diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition.lean b/lean/OAI/GroupTheory/PolycyclicRecognition.lean new file mode 100644 index 0000000000000000000000000000000000000000..b8734c0d597192910567490a54f5ba58d8545d49 --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition.lean @@ -0,0 +1,1349 @@ +import OAI.GroupTheory.PolycyclicRecognition.Recognition +import OAI.GroupTheory.PolycyclicRecognition.Algebra.ExpandingLinearRepresentation +import OAI.GroupTheory.PolycyclicRecognition.Algebra.OneSidedDominantDynamics +import OAI.GroupTheory.PolycyclicRecognition.Algebra.TorsionSpectrumFiniteTrace +import OAI.GroupTheory.PolycyclicRecognition.Algebra.SchurTorsionLinearGroups +import OAI.GroupTheory.PolycyclicRecognition.Algebra.NumberFieldTorsionLinearGroups +import OAI.GroupTheory.PolycyclicRecognition.Algebra.FiniteExponentLinearGroups +import OAI.GroupTheory.PolycyclicRecognition.Algebra.AlgebraicExpandingEmbedding +import OAI.GroupTheory.PolycyclicRecognition.Algebra.ValuedDiagonalDominance +import OAI.GroupTheory.PolycyclicRecognition.Algebra.IrreducibleDominantFreePair +import OAI.GroupTheory.PolycyclicRecognition.Algebra.TransverseEigenlineFreePair +import OAI.GroupTheory.PolycyclicRecognition.Algebra.GromovLinearReduction +import OAI.GroupTheory.PolycyclicRecognition.Geometry.DominantEigenlineContraction +import OAI.GroupTheory.PolycyclicRecognition.Algebra.PolynomialGrowthPingPong +import OAI.GroupTheory.PolycyclicRecognition.Algebra.PolycyclicPolynomialNilpotence +import OAI.GroupTheory.PolycyclicRecognition.Algebra.AbelianKernelPolynomialNilpotence +import OAI.GroupTheory.PolycyclicRecognition.Algebra.ConjugationDualSpectrum +import OAI.GroupTheory.PolycyclicRecognition.Algebra.SolvablePolynomialGrowthPolycyclic +import OAI.GroupTheory.PolycyclicRecognition.Algebra.CyclicKernelPolynomialGrowth +import OAI.GroupTheory.PolycyclicRecognition.Algebra.PolynomialGrowthImages +import OAI.GroupTheory.PolycyclicRecognition.Algebra.PolynomialGrowthLinearImage +import OAI.GroupTheory.PolycyclicRecognition.Analysis.PolynomialHarmonicFiniteDimensional +import OAI.GroupTheory.PolycyclicRecognition.Analysis.HarmonicVolumeDeterminant +import OAI.GroupTheory.PolycyclicRecognition.Analysis.WordBallGramOrder +import OAI.GroupTheory.PolycyclicRecognition.Analysis.HarmonicAveragingDimension +import OAI.GroupTheory.PolycyclicRecognition.Analysis.HarmonicGoodScales +import OAI.GroupTheory.PolycyclicRecognition.Analysis.CayleyBallCutoff +import OAI.GroupTheory.PolycyclicRecognition.RecognitionFromGromov +import OAI.GroupTheory.PolycyclicRecognition.Geometry.HeightKernelVirtualSolvable +import OAI.GroupTheory.PolycyclicRecognition.Algebra.FiniteRationalRepresentation +import OAI.GroupTheory.PolycyclicRecognition.Algebra.UniformLocalVirtualSolvability +import OAI.GroupTheory.PolycyclicRecognition.Geometry.HeightKernelNilpotentStructure +import OAI.GroupTheory.PolycyclicRecognition.Algebra.RationalLocallyNilpotentDimension +import OAI.GroupTheory.PolycyclicRecognition.Geometry.HeightKernelTorsionBound +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.LocalInductionVanishing +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.SmallCoefficientCompletedUnit +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.IntegerProjectiveCoefficientDimension +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.SubgroupInductionDimension +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.SmallCoefficientRing +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.CountableSumVanishing +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.FiniteStabilizerSumVanishing +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.CompleteCohomologyFiniteResolution +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.CompleteCohomologyMiddleExact +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.HorseshoeSyzygySequence +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.ProjectiveKernelStableMap +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.CompleteCohomologyConnecting +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.CompletedCohomologyAdditive +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.InducedFiniteRationalVanishing +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.CompletedCohomologyColimitSurjectivity +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.NormalizedStableSyzygyMap +import OAI.GroupTheory.PolycyclicRecognition.Algebra.RationalCompleteIdentity +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.CompletedIdentityTorsion +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.CompletedIdentity +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.CompletedCohomologyFinitary +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.CompletedCohomologyProjective +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.FinitePresentationSyzygies +import OAI.GroupTheory.PolycyclicRecognition.Algebra.SequentialHomLimit +import OAI.GroupTheory.PolycyclicRecognition.Algebra.BoundedLocallyFiniteKernel +import OAI.GroupTheory.PolycyclicRecognition.Algebra.NilpotentByAbelianRationalDimension +import OAI.GroupTheory.PolycyclicRecognition.Algebra.NilpotentTorsionQuotientEndgame +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.LocallyFiniteRationalHomology +import OAI.GroupTheory.PolycyclicRecognition.Algebra.RationalNormalExtensionBound +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.NilpotentNormalRationalHomology +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.RationalNormalExtensionHomology +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.NormalExtensionHomologyVanishing +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.NormalExtensionColumnHomology +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.NormalExtensionTotalHomology +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.BicomplexTotalComparison +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.ProjectiveCoefficientHomology +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.NormalExtensionBicomplex +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.NormalCentralHomologyExact +import OAI.GroupTheory.PolycyclicRecognition.Algebra.CentralDerivedTransgression +import OAI.GroupTheory.PolycyclicRecognition.Algebra.RationalCentralTransgression +import OAI.GroupTheory.PolycyclicRecognition.Algebra.CentralExtensionTransgressionExact +import OAI.GroupTheory.PolycyclicRecognition.Algebra.CentralTransgressionNaturality +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.NormalFirstHomologyAbelianization +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.NilpotentFirstHomologyDimension +import OAI.GroupTheory.PolycyclicRecognition.Algebra.NilpotentAbelianizedDimension +import OAI.GroupTheory.PolycyclicRecognition.Algebra.ClassTwoFiniteDimension +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CommutatorBarBoundary +import OAI.GroupTheory.PolycyclicRecognition.Algebra.VirtuallyMetabelianRecognition +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.AbelianNormalFinitenessEndgame +import OAI.GroupTheory.PolycyclicRecognition.Algebra.TupleBarExteriorProduct +import OAI.GroupTheory.PolycyclicRecognition.Algebra.ScalarMultilinearExtension +import OAI.GroupTheory.PolycyclicRecognition.Algebra.AlternatingBarPermutation +import OAI.GroupTheory.PolycyclicRecognition.Algebra.AbelianNormalLargePrimeRank +import OAI.GroupTheory.PolycyclicRecognition.Algebra.AbelianNormalFiniteDimension +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.AbelianNormalHigherExteriorFiniteness +import OAI.GroupTheory.PolycyclicRecognition.Analysis.ExteriorShiftIntegrality +import OAI.GroupTheory.PolycyclicRecognition.Algebra.PolynomialOrbitExterior +import OAI.GroupTheory.PolycyclicRecognition.Algebra.FiniteAlgebraIndependentBound +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.AbelianNormalExteriorFiniteness +import OAI.GroupTheory.PolycyclicRecognition.Algebra.CyclicExteriorFiniteRank +import OAI.GroupTheory.PolycyclicRecognition.Algebra.AbelianCyclicFiniteDimension +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.AbelianCyclicFinitenessEndgame +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanUnitarySublinear +import OAI.GroupTheory.PolycyclicRecognition.Lattices.AbelianCyclicFiniteIndexLattice +import OAI.GroupTheory.PolycyclicRecognition.Lattices.NilpotentLatticeDerivationLog +import OAI.GroupTheory.PolycyclicRecognition.Geometry.SemisimpleLieLogarithm +import OAI.GroupTheory.PolycyclicRecognition.Lattices.NilpotentLatticeSemisimpleAction +import OAI.GroupTheory.PolycyclicRecognition.Algebra.NilpotentByCyclicRealization +import OAI.GroupTheory.PolycyclicRecognition.Algebra.NilpotentByAbelianSplitRealization +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.AscendingFinitenessEndgame +import OAI.GroupTheory.PolycyclicRecognition.Algebra.NilpotentContractorEndgame +import OAI.GroupTheory.PolycyclicRecognition.Analysis.ControlledMetricFolner +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.ReducedCohomologyDescent +import OAI.GroupTheory.PolycyclicRecognition.Algebra.InvariantFactorComponents +import OAI.GroupTheory.PolycyclicRecognition.Algebra.ConditionalKernelConsistency +import OAI.GroupTheory.PolycyclicRecognition.Analysis.CountableErgodicComponents +import OAI.GroupTheory.PolycyclicRecognition.Analysis.NormalizedPairErgodicDecomposition +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.SolvablePoincareFiniteness +import OAI.GroupTheory.PolycyclicRecognition.Algebra.RationalInvariantTopClass +import OAI.GroupTheory.PolycyclicRecognition.Algebra.BarAutomorphism +import OAI.GroupTheory.PolycyclicRecognition.Algebra.RationalOrientationExtension +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.NormalHomologyQuotient +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.NilpotentCyclicDuality +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.LatticeTopHomologyInjection +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.NilpotentLatticeDuality +import OAI.GroupTheory.PolycyclicRecognition.Algebra.TopOrientationAutomorphisms +import OAI.GroupTheory.PolycyclicRecognition.Lattices.TriangulableLatticePolycyclic +import OAI.GroupTheory.PolycyclicRecognition.Lattices.SolvableLatticePolycyclic +import OAI.GroupTheory.PolycyclicRecognition.Geometry.DiscreteAbelianHeightKernel +import OAI.GroupTheory.PolycyclicRecognition.Algebra.ConditionalGroupRecognition +import OAI.GroupTheory.PolycyclicRecognition.Algebra.NilpotentModelConstruction +import OAI.GroupTheory.PolycyclicRecognition.Algebra.PolynomialUnipotentModel +import OAI.GroupTheory.PolycyclicRecognition.Algebra.PolynomialMatrixLogarithm +import OAI.GroupTheory.PolycyclicRecognition.Algebra.HomogeneousWordCoefficients +import OAI.GroupTheory.PolycyclicRecognition.Algebra.TruncatedPrimitiveCoefficients +import OAI.GroupTheory.PolycyclicRecognition.Geometry.BoundedAssociativeBCH +import OAI.GroupTheory.PolycyclicRecognition.Algebra.ConstructedNilpotentInputs +import OAI.GroupTheory.PolycyclicRecognition.Algebra.FaithfulGroupDynkin +import OAI.GroupTheory.PolycyclicRecognition.FiniteCovolumeLattice +import OAI.GroupTheory.PolycyclicRecognition.ConditionalBoundedHeight +import OAI.GroupTheory.PolycyclicRecognition.Algebra.ConditionalRecognition +import OAI.GroupTheory.PolycyclicRecognition.Geometry.UniformCoarseCartanHeight +import OAI.GroupTheory.PolycyclicRecognition.Geometry.RecognitionFromUniformHeight +import OAI.GroupTheory.PolycyclicRecognition.Geometry.UniformCartanPublishedCharts +import OAI.GroupTheory.PolycyclicRecognition.Algebra.UnitNetPartition +import OAI.GroupTheory.PolycyclicRecognition.Geometry.ControlledContraction +import OAI.GroupTheory.PolycyclicRecognition.Algebra.MassFractionBounds +import OAI.GroupTheory.PolycyclicRecognition.Analysis.LipschitzInversePairBounds +import OAI.GroupTheory.PolycyclicRecognition.Algebra.PerturbedInversePairs +import OAI.GroupTheory.PolycyclicRecognition.Geometry.UniformCartanHeight +import OAI.GroupTheory.PolycyclicRecognition.Algebra.RecognitionFromPairRepresentatives +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanChosenSamplingHeight +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanPublishedBoundedHeight +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanBoundaryBoundedHeight +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanBoundaryRetainedRay +import OAI.GroupTheory.PolycyclicRecognition.Geometry.NormalizedPairBackwardHeight +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanBoundaryAveraging +import OAI.GroupTheory.PolycyclicRecognition.Geometry.BoundaryFamilyHomeomorphism +import OAI.GroupTheory.PolycyclicRecognition.Geometry.BoundaryFamilyMass +import OAI.GroupTheory.PolycyclicRecognition.Geometry.BoundaryMapFamily +import OAI.GroupTheory.PolycyclicRecognition.Geometry.BoundaryPublishedMetricAveraging +import OAI.GroupTheory.PolycyclicRecognition.Geometry.BoundaryVolumeComparison +import OAI.GroupTheory.PolycyclicRecognition.Geometry.BoundaryVolumeAveraging +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanBoundaryLeafTemplate +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanBoundaryRayMatching +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanRayBoundaryComparison +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanRayBoundaryFamily +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanRayBoundaryHaar +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanRayBoundaryHomeomorphism +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanRayBoundaryInverse +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanRayBoundaryMass +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanRayBoundaryModel +import OAI.GroupTheory.PolycyclicRecognition.Algebra.TemplateInverseRays +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanBoundaryFamilyShadow +import OAI.GroupTheory.PolycyclicRecognition.Geometry.SublinearHeightComposition +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanInverseCoefficients +import OAI.GroupTheory.PolycyclicRecognition.Algebra.NormalizedPairInverseLabels +import OAI.GroupTheory.PolycyclicRecognition.Algebra.BasepointLabelStabilization +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanBasepointConcentration +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanMetricBasepointComparison +import OAI.GroupTheory.PolycyclicRecognition.Analysis.CompactProfileEstimates +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanPublishedProfileEstimates +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanPublishedBasepointComparison +import OAI.GroupTheory.PolycyclicRecognition.Geometry.UniformBasepointHeight +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanPublishedSublinearHeight +import OAI.GroupTheory.PolycyclicRecognition.Analysis.ExactProfileTransport +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanBasepointProfileIdentity +import OAI.GroupTheory.PolycyclicRecognition.Analysis.DominatedAffineComparison +import OAI.GroupTheory.PolycyclicRecognition.Analysis.BasepointAffineSeparation +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanMetricBasepointSampling +import OAI.GroupTheory.PolycyclicRecognition.Analysis.WordBallLeftShift +import OAI.GroupTheory.PolycyclicRecognition.Analysis.DominatedAffineLabels +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanBasepointAffineComparison +import OAI.GroupTheory.PolycyclicRecognition.Analysis.EventualSupportedSampling +import OAI.GroupTheory.PolycyclicRecognition.Analysis.WordBallSamplingSequence +import OAI.GroupTheory.PolycyclicRecognition.Analysis.BasepointCellDomination +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanBasepointBoxes +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanBasepointCellDomination +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanBasepointFactorCover +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanBasepointGeometryOfBounds +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanMetricBasepointGeometry +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanMetricLogChartShift +import OAI.GroupTheory.PolycyclicRecognition.Algebra.PositiveWidthSmallLog +import OAI.GroupTheory.PolycyclicRecognition.Analysis.WordChartLogBound +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanMetricChartShift +import OAI.GroupTheory.PolycyclicRecognition.Analysis.BasepointProfileIdentity +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanConjugationHeightBound +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanSmallMetricFactors +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanSmallWordFactors +import OAI.GroupTheory.PolycyclicRecognition.Analysis.DominatedProfileConcentration +import OAI.GroupTheory.PolycyclicRecognition.Algebra.SmallDistanceRatio +import OAI.GroupTheory.PolycyclicRecognition.Analysis.TranslatedCellDomination +import OAI.GroupTheory.PolycyclicRecognition.Algebra.UniformDynkinDifference +import OAI.GroupTheory.PolycyclicRecognition.Analysis.WordChartLeftShift +import OAI.GroupTheory.PolycyclicRecognition.Analysis.WordChartSmallProducts +import OAI.GroupTheory.PolycyclicRecognition.Analysis.WordChartTranslations +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanPublishedUniformScale +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanCanonicalProfiles +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanOrdinaryMetricBound +import OAI.GroupTheory.PolycyclicRecognition.Analysis.AffineScaleStabilization +import OAI.GroupTheory.PolycyclicRecognition.Analysis.AllScaleProfileEquicontinuity +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanActualScaleComparison +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanPublishedMixedScaleConcentration +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanPublishedScaleStabilization +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanScaleTransition +import OAI.GroupTheory.PolycyclicRecognition.Analysis.CompactSamplingMean +import OAI.GroupTheory.PolycyclicRecognition.Analysis.DeterministicProbabilityComparison +import OAI.GroupTheory.PolycyclicRecognition.Analysis.DifferentCellDomination +import OAI.GroupTheory.PolycyclicRecognition.Analysis.LinearProfilesOnBall +import OAI.GroupTheory.PolycyclicRecognition.Analysis.MeanProbabilityConverse +import OAI.GroupTheory.PolycyclicRecognition.Analysis.MixedCellConcentration +import OAI.GroupTheory.PolycyclicRecognition.Analysis.MixedScaleBasisBound +import OAI.GroupTheory.PolycyclicRecognition.Analysis.ProfileLawIntegral +import OAI.GroupTheory.PolycyclicRecognition.Analysis.ProfileLawProduct +import OAI.GroupTheory.PolycyclicRecognition.Algebra.RealParameterEquicontinuity +import OAI.GroupTheory.PolycyclicRecognition.Analysis.RescaledAffineComparison +import OAI.GroupTheory.PolycyclicRecognition.Analysis.ScaleLabelStabilization +import OAI.GroupTheory.PolycyclicRecognition.Geometry.UniversalAllScaleCartanProfiles +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanPublishedAffineMean +import OAI.GroupTheory.PolycyclicRecognition.Analysis.FiniteAffineSelection +import OAI.GroupTheory.PolycyclicRecognition.Analysis.WordChartScaleTransition +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanMixedScaleBoxes +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanPublishedOrdinaryConcentration +import OAI.GroupTheory.PolycyclicRecognition.Analysis.AffineMeanApproximation +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanCellProfileConcentration +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanTiledSourceEndpoints +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanFixedProbeBridge +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanSampledProbeFrames +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanProfilePivot +import OAI.GroupTheory.PolycyclicRecognition.Analysis.ConeSourceCellVolumes +import OAI.GroupTheory.PolycyclicRecognition.Analysis.LinkedProbeOffset +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanConcentratedFrames +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanTiledOffsetRates +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanSampledBridge +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanUniformCommonAffinity +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanCommonCellAffinity +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanFullCellAffinity +import OAI.GroupTheory.PolycyclicRecognition.Analysis.ConditionedGoodProbeOffset +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanUniformNeighborLabels +import OAI.GroupTheory.PolycyclicRecognition.Algebra.SequenceSubexponentialRate +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanNeighborSuffixRate +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanNeighborBoxAffinity +import OAI.GroupTheory.PolycyclicRecognition.Analysis.CellProbabilityTransport +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanCellTransport +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanCellPairLaws +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanCellProfileAffinity +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanNeighborProfileAffinity +import OAI.GroupTheory.PolycyclicRecognition.Analysis.ShrinkingProfileDomains +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanRootBoxes +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanDiagonalNeighborLabels +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanEventualNeighborLabels +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanSamplingFacet +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanGoodFacetAgreement +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanGoodRootNeighborLabels +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanGoodTemplateComparison +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanShrinkingBoxEnvelope +import OAI.GroupTheory.PolycyclicRecognition.Analysis.DiagonalCellProfilePairs +import OAI.GroupTheory.PolycyclicRecognition.Analysis.DiagonalAffineCellProfiles +import OAI.GroupTheory.PolycyclicRecognition.Analysis.GoodSheetProfileAgreement +import OAI.GroupTheory.PolycyclicRecognition.Geometry.AffineProfileBoundary +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanCellProbability +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanCellProfileComparison +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanCommonBundlePaths +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanComparisonSchemes +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanCoupledProfileComparison +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanFacetSupportedAgreement +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanRootNeighborLabels +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanSourceBundleTerminals +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanSupportedTemplateComparison +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanTargetBundlePaths +import OAI.GroupTheory.PolycyclicRecognition.Analysis.DiagonalProfileSampling +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanCoupledTargetTuples +import OAI.GroupTheory.PolycyclicRecognition.Algebra.SuccessfulSourceWord +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanSuccessfulBundlePaths +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanSourceProfile +import OAI.GroupTheory.PolycyclicRecognition.Analysis.BridgedProfileBounds +import OAI.GroupTheory.PolycyclicRecognition.Analysis.SourceBundleTerminalPaths +import OAI.GroupTheory.PolycyclicRecognition.Analysis.ReachableTuplePaths +import OAI.GroupTheory.PolycyclicRecognition.Algebra.CenteredSourceTerminals +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanSourceTargetComparison +import OAI.GroupTheory.PolycyclicRecognition.Geometry.SheetEndpointHeight +import OAI.GroupTheory.PolycyclicRecognition.Analysis.SequenceCellProfilePairs +import OAI.GroupTheory.PolycyclicRecognition.Algebra.GoodFiniteWordVertices +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanGoodWordPaths +import OAI.GroupTheory.PolycyclicRecognition.Algebra.ShortSheetBridges +import OAI.GroupTheory.PolycyclicRecognition.Analysis.ConjugatedSheetPaths +import OAI.GroupTheory.PolycyclicRecognition.Algebra.FacetPivotBridgeRate +import OAI.GroupTheory.PolycyclicRecognition.Analysis.CenteredTuplePaths +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanAlternatingLimit +import OAI.GroupTheory.PolycyclicRecognition.Analysis.SourceBundleBlockPaths +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanPathAlternatingComparison +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanSourceTerminalCover +import OAI.GroupTheory.PolycyclicRecognition.Algebra.CoupledBundleStates +import OAI.GroupTheory.PolycyclicRecognition.Analysis.CorrelatedAlternatingHaar +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanAlternatingComparison +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanSeparatedAlternatingComparison +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanCoupledRecurrenceCells +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanCoupledSourceImage +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CoupledRootIntervals +import OAI.GroupTheory.PolycyclicRecognition.Analysis.SequencePathCover +import OAI.GroupTheory.PolycyclicRecognition.Algebra.GoodSourceBundleImage +import OAI.GroupTheory.PolycyclicRecognition.Analysis.SourceBundlePaths +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanSourceTuplePacking +import OAI.GroupTheory.PolycyclicRecognition.Analysis.EventualLiftVolumeCover +import OAI.GroupTheory.PolycyclicRecognition.Algebra.AlternatingProductImage +import OAI.GroupTheory.PolycyclicRecognition.Algebra.RescaledTwoImageLimit +import OAI.GroupTheory.PolycyclicRecognition.Algebra.AlternatingPolynomialCoordinates +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanLiftMultiplicity +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanSeparatedTuples +import OAI.GroupTheory.PolycyclicRecognition.Analysis.SequenceTupleVolume +import OAI.GroupTheory.PolycyclicRecognition.Analysis.LiftVolumeCover +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanTuplePerturbation +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.CartanVanishingHeight +import OAI.GroupTheory.PolycyclicRecognition.Analysis.SeparatedTupleVolume +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanFacetProfileAgreement +import OAI.GroupTheory.PolycyclicRecognition.Algebra.FacetReflectionTemplates +import OAI.GroupTheory.PolycyclicRecognition.Geometry.ContactFlowTime +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanPolarProbeTemplates +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanSelectedProbePaths +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanAllowedProbeChains +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanSamplingParameters +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanActualProbeProfiles +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanActualChainConcentration +import OAI.GroupTheory.PolycyclicRecognition.Analysis.ProductProbeSelection +import OAI.GroupTheory.PolycyclicRecognition.Analysis.RetainedProbeAnchors +import OAI.GroupTheory.PolycyclicRecognition.Analysis.MeasuredGoodProbeOffset +import OAI.GroupTheory.PolycyclicRecognition.Analysis.SectionProbeReparametrization +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanPolarFlowTiling +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanPolarTiledChains +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanLinkedProbeChains +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanLinkedProbePaths +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanLinkedChainConcentration +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanLinkedProfileSelection +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanPolarTiledSamplers +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanDilatedLinkedChains +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanTiledProbeEndpoints +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanUniformMeasuredRegions +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanProbeInteriorHeights +import OAI.GroupTheory.PolycyclicRecognition.Analysis.PolarProbeImages +import OAI.GroupTheory.PolycyclicRecognition.Analysis.ThreeProbeConcentration +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanTiledProbeBoxes +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanTiledProbeChains +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanDilatedProbeChains +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanTranslatedProbeChains +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanMeasurableBoxChains +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanProbeChainSequence +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanBoxProbeChains +import OAI.GroupTheory.PolycyclicRecognition.Analysis.ConeProbeIntrinsicTiles +import OAI.GroupTheory.PolycyclicRecognition.Geometry.ConeIdealFlowConjugation +import OAI.GroupTheory.PolycyclicRecognition.Analysis.TiledProbeSamplers +import OAI.GroupTheory.PolycyclicRecognition.Analysis.CompactProbeSequence +import OAI.GroupTheory.PolycyclicRecognition.Analysis.SupportedChainProbeSelection +import OAI.GroupTheory.PolycyclicRecognition.Analysis.FiniteProfileEnvelope +import OAI.GroupTheory.PolycyclicRecognition.Analysis.ProbeImageGeometry +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanUniformImagePaths +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanThreeTemplatePaths +import OAI.GroupTheory.PolycyclicRecognition.Analysis.SupportedAffineProbeSelection +import OAI.GroupTheory.PolycyclicRecognition.Analysis.CompactProbeLift +import OAI.GroupTheory.PolycyclicRecognition.Analysis.SectionSubtypeProbePacking +import OAI.GroupTheory.PolycyclicRecognition.Analysis.RescaledProbeChains +import OAI.GroupTheory.PolycyclicRecognition.Analysis.MeasurableProbeProfiles +import OAI.GroupTheory.PolycyclicRecognition.Analysis.ProbeTileSelector +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanSectionProbeBox +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanProbeChainDilation +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanLogRegionVolume +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanFactorLogVolume +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanKernelRegionVolume +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanProbeCoordinateRegions +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanMeasuredProbeRegions +import OAI.GroupTheory.PolycyclicRecognition.Analysis.MeasuredProbeRegions +import OAI.GroupTheory.PolycyclicRecognition.Analysis.MeasuredProbeOffset +import OAI.GroupTheory.PolycyclicRecognition.Analysis.MeasuredTwoPathOffset +import OAI.GroupTheory.PolycyclicRecognition.Analysis.MeasuredRegionOffset +import OAI.GroupTheory.PolycyclicRecognition.Algebra.QuotientSectionIndependence +import OAI.GroupTheory.PolycyclicRecognition.Analysis.ProbeImageTileCover +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanConeIdealExponent +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanConeHaarAction +import OAI.GroupTheory.PolycyclicRecognition.Analysis.SectionProbePacking +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanWeightHaar +import OAI.GroupTheory.PolycyclicRecognition.Analysis.ProbeRestrictionComposition +import OAI.GroupTheory.PolycyclicRecognition.Analysis.ProbeImageBridge +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanTwoPathProbeRestrictions +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanProfileBridgeRestriction +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanIntrinsicBridge +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanProfileEndpointLifts +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanProfileQuotientRestriction +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanMappedTemplatePaths +import OAI.GroupTheory.PolycyclicRecognition.Analysis.ConeAdaptedPathBasis +import OAI.GroupTheory.PolycyclicRecognition.Analysis.ConeProbeRestrictionPacking +import OAI.GroupTheory.PolycyclicRecognition.Analysis.ProbeKernelVolume +import OAI.GroupTheory.PolycyclicRecognition.Geometry.WeightedHaarVolume +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanFactorHaarInvariance +import OAI.GroupTheory.PolycyclicRecognition.Analysis.ProbeSourcePacking +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanSelectedProfilePaths +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanTemplateProfilePaths +import OAI.GroupTheory.PolycyclicRecognition.Analysis.ProbeAnchorHaarBounds +import OAI.GroupTheory.PolycyclicRecognition.Analysis.ConeProfileOffsetPacking +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanPivotSupportSwitch +import OAI.GroupTheory.PolycyclicRecognition.Geometry.RescaledHeightLegs +import OAI.GroupTheory.PolycyclicRecognition.Analysis.ControlledPathErrorEnvelope +import OAI.GroupTheory.PolycyclicRecognition.Analysis.AffineProfileControlledPaths +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanIndependentChainConcentration +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanMeasurableGeneratorChains +import OAI.GroupTheory.PolycyclicRecognition.Analysis.MeasurableGeneratorChain +import OAI.GroupTheory.PolycyclicRecognition.Geometry.MovingBaseFlow +import OAI.GroupTheory.PolycyclicRecognition.Algebra.RescaledPivotLegs +import OAI.GroupTheory.PolycyclicRecognition.Geometry.ProfileChainHeightBounds +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanMeasurableTemplateCoding +import OAI.GroupTheory.PolycyclicRecognition.Algebra.MeasurableGeneratorPrefixes +import OAI.GroupTheory.PolycyclicRecognition.Analysis.FiniteSupportChainPaths +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanInteriorProfileHeights +import OAI.GroupTheory.PolycyclicRecognition.Analysis.SupportedProbeSelection +import OAI.GroupTheory.PolycyclicRecognition.Analysis.SupportedPairAgreement +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanIndependentBoxConcentration +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanBoxIncrementConcentration +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanRawChainConcentration +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanSupportedCellAgreement +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanSupportedCellLipschitz +import OAI.GroupTheory.PolycyclicRecognition.Analysis.CellProfileRestriction +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanAllowedProfileCompactness +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanDependentProfileCompactness +import OAI.GroupTheory.PolycyclicRecognition.Analysis.ProfileParameterContinuity +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanSuffixGeneratorSequence +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanDominatedGeneratorChain +import OAI.GroupTheory.PolycyclicRecognition.Algebra.DominatedWordPrefixes +import OAI.GroupTheory.PolycyclicRecognition.Analysis.RescaledTranslatedChains +import OAI.GroupTheory.PolycyclicRecognition.Algebra.RescaledWordPrefixes +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanGeneratorPrefixes +import OAI.GroupTheory.PolycyclicRecognition.Algebra.GeneratorWordPadding +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanGeneratorChain +import OAI.GroupTheory.PolycyclicRecognition.Algebra.BoundedPrefixEnvelope +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanGeneratorSequence +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanProfileChainConcentration +import OAI.GroupTheory.PolycyclicRecognition.Algebra.PolynomialPrefixEnvelope +import OAI.GroupTheory.PolycyclicRecognition.Algebra.RescaledProductEnvelope +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanBoundedHeightEndgame +import OAI.GroupTheory.PolycyclicRecognition.Geometry.BoundaryAveragedTrace +import OAI.GroupTheory.PolycyclicRecognition.Geometry.NilpotentBoundaryAveraging +import OAI.GroupTheory.PolycyclicRecognition.Geometry.BoundaryImageMass +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanBoundaryLeaf +import OAI.GroupTheory.PolycyclicRecognition.Algebra.PositiveRayPullback +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanLeafHeight +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanRayTrace +import OAI.GroupTheory.PolycyclicRecognition.Geometry.BoundaryGeneratorHeight +import OAI.GroupTheory.PolycyclicRecognition.Geometry.BoundaryVolumeComparison +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanBoundaryHaarAction +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanBoundaryGeneratorAction +import OAI.GroupTheory.PolycyclicRecognition.Geometry.BoundaryRaySeparation +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanBoundaryTopology +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanBoundaryInverse +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanBoundaryShadow +import OAI.GroupTheory.PolycyclicRecognition.Algebra.FactorTrajectoryIncrements +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanBoundaryOrbitFibers +import OAI.GroupTheory.PolycyclicRecognition.Analysis.CompactLiftQuotient +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanIdealFiberAsymptotics +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CenteredHeightError +import OAI.GroupTheory.PolycyclicRecognition.Geometry.ExponentialCoarseMetric +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanNegativeChainAsymptotics +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanRayFactorContraction +import OAI.GroupTheory.PolycyclicRecognition.Geometry.RayTangentContraction +import OAI.GroupTheory.PolycyclicRecognition.Analysis.CoarseNegativeQuotient +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanPivotWordImage +import OAI.GroupTheory.PolycyclicRecognition.Analysis.FiniteModeProfileChains +import OAI.GroupTheory.PolycyclicRecognition.Analysis.NegativePathWords +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanRayFiberPaths +import OAI.GroupTheory.PolycyclicRecognition.Analysis.QuotientChainDecay +import OAI.GroupTheory.PolycyclicRecognition.Analysis.FactorQuotientChainDecay +import OAI.GroupTheory.PolycyclicRecognition.Geometry.MetricCartanFactorBounds +import OAI.GroupTheory.PolycyclicRecognition.Analysis.LogarithmicBoxScale +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanNLogMetric +import OAI.GroupTheory.PolycyclicRecognition.Analysis.SequenceLogMetric +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanPivotCancellation +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanPivotCoordinateBound +import OAI.GroupTheory.PolycyclicRecognition.Analysis.ProbePivotBridge +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanProbeBridgeLength +import OAI.GroupTheory.PolycyclicRecognition.Geometry.SequenceSmallExponentialProducts +import OAI.GroupTheory.PolycyclicRecognition.Analysis.NormalizedProbeGenerator +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanCompactProbeBridge +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanContactProbeBridge +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanPivotWordPath +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanPivotTemplateCoding +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanBridgeGeometry +import OAI.GroupTheory.PolycyclicRecognition.Analysis.ProbeSectionRestrictions +import OAI.GroupTheory.PolycyclicRecognition.Analysis.CenteredImagePaths +import OAI.GroupTheory.PolycyclicRecognition.Analysis.MetricFactorComparison +import OAI.GroupTheory.PolycyclicRecognition.Analysis.MetricFactorBounds +import OAI.GroupTheory.PolycyclicRecognition.Analysis.SequenceMetricFactorBounds +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanBridgeAbsorption +import OAI.GroupTheory.PolycyclicRecognition.Geometry.SequenceCartanProducts +import OAI.GroupTheory.PolycyclicRecognition.Algebra.FactorBridgeComposition +import OAI.GroupTheory.PolycyclicRecognition.Geometry.ExponentialBridgeComposition +import OAI.GroupTheory.PolycyclicRecognition.Analysis.AnchoredTilePacking +import OAI.GroupTheory.PolycyclicRecognition.Geometry.BoundaryFromLogProducts +import OAI.GroupTheory.PolycyclicRecognition.Algebra.RayHalfspace +import OAI.GroupTheory.PolycyclicRecognition.Algebra.RayMixedWidths +import OAI.GroupTheory.PolycyclicRecognition.Algebra.RayIdealTemplates +import OAI.GroupTheory.PolycyclicRecognition.Algebra.RayIdealConjugation +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanPathQuotientRestriction +import OAI.GroupTheory.PolycyclicRecognition.Geometry.ConeHeightMultiplier +import OAI.GroupTheory.PolycyclicRecognition.Analysis.ConeOffsetPacking +import OAI.GroupTheory.PolycyclicRecognition.Analysis.SequenceConeQuotientBoxes +import OAI.GroupTheory.PolycyclicRecognition.Algebra.DynkinProductTails +import OAI.GroupTheory.PolycyclicRecognition.Algebra.UniformDynkinProducts +import OAI.GroupTheory.PolycyclicRecognition.Geometry.SequenceCartanPathLifts +import OAI.GroupTheory.PolycyclicRecognition.Analysis.ZeroWidthQuotientBoxes +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanSmallHeight +import OAI.GroupTheory.PolycyclicRecognition.Algebra.ConeQuotientBounds +import OAI.GroupTheory.PolycyclicRecognition.Geometry.RayQuotientContraction +import OAI.GroupTheory.PolycyclicRecognition.Geometry.RayGroupContraction +import OAI.GroupTheory.PolycyclicRecognition.Algebra.DynkinSummableProducts +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CanonicalHeightIntegration +import OAI.GroupTheory.PolycyclicRecognition.Geometry.HeightLipschitz +import OAI.GroupTheory.PolycyclicRecognition.Analysis.SequenceTilePacking +import OAI.GroupTheory.PolycyclicRecognition.Analysis.SupportWordImage +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanPathLifts +import OAI.GroupTheory.PolycyclicRecognition.Geometry.BoundaryLimits +import OAI.GroupTheory.PolycyclicRecognition.Analysis.WordBoxComparison +import OAI.GroupTheory.PolycyclicRecognition.Analysis.TemplateBoxEnvelopes +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanCompactTemplatePaths +import OAI.GroupTheory.PolycyclicRecognition.Analysis.GeneratorPrefixChain +import OAI.GroupTheory.PolycyclicRecognition.Geometry.SequenceConeIdealFlowTiling +import OAI.GroupTheory.PolycyclicRecognition.Analysis.SequenceSectionTileVolume +import OAI.GroupTheory.PolycyclicRecognition.Lattices.LatticeCharacterization +import OAI.GroupTheory.PolycyclicRecognition.Lattices.RecognitionLatticeAssembly +import OAI.GroupTheory.PolycyclicRecognition.Algebra.SequenceRealExtension +import OAI.GroupTheory.PolycyclicRecognition.Geometry.SequenceWeightedSectionError +import OAI.GroupTheory.PolycyclicRecognition.Algebra.BoundedInverseCoding +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanBoundedTemplatePaths +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanTemplateSupports +import OAI.GroupTheory.PolycyclicRecognition.Analysis.ProfileChainConcentration +import OAI.GroupTheory.PolycyclicRecognition.Geometry.LieModelUnimodular +import OAI.GroupTheory.PolycyclicRecognition.Geometry.LieModularInput +import OAI.GroupTheory.PolycyclicRecognition.Analysis.CompactSupportSlack +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanCompactSupportSlack +import OAI.GroupTheory.PolycyclicRecognition.Geometry.WeightSamplingSupport +import OAI.GroupTheory.PolycyclicRecognition.Analysis.SubexponentialQuotientVolume +import OAI.GroupTheory.PolycyclicRecognition.Geometry.TriangularLieDifferential +import OAI.GroupTheory.PolycyclicRecognition.Analysis.ConditionedProbeSequence +import OAI.GroupTheory.PolycyclicRecognition.Analysis.ConeProbeEndpoints +import OAI.GroupTheory.PolycyclicRecognition.Algebra.ConeFacetTemplate +import OAI.GroupTheory.PolycyclicRecognition.Analysis.ProbeCellVolume +import OAI.GroupTheory.PolycyclicRecognition.Geometry.WeightSamplingPolytope +import OAI.GroupTheory.PolycyclicRecognition.Analysis.ConeSamplingTemplate +import OAI.GroupTheory.PolycyclicRecognition.Algebra.ConeQuotientRestriction +import OAI.GroupTheory.PolycyclicRecognition.Geometry.TriangularMatrixLieAlgebra +import OAI.GroupTheory.PolycyclicRecognition.Geometry.InvariantTriangularBasis +import OAI.GroupTheory.PolycyclicRecognition.Geometry.TriangularAdjointEmbedding +import OAI.GroupTheory.PolycyclicRecognition.Analysis.ConditionedProbeSelection +import OAI.GroupTheory.PolycyclicRecognition.Geometry.ExponentialQuotientSection +import OAI.GroupTheory.PolycyclicRecognition.Analysis.FactorProductVolumeBound +import OAI.GroupTheory.PolycyclicRecognition.Analysis.HaarMeasureTransfer +import OAI.GroupTheory.PolycyclicRecognition.Analysis.QuotientSectionVolume +import OAI.GroupTheory.PolycyclicRecognition.Analysis.SectionTileVolume +import OAI.GroupTheory.PolycyclicRecognition.Geometry.SimultaneousAdjointBasis +import OAI.GroupTheory.PolycyclicRecognition.Geometry.SplitLieQuotient +import OAI.GroupTheory.PolycyclicRecognition.Geometry.TriangulableLieModel +import OAI.GroupTheory.PolycyclicRecognition.Algebra.ConeSectionBasis +import OAI.GroupTheory.PolycyclicRecognition.Algebra.NilpotentSectionRemainder +import OAI.GroupTheory.PolycyclicRecognition.Geometry.SectionWeightedBoxes +import OAI.GroupTheory.PolycyclicRecognition.Algebra.SectionErrorAbsorption +import OAI.GroupTheory.PolycyclicRecognition.Algebra.IdealProductCoordinates +import OAI.GroupTheory.PolycyclicRecognition.Geometry.WeightedSectionError +import OAI.GroupTheory.PolycyclicRecognition.Analysis.ConeOffsetExponent +import OAI.GroupTheory.PolycyclicRecognition.Algebra.ConeTraceSeparation +import OAI.GroupTheory.PolycyclicRecognition.Analysis.LinearMetricChains +import OAI.GroupTheory.PolycyclicRecognition.Analysis.ProperCocompactMetric +import OAI.GroupTheory.PolycyclicRecognition.Lattices.UniformLatticeFiniteGeneration +import OAI.GroupTheory.PolycyclicRecognition.Lattices.UniformLatticeWordMetric +import OAI.GroupTheory.PolycyclicRecognition.Analysis.MetricQuasiEquivalence +import OAI.GroupTheory.PolycyclicRecognition.Lattices.SolvableLatticeRecognition +import OAI.GroupTheory.PolycyclicRecognition.Geometry.LieModelMetric +import OAI.GroupTheory.PolycyclicRecognition.Analysis.IdealSectionBoxCoordinates +import OAI.GroupTheory.PolycyclicRecognition.Algebra.PositiveWidthAbsorption +import OAI.GroupTheory.PolycyclicRecognition.Analysis.MetricCoarseBridge +import OAI.GroupTheory.PolycyclicRecognition.Algebra.PolycyclicFiniteGeneration +import OAI.GroupTheory.PolycyclicRecognition.Lattices.UniformLatticeMetric +import OAI.GroupTheory.PolycyclicRecognition.Lattices.UniformLatticeQuotient +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.LatticeDualityComparison +import OAI.GroupTheory.PolycyclicRecognition.Analysis.WordMetricBridge +import OAI.GroupTheory.PolycyclicRecognition.Lattices.SolvableLatticeModel +import OAI.GroupTheory.PolycyclicRecognition.Algebra.MaximizingCoordinateCriterion +import OAI.GroupTheory.PolycyclicRecognition.Algebra.BasisQuotientLifts +import OAI.GroupTheory.PolycyclicRecognition.Algebra.ConeIdealBasisExchange +import OAI.GroupTheory.PolycyclicRecognition.Algebra.ConeAdaptedMaximalBasis +import OAI.GroupTheory.PolycyclicRecognition.Algebra.ConeIdealInnerAutomorphism +import OAI.GroupTheory.PolycyclicRecognition.Analysis.ConeIdealInnerHaar +import OAI.GroupTheory.PolycyclicRecognition.Analysis.KernelHaarTransport +import OAI.GroupTheory.PolycyclicRecognition.Analysis.ConeKernelHaar +import OAI.GroupTheory.PolycyclicRecognition.Analysis.QuotientSectionHaar +import OAI.GroupTheory.PolycyclicRecognition.Analysis.FiniteTranslateCover +import OAI.GroupTheory.PolycyclicRecognition.Analysis.FiniteConjugateTiling +import OAI.GroupTheory.PolycyclicRecognition.Geometry.ExponentialBoxCompact +import OAI.GroupTheory.PolycyclicRecognition.Analysis.ConeIdealTiling +import OAI.GroupTheory.PolycyclicRecognition.Geometry.ExponentialVolumeRatio +import OAI.GroupTheory.PolycyclicRecognition.Analysis.ConeIdealMeasuredTiling +import OAI.GroupTheory.PolycyclicRecognition.Geometry.ExponentialAutomorphismTopology +import OAI.GroupTheory.PolycyclicRecognition.Geometry.ConeIdealFlowTiling +import OAI.GroupTheory.PolycyclicRecognition.Algebra.ConePolarTemplate +import OAI.GroupTheory.PolycyclicRecognition.Geometry.IndependentWeightCone +import OAI.GroupTheory.PolycyclicRecognition.Algebra.MixedWordBasis +import OAI.GroupTheory.PolycyclicRecognition.Analysis.MixedWordBoxModel +import OAI.GroupTheory.PolycyclicRecognition.Analysis.ConeIdealBoxCalculus +import OAI.GroupTheory.PolycyclicRecognition.Geometry.ConeIdealInsideAdjoint +import OAI.GroupTheory.PolycyclicRecognition.Geometry.NilpotentCoordinateFlow +import OAI.GroupTheory.PolycyclicRecognition.Algebra.ConeIdealStrictWidth +import OAI.GroupTheory.PolycyclicRecognition.Algebra.ConeIdealGroupConjugation +import OAI.GroupTheory.PolycyclicRecognition.Algebra.QuotientGroupAction +import OAI.GroupTheory.PolycyclicRecognition.Algebra.FactorQuotientAction +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanConeInvariance +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanConeAction +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanConeAmbientAction +import OAI.GroupTheory.PolycyclicRecognition.Geometry.ExponentialHaarMultiplier +import OAI.GroupTheory.PolycyclicRecognition.Geometry.ExponentialHaarImage +import OAI.GroupTheory.PolycyclicRecognition.Algebra.ConeQuotientJacobian +import OAI.GroupTheory.PolycyclicRecognition.Algebra.ConeQuotientAutomorphism +import OAI.GroupTheory.PolycyclicRecognition.Analysis.ConeQuotientHaar +import OAI.GroupTheory.PolycyclicRecognition.Analysis.ConeQuotientHaarAction +import OAI.GroupTheory.PolycyclicRecognition.Algebra.QuotientSectionCoordinates +import OAI.GroupTheory.PolycyclicRecognition.Analysis.QuotientSectionMeasure +import OAI.GroupTheory.PolycyclicRecognition.Algebra.ConeIdealGroup +import OAI.GroupTheory.PolycyclicRecognition.Algebra.MixedWordIdeal +import OAI.GroupTheory.PolycyclicRecognition.Geometry.WeightSpaceWordSpan +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanConeIdeal +import OAI.GroupTheory.PolycyclicRecognition.Algebra.QuotientWordBasis +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanConeTrace +import OAI.GroupTheory.PolycyclicRecognition.Geometry.PositiveWeightCones +import OAI.GroupTheory.PolycyclicRecognition.Algebra.NilpotentQuotientIntegration +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanConeGroup +import OAI.GroupTheory.PolycyclicRecognition.Analysis.AffineSheetAgreement +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanInteriorSwitch +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanSheetAgreement +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanInteriorNeighbor +import OAI.GroupTheory.PolycyclicRecognition.Analysis.AffineProfileConcentration +import OAI.GroupTheory.PolycyclicRecognition.Analysis.UniformProfileConcentration +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanProfileConcentration +import OAI.GroupTheory.PolycyclicRecognition.Analysis.MeasurePreservingLimit +import OAI.GroupTheory.PolycyclicRecognition.Analysis.GradedHaar +import OAI.GroupTheory.PolycyclicRecognition.Algebra.GradedHorizontalStructure +import OAI.GroupTheory.PolycyclicRecognition.Geometry.GradedHeight +import OAI.GroupTheory.PolycyclicRecognition.Geometry.SupportedFlowLipschitz +import OAI.GroupTheory.PolycyclicRecognition.Geometry.RescaledFlowLipschitz +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanGradedGeometry +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanProfileAffinity +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanProfileSegmentVolume +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanSegmentCellPacking +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanIntervalVisits +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanRecurrenceCells +import OAI.GroupTheory.PolycyclicRecognition.Geometry.ExponentialCellMass +import OAI.GroupTheory.PolycyclicRecognition.Algebra.SequenceSubsequences +import OAI.GroupTheory.PolycyclicRecognition.Geometry.FlowSegmentImages +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanGoodCellLegs +import OAI.GroupTheory.PolycyclicRecognition.Geometry.RootIntervalPadding +import OAI.GroupTheory.PolycyclicRecognition.Geometry.ExponentialProfileCells +import OAI.GroupTheory.PolycyclicRecognition.Geometry.SequenceCartanProfileIncrement +import OAI.GroupTheory.PolycyclicRecognition.Geometry.SequenceCartanDenominator +import OAI.GroupTheory.PolycyclicRecognition.Geometry.SequenceCellFlowLegs +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanPivotVisits +import OAI.GroupTheory.PolycyclicRecognition.Geometry.ExponentialGoodCells +import OAI.GroupTheory.PolycyclicRecognition.Geometry.WordChartFlowHeight +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanProfileTemplateIncrement +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanBoxSchemes +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanRecurrentProfilePacking +import OAI.GroupTheory.PolycyclicRecognition.Geometry.SequenceRescaledFlowLegs +import OAI.GroupTheory.PolycyclicRecognition.Analysis.SequenceCellProfiles +import OAI.GroupTheory.PolycyclicRecognition.Algebra.SequenceRecurrentWordImage +import OAI.GroupTheory.PolycyclicRecognition.Algebra.SequenceDifferenceWordImage +import OAI.GroupTheory.PolycyclicRecognition.Analysis.SequenceProfileSampling +import OAI.GroupTheory.PolycyclicRecognition.Geometry.SequenceCartanProfilePacking +import OAI.GroupTheory.PolycyclicRecognition.Analysis.ProfileAffinityCriterion +import OAI.GroupTheory.PolycyclicRecognition.Analysis.LipschitzProfileFTC +import OAI.GroupTheory.PolycyclicRecognition.Analysis.GenericLipschitzProfile +import OAI.GroupTheory.PolycyclicRecognition.Analysis.AffineProfileLines +import OAI.GroupTheory.PolycyclicRecognition.Geometry.FlowLineLabels +import OAI.GroupTheory.PolycyclicRecognition.Geometry.FlowLineAffinity +import OAI.GroupTheory.PolycyclicRecognition.Geometry.ContinuousFlowAffinity +import OAI.GroupTheory.PolycyclicRecognition.Geometry.FiniteFlowSlopes +import OAI.GroupTheory.PolycyclicRecognition.Geometry.LocalFlowLabel +import OAI.GroupTheory.PolycyclicRecognition.Algebra.LocalGeneratorOrbit +import OAI.GroupTheory.PolycyclicRecognition.Algebra.AdmissibleGeneratorWords +import OAI.GroupTheory.PolycyclicRecognition.Algebra.AdmissibleWordOperations +import OAI.GroupTheory.PolycyclicRecognition.Algebra.ParameterizedAdmissibleWords +import OAI.GroupTheory.PolycyclicRecognition.Algebra.AdmissibleConjugateScheme +import OAI.GroupTheory.PolycyclicRecognition.Algebra.PolynomialCoordinateTopology +import OAI.GroupTheory.PolycyclicRecognition.Algebra.LocalCoordinateScheme +import OAI.GroupTheory.PolycyclicRecognition.Algebra.LocalGeneratorAccessibility +import OAI.GroupTheory.PolycyclicRecognition.Geometry.FlowStepIteration +import OAI.GroupTheory.PolycyclicRecognition.Analysis.LocalProfileAffinity +import OAI.GroupTheory.PolycyclicRecognition.Analysis.AffineProfileGluing +import OAI.GroupTheory.PolycyclicRecognition.Geometry.FlowNeighborhoods +import OAI.GroupTheory.PolycyclicRecognition.Analysis.GlobalProfileAffinity +import OAI.GroupTheory.PolycyclicRecognition.Geometry.HorizontalLinearDerivative +import OAI.GroupTheory.PolycyclicRecognition.Geometry.RecognitionFromAffineHeight +import OAI.GroupTheory.PolycyclicRecognition.Algebra.ExtremeTemplateLabels +import OAI.GroupTheory.PolycyclicRecognition.Algebra.ChamberBase +import OAI.GroupTheory.PolycyclicRecognition.Algebra.ChamberExtremeDirections +import OAI.GroupTheory.PolycyclicRecognition.Algebra.HorizontalExtremeSpanning +import OAI.GroupTheory.PolycyclicRecognition.Algebra.ActiveRayConstraints +import OAI.GroupTheory.PolycyclicRecognition.Analysis.FiniteLabelTransport +import OAI.GroupTheory.PolycyclicRecognition.Geometry.GenericWeightDirections +import OAI.GroupTheory.PolycyclicRecognition.Algebra.RightTranslationLabel +import OAI.GroupTheory.PolycyclicRecognition.Geometry.WeightChambers +import OAI.GroupTheory.PolycyclicRecognition.Geometry.WeightChamberLimits +import OAI.GroupTheory.PolycyclicRecognition.Geometry.WeightChamberAction +import OAI.GroupTheory.PolycyclicRecognition.Analysis.GenericProfileChambers +import OAI.GroupTheory.PolycyclicRecognition.Algebra.JointDirectionLabels +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CompactFlowSegments +import OAI.GroupTheory.PolycyclicRecognition.Algebra.ExtremeDirectionLabels +import OAI.GroupTheory.PolycyclicRecognition.Analysis.CompactAeExhaustion +import OAI.GroupTheory.PolycyclicRecognition.Analysis.RightFolnerExpansion +import OAI.GroupTheory.PolycyclicRecognition.Analysis.SourceMetricFolner +import OAI.GroupTheory.PolycyclicRecognition.Analysis.MetricFolnerVolume +import OAI.GroupTheory.PolycyclicRecognition.Analysis.FolnerRatio +import OAI.GroupTheory.PolycyclicRecognition.Analysis.MetricFolnerTransfer +import OAI.GroupTheory.PolycyclicRecognition.Analysis.MetricFolnerMean +import OAI.GroupTheory.PolycyclicRecognition.Analysis.MetricFolnerCount +import OAI.GroupTheory.PolycyclicRecognition.Analysis.CoarseModelMean +import OAI.GroupTheory.PolycyclicRecognition.Analysis.CoarseModelUnimodular +import OAI.GroupTheory.PolycyclicRecognition.Analysis.ApproximateInvariantMean +import OAI.GroupTheory.PolycyclicRecognition.Analysis.FolnerInvariantMean +import OAI.GroupTheory.PolycyclicRecognition.Analysis.FiniteFolnerMean +import OAI.GroupTheory.PolycyclicRecognition.Analysis.InvariantMeanGenerators +import OAI.GroupTheory.PolycyclicRecognition.Analysis.CyclicInvariantMean +import OAI.GroupTheory.PolycyclicRecognition.Analysis.ExtensionInvariantMean +import OAI.GroupTheory.PolycyclicRecognition.Analysis.PolycyclicInvariantMean +import OAI.GroupTheory.PolycyclicRecognition.Analysis.MetricFolnerUnimodular +import OAI.GroupTheory.PolycyclicRecognition.Geometry.NormalizedWeightRays +import OAI.GroupTheory.PolycyclicRecognition.Analysis.GenericProfileSigns +import OAI.GroupTheory.PolycyclicRecognition.Geometry.HorizontalDerivativeLabel +import OAI.GroupTheory.PolycyclicRecognition.Geometry.ProfileDerivativeLabel +import OAI.GroupTheory.PolycyclicRecognition.Geometry.SegmentVolumeDerivative +import OAI.GroupTheory.PolycyclicRecognition.Geometry.SegmentIncrementDerivative +import OAI.GroupTheory.PolycyclicRecognition.Algebra.PositiveVariationEquality +import OAI.GroupTheory.PolycyclicRecognition.Algebra.TemplateVariationEquality +import OAI.GroupTheory.PolycyclicRecognition.Algebra.FiniteSignOrder +import OAI.GroupTheory.PolycyclicRecognition.Geometry.ProfileWeightSigns +import OAI.GroupTheory.PolycyclicRecognition.Algebra.FiniteInvariantOrbit +import OAI.GroupTheory.PolycyclicRecognition.Algebra.TemplateSymmetries +import OAI.GroupTheory.PolycyclicRecognition.Analysis.SupportDirectionCap +import OAI.GroupTheory.PolycyclicRecognition.Analysis.TemplateSupportOrder +import OAI.GroupTheory.PolycyclicRecognition.Geometry.TemplateWeightRays +import OAI.GroupTheory.PolycyclicRecognition.Geometry.WeightRayPermutation +import OAI.GroupTheory.PolycyclicRecognition.Geometry.RootIntervalSlack +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanRootIntervalSlack +import OAI.GroupTheory.PolycyclicRecognition.Geometry.RootIntervalSupports +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanIntervalDenominator +import OAI.GroupTheory.PolycyclicRecognition.Analysis.SublinearAccessiblePaths +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanProfilePacking +import OAI.GroupTheory.PolycyclicRecognition.Analysis.AccessibleProfilePaths +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanSampledVisits +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanSegmentSupportTimes +import OAI.GroupTheory.PolycyclicRecognition.Analysis.GoodProfileSegment +import OAI.GroupTheory.PolycyclicRecognition.Geometry.GoodRescaledFlowLegs +import OAI.GroupTheory.PolycyclicRecognition.Analysis.RescaledProfileLegs +import OAI.GroupTheory.PolycyclicRecognition.Geometry.RootIntervalSampling +import OAI.GroupTheory.PolycyclicRecognition.Analysis.SegmentProfileLegs +import OAI.GroupTheory.PolycyclicRecognition.Analysis.SegmentSupportTimes +import OAI.GroupTheory.PolycyclicRecognition.Analysis.SupportVisitRescale +import OAI.GroupTheory.PolycyclicRecognition.Analysis.AccessibleWordPaths +import OAI.GroupTheory.PolycyclicRecognition.Analysis.CenteredProfilePaths +import OAI.GroupTheory.PolycyclicRecognition.Analysis.SupportVisitImage +import OAI.GroupTheory.PolycyclicRecognition.Analysis.SuccessfulWordPaths +import OAI.GroupTheory.PolycyclicRecognition.Geometry.GoodProfileFlow +import OAI.GroupTheory.PolycyclicRecognition.Analysis.BasedImagePaths +import OAI.GroupTheory.PolycyclicRecognition.Analysis.SubexponentialPathPacking +import OAI.GroupTheory.PolycyclicRecognition.Analysis.FixedSliceVolumeComparison +import OAI.GroupTheory.PolycyclicRecognition.Algebra.GoodSheetWordImage +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanDirectionalVisits +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CanonicalExponentialMeasure +import OAI.GroupTheory.PolycyclicRecognition.Analysis.TranslatedBoxMass +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanAccessibleComparison +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanRecurrenceBoxes +import OAI.GroupTheory.PolycyclicRecognition.Analysis.SuccessfulSamplePaths +import OAI.GroupTheory.PolycyclicRecognition.Algebra.VectorSwitchParameters +import OAI.GroupTheory.PolycyclicRecognition.Analysis.FlatSwitchSamples +import OAI.GroupTheory.PolycyclicRecognition.Analysis.UniformIntervalSamples +import OAI.GroupTheory.PolycyclicRecognition.Analysis.SampledSuccessfulVolume +import OAI.GroupTheory.PolycyclicRecognition.Algebra.PositiveParameterSets +import OAI.GroupTheory.PolycyclicRecognition.Analysis.EventualPolynomialImage +import OAI.GroupTheory.PolycyclicRecognition.Analysis.SwitchEndpoints +import OAI.GroupTheory.PolycyclicRecognition.Algebra.SuccessfulWordImage +import OAI.GroupTheory.PolycyclicRecognition.Algebra.RecurrentWordImage +import OAI.GroupTheory.PolycyclicRecognition.Analysis.RescaledWordEndpoints +import OAI.GroupTheory.PolycyclicRecognition.Analysis.SubexponentialVolumeComparison +import OAI.GroupTheory.PolycyclicRecognition.Analysis.RescaledImageVolume +import OAI.GroupTheory.PolycyclicRecognition.Algebra.SwitchParameterPullback +import OAI.GroupTheory.PolycyclicRecognition.Algebra.DifferenceWordImage +import OAI.GroupTheory.PolycyclicRecognition.Algebra.DifferenceAmplitudeWord +import OAI.GroupTheory.PolycyclicRecognition.Analysis.SubmersivePolynomialImage +import OAI.GroupTheory.PolycyclicRecognition.Algebra.CoordinateMinorPermutation +import OAI.GroupTheory.PolycyclicRecognition.Algebra.AmplitudeWordRank +import OAI.GroupTheory.PolycyclicRecognition.Algebra.ExpandedSchemeAmplitudes +import OAI.GroupTheory.PolycyclicRecognition.Algebra.SurjectiveColumns +import OAI.GroupTheory.PolycyclicRecognition.Algebra.PolynomialFamilies +import OAI.GroupTheory.PolycyclicRecognition.Analysis.PolynomialEndpointCoordinates +import OAI.GroupTheory.PolycyclicRecognition.Algebra.AmplitudeWordCoordinates +import OAI.GroupTheory.PolycyclicRecognition.Geometry.SmoothPolynomialFamilyImage +import OAI.GroupTheory.PolycyclicRecognition.Analysis.ConvergingPolynomialImage +import OAI.GroupTheory.PolycyclicRecognition.Algebra.AmplitudeWordImage +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CompactDerivativeBounds +import OAI.GroupTheory.PolycyclicRecognition.Analysis.CompactImageVolume +import OAI.GroupTheory.PolycyclicRecognition.Analysis.CompactSectionVolume +import OAI.GroupTheory.PolycyclicRecognition.Algebra.CoordinateMesh +import OAI.GroupTheory.PolycyclicRecognition.Geometry.DerivativeOscillation +import OAI.GroupTheory.PolycyclicRecognition.Algebra.DeterminantLowerNorm +import OAI.GroupTheory.PolycyclicRecognition.Analysis.InjectivePatchVolume +import OAI.GroupTheory.PolycyclicRecognition.Algebra.ParameterSplit +import OAI.GroupTheory.PolycyclicRecognition.Geometry.PolynomialDifferential +import OAI.GroupTheory.PolycyclicRecognition.Algebra.PolynomialLargeValueSet +import OAI.GroupTheory.PolycyclicRecognition.Algebra.PolynomialMinor +import OAI.GroupTheory.PolycyclicRecognition.Geometry.PolynomialMinorDifferential +import OAI.GroupTheory.PolycyclicRecognition.Analysis.QuantitativeInjectiveCover +import OAI.GroupTheory.PolycyclicRecognition.Analysis.RemezInput +import OAI.GroupTheory.PolycyclicRecognition.Analysis.SectionVolume +import OAI.GroupTheory.PolycyclicRecognition.Analysis.SubexponentialCompactImage +import OAI.GroupTheory.PolycyclicRecognition.Algebra.SubexponentialOperations +import OAI.GroupTheory.PolycyclicRecognition.Analysis.SubexponentialPolynomialImage +import OAI.GroupTheory.PolycyclicRecognition.Algebra.SubexponentialPolynomialValues +import OAI.GroupTheory.PolycyclicRecognition.Algebra.SubexponentialSections +import OAI.GroupTheory.PolycyclicRecognition.Analysis.OccupationCompactRestriction +import OAI.GroupTheory.PolycyclicRecognition.Geometry.FlowSupportedProfileIncrement +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CoordinateFlowProfileIdentity +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanProfileIncrement +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.PolycyclicDualityComparison +import OAI.GroupTheory.PolycyclicRecognition.Algebra.RecognitionFromPolycyclicComparison +import OAI.GroupTheory.PolycyclicRecognition.Algebra.FiniteSwitchEvents +import OAI.GroupTheory.PolycyclicRecognition.Algebra.SuccessfulParameterMass +import OAI.GroupTheory.PolycyclicRecognition.Algebra.ParameterDensityMass +import OAI.GroupTheory.PolycyclicRecognition.Algebra.AutocorrelationRecurrence +import OAI.GroupTheory.PolycyclicRecognition.Analysis.RecurrenceIntegralBounds +import OAI.GroupTheory.PolycyclicRecognition.Algebra.AutocorrelationLowerBound +import OAI.GroupTheory.PolycyclicRecognition.Algebra.BackwardRecurrenceStep +import OAI.GroupTheory.PolycyclicRecognition.Algebra.BackwardRecurrenceSets +import OAI.GroupTheory.PolycyclicRecognition.Analysis.BackwardSwitchProbability +import OAI.GroupTheory.PolycyclicRecognition.Analysis.BackwardRecurrenceProbability +import OAI.GroupTheory.PolycyclicRecognition.Algebra.SubexponentialBounds +import OAI.GroupTheory.PolycyclicRecognition.Analysis.BackwardRecurrenceAsymptotics +import OAI.GroupTheory.PolycyclicRecognition.Algebra.BackwardRecurrenceFamily +import OAI.GroupTheory.PolycyclicRecognition.Algebra.SlowPositiveSelection +import OAI.GroupTheory.PolycyclicRecognition.Analysis.SupportedGoodSetSelection +import OAI.GroupTheory.PolycyclicRecognition.Analysis.GoodProfileSampling +import OAI.GroupTheory.PolycyclicRecognition.Algebra.IndependentSwitchParameters +import OAI.GroupTheory.PolycyclicRecognition.Algebra.OccupationLimitSelection +import OAI.GroupTheory.PolycyclicRecognition.Analysis.StationaryIntegralMicrosteps +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CoordinateProfileFlow +import OAI.GroupTheory.PolycyclicRecognition.Analysis.SampledProfileIncrements +import OAI.GroupTheory.PolycyclicRecognition.Geometry.FlowSampleDomination +import OAI.GroupTheory.PolycyclicRecognition.Geometry.FlowProbabilityCutoffs +import OAI.GroupTheory.PolycyclicRecognition.Analysis.SupportedProbabilityRestriction +import OAI.GroupTheory.PolycyclicRecognition.Geometry.ProfileHeightIdentity +import OAI.GroupTheory.PolycyclicRecognition.Analysis.CompactProbabilityProduct +import OAI.GroupTheory.PolycyclicRecognition.Analysis.CompactProbabilityDensity +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CompactFlowNeighborhood +import OAI.GroupTheory.PolycyclicRecognition.Analysis.IndependentProfileLimits +import OAI.GroupTheory.PolycyclicRecognition.Analysis.ProfileIncrementLimits +import OAI.GroupTheory.PolycyclicRecognition.Geometry.OccupationFlowLimit +import OAI.GroupTheory.PolycyclicRecognition.Geometry.OccupationFlowMicrosteps +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanProfileAnchors +import OAI.GroupTheory.PolycyclicRecognition.Geometry.ProfileFlowConvergence +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanProfileCompactness +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanDProfiles +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanNMetric +import OAI.GroupTheory.PolycyclicRecognition.Analysis.ProfilePointwiseBounds +import OAI.GroupTheory.PolycyclicRecognition.Geometry.GradedFlowLimit +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanOccupationInvariance +import OAI.GroupTheory.PolycyclicRecognition.Algebra.OccupationDomination +import OAI.GroupTheory.PolycyclicRecognition.Algebra.OccupationMicrostepLimit +import OAI.GroupTheory.PolycyclicRecognition.Analysis.SupportedProfileConstraints +import OAI.GroupTheory.PolycyclicRecognition.Algebra.DynkinTranslations +import OAI.GroupTheory.PolycyclicRecognition.Algebra.PositiveRescaling +import OAI.GroupTheory.PolycyclicRecognition.Algebra.RescaledFixedTranslation +import OAI.GroupTheory.PolycyclicRecognition.Algebra.RescaledDensityOccupation +import OAI.GroupTheory.PolycyclicRecognition.Analysis.OccupationSampling +import OAI.GroupTheory.PolycyclicRecognition.Algebra.OccupationTranslation +import OAI.GroupTheory.PolycyclicRecognition.Analysis.ModelCellOccupation +import OAI.GroupTheory.PolycyclicRecognition.Analysis.CoordinateChartSampling +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanActionCoefficients +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanUniformAction +import OAI.GroupTheory.PolycyclicRecognition.Algebra.PolynomialEnvelopes +import OAI.GroupTheory.PolycyclicRecognition.Algebra.PolynomialChartCoordinates +import OAI.GroupTheory.PolycyclicRecognition.Analysis.BoxInteriorSlack +import OAI.GroupTheory.PolycyclicRecognition.Algebra.UniformSelection +import OAI.GroupTheory.PolycyclicRecognition.Algebra.UniformInteriorSlack +import OAI.GroupTheory.PolycyclicRecognition.Analysis.UniformBoxTranslation +import OAI.GroupTheory.PolycyclicRecognition.Algebra.UniformOccupationAverage +import OAI.GroupTheory.PolycyclicRecognition.Analysis.BoxWordExpansion +import OAI.GroupTheory.PolycyclicRecognition.Algebra.WordExponentBounds +import OAI.GroupTheory.PolycyclicRecognition.Algebra.RescaledBasisChange +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanBoxScaling +import OAI.GroupTheory.PolycyclicRecognition.Algebra.DensityTranslationLimits +import OAI.GroupTheory.PolycyclicRecognition.Algebra.DensityOccupationError +import OAI.GroupTheory.PolycyclicRecognition.Analysis.PairChartSampling +import OAI.GroupTheory.PolycyclicRecognition.Algebra.FactorOccupationLimit +import OAI.GroupTheory.PolycyclicRecognition.Algebra.OccupationMicrosteps +import OAI.GroupTheory.PolycyclicRecognition.Analysis.BasisDynkinHaar +import OAI.GroupTheory.PolycyclicRecognition.Algebra.MappedBasisBrackets +import OAI.GroupTheory.PolycyclicRecognition.Analysis.RescaledBoxTranslation +import OAI.GroupTheory.PolycyclicRecognition.Geometry.BasisAdjointNilpotent +import OAI.GroupTheory.PolycyclicRecognition.Algebra.NilpotentConjugationDecay +import OAI.GroupTheory.PolycyclicRecognition.Algebra.CoordinateConjugationDecay +import OAI.GroupTheory.PolycyclicRecognition.Algebra.RescaledWordSums +import OAI.GroupTheory.PolycyclicRecognition.Algebra.WordInteriorSlack +import OAI.GroupTheory.PolycyclicRecognition.Analysis.ModelBoxTranslation +import OAI.GroupTheory.PolycyclicRecognition.Analysis.CellOccupationError +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanStationaryIncrement +import OAI.GroupTheory.PolycyclicRecognition.Algebra.PairMicrosteps +import OAI.GroupTheory.PolycyclicRecognition.Algebra.OccupationWeakLimit +import OAI.GroupTheory.PolycyclicRecognition.Algebra.PolynomialTranslationLimits +import OAI.GroupTheory.PolycyclicRecognition.Geometry.ExponentialRightHaar +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanErgodicLabel +import OAI.GroupTheory.PolycyclicRecognition.Analysis.PairMeanApproximation +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanStationaryLabel +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanStationaryFactor +import OAI.GroupTheory.PolycyclicRecognition.Analysis.PairMeasureScaling +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanStationaryPacking +import OAI.GroupTheory.PolycyclicRecognition.Analysis.FactorProductPacking +import OAI.GroupTheory.PolycyclicRecognition.Algebra.WordExtension +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanWordThickening +import OAI.GroupTheory.PolycyclicRecognition.Analysis.PositiveProjectionCell +import OAI.GroupTheory.PolycyclicRecognition.Analysis.ModelCubeHaar +import OAI.GroupTheory.PolycyclicRecognition.Analysis.PolynomialPackingAlgebra +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanWordPacking +import OAI.GroupTheory.PolycyclicRecognition.Algebra.CoordinateBoundedInverse +import OAI.GroupTheory.PolycyclicRecognition.Algebra.RescaledInverseSections +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanInverseSections +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanSegmentWordPath +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanSegmentCoding +import OAI.GroupTheory.PolycyclicRecognition.Analysis.NormalizedEndpointMeasure +import OAI.GroupTheory.PolycyclicRecognition.Analysis.CoordinateStationaryPaths +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanStationaryPaths +import OAI.GroupTheory.PolycyclicRecognition.Geometry.ExponentialSubsetVolume +import OAI.GroupTheory.PolycyclicRecognition.Analysis.SubgroupPacking +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanCoordinatePacking +import OAI.GroupTheory.PolycyclicRecognition.Algebra.DistortedHomomorphisms +import OAI.GroupTheory.PolycyclicRecognition.Analysis.PairMeanControl +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanHomKernel +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanPairMean +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanSegmentVisits +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanSegmentPaths +import OAI.GroupTheory.PolycyclicRecognition.Analysis.CoarsePathRadius +import OAI.GroupTheory.PolycyclicRecognition.Analysis.StationaryPathSampling +import OAI.GroupTheory.PolycyclicRecognition.Geometry.RecognitionInLieModel +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanSubgroupRealization +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanLocalProduct +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanFactorHeight +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanAmbientWords +import OAI.GroupTheory.PolycyclicRecognition.Geometry.ExponentialRepresentationInput +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanAmbientPacking +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanGeneratorSchemes +import OAI.GroupTheory.PolycyclicRecognition.Analysis.CompactSubmersionFamily +import OAI.GroupTheory.PolycyclicRecognition.Geometry.RescaledLieFamily +import OAI.GroupTheory.PolycyclicRecognition.Algebra.NormalizedGeneration +import OAI.GroupTheory.PolycyclicRecognition.Algebra.UniformCoordinateGeneration +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanUniformGeneration +import OAI.GroupTheory.PolycyclicRecognition.Geometry.RootSupportSwitch +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanSupportLegs +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanSupportSwitch +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanBoxPaths +import OAI.GroupTheory.PolycyclicRecognition.Algebra.CoordinateInverseSections +import OAI.GroupTheory.PolycyclicRecognition.Algebra.ParametrizedGeneratorSchemes +import OAI.GroupTheory.PolycyclicRecognition.Algebra.CoordinateInverseSections +import OAI.GroupTheory.PolycyclicRecognition.Algebra.ParametrizedGeneratorSchemes +import OAI.GroupTheory.PolycyclicRecognition.Analysis.CoarsePathMesh +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanIntegratedAction +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanFixedSlicePacking +import OAI.GroupTheory.PolycyclicRecognition.Geometry.ExponentialEmbedding +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanCompactWords +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanControlledProducts +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanActualConjugation +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanGroupConjugation +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanBoxMaps +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanResidualAction +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanRootWidths +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanWeightDilation +import OAI.GroupTheory.PolycyclicRecognition.Algebra.NilpotentAutomorphism +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanBoxDilation +import OAI.GroupTheory.PolycyclicRecognition.Analysis.ProfileRegularity +import OAI.GroupTheory.PolycyclicRecognition.Geometry.PairHeightCocycle +import OAI.GroupTheory.PolycyclicRecognition.Algebra.PairApproximation +import OAI.GroupTheory.PolycyclicRecognition.Analysis.PairSublinear +import OAI.GroupTheory.PolycyclicRecognition.Analysis.StationarySampling +import OAI.GroupTheory.PolycyclicRecognition.Analysis.LowerPacking +import OAI.GroupTheory.PolycyclicRecognition.Geometry.NilpotentFlow +import OAI.GroupTheory.PolycyclicRecognition.Algebra.SwitchBounds +import OAI.GroupTheory.PolycyclicRecognition.Geometry.RootRepresentation +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanWeights +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanBoxExponents +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanGroupBoxes +import OAI.GroupTheory.PolycyclicRecognition.Geometry.WeightedZonotope +import OAI.GroupTheory.PolycyclicRecognition.Geometry.FiniteLieNorm +import OAI.GroupTheory.PolycyclicRecognition.Analysis.NilpotentBoxes +import OAI.GroupTheory.PolycyclicRecognition.Algebra.NilpotentRecognition +import OAI.GroupTheory.PolycyclicRecognition.Algebra.NormalizedWordBrackets +import OAI.GroupTheory.PolycyclicRecognition.Analysis.LinearSupportSymmetries +import OAI.GroupTheory.PolycyclicRecognition.Geometry.ExponentialHeightKernel +import OAI.GroupTheory.PolycyclicRecognition.Algebra.PairOrbit +import OAI.GroupTheory.PolycyclicRecognition.Algebra.InverseSection +import OAI.GroupTheory.PolycyclicRecognition.Algebra.InverseCoupling +import OAI.GroupTheory.PolycyclicRecognition.Algebra.InverseAverageL2 +import OAI.GroupTheory.PolycyclicRecognition.Algebra.InverseDefectControl +import OAI.GroupTheory.PolycyclicRecognition.Analysis.PairPathMesh +import OAI.GroupTheory.PolycyclicRecognition.Geometry.WeightedBoxVolume +import OAI.GroupTheory.PolycyclicRecognition.Analysis.StationaryCentered +import OAI.GroupTheory.PolycyclicRecognition.Analysis.StationaryMesh +import OAI.GroupTheory.PolycyclicRecognition.Analysis.StationaryVolumeAlgebra +import OAI.GroupTheory.PolycyclicRecognition.Analysis.VolumeExponents +import OAI.GroupTheory.PolycyclicRecognition.Analysis.SupportSymmetries +import OAI.GroupTheory.PolycyclicRecognition.Geometry.HeightFactorization +import OAI.GroupTheory.PolycyclicRecognition.Geometry.TriangularChainPacking +import OAI.GroupTheory.PolycyclicRecognition.Geometry.TriangularInverseBounds +import OAI.GroupTheory.PolycyclicRecognition.Analysis.CoordinatePacking +import OAI.GroupTheory.PolycyclicRecognition.Geometry.TriangularMatrixHeight +import OAI.GroupTheory.PolycyclicRecognition.Geometry.GlobalHeight +import OAI.GroupTheory.PolycyclicRecognition.Geometry.RecognitionFromHeight +import OAI.GroupTheory.PolycyclicRecognition.Algebra.CocycleGrowth +import OAI.GroupTheory.PolycyclicRecognition.Analysis.BoundedPathPacking +import OAI.GroupTheory.PolycyclicRecognition.Analysis.AffineLabels +import OAI.GroupTheory.PolycyclicRecognition.Geometry.BoundaryHeight +import OAI.GroupTheory.PolycyclicRecognition.Geometry.BoundaryLeaf +import OAI.GroupTheory.PolycyclicRecognition.Geometry.BoundaryMass +import OAI.GroupTheory.PolycyclicRecognition.Analysis.BoundedPathGrowth +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanNeighborCompactProfiles +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanNormalizedNeighborStep +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanTransformedPolarTemplates +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanPolarOffsetExponents +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanPolarConeKernel +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanPolarConeAction +import OAI.GroupTheory.PolycyclicRecognition.Algebra.TemplateConeTraces +import OAI.GroupTheory.PolycyclicRecognition.Algebra.TemplateConeTraceSeparation +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanNeighborLawCompactness +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanSupportedNeighborProfiles +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanReverseNeighborLaw +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanRestrictedNeighborLaw +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanConcentratedProbeSelection +import OAI.GroupTheory.PolycyclicRecognition.Algebra.WordPivotCoordinates +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanPivotProbePaths +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanConcentratedPaths +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanTiledLinkedEndpoints +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanTiledSourceCell +import OAI.GroupTheory.PolycyclicRecognition.Analysis.IndependentConditionedOffset +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanMeasuredCone +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanMeasuredConeHaar +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanMeasuredConeCells +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanConcentratedRootFrames +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanPolarSourceVolumes +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanSourceSectionCoordinates +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanTiledSourceBridge +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanNeighborRateBridge +import OAI.GroupTheory.PolycyclicRecognition.Analysis.RecognitionFromCanonicalAffine +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CanonicalHeight +import OAI.GroupTheory.PolycyclicRecognition.Analysis.ConvexOrbit +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.DualityEndgame +import OAI.GroupTheory.PolycyclicRecognition.Algebra.FiniteCase +import OAI.GroupTheory.PolycyclicRecognition.Algebra.FiniteLinearSymmetries +import OAI.GroupTheory.PolycyclicRecognition.Analysis.HaarAveraging +import OAI.GroupTheory.PolycyclicRecognition.Analysis.MeasurePacking +import OAI.GroupTheory.PolycyclicRecognition.Geometry.NilpotentExponential +import OAI.GroupTheory.PolycyclicRecognition.Algebra.PolynomialGrowth +import OAI.GroupTheory.PolycyclicRecognition.Analysis.SupportNorm +import OAI.GroupTheory.PolycyclicRecognition.Analysis.SupportFromTrace +import OAI.GroupTheory.PolycyclicRecognition.Geometry.TransferredHeight +import OAI.GroupTheory.PolycyclicRecognition.Geometry.TriangularHeight +import OAI.GroupTheory.PolycyclicRecognition.Algebra.UnipotentProducts + +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanLinkedNeighborBoxes +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanTiledSourceChains +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanMeasuredConeRealization +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanUniformCompactProbeBridge +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanUniformContactBridge +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanUniformTiledSourceBridge +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanPolarLinkedSource +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanPolarSourceCells +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanPublishedPolarAction +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanNeighborFrameLaw +import OAI.GroupTheory.PolycyclicRecognition.Analysis.SmallFactorCell +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanNormalizedPolarSamplers +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanPolarSourceProbability +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanSourceDilation +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanOffsetThreshold +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanPublishedPolarRegions +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanCanonicalPolarSamplers +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanOriginalStepBridge +import OAI.GroupTheory.PolycyclicRecognition.Analysis.TemplateOffsetCones +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CanonicalHeightMetricModel +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanSourceOffsetComparison +import OAI.GroupTheory.PolycyclicRecognition.Analysis.PairChainSublinear +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanOriginalNeighborFrames +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanPolarSourceBounds +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanOriginalNeighborOffset +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanPolarSourceFrames +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanPolarRegionMeasure +import OAI.GroupTheory.PolycyclicRecognition.Algebra.RecognitionFromLeafTraces +import OAI.GroupTheory.PolycyclicRecognition.Analysis.MinimizingMetricChains + +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CanonicalHeightMinimizingModel + +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanPolarSourceFramesCanonical + +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanPolarOriginalOffset +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanPolarBoxOffset +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanFixedPolarTargets +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanPolarSamplingGeometry +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanContactStepBridge +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanPolarMeasuredOffset +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanFixedSamplingGeometry + +import OAI.GroupTheory.PolycyclicRecognition.Analysis.NeighborProfileGluing +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanNeighborRowProfile +import OAI.GroupTheory.PolycyclicRecognition.Analysis.SequenceScaleExtraction +import OAI.GroupTheory.PolycyclicRecognition.Geometry.WeightedBasisComparison +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanBasisComparison +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanNeighborRowBasis +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanNeighborRowChart + +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanNeighborRowReverse +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanNeighborRowOffsetsEqual +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanNeighborRowOffset + +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanOneConeThreshold + +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanUniformOffsetThreshold + +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanPolarConeModels +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanPublishedOffsetThreshold + +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanNeighborSamplingRow + +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanNeighborSamplingReindex + +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanIdenticalNeighborProfiles + +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanNeighborConcentration + +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanPublishedNeighborConcentration + +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanNeighborChainConcentration + +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanPublishedChainConcentration + +import OAI.GroupTheory.PolycyclicRecognition.Analysis.SublinearScaleOffsets + +import OAI.GroupTheory.PolycyclicRecognition.Analysis.DeterministicProfileCenters + +import OAI.GroupTheory.PolycyclicRecognition.Analysis.BoundedProbabilityMean + +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanSubexponentialSuffixSequence + +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanSubexponentialGroupChain +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanChainCompactProfiles +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanUniformBoxProfiles +import OAI.GroupTheory.PolycyclicRecognition.Geometry.UniversalCartanProfiles +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanUniformSuffixMetric +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanPublishedRawChain +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanPublishedAllowedChains +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanPublishedSuffixConcentration + +import OAI.GroupTheory.PolycyclicRecognition.Geometry.LieIntegrationNaturality +import OAI.GroupTheory.PolycyclicRecognition.Geometry.ExponentialNormality + +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.CyclicDuality +import OAI.GroupTheory.PolycyclicRecognition.Algebra.CyclicQuotientSequence +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.NormalInductionDimension +import OAI.GroupTheory.PolycyclicRecognition.Algebra.FiniteInduction +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.CyclicExtensionFiniteness +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.RestrictedRegularCohomology +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.TwistedBilateralCohomology +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.PolyZResolution +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.GroupIsoDuality +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.InducedTranslationAugmentation +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.InducedCohomologyDifference +import OAI.GroupTheory.PolycyclicRecognition.Algebra.FaithfulTruncatedEnveloping +import OAI.GroupTheory.PolycyclicRecognition.Geometry.FaithfulTriangularRepresentation +import OAI.GroupTheory.PolycyclicRecognition.Geometry.TriangularGroupIntegration +import OAI.GroupTheory.PolycyclicRecognition.Geometry.TriangularLocalLogarithm +import OAI.GroupTheory.PolycyclicRecognition.Geometry.TriangularRealizationConstruction +import OAI.GroupTheory.PolycyclicRecognition.Geometry.RepresentedExponentialDifferential +import OAI.GroupTheory.PolycyclicRecognition.Algebra.DixmierRegularityFromTopology +import OAI.GroupTheory.PolycyclicRecognition.Algebra.ConnectedIdealNormality +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.NilpotentReducedCohomology +import OAI.GroupTheory.PolycyclicRecognition.Geometry.ExponentialKernelCentral +import OAI.GroupTheory.PolycyclicRecognition.Geometry.IntrinsicCanonicalHeight +import OAI.GroupTheory.PolycyclicRecognition.Geometry.IntrinsicHeightKernel +import OAI.GroupTheory.PolycyclicRecognition.Geometry.IntrinsicCartanFactorModel +import OAI.GroupTheory.PolycyclicRecognition.Geometry.TriangularExponentialInjective +import OAI.GroupTheory.PolycyclicRecognition.Geometry.IntrinsicTriangularRealization +import OAI.GroupTheory.PolycyclicRecognition.Analysis.IntrinsicTraceFromHaar +import OAI.GroupTheory.PolycyclicRecognition.Geometry.IntrinsicContractionModel +import OAI.GroupTheory.PolycyclicRecognition.Analysis.IntrinsicKernelPacking +import OAI.GroupTheory.PolycyclicRecognition.Geometry.IntrinsicCartanHeightAssembly +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.ControlledCochainMap +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.ControlledTupleMaps +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.ControlledGroupCohomology +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.CoarsePoincareDuality +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.FiniteKernelsFromFillings +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.FiniteIndexFiniteness +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.PoincareDualityBase +import OAI.GroupTheory.PolycyclicRecognition.Algebra.TorsionFreeAbelianRank +import OAI.GroupTheory.PolycyclicRecognition.Algebra.RationalConjugation +import OAI.GroupTheory.PolycyclicRecognition.Algebra.LocallyNilpotentDimension +import OAI.GroupTheory.PolycyclicRecognition.Algebra.MaximalNilpotentNormal +import OAI.GroupTheory.PolycyclicRecognition.Algebra.SolvableFiniteExtension +import OAI.GroupTheory.PolycyclicRecognition.Geometry.NilpotentUniqueRoots +import OAI.GroupTheory.PolycyclicRecognition.Algebra.NilpotentAbelianQuotientRank +import OAI.GroupTheory.PolycyclicRecognition.Algebra.NilpotentQuotientRank +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.DimensionFromRegularCohomology +import OAI.GroupTheory.PolycyclicRecognition.Algebra.NilpotentFiniteCentralizer +import OAI.GroupTheory.PolycyclicRecognition.Geometry.NilpotentUpperCentralRoots +import OAI.GroupTheory.PolycyclicRecognition.Algebra.MaximalNilpotentCentralAction +import OAI.GroupTheory.PolycyclicRecognition.Algebra.CharacteristicQuotientAction +import OAI.GroupTheory.PolycyclicRecognition.Algebra.FiniteRationalLinearModel +import OAI.GroupTheory.PolycyclicRecognition.Algebra.NormalEigencharacters +import OAI.GroupTheory.PolycyclicRecognition.Analysis.AffinePolynomialTopology +import OAI.GroupTheory.PolycyclicRecognition.Algebra.NoetherianComponents +import OAI.GroupTheory.PolycyclicRecognition.Algebra.NilpotentByAbelianReduction +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.HomologyExhaustion +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.FiniteIntegralHomology +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.HomologyClassExhaustion +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.PoincareTopHomology +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.InducedResolutionHomology +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.LatticeExtensionHomologyBound +import OAI.GroupTheory.PolycyclicRecognition.Algebra.FiniteIndexOrientation +import OAI.GroupTheory.PolycyclicRecognition.Algebra.FiniteIndexTrace +import OAI.GroupTheory.PolycyclicRecognition.Algebra.RankOneCharacter +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.NilpotentStageTopHomology +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.TopHomologyNaturality +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.FiniteIndexTopHomology +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.FiniteIndexHomologyDegree +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.NilpotentTopHomologyFiniteness +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.LatticeKernelHomologyFiniteness + +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanCoverBoxRadius +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanCoverMetricProducts +import OAI.GroupTheory.PolycyclicRecognition.Analysis.HaarBoxRadius +import OAI.GroupTheory.PolycyclicRecognition.Analysis.PolynomialBallScales +import OAI.GroupTheory.PolycyclicRecognition.Algebra.ControlledProductPairs +import OAI.GroupTheory.PolycyclicRecognition.Geometry.ExponentialBoxNeighborhood + +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.CartanReducedCohomology +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CompactRotationalTwist +import OAI.GroupTheory.PolycyclicRecognition.Geometry.WeightRotationCharacter +import OAI.GroupTheory.PolycyclicRecognition.Geometry.ComplexWeightKernel +import OAI.GroupTheory.PolycyclicRecognition.Algebra.NilpotentAutomorphismAction +import OAI.GroupTheory.PolycyclicRecognition.Geometry.NilradicalRotationAction +import OAI.GroupTheory.PolycyclicRecognition.Geometry.ActualRotationalModification +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanRealShadowSolvable +import OAI.GroupTheory.PolycyclicRecognition.Geometry.RealShadowSplit +import OAI.GroupTheory.PolycyclicRecognition.Geometry.RealTorusSmoothRepresentation +import OAI.GroupTheory.PolycyclicRecognition.Algebra.ComplexFactorLocalChart +import OAI.GroupTheory.PolycyclicRecognition.Geometry.SmoothFactorRotations +import OAI.GroupTheory.PolycyclicRecognition.Geometry.ActualSmoothRotation +import OAI.GroupTheory.PolycyclicRecognition.Algebra.ReweightedFrameBracket +import OAI.GroupTheory.PolycyclicRecognition.Geometry.IndividualRotationDerivative +import OAI.GroupTheory.PolycyclicRecognition.Geometry.SmoothRotationExtension +import OAI.GroupTheory.PolycyclicRecognition.Geometry.FactorPhaseDerivative +import OAI.GroupTheory.PolycyclicRecognition.Geometry.FactorPhaseOperatorDerivative +import OAI.GroupTheory.PolycyclicRecognition.Algebra.FiniteFrameDifferentiation +import OAI.GroupTheory.PolycyclicRecognition.Geometry.RotationalTwistBracket +import OAI.GroupTheory.PolycyclicRecognition.Geometry.ActualRotationLieAlgebra +import OAI.GroupTheory.PolycyclicRecognition.Geometry.SmoothLieDifferential +import OAI.GroupTheory.PolycyclicRecognition.Geometry.RotationFactorLifts +import OAI.GroupTheory.PolycyclicRecognition.Geometry.RotationFactorDifferentials +import OAI.GroupTheory.PolycyclicRecognition.Geometry.RotationFactorKernel +import OAI.GroupTheory.PolycyclicRecognition.Geometry.RealPhaseExponential +import OAI.GroupTheory.PolycyclicRecognition.Geometry.RealShadowConjugation +import OAI.GroupTheory.PolycyclicRecognition.Geometry.RealShadowRepresentationTransport +import OAI.GroupTheory.PolycyclicRecognition.Geometry.RotationalTwistConjugation + +import OAI.GroupTheory.PolycyclicRecognition.Geometry.RotationLieRepresentation +import OAI.GroupTheory.PolycyclicRecognition.Geometry.RotationTriangularRepresentation +import OAI.GroupTheory.PolycyclicRecognition.Geometry.RotationRepresentedChart +import OAI.GroupTheory.PolycyclicRecognition.Geometry.AnalyticRepresentationGroup +import OAI.GroupTheory.PolycyclicRecognition.Analysis.LocallyCompactGroupEmbedding + +import OAI.GroupTheory.PolycyclicRecognition.Algebra.FiniteKernelSolvable +import OAI.GroupTheory.PolycyclicRecognition.Geometry.RootCoreExtensionDimension +import OAI.GroupTheory.PolycyclicRecognition.Algebra.AbelianByFiniteContractor +import OAI.GroupTheory.PolycyclicRecognition.Algebra.FiniteKernelAscendingData +import OAI.GroupTheory.PolycyclicRecognition.Lattices.AbelianLatticeRealization +import OAI.GroupTheory.PolycyclicRecognition.Analysis.IntegralBilinearRealization +import OAI.GroupTheory.PolycyclicRecognition.Algebra.CentralWordCollection +import OAI.GroupTheory.PolycyclicRecognition.Lattices.TwoStepFiniteIndexRealization +import OAI.GroupTheory.PolycyclicRecognition.Algebra.PolynomialCoordinateWords +import OAI.GroupTheory.PolycyclicRecognition.Lattices.PolynomialLatticeExtension +import OAI.GroupTheory.PolycyclicRecognition.Lattices.LatticeAutomorphismFlow +import OAI.GroupTheory.PolycyclicRecognition.Lattices.DerivationSolvableModel +import OAI.GroupTheory.PolycyclicRecognition.Lattices.IntegerTimeLattice +import OAI.GroupTheory.PolycyclicRecognition.Analysis.IntegralLinearExtension +import OAI.GroupTheory.PolycyclicRecognition.Lattices.AbelianCyclicLattice +import OAI.GroupTheory.PolycyclicRecognition.Lattices.OrderedCyclicLatticeExtension +import OAI.GroupTheory.PolycyclicRecognition.Geometry.SemidirectExponentialCoordinates +import OAI.GroupTheory.PolycyclicRecognition.Lattices.NilpotentFiniteIndexLattice +import OAI.GroupTheory.PolycyclicRecognition.Lattices.NilpotentLatticeLinearAction +import OAI.GroupTheory.PolycyclicRecognition.Lattices.SmoothRealActionLattice + +import OAI.GroupTheory.PolycyclicRecognition.Lattices.NilpotentExtensionLattice +import OAI.GroupTheory.PolycyclicRecognition.Algebra.FactorSystemGauge +import OAI.GroupTheory.PolycyclicRecognition.Lattices.AbelianLatticeKernel +import OAI.GroupTheory.PolycyclicRecognition.Lattices.NilpotentExtensionFixedFreeRealization +import OAI.GroupTheory.PolycyclicRecognition.Lattices.SemisimpleLangDecomposition +import OAI.GroupTheory.PolycyclicRecognition.Lattices.SemisimpleCentralizerCorrection +import OAI.GroupTheory.PolycyclicRecognition.Lattices.CompletedExtensionCentralizer +import OAI.GroupTheory.PolycyclicRecognition.Algebra.FiniteSemisimpleLiftFamily +import OAI.GroupTheory.PolycyclicRecognition.Algebra.LinearCocycleReduction +import OAI.GroupTheory.PolycyclicRecognition.Algebra.InnerCentralizerProduct +import OAI.GroupTheory.PolycyclicRecognition.Lattices.ExtensionFixedCocycleSection +import OAI.GroupTheory.PolycyclicRecognition.Lattices.FiniteFixedCocycleSection +import OAI.GroupTheory.PolycyclicRecognition.Lattices.JointFixedReductionData +import OAI.GroupTheory.PolycyclicRecognition.Algebra.PolynomialSubalgebraNilpotence +import OAI.GroupTheory.PolycyclicRecognition.Algebra.CommutingNilpotentWords +import OAI.GroupTheory.PolycyclicRecognition.Lattices.JointFixedActionFiltration +import OAI.GroupTheory.PolycyclicRecognition.Lattices.JointFixedResidualNilpotent +import OAI.GroupTheory.PolycyclicRecognition.Algebra.PolynomialSubalgebraCoordinates +import OAI.GroupTheory.PolycyclicRecognition.Lattices.IntegerCyclicHomExtension +import OAI.GroupTheory.PolycyclicRecognition.Lattices.CyclicCompletionHomUniqueness +import OAI.GroupTheory.PolycyclicRecognition.Lattices.KernelCompletionUnipotentLift +import OAI.GroupTheory.PolycyclicRecognition.Lattices.KernelCompletionCyclicStep +import OAI.GroupTheory.PolycyclicRecognition.Lattices.KernelCompletionTransport +import OAI.GroupTheory.PolycyclicRecognition.Lattices.IntegralNilshadow +import OAI.GroupTheory.PolycyclicRecognition.Lattices.PolycyclicLatticeRealization +import OAI.GroupTheory.PolycyclicRecognition.Algebra.MonicRecurrenceAscendingBase +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.AbelianizationMonoidFiniteness +import OAI.GroupTheory.PolycyclicRecognition.Algebra.PositiveAnnihilatorCriterion +import OAI.GroupTheory.PolycyclicRecognition.Algebra.PositiveCharacterIdeal +import OAI.GroupTheory.PolycyclicRecognition.Algebra.NormalAbelianizationQuotient +import OAI.GroupTheory.PolycyclicRecognition.Analysis.CompactCharacterCertificates +import OAI.GroupTheory.PolycyclicRecognition.Algebra.WellFoundedModuleRelations +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CharacterHemisphereContraction +import OAI.GroupTheory.PolycyclicRecognition.Lattices.LatticeCharacterGeometry +import OAI.GroupTheory.PolycyclicRecognition.Algebra.CharacterHemisphereEndgame +import OAI.GroupTheory.PolycyclicRecognition.Algebra.CharacterTamenessEndgame + +/-! +# Quasi-isometric recognition of virtually polycyclic groups + +The bounded-height theorem, recognition theorem, and finite-covolume lattice +corollary follow from height geometry, polynomial growth, finiteness, and duality. +-/ diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Geometry/WordLieProjection.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Geometry/WordLieProjection.lean new file mode 100644 index 0000000000000000000000000000000000000000..2e5cb160c763925923d093ea9dff9f3ea6142725 --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Geometry/WordLieProjection.lean @@ -0,0 +1,69 @@ +import Mathlib.Algebra.MonoidAlgebra.Module +import Mathlib.Algebra.FreeMonoid.Basic +import Mathlib.LinearAlgebra.Finsupp.LinearCombination +import Mathlib.Algebra.Algebra.Rat +import Mathlib.Tactic.Abel + +namespace OAI + +/-! # The right-nested commutator projection of rational words -/ + +noncomputable section +namespace PolycyclicRecognition + +abbrev RationalWords (n : ℕ) := MonoidAlgebra ℚ (FreeMonoid (Fin n)) + +variable {A : Type*} [Ring A] [Algebra ℚ A] {n : ℕ} (X : Fin n → A) + +def wordRightLie : List (Fin n) → A + | [] => 0 + | [i] => X i + | i :: j :: l => X i * wordRightLie (j :: l) - wordRightLie (j :: l) * X i + +def wordLieProjection : RationalWords n →ₗ[ℚ] A := + (Finsupp.linearCombination ℚ (fun w : FreeMonoid (Fin n) => wordRightLie X w.toList)).comp + (MonoidAlgebra.coeffLinearEquiv ℚ).toLinearMap + +theorem wordLieProjection_single (w : FreeMonoid (Fin n)) (q : ℚ) : + wordLieProjection X (MonoidAlgebra.single w q) = q • wordRightLie X w.toList := by + change Finsupp.linearCombination ℚ _ (Finsupp.single w q) = _ + exact Finsupp.linearCombination_single (R := ℚ) + (v := fun w : FreeMonoid (Fin n) => wordRightLie X w.toList) q w + +def rationalWordLetter (i : Fin n) : RationalWords n := + MonoidAlgebra.single (FreeMonoid.of i) 1 + +theorem wordLieProjection_letter_mul (i : Fin n) (p : RationalWords n) : + wordLieProjection X (rationalWordLetter i * p) = + X i * wordLieProjection X p - wordLieProjection X p * X i + p.coeff 1 • X i := by + induction p using MonoidAlgebra.induction_on with + | of w => + change wordLieProjection X (rationalWordLetter i * MonoidAlgebra.single w 1) = + X i * wordLieProjection X (MonoidAlgebra.single w 1) - + wordLieProjection X (MonoidAlgebra.single w 1) * X i + + (MonoidAlgebra.single w (1 : ℚ)).coeff 1 • X i + rw [rationalWordLetter, MonoidAlgebra.single_mul_single, one_mul, + wordLieProjection_single, wordLieProjection_single, one_smul, one_smul] + cases hw : w.toList with + | nil => + have hw1 : w = 1 := FreeMonoid.toList.injective hw + subst w + simp [wordRightLie, MonoidAlgebra.coeff_single] + | cons j l => + have hw1 : w ≠ 1 := by + intro h + simp [h] at hw + simp [wordRightLie, hw, MonoidAlgebra.coeff_single, hw1] + | add p q hp hq => + simp only [mul_add, map_add, hp, hq, add_mul, MonoidAlgebra.coeff_add, + Finsupp.add_apply, add_smul] + abel + | smul r p hp => + simp only [mul_smul_comm, map_smul, hp, smul_mul_assoc, MonoidAlgebra.coeff_smul, + Finsupp.smul_apply, smul_sub, smul_add, smul_smul, Algebra.mul_smul_comm, smul_eq_mul] + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Geometry/WordProjectionAdjoint.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Geometry/WordProjectionAdjoint.lean new file mode 100644 index 0000000000000000000000000000000000000000..509cafdcb356fdfca80e7c5783395f12874f3b40 --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Geometry/WordProjectionAdjoint.lean @@ -0,0 +1,50 @@ +import OAI.GroupTheory.PolycyclicRecognition.Algebra.RationalWordEvaluation +import Mathlib.Algebra.Lie.OfAssociative + +namespace OAI + +/-! # The adjoint action on the right-nested word projection -/ + +noncomputable section +namespace PolycyclicRecognition + +attribute [local instance 100] LieRing.ofAssociativeRing + +variable {A : Type*} [Ring A] [Algebra ℚ A] {n : ℕ} (X : Fin n → A) + +def rationalWordAdjoint : RationalWords n →ₐ[ℚ] Module.End ℚ A := + rationalWordEvaluation (fun i => LieAlgebra.ad ℚ A (X i)) + +theorem wordLieProjection_word_mul (w : FreeMonoid (Fin n)) (q : RationalWords n) + (hq : q.coeff 1 = 0) : + wordLieProjection X (MonoidAlgebra.single w 1 * q) = + FreeMonoid.lift (fun i => LieAlgebra.ad ℚ A (X i)) w (wordLieProjection X q) := by + induction w using FreeMonoid.recOn with + | one => simp [← MonoidAlgebra.one_def] + | of_mul i w ih => + have heq : MonoidAlgebra.single (FreeMonoid.of i * w) (1 : ℚ) = + rationalWordLetter i * MonoidAlgebra.single w 1 := by + rw [rationalWordLetter, MonoidAlgebra.single_mul_single, one_mul] + rw [heq, mul_assoc, wordLieProjection_letter_mul, rationalWord_emptyCoeff_mul, + hq, mul_zero, zero_smul, add_zero, ih, map_mul] + rw [show FreeMonoid.lift (fun i => LieAlgebra.ad ℚ A (X i)) (FreeMonoid.of i) = + LieAlgebra.ad ℚ A (X i) from rfl] + rfl + +theorem wordLieProjection_mul (p q : RationalWords n) (hq : q.coeff 1 = 0) : + wordLieProjection X (p * q) = rationalWordAdjoint X p (wordLieProjection X q) := by + induction p using MonoidAlgebra.induction_on with + | of w => + change wordLieProjection X (MonoidAlgebra.single w 1 * q) = _ + rw [wordLieProjection_word_mul X w q hq] + change _ = rationalWordEvaluation (fun i => LieAlgebra.ad ℚ A (X i)) + (MonoidAlgebra.single w 1) (wordLieProjection X q) + rw [rationalWordEvaluation_single, one_smul, ← FreeMonoid.lift_apply] + | add p r hp hr => simp only [add_mul, map_add, hp, hr, LinearMap.add_apply] + | smul r p hp => simp only [smul_mul_assoc, map_smul, hp, LinearMap.smul_apply] + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/GromovImport.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/GromovImport.lean new file mode 100644 index 0000000000000000000000000000000000000000..a2cf027f3228e82b91425934ab53747e60763c1b --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/GromovImport.lean @@ -0,0 +1,19 @@ +import OAI.GroupTheory.PolycyclicRecognition.Algebra.GromovGrowthBridge +import Gromov.FormalConjecturesCheck + +namespace OAI + +/-! # Gromov’s polynomial-growth theorem in arbitrary universes. -/ +namespace PolycyclicRecognition +universe u +variable {J : Type u} [Group J] [DecidableEq J] + +/-- Polynomial word growth implies virtual nilpotence in every universe. -/ +theorem gromovPolynomialGrowthInput : GromovPolynomialGrowthInput J := by + intro T hT hgen hgrowth + exact FormalConjecturesCheck.gromov_forward J + (hasPolynomialGrowth_of_wordBall T hT hgen hgrowth) + +end PolycyclicRecognition + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/AbelianCyclicFiniteIndexLattice.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/AbelianCyclicFiniteIndexLattice.lean new file mode 100644 index 0000000000000000000000000000000000000000..35cb8c671c6739780af796840f7bd881f9b97152 --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/AbelianCyclicFiniteIndexLattice.lean @@ -0,0 +1,45 @@ +import OAI.GroupTheory.PolycyclicRecognition.Algebra.RealMatrixSquareLogarithm +import OAI.GroupTheory.PolycyclicRecognition.Algebra.AbelianCyclicSquareLog + +namespace OAI + +/-! # Free-abelian-by-cyclic groups are virtually solvable Lie lattices + +No nilpotence assumption is required. Squaring the integral automorphism +permits a real logarithm, and its exponential supplies the real action. +-/ + +noncomputable section +namespace PolycyclicRecognition +variable {d : ℕ} + +theorem realIntegralLinearEquiv_square (a : MulAut (Multiplicative (Fin d → ℤ))) : + (realIntegralLinearEquiv (a ^ 2).toAdditive.toIntLinearEquiv).toLinearMap = + (realIntegralLinearEquiv a.toAdditive.toIntLinearEquiv).toLinearMap ^ 2 := by + let f : (Fin d → ℤ) →ₗ[ℤ] (Fin d → ℤ) := a.toAdditive.toIntLinearEquiv.toLinearMap + let g : (Fin d → ℤ) →ₗ[ℤ] (Fin d → ℤ) := (a ^ 2).toAdditive.toIntLinearEquiv.toLinearMap + change realLinearExtension g = realLinearExtension f ^ 2 + apply (Pi.basisFun ℝ (Fin d)).ext + intro i + change realLinearExtension g ((Pi.basisFun ℝ (Fin d)) i) = + realLinearExtension f (realLinearExtension f ((Pi.basisFun ℝ (Fin d)) i)) + rw [realLinearExtension_basis, realLinearExtension_basis, realLinearExtension_cast] + rfl + +theorem freeAbelian_cyclic_finiteIndex_lattice + (a : MulAut (Multiplicative (Fin d → ℤ))) : + ∃ Γ : Subgroup (Multiplicative (Fin d → ℤ) ⋊[integerPowerAction a] Multiplicative ℤ), + Γ.FiniteIndex ∧ + ∃ (S : SimplyConnectedSolvableLieModel) (Λ : Subgroup S.carrier), + IsUniformLattice Λ ∧ Nonempty (Γ ≃* Λ) := by + let A := realIntegralLinearEquiv a.toAdditive.toIntLinearEquiv + have hA : IsUnit A.toLinearMap := (Module.End.isUnit_iff _).mpr A.bijective + obtain ⟨D, hD⟩ := real_linear_square_has_log A.toLinearMap hA + apply freeAbelian_cyclic_finiteIndex_lattice_of_square_log a D + exact hD.trans (congrArg LinearMap.toContinuousLinearMap (realIntegralLinearEquiv_square a).symm) + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/AbelianCyclicLattice.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/AbelianCyclicLattice.lean new file mode 100644 index 0000000000000000000000000000000000000000..82ea2a775f653282846e17d32584d3fb5abd1ca8 --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/AbelianCyclicLattice.lean @@ -0,0 +1,59 @@ +import OAI.GroupTheory.PolycyclicRecognition.Lattices.FreeAbelianCyclicLattice +import OAI.GroupTheory.PolycyclicRecognition.Algebra.CyclicKernelSplitting +import OAI.GroupTheory.PolycyclicRecognition.Algebra.PolycyclicTorsionFree + +namespace OAI + +/-! # Lattice realization for torsion-free nilpotent groups with abelian cyclic kernel + +The nilpotency class is unrestricted. An abstract abelian kernel is identified +with its integral basis before applying the constructed real flow. +-/ + +noncomputable section +namespace PolycyclicRecognition +open scoped IsMulCommutative + +theorem abelian_cyclic_nilpotent_lattice {H : Type} [CommGroup H] [Group.FG H] + (htf : HasNoNontrivialTorsion H) (a : MulAut H) + [Group.IsNilpotent (H ⋊[integerPowerAction a] Multiplicative ℤ)] : + ∃ (S : SimplyConnectedSolvableLieModel) (Γ : Subgroup S.carrier), + IsUniformLattice Γ ∧ Nonempty ((H ⋊[integerPowerAction a] Multiplicative ℤ) ≃* Γ) := by + obtain ⟨d, ⟨e⟩⟩ := exists_integralLattice_equiv htf + let aZ : MulAut (IntegralLatticeGroup d) := e.trans (a.trans e.symm) + have he (x : IntegralLatticeGroup d) : e (aZ x) = a (e x) := by + change e (e.symm (a (e x))) = _ + exact e.apply_symm_apply _ + let E : (IntegralLatticeGroup d ⋊[integerPowerAction aZ] Multiplicative ℤ) ≃* + (H ⋊[integerPowerAction a] Multiplicative ℤ) := + SemidirectProduct.congr e (MulEquiv.refl _) (by + intro n + ext x + exact mulAut_zpow_semiconj aZ a e he n.toAdd x) + let : Group.IsNilpotent + (IntegralLatticeGroup d ⋊[integerPowerAction aZ] Multiplicative ℤ) := + Group.nilpotent_of_mulEquiv E.symm + obtain ⟨S, Γ, hΓ, ⟨f⟩⟩ := freeAbelian_cyclic_nilpotent_lattice aZ + exact ⟨S, Γ, hΓ, ⟨E.symm.trans f⟩⟩ + +theorem nilpotent_abelian_kernel_cyclic_lattice {G : Type} [Group G] + [Group.FG G] [Group.IsNilpotent G] (htf : HasNoNontrivialTorsion G) + (q : G →* Multiplicative ℤ) (hq : Function.Surjective q) + [IsMulCommutative q.ker] : + ∃ (S : SimplyConnectedSolvableLieModel) (Γ : Subgroup S.carrier), + IsUniformLattice Γ ∧ Nonempty (G ≃* Γ) := by + obtain ⟨t, ht⟩ := hq (Multiplicative.ofAdd 1) + let E := cyclicKernelEquiv q t ht + let : Group.FG q.ker := CriticalPercolation.nilpotent_subgroup_fg G q.ker + let : Group.IsNilpotent + (q.ker ⋊[integerPowerAction (MulAut.conjNormal t)] Multiplicative ℤ) := + Group.nilpotent_of_mulEquiv E.symm + obtain ⟨S, Γ, hΓ, ⟨f⟩⟩ := abelian_cyclic_nilpotent_lattice + (htf.of_injective q.ker.subtype Subtype.val_injective) (MulAut.conjNormal t) + exact ⟨S, Γ, hΓ, ⟨E.symm.trans f⟩⟩ + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/AbelianCyclicLogarithmLattice.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/AbelianCyclicLogarithmLattice.lean new file mode 100644 index 0000000000000000000000000000000000000000..3e43be637d56dfb452e79433044453a37c4325bf --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/AbelianCyclicLogarithmLattice.lean @@ -0,0 +1,36 @@ +import OAI.GroupTheory.PolycyclicRecognition.Geometry.LinearExponentialAction +import OAI.GroupTheory.PolycyclicRecognition.Lattices.SmoothRealActionLattice +import OAI.GroupTheory.PolycyclicRecognition.Lattices.FreeAbelianCyclicLattice + +namespace OAI + +/-! # The abelian cyclic lattice step from a real matrix logarithm + +The real logarithm is a separate, explicit linear algebra obligation. Once +it is provided, the actual Lie model and compact lattice cover are constructed. +-/ + +noncomputable section +namespace PolycyclicRecognition +variable {d : ℕ} + +theorem freeAbelian_cyclic_lattice_of_linear_log + (a : MulAut (Multiplicative (Fin d → ℤ))) + (D : AbelianRealSpace d →L[ℝ] AbelianRealSpace d) + (hD : NormedSpace.exp D = + (realIntegralLinearEquiv a.toAdditive.toIntLinearEquiv).toContinuousLinearEquiv.toContinuousLinearMap) : + ∃ (S : SimplyConnectedSolvableLieModel) (Γ : Subgroup S.carrier), + IsUniformLattice Γ ∧ + Nonempty ((Multiplicative (Fin d → ℤ) ⋊[integerPowerAction a] Multiplicative ℤ) ≃* Γ) := by + apply smooth_realAction_cyclic_lattice (linearExponentialAction D) + (linearExponentialAction_smooth D) a (abelianRealLattice d) + (abelianRealLattice_uniform d) (abelianRealLatticeEquiv d) + intro x + rw [linearExponentialAction_apply, one_smul, hD] + exact (realIntegralGroupAut_lattice a x).symm + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/AbelianLatticeKernel.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/AbelianLatticeKernel.lean new file mode 100644 index 0000000000000000000000000000000000000000..75fa4a6093096fa4aa0ce42c8998ad8b41bbf67c --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/AbelianLatticeKernel.lean @@ -0,0 +1,41 @@ +import OAI.GroupTheory.PolycyclicRecognition.Lattices.NilpotentLatticeInnerAdjoint + +namespace OAI + +/-! # Commutativity passes to the actual nilpotent lattice completion -/ + +noncomputable section +namespace PolycyclicRecognition.NilpotentLatticeCoordinates +open scoped IsMulCommutative +variable {N : Type} [Group N] [IsMulCommutative N] (C : NilpotentLatticeCoordinates N) + +theorem completed_kernel_mul_comm (u v : C.carrier) : u * v = v * u := by + have hl (n : N) (x : C.carrier) : (C.equiv n : C.carrier) * x * (C.equiv n : C.carrier)⁻¹ = x := by + rw [← C.automorphism_inner_apply] + have hn : MulAut.conj n = 1 := by + apply DFunLike.ext + intro y + change n * y * n⁻¹ = y + rw [mul_comm n y, mul_inv_cancel_right] + rw [hn, C.automorphism_one] + rfl + have hp : IsPolynomialInBasis C.basis C.basis + (fun x : C.carrier => u * x * u⁻¹) := by + have he : (fun x : C.carrier => u * x * u⁻¹) = adjointLinearMap (E := C.carrier) u := + funext (fun x => (polynomial_adjoint_apply u x).symm) + rw [he] + exact IsPolynomialInBasis.linear (adjointLinearMap (E := C.carrier) u).toLinearMap + have he : (fun x : C.carrier => u * x * u⁻¹) = id := + C.ext_polynomial hp (IsPolynomialInBasis.linear (LinearMap.id)) (by + intro n + have hn := hl n u + rw [mul_inv_eq_iff_eq_mul] at hn + change u * (C.equiv n : C.carrier) * u⁻¹ = C.equiv n + rw [← hn, mul_inv_cancel_right]) + exact mul_inv_eq_iff_eq_mul.mp (congrFun he v) + +end PolycyclicRecognition.NilpotentLatticeCoordinates + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/AbelianLatticeRealization.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/AbelianLatticeRealization.lean new file mode 100644 index 0000000000000000000000000000000000000000..9331b47c735043a50f4facffcc9d8f9f4a486873 --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/AbelianLatticeRealization.lean @@ -0,0 +1,50 @@ +import OAI.GroupTheory.PolycyclicRecognition.Lattices.VectorLatticeModel +import OAI.GroupTheory.PolycyclicRecognition.Algebra.PolycyclicTorsionFree + +namespace OAI + +/-! # Solvable lattice realization for virtually abelian groups + +The finite-index torsion-free subgroup is an integral lattice. Its embedding +into the actual additive vector Lie group has a compact fundamental cover. +This discharges the virtually abelian case of Dekimpe's realization input. +-/ + +noncomputable section +namespace PolycyclicRecognition +open scoped IsMulCommutative Manifold +variable {P : Type} [Group P] [Group.FG P] + +theorem solvable_lattice_realization_of_finiteIndex_abelian + (H : Subgroup P) [H.FiniteIndex] [IsMulCommutative H] : + ∃ Γ : Subgroup P, Γ.FiniteIndex ∧ + ∃ (S : SimplyConnectedSolvableLieModel) (Λ : Subgroup S.carrier), + IsUniformLattice Λ ∧ Nonempty (Γ ≃* Λ) := by + have hH : IsPolycyclic H := isPolycyclic_of_finitelyGenerated_commGroup H + obtain ⟨K, hKi, hKtf⟩ := hH.exists_torsionFree_finiteIndex + let := hKi + obtain ⟨n, ⟨e⟩⟩ := exists_integralLattice_equiv hKtf + let Γ := K.map H.subtype + have hΓi : Γ.FiniteIndex := ⟨by + change (K.map H.subtype).index ≠ 0 + rw [Subgroup.index_map_subtype] + exact mul_ne_zero hKi.index_ne_zero (inferInstance : H.FiniteIndex).index_ne_zero⟩ + let eK : K ≃* Γ := K.equivMapOfInjective H.subtype H.subtype_injective + exact ⟨Γ, hΓi, vectorSolvableLieModel n, standardVectorLattice n, + standardVectorLattice_uniform n, + ⟨(eK.symm.trans e.symm).trans (standardVectorLatticeEquiv n)⟩⟩ + +theorem dekimpe_realization_of_finiteIndex_abelian + (H : Subgroup P) [H.FiniteIndex] [IsMulCommutative H] : + ∃ Γ : Subgroup P, Γ.FiniteIndex ∧ + ∃ (S : SimplyConnectedSolvableLieModel) (Λ : Subgroup S.carrier), + DiscreteTopology Λ ∧ CompactSpace (S.carrier ⧸ Λ) ∧ Nonempty (Γ ≃* Λ) := by + obtain ⟨Γ, hΓ, S, Λ, hΛ, e⟩ := solvable_lattice_realization_of_finiteIndex_abelian H + let : IsTopologicalGroup S.carrier := topologicalGroup_of_lieGroup (𝓘(ℝ, S.modelSpace)) ⊤ + exact ⟨Γ, hΓ, S, Λ, hΛ.1, hΛ.compactSpace_quotient, e⟩ + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/BilinearCentralLattice.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/BilinearCentralLattice.lean new file mode 100644 index 0000000000000000000000000000000000000000..c9c545ba784a415ba1add4004e9c0ef58279d26a --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/BilinearCentralLattice.lean @@ -0,0 +1,80 @@ +import OAI.GroupTheory.PolycyclicRecognition.Geometry.BilinearCentralLieModel + +namespace OAI + +/-! # Uniform lattices for integral bilinear central extensions + +The central coordinate of a fundamental-domain representative is reduced +after subtracting the bilinear correction from the first coordinate. +-/ + +noncomputable section +namespace PolycyclicRecognition +open Set Module + +variable {V W : Type} [NormedAddCommGroup V] [NormedAddCommGroup W] + [NormedSpace ℝ V] [NormedSpace ℝ W] [FiniteDimensional ℝ V] [FiniteDimensional ℝ W] + {d e : ℕ} (b : Basis (Fin d) ℝ V) (c : Basis (Fin e) ℝ W) + (B : V →L[ℝ] V →L[ℝ] W) + (hB : ∀ x ∈ Submodule.span ℤ (range b), ∀ y ∈ Submodule.span ℤ (range b), + B x y ∈ Submodule.span ℤ (range c)) + +def bilinearCentralLattice : Subgroup (bilinearCentralLieModel B).carrier where + carrier := {x | x.1 ∈ Submodule.span ℤ (range b) ∧ + x.2 ∈ Submodule.span ℤ (range c)} + one_mem' := ⟨Submodule.zero_mem _, Submodule.zero_mem _⟩ + mul_mem' := by + intro x y hx hy + exact ⟨Submodule.add_mem _ hx.1 hy.1, + Submodule.add_mem _ (Submodule.add_mem _ hx.2 hy.2) (hB _ hx.1 _ hy.1)⟩ + inv_mem' := by + intro x hx + exact ⟨Submodule.neg_mem _ hx.1, + Submodule.add_mem _ (Submodule.neg_mem _ hx.2) (hB _ hx.1 _ hx.1)⟩ + +theorem bilinearCentralLattice_discrete : + DiscreteTopology (bilinearCentralLattice b c B hB) := by + let L := Submodule.span ℤ (range b) + let M := Submodule.span ℤ (range c) + let f : bilinearCentralLattice b c B hB → L × M := + fun x => (⟨x.val.1, x.property.1⟩, ⟨x.val.2, x.property.2⟩) + have hval : Continuous (fun x : bilinearCentralLattice b c B hB => (x.val : V × W)) := + continuous_subtype_val + have hf : Continuous f := by + exact (hval.fst.subtype_mk _).prodMk (hval.snd.subtype_mk _) + apply DiscreteTopology.of_continuous_injective hf + intro x y h + apply Subtype.ext + exact Prod.ext (congrArg (fun z : L × M => z.1.val) h) + (congrArg (fun z : L × M => z.2.val) h) + +theorem bilinearCentralLattice_uniform : + IsUniformLattice (bilinearCentralLattice b c B hB) := by + refine ⟨bilinearCentralLattice_discrete b c B hB, ?_⟩ + let K : Set (V × W) := parallelepiped b ×ˢ parallelepiped c + have hK : IsCompact K := b.parallelepiped.isCompact.prod c.parallelepiped.isCompact + refine ⟨K, hK, ?_⟩ + intro g + let a := ZSpan.floor b g.1 + let u := ZSpan.fract b g.1 + let z := g.2 - B a u + let q := ZSpan.floor c z + let v := ZSpan.fract c z + refine ⟨⟨((a : V), (q : W)), a.property, q.property⟩, (u, v), ?_, ?_⟩ + · exact ⟨ZSpan.fundamentalDomain_subset_parallelepiped b + (ZSpan.fract_mem_fundamentalDomain b g.1), + ZSpan.fundamentalDomain_subset_parallelepiped c + (ZSpan.fract_mem_fundamentalDomain c z)⟩ + · apply Prod.ext + · change (a : V) + u = g.1 + dsimp only [a, u, ZSpan.fract] + abel + · change (q : W) + v + B a u = g.2 + dsimp only [q, v, ZSpan.fract, z] + abel + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/CartanNilshadow.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/CartanNilshadow.lean new file mode 100644 index 0000000000000000000000000000000000000000..6992a1dcd718eb1c2e961b0fd47712714ba6c5b7 --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/CartanNilshadow.lean @@ -0,0 +1,124 @@ +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CartanJordanDecomposition +import Mathlib.Algebra.Lie.SemiDirect + +namespace OAI + +/-! # The nilpotent Lie algebra attached to the Cartan height action + +The graph of minus the semisimple height action is a Lie subalgebra of the +affine derivation algebra. Its first coordinate is linearly the original Lie +algebra, while its bracket has the semisimple action removed. +-/ + +noncomputable section +namespace PolycyclicRecognition + +open LieAlgebra Module + +variable {L : Type*} [LieRing L] [LieAlgebra ℝ L] [FiniteDimensional ℝ L] + {n : ℕ} (T : TriangularAdjoint L n) + (H : LieSubalgebra ℝ L) [H.IsCartanSubalgebra] + +def cartanNilshadowSubalgebra : + LieSubalgebra ℝ (L ⋊⁅(LieHom.id : LieDerivation ℝ L L →ₗ⁅ℝ⁆ LieDerivation ℝ L L)⁆ + LieDerivation ℝ L L) where + carrier := {p | p.right = -heightSemisimpleAction T H p.left} + zero_mem' := by simp + add_mem' {p q} hp hq := by + change p.right + q.right = -heightSemisimpleAction T H (p.left + q.left) + rw [hp, hq, map_add, neg_add] + smul_mem' r {p} hp := by + change r • p.right = -heightSemisimpleAction T H (r • p.left) + rw [hp, map_smul, smul_neg] + lie_mem' {p q} hp hq := by + change ⁅p.right, q.right⁆ = -heightSemisimpleAction T H + (⁅p.left, q.left⁆ + p.right q.left - q.right p.left) + rw [hp, hq] + simp only [neg_lie, lie_neg, heightSemisimpleAction_commute, + LieDerivation.neg_apply, map_add, map_sub, map_neg, + heightSemisimpleAction_lie, heightSemisimpleAction_annihilate, neg_zero, + add_zero, sub_zero] + +abbrev CartanNilshadow := cartanNilshadowSubalgebra T H + +def cartanNilshadowEquiv : L ≃ₗ[ℝ] CartanNilshadow T H where + toFun x := ⟨⟨x, -heightSemisimpleAction T H x⟩, rfl⟩ + invFun p := p.val.left + left_inv _ := rfl + right_inv p := by + apply Subtype.ext + apply SemiDirectSum.ext + · rfl + · exact p.property.symm + map_add' x y := by + apply Subtype.ext + apply SemiDirectSum.ext + · rfl + · change -heightSemisimpleAction T H (x + y) = + -heightSemisimpleAction T H x + -heightSemisimpleAction T H y + rw [map_add, neg_add] + map_smul' r x := by + apply Subtype.ext + apply SemiDirectSum.ext + · rfl + · change -heightSemisimpleAction T H (r • x) = r • -heightSemisimpleAction T H x + rw [map_smul, smul_neg] + +instance : FiniteDimensional ℝ (CartanNilshadow T H) := + (cartanNilshadowEquiv T H).finiteDimensional + +theorem cartanNilshadow_bracket (x y : L) : + (cartanNilshadowEquiv T H).symm ⁅cartanNilshadowEquiv T H x, + cartanNilshadowEquiv T H y⁆ = + ⁅x, y⁆ - heightSemisimpleAction T H x y + heightSemisimpleAction T H y x := by + change ⁅x, y⁆ + (-heightSemisimpleAction T H x) y - + (-heightSemisimpleAction T H y) x = _ + simp only [LieDerivation.neg_apply] + abel + +private theorem nilpotent_of_square_eq_mul {V : Type*} [AddCommGroup V] [Module ℝ V] + {A F : Module.End ℝ V} (hA : IsNilpotent A) (hFF : F * F = A * F) : IsNilpotent F := by + have hp (k : ℕ) : F ^ (k + 1) = A ^ k * F := by + induction k with + | zero => simp + | succ k hk => + calc + F ^ (k + 1 + 1) = F ^ (k + 1) * F := pow_succ _ _ + _ = A ^ k * (F * F) := by rw [hk, mul_assoc] + _ = A ^ (k + 1) * F := by rw [hFF, ← mul_assoc, pow_succ] + obtain ⟨k, hk⟩ := hA + exact ⟨k + 1, by rw [hp, hk, zero_mul]⟩ + +/-- The Cartan graph is nilpotent; no nilshadow theorem is assumed. -/ +theorem cartanNilshadow_nilpotent : LieRing.IsNilpotent (CartanNilshadow T H) := by + let e := cartanNilshadowEquiv T H + apply (LieAlgebra.isNilpotent_iff_forall (R := ℝ)).mpr + intro p + obtain ⟨x, rfl⟩ := e.surjective p + let F : Module.End ℝ L := e.symm.conjRingEquiv (ad ℝ (CartanNilshadow T H) (e x)) + let A : Module.End ℝ L := ad ℝ L x - (heightSemisimpleAction T H x).toLinearMap + have hF (y : L) : F y = ⁅x, y⁆ - heightSemisimpleAction T H x y + + heightSemisimpleAction T H y x := cartanNilshadow_bracket T H x y + have hFh (y : L) : heightProjection T.character (F y) = 0 := by + rw [hF, map_add, map_sub, T.height_lie, heightSemisimpleAction_height_zero, + heightSemisimpleAction_height_zero, sub_self, add_zero] + have hFr (y : L) (hy : heightProjection T.character y = 0) : F y = A y := by + have hs : heightSemisimpleAction T H y = 0 := by + change cartanWeightDerivationLinear T H + (cartanHeightSection T H (heightProjection T.character y)) = 0 + rw [hy, map_zero, map_zero] + rw [hF, hs, LieDerivation.zero_apply, add_zero] + rfl + have hFF : F * F = A * F := by + ext y + exact hFr (F y) (hFh y) + obtain ⟨k, hk⟩ := nilpotent_of_square_eq_mul (heightReducedAdjoint_nilpotent T H x) hFF + refine ⟨k, e.symm.conjRingEquiv.injective ?_⟩ + rw [map_pow, map_zero] + exact hk + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/CompletedExtensionCentralizer.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/CompletedExtensionCentralizer.lean new file mode 100644 index 0000000000000000000000000000000000000000..dd8ec25446cfb22d5883b83fd662fe3dd4f4ca78 --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/CompletedExtensionCentralizer.lean @@ -0,0 +1,49 @@ +import OAI.GroupTheory.PolycyclicRecognition.Algebra.NilpotentExtensionLangSplitting +import OAI.GroupTheory.PolycyclicRecognition.Algebra.ExtensionCentralizerKernel + +namespace OAI + +/-! # Semisimple centralizer reduction for the completed lattice extension -/ + +noncomputable section +namespace PolycyclicRecognition.NilpotentLatticeCoordinates +open scoped Manifold ContDiff IsMulCommutative +variable {N G Q : Type} [Group N] [Group G] [Group Q] + (C : NilpotentLatticeCoordinates N) (S : GroupExtension N G Q) + (σ : S.Section) (hσ : σ 1 = 1) + +theorem completedExtension_conjugation_smooth + (g : FactorExtension (C.extensionFactorSystem S σ hσ)) : + ContMDiff (𝓘(ℝ, C.carrier)) (𝓘(ℝ, C.carrier)) ∞ + ((FactorExtension.groupExtension (C.extensionFactorSystem S σ hσ)).conjAct g) := by + rw [FactorExtension.conjugation_eq] + exact ((contMDiff_conjugation g.left).of_le (by simp)).comp + (C.extensionFactorSystem_smooth S σ hσ g.right) + +/-- No fixed-point-free condition: the actual centralizer surjects onto the +whole original quotient, and its intersection with the kernel is explicit. -/ +theorem completedExtension_semisimple_centralizer [IsMulCommutative Q] (q : Q) : + ∃ T : C.carrier ≃ₗ⁅ℝ⁆ C.carrier, Module.End.IsSemisimple T.toLinearMap ∧ + Function.Surjective + ((FactorExtension.groupExtension (C.extensionFactorSystem S σ hσ)).rightHom.comp + (semisimpleActionCentralizer + (FactorExtension.groupExtension (C.extensionFactorSystem S σ hσ)) T).subtype) ∧ + ∀ x : C.carrier, + (FactorExtension.groupExtension (C.extensionFactorSystem S σ hσ)).inl x ∈ + semisimpleActionCentralizer + (FactorExtension.groupExtension (C.extensionFactorSystem S σ hσ)) T ↔ + ∃ z y : C.carrier, z ∈ Subgroup.center C.carrier ∧ T y = y ∧ x = z * y := by + let E := FactorExtension.groupExtension (C.extensionFactorSystem S σ hσ) + let t : FactorExtension (C.extensionFactorSystem S σ hσ) := ⟨1, q⟩ + let hs := C.completedExtension_conjugation_smooth S σ hσ + let A := polynomialModelLieEquiv (E.conjAct t) (hs t) + obtain ⟨T, U, hT, hU, hTU, hA⟩ := real_lie_jordan_decomposition A + refine ⟨T, hT, extension_semisimple_centralizer_surjective E hs t T U hT hU hTU hA, ?_⟩ + intro x + exact extension_semisimple_centralizer_kernel E T hT x + +end PolycyclicRecognition.NilpotentLatticeCoordinates + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/CyclicCompletionHomUniqueness.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/CyclicCompletionHomUniqueness.lean new file mode 100644 index 0000000000000000000000000000000000000000..15de070e08bd2aecb1f62402c50b511806cd25c9 --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/CyclicCompletionHomUniqueness.lean @@ -0,0 +1,64 @@ +import OAI.GroupTheory.PolycyclicRecognition.Geometry.NilpotentSemidirectGroup +import OAI.GroupTheory.PolycyclicRecognition.Algebra.PolynomialOneParameterUniqueness + +namespace OAI + +/-! # Uniqueness of smooth homomorphisms from a real cyclic completion -/ + +noncomputable section +namespace PolycyclicRecognition +open scoped Manifold ContDiff +variable {L M : Type} [RealNormedLieAlgebra L] [FiniteDimensional ℝ L] + [RealNormedLieAlgebra M] [FiniteDimensional ℝ M] + [P : PolynomialExponentialCoordinates L] [Q : PolynomialExponentialCoordinates M] + +theorem cyclicCompletionHom_ext (D : LieDerivation ℝ L L) (hD : IsNilpotent D.toLinearMap) : + letI := derivationSemidirectGroup D hD + letI : MulOneClass (L × ℝ) := (derivationSemidirectGroup D hD).toMulOneClass + ∀ (φ ψ : (L × ℝ) →* M), + ContMDiff (𝓘(ℝ, L × ℝ)) (𝓘(ℝ, M)) ∞ φ → + ContMDiff (𝓘(ℝ, L × ℝ)) (𝓘(ℝ, M)) ∞ ψ → + (∀ x : L, φ (x, 0) = ψ (x, 0)) → + φ (0, 1) = ψ (0, 1) → φ = ψ := by + let := derivationSemidirectGroup D hD + let : Mul (L × ℝ) := (derivationSemidirectGroup D hD).toMul + let : One (L × ℝ) := (derivationSemidirectGroup D hD).toOne + let : Monoid (L × ℝ) := (derivationSemidirectGroup D hD).toMonoid + let : MulOneClass (L × ℝ) := (derivationSemidirectGroup D hD).toMulOneClass + intro φ ψ hφ hψ hk ht + have haxis (s t : ℝ) : ((0, s + t) : L × ℝ) = + (derivationSemidirectGroup D hD).mul (0, s) (0, t) := by + rw [derivationSemidirect_mul] + change (0, s + t) = (0 * nilpotentDerivationFlow D hD s 0, s + t) + rw [map_zero] + have hz : (0 : L) * 0 = 0 := by rw [← P.one_eq_zero, mul_one] + rw [hz] + have hφ0 : φ (0, 0) = 1 := + (congrArg φ (derivationSemidirect_one D hD).symm).trans φ.map_one + have hψ0 : ψ (0, 0) = 1 := + (congrArg ψ (derivationSemidirect_one D hD).symm).trans ψ.map_one + have htime (t : ℝ) : φ (0, t) = ψ (0, t) := by + rw [polynomial_oneParameter_eq_smul (fun r => φ (0, r)) hφ0 + (fun s t => (congrArg φ (haxis s t)).trans (φ.map_mul _ _)) + (hφ.contDiff.comp (contDiff_const.prodMk contDiff_id)), + polynomial_oneParameter_eq_smul (fun r => ψ (0, r)) hψ0 + (fun s t => (congrArg ψ (haxis s t)).trans (ψ.map_mul _ _)) + (hψ.contDiff.comp (contDiff_const.prodMk contDiff_id)), ht] + apply MonoidHom.ext + intro p + have hp : p = (derivationSemidirectGroup D hD).mul (p.1, 0) (0, p.2) := by + rw [derivationSemidirect_mul, map_zero] + change p = (p.1 * (0 : L), 0 + p.2) + rw [← P.one_eq_zero, mul_one, zero_add] + calc + φ p = φ ((derivationSemidirectGroup D hD).mul (p.1, 0) (0, p.2)) := congrArg φ hp + _ = φ (p.1, 0) * φ (0, p.2) := φ.map_mul _ _ + _ = ψ (p.1, 0) * ψ (0, p.2) := by rw [hk, htime] + _ = ψ ((derivationSemidirectGroup D hD).mul (p.1, 0) (0, p.2)) := (ψ.map_mul _ _).symm + _ = ψ p := congrArg ψ hp.symm + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/DerivationSolvableModel.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/DerivationSolvableModel.lean new file mode 100644 index 0000000000000000000000000000000000000000..7e76f570c38254dff4b8a5f0ea086a6299b358a1 --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/DerivationSolvableModel.lean @@ -0,0 +1,66 @@ +import OAI.GroupTheory.PolycyclicRecognition.Geometry.NilpotentSemidirectGroup +import OAI.GroupTheory.PolycyclicRecognition.Lattices.SolvableLatticeModel +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CompactSemidirectModel +import OAI.GroupTheory.PolycyclicRecognition.Lattices.UniformLatticeTransport +import OAI.GroupTheory.PolycyclicRecognition.Lattices.SemidirectUniformLattice +import Mathlib.Analysis.Convex.Contractible + +namespace OAI + +/-! # The solvable real model of a nilpotent derivation extension -/ + +noncomputable section +namespace PolycyclicRecognition +open scoped Manifold +variable {L : Type} [RealNormedLieAlgebra L] [FiniteDimensional ℝ L] + [P : PolynomialExponentialCoordinates L] [Group.IsSolvable L] + (D : LieDerivation ℝ L L) (hD : IsNilpotent D.toLinearMap) + +def derivationSolvableLieModel : SimplyConnectedSolvableLieModel := by + let g : Group (L × ℝ) := derivationSemidirectGroup D hD + let : Mul (L × ℝ) := g.toMul + let : One (L × ℝ) := g.toOne + let : Monoid (L × ℝ) := g.toMonoid + let : MulOneClass (L × ℝ) := g.toMulOneClass + let : Group (L × ℝ) := g + let : LieGroup (𝓘(ℝ, L × ℝ)) ⊤ (L × ℝ) := derivationSemidirectLieGroup D hD + let e : (L × ℝ) ≃* (L ⋊[P.derivationAction D hD] Multiplicative ℝ) := + { derivationSemidirectEquiv D hD with map_mul' := fun _ _ => rfl } + let : Group.IsSolvable (L ⋊[P.derivationAction D hD] Multiplicative ℝ) := + semidirect_solvable _ + let : Group.IsSolvable (L × ℝ) := + @Group.isSolvable_of_isSolvable_injective (L × ℝ) + (L ⋊[P.derivationAction D hD] Multiplicative ℝ) + g inferInstance e.toMonoidHom e.injective inferInstance + exact { modelSpace := L × ℝ, carrier := L × ℝ } + +def derivationModelEquiv : (derivationSolvableLieModel D hD).carrier ≃* + (L ⋊[P.derivationAction D hD] Multiplicative ℝ) := + { derivationSemidirectEquiv D hD with map_mul' := fun _ _ => rfl } + +attribute [local instance] semidirectProductTopology + +theorem continuous_derivationModelEquiv : Continuous (derivationModelEquiv D hD) := by + change Continuous ((semidirectProductHomeomorph (P.derivationAction D hD)).symm ∘ + (fun p : L × ℝ => (p.1, Multiplicative.ofAdd p.2))) + exact (semidirectProductHomeomorph _).symm.continuous.comp continuous_id + +theorem continuous_derivationModelEquiv_symm : Continuous (derivationModelEquiv D hD).symm := by + change Continuous ((fun p : L × Multiplicative ℝ => (p.1, p.2.toAdd)) ∘ + (semidirectProductHomeomorph (P.derivationAction D hD))) + exact continuous_id.comp (semidirectProductHomeomorph _).continuous + +theorem derivationModel_lattice (Λ : Subgroup L) (Δ : Subgroup (Multiplicative ℝ)) + (hstable : ∀ t ∈ Δ, ∀ x ∈ Λ, P.derivationAction D hD t x ∈ Λ) + (hΛ : IsUniformLattice Λ) (hΔ : IsUniformLattice Δ) : + IsUniformLattice ((semidirectLattice (P.derivationAction D hD) Λ Δ hstable).comap + (derivationModelEquiv D hD).toMonoidHom) := by + exact (semidirectLattice_uniform _ _ _ hstable hΛ hΔ).comap_mulEquiv + (derivationModelEquiv D hD) (continuous_derivationModelEquiv D hD) + (continuous_derivationModelEquiv_symm D hD) + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/ExtensionFixedCocycleSection.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/ExtensionFixedCocycleSection.lean new file mode 100644 index 0000000000000000000000000000000000000000..300a121145eae0228491ba19d67c63bb806ce568 --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/ExtensionFixedCocycleSection.lean @@ -0,0 +1,80 @@ +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CentralizerLiftJordanFactor +import OAI.GroupTheory.PolycyclicRecognition.Algebra.SemisimpleCocycleReduction +import OAI.GroupTheory.PolycyclicRecognition.Algebra.GaugeExtensionSection + +namespace OAI + +/-! # A section with semisimple-fixed factors in the original extension + +Starting with an actual quotient lift, the semisimple centralizer still maps +onto the quotient. Its moving central cocycle is removed by the constructed +Lang correction, and the resulting section is returned in the original group. +-/ + +noncomputable section +namespace PolycyclicRecognition +open scoped Manifold ContDiff IsMulCommutative +attribute [local instance] polynomialSubalgebraGroup +variable {L G Q : Type} [RealNormedLieAlgebra L] [FiniteDimensional ℝ L] + [P : PolynomialExponentialCoordinates L] [LieRing.IsNilpotent L] + [Group G] [Group Q] [IsMulCommutative Q] + +theorem extension_exists_semisimple_fixed_cocycle_section (E : GroupExtension L G Q) + (hsmooth : ∀ g : G, ContMDiff (𝓘(ℝ, L)) (𝓘(ℝ, L)) ∞ (E.conjAct g)) + (t : G) (S U : L ≃ₗ⁅ℝ⁆ L) + (hS : Module.End.IsSemisimple S.toLinearMap) + (hU : IsNilpotent (U.toLinearMap - 1)) + (hSU : Commute S.toLinearMap U.toLinearMap) + (hA : (polynomialModelLieEquiv (E.conjAct t) (hsmooth t)).toLinearMap = + S.toLinearMap * U.toLinearMap) : + ∃ σ : E.Section, σ 1 = 1 ∧ + (∀ q, σ q ∈ semisimpleActionCentralizer E S) ∧ + ∀ q r, S (GroupExtensionSection.factor E σ q r) = GroupExtensionSection.factor E σ q r := by + have hsurj := extension_semisimple_centralizer_surjective E hsmooth t S U hS hU hSU hA + let D := semisimpleCentralizerExtension E S hsurj + let σ := normalizedExtensionSection D + have hσ : σ 1 = 1 := normalizedExtensionSection_one D + let F := GroupExtensionSection.factorSystem D σ hσ + let A := fun q => polynomialModelLieEquiv (E.conjAct (σ q : G)) (hsmooth (σ q)) + have hSA : ∀ q, Commute S.toLinearMap (A q).toLinearMap := by + intro q + exact (mem_semisimpleActionCentralizer_iff E S (σ q) (hsmooth (σ q))).mp (σ q).property + have hact : ∀ q x, (F.action q x : L) = A q x := by + intro q x + change (D.conjAct (σ q) x : L) = A q x + rw [semisimpleCentralizerExtension_conjAct] + exact (polynomialModelLieEquiv_apply _ _ _).symm + have ht : t ∈ semisimpleActionCentralizer E S := by + apply (mem_semisimpleActionCentralizer_iff E S t (hsmooth t)).mpr + rw [hA] + exact (Commute.refl _).mul_right hSU + obtain ⟨W, hW, hSW, he⟩ := centralizer_same_fiber_jordan_factor E hsmooth S U t + (σ (E.rightHom t)) ht (σ _).property + (σ.rightHom_section (E.rightHom t)) hU hSU hA + obtain ⟨b, hb, hfixed⟩ := semisimple_cocycle_reduction S hS F A hSA hact + (E.rightHom t) W hW hSW he + let σb := GroupExtensionSection.gaugeSection D σ b + let θ : E.Section := + { toFun q := (σb q : G) + rightInverse_rightHom q := σb.rightHom_section q } + refine ⟨θ, ?_, fun q => (σb q).property, ?_⟩ + · exact congrArg Subtype.val (GroupExtensionSection.gaugeSection_one D σ hσ b hb) + · intro q r + have hfactor : ((GroupExtensionSection.factor D σb q r : innerCentralizerLieSubalgebra S) : L) = + GroupExtensionSection.factor E θ q r := by + apply E.inl_injective + have hh := congrArg Subtype.val (GroupExtensionSection.inl_factor D σb q r) + change E.inl ((GroupExtensionSection.factor D σb q r : innerCentralizerLieSubalgebra S) : L) = + (σb q : G) * (σb r : G) * (σb (q * r) : G)⁻¹ at hh + exact hh.trans (GroupExtensionSection.inl_factor E θ q r).symm + rw [← hfactor] + have heq := GroupExtensionSection.factor_gaugeSection D σ hσ b hb q r + change GroupExtensionSection.factor D σb q r = (F.gauge b hb).factor q r at heq + rw [heq] + exact hfixed q r + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/FiniteFixedCocycleSection.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/FiniteFixedCocycleSection.lean new file mode 100644 index 0000000000000000000000000000000000000000..156aff8ec4f903221b0ec0ad6f4d49e8bb17889b --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/FiniteFixedCocycleSection.lean @@ -0,0 +1,113 @@ +import OAI.GroupTheory.PolycyclicRecognition.Algebra.FiniteSemisimpleCocycleReduction +import OAI.GroupTheory.PolycyclicRecognition.Lattices.ExtensionFixedCocycleSection +import OAI.GroupTheory.PolycyclicRecognition.Algebra.SubgroupExtensionSection + +namespace OAI + +/-! # Simultaneously fixed section factors for finitely many quotient lifts + +The original extension has a normalized section centralizing a finite +commuting semisimple family. All its factors are fixed by that entire family, +and the specified quotient elements retain their semisimple Jordan factors. +-/ + +noncomputable section +namespace PolycyclicRecognition +open scoped Manifold ContDiff IsMulCommutative +variable {L G Q : Type} [RealNormedLieAlgebra L] [FiniteDimensional ℝ L] + [P : PolynomialExponentialCoordinates L] [LieRing.IsNilpotent L] + [Group G] [Group Q] [IsMulCommutative Q] + +omit [LieRing.IsNilpotent L] [IsMulCommutative Q] in +theorem inl_mem_semisimpleCentralizer_of_center (E : GroupExtension L G Q) + (S : L ≃ₗ⁅ℝ⁆ L) (x : L) (hx : x ∈ Subgroup.center L) : + E.inl x ∈ semisimpleActionCentralizer E S := by + have hi : MulAut.conj x = 1 := by + apply DFunLike.ext + intro y + change x * y * x⁻¹ = y + rw [← Subgroup.mem_center_iff.mp hx y] + group + change E.conjAct (E.inl x) ∈ + Subgroup.centralizer {PolynomialExponentialCoordinates.groupAutomorphism (P := P) S} + rw [extension_conjAct_inl, hi] + exact Subgroup.one_mem _ + +theorem exists_finite_fixed_cocycle_section (E : GroupExtension L G Q) + (hsmooth : ∀ g : G, ContMDiff (𝓘(ℝ, L)) (𝓘(ℝ, L)) ∞ (E.conjAct g)) (qs : List Q) : + ∃ ss : List (L ≃ₗ⁅ℝ⁆ L), + (∀ S ∈ ss, Module.End.IsSemisimple S.toLinearMap) ∧ + (∀ S ∈ ss, ∀ T ∈ ss, Commute S.toLinearMap T.toLinearMap) ∧ + ∃ σ : E.Section, σ 1 = 1 ∧ + (∀ S ∈ ss, ∀ q, σ q ∈ semisimpleActionCentralizer E S) ∧ + (∀ S ∈ ss, ∀ q r, S (GroupExtensionSection.factor E σ q r) = + GroupExtensionSection.factor E σ q r) ∧ + ∀ q ∈ qs, ∃ S ∈ ss, ∃ U : L ≃ₗ⁅ℝ⁆ L, + IsNilpotent (U.toLinearMap - 1) ∧ Commute S.toLinearMap U.toLinearMap ∧ + (polynomialModelLieEquiv (E.conjAct (σ q)) (hsmooth (σ q))).toLinearMap = + S.toLinearMap * U.toLinearMap := by + classical + obtain ⟨ss₀, hss₀, hpair₀, hsurj, hlifts⟩ := exists_finite_semisimple_lift_family E hsmooth qs + have hh : ∀ q : {q : Q // q ∈ qs}, ∃ g : G, + g ∈ commonSemisimpleCentralizer E ss₀ ∧ E.rightHom g = (q : Q) ∧ + ∃ S ∈ ss₀, ∃ U : L ≃ₗ⁅ℝ⁆ L, IsNilpotent (U.toLinearMap - 1) ∧ + Commute S.toLinearMap U.toLinearMap ∧ + (polynomialModelLieEquiv (E.conjAct g) (hsmooth g)).toLinearMap = + S.toLinearMap * U.toLinearMap := fun q => hlifts q q.property + choose g hg hgq s hs u hu hsu hgu using hh + let ss := qs.attach.map s + have hmem (S : L ≃ₗ⁅ℝ⁆ L) (hS : S ∈ ss) : S ∈ ss₀ := by + obtain ⟨q, _, hq⟩ := List.mem_map.mp hS + rw [← hq] + exact hs q + obtain ⟨σ, hσ, hσH⟩ := exists_normalized_section_in_subgroup E + (commonSemisimpleCentralizer E ss₀) hsurj + have hσS : ∀ S ∈ ss₀, ∀ q, σ q ∈ semisimpleActionCentralizer E S := + fun S hS q => (mem_commonSemisimpleCentralizer E ss₀ (σ q)).mp (hσH q) S hS + let F := GroupExtensionSection.factorSystem E σ hσ + let A := fun q => polynomialModelLieEquiv (E.conjAct (σ q)) (hsmooth (σ q)) + have hact : ∀ q x, F.action q x = A q x := + fun _ _ => (polynomialModelLieEquiv_apply _ _ _).symm + have hcomm : ∀ S ∈ ss, ∀ q, Commute S.toLinearMap (A q).toLinearMap := by + intro S hS q + exact (mem_semisimpleActionCentralizer_iff E S (σ q) (hsmooth (σ q))).mp + (hσS S (hmem S hS) q) + have hpair : ∀ S ∈ ss, ∀ T ∈ ss, Commute S.toLinearMap T.toLinearMap := + fun S hS T hT => hpair₀ S (hmem S hS) T (hmem T hT) + have hsemisimple : ∀ S ∈ ss, Module.End.IsSemisimple S.toLinearMap := + fun S hS => hss₀ S (hmem S hS) + have hlift : ∀ S ∈ ss, ∃ q₀ : Q, ∃ U : L ≃ₗ⁅ℝ⁆ L, + IsNilpotent (U.toLinearMap - 1) ∧ Commute S.toLinearMap U.toLinearMap ∧ + (A q₀).toLinearMap = S.toLinearMap * U.toLinearMap := by + intro S hS + obtain ⟨q, _, hq⟩ := List.mem_map.mp hS + subst S + obtain ⟨W, hW, hsW, he⟩ := centralizer_same_fiber_jordan_factor E hsmooth (s q) (u q) + (g q) (σ q) ((mem_commonSemisimpleCentralizer E ss₀ _).mp (hg q) _ (hs q)) + (hσS _ (hs q) q) ((σ.rightHom_section q).trans (hgq q).symm) (hu q) (hsu q) (hgu q) + exact ⟨q, W, hW, hsW, he⟩ + obtain ⟨b, hb, hbZ, _, hfixed⟩ := finite_semisimple_cocycle_reduction F A hact ss + hsemisimple hpair hcomm hlift + let θ := GroupExtensionSection.gaugeSection E σ b + have hθS : ∀ S ∈ ss, ∀ q, θ q ∈ semisimpleActionCentralizer E S := by + intro S hS q + exact (semisimpleActionCentralizer E S).mul_mem + (inl_mem_semisimpleCentralizer_of_center E S (b q) (hbZ q)) (hσS S (hmem S hS) q) + refine ⟨ss, hsemisimple, hpair, θ, GroupExtensionSection.gaugeSection_one E σ hσ b hb, + hθS, ?_, ?_⟩ + · intro S hS q r + rw [GroupExtensionSection.factor_gaugeSection E σ hσ b hb] + exact hfixed S hS q r + · intro q hq + let i : {q : Q // q ∈ qs} := ⟨q, hq⟩ + have hi : s i ∈ ss := List.mem_map.mpr ⟨i, List.mem_attach _ _, rfl⟩ + obtain ⟨W, hW, hsW, he⟩ := centralizer_same_fiber_jordan_factor E hsmooth (s i) (u i) + (g i) (θ q) ((mem_commonSemisimpleCentralizer E ss₀ _).mp (hg i) _ (hs i)) + (hθS _ hi q) ((θ.rightHom_section q).trans (hgq i).symm) (hu i) (hsu i) (hgu i) + exact ⟨s i, hi, W, hW, hsW, he⟩ + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/FreeAbelianCyclicLattice.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/FreeAbelianCyclicLattice.lean new file mode 100644 index 0000000000000000000000000000000000000000..3eb735799c193554898d02defce1e3b1559758a0 --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/FreeAbelianCyclicLattice.lean @@ -0,0 +1,57 @@ +import OAI.GroupTheory.PolycyclicRecognition.Algebra.AbelianRealSpace +import OAI.GroupTheory.PolycyclicRecognition.Lattices.NilpotentCyclicLatticeExtension +import Mathlib.Algebra.Group.Equiv.TypeTags + +namespace OAI + +/-! # Realizing nilpotent integral abelian-by-cyclic groups as Lie lattices + +The nilpotency class is unrestricted. The real action is constructed by the +finite logarithm of the extended integral automorphism. +-/ + +noncomputable section +namespace PolycyclicRecognition +open scoped Manifold ContDiff +variable {d : ℕ} + +def realIntegralGroupAut (a : MulAut (Multiplicative (Fin d → ℤ))) : + MulAut (AbelianRealSpace d) := + { (realIntegralLinearEquiv a.toAdditive.toIntLinearEquiv).toEquiv with + map_mul' := fun x y => (realIntegralLinearEquiv a.toAdditive.toIntLinearEquiv).map_add x y } + +theorem contMDiff_realIntegralGroupAut (a : MulAut (Multiplicative (Fin d → ℤ))) : + ContMDiff (𝓘(ℝ, AbelianRealSpace d)) (𝓘(ℝ, AbelianRealSpace d)) ∞ (realIntegralGroupAut a) := + (realIntegralLinearEquiv a.toAdditive.toIntLinearEquiv).toContinuousLinearEquiv.contDiff.contMDiff + +theorem realIntegralGroupAut_lattice (a : MulAut (Multiplicative (Fin d → ℤ))) + (x : Multiplicative (Fin d → ℤ)) : + realIntegralGroupAut a (abelianRealLatticeEquiv d x) = + (abelianRealLatticeEquiv d (a x) : AbelianRealSpace d) := by + rw [abelianRealLatticeEquiv_apply, abelianRealLatticeEquiv_apply] + exact realIntegralLinearEquiv_cast a.toAdditive.toIntLinearEquiv x.toAdd + +theorem freeAbelian_cyclic_nilpotent_lattice + (a : MulAut (Multiplicative (Fin d → ℤ))) + [Group.IsNilpotent (Multiplicative (Fin d → ℤ) ⋊[integerPowerAction a] Multiplicative ℤ)] : + ∃ (S : SimplyConnectedSolvableLieModel) (Γ : Subgroup S.carrier), + IsUniformLattice Γ ∧ + Nonempty ((Multiplicative (Fin d → ℤ) ⋊[integerPowerAction a] Multiplicative ℤ) ≃* Γ) := by + let b : Module.Basis (Fin d) ℝ (AbelianRealSpace d) := Pi.basisFun ℝ (Fin d) + refine nilpotent_cyclic_lattice_extension a b id + (IsPolynomialInBasis.linear (LinearMap.id : AbelianRealSpace d →ₗ[ℝ] AbelianRealSpace d)) + Function.surjective_id (abelianRealLattice d) (abelianRealLattice_uniform d) + (abelianRealLatticeEquiv d) ?_ (realIntegralGroupAut a) + (contMDiff_realIntegralGroupAut a) (realIntegralGroupAut_lattice a) + intro z + refine ⟨Multiplicative.ofAdd z, ?_⟩ + rw [abelianRealLatticeEquiv_apply] + change (fun i => (z i : ℝ)) = (Pi.basisFun ℝ (Fin d)).equivFun.symm (fun i => (z i : ℝ)) + rw [Pi.basisFun_equivFun] + rfl + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/IntegerCyclicHomExtension.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/IntegerCyclicHomExtension.lean new file mode 100644 index 0000000000000000000000000000000000000000..55ccc6ec1c3ca172e2df29bd559904eb995c6640 --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/IntegerCyclicHomExtension.lean @@ -0,0 +1,63 @@ +import OAI.GroupTheory.PolycyclicRecognition.Lattices.NilpotentCyclicHomExtension +import OAI.GroupTheory.PolycyclicRecognition.Algebra.UnipotentCyclicEmbedding +import OAI.GroupTheory.PolycyclicRecognition.Algebra.PolynomialModelHom +import OAI.GroupTheory.PolycyclicRecognition.Algebra.PolynomialModelWords + +namespace OAI + +/-! # The real cyclic completion extends the given integral homomorphism -/ + +noncomputable section +namespace PolycyclicRecognition +open scoped Manifold ContDiff +variable {L M : Type} [RealNormedLieAlgebra L] [FiniteDimensional ℝ L] + [RealNormedLieAlgebra M] [FiniteDimensional ℝ M] + [P : PolynomialExponentialCoordinates L] [Q : PolynomialExponentialCoordinates M] + [LieRing.IsNilpotent L] [LieRing.IsNilpotent M] + +theorem integer_cyclic_hom_extension (A : L ≃ₗ⁅ℝ⁆ L) + (hA : IsNilpotent (A.toLinearMap - 1)) (F : PolynomialCyclicGroup A →* M) + (hF : ContMDiff (𝓘(ℝ, L)) (𝓘(ℝ, M)) ∞ (F.comp SemidirectProduct.inl)) : + let D := unipotentLieLogarithm A hA + let hD := unipotentLieLogarithm_nilpotent A hA + letI := derivationSemidirectGroup D hD + letI : MulOneClass (L × ℝ) := (derivationSemidirectGroup D hD).toMulOneClass + ∃ φ : (L × ℝ) →* M, ContMDiff (𝓘(ℝ, L × ℝ)) (𝓘(ℝ, M)) ∞ φ ∧ + ∀ z, φ (unipotentCyclicEmbedding A hA z) = F z := by + let k := F.comp SemidirectProduct.inl + let f := polynomialModelLieHom k hF + let t : PolynomialCyclicGroup A := SemidirectProduct.inr (Multiplicative.ofAdd (1 : ℤ)) + let u := F t + have hf (x : L) : f x = F (SemidirectProduct.inl x) := polynomialModelLieHom_apply k hF x + have hconj (x : L) : f (A x) = u * f x * u⁻¹ := by + rw [hf, hf] + have hh := SemidirectProduct.inl_aut + (φ := integerPowerAction (PolynomialExponentialCoordinates.groupAutomorphism A)) + (Multiplicative.ofAdd (1 : ℤ)) x + rw [map_inv] at hh + change SemidirectProduct.inl + (((PolynomialExponentialCoordinates.groupAutomorphism A) ^ (1 : ℤ)) x) = + t * SemidirectProduct.inl x * t⁻¹ at hh + have hh' := congrArg F hh + simpa only [zpow_one, PolynomialExponentialCoordinates.groupAutomorphism_apply, + map_mul, map_inv] using hh' + obtain ⟨φ, hφ, hφx⟩ := nilpotent_cyclic_hom_extension A hA f u hconj + refine ⟨φ, hφ, ?_⟩ + intro z + rw [unipotentCyclicEmbedding_apply, hφx, hf] + have hz : (SemidirectProduct.inr z.right : PolynomialCyclicGroup A) = t ^ z.right.toAdd := by + rw [← map_zpow] + congr 1 + apply Multiplicative.ext + change z.right.toAdd = z.right.toAdd • (1 : ℤ) + simp + rw [← model_zpow, ← map_zpow, ← hz] + rw [← map_mul] + congr 1 + exact (SemidirectProduct.mk_eq_inl_mul_inr z.right z.left).symm + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/IntegerSemidirectLattice.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/IntegerSemidirectLattice.lean new file mode 100644 index 0000000000000000000000000000000000000000..e30e33aa50f3e1f8805888bbc717f6a277bf6e8d --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/IntegerSemidirectLattice.lean @@ -0,0 +1,129 @@ +import OAI.GroupTheory.PolycyclicRecognition.Lattices.RealActionIntegerLattice + +namespace OAI + +/-! # The integral semidirect product is the lattice in its real extension -/ + +noncomputable section +namespace PolycyclicRecognition +variable {H N : Type*} [Group H] [Group N] + +def integerPowerAction (a : MulAut H) : Multiplicative ℤ →* MulAut H where + toFun n := a ^ n.toAdd + map_one' := zpow_zero a + map_mul' n m := zpow_add a n.toAdd m.toAdd + +def integerTimeHom : Multiplicative ℤ →* Multiplicative ℝ where + toFun n := Multiplicative.ofAdd (n.toAdd : ℝ) + map_one' := by apply Multiplicative.ext; exact Int.cast_zero + map_mul' n m := by apply Multiplicative.ext; exact Int.cast_add _ _ + +theorem integerTimeHom_injective : Function.Injective integerTimeHom := by + intro n m h + apply Multiplicative.ext + have he : (n.toAdd : ℝ) = (m.toAdd : ℝ) := congrArg Multiplicative.toAdd h + exact_mod_cast he + +theorem realAction_int (φ : Multiplicative ℝ →* MulAut N) (n : ℤ) : + φ (Multiplicative.ofAdd (n : ℝ)) = φ (Multiplicative.ofAdd 1) ^ n := by + have he : (Multiplicative.ofAdd (1 : ℝ)) ^ n = Multiplicative.ofAdd (n : ℝ) := by + apply Multiplicative.ext + change n • (1 : ℝ) = (n : ℝ) + simp + rw [← he, map_zpow] + +theorem mulAut_zpow_semiconj (a : MulAut H) (b : MulAut N) (e : H → N) + (he : ∀ x, e (a x) = b (e x)) (n : ℤ) (x : H) : + e ((a ^ n) x) = (b ^ n) (e x) := by + have hi (y : H) : e (a.symm y) = b.symm (e y) := by + apply b.injective + rw [← he, a.apply_symm_apply, b.apply_symm_apply] + have hp (a' : MulAut H) (b' : MulAut N) (h : ∀ y, e (a' y) = b' (e y)) (k : ℕ) : + ∀ y, e ((a' ^ k) y) = (b' ^ k) (e y) := by + induction k with + | zero => exact fun _ => rfl + | succ k ih => + intro y + rw [pow_succ', pow_succ'] + change e (a' ((a' ^ k) y)) = b' ((b' ^ k) (e y)) + rw [h, ih] + cases n with + | ofNat n => exact hp a b he n x + | negSucc n => + change e ((a ^ (-((n + 1 : ℕ) : ℤ))) x) = (b ^ (-((n + 1 : ℕ) : ℤ))) (e x) + rw [zpow_neg, zpow_neg, zpow_natCast, zpow_natCast, ← inv_pow, ← inv_pow] + exact hp a.symm b.symm hi (n + 1) x + +def realIntegerSemidirectMap (φ : Multiplicative ℝ →* MulAut N) (a : MulAut H) + (e : H →* N) (he : ∀ x, e (a x) = φ (Multiplicative.ofAdd 1) (e x)) : + (H ⋊[integerPowerAction a] Multiplicative ℤ) →* (N ⋊[φ] Multiplicative ℝ) := + SemidirectProduct.map e integerTimeHom (by + intro n + ext x + change e ((a ^ n.toAdd) x) = φ (Multiplicative.ofAdd (n.toAdd : ℝ)) (e x) + rw [realAction_int] + exact mulAut_zpow_semiconj a _ e he n.toAdd x) + +theorem realIntegerSemidirectMap_injective + (φ : Multiplicative ℝ →* MulAut N) (a : MulAut H) + (e : H →* N) (he : ∀ x, e (a x) = φ (Multiplicative.ofAdd 1) (e x)) + (hej : Function.Injective e) : Function.Injective (realIntegerSemidirectMap φ a e he) := by + intro x y h + apply SemidirectProduct.ext + · exact hej (congrArg SemidirectProduct.left h) + · exact integerTimeHom_injective (congrArg SemidirectProduct.right h) + +variable [TopologicalSpace N] +attribute [local instance] semidirectProductTopology + +theorem integer_semidirect_lattice_realization_with_coordinates + (φ : Multiplicative ℝ →* MulAut N) (a : MulAut H) + (Λ : Subgroup N) (hΛ : IsUniformLattice Λ) (e : H ≃* Λ) + (he : ∀ x, (e (a x) : N) = φ (Multiplicative.ofAdd 1) (e x)) : + ∃ Γ : Subgroup (N ⋊[φ] Multiplicative ℝ), IsUniformLattice Γ ∧ + ∃ f : (H ⋊[integerPowerAction a] Multiplicative ℤ) ≃* Γ, + ∀ x, (f x : N ⋊[φ] Multiplicative ℝ) = + realIntegerSemidirectMap φ a (Λ.subtype.comp e.toMonoidHom) he x := by + let j : H →* N := Λ.subtype.comp e.toMonoidHom + have hstable : ∀ t ∈ integerTimeLattice, ∀ x ∈ Λ, φ t x ∈ Λ := by + intro t ht x hx + obtain ⟨n, rfl⟩ := integerTimeLattice_exists ht + obtain ⟨y, hy⟩ := e.surjective ⟨x, hx⟩ + have hj : j y = x := congrArg Subtype.val hy + rw [← hj, realAction_int, ← mulAut_zpow_semiconj a _ j he] + exact (e ((a ^ n) y)).property + let Γ := semidirectLattice φ Λ integerTimeLattice hstable + let f := realIntegerSemidirectMap φ a j he + have hf (x) : f x ∈ Γ := ⟨(e x.left).property, integerTimeLattice_mem x.right.toAdd⟩ + let f' : (H ⋊[integerPowerAction a] Multiplicative ℤ) →* Γ := f.codRestrict Γ hf + have hinj : Function.Injective f' := by + intro x y h + exact realIntegerSemidirectMap_injective φ a j he + (Λ.subtype_injective.comp e.injective) (congrArg Subtype.val h) + have hsurj : Function.Surjective f' := by + intro z + obtain ⟨x, hx⟩ := e.surjective ⟨z.val.left, z.property.1⟩ + obtain ⟨n, hn⟩ := integerTimeLattice_exists z.property.2 + refine ⟨⟨x, Multiplicative.ofAdd n⟩, ?_⟩ + apply Subtype.ext + apply SemidirectProduct.ext + · exact congrArg Subtype.val hx + · exact hn.symm + exact ⟨Γ, semidirectLattice_uniform φ Λ integerTimeLattice hstable hΛ + integerTimeLattice_uniform, MulEquiv.ofBijective f' ⟨hinj, hsurj⟩, fun _ => rfl⟩ + +theorem integer_semidirect_lattice_realization + (φ : Multiplicative ℝ →* MulAut N) (a : MulAut H) + (Λ : Subgroup N) (hΛ : IsUniformLattice Λ) (e : H ≃* Λ) + (he : ∀ x, (e (a x) : N) = φ (Multiplicative.ofAdd 1) (e x)) : + ∃ Γ : Subgroup (N ⋊[φ] Multiplicative ℝ), IsUniformLattice Γ ∧ + Nonempty ((H ⋊[integerPowerAction a] Multiplicative ℤ) ≃* Γ) := by + obtain ⟨Γ, hΓ, f, _⟩ := + integer_semidirect_lattice_realization_with_coordinates φ a Λ hΛ e he + exact ⟨Γ, hΓ, ⟨f⟩⟩ + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/IntegerTimeLattice.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/IntegerTimeLattice.lean new file mode 100644 index 0000000000000000000000000000000000000000..96bff455acf2d5eb78b21924db755941c1d363b3 --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/IntegerTimeLattice.lean @@ -0,0 +1,48 @@ +import OAI.GroupTheory.PolycyclicRecognition.Lattices.UniformLatticeMetric +import Mathlib.Topology.Instances.ZMultiples +import Mathlib.Algebra.Group.TypeTags.Basic + +namespace OAI + +/-! # The integer time lattice in the real one-parameter group -/ + +noncomputable section +namespace PolycyclicRecognition +open Set + +def integerTimeLattice : Subgroup (Multiplicative ℝ) := + (AddSubgroup.zmultiples (1 : ℝ)).toSubgroup + +theorem integerTimeLattice_mem (n : ℤ) : + Multiplicative.ofAdd (n : ℝ) ∈ integerTimeLattice := by + change (n : ℝ) ∈ AddSubgroup.zmultiples (1 : ℝ) + exact AddSubgroup.mem_zmultiples_iff.mpr ⟨n, by simp⟩ + +theorem integerTimeLattice_exists {x : Multiplicative ℝ} (hx : x ∈ integerTimeLattice) : + ∃ n : ℤ, x = Multiplicative.ofAdd (n : ℝ) := by + change x.toAdd ∈ AddSubgroup.zmultiples (1 : ℝ) at hx + obtain ⟨n, hn⟩ := AddSubgroup.mem_zmultiples_iff.mp hx + refine ⟨n, ?_⟩ + apply Multiplicative.ext + simpa using hn.symm + +theorem integerTimeLattice_uniform : IsUniformLattice integerTimeLattice := by + have hd : DiscreteTopology integerTimeLattice := by + change DiscreteTopology (AddSubgroup.zmultiples (1 : ℝ)) + infer_instance + refine ⟨hd, Multiplicative.ofAdd '' Icc (0 : ℝ) 1, + isCompact_Icc.image (show Continuous (Multiplicative.ofAdd : ℝ → Multiplicative ℝ) + from continuous_id), ?_⟩ + intro x + refine ⟨⟨Multiplicative.ofAdd (⌊x.toAdd⌋ : ℝ), integerTimeLattice_mem _⟩, + Multiplicative.ofAdd (Int.fract x.toAdd), ?_, ?_⟩ + · exact ⟨Int.fract x.toAdd, ⟨Int.fract_nonneg _, (Int.fract_lt_one _).le⟩, rfl⟩ + · apply Multiplicative.ext + change (⌊x.toAdd⌋ : ℝ) + (x.toAdd - (⌊x.toAdd⌋ : ℝ)) = x.toAdd + abel + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/IntegralBilinearLattice.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/IntegralBilinearLattice.lean new file mode 100644 index 0000000000000000000000000000000000000000..d67d54654beac7c6369c667c65b27cbc5c57b171 --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/IntegralBilinearLattice.lean @@ -0,0 +1,63 @@ +import OAI.GroupTheory.PolycyclicRecognition.Analysis.IntegralBilinearExtension + +namespace OAI + +/-! # The Lie lattice attached to an integral bilinear group law -/ + +noncomputable section +namespace PolycyclicRecognition + +variable {d e : ℕ} (a : Fin e → Fin d → Fin d → ℤ) + +def integralBilinearEmbedding : BilinearCentralGroup (coefficientBilinear a) →* + (bilinearCentralLieModel (realCoefficientBilinear a)).carrier where + toFun x := (integerVectorMap d x.1, integerVectorMap e x.2) + map_one' := by apply Prod.ext <;> exact map_zero _ + map_mul' x y := by + apply Prod.ext + · exact map_add _ _ _ + · change integerVectorMap e (x.2 + y.2 + coefficientBilinear a x.1 y.1) = + integerVectorMap e x.2 + integerVectorMap e y.2 + + realCoefficientBilinear a (integerVectorMap d x.1) (integerVectorMap d y.1) + rw [map_add, map_add, realCoefficientBilinear_cast] + +theorem integralBilinearEmbedding_injective : Function.Injective (integralBilinearEmbedding a) := by + intro x y h + exact Prod.ext (integerVectorMap_injective d (congrArg Prod.fst h)) + (integerVectorMap_injective e (congrArg Prod.snd h)) + +def integralBilinearLattice : + Subgroup (bilinearCentralLieModel (realCoefficientBilinear a)).carrier := + bilinearCentralLattice (Pi.basisFun ℝ (Fin d)) (Pi.basisFun ℝ (Fin e)) + (realCoefficientBilinear a) (realCoefficientBilinear_integral a) + +theorem integralBilinearLattice_uniform : IsUniformLattice (integralBilinearLattice a) := + bilinearCentralLattice_uniform _ _ _ _ + +def integralBilinearLatticeEquiv : + BilinearCentralGroup (coefficientBilinear a) ≃* integralBilinearLattice a := by + let f : BilinearCentralGroup (coefficientBilinear a) →* integralBilinearLattice a := + (integralBilinearEmbedding a).codRestrict _ (fun x => + ⟨integerVectorMap_mem d x.1, integerVectorMap_mem e x.2⟩) + apply MulEquiv.ofBijective f + constructor + · intro x y h + exact integralBilinearEmbedding_injective a (congrArg Subtype.val h) + · intro x + obtain ⟨u, hu⟩ := exists_integerVectorMap_of_mem d x.val.1 x.property.1 + obtain ⟨v, hv⟩ := exists_integerVectorMap_of_mem e x.val.2 x.property.2 + refine ⟨(u, v), ?_⟩ + apply Subtype.ext + exact Prod.ext hu hv + +theorem integralBilinear_solvable_realization : + ∃ (S : SimplyConnectedSolvableLieModel) (Λ : Subgroup S.carrier), + IsUniformLattice Λ ∧ Nonempty (BilinearCentralGroup (coefficientBilinear a) ≃* Λ) := + ⟨bilinearCentralLieModel (realCoefficientBilinear a), integralBilinearLattice a, + integralBilinearLattice_uniform a, ⟨integralBilinearLatticeEquiv a⟩⟩ + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/IntegralLatticeGenerators.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/IntegralLatticeGenerators.lean new file mode 100644 index 0000000000000000000000000000000000000000..8e793af983328ed1a015c85de16e6fe3ac6ff38d --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/IntegralLatticeGenerators.lean @@ -0,0 +1,69 @@ +import OAI.GroupTheory.PolycyclicRecognition.Analysis.IntegralLinearExtension + +namespace OAI + +/-! # Coordinate generators and the standard embedding of the integral lattice -/ + +noncomputable section +namespace PolycyclicRecognition + +def integralLatticeGenerator (n : ℕ) (i : Fin n) : IntegralLatticeGroup n := + Multiplicative.ofAdd ((Pi.basisFun ℤ (Fin n)) i) + +theorem integralLatticeGenerator_prod (n : ℕ) (z : IntegralLatticeGroup n) : + (∏ i, integralLatticeGenerator n i ^ z.toAdd i) = z := by + apply Multiplicative.toAdd.injective + simpa only [toAdd_prod, toAdd_zpow, integralLatticeGenerator, toAdd_ofAdd, + Pi.basisFun_equivFun, LinearEquiv.refl_apply] using + (Pi.basisFun ℤ (Fin n)).sum_equivFun z.toAdd + +theorem integralLatticeGenerator_closure (n : ℕ) : + Subgroup.closure (Set.range (integralLatticeGenerator n)) = ⊤ := by + apply top_unique + intro z _ + rw [← integralLatticeGenerator_prod n z] + exact Subgroup.prod_mem _ fun i _ => Subgroup.zpow_mem _ + (Subgroup.subset_closure (Set.mem_range_self i)) _ + +theorem integralLattice_hom_ext {n : ℕ} {K : Type*} [Group K] + {f g : IntegralLatticeGroup n →* K} + (h : ∀ i, f (integralLatticeGenerator n i) = g (integralLatticeGenerator n i)) : f = g := by + apply MonoidHom.eq_of_eqOn_dense (integralLatticeGenerator_closure n) + rintro _ ⟨i, rfl⟩ + exact h i + +def integerVectorHom (n : ℕ) : IntegralLatticeGroup n →* Multiplicative (Fin n → ℝ) where + toFun z := Multiplicative.ofAdd (integerVectorMap n z.toAdd) + map_one' := by apply Multiplicative.ext; exact (integerVectorMap n).map_zero + map_mul' z w := by apply Multiplicative.ext; exact (integerVectorMap n).map_add z.toAdd w.toAdd + +theorem integerVectorHom_injective (n : ℕ) : Function.Injective (integerVectorHom n) := by + intro z w h + exact Multiplicative.ext (integerVectorMap_injective n (congrArg Multiplicative.toAdd h)) + +def integerVectorRangeEquiv (n : ℕ) : IntegralLatticeGroup n ≃* (integerVectorHom n).range := + MulEquiv.ofBijective (integerVectorHom n).rangeRestrict + ⟨fun _ _ h => integerVectorHom_injective n (congrArg Subtype.val h), + (integerVectorHom n).rangeRestrict_surjective⟩ + +theorem integerVectorHom_range (n : ℕ) : (integerVectorHom n).range = standardVectorLattice n := by + ext x + change (∃ z : IntegralLatticeGroup n, + Multiplicative.ofAdd (integerVectorMap n z.toAdd) = x) ↔ + x.toAdd ∈ Submodule.span ℤ (Set.range (Pi.basisFun ℝ (Fin n))) + constructor + · rintro ⟨z, rfl⟩ + exact integerVectorMap_mem n z.toAdd + · intro hx + obtain ⟨z, hz⟩ := exists_integerVectorMap_of_mem n x.toAdd hx + exact ⟨Multiplicative.ofAdd z, Multiplicative.ext hz⟩ + +theorem integerVectorHom_uniform (n : ℕ) : IsUniformLattice (integerVectorHom n).range := by + rw [integerVectorHom_range] + exact standardVectorLattice_uniform n + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/IntegralLatticePowerIndex.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/IntegralLatticePowerIndex.lean new file mode 100644 index 0000000000000000000000000000000000000000..8e45e3d7b661ef2d24140e9db7fd3b9dbee96ae6 --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/IntegralLatticePowerIndex.lean @@ -0,0 +1,91 @@ +import OAI.GroupTheory.PolycyclicRecognition.Lattices.IntegralLatticeGenerators +import OAI.GroupTheory.PolycyclicRecognition.Algebra.CyclicPowerIndex + +namespace OAI + +/-! # Finite-index powers in an integral vector lattice -/ + +noncomputable section +namespace PolycyclicRecognition + +def latticePowerHom (n m : ℕ) : IntegralLatticeGroup n →* IntegralLatticeGroup n where + toFun z := z ^ m + map_one' := one_pow m + map_mul' z w := (Commute.all z w).mul_pow m + +def latticeCoordinateHom (n : ℕ) (i : Fin n) : IntegralLatticeGroup n →* Multiplicative ℤ where + toFun z := Multiplicative.ofAdd (z.toAdd i) + map_one' := rfl + map_mul' _ _ := rfl + +theorem latticePowerHom_injective (n : ℕ) {m : ℕ} (hm : 0 < m) : + Function.Injective (latticePowerHom n m) := by + intro z w h + apply Multiplicative.ext + funext i + have hi := congrArg (fun a : IntegralLatticeGroup n => a.toAdd i) h + change (m : ℤ) * z.toAdd i = (m : ℤ) * w.toAdd i at hi + exact mul_left_cancel₀ (by exact_mod_cast Nat.ne_of_gt hm) hi + +theorem latticePowerHom_range (n m : ℕ) : + (latticePowerHom n m).range = + ⨅ i, (integerScaleHom m).range.comap (latticeCoordinateHom n i) := by + ext z + simp only [Subgroup.mem_iInf, Subgroup.mem_comap, MonoidHom.mem_range] + constructor + · rintro ⟨w, rfl⟩ i + exact ⟨Multiplicative.ofAdd (w.toAdd i), rfl⟩ + · intro h + choose w hw using h + refine ⟨Multiplicative.ofAdd (fun i => (w i).toAdd), ?_⟩ + apply Multiplicative.ext + funext i + exact congrArg Multiplicative.toAdd (hw i) + +theorem latticePowerHom_finiteIndex (n : ℕ) {m : ℕ} (hm : 0 < m) : + (latticePowerHom n m).range.FiniteIndex := by + let := integerScaleHom_range_finiteIndex hm + rw [latticePowerHom_range] + apply Subgroup.finiteIndex_iInf + intro i + infer_instance + +variable {H : Type} [Group H] + +def integralSemidirectPowerMap {n : ℕ} (ρ : IntegralLatticeGroup n →* MulAut H) (m : ℕ) : + (H ⋊[ρ.comp (latticePowerHom n m)] IntegralLatticeGroup n) →* + (H ⋊[ρ] IntegralLatticeGroup n) := + SemidirectProduct.map (MonoidHom.id H) (latticePowerHom n m) (by intros; rfl) + +theorem integralSemidirectPowerMap_injective {n m : ℕ} (ρ : IntegralLatticeGroup n →* MulAut H) + (hm : 0 < m) : Function.Injective (integralSemidirectPowerMap ρ m) := by + intro x y h + apply SemidirectProduct.ext + · exact congrArg (fun z : H ⋊[ρ] IntegralLatticeGroup n => z.left) h + · exact latticePowerHom_injective n hm + (congrArg (fun z : H ⋊[ρ] IntegralLatticeGroup n => z.right) h) + +theorem integralSemidirectPowerMap_range {n : ℕ} (ρ : IntegralLatticeGroup n →* MulAut H) (m : ℕ) : + (integralSemidirectPowerMap ρ m).range = + (latticePowerHom n m).range.comap SemidirectProduct.rightHom := by + ext g + constructor + · rintro ⟨x, rfl⟩ + exact ⟨x.right, rfl⟩ + · rintro ⟨v, hv⟩ + refine ⟨⟨g.left, v⟩, ?_⟩ + apply SemidirectProduct.ext + · rfl + · exact hv + +theorem integralSemidirectPowerMap_finiteIndex {n m : ℕ} (ρ : IntegralLatticeGroup n →* MulAut H) + (hm : 0 < m) : (integralSemidirectPowerMap ρ m).range.FiniteIndex := by + let := latticePowerHom_finiteIndex n hm + rw [integralSemidirectPowerMap_range] + infer_instance + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/IntegralNilshadow.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/IntegralNilshadow.lean new file mode 100644 index 0000000000000000000000000000000000000000..b61a766dbb2cacbe681d03aa3e739b7da01e19db --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/IntegralNilshadow.lean @@ -0,0 +1,113 @@ +import OAI.GroupTheory.PolycyclicRecognition.Analysis.IntegralSemisimpleTwist +import OAI.GroupTheory.PolycyclicRecognition.Algebra.UnipotentFactorSystem +import OAI.GroupTheory.PolycyclicRecognition.Lattices.KernelCompletionAction +import OAI.GroupTheory.PolycyclicRecognition.Algebra.FactorSystemTwistAction + +namespace OAI + +/-! # Constructing the nilshadow of an integral abelian extension + +Both the section and the removed action are constructed from the original +extension. The twisted group has a nilpotent real completion of the correct +dimension. Its removed action extends, and the original group embeds faithfully +in the corresponding semidirect product. The quotient here is still integral. +-/ + +noncomputable section +namespace PolycyclicRecognition +open scoped Manifold ContDiff +variable {L G : Type} [RealNormedLieAlgebra L] [FiniteDimensional ℝ L] + [P : PolynomialExponentialCoordinates L] [LieRing.IsNilpotent L] [Group G] {n : ℕ} + +structure IntegralNilshadowData (E : GroupExtension L G (IntegralLatticeGroup n)) where + sectionMap : E.Section + normalized : sectionMap 1 = 1 + removed : IntegralLatticeGroup n →* MulAut L + commutes : ∀ q r, Commute + ((GroupExtensionSection.factorSystem E sectionMap normalized).action q) (removed r) + fixes : ∀ q r s, removed q + ((GroupExtensionSection.factorSystem E sectionMap normalized).factor r s) = + (GroupExtensionSection.factorSystem E sectionMap normalized).factor r s + smooth : ∀ q, ContMDiff (𝓘(ℝ, L)) (𝓘(ℝ, L)) ∞ (removed q) + twist_smooth : ∀ q, ContMDiff (𝓘(ℝ, L)) (𝓘(ℝ, L)) ∞ + (((GroupExtensionSection.factorSystem E sectionMap normalized).twist removed commutes fixes).action q) + twist_nilpotent : Group.IsNilpotent (FactorExtension + ((GroupExtensionSection.factorSystem E sectionMap normalized).twist removed commutes fixes)) + completion : NilpotentKernelCompletion (FactorExtension.inl + ((GroupExtensionSection.factorSystem E sectionMap normalized).twist removed commutes fixes)) + dimension : completion.dimension = Module.finrank ℝ L + n + +theorem exists_integralNilshadowData (E : GroupExtension L G (IntegralLatticeGroup n)) + (hsmooth : ∀ g : G, ContMDiff (𝓘(ℝ, L)) (𝓘(ℝ, L)) ∞ (E.conjAct g)) : + Nonempty (IntegralNilshadowData E) := by + obtain ⟨σ, hσ, χ, hc, hf, hχ, hT, hu⟩ := integral_semisimple_twist E hsmooth + let R := GroupExtensionSection.factorSystem E σ hσ + let T := R.twist χ hc hf + let qs := List.ofFn (integralLatticeGenerator n) + have hgen : Subgroup.closure {q | q ∈ qs} = ⊤ := by + convert integralLatticeGenerator_closure n using 2 + ext q + exact List.mem_ofFn + have hnil : Group.IsNilpotent (FactorExtension T) := + factorSystem_nilpotent_of_unipotent T hT qs hgen (by + intro q hq + obtain ⟨i, rfl⟩ := List.mem_ofFn.mp hq + exact hu i) + let := hnil + obtain ⟨C, hC⟩ := nilpotent_integral_kernel_completion_with_dimension + (FactorExtension.groupExtension T) (factorSystem_conjugation_smooth T hT) + exact ⟨⟨σ, hσ, χ, hc, hf, hχ, hT, hnil, C, hC⟩⟩ + +namespace IntegralNilshadowData +variable {E : GroupExtension L G (IntegralLatticeGroup n)} (D : IntegralNilshadowData E) +omit [LieRing.IsNilpotent L] + +abbrev system := GroupExtensionSection.factorSystem E D.sectionMap D.normalized +abbrev twistedSystem := D.system.twist D.removed D.commutes D.fixes +abbrev integralAction := factorTwistAction D.system D.removed D.commutes D.fixes + +theorem integralAction_kernel_smooth (q : IntegralLatticeGroup n) : + ContMDiff (𝓘(ℝ, L)) (𝓘(ℝ, D.completion.carrier)) ∞ + ((D.completion.embed.comp (D.integralAction q).toMonoidHom).comp + (FactorExtension.inl D.twistedSystem)) := by + exact D.completion.kernel_smooth.comp (D.smooth q) + +def completedAction : IntegralLatticeGroup n →* MulAut D.completion.carrier := + D.completion.extendedAction D.integralAction D.integralAction_kernel_smooth + +theorem completedAction_smooth (q : IntegralLatticeGroup n) : + ContMDiff (𝓘(ℝ, D.completion.carrier)) (𝓘(ℝ, D.completion.carrier)) ∞ (D.completedAction q) := + D.completion.extendedAction_smooth D.integralAction D.integralAction_kernel_smooth q + +def completionSemidirectMap : + (FactorExtension D.twistedSystem ⋊[D.integralAction] IntegralLatticeGroup n) →* + (D.completion.carrier ⋊[D.completedAction] IntegralLatticeGroup n) := + SemidirectProduct.map D.completion.embed (MonoidHom.id _) (by + intro q + apply MonoidHom.ext + intro x + exact (D.completion.extendedAction_embed D.integralAction + D.integralAction_kernel_smooth q x).symm) + +def originalEmbedding : G →* + (D.completion.carrier ⋊[D.completedAction] IntegralLatticeGroup n) := + D.completionSemidirectMap.comp + ((factorTwistGraph D.system D.removed D.commutes D.fixes).comp + (GroupExtensionSection.mulEquiv E D.sectionMap D.normalized).toMonoidHom) + +theorem originalEmbedding_injective : Function.Injective D.originalEmbedding := by + have hC : Function.Injective D.completionSemidirectMap := by + intro a b h + apply SemidirectProduct.ext + · apply D.completion.injective + exact congrArg (fun z => z.left) h + · exact congrArg (fun z => z.right) h + exact hC.comp ((factorTwistGraph_injective D.system D.removed D.commutes D.fixes).comp + (GroupExtensionSection.mulEquiv E D.sectionMap D.normalized).injective) + +end IntegralNilshadowData +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/JointFixedActionFiltration.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/JointFixedActionFiltration.lean new file mode 100644 index 0000000000000000000000000000000000000000..38c40719c74094068fdb75ae46a40c6362185daf --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/JointFixedActionFiltration.lean @@ -0,0 +1,60 @@ +import OAI.GroupTheory.PolycyclicRecognition.Lattices.JointFixedReductionData +import OAI.GroupTheory.PolycyclicRecognition.Algebra.PolynomialSubalgebraFiltration + +namespace OAI + +/-! # The residual quotient actions commute on lower-central factors + +The two orders of quotient lifts differ by inner automorphisms. Intrinsic BCH +commutator estimates make both inner corrections disappear on the next Lie +lower-central quotient. +-/ + +noncomputable section +namespace PolycyclicRecognition +open LieModule +open scoped IsMulCommutative +attribute [local instance] polynomialSubalgebraGroup +variable {L Q : Type} [RealNormedLieAlgebra L] [FiniteDimensional ℝ L] + [P : PolynomialExponentialCoordinates L] [Group Q] [IsMulCommutative Q] + +theorem jointFixed_action_preserves_lowerCentral (ss : List (L ≃ₗ⁅ℝ⁆ L)) + (T : L ≃ₗ⁅ℝ⁆ L) (hT : ∀ S ∈ ss, Commute S.toLinearMap T.toLinearMap) + (k : ℕ) (x : jointFixedLieSubalgebra ss) + (hx : x ∈ lowerCentralSeries ℝ (jointFixedLieSubalgebra ss) (jointFixedLieSubalgebra ss) k) : + jointFixedGroupAction ss T hT x ∈ + lowerCentralSeries ℝ (jointFixedLieSubalgebra ss) (jointFixedLieSubalgebra ss) k := + LieIdeal.map_lowerCentralSeries_le k (LieIdeal.mem_map (f := (jointFixedLieAction ss T hT).toLieHom) hx) + +theorem jointFixed_actions_commute_mod_lowerCentral (F : NonabelianFactorSystem L Q) + (A : Q → L ≃ₗ⁅ℝ⁆ L) (hact : ∀ q x, F.action q x = A q x) + (ss : List (L ≃ₗ⁅ℝ⁆ L)) + (hcomm : ∀ S ∈ ss, ∀ q, Commute S.toLinearMap (A q).toLinearMap) + (hfixed : ∀ S ∈ ss, ∀ q r, S (F.factor q r) = F.factor q r) + (q r : Q) (k : ℕ) (x : jointFixedLieSubalgebra ss) + (hx : x ∈ lowerCentralSeries ℝ (jointFixedLieSubalgebra ss) (jointFixedLieSubalgebra ss) k) : + jointFixedLinearAction ss (A q) (fun S hS => hcomm S hS q) + (jointFixedLinearAction ss (A r) (fun S hS => hcomm S hS r) x) - + jointFixedLinearAction ss (A r) (fun S hS => hcomm S hS r) + (jointFixedLinearAction ss (A q) (fun S hS => hcomm S hS q) x) ∈ + lowerCentralSeries ℝ (jointFixedLieSubalgebra ss) (jointFixedLieSubalgebra ss) (k + 1) := by + let R := jointFixedFactorSystem F A hact ss hcomm hfixed + let K := jointFixedLieSubalgebra ss + have hy : R.action (q * r) x ∈ lowerCentralSeries ℝ K K k := + jointFixed_action_preserves_lowerCentral ss (A (q * r)) (fun S hS => hcomm S hS _) k x hx + have hq := polynomialSubalgebra_inner_difference K (R.factor q r) k (R.action (q * r) x) hy + have hr := polynomialSubalgebra_inner_difference K (R.factor r q) k (R.action (q * r) x) hy + rw [← R.action_mul_apply] at hq + rw [show q * r = r * q from mul_comm q r, ← R.action_mul_apply] at hr + rw [mul_comm r q] at hr + have hh := (lowerCentralSeries ℝ K K (k + 1)).sub_mem hq hr + change R.action q (R.action r x) - R.action r (R.action q x) ∈ + (lowerCentralSeries ℝ K K (k + 1)).toSubmodule + convert hh using 1 + abel + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/JointFixedFactorSystem.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/JointFixedFactorSystem.lean new file mode 100644 index 0000000000000000000000000000000000000000..5806dcdc16673eebbe92b5d8d1d3c9a7a6a8cd59 --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/JointFixedFactorSystem.lean @@ -0,0 +1,96 @@ +import OAI.GroupTheory.PolycyclicRecognition.Lattices.JointFixedSubalgebra +import OAI.GroupTheory.PolycyclicRecognition.Algebra.FactorExtensionMap +import OAI.GroupTheory.PolycyclicRecognition.Algebra.GroupExtensionFactorSystem + +namespace OAI + +/-! # The actual extension on the joint fixed kernel + +Once the section factors are fixed by the family, the joint fixed subgroup +supports the same nonabelian cocycle. Its factor extension embeds faithfully +in the original group. +-/ + +noncomputable section +namespace PolycyclicRecognition +attribute [local instance] polynomialSubalgebraGroup +variable {L Q : Type} [RealNormedLieAlgebra L] [FiniteDimensional ℝ L] + [P : PolynomialExponentialCoordinates L] [Group Q] + +def jointFixedFactorSystem (F : NonabelianFactorSystem L Q) + (A : Q → L ≃ₗ⁅ℝ⁆ L) (hact : ∀ q x, F.action q x = A q x) + (ss : List (L ≃ₗ⁅ℝ⁆ L)) + (hcomm : ∀ S ∈ ss, ∀ q, Commute S.toLinearMap (A q).toLinearMap) + (hfixed : ∀ S ∈ ss, ∀ q r, S (F.factor q r) = F.factor q r) : + NonabelianFactorSystem (jointFixedLieSubalgebra ss) Q where + action q := jointFixedGroupAction ss (A q) (fun S hS => hcomm S hS q) + factor q r := ⟨F.factor q r, (mem_jointFixedLieSubalgebra ss _).mpr + (fun S hS => hfixed S hS q r)⟩ + action_one := by + apply DFunLike.ext + intro x + apply Subtype.ext + change A 1 x = x + rw [← hact, F.action_one] + rfl + factor_one_left q := Subtype.ext (F.factor_one_left q) + factor_one_right q := Subtype.ext (F.factor_one_right q) + action_mul q r := by + apply DFunLike.ext + intro x + apply Subtype.ext + change A q (A r x) = F.factor q r * A (q * r) x * (F.factor q r)⁻¹ + rw [← hact, ← hact, ← hact, F.action_mul_apply] + cocycle q r s := by + apply Subtype.ext + change F.factor q r * F.factor (q * r) s = A q (F.factor r s) * F.factor q (r * s) + rw [← hact] + exact F.cocycle q r s + +def jointFixedFactorInclusion (F : NonabelianFactorSystem L Q) + (A : Q → L ≃ₗ⁅ℝ⁆ L) (hact : ∀ q x, F.action q x = A q x) + (ss : List (L ≃ₗ⁅ℝ⁆ L)) + (hcomm : ∀ S ∈ ss, ∀ q, Commute S.toLinearMap (A q).toLinearMap) + (hfixed : ∀ S ∈ ss, ∀ q r, S (F.factor q r) = F.factor q r) : + FactorExtension (jointFixedFactorSystem F A hact ss hcomm hfixed) →* FactorExtension F := + FactorExtension.map _ _ + (polynomialSubalgebraHom _ (jointFixedLieSubalgebra ss).incl) + (fun q x => (hact q x).symm) (fun _ _ => rfl) + +theorem jointFixedFactorInclusion_injective (F : NonabelianFactorSystem L Q) + (A : Q → L ≃ₗ⁅ℝ⁆ L) (hact : ∀ q x, F.action q x = A q x) + (ss : List (L ≃ₗ⁅ℝ⁆ L)) + (hcomm : ∀ S ∈ ss, ∀ q, Commute S.toLinearMap (A q).toLinearMap) + (hfixed : ∀ S ∈ ss, ∀ q r, S (F.factor q r) = F.factor q r) : + Function.Injective (jointFixedFactorInclusion F A hact ss hcomm hfixed) := + FactorExtension.map_injective _ _ _ _ _ Subtype.val_injective + +variable {G : Type} [Group G] + +def jointFixedExtensionEmbedding (E : GroupExtension L G Q) (σ : E.Section) (hσ : σ 1 = 1) + (A : Q → L ≃ₗ⁅ℝ⁆ L) (hact : ∀ q x, E.conjAct (σ q) x = A q x) + (ss : List (L ≃ₗ⁅ℝ⁆ L)) + (hcomm : ∀ S ∈ ss, ∀ q, Commute S.toLinearMap (A q).toLinearMap) + (hfixed : ∀ S ∈ ss, ∀ q r, S (GroupExtensionSection.factor E σ q r) = + GroupExtensionSection.factor E σ q r) : + FactorExtension (jointFixedFactorSystem (GroupExtensionSection.factorSystem E σ hσ) + A hact ss hcomm hfixed) →* G := + (GroupExtensionSection.mulEquiv E σ hσ).symm.toMonoidHom.comp + (jointFixedFactorInclusion _ A hact ss hcomm hfixed) + +theorem jointFixedExtensionEmbedding_injective (E : GroupExtension L G Q) + (σ : E.Section) (hσ : σ 1 = 1) + (A : Q → L ≃ₗ⁅ℝ⁆ L) (hact : ∀ q x, E.conjAct (σ q) x = A q x) + (ss : List (L ≃ₗ⁅ℝ⁆ L)) + (hcomm : ∀ S ∈ ss, ∀ q, Commute S.toLinearMap (A q).toLinearMap) + (hfixed : ∀ S ∈ ss, ∀ q r, S (GroupExtensionSection.factor E σ q r) = + GroupExtensionSection.factor E σ q r) : + Function.Injective (jointFixedExtensionEmbedding E σ hσ A hact ss hcomm hfixed) := + (GroupExtensionSection.mulEquiv E σ hσ).symm.injective.comp + (jointFixedFactorInclusion_injective _ A hact ss hcomm hfixed) + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/JointFixedLayerAction.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/JointFixedLayerAction.lean new file mode 100644 index 0000000000000000000000000000000000000000..76e00fcb85bb8e708ccdeb594b4a179a105f4ebb --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/JointFixedLayerAction.lean @@ -0,0 +1,91 @@ +import OAI.GroupTheory.PolycyclicRecognition.Lattices.JointFixedActionFiltration +import OAI.GroupTheory.PolycyclicRecognition.Algebra.InvariantLinearLayer +import OAI.GroupTheory.PolycyclicRecognition.Algebra.GeneratedUnipotentAction + +namespace OAI + +/-! # The abelian quotient acts on the residual lower-central layers + +Inner section factors disappear on these layers, so this is an actual linear +representation of the quotient. Its selected generators are unipotent. +-/ + +noncomputable section +namespace PolycyclicRecognition +open LieModule +open scoped Manifold ContDiff IsMulCommutative +attribute [local instance] polynomialSubalgebraGroup +variable {L G Q : Type} [RealNormedLieAlgebra L] [FiniteDimensional ℝ L] + [P : PolynomialExponentialCoordinates L] [LieRing.IsNilpotent L] + [Group G] [Group Q] + {E : GroupExtension L G Q} + {hsmooth : ∀ g : G, ContMDiff (𝓘(ℝ, L)) (𝓘(ℝ, L)) ∞ (E.conjAct g)} {qs : List Q} + +namespace JointFixedReductionData +variable (D : JointFixedReductionData E hsmooth qs) + +abbrev lowerCentralLayer (k : ℕ) := InvariantLinearLayer + (lowerCentralSeries ℝ (jointFixedLieSubalgebra D.operators) (jointFixedLieSubalgebra D.operators) k).toSubmodule + (lowerCentralSeries ℝ (jointFixedLieSubalgebra D.operators) (jointFixedLieSubalgebra D.operators) (k + 1)).toSubmodule + +def layerEnd (k : ℕ) (q : Q) : Module.End ℝ (D.lowerCentralLayer k) := + invariantLayerEnd _ _ (jointFixedLinearAction D.operators (D.action q) + (fun S hS => D.action_commutes S hS q)) + (jointFixed_action_preserves_lowerCentral D.operators (D.action q) + (fun S hS => D.action_commutes S hS q) k) + (jointFixed_action_preserves_lowerCentral D.operators (D.action q) + (fun S hS => D.action_commutes S hS q) (k + 1)) + +def layerAction (k : ℕ) : Q →* Module.End ℝ (D.lowerCentralLayer k) where + toFun := D.layerEnd k + map_one' := by + apply LinearMap.ext + intro y + refine Quotient.inductionOn' y ?_ + intro x + apply congrArg Submodule.Quotient.mk + apply Subtype.ext + apply Subtype.ext + change D.action 1 (x : jointFixedLieSubalgebra D.operators) = (x : L) + rw [action, polynomialModelLieEquiv_apply, D.normalized, map_one] + rfl + map_mul' q r := by + apply LinearMap.ext + intro y + refine Quotient.inductionOn' y ?_ + intro x + let K := jointFixedLieSubalgebra D.operators + let R := D.residualSystem + have hx : (x : K) ∈ lowerCentralSeries ℝ K K k := x.property + have hy : R.action (q * r) x ∈ lowerCentralSeries ℝ K K k := + jointFixed_action_preserves_lowerCentral D.operators (D.action (q * r)) + (fun S hS => D.action_commutes S hS _) k x hx + have hh := polynomialSubalgebra_inner_difference K (R.factor q r) k (R.action (q * r) x) hy + rw [← R.action_mul_apply] at hh + symm + apply (Submodule.Quotient.eq _).mpr + exact hh + +omit [LieRing.IsNilpotent L] in +theorem layer_generator_unipotent (k : ℕ) (q : Q) (hq : q ∈ qs) : + IsNilpotent (D.layerAction k q - 1) := + invariantLayerEnd_unipotent _ _ _ + (jointFixed_action_preserves_lowerCentral D.operators (D.action q) + (fun S hS => D.action_commutes S hS q) k) + (jointFixed_action_preserves_lowerCentral D.operators (D.action q) + (fun S hS => D.action_commutes S hS q) (k + 1)) + (D.residual_generator_unipotent q hq) + +omit [LieRing.IsNilpotent L] in +theorem layer_action_filtration [IsMulCommutative Q] + (hgen : Subgroup.closure {q | q ∈ qs} = ⊤) (k : ℕ) : + ∃ c, linearActionFiltration (fun q => D.layerAction k q - 1) c = ⊥ := + unipotent_generated_abelian_action_filtration (D.layerAction k) qs hgen + (D.layer_generator_unipotent k) + +end JointFixedReductionData +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/JointFixedReductionData.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/JointFixedReductionData.lean new file mode 100644 index 0000000000000000000000000000000000000000..5b5ec3b8f2f6177dd2882aef41b63dd3637d902b --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/JointFixedReductionData.lean @@ -0,0 +1,92 @@ +import OAI.GroupTheory.PolycyclicRecognition.Lattices.JointFixedFactorSystem +import OAI.GroupTheory.PolycyclicRecognition.Lattices.FiniteFixedCocycleSection +import OAI.GroupTheory.PolycyclicRecognition.Algebra.PolynomialSubalgebraNilpotence + +namespace OAI + +/-! # Constructed joint-fixed residual data for an actual extension + +The residual group is defined by the actual section factors and embeds in the +original extension. The prescribed quotient lifts act unipotently on its +kernel Lie algebra. +-/ + +noncomputable section +namespace PolycyclicRecognition +open scoped Manifold ContDiff IsMulCommutative +attribute [local instance] polynomialSubalgebraGroup +variable {L G Q : Type} [RealNormedLieAlgebra L] [FiniteDimensional ℝ L] + [P : PolynomialExponentialCoordinates L] [LieRing.IsNilpotent L] + [Group G] [Group Q] + +structure JointFixedReductionData (E : GroupExtension L G Q) + (hsmooth : ∀ g : G, ContMDiff (𝓘(ℝ, L)) (𝓘(ℝ, L)) ∞ (E.conjAct g)) (qs : List Q) where + operators : List (L ≃ₗ⁅ℝ⁆ L) + semisimple : ∀ S ∈ operators, Module.End.IsSemisimple S.toLinearMap + commute : ∀ S ∈ operators, ∀ T ∈ operators, Commute S.toLinearMap T.toLinearMap + sectionMap : E.Section + normalized : sectionMap 1 = 1 + centralizes : ∀ S ∈ operators, ∀ q, sectionMap q ∈ semisimpleActionCentralizer E S + factorsFixed : ∀ S ∈ operators, ∀ q r, S (GroupExtensionSection.factor E sectionMap q r) = + GroupExtensionSection.factor E sectionMap q r + jordanLifts : ∀ q ∈ qs, ∃ S ∈ operators, ∃ U : L ≃ₗ⁅ℝ⁆ L, + IsNilpotent (U.toLinearMap - 1) ∧ Commute S.toLinearMap U.toLinearMap ∧ + (polynomialModelLieEquiv (E.conjAct (sectionMap q)) (hsmooth (sectionMap q))).toLinearMap = + S.toLinearMap * U.toLinearMap + +theorem exists_jointFixedReductionData [IsMulCommutative Q] (E : GroupExtension L G Q) + (hsmooth : ∀ g : G, ContMDiff (𝓘(ℝ, L)) (𝓘(ℝ, L)) ∞ (E.conjAct g)) (qs : List Q) : + Nonempty (JointFixedReductionData E hsmooth qs) := by + obtain ⟨ss, hss, hpair, σ, hσ, hcent, hfixed, hlifts⟩ := + exists_finite_fixed_cocycle_section E hsmooth qs + exact ⟨⟨ss, hss, hpair, σ, hσ, hcent, hfixed, hlifts⟩⟩ + +namespace JointFixedReductionData +variable {E : GroupExtension L G Q} + {hsmooth : ∀ g : G, ContMDiff (𝓘(ℝ, L)) (𝓘(ℝ, L)) ∞ (E.conjAct g)} {qs : List Q} + (D : JointFixedReductionData E hsmooth qs) + +def action (q : Q) : L ≃ₗ⁅ℝ⁆ L := + polynomialModelLieEquiv (E.conjAct (D.sectionMap q)) (hsmooth (D.sectionMap q)) + +omit [LieRing.IsNilpotent L] in +theorem action_commutes (S : L ≃ₗ⁅ℝ⁆ L) (hS : S ∈ D.operators) (q : Q) : + Commute S.toLinearMap (D.action q).toLinearMap := + (mem_semisimpleActionCentralizer_iff E S _ _).mp (D.centralizes S hS q) + +def residualSystem : NonabelianFactorSystem (jointFixedLieSubalgebra D.operators) Q := + jointFixedFactorSystem (GroupExtensionSection.factorSystem E D.sectionMap D.normalized) + D.action (fun _ _ => (polynomialModelLieEquiv_apply _ _ _).symm) + D.operators D.action_commutes D.factorsFixed + +def residualEmbedding : FactorExtension D.residualSystem →* G := + jointFixedExtensionEmbedding E D.sectionMap D.normalized D.action + (fun _ _ => (polynomialModelLieEquiv_apply _ _ _).symm) + D.operators D.action_commutes D.factorsFixed + +omit [LieRing.IsNilpotent L] in +theorem residualEmbedding_injective : Function.Injective D.residualEmbedding := + jointFixedExtensionEmbedding_injective E D.sectionMap D.normalized D.action + (fun _ _ => (polynomialModelLieEquiv_apply _ _ _).symm) + D.operators D.action_commutes D.factorsFixed + +omit [LieRing.IsNilpotent L] in +theorem residual_generator_unipotent (q : Q) (hq : q ∈ qs) : + IsNilpotent (jointFixedLinearAction D.operators (D.action q) + (fun S hS => D.action_commutes S hS q) - 1) := by + obtain ⟨S, hS, U, hU, hSU, hA⟩ := D.jordanLifts q hq + exact jointFixedLinearAction_unipotent D.operators S U (D.action q) hS + (fun T hT => D.action_commutes T hT q) hU hSU hA + +theorem residual_kernel_nilpotent : Group.IsNilpotent (jointFixedLieSubalgebra D.operators) := by + let K := jointFixedLieSubalgebra D.operators + let : LieRing.IsNilpotent K := Function.Injective.lieAlgebra_isNilpotent + (f := K.incl) Subtype.val_injective + exact polynomialSubalgebra_group_nilpotent K + +end JointFixedReductionData +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/JointFixedResidualNilpotent.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/JointFixedResidualNilpotent.lean new file mode 100644 index 0000000000000000000000000000000000000000..7cf3b0c9ff0626d05caab6f7debe3e9e8b81f502 --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/JointFixedResidualNilpotent.lean @@ -0,0 +1,62 @@ +import OAI.GroupTheory.PolycyclicRecognition.Algebra.ResidualLowerCentralLayers +import OAI.GroupTheory.PolycyclicRecognition.Algebra.RelativeNilpotentExtension + +namespace OAI + +/-! # The actual joint-fixed residual extension is nilpotent + +The quotient need not split. Its unipotent action has finite length on every +intrinsic Lie lower-central layer, and the cocycle disappears on those layers. +-/ + +noncomputable section +namespace PolycyclicRecognition +open LieModule +open scoped Manifold ContDiff IsMulCommutative +attribute [local instance] polynomialSubalgebraGroup +variable {L G Q : Type} [RealNormedLieAlgebra L] [FiniteDimensional ℝ L] + [P : PolynomialExponentialCoordinates L] [LieRing.IsNilpotent L] + [Group G] [Group Q] [IsMulCommutative Q] + {E : GroupExtension L G Q} + {hsmooth : ∀ g : G, ContMDiff (𝓘(ℝ, L)) (𝓘(ℝ, L)) ∞ (E.conjAct g)} {qs : List Q} + +namespace JointFixedReductionData +variable (D : JointFixedReductionData E hsmooth qs) + +theorem residual_nilpotent (hgen : Subgroup.closure {q | q ∈ qs} = ⊤) : + Group.IsNilpotent (FactorExtension D.residualSystem) := by + let K := jointFixedLieSubalgebra D.operators + let : LieRing.IsNilpotent K := Function.Injective.lieAlgebra_isNilpotent + (f := K.incl) Subtype.val_injective + obtain ⟨d, hd⟩ := (LieModule.isNilpotent_iff ℝ K K).mp + (inferInstance : LieModule.IsNilpotent K K) + have hbot : D.residualLayer d = ⊥ := by + have hk : D.residualKernelLayer d = ⊥ := by + apply eq_bot_iff.mpr + intro x hx + change x ∈ lowerCentralSeries ℝ K K d at hx + rw [hd] at hx + change x = 1 + exact hx.trans (Subtype.ext P.one_eq_zero).symm + rw [residualLayer, hk, Subgroup.map_bot] + have hzero : D.residualLayer 0 = + (FactorExtension.groupExtension D.residualSystem).inl.range := by + have hk : D.residualKernelLayer 0 = ⊤ := by + ext x + simp only [Subgroup.mem_top, iff_true] + change x ∈ lowerCentralSeries ℝ K K 0 + simp + rw [residualLayer, hk, Subgroup.map_top] + rfl + obtain ⟨c, hc⟩ := relative_series_descends_finite_layers ⊤ D.residualLayer + (D.residualLayer_commutator_bound hgen) d + apply nilpotent_of_relative_kernel_series (FactorExtension.groupExtension D.residualSystem) c + rw [← hzero] + exact eq_bot_iff.mpr (hbot ▸ hc) + +end JointFixedReductionData +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/JointFixedSubalgebra.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/JointFixedSubalgebra.lean new file mode 100644 index 0000000000000000000000000000000000000000..7151b42a07cf91c82380713629394639d4ec797c --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/JointFixedSubalgebra.lean @@ -0,0 +1,98 @@ +import OAI.GroupTheory.PolycyclicRecognition.Algebra.SemisimpleMovingAction +import Mathlib.RingTheory.Nilpotent.Lemmas + +namespace OAI + +/-! # The joint fixed algebra and its unipotent quotient-lift actions -/ + +noncomputable section +namespace PolycyclicRecognition +attribute [local instance] polynomialSubalgebraGroup +variable {L : Type} [RealNormedLieAlgebra L] [FiniteDimensional ℝ L] + +def jointFixedLieSubalgebra (ss : List (L ≃ₗ⁅ℝ⁆ L)) : LieSubalgebra ℝ L where + toSubmodule := + { carrier := {x | ∀ S ∈ ss, S x = x} + zero_mem' := by intro S _; exact map_zero S + add_mem' := by + intro x y hx hy S hS + rw [map_add, hx S hS, hy S hS] + smul_mem' := by + intro r x hx S hS + rw [map_smul, hx S hS] } + lie_mem' := by + intro x y hx hy S hS + rw [S.map_lie, hx S hS, hy S hS] + +omit [FiniteDimensional ℝ L] in +theorem mem_jointFixedLieSubalgebra (ss : List (L ≃ₗ⁅ℝ⁆ L)) (x : L) : + x ∈ jointFixedLieSubalgebra ss ↔ ∀ S ∈ ss, S x = x := Iff.rfl + +omit [FiniteDimensional ℝ L] in +theorem commuting_lieEquiv_preserves_jointFixed (ss : List (L ≃ₗ⁅ℝ⁆ L)) + (T : L ≃ₗ⁅ℝ⁆ L) (hT : ∀ S ∈ ss, Commute S.toLinearMap T.toLinearMap) + (x : L) (hx : x ∈ jointFixedLieSubalgebra ss) : T x ∈ jointFixedLieSubalgebra ss := by + apply (mem_jointFixedLieSubalgebra ss _).mpr + intro S hS + have hh : S (T x) = T (S x) := LinearMap.congr_fun (hT S hS).eq x + rw [hh, (mem_jointFixedLieSubalgebra ss x).mp hx S hS] + +def jointFixedLinearAction (ss : List (L ≃ₗ⁅ℝ⁆ L)) + (T : L ≃ₗ⁅ℝ⁆ L) (hT : ∀ S ∈ ss, Commute S.toLinearMap T.toLinearMap) : + Module.End ℝ (jointFixedLieSubalgebra ss) := + T.toLinearMap.restrict (commuting_lieEquiv_preserves_jointFixed ss T hT) + +def jointFixedLieAction (ss : List (L ≃ₗ⁅ℝ⁆ L)) + (T : L ≃ₗ⁅ℝ⁆ L) (hT : ∀ S ∈ ss, Commute S.toLinearMap T.toLinearMap) : + jointFixedLieSubalgebra ss ≃ₗ⁅ℝ⁆ jointFixedLieSubalgebra ss where + toFun x := ⟨T x, commuting_lieEquiv_preserves_jointFixed ss T hT x x.property⟩ + invFun x := ⟨T.symm x, commuting_lieEquiv_preserves_jointFixed ss T.symm + (fun S hS => linear_commute_symm T.toLinearEquiv S.toLinearMap (hT S hS)) x x.property⟩ + left_inv x := Subtype.ext (T.symm_apply_apply x) + right_inv x := Subtype.ext (T.apply_symm_apply x) + map_add' x y := Subtype.ext (T.map_add x y) + map_smul' r x := Subtype.ext (T.map_smul r x) + map_lie' {x y} := Subtype.ext (T.map_lie x y) + +omit [FiniteDimensional ℝ L] in +theorem jointFixedLinearAction_unipotent (ss : List (L ≃ₗ⁅ℝ⁆ L)) + (S U T : L ≃ₗ⁅ℝ⁆ L) (hS : S ∈ ss) + (hT : ∀ R ∈ ss, Commute R.toLinearMap T.toLinearMap) + (hU : IsNilpotent (U.toLinearMap - 1)) (hSU : Commute S.toLinearMap U.toLinearMap) + (hTU : T.toLinearMap = S.toLinearMap * U.toLinearMap) : + IsNilpotent (jointFixedLinearAction ss T hT - 1) := by + have hUx (x : L) (hx : x ∈ jointFixedLieSubalgebra ss) : T x = U x := by + have hh : T x = S (U x) := LinearMap.congr_fun hTU x + have hc : S (U x) = U (S x) := LinearMap.congr_fun hSU.eq x + rw [hh, hc, (mem_jointFixedLieSubalgebra ss x).mp hx S hS] + have hUp : ∀ x ∈ (jointFixedLieSubalgebra ss).toSubmodule, U x ∈ jointFixedLieSubalgebra ss := by + intro x hx + rw [← hUx x hx] + exact commuting_lieEquiv_preserves_jointFixed ss T hT x hx + have hdiffp : ∀ x ∈ (jointFixedLieSubalgebra ss).toSubmodule, + (U.toLinearMap - 1) x ∈ jointFixedLieSubalgebra ss := by + intro x hx + exact (jointFixedLieSubalgebra ss).sub_mem (hUp x hx) hx + have hn := Module.End.isNilpotent.restrict hdiffp hU + have he : jointFixedLinearAction ss T hT - 1 = (U.toLinearMap - 1).restrict hdiffp := by + apply LinearMap.ext + intro x + apply Subtype.ext + change T x - (x : L) = U x - (x : L) + rw [hUx x x.property] + rwa [he] + +variable [P : PolynomialExponentialCoordinates L] + +def jointFixedGroupAction (ss : List (L ≃ₗ⁅ℝ⁆ L)) + (T : L ≃ₗ⁅ℝ⁆ L) (hT : ∀ S ∈ ss, Commute S.toLinearMap T.toLinearMap) : + MulAut (jointFixedLieSubalgebra ss) := + polynomialSubalgebraEquiv _ _ T (commuting_lieEquiv_preserves_jointFixed ss T hT) + (commuting_lieEquiv_preserves_jointFixed ss T.symm + (fun S hS => linear_commute_symm T.toLinearEquiv S.toLinearMap (hT S hS))) + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/KernelCompletionAction.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/KernelCompletionAction.lean new file mode 100644 index 0000000000000000000000000000000000000000..9b56658c74ee31f1e65bd4fb49bd7536f167025b --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/KernelCompletionAction.lean @@ -0,0 +1,95 @@ +import OAI.GroupTheory.PolycyclicRecognition.Lattices.KernelCompletionHeight + +namespace OAI + +/-! # Extending an action to the nilpotent completion + +Existence comes from the constructed homomorphism extension. Uniqueness on +the integer grid forces the extensions to satisfy the action law. +-/ + +noncomputable section +namespace PolycyclicRecognition +open scoped Manifold ContDiff +variable {K G Q : Type} [RealNormedLieAlgebra K] [FiniteDimensional ℝ K] + [PK : PolynomialExponentialCoordinates K] [Group G] [Group Q] + {i : K →* G} (C : NilpotentKernelCompletion i) (ρ : Q →* MulAut G) + (hρ : ∀ q, ContMDiff (𝓘(ℝ, K)) (𝓘(ℝ, C.carrier)) ∞ + ((C.embed.comp (ρ q).toMonoidHom).comp i)) + +namespace NilpotentKernelCompletion + +include hρ in +theorem action_extension_exists (q : Q) : + ∃ A : MulAut C.carrier, ContMDiff (𝓘(ℝ, C.carrier)) (𝓘(ℝ, C.carrier)) ∞ A ∧ + ContMDiff (𝓘(ℝ, C.carrier)) (𝓘(ℝ, C.carrier)) ∞ A.symm ∧ + ∀ g, A (C.embed g) = C.embed (ρ q g) := by + apply C.automorphism_extension (ρ q) (hρ q) + have hi : (ρ q).symm = ρ q⁻¹ := (map_inv ρ q).symm + rw [hi] + exact hρ q⁻¹ + +def extendedAutomorphism (q : Q) : MulAut C.carrier := + (C.action_extension_exists ρ hρ q).choose + +theorem extendedAutomorphism_smooth (q : Q) : + ContMDiff (𝓘(ℝ, C.carrier)) (𝓘(ℝ, C.carrier)) ∞ + (C.extendedAutomorphism ρ hρ q) := + (C.action_extension_exists ρ hρ q).choose_spec.1 + +theorem extendedAutomorphism_embed (q : Q) (g : G) : + C.extendedAutomorphism ρ hρ q (C.embed g) = C.embed (ρ q g) := + (C.action_extension_exists ρ hρ q).choose_spec.2.2 g + +def extendedAction : Q →* MulAut C.carrier where + toFun := C.extendedAutomorphism ρ hρ + map_one' := by + apply MulEquiv.toMonoidHom_injective + apply C.hom_ext C.carrier _ _ (C.extendedAutomorphism_smooth ρ hρ 1) contMDiff_id + intro g + rw [MulEquiv.coe_toMonoidHom, C.extendedAutomorphism_embed] + simp only [map_one, MulAut.one_apply] + rfl + map_mul' q r := by + apply MulEquiv.toMonoidHom_injective + apply C.hom_ext C.carrier + (C.extendedAutomorphism ρ hρ (q * r)).toMonoidHom + ((C.extendedAutomorphism ρ hρ q) * (C.extendedAutomorphism ρ hρ r)).toMonoidHom + (C.extendedAutomorphism_smooth ρ hρ (q * r)) + ((C.extendedAutomorphism_smooth ρ hρ q).comp + (C.extendedAutomorphism_smooth ρ hρ r)) + intro g + change C.extendedAutomorphism ρ hρ (q * r) (C.embed g) = + C.extendedAutomorphism ρ hρ q (C.extendedAutomorphism ρ hρ r (C.embed g)) + rw [C.extendedAutomorphism_embed, C.extendedAutomorphism_embed, + C.extendedAutomorphism_embed, map_mul] + rfl + +@[simp] theorem extendedAction_embed (q : Q) (g : G) : + C.extendedAction ρ hρ q (C.embed g) = C.embed (ρ q g) := + C.extendedAutomorphism_embed ρ hρ q g + +theorem extendedAction_smooth (q : Q) : + ContMDiff (𝓘(ℝ, C.carrier)) (𝓘(ℝ, C.carrier)) ∞ (C.extendedAction ρ hρ q) := + C.extendedAutomorphism_smooth ρ hρ q + +theorem extendedAction_preserves_hom {M : Type} [RealNormedLieAlgebra M] + [FiniteDimensional ℝ M] [PM : PolynomialExponentialCoordinates M] + (π : C.carrier →* M) (hπ : ContMDiff (𝓘(ℝ, C.carrier)) (𝓘(ℝ, M)) ∞ π) + (hinv : ∀ q g, π (C.embed (ρ q g)) = π (C.embed g)) (q : Q) (x : C.carrier) : + π (C.extendedAction ρ hρ q x) = π x := by + have he : π.comp (C.extendedAction ρ hρ q).toMonoidHom = π := by + apply C.hom_ext M (π.comp (C.extendedAction ρ hρ q).toMonoidHom) π + (hπ.comp (C.extendedAction_smooth ρ hρ q)) hπ + intro g + change π (C.extendedAction ρ hρ q (C.embed g)) = π (C.embed g) + rw [extendedAction_embed] + exact hinv q g + exact DFunLike.congr_fun he x + +end NilpotentKernelCompletion +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/KernelCompletionCyclicHom.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/KernelCompletionCyclicHom.lean new file mode 100644 index 0000000000000000000000000000000000000000..2c51180e3f998a3cd7b2b3f15775bfa6fa82944a --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/KernelCompletionCyclicHom.lean @@ -0,0 +1,76 @@ +import OAI.GroupTheory.PolycyclicRecognition.Lattices.NilpotentKernelCompletion +import OAI.GroupTheory.PolycyclicRecognition.Lattices.NilpotentCyclicHomExtension +import OAI.GroupTheory.PolycyclicRecognition.Lattices.IntegerSemidirectLattice + +namespace OAI + +/-! # Extending homomorphisms after one cyclic completion step -/ + +noncomputable section +namespace PolycyclicRecognition +open scoped Manifold ContDiff +variable {K H M : Type} [RealNormedLieAlgebra K] [FiniteDimensional ℝ K] + [PK : PolynomialExponentialCoordinates K] [Group H] + [RealNormedLieAlgebra M] [FiniteDimensional ℝ M] + [PM : PolynomialExponentialCoordinates M] [LieRing.IsNilpotent M] + {i : K →* H} (C : NilpotentKernelCompletion i) + +theorem kernelCompletion_cyclic_hom (a : MulAut H) + (A : C.carrier ≃ₗ⁅ℝ⁆ C.carrier) (hA : IsNilpotent (A.toLinearMap - 1)) + (hAe : ∀ h, A (C.embed h) = C.embed (a h)) + (F : (H ⋊[integerPowerAction a] Multiplicative ℤ) →* M) + (hF : ContMDiff (𝓘(ℝ, K)) (𝓘(ℝ, M)) ∞ ((F.comp SemidirectProduct.inl).comp i)) : + let D := unipotentLieLogarithm A hA + let hD := unipotentLieLogarithm_nilpotent A hA + letI := derivationSemidirectGroup D hD + letI : MulOneClass (C.carrier × ℝ) := (derivationSemidirectGroup D hD).toMulOneClass + ∃ φ : (C.carrier × ℝ) →* M, + ContMDiff (𝓘(ℝ, C.carrier × ℝ)) (𝓘(ℝ, M)) ∞ φ ∧ + ∀ (h : H) (n : ℤ), φ (C.embed h, (n : ℝ)) = F ⟨h, Multiplicative.ofAdd n⟩ := by + obtain ⟨f, hf, hfe⟩ := C.extend M (F.comp SemidirectProduct.inl) hF + simp only [MonoidHom.comp_apply] at hfe + let t : H ⋊[integerPowerAction a] Multiplicative ℤ := + SemidirectProduct.inr (Multiplicative.ofAdd (1 : ℤ)) + let u := F t + have hconj (h : H) : F (SemidirectProduct.inl (a h)) = + u * F (SemidirectProduct.inl h) * u⁻¹ := by + have hh := SemidirectProduct.inl_aut (φ := integerPowerAction a) + (Multiplicative.ofAdd (1 : ℤ)) h + rw [map_inv] at hh + change SemidirectProduct.inl ((a ^ (1 : ℤ)) h) = t * SemidirectProduct.inl h * t⁻¹ at hh + simpa only [zpow_one, map_mul, map_inv] using congrArg F hh + let B := PolynomialExponentialCoordinates.groupAutomorphism A + have hb : ContMDiff (𝓘(ℝ, C.carrier)) (𝓘(ℝ, C.carrier)) ∞ B := + A.toLinearMap.toContinuousLinearMap.contDiff.contMDiff + have hu : ContMDiff (𝓘(ℝ, M)) (𝓘(ℝ, M)) ∞ (MulAut.conj u) := + (contMDiff_conjugation u).of_le (by simp) + have heq : f.comp B.toMonoidHom = (MulAut.conj u).toMonoidHom.comp f := by + apply C.hom_ext M (f.comp B.toMonoidHom) ((MulAut.conj u).toMonoidHom.comp f) + (hf.comp hb) (hu.comp hf) + intro h + change f (A (C.embed h)) = u * f (C.embed h) * u⁻¹ + rw [hAe, hfe, hfe] + exact hconj h + let fL := polynomialModelLieHom f hf + have hL (x : C.carrier) : fL (A x) = u * fL x * u⁻¹ := by + rw [polynomialModelLieHom_apply, polynomialModelLieHom_apply] + exact DFunLike.congr_fun heq x + obtain ⟨φ, hφ, hφx⟩ := nilpotent_cyclic_hom_extension A hA fL u hL + refine ⟨φ, hφ, ?_⟩ + intro h n + rw [hφx, polynomialModelLieHom_apply, hfe, ← model_zpow, ← map_zpow, ← map_mul] + congr 1 + have ht : t ^ n = SemidirectProduct.inr (Multiplicative.ofAdd n) := by + rw [← map_zpow] + congr 1 + apply Multiplicative.ext + change n • (1 : ℤ) = n + simp + rw [ht] + exact (SemidirectProduct.mk_eq_inl_mul_inr _ _).symm + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/KernelCompletionCyclicStep.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/KernelCompletionCyclicStep.lean new file mode 100644 index 0000000000000000000000000000000000000000..cc2efd1fba7f197becb766b8d739bc6a561da5e5 --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/KernelCompletionCyclicStep.lean @@ -0,0 +1,123 @@ +import OAI.GroupTheory.PolycyclicRecognition.Lattices.KernelCompletionCyclicHom +import OAI.GroupTheory.PolycyclicRecognition.Algebra.CyclicParameterBasis +import OAI.GroupTheory.PolycyclicRecognition.Geometry.SemidirectExponentialCoordinates + +namespace OAI + +/-! # A cyclic step in completing a nilpotent extension with a real kernel + +This constructs the next polynomial model, its faithful embedding, its integer +grid and its homomorphism extension property. No lattice in the kernel is +required. +-/ + +noncomputable section +namespace PolycyclicRecognition +open scoped Manifold ContDiff +variable {K H : Type} [RealNormedLieAlgebra K] [FiniteDimensional ℝ K] + [PK : PolynomialExponentialCoordinates K] [Group H] + {i : K →* H} (C : NilpotentKernelCompletion i) + +namespace NilpotentKernelCompletion + +theorem cyclic_step_with_dimension (a : MulAut H) (A : C.carrier ≃ₗ⁅ℝ⁆ C.carrier) + (hA : IsNilpotent (A.toLinearMap - 1)) + (hAe : ∀ h, A (C.embed h) = C.embed (a h)) : + ∃ C' : NilpotentKernelCompletion + ((SemidirectProduct.inl : H →* H ⋊[integerPowerAction a] Multiplicative ℤ).comp i), + C'.dimension = C.dimension + 1 := by + let L := C.carrier + let D := unipotentLieLogarithm A hA + let hD := unipotentLieLogarithm_nilpotent A hA + let φ := PolynomialExponentialCoordinates.derivationAction D hD + have hstep (h : H) : C.embed (a h) = φ (Multiplicative.ofAdd 1) (C.embed h) := by + change C.embed (a h) = unipotentLieFlow A hA 1 (C.embed h) + rw [unipotentLieFlow_one, hAe] + let I := realIntegerSemidirectMap φ a C.embed hstep + have hI : Function.Injective I := realIntegerSemidirectMap_injective φ a C.embed hstep C.injective + let := derivationSemidirectGroup D hD + let : Mul (L × ℝ) := (derivationSemidirectGroup D hD).toMul + let : MulOneClass (L × ℝ) := (derivationSemidirectGroup D hD).toMulOneClass + let e : (L × ℝ) ≃* (L ⋊[φ] Multiplicative ℝ) := + { derivationSemidirectEquiv D hD with map_mul' := fun _ _ => rfl } + let jR := e.symm.toMonoidHom.comp I + have hjR (z : H ⋊[integerPowerAction a] Multiplicative ℤ) : + jR z = (C.embed z.left, (z.right.toAdd : ℝ)) := rfl + obtain ⟨Q, E, hE⟩ := exists_semidirect_polynomial_exponential_coordinates D hD + let := Q + let T := DerivationLieSpace D hD + let : Group T := Q.group + let : Mul T := Q.group.toMul + let j := E.symm.toMonoidHom.comp jR + have hj (z : H ⋊[integerPowerAction a] Multiplicative ℤ) : + E (j z) = (C.embed z.left, (z.right.toAdd : ℝ)) := by + change E (E.symm (jR z)) = _ + rw [E.apply_symm_apply, hjR] + let s := derivationLieSpaceSplit D hD + let b := cyclicParameterBasis C.basis s + let c := Module.finBasis ℝ (L × ℝ) + let p := transportedProductParameter C.parameter s E.toEquiv + have hp := polynomial_transported_product_parameter C.basis c b + C.parameter s E.toEquiv C.polynomial C.polynomial_symm (hE b c).1 (hE b c).2 + have hEinv : ContMDiff (𝓘(ℝ, L × ℝ)) (𝓘(ℝ, T)) ∞ E.symm := + ((hE b c).2.contDiff.of_le le_top).contMDiff + have hEfor : ContMDiff (𝓘(ℝ, T)) (𝓘(ℝ, L × ℝ)) ∞ E := + ((hE b c).1.contDiff.of_le le_top).contMDiff + refine ⟨{ + carrier := T + nilpotent := derivationLieSpace_nilpotent D hD + embed := j + injective := E.symm.injective.comp (e.symm.injective.comp hI) + kernel_smooth := ?_ + dimension := C.dimension + 1 + basis := b + parameter := p + polynomial := hp.1 + polynomial_symm := hp.2 + integer_grid := ?_ + extend := ?_ }, rfl⟩ + · have heq : (j.comp ((SemidirectProduct.inl : H →* + H ⋊[integerPowerAction a] Multiplicative ℤ).comp i) : K → T) = + fun x => E.symm (C.embed (i x), 0) := by + funext x + apply E.injective + rw [E.apply_symm_apply] + change E (j (SemidirectProduct.inl (i x))) = (C.embed (i x), 0) + rw [hj] + simp + rw [heq] + exact hEinv.comp (C.kernel_smooth.prodMk_space contMDiff_const) + · intro z + obtain ⟨h, hh⟩ := C.integer_grid (fun k => z k.castSucc) + refine ⟨⟨h, Multiplicative.ofAdd (z (Fin.last C.dimension))⟩, ?_⟩ + apply E.injective + rw [hj] + have hparam := transportedProductParameter_integer C.basis C.parameter s E.toEquiv z + change E (p (b.equivFun.symm (fun k => (z k : ℝ)))) = + (C.parameter (C.basis.equivFun.symm (fun k => (z k.castSucc : ℝ))), + (z (Fin.last C.dimension) : ℝ)) at hparam + rw [hparam, hh] + rfl + · intro M _ _ PM hnil F hF + obtain ⟨r, hr, hre⟩ := kernelCompletion_cyclic_hom C a A hA hAe F hF + let f := r.comp E.toMonoidHom + refine ⟨f, hr.comp hEfor, ?_⟩ + intro z + change r (E (j z)) = F z + rw [hj] + exact hre z.left z.right.toAdd + +theorem cyclic_step (a : MulAut H) (A : C.carrier ≃ₗ⁅ℝ⁆ C.carrier) + (hA : IsNilpotent (A.toLinearMap - 1)) + (hAe : ∀ h, A (C.embed h) = C.embed (a h)) : + Nonempty (NilpotentKernelCompletion + ((SemidirectProduct.inl : H →* H ⋊[integerPowerAction a] Multiplicative ℤ).comp i)) := by + obtain ⟨C', _⟩ := C.cyclic_step_with_dimension a A hA hAe + exact ⟨C'⟩ + +end NilpotentKernelCompletion +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/KernelCompletionEmbedding.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/KernelCompletionEmbedding.lean new file mode 100644 index 0000000000000000000000000000000000000000..65a275316aa2dc4c1bf27cc68a759f5e7f3a229d --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/KernelCompletionEmbedding.lean @@ -0,0 +1,102 @@ +import OAI.GroupTheory.PolycyclicRecognition.Lattices.KernelCompletionHeight +import OAI.GroupTheory.PolycyclicRecognition.Algebra.FactorExtensionTopology +import Mathlib.LinearAlgebra.Basis.VectorSpace + +namespace OAI + +/-! # The completion embeds the original topology + +The integer quotient is recovered continuously from the real height. On each +fiber a continuous linear left inverse recovers the original kernel coordinate. +-/ + +noncomputable section +namespace PolycyclicRecognition +open scoped Manifold ContDiff +attribute [local instance] factorExtensionTopology +variable {L : Type} [RealNormedLieAlgebra L] [FiniteDimensional ℝ L] + [P : PolynomialExponentialCoordinates L] {n : ℕ} + (R : NonabelianFactorSystem L (IntegralLatticeGroup n)) + (C : NilpotentKernelCompletion (FactorExtension.inl R)) + (π : C.carrier →* AbelianRealSpace n) + (hπ : ContMDiff (𝓘(ℝ, C.carrier)) (𝓘(ℝ, AbelianRealSpace n)) ∞ π) + (he : ∀ a, π (C.embed a) = integralRealHeight a.right) + +local instance completionEmbeddingTopologicalGroup : IsTopologicalGroup C.carrier := + topologicalGroup_of_lieGroup (𝓘(ℝ, C.carrier)) ⊤ + +theorem completion_factorization (a : FactorExtension R) : + C.embed a = C.embed (FactorExtension.inl R a.left) * + C.embed (⟨1, a.right⟩ : FactorExtension R) := by + rw [← map_mul] + apply congrArg C.embed + apply FactorExtension.ext + · change a.left = a.left * R.action 1 1 * R.factor 1 a.right + rw [map_one, R.factor_one_left, mul_one, mul_one] + · exact (one_mul _).symm + +theorem kernelCompletion_continuous : Continuous C.embed := by + have hs : Continuous (fun q : IntegralLatticeGroup n => C.embed (⟨1, q⟩ : FactorExtension R)) := + continuous_of_discreteTopology + have hc := (C.kernel_smooth.continuous.comp (continuous_factor_left R)).mul + (hs.comp (continuous_factor_right R)) + exact hc.congr (fun a => (completion_factorization R C a).symm) + +include hπ he in +theorem kernelCompletion_isEmbedding : Topology.IsEmbedding C.embed := by + let j := (polynomialModelLieHom (C.embed.comp (FactorExtension.inl R)) C.kernel_smooth).toLinearMap + have hj (x : L) : j x = C.embed (FactorExtension.inl R x) := + polynomialModelLieHom_apply _ C.kernel_smooth x + have hji : Function.Injective j := by + intro x y h + apply FactorExtension.inl_injective R + apply C.injective + exact (hj x).symm.trans (h.trans (hj y)) + obtain ⟨l, hl⟩ := j.exists_leftInverse_of_injective (LinearMap.ker_eq_bot.mpr hji) + let e : FactorExtension R ≃* C.embed.range := MonoidHom.ofInjective C.injective + have hlat (x : C.embed.range) : π x.val ∈ abelianRealLattice n := by + obtain ⟨a, ha⟩ := x.property + rw [← ha, he] + exact integerVectorMap_mem n a.right.toAdd + let q : C.embed.range → IntegralLatticeGroup n := fun x => + (abelianRealLatticeEquiv n).symm ⟨π x.val, hlat x⟩ + have hq (a : FactorExtension R) : q (e a) = a.right := by + apply (abelianRealLatticeEquiv n).injective + apply Subtype.ext + change ((abelianRealLatticeEquiv n) ((abelianRealLatticeEquiv n).symm + ⟨π (C.embed a), hlat (e a)⟩) : AbelianRealSpace n) = _ + rw [MulEquiv.apply_symm_apply] + exact he a + have hqc : Continuous q := by + let := (abelianRealLattice_uniform n).1 + exact (continuous_of_discreteTopology : Continuous (abelianRealLatticeEquiv n).symm).comp + ((hπ.continuous.comp continuous_subtype_val).subtype_mk hlat) + let r : C.embed.range → L := fun x => l + (x.val * (C.embed (⟨1, q x⟩ : FactorExtension R))⁻¹) + have hr (a : FactorExtension R) : r (e a) = a.left := by + change l (C.embed a * (C.embed (⟨1, q (e a)⟩ : FactorExtension R))⁻¹) = a.left + rw [hq, completion_factorization R C a, mul_inv_cancel_right, ← hj] + exact LinearMap.congr_fun hl a.left + have hrc : Continuous r := by + have hs : Continuous (fun q : IntegralLatticeGroup n => C.embed (⟨1, q⟩ : FactorExtension R)) := + continuous_of_discreteTopology + exact l.toContinuousLinearMap.continuous.comp + (continuous_subtype_val.mul (hs.comp hqc).inv) + have hinv : (e.symm : C.embed.range → FactorExtension R) = fun x => ⟨r x, q x⟩ := by + funext x + obtain ⟨a, rfl⟩ := e.surjective x + rw [e.symm_apply_apply, hr, hq] + have hei : Continuous e.symm := by + rw [hinv] + exact (factorExtensionHomeomorph R).symm.continuous.comp (hrc.prodMk hqc) + let homeo : FactorExtension R ≃ₜ C.embed.range := + { e.toEquiv with + continuous_toFun := (kernelCompletion_continuous R C).subtype_mk _ + continuous_invFun := hei } + exact Topology.IsEmbedding.subtypeVal.comp homeo.isEmbedding + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/KernelCompletionHeight.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/KernelCompletionHeight.lean new file mode 100644 index 0000000000000000000000000000000000000000..dee8df7f2846d281f7c60c9003773c86444331d7 --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/KernelCompletionHeight.lean @@ -0,0 +1,154 @@ +import OAI.GroupTheory.PolycyclicRecognition.Lattices.NilpotentIntegralKernelCompletion +import OAI.GroupTheory.PolycyclicRecognition.Algebra.AbelianRealSpace +import OAI.GroupTheory.PolycyclicRecognition.Lattices.IntegralLatticeGenerators +import Mathlib.LinearAlgebra.FiniteDimensional.Lemmas + +namespace OAI + +/-! # The real quotient of a nilpotent kernel completion + +The quotient homomorphism extends to the constructed completion. Its kernel +is exactly the original real kernel, by the dimension retained in the cyclic +construction. No exactness property is postulated for the completion. +-/ + +noncomputable section +namespace PolycyclicRecognition +open scoped Manifold ContDiff +variable {K G : Type} [RealNormedLieAlgebra K] [FiniteDimensional ℝ K] + [PK : PolynomialExponentialCoordinates K] [Group G] {n : ℕ} + +def integralRealHeight : IntegralLatticeGroup n →* AbelianRealSpace n where + toFun z := integerVectorMap n z.toAdd + map_one' := (integerVectorMap n).map_zero + map_mul' z w := (integerVectorMap n).map_add z.toAdd w.toAdd + +theorem integralRealHeight_injective : Function.Injective (integralRealHeight (n := n)) := by + intro z w h + exact Multiplicative.ext (integerVectorMap_injective n h) + +theorem integralRealHeight_range : + (integralRealHeight (n := n)).range = abelianRealLattice n := by + ext x + constructor + · rintro ⟨z, rfl⟩ + exact integerVectorMap_mem n z.toAdd + · intro hx + obtain ⟨z, hz⟩ := (abelianRealLatticeEquiv n).surjective ⟨x, hx⟩ + exact ⟨z, congrArg Subtype.val hz⟩ + +namespace NilpotentKernelCompletion +variable (E : GroupExtension K G (IntegralLatticeGroup n)) + (C : NilpotentKernelCompletion E.inl) + +theorem exists_height : + ∃ π : C.carrier →* AbelianRealSpace n, + ContMDiff (𝓘(ℝ, C.carrier)) (𝓘(ℝ, AbelianRealSpace n)) ∞ π ∧ + ∀ g, π (C.embed g) = integralRealHeight (E.rightHom g) := by + apply C.extend (AbelianRealSpace n) (integralRealHeight.comp E.rightHom) + have he : (integralRealHeight.comp E.rightHom).comp E.inl = + (1 : K →* AbelianRealSpace n) := by + ext x + simp only [MonoidHom.comp_apply, E.rightHom_inl, map_one, MonoidHom.one_apply] + rw [he] + exact contMDiff_const + +variable (π : C.carrier →* AbelianRealSpace n) + (hπ : ContMDiff (𝓘(ℝ, C.carrier)) (𝓘(ℝ, AbelianRealSpace n)) ∞ π) + (he : ∀ g, π (C.embed g) = integralRealHeight (E.rightHom g)) + +include hπ he in +theorem height_surjective : Function.Surjective π := by + let f := (polynomialModelLieHom π hπ).toLinearMap + have hr : LinearMap.range f = ⊤ := by + apply top_unique + have hb : Submodule.span ℝ (Set.range (Pi.basisFun ℝ (Fin n))) = + (⊤ : Submodule ℝ (AbelianRealSpace n)) := (Pi.basisFun ℝ (Fin n)).span_eq + rw [← hb] + apply Submodule.span_le.mpr + rintro _ ⟨j, rfl⟩ + obtain ⟨g, hg⟩ := E.rightHom_surjective (integralLatticeGenerator n j) + refine ⟨C.embed g, ?_⟩ + change polynomialModelLieHom π hπ (C.embed g) = _ + rw [polynomialModelLieHom_apply, he, hg] + exact integerVectorMap_basis j + intro x + obtain ⟨y, hy⟩ := (LinearMap.range_eq_top.mp hr) x + exact ⟨y, (polynomialModelLieHom_apply π hπ y).symm.trans hy⟩ + +include hπ he in +theorem height_kernel_eq + (hdim : C.dimension = Module.finrank ℝ K + n) : + π.ker = (C.embed.comp E.inl).range := by + let f := (polynomialModelLieHom π hπ).toLinearMap + let k := (polynomialModelLieHom (C.embed.comp E.inl) C.kernel_smooth).toLinearMap + have hk : Function.Injective k := by + intro x y h + apply E.inl_injective + apply C.injective + exact (polynomialModelLieHom_apply _ C.kernel_smooth x).symm.trans + (h.trans (polynomialModelLieHom_apply _ C.kernel_smooth y)) + have hle : LinearMap.range k ≤ LinearMap.ker f := by + rintro _ ⟨x, rfl⟩ + change polynomialModelLieHom π hπ (polynomialModelLieHom _ C.kernel_smooth x) = 0 + rw [polynomialModelLieHom_apply, polynomialModelLieHom_apply] + change π (C.embed (E.inl x)) = 0 + rw [he, E.rightHom_inl, map_one] + rfl + have hfdim : Module.finrank ℝ (LinearMap.ker f) = Module.finrank ℝ K := by + have hsurj : Function.Surjective f := by + intro x + obtain ⟨y, hy⟩ := C.height_surjective E π hπ he x + exact ⟨y, (polynomialModelLieHom_apply π hπ y).trans hy⟩ + have hr := LinearMap.finrank_range_add_finrank_ker f + rw [LinearMap.range_eq_top.mpr hsurj, finrank_top] at hr + have hn : Module.finrank ℝ (AbelianRealSpace n) = n := by + change Module.finrank ℝ (Fin n → ℝ) = n + simp + have hc : Module.finrank ℝ C.carrier = C.dimension := by + simpa only [Fintype.card_fin] using Module.finrank_eq_card_basis C.basis + rw [hn, hc, hdim] at hr + omega + have hkr : LinearMap.range k = LinearMap.ker f := + Submodule.eq_of_le_of_finrank_eq hle + ((LinearMap.finrank_range_of_inj hk).trans hfdim.symm) + ext y + change π y = 1 ↔ ∃ x, C.embed (E.inl x) = y + constructor + · intro hy + have hy' : y ∈ LinearMap.ker f := by + change polynomialModelLieHom π hπ y = 0 + rw [polynomialModelLieHom_apply, hy] + rfl + rw [← hkr] at hy' + obtain ⟨x, hx⟩ := hy' + exact ⟨x, (polynomialModelLieHom_apply _ C.kernel_smooth x).symm.trans hx⟩ + · rintro ⟨x, rfl⟩ + rw [he, E.rightHom_inl, map_one] + +include hπ he in +theorem embed_range_eq_height_lattice + (hdim : C.dimension = Module.finrank ℝ K + n) : + C.embed.range = (abelianRealLattice n).comap π := by + rw [← integralRealHeight_range] + ext x + constructor + · rintro ⟨g, rfl⟩ + exact ⟨E.rightHom g, (he g).symm⟩ + · rintro ⟨q, hq⟩ + obtain ⟨g, hg⟩ := E.rightHom_surjective q + have hk : x * (C.embed g)⁻¹ ∈ π.ker := by + change π (x * (C.embed g)⁻¹) = 1 + rw [map_mul, map_inv, he, hg, ← hq, mul_inv_cancel] + rw [C.height_kernel_eq E π hπ he hdim] at hk + obtain ⟨k, hk⟩ := hk + refine ⟨E.inl k * g, ?_⟩ + rw [map_mul, show C.embed (E.inl k) = x * (C.embed g)⁻¹ from hk] + exact inv_mul_cancel_right x (C.embed g) + +end NilpotentKernelCompletion +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/KernelCompletionTransport.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/KernelCompletionTransport.lean new file mode 100644 index 0000000000000000000000000000000000000000..8cd202928a9c0a700cd29b44764055a1da506b98 --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/KernelCompletionTransport.lean @@ -0,0 +1,58 @@ +import OAI.GroupTheory.PolycyclicRecognition.Lattices.NilpotentKernelCompletion + +namespace OAI + +/-! # Transporting a constructed completion across an exact group isomorphism -/ + +noncomputable section +namespace PolycyclicRecognition +open scoped Manifold ContDiff +variable {K H J : Type} [RealNormedLieAlgebra K] [FiniteDimensional ℝ K] + [PK : PolynomialExponentialCoordinates K] [Group H] [Group J] + {i : K →* H} + +namespace NilpotentKernelCompletion + +def of_equiv (C : NilpotentKernelCompletion i) (e : H ≃* J) : + NilpotentKernelCompletion (e.toMonoidHom.comp i) where + carrier := C.carrier + embed := C.embed.comp e.symm.toMonoidHom + injective := C.injective.comp e.symm.injective + kernel_smooth := by + convert C.kernel_smooth using 1 + ext x + exact congrArg C.embed (e.symm_apply_apply (i x)) + dimension := C.dimension + basis := C.basis + parameter := C.parameter + polynomial := C.polynomial + polynomial_symm := C.polynomial_symm + integer_grid z := by + obtain ⟨h, hh⟩ := C.integer_grid z + refine ⟨e h, ?_⟩ + simpa only [MonoidHom.comp_apply, MulEquiv.coe_toMonoidHom, e.symm_apply_apply] using hh + extend M _ _ _ _ f hf := by + obtain ⟨φ, hφ, he⟩ := C.extend M (f.comp e.toMonoidHom) hf + refine ⟨φ, hφ, ?_⟩ + intro j + exact (he (e.symm j)).trans (congrArg f (e.apply_symm_apply j)) + +theorem exists_of_bijective_kernel_with_dimension [LieRing.IsNilpotent K] + (i : K →* H) (hi : Function.Bijective i) : + ∃ C : NilpotentKernelCompletion i, C.dimension = Module.finrank ℝ K := by + let e := MulEquiv.ofBijective i hi + have he : e.toMonoidHom.comp (MonoidHom.id K) = i := by ext x; rfl + rw [← he] + exact ⟨of_equiv of_polynomial_kernel e, rfl⟩ + +theorem exists_of_bijective_kernel [LieRing.IsNilpotent K] + (i : K →* H) (hi : Function.Bijective i) : Nonempty (NilpotentKernelCompletion i) := by + obtain ⟨C, _⟩ := exists_of_bijective_kernel_with_dimension i hi + exact ⟨C⟩ + +end NilpotentKernelCompletion +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/KernelCompletionUnipotentLift.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/KernelCompletionUnipotentLift.lean new file mode 100644 index 0000000000000000000000000000000000000000..10b5f11a1bce63e79dfc1cfd54e170cb03fdd356 --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/KernelCompletionUnipotentLift.lean @@ -0,0 +1,39 @@ +import OAI.GroupTheory.PolycyclicRecognition.Lattices.NilpotentKernelCompletion +import OAI.GroupTheory.PolycyclicRecognition.Lattices.LatticeAutomorphismUnipotent + +namespace OAI + +/-! # Nilpotent ambient conjugations extend as unipotent Lie automorphisms -/ + +noncomputable section +namespace PolycyclicRecognition +open scoped Manifold ContDiff +variable {K H G : Type} [RealNormedLieAlgebra K] [FiniteDimensional ℝ K] + [PK : PolynomialExponentialCoordinates K] [Group H] [Group G] [Group.IsNilpotent G] + {i : K →* H} (C : NilpotentKernelCompletion i) + +namespace NilpotentKernelCompletion + +theorem unipotent_conjugation_extension (j : H →* G) (hj : Function.Injective j) + (a : MulAut H) (t : G) (hconj : ∀ h, j (a h) = t * j h * t⁻¹) + (ha : ContMDiff (𝓘(ℝ, K)) (𝓘(ℝ, C.carrier)) ∞ + ((C.embed.comp a.toMonoidHom).comp i)) + (hai : ContMDiff (𝓘(ℝ, K)) (𝓘(ℝ, C.carrier)) ∞ + ((C.embed.comp a.symm.toMonoidHom).comp i)) : + ∃ A : C.carrier ≃ₗ⁅ℝ⁆ C.carrier, + IsNilpotent (A.toLinearMap - 1) ∧ ∀ h, A (C.embed h) = C.embed (a h) := by + obtain ⟨B, hB, _, hBe⟩ := C.automorphism_extension a ha hai + let A := polynomialModelLieEquiv B hB + have hAe (h : H) : A (C.embed h) = C.embed (a h) := by + rw [polynomialModelLieEquiv_apply] + exact hBe h + refine ⟨A, ?_, hAe⟩ + exact lattice_automorphism_unipotent C.basis C.parameter C.polynomial + C.parameter.surjective C.embed C.integer_grid j hj a t hconj A.toLinearMap hAe + +end NilpotentKernelCompletion +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/LatticeAutomorphismFlow.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/LatticeAutomorphismFlow.lean new file mode 100644 index 0000000000000000000000000000000000000000..f9ea9cf0b09becc20e31fca88e6725983d69c880 --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/LatticeAutomorphismFlow.lean @@ -0,0 +1,40 @@ +import OAI.GroupTheory.PolycyclicRecognition.Lattices.LatticeAutomorphismUnipotent +import OAI.GroupTheory.PolycyclicRecognition.Algebra.PolynomialModelHom +import OAI.GroupTheory.PolycyclicRecognition.Geometry.UnipotentLieFlow + +namespace OAI + +/-! # Extending nilpotent lattice conjugation to a real automorphism flow -/ + +noncomputable section +namespace PolycyclicRecognition +open Module +open scoped Manifold ContDiff +variable {L G H : Type*} [RealNormedLieAlgebra L] [FiniteDimensional ℝ L] + [P : PolynomialExponentialCoordinates L] [Group G] [Group H] [Group.IsNilpotent G] + +theorem exists_nilpotent_lattice_automorphism_log {d : ℕ} (b : Basis (Fin d) ℝ L) + (p : L → L) (hp : IsPolynomialInBasis b b p) (hsurj : Function.Surjective p) + (e : H →* L) + (hgrid : ∀ z : Fin d → ℤ, ∃ x : H, + e x = p (b.equivFun.symm (fun i => (z i : ℝ)))) + (j : H →* G) (hj : Function.Injective j) + (a : H ≃* H) (t : G) (ha : ∀ x, j (a x) = t * j x * t⁻¹) + (F : L ≃* L) (hF : ContMDiff (𝓘(ℝ, L)) (𝓘(ℝ, L)) ∞ F) + (he : ∀ x, F (e x) = e (a x)) : + ∃ D : LieDerivation ℝ L L, ∃ hD : IsNilpotent D.toLinearMap, + ∀ x, nilpotentDerivationFlow D hD 1 x = F x := by + let A := polynomialModelLieEquiv F hF + have hA : IsNilpotent (A.toLinearMap - 1) := + lattice_automorphism_unipotent b p hp hsurj e hgrid j hj a t ha A.toLinearMap + (by intro x; change A (e x) = e (a x); rw [polynomialModelLieEquiv_apply]; exact he x) + refine ⟨unipotentLieLogarithm A hA, unipotentLieLogarithm_nilpotent A hA, ?_⟩ + intro x + change unipotentLieFlow A hA 1 x = F x + rw [unipotentLieFlow_one, polynomialModelLieEquiv_apply] + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/LatticeAutomorphismUnipotent.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/LatticeAutomorphismUnipotent.lean new file mode 100644 index 0000000000000000000000000000000000000000..04b87dcdac11d37564828fa76b3ed1beba3dd1a8 --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/LatticeAutomorphismUnipotent.lean @@ -0,0 +1,57 @@ +import OAI.GroupTheory.PolycyclicRecognition.Algebra.PolynomialModelDifference +import OAI.GroupTheory.PolycyclicRecognition.Algebra.NilpotentAutomorphismDifference + +namespace OAI + +/-! # Unipotence of a lattice automorphism induced by nilpotent conjugation + +A polynomial surjective coordinate parameter suffices. Its integral grid +only has to land in the lattice; no additive description of that lattice is +assumed. +-/ + +noncomputable section +namespace PolycyclicRecognition +open Module +variable {L G H : Type*} [RealNormedLieAlgebra L] [FiniteDimensional ℝ L] + [P : PolynomialExponentialCoordinates L] [Group G] [Group H] [Group.IsNilpotent G] + +theorem lattice_automorphism_unipotent {d : ℕ} (b : Basis (Fin d) ℝ L) + (p : L → L) (hp : IsPolynomialInBasis b b p) (hsurj : Function.Surjective p) + (e : H →* L) + (hgrid : ∀ z : Fin d → ℤ, ∃ x : H, + e x = p (b.equivFun.symm (fun i => (z i : ℝ)))) + (j : H →* G) (hj : Function.Injective j) + (a : H ≃* H) (t : G) (ha : ∀ x, j (a x) = t * j x * t⁻¹) + (A : L →ₗ[ℝ] L) (hA : ∀ x, A (e x) = e (a x)) : + IsNilpotent (A - 1) := by + let f : L → L := fun x => A x * (-x) + let n := Group.nilpotencyClass G + have hf : IsPolynomialInBasis b b f := polynomial_model_difference A b + have hs : Function.Semiconj e (fun y => a y * y⁻¹) f := by + intro x + change e (a x * x⁻¹) = A (e x) * (-e x) + rw [map_mul, map_inv, hA, P.inv_eq_neg] + have hezero (x : H) : f^[n] (e x) = 0 := by + rw [← hs.iterate_right n x, automorphism_difference_iterate_one j hj a t ha, + map_one, P.one_eq_zero] + have hz : IsPolynomialInBasis b b (fun _ : L => (0 : L)) := by + simpa only [IsPolynomialInBasis, map_zero] using + (IsCoordinatePolynomial.const (I := Fin d) (0 : Fin d → ℝ)) + have heq : f^[n] ∘ p = fun _ => (0 : L) := + ((hf.iterate n).comp hp).ext_integer_grid hz (by + intro z + obtain ⟨x, hx⟩ := hgrid z + change f^[n] (p (b.equivFun.symm (fun i => (z i : ℝ)))) = 0 + rw [← hx] + exact hezero x) + apply nilpotent_linear_of_group_difference A n + intro y + obtain ⟨x, rfl⟩ := hsurj y + exact congrFun heq x + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/LatticeCharacterGeometry.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/LatticeCharacterGeometry.lean new file mode 100644 index 0000000000000000000000000000000000000000..046fd126aae4afc4c056b7732e4f7a1ae4891bb3 --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/LatticeCharacterGeometry.lean @@ -0,0 +1,62 @@ +import OAI.GroupTheory.PolycyclicRecognition.Geometry.CharacterHemisphereContraction +import Mathlib.Algebra.Module.ZLattice.Basic + +namespace OAI + +/-! # The actual vector lattice for the character criterion -/ + +noncomputable section +namespace PolycyclicRecognition +open Module +variable {E ι : Type} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [ProperSpace E] [Finite ι] (b : Basis ι ℝ E) + +def basisLatticeEmbedding : + Multiplicative (Submodule.span ℤ (Set.range b)) →* Multiplicative E := + (Submodule.span ℤ (Set.range b)).subtype.toAddMonoidHom.toMultiplicative + +omit [ProperSpace E] [Finite ι] in +theorem basisLatticeEmbedding_span : + Submodule.span ℝ (Set.range (fun q => (basisLatticeEmbedding b q).toAdd)) = ⊤ := by + have he : Set.range (fun q => (basisLatticeEmbedding b q).toAdd) = + (Submodule.span ℤ (Set.range b) : Set E) := by + ext x + constructor + · rintro ⟨q, rfl⟩ + exact q.toAdd.property + · intro hx + exact ⟨Multiplicative.ofAdd ⟨x, hx⟩, rfl⟩ + rw [he] + exact ZSpan.span_top b + +theorem basisLatticeEmbedding_bounded (R : ℝ) : + Set.Finite {q | ‖(basisLatticeEmbedding b q).toAdd‖ ≤ R} := by + let L := Submodule.span ℤ (Set.range b) + have h := ZSpan.setFinite_inter b (Metric.isBounded_closedBall (x := (0 : E)) (r := R)) + have hi : Function.Injective (fun q : Multiplicative L => ((q.toAdd : L) : E)) := by + intro q r hqr + apply Multiplicative.toAdd.injective + exact Subtype.ext hqr + have hp := Set.Finite.preimage hi.injOn h + apply hp.subset + intro q hq + change ‖((q.toAdd : L) : E)‖ ≤ R at hq + exact ⟨by simpa only [Metric.mem_closedBall, dist_zero_right] using hq, q.toAdd.property⟩ + +omit [ProperSpace E] in +theorem basisLatticeEmbedding_coarseCover : + ∃ R : ℝ, ∀ x : E, ∃ q, ‖(basisLatticeEmbedding b q).toAdd - x‖ ≤ R := by + let := Fintype.ofFinite ι + obtain ⟨R, hR⟩ := b.parallelepiped.isCompact.isBounded.subset_closedBall (0 : E) + refine ⟨R, fun x => ⟨Multiplicative.ofAdd (ZSpan.floor b x), ?_⟩⟩ + have hf := hR (ZSpan.fundamentalDomain_subset_parallelepiped b + (ZSpan.fract_mem_fundamentalDomain b x)) + change ‖(ZSpan.floor b x : E) - x‖ ≤ R + rw [norm_sub_rev] + simpa only [dist_zero_right, ZSpan.fract_apply] using (Metric.mem_closedBall.mp hf) + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/LatticeCharacterSeparation.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/LatticeCharacterSeparation.lean new file mode 100644 index 0000000000000000000000000000000000000000..8037d7995903b6f4098de202206a29a68332eb82 --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/LatticeCharacterSeparation.lean @@ -0,0 +1,40 @@ +import OAI.GroupTheory.PolycyclicRecognition.Analysis.CompactCharacterSeparation +import OAI.GroupTheory.PolycyclicRecognition.Algebra.InwardVectorCharacters + +namespace OAI + +/-! # An integral separating direction from a compact character set -/ + +noncomputable section +namespace PolycyclicRecognition +open scoped InnerProductSpace +variable {Q E : Type} [CommGroup Q] [NormedAddCommGroup E] + [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] + +theorem exists_lattice_character_separator (e : Q →* Multiplicative E) + (hcover : ∃ R : ℝ, ∀ x : E, ∃ q, ‖(e q).toAdd - x‖ ≤ R) + {C : Set E} (hC : IsCompact C) (hunit : ∀ v ∈ C, ‖v‖ = 1) + (hzero : (0 : E) ∉ convexHull ℝ C) : + ∃ t : Q, ∀ v ∈ C, 0 < (inwardVectorCharacter e v t).toAdd := by + obtain ⟨w, δ, hδ, hw⟩ := exists_inner_separator_of_compact_no_convex_zero hC hzero + obtain ⟨R, hR⟩ := hcover + obtain ⟨n, hn⟩ := exists_nat_gt (R / δ) + have hnR : R < (n : ℝ) * δ := (div_lt_iff₀ hδ).mp hn + obtain ⟨t, ht⟩ := hR (-((n : ℝ) • w)) + refine ⟨t, ?_⟩ + intro v hv + have herror : ⟪v, (e t).toAdd + (n : ℝ) • w⟫_ℝ ≤ R := by + have hb := real_inner_le_norm v ((e t).toAdd + (n : ℝ) • w) + rw [hunit v hv, one_mul] at hb + exact hb.trans (by simpa only [sub_neg_eq_add] using ht) + rw [inner_add_right, real_inner_smul_right, ← real_inner_comm v w] at herror + have hn0 : 0 ≤ (n : ℝ) := Nat.cast_nonneg n + have hmul := mul_le_mul_of_nonneg_left (hw v hv).le hn0 + change 0 < -⟪v, (e t).toAdd⟫_ℝ + linarith + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/LatticeCharacterization.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/LatticeCharacterization.lean new file mode 100644 index 0000000000000000000000000000000000000000..fe8f5014e1416d8f9919d5d48aca2d2e0794de69 --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/LatticeCharacterization.lean @@ -0,0 +1,40 @@ +import OAI.GroupTheory.PolycyclicRecognition.Lattices.SolvableLatticeRecognition + +namespace OAI + +/-! +# Virtual polycyclicity and finite-index solvable lattices + +Dekimpe's realization and polycyclicity of solvable Lie lattices identify +virtual polycyclicity with a finite-index solvable-lattice realization. +-/ + +namespace PolycyclicRecognition + +/-- A group with a finite-index subgroup isomorphic to a uniform solvable Lie +lattice is virtually polycyclic. -/ +theorem virtuallyPolycyclic_of_finiteIndex_solvableLattice + (fw : FarbWeinbergerLatticeInput) {H : Type} [Group H] + (Γ : Subgroup H) (hΓ : Γ.FiniteIndex) + (S : SimplyConnectedSolvableLieModel) (Λ : Subgroup S.carrier) + (hΛ : IsUniformLattice Λ) (e : Γ ≃* Λ) : + IsVirtuallyPolycyclic H := + ⟨Γ, hΓ, (fw S Λ hΛ).of_injective e.toMonoidHom e.injective⟩ + +/-- Virtual polycyclicity is equivalent to finite-index realization as a +discrete uniform lattice in a simply connected solvable Lie group. -/ +theorem virtuallyPolycyclic_iff_finiteIndex_solvableLattice + (dekimpe : DekimpeLatticeRealizationInput) (fw : FarbWeinbergerLatticeInput) + (H : Type) [Group H] : + IsVirtuallyPolycyclic H ↔ + ∃ Γ : Subgroup H, Γ.FiniteIndex ∧ + ∃ (S : SimplyConnectedSolvableLieModel) (Λ : Subgroup S.carrier), + IsUniformLattice Λ ∧ Nonempty (Γ ≃* Λ) := by + constructor + · exact exists_uniform_solvable_lattice_of_virtuallyPolycyclic dekimpe H + · rintro ⟨Γ, hΓ, S, Λ, hΛ, ⟨e⟩⟩ + exact virtuallyPolycyclic_of_finiteIndex_solvableLattice fw Γ hΓ S Λ hΛ e + +end PolycyclicRecognition + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/LatticeKernelTail.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/LatticeKernelTail.lean new file mode 100644 index 0000000000000000000000000000000000000000..381f22431fffe526e8a976a035e4a0b3fccd2220 --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/LatticeKernelTail.lean @@ -0,0 +1,53 @@ +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.FreeAbelianDuality + +namespace OAI + +/-! # Removing the first coordinate of a free abelian quotient -/ + +noncomputable section +namespace PolycyclicRecognition + +def latticeTail (n : ℕ) : IntegralLatticeGroup (n + 1) →* IntegralLatticeGroup n where + toFun a := Multiplicative.ofAdd (fun i => a.toAdd i.succ) + map_one' := rfl + map_mul' _ _ := rfl + +variable {G : Type} [Group G] {n : ℕ} (q : G →* IntegralLatticeGroup (n + 1)) + +def latticeKernelTail : ( (latticeCoordinate n).comp q).ker →* IntegralLatticeGroup n := + (latticeTail n).comp (q.comp ((latticeCoordinate n).comp q).ker.subtype) + +theorem latticeKernelTail_surjective (hq : Function.Surjective q) : + Function.Surjective (latticeKernelTail q) := by + intro a + obtain ⟨g, hg⟩ := hq (Multiplicative.ofAdd (Fin.cases 0 a.toAdd)) + have hg0 : g ∈ ((latticeCoordinate n).comp q).ker := by + change latticeCoordinate n (q g) = 1 + rw [hg] + rfl + refine ⟨⟨g, hg0⟩, ?_⟩ + change latticeTail n (q g) = a + rw [hg] + rfl + +def latticeKernelTailEquiv : q.ker ≃* (latticeKernelTail q).ker where + toFun a := ⟨⟨a, by + change latticeCoordinate n (q a) = 1 + rw [a.property, map_one]⟩, by + change latticeTail n (q a) = 1 + rw [a.property, map_one]⟩ + invFun a := ⟨a.val.val, by + apply Multiplicative.toAdd.injective + funext i + refine Fin.cases ?_ (fun j => ?_) i + · exact congrArg Multiplicative.toAdd a.val.property + · exact congrFun (congrArg Multiplicative.toAdd a.property) j⟩ + left_inv _ := rfl + right_inv _ := rfl + map_mul' _ _ := rfl + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/LatticeMetricChains.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/LatticeMetricChains.lean new file mode 100644 index 0000000000000000000000000000000000000000..1ce965c9737dc10ac38b27fff8e7e926db859f25 --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/LatticeMetricChains.lean @@ -0,0 +1,71 @@ +import OAI.GroupTheory.PolycyclicRecognition.Lattices.UniformLatticeMetric +import OAI.GroupTheory.PolycyclicRecognition.Analysis.LinearMetricChains +import OAI.GroupTheory.PolycyclicRecognition.Analysis.MetricQuasiEquivalence + +namespace OAI + +/-! # Linear metric chains on a uniform lattice -/ + +noncomputable section +namespace PolycyclicRecognition + +variable {G : Type*} [Group G] [MetricSpace G] [IsTopologicalGroup G] + [IsIsometricSMul G G] {Λ : Subgroup G} + +omit [IsTopologicalGroup G] in +/-- Rounding an ambient chain to a uniformly close lattice section keeps +the linear length bound and enlarges only the step size. -/ +theorem IsUniformLattice.nonempty_linearMetricChains + (hΛ : IsUniformLattice Λ) (C : LinearMetricChains G) : + Nonempty (LinearMetricChains Λ) := by + classical + obtain ⟨r, R, hR, hr, _⟩ := hΛ.exists_metric_section + let s : G → Λ := fun x => if h : x ∈ Λ then ⟨x, h⟩ else r x + have hs (x : G) : dist x (s x : G) ≤ R := by + dsimp [s] + split + · simpa using hR + · exact hr x + have hfix (x : Λ) : s x = x := by simp [s] + refine ⟨{ + step := C.step + (R + R) + step_pos := by linarith [C.step_pos] + slope := C.slope + slope_nonneg := C.slope_nonneg + error := C.error + error_nonneg := C.error_nonneg + chain := ?_ }⟩ + intro x y + obtain ⟨n, p, h0, hn, hlen, hstep⟩ := C.chain (x : G) (y : G) + refine ⟨n, s ∘ p, by simpa only [Function.comp_apply, h0] using hfix x, + by simpa only [Function.comp_apply, hn] using hfix y, hlen, ?_⟩ + intro i hi + change dist (s (p i) : G) (s (p (i + 1)) : G) ≤ _ + calc + _ ≤ dist (s (p i) : G) (p i) + dist (p i) (p (i + 1)) + + dist (p (i + 1)) (s (p (i + 1)) : G) := dist_triangle4 _ _ _ _ + _ ≤ R + C.step + R := add_le_add (add_le_add + ((dist_comm _ _).trans_le (hs _)) (hstep i hi)) (hs _) + _ = C.step + (R + R) := by ring + +omit [IsTopologicalGroup G] in +/-- Inclusion and a bounded section are metric quasi-inverses. -/ +theorem IsUniformLattice.nonempty_metricQuasiEquivalence + (hΛ : IsUniformLattice Λ) : Nonempty (MetricQuasiEquivalence Λ G) := by + obtain ⟨r, R, hR, hr, hrlip⟩ := hΛ.exists_metric_section + refine ⟨{ + toFun := Subtype.val + invFun := r + toFun_control := ⟨1, 0, by norm_num, by norm_num, fun x y => by + change dist (x : G) (y : G) ≤ 1 * dist (x : G) (y : G) + 0 + simp⟩ + invFun_control := ⟨1, R + R, by norm_num, add_nonneg hR hR, + fun x y => by simpa using hrlip x y⟩ + left_close := ⟨R, hR, fun x => hr x⟩ + right_close := ⟨R, hR, hr⟩ }⟩ + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/LatticeNormalFlag.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/LatticeNormalFlag.lean new file mode 100644 index 0000000000000000000000000000000000000000..18490eb2319e93c67b5a39cb6ca78751edf8054e --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/LatticeNormalFlag.lean @@ -0,0 +1,98 @@ +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.FreeAbelianDuality + +namespace OAI + +/-! # The normal cyclic flag of a lattice quotient -/ + +noncomputable section +namespace PolycyclicRecognition +variable {G : Type} [Group G] {r : ℕ} (q : G →* IntegralLatticeGroup r) + +def latticeNormalFlag (i : ℕ) : Subgroup G where + carrier := {g | ∀ j : Fin r, i ≤ j.val → (q g).toAdd j = 0} + one_mem' := by intro j _; rw [q.map_one]; rfl + mul_mem' := by + intro a b ha hb j hj + rw [map_mul] + change (q a).toAdd j + (q b).toAdd j = 0 + rw [ha j hj, hb j hj, add_zero] + inv_mem' := by + intro a ha j hj + rw [map_inv] + change -(q a).toAdd j = 0 + rw [ha j hj, neg_zero] + +instance latticeNormalFlag_normal (i : ℕ) : (latticeNormalFlag q i).Normal where + conj_mem x hx g := by + intro j hj + rw [q.map_mul, q.map_mul, q.map_inv] + change (q g).toAdd j + (q x).toAdd j + -(q g).toAdd j = 0 + rw [hx j hj] + abel + +theorem latticeNormalFlag_mono {i j : ℕ} (hij : i ≤ j) : + latticeNormalFlag q i ≤ latticeNormalFlag q j := + fun _ hx k hk => hx k (hij.trans hk) + +theorem latticeNormalFlag_zero : latticeNormalFlag q 0 = q.ker := by + ext g + constructor + · intro hg + change q g = 1 + apply Multiplicative.toAdd.injective + funext j + exact hg j (Nat.zero_le _) + · intro hg j _ + change q g = 1 at hg + rw [hg] + rfl + +theorem latticeNormalFlag_top : latticeNormalFlag q r = ⊤ := by + apply top_unique + intro g _ j hj + exact False.elim (Nat.not_le_of_gt j.isLt hj) + +def latticeNormalFlagStep (i : Fin r) : + latticeNormalFlag q (i.val + 1) →* Multiplicative ℤ where + toFun g := Multiplicative.ofAdd ((q (g : G)).toAdd i) + map_one' := by change Multiplicative.ofAdd ((q 1).toAdd i) = 1; rw [q.map_one]; rfl + map_mul' a b := by + apply Multiplicative.toAdd.injective + change (q ((a : G) * (b : G))).toAdd i = (q (a : G)).toAdd i + (q (b : G)).toAdd i + rw [map_mul] + rfl + +theorem latticeNormalFlagStep_ker (i : Fin r) : + (latticeNormalFlagStep q i).ker = + (latticeNormalFlag q i.val).subgroupOf (latticeNormalFlag q (i.val + 1)) := by + ext g + constructor + · intro hg j hj + have hh := congrArg Multiplicative.toAdd hg + change (q (g : G)).toAdd i = 0 at hh + by_cases hji : j = i + · subst j; exact hh + · exact g.property j (by have hne : j.val ≠ i.val := fun h => hji (Fin.ext h); omega) + · intro hg + exact congrArg Multiplicative.ofAdd (hg i (le_refl _)) + +theorem latticeNormalFlagStep_generator (hq : Function.Surjective q) (i : Fin r) : + ∃ t : latticeNormalFlag q (i.val + 1), latticeNormalFlagStep q i t = Multiplicative.ofAdd 1 := by + classical + obtain ⟨g, hg⟩ := hq (Multiplicative.ofAdd (Pi.single i 1)) + have hmem : g ∈ latticeNormalFlag q (i.val + 1) := by + intro j hj + rw [hg] + change (Pi.single i 1 : Fin r → ℤ) j = 0 + have hji : j ≠ i := by intro h; subst j; omega + simp [hji] + refine ⟨⟨g, hmem⟩, ?_⟩ + change Multiplicative.ofAdd ((q g).toAdd i) = _ + rw [hg] + simp + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/LatticeQuotientDimension.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/LatticeQuotientDimension.lean new file mode 100644 index 0000000000000000000000000000000000000000..74114870f1f9da1b5f59fc0ef155311e5fe37b36 --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/LatticeQuotientDimension.lean @@ -0,0 +1,42 @@ +import OAI.GroupTheory.PolycyclicRecognition.Algebra.CyclicQuotientDimension +import OAI.GroupTheory.PolycyclicRecognition.Analysis.GroupDimensionTransport +import OAI.GroupTheory.PolycyclicRecognition.Lattices.LatticeKernelTail + +namespace OAI + +/-! # Integral dimension through a free abelian quotient -/ + +noncomputable section +namespace PolycyclicRecognition +open CategoryTheory + +theorem cohomologicalDimension_le_of_lattice_quotient (r : ℕ) + {G : Type} [Group G] (q : G →* IntegralLatticeGroup r) + (hq : Function.Surjective q) (d : ℕ) + [HasProjectiveDimensionLE (trivialIntegral q.ker) d] : + HasProjectiveDimensionLE (trivialIntegral G) (d + r) := by + induction r generalizing G with + | zero => + have hker : q.ker = ⊤ := by + ext g + exact iff_of_true (Subsingleton.elim (q g) 1) (Subgroup.mem_top g) + let e := (MulEquiv.subgroupCongr hker).trans Subgroup.topEquiv + simpa only [Nat.add_zero] using cohomologicalDimension_le_of_equiv e d + | succ r ih => + let p := (latticeCoordinate r).comp q + obtain ⟨t, ht⟩ := hq (latticeCoordinateSection r) + have hpt : p t = Multiplicative.ofAdd 1 := by + change latticeCoordinate r (q t) = _ + rw [ht, latticeCoordinate_section] + let := integerQuotient_isCyclic p t hpt + let := integerQuotient_infinite p t hpt + let := cohomologicalDimension_le_of_equiv (latticeKernelTailEquiv q) d + let := ih (latticeKernelTail q) (latticeKernelTail_surjective q hq) + simpa only [Nat.add_assoc] using + cohomologicalDimension_le_of_infiniteCyclicQuotient p.ker (d + r) + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/LatticeRealizationFiniteIndex.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/LatticeRealizationFiniteIndex.lean new file mode 100644 index 0000000000000000000000000000000000000000..2f30c17697acc856b96b9a97dbadab4f501bbd5c --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/LatticeRealizationFiniteIndex.lean @@ -0,0 +1,42 @@ +import OAI.GroupTheory.PolycyclicRecognition.Algebra.NilpotentExtensionRealization +import OAI.GroupTheory.PolycyclicRecognition.Lattices.NilpotentLatticeInduction + +namespace OAI + +/-! # Finite-index transport and integral-quotient realization -/ + +noncomputable section +namespace PolycyclicRecognition +variable {G : Type} [Group G] + +theorem uniform_lattice_realization_of_finiteIndex (H : Subgroup G) [H.FiniteIndex] + (hH : ∃ K : Subgroup H, K.FiniteIndex ∧ ∃ (S : SimplyConnectedSolvableLieModel) + (Λ : Subgroup S.carrier), IsUniformLattice Λ ∧ Nonempty (K ≃* Λ)) : + ∃ K : Subgroup G, K.FiniteIndex ∧ ∃ (S : SimplyConnectedSolvableLieModel) + (Λ : Subgroup S.carrier), IsUniformLattice Λ ∧ Nonempty (K ≃* Λ) := by + obtain ⟨K, hK, S, Λ, hΛ, ⟨e⟩⟩ := hH + have hi : (K.map H.subtype).FiniteIndex := ⟨by + rw [Subgroup.index_map_subtype] + exact mul_ne_zero hK.index_ne_zero (Subgroup.FiniteIndex.index_ne_zero (H := H))⟩ + let eK := K.equivMapOfInjective H.subtype H.subtype_injective + exact ⟨K.map H.subtype, hi, S, Λ, hΛ, ⟨eK.symm.trans e⟩⟩ + +theorem nilpotent_integer_extension_realization {n : ℕ} + (q : G →* IntegralLatticeGroup n) (hq : Function.Surjective q) + [Group.FG q.ker] [Group.IsNilpotent q.ker] (ht : HasNoNontrivialTorsion q.ker) : + ∃ K : Subgroup G, K.FiniteIndex ∧ ∃ (S : SimplyConnectedSolvableLieModel) + (Λ : Subgroup S.carrier), IsUniformLattice Λ ∧ Nonempty (K ≃* Λ) := by + let E : GroupExtension q.ker G (IntegralLatticeGroup n) := + { inl := q.ker.subtype + rightHom := q + inl_injective := Subtype.val_injective + range_inl_eq_ker_rightHom := Subgroup.range_subtype _ + rightHom_surjective := hq } + obtain ⟨C⟩ := nilpotent_lattice_coordinates ht + exact C.extension_realization E (normalizedExtensionSection E) (normalizedExtensionSection_one E) + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/LatticeTopLine.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/LatticeTopLine.lean new file mode 100644 index 0000000000000000000000000000000000000000..989a0ba23ccdde1f3b4184bc33a4447215e79c6d --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/LatticeTopLine.lean @@ -0,0 +1,93 @@ +import OAI.GroupTheory.PolycyclicRecognition.Lattices.LatticeNormalFlag +import OAI.GroupTheory.PolycyclicRecognition.Algebra.NormalCyclicTopStep +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.IntegerExtensionHomologyBound +import OAI.GroupTheory.PolycyclicRecognition.Algebra.RationalInvariantTopClass + +namespace OAI + +/-! # A nonzero top class above a free abelian quotient -/ + +noncomputable section +namespace PolycyclicRecognition +open CategoryTheory CategoryTheory.Limits +attribute [local instance 2000] Rep.hV2 Rep.instLinear ModuleCat.isModule +variable {G : Type} [Group G] {r : ℕ} + +theorem invariantTopLine_of_subgroup_eq (N M : Subgroup G) [N.Normal] [M.Normal] + (h : N = M) (d : ℕ) + (hN : ∃ A : Rep ℤ G, + Nonempty (groupHomology (Rep.res N.subtype A) d ≃ₗ[ℤ] ℚ) ∧ + ∀ g, normalHomologyMap ℤ N A d g = 𝟙 _) : + ∃ A : Rep ℤ G, + Nonempty (groupHomology (Rep.res M.subtype A) d ≃ₗ[ℤ] ℚ) ∧ + ∀ g, normalHomologyMap ℤ M A d g = 𝟙 _ := by + subst M + exact hN + +theorem exists_latticeTopLine_of_kernelLine + (q : G →* IntegralLatticeGroup r) (hq : Function.Surjective q) (d : ℕ) + (hbound : ∀ R : Rep ℤ q.ker, ∀ j, d < j → IsZero (groupHomology R j)) + (A : Rep ℤ G) (eA : groupHomology (Rep.res q.ker.subtype A) d ≃ₗ[ℤ] ℚ) + (hA : ∀ g, normalHomologyMap ℤ q.ker A d g = 𝟙 _) : + ∃ B : Rep ℤ G, Nonempty (groupHomology B (d + r) ≃ₗ[ℤ] ℚ) := by + have H : ∀ i, i ≤ r → + (∀ R : Rep ℤ (latticeNormalFlag q i), ∀ j, d + i < j → IsZero (groupHomology R j)) ∧ + ∃ B : Rep ℤ G, + Nonempty (groupHomology (Rep.res (latticeNormalFlag q i).subtype B) (d + i) ≃ₗ[ℤ] ℚ) ∧ + ∀ g, normalHomologyMap ℤ (latticeNormalFlag q i) B (d + i) g = 𝟙 _ := by + intro i + induction i with + | zero => + intro _ + let e := MulEquiv.subgroupCongr (latticeNormalFlag_zero q).symm + exact ⟨homology_bound_of_equiv e d hbound, + invariantTopLine_of_subgroup_eq q.ker (latticeNormalFlag q 0) + (latticeNormalFlag_zero q).symm d ⟨A, ⟨eA⟩, hA⟩⟩ + + | succ i ih => + intro hi + obtain ⟨hb, B, ⟨eB⟩, hB⟩ := ih (by omega) + let j : Fin r := ⟨i, by omega⟩ + let p := latticeNormalFlagStep q j + obtain ⟨t, ht⟩ := latticeNormalFlagStep_generator q hq j + have hker : p.ker = (latticeNormalFlag q i).subgroupOf (latticeNormalFlag q (i + 1)) := + latticeNormalFlagStep_ker q j + have hle : latticeNormalFlag q i ≤ latticeNormalFlag q (i + 1) := + latticeNormalFlag_mono q (Nat.le_succ i) + let e : p.ker ≃* latticeNormalFlag q i := + (MulEquiv.subgroupCongr hker).trans (Subgroup.subgroupOfEquivOfLe hle) + have hbker := homology_bound_of_equiv e.symm (d + i) hb + have hbnext := homology_bound_of_integer_quotient p t ht (d + i) hbker + have hnext := exists_normalCyclicTopStep (latticeNormalFlag q i) + (latticeNormalFlag q (i + 1)) hle p t ht hker (d + i) hb B eB hB + have hdim : d + i + 1 = d + (i + 1) := Nat.add_assoc d i 1 + rw [hdim] at hbnext hnext + exact ⟨hbnext, hnext⟩ + obtain ⟨_, B, ⟨eB⟩, _⟩ := H r (le_refl r) + have eTop : groupHomology (Rep.res (⊤ : Subgroup G).subtype B) (d + r) ≃ₗ[ℤ] ℚ := by + rw [latticeNormalFlag_top] at eB + exact eB + let E := groupHomology.mapIso (A := Rep.res (⊤ : Subgroup G).subtype B) (B := B) + Subgroup.topEquiv (LinearEquiv.refl ℤ B.V) (by intro g; rfl) (d + r) + exact ⟨B, ⟨E.symm.toLinearEquiv.trans eTop⟩⟩ + +theorem exists_latticeTopLine + (q : G →* IntegralLatticeGroup r) (hq : Function.Surjective q) (d : ℕ) + (hbound : ∀ A : Rep ℤ q.ker, ∀ j, d < j → IsZero (groupHomology A j)) + (R : Rep ℤ q.ker) (eR : R.V ≃ₗ[ℤ] ℤ) + (x : groupHomology R d) (hx : x ≠ 0) + (htor : ∀ (a : ℤ) (y : groupHomology R d), a • y = 0 → a = 0 ∨ y = 0) + (hcomm : ∀ y z : groupHomology R d, y ≠ 0 → z ≠ 0 → + ∃ a b : ℤ, a ≠ 0 ∧ b ≠ 0 ∧ a • y = b • z) + (hdetect : ∀ A : Rep ℤ q.ker, Nonempty (A.V ≃ₗ[ℤ] ℤ) → + (∃ y : groupHomology A d, y ≠ 0) → Nonempty (R ≅ A)) : + ∃ B : Rep ℤ G, Nonempty (groupHomology B (d + r) ≃ₗ[ℤ] ℚ) := by + obtain ⟨χ, _, hχ, _, hact⟩ := exists_rationalInvariantTopClass q.ker R eR d x hx htor hcomm hdetect + obtain ⟨eA⟩ := rationalOrientation_topLine q.ker R eR d χ hχ x hx htor hcomm + exact exists_latticeTopLine_of_kernelLine q hq d hbound (rationalCharacterRep χ) eA hact + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/LatticeWordExtension.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/LatticeWordExtension.lean new file mode 100644 index 0000000000000000000000000000000000000000..98ff78716b11ead815acb6947fbbbe120f1d084a --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/LatticeWordExtension.lean @@ -0,0 +1,91 @@ +import OAI.GroupTheory.PolycyclicRecognition.Algebra.PolynomialModelWords +import OAI.GroupTheory.PolycyclicRecognition.Algebra.PolynomialParameterExtension + +namespace OAI + +/-! # Extending lattice automorphisms through ordered polynomial coordinates + +The extension is constructed by replacing each integral generator power by +the corresponding real one-parameter subgroup. Polynomial identities prove +both multiplicativity and the inverse identities. +-/ + +noncomputable section +namespace PolycyclicRecognition +open Module +open scoped Manifold ContDiff +variable {L H : Type*} [RealNormedLieAlgebra L] [FiniteDimensional ℝ L] + [P : PolynomialExponentialCoordinates L] [Group H] {d : ℕ} + (b : Basis (Fin d) ℝ L) (p : L ≃ L) (e : H →* L) (X : Fin d → H) + +def latticeWordMap (a : H →* H) : L → L := + fun x => orderedRealWord b (fun i => e (a (X i))) (p.symm x) + +theorem latticeWordMap_polynomial (hq : IsPolynomialInBasis b b p.symm) (a : H →* H) : + IsPolynomialInBasis b b (latticeWordMap b p e X a) := + (orderedRealWord_polynomial b _).comp hq + +theorem latticeWordMap_on_lattice + (hparam : ∀ z : Fin d → ℤ, + p (b.equivFun.symm (fun i => (z i : ℝ))) = e (orderedWord X z)) + (hX : Function.Surjective (orderedWord X)) (a : H →* H) (x : H) : + latticeWordMap b p e X a (e x) = e (a x) := by + obtain ⟨z, rfl⟩ := hX x + rw [← hparam z] + change orderedRealWord b (fun i => e (a (X i))) + (p.symm (p (b.equivFun.symm (fun i => (z i : ℝ))))) = _ + rw [p.symm_apply_apply, orderedRealWord_integer] + exact orderedWord_map (e.comp a) X z + +def latticeWordAut (hp : IsPolynomialInBasis b b p) (hq : IsPolynomialInBasis b b p.symm) + (hparam : ∀ z : Fin d → ℤ, + p (b.equivFun.symm (fun i => (z i : ℝ))) = e (orderedWord X z)) + (hX : Function.Surjective (orderedWord X)) (a : MulAut H) : MulAut L := by + let f := latticeWordMap b p e X a.toMonoidHom + let g := latticeWordMap b p e X a.symm.toMonoidHom + have hf := latticeWordMap_polynomial b p e X hq a.toMonoidHom + have hg := latticeWordMap_polynomial b p e X hq a.symm.toMonoidHom + have hF (x : H) : f (e x) = e (a x) := + latticeWordMap_on_lattice b p e X hparam hX a.toMonoidHom x + have hG (x : H) : g (e x) = e (a.symm x) := + latticeWordMap_on_lattice b p e X hparam hX a.symm.toMonoidHom x + refine polynomialGroupEquivFromParameter b hf hg hp p.surjective ?_ ?_ ?_ + · intro z w + rw [hparam z, hparam w] + calc + f (e (orderedWord X z) * e (orderedWord X w)) = + e (a (orderedWord X z * orderedWord X w)) := by rw [← map_mul, hF] + _ = e (a (orderedWord X z)) * e (a (orderedWord X w)) := by rw [map_mul, map_mul] + _ = f (e (orderedWord X z)) * f (e (orderedWord X w)) := by rw [hF, hF] + · intro z + change g (f (p (b.equivFun.symm (fun i => (z i : ℝ))))) = + p (b.equivFun.symm (fun i => (z i : ℝ))) + rw [hparam z, hF, hG, a.symm_apply_apply] + · intro z + change f (g (p (b.equivFun.symm (fun i => (z i : ℝ))))) = + p (b.equivFun.symm (fun i => (z i : ℝ))) + rw [hparam z, hG, hF, a.apply_symm_apply] + +theorem latticeWordAut_on_lattice (hp : IsPolynomialInBasis b b p) + (hq : IsPolynomialInBasis b b p.symm) + (hparam : ∀ z : Fin d → ℤ, + p (b.equivFun.symm (fun i => (z i : ℝ))) = e (orderedWord X z)) + (hX : Function.Surjective (orderedWord X)) (a : MulAut H) (x : H) : + latticeWordAut b p e X hp hq hparam hX a (e x) = e (a x) := + latticeWordMap_on_lattice b p e X hparam hX a.toMonoidHom x + +theorem contMDiff_latticeWordAut (hp : IsPolynomialInBasis b b p) + (hq : IsPolynomialInBasis b b p.symm) + (hparam : ∀ z : Fin d → ℤ, + p (b.equivFun.symm (fun i => (z i : ℝ))) = e (orderedWord X z)) + (hX : Function.Surjective (orderedWord X)) (a : MulAut H) : + ContMDiff (𝓘(ℝ, L)) (𝓘(ℝ, L)) ∞ (latticeWordAut b p e X hp hq hparam hX a) := by + have h : ContDiff ℝ ∞ (latticeWordMap b p e X a.toMonoidHom) := + (latticeWordMap_polynomial b p e X hq a.toMonoidHom).contDiff.of_le le_top + exact h.contMDiff + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilpotentCyclicFiniteIndexLattice.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilpotentCyclicFiniteIndexLattice.lean new file mode 100644 index 0000000000000000000000000000000000000000..3a60ffbe58dc587e8a0529f72cef8f802c08aabc --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilpotentCyclicFiniteIndexLattice.lean @@ -0,0 +1,30 @@ +import OAI.GroupTheory.PolycyclicRecognition.Lattices.NilpotentLatticeDerivationLog +import OAI.GroupTheory.PolycyclicRecognition.Geometry.RealLieAutomorphismPowerLog + +namespace OAI + +/-! # Cyclic extensions of the constructed nilpotent lattice model -/ + +noncomputable section +namespace PolycyclicRecognition.NilpotentLatticeCoordinates +variable {H : Type} [Group H] (C : NilpotentLatticeCoordinates H) +include C + +theorem cyclic_finiteIndex_lattice (a : MulAut H) : + ∃ Γ : Subgroup (H ⋊[integerPowerAction a] Multiplicative ℤ), Γ.FiniteIndex ∧ + ∃ (S : SimplyConnectedSolvableLieModel) (Λ : Subgroup S.carrier), + IsUniformLattice Λ ∧ Nonempty (Γ ≃* Λ) := by + obtain ⟨m, hm, D, hD⟩ := real_lie_automorphism_has_power_log (C.automorphismLieEquiv a) + apply C.cyclic_finiteIndex_lattice_of_derivation_log a hm D + apply ContinuousLinearMap.ext + intro x + have h := congrArg (fun T : Module.End ℝ C.carrier => T x) hD + change _ = (C.automorphismLinear (a ^ m)) x + rw [map_pow] + exact h + +end PolycyclicRecognition.NilpotentLatticeCoordinates + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilpotentCyclicHomExtension.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilpotentCyclicHomExtension.lean new file mode 100644 index 0000000000000000000000000000000000000000..0e077ec44152e56bcc3c903383d59a10a9053c10 --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilpotentCyclicHomExtension.lean @@ -0,0 +1,62 @@ +import OAI.GroupTheory.PolycyclicRecognition.Geometry.UnipotentConjugationFlow +import OAI.GroupTheory.PolycyclicRecognition.Geometry.SemidirectIntegration + +namespace OAI + +/-! # Extending a nilpotent cyclic homomorphism to real time + +The time-one conjugation relation supplies the full real action relation by +finite logarithms. No continuous extension is assumed. +-/ + +noncomputable section +namespace PolycyclicRecognition +open scoped Manifold ContDiff +variable {L M : Type} [RealNormedLieAlgebra L] [FiniteDimensional ℝ L] + [RealNormedLieAlgebra M] [FiniteDimensional ℝ M] + [P : PolynomialExponentialCoordinates L] [Q : PolynomialExponentialCoordinates M] + [LieRing.IsNilpotent L] [LieRing.IsNilpotent M] + +theorem nilpotent_cyclic_hom_extension (A : L ≃ₗ⁅ℝ⁆ L) + (hA : IsNilpotent (A.toLinearMap - 1)) (f : L →ₗ⁅ℝ⁆ M) (u : M) + (h : ∀ x, f (A x) = u * f x * u⁻¹) : + let D := unipotentLieLogarithm A hA + let hD := unipotentLieLogarithm_nilpotent A hA + letI := derivationSemidirectGroup D hD + letI : MulOneClass (L × ℝ) := (derivationSemidirectGroup D hD).toMulOneClass + ∃ φ : (L × ℝ) →* M, ContMDiff (𝓘(ℝ, L × ℝ)) (𝓘(ℝ, M)) ∞ φ ∧ + ∀ p, φ p = f p.1 * (p.2 • u) := by + let D := unipotentLieLogarithm A hA + let hD := unipotentLieLogarithm_nilpotent A hA + let := derivationSemidirectGroup D hD + let : MulOneClass (L × ℝ) := (derivationSemidirectGroup D hD).toMulOneClass + obtain ⟨k, hk, hkexp⟩ := integrate_polynomial_nilpotent + (fun v : GroupLieAlgebra (𝓘(ℝ, M)) M => (v : M)) + PolynomialExponentialCoordinates.isGroupExponential_identity L + (inferInstance : LieRing.IsNilpotent L) (Q.tangentEquiv.toLieHom.comp f) + have hkf (x : L) : k x = f x := (hkexp x).trans (Q.tangentEquiv_apply (f x)) + have hact (t : ℝ) (x : L) : + k (nilpotentDerivationFlow D hD t x) = + (t • u) * k x * (t • u)⁻¹ := by + rw [hkf, hkf] + exact unipotent_conjugation_flow A hA f u h t x + have hexp (t : ℝ) : (show M from t • Q.tangentEquiv u) = t • u := + (Q.tangentEquiv.map_smul t u).symm.trans (Q.tangentEquiv_apply (t • u)) + let φ := derivationSemidirectHom D hD + (fun v : GroupLieAlgebra (𝓘(ℝ, M)) M => (v : M)) + PolynomialExponentialCoordinates.isGroupExponential_identity k (Q.tangentEquiv u) + (by + intro t x + exact (hact t x).trans + (congrArg (fun v : M => v * k x * v⁻¹) (hexp t).symm)) + refine ⟨φ, ?_, ?_⟩ + · exact contMDiff_derivationSemidirectHom D hD _ _ k _ _ hk + · intro p + change k p.1 * (show M from p.2 • Q.tangentEquiv u) = _ + rw [hkf, hexp] + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilpotentCyclicKernelCompletion.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilpotentCyclicKernelCompletion.lean new file mode 100644 index 0000000000000000000000000000000000000000..b1822161549a3ac60d37e9101979185db543334c --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilpotentCyclicKernelCompletion.lean @@ -0,0 +1,53 @@ +import OAI.GroupTheory.PolycyclicRecognition.Lattices.KernelCompletionCyclicStep +import OAI.GroupTheory.PolycyclicRecognition.Lattices.KernelCompletionUnipotentLift +import OAI.GroupTheory.PolycyclicRecognition.Lattices.KernelCompletionTransport +import OAI.GroupTheory.PolycyclicRecognition.Algebra.CyclicKernelSplitting + +namespace OAI + +/-! # Completing a nilpotent group across an actual cyclic quotient -/ + +noncomputable section +namespace PolycyclicRecognition +open scoped Manifold ContDiff +variable {K G : Type} [RealNormedLieAlgebra K] [FiniteDimensional ℝ K] + [PK : PolynomialExponentialCoordinates K] [Group G] [Group.IsNilpotent G] + +theorem nilpotent_cyclic_kernel_completion_with_dimension (q : G →* Multiplicative ℤ) + (t : G) (ht : q t = Multiplicative.ofAdd 1) + (i : K →* q.ker) (C : NilpotentKernelCompletion i) + (ha : ContMDiff (𝓘(ℝ, K)) (𝓘(ℝ, C.carrier)) ∞ + ((C.embed.comp (MulAut.conjNormal (H := q.ker) t).toMonoidHom).comp i)) + (hai : ContMDiff (𝓘(ℝ, K)) (𝓘(ℝ, C.carrier)) ∞ + ((C.embed.comp (MulAut.conjNormal (H := q.ker) t).symm.toMonoidHom).comp i)) : + ∃ D : NilpotentKernelCompletion (q.ker.subtype.comp i), + D.dimension = C.dimension + 1 := by + let a := MulAut.conjNormal (H := q.ker) t + obtain ⟨A, hA, hAe⟩ := C.unipotent_conjugation_extension q.ker.subtype + Subtype.val_injective a t (fun _ => rfl) ha hai + obtain ⟨D, hD⟩ := C.cyclic_step_with_dimension a A hA hAe + let e := cyclicKernelEquiv q t ht + have he : e.toMonoidHom.comp ((SemidirectProduct.inl : q.ker →* + q.ker ⋊[integerPowerAction a] Multiplicative ℤ).comp i) = q.ker.subtype.comp i := by + ext x + change (i x : G) * t ^ (1 : Multiplicative ℤ).toAdd = (i x : G) + simp + rw [← he] + exact ⟨D.of_equiv e, hD⟩ + +theorem nilpotent_cyclic_kernel_completion (q : G →* Multiplicative ℤ) + (t : G) (ht : q t = Multiplicative.ofAdd 1) + (i : K →* q.ker) (C : NilpotentKernelCompletion i) + (ha : ContMDiff (𝓘(ℝ, K)) (𝓘(ℝ, C.carrier)) ∞ + ((C.embed.comp (MulAut.conjNormal (H := q.ker) t).toMonoidHom).comp i)) + (hai : ContMDiff (𝓘(ℝ, K)) (𝓘(ℝ, C.carrier)) ∞ + ((C.embed.comp (MulAut.conjNormal (H := q.ker) t).symm.toMonoidHom).comp i)) : + Nonempty (NilpotentKernelCompletion (q.ker.subtype.comp i)) := by + obtain ⟨D, _⟩ := nilpotent_cyclic_kernel_completion_with_dimension q t ht i C ha hai + exact ⟨D⟩ + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilpotentCyclicLatticeExtension.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilpotentCyclicLatticeExtension.lean new file mode 100644 index 0000000000000000000000000000000000000000..3c036373543036c46a2ba6b7f2e61f9b50dcdbab --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilpotentCyclicLatticeExtension.lean @@ -0,0 +1,62 @@ +import OAI.GroupTheory.PolycyclicRecognition.Lattices.LatticeAutomorphismFlow +import OAI.GroupTheory.PolycyclicRecognition.Lattices.IntegerSemidirectLattice +import OAI.GroupTheory.PolycyclicRecognition.Lattices.DerivationSolvableModel + +namespace OAI + +/-! # The cyclic step in nilpotent lattice realization + +Given a polynomial lattice model for the kernel and the smooth extension of +its conjugation automorphism, nilpotence supplies the real flow and the +resulting cyclic extension is a uniform lattice in a constructed solvable +Lie group. +-/ + +noncomputable section +namespace PolycyclicRecognition +open Module +open scoped Manifold ContDiff +attribute [local instance] semidirectProductTopology +variable {H L : Type} [Group H] [RealNormedLieAlgebra L] [FiniteDimensional ℝ L] + [P : PolynomialExponentialCoordinates L] [Group.IsSolvable L] + +theorem nilpotent_cyclic_lattice_extension (a : MulAut H) + [Group.IsNilpotent (H ⋊[integerPowerAction a] Multiplicative ℤ)] + {d : ℕ} (b : Basis (Fin d) ℝ L) (p : L → L) + (hp : IsPolynomialInBasis b b p) (hsurj : Function.Surjective p) + (Λ : Subgroup L) (hΛ : IsUniformLattice Λ) (e : H ≃* Λ) + (hgrid : ∀ z : Fin d → ℤ, ∃ x : H, + (e x : L) = p (b.equivFun.symm (fun i => (z i : ℝ)))) + (F : L ≃* L) (hF : ContMDiff (𝓘(ℝ, L)) (𝓘(ℝ, L)) ∞ F) + (he : ∀ x, F (e x) = (e (a x) : L)) : + ∃ (S : SimplyConnectedSolvableLieModel) (Γ : Subgroup S.carrier), + IsUniformLattice Γ ∧ + Nonempty ((H ⋊[integerPowerAction a] Multiplicative ℤ) ≃* Γ) := by + let G := H ⋊[integerPowerAction a] Multiplicative ℤ + let j : H →* G := SemidirectProduct.inl + let t : G := SemidirectProduct.inr (Multiplicative.ofAdd (1 : ℤ)) + have ha (x : H) : j (a x) = t * j x * t⁻¹ := by + have h := SemidirectProduct.inl_aut (φ := integerPowerAction a) + (Multiplicative.ofAdd (1 : ℤ)) x + rw [map_inv] at h + change j ((a ^ (1 : ℤ)) x) = t * j x * t⁻¹ at h + simpa only [zpow_one] using h + let q : H →* L := Λ.subtype.comp e.toMonoidHom + obtain ⟨D, hD, htime⟩ := exists_nilpotent_lattice_automorphism_log b p hp hsurj + q hgrid j SemidirectProduct.inl_injective a t ha F hF he + let φ := P.derivationAction D hD + have hstep (x : H) : (e (a x) : L) = φ (Multiplicative.ofAdd 1) (e x) := by + change (e (a x) : L) = nilpotentDerivationFlow D hD 1 (e x) + rw [htime, he] + obtain ⟨Γ, hΓ, ⟨f⟩⟩ := integer_semidirect_lattice_realization φ a Λ hΛ e hstep + let S := derivationSolvableLieModel D hD + let E := derivationModelEquiv D hD + refine ⟨S, Γ.comap E.toMonoidHom, ?_, ⟨f.trans (comapSubgroupEquiv E Γ).symm⟩⟩ + exact hΓ.comap_mulEquiv E (continuous_derivationModelEquiv D hD) + (continuous_derivationModelEquiv_symm D hD) + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilpotentExtensionFixedFreeRealization.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilpotentExtensionFixedFreeRealization.lean new file mode 100644 index 0000000000000000000000000000000000000000..5ac6dfe341f1049297d8fd5ad955a69a36418e1d --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilpotentExtensionFixedFreeRealization.lean @@ -0,0 +1,54 @@ +import OAI.GroupTheory.PolycyclicRecognition.Algebra.NilpotentExtensionLangSplitting +import OAI.GroupTheory.PolycyclicRecognition.Lattices.SmoothIntegralLatticeRealization +import OAI.GroupTheory.PolycyclicRecognition.Algebra.SplitFactorTopology + +namespace OAI + +/-! # Connected realization of nonsplit extensions with a fixed-point-free lift + +The quotient lift is allowed to have nontrivial commutators. The Lang inverse +constructs a splitting only after the nilpotent kernel has been completed. +-/ + +noncomputable section +namespace PolycyclicRecognition.NilpotentLatticeCoordinates +open scoped Manifold ContDiff +attribute [local instance] factorExtensionTopology semidirectProductTopology +variable {N G : Type} [Group N] [Group G] (C : NilpotentLatticeCoordinates N) + {n : ℕ} (S : GroupExtension N G (IntegralLatticeGroup n)) + (σ : S.Section) (hσ : σ 1 = 1) + +include hσ + +/-- A concrete sufficient condition for the general nonsplit realization: +one quotient lift acts without fixed vectors on the completed kernel. -/ +theorem extension_realization_of_fixedPointFree_lift (q : IntegralLatticeGroup n) + (hA : Function.Bijective + (fun x : C.carrier => C.automorphismLinear (S.conjAct (σ q)) x - x)) : + ∃ K : Subgroup G, K.FiniteIndex ∧ ∃ (R : SimplyConnectedSolvableLieModel) + (Λ : Subgroup R.carrier), IsUniformLattice Λ ∧ Nonempty (K ≃* Λ) := by + let T := C.extensionFactorSystem S σ hσ + let s := C.completedExtensionSplitting S σ hσ q hA + let ρ := s.conjAct + let e := splitFactorEquiv T s + let Γ := C.completedExtensionLattice S σ hσ + let Γs := Γ.comap e.toMonoidHom + let : IsTopologicalGroup C.carrier := topologicalGroup_of_lieGroup (𝓘(ℝ, C.carrier)) ⊤ + have hΓs : IsUniformLattice Γs := (C.completedExtensionLattice_uniform S σ hσ).comap_mulEquiv e + (splitFactorEquiv_continuous T s (fun z => (C.extensionFactorSystem_smooth S σ hσ z).continuous)) + (splitFactorEquiv_symm_continuous T s) + have hρ : ∀ z, ContMDiff (𝓘(ℝ, C.carrier)) (𝓘(ℝ, C.carrier)) ∞ (ρ z) := + C.completedExtensionSplitting_action_smooth S σ hσ s + obtain ⟨J, hJ, R, Λ, hΛ, ⟨f⟩⟩ := smooth_integral_uniform_lattice_realization ρ hρ Γs hΓs + let eG : G ≃* Γs := (C.completedExtensionLatticeEquiv S σ hσ).trans + (comapSubgroupEquiv e Γ).symm + let K := J.comap eG.toMonoidHom + let := hJ + have hK : K.FiniteIndex := inferInstance + exact ⟨K, hK, R, Λ, hΛ, ⟨(comapSubgroupEquiv eG J).trans f⟩⟩ + +end PolycyclicRecognition.NilpotentLatticeCoordinates + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilpotentExtensionLattice.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilpotentExtensionLattice.lean new file mode 100644 index 0000000000000000000000000000000000000000..1d662fa88fae1a388851352046caf393cfd9b753 --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilpotentExtensionLattice.lean @@ -0,0 +1,86 @@ +import OAI.GroupTheory.PolycyclicRecognition.Algebra.NilpotentExtensionEmbedding +import OAI.GroupTheory.PolycyclicRecognition.Algebra.FactorExtensionTopology + +namespace OAI + +/-! # A uniform lattice after completing only the nilpotent kernel + +The quotient is still discrete. This is an intermediate construction, not a +claim that the resulting group is connected. +-/ + +noncomputable section +namespace PolycyclicRecognition.NilpotentLatticeCoordinates +open Set +open scoped Manifold +variable {N G Q : Type} [Group N] [Group G] [Group Q] + [TopologicalSpace Q] [DiscreteTopology Q] + (C : NilpotentLatticeCoordinates N) (S : GroupExtension N G Q) + (σ : S.Section) (hσ : σ 1 = 1) +attribute [local instance] factorExtensionTopology + +def completedExtensionLattice : Subgroup (FactorExtension (C.extensionFactorSystem S σ hσ)) := + (C.extensionEmbedding S σ hσ).range + +theorem completedExtensionLattice_discrete : + DiscreteTopology (C.completedExtensionLattice S σ hσ) := by + let := C.uniform.1 + let f : C.completedExtensionLattice S σ hσ → C.lattice × Q := fun a => + (⟨a.val.left, (C.mem_extensionEmbedding_range S σ hσ a.val).mp a.property⟩, a.val.right) + have hl := (continuous_factor_left (C.extensionFactorSystem S σ hσ)).comp + (continuous_subtype_val : Continuous (Subtype.val : C.completedExtensionLattice S σ hσ → _)) + have hr := (continuous_factor_right (C.extensionFactorSystem S σ hσ)).comp + (continuous_subtype_val : Continuous (Subtype.val : C.completedExtensionLattice S σ hσ → _)) + have hf : Continuous f := (hl.subtype_mk _).prodMk hr + apply DiscreteTopology.of_continuous_injective hf + intro a b h + apply Subtype.ext + apply FactorExtension.ext + · exact congrArg (fun z : C.lattice × Q => (z.1 : C.carrier)) h + · exact congrArg (fun z : C.lattice × Q => z.2) h + +omit [TopologicalSpace Q] [DiscreteTopology Q] in +theorem extension_action_lattice (q : Q) (x : C.lattice) : + (C.extensionFactorSystem S σ hσ).action q x ∈ C.lattice := by + obtain ⟨n, hn⟩ := C.equiv.surjective x + rw [← hn] + change C.automorphism (S.conjAct (σ q)) (C.equiv n) ∈ C.lattice + rw [C.automorphism_on_lattice] + exact (C.equiv _).property + +/-- Compactness of the original kernel fundamental cover is retained by the +completed extension, even though its quotient may be infinite and nonsplit. -/ +theorem completedExtensionLattice_uniform : + IsUniformLattice (C.completedExtensionLattice S σ hσ) := by + let T := C.extensionFactorSystem S σ hσ + obtain ⟨K, hK, hcover⟩ := C.uniform.2 + refine ⟨C.completedExtensionLattice_discrete S σ hσ, + FactorExtension.inl T '' K, hK.image (continuous_factor_inl T), ?_⟩ + intro g + obtain ⟨μ, u, hu, heq⟩ := hcover ((T.action g.right).symm g.left) + let γ : C.completedExtensionLattice S σ hσ := + ⟨⟨T.action g.right μ, g.right⟩, + (C.mem_extensionEmbedding_range S σ hσ _).mpr + (C.extension_action_lattice S σ hσ g.right μ)⟩ + refine ⟨γ, FactorExtension.inl T u, ⟨u, hu, rfl⟩, ?_⟩ + apply FactorExtension.ext + · change T.action g.right μ * T.action g.right u * T.factor g.right 1 = g.left + rw [T.factor_one_right, mul_one, ← map_mul, heq] + exact (T.action g.right).apply_symm_apply g.left + · exact mul_one g.right + +/-- The lattice is isomorphic to the original group, not a quotient by its center. -/ +def completedExtensionLatticeEquiv : G ≃* C.completedExtensionLattice S σ hσ := + MonoidHom.ofInjective (C.extensionEmbedding_injective S σ hσ) + +theorem completedExtension_topologicalGroup : + IsTopologicalGroup (FactorExtension (C.extensionFactorSystem S σ hσ)) := by + let : IsTopologicalGroup C.carrier := topologicalGroup_of_lieGroup (𝓘(ℝ, C.carrier)) ⊤ + exact factorExtensionTopologicalGroup _ + (fun q => (C.extensionFactorSystem_smooth S σ hσ q).continuous) + +end PolycyclicRecognition.NilpotentLatticeCoordinates + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilpotentFiniteIndexLattice.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilpotentFiniteIndexLattice.lean new file mode 100644 index 0000000000000000000000000000000000000000..e59206e7c028606ac23a3513ea0d802b2e9272ab --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilpotentFiniteIndexLattice.lean @@ -0,0 +1,51 @@ +import OAI.GroupTheory.PolycyclicRecognition.Lattices.NilpotentLatticeInduction +import OAI.GroupTheory.PolycyclicRecognition.Algebra.PolycyclicTorsionFree + +namespace OAI + +/-! # The virtually nilpotent case of solvable lattice realization -/ + +noncomputable section +namespace PolycyclicRecognition +open scoped Manifold +variable {G : Type} [Group G] [Group.FG G] + +theorem nilpotent_finiteIndex_uniform_lattice [Group.IsNilpotent G] : + ∃ Γ : Subgroup G, Γ.FiniteIndex ∧ + ∃ (S : SimplyConnectedSolvableLieModel) (Λ : Subgroup S.carrier), + IsUniformLattice Λ ∧ Nonempty (Γ ≃* Λ) := by + obtain ⟨Γ, hΓ, htf⟩ := + (isPolycyclic_of_finitelyGenerated_nilpotent G).exists_torsionFree_finiteIndex + let := hΓ + obtain ⟨S, Λ, hΛ, e⟩ := torsionFree_nilpotent_uniform_lattice htf + exact ⟨Γ, hΓ, S, Λ, hΛ, e⟩ + +theorem virtuallyNilpotent_uniform_lattice (hG : Group.IsVirtuallyNilpotent G) : + ∃ Γ : Subgroup G, Γ.FiniteIndex ∧ + ∃ (S : SimplyConnectedSolvableLieModel) (Λ : Subgroup S.carrier), + IsUniformLattice Λ ∧ Nonempty (Γ ≃* Λ) := by + obtain ⟨N, hn, hi⟩ := hG + let := hn + let := hi + obtain ⟨K, hK, S, Λ, hΛ, ⟨e⟩⟩ := nilpotent_finiteIndex_uniform_lattice (G := N) + let Γ := K.map N.subtype + have hΓ : Γ.FiniteIndex := ⟨by + change (K.map N.subtype).index ≠ 0 + rw [Subgroup.index_map_subtype] + exact mul_ne_zero hK.index_ne_zero hi.index_ne_zero⟩ + let eK : K ≃* Γ := K.equivMapOfInjective N.subtype N.subtype_injective + exact ⟨Γ, hΓ, S, Λ, hΛ, ⟨eK.symm.trans e⟩⟩ + +theorem virtuallyNilpotent_dekimpe_realization (hG : Group.IsVirtuallyNilpotent G) : + ∃ Γ : Subgroup G, Γ.FiniteIndex ∧ + ∃ (S : SimplyConnectedSolvableLieModel) (Λ : Subgroup S.carrier), + DiscreteTopology Λ ∧ CompactSpace (S.carrier ⧸ Λ) ∧ Nonempty (Γ ≃* Λ) := by + obtain ⟨Γ, hΓ, S, Λ, hΛ, e⟩ := virtuallyNilpotent_uniform_lattice hG + let : IsTopologicalGroup S.carrier := topologicalGroup_of_lieGroup (𝓘(ℝ, S.modelSpace)) ⊤ + exact ⟨Γ, hΓ, S, Λ, hΛ.1, hΛ.compactSpace_quotient, e⟩ + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilpotentIntegralKernelCompletion.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilpotentIntegralKernelCompletion.lean new file mode 100644 index 0000000000000000000000000000000000000000..c5b190802e508585c369773949622ed8c8e8cd3e --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilpotentIntegralKernelCompletion.lean @@ -0,0 +1,86 @@ +import OAI.GroupTheory.PolycyclicRecognition.Analysis.IntegralQuotientKernel +import OAI.GroupTheory.PolycyclicRecognition.Lattices.NilpotentCyclicKernelCompletion + +namespace OAI + +/-! # Completing every nilpotent extension of a real kernel by an integral lattice + +The quotient rank induction removes an actual coordinate, completes its +kernel, and constructs the next real cyclic direction. The section relations +and all maps are retained through the group isomorphisms. +-/ + +noncomputable section +namespace PolycyclicRecognition +open scoped Manifold ContDiff +variable {K G : Type} [RealNormedLieAlgebra K] [FiniteDimensional ℝ K] + [PK : PolynomialExponentialCoordinates K] [LieRing.IsNilpotent K] + [Group G] [Group.IsNilpotent G] + +theorem nilpotent_integral_kernel_completion_with_dimension {n : ℕ} + (E : GroupExtension K G (IntegralLatticeGroup n)) + (hsmooth : ∀ g : G, ContMDiff (𝓘(ℝ, K)) (𝓘(ℝ, K)) ∞ (E.conjAct g)) : + ∃ C : NilpotentKernelCompletion E.inl, C.dimension = Module.finrank ℝ K + n := by + have main : ∀ m : ℕ, ∀ (H : Type) [Group H] [Group.IsNilpotent H], + ∀ (S : GroupExtension K H (IntegralLatticeGroup m)), + (∀ h : H, ContMDiff (𝓘(ℝ, K)) (𝓘(ℝ, K)) ∞ (S.conjAct h)) → + ∃ C : NilpotentKernelCompletion S.inl, C.dimension = Module.finrank ℝ K + m := by + intro m + induction m with + | zero => + intro H _ _ S _ + simpa only [Nat.add_zero] using + NilpotentKernelCompletion.exists_of_bijective_kernel_with_dimension S.inl (by + refine ⟨S.inl_injective, ?_⟩ + intro h + have hh : h ∈ S.inl.range := by + rw [S.range_inl_eq_ker_rightHom] + change S.rightHom h = 1 + exact Subsingleton.elim _ _ + exact hh) + | succ m ih => + intro H _ _ S hS + let q := integralLastMap S + let T := integralKernelExtension S + have hT (h : q.ker) : ContMDiff (𝓘(ℝ, K)) (𝓘(ℝ, K)) ∞ (T.conjAct h) := by + convert hS (h : H) using 1 + ext x + exact integralKernelExtension_conjAct S h x + obtain ⟨C, hC⟩ := ih q.ker T hT + have hq : Function.Surjective q := (integralQuotientLast_surjective m).comp S.rightHom_surjective + obtain ⟨t, ht⟩ := hq (Multiplicative.ofAdd 1) + have hnormal (g : H) (x : K) : + MulAut.conjNormal (H := q.ker) g (T.inl x) = T.inl (S.conjAct g x) := by + apply Subtype.ext + exact (S.inl_conjAct_comm (e := g) (n := x)).symm + have hact (g : H) : ContMDiff (𝓘(ℝ, K)) (𝓘(ℝ, C.carrier)) ∞ + ((C.embed.comp (MulAut.conjNormal (H := q.ker) g).toMonoidHom).comp T.inl) := by + have heq : ((C.embed.comp (MulAut.conjNormal (H := q.ker) g).toMonoidHom).comp + T.inl : K → C.carrier) = fun x => C.embed (T.inl (S.conjAct g x)) := by + funext x + exact congrArg C.embed (hnormal g x) + rw [heq] + exact C.kernel_smooth.comp (hS g) + have hai : ContMDiff (𝓘(ℝ, K)) (𝓘(ℝ, C.carrier)) ∞ + ((C.embed.comp (MulAut.conjNormal (H := q.ker) t).symm.toMonoidHom).comp T.inl) := by + have hi : (MulAut.conjNormal (H := q.ker) t).symm = + MulAut.conjNormal (H := q.ker) t⁻¹ := (map_inv _ t).symm + rw [hi] + exact hact t⁻¹ + obtain ⟨D, hD⟩ := nilpotent_cyclic_kernel_completion_with_dimension q t ht T.inl C (hact t) hai + change NilpotentKernelCompletion S.inl at D + exact ⟨D, hD.trans (by rw [hC, Nat.add_assoc])⟩ + exact main n G E hsmooth + +theorem nilpotent_integral_kernel_completion {n : ℕ} + (E : GroupExtension K G (IntegralLatticeGroup n)) + (hsmooth : ∀ g : G, ContMDiff (𝓘(ℝ, K)) (𝓘(ℝ, K)) ∞ (E.conjAct g)) : + Nonempty (NilpotentKernelCompletion E.inl) := by + obtain ⟨C, _⟩ := nilpotent_integral_kernel_completion_with_dimension E hsmooth + exact ⟨C⟩ + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilpotentKernelCompletion.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilpotentKernelCompletion.lean new file mode 100644 index 0000000000000000000000000000000000000000..27bee564aa0672d99eff191e26dfaf7842cd9d8d --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilpotentKernelCompletion.lean @@ -0,0 +1,129 @@ +import OAI.GroupTheory.PolycyclicRecognition.Algebra.PolynomialModelHom +import OAI.GroupTheory.PolycyclicRecognition.Algebra.PolynomialModelWords +import OAI.GroupTheory.PolycyclicRecognition.Algebra.BasisPolynomialMaps + +namespace OAI + +/-! # Induction data for completing a nilpotent group with a real kernel + +The integer grid is required only to lie in the embedded group. The kernel +may already contain real one-parameter groups, so discreteness is not assumed. +-/ + +noncomputable section +namespace PolycyclicRecognition +open scoped Manifold ContDiff +variable {K H : Type} [RealNormedLieAlgebra K] [FiniteDimensional ℝ K] + [PK : PolynomialExponentialCoordinates K] [Group H] + +structure NilpotentKernelCompletion (i : K →* H) where + carrier : Type + [normed : RealNormedLieAlgebra carrier] + [finiteDimensional : FiniteDimensional ℝ carrier] + [coordinates : PolynomialExponentialCoordinates carrier] + [nilpotent : LieRing.IsNilpotent carrier] + embed : H →* carrier + injective : Function.Injective embed + kernel_smooth : ContMDiff (𝓘(ℝ, K)) (𝓘(ℝ, carrier)) ∞ (embed.comp i) + dimension : ℕ + basis : Module.Basis (Fin dimension) ℝ carrier + parameter : carrier ≃ carrier + polynomial : IsPolynomialInBasis basis basis parameter + polynomial_symm : IsPolynomialInBasis basis basis parameter.symm + integer_grid : ∀ z : Fin dimension → ℤ, ∃ h : H, + embed h = parameter (basis.equivFun.symm (fun j => (z j : ℝ))) + extend : ∀ (M : Type) [RealNormedLieAlgebra M] [FiniteDimensional ℝ M] + [PolynomialExponentialCoordinates M] [LieRing.IsNilpotent M] + (f : H →* M), ContMDiff (𝓘(ℝ, K)) (𝓘(ℝ, M)) ∞ (f.comp i) → + ∃ φ : carrier →* M, ContMDiff (𝓘(ℝ, carrier)) (𝓘(ℝ, M)) ∞ φ ∧ + ∀ h, φ (embed h) = f h + +attribute [instance] NilpotentKernelCompletion.normed + NilpotentKernelCompletion.finiteDimensional NilpotentKernelCompletion.coordinates + NilpotentKernelCompletion.nilpotent + +namespace NilpotentKernelCompletion + +def of_polynomial_kernel [LieRing.IsNilpotent K] : + NilpotentKernelCompletion (MonoidHom.id K) where + carrier := K + embed := MonoidHom.id K + injective := Function.injective_id + kernel_smooth := contMDiff_id + dimension := Module.finrank ℝ K + basis := Module.finBasis ℝ K + parameter := Equiv.refl K + polynomial := IsPolynomialInBasis.linear LinearMap.id + polynomial_symm := IsPolynomialInBasis.linear LinearMap.id + integer_grid z := ⟨(Module.finBasis ℝ K).equivFun.symm (fun j => (z j : ℝ)), rfl⟩ + extend _ _ _ _ _ f hf := ⟨f, hf, fun _ => rfl⟩ + +variable {i : K →* H} (C : NilpotentKernelCompletion i) + +/-- The polynomial integer grid determines every smooth homomorphism. -/ +theorem hom_ext (M : Type) [RealNormedLieAlgebra M] [FiniteDimensional ℝ M] + [PM : PolynomialExponentialCoordinates M] + (φ ψ : C.carrier →* M) + (hφ : ContMDiff (𝓘(ℝ, C.carrier)) (𝓘(ℝ, M)) ∞ φ) + (hψ : ContMDiff (𝓘(ℝ, C.carrier)) (𝓘(ℝ, M)) ∞ ψ) + (h : ∀ a, φ (C.embed a) = ψ (C.embed a)) : φ = ψ := by + let b := Module.finBasis ℝ M + let f := polynomialModelLieHom φ hφ + let g := polynomialModelLieHom ψ hψ + have he : (f.toLinearMap ∘ C.parameter) = (g.toLinearMap ∘ C.parameter) := by + apply ((IsPolynomialInBasis.linear (b := C.basis) (c := b) f.toLinearMap).comp + C.polynomial).ext_integer_grid + ((IsPolynomialInBasis.linear (b := C.basis) (c := b) g.toLinearMap).comp C.polynomial) + intro z + obtain ⟨a, ha⟩ := C.integer_grid z + change f (C.parameter (C.basis.equivFun.symm (fun j => (z j : ℝ)))) = + g (C.parameter (C.basis.equivFun.symm (fun j => (z j : ℝ)))) + rw [← ha] + exact (polynomialModelLieHom_apply φ hφ _).trans + ((h a).trans (polynomialModelLieHom_apply ψ hψ _).symm) + apply MonoidHom.ext + intro x + have hh := congrFun he (C.parameter.symm x) + change f (C.parameter (C.parameter.symm x)) = g (C.parameter (C.parameter.symm x)) at hh + rw [C.parameter.apply_symm_apply] at hh + exact (polynomialModelLieHom_apply φ hφ x).symm.trans + (hh.trans (polynomialModelLieHom_apply ψ hψ x)) + +/-- Compatible automorphisms of the original group extend with their inverse. -/ +theorem automorphism_extension (a : MulAut H) + (ha : ContMDiff (𝓘(ℝ, K)) (𝓘(ℝ, C.carrier)) ∞ + ((C.embed.comp a.toMonoidHom).comp i)) + (hai : ContMDiff (𝓘(ℝ, K)) (𝓘(ℝ, C.carrier)) ∞ + ((C.embed.comp a.symm.toMonoidHom).comp i)) : + ∃ A : MulAut C.carrier, ContMDiff (𝓘(ℝ, C.carrier)) (𝓘(ℝ, C.carrier)) ∞ A ∧ + ContMDiff (𝓘(ℝ, C.carrier)) (𝓘(ℝ, C.carrier)) ∞ A.symm ∧ + ∀ h, A (C.embed h) = C.embed (a h) := by + obtain ⟨f, hf, hfe⟩ := C.extend C.carrier (C.embed.comp a.toMonoidHom) ha + obtain ⟨g, hg, hge⟩ := C.extend C.carrier (C.embed.comp a.symm.toMonoidHom) hai + simp only [MonoidHom.comp_apply, MulEquiv.coe_toMonoidHom] at hfe hge + have hgf : g.comp f = MonoidHom.id C.carrier := by + apply C.hom_ext C.carrier (g.comp f) (MonoidHom.id C.carrier) (hg.comp hf) contMDiff_id + intro h + change g (f (C.embed h)) = C.embed h + rw [hfe, hge] + exact congrArg C.embed (a.symm_apply_apply h) + have hfg : f.comp g = MonoidHom.id C.carrier := by + apply C.hom_ext C.carrier (f.comp g) (MonoidHom.id C.carrier) (hf.comp hg) contMDiff_id + intro h + change f (g (C.embed h)) = C.embed h + rw [hge, hfe] + exact congrArg C.embed (a.apply_symm_apply h) + let A : MulAut C.carrier := + { toFun := f + invFun := g + left_inv := fun x => DFunLike.congr_fun hgf x + right_inv := fun x => DFunLike.congr_fun hfg x + map_mul' := f.map_mul } + exact ⟨A, hf, hg, hfe⟩ + +end NilpotentKernelCompletion +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilpotentLatticeAbelianExtension.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilpotentLatticeAbelianExtension.lean new file mode 100644 index 0000000000000000000000000000000000000000..4245594673df41359b152b4cd583d3175a373e94 --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilpotentLatticeAbelianExtension.lean @@ -0,0 +1,32 @@ +import OAI.GroupTheory.PolycyclicRecognition.Lattices.NilpotentLatticeVectorAction +import OAI.GroupTheory.PolycyclicRecognition.Lattices.SmoothVectorActionLattice + +namespace OAI + +/-! # Uniform solvable Lie lattices for split integral-abelian extensions -/ + +noncomputable section +namespace PolycyclicRecognition.NilpotentLatticeCoordinates +variable {H : Type} [Group H] (C : NilpotentLatticeCoordinates H) +include C + +theorem abelian_extension_finiteIndex_lattice {n : ℕ} + (ρ : IntegralLatticeGroup n →* MulAut H) : + ∃ Γ : Subgroup (H ⋊[ρ] IntegralLatticeGroup n), Γ.FiniteIndex ∧ + ∃ (S : SimplyConnectedSolvableLieModel) (Λ : Subgroup S.carrier), + IsUniformLattice Λ ∧ Nonempty (Γ ≃* Λ) := by + obtain ⟨m, hm, φ, hφ, he⟩ := C.exists_vector_action ρ + obtain ⟨S, Λ, hΛ, ⟨e⟩⟩ := smooth_vectorAction_integral_lattice φ hφ + (ρ.comp (latticePowerHom n m)) C.lattice C.uniform C.equiv he + let F := integralSemidirectPowerMap ρ m + have hF : Function.Injective F := integralSemidirectPowerMap_injective ρ hm + let eF : (H ⋊[ρ.comp (latticePowerHom n m)] IntegralLatticeGroup n) ≃* F.range := + MulEquiv.ofBijective F.rangeRestrict + ⟨fun _ _ h => hF (congrArg Subtype.val h), F.rangeRestrict_surjective⟩ + exact ⟨F.range, integralSemidirectPowerMap_finiteIndex ρ hm, S, Λ, hΛ, ⟨eF.symm.trans e⟩⟩ + +end PolycyclicRecognition.NilpotentLatticeCoordinates + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilpotentLatticeAutomorphisms.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilpotentLatticeAutomorphisms.lean new file mode 100644 index 0000000000000000000000000000000000000000..8ade67c78c329a3f568dc7c67130c9180beb7bcb --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilpotentLatticeAutomorphisms.lean @@ -0,0 +1,108 @@ +import OAI.GroupTheory.PolycyclicRecognition.Lattices.NilpotentLatticeCoordinates +import OAI.GroupTheory.PolycyclicRecognition.Lattices.LatticeWordExtension +import OAI.GroupTheory.PolycyclicRecognition.Algebra.PolynomialModelHom + +namespace OAI + +/-! # Extending the lattice automorphism group to its nilpotent Lie model + +The extension respects composition. This retains arbitrary discrete actions, +without imposing unipotence on their automorphisms. +-/ + +noncomputable section +namespace PolycyclicRecognition +open scoped Manifold ContDiff +variable {H : Type} [Group H] + +namespace NilpotentLatticeCoordinates +variable (C : NilpotentLatticeCoordinates H) + +theorem ext_polynomial {f g : C.carrier → C.carrier} + (hf : IsPolynomialInBasis C.basis C.basis f) + (hg : IsPolynomialInBasis C.basis C.basis g) + (h : ∀ x : H, f (C.equiv x) = g (C.equiv x)) : f = g := by + have hp : f ∘ C.parameter = g ∘ C.parameter := + (hf.comp C.polynomial).ext_integer_grid (hg.comp C.polynomial) (by + intro z + change f (C.parameter (C.basis.equivFun.symm (fun i => (z i : ℝ)))) = + g (C.parameter (C.basis.equivFun.symm (fun i => (z i : ℝ)))) + rw [C.integer_parameter] + exact h _) + funext x + obtain ⟨y, rfl⟩ := C.parameter.surjective x + exact congrFun hp y + +def automorphism (a : MulAut H) : MulAut C.carrier := + latticeWordAut C.basis C.parameter (C.lattice.subtype.comp C.equiv.toMonoidHom) + C.generators C.polynomial C.polynomial_symm C.integer_parameter C.word_surjective a + +theorem automorphism_polynomial (a : MulAut H) : + IsPolynomialInBasis C.basis C.basis (C.automorphism a) := + latticeWordMap_polynomial C.basis C.parameter + (C.lattice.subtype.comp C.equiv.toMonoidHom) C.generators + C.polynomial_symm a.toMonoidHom + +theorem automorphism_smooth (a : MulAut H) : + ContMDiff (𝓘(ℝ, C.carrier)) (𝓘(ℝ, C.carrier)) ∞ (C.automorphism a) := + contMDiff_latticeWordAut C.basis C.parameter + (C.lattice.subtype.comp C.equiv.toMonoidHom) C.generators + C.polynomial C.polynomial_symm C.integer_parameter C.word_surjective a + +@[simp] theorem automorphism_on_lattice (a : MulAut H) (x : H) : + C.automorphism a (C.equiv x) = (C.equiv (a x) : C.carrier) := + latticeWordAut_on_lattice C.basis C.parameter + (C.lattice.subtype.comp C.equiv.toMonoidHom) C.generators + C.polynomial C.polynomial_symm C.integer_parameter C.word_surjective a x + +@[simp] theorem automorphism_one : C.automorphism 1 = 1 := by + apply DFunLike.ext + intro x + have h : (C.automorphism 1 : C.carrier → C.carrier) = id := + C.ext_polynomial (C.automorphism_polynomial 1) + (IsPolynomialInBasis.linear (LinearMap.id)) (by intro y; simp) + exact congrFun h x + +@[simp] theorem automorphism_mul (a b : MulAut H) : + C.automorphism (a * b) = C.automorphism a * C.automorphism b := by + apply DFunLike.ext + intro x + have h : (C.automorphism (a * b) : C.carrier → C.carrier) = + (C.automorphism a : C.carrier → C.carrier) ∘ C.automorphism b := + C.ext_polynomial (C.automorphism_polynomial (a * b)) + ((C.automorphism_polynomial a).comp (C.automorphism_polynomial b)) (by + intro y + change C.automorphism (a * b) (C.equiv y) = + C.automorphism a (C.automorphism b (C.equiv y)) + rw [C.automorphism_on_lattice, C.automorphism_on_lattice, C.automorphism_on_lattice] + rfl) + exact congrFun h x + +def automorphismHom : MulAut H →* MulAut C.carrier where + toFun := C.automorphism + map_one' := C.automorphism_one + map_mul' := C.automorphism_mul + +theorem automorphism_injective : Function.Injective C.automorphismHom := by + intro a b h + apply DFunLike.ext + intro x + apply C.equiv.injective + apply Subtype.ext + have he := congrArg (fun f : MulAut C.carrier => f (C.equiv x)) h + simpa only [automorphismHom, MonoidHom.coe_mk, OneHom.coe_mk, + C.automorphism_on_lattice] using he + +def automorphismLieEquiv (a : MulAut H) : C.carrier ≃ₗ⁅ℝ⁆ C.carrier := + polynomialModelLieEquiv (C.automorphism a) (C.automorphism_smooth a) + +@[simp] theorem automorphismLieEquiv_apply (a : MulAut H) (x : C.carrier) : + C.automorphismLieEquiv a x = C.automorphism a x := + polynomialModelLieEquiv_apply _ _ _ + +end NilpotentLatticeCoordinates +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilpotentLatticeCoordinates.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilpotentLatticeCoordinates.lean new file mode 100644 index 0000000000000000000000000000000000000000..c616c1255e07361cf582e2f422691acff7e006c0 --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilpotentLatticeCoordinates.lean @@ -0,0 +1,98 @@ +import OAI.GroupTheory.PolycyclicRecognition.Algebra.AbelianRealSpace +import OAI.GroupTheory.PolycyclicRecognition.Algebra.PolynomialModelWords + +namespace OAI + +/-! # Ordered polynomial coordinates for a nilpotent lattice + +This record retains the integer parameter alongside the real Lie model. +It is the induction data, not an additional realization hypothesis. +-/ + +noncomputable section +namespace PolycyclicRecognition +open Module + +structure NilpotentLatticeCoordinates (H : Type) [Group H] where + carrier : Type + [realNormed : RealNormedLieAlgebra carrier] + [finiteDimensional : FiniteDimensional ℝ carrier] + [lieNilpotent : LieRing.IsNilpotent carrier] + [coordinates : PolynomialExponentialCoordinates carrier] + [solvable : Group.IsSolvable carrier] + dimension : ℕ + basis : Basis (Fin dimension) ℝ carrier + parameter : carrier ≃ carrier + polynomial : IsPolynomialInBasis basis basis parameter + polynomial_symm : IsPolynomialInBasis basis basis parameter.symm + lattice : Subgroup carrier + uniform : IsUniformLattice lattice + equiv : H ≃* lattice + generators : Fin dimension → H + word_surjective : Function.Surjective (orderedWord generators) + integer_parameter : ∀ z : Fin dimension → ℤ, + parameter (basis.equivFun.symm (fun i => (z i : ℝ))) = + (equiv (orderedWord generators z) : carrier) + +attribute [instance] NilpotentLatticeCoordinates.realNormed + NilpotentLatticeCoordinates.finiteDimensional NilpotentLatticeCoordinates.lieNilpotent + NilpotentLatticeCoordinates.coordinates NilpotentLatticeCoordinates.solvable + +namespace NilpotentLatticeCoordinates +variable {H K : Type} [Group H] [Group K] + +def of_equiv (C : NilpotentLatticeCoordinates H) (e : H ≃* K) : + NilpotentLatticeCoordinates K where + carrier := C.carrier + dimension := C.dimension + basis := C.basis + parameter := C.parameter + polynomial := C.polynomial + polynomial_symm := C.polynomial_symm + lattice := C.lattice + uniform := C.uniform + equiv := e.symm.trans C.equiv + generators := fun i => e (C.generators i) + word_surjective := by + intro x + obtain ⟨z, hz⟩ := C.word_surjective (e.symm x) + refine ⟨z, ?_⟩ + exact (orderedWord_map e.toMonoidHom C.generators z).trans + ((congrArg e hz).trans (e.apply_symm_apply x)) + integer_parameter := by + intro z + have hw : orderedWord (fun i => e (C.generators i)) z = + e (orderedWord C.generators z) := orderedWord_map e.toMonoidHom C.generators z + rw [C.integer_parameter, hw] + simp only [MulEquiv.trans_apply, MulEquiv.symm_apply_apply] + +def of_subsingleton [Subsingleton H] : NilpotentLatticeCoordinates H := by + let L := AbelianRealSpace 0 + let : Subsingleton L := inferInstanceAs (Subsingleton (Fin 0 → ℝ)) + let : Unique H := uniqueOfSubsingleton 1 + let : Unique (abelianRealLattice 0) := uniqueOfSubsingleton 1 + let e : H ≃* abelianRealLattice 0 := MulEquiv.ofUnique + refine { + carrier := L + dimension := 0 + basis := Pi.basisFun ℝ (Fin 0) + parameter := Equiv.refl L + polynomial := IsPolynomialInBasis.linear (LinearMap.id) + polynomial_symm := IsPolynomialInBasis.linear (LinearMap.id) + lattice := abelianRealLattice 0 + uniform := abelianRealLattice_uniform 0 + equiv := e + generators := Fin.elim0 + word_surjective := ?_ + integer_parameter := ?_ } + · intro x + exact ⟨Fin.elim0, Subsingleton.elim _ _⟩ + · intro z + exact Subsingleton.elim _ _ + +end NilpotentLatticeCoordinates +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilpotentLatticeCyclicExtension.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilpotentLatticeCyclicExtension.lean new file mode 100644 index 0000000000000000000000000000000000000000..9bdaac8c90008ca14599fba99980bc62414d6a4a --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilpotentLatticeCyclicExtension.lean @@ -0,0 +1,52 @@ +import OAI.GroupTheory.PolycyclicRecognition.Lattices.NilpotentLatticeDerivationExtension +import OAI.GroupTheory.PolycyclicRecognition.Lattices.LatticeWordExtension +import OAI.GroupTheory.PolycyclicRecognition.Lattices.LatticeAutomorphismFlow + +namespace OAI + +/-! # The iterative nilpotent lattice step + +Ordered real generator powers extend conjugation; the finite logarithm of +its differential supplies the flow. The output retains the lattice parameter. +-/ + +noncomputable section +namespace PolycyclicRecognition +variable {H : Type} [Group H] + +theorem NilpotentLatticeCoordinates.cyclic_extension + (C : NilpotentLatticeCoordinates H) (a : MulAut H) + [Group.IsNilpotent (H ⋊[integerPowerAction a] Multiplicative ℤ)] : + Nonempty (NilpotentLatticeCoordinates + (H ⋊[integerPowerAction a] Multiplicative ℤ)) := by + let G := H ⋊[integerPowerAction a] Multiplicative ℤ + let j : H →* G := SemidirectProduct.inl + let t : G := SemidirectProduct.inr (Multiplicative.ofAdd (1 : ℤ)) + have ha (x : H) : j (a x) = t * j x * t⁻¹ := by + have h := SemidirectProduct.inl_aut (φ := integerPowerAction a) + (Multiplicative.ofAdd (1 : ℤ)) x + rw [map_inv] at h + change j ((a ^ (1 : ℤ)) x) = t * j x * t⁻¹ at h + simpa only [zpow_one] using h + let q := C.lattice.subtype.comp C.equiv.toMonoidHom + let F := latticeWordAut C.basis C.parameter q C.generators + C.polynomial C.polynomial_symm C.integer_parameter C.word_surjective a + obtain ⟨D, hD, htime⟩ := exists_nilpotent_lattice_automorphism_log + C.basis C.parameter C.polynomial C.parameter.surjective q + (fun z => ⟨orderedWord C.generators z, (C.integer_parameter z).symm⟩) + j SemidirectProduct.inl_injective a t ha F + (contMDiff_latticeWordAut C.basis C.parameter q C.generators + C.polynomial C.polynomial_symm C.integer_parameter C.word_surjective a) + (latticeWordAut_on_lattice C.basis C.parameter q C.generators + C.polynomial C.polynomial_symm C.integer_parameter C.word_surjective a) + apply C.derivation_extension a D hD + intro x + rw [htime] + exact (latticeWordAut_on_lattice C.basis C.parameter q C.generators + C.polynomial C.polynomial_symm C.integer_parameter C.word_surjective a x).symm + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilpotentLatticeDerivationExtension.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilpotentLatticeDerivationExtension.lean new file mode 100644 index 0000000000000000000000000000000000000000..08c12e2f1606b3791259db01cadf78d1f8626e51 --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilpotentLatticeDerivationExtension.lean @@ -0,0 +1,90 @@ +import OAI.GroupTheory.PolycyclicRecognition.Lattices.NilpotentLatticeCoordinates +import OAI.GroupTheory.PolycyclicRecognition.Algebra.CyclicParameterBasis +import OAI.GroupTheory.PolycyclicRecognition.Geometry.OrderedSemidirectWords +import OAI.GroupTheory.PolycyclicRecognition.Geometry.SemidirectExponentialCoordinates +import OAI.GroupTheory.PolycyclicRecognition.Lattices.DerivationSolvableModel + +namespace OAI + +/-! # Retaining the integral parameter in the real derivation extension -/ + +noncomputable section +namespace PolycyclicRecognition +open Module +attribute [local instance] semidirectProductTopology + +variable {H : Type} [Group H] + +theorem NilpotentLatticeCoordinates.derivation_extension + (C : NilpotentLatticeCoordinates H) (a : MulAut H) + (D : LieDerivation ℝ C.carrier C.carrier) (hD : IsNilpotent D.toLinearMap) + (hstep : ∀ x, (C.equiv (a x) : C.carrier) = + nilpotentDerivationFlow D hD 1 (C.equiv x)) : + Nonempty (NilpotentLatticeCoordinates + (H ⋊[integerPowerAction a] Multiplicative ℤ)) := by + let L := C.carrier + let φ := C.coordinates.derivationAction D hD + obtain ⟨Γ, hΓ, f, hf⟩ := integer_semidirect_lattice_realization_with_coordinates + φ a C.lattice C.uniform C.equiv hstep + let := derivationSemidirectGroup D hD + let _ : Mul (L × ℝ) := (derivationSemidirectGroup D hD).toMul + obtain ⟨Q, E, hE⟩ := exists_semidirect_polynomial_exponential_coordinates D hD + let := Q + let T := DerivationLieSpace D hD + let _ : Group T := Q.group + let _ : Mul T := Q.group.toMul + let F : T ≃* (L ⋊[φ] Multiplicative ℝ) := E.trans + { derivationSemidirectEquiv D hD with map_mul' := fun _ _ => rfl } + let : Group.IsSolvable (L ⋊[φ] Multiplicative ℝ) := semidirect_solvable φ + let : Group.IsSolvable T := + Group.isSolvable_of_isSolvable_injective (f := F.toMonoidHom) F.injective + let s := derivationLieSpaceSplit D hD + let b := cyclicParameterBasis C.basis s + let c := Module.finBasis ℝ (L × ℝ) + let p := transportedProductParameter C.parameter s E.toEquiv + have hpoly := polynomial_transported_product_parameter C.basis c b + C.parameter s E.toEquiv C.polynomial C.polynomial_symm (hE b c).1 (hE b c).2 + have hF : Continuous F := by + exact (continuous_derivationModelEquiv D hD).comp ((hE b c).1.contDiff.continuous) + have hFi : Continuous F.symm := by + exact (hE b c).2.contDiff.continuous.comp (continuous_derivationModelEquiv_symm D hD) + let Λ := Γ.comap F.toMonoidHom + let e : (H ⋊[integerPowerAction a] Multiplicative ℤ) ≃* Λ := + f.trans (comapSubgroupEquiv F Γ).symm + refine ⟨{ + carrier := T + lieNilpotent := derivationLieSpace_nilpotent D hD + dimension := C.dimension + 1 + basis := b + parameter := p + polynomial := hpoly.1 + polynomial_symm := hpoly.2 + lattice := Λ + uniform := hΓ.comap_mulEquiv F hF hFi + equiv := e + generators := cyclicExtensionGenerators a C.generators + word_surjective := cyclicExtension_orderedWord_surjective a C.generators C.word_surjective + integer_parameter := ?_ }⟩ + intro z + apply F.injective + change F (p (b.equivFun.symm (fun i => (z i : ℝ)))) = + F (F.symm (f (orderedWord (cyclicExtensionGenerators a C.generators) z))) + rw [F.apply_symm_apply, hf] + have hp := transportedProductParameter_integer C.basis C.parameter s E.toEquiv z + change E (p (b.equivFun.symm (fun i => (z i : ℝ)))) = + (C.parameter (C.basis.equivFun.symm (fun i => (z i.castSucc : ℝ))), + (z (Fin.last C.dimension) : ℝ)) at hp + rw [cyclicExtension_orderedWord] + apply SemidirectProduct.ext + · change (E (p (b.equivFun.symm (fun i => (z i : ℝ))))).1 = _ + simpa [realIntegerSemidirectMap] using + (congrArg Prod.fst hp).trans (C.integer_parameter _) + · change Multiplicative.ofAdd (E (p (b.equivFun.symm (fun i => (z i : ℝ))))).2 = _ + simpa [realIntegerSemidirectMap, integerTimeHom] using + congrArg Multiplicative.ofAdd (congrArg Prod.snd hp) + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilpotentLatticeDerivationLog.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilpotentLatticeDerivationLog.lean new file mode 100644 index 0000000000000000000000000000000000000000..44f3b8002c3ddd74bab52f415c904f1f46840219 --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilpotentLatticeDerivationLog.lean @@ -0,0 +1,50 @@ +import OAI.GroupTheory.PolycyclicRecognition.Geometry.AnalyticDerivationAction +import OAI.GroupTheory.PolycyclicRecognition.Lattices.NilpotentLatticeLinearAction +import OAI.GroupTheory.PolycyclicRecognition.Lattices.SmoothRealActionLattice +import OAI.GroupTheory.PolycyclicRecognition.Algebra.CyclicPowerIndex + +namespace OAI + +/-! # The cyclic lattice step from an actual derivation logarithm + +The logarithm and its exponential equality remain a local algebraic +obligation. The real action and the Lie lattice are constructed here. +-/ + +noncomputable section +namespace PolycyclicRecognition.NilpotentLatticeCoordinates +variable {H : Type} [Group H] (C : NilpotentLatticeCoordinates H) + +theorem cyclic_lattice_of_derivation_log (a : MulAut H) + (D : LieDerivation ℝ C.carrier C.carrier) + (hD : NormedSpace.exp (LinearMap.toContinuousLinearMap D.toLinearMap) = + LinearMap.toContinuousLinearMap (C.automorphismLinear a)) : + ∃ (S : SimplyConnectedSolvableLieModel) (Γ : Subgroup S.carrier), + IsUniformLattice Γ ∧ Nonempty ((H ⋊[integerPowerAction a] Multiplicative ℤ) ≃* Γ) := by + apply smooth_realAction_cyclic_lattice + (PolynomialExponentialCoordinates.analyticDerivationAction D) + (PolynomialExponentialCoordinates.analyticDerivationAction_smooth D) + a C.lattice C.uniform C.equiv + intro x + change (C.equiv (a x) : C.carrier) = analyticDerivationFlow D 1 (C.equiv x) + rw [analyticDerivationFlow, one_smul, analyticDerivationExp_apply, hD] + change (C.equiv (a x) : C.carrier) = C.automorphismLinear a (C.equiv x) + rw [C.automorphismLinear_apply] + exact (C.automorphism_on_lattice a x).symm + +theorem cyclic_finiteIndex_lattice_of_derivation_log (a : MulAut H) + {m : ℕ} (hm : 0 < m) (D : LieDerivation ℝ C.carrier C.carrier) + (hD : NormedSpace.exp (LinearMap.toContinuousLinearMap D.toLinearMap) = + LinearMap.toContinuousLinearMap (C.automorphismLinear (a ^ m))) : + ∃ Γ : Subgroup (H ⋊[integerPowerAction a] Multiplicative ℤ), Γ.FiniteIndex ∧ + ∃ (S : SimplyConnectedSolvableLieModel) (Λ : Subgroup S.carrier), + IsUniformLattice Λ ∧ Nonempty (Γ ≃* Λ) := by + obtain ⟨S, Λ, hΛ, ⟨e⟩⟩ := C.cyclic_lattice_of_derivation_log (a ^ m) D hD + exact ⟨(cyclicPowerMap a m).range, cyclicPowerMap_range_finiteIndex a hm, + S, Λ, hΛ, ⟨(cyclicPowerRangeEquiv a hm).symm.trans e⟩⟩ + +end PolycyclicRecognition.NilpotentLatticeCoordinates + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilpotentLatticeInduction.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilpotentLatticeInduction.lean new file mode 100644 index 0000000000000000000000000000000000000000..83749d90dfa41a375b6015a7b311a4f2183ba5db --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilpotentLatticeInduction.lean @@ -0,0 +1,97 @@ +import OAI.GroupTheory.PolycyclicRecognition.Lattices.NilpotentLatticeCyclicExtension +import OAI.GroupTheory.PolycyclicRecognition.Algebra.CyclicKernelSplitting +import OAI.GroupTheory.PolycyclicRecognition.Algebra.NilpotentPolyZ + +namespace OAI + +/-! # Realizing an arbitrary finitely generated torsion-free nilpotent group + +The induction follows an actual torsion-free cyclic series. Its successive +integer normal forms are retained as polynomial parameters at every stage. +-/ + +noncomputable section +namespace PolycyclicRecognition +variable {G : Type} [Group G] [Group.IsNilpotent G] + +theorem nilpotent_lattice_coordinates_of_cyclic_quotient + (N : Subgroup G) [N.Normal] [IsCyclic (G ⧸ N)] + (C : NilpotentLatticeCoordinates N) + (hQ : HasNoNontrivialTorsion (G ⧸ N)) : + Nonempty (NilpotentLatticeCoordinates G) := by + cases finite_or_infinite (G ⧸ N) with + | inl h => + let := h + let := subsingleton_of_finite_torsionFree (G ⧸ N) hQ + have htop : N = ⊤ := by + apply top_unique + intro g _ + exact (QuotientGroup.eq_one_iff g).mp (Subsingleton.elim _ _) + subst N + exact ⟨C.of_equiv Subgroup.topEquiv⟩ + | inr h => + let := h + let E : Multiplicative ℤ ≃* G ⧸ N := intCyclicMulEquiv + let q : G →* Multiplicative ℤ := E.symm.toMonoidHom.comp (QuotientGroup.mk' N) + have hker : q.ker = N := by + ext g + change E.symm (QuotientGroup.mk' N g) = 1 ↔ g ∈ N + rw [← E.symm.map_one, E.symm.injective.eq_iff] + exact QuotientGroup.eq_one_iff g + obtain ⟨t, ht⟩ := QuotientGroup.mk'_surjective N (E (Multiplicative.ofAdd 1)) + have hqt : q t = Multiplicative.ofAdd 1 := by + change E.symm (QuotientGroup.mk' N t) = _ + rw [ht, E.symm_apply_apply] + let e := cyclicKernelEquiv q t hqt + let : Group.IsNilpotent + (q.ker ⋊[integerPowerAction (MulAut.conjNormal t)] Multiplicative ℤ) := + (Group.isNilpotent_congr e).mpr inferInstance + let C' := C.of_equiv (MulEquiv.subgroupCongr hker.symm) + obtain ⟨D⟩ := C'.cyclic_extension (MulAut.conjNormal t) + exact ⟨D.of_equiv e⟩ + +theorem nilpotent_lattice_coordinates_of_polyZ (hG : IsPolyZ G) : + Nonempty (NilpotentLatticeCoordinates G) := by + obtain ⟨n, c, hc⟩ := hG + have hm : ∀ i, i ≤ n → Nonempty (NilpotentLatticeCoordinates (c.group i)) := by + intro i + induction i with + | zero => + intro _ + rw [c.first] + exact ⟨NilpotentLatticeCoordinates.of_subsingleton⟩ + | succ i ih => + intro hi + let s := c.step i (by omega) + let := s.normal + let := s.cyclic + let e := (Subgroup.subgroupOfEquivOfLe s.le).symm + obtain ⟨C⟩ := ih (by omega) + exact nilpotent_lattice_coordinates_of_cyclic_quotient + ((c.group i).subgroupOf (c.group (i + 1))) (C.of_equiv e) (hc i (by omega)) + obtain ⟨C⟩ := hm n le_rfl + rw [c.last] at C + exact ⟨C.of_equiv Subgroup.topEquiv⟩ + +theorem nilpotent_lattice_coordinates [Group.FG G] + (hG : HasNoNontrivialTorsion G) : Nonempty (NilpotentLatticeCoordinates G) := + nilpotent_lattice_coordinates_of_polyZ + (nilpotent_polyZ_of_finitelyGenerated_torsionFree hG) + +omit [Group.IsNilpotent G] in +def NilpotentLatticeCoordinates.solvableLieModel (C : NilpotentLatticeCoordinates G) : + SimplyConnectedSolvableLieModel := + { modelSpace := C.carrier, carrier := C.carrier } + +theorem torsionFree_nilpotent_uniform_lattice [Group.FG G] + (hG : HasNoNontrivialTorsion G) : + ∃ (S : SimplyConnectedSolvableLieModel) (Λ : Subgroup S.carrier), + IsUniformLattice Λ ∧ Nonempty (G ≃* Λ) := by + obtain ⟨C⟩ := nilpotent_lattice_coordinates hG + exact ⟨C.solvableLieModel, C.lattice, C.uniform, ⟨C.equiv⟩⟩ + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilpotentLatticeInnerAction.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilpotentLatticeInnerAction.lean new file mode 100644 index 0000000000000000000000000000000000000000..681ae29d4665a863a6128c8989ef5e9c04aafc0b --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilpotentLatticeInnerAction.lean @@ -0,0 +1,60 @@ +import OAI.GroupTheory.PolycyclicRecognition.Lattices.NilpotentLatticeLinearAction +import OAI.GroupTheory.PolycyclicRecognition.Lattices.LatticeAutomorphismUnipotent +import Mathlib.GroupTheory.GroupAction.ConjAct + +namespace OAI + +/-! # Unipotent corrections in a nonsplit nilpotent-by-abelian extension + +Commutators of quotient lifts need not be trivial. Their induced action on +the nilpotent Lie model is the actual inner action and is unipotent. +-/ + +noncomputable section +namespace PolycyclicRecognition +open scoped commutatorElement IsMulCommutative + +namespace NilpotentLatticeCoordinates +variable {H : Type} [Group H] [Group.IsNilpotent H] (C : NilpotentLatticeCoordinates H) + +theorem automorphismLinear_inner_unipotent (t : H) : + IsNilpotent (C.automorphismLinear (MulAut.conj t) - 1) := by + let q := C.lattice.subtype.comp C.equiv.toMonoidHom + apply lattice_automorphism_unipotent C.basis C.parameter C.polynomial C.parameter.surjective q + (fun z => ⟨orderedWord C.generators z, (C.integer_parameter z).symm⟩) + (MonoidHom.id H) Function.injective_id (MulAut.conj t) t + · intro x + rfl + · intro x + change C.automorphismLinear (MulAut.conj t) (C.equiv x) = _ + rw [C.automorphismLinear_apply, C.automorphism_on_lattice] + rfl + +end NilpotentLatticeCoordinates + +variable {G : Type} [Group G] (N : Subgroup G) [N.Normal] [Group.IsNilpotent N] + (C : NilpotentLatticeCoordinates N) + +def nilpotentConjugationLinear : G →* Module.End ℝ C.carrier := + C.automorphismLinear.comp (MulAut.conjNormal (H := N)) + +theorem nilpotentConjugationLinear_inner_unipotent (t : N) : + IsNilpotent (nilpotentConjugationLinear N C (t : G) - 1) := by + change IsNilpotent (C.automorphismLinear (MulAut.conjNormal (t : G)) - 1) + rw [MulAut.conjNormal_val] + exact C.automorphismLinear_inner_unipotent t + +theorem nilpotentConjugationLinear_commutator_unipotent [IsMulCommutative (G ⧸ N)] + (g h : G) : IsNilpotent (nilpotentConjugationLinear N C ⁅g, h⁆ - 1) := by + have hN : ⁅g, h⁆ ∈ N := by + apply (QuotientGroup.eq_one_iff _).mp + change (QuotientGroup.mk' N) ⁅g, h⁆ = 1 + rw [map_commutatorElement] + exact commutatorElement_eq_one_iff_commute.mpr (Commute.all _ _) + exact nilpotentConjugationLinear_inner_unipotent N C ⟨⁅g, h⁆, hN⟩ + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilpotentLatticeInnerAdjoint.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilpotentLatticeInnerAdjoint.lean new file mode 100644 index 0000000000000000000000000000000000000000..36d664000f409c77bd22232712afbbea609814e0 --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilpotentLatticeInnerAdjoint.lean @@ -0,0 +1,45 @@ +import OAI.GroupTheory.PolycyclicRecognition.Lattices.NilpotentLatticeInnerAction +import OAI.GroupTheory.PolycyclicRecognition.Geometry.PolynomialInnerAdjoint + +namespace OAI + +/-! # The exact inner action on a constructed nilpotent lattice model -/ + +noncomputable section +namespace PolycyclicRecognition.NilpotentLatticeCoordinates +open scoped Manifold +variable {H : Type} [Group H] (C : NilpotentLatticeCoordinates H) + +theorem automorphism_inner_apply (t : H) (v : C.carrier) : + C.automorphism (MulAut.conj t) v = (C.equiv t : C.carrier) * v * (C.equiv t : C.carrier)⁻¹ := by + let u : C.carrier := C.equiv t + let B := polynomialModelLieHom (MulAut.conj u).toMonoidHom + ((contMDiff_conjugation u).of_le (by simp)) + have hB : (B : C.carrier → C.carrier) = fun v => u * v * u⁻¹ := by + funext v + exact polynomialModelLieHom_apply _ _ v + have hpoly : IsPolynomialInBasis C.basis C.basis (fun v => u * v * u⁻¹) := by + rw [← hB] + exact IsPolynomialInBasis.linear B.toLinearMap + have he : (C.automorphism (MulAut.conj t) : C.carrier → C.carrier) = + fun v => u * v * u⁻¹ := C.ext_polynomial (C.automorphism_polynomial _) hpoly (by + intro y + rw [C.automorphism_on_lattice] + simp only [MulAut.conj_apply, map_mul, map_inv, Subgroup.coe_mul, Subgroup.coe_inv] + rfl) + exact congrFun he v + +theorem automorphismLinear_inner_exp (t : H) : + LinearMap.toContinuousLinearMap (C.automorphismLinear (MulAut.conj t)) = + NormedSpace.exp (LinearMap.toContinuousLinearMap (LieAlgebra.ad ℝ C.carrier (C.equiv t))) := by + apply ContinuousLinearMap.ext + intro v + change C.automorphismLinear (MulAut.conj t) v = _ + rw [C.automorphismLinear_apply, C.automorphism_inner_apply t v] + exact polynomial_inner_eq_exp_ad _ _ + +end PolycyclicRecognition.NilpotentLatticeCoordinates + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilpotentLatticeInnerLogarithm.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilpotentLatticeInnerLogarithm.lean new file mode 100644 index 0000000000000000000000000000000000000000..950b03b7fdff565cf9c71d65a9195e06fab206ef --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilpotentLatticeInnerLogarithm.lean @@ -0,0 +1,42 @@ +import OAI.GroupTheory.PolycyclicRecognition.Lattices.NilpotentLatticeInnerAdjoint +import OAI.GroupTheory.PolycyclicRecognition.Algebra.CanonicalNilpotentLogarithm +import OAI.GroupTheory.PolycyclicRecognition.Geometry.AnalyticNilpotentExponential +import Mathlib.Algebra.Lie.Nilpotent + +namespace OAI + +/-! # Inner logarithms in the actual nilpotent lattice model -/ + +noncomputable section +namespace PolycyclicRecognition.NilpotentLatticeCoordinates +variable {H : Type} [Group H] [Group.IsNilpotent H] (C : NilpotentLatticeCoordinates H) +local instance innerLogRationalModule : Module ℚ C.carrier := + Module.compHom C.carrier (algebraMap ℚ ℝ) + +/-- The finite logarithm of a lattice inner automorphism is exactly the inner +Lie derivation, including its normalization at the lattice element. -/ +theorem automorphismLinear_inner_log (t : H) : + nilpotentLog (C.automorphismLinear (MulAut.conj t) - 1) = + LieAlgebra.ad ℝ C.carrier (C.equiv t) := by + let E := Module.End.toContinuousLinearMap (𝕜 := ℝ) C.carrier + let := NormedAlgebra.restrictScalars ℚ ℝ (C.carrier →L[ℝ] C.carrier) + have hn : IsNilpotent (LieAlgebra.ad ℝ C.carrier (C.equiv t)) := + LieModule.isNilpotent_toEnd_of_isNilpotent ℝ C.carrier C.carrier _ + apply E.injective + have he : E (nilpotentLog (C.automorphismLinear (MulAut.conj t) - 1)) = + nilpotentLog (E (C.automorphismLinear (MulAut.conj t) - 1)) := + (nilpotentLog_map E.toRingHom _ (C.automorphismLinear_inner_unipotent t)).symm + rw [he, map_sub, map_one] + change nilpotentLog + (LinearMap.toContinuousLinearMap (C.automorphismLinear (MulAut.conj t)) - 1) = _ + have hn' : IsNilpotent + (LinearMap.toContinuousLinearMap (LieAlgebra.ad ℝ C.carrier (C.equiv t))) := + hn.map E.toRingHom + rw [C.automorphismLinear_inner_exp, analytic_exp_eq_nilpotent_exp hn', nilpotentLog_exp _ hn'] + rfl + +end PolycyclicRecognition.NilpotentLatticeCoordinates + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilpotentLatticeLinearAction.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilpotentLatticeLinearAction.lean new file mode 100644 index 0000000000000000000000000000000000000000..9ef7953ceb5da698c222160123ebf9197d3466c6 --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilpotentLatticeLinearAction.lean @@ -0,0 +1,58 @@ +import OAI.GroupTheory.PolycyclicRecognition.Lattices.NilpotentLatticeAutomorphisms +import Mathlib.LinearAlgebra.Matrix.ToLin + +namespace OAI + +/-! # A faithful linear action of the discrete lattice automorphisms + +The constructed action is the differential of the actual smooth extension. +It is not a separately assumed representation of the discrete group. +-/ + +noncomputable section +namespace PolycyclicRecognition.NilpotentLatticeCoordinates +variable {H : Type} [Group H] (C : PolycyclicRecognition.NilpotentLatticeCoordinates H) + +def automorphismLinear : MulAut H →* Module.End ℝ C.carrier where + toFun a := (C.automorphismLieEquiv a).toLinearMap + map_one' := by + apply LinearMap.ext + intro x + change C.automorphismLieEquiv 1 x = x + rw [C.automorphismLieEquiv_apply, C.automorphism_one] + rfl + map_mul' a b := by + apply LinearMap.ext + intro x + change C.automorphismLieEquiv (a * b) x = + C.automorphismLieEquiv a (C.automorphismLieEquiv b x) + simp only [C.automorphismLieEquiv_apply, C.automorphism_mul, MulAut.mul_apply] + +@[simp] theorem automorphismLinear_apply (a : MulAut H) (x : C.carrier) : + C.automorphismLinear a x = C.automorphism a x := + C.automorphismLieEquiv_apply a x + +theorem automorphismLinear_injective : Function.Injective C.automorphismLinear := by + intro a b h + apply C.automorphism_injective + apply DFunLike.ext + intro x + change C.automorphism a x = C.automorphism b x + have he := congrArg (fun F : Module.End ℝ C.carrier => F x) h + simpa only [C.automorphismLinear_apply] using he + +def automorphismMatrix : MulAut H →* + Matrix.GeneralLinearGroup (Fin C.dimension) ℝ := + (Units.map (LinearMap.toMatrixAlgEquiv C.basis).toMonoidHom).comp + C.automorphismLinear.toHomUnits + +theorem automorphismMatrix_injective : Function.Injective C.automorphismMatrix := by + intro a b h + apply C.automorphismLinear_injective + exact (LinearMap.toMatrixAlgEquiv C.basis).injective (congrArg Units.val h) + +end PolycyclicRecognition.NilpotentLatticeCoordinates + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilpotentLatticeSemisimpleAction.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilpotentLatticeSemisimpleAction.lean new file mode 100644 index 0000000000000000000000000000000000000000..8f8dbf222e7b00a7f4ee752c248c0b75b5e386b6 --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilpotentLatticeSemisimpleAction.lean @@ -0,0 +1,31 @@ +import OAI.GroupTheory.PolycyclicRecognition.Lattices.NilpotentLatticeDerivationLog +import OAI.GroupTheory.PolycyclicRecognition.Geometry.RealSemisimpleLieLogarithm + +namespace OAI + +/-! # Cyclic lattice extensions with semisimple action -/ + +noncomputable section +namespace PolycyclicRecognition.NilpotentLatticeCoordinates +variable {H : Type} [Group H] (C : NilpotentLatticeCoordinates H) + +theorem cyclic_finiteIndex_lattice_of_semisimple (a : MulAut H) + (ha : Module.End.IsSemisimple (C.automorphismLinear a)) : + ∃ Γ : Subgroup (H ⋊[integerPowerAction a] Multiplicative ℤ), Γ.FiniteIndex ∧ + ∃ (S : SimplyConnectedSolvableLieModel) (Λ : Subgroup S.carrier), + IsUniformLattice Λ ∧ Nonempty (Γ ≃* Λ) := by + obtain ⟨m, hm, D, hD⟩ := real_semisimple_lie_automorphism_has_power_log + (C.automorphismLieEquiv a) ha + apply C.cyclic_finiteIndex_lattice_of_derivation_log a hm D + apply ContinuousLinearMap.ext + intro x + have h := congrArg (fun T : Module.End ℝ C.carrier => T x) hD + change _ = (C.automorphismLinear (a ^ m)) x + rw [map_pow] + exact h + +end PolycyclicRecognition.NilpotentLatticeCoordinates + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilpotentLatticeVectorAction.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilpotentLatticeVectorAction.lean new file mode 100644 index 0000000000000000000000000000000000000000..f31c7c1320c7e2c358c59933cbe6e4d808f793ae --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilpotentLatticeVectorAction.lean @@ -0,0 +1,49 @@ +import OAI.GroupTheory.PolycyclicRecognition.Algebra.CommutingDerivationAction +import OAI.GroupTheory.PolycyclicRecognition.Lattices.NilpotentLatticeLinearAction +import OAI.GroupTheory.PolycyclicRecognition.Lattices.IntegralLatticePowerIndex + +namespace OAI + +/-! # Extending an integral abelian action on a nilpotent lattice -/ + +noncomputable section +namespace PolycyclicRecognition.NilpotentLatticeCoordinates +variable {H : Type} [Group H] (C : NilpotentLatticeCoordinates H) + +theorem exists_vector_action {n : ℕ} (ρ : IntegralLatticeGroup n →* MulAut H) : + ∃ m : ℕ, 0 < m ∧ ∃ φ : Multiplicative (Fin n → ℝ) →* MulAut C.carrier, + ContDiff ℝ ⊤ (fun p : (Fin n → ℝ) × C.carrier => φ (Multiplicative.ofAdd p.1) p.2) ∧ + ∀ z x, (C.equiv (ρ (latticePowerHom n m z) x) : C.carrier) = + φ (integerVectorHom n z) (C.equiv x) := by + let A := fun i : Fin n => C.automorphismLieEquiv (ρ (integralLatticeGenerator n i)) + have hA (i j : Fin n) : Commute (A i).toLinearMap (A j).toLinearMap := + ((Commute.all (integralLatticeGenerator n i) (integralLatticeGenerator n j)).map ρ).map + C.automorphismLinear + obtain ⟨m, hm, D, he, hc⟩ := commuting_lie_automorphisms_have_power_logs A hA + let φ := PolynomialExponentialCoordinates.commutingDerivationAction D hc + have hhom : φ.comp (integerVectorHom n) = + C.automorphismHom.comp (ρ.comp (latticePowerHom n m)) := by + apply integralLattice_hom_ext + intro i + apply DFunLike.ext + intro x + change analyticDerivationExp + (derivationCombination D (integerVectorMap n ((Pi.basisFun ℤ (Fin n)) i))) x = + C.automorphism (ρ ((integralLatticeGenerator n i) ^ m)) x + rw [integerVectorMap_basis, derivationCombination_basis, analyticDerivationExp_apply, map_pow] + rw [← C.automorphismLinear_apply, map_pow] + exact DFunLike.congr_fun (he i) x + refine ⟨m, hm, φ, PolynomialExponentialCoordinates.commutingDerivationAction_smooth D hc, ?_⟩ + intro z x + have h := congrArg (fun f : (IntegralLatticeGroup n →* MulAut C.carrier) => + f z (C.equiv x)) hhom + change φ (integerVectorHom n z) (C.equiv x) = + C.automorphism (ρ (latticePowerHom n m z)) (C.equiv x) at h + rw [C.automorphism_on_lattice] at h + exact h.symm + +end PolycyclicRecognition.NilpotentLatticeCoordinates + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilshadowGraphCover.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilshadowGraphCover.lean new file mode 100644 index 0000000000000000000000000000000000000000..e93a29dad1b87a7083a6f1650ba7313cb4c4e69f --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilshadowGraphCover.lean @@ -0,0 +1,65 @@ +import OAI.GroupTheory.PolycyclicRecognition.Lattices.NilshadowGraphTopology +import OAI.GroupTheory.PolycyclicRecognition.Analysis.ScaledIntegralCover + +namespace OAI + +/-! # A compact fundamental cover for the real nilshadow graph -/ + +noncomputable section +namespace PolycyclicRecognition.IntegralNilshadowData +open Set +open scoped Manifold ContDiff +attribute [local instance] factorExtensionTopology semidirectProductTopology +variable {L G : Type} [RealNormedLieAlgebra L] [FiniteDimensional ℝ L] + [P : PolynomialExponentialCoordinates L] [Group G] {n : ℕ} + {E : GroupExtension L G (IntegralLatticeGroup n)} (D : IntegralNilshadowData E) + {m : ℕ} (hm : 0 < m) + (φ : Multiplicative (Fin n → ℝ) →* MulAut D.completion.carrier) + (he : ∀ z x, D.completedAction (latticePowerHom n m z) x = φ (integerVectorHom n z) x) + (hinv : ∀ v x, D.height (φ v x) = D.height x) + (hfix : ∀ v w, φ v (D.quotientSection w) = D.quotientSection w) + +include hfix in +theorem powerGraph_compact_cover : + ∃ K : Set (rotationalTwist φ (D.inverseScaledHeight m) + (fun v x => congrArg (scaleRealHeight n (-((m : ℝ)⁻¹))) (hinv v x))), + IsCompact K ∧ ∀ g, ∃ a k, k ∈ K ∧ D.powerGraphEmbedding hm φ he hinv a * k = g := by + let e := rotationalTwistHomeomorph φ (D.inverseScaledHeight m) + (fun v x => congrArg (scaleRealHeight n (-((m : ℝ)⁻¹))) (hinv v x)) + (D.inverseScaledHeight_smooth m).continuous + obtain ⟨K, hK, hc⟩ := scaledIntegral_compact_cover n hm + refine ⟨(fun k => e.symm (D.quotientSection k)) '' K, + hK.image (e.symm.continuous.comp D.quotientSection.toContinuousLinearMap.continuous), ?_⟩ + intro g + obtain ⟨z, k, hk, hzk⟩ := hc (D.height (e g)) + let b := D.completion.embed (⟨1, latticePowerHom n m z⟩ : FactorExtension D.twistedSystem) + let u := e g * (D.quotientSection k)⁻¹ * b⁻¹ + have hs : D.height (D.quotientSection k) = k := + (D.heightLinear_apply _).symm.trans (D.heightLinear_section k) + have hu : u ∈ D.height.ker := by + change D.height (e g * (D.quotientSection k)⁻¹ * b⁻¹) = 1 + rw [map_mul, map_mul, map_inv, map_inv, hs] + change D.height (e g) + -k + -(D.height b) = 0 + have hb : D.height b = integralRealHeight (latticePowerHom n m z) := D.height_embed _ + rw [hb, ← hzk] + abel + rw [D.completion.height_kernel_eq (FactorExtension.groupExtension D.twistedSystem) + D.height D.height_smooth D.height_embed D.dimension] at hu + obtain ⟨l, hl⟩ := hu + let a : FactorExtension (D.system.pullback (latticePowerHom n m)) := ⟨l, z⟩ + refine ⟨a, e.symm (D.quotientSection k), ⟨k, hk, rfl⟩, ?_⟩ + apply e.injective + change D.completion.embed (⟨l, latticePowerHom n m z⟩ : FactorExtension D.twistedSystem) * + φ (integerVectorHom n z) (D.quotientSection k) = e g + rw [hfix, completion_factorization D.twistedSystem D.completion] + change D.completion.embed (FactorExtension.inl D.twistedSystem l) * b * D.quotientSection k = e g + change D.completion.embed (FactorExtension.inl D.twistedSystem l) = u at hl + rw [hl] + dsimp only [u] + group + +end PolycyclicRecognition.IntegralNilshadowData + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilshadowGraphTopology.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilshadowGraphTopology.lean new file mode 100644 index 0000000000000000000000000000000000000000..66c65e6e1c56cf900c70c15ff8cf382fbc04f0d6 --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilshadowGraphTopology.lean @@ -0,0 +1,40 @@ +import OAI.GroupTheory.PolycyclicRecognition.Lattices.NilshadowPowerGraph +import OAI.GroupTheory.PolycyclicRecognition.Lattices.KernelCompletionEmbedding + +namespace OAI + +/-! # The original topology in the real nilshadow graph -/ + +noncomputable section +namespace PolycyclicRecognition.IntegralNilshadowData +open scoped Manifold ContDiff +attribute [local instance] factorExtensionTopology semidirectProductTopology +variable {L G : Type} [RealNormedLieAlgebra L] [FiniteDimensional ℝ L] + [P : PolynomialExponentialCoordinates L] [Group G] {n : ℕ} + {E : GroupExtension L G (IntegralLatticeGroup n)} (D : IntegralNilshadowData E) + {m : ℕ} (hm : 0 < m) + (φ : Multiplicative (Fin n → ℝ) →* MulAut D.completion.carrier) + (he : ∀ z x, D.completedAction (latticePowerHom n m z) x = φ (integerVectorHom n z) x) + (hinv : ∀ v x, D.height (φ v x) = D.height x) + +theorem powerGraphEmbedding_isEmbedding : Topology.IsEmbedding (D.powerGraphEmbedding hm φ he hinv) := by + let hτ := (D.inverseScaledHeight_smooth m).continuous + let e := rotationalTwistHomeomorph φ (D.inverseScaledHeight m) + (fun v x => congrArg (scaleRealHeight n (-((m : ℝ)⁻¹))) (hinv v x)) hτ + let c : FactorExtension (D.system.pullback (latticePowerHom n m)) ≃ₜ + FactorExtension (D.twistedSystem.pullback (latticePowerHom n m)) := + (factorExtensionHomeomorph _).trans (factorExtensionHomeomorph _).symm + have hc := kernelCompletion_isEmbedding D.twistedSystem D.completion D.height + D.height_smooth D.height_embed + have h := e.symm.isEmbedding.comp (hc.comp + ((factorPowerMap_isClosedEmbedding D.twistedSystem hm).isEmbedding.comp c.isEmbedding)) + convert h using 1 + funext a + apply e.injective + rfl + +end PolycyclicRecognition.IntegralNilshadowData + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilshadowHeight.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilshadowHeight.lean new file mode 100644 index 0000000000000000000000000000000000000000..75a9020745fa3ac6d1aa46eeeed90dd890e177a9 --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilshadowHeight.lean @@ -0,0 +1,105 @@ +import OAI.GroupTheory.PolycyclicRecognition.Lattices.IntegralNilshadow + +namespace OAI + +/-! # A fixed linear section of the nilshadow height + +The section vectors are the logarithmic coordinates of the actual integral +quotient lifts. The removed action fixes them, as well as the height map. +-/ + +noncomputable section +namespace PolycyclicRecognition.IntegralNilshadowData +open scoped Manifold ContDiff +variable {L G : Type} [RealNormedLieAlgebra L] [FiniteDimensional ℝ L] + [P : PolynomialExponentialCoordinates L] [Group G] {n : ℕ} + {E : GroupExtension L G (IntegralLatticeGroup n)} (D : IntegralNilshadowData E) + +def height : D.completion.carrier →* AbelianRealSpace n := + (D.completion.exists_height (FactorExtension.groupExtension D.twistedSystem)).choose + +theorem height_smooth : + ContMDiff (𝓘(ℝ, D.completion.carrier)) (𝓘(ℝ, AbelianRealSpace n)) ∞ D.height := + (D.completion.exists_height (FactorExtension.groupExtension D.twistedSystem)).choose_spec.1 + +theorem height_embed (g : FactorExtension D.twistedSystem) : + D.height (D.completion.embed g) = integralRealHeight g.right := + (D.completion.exists_height (FactorExtension.groupExtension D.twistedSystem)).choose_spec.2 g + +def heightLinear : D.completion.carrier →ₗ[ℝ] AbelianRealSpace n := + (polynomialModelLieHom D.height D.height_smooth).toLinearMap + +theorem heightLinear_apply (x : D.completion.carrier) : D.heightLinear x = D.height x := + polynomialModelLieHom_apply D.height D.height_smooth x + +def quotientBasis (n : ℕ) : Module.Basis (Fin n) ℝ (AbelianRealSpace n) := Pi.basisFun ℝ (Fin n) + +def quotientSection : AbelianRealSpace n →ₗ[ℝ] D.completion.carrier := + (quotientBasis n).constr ℝ + (fun i => D.completion.embed ⟨1, integralLatticeGenerator n i⟩) + +theorem heightLinear_section (v : AbelianRealSpace n) : + D.heightLinear (D.quotientSection v) = v := by + have he : D.heightLinear.comp D.quotientSection = LinearMap.id := by + apply (quotientBasis n).ext + intro i + change D.heightLinear (D.quotientSection ((quotientBasis n) i)) = _ + rw [quotientSection, Module.Basis.constr_basis, heightLinear_apply, height_embed] + exact integerVectorMap_basis i + exact LinearMap.congr_fun he v + +def completedLieAction (q : IntegralLatticeGroup n) : + D.completion.carrier ≃ₗ⁅ℝ⁆ D.completion.carrier := + polynomialModelLieEquiv (D.completedAction q) (D.completedAction_smooth q) + +theorem completedLieAction_height (q : IntegralLatticeGroup n) (x : D.completion.carrier) : + D.heightLinear (D.completedLieAction q x) = D.heightLinear x := by + rw [heightLinear_apply, heightLinear_apply] + change D.height (polynomialModelLieEquiv _ _ x) = D.height x + rw [polynomialModelLieEquiv_apply] + apply D.completion.extendedAction_preserves_hom D.integralAction + D.integralAction_kernel_smooth D.height D.height_smooth + intro q g + rw [height_embed, height_embed] + rfl + +theorem completedLieAction_section (q : IntegralLatticeGroup n) (v : AbelianRealSpace n) : + D.completedLieAction q (D.quotientSection v) = D.quotientSection v := by + have he : (D.completedLieAction q).toLinearMap.comp D.quotientSection = D.quotientSection := by + apply (quotientBasis n).ext + intro i + change D.completedLieAction q (D.quotientSection ((quotientBasis n) i)) = + D.quotientSection ((quotientBasis n) i) + rw [quotientSection, Module.Basis.constr_basis, completedLieAction, + polynomialModelLieEquiv_apply] + change D.completion.extendedAction D.integralAction D.integralAction_kernel_smooth q + (D.completion.embed ⟨1, integralLatticeGenerator n i⟩) = _ + rw [D.completion.extendedAction_embed] + apply congrArg D.completion.embed + apply FactorExtension.ext + · exact map_one (D.removed q) + · rfl + exact LinearMap.congr_fun he v + +def heightProjection : Module.End ℝ D.completion.carrier := + D.quotientSection.comp D.heightLinear + +theorem heightLinear_projection (x : D.completion.carrier) : + D.heightLinear (D.heightProjection x) = D.heightLinear x := + D.heightLinear_section _ + +theorem completedLieAction_projection (q : IntegralLatticeGroup n) (x : D.completion.carrier) : + D.completedLieAction q (D.heightProjection x) = D.heightProjection x := + D.completedLieAction_section q _ + +theorem projection_completedLieAction (q : IntegralLatticeGroup n) (x : D.completion.carrier) : + D.heightProjection (D.completedLieAction q x) = D.heightProjection x := by + change D.quotientSection (D.heightLinear (D.completedLieAction q x)) = + D.quotientSection (D.heightLinear x) + rw [D.completedLieAction_height] + +end PolycyclicRecognition.IntegralNilshadowData + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilshadowLatticeRealization.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilshadowLatticeRealization.lean new file mode 100644 index 0000000000000000000000000000000000000000..d240cae18042505100ffdf52963d460d631d2743 --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilshadowLatticeRealization.lean @@ -0,0 +1,83 @@ +import OAI.GroupTheory.PolycyclicRecognition.Lattices.NilshadowGraphCover +import OAI.GroupTheory.PolycyclicRecognition.Algebra.PolynomialGroupNilpotence +import OAI.GroupTheory.PolycyclicRecognition.Lattices.UniformLatticeFiniteIndexEmbedding +import OAI.GroupTheory.PolycyclicRecognition.Lattices.UniformLatticeEmbedding +import OAI.GroupTheory.PolycyclicRecognition.Lattices.UniformLatticeTransport + +namespace OAI + +/-! # Connected realization of lattices in the original nonsplit extension -/ + +noncomputable section +namespace PolycyclicRecognition.IntegralNilshadowData +open scoped Manifold ContDiff +attribute [local instance] factorExtensionTopology semidirectProductTopology +variable {L G : Type} [RealNormedLieAlgebra L] [FiniteDimensional ℝ L] + [P : PolynomialExponentialCoordinates L] [Group G] {n : ℕ} + {E : GroupExtension L G (IntegralLatticeGroup n)} (D : IntegralNilshadowData E) + +theorem uniform_lattice_realization + (Γ : Subgroup (FactorExtension D.system)) (hΓ : IsUniformLattice Γ) : + ∃ J : Subgroup Γ, J.FiniteIndex ∧ ∃ (S : SimplyConnectedSolvableLieModel) + (Λ : Subgroup S.carrier), IsUniformLattice Λ ∧ Nonempty (J ≃* Λ) := by + let : IsTopologicalGroup L := topologicalGroup_of_lieGroup (𝓘(ℝ, L)) ⊤ + let : IsTopologicalGroup (FactorExtension D.system) := + factorExtensionTopologicalGroup D.system (fun q => by + have h := ((D.smooth q).comp (D.twist_smooth q)).continuous + have heq : (fun x => D.removed q (D.twistedSystem.action q x)) = D.system.action q := by + funext x + exact (D.removed q).apply_symm_apply _ + change Continuous (fun x => D.removed q (D.twistedSystem.action q x)) at h + rwa [heq] at h) + let : Group.IsNilpotent D.completion.carrier := polynomial_group_nilpotent + let : IsTopologicalGroup D.completion.carrier := + topologicalGroup_of_lieGroup (𝓘(ℝ, D.completion.carrier)) ⊤ + obtain ⟨m, hm, φ, hφ, he, hinv, hfix⟩ := D.exists_real_action + let := semidirectProductTopologicalGroup φ hφ.continuous + let F := factorPullbackMap D.system (latticePowerHom n m) + have hFi := factorPullbackMap_injective D.system (latticePowerHom n m) + (latticePowerHom_injective n hm) + have hFe := factorPowerMap_isClosedEmbedding D.system hm + let := factorPowerMap_finiteIndex D.system hm + let Γm := Γ.comap F + have hΓm : IsUniformLattice Γm := hΓ.comap_finiteIndex F hFe + let J := F.range.comap Γ.subtype + have hJ : J.FiniteIndex := inferInstance + let f0 : Γm →* Γ := (F.comp Γm.subtype).codRestrict Γ (fun x => x.property) + let fJ : Γm →* J := f0.codRestrict J (fun x => ⟨x.val, rfl⟩) + have hfJ : Function.Bijective fJ := by + constructor + · intro a b hab + apply Subtype.ext + apply hFi + exact congrArg (fun x : J => ((x : Γ) : FactorExtension D.system)) hab + · intro j + obtain ⟨x, hx⟩ := j.property + have hxΓ : x ∈ Γm := by change F x ∈ Γ; rw [hx]; exact j.val.property + refine ⟨⟨x, hxΓ⟩, ?_⟩ + apply Subtype.ext + apply Subtype.ext + exact hx + let eJ : Γm ≃* J := MulEquiv.ofBijective fJ hfJ + let ψ := D.powerGraphEmbedding hm φ he hinv + have hψ := D.powerGraphEmbedding_isEmbedding hm φ he hinv + obtain ⟨K, hK, hc⟩ := D.powerGraph_compact_cover hm φ he hinv hfix + have hΛ := hΓm.map_of_compact_cover ψ hψ K hK hc + let τ := D.inverseScaledHeight m + let hτ := D.inverseScaledHeight_smooth m + let hi := fun v x => congrArg (scaleRealHeight n (-((m : ℝ)⁻¹))) (hinv v x) + let S := invariantGraphLieModel φ τ hi hφ hτ + let eS := invariantGraphModelEquiv φ τ hi hφ hτ + let Λ := (Γm.map ψ).comap eS.toMonoidHom + have hΛS : IsUniformLattice Λ := hΛ.comap_mulEquiv eS + (invariantGraphModelEquiv_continuous φ τ hi hφ hτ) + (invariantGraphModelEquiv_symm_continuous φ τ hi hφ hτ) + let eψ : Γm ≃* Γm.map ψ := Γm.equivMapOfInjective ψ hψ.injective + exact ⟨J, hJ, S, Λ, hΛS, + ⟨eJ.symm.trans (eψ.trans (comapSubgroupEquiv eS (Γm.map ψ)).symm)⟩⟩ + +end PolycyclicRecognition.IntegralNilshadowData + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilshadowPowerGraph.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilshadowPowerGraph.lean new file mode 100644 index 0000000000000000000000000000000000000000..518d504a71297734969be2e20160c90eb1946588 --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilshadowPowerGraph.lean @@ -0,0 +1,116 @@ +import OAI.GroupTheory.PolycyclicRecognition.Lattices.NilshadowRealAction +import OAI.GroupTheory.PolycyclicRecognition.Algebra.FactorSystemPullback +import OAI.GroupTheory.PolycyclicRecognition.Geometry.InvariantGraphLieModel + +namespace OAI + +/-! # Embedding the finite-power extension in the real invariant graph -/ + +noncomputable section +namespace PolycyclicRecognition +open scoped Manifold ContDiff + +def scaleRealHeight (n : ℕ) (a : ℝ) : AbelianRealSpace n →* Multiplicative (Fin n → ℝ) where + toFun x := Multiplicative.ofAdd (a • x) + map_one' := by + apply Multiplicative.ext + exact smul_zero a + map_mul' x y := by + apply Multiplicative.ext + exact smul_add a x y + +namespace IntegralNilshadowData +variable {L G : Type} [RealNormedLieAlgebra L] [FiniteDimensional ℝ L] + [P : PolynomialExponentialCoordinates L] [Group G] {n : ℕ} + {E : GroupExtension L G (IntegralLatticeGroup n)} (D : IntegralNilshadowData E) + +def inverseScaledHeight (m : ℕ) : D.completion.carrier →* Multiplicative (Fin n → ℝ) := + (scaleRealHeight n (-((m : ℝ)⁻¹))).comp D.height + +theorem inverseScaledHeight_smooth (m : ℕ) : + ContDiff ℝ ⊤ (fun x => (D.inverseScaledHeight m x).toAdd) := by + have h : ContDiff ℝ ⊤ (fun x => -((m : ℝ)⁻¹) • D.heightLinear x) := + ((-((m : ℝ)⁻¹)) • D.heightLinear).toContinuousLinearMap.contDiff + have hf : (fun x => (D.inverseScaledHeight m x).toAdd) = + (fun x => -((m : ℝ)⁻¹) • D.heightLinear x) := by + funext x + exact congrArg (fun y => -((m : ℝ)⁻¹) • y) (D.heightLinear_apply x).symm + rw [hf] + exact h + +def factorEmbedding : FactorExtension D.system →* + (D.completion.carrier ⋊[D.completedAction] IntegralLatticeGroup n) := + D.completionSemidirectMap.comp + (factorTwistGraph D.system D.removed D.commutes D.fixes) + +def realPowerEmbedding (m : ℕ) + (φ : Multiplicative (Fin n → ℝ) →* MulAut D.completion.carrier) + (he : ∀ z x, D.completedAction (latticePowerHom n m z) x = φ (integerVectorHom n z) x) : + FactorExtension (D.system.pullback (latticePowerHom n m)) →* + (D.completion.carrier ⋊[φ] Multiplicative (Fin n → ℝ)) where + toFun a := ⟨D.completion.embed ⟨a.left, latticePowerHom n m a.right⟩, integerVectorHom n a.right⟩ + map_one' := by + apply SemidirectProduct.ext + · change D.completion.embed (1 : FactorExtension D.twistedSystem) = 1 + exact map_one _ + · exact map_one _ + map_mul' a b := by + apply SemidirectProduct.ext + · have h := congrArg (fun x => x.left) + ((D.factorEmbedding.comp (factorPullbackMap D.system (latticePowerHom n m))).map_mul a b) + change D.completion.embed + ⟨(a * b).left, latticePowerHom n m (a * b).right⟩ = + D.completion.embed ⟨a.left, latticePowerHom n m a.right⟩ * + D.completedAction (latticePowerHom n m a.right) + (D.completion.embed ⟨b.left, latticePowerHom n m b.right⟩) at h + rw [he] at h + exact h + · exact map_mul (integerVectorHom n) _ _ + +theorem realPowerEmbedding_injective (m : ℕ) + (φ : Multiplicative (Fin n → ℝ) →* MulAut D.completion.carrier) + (he : ∀ z x, D.completedAction (latticePowerHom n m z) x = φ (integerVectorHom n z) x) : + Function.Injective (D.realPowerEmbedding m φ he) := by + intro a b h + apply FactorExtension.ext + · have hx := D.completion.injective (congrArg (fun x => x.left) h) + exact congrArg (fun z : FactorExtension D.twistedSystem => z.left) hx + · exact integerVectorHom_injective n (congrArg (fun x => x.right) h) + +theorem realPowerEmbedding_mem_graph {m : ℕ} (hm : 0 < m) + (φ : Multiplicative (Fin n → ℝ) →* MulAut D.completion.carrier) + (he : ∀ z x, D.completedAction (latticePowerHom n m z) x = φ (integerVectorHom n z) x) + (hinv : ∀ v x, D.height (φ v x) = D.height x) + (a : FactorExtension (D.system.pullback (latticePowerHom n m))) : + D.realPowerEmbedding m φ he a ∈ rotationalTwist φ (D.inverseScaledHeight m) + (fun v x => congrArg (scaleRealHeight n (-((m : ℝ)⁻¹))) (hinv v x)) := by + change integerVectorHom n a.right = + (D.inverseScaledHeight m (D.completion.embed ⟨a.left, latticePowerHom n m a.right⟩))⁻¹ + apply Multiplicative.ext + change integerVectorMap n a.right.toAdd = + -(-((m : ℝ)⁻¹) • D.height (D.completion.embed ⟨a.left, latticePowerHom n m a.right⟩)) + rw [D.height_embed] + change integerVectorMap n a.right.toAdd = + -(-((m : ℝ)⁻¹) • integralRealHeight (a.right ^ m)) + rw [map_pow] + change integerVectorMap n a.right.toAdd = + -(-((m : ℝ)⁻¹) • (m • integerVectorMap n a.right.toAdd)) + rw [← Nat.cast_smul_eq_nsmul ℝ, smul_smul] + have hm' : (m : ℝ) ≠ 0 := by exact_mod_cast Nat.ne_of_gt hm + simp [hm'] + +def powerGraphEmbedding {m : ℕ} (hm : 0 < m) + (φ : Multiplicative (Fin n → ℝ) →* MulAut D.completion.carrier) + (he : ∀ z x, D.completedAction (latticePowerHom n m z) x = φ (integerVectorHom n z) x) + (hinv : ∀ v x, D.height (φ v x) = D.height x) : + FactorExtension (D.system.pullback (latticePowerHom n m)) →* + rotationalTwist φ (D.inverseScaledHeight m) + (fun v x => congrArg (scaleRealHeight n (-((m : ℝ)⁻¹))) (hinv v x)) := + (D.realPowerEmbedding m φ he).codRestrict _ (D.realPowerEmbedding_mem_graph hm φ he hinv) + +end IntegralNilshadowData +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilshadowRealAction.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilshadowRealAction.lean new file mode 100644 index 0000000000000000000000000000000000000000..9a528d02d80a9a7463b12e1bfe02aa0d184d220f --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilshadowRealAction.lean @@ -0,0 +1,97 @@ +import OAI.GroupTheory.PolycyclicRecognition.Lattices.NilshadowHeight +import OAI.GroupTheory.PolycyclicRecognition.Algebra.FixedLogQuotient +import OAI.GroupTheory.PolycyclicRecognition.Algebra.CommutingDerivationAction +import OAI.GroupTheory.PolycyclicRecognition.Lattices.IntegralLatticePowerIndex + +namespace OAI + +/-! # The real nilshadow action preserves the actual height + +The logarithms vanish on the fixed quotient section. Commutation with its +projection therefore forces the complete real action to preserve height, +not merely its integral-time values. +-/ + +noncomputable section +namespace PolycyclicRecognition.IntegralNilshadowData +open scoped Manifold ContDiff +attribute [local instance] LieRing.ofAssociativeRing +variable {L G : Type} [RealNormedLieAlgebra L] [FiniteDimensional ℝ L] + [P : PolynomialExponentialCoordinates L] [Group G] {n : ℕ} + {E : GroupExtension L G (IntegralLatticeGroup n)} (D : IntegralNilshadowData E) + +theorem exists_real_action : + ∃ m : ℕ, 0 < m ∧ ∃ φ : Multiplicative (Fin n → ℝ) →* MulAut D.completion.carrier, + ContDiff ℝ ⊤ (fun p : (Fin n → ℝ) × D.completion.carrier => + φ (Multiplicative.ofAdd p.1) p.2) ∧ + (∀ z x, D.completedAction (latticePowerHom n m z) x = φ (integerVectorHom n z) x) ∧ + (∀ v x, D.height (φ v x) = D.height x) ∧ + ∀ v w, φ v (D.quotientSection w) = D.quotientSection w := by + let A := fun i : Fin n => D.completedLieAction (integralLatticeGenerator n i) + have hA (i j : Fin n) : Commute (A i).toLinearMap (A j).toLinearMap := by + apply LinearMap.ext + intro x + change A i (A j x) = A j (A i x) + simp only [A, completedLieAction, polynomialModelLieEquiv_apply] + exact DFunLike.congr_fun + (((show Commute (integralLatticeGenerator n i) (integralLatticeGenerator n j) + from Commute.all _ _).map D.completedAction).eq) x + obtain ⟨m, hm, B, he, hc, hcomm, hfixed⟩ := + commuting_lie_automorphisms_have_fixed_power_logs A hA + let φ := PolynomialExponentialCoordinates.commutingDerivationAction B hc + have hp (i : Fin n) : D.heightProjection * (B i).toLinearMap = 0 := + fixed_log_projection_zero (A i) (B i) (hcomm i) (hfixed i) D.heightProjection + (D.completedLieAction_projection _) (D.projection_completedLieAction _) + have hbp (i : Fin n) : (B i).toLinearMap * D.heightProjection = 0 := by + apply LinearMap.ext + intro x + exact hfixed i _ (D.completedLieAction_projection _ x) + have hprod (i : Fin n) (k : ℕ) (x : D.completion.carrier) : + ((A i).toLinearMap ^ k) x = D.completedAction ((integralLatticeGenerator n i) ^ k) x := by + induction k generalizing x with + | zero => simp only [pow_zero, map_one, Module.End.one_apply, MulAut.one_apply] + | succ k ih => + rw [pow_succ', Module.End.mul_apply, ih, pow_succ', map_mul] + exact polynomialModelLieEquiv_apply _ _ _ + have hhom : φ.comp (integerVectorHom n) = D.completedAction.comp (latticePowerHom n m) := by + apply integralLattice_hom_ext + intro i + apply DFunLike.ext + intro x + change analyticDerivationExp + (derivationCombination B (integerVectorMap n ((Pi.basisFun ℤ (Fin n)) i))) x = + D.completedAction ((integralLatticeGenerator n i) ^ m) x + rw [integerVectorMap_basis, derivationCombination_basis, analyticDerivationExp_apply] + exact (DFunLike.congr_fun (he i) x).trans (hprod i m x) + refine ⟨m, hm, φ, PolynomialExponentialCoordinates.commutingDerivationAction_smooth B hc, + fun z x => (congrArg (fun F : IntegralLatticeGroup n →* MulAut D.completion.carrier => F z x) + hhom).symm, ?_⟩ + constructor + · intro v x + have hpv : D.heightProjection * (derivationCombination B v.toAdd).toLinearMap = 0 := by + let F := (LieDerivation.toLinearMapLieHom ℝ D.completion.carrier).toLinearMap + change D.heightProjection * F (∑ i, v.toAdd i • B i) = 0 + simp only [map_sum, map_smul, Finset.mul_sum, mul_smul_comm] + change (∑ i, v.toAdd i • (D.heightProjection * (B i).toLinearMap)) = 0 + simp only [hp, smul_zero, Finset.sum_const_zero] + rw [← D.heightLinear_apply, ← D.heightLinear_apply] + exact exp_preserves_projected_quotient _ _ hpv D.heightLinear D.heightLinear_projection x + · intro v w + have hpv : (derivationCombination B v.toAdd).toLinearMap * D.heightProjection = 0 := by + let F := (LieDerivation.toLinearMapLieHom ℝ D.completion.carrier).toLinearMap + change F (∑ i, v.toAdd i • B i) * D.heightProjection = 0 + simp only [map_sum, map_smul, Finset.sum_mul, smul_mul_assoc] + change (∑ i, v.toAdd i • ((B i).toLinearMap * D.heightProjection)) = 0 + simp only [hbp, smul_zero, Finset.sum_const_zero] + have hpw : D.heightProjection (D.quotientSection w) = D.quotientSection w := by + change D.quotientSection (D.heightLinear (D.quotientSection w)) = _ + rw [D.heightLinear_section] + have h := exp_fixes_projection _ _ hpv (D.quotientSection w) + rw [hpw] at h + exact h + +end PolycyclicRecognition.IntegralNilshadowData + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilshadowWeightAction.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilshadowWeightAction.lean new file mode 100644 index 0000000000000000000000000000000000000000..3d41cd2223eff9007a1f90a684835eae5e09d1fb --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/NilshadowWeightAction.lean @@ -0,0 +1,123 @@ +import OAI.GroupTheory.PolycyclicRecognition.Lattices.CartanNilshadow + +namespace OAI + +/-! # The original solvable algebra as an extension of its nilshadow -/ + +noncomputable section +namespace PolycyclicRecognition + +open LieAlgebra Module + +variable {L : Type*} [LieRing L] [LieAlgebra ℝ L] [FiniteDimensional ℝ L] + {n : ℕ} (T : TriangularAdjoint L n) + (H : LieSubalgebra ℝ L) [H.IsCartanSubalgebra] + +local notation "K" => CartanNilshadow T H +local notation "σ" => heightSemisimpleAction T H +local notation "e" => cartanNilshadowEquiv T H + +theorem heightSemisimpleAction_apply_commute (x y z : L) : σ x (σ y z) = σ y (σ x z) := by + have h := DFunLike.congr_fun (heightSemisimpleAction_commute T H x y) z + exact sub_eq_zero.mp h + +theorem cartanNilshadow_bracket_symm (p q : K) : + (e).symm ⁅p, q⁆ = ⁅(e).symm p, (e).symm q⁆ - σ ((e).symm p) ((e).symm q) + + σ ((e).symm q) ((e).symm p) := by + obtain ⟨x, rfl⟩ := (e).surjective p + obtain ⟨y, rfl⟩ := (e).surjective q + simpa only [LinearEquiv.symm_apply_apply] using cartanNilshadow_bracket T H x y + +theorem semisimple_derives_nilshadow_bracket (x y z : L) : + σ x (⁅y, z⁆ - σ y z + σ z y) = + (⁅y, σ x z⁆ - σ y (σ x z) + σ (σ x z) y) + + (⁅σ x y, z⁆ - σ (σ x y) z + σ z (σ x y)) := by + simp only [map_add, map_sub, LieDerivation.apply_lie_eq_add, + heightSemisimpleAction_annihilate, LieDerivation.zero_apply, sub_zero, add_zero] + rw [heightSemisimpleAction_apply_commute T H x y z, + heightSemisimpleAction_apply_commute T H x z y] + abel + +def nilshadowWeightOperator (x : L) : K →ₗ[ℝ] K := + (e).toLinearMap.comp ((σ x).toLinearMap.comp (e).symm.toLinearMap) + +@[simp] +theorem nilshadowWeightOperator_symm (x : L) (p : K) : + (e).symm (nilshadowWeightOperator T H x p) = σ x ((e).symm p) := + (e).symm_apply_apply _ + +def nilshadowWeightDerivation (x : L) : LieDerivation ℝ K K where + toLinearMap := nilshadowWeightOperator T H x + leibniz' p q := by + rw [← lie_skew q (nilshadowWeightOperator T H x p), sub_neg_eq_add] + apply (e).symm.injective + rw [map_add, nilshadowWeightOperator_symm, cartanNilshadow_bracket_symm, + cartanNilshadow_bracket_symm, cartanNilshadow_bracket_symm, + nilshadowWeightOperator_symm, nilshadowWeightOperator_symm] + exact semisimple_derives_nilshadow_bracket T H x ((e).symm p) ((e).symm q) + +@[simp] +theorem nilshadowWeightDerivation_symm (x : L) (p : K) : + (e).symm (nilshadowWeightDerivation T H x p) = σ x ((e).symm p) := + nilshadowWeightOperator_symm T H x p + +theorem nilshadowWeightDerivation_equiv (x y : L) : + nilshadowWeightDerivation T H x (e y) = e (σ x y) := by + apply (e).symm.injective + simp only [nilshadowWeightDerivation_symm, LinearEquiv.symm_apply_apply] + +def nilshadowWeightAction : L →ₗ⁅ℝ⁆ LieDerivation ℝ K K where + toFun := nilshadowWeightDerivation T H + map_add' x y := by + apply LieDerivation.ext + intro p + apply (e).symm.injective + simp only [LieDerivation.add_apply, map_add, nilshadowWeightDerivation_symm, + LieDerivation.add_apply] + map_smul' r x := by + apply LieDerivation.ext + intro p + apply (e).symm.injective + simp only [LieDerivation.smul_apply, map_smul, nilshadowWeightDerivation_symm, + RingHom.id_apply, LieDerivation.smul_apply] + map_lie' {x y} := by + apply LieDerivation.ext + intro p + apply (e).symm.injective + simp only [LieDerivation.lie_apply, map_sub, nilshadowWeightDerivation_symm, + heightSemisimpleAction_lie, LieDerivation.zero_apply, + heightSemisimpleAction_apply_commute T H x y, sub_self] + +def nilshadowSemidirectEmbedding : + L →ₗ⁅ℝ⁆ K ⋊⁅(nilshadowWeightAction T H).range.incl⁆ (nilshadowWeightAction T H).range where + toFun x := ⟨e x, (nilshadowWeightAction T H).rangeRestrict x⟩ + map_add' x y := by + apply SemiDirectSum.ext + · exact (e).map_add x y + · exact map_add _ _ _ + map_smul' r x := by + apply SemiDirectSum.ext + · exact (e).map_smul r x + · exact map_smul _ _ _ + map_lie' {x y} := by + apply SemiDirectSum.ext + · apply (e).symm.injective + change (e).symm (e ⁅x, y⁆) = (e).symm (⁅e x, e y⁆ + + nilshadowWeightDerivation T H x (e y) - nilshadowWeightDerivation T H y (e x)) + rw [LinearEquiv.symm_apply_apply, map_sub, map_add, + cartanNilshadow_bracket, nilshadowWeightDerivation_symm, + nilshadowWeightDerivation_symm, LinearEquiv.symm_apply_apply, + LinearEquiv.symm_apply_apply] + abel + · exact LieHom.map_lie _ x y + +theorem nilshadowSemidirectEmbedding_injective : + Function.Injective (nilshadowSemidirectEmbedding T H) := by + intro x y h + exact (e).injective (congrArg SemiDirectSum.left h) + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/OrderedCyclicLatticeExtension.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/OrderedCyclicLatticeExtension.lean new file mode 100644 index 0000000000000000000000000000000000000000..110d0e885b1e503543648a002112c0ec66e2da85 --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/OrderedCyclicLatticeExtension.lean @@ -0,0 +1,41 @@ +import OAI.GroupTheory.PolycyclicRecognition.Lattices.LatticeWordExtension +import OAI.GroupTheory.PolycyclicRecognition.Lattices.NilpotentCyclicLatticeExtension + +namespace OAI + +/-! # The cyclic lattice step with its automorphism extension constructed + +Only the kernel's ordered polynomial coordinates are supplied. Conjugation +extends by real generator powers; its finite logarithm supplies the real +action in the new Lie model. +-/ + +noncomputable section +namespace PolycyclicRecognition +open Module +variable {H L : Type} [Group H] [RealNormedLieAlgebra L] [FiniteDimensional ℝ L] + [P : PolynomialExponentialCoordinates L] [Group.IsSolvable L] + +theorem ordered_cyclic_lattice_extension (a : MulAut H) + [Group.IsNilpotent (H ⋊[integerPowerAction a] Multiplicative ℤ)] + {d : ℕ} (b : Basis (Fin d) ℝ L) (p : L ≃ L) + (hp : IsPolynomialInBasis b b p) (hq : IsPolynomialInBasis b b p.symm) + (Λ : Subgroup L) (hΛ : IsUniformLattice Λ) (e : H ≃* Λ) + (X : Fin d → H) (hX : Function.Surjective (orderedWord X)) + (hparam : ∀ z : Fin d → ℤ, + p (b.equivFun.symm (fun i => (z i : ℝ))) = (e (orderedWord X z) : L)) : + ∃ (S : SimplyConnectedSolvableLieModel) (Γ : Subgroup S.carrier), + IsUniformLattice Γ ∧ + Nonempty ((H ⋊[integerPowerAction a] Multiplicative ℤ) ≃* Γ) := by + let j := Λ.subtype.comp e.toMonoidHom + exact nilpotent_cyclic_lattice_extension a b p hp p.surjective Λ hΛ e + (fun z => ⟨orderedWord X z, (hparam z).symm⟩) + (latticeWordAut b p j X hp hq hparam hX a) + (contMDiff_latticeWordAut b p j X hp hq hparam hX a) + (latticeWordAut_on_lattice b p j X hp hq hparam hX a) + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/OriginalLatticeComparison.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/OriginalLatticeComparison.lean new file mode 100644 index 0000000000000000000000000000000000000000..261ed5bc3355beff4b857a76fd52a88b58e18e13 --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/OriginalLatticeComparison.lean @@ -0,0 +1,46 @@ +import OAI.GroupTheory.PolycyclicRecognition.Analysis.CoarseEquivalenceMetric +import OAI.GroupTheory.PolycyclicRecognition.Lattices.LatticeMetricChains +import OAI.GroupTheory.PolycyclicRecognition.Geometry.LieModelMetric + +namespace OAI + +/-! # Metric comparison with the original finite-index lattice model -/ + +noncomputable section +namespace PolycyclicRecognition + +open scoped Manifold + +/-- The discrete finite-index and lattice comparisons become a metric +quasi-equivalence in the chosen ambient metric. The linear-chain condition +on the original group makes explicit the word-metric scope. -/ +theorem nonempty_original_lattice_comparison + {P : Type} [Group P] [MetricSpace P] [IsIsometricSMul P P] + (CP : LinearMetricChains P) + (hfinite : ∀ R : ℝ, (Metric.closedBall (1 : P) R).Finite) + (Γ : Subgroup P) (hΓ : Γ.FiniteIndex) + (S : SimplyConnectedSolvableLieModel) (Λ : Subgroup S.carrier) + (hΛ : IsUniformLattice Λ) (iso : Γ ≃* Λ) (dS : ProperChainMetric S.carrier) : + letI := dS.compatibleMetric + Nonempty (MetricQuasiEquivalence P S.carrier) := by + let := hΓ + let := dS.compatibleMetric + let := dS.proper_compatibleMetric + let := dS.isometric_compatibleMetric + let : IsTopologicalGroup S.carrier := + topologicalGroup_of_lieGroup (𝓘(ℝ, S.modelSpace)) ⊤ + let : IsIsometricSMul Λ Λ := ⟨fun γ => Isometry.of_dist_eq (fun x y => by + change dist ((γ : S.carrier) * (x : S.carrier)) ((γ : S.carrier) * (y : S.carrier)) = _ + exact dist_mul_left (γ : S.carrier) (x : S.carrier) (y : S.carrier))⟩ + obtain ⟨CΛ⟩ := hΛ.nonempty_linearMetricChains dS.chains_compatibleMetric + let ePΛ := ((finiteIndexCoarseEquivalence Γ).symm.trans + (PolycyclicRecognition.MulEquiv.groupCoarseEquivalence iso)).metric + CP CΛ hfinite hΛ.finite_closedBall + obtain ⟨eΛS⟩ := hΛ.nonempty_metricQuasiEquivalence + exact ⟨ePΛ.trans eΛS⟩ + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/PolycyclicLatticeRealization.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/PolycyclicLatticeRealization.lean new file mode 100644 index 0000000000000000000000000000000000000000..9d810e43158febbdae0101812f5d174cca792714 --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/PolycyclicLatticeRealization.lean @@ -0,0 +1,65 @@ +import OAI.GroupTheory.PolycyclicRecognition.Algebra.NilpotentByAbelianRealization +import OAI.GroupTheory.PolycyclicRecognition.Algebra.PolycyclicExtensionDimension + +namespace OAI + +/-! # The lattice-realization consequence of Dekimpe's theorem + +All extensions used here are actual group extensions. The nilshadow +construction supplies the connected Lie model without a splitting premise. +-/ + +noncomputable section +namespace PolycyclicRecognition +open scoped Manifold + +theorem IsPolycyclic.exists_solvable_finiteDimension {G : Type} [Group G] + (hG : IsPolycyclic G) : + ∃ H : Subgroup G, H.FiniteIndex ∧ Group.IsSolvable H ∧ + HasFiniteIntegralCohomologicalDimension H := by + let B : Subgroup G := ⊥ + let : Group.FG B := finitelyGenerated_of_isCyclic + have hB : ∃ V : Subgroup B, V.FiniteIndex ∧ Group.IsSolvable V ∧ + HasFiniteIntegralCohomologicalDimension V := by + let V : Subgroup B := ⊤ + let : Group.IsSolvable V := Group.isSolvable_of_comm (fun _ _ => Subsingleton.elim _ _) + exact ⟨V, inferInstance, inferInstance, + (poincareDuality_zero_of_subsingleton V).finiteCohomologicalDimension V⟩ + exact exists_solvable_finiteDimension_of_virtuallyPolycyclic_quotient B hB + (hG.of_surjective (QuotientGroup.mk' B) (QuotientGroup.mk'_surjective B)).isVirtuallyPolycyclic + +theorem virtuallyPolycyclic_uniform_lattice {G : Type} [Group G] + (hG : IsVirtuallyPolycyclic G) : + ∃ K : Subgroup G, K.FiniteIndex ∧ ∃ (S : SimplyConnectedSolvableLieModel) + (Λ : Subgroup S.carrier), IsUniformLattice Λ ∧ Nonempty (K ≃* Λ) := by + obtain ⟨P, hPi, hP⟩ := hG + let := hPi + apply uniform_lattice_realization_of_finiteIndex P + obtain ⟨H, hHi, hHs, hHcd⟩ := hP.exists_solvable_finiteDimension + let := hHi + let := hHs + apply uniform_lattice_realization_of_finiteIndex H + obtain ⟨V, hVn, hVi, N, hNn, hNnil, hQ⟩ := + exists_finiteIndex_nilpotent_by_abelian hHcd + let := hVi + let := hNn + let := hNnil + let := hQ + apply uniform_lattice_realization_of_finiteIndex V + have hVpoly : IsPolycyclic V := + (hP.of_injective H.subtype Subtype.val_injective).of_injective V.subtype Subtype.val_injective + exact nilpotent_by_abelian_uniform_lattice hVpoly (hHcd.subgroup V).torsionFree N + +/-- Dekimpe's lattice-realization conclusion follows from nilpotent completion +and the invariant graph construction. -/ +theorem dekimpeLatticeRealizationInput : DekimpeLatticeRealizationInput := by + intro G _ hG + obtain ⟨K, hK, S, Λ, hΛ, e⟩ := virtuallyPolycyclic_uniform_lattice hG + let : IsTopologicalGroup S.carrier := topologicalGroup_of_lieGroup (𝓘(ℝ, S.modelSpace)) ⊤ + exact ⟨K, hK, S, Λ, hΛ.1, hΛ.compactSpace_quotient, e⟩ + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/PolynomialLatticeExtension.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/PolynomialLatticeExtension.lean new file mode 100644 index 0000000000000000000000000000000000000000..2f60b196bc80d07815009226d3cae1aa1b07c6f2 --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/PolynomialLatticeExtension.lean @@ -0,0 +1,98 @@ +import OAI.GroupTheory.PolycyclicRecognition.Algebra.PolynomialIntegerGrid + +namespace OAI + +/-! # Polynomial maps of lattices extend as group maps + +Multiplication identities on integral coordinates determine the identity on +all real coordinates. Polynomial inverse identities extend in the same way. +-/ + +noncomputable section +namespace PolycyclicRecognition +variable {I J : Type*} [gI : Group (I → ℝ)] [gJ : Group (J → ℝ)] + +local instance sourcePolynomialGroupMul : Mul (I → ℝ) := gI.toMul +local instance sourcePolynomialGroupOne : One (I → ℝ) := gI.toOne +local instance targetPolynomialGroupMul : Mul (J → ℝ) := gJ.toMul +local instance targetPolynomialGroupOne : One (J → ℝ) := gJ.toOne +local instance sourcePolynomialGroupMonoid : Monoid (I → ℝ) := gI.toMonoid +local instance sourcePolynomialGroupMulOneClass : MulOneClass (I → ℝ) := gI.toMulOneClass +local instance targetPolynomialGroupMonoid : Monoid (J → ℝ) := gJ.toMonoid +local instance targetPolynomialGroupMulOneClass : MulOneClass (J → ℝ) := gJ.toMulOneClass + +theorem coordinatePolynomial_mul_of_integer_mul + {f : (I → ℝ) → (J → ℝ)} (hf : IsCoordinatePolynomial f) + (hI : IsCoordinatePolynomial + (fun p : (I ⊕ I) → ℝ => (p ∘ Sum.inl) * (p ∘ Sum.inr))) + (hJ : IsCoordinatePolynomial + (fun p : (J ⊕ J) → ℝ => (p ∘ Sum.inl) * (p ∘ Sum.inr))) + (h : ∀ x y : I → ℤ, + f ((fun i => (x i : ℝ)) * (fun i => (y i : ℝ))) = + f (fun i => (x i : ℝ)) * f (fun i => (y i : ℝ))) : + ∀ x y : I → ℝ, f (x * y) = f x * f y := by + have hl := hf.comp hI + have hp := (hf.comp (IsCoordinatePolynomial.reindex (Sum.inl : I → I ⊕ I))).pair + (hf.comp (IsCoordinatePolynomial.reindex (Sum.inr : I → I ⊕ I))) + have hr := hJ.comp hp + have heq : (fun p : (I ⊕ I) → ℝ => f ((p ∘ Sum.inl) * (p ∘ Sum.inr))) = + (fun p : (I ⊕ I) → ℝ => f (p ∘ Sum.inl) * f (p ∘ Sum.inr)) := by + apply IsCoordinatePolynomial.ext_integer_grid hl hr + intro z + exact h (z ∘ Sum.inl) (z ∘ Sum.inr) + intro x y + have hh := congrFun heq (Sum.elim x y) + simpa only [Function.comp_def, Sum.elim_inl, Sum.elim_inr] using hh + +def coordinatePolynomialHomFromIntegerGrid + {f : (I → ℝ) → (J → ℝ)} (hf : IsCoordinatePolynomial f) + (hI : IsCoordinatePolynomial + (fun p : (I ⊕ I) → ℝ => (p ∘ Sum.inl) * (p ∘ Sum.inr))) + (hJ : IsCoordinatePolynomial + (fun p : (J ⊕ J) → ℝ => (p ∘ Sum.inl) * (p ∘ Sum.inr))) + (h : ∀ x y : I → ℤ, + f ((fun i => (x i : ℝ)) * (fun i => (y i : ℝ))) = + f (fun i => (x i : ℝ)) * f (fun i => (y i : ℝ))) : + (I → ℝ) →* (J → ℝ) where + toFun := f + map_one' := by + have hh := coordinatePolynomial_mul_of_integer_mul hf hI hJ h 1 1 + rw [one_mul] at hh + exact (mul_left_cancel ((mul_one (f 1)).trans hh)).symm + map_mul' := coordinatePolynomial_mul_of_integer_mul hf hI hJ h + +omit gI gJ in +theorem coordinatePolynomial_leftInverse_of_integer + {f : (I → ℝ) → (J → ℝ)} {g : (J → ℝ) → (I → ℝ)} + (hf : IsCoordinatePolynomial f) (hg : IsCoordinatePolynomial g) + (h : ∀ x : I → ℤ, g (f (fun i => (x i : ℝ))) = (fun i => (x i : ℝ))) : + Function.LeftInverse g f := by + have hi := IsCoordinatePolynomial.reindex (id : I → I) + have heq : g ∘ f = id := + (hg.comp hf).ext_integer_grid hi h + exact congrFun heq + +def coordinatePolynomialEquivFromIntegerGrid + {f : (I → ℝ) → (J → ℝ)} {g : (J → ℝ) → (I → ℝ)} + (hf : IsCoordinatePolynomial f) (hg : IsCoordinatePolynomial g) + (hI : IsCoordinatePolynomial + (fun p : (I ⊕ I) → ℝ => (p ∘ Sum.inl) * (p ∘ Sum.inr))) + (hJ : IsCoordinatePolynomial + (fun p : (J ⊕ J) → ℝ => (p ∘ Sum.inl) * (p ∘ Sum.inr))) + (hmul : ∀ x y : I → ℤ, + f ((fun i => (x i : ℝ)) * (fun i => (y i : ℝ))) = + f (fun i => (x i : ℝ)) * f (fun i => (y i : ℝ))) + (hleft : ∀ x : I → ℤ, g (f (fun i => (x i : ℝ))) = (fun i => (x i : ℝ))) + (hright : ∀ y : J → ℤ, f (g (fun j => (y j : ℝ))) = (fun j => (y j : ℝ))) : + (I → ℝ) ≃* (J → ℝ) where + toFun := f + invFun := g + left_inv := coordinatePolynomial_leftInverse_of_integer hf hg hleft + right_inv := coordinatePolynomial_leftInverse_of_integer hg hf hright + map_mul' := coordinatePolynomial_mul_of_integer_mul hf hI hJ hmul + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/RealActionIntegerLattice.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/RealActionIntegerLattice.lean new file mode 100644 index 0000000000000000000000000000000000000000..17137f1614fb77ccea721bde4d18bc1f592f130c --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/RealActionIntegerLattice.lean @@ -0,0 +1,61 @@ +import OAI.GroupTheory.PolycyclicRecognition.Lattices.IntegerTimeLattice +import OAI.GroupTheory.PolycyclicRecognition.Lattices.SemidirectUniformLattice + +namespace OAI + +/-! # Time-one invariance constructs a lattice in a real semidirect product -/ + +noncomputable section +namespace PolycyclicRecognition +variable {N : Type*} [Group N] [TopologicalSpace N] + +omit [TopologicalSpace N] in +theorem subgroup_mem_mulAut_zpow (Λ : Subgroup N) (f : MulAut N) + (hf : ∀ x ∈ Λ, f x ∈ Λ) (hi : ∀ x ∈ Λ, f.symm x ∈ Λ) + (n : ℤ) (x : N) (hx : x ∈ Λ) : (f ^ n) x ∈ Λ := by + have hp (a : MulAut N) (ha : ∀ y ∈ Λ, a y ∈ Λ) (k : ℕ) : + ∀ y ∈ Λ, (a ^ k) y ∈ Λ := by + induction k with + | zero => exact fun _ h => h + | succ k ih => + intro y hy + rw [pow_succ'] + exact ha _ (ih y hy) + cases n with + | ofNat n => exact hp f hf n x hx + | negSucc n => + change (f ^ (-((n + 1 : ℕ) : ℤ))) x ∈ Λ + rw [zpow_neg, zpow_natCast, ← inv_pow] + exact hp f.symm hi (n + 1) x hx + +omit [TopologicalSpace N] in +theorem realAction_integerLattice_preserves (φ : Multiplicative ℝ →* MulAut N) + (Λ : Subgroup N) + (hf : ∀ x ∈ Λ, φ (Multiplicative.ofAdd 1) x ∈ Λ) + (hi : ∀ x ∈ Λ, (φ (Multiplicative.ofAdd 1)).symm x ∈ Λ) : + ∀ t ∈ integerTimeLattice, ∀ x ∈ Λ, φ t x ∈ Λ := by + intro t ht x hx + obtain ⟨n, rfl⟩ := integerTimeLattice_exists ht + have he : (Multiplicative.ofAdd (1 : ℝ)) ^ n = Multiplicative.ofAdd (n : ℝ) := by + apply Multiplicative.ext + change n • (1 : ℝ) = (n : ℝ) + simp + rw [← he, map_zpow] + exact subgroup_mem_mulAut_zpow Λ _ hf hi n x hx + +attribute [local instance] semidirectProductTopology + +theorem realAction_integerLattice_uniform (φ : Multiplicative ℝ →* MulAut N) + (Λ : Subgroup N) (hΛ : IsUniformLattice Λ) + (hf : ∀ x ∈ Λ, φ (Multiplicative.ofAdd 1) x ∈ Λ) + (hi : ∀ x ∈ Λ, (φ (Multiplicative.ofAdd 1)).symm x ∈ Λ) : + IsUniformLattice (semidirectLattice φ Λ integerTimeLattice + (realAction_integerLattice_preserves φ Λ hf hi)) := + semidirectLattice_uniform φ Λ integerTimeLattice + (realAction_integerLattice_preserves φ Λ hf hi) hΛ integerTimeLattice_uniform + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/RecognitionLatticeAssembly.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/RecognitionLatticeAssembly.lean new file mode 100644 index 0000000000000000000000000000000000000000..ee5627966912cf022463a291a893c70c63c0c282 --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/RecognitionLatticeAssembly.lean @@ -0,0 +1,159 @@ +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.VirtualPolycyclicDuality +import OAI.GroupTheory.PolycyclicRecognition.Geometry.RecognitionFromHeight +import OAI.GroupTheory.PolycyclicRecognition.Analysis.CoarseModelMean +import OAI.GroupTheory.PolycyclicRecognition.Lattices.LatticeCharacterization +import OAI.GroupTheory.PolycyclicRecognition.Analysis.MetricQuasiEquivalence +import OAI.GroupTheory.PolycyclicRecognition.Analysis.MetricCoarseBridge + +namespace OAI + +/-! +# Recognition from bounded-height hypotheses + +Metric comparison with the virtually polycyclic group supplies the invariant +mean and the cohomological coarse comparison. + +The conditional recognition theorems retain polynomial bounded-height packing +and a uniform affine height estimate as explicit geometric hypotheses. +-/ + +noncomputable section + +namespace PolycyclicRecognition + +namespace MetricQuasiEquivalence + +variable {P H : Type} [Group P] [Group H] [MetricSpace P] [MetricSpace H] + [IsIsometricSMul P P] [IsIsometricSMul H H] + +/-- Finite metric balls turn the specified coarse inverse maps into the +finite-difference comparison required by the cohomological inputs. -/ +def groupCoarseEquivalence (e : MetricQuasiEquivalence P H) + (hPfinite : ∀ R : ℝ, (Metric.closedBall (1 : P) R).Finite) + (hHfinite : ∀ R : ℝ, (Metric.closedBall (1 : H) R).Finite) : + GroupCoarseEquivalence P H where + toFun := e.toFun + invFun := e.invFun + bornologous_toFun := by + obtain ⟨K, C, hK, _, hf⟩ := e.toFun_control + exact groupBornologous_of_metric_bound e.toFun hHfinite hK hf + bornologous_invFun := by + obtain ⟨K, C, hK, _, hr⟩ := e.invFun_control + exact groupBornologous_of_metric_bound e.invFun hPfinite hK hr + left_error := by + obtain ⟨E, _, hleft⟩ := e.left_close + exact finite_groupDifference_range_of_metric_bound (e.invFun ∘ e.toFun) hPfinite hleft + right_error := by + obtain ⟨E, _, hright⟩ := e.right_close + exact finite_groupDifference_range_of_metric_bound (e.toFun ∘ e.invFun) hHfinite hright + +/-- Amenability is derived from the original comparison group and the +actual metric comparison, rather than assumed for the recognized group. -/ +theorem invariantMean_of_virtuallyPolycyclic + [DiscreteTopology H] [ProperSpace H] + [MeasurableSpace H] [BorelSpace H] [MeasurableMul H] + (e : MetricQuasiEquivalence P H) (hP : IsVirtuallyPolycyclic P) + (hPfinite : ∀ R : ℝ, (Metric.closedBall (1 : P) R).Finite) : + Nonempty (ThompsonNonamenability.InvariantMean H) := by + classical + obtain ⟨_, _, K', _, E, _, _, hK', _, hE, _, hlower, hsurj⟩ := + e.quasiIsometry_toFun + exact invariantMean_of_coarse_virtualPolycyclic hP hPfinite e.toFun hE hK' + hsurj hlower + +/-- Once geometry has supplied elementary amenability, the actual metric +comparison supplies all comparison data in the published duality endgame. -/ +theorem virtuallyPolycyclic_of_elementaryAmenable + [Group.FG P] [Group.FG H] + (liFP : LiFinitenessInput) (eaFP : ElementaryAmenableFinitenessInput) + (liPD : LiDualityInput) (bieri : BieriDualityInput) + (e : MetricQuasiEquivalence P H) (hP : IsVirtuallyPolycyclic P) + (hPfinite : ∀ R : ℝ, (Metric.closedBall (1 : P) R).Finite) + (hHfinite : ∀ R : ℝ, (Metric.closedBall (1 : H) R).Finite) + (hEA : IsElementaryAmenable H) : IsVirtuallyPolycyclic H := + virtuallyPolycyclic_of_elementaryAmenable_coarse_virtualPolycyclic_proved + liFP eaFP liPD bieri P H hP + (e.groupCoarseEquivalence hPfinite hHfinite) hEA + +end MetricQuasiEquivalence + +/-- The corrected height, including its possibly infinitely generated +kernel, gives both algebraic conclusions once its geometric packing bound is +available. No arbitrary Poincaré-duality comparison group is assumed. -/ +theorem recognition_and_lattice_of_corrected_height + (dekimpe : DekimpeLatticeRealizationInput) + (liFP : LiFinitenessInput) (eaFP : ElementaryAmenableFinitenessInput) + (liPD : LiDualityInput) (bieri : BieriDualityInput) + {P H : Type} [Group P] [Group H] [MetricSpace P] [MetricSpace H] + [IsIsometricSMul P P] [IsIsometricSMul H H] [Group.FG P] [Group.FG H] + (e : MetricQuasiEquivalence P H) (hP : IsVirtuallyPolycyclic P) + (hPfinite : ∀ R : ℝ, (Metric.closedBall (1 : P) R).Finite) + (hHfinite : ∀ R : ℝ, (Metric.closedBall (1 : H) R).Finite) + {X W : Type} [PseudoMetricSpace X] [DecidableEq X] [NormedAddCommGroup W] + (H₀ : Subgroup H) [H₀.FiniteIndex] (τ : H₀ →* Multiplicative W) + (gromov : ∀ (J : Subgroup τ.ker) [DecidableEq J], GromovPolynomialGrowthInput J) + (f : H → X) (π : X → W) (packing : PolynomialBoundedChainPacking π) + {K C K' C' D : ℝ} (hK : 0 ≤ K) (hC : 0 ≤ C) (hK' : 0 ≤ K') (hD : 0 ≤ D) + (hupper : ∀ x y, dist (f x) (f y) ≤ K * dist x y + C) + (hlower : ∀ x y, dist x y ≤ K' * dist (f x) (f y) + C') + (hheight : ∀ h : H₀, ‖(τ h).toAdd - π (f h)‖ ≤ D) : + IsVirtuallyPolycyclic H ∧ + ∃ Γ : Subgroup H, Γ.FiniteIndex ∧ + ∃ (S : SimplyConnectedSolvableLieModel) (Λ : Subgroup S.carrier), + IsUniformLattice Λ ∧ Nonempty (Γ ≃* Λ) := by + have hEA := elementaryAmenable_of_corrected_height H₀ τ gromov f π packing + hHfinite hK hC hK' hD hupper hlower hheight + have hH := e.virtuallyPolycyclic_of_elementaryAmenable liFP eaFP liPD bieri + hP hPfinite hHfinite hEA + exact ⟨hH, exists_uniform_solvable_lattice_of_virtuallyPolycyclic dekimpe H hH⟩ + +/-- The same conclusion directly from the affine-height interface. The +specified metric coarse inverses provide all transfer maps and estimates; +amenable correction, the height kernel, finiteness and duality are proved +in the invoked supporting theorems. The affine estimate and packing remain +the two explicit geometric obligations. -/ +theorem recognition_and_lattice_of_affine_height + (dekimpe : DekimpeLatticeRealizationInput) + (liFP : LiFinitenessInput) (eaFP : ElementaryAmenableFinitenessInput) + (liPD : LiDualityInput) (bieri : BieriDualityInput) + {P H : Type} [Group P] [Group H] [MetricSpace P] [MetricSpace H] + [IsIsometricSMul P P] [IsIsometricSMul H H] [Group.FG P] [Group.FG H] + [DiscreteTopology H] [ProperSpace H] + [MeasurableSpace H] [BorelSpace H] [MeasurableMul H] + (e : MetricQuasiEquivalence P H) (hP : IsVirtuallyPolycyclic P) + (hPfinite : ∀ R : ℝ, (Metric.closedBall (1 : P) R).Finite) + {X W : Type} [PseudoMetricSpace X] [DecidableEq X] + [NormedAddCommGroup W] [NormedSpace ℝ W] [FiniteDimensional ℝ W] + (u : MetricQuasiEquivalence H X) (π : X → W) + (packing : PolynomialBoundedChainPacking π) + (gromov : ∀ (J : Type) [Group J] [DecidableEq J], GromovPolynomialGrowthInput J) + (A : H → W ≃L[ℝ] W) (hA : Set.Finite (Set.range A)) + (hπsurj : Function.Surjective π) + {L B : ℝ} (hL : 0 ≤ L) (hB : 0 ≤ B) + (hπ : ∀ x y, ‖π x - π y‖ ≤ L * dist x y) + (haffine : ∀ h x, + ‖π (transferredMap u.toFun u.invFun h x) - + (π (u.toFun h) + A h (π x))‖ ≤ B) : + IsVirtuallyPolycyclic H ∧ + ∃ Γ : Subgroup H, Γ.FiniteIndex ∧ + ∃ (S : SimplyConnectedSolvableLieModel) (Λ : Subgroup S.carrier), + IsUniformLattice Λ ∧ Nonempty (Γ ≃* Λ) := by + classical + obtain ⟨M⟩ := e.invariantMean_of_virtuallyPolycyclic hP hPfinite + obtain ⟨K, C, K', C', _, hK, hC, hK', _, _, hupper, hlower, _⟩ := + u.quasiIsometry_toFun + obtain ⟨E, hE, hleft⟩ := u.left_close + have hfinite (R : ℝ) : (Metric.closedBall (1 : H) R).Finite := + (isCompact_closedBall (1 : H) R).finite_of_discrete + have hEA := elementaryAmenable_of_transferred_height gromov u.toFun u.invFun π + packing A hπsurj L K C E B K' C' hL hK hC hE hB hK' hπ hupper hlower + (fun h => (dist_comm _ _).trans_le (hleft h)) haffine M hA hfinite + have hH := e.virtuallyPolycyclic_of_elementaryAmenable liFP eaFP liPD bieri + hP hPfinite hfinite hEA + exact ⟨hH, exists_uniform_solvable_lattice_of_virtuallyPolycyclic dekimpe H hH⟩ + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/SemidirectLatticeEmbedding.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/SemidirectLatticeEmbedding.lean new file mode 100644 index 0000000000000000000000000000000000000000..8af9ca982f86f930ad12c9052826c02418d4f9c4 --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/SemidirectLatticeEmbedding.lean @@ -0,0 +1,64 @@ +import OAI.GroupTheory.PolycyclicRecognition.Lattices.SemidirectUniformLattice + +namespace OAI + +/-! # Equivariant embeddings of two lattices into a semidirect product -/ + +noncomputable section +namespace PolycyclicRecognition +variable {H K N V : Type*} [Group H] [Group K] [Group N] [Group V] + [TopologicalSpace N] [TopologicalSpace V] + (ρ : K →* MulAut H) (φ : V →* MulAut N) + (Λ : Subgroup N) (Δ : Subgroup V) (e : H ≃* Λ) (f : K ≃* Δ) + (he : ∀ k x, (e (ρ k x) : N) = φ (f k) (e x)) + +attribute [local instance] semidirectProductTopology +include e f he + +omit [TopologicalSpace N] [TopologicalSpace V] in +theorem semidirect_lattice_preserved : ∀ v ∈ Δ, ∀ x ∈ Λ, φ v x ∈ Λ := by + intro v hv x hx + obtain ⟨k, hk⟩ := f.surjective ⟨v, hv⟩ + obtain ⟨y, hy⟩ := e.surjective ⟨x, hx⟩ + have hv' : (f k : V) = v := congrArg Subtype.val hk + have hx' : (e y : N) = x := congrArg Subtype.val hy + rw [← hv', ← hx', ← he] + exact (e (ρ k y)).property + +theorem semidirect_lattice_embedding (hΛ : IsUniformLattice Λ) (hΔ : IsUniformLattice Δ) : + ∃ Γ : Subgroup (N ⋊[φ] V), IsUniformLattice Γ ∧ Nonempty ((H ⋊[ρ] K) ≃* Γ) := by + let j : H →* N := Λ.subtype.comp e.toMonoidHom + let k : K →* V := Δ.subtype.comp f.toMonoidHom + let F : (H ⋊[ρ] K) →* (N ⋊[φ] V) := SemidirectProduct.map j k (by + intro a + ext x + exact he a x) + let Γ := semidirectLattice φ Λ Δ (semidirect_lattice_preserved ρ φ Λ Δ e f he) + have hF (x) : F x ∈ Γ := ⟨(e x.left).property, (f x.right).property⟩ + let F' : (H ⋊[ρ] K) →* Γ := F.codRestrict Γ hF + have hinj : Function.Injective F' := by + intro x y h + apply SemidirectProduct.ext + · apply e.injective + apply Subtype.ext + exact congrArg (fun z : Γ => z.val.left) h + · apply f.injective + apply Subtype.ext + exact congrArg (fun z : Γ => z.val.right) h + have hsurj : Function.Surjective F' := by + intro z + obtain ⟨x, hx⟩ := e.surjective ⟨z.val.left, z.property.1⟩ + obtain ⟨y, hy⟩ := f.surjective ⟨z.val.right, z.property.2⟩ + refine ⟨⟨x, y⟩, ?_⟩ + apply Subtype.ext + apply SemidirectProduct.ext + · exact congrArg Subtype.val hx + · exact congrArg Subtype.val hy + exact ⟨Γ, semidirectLattice_uniform φ Λ Δ _ hΛ hΔ, + ⟨MulEquiv.ofBijective F' ⟨hinj, hsurj⟩⟩⟩ + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/SemidirectUniformLattice.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/SemidirectUniformLattice.lean new file mode 100644 index 0000000000000000000000000000000000000000..64e4286efdbc5a4176df749af76ad2ed72ce3833 --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/SemidirectUniformLattice.lean @@ -0,0 +1,74 @@ +import OAI.GroupTheory.PolycyclicRecognition.Geometry.SemidirectProductTopology +import OAI.GroupTheory.PolycyclicRecognition.Lattices.UniformLatticeMetric + +namespace OAI + +/-! # Uniform lattices in a semidirect product + +The lattices in the two factors form a lattice whenever the acting lattice +preserves the first lattice. The compact cover uses the inverse action before +reducing the first coordinate. +-/ + +noncomputable section +namespace PolycyclicRecognition +open Set +variable {N D : Type*} [Group N] [Group D] + [TopologicalSpace N] [TopologicalSpace D] + (φ : D →* MulAut N) (Λ : Subgroup N) (Δ : Subgroup D) + (hφ : ∀ d ∈ Δ, ∀ x ∈ Λ, φ d x ∈ Λ) + +attribute [local instance] semidirectProductTopology + +def semidirectLattice : Subgroup (N ⋊[φ] D) where + carrier := {p | p.left ∈ Λ ∧ p.right ∈ Δ} + one_mem' := ⟨Λ.one_mem, Δ.one_mem⟩ + mul_mem' := by + intro p q hp hq + exact ⟨Λ.mul_mem hp.1 (hφ p.right hp.2 q.left hq.1), Δ.mul_mem hp.2 hq.2⟩ + inv_mem' := by + intro p hp + exact ⟨hφ p.right⁻¹ (Δ.inv_mem hp.2) p.left⁻¹ (Λ.inv_mem hp.1), Δ.inv_mem hp.2⟩ + +theorem semidirectLattice_discrete [DiscreteTopology Λ] [DiscreteTopology Δ] : + DiscreteTopology (semidirectLattice φ Λ Δ hφ) := by + let f : semidirectLattice φ Λ Δ hφ → Λ × Δ := + fun x => (⟨x.val.left, x.property.1⟩, ⟨x.val.right, x.property.2⟩) + have hl := (continuous_semidirect_left φ).comp + (continuous_subtype_val : Continuous (Subtype.val : semidirectLattice φ Λ Δ hφ → N ⋊[φ] D)) + have hr := (continuous_semidirect_right φ).comp + (continuous_subtype_val : Continuous (Subtype.val : semidirectLattice φ Λ Δ hφ → N ⋊[φ] D)) + have hf : Continuous f := (hl.subtype_mk _).prodMk (hr.subtype_mk _) + apply DiscreteTopology.of_continuous_injective hf + intro x y h + apply Subtype.ext + apply SemidirectProduct.ext + · exact congrArg (fun z : Λ × Δ => z.1.val) h + · exact congrArg (fun z : Λ × Δ => z.2.val) h + +theorem semidirectLattice_uniform (hΛ : IsUniformLattice Λ) (hΔ : IsUniformLattice Δ) : + IsUniformLattice (semidirectLattice φ Λ Δ hφ) := by + let := hΛ.1 + let := hΔ.1 + obtain ⟨K, hK, hcoverK⟩ := hΛ.2 + obtain ⟨F, hF, hcoverF⟩ := hΔ.2 + let e := semidirectProductHomeomorph φ + refine ⟨semidirectLattice_discrete φ Λ Δ hφ, + e.symm '' (K ×ˢ F), (hK.prod hF).image e.symm.continuous, ?_⟩ + intro g + obtain ⟨δ, v, hv, hδ⟩ := hcoverF g.right + obtain ⟨μ, u, hu, hμ⟩ := hcoverK (φ (δ.val⁻¹) g.left) + let γ : semidirectLattice φ Λ Δ hφ := + ⟨⟨φ δ.val μ.val, δ.val⟩, hφ δ.val δ.property μ.val μ.property, δ.property⟩ + refine ⟨γ, ⟨u, v⟩, ⟨(u, v), ⟨hu, hv⟩, rfl⟩, ?_⟩ + apply SemidirectProduct.ext + · change φ δ.val μ.val * φ δ.val u = g.left + rw [← map_mul, hμ, map_inv] + exact (φ δ.val).apply_symm_apply g.left + · exact hδ + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/SemisimpleCentralizerCorrection.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/SemisimpleCentralizerCorrection.lean new file mode 100644 index 0000000000000000000000000000000000000000..fc5fef597f71bd41b9ed0c8d56db4ef44b3715b0 --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/SemisimpleCentralizerCorrection.lean @@ -0,0 +1,55 @@ +import OAI.GroupTheory.PolycyclicRecognition.Geometry.InnerTwistJordanFactor + +namespace OAI + +/-! # Correcting an outer centralizer into a semisimple centralizer + +When conjugation by B changes A only by an inner automorphism, B can itself +be corrected by an inner automorphism to centralize the semisimple part of A. +-/ + +noncomputable section +namespace PolycyclicRecognition +variable {L : Type} [RealNormedLieAlgebra L] [FiniteDimensional ℝ L] + [C : PolynomialExponentialCoordinates L] [LieRing.IsNilpotent L] + +theorem semisimple_centralizer_inner_correction (A S U B : L ≃ₗ⁅ℝ⁆ L) + (hS : Module.End.IsSemisimple S.toLinearMap) + (hU : IsNilpotent (U.toLinearMap - 1)) + (hSU : Commute S.toLinearMap U.toLinearMap) + (hA : A.toLinearMap = S.toLinearMap * U.toLinearMap) + (u : L) (hu : (polynomialInnerLieEquiv u).toLinearMap * A.toLinearMap = + B.toLinearEquiv.conjRingEquiv A.toLinearMap) : + ∃ v : L, Commute ((polynomialInnerLieEquiv v).toLinearMap * B.toLinearMap) + S.toLinearMap := by + let T := B.symm.trans (S.trans B) + let V := B.symm.trans (U.trans B) + have hT : T.toLinearMap = B.toLinearEquiv.conjRingEquiv S.toLinearMap := rfl + have hV : V.toLinearMap = B.toLinearEquiv.conjRingEquiv U.toLinearMap := rfl + have hVnil : IsNilpotent (V.toLinearMap - 1) := by + rw [hV] + have hh := hU.map B.toLinearEquiv.conjRingEquiv + simpa only [map_sub, map_one] using hh + have hTV : Commute T.toLinearMap V.toLinearMap := by + rw [hT, hV] + exact hSU.map B.toLinearEquiv.conjRingEquiv.toMonoidHom + have hprod : (polynomialInnerLieEquiv u).toLinearMap * A.toLinearMap = + T.toLinearMap * V.toLinearMap := by + rw [hu, hT, hV, ← map_mul, ← hA] + obtain ⟨v, hv⟩ := inner_twist_semisimple_factor A S U T V hS hU hSU hA u + (by rw [hT]; exact semisimple_conj B.toLinearEquiv S.toLinearMap hS) hVnil hTV hprod + let e := (polynomialInnerLieEquiv v).toLinearEquiv + have hpoint (x : L) : e (B (S (B.symm (e.symm x)))) = S x := + LinearMap.congr_fun hv x + refine ⟨v, ?_⟩ + apply LinearMap.ext + intro x + have hh := hpoint (e (B x)) + rw [e.symm_apply_apply, B.symm_apply_apply] at hh + exact hh + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/SemisimpleLangDecomposition.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/SemisimpleLangDecomposition.lean new file mode 100644 index 0000000000000000000000000000000000000000..8bc47a59238a7f41005c4e1ed5d39cb3fba5ea02 --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/SemisimpleLangDecomposition.lean @@ -0,0 +1,57 @@ +import OAI.GroupTheory.PolycyclicRecognition.Algebra.SemisimpleLangTransversal +import OAI.GroupTheory.PolycyclicRecognition.Algebra.PolynomialDerivationAction + +namespace OAI + +/-! # Inner perturbations of a semisimple nilpotent automorphism + +The fixed part of the Lang transversal is retained. It commutes with the +semisimple automorphism, while the moving part is absorbed by conjugation. +-/ + +noncomputable section +namespace PolycyclicRecognition +variable {L : Type} [RealNormedLieAlgebra L] [FiniteDimensional ℝ L] + [C : PolynomialExponentialCoordinates L] [LieRing.IsNilpotent L] + +theorem semisimple_lang_decomposition (A : L ≃ₗ⁅ℝ⁆ L) + (hA : Module.End.IsSemisimple A.toLinearMap) (u : L) : + ∃ v w : L, v ∈ (A.toLinearMap - (1 : Module.End ℝ L)).range ∧ + A w = w ∧ u = v⁻¹ * w * A v := by + let B : Module.End ℝ L := A.toLinearMap - 1 + have hB : B.IsSemisimple := semisimple_sub_one A.toLinearMap hA + let P := semisimpleKernelProjection B hB + have hs : Function.Surjective (fun x : L => (x - P x)⁻¹ * P x * A (x - P x)) := + (semisimple_lang_transversal_bijective A hA).surjective + obtain ⟨x, hx⟩ := hs u + refine ⟨x - P x, P x, ?_, ?_, hx.symm⟩ + · exact Submodule.sub_projection_mem (semisimple_kernel_range_isCompl B hB) x + · exact sub_eq_zero.mp (semisimpleKernelProjection_mem B hB x) + +theorem semisimple_inner_twist (A : L ≃ₗ⁅ℝ⁆ L) + (hA : Module.End.IsSemisimple A.toLinearMap) (u : L) : + ∃ v w : L, A w = w ∧ + Commute (PolynomialExponentialCoordinates.groupAutomorphism (P := C) A) (MulAut.conj w) ∧ + MulAut.conj v * (MulAut.conj u * PolynomialExponentialCoordinates.groupAutomorphism (P := C) A) * (MulAut.conj v)⁻¹ = + MulAut.conj w * PolynomialExponentialCoordinates.groupAutomorphism (P := C) A := by + obtain ⟨v, w, _, hw, hu⟩ := semisimple_lang_decomposition A hA u + let S := PolynomialExponentialCoordinates.groupAutomorphism (P := C) A + have hSv : S v = A v := rfl + have hSw : S w = w := hw + refine ⟨v, w, hw, ?_, ?_⟩ + · apply DFunLike.ext + intro x + change S (w * x * w⁻¹) = w * S x * w⁻¹ + rw [map_mul, map_mul, map_inv, hSw] + · apply DFunLike.ext + intro x + change v * (u * S (v⁻¹ * x * v) * u⁻¹) * v⁻¹ = w * S x * w⁻¹ + rw [hu, ← hSv] + simp only [map_mul, map_inv] + group + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/SmoothIntegralLatticeRealization.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/SmoothIntegralLatticeRealization.lean new file mode 100644 index 0000000000000000000000000000000000000000..7c14a6506157f896cb53ce92351ac5d229f016fb --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/SmoothIntegralLatticeRealization.lean @@ -0,0 +1,77 @@ +import OAI.GroupTheory.PolycyclicRecognition.Geometry.SmoothIntegralActionExtension +import OAI.GroupTheory.PolycyclicRecognition.Geometry.IntegralSemidirectEmbedding +import OAI.GroupTheory.PolycyclicRecognition.Geometry.IntegralSemidirectPowerTopology +import OAI.GroupTheory.PolycyclicRecognition.Lattices.UniformLatticeFiniteIndexEmbedding +import OAI.GroupTheory.PolycyclicRecognition.Algebra.FactorExtensionTopology + +namespace OAI + +/-! # Realizing a uniform lattice with possibly translated integral fibers + +A smooth action of an integral vector group extends after a finite power. +Any uniform lattice in the original semidirect group then has a finite-index +subgroup which is a uniform lattice in the connected solvable Lie model. +-/ + +noncomputable section +namespace PolycyclicRecognition +open scoped Manifold ContDiff +attribute [local instance] semidirectProductTopology +variable {L : Type} [RealNormedLieAlgebra L] [FiniteDimensional ℝ L] + [PolynomialExponentialCoordinates L] [Group.IsSolvable L] + +theorem smooth_integral_uniform_lattice_realization {n : ℕ} + (ρ : IntegralLatticeGroup n →* MulAut L) + (hρ : ∀ z, ContMDiff (𝓘(ℝ, L)) (𝓘(ℝ, L)) ∞ (ρ z)) + (Γ : Subgroup (L ⋊[ρ] IntegralLatticeGroup n)) (hΓ : IsUniformLattice Γ) : + ∃ J : Subgroup Γ, J.FiniteIndex ∧ ∃ (S : SimplyConnectedSolvableLieModel) + (Λ : Subgroup S.carrier), IsUniformLattice Λ ∧ Nonempty (J ≃* Λ) := by + let : IsTopologicalGroup L := topologicalGroup_of_lieGroup (𝓘(ℝ, L)) ⊤ + have hρc : Continuous (fun p : IntegralLatticeGroup n × L => ρ p.1 p.2) := + continuous_discrete_parameter (fun z x => ρ z x) (fun z => (hρ z).continuous) + let := semidirectProductTopologicalGroup ρ hρc + obtain ⟨m, hm, φ, hφ, he⟩ := smooth_integral_action_has_vector_extension ρ hρ + let F := integralSemidirectPowerMap ρ m + have hFi := integralSemidirectPowerMap_injective ρ hm + have hFe := integralSemidirectPowerMap_isClosedEmbedding ρ hm + let := integralSemidirectPowerMap_finiteIndex ρ hm + let Γm := Γ.comap F + have hΓm : IsUniformLattice Γm := hΓ.comap_finiteIndex F hFe + let J := F.range.comap Γ.subtype + have hJ : J.FiniteIndex := inferInstance + let f0 : Γm →* Γ := (F.comp Γm.subtype).codRestrict Γ (fun x => x.property) + let fJ : Γm →* J := f0.codRestrict J (fun x => ⟨x.val, rfl⟩) + have hfJ : Function.Bijective fJ := by + constructor + · intro a b hab + apply Subtype.ext + apply hFi + exact congrArg (fun x : J => ((x : Γ) : L ⋊[ρ] IntegralLatticeGroup n)) hab + · intro j + obtain ⟨x, hx⟩ := j.property + have hxΓ : x ∈ Γm := by change F x ∈ Γ; rw [hx]; exact j.val.property + refine ⟨⟨x, hxΓ⟩, ?_⟩ + apply Subtype.ext + apply Subtype.ext + exact hx + let eJ : Γm ≃* J := MulEquiv.ofBijective fJ hfJ + let E := integralSemidirectEmbedding (ρ.comp (latticePowerHom n m)) φ he + have hEc : Continuous (fun p : Multiplicative (Fin n → ℝ) × L => φ p.1 p.2) := + hφ.continuous + have hΛ := uniformLattice_integralSemidirect_image (ρ.comp (latticePowerHom n m)) φ he hEc hΓm + let T := smoothVectorActionModel φ hφ + let eT := smoothVectorActionModelEquiv φ hφ + let Λ := (Γm.map E).comap eT.toMonoidHom + have hΛT : IsUniformLattice Λ := hΛ.comap_mulEquiv eT + (smoothVectorActionModelEquiv_continuous φ hφ) + (smoothVectorActionModelEquiv_symm_continuous φ hφ) + let eE : Γm ≃* Γm.map E := Γm.equivMapOfInjective E + (integralSemidirectEmbedding_isEmbedding _ _ _).injective + exact ⟨J, hJ, T, Λ, hΛT, + ⟨eJ.symm.trans (eE.trans (comapSubgroupEquiv eT (Γm.map E)).symm)⟩⟩ + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/SmoothRealActionLattice.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/SmoothRealActionLattice.lean new file mode 100644 index 0000000000000000000000000000000000000000..a1ccbd0c9f44a03dbdd97e3f3931d26ac96295bc --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/SmoothRealActionLattice.lean @@ -0,0 +1,40 @@ +import OAI.GroupTheory.PolycyclicRecognition.Geometry.SmoothRealActionModel +import OAI.GroupTheory.PolycyclicRecognition.Lattices.IntegerSemidirectLattice + +namespace OAI + +/-! # A cyclic lattice in a smooth real-action extension + +The remaining algebraic obligation in an application is to construct the +real action with the stated time-one automorphism. +-/ + +noncomputable section +namespace PolycyclicRecognition +open scoped Manifold +attribute [local instance] semidirectProductTopology + +variable {H L : Type} [Group H] [NormedAddCommGroup L] [NormedSpace ℝ L] + [FiniteDimensional ℝ L] [Group L] [LieGroup (𝓘(ℝ, L)) ⊤ L] + [Group.IsSolvable L] + +theorem smooth_realAction_cyclic_lattice + (φ : Multiplicative ℝ →* MulAut L) + (hφ : ContDiff ℝ ⊤ (fun p : ℝ × L => φ (Multiplicative.ofAdd p.1) p.2)) + (a : MulAut H) (Λ : Subgroup L) (hΛ : IsUniformLattice Λ) (e : H ≃* Λ) + (he : ∀ x, (e (a x) : L) = φ (Multiplicative.ofAdd 1) (e x)) : + ∃ (S : SimplyConnectedSolvableLieModel) (Γ : Subgroup S.carrier), + IsUniformLattice Γ ∧ + Nonempty ((H ⋊[integerPowerAction a] Multiplicative ℤ) ≃* Γ) := by + obtain ⟨Γ, hΓ, ⟨f⟩⟩ := integer_semidirect_lattice_realization φ a Λ hΛ e he + let S := smoothRealActionModel φ hφ + let E := smoothRealActionModelEquiv φ hφ + refine ⟨S, Γ.comap E.toMonoidHom, ?_, ⟨f.trans (comapSubgroupEquiv E Γ).symm⟩⟩ + exact hΓ.comap_mulEquiv E (smoothRealActionModelEquiv_continuous φ hφ) + (smoothRealActionModelEquiv_symm_continuous φ hφ) + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/SmoothVectorActionLattice.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/SmoothVectorActionLattice.lean new file mode 100644 index 0000000000000000000000000000000000000000..3cd5822b1cd1bb016c926afcbea7eef123cf00c4 --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/SmoothVectorActionLattice.lean @@ -0,0 +1,37 @@ +import OAI.GroupTheory.PolycyclicRecognition.Geometry.SmoothVectorActionModel +import OAI.GroupTheory.PolycyclicRecognition.Lattices.SemidirectLatticeEmbedding +import OAI.GroupTheory.PolycyclicRecognition.Lattices.IntegralLatticeGenerators +import OAI.GroupTheory.PolycyclicRecognition.Lattices.UniformLatticeTransport + +namespace OAI + +/-! # Integral lattices in smooth vector-action extensions -/ + +noncomputable section +namespace PolycyclicRecognition +open scoped Manifold +attribute [local instance] semidirectProductTopology +variable {H L : Type} [Group H] [NormedAddCommGroup L] [NormedSpace ℝ L] + [FiniteDimensional ℝ L] [Group L] [LieGroup (𝓘(ℝ, L)) ⊤ L] [Group.IsSolvable L] + +theorem smooth_vectorAction_integral_lattice {n : ℕ} + (φ : Multiplicative (Fin n → ℝ) →* MulAut L) + (hφ : ContDiff ℝ ⊤ (fun p : (Fin n → ℝ) × L => φ (Multiplicative.ofAdd p.1) p.2)) + (ρ : IntegralLatticeGroup n →* MulAut H) + (Λ : Subgroup L) (hΛ : IsUniformLattice Λ) (e : H ≃* Λ) + (he : ∀ z x, (e (ρ z x) : L) = φ (integerVectorHom n z) (e x)) : + ∃ (S : SimplyConnectedSolvableLieModel) (Γ : Subgroup S.carrier), + IsUniformLattice Γ ∧ Nonempty ((H ⋊[ρ] IntegralLatticeGroup n) ≃* Γ) := by + obtain ⟨Γ, hΓ, ⟨f⟩⟩ := semidirect_lattice_embedding ρ φ Λ (integerVectorHom n).range + e (integerVectorRangeEquiv n) he hΛ (integerVectorHom_uniform n) + let S := smoothVectorActionModel φ hφ + let E := smoothVectorActionModelEquiv φ hφ + refine ⟨S, Γ.comap E.toMonoidHom, ?_, ⟨f.trans (comapSubgroupEquiv E Γ).symm⟩⟩ + exact hΓ.comap_mulEquiv E (smoothVectorActionModelEquiv_continuous φ hφ) + (smoothVectorActionModelEquiv_symm_continuous φ hφ) + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/SolvableLatticeModel.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/SolvableLatticeModel.lean new file mode 100644 index 0000000000000000000000000000000000000000..bf7047cc705d7a640bef60842f156c5c972a4a46 --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/SolvableLatticeModel.lean @@ -0,0 +1,83 @@ +import OAI.GroupTheory.PolycyclicRecognition.Lattices.UniformLatticeQuotient +import OAI.GroupTheory.PolycyclicRecognition.Algebra.Polycyclic +import Mathlib.Geometry.Manifold.GroupLieAlgebra +import Mathlib.AlgebraicTopology.FundamentalGroupoid.SimplyConnected +import Mathlib.GroupTheory.Solvable + +namespace OAI + +/-! +# Solvable-lattice realization + +K. Dekimpe, *Solvable Lie Algebras, Lie Groups and Polynomial Structures*, +Compositio Mathematica 121 (2000), 183–204, Theorem 4.1, p.199, +DOI 10.1023/A:1001738932743, gives a finite-index subgroup of a +polycyclic-by-finite group as a uniform lattice in a connected simply +connected solvable Lie group. We use only this consequence, omitting the +additional equality with the Fitting subgroup and omitting normality. + +The realization predicate specifies a finite-dimensional smooth Lie structure +and a discrete lattice with compact coset quotient. +-/ + +noncomputable section + +namespace PolycyclicRecognition + +open scoped Manifold + +/-- A connected simply connected finite-dimensional real solvable Lie group. +No metric or lattice is part of this record. -/ +structure SimplyConnectedSolvableLieModel where + modelSpace : Type + [normedAddCommGroup : NormedAddCommGroup modelSpace] + [normedSpace : NormedSpace ℝ modelSpace] + [finiteDimensional : FiniteDimensional ℝ modelSpace] + carrier : Type + [topologicalSpace : TopologicalSpace carrier] + [chartedSpace : ChartedSpace modelSpace carrier] + [group : Group carrier] + [lieGroup : LieGroup (𝓘(ℝ, modelSpace)) ⊤ carrier] + [t2Space : T2Space carrier] + [secondCountableTopology : SecondCountableTopology carrier] + [simplyConnectedSpace : SimplyConnectedSpace carrier] + [solvable : Group.IsSolvable carrier] + +attribute [instance] SimplyConnectedSolvableLieModel.normedAddCommGroup + SimplyConnectedSolvableLieModel.normedSpace SimplyConnectedSolvableLieModel.finiteDimensional + SimplyConnectedSolvableLieModel.topologicalSpace SimplyConnectedSolvableLieModel.chartedSpace + SimplyConnectedSolvableLieModel.group SimplyConnectedSolvableLieModel.lieGroup + SimplyConnectedSolvableLieModel.t2Space SimplyConnectedSolvableLieModel.simplyConnectedSpace + SimplyConnectedSolvableLieModel.secondCountableTopology + SimplyConnectedSolvableLieModel.solvable + +/-- The exact lattice-realization consequence of Dekimpe's Theorem 4.1 +needed for the paper's lattice formulation. -/ +def DekimpeLatticeRealizationInput : Prop := + ∀ (P : Type) [Group P], IsVirtuallyPolycyclic P → + ∃ Γ : Subgroup P, Γ.FiniteIndex ∧ + ∃ (S : SimplyConnectedSolvableLieModel) (Λ : Subgroup S.carrier), + DiscreteTopology Λ ∧ CompactSpace (S.carrier ⧸ Λ) ∧ Nonempty (Γ ≃* Λ) + +/-- Restate the published realization using the equivalent compact-cover +definition used by the metric lattice lemmas. -/ +theorem exists_uniform_solvable_lattice_of_virtuallyPolycyclic + (dekimpe : DekimpeLatticeRealizationInput) + (P : Type) [Group P] (hP : IsVirtuallyPolycyclic P) : + ∃ Γ : Subgroup P, Γ.FiniteIndex ∧ + ∃ (S : SimplyConnectedSolvableLieModel) (Λ : Subgroup S.carrier), + IsUniformLattice Λ ∧ Nonempty (Γ ≃* Λ) := by + obtain ⟨Γ, hΓ, S, Λ, hdisc, hcompact, e⟩ := dekimpe P hP + let := hdisc + let := hcompact + let : IsTopologicalGroup S.carrier := + topologicalGroup_of_lieGroup (𝓘(ℝ, S.modelSpace)) ⊤ + let : LocallyCompactSpace S.carrier := + Manifold.locallyCompact_of_finiteDimensional (𝓘(ℝ, S.modelSpace)) + exact ⟨Γ, hΓ, S, Λ, isUniformLattice_of_compact_quotient Λ, e⟩ + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/SolvableLatticePolycyclic.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/SolvableLatticePolycyclic.lean new file mode 100644 index 0000000000000000000000000000000000000000..8a69a22038fb1371e9be1232bd1fc6045e84a773 --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/SolvableLatticePolycyclic.lean @@ -0,0 +1,58 @@ +import OAI.GroupTheory.PolycyclicRecognition.Geometry.ComplexWeightRange +import OAI.GroupTheory.PolycyclicRecognition.Geometry.SolvableGroupLieAlgebra +import OAI.GroupTheory.PolycyclicRecognition.Algebra.DiscreteLinearNilpotentKernel +import OAI.GroupTheory.PolycyclicRecognition.Lattices.TriangulableLatticePolycyclic + +namespace OAI + +/-! # Polycyclicity of lattices in simply connected solvable Lie groups + +Complex adjoint weights include rotations. Their normalized additive lifts +have nilpotent Lie kernel and a real vector-space quotient. Discrete subgroups +of the kernel are polycyclic, and finite generation controls the abelian image. +-/ + +noncomputable section +namespace PolycyclicRecognition +open scoped Manifold + +/-- Every finitely generated discrete subgroup of a connected simply +connected finite-dimensional real solvable Lie group is polycyclic. -/ +theorem isPolycyclic_finitelyGenerated_discrete_solvableLieGroup + {E G : Type} [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] + [MetricSpace G] [ChartedSpace E G] [Group G] [LieGroup (𝓘(ℝ, E)) ⊤ G] + [SimplyConnectedSpace G] [Group.IsSolvable G] + (Γ : Subgroup G) [DiscreteTopology Γ] [Group.FG Γ] : IsPolycyclic Γ := by + let L := GroupLieAlgebra (𝓘(ℝ, E)) G + let : IsTopologicalGroup G := topologicalGroup_of_lieGroup (𝓘(ℝ, E)) ⊤ + let : LocallyPathConnectedSpace G := ChartedSpace.locallyPathConnectedSpace E G + let : LieAlgebra.IsSolvable L := groupLieAlgebra_isSolvable (E := E) (G := G) + obtain ⟨n, b, hb⟩ := exists_complex_triangular_adjoint_basis L + let T : ComplexTriangularAdjoint L n := ⟨b, hb⟩ + let Exp := groupExponential (E := E) (G := G) + have hExp : IsGroupExponential Exp := groupExponential_isGroupExponential + obtain ⟨π, hπ, he⟩ := exists_additive_complex_adjoint_weights (Module.finBasis ℝ L) T hExp + obtain ⟨q, hq, hqe⟩ := exists_range_restricted_complex_weights hExp T.weightMap π hπ he + exact isPolycyclic_finitelyGenerated_discrete_of_linear_nilpotent_kernel + T.kernelIdeal T.kernelIdeal_nilpotent T.weightMap.rangeRestrict + T.weightMap.surjective_rangeRestrict (LinearMap.ker_rangeRestrict T.weightMap) + Exp hExp q hq hqe Γ + +/-- The full solvable lattice theorem used by the recognition argument. -/ +theorem isPolycyclic_uniformLattice_solvableLieGroup + (S : SimplyConnectedSolvableLieModel) (Λ : Subgroup S.carrier) + (hΛ : IsUniformLattice Λ) : IsPolycyclic Λ := by + obtain ⟨d⟩ := S.nonempty_properChainMetric geodesicMetricExistenceInput + let := d.compatibleMetric + let := d.proper_compatibleMetric + let := d.isometric_compatibleMetric + let : IsTopologicalGroup S.carrier := topologicalGroup_of_lieGroup (𝓘(ℝ, S.modelSpace)) ⊤ + let : DiscreteTopology Λ := hΛ.1 + let : Group.FG Λ := hΛ.finitelyGenerated d.chains_compatibleMetric + exact isPolycyclic_finitelyGenerated_discrete_solvableLieGroup (E := S.modelSpace) Λ + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/SolvableLatticeRecognition.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/SolvableLatticeRecognition.lean new file mode 100644 index 0000000000000000000000000000000000000000..2cc80e1fa73f7387892424bf56b24df0ec157e2e --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/SolvableLatticeRecognition.lean @@ -0,0 +1,65 @@ +import OAI.GroupTheory.PolycyclicRecognition.Lattices.SolvableLatticeModel +import OAI.GroupTheory.PolycyclicRecognition.Algebra.PolycyclicFiniteGeneration +import OAI.GroupTheory.PolycyclicRecognition.Finiteness.VirtualPolycyclicDuality + +namespace OAI + +/-! +# The algebraic endgame for recognition of solvable Lie lattices + +B. Farb and S. Weinberger, *Isometries, rigidity and universal covers*, +Annals of Mathematics 168 (2008), 915–940, Proposition 3.4, p.932, +states that every lattice in a connected solvable Lie group is polycyclic. +The lattice-polycyclicity predicate specializes this statement to uniform +lattices in connected simply connected solvable Lie groups. + +Elementary amenability and the finiteness and duality theorems give virtual +polycyclicity. Dekimpe's realization then produces a finite-index lattice in +a possibly different solvable Lie group. Elementary amenability remains an +explicit premise of these conditional recognition theorems. +-/ + +namespace PolycyclicRecognition + +/-- The simply connected uniform-lattice specialization of +Farb–Weinberger (2008), Proposition 3.4. -/ +def FarbWeinbergerLatticeInput : Prop := + ∀ (S : SimplyConnectedSolvableLieModel) (Λ : Subgroup S.carrier), + IsUniformLattice Λ → IsPolycyclic Λ + +/-- Coarse comparison with an actual solvable Lie lattice supplies the +polycyclic comparison group for the elementary-amenable endgame. -/ +theorem virtuallyPolycyclic_of_elementaryAmenable_coarse_solvableLattice + (fw : FarbWeinbergerLatticeInput) + (liFP : LiFinitenessInput) (eaFP : ElementaryAmenableFinitenessInput) + (liPD : LiDualityInput) (bieri : BieriDualityInput) + (S : SimplyConnectedSolvableLieModel) (Λ : Subgroup S.carrier) + (hΛ : IsUniformLattice Λ) + (H : Type) [Group H] [Group.FG H] (hEA : IsElementaryAmenable H) + (e : GroupCoarseEquivalence Λ H) : IsVirtuallyPolycyclic H := by + have hpoly := fw S Λ hΛ + let := hpoly.finitelyGenerated + exact virtuallyPolycyclic_of_elementaryAmenable_coarse_virtualPolycyclic_proved + liFP eaFP liPD bieri Λ H hpoly.isVirtuallyPolycyclic e hEA + +/-- The lattice realization follows from the algebraic endgame and the +precisely stated published realization theorem. The ambient Lie group is +allowed to change, as in the manuscript's lattice-recognition statement. -/ +theorem exists_solvableLattice_of_elementaryAmenable_coarse_solvableLattice + (dekimpe : DekimpeLatticeRealizationInput) (fw : FarbWeinbergerLatticeInput) + (liFP : LiFinitenessInput) (eaFP : ElementaryAmenableFinitenessInput) + (liPD : LiDualityInput) (bieri : BieriDualityInput) + (S : SimplyConnectedSolvableLieModel) (Λ : Subgroup S.carrier) + (hΛ : IsUniformLattice Λ) + (H : Type) [Group H] [Group.FG H] (hEA : IsElementaryAmenable H) + (e : GroupCoarseEquivalence Λ H) : + ∃ Γ : Subgroup H, Γ.FiniteIndex ∧ + ∃ (S' : SimplyConnectedSolvableLieModel) (Λ' : Subgroup S'.carrier), + IsUniformLattice Λ' ∧ Nonempty (Γ ≃* Λ') := by + apply exists_uniform_solvable_lattice_of_virtuallyPolycyclic dekimpe H + exact virtuallyPolycyclic_of_elementaryAmenable_coarse_solvableLattice + fw liFP eaFP liPD bieri S Λ hΛ H hEA e + +end PolycyclicRecognition + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/TriangulableLatticePolycyclic.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/TriangulableLatticePolycyclic.lean new file mode 100644 index 0000000000000000000000000000000000000000..c3004a2bb57a88024c48957a4750a407d922e910 --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/TriangulableLatticePolycyclic.lean @@ -0,0 +1,42 @@ +import OAI.GroupTheory.PolycyclicRecognition.Geometry.DiscreteHeightKernel +import OAI.GroupTheory.PolycyclicRecognition.Lattices.UniformLatticeFiniteGeneration +import OAI.GroupTheory.PolycyclicRecognition.Analysis.ConstructChainMetric +import OAI.GroupTheory.PolycyclicRecognition.Geometry.MatrixDifferentialFromSmoothness + +namespace OAI + +/-! # Polycyclicity of lattices in the actual triangulable model + +Finite generation comes from compactness and metric chains. The real triangular +adjoint representation then identifies a polycyclic kernel and abelian height +quotient. No lattice structure theorem is assumed for this specialization. +-/ + +noncomputable section +namespace PolycyclicRecognition + +open scoped Manifold + +/-- The uniform-lattice polycyclicity theorem for a real-triangulable, +connected simply connected solvable Lie model. -/ +theorem isPolycyclic_uniformLattice_of_realTriangulable + (S : SimplyConnectedSolvableLieModel) (hS : IsRealTriangulable S) + (Λ : Subgroup S.carrier) (hΛ : IsUniformLattice Λ) : IsPolycyclic Λ := by + obtain ⟨d⟩ := S.nonempty_properChainMetric geodesicMetricExistenceInput + let := d.compatibleMetric + let := d.proper_compatibleMetric + let := d.isometric_compatibleMetric + let : IsTopologicalGroup S.carrier := + topologicalGroup_of_lieGroup (𝓘(ℝ, S.modelSpace)) ⊤ + let : DiscreteTopology Λ := hΛ.1 + let : Group.FG Λ := hΛ.finitelyGenerated d.chains_compatibleMetric + obtain ⟨a, ⟨T⟩⟩ := hS.exists_triangularAdjoint matrixLieDifferentialInput S + exact isPolycyclic_finitelyGenerated_discrete_of_triangularAdjoint T + (groupExponential (E := S.modelSpace) (G := S.carrier)) + groupExponential_isGroupExponential Λ + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/TwoStepFiniteIndexRealization.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/TwoStepFiniteIndexRealization.lean new file mode 100644 index 0000000000000000000000000000000000000000..d42f166e61f8636f4fe12d081cd16ce7117d8fde --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/TwoStepFiniteIndexRealization.lean @@ -0,0 +1,46 @@ +import OAI.GroupTheory.PolycyclicRecognition.Lattices.TwoStepLatticeRealization + +namespace OAI + +/-! # Finite-index lattice realization for two-step nilpotent groups -/ + +noncomputable section +namespace PolycyclicRecognition +open scoped IsMulCommutative commutatorElement + +theorem commutator_le_center_of_injective {H G : Type*} [Group H] [Group G] + (f : H →* G) (hf : Function.Injective f) (h2 : commutator G ≤ Subgroup.center G) : + commutator H ≤ Subgroup.center H := by + rw [commutator_def] + apply Subgroup.commutator_le.mpr + intro a _ b _ + apply Subgroup.mem_center_iff.mpr + intro c + apply hf + rw [map_mul, map_mul, map_commutatorElement] + have hab : ⁅f a, f b⁆ ∈ commutator G := + Subgroup.commutator_mem_commutator (Subgroup.mem_top _) (Subgroup.mem_top _) + exact Subgroup.mem_center_iff.mp (h2 hab) (f c) + +theorem twoStep_finiteIndex_lattice_realization {G : Type} [Group G] [Group.FG G] + (h2 : commutator G ≤ Subgroup.center G) : + ∃ (Γ : Subgroup G), Γ.FiniteIndex ∧ + ∃ (S : SimplyConnectedSolvableLieModel) (Λ : Subgroup S.carrier), + IsUniformLattice Λ ∧ Nonempty (Γ ≃* Λ) := by + let : IsMulCommutative (G ⧸ Subgroup.center G) := + Subgroup.Normal.quotient_commutative_iff_commutator_le.mpr h2 + let : Group.IsNilpotent G := + Subgroup.isNilpotent_of_ker_le_center (QuotientGroup.mk' (Subgroup.center G)) (by + rw [QuotientGroup.ker_mk']) + obtain ⟨Γ, hΓ, htf⟩ := + (isPolycyclic_of_finitelyGenerated_nilpotent G).exists_torsionFree_finiteIndex + let := hΓ + obtain ⟨S, Λ, hΛ, e⟩ := twoStep_torsionFree_lattice_realization + (commutator_le_center_of_injective Γ.subtype Subtype.val_injective h2) htf + exact ⟨Γ, hΓ, S, Λ, hΛ, e⟩ + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/TwoStepLatticeRealization.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/TwoStepLatticeRealization.lean new file mode 100644 index 0000000000000000000000000000000000000000..2bd1710af4ee78a6305632783627f455874f1230 --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/TwoStepLatticeRealization.lean @@ -0,0 +1,46 @@ +import OAI.GroupTheory.PolycyclicRecognition.Algebra.FreeAbelianCentralExtension +import OAI.GroupTheory.PolycyclicRecognition.Geometry.NilpotentCentralRoots +import OAI.GroupTheory.PolycyclicRecognition.Algebra.PolycyclicTorsionFree + +namespace OAI + +/-! # Lattice realization for groups of nilpotency class at most two -/ + +noncomputable section +namespace PolycyclicRecognition +open scoped IsMulCommutative +variable {G : Type} [Group G] [Group.FG G] + +theorem twoStep_torsionFree_lattice_realization + (h2 : commutator G ≤ Subgroup.center G) (htf : HasNoNontrivialTorsion G) : + ∃ (S : SimplyConnectedSolvableLieModel) (Λ : Subgroup S.carrier), + IsUniformLattice Λ ∧ Nonempty (G ≃* Λ) := by + let Z := Subgroup.center G + let : IsMulCommutative (G ⧸ Z) := + Subgroup.Normal.quotient_commutative_iff_commutator_le.mpr h2 + let : Group.IsNilpotent G := + Subgroup.isNilpotent_of_ker_le_center (QuotientGroup.mk' Z) (by + rw [QuotientGroup.ker_mk']) + let : Group.FG Z := CriticalPercolation.nilpotent_subgroup_fg G Z + obtain ⟨d, ⟨eQ⟩⟩ := exists_integralLattice_equiv + (nilpotent_centerQuotient_torsionFree htf) + let q : G →* Multiplicative (Fin d → ℤ) := + eQ.symm.toMonoidHom.comp (QuotientGroup.mk' Z) + have hq : Function.Surjective q := eQ.symm.surjective.comp (QuotientGroup.mk'_surjective Z) + have hker : q.ker = Z := by + ext g + change eQ.symm ((QuotientGroup.mk' Z) g) = 1 ↔ g ∈ Z + rw [← map_one eQ.symm, eQ.symm.injective.eq_iff] + exact QuotientGroup.eq_one_iff g + let : Group.FG q.ker := hker.symm ▸ (inferInstance : Group.FG Z) + let : IsMulCommutative q.ker := hker.symm ▸ (inferInstance : IsMulCommutative Z) + have hktf : HasNoNontrivialTorsion q.ker := + htf.of_injective q.ker.subtype Subtype.val_injective + obtain ⟨e, ⟨eZ⟩⟩ := exists_integralLattice_equiv hktf + exact freeAbelianCentralExtension_realization q hq (by rw [hker]) eZ + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/UniformLatticeEmbedding.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/UniformLatticeEmbedding.lean new file mode 100644 index 0000000000000000000000000000000000000000..1a729b5db969c7bfd6903a3a61ca87c5354b9586 --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/UniformLatticeEmbedding.lean @@ -0,0 +1,79 @@ +import OAI.GroupTheory.PolycyclicRecognition.Lattices.UniformLatticeTransport +import Mathlib.Topology.Homeomorph.Lemmas +import Mathlib.GroupTheory.Index + +namespace OAI + +/-! # Uniform lattices under cocompact embeddings and finite index -/ + +noncomputable section +namespace PolycyclicRecognition +open Set +open scoped Pointwise + +variable {G H : Type*} [Group G] [Group H] [TopologicalSpace G] [TopologicalSpace H] + +/-- A topological group embedding with a compact right fundamental cover +carries uniform lattices to uniform lattices. -/ +theorem IsUniformLattice.map_of_compact_cover [IsTopologicalGroup H] + {Λ : Subgroup G} (hΛ : IsUniformLattice Λ) (f : G →* H) + (hf : Topology.IsEmbedding f) (K : Set H) (hK : IsCompact K) + (hcover : ∀ h : H, ∃ (g : G) (k : H), k ∈ K ∧ f g * k = h) : + IsUniformLattice (Λ.map f) := by + let := hΛ.1 + have hi : Topology.IsEmbedding (fun a : Λ => f a) := hf.comp .subtypeVal + have hr : Set.range (fun a : Λ => f a) = (Λ.map f : Set H) := by + ext h + constructor + · rintro ⟨a, rfl⟩ + exact ⟨a, a.property, rfl⟩ + · rintro ⟨a, ha, rfl⟩ + exact ⟨⟨a, ha⟩, rfl⟩ + have hdisc : DiscreteTopology (Λ.map f) := by + change DiscreteTopology (Λ.map f : Set H) + rw [← hr] + exact hi.toHomeomorph.symm.isEmbedding.discreteTopology + obtain ⟨F, hF, hcovF⟩ := hΛ.2 + refine ⟨hdisc, (f '' F) * K, (hF.image hf.continuous).mul hK, ?_⟩ + intro h + obtain ⟨g, k, hk, hg⟩ := hcover h + obtain ⟨a, u, hu, ha⟩ := hcovF g + refine ⟨⟨f a, ⟨a, a.property, rfl⟩⟩, f u * k, ⟨f u, ⟨u, hu, rfl⟩, k, hk, rfl⟩, ?_⟩ + change f a * (f u * k) = h + rw [← mul_assoc, ← map_mul, ha, hg] + +/-- A finite-index subgroup of a uniform lattice is again uniform in the +same ambient group. -/ +theorem IsUniformLattice.finiteIndex [IsTopologicalGroup G] + {Λ : Subgroup G} (hΛ : IsUniformLattice Λ) (J : Subgroup Λ) [J.FiniteIndex] : + IsUniformLattice (J.map Λ.subtype) := by + let := hΛ.1 + have hle : J.map Λ.subtype ≤ Λ := by + rintro g ⟨a, _, rfl⟩ + exact a.property + let f : J.map Λ.subtype → Λ := Subgroup.inclusion hle + have hf : Continuous f := continuous_subtype_val.subtype_mk _ + have hdisc : DiscreteTopology (J.map Λ.subtype) := + DiscreteTopology.of_continuous_injective hf (Subgroup.inclusion_injective hle) + let R := Quotient (QuotientGroup.rightRel J) + let : Finite R := Finite.of_equiv (Λ ⧸ J) + (QuotientGroup.quotientRightRelEquivQuotientLeftRel J).symm + let reps : R → G := fun c => ((Quotient.out c : Λ) : G) + obtain ⟨K, hK, hcover⟩ := hΛ.2 + refine ⟨hdisc, Set.range reps * K, (Set.finite_range reps).isCompact.mul hK, ?_⟩ + intro g + obtain ⟨γ, k, hk, hγ⟩ := hcover g + let c : R := Quotient.mk (QuotientGroup.rightRel J) γ + let r : Λ := Quotient.out c + have hj : γ * r⁻¹ ∈ J := QuotientGroup.rightRel_apply.mp + (Quotient.exact' (Quotient.out_eq' c)) + refine ⟨⟨((γ * r⁻¹ : Λ) : G), ⟨γ * r⁻¹, hj, rfl⟩⟩, (r : G) * k, + ⟨r, ⟨c, rfl⟩, k, hk, rfl⟩, ?_⟩ + change ((γ : G) * (r : G)⁻¹) * ((r : G) * k) = g + rw [mul_assoc, inv_mul_cancel_left, hγ] + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/UniformLatticeFiniteGeneration.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/UniformLatticeFiniteGeneration.lean new file mode 100644 index 0000000000000000000000000000000000000000..744223a2d6d5ad48be5d4c0abf1a533dd5ce1f1b --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/UniformLatticeFiniteGeneration.lean @@ -0,0 +1,83 @@ +import OAI.GroupTheory.PolycyclicRecognition.Lattices.UniformLatticeMetric +import OAI.GroupTheory.PolycyclicRecognition.Analysis.LinearMetricChains +import Mathlib.GroupTheory.Finiteness + +namespace OAI + +/-! +# Finite generation of a uniform lattice from metric chains + +The bounded-distance lattice section sends ambient chains to bounded +lattice steps. The steps belong to one finite ball, which therefore +generates the lattice. This is the finite-generation part of the +Švarc argument, proved from compactness and explicit chains. +-/ + +noncomputable section + +namespace PolycyclicRecognition + +open Metric Set + +variable {G : Type*} [Group G] [MetricSpace G] [IsTopologicalGroup G] + [IsIsometricSMul G G] [ProperSpace G] + +omit [IsTopologicalGroup G] [ProperSpace G] in +/-- A uniform lattice in a metric group with linear metric chains +has a finite generating set contained in a single induced metric ball. -/ +theorem IsUniformLattice.exists_generating_ball {Λ : Subgroup G} + (hΛ : IsUniformLattice Λ) (C : LinearMetricChains G) : + ∃ B : ℝ, 0 ≤ B ∧ + Subgroup.closure (closedBall (1 : Λ) B) = ⊤ := by + obtain ⟨r, R, hR, hr, hrlip⟩ := hΛ.exists_metric_section + let B := R + R + C.step + have hRB : R ≤ B := by dsimp [B]; linarith [C.step_pos] + let K : Subgroup Λ := Subgroup.closure (closedBall (1 : Λ) B) + have hsmall (x : Λ) (hx : dist (1 : G) (x : G) ≤ B) : x ∈ K := by + apply Subgroup.subset_closure + change dist (x : G) 1 ≤ B + simpa only [dist_comm] using hx + have hdiff (x y : Λ) (hxy : dist (x : G) (y : G) ≤ B) : x⁻¹ * y ∈ K := by + apply hsmall + change dist (1 : G) ((x : G)⁻¹ * (y : G)) ≤ B + rwa [dist_one_groupDifference] + refine ⟨B, hR.trans hRB, ?_⟩ + apply top_unique + intro x _ + obtain ⟨n, p, hp0, hpn, _, hpstep⟩ := C.chain 1 (x : G) + have hstart : r (p 0) ∈ K := by + apply hsmall + rw [hp0] + exact (hr 1).trans hRB + have hvertices : ∀ i ≤ n, r (p i) ∈ K := by + intro i hi + induction i with + | zero => exact hstart + | succ i ih => + have hi' : i < n := Nat.lt_of_succ_le hi + have hprev := ih (Nat.le_of_lt hi') + have hnext : (r (p i))⁻¹ * r (p (i + 1)) ∈ K := by + apply hdiff + have hs := (hrlip (p i) (p (i + 1))).trans + (add_le_add (hpstep i hi') le_rfl) + change dist (r (p i) : G) (r (p (i + 1)) : G) ≤ _ at hs + simpa only [B, add_assoc, add_comm, add_left_comm] using hs + simpa only [mul_inv_cancel_left] using K.mul_mem hprev hnext + have hend : (r (p n))⁻¹ * x ∈ K := by + apply hdiff + rw [hpn, dist_comm] + exact (hr x).trans hRB + simpa only [mul_inv_cancel_left] using K.mul_mem (hvertices n le_rfl) hend + +/-- Compactness and linear ambient chains give finite generation without +any algebraic structure theorem for lattices. -/ +theorem IsUniformLattice.finitelyGenerated {Λ : Subgroup G} + (hΛ : IsUniformLattice Λ) (C : LinearMetricChains G) : Group.FG Λ := by + obtain ⟨B, _, hB⟩ := hΛ.exists_generating_ball C + exact Group.fg_iff.mpr ⟨closedBall (1 : Λ) B, hB, hΛ.finite_closedBall B⟩ + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/UniformLatticeFiniteIndexEmbedding.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/UniformLatticeFiniteIndexEmbedding.lean new file mode 100644 index 0000000000000000000000000000000000000000..bbfacda0563447aab01d693964d3752bad6a4d72 --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/UniformLatticeFiniteIndexEmbedding.lean @@ -0,0 +1,64 @@ +import OAI.GroupTheory.PolycyclicRecognition.Lattices.UniformLatticeEmbedding + +namespace OAI + +/-! # Pulling a lattice back through a closed finite-index embedding -/ + +noncomputable section +namespace PolycyclicRecognition +open Set +variable {G H : Type*} [Group G] [Group H] [TopologicalSpace G] [TopologicalSpace H] + +/-- If a closed subgroup contains the lattice, its induced lattice is uniform. -/ +theorem IsUniformLattice.comap_of_le_range + {Γ : Subgroup G} (hΓ : IsUniformLattice Γ) (f : H →* G) + (hf : Topology.IsClosedEmbedding f) (hle : Γ ≤ f.range) : + IsUniformLattice (Γ.comap f) := by + let := hΓ.1 + let g : Γ.comap f → Γ := fun x => ⟨f x, x.property⟩ + have hg : Continuous g := (hf.continuous.comp continuous_subtype_val).subtype_mk _ + have hdisc : DiscreteTopology (Γ.comap f) := + DiscreteTopology.of_continuous_injective hg (by + intro x y h + exact Subtype.ext (hf.injective (congrArg Subtype.val h))) + obtain ⟨K, hK, hcover⟩ := hΓ.2 + refine ⟨hdisc, f ⁻¹' K, hf.isCompact_preimage hK, ?_⟩ + intro x + obtain ⟨γ, k, hk, he⟩ := hcover (f x) + obtain ⟨a, ha⟩ := hle γ.property + have haΓ : a ∈ Γ.comap f := by change f a ∈ Γ; rw [ha]; exact γ.property + have hfk : f (a⁻¹ * x) = k := by + rw [map_mul, map_inv, ha, ← he, inv_mul_cancel_left] + refine ⟨⟨a, haΓ⟩, a⁻¹ * x, ?_, mul_inv_cancel_left a x⟩ + change f (a⁻¹ * x) ∈ K + rw [hfk] + exact hk + +/-- Restriction to a closed finite-index subgroup preserves a uniform lattice. -/ +theorem IsUniformLattice.comap_finiteIndex [IsTopologicalGroup G] + {Γ : Subgroup G} (hΓ : IsUniformLattice Γ) (f : H →* G) + (hf : Topology.IsClosedEmbedding f) [f.range.FiniteIndex] : + IsUniformLattice (Γ.comap f) := by + let J := f.range.comap Γ.subtype + let : J.FiniteIndex := inferInstance + have hJ := hΓ.finiteIndex J + have hle : J.map Γ.subtype ≤ f.range := by + rintro x ⟨y, hy, rfl⟩ + exact hy + have heq : (J.map Γ.subtype).comap f = Γ.comap f := by + ext x + constructor + · rintro ⟨y, _, hy⟩ + change f x ∈ Γ + rw [← hy] + exact y.property + · intro hx + exact ⟨⟨f x, hx⟩, ⟨x, rfl⟩, rfl⟩ + rw [← heq] + exact hJ.comap_of_le_range f hf hle + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/UniformLatticeMetric.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/UniformLatticeMetric.lean new file mode 100644 index 0000000000000000000000000000000000000000..652eb24af686a143e8b3190680dde76035972a0d --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/UniformLatticeMetric.lean @@ -0,0 +1,129 @@ +import OAI.GroupTheory.PolycyclicRecognition.Analysis.MetricCoarseBridge +import Mathlib.Topology.Algebra.OpenSubgroup +import Mathlib.Topology.MetricSpace.ProperSpace + +namespace OAI + +/-! +# Uniform lattice metric comparison + +A discrete subgroup with a compact set of right-coset representatives is a +uniform lattice. Its inclusion has a uniformly close section. This gives +the discrete-group coarse comparison required in the duality endgame from +a metric quasi-isometry to the ambient Lie group. Neither finite generation +nor a recognition conclusion is built into the lattice definition. +-/ + +noncomputable section + +namespace PolycyclicRecognition + +open Metric + +variable {G : Type*} [Group G] + +/-- A uniform lattice, expressed by discreteness and a compact fundamental +cover. Over a locally compact group this is equivalent to compactness of +the coset quotient. -/ +def IsUniformLattice [TopologicalSpace G] (Λ : Subgroup G) : Prop := + DiscreteTopology Λ ∧ ∃ K : Set G, IsCompact K ∧ + ∀ g : G, ∃ (γ : Λ) (k : G), k ∈ K ∧ (γ : G) * k = g + +variable [MetricSpace G] [IsTopologicalGroup G] [IsIsometricSMul G G] + +omit [IsTopologicalGroup G] in +/-- Compactness of a fundamental cover gives a uniform distance to the +lattice. -/ +theorem IsUniformLattice.exists_covering_radius {Λ : Subgroup G} + (hΛ : IsUniformLattice Λ) : + ∃ R : ℝ, 0 ≤ R ∧ ∀ g : G, ∃ γ : Λ, dist g (γ : G) ≤ R := by + obtain ⟨K, hK, hcover⟩ := hΛ.2 + obtain ⟨R, hR⟩ := hK.isBounded.subset_closedBall (1 : G) + refine ⟨max R 0, le_max_right _ _, fun g => ?_⟩ + obtain ⟨γ, k, hk, rfl⟩ := hcover g + refine ⟨γ, ?_⟩ + have hkR : dist k 1 ≤ R := hR hk + calc + dist ((γ : G) * k) (γ : G) = dist k 1 := by + simpa only [mul_one] using dist_mul_left (γ : G) k 1 + _ ≤ max R 0 := hkR.trans (le_max_left _ _) + +omit [IsIsometricSMul G G] in +/-- A discrete subgroup has finite metric balls in a proper ambient group. -/ +theorem IsUniformLattice.finite_closedBall [ProperSpace G] {Λ : Subgroup G} + (hΛ : IsUniformLattice Λ) (R : ℝ) : + (closedBall (1 : Λ) R).Finite := by + let := hΛ.1 + have hclosed : IsClosed (Λ : Set G) := Subgroup.isClosed_of_discreteTopology + have hcompact := hclosed.isClosedEmbedding_subtypeVal.isCompact_preimage + (isCompact_closedBall (1 : G) R) + exact hcompact.finite_of_discrete + +omit [IsTopologicalGroup G] in +/-- A uniformly close lattice section has explicit coarse Lipschitz bounds. -/ +theorem IsUniformLattice.exists_metric_section {Λ : Subgroup G} + (hΛ : IsUniformLattice Λ) : + ∃ (r : G → Λ) (R : ℝ), 0 ≤ R ∧ + (∀ g, dist g (r g : G) ≤ R) ∧ + (∀ x y, dist (r x) (r y) ≤ dist x y + (R + R)) := by + obtain ⟨R, hR, hcover⟩ := hΛ.exists_covering_radius + choose r hr using hcover + refine ⟨r, R, hR, hr, fun x y => ?_⟩ + change dist (r x : G) (r y : G) ≤ _ + calc + dist (r x : G) (r y : G) ≤ + dist (r x : G) x + dist x y + dist y (r y : G) := dist_triangle4 _ _ _ _ + _ ≤ R + dist x y + R := by + gcongr + exact (dist_comm (r x : G) x).trans_le (hr x) + exact hr y + _ = dist x y + (R + R) := by ring + +variable {H : Type*} [Group H] [MetricSpace H] [IsIsometricSMul H H] + +/-- A metric quasi-isometry to a group containing a uniform lattice gives +the actual coarse equivalence with that lattice used by the algebraic +duality comparison. All inverse and finite-difference estimates are proved. -/ +theorem IsUniformLattice.nonempty_coarseEquivalence [ProperSpace G] + {Λ : Subgroup G} (hΛ : IsUniformLattice Λ) (f : H → G) + (hfinite : ∀ R : ℝ, (closedBall (1 : H) R).Finite) + {K C K' C' E : ℝ} (hK : 0 ≤ K) (hK' : 0 ≤ K') + (hupper : ∀ x y, dist (f x) (f y) ≤ K * dist x y + C) + (hlower : ∀ x y, dist x y ≤ K' * dist (f x) (f y) + C') + (hsurj : ∀ g, ∃ x, dist g (f x) ≤ E) : + Nonempty (GroupCoarseEquivalence H Λ) := by + let : IsIsometricSMul Λ Λ := ⟨fun γ => Isometry.of_dist_eq (fun x y => by + change dist ((γ : G) * (x : G)) ((γ : G) * (y : G)) = dist (x : G) (y : G) + exact dist_mul_left (γ : G) (x : G) (y : G))⟩ + obtain ⟨r, R, _, hr, hrlip⟩ := hΛ.exists_metric_section + have hgupper (x y : H) : dist (r (f x)) (r (f y)) ≤ K * dist x y + (C + (R + R)) := by + exact (hrlip _ _).trans (by linarith [hupper x y]) + have hglower (x y : H) : dist x y ≤ + K' * dist (r (f x)) (r (f y)) + (K' * (R + R) + C') := by + have hd : dist (f x) (f y) ≤ dist (r (f x)) (r (f y)) + (R + R) := by + change dist (f x) (f y) ≤ dist (r (f x) : G) (r (f y) : G) + (R + R) + calc + dist (f x) (f y) ≤ dist (f x) (r (f x) : G) + + dist (r (f x) : G) (r (f y) : G) + dist (r (f y) : G) (f y) := + dist_triangle4 _ _ _ _ + _ ≤ R + dist (r (f x) : G) (r (f y) : G) + R := by + gcongr + exact hr (f x) + exact (dist_comm (r (f y) : G) (f y)).trans_le (hr (f y)) + _ = dist (r (f x) : G) (r (f y) : G) + (R + R) := by ring + calc + dist x y ≤ K' * dist (f x) (f y) + C' := hlower x y + _ ≤ K' * (dist (r (f x)) (r (f y)) + (R + R)) + C' := by gcongr + _ = K' * dist (r (f x)) (r (f y)) + (K' * (R + R) + C') := by ring + have hgsurj (γ : Λ) : ∃ x : H, dist γ (r (f x)) ≤ E + R := by + obtain ⟨x, hx⟩ := hsurj (γ : G) + refine ⟨x, (dist_triangle (γ : G) (f x) (r (f x))).trans ?_⟩ + exact add_le_add hx (hr (f x)) + exact ⟨groupCoarseEquivalenceOfQuasiIsometry (r ∘ f) hfinite hΛ.finite_closedBall + hK hK' hgupper hglower hgsurj⟩ + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/UniformLatticeQuotient.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/UniformLatticeQuotient.lean new file mode 100644 index 0000000000000000000000000000000000000000..ce5723178578cde847cb1e562530f10827a93be9 --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/UniformLatticeQuotient.lean @@ -0,0 +1,87 @@ +import OAI.GroupTheory.PolycyclicRecognition.Lattices.UniformLatticeMetric +import Mathlib.Topology.Algebra.Group.Quotient + +namespace OAI + +/-! # Compact quotient and compact fundamental cover + +The concrete uniform lattice definition agrees with the usual compact-coset- +quotient definition. Left and right cosets are interchanged by inversion. +-/ + +noncomputable section + +namespace PolycyclicRecognition + +open Set +open scoped Topology + +variable {G : Type*} [Group G] [TopologicalSpace G] [IsTopologicalGroup G] + +/-- The compact fundamental cover gives compactness of the ordinary right +coset quotient, without any normality assumption. -/ +theorem IsUniformLattice.compactSpace_quotient {Λ : Subgroup G} + (hΛ : IsUniformLattice Λ) : CompactSpace (G ⧸ Λ) := by + obtain ⟨K, hK, hcover⟩ := hΛ.2 + let q : G → G ⧸ Λ := QuotientGroup.mk + have hsurj : (fun k => q k⁻¹) '' K = univ := by + apply eq_univ_of_forall + intro y + obtain ⟨a, rfl⟩ := QuotientGroup.mk_surjective y + obtain ⟨γ, k, hk, heq⟩ := hcover a⁻¹ + refine ⟨k, hk, ?_⟩ + apply QuotientGroup.eq.mpr + simp only [inv_inv] + have hka : k * a = (γ : G)⁻¹ := by + calc + k * a = (γ : G)⁻¹ * ((γ : G) * k) * a := by group + _ = (γ : G)⁻¹ := by rw [heq]; group + rw [hka] + exact Λ.inv_mem γ.property + apply isCompact_univ_iff.mp + rw [← hsurj] + exact hK.image (QuotientGroup.continuous_mk.comp continuous_inv) + +/-- In a locally compact group, a compact coset quotient admits a compact +fundamental cover. The finite subcover consists of images of relatively +compact neighborhoods. -/ +theorem isUniformLattice_of_compact_quotient [LocallyCompactSpace G] + (Λ : Subgroup G) [DiscreteTopology Λ] [CompactSpace (G ⧸ Λ)] : + IsUniformLattice Λ := by + let q : G → G ⧸ Λ := QuotientGroup.mk + choose K hK hneigh using fun x : G => exists_compact_mem_nhds x + have hxK (x : G) : x ∈ interior (K x) := mem_interior_iff_mem_nhds.mpr (hneigh x) + have hcover : (univ : Set (G ⧸ Λ)) ⊆ ⋃ x : G, q '' interior (K x) := by + intro y _ + obtain ⟨x, rfl⟩ := QuotientGroup.mk_surjective y + exact mem_iUnion.mpr ⟨x, ⟨x, hxK x, rfl⟩⟩ + obtain ⟨F, hF⟩ := isCompact_univ.elim_finite_subcover + (fun x : G => q '' interior (K x)) + (fun x => QuotientGroup.isOpenMap_coe _ isOpen_interior) hcover + let L : Set G := ⋃ x ∈ F, K x + have hL : IsCompact L := F.isCompact_biUnion (fun x _ => hK x) + refine ⟨inferInstance, Inv.inv '' L, hL.image continuous_inv, ?_⟩ + intro g + obtain ⟨x, hx, k, hk, hkg⟩ := mem_iUnion₂.mp (hF (mem_univ (q g⁻¹))) + have hrel : k⁻¹ * g⁻¹ ∈ Λ := QuotientGroup.eq.mp hkg + refine ⟨⟨g * k, ?_⟩, k⁻¹, ⟨k, ?_, rfl⟩, ?_⟩ + · simpa only [mul_inv_rev, inv_inv] using Λ.inv_mem hrel + · exact mem_iUnion₂.mpr ⟨x, hx, interior_subset hk⟩ + · simp [mul_assoc] + +/-- This is the usual uniform-lattice predicate in locally compact groups. -/ +theorem isUniformLattice_iff_compact_quotient [LocallyCompactSpace G] (Λ : Subgroup G) : + IsUniformLattice Λ ↔ DiscreteTopology Λ ∧ CompactSpace (G ⧸ Λ) := by + constructor + · intro h + exact ⟨h.1, h.compactSpace_quotient⟩ + · rintro ⟨hdisc, hcompact⟩ + let := hdisc + let := hcompact + exact isUniformLattice_of_compact_quotient Λ + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/UniformLatticeTransport.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/UniformLatticeTransport.lean new file mode 100644 index 0000000000000000000000000000000000000000..4ad33e98c89819d8025d335e36dd65b6c04c93ad --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/UniformLatticeTransport.lean @@ -0,0 +1,45 @@ +import OAI.GroupTheory.PolycyclicRecognition.Lattices.UniformLatticeMetric + +namespace OAI + +/-! # Transporting a compact lattice cover through a group homeomorphism -/ + +noncomputable section +namespace PolycyclicRecognition +variable {G H : Type*} [Group G] [Group H] [TopologicalSpace G] [TopologicalSpace H] + +omit [TopologicalSpace G] [TopologicalSpace H] in +def comapSubgroupEquiv (e : G ≃* H) (Λ : Subgroup H) : + (Λ.comap e.toMonoidHom) ≃* Λ where + toFun x := ⟨e x.val, x.property⟩ + invFun y := ⟨e.symm y.val, by change e (e.symm y.val) ∈ Λ; rw [e.apply_symm_apply]; exact y.property⟩ + left_inv x := by apply Subtype.ext; exact e.symm_apply_apply x.val + right_inv y := by apply Subtype.ext; exact e.apply_symm_apply y.val + map_mul' x y := by apply Subtype.ext; exact e.map_mul x.val y.val + +theorem IsUniformLattice.comap_mulEquiv (e : G ≃* H) + (he : Continuous e) (hei : Continuous e.symm) + {Λ : Subgroup H} (hΛ : IsUniformLattice Λ) : + IsUniformLattice (Λ.comap e.toMonoidHom) := by + let := hΛ.1 + let f : Λ.comap e.toMonoidHom → Λ := fun x => ⟨e x.val, x.property⟩ + have hf : Continuous f := (he.comp continuous_subtype_val).subtype_mk _ + have hdisc : DiscreteTopology (Λ.comap e.toMonoidHom) := + DiscreteTopology.of_continuous_injective hf (by + intro x y h + apply Subtype.ext + exact e.injective (congrArg Subtype.val h)) + obtain ⟨K, hK, hc⟩ := hΛ.2 + refine ⟨hdisc, e.symm '' K, hK.image hei, ?_⟩ + intro g + obtain ⟨a, k, hk, h⟩ := hc (e g) + refine ⟨⟨e.symm a.val, by change e (e.symm a.val) ∈ Λ; rw [e.apply_symm_apply]; exact a.property⟩, + e.symm k, ⟨k, hk, rfl⟩, ?_⟩ + change e.symm a.val * e.symm k = g + rw [← map_mul, h, e.symm_apply_apply] + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/UniformLatticeWordMetric.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/UniformLatticeWordMetric.lean new file mode 100644 index 0000000000000000000000000000000000000000..00f4e218a14b713602f2607f46a4618d93155f72 --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/UniformLatticeWordMetric.lean @@ -0,0 +1,77 @@ +import OAI.GroupTheory.PolycyclicRecognition.Lattices.UniformLatticeFiniteGeneration +import OAI.GroupTheory.PolycyclicRecognition.Analysis.WordMetricBridge +import OAI.GroupTheory.PolycyclicRecognition.Analysis.ProperCocompactMetric +import Mathlib.Topology.Maps.Proper.CompactlyGenerated + +namespace OAI + +/-! +# Comparing a lattice word metric with its ambient metric + +The inclusion of a uniform lattice, equipped with any finite word metric, +is continuous and proper. Applying the proved chain argument therefore +gives both quasi-isometry inequalities and coarse surjectivity. +-/ + +noncomputable section + +namespace PolycyclicRecognition + +open Metric Set + +variable {G : Type*} [Group G] [MetricSpace G] [IsTopologicalGroup G] + [IsIsometricSMul G G] [ProperSpace G] + +/-- A uniform lattice with any finite word metric is quasi-isometric to its +ambient group, provided that the ambient metric has linear chains. -/ +theorem IsUniformLattice.wordMetric_quasiIsometry {Λ : Subgroup G} + (hΛ : IsUniformLattice Λ) (C : LinearMetricChains G) + {ι : Type*} [Finite ι] (P : Group.Generators Λ ι) : + ∃ A B A' B' E : ℝ, 0 ≤ A ∧ 0 ≤ B ∧ 0 ≤ A' ∧ 0 ≤ B' ∧ 0 ≤ E ∧ + (∀ x y : Λ, dist (x : G) (y : G) ≤ A * (P.wordLength (x⁻¹ * y) : ℝ) + B) ∧ + (∀ x y : Λ, (P.wordLength (x⁻¹ * y) : ℝ) ≤ A' * dist (x : G) (y : G) + B') ∧ + (∀ g : G, ∃ x : Λ, dist g (x : G) ≤ E) := by + have hfinite : ∀ K : Set G, IsCompact K → (Subtype.val ⁻¹' K : Set Λ).Finite := by + let := hΛ.1 + have hclosed : IsClosed (Λ : Set G) := Subgroup.isClosed_of_discreteTopology + intro K hK + exact (hclosed.isClosedEmbedding_subtypeVal.isCompact_preimage hK).finite_of_discrete + obtain ⟨K, hK, hcover⟩ := hΛ.2 + let m := P.normedGroup.toMetricSpace + let : MetricSpace Λ := m + let : PseudoMetricSpace Λ := m.toPseudoMetricSpace + let : PseudoEMetricSpace Λ := m.toPseudoMetricSpace.toPseudoEMetricSpace + let : UniformSpace Λ := m.toUniformSpace + let : TopologicalSpace Λ := m.toUniformSpace.toTopologicalSpace + let : Dist Λ := m.toPseudoMetricSpace.toDist + let : EDist Λ := m.toPseudoMetricSpace.toPseudoEMetricSpace.toEDist + let : ProperSpace Λ := proper_wordMetric P + let : DiscreteTopology Λ := discrete_wordMetric P + let : IsIsometricSMul Λ Λ := ⟨fun g => Isometry.of_dist_eq (fun x y => by + change (P.wordLength ((g * x)⁻¹ * (g * y)) : ℝ) = (P.wordLength (x⁻¹ * y) : ℝ) + simp only [mul_inv_rev, mul_assoc, inv_mul_cancel_left])⟩ + have hf : Continuous (Λ.subtype : Λ → G) := continuous_of_discreteTopology + have hproper : IsProperMap (Λ.subtype : Λ → G) := by + refine isProperMap_iff_isCompact_preimage.mpr ⟨hf, fun {K} hK => ?_⟩ + exact (hfinite K hK).isCompact + exact proper_cocompact_hom_quasiIsometry (wordMetric_linearChains P) C + Λ.subtype hf hproper K hK hcover + +/-- The finite generating family can itself be obtained from compactness +and the ambient chains. No finite generation assumption is needed. -/ +theorem IsUniformLattice.exists_wordMetric_quasiIsometry {Λ : Subgroup G} + (hΛ : IsUniformLattice Λ) (C : LinearMetricChains G) : + ∃ (n : ℕ) (P : Group.Generators Λ (Fin n)), + ∃ A B A' B' E : ℝ, 0 ≤ A ∧ 0 ≤ B ∧ 0 ≤ A' ∧ 0 ≤ B' ∧ 0 ≤ E ∧ + (∀ x y : Λ, dist (x : G) (y : G) ≤ A * (P.wordLength (x⁻¹ * y) : ℝ) + B) ∧ + (∀ x y : Λ, (P.wordLength (x⁻¹ * y) : ℝ) ≤ A' * dist (x : G) (y : G) + B') ∧ + (∀ g : G, ∃ x : Λ, dist g (x : G) ≤ E) := by + let := hΛ.finitelyGenerated C + obtain ⟨n, ⟨P⟩⟩ := Group.fg_iff_nonempty_finite_generators.mp (inferInstance : Group.FG Λ) + exact ⟨n, P, hΛ.wordMetric_quasiIsometry C P⟩ + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/VectorLatticeModel.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/VectorLatticeModel.lean new file mode 100644 index 0000000000000000000000000000000000000000..df48317039503b252105ae66eed5e353360c30a4 --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Lattices/VectorLatticeModel.lean @@ -0,0 +1,94 @@ +import OAI.GroupTheory.PolycyclicRecognition.Lattices.SolvableLatticeModel +import OAI.GroupTheory.PolycyclicRecognition.Algebra.TorsionFreeAbelianRank +import Mathlib.Algebra.Module.ZLattice.Basic +import Mathlib.Analysis.Convex.Contractible +import Mathlib.Geometry.Manifold.Instances.Real +import Mathlib.Geometry.Manifold.MFDeriv.NormedSpace + +namespace OAI + +/-! # The integral vector lattice as a solvable Lie lattice + +This constructs the abelian case of the lattice-realization input. The compact +fundamental cover is the closed unit parallelepiped of the standard real basis. +-/ + +noncomputable section +namespace PolycyclicRecognition +open scoped Manifold + +def vectorSolvableLieModel (n : ℕ) : SimplyConnectedSolvableLieModel := by + let V := Fin n → ℝ + let : ChartedSpace V (Multiplicative V) := inferInstanceAs (ChartedSpace V V) + let : LieGroup (𝓘(ℝ, V)) ⊤ (Multiplicative V) := + { toIsManifold := by change IsManifold (𝓘(ℝ, V)) ⊤ V; infer_instance + contMDiff_mul := by + change ContMDiff ((𝓘(ℝ, V)).prod (𝓘(ℝ, V))) (𝓘(ℝ, V)) ⊤ + (fun p : V × V => p.1 + p.2) + exact contMDiff_add (I := 𝓘(ℝ, V)) (n := ⊤) + contMDiff_inv := by + change ContMDiff (𝓘(ℝ, V)) (𝓘(ℝ, V)) ⊤ (fun v : V => -v) + exact contDiff_neg.contMDiff } + let : SimplyConnectedSpace (Multiplicative V) := inferInstanceAs (SimplyConnectedSpace V) + exact { modelSpace := V, carrier := Multiplicative V } + +def standardVectorLattice (n : ℕ) : Subgroup (vectorSolvableLieModel n).carrier := + (Submodule.span ℤ (Set.range (Pi.basisFun ℝ (Fin n)))).toAddSubgroup.toSubgroup + +theorem standardVectorLattice_uniform (n : ℕ) : IsUniformLattice (standardVectorLattice n) := by + let b := Pi.basisFun ℝ (Fin n) + let L := Submodule.span ℤ (Set.range b) + change IsUniformLattice (G := Multiplicative (Fin n → ℝ)) L.toAddSubgroup.toSubgroup + have hdisc : DiscreteTopology (standardVectorLattice n) := + inferInstanceAs (DiscreteTopology L) + let K : Set (Fin n → ℝ) := parallelepiped b + have hK : IsCompact K := b.parallelepiped.isCompact + refine ⟨hdisc, K, hK, ?_⟩ + intro g + let z := ZSpan.floor b g.toAdd + refine ⟨⟨Multiplicative.ofAdd (z : Fin n → ℝ), z.property⟩, + Multiplicative.ofAdd (ZSpan.fract b g.toAdd), ?_, ?_⟩ + · exact ZSpan.fundamentalDomain_subset_parallelepiped b + (ZSpan.fract_mem_fundamentalDomain b g.toAdd) + · change (z : Fin n → ℝ) + ZSpan.fract b g.toAdd = g.toAdd + dsimp only [z, ZSpan.fract] + abel + +def standardVectorLatticeEquiv (n : ℕ) : + IntegralLatticeGroup n ≃* standardVectorLattice n := by + let L := Submodule.span ℤ (Set.range (Pi.basisFun ℝ (Fin n))) + let b := IsZLattice.basis L + exact + { toFun := fun a => ⟨Multiplicative.ofAdd (b.equivFun.symm a.toAdd : Fin n → ℝ), + (b.equivFun.symm a.toAdd).property⟩ + invFun := fun a => Multiplicative.ofAdd (b.equivFun ⟨a.val.toAdd, a.property⟩) + left_inv := by + intro a + change Multiplicative.ofAdd (b.equivFun (b.equivFun.symm a.toAdd)) = a + rw [LinearEquiv.apply_symm_apply] + rfl + right_inv := by + intro a + apply Subtype.ext + change Multiplicative.ofAdd + (b.equivFun.symm (b.equivFun ⟨a.val.toAdd, a.property⟩) : Fin n → ℝ) = a.val + rw [LinearEquiv.symm_apply_apply] + rfl + map_mul' := by + intro a c + apply Subtype.ext + change Multiplicative.ofAdd (b.equivFun.symm (a.toAdd + c.toAdd) : Fin n → ℝ) = _ + rw [map_add] + rfl } + +theorem integralLattice_solvable_realization (n : ℕ) : + ∃ (S : SimplyConnectedSolvableLieModel) (Λ : Subgroup S.carrier), + IsUniformLattice Λ ∧ Nonempty (IntegralLatticeGroup n ≃* Λ) := + ⟨vectorSolvableLieModel n, standardVectorLattice n, standardVectorLattice_uniform n, + ⟨standardVectorLatticeEquiv n⟩⟩ + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/Recognition.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/Recognition.lean new file mode 100644 index 0000000000000000000000000000000000000000..c7b29a85e013a365f29c1e441fec94b5a6c40137 --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/Recognition.lean @@ -0,0 +1,100 @@ +import OAI.GroupTheory.PolycyclicRecognition.GromovImport +import OAI.GroupTheory.PolycyclicRecognition.RecognitionFromGromov +import OAI.GroupTheory.PolycyclicRecognition.ConditionalBoundedHeight +import OAI.GroupTheory.PolycyclicRecognition.CoarseFiniteGeneration +import OAI.GroupTheory.PolycyclicRecognition.FiniteCovolumeLattice + +namespace OAI + +/-! +# Unconditional quasi-isometric recognition of virtually polycyclic groups + +The geometric height theorem, finiteness and duality endgame, and solvable +lattice realization combine with Gromov's polynomial-growth theorem to yield +virtual polycyclicity and a finite-index uniform-lattice model. +-/ + +noncomputable section +namespace PolycyclicRecognition + +open Module LieAlgebra MeasureTheory +open scoped Manifold NNReal + +/-- The main group recognition theorem and its uniform-lattice realization. -/ +theorem group_recognition + {P J : Type} [Group P] [Group J] [Group.FG P] [Group.FG J] + (e : GroupCoarseEquivalence P J) (hP : IsVirtuallyPolycyclic P) : + IsVirtuallyPolycyclic J ∧ + ∃ Γ : Subgroup J, Γ.FiniteIndex ∧ + ∃ (S : SimplyConnectedSolvableLieModel) (Λ : Subgroup S.carrier), + IsUniformLattice Λ ∧ Nonempty (Γ ≃* Λ) := + group_recognition_of_gromov (fun _ => gromovPolynomialGrowthInput) e hP + +/-- A group quasi-isometric to a uniform solvable Lie lattice is virtually +isomorphic to a uniform lattice in a connected simply connected solvable Lie +group. The new ambient Lie group is allowed to differ from the original one. -/ +theorem uniform_lattice_recognition + (S : SimplyConnectedSolvableLieModel) (Λ : Subgroup S.carrier) + (hΛ : IsUniformLattice Λ) + {J : Type} [Group J] [Group.FG J] (e : GroupCoarseEquivalence Λ J) : + ∃ Γ : Subgroup J, Γ.FiniteIndex ∧ + ∃ (R : SimplyConnectedSolvableLieModel) (Δ : Subgroup R.carrier), + IsUniformLattice Δ ∧ Nonempty (Γ ≃* Δ) := + uniform_lattice_recognition_of_gromov (fun _ => gromovPolynomialGrowthInput) S Λ hΛ e + +/-- The metric formulation, retaining the concrete proper word-metric data. -/ +theorem recognition_and_lattice + {P J : Type} [Group P] [Group J] [MetricSpace P] [MetricSpace J] + [IsIsometricSMul P P] [IsIsometricSMul J J] [Group.FG P] [Group.FG J] + [DiscreteTopology J] [ProperSpace J] + [MeasurableSpace J] [BorelSpace J] [MeasurableMul J] + (e : MetricQuasiEquivalence P J) (hP : IsVirtuallyPolycyclic P) + (CP : LinearMetricChains P) + (hPfinite : ∀ r : ℝ, (Metric.closedBall (1 : P) r).Finite) : + IsVirtuallyPolycyclic J ∧ + ∃ Γ : Subgroup J, Γ.FiniteIndex ∧ + ∃ (S : SimplyConnectedSolvableLieModel) (Λ : Subgroup S.carrier), + IsUniformLattice Λ ∧ Nonempty (Γ ≃* Λ) := + recognition_and_lattice_of_gromov (fun _ => gromovPolynomialGrowthInput) e hP CP hPfinite + +/-- The full finite-covolume lattice corollary. Finite generation of the source +lattice follows from the given coarse equivalence. The existing discrete +subgroup theorem then supplies its polycyclicity, without a uniformity input. -/ +theorem lattice_recognition + (S : SimplyConnectedSolvableLieModel) (Λ : Subgroup S.carrier) + (hΛ : IsFiniteCovolumeLattice Λ) + {J : Type} [Group J] [Group.FG J] (e : GroupCoarseEquivalence Λ J) : + ∃ Γ : Subgroup J, Γ.FiniteIndex ∧ + ∃ (R : SimplyConnectedSolvableLieModel) (Δ : Subgroup R.carrier), + IsUniformLattice Δ ∧ Nonempty (Γ ≃* Δ) := by + obtain ⟨d⟩ := S.nonempty_properChainMetric geodesicMetricExistenceInput + let := d.compatibleMetric + let : Group.FG Λ := e.symm.finitelyGenerated + let : DiscreteTopology Λ := hΛ.1 + have hpoly : IsPolycyclic Λ := + isPolycyclic_finitelyGenerated_discrete_solvableLieGroup + (E := S.modelSpace) Λ + exact (group_recognition e hpoly.isVirtuallyPolycyclic).2 + +/-- The standalone geometric main theorem of the paper. -/ +theorem main_uniform_bounded_height + (R : SimplyConnectedSolvableLieModel) (d : ProperChainMetric R.carrier) + {a : ℕ} (T : TriangularAdjoint (GroupLieAlgebra (𝓘(ℝ, R.modelSpace)) R.carrier) a) + (huni : ModelIsUnimodular R) + {W : Type} [NormedAddCommGroup W] [NormedSpace ℝ W] [FiniteDimensional ℝ W] + (q : HeightSpace T.character ≃ₗ[ℝ] W) + (Exp : GroupLieAlgebra (𝓘(ℝ, R.modelSpace)) R.carrier → R.carrier) + (hExp : IsGroupExponential Exp) (π : R.carrier →* Multiplicative W) + (hπExp : ∀ x, (π (Exp x)).toAdd = q (heightProjection T.character x)) : + letI := d.compatibleMetric + ∃ A : Subgroup (W ≃ₗ[ℝ] W), Set.Finite (A : Set (W ≃ₗ[ℝ] W)) ∧ + ∀ K C : ℝ, 1 ≤ K → 0 ≤ C → ∃ B : ℝ, 0 ≤ B ∧ + ∀ F : SelfQuasiIsometry R.carrier K C, ∃ AF : A, ∀ g, + ‖(π (F.toFun g)).toAdd - ((π (F.toFun 1)).toAdd + AF.val (π g).toAdd)‖ ≤ B := + uniform_bounded_height R d T huni q Exp hExp π hπExp + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/PolycyclicRecognition/RecognitionFromGromov.lean b/lean/OAI/GroupTheory/PolycyclicRecognition/RecognitionFromGromov.lean new file mode 100644 index 0000000000000000000000000000000000000000..335cd3afae388b19e3ae163d0c833beb758edf3a --- /dev/null +++ b/lean/OAI/GroupTheory/PolycyclicRecognition/RecognitionFromGromov.lean @@ -0,0 +1,123 @@ +import OAI.GroupTheory.PolycyclicRecognition.Algebra.ConditionalGroupRecognition +import OAI.GroupTheory.PolycyclicRecognition.Algebra.RecognitionWithoutKMN + +namespace OAI + +/-! # Recognition from the polynomial-growth theorem + +The geometric height estimate, lattice realization, finiteness, and duality +combine with the exact polynomial-growth statement of Gromov's theorem. +-/ +noncomputable section +namespace PolycyclicRecognition +open Module LieAlgebra MeasureTheory +open scoped Manifold NNReal +attribute [local instance] stationaryL2Action zeroMeanL2Action + +theorem recognition_and_lattice_of_gromov + (gromov : ∀ (K : Type) [Group K] [DecidableEq K], GromovPolynomialGrowthInput K) + {P J : Type} [Group P] [Group J] [MetricSpace P] [MetricSpace J] + [IsIsometricSMul P P] [IsIsometricSMul J J] [Group.FG P] [Group.FG J] + [DiscreteTopology J] [ProperSpace J] + [MeasurableSpace J] [BorelSpace J] [MeasurableMul J] + (e : MetricQuasiEquivalence P J) (hP : IsVirtuallyPolycyclic P) + (CP : LinearMetricChains P) + (hPfinite : ∀ r : ℝ, (Metric.closedBall (1 : P) r).Finite) : + IsVirtuallyPolycyclic J ∧ + ∃ Γ : Subgroup J, Γ.FiniteIndex ∧ + ∃ (S : SimplyConnectedSolvableLieModel) (Λ : Subgroup S.carrier), + IsUniformLattice Λ ∧ Nonempty (Γ ≃* Λ) := by + classical + obtain ⟨Γ, hΓ, S, Λ, hΛ, ⟨iso⟩⟩ := + exists_uniform_solvable_lattice_of_virtuallyPolycyclic dekimpeLatticeRealizationInput P hP + obtain ⟨R, a, T, dS, dR, hmodel⟩ := + exists_intrinsic_height_model_with_controlled_contraction cornulierTesseraModelInput + geodesicMetricExistenceInput lieRiemannianMetricInput matrixLieDifferentialInput S + let := dS.compatibleMetric + let := dR.toProperChainMetric.compatibleMetric + let := dS.proper_compatibleMetric + let := dS.isometric_compatibleMetric + let := dR.toProperChainMetric.proper_compatibleMetric + let := dR.toProperChainMetric.isometric_compatibleMetric + let : IsTopologicalGroup S.carrier := + topologicalGroup_of_lieGroup (𝓘(ℝ, S.modelSpace)) ⊤ + let : IsTopologicalGroup R.carrier := + topologicalGroup_of_lieGroup (𝓘(ℝ, R.modelSpace)) ⊤ + let : MeasurableSpace R.carrier := borel _ + let : BorelSpace R.carrier := ⟨rfl⟩ + obtain ⟨⟨eSR⟩, ⟨c⟩, q, Exp, π, hExp, hπExp, _, _, K, hK, hπLip⟩ := hmodel + obtain ⟨ePS⟩ := nonempty_original_lattice_comparison CP hPfinite Γ hΓ S Λ hΛ iso dS + let u := e.symm.trans (ePS.trans eSR) + let m : Measure R.carrier := Measure.haar + let : m.IsMulRightInvariant := + SimplyConnectedSolvableLieModel.isMulRightInvariant_of_lattice_comparison + isPolycyclic_uniformLattice_solvableLieGroup S R Λ hΛ + dS dR.toProperChainMetric eSR m + have hπ : LipschitzWith (⟨K, hK⟩ : ℝ≥0) (fun g => (π g).toAdd) := by + apply LipschitzWith.of_dist_le_mul + intro x y + rw [dist_eq_norm] + exact hπLip x y + have hunimod (x : GroupLieAlgebra (𝓘(ℝ, R.modelSpace)) R.carrier) : + LinearMap.trace ℝ _ (ad ℝ _ x) = 0 := + trace_ad_eq_zero_of_intrinsic_kernel_haar T q Exp hExp π hπ.continuous hπExp m x + obtain ⟨x, hx⟩ := LieAlgebra.exists_isCartanSubalgebra_engel ℝ + (GroupLieAlgebra (𝓘(ℝ, R.modelSpace)) R.carrier) + let H := LieSubalgebra.engel ℝ x + let : H.IsCartanSubalgebra := hx + obtain ⟨M⟩ := nonempty_cartanWordModel H T + have hheight := M.exists_uniform_height_intrinsic T hunimod q Exp hExp + m π hπExp hπ + dR.minimizing_compatibleMetric remezPolynomialInput geodesicMetricExistenceInput + exact recognition_and_lattice_of_uniform_normalized_height_proved dekimpeLatticeRealizationInput + e hP hPfinite T _ q π Exp hExp hπExp u gromov (M.supportIn T hunimod q) + hπ c dR.minimizing_compatibleMetric hheight + + +theorem group_recognition_of_gromov + (gromov : ∀ (K : Type) [Group K] [DecidableEq K], GromovPolynomialGrowthInput K) + {P J : Type} [Group P] [Group J] [Group.FG P] [Group.FG J] + (e : GroupCoarseEquivalence P J) (hP : IsVirtuallyPolycyclic P) : + IsVirtuallyPolycyclic J ∧ + ∃ Γ : Subgroup J, Γ.FiniteIndex ∧ + ∃ (S : SimplyConnectedSolvableLieModel) (Λ : Subgroup S.carrier), + IsUniformLattice Λ ∧ Nonempty (Γ ≃* Λ) := by + obtain ⟨dP, hPd, hPi, hPp, ⟨CP⟩⟩ := exists_finite_word_metric P + let := dP + let := hPd + let := hPi + let := hPp + obtain ⟨dJ, hJd, hJi, hJp, ⟨CJ⟩⟩ := exists_finite_word_metric J + let := dJ + let := hJd + let := hJi + let := hJp + let : MeasurableSpace J := borel _ + let : BorelSpace J := ⟨rfl⟩ + have hPfinite (r : ℝ) : (Metric.closedBall (1 : P) r).Finite := + (isCompact_closedBall (1 : P) r).finite_of_discrete + have hJfinite (r : ℝ) : (Metric.closedBall (1 : J) r).Finite := + (isCompact_closedBall (1 : J) r).finite_of_discrete + exact recognition_and_lattice_of_gromov gromov + (e.metric CP CJ hPfinite hJfinite) hP CP hPfinite + +/-- In particular a group quasi-isometric to a uniform solvable Lie lattice +has a finite-index subgroup which is a uniform solvable Lie lattice. -/ +theorem uniform_lattice_recognition_of_gromov + (gromov : ∀ (K : Type) [Group K] [DecidableEq K], GromovPolynomialGrowthInput K) + (S : SimplyConnectedSolvableLieModel) (Λ : Subgroup S.carrier) + (hΛ : IsUniformLattice Λ) + {J : Type} [Group J] [Group.FG J] (e : GroupCoarseEquivalence Λ J) : + ∃ Γ : Subgroup J, Γ.FiniteIndex ∧ + ∃ (R : SimplyConnectedSolvableLieModel) (Δ : Subgroup R.carrier), + IsUniformLattice Δ ∧ Nonempty (Γ ≃* Δ) := by + have hpoly := isPolycyclic_uniformLattice_solvableLieGroup S Λ hΛ + let := hpoly.finitelyGenerated + exact (group_recognition_of_gromov gromov e hpoly.isVirtuallyPolycyclic).2 + + +end PolycyclicRecognition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/Presentation/KernelCycles.lean b/lean/OAI/GroupTheory/Presentation/KernelCycles.lean new file mode 100644 index 0000000000000000000000000000000000000000..f2268ca1f5cc5a2044befd4a9328cbab8d271c40 --- /dev/null +++ b/lean/OAI/GroupTheory/Presentation/KernelCycles.lean @@ -0,0 +1,284 @@ +import OAI.Topology.EilenbergGanea.PresentationAlignment +import OAI.AlgebraicTopology.Cubical.PathChains +import Mathlib.GroupTheory.Abelianization.Defs +import Mathlib.GroupTheory.FreeGroup.IsFreeGroup + +namespace OAI + +noncomputable section + +open Classical Set Filter Topology MeasureTheory +open scoped Quaternion ContDiff + + + +namespace EilenbergGanea.KernelCycles +open Classical +variable {G A : Type*} [Group G] (a : A → G) +abbrev Kernel := (wordValue a).ker +abbrev AbKernel := Additive (Abelianization (Kernel a)) + +def kernelChainHom : Kernel a →* Multiplicative (cycles a) where + toFun w := Multiplicative.ofAdd ⟨pathChain a w.val 1,by + change edgeBoundary a (pathChain a w.val 1) = 0 + rw [edgeBoundary_pathChain,w.property,mul_one,sub_self]⟩ + map_one' := by apply (Equiv.refl _ : Multiplicative (cycles a) ≃ cycles a).injective; apply Subtype.ext; exact pathChain_one a 1 + map_mul' w z := by + apply (Equiv.refl _ : Multiplicative (cycles a) ≃ cycles a).injective + apply Subtype.ext + change pathChain a (w.val*z.val) 1 = pathChain a w.val 1 + pathChain a z.val 1 + rw [pathChain_mul,w.property,mul_one] + +def abKernelToCycles : AbKernel a →ₗ[ℤ] cycles a := + (Abelianization.lift (kernelChainHom a)).toAdditive.toIntLinearMap + +@[simp] theorem abKernelToCycles_of (w : Kernel a) : + (abKernelToCycles a (Additive.ofMul (Abelianization.of w))).val = pathChain a w.val 1 := rfl + +variable (t : G → FreeGroup A) (ht : ∀ g, wordValue a (t g) = g) + +def bridge (w : FreeGroup A) (g : G) : Kernel a := + ⟨t g * w * (t (g * wordValue a w))⁻¹,by + change wordValue a (t g * w * (t (g * wordValue a w))⁻¹) = 1 + simp only [map_mul,map_inv,ht] + group⟩ + +@[simp] theorem bridge_one (g : G) : bridge a t ht 1 g = 1 := by + apply Subtype.ext + simp [bridge] + +theorem bridge_mul (w z : FreeGroup A) (g : G) : + bridge a t ht (w*z) g = bridge a t ht w g * bridge a t ht z (g * wordValue a w) := by + apply Subtype.ext + simp only [bridge,Subgroup.coe_mul,map_mul,mul_assoc] + group + +theorem bridge_inv (w : FreeGroup A) (g : G) : + bridge a t ht w⁻¹ g = (bridge a t ht w (g * (wordValue a w)⁻¹))⁻¹ := by + apply Subtype.ext + simp only [bridge,Subgroup.coe_inv,map_inv] + simp only [inv_mul_cancel_right] + group + +def bridgeAb (w : FreeGroup A) (g : G) : AbKernel a := + Additive.ofMul (Abelianization.of (bridge a t ht w g)) +@[simp] theorem bridgeAb_one (g : G) : bridgeAb a t ht 1 g = 0 := by simp [bridgeAb] +theorem bridgeAb_mul (w z : FreeGroup A) (g : G) : + bridgeAb a t ht (w*z) g = bridgeAb a t ht w g + bridgeAb a t ht z (g * wordValue a w) := by + unfold bridgeAb + rw [bridge_mul,map_mul] + rfl + +theorem bridgeAb_inv (w : FreeGroup A) (g : G) : + bridgeAb a t ht w⁻¹ g = -bridgeAb a t ht w (g * (wordValue a w)⁻¹) := by + unfold bridgeAb + rw [bridge_inv,map_inv] + rfl + +def chainsToKernel : BasedChains G A →ₗ[ℤ] AbKernel a := + Finsupp.linearCombination ℤ (fun p => bridgeAb a t ht (FreeGroup.of p.2) p.1) + +@[simp] theorem chainsToKernel_single (g : G) (x : A) (n : ℤ) : + chainsToKernel a t ht (Finsupp.single (g,x) n) = n • bridgeAb a t ht (FreeGroup.of x) g := by + simp [chainsToKernel] + +theorem chainsToKernel_pathChain (w : FreeGroup A) (g : G) : + chainsToKernel a t ht (pathChain a w g) = bridgeAb a t ht w g := by + induction w using FreeGroup.induction_on generalizing g with + | one => simp + | of x => simp + | inv_of x => rw [pathChain_inv,map_neg,bridgeAb_inv]; simp + | mul w z hw hz => rw [pathChain_mul,map_add,hw,hz,bridgeAb_mul] + +theorem bridgeAb_kernel (w : Kernel a) : bridgeAb a t ht w.val 1 = Additive.ofMul (Abelianization.of w) := by + let u : Kernel a := ⟨t 1,ht 1⟩ + have he : bridge a t ht w.val 1 = u*w*u⁻¹ := by + apply Subtype.ext + change t 1 * w.val * (t (1 * wordValue a w.val))⁻¹ = t 1 * w.val * (t 1)⁻¹ + rw [w.property,mul_one] + change Additive.ofMul (Abelianization.of (bridge a t ht w.val 1)) = _ + apply congrArg Additive.ofMul + rw [he,map_mul,map_mul,map_inv] + simp [mul_comm] + +theorem chains_kernel_inverse (w : AbKernel a) : + chainsToKernel a t ht (abKernelToCycles a w).val = w := by + revert w + change ∀ w : Abelianization (Kernel a), + chainsToKernel a t ht (abKernelToCycles a (Additive.ofMul w)).val = Additive.ofMul w + intro w + induction w using QuotientGroup.induction_on with + | H w => + change chainsToKernel a t ht (abKernelToCycles a (Additive.ofMul (Abelianization.of w))).val = Additive.ofMul (Abelianization.of w) + rw [abKernelToCycles_of,chainsToKernel_pathChain,bridgeAb_kernel] + +def anchors : (G →₀ ℤ) →ₗ[ℤ] BasedChains G A := Finsupp.linearCombination ℤ (fun g => pathChain a (t g) 1) + +theorem bridge_chain (w : FreeGroup A) (g : G) : + pathChain a (bridge a t ht w g).val 1 = + pathChain a (t g) 1 + pathChain a w g - pathChain a (t (g * wordValue a w)) 1 := by + change pathChain a (t g*w*(t (g*wordValue a w))⁻¹) 1 = _ + rw [pathChain_mul,pathChain_mul,pathChain_inv] + simp only [ht,map_mul,one_mul,mul_inv_cancel,sub_eq_add_neg] + +theorem kernel_chains_identity (c : BasedChains G A) : + (abKernelToCycles a (chainsToKernel a t ht c)).val = c - anchors a t (edgeBoundary a c) := by + have he : (cycles a).subtype.comp ((abKernelToCycles a).comp (chainsToKernel a t ht)) = + LinearMap.id - (anchors a t).comp (edgeBoundary a) := by + apply Finsupp.lhom_ext + rintro ⟨g,x⟩ n + simp only [LinearMap.comp_apply,chainsToKernel_single,map_smul,LinearMap.sub_apply, + LinearMap.id_apply,edgeBoundary_single] + change n • pathChain a (bridge a t ht (FreeGroup.of x) g).val 1 = + Finsupp.single (g,x) n - n • anchors a t (Finsupp.single (g*a x) 1 - Finsupp.single g 1) + rw [bridge_chain] + simp only [pathChain_of,wordValue,FreeGroup.lift_apply_of,anchors,map_sub,Finsupp.linearCombination_single,one_smul] + rw [← Finsupp.smul_single_one (g,x) n] + simp only [smul_add,smul_sub] + abel + exact LinearMap.congr_fun he c + +/-- The exact integral abelianized-kernel/Cayley-cycle comparison, with its +literal Fox/path-chain coefficients. No graph realization is assumed. -/ +def abKernelCycleEquiv : AbKernel a ≃ₗ[ℤ] cycles a := + LinearEquiv.ofLinearMap (abKernelToCycles a) ((chainsToKernel a t ht).comp (cycles a).subtype) + (by apply LinearMap.ext; intro c; apply Subtype.ext; exact (kernel_chains_identity a t ht c.val).trans (by rw [c.property,map_zero,sub_zero]; rfl)) + (by apply LinearMap.ext; intro w; exact chains_kernel_inverse a t ht w) + +end EilenbergGanea.KernelCycles + + +namespace EilenbergGanea.PresentationAlgebra +open Classical +universe u +variable {H : Type u} {G R : Type*} [Group H] [Group G] +variable (φ : H →* G) (hf : Function.Surjective φ) +variable (r : R → H) (hr : ∀ j, φ (r j) = 1) + +include hf in +/-- A kernel basis with genuine conjugate coefficients becomes the literal +Cayley relator-chain basis after choosing a free generating alphabet. -/ +theorem boundary_basis_of_free [IsFreeGroup H] + (hp : φ.ker = Subgroup.normalClosure (Set.range r)) + (B : BasedChains G R ≃ₗ[ℤ] Additive (Abelianization φ.ker)) + (hB : ∀ g j, ∃ k : H, φ k = g ∧ B (Finsupp.single (g,j) 1) = + Additive.ofMul (Abelianization.of (⟨k*r j*k⁻¹,by + change φ (k*r j*k⁻¹) = 1 + rw [map_mul,map_mul,map_inv,hr,mul_one,mul_inv_cancel]⟩ : φ.ker))) : + ∃ (A : Type u) (a : A → G), Function.Surjective (wordValue a) ∧ + ∃ (s : R → FreeGroup A), (∀ j, wordValue a (s j) = 1) ∧ + (wordValue a).ker = Subgroup.normalClosure (Set.range s) ∧ + ∃ E : BasedChains G R ≃ₗ[ℤ] cycles a, + ∀ c, (E c : BasedChains G A) = relatorChainMap a s c := by + let A := IsFreeGroup.Generators H + let e : FreeGroup A ≃* H := IsFreeGroup.mulEquiv H + let a : A → G := fun x => φ (e (FreeGroup.of x)) + have ha : wordValue a = φ.comp e.toMonoidHom := by + apply FreeGroup.ext_hom + intro x + simp only [wordValue,FreeGroup.lift_apply_of,MonoidHom.comp_apply,MulEquiv.coe_toMonoidHom,a] + have hsur : Function.Surjective (wordValue a) := by rw [ha]; exact hf.comp e.surjective + let s : R → FreeGroup A := fun j => e.symm (r j) + have hs : ∀ j, wordValue a (s j) = 1 := by + intro j + rw [ha] + change φ (e (e.symm (r j))) = 1 + rw [e.apply_symm_apply,hr] + have hnormal : (wordValue a).ker = Subgroup.normalClosure (Set.range s) := by + change (wordValue a).ker = Subgroup.normalClosure (Set.range (e.symm ∘ r)) + rw [Set.range_comp] + change (wordValue a).ker = Subgroup.normalClosure (e.symm.toMonoidHom '' Set.range r) + rw [← Subgroup.map_normalClosure _ e.symm.toMonoidHom e.symm.surjective,← hp] + ext w + constructor + · intro hw + refine ⟨e w,?_,e.symm_apply_apply w⟩ + change φ (e w) = 1 + change (φ.comp e.toMonoidHom) w = 1 + rw [← ha] + exact hw + · rintro ⟨v,hv,rfl⟩ + change wordValue a (e.symm v) = 1 + rw [ha] + exact (congrArg φ (e.apply_symm_apply v)).trans hv + let ke : φ.ker ≃* (wordValue a).ker := + { toFun := fun k => ⟨e.symm k.val,by change wordValue a (e.symm k.val) = 1; rw [ha]; exact (congrArg φ (e.apply_symm_apply k.val)).trans k.property⟩ + invFun := fun k => ⟨e k.val,by change (φ.comp e.toMonoidHom) k.val = 1; rw [← ha]; exact k.property⟩ + left_inv := fun k => Subtype.ext (e.apply_symm_apply k.val) + right_inv := fun k => Subtype.ext (e.symm_apply_apply k.val) + map_mul' := fun k l => Subtype.ext (map_mul e.symm _ _) } + let t : G → FreeGroup A := fun g => (hsur g).choose + have ht : ∀ g, wordValue a (t g) = g := fun g => (hsur g).choose_spec + let E : BasedChains G R ≃ₗ[ℤ] cycles a := + B.trans (ke.abelianizationCongr.toAdditive.toIntLinearEquiv.trans + (KernelCycles.abKernelCycleEquiv a t ht)) + refine ⟨A,a,hsur,s,hs,hnormal,E,?_⟩ + have he : (cycles a).subtype.comp E.toLinearMap = relatorChainMap a s := by + apply Finsupp.lhom_ext + rintro ⟨g,j⟩ n + rw [← Finsupp.smul_single_one (g,j) n,map_smul,map_smul] + congr 1 + + obtain ⟨k,hk,hkj⟩ := hB g j + change (E (Finsupp.single (g,j) 1)).val = _ + change ((KernelCycles.abKernelCycleEquiv a t ht) + (ke.abelianizationCongr.toAdditive.toIntLinearEquiv (B (Finsupp.single (g,j) 1)))).val = _ + rw [hkj] + change pathChain a (e.symm (k*r j*k⁻¹)) 1 = relatorChainMap a s (Finsupp.single (g,j) 1) + rw [map_mul,map_mul,map_inv,pathChain_conjugate a _ _ (hs j),one_mul,relatorChainMap_single,one_smul] + congr 1 + rw [ha] + simpa only [MonoidHom.comp_apply,MulEquiv.coe_toMonoidHom,e.apply_symm_apply] using hk + intro c + exact LinearMap.congr_fun he c + +include hf in +/-- The same literal kernel-basis criterion is invariant under a specified +isomorphism of the quotient group. No new presentation is assumed. -/ +theorem boundary_basis_of_free_target [IsFreeGroup H] + (hp : φ.ker = Subgroup.normalClosure (Set.range r)) + (B : BasedChains G R ≃ₗ[ℤ] Additive (Abelianization φ.ker)) + (hB : ∀ g j, ∃ k : H, φ k = g ∧ B (Finsupp.single (g,j) 1) = + Additive.ofMul (Abelianization.of (⟨k*r j*k⁻¹,by + change φ (k*r j*k⁻¹) = 1 + rw [map_mul,map_mul,map_inv,hr,mul_one,mul_inv_cancel]⟩ : φ.ker))) + {K : Type*} [Group K] (χ : G ≃* K) : + ∃ (A : Type u) (a : A → K), Function.Surjective (wordValue a) ∧ + ∃ (s : R → FreeGroup A), (∀ j, wordValue a (s j) = 1) ∧ + (wordValue a).ker = Subgroup.normalClosure (Set.range s) ∧ + ∃ E : BasedChains K R ≃ₗ[ℤ] cycles a, + ∀ c, (E c : BasedChains K A) = relatorChainMap a s c := by + let ψ := χ.toMonoidHom.comp φ + have hψ : Function.Surjective ψ := χ.surjective.comp hf + have hrψ : ∀ j, ψ (r j) = 1 := by intro j; change χ (φ (r j)) = 1; rw [hr,map_one] + have hk : ψ.ker = φ.ker := by + ext k + change χ (φ k) = 1 ↔ φ k = 1 + exact χ.map_eq_one_iff + let ke : φ.ker ≃* ψ.ker := + { toFun := fun k => ⟨k.val,by rw [hk]; exact k.property⟩ + invFun := fun k => ⟨k.val,by rw [← hk]; exact k.property⟩ + left_inv := fun _ => rfl + right_inv := fun _ => rfl + map_mul' := fun _ _ => rfl } + let B' : BasedChains K R ≃ₗ[ℤ] Additive (Abelianization ψ.ker) := + (Finsupp.domLCongr (Equiv.prodCongr χ.symm.toEquiv (Equiv.refl R))).trans + (B.trans ke.abelianizationCongr.toAdditive.toIntLinearEquiv) + apply boundary_basis_of_free ψ hψ r hrψ (hk.trans hp) B' + intro g j + obtain ⟨k,hk,hkj⟩ := hB (χ.symm g) j + refine ⟨k,?_,?_⟩ + · change χ (φ k) = g + rw [hk,χ.apply_symm_apply] + · simp only [B',LinearEquiv.trans_apply,Finsupp.domLCongr_single] + change ke.abelianizationCongr.toAdditive.toIntLinearEquiv + (B (Finsupp.single (χ.symm g,j) 1)) = _ + rw [hkj] + rfl + +end EilenbergGanea.PresentationAlgebra + + +end + +end OAI diff --git a/lean/OAI/GroupTheory/RightAngledArtin/Basic.lean b/lean/OAI/GroupTheory/RightAngledArtin/Basic.lean new file mode 100644 index 0000000000000000000000000000000000000000..1edaaf833b725cef9e588b388d9b1dcfc85e9e35 --- /dev/null +++ b/lean/OAI/GroupTheory/RightAngledArtin/Basic.lean @@ -0,0 +1,174 @@ +import Mathlib.Tactic +import Mathlib.GroupTheory.PresentedGroup +import Mathlib.GroupTheory.Finiteness +import Mathlib.Combinatorics.SimpleGraph.Connectivity.Connected + +namespace OAI + +noncomputable section + +open Classical Set + +namespace EilenbergGanea +/-- The defining commutators of the right-angled Artin group. -/ +def artinRelations {V : Type*} (L : SimpleGraph V) : Set (FreeGroup V) := + {w | ∃ q r, L.Adj q r ∧ + w = FreeGroup.of q * FreeGroup.of r * (FreeGroup.of q)⁻¹ * (FreeGroup.of r)⁻¹} + +abbrev ArtinGroup {V : Type*} (L : SimpleGraph V) := PresentedGroup (artinRelations L) + +/-- Every standard generator has integral height one. -/ +def height {V : Type*} (L : SimpleGraph V) : ArtinGroup L →* Multiplicative ℤ := + PresentedGroup.toGroup (f := fun _ : V => Multiplicative.ofAdd (1 : ℤ)) (by + rintro w ⟨q, r, _, rfl⟩ + simp) + + +end EilenbergGanea + +namespace EilenbergGanea + + +section FiniteGeneration +variable {V : Type*} (L : SimpleGraph V) + +abbrev artinGenerator (v : V) : ArtinGroup L := PresentedGroup.of v + +@[simp] theorem height_generator (v : V) : + height L (artinGenerator L v) = Multiplicative.ofAdd (1 : ℤ) := by + simp [height, artinGenerator] + +theorem adjacent_generators_commute {v w : V} (h : L.Adj v w) : + Commute (artinGenerator L v) (artinGenerator L w) := by + have he := PresentedGroup.one_of_mem (rels := artinRelations L) + (x := FreeGroup.of v * FreeGroup.of w * (FreeGroup.of v)⁻¹ * (FreeGroup.of w)⁻¹) + ⟨v, w, h, rfl⟩ + simp only [map_mul, map_inv] at he + change artinGenerator L v * artinGenerator L w = + artinGenerator L w * artinGenerator L v + apply mul_inv_eq_one.mp + simpa only [artinGenerator, PresentedGroup.of, mul_inv_rev, mul_assoc] using he + +def edgeDifferences : Set (ArtinGroup L) := + {x | ∃ v w, L.Adj v w ∧ x = artinGenerator L v * (artinGenerator L w)⁻¹} + +def edgeGenerated : Subgroup (ArtinGroup L) := Subgroup.closure (edgeDifferences L) + +theorem edge_difference_mem {v w : V} (h : L.Adj v w) : + artinGenerator L v * (artinGenerator L w)⁻¹ ∈ edgeGenerated L := + Subgroup.subset_closure ⟨v, w, h, rfl⟩ + +theorem reachable_difference_mem {v w : V} (h : L.Reachable v w) : + artinGenerator L v * (artinGenerator L w)⁻¹ ∈ edgeGenerated L := by + obtain ⟨p⟩ := h + induction p with + | nil => simp + | @cons u v w huv p ih => + simpa only [mul_assoc, inv_mul_cancel_left] using + (edgeGenerated L).mul_mem (edge_difference_mem L huv) ih + +theorem reachable_inv_difference_mem {v w : V} (h : L.Reachable v w) : + (artinGenerator L v)⁻¹ * artinGenerator L w ∈ edgeGenerated L := by + obtain ⟨p⟩ := h + induction p with + | nil => simp + | @cons u v w huv p ih => + have hc := (adjacent_generators_commute L huv).inv_left + have he : (artinGenerator L u)⁻¹ * artinGenerator L v ∈ edgeGenerated L := by + rw [hc.eq] + exact edge_difference_mem L huv.symm + simpa only [mul_assoc, mul_inv_cancel_left] using (edgeGenerated L).mul_mem he ih + + +/-- A group-theoretic conjugation identity used with edge differences. -/ +theorem conjugate_mem_of_difference {A : Type*} [Group A] (K : Subgroup A) + {g a e : A} (hga : g * a⁻¹ ∈ K) (he : e ∈ K) (ha : Commute a e) : + g * e * g⁻¹ ∈ K := by + have hm := K.mul_mem (K.mul_mem hga he) (K.inv_mem hga) + have hi : (g * a⁻¹) * e * (g * a⁻¹)⁻¹ = g * e * g⁻¹ := by + calc + (g * a⁻¹) * e * (g * a⁻¹)⁻¹ = g * (a⁻¹ * e * a) * g⁻¹ := by group + _ = g * e * g⁻¹ := by rw [ha.inv_left.eq]; simp [mul_assoc] + rwa [hi] at hm + +theorem generator_conjugate_mem (hconn : L.Preconnected) (v : V) + {x : ArtinGroup L} (hx : x ∈ edgeGenerated L) : + artinGenerator L v * x * (artinGenerator L v)⁻¹ ∈ edgeGenerated L := by + have hh : edgeGenerated L ≤ (edgeGenerated L).comap (MulAut.conj (artinGenerator L v)) := by + apply (Subgroup.closure_le _).mpr + rintro x ⟨b, c, hbc, rfl⟩ + exact conjugate_mem_of_difference (edgeGenerated L) + (reachable_difference_mem L (hconn v b)) (edge_difference_mem L hbc) + ((Commute.refl _).mul_right (adjacent_generators_commute L hbc).inv_right) + exact hh hx + +theorem generator_inv_conjugate_mem (hconn : L.Preconnected) (v : V) + {x : ArtinGroup L} (hx : x ∈ edgeGenerated L) : + (artinGenerator L v)⁻¹ * x * artinGenerator L v ∈ edgeGenerated L := by + have hh : edgeGenerated L ≤ + (edgeGenerated L).comap (MulAut.conj ((artinGenerator L v)⁻¹)) := by + apply (Subgroup.closure_le _).mpr + rintro x ⟨b, c, hbc, rfl⟩ + change (artinGenerator L v)⁻¹ * (artinGenerator L b * (artinGenerator L c)⁻¹) * + ((artinGenerator L v)⁻¹)⁻¹ ∈ edgeGenerated L + apply conjugate_mem_of_difference (edgeGenerated L) (a := (artinGenerator L b)⁻¹) + · simpa using reachable_inv_difference_mem L (hconn v b) + · exact edge_difference_mem L hbc + · exact ((Commute.refl _).mul_right + (adjacent_generators_commute L hbc).inv_right).inv_left + simpa using hh hx + +theorem edgeGenerated_normal (hconn : L.Preconnected) : (edgeGenerated L).Normal := by + apply Subgroup.normalizer_eq_top_iff.mp + apply (Subgroup.eq_top_iff' _).mpr + apply PresentedGroup.generated_by + intro v + rw [Subgroup.mem_normalizer_iff] + intro x + constructor + · exact generator_conjugate_mem L hconn v + · intro hx + simpa [mul_assoc] using generator_inv_conjugate_mem L hconn v hx + +/-- For a connected defining graph, edge differences generate the full height kernel. -/ +theorem edgeGenerated_eq_height_kernel (hconn : L.Preconnected) (v₀ : V) : + edgeGenerated L = (height L).ker := by + apply le_antisymm + · apply (Subgroup.closure_le _).mpr + rintro x ⟨v, w, _, rfl⟩ + simp [MonoidHom.mem_ker] + · let _ := edgeGenerated_normal L hconn + let q := QuotientGroup.mk' (edgeGenerated L) + let z := zpowersHom _ (q (artinGenerator L v₀)) + have hq : q = z.comp (height L) := by + apply PresentedGroup.ext + intro v + change q (artinGenerator L v) = z (height L (artinGenerator L v)) + rw [height_generator] + change q (artinGenerator L v) = q (artinGenerator L v₀) ^ (1 : ℤ) + rw [zpow_one] + apply mul_inv_eq_one.mp + rw [← map_inv, ← map_mul] + exact (QuotientGroup.eq_one_iff _).mpr (reachable_difference_mem L (hconn v v₀)) + intro x hx + apply (QuotientGroup.eq_one_iff x).mp + change q x = 1 + rw [hq, MonoidHom.comp_apply, (MonoidHom.mem_ker.mp hx), map_one] + +theorem height_kernel_fg [Finite V] (hconn : L.Preconnected) (v₀ : V) : + Group.FG (height L).ker := by + rw [Group.fg_iff_subgroup_fg, ← edgeGenerated_eq_height_kernel L hconn v₀] + apply (Subgroup.fg_iff _).mpr + refine ⟨edgeDifferences L, rfl, ?_⟩ + apply Set.Finite.subset + (Set.finite_range (fun p : V × V => artinGenerator L p.1 * (artinGenerator L p.2)⁻¹)) + rintro x ⟨v, w, _, rfl⟩ + exact ⟨(v, w), rfl⟩ + +end FiniteGeneration + +end EilenbergGanea + +end + +end OAI diff --git a/lean/OAI/GroupTheory/RightAngledArtin/CubeDescents.lean b/lean/OAI/GroupTheory/RightAngledArtin/CubeDescents.lean new file mode 100644 index 0000000000000000000000000000000000000000..5565169171a84893e9d60d83080de782c545fb91 --- /dev/null +++ b/lean/OAI/GroupTheory/RightAngledArtin/CubeDescents.lean @@ -0,0 +1,295 @@ +import OAI.GroupTheory.RightAngledArtin.TraceWords + +namespace OAI + +noncomputable section + +open Classical Set + +namespace EilenbergGanea +namespace TraceWords +variable {V : Type*} (L : SimpleGraph V) +/-! Right descents and the cubes in the actual Artin Cayley graph. -/ + +section CubeDescents +open Classical +variable {L} + +theorem Equivalent.extract {x : Letter V} {w w' v : Word V} + (hs : Equivalent L w w') (he : Extract L x w v) : + ∃ v', Extract L x w' v' ∧ Equivalent L v v' := by + have hh : Relation.ReflTransGen (Swap L) w w' := by + rwa [← Relation.EqvGen.eqvGen_eq_reflTransGen] + clear hs + induction hh with + | refl => exact ⟨_,he,.refl _⟩ + | tail _ hs ih => + obtain ⟨v',he',hv'⟩ := ih + obtain ⟨v'',he'',hv''⟩ := he'.swap hs + exact ⟨_,he'',hv'.trans hv''⟩ + +theorem Swap.reverse {w v : Word V} (h : Swap L w v) : + Equivalent L w.reverse v.reverse := by + induction h with + | @head x y w h => + simpa only [List.reverse_cons,List.append_assoc,List.cons_append,List.nil_append] + using Equivalent.append_left (Relation.EqvGen.rel _ _ (Swap.head (w := []) h.symm)) w.reverse + | cons x _ ih => + simpa only [List.reverse_cons] using ih.append_right [x] + +theorem Equivalent.reverse {w v : Word V} (h : Equivalent L w v) : + Equivalent L w.reverse v.reverse := by + induction h with + | rel _ _ h => exact h.reverse + | refl => exact .refl _ + | symm _ _ _ ih => exact ih.symm + | trans _ _ _ _ _ ih ih' => exact ih.trans ih' + +/-- Distinct accessible occurrences commute. In particular two opposite signs +of the same vertex can never both be accessible. -/ +theorem Extract.eq_or_independent {x y : Letter V} {w u v : Word V} + (hx : Extract L x w u) (hy : Extract L y w v) : + x = y ∨ Independent L x y := by + induction hx generalizing v with + | head w => + cases hy with + | head => exact Or.inl rfl + | cons h _ => exact Or.inr h.symm + | @cons a w u ha hx ih => + cases hy with + | head => exact Or.inr ha + | cons _ hy => exact ih hy + +variable (L) +def RightExtract (x : Letter V) (w v : Word V) : Prop := + Extract L x w.reverse v.reverse + +variable {L} +theorem RightExtract.equivalent {x : Letter V} {w v : Word V} + (h : RightExtract L x w v) : Equivalent L w (v ++ [x]) := by + simpa only [List.reverse_reverse,List.reverse_cons] using (Extract.equivalent h).reverse + +theorem RightExtract.of_equivalent {x : Letter V} {w v : Word V} + (h : Equivalent L w (v ++ [x])) : ∃ u, RightExtract L x w u ∧ Equivalent L u v := by + obtain ⟨u,hu,hue⟩ := h.reverse.symm.extract (by + simpa only [List.reverse_append,List.reverse_singleton,List.singleton_append] + using (Extract.head (L := L) (x := x) v.reverse)) + exact ⟨u.reverse,by simpa [RightExtract] using hu,by simpa using hue.symm.reverse⟩ + +theorem RightExtract.length {x : Letter V} {w v : Word V} + (h : RightExtract L x w v) : v.length + 1 = w.length := by + simpa [RightExtract] using Extract.length h + +theorem RightExtract.eq_or_independent {x y : Letter V} {w u v : Word V} + (hx : RightExtract L x w u) (hy : RightExtract L y w v) : + x = y ∨ Independent L x y := Extract.eq_or_independent hx hy + +theorem RightExtract.diamond {x y : Letter V} {w u v : Word V} + (hxy : Independent L x y) (hx : RightExtract L x w u) (hy : RightExtract L y w v) : + ∃ t, RightExtract L y u t ∧ RightExtract L x v t := by + obtain ⟨t,ht,h't⟩ := Extract.diamond hxy hx hy + exact ⟨t.reverse,by simpa [RightExtract] using ht,by simpa [RightExtract] using h't⟩ + + +variable (L) +/-- A maximal occurrence of a trace, retaining its sign. -/ +def EndsWith (t : Trace L) (x : Letter V) : Prop := + ∃ u, t = appendTrace L u (ofWord L [x]) + +def artinLength (g : ArtinGroup L) : ℕ := traceLength L (artinNormalTrace L g) + +def rightDescents (g : ArtinGroup L) : Set (Letter V) := + {x | EndsWith L (artinNormalTrace L g) x} + +variable {L} +theorem endsWith_ofWord_iff (w : Word V) (x : Letter V) : + EndsWith L (ofWord L w) x ↔ ∃ v, RightExtract L x w v := by + constructor + · rintro ⟨t,ht⟩ + induction t using Quotient.inductionOn with + | h v => + obtain ⟨u,hu,_⟩ := RightExtract.of_equivalent ((ofWord_eq L).mp ht) + exact ⟨u,hu⟩ + · rintro ⟨v,hv⟩ + exact ⟨ofWord L v,(ofWord_eq L).mpr hv.equivalent⟩ + +theorem endsWith_append_independent (t : Trace L) {x y : Letter V} + (hxy : Independent L x y) : + EndsWith L (appendTrace L t (ofWord L [x])) y ↔ EndsWith L t y := by + induction t using Quotient.inductionOn with + | h w => + change EndsWith L (ofWord L (w ++ [x])) y ↔ EndsWith L (ofWord L w) y + rw [endsWith_ofWord_iff,endsWith_ofWord_iff] + constructor + · rintro ⟨v,hv⟩ + have hv' : Extract L y (x :: w.reverse) v.reverse := by + simpa [RightExtract] using hv + generalize hvv : v.reverse = u at hv' + cases hv' with + | head => exact False.elim (independent_self L x hxy) + | @cons _ _ u _ hu => + exact ⟨u.reverse,by simpa [RightExtract] using hu⟩ + · rintro ⟨v,hv⟩ + refine ⟨v ++ [x],?_⟩ + simpa [RightExtract] using Extract.cons hxy.symm hv + +variable (L) +theorem artinLength_word {w : Word V} (h : Reduced L (ofWord L w)) : + artinLength L (wordEval (artinGenerator L) w) = w.length := by + simp only [artinLength,artinNormalTrace_word,h.normalTrace_eq,traceLength_ofWord] + +theorem rightDescents_word {w : Word V} (h : Reduced L (ofWord L w)) (x : Letter V) : + x ∈ rightDescents L (wordEval (artinGenerator L) w) ↔ ∃ v, RightExtract L x w v := by + change EndsWith L (artinNormalTrace L _) x ↔ _ + rw [artinNormalTrace_word,h.normalTrace_eq,endsWith_ofWord_iff] + +/-- The whole descending link is a clique, not just its pairwise choices. -/ +theorem rightDescents_pairwise (g : ArtinGroup L) : + (rightDescents L g).Pairwise (Independent L) := by + obtain ⟨w,hw,rfl⟩ := exists_reduced_word L g + intro x hx y hy hne + obtain ⟨u,hu⟩ := (rightDescents_word L hw x).mp hx + obtain ⟨v,hv⟩ := (rightDescents_word L hw y).mp hy + exact (hu.eq_or_independent hv).resolve_left hne + +theorem rightDescents_length (g : ArtinGroup L) (x : Letter V) : + x ∈ rightDescents L g ↔ + artinLength L (g * letterValue (artinGenerator L) (invLetter x)) + 1 = artinLength L g := by + constructor + · obtain ⟨w,hw,rfl⟩ := exists_reduced_word L g + intro hx + obtain ⟨v,hv⟩ := (rightDescents_word L hw x).mp hx + have he := hv.equivalent + have hvred := (hw.of_equivalent he).of_append_right + have heval := he.wordEval (fun _ _ h => adjacent_generators_commute L h) + rw [wordEval_append,wordEval_singleton] at heval + rw [heval,letterValue_inverse,mul_inv_cancel_right,artinLength_word L hvred] + rw [← heval,artinLength_word L hw] + exact hv.length + · intro hl + rcases artinNormalTrace_right_step L g (invLetter x) with ht | ht + · have := congrArg (traceLength L) ht + rw [traceLength_append_singleton] at this + change artinLength L _ = artinLength L _ + 1 at this + omega + · exact ⟨_,by simpa only [invLetter_invLetter] using ht⟩ + +/-- Crossing one cube direction does not change the descent status of any +independent direction. This is the no-local-maximum obstruction needed for the +length filtration of the universal cubical complex. -/ +theorem descent_independent_step (g : ArtinGroup L) {x y : Letter V} + (hxy : Independent L x y) : + y ∈ rightDescents L (g * letterValue (artinGenerator L) x) ↔ y ∈ rightDescents L g := by + change EndsWith L (artinNormalTrace L _) y ↔ EndsWith L (artinNormalTrace L g) y + rcases artinNormalTrace_right_step L g x with ht | ht + · rw [ht,endsWith_append_independent _ hxy] + · rw [ht,endsWith_append_independent _ (show Independent L (invLetter x) y from hxy)] + +theorem artinLength_eq_zero_iff (g : ArtinGroup L) : artinLength L g = 0 ↔ g = 1 := by + obtain ⟨w,hw,rfl⟩ := exists_reduced_word L g + rw [artinLength_word L hw] + constructor + · intro h + have : w = [] := by simpa using h + simp [this] + · intro h + have hh := (artin_word_eq_iff L w []).mp (by simpa using h) + rw [hw.normalTrace_eq] at hh + have he : ofWord L w = ofWord L [] := hh.trans (by + apply Reduced.normalTrace_eq + intro t ht + have := ht.length + simp only [traceLength_ofWord,List.length_nil] at this + omega) + exact (congrArg (traceLength L) he) + +theorem rightDescents_nonempty {g : ArtinGroup L} (hg : g ≠ 1) : + (rightDescents L g).Nonempty := by + obtain ⟨w,hw,rfl⟩ := exists_reduced_word L g + have hwne : w ≠ [] := by intro h; apply hg; simp [h] + obtain ⟨v,x,rfl⟩ : ∃ (v : Word V) (x : Letter V), w = v ++ [x] := by + cases he : w.reverse with + | nil => exact False.elim (hwne (by simpa using congrArg List.reverse he)) + | cons x v => exact ⟨v.reverse,x,by simpa using congrArg List.reverse he⟩ + refine ⟨x,(rightDescents_word L hw x).mpr ⟨v,?_⟩⟩ + simp only [RightExtract,List.reverse_append,List.reverse_singleton,List.singleton_append] + exact .head _ + + +/-- The exact length increment of one generator, with no chosen normal word. -/ +theorem artinLength_step (g : ArtinGroup L) (x : Letter V) : + (artinLength L (g * letterValue (artinGenerator L) x) : ℤ) = + artinLength L g + if invLetter x ∈ rightDescents L g then -1 else 1 := by + by_cases hx : invLetter x ∈ rightDescents L g + · have hh := (rightDescents_length L g (invLetter x)).mp hx + simp only [invLetter_invLetter] at hh + simp only [ite_eq_left hx] + omega + · simp only [ite_eq_right hx] + rcases artinNormalTrace_right_step L g x with ht | ht + · have hh := congrArg (traceLength L) ht + rw [traceLength_append_singleton] at hh + change artinLength L _ = artinLength L _ + 1 at hh + omega + · exact False.elim (hx ⟨_,ht⟩) + +theorem descent_word_invariant (g : ArtinGroup L) (w : Word V) (y : Letter V) + (hw : ∀ x ∈ w, Independent L x y) : + y ∈ rightDescents L (g * wordEval (artinGenerator L) w) ↔ y ∈ rightDescents L g := by + induction w generalizing g with + | nil => simp + | cons x w ih => + rw [wordEval_cons,← mul_assoc,ih _ (fun z hz => hw z (by simp [hz]))] + exact descent_independent_step L g (hw x (by simp)) + +/-- On a cube, length is affine: every coordinate has increment +1 or -1, +and independent crossings cannot change that increment. -/ +theorem artinLength_clique_word (g : ArtinGroup L) (w : Word V) + (hw : w.Pairwise (Independent L)) : + (artinLength L (g * wordEval (artinGenerator L) w) : ℤ) = artinLength L g + + (w.map fun x => if invLetter x ∈ rightDescents L g then (-1 : ℤ) else 1).sum := by + induction w generalizing g with + | nil => simp + | cons x w ih => + obtain ⟨hx,hw⟩ := List.pairwise_cons.mp hw + rw [wordEval_cons,← mul_assoc,ih _ hw,artinLength_step] + have he : (w.map fun y => if invLetter y ∈ rightDescents L + (g * letterValue (artinGenerator L) x) then (-1 : ℤ) else 1) = + w.map fun y => if invLetter y ∈ rightDescents L g then (-1 : ℤ) else 1 := by + apply List.map_congr_left + intro y hy + rw [descent_independent_step L g (show Independent L x (invLetter y) from hx y hy)] + rw [he] + simp only [List.map_cons,List.sum_cons] + omega + +/-- Every face of the full descending cube has precisely the expected length. +This proves in particular that its corners are different from its top. -/ +theorem artinLength_descending_cube (g : ArtinGroup L) (w : Word V) + (hw : w.Pairwise (Independent L)) (hd : ∀ x ∈ w, x ∈ rightDescents L g) : + artinLength L (g * wordEval (artinGenerator L) (w.map invLetter)) + w.length = + artinLength L g := by + have hwi : (w.map invLetter).Pairwise (Independent L) := by + simpa only [List.pairwise_map,independent_inv_left,independent_inv_right] using hw + have hh := artinLength_clique_word L g (w.map invLetter) hwi + have hsum : ((w.map invLetter).map fun x => + if invLetter x ∈ rightDescents L g then (-1 : ℤ) else 1).sum = -(w.length : ℤ) := by + rw [List.map_map] + simp only [Function.comp_def] + have he : w.map (fun x => if invLetter (invLetter x) ∈ rightDescents L g then (-1 : ℤ) else 1) = + w.map (fun _ => (-1 : ℤ)) := by + apply List.map_congr_left + intro x hx + simp only [invLetter_invLetter,ite_eq_left (hd x hx)] + rw [he] + simp + rw [hsum] at hh + omega + +end CubeDescents +end TraceWords +end EilenbergGanea + +end + +end OAI diff --git a/lean/OAI/GroupTheory/RightAngledArtin/ResidualFiniteness.lean b/lean/OAI/GroupTheory/RightAngledArtin/ResidualFiniteness.lean new file mode 100644 index 0000000000000000000000000000000000000000..04737cd185096b589f5c5f0d2251fa88ef71840e --- /dev/null +++ b/lean/OAI/GroupTheory/RightAngledArtin/ResidualFiniteness.lean @@ -0,0 +1,639 @@ +import OAI.GroupTheory.RightAngledArtin.Basic +import Mathlib.GroupTheory.FreeGroup.Reduce +import Mathlib.GroupTheory.ResiduallyFinite +import Mathlib.GroupTheory.SemidirectProduct + +namespace OAI + +noncomputable section + +open Classical Set + +namespace EilenbergGanea +universe u +/-! Finite permutation separation for free groups. -/ +section FreeGroupResidualFiniteness + +variable {A : Type*} [Group A] + +/-- Left translation, restricted wherever both endpoints lie in a finite set, +extends to a permutation of that finite set. -/ +theorem finite_translation_extension (s : Finset A) (a : A) : + ∃ σ : Equiv.Perm s, ∀ (x : s), a * x.val ∈ s → (σ x).val = a * x.val := by + classical + let D := {x : s // a * x.val ∈ s} + let f : D → s := fun x => x.val + let g : D → s := fun x => ⟨a * x.val.val, x.property⟩ + have hf : Function.Injective f := fun _ _ h => Subtype.ext h + have hg : Function.Injective g := by + intro x y h + apply Subtype.ext + apply Subtype.ext + exact mul_left_cancel (congrArg Subtype.val h) + obtain ⟨σ, hσ⟩ := Equiv.Perm.exists_extending_pair f g hf hg + exact ⟨σ, fun x hx => congrArg Subtype.val (hσ ⟨x, hx⟩)⟩ + +noncomputable def finiteTranslation (s : Finset A) (a : A) : Equiv.Perm s := + (finite_translation_extension s a).choose + +theorem finiteTranslation_apply (s : Finset A) (a : A) (x : s) + (hx : a * x.val ∈ s) : (finiteTranslation s a x).val = a * x.val := + (finite_translation_extension s a).choose_spec x hx + +theorem finiteTranslation_inv_apply (s : Finset A) (a : A) (x : s) + (hx : a⁻¹ * x.val ∈ s) : ((finiteTranslation s a)⁻¹ x).val = a⁻¹ * x.val := by + let y : s := ⟨a⁻¹ * x.val, hx⟩ + have he : finiteTranslation s a y = x := by + apply Subtype.ext + have hm : a * y.val ∈ s := by simp [y] + rw [finiteTranslation_apply s a y hm] + simp [y] + have hi := congrArg (finiteTranslation s a).symm he + simpa [y] using (congrArg Subtype.val hi).symm + +variable {X : Type*} + +/-- The finite set of suffix vertices of a free word, including both endpoints. -/ +def wordVertices (w : List (X × Bool)) : Finset (FreeGroup X) := by + classical + exact (w.tails.map FreeGroup.mk).toFinset + +theorem mk_mem_wordVertices (w : List (X × Bool)) : FreeGroup.mk w ∈ wordVertices w := by + classical + simp only [wordVertices, List.mem_toFinset, List.mem_map] + exact ⟨w, by simp, rfl⟩ + +theorem one_mem_wordVertices (w : List (X × Bool)) : (1 : FreeGroup X) ∈ wordVertices w := by + classical + simp only [wordVertices, List.mem_toFinset, List.mem_map] + exact ⟨[], by simp, rfl⟩ + +theorem wordVertices_tail_subset (x : X × Bool) (w : List (X × Bool)) : + wordVertices w ⊆ wordVertices (x :: w) := by + classical + simp only [wordVertices, List.tails_cons, List.map_cons, List.toFinset_cons] + exact Finset.subset_insert _ _ + +theorem mk_cons_sign (a : X) (b : Bool) (w : List (X × Bool)) : + FreeGroup.mk ((a, b) :: w) = + (if b then FreeGroup.of a else (FreeGroup.of a)⁻¹) * FreeGroup.mk w := by + cases b <;> rfl + +noncomputable def finiteWordAction (s : Finset (FreeGroup X)) : + FreeGroup X →* Equiv.Perm s := + FreeGroup.lift (fun a => finiteTranslation s (FreeGroup.of a)) + +/-- Whenever a finite set includes all suffix vertices, the finite action follows +that word exactly starting at the identity. No reduced-word choice is needed. -/ +theorem finiteWordAction_tracks (s : Finset (FreeGroup X)) (w : List (X × Bool)) + (hw : wordVertices w ⊆ s) (h1 : (1 : FreeGroup X) ∈ s) : + (finiteWordAction s (FreeGroup.mk w) ⟨1, h1⟩).val = FreeGroup.mk w := by + induction w with + | nil => simp [finiteWordAction, FreeGroup.one_eq_mk] + | cons x w ih => + have ht := ih ((wordVertices_tail_subset x w).trans hw) + have hm := hw (mk_mem_wordVertices (x :: w)) + rcases x with ⟨a, b⟩ + rw [mk_cons_sign] at hm ⊢ + rw [map_mul] + change ((finiteWordAction s (if b then FreeGroup.of a else (FreeGroup.of a)⁻¹)) + (finiteWordAction s (FreeGroup.mk w) ⟨1, h1⟩)).val = _ + cases b + · simp only [Bool.false_eq_true, ↓reduceIte, map_inv, + finiteWordAction, FreeGroup.lift_apply_of] + rw [finiteTranslation_inv_apply] + · exact congrArg ((FreeGroup.of a)⁻¹ * ·) ht + · change (FreeGroup.of a)⁻¹ * (finiteWordAction s (FreeGroup.mk w) ⟨1, h1⟩).val ∈ s + rw [ht]; exact hm + · simp only [↓reduceIte, finiteWordAction, FreeGroup.lift_apply_of] + rw [finiteTranslation_apply] + · exact congrArg (FreeGroup.of a * ·) ht + · change FreeGroup.of a * (finiteWordAction s (FreeGroup.mk w) ⟨1, h1⟩).val ∈ s + rw [ht]; exact hm + +/-- Free groups on arbitrary types are residually finite; this is proved using +finite partial translations, not assumed as a literature result. -/ +theorem freeGroup_residuallyFinite (X : Type*) : Group.ResiduallyFinite (FreeGroup X) := by + classical + apply Group.residuallyFinite_of_forall_exists_finite_monoidHom + intro g hg + let s := wordVertices g.toWord + have h1 : (1 : FreeGroup X) ∈ s := one_mem_wordVertices _ + refine ⟨Equiv.Perm s, inferInstance, inferInstance, finiteWordAction s, ?_⟩ + intro he + have ht := finiteWordAction_tracks s g.toWord (Finset.Subset.refl s) h1 + rw [FreeGroup.mk_toWord, he] at ht + change (1 : FreeGroup X) = g at ht + exact hg ht.symm + +end FreeGroupResidualFiniteness + + +section FiniteSemidirectSeparation + +variable {N D K : Type*} [Group N] [Group D] [Group K] + +/-- The right translation action on a group-valued function space. -/ +def functionShift (D K : Type*) [Group D] [Group K] : D →* MulAut (D → K) where + toFun d := + { toFun := fun f x => f (x * d) + invFun := fun f x => f (x * d⁻¹) + left_inv := by intro f; funext x; simp [mul_assoc] + right_inv := by intro f; funext x; simp [mul_assoc] + map_mul' := by intro f g; rfl } + map_one' := by ext f x; simp + map_mul' d e := by ext f x; simp [mul_assoc] + +/-- All translates of a finite observation of the normal factor, simultaneously. -/ +def orbitObservation (φ : D →* MulAut N) (f : N →* K) : N →* (D → K) where + toFun n d := f (φ d n) + map_one' := by ext d; simp + map_mul' n m := by ext d; simp + +theorem orbitObservation_equivariant (φ : D →* MulAut N) (f : N →* K) (d : D) : + (orbitObservation φ f).comp (φ d).toMonoidHom = + (functionShift D K d).toMonoidHom.comp (orbitObservation φ f) := by + ext n e + simp [orbitObservation, functionShift, map_mul] + +/-- A finite extension of a residually finite group is residually finite. +Only the semidirect form needed by the source is used. -/ +theorem finite_semidirect_residuallyFinite [Finite D] [Group.ResiduallyFinite N] + (φ : D →* MulAut N) : Group.ResiduallyFinite (N ⋊[φ] D) := by + classical + apply Group.residuallyFinite_of_forall_exists_finite_monoidHom + intro x hx + by_cases hd : x.right = 1 + · have hn : x.left ≠ 1 := by + intro he + apply hx + ext <;> assumption + obtain ⟨H, hH⟩ := Group.exists_finiteIndexNormalSubgroup_notMem x.left hn + let f : N →* N ⧸ H.toSubgroup := QuotientGroup.mk' H.toSubgroup + let F := orbitObservation φ f + let ψ := functionShift D (N ⧸ H.toSubgroup) + let q : (N ⋊[φ] D) →* ((D → N ⧸ H.toSubgroup) ⋊[ψ] D) := + SemidirectProduct.map F (MonoidHom.id D) (orbitObservation_equivariant φ f) + refine ⟨_, inferInstance, ?_, q, ?_⟩ + · exact Finite.of_equiv ((D → N ⧸ H.toSubgroup) × D) + SemidirectProduct.equivProd.symm + · intro he + have hv := congrArg (fun y => y.left (1 : D)) he + have hz : f x.left = 1 := by simpa [q, F, orbitObservation] using hv + exact hH ((QuotientGroup.eq_one_iff _).mp hz) + · let q : (N ⋊[φ] D) →* D × (N ⧸ (⊤ : Subgroup N)) := + SemidirectProduct.rightHom.prod 1 + refine ⟨_, inferInstance, inferInstance, q, ?_⟩ + intro he + exact hd (congrArg Prod.fst he) + +end FiniteSemidirectSeparation + + +section FreeAction + +variable (A X : Type*) [Group A] [MulAction A X] + +def freeAction : A →* MulAut (FreeGroup X) where + toFun a := FreeGroup.freeGroupCongr (MulAction.toPermHom A X a) + map_one' := by + apply MulEquiv.ext + intro w + change FreeGroup.map (fun x : X => (1 : A) • x) w = w + simpa only [one_smul] using FreeGroup.map.id' w + map_mul' a b := by + apply MulEquiv.ext + intro w + change FreeGroup.map (fun x : X => (a * b) • x) w = + FreeGroup.map (fun x => a • x) (FreeGroup.map (fun x => b • x) w) + rw [FreeGroup.map.comp] + simp only [Function.comp_def, mul_smul] + +@[simp] theorem freeAction_of (a : A) (x : X) : + freeAction A X a (FreeGroup.of x) = FreeGroup.of (a • x) := rfl + +theorem freeAction_apply (a : A) (w : FreeGroup X) : + freeAction A X a w = FreeGroup.map (fun x : X => a • x) w := rfl + +variable {A X} {B Y : Type*} [Group B] [MulAction B Y] + +theorem freeAction_map_equivariant (q : A →* B) (f : X → Y) + (hf : ∀ a x, f (a • x) = q a • f x) (a : A) : + (FreeGroup.map f).comp (freeAction A X a).toMonoidHom = + (freeAction B Y (q a)).toMonoidHom.comp (FreeGroup.map f) := by + ext x + simp only [MonoidHom.comp_apply, MulEquiv.coe_toMonoidHom, freeAction_of, + FreeGroup.map.of, hf] + +end FreeAction + + +section FiniteQuotientSeparation + +variable {A : Type*} [Group A] [Group.ResiduallyFinite A] + +/-- Finitely many nonidentity elements can be excluded by one finite quotient. -/ +theorem finite_nonidentity_separation (s : Finset A) : + ∃ H : FiniteIndexNormalSubgroup A, ∀ a ∈ s, a ≠ 1 → a ∉ H := by + classical + induction s using Finset.induction_on with + | empty => exact ⟨.ofSubgroup ⊤, by simp⟩ + | @insert a s ha ih => + obtain ⟨H, hH⟩ := ih + by_cases h1 : a = 1 + · refine ⟨H, ?_⟩ + intro b hb hb1 + rcases Finset.mem_insert.mp hb with rfl | hb + · exact (hb1 h1).elim + · exact hH b hb hb1 + · obtain ⟨K, hK⟩ := Group.exists_finiteIndexNormalSubgroup_notMem a h1 + refine ⟨H ⊓ K, ?_⟩ + intro b hb hb1 hm + change b ∈ H.toSubgroup ⊓ K.toSubgroup at hm + rcases Finset.mem_insert.mp hb with rfl | hb + · exact hK hm.2 + · exact hH b hb hb1 hm.1 + +/-- The exact finite-set injectivity consequence of residual finiteness. -/ +theorem finite_set_quotient_injective (s : Finset A) : + ∃ H : FiniteIndexNormalSubgroup A, + Set.InjOn (QuotientGroup.mk' H.toSubgroup) (s : Set A) := by + classical + obtain ⟨H, hH⟩ := finite_nonidentity_separation + ((s ×ˢ s).image (fun z => z.1⁻¹ * z.2)) + refine ⟨H, ?_⟩ + intro a ha b hb he + by_contra hn + apply hH (a⁻¹ * b) (Finset.mem_image.mpr ⟨(a, b), Finset.mem_product.mpr ⟨ha, hb⟩, rfl⟩) + (fun h => hn (eq_of_inv_mul_eq_one h)) + exact QuotientGroup.eq.mp he + +end FiniteQuotientSeparation + +section RetractCosetSeparation + +variable {A : Type u} {D : Type*} [Group A] [Group D] + +/-- A homomorphism induces a map on left cosets of a subgroup, without a +normality hypothesis on that subgroup. -/ +def cosetMap (q : A →* D) (C : Subgroup A) : A ⧸ C → D ⧸ C.map q := + Quotient.map' q (by + intro a b h + apply QuotientGroup.leftRel_apply.mpr + rw [← map_inv, ← map_mul] + exact Subgroup.mem_map.mpr ⟨a⁻¹ * b, QuotientGroup.leftRel_apply.mp h, rfl⟩) + +@[simp] theorem cosetMap_mk (q : A →* D) (C : Subgroup A) (a : A) : + cosetMap q C (QuotientGroup.mk a) = QuotientGroup.mk (q a) := rfl + +theorem cosetMap_equivariant (q : A →* D) (C : Subgroup A) (a : A) (x : A ⧸ C) : + cosetMap q C (a • x) = q a • cosetMap q C x := by + induction x using QuotientGroup.induction_on with + | H x => simp only [MulAction.Quotient.smul_mk, smul_eq_mul, cosetMap_mk, map_mul] + +theorem cosetMap_out (q : A →* D) (C : Subgroup A) (x : A ⧸ C) : + cosetMap q C x = QuotientGroup.mk (q x.out) := by + rw [← cosetMap_mk, QuotientGroup.out_eq'] + +/-- A retract is separable on any finite set of cosets. The two observations +(p, p ∘ r) implement the source's diagonal separation argument exactly. -/ +theorem retract_coset_finite_separation [Group.ResiduallyFinite A] + (C : Subgroup A) (r : A →* A) (hr : ∀ a, r a ∈ C) + (hfix : ∀ c ∈ C, r c = c) (s : Finset (A ⧸ C)) : + ∃ (D : Type u) (_ : Group D) (_ : Finite D) (q : A →* D), + Set.InjOn (cosetMap q C) (s : Set (A ⧸ C)) := by + classical + let t := (s ×ˢ s).image (fun z => z.1.out⁻¹ * z.2.out) + obtain ⟨H, hH⟩ := finite_set_quotient_injective (t ∪ t.image r) + let p := QuotientGroup.mk' H.toSubgroup + let q := p.prod (p.comp r) + refine ⟨(A ⧸ H.toSubgroup) × (A ⧸ H.toSubgroup), inferInstance, inferInstance, q, ?_⟩ + intro x hx y hy he + rw [cosetMap_out, cosetMap_out] at he + have hm : q (x.out⁻¹ * y.out) ∈ C.map q := by + simpa only [map_mul, map_inv] using QuotientGroup.eq.mp he + obtain ⟨c, hc, hce⟩ := Subgroup.mem_map.mp hm + have hp : p (x.out⁻¹ * y.out) = p (r (x.out⁻¹ * y.out)) := by + have hleft := congrArg Prod.fst hce + have hright := congrArg Prod.snd hce + change p c = p (x.out⁻¹ * y.out) at hleft + change p (r c) = p (r (x.out⁻¹ * y.out)) at hright + rw [hfix c hc] at hright + exact hleft.symm.trans hright + have hd : x.out⁻¹ * y.out ∈ t := + Finset.mem_image.mpr ⟨(x, y), Finset.mem_product.mpr ⟨hx, hy⟩, rfl⟩ + have hd' := hH (Finset.mem_union_left _ hd) + (Finset.mem_union_right _ (Finset.mem_image.mpr ⟨_, hd, rfl⟩)) hp + have hmC : x.out⁻¹ * y.out ∈ C := hd' ▸ hr (x.out⁻¹ * y.out) + have hxy : (QuotientGroup.mk x.out : A ⧸ C) = QuotientGroup.mk y.out := + QuotientGroup.eq.mpr hmC + simpa only [QuotientGroup.out_eq'] using hxy + +end RetractCosetSeparation + +section RetractSemidirectSeparation + +/-- Only the finitely many letters of a word must survive a map of alphabets. -/ +theorem freeGroup_map_ne_one_of_injOn {X Y : Type*} [Nonempty X] [DecidableEq X] + (f : X → Y) (w : FreeGroup X) (hw : w ≠ 1) + (hf : Set.InjOn f {x | x ∈ w.toWord.map Prod.fst}) : + FreeGroup.map f w ≠ 1 := by + let g := Function.invFunOn f {x | x ∈ w.toWord.map Prod.fst} + have hgf : FreeGroup.map g (FreeGroup.map f w) = w := by + rw [FreeGroup.map.comp] + have hm : (w.toWord.map fun a => ((g ∘ f) a.1, a.2)) = w.toWord := by + apply Eq.trans _ (List.map_id' _) + apply List.map_congr_left + intro a ha + have hx : a.1 ∈ w.toWord.map Prod.fst := List.mem_map.mpr ⟨a, ha, rfl⟩ + exact Prod.ext (hf.leftInvOn_invFunOn hx) rfl + calc + FreeGroup.map (g ∘ f) w = FreeGroup.map (g ∘ f) (FreeGroup.mk w.toWord) := + congrArg _ FreeGroup.mk_toWord.symm + _ = FreeGroup.mk w.toWord := by rw [FreeGroup.map.mk, hm] + _ = w := FreeGroup.mk_toWord + intro he + rw [he, map_one] at hgf + exact hw hgf.symm + +/-- The special permutational semidirect product used to add a graph-group +vertex is residually finite when the stabilizer is a retract. -/ +theorem retract_semidirect_residuallyFinite {A : Type u} [Group A] + [Group.ResiduallyFinite A] (C : Subgroup A) (r : A →* A) + (hr : ∀ a, r a ∈ C) (hfix : ∀ c ∈ C, r c = c) : + Group.ResiduallyFinite (FreeGroup (A ⧸ C) ⋊[freeAction A (A ⧸ C)] A) := by + classical + apply Group.residuallyFinite_of_forall_exists_finite_monoidHom + intro x hx + by_cases ha : x.right = 1 + · have hw : x.left ≠ 1 := by + intro he + apply hx + ext <;> assumption + obtain ⟨D, hD, hfD, q, hq⟩ := retract_coset_finite_separation C r hr hfix + (x.left.toWord.map Prod.fst).toFinset + let : Group D := hD + have : Finite D := hfD + let f := FreeGroup.map (cosetMap q C) + let Q := SemidirectProduct.map f q + (freeAction_map_equivariant q (cosetMap q C) (cosetMap_equivariant q C)) + have := freeGroup_residuallyFinite (D ⧸ C.map q) + have := finite_semidirect_residuallyFinite (freeAction D (D ⧸ C.map q)) + have hQ : Q x ≠ 1 := by + intro he + have hl : f x.left = 1 := congrArg SemidirectProduct.left he + apply freeGroup_map_ne_one_of_injOn (cosetMap q C) x.left hw _ hl + intro a ha b hb he + exact hq (by simpa using ha) (by simpa using hb) he + obtain ⟨H, hH⟩ := Group.exists_finiteIndexNormalSubgroup_notMem (Q x) hQ + refine ⟨_, inferInstance, inferInstance, (QuotientGroup.mk' H.toSubgroup).comp Q, ?_⟩ + intro he + exact hH ((QuotientGroup.eq_one_iff _).mp he) + · obtain ⟨H, hH⟩ := Group.exists_finiteIndexNormalSubgroup_notMem x.right ha + refine ⟨_, inferInstance, inferInstance, + (QuotientGroup.mk' H.toSubgroup).comp SemidirectProduct.rightHom, ?_⟩ + intro he + exact hH ((QuotientGroup.eq_one_iff _).mp he) + +end RetractSemidirectSeparation + +section ArtinUniversal + +variable {V W K : Type*} [Group K] (L : SimpleGraph V) + +/-- Universal property in commuting-generator form. -/ +def artinLift (f : V → K) (hf : ∀ v w, L.Adj v w → Commute (f v) (f w)) : + ArtinGroup L →* K := + PresentedGroup.toGroup (by + rintro _ ⟨v, w, hvw, rfl⟩ + simp only [map_mul, map_inv, FreeGroup.lift_apply_of] + rw [(hf v w hvw).eq] + group) + +@[simp] theorem artinLift_generator (f : V → K) + (hf : ∀ v w, L.Adj v w → Commute (f v) (f w)) (v : V) : + artinLift L f hf (artinGenerator L v) = f v := by + exact PresentedGroup.toGroup.of _ + +/-- Renaming vertices along a graph isomorphism gives the expected group map. -/ +def artinMap (M : SimpleGraph W) (f : V → W) + (hf : ∀ v w, L.Adj v w → M.Adj (f v) (f w)) : ArtinGroup L →* ArtinGroup M := + artinLift L (fun v => artinGenerator M (f v)) + (fun v w h => adjacent_generators_commute M (hf v w h)) + +@[simp] theorem artinMap_generator (M : SimpleGraph W) (f : V → W) + (hf : ∀ v w, L.Adj v w → M.Adj (f v) (f w)) (v : V) : + artinMap L M f hf (artinGenerator L v) = artinGenerator M (f v) := by + exact artinLift_generator _ _ _ _ + +/-- Residual finiteness pulls back along an injective homomorphism. -/ +theorem residuallyFinite_of_injective {G H : Type*} [Group G] [Group H] + [Group.ResiduallyFinite H] (f : G →* H) (hf : Function.Injective f) : + Group.ResiduallyFinite G := by + apply Group.residuallyFinite_of_forall_exists_finite_monoidHom + intro g hg + have hfg : f g ≠ 1 := fun h => hg (hf (h.trans (map_one f).symm)) + obtain ⟨N, hN⟩ := Group.exists_finiteIndexNormalSubgroup_notMem (f g) hfg + refine ⟨_, inferInstance, inferInstance, (QuotientGroup.mk' N.toSubgroup).comp f, ?_⟩ + intro he + exact hN ((QuotientGroup.eq_one_iff _).mp he) + +end ArtinUniversal + +section CosetConjugation + +variable {A P : Type*} [Group A] [Group P] + +/-- The formal inverse to the graph-group splitting, on its free generators. -/ +def cosetConjugate (C : Subgroup A) (i : A →* P) (t : P) + (ht : ∀ c ∈ C, Commute (i c) t) : A ⧸ C → P := + Quotient.lift (fun a => i a * t * (i a)⁻¹) (by + intro a b hab + have hd := QuotientGroup.leftRel_apply.mp hab + have hc : i (a⁻¹ * b) * t * (i (a⁻¹ * b))⁻¹ = t := by + rw [(ht _ hd).eq] + group + calc + i a * t * (i a)⁻¹ = i a * (i (a⁻¹ * b) * t * (i (a⁻¹ * b))⁻¹) * (i a)⁻¹ := by rw [hc] + _ = i b * t * (i b)⁻¹ := by simp only [map_mul, map_inv]; group) + +@[simp] theorem cosetConjugate_mk (C : Subgroup A) (i : A →* P) (t : P) + (ht : ∀ c ∈ C, Commute (i c) t) (a : A) : + cosetConjugate C i t ht (QuotientGroup.mk a) = i a * t * (i a)⁻¹ := rfl + +theorem cosetConjugate_equivariant (C : Subgroup A) (i : A →* P) (t : P) + (ht : ∀ c ∈ C, Commute (i c) t) (a : A) (x : A ⧸ C) : + cosetConjugate C i t ht (a • x) = i a * cosetConjugate C i t ht x * (i a)⁻¹ := by + induction x using QuotientGroup.induction_on with + | H b => + simp only [MulAction.Quotient.smul_mk, smul_eq_mul, cosetConjugate_mk, map_mul] + group + +def cosetSemidirectLift (C : Subgroup A) (i : A →* P) (t : P) + (ht : ∀ c ∈ C, Commute (i c) t) : + (FreeGroup (A ⧸ C) ⋊[freeAction A (A ⧸ C)] A) →* P := + SemidirectProduct.lift (FreeGroup.lift (cosetConjugate C i t ht)) i (by + intro a + ext x + simp only [MonoidHom.comp_apply, MulEquiv.coe_toMonoidHom, freeAction_of, + FreeGroup.lift_apply_of, MulAut.conj_apply, cosetConjugate_equivariant]) + +@[simp] theorem cosetSemidirectLift_inr (C : Subgroup A) (i : A →* P) (t : P) + (ht : ∀ c ∈ C, Commute (i c) t) (a : A) : + cosetSemidirectLift C i t ht (SemidirectProduct.inr a) = i a := by + simp [cosetSemidirectLift] + +@[simp] theorem cosetSemidirectLift_base (C : Subgroup A) (i : A →* P) (t : P) + (ht : ∀ c ∈ C, Commute (i c) t) : + cosetSemidirectLift C i t ht + (SemidirectProduct.inl (FreeGroup.of (QuotientGroup.mk (1 : A)))) = t := by + simp [cosetSemidirectLift] + +end CosetConjugation + +section ArtinOption + +variable {V : Type*} (L : SimpleGraph (Option V)) + +abbrev deletedGraph := L.comap Option.some +abbrev deletedGroup := ArtinGroup (deletedGraph L) + +def deletedInclusion : deletedGroup L →* ArtinGroup L := + artinMap (deletedGraph L) L Option.some (fun _ _ h => h) + +def linkSubgroup : Subgroup (deletedGroup L) := + Subgroup.closure {g | ∃ v, L.Adj none (some v) ∧ g = artinGenerator (deletedGraph L) v} + +local instance : DecidableRel L.Adj := Classical.decRel _ + +def linkRetraction : deletedGroup L →* deletedGroup L := + artinLift (deletedGraph L) + (fun v => if L.Adj none (some v) then artinGenerator (deletedGraph L) v else 1) (by + classical + intro v w hvw + split_ifs <;> first + | exact adjacent_generators_commute (deletedGraph L) hvw + | exact Commute.one_left _ + | exact Commute.one_right _) + +@[simp] theorem linkRetraction_generator (v : V) : + linkRetraction L (artinGenerator (deletedGraph L) v) = + if L.Adj none (some v) then artinGenerator (deletedGraph L) v else 1 := by + exact artinLift_generator _ _ _ _ + +theorem linkRetraction_mem (a : deletedGroup L) : linkRetraction L a ∈ linkSubgroup L := by + classical + apply PresentedGroup.generated_by (artinRelations (deletedGraph L)) + ((linkSubgroup L).comap (linkRetraction L)) _ a + intro v + change linkRetraction L (artinGenerator (deletedGraph L) v) ∈ linkSubgroup L + rw [linkRetraction_generator] + split_ifs with hv + · exact Subgroup.subset_closure ⟨v, hv, rfl⟩ + · exact (linkSubgroup L).one_mem + +theorem linkRetraction_fix (c : deletedGroup L) (hc : c ∈ linkSubgroup L) : + linkRetraction L c = c := by + classical + have hle : linkSubgroup L ≤ (linkRetraction L).eqLocus (MonoidHom.id _) := by + apply (Subgroup.closure_le _).mpr + rintro _ ⟨v, hv, rfl⟩ + change linkRetraction L (artinGenerator (deletedGraph L) v) = _ + simp [hv] + exact hle hc + +theorem link_commutes_new (c : deletedGroup L) (hc : c ∈ linkSubgroup L) : + Commute (deletedInclusion L c) (artinGenerator L none) := by + have hle : linkSubgroup L ≤ + (Subgroup.centralizer {artinGenerator L none}).comap (deletedInclusion L) := by + apply (Subgroup.closure_le _).mpr + rintro _ ⟨v, hv, rfl⟩ + apply Subgroup.mem_centralizer_singleton_iff.mpr + simpa [deletedInclusion, artinMap] using (adjacent_generators_commute L hv).symm.eq + exact (Subgroup.mem_centralizer_singleton_iff.mp (hle hc)) + +abbrev optionSemidirect := + FreeGroup (deletedGroup L ⧸ linkSubgroup L) ⋊[freeAction _ _] deletedGroup L + +def optionGenerator : Option V → optionSemidirect L + | none => SemidirectProduct.inl (FreeGroup.of (QuotientGroup.mk 1)) + | some v => SemidirectProduct.inr (artinGenerator (deletedGraph L) v) + +theorem optionGenerator_commute (v w : Option V) (h : L.Adj v w) : + Commute (optionGenerator L v) (optionGenerator L w) := by + have hnew (a : V) (ha : L.Adj none (some a)) : + Commute (optionGenerator L none) (optionGenerator L (some a)) := by + have hc : (QuotientGroup.mk (artinGenerator (deletedGraph L) a) : + deletedGroup L ⧸ linkSubgroup L) = QuotientGroup.mk 1 := by + apply QuotientGroup.eq.mpr + simpa only [mul_one] using + (linkSubgroup L).inv_mem (Subgroup.subset_closure ⟨a, ha, rfl⟩) + apply SemidirectProduct.ext + · simp [optionGenerator, freeAction_of, MulAction.Quotient.smul_mk, hc] + · simp [optionGenerator] + cases v with + | none => + cases w with + | none => exact False.elim (L.ne_of_adj h rfl) + | some a => exact hnew a h + | some a => + cases w with + | none => exact (hnew a h.symm).symm + | some b => + exact (adjacent_generators_commute (deletedGraph L) h).map SemidirectProduct.inr + +def optionForward : ArtinGroup L →* optionSemidirect L := + artinLift L (optionGenerator L) (optionGenerator_commute L) + +def optionBackward : optionSemidirect L →* ArtinGroup L := + cosetSemidirectLift (linkSubgroup L) (deletedInclusion L) (artinGenerator L none) + (link_commutes_new L) + +theorem optionForward_injective : Function.Injective (optionForward L) := by + have he : (optionBackward L).comp (optionForward L) = MonoidHom.id _ := by + apply PresentedGroup.ext + intro v + cases v <;> simp [optionForward, optionBackward, optionGenerator, deletedInclusion, artinMap] + exact (show Function.LeftInverse (optionBackward L) (optionForward L) from + fun a => DFunLike.congr_fun he a).injective + +end ArtinOption + +/-- Graph groups on finite graphs are residually finite, by deletion of a +vertex and the retract-coset semidirect splitting. -/ +theorem artin_residuallyFinite (V : Type u) [Finite V] (L : SimpleGraph V) : + Group.ResiduallyFinite (ArtinGroup L) := by + classical + apply Finite.induction_empty_option (P := fun W => ∀ M : SimpleGraph W, + Group.ResiduallyFinite (ArtinGroup M)) _ _ _ V L + · intro A B e hA M + let N := M.comap e + let f : ArtinGroup M →* ArtinGroup N := + artinMap M N e.symm (by intro v w h; simpa [N] using h) + let g : ArtinGroup N →* ArtinGroup M := artinMap N M e (fun _ _ h => h) + have hfg : g.comp f = MonoidHom.id _ := by + apply PresentedGroup.ext + intro v + change g (f (artinGenerator M v)) = artinGenerator M v + simp [g, f, artinMap] + have := hA N + apply residuallyFinite_of_injective f + exact (show Function.LeftInverse g f from fun a => DFunLike.congr_fun hfg a).injective + · intro M + rw [Group.residuallyFinite_iff_forall_finiteIndexNormalSubgroup] + intro a _ + have hm : a ∈ (⊥ : Subgroup (ArtinGroup M)) := + PresentedGroup.generated_by _ ⊥ (fun v => PEmpty.elim v) a + exact hm + · intro A _ hA M + have := hA (deletedGraph M) + have := retract_semidirect_residuallyFinite (linkSubgroup M) (linkRetraction M) + (linkRetraction_mem M) (linkRetraction_fix M) + exact residuallyFinite_of_injective (optionForward M) (optionForward_injective M) + + +end EilenbergGanea + +end + +end OAI diff --git a/lean/OAI/GroupTheory/RightAngledArtin/TraceWords.lean b/lean/OAI/GroupTheory/RightAngledArtin/TraceWords.lean new file mode 100644 index 0000000000000000000000000000000000000000..98f392b9f2ef3f89c3dd18e8870a8fad15ff3cb1 --- /dev/null +++ b/lean/OAI/GroupTheory/RightAngledArtin/TraceWords.lean @@ -0,0 +1,1322 @@ +import OAI.GroupTheory.RightAngledArtin.ResidualFiniteness +import Mathlib.Analysis.InnerProductSpace.PiL2 + +namespace OAI + +noncomputable section + +open Classical Set + +namespace EilenbergGanea +/-! Signed trace normal forms and slowly varying barycentric directions. -/ + +namespace TraceWords + +variable {V : Type*} (L : SimpleGraph V) +abbrev Letter (V : Type*) := V × Bool +abbrev Word (V : Type*) := List (Letter V) + +def invLetter (x : Letter V) : Letter V := (x.1, !x.2) +@[simp] theorem invLetter_invLetter (x : Letter V) : invLetter (invLetter x) = x := by + cases x; simp [invLetter] + +def Independent (x y : Letter V) : Prop := L.Adj x.1 y.1 +@[simp] theorem independent_inv_left (x y : Letter V) : + Independent L (invLetter x) y ↔ Independent L x y := Iff.rfl +@[simp] theorem independent_inv_right (x y : Letter V) : + Independent L x (invLetter y) ↔ Independent L x y := Iff.rfl +@[simp] theorem independent_self (x : Letter V) : ¬ Independent L x x := fun h => L.irrefl h +theorem Independent.symm {x y : Letter V} (h : Independent L x y) : Independent L y x := + L.symm.symm _ _ h + +/-- A single exchange of independent neighboring occurrences. -/ +inductive Swap : Word V → Word V → Prop + | head {x y : Letter V} {w : Word V} (h : Independent L x y) : + Swap (x :: y :: w) (y :: x :: w) + | cons (x : Letter V) {w w' : Word V} (h : Swap w w') : Swap (x :: w) (x :: w') + +variable {L} +theorem Swap.symm {w w' : Word V} (h : Swap L w w') : Swap L w' w := by + induction h with + | head h => exact .head h.symm + | cons x _ ih => exact .cons x ih + +theorem Swap.length {w w' : Word V} (h : Swap L w w') : w.length = w'.length := by + induction h <;> simp_all + +variable (L) +abbrev Equivalent := Relation.EqvGen (Swap L) + +variable {L} +@[refl] theorem Equivalent.refl (w : Word V) : Equivalent L w w := Relation.EqvGen.refl _ +@[symm] theorem Equivalent.symm {w w' : Word V} (h : Equivalent L w w') : + Equivalent L w' w := Relation.EqvGen.symm _ _ h +@[trans] theorem Equivalent.trans {w w' w'' : Word V} (h : Equivalent L w w') + (h' : Equivalent L w' w'') : Equivalent L w w'' := Relation.EqvGen.trans _ _ _ h h' + +theorem Equivalent.cons (x : Letter V) {w w' : Word V} (h : Equivalent L w w') : + Equivalent L (x :: w) (x :: w') := by + induction h with + | rel _ _ h => exact .rel _ _ (.cons x h) + | refl => exact .refl _ + | symm _ _ _ ih => exact .symm ih + | trans _ _ _ _ _ ih ih' => exact ih.trans ih' + +theorem Equivalent.length {w w' : Word V} (h : Equivalent L w w') : w.length = w'.length := by + induction h with + | rel _ _ h => exact h.length + | refl => rfl + | symm _ _ _ ih => exact ih.symm + | trans _ _ _ _ _ ih ih' => exact ih.trans ih' + +variable (L) +/-- Remove an occurrence accessible from the left through independent letters. +This retains the actual other occurrences, not merely their group value. -/ +inductive Extract (x : Letter V) : Word V → Word V → Prop + | head (w : Word V) : Extract x (x :: w) w + | cons {y : Letter V} {w w' : Word V} (h : Independent L x y) + (e : Extract x w w') : Extract x (y :: w) (y :: w') + +variable {L} +theorem Extract.length {x : Letter V} {w w' : Word V} (h : Extract L x w w') : + w'.length + 1 = w.length := by + induction h <;> simp_all + +theorem Extract.equivalent {x : Letter V} {w w' : Word V} (h : Extract L x w w') : + Equivalent L w (x :: w') := by + induction h with + | head => exact .refl _ + | @cons y w w' h e ih => + exact (ih.cons y).trans (.rel _ _ (.head h.symm)) + +theorem Extract.unique {x : Letter V} {w v v' : Word V} + (h : Extract L x w v) (h' : Extract L x w v') : v = v' := by + induction h generalizing v' with + | head w => + cases h' with + | head => rfl + | cons hi _ => exact False.elim (independent_self L x hi) + | @cons y w v hi he ih => + cases h' with + | head => exact False.elim (independent_self L x hi) + | cons _ he' => exact congrArg (List.cons y) (ih he') + +/-- Independent accessible occurrences may be removed in either order. -/ +theorem Extract.diamond {x y : Letter V} {w v u : Word V} + (hxy : Independent L x y) (hx : Extract L x w v) (hy : Extract L y w u) : + ∃ t, Extract L y v t ∧ Extract L x u t := by + induction hx generalizing u with + | head w => + cases hy with + | head => exact False.elim (independent_self L x hxy) + | cons _ he => exact ⟨_,he,.head _⟩ + | @cons a w v hxa hx ih => + cases hy with + | head => exact ⟨_,.head _,hx⟩ + | cons hya hy => + obtain ⟨t,ht,h't⟩ := ih hy + exact ⟨a :: t,.cons hya ht,.cons hxa h't⟩ + +/-- An adjacent commutation does not destroy accessible occurrences. -/ +theorem Extract.swap {x : Letter V} {w w' v : Word V} + (hs : Swap L w w') (he : Extract L x w v) : + ∃ v', Extract L x w' v' ∧ Equivalent L v v' := by + induction hs generalizing v with + | @head a b w hab => + cases he with + | head => exact ⟨_,.cons hab (.head _),.refl _⟩ + | cons hxa he => + cases he with + | head => exact ⟨_,.head _,.refl _⟩ + | cons hxb he => + exact ⟨_,.cons hxb (.cons hxa he),.rel _ _ (.head hab)⟩ + | @cons a w w' hs ih => + cases he with + | head => exact ⟨_,.head _,.rel _ _ hs⟩ + | cons hxa he => + obtain ⟨v',he',hv'⟩ := ih he + exact ⟨_,.cons hxa he',hv'.cons a⟩ + +variable (L) +/-- Delete an inverse pair after commuting its endpoints together. -/ +inductive Step : Word V → Word V → Prop + | head {x : Letter V} {w w' : Word V} (h : Extract L (invLetter x) w w') : + Step (x :: w) w' + | cons (x : Letter V) {w w' : Word V} (h : Step w w') : Step (x :: w) (x :: w') + +variable {L} +theorem Step.length {w w' : Word V} (h : Step L w w') : w'.length + 2 = w.length := by + induction h with + | head h => have := h.length; simp only [List.length_cons]; omega + | cons _ _ ih => simp_all + +/-- Lift a cancellation across one independent exchange, tracking its output. -/ +theorem Step.swap {w w' v : Word V} (hs : Swap L w w') (he : Step L w v) : + ∃ v', Step L w' v' ∧ Equivalent L v v' := by + induction hs generalizing v with + | @head a b w hab => + cases he with + | head he => + cases he with + | head => exact False.elim (independent_self L a hab) + | cons _ he => exact ⟨_,.cons b (.head he),.refl _⟩ + | cons _ he => + cases he with + | head he => exact ⟨_,.head (.cons hab.symm he),.refl _⟩ + | cons _ he => exact ⟨_,.cons b (.cons a he),.rel _ _ (.head hab)⟩ + | @cons a w w' hs ih => + cases he with + | head he => + obtain ⟨v',he',hv'⟩ := he.swap hs + exact ⟨_,.head he',hv'⟩ + | cons _ he => + obtain ⟨v',he',hv'⟩ := ih he + exact ⟨_,.cons a he',hv'.cons a⟩ + +/-- The only overlapping cancellation shares the accessible occurrence. +Its two outcomes differ only by exchanges; disjoint deletions commute. -/ +theorem Extract.step {x : Letter V} {w v u : Word V} + (hx : Extract L x w v) (hs : Step L w u) : + Equivalent L v (invLetter x :: u) ∨ + ∃ t, Step L v t ∧ Extract L x u t := by + induction hx generalizing u with + | head w => + cases hs with + | head he => exact Or.inl he.equivalent + | cons _ hs => exact Or.inr ⟨_,hs,.head _⟩ + | @cons a w v hxa hx ih => + cases hs with + | head he => + obtain ⟨t,ht,h't⟩ := hx.diamond (show Independent L x (invLetter a) from hxa) he + exact Or.inr ⟨t,.head ht,h't⟩ + | cons _ hs => + rcases ih hs with h | ⟨t,ht,h't⟩ + · exact Or.inl ((h.cons a).trans (.rel _ _ (.head hxa.symm))) + · exact Or.inr ⟨a :: t,.cons a ht,.cons hxa h't⟩ + +/-- Local confluence modulo independent exchanges. -/ +theorem Step.diamond {w v u : Word V} (hv : Step L w v) (hu : Step L w u) : + Equivalent L v u ∨ ∃ t t', Step L v t ∧ Step L u t' ∧ Equivalent L t t' := by + induction hv generalizing u with + | @head x w v he => + cases hu with + | head he' => exact Or.inl (he.unique he' ▸ .refl _) + | cons _ hu => + rcases he.step hu with h | ⟨t,ht,h't⟩ + · exact Or.inl (by simpa using h) + · exact Or.inr ⟨t,t,ht,.head h't,.refl _⟩ + | @cons x w v hv ih => + cases hu with + | head he => + rcases he.step hv with h | ⟨t,ht,h't⟩ + · exact Or.inl (by simpa using h.symm) + · exact Or.inr ⟨t,t,.head h't,ht,.refl _⟩ + | cons _ hu => + rcases ih hu with h | ⟨t,t',ht,h't,htt'⟩ + · exact Or.inl (h.cons x) + · exact Or.inr ⟨x :: t,x :: t',.cons x ht,.cons x h't,htt'.cons x⟩ + +instance : Std.Symm (Swap L) where + symm _ _ h := h.symm + +theorem Equivalent.step {w w' v : Word V} (hs : Equivalent L w w') (he : Step L w v) : + ∃ v', Step L w' v' ∧ Equivalent L v v' := by + have hh : Relation.ReflTransGen (Swap L) w w' := by + rwa [← Relation.EqvGen.eqvGen_eq_reflTransGen] + clear hs + induction hh with + | refl => exact ⟨_,he,.refl _⟩ + | tail _ hs ih => + obtain ⟨v',he',hv'⟩ := ih + obtain ⟨v'',he'',hv''⟩ := he'.swap hs + exact ⟨_,he'',hv'.trans hv''⟩ + +variable (L) +def traceSetoid : Setoid (Word V) where + r := Equivalent L + iseqv := ⟨Equivalent.refl,Equivalent.symm,Equivalent.trans⟩ + +abbrev Trace := Quotient (traceSetoid L) +def ofWord (w : Word V) : Trace L := Quotient.mk _ w + +def traceLength : Trace L → ℕ := Quotient.lift List.length (fun _ _ h => h.length) +@[simp] theorem traceLength_ofWord (w : Word V) : traceLength L (ofWord L w) = w.length := rfl + +@[simp] theorem ofWord_eq {w v : Word V} : ofWord L w = ofWord L v ↔ Equivalent L w v := + Quotient.eq + +/-- Reduction of traces, not a choice of ordered representative. -/ +def ReductionStep (t t' : Trace L) : Prop := + ∃ w v, Step L w v ∧ ofWord L w = t ∧ ofWord L v = t' + +variable {L} +theorem Step.trace {w v : Word V} (h : Step L w v) : + ReductionStep L (ofWord L w) (ofWord L v) := ⟨w,v,h,rfl,rfl⟩ + +theorem ReductionStep.representative {w : Word V} {t : Trace L} + (h : ReductionStep L (ofWord L w) t) : + ∃ v, Step L w v ∧ ofWord L v = t := by + obtain ⟨a,b,hab,ha,hb⟩ := h + obtain ⟨v,hv,hbv⟩ := ((ofWord_eq L).mp ha).step hab + exact ⟨v,hv,((ofWord_eq L).mpr hbv).symm.trans hb⟩ + +theorem ReductionStep.length {t t' : Trace L} (h : ReductionStep L t t') : + traceLength L t' + 2 = traceLength L t := by + obtain ⟨w,v,h,rfl,rfl⟩ := h + exact h.length + +theorem ReductionStep.diamond {t t' t'' : Trace L} + (h : ReductionStep L t t') (h' : ReductionStep L t t'') : + t' = t'' ∨ ∃ u, ReductionStep L t' u ∧ ReductionStep L t'' u := by + induction t using Quotient.inductionOn with + | h w => + obtain ⟨v,hv,rfl⟩ := h.representative + obtain ⟨u,hu,rfl⟩ := h'.representative + rcases hv.diamond hu with he | ⟨a,b,ha,hb,hab⟩ + · exact Or.inl ((ofWord_eq L).mpr he) + · refine Or.inr ⟨ofWord L a,ha.trace,?_⟩ + rw [(ofWord_eq L).mpr hab] + exact hb.trace + +variable (L) +abbrev Reduction := Relation.ReflTransGen (ReductionStep L) +def Reduced (t : Trace L) : Prop := ∀ t', ¬ ReductionStep L t t' + +variable {L} +theorem Reduction.length_le {t t' : Trace L} (h : Reduction L t t') : + traceLength L t' ≤ traceLength L t := by + induction h with + | refl => rfl + | tail _ hs ih => have := hs.length; omega + +theorem Reduction.confluence {t t' t'' : Trace L} + (h : Reduction L t t') (h' : Reduction L t t'') : + ∃ u, Reduction L t' u ∧ Reduction L t'' u := by + apply Relation.church_rosser (r := ReductionStep L) _ h h' + intro _ _ _ ha hb + rcases ha.diamond hb with rfl | ⟨u,hu,hu'⟩ + · exact ⟨_,.refl,.refl⟩ + · exact ⟨u,.single hu,.single hu'⟩ + +theorem Reduced.reduction_eq {t t' : Trace L} (h : Reduced L t) (hr : Reduction L t t') : + t = t' := by + rcases hr.cases_head with he | ⟨u,hu,_⟩ + · exact he + · exact False.elim (h u hu) + +theorem exists_reduced (t : Trace L) : ∃ t', Reduction L t t' ∧ Reduced L t' := by + classical + induction hn : traceLength L t using Nat.strong_induction_on generalizing t with + | h n ih => + by_cases ht : Reduced L t + · exact ⟨t,.refl,ht⟩ + · obtain ⟨u,hu⟩ : ∃ u, ReductionStep L t u := by simpa [Reduced] using ht + have hl := hu.length + obtain ⟨v,hv,hv'⟩ := ih (traceLength L u) (by omega) u rfl + exact ⟨v,hv.head hu,hv'⟩ + +theorem reduced_unique {t u v : Trace L} (hu : Reduction L t u) (hv : Reduction L t v) + (hru : Reduced L u) (hrv : Reduced L v) : u = v := by + obtain ⟨a,ha,h'a⟩ := hu.confluence hv + exact (hru.reduction_eq ha).trans (hrv.reduction_eq h'a).symm + +variable (L) +def normalTrace (t : Trace L) : Trace L := (exists_reduced t).choose + +theorem normalTrace_reduction (t : Trace L) : Reduction L t (normalTrace L t) := + (exists_reduced t).choose_spec.1 + +theorem normalTrace_reduced (t : Trace L) : Reduced L (normalTrace L t) := + (exists_reduced t).choose_spec.2 + +variable {L} +theorem Reduced.normalTrace_eq {t : Trace L} (h : Reduced L t) : normalTrace L t = t := + (h.reduction_eq (normalTrace_reduction L t)).symm + +theorem Reduction.normalTrace_eq {t u : Trace L} (h : Reduction L t u) : + normalTrace L t = normalTrace L u := + reduced_unique (normalTrace_reduction L t) (h.trans (normalTrace_reduction L u)) + (normalTrace_reduced L t) (normalTrace_reduced L u) + +@[simp] theorem normalTrace_idem (t : Trace L) : + normalTrace L (normalTrace L t) = normalTrace L t := + (normalTrace_reduced L t).normalTrace_eq + +theorem Swap.append_right {w v : Word V} (h : Swap L w v) (u : Word V) : + Swap L (w ++ u) (v ++ u) := by + induction h with + | head h => exact .head h + | cons x _ ih => exact .cons x ih + +theorem Equivalent.append_right {w v : Word V} (h : Equivalent L w v) (u : Word V) : + Equivalent L (w ++ u) (v ++ u) := by + induction h with + | rel _ _ h => exact .rel _ _ (h.append_right u) + | refl => exact .refl _ + | symm _ _ _ ih => exact ih.symm + | trans _ _ _ _ _ ih ih' => exact ih.trans ih' + +theorem Equivalent.append_left {w v : Word V} (h : Equivalent L w v) (u : Word V) : + Equivalent L (u ++ w) (u ++ v) := by + induction u with + | nil => exact h + | cons a u ih => exact ih.cons a + +theorem Extract.append_right {x : Letter V} {w v : Word V} + (h : Extract L x w v) (u : Word V) : Extract L x (w ++ u) (v ++ u) := by + induction h with + | head => exact .head _ + | cons hi _ ih => exact .cons hi ih + +theorem Step.append_right {w v : Word V} (h : Step L w v) (u : Word V) : + Step L (w ++ u) (v ++ u) := by + induction h with + | head h => exact .head (h.append_right u) + | cons x _ ih => exact .cons x ih + +theorem Step.append_left {w v : Word V} (h : Step L w v) (u : Word V) : + Step L (u ++ w) (u ++ v) := by + induction u with + | nil => exact h + | cons a u ih => exact .cons a ih + +variable (L) +def appendTrace (t u : Trace L) : Trace L := + Quotient.liftOn₂ t u (fun w v => ofWord L (w ++ v)) (by + intro w v w' v' hw hv + exact (ofWord_eq L).mpr ((hw.append_right v).trans (hv.append_left w'))) + +@[simp] theorem appendTrace_ofWord (w v : Word V) : + appendTrace L (ofWord L w) (ofWord L v) = ofWord L (w ++ v) := rfl + +variable {L} +theorem ReductionStep.append_left {t t' : Trace L} (h : ReductionStep L t t') (u : Trace L) : + ReductionStep L (appendTrace L u t) (appendTrace L u t') := by + obtain ⟨w,v,h,rfl,rfl⟩ := h + induction u using Quotient.inductionOn with + | h a => exact (h.append_left a).trace + +theorem ReductionStep.append_right {t t' : Trace L} (h : ReductionStep L t t') (u : Trace L) : + ReductionStep L (appendTrace L t u) (appendTrace L t' u) := by + obtain ⟨w,v,h,rfl,rfl⟩ := h + induction u using Quotient.inductionOn with + | h a => exact (h.append_right a).trace + +theorem Reduction.append_left {t t' : Trace L} (h : Reduction L t t') (u : Trace L) : + Reduction L (appendTrace L u t) (appendTrace L u t') := by + induction h with + | refl => exact .refl + | tail _ h ih => exact ih.tail (h.append_left u) + +theorem Reduction.append_right {t t' : Trace L} (h : Reduction L t t') (u : Trace L) : + Reduction L (appendTrace L t u) (appendTrace L t' u) := by + induction h with + | refl => exact .refl + | tail _ h ih => exact ih.tail (h.append_right u) + +theorem normalTrace_append (t u : Trace L) : + normalTrace L (appendTrace L t u) = + normalTrace L (appendTrace L (normalTrace L t) (normalTrace L u)) := + Reduction.normalTrace_eq (((normalTrace_reduction L t).append_right u).trans + ((normalTrace_reduction L u).append_left (normalTrace L t))) + +variable (L) +/-- Equality of reduced traces is a monoid congruence on signed words. -/ +def normalCon : Con (FreeMonoid (Letter V)) where + r w v := normalTrace L (ofWord L w.toList) = normalTrace L (ofWord L v.toList) + iseqv := ⟨fun _ => rfl,fun h => h.symm,fun h h' => h.trans h'⟩ + mul' {x y z t} hxy hzt := by + change normalTrace L (appendTrace L (ofWord L x.toList) (ofWord L z.toList)) = + normalTrace L (appendTrace L (ofWord L y.toList) (ofWord L t.toList)) + calc + _ = normalTrace L (appendTrace L (normalTrace L (ofWord L x.toList)) + (normalTrace L (ofWord L z.toList))) := normalTrace_append _ _ + _ = normalTrace L (appendTrace L (normalTrace L (ofWord L y.toList)) + (normalTrace L (ofWord L t.toList))) := by rw [hxy,hzt] + _ = _ := (normalTrace_append _ _).symm + +abbrev WordGroup := (normalCon L).Quotient + +def groupWord (w : Word V) : WordGroup L := (normalCon L).mk' (FreeMonoid.ofList w) + +@[simp] theorem groupWord_nil : groupWord L [] = 1 := rfl +@[simp] theorem groupWord_append (w v : Word V) : groupWord L (w ++ v) = + groupWord L w * groupWord L v := rfl + +@[simp] theorem groupWord_eq {w v : Word V} : groupWord L w = groupWord L v ↔ + normalTrace L (ofWord L w) = normalTrace L (ofWord L v) := Quotient.eq + +variable {L} +theorem Step.groupWord {w v : Word V} (h : Step L w v) : groupWord L w = groupWord L v := + (groupWord_eq L).mpr (Reduction.normalTrace_eq (Relation.ReflTransGen.single h.trace)) + +theorem Swap.groupWord {w v : Word V} (h : Swap L w v) : groupWord L w = groupWord L v := by + apply (groupWord_eq L).mpr + rw [(ofWord_eq L).mpr (.rel _ _ h)] + +theorem isUnit_groupWord_singleton (x : Letter V) : IsUnit (groupWord L [x]) := by + refine ⟨⟨groupWord L [x],groupWord L [invLetter x],?_,?_⟩,rfl⟩ + · change groupWord L [x,invLetter x] = groupWord L [] + exact (Step.head (.head [])).groupWord + · change groupWord L [invLetter x,x] = groupWord L [] + exact (Step.head (by simpa using (Extract.head (L := L) (x := invLetter (invLetter x)) []))).groupWord + +theorem isUnit_groupWord (w : Word V) : IsUnit (groupWord L w) := by + induction w with + | nil => exact isUnit_one + | cons x w ih => + change IsUnit (groupWord L [x] * groupWord L w) + exact (isUnit_groupWord_singleton x).mul ih + +variable (L) +noncomputable instance wordGroupGroup : Group (WordGroup L) := groupOfIsUnit (by + intro x + induction x using Con.induction_on with + | H w => exact isUnit_groupWord w.toList) + +@[simp] theorem groupWord_inv_singleton (x : Letter V) : + groupWord L [invLetter x] = (groupWord L [x])⁻¹ := by + apply mul_left_cancel (a := groupWord L [x]) + rw [mul_inv_cancel,← groupWord_append] + exact (Step.head (.head [])).groupWord + +section Evaluation +variable {K : Type*} [Group K] (f : V → K) + +def letterValue (x : Letter V) : K := if x.2 then f x.1 else (f x.1)⁻¹ +@[simp] theorem letterValue_positive (v : V) : letterValue f (v,true) = f v := rfl +@[simp] theorem letterValue_negative (v : V) : letterValue f (v,false) = (f v)⁻¹ := rfl +@[simp] theorem letterValue_inverse (x : Letter V) : letterValue f (invLetter x) = + (letterValue f x)⁻¹ := by + rcases x with ⟨x,b⟩; cases b <;> simp [letterValue,invLetter] + +def wordEval (w : Word V) : K := (w.map (letterValue f)).prod +@[simp] theorem wordEval_nil : wordEval f [] = 1 := rfl +@[simp] theorem wordEval_cons (x : Letter V) (w : Word V) : + wordEval f (x :: w) = letterValue f x * wordEval f w := rfl +@[simp] theorem wordEval_append (w v : Word V) : + wordEval f (w ++ v) = wordEval f w * wordEval f v := by simp [wordEval] +@[simp] theorem wordEval_singleton (x : Letter V) : wordEval f [x] = letterValue f x := by + simp + +variable {L f} +theorem letterValue_commute (hf : ∀ x y, L.Adj x y → Commute (f x) (f y)) + {x y : Letter V} (h : Independent L x y) : Commute (letterValue f x) (letterValue f y) := by + rcases x with ⟨x,b⟩; rcases y with ⟨y,c⟩ + have hh := hf x y h + cases b <;> cases c + · exact hh.inv_left.inv_right + · exact hh.inv_left + · exact hh.inv_right + · exact hh + +theorem Swap.wordEval (hf : ∀ x y, L.Adj x y → Commute (f x) (f y)) + {w v : Word V} (h : Swap L w v) : wordEval f w = wordEval f v := by + induction h with + | head h => simp only [wordEval_cons,← mul_assoc,(letterValue_commute hf h).eq] + | cons _ _ ih => simp only [wordEval_cons,ih] + +theorem Equivalent.wordEval (hf : ∀ x y, L.Adj x y → Commute (f x) (f y)) + {w v : Word V} (h : Equivalent L w v) : wordEval f w = wordEval f v := by + induction h with + | rel _ _ h => exact h.wordEval hf + | refl => rfl + | symm _ _ _ ih => exact ih.symm + | trans _ _ _ _ _ ih ih' => exact ih.trans ih' + +theorem Step.wordEval (hf : ∀ x y, L.Adj x y → Commute (f x) (f y)) + {w v : Word V} (h : Step L w v) : wordEval f w = wordEval f v := by + induction h with + | head h => + rw [wordEval_cons,h.equivalent.wordEval hf,wordEval_cons,letterValue_inverse, + mul_inv_cancel_left] + | cons _ _ ih => simp only [wordEval_cons,ih] + +variable (L f) +def traceEval (hf : ∀ x y, L.Adj x y → Commute (f x) (f y)) : Trace L → K := + Quotient.lift (wordEval f) (fun _ _ h => h.wordEval hf) + +@[simp] theorem traceEval_ofWord (hf : ∀ x y, L.Adj x y → Commute (f x) (f y)) + (w : Word V) : traceEval L f hf (ofWord L w) = wordEval f w := rfl + +variable {L f} +theorem ReductionStep.traceEval (hf : ∀ x y, L.Adj x y → Commute (f x) (f y)) + {t u : Trace L} (h : ReductionStep L t u) : traceEval L f hf t = traceEval L f hf u := by + obtain ⟨w,v,h,rfl,rfl⟩ := h + exact h.wordEval hf + +theorem Reduction.traceEval (hf : ∀ x y, L.Adj x y → Commute (f x) (f y)) + {t u : Trace L} (h : Reduction L t u) : traceEval L f hf t = traceEval L f hf u := by + induction h with + | refl => rfl + | tail _ h ih => exact ih.trans (h.traceEval hf) + +theorem traceEval_normalTrace (hf : ∀ x y, L.Adj x y → Commute (f x) (f y)) + (t : Trace L) : traceEval L f hf (normalTrace L t) = traceEval L f hf t := + ((normalTrace_reduction L t).traceEval hf).symm + +variable (L f) +def groupEval (hf : ∀ x y, L.Adj x y → Commute (f x) (f y)) : WordGroup L →* K := + (normalCon L).lift (FreeMonoid.lift (letterValue f)) (by + intro w v h + change normalTrace L (ofWord L w.toList) = normalTrace L (ofWord L v.toList) at h + have hh := congrArg (traceEval L f hf) h + change FreeMonoid.lift (letterValue f) w = FreeMonoid.lift (letterValue f) v + simpa only [FreeMonoid.lift_apply,traceEval_normalTrace,traceEval_ofWord,wordEval] using hh) + +@[simp] theorem groupEval_word (hf : ∀ x y, L.Adj x y → Commute (f x) (f y)) + (w : Word V) : groupEval L f hf (groupWord L w) = wordEval f w := by + change FreeMonoid.lift (letterValue f) (FreeMonoid.ofList w) = wordEval f w + exact FreeMonoid.lift_ofList _ _ + +end Evaluation + +/-- The kernel presentation is compared with the signed trace group, not with +an assumed normal-form model. -/ +def toArtin : WordGroup L →* ArtinGroup L := + groupEval L (artinGenerator L) (fun _ _ h => adjacent_generators_commute L h) + +theorem groupWord_commute {v w : V} (h : L.Adj v w) : + Commute (groupWord L [(v,true)]) (groupWord L [(w,true)]) := by + change groupWord L [(v,true),(w,true)] = groupWord L [(w,true),(v,true)] + exact (Swap.head (L := L) (x := (v,true)) (y := (w,true)) (w := []) h).groupWord + +def ofArtin : ArtinGroup L →* WordGroup L := + artinLift L (fun v => groupWord L [(v,true)]) (fun _ _ h => groupWord_commute L h) + +@[simp] theorem ofArtin_generator (v : V) : ofArtin L (artinGenerator L v) = + groupWord L [(v,true)] := artinLift_generator _ _ _ _ + +@[simp] theorem toArtin_word (w : Word V) : + toArtin L (groupWord L w) = wordEval (artinGenerator L) w := groupEval_word _ _ _ _ + +@[simp] theorem ofArtin_letter (x : Letter V) : + ofArtin L (letterValue (artinGenerator L) x) = groupWord L [x] := by + rcases x with ⟨x,b⟩ + cases b + · change ofArtin L (artinGenerator L x)⁻¹ = groupWord L [(x,false)] + rw [map_inv,ofArtin_generator] + exact (groupWord_inv_singleton L (x,true)).symm + · exact ofArtin_generator L x + +theorem ofArtin_word (w : Word V) : + ofArtin L (wordEval (artinGenerator L) w) = groupWord L w := by + induction w with + | nil => exact (ofArtin L).map_one + | cons x w ih => + rw [wordEval_cons,map_mul,ofArtin_letter,ih] + rfl + +theorem ofArtin_toArtin (g : WordGroup L) : ofArtin L (toArtin L g) = g := by + induction g using Con.induction_on with + | H w => + change ofArtin L (toArtin L (groupWord L w.toList)) = groupWord L w.toList + rw [toArtin_word,ofArtin_word] + +theorem toArtin_ofArtin (g : ArtinGroup L) : toArtin L (ofArtin L g) = g := by + have he : (toArtin L).comp (ofArtin L) = MonoidHom.id _ := by + apply PresentedGroup.ext + intro v + change toArtin L (ofArtin L (artinGenerator L v)) = artinGenerator L v + rw [ofArtin_generator,toArtin_word,wordEval_singleton,letterValue_positive] + exact DFunLike.congr_fun he g + +/-- The actual presented Artin group equals the word group constructed by +confluence of individual-occurrence cancellations. -/ +def artinEquiv : ArtinGroup L ≃* WordGroup L where + toFun := ofArtin L + invFun := toArtin L + left_inv := toArtin_ofArtin L + right_inv := ofArtin_toArtin L + map_mul' := (ofArtin L).map_mul + +/-- Two words have the same value in the actual Artin group exactly when they +have the same reduced trace. -/ +theorem artin_word_eq_iff (w v : Word V) : + wordEval (artinGenerator L) w = wordEval (artinGenerator L) v ↔ + normalTrace L (ofWord L w) = normalTrace L (ofWord L v) := by + rw [← groupWord_eq] + constructor + · intro h + simpa only [ofArtin_word] using congrArg (ofArtin L) h + · intro h + simpa only [toArtin_word] using congrArg (toArtin L) h + +theorem trace_reduced_minimal {w : Word V} (h : Reduced L (ofWord L w)) + {v : Word V} (hv : wordEval (artinGenerator L) w = wordEval (artinGenerator L) v) : + w.length ≤ v.length := by + have he := (artin_word_eq_iff L w v).mp hv + rw [h.normalTrace_eq] at he + have hl := (normalTrace_reduction L (ofWord L v)).length_le + rwa [← he] at hl + + +/-! The occurrence-level normal form is now used to control an actual generator +step. No geometric normal-form or direction-vector assertion is assumed. -/ + +variable {L} + +theorem Reduced.of_equivalent {w v : Word V} (h : Reduced L (ofWord L w)) + (he : Equivalent L w v) : Reduced L (ofWord L v) := by + rwa [← (ofWord_eq L).mpr he] + +theorem Reduced.of_append_left {w v : Word V} (h : Reduced L (ofWord L (w ++ v))) : + Reduced L (ofWord L v) := by + intro t ht + exact h _ (ht.append_left (ofWord L w)) + +theorem Reduced.of_append_right {w v : Word V} (h : Reduced L (ofWord L (w ++ v))) : + Reduced L (ofWord L w) := by + intro t ht + exact h _ (ht.append_right (ofWord L v)) + +theorem Reduced.tail {x : Letter V} {w : Word V} (h : Reduced L (ofWord L (x :: w))) : + Reduced L (ofWord L w) := + Reduced.of_append_left (w := [x]) h + +theorem Extract.append_singleton {x y : Letter V} {w v : Word V} + (h : Extract L x (w ++ [y]) v) : + (∃ v', Extract L x w v' ∧ v = v' ++ [y]) ∨ + (x = y ∧ v = w ∧ ∀ a ∈ w, Independent L x a) := by + induction w generalizing v with + | nil => + cases h with + | head => exact Or.inr ⟨rfl,rfl,by simp⟩ + | cons _ he => cases he + | cons a w ih => + cases h with + | head => exact Or.inl ⟨w,.head _,rfl⟩ + | cons ha he => + rcases ih he with ⟨v',hv',rfl⟩ | ⟨hxy,rfl,hw⟩ + · exact Or.inl ⟨a :: v',.cons ha hv',rfl⟩ + · refine Or.inr ⟨hxy,rfl,?_⟩ + intro b hb + rcases List.mem_cons.mp hb with rfl | hb + · exact ha + · exact hw b hb + +theorem Extract.last {x : Letter V} {w : Word V} + (h : ∀ a ∈ w, Independent L x a) : Extract L x (w ++ [x]) w := by + induction w with + | nil => exact .head [] + | cons a w ih => + exact .cons (h a (by simp)) (ih (fun b hb => h b (by simp [hb]))) + +/-- A cancellation in a reduced word with one appended occurrence must cancel +that new occurrence. The old inverse occurrence was maximal: it can be moved +all the way to the right by independent exchanges. -/ +theorem Step.append_reduced {x : Letter V} {w v : Word V} + (hw : Reduced L (ofWord L w)) (h : Step L (w ++ [x]) v) : + Equivalent L w (v ++ [invLetter x]) := by + induction w generalizing v with + | nil => + cases h with + | head he => cases he + | cons _ he => cases he + | cons a w ih => + cases h with + | head he => + rcases he.append_singleton with ⟨v',hv',_⟩ | ⟨hax,hv,hi⟩ + · exact False.elim (hw _ (Step.head hv').trace) + · subst v + have hia : ∀ b ∈ w, Independent L a b := hi + have ha : a = invLetter x := by rw [← hax,invLetter_invLetter] + rw [← ha] + exact (Extract.last hia).equivalent.symm + | cons _ he => exact (ih hw.tail he).cons a + +/-- On an actual reduced trace, a generator step either adds a maximal +occurrence or removes a maximal inverse occurrence, with no further reduction. -/ +theorem reduced_append_alternative {x : Letter V} {w : Word V} + (hw : Reduced L (ofWord L w)) : + Reduced L (ofWord L (w ++ [x])) ∨ + ∃ v, Reduced L (ofWord L v) ∧ Equivalent L w (v ++ [invLetter x]) ∧ + normalTrace L (ofWord L (w ++ [x])) = ofWord L v := by + classical + by_cases h : Reduced L (ofWord L (w ++ [x])) + · exact Or.inl h + · obtain ⟨t,ht⟩ : ∃ t, ReductionStep L (ofWord L (w ++ [x])) t := by + simpa only [Reduced,not_forall,not_not] using h + obtain ⟨v,hv,rfl⟩ := ht.representative + have he := hv.append_reduced hw + have hr : Reduced L (ofWord L v) := (hw.of_equivalent he).of_append_right + exact Or.inr ⟨v,hr,he,(Reduction.normalTrace_eq (Relation.ReflTransGen.single hv.trace)).trans + hr.normalTrace_eq⟩ + + +section RootCounts +variable [LinearOrder V] +variable (L) + +/-- The previously encountered minimal ancestral directions of letters +which are dependent on the next direction. Taking the minimum recursively +computes the first minimal ancestor in the occurrence poset. -/ +def predecessorRoots (s : Multiset (V × V)) (v : V) : Finset V := by + classical + exact ((s.filter (fun p => ¬ L.Adj p.1 v)).map Prod.snd).toFinset + +def nextRoot (s : Multiset (V × V)) (v : V) : V := + if h : (predecessorRoots L s v).Nonempty then (predecessorRoots L s v).min' h else v + +def rootInsert (s : Multiset (V × V)) (v : V) : Multiset (V × V) := + (v,nextRoot L s v) ::ₘ s + +/-- Each pair records an occurrence's direction and its assigned minimal +ancestral direction. Signs do not change the occurrence dependency relation. -/ +def rootScan (s : Multiset (V × V)) (w : Word V) : Multiset (V × V) := + w.foldl (fun s x => rootInsert L s x.1) s + +@[simp] theorem rootScan_nil (s : Multiset (V × V)) : rootScan L s [] = s := rfl +@[simp] theorem rootScan_cons (s : Multiset (V × V)) (x : Letter V) (w : Word V) : + rootScan L s (x :: w) = rootScan L (rootInsert L s x.1) w := rfl + +theorem rootScan_append (s : Multiset (V × V)) (w v : Word V) : + rootScan L s (w ++ v) = rootScan L (rootScan L s w) v := List.foldl_append + +variable {L} + +theorem mem_predecessorRoots {s : Multiset (V × V)} {v r : V} : + r ∈ predecessorRoots L s v ↔ ∃ p ∈ s, ¬ L.Adj p.1 v ∧ p.2 = r := by + classical + simp only [predecessorRoots,Multiset.mem_toFinset,Multiset.mem_map,Multiset.mem_filter] + aesop + +theorem predecessorRoots_cons_independent (s : Multiset (V × V)) {a v : V} + (r : V) (h : L.Adj a v) : + predecessorRoots L ((a,r) ::ₘ s) v = predecessorRoots L s v := by + classical + simp [predecessorRoots,h] + +theorem nextRoot_cons_independent (s : Multiset (V × V)) {a v : V} + (r : V) (h : L.Adj a v) : + nextRoot L ((a,r) ::ₘ s) v = nextRoot L s v := by + simp only [nextRoot,predecessorRoots_cons_independent s r h] + +theorem rootInsert_commute (s : Multiset (V × V)) {v w : V} (h : L.Adj v w) : + rootInsert L (rootInsert L s v) w = rootInsert L (rootInsert L s w) v := by + simp only [rootInsert,nextRoot_cons_independent s _ h, + nextRoot_cons_independent s _ (L.symm.symm _ _ h)] + exact Multiset.cons_swap _ _ _ + +theorem Swap.rootScan {w v : Word V} (h : Swap L w v) (s : Multiset (V × V)) : + rootScan L s w = rootScan L s v := by + induction h generalizing s with + | head h => simp only [rootScan_cons,rootInsert_commute s h] + | cons _ _ ih => exact ih _ + +theorem Equivalent.rootScan {w v : Word V} (h : Equivalent L w v) (s : Multiset (V × V)) : + rootScan L s w = rootScan L s v := by + induction h with + | rel _ _ h => exact h.rootScan s + | refl => rfl + | symm _ _ _ ih => exact ih.symm + | trans _ _ _ _ _ ih ih' => exact ih.trans ih' + +/-- Every assigned root occurs as a minimal occurrence, and the root directions +of the whole state form a clique. These assertions simultaneously express +support in a simplex and permanence of old assignments. -/ +def RootInvariant (L : SimpleGraph V) (s : Multiset (V × V)) : Prop := + (∀ p ∈ s, (p.2,p.2) ∈ s) ∧ + ∀ p ∈ s, ∀ q ∈ s, p.2 ≠ q.2 → L.Adj p.2 q.2 + +theorem nextRoot_mem_or_new (s : Multiset (V × V)) (v : V) : + (∃ p ∈ s, p.2 = nextRoot L s v) ∨ + (nextRoot L s v = v ∧ ∀ p ∈ s, L.Adj p.1 v) := by + classical + by_cases h : (predecessorRoots L s v).Nonempty + · left + have hm := Finset.min'_mem (predecessorRoots L s v) h + obtain ⟨p,hp,_,he⟩ := mem_predecessorRoots.mp hm + exact ⟨p,hp,by simpa only [nextRoot,dite_eq_left h] using he⟩ + · refine Or.inr ⟨by simp [nextRoot,h],?_⟩ + intro p hp + by_contra hn + exact h ⟨p.2,mem_predecessorRoots.mpr ⟨p,hp,hn,rfl⟩⟩ + +theorem RootInvariant.insert {s : Multiset (V × V)} (hs : RootInvariant L s) (v : V) : + RootInvariant L (rootInsert L s v) := by + classical + have hr : (nextRoot L s v,nextRoot L s v) ∈ rootInsert L s v := by + rcases nextRoot_mem_or_new (L := L) s v with ⟨p,hp,he⟩ | ⟨he,_⟩ + · simp only [rootInsert,Multiset.mem_cons] + right + rw [← he] + exact hs.1 p hp + · simp [rootInsert,he] + have ha : ∀ p ∈ s, nextRoot L s v ≠ p.2 → L.Adj (nextRoot L s v) p.2 := by + intro p hp hne + rcases nextRoot_mem_or_new (L := L) s v with ⟨q,hq,he⟩ | ⟨he,hv⟩ + · rw [← he] at hne ⊢ + exact hs.2 q hq p hp hne + · rw [he] + exact L.symm.symm _ _ (hv (p.2,p.2) (hs.1 p hp)) + constructor + · intro p hp + rcases Multiset.mem_cons.mp hp with rfl | hp + · exact hr + · exact Multiset.mem_cons.mpr (Or.inr (hs.1 p hp)) + · intro p hp q hq hne + rcases Multiset.mem_cons.mp hp with rfl | hp + · rcases Multiset.mem_cons.mp hq with rfl | hq + · exact False.elim (hne rfl) + · exact ha q hq hne + · rcases Multiset.mem_cons.mp hq with rfl | hq + · exact L.symm.symm _ _ (ha p hp hne.symm) + · exact hs.2 p hp q hq hne + +theorem RootInvariant.scan {s : Multiset (V × V)} (hs : RootInvariant L s) (w : Word V) : + RootInvariant L (rootScan L s w) := by + induction w generalizing s with + | nil => exact hs + | cons x w ih => exact ih (hs.insert x.1) + +theorem rootInvariant_word (w : Word V) : RootInvariant L (rootScan L 0 w) := + RootInvariant.scan ⟨by simp,by simp⟩ w + +variable (L) +def rootCounts (s : Multiset (V × V)) : V →₀ ℕ := + (s.map (fun p => Finsupp.single p.2 1)).sum + +def wordCounts (w : Word V) : V →₀ ℕ := rootCounts (rootScan L 0 w) + +def traceCounts : Trace L → V →₀ ℕ := + Quotient.lift (wordCounts L) (fun _ _ h => congrArg rootCounts (h.rootScan 0)) + +@[simp] theorem traceCounts_ofWord (w : Word V) : + traceCounts L (ofWord L w) = wordCounts L w := rfl + +omit [LinearOrder V] in +@[simp] theorem rootCounts_cons (p : V × V) (s : Multiset (V × V)) : + rootCounts (p ::ₘ s) = Finsupp.single p.2 1 + rootCounts s := by + simp [rootCounts] + +omit [LinearOrder V] in +@[simp] theorem rootCounts_zero : rootCounts (0 : Multiset (V × V)) = 0 := by + simp [rootCounts] + +theorem wordCounts_append_singleton (w : Word V) (x : Letter V) : + wordCounts L (w ++ [x]) = wordCounts L w + + Finsupp.single (nextRoot L (rootScan L 0 w) x.1) 1 := by + simp only [wordCounts,rootScan_append,rootScan_cons,rootScan_nil,rootInsert,rootCounts_cons] + exact add_comm _ _ + + +omit [LinearOrder V] in + theorem rootCounts_mem_iff (s : Multiset (V × V)) (r : V) : + rootCounts s r ≠ 0 ↔ ∃ p ∈ s, p.2 = r := by + classical + induction s using Multiset.induction_on with + | empty => simp + | cons p s ih => + by_cases hp : p.2 = r + · simp [rootCounts_cons,hp] + · simp [rootCounts_cons,hp,ih] + +omit [LinearOrder V] in + theorem rootCounts_support_clique {s : Multiset (V × V)} (hs : RootInvariant L s) : + ((rootCounts s).support : Set V).Pairwise L.Adj := by + intro r hr t ht hne + obtain ⟨p,hp,hpr⟩ := (rootCounts_mem_iff s r).mp (Finsupp.mem_support_iff.mp hr) + obtain ⟨q,hq,hqt⟩ := (rootCounts_mem_iff s t).mp (Finsupp.mem_support_iff.mp ht) + rw [← hpr,← hqt] at hne ⊢ + exact hs.2 p hp q hq hne + +theorem wordCounts_support_clique (w : Word V) : ((wordCounts L w).support : Set V).Pairwise L.Adj := + rootCounts_support_clique L (rootInvariant_word w) + +theorem traceCounts_support_clique (t : Trace L) : ((traceCounts L t).support : Set V).Pairwise L.Adj := by + induction t using Quotient.inductionOn with + | h w => exact wordCounts_support_clique L w + +omit [LinearOrder V] in + theorem rootCounts_sum [Fintype V] (s : Multiset (V × V)) : + ∑ v, rootCounts s v = s.card := by + classical + induction s using Multiset.induction_on with + | empty => simp + | cons p s ih => + simp [rootCounts_cons,Finset.sum_add_distrib,ih,Finsupp.single_apply,add_comm] + +theorem rootScan_card (s : Multiset (V × V)) (w : Word V) : + (rootScan L s w).card = s.card + w.length := by + induction w generalizing s with + | nil => simp + | cons x w ih => simp [rootScan_cons,ih,rootInsert,add_comm,add_left_comm] + +theorem wordCounts_sum [Fintype V] (w : Word V) : ∑ v, wordCounts L w v = w.length := by + rw [wordCounts,rootCounts_sum,rootScan_card] + simp + +theorem traceCounts_sum [Fintype V] (t : Trace L) : + ∑ v, traceCounts L t v = traceLength L t := by + induction t using Quotient.inductionOn with + | h w => exact wordCounts_sum L w + +theorem traceCounts_append_singleton (t : Trace L) (x : Letter V) : + ∃ r, traceCounts L (appendTrace L t (ofWord L [x])) = traceCounts L t + Finsupp.single r 1 := by + induction t using Quotient.inductionOn with + | h w => exact ⟨_,wordCounts_append_singleton L w x⟩ + +omit [LinearOrder V] in + theorem support_subset_singleton_add (c : V →₀ ℕ) (r : V) : + c.support ⊆ (c + Finsupp.single r 1).support := by + intro v hv + apply Finsupp.mem_support_iff.mpr + intro h + apply Finsupp.mem_support_iff.mp hv + exact (Nat.add_eq_zero_iff.mp (show c v + (Finsupp.single r 1) v = 0 from h)).1 + +theorem traceCounts_append_support (t : Trace L) (x : Letter V) : + (traceCounts L t).support ⊆ (traceCounts L (appendTrace L t (ofWord L [x]))).support := by + obtain ⟨r,hr⟩ := traceCounts_append_singleton L t x + rw [hr] + exact support_subset_singleton_add _ _ + +end RootCounts + +variable (L) + +/-- The normal trace of an element, obtained from the actual Artin presentation. -/ +def groupNormalTrace : WordGroup L → Trace L := + Quotient.lift (fun w : FreeMonoid (Letter V) => normalTrace L (ofWord L w.toList)) + (fun _ _ h => h) + +def artinNormalTrace (g : ArtinGroup L) : Trace L := groupNormalTrace L (ofArtin L g) + +@[simp] theorem artinNormalTrace_word (w : Word V) : + artinNormalTrace L (wordEval (artinGenerator L) w) = normalTrace L (ofWord L w) := by + simp only [artinNormalTrace,ofArtin_word] + rfl + +theorem artinNormalTrace_reduced (g : ArtinGroup L) : Reduced L (artinNormalTrace L g) := by + suffices ∀ h : WordGroup L, Reduced L (groupNormalTrace L h) from this _ + intro h + induction h using Con.induction_on with + | H w => exact normalTrace_reduced L (ofWord L w.toList) + +theorem artinNormalTrace_eval (g : ArtinGroup L) : + traceEval L (artinGenerator L) (fun _ _ h => adjacent_generators_commute L h) + (artinNormalTrace L g) = g := by + suffices ∀ h : WordGroup L, + traceEval L (artinGenerator L) (fun _ _ h => adjacent_generators_commute L h) + (groupNormalTrace L h) = toArtin L h by + simpa only [artinNormalTrace,toArtin_ofArtin] using this (ofArtin L g) + intro h + induction h using Con.induction_on with + | H w => + change traceEval L (artinGenerator L) _ (normalTrace L (ofWord L w.toList)) = + toArtin L (groupWord L w.toList) + rw [traceEval_normalTrace,traceEval_ofWord,toArtin_word] + +theorem exists_reduced_word (g : ArtinGroup L) : + ∃ w : Word V, Reduced L (ofWord L w) ∧ wordEval (artinGenerator L) w = g := by + obtain ⟨w,hw⟩ := Quotient.exists_rep (artinNormalTrace L g) + refine ⟨w,?_,?_⟩ + · rw [show ofWord L w = artinNormalTrace L g from hw] + exact artinNormalTrace_reduced L g + · change traceEval L (artinGenerator L) (fun _ _ h => adjacent_generators_commute L h) + (ofWord L w) = g + rw [show ofWord L w = artinNormalTrace L g from hw] + exact artinNormalTrace_eval L g + +/-- A right generator step in the actual presented group is addition/removal +of exactly one maximal occurrence in its reduced trace. -/ +theorem artinNormalTrace_right_step (g : ArtinGroup L) (x : Letter V) : + (artinNormalTrace L (g * letterValue (artinGenerator L) x) = + appendTrace L (artinNormalTrace L g) (ofWord L [x])) ∨ + (artinNormalTrace L g = appendTrace L + (artinNormalTrace L (g * letterValue (artinGenerator L) x)) (ofWord L [invLetter x])) := by + obtain ⟨w,hw,rfl⟩ := exists_reduced_word L g + have he : wordEval (artinGenerator L) w * letterValue (artinGenerator L) x = + wordEval (artinGenerator L) (w ++ [x]) := by simp + rw [he,artinNormalTrace_word,artinNormalTrace_word,hw.normalTrace_eq] + rcases reduced_append_alternative hw with hl | ⟨v,hv,he,hn⟩ + · left + exact hl.normalTrace_eq + · right + rw [hn] + exact (ofWord_eq L).mpr he + + +section DirectionVectors +variable [Fintype V] [LinearOrder V] + +/-- Barycentric direction, with value zero at the empty trace. -/ +def traceDirection (t : Trace L) (v : V) : ℝ := + (traceCounts L t v : ℝ) / (traceLength L t : ℝ) + +def artinDirection (g : ArtinGroup L) : V → ℝ := + traceDirection L (artinNormalTrace L g) + +omit [Fintype V] in +theorem traceDirection_nonneg (t : Trace L) (v : V) : 0 ≤ traceDirection L t v := + div_nonneg (Nat.cast_nonneg _) (Nat.cast_nonneg _) + +theorem traceDirection_sum {t : Trace L} (ht : 0 < traceLength L t) : + ∑ v, traceDirection L t v = 1 := by + simp only [traceDirection,← Finset.sum_div,← Nat.cast_sum,traceCounts_sum] + exact div_self (Nat.cast_ne_zero.mpr (Nat.ne_of_gt ht)) + +omit [Fintype V] [LinearOrder V] in +theorem traceLength_append_singleton (t : Trace L) (x : Letter V) : + traceLength L (appendTrace L t (ofWord L [x])) = traceLength L t + 1 := by + induction t using Quotient.inductionOn with + | h w => + change (w ++ [x]).length = w.length + 1 + simp + +/-- The exact finite-coordinate estimate used in the manuscript's direction map. -/ +theorem count_normalization_bound (c : V →₀ ℕ) (r : V) {n : ℕ} + (hn : 0 < n) (hs : ∑ v, c v = n) : + ∑ v, |((c + Finsupp.single r 1 : V →₀ ℕ) v : ℝ) / (n + 1 : ℝ) - + (c v : ℝ) / (n : ℝ)| ≤ 2 / (n + 1 : ℝ) := by + classical + have hn0 : (n : ℝ) ≠ 0 := Nat.cast_ne_zero.mpr (Nat.ne_of_gt hn) + have hd : 0 < (n + 1 : ℝ) := by positivity + have hi (v : V) : + ((c + Finsupp.single r 1 : V →₀ ℕ) v : ℝ) / (n + 1 : ℝ) - (c v : ℝ) / (n : ℝ) = + (((Finsupp.single r (1 : ℕ)) v : ℝ) - (c v : ℝ) / n) / (n + 1 : ℝ) := by + simp only [Finsupp.add_apply,Nat.cast_add] + field_simp [hn0,ne_of_gt hd] + ring + have hpoint (v : V) : + |((c + Finsupp.single r 1 : V →₀ ℕ) v : ℝ) / (n + 1 : ℝ) - (c v : ℝ) / (n : ℝ)| ≤ + (((Finsupp.single r (1 : ℕ)) v : ℝ) + (c v : ℝ) / n) / (n + 1 : ℝ) := by + rw [hi,abs_div,abs_of_pos hd] + apply div_le_div_of_nonneg_right _ hd.le + calc + _ ≤ |(((Finsupp.single r (1 : ℕ)) v : ℝ))| + |(c v : ℝ) / n| := + abs_sub _ _ + _ = _ := by rw [abs_of_nonneg (Nat.cast_nonneg _), + abs_of_nonneg (div_nonneg (Nat.cast_nonneg _) (Nat.cast_nonneg _))] + calc + _ ≤ ∑ v, (((Finsupp.single r (1 : ℕ)) v : ℝ) + (c v : ℝ) / n) / + (n + 1 : ℝ) := Finset.sum_le_sum (fun v _ => hpoint v) + _ = 2 / (n + 1 : ℝ) := by + rw [← Finset.sum_div,Finset.sum_add_distrib,← Finset.sum_div] + simp only [← Nat.cast_sum,hs] + norm_num [Finsupp.single_apply,div_self hn0] + +theorem traceDirection_append_bound (t : Trace L) (x : Letter V) + (ht : 0 < traceLength L t) : + ∑ v, |traceDirection L (appendTrace L t (ofWord L [x])) v - traceDirection L t v| ≤ + 2 / (traceLength L t + 1 : ℝ) := by + obtain ⟨r,hr⟩ := traceCounts_append_singleton L t x + simp only [traceDirection,traceLength_append_singleton,hr,Nat.cast_add,Nat.cast_one] + exact count_normalization_bound (traceCounts L t) r ht (traceCounts_sum L t) + +omit [Fintype V] in +theorem traceCounts_step_common_simplex (t : Trace L) (x : Letter V) : + (((traceCounts L t).support ∪ + (traceCounts L (appendTrace L t (ofWord L [x]))).support : Finset V) : Set V).Pairwise L.Adj := by + rw [Finset.union_eq_right.mpr (traceCounts_append_support L t x)] + exact traceCounts_support_clique L _ + +/-- Full trace-direction step, for the actual generators of the Artin presentation. +The shorter normal trace controls both the common simplex and the uniform l1 bound. -/ +theorem artinDirection_right_step (g : ArtinGroup L) (x : Letter V) + (hg : 0 < traceLength L (artinNormalTrace L g)) + (hgx : 0 < traceLength L (artinNormalTrace L + (g * letterValue (artinGenerator L) x))) : + let t := artinNormalTrace L g + let t' := artinNormalTrace L (g * letterValue (artinGenerator L) x) + (((traceCounts L t).support ∪ (traceCounts L t').support : Finset V) : Set V).Pairwise L.Adj ∧ + ∃ n : ℕ, 0 < n ∧ + ((traceLength L t = n ∧ traceLength L t' = n + 1) ∨ + (traceLength L t' = n ∧ traceLength L t = n + 1)) ∧ + ∑ v, |artinDirection L (g * letterValue (artinGenerator L) x) v - + artinDirection L g v| ≤ 2 / (n + 1 : ℝ) := by + dsimp only + rcases artinNormalTrace_right_step L g x with h | h + · rw [h] at hgx ⊢ + refine ⟨traceCounts_step_common_simplex L _ x, + traceLength L (artinNormalTrace L g),hg,Or.inl ⟨rfl,?_⟩,?_⟩ + · exact traceLength_append_singleton L _ x + · simpa only [artinDirection,h] using + traceDirection_append_bound L (artinNormalTrace L g) x hg + · rw [h] at hg ⊢ + refine ⟨?_,traceLength L (artinNormalTrace L + (g * letterValue (artinGenerator L) x)),hgx,Or.inr ⟨rfl,?_⟩,?_⟩ + · rw [Finset.union_comm] + exact traceCounts_step_common_simplex L _ _ + · exact traceLength_append_singleton L _ _ + · simpa only [artinDirection,h,abs_sub_comm] using + traceDirection_append_bound L + (artinNormalTrace L (g * letterValue (artinGenerator L) x)) (invLetter x) hgx + +end DirectionVectors + + +section CommutingPowerDirections +variable {L} + +theorem Extract.mem {x : Letter V} {w v : Word V} (h : Extract L x w v) : x ∈ w := by + induction h with + | head => simp + | cons _ _ ih => exact List.mem_cons_of_mem _ ih + +theorem same_sign_reduced {w : Word V} (b : Bool) (hw : ∀ x ∈ w, x.2 = b) : + Reduced L (ofWord L w) := by + intro t ht + obtain ⟨v,hv,_⟩ := ht.representative + suffices ∀ {w v : Word V}, Step L w v → (∀ x ∈ w, x.2 = b) → False from this hv hw + intro w v h + induction h with + | @head x w v he => + intro hh + have hx := hh x (by simp) + have hi := hh (invLetter x) (List.mem_cons_of_mem _ he.mem) + simp only [invLetter,hx] at hi + cases b <;> cases hi + | cons x h ih => + intro hh + exact ih (fun _ h => hh _ (List.mem_cons_of_mem _ h)) + +variable (L) +variable [LinearOrder V] + +theorem nextRoot_self {s : Multiset (V × V)} {v : V} + (hs : ∀ p ∈ s, p.2 = p.1) (hv : ∀ p ∈ s, p.1 = v ∨ L.Adj p.1 v) : + nextRoot L s v = v := by + classical + unfold nextRoot + split_ifs with h + · obtain ⟨p,hp,hdep,hroot⟩ := mem_predecessorRoots.mp (Finset.min'_mem _ h) + rw [← hroot,hs p hp] + exact (hv p hp).resolve_right hdep + · rfl + +theorem rootScan_clique {C : Set V} (hC : C.Pairwise L.Adj) + {s : Multiset (V × V)} (hs : ∀ p ∈ s, p.1 ∈ C ∧ p.2 = p.1) + {w : Word V} (hw : ∀ x ∈ w, x.1 ∈ C) : + rootScan L s w = ((w.map (fun x => (x.1,x.1))) : Multiset (V × V)) + s := by + classical + induction w generalizing s with + | nil => simp + | cons x w ih => + have hx : x.1 ∈ C := hw x (by simp) + have hr : nextRoot L s x.1 = x.1 := by + apply nextRoot_self L (fun p hp => (hs p hp).2) + intro p hp + by_cases hpv : p.1 = x.1 + · exact Or.inl hpv + · exact Or.inr (hC (hs p hp).1 hx hpv) + have hi : ∀ p ∈ rootInsert L s x.1, p.1 ∈ C ∧ p.2 = p.1 := by + intro p hp + simp only [rootInsert,hr,Multiset.mem_cons] at hp + rcases hp with rfl | hp + · exact ⟨hx,rfl⟩ + · exact hs p hp + rw [rootScan_cons,ih hi (fun y hy => hw y (List.mem_cons_of_mem _ hy))] + simp [rootInsert,hr,← Multiset.cons_coe,Multiset.add_cons] + +theorem wordCounts_clique {C : Set V} (hC : C.Pairwise L.Adj) + {w : Word V} (hw : ∀ x ∈ w, x.1 ∈ C) : + wordCounts L w = (w.map (fun x => Finsupp.single x.1 (1 : ℕ))).sum := by + rw [wordCounts,rootScan_clique L hC (by simp) hw] + simp only [add_zero,rootCounts,Multiset.map_coe,List.map_map,Multiset.sum_coe,Function.comp_def] + +theorem counts_negative_commuting_powers {q r : V} (hqr : L.Adj q r) (n m : ℕ) : + traceCounts L (artinNormalTrace L + ((artinGenerator L q)⁻¹ ^ n * (artinGenerator L r)⁻¹ ^ m)) = + Finsupp.single q n + Finsupp.single r m := by + classical + let w : Word V := List.replicate n (q,false) ++ List.replicate m (r,false) + have hn : ∀ x ∈ w, x.2 = false := by + intro x hx + simp only [w,List.mem_append,List.mem_replicate] at hx + rcases hx with ⟨_,rfl⟩ | ⟨_,rfl⟩ <;> rfl + have hC : ({q,r} : Set V).Pairwise L.Adj := by + intro a ha b hb hab + simp only [Set.mem_insert_iff,Set.mem_singleton_iff] at ha hb + rcases ha with rfl | rfl <;> rcases hb with rfl | rfl + · exact False.elim (hab rfl) + · exact hqr + · exact L.symm.symm _ _ hqr + · exact False.elim (hab rfl) + have hwc : ∀ x ∈ w, x.1 ∈ ({q,r} : Set V) := by + intro x hx + simp only [w,List.mem_append,List.mem_replicate] at hx + rcases hx with ⟨_,rfl⟩ | ⟨_,rfl⟩ <;> simp + have he : wordEval (artinGenerator L) w = + (artinGenerator L q)⁻¹ ^ n * (artinGenerator L r)⁻¹ ^ m := by + simp [wordEval,w,List.map_replicate] + rw [← he,artinNormalTrace_word,(same_sign_reduced false hn).normalTrace_eq, + traceCounts_ofWord,wordCounts_clique L hC hwc] + ext v + simp [w,List.map_replicate,Finsupp.single_apply] + +end CommutingPowerDirections + +section HeightAndExactDirections + +@[simp] theorem height_generator (v : V) : + height L (artinGenerator L v) = Multiplicative.ofAdd 1 := PresentedGroup.toGroup.of _ + +def wordHeight (w : Word V) : ℤ := (w.map fun x => if x.2 then 1 else -1).sum + +@[simp] theorem wordHeight_nil : wordHeight ([] : Word V) = 0 := rfl +@[simp] theorem wordHeight_cons (x : Letter V) (w : Word V) : + wordHeight (x :: w) = (if x.2 then 1 else -1) + wordHeight w := rfl + +theorem height_wordEval (w : Word V) : + (height L (wordEval (artinGenerator L) w)).toAdd = wordHeight w := by + induction w with + | nil => simp [wordEval] + | cons x w ih => + simp only [wordEval,List.map_cons,List.prod_cons,map_mul, + wordHeight_cons] at * + change (height L (letterValue (artinGenerator L) x)).toAdd + + (height L ((w.map (letterValue (artinGenerator L))).prod)).toAdd = _ + rw [ih] + congr 1 + cases x with + | mk v b => cases b <;> simp [letterValue] + +theorem wordHeight_abs_le (w : Word V) : |wordHeight w| ≤ (w.length : ℤ) := by + induction w with + | nil => simp + | cons x w ih => + rw [wordHeight_cons] + calc + _ ≤ |(if x.2 then 1 else -1 : ℤ)| + |wordHeight w| := abs_add_le _ _ + _ = 1 + |wordHeight w| := by cases x.2 <;> norm_num + _ ≤ ((x :: w).length : ℤ) := by simp only [List.length_cons,Nat.cast_add,Nat.cast_one]; omega + +theorem height_abs_le_traceLength (g : ArtinGroup L) : + |(height L g).toAdd| ≤ (traceLength L (artinNormalTrace L g) : ℤ) := by + obtain ⟨w,hw,rfl⟩ := exists_reduced_word L g + rw [height_wordEval,artinNormalTrace_word,hw.normalTrace_eq] + exact wordHeight_abs_le w + +theorem traceLength_pos_of_height_ne {g : ArtinGroup L} (h : (height L g).toAdd ≠ 0) : + 0 < traceLength L (artinNormalTrace L g) := by + have hh := height_abs_le_traceLength L g + have ha := abs_pos.mpr h + omega + +variable [Fintype V] [LinearOrder V] + +theorem length_negative_commuting_powers {q r : V} (hqr : L.Adj q r) (n m : ℕ) : + traceLength L (artinNormalTrace L + ((artinGenerator L q)⁻¹ ^ n * (artinGenerator L r)⁻¹ ^ m)) = n + m := by + rw [← traceCounts_sum,counts_negative_commuting_powers L hqr] + simp [Finsupp.single_apply,Finset.sum_add_distrib] + +theorem direction_negative_commuting_powers {q r : V} (hqr : L.Adj q r) + (n m : ℕ) (v : V) : + artinDirection L ((artinGenerator L q)⁻¹ ^ n * (artinGenerator L r)⁻¹ ^ m) v = + ((if q = v then n else 0 : ℕ) + (if r = v then m else 0 : ℕ) : ℝ) / (n + m : ℝ) := by + rw [artinDirection,traceDirection,counts_negative_commuting_powers L hqr, + length_negative_commuting_powers L hqr] + simp only [Finsupp.add_apply,Finsupp.single_apply,Nat.cast_add,Nat.cast_ite,Nat.cast_zero] + +end HeightAndExactDirections + +end TraceWords + +end EilenbergGanea + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Amenability/BarrierAlgorithm.lean b/lean/OAI/GroupTheory/SimpleAmenable/Amenability/BarrierAlgorithm.lean new file mode 100644 index 0000000000000000000000000000000000000000..d44b006d0430130ade05d972443ce4acf2f17eb3 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Amenability/BarrierAlgorithm.lean @@ -0,0 +1,161 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Amenability.BarrierLineGeometry + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section BarrierAlgorithm +open Classical Set + +noncomputable def barrierSitePoint {a m D : ℕ} {v : ℝ×ℝ} (z : FlagSite a m D v) : ℝ×ℝ := + z.val.2.val + +theorem flagSite_eq_of_track_point {a m D : ℕ} {v : ℝ×ℝ} + {z w : FlagSite a m D v} (ht : z.val.1=w.val.1) + (hp : barrierSitePoint z=barrierSitePoint w) : z=w := by + apply Subtype.ext + exact Prod.ext ht (Subtype.ext hp) + +noncomputable def barrierMarkedParameters {a m : ℕ} (ha : 0 z.val.1=i ∧ barrierSitePoint z∈squareInterior ∧ + cutForm a j (barrierSitePoint z)=ordinary c)).image + (fun z => barrierLineParameter j (barrierSitePoint z)) + +noncomputable def barrierSubdivision {a m : ℕ} (ha : 0 ConsecutiveSubdivision (barrierSubdivision ha i j c M) st.1 st.2 ∧ + barrierActivation ha i j c b st.1=true) + +theorem barrierActivation_at_site {a m : ℕ} (ha : 0 l.1) (fun l => l.2.val) + (sampledBarriers ha i N M b) := by + rintro p ⟨l,st,hst,t,ht,rfl⟩ + exact ⟨l,cutForm_barrierLinePoint a l.1 l.2.val t⟩ + +noncomputable def sampledPolygonPartition {a m : ℕ} (ha : 0 barrierLinePoint a j c t) + fin_cases j <;> simp only [barrierLinePoint] <;> fun_prop + +theorem sampledBarriers_closed {a m : ℕ} (ha : 0 if σ i then ⟨halfPlane a (j i) (c i),halfPlane_mem _ _ _⟩ + else (⟨halfPlane a (j i) (c i),halfPlane_mem _ _ _⟩ : polygonAlgebra a)ᶜ) + +theorem mem_arrangementAtom {ι : Type*} [Fintype ι] (a : ℕ) + (j : ι → Fin 4) (c : ι → CutRing) (σ : ι → Bool) (p : GenericSquare a) : + p∈(arrangementAtom a j c σ).val ↔ p.val∈strictLineCell a j (ordinary ∘ c) σ := by + rw [arrangementAtom,polygon_mem_finset_inf] + simp only [Finset.mem_univ,true_implies,strictLineCell,Set.mem_ofPred_eq,Function.comp_apply] + apply forall_congr' + intro i + cases σ i + · change (¬cutForm a (j i) p.val lt_of_le_of_ne (le_of_not_gt h) (p.property.2.2 (j i) (c i)).symm, + fun h => not_lt.mpr h.le⟩ + · rfl + +noncomputable def arrangementPattern {ι : Type*} (a : ℕ) + (j : ι → Fin 4) (c : ι → CutRing) (p : GenericSquare a) : ι → Bool := + fun i => decide (cutForm a (j i) p.val cutForm_smul a (j i) t p⟩ + simp only [strictLineCell,Set.ofPred_forall] + apply convex_iInter + intro i + cases σ i + · exact convex_halfSpace_gt (hlin i) (c i) + · exact convex_halfSpace_lt (hlin i) (c i) + +def squareInterior : Set (ℝ×ℝ) := Ioo 0 1 ×ˢ Ioo 0 1 + +theorem generic_mem_squareInterior {a : ℕ} (p : GenericSquare a) : p.val∈squareInterior := + ⟨⟨(generic_coordinates_pos p).1,p.property.1.2⟩, + ⟨(generic_coordinates_pos p).2,p.property.2.1.2⟩⟩ + +def barrierRegion (B : Set (ℝ×ℝ)) : Set (ℝ×ℝ) := squareInterior \ B + +def SupportedBarriers {ι : Type*} (a : ℕ) (j : ι → Fin 4) (c : ι → CutRing) + (B : Set (ℝ×ℝ)) : Prop := + ∀p∈B,∃i,cutForm a (j i) p=ordinary (c i) + +theorem generic_mem_barrierRegion {ι : Type*} {a : ℕ} {j : ι → Fin 4} + {c : ι → CutRing} {B : Set (ℝ×ℝ)} (hB : SupportedBarriers a j c B) + (p : GenericSquare a) : p.val∈barrierRegion B := by + refine ⟨generic_mem_squareInterior p,?_⟩ + intro hp + obtain ⟨i,hi⟩ := hB p.val hp + exact p.property.2.2 (j i) (c i) hi + +theorem arrangementAtom_same_component {ι : Type*} [Fintype ι] {a : ℕ} + {j : ι → Fin 4} {c : ι → CutRing} {B : Set (ℝ×ℝ)} + (hB : SupportedBarriers a j c B) (σ : ι → Bool) (p q : GenericSquare a) + (hp : p∈(arrangementAtom a j c σ).val) (hq : q∈(arrangementAtom a j c σ).val) : + q.val∈connectedComponentIn (barrierRegion B) p.val := by + let C := squareInterior ∩ strictLineCell a j (ordinary ∘ c) σ + have hC : Convex ℝ C := ((convex_Ioo (0:ℝ) 1).prod (convex_Ioo (0:ℝ) 1)).inter + (strictLineCell_convex a j (ordinary ∘ c) σ) + have hpC : p.val∈C := ⟨generic_mem_squareInterior p,(mem_arrangementAtom _ _ _ _ _).mp hp⟩ + have hqC : q.val∈C := ⟨generic_mem_squareInterior q,(mem_arrangementAtom _ _ _ _ _).mp hq⟩ + have hCB : C⊆barrierRegion B := by + intro x hx + refine ⟨hx.1,?_⟩ + intro hxB + obtain ⟨i,hi⟩ := hB x hxB + have hc := hx.2 i + cases hσ : σ i <;> simp only [hσ,Bool.false_eq_true,ite_false,ite_true,Function.comp_apply] at hc + · exact (ne_of_gt hc) hi + · exact (ne_of_lt hc) hi + exact hC.isPreconnected.subset_connectedComponentIn hpC hCB hqC + +noncomputable def barrierComponentCell {a : ℕ} (B : Set (ℝ×ℝ)) (x : ℝ×ℝ) : + Set (GenericSquare a) := {p | p.val∈connectedComponentIn (barrierRegion B) x} + +theorem barrierComponentCell_polygon {ι : Type*} [Fintype ι] {a : ℕ} + {j : ι → Fin 4} {c : ι → CutRing} {B : Set (ℝ×ℝ)} + (hB : SupportedBarriers a j c B) (x : ℝ×ℝ) : + barrierComponentCell (a:=a) B x∈polygonAlgebra a := by + let T := (Finset.univ : Finset (ι → Bool)).filter (fun σ => ∃p : GenericSquare a, + p∈(arrangementAtom a j c σ).val ∧ p∈barrierComponentCell B x) + let P : polygonAlgebra a := T.sup (arrangementAtom a j c) + have hmem (p : GenericSquare a) : p∈P.val ↔ ∃σ∈T,p∈(arrangementAtom a j c σ).val := by + dsimp [P] + induction T using Finset.induction_on with + | empty => simp + | @insert σ T hσ ih => + rw [Finset.sup_insert] + change (p∈(arrangementAtom a j c σ).val ∨ p∈(T.sup (arrangementAtom a j c)).val) ↔ _ + rw [ih] + simp only [Finset.mem_insert,exists_eq_or_imp] + have he : P.val=barrierComponentCell B x := by + ext p + rw [hmem] + constructor + · rintro ⟨σ,hσ,hp⟩ + obtain ⟨q,hq,hqx⟩ := (Finset.mem_filter.mp hσ).2 + have hqp := arrangementAtom_same_component hB σ q p hq hp + change p.val∈connectedComponentIn (barrierRegion B) x + rw [connectedComponentIn_eq hqx] + exact hqp + · intro hp + refine ⟨arrangementPattern a j c p,?_,mem_arrangementPattern a j c p⟩ + exact Finset.mem_filter.mpr ⟨Finset.mem_univ _,p,mem_arrangementPattern a j c p,hp⟩ + exact he ▸ P.property + +end BarrierCells + +section BarrierPartitions +open Classical Set + +structure FinitePolygonPartition (a : ℕ) where + cells : Finset (polygonAlgebra a) + nonempty : ∀C∈cells,C.val.Nonempty + cover : ∀p : GenericSquare a,∃! C,C∈cells ∧ p∈C.val + +noncomputable def barrierPolygonAt {ι : Type*} [Fintype ι] {a : ℕ} + {j : ι → Fin 4} {c : ι → CutRing} {B : Set (ℝ×ℝ)} + (hB : SupportedBarriers a j c B) (p : GenericSquare a) : polygonAlgebra a := + ⟨barrierComponentCell B p.val,barrierComponentCell_polygon hB p.val⟩ + +theorem barrierPolygonAt_eq_of_pattern {ι : Type*} [Fintype ι] {a : ℕ} + {j : ι → Fin 4} {c : ι → CutRing} {B : Set (ℝ×ℝ)} + (hB : SupportedBarriers a j c B) {p q : GenericSquare a} + (h : arrangementPattern a j c p=arrangementPattern a j c q) : + barrierPolygonAt hB p=barrierPolygonAt hB q := by + have hp := mem_arrangementPattern a j c p + rw [h] at hp + have hq := mem_arrangementPattern a j c q + have hh := connectedComponentIn_eq (arrangementAtom_same_component hB _ p q hp hq) + apply Subtype.ext + change {r : GenericSquare a | r.val∈connectedComponentIn (barrierRegion B) p.val}= + {r : GenericSquare a | r.val∈connectedComponentIn (barrierRegion B) q.val} + rw [hh] + +theorem barrierPolygonAt_finite_range {ι : Type*} [Fintype ι] {a : ℕ} + {j : ι → Fin 4} {c : ι → CutRing} {B : Set (ℝ×ℝ)} + (hB : SupportedBarriers a j c B) : (Set.range (barrierPolygonAt hB)).Finite := by + let f (σ : ι → Bool) : polygonAlgebra a := + if h : ∃p : GenericSquare a,arrangementPattern a j c p=σ then + barrierPolygonAt hB h.choose else ⊥ + apply (Set.finite_range f).subset + rintro C ⟨p,rfl⟩ + refine ⟨arrangementPattern a j c p,?_⟩ + have h : ∃q : GenericSquare a,arrangementPattern a j c q=arrangementPattern a j c p := ⟨p,rfl⟩ + simp only [f,dite_eq_left h] + exact barrierPolygonAt_eq_of_pattern hB h.choose_spec + +noncomputable def finiteBarrierPartition {ι : Type*} [Fintype ι] {a : ℕ} + {j : ι → Fin 4} {c : ι → CutRing} {B : Set (ℝ×ℝ)} + (hB : SupportedBarriers a j c B) : FinitePolygonPartition a where + cells := (barrierPolygonAt_finite_range hB).toFinset + nonempty := by + intro C hC + obtain ⟨p,rfl⟩ := (Set.Finite.mem_toFinset _).mp hC + exact ⟨p,mem_connectedComponentIn (generic_mem_barrierRegion hB p)⟩ + cover := by + intro p + refine ⟨barrierPolygonAt hB p,⟨?_,?_⟩,?_⟩ + · exact (Set.Finite.mem_toFinset _).mpr ⟨p,rfl⟩ + · exact mem_connectedComponentIn (generic_mem_barrierRegion hB p) + · intro C hC + obtain ⟨q,rfl⟩ := (Set.Finite.mem_toFinset _).mp hC.1 + apply Subtype.ext + change {r : GenericSquare a | r.val∈connectedComponentIn (barrierRegion B) q.val}= + {r : GenericSquare a | r.val∈connectedComponentIn (barrierRegion B) p.val} + rw [connectedComponentIn_eq hC.2] + +theorem mem_finiteBarrierPartition {ι : Type*} [Fintype ι] {a : ℕ} + {j : ι → Fin 4} {c : ι → CutRing} {B : Set (ℝ×ℝ)} + (hB : SupportedBarriers a j c B) (C : polygonAlgebra a) : + C∈(finiteBarrierPartition hB).cells ↔ ∃p : GenericSquare a, + C.val=barrierComponentCell B p.val := by + change C∈(barrierPolygonAt_finite_range hB).toFinset ↔ _ + rw [Set.Finite.mem_toFinset] + constructor + · rintro ⟨p,rfl⟩ + exact ⟨p,rfl⟩ + · rintro ⟨p,hp⟩ + exact ⟨p,Subtype.ext hp.symm⟩ + +end BarrierPartitions + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Amenability/BarrierChartRefinement.lean b/lean/OAI/GroupTheory/SimpleAmenable/Amenability/BarrierChartRefinement.lean new file mode 100644 index 0000000000000000000000000000000000000000..b36253a6297d1edb382e1f3e5b2304227b4f2e48 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Amenability/BarrierChartRefinement.lean @@ -0,0 +1,169 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Amenability.BarrierSignalSystem + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section BarrierChartRefinement +open Classical Set + +theorem barrierComponent_cut_sign {a : ℕ} {B : Set (ℝ×ℝ)} {j : Fin 4} {c : CutRing} + (hline : ∀x ∈ squareInterior,cutForm a j x=ordinary c → x ∈ B) + {p q : GenericSquare a} (hp : p.val ∈ barrierRegion B) + (hq : q.val ∈ connectedComponentIn (barrierRegion B) p.val) : + (cutForm a j p.val < ordinary c ↔ cutForm a j q.val < ordinary c) := by + have hpc := mem_connectedComponentIn hp + have no_cross (x y : ℝ×ℝ) + (hx : x ∈ connectedComponentIn (barrierRegion B) p.val) + (hy : y ∈ connectedComponentIn (barrierRegion B) p.val) + (hxc : cutForm a j x < ordinary c) (hyc : ordinary c ≤ cutForm a j y) : False := by + obtain ⟨z,hz,hzc⟩ := isPreconnected_connectedComponentIn.intermediate_value hx hy + (cutForm_continuous a j).continuousOn ⟨hxc.le,hyc⟩ + have hz' := connectedComponentIn_subset (barrierRegion B) p.val hz + exact hz'.2 (hline z hz'.1 hzc) + constructor + · intro h + by_contra hn + exact no_cross p.val q.val hpc hq h (le_of_not_gt hn) + · intro h + by_contra hn + exact no_cross q.val p.val hq hpc h (le_of_not_gt hn) + +namespace BarrierSignalSystem +variable {a : ℕ} {ha : 0 < a} {Q B : ℝ} (S : BarrierSignalSystem a ha Q B) + +theorem component_cut_sign {m : ℕ} (i : Fin m) {N : ℝ} (hN : 1 ≤ N) + (b₁ b₂ : ∀j,FlagSite a m (commonVertexDenominator a) (barrierFlagDirection ha j) → Bool) + (hs₁ : ∀j,signalSuccess (flagMeanSignal S.first.signal N) (b₁ j)) + (hs₂ : ∀j,signalSuccess (flagMeanSignal (S.second j).signal N) (b₂ j)) + {j : Fin 4} {c : CutRing} (hband : |conjugate c| ≤ N) + {p q : GenericSquare a} + (hq : q ∈ barrierComponentCell (sampledBarriers ha i N + (fun j => S.marks (N:=N) (lt_of_lt_of_le zero_lt_one hN) j (b₁ j)) b₂) p.val) : + squareSign (j,c) p=squareSign (j,c) q := by + apply decide_eq_decide.mpr + apply barrierComponent_cut_sign _ + (generic_mem_barrierRegion (sampledBarriers_supported ha i N _ b₂) p) hq + intro x hx hxc + have hc : c ∈ barrierCandidate a j N := ⟨by linarith, x,hx,hxc⟩ + exact S.central_line_barrier i hN b₁ b₂ hs₁ hs₂ hc hband x hx hxc + +theorem component_step_eventually {m : ℕ} (f : Fin m → GenericSquare a → Fin m × (CutRing×CutRing)) + (hf : ∀i,HasSquareArrangement (f i)) : + ∃N₀ : ℝ,∃hN₀ : 0 < N₀,∀N : ℝ,∀hN : N₀ ≤ N, ∀b₁ b₂ : + ∀j,FlagSite a m (commonVertexDenominator a) (barrierFlagDirection ha j) → Bool, + (∀j,signalSuccess (flagMeanSignal S.first.signal N) (b₁ j)) → + (∀j,signalSuccess (flagMeanSignal (S.second j).signal N) (b₂ j)) → + ∀i (p q : GenericSquare a), + q ∈ barrierComponentCell (sampledBarriers ha i N + (fun j => S.marks (N:=N) (lt_of_lt_of_le hN₀ hN) j (b₁ j)) b₂) p.val → f i p=f i q := by + choose T hT using hf + let C : ℝ := ∑i,∑l ∈ T i,|conjugate l.2| + have hC : 0 ≤ C := Finset.sum_nonneg (fun i _ => Finset.sum_nonneg (fun l _ => abs_nonneg _)) + refine ⟨C+1,by linarith,?_⟩ + intro N hN b₁ b₂ hs₁ hs₂ i p q hq + apply hT i p q + intro l hl + have hi : (∑l ∈ T i,|conjugate l.2|) ≤ C := + Finset.single_le_sum (f:=fun k => ∑l∈T k,|conjugate l.2|) (fun k _ => Finset.sum_nonneg (fun l _ => abs_nonneg _)) (Finset.mem_univ i) + have hl' : |conjugate l.2| ≤ C := (Finset.single_le_sum (fun l _ => abs_nonneg _) hl).trans hi + exact S.component_cut_sign i (by linarith) b₁ b₂ hs₁ hs₂ (by linarith : |conjugate l.2| ≤ N) hq + +theorem component_affine_eventually {m : ℕ} (g : polygonFullGroup a m) : + ∃N₀ : ℝ,∃hN₀ : 0 < N₀,∀N : ℝ,∀hN : N₀ ≤ N, ∀b₁ b₂ : + ∀j,FlagSite a m (commonVertexDenominator a) (barrierFlagDirection ha j) → Bool, + (∀j,signalSuccess (flagMeanSignal S.first.signal N) (b₁ j)) → + (∀j,signalSuccess (flagMeanSignal (S.second j).signal N) (b₂ j)) → + ∀i (p q : GenericSquare a), + q ∈ barrierComponentCell (sampledBarriers ha i N + (fun j => S.marks (N:=N) (lt_of_lt_of_le hN₀ hN) j (b₁ j)) b₂) p.val → + fullGroupAffineData g i p=fullGroupAffineData g i q := + S.component_step_eventually (fullGroupAffineData g) (fullGroupAffineData_arrangement g) + +end BarrierSignalSystem +end BarrierChartRefinement + +section BarrierCrossings +open Classical Set + +theorem barrierIntersection_lattice {a : ℕ} (ha : 0 < a) {i j : Fin 4} (hij : i ≠ j) + {c d : CutRing} {p : ℝ×ℝ} (hi : cutForm a i p=ordinary c) + (hj : cutForm a j p=ordinary d) : InFlagLattice (commonVertexDenominator a) p := by + obtain ⟨u,v,hu,hv⟩ := all_intersections_common_denominator ha i j hij c d p hi hj + have hD : (commonVertexDenominator a : ℝ) ≠ 0 := by + exact_mod_cast Nat.ne_of_gt (commonVertexDenominator_pos ha) + refine ⟨(u,v),?_⟩ + apply Prod.ext <;> simp only [scaledOrdinary,hu,hv] <;> field_simp + +noncomputable def barrierInteriorSite {a m : ℕ} (ha : 0 < a) (i : Fin m) (j : Fin 4) + {p : ℝ×ℝ} (hp : p ∈ squareInterior) + (hl : InFlagLattice (commonVertexDenominator a) p) : + FlagSite a m (commonVertexDenominator a) (barrierFlagDirection ha j) := + ⟨(i,⟨p,(barrierFlagDirection_spec ha j).1, + ⟨⟨hp.1.1.le,hp.1.2.le⟩,⟨hp.2.1.le,hp.2.2.le⟩, + fun h => (ne_of_gt hp.1.1 h).elim,fun h => (ne_of_lt hp.1.2 h).elim, + fun h => (ne_of_gt hp.2.1 h).elim,fun h => (ne_of_lt hp.2.2 h).elim⟩⟩),hl⟩ + +namespace BarrierSignalSystem +variable {a : ℕ} {ha : 0 < a} {Q B : ℝ} (S : BarrierSignalSystem a ha Q B) + +theorem crossing_in_subdivision {m : ℕ} (i : Fin m) {N : ℝ} (hN : 1 ≤ N) + {j k : Fin 4} (hjk : j ≠ k) {c d : CutRing} (hc : c ∈ barrierCandidate a j N) + (hcQ : |conjugate c| ≤ 4*N+Q) (hd : |conjugate d| ≤ B) + (b : FlagSite a m (commonVertexDenominator a) (barrierFlagDirection ha j) → Bool) + (hs : signalSuccess (flagMeanSignal S.first.signal N) b) + {t : ℝ} (ht : t ∈ Icc (barrierLineLower a j c) (barrierLineUpper a j c)) + (hk : cutForm a k (barrierLinePoint a j c t)=ordinary d) : + t ∈ barrierSubdivision ha i j c (S.marks (N:=N) (lt_of_lt_of_le zero_lt_one hN) j b) := by + by_cases hL : t=barrierLineLower a j c + · simp [barrierSubdivision,hL] + by_cases hU : t=barrierLineUpper a j c + · simp [barrierSubdivision,hU] + have ht' : t ∈ Ioo (barrierLineLower a j c) (barrierLineUpper a j c) := + ⟨lt_of_le_of_ne ht.1 (Ne.symm hL),lt_of_le_of_ne ht.2 hU⟩ + have hp := (barrierLinePoint_interior_iff hc t).mpr ht' + let z := barrierInteriorSite ha i j hp + (barrierIntersection_lattice ha hjk (cutForm_barrierLinePoint a j c t) hk) + have hzpoint : barrierSitePoint z=barrierLinePoint a j c t := rfl + have hzt : z.val.1=i := rfl + have hzline : cutForm a j (barrierSitePoint z)=ordinary c := cutForm_barrierLinePoint a j c t + have hzbit := S.intersection_first_true hN hjk hcQ hd z hzline hk b hs + have hzmem := (S.mem_marks_iff (lt_of_lt_of_le zero_lt_one hN) j b hs z).mpr hzbit + apply Finset.mem_union_right + apply Finset.mem_image.mpr + refine ⟨z,Finset.mem_filter.mpr ⟨hzmem,hzt,hp,hzline⟩,?_⟩ + exact barrierLineParameter_point a j c t + +end BarrierSignalSystem + +theorem barrierLineParameter_add (j : Fin 4) (p q : ℝ×ℝ) : + barrierLineParameter j (p+q)=barrierLineParameter j p+barrierLineParameter j q := by + fin_cases j <;> simp [barrierLineParameter] + +theorem barrierLinePoint_translate (a : ℕ) (j : Fin 4) (c : CutRing) + (u : CutRing×CutRing) (t : ℝ) : + barrierLinePoint a j (c+integralCutForm a j u) + (t+barrierLineParameter j (ordinary u.1,ordinary u.2))= + barrierLinePoint a j c t+(ordinary u.1,ordinary u.2) := by + have hp : cutForm a j (barrierLinePoint a j c t+(ordinary u.1,ordinary u.2)) = + ordinary (c+integralCutForm a j u) := by + rw [cutForm_add,cutForm_barrierLinePoint,cutForm_ordinary,map_add] + have hparam : barrierLineParameter j + (barrierLinePoint a j c t+(ordinary u.1,ordinary u.2)) = + t+barrierLineParameter j (ordinary u.1,ordinary u.2) := by + rw [barrierLineParameter_add,barrierLineParameter_point] + rw [←hparam] + exact barrierLinePoint_parameter hp + +end BarrierCrossings + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Amenability/BarrierCore.lean b/lean/OAI/GroupTheory/SimpleAmenable/Amenability/BarrierCore.lean new file mode 100644 index 0000000000000000000000000000000000000000..c5fd2fafec31292eb25a87ef3ed14603d68b1ad9 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Amenability/BarrierCore.lean @@ -0,0 +1,192 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Amenability.BarrierSignals +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.OrderedSubdivision + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section BarrierCore +open Classical + +theorem conjugateLineForm_site {a m D : ℕ} {v : ℝ×ℝ} (hD : 0 simp [scaledOrdinary,mul_div_cancel₀ _ hD'] + have hlevel : integralCutForm a j (flagSiteNumerator z)=(D:CutRing)*c := by + apply ordinary_injective + rw [←cutForm_ordinary,hpoint,cutForm_smul,hc,map_mul,map_natCast] + have hconj : flagSiteConjugate z=(D:ℝ)⁻¹ • + (conjugate (flagSiteNumerator z).1,conjugate (flagSiteNumerator z).2) := by + apply Prod.ext <;> simp [flagSiteConjugate,scaledConjugate,div_eq_mul_inv,mul_comm] + rw [hconj,map_smul,conjugateLineForm_integral,hlevel,map_mul,map_natCast] + simp [hD'] + +noncomputable def conjugateIntersectionCoefficient (a : ℕ) (i j : Fin 4) : ℝ := + (|conjugate (lineNormal a i).1|+|conjugate (lineNormal a i).2|+ + |conjugate (lineNormal a j).1|+|conjugate (lineNormal a j).2|)/|conjugate (lineDet a i j)| + +theorem conjugateIntersectionCoefficient_nonneg (a : ℕ) (i j : Fin 4) : + 0≤conjugateIntersectionCoefficient a i j := by unfold conjugateIntersectionCoefficient; positivity + +theorem conjugateLineForm_bound {a : ℕ} (ha : 0 Finset.sum_nonneg + (fun j _ => conjugateIntersectionCoefficient_nonneg a i j)) + have hCij (i j : Fin 4) : conjugateIntersectionCoefficient a i j≤C := by + apply (Finset.single_le_sum (fun k _ => conjugateIntersectionCoefficient_nonneg a i k) + (Finset.mem_univ j)).trans + exact Finset.single_le_sum (fun k _ => Finset.sum_nonneg + (fun l _ => conjugateIntersectionCoefficient_nonneg a k l)) (Finset.mem_univ i) + let A := 4+|Q|+|B| + have hA : 0 simp [scaledSiteConjugate,div_eq_mul_inv,mul_comm] + +theorem norm_scaledSiteConjugate {a m D : ℕ} {v : ℝ×ℝ} {N : ℝ} (hN : 0 linarith [hh.1,hh.2] + +noncomputable def finiteFirstMarks {a m D : ℕ} {v : ℝ×ℝ} (hD : 0 b z=true) + +theorem mem_finiteFirstMarks_iff {a m D : ℕ} {v : ℝ×ℝ} (hD : 0 ⟨firstSignal_true_in_box hN θ b hθ hs z hz,hz⟩⟩ + +theorem firstSignal_true_finite {a m D : ℕ} {v : ℝ×ℝ} (hD : 0 Finset.sum_nonneg (fun _ _ => abs_nonneg _)) + let Q : ℝ := ∑g ∈ F,∑i,C g i + have hQ : 0 ≤ Q := Finset.sum_nonneg (fun g _ => Finset.sum_nonneg (fun i _ => hC g i)) + have hshift (g : polygonFullGroup a m) (hg : g ∈ F) (i : Fin m) (p : GenericSquare a) (j : Fin 4) : + |conjugate (integralCutForm a j (fullGroupAffineData g i p).2)| ≤ Q := by + have hd : fullGroupAffineData g i p ∈ R g i := (Set.Finite.mem_toFinset _).mpr ⟨p,rfl⟩ + calc + _ ≤ ∑j : Fin 4,|conjugate (integralCutForm a j (fullGroupAffineData g i p).2)| := + Finset.single_le_sum (fun _ _ => abs_nonneg _) (Finset.mem_univ j) + _ ≤ C g i := by + dsimp [C] + exact Finset.single_le_sum (s := R g i) (f := fun d : Fin m × (CutRing × CutRing) => ∑j : Fin 4, |conjugate (integralCutForm a j d.2)|) (fun _ _ => Finset.sum_nonneg (fun _ _ => abs_nonneg _)) hd + _ ≤ ∑i,C g i := Finset.single_le_sum (fun i _ => hC g i) (Finset.mem_univ i) + _ ≤ Q := Finset.single_le_sum (fun g _ => Finset.sum_nonneg (fun i _ => hC g i)) hg + let D (g : polygonFullGroup a m) (i : Fin m) : ℝ := ∑l ∈ barrierChartCuts g i ∪ squareBoundaryCuts,|conjugate l.2| + have hD (g : polygonFullGroup a m) (i : Fin m) : 0 ≤ D g i := Finset.sum_nonneg (fun _ _ => abs_nonneg _) + let L : ℝ := ∑g ∈ F,∑i,D g i + have hL : 0 ≤ L := Finset.sum_nonneg (fun g _ => Finset.sum_nonneg (fun i _ => hD g i)) + have hlevel (g : polygonFullGroup a m) (hg : g ∈ F) (i : Fin m) + (l : PlaneCut) (hl : l ∈ barrierChartCuts g i ∪ squareBoundaryCuts) : |conjugate l.2| ≤ L := by + calc + _ ≤ D g i := Finset.single_le_sum (fun _ _ => abs_nonneg _) hl + _ ≤ ∑i,D g i := Finset.single_le_sum (fun i _ => hD g i) (Finset.mem_univ i) + _ ≤ L := Finset.single_le_sum (fun g _ => Finset.sum_nonneg (fun i _ => hD g i)) hg + refine ⟨Q,L+Q,hQ,add_nonneg hL hQ,?_⟩ + intro g hg i p + refine ⟨hshift g hg i p,?_⟩ + intro l hl + refine ⟨by linarith [hlevel g hg i l hl],?_⟩ + rw [map_add] + exact (abs_add_le _ _).trans (add_le_add (hlevel g hg i l hl) (hshift g hg i p l.1)) + +structure BarrierMenu (a m : ℕ) (ha : 0 < a) (F : Finset (polygonFullGroup a m)) where + Q : ℝ + B : ℝ + Q_nonneg : 0 ≤ Q + B_nonneg : 0 ≤ B + signals : BarrierSignalSystem a ha Q B + shift_bound : ∀g ∈ F,∀i (p : GenericSquare a),∀j, + |conjugate (integralCutForm a j (fullGroupAffineData g i p).2)| ≤ Q + chart_bound : ∀g ∈ F,∀i (p : GenericSquare a),∀l ∈ barrierChartCuts g i ∪ squareBoundaryCuts, + |conjugate l.2| ≤ B ∧ |conjugate (l.2+integralCutForm a l.1 (fullGroupAffineData g i p).2)| ≤ B + +theorem exists_barrierMenu {a m : ℕ} (ha : 0 < a) (F : Finset (polygonFullGroup a m)) : + Nonempty (BarrierMenu a m ha F) := by + obtain ⟨Q,B,hQ,hB,hall⟩ := barrier_uniform_constants F + obtain ⟨S⟩ := exists_barrierSignalSystem ha Q B + exact ⟨⟨Q,B,hQ,hB,S,fun g hg i p => (hall g hg i p).1,fun g hg i p => (hall g hg i p).2⟩⟩ + +end BarrierFiniteMenu + +section EightBarrierFields +open Classical MeasureTheory Filter Set +open scoped Topology + +noncomputable def barrierEightDirections {a : ℕ} (ha : 0 < a) : Fin (4+4) → ℝ×ℝ := + Fin.addCases (barrierFlagDirection ha) (barrierFlagDirection ha) + +noncomputable def BarrierSignalSystem.eight {a : ℕ} {ha : 0 < a} {Q B : ℝ} + (S : BarrierSignalSystem a ha Q B) : Fin (4+4) → FieldSignalData := + Fin.addCases (fun _ => S.first) S.second + +abbrev BarrierBits (a m : ℕ) (ha : 0 < a) := + ∀j : Fin (4+4),FlagSite a m (commonVertexDenominator a) (barrierEightDirections ha j) → Bool + +def castFlagBits {a m D : ℕ} {v w : ℝ×ℝ} (e : v=w) + (b : FlagSite a m D v → Bool) : FlagSite a m D w → Bool := fun z => b (e.symm ▸ z) + +theorem castFlagBits_success {a m D : ℕ} {v w : ℝ×ℝ} (e : v=w) + (b : FlagSite a m D v → Bool) (f : (ℝ×ℝ) → ℝ) (N : ℝ) + (h : signalSuccess (flagMeanSignal f N) b) : + signalSuccess (flagMeanSignal f N) (castFlagBits e b) := by cases e; exact h + +theorem castFlagBits_transport {a m D : ℕ} {v w : ℝ×ℝ} (e : v=w) (hD : 0 < D) + (b : FlagSite a m D v → Bool) (g : polygonFullGroup a m) (z : FlagSite a m D w) : + castFlagBits e (bitReindex (flagSitePermutation hD g) b) (flagSiteAction hD g z)=castFlagBits e b z := by + cases e + exact congrArg b ((flagSitePermutation hD g).symm_apply_apply z) + +noncomputable def barrierFirstBits {a m : ℕ} {ha : 0 < a} (b : BarrierBits a m ha) + (j : Fin 4) : FlagSite a m (commonVertexDenominator a) (barrierFlagDirection ha j) → Bool := + castFlagBits (Fin.addCases_left j) (b (j.castAdd 4)) + +noncomputable def barrierSecondBits {a m : ℕ} {ha : 0 < a} (b : BarrierBits a m ha) + (j : Fin 4) : FlagSite a m (commonVertexDenominator a) (barrierFlagDirection ha j) → Bool := + castFlagBits (Fin.addCases_right j) (b (j.natAdd 4)) + +namespace BarrierSignalSystem +variable {a : ℕ} {ha : 0 < a} {Q B : ℝ} (S : BarrierSignalSystem a ha Q B) + +theorem eight_q (j : Fin (4+4)) : (S.eight j).q = -3 := by + induction j using Fin.addCases with + | left j => simpa only [eight,Fin.addCases_left] using S.first_q + | right j => simpa only [eight,Fin.addCases_right] using S.second_q j + +theorem eight_success {m n : ℕ} {b : BarrierBits a m ha} + (h : jointFieldSuccess (barrierEightDirections ha) S.eight n b) : + (∀j,signalSuccess (flagMeanSignal S.first.signal (sourceDyadicN n)) (barrierFirstBits b j)) ∧ + (∀j,signalSuccess (flagMeanSignal (S.second j).signal (sourceDyadicN n)) (barrierSecondBits b j)) := by + constructor + · intro j + apply castFlagBits_success + simpa only [eight,Fin.addCases_left] using h (j.castAdd 4) + · intro j + apply castFlagBits_success + simpa only [eight,Fin.addCases_right] using h (j.natAdd 4) + +end BarrierSignalSystem + +noncomputable def barrierBitsTransport {a m : ℕ} {ha : 0 < a} (g : polygonFullGroup a m) + (b : BarrierBits a m ha) : BarrierBits a m ha := + jointBitReindex (barrierEightDirections ha) (commonVertexDenominator_pos ha) g b + +theorem barrierBitsTransport_first {a m : ℕ} {ha : 0 < a} (g : polygonFullGroup a m) + (b : BarrierBits a m ha) (j : Fin 4) (z) : + barrierFirstBits (barrierBitsTransport g b) j + (flagSiteAction (commonVertexDenominator_pos ha) g z)=barrierFirstBits b j z := by + exact castFlagBits_transport (Fin.addCases_left j) (commonVertexDenominator_pos ha) + (b (j.castAdd 4)) g z + +theorem barrierBitsTransport_second {a m : ℕ} {ha : 0 < a} (g : polygonFullGroup a m) + (b : BarrierBits a m ha) (j : Fin 4) (z) : + barrierSecondBits (barrierBitsTransport g b) j + (flagSiteAction (commonVertexDenominator_pos ha) g z)=barrierSecondBits b j z := by + exact castFlagBits_transport (Fin.addCases_right j) (commonVertexDenominator_pos ha) + (b (j.natAdd 4)) g z + +end EightBarrierFields + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Amenability/BarrierLineGeometry.lean b/lean/OAI/GroupTheory/SimpleAmenable/Amenability/BarrierLineGeometry.lean new file mode 100644 index 0000000000000000000000000000000000000000..dbb8f040c96f599bb99a19a0d9abfe143f4b1457 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Amenability/BarrierLineGeometry.lean @@ -0,0 +1,259 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Arithmetic.ConcurrentDenominators +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.FlagSites +import OAI.GroupTheory.SimpleAmenable.Arithmetic.QuadraticRectangleCounts +import OAI.GroupTheory.SimpleAmenable.Amenability.BarrierCells + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section BarrierLineGeometry +open Classical Set + +noncomputable def barrierLinePoint (a : ℕ) (j : Fin 4) (c : CutRing) (t : ℝ) : ℝ×ℝ := + ![(ordinary c,t),(t,ordinary c),(t,ordinary c+Real.goldenRatio^a*t), + (ordinary c+Real.goldenRatio^a*t,t)] j + +noncomputable def barrierLineParameter (j : Fin 4) (p : ℝ×ℝ) : ℝ := + ![p.2,p.1,p.1,p.2] j + +noncomputable def barrierLineLower (a : ℕ) (j : Fin 4) (c : CutRing) : ℝ := + ![0,0,max 0 (-ordinary c/Real.goldenRatio^a),max 0 (-ordinary c/Real.goldenRatio^a)] j + +noncomputable def barrierLineUpper (a : ℕ) (j : Fin 4) (c : CutRing) : ℝ := + ![1,1,min 1 ((1-ordinary c)/Real.goldenRatio^a),min 1 ((1-ordinary c)/Real.goldenRatio^a)] j + +theorem cutForm_barrierLinePoint (a : ℕ) (j : Fin 4) (c : CutRing) (t : ℝ) : + cutForm a j (barrierLinePoint a j c t)=ordinary c := by + fin_cases j <;> simp [cutForm,barrierLinePoint] + +theorem barrierLineParameter_point (a : ℕ) (j : Fin 4) (c : CutRing) (t : ℝ) : + barrierLineParameter j (barrierLinePoint a j c t)=t := by + fin_cases j <;> simp [barrierLineParameter,barrierLinePoint] + +theorem barrierLinePoint_parameter {a : ℕ} {j : Fin 4} {c : CutRing} {p : ℝ×ℝ} + (hp : cutForm a j p=ordinary c) : barrierLinePoint a j c (barrierLineParameter j p)=p := by + fin_cases j <;> simp [cutForm] at hp <;> + apply Prod.ext <;> simp [barrierLinePoint,barrierLineParameter] <;> linarith + +noncomputable def barrierCandidate (a : ℕ) (j : Fin 4) (N : ℝ) : Set CutRing := + {c | |conjugate c|≤4*N ∧ ∃p∈squareInterior,cutForm a j p=ordinary c} + +theorem squareInterior_cutForm_bound {a : ℕ} {p : ℝ×ℝ} (hp : p∈squareInterior) (j : Fin 4) : + |cutForm a j p|≤1+Real.goldenRatio^a := by + have ht : 0 simp [cutForm] <;> constructor <;> nlinarith + +theorem barrierCandidate_finite (a : ℕ) (j : Fin 4) {N : ℝ} (hN : 0 simp [barrierLinePoint,barrierLineLower,barrierLineUpper, + squareInterior,Set.mem_prod,Set.mem_Ioo] + · have hz := barrierCandidate_coordinate hc (Or.inl rfl) + exact fun _ _ => hz + · have hz := barrierCandidate_coordinate hc (Or.inr rfl) + exact fun _ _ => hz + · rw [div_lt_iff₀ ht,lt_div_iff₀ ht] + constructor <;> intro h <;> constructor <;> constructor <;> linarith [h.1.1,h.1.2,h.2.1,h.2.2] + · rw [div_lt_iff₀ ht,lt_div_iff₀ ht] + constructor <;> intro h <;> constructor <;> constructor <;> linarith [h.1.1,h.1.2,h.2.1,h.2.2] + +end BarrierLineGeometry + +section BarrierFlags +open Classical + +noncomputable def barrierTangent (a : ℕ) (j : Fin 4) : ℝ×ℝ := + ![(0,1),(1,0),(1,Real.goldenRatio^a),(Real.goldenRatio^a,1)] j + +theorem barrierLinePoint_sub (a : ℕ) (j : Fin 4) (c : CutRing) (s t : ℝ) : + barrierLinePoint a j c s-barrierLinePoint a j c t=(s-t) • barrierTangent a j := by + fin_cases j <;> apply Prod.ext <;> simp [barrierLinePoint,barrierTangent] <;> ring + +theorem barrierTangent_cut (a : ℕ) (j : Fin 4) : cutForm a j (barrierTangent a j)=0 := by + fin_cases j <;> simp [barrierTangent,cutForm] + +theorem positiveDiagonal_transverse {a : ℕ} (ha : 0 simp [cutForm] <;> linarith + +theorem exists_barrierFlagDirection {a : ℕ} (ha : 0 Or.inr (positiveDiagonal_transverse ha k)) + have ht : 0 norm_num [cutForm,barrierTangent,ne_of_gt ht,not_lt_of_gt ht] at hh ⊢ <;> exact hh + exact lt_of_le_of_ne (le_of_not_gt hnot) hn.symm + have hpos₂ : 0 norm_num [cutForm,barrierTangent,ne_of_gt ht,not_lt_of_gt ht] at hh ⊢ <;> exact hh + exact lt_of_le_of_ne (le_of_not_gt hnot) hn.symm + exact ⟨d,hd,hpos₁,hpos₂,he⟩ + +noncomputable def barrierFlagDirection {a : ℕ} (ha : 0 hd.2.1, + fun h => False.elim ((ne_of_lt hx.2) h),fun _ => hd.2.2.1, + fun h => False.elim ((ne_of_lt hy.2) h)⟩ + +theorem barrierIncoming_edge {a : ℕ} {j : Fin 4} {N : ℝ} {c : CutRing} + (hc : c∈barrierCandidate a j N) : ∃k : Fin 4,k≠j ∧ + cutForm a k (barrierIncoming a j c)=ordinary (0:CutRing) := by + obtain ⟨hx,hy,hzero⟩ := barrierIncoming_bounds hc + have hj := cutForm_barrierLinePoint a j c (barrierLineLower a j c) + change cutForm a j (barrierIncoming a j c)=ordinary c at hj + by_cases hj₀ : j=0 + · subst j + refine ⟨1,by decide,?_⟩ + have hcpos := (barrierCandidate_coordinate hc (Or.inl rfl)).1 + have hxne : (barrierIncoming a 0 c).1≠0 := by + simp [cutForm] at hj + rw [hj]; exact ne_of_gt hcpos + simpa [cutForm] using hzero.resolve_left hxne + · rcases hzero with hzero | hzero + · exact ⟨0,Ne.symm hj₀,by simpa [cutForm] using hzero⟩ + · refine ⟨1,?_,by simpa [cutForm] using hzero⟩ + intro he + subst j + have hcpos := (barrierCandidate_coordinate hc (Or.inr rfl)).1 + simp [cutForm] at hj + linarith + +theorem barrierIncoming_lattice {a : ℕ} (ha : 0 simp only [scaledOrdinary] + · rw [hu,mul_div_cancel_left₀ _ (by exact_mod_cast Nat.ne_of_gt (commonVertexDenominator_pos ha))] + · rw [hv,mul_div_cancel_left₀ _ (by exact_mod_cast Nat.ne_of_gt (commonVertexDenominator_pos ha))] + +noncomputable def barrierIncomingSite {a m : ℕ} (ha : 0 exists_secondBarrierSignal (conjugateLineForm a j) hR₁ + refine ⟨⟨R₀,R₁,hR₀,by dsimp [R₁]; linarith,first,second,hq,hsq,hp,hn,hsp,hsn,?_,?_⟩⟩ + · intro N hN i j hij c d hc hd p hi hj + exact (hcore N hN i j hij c d hc hd p hi hj).trans + (mul_le_mul_of_nonneg_right (by dsimp [R₀]; linarith) (by linarith)) + · intro m i N hN j c hc + exact (hin m i N hN j c hc).trans + (mul_le_mul_of_nonneg_right (by dsimp [R₀]; linarith) (by linarith)) + +namespace BarrierSignalSystem +variable {a : ℕ} {ha : 0 < a} {Q B : ℝ} (S : BarrierSignalSystem a ha Q B) + +theorem R₁_pos : 0 < S.R₁ := by linarith [S.R₀_pos,S.gap] + +theorem incoming_first_true {m : ℕ} (i : Fin m) {N : ℝ} (hN : 1 ≤ N) {j : Fin 4} + {c : CutRing} (hc : c ∈ barrierCandidate a j N) + (b : FlagSite a m (commonVertexDenominator a) (barrierFlagDirection ha j) → Bool) + (hs : signalSuccess (flagMeanSignal S.first.signal N) b) : b (barrierIncomingSite ha i hc)=true := by + apply (hs _).1 + rw [flagMeanSignal,S.first_pos] + · norm_num + · rw [norm_scaledSiteConjugate (by linarith : 0 < N),div_le_iff₀ (by linarith : 0 < N)] + exact S.incoming_core m i N hN j c hc + +noncomputable def marks {m : ℕ} {N : ℝ} (hN : 0 < N) (j : Fin 4) + (b : FlagSite a m (commonVertexDenominator a) (barrierFlagDirection ha j) → Bool) := + finiteFirstMarks (commonVertexDenominator_pos ha) hN S.R₁_pos b + +theorem mem_marks_iff {m : ℕ} {N : ℝ} (hN : 0 < N) (j : Fin 4) + (b : FlagSite a m (commonVertexDenominator a) (barrierFlagDirection ha j) → Bool) + (hs : signalSuccess (flagMeanSignal S.first.signal N) b) (z) : + z ∈ S.marks hN j b ↔ b z=true := + mem_finiteFirstMarks_iff (commonVertexDenominator_pos ha) hN S.R₁_pos S.first.signal b S.first_neg hs z + +theorem intersection_first_true {m : ℕ} {N : ℝ} (hN : 1 ≤ N) {i j : Fin 4} (hij : i ≠ j) + {c d : CutRing} (hc : |conjugate c| ≤ 4*N+Q) (hd : |conjugate d| ≤ B) + (z : FlagSite a m (commonVertexDenominator a) (barrierFlagDirection ha i)) + (hz : cutForm a i (barrierSitePoint z)=ordinary c) + (hzd : cutForm a j (barrierSitePoint z)=ordinary d) + (b : FlagSite a m (commonVertexDenominator a) (barrierFlagDirection ha i) → Bool) + (hs : signalSuccess (flagMeanSignal S.first.signal N) b) : b z=true := by + apply (hs z).1 + rw [flagMeanSignal,S.first_pos] + · norm_num + · rw [norm_scaledSiteConjugate (by linarith : 0 < N),div_le_iff₀ (by linarith : 0 < N)] + exact S.intersection_core N hN i j hij c d hc hd _ + (conjugateLineForm_site (commonVertexDenominator_pos ha) z i c hz) + (conjugateLineForm_site (commonVertexDenominator_pos ha) z j d hzd) + +theorem central_line_barrier {m : ℕ} (i : Fin m) {N : ℝ} (hN : 1 ≤ N) + (b₁ b₂ : ∀j,FlagSite a m (commonVertexDenominator a) (barrierFlagDirection ha j) → Bool) + (hs₁ : ∀j,signalSuccess (flagMeanSignal S.first.signal N) (b₁ j)) + (hs₂ : ∀j,signalSuccess (flagMeanSignal (S.second j).signal N) (b₂ j)) + {j : Fin 4} {c : CutRing} (hc : c ∈ barrierCandidate a j N) (hband : |conjugate c| ≤ N) : + ∀p ∈ squareInterior,cutForm a j p=ordinary c → + p ∈ sampledBarriers ha i N (fun j => S.marks (N:=N) (lt_of_lt_of_le zero_lt_one hN) j (b₁ j)) b₂ := by + have hN₀ : 0 < N := by linarith + apply sampledBarriers_contains_line ha i _ b₂ hc + intro z hzt hzline hzstart + have hzfirst : b₁ j z=true := by + rcases hzstart with hz | hz + · have he : z=barrierIncomingSite ha i hc := + flagSite_eq_of_track_point hzt hz + rw [he] + exact S.incoming_first_true i hN hc (b₁ j) (hs₁ j) + · exact (S.mem_marks_iff hN₀ j (b₁ j) (hs₁ j) z).mp hz + apply (hs₂ j z).1 + rw [flagMeanSignal,S.second_pos] + · norm_num + · exact (firstSignal_true_norm S.first.signal (b₁ j) S.first_neg (hs₁ j) z hzfirst).le + · rw [conjugateLineForm_scaledSite (commonVertexDenominator_pos ha) z j c N hzline, + abs_div,abs_of_pos hN₀,div_le_one hN₀] + exact hband + +end BarrierSignalSystem +end BarrierSignalSystem + +section SubdivisionCovariance +open Classical Set + +def subdivisionBarrier (E : Finset ℝ) (b : ℝ → Bool) : Set ℝ := + {x | ∃s t,ConsecutiveSubdivision E s t ∧ b s=true ∧ x ∈ Icc s t} + +theorem consecutiveSubdivision_local {E : Finset ℝ} {L U x s t : ℝ} + (hL : L ∈ E) (hU : U ∈ E) (hx : x ∈ Ioo L U) + (hst : ConsecutiveSubdivision E s t) (hxi : x ∈ Icc s t) : L ≤ s ∧ t ≤ U := by + constructor + · by_contra h + have hh := hst.2.2.2 L hL (lt_of_not_ge h) + have hlx := hx.1 + have hxt := hxi.2 + linarith + · exact hst.2.2.2 U hU (lt_of_le_of_lt hxi.1 hx.2) + +theorem consecutiveSubdivision_translate {E F : Finset ℝ} {L U s t d : ℝ} + (hE : ∀r ∈ Icc L U,r ∈ E ↔ r+d ∈ F) (hs : L ≤ s) (ht : t ≤ U) + (hst : ConsecutiveSubdivision E s t) : ConsecutiveSubdivision F (s+d) (t+d) := by + have hsU : s ≤ U := hst.2.2.1.le.trans ht + have hLt : L ≤ t := hs.trans hst.2.2.1.le + refine ⟨(hE s ⟨hs,hsU⟩).mp hst.1,(hE t ⟨hLt,ht⟩).mp hst.2.1, + by linarith [hst.2.2.1],?_⟩ + intro r hr hsr + by_contra htr + have hrU : r-d ≤ U := by linarith + have hLr : L ≤ r-d := by linarith + have hrE : r-d ∈ E := (hE (r-d) ⟨hLr,hrU⟩).mpr (by simpa using hr) + have hh := hst.2.2.2 (r-d) hrE (by linarith) + linarith + +theorem subdivisionBarrier_translate_iff {E F : Finset ℝ} {b c : ℝ → Bool} + {L U d : ℝ} (hL : L ∈ E) (hU : U ∈ E) + (hFL : L+d ∈ F) (hFU : U+d ∈ F) + (hE : ∀r ∈ Icc L U,r ∈ E ↔ r+d ∈ F) + (hb : ∀r ∈ E,r ∈ Ico L U → b r=c (r+d)) {x : ℝ} (hx : x ∈ Ioo L U) : + x ∈ subdivisionBarrier E b ↔ x+d ∈ subdivisionBarrier F c := by + constructor + · rintro ⟨s,t,hst,hbs,hxi⟩ + obtain ⟨hs,ht⟩ := consecutiveSubdivision_local hL hU hx hst hxi + refine ⟨s+d,t+d,consecutiveSubdivision_translate hE hs ht hst,?_,?_⟩ + · rw [←hb s hst.1 ⟨hs,lt_of_lt_of_le hst.2.2.1 ht⟩] + exact hbs + · exact ⟨by linarith [hxi.1],by linarith [hxi.2]⟩ + · rintro ⟨s,t,hst,hcs,hxi⟩ + have hx' : x+d ∈ Ioo (L+d) (U+d) := ⟨by linarith [hx.1],by linarith [hx.2]⟩ + obtain ⟨hs,ht⟩ := consecutiveSubdivision_local hFL hFU hx' hst hxi + have hFinv : ∀r ∈ Icc (L+d) (U+d),r ∈ F ↔ r+(-d) ∈ E := by + intro r hr + have hr' : r-d ∈ Icc L U := ⟨by linarith [hr.1],by linarith [hr.2]⟩ + simpa [sub_eq_add_neg,add_assoc] using (hE (r-d) hr').symm + have hst' := consecutiveSubdivision_translate hFinv hs ht hst + refine ⟨s+(-d),t+(-d),hst',?_,?_⟩ + · rw [hb _ hst'.1 ⟨by linarith,by linarith [hst.2.2.1]⟩] + simpa using hcs + · exact ⟨by linarith [hxi.1],by linarith [hxi.2]⟩ + +theorem mem_barrierActiveIntervals_image_iff {a m : ℕ} (ha : 0 < a) (i : Fin m) + (j : Fin 4) (c : CutRing) + (M : Finset (FlagSite a m (commonVertexDenominator a) (barrierFlagDirection ha j))) + (b : FlagSite a m (commonVertexDenominator a) (barrierFlagDirection ha j) → Bool) (x : ℝ) : + (∃st ∈ barrierActiveIntervals ha i j c M b,x ∈ Icc st.1 st.2) ↔ + x ∈ subdivisionBarrier (barrierSubdivision ha i j c M) (barrierActivation ha i j c b) := by + constructor + · rintro ⟨⟨s,t⟩,hst,hx⟩ + have hh := (Finset.mem_filter.mp hst).2 + exact ⟨s,t,hh.1,hh.2,hx⟩ + · rintro ⟨s,t,hst,hb,hx⟩ + exact ⟨(s,t),Finset.mem_filter.mpr ⟨Finset.mem_product.mpr ⟨hst.1,hst.2.1⟩,hst,hb⟩,hx⟩ + +end SubdivisionCovariance + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Amenability/BarrierSignals.lean b/lean/OAI/GroupTheory/SimpleAmenable/Amenability/BarrierSignals.lean new file mode 100644 index 0000000000000000000000000000000000000000..5877f8c673225c7de4c016f914e60abb30406fa1 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Amenability/BarrierSignals.lean @@ -0,0 +1,67 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.RandomFields.FieldSignalData + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section BarrierSignals +open Classical Set +open scoped ContDiff + +theorem exists_firstBarrierSignal {R₀ R₁ : ℝ} (hR₀ : 0 6*b x + have hs : ContDiff ℝ 2 ψ := contDiff_const.mul b.contDiff + have hc : HasCompactSupport ψ := b.hasCompactSupport.mul_left + obtain ⟨S,hψ,hq⟩ := exists_fieldSignalData ψ hs hc (-3) + refine ⟨S,hq,?_,?_⟩ + · intro x hx + have hb : b x=1 := b.one_of_mem_closedBall (by simpa only [Metric.mem_closedBall,dist_zero_right,b] using hx) + simp only [FieldSignalData.signal,hq,hψ,ψ,hb] + norm_num + · intro x hx + have hb : b x=0 := b.zero_of_le_dist (by simpa only [dist_zero_right,b] using hx) + simp only [FieldSignalData.signal,hq,hψ,ψ,hb,mul_zero,add_zero] + +theorem exists_secondBarrierSignal (ℓ : (ℝ×ℝ) →L[ℝ] ℝ) {R₁ : ℝ} (hR₁ : 0 6*α (ℓ x)*β x + have hs : ContDiff ℝ 2 ψ := (contDiff_const.mul (α.contDiff.comp ℓ.contDiff)).mul β.contDiff + have hc : HasCompactSupport ψ := β.hasCompactSupport.mul_left + obtain ⟨S,hψ,hq⟩ := exists_fieldSignalData ψ hs hc (-3) + refine ⟨S,hq,?_,?_⟩ + · intro x hx hℓ + have hα : α (ℓ x)=1 := α.one_of_mem_closedBall (by simpa only [Metric.mem_closedBall,dist_zero_right,Real.norm_eq_abs,α] using hℓ) + have hβ : β x=1 := β.one_of_mem_closedBall (by simpa only [Metric.mem_closedBall,dist_zero_right,β] using hx) + simp only [FieldSignalData.signal,hq,hψ,ψ,hα,hβ] + norm_num + · intro x hx + have hα : α (ℓ x)=0 := α.zero_of_le_dist (by simpa only [dist_zero_right,Real.norm_eq_abs,α] using hx) + simp only [FieldSignalData.signal,hq,hψ,ψ,hα,mul_zero,zero_mul,add_zero] + +noncomputable def conjugateLineForm (a : ℕ) (j : Fin 4) : (ℝ×ℝ) →L[ℝ] ℝ := + conjugate (lineNormal a j).1 • ContinuousLinearMap.fst ℝ ℝ ℝ + + conjugate (lineNormal a j).2 • ContinuousLinearMap.snd ℝ ℝ ℝ + +theorem conjugateLineForm_integral (a : ℕ) (j : Fin 4) (u : CutRing×CutRing) : + conjugateLineForm a j (conjugate u.1,conjugate u.2)=conjugate (integralCutForm a j u) := by + fin_cases j <;> simp [conjugateLineForm,lineNormal,integralCutForm] <;> ring + +end BarrierSignals + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Amenability/BarrierStartGerm.lean b/lean/OAI/GroupTheory/SimpleAmenable/Amenability/BarrierStartGerm.lean new file mode 100644 index 0000000000000000000000000000000000000000..e1eba1c0a029d3a9b66c29343de46ad7ef858c52 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Amenability/BarrierStartGerm.lean @@ -0,0 +1,118 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.FullGroupAffineData +import OAI.GroupTheory.SimpleAmenable.Amenability.BarrierAlgorithm + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section BarrierStartGerm +open Classical Set + +theorem continuous_nonzero_sign {X : Type*} [TopologicalSpace X] {C : Set X} + (hC : IsPreconnected C) {f : X → ℝ} (hf : ContinuousOn f C) + (hn : ∀x ∈ C,f x ≠ 0) {x y : X} (hx : x ∈ C) (hy : y ∈ C) : + f x < 0 ↔ f y < 0 := by + have h (u v : X) (hu : u ∈ C) (hv : v ∈ C) (hu' : f u < 0) : f v < 0 := by + by_contra hh + obtain ⟨z,hz,hz0⟩ := hC.intermediate_value hu hv hf ⟨hu'.le,le_of_not_gt hh⟩ + exact hn z hz hz0 + exact ⟨h x y hx hy,h y x hy hx⟩ + +theorem barrier_cut_difference (a : ℕ) (j k : Fin 4) (c : CutRing) (s t : ℝ) : + cutForm a k (barrierLinePoint a j c t)=cutForm a k (barrierLinePoint a j c s)+ + (t-s)*cutForm a k (barrierTangent a j) := by + have hh := barrierLinePoint_sub a j c t s + have hp : barrierLinePoint a j c t=barrierLinePoint a j c s+(t-s) • barrierTangent a j := by + exact (sub_eq_iff_eq_add.mp hh).trans (add_comm _ _) + rw [hp,cutForm_add,cutForm_smul] + +theorem barrier_start_cut_sign {a : ℕ} (ha : 0 < a) (j k : Fin 4) (c d : CutRing) + {L U s x : ℝ} (hs : s ∈ Ico L U) (hx : x ∈ Ioo L U) + (hn : ∀r ∈ Ioo L U,cutForm a k (barrierLinePoint a j c r) ≠ ordinary d) : + (if cutForm a k (barrierLinePoint a j c s)=ordinary d then + cutForm a k (barrierFlagDirection ha j) < 0 else + cutForm a k (barrierLinePoint a j c s) < ordinary d) ↔ + cutForm a k (barrierLinePoint a j c x) < ordinary d := by + let t := (s+U)/2 + have hst : s < t := by dsimp [t]; linarith [hs.2] + have ht : t ∈ Ioo L U := by dsimp [t]; constructor <;> linarith [hs.1,hs.2] + let f := fun r => cutForm a k (barrierLinePoint a j c r)-ordinary d + have hf : Continuous f := ((cutForm_continuous a k).comp (barrierLinePoint_continuous a j c)).sub continuous_const + have hnon : ∀r ∈ Ioo L U,f r ≠ 0 := fun r hr => sub_ne_zero.mpr (hn r hr) + have htx : f t < 0 ↔ f x < 0 := continuous_nonzero_sign isPreconnected_Ioo hf.continuousOn hnon ht hx + have hdif := barrier_cut_difference a j k c s t + by_cases he : cutForm a k (barrierLinePoint a j c s)=ordinary d + · have hB : cutForm a k (barrierTangent a j) ≠ 0 := by + intro hh + apply hn t ht + rw [he,hh,mul_zero,add_zero] at hdif + exact hdif + have hflag := (barrierFlagDirection_spec ha j).2.2.2 k + rw [ite_eq_right hB] at hflag + rw [ite_eq_left he,hflag] + have heq : f t=(t-s)*cutForm a k (barrierTangent a j) := by dsimp [f]; linarith + have hsign : f t < 0 ↔ cutForm a k (barrierTangent a j) < 0 := by + rw [heq,mul_neg_iff] + have hts : 0 < t-s := sub_pos.mpr hst + simp [hts,not_lt_of_gt hts] + exact (hsign.symm.trans htx).trans (sub_lt_zero (a:=cutForm a k (barrierLinePoint a j c x)) (b:=ordinary d)) + · rw [ite_eq_right he] + have hseg : ∀r ∈ Icc s t,f r ≠ 0 := by + intro r hr + by_cases hrs : r=s + · subst r + exact sub_ne_zero.mpr he + · exact hnon r ⟨lt_of_le_of_lt hs.1 (lt_of_le_of_ne hr.1 (Ne.symm hrs)),hr.2.trans_lt ht.2⟩ + have hsign := continuous_nonzero_sign isPreconnected_Icc hf.continuousOn hseg + (left_mem_Icc.mpr hst.le) (right_mem_Icc.mpr hst.le) + simpa only [f,sub_lt_zero] using hsign.trans htx + +theorem flagValue_of_arrangement_signs {a : ℕ} {v : ℝ×ℝ} {K : Type*} + (f : GenericSquare a → K) (T : Finset PlaneCut) + (hT : ∀p q,(∀l ∈ T,squareSign l p=squareSign l q) → f p=f q) + (z : SquareFlag a v) (p : GenericSquare a) + (hs : ∀l ∈ T,(if cutForm a l.1 z.val=ordinary l.2 then cutForm a l.1 v < 0 + else cutForm a l.1 z.val < ordinary l.2) ↔ cutForm a l.1 p.val < ordinary l.2) : + flagValue f ⟨T,hT⟩ z=f p := by + apply flagValue_eq + refine ⟨arrangementNeighborhood a T z.val,arrangementNeighborhood_open a T z.val, + self_mem_arrangementNeighborhood a T z.val,?_⟩ + intro q hq hqv + apply hT q p + intro l hl + have hh := planeSign_neighborhood (p:=⟨q.val,q.property.2.2⟩) hq hqv hl + change squareSign l q=_ at hh + rw [hh] + exact decide_eq_decide.mpr (hs l hl) + +theorem flagAffineData_barrier_chart {a m : ℕ} (ha : 0 < a) (g : polygonFullGroup a m) + (i : Fin m) (j : Fin 4) (c : CutRing) (T : Finset PlaneCut) + (hT : ∀p q,(∀l ∈ T,squareSign l p=squareSign l q) → + fullGroupAffineData g i p=fullGroupAffineData g i q) + (p : GenericSquare a) {L U s : ℝ} (hLU : L < U) (hs : s ∈ Ico L U) + (hchart : ∀l ∈ T,∀r ∈ Ioo L U, + cutForm a l.1 (barrierLinePoint a j c r) ≠ ordinary l.2 ∧ + (cutForm a l.1 (barrierLinePoint a j c r) < ordinary l.2 ↔ + cutForm a l.1 p.val < ordinary l.2)) + (z : SquareFlag a (barrierFlagDirection ha j)) (hz : z.val=barrierLinePoint a j c s) : + flagAffineData g i z=fullGroupAffineData g i p := by + let x := (L+U)/2 + have hx : x ∈ Ioo L U := by dsimp [x]; constructor <;> linarith + apply flagValue_of_arrangement_signs (fullGroupAffineData g i) T hT z p + intro l hl + rw [hz] + exact (barrier_start_cut_sign ha j l.1 c l.2 hs hx + (fun r hr => (hchart l hl r hr).1)).trans (hchart l hl x hx).2 + +end BarrierStartGerm + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Amenability/ChartLineTransport.lean b/lean/OAI/GroupTheory/SimpleAmenable/Amenability/ChartLineTransport.lean new file mode 100644 index 0000000000000000000000000000000000000000..ee8e86d616268a442e7d3633eb3b928727bf0d2a --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Amenability/ChartLineTransport.lean @@ -0,0 +1,190 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Amenability.BarrierChartRefinement +import OAI.GroupTheory.SimpleAmenable.Amenability.LocalBarrierTransport +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.ChartBoundaryEndpoints + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section ChartLineTransport +open Classical Set +namespace BarrierSignalSystem +variable {a : ℕ} {ha : 0 < a} {Q B : ℝ} (S : BarrierSignalSystem a ha Q B) + +theorem chart_line_transport {m : ℕ} (g : polygonFullGroup a m) (i k : Fin m) + (T : Finset PlaneCut) + (hT : ∀p q,(∀l ∈ T,squareSign l p=squareSign l q) → + fullGroupAffineData g i p=fullGroupAffineData g i q) (p : GenericSquare a) + (u : CutRing×CutRing) (hdata : fullGroupAffineData g i p=(k,u)) + (hQ : 0 ≤ Q) + (hB : ∀l ∈ T ∪ squareBoundaryCuts,|conjugate l.2| ≤ B ∧ + |conjugate (l.2+integralCutForm a l.1 u)| ≤ B) + {N : ℝ} (hN : 1 ≤ N) (j : Fin 4) (c : CutRing) + (hc : c ∈ barrierCandidate a j N) + (hc' : c+integralCutForm a j u ∈ barrierCandidate a j N) + (b₁ b₂ b₁' b₂' : FlagSite a m (commonVertexDenominator a) (barrierFlagDirection ha j) → Bool) + (hs : signalSuccess (flagMeanSignal S.first.signal N) b₁) + (hs' : signalSuccess (flagMeanSignal S.first.signal N) b₁') + (hb₁ : ∀z,b₁' (flagSiteAction (commonVertexDenominator_pos ha) g z)=b₁ z) + (hb₂ : ∀z,b₂' (flagSiteAction (commonVertexDenominator_pos ha) g z)=b₂ z) + {x : ℝ} (hx : barrierLinePoint a j c x ∈ openSquareChart T p) : + x ∈ subdivisionBarrier (barrierSubdivision ha i j c + (S.marks (N:=N) (lt_of_lt_of_le zero_lt_one hN) j b₁)) (barrierActivation ha i j c b₂) ↔ + x+barrierLineParameter j (ordinary u.1,ordinary u.2) ∈ + subdivisionBarrier (barrierSubdivision ha k j (c+integralCutForm a j u) + (S.marks (N:=N) (lt_of_lt_of_le zero_lt_one hN) j b₁')) + (barrierActivation ha k j (c+integralCutForm a j u) b₂') := by + let d := barrierLineParameter j (ordinary u.1,ordinary u.2) + obtain ⟨L,U,hxLU,hL,hU,hchart,hend⟩ := chart_line_endpoints_forced T p hc hx + have hLU : L < U := hxLU.1.trans hxLU.2 + have htrans : ∀r ∈ Ioo L U,barrierLinePoint a j (c+integralCutForm a j u) (r+d) ∈ squareInterior := by + intro r hr + rw [barrierLinePoint_translate] + have hh := fullGroupAffineChart_square g i T hT p + rw [hdata] at hh + exact hh ⟨barrierLinePoint a j c r,hchart r hr,rfl⟩ + have hbounds := interval_endpoints_closed (continuous_id.add continuous_const) + isClosed_Icc hLU (fun r hr => let hp := (barrierLinePoint_interior_iff hc' (r+d)).mp (htrans r hr) + show r+d ∈ Icc (barrierLineLower a j (c+integralCutForm a j u)) + (barrierLineUpper a j (c+integralCutForm a j u)) from ⟨hp.1.le,hp.2.le⟩) + have hsource (r : ℝ) (hr : r ∈ ({L,U} : Finset ℝ)) + (hrb : r ∈ Icc (barrierLineLower a j c) (barrierLineUpper a j c)) : + r ∈ barrierSubdivision ha i j c (S.marks (N:=N) (lt_of_lt_of_le zero_lt_one hN) j b₁) := by + obtain ⟨l,hl,hjl,hzero⟩ := hend r hr + exact S.crossing_in_subdivision i hN hjl hc (by linarith [hc.1]) (hB l hl).1 b₁ hs hrb hzero + have htarget (r : ℝ) (hr : r ∈ ({L,U} : Finset ℝ)) + (hrb : r+d ∈ Icc (barrierLineLower a j (c+integralCutForm a j u)) + (barrierLineUpper a j (c+integralCutForm a j u))) : + r+d ∈ barrierSubdivision ha k j (c+integralCutForm a j u) + (S.marks (N:=N) (lt_of_lt_of_le zero_lt_one hN) j b₁') := by + obtain ⟨l,hl,hjl,hzero⟩ := hend r hr + apply S.crossing_in_subdivision k hN hjl hc' (by linarith [hc'.1]) (hB l hl).2 b₁' hs' hrb + rw [barrierLinePoint_translate,cutForm_add,hzero,cutForm_ordinary,map_add] + apply S.local_line_transport g i k (lt_of_lt_of_le zero_lt_one hN) j c u hc hc' b₁ b₂ b₁' b₂' + hs hs' hb₁ hb₂ L U (fun r hr => ⟨(hchart r hr).1,htrans r hr⟩) hU.2 + (hsource L (by simp) hL) (hsource U (by simp) hU) + (htarget L (by simp) hbounds.1) (htarget U (by simp) hbounds.2) _ hxLU + intro r hr z hzi hzp + exact (flagAffineData_barrier_chart ha g i j c T hT p hLU hr + (fun l hl r hr => openSquareChart_signs (hchart r hr) hl) z.val.2 hzp).trans hdata + +end BarrierSignalSystem +end ChartLineTransport + +section ChartBarrierTransport +open Classical Set + +theorem mem_sampledBarriers_iff {a m : ℕ} (ha : 0 < a) (i : Fin m) (N : ℝ) + (M : ∀j,Finset (FlagSite a m (commonVertexDenominator a) (barrierFlagDirection ha j))) + (b : ∀j,FlagSite a m (commonVertexDenominator a) (barrierFlagDirection ha j) → Bool) + (p : ℝ×ℝ) : p ∈ sampledBarriers ha i N M b ↔ + ∃j c,c ∈ barrierCandidate a j N ∧ cutForm a j p=ordinary c ∧ + barrierLineParameter j p ∈ subdivisionBarrier (barrierSubdivision ha i j c (M j)) + (barrierActivation ha i j c (b j)) := by + constructor + · rintro ⟨⟨j,c,hc⟩,st,hst,x,hx,rfl⟩ + refine ⟨j,c,hc,cutForm_barrierLinePoint a j c x,?_⟩ + rw [barrierLineParameter_point] + exact (mem_barrierActiveIntervals_image_iff ha i j c (M j) (b j) x).mp ⟨st,hst,hx⟩ + · rintro ⟨j,c,hc,hpc,hp⟩ + obtain ⟨st,hst,hx⟩ := (mem_barrierActiveIntervals_image_iff ha i j c (M j) (b j) _).mpr hp + exact ⟨⟨j,⟨c,hc⟩⟩,st,hst,barrierLineParameter j p,hx,barrierLinePoint_parameter hpc⟩ + +namespace BarrierSignalSystem +variable {a : ℕ} {ha : 0 < a} {Q B : ℝ} (S : BarrierSignalSystem a ha Q B) + +theorem active_line_small {m : ℕ} (i : Fin m) {N : ℝ} (hN : 0 < N) (j : Fin 4) + (c : CutRing) (hc : c ∈ barrierCandidate a j N) + (M : Finset (FlagSite a m (commonVertexDenominator a) (barrierFlagDirection ha j))) + (b : FlagSite a m (commonVertexDenominator a) (barrierFlagDirection ha j) → Bool) + (hs : signalSuccess (flagMeanSignal (S.second j).signal N) b) + {x : ℝ} (hx : x ∈ subdivisionBarrier (barrierSubdivision ha i j c M) (barrierActivation ha i j c b)) : + |conjugate c| < 3*N := by + by_contra hn + have he := secondSignal_negative_empty ha i hN hc M (S.second j).signal b + (S.second_neg j) hs (le_of_not_gt hn) + obtain ⟨st,hst,_⟩ := (mem_barrierActiveIntervals_image_iff ha i j c M b x).mpr hx + rw [he] at hst + exact Finset.notMem_empty st hst + +theorem chart_barrier_transport {m : ℕ} (g : polygonFullGroup a m) (i k : Fin m) + (T : Finset PlaneCut) + (hT : ∀p q,(∀l ∈ T,squareSign l p=squareSign l q) → + fullGroupAffineData g i p=fullGroupAffineData g i q) (p : GenericSquare a) + (u : CutRing×CutRing) (hdata : fullGroupAffineData g i p=(k,u)) + (hQ : 0 ≤ Q) (huQ : ∀j,|conjugate (integralCutForm a j u)| ≤ Q) + (hB : ∀l ∈ T ∪ squareBoundaryCuts,|conjugate l.2| ≤ B ∧ + |conjugate (l.2+integralCutForm a l.1 u)| ≤ B) + {N : ℝ} (hN : 1 ≤ N) (hQN : Q < N) + (b₁ b₂ b₁' b₂' : ∀j,FlagSite a m (commonVertexDenominator a) (barrierFlagDirection ha j) → Bool) + (hs : ∀j,signalSuccess (flagMeanSignal S.first.signal N) (b₁ j)) + (hs' : ∀j,signalSuccess (flagMeanSignal S.first.signal N) (b₁' j)) + (ht : ∀j,signalSuccess (flagMeanSignal (S.second j).signal N) (b₂ j)) + (ht' : ∀j,signalSuccess (flagMeanSignal (S.second j).signal N) (b₂' j)) + (hb₁ : ∀j z,b₁' j (flagSiteAction (commonVertexDenominator_pos ha) g z)=b₁ j z) + (hb₂ : ∀j z,b₂' j (flagSiteAction (commonVertexDenominator_pos ha) g z)=b₂ j z) + {x : ℝ×ℝ} (hx : x ∈ openSquareChart T p) : + x ∈ sampledBarriers ha i N (fun j => S.marks (N:=N) (lt_of_lt_of_le zero_lt_one hN) j (b₁ j)) b₂ ↔ + x+(ordinary u.1,ordinary u.2) ∈ sampledBarriers ha k N + (fun j => S.marks (N:=N) (lt_of_lt_of_le zero_lt_one hN) j (b₁' j)) b₂' := by + have hN₀ : 0 < N := lt_of_lt_of_le zero_lt_one hN + have hx' : x+(ordinary u.1,ordinary u.2) ∈ squareInterior := by + have hh := fullGroupAffineChart_square g i T hT p + rw [hdata] at hh + exact hh ⟨x,hx,rfl⟩ + rw [mem_sampledBarriers_iff,mem_sampledBarriers_iff] + constructor + · rintro ⟨j,c,hc,hline,hactive⟩ + have hsmall := S.active_line_small i hN₀ j c hc _ (b₂ j) (ht j) hactive + have hc' : c+integralCutForm a j u ∈ barrierCandidate a j N := by + refine ⟨?_,x+(ordinary u.1,ordinary u.2),hx',?_⟩ + · rw [map_add] + calc + |conjugate c+conjugate (integralCutForm a j u)| ≤ |conjugate c|+|conjugate (integralCutForm a j u)| := abs_add_le _ _ + _ ≤ 4*N := by linarith [huQ j] + · rw [cutForm_add,hline,cutForm_ordinary,map_add] + have hxline : barrierLinePoint a j c (barrierLineParameter j x) ∈ openSquareChart T p := by + rwa [barrierLinePoint_parameter hline] + have htransport := S.chart_line_transport g i k T hT p u hdata hQ hB hN j c hc hc' + (b₁ j) (b₂ j) (b₁' j) (b₂' j) (hs j) (hs' j) (hb₁ j) (hb₂ j) hxline + refine ⟨j,c+integralCutForm a j u,hc',?_,?_⟩ + · rw [cutForm_add,hline,cutForm_ordinary,map_add] + · rw [barrierLineParameter_add] + exact htransport.mp hactive + · rintro ⟨j,c',hc',hline',hactive'⟩ + let c := c'-integralCutForm a j u + have hce : c+integralCutForm a j u=c' := sub_add_cancel _ _ + have hline : cutForm a j x=ordinary c := by + rw [cutForm_add,cutForm_ordinary] at hline' + dsimp [c] + rw [map_sub] + linarith + have hsmall := S.active_line_small k hN₀ j c' hc' _ (b₂' j) (ht' j) hactive' + have hc : c ∈ barrierCandidate a j N := by + refine ⟨?_,x,hx.1,hline⟩ + change |conjugate (c'-integralCutForm a j u)| ≤ _ + rw [map_sub] + calc + |conjugate c'-conjugate (integralCutForm a j u)| ≤ |conjugate c'|+|conjugate (integralCutForm a j u)| := abs_sub _ _ + _ ≤ 4*N := by linarith [huQ j] + have hxline : barrierLinePoint a j c (barrierLineParameter j x) ∈ openSquareChart T p := by + rwa [barrierLinePoint_parameter hline] + have htransport := S.chart_line_transport g i k T hT p u hdata hQ hB hN j c hc + (hce.symm ▸ hc') (b₁ j) (b₂ j) (b₁' j) (b₂' j) (hs j) (hs' j) (hb₁ j) (hb₂ j) hxline + rw [hce] at htransport + refine ⟨j,c,hc,hline,htransport.mpr ?_⟩ + simpa only [barrierLineParameter_add] using hactive' + +end BarrierSignalSystem +end ChartBarrierTransport + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Amenability/ComponentChartContainment.lean b/lean/OAI/GroupTheory/SimpleAmenable/Amenability/ComponentChartContainment.lean new file mode 100644 index 0000000000000000000000000000000000000000..8a9f61d5602209d42020ae0c35c0a7a8945f7ab7 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Amenability/ComponentChartContainment.lean @@ -0,0 +1,175 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Amenability.BarrierSignalSystem +import OAI.GroupTheory.SimpleAmenable.Amenability.ChartLineTransport +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.ChartBoundaryEndpoints + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section ComponentChartContainment +open Classical Set + +theorem barrier_component_cut_ordinary {a : ℕ} {B : Set (ℝ×ℝ)} {j : Fin 4} {c : CutRing} + (hline : ∀x ∈ squareInterior,cutForm a j x=ordinary c → x ∈ B) + {p x : ℝ×ℝ} (hp : p ∈ barrierRegion B) + (hx : x ∈ connectedComponentIn (barrierRegion B) p) : + cutForm a j x ≠ ordinary c ∧ (cutForm a j x < ordinary c ↔ cutForm a j p < ordinary c) := by + have hn (y : ℝ×ℝ) (hy : y ∈ connectedComponentIn (barrierRegion B) p) : cutForm a j y ≠ ordinary c := by + intro he + have hr := connectedComponentIn_subset (barrierRegion B) p hy + exact hr.2 (hline y hr.1 he) + refine ⟨hn x hx,?_⟩ + have hh := continuous_nonzero_sign isPreconnected_connectedComponentIn + ((cutForm_continuous a j).sub continuous_const).continuousOn + (fun y hy => sub_ne_zero.mpr (hn y hy)) hx (mem_connectedComponentIn hp) + simpa only [Pi.sub_apply,sub_lt_zero] using hh + +theorem barrier_component_openChart {a : ℕ} {B : Set (ℝ×ℝ)} + (T : Finset PlaneCut) (p : GenericSquare a) + (hp : p.val ∈ barrierRegion B) + (hline : ∀l ∈ T,∀x ∈ squareInterior,cutForm a l.1 x=ordinary l.2 → x ∈ B) : + connectedComponentIn (barrierRegion B) p.val ⊆ openSquareChart T p := by + intro x hx + refine ⟨(connectedComponentIn_subset (barrierRegion B) p.val hx).1,?_⟩ + intro l + obtain ⟨hne,hs⟩ := barrier_component_cut_ordinary (hline l.val l.property) hp hx + by_cases hh : cutForm a l.val.1 p.val < ordinary l.val.2 + · simpa [squareSign,hh] using hs.mpr hh + · simpa [squareSign,hh] using lt_of_le_of_ne (le_of_not_gt (fun h => hh (hs.mp h))) hne.symm + +theorem barrier_component_translatedChart {a : ℕ} {B : Set (ℝ×ℝ)} + (T : Finset PlaneCut) (p q : GenericSquare a) (u : CutRing×CutRing) + (hqp : q.val=p.val+(ordinary u.1,ordinary u.2)) + (hq : q.val ∈ barrierRegion B) + (hline : ∀l ∈ T ∪ squareBoundaryCuts,∀x ∈ squareInterior, + cutForm a l.1 x=ordinary (l.2+integralCutForm a l.1 u) → x ∈ B) : + ∀x ∈ connectedComponentIn (barrierRegion B) q.val, + x-(ordinary u.1,ordinary u.2) ∈ openSquareChart T p := by + intro x hx + have hsign (l : PlaneCut) (hl : l ∈ T ∪ squareBoundaryCuts) : + cutForm a l.1 (x-(ordinary u.1,ordinary u.2)) ≠ ordinary l.2 ∧ + (cutForm a l.1 (x-(ordinary u.1,ordinary u.2)) < ordinary l.2 ↔ + cutForm a l.1 p.val < ordinary l.2) := by + obtain ⟨hne,hs⟩ := barrier_component_cut_ordinary (hline l hl) hq hx + rw [hqp,cutForm_add,cutForm_ordinary,map_add] at hs + rw [map_add] at hne + rw [cutForm_sub,cutForm_ordinary] + refine ⟨fun h => hne (by linarith),?_⟩ + constructor + · intro h + have hh := hs.mp (by linarith : cutForm a l.1 x < ordinary l.2+ordinary (integralCutForm a l.1 u)) + linarith + · intro h + have hh := hs.mpr (by linarith : cutForm a l.1 p.val+ordinary (integralCutForm a l.1 u) < ordinary l.2+ordinary (integralCutForm a l.1 u)) + linarith + have hp := generic_mem_squareInterior p + have hx₀ := hsign (0,0) (Finset.mem_union_right _ (by simp [squareBoundaryCuts])) + have hx₁ := hsign (0,1) (Finset.mem_union_right _ (by simp [squareBoundaryCuts])) + have hy₀ := hsign (1,0) (Finset.mem_union_right _ (by simp [squareBoundaryCuts])) + have hy₁ := hsign (1,1) (Finset.mem_union_right _ (by simp [squareBoundaryCuts])) + simp only [cutForm,Matrix.cons_val_zero,Matrix.cons_val_one, + map_zero,map_one,Prod.fst_sub,Prod.snd_sub] at hx₀ hx₁ hy₀ hy₁ + refine ⟨⟨⟨?_,?_⟩,⟨?_,?_⟩⟩,?_⟩ + · exact lt_of_le_of_ne (le_of_not_gt (fun h => not_lt_of_gt hp.1.1 (hx₀.2.mp h))) hx₀.1.symm + · exact hx₁.2.mpr hp.1.2 + · exact lt_of_le_of_ne (le_of_not_gt (fun h => not_lt_of_gt hp.2.1 (hy₀.2.mp h))) hy₀.1.symm + · exact hy₁.2.mpr hp.2.2 + · intro l + obtain ⟨hne,hs⟩ := hsign l.val (Finset.mem_union_left _ l.property) + by_cases hh : cutForm a l.val.1 p.val < ordinary l.val.2 + · simpa [squareSign,hh] using hs.mpr hh + · simpa [squareSign,hh] using lt_of_le_of_ne (le_of_not_gt (fun h => hh (hs.mp h))) hne.symm + +end ComponentChartContainment + +section ComponentTransport +open Classical Set +namespace BarrierSignalSystem +variable {a : ℕ} {ha : 0 < a} {Q B : ℝ} (S : BarrierSignalSystem a ha Q B) + +theorem component_transport {m : ℕ} (g : polygonFullGroup a m) (i k : Fin m) + (T : Finset PlaneCut) + (hT : ∀p q,(∀l ∈ T,squareSign l p=squareSign l q) → + fullGroupAffineData g i p=fullGroupAffineData g i q) (p q : GenericSquare a) + (u : CutRing×CutRing) (hdata : fullGroupAffineData g i p=(k,u)) + (hqp : q.val=p.val+(ordinary u.1,ordinary u.2)) + (hQ : 0 ≤ Q) (huQ : ∀j,|conjugate (integralCutForm a j u)| ≤ Q) + (hB : ∀l ∈ T ∪ squareBoundaryCuts,|conjugate l.2| ≤ B ∧ + |conjugate (l.2+integralCutForm a l.1 u)| ≤ B) + {N : ℝ} (hN : 1 ≤ N) (hQN : Q < N) (hBN : B ≤ N) + (b₁ b₂ b₁' b₂' : ∀j,FlagSite a m (commonVertexDenominator a) (barrierFlagDirection ha j) → Bool) + (hs : ∀j,signalSuccess (flagMeanSignal S.first.signal N) (b₁ j)) + (hs' : ∀j,signalSuccess (flagMeanSignal S.first.signal N) (b₁' j)) + (ht : ∀j,signalSuccess (flagMeanSignal (S.second j).signal N) (b₂ j)) + (ht' : ∀j,signalSuccess (flagMeanSignal (S.second j).signal N) (b₂' j)) + (hb₁ : ∀j z,b₁' j (flagSiteAction (commonVertexDenominator_pos ha) g z)=b₁ j z) + (hb₂ : ∀j z,b₂' j (flagSiteAction (commonVertexDenominator_pos ha) g z)=b₂ j z) : + (fun x => x+(ordinary u.1,ordinary u.2)) '' connectedComponentIn + (barrierRegion (sampledBarriers ha i N + (fun j => S.marks (N:=N) (lt_of_lt_of_le zero_lt_one hN) j (b₁ j)) b₂)) p.val = + connectedComponentIn (barrierRegion (sampledBarriers ha k N + (fun j => S.marks (N:=N) (lt_of_lt_of_le zero_lt_one hN) j (b₁' j)) b₂')) q.val := by + let v := (ordinary u.1,ordinary u.2) + let A₀ := sampledBarriers ha i N + (fun j => S.marks (N:=N) (lt_of_lt_of_le zero_lt_one hN) j (b₁ j)) b₂ + let A₁ := sampledBarriers ha k N + (fun j => S.marks (N:=N) (lt_of_lt_of_le zero_lt_one hN) j (b₁' j)) b₂' + have hp : p.val ∈ barrierRegion A₀ := generic_mem_barrierRegion (sampledBarriers_supported ha i N _ b₂) p + have hq : q.val ∈ barrierRegion A₁ := generic_mem_barrierRegion (sampledBarriers_supported ha k N _ b₂') q + have hsource : connectedComponentIn (barrierRegion A₀) p.val ⊆ openSquareChart T p := by + apply barrier_component_openChart T p hp + intro l hl x hx hxc + have hband := ((hB l (Finset.mem_union_left _ hl)).1).trans hBN + exact S.central_line_barrier i hN b₁ b₂ hs ht + ⟨by linarith, x,hx,hxc⟩ hband x hx hxc + have htarget : ∀x ∈ connectedComponentIn (barrierRegion A₁) q.val,x-v ∈ openSquareChart T p := by + apply barrier_component_translatedChart T p q u hqp hq + intro l hl x hx hxc + have hband := ((hB l hl).2).trans hBN + exact S.central_line_barrier k hN b₁' b₂' hs' ht' + ⟨by linarith,x,hx,hxc⟩ hband x hx hxc + have hbar (x : ℝ×ℝ) (hx : x ∈ openSquareChart T p) : x ∈ A₀ ↔ x+v ∈ A₁ := + S.chart_barrier_transport g i k T hT p u hdata hQ huQ hB hN hQN + b₁ b₂ b₁' b₂' hs hs' ht ht' hb₁ hb₂ hx + have hforward : (fun x => x+v) '' connectedComponentIn (barrierRegion A₀) p.val ⊆ + connectedComponentIn (barrierRegion A₁) q.val := by + apply (isPreconnected_connectedComponentIn.image _ (continuous_id.add continuous_const).continuousOn).subset_connectedComponentIn + · exact ⟨p.val,mem_connectedComponentIn hp,hqp.symm⟩ + · rintro x ⟨y,hy,rfl⟩ + have hyC := hsource hy + have hyreg := connectedComponentIn_subset (barrierRegion A₀) p.val hy + refine ⟨?_,fun h => hyreg.2 ((hbar y hyC).mpr h)⟩ + have himage := fullGroupAffineChart_square g i T hT p + rw [hdata] at himage + exact himage ⟨y,hyC,rfl⟩ + have hbackward : (fun x => x-v) '' connectedComponentIn (barrierRegion A₁) q.val ⊆ + connectedComponentIn (barrierRegion A₀) p.val := by + apply (isPreconnected_connectedComponentIn.image _ (continuous_id.sub continuous_const).continuousOn).subset_connectedComponentIn + · refine ⟨q.val,mem_connectedComponentIn hq,?_⟩ + change q.val-v=p.val + rw [hqp,add_sub_cancel_right] + · rintro x ⟨y,hy,rfl⟩ + have hyC := htarget y hy + have hyreg := connectedComponentIn_subset (barrierRegion A₁) q.val hy + refine ⟨hyC.1,?_⟩ + intro h + have hh := (hbar (y-v) hyC).mp h + rw [sub_add_cancel] at hh + exact hyreg.2 hh + apply Subset.antisymm hforward + intro y hy + exact ⟨y-v,hbackward ⟨y,hy,rfl⟩,sub_add_cancel y v⟩ + +end BarrierSignalSystem +end ComponentTransport + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Amenability/FiniteCoarea.lean b/lean/OAI/GroupTheory/SimpleAmenable/Amenability/FiniteCoarea.lean new file mode 100644 index 0000000000000000000000000000000000000000..e2638dc734c62b8f3bddda2ca0530ac13cf98a8a --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Amenability/FiniteCoarea.lean @@ -0,0 +1,263 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Model + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section FiniteCoarea + +variable {V E : Type*} [Fintype V] [Fintype E] + +noncomputable def graphVariation (u v : E → V) (w : V → ℝ) : ℝ := + ∑ e, |w (u e) - w (v e)| + +noncomputable def graphBoundary (u v : E → V) (A : Finset V) : ℝ := by + classical + exact graphVariation u v (fun x => if x ∈ A then 1 else 0) + +theorem finite_coarea (u v : E → V) (w : V → ℝ) (hw : ∀ x, 0 ≤ w x) + (ε : ℝ) (h : graphVariation u v w < ε * ∑ x, w x) : + ∃ A : Finset V, A.Nonempty ∧ (∀ x ∈ A, 0 < w x) ∧ + graphBoundary u v A < ε * A.card := by + classical + let S : Finset V := Finset.univ.filter (fun x => 0 < w x) + suffices aux : ∀ n : ℕ, ∀ w : V → ℝ, (∀ x, 0 ≤ w x) → + (Finset.univ.filter (fun x => 0 < w x)).card = n → + graphVariation u v w < ε * ∑ x, w x → + ∃ A : Finset V, A.Nonempty ∧ (∀ x ∈ A, 0 < w x) ∧ + graphBoundary u v A < ε * A.card from aux S.card w hw rfl h + intro n + induction n using Nat.strong_induction_on with + | h n ih => + intro w hw hn h + let S : Finset V := Finset.univ.filter (fun x => 0 < w x) + have hs : ∀ x, x ∈ S ↔ 0 < w x := by simp [S] + have hS : S.Nonempty := by + by_contra he + have hz (x : V) : w x = 0 := by + have : ¬ 0 < w x := fun hp => he ⟨x,(hs x).mpr hp⟩ + linarith [hw x] + simp [graphVariation,hz] at h + obtain ⟨i,hi,hmin⟩ := Finset.exists_min_image S w hS + let δ := w i + have hd : 0 < δ := (hs i).mp hi + let q : V → ℝ := fun x => if x ∈ S then w x - δ else 0 + have hq (x : V) : 0 ≤ q x := by + dsimp only [q] + split_ifs with hx + · exact sub_nonneg.mpr (hmin x hx) + · rfl + have hw0 (x : V) (hx : x ∉ S) : w x = 0 := by + have : ¬ 0 < w x := fun hp => hx ((hs x).mpr hp) + linarith [hw x] + have hwq (x : V) : w x = q x + δ * (if x ∈ S then 1 else 0) := by + by_cases hx : x ∈ S + · simp [q,hx] + · simp [q,hx,hw0 x hx] + have coeff (x y : V) : + |w x - w y| = |q x - q y| + δ * + |(if x ∈ S then (1 : ℝ) else 0) - (if y ∈ S then 1 else 0)| := by + by_cases hx : x ∈ S <;> by_cases hy : y ∈ S + · simp [q,hx,hy] + · have hqx : 0 ≤ w x - δ := by simpa [q,hx] using hq x + simp only [q,hx,hy,ite_true,ite_false,hw0 y hy,sub_zero,abs_one,mul_one] + rw [abs_of_nonneg (hw x),abs_of_nonneg hqx] + ring + · have hqy : 0 ≤ w y - δ := by simpa [q,hy] using hq y + simp only [q,hx,hy,ite_true,ite_false,hw0 x hx,zero_sub,abs_neg,abs_one,mul_one] + rw [abs_of_nonneg (hw y),abs_of_nonneg hqy] + ring + · simp [q,hx,hy,hw0 x hx,hw0 y hy] + have hvar : graphVariation u v w = graphVariation u v q + δ * graphBoundary u v S := by + unfold graphBoundary graphVariation + simp_rw [coeff] + rw [Finset.sum_add_distrib,Finset.mul_sum] + have hmass : (∑ x, w x) = (∑ x, q x) + δ * S.card := by + simp only [hwq,Finset.sum_add_distrib,← Finset.mul_sum] + congr 1 + simp + by_cases hb : graphBoundary u v S < ε * S.card + · exact ⟨S,hS,fun x hx => (hs x).mp hx,hb⟩ + · have hrec : graphVariation u v q < ε * ∑ x, q x := by + rw [hvar,hmass] at h + have hbd : ε * S.card ≤ graphBoundary u v S := le_of_not_gt hb + nlinarith + let T := Finset.univ.filter (fun x => 0 < q x) + have hTS : T ⊆ S := by + intro x hx + have hqx : 0 < q x := (Finset.mem_filter.mp hx).2 + by_contra hxS + simp [q,hxS] at hqx + have hiT : i ∉ T := by simp [T,q,hi,δ] + have hc : T.card < n := by + rw [← hn] + exact Finset.card_lt_card (Finset.ssubset_iff_subset_ne.mpr + ⟨hTS,fun he => hiT (he.symm ▸ hi)⟩) + obtain ⟨A,hA,hAw,hAb⟩ := ih T.card hc q hq rfl hrec + refine ⟨A,hA,?_,hAb⟩ + intro x hx + have hp := hAw x hx + have hqS : x ∈ S := hTS (by simp [T,hp]) + exact (hs x).mp hqS + +end FiniteCoarea + +section WeightedGroupCoarea + +variable {G : Type*} [Group G] [DecidableEq G] + +noncomputable def translationWindow (K S : Finset G) : Finset G := by + classical + exact S ∪ K.biUnion (fun k => S.image (fun x => k*x)) + +noncomputable def weightedVariation (K S : Finset G) (p : G → ℝ) : ℝ := + ∑ k ∈ K, ∑ x ∈ translationWindow K S, |p (k⁻¹*x) - p x| + +theorem weighted_group_coarea (K S : Finset G) (p : G → ℝ) + (hp : ∀ x, 0 ≤ p x) (hs : ∀ x ∉ S, p x = 0) (ε : ℝ) + (h : weightedVariation K S p < ε * ∑ x ∈ S, p x) : + ∃ D : Finset G, D.Nonempty ∧ D ⊆ S ∧ + (∑ k ∈ K, ((symmDiff (D.image (fun x => k*x)) D).card : ℝ)) < ε * D.card := by + classical + let B := translationWindow K S + let node : G → Option {x // x ∈ S} := fun x => if hx : x ∈ S then some ⟨x,hx⟩ else none + let w : Option {x // x ∈ S} → ℝ := fun z => match z with + | none => 0 + | some x => p x.val + let u : {k // k ∈ K} × {x // x ∈ B} → Option {x // x ∈ S} := + fun e => node (e.1.val⁻¹ * e.2.val) + let v : {k // k ∈ K} × {x // x ∈ B} → Option {x // x ∈ S} := + fun e => node e.2.val + have hwnode (x : G) : w (node x) = p x := by + by_cases hx : x ∈ S + · simp [node,w,hx] + · simp [node,w,hx,hs x hx] + have hw : ∀ z, 0 ≤ w z := by intro z; cases z with + | none => exact le_rfl + | some z => exact hp z.val + have hm : (∑ z, w z) = ∑ x ∈ S, p x := by + simp [w,Fintype.sum_option,Finset.sum_attach] + have hv : graphVariation u v w = weightedVariation K S p := by + simp only [graphVariation,Fintype.sum_prod_type,u,v,hwnode] + unfold weightedVariation + rw [← Finset.sum_coe_sort K] + apply Fintype.sum_congr + intro k + rw [← Finset.sum_coe_sort (translationWindow K S)] + obtain ⟨A,hA,hpos,hbd⟩ := finite_coarea u v w hw ε (by rwa [hv,hm]) + have hn : (none : Option {x // x ∈ S}) ∉ A := by + intro hn + have hh := hpos none hn + exact (lt_irrefl 0) hh + let D : Finset G := S.filter (fun x => node x ∈ A) + have hDS : D ⊆ S := Finset.filter_subset _ _ + have hnode (x : G) : node x ∈ A ↔ x ∈ D := by + by_cases hx : x ∈ S + · simp [D,hx] + · simp [node,D,hx,hn] + have hmap : D.image node = A := by + ext z + constructor + · rintro hz + obtain ⟨x,hx,rfl⟩ := Finset.mem_image.mp hz + exact (hnode x).mpr hx + · intro hz + cases z with + | none => exact False.elim (hn hz) + | some x => + have he : node x.val = some x := by simp [node,x.property] + exact Finset.mem_image.mpr ⟨x.val,(hnode x.val).mp (he ▸ hz),he⟩ + have hc : A.card = D.card := by + rw [← hmap] + apply Finset.card_image_iff.mpr + intro x hx y hy he + have hxS := hDS hx + have hyS := hDS hy + simp only [node,hxS,hyS,dite_eq_left,Option.some.injEq,Subtype.mk.injEq] at he + exact he + have hDn : D.Nonempty := by + rw [← hmap] at hA + exact Finset.Nonempty.of_image hA + have hb (k : G) (hk : k ∈ K) : symmDiff (D.image (fun x => k*x)) D ⊆ B := by + intro x hx + have hx' := Finset.mem_symmDiff.mp hx + rcases hx' with ⟨him,_⟩ | ⟨hD,_⟩ + · obtain ⟨y,hy,rfl⟩ := Finset.mem_image.mp him + exact Finset.mem_union_right _ (Finset.mem_biUnion.mpr + ⟨k,hk,Finset.mem_image.mpr ⟨y,hDS hy,rfl⟩⟩) + · exact Finset.mem_union_left _ (hDS hD) + have hf (k x : G) : + |(if node (k⁻¹*x) ∈ A then (1 : ℝ) else 0) - + (if node x ∈ A then 1 else 0)| = + if x ∈ symmDiff (D.image (fun y => k*y)) D then 1 else 0 := by + have hi : x ∈ D.image (fun y => k*y) ↔ k⁻¹*x ∈ D := by + constructor + · rintro h + obtain ⟨y,hy,rfl⟩ := Finset.mem_image.mp h + simpa using hy + · intro hx + exact Finset.mem_image.mpr ⟨k⁻¹*x,hx,by group⟩ + simp only [hnode,Finset.mem_symmDiff,hi] + by_cases h1 : k⁻¹*x ∈ D <;> by_cases h2 : x ∈ D <;> simp [h1,h2] + have hbound : graphBoundary u v A = + ∑ k ∈ K, ((symmDiff (D.image (fun x => k*x)) D).card : ℝ) := by + unfold graphBoundary graphVariation + simp only [u,v] + rw [Fintype.sum_prod_type] + rw [← Finset.sum_coe_sort K] + apply Fintype.sum_congr + intro k + have hinner : (∑ x : B, |(if node (k.val⁻¹*x.val) ∈ A then (1 : ℝ) else 0) - + (if node x.val ∈ A then 1 else 0)|) = + ∑ x : B, if x.val ∈ symmDiff (D.image (fun y => k.val*y)) D then (1 : ℝ) else 0 := by + apply Fintype.sum_congr + intro x + exact hf k.val x.val + refine Eq.trans ?_ hinner |>.trans ?_ + · apply Fintype.sum_congr + intro x + split_ifs <;> simp_all + have hcSum := Finset.sum_coe_sort B (fun (x : G) => + if x ∈ symmDiff (D.image (fun y => k.val*y)) D then (1 : ℝ) else 0) + have he : B.filter (fun x => x ∈ symmDiff (D.image (fun x => k.val*x)) D) = + symmDiff (D.image (fun x => k.val*x)) D := by + exact Finset.filter_mem_eq_inter.trans (Finset.inter_eq_right.mpr (hb k.val k.property)) + calc + _ = ∑ x ∈ B, if x ∈ symmDiff (D.image (fun y => k.val*y)) D then (1 : ℝ) else 0 := by + simpa using hcSum + _ = _ := by rw [Finset.sum_boole,he] + refine ⟨D,hDn,hDS,?_⟩ + rwa [hbound,hc] at hbd + +end WeightedGroupCoarea + +noncomputable def FiniteSupportReiter (G : Type*) [Group G] : Prop := by + classical + exact ∀ K : Finset G, ∀ ε : ℝ, 0 < ε → + ∃ (S : Finset G) (p : G → ℝ), (∀ x, 0 ≤ p x) ∧ + (∀ x ∉ S, p x = 0) ∧ (∑ x ∈ S, p x) = 1 ∧ + weightedVariation K S p < ε + +theorem folner_of_finite_reiter {G : Type*} [Group G] + (h : FiniteSupportReiter G) : FolnerAmenable G := by + classical + intro K ε hε + obtain ⟨S,p,hp,hs,hm,hv⟩ := h K ε hε + obtain ⟨D,hD,_,hb⟩ := weighted_group_coarea K S p hp hs ε (by simpa only [hm,mul_one] using hv) + refine ⟨D,hD,?_⟩ + intro k hk + have hn (j : G) (_ : j ∈ K) : 0 ≤ ((symmDiff (D.image (fun x => j*x)) D).card : ℝ) := + Nat.cast_nonneg _ + have hi := Finset.single_le_sum hn hk + exact lt_of_le_of_lt hi hb + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Amenability/FinitePartitionArrows.lean b/lean/OAI/GroupTheory/SimpleAmenable/Amenability/FinitePartitionArrows.lean new file mode 100644 index 0000000000000000000000000000000000000000..1eeac51e993d913498147d848b5e31314d3ee972 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Amenability/FinitePartitionArrows.lean @@ -0,0 +1,200 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Amenability.ComponentChartContainment +import OAI.GroupTheory.SimpleAmenable.Amenability.BarrierFiniteMenu +import OAI.GroupTheory.SimpleAmenable.Amenability.PartitionArrows +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.ShapeTranslationUnique + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section FinitePartitionArrows +open Classical Set +namespace PartitionArrow +variable {a m : ℕ} {P Q : TrackPolygonPartition a m} {g h : polygonFullGroup a m} + +noncomputable def cellMap (hg : PartitionArrow P Q g) (c : PartitionCell P) : PartitionCell Q := + (hg c).choose + +theorem cellMap_image (hg : PartitionArrow P Q g) (c : PartitionCell P) : + g.val '' partitionCellSet c=partitionCellSet (hg.cellMap c) := (hg c).choose_spec.1 + +theorem eq_of_cellMap (hg : PartitionArrow P Q g) (hh : PartitionArrow P Q h) + (he : hg.cellMap=hh.cellMap) : g=h := by + apply Subtype.ext + apply Equiv.ext + intro x + obtain ⟨c,hc,-⟩ := partitionCellSet_cover P x + obtain ⟨u,hu⟩ := (hg c).choose_spec.2 + obtain ⟨v,hv⟩ := (hh c).choose_spec.2 + have him : g.val '' partitionCellSet c=h.val '' partitionCellSet c := by + rw [hg.cellMap_image,hh.cellMap_image,he] + have hne := partitionCellSet_nonempty c + have hxshift : ordinary u.1=ordinary v.1 := by + refine bounded_coordinate_shift_unique (partitionCellSet c) (fun t => t.2.val.1) + (fun t => t.2.val.1) hne (show BddAbove ((fun t => t.2.val.1) '' partitionCellSet c) from ?_) + g.val h.val him (ordinary u.1) (ordinary v.1) ?_ ?_ + · exact ⟨1,by rintro y ⟨z,hz,rfl⟩; exact z.2.property.1.2.le⟩ + · intro z hz + exact congrArg Prod.fst (hu z hz) + · intro z hz + exact congrArg Prod.fst (hv z hz) + have hyshift : ordinary u.2=ordinary v.2 := by + refine bounded_coordinate_shift_unique (partitionCellSet c) (fun t => t.2.val.2) + (fun t => t.2.val.2) hne (show BddAbove ((fun t => t.2.val.2) '' partitionCellSet c) from ?_) + g.val h.val him (ordinary u.2) (ordinary v.2) ?_ ?_ + · exact ⟨1,by rintro y ⟨z,hz,rfl⟩; exact z.2.property.2.1.2.le⟩ + · intro z hz + exact congrArg Prod.snd (hu z hz) + · intro z hz + exact congrArg Prod.snd (hv z hz) + apply Prod.ext + · have hgc : g.val x∈partitionCellSet (hg.cellMap c) := by rw [←hg.cellMap_image]; exact ⟨x,hc,rfl⟩ + have hhc : h.val x∈partitionCellSet (hh.cellMap c) := by rw [←hh.cellMap_image]; exact ⟨x,hc,rfl⟩ + rw [he] at hgc + exact hgc.1.trans hhc.1.symm + · apply Subtype.ext + rw [hu x hc,hv x hc,hxshift,hyshift] + +instance arrows_finite (P Q : TrackPolygonPartition a m) : + Finite {g : polygonFullGroup a m // PartitionArrow P Q g} := by + apply Finite.of_injective (fun g : {g : polygonFullGroup a m // PartitionArrow P Q g} => g.property.cellMap) + intro g h he + apply Subtype.ext + exact eq_of_cellMap g.property h.property he + +end PartitionArrow +end FinitePartitionArrows + +section SampledPartitionMotion +open Classical Set + +noncomputable def BarrierSignalSystem.sampledPartition {a m : ℕ} {ha : 0 < a} {Q B : ℝ} + (S : BarrierSignalSystem a ha Q B) (n : ℕ) (b : BarrierBits a m ha) : TrackPolygonPartition a m := + fun i => sampledPolygonPartition ha i (sourceDyadicN_pos n) + (fun j => S.marks (sourceDyadicN_pos n) j (barrierFirstBits b j)) (barrierSecondBits b) + +theorem generic_component_image {a m : ℕ} (g : polygonFullGroup a m) (i k : Fin m) + (u : CutRing×CutRing) (C D : Set (ℝ×ℝ)) (hC : C ⊆ squareInterior) + (he : (fun x => x+(ordinary u.1,ordinary u.2)) '' C=D) + (haff : ∀p : GenericSquare a,p.val∈C → fullGroupAffineData g i p=(k,u)) : + g.val '' {x : TrackPoint a m | x.1=i ∧ x.2.val∈C}= + {x : TrackPoint a m | x.1=k ∧ x.2.val∈D} := by + apply Set.Subset.antisymm + · rintro x ⟨⟨j,p⟩,⟨hji,hp⟩,rfl⟩ + dsimp at hji + subst j + have hd := haff p hp + have ht := congrArg Prod.fst hd + have hu := congrArg Prod.snd hd + have hv := fullGroupSquareShift_spec g i p + change fullGroupSquareShift g i p=u at hu + rw [hu] at hv + exact ⟨ht,by rw [hv,←he]; exact ⟨p.val,hp,rfl⟩⟩ + · rintro ⟨j,q⟩ ⟨hjk,hq⟩ + dsimp at hjk + subst j + obtain ⟨x,hx,hxq⟩ := (Set.mem_image _ _ _).mp (he.symm ▸ hq) + have hxg : AvoidsCuts a x := by + have hh := avoidsCuts_translate q.property.2.2 (-u) + rw [←hxq] at hh + simpa [map_neg,←Prod.neg_mk] using hh + let p : GenericSquare a := ⟨x,⟨⟨(hC hx).1.1.le,(hC hx).1.2⟩, + ⟨(hC hx).2.1.le,(hC hx).2.2⟩,hxg⟩⟩ + have hd := haff p hx + have ht := congrArg Prod.fst hd + have hu := congrArg Prod.snd hd + have hv := fullGroupSquareShift_spec g i p + change fullGroupSquareShift g i p=u at hu + rw [hu] at hv + refine ⟨(i,p),⟨rfl,hx⟩,?_⟩ + exact Prod.ext ht (Subtype.ext (hv.trans hxq)) + +namespace BarrierMenu +variable {a m : ℕ} {ha : 0 < a} {F : Finset (polygonFullGroup a m)} (M : BarrierMenu a m ha F) + +theorem component_chart {n : ℕ} (hN : 1 ≤ sourceDyadicN n) (hB : M.B ≤ sourceDyadicN n) + {b : BarrierBits a m ha} (hs : jointFieldSuccess (barrierEightDirections ha) M.signals.eight n b) + (g : polygonFullGroup a m) (hg : g∈F) (i : Fin m) (p : GenericSquare a) : + connectedComponentIn (barrierRegion (sampledBarriers ha i (sourceDyadicN n) + (fun j => M.signals.marks (sourceDyadicN_pos n) j (barrierFirstBits b j)) + (barrierSecondBits b))) p.val ⊆ openSquareChart (barrierChartCuts g i) p := by + obtain ⟨hs₁,hs₂⟩ := M.signals.eight_success hs + apply barrier_component_openChart (barrierChartCuts g i) p + (generic_mem_barrierRegion (sampledBarriers_supported ha i _ _ _) p) + intro l hl x hx hxc + have hb := ((M.chart_bound g hg i p l (Finset.mem_union_left _ hl)).1).trans hB + exact M.signals.central_line_barrier i hN (barrierFirstBits b) (barrierSecondBits b) hs₁ hs₂ + ⟨by linarith,x,hx,hxc⟩ hb x hx hxc + +theorem sampledPartition_arrow {n : ℕ} (hN : 1 ≤ sourceDyadicN n) + (hQ : M.Q < sourceDyadicN n) (hB : M.B ≤ sourceDyadicN n) + (g : polygonFullGroup a m) (hg : g∈F) (b : BarrierBits a m ha) + (hs : jointFieldSuccess (barrierEightDirections ha) M.signals.eight n b) + (hs' : jointFieldSuccess (barrierEightDirections ha) M.signals.eight n (barrierBitsTransport g b)) : + PartitionArrow (M.signals.sampledPartition n b) + (M.signals.sampledPartition n (barrierBitsTransport g b)) g := by + let := barrierLineIndexFintype a (sourceDyadicN_pos n) + obtain ⟨hs₁,hs₂⟩ := M.signals.eight_success hs + obtain ⟨hs₁',hs₂'⟩ := M.signals.eight_success hs' + intro c + have hc := c.2.property + change c.2.val∈(sampledPolygonPartition ha c.1 (sourceDyadicN_pos n) _ _).cells at hc + obtain ⟨p,hpc⟩ := (mem_finiteBarrierPartition _ c.2.val).mp hc + let k := (g.val (c.1,p)).1 + let q := (g.val (c.1,p)).2 + let u := fullGroupSquareShift g c.1 p + let B₀ := sampledBarriers ha c.1 (sourceDyadicN n) + (fun j => M.signals.marks (sourceDyadicN_pos n) j (barrierFirstBits b j)) (barrierSecondBits b) + let B₁ := sampledBarriers ha k (sourceDyadicN n) + (fun j => M.signals.marks (sourceDyadicN_pos n) j (barrierFirstBits (barrierBitsTransport g b) j)) + (barrierSecondBits (barrierBitsTransport g b)) + let d₀ : polygonAlgebra a := ⟨barrierComponentCell B₁ q.val, + barrierComponentCell_polygon (sampledBarriers_supported ha k _ _ _) q.val⟩ + have hd₀ : d₀∈(M.signals.sampledPartition n (barrierBitsTransport g b) k).cells := + (mem_finiteBarrierPartition _ d₀).mpr ⟨q,rfl⟩ + let d : PartitionCell (M.signals.sampledPartition n (barrierBitsTransport g b)) := ⟨k,⟨d₀,hd₀⟩⟩ + have hdata : fullGroupAffineData g c.1 p=(k,u) := rfl + have haff (r : GenericSquare a) (hr : r.val∈connectedComponentIn (barrierRegion B₀) p.val) : + fullGroupAffineData g c.1 r=(k,u) := by + exact (squareArrangement_on_openChart (fullGroupAffineData g c.1) (barrierChartCuts g c.1) + (barrierChartCuts_spec g c.1) p r (M.component_chart hN hB hs g hg c.1 p hr)).trans hdata + have he := M.signals.component_transport g c.1 k (barrierChartCuts g c.1) + (barrierChartCuts_spec g c.1) p q u hdata (fullGroupSquareShift_spec g c.1 p) + M.Q_nonneg (M.shift_bound g hg c.1 p) (M.chart_bound g hg c.1 p) + hN hQ hB (barrierFirstBits b) (barrierSecondBits b) + (barrierFirstBits (barrierBitsTransport g b)) (barrierSecondBits (barrierBitsTransport g b)) + hs₁ hs₁' hs₂ hs₂' (barrierBitsTransport_first g b) (barrierBitsTransport_second g b) + have hcs : partitionCellSet c={x : TrackPoint a m | x.1=c.1 ∧ + x.2.val∈connectedComponentIn (barrierRegion B₀) p.val} := by + ext x + change (x.1=c.1 ∧ x.2∈c.2.val.val) ↔ _ + rw [hpc] + rfl + refine ⟨d,?_,u,?_⟩ + · rw [hcs] + exact generic_component_image g c.1 k u _ _ + (fun _ hx => (connectedComponentIn_subset (barrierRegion B₀) p.val hx).1) he haff + · intro x hx + rw [hcs] at hx + have hi := hx.1 + have hd := congrArg Prod.snd (haff x.2 hx.2) + have hv := fullGroupSquareShift_spec g c.1 x.2 + change fullGroupSquareShift g c.1 x.2=u at hd + rw [hd] at hv + have hxpair : x=(c.1,x.2) := Prod.ext hi rfl + rw [hxpair] + exact hv + +end BarrierMenu +end SampledPartitionMotion + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Amenability/LocalBarrierTransport.lean b/lean/OAI/GroupTheory/SimpleAmenable/Amenability/LocalBarrierTransport.lean new file mode 100644 index 0000000000000000000000000000000000000000..f9d764eef46b8797b352a1130442bdcc42bb62d7 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Amenability/LocalBarrierTransport.lean @@ -0,0 +1,153 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Amenability.BarrierChartRefinement + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section LocalBarrierTransport +open Classical Set + +theorem inFlagLattice_add {D : ℕ} (hD : 0 < D) {p : ℝ×ℝ} + (hp : InFlagLattice D p) (u : CutRing×CutRing) : + InFlagLattice D (p+(ordinary u.1,ordinary u.2)) := by + obtain ⟨v,rfl⟩ := hp + have hD' : (D : ℝ) ≠ 0 := by exact_mod_cast Nat.ne_of_gt hD + refine ⟨(v.1+D*u.1,v.2+D*u.2),?_⟩ + apply Prod.ext <;> simp only [scaledOrdinary,map_add,map_mul,map_natCast,Prod.fst_add,Prod.snd_add] <;> field_simp + +theorem mem_barrierSubdivision_interior {a m : ℕ} (ha : 0 < a) (i : Fin m) + {j : Fin 4} {c : CutRing} {N : ℝ} (hc : c ∈ barrierCandidate a j N) + (M : Finset (FlagSite a m (commonVertexDenominator a) (barrierFlagDirection ha j))) + {s : ℝ} (hp : barrierLinePoint a j c s ∈ squareInterior) : + s ∈ barrierSubdivision ha i j c M ↔ + ∃z ∈ M,z.val.1=i ∧ barrierSitePoint z=barrierLinePoint a j c s := by + have hs := (barrierLinePoint_interior_iff hc s).mp hp + simp only [barrierSubdivision,Finset.mem_union,Finset.mem_insert,Finset.mem_singleton] + have hlo : s ≠ barrierLineLower a j c := ne_of_gt hs.1 + have hhi : s ≠ barrierLineUpper a j c := ne_of_lt hs.2 + simp only [hlo,hhi,false_or] + constructor + · intro h + obtain ⟨z,hz,he⟩ := Finset.mem_image.mp h + obtain ⟨hzM,hzi,hzp,hzc⟩ := Finset.mem_filter.mp hz + refine ⟨z,hzM,hzi,?_⟩ + rw [←he,barrierLinePoint_parameter hzc] + · rintro ⟨z,hz,hzi,hzp⟩ + apply Finset.mem_image.mpr + refine ⟨z,Finset.mem_filter.mpr ⟨hz,hzi,?_,?_⟩,?_⟩ + · rwa [hzp] + · rw [hzp,cutForm_barrierLinePoint] + · rw [hzp,barrierLineParameter_point] + +theorem barrierSubdivision_site_before_upper {a m : ℕ} (ha : 0 < a) (i : Fin m) + {j : Fin 4} {c : CutRing} {N : ℝ} (hc : c ∈ barrierCandidate a j N) + (M : Finset (FlagSite a m (commonVertexDenominator a) (barrierFlagDirection ha j))) + {s : ℝ} (hs : s ∈ barrierSubdivision ha i j c M) + (hsU : s < barrierLineUpper a j c) : + ∃z : FlagSite a m (commonVertexDenominator a) (barrierFlagDirection ha j), + z.val.1=i ∧ barrierSitePoint z=barrierLinePoint a j c s := by + simp only [barrierSubdivision,Finset.mem_union,Finset.mem_insert,Finset.mem_singleton] at hs + rcases hs with (rfl | rfl) | hs + · exact ⟨barrierIncomingSite ha i hc,rfl,rfl⟩ + · exact False.elim (lt_irrefl _ hsU) + · obtain ⟨z,hz,rfl⟩ := Finset.mem_image.mp hs + obtain ⟨_,hzi,_,hzline⟩ := Finset.mem_filter.mp hz + exact ⟨z,hzi,(barrierLinePoint_parameter hzline).symm⟩ + +namespace BarrierSignalSystem +variable {a : ℕ} {ha : 0 < a} {Q B : ℝ} (S : BarrierSignalSystem a ha Q B) + +theorem local_line_transport {m : ℕ} (g : polygonFullGroup a m) (i k : Fin m) + {N : ℝ} (hN : 0 < N) (j : Fin 4) (c : CutRing) (u : CutRing×CutRing) + (hc : c ∈ barrierCandidate a j N) + (hc' : c+integralCutForm a j u ∈ barrierCandidate a j N) + (b₁ b₂ b₁' b₂' : FlagSite a m (commonVertexDenominator a) (barrierFlagDirection ha j) → Bool) + (hs : signalSuccess (flagMeanSignal S.first.signal N) b₁) + (hs' : signalSuccess (flagMeanSignal S.first.signal N) b₁') + (hb₁ : ∀z,b₁' (flagSiteAction (commonVertexDenominator_pos ha) g z)=b₁ z) + (hb₂ : ∀z,b₂' (flagSiteAction (commonVertexDenominator_pos ha) g z)=b₂ z) + (L U : ℝ) + (hinside : ∀r ∈ Ioo L U,barrierLinePoint a j c r ∈ squareInterior ∧ + barrierLinePoint a j (c+integralCutForm a j u) + (r+barrierLineParameter j (ordinary u.1,ordinary u.2)) ∈ squareInterior) + (hU : U ≤ barrierLineUpper a j c) + (hL : L ∈ barrierSubdivision ha i j c (S.marks hN j b₁)) + (hT : U ∈ barrierSubdivision ha i j c (S.marks hN j b₁)) + (hL' : L+barrierLineParameter j (ordinary u.1,ordinary u.2) ∈ + barrierSubdivision ha k j (c+integralCutForm a j u) (S.marks hN j b₁')) + (hT' : U+barrierLineParameter j (ordinary u.1,ordinary u.2) ∈ + barrierSubdivision ha k j (c+integralCutForm a j u) (S.marks hN j b₁')) + (hchart : ∀(r : ℝ),r ∈ Ico L U → + ∀z : FlagSite a m (commonVertexDenominator a) (barrierFlagDirection ha j), + z.val.1=i → barrierSitePoint z=barrierLinePoint a j c r → + flagAffineData g i z.val.2=(k,u)) + {x : ℝ} (hx : x ∈ Ioo L U) : + x ∈ subdivisionBarrier (barrierSubdivision ha i j c (S.marks hN j b₁)) + (barrierActivation ha i j c b₂) ↔ + x+barrierLineParameter j (ordinary u.1,ordinary u.2) ∈ + subdivisionBarrier (barrierSubdivision ha k j (c+integralCutForm a j u) (S.marks hN j b₁')) + (barrierActivation ha k j (c+integralCutForm a j u) b₂') := by + let d := barrierLineParameter j (ordinary u.1,ordinary u.2) + have haction (r : ℝ) (hr : r ∈ Ico L U) + (z : FlagSite a m (commonVertexDenominator a) (barrierFlagDirection ha j)) + (hzi : z.val.1=i) (hzp : barrierSitePoint z=barrierLinePoint a j c r) : + (flagSiteAction (commonVertexDenominator_pos ha) g z).val.1=k ∧ + barrierSitePoint (flagSiteAction (commonVertexDenominator_pos ha) g z)= + barrierLinePoint a j (c+integralCutForm a j u) (r+d) := by + have hh := flagAffineData_action g z.val + rw [hzi,hchart r hr z hzi hzp] at hh + refine ⟨hh.1,?_⟩ + change (flagAction g z.val).2.val=_ + rw [hh.2] + change barrierSitePoint z+_= _ + rw [hzp,barrierLinePoint_translate] + apply subdivisionBarrier_translate_iff hL hT hL' hT' _ _ hx + · intro r hr + by_cases heL : r=L + · subst r + exact iff_of_true hL hL' + by_cases heU : r=U + · subst r + exact iff_of_true hT hT' + have hr' : r ∈ Ioo L U := ⟨lt_of_le_of_ne hr.1 (Ne.symm heL),lt_of_le_of_ne hr.2 heU⟩ + obtain ⟨hp,hp'⟩ := hinside r hr' + rw [mem_barrierSubdivision_interior ha i hc _ hp, + mem_barrierSubdivision_interior ha k hc' _ hp'] + constructor + · rintro ⟨z,hz,hzi,hzp⟩ + obtain ⟨hwi,hwp⟩ := haction r ⟨hr'.1.le,hr'.2⟩ z hzi hzp + refine ⟨flagSiteAction (commonVertexDenominator_pos ha) g z,?_,hwi,hwp⟩ + rw [S.mem_marks_iff hN j b₁' hs',hb₁] + exact (S.mem_marks_iff hN j b₁ hs z).mp hz + · rintro ⟨w,hw,hwk,hwp⟩ + have hlat : InFlagLattice (commonVertexDenominator a) (barrierLinePoint a j c r) := by + have hh := inFlagLattice_add (commonVertexDenominator_pos ha) w.property (-u) + change InFlagLattice _ (barrierSitePoint w+_) at hh + rw [hwp,barrierLinePoint_translate] at hh + simpa only [Prod.fst_neg,Prod.snd_neg,map_neg,←Prod.neg_mk,add_neg_cancel_right] using hh + let z := barrierInteriorSite ha i j hp hlat + obtain ⟨hwi,hwp'⟩ := haction r ⟨hr'.1.le,hr'.2⟩ z rfl rfl + have hew : flagSiteAction (commonVertexDenominator_pos ha) g z=w := + flagSite_eq_of_track_point (hwi.trans hwk.symm) (hwp'.trans hwp.symm) + refine ⟨z,?_,rfl,rfl⟩ + rw [S.mem_marks_iff hN j b₁ hs,←hb₁,hew] + exact (S.mem_marks_iff hN j b₁' hs' w).mp hw + · intro r hr hrLU + obtain ⟨z,hzi,hzp⟩ := barrierSubdivision_site_before_upper ha i hc _ hr (hrLU.2.trans_le hU) + obtain ⟨hwi,hwp⟩ := haction r hrLU z hzi hzp + rw [barrierActivation_at_site ha i j c b₂ r z hzi hzp, + barrierActivation_at_site ha k j (c+integralCutForm a j u) b₂' _ _ hwi hwp,hb₂] + +end BarrierSignalSystem +end LocalBarrierTransport + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Amenability/PartitionArrows.lean b/lean/OAI/GroupTheory/SimpleAmenable/Amenability/PartitionArrows.lean new file mode 100644 index 0000000000000000000000000000000000000000..a376073c98f2ab27a67958de69a4fdc02ed6e997 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Amenability/PartitionArrows.lean @@ -0,0 +1,98 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Amenability.BarrierCells + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section PartitionArrows +open Classical Set + +abbrev TrackPolygonPartition (a m : ℕ) := Fin m → FinitePolygonPartition a +abbrev PartitionCell {a m : ℕ} (P : TrackPolygonPartition a m) := Σi : Fin m,↥(P i).cells + +noncomputable def partitionCellSet {a m : ℕ} {P : TrackPolygonPartition a m} + (c : PartitionCell P) : Set (TrackPoint a m) := {x | x.1=c.1 ∧ x.2∈c.2.val.val} + +theorem partitionCellSet_nonempty {a m : ℕ} {P : TrackPolygonPartition a m} + (c : PartitionCell P) : (partitionCellSet c).Nonempty := by + obtain ⟨p,hp⟩ := (P c.1).nonempty c.2.val c.2.property + exact ⟨(c.1,p),rfl,hp⟩ + +theorem partitionCellSet_cover {a m : ℕ} (P : TrackPolygonPartition a m) (x : TrackPoint a m) : + ∃!c : PartitionCell P,x∈partitionCellSet c := by + obtain ⟨C,⟨hC,hx⟩,hu⟩ := (P x.1).cover x.2 + refine ⟨⟨x.1,⟨C,hC⟩⟩,⟨rfl,hx⟩,?_⟩ + rintro ⟨i,D,hD⟩ ⟨hi,hxD⟩ + dsimp at hi + subst i + have he := hu D ⟨hD,hxD⟩ + subst D + rfl + +theorem partitionCellSet_eq_of_mem {a m : ℕ} {P : TrackPolygonPartition a m} + {c d : PartitionCell P} {x : TrackPoint a m} + (hc : x∈partitionCellSet c) (hd : x∈partitionCellSet d) : c=d := + (partitionCellSet_cover P x).unique hc hd + +def PartitionArrow {a m : ℕ} (P Q : TrackPolygonPartition a m) (g : polygonFullGroup a m) : Prop := + ∀c : PartitionCell P,∃d : PartitionCell Q, + g.val '' partitionCellSet c=partitionCellSet d ∧ ∃u : CutRing×CutRing, + ∀x∈partitionCellSet c,(g.val x).2.val=x.2.val+(ordinary u.1,ordinary u.2) + +namespace PartitionArrow +variable {a m : ℕ} {P Q R : TrackPolygonPartition a m} {g h : polygonFullGroup a m} + +theorem one (P : TrackPolygonPartition a m) : PartitionArrow P P 1 := by + intro c + refine ⟨c,?_,0,?_⟩ + · exact Set.image_id _ + · intro x _ + change x.2.val=x.2.val+(ordinary (0:CutRing),ordinary (0:CutRing)) + simp only [map_zero] + exact (add_zero x.2.val).symm + +theorem mul (hg : PartitionArrow Q R g) (hh : PartitionArrow P Q h) : PartitionArrow P R (g*h) := by + intro c + obtain ⟨d,hd,u,hu⟩ := hh c + obtain ⟨e,he,v,hv⟩ := hg d + refine ⟨e,?_,u+v,?_⟩ + · change (g.val ∘ h.val) '' partitionCellSet c=partitionCellSet e + exact (Set.image_image g.val h.val (partitionCellSet c)).symm.trans (by rw [hd,he]) + · intro x hx + have hhx : h.val x∈partitionCellSet d := by rw [←hd]; exact ⟨x,hx,rfl⟩ + change (g.val (h.val x)).2.val=x.2.val+_ + rw [hv _ hhx,hu _ hx] + simp only [Prod.fst_add,Prod.snd_add,map_add,Prod.mk_add_mk,add_assoc] + +theorem inv (hg : PartitionArrow P Q g) : PartitionArrow Q P g⁻¹ := by + intro d + obtain ⟨y,hy⟩ := partitionCellSet_nonempty d + obtain ⟨c,hc,-⟩ := partitionCellSet_cover P (g.val.symm y) + obtain ⟨e,he,u,hu⟩ := hg c + have hye : y∈partitionCellSet e := by rw [←he]; exact ⟨g.val.symm y,hc,g.val.apply_symm_apply y⟩ + have hde : d=e := partitionCellSet_eq_of_mem hy hye + subst e + refine ⟨c,?_, -u,?_⟩ + · rw [←he] + exact g.val.symm_image_image _ + · intro x hx + obtain ⟨w,hw,rfl⟩ := (Set.mem_image g.val _ _).mp (he.symm ▸ hx) + have h := hu w hw + change (g.val.symm (g.val w)).2.val=(g.val w).2.val+_ + rw [g.val.symm_apply_apply,h] + simp only [Prod.fst_neg,Prod.snd_neg,map_neg] + apply Prod.ext <;> simp only [Prod.fst_add,Prod.snd_add] <;> ring + +end PartitionArrow +end PartitionArrows + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Amenability/SubgroupTestReiter.lean b/lean/OAI/GroupTheory/SimpleAmenable/Amenability/SubgroupTestReiter.lean new file mode 100644 index 0000000000000000000000000000000000000000..ca786736cee4dd84080a35f6049373c4cae53d40 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Amenability/SubgroupTestReiter.lean @@ -0,0 +1,97 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.PolygonMatchingLaw + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section SubgroupTestReiter +open Classical Set + +noncomputable def subgroupOrbitSetoid {G : Type*} [Group G] (H : Subgroup G) : Setoid G where + r x y := ∃h : H,(h:G)*x=y + iseqv := ⟨fun x => ⟨1,by simp⟩,by + rintro x y ⟨h,hh⟩ + refine ⟨h⁻¹,?_⟩ + rw [←hh] + simp,by + rintro x y z ⟨h,hh⟩ ⟨k,hk⟩ + refine ⟨k*h,?_⟩ + change (k:G)*(h:G)*x=z + rw [mul_assoc,hh,hk]⟩ + +noncomputable def subgroupOrbitBase {G : Type*} [Group G] (H : Subgroup G) (x : G) : G := + (Quotient.mk (subgroupOrbitSetoid H) x).out + +theorem subgroupOrbitBase_spec {G : Type*} [Group G] (H : Subgroup G) (x : G) : + ∃h : H,(h:G)*subgroupOrbitBase H x=x := + Quotient.exact (Quotient.out_eq (Quotient.mk (subgroupOrbitSetoid H) x)) + +noncomputable def subgroupCoordinate {G : Type*} [Group G] (H : Subgroup G) (x : G) : H := + (subgroupOrbitBase_spec H x).choose + +theorem subgroupCoordinate_spec {G : Type*} [Group G] (H : Subgroup G) (x : G) : + (subgroupCoordinate H x:G)*subgroupOrbitBase H x=x := (subgroupOrbitBase_spec H x).choose_spec + +theorem subgroupCoordinate_mul {G : Type*} [Group G] (H : Subgroup G) (k : H) (x : G) : + subgroupCoordinate H ((k:G)*x)=k*subgroupCoordinate H x := by + have hb : subgroupOrbitBase H x=subgroupOrbitBase H ((k:G)*x) := + congrArg Quotient.out (Quotient.sound (s:=subgroupOrbitSetoid H) ⟨k,rfl⟩) + apply Subtype.ext + apply mul_right_cancel (b:=subgroupOrbitBase H ((k:G)*x)) + rw [subgroupCoordinate_spec] + change (k:G)*x=((k:G)*(subgroupCoordinate H x:G))*subgroupOrbitBase H ((k:G)*x) + rw [←hb,mul_assoc,subgroupCoordinate_spec] + +theorem finite_weights_push {X Y : Type*} (S : Finset X) (p : X → ℝ) (π : X → Y) + (hp : ∀x,0 ≤ p x) (hm : (∑x∈S,p x)=1) : + ∃(T : Finset Y) (q : Y → ℝ),(∀y,0 ≤ q y) ∧ (∀y∉T,q y=0) ∧ (∑y∈T,q y)=1 ∧ + ∀f : Y → ℝ,(∑y∈T,q y*f y)=∑x∈S,p x*f (π x) := by + obtain ⟨T,q,hq,hs,ht,havg⟩ := finite_uniform_mixture S p (fun x => {π x}) + (fun x _ => hp x) hm (fun _ _ => Finset.singleton_nonempty _) + refine ⟨T,q,hq,hs,ht,?_⟩ + intro f + simpa using havg f + +theorem FiniteTestReiter.subgroup {G : Type*} [Group G] (h : FiniteTestReiter G) + (H : Subgroup G) : FiniteTestReiter H := by + intro K ε hε + obtain ⟨S,p,hp,hs,hm,ht⟩ := h (K.image (fun k : H => (k:G))) ε hε + obtain ⟨T,q,hq,hT,hM,havg⟩ := finite_weights_push S p (subgroupCoordinate H) hp hm + refine ⟨T,q,hq,hT,hM,?_⟩ + intro k hk f hf + rw [havg,havg] + have hh := ht (k:G) (Finset.mem_image_of_mem (fun k : H => (k:G)) hk) + (fun x => f (subgroupCoordinate H x)) (fun x => hf (subgroupCoordinate H x)) + simpa only [subgroupCoordinate_mul] using hh + +end SubgroupTestReiter + +section PolygonAmenability + +theorem polygonFullGroup_folner {a m : ℕ} (ha : 0 < a) : + FolnerAmenable (polygonFullGroup a m) := + folner_of_finite_reiter (finiteSupportReiter_of_finiteTestReiter (polygonFullGroup_finiteTestReiter ha)) + +theorem polygonAlternatingGroup_folner {a m : ℕ} (ha : 0 < a) : + FolnerAmenable (polygonAlternatingGroup a m) := + folner_of_finite_reiter (finiteSupportReiter_of_finiteTestReiter + ((polygonFullGroup_finiteTestReiter ha).subgroup (polygonAlternatingGroup a m))) + +theorem polygon_infinite_simple_folner {a m : ℕ} (ha : 0 < a) (hm : 15 ≤ m) : + Infinite (polygonAlternatingGroup a m) ∧ IsSimpleGroup (polygonAlternatingGroup a m) ∧ + FolnerAmenable (polygonAlternatingGroup a m) := + ⟨polygonAlternatingGroup_infinite a m (by omega),polygonAlternatingGroup_simple a m hm, + polygonAlternatingGroup_folner ha⟩ + +end PolygonAmenability + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Amenability/SuccessfulLawCovariance.lean b/lean/OAI/GroupTheory/SimpleAmenable/Amenability/SuccessfulLawCovariance.lean new file mode 100644 index 0000000000000000000000000000000000000000..ef34f96b7ed298b6ee837dd0b271beead5059f65 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Amenability/SuccessfulLawCovariance.lean @@ -0,0 +1,205 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Amenability.FiniteCoarea +import OAI.GroupTheory.SimpleAmenable.Amenability.UniformShapeMatchings + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section SuccessfulLawCovariance +open Classical MeasureTheory Set + +theorem successful_law_covariance {X : Type*} [MeasurableSpace X] [MeasurableSingletonClass X] + (μ : Measure X) [IsProbabilityMeasure μ] (T : Finset X) (hT : ∀ᵐx ∂μ,x∈T) + (t : X → X) (ht : Measurable t) (S : Set X) (hS : MeasurableSet S) + {ε : ℝ} (hc : ObservableClose μ (μ.map t) ε) + (f g : X → ℝ) (hf : ∀x,f x∈Icc (0:ℝ) 1) (hg : ∀x,g x∈Icc (0:ℝ) 1) + (he : ∀x,x∈S → t x∈S → f (t x)=g x) : + |(∫x,f x ∂μ)-(∫x,g x ∂μ)| ≤ 2*μ.real Sᶜ+2*ε := by + let ν := μ.map t + let : IsProbabilityMeasure ν := inferInstance + let U := T.image t + have hU : ∀ᵐx ∂ν,x∈U := by + apply (ae_map_iff ht.aemeasurable U.measurableSet).mpr + filter_upwards [hT] with x hx + exact Finset.mem_image_of_mem t hx + have hic := hc.finiteSupport T U hT hU f hf + have hmap : (∫x,f x ∂ν)=∫x,f (t x) ∂μ := + integral_map ht.aemeasurable (integrable_of_finite_support ν U hU f).aestronglyMeasurable + rw [hmap] at hic + let E := Sᶜ ∪ t ⁻¹' Sᶜ + have hE : MeasurableSet E := hS.compl.union (ht hS.compl) + have hd := integral_difference_le_failure μ T hT (fun x => f (t x)) g + (fun x => hf (t x)) hg E hE (by + intro x hx + have hx' : x∈S ∧ t x∈S := by simpa [E] using hx + exact he x hx'.1 hx'.2) + have hb := hc.event hS.compl + have hreal : ν.real Sᶜ=μ.real (t ⁻¹' Sᶜ) := map_measureReal_apply ht hS.compl + have hbound : μ.real E ≤ 2*μ.real Sᶜ+ε := by + have hu : μ.real E ≤ μ.real Sᶜ+μ.real (t ⁻¹' Sᶜ) := + measureReal_union_le (μ:=μ) Sᶜ (t ⁻¹' Sᶜ) + have ht' := (abs_le.mp hb).1 + change -ε ≤ μ.real Sᶜ-ν.real Sᶜ at ht' + rw [hreal] at ht' + linarith + have htri := abs_sub_le (∫x,f x ∂μ) (∫x,f (t x) ∂μ) (∫x,g x ∂μ) + linarith + +end SuccessfulLawCovariance + +section FiniteMixtureWeights +open Classical + +noncomputable def finiteUniformWeight {G : Type*} (U : Finset G) (x : G) : ℝ := + if x∈U then (1:ℝ)/U.card else 0 + +theorem finiteUniformWeight_nonneg {G : Type*} (U : Finset G) (x : G) : + 0 ≤ finiteUniformWeight U x := by unfold finiteUniformWeight; split_ifs <;> positivity + +theorem finiteUniformWeight_sum {G : Type*} (S U : Finset G) (hUS : U ⊆ S) (f : G → ℝ) : + (∑x∈S,finiteUniformWeight U x*f x)=(∑x∈U,f x)/U.card := by + calc + _ = ∑x∈U,finiteUniformWeight U x*f x := by + symm + apply Finset.sum_subset hUS + intro x hx hxU + simp [finiteUniformWeight,hxU] + _ = ∑x∈U,f x/(U.card:ℝ) := by + apply Finset.sum_congr rfl + intro x hx + simp [finiteUniformWeight,hx,div_eq_mul_inv,mul_comm] + _ = _ := by rw [Finset.sum_div] + +theorem finite_uniform_mixture {X G : Type*} (T : Finset X) (w : X → ℝ) (U : X → Finset G) + (hw : ∀x∈T,0 ≤ w x) (hmass : (∑x∈T,w x)=1) (hU : ∀x∈T,(U x).Nonempty) : + ∃ (S : Finset G) (p : G → ℝ), (∀g,0 ≤ p g) ∧ (∀g∉S,p g=0) ∧ (∑g∈S,p g)=1 ∧ + ∀f : G → ℝ,(∑g∈S,p g*f g)=∑x∈T,w x*((∑g∈U x,f g)/(U x).card) := by + let S := T.biUnion U + let p := fun g => ∑x∈T,w x*finiteUniformWeight (U x) g + have hcontains (x : X) (hx : x∈T) : U x ⊆ S := by + intro g hg + exact Finset.mem_biUnion.mpr ⟨x,hx,hg⟩ + have htest (f : G → ℝ) : (∑g∈S,p g*f g)=∑x∈T,w x*((∑g∈U x,f g)/(U x).card) := by + simp only [p,Finset.sum_mul] + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro x hx + simp only [mul_assoc] + rw [←Finset.mul_sum,finiteUniformWeight_sum S (U x) (hcontains x hx)] + refine ⟨S,p,fun g => Finset.sum_nonneg (fun x hx => mul_nonneg (hw x hx) + (finiteUniformWeight_nonneg (U x) g)),?_,?_,htest⟩ + · intro g hg + apply Finset.sum_eq_zero + intro x hx + have hgU : g∉U x := fun h => hg (hcontains x hx h) + simp [finiteUniformWeight,hgU] + · have hh := htest (fun _ => 1) + simp only [mul_one,Finset.sum_const,nsmul_eq_mul,mul_one] at hh + rw [hh] + calc + (∑x∈T,w x*(((U x).card:ℝ)/(U x).card)) = ∑x∈T,w x := by + apply Finset.sum_congr rfl + intro x hx + have hcard : ((U x).card:ℝ)≠0 := by exact_mod_cast (hU x hx).card_pos.ne' + field_simp + _ = 1 := hmass + +end FiniteMixtureWeights + +section FiniteTestReiter +open Classical Set + +def FiniteTestReiter (G : Type*) [Group G] : Prop := + ∀K : Finset G,∀δ : ℝ,0 < δ → ∃(S : Finset G) (p : G → ℝ), + (∀x,0 ≤ p x) ∧ (∀x∉S,p x=0) ∧ (∑x∈S,p x)=1 ∧ + ∀k∈K,∀f : G → ℝ,(∀x,f x∈Icc (0:ℝ) 1) → + |(∑x∈S,p x*f x)-(∑x∈S,p x*f (k*x))| ≤ δ + +theorem sum_support_window {G : Type*} (S W : Finset G) (p f : G → ℝ) + (hS : S ⊆ W) (hp : ∀x∉S,p x=0) : + (∑x∈W,p x*f x)=∑x∈S,p x*f x := by + symm + apply Finset.sum_subset hS + intro x hx hn + simp [hp x hn] + +theorem sum_translate_window {G : Type*} [Group G] (S W : Finset G) (p f : G → ℝ) (k : G) + (hS : S.image (fun x => k*x) ⊆ W) (hp : ∀x∉S,p x=0) : + (∑x∈W,p (k⁻¹*x)*f x)=∑x∈S,p x*f (k*x) := by + calc + _ = ∑x∈S.image (fun y => k*y),p (k⁻¹*x)*f x := by + symm + apply Finset.sum_subset hS + intro x hx hn + have hx' : k⁻¹*x∉S := by + intro hh + exact hn (Finset.mem_image.mpr ⟨k⁻¹*x,hh,by group⟩) + simp [hp _ hx'] + _ = _ := by + rw [Finset.sum_image] + · apply Finset.sum_congr rfl + intro x hx + simp + · intro x hx y hy he + exact mul_left_cancel he + +theorem finite_test_l1_bound {G : Type*} [Group G] (S W : Finset G) (p : G → ℝ) (k : G) + (hS : S ⊆ W) (hkS : S.image (fun x => k*x) ⊆ W) (hp : ∀x∉S,p x=0) + (δ : ℝ) (htest : ∀f : G → ℝ,(∀x,f x∈Icc (0:ℝ) 1) → + |(∑x∈S,p x*f x)-(∑x∈S,p x*f (k*x))| ≤ δ) : + (∑x∈W,|p (k⁻¹*x)-p x|) ≤ 2*δ := by + let d := fun x => p (k⁻¹*x)-p x + have hd (f : G → ℝ) (hf : ∀x,f x∈Icc (0:ℝ) 1) : |∑x∈W,d x*f x| ≤ δ := by + simp only [d,sub_mul,Finset.sum_sub_distrib] + rw [sum_translate_window S W p f k hkS hp,sum_support_window S W p f hS hp,abs_sub_comm] + exact htest f hf + let fpos := fun x => if 0 ≤ d x then (1:ℝ) else 0 + let fneg := fun x => if 0 ≤ d x then (0:ℝ) else 1 + have hfpos : ∀x,fpos x∈Icc (0:ℝ) 1 := by intro x; dsimp [fpos]; split_ifs <;> norm_num + have hfneg : ∀x,fneg x∈Icc (0:ℝ) 1 := by intro x; dsimp [fneg]; split_ifs <;> norm_num + have he : (∑x∈W,|d x|)=(∑x∈W,d x*fpos x)-(∑x∈W,d x*fneg x) := by + rw [←Finset.sum_sub_distrib] + apply Finset.sum_congr rfl + intro x hx + by_cases h : 0 ≤ d x + · simp [fpos,fneg,h,abs_of_nonneg h] + · simp [fpos,fneg,h,abs_of_neg (lt_of_not_ge h)] + change (∑x∈W,|d x|) ≤ _ + rw [he] + linarith [(abs_le.mp (hd fpos hfpos)).2,(abs_le.mp (hd fneg hfneg)).1] + +theorem finiteSupportReiter_of_finiteTestReiter {G : Type*} [Group G] + (h : FiniteTestReiter G) : FiniteSupportReiter G := by + intro K ε hε + have hc : (0:ℝ)<2*(K.card:ℝ)+1 := by positivity + let δ := ε/(2*(K.card:ℝ)+1) + obtain ⟨S,p,hp,hs,hm,ht⟩ := h K δ (div_pos hε hc) + refine ⟨S,p,hp,hs,hm,?_⟩ + have hbound : weightedVariation K S p ≤ (K.card:ℝ)*(2*δ) := by + calc + _ ≤ ∑k∈K,2*δ := by + apply Finset.sum_le_sum + intro k hk + apply finite_test_l1_bound S (translationWindow K S) p k + (Finset.subset_union_left) _ hs δ (ht k hk) + intro x hx + exact Finset.mem_union_right _ (Finset.mem_biUnion.mpr ⟨k,hk,hx⟩) + _ = _ := by simp + apply lt_of_le_of_lt hbound + dsimp [δ] + rw [←mul_assoc,←mul_div_assoc] + apply (div_lt_iff₀ hc).mpr + nlinarith + +end FiniteTestReiter + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Amenability/UniformShapeMatchings.lean b/lean/OAI/GroupTheory/SimpleAmenable/Amenability/UniformShapeMatchings.lean new file mode 100644 index 0000000000000000000000000000000000000000..f47c2508b689b8ed50ae2a35d2208a4a1da560d4 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Amenability/UniformShapeMatchings.lean @@ -0,0 +1,182 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Amenability.FinitePartitionArrows + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section UniformShapeMatchings +open Classical Set + +noncomputable def partitionShapeSetoid (a m : ℕ) : Setoid (TrackPolygonPartition a m) where + r P Q := ∃g : polygonFullGroup a m,PartitionArrow P Q g + iseqv := ⟨fun P => ⟨1,PartitionArrow.one P⟩, + fun ⟨g,hg⟩ => ⟨g⁻¹,hg.inv⟩, + fun ⟨g,hg⟩ ⟨h,hh⟩ => ⟨h*g,hh.mul hg⟩⟩ + +noncomputable def partitionBaseline {a m : ℕ} (P : TrackPolygonPartition a m) : TrackPolygonPartition a m := + (Quotient.mk (partitionShapeSetoid a m) P).out + +theorem partitionBaseline_related {a m : ℕ} (P : TrackPolygonPartition a m) : + ∃g : polygonFullGroup a m,PartitionArrow (partitionBaseline P) P g := + Quotient.exact (Quotient.out_eq (Quotient.mk (partitionShapeSetoid a m) P)) + +theorem partitionBaseline_eq {a m : ℕ} {P Q : TrackPolygonPartition a m} {g : polygonFullGroup a m} + (hg : PartitionArrow P Q g) : partitionBaseline P=partitionBaseline Q := + congrArg Quotient.out (Quotient.sound (s:=partitionShapeSetoid a m) ⟨g,hg⟩) + +noncomputable def matchingSupport {a m : ℕ} (P : TrackPolygonPartition a m) : Finset (polygonFullGroup a m) := + (show Set.Finite {g : polygonFullGroup a m | PartitionArrow (partitionBaseline P) P g} from + @Set.toFinite _ _ (PartitionArrow.arrows_finite (partitionBaseline P) P)).toFinset + +@[simp] theorem mem_matchingSupport {a m : ℕ} (P : TrackPolygonPartition a m) (g : polygonFullGroup a m) : + g∈matchingSupport P ↔ PartitionArrow (partitionBaseline P) P g := Set.Finite.mem_toFinset _ + +theorem matchingSupport_nonempty {a m : ℕ} (P : TrackPolygonPartition a m) : (matchingSupport P).Nonempty := by + obtain ⟨g,hg⟩ := partitionBaseline_related P + exact ⟨g,(mem_matchingSupport P g).mpr hg⟩ + +theorem matchingSupport_transport {a m : ℕ} {P Q : TrackPolygonPartition a m} {g : polygonFullGroup a m} + (hg : PartitionArrow P Q g) : matchingSupport Q=(matchingSupport P).image (fun x => g*x) := by + have hb := partitionBaseline_eq hg + ext h + simp only [Finset.mem_image,mem_matchingSupport] + constructor + · intro hh + refine ⟨g⁻¹*h,?_,by group⟩ + have h := hg.inv.mul hh + rwa [←hb] at h + · rintro ⟨x,hx,rfl⟩ + have h := hg.mul hx + rwa [hb] at h + +noncomputable def matchingAverage {a m : ℕ} (P : TrackPolygonPartition a m) + (f : polygonFullGroup a m → ℝ) : ℝ := + (∑x∈matchingSupport P,f x)/(matchingSupport P).card + +theorem matchingAverage_range {a m : ℕ} (P : TrackPolygonPartition a m) + {f : polygonFullGroup a m → ℝ} (hf : ∀x,f x∈Icc (0:ℝ) 1) : matchingAverage P f∈Icc (0:ℝ) 1 := by + have hc : (0:ℝ)<(matchingSupport P).card := by exact_mod_cast (matchingSupport_nonempty P).card_pos + refine ⟨div_nonneg (Finset.sum_nonneg (fun x _ => (hf x).1)) hc.le,?_⟩ + apply (div_le_one hc).mpr + calc + (∑x∈matchingSupport P,f x) ≤ ∑_x∈matchingSupport P,(1:ℝ) := Finset.sum_le_sum (fun x _ => (hf x).2) + _ = _ := by simp + +theorem matchingAverage_transport {a m : ℕ} {P Q : TrackPolygonPartition a m} {g : polygonFullGroup a m} + (hg : PartitionArrow P Q g) (f : polygonFullGroup a m → ℝ) : + matchingAverage Q f=matchingAverage P (fun x => f (g*x)) := by + unfold matchingAverage + rw [matchingSupport_transport hg,Finset.card_image_of_injective _ (fun _ _ h => mul_left_cancel h),Finset.sum_image] + intro _ _ _ _ equality + exact mul_left_cancel equality + +end UniformShapeMatchings + +section FiniteSupportedLaws +open Classical MeasureTheory Set + +theorem finset_indicator_measurable {X : Type*} [MeasurableSpace X] [MeasurableSingletonClass X] + (T : Finset X) (f : X → ℝ) : Measurable ((T : Set X).indicator f) := by + apply measurable_zero.measurable_of_countable_ne + apply T.finite_toSet.countable.mono + intro x hx + by_contra hn + exact hx (by simp [hn]) + +theorem integrable_of_finite_support {X : Type*} [MeasurableSpace X] [MeasurableSingletonClass X] + (μ : Measure X) [IsFiniteMeasure μ] (T : Finset X) (hT : ∀ᵐx ∂μ,x∈T) (f : X → ℝ) : + Integrable f μ := by + have hi : Integrable ((T : Set X).indicator f) μ := by + have he : (T : Set X).indicator f=fun x => ∑z∈T,({z} : Set X).indicator (fun _ => f z) x := by + funext x + by_cases hx : x∈T + · simp only [Set.indicator_of_mem hx] + symm + rw [Finset.sum_eq_single x] + · simp + · intro _ _ distinct + simp [Set.indicator_of_notMem,Ne.symm distinct] + · exact fun hn => (hn hx).elim + · simp only [Set.indicator_of_notMem hx] + symm + apply Finset.sum_eq_zero + intro z hz + have hz' : x≠z := fun h => hx (h.symm ▸ hz) + simp [hz'] + rw [he] + apply integrable_finsetSum + intro point _ + exact (integrable_const (f point)).indicator (measurableSet_singleton point) + apply hi.congr + filter_upwards [hT] with x hx + simp [hx] + +theorem integral_of_finite_support {X : Type*} [MeasurableSpace X] [MeasurableSingletonClass X] + (μ : Measure X) [IsFiniteMeasure μ] (T : Finset X) (hT : ∀ᵐx ∂μ,x∈T) (f : X → ℝ) : + (∫x,f x ∂μ)=∑x∈T,μ.real {x}*f x := by + have he : f=ᵐ[μ] fun x => ∑z∈T,({z} : Set X).indicator (fun _ => f z) x := by + filter_upwards [hT] with x hx + symm + rw [Finset.sum_eq_single x] + · simp + · intro _ _ distinct + simp [Set.indicator_of_notMem,Ne.symm distinct] + · exact fun hn => (hn hx).elim + rw [integral_congr_ae he,integral_finsetSum T (fun z _ => + (integrable_const (f z)).indicator (measurableSet_singleton z))] + apply Finset.sum_congr rfl + intro point _ + rw [integral_indicator_const (f point) (measurableSet_singleton point)] + rfl + +theorem ObservableClose.finiteSupport {X : Type*} [MeasurableSpace X] [MeasurableSingletonClass X] + {μ ν : Measure X} (T U : Finset X) (hT : ∀ᵐx ∂μ,x∈T) (hU : ∀ᵐx ∂ν,x∈U) + {ε : ℝ} (h : ObservableClose μ ν ε) (f : X → ℝ) (hf : ∀x,f x∈Icc (0:ℝ) 1) : + |(∫x,f x ∂μ)-(∫x,f x ∂ν)| ≤ ε := by + let V := T∪U + let f' := (V : Set X).indicator f + have heμ : f'=ᵐ[μ] f := by + filter_upwards [hT] with x hx + exact Set.indicator_of_mem (Finset.mem_union_left U hx) f + have heν : f'=ᵐ[ν] f := by + filter_upwards [hU] with x hx + exact Set.indicator_of_mem (Finset.mem_union_right T hx) f + have hh := h f' (finset_indicator_measurable V f) (by + intro x + by_cases hx : x∈V + · simpa only [f',Set.indicator_of_mem hx] using hf x + · simp [f',hx]) + rwa [integral_congr_ae heμ,integral_congr_ae heν] at hh + +theorem integral_difference_le_failure {X : Type*} [MeasurableSpace X] [MeasurableSingletonClass X] + (μ : Measure X) [IsFiniteMeasure μ] (T : Finset X) (hT : ∀ᵐx ∂μ,x∈T) + (f g : X → ℝ) (hf : ∀x,f x∈Icc (0:ℝ) 1) (hg : ∀x,g x∈Icc (0:ℝ) 1) + (E : Set X) (hE : MeasurableSet E) (he : ∀x,x∉E → f x=g x) : + |(∫x,f x ∂μ)-(∫x,g x ∂μ)| ≤ μ.real E := by + have hif := integrable_of_finite_support μ T hT f + have hig := integrable_of_finite_support μ T hT g + rw [←integral_sub hif hig] + calc + _ ≤ ∫x,|f x-g x| ∂μ := abs_integral_le_integral_abs + _ ≤ ∫x,E.indicator (fun _ => (1:ℝ)) x ∂μ := by + apply integral_mono (hif.sub hig).abs ((integrable_const 1).indicator hE) + intro x + by_cases hx : x∈E + · rw [Set.indicator_of_mem hx] + change |f x-g x| ≤ 1 + exact abs_le.mpr ⟨by linarith [(hf x).1,(hg x).2],by linarith [(hg x).1,(hf x).2]⟩ + · simp [Set.indicator_of_notMem hx,he x hx] + _ = μ.real E := by simp [integral_indicator hE,Measure.real] + +end FiniteSupportedLaws + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Arithmetic/CompiledTranslations.lean b/lean/OAI/GroupTheory/SimpleAmenable/Arithmetic/CompiledTranslations.lean new file mode 100644 index 0000000000000000000000000000000000000000..4b5c249ba260588a2d52563a6534f3db59bb9fd0 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Arithmetic/CompiledTranslations.lean @@ -0,0 +1,56 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.InitialCoverSystem + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section CompiledTranslations + +noncomputable def latticeWord {m : ℕ} + (k : Multiplicative (FreeAbelianGroup (Fin m × Fin 2))) : + FreeGroup (SourceGeneratorLabel m) := + FreeGroup.map (sourceTranslationLabel m) + (translationWordMap_surjective k).choose + +theorem latticeWord_eval {m : ℕ} {H : Type*} [Group H] + (f : SourceGeneratorLabel m → H) + (t : Multiplicative (FreeAbelianGroup (Fin m × Fin 2)) →* H) + (ht : ∀ i, t (Multiplicative.ofAdd (FreeAbelianGroup.of i)) = f (sourceTranslationLabel m i)) + (k : Multiplicative (FreeAbelianGroup (Fin m × Fin 2))) : + FreeGroup.lift f (latticeWord k) = t k := by + have he : (FreeGroup.lift f).comp (FreeGroup.map (sourceTranslationLabel m)) = + t.comp (translationWordMap (Fin m × Fin 2)) := by + ext i + simpa only [MonoidHom.comp_apply,FreeGroup.map.of,FreeGroup.lift_apply_of, + translationWordMap] using (ht i).symm + have hv := DFunLike.congr_fun he (translationWordMap_surjective k).choose + simpa only [MonoidHom.comp_apply,latticeWord,(translationWordMap_surjective k).choose_spec] using hv + +namespace InitialCoverSystem + +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + +theorem latticeWord_mk (k : Multiplicative (FreeAbelianGroup (Fin m × Fin 2))) : + PresentedGroup.mk (shortRelations M (alternatingGenerator a r m hm)) (latticeWord k) = B.t k := by + have he : FreeGroup.lift (PresentedGroup.of : SourceGeneratorLabel m → + BoundedRelationCover M (alternatingGenerator a r m hm)) = + PresentedGroup.mk (shortRelations M (alternatingGenerator a r m hm)) := by + ext i + rfl + rw [← he] + exact latticeWord_eval _ B.t B.t_base k + +end InitialCoverSystem +end CompiledTranslations + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Arithmetic/ConcurrentDenominators.lean b/lean/OAI/GroupTheory/SimpleAmenable/Arithmetic/ConcurrentDenominators.lean new file mode 100644 index 0000000000000000000000000000000000000000..5469b8206221e61871a151ef767626236584f195 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Arithmetic/ConcurrentDenominators.lean @@ -0,0 +1,174 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Arithmetic.PolygonArithmetic + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section ConcurrentDenominators + +noncomputable def lineNormal (a : ℕ) (j : Fin 4) : CutRing × CutRing := + ![(1,0),(0,1),(-(cutTau^a),1),(1,-(cutTau^a))] j + +noncomputable def lineDet (a : ℕ) (i j : Fin 4) : CutRing := + (lineNormal a i).1*(lineNormal a j).2-(lineNormal a j).1*(lineNormal a i).2 + +theorem cutForm_normal (a : ℕ) (j : Fin 4) (z : ℝ × ℝ) : + cutForm a j z = ordinary (lineNormal a j).1*z.1+ordinary (lineNormal a j).2*z.2 := by + fin_cases j <;> simp [cutForm,lineNormal] <;> ring + +theorem lineDet_ne_zero {a : ℕ} (ha : 0 fin_cases j <;> + simp_all [lineDet,lineNormal] + +theorem intersection_pair_denominator (a : ℕ) (i j : Fin 4) + (c d : CutRing) (z : ℝ × ℝ) + (hi : cutForm a i z = ordinary c) (hj : cutForm a j z = ordinary d) : + ∃ u v : CutRing, + ordinary u=((QuadraticAlgebra.norm (lineDet a i j) : ℤ) : ℝ)*z.1 ∧ + ordinary v=((QuadraticAlgebra.norm (lineDet a i j) : ℤ) : ℝ)*z.2 := by + let δ := lineDet a i j + let x := c*(lineNormal a j).2-d*(lineNormal a i).2 + let y := (lineNormal a i).1*d-(lineNormal a j).1*c + have hx : ordinary x=ordinary δ*z.1 := by + rw [cutForm_normal] at hi hj + simp only [x,δ,lineDet,map_sub,map_mul] + linear_combination -(ordinary (lineNormal a j).2)*hi+(ordinary (lineNormal a i).2)*hj + have hy : ordinary y=ordinary δ*z.2 := by + rw [cutForm_normal] at hi hj + simp only [y,δ,lineDet,map_sub,map_mul] + linear_combination -(ordinary (lineNormal a i).1)*hj+(ordinary (lineNormal a j).1)*hi + refine ⟨x*star δ,y*star δ,?_,?_⟩ <;> + simp only [map_mul,hx,hy,← conjugate_eq_ordinary_star] + · rw [← cut_norm_identity δ]; ring + · rw [← cut_norm_identity δ]; ring + +noncomputable def commonVertexDenominator (a : ℕ) : ℕ := + (∏ i : Fin 4, ∏ j : Fin 4, + if i=j then (1 : ℤ) else QuadraticAlgebra.norm (lineDet a i j)).natAbs + +theorem commonVertexDenominator_pos {a : ℕ} (ha : 0 ∏ j : Fin 4, if i=j then (1 : ℤ) else QuadraticAlgebra.norm (lineDet a i j)) + (Finset.mem_univ i) + have hj := Finset.dvd_prod_of_mem + (fun j : Fin 4 => if i=j then (1 : ℤ) else QuadraticAlgebra.norm (lineDet a i j)) + (Finset.mem_univ j) + have hh : QuadraticAlgebra.norm (lineDet a i j) ∣ + ∏ j : Fin 4, if i=j then (1 : ℤ) else QuadraticAlgebra.norm (lineDet a i j) := by + simpa only [ite_eq_right hij] using hj + exact hh.trans hi + +theorem all_intersections_common_denominator {a : ℕ} (_ha : 0 + simp only [map_mul,map_intCast,hu,hv,hkr] <;> ring + +end ConcurrentDenominators + +section VertexResidues + +noncomputable def cutResidue (D : ℕ) (z : CutRing) : CutRing := + ⟨z.re % (D : ℤ),z.im % (D : ℤ)⟩ +noncomputable def cutQuotient (D : ℕ) (z : CutRing) : CutRing := + ⟨z.re / (D : ℤ),z.im / (D : ℤ)⟩ + +theorem cut_residue_decomposition (D : ℕ) (z : CutRing) : + z = cutResidue D z + (D : CutRing)*cutQuotient D z := by + ext <;> simp [cutResidue,cutQuotient,Int.emod_add_mul_ediv] + +noncomputable def finiteCutResidue (D : ℕ) (t : Fin D × Fin D) : CutRing := + ⟨t.1.val,t.2.val⟩ + +theorem cutResidue_exists_finite {D : ℕ} (hD : 0 simp [cutResidue,finiteCutResidue,p,q,Int.emod_nonneg _ (ne_of_gt hDi)] + +noncomputable def vertexRepresentative (D : ℕ) + (t : (Fin D × Fin D) × (Fin D × Fin D)) : ℝ × ℝ := + (ordinary (finiteCutResidue D t.1)/(D : ℝ),ordinary (finiteCutResidue D t.2)/(D : ℝ)) + +theorem denominated_vertex_normal_form {D : ℕ} (hD : 0 lhs; rw [← Real.rpow_one (n:ℝ)] + rw [← Real.rpow_add hn₀] + norm_num + calc + _ ≤ (2*(n:ℝ))*((4*Real.log 2)^(-3/2:ℝ)*(n:ℝ)^(-3/2:ℝ)) := + mul_le_mul_of_nonneg_right (by linarith) hc + _ = _ := by rw [show (2*(n:ℝ))*((4*Real.log 2)^(-3/2:ℝ)*(n:ℝ)^(-3/2:ℝ))= + (2*(4*Real.log 2)^(-3/2:ℝ))*((n:ℝ)*(n:ℝ)^(-3/2:ℝ)) by ring,he] + +theorem sourceDyadicWeight_energy_tendsto : + Tendsto (fun n => ((sourceDyadicIndices n).card:ℝ)*(sourceDyadicWeight n)^2) atTop (nhds 0) := by + have ht : Tendsto (fun n : ℕ => (n:ℝ)^(-1/2:ℝ)) atTop (nhds 0) := by + convert (tendsto_rpow_neg_atTop (show (0:ℝ) < 1/2 by norm_num)).comp + (tendsto_natCast_atTop_atTop (R:=ℝ)) using 1 + norm_num + rfl + have ht' := ht.const_mul (2*(4*Real.log 2)^(-3/2:ℝ)) + simp only [mul_zero] at ht' + apply squeeze_zero' (Eventually.of_forall (fun n => mul_nonneg (Nat.cast_nonneg _) (sq_nonneg _))) _ ht' + filter_upwards [eventually_ge_atTop 1] with n hn + exact sourceDyadicWeight_energy_bound hn + +theorem sourceDyadic_fine_eventually (R : ℝ) {κ : ℝ} (hκ : 0 < κ) : + ∀ᶠn : ℕ in atTop,∀i∈sourceDyadicIndices n,R ≤ κ/((2:ℝ)^i/sourceDyadicN n) := by + have ht := (tendsto_pow_atTop_atTop_of_one_lt (show (1:ℝ) < 4 by norm_num)).const_mul_atTop hκ + filter_upwards [ht.eventually_ge_atTop R] with n hn i hi + have hi' : i ≤ 2*n := (Finset.mem_Icc.mp hi).2 + have hp : (2:ℝ)^i ≤ (2:ℝ)^(2*n) := pow_le_pow_right₀ (by norm_num) hi' + have he : κ/((2:ℝ)^(2*n)/sourceDyadicN n)=κ*(4:ℝ)^n := by + unfold sourceDyadicN + have hN : (2:ℝ)^(4*n)=((2:ℝ)^(2*n))^2 := by rw [← pow_mul]; congr 1; omega + have h4 : (4:ℝ)^n=(2:ℝ)^(2*n) := by rw [pow_mul]; norm_num + rw [hN,h4] + field_simp + calc + R ≤ κ*(4:ℝ)^n := hn + _ = κ/((2:ℝ)^(2*n)/sourceDyadicN n) := he.symm + _ ≤ _ := by + apply div_le_div_of_nonneg_left hκ.le (div_pos (by positivity) (sourceDyadicN_pos n)) + exact div_le_div_of_nonneg_right hp (sourceDyadicN_pos n).le + +end SourceDyadicArithmetic + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Arithmetic/LatticeCounting.lean b/lean/OAI/GroupTheory/SimpleAmenable/Arithmetic/LatticeCounting.lean new file mode 100644 index 0000000000000000000000000000000000000000..f75f7759feee29694b4c9482d88b062532523874 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Arithmetic/LatticeCounting.lean @@ -0,0 +1,293 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Arithmetic.PolygonArithmetic + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +section LatticeCounting + +def embeddingBox (x y a b : ℝ) : Set CutRing := + {z | ordinary z ∈ Set.Icc x (x + a) ∧ conjugate z ∈ Set.Icc y (y + b)} + +theorem embeddingBox_floor_injective (x y a b : ℝ) (hb : 0 < b) : + Set.InjOn (fun z : CutRing => ⌊b * ordinary z⌋) (embeddingBox x y a b) := by + intro z hz w hw he + dsimp only at he + by_contra hn + have hnorm := one_le_abs_cut_norm (sub_ne_zero.mpr hn) + rw [map_sub, map_sub, abs_mul] at hnorm + have ho : |b * (ordinary z - ordinary w)| < 1 := by + have hz₁ := Int.floor_le (b * ordinary z) + have hz₂ := Int.lt_floor_add_one (b * ordinary z) + have hw₁ := Int.floor_le (b * ordinary w) + have hw₂ := Int.lt_floor_add_one (b * ordinary w) + rw [he] at hz₁ hz₂ + apply abs_lt.mpr + constructor <;> nlinarith + have hc : |conjugate z - conjugate w| ≤ b := by + exact abs_le.mpr ⟨by linarith [hz.2.1, hw.2.2], by linarith [hz.2.2, hw.2.1]⟩ + rw [abs_mul, abs_of_pos hb] at ho + have hprod := mul_le_mul_of_nonneg_left hc (abs_nonneg (ordinary z - ordinary w)) + nlinarith + +theorem embeddingBox_floor_mapsTo (x y a b : ℝ) (hb : 0 ≤ b) : + Set.MapsTo (fun z : CutRing => ⌊b * ordinary z⌋) (embeddingBox x y a b) + (Set.Icc ⌊b * x⌋ ⌊b * (x + a)⌋) := by + intro z hz + exact ⟨Int.floor_mono (mul_le_mul_of_nonneg_left hz.1.1 hb), + Int.floor_mono (mul_le_mul_of_nonneg_left hz.1.2 hb)⟩ + +theorem embeddingBox_finite (x y a b : ℝ) (hb : 0 < b) : + (embeddingBox x y a b).Finite := + (Set.finite_Icc _ _).of_injOn (embeddingBox_floor_mapsTo x y a b hb.le) + (embeddingBox_floor_injective x y a b hb) + +theorem embeddingBox_card_le (x y a b : ℝ) (ha : 0 ≤ a) (hb : 0 < b) + (s : Finset CutRing) (hs : (s : Set CutRing) ⊆ embeddingBox x y a b) : + (s.card : ℝ) ≤ a * b + 2 := by + classical + have hinj := (embeddingBox_floor_injective x y a b hb).mono hs + have hcard : s.card ≤ (Finset.Icc ⌊b * x⌋ ⌊b * (x + a)⌋).card := by + calc + _ = (s.image (fun z => ⌊b * ordinary z⌋)).card := (Finset.card_image_of_injOn hinj).symm + _ ≤ _ := Finset.card_le_card (by + intro k hk + obtain ⟨z, hz, rfl⟩ := Finset.mem_image.mp hk + exact Finset.mem_Icc.mpr (embeddingBox_floor_mapsTo x y a b hb.le (hs hz))) + have hle : ⌊b * x⌋ ≤ ⌊b * (x + a)⌋ + 1 := by + have := Int.floor_mono (show b * x ≤ b * (x + a) by nlinarith) + omega + have he := Int.card_Icc_of_le ⌊b * x⌋ ⌊b * (x + a)⌋ hle + have he' : ((Finset.Icc ⌊b * x⌋ ⌊b * (x + a)⌋).card : ℝ) = + (⌊b * (x + a)⌋ : ℝ) + 1 - (⌊b * x⌋ : ℝ) := by exact_mod_cast he + have hc : (s.card : ℝ) ≤ ((Finset.Icc ⌊b * x⌋ ⌊b * (x + a)⌋).card : ℝ) := by + exact_mod_cast hcard + rw [he'] at hc + linarith [Int.floor_le (b * (x + a)), Int.lt_floor_add_one (b * x)] + +def dividedEmbeddingBox (d x y a b : ℝ) : Set CutRing := + {z | ordinary z / d ∈ Set.Icc x (x + a) ∧ + conjugate z / d ∈ Set.Icc y (y + b)} + +theorem dividedEmbeddingBox_eq (d x y a b : ℝ) (hd : 0 < d) : + dividedEmbeddingBox d x y a b = embeddingBox (d*x) (d*y) (d*a) (d*b) := by + ext z + simp only [dividedEmbeddingBox, embeddingBox, Set.mem_ofPred_eq, Set.mem_Icc, + le_div_iff₀ hd, div_le_iff₀ hd] + constructor <;> rintro ⟨⟨h₁,h₂⟩,⟨h₃,h₄⟩⟩ <;> + constructor <;> constructor <;> nlinarith + +theorem dividedEmbeddingBox_finite (d x y a b : ℝ) (hd : 0 < d) (hb : 0 < b) : + (dividedEmbeddingBox d x y a b).Finite := by + rw [dividedEmbeddingBox_eq d x y a b hd] + exact embeddingBox_finite _ _ _ _ (mul_pos hd hb) + +theorem dividedEmbeddingBox_card_le (d x y a b : ℝ) + (hd : 0 < d) (ha : 0 ≤ a) (hb : 0 < b) + (s : Finset CutRing) (hs : (s : Set CutRing) ⊆ dividedEmbeddingBox d x y a b) : + (s.card : ℝ) ≤ d^2 * a * b + 2 := by + rw [dividedEmbeddingBox_eq d x y a b hd] at hs + convert embeddingBox_card_le _ _ _ _ (mul_nonneg hd.le ha) (mul_pos hd hb) s hs using 1; ring + +theorem pairedEmbeddingBox_card_le (d : ℝ) (hd : 0 < d) + (x₁ y₁ a₁ b₁ x₂ y₂ a₂ b₂ : ℝ) + (ha₁ : 0 ≤ a₁) (hb₁ : 0 < b₁) (ha₂ : 0 ≤ a₂) (hb₂ : 0 < b₂) + (s : Finset (CutRing × CutRing)) + (hs : ∀ z ∈ s, z.1 ∈ dividedEmbeddingBox d x₁ y₁ a₁ b₁ ∧ + z.2 ∈ dividedEmbeddingBox d x₂ y₂ a₂ b₂) : + (s.card : ℝ) ≤ (d^2*a₁*b₁ + 2) * (d^2*a₂*b₂ + 2) := by + classical + have hc₁ := dividedEmbeddingBox_card_le d x₁ y₁ a₁ b₁ hd ha₁ hb₁ + (s.image Prod.fst) (by + rintro z hz + obtain ⟨p,hp,rfl⟩ := Finset.mem_image.mp hz + exact (hs p hp).1) + have hc₂ := dividedEmbeddingBox_card_le d x₂ y₂ a₂ b₂ hd ha₂ hb₂ + (s.image Prod.snd) (by + rintro z hz + obtain ⟨p,hp,rfl⟩ := Finset.mem_image.mp hz + exact (hs p hp).2) + have hc : s.card ≤ (s.image Prod.fst).card * (s.image Prod.snd).card := by + rw [← Finset.card_product] + apply Finset.card_le_card + intro z hz + exact Finset.mem_product.mpr ⟨Finset.mem_image_of_mem _ hz, Finset.mem_image_of_mem _ hz⟩ + calc + (s.card : ℝ) ≤ (s.image Prod.fst).card * (s.image Prod.snd).card := by exact_mod_cast hc + _ ≤ _ := mul_le_mul hc₁ hc₂ (by positivity) (by positivity) + +end LatticeCounting + +section QuantitativeArithmetic + +lemma floor_error (x : ℝ) : |(⌊x⌋ : ℝ) - x| ≤ 1 := by + rw [abs_of_nonpos (sub_nonpos.mpr (Int.floor_le x))] + linarith [Int.lt_floor_add_one x] + +theorem quadratic_lattice_cover (u : CutRing) (hu : u ≠ 0) (x y : ℝ) : + ∃ z : CutRing, |ordinary z - x| ≤ 3 * |ordinary u| ∧ + |conjugate z - y| ≤ 2 * |conjugate u| := by + have huo : ordinary u ≠ 0 := by simpa using ordinary_injective.ne hu + have huc : conjugate u ≠ 0 := by simpa using conjugate_injective.ne hu + have hd : Real.goldenRatio - Real.goldenConj ≠ 0 := by + rw [Real.goldenRatio_sub_goldenConj] + exact ne_of_gt (Real.sqrt_pos.mpr (by norm_num)) + let b := (x / ordinary u - y / conjugate u) / + (Real.goldenRatio - Real.goldenConj) + let a := x / ordinary u - b * Real.goldenRatio + have hb : b * (Real.goldenRatio - Real.goldenConj) = + x / ordinary u - y / conjugate u := div_mul_cancel₀ _ hd + have ha₁ : a + b * Real.goldenRatio = x / ordinary u := by dsimp [a]; ring + have ha₂ : a + b * Real.goldenConj = y / conjugate u := by dsimp [a]; nlinarith [hb] + have hx : ordinary u * (a + b * Real.goldenRatio) = x := by + rw [ha₁]; exact mul_div_cancel₀ _ huo + have hy : conjugate u * (a + b * Real.goldenConj) = y := by + rw [ha₂]; exact mul_div_cancel₀ _ huc + let z : CutRing := u * ((⌊a⌋ : CutRing) + (⌊b⌋ : CutRing) * cutTau) + have ho : ordinary z - x = ordinary u * + (((⌊a⌋ : ℝ) - a) + ((⌊b⌋ : ℝ) - b) * Real.goldenRatio) := by + dsimp [z] + simp only [map_mul,map_add,map_intCast,ordinary_cutTau] + rw [← hx]; ring + have hc : conjugate z - y = conjugate u * + (((⌊a⌋ : ℝ) - a) + ((⌊b⌋ : ℝ) - b) * Real.goldenConj) := by + dsimp [z] + simp only [map_mul,map_add,map_intCast,conjugate_cutTau] + rw [← hy]; ring + have hr : |Real.goldenRatio| ≤ 2 := by + rw [abs_of_pos Real.goldenRatio_pos] + exact Real.goldenRatio_lt_two.le + have hb' : |Real.goldenConj| ≤ 1 := by + rw [abs_of_neg Real.goldenConj_neg] + linarith [Real.neg_one_lt_goldenConj] + have bound (t : ℝ) (B : ℝ) (ht : |t| ≤ B) : + |((⌊a⌋ : ℝ) - a) + ((⌊b⌋ : ℝ) - b)*t| ≤ 1+B := by + calc + _ ≤ |(⌊a⌋ : ℝ)-a| + |((⌊b⌋ : ℝ)-b)*t| := abs_add_le _ _ + _ = |(⌊a⌋ : ℝ)-a| + |(⌊b⌋ : ℝ)-b| *|t| := by rw [abs_mul] + _ ≤ 1 + 1*B := by gcongr; exact floor_error a; exact floor_error b + _ = _ := by ring + refine ⟨z,?_,?_⟩ + · rw [ho,abs_mul] + have := mul_le_mul_of_nonneg_left (bound _ _ hr) (abs_nonneg (ordinary u)) + nlinarith + · rw [hc,abs_mul] + have := mul_le_mul_of_nonneg_left (bound _ _ hb') (abs_nonneg (conjugate u)) + nlinarith + +theorem scaled_quadratic_lattice_cover (L : ℝ) (hL : 1 ≤ L) (x y : ℝ) : + ∃ z : CutRing, |ordinary z - x| ≤ 6 / L ∧ + |conjugate z - y| ≤ 2 * L := by + obtain ⟨k,hk,hk'⟩ := exists_nat_pow_near hL Real.one_lt_goldenRatio + let u : CutRing := (cutTau - 1)^k + have hτ : 0 < Real.goldenRatio^k := pow_pos Real.goldenRatio_pos _ + have ho : ordinary u = (Real.goldenRatio^k)⁻¹ := by + simp only [u,map_pow,map_sub,ordinary_cutTau,map_one] + rw [← inv_pow] + congr 1 + rw [Real.inv_goldenRatio] + linarith [Real.goldenRatio_add_goldenConj] + have hc : |conjugate u| = Real.goldenRatio^k := by + simp only [u,map_pow,map_sub,conjugate_cutTau,map_one,abs_pow] + congr 1 + rw [abs_of_neg (by linarith [Real.goldenConj_neg] : Real.goldenConj - 1 < 0)] + linarith [Real.goldenRatio_add_goldenConj] + have hu : u ≠ 0 := by + intro h + have he : ordinary u = 0 := by rw [h,map_zero] + rw [ho] at he + exact (inv_ne_zero hτ.ne') he + obtain ⟨z,hz,hz'⟩ := quadratic_lattice_cover u hu x y + refine ⟨z,hz.trans ?_,hz'.trans ?_⟩ + · rw [ho,abs_of_pos (inv_pos.mpr hτ)] + have hL0 : 0 < L := by linarith + have hnear : L < 2*Real.goldenRatio^k := by + rw [pow_succ] at hk' + nlinarith [Real.goldenRatio_lt_two] + apply (le_div_iff₀ hL0).mpr + have he : (Real.goldenRatio^k)⁻¹ * Real.goldenRatio^k = 1 := inv_mul_cancel₀ hτ.ne' + nlinarith [mul_lt_mul_of_pos_left hnear (inv_pos.mpr hτ)] + · rw [hc] + linarith + +theorem endpoint_separation {z : CutRing} (hz : z ≠ 0) {n : ℕ} (hn : 1 ≤ n) + (ho : |ordinary z| ≤ 1) (hq : |(endpointLabel z : ℝ)| ≤ n) : + 1 / (4 * (n : ℝ)) ≤ |ordinary z| := by + have hsqrt : Real.sqrt 5 ≤ 3 := by nlinarith [Real.sq_sqrt (by norm_num : (0:ℝ) ≤ 5), Real.sqrt_nonneg 5] + have hn' : (1:ℝ) ≤ n := by exact_mod_cast hn + have he : conjugate z = ordinary z - (endpointLabel z : ℝ)*Real.sqrt 5 := by + have h := (eq_div_iff (ne_of_gt (Real.sqrt_pos.mpr (by norm_num : (0:ℝ) < 5)))).mp + (endpointLabel_embedding z) + linarith + have hc : |conjugate z| ≤ 4*(n:ℝ) := by + rw [he] + calc + _ ≤ |ordinary z| + |(endpointLabel z:ℝ)*Real.sqrt 5| := by simpa using abs_sub_le (ordinary z) 0 ((endpointLabel z:ℝ)*Real.sqrt 5) + _ = |ordinary z| + |(endpointLabel z:ℝ)| *Real.sqrt 5 := by + rw [abs_mul,abs_of_nonneg (Real.sqrt_nonneg 5)] + _ ≤ 1 + (n:ℝ)*3 := by gcongr + _ ≤ _ := by linarith + have hnorm := one_le_abs_cut_norm hz + rw [abs_mul] at hnorm + apply (div_le_iff₀ (by positivity : (0:ℝ) < 4*(n:ℝ))).mpr + nlinarith [mul_le_mul_of_nonneg_left hc (abs_nonneg (ordinary z))] + +theorem coordinate_window_net (n : ℕ) (hn : 1 ≤ n) (q : ℤ) (t : ℝ) : + ∃ z : CutRing, q ≤ endpointLabel z ∧ endpointLabel z < q + n ∧ + |ordinary z - t| ≤ 100 / (n : ℝ) := by + have hn0 : (0:ℝ) < n := by exact_mod_cast (lt_of_lt_of_le Nat.zero_lt_one hn) + by_cases hn32 : 32 ≤ n + · have hn32' : (32:ℝ) ≤ n := by exact_mod_cast hn32 + let c : ℝ := (q:ℝ) + (n:ℝ)/2 + obtain ⟨z,ho,hb⟩ := scaled_quadratic_lattice_cover ((n:ℝ)/16) (by linarith) + t (t-c*Real.sqrt 5) + have ho' : |ordinary z-t| ≤ 96/(n:ℝ) := by + convert ho using 1; field_simp; ring + have hb' : |conjugate z-(t-c*Real.sqrt 5)| ≤ (n:ℝ)/8 := by + convert hb using 1; ring + have hs : 1 ≤ Real.sqrt 5 := by + nlinarith [Real.sq_sqrt (by norm_num : (0:ℝ) ≤ 5),Real.sqrt_nonneg 5] + have hsmall : 96/(n:ℝ) ≤ (n:ℝ)/8 := by + apply (div_le_iff₀ hn0).mpr + nlinarith + have hlabel : |(endpointLabel z:ℝ)-c| ≤ (n:ℝ)/4 := by + have he : ((endpointLabel z:ℝ)-c)*Real.sqrt 5 = + (ordinary z-t)-(conjugate z-(t-c*Real.sqrt 5)) := by + have he := (eq_div_iff (ne_of_gt (lt_of_lt_of_le zero_lt_one hs))).mp + (endpointLabel_embedding z) + nlinarith [he] + have htri : |(ordinary z-t)-(conjugate z-(t-c*Real.sqrt 5))| ≤ + |ordinary z-t| + |conjugate z-(t-c*Real.sqrt 5)| := by + simpa only [sub_zero,zero_sub,abs_neg] using abs_sub_le (ordinary z-t) 0 (conjugate z-(t-c*Real.sqrt 5)) + rw [← he,abs_mul,abs_of_nonneg (le_trans zero_le_one hs)] at htri + nlinarith [abs_nonneg ((endpointLabel z:ℝ)-c)] + have hlow : (q:ℝ) ≤ (endpointLabel z:ℝ) := by + have hh := (abs_le.mp hlabel).1 + dsimp [c] at hh + linarith + have hhigh : (endpointLabel z:ℝ) < (q:ℝ)+(n:ℝ) := by + have hh := (abs_le.mp hlabel).2 + dsimp [c] at hh + linarith + refine ⟨z,by exact_mod_cast hlow,by exact_mod_cast hhigh,ho'.trans ?_⟩ + apply div_le_div_of_nonneg_right (by norm_num) hn0.le + · let z : CutRing := ⟨⌊t-(q:ℝ)*Real.goldenRatio⌋,q⟩ + refine ⟨z,le_rfl,by change q < q+(n:ℤ); omega,?_⟩ + have he : ordinary z-t = (⌊t-(q:ℝ)*Real.goldenRatio⌋:ℝ)- + (t-(q:ℝ)*Real.goldenRatio) := by simp only [ordinary_apply,z]; ring + rw [he] + apply (floor_error _).trans + apply (le_div_iff₀ hn0).mpr + have : (n:ℝ) < 32 := by exact_mod_cast (lt_of_not_ge hn32) + linarith + +end QuantitativeArithmetic + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Arithmetic/LatticeRange.lean b/lean/OAI/GroupTheory/SimpleAmenable/Arithmetic/LatticeRange.lean new file mode 100644 index 0000000000000000000000000000000000000000..e83c3241c66292d59f505ca1301099752aa8194b --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Arithmetic/LatticeRange.lean @@ -0,0 +1,118 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.ConditionalBooleanGeneration +import OAI.GroupTheory.SimpleAmenable.CentralCovers.PerfectGeneratingFamilies + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section SourceLatticeRange + +variable (a : ℕ) (r : CutRing) (m : ℕ) (hm : 2 ≤ m) + +noncomputable def sourceLatticeFullMap : + Multiplicative (FreeAbelianGroup (Fin m × Fin 2)) →* + polygonFullGroup a (m+1) := + (polygonAlternatingGroup a (m+1)).subtype.comp (sourceLatticeMap a r m hm) + +@[simp] theorem sourceLatticeFullMap_of (i : Fin m × Fin 2) : + sourceLatticeFullMap a r m hm (Multiplicative.ofAdd (FreeAbelianGroup.of i)) = + sourceGenerator a r m (Sum.inr i) := by + change (sourceLatticeMap a r m hm (Multiplicative.ofAdd (FreeAbelianGroup.of i))).val = _ + rw [sourceLatticeMap,commutingFamilyHom_of] + rfl + +theorem sourceLatticeFullMap_balanced (i : Fin (m+1)) (v : CutRing × CutRing) : + trackTranslation (a := a) (Pi.single i v - Pi.single (Fin.last m) v) ∈ + (sourceLatticeFullMap a r m hm).range := by + classical + let K := (sourceLatticeFullMap a r m hm).range + change _ ∈ K + refine Fin.lastCases ?_ (fun i => ?_) i + · simp + let dx : Fin (m+1) → CutRing × CutRing := Pi.single i.castSucc (cutTau,0) - Pi.single (Fin.last m) (cutTau,0) + let dy : Fin (m+1) → CutRing × CutRing := Pi.single i.castSucc (0,cutTau) - Pi.single (Fin.last m) (0,cutTau) + have hx : trackTranslation (a := a) dx ∈ K := + ⟨_,sourceLatticeFullMap_of a r m hm (i,0)⟩ + have hy : trackTranslation (a := a) dy ∈ K := by + refine ⟨Multiplicative.ofAdd (FreeAbelianGroup.of (i,1)),?_⟩ + simpa only [sourceGenerator,show (1 : Fin 2) ≠ 0 by decide,ite_false] + using sourceLatticeFullMap_of a r m hm (i,1) + have he : trackTranslation (a := a) (Pi.single i.castSucc v - Pi.single (Fin.last m) v) = + trackTranslation (v.1.im • dx + v.2.im • dy) := by + let d : Fin (m+1) → CutRing × CutRing := Pi.single i.castSucc v - Pi.single (Fin.last m) v + change trackTranslation d = _ + rw [trackTranslation_reduce d] + congr 1 + funext k + by_cases hki : k = i.castSucc <;> by_cases hkl : k = Fin.last m <;> + apply Prod.ext <;> simp [d,dx,dy,hki,hkl,zsmul_eq_mul] + rw [he,trackTranslation_add,trackTranslation_zsmul,trackTranslation_zsmul] + exact K.mul_mem (K.zpow_mem hx _) (K.zpow_mem hy _) + +theorem sourceLatticeFullMap_difference (i j : Fin (m+1)) (v : CutRing × CutRing) : + trackTranslation (a := a) (Pi.single j v - Pi.single i v) ∈ + (sourceLatticeFullMap a r m hm).range := by + have he : (Pi.single j v - Pi.single i v : Fin (m+1) → CutRing × CutRing) = + (Pi.single j v - Pi.single (Fin.last m) v) - + (Pi.single i v - Pi.single (Fin.last m) v) := by abel + rw [he,trackTranslation_sub] + exact (sourceLatticeFullMap a r m hm).range.mul_mem + (sourceLatticeFullMap_balanced a r m hm j v) + ((sourceLatticeFullMap a r m hm).range.inv_mem + (sourceLatticeFullMap_balanced a r m hm i v)) + +theorem sourceLatticeFullMap_prescribed (I : Finset (Fin (m+1))) + (b : Fin (m+1)) (hb : b ∉ I) (u : Fin (m+1) → CutRing × CutRing) : + ∃ k d, sourceLatticeFullMap a r m hm k = trackTranslation d ∧ + ∀ i ∈ I, d i = u i := by + classical + let d : Fin (m+1) → CutRing × CutRing := + ∑ i ∈ I, (Pi.single i (u i) - Pi.single b (u i)) + have hd : trackTranslation (a := a) d ∈ (sourceLatticeFullMap a r m hm).range := by + dsimp only [d] + clear hb + induction I using Finset.induction_on with + | empty => simp + | @insert i s hi ih => + rw [Finset.sum_insert hi,trackTranslation_add] + exact (sourceLatticeFullMap a r m hm).range.mul_mem + (sourceLatticeFullMap_difference a r m hm b i (u i)) ih + obtain ⟨k,hk⟩ := hd + refine ⟨k,d,hk,?_⟩ + intro i hi + have hib : i ≠ b := fun h => hb (h ▸ hi) + simp [d,Finset.sum_apply,Pi.sub_apply,Pi.single_apply,hib,hi] + +theorem sourceLatticeFullMap_translation (k : Multiplicative (FreeAbelianGroup (Fin m × Fin 2))) : + ∃ d, sourceLatticeFullMap a r m hm k = trackTranslation d := by + change ∃ d, sourceLatticeFullMap a r m hm + (Multiplicative.ofAdd (Multiplicative.toAdd k)) = trackTranslation d + induction Multiplicative.toAdd k using FreeAbelianGroup.induction_on with + | zero => refine ⟨0,?_⟩; exact (map_one _).trans trackTranslation_zero.symm + | of i => exact ⟨_,sourceLatticeFullMap_of a r m hm i⟩ + | neg i hi => + obtain ⟨d,hd⟩ := hi + refine ⟨-d,?_⟩ + change sourceLatticeFullMap a r m hm + ((Multiplicative.ofAdd (FreeAbelianGroup.of i))⁻¹) = _ + rw [map_inv,hd,trackTranslation_neg] + | add x y hx hy => + obtain ⟨d,hd⟩ := hx + obtain ⟨e,he⟩ := hy + refine ⟨d+e,?_⟩ + change sourceLatticeFullMap a r m hm + (Multiplicative.ofAdd x * Multiplicative.ofAdd y) = _ + rw [map_mul,hd,he,trackTranslation_add] + +end SourceLatticeRange + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Arithmetic/LatticeRiemann.lean b/lean/OAI/GroupTheory/SimpleAmenable/Arithmetic/LatticeRiemann.lean new file mode 100644 index 0000000000000000000000000000000000000000..719083c3302abf0eebd01f524dca0cf4622ea1fb --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Arithmetic/LatticeRiemann.lean @@ -0,0 +1,250 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Arithmetic.QuadraticRectangleCounts +import OAI.GroupTheory.SimpleAmenable.Arithmetic.QuadraticTiles + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section LatticeRiemann +open Classical MeasureTheory + +theorem fundamentalDomain_riemann_error + {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + [MeasureSpace E] [BorelSpace E] [Measure.IsAddLeftInvariant (volume : Measure E)] + (L : AddSubgroup E) [Countable L] + {F : Set E} (hF : IsAddFundamentalDomain L F volume) + (hFfin : volume F<⊤) {δ : ℝ} (hδ : ∀x∈F,‖x‖≤δ) + {f : E → ℝ} (hf : Integrable f) {A : NNReal} (hlip : LipschitzWith A f) + (T : Finset L) (hT : ∀z : L,z∉T → ∀x∈F,f ((z:E)+x)=0) : + |volume.real F*(∑z∈T,f (z:E))-∫x,f x| ≤ + (T.card:ℝ)*((A:ℝ)*δ*volume.real F) := by + have hint (z : L) : Integrable (fun x : E => f ((z:E)+x)) := + (measurePreserving_add_left volume (z:E)).integrable_comp_of_integrable hf + have hdecomp : (∫x,f x)=∑z∈T,∫x in F,f ((z:E)+x) := by + rw [hF.integral_eq_tsum'' f hf] + apply tsum_eq_sum + intro z hz + apply integral_eq_zero_of_ae + exact (ae_restrict_mem₀ hF.nullMeasurableSet).mono (fun x hx => hT z hz x hx) + rw [hdecomp,Finset.mul_sum,← Finset.sum_sub_distrib] + have he (z : L) : volume.real F*f (z:E)-(∫x in F,f ((z:E)+x))= + ∫x in F,f (z:E)-f ((z:E)+x) := by + rw [integral_sub (integrableOn_const (C := f (z:E)) hFfin.ne) (hint z).integrableOn, + setIntegral_const,smul_eq_mul] + simp_rw [he] + calc + _ ≤ ∑z∈T,|∫x in F,f (z:E)-f ((z:E)+x)| := Finset.abs_sum_le_sum_abs _ _ + _ ≤ ∑_z∈T,(A:ℝ)*δ*volume.real F := by + apply Finset.sum_le_sum + intro z _ + rw [← Real.norm_eq_abs] + apply norm_setIntegral_le_of_norm_le_const hFfin + intro x hx + calc + _ ≤ (A:ℝ)*‖(z:E)-((z:E)+x)‖ := hlip.norm_sub_le _ _ + _ = (A:ℝ)*‖x‖ := by simp + _ ≤ _ := mul_le_mul_of_nonneg_left (hδ x hx) A.coe_nonneg + _ = _ := by simp + +end LatticeRiemann + +section PairedQuadraticTiles +open Classical Module MeasureTheory + +theorem balanced_cutUnit_pos {L : ℝ} (hL : 0 ?_⟩ + have hb := quadraticScaledTile_bound hu hd hs ht x hx + apply (pi_norm_le_iff_of_nonneg (by positivity)).mpr + intro i + fin_cases i + · rw [Real.norm_eq_abs] + calc + _ ≤ 3*|ordinary u|/(d*s) := hb.1 + _ ≤ 3*(2/L)/(d*s) := by gcongr + _ = 6/(d*Real.sqrt (s*t)) := by rw [← hmul]; field_simp; ring + · rw [Real.norm_eq_abs] + calc + _ ≤ 2*|conjugate u|/(d*t) := hb.2 + _ ≤ 2*(2*L)/(d*t) := by gcongr + _ = 4/(d*Real.sqrt (s*t)) := by + calc + _ = (4/d)*(L/t) := by ring + _ = _ := by rw [hdiv]; ring + _ ≤ _ := by gcongr; norm_num + +noncomputable def pairedQuadraticBasis {u : CutRing} (hu : IsUnit u) + {d s t : ℝ} (hd : 0 linarith + have hc : (-R-p 1)≤conjugate u/(d*t) ∧ conjugate u/(d*t)≤R-p 1 := by constructor <;> linarith + rw [le_div_iff₀ (mul_pos hd hs),div_le_iff₀ (mul_pos hd hs)] at ho + rw [le_div_iff₀ (mul_pos hd ht),div_le_iff₀ (mul_pos hd ht)] at hc + exact ⟨⟨ho.1,by nlinarith [ho.2]⟩,⟨hc.1,by nlinarith [hc.2]⟩⟩ + exact ⟨hb z.1 q.1 hnorm.1,hb z.2 q.2 hnorm.2⟩ + +theorem pairedQuadraticBox_finite {d s t R : ℝ} (hd : 0 pairedQuadraticBox_rectangles hd hs ht q z hz) + +theorem pairedQuadraticBox_card {d s t R : ℝ} (hd : 0 simp [cutForm, integralCutForm] + +theorem cutForm_add (a : ℕ) (j : Fin 4) (p q : ℝ × ℝ) : + cutForm a j (p + q) = cutForm a j p + cutForm a j q := by + fin_cases j <;> simp [cutForm] <;> ring + +def AvoidsCuts (a : ℕ) (p : ℝ × ℝ) : Prop := + ∀ (j : Fin 4) (z : CutRing), cutForm a j p ≠ ordinary z + +theorem avoidsCuts_translate {a : ℕ} {p : ℝ × ℝ} (hp : AvoidsCuts a p) + (u : CutRing × CutRing) : AvoidsCuts a (p + (ordinary u.1, ordinary u.2)) := by + intro j z hz + apply hp j (z - integralCutForm a j u) + rw [cutForm_add, cutForm_ordinary] at hz + simpa only [map_sub] using eq_sub_of_add_eq hz + +def GenericSquare (a : ℕ) := + {p : ℝ × ℝ // p.1 ∈ Set.Ico 0 1 ∧ p.2 ∈ Set.Ico 0 1 ∧ AvoidsCuts a p} + +def halfPlane (a : ℕ) (j : Fin 4) (z : CutRing) : Set (GenericSquare a) := + {p | cutForm a j p.val < ordinary z} + +def polygonAlgebra (a : ℕ) : BooleanSubalgebra (Set (GenericSquare a)) := + BooleanSubalgebra.closure {U | ∃ j z, U = halfPlane a j z} + +theorem polygon_induction {a : ℕ} {P : Set (GenericSquare a) → Prop} + (hcut : ∀ j z, P (halfPlane a j z)) (hbot : P ∅) + (hsup : ∀ U V, P U → P V → P (U ∪ V)) + (hcompl : ∀ U, P U → P Uᶜ) {U : Set (GenericSquare a)} + (hU : U ∈ polygonAlgebra a) : P U := by + induction hU using BooleanSubalgebra.closure_bot_sup_induction with + | mem U h => obtain ⟨j, z, rfl⟩ := h; exact hcut j z + | bot => exact hbot + | sup U hU V hV ihU ihV => exact hsup U V ihU ihV + | compl U hU ih => exact hcompl U ih + +end PolygonArithmetic + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Arithmetic/PropagationArithmetic.lean b/lean/OAI/GroupTheory/SimpleAmenable/Arithmetic/PropagationArithmetic.lean new file mode 100644 index 0000000000000000000000000000000000000000..19cb3cf5921a52b2244f3edc8f8541aaacfdd6ec --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Arithmetic/PropagationArithmetic.lean @@ -0,0 +1,154 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Arithmetic.PolygonArithmetic + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section PropagationArithmetic + +@[simp] theorem endpointLabel_add (z w : CutRing) : + endpointLabel (z+w) = endpointLabel z + endpointLabel w := rfl + +@[simp] theorem endpointLabel_sub (z w : CutRing) : + endpointLabel (z-w) = endpointLabel z - endpointLabel w := rfl + +@[simp] theorem endpointLabel_intCast (k : ℤ) : endpointLabel (k : CutRing) = 0 := rfl + +theorem endpointLabel_mul (l d : CutRing) : + (endpointLabel (l*d) : ℝ) = conjugate l * (endpointLabel d : ℝ) + + (endpointLabel l : ℝ) * ordinary d := by + simp only [endpointLabel, QuadraticAlgebra.im_mul, Int.cast_add, Int.cast_mul, + Int.cast_one, ordinary_apply, conjugate_apply] + rw [← Real.one_sub_goldenConj] + ring + +theorem endpointLabel_mul_bound (l d : CutRing) {N D : ℝ} + (hq : |(endpointLabel d : ℝ)| ≤ N) (hd : |ordinary d| ≤ D) : + |(endpointLabel (l*d) : ℝ)| ≤ |conjugate l| * N + |(endpointLabel l : ℝ)| * D := by + rw [endpointLabel_mul] + calc + _ ≤ |conjugate l * (endpointLabel d : ℝ)| + + |(endpointLabel l : ℝ) * ordinary d| := abs_add_le _ _ + _ = |conjugate l| * |(endpointLabel d : ℝ)| + + |(endpointLabel l : ℝ)| * |ordinary d| := by rw [abs_mul, abs_mul] + _ ≤ _ := by gcongr + +theorem exists_source_slope (c C : ℝ) (hc : 0 < c) : + ∃ a : ℕ, 0 < a ∧ + ordinary (cutTau^a)*c > 1000*(C+1) ∧ + |conjugate (cutTau^a)| < 1/1000 := by + obtain ⟨a,ha⟩ := pow_unbounded_of_one_lt (1000*(C+1)/c) Real.one_lt_goldenRatio + have hconj : |Real.goldenConj| < 1 := by + rw [abs_of_neg Real.goldenConj_neg] + linarith [Real.neg_one_lt_goldenConj] + obtain ⟨b,hb⟩ := exists_pow_lt_of_lt_one (by norm_num : (0:ℝ) < 1/1000) hconj + refine ⟨max a b + 1, by omega, ?_, ?_⟩ + · have hp : Real.goldenRatio^a ≤ Real.goldenRatio^(max a b + 1) := + pow_le_pow_right₀ Real.one_lt_goldenRatio.le (by omega) + simpa only [map_pow, ordinary_cutTau] using + (div_lt_iff₀ hc).mp (lt_of_lt_of_le ha hp) + · simp only [map_pow, conjugate_cutTau, abs_pow] + exact lt_of_le_of_lt (pow_le_pow_of_le_one (abs_nonneg _) hconj.le (by omega)) hb + +theorem exists_source_slope_explicit : + ∃ a : ℕ, 0 < a ∧ ordinary (cutTau^a)*(1/4) > 1000*(100+1) ∧ + |conjugate (cutTau^a)| < 1/1000 := + exists_source_slope (1/4) 100 (by norm_num) + +end PropagationArithmetic + +section BoundedOneDimensionalOrdering + +variable {α : Type*} + +private theorem real_list_sum_nonpos {l : List ℝ} (h : ∀ x ∈ l, x ≤ 0) : l.sum ≤ 0 := by + induction l with + | nil => simp + | cons x l ih => + exact add_nonpos (h x (by simp)) (ih (fun y hy => h y (by simp [hy]))) + +theorem exists_bounded_step_order (v : α → ℝ) (xs : List α) + {L U δ x : ℝ} (hLU : L ≤ U) (_hδ : 0 ≤ δ) + (hstep : ∀ t ∈ xs, |v t| ≤ δ) + (hx : L-δ ≤ x ∧ x ≤ U+δ) + (hy : L ≤ x+(xs.map v).sum ∧ x+(xs.map v).sum ≤ U) : + ∃ ys : List α, ys.Perm xs ∧ + ∀ n : ℕ, L-δ ≤ x+((ys.take n).map v).sum ∧ + x+((ys.take n).map v).sum ≤ U+δ := by + classical + induction hn : xs.length using Nat.strong_induction_on generalizing xs x with + | h n ih => + by_cases hnil : xs = [] + · subst xs + exact ⟨[],List.Perm.refl _,fun _ => by simpa using hx⟩ + have hcons : ∃ t, t ∈ xs := List.exists_mem_of_ne_nil xs hnil + have hchoose : ∃ t ∈ xs, L-δ ≤ x+v t ∧ x+v t ≤ U+δ := by + by_cases hlow : x < L + · have hp : ∃ t ∈ xs, 0 < v t := by + by_contra! hp + have hz : (xs.map v).sum ≤ 0 := real_list_sum_nonpos (by + intro r hr + obtain ⟨t,ht,rfl⟩ := List.mem_map.mp hr + exact hp t ht) + linarith [hy.1] + obtain ⟨t,ht,hpos⟩ := hp + refine ⟨t,ht,by linarith [hx.1],?_⟩ + linarith [(abs_le.mp (hstep t ht)).2] + · by_cases hhigh : U < x + · have hp : ∃ t ∈ xs, v t < 0 := by + by_contra! hp + have hz : 0 ≤ (xs.map v).sum := List.sum_nonneg (by + intro r hr + obtain ⟨t,ht,rfl⟩ := List.mem_map.mp hr + exact hp t ht) + linarith [hy.2] + obtain ⟨t,ht,hneg⟩ := hp + refine ⟨t,ht,?_,by linarith [hx.2]⟩ + linarith [(abs_le.mp (hstep t ht)).1] + · obtain ⟨t,ht⟩ := hcons + refine ⟨t,ht,?_,?_⟩ <;> linarith [abs_le.mp (hstep t ht)] + obtain ⟨t,ht,htx⟩ := hchoose + have hperm : (t :: xs.erase t).Perm xs := (List.perm_cons_erase ht).symm + have he : v t + ((xs.erase t).map v).sum = (xs.map v).sum := by + have := (hperm.map v).sum_eq + simpa using this + have hlen : (xs.erase t).length < n := by + rw [← hn] + rw [List.length_erase_of_mem ht] + have : 0 < xs.length := List.length_pos_iff.mpr hnil + omega + obtain ⟨ys,hys,hbounds⟩ := ih _ hlen (xs.erase t) (x := x+v t) + (fun s hs => hstep s (List.mem_of_mem_erase hs)) htx + (by constructor <;> linarith [hy.1,hy.2]) rfl + refine ⟨t::ys,(List.Perm.cons t hys).trans hperm,?_⟩ + intro k + cases k with + | zero => simpa using hx + | succ k => simpa only [List.take_succ_cons,List.map_cons,List.sum_cons,add_assoc] + using hbounds k + +theorem exists_step_order_near_segment (v : α → ℝ) (xs : List α) {δ : ℝ} + (hδ : 0 ≤ δ) (hstep : ∀ t ∈ xs, |v t| ≤ δ) : + ∃ ys : List α, ys.Perm xs ∧ ∀ n : ℕ, + min 0 (xs.map v).sum - δ ≤ ((ys.take n).map v).sum ∧ + ((ys.take n).map v).sum ≤ max 0 (xs.map v).sum + δ := by + obtain ⟨ys,hy,hb⟩ := exists_bounded_step_order v xs + (L := min 0 (xs.map v).sum) (U := max 0 (xs.map v).sum) (x := 0) + min_le_max hδ hstep + ⟨by linarith [min_le_left 0 (xs.map v).sum], + by linarith [le_max_left 0 (xs.map v).sum]⟩ + ⟨by simp, by simp⟩ + exact ⟨ys,hy,fun n => by simpa using hb n⟩ + +end BoundedOneDimensionalOrdering + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Arithmetic/QuadraticRectangleCounts.lean b/lean/OAI/GroupTheory/SimpleAmenable/Arithmetic/QuadraticRectangleCounts.lean new file mode 100644 index 0000000000000000000000000000000000000000..c44bde50907c8dbec57d2c6089817ed0f2b7a7f3 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Arithmetic/QuadraticRectangleCounts.lean @@ -0,0 +1,83 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Arithmetic.PolygonArithmetic + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section QuadraticRectangleCounts +open Classical + +theorem conjugateStrip_floor_inj (y b : ℝ) (hb : 0 ⌊b*ordinary u⌋) + {u | conjugate u∈Set.Icc y (y+b)} := by + intro u hu w hw he + change ⌊b*ordinary u⌋=⌊b*ordinary w⌋ at he + by_contra hne + have hn := one_le_abs_cut_norm (sub_ne_zero.mpr hne) + simp only [map_sub,abs_mul] at hn + have hc : |conjugate u-conjugate w|≤b := by + apply abs_le.mpr + constructor <;> linarith [hu.1,hu.2,hw.1,hw.2] + have h₁ := Int.floor_le (b*ordinary u) + have h₂ := Int.lt_floor_add_one (b*ordinary u) + have h₃ := Int.floor_le (b*ordinary w) + have h₄ := Int.lt_floor_add_one (b*ordinary w) + rw [he] at h₁ h₂ + have hlt : |b*(ordinary u-ordinary w)|<1 := by + apply abs_lt.mpr + constructor <;> nlinarith + rw [abs_mul,abs_of_pos hb] at hlt + nlinarith [abs_nonneg (ordinary u-ordinary w)] + +def cutRectangle (x y a b : ℝ) : Set CutRing := + {u | ordinary u∈Set.Icc x (x+a) ∧ conjugate u∈Set.Icc y (y+b)} + +theorem cutRectangle_finite (x y a b : ℝ) (hb : 0 ⌊b*ordinary u⌋) '' cutRectangle x y a b).Finite := by + apply (Set.finite_Icc ⌊b*x⌋ ⌊b*(x+a)⌋).subset + rintro _ ⟨u,hu,rfl⟩ + exact ⟨Int.floor_mono (mul_le_mul_of_nonneg_left hu.1.1 hb.le), + Int.floor_mono (mul_le_mul_of_nonneg_left hu.1.2 hb.le)⟩ + exact him.of_finite_image (fun _ hu _ hw he => + conjugateStrip_floor_inj y b hb hu.2 hw.2 he) + +theorem cutRectangle_card_floor (S : Finset CutRing) (x y a b : ℝ) (hb : 0 ⌊b*ordinary u⌋) (↑S) := by + intro u hu w hw he + exact conjugateStrip_floor_inj y b hb (hS u hu).2 (hS w hw).2 he + rw [← Int.card_Icc,← Finset.card_image_of_injOn hinj] + apply Finset.card_le_card + intro t ht + obtain ⟨u,hu,rfl⟩ := Finset.mem_image.mp ht + exact Finset.mem_Icc.mpr + ⟨Int.floor_mono (mul_le_mul_of_nonneg_left (hS u hu).1.1 hb.le), + Int.floor_mono (mul_le_mul_of_nonneg_left (hS u hu).1.2 hb.le)⟩ + +theorem cutRectangle_card_bound (S : Finset CutRing) (x y a b : ℝ) + (ha : 0≤a) (hb : 0 simp [h] + +theorem cutTau_sub_one_isUnit : IsUnit (cutTau-1) := by + apply QuadraticAlgebra.isUnit_iff_norm_isUnit.mpr + norm_num [cutTau,QuadraticAlgebra.norm_def] + +theorem balanced_cutUnit {L : ℝ} (hL : 1≤L) : + ∃u : CutRing,IsUnit u ∧ |ordinary u| ≤ 2/L ∧ |conjugate u| ≤ L := by + obtain ⟨k,hk,hk'⟩ := exists_nat_pow_near hL Real.one_lt_goldenRatio + let u : CutRing := (cutTau-1)^k + have hp : 0 simp [Pi.basisFun_apply,Fin.sum_univ_two] + +theorem quadraticScaledBasis_volume {u : CutRing} (hu : IsUnit u) + {d s t : ℝ} (hd : 0 simp [add_div] + map_smul' n z := by ext i; fin_cases i <;> simp [mul_div_assoc] + +theorem quadraticScaledEmbedding_injective {d s t : ℝ} + (hd : 0 rfl + +theorem quadraticScaledBasis_one {u : CutRing} (hu : IsUnit u) + {d s t : ℝ} (hd : 0 simp [quadraticScaledMatrix,quadraticScaledEmbedding] + +theorem quadraticScaledBasis_span {u : CutRing} (hu : IsUnit u) + {d s t : ℝ} (hd : 0 simp [cutTau] + have he : quadraticScaledEmbedding d s t z= + w.re • quadraticScaledBasis hu hd hs ht 0+ + w.im • quadraticScaledBasis hu hd hs ht 1 := by + rw [quadraticScaledBasis_zero,quadraticScaledBasis_one,← LinearMap.map_smul, + ← LinearMap.map_smul,← map_add] + congr 1 + rw [← hz,zsmul_eq_mul,zsmul_eq_mul] + conv_lhs => rhs; rw [hw'] + ring + rw [he] + exact Submodule.add_mem _ + (Submodule.smul_mem _ _ (Submodule.subset_span ⟨0,rfl⟩)) + (Submodule.smul_mem _ _ (Submodule.subset_span ⟨1,rfl⟩)) + +theorem quadraticScaledTile_bound {u : CutRing} (hu : IsUnit u) + {d s t : ℝ} (hd : 0 ((measurePreserving_add_left volume q.1).prod + (measurePreserving_add_left volume q.2)).map_eq⟩ + have hd₀ : 0 f (q+x)) := + (measurePreserving_add_left volume q).integrable_comp_of_integrable hf + have hlipt : LipschitzWith A (fun x => f (q+x)) := by + simpa only [mul_one,Function.comp_def] using hLip.comp (isometry_add_left q).lipschitzWith + have herr := fundamentalDomain_riemann_error L.toAddSubgroup hF hFfinite hcell' hft hlipt T hT + have hsum : (∑z∈T,f (q+(z:((Fin 2 → ℝ)×(Fin 2 → ℝ)))))= + ∑z∈S,f (q+pairedQuadraticEmbedding d s t z) := by + rw [Finset.sum_image (fun z _ w _ hh => e.injective hh)] + rfl + have hvol : volume.real F=5/(d^4*s^2*t^2) := pairedQuadratic_volume hu hd₀ hs ht + change |volume.real F*(∑z∈T,f (q+(z:((Fin 2 → ℝ)×(Fin 2 → ℝ)))))-∫x,f (q+x)| ≤ + (T.card:ℝ)*((A:ℝ)*δ*volume.real F) at herr + rw [hsum,integral_add_left_eq_self,hvol] at herr + have hcard : T.card=S.card := Finset.card_image_of_injective _ e.injective + rw [hcard] at herr + have hSbox : ∀z∈S,z∈pairedQuadraticBox d s t (K+δ) q := by simp only [S,Set.Finite.mem_toFinset]; tauto + have hcardbound := pairedQuadraticBox_card hd₀ hs ht (show 0 (primitiveTests (a := a) (r := r) (A.concurrentPrimitives T.vertex T.offset) e).val) + (T.polygons R i).val := + polygonBooleanPullback_resolved _ _ + (fun e => A.concurrent_localDecision_resolved T.vertex T.offset z (j e) (c e)) _ + +omit [Group.IsPerfect (alternatingGroup (Fin (m+1)))] in +theorem concurrent_coordinateGate_resolved {κ : Type*} [Finite κ] + (t : VertexType (commonVertexDenominator a)) (u : CutRing × CutRing) (z : ℝ × ℝ) + (j : κ → Fin 2) (c : κ → CutRing) (σ : κ → Bool) : + ResolvedBy (fun e => (primitiveTests (a := a) (r := r) (A.concurrentPrimitives t u) e).val) + (A.geometry.coordinateGate t u z j c σ).val := + fun x y hh => A.coordinateGate_resolved t u z j c σ x y + (fun i => hh (A.concurrentCoordinateEmbedding i)) + +theorem active_clipped_model_action {ι : Type*} [Finite ι] + (hlarge : 20 ≤ m+1) (hr : 0 halfPlane a (j i) (c i)) + (spatialTranslate u (clippedSlopePrimitive a r (slopeDirection d))).val) + (hactive : cutForm a (j slope) z=ordinary (c slope)) + (σ : Fin 2 × Bool → Bool) (hσ : ∀ k, σ (k,false)=false ∧ σ (k,true)=true) + (L V : Fin 2 → CutRing) (hLV : ∀ k, ordinary (L k) ≤ ordinary (V k)) + (hclip : ∀ k, -ordinary r≤ordinary (L k)-ordinary (pointCoordinate G.offset k) ∧ + ordinary (V k)-ordinary (pointCoordinate G.offset k)≤ordinary r) + (hnear : ∀ k, |ordinary (L k)-realCoordinate z k| (primitiveTests (a := a) (r := r) + (coordinateWindowPrimitives n q) e).val) (coordinateRectangle a L V).val) + (hinc : coordinateRectangle a L V ≤ + A.geometry.coordinateGate T.vertex T.offset z Prod.fst G.axialCut σ) + (f : TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm)) + (hf : B.AlignedSmallSupported f) + (hc : SmallControlled B.c f (B.windowSector (by omega) n (A.rectangles.rectangles n) q + (coordinateRectangle a L V))) + (I : ControlAlphabet (Fin (m+1))) (s : UniversalExtension (alternatingGroup I.val)) + (x : BoundedRelationCover M (alternatingGenerator a r m hm)) (hx : x ∈ f.range) : + A.primitiveStar (by omega) (slopeTestIndex d,u) (universalMap (subtypeAlternatingHom I.val) s)*x* + (A.primitiveStar (by omega) (slopeTestIndex d,u) (universalMap (subtypeAlternatingHom I.val) s))⁻¹ = + B.fullGeometricSector (by omega) (A.concurrentPrimitives T.vertex T.offset) (A.concurrentLaw T.vertex T.offset) + (T.polygons (fun _ : Unit => spatialTranslate u (clippedSlopePrimitive a r (slopeDirection d))) ()) + (universalMap (subtypeAlternatingHom I.val) s)*x* + (B.fullGeometricSector (by omega) (A.concurrentPrimitives T.vertex T.offset) (A.concurrentLaw T.vertex T.offset) + (T.polygons (fun _ : Unit => spatialTranslate u (clippedSlopePrimitive a r (slopeDirection d))) ()) + (universalMap (subtypeAlternatingHom I.val) s))⁻¹ := by + have hperiod := A.primitiveStar_periodic (by omega) (slopeTestIndex d) u G.period + change A.primitiveStar (by omega) (slopeTestIndex d,G.offset)=_ at hperiod + rw [← hperiod,A.primitiveStar_slope] + have ha := A.selected_active_slope_actions hlarge hr T slope hactive d hs.1 G.offset hs.2.symm + L V hLV hclip hnear n q hW f hf hc I s x hx + rw [hs.1,← A.concurrent_slope] at ha + apply ha.trans + have he := G.model_restrict_gate T hr hz₁ hz₂ lo hi slope hlo hhi hs hR σ + rw [ite_eq_left hσ] at he + have hactive' : cutForm a (slopeDirection d) z=ordinary (c slope) := by + simpa only [hs.1] using hactive + simp only [ConcurrentGeometry.localDecision,hs.1,hactive',↓reduceIte,compl_compl] at he + exact B.chart_action_transfer hlarge _ (A.concurrentLaw T.vertex T.offset) _ _ _ + (A.concurrent_positive_resolved T.vertex T.offset (slopeDirection d)) + (A.inward_model_resolved T _ ()) + (A.concurrent_coordinateGate_resolved T.vertex T.offset z Prod.fst G.axialCut σ) he.symm f hf + (A.coordinateGate_control hlarge T.vertex T.offset z Prod.fst G.axialCut σ n q _ hW hinc f hf hc) + I s x hx + +end InitialCoverSystem.PatchAtlas + +section CoordinateGerms + +theorem coordinatePrimitive_interval {a : ℕ} (j : Fin 2) : + coordinatePrimitive a j=coordinateInterval a j 0 (cutTau-1) := by + apply Subtype.ext + rw [← coordinateArc_tau] + have hzero : coordinateShift j 0=0 := by fin_cases j <;> simp [coordinateShift] + ext p + simp only [coordinateInterval,coordinateBetween,sub_zero,hzero,neg_zero,translate_zero, + Set.mem_preimage,coordinateArc,map_sub,map_one,Int.fract_sub_one] + +theorem local_coordinate_formula {a : ℕ} (d : Fin 2) (u : CutRing × CutRing) (z : ℝ × ℝ) : + ∃ k : ℤ, ∃ δ : ℝ, 0<δ ∧ ∀ p : GenericSquare a, dist p.val z<δ → + (p ∈ (spatialTranslate u (coordinatePrimitive a d)).val ↔ + ordinary (pointCoordinate u d+(k:CutRing))≤realCoordinate p.val d ∧ + realCoordinate p.val d rfl + simp only [l,h,map_add,map_sub,map_intCast,map_one,hcoord] + constructor <;> rintro ⟨h₁,h₂⟩ <;> constructor <;> linarith + +end CoordinateGerms + +namespace InitialCoverSystem.PatchAtlas +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} {B : InitialCoverSystem a r m hm M} + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] (A : B.PatchAtlas) + +theorem coordinate_concurrent_action (hlarge : 20 ≤ m+1) + (d : Fin 2) (v : CutRing × CutRing) + (t : VertexType (commonVertexDenominator a)) (u : CutRing × CutRing) (V : polygonAlgebra a) + (hV : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) (A.concurrentCoordinates t u) i).val) V.val) + (n : ℕ) (q : Fin 2 → ℤ) (W : polygonAlgebra a) + (hW : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) (coordinateWindowPrimitives n q) i).val) W.val) + (he : spatialTranslate v (coordinatePrimitive a d) ⊓ W=V ⊓ W) + (f : TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm)) + (hf : B.AlignedSmallSupported f) + (hc : SmallControlled B.c f (B.windowSector (by omega) n (A.rectangles.rectangles n) q W)) + (I : ControlAlphabet (Fin (m+1))) (s : UniversalExtension (alternatingGroup I.val)) + (x : BoundedRelationCover M (alternatingGenerator a r m hm)) (hx : x ∈ f.range) : + A.primitiveStar (by omega) (coordinateTestIndex d,v) (universalMap (subtypeAlternatingHom I.val) s)*x* + (A.primitiveStar (by omega) (coordinateTestIndex d,v) (universalMap (subtypeAlternatingHom I.val) s))⁻¹ = + B.fullGeometricSector (by omega) (A.concurrentPrimitives t u) (A.concurrentLaw t u) V + (universalMap (subtypeAlternatingHom I.val) s)*x* + (B.fullGeometricSector (by omega) (A.concurrentPrimitives t u) (A.concurrentLaw t u) V + (universalMap (subtypeAlternatingHom I.val) s))⁻¹ := by + let P := translatedTemplate (initialPatchPrimitives r A.geometry.mesh) v + let h := fun J (_ : J.card ≤ 15) b hb => A.initial v J b hb + let R : Unit → Fin 5 × (CutRing × CutRing) := fun _ => (coordinateTestIndex d,v) + let hR := fun J (_ : J.card ≤ 15) b hb => + B.coordinateFamilyLaw_all A.rectangles.rectangles (fun _ : Unit => d) (fun _ => v) J b hb + have horig := B.fullGeometricSector_shared_primitive (by omega) P R (Sum.inl (coordinateTestIndex d)) () + (by simp [P,R,translatedTemplate,initialPatchPrimitives]) h hR + (spatialTranslate v (coordinatePrimitive a d)) + (by intro y z hh; simpa only [P,primitiveTests,primitiveFamilyTests,translatedTemplate, + initialPatchPrimitives,Sum.elim_inl,add_zero,initialTest_coordinate] using hh ()) + let J : Sum (Fin 2) (Fin 2 × Fin (A.geometry.window-1)) → Fin 2 := Sum.elim id Prod.fst + let Z : Sum (Fin 2) (Fin 2 × Fin (A.geometry.window-1)) → CutRing × CutRing := + Sum.elim (fun k => u+A.geometry.anchors t (axisDirection k)) + (fun k => u+(coordinateWindowPrimitives A.geometry.window A.geometry.start k).2) + let Q := fun i => (coordinateTestIndex (J i),Z i) + let hQ := fun K (_ : K.card ≤ 15) b hb => B.coordinateFamilyLaw_all A.rectangles.rectangles J Z K b hb + have hQe : Q=A.concurrentCoordinates t u := (A.concurrentCoordinates_eq t u).symm + have hv : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) Q i).val) V.val := by + rw [hQe]; exact hV + have htarget := B.fullGeometricSector_subfamily (by omega) (A.concurrentPrimitives t u) Q + A.concurrentCoordinateEmbedding (by rw [hQe]; rfl) (A.concurrentLaw t u) hQ V hv + change B.fullGeometricSector (by omega) P h (spatialTranslate v (initialTest a r (coordinateTestIndex d))) + (universalMap (subtypeAlternatingHom I.val) s)*x* + (B.fullGeometricSector (by omega) P h (spatialTranslate v (initialTest a r (coordinateTestIndex d))) + (universalMap (subtypeAlternatingHom I.val) s))⁻¹ = _ + rw [initialTest_coordinate,horig,← htarget] + exact B.coordinate_charts_action hlarge A.rectangles.rectangles (fun _ : Unit => d) (fun _ => v) + J Z _ V W (fun y z hh => by simpa only [primitiveTests,primitiveFamilyTests,initialTest_coordinate] using hh ()) + hv n q hW he f hf hc I s x hx + +end InitialCoverSystem.PatchAtlas + +end SimpleAmenable + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/AlignedPolygonGeneration.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/AlignedPolygonGeneration.lean new file mode 100644 index 0000000000000000000000000000000000000000..e467745af9caeab1cf536e95297ecfaf287e6263 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/AlignedPolygonGeneration.lean @@ -0,0 +1,114 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.PrimitiveGeometricGeneration +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.AlignedGroups + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section AlignedPolygonGeneration + +variable (a : ℕ) (r : CutRing) (m : ℕ) (hm : 2 ≤ m) + +noncomputable def polygonAlignedGroup (I : Finset (Fin (m+1))) : + Subgroup (polygonFullGroup a (m+1)) := + alignedGroup (sourceLatticeFullMap a r m hm) + (fun b : SmallConditional m => conditionalHom (initialTest a r b.1) b.2.val) + (fun b => b.2.val.support ⊆ I) + +theorem fiveTrack_support_subset (ι : Fin 5 ↪ Fin (m+1)) + (g : alternatingGroup (Fin 5)) : + (fiveTrackHom ι g).support ⊆ Finset.univ.map ι := by + classical + intro i hi + by_contra hn + have hn' : i ∉ Set.range ι := by simpa using hn + exact (Equiv.Perm.mem_support.mp hi) + (Equiv.Perm.viaEmbedding_apply_of_notMem g.val ι i hn') + +theorem fiveTrack_initial_aligned (ι : Fin 5 ↪ Fin (m+1)) (j : Fin 5) : + ConditionalAvailable (fiveTrackHom ι) + (polygonAlignedGroup a r m hm (Finset.univ.map ι)) (initialTest a r j) := by + intro g + exact alignedGroup_input _ _ _ + ((j,⟨fiveTrackHom ι g,fiveTrack_sign ι g,fiveTrack_support ι g⟩) : SmallConditional m) + (fiveTrack_support_subset m ι g) + +theorem fiveTrack_translate_aligned (ι : Fin 5 ↪ Fin (m+1)) + (b : Fin (m+1)) (hb : b ∉ Set.range ι) (U : polygonAlgebra a) + (hU : ConditionalAvailable (fiveTrackHom ι) + (polygonAlignedGroup a r m hm (Finset.univ.map ι)) U) + (u : CutRing × CutRing) : + ConditionalAvailable (fiveTrackHom ι) + (polygonAlignedGroup a r m hm (Finset.univ.map ι)) + ⟨translate a u ⁻¹' U.val,polygon_preimage_translate u U.property⟩ := by + classical + obtain ⟨k,d,hk,hd⟩ := sourceLatticeFullMap_prescribed a r m hm + (Finset.univ.map ι) b (by simpa using hb) (fun _ => -u) + intro g + have hd' : ∀ i, fiveTrackHom ι g i ≠ i → d i = -u := by + intro i hi + exact hd i (fiveTrack_support_subset m ι g (Equiv.Perm.mem_support.mpr hi)) + have he := conditional_translation_conjugate U (fiveTrackHom ι g) d (-u) hd' + simp only [neg_neg] at he + rw [he,← hk] + exact alignedGroup_conjugate _ _ _ k (hU g) + +noncomputable def fiveTrackAlignedBoolean (ι : Fin 5 ↪ Fin (m+1)) : + BooleanSubalgebra (Set (GenericSquare a)) := + conditionalBoolean (fiveTrackHom ι) (polygonAlignedGroup a r m hm (Finset.univ.map ι)) + (fiveTrack_initial_aligned a r m hm ι 0) + +theorem fiveTrackAlignedBoolean_initial (ι : Fin 5 ↪ Fin (m+1)) (j : Fin 5) : + (initialTest a r j).val ∈ fiveTrackAlignedBoolean a r m hm ι := + ⟨(initialTest a r j).property,fiveTrack_initial_aligned a r m hm ι j⟩ + +theorem fiveTrackAlignedBoolean_translate (ι : Fin 5 ↪ Fin (m+1)) + (b : Fin (m+1)) (hb : b ∉ Set.range ι) (u : CutRing × CutRing) + {U : Set (GenericSquare a)} (hU : U ∈ fiveTrackAlignedBoolean a r m hm ι) : + translate a u ⁻¹' U ∈ fiveTrackAlignedBoolean a r m hm ι := by + obtain ⟨hU,hU'⟩ := hU + exact ⟨polygon_preimage_translate u hU, + fiveTrack_translate_aligned a r m hm ι b hb ⟨U,hU⟩ hU' u⟩ + +theorem fiveTrackAlignedBoolean_coordinate (ι : Fin 5 ↪ Fin (m+1)) + (b : Fin (m+1)) (hb : b ∉ Set.range ι) (j : Fin 2) (z : CutRing) : + halfPlane a (Fin.castLE (by omega) j) z ∈ fiveTrackAlignedBoolean a r m hm ι := by + apply coordinate_cuts_generated _ j + (fun u _ hU => fiveTrackAlignedBoolean_translate a r m hm ι b hb u hU) + fin_cases j + · exact fiveTrackAlignedBoolean_initial a r m hm ι 1 + · exact fiveTrackAlignedBoolean_initial a r m hm ι 2 + +theorem fiveTrack_polygon_aligned (hr : 0 < ordinary r ∧ ordinary r < 1/2) + (ι : Fin 5 ↪ Fin (m+1)) (b : Fin (m+1)) (hb : b ∉ Set.range ι) + (U : polygonAlgebra a) : ConditionalAvailable (fiveTrackHom ι) + (polygonAlignedGroup a r m hm (Finset.univ.map ι)) U := by + let B := fiveTrackAlignedBoolean a r m hm ι + have hcoord := fiveTrackAlignedBoolean_coordinate a r m hm ι b hb + have htrans := fun u U hU => fiveTrackAlignedBoolean_translate a r m hm ι b hb u (U := U) hU + have hv : U.val ∈ B := by + apply polygon_induction (P := fun U => U ∈ B) ?_ BooleanSubalgebra.bot_mem + (fun _ _ hU hV => BooleanSubalgebra.sup_mem hU hV) + (fun _ hU => BooleanSubalgebra.compl_mem hU) U.property + intro j z + fin_cases j + · exact hcoord 0 z + · exact hcoord 1 z + · exact slope_cuts_generated r hr B htrans hcoord 2 (Or.inl rfl) + (fiveTrackAlignedBoolean_initial a r m hm ι 3) z + · exact slope_cuts_generated r hr B htrans hcoord 3 (Or.inr rfl) + (fiveTrackAlignedBoolean_initial a r m hm ι 4) z + exact hv.choose_spec + +end AlignedPolygonGeneration + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/AllWindowAction.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/AllWindowAction.lean new file mode 100644 index 0000000000000000000000000000000000000000..f0eb0443e8b8b3c9e73f35e809327032648cf452 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/AllWindowAction.lean @@ -0,0 +1,66 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.RectangularBound + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section AllWindowAction +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + +theorem all_window_action_comparison (hlarge : 20 ≤ m+1) + (h : ∀ n, B.CoordinateWindowLaw n) + (k : Fin 3 → ℕ) (p : Fin 3 → Fin 2 → ℤ) (V : Fin 3 → polygonAlgebra a) + (hV : ∀ i, ResolvedBy (fun t => (primitiveTests (a := a) (r := r) + (coordinateWindowPrimitives (k i) (p i)) t).val) (V i).val) + (he : V 0 ⊓ V 2 = V 1 ⊓ V 2) + (f : TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm)) + (hf : B.AlignedSmallSupported f) + (hc : SmallControlled B.c f (B.windowSector (by omega) (k 2) (h (k 2)) (p 2) (V 2))) + (I : ControlAlphabet (Fin (m+1))) (s : UniversalExtension (alternatingGroup I.val)) : + ∀ x ∈ f.range, + B.windowSector (by omega) (k 0) (h (k 0)) (p 0) (V 0) + (universalMap (subtypeAlternatingHom I.val) s)*x* + (B.windowSector (by omega) (k 0) (h (k 0)) (p 0) (V 0) + (universalMap (subtypeAlternatingHom I.val) s))⁻¹ = + B.windowSector (by omega) (k 1) (h (k 1)) (p 1) (V 1) + (universalMap (subtypeAlternatingHom I.val) s)*x* + (B.windowSector (by omega) (k 1) (h (k 1)) (p 1) (V 1) + (universalMap (subtypeAlternatingHom I.val) s))⁻¹ := by + obtain ⟨n,q,hq⟩ := finite_coordinate_windows_container k p + have heq i : B.windowSector (by omega) (k i) (h (k i)) (p i) (V i) = + B.windowSector (by omega) n (h n) q (V i) := + B.windowSector_inclusion (by omega) n (k i) (h n) (h (k i)) q (p i) + (fun j => (hq i j).1) (fun j => (hq i j).2) (V i) (hV i) + have hres i : ResolvedBy (fun t => (primitiveTests (a := a) (r := r) + (coordinateWindowPrimitives n q) t).val) (V i).val := by + intro x y hxy + apply hV i x y + intro t + have ht := hxy (coordinateWindowEmbedding n (k i) q (p i) + (fun j => (hq i j).1) (fun j => (hq i j).2) t) + have hs := congrFun (coordinateWindowEmbedding_spec n (k i) q (p i) + (fun j => (hq i j).1) (fun j => (hq i j).2)) t + dsimp only [Function.comp_def] at hs + simpa only [primitiveTests,primitiveFamilyTests,hs] using ht + rw [heq 2] at hc + rw [heq 0,heq 1] + exact B.chart_action_transfer hlarge (coordinateWindowPrimitives n q) + (fun I _ b hb => h n I b hb q) (V 0) (V 1) (V 2) + (hres 0) (hres 1) (hres 2) he f hf hc I s + +end InitialCoverSystem +end AllWindowAction + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/AlphabetAlignedGeneration.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/AlphabetAlignedGeneration.lean new file mode 100644 index 0000000000000000000000000000000000000000..54b558a183f2fe6c6151f6a93632d67a49b7bf38 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/AlphabetAlignedGeneration.lean @@ -0,0 +1,200 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.AlignedPolygonGeneration + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section AlphabetAlignedGeneration + +noncomputable def alphabetHom {n m : ℕ} (ι : Fin n ↪ Fin m) : + alternatingGroup (Fin n) →* Equiv.Perm (Fin m) := + (Equiv.Perm.viaEmbeddingHom ι).comp (alternatingGroup (Fin n)).subtype + +theorem alphabet_sign {n m : ℕ} (ι : Fin n ↪ Fin m) + (g : alternatingGroup (Fin n)) : alphabetHom ι g ∈ alternatingGroup (Fin m) := by + classical + change Equiv.Perm.sign (g.val.viaEmbedding ι) = 1 + rw [Equiv.Perm.viaEmbedding,Equiv.Perm.sign_extendDomain] + exact g.property + +theorem alphabet_support_subset {n m : ℕ} (ι : Fin n ↪ Fin m) + (g : alternatingGroup (Fin n)) : + (alphabetHom ι g).support ⊆ Finset.univ.map ι := by + classical + intro i hi + by_contra hn + have hn' : i ∉ Set.range ι := by simpa using hn + exact (Equiv.Perm.mem_support.mp hi) + (Equiv.Perm.viaEmbedding_apply_of_notMem g.val ι i hn') + +theorem alphabet_support_card {n m : ℕ} (ι : Fin n ↪ Fin m) + (g : alternatingGroup (Fin n)) : (alphabetHom ι g).support.card = g.val.support.card := by + classical + exact @Equiv.Perm.card_support_extend_domain (Fin n) _ _ (Fin m) _ _ + (Set.range ι.toFun) (Classical.decPred _) (Equiv.ofInjective ι.toFun ι.injective) g.val + +variable (a : ℕ) (r : CutRing) (m : ℕ) (hm : 2 ≤ m) {n : ℕ} + +theorem alphabet_initial_aligned (ι : Fin n ↪ Fin (m+1)) (j : Fin 5) : + ConditionalAvailable (alphabetHom ι) + (polygonAlignedGroup a r m hm (Finset.univ.map ι)) (initialTest a r j) := by + let f := (conditionalHom (initialTest a r j)).comp (alphabetHom ι) + have hh : Subgroup.closure {g : alternatingGroup (Fin n) | + Equiv.Perm.IsThreeCycle g.val} ≤ + (polygonAlignedGroup a r m hm (Finset.univ.map ι)).comap f := by + apply (Subgroup.closure_le _).mpr + intro g hg + have hc : (alphabetHom ι g).support.card ≤ 5 := by + rw [alphabet_support_card, hg.card_support] + omega + exact alignedGroup_input _ _ _ + ((j,⟨alphabetHom ι g,alphabet_sign ι g,hc⟩) : SmallConditional m) + (alphabet_support_subset ι g) + rw [alternatingGroup.closure_isThreeCycles_eq_top] at hh + exact fun g => hh (Subgroup.mem_top g) + +theorem alphabet_translate_aligned (ι : Fin n ↪ Fin (m+1)) + (b : Fin (m+1)) (hb : b ∉ Set.range ι) (U : polygonAlgebra a) + (hU : ConditionalAvailable (alphabetHom ι) + (polygonAlignedGroup a r m hm (Finset.univ.map ι)) U) + (u : CutRing × CutRing) : + ConditionalAvailable (alphabetHom ι) + (polygonAlignedGroup a r m hm (Finset.univ.map ι)) + ⟨translate a u ⁻¹' U.val,polygon_preimage_translate u U.property⟩ := by + classical + obtain ⟨k,d,hk,hd⟩ := sourceLatticeFullMap_prescribed a r m hm + (Finset.univ.map ι) b (by simpa using hb) (fun _ => -u) + intro g + have hd' : ∀ i, alphabetHom ι g i ≠ i → d i = -u := by + intro i hi + exact hd i (alphabet_support_subset ι g (Equiv.Perm.mem_support.mpr hi)) + have he := conditional_translation_conjugate U (alphabetHom ι g) d (-u) hd' + simp only [neg_neg] at he + rw [he,← hk] + exact alignedGroup_conjugate _ _ _ k (hU g) + +variable [Group.IsPerfect (alternatingGroup (Fin n))] + +noncomputable def alphabetAlignedBoolean (ι : Fin n ↪ Fin (m+1)) : + BooleanSubalgebra (Set (GenericSquare a)) := + conditionalBoolean (alphabetHom ι) (polygonAlignedGroup a r m hm (Finset.univ.map ι)) + (alphabet_initial_aligned a r m hm ι 0) + +theorem alphabetAlignedBoolean_initial (ι : Fin n ↪ Fin (m+1)) (j : Fin 5) : + (initialTest a r j).val ∈ alphabetAlignedBoolean a r m hm ι := + ⟨(initialTest a r j).property,alphabet_initial_aligned a r m hm ι j⟩ + +theorem alphabetAlignedBoolean_translate (ι : Fin n ↪ Fin (m+1)) + (b : Fin (m+1)) (hb : b ∉ Set.range ι) (u : CutRing × CutRing) + {U : Set (GenericSquare a)} (hU : U ∈ alphabetAlignedBoolean a r m hm ι) : + translate a u ⁻¹' U ∈ alphabetAlignedBoolean a r m hm ι := by + obtain ⟨hU,hU'⟩ := hU + exact ⟨polygon_preimage_translate u hU, + alphabet_translate_aligned a r m hm ι b hb ⟨U,hU⟩ hU' u⟩ + +theorem alphabetAlignedBoolean_coordinate (ι : Fin n ↪ Fin (m+1)) + (b : Fin (m+1)) (hb : b ∉ Set.range ι) (j : Fin 2) (z : CutRing) : + halfPlane a (Fin.castLE (by omega) j) z ∈ alphabetAlignedBoolean a r m hm ι := by + apply coordinate_cuts_generated _ j + (fun u _ hU => alphabetAlignedBoolean_translate a r m hm ι b hb u hU) + fin_cases j + · exact alphabetAlignedBoolean_initial a r m hm ι 1 + · exact alphabetAlignedBoolean_initial a r m hm ι 2 + +theorem alphabet_polygon_aligned (hr : 0 < ordinary r ∧ ordinary r < 1/2) + (ι : Fin n ↪ Fin (m+1)) (b : Fin (m+1)) (hb : b ∉ Set.range ι) + (U : polygonAlgebra a) : ConditionalAvailable (alphabetHom ι) + (polygonAlignedGroup a r m hm (Finset.univ.map ι)) U := by + let B := alphabetAlignedBoolean a r m hm ι + have hcoord := alphabetAlignedBoolean_coordinate a r m hm ι b hb + have htrans := fun u U hU => alphabetAlignedBoolean_translate a r m hm ι b hb u (U := U) hU + have hv : U.val ∈ B := by + apply polygon_induction (P := fun U => U ∈ B) ?_ BooleanSubalgebra.bot_mem + (fun _ _ hU hV => BooleanSubalgebra.sup_mem hU hV) + (fun _ hU => BooleanSubalgebra.compl_mem hU) U.property + intro j z + fin_cases j + · exact hcoord 0 z + · exact hcoord 1 z + · exact slope_cuts_generated r hr B htrans hcoord 2 (Or.inl rfl) + (alphabetAlignedBoolean_initial a r m hm ι 3) z + · exact slope_cuts_generated r hr B htrans hcoord 3 (Or.inr rfl) + (alphabetAlignedBoolean_initial a r m hm ι 4) z + exact hv.choose_spec + +end AlphabetAlignedGeneration + +section CentralLaws + +variable {D M H : Type*} [Group D] [Group M] [Group H] + +def HasCentralLaw (v : D →* M) (f : D →* H) : Prop := + v.ker ≤ ((QuotientGroup.mk' (Subgroup.center H)).comp f).ker + +theorem hasCentralLaw_iff (v : D →* M) (f : D →* H) : + HasCentralLaw v f ↔ ∀ w, v w = 1 → f w ∈ Subgroup.center H := by + constructor + · intro h w hw + have hh : f w ∈ (QuotientGroup.mk' (Subgroup.center H)).ker := h hw + rwa [QuotientGroup.ker_mk'] at hh + · intro h w hw + change f w ∈ (QuotientGroup.mk' (Subgroup.center H)).ker + rw [QuotientGroup.ker_mk'] + exact h w hw + +theorem hasCentralLaw_iff_modelMap (v : D →* M) (f : D →* H) + (hv : Function.Surjective v) : HasCentralLaw v f ↔ + ∃ φ : M →* H ⧸ Subgroup.center H, + φ.comp v = (QuotientGroup.mk' (Subgroup.center H)).comp f := by + constructor + · intro h + exact ⟨v.liftOfSurjective hv ⟨_,h⟩, v.liftOfRightInverse_comp _ _ _⟩ + · rintro ⟨φ,hφ⟩ w hw + change QuotientGroup.mk' (Subgroup.center H) (f w) = 1 + have hh := DFunLike.congr_fun hφ w + change φ (v w) = _ at hh + rw [show v w = 1 from hw, map_one] at hh + exact hh.symm + +theorem centralLaw_modelMap_surjective (v : D →* M) (f : D →* H) + (hf : Function.Surjective f) (φ : M →* H ⧸ Subgroup.center H) + (hφ : φ.comp v = (QuotientGroup.mk' (Subgroup.center H)).comp f) : + Function.Surjective φ := by + intro x + obtain ⟨y,rfl⟩ := QuotientGroup.mk'_surjective (Subgroup.center H) x + obtain ⟨w,rfl⟩ := hf y + exact ⟨v w, DFunLike.congr_fun hφ w⟩ + +theorem HasCentralLaw.map {Q : Type*} [Group Q] {v : D →* M} {f : D →* H} + (h : HasCentralLaw v f) (q : H →* Q) (hq : Function.Surjective q) : + HasCentralLaw v (q.comp f) := by + rw [hasCentralLaw_iff] at h ⊢ + intro w hw + apply Subgroup.mem_center_iff.mpr + intro x + obtain ⟨y,rfl⟩ := hq x + simpa only [map_mul, MonoidHom.comp_apply] using + congrArg q (Subgroup.mem_center_iff.mp (h w hw) y) + +theorem centralLaw_of_quotient [Group.IsPerfect H] (v : D →* M) (f : D →* H) + (h : HasCentralLaw v ((QuotientGroup.mk' (Subgroup.center H)).comp f)) : + HasCentralLaw v f := by + rw [hasCentralLaw_iff] at h ⊢ + intro w hw + have hh := h w hw + rw [perfect_center_quotient] at hh + have hh' : f w ∈ (QuotientGroup.mk' (Subgroup.center H)).ker := hh + rwa [QuotientGroup.ker_mk'] at hh' + +end CentralLaws + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/AssignmentAtoms.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/AssignmentAtoms.lean new file mode 100644 index 0000000000000000000000000000000000000000..b5b4c986c552f81278ff33b5e1b502dfa48de042 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/AssignmentAtoms.lean @@ -0,0 +1,210 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Configurations.ReserveAtom + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section AssignmentAtoms + +variable {I Ω : Type*} [Fintype I] [DecidableEq I] [DecidableEq Ω] + +noncomputable def assignmentAtom (a : SwapLabel I) (t : Ω × SwapLabel I) : + Ω → alternatingGroup I := Pi.mulSingle (M := fun _ : Ω => alternatingGroup I) t.1 (reserveAtom a t.2) + +theorem supported_assignmentAtoms_generate [Finite Ω] (S : Finset I) (a : SwapLabel I) + (ha : a.val.support ⊆ S) (g : Ω → alternatingGroup I) + (hg : ∀ ω, (g ω).val.support ⊆ S) : + g ∈ Subgroup.closure (Set.range (fun t : {t : Ω × SwapLabel I // t.2.val.support ⊆ S} => + assignmentAtom a t.val)) := by + let K := Subgroup.closure (Set.range + (fun t : {t : Ω × SwapLabel I // t.2.val.support ⊆ S} => assignmentAtom a t.val)) + apply Subgroup.pi_mem_of_mulSingle_mem g + intro ω + have hle : Subgroup.closure {h : alternatingGroup I | ∃ t : SwapLabel I, + t.val.support ⊆ S ∧ h = reserveAtom a t} ≤ + K.comap (MonoidHom.mulSingle (fun _ : Ω => alternatingGroup I) ω) := by + apply (Subgroup.closure_le _).mpr + rintro _ ⟨t,ht,rfl⟩ + exact Subgroup.subset_closure ⟨⟨(ω,t),ht⟩,rfl⟩ + exact hle (supported_reserveAtoms_generate S a ha (g ω) (hg ω)) + +theorem assignmentAtoms_generate [Finite Ω] (a : SwapLabel I) : + Subgroup.closure (Set.range (assignmentAtom (Ω := Ω) a)) = ⊤ := by + apply top_unique + intro g _ + have h := supported_assignmentAtoms_generate Finset.univ a (Finset.subset_univ _) g + (fun _ => Finset.subset_univ _) + have hsub : Set.range (fun t : {t : Ω × SwapLabel I // t.2.val.support ⊆ Finset.univ} => + assignmentAtom a t.val) ⊆ Set.range (assignmentAtom a) := by + rintro _ ⟨t,rfl⟩ + exact ⟨t.val,rfl⟩ + exact Subgroup.closure_mono hsub h + +instance assignmentSwapMulAction : MulAction (Ω → alternatingGroup I) (Ω × SwapLabel I) where + smul g t := (t.1, swapLabelConj (g t.1).val t.2) + one_smul t := by + apply Prod.ext rfl + apply Subtype.ext + change 1 * t.2.val * 1⁻¹ = t.2.val + simp + mul_smul g h t := by + apply Prod.ext rfl + apply Subtype.ext + change (g t.1).val * (h t.1).val * t.2.val * + ((g t.1).val * (h t.1).val)⁻¹ = + (g t.1).val * ((h t.1).val * t.2.val * (h t.1).val⁻¹) * (g t.1).val⁻¹ + group + +omit [DecidableEq Ω] in +theorem assignmentSwap_smul_fst (g : Ω → alternatingGroup I) (t : Ω × SwapLabel I) : + (g • t).1 = t.1 := rfl + +theorem assignmentSwap_base_atom (a : SwapLabel I) (ω : Ω) : + assignmentAtom a (ω,a) = 1 := by + simp [assignmentAtom,reserveAtom_base] + +theorem assignmentAtom_conjugation (a : SwapLabel I) (g : Ω → alternatingGroup I) + (t : Ω × SwapLabel I) : + g * assignmentAtom a t * g⁻¹ = + (assignmentAtom a (g • (t.1,a)))⁻¹ * assignmentAtom a (g • t) := by + funext ω + by_cases hω : ω = t.1 + · subst ω + change g t.1 * Pi.mulSingle (M := fun _ : Ω => alternatingGroup I) t.1 (reserveAtom a t.2) t.1 * (g t.1)⁻¹ = + (Pi.mulSingle (M := fun _ : Ω => alternatingGroup I) t.1 (reserveAtom a (swapLabelConj (g t.1).val a)) t.1)⁻¹ * + Pi.mulSingle (M := fun _ : Ω => alternatingGroup I) t.1 (reserveAtom a (swapLabelConj (g t.1).val t.2)) t.1 + simp only [Pi.mulSingle_eq_same] + apply Subtype.ext + rw [reserveAtom_difference] + change (g t.1).val * (a.val * t.2.val) * (g t.1).val⁻¹ = + ((g t.1).val * a.val * (g t.1).val⁻¹) * + ((g t.1).val * t.2.val * (g t.1).val⁻¹) + group + · change g ω * Pi.mulSingle (M := fun _ : Ω => alternatingGroup I) t.1 (reserveAtom a t.2) ω * (g ω)⁻¹ = + (Pi.mulSingle (M := fun _ : Ω => alternatingGroup I) t.1 (reserveAtom a (swapLabelConj (g t.1).val a)) ω)⁻¹ * + Pi.mulSingle (M := fun _ : Ω => alternatingGroup I) t.1 (reserveAtom a (swapLabelConj (g t.1).val t.2)) ω + simp [Pi.mulSingle_eq_of_ne hω] + +end AssignmentAtoms + +section SupportedAtomWords + +variable {J K D Q : Type*} [Group D] [Group Q] + +theorem hom_comp_freeLift (q : D →* Q) (u : J → D) : + q.comp (FreeGroup.lift u) = FreeGroup.lift (fun j => q (u j)) := by + apply FreeGroup.ext_hom + intro j + simp + +theorem freeLift_comp_map (u : J → D) (b : K → J) : + (FreeGroup.lift u).comp (FreeGroup.map b) = FreeGroup.lift (fun k => u (b k)) := by + apply FreeGroup.ext_hom + intro k + simp + +variable {I Ω : Type*} [Fintype I] [DecidableEq I] [DecidableEq Ω] [Finite Ω] + +theorem supported_atom_word (L : Finset I → Subgroup D) (hmono : Monotone L) + (E : Finset I) (a : SwapLabel I) (ha : a.val.support ⊆ E) + (u : Ω × SwapLabel I → D) + (hu : ∀ t, u t ∈ L (E ∪ t.2.val.support)) + (S : Finset I) (hES : E ⊆ S) (g : Ω → alternatingGroup I) + (hg : ∀ ω, (g ω).val.support ⊆ S) : + ∃ w : FreeGroup (Ω × SwapLabel I), + FreeGroup.lift (assignmentAtom a) w = g ∧ FreeGroup.lift u w ∈ L S := by + let T := {t : Ω × SwapLabel I // t.2.val.support ⊆ S} + have hm : g ∈ (FreeGroup.lift (fun t : T => assignmentAtom a t.val)).range := by + rw [FreeGroup.range_lift_eq_closure] + exact supported_assignmentAtoms_generate S a (ha.trans hES) g hg + obtain ⟨w,hw⟩ := hm + have hle : (FreeGroup.lift (fun t : T => u t.val)).range ≤ L S := by + rw [FreeGroup.range_lift_eq_closure] + apply (Subgroup.closure_le _).mpr + rintro _ ⟨t,rfl⟩ + exact hmono (Finset.union_subset hES t.property) (hu t.val) + refine ⟨FreeGroup.map (Subtype.val : T → Ω × SwapLabel I) w, ?_, ?_⟩ + · change ((FreeGroup.lift (assignmentAtom a)).comp (FreeGroup.map Subtype.val)) w = g + rw [freeLift_comp_map] + exact hw + · change ((FreeGroup.lift u).comp (FreeGroup.map Subtype.val)) w ∈ L S + rw [freeLift_comp_map] + exact hle ⟨w,rfl⟩ + +end SupportedAtomWords + +section AtomSupportBounds + +variable {I Ω : Type*} [Fintype I] [DecidableEq I] [DecidableEq Ω] + +theorem swapLabel_card_support (t : SwapLabel I) : t.val.support.card = 2 := + Equiv.Perm.card_support_eq_two.mpr t.property + +theorem swapLabelConj_support (g : Equiv.Perm I) (t : SwapLabel I) (S : Finset I) + (hg : g.support ⊆ S) (ht : t.val.support ⊆ S) : + (swapLabelConj g t).val.support ⊆ S := by + change (g * t.val * g⁻¹).support ⊆ S + apply (Equiv.Perm.support_mul_le _ _).trans + apply Finset.union_subset + · exact (Equiv.Perm.support_mul_le _ _).trans (Finset.union_subset hg ht) + · simpa only [Equiv.Perm.support_inv] using hg + +theorem assignmentAtom_support (a : SwapLabel I) (t : Ω × SwapLabel I) (ω : Ω) : + ((assignmentAtom a t) ω).val.support ⊆ a.val.support ∪ t.2.val.support := by + by_cases h : ω = t.1 + · subst ω + change (Pi.mulSingle (M := fun _ : Ω => alternatingGroup I) t.1 + (reserveAtom a t.2) t.1).val.support ⊆ _ + rw [Pi.mulSingle_eq_same] + exact Equiv.Perm.support_mul_le a.val t.2.val + · simp only [assignmentAtom,Pi.mulSingle_eq_of_ne h,OneMemClass.coe_one, + Equiv.Perm.support_one,Finset.empty_subset] + +theorem atom_conjugation_support (E : Finset I) (a : SwapLabel I) + (ha : a.val.support ⊆ E) (s t : Ω × SwapLabel I) : + ((assignmentAtom a s • (t.1,a)).2).val.support ⊆ + E ∪ s.2.val.support ∪ t.2.val.support ∧ + ((assignmentAtom a s • t).2).val.support ⊆ + E ∪ s.2.val.support ∪ t.2.val.support := by + have hgs : ((assignmentAtom a s) t.1).val.support ⊆ + E ∪ s.2.val.support ∪ t.2.val.support := + (assignmentAtom_support a s t.1).trans + ((Finset.union_subset_union_left ha).trans Finset.subset_union_left) + constructor + · exact swapLabelConj_support _ _ _ hgs + (ha.trans (Finset.subset_union_left.trans Finset.subset_union_left)) + · exact swapLabelConj_support _ _ _ hgs Finset.subset_union_right + +variable {D : Type*} [Group D] + +theorem exists_supported_atom_words (L : Finset I → Subgroup D) + (v : D →* (Ω → alternatingGroup I)) (E : Finset I) (hE : E.card = 5) + (a : SwapLabel I) (ha : a.val.support ⊆ E) + (hcomplete : ∀ S : Finset I, 5 ≤ S.card → S.card ≤ 7 → ∀ g : Ω → alternatingGroup I, + (∀ ω, (g ω).val.support ⊆ S) → ∃ d ∈ L S, v d = g) : + ∃ u : Ω × SwapLabel I → D, ∀ t, + u t ∈ L (E ∪ t.2.val.support) ∧ v (u t) = assignmentAtom a t := by + classical + have h (t : Ω × SwapLabel I) : ∃ d ∈ L (E ∪ t.2.val.support), + v d = assignmentAtom a t := by + apply hcomplete (E ∪ t.2.val.support) + · rw [← hE] + exact Finset.card_le_card Finset.subset_union_left + · exact (Finset.card_union_le _ _).trans (by rw [hE,swapLabel_card_support]) + · intro ω + exact (assignmentAtom_support a t ω).trans (Finset.union_subset_union_left ha) + choose u hu hv using h + exact ⟨u,fun t => ⟨hu t,hv t⟩⟩ + +end AtomSupportBounds + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/AssignmentGeneration.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/AssignmentGeneration.lean new file mode 100644 index 0000000000000000000000000000000000000000..f60645f8dc3b727efa65a63b178d87706149c3fb --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/AssignmentGeneration.lean @@ -0,0 +1,299 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.DirectFactors +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.CanonicalSectors + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section AssignmentGeneration +open scoped commutatorElement +variable {E Ω : Type*} [Group E] + +theorem sectorMask_inter_commutator (U V : Set Ω) (s t : E) : + sectorMask (U ∩ V) ⁅s,t⁆ = ⁅sectorMask U s,sectorMask V t⁆ := by + classical + ext ω + by_cases hu : ω ∈ U <;> by_cases hv : ω ∈ V <;> + simp [sectorMask, hu, hv, commutatorElement_def] + +theorem sectorMask_complement (U : Set Ω) (s : E) : + sectorMask Uᶜ s = sectorMask Set.univ s * (sectorMask U s)⁻¹ := by + classical + ext ω + by_cases hu : ω ∈ U <;> simp [sectorMask, hu] + +def SectorAvailable (K : Subgroup (Ω → E)) (U : Set Ω) : Prop := + ∀ s, sectorMask U s ∈ K + +theorem sectorAvailable_inter [Group.IsPerfect E] (K : Subgroup (Ω → E)) + {U V : Set Ω} (hU : SectorAvailable K U) (hV : SectorAvailable K V) : + SectorAvailable K (U ∩ V) := by + let L := K.comap (sectorMask (U ∩ V)) + have hL : commutator E ≤ L := by + rw [commutator_def] + apply Subgroup.commutator_le.mpr + intro s _ t _ + change sectorMask (U ∩ V) ⁅s,t⁆ ∈ K + rw [sectorMask_inter_commutator] + exact Subgroup.commutator_le_self K (Subgroup.commutator_mem_commutator (hU s) (hV t)) + intro s + exact hL (Group.IsPerfect.commutator_eq_top (G := E) ▸ Subgroup.mem_top s) + +theorem sectorAvailable_compl (K : Subgroup (Ω → E)) + (hwhole : SectorAvailable K Set.univ) {U : Set Ω} (hU : SectorAvailable K U) : + SectorAvailable K Uᶜ := by + intro s + rw [sectorMask_complement] + exact K.mul_mem (hwhole s) (K.inv_mem (hU s)) + +theorem sectorAvailable_finsetInter [Group.IsPerfect E] {ι : Type*} + (K : Subgroup (Ω → E)) (hwhole : SectorAvailable K Set.univ) + (U : ι → Set Ω) (S : Finset ι) (hU : ∀ i ∈ S, SectorAvailable K (U i)) : + SectorAvailable K (⋂ i ∈ S, U i) := by + classical + induction S using Finset.induction_on with + | empty => simpa using hwhole + | @insert i S hi ih => + rw [Finset.set_biInter_insert] + exact sectorAvailable_inter K (hU i (Finset.mem_insert_self _ _)) + (ih (fun j hj => hU j (Finset.mem_insert_of_mem hj))) + +theorem assignment_group_generated [Group.IsPerfect E] [Finite Ω] + {ι : Type*} [Finite ι] (U : ι → Set Ω) + (hsep : ∀ ω ν : Ω, (∀ i, ω ∈ U i ↔ ν ∈ U i) → ω = ν) + (K : Subgroup (Ω → E)) (hwhole : SectorAvailable K Set.univ) + (hU : ∀ i, SectorAvailable K (U i)) : K = ⊤ := by + classical + let := Fintype.ofFinite ι + have hsingle (ω : Ω) : SectorAvailable K {ω} := by + let V : ι → Set Ω := fun i => if ω ∈ U i then U i else (U i)ᶜ + have hV (i : ι) : SectorAvailable K (V i) := by + dsimp [V] + split_ifs + · exact hU i + · exact sectorAvailable_compl K hwhole (hU i) + have heq : (⋂ i ∈ Finset.univ, V i) = {ω} := by + ext ν + simp only [Set.mem_iInter, Finset.mem_univ, true_implies, Set.mem_singleton_iff] + constructor + · intro hν + apply hsep ν ω + intro i + have ht := hν i + by_cases hi : ω ∈ U i <;> simp_all [V] + · intro hνω i + subst ν + by_cases hi : ω ∈ U i <;> simp [V, hi] + rw [← heq] + exact sectorAvailable_finsetInter K hwhole V Finset.univ (fun i _ => hV i) + apply top_unique + intro f _ + apply Subgroup.pi_mem_of_mulSingle_mem f + intro ω + convert hsingle ω (f ω) using 1 + ext ν + by_cases h : ν = ω + · subst ν + simp + · simp [sectorMask, h] + +end AssignmentGeneration + +section FiniteDirectRefinement +variable {G : Type*} [Group G] + +namespace CommutingFactors +variable {A B C D : Subgroup G} + +noncomputable def projectLeft (h : CommutingFactors A B) + (hz : Subgroup.center G = ⊥) : G →* G := + A.subtype.comp ((MonoidHom.fst A B).comp (h.productEquiv hz).symm.toMonoidHom) + +@[simp] theorem projectLeft_mem (h : CommutingFactors A B) + (hz : Subgroup.center G = ⊥) (x : G) : h.projectLeft hz x ∈ A := + ((h.productEquiv hz).symm x).1.property + +theorem projectLeft_factors (h : CommutingFactors A B) + (hz : Subgroup.center G = ⊥) {a b : G} (ha : a ∈ A) (hb : b ∈ B) : + h.projectLeft hz (a*b) = a := by + change (((h.productEquiv hz).symm (a*b)).1 : G) = a + have hh : (h.productEquiv hz).symm (a*b) = (⟨a,ha⟩,⟨b,hb⟩) := by + apply (h.productEquiv hz).injective + simp only [MulEquiv.apply_symm_apply, productEquiv_apply] + rw [hh] + +theorem projectLeft_fix (h : CommutingFactors A B) + (hz : Subgroup.center G = ⊥) {a : G} (ha : a ∈ A) : h.projectLeft hz a = a := by + simpa using h.projectLeft_factors hz ha B.one_mem + +theorem projectLeft_kill (h : CommutingFactors A B) + (hz : Subgroup.center G = ⊥) {b : G} (hb : b ∈ B) : h.projectLeft hz b = 1 := by + simpa using h.projectLeft_factors hz A.one_mem hb + +theorem projectLeft_split (h : CommutingFactors A B) + (hz : Subgroup.center G = ⊥) (x : G) : + x = h.projectLeft hz x * h.symm.projectLeft hz x := by + obtain ⟨a,ha,b,hb,rfl⟩ := h.cover x + rw [h.projectLeft_factors hz ha hb] + rw [(h.commute a ha b hb).eq, h.symm.projectLeft_factors hz hb ha] + exact (h.commute a ha b hb).eq.symm + +theorem projectLeft_preserves (h : CommutingFactors A B) (k : CommutingFactors C D) + (hz : Subgroup.center G = ⊥) {x : G} (hx : x ∈ C) : h.projectLeft hz x ∈ C := by + apply k.mem_left_of_commute_right hz + intro y hy + apply h.left_component_commutes hz (h.projectLeft_mem hz x) + (h.symm.projectLeft_mem hz x) + rw [← h.projectLeft_split hz x] + exact k.commute x hx y hy + +theorem projectLeft_comp_commute (h : CommutingFactors A B) (k : CommutingFactors C D) + (hz : Subgroup.center G = ⊥) : + (h.projectLeft hz).comp (k.projectLeft hz) = + (k.projectLeft hz).comp (h.projectLeft hz) := by + ext x + obtain ⟨a,ha,b,hb,rfl⟩ := h.cover x + simp only [MonoidHom.comp_apply, map_mul] + rw [h.projectLeft_fix hz ha, h.projectLeft_kill hz hb, map_one, mul_one, + h.projectLeft_fix hz (k.projectLeft_preserves h hz ha), + h.projectLeft_kill hz (k.projectLeft_preserves h.symm hz hb), mul_one] + +end CommutingFactors + +def assignmentFactor {ι : Type*} (A : ι → Subgroup G) (S : Finset ι) : Subgroup G := + ⨅ i ∈ S, A i + +theorem projectLeft_mem_assignmentFactor {ι : Type*} + (A B : ι → Subgroup G) (h : ∀ i, CommutingFactors (A i) (B i)) + {C D : Subgroup G} (k : CommutingFactors C D) (hz : Subgroup.center G = ⊥) + (S : Finset ι) {x : G} (hx : x ∈ assignmentFactor A S) : + k.projectLeft hz x ∈ assignmentFactor A S := by + simp only [assignmentFactor, Subgroup.mem_iInf] at hx ⊢ + intro i hi + exact k.projectLeft_preserves (h i) hz (hx i hi) + +theorem split_assignmentFactor {ι : Type*} + (A B : ι → Subgroup G) (h : ∀ i, CommutingFactors (A i) (B i)) + {C D : Subgroup G} (k : CommutingFactors C D) (hz : Subgroup.center G = ⊥) + (S : Finset ι) {x : G} (hx : x ∈ assignmentFactor A S) : + ∃ c ∈ assignmentFactor A S ⊓ C, ∃ d ∈ assignmentFactor A S ⊓ D, x = c*d := by + refine ⟨k.projectLeft hz x, ⟨?_,k.projectLeft_mem hz x⟩, + k.symm.projectLeft hz x, ⟨?_,k.symm.projectLeft_mem hz x⟩,k.projectLeft_split hz x⟩ + · exact projectLeft_mem_assignmentFactor A B h k hz S hx + · exact projectLeft_mem_assignmentFactor A B h k.symm hz S hx + +def refinedFactor {ι : Type*} (A B : ι → Subgroup G) (S : Finset ι) + (σ : ι → Bool) : Subgroup G := + assignmentFactor (fun i => if σ i then A i else B i) S + +theorem simultaneous_refinement {ι : Type*} (A B : ι → Subgroup G) + (h : ∀ i, CommutingFactors (A i) (B i)) (hz : Subgroup.center G = ⊥) + (S : Finset ι) : (⨆ σ : ι → Bool, refinedFactor A B S σ) = ⊤ := by + classical + induction S using Finset.induction_on with + | empty => simp [refinedFactor, assignmentFactor] + | @insert i S hi ih => + apply top_unique + rw [← ih] + apply iSup_le + intro σ x hx + have hp (j : ι) : CommutingFactors + (if σ j then A j else B j) (if σ j then B j else A j) := by + cases hs : σ j + · simpa only [hs, Bool.false_eq_true, ↓reduceIte] using (h j).symm + · simpa only [hs, ↓reduceIte] using h j + obtain ⟨c,hc,d,hd,rfl⟩ := split_assignmentFactor + (fun j => if σ j then A j else B j) (fun j => if σ j then B j else A j) + hp (h i) hz S hx + have hm (b : Bool) {z : G} + (hS : z ∈ refinedFactor A B S σ) (hzi : z ∈ if b then A i else B i) : + z ∈ refinedFactor A B (insert i S) (Function.update σ i b) := by + simp only [refinedFactor, assignmentFactor, Subgroup.mem_iInf] at hS ⊢ + intro j hj + rcases Finset.mem_insert.mp hj with rfl | hj + · simpa only [Function.update_self] using hzi + · have hji : j ≠ i := by + intro heq + subst j + exact hi hj + simpa only [Function.update_of_ne hji] using hS j hj + apply Subgroup.mul_mem + · exact Subgroup.mem_iSup_of_mem (Function.update σ i true) (hm true hc.1 hc.2) + · exact Subgroup.mem_iSup_of_mem (Function.update σ i false) (hm false hd.1 hd.2) + +theorem refinedFactor_commute {ι : Type*} [Fintype ι] (A B : ι → Subgroup G) + (h : ∀ i, CommutingFactors (A i) (B i)) {σ τ : ι → Bool} (hστ : σ ≠ τ) + {x y : G} (hx : x ∈ refinedFactor A B Finset.univ σ) + (hy : y ∈ refinedFactor A B Finset.univ τ) : Commute x y := by + classical + obtain ⟨i,hi⟩ := Function.ne_iff.mp hστ + simp only [refinedFactor, assignmentFactor, Subgroup.mem_iInf, Finset.mem_univ, + forall_const] at hx hy + specialize hx i + specialize hy i + cases hs : σ i <;> cases ht : τ i <;> simp_all + · exact ((h i).commute y hy x hx).symm + · exact (h i).commute x hx y hy + +theorem commuting_factors_independent {ι : Type*} (F : ι → Subgroup G) + (hcomm : Pairwise fun i j => ∀ x y : G, x ∈ F i → y ∈ F j → Commute x y) + (hgenerate : (⨆ i, F i) = ⊤) (hz : Subgroup.center G = ⊥) : iSupIndep F := by + classical + intro i + rw [disjoint_iff_inf_le] + intro x hx + have hrest : (⨆ j, ⨆ (_ : j ≠ i), F j) ≤ Subgroup.centralizer (F i : Set G) := by + apply iSup_le + intro j + apply iSup_le + intro hji y hy + exact Subgroup.mem_centralizer_iff.mpr fun z hz' => (hcomm hji y z hy hz').eq.symm + have hself : x ∈ Subgroup.centralizer (F i : Set G) := hrest hx.2 + have hall : (⨆ j, F j) ≤ Subgroup.centralizer {x} := by + apply iSup_le + intro j y hy + apply Subgroup.mem_centralizer_iff.mpr + intro z hz' + have hzx : z = x := Set.mem_singleton_iff.mp hz' + subst z + by_cases hji : j = i + · subst j + exact (Subgroup.mem_centralizer_iff.mp hself y hy).symm + · exact (hcomm hji y x hy hx.1).eq.symm + have hcenter : x ∈ Subgroup.center G := by + apply Subgroup.mem_center_iff.mpr + intro y + have hy := hall (hgenerate ▸ Subgroup.mem_top y) + exact (Subgroup.mem_centralizer_iff.mp hy x (Set.mem_singleton x)).symm + simpa only [hz, Subgroup.mem_bot] using hcenter + +noncomputable def commutingFactorsEquiv {ι : Type*} [Fintype ι] (F : ι → Subgroup G) + (hcomm : Pairwise fun i j => ∀ x y : G, x ∈ F i → y ∈ F j → Commute x y) + (hgenerate : (⨆ i, F i) = ⊤) (hz : Subgroup.center G = ⊥) : + (∀ i, F i) ≃* G := + MulEquiv.ofBijective (Subgroup.noncommPiCoprod hcomm) + ⟨Subgroup.injective_noncommPiCoprod_of_iSupIndep + (commuting_factors_independent F hcomm hgenerate hz), + MonoidHom.range_eq_top.mp (by + rw [Subgroup.noncommPiCoprod_range] + exact hgenerate)⟩ + +@[simp] theorem commutingFactorsEquiv_single {ι : Type*} [Fintype ι] [DecidableEq ι] + (F : ι → Subgroup G) + (hcomm : Pairwise fun i j => ∀ x y : G, x ∈ F i → y ∈ F j → Commute x y) + (hgenerate : (⨆ i, F i) = ⊤) (hz : Subgroup.center G = ⊥) + (i : ι) (x : F i) : commutingFactorsEquiv F hcomm hgenerate hz (Pi.mulSingle i x) = x := by + exact Subgroup.noncommPiCoprod_mulSingle (hcomm := hcomm) i x + +end FiniteDirectRefinement + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/AtomConjugation.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/AtomConjugation.lean new file mode 100644 index 0000000000000000000000000000000000000000..96a4fddbf0dc79d327b6b602e7fa0ff6bf44700d --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/AtomConjugation.lean @@ -0,0 +1,160 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.ConjugationTransport + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section AtomConjugation +variable {J M H T : Type*} [Group M] [Group H] [MulAction M T] + +theorem difference_conjugation_of_atom (p : J → M) (f : J → H) (Y : T → H) + (b : T → T) (R : T → T → Prop) (hb : ∀ t u, R t u → b t = b u) + (hconj : ∀ j t, f j * Y t * (f j)⁻¹ = + (Y (p j • b t))⁻¹ * Y (p j • t)) : + ∀ j t u, R t u → + f j * (Y t)⁻¹ * Y u * (f j)⁻¹ = + (Y (p j • t))⁻¹ * Y (p j • u) := by + intro j t u htu + calc + f j * (Y t)⁻¹ * Y u * (f j)⁻¹ = + (f j * Y t * (f j)⁻¹)⁻¹ * (f j * Y u * (f j)⁻¹) := by group + _ = ((Y (p j • b t))⁻¹ * Y (p j • t))⁻¹ * + ((Y (p j • b u))⁻¹ * Y (p j • u)) := by rw [hconj, hconj] + _ = _ := by rw [hb t u htu]; group + +theorem centralLaw_of_atom_conjugations (p : J → M) (f : J → H) (Y : T → H) + (b : T → T) (R : T → T → Prop) (hb : ∀ t u, R t u → b t = b u) + (hRb : ∀ t, R (b t) t) (hYb : ∀ t, Y (b t) = 1) + (hR : ∀ (g : M) t u, R t u → R (g • t) (g • u)) + (hconj : ∀ j t, f j * Y t * (f j)⁻¹ = + (Y (p j • b t))⁻¹ * Y (p j • t)) + (hgen : Subgroup.closure (Set.range Y) = ⊤) : + HasCentralLaw (FreeGroup.lift p) (FreeGroup.lift f) := by + apply centralLaw_of_difference_conjugations p f Y R hR + (difference_conjugation_of_atom p f Y b R hb hconj) + apply top_unique + rw [← hgen] + apply Subgroup.closure_mono + rintro _ ⟨t,rfl⟩ + exact ⟨b t,t,hRb t,by rw [hYb]; simp⟩ + +end AtomConjugation + +section LocalSupportLaws + +variable {I D M H : Type*} [DecidableEq I] [Group D] [Group M] [Group H] + +def LocalCentralLaw (L : Finset I → Subgroup D) (v : D →* M) (f : D →* H) + (S : Finset I) : Prop := + ∀ d ∈ L S, v d = 1 → ∀ e ∈ L S, Commute (f d) (f e) + +theorem local_null_is_central (L : Finset I → Subgroup D) (hmono : Monotone L) + (v : D →* M) (f : D →* H) + (hgen : Subgroup.closure {h : H | ∃ T : Finset I, T.card ≤ 5 ∧ + ∃ e ∈ L T, h = f e} = ⊤) + (hlaw : ∀ T : Finset I, T.card ≤ 15 → LocalCentralLaw L v f T) + {S : Finset I} (hS : S.card ≤ 10) {d : D} (hd : d ∈ L S) (hv : v d = 1) : + f d ∈ Subgroup.center H := by + rw [← Subgroup.centralizer_univ, ← Subgroup.coe_top, ← hgen, + Subgroup.centralizer_closure] + apply Subgroup.mem_centralizer_iff.mpr + rintro z ⟨T,hT,e,he,rfl⟩ + have hc : (S ∪ T).card ≤ 15 := (Finset.card_union_le S T).trans (by omega) + exact (hlaw (S ∪ T) hc d (hmono Finset.subset_union_left hd) hv e + (hmono Finset.subset_union_right he)).symm.eq + +theorem local_equality_mod_center (L : Finset I → Subgroup D) (hmono : Monotone L) + (v : D →* M) (f : D →* H) + (hgen : Subgroup.closure {h : H | ∃ T : Finset I, T.card ≤ 5 ∧ + ∃ e ∈ L T, h = f e} = ⊤) + (hlaw : ∀ T : Finset I, T.card ≤ 15 → LocalCentralLaw L v f T) + {S : Finset I} (hS : S.card ≤ 10) {d e : D} + (hd : d ∈ L S) (he : e ∈ L S) (hv : v d = v e) : + QuotientGroup.mk' (Subgroup.center H) (f d) = + QuotientGroup.mk' (Subgroup.center H) (f e) := by + have hz := local_null_is_central L hmono v f hgen hlaw hS + ((L S).mul_mem hd ((L S).inv_mem he)) (by simp [hv] : v (d * e⁻¹) = 1) + have hh : f (d * e⁻¹) ∈ (QuotientGroup.mk' (Subgroup.center H)).ker := by + rwa [QuotientGroup.ker_mk'] + have hh' : QuotientGroup.mk' (Subgroup.center H) (f (d * e⁻¹)) = 1 := hh + simpa only [map_mul, map_inv, mul_inv_eq_one] using hh' + +end LocalSupportLaws + +section ReserveAtoms + +variable {I : Type*} [Fintype I] [DecidableEq I] + +abbrev SwapLabel (I : Type*) [DecidableEq I] := + {t : Equiv.Perm I // t.IsSwap} + +noncomputable def reserveAtom (a t : SwapLabel I) : alternatingGroup I := + ⟨a.val * t.val, Equiv.Perm.mul_mem_alternatingGroup_of_isSwap a.property t.property⟩ + +omit [Fintype I] in +theorem swapLabel_inv (t : SwapLabel I) : t.val⁻¹ = t.val := by + obtain ⟨i,j,_,h⟩ := t.property + simp [h] + +theorem reserveAtom_base (a : SwapLabel I) : reserveAtom a a = 1 := by + apply Subtype.ext + change a.val * a.val = 1 + nth_rw 1 [← swapLabel_inv a] + exact inv_mul_cancel a.val + +theorem reserveAtom_difference (a s t : SwapLabel I) : + ((reserveAtom a s)⁻¹ * reserveAtom a t : alternatingGroup I).val = s.val * t.val := by + change (a.val * s.val)⁻¹ * (a.val * t.val) = _ + calc + _ = s.val⁻¹ * t.val := by group + _ = _ := by rw [swapLabel_inv] + +theorem reserveAtoms_generate (a : SwapLabel I) : + Subgroup.closure (Set.range (reserveAtom a)) = ⊤ := by + apply top_unique + rw [← alternatingGroup.closure_isThreeCycles_eq_top] + apply (Subgroup.closure_le _).mpr + intro g hg + obtain ⟨i,hi⟩ := Finset.card_pos.mp (show 0 < g.val.support.card by rw [hg.card_support]; omega) + have hne : i ≠ g.val i := (Equiv.Perm.mem_support.mp hi).symm + let s : SwapLabel I := ⟨Equiv.swap i (g.val i), i, g.val i, hne, rfl⟩ + let t : SwapLabel I := ⟨Equiv.swap (g.val i) (g.val (g.val i)), + g.val i, g.val (g.val i), fun h => hne (g.val.injective h), rfl⟩ + have heq : g = (reserveAtom a s)⁻¹ * reserveAtom a t := by + apply Subtype.ext + rw [reserveAtom_difference] + exact hg.eq_swap_mul_swap_iff_mem_support.mpr hi + rw [heq] + exact Subgroup.mul_mem _ (Subgroup.inv_mem _ (Subgroup.subset_closure ⟨s,rfl⟩)) + (Subgroup.subset_closure ⟨t,rfl⟩) + +def swapLabelConj (g : Equiv.Perm I) (t : SwapLabel I) : SwapLabel I := by + refine ⟨g * t.val * g⁻¹, ?_⟩ + obtain ⟨i,j,hij,ht⟩ := t.property + refine ⟨g i,g j,fun h => hij (g.injective h), ?_⟩ + rw [ht] + rw [Equiv.mul_swap_eq_swap_mul, mul_inv_cancel_right] + +theorem reserveAtom_conjugation (a s t : SwapLabel I) : + reserveAtom a s * reserveAtom a t * (reserveAtom a s)⁻¹ = + (reserveAtom a (swapLabelConj (reserveAtom a s).val a))⁻¹ * + reserveAtom a (swapLabelConj (reserveAtom a s).val t) := by + apply Subtype.ext + rw [reserveAtom_difference] + change (a.val*s.val) * (a.val*t.val) * (a.val*s.val)⁻¹ = + ((a.val*s.val) * a.val * (a.val*s.val)⁻¹) * + ((a.val*s.val) * t.val * (a.val*s.val)⁻¹) + group + +end ReserveAtoms + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/AxisCutCommutation.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/AxisCutCommutation.lean new file mode 100644 index 0000000000000000000000000000000000000000..0186f87a3bc552d85785474637802aa14d993816 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/AxisCutCommutation.lean @@ -0,0 +1,93 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.DisjointPolygonAtoms +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.AxisCutSequences + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section AxisCutCommutation +namespace InitialCoverSystem +variable {a m : ℕ} {r : CutRing} {hm : 2 ≤ m} + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + +theorem axis_cut_sequence_commutations (hlarge : 20 ≤ m+1) + (hr : 0 < ordinary r ∧ ordinary r < 1/2) + (s w z : CutRing) (hs : 0 < ordinary s) (hsr : ordinary s < ordinary r/2) + (hwz : w*z=1) + (hshort : (1+|ordinary (cutTau^a)|)*(|ordinary w|+|ordinary (cutTau*w)|) < ordinary s/4) + {C : ℝ} (hC : 1000 ≤ C) (hSlope : 8*C < ordinary (cutTau^a)) + (hconj : |conjugate (cutTau^a)| < 1/1000) : + ∃ N : ℕ, 1005 ≤ N ∧ ∀ (M : ℕ) (B : InitialCoverSystem a r m hm M) + (_h : B.TangentChartLaws (symmetricWindowLength s) (symmetricWindowStart s) w), + ∀ n : ℕ, N ≤ n → ∀ g : B.CoordinateWindowLaw n, + ∀ (d : Fin 2) (K : ℕ) (D : AxisCutSequence n K), + ordinary (D.cut (Fin.last K))-ordinary (D.cut 0) ≤ C/(n:ℝ) → + (∀ i j, |(endpointLabel (D.cut j-D.cut i):ℝ)| ≤ 6*(n:ℝ)/5) → + ordinary (D.cut (Fin.last K))-ordinary (D.cut 0) < 1 ∧ + ∀ i j : ℕ, i ≤ j → ∀ x y, + Commute (D.prefixCopy B (by omega) g d i x) (D.suffix B (by omega) g d j y) := by + obtain ⟨N₀,hN₀,hcomm⟩ := separated_axis_sectors_commute + (a := a) (hm := hm) hlarge hr s w z hs hsr hwz hshort hC hSlope hconj + obtain ⟨N₁,hN₁⟩ := exists_nat_gt C + refine ⟨max N₀ N₁,by omega,?_⟩ + intro M B h n hn g d K D hwidth hlabels + have hnp : (0:ℝ) < n := by exact_mod_cast (show 0 < n by omega) + have hCn : C < (n:ℝ) := hN₁.trans_le (by exact_mod_cast (show N₁ ≤ n by omega)) + have hlen : ordinary (D.cut (Fin.last K))-ordinary (D.cut 0) < 1 := + hwidth.trans_lt ((div_lt_one hnp).mpr hCn) + refine ⟨hlen,?_⟩ + intro i j hij x y + have hle := D.index_mono hij + rcases eq_or_lt_of_le hle with he | hlt + · have hp : D.prefixCopy B (by omega) g d i = D.prefixCopy B (by omega) g d j := by + simp only [AxisCutSequence.prefixCopy,he] + rw [hp] + exact D.prefix_suffix_self_commute B (by omega) g d hlen j x y + · exact hcomm M B h n (by omega) g d _ _ (D.length_le _) (D.length_le _) + _ _ _ _ _ _ (D.ordered _).1 (D.strictMono hlt) (D.ordered _).2 + (D.lower_label _) (D.cut_label _) (D.cut_label _) (D.upper_label _) + hwidth (hlabels _ _) x y + +end InitialCoverSystem +end AxisCutCommutation + +section AxisCutLocalLaw +namespace InitialCoverSystem +variable {a m : ℕ} {r : CutRing} {hm : 2 ≤ m} + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + +theorem axis_cut_sequence_central (hlarge : 20 ≤ m+1) + (hr : 0 < ordinary r ∧ ordinary r < 1/2) + (s w z : CutRing) (hs : 0 < ordinary s) (hsr : ordinary s < ordinary r/2) + (hwz : w*z=1) + (hshort : (1+|ordinary (cutTau^a)|)*(|ordinary w|+|ordinary (cutTau*w)|) < ordinary s/4) + {C : ℝ} (hC : 1000 ≤ C) (hSlope : 8*C < ordinary (cutTau^a)) + (hconj : |conjugate (cutTau^a)| < 1/1000) : + ∃ N : ℕ, 1005 ≤ N ∧ ∀ (M : ℕ) (B : InitialCoverSystem a r m hm M) + (_h : B.TangentChartLaws (symmetricWindowLength s) (symmetricWindowStart s) w), + ∀ n : ℕ, N ≤ n → ∀ g : B.CoordinateWindowLaw n, + ∀ (d : Fin 2) (K : ℕ) (D : AxisCutSequence n K), + ordinary (D.cut (Fin.last K))-ordinary (D.cut 0) ≤ C/(n:ℝ) → + (∀ i j, |(endpointLabel (D.cut j-D.cut i):ℝ)| ≤ 6*(n:ℝ)/5) → + CentralOn (coverMap M (alternatingGenerator a r m hm)) + (⨆ i : Fin (K+1), (D.prefixCopy B (by omega) g d i.val).range) := by + obtain ⟨N,hN,hcomm⟩ := axis_cut_sequence_commutations + (a := a) (hm := hm) hlarge hr s w z hs hsr hwz hshort hC hSlope hconj + refine ⟨N,hN,?_⟩ + intro M B h n hn g d K D hwidth hlabels + obtain ⟨hlen,hc⟩ := hcomm M B h n hn g d K D hwidth hlabels + exact D.cuts_central B (by omega) g d hlen hc + +end InitialCoverSystem +end AxisCutLocalLaw + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/AxisSplitting.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/AxisSplitting.lean new file mode 100644 index 0000000000000000000000000000000000000000..3f90336d992594f58414416dcd1c63cd2f6a8503 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/AxisSplitting.lean @@ -0,0 +1,52 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.CellGeometry +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.FiniteSectorPartition + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section AxisSplitting +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + +theorem axisSector_split (hlarge : 15 < m+1) (n : ℕ) (g : B.CoordinateWindowLaw n) + (d : Fin 2) (k : ℕ) (hk : k ≤ n) (p : ℤ) (u v w : CutRing) + (huv : ordinary u ≤ ordinary v) (hvw : ordinary v ≤ ordinary w) + (hlen : ordinary w-ordinary u < 1) + (hu : p ≤ endpointLabel u ∧ endpointLabel u < p+k) + (hv : p ≤ endpointLabel v ∧ endpointLabel v < p+k) + (s : TrackStar (Fin (m+1))) : + B.axisSector hlarge n g d k hk p (coordinateInterval a d u w) s = + B.axisSector hlarge n g d k hk p (coordinateInterval a d u v) s * + B.axisSector hlarge n g d k hk p (coordinateInterval a d v w) s := by + rw [coordinateInterval_union d u v w huv hvw hlen] + exact B.fullGeometricSector_union hlarge _ _ _ _ (axisInterval_resolved d k p u v hu hv) + (coordinateInterval_disjoint d u v v w huv le_rfl hvw hlen) s + +theorem axisSector_split_commute (hlarge : 15 < m+1) (n : ℕ) (g : B.CoordinateWindowLaw n) + (d : Fin 2) (k : ℕ) (hk : k ≤ n) (p : ℤ) (u v w : CutRing) + (huv : ordinary u ≤ ordinary v) (hvw : ordinary v ≤ ordinary w) + (hlen : ordinary w-ordinary u < 1) + (hu : p ≤ endpointLabel u ∧ endpointLabel u < p+k) + (hv : p ≤ endpointLabel v ∧ endpointLabel v < p+k) + (s t : TrackStar (Fin (m+1))) : + Commute (B.axisSector hlarge n g d k hk p (coordinateInterval a d u v) s) + (B.axisSector hlarge n g d k hk p (coordinateInterval a d v w) t) := + B.fullGeometricSector_commute hlarge _ _ _ _ (axisInterval_resolved d k p u v hu hv) + (coordinateInterval_disjoint d u v v w huv le_rfl hvw hlen) s t + +end InitialCoverSystem +end AxisSplitting + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/BooleanCoordinateGeneration.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/BooleanCoordinateGeneration.lean new file mode 100644 index 0000000000000000000000000000000000000000..41d24f83475bc83f35c69a331350108671ba6338 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/BooleanCoordinateGeneration.lean @@ -0,0 +1,205 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Configurations.TrackTranslationChart + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section BooleanCoordinateGeneration + +noncomputable def coordinate {a : ℕ} (j : Fin 2) (p : GenericSquare a) : ℝ := + ![p.val.1,p.val.2] j + +noncomputable def coordinateShift (j : Fin 2) (z : CutRing) : CutRing × CutRing := + if j = 0 then (z,0) else (0,z) + +theorem coordinate_bounds {a : ℕ} (j : Fin 2) (p : GenericSquare a) : + 0 ≤ coordinate j p ∧ coordinate j p < 1 := by + fin_cases j + · exact p.property.1 + · exact p.property.2.1 + +theorem coordinate_translate {a : ℕ} (j : Fin 2) (z : CutRing) (p : GenericSquare a) : + coordinate j (translate a (coordinateShift j z) p) = + Int.fract (coordinate j p + ordinary z) := by + fin_cases j <;> simp [coordinate,coordinateShift,translate_val] + +noncomputable def coordinateArc (a : ℕ) (j : Fin 2) (z : CutRing) : Set (GenericSquare a) := + {p | coordinate j p < Int.fract (ordinary z)} + +private theorem fract_sub_unit {x u : ℝ} (hx : 0 ≤ x ∧ x < 1) + (hu : 0 ≤ u ∧ u < 1) : + Int.fract (x-u) = if x < u then x-u+1 else x-u := by + split_ifs with h + · have hf : ⌊x-u⌋ = (-1 : ℤ) := Int.floor_eq_iff.mpr ⟨by norm_num; linarith,by norm_num; linarith⟩ + simp only [Int.fract,hf,Int.cast_neg,Int.cast_one] + ring + · exact Int.fract_eq_self.mpr ⟨by linarith,by linarith⟩ + +private theorem fract_sum_unit {u v : ℝ} (hu : 0 ≤ u ∧ u < 1) + (hv : 0 ≤ v ∧ v < 1) : + Int.fract (u+v) = if u+v < 1 then u+v else u+v-1 := by + split_ifs with h + · exact Int.fract_eq_self.mpr ⟨by linarith,h⟩ + · have hf : ⌊u+v⌋ = (1 : ℤ) := Int.floor_eq_iff.mpr ⟨by norm_num; linarith,by norm_num; linarith⟩ + simp [Int.fract,hf] + +private theorem arc_add_test (x u v : ℝ) (hx : 0 ≤ x ∧ x < 1) + (hu : 0 ≤ u ∧ u < 1) (hv : 0 ≤ v ∧ v < 1) : + (x < Int.fract (u+v)) ↔ + if u+v < 1 then Xor (x < u) (Int.fract (x-u) < v) + else ¬ Xor (x < u) (Int.fract (x-u) < v) := by + rw [fract_sum_unit hu hv,fract_sub_unit hx hu] + by_cases hs : u+v < 1 <;> by_cases hxu : x < u <;> + simp only [hs,hxu,ite_true,ite_false,Xor,true_and,false_and,false_or, + not_true_eq_false,not_false_eq_true,and_true,and_false,or_false,not_lt] <;> + constructor <;> intro h <;> linarith + +private theorem fract_add_fracts (x y : ℝ) : + Int.fract (Int.fract x + Int.fract y) = Int.fract (x+y) := by + rw [fract_fract_add] + change Int.fract (x+(y-(⌊y⌋ : ℝ))) = _ + rw [← add_sub_assoc,Int.fract_sub_intCast] + +private theorem fract_sub_fract (x y : ℝ) : + Int.fract (x-Int.fract y) = Int.fract (x-y) := by + change Int.fract (x-(y-(⌊y⌋ : ℝ))) = _ + rw [sub_sub_eq_add_sub,add_sub_right_comm,Int.fract_add_intCast] + +theorem coordinateArc_add {a : ℕ} (j : Fin 2) (u v : CutRing) : + coordinateArc a j (u+v) = + if Int.fract (ordinary u)+Int.fract (ordinary v) < 1 then + symmDiff (coordinateArc a j u) + (translate a (coordinateShift j (-u)) ⁻¹' coordinateArc a j v) + else (symmDiff (coordinateArc a j u) + (translate a (coordinateShift j (-u)) ⁻¹' coordinateArc a j v))ᶜ := by + ext p + have hc := arc_add_test (coordinate j p) (Int.fract (ordinary u)) (Int.fract (ordinary v)) + (coordinate_bounds j p) ⟨Int.fract_nonneg _,Int.fract_lt_one _⟩ + ⟨Int.fract_nonneg _,Int.fract_lt_one _⟩ + rw [fract_add_fracts,fract_sub_fract] at hc + split_ifs with h + · simpa only [coordinateArc,Set.mem_ofPred_eq,Set.mem_symmDiff,Set.mem_preimage, + coordinate_translate,map_neg,map_add,sub_eq_add_neg,Xor,h,ite_true] using hc + · simpa only [coordinateArc,Set.mem_ofPred_eq,Set.mem_compl_iff,Set.mem_symmDiff, + Set.mem_preimage,coordinate_translate,map_neg,map_add,sub_eq_add_neg,Xor,h,ite_false] using hc + +private theorem arc_neg_test (x u : ℝ) (hx : 0 ≤ x ∧ x < 1) + (hu : 0 < u ∧ u < 1) : + (x < 1-u) ↔ ¬ Int.fract (x+u) < u := by + rw [fract_sum_unit hx ⟨hu.1.le,hu.2⟩] + split_ifs <;> push Not <;> constructor <;> intro h <;> linarith + +theorem coordinateArc_neg {a : ℕ} (j : Fin 2) (u : CutRing) + (hu : Int.fract (ordinary u) ≠ 0) : + coordinateArc a j (-u) = + (translate a (coordinateShift j u) ⁻¹' coordinateArc a j u)ᶜ := by + ext p + simp only [coordinateArc,Set.mem_ofPred_eq,Set.mem_compl_iff,Set.mem_preimage, + coordinate_translate,map_neg,Int.fract_neg hu] + rw [← fract_fract_add (coordinate j p) (ordinary u)] + rw [Int.fract_eq_self.mpr (coordinate_bounds j p)] + have he : Int.fract (coordinate j p + ordinary u) = + Int.fract (coordinate j p + Int.fract (ordinary u)) := by + rw [← fract_add_fracts,Int.fract_eq_self.mpr (coordinate_bounds j p)] + rw [he] + exact arc_neg_test _ _ (coordinate_bounds j p) + ⟨lt_of_le_of_ne (Int.fract_nonneg _) (Ne.symm hu),Int.fract_lt_one _⟩ + +theorem coordinateArc_zero_of_fract {a : ℕ} (j : Fin 2) (u : CutRing) + (hu : Int.fract (ordinary u) = 0) : coordinateArc a j u = ∅ := by + ext p + simp only [coordinateArc,Set.mem_ofPred_eq,Set.mem_empty_iff_false,iff_false,not_lt,hu] + exact (coordinate_bounds j p).1 + +theorem coordinate_cuts_generated {a : ℕ} (B : BooleanSubalgebra (Set (GenericSquare a))) + (j : Fin 2) (htrans : ∀ u U, U ∈ B → translate a u ⁻¹' U ∈ B) + (hprimitive : (coordinatePrimitive a j).val ∈ B) (z : CutRing) : + halfPlane a (Fin.castLE (by omega) j) z ∈ B := by + classical + have hsymm {U V : Set (GenericSquare a)} (hU : U ∈ B) (hV : V ∈ B) : + symmDiff U V ∈ B := by + rw [Set.symmDiff_def] + exact BooleanSubalgebra.sup_mem (BooleanSubalgebra.sdiff_mem hU hV) + (BooleanSubalgebra.sdiff_mem hV hU) + let H : AddSubgroup CutRing := { + carrier := {u | coordinateArc a j u ∈ B} + zero_mem' := by + change coordinateArc a j 0 ∈ B + rw [coordinateArc_zero_of_fract j 0 (by simp)] + exact BooleanSubalgebra.bot_mem + add_mem' := by + intro u v hu hv + change coordinateArc a j (u+v) ∈ B + rw [coordinateArc_add] + split_ifs + · exact hsymm hu (htrans _ _ hv) + · exact BooleanSubalgebra.compl_mem (hsymm hu (htrans _ _ hv)) + neg_mem' := by + intro u hu + change coordinateArc a j (-u) ∈ B + by_cases hzero : Int.fract (ordinary u) = 0 + · have hh : Int.fract (ordinary (-u)) = 0 := by + rw [map_neg,Int.fract_neg_eq_zero.mpr hzero] + rw [coordinateArc_zero_of_fract j (-u) hh] + exact BooleanSubalgebra.bot_mem + · rw [coordinateArc_neg j u hzero] + exact BooleanSubalgebra.compl_mem (htrans _ _ hu) } + have hτ : cutTau ∈ H := by + have hfloor : ⌊Real.goldenRatio⌋ = (1 : ℤ) := + Int.floor_eq_iff.mpr ⟨by norm_num; exact Real.one_lt_goldenRatio.le,by norm_num; exact Real.goldenRatio_lt_two⟩ + have he : coordinateArc a j cutTau = (coordinatePrimitive a j).val := by + ext p + have hp := (coordinate_bounds j p).1 + fin_cases j <;> + simp [coordinateArc,coordinate,coordinatePrimitive,halfPlane,cutForm, + Int.fract,hfloor,ordinary_cutTau] <;> intro _ <;> exact hp + change coordinateArc a j cutTau ∈ B + rw [he] + exact hprimitive + have hint (n : ℤ) : (n : CutRing) ∈ H := by + change coordinateArc a j (n : CutRing) ∈ B + rw [coordinateArc_zero_of_fract j _ (by simp)] + exact BooleanSubalgebra.bot_mem + have hall (u : CutRing) : coordinateArc a j u ∈ B := by + have he : u = (u.re : CutRing) + u.im • cutTau := by + apply QuadraticAlgebra.ext <;> simp [cutTau] + change u ∈ H + rw [he] + exact H.add_mem (hint _) (H.zsmul_mem hτ _) + have hcoord : ∀ p : GenericSquare a, + cutForm a (Fin.castLE (by omega) j) p.val = coordinate j p := by + intro p + fin_cases j <;> rfl + by_cases hz0 : ordinary z ≤ 0 + · have he : halfPlane a (Fin.castLE (by omega) j) z = ∅ := by + ext p + simp only [halfPlane,Set.mem_ofPred_eq,Set.mem_empty_iff_false,iff_false,not_lt,hcoord] + exact hz0.trans (coordinate_bounds j p).1 + rw [he] + exact BooleanSubalgebra.bot_mem + by_cases hz1 : 1 ≤ ordinary z + · have he : halfPlane a (Fin.castLE (by omega) j) z = Set.univ := by + ext p + simp only [halfPlane,Set.mem_ofPred_eq,Set.mem_univ,iff_true,hcoord] + exact (coordinate_bounds j p).2.trans_le hz1 + rw [he] + exact BooleanSubalgebra.top_mem + have he : halfPlane a (Fin.castLE (by omega) j) z = coordinateArc a j z := by + ext p + simp only [halfPlane,coordinateArc,Set.mem_ofPred_eq,hcoord, + Int.fract_eq_self.mpr (show 0 ≤ ordinary z ∧ ordinary z < 1 by constructor <;> linarith)] + rw [he] + exact hall z + +end BooleanCoordinateGeneration + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/BoundedRelationCover.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/BoundedRelationCover.lean new file mode 100644 index 0000000000000000000000000000000000000000..9ba585a0d307eafc7cd042b1a323f94f5fe2f1d7 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/BoundedRelationCover.lean @@ -0,0 +1,219 @@ +import Mathlib + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +section BoundedRelationCover + +variable (α : Type*) (L : ℕ) + +def ShortWord := Σ n : Fin (L + 1), Fin n.val → α × Bool + +def ShortWord.value (w : ShortWord α L) : FreeGroup α := + FreeGroup.mk (List.ofFn w.2) + +instance [Finite α] : Finite (ShortWord α L) := by + unfold ShortWord + infer_instance + +variable {α} {G : Type*} [Group G] (f : α → G) + +def shortRelations : Set (FreeGroup α) := + Set.range (ShortWord.value α L) ∩ (FreeGroup.lift f).ker + +theorem shortRelations_finite [Finite α] : (shortRelations L f).Finite := + (Set.finite_range (ShortWord.value α L)).subset Set.inter_subset_left + +abbrev BoundedRelationCover := PresentedGroup (shortRelations L f) + +instance [Finite α] : Group.IsFinitelyPresented (BoundedRelationCover L f) := by + have : Finite (shortRelations L f) := (shortRelations_finite L f).to_subtype + unfold BoundedRelationCover + infer_instance + +def coverMap : BoundedRelationCover L f →* G := + PresentedGroup.toGroup (fun _ h => h.2) + +@[simp] theorem coverMap_mk (w : FreeGroup α) : + coverMap L f (PresentedGroup.mk (shortRelations L f) w) = FreeGroup.lift f w := rfl + +@[simp] theorem coverMap_of (a : α) : + coverMap L f (PresentedGroup.of a) = f a := by + exact FreeGroup.lift_apply_of + +theorem coverMap_surjective (hf : Function.Surjective (FreeGroup.lift f)) : + Function.Surjective (coverMap L f) := by + intro g + obtain ⟨w, hw⟩ := hf g + exact ⟨PresentedGroup.mk (shortRelations L f) w, hw⟩ + +theorem mem_shortRelations_of_length [DecidableEq α] {L : ℕ} {w : FreeGroup α} + (hw : FreeGroup.lift f w = 1) (hlen : w.toWord.length ≤ L) : + w ∈ shortRelations L f := by + classical + refine ⟨⟨⟨⟨w.toWord.length,by omega⟩,fun i => w.toWord[i]⟩, ?_⟩,hw⟩ + change FreeGroup.mk (List.ofFn w.toWord.get) = w + rw [List.ofFn_get] + exact FreeGroup.mk_toWord + +theorem finite_true_relations_bounded {R : Set (FreeGroup α)} (hR : R.Finite) + (ht : ∀ w ∈ R, FreeGroup.lift f w = 1) : + ∃ L : ℕ, R ⊆ shortRelations L f := by + classical + refine ⟨hR.toFinset.sup (fun w => w.toWord.length), ?_⟩ + intro w hw + exact mem_shortRelations_of_length f (ht w hw) + (Finset.le_sup (f := fun w => w.toWord.length) (hR.mem_toFinset.mpr hw)) + +theorem finite_table_lift {T : Type*} [Group T] [Finite T] + (φ : T →* G) (w : T → FreeGroup α) (hw : ∀ t, FreeGroup.lift f (w t) = φ t) : + ∃ (L : ℕ) (ρ : T →* BoundedRelationCover L f), + (coverMap L f).comp ρ = φ ∧ + ∀ t, ρ t = PresentedGroup.mk (shortRelations L f) (w t) := by + classical + let R : Set (FreeGroup α) := {w 1} ∪ + Set.range (fun p : T × T => w p.1 * w p.2 * (w (p.1*p.2))⁻¹) + have hRf : R.Finite := (Set.finite_singleton _).union (Set.finite_range _) + obtain ⟨L,hL⟩ := finite_true_relations_bounded f hRf (by + intro z hz + rcases hz with hz | ⟨⟨s,t⟩,rfl⟩ + · rcases hz with rfl + simp [hw] + · simp [hw]) + let ρ : T →* BoundedRelationCover L f := + { toFun := fun t => PresentedGroup.mk (shortRelations L f) (w t) + map_one' := PresentedGroup.one_of_mem (hL (Set.mem_union_left _ (Set.mem_singleton _))) + map_mul' := by + intro s t + have he := PresentedGroup.one_of_mem (hL (Set.mem_union_right _ + (Set.mem_range.mpr ⟨(s,t),rfl⟩))) + simp only [map_mul, map_inv, mul_inv_eq_one] at he + exact he.symm } + refine ⟨L,ρ,?_,fun _ => rfl⟩ + ext t + exact hw t + +theorem finitelyPresented_of_cover [Finite α] + (hf : Function.Surjective (FreeGroup.lift f)) + [Group.FG (coverMap L f).ker] : Group.IsFinitelyPresented G := + Group.IsFinitelyPresented.of_surjective (coverMap L f) (coverMap_surjective L f hf) + (Subgroup.IsFinitelyNormallyGenerated.of_FG _) + +end BoundedRelationCover + +section CoherentBoundedCovers +variable {α G : Type*} [Group G] (f : α → G) + +theorem shortRelations_mono {L M : ℕ} (hLM : L ≤ M) : + shortRelations L f ⊆ shortRelations M f := by + rintro w ⟨⟨⟨n,v⟩,rfl⟩,he⟩ + exact ⟨⟨⟨⟨n.val,by omega⟩,v⟩,rfl⟩,he⟩ + +def coverTransition {L M : ℕ} (hLM : L ≤ M) : + BoundedRelationCover L f →* BoundedRelationCover M f := + PresentedGroup.map (MonoidHom.id _) (fun _ h => shortRelations_mono f hLM h) + +@[simp] theorem coverTransition_mk {L M : ℕ} (hLM : L ≤ M) (w : FreeGroup α) : + coverTransition f hLM (PresentedGroup.mk (shortRelations L f) w) = + PresentedGroup.mk (shortRelations M f) w := rfl + +theorem coverTransition_surjective {L M : ℕ} (hLM : L ≤ M) : + Function.Surjective (coverTransition f hLM) := by + intro g + obtain ⟨w,rfl⟩ := PresentedGroup.mk_surjective (shortRelations M f) g + exact ⟨PresentedGroup.mk (shortRelations L f) w,rfl⟩ + +theorem coverTransition_projection {L M : ℕ} (hLM : L ≤ M) : + (coverMap M f).comp (coverTransition f hLM) = coverMap L f := by + ext a + simp only [MonoidHom.comp_apply, PresentedGroup.of, coverTransition_mk, coverMap_mk] + +theorem finite_table_lift_eventually {T : Type*} [Group T] [Finite T] + (φ : T →* G) (w : T → FreeGroup α) (hw : ∀ t, FreeGroup.lift f (w t) = φ t) : + ∃ L : ℕ, ∀ M : ℕ, L ≤ M → ∃ ρ : T →* BoundedRelationCover M f, + (coverMap M f).comp ρ = φ ∧ + ∀ t, ρ t = PresentedGroup.mk (shortRelations M f) (w t) := by + obtain ⟨L,ρ,hρ,hword⟩ := finite_table_lift f φ w hw + refine ⟨L,fun M hM => ⟨(coverTransition f hM).comp ρ,?_,?_⟩⟩ + · rw [← MonoidHom.comp_assoc,coverTransition_projection,hρ] + · intro t + simp only [MonoidHom.comp_apply,hword,coverTransition_mk] + +theorem bounded_cover_eventually_perfect [Finite α] [Group.IsPerfect G] + (hf : Function.Surjective (FreeGroup.lift f)) : + ∃ L : ℕ, ∀ M : ℕ, L ≤ M → Group.IsPerfect (BoundedRelationCover M f) := by + classical + have hmap : (commutator (FreeGroup α)).map (FreeGroup.lift f) = ⊤ := by + rw [map_commutator_eq,MonoidHom.range_eq_top.mpr hf, + ← commutator_def,Group.IsPerfect.commutator_eq_top] + have hex (a : α) : ∃ w ∈ commutator (FreeGroup α), FreeGroup.lift f w = f a := + Subgroup.mem_map.mp (hmap.symm ▸ Subgroup.mem_top (f a)) + choose w hw hwe using hex + let R : Set (FreeGroup α) := Set.range (fun a => w a * (FreeGroup.of a)⁻¹) + obtain ⟨L,hL⟩ := finite_true_relations_bounded f (R := R) (Set.finite_range _) (by + rintro r ⟨a,rfl⟩ + simp only [map_mul, map_inv, FreeGroup.lift_apply_of, hwe, mul_inv_cancel]) + refine ⟨L,fun M hM => ?_⟩ + let π := PresentedGroup.mk (shortRelations M f) + have hgen (a : α) : π (FreeGroup.of a) ∈ commutator (BoundedRelationCover M f) := by + have he : π (w a) = π (FreeGroup.of a) := + PresentedGroup.mk_eq_mk_of_mul_inv_mem + (shortRelations_mono f hM (hL (Set.mem_range.mpr ⟨a,rfl⟩))) + rw [← he] + have hle : (commutator (FreeGroup α)).map π ≤ commutator (BoundedRelationCover M f) := by + rw [map_commutator_eq,commutator_def] + exact Subgroup.commutator_mono le_top le_top + exact hle (Subgroup.mem_map.mpr ⟨w a,hw a,rfl⟩) + constructor + apply top_unique + intro g hg + clear hg + obtain ⟨z,rfl⟩ := PresentedGroup.mk_surjective (shortRelations M f) g + induction z using FreeGroup.induction_on with + | one => exact (commutator _).one_mem + | of a => exact hgen a + | inv_of a ha => exact (commutator _).inv_mem ha + | mul x y hx hy => exact (commutator _).mul_mem hx hy + +theorem finitelyPresented_lift_eventually {T : Type*} [Group T] + [Group.IsFinitelyPresented T] (φ : T →* G) + (hf : Function.Surjective (FreeGroup.lift f)) : + ∃ L : ℕ, ∀ M : ℕ, L ≤ M → ∃ ρ : T →* BoundedRelationCover M f, + (coverMap M f).comp ρ = φ := by + classical + obtain ⟨n,R,hR,⟨e⟩⟩ := Group.IsFinitelyPresented.exists_mulEquiv_presentedGroup (G := T) + let ψ : PresentedGroup R →* G := φ.comp e.symm.toMonoidHom + have hex (i : Fin n) : ∃ w : FreeGroup α, FreeGroup.lift f w = ψ (PresentedGroup.of i) := + hf _ + choose w hw using hex + let W : FreeGroup (Fin n) →* FreeGroup α := FreeGroup.lift w + have hW : (FreeGroup.lift f).comp W = ψ.comp (PresentedGroup.mk R) := by + ext i + simpa only [MonoidHom.comp_apply, W, FreeGroup.lift_apply_of, PresentedGroup.of] using hw i + obtain ⟨L,hL⟩ := finite_true_relations_bounded f (hR.image W) (by + rintro z ⟨r,hr,rfl⟩ + have he := DFunLike.congr_fun hW r + simpa only [MonoidHom.comp_apply,PresentedGroup.one_of_mem hr,map_one] using he) + refine ⟨L,fun M hM => ?_⟩ + let ρ₀ : PresentedGroup R →* BoundedRelationCover M f := + PresentedGroup.map W (fun r hr => shortRelations_mono f hM (hL ⟨r,hr,rfl⟩)) + have hρ : (coverMap M f).comp ρ₀ = ψ := by + ext i + change coverMap M f (PresentedGroup.mk _ (W (FreeGroup.of i))) = ψ (PresentedGroup.of i) + rw [coverMap_mk] + exact DFunLike.congr_fun hW (FreeGroup.of i) + refine ⟨ρ₀.comp e.toMonoidHom,?_⟩ + rw [← MonoidHom.comp_assoc,hρ] + ext t + exact congrArg φ (e.symm_apply_apply t) + +end CoherentBoundedCovers + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/CanonicalSlotStars.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/CanonicalSlotStars.lean new file mode 100644 index 0000000000000000000000000000000000000000..6201aec5676976bd6c4012e9efb65a2ecf90afde --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/CanonicalSlotStars.lean @@ -0,0 +1,157 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.RoutingIndependence + +namespace OAI + +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + (hlarge : 15 < m+1) (h : B.AllPrimitiveLaws) (hr : 0 ρ.transport j ⟨x.val,hW x.property⟩ + +noncomputable def identity (V : polygonAlgebra a) (ι : Fin 5 ↪ Fin (m+1)) + (u : Fin (m+1) → CutRing × CutRing) + (F : OffsetFrame a r m hm (orderedTrackAlphabet ι) u) : + B.SlotRouting hlarge h hr V (fun j => ι j) (fun j => u (ι j)) where + alphabet := orderedTrackAlphabet ι + card_le := by simp [orderedTrackAlphabet] + source_mem := orderedTrackAlphabet_mem ι + target := ι + target_mem := orderedTrackAlphabet_mem ι + offsets := u + offsets_spec := fun _ => rfl + frame := F + word := 1 + aligned := Subgroup.one_mem _ + supported := Subgroup.one_mem _ + transport := by intro j x; simp + +theorem identity_star (V : polygonAlgebra a) (ι : Fin 5 ↪ Fin (m+1)) + (u : Fin (m+1) → CutRing × CutRing) + (F : OffsetFrame a r m hm (orderedTrackAlphabet ι) u) : + (identity (B := B) (hlarge := hlarge) (h := h) (hr := hr) V ι u F).star = + B.distinctSlotStar hlarge h hr ι u F V := by + ext s : 1 + change 1⁻¹*B.distinctSlotStar hlarge h hr ι u F V s*(1⁻¹)⁻¹ = _ + simp + +theorem star_union {V W : polygonAlgebra a} {i : Fin 5 → Fin (m+1)} + {u : Fin 5 → CutRing × CutRing} (ρ : B.SlotRouting hlarge h hr (V ⊔ W) i u) + (hd : Disjoint V.val W.val) (s : UniversalExtension (alternatingGroup (Fin 5))) : + ρ.star s=(ρ.restrict V le_sup_left).star s*(ρ.restrict W le_sup_right).star s := by + have he := B.frameStar_union hlarge h hr (orderedTrackAlphabet ρ.target) + ρ.offsets ρ.frame V W hd (universalMap (orderedTrackHom ρ.target) s) + change (MulAut.conj ρ.word⁻¹).toMonoidHom + (B.frameStar hlarge h hr _ ρ.offsets ρ.frame (V ⊔ W) + (universalMap (orderedTrackHom ρ.target) s)) = _ + rw [he,map_mul] + rfl + +theorem star_commute {V W : polygonAlgebra a} {i : Fin 5 → Fin (m+1)} + {u : Fin 5 → CutRing × CutRing} (ρ : B.SlotRouting hlarge h hr (V ⊔ W) i u) + (hd : Disjoint V.val W.val) (s t : UniversalExtension (alternatingGroup (Fin 5))) : + Commute ((ρ.restrict V le_sup_left).star s) ((ρ.restrict W le_sup_right).star t) := + (B.frameStar_commute hlarge h hr (orderedTrackAlphabet ρ.target) ρ.offsets ρ.frame V W hd + (universalMap (orderedTrackHom ρ.target) s) (universalMap (orderedTrackHom ρ.target) t)).map + (MulAut.conj ρ.word⁻¹).toMonoidHom + +end SlotRouting + +noncomputable def slotStar (hwide : 100 ≤ m+1) (V : polygonAlgebra a) + (i : Fin 5 → Fin (m+1)) (u : Fin 5 → CutRing × CutRing) + (hinj : Function.Injective (SlotMap a (m+1) V (fun j => (i j,u j)))) : + UniversalExtension (alternatingGroup (Fin 5)) →* + BoundedRelationCover M (alternatingGenerator a r m hm) := + (B.slotRouting_nonempty hlarge h hr (by omega) V i u hinj).some.star + +variable (R : alternatingGroup (Fin (m+1)) → + Multiplicative (FreeAbelianGroup (Fin m × Fin 2)) →* + Multiplicative (FreeAbelianGroup (Fin m × Fin 2))) + (hR : ∀ s k, B.c s * B.t k * (B.c s)⁻¹ = B.t (R s k)) + (hwide : 100 ≤ m+1) + +include R hR + +theorem slotStar_eq_routing (V : polygonAlgebra a) + (i : Fin 5 → Fin (m+1)) (u : Fin 5 → CutRing × CutRing) + (hinj : Function.Injective (SlotMap a (m+1) V (fun j => (i j,u j)))) + (ρ : B.SlotRouting hlarge h hr V i u) : + B.slotStar hlarge h hr hwide V i u hinj=ρ.star := + SlotRouting.independent R hR (by omega) _ ρ + +theorem slotStar_distinct (V : polygonAlgebra a) (ι : Fin 5 ↪ Fin (m+1)) + (u : Fin (m+1) → CutRing × CutRing) + (F : OffsetFrame a r m hm (orderedTrackAlphabet ι) u) + (hinj : Function.Injective (SlotMap a (m+1) V (fun j => (ι j,u (ι j))))) : + B.slotStar hlarge h hr hwide V (fun j => ι j) (fun j => u (ι j)) hinj = + B.distinctSlotStar hlarge h hr ι u F V := by + rw [B.slotStar_eq_routing hlarge h hr R hR hwide V _ _ hinj (SlotRouting.identity V ι u F)] + exact SlotRouting.identity_star V ι u F + +theorem slotStar_aligned_transport (V : polygonAlgebra a) + (i k : Fin 5 → Fin (m+1)) (u : Fin 5 → CutRing × CutRing) + (hi : Function.Injective (SlotMap a (m+1) V (fun j => (i j,u j)))) + (hk : Function.Injective (SlotMap a (m+1) V (fun j => (k j,u j)))) + (J : Finset (Fin (m+1))) (hJ : J.card ≤ 5) + (z : BoundedRelationCover M (alternatingGenerator a r m hm)) + (hz : z ∈ ⨆ W : polygonAlgebra a, (B.polygonStar hlarge h hr W).range) + (hzJ : z ∈ sourceAlignedGroup a r m hm M B.t J) + (htransport : ∀ (j : Fin 5) (x : V.val), + (coverMap M (alternatingGenerator a r m hm) z).val.val (i j,translate a (u j) x.val) = + (k j,translate a (u j) x.val)) : + (MulAut.conj z).toMonoidHom.comp (B.slotStar hlarge h hr hwide V i u hi) = + B.slotStar hlarge h hr hwide V k u hk := + SlotRouting.aligned_transport R hR _ _ J (by omega) z hz hzJ htransport + +theorem slotStar_union (V W : polygonAlgebra a) + (i : Fin 5 → Fin (m+1)) (u : Fin 5 → CutRing × CutRing) + (hinj : Function.Injective (SlotMap a (m+1) (V ⊔ W) (fun j => (i j,u j)))) + (hd : Disjoint V.val W.val) (s : UniversalExtension (alternatingGroup (Fin 5))) : + B.slotStar hlarge h hr hwide (V ⊔ W) i u hinj s = + B.slotStar hlarge h hr hwide V i u (SlotMap_injective_mono _ le_sup_left hinj) s * + B.slotStar hlarge h hr hwide W i u (SlotMap_injective_mono _ le_sup_right hinj) s := by + let ρ := (B.slotRouting_nonempty hlarge h hr (by omega) (V ⊔ W) i u hinj).some + rw [B.slotStar_eq_routing hlarge h hr R hR hwide _ _ _ hinj ρ, + B.slotStar_eq_routing hlarge h hr R hR hwide _ _ _ _ (ρ.restrict V le_sup_left), + B.slotStar_eq_routing hlarge h hr R hR hwide _ _ _ _ (ρ.restrict W le_sup_right)] + exact ρ.star_union hd s + +theorem slotStar_commute (V W : polygonAlgebra a) + (i : Fin 5 → Fin (m+1)) (u : Fin 5 → CutRing × CutRing) + (hinj : Function.Injective (SlotMap a (m+1) (V ⊔ W) (fun j => (i j,u j)))) + (hd : Disjoint V.val W.val) (s t : UniversalExtension (alternatingGroup (Fin 5))) : + Commute + (B.slotStar hlarge h hr hwide V i u (SlotMap_injective_mono _ le_sup_left hinj) s) + (B.slotStar hlarge h hr hwide W i u (SlotMap_injective_mono _ le_sup_right hinj) t) := by + let ρ := (B.slotRouting_nonempty hlarge h hr (by omega) (V ⊔ W) i u hinj).some + rw [B.slotStar_eq_routing hlarge h hr R hR hwide _ _ _ _ (ρ.restrict V le_sup_left), + B.slotStar_eq_routing hlarge h hr R hR hwide _ _ _ _ (ρ.restrict W le_sup_right)] + exact ρ.star_commute hd s t + +end InitialCoverSystem + +end SimpleAmenable + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/CentralRangeReflection.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/CentralRangeReflection.lean new file mode 100644 index 0000000000000000000000000000000000000000..8c6c38f68162c9fc4b4d7c96b516c34c51310e4b --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/CentralRangeReflection.lean @@ -0,0 +1,119 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.NestedCutCalculus +import OAI.GroupTheory.SimpleAmenable.CentralCovers.AssignmentGeneration + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section CentralRangeReflection +open scoped commutatorElement + +theorem perfect_range_le_of_central_image {G H Q : Type*} [Group G] [Group H] + [Group Q] [Group.IsPerfect G] (f : G →* H) (q : H →* Q) + (hc : q.ker ≤ Subgroup.center H) (K : Subgroup H) + (himage : (q.comp f).range ≤ K.map q) : f.range ≤ K := by + have he : f.range = ⁅f.range,f.range⁆ := by + rw [← map_commutator_eq,Group.IsPerfect.commutator_eq_top,← MonoidHom.range_eq_map] + rw [he] + apply Subgroup.commutator_le.mpr + intro x hx y hy + obtain ⟨u,hu⟩ := hx + obtain ⟨v,hv⟩ := hy + obtain ⟨k,hk,hkx⟩ := Subgroup.mem_map.mp (himage ⟨u,by simpa using congrArg q hu⟩) + obtain ⟨l,hl,hly⟩ := Subgroup.mem_map.mp (himage ⟨v,by simpa using congrArg q hv⟩) + have hz : k⁻¹*x ∈ Subgroup.center H := hc (by + change q (k⁻¹*x) = 1 + simp only [map_mul,map_inv,hkx,inv_mul_cancel]) + have hw : l⁻¹*y ∈ Subgroup.center H := hc (by + change q (l⁻¹*y) = 1 + simp only [map_mul,map_inv,hly,inv_mul_cancel]) + have hz' (a : H) : ⁅k⁻¹*x,a⁆ = 1 := + commutatorElement_eq_one_iff_mul_comm.mpr ((Subgroup.mem_center_iff.mp hz a).symm) + have hw' (a : H) : ⁅a,l⁻¹*y⁆ = 1 := + commutatorElement_eq_one_iff_mul_comm.mpr (Subgroup.mem_center_iff.mp hw a) + have hxy : ⁅x,y⁆ = ⁅k,l⁆ := by + have hex : x=k*(k⁻¹*x) := by simp + have hey : y=l*(l⁻¹*y) := by simp + conv_lhs => rw [hex,hey] + rw [commutatorElement_mul_left_eq_conj_mul,hz'] + simp only [mul_one,mul_inv_cancel,one_mul] + rw [commutatorElement_mul_right_eq_mul_conj,hw'] + simp only [mul_one,mul_inv_cancel_right] + rw [hxy] + exact K.mul_mem (K.mul_mem (K.mul_mem hk hl) (K.inv_mem hk)) (K.inv_mem hl) + +end CentralRangeReflection + +section FormalSectorSupport +variable {E E' H Ω ι : Type*} [Group E] [Group E'] [Group H] + +def assignmentPost (ψ : E' →* E) : (Ω → E') →* (Ω → E) where + toFun f ω := ψ (f ω) + map_one' := by ext ω; exact map_one ψ + map_mul' f g := by ext ω; exact map_mul ψ (f ω) (g ω) + +theorem assignmentPost_mask (ψ : E' →* E) (U : Set Ω) (s : E') : + assignmentPost ψ (sectorMask U s) = sectorMask U (ψ s) := by + classical + ext ω + by_cases h : ω ∈ U <;> simp [assignmentPost,sectorMask,h] + +theorem centralSector_supported [Group.IsPerfect E] [Group.IsPerfect E'] + [Finite Ω] [Finite ι] (φ : (Ω → E) →* H ⧸ Subgroup.center H) + (U : ι → Set Ω) (hsep : ∀ ω ν, (∀ i, ω ∈ U i ↔ ν ∈ U i) → ω=ν) + (ψ : E' →* E) (K : Subgroup H) + (hwhole : ∀ s, φ (sectorMask Set.univ (ψ s)) ∈ K.map (QuotientGroup.mk' _)) + (hU : ∀ i s, φ (sectorMask (U i) (ψ s)) ∈ K.map (QuotientGroup.mk' _)) + (V : Set Ω) : + ((centralSector φ V).comp (universalMap ψ)).range ≤ K := by + let q := QuotientGroup.mk' (Subgroup.center H) + let J := (K.map q).comap (φ.comp (assignmentPost ψ)) + have hJ : J=⊤ := assignment_group_generated U hsep J + (fun s => by change φ (assignmentPost ψ (sectorMask Set.univ s)) ∈ K.map q + rw [assignmentPost_mask]; exact hwhole s) + (fun i s => by change φ (assignmentPost ψ (sectorMask (U i) s)) ∈ K.map q + rw [assignmentPost_mask]; exact hU i s) + apply perfect_range_le_of_central_image _ q (by rw [QuotientGroup.ker_mk']) K + rintro y ⟨s,rfl⟩ + change q (centralSector φ V (universalMap ψ s)) ∈ K.map q + rw [centralSector_spec] + have hs := DFunLike.congr_fun (universalMap_spec ψ) s + change universalProjection E (universalMap ψ s)=ψ (universalProjection E' s) at hs + rw [hs,← assignmentPost_mask] + have hmem : sectorMask V (universalProjection E' s) ∈ J := by rw [hJ]; trivial + exact hmem + +theorem centralSector_whole_eq [Group.IsPerfect E] + (φ : (Ω → E) →* H ⧸ Subgroup.center H) (c : E →* H) + (hc : φ.comp (sectorMask Set.univ)=(QuotientGroup.mk' _).comp c) : + centralSector φ Set.univ=c.comp (universalProjection E) := by + apply perfect_lift_unique (QuotientGroup.mk' (Subgroup.center H)) + (by rw [QuotientGroup.ker_mk']) + ext s + simp only [MonoidHom.comp_apply,centralSector_spec] + exact DFunLike.congr_fun hc (universalProjection E s) + +theorem centralSector_control [Group.IsPerfect E] + (φ : (Ω → E) →* H ⧸ Subgroup.center H) {U V : Set Ω} (hUV : U ⊆ V) : + SameActionOn (centralSector φ V) (centralSector φ Set.univ) (centralSector φ U).range := by + intro s x hx + obtain ⟨t,rfl⟩ := hx + have hd : Disjoint V Vᶜ := disjoint_compl_right_iff.mpr le_rfl + have he := centralSector_union φ hd s + rw [Set.union_compl_self] at he + rw [he] + exact (conj_mul_of_commute _ _ _ + (centralSector_commute φ (disjoint_compl_left_iff.mpr hUV) s t)).symm + +end FormalSectorSupport + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/ClippedLineSlideAction.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/ClippedLineSlideAction.lean new file mode 100644 index 0000000000000000000000000000000000000000..1cff732e9584d3a222f3e0a8d4c95d7a5f347e81 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/ClippedLineSlideAction.lean @@ -0,0 +1,177 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.IntervalTangentConnectivity +import OAI.GroupTheory.SimpleAmenable.Homology.ClippedLineSlide +import OAI.GroupTheory.SimpleAmenable.Homology.GlobalTangentChain + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section ClippedLineSlideAction +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + +theorem tangent_interval_edge_action (hlarge : 20 ≤ m+1) + (hr : 0 < ordinary r ∧ ordinary r < 1/2) + (g : ∀ n, B.CoordinateWindowLaw n) + (k : ℕ) (p : Fin 2 → ℤ) (u : CutRing) (h : B.TangentChartLaws k p u) + (d : Fin 2) + (hsteps : ∀ e j, |ordinary (pointCoordinate (tangentOffset a d (signedShortSteps u e)) j)| ≤ 2*ordinary r) + (hlabels : ∀ e j, + (p j ≤ endpointLabel (clippingOverlapLower r (tangentOffset a d (signedShortSteps u e)) j) ∧ + endpointLabel (clippingOverlapLower r (tangentOffset a d (signedShortSteps u e)) j) < p j+k) ∧ + (p j ≤ endpointLabel (clippingOverlapUpper r (tangentOffset a d (signedShortSteps u e)) j) ∧ + endpointLabel (clippingOverlapUpper r (tangentOffset a d (signedShortSteps u e)) j) < p j+k)) + (z : CutRing × CutRing) (L V : Fin 2 → CutRing) + (hLV : ∀ j, ordinary (L j) ≤ ordinary (V j)) + (A C : ℝ) (x y : CutRing) (hstep : TangentIntervalStep u A C x y) + (hcenters : ∀ t : CutRing, A ≤ ordinary t → ordinary t ≤ C → ∀ j, + -ordinary r ≤ ordinary (L j)-ordinary (pointCoordinate (z+tangentOffset a d t) j) ∧ + ordinary (V j)-ordinary (pointCoordinate (z+tangentOffset a d t) j) ≤ ordinary r) + (n : ℕ) (q : Fin 2 → ℤ) + (hW : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) + (coordinateWindowPrimitives n q) i).val) (coordinateRectangle a L V).val) + (f : TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm)) + (hf : B.AlignedSmallSupported f) + (hc : SmallControlled B.c f (B.windowSector (by omega) n (g n) q (coordinateRectangle a L V))) + (I : ControlAlphabet (Fin (m+1))) (s : UniversalExtension (alternatingGroup I.val)) + (t : BoundedRelationCover M (alternatingGenerator a r m hm)) (ht : t ∈ f.range) : + B.tangentSign (by omega) k p u h d (z+tangentOffset a d x) true + (universalMap (subtypeAlternatingHom I.val) s)*t* + (B.tangentSign (by omega) k p u h d (z+tangentOffset a d x) true + (universalMap (subtypeAlternatingHom I.val) s))⁻¹ = + B.tangentSign (by omega) k p u h d (z+tangentOffset a d y) true + (universalMap (subtypeAlternatingHom I.val) s)*t* + (B.tangentSign (by omega) k p u h d (z+tangentOffset a d y) true + (universalMap (subtypeAlternatingHom I.val) s))⁻¹ := by + obtain ⟨e,he⟩ := tangentIntervalStep_index hstep + have hy := hcenters x hstep.1 hstep.2.1 + have hy' := hcenters y hstep.2.2.1 hstep.2.2.2.1 + have hcenter : z+tangentOffset a d y = (z+tangentOffset a d x)+tangentOffset a d (signedShortSteps u e) := by + rw [he,tangentOffset_add,add_assoc] + have hb := clippingOverlap_bounds r (tangentOffset a d (signedShortSteps u e)) hr (hsteps e) + have hinc := coordinateRectangle_in_clippingOverlap (a := a) r hr + (z+tangentOffset a d x) (tangentOffset a d (signedShortSteps u e)) L V hLV (hsteps e) hy + (by simpa only [← hcenter] using hy') + have hc' := B.all_rectangle_control_to_chart hlarge g k p u h d e (z+tangentOffset a d x) + (clippingOverlapLower r (tangentOffset a d (signedShortSteps u e))) + (clippingOverlapUpper r (tangentOffset a d (signedShortSteps u e))) + (fun j => (hlabels e j).1) (fun j => (hlabels e j).2) n q (coordinateRectangle a L V) hW hinc f hf hc + have heq := B.tangentSign_step_action_closed hlarge hr k p u h d e (z+tangentOffset a d x) + (clippingOverlapLower r (tangentOffset a d (signedShortSteps u e))) + (clippingOverlapUpper r (tangentOffset a d (signedShortSteps u e))) + (fun j => (hlabels e j).1) (fun j => (hlabels e j).2) + (fun j => (hb j).1) (fun j => (hb j).2.1) (fun j => (hb j).2.2.1) (fun j => (hb j).2.2.2) + f hf hc' I s t ht + exact heq.trans (congrArg (fun z => + B.tangentSign (by omega) k p u h d z true (universalMap (subtypeAlternatingHom I.val) s)*t* + (B.tangentSign (by omega) k p u h d z true (universalMap (subtypeAlternatingHom I.val) s))⁻¹) + hcenter.symm) + +theorem tangent_interval_action (hlarge : 20 ≤ m+1) + (hr : 0 < ordinary r ∧ ordinary r < 1/2) + (g : ∀ n, B.CoordinateWindowLaw n) + (k : ℕ) (p : Fin 2 → ℤ) (u : CutRing) (h : B.TangentChartLaws k p u) + (d : Fin 2) + (hsteps : ∀ e j, |ordinary (pointCoordinate (tangentOffset a d (signedShortSteps u e)) j)| ≤ 2*ordinary r) + (hlabels : ∀ e j, + (p j ≤ endpointLabel (clippingOverlapLower r (tangentOffset a d (signedShortSteps u e)) j) ∧ + endpointLabel (clippingOverlapLower r (tangentOffset a d (signedShortSteps u e)) j) < p j+k) ∧ + (p j ≤ endpointLabel (clippingOverlapUpper r (tangentOffset a d (signedShortSteps u e)) j) ∧ + endpointLabel (clippingOverlapUpper r (tangentOffset a d (signedShortSteps u e)) j) < p j+k)) + (z : CutRing × CutRing) (L V : Fin 2 → CutRing) + (hLV : ∀ j, ordinary (L j) ≤ ordinary (V j)) + (A C : ℝ) (x y : CutRing) (hpath : TangentIntervalReach u A C x y) + (hcenters : ∀ t : CutRing, A ≤ ordinary t → ordinary t ≤ C → ∀ j, + -ordinary r ≤ ordinary (L j)-ordinary (pointCoordinate (z+tangentOffset a d t) j) ∧ + ordinary (V j)-ordinary (pointCoordinate (z+tangentOffset a d t) j) ≤ ordinary r) + (n : ℕ) (q : Fin 2 → ℤ) + (hW : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) + (coordinateWindowPrimitives n q) i).val) (coordinateRectangle a L V).val) + (f : TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm)) + (hf : B.AlignedSmallSupported f) + (hc : SmallControlled B.c f (B.windowSector (by omega) n (g n) q (coordinateRectangle a L V))) + (I : ControlAlphabet (Fin (m+1))) (s : UniversalExtension (alternatingGroup I.val)) + (t : BoundedRelationCover M (alternatingGenerator a r m hm)) (ht : t ∈ f.range) : + B.tangentSign (by omega) k p u h d (z+tangentOffset a d x) true + (universalMap (subtypeAlternatingHom I.val) s)*t* + (B.tangentSign (by omega) k p u h d (z+tangentOffset a d x) true + (universalMap (subtypeAlternatingHom I.val) s))⁻¹ = + B.tangentSign (by omega) k p u h d (z+tangentOffset a d y) true + (universalMap (subtypeAlternatingHom I.val) s)*t* + (B.tangentSign (by omega) k p u h d (z+tangentOffset a d y) true + (universalMap (subtypeAlternatingHom I.val) s))⁻¹ := by + induction hpath with + | refl => rfl + | @tail y y' _ hstep ih => + exact ih.trans (B.tangent_interval_edge_action hlarge hr g k p u h d hsteps hlabels z L V hLV + A C y y' hstep hcenters n q hW f hf hc I s t ht) + +theorem tangent_line_slide (hlarge : 20 ≤ m+1) + (hr : 0 < ordinary r ∧ ordinary r < 1/2) + (g : ∀ n, B.CoordinateWindowLaw n) + (k : ℕ) (p : Fin 2 → ℤ) (u v : CutRing) (huv : u*v=1) + (h : B.TangentChartLaws k p u) + (hshort : 4*(1+|ordinary (cutTau^a)|)*(|ordinary u|+|ordinary (cutTau*u)|) ≤ ordinary r) + (hlabels : ∀ d e j, + (p j ≤ endpointLabel (clippingOverlapLower r (tangentOffset a d (signedShortSteps u e)) j) ∧ + endpointLabel (clippingOverlapLower r (tangentOffset a d (signedShortSteps u e)) j) < p j+k) ∧ + (p j ≤ endpointLabel (clippingOverlapUpper r (tangentOffset a d (signedShortSteps u e)) j) ∧ + endpointLabel (clippingOverlapUpper r (tangentOffset a d (signedShortSteps u e)) j) < p j+k)) + (d : Fin 2) (z : CutRing × CutRing) (w : CutRing) (L V : Fin 2 → CutRing) + (hLV : ∀ j, ordinary (L j) ≤ ordinary (V j)) + (hz : ∀ j, -ordinary r ≤ ordinary (L j)-ordinary (pointCoordinate z j) ∧ + ordinary (V j)-ordinary (pointCoordinate z j) ≤ ordinary r) + (hzw : ∀ j, -ordinary r ≤ ordinary (L j)-ordinary (pointCoordinate (z+tangentOffset a d w) j) ∧ + ordinary (V j)-ordinary (pointCoordinate (z+tangentOffset a d w) j) ≤ ordinary r) + (c : ℝ) + (hnear : ∀ j, + |ordinary (L j)-(ordinary (pointCoordinate z j)+tangentCoefficient a d j*c)| ≤ ordinary r/4 ∧ + |ordinary (V j)-(ordinary (pointCoordinate z j)+tangentCoefficient a d j*c)| ≤ ordinary r/4) + (n : ℕ) (q : Fin 2 → ℤ) + (hW : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) + (coordinateWindowPrimitives n q) i).val) (coordinateRectangle a L V).val) + (f : TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm)) + (hf : B.AlignedSmallSupported f) + (hc : SmallControlled B.c f (B.windowSector (by omega) n (g n) q (coordinateRectangle a L V))) + (I : ControlAlphabet (Fin (m+1))) (s : UniversalExtension (alternatingGroup I.val)) + (t : BoundedRelationCover M (alternatingGenerator a r m hm)) (ht : t ∈ f.range) : + B.tangentSign (by omega) k p u h d z true (universalMap (subtypeAlternatingHom I.val) s)*t* + (B.tangentSign (by omega) k p u h d z true (universalMap (subtypeAlternatingHom I.val) s))⁻¹ = + B.tangentSign (by omega) k p u h d (z+tangentOffset a d w) true + (universalMap (subtypeAlternatingHom I.val) s)*t* + (B.tangentSign (by omega) k p u h d (z+tangentOffset a d w) true + (universalMap (subtypeAlternatingHom I.val) s))⁻¹ := by + have hz' := (tangentAllowed_iff a r d z L V (ordinary (0:CutRing))).mpr + (by simpa only [map_zero,mul_zero,add_zero] using hz) + have hw' := (tangentAllowed_iff a r d z L V (ordinary w)).mpr + (by simpa only [pointCoordinate_add,map_add,tangentOffset_coordinate] using hzw) + have hpath := tangentInterval_connected u v huv _ _ + (tangentAllowed_wide a r u hr.1 d z L V c hshort hnear) 0 w hz' hw' + have hsteps (e : Fin 5) (j : Fin 2) : + |ordinary (pointCoordinate (tangentOffset a d (signedShortSteps u e)) j)| ≤ 2*ordinary r := by + have hh := (tangentOffset_ordinary_bound a d (signedShortSteps u e) j).trans + (mul_le_mul_of_nonneg_left (signedShortSteps_bound u e) (by positivity : 0 ≤ 1+|ordinary (cutTau^a)|)) + nlinarith [hr.1] + have heq := B.tangent_interval_action hlarge hr g k p u h d hsteps (hlabels d) z L V hLV + (tangentAllowedLower a r d z V) (tangentAllowedUpper a r d z L) 0 w hpath + (fun t h1 h2 j => by + have hh := (tangentAllowed_iff a r d z L V (ordinary t)).mp ⟨h1,h2⟩ j + simpa only [pointCoordinate_add,map_add,tangentOffset_coordinate] using hh) + n q hW f hf hc I s t ht + simpa only [tangentOffset_zero,add_zero] using heq + +end InitialCoverSystem +end ClippedLineSlideAction + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/ClosedLocalAssignments.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/ClosedLocalAssignments.lean new file mode 100644 index 0000000000000000000000000000000000000000..33910576550620e68e18a737e2d88ec4558d8d81 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/ClosedLocalAssignments.lean @@ -0,0 +1,175 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.GridFormalPatching +import OAI.GroupTheory.SimpleAmenable.CentralCovers.FormalGridPieces +import OAI.GroupTheory.SimpleAmenable.CentralCovers.LocalArrangementAssignments +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.ClosedSquareGerms +import OAI.GroupTheory.SimpleAmenable.CentralCovers.TemplateActualRelators + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section ClosedLocalAssignments +variable {a : ℕ} {ι κ : Type*} + +theorem localCutFamily_assignment_realized_closed [Finite ι] + (j : ι → Fin 4) (c : ι → CutRing) (z : ℝ × ℝ) + (hz₁ : z.1 ∈ Set.Icc (0:ℝ) 1) (hz₂ : z.2 ∈ Set.Icc (0:ℝ) 1) + (y : GenericSquare a) (N : Set (ℝ × ℝ)) (hN : IsOpen N) (hz : z ∈ N) : + ∃ p : GenericSquare a, p.val ∈ N ∧ + polygonAssignment (fun i => cutPolygon a (j i) (c i)) p= + polygonAssignment (localCutFamily j c z) y := by + classical + let σ := polygonAssignment (localCutFamily (a := a) j c z) y + have hactive : ∀ i, cutForm a (j i) z=ordinary (c i) → + if σ i then cutForm a (j i) y.val ordinary (c i)) + z y σ hz₁ hz₂ hactive hinactive N hN hz + refine ⟨p,hp,?_⟩ + funext i + change decide (cutForm a (j i) p.val cutPolygon a (j i) (c i))) := by + rintro σ ⟨y,rfl⟩ + obtain ⟨p,_,hp⟩ := localCutFamily_assignment_realized_closed j c z hz₁ hz₂ y Set.univ isOpen_univ (Set.mem_univ z) + exact ⟨p,hp⟩ + +theorem localPolygonFamily_assignment_realized_closed [Finite κ] + (j : κ → Fin 4) (c : κ → CutRing) (z : ℝ × ℝ) + (hz₁ : z.1 ∈ Set.Icc (0:ℝ) 1) (hz₂ : z.2 ∈ Set.Icc (0:ℝ) 1) + (R : ι → polygonAlgebra a) + (hR : ∀ i, ResolvedBy (fun k => halfPlane a (j k) (c k)) (R i).val) + (y : GenericSquare a) (N : Set (ℝ × ℝ)) (hN : IsOpen N) (hz : z ∈ N) : + ∃ p : GenericSquare a, p.val ∈ N ∧ + polygonAssignment R p=polygonAssignment (localPolygonFamily j c z R) y := by + obtain ⟨p,hp,he⟩ := localCutFamily_assignment_realized_closed j c z hz₁ hz₂ y N hN hz + refine ⟨p,hp,?_⟩ + funext i + apply decide_eq_decide.mpr + change (p ∈ (R i).val) ↔ polygonAssignment (localCutFamily j c z) y ∈ + polygonFormalMask (fun k => cutPolygon a (j k) (c k)) (R i) + rw [← he] + exact (polygonFormalMask_mem _ (R i) (hR i) p).symm + +theorem localPolygonFamily_range_subset_closed [Finite κ] + (j : κ → Fin 4) (c : κ → CutRing) (z : ℝ × ℝ) + (hz₁ : z.1 ∈ Set.Icc (0:ℝ) 1) (hz₂ : z.2 ∈ Set.Icc (0:ℝ) 1) + (R : ι → polygonAlgebra a) + (hR : ∀ i, ResolvedBy (fun k => halfPlane a (j k) (c k)) (R i).val) : + Set.range (polygonAssignment (localPolygonFamily j c z R)) ⊆ Set.range (polygonAssignment R) := by + rintro σ ⟨y,rfl⟩ + obtain ⟨p,_,hp⟩ := localPolygonFamily_assignment_realized_closed j c z hz₁ hz₂ R hR y + Set.univ isOpen_univ (Set.mem_univ z) + exact ⟨p,hp⟩ + +end ClosedLocalAssignments + +section IndependentActualPatching +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) {ι D : Type*} [Finite ι] [Fintype D] + {κ : Option ι → Type*} [∀ i, Finite (κ i)] + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + +theorem independent_actual_patching (hlarge : 25 ≤ m+1) + (F : (i : Option ι) → Option (κ i) → TrackStar (Fin (m+1)) →* + BoundedRelationCover M (alternatingGenerator a r m hm)) + (T : ∀ i, FormalStarTable (F i)) (U : (i : Option ι) → Set (κ i → Bool)) + (C : (i : Option ι) → D → Set (κ i → Bool)) + (hF : ∀ i j, B.AlignedSmallSupported (F i j)) + (hc : ∀ i, F i none=B.c.comp (universalProjection _)) + (hd : ∀ i, Pairwise fun d e => Disjoint (C i d) (C i e)) + (hcover : ∀ i σ, ∃ d, σ ∈ C i d) + (j k : D → TrackStar (Fin (m+1)) →* + BoundedRelationCover M (alternatingGenerator a r m hm)) + (hj : ∀ i d, (T i).sector (C i d)=j d) + (hk : ∀ i d, (T i).sector (C i d)ᶜ=k d) + (hjs : ∀ d, B.AlignedSmallSupported (j d)) + (hcomm : ∀ d s t, Commute (j d s) (k d t)) + (hzero : formalGridInput F T U none=B.c.comp (universalProjection _)) + (f : (I : FiveAlphabet (Fin (m+1))) → Option ι → alternatingGroup I.val →* + BoundedRelationCover M (alternatingGenerator a r m hm)) + (hspec : ∀ I i, (formalGridInput F T U i).comp (universalMap (subtypeAlternatingHom I.val))= + (f I i).comp (universalProjection (alternatingGroup I.val))) + (R : ι → polygonAlgebra a) + (L : ∀ d, B.LocalPatchTemplate (by omega) + (formalGridInput F T U) (formalGridPiece F T U C d)) + (hreal : ∀ d x, x ∈ (L d).margin.val → + polygonAssignment (L d).predicates x ∈ Set.range (polygonAssignment R)) : + HasCentralLaw (smallFamilyModel (actualTestMask R)) (smallFamilyEval f).rangeRestrict := by + classical + have hpieces d i : B.AlignedSmallSupported (formalGridPiece F T U C d i) := + formalGridPiece_supported F T U C _ hF d i + apply supported_assignment_patching (actualTestMask R) ?_ + (formalGridInput F T U) f hspec + (fun d => ⨆ i, (formalGridPiece F T U C d i).range) ?_ ?_ + (fun d i => B.fullGeometricSector (by omega) (L d).tests (L d).lawful + (marginFamily (L d).predicates (L d).margin i)) ?_ ?_ + (by simp only [Fintype.card_fin]; omega) + · intro σ τ h + apply Subtype.ext + funext i + exact Bool.eq_iff_iff.mpr (h i) + · rw [copyFamilyEval_range] + exact formalGridPieces_generate F T U C hd hcover + · exact formalGridInputs_normalize F T U C _ B.c + (by simp only [Fintype.card_fin]; omega) B.constant_aligned B.disjoint_aligned + hF hc j k hj hk hjs hcomm + · intro d I i s + apply inner_action_iSup + intro e + exact (L d).masked_actions (by omega) hzero (hpieces d) i I s e + · intro d S hS w hw hrel + have hh : (⨆ i, (formalGridPiece F T U C d i).range) ≤ + Subgroup.centralizer ({copyFamilyEval + (fun i => B.fullGeometricSector (by omega) (L d).tests (L d).lawful + (marginFamily (L d).predicates (L d).margin i)) + (smallFamilyStarWord w)} : Set _) := by + apply iSup_le + intro i x hx + apply Subgroup.mem_centralizer_singleton_iff.mpr + exact (B.actual_template_actual_word_controls hlarge (L d).tests (L d).lawful + (L d).predicates (L d).margin (L d).predicates_resolved (L d).margin_resolved + _ (hpieces d i) ((L d).controlled i) S hS w hw R (hreal d) hrel x hx).symm + intro x hx + exact (Subgroup.mem_centralizer_singleton_iff.mp (hh hx)).symm + +end InitialCoverSystem +end IndependentActualPatching + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/CommonFrameTransport.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/CommonFrameTransport.lean new file mode 100644 index 0000000000000000000000000000000000000000..38af9728140d068236e11e52649b9f2b16c63c8c --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/CommonFrameTransport.lean @@ -0,0 +1,159 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.FrameCentrality +import OAI.GroupTheory.SimpleAmenable.Configurations.DistinctSlotStars + +namespace OAI + +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement + +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + (hlarge : 15 < m+1) (h : B.AllPrimitiveLaws) (hr : 0 (B.polygonStar hlarge h hr W).range) V) + ⟨universalMap (subtypeAlternatingHom I) s,rfl⟩ + +theorem distinctSlotStar_mem_geometricFrameGroup (ι : Fin 5 ↪ Fin (m+1)) + (u : Fin (m+1) → CutRing × CutRing) + (F : OffsetFrame a r m hm (orderedTrackAlphabet ι) u) (V : polygonAlgebra a) + (s : UniversalExtension (alternatingGroup (Fin 5))) : + B.distinctSlotStar hlarge h hr ι u F V s ∈ B.geometricFrameGroup hlarge h hr F.k := + B.frameStar_mem_geometricFrameGroup hlarge h hr _ u F V (universalMap (orderedTrackHom ι) s) + +theorem distinctSlotStar_common_frame_transport (ι κ : Fin 5 ↪ Fin (m+1)) + (u v : Fin (m+1) → CutRing × CutRing) + (F : OffsetFrame a r m hm (orderedTrackAlphabet ι) u) + (G : OffsetFrame a r m hm (orderedTrackAlphabet κ) v) (hFG : F.k=G.k) + (V : polygonAlgebra a) (z : BoundedRelationCover M (alternatingGenerator a r m hm)) + (hz : z ∈ B.geometricFrameGroup hlarge h hr F.k) + (htransport : ∀ (j : Fin 5) (x : V.val), + (coverMap M (alternatingGenerator a r m hm) z).val.val (ι j,translate a (u (ι j)) x.val) = + (κ j,translate a (v (κ j)) x.val)) : + (MulAut.conj z).toMonoidHom.comp (B.distinctSlotStar hlarge h hr ι u F V) = + B.distinctSlotStar hlarge h hr κ v G V := by + let S := B.geometricFrameGroup hlarge h hr F.k + apply CentralOn.lift_unique (coverMap M (alternatingGenerator a r m hm)) S + (B.geometricFrameGroup_central hlarge h hr F.k) + · rintro y ⟨s,rfl⟩ + exact S.mul_mem (S.mul_mem hz (B.distinctSlotStar_mem_geometricFrameGroup hlarge h hr ι u F V s)) + (S.inv_mem hz) + · rintro y ⟨s,rfl⟩ + have he := B.distinctSlotStar_mem_geometricFrameGroup hlarge h hr κ v G V s + rwa [← hFG] at he + · ext s : 1 + change coverMap M (alternatingGenerator a r m hm) + (z*B.distinctSlotStar hlarge h hr ι u F V s*z⁻¹) = + coverMap M (alternatingGenerator a r m hm) (B.distinctSlotStar hlarge h hr κ v G V s) + rw [map_mul,map_mul,map_inv] + rw [show coverMap M (alternatingGenerator a r m hm) (B.distinctSlotStar hlarge h hr ι u F V s) = _ from + DFunLike.congr_fun (B.distinctSlotStar_projection hlarge h hr ι u F V) s] + rw [show coverMap M (alternatingGenerator a r m hm) (B.distinctSlotStar hlarge h hr κ v G V s) = _ from + DFunLike.congr_fun (B.distinctSlotStar_projection hlarge h hr κ v G V) s] + apply Subtype.ext + exact slotHom_conjugate V (fun j => (ι j,u (ι j))) (fun j => (κ j,v (κ j))) + (slots_injective_of_tracks V _ ι.injective) (slots_injective_of_tracks V _ κ.injective) + (coverMap M (alternatingGenerator a r m hm) z).val htransport (universalProjection _ s).val + +theorem distinctSlotStar_common_frame_fixer (ι : Fin 5 ↪ Fin (m+1)) + (u : Fin (m+1) → CutRing × CutRing) + (F : OffsetFrame a r m hm (orderedTrackAlphabet ι) u) (V : polygonAlgebra a) + (z : BoundedRelationCover M (alternatingGenerator a r m hm)) + (hz : z ∈ B.geometricFrameGroup hlarge h hr F.k) + (hfix : ∀ (j : Fin 5) (x : V.val), + (coverMap M (alternatingGenerator a r m hm) z).val.val (ι j,translate a (u (ι j)) x.val) = + (ι j,translate a (u (ι j)) x.val)) + (s : UniversalExtension (alternatingGroup (Fin 5))) : + Commute z (B.distinctSlotStar hlarge h hr ι u F V s) := by + have he := DFunLike.congr_fun + (B.distinctSlotStar_common_frame_transport hlarge h hr ι ι u u F F rfl V z hz hfix) s + change z*B.distinctSlotStar hlarge h hr ι u F V s*z⁻¹ = B.distinctSlotStar hlarge h hr ι u F V s at he + have he' := congrArg (fun x => x*z) he + exact show _*_ = _*_ from by simpa only [mul_assoc,inv_mul_cancel,mul_one] using he' + +theorem frameStar_uniform (I : Finset (Fin (m+1))) (hI : 5 ≤ I.card) + [Group.IsPerfect (alternatingGroup I)] (b : Fin (m+1)) (hb : b ∉ I) + (u : Fin (m+1) → CutRing × CutRing) (F : OffsetFrame a r m hm I u) + (v : CutRing × CutRing) (hu : ∀ i ∈ I, u i=v) (V : polygonAlgebra a) : + B.frameStar hlarge h hr I u F V = + (B.polygonStar hlarge h hr (spatialTranslate v V)).comp (universalMap (subtypeAlternatingHom I)) := by + let C : CommonFrame a r m hm I v := { + k := F.k + d := F.d + projection := F.projection + common := fun i hi => (F.prescribed i hi).trans (hu i hi) } + exact B.polygonStar_common_translate hlarge h hr I hI b hb v C V + +theorem distinctSlotStar_uniform_mem (ι : Fin 5 ↪ Fin (m+1)) (b : Fin (m+1)) + (hb : b ∉ orderedTrackAlphabet ι) (u : Fin (m+1) → CutRing × CutRing) + (F : OffsetFrame a r m hm (orderedTrackAlphabet ι) u) + (v : CutRing × CutRing) (hu : ∀ j, u (ι j)=v) (V : polygonAlgebra a) + (s : UniversalExtension (alternatingGroup (Fin 5))) : + B.distinctSlotStar hlarge h hr ι u F V s ∈ + ⨆ W : polygonAlgebra a, (B.polygonStar hlarge h hr W).range := by + have hc : 5 ≤ (orderedTrackAlphabet ι).card := by + rw [orderedTrackAlphabet,Finset.card_map,Finset.card_univ,Fintype.card_fin] + have huv : ∀ i ∈ orderedTrackAlphabet ι, u i=v := by + intro i hi + obtain ⟨j,_,rfl⟩ := Finset.mem_map.mp hi + exact hu j + change B.frameStar hlarge h hr (orderedTrackAlphabet ι) u F V (universalMap (orderedTrackHom ι) s) ∈ _ + rw [B.frameStar_uniform hlarge h hr _ hc b hb u F v huv V] + exact (le_iSup (fun W : polygonAlgebra a => (B.polygonStar hlarge h hr W).range) (spatialTranslate v V)) ⟨_,rfl⟩ + +theorem distinctSlotStar_uniform_fixer (ι : Fin 5 ↪ Fin (m+1)) (b : Fin (m+1)) + (hb : b ∉ orderedTrackAlphabet ι) (u : Fin (m+1) → CutRing × CutRing) + (F : OffsetFrame a r m hm (orderedTrackAlphabet ι) u) + (v : CutRing × CutRing) (hu : ∀ j, u (ι j)=v) (V : polygonAlgebra a) + (z : BoundedRelationCover M (alternatingGenerator a r m hm)) + (hz : z ∈ ⨆ W : polygonAlgebra a, (B.polygonStar hlarge h hr W).range) + (hfix : ∀ (j : Fin 5) (x : V.val), + (coverMap M (alternatingGenerator a r m hm) z).val.val (ι j,translate a (u (ι j)) x.val) = + (ι j,translate a (u (ι j)) x.val)) + (s : UniversalExtension (alternatingGroup (Fin 5))) : + Commute z (B.distinctSlotStar hlarge h hr ι u F V s) := by + apply CentralOn.commute_perfect _ _ (B.polygonStars_central hlarge h hr) + (B.distinctSlotStar hlarge h hr ι u F V) _ z hz _ s + · rintro y ⟨s,rfl⟩ + exact B.distinctSlotStar_uniform_mem hlarge h hr ι b hb u F v hu V s + · intro t + have hg := B.frameStar_supported hlarge h hr (orderedTrackAlphabet ι) u F V + (universalMap (orderedTrackHom ι) t) + have hf : ∀ p ∈ frameDomain (orderedTrackAlphabet ι) u V, + (coverMap M (alternatingGenerator a r m hm) z).val.val p=p := by + rintro p ⟨i,hi,x,hx,rfl⟩ + obtain ⟨j,_,rfl⟩ := Finset.mem_map.mp hi + exact hfix j ⟨x,hx⟩ + exact show _*_ = _*_ from Subtype.ext (Subtype.ext (supported_fixer_commute hf hg).eq) + +theorem frameStar_alphabet_mem (I : Finset (Fin (m+1))) (hI : 5 ≤ I.card) + [Group.IsPerfect (alternatingGroup I)] (b : Fin (m+1)) (hb : b ∉ I) + (u : Fin (m+1) → CutRing × CutRing) (F : OffsetFrame a r m hm I u) + (V : polygonAlgebra a) (s : UniversalExtension (alternatingGroup I)) : + B.frameStar hlarge h hr I u F V s ∈ sourceAlignedGroup a r m hm M B.t I := + alignedGroup_conjugate B.t _ _ F.k (B.polygonStar_alphabet_aligned hlarge h hr I hI b hb V s) + +end InitialCoverSystem + +end SimpleAmenable + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/ConcurrentCellSlopeAction.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/ConcurrentCellSlopeAction.lean new file mode 100644 index 0000000000000000000000000000000000000000..5fa2f47ea200de6cd446eb5aafb89d6794068965 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/ConcurrentCellSlopeAction.lean @@ -0,0 +1,179 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.WindowClipping +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.ConcurrentGeometry + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section ConcurrentCellSlopeAction +namespace InitialCoverSystem.RectangularAtlas +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + {B : InitialCoverSystem a r m hm M} + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + (A : B.RectangularAtlas) (C : ConcurrentGeometry a r) + +theorem concurrent_cell_slope_action (hlarge : 20 ≤ m+1) + (hr : 0 < ordinary r ∧ ordinary r < 1/2) (ha : 0 windowCut C.mesh (q k) (cell k).castSucc + let V := fun k => windowCut C.mesh (q k) (cell k).succ + have hLV (k) : ordinary (L k) ≤ ordinary (V k) := + (windowCut_strictMono C.mesh (q k) (Fin.castSucc_lt_succ (i := cell k))).le + obtain ⟨z₀,hz₀,hz₀cell⟩ := windowRectangle_crossing_line_point C.mesh C.mesh_large q cell + (slopeDirection d) (integralCutForm a (slopeDirection d) z) x y hx hy hcx hcy + have hLcell : ∀ k, ordinary (L k) ≤ realCoordinate (ordinary (L 0),ordinary (L 1)) k ∧ + realCoordinate (ordinary (L 0),ordinary (L 1)) k ≤ ordinary (V k) := by + intro k; fin_cases k <;> exact ⟨le_rfl,hLV _⟩ + have hVcell : ∀ k, ordinary (L k) ≤ realCoordinate (ordinary (V 0),ordinary (V 1)) k ∧ + realCoordinate (ordinary (V 0),ordinary (V 1)) k ≤ ordinary (V k) := by + intro k; fin_cases k <;> exact ⟨hLV _,le_rfl⟩ + have hclip' : ∀ k, -ordinary r ≤ ordinary (L k)-ordinary (pointCoordinate (u+C.anchors t (slopeDirection d)) k) ∧ + ordinary (V k)-ordinary (pointCoordinate (u+C.anchors t (slopeDirection d)) k) ≤ ordinary r := by + intro k + have hmL := fun l => (hmargin _ hLcell l).imp le_of_lt le_of_lt + have hmV := fun l => (hmargin _ hVcell l).imp le_of_lt le_of_lt + have h₁ := hclose (slopeDirection d) (by simp) _ hmL k + have h₂ := hclose (slopeDirection d) (by simp) _ hmV k + have hc₁ : realCoordinate (ordinary (L 0),ordinary (L 1)) k=ordinary (L k) := by fin_cases k <;> rfl + have hc₂ : realCoordinate (ordinary (V 0),ordinary (V 1)) k=ordinary (V k) := by fin_cases k <;> rfl + rw [hc₁] at h₁ + rw [hc₂] at h₂ + have hb₁ := (abs_lt.mp h₁).1 + have hb₂ := (abs_lt.mp h₂).2 + have hh := C.radius + have hpos := C.positive + constructor <;> linarith + have hnear (k) : |ordinary (L k)-realCoordinate z₀ k| ≤ ordinary r/4 ∧ + |ordinary (V k)-realCoordinate z₀ k| ≤ ordinary r/4 := by + have hh := hz₀cell k + have hm := windowCut_mesh C.mesh (q k) (cell k) + have he := C.mesh_small + have hr' := C.radius + have hpos := C.positive + change ordinary (L k) ≤ realCoordinate z₀ k ∧ realCoordinate z₀ k ≤ ordinary (V k) at hh + change ordinary (V k)-ordinary (L k) ≤ 200/(C.mesh:ℝ) at hm + rw [abs_of_nonpos (by linarith : ordinary (L k)-realCoordinate z₀ k≤0), + abs_of_nonneg (by linarith : 0≤ordinary (V k)-realCoordinate z₀ k)] + constructor <;> linarith + intro f hf hc I s b hb + exact A.slope_line_action hlarge hr d z (u+C.anchors t (slopeDirection d)) hline.symm L V hLV + hclip hclip' z₀ hz₀ hnear C.mesh q (windowRectangle_resolved C.mesh (by have hh := C.mesh_large; omega) q cell) + f hf hc I s b hb + +end InitialCoverSystem.RectangularAtlas +end ConcurrentCellSlopeAction + +section ActualTemplateWindows +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) {ι : Type*} [Finite ι] + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + +theorem templateWindowSector_eq (hlarge : 15 < m+1) + (k : ℕ) (p : Fin 2 → ℤ) (z : CutRing × CutRing) (g : B.CoordinateWindowLaw k) + (P : ι → Fin 5 × (CutRing × CutRing)) + (h : ∀ I, I.card≤15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb P) + (v : Fin 2 × Fin (k-1) → ι) + (hv : ∀ i, P (v i)=translatedTemplate (coordinateWindowPrimitives k p) z i) + (V : polygonAlgebra a) + (hV : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) + (coordinateWindowPrimitives k p) i).val) V.val) : + B.fullGeometricSector hlarge P h (spatialTranslate z V)= + B.windowSector hlarge k g (fun j => pointLabel z j+p j) (spatialTranslate z V) := by + apply B.chartCoordinateSector_eq_window hlarge k g (fun j => pointLabel z j+p j) + P h v Prod.fst (fun i => z+(coordinateWindowPrimitives k p i).2) + · intro i + rw [hv i] + rfl + · intro i + change pointLabel z i.1 + p i.1 ≤ pointLabel (z+(coordinateWindowPrimitives k p i).2) i.1 + rw [pointLabel_add,coordinateWindow_pointLabel] + omega + · intro i + change pointLabel (z+(coordinateWindowPrimitives k p i).2) i.1 < pointLabel z i.1+p i.1+(k-1:ℕ) + rw [pointLabel_add,coordinateWindow_pointLabel] + have hi := i.2.isLt + omega + · intro x y he + apply (translatedTemplate_resolved (a := a) (r := r) (coordinateWindowPrimitives k p) V hV z) x y + simpa only [primitiveTests,primitiveFamilyTests,translatedTemplate,coordinateWindowPrimitives, + initialTest_coordinate] using he + +theorem all_rectangle_control_to_template (hlarge : 20 ≤ m+1) + (g : ∀ n, B.CoordinateWindowLaw n) + (k : ℕ) (p : Fin 2 → ℤ) (z : CutRing × CutRing) + (P : ι → Fin 5 × (CutRing × CutRing)) + (h : ∀ I, I.card≤15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb P) + (v : Fin 2 × Fin (k-1) → ι) + (hv : ∀ i, P (v i)=translatedTemplate (coordinateWindowPrimitives k p) z i) + (V : polygonAlgebra a) + (hV : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) + (coordinateWindowPrimitives k p) i).val) V.val) + (hV' : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) + (coordinateWindowPrimitives k (fun j => pointLabel z j+p j)) i).val) (spatialTranslate z V).val) + (n : ℕ) (q : Fin 2 → ℤ) (W : polygonAlgebra a) + (hW : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) + (coordinateWindowPrimitives n q) i).val) W.val) + (hinc : W ≤ spatialTranslate z V) + (f : TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm)) + (hf : B.AlignedSmallSupported f) + (hc : SmallControlled B.c f (B.windowSector (by omega) n (g n) q W)) : + SmallControlled B.c f (B.fullGeometricSector (by omega) P h (spatialTranslate z V)) := by + rw [B.templateWindowSector_eq (by omega) k p z (g k) P h v hv V hV] + apply B.control_trans hlarge f _ _ hf (B.fullGeometricSector_supported (by omega) _ _ _ hV') hc + exact B.all_window_control (by omega) g n k q _ W (spatialTranslate z V) hinc hW hV' + +end InitialCoverSystem +end ActualTemplateWindows + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/ConcurrentCoordinateGates.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/ConcurrentCoordinateGates.lean new file mode 100644 index 0000000000000000000000000000000000000000..62cc21ae8b92657cc5ced3b60570aedf8361d171 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/ConcurrentCoordinateGates.lean @@ -0,0 +1,109 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.CoordinateTemplateControl +import OAI.GroupTheory.SimpleAmenable.CentralCovers.CrossingCellActions +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.ConcurrentInwardModel + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section ConcurrentCoordinateGates +namespace InitialCoverSystem.PatchAtlas +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + {B : InitialCoverSystem a r m hm M} + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] (A : B.PatchAtlas) + +def concurrentCoordinateEmbedding : + Sum (Fin 2) (Fin 2 × Fin (A.geometry.window-1)) → + Sum (Fin 4) (Fin 2 × Fin (A.geometry.window-1)) := + Sum.map axisDirection id + +noncomputable def concurrentCoordinates (t : VertexType (commonVertexDenominator a)) + (u : CutRing × CutRing) := A.concurrentPrimitives t u ∘ A.concurrentCoordinateEmbedding + +omit [Group.IsPerfect (alternatingGroup (Fin (m+1)))] in +theorem concurrentCoordinates_eq (t : VertexType (commonVertexDenominator a)) + (u : CutRing × CutRing) : + A.concurrentCoordinates t u=fun i => + (coordinateTestIndex (Sum.elim id Prod.fst i), + Sum.elim (fun k => u+A.geometry.anchors t (axisDirection k)) + (fun k => u+(coordinateWindowPrimitives A.geometry.window A.geometry.start k).2) i) := by + funext i + cases i <;> rfl + +omit [Group.IsPerfect (alternatingGroup (Fin (m+1)))] in +theorem coordinate_margin_resolved (t : VertexType (commonVertexDenominator a)) + (u : CutRing × CutRing) : + ResolvedBy (fun i => (primitiveTests (a := a) (r := r) (A.concurrentCoordinates t u) i).val) + (A.geometry.marginPolygon t u).val := by + intro x y hh + apply translatedTemplate_resolved (coordinateWindowPrimitives A.geometry.window A.geometry.start) + (coordinateRectangle a (A.geometry.margins t).lower (A.geometry.margins t).upper) + (A.geometry.margin_resolved t) u x y + intro i + exact hh (Sum.inr i) + +omit [Group.IsPerfect (alternatingGroup (Fin (m+1)))] in +theorem coordinate_positive_resolved (t : VertexType (commonVertexDenominator a)) + (u : CutRing × CutRing) (k : Fin 2) : + ResolvedBy (fun i => (primitiveTests (a := a) (r := r) (A.concurrentCoordinates t u) i).val) + (A.geometry.positiveDecision t u (axisDirection k)).val := by + intro x y hh + exact hh (Sum.inl k) + +omit [Group.IsPerfect (alternatingGroup (Fin (m+1)))] in +theorem coordinate_inward_resolved (t : VertexType (commonVertexDenominator a)) + (u : CutRing × CutRing) (z : ℝ × ℝ) : + ResolvedBy (fun i => (primitiveTests (a := a) (r := r) (A.concurrentCoordinates t u) i).val) + (A.geometry.inwardMargin t u z).val := by + intro x y hh + have hgate k : x ∈ (A.geometry.inwardGate t u z k).val ↔ y ∈ (A.geometry.inwardGate t u z k).val := by + dsimp only [ConcurrentGeometry.inwardGate] + split_ifs + · exact A.coordinate_positive_resolved t u k x y hh + · exact not_congr (A.coordinate_positive_resolved t u k x y hh) + · exact Iff.rfl + exact and_congr (and_congr (A.coordinate_margin_resolved t u x y hh) (hgate 0)) (hgate 1) + +omit [Group.IsPerfect (alternatingGroup (Fin (m+1)))] in +theorem coordinate_localDecision_resolved (t : VertexType (commonVertexDenominator a)) + (u : CutRing × CutRing) (z : ℝ × ℝ) (k : Fin 2) (c : CutRing) : + ResolvedBy (fun i => (primitiveTests (a := a) (r := r) (A.concurrentCoordinates t u) i).val) + (A.geometry.localDecision t u z (axisDirection k) c).val := by + intro x y hh + dsimp only [ConcurrentGeometry.localDecision] + split_ifs + · exact not_congr (A.coordinate_positive_resolved t u k x y hh) + · exact Iff.rfl + · exact Iff.rfl + +theorem coordinate_control_inward_gate (hlarge : 20 ≤ m+1) + (t : VertexType (commonVertexDenominator a)) (u : CutRing × CutRing) + (V : polygonAlgebra a) + (hV : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) (A.concurrentCoordinates t u) i).val) V.val) + (n : ℕ) (q : Fin 2 → ℤ) (W : polygonAlgebra a) + (hW : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) (coordinateWindowPrimitives n q) i).val) W.val) + (hinc : W ≤ V) + (f : TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm)) + (hf : B.AlignedSmallSupported f) + (hc : SmallControlled B.c f (B.windowSector (by omega) n (A.rectangles.rectangles n) q W)) : + SmallControlled B.c f (B.fullGeometricSector (by omega) (A.concurrentPrimitives t u) (A.concurrentLaw t u) V) := by + apply B.coordinate_control_to_template hlarge A.rectangles.rectangles _ (A.concurrentLaw t u) + (Sum.elim id Prod.fst) + (Sum.elim (fun k => u+A.geometry.anchors t (axisDirection k)) + (fun k => u+(coordinateWindowPrimitives A.geometry.window A.geometry.start k).2)) + A.concurrentCoordinateEmbedding (A.concurrentCoordinates_eq t u) V _ n q W hW hinc f hf hc + simpa only [← A.concurrentCoordinates_eq t u] using hV + +end InitialCoverSystem.PatchAtlas +end ConcurrentCoordinateGates + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/ConditionalBooleanGeneration.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/ConditionalBooleanGeneration.lean new file mode 100644 index 0000000000000000000000000000000000000000..bf9b069f0556cd370cce9cd8f2117a270f3103f8 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/ConditionalBooleanGeneration.lean @@ -0,0 +1,181 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Configurations.TrackTranslationChart + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section ConditionalBooleanGeneration + +open scoped commutatorElement + +theorem conditional_inter_commutator {a m : ℕ} (U V : polygonAlgebra a) + (g h : Equiv.Perm (Fin m)) : + conditionalHom (U ⊓ V) ⁅g,h⁆ = ⁅conditionalHom U g,conditionalHom V h⁆ := by + classical + apply Subtype.ext + apply Equiv.ext + intro p + change conditionalPerm (U ⊓ V) ⁅g,h⁆ p = + conditionalPerm U g (conditionalPerm V h + ((conditionalPerm U g).symm ((conditionalPerm V h).symm p))) + obtain ⟨i,p⟩ := p + by_cases hU : p ∈ U.val <;> by_cases hV : p ∈ V.val <;> + simp_all [conditionalPerm,commutatorElement_def,Equiv.Perm.mul_apply] + +theorem conditional_complement {a m : ℕ} (U : polygonAlgebra a) + (g : Equiv.Perm (Fin m)) : + conditionalHom Uᶜ g = conditionalHom (wholePolygon a) g * (conditionalHom U g)⁻¹ := by + classical + apply Subtype.ext + apply Equiv.ext + intro p + change conditionalPerm Uᶜ g p = + conditionalPerm (wholePolygon a) g ((conditionalPerm U g).symm p) + obtain ⟨i,p⟩ := p + by_cases hp : p ∈ U.val <;> simp_all [conditionalPerm,wholePolygon] + +def ConditionalAvailable {a m : ℕ} {E : Type*} [Group E] + (φ : E →* Equiv.Perm (Fin m)) (H : Subgroup (polygonFullGroup a m)) + (U : polygonAlgebra a) : Prop := ∀ g, conditionalHom U (φ g) ∈ H + +theorem conditionalAvailable_inter {a m : ℕ} {E : Type*} [Group E] [Group.IsPerfect E] + (φ : E →* Equiv.Perm (Fin m)) (H : Subgroup (polygonFullGroup a m)) + {U V : polygonAlgebra a} (hU : ConditionalAvailable φ H U) + (hV : ConditionalAvailable φ H V) : ConditionalAvailable φ H (U ⊓ V) := by + let K := H.comap ((conditionalHom (U ⊓ V)).comp φ) + have hK : commutator E ≤ K := by + rw [commutator_def] + apply Subgroup.commutator_le.mpr + intro x _ y _ + change conditionalHom (U ⊓ V) (φ ⁅x,y⁆) ∈ H + rw [map_commutatorElement,conditional_inter_commutator] + exact Subgroup.commutator_le_self H (Subgroup.commutator_mem_commutator (hU x) (hV y)) + intro x + exact hK (Group.IsPerfect.commutator_eq_top (G := E) ▸ Subgroup.mem_top x) + +theorem conditionalAvailable_compl {a m : ℕ} {E : Type*} [Group E] + (φ : E →* Equiv.Perm (Fin m)) (H : Subgroup (polygonFullGroup a m)) + (hwhole : ConditionalAvailable φ H (wholePolygon a)) + {U : polygonAlgebra a} (hU : ConditionalAvailable φ H U) : + ConditionalAvailable φ H Uᶜ := by + intro x + rw [conditional_complement] + exact H.mul_mem (hwhole x) (H.inv_mem (hU x)) + +theorem conditionalAvailable_union {a m : ℕ} {E : Type*} [Group E] [Group.IsPerfect E] + (φ : E →* Equiv.Perm (Fin m)) (H : Subgroup (polygonFullGroup a m)) + (hwhole : ConditionalAvailable φ H (wholePolygon a)) + {U V : polygonAlgebra a} (hU : ConditionalAvailable φ H U) + (hV : ConditionalAvailable φ H V) : ConditionalAvailable φ H (U ⊔ V) := by + have hh := conditionalAvailable_compl φ H hwhole + (conditionalAvailable_inter φ H (conditionalAvailable_compl φ H hwhole hU) + (conditionalAvailable_compl φ H hwhole hV)) + simpa only [compl_inf,compl_compl] using hh + +noncomputable def conditionalBoolean {a m : ℕ} {E : Type*} [Group E] [Group.IsPerfect E] + (φ : E →* Equiv.Perm (Fin m)) (H : Subgroup (polygonFullGroup a m)) + (hwhole : ConditionalAvailable φ H (wholePolygon a)) : + BooleanSubalgebra (Set (GenericSquare a)) where + carrier := {U | ∃ hU : U ∈ polygonAlgebra a, ConditionalAvailable φ H ⟨U,hU⟩} + infClosed' := by + rintro U ⟨hU,hU'⟩ V ⟨hV,hV'⟩ + exact ⟨BooleanSubalgebra.inf_mem hU hV,conditionalAvailable_inter φ H hU' hV'⟩ + supClosed' := by + rintro U ⟨hU,hU'⟩ V ⟨hV,hV'⟩ + exact ⟨BooleanSubalgebra.sup_mem hU hV,conditionalAvailable_union φ H hwhole hU' hV'⟩ + compl_mem' := by + rintro U ⟨hU,hU'⟩ + exact ⟨BooleanSubalgebra.compl_mem hU,conditionalAvailable_compl φ H hwhole hU'⟩ + bot_mem' := by + refine ⟨BooleanSubalgebra.bot_mem,?_⟩ + intro x + have he : conditionalHom (⟨∅,BooleanSubalgebra.bot_mem⟩ : polygonAlgebra a) (φ x) = 1 := by + apply Subtype.ext + apply Equiv.ext + intro p + simp [conditionalHom,conditionalPerm] + change conditionalHom (⟨∅,BooleanSubalgebra.bot_mem⟩ : polygonAlgebra a) (φ x) ∈ H + rw [he] + exact H.one_mem + +noncomputable def trackTranslationAddHom (a m : ℕ) : + (Fin m → CutRing × CutRing) →+ Additive (polygonFullGroup a m) where + toFun d := Additive.ofMul (trackTranslation d) + map_zero' := trackTranslation_zero + map_add' := trackTranslation_add + +theorem trackTranslation_zsmul {a m : ℕ} (n : ℤ) (d : Fin m → CutRing × CutRing) : + trackTranslation (a := a) (n • d) = (trackTranslation d)^n := + (trackTranslationAddHom a m).map_zsmul n d + +theorem trackTranslation_reduce {a m : ℕ} (d : Fin m → CutRing × CutRing) : + trackTranslation (a := a) d = trackTranslation + (fun i => (((d i).1.im : CutRing)*cutTau,((d i).2.im : CutRing)*cutTau)) := by + apply Subtype.ext + apply Equiv.ext + intro p + change (p.1,translation a (d p.1) p.2) = _ + rw [translation_reduce] + rfl + +noncomputable def sourceGenerated (a : ℕ) (r : CutRing) (m : ℕ) : + Subgroup (polygonFullGroup a (m+1)) := Subgroup.closure (Set.range (sourceGenerator a r m)) + +theorem sourceGenerator_mem_generated (a : ℕ) (r : CutRing) (m : ℕ) + (s : SourceGeneratorLabel m) : sourceGenerator a r m s ∈ sourceGenerated a r m := + Subgroup.subset_closure ⟨s,rfl⟩ + +theorem sourceGenerated_le_alternating (a : ℕ) (r : CutRing) (m : ℕ) (hm : 2 ≤ m) : + sourceGenerated a r m ≤ polygonAlternatingGroup a (m+1) := by + apply (Subgroup.closure_le _).mpr + rintro _ ⟨s,rfl⟩ + exact sourceGenerator_mem a r m hm s + +theorem balanced_translation_generated (a : ℕ) (r : CutRing) (m : ℕ) + (i : Fin (m+1)) (v : CutRing × CutRing) : + trackTranslation (a := a) (Pi.single i v - Pi.single (Fin.last m) v) ∈ sourceGenerated a r m := by + classical + refine Fin.lastCases ?_ (fun i => ?_) i + · simp + let dx : Fin (m+1) → CutRing × CutRing := Pi.single i.castSucc (cutTau,0) - Pi.single (Fin.last m) (cutTau,0) + let dy : Fin (m+1) → CutRing × CutRing := Pi.single i.castSucc (0,cutTau) - Pi.single (Fin.last m) (0,cutTau) + have hx : trackTranslation (a := a) dx ∈ sourceGenerated a r m := + sourceGenerator_mem_generated a r m (Sum.inr (i,0)) + have hy : trackTranslation (a := a) dy ∈ sourceGenerated a r m := by + simpa only [sourceGenerator,show (1 : Fin 2) ≠ 0 by decide,ite_false] + using sourceGenerator_mem_generated a r m (Sum.inr (i,1)) + have he : trackTranslation (a := a) (Pi.single i.castSucc v - Pi.single (Fin.last m) v) = + trackTranslation (v.1.im • dx + v.2.im • dy) := by + let d : Fin (m+1) → CutRing × CutRing := Pi.single i.castSucc v - Pi.single (Fin.last m) v + change trackTranslation d = _ + rw [trackTranslation_reduce d] + congr 1 + funext k + by_cases hki : k = i.castSucc <;> by_cases hkl : k = Fin.last m <;> + apply Prod.ext <;> simp [d,dx,dy,hki,hkl,zsmul_eq_mul] + rw [he,trackTranslation_add,trackTranslation_zsmul,trackTranslation_zsmul] + exact (sourceGenerated a r m).mul_mem ((sourceGenerated a r m).zpow_mem hx _) + ((sourceGenerated a r m).zpow_mem hy _) + +theorem balanced_difference_generated (a : ℕ) (r : CutRing) (m : ℕ) + (i j : Fin (m+1)) (v : CutRing × CutRing) : + trackTranslation (a := a) (Pi.single j v - Pi.single i v) ∈ sourceGenerated a r m := by + have he : (Pi.single j v - Pi.single i v : Fin (m+1) → CutRing × CutRing) = + (Pi.single j v - Pi.single (Fin.last m) v) - + (Pi.single i v - Pi.single (Fin.last m) v) := by abel + rw [he,trackTranslation_sub] + exact (sourceGenerated a r m).mul_mem (balanced_translation_generated a r m j v) + ((sourceGenerated a r m).inv_mem (balanced_translation_generated a r m i v)) + +end ConditionalBooleanGeneration + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/ConditionalFamilyLaws.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/ConditionalFamilyLaws.lean new file mode 100644 index 0000000000000000000000000000000000000000..b0852d396427a1b416ab8ba044d4e37ec7999150 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/ConditionalFamilyLaws.lean @@ -0,0 +1,178 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.AssignmentGeneration +import OAI.GroupTheory.SimpleAmenable.CentralCovers.AlphabetAlignedGeneration + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section ConditionalFamilyLaws + +variable {ι E H Ω : Type*} [Group E] [Group H] + +noncomputable def copyFamilyEval (F : ι → E →* H) : FreeGroup (ι × E) →* H := + FreeGroup.lift (fun p => F p.1 p.2) + +@[simp] theorem copyFamilyEval_of (F : ι → E →* H) (i : ι) (x : E) : + copyFamilyEval F (FreeGroup.of (i,x)) = F i x := FreeGroup.lift_apply_of + +theorem copyFamilyEval_range (F : ι → E →* H) : + (copyFamilyEval F).range = ⨆ i, (F i).range := by + rw [copyFamilyEval,FreeGroup.range_lift_eq_closure] + apply le_antisymm + · apply (Subgroup.closure_le _).mpr + rintro _ ⟨⟨i,x⟩,rfl⟩ + exact (le_iSup (fun i => (F i).range) i) ⟨x,rfl⟩ + · apply iSup_le + intro i x hx + obtain ⟨x,rfl⟩ := hx + exact Subgroup.subset_closure ⟨(i,x),rfl⟩ + +theorem copyFamilyEval_perfect [Group.IsPerfect E] (F : ι → E →* H) : + Group.IsPerfect (copyFamilyEval F).range := by + rw [copyFamilyEval_range] + let (i : ι) : Group.IsPerfect (F i).range := Group.IsPerfect.range (F i) + exact perfect_iSup (fun i => (F i).range) + +noncomputable def maskFamily (U : ι → Set Ω) : Option ι → E →* (Ω → E) + | none => sectorMask Set.univ + | some i => sectorMask (U i) + +noncomputable def assignmentEval (U : ι → Set Ω) : + FreeGroup (Option ι × E) →* (Ω → E) := copyFamilyEval (maskFamily U) + +theorem assignmentEval_surjective [Group.IsPerfect E] [Finite ι] [Finite Ω] + (U : ι → Set Ω) (hsep : ∀ ω ν, (∀ i, ω ∈ U i ↔ ν ∈ U i) → ω = ν) : + Function.Surjective (assignmentEval (E := E) U) := by + apply MonoidHom.range_eq_top.mp + apply assignment_group_generated U hsep + · intro s + exact ⟨FreeGroup.of (none,s),copyFamilyEval_of _ _ _⟩ + · intro i s + exact ⟨FreeGroup.of (some i,s),copyFamilyEval_of _ _ _⟩ + +def CopyFamilyLaw (U : ι → Set Ω) (F : Option ι → E →* H) : Prop := + HasCentralLaw (assignmentEval U) (copyFamilyEval F).rangeRestrict + +theorem copyFamilyLaw_iff (U : ι → Set Ω) (F : Option ι → E →* H) : + CopyFamilyLaw U F ↔ ∀ w, assignmentEval U w = 1 → + ∀ i x, Commute (copyFamilyEval F w) (F i x) := by + rw [CopyFamilyLaw,hasCentralLaw_iff] + constructor + · intro h w hw i x + have ht := Subgroup.mem_center_iff.mp (h w hw) + ⟨F i x,⟨FreeGroup.of (i,x),copyFamilyEval_of _ _ _⟩⟩ + exact (show Commute (F i x) (copyFamilyEval F w) from + congrArg Subtype.val ht).symm + · intro h w hw + apply Subgroup.mem_center_iff.mpr + intro x + apply Subtype.ext + have hx : x.val ∈ Subgroup.centralizer {copyFamilyEval F w} := by + have hc : (copyFamilyEval F).range ≤ Subgroup.centralizer {copyFamilyEval F w} := by + rw [copyFamilyEval_range] + apply iSup_le + rintro i y ⟨s,rfl⟩ + exact Subgroup.mem_centralizer_singleton_iff.mpr (h w hw i s).symm.eq + exact hc x.property + exact Subgroup.mem_centralizer_singleton_iff.mp hx + +theorem copyFamilyLaw_of_table (U : ι → Set Ω) (F : Option ι → E →* H) + (ρ : (Ω → E) →* H) (hρ : ∀ i, ρ.comp (maskFamily U i) = F i) : + CopyFamilyLaw U F := by + have he : ρ.comp (assignmentEval U) = copyFamilyEval F := by + apply FreeGroup.ext_hom + rintro ⟨i,s⟩ + simpa only [MonoidHom.comp_apply,assignmentEval,copyFamilyEval_of] using + DFunLike.congr_fun (hρ i) s + rw [copyFamilyLaw_iff] + intro w hw i s + have hf : copyFamilyEval F w = 1 := by + rw [← DFunLike.congr_fun he w,MonoidHom.comp_apply,hw,map_one] + rw [hf] + exact Commute.one_left _ + +end ConditionalFamilyLaws + +section ActualFamilyLaws + +variable {ι E H Q : Type*} [Group E] [Group H] [Group Q] + +def CentralOn (q : H →* Q) (S : Subgroup H) : Prop := + (q.comp S.subtype).ker ≤ Subgroup.center S + +theorem centralOn_iff (q : H →* Q) (S : Subgroup H) : + CentralOn q S ↔ ∀ x ∈ S, q x = 1 → ∀ y ∈ S, Commute x y := by + constructor + · intro h x hx hqx y hy + exact (show Commute y x from congrArg Subtype.val + (Subgroup.mem_center_iff.mp (h (show ⟨x,hx⟩ ∈ (q.comp S.subtype).ker from hqx)) + ⟨y,hy⟩)).symm + · intro h x hx + apply Subgroup.mem_center_iff.mpr + intro y + exact Subtype.ext (h x.val x.property hx y.val y.property).symm.eq + +theorem CentralOn.mono {q : H →* Q} {S T : Subgroup H} + (h : CentralOn q T) (hst : S ≤ T) : CentralOn q S := by + rw [centralOn_iff] at h ⊢ + intro x hx hqx y hy + exact h x (hst hx) hqx y (hst hy) + +theorem centralOn_of_table (q : H →* Q) {T : Type*} [Group T] + (ρ : T →* H) (hρ : Function.Injective (q.comp ρ)) : CentralOn q ρ.range := by + rw [centralOn_iff] + rintro x ⟨t,rfl⟩ hx y hy + have ht : t = 1 := hρ (hx.trans (map_one (q.comp ρ)).symm) + rw [ht,map_one] + exact Commute.one_left y + +theorem copyFamilyLaw_iff_centralOn {Ω : Type*} (U : ι → Set Ω) + (F : Option ι → E →* H) (q : H →* Q) (v : (Ω → E) →* Q) + (hv : Function.Injective v) + (hcompat : ∀ i, q.comp (F i) = v.comp (maskFamily U i)) : + CopyFamilyLaw U F ↔ CentralOn q (copyFamilyEval F).range := by + have he : q.comp (copyFamilyEval F) = v.comp (assignmentEval U) := by + apply FreeGroup.ext_hom + rintro ⟨i,s⟩ + simpa only [MonoidHom.comp_apply,assignmentEval,copyFamilyEval_of] using + DFunLike.congr_fun (hcompat i) s + have hk (w : FreeGroup (Option ι × E)) : + q (copyFamilyEval F w) = 1 ↔ assignmentEval U w = 1 := by + have hw := DFunLike.congr_fun he w + change q (copyFamilyEval F w) = v (assignmentEval U w) at hw + rw [hw,← map_one v] + exact hv.eq_iff + rw [CopyFamilyLaw,hasCentralLaw_iff] + constructor + · intro h x hx + obtain ⟨w,hw⟩ := x.property + have hx' : q (copyFamilyEval F w) = 1 := by + change q x.val = 1 at hx + simpa only [hw] using hx + have ht := h w ((hk w).mp hx') + have heq : (copyFamilyEval F).rangeRestrict w = x := Subtype.ext hw + rwa [heq] at ht + · intro h w hw + exact h ((hk w).mpr hw) + +theorem centralOn_conjugate (q : H →* Q) (S : Subgroup H) (z : H) + (h : CentralOn q S) : CentralOn q (S.map (MulAut.conj z).toMonoidHom) := by + rw [centralOn_iff] at h ⊢ + rintro x ⟨x,hx,rfl⟩ hqx y ⟨y,hy,rfl⟩ + have hqx' : q x = 1 := by + have he : MulAut.conj (q z) (q x) = 1 := by simpa using hqx + exact (MulAut.conj (q z)).injective (he.trans (map_one _).symm) + exact (h x hx hqx' y hy).map (MulAut.conj z).toMonoidHom + +end ActualFamilyLaws + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/ConstantCellTemplates.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/ConstantCellTemplates.lean new file mode 100644 index 0000000000000000000000000000000000000000..ffd28a824dbbffbe8e263ab6c7b122a81d6b8e29 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/ConstantCellTemplates.lean @@ -0,0 +1,199 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.GlobalTangentChain +import OAI.GroupTheory.SimpleAmenable.CentralCovers.CrossingCellActions + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section ConstantCellTemplates +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) {J : Type*} {κ : Type} [Finite κ] + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + +theorem constant_cell_template (hlarge : 20 ≤ m+1) + (F : Option (Fin 2) → TrackStar (Fin (m+1)) →* + BoundedRelationCover M (alternatingGenerator a r m hm)) + (f : J → TrackStar (Fin (m+1)) →* + BoundedRelationCover M (alternatingGenerator a r m hm)) + (P : Fin 2 → κ → Fin 5 × (CutRing × CutRing)) + (h : ∀ i I, I.card ≤ 15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb (P i)) + (U : Fin 2 → polygonAlgebra a) (W : polygonAlgebra a) + (hF : ∀ i, F (some i)=B.fullGeometricSector (by omega) (P i) (h i) (U i)) + (hU : ∀ i, ResolvedBy (fun j => (primitiveTests (a := a) (r := r) (P i) j).val) (U i).val) + (hW : ∀ i, ResolvedBy (fun j => (primitiveTests (a := a) (r := r) (P i) j).val) W.val) + (hf : ∀ j, B.AlignedSmallSupported (f j)) + (hc : ∀ i j, SmallControlled B.c (f j) (B.fullGeometricSector (by omega) (P i) (h i) W)) + (i i' : Fin 2) (hne : i≠i') (positive : Bool) + (he : U i ⊓ W=if positive then W else ⊥) : + Nonempty (B.LocalPatchTemplate (by omega) F f) := by + classical + let V : polygonAlgebra a := if positive then wholePolygon a else ⊥ + let R : Fin 2 → polygonAlgebra a := fun j => if j=i then V else U i' + refine ⟨{ index := κ + tests := P i' + lawful := h i' + margin := W + predicates := R + margin_resolved := hW i' + predicates_resolved := ?_ + controlled := hc i' + action := ?_ }⟩ + · intro j + by_cases hj : j=i + · simp only [R,hj,↓reduceIte] + cases positive <;> exact fun _ _ _ => Iff.rfl + · simpa only [R,hj,↓reduceIte] using hU i' + · intro j I s l x hx + let I' : ControlAlphabet (Fin (m+1)) := ⟨I.val,by rw [I.property.2]; omega⟩ + by_cases hj : j=i + · subst j + rw [hF] + have hh := B.cell_constant_action hlarge (P i) (h i) (U i) W (hU i) (hW i) + positive he (f l) (hf l) (hc i l) I' s x hx + have hπ := DFunLike.congr_fun (universalMap_spec (subtypeAlternatingHom I.val)) s + simp only [MonoidHom.comp_apply] at hπ + cases positive <;> + simpa only [R,V,Bool.false_eq_true,↓reduceIte,B.fullGeometricSector_whole,B.fullGeometricSector_bot, + MonoidHom.comp_apply,MonoidHom.one_apply,hπ] using hh + · have hj' : j=i' := by + fin_cases i <;> fin_cases i' <;> fin_cases j <;> simp_all + subst j + simp only [R,Ne.symm hne,↓reduceIte,hF] + +end InitialCoverSystem +end ConstantCellTemplates + +section SlopeCoordinateCellTemplate +namespace InitialCoverSystem.PatchAtlas +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + {B : InitialCoverSystem a r m hm M} + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + (A : B.PatchAtlas) + +theorem slope_coordinate_cell_template {κ : Type} [Finite κ] {J : Type*} + (hlarge : 20 ≤ m+1) (hr : 0 (InitialCoverSystem.primitiveTests (a := a) (r := r) (P i) s).val) + (windowRectangle a A.geometry.mesh q cell).val) + (hcoherent : ∀ i, B.fullGeometricSector (by omega) (P i) (h i) + (windowRectangle a A.geometry.mesh q cell)=B.windowSector (by omega) A.geometry.mesh + (A.rectangles.rectangles A.geometry.mesh) q (windowRectangle a A.geometry.mesh q cell)) + (hf : ∀ l, B.AlignedSmallSupported (f l)) + (hcontrol : ∀ l, SmallControlled B.c (f l) (B.windowSector (by omega) A.geometry.mesh + (A.rectangles.rectangles A.geometry.mesh) q (windowRectangle a A.geometry.mesh q cell))) : + Nonempty (B.LocalPatchTemplate (by omega) F f) := by + let U : Fin 2 → polygonAlgebra a := + ![clippedSlopePrimitive a r (slopeDirection d),spatialTranslate v (coordinatePrimitive a j)] + have hU : ∀ i, ResolvedBy (fun s => (InitialCoverSystem.primitiveTests (a := a) (r := r) (P i) s).val) (U i).val := by + intro i x y hxy + fin_cases i + · change x ∈ (clippedSlopePrimitive a r (slopeDirection d)).val ↔ + y ∈ (clippedSlopePrimitive a r (slopeDirection d)).val + have hh := hxy i₀ + change x ∈ (spatialTranslate (P 0 i₀).2 (initialTest a r (P 0 i₀).1)).val ↔ + y ∈ (spatialTranslate (P 0 i₀).2 (initialTest a r (P 0 i₀).1)).val at hh + simpa only [hP,initialTest_slope,spatialTranslate_zero] using hh + · change x ∈ (spatialTranslate v (coordinatePrimitive a j)).val ↔ + y ∈ (spatialTranslate v (coordinatePrimitive a j)).val + have hh := hxy i₁ + change x ∈ (spatialTranslate (P 1 i₁).2 (initialTest a r (P 1 i₁).1)).val ↔ + y ∈ (spatialTranslate (P 1 i₁).2 (initialTest a r (P 1 i₁).1)).val at hh + simpa only [hQ,initialTest_coordinate] using hh + have hctrl : ∀ i l, SmallControlled B.c (f l) (B.fullGeometricSector (by omega) (P i) (h i) + (windowRectangle a A.geometry.mesh q cell)) := by + intro i l + rw [hcoherent i] + exact hcontrol l + obtain ⟨b,hb'⟩ | ⟨b,hb'⟩ | ⟨k,c,positive,hk,hc,x,y,v',w,hx,hy,hv,hw,hcx,hcy,hdv,hdw⟩ := + varying_cell_classification r hr A.geometry q hb he cell d j v + · exact B.constant_cell_template hlarge F f P h U _ hF hU hW hf hctrl 0 1 (by decide) b hb' + · exact B.constant_cell_template hlarge F f P h U _ hF hU hW hf hctrl 1 0 (by decide) b hb' + · obtain ⟨t,u,hinc,hact⟩ := A.crossing_cell_actions hlarge hr ha (P 0) (P 1) (h 0) (h 1) + i₀ i₁ d j v hP hQ q cell k c positive hk hc x y v' w hx hy hv hw hcx hcy hdv hdw + let R : Fin 2 → polygonAlgebra a := ![ + spatialTranslate (u+A.geometry.anchors t (slopeDirection d)) (clippedSlopePrimitive a r (slopeDirection d)), + if positive then spatialTranslate (u+A.geometry.anchors t (axisDirection j)) (coordinatePrimitive a j) + else (spatialTranslate (u+A.geometry.anchors t (axisDirection j)) (coordinatePrimitive a j))ᶜ] + have hrMargin : ResolvedBy (fun s => (InitialCoverSystem.primitiveTests (a := a) (r := r) + (A.concurrentPrimitives t u) s).val) (A.margin t u).val := by + intro x y hh + exact translatedTemplate_resolved (Sum.elim + (fun j : Fin 4 => (⟨j.val+1,by omega⟩,A.geometry.anchors t j)) + (coordinateWindowPrimitives A.geometry.window A.geometry.start)) + (coordinateRectangle a (A.geometry.margins t).lower (A.geometry.margins t).upper) + (fun x y hh => A.geometry.margin_resolved t x y (fun i => hh (Sum.inr i))) u x y hh + have hrc : ∀ l, SmallControlled B.c (f l) + (B.fullGeometricSector (by omega) (A.concurrentPrimitives t u) (A.concurrentLaw t u) (A.margin t u)) := by + intro l + apply B.all_rectangle_control_to_template hlarge A.rectangles.rectangles A.geometry.window + A.geometry.start u (A.concurrentPrimitives t u) (A.concurrentLaw t u) Sum.inr (fun _ => rfl) + _ (A.geometry.margin_resolved t) + (translated_rectangle_window A.geometry.start u _ _ + (fun j => (A.geometry.labels t j).1) (fun j => (A.geometry.labels t j).2)) + A.geometry.mesh q _ + (windowRectangle_resolved A.geometry.mesh (by have hh := A.geometry.mesh_large; omega) q cell) + hinc (f l) (hf l) (hcontrol l) + refine ⟨{ index := Sum (Fin 4) (Fin 2 × Fin (A.geometry.window-1)) + tests := A.concurrentPrimitives t u + lawful := A.concurrentLaw t u + margin := A.margin t u + predicates := R + margin_resolved := hrMargin + predicates_resolved := ?_ + controlled := hrc + action := ?_ }⟩ + · intro l x y hh + fin_cases l + · change x ∈ (spatialTranslate (u+A.geometry.anchors t (slopeDirection d)) + (clippedSlopePrimitive a r (slopeDirection d))).val ↔ + y ∈ (spatialTranslate (u+A.geometry.anchors t (slopeDirection d)) + (clippedSlopePrimitive a r (slopeDirection d))).val + have hs := hh (Sum.inl (slopeDirection d)) + change x ∈ (spatialTranslate (u+A.geometry.anchors t (slopeDirection d)) + (initialTest a r (slopeTestIndex d))).val ↔ + y ∈ (spatialTranslate (u+A.geometry.anchors t (slopeDirection d)) + (initialTest a r (slopeTestIndex d))).val at hs + simpa only [initialTest_slope] using hs + · have hs := hh (Sum.inl (axisDirection j)) + change x ∈ (spatialTranslate (u+A.geometry.anchors t (axisDirection j)) + (initialTest a r (coordinateTestIndex j))).val ↔ + y ∈ (spatialTranslate (u+A.geometry.anchors t (axisDirection j)) + (initialTest a r (coordinateTestIndex j))).val at hs + rw [initialTest_coordinate] at hs + cases positive <;> change _ ↔ _ + · exact not_congr hs + · exact hs + · intro l I s l' x hx' + let I' : ControlAlphabet (Fin (m+1)) := ⟨I.val,by rw [I.property.2]; omega⟩ + have hh := hact (f l') (hf l') (hcontrol l') I' s x hx' + rw [hF] + fin_cases l + · exact hh.1 + · exact hh.2 + +end InitialCoverSystem.PatchAtlas +end SlopeCoordinateCellTemplate + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/ControlCalculus.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/ControlCalculus.lean new file mode 100644 index 0000000000000000000000000000000000000000..06c16c4961d704e3f66d3e68b529c0fb4920dc0c --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/ControlCalculus.lean @@ -0,0 +1,185 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.UniformPropagationBounds +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.SmallControlTransfer +import OAI.GroupTheory.SimpleAmenable.CentralCovers.FullSector + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section SourceControlCalculus +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + +abbrev AlignedSmallSupported (f : TrackStar (Fin (m+1)) →* + BoundedRelationCover M (alternatingGenerator a r m hm)) : Prop := + SmallSupported (sourceAlignedGroup a r m hm M B.t) f + +theorem control_trans (hlarge : 20 ≤ m+1) + (f g k : TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm)) + (hf : B.AlignedSmallSupported f) (hk : B.AlignedSmallSupported k) + (hfg : SmallControlled B.c f g) (hgk : SmallControlled B.c g k) : + SmallControlled B.c f k := + small_control_trans _ B.c B.constant_aligned B.disjoint_aligned (by simpa using hlarge) + B.constant_small_supported f g k hf hk hfg hgk + +theorem control_chain (hlarge : 20 ≤ m+1) + (f : TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm)) + (F : ℕ → TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm)) + (T : ℕ) (hf : B.AlignedSmallSupported f) + (hF : ∀ i, i ≤ T → B.AlignedSmallSupported (F i)) + (h₀ : SmallControlled B.c f (F 0)) + (hstep : ∀ i, i < T → SmallControlled B.c (F i) (F (i+1))) : + SmallControlled B.c f (F T) := by + have hh : ∀ i, i ≤ T → SmallControlled B.c f (F i) := by + intro i + induction i with + | zero => intro _; exact h₀ + | succ i ih => + intro hi + exact B.control_trans hlarge f (F i) (F (i+1)) hf (hF _ (by omega)) + (ih (by omega)) (hstep i (by omega)) + exact hh T le_rfl + +theorem axisSector_supported (hlarge : 15 < m+1) (n : ℕ) (h : B.CoordinateWindowLaw n) + (j : Fin 2) (k : ℕ) (hk : k ≤ n) (p : ℤ) (V : polygonAlgebra a) + (hV : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) + (axisWindowPrimitives j k p) i).val) V.val) : + B.AlignedSmallSupported (B.axisSector hlarge n h j k hk p V) := + B.fullGeometricSector_supported hlarge _ _ V hV + +theorem axisInterval_chain_control (hlarge : 20 ≤ m+1) (n : ℕ) (h : B.CoordinateWindowLaw n) + (j : Fin 2) (k : ℕ) (hk : k ≤ n) (T : ℕ) (w : ℕ → ℤ) (u v : ℕ → CutRing) + (hlabel : ∀ i, (w i ≤ endpointLabel (u i) ∧ endpointLabel (u i) < w i+k) ∧ + (w i ≤ endpointLabel (v i) ∧ endpointLabel (v i) < w i+k)) + (hstep : ∀ i, i < T → |w (i+1)-w i|+(k:ℤ) ≤ n) + (hinc : ∀ i, i < T → coordinateInterval a j (u i) (v i) ≤ + coordinateInterval a j (u (i+1)) (v (i+1))) + (f : TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm)) + (hf : B.AlignedSmallSupported f) + (h₀ : SmallControlled B.c f (B.axisSector (by omega) n h j k hk (w 0) + (coordinateInterval a j (u 0) (v 0)))) : + SmallControlled B.c f (B.axisSector (by omega) n h j k hk (w T) + (coordinateInterval a j (u T) (v T))) := by + apply B.control_chain hlarge f + (fun i => B.axisSector (by omega) n h j k hk (w i) (coordinateInterval a j (u i) (v i))) T hf + · intro i _ + exact B.axisSector_supported (by omega) n h j k hk (w i) _ + (axisInterval_resolved j k (w i) (u i) (v i) (hlabel i).1 (hlabel i).2) + · exact h₀ + · intro i hi + have hh := hstep i hi + have h₁ := le_abs_self (w (i+1)-w i) + have h₂ := neg_le_abs (w (i+1)-w i) + apply B.axisSector_overlap_control (by omega) n h j k k hk hk (w i) (w (i+1)) + (min (w i) (w (i+1))) (min_le_left _ _) ?_ (min_le_right _ _) ?_ _ _ (hinc i hi) + (axisInterval_resolved j k (w i) (u i) (v i) (hlabel i).1 (hlabel i).2) + (axisInterval_resolved j k (w (i+1)) (u (i+1)) (v (i+1)) (hlabel (i+1)).1 (hlabel (i+1)).2) + · omega + · omega + +end InitialCoverSystem +end SourceControlCalculus + +section ActualOldAxisBridge +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + +theorem old_axis_bridge_control (hlarge : 20 ≤ m+1) {K δ : ℝ} (hK : 0 ≤ K) (hδ : 0 < δ) : + ∃ N : ℕ, 160 ≤ N ∧ ∀ n : ℕ, N ≤ n → ∀ h : B.CoordinateWindowLaw n, + ∀ (j : Fin 2) (s : ℕ) (hs : s ≤ n) (p q : ℤ), + ((q-p).natAbs:ℝ) ≤ (K+1)*(n:ℝ) → + ∀ u v U V : CutRing, ordinary u ≤ ordinary v → + ordinary U ≤ ordinary u-δ → ordinary v+δ ≤ ordinary V → + ordinary V-ordinary U < 1 → + (p ≤ endpointLabel u ∧ endpointLabel u < p+s) → + (p ≤ endpointLabel v ∧ endpointLabel v < p+s) → + (q ≤ endpointLabel U ∧ endpointLabel U < q+(n/8:ℕ)) → + (q ≤ endpointLabel V ∧ endpointLabel V < q+(n/8:ℕ)) → + ∀ f : TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm), + B.AlignedSmallSupported f → + SmallControlled B.c f (B.axisSector (by omega) n h j s hs p (coordinateInterval a j u v)) → + SmallControlled B.c f (B.axisSector (by omega) n h j (n/8) (Nat.div_le_self n 8) q + (coordinateInterval a j U V)) := by + obtain ⟨N,hN,hgeo⟩ := old_window_bridge_geometry hK hδ 0 + refine ⟨N,hN,?_⟩ + intro n hn h j s hs p q hpq u v U V huv hU hV hlen hlu hlv hlU hlV f hf hstart + obtain ⟨T,w,u',v',hw₀,hwT,_,hlabel,hstep,hinc,hnest,herror⟩ := + hgeo n hn p q hpq (ordinary u) (ordinary v) huv + have horder (i : ℕ) : ordinary (u' i) ≤ ordinary (v' i) := by + have hh := hinc i (show ordinary u ∈ Set.Icc (ordinary u) (ordinary v) from ⟨le_rfl,huv⟩) + exact hh.1.le.trans hh.2.le + have hbounds (i : ℕ) (hi : i ≤ T) : + ordinary U ≤ ordinary (u' i) ∧ ordinary (v' i) ≤ ordinary V := by + have h₁ := herror i hi (show ordinary (u' i) ∈ Set.Icc (ordinary (u' i)) (ordinary (v' i)) + from ⟨le_rfl,horder i⟩) + have h₂ := herror i hi (show ordinary (v' i) ∈ Set.Icc (ordinary (u' i)) (ordinary (v' i)) + from ⟨horder i,le_rfl⟩) + exact ⟨hU.trans h₁.1.le,h₂.2.le.trans hV⟩ + have hlength (i : ℕ) (hi : i ≤ T) : ordinary (v' i)-ordinary (u' i) < 1 := by + obtain ⟨h₁,h₂⟩ := hbounds i hi + linarith + have hlabels₀ : (p ≤ endpointLabel (u' 0) ∧ endpointLabel (u' 0) < p+(n/8:ℕ)) ∧ + (p ≤ endpointLabel (v' 0) ∧ endpointLabel (v' 0) < p+(n/8:ℕ)) := by + simpa only [hw₀] using hlabel 0 + have hfirstinc : coordinateInterval a j u v ≤ coordinateInterval a j (u' 0) (v' 0) := by + apply coordinateInterval_mono j u v (u' 0) (v' 0) + · exact (hinc 0 (show ordinary u ∈ Set.Icc (ordinary u) (ordinary v) from ⟨le_rfl,huv⟩)).1.le + · exact huv + · exact (hinc 0 (show ordinary v ∈ Set.Icc (ordinary u) (ordinary v) from ⟨huv,le_rfl⟩)).2.le + · exact hlength 0 (Nat.zero_le _) + have hfirst := B.axisSector_overlap_control (by omega : 15 < m+1) n h j s (n/8) hs + (Nat.div_le_self n 8) p p p le_rfl (by omega) le_rfl + (by omega) + (coordinateInterval a j u v) (coordinateInterval a j (u' 0) (v' 0)) hfirstinc + (axisInterval_resolved j s p u v hlu hlv) + (axisInterval_resolved j (n/8) p (u' 0) (v' 0) hlabels₀.1 hlabels₀.2) + have hF₀ := B.axisSector_supported (by omega : 15 < m+1) n h j (n/8) + (Nat.div_le_self n 8) p (coordinateInterval a j (u' 0) (v' 0)) + (axisInterval_resolved j (n/8) p (u' 0) (v' 0) hlabels₀.1 hlabels₀.2) + have h₀ := B.control_trans hlarge f _ _ hf hF₀ hstart hfirst + have hchain : SmallControlled B.c f (B.axisSector (by omega) n h j (n/8) + (Nat.div_le_self n 8) (w T) (coordinateInterval a j (u' T) (v' T))) := by + refine B.axisInterval_chain_control hlarge n h j (n/8) (Nat.div_le_self n 8) T w u' v' + hlabel ?_ ?_ f hf ?_ + · intro i _ + have hh := hstep i + simp only [mul_zero,Nat.cast_zero,add_zero] at hh + exact hh.le + · intro i hi + apply coordinateInterval_mono j (u' i) (v' i) (u' (i+1)) (v' (i+1)) + · exact (hnest i (show ordinary (u' i) ∈ Set.Icc (ordinary (u' i)) (ordinary (v' i)) + from ⟨le_rfl,horder i⟩)).1.le + · exact horder i + · exact (hnest i (show ordinary (v' i) ∈ Set.Icc (ordinary (u' i)) (ordinary (v' i)) + from ⟨horder i,le_rfl⟩)).2.le + · exact hlength (i+1) (by omega) + · simpa only [hw₀] using h₀ + rw [hwT] at hchain + have hlastinc : coordinateInterval a j (u' T) (v' T) ≤ coordinateInterval a j U V := + coordinateInterval_mono j (u' T) (v' T) U V (hbounds T le_rfl).1 (horder T) + (hbounds T le_rfl).2 hlen + have hlast : SmallControlled B.c + (B.axisSector (by omega) n h j (n/8) (Nat.div_le_self n 8) q (coordinateInterval a j (u' T) (v' T))) + (B.axisSector (by omega) n h j (n/8) (Nat.div_le_self n 8) q (coordinateInterval a j U V)) := + B.fullGeometricSector_small_control (by omega) _ _ _ _ hlastinc + exact B.control_trans hlarge f _ _ hf + (B.axisSector_supported (by omega) n h j (n/8) (Nat.div_le_self n 8) q _ + (axisInterval_resolved j (n/8) q U V hlU hlV)) hchain hlast + +end InitialCoverSystem +end ActualOldAxisBridge + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/CoordinateFamilyCompare.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/CoordinateFamilyCompare.lean new file mode 100644 index 0000000000000000000000000000000000000000..c97dce4388f1b80d284223d227250c153e7c15ab --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/CoordinateFamilyCompare.lean @@ -0,0 +1,107 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.SectorOffsetCoherence + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section CoordinateFamilyCompare + +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) {ι κ : Type*} [Finite ι] [Finite κ] + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + +theorem fullGeometricSector_compare (hlarge : 15 < m+1) + (P : ι → Fin 5 × (CutRing × CutRing)) (Q : κ → Fin 5 × (CutRing × CutRing)) + (v : κ → ι) + (hj : ∀ i, (P (v i)).1 = (Q i).1) + (hp : ∀ i, spatialTranslate (P (v i)).2 (initialTest a r (P (v i)).1) = + spatialTranslate (Q i).2 (initialTest a r (Q i).1)) + (h : ∀ I, I.card ≤ 15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb P) + (g : ∀ I, I.card ≤ 15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb Q) + (V : polygonAlgebra a) + (hV : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) Q i).val) V.val) : + B.fullGeometricSector hlarge Q g V = B.fullGeometricSector hlarge P h V := by + let R := P ∘ v + have hR : ∀ I, I.card ≤ 15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb R := + fun I hI b hb => PrimitiveFamilyLaw.reindex B I b hb P (h I hI b hb) v + have hVR : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) R i).val) V.val := by + intro x y he + apply hV x y + intro i + have hh := he i + change x ∈ (spatialTranslate (P (v i)).2 (initialTest a r (P (v i)).1)).val ↔ + y ∈ (spatialTranslate (P (v i)).2 (initialTest a r (P (v i)).1)).val at hh + rw [hp i] at hh + exact hh + rw [← B.fullGeometricSector_congr_offsets hlarge R Q hj hp hR g V hVR] + exact B.fullGeometricSector_subfamily hlarge P R v rfl h hR V hVR + +omit [Finite ι] [Finite κ] [Group.IsPerfect (alternatingGroup (Fin (m+1)))] in + +theorem coordinateFamily_window_reindex (n : ℕ) (q : Fin 2 → ℤ) + (j : ι → Fin 2) (u : ι → CutRing × CutRing) + (hs : ∀ i, q (j i) ≤ endpointLabel (if j i = 0 then (u i).1 else (u i).2)) + (he : ∀ i, endpointLabel (if j i = 0 then (u i).1 else (u i).2) < q (j i)+(n-1:ℕ)) : + ∃ v : ι → Fin 2 × Fin (n-1), + (∀ i, (coordinateWindowPrimitives n q (v i)).1 = coordinateTestIndex (j i)) ∧ + ∀ i, spatialTranslate (coordinateWindowPrimitives n q (v i)).2 + (initialTest a r (coordinateWindowPrimitives n q (v i)).1) = + spatialTranslate (u i) (initialTest a r (coordinateTestIndex (j i))) := by + let k (i : ι) := (endpointLabel (if j i = 0 then (u i).1 else (u i).2)-q (j i)).toNat + have hk (i : ι) : (k i:ℤ) = endpointLabel (if j i = 0 then (u i).1 else (u i).2)-q (j i) := + Int.toNat_of_nonneg (by have hh := hs i; omega) + have hk' (i : ι) : k i < n-1 := by have hh := he i; have hh' := hk i; omega + refine ⟨fun i => (j i,⟨k i,hk' i⟩),fun _ => rfl,?_⟩ + intro i + simp only [coordinateWindowPrimitives,initialTest_coordinate] + apply coordinatePrimitive_translate_label_eq + have hz : endpointLabel (((q (j i)+(k i:ℤ)):CutRing)*cutTau) = + endpointLabel (if j i = 0 then (u i).1 else (u i).2) := by + simp [endpointLabel,cutTau] + have hh := hk i + change (k i:ℤ) = (if j i = 0 then (u i).1 else (u i).2).im-q (j i) at hh + omega + by_cases hji : j i = 0 <;> simpa [coordinateShift,hji] using hz + +omit [Finite ι] [Finite κ] [Group.IsPerfect (alternatingGroup (Fin (m+1)))] in +theorem coordinateFamilyLaw_of_window (n : ℕ) (h : B.CoordinateWindowLaw n) + (q : Fin 2 → ℤ) (j : ι → Fin 2) (u : ι → CutRing × CutRing) + (hs : ∀ i, q (j i) ≤ endpointLabel (if j i = 0 then (u i).1 else (u i).2)) + (he : ∀ i, endpointLabel (if j i = 0 then (u i).1 else (u i).2) < q (j i)+(n-1:ℕ)) + (I : Finset (Fin (m+1))) (b : Fin (m+1)) (hb : b ∉ I) : + B.PrimitiveFamilyLaw I b hb (fun i => (coordinateTestIndex (j i),u i)) := by + obtain ⟨v,hj,hp⟩ := coordinateFamily_window_reindex (a := a) (r := r) n q j u hs he + exact PrimitiveFamilyLaw.congr_offsets B I b hb + (coordinateWindowPrimitives n q ∘ v) _ hj hp + (PrimitiveFamilyLaw.reindex B I b hb _ (h I b hb q) v) + +omit [Finite κ] in +theorem coordinateFamilySector_eq_window (hlarge : 15 < m+1) + (n : ℕ) (h : B.CoordinateWindowLaw n) (q : Fin 2 → ℤ) + (j : ι → Fin 2) (u : ι → CutRing × CutRing) + (hs : ∀ i, q (j i) ≤ endpointLabel (if j i = 0 then (u i).1 else (u i).2)) + (he : ∀ i, endpointLabel (if j i = 0 then (u i).1 else (u i).2) < q (j i)+(n-1:ℕ)) + (g : ∀ I, I.card ≤ 15 → ∀ b hb, + B.PrimitiveFamilyLaw I b hb (fun i => (coordinateTestIndex (j i),u i))) + (V : polygonAlgebra a) + (hV : ResolvedBy (fun i => (spatialTranslate (u i) (coordinatePrimitive a (j i))).val) V.val) : + B.fullGeometricSector hlarge (fun i => (coordinateTestIndex (j i),u i)) g V = + B.windowSector hlarge n h q V := by + obtain ⟨v,hj,hp⟩ := coordinateFamily_window_reindex (a := a) (r := r) n q j u hs he + apply B.fullGeometricSector_compare hlarge _ _ v hj hp _ g V + simpa only [primitiveTests,primitiveFamilyTests,initialTest_coordinate] using hV + +end InitialCoverSystem +end CoordinateFamilyCompare + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/CoordinateJointLaw.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/CoordinateJointLaw.lean new file mode 100644 index 0000000000000000000000000000000000000000..3217b7cf351b47229e1eafcd7e8d3ca0e84014fb --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/CoordinateJointLaw.lean @@ -0,0 +1,117 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.GrowthAxisUniform +import OAI.GroupTheory.SimpleAmenable.CentralCovers.StarProjection +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.CoordinateProductPatterns + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section CoordinateJointLaw +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + +theorem coordinate_pair_law {n k : ℕ} (hn : 2 ≤ n) + (g : B.CoordinateWindowLaw n) (q : Fin 2 → ℤ) + (haxis : ∀ d p I b hb, B.PrimitiveFamilyLaw I b hb (axisWindowPrimitives d k p)) + (i j : Fin 2 × Fin (k-1)) (I : Finset (Fin (m+1))) (b : Fin (m+1)) (hb : b ∉ I) : + B.PrimitiveFamilyLaw I b hb (primitivePair (coordinateWindowPrimitives k q) i j) := by + classical + by_cases hij : i.1 = j.1 + · have h := PrimitiveFamilyLaw.reindex B I b hb (axisWindowPrimitives i.1 k (q i.1)) + (haxis i.1 (q i.1) I b hb) (fun t : Bool => if t then j.2 else i.2) + convert h using 1 + funext t + cases t <;> simp [primitivePair,axisWindowPrimitives,coordinateWindowPrimitives,hij] + · let p : Fin 2 → ℤ := fun d => if d=i.1 then q i.1+(i.2.val:ℤ) else q j.1+(j.2.val:ℤ) + let v : Bool → Fin 2 × Fin (n-1) := fun t => (if t then j.1 else i.1,⟨0,by omega⟩) + have h := PrimitiveFamilyLaw.reindex B I b hb (coordinateWindowPrimitives n p) (g I b hb p) v + convert h using 1 + funext t + cases t <;> simp [primitivePair,coordinateWindowPrimitives,p,v,Ne.symm hij] + +omit B in +theorem coordinateWindowPatterns {k : ℕ} (q : Fin 2 → ℤ) + (σ : Fin 2 × Fin (k-1) → Bool) + (hσ : ∀ d : Fin 2, (fun i => σ (d,i)) ∈ + Set.range (polygonAssignment (primitiveTests (a := a) (r := r) (axisWindowPrimitives d k (q d))))) : + σ ∈ Set.range (polygonAssignment (primitiveTests (a := a) (r := r) (coordinateWindowPrimitives k q))) := by + apply coordinate_patterns_product _ _ σ hσ + intro d i p p' hp + simp only [primitiveTests,primitiveFamilyTests,coordinateWindowPrimitives,initialTest_coordinate] + fin_cases d <;> + simp_all [spatialTranslate,coordinatePrimitive,coordinateShift,halfPlane,cutForm,translate_val,coordinate] + +variable [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + +theorem coordinate_joint_law (h20 : 20 ≤ m+1) {n k : ℕ} (hn : 2 ≤ n) + (g : B.CoordinateWindowLaw n) + (haxis : ∀ d p I b hb, B.PrimitiveFamilyLaw I b hb (axisWindowPrimitives d k p)) : + B.CoordinateWindowLaw k := by + classical + intro I b hb q + apply B.pair_actual_law (by omega) (coordinateWindowPrimitives k q) + (fun i j I _ b hb => B.coordinate_pair_law hn g q haxis i j I b hb) h20 + (fun d : Fin 2 => fun i : Fin (k-1) => (d,i)) _ _ I b hb + · intro d I _ b hb + exact haxis d (q d) I b hb + · intro σ hσ + by_contra! h + apply hσ + apply coordinateWindowPatterns q σ + exact h + +end InitialCoverSystem +end CoordinateJointLaw + +section CoordinatePropagation +namespace InitialCoverSystem +variable {a m : ℕ} {r : CutRing} {hm : 2 ≤ m} + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + +theorem coordinate_growth (hlarge : 20 ≤ m+1) + (hr : 0 < ordinary r ∧ ordinary r < 1/2) + (s w z : CutRing) (hs : 0 < ordinary s) (hsr : ordinary s < ordinary r/2) + (hwz : w*z=1) + (hshort : (1+|ordinary (cutTau^a)|)*(|ordinary w|+|ordinary (cutTau*w)|) < ordinary s/4) + {C : ℝ} (hC : 1000 ≤ C) (hSlope : 8*C < ordinary (cutTau^a)) + (hconj : |conjugate (cutTau^a)| < 1/1000) : + ∃ N : ℕ, 1005 ≤ N ∧ ∀ (M : ℕ) (B : InitialCoverSystem a r m hm M) + (_h : B.TangentChartLaws (symmetricWindowLength s) (symmetricWindowStart s) w), + ∀ n : ℕ, N ≤ n → B.CoordinateWindowLaw n → B.CoordinateWindowLaw (growthNewLength n) := by + obtain ⟨N,hN,h⟩ := growth_axis_law (hm := hm) hlarge hr s w z hs hsr hwz hshort hC hSlope hconj + refine ⟨N,hN,?_⟩ + intro M B hB n hn g + exact B.coordinate_joint_law hlarge (by omega) g (h M B hB n hn g) + +omit [Group.IsPerfect (alternatingGroup (Fin (m+1)))] in + +theorem coordinate_iteration {M : ℕ} (B : InitialCoverSystem a r m hm M) + (N : ℕ) (hN : 5 ≤ N) (hbase : B.CoordinateWindowLaw N) + (hstep : ∀ n, N ≤ n → B.CoordinateWindowLaw n → B.CoordinateWindowLaw (growthNewLength n)) : + ∀ n, B.CoordinateWindowLaw n := by + have hge : ∀ n, N ≤ n → B.CoordinateWindowLaw n := by + apply Nat.le_induction + · exact hbase + · intro n hn g + apply (hstep n hn g).mono B + simp only [growthNewLength] + omega + intro n + rcases le_total n N with hn|hn + · exact hbase.mono B hn + · exact hge n hn + +end InitialCoverSystem +end CoordinatePropagation + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/CoordinateTemplateControl.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/CoordinateTemplateControl.lean new file mode 100644 index 0000000000000000000000000000000000000000..b1470e2db05b2ac1177a03d31ab65267695632ac --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/CoordinateTemplateControl.lean @@ -0,0 +1,66 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.SmallControlCalculus +import OAI.GroupTheory.SimpleAmenable.CentralCovers.ControlCalculus +import OAI.GroupTheory.SimpleAmenable.CentralCovers.GridFormalPatching + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section CoordinateTemplateControl +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + {ι κ : Type*} [Finite ι] [Finite κ] + +theorem coordinate_control_to_template (hlarge : 20 ≤ m+1) + (g : ∀ n, B.CoordinateWindowLaw n) + (P : ι → Fin 5 × (CutRing × CutRing)) + (h : ∀ I, I.card ≤ 15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb P) + (j : κ → Fin 2) (u : κ → CutRing × CutRing) (v : κ → ι) + (hv : P ∘ v=fun i => (coordinateTestIndex (j i),u i)) + (V : polygonAlgebra a) + (hV : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) + (fun i => (coordinateTestIndex (j i),u i)) i).val) V.val) + (n : ℕ) (q : Fin 2 → ℤ) (W : polygonAlgebra a) + (hW : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) + (coordinateWindowPrimitives n q) i).val) W.val) + (hinc : W ≤ V) + (f : TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm)) + (hf : B.AlignedSmallSupported f) + (hc : SmallControlled B.c f (B.windowSector (by omega) n (g n) q W)) : + SmallControlled B.c f (B.fullGeometricSector (by omega) P h V) := by + let J : Sum κ (Fin 2 × Fin (n-1)) → Fin 2 := Sum.elim j Prod.fst + let Z : Sum κ (Fin 2 × Fin (n-1)) → CutRing × CutRing := + Sum.elim u (fun i => (coordinateWindowPrimitives n q i).2) + let Q := fun i => (coordinateTestIndex (J i),Z i) + have hQ := fun I (_ : I.card ≤ 15) b hb => B.coordinateFamilyLaw_all g J Z I b hb + have hj := fun I (_ : I.card ≤ 15) b hb => B.coordinateFamilyLaw_all g j u I b hb + have h₀ := B.fullGeometricSector_subfamily (by omega) Q + (fun i => (coordinateTestIndex (j i),u i)) Sum.inl rfl hQ hj V hV + have h₁ := B.fullGeometricSector_subfamily (by omega) Q + (coordinateWindowPrimitives n q) Sum.inr rfl hQ (fun I _ b hb => g n I b hb q) W hW + have h₂ := B.fullGeometricSector_subfamily (by omega) P + (fun i => (coordinateTestIndex (j i),u i)) v hv h hj V hV + rw [← h₂, h₀] + change SmallControlled B.c f (B.fullGeometricSector (by omega) + (coordinateWindowPrimitives n q) (fun I _ b hb => g n I b hb q) W) at hc + rw [h₁] at hc + apply B.control_trans hlarge f _ _ hf ?_ hc + · exact B.fullGeometricSector_small_control (by omega) Q hQ W V hinc + · exact B.fullGeometricSector_supported (by omega) Q hQ V + (fun x y he => hV x y (fun i => he (Sum.inl i))) + +end InitialCoverSystem +end CoordinateTemplateControl + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/CoordinateWindowBase.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/CoordinateWindowBase.lean new file mode 100644 index 0000000000000000000000000000000000000000..e12cc8851fcc0e74487f9c238b72e50425a5ca01 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/CoordinateWindowBase.lean @@ -0,0 +1,64 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.RandomFields.PrimitiveCovariance +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.CoordinateWindowTarget + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section CoordinateWindowBase + +namespace InitialCoverSystem + +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + +theorem coordinateWindowLaw_of_zero (n : ℕ) + (h : ∀ (I : Finset (Fin (m+1))) (b : Fin (m+1)) (hb : b ∉ I), + B.PrimitiveFamilyLaw I b hb (coordinateWindowPrimitives n 0)) : + B.CoordinateWindowLaw n := by + intro I b hb q + let u : CutRing × CutRing := ((q 0 : CutRing)*cutTau,(q 1 : CutRing)*cutTau) + have ht := PrimitiveFamilyLaw.translate B I b hb (coordinateWindowPrimitives n 0) (h I b hb) u + apply PrimitiveFamilyLaw.congr_offsets B I b hb _ (coordinateWindowPrimitives n q) _ _ ht + · intro i + rfl + · rintro ⟨j,i⟩ + simp only [coordinateWindowPrimitives,initialTest_coordinate] + apply coordinatePrimitive_translate_eq + fin_cases j <;> simp [u,coordinateShift,add_mul] + +theorem CoordinateWindowLaw.mono {n k : ℕ} (h : B.CoordinateWindowLaw n) (hk : k ≤ n) : + B.CoordinateWindowLaw k := by + intro I b hb q + let v : Fin 2 × Fin (k-1) → Fin 2 × Fin (n-1) := + fun i => (i.1,Fin.castLE (by omega) i.2) + exact PrimitiveFamilyLaw.reindex B I b hb (coordinateWindowPrimitives n q) (h I b hb q) v + +end InitialCoverSystem + +theorem coordinateWindowLaw_eventually {a m : ℕ} {r : CutRing} {hm : 2 ≤ m} + (hr : 0 < ordinary r ∧ ordinary r < 1/2) (hm' : 15 ≤ m+1) (n : ℕ) : + ∃ L : ℕ, ∀ M : ℕ, L ≤ M → ∀ B : InitialCoverSystem a r m hm M, + B.CoordinateWindowLaw n := by + classical + let Z := Σ (I : Finset (Fin (m+1))), {b : Fin (m+1) // b ∉ I} + have he (z : Z) := primitiveFamilyLaw_eventually (a := a) (hm := hm) hr hm' z.1 z.2.val z.2.property + (coordinateWindowPrimitives n 0) + choose L hL using he + refine ⟨Finset.univ.sup L,fun M hM B => ?_⟩ + apply B.coordinateWindowLaw_of_zero n + intro I b hb + exact hL ⟨I,⟨b,hb⟩⟩ M ((Finset.le_sup (f := L) (Finset.mem_univ _)).trans hM) B + +end CoordinateWindowBase + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/CoverUniformBridges.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/CoverUniformBridges.lean new file mode 100644 index 0000000000000000000000000000000000000000..0f04d518e36bf15eaed8227c4e0059b05b6ea05a --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/CoverUniformBridges.lean @@ -0,0 +1,292 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.ChartControlChain +import OAI.GroupTheory.SimpleAmenable.Configurations.SymmetricCharts + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section CoverUniformBridges +namespace InitialCoverSystem +variable {a m : ℕ} {r : CutRing} {hm : 2 ≤ m} + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + +theorem old_axis_bridge_control_cover_uniform (hlarge : 20 ≤ m+1) {K δ : ℝ} (hK : 0 ≤ K) (hδ : 0 < δ) : + ∃ N : ℕ, 160 ≤ N ∧ ∀ (M : ℕ) (B : InitialCoverSystem a r m hm M), ∀ n : ℕ, N ≤ n → ∀ h : B.CoordinateWindowLaw n, + ∀ (j : Fin 2) (s : ℕ) (hs : s ≤ n) (p q : ℤ), + ((q-p).natAbs:ℝ) ≤ (K+1)*(n:ℝ) → + ∀ u v U V : CutRing, ordinary u ≤ ordinary v → + ordinary U ≤ ordinary u-δ → ordinary v+δ ≤ ordinary V → + ordinary V-ordinary U < 1 → + (p ≤ endpointLabel u ∧ endpointLabel u < p+s) → + (p ≤ endpointLabel v ∧ endpointLabel v < p+s) → + (q ≤ endpointLabel U ∧ endpointLabel U < q+(n/8:ℕ)) → + (q ≤ endpointLabel V ∧ endpointLabel V < q+(n/8:ℕ)) → + ∀ f : TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm), + B.AlignedSmallSupported f → + SmallControlled B.c f (B.axisSector (by omega) n h j s hs p (coordinateInterval a j u v)) → + SmallControlled B.c f (B.axisSector (by omega) n h j (n/8) (Nat.div_le_self n 8) q + (coordinateInterval a j U V)) := by + obtain ⟨N,hN,hgeo⟩ := old_window_bridge_geometry hK hδ 0 + refine ⟨N,hN,?_⟩ + intro M B n hn h j s hs p q hpq u v U V huv hU hV hlen hlu hlv hlU hlV f hf hstart + obtain ⟨T,w,u',v',hw₀,hwT,_,hlabel,hstep,hinc,hnest,herror⟩ := + hgeo n hn p q hpq (ordinary u) (ordinary v) huv + have horder (i : ℕ) : ordinary (u' i) ≤ ordinary (v' i) := by + have hh := hinc i (show ordinary u ∈ Set.Icc (ordinary u) (ordinary v) from ⟨le_rfl,huv⟩) + exact hh.1.le.trans hh.2.le + have hbounds (i : ℕ) (hi : i ≤ T) : + ordinary U ≤ ordinary (u' i) ∧ ordinary (v' i) ≤ ordinary V := by + have h₁ := herror i hi (show ordinary (u' i) ∈ Set.Icc (ordinary (u' i)) (ordinary (v' i)) + from ⟨le_rfl,horder i⟩) + have h₂ := herror i hi (show ordinary (v' i) ∈ Set.Icc (ordinary (u' i)) (ordinary (v' i)) + from ⟨horder i,le_rfl⟩) + exact ⟨hU.trans h₁.1.le,h₂.2.le.trans hV⟩ + have hlength (i : ℕ) (hi : i ≤ T) : ordinary (v' i)-ordinary (u' i) < 1 := by + obtain ⟨h₁,h₂⟩ := hbounds i hi + linarith + have hlabels₀ : (p ≤ endpointLabel (u' 0) ∧ endpointLabel (u' 0) < p+(n/8:ℕ)) ∧ + (p ≤ endpointLabel (v' 0) ∧ endpointLabel (v' 0) < p+(n/8:ℕ)) := by + simpa only [hw₀] using hlabel 0 + have hfirstinc : coordinateInterval a j u v ≤ coordinateInterval a j (u' 0) (v' 0) := by + apply coordinateInterval_mono j u v (u' 0) (v' 0) + · exact (hinc 0 (show ordinary u ∈ Set.Icc (ordinary u) (ordinary v) from ⟨le_rfl,huv⟩)).1.le + · exact huv + · exact (hinc 0 (show ordinary v ∈ Set.Icc (ordinary u) (ordinary v) from ⟨huv,le_rfl⟩)).2.le + · exact hlength 0 (Nat.zero_le _) + have hfirst := B.axisSector_overlap_control (by omega : 15 < m+1) n h j s (n/8) hs + (Nat.div_le_self n 8) p p p le_rfl (by omega) le_rfl + (by omega) + (coordinateInterval a j u v) (coordinateInterval a j (u' 0) (v' 0)) hfirstinc + (axisInterval_resolved j s p u v hlu hlv) + (axisInterval_resolved j (n/8) p (u' 0) (v' 0) hlabels₀.1 hlabels₀.2) + have hF₀ := B.axisSector_supported (by omega : 15 < m+1) n h j (n/8) + (Nat.div_le_self n 8) p (coordinateInterval a j (u' 0) (v' 0)) + (axisInterval_resolved j (n/8) p (u' 0) (v' 0) hlabels₀.1 hlabels₀.2) + have h₀ := B.control_trans hlarge f _ _ hf hF₀ hstart hfirst + have hchain : SmallControlled B.c f (B.axisSector (by omega) n h j (n/8) + (Nat.div_le_self n 8) (w T) (coordinateInterval a j (u' T) (v' T))) := by + refine B.axisInterval_chain_control hlarge n h j (n/8) (Nat.div_le_self n 8) T w u' v' + hlabel ?_ ?_ f hf ?_ + · intro i _ + have hh := hstep i + simp only [mul_zero,Nat.cast_zero,add_zero] at hh + exact hh.le + · intro i hi + apply coordinateInterval_mono j (u' i) (v' i) (u' (i+1)) (v' (i+1)) + · exact (hnest i (show ordinary (u' i) ∈ Set.Icc (ordinary (u' i)) (ordinary (v' i)) + from ⟨le_rfl,horder i⟩)).1.le + · exact horder i + · exact (hnest i (show ordinary (v' i) ∈ Set.Icc (ordinary (u' i)) (ordinary (v' i)) + from ⟨horder i,le_rfl⟩)).2.le + · exact hlength (i+1) (by omega) + · simpa only [hw₀] using h₀ + rw [hwT] at hchain + have hlastinc : coordinateInterval a j (u' T) (v' T) ≤ coordinateInterval a j U V := + coordinateInterval_mono j (u' T) (v' T) U V (hbounds T le_rfl).1 (horder T) + (hbounds T le_rfl).2 hlen + have hlast : SmallControlled B.c + (B.axisSector (by omega) n h j (n/8) (Nat.div_le_self n 8) q (coordinateInterval a j (u' T) (v' T))) + (B.axisSector (by omega) n h j (n/8) (Nat.div_le_self n 8) q (coordinateInterval a j U V)) := + B.fullGeometricSector_small_control (by omega) _ _ _ _ hlastinc + exact B.control_trans hlarge f _ _ hf + (B.axisSector_supported (by omega) n h j (n/8) (Nat.div_le_self n 8) q _ + (axisInterval_resolved j (n/8) q U V hlU hlV)) hchain hlast + +theorem old_rectangle_bridge_control_cover_uniform (hlarge : 20 ≤ m+1) + {K δ : ℝ} (hK : 0 ≤ K) (hδ : 0 < δ) : + ∃ N : ℕ, 160 ≤ N ∧ ∀ (M : ℕ) (B : InitialCoverSystem a r m hm M), ∀ n : ℕ, N ≤ n → ∀ h : B.CoordinateWindowLaw n, + ∀ (s : Fin 2 → ℕ) (hs : ∀ j, s j ≤ n) (p q : Fin 2 → ℤ), + (∀ j, ((q j-p j).natAbs:ℝ) ≤ (K+1)*(n:ℝ)) → + ∀ u v U V : Fin 2 → CutRing, + (∀ j, ordinary (u j) ≤ ordinary (v j)) → + (∀ j, ordinary (U j) ≤ ordinary (u j)-δ) → + (∀ j, ordinary (v j)+δ ≤ ordinary (V j)) → + (∀ j, ordinary (V j)-ordinary (U j) < 1) → + (∀ j, p j ≤ endpointLabel (u j) ∧ endpointLabel (u j) < p j+s j) → + (∀ j, p j ≤ endpointLabel (v j) ∧ endpointLabel (v j) < p j+s j) → + (∀ j, q j ≤ endpointLabel (U j) ∧ endpointLabel (U j) < q j+(n/8:ℕ)) → + (∀ j, q j ≤ endpointLabel (V j) ∧ endpointLabel (V j) < q j+(n/8:ℕ)) → + ∀ f : TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm), + B.AlignedSmallSupported f → + (∀ j, SmallControlled B.c f + (B.axisSector (by omega) n h j (s j) (hs j) (p j) (coordinateInterval a j (u j) (v j)))) → + SmallControlled B.c f (B.windowSector (by omega) n h q (coordinateRectangle a U V)) := by + obtain ⟨N,hN,hbridge⟩ := old_axis_bridge_control_cover_uniform (a := a) (r := r) (hm := hm) hlarge hK hδ + refine ⟨N,hN,?_⟩ + intro M B n hn h s hs p q hpq u v U V huv hU hV hlen hlu hlv hlU hlV f hf hstart + have hc (j : Fin 2) : SmallControlled B.c f + (B.windowSector (by omega) n h q (coordinateInterval a j (U j) (V j))) := by + have hh := hbridge M B n hn h j (s j) (hs j) (p j) (q j) (hpq j) + (u j) (v j) (U j) (V j) (huv j) (hU j) (hV j) (hlen j) + (hlu j) (hlv j) (hlU j) (hlV j) f hf (hstart j) + rw [B.axisSector_in_window (by omega) n h j (n/8) (Nat.div_le_self n 8) + (q j) q le_rfl (by omega) (coordinateInterval a j (U j) (V j)) + (axisInterval_resolved j (n/8) (q j) (U j) (V j) (hlU j) (hlV j))] at hh + exact hh + apply B.fullGeometricSector_intersection_control (by omega) (coordinateWindowPrimitives n q) + (fun I _ b hb => h I b hb q) (coordinateInterval a 0 (U 0) (V 0)) + (coordinateInterval a 1 (U 1) (V 1)) ?_ ?_ f (hc 0) (hc 1) + · exact coordinateLabelWindow_resolved n q 0 (U 0) (V 0) + ⟨(hlU 0).1,by have h' := (hlU 0).2; omega⟩ + ⟨(hlV 0).1,by have h' := (hlV 0).2; omega⟩ + · exact coordinateLabelWindow_resolved n q 1 (U 1) (V 1) + ⟨(hlU 1).1,by have h' := (hlU 1).2; omega⟩ + ⟨(hlV 1).1,by have h' := (hlV 1).2; omega⟩ + +theorem old_rectangle_bridge_to_chart_cover_uniform (hlarge : 20 ≤ m+1) + {K δ : ℝ} (hK : 0 ≤ K) (hδ : 0 < δ) + (k : ℕ) (q : Fin 2 → ℤ) (u : CutRing) + (l v : Fin 2 → CutRing) + (hl : ∀ j, q j ≤ endpointLabel (l j) ∧ endpointLabel (l j) < q j+k) + (hv : ∀ j, q j ≤ endpointLabel (v j) ∧ endpointLabel (v j) < q j+k) + (hlen : ∀ j, ordinary (v j)-ordinary (l j) < 1) : + ∃ N : ℕ, 160 ≤ N ∧ ∀ (M : ℕ) (B : InitialCoverSystem a r m hm M) (h : B.TangentChartLaws k q u), ∀ n : ℕ, N ≤ n → ∀ g : B.CoordinateWindowLaw n, + ∀ (s : Fin 2 → ℕ) (hs : ∀ j, s j ≤ n) (p : Fin 2 → ℤ), + ∀ L V : Fin 2 → CutRing, + (∀ j, ordinary (L j) ≤ ordinary (V j)) → + (∀ j, p j ≤ endpointLabel (L j) ∧ endpointLabel (L j) < p j+s j) → + (∀ j, p j ≤ endpointLabel (V j) ∧ endpointLabel (V j) < p j+s j) → + ∀ (d : Fin 2) (e : Fin 5) (z : CutRing × CutRing), + (∀ j, ((pointLabel z j+q j-p j).natAbs:ℝ) ≤ (K+1)*(n:ℝ)) → + (∀ j, ordinary (l j)+ordinary (pointCoordinate z j) ≤ ordinary (L j)-δ) → + (∀ j, ordinary (V j)+δ ≤ ordinary (v j)+ordinary (pointCoordinate z j)) → + ∀ f : TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm), + B.AlignedSmallSupported f → + (∀ j, SmallControlled B.c f + (B.axisSector (by omega) n g j (s j) (hs j) (p j) (coordinateInterval a j (L j) (V j)))) → + SmallControlled B.c f (B.fullGeometricSector (by omega) + (translatedTemplate (tangentChartTemplate a k q d (signedShortSteps u e)) z) + (h d e z) (spatialTranslate z (coordinateRectangle a l v))) := by + obtain ⟨N,hN,hbridge⟩ := old_rectangle_bridge_control_cover_uniform (a := a) (r := r) (hm := hm) hlarge hK hδ + refine ⟨max N (8*k),le_trans hN (le_max_left _ _),?_⟩ + intro M B h n hn g s hs p L V hLV hL hV d e z hpq hlo hup f hf hc + have hnN : N ≤ n := (le_max_left _ _).trans hn + have hkn : k ≤ n/8 := (Nat.le_div_iff_mul_le (by omega : 0 < 8)).mpr (by omega) + rw [B.tangentChartSector_eq_window (by omega) k q u h n (by omega) g d e z l v hl hv, + spatialTranslate_coordinateRectangle] + apply hbridge M B n hnN g s hs p (fun j => pointLabel z j+q j) hpq L V + (fun j => l j+pointCoordinate z j) (fun j => v j+pointCoordinate z j) hLV + · intro j + simpa only [map_add] using hlo j + · intro j + simpa only [map_add] using hup j + · intro j + simpa only [map_add,add_sub_add_right_eq_sub] using hlen j + · exact hL + · exact hV + · intro j + simp only [endpointLabel_add,pointLabel] + have hh := hl j + omega + · intro j + simp only [endpointLabel_add,pointLabel] + have hh := hv j + omega + · exact hf + · exact hc + +theorem tangent_chart_chain_control_cover_uniform (hlarge : 20 ≤ m+1) + (hr : 0 < ordinary r ∧ ordinary r < 1/2) + {K δ : ℝ} (hK : 0 ≤ K) (hδ : 0 < δ) + (k : ℕ) (q : Fin 2 → ℤ) (u : CutRing) + (l v : Fin 2 → CutRing) + (hl : ∀ j, q j ≤ endpointLabel (l j) ∧ endpointLabel (l j) < q j+k) + (hv : ∀ j, q j ≤ endpointLabel (v j) ∧ endpointLabel (v j) < q j+k) + (hlv : ∀ j, ordinary (l j) ≤ ordinary (v j)) + (hlen : ∀ j, ordinary (v j)-ordinary (l j) < 1) + (hbox : ∀ j, -ordinary r < ordinary (l j) ∧ ordinary (v j) < ordinary r) + (hbox' : ∀ (d : Fin 2) (e : Fin 5) (j : Fin 2), + -ordinary r < ordinary (l j)-ordinary (pointCoordinate (tangentOffset a d (signedShortSteps u e)) j) ∧ + ordinary (v j)-ordinary (pointCoordinate (tangentOffset a d (signedShortSteps u e)) j) < ordinary r) : + ∃ N : ℕ, 160 ≤ N ∧ ∀ (M : ℕ) (B : InitialCoverSystem a r m hm M) (h : B.TangentChartLaws k q u), ∀ n : ℕ, N ≤ n → ∀ g : B.CoordinateWindowLaw n, + ∀ (s : Fin 2 → ℕ) (hs : ∀ j, s j ≤ n) (p : Fin 2 → ℤ), + ∀ L V : Fin 2 → CutRing, + (∀ j, ordinary (L j) ≤ ordinary (V j)) → + (∀ j, p j ≤ endpointLabel (L j) ∧ endpointLabel (L j) < p j+s j) → + (∀ j, p j ≤ endpointLabel (V j) ∧ endpointLabel (V j) < p j+s j) → + ∀ (d : Fin 2) (T : ℕ) (z : ℕ → CutRing × CutRing) (e : ℕ → Fin 5), + (∀ i, i < T → z (i+1) = z i+tangentOffset a d (signedShortSteps u (e i))) → + (∀ i, i < T → ∀ j, ((pointLabel (z i) j+q j-p j).natAbs:ℝ) ≤ (K+1)*(n:ℝ)) → + (∀ i, i < T → ∀ j, ordinary (l j)+ordinary (pointCoordinate (z i) j) ≤ ordinary (L j)-δ) → + (∀ i, i < T → ∀ j, ordinary (V j)+δ ≤ ordinary (v j)+ordinary (pointCoordinate (z i) j)) → + ∀ f : TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm), + B.AlignedSmallSupported f → + (∀ j, SmallControlled B.c f + (B.axisSector (by omega) n g j (s j) (hs j) (p j) (coordinateInterval a j (L j) (V j)))) → + SmallControlled B.c f (B.tangentSign (by omega) k q u h d (z 0) true) → + SmallControlled B.c f (B.tangentSign (by omega) k q u h d (z T) true) := by + obtain ⟨N,hN,hbridge⟩ := old_rectangle_bridge_to_chart_cover_uniform (m := m) (r := r) (hm := hm) hlarge hK hδ k q u l v hl hv hlen + refine ⟨N,hN,?_⟩ + intro M B h n hn g s hs p L V hLV hL hV d T z e hz hpq hlo hup f hf hc hstart + apply small_control_action_chain B.c f + (fun i => B.tangentSign (by omega) k q u h d (z i) true) T hstart + intro i hi I t x hx + rw [hz i hi] + exact B.tangentSign_step_action hlarge hr k q u h d (e i) (z i) l v hl hv hlv hlen hbox + (hbox' d (e i)) f hf + (hbridge M B h n hn g s hs p L V hLV hL hV d (e i) (z i) (hpq i hi) (hlo i hi) (hup i hi) f hf hc) + I t x hx + +theorem tangent_transport_uniform_cover_uniform (hlarge : 20 ≤ m+1) + (hr : 0 < ordinary r ∧ ordinary r < 1/2) + (s u v : CutRing) (hs : 0 < ordinary s) (hsr : ordinary s < ordinary r/2) + (huv : u*v=1) + (hshort : (1+|ordinary (cutTau^a)|)*(|ordinary u|+|ordinary (cutTau*u)|) < ordinary s/4) + {A C D E : ℝ} (hA : 0 ≤ A) (hC : 0 ≤ C) (hD : 0 ≤ D) (hE : 0 ≤ E) : + ∃ N : ℕ, 160 ≤ N ∧ ∀ (M : ℕ) (B : InitialCoverSystem a r m hm M) + (h : B.TangentChartLaws (symmetricWindowLength s) (symmetricWindowStart s) u), ∀ n : ℕ, N ≤ n → ∀ g : B.CoordinateWindowLaw n, + ∀ (t : Fin 2 → ℕ) (ht : ∀ j, t j ≤ n) (p : Fin 2 → ℤ) (L V : Fin 2 → CutRing), + (∀ j, ordinary (L j) ≤ ordinary (V j)) → + (∀ j, p j ≤ endpointLabel (L j) ∧ endpointLabel (L j) < p j+t j) → + (∀ j, p j ≤ endpointLabel (V j) ∧ endpointLabel (V j) < p j+t j) → + ∀ w : CutRing, |ordinary w| ≤ A/(n:ℝ) → |(endpointLabel w:ℝ)| ≤ C*(n:ℝ) → + ∀ (d : Fin 2) (z₀ : CutRing × CutRing), + (∀ j, |(pointLabel z₀ j+symmetricWindowStart s j-p j:ℝ)| ≤ E*(n:ℝ)) → + (∀ j, |ordinary (L j)-ordinary (pointCoordinate z₀ j)| ≤ D/(n:ℝ)) → + (∀ j, |ordinary (V j)-ordinary (pointCoordinate z₀ j)| ≤ D/(n:ℝ)) → + ∀ f : TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm), + B.AlignedSmallSupported f → + (∀ j, SmallControlled B.c f + (B.axisSector (by omega) n g j (t j) (ht j) (p j) (coordinateInterval a j (L j) (V j)))) → + SmallControlled B.c f (B.tangentSign (by omega) (symmetricWindowLength s) + (symmetricWindowStart s) u h d z₀ true) → + SmallControlled B.c f (B.tangentSign (by omega) (symmetricWindowLength s) + (symmetricWindowStart s) u h d (z₀+tangentOffset a d w) true) := by + obtain ⟨K,hK,N₁,hN₁,hgeo⟩ := uniform_tangent_chart_geometry a u v s huv hs hshort hA hC hD hE + have hl := fun j => (symmetricWindow_labels s j).1 + have hv := fun j => (symmetricWindow_labels s j).2.2 + have hlen : ∀ _ : Fin 2, ordinary s-ordinary (-s) < 1 := by + intro j + rw [map_neg] + linarith [hr.2] + have hbox (j : Fin 2) : -ordinary r < ordinary (-s) ∧ ordinary s < ordinary r := by + rw [map_neg] + constructor <;> linarith [hr.1] + obtain ⟨N₂,hN₂,hchain⟩ := tangent_chart_chain_control_cover_uniform (m := m) (r := r) (hm := hm) hlarge hr hK + (by linarith : 0 < ordinary s/4) (symmetricWindowLength s) (symmetricWindowStart s) u + (fun _ => -s) (fun _ => s) hl hv (fun _ => by rw [map_neg]; linarith) hlen hbox + (fun d e j => (symmetric_chart_overlap_boxes a r s u hs hsr hshort d e j).2) + refine ⟨max N₁ N₂,hN₂.trans (le_max_right _ _),?_⟩ + intro M B h n hn g t ht p L V hLV hL hV w hw hw' d z₀ hp hLo hVo f hf hc hstart + have hn₁ : N₁ ≤ n := (le_max_left _ _).trans hn + have hn₂ : N₂ ≤ n := (le_max_right _ _).trans hn + obtain ⟨T,z,e,hz0,hzT,hstep,hpq,hlo,hup⟩ := hgeo n hn₁ w hw hw' d z₀ + (symmetricWindowStart s) p L V hp hLo hVo + have hh := hchain M B h n hn₂ g t ht p L V hLV hL hV d T z e hstep + (fun i _ => hpq i) (fun i _ => by simpa only [map_neg] using hlo i) + (fun i _ => hup i) f hf hc (by simpa only [hz0] using hstart) + simpa only [hzT] using hh + +end InitialCoverSystem +end CoverUniformBridges + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/CrossingCellActions.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/CrossingCellActions.lean new file mode 100644 index 0000000000000000000000000000000000000000..888a9befec8f8835c29b68b4088fc3fd77108d4e --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/CrossingCellActions.lean @@ -0,0 +1,242 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.ConcurrentCellSlopeAction +import OAI.GroupTheory.SimpleAmenable.CentralCovers.GridFormalPatching +import OAI.GroupTheory.SimpleAmenable.CentralCovers.PrimitiveChartActions +import OAI.GroupTheory.SimpleAmenable.CentralCovers.TemplateRelators +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.ConcurrentCellDecisions +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.VaryingCellClassification + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section CrossingCellActions + +@[simp] theorem integralCutForm_neg (a : ℕ) (j : Fin 4) (z : CutRing × CutRing) : + integralCutForm a j (-z) = -integralCutForm a j z := by + fin_cases j <;> simp [integralCutForm] <;> ring + +namespace InitialCoverSystem.PatchAtlas +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + {B : InitialCoverSystem a r m hm M} + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + (A : B.PatchAtlas) + +noncomputable def concurrentPrimitives (t : VertexType (commonVertexDenominator a)) + (u : CutRing × CutRing) : + Sum (Fin 4) (Fin 2 × Fin (A.geometry.window-1)) → Fin 5 × (CutRing × CutRing) := + translatedTemplate (Sum.elim + (fun j : Fin 4 => (⟨j.val+1,by omega⟩,A.geometry.anchors t j)) + (coordinateWindowPrimitives A.geometry.window A.geometry.start)) u + +omit [Group.IsPerfect (alternatingGroup (Fin (m+1)))] in +theorem concurrentLaw (t : VertexType (commonVertexDenominator a)) (u : CutRing × CutRing) : + ∀ I (_ : I.card ≤ 15) b hb, B.PrimitiveFamilyLaw I b hb (A.concurrentPrimitives t u) := + fun I _ b hb => A.concurrent t u I b hb + +noncomputable def margin (t : VertexType (commonVertexDenominator a)) (u : CutRing × CutRing) : + polygonAlgebra a := spatialTranslate u + (coordinateRectangle a (A.geometry.margins t).lower (A.geometry.margins t).upper) + +theorem crossing_cell_actions {ι κ : Type*} [Finite ι] [Finite κ] + (hlarge : 20 ≤ m+1) (hr : 0 simpa [z,pointCoordinate] using hk _ + obtain ⟨t,u,hline,haxis,hmargin,hnear,hact⟩ := A.rectangles.concurrent_cell_slope_action A.geometry + hlarge hr ha q cell d (axisDirection j) (slopeDirection_ne_axisDirection d j) z c hclip + x y v' w hx hy hv hw (by simpa only [z,integralCutForm_neg] using hcx) (by simpa only [z,integralCutForm_neg] using hcy) hdv hdw + refine ⟨t,u,A.geometry.cell_le_margin hr.2 q cell t u hmargin,fun f hf hfW I s b hb => ?_⟩ + have e₀ := A.rectangles.slope_chart_eq (by omega) P h i d 0 hP + rw [spatialTranslate_zero] at e₀ + have e₁ := A.rectangles.slope_chart_eq (by omega) (A.concurrentPrimitives t u) + (A.concurrentLaw t u) (Sum.inl (slopeDirection d)) d + (u+A.geometry.anchors t (slopeDirection d)) rfl + have ez : A.rectangles.slope (by omega) d z=A.rectangles.slope (by omega) d 0 := by + simpa [RectangularAtlas.slope,z] using B.tangentSign_integral (by omega) + A.rectangles.k A.rectangles.p A.rectangles.u A.rectangles.charts d (fun l => -k l) true + constructor + · rw [← e₀,← e₁,← ez] + exact hact f hf hfW I s b hb + · apply B.primitive_coordinate_action hlarge A.rectangles.rectangles Q + (A.concurrentPrimitives t u) g (A.concurrentLaw t u) i' (Sum.inl (axisDirection j)) + j j v (u+A.geometry.anchors t (axisDirection j)) hQ rfl _ _ _ + (fun _ _ he => he ()) ?_ A.geometry.mesh q + (windowRectangle_resolved A.geometry.mesh (by have hh := A.geometry.mesh_large; omega) q cell) + (A.geometry.cell_axis_eq q cell j v c positive hc t u haxis hmargin + (hnear (axisDirection j) (by simp))) f hf hfW I s b hb + cases positive with + | false => exact fun _ _ he => not_congr (he ()) + | true => exact fun _ _ he => he () + +end InitialCoverSystem.PatchAtlas +end CrossingCellActions + +section LocalPatchTemplates +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) {ι J : Type*} + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + +structure LocalPatchTemplate (hlarge : 15 < m+1) + (F : Option ι → TrackStar (Fin (m+1)) →* + BoundedRelationCover M (alternatingGenerator a r m hm)) + (f : J → TrackStar (Fin (m+1)) →* + BoundedRelationCover M (alternatingGenerator a r m hm)) where + index : Type + [finite_index : Finite index] + tests : index → Fin 5 × (CutRing × CutRing) + lawful : ∀ I, I.card ≤ 15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb tests + margin : polygonAlgebra a + predicates : ι → polygonAlgebra a + margin_resolved : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) tests i).val) margin.val + predicates_resolved : ∀ j, ResolvedBy (fun i => (primitiveTests (a := a) (r := r) tests i).val) (predicates j).val + controlled : ∀ j, SmallControlled B.c (f j) (B.fullGeometricSector hlarge tests lawful margin) + action : ∀ i (I : FiveAlphabet (Fin (m+1))) s j, ∀ x ∈ (f j).range, + F (some i) (universalMap (subtypeAlternatingHom I.val) s)*x* + (F (some i) (universalMap (subtypeAlternatingHom I.val) s))⁻¹ = + B.fullGeometricSector hlarge tests lawful (predicates i) + (universalMap (subtypeAlternatingHom I.val) s)*x* + (B.fullGeometricSector hlarge tests lawful (predicates i) + (universalMap (subtypeAlternatingHom I.val) s))⁻¹ + +attribute [instance] LocalPatchTemplate.finite_index + +namespace LocalPatchTemplate +variable {B} {F : Option ι → TrackStar (Fin (m+1)) →* + BoundedRelationCover M (alternatingGenerator a r m hm)} + {f : J → TrackStar (Fin (m+1)) →* + BoundedRelationCover M (alternatingGenerator a r m hm)} + {hlarge : 15 < m+1} (T : B.LocalPatchTemplate hlarge F f) + +theorem masked_actions (h20 : 20 ≤ m+1) + (hF : F none=B.c.comp (universalProjection (alternatingGroup (Fin (m+1))))) + (hf : ∀ j, B.AlignedSmallSupported (f j)) : + ∀ i (I : FiveAlphabet (Fin (m+1))) s j, ∀ x ∈ (f j).range, + F i (universalMap (subtypeAlternatingHom I.val) s)*x* + (F i (universalMap (subtypeAlternatingHom I.val) s))⁻¹ = + B.fullGeometricSector hlarge T.tests T.lawful (marginFamily T.predicates T.margin i) + (universalMap (subtypeAlternatingHom I.val) s)*x* + (B.fullGeometricSector hlarge T.tests T.lawful (marginFamily T.predicates T.margin i) + (universalMap (subtypeAlternatingHom I.val) s))⁻¹ := by + intro i I s j x hx + let I' : ControlAlphabet (Fin (m+1)) := ⟨I.val,by rw [I.property.2]; omega⟩ + cases i with + | none => + have hh := B.cell_restrict_action h20 T.tests T.lawful (wholePolygon a) T.margin + (fun _ _ _ => Iff.rfl) T.margin_resolved (f j) (hf j) (T.controlled j) I' s x hx + rw [B.fullGeometricSector_whole,← hF] at hh + have he : wholePolygon a ⊓ T.margin=T.margin := top_inf_eq _ + rw [he] at hh + exact hh + | some i => + exact (T.action i I s j x hx).trans (by + simpa only [marginFamily,inf_comm] using B.cell_restrict_action h20 T.tests T.lawful + (T.predicates i) T.margin (T.predicates_resolved i) T.margin_resolved + (f j) (hf j) (T.controlled j) I' s x hx) + +end LocalPatchTemplate + +theorem grid_formal_patching_templates {ι D : Type*} [Finite ι] [Fintype D] + {κ : Option ι → Type*} [∀ i, Finite (κ i)] + (hlarge : 25 ≤ m+1) + (Q : (i : Option ι) → κ i → Fin 5 × (CutRing × CutRing)) + (h : ∀ i I, I.card ≤ 15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb (Q i)) + (U : Option ι → polygonAlgebra a) (W : D → polygonAlgebra a) + (hU : ∀ i, ResolvedBy (fun j => (primitiveTests (a := a) (r := r) (Q i) j).val) (U i).val) + (hW : ∀ i d, ResolvedBy (fun j => (primitiveTests (a := a) (r := r) (Q i) j).val) (W d).val) + (he : ∀ i d, B.fullGeometricSector (by omega) (Q i) (h i) (W d)= + B.fullGeometricSector (by omega) (Q none) (h none) (W d)) + (hdisjoint : Pairwise fun d e => Disjoint (W d).val (W e).val) + (hcover : ∀ x, ∃ d, x ∈ (W d).val) + (f : (I : FiveAlphabet (Fin (m+1))) → Option ι → alternatingGroup I.val →* + BoundedRelationCover M (alternatingGenerator a r m hm)) + (hspec : ∀ I i, (B.gridInput (by omega) Q h U i).comp (universalMap (subtypeAlternatingHom I.val))= + (f I i).comp (universalProjection (alternatingGroup I.val))) + (hconst : U none=wholePolygon a) + (hlocal : ∀ d, Nonempty (B.LocalPatchTemplate (by omega) + (B.gridInput (by omega) Q h U) (B.gridPiece (by omega) Q h U W d))) : + HasCentralLaw (smallFamilyModel (fun i : ι => {σ : ι → Bool | σ i=true})) + (smallFamilyEval f).rangeRestrict := by + classical + let T := fun d => Classical.choice (hlocal d) + apply B.grid_formal_patching hlarge Q h U W hU hW he hdisjoint hcover f hspec + (fun d => (T d).tests) (fun d => (T d).lawful) (fun d => (T d).margin) + (fun d => (T d).predicates) (fun d => (T d).margin_resolved) + (fun d => (T d).predicates_resolved) (fun d => (T d).controlled) + intro d + apply (T d).masked_actions (by omega) ?_ (B.gridPiece_supported (by omega) Q h U W hU hW d) + change B.fullGeometricSector _ (Q none) (h none) (U none)=_ + rw [hconst,B.fullGeometricSector_whole] + +end InitialCoverSystem +end LocalPatchTemplates + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/DirectFactors.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/DirectFactors.lean new file mode 100644 index 0000000000000000000000000000000000000000..41bac25e665ff0aebb6ac8208e7e3bcce9f03b8c --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/DirectFactors.lean @@ -0,0 +1,153 @@ +import Mathlib + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section DirectFactors +variable {G : Type*} [Group G] + +structure CommutingFactors (A B : Subgroup G) : Prop where + commute : ∀ a ∈ A, ∀ b ∈ B, Commute a b + cover : ∀ x : G, ∃ a ∈ A, ∃ b ∈ B, x = a * b + +namespace CommutingFactors +variable {A B C D : Subgroup G} + +theorem symm (h : CommutingFactors A B) : CommutingFactors B A where + commute b hb a ha := (h.commute a ha b hb).symm + cover x := by + obtain ⟨a, ha, b, hb, rfl⟩ := h.cover x + exact ⟨b, hb, a, ha, (h.commute a ha b hb).eq⟩ + +theorem mem_center_of_mem_inter (h : CommutingFactors A B) {x : G} + (ha : x ∈ A) (hb : x ∈ B) : x ∈ Subgroup.center G := by + apply Subgroup.mem_center_iff.mpr + intro y + obtain ⟨a, ha', b, hb', rfl⟩ := h.cover y + exact ((h.commute a ha' x hb).mul_left (h.commute x ha b hb').symm).eq + +theorem inter_eq_bot (h : CommutingFactors A B) (hz : Subgroup.center G = ⊥) : + A ⊓ B = ⊥ := by + apply bot_unique + intro x hx + simpa [hz] using h.mem_center_of_mem_inter hx.1 hx.2 + +theorem mem_left_of_commute_right (h : CommutingFactors A B) + (hz : Subgroup.center G = ⊥) {x : G} + (hx : ∀ b ∈ B, Commute x b) : x ∈ A := by + obtain ⟨a, ha, b, hb, rfl⟩ := h.cover x + have hbz : b ∈ Subgroup.center G := by + apply Subgroup.mem_center_iff.mpr + intro y + obtain ⟨c, hc, d, hd, rfl⟩ := h.cover y + have hbd : Commute b d := by + have ht := (hx d hd).eq + have ht' : a * (b * d) = a * (d * b) := by + calc + a * (b * d) = (a * b) * d := (mul_assoc _ _ _).symm + _ = d * (a * b) := ht + _ = (d * a) * b := (mul_assoc _ _ _).symm + _ = (a * d) * b := by rw [(h.commute a ha d hd).eq] + _ = a * (d * b) := mul_assoc _ _ _ + exact mul_left_cancel ht' + exact ((h.commute c hc b hb).mul_left hbd.symm).eq + have hb1 : b = 1 := by simpa [hz] using hbz + simpa [hb1] using ha + +def productHom (h : CommutingFactors A B) : A × B →* G where + toFun x := x.1.1 * x.2.1 + map_one' := one_mul _ + map_mul' x y := by + change (x.1.1 * y.1.1) * (x.2.1 * y.2.1) = + (x.1.1 * x.2.1) * (y.1.1 * y.2.1) + calc + _ = x.1.1 * (y.1.1 * x.2.1) * y.2.1 := by group + _ = x.1.1 * (x.2.1 * y.1.1) * y.2.1 := by + rw [(h.commute _ y.1.2 _ x.2.2).eq] + _ = _ := by group + +@[simp] theorem productHom_apply (h : CommutingFactors A B) (x : A × B) : + h.productHom x = x.1.1 * x.2.1 := rfl + +theorem productHom_bijective (h : CommutingFactors A B) + (hz : Subgroup.center G = ⊥) : Function.Bijective h.productHom := by + constructor + · apply (MonoidHom.ker_eq_bot_iff h.productHom).mp + apply bot_unique + rintro ⟨a, b⟩ hab + change (a : G) * b = 1 at hab + have hab' : (a : G) = (b : G)⁻¹ := eq_inv_of_mul_eq_one_left hab + have haB : (a : G) ∈ B := hab' ▸ B.inv_mem b.property + have ha1 : (a : G) = 1 := by + simpa [hz] using h.mem_center_of_mem_inter a.property haB + have hb1 : (b : G) = 1 := by simpa [ha1] using hab + change (a, b) = 1 + exact Prod.ext (Subtype.ext ha1) (Subtype.ext hb1) + · intro x + obtain ⟨a, ha, b, hb, hab⟩ := h.cover x + exact ⟨(⟨a,ha⟩,⟨b,hb⟩), hab.symm⟩ + +noncomputable def productEquiv (h : CommutingFactors A B) + (hz : Subgroup.center G = ⊥) : A × B ≃* G := + MulEquiv.ofBijective h.productHom (h.productHom_bijective hz) + +@[simp] theorem productEquiv_apply (h : CommutingFactors A B) + (hz : Subgroup.center G = ⊥) (x : A × B) : + h.productEquiv hz x = x.1.1 * x.2.1 := rfl + +theorem left_component_commutes (h : CommutingFactors C D) + (hz : Subgroup.center G = ⊥) {c y : G} (hc : c ∈ C) {d : G} (hd : d ∈ D) + (hcy : Commute (c * d) y) : Commute c y := by + obtain ⟨c', hc', d', hd', rfl⟩ := h.cover y + let e := h.productEquiv hz + have he : Commute ((⟨c,hc⟩,⟨d,hd⟩) : C × D) + ((⟨c',hc'⟩,⟨d',hd'⟩) : C × D) := by + apply e.injective + simpa only [map_mul, e, productEquiv_apply] using hcy.eq + have hcc' : Commute c c' := by + exact congrArg (fun z : C × D => (z.1 : G)) he + exact hcc'.mul_right (h.commute c hc d' hd') + +theorem refine_four (h : CommutingFactors A B) (k : CommutingFactors C D) + (hz : Subgroup.center G = ⊥) (x : G) : + ∃ ac ∈ A ⊓ C, ∃ ad ∈ A ⊓ D, ∃ bc ∈ B ⊓ C, ∃ bd ∈ B ⊓ D, + x = ac * ad * bc * bd := by + obtain ⟨a, ha, b, hb, rfl⟩ := h.cover x + obtain ⟨ac, hacC, ad, hadD, heqa⟩ := k.cover a + obtain ⟨bc, hbcC, bd, hbdD, heqb⟩ := k.cover b + have hacA : ac ∈ A := by + apply h.mem_left_of_commute_right hz + intro y hy + apply k.left_component_commutes hz hacC hadD + rw [← heqa] + exact h.commute a ha y hy + have hadA : ad ∈ A := by + have : ad = ac⁻¹ * a := by rw [heqa]; group + rw [this] + exact A.mul_mem (A.inv_mem hacA) ha + have hbcB : bc ∈ B := by + apply h.symm.mem_left_of_commute_right hz + intro y hy + apply k.left_component_commutes hz hbcC hbdD + rw [← heqb] + exact (h.commute y hy b hb).symm + have hbdB : bd ∈ B := by + have : bd = bc⁻¹ * b := by rw [heqb]; group + rw [this] + exact B.mul_mem (B.inv_mem hbcB) hb + exact ⟨ac, ⟨hacA,hacC⟩, ad, ⟨hadA,hadD⟩, bc, ⟨hbcB,hbcC⟩, + bd, ⟨hbdB,hbdD⟩, by rw [heqa, heqb]; group⟩ + +end CommutingFactors +end DirectFactors + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/DisjointPolygonAtoms.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/DisjointPolygonAtoms.lean new file mode 100644 index 0000000000000000000000000000000000000000..7b9acef2dd22aab787bdb4fa813a8bb6296e06f0 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/DisjointPolygonAtoms.lean @@ -0,0 +1,209 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.AxisCutSequences +import OAI.GroupTheory.SimpleAmenable.Configurations.ConditionalIntervalDifference + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section DisjointPolygonAtoms +variable {a m : ℕ} {Ω : Type*} [Fintype Ω] + +omit [Fintype Ω] in +theorem polygonTableInput_disjoint (U : Ω → polygonAlgebra a) + (hd : Pairwise fun i j => Disjoint (U i).val (U j).val) : + Pairwise fun i j => ∀ s t : alternatingGroup (Fin m), + Commute (polygonTableInput U i s) (polygonTableInput U j t) := by + intro i j hij s t + apply sectorMask_commute + apply Set.disjoint_left.mpr + rintro ⟨ω,p,rfl⟩ hi hj + have hi' : p ∈ (U i).val := by simpa [polygonAssignment] using hi + have hj' : p ∈ (U j).val := by simpa [polygonAssignment] using hj + exact Set.disjoint_left.mp (hd hij) hi' hj' + +noncomputable def polygonDisjointTable (U : Ω → polygonAlgebra a) + (hd : Pairwise fun i j => Disjoint (U i).val (U j).val) : + (Ω → alternatingGroup (Fin m)) →* polygonAlternatingGroup a m := + (actualPolygonTableHom U).comp (MonoidHom.noncommPiCoprod + (fun i => polygonTableInput U i) (polygonTableInput_disjoint U hd)) + +@[simp] theorem polygonDisjointTable_single [DecidableEq Ω] (U : Ω → polygonAlgebra a) + (hd : Pairwise fun i j => Disjoint (U i).val (U j).val) (i : Ω) (s : alternatingGroup (Fin m)) : + polygonDisjointTable U hd (Pi.mulSingle i s) = conditionalAlternatingHom (U i) s := by + simp only [polygonDisjointTable,MonoidHom.comp_apply,MonoidHom.noncommPiCoprod_mulSingle, + actualPolygonTableHom_input] + +theorem polygonDisjointTable_mask (U : Ω → polygonAlgebra a) + (hd : Pairwise fun i j => Disjoint (U i).val (U j).val) (i : Ω) : + (polygonDisjointTable (m := m) U hd).comp (sectorMask {i}) = conditionalAlternatingHom (U i) := by + classical + ext s : 1 + have he : sectorMask {i} s = Pi.mulSingle i s := by + ext j + by_cases hh : j=i <;> simp [sectorMask,hh] + simp only [MonoidHom.comp_apply,he,polygonDisjointTable_single] + +theorem polygonDisjointTable_injective (U : Ω → polygonAlgebra a) + (hd : Pairwise fun i j => Disjoint (U i).val (U j).val) + (hne : ∀ i, (U i).val.Nonempty) : Function.Injective (polygonDisjointTable (m := m) U hd) := by + classical + let F := MonoidHom.noncommPiCoprod (fun i => polygonTableInput (m := m) U i) + (polygonTableInput_disjoint U hd) + intro s t he + have hs : F s = F t := actualPolygonTableHom_injective U he + funext i + obtain ⟨p,hp⟩ := hne i + let ω : Set.range (polygonAssignment U) := ⟨polygonAssignment U p,⟨p,rfl⟩⟩ + have hω (j : Ω) : ω.val j = true ↔ j=i := by + change decide (p ∈ (U j).val) = true ↔ j=i + simp only [decide_eq_true_eq] + constructor + · intro hj + by_contra hh + exact Set.disjoint_left.mp (hd hh) hj hp + · rintro rfl; exact hp + have hEval : (Pi.evalMonoidHom (fun _ : Set.range (polygonAssignment U) => alternatingGroup (Fin m)) ω).comp F = + Pi.evalMonoidHom (fun _ : Ω => alternatingGroup (Fin m)) i := by + apply MonoidHom.pi_ext + intro j x + change F (Pi.mulSingle j x) ω = (Pi.mulSingle j x : Ω → alternatingGroup (Fin m)) i + rw [MonoidHom.noncommPiCoprod_mulSingle] + by_cases hh : j=i + · subst j + simp [polygonTableInput,sectorMask,hω] + · have hh' : ¬ω.val j = true := by simpa only [hω j] using hh + simp [polygonTableInput,sectorMask,hh',Ne.symm hh] + have hx := congrArg (fun z => z ω) hs + have hsEval := DFunLike.congr_fun hEval s + have htEval := DFunLike.congr_fun hEval t + change F s ω = s i at hsEval + change F t ω = t i at htEval + rwa [hsEval,htEval] at hx + +theorem centralOn_disjoint_polygon_atoms {H : Type*} [Group H] + (q : H →* polygonAlternatingGroup a m) (U : Ω → polygonAlgebra a) + (hd : Pairwise fun i j => Disjoint (U i).val (U j).val) + (hne : ∀ i, (U i).val.Nonempty) + (f : Ω → UniversalExtension (alternatingGroup (Fin m)) →* H) + (hc : Pairwise fun i j => ∀ s t, Commute (f i s) (f j t)) + (hp : ∀ i, q.comp (f i) = (conditionalAlternatingHom (U i)).comp + (universalProjection (alternatingGroup (Fin m)))) : + CentralOn q (⨆ i, (f i).range) := by + apply centralOn_of_star_atoms q (polygonDisjointTable U hd) + (polygonDisjointTable_injective U hd hne) f hc + intro i + rw [polygonDisjointTable_mask] + exact hp i + +end DisjointPolygonAtoms + +section AxisCutAtoms +namespace AxisCutSequence +variable {n K : ℕ} (D : AxisCutSequence n K) + {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + (hlarge : 15 < m+1) (g : B.CoordinateWindowLaw n) (d : Fin 2) + (hlen : ordinary (D.cut (Fin.last K))-ordinary (D.cut 0) < 1) + (hc : ∀ i j : ℕ, i ≤ j → ∀ x y, + Commute (D.prefixCopy B hlarge g d i x) (D.suffix B hlarge g d j y)) + +noncomputable def atomCopy (i : Fin K) : TrackStar (Fin (m+1)) →* + BoundedRelationCover M (alternatingGenerator a r m hm) := + cutDifference (D.anchorCopy B hlarge g d) (D.prefixCopy B hlarge g d) + (D.suffix B hlarge g d) (D.prefix_suffix B hlarge g d hlen) hc i.val + +noncomputable def atomPolygon (i : Fin K) : polygonAlgebra a := + coordinateInterval a d (D.cut i.castSucc) (D.cut i.succ) + +include hlen in +theorem atomPolygon_nonempty (i : Fin K) : (D.atomPolygon d i : polygonAlgebra a).val.Nonempty := by + apply coordinateInterval_nonempty + · exact D.strictMono (Fin.castSucc_lt_succ (i := i)) + · have h₁ := (D.ordered i.castSucc).1 + have h₂ := (D.ordered i.succ).2 + linarith + +include hlen in +theorem atomPolygon_disjoint : Pairwise fun i j : Fin K => + Disjoint (D.atomPolygon d i : polygonAlgebra a).val (D.atomPolygon d j).val := by + intro i j hij + have one (i j : Fin K) (hij : i < j) : + Disjoint (D.atomPolygon d i : polygonAlgebra a).val (D.atomPolygon d j).val := by + have hgap : i.succ ≤ j.castSucc := by simpa only [Fin.le_def,Fin.val_succ,Fin.val_castSucc] using (show i.val+1 ≤ j.val by omega) + apply coordinateInterval_disjoint + · exact (D.strictMono (Fin.castSucc_lt_succ (i := i))).le + · exact D.strictMono.monotone hgap + · exact (D.strictMono (Fin.castSucc_lt_succ (i := j))).le + · have h₁ := (D.ordered i.castSucc).1 + have h₂ := (D.ordered j.succ).2 + linarith + rcases lt_or_gt_of_ne hij with hh | hh + · exact one i j hh + · exact (one j i hh).symm + +theorem atomCopy_projection (i : Fin K) : + (coverMap M (alternatingGenerator a r m hm)).comp (D.atomCopy B hlarge g d hlen hc i) = + (conditionalAlternatingHom (D.atomPolygon d i)).comp + (universalProjection (alternatingGroup (Fin (m+1)))) := by + ext x : 1 + change coverMap M (alternatingGenerator a r m hm) + ((D.prefixCopy B hlarge g d i.val x)⁻¹*D.prefixCopy B hlarge g d (i.val+1) x) = _ + rw [map_mul,map_inv] + have h₁ := DFunLike.congr_fun (D.prefix_projection B hlarge g d i.val) x + have h₂ := DFunLike.congr_fun (D.prefix_projection B hlarge g d (i.val+1)) x + simp only [MonoidHom.comp_apply] at h₁ h₂ + rw [h₁,h₂] + have hi : D.index i.val = i.castSucc := D.index_fin i.castSucc + have hi' : D.index (i.val+1) = i.succ := D.index_fin i.succ + rw [hi,hi'] + apply conditionalAlternatingHom_interval_difference + · exact (D.ordered i.castSucc).1 + · exact (D.strictMono (Fin.castSucc_lt_succ (i := i))).le + · have hh := (D.ordered i.succ).2 + linarith + +theorem atomCopy_commute : Pairwise fun i j : Fin K => ∀ x y, + Commute (D.atomCopy B hlarge g d hlen hc i x) (D.atomCopy B hlarge g d hlen hc j y) := by + intro i j hij x y + rcases lt_or_gt_of_ne hij with hh | hh + · exact cutDifference_pairwise _ _ _ _ _ i.val j.val hh x y + · exact (cutDifference_pairwise _ _ _ _ _ j.val i.val hh y x).symm + +theorem atomCopy_supported (i : Fin K) : + B.AlignedSmallSupported (D.atomCopy B hlarge g d hlen hc i) := + cutDifference_small_supported (sourceAlignedGroup a r m hm M B.t) _ _ _ _ _ + (D.prefix_small_supported B hlarge g d) i.val + +theorem atomCopy_controlled (i : Fin K) : + SmallControlled B.c (D.atomCopy B hlarge g d hlen hc i) (D.anchorCopy B hlarge g d) := + cutDifference_small_controlled B.c _ _ _ _ _ + (D.prefix_small_controlled B hlarge g d hlen) i.val + +include hlen hc in + +theorem cuts_central : CentralOn (coverMap M (alternatingGenerator a r m hm)) + (⨆ i : Fin (K+1), (D.prefixCopy B hlarge g d i.val).range) := by + have hcentral := centralOn_disjoint_polygon_atoms + (coverMap M (alternatingGenerator a r m hm)) (D.atomPolygon d) + (D.atomPolygon_disjoint d hlen) (D.atomPolygon_nonempty d hlen) + (D.atomCopy B hlarge g d hlen hc) (D.atomCopy_commute B hlarge g d hlen hc) + (D.atomCopy_projection B hlarge g d hlen hc) + apply hcentral.mono + apply iSup_le + intro i + exact prefix_range_le_differences _ _ _ _ hc (D.prefix_zero B hlarge g d) K i.val (by omega) + +end AxisCutSequence +end AxisCutAtoms + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/DistinctSlotFixer.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/DistinctSlotFixer.lean new file mode 100644 index 0000000000000000000000000000000000000000..3b45f0c442d7de9c0624c2b67351c734f9690978 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/DistinctSlotFixer.lean @@ -0,0 +1,81 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.PrivateBankWord +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.PrivateBankReserve +import OAI.GroupTheory.SimpleAmenable.CentralCovers.PrivateBankFixer + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section DistinctSlotFixer +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + (hlarge : 15 < m+1) (h : B.AllPrimitiveLaws) (hr : 0 u (ι i) + let u' : Fin (m+1) → CutRing × CutRing := Function.extend e (fun p => v p.1) (fun _ => 0) + have hu : ∀ i j, u' (e (i,j))=v i := fun i j => e.injective.extend_apply _ _ (i,j) + let G := balancedOffsetFrame a r m hm (bankAlphabet e) b hb' u' + have hfix' : ∀ (i : Fin 5) (x : V.val), + (coverMap M (alternatingGenerator a r m hm) z).val.val (e (i,0),translate a (u' (e (i,0))) x.val) = + (e (i,0),translate a (u' (e (i,0))) x.val) := by + intro i x + rw [hu i 0,he i] + exact hfix i x + have hh := B.private_bank_source_fixer hlarge h hr e b hb' u' v hu G V J + (fun i j hj hjJ => hprivate i j hj (Finset.mem_insert_of_mem hjJ)) z hz hzJ hfix' s + let G0 : OffsetFrame a r m hm (orderedTrackAlphabet ι) u' := heq ▸ G.restrict (bankColumn_subset e 0) + have huv : ∀ k ∈ orderedTrackAlphabet ι, u k=u' k := by + intro k hk + obtain ⟨i,_,rfl⟩ := Finset.mem_map.mp hk + rw [← he i,hu i 0] + exact congrArg u (he i) + have hehom : B.distinctSlotStar hlarge h hr ι u F V = + B.distinctSlotStar hlarge h hr ι u' G0 V := by + unfold distinctSlotStar + rw [B.frameStar_independent hlarge h hr (orderedTrackAlphabet ι) + (by rw [orderedTrackAlphabet,Finset.card_map,Finset.card_univ,Fintype.card_fin]) + b hb u u' F G0 huv V] + rw [hehom] + subst ι + exact hh + +end InitialCoverSystem +end DistinctSlotFixer + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/ExteriorClippedModels.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/ExteriorClippedModels.lean new file mode 100644 index 0000000000000000000000000000000000000000..5db77040d566a277c024d427200bf598834d9ea9 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/ExteriorClippedModels.lean @@ -0,0 +1,73 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.ActiveClippedModelActions +import OAI.GroupTheory.SimpleAmenable.CentralCovers.InitialGridActions +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.ClippedGerms + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section ExteriorClippedModels +namespace InitialCoverSystem.PatchAtlas +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} {B : InitialCoverSystem a r m hm M} + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] (A : B.PatchAtlas) + +theorem exterior_clipped_model_action {ι : Type*} [Finite ι] + (hlarge : 20 ≤ m+1) (hr : 0 halfPlane a (j i) (c i)) + (spatialTranslate u (clippedSlopePrimitive a r (slopeDirection d))).val) + (σ : Fin 2 × Bool → Bool) (hσ : ¬ ∀ k, σ (k,false)=false ∧ σ (k,true)=true) + (cell : Fin 2 → Fin A.geometry.mesh) + (hout : Disjoint (windowRectangle a A.geometry.mesh (symmetricWindowStart r) cell) + (coordinateRectangle a (fun _ => -r) (fun _ => r))) + (n : ℕ) (q : Fin 2 → ℤ) (W : polygonAlgebra a) + (hW : ResolvedBy (fun e => (primitiveTests (a := a) (r := r) + (coordinateWindowPrimitives n q) e).val) W.val) + (hinc : W ≤ + A.geometry.coordinateGate T.vertex T.offset z Prod.fst G.axialCut σ) + (hinitial : W ≤ spatialTranslate u (windowRectangle a A.geometry.mesh (symmetricWindowStart r) cell)) + (f : TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm)) + (hf : B.AlignedSmallSupported f) + (hc : SmallControlled B.c f (B.windowSector (by omega) n (A.rectangles.rectangles n) q + W)) + (I : ControlAlphabet (Fin (m+1))) (s : UniversalExtension (alternatingGroup I.val)) + (x : BoundedRelationCover M (alternatingGenerator a r m hm)) (hx : x ∈ f.range) : + A.primitiveStar (by omega) (slopeTestIndex d,u) (universalMap (subtypeAlternatingHom I.val) s)*x* + (A.primitiveStar (by omega) (slopeTestIndex d,u) (universalMap (subtypeAlternatingHom I.val) s))⁻¹ = + B.fullGeometricSector (by omega) (A.concurrentPrimitives T.vertex T.offset) (A.concurrentLaw T.vertex T.offset) + (T.polygons (fun _ : Unit => spatialTranslate u (clippedSlopePrimitive a r (slopeDirection d))) ()) + (universalMap (subtypeAlternatingHom I.val) s)*x* + (B.fullGeometricSector (by omega) (A.concurrentPrimitives T.vertex T.offset) (A.concurrentLaw T.vertex T.offset) + (T.polygons (fun _ : Unit => spatialTranslate u (clippedSlopePrimitive a r (slopeDirection d))) ()) + (universalMap (subtypeAlternatingHom I.val) s))⁻¹ := by + rw [A.primitiveStar_slope] + have hcomm := A.exterior_grid_action hlarge hr d u cell hout n q W hW hinitial f hf hc I s x hx + have hconstant := B.cell_constant_action hlarge _ (A.concurrentLaw T.vertex T.offset) _ _ + (A.inward_model_resolved T _ ()) + (A.concurrent_coordinateGate_resolved T.vertex T.offset z Prod.fst G.axialCut σ) false + (by rw [G.model_restrict_gate T hr hz₁ hz₂ lo hi slope hlo hhi hs hR σ,ite_eq_right hσ]; + exact bot_inf_eq _) f hf + (A.coordinateGate_control hlarge T.vertex T.offset z Prod.fst G.axialCut σ n q _ hW hinc f hf hc) I s x hx + simp only [Bool.false_eq_true,↓reduceIte,one_mul,inv_one,mul_one] at hconstant + rw [hconstant,hcomm.eq,mul_assoc,mul_inv_cancel,mul_one] + +end InitialCoverSystem.PatchAtlas +end ExteriorClippedModels + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/FarClippedModels.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/FarClippedModels.lean new file mode 100644 index 0000000000000000000000000000000000000000..7851b0e29b03e8223c541a388dd2f9e00f06ddf1 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/FarClippedModels.lean @@ -0,0 +1,207 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.ClippedGerms +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.FarClippingGeometry +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.CoordinateModels +import OAI.GroupTheory.SimpleAmenable.CentralCovers.InitialGridActions +import OAI.GroupTheory.SimpleAmenable.CentralCovers.PrimitiveStarCoherence + +namespace OAI + +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +namespace InitialCoverSystem.PatchAtlas +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} {B : InitialCoverSystem a r m hm M} + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] (A : B.PatchAtlas) + +theorem far_grid_action_at_point (hlarge : 20 ≤ m+1) + (hr : 0 (primitiveTests (a := a) (r := r) + (coordinateWindowPrimitives n q) e).val) W.val) + (hinitial : W ≤ spatialTranslate v₀ (windowRectangle a A.geometry.mesh (symmetricWindowStart r) cell)) + (p : GenericSquare a) (hp : p ∈ W.val) + (hpclip : ∀ k, -ordinary r≤realCoordinate p.val k-ordinary (pointCoordinate v₀ k) ∧ + realCoordinate p.val k-ordinary (pointCoordinate v₀ k) exact h + have hb (k : Fin 2) : symmetricWindowStart r k≤endpointLabel (-r) ∧ + endpointLabel (-r) ⟨(hw k).1,(hw k).2.le⟩) + (by rw [hform]; exact hfar) n q W hW hinitial f hf hc I s x hx + simpa only [hform] using hact + +theorem far_clipped_model_action_neighborhood {ι : Type*} [Finite ι] + (hlarge : 20 ≤ m+1) (hr : 0 halfPlane a (j i) (c i)) + (spatialTranslate u (clippedSlopePrimitive a r (slopeDirection d))).val) + (hmesh : (1+|ordinary (cutTau^a)|)*(200/(A.geometry.mesh:ℝ)) (primitiveTests (a := a) (r := r) + (coordinateWindowPrimitives n q) e).val) W.val → + W ≤ A.geometry.coordinateGate T.vertex T.offset z Prod.fst G.axialCut σ → + W ≤ spatialTranslate G.offset (windowRectangle a A.geometry.mesh (symmetricWindowStart r) cell) → + ∀ p : GenericSquare a, p ∈ W.val → dist p.val z<δ → + (∀ k, -ordinary r≤realCoordinate p.val k-ordinary (pointCoordinate G.offset k) ∧ + realCoordinate p.val k-ordinary (pointCoordinate G.offset k) spatialTranslate u (clippedSlopePrimitive a r (slopeDirection d))) ()) + (universalMap (subtypeAlternatingHom I.val) s)*x* + (B.fullGeometricSector (by omega) (A.concurrentPrimitives T.vertex T.offset) (A.concurrentLaw T.vertex T.offset) + (T.polygons (fun _ : Unit => spatialTranslate u (clippedSlopePrimitive a r (slopeDirection d))) ()) + (universalMap (subtypeAlternatingHom I.val) s))⁻¹ := by + obtain ⟨δ,hδ,hδspec⟩ := far_cut_neighborhood a (slopeDirection d) z + (ordinary (integralCutForm a (slopeDirection d) G.offset)) (ordinary A.rectangles.radius) + ((1+|ordinary (cutTau^a)|)*(200/(A.geometry.mesh:ℝ))) A.rectangles.radius_pos hmesh hfarline + refine ⟨δ,hδ,?_⟩ + intro cell n q W hW hinc hinitial p hp hpδ hpclip f hf hc I s x hx + have hfar := hδspec p.val hpδ + have hact := A.far_grid_action_at_point hlarge hr d G.offset cell n q W hW hinitial + p hp hpclip hfar.1 f hf hc I s x hx + simp only [hfar.2] at hact + have hperiod := A.primitiveStar_periodic (by omega) (slopeTestIndex d) u G.period + change A.primitiveStar (by omega) (slopeTestIndex d,G.offset)=_ at hperiod + rw [← hperiod,A.primitiveStar_slope] + apply hact.trans + symm + have hinactive : cutForm a (slopeDirection d) z ≠ ordinary (integralCutForm a (slopeDirection d) G.offset) := by + intro he + rw [he,sub_self,abs_zero] at hfarline + linarith [A.rectangles.radius_pos] + let b : Bool := decide (ordinary (integralCutForm a (slopeDirection d) G.offset) halfPlane a (j i) (c i)) + (spatialTranslate u (clippedSlopePrimitive a r (slopeDirection d))).val) + (hmesh : (1+|ordinary (cutTau^a)|)*(200/(A.geometry.mesh:ℝ)) (primitiveTests (a := a) (r := r) + (coordinateWindowPrimitives n q) e).val) (coordinateRectangle a L V).val) → + (coordinateRectangle a L V ≤ + A.geometry.coordinateGate T.vertex T.offset z Prod.fst G.axialCut σ) → + ∀ (cell : Fin 2 → Fin A.geometry.mesh), + (coordinateRectangle a L V ≤ spatialTranslate G.offset + (windowRectangle a A.geometry.mesh (symmetricWindowStart r) cell)) → + ∀ p : GenericSquare a, p ∈ (coordinateRectangle a L V).val → dist p.val z<δ → + (∀ k, ordinary (L k)≤realCoordinate p.val k ∧ realCoordinate p.val k spatialTranslate u (clippedSlopePrimitive a r (slopeDirection d))) ()) + (universalMap (subtypeAlternatingHom I.val) s)*x* + (B.fullGeometricSector (by omega) (A.concurrentPrimitives T.vertex T.offset) (A.concurrentLaw T.vertex T.offset) + (T.polygons (fun _ : Unit => spatialTranslate u (clippedSlopePrimitive a r (slopeDirection d))) ()) + (universalMap (subtypeAlternatingHom I.val) s))⁻¹ := by + by_cases hactive : cutForm a (slopeDirection d) z=ordinary (integralCutForm a (slopeDirection d) G.offset) + · refine ⟨A.geometry.epsilon/2,by linarith [A.geometry.positive],?_⟩ + intro L V hLV hclip hnear n q hW hinc cell hinitial p hp hpδ hpoint f hf hc I s x hx + exact A.active_clipped_model_action hlarge hr d u z G T hz₁ hz₂ lo hi slope hlo hhi hs hR + (by simpa only [hs.1,hs.2] using hactive) σ hσ L V hLV hclip hnear n q hW hinc f hf hc I s x hx + by_cases hnearline : |cutForm a (slopeDirection d) z-ordinary (integralCutForm a (slopeDirection d) G.offset)| linarith [(hclip k).1,(hclip k).2,(hpoint k).1,(hpoint k).2] + +end InitialCoverSystem.PatchAtlas + +end SimpleAmenable + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/FiniteCentralKernel.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/FiniteCentralKernel.lean new file mode 100644 index 0000000000000000000000000000000000000000..37c60c2c2179659fcea623f49d12d7e869a844b2 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/FiniteCentralKernel.lean @@ -0,0 +1,153 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.PerfectCalculus + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section FiniteCentralKernel + +open scoped commutatorElement + +variable {G H Q : Type*} [Group G] [Group H] [Group Q] + +theorem subgroup_fg_map (f : G →* H) {K : Subgroup G} (hK : K.FG) : (K.map f).FG := by + obtain ⟨S,hS,hSf⟩ := (Subgroup.fg_iff K).mp hK + apply (Subgroup.fg_iff _).mpr + exact ⟨f '' S, by rw [← MonoidHom.map_closure, hS], hSf.image f⟩ + +theorem group_fg_of_kernel_quotient (f : G →* H) (hf : Function.Surjective f) + (hker : f.ker.FG) [Group.FG H] : Group.FG G := by + classical + obtain ⟨S,hS,hSf⟩ := Group.fg_iff.mp (inferInstance : Group.FG H) + let a : H → G := fun y => (hf y).choose + have ha (y : H) : f (a y) = y := (hf y).choose_spec + let T := Subgroup.closure (a '' S) + have hTf : T.FG := (Subgroup.fg_iff T).mpr ⟨a '' S,rfl,hSf.image a⟩ + have hm : T.map f = ⊤ := by + change (Subgroup.closure (a '' S)).map f = ⊤ + rw [MonoidHom.map_closure,Set.image_image] + have he : (fun y => f (a y)) = id := funext ha + rw [he,Set.image_id,hS] + have htop : T ⊔ f.ker = ⊤ := by + apply (Subgroup.eq_top_iff' _).mpr + intro x + obtain ⟨y,hy,hyx⟩ := Subgroup.mem_map.mp (hm.symm ▸ Subgroup.mem_top (f x)) + have hd : y⁻¹*x ∈ f.ker := by + change f (y⁻¹*x) = 1 + simp [hyx] + have hh := (T ⊔ f.ker).mul_mem ((show T ≤ T ⊔ f.ker from le_sup_left) hy) + ((show f.ker ≤ T ⊔ f.ker from le_sup_right) hd) + simpa using hh + exact Group.fg_def.mpr (htop ▸ hTf.sup hker) + +theorem subgroup_fg_of_comm {A : Type*} [CommGroup A] [Group.FG A] (K : Subgroup A) : K.FG := by + let : Module.Finite ℤ (Additive A) := + Module.Finite.iff_addGroup_fg.mpr (inferInstance : AddGroup.FG (Additive A)) + apply (Subgroup.fg_iff_add_fg K).mpr + exact (Submodule.fg_iff_addSubgroup_fg (AddSubgroup.toIntSubmodule K.toAddSubgroup)).mp + (IsNoetherian.noetherian _) + +theorem perfect_lift_range [Group.IsPerfect G] (l : G →* H) (q : H →* Q) + (hq : Function.Surjective (q.comp l)) (hc : q.ker ≤ Subgroup.center H) : + l.range = commutator H := by + apply le_antisymm + · have he : l.range = ⁅l.range,l.range⁆ := by + rw [← map_commutator_eq,Group.IsPerfect.commutator_eq_top,← MonoidHom.range_eq_map] + rw [he,commutator_def] + exact Subgroup.commutator_mono le_top le_top + · rw [commutator_def] + apply Subgroup.commutator_le.mpr + intro x _ y _ + obtain ⟨u,hu⟩ := hq (q x) + obtain ⟨v,hv⟩ := hq (q y) + change q (l u) = q x at hu + change q (l v) = q y at hv + have hx : (l u)⁻¹*x ∈ Subgroup.center H := hc (by + change q ((l u)⁻¹*x) = 1 + simpa only [map_mul,map_inv,MonoidHom.comp_apply] using + (show (q (l u))⁻¹*q x = 1 by rw [hu]; simp)) + have hy : (l v)⁻¹*y ∈ Subgroup.center H := hc (by + change q ((l v)⁻¹*y) = 1 + simpa only [map_mul,map_inv,MonoidHom.comp_apply] using + (show (q (l v))⁻¹*q y = 1 by rw [hv]; simp)) + have hex : x = l u*((l u)⁻¹*x) := by simp + have hey : y = l v*((l v)⁻¹*y) := by simp + have hz (a : H) : ⁅(l u)⁻¹*x,a⁆ = 1 := + commutatorElement_eq_one_iff_mul_comm.mpr ((Subgroup.mem_center_iff.mp hx a).symm) + have hw (a : H) : ⁅a,(l v)⁻¹*y⁆ = 1 := + commutatorElement_eq_one_iff_mul_comm.mpr (Subgroup.mem_center_iff.mp hy a) + have he : ⁅x,y⁆ = ⁅l u,l v⁆ := by + conv_lhs => rw [hex,hey] + rw [commutatorElement_mul_left_eq_conj_mul,hz] + simp only [mul_one,mul_inv_cancel,one_mul] + rw [commutatorElement_mul_right_eq_mul_conj,hw] + simp only [mul_one,mul_inv_cancel_right] + rw [he] + exact ⟨⁅u,v⁆,map_commutatorElement l u v⟩ + +theorem central_kernel_fg_of_universal [Group.IsPerfect Q] [Group.FG H] + [Group.FG (universalProjection Q).ker] (q : H →* Q) + (hq : Function.Surjective q) (hc : q.ker ≤ Subgroup.center H) : Group.FG q.ker := by + let l := universalLift q hq hc (MonoidHom.id Q) + have hl : q.comp l = universalProjection Q := by + simpa only [l,MonoidHom.id_comp] using universalLift_spec q hq hc (MonoidHom.id Q) + have hls : Function.Surjective (q.comp l) := hl ▸ universalProjection_surjective Q + have hr : l.range = commutator H := perfect_lift_range l q hls hc + let f : q.ker →* Abelianization H := Abelianization.of.comp q.ker.subtype + let t : (universalProjection Q).ker →* f.ker := + { toFun := fun u => ⟨⟨l u.val, by + change q (l u.val) = 1 + rw [← MonoidHom.comp_apply,hl] + exact u.property⟩, by + change Abelianization.of (l u.val) = 1 + apply MonoidHom.mem_ker.mp + rw [Abelianization.ker_of] + exact hr ▸ (show l u.val ∈ l.range from ⟨u.val,rfl⟩)⟩ + map_one' := by apply Subtype.ext; apply Subtype.ext; exact map_one l + map_mul' := by intro u v; apply Subtype.ext; apply Subtype.ext; exact map_mul l u.val v.val } + have ht : Function.Surjective t := by + intro x + have hx : x.val.val ∈ commutator H := by + rw [← Abelianization.ker_of] + exact x.property + obtain ⟨u,hu⟩ := hr.symm ▸ hx + have hup : u ∈ (universalProjection Q).ker := by + change universalProjection Q u = 1 + rw [← hl] + change q (l u) = 1 + rw [hu] + exact x.val.property + refine ⟨⟨u,hup⟩,?_⟩ + apply Subtype.ext + apply Subtype.ext + exact hu + have : Group.FG f.ker := Group.fg_of_surjective ht + have : Group.FG (Abelianization H) := by + change Group.FG (H ⧸ commutator H) + infer_instance + have : Group.FG f.range := (Group.fg_iff_subgroup_fg _).mpr (subgroup_fg_of_comm f.range) + apply group_fg_of_kernel_quotient f.rangeRestrict f.rangeRestrict_surjective + rw [MonoidHom.ker_rangeRestrict] + exact (Group.fg_iff_subgroup_fg _).mp inferInstance + +theorem finitelyPresented_of_central_cover [Group.IsPerfect Q] [Group.IsFinitelyPresented H] + [Group.FG (universalProjection Q).ker] (q : H →* Q) + (hq : Function.Surjective q) (hc : q.ker ≤ Subgroup.center H) : Group.IsFinitelyPresented Q := by + have : Group.FG H := by + obtain ⟨n,p,hp,_⟩ := (inferInstance : Group.IsFinitelyPresented H).out + exact Group.fg_of_surjective hp + have := central_kernel_fg_of_universal q hq hc + exact Group.IsFinitelyPresented.of_surjective q hq (Subgroup.IsFinitelyNormallyGenerated.of_FG _) + +end FiniteCentralKernel + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/FiniteSlotRefinement.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/FiniteSlotRefinement.lean new file mode 100644 index 0000000000000000000000000000000000000000..39ea47fdbffe6d96faa51e1ce74bfc857ea3d124 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/FiniteSlotRefinement.lean @@ -0,0 +1,276 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.InitialCoverSystem +import OAI.GroupTheory.SimpleAmenable.CentralCovers.CanonicalSlotStars +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.PeriodicSlotStars + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section FiniteSlotRefinement + +theorem polygon_finite_cover_induction {a : ℕ} (P : polygonAlgebra a → Prop) + (hbot : P ⊥) + (hunion : ∀ U W : polygonAlgebra a, Disjoint U.val W.val → P U → P W → P (U ⊔ W)) + (s : Finset (polygonAlgebra a)) (V : polygonAlgebra a) + (hcover : V ≤ s.sup id) + (hlocal : ∀ U ∈ s, ∀ W : polygonAlgebra a, W ≤ U → P W) : P V := by + classical + induction s using Finset.induction_on generalizing V with + | empty => + have he : V=⊥ := le_antisymm (by simpa using hcover) bot_le + simpa only [he] using hbot + | @insert U s hUs ih => + have hleft : P (V ⊓ U) := hlocal U (Finset.mem_insert_self _ _) _ inf_le_right + have hright : P (V ⊓ Uᶜ) := by + apply ih (V ⊓ Uᶜ) + · intro x hx + have hc := hcover hx.1 + rw [Finset.sup_insert] at hc + exact hc.resolve_left hx.2 + · intro W hW Z hZ + exact hlocal W (Finset.mem_insert_of_mem hW) Z hZ + have hd : Disjoint (V ⊓ U).val (V ⊓ Uᶜ).val := Set.disjoint_left.mpr (by + intro x hx hy + exact hy.2 hx.2) + have he : (V ⊓ U) ⊔ (V ⊓ Uᶜ)=V := by + ext x + change (x∈V.val ∧ x∈U.val) ∨ (x∈V.val ∧ x∉U.val) ↔ x∈V.val + tauto + rw [← he] + exact hunion _ _ hd hleft hright + +theorem polygon_mem_finset_inf {a : ℕ} {ι : Type*} (s : Finset ι) + (f : ι → polygonAlgebra a) (x : GenericSquare a) : + x∈(s.inf f).val ↔ ∀ j∈s, x∈(f j).val := by + classical + induction s using Finset.induction_on with + | empty => simp only [Finset.inf_empty,Finset.notMem_empty,IsEmpty.forall_iff,implies_true] + exact iff_true_intro (Set.mem_univ x) + | @insert j s hjs ih => + rw [Finset.inf_insert] + change x∈(f j).val ∧ x∈(s.inf f).val ↔ _ + rw [ih] + simp only [Finset.mem_insert,forall_eq_or_imp] + +theorem finite_slot_chart_cover {a m : ℕ} (f : TrackPoint a m → TrackPoint a m) + (hf : HasTranslationTable f) (V : polygonAlgebra a) + (i : Fin 5 → Fin m) (u : Fin 5 → CutRing × CutRing) : + ∃ s : Finset (polygonAlgebra a), V ≤ s.sup id ∧ + ∀ W ∈ s, ∃ (k : Fin 5 → Fin m) (v : Fin 5 → CutRing × CutRing), + ∀ (j : Fin 5) (x : W.val), + f (i j,translate a (u j) x.val)=(k j,translate a (v j) x.val) := by + classical + obtain ⟨t,ht,hcover⟩ := hf + let cell : (Fin 5 → t) → polygonAlgebra a := fun c => + V ⊓ (Finset.univ : Finset (Fin 5)).inf (fun j => + if (c j).val.source=i j then + ⟨translate a (u j) ⁻¹' (c j).val.domain.val, + polygon_preimage_translate _ (c j).val.domain.property⟩ else ⊥) + have hcell (c : Fin 5 → t) (x : GenericSquare a) : x∈(cell c).val ↔ + x∈V.val ∧ ∀ j, (c j).val.source=i j ∧ translate a (u j) x∈(c j).val.domain.val := by + change x∈V.val ∧ x∈((Finset.univ : Finset (Fin 5)).inf _ : polygonAlgebra a).val ↔ _ + rw [polygon_mem_finset_inf] + simp only [Finset.mem_univ,true_implies] + apply and_congr_right + intro _ + apply forall_congr' + intro j + by_cases he : (c j).val.source=i j <;> simp [he] + refine ⟨Finset.univ.image cell,?_,?_⟩ + · intro x hx + have hchoice : ∀ j : Fin 5, ∃ c : t, c.val.source=i j ∧ + translate a (u j) x∈c.val.domain.val := by + intro j + obtain ⟨c,hc,hci,hcx⟩ := hcover (i j,translate a (u j) x) + exact ⟨⟨c,hc⟩,hci.symm,hcx⟩ + choose c hc using hchoice + have hxcell : x∈(cell c).val := (hcell c x).mpr ⟨hx,hc⟩ + have hh : cell c ≤ (Finset.univ.image cell).sup id := + Finset.le_sup (f := id) (s := Finset.univ.image cell) (b := cell c) + (Finset.mem_image.mpr ⟨c,Finset.mem_univ _,rfl⟩) + exact hh hxcell + · intro W hW + obtain ⟨c,_,rfl⟩ := Finset.mem_image.mp hW + refine ⟨fun j => (c j).val.target,fun j => (c j).val.shift+u j,?_⟩ + intro j x + have hx := ((hcell c x.val).mp x.property).2 j + rw [← hx.1,ht (c j).val (c j).property _ hx.2,translate_add] + +end FiniteSlotRefinement + +section SlotTransportClosure + +theorem SlotMap_injective_of_transport {a m : ℕ} (V : polygonAlgebra a) + (i k : Fin 5 → Fin m) (u v : Fin 5 → CutRing × CutRing) + (f : TrackPoint a m → TrackPoint a m) (hf : Function.Injective f) + (hi : Function.Injective (SlotMap a m V (fun j => (i j,u j)))) + (htr : ∀ (j : Fin 5) (x : V.val), + f (i j,translate a (u j) x.val)=(k j,translate a (v j) x.val)) : + Function.Injective (SlotMap a m V (fun j => (k j,v j))) := by + have he : SlotMap a m V (fun j => (k j,v j))=f ∘ SlotMap a m V (fun j => (i j,u j)) := by + funext p + exact (htr p.1 p.2).symm + rw [he] + exact hf.comp hi + +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + (hlarge : 15 < m+1) (h : B.AllPrimitiveLaws) (hr : 0 (i j,u j)) )) + (hk : Function.Injective (SlotMap a (m+1) V (fun j => (k j,v j)) )), + (MulAut.conj z).toMonoidHom.comp (B.slotStar hlarge h hr hwide V i u hi) = + B.slotStar hlarge h hr hwide V k v hk + +def UniformSlotTransport (z : BoundedRelationCover M (alternatingGenerator a r m hm)) : Prop := + ∀ (V : polygonAlgebra a) (i k : Fin 5 → Fin (m+1)) (u v : Fin 5 → CutRing × CutRing), + (∀ (j : Fin 5) (x : V.val), + (coverMap M (alternatingGenerator a r m hm) z).val.val (i j,translate a (u j) x.val)= + (k j,translate a (v j) x.val)) → + B.ExactSlotTransport hlarge h hr hwide z V i k u v + +variable (R : alternatingGroup (Fin (m+1)) → + Multiplicative (FreeAbelianGroup (Fin m × Fin 2)) →* + Multiplicative (FreeAbelianGroup (Fin m × Fin 2))) + (hR : ∀ s k, B.c s * B.t k * (B.c s)⁻¹ = B.t (R s k)) +include R hR + +theorem exactSlotTransport_empty (z : BoundedRelationCover M (alternatingGenerator a r m hm)) + (i k : Fin 5 → Fin (m+1)) (u v : Fin 5 → CutRing × CutRing) : + B.ExactSlotTransport hlarge h hr hwide z ⊥ i k u v := by + intro hi hk + rw [B.slotStar_empty hlarge h hr R hR hwide,B.slotStar_empty hlarge h hr R hR hwide] + ext s : 1 + simp + +theorem exactSlotTransport_union (z : BoundedRelationCover M (alternatingGenerator a r m hm)) + (V W : polygonAlgebra a) (i k : Fin 5 → Fin (m+1)) (u v : Fin 5 → CutRing × CutRing) + (hd : Disjoint V.val W.val) + (hV : B.ExactSlotTransport hlarge h hr hwide z V i k u v) + (hW : B.ExactSlotTransport hlarge h hr hwide z W i k u v) : + B.ExactSlotTransport hlarge h hr hwide z (V ⊔ W) i k u v := by + intro hi hk + ext s : 1 + change (MulAut.conj z).toMonoidHom (B.slotStar hlarge h hr hwide (V ⊔ W) i u hi s)=_ + rw [B.slotStar_union hlarge h hr R hR hwide V W i u hi hd,map_mul, + B.slotStar_union hlarge h hr R hR hwide V W k v hk hd] + rw [show (MulAut.conj z).toMonoidHom (B.slotStar hlarge h hr hwide V i u + (SlotMap_injective_mono _ le_sup_left hi) s)=_ from + DFunLike.congr_fun (hV _ _) s] + rw [show (MulAut.conj z).toMonoidHom (B.slotStar hlarge h hr hwide W i u + (SlotMap_injective_mono _ le_sup_right hi) s)=_ from + DFunLike.congr_fun (hW _ _) s] + +theorem exactSlotTransport_cover (z : BoundedRelationCover M (alternatingGenerator a r m hm)) + (V : polygonAlgebra a) (i k : Fin 5 → Fin (m+1)) (u v : Fin 5 → CutRing × CutRing) + (s : Finset (polygonAlgebra a)) (hs : V ≤ s.sup id) + (hl : ∀ W∈s, ∀ Z : polygonAlgebra a, Z≤W → Z≤V → + B.ExactSlotTransport hlarge h hr hwide z Z i k u v) : + B.ExactSlotTransport hlarge h hr hwide z V i k u v := by + have hp : ∀ hV : V≤V, B.ExactSlotTransport hlarge h hr hwide z V i k u v := by + refine polygon_finite_cover_induction + (fun W => W≤V → B.ExactSlotTransport hlarge h hr hwide z W i k u v) + (fun _ => B.exactSlotTransport_empty hlarge h hr hwide R hR z i k u v) ?_ s V hs ?_ + · intro U W hd hU hW he + exact B.exactSlotTransport_union hlarge h hr hwide R hR z U W i k u v hd + (hU (le_trans le_sup_left he)) (hW (le_trans le_sup_right he)) + · exact hl + exact hp le_rfl + +theorem uniformSlotTransport_one : + B.UniformSlotTransport hlarge h hr hwide 1 := by + intro V i k u v htr hi hk + have he := B.slotStar_parameterwise hlarge h hr R hR hwide V i k u v hi hk (by + intro j x + simpa only [map_one,Subgroup.coe_one,Equiv.Perm.one_apply] using htr j x) + rw [← he] + ext s : 1 + simp + +omit R hR in +theorem uniformSlotTransport_inv + (z : BoundedRelationCover M (alternatingGenerator a r m hm)) + (hz : B.UniformSlotTransport hlarge h hr hwide z) : + B.UniformSlotTransport hlarge h hr hwide z⁻¹ := by + intro V i k u v htr hi hk + have htr' : ∀ (j : Fin 5) (x : V.val), + (coverMap M (alternatingGenerator a r m hm) z).val.val (k j,translate a (v j) x.val)= + (i j,translate a (u j) x.val) := by + intro j x + have hh := congrArg (coverMap M (alternatingGenerator a r m hm) z).val.val (htr j x) + simpa only [map_inv,Subgroup.coe_inv,Equiv.Perm.inv_def,Equiv.apply_symm_apply] using hh.symm + have he := hz V k i v u htr' hk hi + ext s : 1 + have hh := DFunLike.congr_fun he s + change z*B.slotStar hlarge h hr hwide V k v hk s*z⁻¹= + B.slotStar hlarge h hr hwide V i u hi s at hh + change z⁻¹*B.slotStar hlarge h hr hwide V i u hi s*(z⁻¹)⁻¹=_ + rw [← hh] + group + +theorem uniformSlotTransport_mul + (z y : BoundedRelationCover M (alternatingGenerator a r m hm)) + (hz : B.UniformSlotTransport hlarge h hr hwide z) + (hy : B.UniformSlotTransport hlarge h hr hwide y) : + B.UniformSlotTransport hlarge h hr hwide (z*y) := by + intro V i k u v htr + obtain ⟨s,hs,hcharts⟩ := finite_slot_chart_cover + (coverMap M (alternatingGenerator a r m hm) y).val.val + (coverMap M (alternatingGenerator a r m hm) y).val.property V i u + apply B.exactSlotTransport_cover hlarge h hr hwide R hR (z*y) V i k u v s hs + intro W hW Z hZW hZV hi hk + obtain ⟨l,b,hl⟩ := hcharts W hW + have hytr : ∀ (j : Fin 5) (x : Z.val), + (coverMap M (alternatingGenerator a r m hm) y).val.val (i j,translate a (u j) x.val)= + (l j,translate a (b j) x.val) := fun j x => hl j ⟨x.val,hZW x.property⟩ + have hl_inj := SlotMap_injective_of_transport Z i l u b _ + (coverMap M (alternatingGenerator a r m hm) y).val.val.injective hi hytr + have hztr : ∀ (j : Fin 5) (x : Z.val), + (coverMap M (alternatingGenerator a r m hm) z).val.val (l j,translate a (b j) x.val)= + (k j,translate a (v j) x.val) := by + intro j x + have hh := htr j ⟨x.val,hZV x.property⟩ + rw [map_mul] at hh + change (coverMap M (alternatingGenerator a r m hm) z).val.val + ((coverMap M (alternatingGenerator a r m hm) y).val.val (i j,translate a (u j) x.val))=_ at hh + rw [hytr j x] at hh + exact hh + have he_y := hy Z i l u b hytr hi hl_inj + have he_z := hz Z l k b v hztr hl_inj hk + ext t : 1 + have ey := DFunLike.congr_fun he_y t + have ez := DFunLike.congr_fun he_z t + change y*B.slotStar hlarge h hr hwide Z i u hi t*y⁻¹= + B.slotStar hlarge h hr hwide Z l b hl_inj t at ey + change z*B.slotStar hlarge h hr hwide Z l b hl_inj t*z⁻¹= + B.slotStar hlarge h hr hwide Z k v hk t at ez + change (z*y)*B.slotStar hlarge h hr hwide Z i u hi t*(z*y)⁻¹=_ + calc + _ = z*(y*B.slotStar hlarge h hr hwide Z i u hi t*y⁻¹)*z⁻¹ := by group + _ = _ := by rw [ey,ez] + +def slotTransportSubgroup : Subgroup (BoundedRelationCover M (alternatingGenerator a r m hm)) where + carrier := B.UniformSlotTransport hlarge h hr hwide + one_mem' := B.uniformSlotTransport_one hlarge h hr hwide R hR + mul_mem' := fun {z y} => B.uniformSlotTransport_mul hlarge h hr hwide R hR z y + inv_mem' := fun {z} => B.uniformSlotTransport_inv hlarge h hr hwide z + +end InitialCoverSystem +end SlotTransportClosure + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/FinitelyManyTranslationRelations.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/FinitelyManyTranslationRelations.lean new file mode 100644 index 0000000000000000000000000000000000000000..39cc5cd88711a120f2c4a89881fb0da000e7d6d1 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/FinitelyManyTranslationRelations.lean @@ -0,0 +1,131 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Configurations.TrackTranslationChart +import OAI.GroupTheory.SimpleAmenable.CentralCovers.BoundedRelationCover + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +section FinitelyManyTranslationRelations + +open scoped IsMulCommutative + +variable {β H : Type*} [Group H] + +noncomputable def commutingFamilyHom (t : β → H) (ht : ∀ i j, Commute (t i) (t j)) : + Multiplicative (FreeAbelianGroup β) →* H := by + let C := Subgroup.closure (Set.range t) + haveI : IsMulCommutative C := Subgroup.isMulCommutative_closure (by + rintro x ⟨i,rfl⟩ y ⟨j,rfl⟩ _ + exact ht i j) + letI : CommGroup C := by infer_instance + exact C.subtype.comp (AddMonoidHom.toMultiplicativeLeft + (FreeAbelianGroup.lift (fun i => Additive.ofMul (⟨t i,Subgroup.subset_closure ⟨i,rfl⟩⟩ : C)))) + +@[simp] theorem commutingFamilyHom_of (t : β → H) (ht : ∀ i j, Commute (t i) (t j)) + (i : β) : commutingFamilyHom t ht (Multiplicative.ofAdd (FreeAbelianGroup.of i)) = t i := by + simp [commutingFamilyHom] + +theorem freeAbelianHom_ext (φ ψ : Multiplicative (FreeAbelianGroup β) →* H) + (h : ∀ i, φ (Multiplicative.ofAdd (FreeAbelianGroup.of i)) = + ψ (Multiplicative.ofAdd (FreeAbelianGroup.of i))) : φ = ψ := by + apply MonoidHom.ext + intro x + change φ (Multiplicative.ofAdd (Multiplicative.toAdd x)) = ψ (Multiplicative.ofAdd (Multiplicative.toAdd x)) + induction Multiplicative.toAdd x using FreeAbelianGroup.induction_on with + | zero => exact (map_one φ).trans (map_one ψ).symm + | of i => exact h i + | neg x hx => + change φ ((Multiplicative.ofAdd (FreeAbelianGroup.of x))⁻¹) = ψ ((Multiplicative.ofAdd (FreeAbelianGroup.of x))⁻¹) + rw [map_inv, map_inv, hx] + | add x y hx hy => + change φ (Multiplicative.ofAdd x * Multiplicative.ofAdd y) = ψ (Multiplicative.ofAdd x * Multiplicative.ofAdd y) + rw [map_mul, map_mul, hx, hy] + +theorem commutingFamilyHom_range (t : β → H) (ht : ∀ i j, Commute (t i) (t j)) : + (commutingFamilyHom t ht).range = Subgroup.closure (Set.range t) := by + apply le_antisymm + · rintro _ ⟨x,rfl⟩ + exact Subtype.property _ + · apply (Subgroup.closure_le _).mpr + rintro _ ⟨i,rfl⟩ + exact ⟨_,commutingFamilyHom_of t ht i⟩ + +theorem commutingFamilyHom_commute (t : β → H) (ht : ∀ i j, Commute (t i) (t j)) + {g : H} (hg : ∀ i, Commute (t i) g) (v : Multiplicative (FreeAbelianGroup β)) : + Commute (commutingFamilyHom t ht v) g := by + have hc : Subgroup.closure (Set.range t) ≤ Subgroup.centralizer {g} := by + apply (Subgroup.closure_le _).mpr + rintro x ⟨i,rfl⟩ + exact Subgroup.mem_centralizer_singleton_iff.mpr (hg i).eq + have hm : commutingFamilyHom t ht v ∈ Subgroup.closure (Set.range t) := by + rw [← commutingFamilyHom_range t ht] + exact ⟨v,rfl⟩ + exact Subgroup.mem_centralizer_singleton_iff.mp (hc hm) + +variable {α G : Type*} [Group G] (f : α → G) + +theorem finite_word_equalities_eventually [Finite β] (u v : β → FreeGroup α) + (huv : ∀ i, FreeGroup.lift f (u i) = FreeGroup.lift f (v i)) : + ∃ L : ℕ, ∀ M : ℕ, L ≤ M → ∀ i, + PresentedGroup.mk (shortRelations M f) (u i) = + PresentedGroup.mk (shortRelations M f) (v i) := by + obtain ⟨L,hL⟩ := finite_true_relations_bounded f + (Set.finite_range (fun i => u i * (v i)⁻¹)) (by + rintro w ⟨i,rfl⟩ + simp [huv]) + refine ⟨L,fun M hM i => ?_⟩ + exact PresentedGroup.mk_eq_mk_of_mul_inv_mem + (shortRelations_mono f hM (hL ⟨i,rfl⟩)) + +theorem finite_table_with_inputs_eventually {T : Type*} [Group T] [Finite T] + [Finite β] (φ : T →* G) (input : β → T) (w : β → FreeGroup α) + (hw : ∀ i, FreeGroup.lift f (w i) = φ (input i)) + (hf : Function.Surjective (FreeGroup.lift f)) : + ∃ L : ℕ, ∀ M : ℕ, L ≤ M → ∃ ρ : T →* BoundedRelationCover M f, + (coverMap M f).comp ρ = φ ∧ + ∀ i, ρ (input i) = PresentedGroup.mk (shortRelations M f) (w i) := by + choose W hW using fun t : T => hf (φ t) + obtain ⟨L₁,hL₁⟩ := finite_table_lift_eventually f φ W hW + obtain ⟨L₂,hL₂⟩ := finite_word_equalities_eventually f (fun i => W (input i)) w + (fun i => (hW (input i)).trans (hw i).symm) + refine ⟨max L₁ L₂,fun M hM => ?_⟩ + obtain ⟨ρ,hρ,hρW⟩ := hL₁ M (le_trans (le_max_left _ _) hM) + refine ⟨ρ,hρ,fun i => ?_⟩ + rw [hρW, hL₂ M (le_trans (le_max_right _ _) hM)] + +theorem commuting_words_lift_eventually [Finite β] (w : β → FreeGroup α) + (ht : ∀ i j, Commute (FreeGroup.lift f (w i)) (FreeGroup.lift f (w j))) : + ∃ L : ℕ, ∀ M : ℕ, L ≤ M → + ∃ t : Multiplicative (FreeAbelianGroup β) →* BoundedRelationCover M f, + (∀ i, t (Multiplicative.ofAdd (FreeAbelianGroup.of i)) = + PresentedGroup.mk (shortRelations M f) (w i)) ∧ + (coverMap M f).comp t = + commutingFamilyHom (fun i => FreeGroup.lift f (w i)) ht := by + obtain ⟨L,hL⟩ := finite_word_equalities_eventually f + (fun p : β × β => w p.1 * w p.2) (fun p => w p.2 * w p.1) + (fun p => by simpa only [map_mul] using (ht p.1 p.2).eq) + refine ⟨L,fun M hM => ?_⟩ + let u : β → BoundedRelationCover M f := fun i => PresentedGroup.mk (shortRelations M f) (w i) + have hu : ∀ i j, Commute (u i) (u j) := by + intro i j + have he := hL M hM (i,j) + exact show u i * u j = u j * u i from by simpa only [map_mul] using he + refine ⟨commutingFamilyHom u hu, fun i => commutingFamilyHom_of u hu i, ?_⟩ + apply freeAbelianHom_ext + intro i + simp [u] + +end FinitelyManyTranslationRelations + +def SourceCoverCentrality (a : ℕ) (r : CutRing) (m : ℕ) (hm : 2 ≤ m) : Prop := + ∃ L : ℕ, (coverMap L (alternatingGenerator a r m hm)).ker ≤ + Subgroup.center (BoundedRelationCover L (alternatingGenerator a r m hm)) + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/FormalCoordinates.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/FormalCoordinates.lean new file mode 100644 index 0000000000000000000000000000000000000000..a83d0b0d9784710e101c0ca1b0fc169eab9328e9 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/FormalCoordinates.lean @@ -0,0 +1,235 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.PairControl + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section FormalCoordinates +variable {S Q Ω : Type*} [Group S] [Group Q] [DecidableEq Ω] + +theorem coordinateFactors (φ : (Ω → S) →* Q) (hφ : Function.Surjective φ) (ω : Ω) : + CommutingFactors ((φ.comp (MonoidHom.mulSingle (fun _ : Ω => S) ω)).range) + ((φ.comp (assignmentRestriction (fun _ : Ω => S) {ν | ν ≠ ω})).range) := by + classical + constructor + · rintro x ⟨s,rfl⟩ y ⟨t,rfl⟩ + change Commute (φ (Pi.mulSingle ω s)) (φ (assignmentRestriction (fun _ : Ω => S) {ν | ν ≠ ω} t)) + apply Commute.map _ φ + ext ν + by_cases hν : ν = ω + · subst ν; simp [assignmentRestriction] + · simp [assignmentRestriction,hν] + · intro x + obtain ⟨s,rfl⟩ := hφ x + refine ⟨φ (Pi.mulSingle ω (s ω)),⟨s ω,rfl⟩, + φ (assignmentRestriction (fun _ : Ω => S) {ν | ν ≠ ω} s),⟨s,rfl⟩,?_⟩ + rw [← map_mul] + congr 1 + ext ν + by_cases hν : ν = ω + · subst ν; simp [assignmentRestriction] + · simp [assignmentRestriction,hν] + +noncomputable def coordinateProjection (φ : (Ω → S) →* Q) (hφ : Function.Surjective φ) + (hz : Subgroup.center Q = ⊥) (ω : Ω) : Q →* Q := + (coordinateFactors φ hφ ω).projectLeft hz + +theorem coordinateProjection_apply (φ : (Ω → S) →* Q) (hφ : Function.Surjective φ) + (hz : Subgroup.center Q = ⊥) (ω : Ω) (s : Ω → S) : + coordinateProjection φ hφ hz ω (φ s) = φ (Pi.mulSingle ω (s ω)) := by + classical + have he : s = Pi.mulSingle ω (s ω)*assignmentRestriction (fun _ : Ω => S) {ν | ν ≠ ω} s := by + ext ν + by_cases hν : ν = ω + · subst ν; simp [assignmentRestriction] + · simp [assignmentRestriction,hν] + change (coordinateFactors φ hφ ω).projectLeft hz (φ s) = _ + conv_lhs => rw [he,map_mul] + exact (coordinateFactors φ hφ ω).projectLeft_factors hz ⟨s ω,rfl⟩ ⟨s,rfl⟩ + +theorem formalMap_kill_of_actual [Finite Ω] + (φ : (Ω → S) →* Q) (U : Set Ω) + (hexcluded : ∀ ω, ω ∉ U → ∀ s, φ (Pi.mulSingle ω s) = 1) + (f : Ω → S) (hf : ∀ ω ∈ U, f ω = 1) : φ f = 1 := by + classical + apply (Submonoid.pi_mem_of_mulSingle_mem (H := φ.ker) f) + intro ω + by_cases hω : ω ∈ U + · change φ (Pi.mulSingle ω (f ω)) = 1 + rw [hf ω hω,Pi.mulSingle_one,map_one] + · exact hexcluded ω hω (f ω) + +end FormalCoordinates + +section CodRestrictGeneration +variable {E G ι : Type*} [Group E] [Group G] + +theorem codRestrict_iSup_top (F : ι → E →* G) (K : Subgroup G) + (hm : ∀ i s, F i s ∈ K) (hgen : (⨆ i, (F i).range : Subgroup G) = K) : + (⨆ i, (MonoidHom.codRestrict (F i) K (hm i)).range : Subgroup K) = ⊤ := by + apply (Subgroup.map_injective K.subtype_injective) + rw [Subgroup.map_iSup] + have he (i : ι) : Subgroup.map K.subtype ((MonoidHom.codRestrict (F i) K (hm i)).range) = (F i).range := by + rw [← MonoidHom.range_comp] + rfl + simp only [he] + rw [hgen,← MonoidHom.range_eq_map,K.range_subtype] + +end CodRestrictGeneration + +section PairFormalLaw +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) {ι : Type*} [Fintype ι] + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + (hlarge : 15 < m+1) (P : ι → Fin 5 × (CutRing × CutRing)) + (h : ∀ i j I, I.card ≤ 15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb (primitivePair P i j)) + +noncomputable def pairCarrierStar (j : Option ι) : TrackStar (Fin (m+1)) →* + (smallFamilyEval (B.smallPrimitiveInputs hlarge P)).range := + (B.pairStar hlarge P h j).codRestrict _ (B.pairStar_mem hlarge P h j) + +noncomputable def pairCarrierConstant : alternatingGroup (Fin (m+1)) →* + (smallFamilyEval (B.smallPrimitiveInputs hlarge P)).range := + B.c.codRestrict _ (fun s => B.constant_range_full hlarge P ⟨s,rfl⟩) + +theorem pair_formal_quotient (h20 : 20 ≤ m+1) : + ∃ φ : ((ι → Bool) → alternatingGroup (Fin (m+1))) →* + ((smallFamilyEval (B.smallPrimitiveInputs hlarge P)).range ⧸ + Subgroup.center (smallFamilyEval (B.smallPrimitiveInputs hlarge P)).range), + Function.Surjective φ ∧ + φ.comp (sectorMask Set.univ) = (QuotientGroup.mk' _).comp (B.pairCarrierConstant hlarge P) ∧ + ∀ i, (φ.comp (sectorMask {σ | σ i = true})).comp + (universalProjection (alternatingGroup (Fin (m+1)))) = + (QuotientGroup.mk' _).comp (B.pairCarrierStar hlarge P h (some i)) := by + let : Group.IsPerfect (smallFamilyEval (B.smallPrimitiveInputs hlarge P)).range := + smallFamilyEval_perfect _ + let L := fun i j => (B.pairSplit hlarge P h i j true).codRestrict _ + (B.pairSplit_mem hlarge P h i j true) + let R := fun i j => (B.pairSplit hlarge P h i j false).codRestrict _ + (B.pairSplit_mem hlarge P h i j false) + apply star_split_assignment (universalProjection (alternatingGroup (Fin (m+1)))) + (universalProjection_surjective _) (B.pairCarrierConstant hlarge P) + (B.pairCarrierStar hlarge P h) rfl + (codRestrict_iSup_top _ _ (B.pairStar_mem hlarge P h) (B.pairStar_range hlarge P h)) L R + · intro i j s + apply Subtype.ext + exact B.pairStar_split hlarge P h i j s + · intro i j k s t + apply Subtype.ext + exact (B.pairSplit_commute hlarge P h h20 i j k s t).eq + · intro i + ext s + exact congrArg (fun f : TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm) => f s) + (B.pairSplit_whole_left hlarge P h i) + +end InitialCoverSystem +end PairFormalLaw + +section StarFormalComponents +variable {E S G ι κ Ω : Type*} [Group E] [Group S] [Group G] + [Finite ι] [DecidableEq (ι → Bool)] [Group.IsPerfect G] + (π : E →* S) (c : S →* G) (F : Option ι → E →* G) + (hc : F none = c.comp π) + (φ : ((ι → Bool) → S) →* (G ⧸ Subgroup.center G)) + (hφ : Function.Surjective φ) + (hφc : φ.comp (sectorMask Set.univ) = (QuotientGroup.mk' _).comp c) + (hφi : ∀ i, (φ.comp (sectorMask {σ | σ i = true})).comp π = + (QuotientGroup.mk' _).comp (F (some i))) + +include hc hφc hφi in +omit [Finite ι] [DecidableEq (ι → Bool)] [Group.IsPerfect G] in +theorem star_formal_eval : (QuotientGroup.mk' _).comp (copyFamilyEval F) = + φ.comp (formalAssignmentEval π) := by + apply FreeGroup.ext_hom + rintro ⟨i,s⟩ + cases i with + | none => + simp only [MonoidHom.comp_apply,copyFamilyEval_of,formalAssignmentEval,copySourceMap, + FreeGroup.map.of,assignmentEval,maskFamily] + rw [hc] + exact (DFunLike.congr_fun hφc (π s)).symm + | some i => + simp only [MonoidHom.comp_apply,copyFamilyEval_of,formalAssignmentEval,copySourceMap, + FreeGroup.map.of,assignmentEval,maskFamily] + exact (DFunLike.congr_fun (hφi i) s).symm + +noncomputable def formalCoordinateSource (σ : ι → Bool) : S →* (G ⧸ Subgroup.center G) := + φ.comp (MonoidHom.mulSingle (fun _ : ι → Bool => S) σ) + +noncomputable def formalCoordinateMap (σ : ι → Bool) : G →* (G ⧸ Subgroup.center G) := + (coordinateProjection φ hφ perfect_center_quotient σ).comp (QuotientGroup.mk' _) + +include hc hφc in +omit [Finite ι] in +theorem formalCoordinate_whole (σ : ι → Bool) : + (formalCoordinateMap φ hφ σ).comp (F none) = + (formalCoordinateSource φ σ).comp π := by + ext s + change coordinateProjection φ hφ perfect_center_quotient σ ((QuotientGroup.mk' _) (F none s)) = _ + rw [hc] + change coordinateProjection φ hφ perfect_center_quotient σ ((QuotientGroup.mk' _) (c (π s))) = _ + have he := DFunLike.congr_fun hφc (π s) + simp only [MonoidHom.comp_apply] at he + rw [← he] + simp [coordinateProjection_apply,formalCoordinateSource,sectorMask] + +include hφi in +omit [Finite ι] in +theorem formalCoordinate_input (σ : ι → Bool) (i : ι) (s : E) : + formalCoordinateMap φ hφ σ (F (some i) s) = + if σ i then formalCoordinateSource φ σ (π s) else 1 := by + change coordinateProjection φ hφ perfect_center_quotient σ ((QuotientGroup.mk' _) (F (some i) s)) = _ + have he := DFunLike.congr_fun (hφi i) s + simp only [MonoidHom.comp_apply] at he + rw [← he] + simp only [coordinateProjection_apply] + cases hs : σ i <;> simp [sectorMask,hs,formalCoordinateSource] + +include hc hφ hφc hφi in +omit [Finite ι] in +theorem formal_exclusion_of_subfamily [Finite κ] [Group.IsPerfect S] + (hπ : Function.Surjective π) (v : κ → ι) (σ : ι → Bool) (pattern : Ω → κ → Bool) + (hbad : σ ∘ v ∉ Set.range pattern) + (hlocal : ∀ w, ((assignmentPullback pattern).comp (formalAssignmentEval π)) w = 1 → + ∀ t, Commute (copyFamilyEval (fun j => F (j.map v)) w) (F none t)) : + ∀ s, φ (Pi.mulSingle σ s) = 1 := by + apply forbidden_factor_trivial π hπ (fun j => F (j.map v)) + (formalCoordinateMap φ hφ σ) (formalCoordinateSource φ σ) (σ ∘ v) pattern hbad + · exact formalCoordinate_whole π c F hc φ hφ hφc σ + · apply formal_component_of_inputs π + · exact formalCoordinate_whole π c F hc φ hφ hφc σ + · intro i s + exact formalCoordinate_input π F φ hφ hφi σ (v i) s + · exact hlocal + +omit [Group.IsPerfect G] in +include hc hφc hφi in +theorem formal_centralOn_of_exclusions {H : Type*} [Group H] + (q : G →* H) (U : Set (ι → Bool)) + (hgen : Function.Surjective (copyFamilyEval F)) + (hfaith : ∀ w, q (copyFamilyEval F w) = 1 → ∀ σ ∈ U, formalAssignmentEval π w σ = 1) + (hkill : ∀ σ, σ ∉ U → ∀ s, φ (Pi.mulSingle σ s) = 1) : + q.ker ≤ Subgroup.center G := by + classical + intro x hx + obtain ⟨w,rfl⟩ := hgen x + apply (QuotientGroup.eq_one_iff _).mp + have he := DFunLike.congr_fun (star_formal_eval π c F hc φ hφc hφi) w + rw [MonoidHom.comp_apply,MonoidHom.comp_apply] at he + change (QuotientGroup.mk' (Subgroup.center G)) (copyFamilyEval F w) = 1 + rw [he] + exact formalMap_kill_of_actual φ U hkill _ (hfaith w hx) + +end StarFormalComponents + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/FormalGridPieces.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/FormalGridPieces.lean new file mode 100644 index 0000000000000000000000000000000000000000..953aeab1aa6245d2e8aaa09d0864352e7b464d23 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/FormalGridPieces.lean @@ -0,0 +1,206 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.ControlledPatching +import OAI.GroupTheory.SimpleAmenable.CentralCovers.SmallFormalGlobal +import OAI.GroupTheory.SimpleAmenable.CentralCovers.SmallStarRelators +import OAI.GroupTheory.SimpleAmenable.CentralCovers.PrimitiveFormalSectors + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section FormalGridPieces +variable {α H ι D : Type*} [Fintype α] [DecidableEq α] [Group H] + [Group.IsPerfect (alternatingGroup α)] {κ : ι → Type*} + (F : (i : ι) → Option (κ i) → TrackStar α →* H) + (T : ∀ i, FormalStarTable (F i)) (U : (i : ι) → Set (κ i → Bool)) + (C : (i : ι) → D → Set (κ i → Bool)) + +noncomputable def formalGridInput (i : ι) : TrackStar α →* H := (T i).sector (U i) +noncomputable def formalGridPiece (d : D) (i : ι) : TrackStar α →* H := + (T i).sector (U i ∩ C i d) + +theorem formalGridInput_split (d : D) (i : ι) (s : TrackStar α) : + formalGridInput F T U i s=formalGridPiece F T U C d i s* + formalGridPiece F T U (fun i d => (C i d)ᶜ) d i s := by + have hd : Disjoint (U i ∩ C i d) (U i ∩ (C i d)ᶜ) := by + apply Set.disjoint_left.mpr + intro σ hs ht + exact ht.2 hs.2 + have he : (U i ∩ C i d) ∪ (U i ∩ (C i d)ᶜ)=U i := by + ext σ + simp only [Set.mem_union,Set.mem_inter_iff,Set.mem_compl_iff] + tauto + exact (congrArg (fun V => (T i).sector V s) he).symm.trans ((T i).sector_union hd s) + +theorem formalGridPiece_supported [∀ i, Finite (κ i)] (L : Finset α → Subgroup H) + (hF : ∀ i j, SmallSupported L (F i j)) (d : D) (i : ι) : + SmallSupported L (formalGridPiece F T U C d i) := + (T i).sector_supported L (hF i) _ + +theorem formalGridPiece_control (c : alternatingGroup α →* H) + (hc : ∀ i, F i none=c.comp (universalProjection _)) + (j : D → TrackStar α →* H) (hj : ∀ i d, (T i).sector (C i d)=j d) (d : D) (i : ι) : + SmallControlled c (formalGridPiece F T U C d i) (j d) := by + have hh := (T i).sector_control (show U i ∩ C i d ⊆ C i d from Set.inter_subset_right) + rw [hj,hc] at hh + intro I s x hx + exact hh (universalMap (subtypeAlternatingHom I.val) s) x hx + +theorem formalGridPieces_generate [Fintype D] + (hd : ∀ i, Pairwise fun d e => Disjoint (C i d) (C i e)) + (hcover : ∀ i σ, ∃ d, σ ∈ C i d) : + (⨆ i, (formalGridInput F T U i).range : Subgroup H) ≤ + ⨆ d, ⨆ i, (formalGridPiece F T U C d i).range := by + apply iSup_le + intro i + have hh := (T i).sector_range_le_partition (fun d => U i ∩ C i d) (U i) + (fun d e hde => (hd i hde).mono Set.inter_subset_right Set.inter_subset_right) + (fun σ => by + constructor + · intro hσ + obtain ⟨d,hd⟩ := hcover i σ + exact ⟨d,hσ,hd⟩ + · rintro ⟨d,hd⟩ + exact hd.1) + exact hh.trans (iSup_mono fun d => le_iSup (fun i => (formalGridPiece F T U C d i).range) i) + +theorem formalGridInputs_normalize [∀ i, Finite (κ i)] + (L : Finset α → Subgroup H) (c : alternatingGroup α →* H) + (h20 : 20 ≤ Fintype.card α) + (hconj : ∀ σ I, ∀ x ∈ L I, c σ*x*(c σ)⁻¹ ∈ L (I.map σ.val.toEmbedding)) + (hdis : ∀ I J, Disjoint I J → ∀ x ∈ L I, ∀ y ∈ L J, Commute x y) + (hF : ∀ i j, SmallSupported L (F i j)) + (hc : ∀ i, F i none=c.comp (universalProjection _)) + (j k : D → TrackStar α →* H) + (hj : ∀ i d, (T i).sector (C i d)=j d) + (hk : ∀ i d, (T i).sector (C i d)ᶜ=k d) + (hjs : ∀ d, SmallSupported L (j d)) + (hcomm : ∀ d s t, Commute (j d s) (k d t)) : + ∀ d i s, formalGridInput F T U i s ∈ + Subgroup.normalizer ((⨆ i, (formalGridPiece F T U C d i).range : Subgroup H) : Set H) := by + intro d + apply controlled_cell_normalizes L c hconj hdis h20 + (formalGridInput F T U) (formalGridPiece F T U C d) + (formalGridPiece F T U (fun i d => (C i d)ᶜ) d) (j d) (k d) + · exact formalGridPiece_supported F T U C L hF d + · exact formalGridPiece_supported F T U (fun i d => (C i d)ᶜ) L hF d + · exact hjs d + · exact formalGridPiece_control F T U C c hc j hj d + · exact formalGridPiece_control F T U (fun i d => (C i d)ᶜ) c hc k hk d + · exact hcomm d + · exact formalGridInput_split F T U C d + +end FormalGridPieces + +section PrimitiveRectangleMasks +namespace InitialCoverSystem.PatchAtlas +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + {B : InitialCoverSystem a r m hm M} + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] (A : B.PatchAtlas) + {ι κ D : Type*} [Finite ι] [Finite κ] [Nonempty D] + +theorem formalRectangleMasks (hlarge : 15 < m+1) + (P : ι → Fin 5 × (CutRing × CutRing)) (T : FormalStarTable (A.starFamily hlarge P)) + (v : κ → ι) + (h : ∀ I, I.card≤15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb (P ∘ v)) + (W : D → polygonAlgebra a) + (hW : ∀ d, ResolvedBy (fun i => (primitiveTests (a := a) (r := r) (P ∘ v) i).val) (W d).val) + (hcover : ∀ x, ∃ d, x ∈ (W d).val) + (hd : Pairwise fun d e => Disjoint (W d).val (W e).val) : + ∃ C : D → Set (ι → Bool), + (Pairwise fun d e => Disjoint (C d) (C e)) ∧ + (∀ σ, ∃ d, σ ∈ C d) ∧ + (∀ d, T.sector (C d)=B.fullGeometricSector hlarge (P ∘ v) h (W d)) ∧ + (∀ d, T.sector (C d)ᶜ=B.fullGeometricSector hlarge (P ∘ v) h (W d)ᶜ) ∧ + (∀ x d, polygonAssignment (primitiveTests (a := a) (r := r) P) x ∈ C d ↔ x ∈ (W d).val) := by + obtain ⟨χ,hχ⟩ := resolvedPartitionSelector (primitiveTests (a := a) (r := r) (P ∘ v)) W hW hcover hd + let C (d : D) : Set (ι → Bool) := {σ | χ (σ ∘ v)=d} + refine ⟨C,?_,?_,?_,?_,?_⟩ + · intro d e hde + apply Set.disjoint_left.mpr + intro σ hd he + exact hde (hd.symm.trans he) + · intro σ + exact ⟨χ (σ ∘ v),rfl⟩ + · intro d + exact A.formalSector_subfamily_eq hlarge P T v h {σ | χ σ=d} (W d) (hW d) + (fun x => hχ x d) + · intro d + exact A.formalSector_subfamily_eq hlarge P T v h {σ | χ σ≠d} (W d)ᶜ + (fun x y he => not_congr (hW d x y he)) (fun x => not_congr (hχ x d)) + · intro x d + exact hχ x d + +end InitialCoverSystem.PatchAtlas +end PrimitiveRectangleMasks + +section SupportedAssignmentPatching +variable {α ι D H Ω : Type*} [Fintype α] [DecidableEq α] [Finite ι] [Finite Ω] [Group H] + [Group.IsPerfect (alternatingGroup α)] + +theorem supported_assignment_patching + (U : ι → Set Ω) (hsep : ∀ ω ν, (∀ i, ω ∈ U i ↔ ν ∈ U i) → ω=ν) + (F : Option ι → TrackStar α →* H) + (f : (I : FiveAlphabet α) → Option ι → alternatingGroup I.val →* H) + (hspec : ∀ I i, (F i).comp (universalMap (subtypeAlternatingHom I.val))= + (f I i).comp (universalProjection (alternatingGroup I.val))) + (P : D → Subgroup H) + (hgen : (copyFamilyEval F).range ≤ ⨆ d, P d) + (hinv : ∀ d i s, F i s ∈ Subgroup.normalizer (P d : Set H)) + (G : D → Option ι → TrackStar α →* H) + (hact : ∀ d (I : FiveAlphabet α) i s, + ∀ x ∈ P d, + F i (universalMap (subtypeAlternatingHom I.val) s)*x* + (F i (universalMap (subtypeAlternatingHom I.val) s))⁻¹ = + G d i (universalMap (subtypeAlternatingHom I.val) s)*x* + (G d i (universalMap (subtypeAlternatingHom I.val) s))⁻¹) + (hlocal : ∀ d (S : Finset α), S.card ≤ 15 → ∀ w ∈ smallFamilyLocal (ι := ι) S, + smallFamilyModel U w=1 → + ∀ x ∈ P d, Commute (copyFamilyEval (G d) (smallFamilyStarWord w)) x) + (hα : 5 ≤ Fintype.card α) : + HasCentralLaw (smallFamilyModel U) + (smallFamilyEval f).rangeRestrict := by + classical + let f₀ : SmallFamilyLabel α ι → H := fun l => f l.1 l.2.1 l.2.2 + have hfs (I : FiveAlphabet α) (i : Option ι) (s : alternatingGroup I.val) : + f I i s=F i (alphabetStarLift I s) := by + have hh := DFunLike.congr_fun (hspec I i) + (Classical.choose (universalProjection_surjective (alternatingGroup I.val) s)) + simpa only [MonoidHom.comp_apply,alphabetStarLift, + Classical.choose_spec (universalProjection_surjective (alternatingGroup I.val) s)] using hh.symm + have hgen' : (FreeGroup.lift f₀).range ≤ ⨆ d, P d := by + rintro x ⟨w,rfl⟩ + apply hgen + refine ⟨smallFamilyStarWord w,?_⟩ + exact DFunLike.congr_fun (smallFamilyStarWord_eval F f hspec) w + apply smallFamily_assignment_law U hsep f ?_ hα + intro S hS w hw hrel v _hv + have hc := patching_centrality f₀ P hgen' (fun d l => by + rw [show f₀ l=F l.2.1 (alphabetStarLift l.1 l.2.2) from hfs _ _ _] + exact hinv _ _ _) w ?_ + · exact hc _ ⟨v,rfl⟩ + · intro d + let g : SmallFamilyLabel α ι → H := fun l => G d l.2.1 (alphabetStarLift l.1 l.2.2) + have hg : (FreeGroup.lift g)=(copyFamilyEval (G d)).comp smallFamilyStarWord := by + apply FreeGroup.ext_hom + rintro ⟨I,i,s⟩ + simp [g,smallFamilyStarWord] + refine ⟨g,?_,?_⟩ + · intro l x hx + rw [show f₀ l=F l.2.1 (alphabetStarLift l.1 l.2.2) from hfs _ _ _] + exact hact d l.1 l.2.1 _ x hx + · rw [hg] + intro x hx + exact (hlocal d S hS w hw hrel x hx).eq.symm + +end SupportedAssignmentPatching + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/FormalLaws.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/FormalLaws.lean new file mode 100644 index 0000000000000000000000000000000000000000..8db72234c34c0712534f29d395890f737afe11a5 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/FormalLaws.lean @@ -0,0 +1,204 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.ConcurrentGeometry +import OAI.GroupTheory.SimpleAmenable.CentralCovers.FormalPairSplits +import OAI.GroupTheory.SimpleAmenable.CentralCovers.GridFormalPatching +import OAI.GroupTheory.SimpleAmenable.CentralCovers.GridPrimitiveInputs +import OAI.GroupTheory.SimpleAmenable.Simplicial.FormalLawReindex +import OAI.GroupTheory.SimpleAmenable.RandomFields.FormalLawCovariance + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section ActualFormalLaws +variable {a : ℕ} {α ι : Type*} [Fintype α] [DecidableEq α] + +theorem smallActualModel_pullback (U : ι → polygonAlgebra a) : + smallFamilyModel (α := α) (actualTestMask U)= + (assignmentPullback (fun σ : Set.range (polygonAssignment U) => σ.val)).comp + (smallFamilyModel (fun i : ι => {σ : ι → Bool | σ i=true})) := by + apply FreeGroup.ext_hom + rintro ⟨I,i,s⟩ + ext σ + simp only [MonoidHom.comp_apply,smallFamilyModel,smallFamilyEval_of] + cases i <;> simp [maskFamily,sectorMask,assignmentPullback,actualTestMask] + rfl + +namespace InitialCoverSystem +variable {m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) [Finite ι] + +theorem smallPrimitive_formal_of_actual (hlarge : 15 < m+1) + (P : ι → Fin 5 × (CutRing × CutRing)) + (h : ∀ I, I.card≤15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb P) : + HasCentralLaw (smallFamilyModel (fun i : ι => {σ : ι → Bool | σ i=true})) + (smallFamilyEval (B.smallPrimitiveInputs hlarge P)).rangeRestrict := by + rw [hasCentralLaw_iff] + intro w hw + apply B.fullPrimitiveFamily_central hlarge P h + change coverMap M (alternatingGenerator a r m hm) + (smallFamilyEval (B.smallPrimitiveInputs hlarge P) w)=1 + have he := DFunLike.congr_fun (B.fullPrimitiveProjection hlarge P) w + simp only [MonoidHom.comp_apply] at he + rw [he,smallActualModel_pullback,MonoidHom.comp_apply,hw,map_one,map_one] + +end InitialCoverSystem +end ActualFormalLaws + +section CanonicalPrimitiveStars +namespace InitialCoverSystem.PatchAtlas +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + {B : InitialCoverSystem a r m hm M} + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] (A : B.PatchAtlas) + {ι : Type*} + +noncomputable def primitiveStar (hlarge : 15 < m+1) (p : Fin 5 × (CutRing × CutRing)) : + TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm) := + B.fullGeometricSector hlarge (translatedTemplate (initialPatchPrimitives r A.geometry.mesh) p.2) + (fun I _ b hb => A.initial p.2 I b hb) + (spatialTranslate p.2 (initialTest a r p.1)) + +noncomputable def starFamily (hlarge : 15 < m+1) (P : ι → Fin 5 × (CutRing × CutRing)) : + Option ι → TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm) + | none => B.c.comp (universalProjection (alternatingGroup (Fin (m+1)))) + | some i => A.primitiveStar hlarge (P i) + +theorem starFamily_small (hlarge : 15 < m+1) (P : ι → Fin 5 × (CutRing × CutRing)) + (I : FiveAlphabet (Fin (m+1))) (i : Option ι) : + (A.starFamily hlarge P i).comp (universalMap (subtypeAlternatingHom I.val))= + (B.smallPrimitiveInputs hlarge P I i).comp (universalProjection (alternatingGroup I.val)) := by + cases i with + | none => + change (B.c.comp _).comp _=(B.initialAlphabet I.val 0).comp _ + rw [MonoidHom.comp_assoc,universalMap_spec,← MonoidHom.comp_assoc,B.initialAlphabet_zero] + | some i => + apply B.fullGeometricSector_small_input hlarge _ _ P (Sum.inl (P i).1) i _ I + simp [translatedTemplate,initialPatchPrimitives] + +theorem starFamily_supported (hlarge : 15 < m+1) (P : ι → Fin 5 × (CutRing × CutRing)) + (i : Option ι) : + SmallSupported (sourceAlignedGroup a r m hm M B.t) (A.starFamily hlarge P i) := by + cases i with + | none => exact B.constant_small_supported + | some i => + apply B.fullGeometricSector_supported + have he : spatialTranslate (P i).2 (initialTest a r (P i).1)= + primitiveTests (a := a) (r := r) + (translatedTemplate (initialPatchPrimitives r A.geometry.mesh) (P i).2) (Sum.inl (P i).1) := by + simp [primitiveTests,primitiveFamilyTests,translatedTemplate,initialPatchPrimitives] + rw [he] + exact resolved_test _ _ + +end InitialCoverSystem.PatchAtlas +end CanonicalPrimitiveStars + +section OneSlopeFormalTable +noncomputable def oneSlopeCoordinates {ι : Type*} (d : Fin 2) (u : CutRing × CutRing) + (j : ι → Fin 2) (v : ι → CutRing × CutRing) : Option ι → Fin 5 × (CutRing × CutRing) + | none => (slopeTestIndex d,u) + | some i => (coordinateTestIndex (j i),v i) + +namespace InitialCoverSystem.PatchAtlas +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + {B : InitialCoverSystem a r m hm M} + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] (A : B.PatchAtlas) + {ι : Type*} + +omit [Group.IsPerfect (alternatingGroup (Fin (m+1)))] in +include A in +theorem primitive_self_formal_law (hlarge : 15 < m+1) (p : Fin 5 × (CutRing × CutRing)) : + HasCentralLaw (smallFamilyModel (fun i : Bool => {σ : Bool → Bool | σ i=true})) + (smallFamilyEval (B.smallPrimitiveInputs hlarge (fun _ : Bool => p))).rangeRestrict := by + apply B.smallPrimitive_formal_of_actual + intro I hI b hb + have hh := PrimitiveFamilyLaw.reindex B I b hb + (translatedTemplate (initialPatchPrimitives r A.geometry.mesh) p.2) + (A.initial p.2 I b hb) (fun _ : Bool => Sum.inl p.1) + have he : (translatedTemplate (initialPatchPrimitives r A.geometry.mesh) p.2) ∘ + (fun _ : Bool => Sum.inl p.1)=(fun _ : Bool => p) := by + funext i + simp [translatedTemplate,initialPatchPrimitives] + rwa [he] at hh + +include A in + +theorem oneSlope_pairs_formal_law [Finite ι] (hlarge : 25 ≤ m+1) + (hr : 0 {σ : Bool → Bool | σ b=true})) + (smallFamilyEval (B.smallPrimitiveInputs (by omega) + (primitivePair (oneSlopeCoordinates d u j v) i k))).rangeRestrict := by + cases i with + | none => + cases k with + | none => + have he : primitivePair (oneSlopeCoordinates d u j v) none none=(fun _ : Bool => (slopeTestIndex d,u)) := by + funext b; cases b <;> rfl + rw [he] + exact A.primitive_self_formal_law (by omega) (slopeTestIndex d,u) + | some k => + have hh := B.smallPrimitive_formal_reindex (by omega) _ + (A.translated_slope_coordinate_formal_law hlarge hr ha d (j k) u (v k)) + (fun b : Bool => if b then (1 : Fin 2) else 0) + have he : ![(slopeTestIndex d,u),(coordinateTestIndex (j k),v k)] ∘ + (fun b : Bool => if b then (1 : Fin 2) else 0)= + primitivePair (oneSlopeCoordinates d u j v) none (some k) := by + funext b; cases b <;> rfl + rwa [he] at hh + | some i => + cases k with + | none => + have hh := B.smallPrimitive_formal_reindex (by omega) _ + (A.translated_slope_coordinate_formal_law hlarge hr ha d (j i) u (v i)) + (fun b : Bool => if b then (0 : Fin 2) else 1) + have he : ![(slopeTestIndex d,u),(coordinateTestIndex (j i),v i)] ∘ + (fun b : Bool => if b then (0 : Fin 2) else 1)= + primitivePair (oneSlopeCoordinates d u j v) (some i) none := by + funext b; cases b <;> rfl + rwa [he] at hh + | some k => + have he : primitivePair (oneSlopeCoordinates d u j v) (some i) (some k)= + fun b : Bool => (coordinateTestIndex (if b then j k else j i),if b then v k else v i) := by + funext b; cases b <;> rfl + rw [he] + exact B.smallPrimitive_formal_of_actual (by omega) _ + (fun I _ b hb => B.coordinateFamilyLaw_all A.rectangles.rectangles _ _ I b hb) + +theorem starFamily_formal_table [Fintype ι] (hlarge : 20 ≤ m+1) + (P : ι → Fin 5 × (CutRing × CutRing)) + (hpair : ∀ i j, HasCentralLaw (smallFamilyModel (fun b : Bool => {σ : Bool → Bool | σ b=true})) + (smallFamilyEval (B.smallPrimitiveInputs (by omega) (primitivePair P i j))).rangeRestrict) : + Nonempty (FormalStarTable (A.starFamily (by omega) P)) := by + classical + have ht (i j : ι) : Nonempty (FormalStarTable (starPair (A.starFamily (by omega) P) i j)) := by + have he : starPair (A.starFamily (by omega) P) i j=A.starFamily (by omega) (primitivePair P i j) := by + funext k + cases k with + | none => rfl + | some b => cases b <;> rfl + rw [he] + exact formalStarTable_of_small (by simpa using (by omega : 5 ≤ m+1)) _ _ + (A.starFamily_small (by omega) _) (hpair i j) + exact formal_pairs_assemble (by simpa using hlarge) + (sourceAlignedGroup a r m hm M B.t) B.c B.constant_aligned B.disjoint_aligned _ + (A.starFamily_supported (by omega) P) rfl (fun i j => Classical.choice (ht i j)) + +theorem oneSlope_formal_table [Fintype ι] (hlarge : 25 ≤ m+1) + (hr : 0 F none + | some false => F (some i) + | some true => F (some j) + +variable (F : Option ι → TrackStar α →* H) + (T : ∀ i j, FormalStarTable (starPair F i j)) + +noncomputable def formalPairSplit (i : ι) (j : Option ι) (b : Bool) : TrackStar α →* H := + (T i (j.getD i)).sector + ((match j with | none => Set.univ | some _ => {σ | σ true=true}) ∩ {σ | σ false=b}) + +noncomputable def formalPairContainer (i : ι) (b : Bool) : TrackStar α →* H := + (T i i).sector {σ | σ false=b} + +theorem formalPair_container_shared (i j : ι) (b : Bool) : + formalPairContainer F T i b=(T i j).sector {σ | σ false=b} := by + cases b with + | true => + exact ((T i i).sector_input (some false)).trans + ((T i j).sector_input (some false)).symm + | false => + ext s + have hd : Disjoint {σ : Bool → Bool | σ false=true} {σ | σ false=false} := by + apply Set.disjoint_left.mpr; intro σ ht hf + exact Bool.false_ne_true (hf.symm.trans ht) + have he : ({σ : Bool → Bool | σ false=true} ∪ {σ | σ false=false})=Set.univ := by + ext σ; simp only [Set.mem_union,Set.mem_ofPred_eq,Set.mem_univ,iff_true] + cases σ false <;> simp + have hi := (T i i).sector_union hd s + have hj := (T i j).sector_union hd s + rw [he,(T i i).sector_input none,(T i i).sector_input (some false)] at hi + rw [he,(T i j).sector_input none,(T i j).sector_input (some false)] at hj + change (T i i).sector _ s=(T i j).sector _ s + exact mul_left_cancel (hi.symm.trans hj) + +theorem formalPair_split (i : ι) (j : Option ι) (s : TrackStar α) : + F j s=formalPairSplit F T i j true s*formalPairSplit F T i j false s := by + classical + let U : Set (Bool → Bool) := match j with | none => Set.univ | some _ => {σ | σ true=true} + have hd : Disjoint (U ∩ {σ | σ false=true}) (U ∩ {σ | σ false=false}) := by + apply Set.disjoint_left.mpr; intro σ ht hf + exact Bool.false_ne_true (hf.2.symm.trans ht.2) + have he : (U ∩ {σ | σ false=true}) ∪ (U ∩ {σ | σ false=false})=U := by + ext σ + simp only [Set.mem_union,Set.mem_inter_iff,Set.mem_ofPred_eq] + cases σ false <;> simp + have hh := (T i (j.getD i)).sector_union hd s + rw [he] at hh + have hi : (T i (j.getD i)).sector U=F j := by + cases j with + | none => exact (T i i).sector_input none + | some j => exact (T i j).sector_input (some true) + rw [hi] at hh + exact hh + +theorem formalPair_split_whole (i : ι) : formalPairSplit F T i none true=F (some i) := by + change (T i i).sector (Set.univ ∩ _)=_ + rw [Set.univ_inter] + exact (T i i).sector_input (some false) + +theorem formalPair_mem (i : ι) (j : Option ι) (b : Bool) (s : TrackStar α) : + formalPairSplit F T i j b s ∈ (copyFamilyEval F).range := by + have hh := (T i (j.getD i)).sector_mem + ((match j with | none => Set.univ | some _ => {σ | σ true=true}) ∩ {σ | σ false=b}) s + apply Set.mem_of_subset_of_mem (show (copyFamilyEval (starPair F i (j.getD i))).range ≤ _ from ?_) hh + rw [copyFamilyEval_range,copyFamilyEval_range] + apply iSup_le + intro k + cases k with + | none => exact le_iSup (fun j => (F j).range) none + | some b => cases b <;> exact le_iSup (fun j => (F j).range) _ + +theorem formalPair_supported (L : Finset α → Subgroup H) + (hF : ∀ j, SmallSupported L (F j)) (i : ι) (j : Option ι) (b : Bool) : + SmallSupported L (formalPairSplit F T i j b) := by + apply FormalStarTable.sector_supported + intro k + cases k with + | none => exact hF none + | some b => cases b <;> exact hF _ + +theorem formalPair_container_supported (L : Finset α → Subgroup H) + (hF : ∀ j, SmallSupported L (F j)) (i : ι) (b : Bool) : + SmallSupported L (formalPairContainer F T i b) := by + apply FormalStarTable.sector_supported + intro k + cases k with + | none => exact hF none + | some b => cases b <;> exact hF _ + +theorem formalPair_control (c : alternatingGroup α →* H) + (hc : F none=c.comp (universalProjection (alternatingGroup α))) + (i : ι) (j : Option ι) (b : Bool) : + SmallControlled c (formalPairSplit F T i j b) (formalPairContainer F T i b) := by + rw [formalPair_container_shared F T i (j.getD i)] + have hh := (T i (j.getD i)).sector_control + (show ((match j with | none => Set.univ | some _ => {σ | σ true=true}) ∩ + {σ | σ false=b}) ⊆ {σ | σ false=b} from Set.inter_subset_right) + intro I s x hx + have he := hh (universalMap (subtypeAlternatingHom I.val) s) x hx + change _=(F none (universalMap (subtypeAlternatingHom I.val) s))*x* + (F none (universalMap (subtypeAlternatingHom I.val) s))⁻¹ at he + simpa only [hc,MonoidHom.comp_apply] using he + +theorem formalPair_containers_commute (i : ι) (s t : TrackStar α) : + Commute (formalPairContainer F T i true s) (formalPairContainer F T i false t) := by + apply FormalStarTable.sector_commute + apply Set.disjoint_left.mpr + intro σ ht hf + exact Bool.false_ne_true (hf.symm.trans ht) + +end FormalPairSplits + +section FormalPairAssembly +variable {α ι H : Type*} [Fintype α] [DecidableEq α] [Fintype ι] [Group H] + [Group.IsPerfect (alternatingGroup α)] + +theorem formal_pairs_assemble (hα : 20 ≤ Fintype.card α) + (L : Finset α → Subgroup H) (c : alternatingGroup α →* H) + (hc : ∀ σ I, ∀ x ∈ L I, c σ*x*(c σ)⁻¹ ∈ L (I.map σ.val.toEmbedding)) + (hd : ∀ I J, Disjoint I J → ∀ x ∈ L I, ∀ y ∈ L J, Commute x y) + (F : Option ι → TrackStar α →* H) (hF : ∀ j, SmallSupported L (F j)) + (h0 : F none=c.comp (universalProjection (alternatingGroup α))) + (T : ∀ i j, FormalStarTable (starPair F i j)) : Nonempty (FormalStarTable F) := by + let K := (copyFamilyEval F).range + have hm (i : Option ι) (s : TrackStar α) : F i s ∈ K := + ⟨FreeGroup.of (i,s),copyFamilyEval_of F i s⟩ + let F' := fun i => (F i).codRestrict K (hm i) + let : Group.IsPerfect K := copyFamilyEval_perfect F + have hcm (s : alternatingGroup α) : c s ∈ K := by + obtain ⟨t,rfl⟩ := universalProjection_surjective (alternatingGroup α) s + rw [← MonoidHom.comp_apply,← h0] + exact hm none t + let c' := c.codRestrict K hcm + have h0' : F' none=c'.comp (universalProjection (alternatingGroup α)) := by + ext s + exact DFunLike.congr_fun h0 s + let Fl := fun i j => (formalPairSplit F T i j true).codRestrict K (formalPair_mem F T i j true) + let Fr := fun i j => (formalPairSplit F T i j false).codRestrict K (formalPair_mem F T i j false) + obtain ⟨φ,hφ,hφc,hφi⟩ := star_split_assignment + (universalProjection (alternatingGroup α)) (universalProjection_surjective _) c' F' h0' + (codRestrict_iSup_top F K hm (copyFamilyEval_range F).symm) Fl Fr + (fun i j s => Subtype.ext (formalPair_split F T i j s)) + (fun i j k s t => by + apply Subtype.ext + exact (small_control_disjoint L c hc hd hα _ _ _ _ + (formalPair_supported F T L hF i j true) + (formalPair_supported F T L hF i k false) + (formalPair_container_supported F T L hF i true) + (formalPair_control F T c h0 i j true) + (formalPair_control F T c h0 i k false) + (formalPair_containers_commute F T i) s t).eq) + (fun i => by ext s; exact DFunLike.congr_fun (formalPair_split_whole F T i) s) + refine ⟨⟨K,rfl,F',(fun _ => rfl),φ,hφ,?_⟩⟩ + intro i + cases i with + | none => + change φ.comp ((sectorMask Set.univ).comp _)=_ + rw [← MonoidHom.comp_assoc,hφc,MonoidHom.comp_assoc,← h0'] + | some i => exact hφi i + +end FormalPairAssembly + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/FormalSectorSubfamily.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/FormalSectorSubfamily.lean new file mode 100644 index 0000000000000000000000000000000000000000..e8b255443fe4669253fe8b70d83fbf6e21665fa5 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/FormalSectorSubfamily.lean @@ -0,0 +1,122 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.PairControl +import OAI.GroupTheory.SimpleAmenable.CentralCovers.FormalStarTables + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section FormalSectorSubfamily +namespace FormalStarTable +variable {α ι κ H Q : Type*} [Fintype α] [DecidableEq α] [Group H] [Group Q] + [Group.IsPerfect (alternatingGroup α)] + {F : Option ι → TrackStar α →* H} (T : FormalStarTable F) + +omit [Group.IsPerfect (alternatingGroup α)] in +theorem input_eval : T.carrier.subtype.comp (copyFamilyEval T.input)=copyFamilyEval F := by + rw [← copyFamilyEval_comp] + congr 1 + funext i + exact T.inclusion i + +omit [Group.IsPerfect (alternatingGroup α)] in +theorem input_surjective : Function.Surjective (copyFamilyEval T.input) := by + intro x + have hx : x.val ∈ (copyFamilyEval F).range := by rw [← T.carrier_eq]; exact x.property + obtain ⟨w,hw⟩ := hx + refine ⟨w,Subtype.ext ?_⟩ + have he := DFunLike.congr_fun T.input_eval w + exact he.trans hw + +omit [Group.IsPerfect (alternatingGroup α)] in +theorem model_eval : T.model.comp (formalAssignmentEval (universalProjection (alternatingGroup α)))= + (QuotientGroup.mk' _).comp (copyFamilyEval T.input) := by + apply FreeGroup.ext_hom + rintro ⟨i,s⟩ + have hh := DFunLike.congr_fun (T.spec i) s + simpa only [MonoidHom.comp_apply,formalAssignmentEval,copySourceMap,FreeGroup.map.of, + assignmentEval,copyFamilyEval_of] using hh + +theorem sector_subfamily_range [Finite κ] (v : κ → ι) (V : Set (κ → Bool)) : + (T.sector ((fun σ : ι → Bool => σ ∘ v) ⁻¹' V)).range ≤ + (copyFamilyEval (fun i : Option κ => F (i.map v))).range := by + classical + let K := ((copyFamilyEval (fun i : Option κ => F (i.map v))).range).comap T.carrier.subtype + let q := QuotientGroup.mk' (Subgroup.center T.carrier) + let J := (K.map q).comap (T.model.comp (assignmentPullback (fun σ : ι → Bool => σ ∘ v))) + have hm (i : Option κ) (s : alternatingGroup α) : + maskFamily (fun j : κ => {σ : κ → Bool | σ j=true}) i s ∈ J := by + obtain ⟨t,rfl⟩ := universalProjection_surjective (alternatingGroup α) s + change T.model (assignmentPullback (fun σ : ι → Bool => σ ∘ v) + (maskFamily (fun j : κ => {σ : κ → Bool | σ j=true}) i (universalProjection _ t))) ∈ K.map q + have he : assignmentPullback (fun σ : ι → Bool => σ ∘ v) + (maskFamily (fun j : κ => {σ : κ → Bool | σ j=true}) i (universalProjection _ t))= + maskFamily (fun j : ι => {σ : ι → Bool | σ j=true}) (i.map v) (universalProjection _ t) := by + cases i <;> rfl + rw [he] + have hs := DFunLike.congr_fun (T.spec (i.map v)) t + simp only [MonoidHom.comp_apply] at hs + rw [hs] + apply Subgroup.mem_map.mpr + refine ⟨T.input (i.map v) t,?_,rfl⟩ + change T.carrier.subtype (T.input (i.map v) t) ∈ (copyFamilyEval (fun i : Option κ => F (i.map v))).range + rw [← MonoidHom.comp_apply,T.inclusion] + exact ⟨FreeGroup.of (i,t),copyFamilyEval_of _ i t⟩ + have hJ : J=⊤ := assignment_group_generated + (fun j : κ => {σ : κ → Bool | σ j=true}) + (fun σ τ he => funext (fun i => Bool.eq_iff_iff.mpr (he i))) J (hm none) (fun i => hm (some i)) + have hsec : (centralSector T.model ((fun σ : ι → Bool => σ ∘ v) ⁻¹' V)).range ≤ K := by + apply perfect_range_le_of_central_image _ q (by rw [QuotientGroup.ker_mk']) K + rintro x ⟨s,rfl⟩ + change q (centralSector T.model _ s) ∈ K.map q + rw [centralSector_spec] + have he : sectorMask ((fun σ : ι → Bool => σ ∘ v) ⁻¹' V) (universalProjection _ s)= + assignmentPullback (fun σ : ι → Bool => σ ∘ v) (sectorMask V (universalProjection _ s)) := by + rfl + rw [he] + have hh : sectorMask V (universalProjection _ s) ∈ J := by rw [hJ]; trivial + exact hh + rintro x ⟨s,rfl⟩ + exact hsec ⟨s,rfl⟩ + +theorem sector_forward [Finite ι] (γ : T.carrier →* Q) (hγ : Function.Surjective γ) + (hz : Subgroup.center Q=⊥) (δ : ((ι → Bool) → alternatingGroup α) →* Q) + (hδ : ∀ i, γ.comp (T.input i)=δ.comp + ((maskFamily (fun j : ι => {σ : ι → Bool | σ j=true}) i).comp (universalProjection _))) + (V : Set (ι → Bool)) (s : TrackStar α) : + γ (centralSector T.model V s)=δ (sectorMask V (universalProjection _ s)) := by + have hc : Subgroup.center T.carrier ≤ γ.ker := by + intro x hx + have hh : γ x ∈ Subgroup.center Q := by + apply Subgroup.mem_center_iff.mpr + intro y + obtain ⟨t,rfl⟩ := hγ y + simpa only [map_mul] using congrArg γ (Subgroup.mem_center_iff.mp hx t) + simpa only [hz,Subgroup.mem_bot,MonoidHom.mem_ker] using hh + let γ' := QuotientGroup.lift (Subgroup.center T.carrier) γ hc + have he : γ'.comp T.model=δ := by + apply MonoidHom.cancel_right (formalAssignmentEval_surjective + (universalProjection (alternatingGroup α)) (universalProjection_surjective _)) |>.mp + rw [MonoidHom.comp_assoc,T.model_eval] + apply FreeGroup.ext_hom + rintro ⟨i,t⟩ + have hh := DFunLike.congr_fun (hδ i) t + simpa only [MonoidHom.comp_apply,copyFamilyEval_of,formalAssignmentEval,copySourceMap, + FreeGroup.map.of,assignmentEval,γ',QuotientGroup.mk'_apply,QuotientGroup.lift_mk] using hh + have hh := DFunLike.congr_fun he (sectorMask V (universalProjection _ s)) + change γ' (T.model _)=_ at hh + rw [← centralSector_spec] at hh + exact hh + +end FormalStarTable +end FormalSectorSubfamily + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/FormalStarTables.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/FormalStarTables.lean new file mode 100644 index 0000000000000000000000000000000000000000..ffe0781b371c7356beb7281540bbe16651f543dc --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/FormalStarTables.lean @@ -0,0 +1,162 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.PairLawAssembly +import OAI.GroupTheory.SimpleAmenable.CentralCovers.FullSector +import OAI.GroupTheory.SimpleAmenable.CentralCovers.CentralRangeReflection + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section FormalStarTables +variable {α ι H : Type*} [Fintype α] [DecidableEq α] [Group H] + [Group.IsPerfect (alternatingGroup α)] + +theorem star_small_range_eq (hα : 5 ≤ Fintype.card α) + (F : Option ι → TrackStar α →* H) + (f : (I : FiveAlphabet α) → Option ι → alternatingGroup I.val →* H) + (hspec : ∀ I i, (F i).comp (universalMap (subtypeAlternatingHom I.val))= + (f I i).comp (universalProjection (alternatingGroup I.val))) : + (copyFamilyEval F).range=(smallFamilyEval f).range := by + rw [copyFamilyEval_range,smallFamilyEval_range,iSup_comm] + apply iSup_congr + intro i + rw [MonoidHom.range_eq_map,← universal_five_alphabet_generate hα,Subgroup.map_iSup] + apply iSup_congr + intro I + rw [← MonoidHom.range_comp,hspec] + apply le_antisymm (range_comp_subset _ _) + rintro x ⟨s,rfl⟩ + obtain ⟨t,rfl⟩ := universalProjection_surjective (alternatingGroup I.val) s + exact ⟨t,rfl⟩ + +structure FormalStarTable (F : Option ι → TrackStar α →* H) where + carrier : Subgroup H + carrier_eq : carrier=(copyFamilyEval F).range + input : Option ι → TrackStar α →* carrier + inclusion : ∀ i, carrier.subtype.comp (input i)=F i + model : ((ι → Bool) → alternatingGroup α) →* carrier ⧸ Subgroup.center carrier + onto : Function.Surjective model + spec : ∀ i, model.comp ((maskFamily (fun j : ι => {σ : ι → Bool | σ j=true}) i).comp + (universalProjection (alternatingGroup α))) = + (QuotientGroup.mk' _).comp (input i) + +theorem formalStarTable_of_small [Finite ι] (hα : 5 ≤ Fintype.card α) + (F : Option ι → TrackStar α →* H) + (f : (I : FiveAlphabet α) → Option ι → alternatingGroup I.val →* H) + (hspec : ∀ I i, (F i).comp (universalMap (subtypeAlternatingHom I.val))= + (f I i).comp (universalProjection (alternatingGroup I.val))) + (hlaw : HasCentralLaw (smallFamilyModel (fun i : ι => {σ : ι → Bool | σ i=true})) + (smallFamilyEval f).rangeRestrict) : Nonempty (FormalStarTable F) := by + classical + let K := (smallFamilyEval f).range + have hmem : ∀ i s, F i s ∈ K := by + intro i s + change F i s ∈ (smallFamilyEval f).range + rw [← star_small_range_eq hα F f hspec] + exact ⟨FreeGroup.of (i,s),copyFamilyEval_of F i s⟩ + let F' : Option ι → TrackStar α →* K := fun i => (F i).codRestrict K (hmem i) + have hsep : ∀ σ τ : ι → Bool, + (∀ i, σ ∈ {σ : ι → Bool | σ i=true} ↔ τ ∈ {σ : ι → Bool | σ i=true}) → σ=τ := by + intro σ τ he + funext i + exact Bool.eq_iff_iff.mpr (he i) + obtain ⟨φ,hφ⟩ := (hasCentralLaw_iff_modelMap _ _ (smallFamilyModel_surjective _ hsep hα)).mp hlaw + refine ⟨⟨K,(star_small_range_eq hα F f hspec).symm,F',(fun _ => rfl),φ,centralLaw_modelMap_surjective _ _ + (smallFamilyEval f).rangeRestrict_surjective φ hφ,?_⟩⟩ + intro i + apply universal_five_alphabet_hom_ext hα + intro I + ext s + have hp := DFunLike.congr_fun (universalMap_spec (subtypeAlternatingHom I.val)) s + have he : F' i (universalMap (subtypeAlternatingHom I.val) s)= + (smallFamilyEval f).rangeRestrict (FreeGroup.of ⟨I,i,universalProjection _ s⟩) := by + apply Subtype.ext + change F i (universalMap (subtypeAlternatingHom I.val) s)= + smallFamilyEval f (FreeGroup.of ⟨I,i,universalProjection _ s⟩) + rw [smallFamilyEval_of] + exact DFunLike.congr_fun (hspec I i) s + simp only [MonoidHom.comp_apply,he] + have hh := DFunLike.congr_fun hφ (FreeGroup.of ⟨I,i,universalProjection _ s⟩) + simp only [MonoidHom.comp_apply] at hp hh + rw [hp] + exact hh + +namespace FormalStarTable +variable {F : Option ι → TrackStar α →* H} (T : FormalStarTable F) +noncomputable def sector (U : Set (ι → Bool)) : TrackStar α →* H := + T.carrier.subtype.comp (centralSector T.model U) + +theorem sector_input (i : Option ι) : + T.sector (match i with | none => Set.univ | some i => {σ | σ i=true})=F i := by + rw [← T.inclusion i] + apply congrArg (T.carrier.subtype.comp) + apply perfect_lift_unique (QuotientGroup.mk' (Subgroup.center T.carrier)) + (by rw [QuotientGroup.ker_mk']) + ext s + simp only [MonoidHom.comp_apply,centralSector_spec] + cases i with + | none => simpa only [MonoidHom.comp_apply,maskFamily] using DFunLike.congr_fun (T.spec none) s + | some i => simpa only [MonoidHom.comp_apply,maskFamily] using DFunLike.congr_fun (T.spec (some i)) s + +theorem sector_mem (U : Set (ι → Bool)) (s : TrackStar α) : + T.sector U s ∈ (copyFamilyEval F).range := by + rw [← T.carrier_eq] + exact (centralSector T.model U s).property + +theorem sector_union {U V : Set (ι → Bool)} (hd : Disjoint U V) (s : TrackStar α) : + T.sector (U ∪ V) s=T.sector U s*T.sector V s := by + change (centralSector T.model (U ∪ V) s).val=_ + rw [centralSector_union T.model hd] + rfl + +theorem sector_commute {U V : Set (ι → Bool)} (hd : Disjoint U V) (s t : TrackStar α) : + Commute (T.sector U s) (T.sector V t) := (centralSector_commute T.model hd s t).map T.carrier.subtype + +theorem sector_control {U V : Set (ι → Bool)} (hUV : U ⊆ V) : + SameActionOn (T.sector V) (F none) (T.sector U).range := by + rw [← T.sector_input none] + rintro s x ⟨t,rfl⟩ + exact congrArg Subtype.val (centralSector_control T.model hUV s _ ⟨t,rfl⟩) + +theorem sector_supported [Finite ι] (L : Finset α → Subgroup H) + (hF : ∀ i, SmallSupported L (F i)) (U : Set (ι → Bool)) : + SmallSupported L (T.sector U) := by + classical + intro I + let K := (L I.val).comap T.carrier.subtype + have hsep : ∀ σ τ : ι → Bool, + (∀ i, σ ∈ {σ : ι → Bool | σ i=true} ↔ τ ∈ {σ : ι → Bool | σ i=true}) → σ=τ := by + intro σ τ he + funext i + exact Bool.eq_iff_iff.mpr (he i) + have hm (i : Option ι) (s : alternatingGroup I.val) : + T.model (maskFamily (fun j : ι => {σ : ι → Bool | σ j=true}) i (subtypeAlternatingHom I.val s)) ∈ + K.map (QuotientGroup.mk' _) := by + obtain ⟨t,rfl⟩ := universalProjection_surjective (alternatingGroup I.val) s + have hπ := DFunLike.congr_fun (universalMap_spec (subtypeAlternatingHom I.val)) t + have hs := DFunLike.congr_fun (T.spec i) (universalMap (subtypeAlternatingHom I.val) t) + simp only [MonoidHom.comp_apply] at hπ hs + rw [hπ] at hs + rw [hs] + apply Subgroup.mem_map.mpr + refine ⟨T.input i (universalMap (subtypeAlternatingHom I.val) t),?_,rfl⟩ + change T.carrier.subtype (T.input i (universalMap (subtypeAlternatingHom I.val) t)) ∈ L I.val + rw [← MonoidHom.comp_apply,T.inclusion] + exact hF i I ⟨t,rfl⟩ + have hh := centralSector_supported T.model (fun j : ι => {σ : ι → Bool | σ j=true}) + hsep (subtypeAlternatingHom I.val) K (hm none) (fun i => hm (some i)) U + rintro x ⟨s,rfl⟩ + exact hh ⟨s,rfl⟩ + +end FormalStarTable +end FormalStarTables + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/FrameActions.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/FrameActions.lean new file mode 100644 index 0000000000000000000000000000000000000000..bed3527ec2527706e8b60175bac43c5ebea90bb1 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/FrameActions.lean @@ -0,0 +1,90 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.Sectors +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.OffsetFrames +import OAI.GroupTheory.SimpleAmenable.CentralCovers.FrameCentrality + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section FrameActions + +variable {P H Q : Type*} [Group P] [Group H] [Group Q] + +theorem CentralOn.commute_perfect [Group.IsPerfect P] (q : H →* Q) (S : Subgroup H) + (h : CentralOn q S) (f : P →* H) (hf : f.range ≤ S) (z : H) (hz : z ∈ S) + (hc : ∀ s, Commute (q z) (q (f s))) (s : P) : Commute z (f s) := by + have he : (MulAut.conj z).toMonoidHom.comp f = f := by + apply CentralOn.lift_unique q S h + · rintro x ⟨s,rfl⟩ + exact S.mul_mem (S.mul_mem hz (hf ⟨s,rfl⟩)) (S.inv_mem hz) + · exact hf + · ext s : 1 + change q (z*f s*z⁻¹)=q (f s) + rw [map_mul,map_mul,map_inv,(hc s).eq,mul_assoc,mul_inv_cancel,mul_one] + have hh := DFunLike.congr_fun he s + change z*f s*z⁻¹=f s at hh + have hh' := congrArg (fun x => x*z) hh + exact show z*f s=f s*z from by simpa only [mul_assoc,inv_mul_cancel,mul_one] using hh' + +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + (hlarge : 15 < m+1) (h : B.AllPrimitiveLaws) (hr : 0 (B.frameStar hlarge h hr I u F W).range) V) z hz hc s + +end InitialCoverSystem +end FrameActions + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/FrameCentrality.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/FrameCentrality.lean new file mode 100644 index 0000000000000000000000000000000000000000..fb327f9a44940e7e6b9bf93b558c5b0f5fd6ae09 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/FrameCentrality.lean @@ -0,0 +1,80 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.ConditionalFamilyLaws +import OAI.GroupTheory.SimpleAmenable.CentralCovers.GlobalAlignedCentrality +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.OffsetFrames + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section FrameCentrality + +variable {H Q : Type*} [Group H] [Group Q] + +theorem CentralOn.conjugate {q : H →* Q} {S : Subgroup H} (h : CentralOn q S) (z : H) : + CentralOn q (S.map (MulAut.conj z).toMonoidHom) := by + rw [centralOn_iff] at h ⊢ + rintro _ ⟨x,hx,rfl⟩ he _ ⟨y,hy,rfl⟩ + change q (z*x*z⁻¹) = 1 at he + have hqx : q x = 1 := by + have hh := congrArg (fun t => (q z)⁻¹*t*q z) he + simpa [mul_assoc] using hh + exact (h x hx hqx y hy).map (MulAut.conj z).toMonoidHom + +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + (hlarge : 15 < m+1) (h : B.AllPrimitiveLaws) (hr : 0 (B.polygonStar hlarge h hr W).range) V) + ⟨_,rfl⟩,rfl⟩ + +theorem frameStar_union (I : Finset (Fin (m+1))) [Group.IsPerfect (alternatingGroup I)] + (u : Fin (m+1) → CutRing × CutRing) (F : OffsetFrame a r m hm I u) + (V W : polygonAlgebra a) (hd : Disjoint V.val W.val) + (s : UniversalExtension (alternatingGroup I)) : + B.frameStar hlarge h hr I u F (V ⊔ W) s = + B.frameStar hlarge h hr I u F V s * B.frameStar hlarge h hr I u F W s := by + change (MulAut.conj (B.t F.k)).toMonoidHom + (B.polygonStar hlarge h hr (V ⊔ W) (universalMap (subtypeAlternatingHom I) s)) = _ + rw [B.polygonStar_union hlarge h hr V W hd,map_mul] + rfl + +theorem frameStar_commute (I : Finset (Fin (m+1))) [Group.IsPerfect (alternatingGroup I)] + (u : Fin (m+1) → CutRing × CutRing) (F : OffsetFrame a r m hm I u) + (V W : polygonAlgebra a) (hd : Disjoint V.val W.val) + (s t : UniversalExtension (alternatingGroup I)) : + Commute (B.frameStar hlarge h hr I u F V s) (B.frameStar hlarge h hr I u F W t) := + (B.polygonStar_commute hlarge h hr V W hd _ _).map (MulAut.conj (B.t F.k)).toMonoidHom + +theorem frameStar_empty (I : Finset (Fin (m+1))) [Group.IsPerfect (alternatingGroup I)] + (u : Fin (m+1) → CutRing × CutRing) (F : OffsetFrame a r m hm I u) : + B.frameStar hlarge h hr I u F ⊥ = 1 := by + ext s : 1 + change (MulAut.conj (B.t F.k)).toMonoidHom + (B.polygonStar hlarge h hr ⊥ (universalMap (subtypeAlternatingHom I) s)) = 1 + rw [B.polygonStar_empty hlarge h hr] + exact map_one _ + +end InitialCoverSystem +end FrameCentrality + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/FullAlphabetGeneration.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/FullAlphabetGeneration.lean new file mode 100644 index 0000000000000000000000000000000000000000..4e57873cd5f3a449c9ae207be14a8c282335b06e --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/FullAlphabetGeneration.lean @@ -0,0 +1,141 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.SmallFamilyWords +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.EvaluationTable +import OAI.GroupTheory.SimpleAmenable.CentralCovers.SmallFamilyGlobal + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section FullAlphabetGeneration +variable {α : Type*} [Fintype α] [DecidableEq α] + +theorem five_alphabet_generate (hα : 5 ≤ Fintype.card α) : + (⨆ I : FiveAlphabet α, (subtypeAlternatingHom I.val).range) = ⊤ := by + apply top_unique + rw [← alternatingGroup.closure_isThreeCycles_eq_top] + apply (Subgroup.closure_le _).mpr + intro s hs + obtain ⟨I,hSI,hIU,hI⟩ := Finset.exists_subsuperset_card_eq + (Finset.subset_univ s.val.support) (by rw [hs.card_support]; omega : s.val.support.card ≤ 5) + (by simpa using hα : 5 ≤ (Finset.univ : Finset α).card) + apply le_iSup (fun I : FiveAlphabet α => (subtypeAlternatingHom I.val).range) ⟨I,hIU,hI⟩ + exact (subtypeAlternatingHom_mem_range I s).mpr hSI + +theorem universal_five_alphabet_generate [Group.IsPerfect (alternatingGroup α)] + (hα : 5 ≤ Fintype.card α) : + (⨆ I : FiveAlphabet α, (universalMap (subtypeAlternatingHom I.val)).range) = ⊤ := + universal_generating_ranges (fun I : FiveAlphabet α => subtypeAlternatingHom I.val) + (five_alphabet_generate hα) + +end FullAlphabetGeneration + +section FullPrimitiveSectors + +variable {α ι Ω : Type*} [Fintype α] [DecidableEq α] [Finite ι] [Finite Ω] + +theorem smallFamilyModel_surjective (U : ι → Set Ω) + (hsep : ∀ ω ν, (∀ i, ω ∈ U i ↔ ν ∈ U i) → ω = ν) + (hα : 5 ≤ Fintype.card α) : Function.Surjective (smallFamilyModel (α := α) U) := by + intro g + obtain ⟨w,_,hw⟩ := smallFamilyModel_complete U hsep Finset.univ (by simpa using hα) g + (fun ω => Finset.subset_univ _) + exact ⟨w,hw⟩ + +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + +theorem fullPrimitiveProjection (hlarge : 15 < m+1) + (P : ι → Fin 5 × (CutRing × CutRing)) : + (coverMap M (alternatingGenerator a r m hm)).comp + (smallFamilyEval (B.smallPrimitiveInputs hlarge P)) = + (actualPolygonTableHom (primitiveTests (a := a) (r := r) P)).comp + (smallFamilyModel (actualTestMask (primitiveTests (a := a) (r := r) P))) := by + apply FreeGroup.ext_hom + rintro ⟨I,i,s⟩ + simpa only [MonoidHom.comp_apply,smallFamilyModel,smallFamilyEval_of] using + DFunLike.congr_fun (B.smallPrimitiveInputs_projection hlarge P I i) s + +noncomputable def fullPrimitiveTable (hlarge : 15 < m+1) + (P : ι → Fin 5 × (CutRing × CutRing)) + (h : ∀ I, I.card ≤ 15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb P) : + ActualLawfulTable (coverMap M (alternatingGenerator a r m hm)) + (actualPolygonTableHom (primitiveTests (a := a) (r := r) P)) := + evaluationTable _ (smallFamilyEval (B.smallPrimitiveInputs hlarge P)) + (smallFamilyModel _) (actualPolygonTableHom _) (actualPolygonTableHom_injective _) + (B.fullPrimitiveProjection hlarge P) + (smallFamilyModel_surjective _ (actualTestMask_separates _) + (by simpa using (by omega : 5 ≤ m+1))) + (B.fullPrimitiveFamily_central hlarge P h) + +omit [Finite ι] in + +theorem primitiveFamily_range_full (hlarge : 15 < m+1) + (P : ι → Fin 5 × (CutRing × CutRing)) + (J : Finset (Fin (m+1))) (hJ : 5 ≤ J.card) (b : Fin (m+1)) (hb : b ∉ J) : + (copyFamilyEval (B.primitiveFamily J b hb P)).range ≤ + (smallFamilyEval (B.smallPrimitiveInputs hlarge P)).range := by + rw [copyFamilyEval_range] + apply iSup_le + intro i + rw [MonoidHom.range_eq_map,← subalphabet_five_generate J hJ,Subgroup.map_iSup] + apply iSup_le + intro I + rw [← MonoidHom.range_comp] + rintro x ⟨t,rfl⟩ + let I' : FiveAlphabet (Fin (m+1)) := ⟨I.val,Finset.subset_univ _,I.property.2⟩ + refine ⟨FreeGroup.of ⟨I',i,t⟩,?_⟩ + rw [smallFamilyEval_of] + exact (DFunLike.congr_fun (B.primitiveFamily_inclusion I.property.1 _ _ _ _ P i) t).symm + +omit [Finite ι] in +theorem constant_range_full (hlarge : 15 < m+1) + (P : ι → Fin 5 × (CutRing × CutRing)) : + B.c.range ≤ (smallFamilyEval (B.smallPrimitiveInputs hlarge P)).range := by + rw [MonoidHom.range_eq_map,← five_alphabet_generate (by simpa using (by omega : 5 ≤ m+1)), + Subgroup.map_iSup] + apply iSup_le + intro I + rw [← MonoidHom.range_comp] + rintro x ⟨s,rfl⟩ + refine ⟨FreeGroup.of ⟨I,none,s⟩,?_⟩ + rw [smallFamilyEval_of] + change B.initialAlphabet I.val 0 s = B.c (subtypeAlternatingHom I.val s) + rw [B.initialAlphabet_zero] + rfl + +variable [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + +noncomputable def fullGeometricSector (hlarge : 15 < m+1) + (P : ι → Fin 5 × (CutRing × CutRing)) + (h : ∀ I, I.card ≤ 15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb P) + (V : polygonAlgebra a) : UniversalExtension (alternatingGroup (Fin (m+1))) →* + BoundedRelationCover M (alternatingGenerator a r m hm) := + (B.fullPrimitiveTable hlarge P h).sector + (resolvedPolygonMask (primitiveTests (a := a) (r := r) P) V.val) + +theorem fullGeometricSector_projection (hlarge : 15 < m+1) + (P : ι → Fin 5 × (CutRing × CutRing)) + (h : ∀ I, I.card ≤ 15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb P) + (V : polygonAlgebra a) + (hV : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) P i).val) V.val) : + (coverMap M (alternatingGenerator a r m hm)).comp (B.fullGeometricSector hlarge P h V) = + (conditionalAlternatingHom V).comp (universalProjection (alternatingGroup (Fin (m+1)))) := by + rw [fullGeometricSector,ActualLawfulTable.sector_projection] + congr 1 + ext s : 1 + exact actualPolygonTableHom_resolved _ V hV s + +end InitialCoverSystem +end FullPrimitiveSectors + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/FullSector.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/FullSector.lean new file mode 100644 index 0000000000000000000000000000000000000000..abf5657cb741522df09b7cbff2835a73656fd742 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/FullSector.lean @@ -0,0 +1,273 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.CoordinateWindowBase +import OAI.GroupTheory.SimpleAmenable.CentralCovers.FullSectorCompatibility +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.WindowSubfamilies +import OAI.GroupTheory.SimpleAmenable.CentralCovers.SmallFamilyGlobal +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.SmallControlCalculus + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section FullSectorSupport +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) {ι : Type*} [Finite ι] + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + +theorem fullGeometricSector_supported (hlarge : 15 < m+1) + (P : ι → Fin 5 × (CutRing × CutRing)) + (h : ∀ I, I.card ≤ 15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb P) + (V : polygonAlgebra a) + (hV : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) P i).val) V.val) : + SmallSupported (sourceAlignedGroup a r m hm M B.t) (B.fullGeometricSector hlarge P h V) := by + intro I + let b := smallAlphabetBalance hlarge I.val (by have hh := I.property.2; omega) + have hb : b ∉ I.val := smallAlphabetBalance_notMem hlarge I.val _ + rw [B.fullGeometricSector_inclusion hlarge P h I.val I.property.1 b hb (h _ (by have hh := I.property.2; omega) b hb) V hV] + rintro x ⟨t,rfl⟩ + exact B.geometricSector_aligned I.val b hb P _ V t + +theorem constant_small_supported : + SmallSupported (sourceAlignedGroup a r m hm M B.t) + (B.c.comp (universalProjection (alternatingGroup (Fin (m+1))))) := by + intro I + rw [MonoidHom.comp_assoc,universalMap_spec,← MonoidHom.comp_assoc,← B.initialAlphabet_zero] + rintro x ⟨t,rfl⟩ + exact B.initialAlphabet_aligned I.val 0 _ + +theorem fullGeometricSector_small_control (hlarge : 15 < m+1) + (P : ι → Fin 5 × (CutRing × CutRing)) + (h : ∀ I, I.card ≤ 15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb P) + (V W : polygonAlgebra a) (hVW : V ≤ W) : + SmallControlled B.c (B.fullGeometricSector hlarge P h V) (B.fullGeometricSector hlarge P h W) := by + intro I t x hx + exact B.fullGeometricSector_control hlarge P h V W hVW _ x hx + +theorem fullGeometricSector_commute (hlarge : 15 < m+1) + (P : ι → Fin 5 × (CutRing × CutRing)) + (h : ∀ I, I.card ≤ 15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb P) + (V W : polygonAlgebra a) + (hV : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) P i).val) V.val) + (hVW : Disjoint V.val W.val) + (s t : UniversalExtension (alternatingGroup (Fin (m+1)))) : + Commute (B.fullGeometricSector hlarge P h V s) (B.fullGeometricSector hlarge P h W t) := + (B.fullPrimitiveTable hlarge P h).sector_commute (resolvedPolygonMask_disjoint _ hV hVW) s t + +end InitialCoverSystem +end FullSectorSupport + +section FullWindowCoherence + +variable {α H : Type*} [Fintype α] [DecidableEq α] [Group H] + [Group.IsPerfect (alternatingGroup α)] + +theorem universal_five_alphabet_hom_ext (hα : 5 ≤ Fintype.card α) + (f g : UniversalExtension (alternatingGroup α) →* H) + (h : ∀ I : FiveAlphabet α, f.comp (universalMap (subtypeAlternatingHom I.val)) = + g.comp (universalMap (subtypeAlternatingHom I.val))) : f = g := by + have he : (⊤ : Subgroup (UniversalExtension (alternatingGroup α))) ≤ f.eqLocus g := by + rw [← universal_five_alphabet_generate hα] + apply iSup_le + intro I x hx + obtain ⟨s,rfl⟩ := hx + exact DFunLike.congr_fun (h I) s + ext s + exact he (Subgroup.mem_top s) + +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) {ι κ : Type*} [Finite ι] [Finite κ] + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + +theorem fullGeometricSector_subfamily (hlarge : 15 < m+1) + (P : ι → Fin 5 × (CutRing × CutRing)) (Q : κ → Fin 5 × (CutRing × CutRing)) + (v : κ → ι) (hv : P ∘ v = Q) + (h : ∀ I, I.card ≤ 15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb P) + (g : ∀ I, I.card ≤ 15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb Q) + (V : polygonAlgebra a) + (hV : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) Q i).val) V.val) : + B.fullGeometricSector hlarge Q g V = B.fullGeometricSector hlarge P h V := by + apply universal_five_alphabet_hom_ext (by simp; omega) + intro I + let b := smallAlphabetBalance hlarge I.val (by rw [I.property.2]; omega) + have hb : b ∉ I.val := smallAlphabetBalance_notMem hlarge I.val _ + have hV' : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) P i).val) V.val := by + subst Q + intro x y he + exact hV x y (fun i => he (v i)) + rw [B.fullGeometricSector_inclusion hlarge Q g I.val (by rw [I.property.2]) b hb + (g _ (by rw [I.property.2]; omega) b hb) V hV, + B.fullGeometricSector_inclusion hlarge P h I.val (by rw [I.property.2]) b hb + (h _ (by rw [I.property.2]; omega) b hb) V hV'] + exact B.geometricSector_subfamily I.val b hb P Q v hv _ _ V hV + +noncomputable def windowSector (hlarge : 15 < m+1) (n : ℕ) + (h : B.CoordinateWindowLaw n) (q : Fin 2 → ℤ) (V : polygonAlgebra a) : + UniversalExtension (alternatingGroup (Fin (m+1))) →* + BoundedRelationCover M (alternatingGenerator a r m hm) := + B.fullGeometricSector hlarge (coordinateWindowPrimitives n q) (fun I _ b hb => h I b hb q) V + +theorem windowSector_inclusion (hlarge : 15 < m+1) (n k : ℕ) + (h : B.CoordinateWindowLaw n) (g : B.CoordinateWindowLaw k) + (q p : Fin 2 → ℤ) (hs : ∀ j, q j ≤ p j) (he : ∀ j, p j+(k:ℤ) ≤ q j+n) + (V : polygonAlgebra a) + (hV : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) + (coordinateWindowPrimitives k p) i).val) V.val) : + B.windowSector hlarge k g p V = B.windowSector hlarge n h q V := + B.fullGeometricSector_subfamily hlarge _ _ (coordinateWindowEmbedding n k q p hs he) + (coordinateWindowEmbedding_spec n k q p hs he) _ _ V hV + +theorem windowSector_overlap_control (hlarge : 15 < m+1) (n k l : ℕ) + (h : B.CoordinateWindowLaw n) (g : B.CoordinateWindowLaw k) (g' : B.CoordinateWindowLaw l) + (q p p' : Fin 2 → ℤ) + (hs : ∀ j, q j ≤ p j) (he : ∀ j, p j+(k:ℤ) ≤ q j+n) + (hs' : ∀ j, q j ≤ p' j) (he' : ∀ j, p' j+(l:ℤ) ≤ q j+n) + (V W : polygonAlgebra a) (hVW : V ≤ W) + (hV : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) + (coordinateWindowPrimitives k p) i).val) V.val) + (hW : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) + (coordinateWindowPrimitives l p') i).val) W.val) : + SmallControlled B.c (B.windowSector hlarge k g p V) (B.windowSector hlarge l g' p' W) := by + rw [B.windowSector_inclusion hlarge n k h g q p hs he V hV, + B.windowSector_inclusion hlarge n l h g' q p' hs' he' W hW] + exact B.fullGeometricSector_small_control hlarge _ _ V W hVW + +end InitialCoverSystem +end FullWindowCoherence + +section AxisWindows + +noncomputable def axisWindowPrimitives (j : Fin 2) (k : ℕ) (p : ℤ) : + Fin (k-1) → Fin 5 × (CutRing × CutRing) := fun i => + (coordinateTestIndex j,coordinateShift j (((p+(i.val:ℤ)):CutRing)*cutTau)) + +theorem axisInterval_resolved {a : ℕ} {r : CutRing} (j : Fin 2) (k : ℕ) (p : ℤ) + (u v : CutRing) (hu : p ≤ endpointLabel u ∧ endpointLabel u < p+k) + (hv : p ≤ endpointLabel v ∧ endpointLabel v < p+k) : + ResolvedBy (fun i => (InitialCoverSystem.primitiveTests (a := a) (r := r) + (axisWindowPrimitives j k p) i).val) (coordinateInterval a j u v).val := by + let A := resolvedAlgebra (fun i => (InitialCoverSystem.primitiveTests (a := a) (r := r) + (axisWindowPrimitives j k p) i).val) + have hbetween (s t : ℕ) (hst : s ≤ t) (ht : t < k) : + coordinateBetween a j (((p+(s:ℤ)):CutRing)*cutTau) + (((p+(t:ℤ)):CutRing)*cutTau) ∈ A := by + have hh := coordinate_prefix_generated A j (((p+(s:ℤ)):CutRing)*cutTau) (t-s) + have he : (((p+(s:ℤ)):CutRing)*cutTau)+((t-s:ℕ):CutRing)*cutTau = + (((p+(t:ℤ)):CutRing)*cutTau) := by + push_cast + rw [Nat.cast_sub hst] + ring + rw [he] at hh + apply hh + intro i hi + have hi' : s+i < k-1 := by omega + have hh := resolved_test (fun z => (InitialCoverSystem.primitiveTests (a := a) (r := r) + (axisWindowPrimitives j k p) z).val) ⟨s+i,hi'⟩ + change (spatialTranslate (coordinateShift j (((p+((s+i:ℕ):ℤ)):CutRing)*cutTau)) + (initialTest a r (coordinateTestIndex j))).val ∈ A at hh + rw [initialTest_coordinate] at hh + convert hh using 1 + congr 3 + push_cast + ring + have hall (s t : ℕ) (hs : s < k) (ht : t < k) : + coordinateBetween a j (((p+(s:ℤ)):CutRing)*cutTau) + (((p+(t:ℤ)):CutRing)*cutTau) ∈ A := by + by_cases hst : s ≤ t + · exact hbetween s t hst ht + · let u' : CutRing := ((p+(s:ℤ)):CutRing)*cutTau + let v' : CutRing := ((p+(t:ℤ)):CutRing)*cutTau + by_cases he : Int.fract (ordinary (v'-u')) = 0 + · rw [coordinateBetween_empty j u' v' he] + exact BooleanSubalgebra.bot_mem + · have hh := hbetween t s (by omega) hs + rw [coordinateBetween_reverse j u' v' he] at hh + simpa only [compl_compl] using BooleanSubalgebra.compl_mem hh + let s := (endpointLabel u-p).toNat + let t := (endpointLabel v-p).toNat + have hs : (s:ℤ) = endpointLabel u-p := Int.toNat_of_nonneg (by omega) + have ht : (t:ℤ) = endpointLabel v-p := Int.toNat_of_nonneg (by omega) + have hu' : u = (((p+(s:ℤ)):CutRing)*cutTau)+(u.re:CutRing) := by + apply QuadraticAlgebra.ext <;> simp [cutTau,hs,endpointLabel] + have hv' : v = (((p+(t:ℤ)):CutRing)*cutTau)+(v.re:CutRing) := by + apply QuadraticAlgebra.ext <;> simp [cutTau,ht,endpointLabel] + change coordinateBetween a j u v ∈ A + rw [hu',hv',coordinateBetween_period] + exact hall s t (by omega) (by omega) + +def axisWindowEmbedding (j : Fin 2) (n k : ℕ) (q : Fin 2 → ℤ) (p : ℤ) + (hs : q j ≤ p) (he : p+(k:ℤ) ≤ q j+n) : Fin (k-1) → Fin 2 × Fin (n-1) := + fun i => (j,⟨(p-q j).toNat+i.val,by + have hh : ((p-q j).toNat:ℤ) = p-q j := Int.toNat_of_nonneg (by omega) + have hi := i.isLt + omega⟩) + +theorem axisWindowEmbedding_spec (j : Fin 2) (n k : ℕ) (q : Fin 2 → ℤ) (p : ℤ) + (hs : q j ≤ p) (he : p+(k:ℤ) ≤ q j+n) : + coordinateWindowPrimitives n q ∘ axisWindowEmbedding j n k q p hs he = + axisWindowPrimitives j k p := by + funext i + apply Prod.ext + · rfl + · change coordinateShift j (((q j+(((p-q j).toNat+i.val:ℕ):ℤ)):CutRing)*cutTau) = _ + have hh : ((p-q j).toNat:ℤ) = p-q j := Int.toNat_of_nonneg (by omega) + simp only [Nat.cast_add,hh] + congr 2 + push_cast + ring + +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + +omit [Group.IsPerfect (alternatingGroup (Fin (m+1)))] in +theorem axisFamilyLaw (n : ℕ) (h : B.CoordinateWindowLaw n) (j : Fin 2) + (k : ℕ) (hk : k ≤ n) (p : ℤ) (I : Finset (Fin (m+1))) + (b : Fin (m+1)) (hb : b ∉ I) : B.PrimitiveFamilyLaw I b hb (axisWindowPrimitives j k p) := + PrimitiveFamilyLaw.reindex B I b hb (coordinateWindowPrimitives k (fun _ => p)) + (CoordinateWindowLaw.mono B h hk I b hb (fun _ => p)) (fun i => (j,i)) + +noncomputable def axisSector (hlarge : 15 < m+1) (n : ℕ) (h : B.CoordinateWindowLaw n) + (j : Fin 2) (k : ℕ) (hk : k ≤ n) (p : ℤ) (V : polygonAlgebra a) : + UniversalExtension (alternatingGroup (Fin (m+1))) →* + BoundedRelationCover M (alternatingGenerator a r m hm) := + B.fullGeometricSector hlarge (axisWindowPrimitives j k p) + (fun I _ b hb => B.axisFamilyLaw n h j k hk p I b hb) V + +theorem axisSector_in_window (hlarge : 15 < m+1) (n : ℕ) (h : B.CoordinateWindowLaw n) + (j : Fin 2) (k : ℕ) (hk : k ≤ n) (p : ℤ) (q : Fin 2 → ℤ) + (hs : q j ≤ p) (he : p+(k:ℤ) ≤ q j+n) (V : polygonAlgebra a) + (hV : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) + (axisWindowPrimitives j k p) i).val) V.val) : + B.axisSector hlarge n h j k hk p V = B.windowSector hlarge n h q V := + B.fullGeometricSector_subfamily hlarge _ _ (axisWindowEmbedding j n k q p hs he) + (axisWindowEmbedding_spec j n k q p hs he) _ _ V hV + +theorem axisSector_overlap_control (hlarge : 15 < m+1) (n : ℕ) (h : B.CoordinateWindowLaw n) + (j : Fin 2) (k l : ℕ) (hk : k ≤ n) (hl : l ≤ n) (p q z : ℤ) + (hsp : z ≤ p) (hep : p+(k:ℤ) ≤ z+n) + (hsq : z ≤ q) (heq : q+(l:ℤ) ≤ z+n) (V W : polygonAlgebra a) (hVW : V ≤ W) + (hV : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) + (axisWindowPrimitives j k p) i).val) V.val) + (hW : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) + (axisWindowPrimitives j l q) i).val) W.val) : + SmallControlled B.c (B.axisSector hlarge n h j k hk p V) + (B.axisSector hlarge n h j l hl q W) := by + rw [B.axisSector_in_window hlarge n h j k hk p (fun _ => z) hsp hep V hV, + B.axisSector_in_window hlarge n h j l hl q (fun _ => z) hsq heq W hW] + exact B.fullGeometricSector_small_control hlarge _ _ V W hVW + +end InitialCoverSystem +end AxisWindows + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/FullSectorCompatibility.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/FullSectorCompatibility.lean new file mode 100644 index 0000000000000000000000000000000000000000..145bc4ee7360a7a6c0b3dde1afdb34586aa2c43c --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/FullSectorCompatibility.lean @@ -0,0 +1,84 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.FullAlphabetGeneration + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section FullSectorCompatibility +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) {ι : Type*} [Finite ι] + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + +theorem fullGeometricSector_mem (hlarge : 15 < m+1) + (P : ι → Fin 5 × (CutRing × CutRing)) + (h : ∀ I, I.card ≤ 15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb P) + (V : polygonAlgebra a) (s : UniversalExtension (alternatingGroup (Fin (m+1)))) : + B.fullGeometricSector hlarge P h V s ∈ + (smallFamilyEval (B.smallPrimitiveInputs hlarge P)).range := + (B.fullPrimitiveTable hlarge P h).sector_mem _ s + +theorem fullGeometricSector_inclusion (hlarge : 15 < m+1) + (P : ι → Fin 5 × (CutRing × CutRing)) + (h : ∀ I, I.card ≤ 15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb P) + (I : Finset (Fin (m+1))) (hI : 5 ≤ I.card) [Group.IsPerfect (alternatingGroup I)] + (b : Fin (m+1)) (hb : b ∉ I) (g : B.PrimitiveFamilyLaw I b hb P) + (V : polygonAlgebra a) + (hV : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) P i).val) V.val) : + (B.fullGeometricSector hlarge P h V).comp (universalMap (subtypeAlternatingHom I)) = + B.geometricSector I b hb P g V := by + apply CentralOn.lift_unique (coverMap M (alternatingGenerator a r m hm)) + (smallFamilyEval (B.smallPrimitiveInputs hlarge P)).range + (B.fullPrimitiveFamily_central hlarge P h) + · rintro x ⟨s,rfl⟩ + exact B.fullGeometricSector_mem hlarge P h V _ + · rintro x ⟨s,rfl⟩ + exact B.primitiveFamily_range_full hlarge P I hI b hb + (B.geometricSector_mem I b hb P g V s) + · rw [← MonoidHom.comp_assoc,B.fullGeometricSector_projection hlarge P h V hV, + B.geometricSector_projection I b hb P g V hV,MonoidHom.comp_assoc,universalMap_spec, + MonoidHom.comp_assoc] + +theorem fullGeometricSector_whole (hlarge : 15 < m+1) + (P : ι → Fin 5 × (CutRing × CutRing)) + (h : ∀ I, I.card ≤ 15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb P) : + B.fullGeometricSector hlarge P h (wholePolygon a) = + B.c.comp (universalProjection (alternatingGroup (Fin (m+1)))) := by + apply CentralOn.lift_unique (coverMap M (alternatingGenerator a r m hm)) + (smallFamilyEval (B.smallPrimitiveInputs hlarge P)).range + (B.fullPrimitiveFamily_central hlarge P h) + · rintro x ⟨s,rfl⟩ + exact B.fullGeometricSector_mem hlarge P h _ s + · rintro x ⟨s,rfl⟩ + exact B.constant_range_full hlarge P ⟨universalProjection _ s,rfl⟩ + · rw [B.fullGeometricSector_projection hlarge P h _ + (show ResolvedBy _ (wholePolygon a).val from fun x y he => Iff.rfl), + ← MonoidHom.comp_assoc,B.c_projection] + +theorem fullGeometricSector_control (hlarge : 15 < m+1) + (P : ι → Fin 5 × (CutRing × CutRing)) + (h : ∀ I, I.card ≤ 15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb P) + (V W : polygonAlgebra a) (hVW : V ≤ W) : + SameActionOn (B.fullGeometricSector hlarge P h W) + (B.c.comp (universalProjection (alternatingGroup (Fin (m+1))))) + (B.fullGeometricSector hlarge P h V).range := by + rw [← B.fullGeometricSector_whole hlarge P h] + unfold fullGeometricSector + change SameActionOn _ ((B.fullPrimitiveTable hlarge P h).sector + (resolvedPolygonMask (primitiveTests (a := a) (r := r) P) Set.univ)) _ + rw [resolvedPolygonMask_univ] + exact (B.fullPrimitiveTable hlarge P h).sector_control (resolvedPolygonMask_mono _ hVW) + +end InitialCoverSystem +end FullSectorCompatibility + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/GenerationUpstairs.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/GenerationUpstairs.lean new file mode 100644 index 0000000000000000000000000000000000000000..2def2bf0c84807869e496a943aaf752a98593034 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/GenerationUpstairs.lean @@ -0,0 +1,86 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.InitialCoverSystem + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section GenerationUpstairs +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + +theorem sourceAlignedGroup_univ_eq_top : + sourceAlignedGroup a r m hm M B.t Finset.univ=⊤ := by + classical + let H := sourceAlignedGroup a r m hm M B.t Finset.univ + have hx (b : SmallConditional m) : PresentedGroup.of (Sum.inl b) ∈ H := + alignedGroup_input B.t _ _ b (Finset.subset_univ _) + have ht (u : Multiplicative (FreeAbelianGroup (Fin m × Fin 2))) : + B.t u ∈ (Subgroup.normalizer (H : Set (BoundedRelationCover M (alternatingGenerator a r m hm)))) := by + rw [Subgroup.mem_normalizer_iff] + intro y + constructor + · exact alignedGroup_conjugate B.t _ _ u + · intro hy + have hh := alignedGroup_conjugate B.t _ _ u⁻¹ hy + have he : B.t u⁻¹*(B.t u*y*(B.t u)⁻¹)*(B.t u⁻¹)⁻¹=y := by + rw [map_inv]; group + rw [he] at hh + exact hh + have hn : (Subgroup.normalizer (H : Set (BoundedRelationCover M (alternatingGenerator a r m hm))))=⊤ := by + apply top_unique + intro z _ + apply PresentedGroup.generated_by _ (Subgroup.normalizer (H : Set (BoundedRelationCover M (alternatingGenerator a r m hm)))) _ z + intro j + cases j with + | inl b => exact H.le_normalizer (hx b) + | inr k => + have hh := ht (Multiplicative.ofAdd (FreeAbelianGroup.of k)) + rw [B.t_base] at hh + exact hh + let : H.Normal := Subgroup.normalizer_eq_top_iff.mp hn + let q := QuotientGroup.mk' H + let f := q.comp B.t + have hgen (z : BoundedRelationCover M (alternatingGenerator a r m hm)) : + q z ∈ f.range := by + change z ∈ f.range.comap q + apply PresentedGroup.generated_by _ (f.range.comap q) _ z + intro j + cases j with + | inl b => + change q (PresentedGroup.of (Sum.inl b)) ∈ f.range + have he : q (PresentedGroup.of (Sum.inl b))=1 := (QuotientGroup.eq_one_iff _).mpr (hx b) + rw [he] + exact f.range.one_mem + | inr k => + change q (PresentedGroup.of (Sum.inr k)) ∈ f.range + refine ⟨Multiplicative.ofAdd (FreeAbelianGroup.of k),?_⟩ + exact congrArg q (B.t_base k) + have hf : Function.Surjective f := by + intro z + obtain ⟨w,rfl⟩ := QuotientGroup.mk'_surjective H z + exact hgen w + let : Group.IsPerfect (BoundedRelationCover M (alternatingGenerator a r m hm)) := B.perfect + let : IsMulCommutative (BoundedRelationCover M (alternatingGenerator a r m hm) ⧸ H) := + IsMulCommutative.of_comm (by + intro x y + obtain ⟨u,rfl⟩ := hf x + obtain ⟨v,rfl⟩ := hf y + rw [← map_mul,← map_mul,mul_comm]) + apply top_unique + intro z _ + exact (QuotientGroup.eq_one_iff _).mp (Subsingleton.elim (q z) 1) + +end InitialCoverSystem +end GenerationUpstairs + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/GenuineFiniteGeneration.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/GenuineFiniteGeneration.lean new file mode 100644 index 0000000000000000000000000000000000000000..c4f5ba33952f7609b2e571043d215ca100eda1e6 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/GenuineFiniteGeneration.lean @@ -0,0 +1,269 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.ShiftedSlots +import OAI.GroupTheory.SimpleAmenable.CentralCovers.BoundedRelationCover +import OAI.GroupTheory.SimpleAmenable.Configurations.FiveTrackGeneration +import OAI.GroupTheory.SimpleAmenable.CentralCovers.PrimitiveGeometricGeneration + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section GenuineFiniteGeneration + +theorem fiveTrackBoolean_polygon (a : ℕ) (r : CutRing) (m : ℕ) + (hr : 0 < ordinary r ∧ ordinary r < 1/2) + (ι : Fin 5 ↪ Fin (m+1)) (b : Fin (m+1)) (hb : b ∉ Set.range ι) + (U : polygonAlgebra a) : U.val ∈ fiveTrackBoolean a r m ι := by + let B := fiveTrackBoolean a r m ι + have hcoord := fiveTrackBoolean_coordinate a r m ι b hb + have htrans := fun u U hU => fiveTrackBoolean_translate a r m ι b hb u (U := U) hU + apply polygon_induction (P := fun U => U ∈ B) ?_ BooleanSubalgebra.bot_mem + (fun _ _ hU hV => BooleanSubalgebra.sup_mem hU hV) + (fun _ hU => BooleanSubalgebra.compl_mem hU) U.property + intro j z + fin_cases j + · exact hcoord 0 z + · exact hcoord 1 z + · exact slope_cuts_generated r hr B htrans hcoord 2 (Or.inl rfl) + (fiveTrackBoolean_initial a r m ι 3) z + · exact slope_cuts_generated r hr B htrans hcoord 3 (Or.inr rfl) + (fiveTrackBoolean_initial a r m ι 4) z + +theorem fiveTrack_polygon_generated (a : ℕ) (r : CutRing) (m : ℕ) + (hr : 0 < ordinary r ∧ ordinary r < 1/2) + (ι : Fin 5 ↪ Fin (m+1)) (b : Fin (m+1)) (hb : b ∉ Set.range ι) + (U : polygonAlgebra a) : ConditionalAvailable (fiveTrackHom ι) (sourceGenerated a r m) U := by + obtain ⟨_,h⟩ := fiveTrackBoolean_polygon a r m hr ι b hb U + exact h + +private theorem extend_three_tracks {m : ℕ} (hm : 15 ≤ m) (s : Fin 3 ↪ Fin m) : + ∃ (ι : Fin 5 ↪ Fin m) (b : Fin m), (∀ i, ι (threeInFive i) = s i) ∧ b ∉ Set.range ι := by + obtain ⟨e,he⟩ := fresh_nine_tracks hm s s + let t : Fin 5 → Fin m := ![s 0,s 1,s 2,e 0,e 1] + have hs : Function.Injective t := by + intro i j hij + fin_cases i <;> fin_cases j + all_goals dsimp only [t,Matrix.cons_val_zero,Matrix.cons_val_one,Matrix.cons_val_two, + Matrix.cons_val_three,Matrix.cons_val_four] at hij + all_goals first | rfl | exact False.elim (by have := s.injective hij; contradiction) | + exact False.elim (by have := e.injective hij; contradiction) | + exact False.elim ((he _ _).1 hij) | exact False.elim ((he _ _).1 hij.symm) + refine ⟨⟨t,hs⟩,e 2,?_,?_⟩ + · intro i + fin_cases i <;> rfl + · rintro ⟨i,hi⟩ + fin_cases i + all_goals dsimp only [Function.Embedding.coeFn_mk,t,Matrix.cons_val_zero,Matrix.cons_val_one, + Matrix.cons_val_two,Matrix.cons_val_three,Matrix.cons_val_four] at hi + all_goals first | exact (he _ _).1 hi.symm | + exact False.elim (by have := e.injective hi; contradiction) + +theorem trackCycle_viaEmbedding {m n : ℕ} (ι : Fin m ↪ Fin n) (s : Fin 3 ↪ Fin m) : + (trackCycle s).viaEmbedding ι = trackCycle (s.trans ι) := by + apply Equiv.ext + intro x + by_cases hx : x ∈ Set.range ι + · obtain ⟨y,rfl⟩ := hx + rw [Equiv.Perm.viaEmbedding_apply] + by_cases hy : y ∈ Set.range s + · obtain ⟨i,rfl⟩ := hy + rw [trackCycle_apply] + exact (trackCycle_apply (s.trans ι) i).symm + · rw [trackCycle_apply_of_notMem s hy,trackCycle_apply_of_notMem (s.trans ι)] + rintro ⟨i,hi⟩ + exact hy ⟨i,ι.injective hi⟩ + · rw [Equiv.Perm.viaEmbedding_apply_of_notMem _ _ _ hx,trackCycle_apply_of_notMem] + rintro ⟨i,hi⟩ + exact hx ⟨s i,hi⟩ + +theorem conditional_cycle_generated (a : ℕ) (r : CutRing) (m : ℕ) + (hr : 0 < ordinary r ∧ ordinary r < 1/2) (hm : 15 ≤ m+1) + (U : polygonAlgebra a) (s : Fin 3 ↪ Fin (m+1)) : + conditionalHom U (trackCycle s) ∈ sourceGenerated a r m := by + obtain ⟨ι,b,he,hb⟩ := extend_three_tracks hm s + have hg : trackCycle threeInFive ∈ alternatingGroup (Fin 5) := by + rw [Equiv.Perm.mem_alternatingGroup] + decide + have h := fiveTrack_polygon_generated a r m hr ι b hb U ⟨trackCycle threeInFive,hg⟩ + change conditionalHom U ((trackCycle threeInFive).viaEmbedding ι) ∈ _ at h + rw [trackCycle_viaEmbedding] at h + have hs : threeInFive.trans ι = s := Function.Embedding.ext he + simpa only [hs] using h + +noncomputable def offsetFrame {m n : ℕ} (s : Fin n ↪ Fin m) (b : Fin m) + (u : Fin n → CutRing × CutRing) : Fin m → CutRing × CutRing := + ∑ i, (Pi.single (s i) (u i) - Pi.single b (u i)) + +theorem offsetFrame_apply {m n : ℕ} (s : Fin n ↪ Fin m) (b : Fin m) + (hb : b ∉ Set.range s) (u : Fin n → CutRing × CutRing) (i : Fin n) : + offsetFrame s b u (s i) = u i := by + classical + have hbi : s i ≠ b := fun h => hb ⟨i,h⟩ + simp only [offsetFrame,Finset.sum_apply,Pi.sub_apply,Pi.single_apply, hbi,ite_false,sub_zero] + have he : (∑ j : Fin n, if s i = s j then u j else 0) = u i := by + simp only [s.injective.eq_iff] + simp + exact he + +theorem offsetFrame_generated (a : ℕ) (r : CutRing) (m n : ℕ) + (s : Fin n ↪ Fin (m+1)) (b : Fin (m+1)) (u : Fin n → CutRing × CutRing) : + trackTranslation (a := a) (offsetFrame s b u) ∈ sourceGenerated a r m := by + classical + unfold offsetFrame + induction (Finset.univ : Finset (Fin n)) using Finset.induction_on with + | empty => simp [trackTranslation_zero] + | @insert i t hi ih => + rw [Finset.sum_insert hi,trackTranslation_add] + exact (sourceGenerated a r m).mul_mem (balanced_difference_generated a r m b (s i) (u i)) ih + +theorem distinct_track_cycle_generated (a : ℕ) (r : CutRing) (m : ℕ) + (hr : 0 < ordinary r ∧ ordinary r < 1/2) (hm : 15 ≤ m+1) + (U : polygonAlgebra a) (s : Fin 3 → Fin (m+1) × (CutRing × CutRing)) + (ht : Function.Injective (fun i => (s i).1)) + (hs : Function.Injective (SlotMap a (m+1) U s)) : + slotHom U s hs (trackCycle (Function.Embedding.refl _)) ∈ sourceGenerated a r m := by + classical + let ι : Fin 3 ↪ Fin (m+1) := ⟨fun i => (s i).1,ht⟩ + obtain ⟨b,c,_,hb,_⟩ := two_spare_tracks (by omega : 5 ≤ m+1) ι + have hb' : b ∉ Set.range ι := by rintro ⟨i,hi⟩; exact hb i hi + let d := offsetFrame ι b (fun i => (s i).2) + have hd := offsetFrame_generated a r m 3 ι b (fun i => (s i).2) + have heq : trackTranslation (a := a) d * conditionalHom U (trackCycle ι) * + (trackTranslation d)⁻¹ = slotHom U s hs (trackCycle (Function.Embedding.refl _)) := by + have he (i : Fin 3) (x : U.val) : + (trackTranslation (a := a) d).val (ι i,x.val) = SlotMap a (m+1) U s (i,x) := by + change (ι i,translate a (d (ι i)) x.val) = _ + dsimp only [d] + rw [offsetFrame_apply ι b hb'] + rfl + apply Subtype.ext + apply Equiv.ext + intro y + obtain ⟨p,rfl⟩ := (trackTranslation (a := a) d).val.surjective y + change (trackTranslation (a := a) d).val + (conditionalPerm U (trackCycle ι) ((trackTranslation d).val.symm ((trackTranslation d).val p))) = _ + rw [Equiv.symm_apply_apply] + by_cases hx : p.2 ∈ U.val + · by_cases hi : p.1 ∈ Set.range ι + · obtain ⟨i,hi⟩ := hi + obtain ⟨j,x⟩ := p + dsimp at hx hi + subst j + change (trackTranslation (a := a) d).val + (if x ∈ U.val then trackCycle ι (ι i) else ι i,x) = _ + simp only [hx,ite_true,trackCycle_apply] + rw [he (i+1) ⟨x,hx⟩,he i ⟨x,hx⟩] + change _ = slotPerm U s hs _ _ + rw [slotPerm_apply] + have hz := trackCycle_apply (Function.Embedding.refl (Fin 3)) i + change trackCycle (Function.Embedding.refl (Fin 3)) i = i+1 at hz + rw [hz] + · have hf : conditionalPerm U (trackCycle ι) p = p := by + simp [conditionalPerm,trackCycle_apply_of_notMem ι hi] + rw [hf] + symm + apply slotPerm_apply_of_notMem + rintro ⟨⟨i,x⟩,hi'⟩ + rw [← he] at hi' + have hh := (trackTranslation (a := a) d).val.injective hi' + exact hi ⟨i,congrArg Prod.fst hh⟩ + · have hf : conditionalPerm U (trackCycle ι) p = p := by + change (if p.2 ∈ U.val then trackCycle ι p.1 else p.1,p.2) = p + simp only [hx,ite_false] + rw [hf] + symm + apply slotPerm_apply_of_notMem + rintro ⟨⟨i,x⟩,hi'⟩ + rw [← he] at hi' + have hh := (trackTranslation (a := a) d).val.injective hi' + exact hx (congrArg Prod.snd hh ▸ x.property) + rw [← heq] + exact (sourceGenerated a r m).mul_mem + ((sourceGenerated a r m).mul_mem hd (conditional_cycle_generated a r m hr hm U ι)) + ((sourceGenerated a r m).inv_mem hd) + +private def starThreeInFive (i : Fin 3) : Fin 3 ↪ Fin 5 := + ⟨![threeInFive i,3,4],by fin_cases i <;> decide⟩ + +private theorem star_cycle_identity : + trackCycle (starThreeInFive 0) * trackCycle (starThreeInFive 1) * + trackCycle (starThreeInFive 2) * trackCycle (starThreeInFive 0) * + trackCycle (starThreeInFive 1) = trackCycle threeInFive := by decide + +theorem threeSlot_generated (a : ℕ) (r : CutRing) (m : ℕ) + (hr : 0 < ordinary r ∧ ordinary r < 1/2) (hm : 15 ≤ m+1) + (g : polygonFullGroup a (m+1)) (hg : IsThreeSlotCycle g) : + g ∈ sourceGenerated a r m := by + obtain ⟨U,s,hs,rfl⟩ := threeSlot_eq_slotHom hg + obtain ⟨k,l,hkl,hk,hl⟩ := two_spare_tracks (by omega : 5 ≤ m+1) (fun i => (s i).1) + let S := extendSlots s k l + have hS := extendSlots_injective U s hs k l hkl hk hl + let φ := slotHom U S hS + have hi (i : Fin 3) : φ (trackCycle (starThreeInFive i)) ∈ sourceGenerated a r m := by + rw [slotHom_subcycle] + apply distinct_track_cycle_generated a r m hr hm + intro j n he + fin_cases i <;> fin_cases j <;> fin_cases n + all_goals dsimp [S,starThreeInFive,extendSlots,threeInFive] at he + all_goals first | rfl | exact False.elim (hkl he) | exact False.elim (hkl he.symm) | + exact False.elim (hk _ he) | exact False.elim (hl _ he) | + exact False.elim (hk _ he.symm) | exact False.elim (hl _ he.symm) + have h := (sourceGenerated a r m).mul_mem + ((sourceGenerated a r m).mul_mem ((sourceGenerated a r m).mul_mem + ((sourceGenerated a r m).mul_mem (hi 0) (hi 1)) (hi 2)) (hi 0)) (hi 1) + simp only [← map_mul,star_cycle_identity] at h + rw [slotHom_subcycle] at h + have he : S ∘ threeInFive = s := funext (extendSlots_three s k l) + simpa only [he] using h + +theorem sourceGenerated_eq_alternating (a : ℕ) (r : CutRing) (m : ℕ) + (hr : 0 < ordinary r ∧ ordinary r < 1/2) (hm : 15 ≤ m+1) : + sourceGenerated a r m = polygonAlternatingGroup a (m+1) := by + apply le_antisymm (sourceGenerated_le_alternating a r m (by omega)) + apply (Subgroup.closure_le _).mpr + exact threeSlot_generated a r m hr hm + +theorem polygonAlternatingGroup_fg (a : ℕ) (r : CutRing) (m : ℕ) + (hr : 0 < ordinary r ∧ ordinary r < 1/2) (hm : 15 ≤ m+1) : + Group.FG (polygonAlternatingGroup a (m+1)) := by + rw [← sourceGenerated_eq_alternating a r m hr hm] + unfold sourceGenerated + have : Finite (Set.range (sourceGenerator a r m)) := (Set.finite_range _).to_subtype + infer_instance + +theorem alternatingGenerator_surjective (a : ℕ) (r : CutRing) (m : ℕ) + (hr : 0 < ordinary r ∧ ordinary r < 1/2) (hm : 15 ≤ m+1) + (hm' : 2 ≤ m) : Function.Surjective (FreeGroup.lift (alternatingGenerator a r m hm')) := by + rw [FreeGroup.lift_surjective_iff_closure_range_eq_top] + apply Subgroup.map_injective (polygonAlternatingGroup a (m+1)).subtype_injective + rw [← MonoidHom.range_eq_map,Subgroup.range_subtype,MonoidHom.map_closure] + have he : (polygonAlternatingGroup a (m+1)).subtype '' + Set.range (alternatingGenerator a r m hm') = Set.range (sourceGenerator a r m) := by + rw [← Set.range_comp] + rfl + rw [he] + exact sourceGenerated_eq_alternating a r m hr hm + +theorem sourceCover_surjective (a : ℕ) (r : CutRing) (m L : ℕ) + (hr : 0 < ordinary r ∧ ordinary r < 1/2) (hm : 15 ≤ m+1) (hm' : 2 ≤ m) : + Function.Surjective (coverMap L (alternatingGenerator a r m hm')) := + coverMap_surjective L _ (alternatingGenerator_surjective a r m hr hm hm') + +theorem sourceCover_eventually_perfect (a : ℕ) (r : CutRing) (m : ℕ) + (hr : 0 < ordinary r ∧ ordinary r < 1/2) (hm : 15 ≤ m+1) (hm' : 2 ≤ m) : + ∃ L : ℕ, ∀ M : ℕ, L ≤ M → + Group.IsPerfect (BoundedRelationCover M (alternatingGenerator a r m hm')) := by + let := polygonAlternatingGroup_perfect a (m+1) (by omega) + exact bounded_cover_eventually_perfect _ (alternatingGenerator_surjective a r m hr hm hm') + +end GenuineFiniteGeneration + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/GeometricSectors.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/GeometricSectors.lean new file mode 100644 index 0000000000000000000000000000000000000000..3d64f31f5ff0dbb554f1beb59c400194e1e08d88 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/GeometricSectors.lean @@ -0,0 +1,147 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.ResolvedBoolean + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section GeometricSectors + +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} {ι : Type*} [Finite ι] + +theorem actualPolygonTableHom_resolved (U : ι → polygonAlgebra a) + (V : polygonAlgebra a) (hV : ResolvedBy (fun i => (U i).val) V.val) + (s : alternatingGroup (Fin (m+1))) : + actualPolygonTableHom U (sectorMask (resolvedPolygonMask U V.val) s) = + conditionalAlternatingHom V s := by + classical + apply Subtype.ext + apply Subtype.ext + apply Equiv.ext + intro p + rw [actualPolygonTableHom_apply] + change ((sectorMask (resolvedPolygonMask U V.val) s + ⟨polygonAssignment U p.2,⟨p.2,rfl⟩⟩).val p.1,p.2) = conditionalPerm V s.val p + rw [conditionalPerm_apply] + by_cases hp : p.2 ∈ V.val + · rw [sectorMask_of_mem _ _ _ ((resolvedPolygonMask_mem U V.val hV p.2).mpr hp),ite_eq_left hp] + · rw [sectorMask_of_not_mem _ _ _ (fun h => hp ((resolvedPolygonMask_mem U V.val hV p.2).mp h)),ite_eq_right hp] + rfl + +theorem actualAlphabetTableHom_resolved (I : Finset (Fin (m+1))) + (U : ι → polygonAlgebra a) (V : polygonAlgebra a) + (hV : ResolvedBy (fun i => (U i).val) V.val) : + (actualAlphabetTableHom I U).comp (sectorMask (resolvedPolygonMask U V.val)) = + (conditionalAlternatingHom V).comp (subtypeAlternatingHom I) := by + apply MonoidHom.ext + intro s + change actualPolygonTableHom U (tableAlphabetHom I (sectorMask _ s)) = _ + rw [tableAlphabetHom_mask] + exact actualPolygonTableHom_resolved U V hV (subtypeAlternatingHom I s) + +namespace InitialCoverSystem + +variable (B : InitialCoverSystem a r m hm M) + +noncomputable def geometricSector (I : Finset (Fin (m+1))) + [Group.IsPerfect (alternatingGroup I)] + (b : Fin (m+1)) (hb : b ∉ I) (P : ι → Fin 5 × (CutRing × CutRing)) + (h : B.PrimitiveFamilyLaw I b hb P) (V : polygonAlgebra a) : + UniversalExtension (alternatingGroup I) →* BoundedRelationCover M (alternatingGenerator a r m hm) := + (B.primitiveTable I b hb P h).sector (resolvedPolygonMask (primitiveTests (r := r) P) V.val) + +theorem geometricSector_projection (I : Finset (Fin (m+1))) + [Group.IsPerfect (alternatingGroup I)] + (b : Fin (m+1)) (hb : b ∉ I) (P : ι → Fin 5 × (CutRing × CutRing)) + (h : B.PrimitiveFamilyLaw I b hb P) (V : polygonAlgebra a) + (hV : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) P i).val) V.val) : + (coverMap M (alternatingGenerator a r m hm)).comp (B.geometricSector I b hb P h V) = + ((conditionalAlternatingHom V).comp (subtypeAlternatingHom I)).comp + (universalProjection (alternatingGroup I)) := by + unfold geometricSector + rw [ActualLawfulTable.sector_projection,actualAlphabetTableHom_resolved I _ V hV] + +theorem geometricSector_mem (I : Finset (Fin (m+1))) + [Group.IsPerfect (alternatingGroup I)] + (b : Fin (m+1)) (hb : b ∉ I) (P : ι → Fin 5 × (CutRing × CutRing)) + (h : B.PrimitiveFamilyLaw I b hb P) (V : polygonAlgebra a) + (s : UniversalExtension (alternatingGroup I)) : + B.geometricSector I b hb P h V s ∈ (copyFamilyEval (B.primitiveFamily I b hb P)).range := + (B.primitiveTable I b hb P h).sector_mem _ s + +theorem geometricSector_aligned (I : Finset (Fin (m+1))) + [Group.IsPerfect (alternatingGroup I)] + (b : Fin (m+1)) (hb : b ∉ I) (P : ι → Fin 5 × (CutRing × CutRing)) + (h : B.PrimitiveFamilyLaw I b hb P) (V : polygonAlgebra a) + (s : UniversalExtension (alternatingGroup I)) : + B.geometricSector I b hb P h V s ∈ sourceAlignedGroup a r m hm M B.t I := + B.primitiveFamily_aligned I b hb P (B.geometricSector_mem I b hb P h V s) + +theorem geometricSector_commute (I : Finset (Fin (m+1))) + [Group.IsPerfect (alternatingGroup I)] + (b : Fin (m+1)) (hb : b ∉ I) (P : ι → Fin 5 × (CutRing × CutRing)) + (h : B.PrimitiveFamilyLaw I b hb P) (V W : polygonAlgebra a) + (hV : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) P i).val) V.val) + (hd : Disjoint V.val W.val) (s t : UniversalExtension (alternatingGroup I)) : + Commute (B.geometricSector I b hb P h V s) (B.geometricSector I b hb P h W t) := + (B.primitiveTable I b hb P h).sector_commute (resolvedPolygonMask_disjoint _ hV hd) s t + +theorem geometricSector_union (I : Finset (Fin (m+1))) + [Group.IsPerfect (alternatingGroup I)] + (b : Fin (m+1)) (hb : b ∉ I) (P : ι → Fin 5 × (CutRing × CutRing)) + (h : B.PrimitiveFamilyLaw I b hb P) (V W : polygonAlgebra a) + (hV : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) P i).val) V.val) + (hd : Disjoint V.val W.val) (s : UniversalExtension (alternatingGroup I)) : + B.geometricSector I b hb P h (V ⊔ W) s = + B.geometricSector I b hb P h V s * B.geometricSector I b hb P h W s := by + unfold geometricSector + change (B.primitiveTable I b hb P h).sector (resolvedPolygonMask _ (V.val ∪ W.val)) s = _ + rw [resolvedPolygonMask_union] + exact DFunLike.congr_fun ((B.primitiveTable I b hb P h).sector_union + (resolvedPolygonMask_disjoint _ hV hd)) s + +omit [Finite ι] in + +theorem primitiveFamily_range_reindex {κ : Type*} (I : Finset (Fin (m+1))) + (b : Fin (m+1)) (hb : b ∉ I) (P : ι → Fin 5 × (CutRing × CutRing)) (v : κ → ι) : + (copyFamilyEval (B.primitiveFamily I b hb (P ∘ v))).range ≤ + (copyFamilyEval (B.primitiveFamily I b hb P)).range := by + rw [copyFamilyEval_range,copyFamilyEval_range] + apply iSup_le + intro i + cases i with + | none => exact le_iSup (fun z => (B.primitiveFamily I b hb P z).range) none + | some j => exact le_iSup (fun z => (B.primitiveFamily I b hb P z).range) (some (v j)) + +theorem geometricSector_reindex {κ : Type*} [Finite κ] (I : Finset (Fin (m+1))) + [Group.IsPerfect (alternatingGroup I)] + (b : Fin (m+1)) (hb : b ∉ I) (P : ι → Fin 5 × (CutRing × CutRing)) (v : κ → ι) + (h : B.PrimitiveFamilyLaw I b hb P) (g : B.PrimitiveFamilyLaw I b hb (P ∘ v)) + (V : polygonAlgebra a) + (hV : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) (P ∘ v) i).val) V.val) : + B.geometricSector I b hb (P ∘ v) g V = B.geometricSector I b hb P h V := by + apply CentralOn.lift_unique (coverMap M (alternatingGenerator a r m hm)) + (copyFamilyEval (B.primitiveFamily I b hb P)).range h + · rintro x ⟨s,rfl⟩ + exact B.primitiveFamily_range_reindex I b hb P v + (B.geometricSector_mem I b hb (P ∘ v) g V s) + · rintro x ⟨s,rfl⟩ + exact B.geometricSector_mem I b hb P h V s + · have hV' : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) P i).val) V.val := by + intro x y he + exact hV x y (fun j => he (v j)) + rw [B.geometricSector_projection I b hb (P ∘ v) g V hV, + B.geometricSector_projection I b hb P h V hV'] + +end InitialCoverSystem +end GeometricSectors + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/GlobalAlignedCentrality.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/GlobalAlignedCentrality.lean new file mode 100644 index 0000000000000000000000000000000000000000..98b5bbd2e605ea52afcb31a4d0585002eba7f2cb --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/GlobalAlignedCentrality.lean @@ -0,0 +1,110 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.PrimitiveCentralLaws + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section GlobalAlignedCentrality + +variable {H Q ι : Type*} [Group H] [Group Q] + +theorem CentralOn.iSup_directed (q : H →* Q) (S : ι → Subgroup H) [Nonempty ι] + (hd : Directed (· ≤ ·) S) (h : ∀ i, CentralOn q (S i)) : CentralOn q (⨆ i, S i) := by + rw [centralOn_iff] + intro x hx hqx y hy + obtain ⟨i,hi⟩ := (Subgroup.mem_iSup_of_directed hd).mp hx + obtain ⟨j,hj⟩ := (Subgroup.mem_iSup_of_directed hd).mp hy + obtain ⟨k,hik,hjk⟩ := hd i j + exact (centralOn_iff q (S k)).mp (h k) x (hik hi) hqx y (hjk hj) + +theorem centralOn_iSup_of_finite (q : H →* Q) (S : ι → Subgroup H) + (h : ∀ F : Finset ι, CentralOn q (⨆ i : F, S i.val)) : CentralOn q (⨆ i, S i) := by + classical + let T : Finset ι → Subgroup H := fun F => ⨆ i : F, S i.val + have hmono : Monotone T := by + intro F F' hFF' + apply iSup_le + intro i + exact le_iSup (fun j : F' => S j.val) ⟨i.val,hFF' i.property⟩ + have hdir : Directed (· ≤ ·) T := fun F F' => + ⟨F ∪ F',hmono Finset.subset_union_left,hmono Finset.subset_union_right⟩ + have he : (⨆ F, T F) = ⨆ i, S i := by + apply le_antisymm + · apply iSup_le + intro F + exact iSup_le (fun i => le_iSup S i.val) + · apply iSup_le + intro i + exact (le_iSup (fun j : ({i} : Finset ι) => S j.val) ⟨i,Finset.mem_singleton_self i⟩).trans + (le_iSup T {i}) + rw [← he] + exact CentralOn.iSup_directed q T hdir h + +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + (hlarge : 15 < m+1) (h : B.AllPrimitiveLaws) (hr : 0 V.val) + +theorem polygonStar_control (V W : polygonAlgebra a) (hVW : V ≤ W) : + SameActionOn (B.polygonStar hlarge h hr W) + (B.c.comp (universalProjection (alternatingGroup (Fin (m+1))))) + (B.polygonStar hlarge h hr V).range := by + let R : Bool → polygonAlgebra a := fun b => if b then W else V + obtain ⟨S,hS⟩ := polygon_family_primitive_resolution r hr R + have hV := hS false + have hW := hS true + change ResolvedBy _ V.val at hV + change ResolvedBy _ W.val at hW + rw [B.polygonStar_eq hlarge h hr (fun p : S => p.val) V hV, + B.polygonStar_eq hlarge h hr (fun p : S => p.val) W hW] + exact B.fullGeometricSector_control hlarge _ _ V W hVW + +theorem polygonStar_empty : B.polygonStar hlarge h hr ⊥ = 1 := by + apply CentralOn.lift_unique (coverMap M (alternatingGenerator a r m hm)) + (⨆ V : polygonAlgebra a, (B.polygonStar hlarge h hr V).range) + (B.polygonStars_central hlarge h hr) + · exact le_iSup (fun V : polygonAlgebra a => (B.polygonStar hlarge h hr V).range) ⊥ + · rintro x ⟨s,rfl⟩ + exact Subgroup.one_mem _ + · rw [B.polygonStar_projection hlarge h hr] + ext s : 1 + apply Subtype.ext + apply Subtype.ext + apply Equiv.ext + intro p + change conditionalPerm (⊥ : polygonAlgebra a) (universalProjection _ s).val p = p + simp [conditionalPerm] + +end InitialCoverSystem + +theorem polygon_law_cover_eventually {a m : ℕ} {r : CutRing} {hm : 2 ≤ m} + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + (ha : 0 ?_⟩ + obtain ⟨B⟩ := hL₁ M ((le_max_left _ _).trans hM) + exact ⟨B,hL₂ M ((le_max_right _ _).trans hM) B⟩ + +end GlobalAlignedCentrality + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/GlobalSignControl.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/GlobalSignControl.lean new file mode 100644 index 0000000000000000000000000000000000000000..9a8fcc2e43a6c010845db899582378d3a6a6d01f --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/GlobalSignControl.lean @@ -0,0 +1,96 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.UniformTangentTransport +import OAI.GroupTheory.SimpleAmenable.Homology.GlobalTangentChain +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.TangentChartTemplates + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section GlobalSignControl +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + +theorem tangentSign_eq (hlarge : 15 < m+1) + (k k' : ℕ) (p p' : Fin 2 → ℤ) (u u' : CutRing) + (h : B.TangentChartLaws k p u) (h' : B.TangentChartLaws k' p' u') + (d : Fin 2) (z : CutRing × CutRing) (positive : Bool) : + B.tangentSign hlarge k p u h d z positive = B.tangentSign hlarge k' p' u' h' d z positive := by + unfold tangentSign + refine B.fullGeometricSector_shared_primitive hlarge _ _ + (Sum.inl (0 : Fin 2)) (Sum.inl (0 : Fin 2)) ?_ (h d 0 z) (h' d 0 z) _ ?_ + · simp only [translatedTemplate,tangentChartTemplate,ite_true] + · intro x y he + have hh := he () + change x ∈ (spatialTranslate (z+0) (initialTest a r (slopeTestIndex d))).val ↔ + y ∈ (spatialTranslate (z+0) (initialTest a r (slopeTestIndex d))).val at hh + simp only [add_zero,initialTest_slope] at hh + cases positive with + | false => simpa using not_congr hh + | true => simpa using hh + +theorem all_rectangle_control_to_sign (hlarge : 20 ≤ m+1) + (g : ∀ n, B.CoordinateWindowLaw n) + (k : ℕ) (p : Fin 2 → ℤ) (u : CutRing) (h : B.TangentChartLaws k p u) + (d : Fin 2) (z : CutRing × CutRing) (positive : Bool) (l v : Fin 2 → CutRing) + (hl : ∀ j, p j ≤ endpointLabel (l j) ∧ endpointLabel (l j) < p j+k) + (hv : ∀ j, p j ≤ endpointLabel (v j) ∧ endpointLabel (v j) < p j+k) + (hside : coordinateRectangle a l v ≤ if positive then clippedSlopePrimitive a r (slopeDirection d) + else (clippedSlopePrimitive a r (slopeDirection d))ᶜ) + (n : ℕ) (q : Fin 2 → ℤ) (W : polygonAlgebra a) + (hW : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) + (coordinateWindowPrimitives n q) i).val) W.val) + (hinc : W ≤ spatialTranslate z (coordinateRectangle a l v)) + (f : TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm)) + (hf : B.AlignedSmallSupported f) + (hc : SmallControlled B.c f (B.windowSector (by omega) n (g n) q W)) : + SmallControlled B.c f (B.tangentSign (by omega) k p u h d z positive) := by + apply B.control_trans hlarge f _ _ hf (B.tangentSign_supported (by omega) k p u h d z positive) + (B.all_rectangle_control_to_chart hlarge g k p u h d 0 z l v hl hv n q W hW hinc f hf hc) + unfold tangentSign + apply B.fullGeometricSector_small_control + cases positive with + | false => exact spatialTranslate_mono z hside + | true => exact spatialTranslate_mono z hside + +theorem tangentSign_constant_action (hlarge : 20 ≤ m+1) + (k : ℕ) (p : Fin 2 → ℤ) (u : CutRing) (h : B.TangentChartLaws k p u) + (d : Fin 2) (z : CutRing × CutRing) (positive : Bool) + (f : TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm)) + (hf : B.AlignedSmallSupported f) + (hc : SmallControlled B.c f (B.tangentSign (by omega) k p u h d z positive)) + (I : ControlAlphabet (Fin (m+1))) (s : UniversalExtension (alternatingGroup I.val)) + (x : BoundedRelationCover M (alternatingGenerator a r m hm)) (hx : x ∈ f.range) : + B.tangentSign (by omega) k p u h d z true (universalMap (subtypeAlternatingHom I.val) s)*x* + (B.tangentSign (by omega) k p u h d z true (universalMap (subtypeAlternatingHom I.val) s))⁻¹ = + (if positive then B.c (subtypeAlternatingHom I.val (universalProjection (alternatingGroup I.val) s)) else 1)*x* + (if positive then B.c (subtypeAlternatingHom I.val (universalProjection (alternatingGroup I.val) s)) else 1)⁻¹ := by + cases positive with + | true => + have hh := hc I s x hx + have he := DFunLike.congr_fun (universalMap_spec (subtypeAlternatingHom I.val)) s + simp only [MonoidHom.comp_apply] at he + simpa only [MonoidHom.comp_apply,he,ite_true] using hh + | false => + have hh := small_control_transfer _ B.c B.constant_aligned B.disjoint_aligned f _ hf hc I.val + (B.tangentSign (by omega) k p u h d z true (universalMap (subtypeAlternatingHom I.val) s)) + (B.tangentSign_supported (by omega) k p u h d z true I ⟨s,rfl⟩) + (by have hI := I.property.2; simp only [Fintype.card_fin]; omega) + (fun J t => B.tangentSign_opposite_commute (by omega) k p u h d z _ _) x hx + simp only [Bool.false_eq_true,ite_false,inv_one,one_mul,mul_one] + rw [hh.eq,mul_assoc,mul_inv_cancel,mul_one] + +end InitialCoverSystem +end GlobalSignControl + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/GridFormalPatching.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/GridFormalPatching.lean new file mode 100644 index 0000000000000000000000000000000000000000..ffa44f6ec0cb2e2e96480d1a4e2f5c6ff687a2d5 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/GridFormalPatching.lean @@ -0,0 +1,177 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.IndividualGridSplits +import OAI.GroupTheory.SimpleAmenable.CentralCovers.TemplateRelators +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.SupportedCellPatching + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section GridFormalPatching + +theorem inner_action_iSup {G J : Type*} [Group G] (P : J → Subgroup G) (x y : G) + (h : ∀ j, ∀ z ∈ P j, x*z*x⁻¹=y*z*y⁻¹) : + ∀ z ∈ ⨆ j, P j, x*z*x⁻¹=y*z*y⁻¹ := by + have hh : (⨆ j, P j) ≤ MonoidHom.eqLocus (MulAut.conj x).toMonoidHom + (MulAut.conj y).toMonoidHom := by + apply iSup_le + intro j z hz + exact h j z hz + exact hh + +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) {ι D : Type*} [Finite ι] [Fintype D] + {κ : Option ι → Type*} [∀ i, Finite (κ i)] + {τ : D → Type*} [∀ d, Finite (τ d)] + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + +theorem grid_formal_patching (hlarge : 25 ≤ m+1) + (Q : (i : Option ι) → κ i → Fin 5 × (CutRing × CutRing)) + (h : ∀ i I, I.card≤15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb (Q i)) + (U : Option ι → polygonAlgebra a) (W : D → polygonAlgebra a) + (hU : ∀ i, ResolvedBy (fun j => (primitiveTests (a := a) (r := r) (Q i) j).val) (U i).val) + (hW : ∀ i d, ResolvedBy (fun j => (primitiveTests (a := a) (r := r) (Q i) j).val) (W d).val) + (he : ∀ i d, B.fullGeometricSector (by omega) (Q i) (h i) (W d)= + B.fullGeometricSector (by omega) (Q none) (h none) (W d)) + (hdisjoint : Pairwise fun d e => Disjoint (W d).val (W e).val) + (hcover : ∀ x, ∃ d, x ∈ (W d).val) + (f : (I : FiveAlphabet (Fin (m+1))) → Option ι → alternatingGroup I.val →* + BoundedRelationCover M (alternatingGenerator a r m hm)) + (hspec : ∀ I i, (B.gridInput (by omega) Q h U i).comp (universalMap (subtypeAlternatingHom I.val))= + (f I i).comp (universalProjection (alternatingGroup I.val))) + (T : (d : D) → τ d → Fin 5 × (CutRing × CutRing)) + (hT : ∀ d I, I.card≤15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb (T d)) + (V : D → polygonAlgebra a) (R : D → ι → polygonAlgebra a) + (hV : ∀ d, ResolvedBy (fun j => (primitiveTests (a := a) (r := r) (T d) j).val) (V d).val) + (hR : ∀ d i, ResolvedBy (fun j => (primitiveTests (a := a) (r := r) (T d) j).val) (R d i).val) + (hcontrol : ∀ d i, SmallControlled B.c (B.gridPiece (by omega) Q h U W d i) + (B.fullGeometricSector (by omega) (T d) (hT d) (V d))) + (haction : ∀ d i (I : FiveAlphabet (Fin (m+1))) s j, + ∀ x ∈ (B.gridPiece (by omega) Q h U W d j).range, + B.gridInput (by omega) Q h U i (universalMap (subtypeAlternatingHom I.val) s)*x* + (B.gridInput (by omega) Q h U i (universalMap (subtypeAlternatingHom I.val) s))⁻¹ = + B.fullGeometricSector (by omega) (T d) (hT d) (marginFamily (R d) (V d) i) + (universalMap (subtypeAlternatingHom I.val) s)*x* + (B.fullGeometricSector (by omega) (T d) (hT d) (marginFamily (R d) (V d) i) + (universalMap (subtypeAlternatingHom I.val) s))⁻¹) : + HasCentralLaw (smallFamilyModel (fun i : ι => {σ : ι → Bool | σ i=true})) + (smallFamilyEval f).rangeRestrict := by + apply supported_cell_patching (B.gridInput (by omega) Q h U) f hspec + (fun d => ⨆ j, (B.gridPiece (by omega) Q h U W d j).range) ?_ ?_ + (fun d i => B.fullGeometricSector (by omega) (T d) (hT d) (marginFamily (R d) (V d) i)) + ?_ ?_ (by simp only [Fintype.card_fin]; omega) + · rw [copyFamilyEval_range] + exact B.gridPieces_generate (by omega) Q h U W hU hW hdisjoint hcover + · exact B.gridInputs_normalize (by omega) Q h U W (by omega) none hU hW he + · intro d I i s + apply inner_action_iSup + intro j + exact haction d i I s j + · intro d S hS w hw hrel + have hh : (⨆ j, (B.gridPiece (by omega) Q h U W d j).range) ≤ + Subgroup.centralizer ({copyFamilyEval + (fun i => B.fullGeometricSector (by omega) (T d) (hT d) (marginFamily (R d) (V d) i)) + (smallFamilyStarWord w)} : Set _) := by + apply iSup_le + intro j x hx + apply Subgroup.mem_centralizer_singleton_iff.mpr + exact (B.actual_template_word_controls hlarge (T d) (hT d) (R d) (V d) + (hR d) (hV d) _ (B.gridPiece_supported (by omega) Q h U W hU hW d j) + (hcontrol d j) S hS w hw hrel x hx).symm + intro x hx + exact (Subgroup.mem_centralizer_singleton_iff.mp (hh hx)).symm + +end InitialCoverSystem +end GridFormalPatching + +section CoordinateGlobalActions +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) {ι κ : Type*} [Finite ι] [Finite κ] + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + +omit [Group.IsPerfect (alternatingGroup (Fin (m+1)))] in + +theorem coordinateFamilyLaw_all (g : ∀ n, B.CoordinateWindowLaw n) + (j : ι → Fin 2) (u : ι → CutRing × CutRing) + (I : Finset (Fin (m+1))) (b : Fin (m+1)) (hb : b ∉ I) : + B.PrimitiveFamilyLaw I b hb (fun i => (coordinateTestIndex (j i),u i)) := by + classical + let _ := Fintype.ofFinite ι + obtain ⟨n,q,hq⟩ := finite_coordinate_windows_container (fun _ : ι => 1) + (fun i k => pointLabel (u i) k) + apply B.coordinateFamilyLaw_of_window (n+1) (g (n+1)) q j u ?_ ?_ I b hb + · intro i + have hh := (hq i (j i)).1 + simpa only [pointLabel,pointCoordinate] using hh + · intro i + have hh := (hq i (j i)).2 + have hx : endpointLabel (if j i=0 then (u i).1 else (u i).2)=pointLabel (u i) (j i) := by + rfl + rw [hx] + omega + +theorem coordinate_charts_action (hlarge : 20 ≤ m+1) + (g : ∀ n, B.CoordinateWindowLaw n) + (j : ι → Fin 2) (u : ι → CutRing × CutRing) + (j' : κ → Fin 2) (u' : κ → CutRing × CutRing) + (V V' W : polygonAlgebra a) + (hV : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) + (fun i => (coordinateTestIndex (j i),u i)) i).val) V.val) + (hV' : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) + (fun i => (coordinateTestIndex (j' i),u' i)) i).val) V'.val) + (n : ℕ) (q : Fin 2 → ℤ) + (hW : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) + (coordinateWindowPrimitives n q) i).val) W.val) + (heq : V ⊓ W=V' ⊓ W) + (f : TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm)) + (hf : B.AlignedSmallSupported f) + (hc : SmallControlled B.c f (B.windowSector (by omega) n (g n) q W)) + (I : ControlAlphabet (Fin (m+1))) (s : UniversalExtension (alternatingGroup I.val)) : + ∀ x ∈ f.range, + B.fullGeometricSector (by omega) (fun i => (coordinateTestIndex (j i),u i)) + (fun I _ b hb => B.coordinateFamilyLaw_all g j u I b hb) V + (universalMap (subtypeAlternatingHom I.val) s)*x* + (B.fullGeometricSector (by omega) (fun i => (coordinateTestIndex (j i),u i)) + (fun I _ b hb => B.coordinateFamilyLaw_all g j u I b hb) V + (universalMap (subtypeAlternatingHom I.val) s))⁻¹ = + B.fullGeometricSector (by omega) (fun i => (coordinateTestIndex (j' i),u' i)) + (fun I _ b hb => B.coordinateFamilyLaw_all g j' u' I b hb) V' + (universalMap (subtypeAlternatingHom I.val) s)*x* + (B.fullGeometricSector (by omega) (fun i => (coordinateTestIndex (j' i),u' i)) + (fun I _ b hb => B.coordinateFamilyLaw_all g j' u' I b hb) V' + (universalMap (subtypeAlternatingHom I.val) s))⁻¹ := by + let J : Sum (Sum ι κ) (Fin 2 × Fin (n-1)) → Fin 2 := Sum.elim (Sum.elim j j') Prod.fst + let Z : Sum (Sum ι κ) (Fin 2 × Fin (n-1)) → CutRing × CutRing := + Sum.elim (Sum.elim u u') (fun i => (coordinateWindowPrimitives n q i).2) + let P := fun i => (coordinateTestIndex (J i),Z i) + have h := fun I (_ : I.card≤15) b hb => B.coordinateFamilyLaw_all g J Z I b hb + have h₀ := B.fullGeometricSector_subfamily (by omega) P _ (Sum.inl ∘ Sum.inl) rfl h + (fun I _ b hb => B.coordinateFamilyLaw_all g j u I b hb) V hV + have h₁ := B.fullGeometricSector_subfamily (by omega) P _ (Sum.inl ∘ Sum.inr) rfl h + (fun I _ b hb => B.coordinateFamilyLaw_all g j' u' I b hb) V' hV' + have h₂ := B.fullGeometricSector_subfamily (by omega) P (coordinateWindowPrimitives n q) Sum.inr rfl h + (fun I _ b hb => g n I b hb q) W hW + change SmallControlled B.c f (B.fullGeometricSector (by omega) (coordinateWindowPrimitives n q) + (fun I _ b hb => g n I b hb q) W) at hc + rw [h₂] at hc + simp only [Function.comp_def,P,J,Z,Sum.elim_inl,Sum.elim_inr] at h₀ h₁ + rw [h₀,h₁] + exact B.chart_action_transfer hlarge P h V V' W + (fun x y he => hV x y (fun i => he (Sum.inl (Sum.inl i)))) + (fun x y he => hV' x y (fun i => he (Sum.inl (Sum.inr i)))) + (fun x y he => hW x y (fun i => he (Sum.inr i))) heq f hf hc I s + +end InitialCoverSystem +end CoordinateGlobalActions + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/GridPrimitiveInputs.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/GridPrimitiveInputs.lean new file mode 100644 index 0000000000000000000000000000000000000000..055299835a7d475e088a2be3f2d1407f93f3bf4c --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/GridPrimitiveInputs.lean @@ -0,0 +1,182 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.ConcurrentGeometry +import OAI.GroupTheory.SimpleAmenable.CentralCovers.IndividualGridSplits +import OAI.GroupTheory.SimpleAmenable.CentralCovers.GridFormalPatching +import OAI.GroupTheory.SimpleAmenable.CentralCovers.ConcurrentCellSlopeAction +import OAI.GroupTheory.SimpleAmenable.CentralCovers.CrossingCellActions +import OAI.GroupTheory.SimpleAmenable.CentralCovers.ConstantCellTemplates + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section GridPrimitiveInputs +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) {ι κ : Type*} [Finite κ] + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + +theorem fullGeometricSector_small_input (hlarge : 15 < m+1) + (P : κ → Fin 5 × (CutRing × CutRing)) + (h : ∀ I, I.card ≤ 15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb P) + (R : ι → Fin 5 × (CutRing × CutRing)) (k : κ) (i : ι) (he : P k=R i) + (I : FiveAlphabet (Fin (m+1))) : + (B.fullGeometricSector hlarge P h (primitiveTests (a := a) (r := r) R i)).comp + (universalMap (subtypeAlternatingHom I.val)) = + (B.smallPrimitiveInputs hlarge R I (some i)).comp (universalProjection (alternatingGroup I.val)) := by + let b := smallAlphabetBalance hlarge I.val (by rw [I.property.2]; omega) + have hb := smallAlphabetBalance_notMem hlarge I.val (by rw [I.property.2]; omega) + have hR : primitiveTests (a := a) (r := r) R i=primitiveTests (a := a) (r := r) P k := by + simp only [primitiveTests,primitiveFamilyTests,he] + rw [hR,B.fullGeometricSector_inclusion hlarge P h I.val (by rw [I.property.2]) b hb + (h I.val (by rw [I.property.2]; omega) b hb) _ (resolved_test _ k),B.geometricSector_input] + change (B.primitiveCopy I.val b hb (P k)).comp _ = (B.primitiveCopy I.val b hb (R i)).comp _ + rw [he] + +theorem fullGeometricSector_small_whole (hlarge : 15 < m+1) + (P : κ → Fin 5 × (CutRing × CutRing)) + (h : ∀ I, I.card ≤ 15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb P) + (R : ι → Fin 5 × (CutRing × CutRing)) (I : FiveAlphabet (Fin (m+1))) : + (B.fullGeometricSector hlarge P h (wholePolygon a)).comp + (universalMap (subtypeAlternatingHom I.val)) = + (B.smallPrimitiveInputs hlarge R I none).comp (universalProjection (alternatingGroup I.val)) := by + rw [B.fullGeometricSector_whole] + change (B.c.comp (universalProjection (alternatingGroup (Fin (m+1))))).comp _ = + (B.initialAlphabet I.val 0).comp _ + rw [MonoidHom.comp_assoc,universalMap_spec,← MonoidHom.comp_assoc,B.initialAlphabet_zero] + +end InitialCoverSystem +end GridPrimitiveInputs + +section SlopeCoordinateFormalLaw +namespace InitialCoverSystem.PatchAtlas +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + {B : InitialCoverSystem a r m hm M} + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + (A : B.PatchAtlas) + +include A in + +theorem slope_coordinate_formal_law (hlarge : 25 ≤ m+1) + (hr : 0 {σ : Fin 2 → Bool | σ i=true})) + (smallFamilyEval (B.smallPrimitiveInputs (by omega) + ![(slopeTestIndex d,0),(coordinateTestIndex j,v)])).rangeRestrict := by + classical + let n := A.geometry.mesh + let q := symmetricWindowStart r + let κ := Sum (Fin 5) (Fin 2 × Fin (n-1)) + let R : Fin 2 → Fin 5 × (CutRing × CutRing) := ![(slopeTestIndex d,0),(coordinateTestIndex j,v)] + let P : κ → Fin 5 × (CutRing × CutRing) := initialPatchPrimitives r n + let Q : κ → Fin 5 × (CutRing × CutRing) := + Sum.elim (fun _ : Fin 5 => (coordinateTestIndex j,v)) (coordinateWindowPrimitives n q) + let O : Option (Fin 2) → κ → Fin 5 × (CutRing × CutRing) := + fun i => if i=some 0 then P else Q + have hP : ∀ I, I.card ≤ 15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb P := by + intro I _ b hb + have hz : translatedTemplate (initialPatchPrimitives r A.geometry.mesh) 0=P := by + funext i + exact Prod.ext rfl (zero_add _) + simpa only [hz] using A.initial 0 I b hb + have hQ : ∀ I, I.card ≤ 15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb Q := by + intro I _ b hb + have hz : (fun i : κ => + (coordinateTestIndex (Sum.elim (fun _ : Fin 5 => j) Prod.fst i), + Sum.elim (fun _ : Fin 5 => v) (fun z => (coordinateWindowPrimitives n q z).2) i))=Q := by + funext i + cases i <;> rfl + rw [← hz] + exact B.coordinateFamilyLaw_all A.rectangles.rectangles + (Sum.elim (fun _ : Fin 5 => j) Prod.fst) + (Sum.elim (fun _ : Fin 5 => v) (fun z => (coordinateWindowPrimitives n q z).2)) I b hb + have h : ∀ i I, I.card ≤ 15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb (O i) := by + intro i + dsimp [O] + split <;> assumption + let U : Option (Fin 2) → polygonAlgebra a := fun i => + match i with + | none => wholePolygon a + | some i => primitiveTests (a := a) (r := r) R i + let W := windowRectangle a n q + have hn : 201 ≤ n := A.geometry.mesh_large + have hcoord : ∀ i z, O i (Sum.inr z)=translatedTemplate (coordinateWindowPrimitives n q) 0 z := by + intro i z + dsimp [O] + split <;> simp only [P,Q,initialPatchPrimitives,Sum.elim_inr,translatedTemplate,zero_add] + rfl + have hW : ∀ i cell, ResolvedBy (fun k => (primitiveTests (a := a) (r := r) (O i) k).val) (W cell).val := by + intro i cell x y hh + apply windowRectangle_resolved n (by omega) q cell x y + intro z + have hz := hh (Sum.inr z) + simpa only [primitiveTests,primitiveFamilyTests,hcoord,translatedTemplate,zero_add] using hz + have he : ∀ i cell, B.fullGeometricSector (by omega) (O i) (h i) (W cell)= + B.windowSector (by omega) n (A.rectangles.rectangles n) q (W cell) := by + intro i cell + have hh := B.templateWindowSector_eq (by omega) n q 0 (A.rectangles.rectangles n) + (O i) (h i) Sum.inr (hcoord i) (W cell) (windowRectangle_resolved n (by omega) q cell) + simpa only [pointLabel_zero,zero_add,spatialTranslate_zero] using hh + have hinput : ∀ i : Fin 2, ∃ k : κ, O (some i) k=R i := by + intro i + fin_cases i + · exact ⟨Sum.inl (slopeTestIndex d), rfl⟩ + · exact ⟨Sum.inl 0, by simp [O,Q,R]⟩ + have hU : ∀ i, ResolvedBy (fun k => (primitiveTests (a := a) (r := r) (O i) k).val) (U i).val := by + intro i + cases i with + | none => exact fun _ _ _ => Iff.rfl + | some i => + obtain ⟨k,hk⟩ := hinput i + intro x y hh + have hx := hh k + simpa only [U,primitiveTests,primitiveFamilyTests,hk] using hx + refine B.grid_formal_patching_templates hlarge O h U W hU hW + (fun i cell => (he i cell).trans (he none cell).symm) + (windowRectangle_pairwise_disjoint n hn q) (windowRectangle_cover n hn q) + (B.smallPrimitiveInputs (by omega) R) ?_ rfl ?_ + · intro I i + cases i with + | none => exact B.fullGeometricSector_small_whole (by omega) (O none) (h none) R I + | some i => + obtain ⟨k,hk⟩ := hinput i + exact B.fullGeometricSector_small_input (by omega) (O (some i)) (h (some i)) R k i hk I + · intro cell + have hclip := A.geometry.clipping + have hb : ∀ k, q k≤endpointLabel (-r) ∧ endpointLabel (-r) O (some i)) (fun i => h (some i)) + (Sum.inl (slopeTestIndex d)) (Sum.inl 0) rfl (by simp [O,Q]) + (B.gridInput (by omega) O h U) (B.gridPiece (by omega) O h U W cell) ?_ q cell hb hu + (fun i => hW (some i) cell) (fun i => he (some i) cell) + (B.gridPiece_supported (by omega) O h U W hU hW cell) ?_ + · intro i + fin_cases i <;> simp [gridInput,U,R,primitiveTests,primitiveFamilyTests, + initialTest_slope,initialTest_coordinate,spatialTranslate_zero] + · intro i + rw [← he i cell] + exact B.gridPiece_control (by omega) O h U W cell i + +end InitialCoverSystem.PatchAtlas +end SlopeCoordinateFormalLaw + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/GrowthAnchorLaw.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/GrowthAnchorLaw.lean new file mode 100644 index 0000000000000000000000000000000000000000..8a400b6456dd2f6cf1cd32929d288a184002b3af --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/GrowthAnchorLaw.lean @@ -0,0 +1,52 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.AxisCutCommutation +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.AxisAnchorFamily + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section GrowthAnchorLaw +namespace InitialCoverSystem +variable {a m : ℕ} {r : CutRing} {hm : 2 ≤ m} + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + +theorem growth_anchor_law (hlarge : 20 ≤ m+1) + (hr : 0 < ordinary r ∧ ordinary r < 1/2) + (s w z : CutRing) (hs : 0 < ordinary s) (hsr : ordinary s < ordinary r/2) + (hwz : w*z=1) + (hshort : (1+|ordinary (cutTau^a)|)*(|ordinary w|+|ordinary (cutTau*w)|) < ordinary s/4) + {C : ℝ} (hC : 1000 ≤ C) (hSlope : 8*C < ordinary (cutTau^a)) + (hconj : |conjugate (cutTau^a)| < 1/1000) : + ∃ (N : ℕ) (_hN : 1005 ≤ N), ∀ (M : ℕ) (B : InitialCoverSystem a r m hm M) + (_h : B.TangentChartLaws (symmetricWindowLength s) (symmetricWindowStart s) w), + ∀ n : ℕ, ∀ hn : N ≤ n, ∀ g : B.CoordinateWindowLaw n, + ∀ (d : Fin 2) (p : ℤ), + CentralOn (coverMap M (alternatingGenerator a r m hm)) + (⨆ i : Fin (growthAnchorLength n), ⨆ j : Fin ((growthAnchorFamily n (by omega) p).count i+1), + (((growthAnchorFamily n (by omega) p).cuts i).prefixCopy B (by omega) g d j.val).range) := by + obtain ⟨N,hN,hcomm⟩ := axis_cut_sequence_commutations + (a := a) (hm := hm) hlarge hr s w z hs hsr hwz hshort hC hSlope hconj + refine ⟨N,hN,?_⟩ + intro M B h n hn g d p + let A := growthAnchorFamily n (by omega) p + have hlens := growth_lengths (show 1005 ≤ n by omega) + apply A.prefixes_central B (by omega) g d hlens.2.2.2.1 hlens.2.2.2.2.1 _ hlarge + intro i j k hjk x y + have hh := hcomm M B h n hn g d (A.count i) (A.cuts i) ?_ (growthAnchorFamily.label_difference n (by omega) p i) + · exact hh.2 j k hjk x y + · apply (growthAnchorFamily.width n (by omega) p i).trans + apply div_le_div_of_nonneg_right (by linarith) (by positivity) + +end InitialCoverSystem +end GrowthAnchorLaw + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/GrowthAxisUniform.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/GrowthAxisUniform.lean new file mode 100644 index 0000000000000000000000000000000000000000..b618ae9b911f0716fdb817f41f8a467d3039e885 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/GrowthAxisUniform.lean @@ -0,0 +1,282 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.PairLawAssembly +import OAI.GroupTheory.SimpleAmenable.CentralCovers.GrowthAnchorLaw +import OAI.GroupTheory.SimpleAmenable.CentralCovers.GrowthGeneration + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section GrowthAxisUniform +namespace InitialCoverSystem +variable {a m : ℕ} {r : CutRing} {hm : 2 ≤ m} + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + +theorem growth_axis_law (hlarge : 20 ≤ m+1) + (hr : 0 < ordinary r ∧ ordinary r < 1/2) + (s w z : CutRing) (hs : 0 < ordinary s) (hsr : ordinary s < ordinary r/2) + (hwz : w*z=1) + (hshort : (1+|ordinary (cutTau^a)|)*(|ordinary w|+|ordinary (cutTau*w)|) < ordinary s/4) + {C : ℝ} (hC : 1000 ≤ C) (hSlope : 8*C < ordinary (cutTau^a)) + (hconj : |conjugate (cutTau^a)| < 1/1000) : + ∃ N : ℕ, 1005 ≤ N ∧ ∀ (M : ℕ) (B : InitialCoverSystem a r m hm M) + (_h : B.TangentChartLaws (symmetricWindowLength s) (symmetricWindowStart s) w), + ∀ n : ℕ, N ≤ n → B.CoordinateWindowLaw n → + ∀ (d : Fin 2) (p : ℤ) (I : Finset (Fin (m+1))) (b : Fin (m+1)) (hb : b ∉ I), + B.PrimitiveFamilyLaw I b hb (axisWindowPrimitives d (growthNewLength n) p) := by + obtain ⟨N,hN,h⟩ := growth_anchor_law (a := a) (hm := hm) hlarge hr s w z hs hsr hwz hshort hC hSlope hconj + refine ⟨N,hN,?_⟩ + intro M B hB n hn g d p I b hb + exact B.growth_axis_law_of_anchor (by omega) n (by omega) g d p + (h M B hB n hn g d p) I b hb + +end InitialCoverSystem +end GrowthAxisUniform + +section SplitAssignment +variable {E S G ι κ : Type*} [Group E] [Group S] [Group G] + +theorem iSup_ranges_commute (f : ι → E →* G) (g : κ → S →* G) + (h : ∀ i j s t, Commute (f i s) (g j t)) : + ∀ x ∈ ⨆ i, (f i).range, ∀ y ∈ ⨆ j, (g j).range, Commute x y := by + intro x hx + let C := Subgroup.centralizer ((⨆ j, (g j).range : Subgroup G) : Set G) + have hf : (⨆ i, (f i).range : Subgroup G) ≤ C := by + apply iSup_le + intro i z hz + obtain ⟨s,rfl⟩ := hz + have hg : (⨆ j, (g j).range : Subgroup G) ≤ Subgroup.centralizer ({f i s} : Set G) := by + apply iSup_le + rintro j y ⟨t,rfl⟩ z hz + obtain rfl := Set.mem_singleton_iff.mp hz + exact (h i j s t).eq + intro y hy + exact (hg hy _ (Set.mem_singleton _)).symm + intro y hy + exact (show Commute y x from hf hx y hy).symm + +def splitFactorProduct (A B : Subgroup G) + (h : ∀ x ∈ A, ∀ y ∈ B, Commute x y) : A × B →* G where + toFun x := x.1.1*x.2.1 + map_one' := one_mul _ + map_mul' x y := by + change (x.1.1*y.1.1)*(x.2.1*y.2.1) = (x.1.1*x.2.1)*(y.1.1*y.2.1) + calc + _ = x.1.1*(y.1.1*x.2.1)*y.2.1 := by group + _ = x.1.1*(x.2.1*y.1.1)*y.2.1 := by rw [(h _ y.1.2 _ x.2.2).eq] + _ = _ := by group + +theorem commutingFactors_of_generate (F L R : ι → E →* G) + (hgen : (⨆ i, (F i).range : Subgroup G) = ⊤) + (hsplit : ∀ i s, F i s = L i s*R i s) + (hcomm : ∀ i j s t, Commute (L i s) (R j t)) : + CommutingFactors (⨆ i, (L i).range) (⨆ i, (R i).range) := by + have hLR := iSup_ranges_commute L R hcomm + let p := splitFactorProduct (⨆ i, (L i).range) (⨆ i, (R i).range) hLR + have hp : p.range = ⊤ := by + apply top_unique + rw [← hgen] + apply iSup_le + rintro i x ⟨s,rfl⟩ + exact ⟨(⟨L i s,le_iSup (fun i => (L i).range) i ⟨s,rfl⟩⟩, + ⟨R i s,le_iSup (fun i => (R i).range) i ⟨s,rfl⟩⟩),(hsplit i s).symm⟩ + refine ⟨hLR,?_⟩ + intro x + obtain ⟨⟨u,v⟩,huv⟩ := MonoidHom.range_eq_top.mp hp x + exact ⟨u,u.property,v,v.property,huv.symm⟩ + +theorem star_split_assignment [Fintype ι] [Group.IsPerfect G] + (π : E →* S) (_hπ : Function.Surjective π) (c : S →* G) + (F : Option ι → E →* G) (hc : F none = c.comp π) + (hgen : (⨆ i, (F i).range : Subgroup G) = ⊤) + (L R : ι → Option ι → E →* G) + (hsplit : ∀ i j s, F j s = L i j s*R i j s) + (hcomm : ∀ i j k s t, Commute (L i j s) (R i k t)) + (hleft : ∀ i, L i none = F (some i)) : + ∃ φ : ((ι → Bool) → S) →* (G ⧸ Subgroup.center G), + Function.Surjective φ ∧ + φ.comp (sectorMask Set.univ) = (QuotientGroup.mk' _).comp c ∧ + ∀ i, (φ.comp (sectorMask {σ | σ i = true})).comp π = + (QuotientGroup.mk' _).comp (F (some i)) := by + let q : G →* G ⧸ Subgroup.center G := QuotientGroup.mk' _ + let F' := fun i => q.comp (F i) + let L' := fun i j => q.comp (L i j) + let R' := fun i j => q.comp (R i j) + have hgen' : (⨆ i, (F' i).range : Subgroup (G ⧸ Subgroup.center G)) = ⊤ := by + simp only [F',MonoidHom.range_comp] + rw [← Subgroup.map_iSup,hgen,← MonoidHom.range_eq_map,MonoidHom.range_eq_top.mpr (QuotientGroup.mk'_surjective _)] + have hs' i j s : F' j s = L' i j s*R' i j s := by + dsimp [F',L',R']; rw [hsplit,map_mul] + have hm' i j k s t : Commute (L' i j s) (R' i k t) := (hcomm i j k s t).map q + let A := fun i => ⨆ j, (L' i j).range + let B := fun i => ⨆ j, (R' i j).range + have hAB i : CommutingFactors (A i) (B i) := + commutingFactors_of_generate F' (L' i) (R' i) hgen' (hs' i) (hm' i) + have hz : Subgroup.center (G ⧸ Subgroup.center G) = ⊥ := perfect_center_quotient + let g := fun i => ((hAB i).projectLeft hz).comp (q.comp c) + have hg i : (g i).comp π = F' (some i) := by + ext s + change (hAB i).projectLeft hz (q (c (π s))) = q (F (some i) s) + rw [← show F none s = c (π s) from DFunLike.congr_fun hc s] + change (hAB i).projectLeft hz (F' none s) = F' (some i) s + rw [hs' i none s,(hAB i).projectLeft_factors hz + (le_iSup (fun j => (L' i j).range) none ⟨s,rfl⟩) + (le_iSup (fun j => (R' i j).range) none ⟨s,rfl⟩)] + exact congrArg (fun f : E →* G => q (f s)) (hleft i) + have hggen : (q.comp c).range ⊔ ⨆ i, (g i).range = ⊤ := by + apply top_unique + rw [← hgen'] + apply iSup_le + intro i + cases i with + | none => + have h : F' none = (q.comp c).comp π := by dsimp [F']; rw [hc,MonoidHom.comp_assoc] + rw [h] + exact (range_comp_subset _ _).trans le_sup_left + | some i => + rw [← hg i] + exact (range_comp_subset _ _).trans ((le_iSup (fun i => (g i).range) i).trans le_sup_right) + obtain ⟨φ,hφ,hφc,hφg⟩ := simultaneous_assignment_surjection A B hAB hz (q.comp c) g (fun _ => rfl) hggen + exact ⟨φ,hφ,hφc,fun i => by rw [hφg]; exact hg i⟩ + +end SplitAssignment + +section PairSectors +noncomputable def primitivePair {ι : Type*} + (P : ι → Fin 5 × (CutRing × CutRing)) (i j : ι) : Bool → Fin 5 × (CutRing × CutRing) := + fun b => if b then P j else P i + +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) {ι κ : Type*} [Finite ι] [Finite κ] + +omit [Finite ι] [Finite κ] in + +theorem smallPrimitive_range_reindex (hlarge : 15 < m+1) + (P : ι → Fin 5 × (CutRing × CutRing)) (v : κ → ι) : + (smallFamilyEval (B.smallPrimitiveInputs hlarge (P ∘ v))).range ≤ + (smallFamilyEval (B.smallPrimitiveInputs hlarge P)).range := by + rw [smallFamilyEval_range,smallFamilyEval_range] + apply iSup_le + intro I + apply iSup_le + intro j + have he : B.smallPrimitiveInputs hlarge (P ∘ v) I j = + B.smallPrimitiveInputs hlarge P I (j.map v) := by cases j <;> rfl + rw [he] + exact (le_iSup (fun j => (B.smallPrimitiveInputs hlarge P I j).range) (j.map v)).trans + (le_iSup (fun I => ⨆ j, (B.smallPrimitiveInputs hlarge P I j).range) I) + +variable [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + (hlarge : 15 < m+1) (P : ι → Fin 5 × (CutRing × CutRing)) + (h : ∀ i j I, I.card ≤ 15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb (primitivePair P i j)) + +noncomputable def pairStar : Option ι → TrackStar (Fin (m+1)) →* + BoundedRelationCover M (alternatingGenerator a r m hm) + | none => B.c.comp (universalProjection (alternatingGroup (Fin (m+1)))) + | some i => B.fullGeometricSector hlarge (primitivePair P i i) (h i i) + (primitiveTests (a := a) (r := r) P i) + +noncomputable def pairSplit (i : ι) (j : Option ι) (positive : Bool) : + TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm) := + B.fullGeometricSector hlarge (primitivePair P i (j.getD i)) (h i (j.getD i)) + (primitiveFamilyTests (a := a) (r := r) P j ⊓ + (if positive then primitiveTests (a := a) (r := r) P i + else (primitiveTests (a := a) (r := r) P i)ᶜ)) + +omit [Finite ι] [Group.IsPerfect (alternatingGroup (Fin (m+1)))] in +theorem primitivePair_left_resolved (i j : ι) : + ResolvedBy (fun b => (primitiveTests (a := a) (r := r) (primitivePair P i j) b).val) + (primitiveTests (a := a) (r := r) P i).val := + resolved_test _ false + +omit [Finite ι] [Group.IsPerfect (alternatingGroup (Fin (m+1)))] in +theorem primitivePair_right_resolved (i : ι) (j : Option ι) : + ResolvedBy (fun b => (primitiveTests (a := a) (r := r) (primitivePair P i (j.getD i)) b).val) + (primitiveFamilyTests (a := a) (r := r) P j).val := by + cases j with + | none => exact fun _ _ _ => Iff.rfl + | some j => exact resolved_test _ true + +omit [Finite ι] in +theorem pairSplit_supported (i : ι) (j : Option ι) (positive : Bool) : + B.AlignedSmallSupported (B.pairSplit hlarge P h i j positive) := by + apply B.fullGeometricSector_supported + intro x y he + apply and_congr (primitivePair_right_resolved P i j x y he) + cases positive with + | false => exact not_congr (primitivePair_left_resolved P i (j.getD i) x y he) + | true => exact primitivePair_left_resolved P i (j.getD i) x y he + +omit [Finite ι] in +theorem pair_selected_star (i : ι) (j : Option ι) : + B.fullGeometricSector hlarge (primitivePair P i (j.getD i)) (h i (j.getD i)) + (primitiveFamilyTests (a := a) (r := r) P j) = B.pairStar hlarge P h j := by + cases j with + | none => exact B.fullGeometricSector_whole hlarge _ _ + | some j => + apply B.fullGeometricSector_shared_primitive hlarge (primitivePair P i j) (primitivePair P j j) + true false rfl _ _ _ + exact resolved_test _ () + +omit [Finite ι] in +theorem pairStar_split (i : ι) (j : Option ι) (s : TrackStar (Fin (m+1))) : + B.pairStar hlarge P h j s = + B.pairSplit hlarge P h i j true s * B.pairSplit hlarge P h i j false s := by + rw [← B.pair_selected_star hlarge P h i j] + unfold pairSplit + simp only [Bool.false_eq_true,↓reduceIte] + rw [← B.fullGeometricSector_union hlarge _ _ + (primitiveFamilyTests (a := a) (r := r) P j ⊓ primitiveTests (a := a) (r := r) P i) + (primitiveFamilyTests (a := a) (r := r) P j ⊓ (primitiveTests (a := a) (r := r) P i)ᶜ) + (fun x y he => and_congr (primitivePair_right_resolved P i j x y he) + (primitivePair_left_resolved P i (j.getD i) x y he)) + (Set.disjoint_left.mpr (by intro x hx hy; exact hy.2 hx.2))] + congr 2 + ext x + change (x ∈ (primitiveFamilyTests (a := a) (r := r) P j).val) ↔ + (x ∈ (primitiveFamilyTests (a := a) (r := r) P j).val ∧ x ∈ (primitiveTests (a := a) (r := r) P i).val) ∨ + (x ∈ (primitiveFamilyTests (a := a) (r := r) P j).val ∧ x ∉ (primitiveTests (a := a) (r := r) P i).val) + tauto + +omit [Finite ι] in +theorem pairSplit_whole_left (i : ι) : + B.pairSplit hlarge P h i none true = B.pairStar hlarge P h (some i) := by + unfold pairSplit pairStar + congr 1 + ext x + change (x ∈ Set.univ ∧ x ∈ (primitiveTests (a := a) (r := r) P i).val) ↔ _ + simp + +omit [Finite ι] in +theorem pairSplit_mem (i : ι) (j : Option ι) (positive : Bool) (s : TrackStar (Fin (m+1))) : + B.pairSplit hlarge P h i j positive s ∈ + (smallFamilyEval (B.smallPrimitiveInputs hlarge P)).range := by + have hi := B.smallPrimitive_range_reindex hlarge P (fun b : Bool => if b then j.getD i else i) + have he : P ∘ (fun b : Bool => if b then j.getD i else i) = primitivePair P i (j.getD i) := by + funext b; cases b <;> rfl + rw [he] at hi + apply hi + exact B.fullGeometricSector_mem hlarge _ _ _ s + +omit [Finite ι] in +theorem pairStar_mem (j : Option ι) (s : TrackStar (Fin (m+1))) : + B.pairStar hlarge P h j s ∈ (smallFamilyEval (B.smallPrimitiveInputs hlarge P)).range := by + cases j with + | none => exact B.constant_range_full hlarge P ⟨_,rfl⟩ + | some i => + rw [← B.pairSplit_whole_left hlarge P h i] + exact B.pairSplit_mem hlarge P h i none true s + +end InitialCoverSystem +end PairSectors + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/GrowthGeneration.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/GrowthGeneration.lean new file mode 100644 index 0000000000000000000000000000000000000000..fd41aeea94a20162eb0961fe62d8b9782172eb7c --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/GrowthGeneration.lean @@ -0,0 +1,196 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.PairLawAssembly +import OAI.GroupTheory.SimpleAmenable.CentralCovers.SectorDifferenceRange +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.AnchorConstants +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.AxisAnchorFamily +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.ClippedIntervals + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section GrowthGeneration +attribute [local instance] cutOrdinaryOrder + +namespace growthAnchorFamily +variable (n : ℕ) (hn : 1005 ≤ n) (p : ℤ) +local notation "A" => growthAnchorFamily n hn p + +theorem clipped_mem_range (i : Fin (growthAnchorLength n)) (q : ℤ) + (hq : p ≤ q ∧ q < p+growthNewLength n) : + clippedLabel ((A).cuts i |>.cut 0) (((A).cuts i).cut (Fin.last ((A).count i))) q ∈ + Set.range ((A).cuts i).cut := by + rw [range,← (A).lower,← (A).upper] + exact clippedLabel_mem _ _ _ _ _ (((A).cuts i).ordered (Fin.last ((A).count i))).1 + ((A).intervalLength (growth_lengths hn).2.2.2.1 i) + (labels n hn p i (Fin.last ((A).count i))) hq + +end growthAnchorFamily + +theorem growth_edge_window {n : ℕ} (hn : 1005 ≤ n) (p : ℤ) (j : Fin (growthNewLength n-1)) : + ∃ q : ℤ, + (q ≤ p+(j.val:ℤ) ∧ p+(j.val:ℤ)+1 < q+growthOldLength n) ∧ + ∀ i : Fin (growthAnchorLength n+1), + q ≤ endpointLabel (windowCut (growthAnchorLength n) (growthAnchorStart n p) i) ∧ + endpointLabel (windowCut (growthAnchorLength n) (growthAnchorStart n p) i) < q+growthOldLength n := by + have hlens := growth_lengths hn + by_cases h : p+(j.val:ℤ)+1 < p+growthOldLength n + · refine ⟨p,⟨by omega,h⟩,?_⟩ + intro i + have hi := growth_anchor_label hn p i + constructor <;> omega + · refine ⟨growthAnchorStart n p,?_,?_⟩ + · dsimp [growthAnchorStart] + have hj := j.isLt + have hover : growthNewLength n+201 ≤ 2*growthOldLength n := by + simp only [growthNewLength,growthOldLength]; omega + constructor <;> omega + · intro i + have hi := growth_anchor_label hn p i + dsimp [growthAnchorStart] at hi ⊢ + constructor <;> omega + +theorem axisWindowPrimitive_interval {a : ℕ} {r : CutRing} (d : Fin 2) (k : ℕ) (p : ℤ) + (j : Fin (k-1)) : + InitialCoverSystem.primitiveTests (a := a) (r := r) (axisWindowPrimitives d k p) j = + coordinateInterval a d (((p+(j.val:ℤ)):CutRing)*cutTau) + (((p+(j.val:ℤ)+1):CutRing)*cutTau) := by + apply Subtype.ext + change (spatialTranslate (coordinateShift d (((p+(j.val:ℤ)):CutRing)*cutTau)) + (initialTest a r (coordinateTestIndex d))).val = coordinateBetween a d _ _ + rw [initialTest_coordinate] + unfold coordinateBetween + have he : (((p+(j.val:ℤ)+1):CutRing)*cutTau)-(((p+(j.val:ℤ)):CutRing)*cutTau) = cutTau := by ring + rw [he,coordinateArc_tau] + rfl + +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + +omit [Group.IsPerfect (alternatingGroup (Fin (m+1)))] in + +theorem primitiveFamily_range_full_all {ι : Type*} (hlarge : 15 < m+1) + (P : ι → Fin 5 × (CutRing × CutRing)) (I : Finset (Fin (m+1))) + (b : Fin (m+1)) (hb : b ∉ I) : + (copyFamilyEval (B.primitiveFamily I b hb P)).range ≤ + (smallFamilyEval (B.smallPrimitiveInputs hlarge P)).range := by + classical + let J : Finset (Fin (m+1)) := Finset.univ.erase b + have hIJ : I ⊆ J := by intro x hx; exact Finset.mem_erase.mpr ⟨by intro he; subst x; exact hb hx,Finset.mem_univ _⟩ + have hJ : 5 ≤ J.card := by simp [J]; omega + have hbJ : b ∉ J := Finset.notMem_erase _ _ + exact (B.primitiveFamily_range_inclusion hIJ b b hb hbJ P).trans + (B.primitiveFamily_range_full hlarge P J hJ b hbJ) + +theorem primitiveCopy_range_fullSector {ι : Type*} [Finite ι] (hlarge : 15 < m+1) + (P : ι → Fin 5 × (CutRing × CutRing)) + (h : ∀ I, I.card ≤ 15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb P) + (I : Finset (Fin (m+1))) (hI : 5 ≤ I.card) (b : Fin (m+1)) (hb : b ∉ I) + (g : B.PrimitiveFamilyLaw I b hb P) (j : ι) : + (B.primitiveCopy I b hb (P j)).range ≤ + (B.fullGeometricSector hlarge P h (primitiveTests (a := a) (r := r) P j)).range := by + let := alphabetPerfect I hI + rintro x ⟨s,rfl⟩ + obtain ⟨t,ht⟩ := universalProjection_surjective (alternatingGroup I) s + refine ⟨universalMap (subtypeAlternatingHom I) t,?_⟩ + have hh := B.fullGeometricSector_inclusion hlarge P h I hI b hb g + (primitiveTests (a := a) (r := r) P j) (resolved_test _ j) + rw [B.geometricSector_input I b hb P g j] at hh + exact (DFunLike.congr_fun hh t).trans (by simp only [MonoidHom.comp_apply,ht]) + +end InitialCoverSystem +end GrowthGeneration + +section GrowthAxisLaw +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + +theorem growth_axis_range_prefixGroup (hlarge : 15 < m+1) (n : ℕ) (hn : 1005 ≤ n) + (g : B.CoordinateWindowLaw n) (d : Fin 2) (p : ℤ) : + (smallFamilyEval (B.smallPrimitiveInputs hlarge (axisWindowPrimitives d (growthNewLength n) p))).range ≤ + (growthAnchorFamily n hn p).prefixGroup B hlarge g d := by + classical + let A := growthAnchorFamily n hn p + have hlens := growth_lengths hn + rw [smallFamilyEval_range] + apply iSup_le + intro I + apply iSup_le + intro j + cases j with + | none => + change (B.initialAlphabet I.val 0).range ≤ _ + rw [B.initialAlphabet_zero] + exact (range_comp_subset B.c _).trans + (A.constant_range_prefixGroup B hlarge g d hlens.2.2.2.1 hlens.2.2.2.2.1) + | some j => + let b := smallAlphabetBalance hlarge I.val (by rw [I.property.2]; omega) + have hb : b ∉ I.val := smallAlphabetBalance_notMem hlarge I.val _ + change (B.primitiveCopy I.val b hb (axisWindowPrimitives d (growthNewLength n) p j)).range ≤ _ + obtain ⟨q,hq,ha⟩ := growth_edge_window hn p j + let i : Fin (growthOldLength n-1) := ⟨(p+(j.val:ℤ)-q).toNat,by + have he : ((p+(j.val:ℤ)-q).toNat:ℤ) = p+(j.val:ℤ)-q := Int.toNat_of_nonneg (by omega) + omega⟩ + have hi : q+(i.val:ℤ) = p+(j.val:ℤ) := by + have he : ((p+(j.val:ℤ)-q).toNat:ℤ) = p+(j.val:ℤ)-q := Int.toNat_of_nonneg (by omega) + dsimp [i]; omega + have he : axisWindowPrimitives d (growthOldLength n) q i = + axisWindowPrimitives d (growthNewLength n) p j := by + unfold axisWindowPrimitives + congr 2 + exact congrArg (fun z : ℤ => (z:CutRing)*cutTau) hi + rw [← he] + have hh := B.primitiveCopy_range_fullSector hlarge (axisWindowPrimitives d (growthOldLength n) q) + (fun I _ b hb => B.axisFamilyLaw n g d _ hlens.1 q I b hb) I.val (by rw [I.property.2]) b hb + (B.axisFamilyLaw n g d _ hlens.1 q I.val b hb) i + apply hh.trans + rw [axisWindowPrimitive_interval] + change (B.axisSector hlarge n g d (growthOldLength n) hlens.1 q + (coordinateInterval a d (((q+(i.val:ℤ)):CutRing)*cutTau) + (((q+(i.val:ℤ)+1):CutRing)*cutTau))).range ≤ _ + have he0 : (((q+(i.val:ℤ)):CutRing)*cutTau) = (((p+(j.val:ℤ)):CutRing)*cutTau) := by exact_mod_cast congrArg (fun z : ℤ => (z:CutRing)*cutTau) hi + have he1 : (((q+(i.val:ℤ)+1):CutRing)*cutTau) = (((p+(j.val:ℤ)+1):CutRing)*cutTau) := by + congr 1; exact_mod_cast (show q+(i.val:ℤ)+1 = p+(j.val:ℤ)+1 by omega) + rw [he0,he1] + have hl0 : endpointLabel (((p+(j.val:ℤ)):CutRing)*cutTau) = p+(j.val:ℤ) := by + simpa only [Int.cast_add] using endpointLabel_int_mul_tau (p+(j.val:ℤ)) + have hl1 : endpointLabel (((p+(j.val:ℤ)+1):CutRing)*cutTau) = p+(j.val:ℤ)+1 := by + simpa only [Int.cast_add,Int.cast_one] using endpointLabel_int_mul_tau (p+(j.val:ℤ)+1) + apply A.old_interval_range B hlarge g d hlens.2.2.2.1 (growthOldLength n) hlens.1 q _ _ + · simp only [hl0] + omega + · simp only [hl1] + omega + · exact ha + · intro i z hz + apply growthAnchorFamily.clipped_mem_range n hn p i + simp only [Finset.mem_insert,Finset.mem_singleton] at hz + rcases hz with rfl|rfl <;> simp only [hl0,hl1] + all_goals have hj := j.isLt; omega + +theorem growth_axis_law_of_anchor (hlarge : 15 < m+1) (n : ℕ) (hn : 1005 ≤ n) + (g : B.CoordinateWindowLaw n) (d : Fin 2) (p : ℤ) + (h : CentralOn (coverMap M (alternatingGenerator a r m hm)) + ((growthAnchorFamily n hn p).prefixGroup B hlarge g d)) + (I : Finset (Fin (m+1))) (b : Fin (m+1)) (hb : b ∉ I) : + B.PrimitiveFamilyLaw I b hb (axisWindowPrimitives d (growthNewLength n) p) := by + apply CentralOn.mono h + exact (B.primitiveFamily_range_full_all hlarge _ I b hb).trans + (B.growth_axis_range_prefixGroup hlarge n hn g d p) + +end InitialCoverSystem +end GrowthAxisLaw + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/IndividualGridSplits.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/IndividualGridSplits.lean new file mode 100644 index 0000000000000000000000000000000000000000..579871a722ecefb1609c7f6a7170200ef35a04d2 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/IndividualGridSplits.lean @@ -0,0 +1,208 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.FiniteSectorPartition +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.SectorOffsetCoherence +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.TangentChartTemplates +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.ControlledPatching + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section IndividualGridSplits +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + {ι D : Type*} {κ : ι → Type*} [∀ i, Finite (κ i)] + (hlarge : 15 < m+1) + (Q : (i : ι) → κ i → Fin 5 × (CutRing × CutRing)) + (h : ∀ i I, I.card ≤ 15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb (Q i)) + (U : ι → polygonAlgebra a) (W : D → polygonAlgebra a) + +noncomputable def gridInput (i : ι) : TrackStar (Fin (m+1)) →* + BoundedRelationCover M (alternatingGenerator a r m hm) := + B.fullGeometricSector hlarge (Q i) (h i) (U i) + +noncomputable def gridPiece (d : D) (i : ι) : TrackStar (Fin (m+1)) →* + BoundedRelationCover M (alternatingGenerator a r m hm) := + B.fullGeometricSector hlarge (Q i) (h i) (U i ⊓ W d) + +theorem gridPiece_supported + (hU : ∀ i, ResolvedBy (fun j => (primitiveTests (a := a) (r := r) (Q i) j).val) (U i).val) + (hW : ∀ i d, ResolvedBy (fun j => (primitiveTests (a := a) (r := r) (Q i) j).val) (W d).val) + (d : D) (i : ι) : B.AlignedSmallSupported (B.gridPiece hlarge Q h U W d i) := by + apply B.fullGeometricSector_supported + intro x y he + exact and_congr (hU i x y he) (hW i d x y he) + +theorem gridPiece_control (d : D) (i : ι) : + SmallControlled B.c (B.gridPiece hlarge Q h U W d i) + (B.fullGeometricSector hlarge (Q i) (h i) (W d)) := + B.fullGeometricSector_small_control hlarge _ _ _ _ inf_le_right + +theorem gridInput_split + (hU : ∀ i, ResolvedBy (fun j => (primitiveTests (a := a) (r := r) (Q i) j).val) (U i).val) + (hW : ∀ i d, ResolvedBy (fun j => (primitiveTests (a := a) (r := r) (Q i) j).val) (W d).val) + (d : D) (i : ι) (s : TrackStar (Fin (m+1))) : + B.gridInput hlarge Q h U i s = B.gridPiece hlarge Q h U W d i s * + B.gridPiece hlarge Q h U (fun d => (W d)ᶜ) d i s := by + unfold gridInput gridPiece + rw [← B.fullGeometricSector_union hlarge _ _ (U i ⊓ W d) (U i ⊓ (W d)ᶜ) + (fun x y he => and_congr (hU i x y he) (hW i d x y he)) + (Set.disjoint_left.mpr (by intro x hx hy; exact hy.2 hx.2))] + congr 2 + exact (inf_sup_left _ _ _).symm.trans (by rw [sup_compl_eq_top,inf_top_eq]) |>.symm + +theorem grid_complement_coherent (i₀ i : ι) (d : D) + (hW : ∀ i d, ResolvedBy (fun j => (primitiveTests (a := a) (r := r) (Q i) j).val) (W d).val) + (he : B.fullGeometricSector hlarge (Q i) (h i) (W d) = + B.fullGeometricSector hlarge (Q i₀) (h i₀) (W d)) : + B.fullGeometricSector hlarge (Q i) (h i) (W d)ᶜ = + B.fullGeometricSector hlarge (Q i₀) (h i₀) (W d)ᶜ := by + ext s + have hi := B.fullGeometricSector_union hlarge (Q i) (h i) (W d) (W d)ᶜ (hW i d) + (disjoint_compl_right) s + have h₀ := B.fullGeometricSector_union hlarge (Q i₀) (h i₀) (W d) (W d)ᶜ (hW i₀ d) + (disjoint_compl_right) s + rw [sup_compl_eq_top] at hi + change B.fullGeometricSector hlarge (Q i) (h i) (wholePolygon a) s = _ at hi + rw [B.fullGeometricSector_whole,he] at hi + rw [sup_compl_eq_top] at h₀ + change B.fullGeometricSector hlarge (Q i₀) (h i₀) (wholePolygon a) s = _ at h₀ + rw [B.fullGeometricSector_whole] at h₀ + exact mul_left_cancel (hi.symm.trans h₀) + +theorem gridInputs_normalize (h20 : 20 ≤ m+1) (i₀ : ι) + (hU : ∀ i, ResolvedBy (fun j => (primitiveTests (a := a) (r := r) (Q i) j).val) (U i).val) + (hW : ∀ i d, ResolvedBy (fun j => (primitiveTests (a := a) (r := r) (Q i) j).val) (W d).val) + (he : ∀ i d, B.fullGeometricSector hlarge (Q i) (h i) (W d) = + B.fullGeometricSector hlarge (Q i₀) (h i₀) (W d)) : + ∀ d i s, B.gridInput hlarge Q h U i s ∈ + Subgroup.normalizer ((⨆ j, (B.gridPiece hlarge Q h U W d j).range : + Subgroup (BoundedRelationCover M (alternatingGenerator a r m hm))) : Set _) := by + intro d + apply controlled_cell_normalizes _ B.c B.constant_aligned B.disjoint_aligned + (by simpa using h20) (B.gridInput hlarge Q h U) + (B.gridPiece hlarge Q h U W d) (B.gridPiece hlarge Q h U (fun d => (W d)ᶜ) d) + (B.fullGeometricSector hlarge (Q i₀) (h i₀) (W d)) + (B.fullGeometricSector hlarge (Q i₀) (h i₀) (W d)ᶜ) + · exact B.gridPiece_supported hlarge Q h U W hU hW d + · exact B.gridPiece_supported hlarge Q h U (fun d => (W d)ᶜ) hU + (fun i d x y hh => not_congr (hW i d x y hh)) d + · exact B.fullGeometricSector_supported hlarge _ _ _ (hW i₀ d) + · intro i + rw [← he i d] + exact B.gridPiece_control hlarge Q h U W d i + · intro i + rw [← B.grid_complement_coherent hlarge Q h W i₀ i d hW (he i d)] + exact B.gridPiece_control hlarge Q h U (fun d => (W d)ᶜ) d i + · exact B.fullGeometricSector_commute hlarge _ _ _ _ (hW i₀ d) disjoint_compl_right + · exact B.gridInput_split hlarge Q h U W hU hW d + +theorem gridPieces_generate [Fintype D] + (hU : ∀ i, ResolvedBy (fun j => (primitiveTests (a := a) (r := r) (Q i) j).val) (U i).val) + (hW : ∀ i d, ResolvedBy (fun j => (primitiveTests (a := a) (r := r) (Q i) j).val) (W d).val) + (hdisjoint : Pairwise fun d e => Disjoint (W d).val (W e).val) + (hcover : ∀ x, ∃ d, x ∈ (W d).val) : + (⨆ i, (B.gridInput hlarge Q h U i).range) ≤ + ⨆ d, ⨆ i, (B.gridPiece hlarge Q h U W d i).range := by + apply iSup_le + intro i + have hle := B.fullGeometricSector_partition_range hlarge (Q i) (h i) (U i) + (fun d => U i ⊓ W d) + (fun d x y he => and_congr (hU i x y he) (hW i d x y he)) + (fun d e hde => (hdisjoint hde).mono (fun _ hx => hx.2) (fun _ hx => hx.2)) + (fun x => by + constructor + · intro hx + obtain ⟨d,hd⟩ := hcover x + exact ⟨d,hx,hd⟩ + · rintro ⟨d,hd⟩; exact hd.1) + exact hle.trans (iSup_mono fun d => le_iSup (fun i => (B.gridPiece hlarge Q h U W d i).range) i) + +end InitialCoverSystem +end IndividualGridSplits + +section SharedPrimitivePredicates + +theorem spatialTranslate_integral {a : ℕ} (k : Fin 2 → ℤ) (V : polygonAlgebra a) : + spatialTranslate ((k 0:CutRing),(k 1:CutRing)) V=V := by + rw [spatialTranslate_reduce] + have hz : (((k 0:CutRing).im:CutRing)*cutTau,((k 1:CutRing).im:CutRing)*cutTau) = + (0:CutRing × CutRing) := by simp + rw [hz] + apply Subtype.ext + ext p + simp [spatialTranslate,translate_zero] + +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) {ι κ : Type*} [Finite ι] [Finite κ] + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + +theorem fullGeometricSector_shared_test (hlarge : 15 < m+1) + (P : ι → Fin 5 × (CutRing × CutRing)) (Q : κ → Fin 5 × (CutRing × CutRing)) + (i : ι) (j : κ) (he : (P i).1=(Q j).1) + (hp : spatialTranslate (P i).2 (initialTest a r (P i).1)= + spatialTranslate (Q j).2 (initialTest a r (Q j).1)) + (h : ∀ I, I.card≤15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb P) + (g : ∀ I, I.card≤15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb Q) + (V : polygonAlgebra a) + (hV : ResolvedBy (fun _ : Unit => (primitiveTests (a := a) (r := r) P i).val) V.val) : + B.fullGeometricSector hlarge P h V=B.fullGeometricSector hlarge Q g V := by + let S : Unit → Fin 5 × (CutRing × CutRing) := fun _ => P i + let T : Unit → Fin 5 × (CutRing × CutRing) := fun _ => Q j + have hS := fun I hI b hb => PrimitiveFamilyLaw.reindex B I b hb P (h I hI b hb) (fun _ : Unit => i) + have hT := fun I hI b hb => PrimitiveFamilyLaw.reindex B I b hb Q (g I hI b hb) (fun _ : Unit => j) + have hV' : ResolvedBy (fun _ : Unit => (primitiveTests (a := a) (r := r) Q j).val) V.val := by + intro x y hxy + apply hV x y + intro z + change x ∈ (spatialTranslate (P i).2 (initialTest a r (P i).1)).val ↔ + y ∈ (spatialTranslate (P i).2 (initialTest a r (P i).1)).val + rw [hp] + exact hxy () + rw [← B.fullGeometricSector_subfamily hlarge P S (fun _ => i) rfl h hS V hV, + ← B.fullGeometricSector_subfamily hlarge Q T (fun _ => j) rfl g hT V hV'] + exact B.fullGeometricSector_congr_offsets hlarge S T (fun _ => he) (fun _ => hp) hS hT V hV + +theorem tangentSign_integral (hlarge : 15 < m+1) + (n : ℕ) (q : Fin 2 → ℤ) (u : CutRing) (h : B.TangentChartLaws n q u) + (d : Fin 2) (k : Fin 2 → ℤ) (positive : Bool) : + B.tangentSign hlarge n q u h d ((k 0:CutRing),(k 1:CutRing)) positive= + B.tangentSign hlarge n q u h d 0 positive := by + unfold tangentSign + have hp (V : polygonAlgebra a) : spatialTranslate ((k 0:CutRing),(k 1:CutRing)) V= + spatialTranslate 0 V := by + rw [spatialTranslate_integral] + apply Subtype.ext + ext p + simp [spatialTranslate,translate_zero] + rw [hp] + apply B.fullGeometricSector_shared_test hlarge _ _ (Sum.inl (0:Fin 2)) (Sum.inl (0:Fin 2)) + · rfl + · simp only [translatedTemplate,tangentChartTemplate,ite_true,add_zero] + exact hp _ + · intro x y he + have hh := he () + change x ∈ (spatialTranslate (((k 0:CutRing),(k 1:CutRing))+0) + (initialTest a r (slopeTestIndex d))).val ↔ + y ∈ (spatialTranslate (((k 0:CutRing),(k 1:CutRing))+0) + (initialTest a r (slopeTestIndex d))).val at hh + simp only [add_zero,initialTest_slope,hp] at hh + cases positive with + | false => exact not_congr hh + | true => exact hh + +end InitialCoverSystem +end SharedPrimitivePredicates + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/InitialCoverSystem.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/InitialCoverSystem.lean new file mode 100644 index 0000000000000000000000000000000000000000..4a53b2b14d722a09c87c1b04905ffee6021e62a4 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/InitialCoverSystem.lean @@ -0,0 +1,108 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.RandomFields.AlignedCovariance + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section InitialCoverSystem + +private theorem alternating_hom_ext_small {I H : Type*} [Fintype I] [DecidableEq I] + [Group H] (f g : alternatingGroup I →* H) + (h : ∀ s : alternatingGroup I, s.val.support.card ≤ 5 → f s = g s) : f = g := by + apply MonoidHom.eq_of_eqOn_dense alternatingGroup.closure_isThreeCycles_eq_top + intro s hs + exact h s (by rw [hs.card_support]; omega) + +structure InitialCoverSystem (a : ℕ) (r : CutRing) (m : ℕ) (hm : 2 ≤ m) (M : ℕ) where + t : Multiplicative (FreeAbelianGroup (Fin m × Fin 2)) →* + BoundedRelationCover M (alternatingGenerator a r m hm) + c : alternatingGroup (Fin (m+1)) →* + BoundedRelationCover M (alternatingGenerator a r m hm) + t_base : ∀ i, t (Multiplicative.ofAdd (FreeAbelianGroup.of i)) = + PresentedGroup.of (Sum.inr i) + t_projection : (coverMap M (alternatingGenerator a r m hm)).comp t = + sourceLatticeMap a r m hm + t_stabilizers : ∀ s k, Commute (sourceLatticeMap a r m hm k) + (alternatingGenerator a r m hm s) → Commute (t k) (PresentedGroup.of s) + c_projection : (coverMap M (alternatingGenerator a r m hm)).comp c = + conditionalAlternatingHom (wholePolygon a) + c_base : ∀ b : {σ : Equiv.Perm (Fin (m+1)) // σ ∈ alternatingGroup (Fin (m+1)) ∧ + σ.support.card ≤ 5}, c ⟨b.val,b.property.1⟩ = + PresentedGroup.of (sourceConditionalLabel m (0,b)) + constant_aligned : ∀ (s : alternatingGroup (Fin (m+1))) (I : Finset (Fin (m+1))), + ∀ y ∈ sourceAlignedGroup a r m hm M t I, + c s*y*(c s)⁻¹ ∈ sourceAlignedGroup a r m hm M t (I.map s.val.toEmbedding) + disjoint_aligned : ∀ (I J : Finset (Fin (m+1))), Disjoint I J → + ∀ x ∈ sourceAlignedGroup a r m hm M t I, + ∀ y ∈ sourceAlignedGroup a r m hm M t J, Commute x y + initialTable : (Set.range (polygonAssignment (initialTest a r)) → + alternatingGroup (Fin (m+1))) →* + BoundedRelationCover M (alternatingGenerator a r m hm) + initialTable_projection : (coverMap M (alternatingGenerator a r m hm)).comp initialTable = + actualPolygonTableHom (initialTest a r) + initialTable_injective : Function.Injective initialTable + initialTable_input : ∀ b, initialTable (polygonTableInput (initialTest a r) b.1 + (⟨b.2.val,b.2.property.1⟩ : alternatingGroup (Fin (m+1)))) = + PresentedGroup.of (sourceConditionalLabel m b) + perfect : Group.IsPerfect (BoundedRelationCover M (alternatingGenerator a r m hm)) + +theorem initialCoverSystem_eventually (a : ℕ) (r : CutRing) (m : ℕ) + (hm : 2 ≤ m) (hr : 0 < ordinary r ∧ ordinary r < 1/2) (hm' : 15 ≤ m+1) : + ∃ L : ℕ, ∀ M : ℕ, L ≤ M → Nonempty (InitialCoverSystem a r m hm M) := by + obtain ⟨L₁,hL₁⟩ := source_centralizing_translation_lifts_eventually a r m hm + obtain ⟨L₂,hL₂⟩ := source_aligned_disjoint_eventually a r m hm (by omega) + obtain ⟨L₃,hL₃⟩ := source_constant_covariance_eventually a r m hm hr hm' + obtain ⟨L₄,hL₄⟩ := source_initial_table_lifts_eventually a r m hr hm' hm + obtain ⟨L₅,hL₅⟩ := sourceCover_eventually_perfect a r m hr hm' hm + refine ⟨L₁+L₂+L₃+L₄+L₅,fun M hM => ?_⟩ + obtain ⟨t,ht,htp,hts⟩ := hL₁ M (by omega) + obtain ⟨t',ht',_,hd⟩ := hL₂ M (by omega) + have he : t' = t := freeAbelianHom_ext t' t (fun i => (ht' i).trans (ht i).symm) + subst t' + obtain ⟨c,hcp,hcb,R,hc⟩ := hL₃ M (by omega) + obtain ⟨hct,hcx⟩ := hc t ht + obtain ⟨ρ,hρ,hinj,hinput⟩ := hL₄ M (by omega) + refine ⟨{ + t := t + c := c + t_base := ht + t_projection := htp + t_stabilizers := hts + c_projection := hcp + c_base := hcb + constant_aligned := ?_ + disjoint_aligned := hd + initialTable := ρ + initialTable_projection := hρ + initialTable_injective := hinj + initialTable_input := hinput + perfect := hL₅ M (by omega) }⟩ + intro s I y hy + exact source_aligned_constant_conjugation a r m hm M t c R hct hcx s I hy + +namespace InitialCoverSystem + +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + +theorem initialTable_constant : + B.initialTable.comp (polygonTableInput (initialTest a r) 0) = B.c := by + apply alternating_hom_ext_small + intro s hs + change B.initialTable (polygonTableInput (initialTest a r) 0 s) = B.c s + exact (B.initialTable_input (0,⟨s.val,s.property,hs⟩)).trans + (B.c_base ⟨s.val,s.property,hs⟩).symm + +end InitialCoverSystem +end InitialCoverSystem + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/InitialGridActions.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/InitialGridActions.lean new file mode 100644 index 0000000000000000000000000000000000000000..418d2575a437c3427880a5828d06dbb1a4d5e7cc --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/InitialGridActions.lean @@ -0,0 +1,159 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.FormalLaws +import OAI.GroupTheory.SimpleAmenable.CentralCovers.CoordinateTemplateControl +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.FinePatchAtlas + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section InitialGridActions +namespace InitialCoverSystem.PatchAtlas +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + {B : InitialCoverSystem a r m hm M} + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] (A : B.PatchAtlas) + +theorem initial_grid_constant_action (hlarge : 20 ≤ m+1) + (p : Fin 5 × (CutRing × CutRing)) (V : polygonAlgebra a) + (hV : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) + (translatedTemplate (coordinateWindowPrimitives A.geometry.mesh (symmetricWindowStart r)) p.2) i).val) V.val) + (b : Bool) (he : spatialTranslate p.2 (initialTest a r p.1) ⊓ V=if b then V else ⊥) + (n : ℕ) (q : Fin 2 → ℤ) (W : polygonAlgebra a) + (hW : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) + (coordinateWindowPrimitives n q) i).val) W.val) + (hinc : W ≤ V) + (f : TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm)) + (hf : B.AlignedSmallSupported f) + (hc : SmallControlled B.c f (B.windowSector (by omega) n (A.rectangles.rectangles n) q W)) + (I : ControlAlphabet (Fin (m+1))) (s : UniversalExtension (alternatingGroup I.val)) + (x : BoundedRelationCover M (alternatingGenerator a r m hm)) (hx : x ∈ f.range) : + A.primitiveStar (by omega) p (universalMap (subtypeAlternatingHom I.val) s)*x* + (A.primitiveStar (by omega) p (universalMap (subtypeAlternatingHom I.val) s))⁻¹ = + (if b then B.c (subtypeAlternatingHom I.val (universalProjection _ s)) else 1)*x* + (if b then B.c (subtypeAlternatingHom I.val (universalProjection _ s)) else 1)⁻¹ := by + let P := translatedTemplate (initialPatchPrimitives r A.geometry.mesh) p.2 + let h := fun J (_ : J.card ≤ 15) c hc => A.initial p.2 J c hc + have hVp : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) P i).val) V.val := + fun x y he => hV x y (fun i => he (Sum.inr i)) + have hU : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) P i).val) + (spatialTranslate p.2 (initialTest a r p.1)).val := by + intro x y he + simpa only [P,primitiveTests,primitiveFamilyTests,translatedTemplate,initialPatchPrimitives, + Sum.elim_inl,add_zero] using he (Sum.inl p.1) + have hctrl : SmallControlled B.c f (B.fullGeometricSector (by omega) P h V) := by + exact B.coordinate_control_to_template hlarge A.rectangles.rectangles P h Prod.fst + (fun i => p.2+(coordinateWindowPrimitives A.geometry.mesh (symmetricWindowStart r) i).2) + Sum.inr rfl V hV n q W hW hinc f hf hc + exact B.cell_constant_action hlarge P h _ V hU hVp b he f hf hctrl I s x hx + +theorem primitiveStar_slope (hlarge : 15 < m+1) (d : Fin 2) (v : CutRing × CutRing) : + A.primitiveStar hlarge (slopeTestIndex d,v)=A.rectangles.slope hlarge d v := by + symm + unfold primitiveStar + rw [initialTest_slope] + apply A.rectangles.slope_chart_eq hlarge _ _ (Sum.inl (slopeTestIndex d)) d v + simp [translatedTemplate,initialPatchPrimitives] + +end InitialCoverSystem.PatchAtlas +end InitialGridActions + +section LiftedFarGridActions +namespace InitialCoverSystem.PatchAtlas +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + {B : InitialCoverSystem a r m hm M} + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] (A : B.PatchAtlas) + +theorem far_grid_action (hlarge : 20 ≤ m+1) + (hr : 0 (primitiveTests (a := a) (r := r) + (coordinateWindowPrimitives n q) i).val) W.val) + (hinc : W ≤ spatialTranslate v (windowRectangle a A.geometry.mesh (symmetricWindowStart r) cell)) + (f : TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm)) + (hf : B.AlignedSmallSupported f) + (hc : SmallControlled B.c f (B.windowSector (by omega) n (A.rectangles.rectangles n) q W)) + (I : ControlAlphabet (Fin (m+1))) (s : UniversalExtension (alternatingGroup I.val)) + (x : BoundedRelationCover M (alternatingGenerator a r m hm)) (hx : x ∈ f.range) : + A.rectangles.slope (by omega) d v (universalMap (subtypeAlternatingHom I.val) s)*x* + (A.rectangles.slope (by omega) d v (universalMap (subtypeAlternatingHom I.val) s))⁻¹ = + (if 0 ≤ cutForm a (slopeDirection d) z+cutForm a (slopeDirection d) ((k 0:ℝ),(k 1:ℝ)) + then B.c (subtypeAlternatingHom I.val (universalProjection _ s)) else 1)*x* + (if 0 ≤ cutForm a (slopeDirection d) z+cutForm a (slopeDirection d) ((k 0:ℝ),(k 1:ℝ)) + then B.c (subtypeAlternatingHom I.val (universalProjection _ s)) else 1)⁻¹ := by + classical + let b : Bool := decide (0 ≤ cutForm a (slopeDirection d) z+ + cutForm a (slopeDirection d) ((k 0:ℝ),(k 1:ℝ))) + have hres := translatedTemplate_resolved (a := a) (r := r) + (coordinateWindowPrimitives A.geometry.mesh (symmetricWindowStart r)) + (windowRectangle a A.geometry.mesh (symmetricWindowStart r) cell) + (windowRectangle_resolved A.geometry.mesh (by have := A.geometry.mesh_large; omega) _ cell) v + have he : spatialTranslate v (initialTest a r (slopeTestIndex d)) ⊓ + spatialTranslate v (windowRectangle a A.geometry.mesh (symmetricWindowStart r) cell)= + if b then spatialTranslate v (windowRectangle a A.geometry.mesh (symmetricWindowStart r) cell) else ⊥ := by + rw [initialTest_slope,← spatialTranslate_inter, + windowRectangle_far_clipped r (slopeDirection d) hr A.geometry.mesh + (by have := A.geometry.mesh_large; omega) _ cell k hk z hz hfar] + simp only [b,decide_eq_true_eq] + split_ifs <;> rfl + have hh := A.initial_grid_constant_action hlarge (slopeTestIndex d,v) _ hres b he + n q W hW hinc f hf hc I s x hx + rw [A.primitiveStar_slope] at hh + simpa only [b,decide_eq_true_eq] using hh + +theorem exterior_grid_action (hlarge : 20 ≤ m+1) + (hr : 0 -r) (fun _ => r))) + (n : ℕ) (q : Fin 2 → ℤ) (W : polygonAlgebra a) + (hW : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) + (coordinateWindowPrimitives n q) i).val) W.val) + (hinc : W ≤ spatialTranslate v (windowRectangle a A.geometry.mesh (symmetricWindowStart r) cell)) + (f : TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm)) + (hf : B.AlignedSmallSupported f) + (hc : SmallControlled B.c f (B.windowSector (by omega) n (A.rectangles.rectangles n) q W)) + (I : ControlAlphabet (Fin (m+1))) (s : UniversalExtension (alternatingGroup I.val)) + (x : BoundedRelationCover M (alternatingGenerator a r m hm)) (hx : x ∈ f.range) : + Commute (A.rectangles.slope (by omega) d v (universalMap (subtypeAlternatingHom I.val) s)) x := by + have hres := translatedTemplate_resolved (a := a) (r := r) + (coordinateWindowPrimitives A.geometry.mesh (symmetricWindowStart r)) + (windowRectangle a A.geometry.mesh (symmetricWindowStart r) cell) + (windowRectangle_resolved A.geometry.mesh (by have := A.geometry.mesh_large; omega) _ cell) v + have hd : Disjoint (clippedSlopePrimitive a r (slopeDirection d)) + (windowRectangle a A.geometry.mesh (symmetricWindowStart r) cell) := + hout.symm.mono_left (clippedSlope_le_box r (slopeDirection d) hr) + have he : spatialTranslate v (initialTest a r (slopeTestIndex d)) ⊓ + spatialTranslate v (windowRectangle a A.geometry.mesh (symmetricWindowStart r) cell)= + if false then spatialTranslate v (windowRectangle a A.geometry.mesh (symmetricWindowStart r) cell) else ⊥ := by + rw [initialTest_slope,← spatialTranslate_inter,disjoint_iff.mp hd] + rfl + have hh := A.initial_grid_constant_action hlarge (slopeTestIndex d,v) _ hres false he + n q W hW hinc f hf hc I s x hx + rw [A.primitiveStar_slope] at hh + simp only [Bool.false_eq_true,↓reduceIte,inv_one,one_mul,mul_one] at hh + change _ * x = x * _ + have hh' := congrArg (fun y => y*A.rectangles.slope (by omega) d v + (universalMap (subtypeAlternatingHom I.val) s)) hh + simpa only [mul_assoc,inv_mul_cancel,mul_one] using hh' + +end InitialCoverSystem.PatchAtlas +end LiftedFarGridActions + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/LatticeTranslationTransport.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/LatticeTranslationTransport.lean new file mode 100644 index 0000000000000000000000000000000000000000..2a6b24da54433df29d6ba4117c2ca108fa7976ab --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/LatticeTranslationTransport.lean @@ -0,0 +1,119 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.TranslationRoutingHelpers +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.TranslationTransport + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section LatticeTranslationTransport + +noncomputable def sourceGeneratorOffsets (m : ℕ) (j : Fin m × Fin 2) : + Fin (m+1) → CutRing × CutRing := + Pi.single j.1.castSucc (if j.2=0 then (cutTau,0) else (0,cutTau)) - + Pi.single (Fin.last m) (if j.2=0 then (cutTau,0) else (0,cutTau)) + +noncomputable def sourceLatticeOffsets (m : ℕ) : + FreeAbelianGroup (Fin m × Fin 2) →+ (Fin (m+1) → CutRing × CutRing) := + FreeAbelianGroup.lift (sourceGeneratorOffsets m) + +@[simp] theorem sourceLatticeOffsets_of (m : ℕ) (j : Fin m × Fin 2) : + sourceLatticeOffsets m (FreeAbelianGroup.of j)=sourceGeneratorOffsets m j := + FreeAbelianGroup.lift_apply_of _ _ + +theorem sourceGeneratorOffsets_support (m : ℕ) (j : Fin m × Fin 2) + (t : Fin (m+1)) (ht : t ∉ ({j.1.castSucc,Fin.last m} : Finset (Fin (m+1)))) : + sourceGeneratorOffsets m j t=0 := by + classical + have hi : t≠j.1.castSucc := fun he => ht (he ▸ Finset.mem_insert_self _ _) + have hl : t≠Fin.last m := fun he => ht (he ▸ Finset.mem_insert_of_mem + (Finset.mem_singleton_self _)) + simp [sourceGeneratorOffsets,Pi.sub_apply,hi,hl] + +theorem sourceLatticeFullMap_offsets (a : ℕ) (r : CutRing) (m : ℕ) (hm : 2 ≤ m) + (k : FreeAbelianGroup (Fin m × Fin 2)) : + sourceLatticeFullMap a r m hm (Multiplicative.ofAdd k)= + trackTranslation (sourceLatticeOffsets m k) := by + induction k using FreeAbelianGroup.induction_on with + | zero => simp only [map_zero,ofAdd_zero,map_one,trackTranslation_zero] + | of j => + rw [sourceLatticeOffsets_of] + exact sourceLatticeFullMap_of a r m hm j + | neg j ih => + change sourceLatticeFullMap a r m hm ((Multiplicative.ofAdd (FreeAbelianGroup.of j))⁻¹)=_ + rw [map_inv,ih,map_neg,trackTranslation_neg] + | add k l ihk ihl => + change sourceLatticeFullMap a r m hm (Multiplicative.ofAdd k*Multiplicative.ofAdd l)=_ + rw [map_mul,ihk,ihl,map_add,trackTranslation_add] + +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + (hlarge : 15 < m+1) (h : B.AllPrimitiveLaws) (hr : 0 (i j,u j)))) : + (MulAut.conj (B.t (Multiplicative.ofAdd k))).toMonoidHom.comp + (B.slotStar hlarge h hr hwide V i u hinj) = + B.slotStar hlarge h hr hwide V i (fun j => sourceLatticeOffsets m k (i j)+u j) + (SlotMap_shift_injective V i u hinj (sourceLatticeOffsets m k)) := by + induction k using FreeAbelianGroup.induction_on generalizing u with + | zero => + simp only [ofAdd_zero,map_one,map_zero,Pi.zero_apply,zero_add] + ext s : 1 + rfl + | of j => + simpa only [sourceLatticeOffsets_of] using B.slotStar_translation_two_support hlarge h hr R hR hwide V i u hinj + (Multiplicative.ofAdd (FreeAbelianGroup.of j)) (sourceGeneratorOffsets m j) + (sourceLatticeFullMap_of a r m hm j) {j.1.castSucc,Fin.last m} + (by exact le_trans (Finset.card_insert_le _ _) (by simp)) (sourceGeneratorOffsets_support m j) + | neg j _ => + have hd := sourceLatticeFullMap_offsets a r m hm (-FreeAbelianGroup.of j) + exact B.slotStar_translation_two_support hlarge h hr R hR hwide V i u hinj + (Multiplicative.ofAdd (-FreeAbelianGroup.of j)) _ hd {j.1.castSucc,Fin.last m} + (by exact le_trans (Finset.card_insert_le _ _) (by simp)) (by + intro t ht + rw [map_neg,sourceLatticeOffsets_of,Pi.neg_apply,sourceGeneratorOffsets_support m j t ht,neg_zero]) + | add k l ihk ihl => + have hl := DFunLike.congr_fun (ihl u hinj) + have hk := DFunLike.congr_fun (ihk (fun j => sourceLatticeOffsets m l (i j)+u j) + (SlotMap_shift_injective V i u hinj (sourceLatticeOffsets m l))) + have hoff : (fun j => sourceLatticeOffsets m k (i j)+(sourceLatticeOffsets m l (i j)+u j)) = + (fun j => sourceLatticeOffsets m (k+l) (i j)+u j) := by + funext j + rw [map_add,Pi.add_apply,add_assoc] + ext s : 1 + change B.t (Multiplicative.ofAdd k*Multiplicative.ofAdd l)* + B.slotStar hlarge h hr hwide V i u hinj s* + (B.t (Multiplicative.ofAdd k*Multiplicative.ofAdd l))⁻¹ = _ + rw [map_mul] + calc + _ = B.t (Multiplicative.ofAdd k)* + (B.t (Multiplicative.ofAdd l)* B.slotStar hlarge h hr hwide V i u hinj s* + (B.t (Multiplicative.ofAdd l))⁻¹)*(B.t (Multiplicative.ofAdd k))⁻¹ := by group + _ = _ := by + rw [show B.t (Multiplicative.ofAdd l)*B.slotStar hlarge h hr hwide V i u hinj s* + (B.t (Multiplicative.ofAdd l))⁻¹ = _ from hl s] + exact (hk s).trans (by simp only [hoff]) + +end InitialCoverSystem +end LatticeTranslationTransport + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/LocalArrangementAssignments.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/LocalArrangementAssignments.lean new file mode 100644 index 0000000000000000000000000000000000000000..46149fdb89e332321e8fd23b1adcec74c2e7c7d1 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/LocalArrangementAssignments.lean @@ -0,0 +1,206 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.ResolvedBoolean +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.FiniteArrangementGerms + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section LocalArrangementAssignments +variable {a : ℕ} {ι : Type*} + +noncomputable def cutPolygon (a : ℕ) (j : Fin 4) (c : CutRing) : polygonAlgebra a := + ⟨halfPlane a j c,halfPlane_mem a j c⟩ + +noncomputable def localCutFamily (j : ι → Fin 4) (c : ι → CutRing) + (z : ℝ × ℝ) (i : ι) : polygonAlgebra a := by + classical + exact if cutForm a (j i) z=ordinary (c i) then cutPolygon a (j i) (c i) + else if cutForm a (j i) z cutPolygon a (j i) (c i)) p= + polygonAssignment (localCutFamily j c z) y := by + classical + let σ := polygonAssignment (localCutFamily (a := a) j c z) y + have hactive : ∀ i, cutForm a (j i) z=ordinary (c i) → + if σ i then cutForm a (j i) y.val ordinary (c i)) + z y.val σ hactive hinactive V hV ⟨hz,hz₁,hz₂⟩ + let p' : GenericSquare a := ⟨p,⟨hp.2.1.1.le,hp.2.1.2⟩,⟨hp.2.2.1.le,hp.2.2.2⟩,hgeneric⟩ + refine ⟨p',hp.1,?_⟩ + funext i + change decide (cutForm a (j i) p cutPolygon a (j i) (c i))) := by + rintro σ ⟨y,rfl⟩ + obtain ⟨p,_,hp⟩ := localCutFamily_assignment_realized j c z hz₁ hz₂ y Set.univ isOpen_univ (Set.mem_univ z) + exact ⟨p,hp⟩ + +end LocalArrangementAssignments + +section LocalBooleanAssignments +variable {a : ℕ} {ι κ : Type*} + +noncomputable def polygonBooleanPullback [Finite κ] (U : κ → polygonAlgebra a) + (S : Set (κ → Bool)) : polygonAlgebra a := by + refine ⟨{p | polygonAssignment U p ∈ S},?_⟩ + have he : {p | polygonAssignment U p ∈ S}= + ⋃ σ : S, {p | polygonAssignment U p=σ.val} := by + ext p + simp only [Set.mem_ofPred_eq,Set.mem_iUnion] + constructor + · intro h; exact ⟨⟨_,h⟩,rfl⟩ + · rintro ⟨σ,hσ⟩; exact hσ ▸ σ.property + rw [he] + exact BooleanSubalgebra.iSup_mem fun σ => polygonAssignment_fiber_mem U σ.val + +noncomputable def polygonFormalMask (U : κ → polygonAlgebra a) + (V : polygonAlgebra a) : Set (κ → Bool) := + {σ | ∃ p, polygonAssignment U p=σ ∧ p ∈ V.val} + +theorem polygonFormalMask_mem (U : κ → polygonAlgebra a) (V : polygonAlgebra a) + (hV : ResolvedBy (fun i => (U i).val) V.val) (p : GenericSquare a) : + polygonAssignment U p ∈ polygonFormalMask U V ↔ p ∈ V.val := by + constructor + · rintro ⟨q,hq,hqV⟩ + exact (hV q p ((polygonAssignment_eq_iff U q p).mp hq)).mp hqV + · intro hp; exact ⟨p,rfl,hp⟩ + +theorem polygonBooleanPullback_formalMask [Finite κ] + (U : κ → polygonAlgebra a) (V : polygonAlgebra a) + (hV : ResolvedBy (fun i => (U i).val) V.val) : + polygonBooleanPullback U (polygonFormalMask U V)=V := by + apply Subtype.ext + ext p + exact polygonFormalMask_mem U V hV p + +noncomputable def localPolygonFamily [Finite κ] + (j : κ → Fin 4) (c : κ → CutRing) (z : ℝ × ℝ) + (R : ι → polygonAlgebra a) (i : ι) : polygonAlgebra a := + polygonBooleanPullback (localCutFamily j c z) + (polygonFormalMask (fun k => cutPolygon a (j k) (c k)) (R i)) + +theorem localPolygonFamily_assignment_realized [Finite κ] + (j : κ → Fin 4) (c : κ → CutRing) (z : ℝ × ℝ) + (hz₁ : z.1 ∈ Set.Ioo (0:ℝ) 1) (hz₂ : z.2 ∈ Set.Ioo (0:ℝ) 1) + (R : ι → polygonAlgebra a) + (hR : ∀ i, ResolvedBy (fun k => halfPlane a (j k) (c k)) (R i).val) + (y : GenericSquare a) (N : Set (ℝ × ℝ)) (hN : IsOpen N) (hz : z ∈ N) : + ∃ p : GenericSquare a, p.val ∈ N ∧ + polygonAssignment R p=polygonAssignment (localPolygonFamily j c z R) y := by + obtain ⟨p,hp,he⟩ := localCutFamily_assignment_realized j c z hz₁ hz₂ y N hN hz + refine ⟨p,hp,?_⟩ + funext i + apply decide_eq_decide.mpr + change (p ∈ (R i).val) ↔ polygonAssignment (localCutFamily j c z) y ∈ + polygonFormalMask (fun k => cutPolygon a (j k) (c k)) (R i) + rw [← he] + exact (polygonFormalMask_mem _ (R i) (hR i) p).symm + +theorem localPolygonFamily_range_subset [Finite κ] + (j : κ → Fin 4) (c : κ → CutRing) (z : ℝ × ℝ) + (hz₁ : z.1 ∈ Set.Ioo (0:ℝ) 1) (hz₂ : z.2 ∈ Set.Ioo (0:ℝ) 1) + (R : ι → polygonAlgebra a) + (hR : ∀ i, ResolvedBy (fun k => halfPlane a (j k) (c k)) (R i).val) : + Set.range (polygonAssignment (localPolygonFamily j c z R)) ⊆ Set.range (polygonAssignment R) := by + rintro σ ⟨y,rfl⟩ + obtain ⟨p,_,hp⟩ := localPolygonFamily_assignment_realized j c z hz₁ hz₂ R hR y + Set.univ isOpen_univ (Set.mem_univ z) + exact ⟨p,hp⟩ + +theorem localCutFamily_locally_eq [Finite κ] + (j : κ → Fin 4) (c : κ → CutRing) (z : ℝ × ℝ) : + ∃ N : Set (ℝ × ℝ), IsOpen N ∧ z ∈ N ∧ + ∀ p : GenericSquare a, p.val ∈ N → + polygonAssignment (localCutFamily j c z) p= + polygonAssignment (fun k => cutPolygon a (j k) (c k)) p := by + classical + let N : Set (ℝ × ℝ) := ⋂ k, + if cutForm a (j k) z=ordinary (c k) then Set.univ + else if cutForm a (j k) z halfPlane a (j k) (c k)) (R i).val) : + ∃ N : Set (ℝ × ℝ), IsOpen N ∧ z ∈ N ∧ + ∀ p : GenericSquare a, p.val ∈ N → ∀ i, + p ∈ (localPolygonFamily j c z R i).val ↔ p ∈ (R i).val := by + obtain ⟨N,hN,hz,h⟩ := localCutFamily_locally_eq (a := a) j c z + refine ⟨N,hN,hz,fun p hp i => ?_⟩ + change polygonAssignment (localCutFamily j c z) p ∈ polygonFormalMask _ (R i) ↔ _ + rw [h p hp] + exact polygonFormalMask_mem _ (R i) (hR i) p + +end LocalBooleanAssignments + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/LocalAtomComparison.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/LocalAtomComparison.lean new file mode 100644 index 0000000000000000000000000000000000000000..3eeacc4d32454c2c7ef9539955b8d663e4b7e1ec --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/LocalAtomComparison.lean @@ -0,0 +1,233 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.AssignmentAtoms + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section LocalAtomComparison + +variable {I Ω D H : Type*} [Fintype I] [DecidableEq I] [DecidableEq Ω] [Finite Ω] + [Group D] [Group H] + +theorem local_atom_comparison (L : Finset I → Subgroup D) (hmono : Monotone L) + (v : D →* (Ω → alternatingGroup I)) (f : D →* H) + (hgen : Subgroup.closure {h : H | ∃ T : Finset I, T.card ≤ 5 ∧ + ∃ e ∈ L T, h = f e} = ⊤) + (hlaw : ∀ T : Finset I, T.card ≤ 15 → LocalCentralLaw L v f T) + (E : Finset I) (hE : E.card = 5) (a : SwapLabel I) (ha : a.val.support ⊆ E) + (u : Ω × SwapLabel I → D) + (hu : ∀ t, u t ∈ L (E ∪ t.2.val.support)) + (huv : ∀ t, v (u t) = assignmentAtom a t) + (S : Finset I) (hS : S.card ≤ 5) (d : D) (hd : d ∈ L S) + (hvd : ∀ ω, ((v d) ω).val.support ⊆ S) : + ∃ w : FreeGroup (Ω × SwapLabel I), + FreeGroup.lift (assignmentAtom a) w = v d ∧ + QuotientGroup.mk' (Subgroup.center H) (f (FreeGroup.lift u w)) = + QuotientGroup.mk' (Subgroup.center H) (f d) := by + obtain ⟨w,hw,hwu⟩ := supported_atom_word L hmono E a ha u hu (E ∪ S) + Finset.subset_union_left (v d) (fun ω => (hvd ω).trans Finset.subset_union_right) + refine ⟨w,hw,?_⟩ + have hvw : v (FreeGroup.lift u w) = v d := by + change (v.comp (FreeGroup.lift u)) w = v d + rw [hom_comp_freeLift] + simpa only [huv] using hw + have hc : (E ∪ S).card ≤ 10 := + (Finset.card_union_le _ _).trans (by omega) + exact local_equality_mod_center L hmono v f hgen hlaw hc hwu + (hmono Finset.subset_union_right hd) hvw + +theorem local_atoms_generate_center_quotient (L : Finset I → Subgroup D) + (hmono : Monotone L) (v : D →* (Ω → alternatingGroup I)) (f : D →* H) + (hgen : Subgroup.closure {h : H | ∃ T : Finset I, T.card ≤ 5 ∧ + ∃ e ∈ L T, h = f e} = ⊤) + (hlaw : ∀ T : Finset I, T.card ≤ 15 → LocalCentralLaw L v f T) + (hsupp : ∀ S : Finset I, ∀ d ∈ L S, ∀ ω, ((v d) ω).val.support ⊆ S) + (E : Finset I) (hE : E.card = 5) (a : SwapLabel I) (ha : a.val.support ⊆ E) + (u : Ω × SwapLabel I → D) + (hu : ∀ t, u t ∈ L (E ∪ t.2.val.support)) + (huv : ∀ t, v (u t) = assignmentAtom a t) : + Subgroup.closure (Set.range (fun t => QuotientGroup.mk' (Subgroup.center H) (f (u t)))) = ⊤ := by + let q := QuotientGroup.mk' (Subgroup.center H) + let Y := fun t => q (f (u t)) + rw [← FreeGroup.range_lift_eq_closure] + apply top_unique + have hle : (⊤ : Subgroup H) ≤ (FreeGroup.lift Y).range.comap q := by + rw [← hgen] + apply (Subgroup.closure_le _).mpr + rintro _ ⟨S,hS,d,hd,rfl⟩ + obtain ⟨w,_,hw⟩ := local_atom_comparison L hmono v f hgen hlaw E hE a ha u hu huv + S hS d hd (hsupp S d hd) + refine ⟨w,?_⟩ + have heq := DFunLike.congr_fun (hom_comp_freeLift (q.comp f) u) w + exact heq.symm.trans hw + intro z _ + obtain ⟨h,rfl⟩ := QuotientGroup.mk'_surjective (Subgroup.center H) z + exact hle (Subgroup.mem_top h) + +end LocalAtomComparison + +section LocalAtomConjugation + +variable {I Ω D H : Type*} [Fintype I] [DecidableEq I] [DecidableEq Ω] + [Group D] [Group H] + +theorem local_atom_conjugation (L : Finset I → Subgroup D) (hmono : Monotone L) + (v : D →* (Ω → alternatingGroup I)) (f : D →* H) + (hgen : Subgroup.closure {h : H | ∃ T : Finset I, T.card ≤ 5 ∧ + ∃ e ∈ L T, h = f e} = ⊤) + (hlaw : ∀ T : Finset I, T.card ≤ 15 → LocalCentralLaw L v f T) + (E : Finset I) (hE : E.card = 5) (a : SwapLabel I) (ha : a.val.support ⊆ E) + (u : Ω × SwapLabel I → D) + (hu : ∀ t, u t ∈ L (E ∪ t.2.val.support)) + (huv : ∀ t, v (u t) = assignmentAtom a t) (s t : Ω × SwapLabel I) : + let Y := fun t => QuotientGroup.mk' (Subgroup.center H) (f (u t)) + Y s * Y t * (Y s)⁻¹ = + (Y (assignmentAtom a s • (t.1,a)))⁻¹ * Y (assignmentAtom a s • t) := by + dsimp only + let S := E ∪ s.2.val.support ∪ t.2.val.support + have hES : E ⊆ S := Finset.subset_union_left.trans Finset.subset_union_left + have hs : u s ∈ L S := hmono Finset.subset_union_left (hu s) + have ht : u t ∈ L S := hmono + (Finset.union_subset hES Finset.subset_union_right) (hu t) + have hc := atom_conjugation_support E a ha s t + have hb : u (assignmentAtom a s • (t.1,a)) ∈ L S := + hmono (Finset.union_subset hES hc.1) (hu _) + have hd : u (assignmentAtom a s • t) ∈ L S := + hmono (Finset.union_subset hES hc.2) (hu _) + have hcard : S.card ≤ 10 := by + have h1 := Finset.card_union_le E s.2.val.support + have h2 := Finset.card_union_le (E ∪ s.2.val.support) t.2.val.support + rw [swapLabel_card_support] at h1 h2 + dsimp [S] + omega + have heq : v (u s * u t * (u s)⁻¹) = + v ((u (assignmentAtom a s • (t.1,a)))⁻¹ * u (assignmentAtom a s • t)) := by + simp only [map_mul,map_inv,huv] + exact assignmentAtom_conjugation a (assignmentAtom a s) t + have h := local_equality_mod_center L hmono v f hgen hlaw hcard + ((L S).mul_mem ((L S).mul_mem hs ht) ((L S).inv_mem hs)) + ((L S).mul_mem ((L S).inv_mem hb) hd) heq + simpa only [map_mul,map_inv] using h + +theorem local_atom_base (L : Finset I → Subgroup D) (hmono : Monotone L) + (v : D →* (Ω → alternatingGroup I)) (f : D →* H) + (hgen : Subgroup.closure {h : H | ∃ T : Finset I, T.card ≤ 5 ∧ + ∃ e ∈ L T, h = f e} = ⊤) + (hlaw : ∀ T : Finset I, T.card ≤ 15 → LocalCentralLaw L v f T) + (E : Finset I) (hE : E.card = 5) (a : SwapLabel I) + (u : Ω × SwapLabel I → D) + (hu : ∀ t, u t ∈ L (E ∪ t.2.val.support)) + (huv : ∀ t, v (u t) = assignmentAtom a t) (ω : Ω) : + QuotientGroup.mk' (Subgroup.center H) (f (u (ω,a))) = 1 := by + have hc : (E ∪ a.val.support).card ≤ 10 := + (Finset.card_union_le _ _).trans (by rw [hE,swapLabel_card_support]; omega) + have heq : v (u (ω,a)) = v 1 := by rw [huv,assignmentSwap_base_atom,map_one] + simpa only [map_one] using local_equality_mod_center L hmono v f hgen hlaw hc + (hu (ω,a)) (L (E ∪ a.val.support)).one_mem heq + +end LocalAtomConjugation + +section SmallSupportAssignment + +variable {I Ω D H : Type*} [Fintype I] [DecidableEq I] [DecidableEq Ω] [Finite Ω] + [Group D] [Group H] [Group.IsPerfect H] + +theorem small_support_assignment_law_with_atoms + (L : Finset I → Subgroup D) (hmono : Monotone L) + (v : D →* (Ω → alternatingGroup I)) (f : D →* H) (hf : Function.Surjective f) + (hDgen : Subgroup.closure {d : D | ∃ S : Finset I, S.card ≤ 5 ∧ d ∈ L S} = ⊤) + (hsupp : ∀ S : Finset I, ∀ d ∈ L S, ∀ ω, ((v d) ω).val.support ⊆ S) + (hlaw : ∀ T : Finset I, T.card ≤ 15 → LocalCentralLaw L v f T) + (E : Finset I) (hE : E.card = 5) (a : SwapLabel I) (ha : a.val.support ⊆ E) + (u : Ω × SwapLabel I → D) + (hu : ∀ t, u t ∈ L (E ∪ t.2.val.support)) + (huv : ∀ t, v (u t) = assignmentAtom a t) : HasCentralLaw v f := by + classical + have hgen : Subgroup.closure {h : H | ∃ T : Finset I, T.card ≤ 5 ∧ + ∃ e ∈ L T, h = f e} = ⊤ := by + have hi : f '' {d : D | ∃ S : Finset I, S.card ≤ 5 ∧ d ∈ L S} = + {h : H | ∃ T : Finset I, T.card ≤ 5 ∧ ∃ e ∈ L T, h = f e} := by + ext h + constructor + · rintro ⟨d,⟨S,hS,hd⟩,rfl⟩ + exact ⟨S,hS,d,hd,rfl⟩ + · rintro ⟨S,hS,d,hd,rfl⟩ + exact ⟨d,⟨S,hS,hd⟩,rfl⟩ + rw [← hi, ← MonoidHom.map_closure, hDgen, ← MonoidHom.range_eq_map, + MonoidHom.range_eq_top.mpr hf] + let Q := H ⧸ Subgroup.center H + let q : H →* Q := QuotientGroup.mk' (Subgroup.center H) + let P := FreeGroup.lift (assignmentAtom (Ω := Ω) a) + let Y := fun t => q (f (u t)) + have hgenY : Subgroup.closure (Set.range Y) = ⊤ := + local_atoms_generate_center_quotient L hmono v f hgen hlaw hsupp E hE a ha u hu huv + have hcentral : HasCentralLaw P (FreeGroup.lift Y) := by + apply centralLaw_of_atom_conjugations (assignmentAtom a) Y Y (fun t => (t.1,a)) + (fun t s => t.1 = s.1) + · intro t s hts + exact Prod.ext hts rfl + · intro t + rfl + · intro t + exact local_atom_base L hmono v f hgen hlaw E hE a u hu huv t.1 + · intro g t s hts + exact hts + · intro s t + exact local_atom_conjugation L hmono v f hgen hlaw E hE a ha u hu huv s t + · exact hgenY + have hker : P.ker ≤ (FreeGroup.lift Y).ker := by + intro w hw + have hz := (hasCentralLaw_iff P (FreeGroup.lift Y)).mp hcentral w hw + change FreeGroup.lift Y w ∈ Subgroup.center (H ⧸ Subgroup.center H) at hz + rw [perfect_center_quotient] at hz + exact hz + have hP : Function.Surjective P := + FreeGroup.lift_surjective_iff_closure_range_eq_top.mpr (assignmentAtoms_generate a) + let φ : (Ω → alternatingGroup I) →* Q := P.liftOfSurjective hP ⟨_,hker⟩ + have hφ : φ.comp P = FreeGroup.lift Y := P.liftOfRightInverse_comp _ _ _ + have hmap : φ.comp v = q.comp f := by + apply MonoidHom.eq_of_eqOn_dense hDgen + rintro d ⟨S,hS,hd⟩ + obtain ⟨w,hw,hq⟩ := local_atom_comparison L hmono v f hgen hlaw E hE a ha u hu huv + S hS d hd (hsupp S d hd) + change φ (v d) = q (f d) + have hwp : P w = v d := hw + calc + φ (v d) = φ (P w) := congrArg φ hwp.symm + _ = FreeGroup.lift Y w := DFunLike.congr_fun hφ w + _ = q (f (FreeGroup.lift u w)) := + (DFunLike.congr_fun (hom_comp_freeLift (q.comp f) u) w).symm + _ = q (f d) := hq + rw [hasCentralLaw_iff] + intro d hd + have he := DFunLike.congr_fun hmap d + change φ (v d) = q (f d) at he + rw [hd,map_one] at he + have hk : f d ∈ (QuotientGroup.mk' (Subgroup.center H)).ker := he.symm + rwa [QuotientGroup.ker_mk'] at hk + +theorem small_support_assignment_law + (L : Finset I → Subgroup D) (hmono : Monotone L) + (v : D →* (Ω → alternatingGroup I)) (f : D →* H) (hf : Function.Surjective f) + (hDgen : Subgroup.closure {d : D | ∃ S : Finset I, S.card ≤ 5 ∧ d ∈ L S} = ⊤) + (hsupp : ∀ S : Finset I, ∀ d ∈ L S, ∀ ω, ((v d) ω).val.support ⊆ S) + (hlaw : ∀ T : Finset I, T.card ≤ 15 → LocalCentralLaw L v f T) + (E : Finset I) (hE : E.card = 5) (a : SwapLabel I) (ha : a.val.support ⊆ E) + (hcomplete : ∀ S : Finset I, 5 ≤ S.card → S.card ≤ 7 → ∀ g : Ω → alternatingGroup I, + (∀ ω, (g ω).val.support ⊆ S) → ∃ d ∈ L S, v d = g) : HasCentralLaw v f := by + obtain ⟨u,hu⟩ := exists_supported_atom_words L v E hE a ha hcomplete + exact small_support_assignment_law_with_atoms L hmono v f hf hDgen hsupp hlaw E hE a ha u + (fun t => (hu t).1) (fun t => (hu t).2) + +end SmallSupportAssignment + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/PairControl.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/PairControl.lean new file mode 100644 index 0000000000000000000000000000000000000000..17d54bc3e78dd3e0a92aa117933e23426cd00e8d --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/PairControl.lean @@ -0,0 +1,193 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.GrowthAxisUniform + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section PairControl +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) {ι : Type*} [Finite ι] + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + (hlarge : 15 < m+1) (P : ι → Fin 5 × (CutRing × CutRing)) + (h : ∀ i j I, I.card ≤ 15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb (primitivePair P i j)) + +noncomputable def pairContainer (i : ι) (positive : Bool) : + TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm) := + B.fullGeometricSector hlarge (primitivePair P i i) (h i i) + (if positive then primitiveTests (a := a) (r := r) P i + else (primitiveTests (a := a) (r := r) P i)ᶜ) + +omit [Finite ι] in +theorem pairContainer_eq (i j : ι) (positive : Bool) : + B.pairContainer hlarge P h i positive = + B.fullGeometricSector hlarge (primitivePair P i j) (h i j) + (if positive then primitiveTests (a := a) (r := r) P i + else (primitiveTests (a := a) (r := r) P i)ᶜ) := by + apply B.fullGeometricSector_shared_primitive hlarge (primitivePair P i i) (primitivePair P i j) false false rfl _ _ _ + cases positive with + | false => exact fun x y he => not_congr (resolved_test _ () x y he) + | true => exact resolved_test _ () + +omit [Finite ι] in +theorem pairContainer_supported (i : ι) (positive : Bool) : + B.AlignedSmallSupported (B.pairContainer hlarge P h i positive) := by + apply B.fullGeometricSector_supported + cases positive with + | false => exact fun x y he => not_congr (primitivePair_left_resolved P i i x y he) + | true => exact primitivePair_left_resolved P i i + +omit [Finite ι] in +theorem pairSplit_control (i : ι) (j : Option ι) (positive : Bool) : + SmallControlled B.c (B.pairSplit hlarge P h i j positive) + (B.pairContainer hlarge P h i positive) := by + rw [B.pairContainer_eq hlarge P h i (j.getD i) positive] + exact B.fullGeometricSector_small_control hlarge _ _ _ _ inf_le_right + +omit [Finite ι] in +theorem pairContainer_commute (i : ι) (s t : TrackStar (Fin (m+1))) : + Commute (B.pairContainer hlarge P h i true s) (B.pairContainer hlarge P h i false t) := by + apply B.fullGeometricSector_commute hlarge _ _ _ _ (primitivePair_left_resolved P i i) + exact Set.disjoint_left.mpr (by intro x hx hy; exact hy hx) + +omit [Finite ι] in +theorem pairSplit_commute (h20 : 20 ≤ m+1) (i : ι) (j k : Option ι) + (s t : TrackStar (Fin (m+1))) : + Commute (B.pairSplit hlarge P h i j true s) (B.pairSplit hlarge P h i k false t) := + small_control_disjoint _ B.c B.constant_aligned B.disjoint_aligned (by simpa using h20) + _ _ _ _ (B.pairSplit_supported hlarge P h i j true) + (B.pairSplit_supported hlarge P h i k false) + (B.pairContainer_supported hlarge P h i true) + (B.pairSplit_control hlarge P h i j true) + (B.pairSplit_control hlarge P h i k false) + (B.pairContainer_commute hlarge P h i) s t + +omit [Finite ι] in + +theorem pairStar_small (I : FiveAlphabet (Fin (m+1))) (j : Option ι) : + (B.pairStar hlarge P h j).comp (universalMap (subtypeAlternatingHom I.val)) = + (B.smallPrimitiveInputs hlarge P I j).comp + (universalProjection (alternatingGroup I.val)) := by + cases j with + | none => + change (B.c.comp (universalProjection (alternatingGroup (Fin (m+1))))).comp _ = + (B.initialAlphabet I.val 0).comp _ + rw [MonoidHom.comp_assoc,universalMap_spec,← MonoidHom.comp_assoc,B.initialAlphabet_zero] + | some i => + let b := smallAlphabetBalance hlarge I.val (by rw [I.property.2]; omega) + have hb := smallAlphabetBalance_notMem hlarge I.val (by rw [I.property.2]; omega) + change (B.fullGeometricSector hlarge (primitivePair P i i) (h i i) + (primitiveTests (a := a) (r := r) P i)).comp _ = _ + rw [B.fullGeometricSector_inclusion hlarge _ _ I.val (by rw [I.property.2]) b hb + (h i i I.val (by rw [I.property.2]; omega) b hb) _ (primitivePair_left_resolved P i i)] + exact B.geometricSector_input I.val b hb (primitivePair P i i) (h i i _ (by rw [I.property.2]; omega) b hb) false + +omit [Finite ι] in + +theorem pairStar_range : + (⨆ j, (B.pairStar hlarge P h j).range) = + (smallFamilyEval (B.smallPrimitiveInputs hlarge P)).range := by + apply le_antisymm + · apply iSup_le + rintro j x ⟨s,rfl⟩ + exact B.pairStar_mem hlarge P h j s + · rw [smallFamilyEval_range] + apply iSup_le + intro I + apply iSup_le + rintro j x ⟨s,rfl⟩ + obtain ⟨t,rfl⟩ := universalProjection_surjective (alternatingGroup I.val) s + apply le_iSup (fun j => (B.pairStar hlarge P h j).range) j + exact ⟨universalMap (subtypeAlternatingHom I.val) t, + DFunLike.congr_fun (B.pairStar_small hlarge P h I j) t⟩ + +end InitialCoverSystem +end PairControl + +section AssignmentExclusions +variable {E S G K ι Ω : Type*} [Group E] [Group S] [Group G] [Group K] + +noncomputable def copySourceMap (π : E →* S) : FreeGroup (Option ι × E) →* FreeGroup (Option ι × S) := + FreeGroup.map (fun p => (p.1,π p.2)) + +noncomputable def formalAssignmentEval (π : E →* S) : + FreeGroup (Option ι × E) →* ((ι → Bool) → S) := + (assignmentEval (fun i : ι => {σ : ι → Bool | σ i = true})).comp (copySourceMap π) + +theorem formalAssignmentEval_surjective [Finite ι] [Group.IsPerfect S] + (π : E →* S) (hπ : Function.Surjective π) : Function.Surjective (formalAssignmentEval (ι := ι) π) := by + have hv : Function.Surjective (assignmentEval (E := S) (fun i : ι => {σ : ι → Bool | σ i = true})) := by + apply assignmentEval_surjective + intro σ τ h + funext i + exact Bool.eq_iff_iff.mpr (h i) + have hw : Function.Surjective (copySourceMap (ι := ι) π) := by + apply FreeGroup.map_surjective + rintro ⟨i,s⟩ + obtain ⟨t,rfl⟩ := hπ s + exact ⟨(i,t),rfl⟩ + exact hv.comp hw + +theorem forbidden_factor_trivial [Finite ι] [Group.IsPerfect S] + (π : E →* S) (hπ : Function.Surjective π) + (F : Option ι → E →* G) (ρ : G →* K) (c : S →* K) + (σ : ι → Bool) (pattern : Ω → ι → Bool) + (hforbid : σ ∉ Set.range pattern) + (hwhole : ρ.comp (F none) = c.comp π) + (hcomponent : ρ.comp (copyFamilyEval F) = + c.comp ((Pi.evalMonoidHom _ σ).comp (formalAssignmentEval π))) + (hlocal : ∀ w, ((assignmentPullback pattern).comp (formalAssignmentEval π)) w = 1 → + ∀ t, Commute (copyFamilyEval F w) (F none t)) : ∀ s, c s = 1 := by + classical + have hcomm (s t : S) : Commute (c s) (c t) := by + obtain ⟨w,hw⟩ := formalAssignmentEval_surjective (ι := ι) π hπ (Pi.mulSingle σ s) + have hmodel : ((assignmentPullback pattern).comp (formalAssignmentEval π)) w = 1 := by + ext ω + change formalAssignmentEval π w (pattern ω) = 1 + rw [hw,Pi.mulSingle_eq_of_ne] + exact fun he => hforbid ⟨ω,he⟩ + obtain ⟨v,hv⟩ := hπ t + have hh := (hlocal w hmodel v).map ρ + have he := DFunLike.congr_fun hcomponent w + have ht := DFunLike.congr_fun hwhole v + simp only [MonoidHom.comp_apply,Pi.evalMonoidHom_apply,hw,Pi.mulSingle_eq_same] at he + simp only [MonoidHom.comp_apply,hv] at ht + rwa [he,ht] at hh + let : IsMulCommutative c.range := ⟨⟨fun x y => by + obtain ⟨s,hs⟩ := x.property + obtain ⟨t,ht⟩ := y.property + apply Subtype.ext + change x.val*y.val = y.val*x.val + rw [← hs,← ht] + exact (hcomm s t).eq⟩⟩ + intro s + exact congrArg Subtype.val (perfect_hom_to_commGroup c.rangeRestrict s) + +theorem formal_component_of_inputs (π : E →* S) + (F : Option ι → E →* G) (ρ : G →* K) (c : S →* K) (σ : ι → Bool) + (hwhole : ρ.comp (F none) = c.comp π) + (hinput : ∀ i s, ρ (F (some i) s) = if σ i then c (π s) else 1) : + ρ.comp (copyFamilyEval F) = c.comp ((Pi.evalMonoidHom _ σ).comp (formalAssignmentEval π)) := by + apply FreeGroup.ext_hom + rintro ⟨i,s⟩ + cases i with + | none => simpa only [MonoidHom.comp_apply,copyFamilyEval_of,formalAssignmentEval,copySourceMap, + FreeGroup.map.of,assignmentEval,maskFamily,sectorMask_of_mem _ _ _ (Set.mem_univ _), + Pi.evalMonoidHom_apply] using DFunLike.congr_fun hwhole s + | some i => + simp only [MonoidHom.comp_apply,copyFamilyEval_of,formalAssignmentEval,copySourceMap, + FreeGroup.map.of,assignmentEval,maskFamily,Pi.evalMonoidHom_apply] + cases hs : σ i <;> simp [sectorMask,hinput,hs] + +end AssignmentExclusions + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/PairLawAssembly.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/PairLawAssembly.lean new file mode 100644 index 0000000000000000000000000000000000000000..83149bd526382e607409bb6961e51cb8f66c47c7 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/PairLawAssembly.lean @@ -0,0 +1,147 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.AssignmentGeneration + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section PairLawAssembly +variable {G E ι : Type*} [Group G] [Group E] + +noncomputable def assignmentRestriction {Ω : Type*} (F : Ω → Type*) [∀ ω, Group (F ω)] + (U : Set Ω) : (∀ ω, F ω) →* (∀ ω, F ω) := by + classical + exact { toFun := fun s ω => if ω ∈ U then s ω else 1 + map_one' := by ext ω; simp + map_mul' := by intro s t; ext ω; by_cases hu : ω ∈ U <;> simp [hu] } + +@[simp] theorem assignmentRestriction_single {Ω : Type*} [DecidableEq Ω] + (F : Ω → Type*) [∀ ω, Group (F ω)] (U : Set Ω) [DecidablePred (· ∈ U)] + (ω : Ω) (s : F ω) : + assignmentRestriction F U (Pi.mulSingle ω s) = + if ω ∈ U then Pi.mulSingle ω s else 1 := by + classical + ext ν + by_cases heq : ν = ω + · subst ν + by_cases hu : ω ∈ U <;> simp [assignmentRestriction, hu] + · by_cases huω : ω ∈ U <;> by_cases huν : ν ∈ U <;> + simp [assignmentRestriction, heq, huω, huν] + +variable [Fintype ι] +variable (A B : ι → Subgroup G) (h : ∀ i, CommutingFactors (A i) (B i)) + (hz : Subgroup.center G = ⊥) + +noncomputable def refinementEquiv : (∀ σ : ι → Bool, refinedFactor A B Finset.univ σ) ≃* G := by + classical + exact commutingFactorsEquiv (fun σ => refinedFactor A B Finset.univ σ) + (fun _ _ hστ _ _ hx hy => refinedFactor_commute A B h hστ hx hy) + (simultaneous_refinement A B h hz Finset.univ) hz + +@[simp] theorem refinementEquiv_single [DecidableEq (ι → Bool)] (σ : ι → Bool) + (x : refinedFactor A B Finset.univ σ) : + refinementEquiv A B h hz (Pi.mulSingle σ x) = x := by + classical + exact commutingFactorsEquiv_single _ _ _ _ _ _ + +theorem refinement_projection (i : ι) : + ((h i).projectLeft hz).comp (refinementEquiv A B h hz).toMonoidHom = + (refinementEquiv A B h hz).toMonoidHom.comp + (assignmentRestriction (fun σ : ι → Bool => refinedFactor A B Finset.univ σ) + {σ | σ i = true}) := by + classical + apply MonoidHom.pi_ext + intro σ s + change (h i).projectLeft hz (refinementEquiv A B h hz (Pi.mulSingle σ s)) = + refinementEquiv A B h hz + (assignmentRestriction (fun σ : ι → Bool => refinedFactor A B Finset.univ σ) + {σ | σ i = true} (Pi.mulSingle σ s)) + rw [refinementEquiv_single, assignmentRestriction_single] + have hs := s.property + simp only [refinedFactor, assignmentFactor, Subgroup.mem_iInf, Finset.mem_univ, + forall_const] at hs + specialize hs i + by_cases hσ : σ i = true + · simp only [Set.mem_ofPred_eq, hσ, ↓reduceIte, refinementEquiv_single] at hs ⊢ + exact (h i).projectLeft_fix hz hs + · simp only [Set.mem_ofPred_eq, hσ, Bool.false_eq_true, ↓reduceIte] at hs ⊢ + rw [map_one] + exact (h i).projectLeft_kill hz hs + +noncomputable def refinementSource (c : E →* G) (σ : ι → Bool) : + E →* refinedFactor A B Finset.univ σ := + (Pi.evalMonoidHom _ σ).comp ((refinementEquiv A B h hz).symm.toMonoidHom.comp c) + +noncomputable def simultaneousAssignmentMap (c : E →* G) : ((ι → Bool) → E) →* G := + (refinementEquiv A B h hz).toMonoidHom.comp + (MonoidHom.pi fun σ => (refinementSource A B h hz c σ).comp (Pi.evalMonoidHom _ σ)) + +@[simp] theorem simultaneousAssignmentMap_whole (c : E →* G) : + (simultaneousAssignmentMap A B h hz c).comp (sectorMask Set.univ) = c := by + ext s + change refinementEquiv A B h hz + (fun σ => refinementSource A B h hz c σ (sectorMask Set.univ s σ)) = c s + simp only [sectorMask_of_mem _ _ _ (Set.mem_univ _)] + exact (refinementEquiv A B h hz).apply_symm_apply (c s) + +theorem simultaneousAssignmentMap_test (c : E →* G) (i : ι) : + (simultaneousAssignmentMap A B h hz c).comp (sectorMask {σ | σ i = true}) = + ((h i).projectLeft hz).comp c := by + ext s + have hp := DFunLike.congr_fun (refinement_projection A B h hz i) + ((refinementEquiv A B h hz).symm (c s)) + change (h i).projectLeft hz + (refinementEquiv A B h hz ((refinementEquiv A B h hz).symm (c s))) = + refinementEquiv A B h hz + (assignmentRestriction (fun σ : ι → Bool => refinedFactor A B Finset.univ σ) + {σ | σ i = true} ((refinementEquiv A B h hz).symm (c s))) at hp + rw [MulEquiv.apply_symm_apply] at hp + rw [MonoidHom.comp_apply, MonoidHom.comp_apply, hp] + change refinementEquiv A B h hz _ = refinementEquiv A B h hz _ + apply (refinementEquiv A B h hz).congr_arg + ext σ + by_cases hσ : σ i = true + · simp [refinementSource, sectorMask, assignmentRestriction, hσ] + · simp [refinementSource, sectorMask, assignmentRestriction, hσ] + +theorem range_comp_subset {X Y Z : Type*} [Group X] [Group Y] [Group Z] + (f : Y →* Z) (g : X →* Y) : (f.comp g).range ≤ f.range := by + rintro y ⟨x, rfl⟩ + exact ⟨g x, rfl⟩ + +theorem simultaneous_assignment_surjection (c : E →* G) (g : ι → E →* G) + (hinput : ∀ i, g i = ((h i).projectLeft hz).comp c) + (hgenerate : c.range ⊔ ⨆ i, (g i).range = ⊤) : + ∃ φ : ((ι → Bool) → E) →* G, + Function.Surjective φ ∧ φ.comp (sectorMask Set.univ) = c ∧ + ∀ i, φ.comp (sectorMask {σ | σ i = true}) = g i := by + let φ := simultaneousAssignmentMap A B h hz c + have hwhole : φ.comp (sectorMask Set.univ) = c := + simultaneousAssignmentMap_whole A B h hz c + have htest : ∀ i, φ.comp (sectorMask {σ | σ i = true}) = g i := by + intro i + exact (simultaneousAssignmentMap_test A B h hz c i).trans (hinput i).symm + refine ⟨φ, ?_, hwhole, htest⟩ + apply MonoidHom.range_eq_top.mp + apply top_unique + calc + ⊤ = c.range ⊔ ⨆ i, (g i).range := hgenerate.symm + _ ≤ φ.range := sup_le ?_ (iSup_le fun i => ?_) + · calc c.range = (φ.comp (sectorMask Set.univ)).range := + congrArg MonoidHom.range hwhole.symm + _ ≤ φ.range := range_comp_subset φ _ + · calc (g _).range = (φ.comp (sectorMask {σ | σ _ = true})).range := + congrArg MonoidHom.range (htest _).symm + _ ≤ φ.range := range_comp_subset φ _ + +end PairLawAssembly + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/PerfectCalculus.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/PerfectCalculus.lean new file mode 100644 index 0000000000000000000000000000000000000000..fce062c41e610eb1c835b308bc89910a71156dc5 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/PerfectCalculus.lean @@ -0,0 +1,305 @@ +import Mathlib + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +section PerfectCalculus + +open scoped commutatorElement + +variable {P H Q : Type*} [Group P] [Group H] [Group Q] + +theorem perfect_hom_to_commGroup {A : Type*} [Group A] [IsMulCommutative A] [Group.IsPerfect P] + (f : P →* A) (x : P) : f x = 1 := by + have : Group.IsPerfect f.range := Group.IsPerfect.range f + have : Subsingleton f.range := inferInstance + exact congrArg Subtype.val + (Subsingleton.elim (⟨f x, x, rfl⟩ : f.range) 1) + +theorem perfect_lift_unique [Group.IsPerfect P] (q : H →* Q) + (hq : q.ker ≤ Subgroup.center H) (f g : P →* H) + (hfg : q.comp f = q.comp g) : f = g := by + have hpoint (x : P) : q (f x) = q (g x) := DFunLike.congr_fun hfg x + have hc (x : P) : f x * (g x)⁻¹ ∈ Subgroup.center H := by + apply hq + change q (f x * (g x)⁻¹) = 1 + simp [hpoint] + let d : P →* Subgroup.center H := + { toFun := fun x => ⟨f x * (g x)⁻¹, hc x⟩ + map_one' := by apply Subtype.ext; simp + map_mul' := by + intro x y + apply Subtype.ext + change f (x * y) * (g (x * y))⁻¹ = + (f x * (g x)⁻¹) * (f y * (g y)⁻¹) + rw [map_mul, map_mul, mul_inv_rev] + have hcomm := Subgroup.mem_center_iff.mp (hc y) ((g x)⁻¹) + calc + f x * f y * ((g y)⁻¹ * (g x)⁻¹) = + f x * ((f y * (g y)⁻¹) * (g x)⁻¹) := by simp only [mul_assoc] + _ = f x * ((g x)⁻¹ * (f y * (g y)⁻¹)) := by rw [hcomm] + _ = (f x * (g x)⁻¹) * (f y * (g y)⁻¹) := by simp only [mul_assoc] } + ext x + have heq := congrArg Subtype.val (perfect_hom_to_commGroup d x) + exact mul_inv_eq_one.mp heq + +theorem perfect_commutator_central_trivial (A B : Subgroup H) [Group.IsPerfect A] + (h : ⁅A, B⁆ ≤ Subgroup.center H) : ⁅A, B⁆ = ⊥ := by + have hz : ⁅⁅A, B⁆, (⊤ : Subgroup H)⁆ = ⊥ := + Subgroup.commutator_top_right_eq_bot_iff_le_center.mpr h + have ha : ⁅⁅A, B⁆, A⁆ = ⊥ := + bot_unique ((Subgroup.commutator_mono le_rfl le_top).trans hz.le) + have hb : ⁅⁅B, A⁆, A⁆ = ⊥ := by simpa only [Subgroup.commutator_comm B A] using ha + have hc : ⁅⁅A, A⁆, B⁆ = ⊥ := + Subgroup.commutator_commutator_eq_bot_of_rotate ha hb + simpa only [Subgroup.commutator_eq_self] using hc + +theorem perfect_center_quotient [Group.IsPerfect H] : + Subgroup.center (H ⧸ Subgroup.center H) = ⊥ := + Group.IsPerfect.center_quotient_center_eq_bot H + +theorem central_extension_decomposition [Group.IsPerfect Q] (q : H →* Q) + (hq : Function.Surjective q) (hcentral : q.ker ≤ Subgroup.center H) (x : H) : + ∃ d ∈ commutator H, ∃ z ∈ Subgroup.center H, x = d * z := by + have hmap : (commutator H).map q = ⊤ := by + rw [map_commutator_eq, MonoidHom.range_eq_top.mpr hq, + ← commutator_def, Group.IsPerfect.commutator_eq_top] + obtain ⟨d, hd, hdx⟩ := Subgroup.mem_map.mp (hmap.symm ▸ Subgroup.mem_top (q x)) + refine ⟨d, hd, d⁻¹ * x, hcentral ?_, by simp⟩ + change q (d⁻¹ * x) = 1 + simp [hdx] + +theorem central_extension_commutator_perfect [Group.IsPerfect Q] (q : H →* Q) + (hq : Function.Surjective q) (hcentral : q.ker ≤ Subgroup.center H) : + Group.IsPerfect (commutator H) := by + apply Subgroup.isPerfect_iff.mpr + apply le_antisymm (Subgroup.commutator_le_self _) + rw [commutator_def] + apply Subgroup.commutator_le.mpr + intro x _ y _ + obtain ⟨d, hd, z, hz, rfl⟩ := central_extension_decomposition q hq hcentral x + obtain ⟨e, he, w, hw, rfl⟩ := central_extension_decomposition q hq hcentral y + have hzcomm : ⁅z, e * w⁆ = 1 := + commutatorElement_eq_one_iff_mul_comm.mpr + ((Subgroup.mem_center_iff.mp hz (e * w)).symm) + have hwcomm : ⁅d, w⁆ = 1 := + commutatorElement_eq_one_iff_mul_comm.mpr (Subgroup.mem_center_iff.mp hw d) + rw [commutatorElement_mul_left_eq_conj_mul, hzcomm] + simp only [mul_one, mul_inv_cancel, one_mul] + rw [commutatorElement_mul_right_eq_mul_conj, hwcomm] + simpa only [mul_one, mul_inv_cancel_right, commutator_def] using Subgroup.commutator_mem_commutator hd he + +theorem central_extension_commutator_surjective [Group.IsPerfect Q] (q : H →* Q) + (hq : Function.Surjective q) : + Function.Surjective (q.comp (commutator H).subtype) := by + intro x + have hmap : (commutator H).map q = ⊤ := by + rw [map_commutator_eq, MonoidHom.range_eq_top.mpr hq, + ← commutator_def, Group.IsPerfect.commutator_eq_top] + obtain ⟨d, hd, hdx⟩ := Subgroup.mem_map.mp (hmap.symm ▸ Subgroup.mem_top x) + exact ⟨⟨d, hd⟩, hdx⟩ + +end PerfectCalculus + +open scoped commutatorElement +section FiniteCentralCovers +variable {H Q : Type*} [Group H] [Group Q] + +theorem commutator_eq_of_central_kernel (q : H →* Q) + (hc : q.ker ≤ Subgroup.center H) {x x' : H} (hx : q x = q x') (y : H) : + ⁅x,y⁆ = ⁅x',y⁆ := by + have hz : x'⁻¹*x ∈ q.ker := by simp [hx] + have hzy : Commute (x'⁻¹*x) y := (Subgroup.mem_center_iff.mp (hc hz) y).symm + calc + _ = ⁅x'*(x'⁻¹*x),y⁆ := by simp + _ = ⁅x',y⁆ := by rw [commutatorElement_mul_left_eq_conj_mul,hzy.commutator_eq]; simp + +theorem finite_of_perfect_central_cover [Finite Q] [Group.IsPerfect H] + (q : H →* Q) (hq : Function.Surjective q) (hc : q.ker ≤ Subgroup.center H) : Finite H := by + classical + let s : Q → H := fun x => (hq x).choose + have hs (x : Q) : q (s x) = x := (hq x).choose_spec + let r : Q × Q → commutatorSet H := fun p => + ⟨⁅s p.1,s p.2⁆,commutator_mem_commutatorSet _ _⟩ + have hr : Function.Surjective r := by + rintro ⟨z,hz⟩ + obtain ⟨x,y,rfl⟩ := mem_commutatorSet_iff.mp hz + refine ⟨(q x,q y),Subtype.ext ?_⟩ + change ⁅s (q x),s (q y)⁆ = ⁅x,y⁆ + rw [commutator_eq_of_central_kernel q hc (hs (q x))] + rw [← commutatorElement_inv,commutator_eq_of_central_kernel q hc (hs (q y)), + commutatorElement_inv] + have : Finite (commutatorSet H) := Finite.of_surjective r hr + have : Finite (commutator H) := inferInstance + exact Finite.of_surjective (commutator H).subtype (by + intro x + refine ⟨⟨x,?_⟩,rfl⟩ + rw [Group.IsPerfect.commutator_eq_top] + trivial) +end FiniteCentralCovers + +section UniversalCentralExtension + +open scoped commutatorElement + +variable (E : Type*) [Group E] + +def freeEvaluation : FreeGroup E →* E := FreeGroup.lift id + +@[simp] theorem freeEvaluation_of (x : E) : freeEvaluation E (FreeGroup.of x) = x := + FreeGroup.lift_apply_of + +theorem freeEvaluation_surjective : Function.Surjective (freeEvaluation E) := + fun x => ⟨FreeGroup.of x, freeEvaluation_of E x⟩ + +def centralizingRelations : Subgroup (FreeGroup E) := + ⁅(⊤ : Subgroup (FreeGroup E)), (freeEvaluation E).ker⁆ + +instance : (centralizingRelations E).Normal := by + unfold centralizingRelations + infer_instance + +abbrev CentralizedFree := FreeGroup E ⧸ centralizingRelations E + +def centralFreeMap : CentralizedFree E →* E := + QuotientGroup.lift (centralizingRelations E) (freeEvaluation E) + (fun _ h => Subgroup.commutator_le_right (⊤ : Subgroup (FreeGroup E)) + (freeEvaluation E).ker h) + +@[simp] theorem centralFreeMap_mk (x : FreeGroup E) : + centralFreeMap E (QuotientGroup.mk' (centralizingRelations E) x) = + freeEvaluation E x := rfl + +theorem centralFreeMap_surjective : Function.Surjective (centralFreeMap E) := by + intro x + exact ⟨QuotientGroup.mk' (centralizingRelations E) (FreeGroup.of x), freeEvaluation_of E x⟩ + +theorem centralFreeMap_central : (centralFreeMap E).ker ≤ Subgroup.center (CentralizedFree E) := by + intro x + refine QuotientGroup.induction_on x ?_ + intro w hw + apply Subgroup.mem_center_iff.mpr + intro y + refine QuotientGroup.induction_on y ?_ + intro v + apply commutatorElement_eq_one_iff_mul_comm.mp + change ⁅QuotientGroup.mk' (centralizingRelations E) v, + QuotientGroup.mk' (centralizingRelations E) w⁆ = 1 + rw [← map_commutatorElement] + apply (QuotientGroup.eq_one_iff _).mpr + exact Subgroup.commutator_mem_commutator (Subgroup.mem_top v) hw + +abbrev UniversalExtension := commutator (CentralizedFree E) + +def universalProjection : UniversalExtension E →* E := + (centralFreeMap E).comp (commutator (CentralizedFree E)).subtype + +instance [Group.IsPerfect E] : Group.IsPerfect (UniversalExtension E) := + central_extension_commutator_perfect (centralFreeMap E) + (centralFreeMap_surjective E) (centralFreeMap_central E) + +theorem universalProjection_surjective [Group.IsPerfect E] : + Function.Surjective (universalProjection E) := + central_extension_commutator_surjective (centralFreeMap E) (centralFreeMap_surjective E) + +theorem universalProjection_central : + (universalProjection E).ker ≤ Subgroup.center (UniversalExtension E) := by + intro x hx + apply Subgroup.mem_center_iff.mpr + intro y + apply Subtype.ext + exact Subgroup.mem_center_iff.mp (centralFreeMap_central E hx) y.val + +variable {E} {H Q : Type*} [Group H] [Group Q] + +theorem universal_lift_exists (q : H →* Q) (hq : Function.Surjective q) + (hcentral : q.ker ≤ Subgroup.center H) (f : E →* Q) : + ∃ l : UniversalExtension E →* H, q.comp l = f.comp (universalProjection E) := by + classical + let a : E → H := fun x => (hq (f x)).choose + have ha (x : E) : q (a x) = f x := (hq (f x)).choose_spec + let F : FreeGroup E →* H := FreeGroup.lift a + have hF : q.comp F = f.comp (freeEvaluation E) := by + ext x + simpa [F, freeEvaluation] using ha x + have hrel : centralizingRelations E ≤ F.ker := by + apply Subgroup.commutator_le.mpr + intro x _ r hr + change F ⁅x, r⁆ = 1 + rw [map_commutatorElement] + apply commutatorElement_eq_one_iff_mul_comm.mpr + apply Subgroup.mem_center_iff.mp + apply hcentral + change q (F r) = 1 + have hpoint := DFunLike.congr_fun hF r + simpa only [MonoidHom.comp_apply, MonoidHom.mem_ker.mp hr, map_one] using hpoint + let Fbar : CentralizedFree E →* H := + QuotientGroup.lift (centralizingRelations E) F (fun _ hr => hrel hr) + refine ⟨Fbar.comp (commutator (CentralizedFree E)).subtype, ?_⟩ + ext x + change q (Fbar x.val) = f (centralFreeMap E x.val) + have hpoint (y : CentralizedFree E) : q (Fbar y) = f (centralFreeMap E y) := by + refine QuotientGroup.induction_on y ?_ + intro w + exact DFunLike.congr_fun hF w + exact hpoint x.val + +theorem universal_lift_exists_unique [Group.IsPerfect E] (q : H →* Q) + (hq : Function.Surjective q) (hcentral : q.ker ≤ Subgroup.center H) (f : E →* Q) : + ∃! l : UniversalExtension E →* H, q.comp l = f.comp (universalProjection E) := by + obtain ⟨l, hl⟩ := universal_lift_exists q hq hcentral f + refine ⟨l, hl, ?_⟩ + intro l' hl' + exact perfect_lift_unique q hcentral l' l (hl'.trans hl.symm) + +noncomputable def universalLift [Group.IsPerfect E] (q : H →* Q) + (hq : Function.Surjective q) (hcentral : q.ker ≤ Subgroup.center H) (f : E →* Q) : + UniversalExtension E →* H := + (universal_lift_exists_unique q hq hcentral f).choose + +theorem universalLift_spec [Group.IsPerfect E] (q : H →* Q) + (hq : Function.Surjective q) (hcentral : q.ker ≤ Subgroup.center H) (f : E →* Q) : + q.comp (universalLift q hq hcentral f) = f.comp (universalProjection E) := + (universal_lift_exists_unique q hq hcentral f).choose_spec.1 + +variable [Group.IsPerfect E] [Group.IsPerfect H] [Group.IsPerfect Q] + +noncomputable def universalMap (f : E →* H) : UniversalExtension E →* UniversalExtension H := + universalLift (universalProjection H) (universalProjection_surjective H) + (universalProjection_central H) f + +theorem universalMap_spec (f : E →* H) : + (universalProjection H).comp (universalMap f) = f.comp (universalProjection E) := + universalLift_spec _ _ _ _ + +@[simp] theorem universalMap_id : universalMap (MonoidHom.id E) = + MonoidHom.id (UniversalExtension E) := by + apply perfect_lift_unique (universalProjection E) (universalProjection_central E) + simpa using universalMap_spec (MonoidHom.id E) + +@[simp] theorem universalMap_comp (g : H →* Q) (f : E →* H) : + universalMap (g.comp f) = (universalMap g).comp (universalMap f) := by + apply perfect_lift_unique (universalProjection Q) (universalProjection_central Q) + rw [universalMap_spec, ← MonoidHom.comp_assoc, universalMap_spec] + simp only [MonoidHom.comp_assoc, universalMap_spec] + +noncomputable def universalEquiv (f : E ≃* H) : UniversalExtension E ≃* UniversalExtension H := + MonoidHom.toMulEquiv (universalMap f.toMonoidHom) (universalMap f.symm.toMonoidHom) + (by rw [← universalMap_comp]; simp) + (by rw [← universalMap_comp]; simp) + +instance universalExtension_finite [Finite E] : Finite (UniversalExtension E) := + finite_of_perfect_central_cover (universalProjection E) (universalProjection_surjective E) + (universalProjection_central E) + +end UniversalCentralExtension + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/PerfectGeneratingFamilies.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/PerfectGeneratingFamilies.lean new file mode 100644 index 0000000000000000000000000000000000000000..d35dbd4c2ae4a738f8f61c553f51abf06791ff71 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/PerfectGeneratingFamilies.lean @@ -0,0 +1,187 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.FiniteCentralKernel +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.TranslationLifts + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section PerfectGeneratingFamilies + +variable {ι G H : Type*} [Group G] [Group H] + +theorem perfect_iSup (F : ι → Subgroup G) [∀ i, Group.IsPerfect (F i)] : + Group.IsPerfect ↥(⨆ i, F i) := by + apply Subgroup.isPerfect_iff.mpr + apply le_antisymm (Subgroup.commutator_le_self _) + apply iSup_le + intro i + rw [← Subgroup.commutator_eq_self (H := F i)] + exact Subgroup.commutator_mono (le_iSup F i) (le_iSup F i) + +theorem central_perfect_generating_ranges {E : ι → Type*} [∀ i, Group (E i)] + [∀ i, Group.IsPerfect (E i)] [Group.IsPerfect H] + (q : H →* G) (hc : q.ker ≤ Subgroup.center H) + (f : ∀ i, E i →* H) (hf : (⨆ i, (q.comp (f i)).range) = ⊤) : + (⨆ i, (f i).range) = ⊤ := by + let S : Subgroup H := ⨆ i, (f i).range + let (i : ι) : Group.IsPerfect (f i).range := Group.IsPerfect.range (f i) + let : Group.IsPerfect S := perfect_iSup (fun i => (f i).range) + have hm : S.map q = ⊤ := by + simp only [S, Subgroup.map_iSup, ← MonoidHom.range_comp] + exact hf + have hs : Function.Surjective (q.comp S.subtype) := by + apply MonoidHom.range_eq_top.mp + rw [MonoidHom.range_comp, Subgroup.range_subtype] + exact hm + have hr := perfect_lift_range S.subtype q hs hc + simpa only [Subgroup.range_subtype, Group.IsPerfect.commutator_eq_top] using hr + +variable [Group.IsPerfect G] + +theorem universal_generating_ranges {E : ι → Type*} [∀ i, Group (E i)] + [∀ i, Group.IsPerfect (E i)] (f : ∀ i, E i →* G) + (hf : (⨆ i, (f i).range) = ⊤) : + (⨆ i, (universalMap (f i)).range) = ⊤ := by + apply central_perfect_generating_ranges (universalProjection G) + (universalProjection_central G) (fun i => universalMap (f i)) + have he (i : ι) : ((universalProjection G).comp (universalMap (f i))).range = (f i).range := by + rw [universalMap_spec, MonoidHom.range_comp, + MonoidHom.range_eq_top.mpr (universalProjection_surjective (E i)), ← MonoidHom.range_eq_map] + simpa only [he] using hf + +end PerfectGeneratingFamilies + +section FiniteTranslationCentralizers + +variable {α β ι G : Type*} [Group G] + +noncomputable def translationWordMap (β : Type*) : + FreeGroup β →* Multiplicative (FreeAbelianGroup β) := + FreeGroup.lift (fun i => Multiplicative.ofAdd (FreeAbelianGroup.of i)) + +theorem translationWordMap_surjective : Function.Surjective (translationWordMap β) := by + intro x + change ∃ y, translationWordMap β y = + Multiplicative.ofAdd (Multiplicative.toAdd x) + induction Multiplicative.toAdd x using FreeAbelianGroup.induction_on with + | zero => exact ⟨1,map_one _⟩ + | of i => exact ⟨FreeGroup.of i,FreeGroup.lift_apply_of⟩ + | neg i hi => + obtain ⟨w,hw⟩ := hi + exact ⟨w⁻¹,by change translationWordMap β (w⁻¹) = _⁻¹; rw [map_inv,hw]; rfl⟩ + | add x y hx hy => + obtain ⟨w,hw⟩ := hx + obtain ⟨v,hv⟩ := hy + exact ⟨w*v,by change translationWordMap β (w*v) = _*_; rw [map_mul,hw,hv]; rfl⟩ + +theorem translation_lattice_fg [Finite β] : + Group.FG (Multiplicative (FreeAbelianGroup β)) := + Group.fg_of_surjective (translationWordMap_surjective (β := β)) + +theorem translation_centralizers_eventually [Finite β] [Finite ι] + (f : α → G) (w : β → FreeGroup α) (v : ι → FreeGroup α) + (ht : ∀ i j, Commute (FreeGroup.lift f (w i)) (FreeGroup.lift f (w j))) : + ∃ L : ℕ, ∀ M : ℕ, L ≤ M → + ∀ t : Multiplicative (FreeAbelianGroup β) →* BoundedRelationCover M f, + (∀ i, t (Multiplicative.ofAdd (FreeAbelianGroup.of i)) = + PresentedGroup.mk (shortRelations M f) (w i)) → + ∀ i k, Commute (commutingFamilyHom (fun j => FreeGroup.lift f (w j)) ht k) + (FreeGroup.lift f (v i)) → + Commute (t k) (PresentedGroup.mk (shortRelations M f) (v i)) := by + classical + let T := Multiplicative (FreeAbelianGroup β) + let : Group.FG T := translation_lattice_fg + let q : T →* G := commutingFamilyHom (fun j => FreeGroup.lift f (w j)) ht + let K (i : ι) : Subgroup T := (Subgroup.centralizer {FreeGroup.lift f (v i)}).comap q + have hK (i : ι) : (K i).FG := subgroup_fg_of_comm (K i) + choose S hS using hK + let J := (i : ι) × ↥(S i) + let z : J → T := fun j => j.2.val + choose V hV using fun j : J => translationWordMap_surjective (z j) + let W : FreeGroup β →* FreeGroup α := FreeGroup.lift w + have he : (FreeGroup.lift f).comp W = q.comp (translationWordMap β) := by + ext i + simp only [MonoidHom.comp_apply,W,q,translationWordMap,FreeGroup.lift_apply_of] + exact (commutingFamilyHom_of (fun j => FreeGroup.lift f (w j)) ht i).symm + have hc (j : J) : Commute (FreeGroup.lift f (W (V j))) (FreeGroup.lift f (v j.1)) := by + have hz : z j ∈ K j.1 := by + rw [← hS j.1] + exact Subgroup.subset_closure j.2.property + change q (z j) ∈ Subgroup.centralizer {_} at hz + have hv : FreeGroup.lift f (W (V j)) = q (z j) := by + simpa only [MonoidHom.comp_apply,hV j] using DFunLike.congr_fun he (V j) + rw [hv] + exact Subgroup.mem_centralizer_singleton_iff.mp hz + obtain ⟨L,hL⟩ := finite_word_equalities_eventually f + (fun j : J => W (V j) * v j.1) (fun j => v j.1 * W (V j)) + (fun j => by simpa only [map_mul] using (hc j).eq) + refine ⟨L,fun M hM t ht' i k hk => ?_⟩ + have he' : t.comp (translationWordMap β) = + (PresentedGroup.mk (shortRelations M f)).comp W := by + ext j + simpa [translationWordMap,W] using ht' j + have hk' : k ∈ K i := Subgroup.mem_centralizer_singleton_iff.mpr hk.eq + have hle : K i ≤ (Subgroup.centralizer + {PresentedGroup.mk (shortRelations M f) (v i)}).comap t := by + rw [← hS i] + apply (Subgroup.closure_le _).mpr + intro x hx + let j : J := ⟨i,⟨x,hx⟩⟩ + have hv : t x = PresentedGroup.mk (shortRelations M f) (W (V j)) := by + simpa only [MonoidHom.comp_apply,hV j] using DFunLike.congr_fun he' (V j) + change t x ∈ Subgroup.centralizer {_} + apply Subgroup.mem_centralizer_singleton_iff.mpr + rw [hv] + simpa only [map_mul] using hL M hM j + exact Subgroup.mem_centralizer_singleton_iff.mp (hle hk') + +end FiniteTranslationCentralizers + +section SourceCentralizingTranslations + +variable (a : ℕ) (r : CutRing) (m : ℕ) (hm : 2 ≤ m) + +noncomputable def sourceLatticeMap : + Multiplicative (FreeAbelianGroup (Fin m × Fin 2)) →* + polygonAlternatingGroup a (m+1) := + commutingFamilyHom (fun i => alternatingGenerator a r m hm (Sum.inr i)) + (source_translation_commute a r m hm) + +theorem source_centralizing_translation_lifts_eventually : + ∃ L : ℕ, ∀ M : ℕ, L ≤ M → + ∃ t : Multiplicative (FreeAbelianGroup (Fin m × Fin 2)) →* + BoundedRelationCover M (alternatingGenerator a r m hm), + (∀ i, t (Multiplicative.ofAdd (FreeAbelianGroup.of i)) = + PresentedGroup.of (Sum.inr i)) ∧ + (coverMap M (alternatingGenerator a r m hm)).comp t = + sourceLatticeMap a r m hm ∧ + ∀ s k, Commute (sourceLatticeMap a r m hm k) + (alternatingGenerator a r m hm s) → + Commute (t k) (PresentedGroup.of s) := by + let f := alternatingGenerator a r m hm + let w : Fin m × Fin 2 → FreeGroup (SourceGeneratorLabel m) := + fun i => FreeGroup.of (sourceTranslationLabel m i) + have hc : ∀ i j, Commute (FreeGroup.lift f (w i)) (FreeGroup.lift f (w j)) := by + intro i j + exact source_translation_commute a r m hm i j + obtain ⟨L₁,hL₁⟩ := commuting_words_lift_eventually f w hc + obtain ⟨L₂,hL₂⟩ := translation_centralizers_eventually f w + (fun s : SourceGeneratorLabel m => FreeGroup.of s) hc + refine ⟨max L₁ L₂,fun M hM => ?_⟩ + obtain ⟨t,ht,htq⟩ := hL₁ M (le_trans (le_max_left _ _) hM) + refine ⟨t,ht,htq,?_⟩ + intro s k hk + exact hL₂ M (le_trans (le_max_right _ _) hM) t ht s k hk + +end SourceCentralizingTranslations + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/PhaseClippedModels.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/PhaseClippedModels.lean new file mode 100644 index 0000000000000000000000000000000000000000..651322355cec8c56a21aeb3cdbf4b457a745a475 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/PhaseClippedModels.lean @@ -0,0 +1,159 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.ExteriorClippedModels +import OAI.GroupTheory.SimpleAmenable.CentralCovers.FarClippedModels +import OAI.GroupTheory.SimpleAmenable.CentralCovers.FormalLaws +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.ClippedGerms +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.ExteriorPhaseGeometry + +namespace OAI + +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +namespace InitialCoverSystem.PatchAtlas +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} {B : InitialCoverSystem a r m hm M} + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] (A : B.PatchAtlas) + +theorem phase_clipped_model_action_neighborhood {ι : Type*} [Finite ι] + (hlarge : 20 ≤ m+1) (hr : 0 halfPlane a (j i) (c i)) + (spatialTranslate u (clippedSlopePrimitive a r (slopeDirection d))).val) + (hmesh : (1+|ordinary (cutTau^a)|)*(200/(A.geometry.mesh:ℝ)) (primitiveTests (a := a) (r := r) + (coordinateWindowPrimitives n q) e).val) (coordinateRectangle a L V).val) → + (coordinateRectangle a L V ≤ + A.geometry.coordinateGate T.vertex T.offset z Prod.fst G.axialCut σ) → + ∀ (cell : Fin 2 → Fin A.geometry.mesh), + (coordinateRectangle a L V ≤ spatialTranslate G.offset + (windowRectangle a A.geometry.mesh (symmetricWindowStart r) cell)) → + ∀ p : GenericSquare a, p ∈ (coordinateRectangle a L V).val → dist p.val z<δ → + (∀ k, ordinary (L k)≤realCoordinate p.val k ∧ realCoordinate p.val k spatialTranslate u (clippedSlopePrimitive a r (slopeDirection d))) ()) + (universalMap (subtypeAlternatingHom I.val) s)*x* + (B.fullGeometricSector (by omega) (A.concurrentPrimitives T.vertex T.offset) (A.concurrentLaw T.vertex T.offset) + (T.polygons (fun _ : Unit => spatialTranslate u (clippedSlopePrimitive a r (slopeDirection d))) ()) + (universalMap (subtypeAlternatingHom I.val) s))⁻¹ := by + by_cases hσ : ∀ k, σ (k,false)=false ∧ σ (k,true)=true + · obtain ⟨δ,hδ,hact⟩ := A.interior_clipped_model_action_neighborhood hlarge hr d u z G T hz₁ hz₂ + lo hi slope hlo hhi hs hR hmesh σ hσ + refine ⟨δ,hδ,?_⟩ + intro L V hLV hclip hnear n q hW hinc cell hinitial p hp hpδ hpoint f hf hc I s x hx + exact hact L V hLV (hclip hσ) hnear n q hW hinc cell hinitial p hp hpδ hpoint f hf hc I s x hx + · obtain ⟨O,hO,hz,hlocal⟩ := T.decisions_locally_eq hr + obtain ⟨δ,hδ,hball⟩ := Metric.isOpen_iff.mp hO z hz + refine ⟨min δ G.radius,lt_min hδ G.radius_pos,?_⟩ + intro L V hLV hclip hnear n q hW hinc cell hinitial p hp hpδ hpoint f hf hc I s x hx + have hperiod (P : polygonAlgebra a) : spatialTranslate G.offset P=spatialTranslate u P := by + change spatialTranslate (u+((G.period 0:CutRing),(G.period 1:CutRing))) P=_ + rw [spatialTranslate_add,spatialTranslate_integral] + have hinitial' : coordinateRectangle a L V≤ spatialTranslate u + (windowRectangle a A.geometry.mesh (symmetricWindowStart r) cell) := by + simpa only [hperiod] using hinitial + have hb (k : Fin 2) : symmetricWindowStart r k≤endpointLabel (-r) ∧ + endpointLabel (-r) halfPlane a (j i) (c i)) + (spatialTranslate u (clippedSlopePrimitive a r (slopeDirection d))).val) + (hmesh : (1+|ordinary (cutTau^a)|)*(200/(A.geometry.mesh:ℝ)) (primitiveTests (a := a) (r := r) + (coordinateWindowPrimitives n q) e).val) (coordinateRectangle a L V).val) → + (coordinateRectangle a L V ≤ + A.geometry.coordinateGate T.vertex T.offset z Prod.fst G.axialCut σ) → + ∀ (cell : Fin 2 → Fin A.geometry.mesh), + (coordinateRectangle a L V ≤ spatialTranslate G.offset + (windowRectangle a A.geometry.mesh (symmetricWindowStart r) cell)) → + ∀ p : GenericSquare a, p ∈ (coordinateRectangle a L V).val → dist p.val z<δ → + (∀ k, ordinary (L k)≤realCoordinate p.val k ∧ realCoordinate p.val k spatialTranslate u (clippedSlopePrimitive a r (slopeDirection d))) ()) + (universalMap (subtypeAlternatingHom I.val) s)*x* + (B.fullGeometricSector (by omega) (A.concurrentPrimitives T.vertex T.offset) (A.concurrentLaw T.vertex T.offset) + (T.polygons (fun _ : Unit => spatialTranslate u (clippedSlopePrimitive a r (slopeDirection d))) ()) + (universalMap (subtypeAlternatingHom I.val) s))⁻¹ := by + classical + have hall σ := A.phase_clipped_model_action_neighborhood hlarge hr d u z G hbox T hz₁ hz₂ + lo hi slope hlo hhi hs hR hmesh σ + choose δ hδ hact using hall + obtain ⟨σ₀,_,hmin⟩ := Finset.univ.exists_min_image δ + (show (Finset.univ : Finset (Fin 2 × Bool → Bool)).Nonempty from Finset.univ_nonempty) + refine ⟨δ σ₀,hδ σ₀,?_⟩ + intro σ L V hLV hclip hnear n q hW hinc cell hinitial p hp hpδ hpoint f hf hc I s x hx + have hb : δ σ₀≤δ σ := hmin σ (Finset.mem_univ σ) + exact hact σ L V hLV hclip (fun k => ⟨(hnear k).1.trans_le hb,(hnear k).2.trans_le hb⟩) + n q hW hinc cell hinitial p hp (hpδ.trans_le hb) hpoint f hf hc I s x hx + +end InitialCoverSystem.PatchAtlas + +end SimpleAmenable + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/PolygonAtomLaw.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/PolygonAtomLaw.lean new file mode 100644 index 0000000000000000000000000000000000000000..c4c6563c447d904812f9b3d70f4df0e5eff73b19 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/PolygonAtomLaw.lean @@ -0,0 +1,92 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.StarAtomLaw + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section PolygonAtomLaw +variable {a m : ℕ} {Ω : Type*} + +@[simp] theorem PolygonLabelling.tableHom_single_mask [Fintype Ω] (v : PolygonLabelling a Ω) + (ω : Ω) : v.tableHom.comp (sectorMask {ω}) = conditionalAlternatingHom (m := m) (v.fiber ω) := by + classical + ext s : 1 + change v.tableHom (sectorMask {ω} s) = conditionalAlternatingHom (v.fiber ω) s + have he : sectorMask {ω} s = Pi.mulSingle ω s := by + ext ν + by_cases hh : ν=ω <;> simp [sectorMask,hh] + rw [he,v.tableHom_single] + +noncomputable def polygonPartitionLabelling (U : Ω → polygonAlgebra a) + (hcover : ∀ p : GenericSquare a, ∃ i, p ∈ (U i).val) + (hdisjoint : Pairwise fun i j => Disjoint (U i).val (U j).val) : PolygonLabelling a Ω where + label p := (hcover p).choose + fiber_mem i := by + have he : {p | (hcover p).choose = i} = (U i).val := by + ext p + constructor + · intro hp + change (hcover p).choose = i at hp + simpa only [hp] using (hcover p).choose_spec + · intro hp + by_contra hh + exact Set.disjoint_left.mp (hdisjoint hh) (hcover p).choose_spec hp + rw [he] + exact (U i).property + +theorem polygonPartitionLabelling_fiber (U : Ω → polygonAlgebra a) + (hcover : ∀ p : GenericSquare a, ∃ i, p ∈ (U i).val) + (hdisjoint : Pairwise fun i j => Disjoint (U i).val (U j).val) (i : Ω) : + (polygonPartitionLabelling U hcover hdisjoint).fiber i = U i := by + apply Subtype.ext + ext p + change (hcover p).choose = i ↔ p ∈ (U i).val + constructor + · intro hp; simpa only [hp] using (hcover p).choose_spec + · intro hp + by_contra hh + exact Set.disjoint_left.mp (hdisjoint hh) (hcover p).choose_spec hp + +theorem polygonPartitionLabelling_surjective (U : Ω → polygonAlgebra a) + (hcover : ∀ p : GenericSquare a, ∃ i, p ∈ (U i).val) + (hdisjoint : Pairwise fun i j => Disjoint (U i).val (U j).val) + (hne : ∀ i, (U i).val.Nonempty) : + Function.Surjective (polygonPartitionLabelling U hcover hdisjoint).label := by + intro i + obtain ⟨p,hp⟩ := hne i + refine ⟨p,?_⟩ + change p ∈ ((polygonPartitionLabelling U hcover hdisjoint).fiber i).val + rwa [polygonPartitionLabelling_fiber] + +theorem centralOn_polygon_atoms {H : Type*} [Group H] [Fintype Ω] + (q : H →* polygonAlternatingGroup a m) (U : Ω → polygonAlgebra a) + (hcover : ∀ p : GenericSquare a, ∃ i, p ∈ (U i).val) + (hdisjoint : Pairwise fun i j => Disjoint (U i).val (U j).val) + (hne : ∀ i, (U i).val.Nonempty) + (f : Ω → UniversalExtension (alternatingGroup (Fin m)) →* H) + (hcomm : Pairwise fun i j => ∀ s t, Commute (f i s) (f j t)) + (hproj : ∀ i, q.comp (f i) = (conditionalAlternatingHom (U i)).comp + (universalProjection (alternatingGroup (Fin m)))) : + CentralOn q (⨆ i, (f i).range) := by + let v := polygonPartitionLabelling U hcover hdisjoint + apply centralOn_of_star_atoms q v.tableHom + (v.tableHom_injective (polygonPartitionLabelling_surjective U hcover hdisjoint hne)) f hcomm + intro i + rw [PolygonLabelling.tableHom_single_mask] + change q.comp (f i) = (conditionalAlternatingHom + ((polygonPartitionLabelling U hcover hdisjoint).fiber i)).comp _ + rw [polygonPartitionLabelling_fiber] + exact hproj i + +end PolygonAtomLaw + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/PolygonCommutingRepresentatives.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/PolygonCommutingRepresentatives.lean new file mode 100644 index 0000000000000000000000000000000000000000..10173fcf48cd7bcdf3c8f2672ce6c7a3b43adc1a --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/PolygonCommutingRepresentatives.lean @@ -0,0 +1,105 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.PolygonSmallPartition + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section PolygonCommutingRepresentatives + +open Classical Set +namespace PolygonObject.BankEmbedding +variable {a m : ℕ} + +theorem commuting_representatives (hm : 0 < m) (f g : polygonFullGroup a m) : + ∃u v : polygonFullGroup a m, + (∃a₀ : polygonAlternatingGroup a m,u=a₀.val*f) ∧ + (∃b₀ c : polygonAlternatingGroup a m,v=c.val*(b₀.val*g)*c.val⁻¹) ∧ Commute u v := by + let δ : ℝ := (m:ℝ)/100 + have hδ : 0<δ := by dsimp [δ]; positivity + obtain ⟨a₀,S,hS,hf⟩ := small_support_coset f hδ + obtain ⟨b₀,T,hT,hg⟩ := small_support_coset g hδ + have htotal : (∑i,PolygonArea.area (S i))+(∑i,PolygonArea.area (S i)ᶜ)=(m:ENNReal) := by + rw [←Finset.sum_add_distrib] + simp only [PolygonArea.area_compl,Finset.sum_const,Finset.card_univ,Fintype.card_fin,nsmul_eq_mul,mul_one] + have htwo : ENNReal.ofReal δ+ENNReal.ofReal δ<(m:ENNReal) := by + rw [←ENNReal.ofReal_add hδ.le hδ.le,←ENNReal.ofReal_natCast] + apply ENNReal.ofReal_lt_ofReal_iff (by positivity) |>.mpr + dsimp [δ] + have : (0:ℝ) < m := Nat.cast_pos.mpr hm + linarith + have hTS : (∑i,PolygonArea.area (T i))<∑i,PolygonArea.area (S i)ᶜ := by + by_contra hn + have hle := add_le_add hS.le ((le_of_not_gt hn).trans hT.le) + rw [htotal] at hle + exact (not_le_of_gt htwo) hle + obtain ⟨e,he⟩ := exists_into hTS + have hten : 10*(∑i,PolygonArea.area (T i))<∑_i : Fin m,PolygonArea.area (⊥ : polygonAlgebra a)ᶜ := by + calc + _≤10*ENNReal.ofReal δ := mul_le_mul le_rfl hT.le (by positivity) (by positivity) + _<(m:ENNReal) := by + rw [←ENNReal.ofReal_ofNat 10,←ENNReal.ofReal_mul (by norm_num : (0:ℝ)≤10),←ENNReal.ofReal_natCast] + apply ENNReal.ofReal_lt_ofReal_iff (by positivity) |>.mpr + dsimp [δ] + have : (0:ℝ) < m := Nat.cast_pos.mpr hm + linarith + _=_ := by simp [PolygonArea.area_top] + obtain ⟨c,hc,_⟩ := alternating_extension T (fun _ => ⊥) e + (fun _ => id) (fun _ => id) hten + let u : polygonFullGroup a m := a₀.val*f + let v : polygonFullGroup a m := c.val*(b₀.val*g)*c.val⁻¹ + have hvfix : ∀y : TrackPoint a m,y.2∈(S y.1).val → v.val y=y := by + intro y hy + have hpre : (c.val.val.symm y).2∉(T (c.val.val.symm y).1).val := by + intro hp + let p : (PolygonObject.mk m T).Point := ⟨c.val.val.symm y,hp⟩ + have hcp : e p=y := by rw [←hc p]; exact c.val.val.apply_symm_apply y + have hi := he p + rw [hcp] at hi + exact hi hy + change c.val.val ((b₀.val*g).val (c.val.val.symm y))=y + rw [hg _ hpre] + exact c.val.val.apply_symm_apply y + refine ⟨u,v,⟨a₀,rfl⟩,⟨b₀,c,rfl⟩,?_⟩ + have hh : Commute v.val u.val := supported_fixer_commute hvfix hf + exact Subtype.ext hh.symm.eq + +end PolygonObject.BankEmbedding + +local instance polygonFullNormal (a m : ℕ) : (polygonAlternatingGroup a m).Normal := + polygonAlternatingGroup_normal a m + +theorem polygonFullGroup_quotient_commutative (a m : ℕ) (hm : 0 < m) : + IsMulCommutative (polygonFullGroup a m ⧸ polygonAlternatingGroup a m) := by + let q := QuotientGroup.mk' (polygonAlternatingGroup a m) + refine ⟨⟨?_⟩⟩ + intro x y + obtain ⟨f,rfl⟩ := QuotientGroup.mk'_surjective (polygonAlternatingGroup a m) x + obtain ⟨g,rfl⟩ := QuotientGroup.mk'_surjective (polygonAlternatingGroup a m) y + obtain ⟨u,v,⟨a₀,rfl⟩,⟨b₀,c,rfl⟩,hc⟩ := PolygonObject.BankEmbedding.commuting_representatives hm f g + have ha : q a₀.val=1 := (QuotientGroup.eq_one_iff a₀.val).mpr a₀.property + have hb : q b₀.val=1 := (QuotientGroup.eq_one_iff b₀.val).mpr b₀.property + have hcc : q c.val=1 := (QuotientGroup.eq_one_iff c.val).mpr c.property + have hh := hc.map q + simpa only [map_mul,map_inv,ha,hb,hcc,one_mul,mul_one,inv_one] using hh.eq + +theorem polygonFullGroup_commutator_eq (a m : ℕ) (hm : 5 ≤ m) : + _root_.commutator (polygonFullGroup a m)=polygonAlternatingGroup a m := by + apply le_antisymm + · exact Subgroup.Normal.quotient_commutative_iff_commutator_le.mp + (polygonFullGroup_quotient_commutative a m (by omega)) + · have hp := Subgroup.isPerfect_iff.mp (polygonAlternatingGroup_perfect a m hm) + rw [←hp] + exact Subgroup.commutator_mono le_top le_top + +end PolygonCommutingRepresentatives + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/PrimitiveCentralLaws.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/PrimitiveCentralLaws.lean new file mode 100644 index 0000000000000000000000000000000000000000..c6941990369c225608035e70d099234752effdac --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/PrimitiveCentralLaws.lean @@ -0,0 +1,179 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.FinitePrimitiveResolution +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.FinePatchAtlas +import OAI.GroupTheory.SimpleAmenable.CentralCovers.PrimitiveGlobalTemplates + +namespace OAI + +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +section PrimitiveCentralLaws +namespace InitialCoverSystem.PatchAtlas +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} {B : InitialCoverSystem a r m hm M} + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] (A : B.PatchAtlas) + +theorem primitive_full_central {ι : Type} [Finite ι] + (ha : 0 ?_⟩ + obtain ⟨A⟩ := hL M hM B + intro ι hι P I b hb + exact A.toPatchAtlas.primitive_family_law_all ha hlarge hr P A.far_mesh I b hb + +end PrimitiveCentralLaws + +theorem polygon_family_primitive_resolution {a : ℕ} {ι : Type} [Finite ι] + (r : CutRing) (hr : 0 (spatialTranslate p.val.2 (initialTest a r p.val.1)).val) (V i).val := by + classical + let _ := Fintype.ofFinite ι + choose S hS using fun i => polygon_finite_primitive_resolution r hr (V i) + refine ⟨Finset.univ.biUnion S,fun i x y he => hS i x y ?_⟩ + intro p + exact he ⟨p.val,Finset.mem_biUnion.mpr ⟨i,Finset.mem_univ i,p.property⟩⟩ + +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + +def AllPrimitiveLaws : Prop := + ∀ (ι : Type) [Finite ι] (P : ι → Fin 5 × (CutRing × CutRing)) + (I : Finset (Fin (m+1))) (b : Fin (m+1)) (hb : b ∉ I), B.PrimitiveFamilyLaw I b hb P + +variable (hlarge : 15 < m+1) (h : B.AllPrimitiveLaws) + +theorem fullGeometricSector_independent {ι κ : Type} [Finite ι] [Finite κ] + (P : ι → Fin 5 × (CutRing × CutRing)) (Q : κ → Fin 5 × (CutRing × CutRing)) + (V : polygonAlgebra a) + (hV : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) P i).val) V.val) + (hV' : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) Q i).val) V.val) : + B.fullGeometricSector hlarge P (fun I _ b hb => h ι P I b hb) V = + B.fullGeometricSector hlarge Q (fun I _ b hb => h κ Q I b hb) V := by + let R : ι ⊕ κ → Fin 5 × (CutRing × CutRing) := Sum.elim P Q + rw [B.fullGeometricSector_subfamily hlarge R P Sum.inl rfl + (fun I _ b hb => h _ R I b hb) _ V hV, + B.fullGeometricSector_subfamily hlarge R Q Sum.inr rfl + (fun I _ b hb => h _ R I b hb) _ V hV'] + +noncomputable def polygonStar (hr : 0 p.val) (fun I _ b hb => h S (fun p => p.val) I b hb) V + +theorem polygonStar_eq (hr : 0 (primitiveTests (a := a) (r := r) P i).val) V.val) : + B.polygonStar hlarge h hr V = B.fullGeometricSector hlarge P (fun I _ b hb => h ι P I b hb) V := by + apply B.fullGeometricSector_independent hlarge h _ P V _ hV + exact (polygon_finite_primitive_resolution r hr V).choose_spec + +theorem polygonStar_projection (hr : 0 if b then W else V + obtain ⟨S,hS⟩ := polygon_family_primitive_resolution r hr R + have hV := hS false + have hW := hS true + change ResolvedBy _ V.val at hV + change ResolvedBy _ W.val at hW + rw [B.polygonStar_eq hlarge h hr (fun p : S => p.val) V hV, + B.polygonStar_eq hlarge h hr (fun p : S => p.val) W hW] + exact B.fullGeometricSector_commute hlarge _ _ V W hV hd s t + +theorem polygonStar_union (hr : 0 if b then W else V + obtain ⟨S,hS⟩ := polygon_family_primitive_resolution r hr R + have hV := hS false + have hW := hS true + change ResolvedBy _ V.val at hV + change ResolvedBy _ W.val at hW + have hU : ResolvedBy (fun p : S => (spatialTranslate p.val.2 (initialTest a r p.val.1)).val) + (V ⊔ W).val := fun x y he => or_congr (hV x y he) (hW x y he) + rw [B.polygonStar_eq hlarge h hr (fun p : S => p.val) (V ⊔ W) hU, + B.polygonStar_eq hlarge h hr (fun p : S => p.val) V hV, + B.polygonStar_eq hlarge h hr (fun p : S => p.val) W hW] + exact B.fullGeometricSector_union hlarge _ _ V W hV hd s + +theorem polygonStars_finite_central (hr : 0 p.val) + (fun I _ b hb => h S (fun p => p.val) I b hb)).mono + apply iSup_le + intro i + rw [B.polygonStar_eq hlarge h hr (fun p : S => p.val) (V i) (hS i)] + rintro x ⟨s,rfl⟩ + exact B.fullGeometricSector_mem hlarge _ _ (V i) s + +end InitialCoverSystem + +end SimpleAmenable + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/PrimitiveChartActions.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/PrimitiveChartActions.lean new file mode 100644 index 0000000000000000000000000000000000000000..f2627adf150fa2c9979884d139ac4fb7e29c0e61 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/PrimitiveChartActions.lean @@ -0,0 +1,83 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.RectangularAtlas +import OAI.GroupTheory.SimpleAmenable.CentralCovers.GridFormalPatching + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section PrimitiveChartActions +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) {ι κ : Type*} [Finite ι] [Finite κ] + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + +theorem primitive_coordinate_action (hlarge : 20 ≤ m+1) + (g : ∀ n, B.CoordinateWindowLaw n) + (P : ι → Fin 5 × (CutRing × CutRing)) (Q : κ → Fin 5 × (CutRing × CutRing)) + (h : ∀ I, I.card≤15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb P) + (h' : ∀ I, I.card≤15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb Q) + (i : ι) (i' : κ) (j j' : Fin 2) (u u' : CutRing × CutRing) + (hp : P i=(coordinateTestIndex j,u)) (hp' : Q i'=(coordinateTestIndex j',u')) + (V V' W : polygonAlgebra a) + (hV : ResolvedBy (fun _ : Unit => (spatialTranslate u (coordinatePrimitive a j)).val) V.val) + (hV' : ResolvedBy (fun _ : Unit => (spatialTranslate u' (coordinatePrimitive a j')).val) V'.val) + (n : ℕ) (q : Fin 2 → ℤ) + (hW : ResolvedBy (fun s => (primitiveTests (a := a) (r := r) + (coordinateWindowPrimitives n q) s).val) W.val) + (heq : V ⊓ W=V' ⊓ W) + (f : TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm)) + (hf : B.AlignedSmallSupported f) + (hc : SmallControlled B.c f (B.windowSector (by omega) n (g n) q W)) + (I : ControlAlphabet (Fin (m+1))) (s : UniversalExtension (alternatingGroup I.val)) : + ∀ x ∈ f.range, + B.fullGeometricSector (by omega) P h V (universalMap (subtypeAlternatingHom I.val) s)*x* + (B.fullGeometricSector (by omega) P h V (universalMap (subtypeAlternatingHom I.val) s))⁻¹ = + B.fullGeometricSector (by omega) Q h' V' (universalMap (subtypeAlternatingHom I.val) s)*x* + (B.fullGeometricSector (by omega) Q h' V' (universalMap (subtypeAlternatingHom I.val) s))⁻¹ := by + let S : Unit → Fin 5 × (CutRing × CutRing) := fun _ => (coordinateTestIndex j,u) + let T : Unit → Fin 5 × (CutRing × CutRing) := fun _ => (coordinateTestIndex j',u') + have hs := fun I (_ : I.card≤15) b hb => B.coordinateFamilyLaw_all g (fun _ : Unit => j) (fun _ => u) I b hb + have ht := fun I (_ : I.card≤15) b hb => B.coordinateFamilyLaw_all g (fun _ : Unit => j') (fun _ => u') I b hb + have h₀ := B.fullGeometricSector_shared_primitive (by omega) P S i () hp h hs V + (by simpa only [primitiveTests,primitiveFamilyTests,hp,initialTest_coordinate] using hV) + have h₁ := B.fullGeometricSector_shared_primitive (by omega) Q T i' () hp' h' ht V' + (by simpa only [primitiveTests,primitiveFamilyTests,hp',initialTest_coordinate] using hV') + rw [h₀,h₁] + exact B.coordinate_charts_action hlarge g (fun _ : Unit => j) (fun _ => u) + (fun _ : Unit => j') (fun _ => u') V V' W + (by simpa only [primitiveTests,primitiveFamilyTests,initialTest_coordinate] using hV) + (by simpa only [primitiveTests,primitiveFamilyTests,initialTest_coordinate] using hV') + n q hW heq f hf hc I s + +namespace RectangularAtlas +variable {B} (A : B.RectangularAtlas) + +theorem slope_chart_eq (hlarge : 15 < m+1) + (P : ι → Fin 5 × (CutRing × CutRing)) + (h : ∀ I, I.card≤15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb P) + (i : ι) (d : Fin 2) (z : CutRing × CutRing) (hp : P i=(slopeTestIndex d,z)) : + A.slope hlarge d z=B.fullGeometricSector hlarge P h + (spatialTranslate z (clippedSlopePrimitive a r (slopeDirection d))) := by + unfold slope tangentSign + simp only [↓reduceIte] + apply B.fullGeometricSector_shared_primitive hlarge _ P (Sum.inl (0:Fin 2)) i + · simpa only [translatedTemplate,tangentChartTemplate,ite_true,add_zero] using hp.symm + · intro x y he + have hh := he () + simpa only [primitiveTests,primitiveFamilyTests,translatedTemplate,tangentChartTemplate, + ite_true,add_zero,initialTest_slope] using hh + +end RectangularAtlas +end InitialCoverSystem +end PrimitiveChartActions + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/PrimitiveCopies.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/PrimitiveCopies.lean new file mode 100644 index 0000000000000000000000000000000000000000..434c7b58bf0c0cf97ac3156eec81ffb2d3cdeb8e --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/PrimitiveCopies.lean @@ -0,0 +1,108 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Configurations.ReserveAtom +import OAI.GroupTheory.SimpleAmenable.CentralCovers.InitialCoverSystem + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section PrimitiveCopies + +namespace InitialCoverSystem + +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + +noncomputable def initialConditional (j : Fin 5) : + alternatingGroup (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm) := + B.initialTable.comp (polygonTableInput (initialTest a r) j) + +@[simp] theorem initialConditional_input (j : Fin 5) + (s : alternatingGroup (Fin (m+1))) (hs : s.val.support.card ≤ 5) : + B.initialConditional j s = PresentedGroup.of (sourceConditionalLabel m (j,⟨s.val,s.property,hs⟩)) := + B.initialTable_input (j,⟨s.val,s.property,hs⟩) + +theorem initialConditional_projection (j : Fin 5) : + (coverMap M (alternatingGenerator a r m hm)).comp (B.initialConditional j) = + conditionalAlternatingHom (initialTest a r j) := by + rw [initialConditional,← MonoidHom.comp_assoc,B.initialTable_projection] + apply MonoidHom.ext + intro s + exact actualPolygonTableHom_input (initialTest a r) j s + +theorem initialConditional_zero : B.initialConditional 0 = B.c := + B.initialTable_constant + +noncomputable def initialAlphabet (I : Finset (Fin (m+1))) (j : Fin 5) : + alternatingGroup I →* BoundedRelationCover M (alternatingGenerator a r m hm) := + (B.initialConditional j).comp (subtypeAlternatingHom I) + +theorem initialAlphabet_aligned (I : Finset (Fin (m+1))) (j : Fin 5) + (s : alternatingGroup I) : + B.initialAlphabet I j s ∈ sourceAlignedGroup a r m hm M B.t I := by + have hle : Subgroup.closure {g : alternatingGroup I | Equiv.Perm.IsThreeCycle g.val} ≤ + (sourceAlignedGroup a r m hm M B.t I).comap (B.initialAlphabet I j) := by + apply (Subgroup.closure_le _).mpr + intro g hg + change B.initialConditional j (subtypeAlternatingHom I g) ∈ + sourceAlignedGroup a r m hm M B.t I + have hc : (subtypeAlternatingHom I g).val.support.card ≤ 5 := by + change (Equiv.Perm.ofSubtype g.val).support.card ≤ 5 + have hI : (Subtype.fintype (fun x : Fin (m+1) => x ∈ I)) = + (inferInstance : Fintype I) := Subsingleton.elim _ _ + rw [Equiv.Perm.support_ofSubtype, Finset.card_map, hI, hg.card_support] + decide + rw [B.initialConditional_input j _ hc] + exact alignedGroup_input _ _ _ + ((j,⟨(subtypeAlternatingHom I g).val,(subtypeAlternatingHom I g).property,hc⟩) : + SmallConditional m) + (Equiv.Perm.mem_range_ofSubtype_iff.mp ⟨g.val,rfl⟩) + rw [alternatingGroup.closure_isThreeCycles_eq_top] at hle + exact hle (Subgroup.mem_top s) + +noncomputable def translatedAlphabet (I : Finset (Fin (m+1))) (j : Fin 5) + (k : Multiplicative (FreeAbelianGroup (Fin m × Fin 2))) : + alternatingGroup I →* BoundedRelationCover M (alternatingGenerator a r m hm) := + (MulAut.conj (B.t k)).toMonoidHom.comp (B.initialAlphabet I j) + +theorem translatedAlphabet_aligned (I : Finset (Fin (m+1))) (j : Fin 5) + (k : Multiplicative (FreeAbelianGroup (Fin m × Fin 2))) (s : alternatingGroup I) : + B.translatedAlphabet I j k s ∈ sourceAlignedGroup a r m hm M B.t I := + alignedGroup_conjugate _ _ _ k (B.initialAlphabet_aligned I j s) + +theorem initialAlphabet_orbit_independent (I : Finset (Fin (m+1))) (j : Fin 5) + (k l : Multiplicative (FreeAbelianGroup (Fin m × Fin 2))) + (hkl : ∀ s : alternatingGroup I, + sourceLatticeMap a r m hm k * conditionalAlternatingHom (initialTest a r j) + (subtypeAlternatingHom I s) * (sourceLatticeMap a r m hm k)⁻¹ = + sourceLatticeMap a r m hm l * conditionalAlternatingHom (initialTest a r j) + (subtypeAlternatingHom I s) * (sourceLatticeMap a r m hm l)⁻¹) : + B.translatedAlphabet I j k = B.translatedAlphabet I j l := by + apply MonoidHom.eq_of_eqOn_dense alternatingGroup.closure_isThreeCycles_eq_top + intro s hs + have hc : (subtypeAlternatingHom I s).val.support.card ≤ 5 := by + change (Equiv.Perm.ofSubtype s.val).support.card ≤ 5 + have hI : (Subtype.fintype (fun x : Fin (m+1) => x ∈ I)) = + (inferInstance : Fintype I) := Subsingleton.elim _ _ + rw [Equiv.Perm.support_ofSubtype, Finset.card_map, hI, hs.card_support] + decide + change B.t k * B.initialConditional j (subtypeAlternatingHom I s) * (B.t k)⁻¹ = + B.t l * B.initialConditional j (subtypeAlternatingHom I s) * (B.t l)⁻¹ + rw [B.initialConditional_input j _ hc] + exact lifted_translation_orbit_independent (sourceLatticeMap a r m hm) B.t + (alternatingGenerator a r m hm (sourceConditionalLabel m + (j,⟨(subtypeAlternatingHom I s).val,(subtypeAlternatingHom I s).property,hc⟩))) + _ (B.t_stabilizers _) k l (hkl s) + +end InitialCoverSystem +end PrimitiveCopies + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/PrimitiveFormalSectors.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/PrimitiveFormalSectors.lean new file mode 100644 index 0000000000000000000000000000000000000000..af08dca61212708f2b25172dfa369e835b3ecf09 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/PrimitiveFormalSectors.lean @@ -0,0 +1,197 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.StarProjection +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.ConcurrentGeometry +import OAI.GroupTheory.SimpleAmenable.Configurations.FormalSectorProjection +import OAI.GroupTheory.SimpleAmenable.CentralCovers.FormalLaws + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section PrimitiveFormalSectors +namespace InitialCoverSystem.PatchAtlas +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + {B : InitialCoverSystem a r m hm M} + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] (A : B.PatchAtlas) + {ι κ : Type*} [Finite ι] [Finite κ] + +omit [Finite ι] in +theorem starFamily_projection (hlarge : 15 < m+1) (P : ι → Fin 5 × (CutRing × CutRing)) + (i : Option ι) : + (coverMap M (alternatingGenerator a r m hm)).comp (A.starFamily hlarge P i)= + (conditionalAlternatingHom (match i with + | none => wholePolygon a + | some i => primitiveTests (a := a) (r := r) P i)).comp (universalProjection _) := by + cases i with + | none => exact congrArg (fun f => f.comp (universalProjection _)) B.c_projection + | some i => + apply B.fullGeometricSector_projection + have he : spatialTranslate (P i).2 (initialTest a r (P i).1)= + primitiveTests (a := a) (r := r) + (translatedTemplate (initialPatchPrimitives r A.geometry.mesh) (P i).2) (Sum.inl (P i).1) := by + simp [primitiveTests,primitiveFamilyTests,translatedTemplate,initialPatchPrimitives] + rw [he] + exact resolved_test _ _ + +theorem formalSector_projection (hlarge : 15 < m+1) + (P : ι → Fin 5 × (CutRing × CutRing)) + (T : FormalStarTable (A.starFamily hlarge P)) + (V : Set (ι → Bool)) (s : TrackStar (Fin (m+1))) : + coverMap M (alternatingGenerator a r m hm) (T.sector V s)= + formalPolygonTable (primitiveTests (a := a) (r := r) P) + (sectorMask V (universalProjection _ s)) := by + apply T.sector_projection (by simp only [Nat.card_fin]; omega) + (coverMap M (alternatingGenerator a r m hm)) (actualPolygonTableHom _) + (actualPolygonTableHom_injective _) + (assignmentPullback (fun σ : Set.range (polygonAssignment (primitiveTests (a := a) (r := r) P)) => σ.val)) + (assignmentPullback_surjective _ Subtype.val_injective) + intro i + rw [A.starFamily_projection] + ext t : 1 + cases i with + | none => exact (formalPolygonTable_whole _ _).symm + | some i => exact (formalPolygonTable_test (primitiveTests (a := a) (r := r) P) i (universalProjection _ t)).symm + +theorem formalSector_subfamily_eq (hlarge : 15 < m+1) + (P : ι → Fin 5 × (CutRing × CutRing)) + (T : FormalStarTable (A.starFamily hlarge P)) (v : κ → ι) + (h : ∀ I, I.card≤15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb (P ∘ v)) + (U : Set (κ → Bool)) (V : polygonAlgebra a) + (hV : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) (P ∘ v) i).val) V.val) + (hUV : ∀ x, polygonAssignment (primitiveTests (a := a) (r := r) (P ∘ v)) x ∈ U ↔ x ∈ V.val) : + T.sector ((fun σ : ι → Bool => σ ∘ v) ⁻¹' U)= + B.fullGeometricSector hlarge (P ∘ v) h V := by + apply (B.fullPrimitiveFamily_central hlarge (P ∘ v) h).lift_unique + (coverMap M (alternatingGenerator a r m hm)) + (smallFamilyEval (B.smallPrimitiveInputs hlarge (P ∘ v))).range + · have hh := T.sector_subfamily_range v U + have he : (fun i : Option κ => A.starFamily hlarge P (i.map v))= + A.starFamily hlarge (P ∘ v) := by + funext i; cases i <;> rfl + rw [he,star_small_range_eq (by simpa using (by omega : 5 ≤ m+1)) _ _ + (A.starFamily_small hlarge (P ∘ v))] at hh + exact hh + · rintro x ⟨s,rfl⟩ + exact (B.fullPrimitiveTable hlarge (P ∘ v) h).sector_mem _ s + · rw [B.fullGeometricSector_projection hlarge (P ∘ v) h V hV] + apply MonoidHom.ext + intro s + rw [MonoidHom.comp_apply,A.formalSector_projection] + apply Subtype.ext + apply Subtype.ext + apply Equiv.ext + intro p + change (actualPolygonTableHom _ _).val.val p = _ + rw [actualPolygonTableHom_apply] + change ((sectorMask ((fun σ : ι → Bool => σ ∘ v) ⁻¹' U) (universalProjection _ s) + (polygonAssignment (primitiveTests (a := a) (r := r) P) p.2)).val p.1,p.2)= + conditionalPerm V (universalProjection _ s).val p + rw [conditionalPerm_apply] + have he : polygonAssignment (primitiveTests (a := a) (r := r) P) p.2 ∘ v= + polygonAssignment (primitiveTests (a := a) (r := r) (P ∘ v)) p.2 := rfl + have hp : polygonAssignment (primitiveTests (a := a) (r := r) P) p.2 ∈ + ((fun σ : ι → Bool => σ ∘ v) ⁻¹' U) ↔ p.2 ∈ V.val := by + change _ ∘ v ∈ U ↔ _ + rw [he] + exact hUV p.2 + by_cases hx : p.2 ∈ V.val + · rw [sectorMask_of_mem _ _ _ (hp.mpr hx),ite_eq_left hx] + · rw [sectorMask_of_not_mem _ _ _ (fun h => hx (hp.mp h)),ite_eq_right hx] + rfl + +end InitialCoverSystem.PatchAtlas +end PrimitiveFormalSectors + +section FormalRectangleSplits + +theorem resolvedPartitionSelector {a : ℕ} {ι D : Type*} [Nonempty D] + (R : ι → polygonAlgebra a) (W : D → polygonAlgebra a) + (hW : ∀ d, ResolvedBy (fun i => (R i).val) (W d).val) + (hcover : ∀ x, ∃ d, x ∈ (W d).val) + (hdisjoint : Pairwise fun d e => Disjoint (W d).val (W e).val) : + ∃ χ : (ι → Bool) → D, ∀ x d, χ (polygonAssignment R x)=d ↔ x ∈ (W d).val := by + classical + let C (σ : ι → Bool) (d : D) := ∃ x, polygonAssignment R x=σ ∧ x ∈ (W d).val + let χ (σ : ι → Bool) : D := if h : ∃ d, C σ d then h.choose else Classical.choice inferInstance + refine ⟨χ,?_⟩ + intro x d + have hc : ∃ d, C (polygonAssignment R x) d := by + obtain ⟨e,he⟩ := hcover x + exact ⟨e,x,rfl,he⟩ + have hm : x ∈ (W (χ (polygonAssignment R x))).val := by + have hh : C (polygonAssignment R x) (χ (polygonAssignment R x)) := by + dsimp only [χ] + rw [dite_eq_left hc] + exact hc.choose_spec + obtain ⟨y,hy,hm⟩ := hh + exact (hW _ y x ((polygonAssignment_eq_iff R y x).mp hy)).mp hm + constructor + · intro he + rwa [← he] + · intro hd + by_contra he + exact Set.disjoint_left.mp (hdisjoint he) hm hd + +namespace FormalStarTable +variable {α ι κ H : Type*} [Fintype α] [DecidableEq α] [Group H] + [Group.IsPerfect (alternatingGroup α)] {F : Option ι → TrackStar α →* H} + (T : FormalStarTable F) + +theorem sector_empty : T.sector ∅=1 := by + ext s + change (centralSector T.model ∅ s).val=1 + rw [centralSector_empty] + rfl + +theorem sector_range_le_biUnion (W : κ → Set (ι → Bool)) (S : Finset κ) + (hd : Pairwise fun i j => Disjoint (W i) (W j)) (K : Subgroup H) + (hK : ∀ i ∈ S, (T.sector (W i)).range ≤ K) : + (T.sector (⋃ i ∈ S, W i)).range ≤ K := by + classical + induction S using Finset.induction_on with + | empty => simp [T.sector_empty] + | @insert i S hi ih => + have hdis : Disjoint (W i) (⋃ j ∈ S, W j) := by + apply Set.disjoint_iUnion_right.mpr + intro j + apply Set.disjoint_iUnion_right.mpr + intro hj + exact hd (by intro he; subst j; exact hi hj) + have he : (⋃ j ∈ insert i S, W j)=W i ∪ ⋃ j ∈ S, W j := by + ext x + simp only [Set.mem_iUnion,Finset.mem_insert,Set.mem_union] + constructor + · rintro ⟨j,(rfl|hj),hx⟩ + · exact Or.inl hx + · exact Or.inr ⟨j,hj,hx⟩ + · rintro (hx|⟨j,hj,hx⟩) + · exact ⟨i,Or.inl rfl,hx⟩ + · exact ⟨j,Or.inr hj,hx⟩ + rw [he] + rintro x ⟨s,rfl⟩ + rw [T.sector_union hdis] + exact K.mul_mem (hK i (Finset.mem_insert_self i S) ⟨s,rfl⟩) + (ih (fun j hj => hK j (Finset.mem_insert_of_mem hj)) ⟨s,rfl⟩) + +theorem sector_range_le_partition [Fintype κ] (W : κ → Set (ι → Bool)) (V : Set (ι → Bool)) + (hd : Pairwise fun i j => Disjoint (W i) (W j)) + (hc : ∀ σ, σ ∈ V ↔ ∃ i, σ ∈ W i) : + (T.sector V).range ≤ ⨆ i, (T.sector (W i)).range := by + have he : V=⋃ i ∈ (Finset.univ : Finset κ), W i := by + ext σ + simpa only [Set.mem_iUnion,Finset.mem_univ,exists_true_left] using hc σ + rw [he] + exact T.sector_range_le_biUnion W Finset.univ hd _ (fun i _ => le_iSup (fun j => (T.sector (W j)).range) i) + +end FormalStarTable +end FormalRectangleSplits + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/PrimitiveGeometricGeneration.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/PrimitiveGeometricGeneration.lean new file mode 100644 index 0000000000000000000000000000000000000000..d293fea4595bfcecaada468d910c442e76a4858a --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/PrimitiveGeometricGeneration.lean @@ -0,0 +1,253 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Configurations.TrackTranslationChart +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.Supported + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section PrimitiveGeometricGeneration + +theorem cutForm_sub (a : ℕ) (j : Fin 4) (p q : ℝ × ℝ) : + cutForm a j (p-q) = cutForm a j p - cutForm a j q := by + fin_cases j <;> simp [cutForm] <;> ring + +private theorem fract_small_lift {r x : ℝ} (hr : 0 < r ∧ r < 1/2) + (hx : -r < x ∧ x < r) : ∃ k : Fin 2, Int.fract x = x + k.val := by + by_cases hx0 : 0 ≤ x + · refine ⟨0,?_⟩ + simp only [Fin.val_zero,Nat.cast_zero,add_zero] + exact Int.fract_eq_self.mpr ⟨hx0,by linarith⟩ + · refine ⟨1,?_⟩ + have hf : ⌊x⌋ = (-1 : ℤ) := Int.floor_eq_iff.mpr (by constructor <;> norm_num <;> linarith) + simp [Int.fract,hf] + +private theorem fract_small_lift_unique {r x : ℝ} (hr : 0 < r ∧ r < 1/2) + (hx : -r < x ∧ x < r) (k : Fin 2) + (hk : -r ≤ Int.fract x - k.val ∧ Int.fract x - k.val < r) : + Int.fract x - k.val = x := by + obtain ⟨j,hj⟩ := fract_small_lift hr hx + fin_cases j <;> fin_cases k <;> + simp only [Nat.cast_zero,Nat.cast_one,add_zero,sub_zero] at hj hk ⊢ <;> + linarith + +theorem mem_circularBoxPiece {a : ℕ} (r : CutRing) (k : Fin 2 × Fin 2) + (p : GenericSquare a) : p ∈ (circularBoxPiece a r k).val ↔ + (-ordinary r ≤ p.val.1-k.1.val ∧ p.val.1-k.1.val < ordinary r) ∧ + (-ordinary r ≤ p.val.2-k.2.val ∧ p.val.2-k.2.val < ordinary r) := by + simp only [circularBoxPiece,Set.mem_inter_iff,Set.mem_compl_iff,halfPlane, + Set.mem_ofPred_eq,not_lt,cutForm,Matrix.cons_val_zero,Matrix.cons_val_one, + map_add,map_neg,map_natCast] + constructor <;> rintro ⟨⟨h1,h2⟩,⟨h3,h4⟩⟩ <;> constructor <;> constructor <;> linarith + +theorem mem_clippedSlope_lift {a : ℕ} (r : CutRing) (j : Fin 4) + (hr : 0 < ordinary r ∧ ordinary r < 1/2) (p : GenericSquare a) (t : ℝ × ℝ) + (ht : (-ordinary r < t.1 ∧ t.1 < ordinary r) ∧ + (-ordinary r < t.2 ∧ t.2 < ordinary r)) + (hp : p.val = (Int.fract t.1,Int.fract t.2)) : + p ∈ (clippedSlopePrimitive a r j).val ↔ 0 ≤ cutForm a j t := by + classical + have hform (k : Fin 2 × Fin 2) + (hk : (p.val.1-k.1.val,p.val.2-k.2.val) = t) : + cutForm a j p.val - ordinary (integralCutForm a j (k.1.val,k.2.val)) = + cutForm a j t := by + rw [← cutForm_ordinary,← cutForm_sub] + simpa only [map_natCast,Prod.sub_def] using congrArg (cutForm a j) hk + constructor + · intro h + obtain ⟨k,hk,hside⟩ := Set.mem_iUnion.mp h + have hb := (mem_circularBoxPiece r k p).mp hk + have he : (p.val.1-k.1.val,p.val.2-k.2.val) = t := by + apply Prod.ext + · simpa only [hp] using fract_small_lift_unique hr ht.1 k.1 (by simpa only [hp] using hb.1) + · simpa only [hp] using fract_small_lift_unique hr ht.2 k.2 (by simpa only [hp] using hb.2) + have hs : ordinary (integralCutForm a j (k.1.val,k.2.val)) ≤ cutForm a j p.val := not_lt.mp hside + linarith [hform k he] + · intro h + obtain ⟨kx,hx⟩ := fract_small_lift hr ht.1 + obtain ⟨ky,hy⟩ := fract_small_lift hr ht.2 + let k : Fin 2 × Fin 2 := (kx,ky) + have he : (p.val.1-k.1.val,p.val.2-k.2.val) = t := by + simp [hp,k,hx,hy] + apply Set.mem_iUnion.mpr + refine ⟨k,(mem_circularBoxPiece r k p).mpr ?_,?_⟩ + · have h1 : p.val.1-k.1.val = t.1 := congrArg Prod.fst he + have h2 : p.val.2-k.2.val = t.2 := congrArg Prod.snd he + constructor <;> constructor <;> linarith [ht.1.1,ht.1.2,ht.2.1,ht.2.2] + · change ¬cutForm a j p.val < ordinary (integralCutForm a j (k.1.val,k.2.val)) + linarith [hform k he] + +theorem translated_clippedSlope_local {a : ℕ} (r : CutRing) (j : Fin 4) + (hr : 0 < ordinary r ∧ ordinary r < 1/2) (u : CutRing × CutRing) + (p : GenericSquare a) + (hp : (-ordinary r < p.val.1-ordinary u.1 ∧ p.val.1-ordinary u.1 < ordinary r) ∧ + (-ordinary r < p.val.2-ordinary u.2 ∧ p.val.2-ordinary u.2 < ordinary r)) : + translate a (-u) p ∈ (clippedSlopePrimitive a r j).val ↔ + ordinary (integralCutForm a j u) ≤ cutForm a j p.val := by + rw [mem_clippedSlope_lift r j hr (translate a (-u) p) + (p.val - (ordinary u.1,ordinary u.2)) hp (by simp [sub_eq_add_neg])] + rw [cutForm_sub,cutForm_ordinary] + exact sub_nonneg + +private theorem exists_cut_parameter (f : ℝ → ℝ × ℝ) (hf : Continuous f) + (x : ℝ) {ε : ℝ} (hε : 0 < ε) : + ∃ u : CutRing, dist (f (ordinary u)) (f x) < ε := by + exact ordinary_denseRange.exists_mem_open (hf.isOpen_preimage _ Metric.isOpen_ball) + ⟨x,by simpa using hε⟩ + +theorem slope_line_anchor (a : ℕ) (j : Fin 4) (hj : j = 2 ∨ j = 3) + (z : CutRing) (p : ℝ × ℝ) (hp : cutForm a j p = ordinary z) + {ε : ℝ} (hε : 0 < ε) : + ∃ u : CutRing × CutRing, integralCutForm a j u = z ∧ + dist (ordinary u.1,ordinary u.2) p < ε := by + rcases hj with rfl | rfl + · let f : ℝ → ℝ × ℝ := fun x => (x,ordinary z + Real.goldenRatio^a*x) + have hf : Continuous f := continuous_id.prodMk (continuous_const.add (continuous_const.mul continuous_id)) + obtain ⟨u,hu⟩ := exists_cut_parameter f hf p.1 hε + have he : f p.1 = p := by + apply Prod.ext + · rfl + · change ordinary z + Real.goldenRatio^a*p.1 = p.2 + simp [cutForm] at hp + linarith + refine ⟨(u,z+cutTau^a*u),?_,?_⟩ + · simp [integralCutForm] + · simpa only [f,map_add,map_mul,map_pow,ordinary_cutTau,he] using hu + · let f : ℝ → ℝ × ℝ := fun y => (ordinary z + Real.goldenRatio^a*y,y) + have hf : Continuous f := (continuous_const.add (continuous_const.mul continuous_id)).prodMk continuous_id + obtain ⟨u,hu⟩ := exists_cut_parameter f hf p.2 hε + have he : f p.2 = p := by + apply Prod.ext + · change ordinary z + Real.goldenRatio^a*p.2 = p.1 + simp [cutForm] at hp + linarith + · rfl + refine ⟨(z+cutTau^a*u,u),?_,?_⟩ + · simp [integralCutForm] + · simpa only [f,map_add,map_mul,map_pow,ordinary_cutTau,he] using hu + +noncomputable def ordinaryBox (l h : CutRing × CutRing) : Set (ℝ × ℝ) := + Set.Ioo (ordinary l.1) (ordinary h.1) ×ˢ Set.Ioo (ordinary l.2) (ordinary h.2) + +noncomputable def genericBox (a : ℕ) (l h : CutRing × CutRing) : Set (GenericSquare a) := + Subtype.val ⁻¹' ordinaryBox l h + +theorem genericBox_eq {a : ℕ} (l h : CutRing × CutRing) : genericBox a l h = + ((halfPlane a 0 l.1)ᶜ ∩ halfPlane a 0 h.1) ∩ + ((halfPlane a 1 l.2)ᶜ ∩ halfPlane a 1 h.2) := by + ext p + have hx : p.val.1 ≠ ordinary l.1 := p.property.2.2 0 l.1 + have hy : p.val.2 ≠ ordinary l.2 := p.property.2.2 1 l.2 + simp only [genericBox,ordinaryBox, + Set.mem_inter_iff,Set.mem_compl_iff,halfPlane,Set.mem_ofPred_eq,cutForm, + Matrix.cons_val_zero,Matrix.cons_val_one,not_lt] + exact and_congr (and_congr (lt_iff_le_and_ne.trans (and_iff_left hx.symm)) Iff.rfl) + (and_congr (lt_iff_le_and_ne.trans (and_iff_left hy.symm)) Iff.rfl) + +theorem genericBox_mem {a : ℕ} (B : BooleanSubalgebra (Set (GenericSquare a))) + (hcoord : ∀ (j : Fin 2) z, halfPlane a (Fin.castLE (by omega) j) z ∈ B) + (l h : CutRing × CutRing) : genericBox a l h ∈ B := by + rw [genericBox_eq] + exact BooleanSubalgebra.inf_mem + (BooleanSubalgebra.inf_mem (BooleanSubalgebra.compl_mem (hcoord 0 l.1)) (hcoord 0 h.1)) + (BooleanSubalgebra.inf_mem (BooleanSubalgebra.compl_mem (hcoord 1 l.2)) (hcoord 1 h.2)) + +theorem exists_box_in_open {U : Set (ℝ × ℝ)} (hU : IsOpen U) + (p : ℝ × ℝ) (hp : p ∈ U) : + ∃ l h : CutRing × CutRing, p ∈ ordinaryBox l h ∧ ordinaryBox l h ⊆ U := by + obtain ⟨ε,hε,hball⟩ := Metric.isOpen_iff.mp hU p hp + obtain ⟨l₁,hl₁,hlp⟩ := exists_cut_between (show p.1-ε < p.1 by linarith) + obtain ⟨l₂,hl₂,hlq⟩ := exists_cut_between (show p.2-ε < p.2 by linarith) + obtain ⟨h₁,hph,hh₁⟩ := exists_cut_between (show p.1 < p.1+ε by linarith) + obtain ⟨h₂,hqh,hh₂⟩ := exists_cut_between (show p.2 < p.2+ε by linarith) + refine ⟨(l₁,l₂),(h₁,h₂),⟨⟨hlp,hph⟩,⟨hlq,hqh⟩⟩,?_⟩ + rintro q ⟨⟨hqx,hqx'⟩,⟨hqy,hqy'⟩⟩ + apply hball + change max (dist q.1 p.1) (dist q.2 p.2) < ε + rw [max_lt_iff,Real.dist_eq,Real.dist_eq,abs_lt,abs_lt] + constructor <;> constructor <;> linarith + +theorem halfPlane_locally_generated {a : ℕ} (r : CutRing) + (hr : 0 < ordinary r ∧ ordinary r < 1/2) + (B : BooleanSubalgebra (Set (GenericSquare a))) + (htrans : ∀ u U, U ∈ B → translate a u ⁻¹' U ∈ B) + (j : Fin 4) (hj : j = 2 ∨ j = 3) + (hprimitive : (clippedSlopePrimitive a r j).val ∈ B) + (z : CutRing) (p : ℝ × ℝ) : + ∃ l h : CutRing × CutRing, ∃ D : Set (GenericSquare a), + p ∈ ordinaryBox l h ∧ D ∈ B ∧ + ∀ q : GenericSquare a, q.val ∈ ordinaryBox l h → + (q ∈ halfPlane a j z ↔ q ∈ D) := by + rcases lt_trichotomy (cutForm a j p) (ordinary z) with hp | hp | hp + · obtain ⟨l,h,hl,hsub⟩ := exists_box_in_open + (isOpen_lt (cutForm_continuous a j) continuous_const) p hp + refine ⟨l,h,Set.univ,hl,BooleanSubalgebra.top_mem,?_⟩ + intro q hq + exact iff_true_intro (hsub hq) + · obtain ⟨u,hu,hup⟩ := slope_line_anchor a j hj z p hp hr.1 + have hpU : p ∈ {q : ℝ × ℝ | + (-ordinary r < q.1-ordinary u.1 ∧ q.1-ordinary u.1 < ordinary r) ∧ + (-ordinary r < q.2-ordinary u.2 ∧ q.2-ordinary u.2 < ordinary r)} := by + change max (dist (ordinary u.1) p.1) (dist (ordinary u.2) p.2) < ordinary r at hup + rw [max_lt_iff,Real.dist_eq,Real.dist_eq,abs_lt,abs_lt] at hup + exact ⟨⟨by linarith [hup.1.2],by linarith [hup.1.1]⟩, + ⟨by linarith [hup.2.2],by linarith [hup.2.1]⟩⟩ + have hU : IsOpen {q : ℝ × ℝ | + (-ordinary r < q.1-ordinary u.1 ∧ q.1-ordinary u.1 < ordinary r) ∧ + (-ordinary r < q.2-ordinary u.2 ∧ q.2-ordinary u.2 < ordinary r)} := + ((isOpen_lt continuous_const (continuous_fst.sub continuous_const)).inter + (isOpen_lt (continuous_fst.sub continuous_const) continuous_const)).inter + ((isOpen_lt continuous_const (continuous_snd.sub continuous_const)).inter + (isOpen_lt (continuous_snd.sub continuous_const) continuous_const)) + obtain ⟨l,h,hl,hsub⟩ := exists_box_in_open hU p hpU + refine ⟨l,h,(translate a (-u) ⁻¹' (clippedSlopePrimitive a r j).val)ᶜ,hl, + BooleanSubalgebra.compl_mem (htrans _ _ hprimitive),?_⟩ + intro q hq + change cutForm a j q.val < ordinary z ↔ ¬translate a (-u) q ∈ (clippedSlopePrimitive a r j).val + rw [translated_clippedSlope_local r j hr u q (hsub hq),hu,not_le] + · obtain ⟨l,h,hl,hsub⟩ := exists_box_in_open + (isOpen_lt continuous_const (cutForm_continuous a j)) p hp + refine ⟨l,h,∅,hl,BooleanSubalgebra.bot_mem,?_⟩ + intro q hq + change cutForm a j q.val < ordinary z ↔ False + exact iff_false_intro (not_lt.mpr (le_of_lt (hsub hq))) + +theorem slope_cuts_generated {a : ℕ} (r : CutRing) + (hr : 0 < ordinary r ∧ ordinary r < 1/2) + (B : BooleanSubalgebra (Set (GenericSquare a))) + (htrans : ∀ u U, U ∈ B → translate a u ⁻¹' U ∈ B) + (hcoord : ∀ (j : Fin 2) z, halfPlane a (Fin.castLE (by omega) j) z ∈ B) + (j : Fin 4) (hj : j = 2 ∨ j = 3) + (hprimitive : (clippedSlopePrimitive a r j).val ∈ B) (z : CutRing) : + halfPlane a j z ∈ B := by + classical + choose l h D hp hD he using halfPlane_locally_generated r hr B htrans j hj hprimitive z + have hK : IsCompact (Set.Icc (0 : ℝ) 1 ×ˢ Set.Icc (0 : ℝ) 1) := isCompact_Icc.prod isCompact_Icc + obtain ⟨s,hs⟩ := hK.elim_finite_subcover (fun p => ordinaryBox (l p) (h p)) + (fun _ => isOpen_Ioo.prod isOpen_Ioo) (by intro p _; exact Set.mem_iUnion.mpr ⟨p,hp p⟩) + have heq : halfPlane a j z = ⋃ p ∈ s, genericBox a (l p) (h p) ∩ D p := by + ext q + constructor + · intro hq + have hqK : q.val ∈ Set.Icc (0 : ℝ) 1 ×ˢ Set.Icc (0 : ℝ) 1 := + ⟨⟨q.property.1.1,q.property.1.2.le⟩,⟨q.property.2.1.1,q.property.2.1.2.le⟩⟩ + obtain ⟨p,hps,hqp⟩ := Set.mem_iUnion₂.mp (hs hqK) + exact Set.mem_iUnion₂.mpr ⟨p,hps,hqp,(he p q hqp).mp hq⟩ + · intro hq + obtain ⟨p,_,hqp,hqD⟩ := Set.mem_iUnion₂.mp hq + exact (he p q hqp).mpr hqD + rw [heq] + exact BooleanSubalgebra.biSup_mem s.finite_toSet (fun p _ => + BooleanSubalgebra.inf_mem (genericBox_mem B hcoord _ _) (hD p)) + +end PrimitiveGeometricGeneration + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/PrimitiveGermActions.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/PrimitiveGermActions.lean new file mode 100644 index 0000000000000000000000000000000000000000..8aa66c6a788a8188491b2d15f961d976e1f87031 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/PrimitiveGermActions.lean @@ -0,0 +1,178 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.CrossingCellActions +import OAI.GroupTheory.SimpleAmenable.Homology.FiniteCutResolution +import OAI.GroupTheory.SimpleAmenable.CentralCovers.RefinedClippedModels + +namespace OAI + +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +namespace InitialCoverSystem.PatchAtlas +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} {B : InitialCoverSystem a r m hm M} + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] (A : B.PatchAtlas) + +theorem primitive_germ_action_neighborhood {ι : Type*} [Finite ι] + (hlarge : 20 ≤ m+1) (hr : 0 halfPlane a (j i) (c i)) (spatialTranslate p.2 (initialTest a r p.1)).val) + (hmesh : (1+|ordinary (cutTau^a)|)*(200/(A.geometry.mesh:ℝ)) ordinary (e i)) → e 0=0 → e (Fin.last N)=1 → + (∀ i : Fin N, ordinary (e i.succ)-ordinary (e i.castSucc)<1) → + (∀ k, cutFraction (pointCoordinate G.oldOffset k-r) ∈ Set.range e) → + (∀ k, cutFraction (pointCoordinate G.oldOffset k+r) ∈ Set.range e) → + ∀ cell : Fin 2 → Fin N, + (∀ k, |ordinary (e (cell k).castSucc)-realCoordinate z k|<δ ∧ + |ordinary (e (cell k).succ)-realCoordinate z k|<δ) → + ∀ (n : ℕ) (q : Fin 2 → ℤ), + ResolvedBy (fun i => (primitiveTests (a := a) (r := r) + (coordinateWindowPrimitives n q) i).val) (refinedGridRectangle a N e cell).val → + ∀ initial : Fin 2 → Fin A.geometry.mesh, + refinedGridRectangle a N e cell ≤ spatialTranslate G.oldOffset + (windowRectangle a A.geometry.mesh (symmetricWindowStart r) initial) → + ∀ f : TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm), + B.AlignedSmallSupported f → + SmallControlled B.c f (B.windowSector (by omega) n (A.rectangles.rectangles n) q + (refinedGridRectangle a N e cell)) → + ∀ (I : ControlAlphabet (Fin (m+1))) (s : UniversalExtension (alternatingGroup I.val)), + ∀ x ∈ f.range, + A.primitiveStar (by omega) p (universalMap (subtypeAlternatingHom I.val) s)*x* + (A.primitiveStar (by omega) p (universalMap (subtypeAlternatingHom I.val) s))⁻¹ = + B.fullGeometricSector (by omega) (A.concurrentPrimitives T.vertex T.offset) (A.concurrentLaw T.vertex T.offset) + (T.polygons (fun _ : Unit => spatialTranslate p.2 (initialTest a r p.1)) ()) + (universalMap (subtypeAlternatingHom I.val) s)*x* + (B.fullGeometricSector (by omega) (A.concurrentPrimitives T.vertex T.offset) (A.concurrentLaw T.vertex T.offset) + (T.polygons (fun _ : Unit => spatialTranslate p.2 (initialTest a r p.1)) ()) + (universalMap (subtypeAlternatingHom I.val) s))⁻¹ := by + cases G with + | constant u => + obtain ⟨δ,hδ,hlocal⟩ := T.refined_cells_locally_decided hr + refine ⟨δ,hδ,?_⟩ + intro N e he hzero hlast hmesh' _ _ cell hnear n q hW _ _ f hf hc I s x hx + apply A.constant_model_action hlarge hr T hz₁ hz₂ u f hf ?_ I s x hx + exact A.coordinate_control_inward_gate hlarge T.vertex T.offset _ + (A.coordinate_inward_resolved T.vertex T.offset z) n q _ hW + (fun p hp => (hlocal N e he hzero hlast hmesh' cell hnear p hp).1) f hf hc + | coordinate d u G => + have hlo : j (idx false)=axisDirection d ∧ c (idx false)=G.lower := ⟨congrArg Prod.fst (hidx false),congrArg Prod.snd (hidx false)⟩ + have hhi : j (idx true)=axisDirection d ∧ c (idx true)=G.upper := ⟨congrArg Prod.fst (hidx true),congrArg Prod.snd (hidx true)⟩ + have hR' : ResolvedBy (fun i => halfPlane a (j i) (c i)) (spatialTranslate u (coordinatePrimitive a d)).val := by + simpa only [initialTest_coordinate] using hR + obtain ⟨O,hO,hz,hact⟩ := A.coordinate_model_action_neighborhood hlarge hr d u z G T hz₁ hz₂ + (idx false) (idx true) hlo hhi hR' + obtain ⟨δ,hδ,hball⟩ := Metric.isOpen_iff.mp hO z hz + refine ⟨δ,hδ,?_⟩ + intro N e he hzero hlast hmesh' _ _ cell hnear n q hW _ _ f hf hc I s x hx + simp only [initialTest_coordinate] + exact hact n q _ hW + (fun p hp => hball (refinedGridRectangle_point_near e he hzero hlast hmesh' cell z δ hnear p hp)) + f hf hc I s x hx + | slope d u G hbox => + have hlo (k : Fin 2) : j (idx (.inl (k,false)))=axisDirection k ∧ + c (idx (.inl (k,false)))=pointCoordinate G.offset k-r := ⟨congrArg Prod.fst (hidx (.inl (k,false))),congrArg Prod.snd (hidx (.inl (k,false)))⟩ + have hhi (k : Fin 2) : j (idx (.inl (k,true)))=axisDirection k ∧ + c (idx (.inl (k,true)))=pointCoordinate G.offset k+r := ⟨congrArg Prod.fst (hidx (.inl (k,true))),congrArg Prod.snd (hidx (.inl (k,true)))⟩ + have hs : j (idx (.inr ()))=slopeDirection d ∧ + c (idx (.inr ()))=integralCutForm a (slopeDirection d) G.offset := ⟨congrArg Prod.fst (hidx (.inr ())),congrArg Prod.snd (hidx (.inr ()))⟩ + have hR' : ResolvedBy (fun i => halfPlane a (j i) (c i)) + (spatialTranslate u (clippedSlopePrimitive a r (slopeDirection d))).val := by + simpa only [initialTest_slope] using hR + simpa only [PrimitiveGerm.oldOffset,initialTest_slope] using + A.refined_clipped_model_action_neighborhood hlarge hr d u z G hbox T hz₁ hz₂ + (fun k => idx (.inl (k,false))) (fun k => idx (.inl (k,true))) (idx (.inr ())) hlo hhi hs hR' hmesh + +theorem primitive_family_local_templates {ι : Type*} [Finite ι] + (ha : 0 ordinary (e i)) → e 0=0 → e (Fin.last N)=1 → + (∀ i : Fin N, ordinary (e i.succ)-ordinary (e i.castSucc)<1) → + (∀ i k, cutFraction (pointCoordinate (G i).oldOffset k-r) ∈ Set.range e) → + (∀ i k, cutFraction (pointCoordinate (G i).oldOffset k+r) ∈ Set.range e) → + ∀ cell : Fin 2 → Fin N, + (∀ k, |ordinary (e (cell k).castSucc)-realCoordinate z k|<δ ∧ + |ordinary (e (cell k).succ)-realCoordinate z k|<δ) → + ∀ (n : ℕ) (q : Fin 2 → ℤ), + ResolvedBy (fun i => (primitiveTests (a := a) (r := r) + (coordinateWindowPrimitives n q) i).val) (refinedGridRectangle a N e cell).val → + (∀ i, ∃ initial : Fin 2 → Fin A.geometry.mesh, + refinedGridRectangle a N e cell ≤ spatialTranslate (G i).oldOffset + (windowRectangle a A.geometry.mesh (symmetricWindowStart r) initial)) → + ∀ (J : Type) (f : J → TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm)), + (∀ v, B.AlignedSmallSupported (f v)) → + (∀ v, SmallControlled B.c (f v) (B.windowSector (by omega) n (A.rectangles.rectangles n) q + (refinedGridRectangle a N e cell))) → + ∃ L : B.LocalPatchTemplate (by omega) (A.starFamily (by omega) P) f, + ∀ x : GenericSquare a, x ∈ L.margin.val → + polygonAssignment L.predicates x ∈ Set.range (polygonAssignment (primitiveTests (a := a) (r := r) P)) := by + classical + let _ := Fintype.ofFinite ι + let G (i : ι) := Classical.choice (PrimitiveGerm.nonempty (a := a) (z := z) hr (P i)) + let R := primitiveTests (a := a) (r := r) P + let K := Σ i, (G i).Index + let dir : K → Fin 4 := fun v => ((G v.1).cuts v.2).1 + let cut : K → CutRing := fun v => ((G v.1).cuts v.2).2 + obtain ⟨S,hR,hS⟩ := finite_cut_resolution_extend R dir cut + let j : S → Fin 4 := fun p => p.val.1 + let c : S → CutRing := fun p => p.val.2 + obtain ⟨T⟩ := A.geometry.inwardChart_exists ha j c z + let idx (i : ι) (k : (G i).Index) : S := ⟨(G i).cuts k,hS ⟨i,k⟩⟩ + have hidx i k : (j (idx i k),c (idx i k))=(G i).cuts k := rfl + have hres i : ResolvedBy (fun s => halfPlane a (j s) (c s)) + (spatialTranslate (P i).2 (initialTest a r (P i).1)).val := hR i + have hact i := A.primitive_germ_action_neighborhood hlarge hr (P i) z (G i) T hz₁ hz₂ + (idx i) (hidx i) (hres i) hmesh + choose δ hδ hacts using hact + obtain ⟨δ₀,hδ₀,hinside⟩ := T.refined_cells_locally_decided hr + let radius : Option ι → ℝ := Option.elim' δ₀ δ + have hpositive (i : Option ι) : 0 exact hδ₀ + | some i => exact hδ i + obtain ⟨imin,_,hmin⟩ := Finset.univ.exists_min_image radius + (show (Finset.univ : Finset (Option ι)).Nonempty from Finset.univ_nonempty) + refine ⟨G,radius imin,hpositive imin,?_⟩ + intro N e he hzero hlast hmesh' hlends huends cell hnear n q hW hinitial J f hf hc + have hnear₀ k : |ordinary (e (cell k).castSucc)-realCoordinate z k|<δ₀ ∧ + |ordinary (e (cell k).succ)-realCoordinate z k|<δ₀ := by + have hm : radius imin≤δ₀ := hmin none (Finset.mem_univ none) + exact ⟨(hnear k).1.trans_le hm,(hnear k).2.trans_le hm⟩ + have hinc : refinedGridRectangle a N e cell ≤ A.geometry.inwardMargin T.vertex T.offset z := + fun p hp => (hinside N e he hzero hlast hmesh' cell hnear₀ p hp).1 + let L : B.LocalPatchTemplate (by omega) (A.starFamily (by omega) P) f := { + index := Fin 4 ⊕ (Fin 2 × Fin (A.geometry.window-1)) + tests := A.concurrentPrimitives T.vertex T.offset + lawful := A.concurrentLaw T.vertex T.offset + margin := A.geometry.inwardMargin T.vertex T.offset z + predicates := T.polygons R + margin_resolved := A.concurrent_inward_resolved T.vertex T.offset z + predicates_resolved := A.inward_model_resolved T R + controlled := fun v => A.coordinate_control_inward_gate hlarge T.vertex T.offset _ + (A.coordinate_inward_resolved T.vertex T.offset z) n q _ hW hinc (f v) (hf v) (hc v) + action := by + intro i I s v x hx + let I' : ControlAlphabet (Fin (m+1)) := ⟨I.val,by rw [I.property.2]; omega⟩ + have hneari k : |ordinary (e (cell k).castSucc)-realCoordinate z k|<δ i ∧ + |ordinary (e (cell k).succ)-realCoordinate z k|<δ i := by + have hm : radius imin≤δ i := hmin (some i) (Finset.mem_univ (some i)) + exact ⟨(hnear k).1.trans_le hm,(hnear k).2.trans_le hm⟩ + obtain ⟨initial,hi⟩ := hinitial i + exact hacts i N e he hzero hlast hmesh' (hlends i) (huends i) cell hneari n q hW + initial hi (f v) (hf v) (hc v) I' s x hx } + refine ⟨L,?_⟩ + intro x hx + obtain ⟨y,_,hy⟩ := T.polygons_assignment_realized hr hz₁ hz₂ R hR x hx Set.univ isOpen_univ (Set.mem_univ z) + exact ⟨y,hy⟩ + +end InitialCoverSystem.PatchAtlas + +end SimpleAmenable + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/PrimitiveGlobalTemplates.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/PrimitiveGlobalTemplates.lean new file mode 100644 index 0000000000000000000000000000000000000000..a538559344b6795cbb1c241c487baf652af43a92 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/PrimitiveGlobalTemplates.lean @@ -0,0 +1,212 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.ClosedLocalAssignments +import OAI.GroupTheory.SimpleAmenable.CentralCovers.FormalLaws +import OAI.GroupTheory.SimpleAmenable.CentralCovers.FormalGridPieces +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.RefinementNeighborhoods +import OAI.GroupTheory.SimpleAmenable.CentralCovers.PrimitiveGermActions + +namespace OAI + +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +namespace InitialCoverSystem.PatchAtlas +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} {B : InitialCoverSystem a r m hm M} + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] (A : B.PatchAtlas) + +theorem primitive_family_global_templates {ι : Type*} [Finite ι] + (ha : 0 ordinary (e i)) ∧ e 0=0 ∧ e (Fin.last N)=1 ∧ + (∀ i : Fin N, ordinary (e i.succ)-ordinary (e i.castSucc)<1) ∧ + ∃ n : ℕ, ∃ q : Fin 2 → ℤ, + (∀ cell : Fin 2 → Fin N, + ResolvedBy (fun i => (primitiveTests (a := a) (r := r) + (coordinateWindowPrimitives n q) i).val) (refinedGridRectangle a N e cell).val) ∧ + ∀ (cell : Fin 2 → Fin N) (J : Type) + (f : J → TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm)), + (∀ v, B.AlignedSmallSupported (f v)) → + (∀ v, SmallControlled B.c (f v) (B.windowSector (by omega) n (A.rectangles.rectangles n) q + (refinedGridRectangle a N e cell))) → + ∃ L : B.LocalPatchTemplate (by omega) (A.starFamily (by omega) P) f, + ∀ x : GenericSquare a, x ∈ L.margin.val → + polygonAssignment L.predicates x ∈ Set.range (polygonAssignment (primitiveTests (a := a) (r := r) P)) := by + classical + let _ := Fintype.ofFinite ι + let Z := {z : ℝ × ℝ // z ∈ Set.Icc (0:ℝ) 1 ×ˢ Set.Icc (0:ℝ) 1} + have hlocal (z : Z) := A.primitive_family_local_templates ha hlarge hr P z.val z.property.1 z.property.2 hmesh + choose G δ hδ htemplates using hlocal + let O : Z → Set (ℝ × ℝ) := fun z => Metric.ball z.val (δ z) + have hO z : IsOpen (O z) := Metric.isOpen_ball + have hcover : Set.Icc (0:ℝ) 1 ×ˢ Set.Icc (0:ℝ) 1 ⊆ ⋃ z, O z := by + intro z hz + exact Set.mem_iUnion.mpr ⟨⟨z,hz⟩,Metric.mem_ball_self (hδ ⟨z,hz⟩)⟩ + obtain ⟨s,hs⟩ := (isCompact_Icc.prod isCompact_Icc).elim_finite_subcover O hO hcover + have hcov : Set.Icc (0:ℝ) 1 ×ˢ Set.Icc (0:ℝ) 1 ⊆ ⋃ z : s, O z.val := by + intro x hx + obtain ⟨z,hz⟩ := Set.mem_iUnion.mp (hs hx) + obtain ⟨hz,hx⟩ := Set.mem_iUnion.mp hz + exact Set.mem_iUnion.mpr ⟨⟨z,hz⟩,hx⟩ + let S : Finset CutRing := Finset.univ.biUnion (fun z : s => Finset.univ.biUnion (fun i : ι => + Finset.univ.biUnion (fun k : Fin 2 => + {pointCoordinate (G z.val i).oldOffset k-r,pointCoordinate (G z.val i).oldOffset k+r}))) + have hSlo (z : s) (i : ι) (k : Fin 2) : pointCoordinate (G z.val i).oldOffset k-r ∈ S := by + simp only [S,Finset.mem_biUnion,Finset.mem_univ,true_and,Finset.mem_insert,Finset.mem_singleton] + exact ⟨z,i,k,Or.inl rfl⟩ + have hShi (z : s) (i : ι) (k : Fin 2) : pointCoordinate (G z.val i).oldOffset k+r ∈ S := by + simp only [S,Finset.mem_biUnion,Finset.mem_univ,true_and,Finset.mem_insert,Finset.mem_singleton] + exact ⟨z,i,k,Or.inr rfl⟩ + obtain ⟨N,hN,e,he,hzero,hlast,hfine,hends,hgrids,hboxes⟩ := compact_common_refining_grid S + (fun _ : s × ι => A.geometry.mesh) (fun _ => A.geometry.mesh_large) + (fun _ => symmetricWindowStart r) (fun k => (G k.1.val k.2).oldOffset) + (fun z : s => O z.val) (fun z => hO z.val) hcov (fun _ => 1) (fun _ => by norm_num) + obtain ⟨n,q,hW⟩ := refinedGridRectangle_resolved (a := a) r e + refine ⟨N,hN,e,he,hzero,hlast,hfine,n,q,hW,?_⟩ + intro cell J f hf hc + obtain ⟨z,hz,_⟩ := hboxes cell + have hnear := closedRefinedBox_endpoint_near e he cell z.val.val (δ z.val) hz + exact htemplates z.val N e he hzero hlast hfine + (fun i k => hends _ (hSlo z i k)) (fun i k => hends _ (hShi z i k)) + cell hnear n q (hW cell) + (fun i => refinedGridRectangle_subset_translated_window e he hzero hlast hfine cell + A.geometry.mesh A.geometry.mesh_large (symmetricWindowStart r) (G z.val i).oldOffset + (hgrids (z,i))) J f hf hc + +theorem primitiveStar_zero (hlarge : 15 < m+1) (u : CutRing × CutRing) : + A.primitiveStar hlarge (0,u)=B.c.comp (universalProjection _) := by + unfold primitiveStar + have hu : spatialTranslate u (initialTest a r 0)=wholePolygon a := by + apply Subtype.ext + ext p + simp [spatialTranslate,initialTest,wholePolygon] + rw [hu,B.fullGeometricSector_whole] + +theorem primitive_table_with_coordinates {κ : Type*} [Fintype κ] + (hlarge : 25 ≤ m+1) (hr : 0 rfl,T,Set.univ,?_⟩ + rw [T.sector_input none,A.primitiveStar_zero] + rfl + have hcoordinate (e : Fin 2) (w : CutRing × CutRing) : + ∃ Q : Option (Option κ) → Fin 5 × (CutRing × CutRing), + (∀ k, Q (some (some k))=(coordinateTestIndex (j k),v k)) ∧ + ∃ T : FormalStarTable (A.starFamily (by omega) Q), + ∃ U : Set (Option (Option κ) → Bool), T.sector U=A.primitiveStar (by omega) (coordinateTestIndex e,w) := by + let T := Classical.choice (hc 0 0 e w) + refine ⟨_,fun _ => rfl,T,{σ | σ (some none)=true},?_⟩ + exact T.sector_input (some (some none)) + have hslope (d : Fin 2) (u : CutRing × CutRing) : + ∃ Q : Option (Option κ) → Fin 5 × (CutRing × CutRing), + (∀ k, Q (some (some k))=(coordinateTestIndex (j k),v k)) ∧ + ∃ T : FormalStarTable (A.starFamily (by omega) Q), + ∃ U : Set (Option (Option κ) → Bool), T.sector U=A.primitiveStar (by omega) (slopeTestIndex d,u) := by + let T := Classical.choice (hc d u 0 0) + refine ⟨_,fun _ => rfl,T,{σ | σ none=true},?_⟩ + exact T.sector_input (some none) + rcases p with ⟨p,u⟩ + fin_cases p + · exact hconstant u + · exact hcoordinate 0 u + · exact hcoordinate 1 u + · exact hslope 0 u + · exact hslope 1 u + +theorem primitive_family_actual_global_law {ι : Type} [Finite ι] + (ha : 0 ⟨0,hN⟩⟩ + let κ := Fin 2 × Fin (n-1) + let W : D → polygonAlgebra a := refinedGridRectangle a N e + let Q₀ := coordinateWindowPrimitives n q + let P' : Option ι → Fin 5 × (CutRing × CutRing) := Option.elim' (0,0) P + have ht (i : Option ι) := A.primitive_table_with_coordinates hlarge hr ha (P' i) + (Prod.fst : κ → Fin 2) (fun k : κ => (Q₀ k).2) + choose Q hQ T U hU using ht + let F := fun i => A.starFamily (by omega) (Q i) + have hinput : formalGridInput F T U=A.starFamily (by omega) P := by + funext i + change (T i).sector (U i)=_ + rw [hU] + cases i with + | none => exact A.primitiveStar_zero (by omega) 0 + | some i => rfl + have hsub (i : Option ι) : Q i ∘ (fun k : κ => some (some k))=Q₀ := by + funext k + exact hQ i k + have hcoord (i : Option ι) : ∀ I, I.card ≤ 15 → ∀ b hb, + B.PrimitiveFamilyLaw I b hb (Q i ∘ (fun k : κ => some (some k))) := by + rw [hsub] + exact fun I _ b hb => A.rectangles.rectangles n I b hb q + have hmasks (i : Option ι) := A.formalRectangleMasks (by omega) (Q i) (T i) + (fun k : κ => some (some k)) (hcoord i) W + (by rw [hsub]; exact hW) + (refinedGridRectangle_cover hN e he hzero hlast hfine) + (refinedGridRectangle_disjoint e he hzero hlast hfine) + choose C hdis hcover hj' hk' hactual using hmasks + let j : D → TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm) := + fun d => B.windowSector (by omega) n (A.rectangles.rectangles n) q (W d) + let k : D → TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm) := + fun d => B.windowSector (by omega) n (A.rectangles.rectangles n) q (W d)ᶜ + have hj (i : Option ι) (d : D) : (T i).sector (C i d)=j d := by + rw [hj'] + simp only [hsub] + rfl + have hk (i : Option ι) (d : D) : (T i).sector (C i d)ᶜ=k d := by + rw [hk'] + simp only [hsub] + rfl + have hF (i : Option ι) (v) : B.AlignedSmallSupported (F i v) := + A.starFamily_supported (by omega) (Q i) v + have hc (i : Option ι) : F i none=B.c.comp (universalProjection _) := rfl + have hpieces (d : D) : ∀ i, B.AlignedSmallSupported (formalGridPiece F T U C d i) := + formalGridPiece_supported F T U C _ hF d + have hcontrols (d : D) : ∀ i, SmallControlled B.c (formalGridPiece F T U C d i) (j d) := + formalGridPiece_control F T U C B.c hc j hj d + have htemplates' (d : D) : ∃ L : B.LocalPatchTemplate (by omega) + (formalGridInput F T U) (formalGridPiece F T U C d), + ∀ x : GenericSquare a, x ∈ L.margin.val → + polygonAssignment L.predicates x ∈ Set.range (polygonAssignment (primitiveTests (a := a) (r := r) P)) := by + rw [hinput] + exact htemplates d (Option ι) (formalGridPiece F T U C d) (hpieces d) (hcontrols d) + choose L hreal using htemplates' + apply B.independent_actual_patching hlarge F T U C hF hc hdis hcover j k hj hk + (fun d => B.fullGeometricSector_supported (by omega) Q₀ _ (W d) (hW d)) + (fun d s t => B.fullGeometricSector_commute (by omega) Q₀ _ (W d) (W d)ᶜ + (hW d) disjoint_compl_right s t) ?_ (B.smallPrimitiveInputs (by omega) P) ?_ + (primitiveTests (a := a) (r := r) P) L hreal + · rw [hinput] + rfl + · intro I i + rw [hinput] + exact A.starFamily_small (by omega) P I i + +end InitialCoverSystem.PatchAtlas + +end SimpleAmenable + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/PrimitiveStarCoherence.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/PrimitiveStarCoherence.lean new file mode 100644 index 0000000000000000000000000000000000000000..a8c1664b4a51dfafec79495fdb87c252be2e34ec --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/PrimitiveStarCoherence.lean @@ -0,0 +1,75 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.IndividualGridSplits +import OAI.GroupTheory.SimpleAmenable.CentralCovers.CrossingCellActions +import OAI.GroupTheory.SimpleAmenable.CentralCovers.FormalLaws +import OAI.GroupTheory.SimpleAmenable.CentralCovers.InitialGridActions +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.InwardPlanarGerms + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section PrimitiveStarCoherence +namespace InitialCoverSystem.PatchAtlas +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + {B : InitialCoverSystem a r m hm M} + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] (A : B.PatchAtlas) + +theorem primitiveStar_eq_of_predicate (hlarge : 15 < m+1) (j : Fin 5) + (u v : CutRing × CutRing) + (he : spatialTranslate u (initialTest a r j)=spatialTranslate v (initialTest a r j)) : + A.primitiveStar hlarge (j,u)=A.primitiveStar hlarge (j,v) := by + unfold primitiveStar + rw [he] + apply B.fullGeometricSector_shared_test hlarge _ _ (Sum.inl j) (Sum.inl j) + · rfl + · simpa only [translatedTemplate,initialPatchPrimitives,Sum.elim_inl,add_zero] using he + · intro x y hh + have h := hh () + simpa only [primitiveTests,primitiveFamilyTests,translatedTemplate,initialPatchPrimitives, + Sum.elim_inl,add_zero,he] using h + +theorem primitiveStar_periodic (hlarge : 15 < m+1) (j : Fin 5) + (u : CutRing × CutRing) (k : Fin 2 → ℤ) : + A.primitiveStar hlarge (j,u+((k 0:CutRing),(k 1:CutRing)))= + A.primitiveStar hlarge (j,u) := by + apply A.primitiveStar_eq_of_predicate hlarge j + rw [spatialTranslate_add,spatialTranslate_integral] + +theorem concurrent_primitiveStar (hlarge : 15 < m+1) + (t : VertexType (commonVertexDenominator a)) (u : CutRing × CutRing) (j : Fin 4) : + B.fullGeometricSector hlarge (A.concurrentPrimitives t u) (A.concurrentLaw t u) + (A.geometry.positiveDecision t u j)= + A.primitiveStar hlarge (⟨j.val+1,by omega⟩,u+A.geometry.anchors t j) := by + unfold primitiveStar + apply B.fullGeometricSector_shared_test hlarge _ _ (Sum.inl j) + (Sum.inl ⟨j.val+1,by omega⟩) + · rfl + · simp only [concurrentPrimitives,translatedTemplate,Sum.elim_inl,initialPatchPrimitives,add_zero] + · intro x y hh + have h := hh () + simpa [primitiveTests,primitiveFamilyTests,concurrentPrimitives,translatedTemplate, + ConcurrentGeometry.positiveDecision,initialTest] using h + +theorem concurrent_slope (hlarge : 15 < m+1) + (t : VertexType (commonVertexDenominator a)) (u : CutRing × CutRing) (d : Fin 2) : + B.fullGeometricSector hlarge (A.concurrentPrimitives t u) (A.concurrentLaw t u) + (A.geometry.positiveDecision t u (slopeDirection d))= + A.rectangles.slope hlarge d (u+A.geometry.anchors t (slopeDirection d)) := by + have h := A.concurrent_primitiveStar hlarge t u (slopeDirection d) + have he : (⟨(slopeDirection d).val+1,by omega⟩:Fin 5)=slopeTestIndex d := rfl + rw [he,A.primitiveStar_slope] at h + exact h + +end InitialCoverSystem.PatchAtlas +end PrimitiveStarCoherence + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/PrimitiveTable.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/PrimitiveTable.lean new file mode 100644 index 0000000000000000000000000000000000000000..1a0fd98c9d2e668a10bb191da0563d5fed66e9f7 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/PrimitiveTable.lean @@ -0,0 +1,145 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.PrimitiveWords +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.Sectors + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section ActualPrimitiveTable + +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} {ι : Type*} [Finite ι] + +theorem subtypeAlternatingHom_injective {X : Type*} [Fintype X] [DecidableEq X] + (I : Finset X) : Function.Injective (subtypeAlternatingHom I) := by + intro s t h + apply Subtype.ext + exact Equiv.Perm.ofSubtype_injective (congrArg Subtype.val h) + +noncomputable def tableAlphabetHom (I : Finset (Fin (m+1))) {Ω : Type*} : + (Ω → alternatingGroup I) →* (Ω → alternatingGroup (Fin (m+1))) where + toFun s ω := subtypeAlternatingHom I (s ω) + map_one' := by funext ω; exact map_one _ + map_mul' s t := by funext ω; exact map_mul _ _ _ + +theorem tableAlphabetHom_injective (I : Finset (Fin (m+1))) {Ω : Type*} : + Function.Injective (tableAlphabetHom (Ω := Ω) I) := by + intro s t h + funext ω + exact subtypeAlternatingHom_injective I (congrFun h ω) + +noncomputable def actualAlphabetTableHom (I : Finset (Fin (m+1))) + (U : ι → polygonAlgebra a) : + (Set.range (polygonAssignment U) → alternatingGroup I) →* polygonAlternatingGroup a (m+1) := + (actualPolygonTableHom U).comp (tableAlphabetHom I) + +theorem actualAlphabetTableHom_injective (I : Finset (Fin (m+1))) + (U : ι → polygonAlgebra a) : Function.Injective (actualAlphabetTableHom I U) := + (actualPolygonTableHom_injective U).comp (tableAlphabetHom_injective I) + +noncomputable def actualTestMask (U : ι → polygonAlgebra a) (i : ι) : + Set (Set.range (polygonAssignment U)) := {ω | ω.val i = true} + +omit [Finite ι] in +theorem actualTestMask_separates (U : ι → polygonAlgebra a) + (ω ν : Set.range (polygonAssignment U)) + (h : ∀ i, ω ∈ actualTestMask U i ↔ ν ∈ actualTestMask U i) : ω = ν := by + apply Subtype.ext + funext i + apply Bool.eq_iff_iff.mpr + exact h i + +theorem tableAlphabetHom_mask (I : Finset (Fin (m+1))) {Ω : Type*} + (V : Set Ω) (s : alternatingGroup I) : + tableAlphabetHom I (sectorMask V s) = sectorMask V (subtypeAlternatingHom I s) := by + classical + funext ω + by_cases h : ω ∈ V <;> simp [tableAlphabetHom,sectorMask,h] + +theorem actualPolygonTableHom_whole (U : ι → polygonAlgebra a) + (s : alternatingGroup (Fin (m+1))) : + actualPolygonTableHom U (sectorMask Set.univ s) = + conditionalAlternatingHom (wholePolygon a) s := by + apply Subtype.ext + apply Subtype.ext + apply Equiv.ext + intro p + rw [actualPolygonTableHom_apply] + simp only [sectorMask_of_mem Set.univ s _ (Set.mem_univ _)] + change (s.val p.1,p.2) = conditionalPerm (wholePolygon a) s.val p + rw [conditionalPerm_apply] + simp only [wholePolygon,Set.mem_univ,ite_true] + +theorem actualAlphabetTableHom_masks (I : Finset (Fin (m+1))) + (U : ι → polygonAlgebra a) (i : Option ι) : + (actualAlphabetTableHom I U).comp (maskFamily (actualTestMask U) i) = + (conditionalAlternatingHom (match i with + | none => wholePolygon a + | some j => U j)).comp (subtypeAlternatingHom I) := by + apply MonoidHom.ext + intro s + cases i with + | none => + change actualPolygonTableHom U (tableAlphabetHom I (sectorMask Set.univ s)) = _ + rw [tableAlphabetHom_mask,actualPolygonTableHom_whole] + rfl + | some j => + change actualPolygonTableHom U (tableAlphabetHom I (sectorMask (actualTestMask U j) s)) = _ + rw [tableAlphabetHom_mask] + exact actualPolygonTableHom_input U j (subtypeAlternatingHom I s) + +namespace InitialCoverSystem + +variable (B : InitialCoverSystem a r m hm M) + +noncomputable def primitiveTests (P : ι → Fin 5 × (CutRing × CutRing)) : + ι → polygonAlgebra a := fun i => primitiveFamilyTests (r := r) P (some i) + +omit [Finite ι] in +theorem primitiveFamily_aligned (I : Finset (Fin (m+1))) + (b : Fin (m+1)) (hb : b ∉ I) (P : ι → Fin 5 × (CutRing × CutRing)) : + (copyFamilyEval (B.primitiveFamily I b hb P)).range ≤ + sourceAlignedGroup a r m hm M B.t I := by + rw [copyFamilyEval_range] + apply iSup_le + intro i s hs + obtain ⟨t,rfl⟩ := hs + cases i with + | none => exact B.initialAlphabet_aligned I 0 t + | some j => exact B.primitiveCopy_aligned I b hb (P j) t + +noncomputable def primitiveTable (I : Finset (Fin (m+1))) + [Group.IsPerfect (alternatingGroup I)] + (b : Fin (m+1)) (hb : b ∉ I) (P : ι → Fin 5 × (CutRing × CutRing)) + (h : B.PrimitiveFamilyLaw I b hb P) : + ActualLawfulTable (coverMap M (alternatingGenerator a r m hm)) + (actualAlphabetTableHom I (primitiveTests (a := a) (r := r) P)) := + actualFamilyTable (actualTestMask (primitiveTests (a := a) (r := r) P)) (B.primitiveFamily I b hb P) + (coverMap M (alternatingGenerator a r m hm)) (actualAlphabetTableHom I (primitiveTests (a := a) (r := r) P)) + (actualAlphabetTableHom_injective I (primitiveTests (a := a) (r := r) P)) + (fun i => by + rw [B.primitiveFamily_projection,actualAlphabetTableHom_masks] + cases i <;> rfl) + (actualTestMask_separates (primitiveTests (a := a) (r := r) P)) h + +theorem primitiveTable_sector_aligned (I : Finset (Fin (m+1))) + [Group.IsPerfect (alternatingGroup I)] + (b : Fin (m+1)) (hb : b ∉ I) (P : ι → Fin 5 × (CutRing × CutRing)) + (h : B.PrimitiveFamilyLaw I b hb P) + (V : Set (Set.range (polygonAssignment (primitiveTests (a := a) (r := r) P)))) + (s : UniversalExtension (alternatingGroup I)) : + (B.primitiveTable I b hb P h).sector V s ∈ sourceAlignedGroup a r m hm M B.t I := + B.primitiveFamily_aligned I b hb P ((B.primitiveTable I b hb P h).sector_mem V s) + +end InitialCoverSystem +end ActualPrimitiveTable + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/PrimitiveWords.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/PrimitiveWords.lean new file mode 100644 index 0000000000000000000000000000000000000000..e4c02ee09782745338453b315b82ae41178184eb --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/PrimitiveWords.lean @@ -0,0 +1,213 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.PrimitiveCopies +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.CommonTranslatedCopies +import OAI.GroupTheory.SimpleAmenable.Arithmetic.CompiledTranslations +import OAI.GroupTheory.SimpleAmenable.CentralCovers.ConditionalFamilyLaws + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section PrimitiveWords + +abbrev SmallAlt (m : ℕ) := {s : alternatingGroup (Fin (m+1)) // s.val.support.card ≤ 5} + +theorem smallAlt_free_surjective (m : ℕ) : + Function.Surjective (FreeGroup.lift (fun s : SmallAlt m => s.val)) := by + apply MonoidHom.range_eq_top.mp + rw [FreeGroup.range_lift_eq_closure] + apply top_unique + rw [← alternatingGroup.closure_isThreeCycles_eq_top] + apply Subgroup.closure_mono + intro s hs + exact ⟨⟨s,by rw [hs.card_support]; omega⟩,rfl⟩ + +noncomputable def smallAltWord {m : ℕ} (s : alternatingGroup (Fin (m+1))) : + FreeGroup (SmallAlt m) := (smallAlt_free_surjective m s).choose + +@[simp] theorem smallAltWord_eval {m : ℕ} (s : alternatingGroup (Fin (m+1))) : + FreeGroup.lift (fun t : SmallAlt m => t.val) (smallAltWord s) = s := + (smallAlt_free_surjective m s).choose_spec + +noncomputable def conditionalWord {m : ℕ} (j : Fin 5) + (s : alternatingGroup (Fin (m+1))) : FreeGroup (SourceGeneratorLabel m) := + FreeGroup.map (fun t : SmallAlt m => sourceConditionalLabel m + (j,⟨t.val.val,t.val.property,t.property⟩)) (smallAltWord s) + +theorem conditionalWord_eval {m : ℕ} {H : Type*} [Group H] + (f : SourceGeneratorLabel m → H) (h : alternatingGroup (Fin (m+1)) →* H) + (j : Fin 5) (hj : ∀ t : SmallAlt m, + f (sourceConditionalLabel m (j,⟨t.val.val,t.val.property,t.property⟩)) = h t.val) + (s : alternatingGroup (Fin (m+1))) : FreeGroup.lift f (conditionalWord j s) = h s := by + have he : (FreeGroup.lift f).comp (FreeGroup.map (fun t : SmallAlt m => + sourceConditionalLabel m (j,⟨t.val.val,t.val.property,t.property⟩))) = + h.comp (FreeGroup.lift (fun t : SmallAlt m => t.val)) := by + apply FreeGroup.ext_hom + intro t + simpa only [MonoidHom.comp_apply, FreeGroup.map.of,FreeGroup.lift_apply_of] using hj t + simpa only [MonoidHom.comp_apply,conditionalWord,smallAltWord_eval] using + DFunLike.congr_fun he (smallAltWord s) + +noncomputable def primitiveWord {a m : ℕ} {r : CutRing} {hm : 2 ≤ m} + (I : Finset (Fin (m+1))) (b : Fin (m+1)) (hb : b ∉ I) + (p : Fin 5 × (CutRing × CutRing)) (s : alternatingGroup I) : + FreeGroup (SourceGeneratorLabel m) := + let k := (commonFrame a r m hm I b hb p.2).k + latticeWord k * conditionalWord p.1 (subtypeAlternatingHom I s) * (latticeWord k)⁻¹ + +namespace InitialCoverSystem + +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + +theorem conditionalWord_mk (j : Fin 5) (s : alternatingGroup (Fin (m+1))) : + PresentedGroup.mk (shortRelations M (alternatingGenerator a r m hm)) (conditionalWord j s) = + B.initialConditional j s := by + have he : FreeGroup.lift (PresentedGroup.of : SourceGeneratorLabel m → + BoundedRelationCover M (alternatingGenerator a r m hm)) = + PresentedGroup.mk (shortRelations M (alternatingGenerator a r m hm)) := by + ext i + rfl + rw [← he] + exact conditionalWord_eval _ (B.initialConditional j) j + (fun t => (B.initialConditional_input j t.val t.property).symm) s + +theorem primitiveWord_mk (I : Finset (Fin (m+1))) (b : Fin (m+1)) (hb : b ∉ I) + (p : Fin 5 × (CutRing × CutRing)) (s : alternatingGroup I) : + PresentedGroup.mk (shortRelations M (alternatingGenerator a r m hm)) + (primitiveWord (a := a) (r := r) (hm := hm) I b hb p s) = B.primitiveCopy I b hb p s := by + simp only [primitiveWord,map_mul,map_inv,B.latticeWord_mk,B.conditionalWord_mk] + rfl + +end InitialCoverSystem + +theorem primitiveWord_eval {a m : ℕ} {r : CutRing} {hm : 2 ≤ m} + (I : Finset (Fin (m+1))) (b : Fin (m+1)) (hb : b ∉ I) + (p : Fin 5 × (CutRing × CutRing)) (s : alternatingGroup I) : + FreeGroup.lift (alternatingGenerator a r m hm) + (primitiveWord (a := a) (r := r) (hm := hm) I b hb p s) = + conditionalAlternatingHom (spatialTranslate p.2 (initialTest a r p.1)) + (subtypeAlternatingHom I s) := by + have ht : ∀ i, sourceLatticeMap a r m hm (Multiplicative.ofAdd (FreeAbelianGroup.of i)) = + alternatingGenerator a r m hm (sourceTranslationLabel m i) := by + intro i + exact commutingFamilyHom_of _ _ i + rw [primitiveWord,map_mul,map_mul,map_inv,latticeWord_eval _ _ ht] + rw [conditionalWord_eval _ (conditionalAlternatingHom (initialTest a r p.1)) p.1 + (fun _ => rfl)] + exact (commonFrame a r m hm I b hb p.2).conditional_projection _ s + +end PrimitiveWords + +section PrimitiveFamilyLaws + +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} {ι : Type*} + +noncomputable def primitiveFamilyTests (P : ι → Fin 5 × (CutRing × CutRing)) : + Option ι → polygonAlgebra a + | none => wholePolygon a + | some i => spatialTranslate (P i).2 (initialTest a r (P i).1) + +namespace InitialCoverSystem + +variable (B : InitialCoverSystem a r m hm M) + +noncomputable def primitiveFamily (I : Finset (Fin (m+1))) + (b : Fin (m+1)) (hb : b ∉ I) (P : ι → Fin 5 × (CutRing × CutRing)) : + Option ι → alternatingGroup I →* BoundedRelationCover M (alternatingGenerator a r m hm) + | none => B.initialAlphabet I 0 + | some i => B.primitiveCopy I b hb (P i) + +def PrimitiveFamilyLaw (I : Finset (Fin (m+1))) + (b : Fin (m+1)) (hb : b ∉ I) (P : ι → Fin 5 × (CutRing × CutRing)) : Prop := + CentralOn (coverMap M (alternatingGenerator a r m hm)) + (copyFamilyEval (B.primitiveFamily I b hb P)).range + +theorem primitiveFamily_projection (I : Finset (Fin (m+1))) + (b : Fin (m+1)) (hb : b ∉ I) (P : ι → Fin 5 × (CutRing × CutRing)) (i : Option ι) : + (coverMap M (alternatingGenerator a r m hm)).comp (B.primitiveFamily I b hb P i) = + (conditionalAlternatingHom (primitiveFamilyTests (a := a) (r := r) P i)).comp (subtypeAlternatingHom I) := by + cases i with + | none => + rw [primitiveFamily,initialAlphabet,← MonoidHom.comp_assoc, + B.initialConditional_projection] + rfl + | some i => exact B.primitiveCopy_projection I b hb (P i) + +end InitialCoverSystem + +noncomputable def primitiveFamilyWord (I : Finset (Fin (m+1))) + (b : Fin (m+1)) (hb : b ∉ I) (P : ι → Fin 5 × (CutRing × CutRing)) : + Option ι × alternatingGroup I → FreeGroup (SourceGeneratorLabel m) + | (none,s) => conditionalWord 0 (subtypeAlternatingHom I s) + | (some i,s) => primitiveWord (a := a) (r := r) (hm := hm) I b hb (P i) s + +theorem primitiveFamilyWord_eval (I : Finset (Fin (m+1))) + (b : Fin (m+1)) (hb : b ∉ I) (P : ι → Fin 5 × (CutRing × CutRing)) + (i : Option ι × alternatingGroup I) : + FreeGroup.lift (alternatingGenerator a r m hm) + (primitiveFamilyWord (a := a) (r := r) (hm := hm) I b hb P i) = + conditionalAlternatingHom (primitiveFamilyTests (a := a) (r := r) P i.1) (subtypeAlternatingHom I i.2) := by + rcases i with ⟨i,s⟩ + cases i with + | none => + exact conditionalWord_eval _ (conditionalAlternatingHom (initialTest a r 0)) 0 + (fun _ => rfl) _ + | some i => exact primitiveWord_eval I b hb (P i) s + +namespace InitialCoverSystem + +variable (B : InitialCoverSystem a r m hm M) + +theorem primitiveFamilyWord_mk (I : Finset (Fin (m+1))) + (b : Fin (m+1)) (hb : b ∉ I) (P : ι → Fin 5 × (CutRing × CutRing)) + (i : Option ι × alternatingGroup I) : + PresentedGroup.mk (shortRelations M (alternatingGenerator a r m hm)) + (primitiveFamilyWord (a := a) (r := r) (hm := hm) I b hb P i) = + B.primitiveFamily I b hb P i.1 i.2 := by + rcases i with ⟨i,s⟩ + cases i with + | none => exact B.conditionalWord_mk 0 (subtypeAlternatingHom I s) + | some i => exact B.primitiveWord_mk I b hb (P i) s + +end InitialCoverSystem + +theorem primitiveFamilyLaw_eventually [Finite ι] + (hr : 0 < ordinary r ∧ ordinary r < 1/2) (hm' : 15 ≤ m+1) + (I : Finset (Fin (m+1))) (b : Fin (m+1)) (hb : b ∉ I) + (P : ι → Fin 5 × (CutRing × CutRing)) : + ∃ L : ℕ, ∀ M : ℕ, L ≤ M → ∀ B : InitialCoverSystem a r m hm M, + B.PrimitiveFamilyLaw I b hb P := by + let U := primitiveFamilyTests (a := a) (r := r) P + let input : Option ι × alternatingGroup I → + (Set.range (polygonAssignment U) → alternatingGroup (Fin (m+1))) := + fun i => polygonTableInput U i.1 (subtypeAlternatingHom I i.2) + obtain ⟨L,hL⟩ := finite_table_with_inputs_eventually (alternatingGenerator a r m hm) + (actualPolygonTableHom U) input (primitiveFamilyWord (a := a) (r := r) (hm := hm) I b hb P) + (fun i => (primitiveFamilyWord_eval I b hb P i).trans + (actualPolygonTableHom_input U i.1 (subtypeAlternatingHom I i.2)).symm) + (alternatingGenerator_surjective a r m hr hm' hm) + refine ⟨L,fun M hM B => ?_⟩ + obtain ⟨ρ,hρ,hin⟩ := hL M hM + have hc : CentralOn (coverMap M (alternatingGenerator a r m hm)) ρ.range := by + apply centralOn_of_table + rw [hρ] + exact actualPolygonTableHom_injective U + apply hc.mono + rw [copyFamilyEval_range] + apply iSup_le + rintro i y ⟨s,rfl⟩ + refine ⟨input (i,s),?_⟩ + rw [hin,B.primitiveFamilyWord_mk] + +end PrimitiveFamilyLaws + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/PrivateBankFixer.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/PrivateBankFixer.lean new file mode 100644 index 0000000000000000000000000000000000000000..bf30b96f9c857af3bfe81a73e1a55c1a15ae8be2 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/PrivateBankFixer.lean @@ -0,0 +1,139 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.PrivateBankWord + +namespace OAI + +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +namespace InitialCoverSystem + +section +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + (hlarge : 15 < m+1) (h : B.AllPrimitiveLaws) (hr : 0 hb (bankColumn_subset e 1 hi)) u + (F.restrict (bankColumn_subset e 1)) V (universalMap (orderedTrackHom (bankColumn e 1)) s) + have hh := (hzw.inv_right.mul_right hc).mul_right hzw + rw [← he] at hh + have he' : w⁻¹*(w*B.distinctSlotStar hlarge h hr (bankColumn e 0) u + (F.restrict (bankColumn_subset e 0)) V s*w⁻¹)*w = + B.distinctSlotStar hlarge h hr (bankColumn e 0) u (F.restrict (bankColumn_subset e 0)) V s := by group + rwa [he'] at hh + +end + +section +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + +theorem sourceAlignedGroup_supported (J : Finset (Fin (m+1))) + (z : BoundedRelationCover M (alternatingGenerator a r m hm)) + (hz : z ∈ sourceAlignedGroup a r m hm M B.t J) : + SupportedIn (coverMap M (alternatingGenerator a r m hm) z).val.val + {p : TrackPoint a (m+1) | p.1 ∈ J} := by + classical + let q : BoundedRelationCover M (alternatingGenerator a r m hm) →* Equiv.Perm (TrackPoint a (m+1)) := + (polygonFullGroup a (m+1)).subtype.comp + ((polygonAlternatingGroup a (m+1)).subtype.comp (coverMap M (alternatingGenerator a r m hm))) + let K : Subgroup (BoundedRelationCover M (alternatingGenerator a r m hm)) := { + carrier := {z | SupportedIn (q z) {p : TrackPoint a (m+1) | p.1 ∈ J}} + one_mem' := by intro p hp; simp + mul_mem' := by + intro x y hx hy p hp + rw [map_mul,Equiv.Perm.mul_apply,hy p hp,hx p hp] + inv_mem' := by + intro x hx + change SupportedIn (q x⁻¹) _ + rw [map_inv] + exact supported_inv hx } + have hK : sourceAlignedGroup a r m hm M B.t J ≤ K := by + apply (Subgroup.closure_le _).mpr + rintro _ ⟨c,hc,k,rfl⟩ + change SupportedIn (q (B.t k * PresentedGroup.of (sourceConditionalLabel m c) * (B.t k)⁻¹)) _ + rw [map_mul,map_mul,map_inv] + obtain ⟨d,hd⟩ := sourceLatticeFullMap_translation a r m hm k + have ht : q (B.t k) = (trackTranslation (a:=a) d).val := by + have ht := congrArg Subtype.val (DFunLike.congr_fun B.t_projection k) + change (coverMap M (alternatingGenerator a r m hm) (B.t k)).val = + sourceLatticeFullMap a r m hm k at ht + exact congrArg Subtype.val (ht.trans hd) + rw [ht] + have hs : SupportedIn (q (PresentedGroup.of (sourceConditionalLabel m c))) + {p : TrackPoint a (m+1) | p.1 ∈ J} := by + intro p hp + have hf : c.2.val p.1=p.1 := Equiv.Perm.notMem_support.mp (fun hi => hp (hc hi)) + change (conditionalPerm (initialTest a r c.1) c.2.val) p=p + simp [conditionalPerm,hf] + apply (supported_conjugate (trackTranslation (a:=a) d).val hs).mono + rintro p ⟨⟨i,x⟩,hi,rfl⟩ + exact hi + exact hK hz + +end + +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + (hlarge : 15 < m+1) (h : B.AllPrimitiveLaws) (hr : 0 (primitiveTests (a := a) (r := r) + (coordinateWindowPrimitives n q) i).val) (coordinateRectangle a L V).val) + (f : TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm)) + (hf : B.AlignedSmallSupported f) + (hc : SmallControlled B.c f (B.windowSector (by omega) n (A.rectangles n) q (coordinateRectangle a L V))) + (I : ControlAlphabet (Fin (m+1))) (s : UniversalExtension (alternatingGroup I.val)) + (t : BoundedRelationCover M (alternatingGenerator a r m hm)) (ht : t ∈ f.range) : + A.slope (by omega) d z (universalMap (subtypeAlternatingHom I.val) s)*t* + (A.slope (by omega) d z (universalMap (subtypeAlternatingHom I.val) s))⁻¹ = + A.slope (by omega) d z' (universalMap (subtypeAlternatingHom I.val) s)*t* + (A.slope (by omega) d z' (universalMap (subtypeAlternatingHom I.val) s))⁻¹ := by + obtain ⟨w,rfl⟩ := slope_same_intercept a d z z' hline + obtain ⟨c,hc'⟩ := real_slope_parameter a d z x hx + exact B.tangent_line_slide hlarge hr A.rectangles A.k A.p A.u A.v A.inverse A.charts A.short + A.labels d z w L V hLV hz hz' c (by simpa only [← hc'] using hnear) n q hW f hf hc I s t ht + +end RectangularAtlas +end InitialCoverSystem + +theorem rectangularAtlas_eventually {a m : ℕ} {r : CutRing} {hm : 2 ≤ m} + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] (hlarge : 20 ≤ m+1) + (hr : 0 < ordinary r ∧ ordinary r < 1/2) + (hSlope : 8000 < ordinary (cutTau^a)) (hconj : |conjugate (cutTau^a)| < 1/1000) : + ∃ L : ℕ, ∀ M : ℕ, L ≤ M → ∀ B : InitialCoverSystem a r m hm M, + Nonempty B.RectangularAtlas := by + obtain ⟨s,u,v,hs,hsr,huv,hshort⟩ := exists_symmetric_short_chart a r hr.1 + obtain ⟨k,p,hp⟩ := exists_full_overlap_window a r u + obtain ⟨s₁,hs₁,hs₁'⟩ := exists_cut_between (by linarith : (0:ℝ) < ordinary r/8) + obtain ⟨L₁,hL₁⟩ := coordinate_all_eventually (hm := hm) hlarge hr hSlope hconj + obtain ⟨L₂,hL₂⟩ := tangentChartTables_eventually (hm := hm) hr (by omega) k p u + obtain ⟨L₃,hL₃⟩ := tangentChartTables_eventually (hm := hm) hr (by omega) + (symmetricWindowLength s₁) (symmetricWindowStart s₁) u + refine ⟨L₁+L₂+L₃,fun M hM B => ⟨⟨k,p,u,v,huv,?_,hp,hL₁ M (by omega) B,?_,s₁,hs₁,hs₁',?_⟩⟩⟩ + · nlinarith + · intro d e z I _ b hb + exact hL₂ M (by omega) B d e z I b hb + · intro d e z I _ b hb + exact hL₃ M (by omega) B d e z I b hb + +end RectangularAtlas + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/RefinedClippedModels.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/RefinedClippedModels.lean new file mode 100644 index 0000000000000000000000000000000000000000..d7cf699985647d58d536664ebb9209ed2dea9246 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/RefinedClippedModels.lean @@ -0,0 +1,204 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.FormalLaws +import OAI.GroupTheory.SimpleAmenable.CentralCovers.PhaseClippedModels +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.CoordinateModels +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.LocalClippedBoxFormula +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.RefinedLocalDecisions + +namespace OAI + +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +namespace InitialCoverSystem.PatchAtlas +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} {B : InitialCoverSystem a r m hm M} + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] (A : B.PatchAtlas) + +theorem refined_clipped_model_action_neighborhood {ι : Type*} [Finite ι] + (hlarge : 20 ≤ m+1) (hr : 0 halfPlane a (j i) (c i)) + (spatialTranslate u (clippedSlopePrimitive a r (slopeDirection d))).val) + (hmesh : (1+|ordinary (cutTau^a)|)*(200/(A.geometry.mesh:ℝ)) ordinary (e i)) → e 0=0 → e (Fin.last N)=1 → + (∀ i : Fin N, ordinary (e i.succ)-ordinary (e i.castSucc)<1) → + (∀ k, cutFraction (pointCoordinate G.offset k-r) ∈ Set.range e) → + (∀ k, cutFraction (pointCoordinate G.offset k+r) ∈ Set.range e) → + ∀ cell : Fin 2 → Fin N, + (∀ k, |ordinary (e (cell k).castSucc)-realCoordinate z k|<δ ∧ + |ordinary (e (cell k).succ)-realCoordinate z k|<δ) → + ∀ (n : ℕ) (q : Fin 2 → ℤ), + ResolvedBy (fun i => (primitiveTests (a := a) (r := r) + (coordinateWindowPrimitives n q) i).val) (refinedGridRectangle a N e cell).val → + ∀ initial : Fin 2 → Fin A.geometry.mesh, + refinedGridRectangle a N e cell ≤ spatialTranslate G.offset + (windowRectangle a A.geometry.mesh (symmetricWindowStart r) initial) → + ∀ f : TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm), + B.AlignedSmallSupported f → + SmallControlled B.c f (B.windowSector (by omega) n (A.rectangles.rectangles n) q + (refinedGridRectangle a N e cell)) → + ∀ (I : ControlAlphabet (Fin (m+1))) (s : UniversalExtension (alternatingGroup I.val)), + ∀ x ∈ f.range, + A.primitiveStar (by omega) (slopeTestIndex d,u) (universalMap (subtypeAlternatingHom I.val) s)*x* + (A.primitiveStar (by omega) (slopeTestIndex d,u) (universalMap (subtypeAlternatingHom I.val) s))⁻¹ = + B.fullGeometricSector (by omega) (A.concurrentPrimitives T.vertex T.offset) (A.concurrentLaw T.vertex T.offset) + (T.polygons (fun _ : Unit => spatialTranslate u (clippedSlopePrimitive a r (slopeDirection d))) ()) + (universalMap (subtypeAlternatingHom I.val) s)*x* + (B.fullGeometricSector (by omega) (A.concurrentPrimitives T.vertex T.offset) (A.concurrentLaw T.vertex T.offset) + (T.polygons (fun _ : Unit => spatialTranslate u (clippedSlopePrimitive a r (slopeDirection d))) ()) + (universalMap (subtypeAlternatingHom I.val) s))⁻¹ := by + obtain ⟨δ₀,hδ₀,hdecisions⟩ := T.refined_cells_locally_decided hr + obtain ⟨δ₁,hδ₁,hact⟩ := A.uniform_clipped_model_action_neighborhood hlarge hr d u z G hbox T hz₁ hz₂ + lo hi slope hlo hhi hs hR hmesh + refine ⟨min δ₀ δ₁,lt_min hδ₀ hδ₁,?_⟩ + intro N e he hzero hlast hmesh' hlor hhir cell hnear n q hW initial hinitial f hf hc I s x hx + have hnear₀ k := And.intro ((hnear k).1.trans_le (min_le_left δ₀ δ₁)) + ((hnear k).2.trans_le (min_le_left δ₀ δ₁)) + have hnear₁ k := And.intro ((hnear k).1.trans_le (min_le_right δ₀ δ₁)) + ((hnear k).2.trans_le (min_le_right δ₀ δ₁)) + have hlocal := hdecisions N e he hzero hlast hmesh' cell hnear₀ + let idx (k : Fin 2 × Bool) : ι := if k.2 then hi k.1 else lo k.1 + have hidx (k : Fin 2 × Bool) : j (idx k)=axisDirection k.1 ∧ c (idx k)=G.axialCut k := by + obtain ⟨k,b⟩ := k + cases b + · exact hlo k + · exact hhi k + have hends (k : Fin 2 × Bool) : cutFraction (G.axialCut k) ∈ Set.range e := by + obtain ⟨k,b⟩ := k + cases b + · exact hlor k + · exact hhir k + obtain ⟨σ,hgate⟩ := T.refined_coordinate_phase e he hzero hlast hmesh' cell Prod.fst G.axialCut idx hidx hends hlocal + obtain ⟨p,hp⟩ := refinedGridRectangle_nonempty e he hzero hlast hmesh' cell + apply hact σ (fun k => e (cell k).castSucc) (fun k => e (cell k).succ) + (fun k => (he (Fin.castSucc_lt_succ (i := cell k))).le) ?_ hnear₁ n q hW hgate initial hinitial p hp + (refinedGridRectangle_point_near e he hzero hlast hmesh' cell z δ₁ hnear₁ p hp) + ((refinedGridRectangle_mem e he hzero hlast hmesh' cell p).mp hp) f hf hc I s x hx + intro hσ + exact T.refined_interior_phase_bounds e he hzero hlast hmesh' cell G.offset lo hi hlo hhi hlor hhir σ hσ + hgate (fun p hp => (hlocal p hp).2) + +end InitialCoverSystem.PatchAtlas + +section PrimitiveGerms + +inductive PrimitiveGerm (a : ℕ) (r : CutRing) (z : ℝ × ℝ) : + Fin 5 × (CutRing × CutRing) → Type + | constant (u : CutRing × CutRing) : PrimitiveGerm a r z (0,u) + | coordinate (d : Fin 2) (u : CutRing × CutRing) (g : CoordinateGerm a d u z) : + PrimitiveGerm a r z (coordinateTestIndex d,u) + | slope (d : Fin 2) (u : CutRing × CutRing) + (g : ClippedGerm a r (slopeDirection d) u z) (box : g.BoxValid) : + PrimitiveGerm a r z (slopeTestIndex d,u) + +namespace PrimitiveGerm +variable {a : ℕ} {r : CutRing} {z : ℝ × ℝ} {p : Fin 5 × (CutRing × CutRing)} + +theorem nonempty (hr : 0 Unit + | .coordinate _ _ _ => Bool + | .slope _ _ _ _ => Sum (Fin 2 × Bool) Unit + +instance (G : PrimitiveGerm a r z p) : Finite G.Index := by + cases G <;> dsimp only [Index] <;> infer_instance + +noncomputable def cuts (G : PrimitiveGerm a r z p) : G.Index → Fin 4 × CutRing := by + cases G with + | constant u => exact fun _ => (0,0) + | coordinate d u g => exact fun b : Bool => (axisDirection d,if b then g.upper else g.lower) + | slope d u g box => + exact Sum.elim + (fun k : Fin 2 × Bool => (axisDirection k.1,if k.2 then pointCoordinate g.offset k.1+r else pointCoordinate g.offset k.1-r)) + (fun _ => (slopeDirection d,integralCutForm a (slopeDirection d) g.offset)) + +noncomputable def oldOffset : PrimitiveGerm a r z p → CutRing × CutRing + | .constant _ => 0 + | .coordinate _ _ _ => 0 + | .slope _ _ g _ => g.offset + +end PrimitiveGerm +end PrimitiveGerms + +namespace InitialCoverSystem.PatchAtlas +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} {B : InitialCoverSystem a r m hm M} + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] (A : B.PatchAtlas) + +theorem constant_model_action {ι : Type*} [Finite ι] + (hlarge : 20 ≤ m+1) (hr : 0 spatialTranslate u (initialTest a r 0)) ()) + (universalMap (subtypeAlternatingHom I.val) s)*x* + (B.fullGeometricSector (by omega) (A.concurrentPrimitives T.vertex T.offset) (A.concurrentLaw T.vertex T.offset) + (T.polygons (fun _ : Unit => spatialTranslate u (initialTest a r 0)) ()) + (universalMap (subtypeAlternatingHom I.val) s))⁻¹ := by + let R : Unit → polygonAlgebra a := fun _ => spatialTranslate u (initialTest a r 0) + have hR : R ()=wholePolygon a := by simp [R,initialTest] + have hresolve : ResolvedBy (fun i => halfPlane a (j i) (c i)) (R ()).val := by + rw [hR]; exact fun _ _ _ => Iff.rfl + have he : wholePolygon a ⊓ A.geometry.inwardMargin T.vertex T.offset z = + T.polygons R () ⊓ A.geometry.inwardMargin T.vertex T.offset z := by + apply Subtype.ext + ext p + change (True ∧ _) ↔ (_ ∧ _) + by_cases hp : p ∈ (A.geometry.inwardMargin T.vertex T.offset z).val + · obtain ⟨q,_,hh⟩ := T.polygons_assignment_realized hr hz₁ hz₂ R (fun _ => hresolve) + p hp Set.univ isOpen_univ (Set.mem_univ z) + have hval : p ∈ (T.polygons R ()).val := by + have hq : q ∈ (R ()).val := by rw [hR]; trivial + exact (show q ∈ (R ()).val ↔ p ∈ (T.polygons R ()).val by + simpa only [polygonAssignment,decide_eq_true_eq] using Bool.eq_iff_iff.mp (congrFun hh ())).mp hq + simp only [hp,hval] + · simp only [hp,and_false] + have hpstar : A.primitiveStar (by omega) (0,u)= + B.c.comp (universalProjection (alternatingGroup (Fin (m+1)))) := by + unfold primitiveStar + have hu : spatialTranslate u (initialTest a r 0)=wholePolygon a := hR + rw [hu,B.fullGeometricSector_whole] + rw [hpstar] + have hh := B.chart_action_transfer hlarge (A.concurrentPrimitives T.vertex T.offset) + (A.concurrentLaw T.vertex T.offset) (wholePolygon a) (T.polygons R ()) + (A.geometry.inwardMargin T.vertex T.offset z) (fun _ _ _ => Iff.rfl) + (A.inward_model_resolved T R ()) (A.concurrent_inward_resolved T.vertex T.offset z) he f hf hc I s x hx + rw [B.fullGeometricSector_whole] at hh + exact hh + +end InitialCoverSystem.PatchAtlas + +end SimpleAmenable + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/SectorDifferenceRange.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/SectorDifferenceRange.lean new file mode 100644 index 0000000000000000000000000000000000000000..41acea308b464e7286d650b22afdfa73807179c3 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/SectorDifferenceRange.lean @@ -0,0 +1,193 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.AxisAnchorFamily +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.ClippedIntervals + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section SectorDifferenceRange +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) {ι : Type*} [Finite ι] + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + +theorem fullGeometricSector_sdiff_range (hlarge : 15 < m+1) + (P : ι → Fin 5 × (CutRing × CutRing)) + (h : ∀ I, I.card ≤ 15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb P) + (V W : polygonAlgebra a) (hWV : W ≤ V) + (hW : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) P i).val) W.val) + (K : Subgroup (BoundedRelationCover M (alternatingGenerator a r m hm))) + (hV : (B.fullGeometricSector hlarge P h V).range ≤ K) + (hW' : (B.fullGeometricSector hlarge P h W).range ≤ K) : + (B.fullGeometricSector hlarge P h (V \ W)).range ≤ K := by + have he : W ⊔ (V \ W) = V := by + apply Subtype.ext + ext x + change (x ∈ W.val ∨ x ∈ V.val ∧ x ∉ W.val) ↔ x ∈ V.val + constructor + · rintro (hx|hx); exact hWV hx; exact hx.1 + · intro hx; by_cases hh : x ∈ W.val; exact Or.inl hh; exact Or.inr ⟨hx,hh⟩ + have hd : Disjoint W.val (V \ W).val := Set.disjoint_left.mpr (by rintro x hx ⟨_,h⟩; exact h hx) + rintro x ⟨s,rfl⟩ + have hh := B.fullGeometricSector_union hlarge P h W (V \ W) hW hd s + rw [he] at hh + have hm := K.mul_mem (K.inv_mem (hW' ⟨s,rfl⟩)) (hV ⟨s,rfl⟩) + rw [hh,inv_mul_cancel_left] at hm + exact hm + +end InitialCoverSystem +end SectorDifferenceRange + +section AnchorIntersectionRange +attribute [local instance] cutOrdinaryOrder +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + +theorem axisSector_anchor_intersection_range (hlarge : 15 < m+1) (n : ℕ) (g : B.CoordinateWindowLaw n) + (d : Fin 2) (k : ℕ) (hk : k ≤ n) (p : ℤ) (u v s t : CutRing) + (huv : ordinary u ≤ ordinary v) (hlen : ordinary v-ordinary u < 1) + (hu : p ≤ endpointLabel u ∧ endpointLabel u < p+k) + (hv : p ≤ endpointLabel v ∧ endpointLabel v < p+k) + (hs : p ≤ endpointLabel s ∧ endpointLabel s < p+k) + (ht : p ≤ endpointLabel t ∧ endpointLabel t < p+k) + (K : Subgroup (BoundedRelationCover M (alternatingGenerator a r m hm))) + (hU : (B.axisSector hlarge n g d k hk p (coordinateInterval a d u v)).range ≤ K) + (hS : (B.axisSector hlarge n g d k hk p + (coordinateInterval a d u (clippedLabel u v (endpointLabel s)))).range ≤ K) + (hT : (B.axisSector hlarge n g d k hk p + (coordinateInterval a d u (clippedLabel u v (endpointLabel t)))).range ≤ K) : + (B.axisSector hlarge n g d k hk p + (coordinateInterval a d u v ⊓ coordinateInterval a d s t)).range ≤ K := by + let S := coordinateInterval a d u (clippedLabel u v (endpointLabel s)) + let T := coordinateInterval a d u (clippedLabel u v (endpointLabel t)) + have hsl : p ≤ endpointLabel (clippedLabel u v (endpointLabel s)) ∧ + endpointLabel (clippedLabel u v (endpointLabel s)) < p+k := by + rcases clippedLabel_label u v (endpointLabel s) with h|h <;> rw [h] <;> assumption + have htl : p ≤ endpointLabel (clippedLabel u v (endpointLabel t)) ∧ + endpointLabel (clippedLabel u v (endpointLabel t)) < p+k := by + rcases clippedLabel_label u v (endpointLabel t) with h|h <;> rw [h] <;> assumption + have hSr := axisInterval_resolved (a := a) (r := r) d k p u _ hu hsl + have hTr := axisInterval_resolved (a := a) (r := r) d k p u _ hu htl + have hSb := clippedLabel_bounds u v (endpointLabel s) huv + have hTb := clippedLabel_bounds u v (endpointLabel t) huv + rw [coordinateInterval_anchor_formula d u v s t huv hlen] + split_ifs with h + · apply B.fullGeometricSector_sdiff_range hlarge _ _ T S ?_ hSr K hT hS + apply coordinateInterval_mono d _ _ _ _ le_rfl hSb.1 ?_ (by linarith) + exact min_le_min_left v h + · have hST : T ≤ S := by + apply coordinateInterval_mono d _ _ _ _ le_rfl hTb.1 ?_ (by linarith) + exact min_le_min_left v (le_of_not_ge h) + have hdiff : (B.axisSector hlarge n g d k hk p (S \ T)).range ≤ K := + B.fullGeometricSector_sdiff_range hlarge _ _ S T hST hTr K hS hT + apply B.fullGeometricSector_sdiff_range hlarge _ _ _ (S \ T) ?_ ?_ K hU hdiff + · exact (sdiff_le : S \ T ≤ S).trans (coordinateInterval_mono d _ _ _ _ le_rfl hSb.1 hSb.2 hlen) + · exact BooleanSubalgebra.sdiff_mem (L := resolvedAlgebra _) hSr hTr + +end InitialCoverSystem +end AnchorIntersectionRange + +section AnchorGeneration +namespace AxisAnchorFamily +variable {n l : ℕ} {q : ℤ} (A : AxisAnchorFamily n l q) +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + (hlarge : 15 < m+1) (g : B.CoordinateWindowLaw n) (d : Fin 2) + +noncomputable def prefixGroup : Subgroup (BoundedRelationCover M (alternatingGenerator a r m hm)) := + ⨆ i : Fin l, ⨆ j : Fin (A.count i+1), ((A.cuts i).prefixCopy B hlarge g d j.val).range + +theorem anchor_range_prefixGroup (i : Fin l) : + ((A.cuts i).anchorCopy B hlarge g d).range ≤ A.prefixGroup B hlarge g d := by + unfold prefixGroup + rw [← (A.cuts i).prefix_last B hlarge g d] + exact (le_iSup (fun j : Fin (A.count i+1) => ((A.cuts i).prefixCopy B hlarge g d j.val).range) + (Fin.last (A.count i))).trans (le_iSup (fun i : Fin l => ⨆ j : Fin (A.count i+1), + ((A.cuts i).prefixCopy B hlarge g d j.val).range) i) + +theorem interval_prefix_range (i : Fin l) (k : ℕ) (hk : k ≤ n) (p : ℤ) (v : CutRing) + (hu : p ≤ endpointLabel ((A.cuts i).cut 0) ∧ endpointLabel ((A.cuts i).cut 0) < p+k) + (hv : p ≤ endpointLabel v ∧ endpointLabel v < p+k) + (hcut : v ∈ Set.range (A.cuts i).cut) : + (B.axisSector hlarge n g d k hk p (coordinateInterval a d ((A.cuts i).cut 0) v)).range ≤ + A.prefixGroup B hlarge g d := by + unfold prefixGroup + obtain ⟨j,rfl⟩ := hcut + have he : B.axisSector hlarge n g d k hk p (coordinateInterval a d ((A.cuts i).cut 0) ((A.cuts i).cut j)) = + (A.cuts i).prefixCopy B hlarge g d j.val := by + simp only [AxisCutSequence.prefixCopy,AxisCutSequence.index_fin] + exact B.axisInterval_copy_eq hlarge n g d _ _ _ _ _ _ _ _ hu hv + ((A.cuts i).lower_label j) ((A.cuts i).cut_label j) + rw [he] + exact (le_iSup (fun j : Fin (A.count i+1) => ((A.cuts i).prefixCopy B hlarge g d j.val).range) j).trans + (le_iSup (fun i : Fin l => ⨆ j : Fin (A.count i+1), + ((A.cuts i).prefixCopy B hlarge g d j.val).range) i) + +theorem old_interval_range (hl : 201 ≤ l) (k : ℕ) (hk : k ≤ n) (p : ℤ) (s t : CutRing) + (hs : p ≤ endpointLabel s ∧ endpointLabel s < p+k) + (ht : p ≤ endpointLabel t ∧ endpointLabel t < p+k) + (hanchor : ∀ j : Fin (l+1), p ≤ endpointLabel (windowCut l q j) ∧ endpointLabel (windowCut l q j) < p+k) + (hcuts : ∀ i : Fin l, ∀ z ∈ ({s,t} : Finset CutRing), + clippedLabel ((A.cuts i).cut 0) ((A.cuts i).cut (Fin.last (A.count i))) (endpointLabel z) ∈ + Set.range (A.cuts i).cut) : + (B.axisSector hlarge n g d k hk p (coordinateInterval a d s t)).range ≤ A.prefixGroup B hlarge g d := by + classical + let f : Fin l → polygonAlgebra a := fun i => windowCell a d l q i ⊓ coordinateInterval a d s t + have hV := axisInterval_resolved (a := a) (r := r) d k p s t hs ht + have hW (i : Fin l) : ResolvedBy (fun j => (InitialCoverSystem.primitiveTests (a := a) (r := r) + (axisWindowPrimitives d k p) j).val) (f i).val := by + exact BooleanSubalgebra.inf_mem (L := resolvedAlgebra _) + (axisInterval_resolved d k p _ _ (hanchor i.castSucc) (hanchor i.succ)) hV + apply (B.fullGeometricSector_partition_range hlarge (axisWindowPrimitives d k p) + (fun I _ b hb => B.axisFamilyLaw n g d k hk p I b hb) _ f hW ?_ ?_).trans + · apply iSup_le + intro i + change (B.axisSector hlarge n g d k hk p (windowCell a d l q i ⊓ coordinateInterval a d s t)).range ≤ _ + have hlu := hanchor i.castSucc + have hlv := hanchor i.succ + rw [← A.lower i] at hlu + rw [← A.upper i] at hlv + change (B.axisSector hlarge n g d k hk p (coordinateInterval a d _ _ ⊓ _)).range ≤ _ + rw [← A.lower i,← A.upper i] + apply B.axisSector_anchor_intersection_range hlarge n g d k hk p _ _ s t + ((A.cuts i).ordered (Fin.last (A.count i))).1 (A.intervalLength hl i) hlu hlv hs ht + · have he : B.axisSector hlarge n g d k hk p + (coordinateInterval a d ((A.cuts i).cut 0) ((A.cuts i).cut (Fin.last (A.count i)))) = + (A.cuts i).anchorCopy B hlarge g d := by + exact B.axisInterval_copy_eq hlarge n g d _ _ _ _ _ _ _ _ hlu hlv + ((A.cuts i).lower_label 0) ((A.cuts i).upper_label 0) + rw [he] + exact A.anchor_range_prefixGroup B hlarge g d i + · apply A.interval_prefix_range B hlarge g d i k hk p _ hlu ?_ (hcuts i s (by simp)) + rcases clippedLabel_label ((A.cuts i).cut 0) ((A.cuts i).cut (Fin.last (A.count i))) (endpointLabel s) with h|h + · rw [h]; exact hlv + · rw [h]; exact hs + · apply A.interval_prefix_range B hlarge g d i k hk p _ hlu ?_ (hcuts i t (by simp)) + rcases clippedLabel_label ((A.cuts i).cut 0) ((A.cuts i).cut (Fin.last (A.count i))) (endpointLabel t) with h|h + · rw [h]; exact hlv + · rw [h]; exact ht + · intro i j hij + exact (windowCell_pairwise_disjoint d l hl q hij).mono Set.inter_subset_left Set.inter_subset_left + · intro x + constructor + · intro hx + obtain ⟨i,hi⟩ := windowCell_cover d l hl q x + exact ⟨i,hi,hx⟩ + · rintro ⟨i,hi⟩; exact hi.2 + +end AxisAnchorFamily +end AnchorGeneration + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/SelectedInwardActions.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/SelectedInwardActions.lean new file mode 100644 index 0000000000000000000000000000000000000000..cc827b3701f44603428b1161fcd78b3aa5098747 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/SelectedInwardActions.lean @@ -0,0 +1,92 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.ConcurrentGeometry +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.InactiveNeighborhoodActions + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section SelectedInwardActions +namespace InitialCoverSystem.PatchAtlas +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + {B : InitialCoverSystem a r m hm M} + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + (A : B.PatchAtlas) {ι : Type*} + +theorem selected_active_slope_actions + (hlarge : 20 ≤ m+1) (hr : 0 (primitiveTests (a := a) (r := r) + (coordinateWindowPrimitives n q) e).val) (coordinateRectangle a L V).val) + (f : TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm)) + (hf : B.AlignedSmallSupported f) + (hc : SmallControlled B.c f (B.windowSector (by omega) n (A.rectangles.rectangles n) q + (coordinateRectangle a L V))) + (I : ControlAlphabet (Fin (m+1))) (s : UniversalExtension (alternatingGroup I.val)) + (b : BoundedRelationCover M (alternatingGenerator a r m hm)) (hb : b ∈ f.range) : + A.rectangles.slope (by omega) d v (universalMap (subtypeAlternatingHom I.val) s)*b* + (A.rectangles.slope (by omega) d v (universalMap (subtypeAlternatingHom I.val) s))⁻¹ = + A.rectangles.slope (by omega) d (T.offset+A.geometry.anchors T.vertex (j i)) + (universalMap (subtypeAlternatingHom I.val) s)*b* + (A.rectangles.slope (by omega) d (T.offset+A.geometry.anchors T.vertex (j i)) + (universalMap (subtypeAlternatingHom I.val) s))⁻¹ := by + have hLdist : dist (ordinary (L 0),ordinary (L 1)) z < A.geometry.epsilon/2 := by + rw [Prod.dist_eq,Real.dist_eq,Real.dist_eq,max_lt_iff] + exact ⟨(hnear 0).1,(hnear 1).1⟩ + have hVdist : dist (ordinary (V 0),ordinary (V 1)) z < A.geometry.epsilon/2 := by + rw [Prod.dist_eq,Real.dist_eq,Real.dist_eq,max_lt_iff] + exact ⟨(hnear 0).2,(hnear 1).2⟩ + have hclip' : ∀ k, -ordinary r ≤ ordinary (L k)-ordinary (pointCoordinate (T.offset+A.geometry.anchors T.vertex (j i)) k) ∧ + ordinary (V k)-ordinary (pointCoordinate (T.offset+A.geometry.anchors T.vertex (j i)) k) ≤ ordinary r := by + intro k + have hL := (T.active_bound i hi) (ordinary (L 0),ordinary (L 1)) + (fun l => (T.neighborhood _ hLdist l).imp le_of_lt le_of_lt) k + have hV := (T.active_bound i hi) (ordinary (V 0),ordinary (V 1)) + (fun l => (T.neighborhood _ hVdist l).imp le_of_lt le_of_lt) k + have heL : realCoordinate (ordinary (L 0),ordinary (L 1)) k=ordinary (L k) := by fin_cases k <;> rfl + have heV : realCoordinate (ordinary (V 0),ordinary (V 1)) k=ordinary (V k) := by fin_cases k <;> rfl + rw [heL] at hL + rw [heV] at hV + have hL' := (abs_lt.mp hL).1 + have hV' := (abs_lt.mp hV).2 + have hrad := A.geometry.radius + have hpos := A.geometry.positive + constructor <;> linarith + have hline : integralCutForm a (slopeDirection d) v= + integralCutForm a (slopeDirection d) (T.offset+A.geometry.anchors T.vertex (j i)) := by + rw [hv,← hd,(T.active_anchor i hi)] + have hz : cutForm a (slopeDirection d) z=ordinary (integralCutForm a (slopeDirection d) v) := by + rw [hv,← hd]; exact hi + have hnear' : ∀ k, |ordinary (L k)-realCoordinate z k| ≤ ordinary r/4 ∧ + |ordinary (V k)-realCoordinate z k| ≤ ordinary r/4 := by + intro k + have hh := hnear k + have hrad := A.geometry.radius + have hpos := A.geometry.positive + constructor <;> linarith + exact A.rectangles.slope_line_action hlarge hr d v (T.offset+A.geometry.anchors T.vertex (j i)) hline L V hLV + hclip hclip' z hz hnear' n q hW f hf hc I s b hb + +end InitialCoverSystem.PatchAtlas +end SelectedInwardActions + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/ShiftedRouting.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/ShiftedRouting.lean new file mode 100644 index 0000000000000000000000000000000000000000..7d0b87cc26ed59963739bf0861cbc6af0cc8086e --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/ShiftedRouting.lean @@ -0,0 +1,169 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.RoutingIndependence +import OAI.GroupTheory.SimpleAmenable.CentralCovers.CanonicalSlotStars +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.FrameCompatibility +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.TranslationRoutingHelpers + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section ShiftedRouting +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + (hlarge : 15 < m+1) (h : B.AllPrimitiveLaws) (hr : 0 (i j,u j)))) : + B.SlotRouting hlarge h hr V i u where + alphabet := P.alphabet + card_le := P.alphabet_card + source_mem := P.source_mem + target := P.target + target_mem := fun j => P.row_subset j (orderedTrackAlphabet_mem _ 1) + offsets := orderedOffsets P.target u + offsets_spec := orderedOffsets_apply P.target u + frame := balancedOffsetFrame a r m hm _ b (by + intro ht + obtain ⟨j,_,rfl⟩ := Finset.mem_map.mp ht + exact hb (P.row_subset j (orderedTrackAlphabet_mem _ 1))) (orderedOffsets P.target u) + word := B.privateRoutingWord hlarge h hr i u P b hb V + aligned := (B.privateRoutingWord_properties hlarge h hr i u P b hb V hinj).1 + supported := (B.privateRoutingWord_properties hlarge h hr i u P b hb V hinj).2.1 + transport := (B.privateRoutingWord_properties hlarge h hr i u P b hb V hinj).2.2 + +noncomputable def shift {V : polygonAlgebra a} {i : Fin 5 → Fin (m+1)} + {u : Fin 5 → CutRing × CutRing} (ρ : B.SlotRouting hlarge h hr V i u) + (k : Multiplicative (FreeAbelianGroup (Fin m × Fin 2))) + (d : Fin (m+1) → CutRing × CutRing) + (hd : sourceLatticeFullMap a r m hm k=trackTranslation d) + (htarget : ∀ j, d (ρ.target j)=d (i j)) + (halign : (MulAut.conj (B.t k)) ρ.word ∈ + ⨆ W : polygonAlgebra a, (B.polygonStar hlarge h hr W).range) + (hsupp : (MulAut.conj (B.t k)) ρ.word ∈ sourceAlignedGroup a r m hm M B.t ρ.alphabet) : + B.SlotRouting hlarge h hr V i (fun j => d (i j)+u j) where + alphabet := ρ.alphabet + card_le := ρ.card_le + source_mem := ρ.source_mem + target := ρ.target + target_mem := ρ.target_mem + offsets := d+ρ.offsets + offsets_spec := by intro j; simp only [Pi.add_apply,ρ.offsets_spec,htarget] + frame := ρ.frame.shift k d hd + word := (MulAut.conj (B.t k)) ρ.word + aligned := halign + supported := hsupp + transport := by + intro j x + have ht : (coverMap M (alternatingGenerator a r m hm) (B.t k)).val=trackTranslation d := by + have hh := congrArg Subtype.val (DFunLike.congr_fun B.t_projection k) + exact hh.trans hd + have hp : (i j,translate a (d (i j)+u j) x.val) = + (trackTranslation d).val (i j,translate a (u j) x.val) := by + simp only [trackTranslation_apply,translate_add] + rw [hp] + change (coverMap M (alternatingGenerator a r m hm) (B.t k*ρ.word*(B.t k)⁻¹)).val.val _ = _ + rw [map_mul,map_mul,map_inv] + change (coverMap M (alternatingGenerator a r m hm) (B.t k)).val.val + ((coverMap M (alternatingGenerator a r m hm) ρ.word).val.val + ((coverMap M (alternatingGenerator a r m hm) (B.t k)).val.val.symm _)) = _ + rw [ht,Equiv.symm_apply_apply,ρ.transport j x] + simp only [trackTranslation_apply,htarget,translate_add] + +theorem shift_star {V : polygonAlgebra a} {i : Fin 5 → Fin (m+1)} + {u : Fin 5 → CutRing × CutRing} (ρ : B.SlotRouting hlarge h hr V i u) + (k : Multiplicative (FreeAbelianGroup (Fin m × Fin 2))) + (d : Fin (m+1) → CutRing × CutRing) + (hd : sourceLatticeFullMap a r m hm k=trackTranslation d) + (htarget : ∀ j, d (ρ.target j)=d (i j)) + (halign : (MulAut.conj (B.t k)) ρ.word ∈ + ⨆ W : polygonAlgebra a, (B.polygonStar hlarge h hr W).range) + (hsupp : (MulAut.conj (B.t k)) ρ.word ∈ sourceAlignedGroup a r m hm M B.t ρ.alphabet) : + (ρ.shift k d hd htarget halign hsupp).star = + (MulAut.conj (B.t k)).toMonoidHom.comp ρ.star := by + ext s : 1 + have he := DFunLike.congr_fun (B.frameStar_shift hlarge h hr (orderedTrackAlphabet ρ.target) + ρ.offsets ρ.frame k d hd V) (universalMap (orderedTrackHom ρ.target) s) + change B.frameStar hlarge h hr _ _ _ V _ = + B.t k*B.distinctSlotStar hlarge h hr ρ.target ρ.offsets ρ.frame V s*(B.t k)⁻¹ at he + change (B.t k*ρ.word*(B.t k)⁻¹)⁻¹ * + B.frameStar hlarge h hr (orderedTrackAlphabet ρ.target) (d+ρ.offsets) (ρ.frame.shift k d hd) V + (universalMap (orderedTrackHom ρ.target) s) *((B.t k*ρ.word*(B.t k)⁻¹)⁻¹)⁻¹ = + B.t k*(ρ.word⁻¹*B.distinctSlotStar hlarge h hr ρ.target ρ.offsets ρ.frame V s*(ρ.word⁻¹)⁻¹)*(B.t k)⁻¹ + rw [he] + group + +end SlotRouting + +variable (R : alternatingGroup (Fin (m+1)) → + Multiplicative (FreeAbelianGroup (Fin m × Fin 2)) →* + Multiplicative (FreeAbelianGroup (Fin m × Fin 2))) + (hR : ∀ s k, B.c s * B.t k * (B.c s)⁻¹ = B.t (R s k)) + (hwide : 100 ≤ m+1) + +include R hR + +theorem slotStar_zero_commute (V : polygonAlgebra a) (i : Fin 5 → Fin (m+1)) + (u : Fin 5 → CutRing × CutRing) + (hinj : Function.Injective (SlotMap a (m+1) V (fun j => (i j,u j)))) + (k : Multiplicative (FreeAbelianGroup (Fin m × Fin 2))) + (d : Fin (m+1) → CutRing × CutRing) + (hd : sourceLatticeFullMap a r m hm k=trackTranslation d) + (J : Finset (Fin (m+1))) (hJ : J.card≤28) + (hsupp : ∀ t, t∉J → d t=0) (hz : ∀ j, d (i j)=0) + (s : UniversalExtension (alternatingGroup (Fin 5))) : + Commute (B.t k) (B.slotStar hlarge h hr hwide V i u hinj s) := by + classical + have hres : 20 ≤ ((Finset.univ : Finset (Fin (m+1))) \ + (J ∪ Finset.univ.image i)).card := by + rw [Finset.card_sdiff_of_subset (Finset.subset_univ _)] + have h₁ := Finset.card_union_le J (Finset.univ.image i) + have h₂ := Finset.card_image_le (f := i) (s := Finset.univ) + simp only [Finset.card_univ,Fintype.card_fin] at h₂ ⊢ + omega + obtain ⟨P,hP⟩ := exists_privateRoutingBank i J hres + obtain ⟨b,_,hb⟩ := Finset.exists_mem_notMem_of_card_lt_card + (show P.alphabet.card < (Finset.univ : Finset (Fin (m+1))).card by + have hc := P.alphabet_card + simp only [Finset.card_univ,Fintype.card_fin] + omega) + let ρ := SlotRouting.privateBank (B := B) (hlarge := hlarge) (h := h) (hr := hr) + V i u P b hb hinj + rw [B.slotStar_eq_routing hlarge h hr R hR hwide V i u hinj ρ] + have hzrow (j l : Fin 5) : d (P.row j l)=0 := by + by_cases hl : l=0 + · subst l; rw [P.source j]; exact hz j + · exact hsupp _ (hP j l hl) + have hw : Commute (B.t k) ρ.word := by + change Commute (B.t k) (((List.finRange 5).map _).prod) + apply Commute.list_prod_right + intro z hmem + obtain ⟨j,_,rfl⟩ := List.mem_map.mp hmem + exact B.distinctSlotStar_zero_commute hlarge h hr (P.row j) b + (fun ht => hb (P.row_subset j ht)) (fun _ => u j) _ V k d hd (hzrow j) privateCycleStar + have ht : Commute (B.t k) (B.distinctSlotStar hlarge h hr ρ.target ρ.offsets ρ.frame V s) := + B.distinctSlotStar_zero_commute hlarge h hr ρ.target b + (by intro ht; obtain ⟨j,_,he⟩ := Finset.mem_map.mp ht + exact hb (he ▸ P.row_subset j (orderedTrackAlphabet_mem _ 1))) + ρ.offsets ρ.frame V k d hd (fun j => hzrow j 1) s + exact (hw.inv_right.mul_right ht).mul_right hw.inv_right.inv_right + +end InitialCoverSystem +end ShiftedRouting + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/SimultaneousActiveActions.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/SimultaneousActiveActions.lean new file mode 100644 index 0000000000000000000000000000000000000000..fb91997e98ce4b412ba1ba0484f1a1524fb0bb7f --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/SimultaneousActiveActions.lean @@ -0,0 +1,194 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.ConcurrentGeometry +import OAI.GroupTheory.SimpleAmenable.CentralCovers.FormalStarTables +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.CompactFineGrid +import OAI.GroupTheory.SimpleAmenable.CentralCovers.PrimitiveFormalSectors + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section SimultaneousActiveActions +namespace InitialCoverSystem.RectangularAtlas +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + {B : InitialCoverSystem a r m hm M} + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + (A : B.RectangularAtlas) (C : ConcurrentGeometry a r) + +theorem simultaneous_active_slope_actions {ι : Type*} + (hlarge : 20 ≤ m+1) (hr : 0 < ordinary r ∧ ordinary r < 1/2) (ha : 0 < a) + (j : ι → Fin 4) (c : ι → CutRing) (z : ℝ × ℝ) : + ∃ t : VertexType (commonVertexDenominator a), ∃ u : CutRing × CutRing, + (∀ p : ℝ × ℝ, dist p z < C.epsilon/2 → ∀ k, + ordinary ((C.margins t).lower k+pointCoordinate u k) (primitiveTests (a := a) (r := r) + (coordinateWindowPrimitives n q) e).val) (coordinateRectangle a L V).val → + ∀ f : TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm), + B.AlignedSmallSupported f → + SmallControlled B.c f (B.windowSector (by omega) n (A.rectangles n) q + (coordinateRectangle a L V)) → + ∀ (I : ControlAlphabet (Fin (m+1))) (s : UniversalExtension (alternatingGroup I.val)), + ∀ b ∈ f.range, + A.slope (by omega) d v (universalMap (subtypeAlternatingHom I.val) s)*b* + (A.slope (by omega) d v (universalMap (subtypeAlternatingHom I.val) s))⁻¹ = + A.slope (by omega) d (u+C.anchors t (j i)) (universalMap (subtypeAlternatingHom I.val) s)*b* + (A.slope (by omega) d (u+C.anchors t (j i)) (universalMap (subtypeAlternatingHom I.val) s))⁻¹ := by + obtain ⟨t,u,hmargin,hactive⟩ := C.simultaneous_active_neighborhood ha j c z + refine ⟨t,u,hmargin,fun i hi => ⟨(hactive i hi).1,?_⟩⟩ + intro d hd v hv L V hLV hclip hnear n q hW f hf hc I s b hb + have hLdist : dist (ordinary (L 0),ordinary (L 1)) z < C.epsilon/2 := by + rw [Prod.dist_eq,Real.dist_eq,Real.dist_eq,max_lt_iff] + exact ⟨(hnear 0).1,(hnear 1).1⟩ + have hVdist : dist (ordinary (V 0),ordinary (V 1)) z < C.epsilon/2 := by + rw [Prod.dist_eq,Real.dist_eq,Real.dist_eq,max_lt_iff] + exact ⟨(hnear 0).2,(hnear 1).2⟩ + have hclip' : ∀ k, -ordinary r ≤ ordinary (L k)-ordinary (pointCoordinate (u+C.anchors t (j i)) k) ∧ + ordinary (V k)-ordinary (pointCoordinate (u+C.anchors t (j i)) k) ≤ ordinary r := by + intro k + have hL := (hactive i hi).2 (ordinary (L 0),ordinary (L 1)) + (fun l => (hmargin _ hLdist l).imp le_of_lt le_of_lt) k + have hV := (hactive i hi).2 (ordinary (V 0),ordinary (V 1)) + (fun l => (hmargin _ hVdist l).imp le_of_lt le_of_lt) k + have heL : realCoordinate (ordinary (L 0),ordinary (L 1)) k=ordinary (L k) := by fin_cases k <;> rfl + have heV : realCoordinate (ordinary (V 0),ordinary (V 1)) k=ordinary (V k) := by fin_cases k <;> rfl + rw [heL] at hL + rw [heV] at hV + have hL' := (abs_lt.mp hL).1 + have hV' := (abs_lt.mp hV).2 + have hrad := C.radius + have hpos := C.positive + constructor <;> linarith + have hline : integralCutForm a (slopeDirection d) v= + integralCutForm a (slopeDirection d) (u+C.anchors t (j i)) := by + rw [hv,← hd,(hactive i hi).1] + have hz : cutForm a (slopeDirection d) z=ordinary (integralCutForm a (slopeDirection d) v) := by + rw [hv,← hd]; exact hi + have hnear' : ∀ k, |ordinary (L k)-realCoordinate z k| ≤ ordinary r/4 ∧ + |ordinary (V k)-realCoordinate z k| ≤ ordinary r/4 := by + intro k + have hh := hnear k + have hrad := C.radius + have hpos := C.positive + constructor <;> linarith + exact A.slope_line_action hlarge hr d v (u+C.anchors t (j i)) hline L V hLV + hclip hclip' z hz hnear' n q hW f hf hc I s b hb + +end InitialCoverSystem.RectangularAtlas +end SimultaneousActiveActions + +section ActualFormalPartitions +variable {a : ℕ} {ι D : Type*} + +theorem polygon_partition_formal_extension (U : ι → polygonAlgebra a) + (W : D → polygonAlgebra a) (d₀ : D) + (hW : ∀ d, ResolvedBy (fun i => (U i).val) (W d).val) + (hd : Pairwise fun d e => Disjoint (W d).val (W e).val) + (hc : ∀ x : GenericSquare a, ∃ d, x ∈ (W d).val) : + ∃ C : D → Set (ι → Bool), + (Pairwise fun d e => Disjoint (C d) (C e)) ∧ + (∀ σ, ∃ d, σ ∈ C d) ∧ + ∀ d x, polygonAssignment U x ∈ C d ↔ x ∈ (W d).val := by + classical + let chooseCell (σ : ι → Bool) : D := + if h : ∃ x : GenericSquare a, polygonAssignment U x=σ then + Classical.choose (hc (Classical.choose h)) else d₀ + refine ⟨fun d => {σ | chooseCell σ=d},?_,?_,?_⟩ + · intro d e hde + apply Set.disjoint_left.mpr + intro σ hσ hτ + exact hde (hσ.symm.trans hτ) + · intro σ + exact ⟨chooseCell σ,rfl⟩ + · intro d x + have hx : ∃ y : GenericSquare a, polygonAssignment U y=polygonAssignment U x := ⟨x,rfl⟩ + have hy := Classical.choose_spec hx + have hcell := Classical.choose_spec (hc (Classical.choose hx)) + have hactual : x ∈ (W (chooseCell (polygonAssignment U x))).val := by + dsimp only [chooseCell] + rw [dite_eq_left hx] + exact (hW _ _ _ ((polygonAssignment_eq_iff U _ _).mp hy)).mp hcell + change chooseCell (polygonAssignment U x)=d ↔ x ∈ (W d).val + constructor + · intro he; exact he ▸ hactual + · intro hxW + by_contra hn + exact Set.disjoint_left.mp (hd hn) hactual hxW + +namespace InitialCoverSystem.PatchAtlas +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + {B : InitialCoverSystem a r m hm M} + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] (A : B.PatchAtlas) + {J κ : Type*} [Finite κ] {η : J → Type*} [∀ i, Finite (η i)] + +theorem independent_formal_partition (hlarge : 15 < m+1) + (P : (i : J) → η i → Fin 5 × (CutRing × CutRing)) + (T : ∀ i, FormalStarTable (A.starFamily hlarge (P i))) + (Q : κ → Fin 5 × (CutRing × CutRing)) + (v : (i : J) → κ → η i) (he : ∀ i, P i ∘ v i=Q) + (hQ : ∀ I, I.card ≤ 15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb Q) + (W : D → polygonAlgebra a) (d₀ : D) + (hW : ∀ d, ResolvedBy (fun j => (primitiveTests (a := a) (r := r) Q j).val) (W d).val) + (hd : Pairwise fun d e => Disjoint (W d).val (W e).val) + (hc : ∀ x : GenericSquare a, ∃ d, x ∈ (W d).val) : + ∃ C : (i : J) → D → Set (η i → Bool), + (∀ i, Pairwise fun d e => Disjoint (C i d) (C i e)) ∧ + (∀ i σ, ∃ d, σ ∈ C i d) ∧ + (∀ i d, (T i).sector (C i d)=B.fullGeometricSector hlarge Q hQ (W d)) ∧ + (∀ i d, (T i).sector (C i d)ᶜ=B.fullGeometricSector hlarge Q hQ (W d)ᶜ) := by + classical + obtain ⟨U,hUd,hUc,hU⟩ := polygon_partition_formal_extension + (primitiveTests (a := a) (r := r) Q) W d₀ hW hd hc + let C : (i : J) → D → Set (η i → Bool) := fun i d => + (fun σ : η i → Bool => σ ∘ v i) ⁻¹' U d + refine ⟨C,?_,?_,?_,?_⟩ + · intro i d e hde + apply Set.disjoint_left.mpr + intro σ hσ hτ + exact Set.disjoint_left.mp (hUd hde) hσ hτ + · intro i σ + exact hUc (σ ∘ v i) + · intro i d + have h : ∀ I, I.card ≤ 15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb (P i ∘ v i) := by rw [he i]; exact hQ + have hWd : ResolvedBy (fun j => (primitiveTests (a := a) (r := r) (P i ∘ v i) j).val) (W d).val := by + rw [he i]; exact hW d + have hUd' : ∀ x, polygonAssignment (primitiveTests (a := a) (r := r) (P i ∘ v i)) x ∈ U d ↔ x ∈ (W d).val := by + rw [he i]; exact hU d + have hh := A.formalSector_subfamily_eq hlarge (P i) (T i) (v i) h (U d) (W d) hWd hUd' + simpa only [C,he i] using hh + · intro i d + have h : ∀ I, I.card ≤ 15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb (P i ∘ v i) := by rw [he i]; exact hQ + have hWd : ResolvedBy (fun j => (primitiveTests (a := a) (r := r) (P i ∘ v i) j).val) ((W d)ᶜ).val := by + rw [he i] + intro x y hxy + exact not_congr (hW d x y hxy) + have hUd' : ∀ x, polygonAssignment (primitiveTests (a := a) (r := r) (P i ∘ v i)) x ∈ (U d)ᶜ ↔ x ∈ ((W d)ᶜ).val := by + rw [he i] + intro x + exact not_congr (hU d x) + have hh := A.formalSector_subfamily_eq hlarge (P i) (T i) (v i) h (U d)ᶜ (W d)ᶜ hWd hUd' + simpa only [C,he i,Set.preimage_compl] using hh + +end InitialCoverSystem.PatchAtlas +end ActualFormalPartitions + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/SmallFamilyGlobal.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/SmallFamilyGlobal.lean new file mode 100644 index 0000000000000000000000000000000000000000..e3eef9c51c0710a76a53f8242f370edcac50d3bd --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/SmallFamilyGlobal.lean @@ -0,0 +1,170 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.LocalAtomComparison +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.SmallFamilyWords + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section SmallFamilyGlobal + +variable {D H Q T : Type*} [Group D] [Group H] [Group Q] [Group T] + +theorem centralOn_range_iff_hasCentralLaw (q : H →* Q) (e : D →* H) + (v : D →* T) (ρ : T →* Q) (hρ : Function.Injective ρ) + (he : q.comp e = ρ.comp v) : + CentralOn q e.range ↔ HasCentralLaw v e.rangeRestrict := by + have hk (w : D) : q (e w) = 1 ↔ v w = 1 := by + have hh := DFunLike.congr_fun he w + change q (e w) = ρ (v w) at hh + rw [hh,← map_one ρ] + exact hρ.eq_iff + rw [hasCentralLaw_iff] + constructor + · intro h w hw + exact h ((hk w).mpr hw) + · intro h x hx + obtain ⟨w,hw⟩ := x.property + have hx' : q (e w) = 1 := by + change q x.val = 1 at hx + simpa only [hw] using hx + have ht := h w ((hk w).mp hx') + have heq : e.rangeRestrict w = x := Subtype.ext hw + rwa [heq] at ht + +variable {α ι Ω : Type*} [Fintype α] [DecidableEq α] [Finite ι] [Finite Ω] + +theorem smallFamily_centralOn + (U : ι → Set Ω) (hsep : ∀ ω ν, (∀ i, ω ∈ U i ↔ ν ∈ U i) → ω = ν) + (F : (I : FiveAlphabet α) → Option ι → alternatingGroup I.val →* H) + (q : H →* Q) (ρ : (Ω → alternatingGroup α) →* Q) (hρ : Function.Injective ρ) + (hproj : ∀ I i, q.comp (F I i) = + ρ.comp ((maskFamily U i).comp (subtypeAlternatingHom I.val))) + (K : Finset α → Subgroup H) + (hlaw : ∀ S, S.card ≤ 15 → CentralOn q (K S)) + (hcontain : ∀ S, S.card ≤ 15 → ∀ I, I.val ⊆ S → ∀ i, (F I i).range ≤ K S) + (hα : 5 ≤ Fintype.card α) : CentralOn q (smallFamilyEval F).range := by + classical + let e := smallFamilyEval F + let v := smallFamilyModel (α := α) U + have he : q.comp e = ρ.comp v := by + apply FreeGroup.ext_hom + rintro ⟨I,i,s⟩ + simpa only [e,v,MonoidHom.comp_apply,smallFamilyModel,smallFamilyEval_of] using + DFunLike.congr_fun (hproj I i) s + apply (centralOn_range_iff_hasCentralLaw q e v ρ hρ he).mpr + let : Group.IsPerfect e.range := smallFamilyEval_perfect F + obtain ⟨E,_hEsub,hE⟩ := Finset.exists_subset_card_eq (show 5 ≤ (Finset.univ : Finset α).card by simpa using hα) + obtain ⟨x,hx⟩ := Finset.card_pos.mp (show 0 < E.card by omega) + obtain ⟨y,hy,hyx⟩ := Finset.exists_mem_ne (show 1 < E.card by omega) x + let a : SwapLabel α := ⟨Equiv.swap x y,x,y,Ne.symm hyx,rfl⟩ + have ha : a.val.support ⊆ E := by + change (Equiv.swap x y).support ⊆ E + rw [Equiv.Perm.support_swap (Ne.symm hyx)] + exact Finset.insert_subset_iff.mpr ⟨hx,Finset.singleton_subset_iff.mpr hy⟩ + refine small_support_assignment_law (smallFamilyLocal (ι := ι)) smallFamilyLocal_mono + v e.rangeRestrict e.rangeRestrict_surjective smallFamilyLocal_generate + (smallFamilyModel_support U) ?_ E hE a ha ?_ + · intro S hS d hd hv z hz + apply Commute.of_map (f := e.range.subtype) Subtype.val_injective + have hle := smallFamilyLocal_map_le F S (K S) (hcontain S hS) + apply (centralOn_iff q (K S)).mp (hlaw S hS) (e d) (hle ⟨d,hd,rfl⟩) + · have hh := DFunLike.congr_fun he d + change q (e d) = ρ (v d) at hh + rw [hh,hv,map_one] + · exact hle ⟨z,hz,rfl⟩ + · intro S hS _ g hg + exact smallFamilyModel_complete U hsep S hS g hg + +end SmallFamilyGlobal + +section GlobalPrimitiveTable + +theorem exists_alphabet_balance {α : Type*} [Fintype α] [DecidableEq α] + (S : Finset α) (hS : S.card < Fintype.card α) : ∃ b, b ∉ S := by + classical + by_contra h + push Not at h + have he : S = Finset.univ := Finset.eq_univ_iff_forall.mpr h + rw [he,Finset.card_univ] at hS + exact (lt_irrefl _ hS) + +noncomputable def smallAlphabetBalance {m : ℕ} (hlarge : 15 < m+1) + (S : Finset (Fin (m+1))) (hS : S.card ≤ 15) : Fin (m+1) := + (exists_alphabet_balance S (by simpa using lt_of_le_of_lt hS hlarge)).choose + +theorem smallAlphabetBalance_notMem {m : ℕ} (hlarge : 15 < m+1) + (S : Finset (Fin (m+1))) (hS : S.card ≤ 15) : + smallAlphabetBalance hlarge S hS ∉ S := + (exists_alphabet_balance S (by simpa using lt_of_le_of_lt hS hlarge)).choose_spec + +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) {ι : Type*} [Finite ι] + +noncomputable def smallPrimitiveInputs (hlarge : 15 < m+1) + (P : ι → Fin 5 × (CutRing × CutRing)) + (I : FiveAlphabet (Fin (m+1))) : + Option ι → alternatingGroup I.val →* BoundedRelationCover M (alternatingGenerator a r m hm) := + B.primitiveFamily I.val (smallAlphabetBalance hlarge I.val (by rw [I.property.2]; omega)) + (smallAlphabetBalance_notMem hlarge I.val (by rw [I.property.2]; omega)) P + +noncomputable def smallPrimitiveCarrier (hlarge : 15 < m+1) + (P : ι → Fin 5 × (CutRing × CutRing)) (S : Finset (Fin (m+1))) : + Subgroup (BoundedRelationCover M (alternatingGenerator a r m hm)) := + if hS : S.card ≤ 15 then + (copyFamilyEval (B.primitiveFamily S (smallAlphabetBalance hlarge S hS) + (smallAlphabetBalance_notMem hlarge S hS) P)).range + else ⊥ + +theorem smallPrimitiveInputs_projection (hlarge : 15 < m+1) + (P : ι → Fin 5 × (CutRing × CutRing)) (I : FiveAlphabet (Fin (m+1))) (i : Option ι) : + (coverMap M (alternatingGenerator a r m hm)).comp (B.smallPrimitiveInputs hlarge P I i) = + (actualPolygonTableHom (primitiveTests (a := a) (r := r) P)).comp + ((maskFamily (actualTestMask (primitiveTests (a := a) (r := r) P)) i).comp + (subtypeAlternatingHom I.val)) := by + rw [smallPrimitiveInputs,B.primitiveFamily_projection] + have he := actualAlphabetTableHom_masks I.val (primitiveTests (a := a) (r := r) P) i + change ((actualPolygonTableHom _).comp (alphabetAssignment I.val)).comp _ = _ at he + rw [MonoidHom.comp_assoc,alphabetAssignment_mask] at he + exact he.symm + +omit [Finite ι] in +theorem smallPrimitiveInputs_local (hlarge : 15 < m+1) + (P : ι → Fin 5 × (CutRing × CutRing)) (S : Finset (Fin (m+1))) (hS : S.card ≤ 15) + (I : FiveAlphabet (Fin (m+1))) (hIS : I.val ⊆ S) (i : Option ι) : + (B.smallPrimitiveInputs hlarge P I i).range ≤ B.smallPrimitiveCarrier hlarge P S := by + rw [smallPrimitiveCarrier,dite_eq_left hS] + rintro x ⟨s,rfl⟩ + rw [copyFamilyEval_range] + apply le_iSup (fun j => (B.primitiveFamily S (smallAlphabetBalance hlarge S hS) + (smallAlphabetBalance_notMem hlarge S hS) P j).range) i + refine ⟨subalphabetHom hIS s,?_⟩ + exact DFunLike.congr_fun (B.primitiveFamily_inclusion hIS _ _ _ _ P i) s + +theorem fullPrimitiveFamily_central (hlarge : 15 < m+1) + (P : ι → Fin 5 × (CutRing × CutRing)) + (h : ∀ I, I.card ≤ 15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb P) : + CentralOn (coverMap M (alternatingGenerator a r m hm)) + (smallFamilyEval (B.smallPrimitiveInputs hlarge P)).range := by + apply smallFamily_centralOn (actualTestMask (primitiveTests (a := a) (r := r) P)) + (actualTestMask_separates _) (B.smallPrimitiveInputs hlarge P) _ + (actualPolygonTableHom _) (actualPolygonTableHom_injective _) + (B.smallPrimitiveInputs_projection hlarge P) (B.smallPrimitiveCarrier hlarge P) ?_ + (B.smallPrimitiveInputs_local hlarge P) (by simpa using (by omega : 5 ≤ m+1)) + intro S hS + rw [smallPrimitiveCarrier,dite_eq_left hS] + exact h S hS _ _ + +end InitialCoverSystem +end GlobalPrimitiveTable + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/SmallFormalGlobal.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/SmallFormalGlobal.lean new file mode 100644 index 0000000000000000000000000000000000000000..6263eeef34cb02d54966d48b9d70a49e60be4c65 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/SmallFormalGlobal.lean @@ -0,0 +1,75 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.LocalAtomComparison +import OAI.GroupTheory.SimpleAmenable.CentralCovers.FullAlphabetGeneration + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section SmallFormalGlobal +variable {α ι Ω H : Type*} [Fintype α] [DecidableEq α] [Finite ι] [Finite Ω] [Group H] + +theorem smallFamily_assignment_law + (U : ι → Set Ω) (hsep : ∀ ω ν, (∀ i, ω ∈ U i ↔ ν ∈ U i) → ω=ν) + (F : (I : FiveAlphabet α) → Option ι → alternatingGroup I.val →* H) + (hlaw : ∀ S : Finset α, S.card≤15 → ∀ w ∈ smallFamilyLocal (ι := ι) S, + smallFamilyModel U w=1 → ∀ v ∈ smallFamilyLocal (ι := ι) S, + Commute (smallFamilyEval F w) (smallFamilyEval F v)) + (hα : 5≤Fintype.card α) : + HasCentralLaw (smallFamilyModel U) (smallFamilyEval F).rangeRestrict := by + classical + let e := smallFamilyEval F + let v := smallFamilyModel (α := α) U + let : Group.IsPerfect e.range := smallFamilyEval_perfect F + obtain ⟨E,_hEsub,hE⟩ := Finset.exists_subset_card_eq + (show 5≤(Finset.univ : Finset α).card by simpa using hα) + obtain ⟨x,hx⟩ := Finset.card_pos.mp (show 0 {σ : ι → Bool | σ i=true}) w=1 → + ∀ v ∈ smallFamilyLocal (ι := ι) S, + Commute (smallFamilyEval F w) (smallFamilyEval F v)) + (hα : 5≤Fintype.card α) : + ∃ φ : ((ι → Bool) → alternatingGroup α) →* + ((smallFamilyEval F).range ⧸ Subgroup.center (smallFamilyEval F).range), + Function.Surjective φ ∧ + φ.comp (smallFamilyModel (fun i : ι => {σ : ι → Bool | σ i=true})) = + (QuotientGroup.mk' _).comp (smallFamilyEval F).rangeRestrict := by + classical + have hs : ∀ σ τ : ι → Bool, + (∀ i, σ ∈ {σ : ι → Bool | σ i=true} ↔ τ ∈ {σ : ι → Bool | σ i=true}) → σ=τ := by + intro σ τ h + funext i + exact Bool.eq_iff_iff.mpr (h i) + have h := smallFamily_assignment_law _ hs F hlaw hα + obtain ⟨φ,hφ⟩ := (hasCentralLaw_iff_modelMap _ _ + (smallFamilyModel_surjective _ hs hα)).mp h + exact ⟨φ,centralLaw_modelMap_surjective _ _ (smallFamilyEval F).rangeRestrict_surjective φ hφ,hφ⟩ + +end SmallFormalGlobal + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/SmallSectorGeneration.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/SmallSectorGeneration.lean new file mode 100644 index 0000000000000000000000000000000000000000..d3c1e260315da44b8deb3550e20d35b34d39df31 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/SmallSectorGeneration.lean @@ -0,0 +1,76 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.WindowIntervals + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section SmallSectorGeneration + +variable {α : Type*} [Fintype α] [DecidableEq α] + +abbrev FiveSubalphabet (J : Finset α) := {I : Finset α // I ⊆ J ∧ I.card = 5} + +instance fiveSubalphabet_perfect (J : Finset α) (I : FiveSubalphabet J) : + Group.IsPerfect (alternatingGroup I.val) := alphabetPerfect I.val (by rw [I.property.2]) + +theorem subalphabet_five_generate (J : Finset α) (hJ : 5 ≤ J.card) : + (⨆ I : FiveSubalphabet J, (subalphabetHom I.property.1).range) = ⊤ := by + apply top_unique + rw [← alternatingGroup.closure_isThreeCycles_eq_top] + apply (Subgroup.closure_le _).mpr + intro g hg + let σ := subtypeAlternatingHom J g + have hs : σ.val.support ⊆ J := (subtypeAlternatingHom_mem_range J σ).mp ⟨g,rfl⟩ + have hc : σ.val.support.card = 3 := by + change (Equiv.Perm.ofSubtype g.val).support.card = 3 + have hF : (Subtype.fintype (fun x : α => x ∈ J)) = (inferInstance : Fintype J) := Subsingleton.elim _ _ + rw [Equiv.Perm.support_ofSubtype,Finset.card_map,hF,hg.card_support] + obtain ⟨I,hSI,hIJ,hI⟩ := Finset.exists_subsuperset_card_eq hs (by omega : σ.val.support.card ≤ 5) hJ + obtain ⟨t,ht⟩ := (subtypeAlternatingHom_mem_range I σ).mpr hSI + apply le_iSup (fun I : FiveSubalphabet J => (subalphabetHom I.property.1).range) ⟨I,hIJ,hI⟩ + refine ⟨t,?_⟩ + apply subtypeAlternatingHom_injective J + exact (DFunLike.congr_fun (subtypeAlternatingHom_comp hIJ) t).trans ht + +theorem universal_subalphabet_five_generate (J : Finset α) (hJ : 5 ≤ J.card) + [Group.IsPerfect (alternatingGroup J)] : + (⨆ I : FiveSubalphabet J, (universalMap (subalphabetHom I.property.1)).range) = ⊤ := + universal_generating_ranges (fun I : FiveSubalphabet J => subalphabetHom I.property.1) + (subalphabet_five_generate J hJ) + +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) {ι : Type*} [Finite ι] + +theorem geometricSector_five_generate + (J : Finset (Fin (m+1))) (hJ : 5 ≤ J.card) [Group.IsPerfect (alternatingGroup J)] + (b : Fin (m+1)) (hb : b ∉ J) (P : ι → Fin 5 × (CutRing × CutRing)) + (h : B.PrimitiveFamilyLaw J b hb P) + (g : ∀ I : FiveSubalphabet J, B.PrimitiveFamilyLaw I.val b + (fun hi => hb (I.property.1 hi)) P) + (V : polygonAlgebra a) + (hV : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) P i).val) V.val) : + (B.geometricSector J b hb P h V).range = + ⨆ I : FiveSubalphabet J, (B.geometricSector I.val b + (fun hi => hb (I.property.1 hi)) P (g I) V).range := by + rw [MonoidHom.range_eq_map,← universal_subalphabet_five_generate J hJ,Subgroup.map_iSup] + apply iSup_congr + intro I + rw [← MonoidHom.range_comp] + congr 1 + exact B.geometricSector_inclusion I.property.1 b b (fun hi => hb (I.property.1 hi)) hb + P (g I) h V hV + +end InitialCoverSystem +end SmallSectorGeneration + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/SmallStarRelators.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/SmallStarRelators.lean new file mode 100644 index 0000000000000000000000000000000000000000..0ca9c404c6428fda678c21f8bfcae371261a1be1 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/SmallStarRelators.lean @@ -0,0 +1,162 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.TemplateFormalRelators + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section SmallStarRelators +variable {α ι Ω H Q : Type*} [Fintype α] [DecidableEq α] [Group H] [Group Q] + [Group.IsPerfect (alternatingGroup α)] + +noncomputable def alphabetStarLift (I : FiveAlphabet α) (s : alternatingGroup I.val) : + TrackStar α := universalMap (subtypeAlternatingHom I.val) + (Classical.choose (universalProjection_surjective (alternatingGroup I.val) s)) + +@[simp] theorem alphabetStarLift_projection (I : FiveAlphabet α) (s : alternatingGroup I.val) : + universalProjection (alternatingGroup α) (alphabetStarLift I s)=subtypeAlternatingHom I.val s := by + have h := DFunLike.congr_fun (universalMap_spec (subtypeAlternatingHom I.val)) + (Classical.choose (universalProjection_surjective (alternatingGroup I.val) s)) + simpa only [MonoidHom.comp_apply,alphabetStarLift, + Classical.choose_spec (universalProjection_surjective (alternatingGroup I.val) s)] using h + +noncomputable def smallFamilyStarWord : SmallFamilyWord α ι →* + FreeGroup (Option ι × TrackStar α) := + FreeGroup.lift (fun l => FreeGroup.of (l.2.1,alphabetStarLift l.1 l.2.2)) + +theorem smallFamilyStarWord_model : + (formalAssignmentEval (ι := ι) (universalProjection (alternatingGroup α))).comp + smallFamilyStarWord = + smallFamilyModel (fun i : ι => {σ : ι → Bool | σ i=true}) := by + apply FreeGroup.ext_hom + rintro ⟨I,i,s⟩ + change formalAssignmentEval (universalProjection (alternatingGroup α)) + (FreeGroup.of (i,alphabetStarLift I s)) = _ + ext σ + cases i with + | none => simp [formalAssignmentEval,assignmentEval,copySourceMap,maskFamily,sectorMask,smallFamilyModel] + | some i => + cases hi : σ i <;> + simp [formalAssignmentEval,assignmentEval,copySourceMap,maskFamily,sectorMask,smallFamilyModel,hi] + +theorem smallFamilyStarWord_eval (F : Option ι → TrackStar α →* H) + (f : (I : FiveAlphabet α) → Option ι → alternatingGroup I.val →* H) + (hspec : ∀ I i, (F i).comp (universalMap (subtypeAlternatingHom I.val))= + (f I i).comp (universalProjection (alternatingGroup I.val))) : + (copyFamilyEval F).comp smallFamilyStarWord=smallFamilyEval f := by + apply FreeGroup.ext_hom + rintro ⟨I,i,s⟩ + have h := DFunLike.congr_fun (hspec I i) + (Classical.choose (universalProjection_surjective (alternatingGroup I.val) s)) + simpa only [MonoidHom.comp_apply,smallFamilyStarWord,FreeGroup.lift_apply_of, + copyFamilyEval_of,smallFamilyEval_of,alphabetStarLift, + Classical.choose_spec (universalProjection_surjective (alternatingGroup I.val) s)] using h + +theorem smallFamilyStarWord_supported + (L : Finset α → Subgroup H) (hmono : Monotone L) + (F : Option ι → TrackStar α →* H) (hF : ∀ i, SmallSupported L (F i)) + (S : Finset α) (w : SmallFamilyWord α ι) (hw : w ∈ smallFamilyLocal S) : + copyFamilyEval F (smallFamilyStarWord w) ∈ L S := by + have hle : smallFamilyLocal (ι := ι) S ≤ (L S).comap + ((copyFamilyEval F).comp smallFamilyStarWord) := by + apply (Subgroup.closure_le _).mpr + rintro x ⟨⟨I,i,s⟩,hI,rfl⟩ + let J : ControlAlphabet α := ⟨I.val,by have hi := I.property.2; omega, + by have hi := I.property.2; omega⟩ + apply hmono hI + apply hF i J + refine ⟨Classical.choose (universalProjection_surjective (alternatingGroup I.val) s),?_⟩ + simp [smallFamilyStarWord,alphabetStarLift,J] + exact hle hw + +theorem template_supported_word_controls + (L : Finset α → Subgroup H) (hmono : Monotone L) (c : alternatingGroup α →* H) + (hc : ∀ σ I, ∀ x ∈ L I, c σ*x*(c σ)⁻¹ ∈ L (I.map σ.val.toEmbedding)) + (hd : ∀ I J, Disjoint I J → ∀ x ∈ L I, ∀ y ∈ L J, Commute x y) + {q : H →* Q} {v : (Ω → alternatingGroup α) →* Q} (T : ActualLawfulTable q v) + (U : ι → Set Ω) (V : Set Ω) + (hT : ∀ i : Option ι, SmallSupported L (T.sector (templateSides U V i))) + (f : TrackStar α →* H) (hf : SmallSupported L f) + (hcontrol : SmallControlled c f (T.sector V)) + (S : Finset α) (hS : S.card+10 ≤ Fintype.card α) + (w : SmallFamilyWord α ι) (hw : w ∈ smallFamilyLocal S) + (hrel : smallFamilyModel (fun i : ι => {σ : ι → Bool | σ i=true}) w=1) : + ∀ x ∈ f.range, Commute + (copyFamilyEval (fun i => T.sector (templateSides U V i)) (smallFamilyStarWord w)) x := by + have hm : formalAssignmentEval (universalProjection (alternatingGroup α)) + (smallFamilyStarWord w)=1 := by + have h := DFunLike.congr_fun (smallFamilyStarWord_model (α := α) (ι := ι)) w + exact h.trans hrel + have hz := T.template_relator_central U V _ hm + exact small_control_transfer L c hc hd f (T.sector V) hf hcontrol S _ + (smallFamilyStarWord_supported L hmono _ hT S w hw) hS + (fun J s => show Commute _ (T.sector V (universalMap (subtypeAlternatingHom J.val) s)) from + (hz _ (T.sector_mem _ _)).symm) + +end SmallStarRelators + +section CellConstantActions +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) {ι : Type*} [Finite ι] + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + +theorem cell_constant_action (hlarge : 20 ≤ m+1) + (P : ι → Fin 5 × (CutRing × CutRing)) + (h : ∀ I, I.card ≤ 15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb P) + (U W : polygonAlgebra a) + (hU : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) P i).val) U.val) + (hW : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) P i).val) W.val) + (b : Bool) (he : U ⊓ W = if b then W else ⊥) + (f : TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm)) + (hf : B.AlignedSmallSupported f) + (hc : SmallControlled B.c f (B.fullGeometricSector (by omega) P h W)) + (I : ControlAlphabet (Fin (m+1))) (s : UniversalExtension (alternatingGroup I.val)) : + ∀ x ∈ f.range, + B.fullGeometricSector (by omega) P h U (universalMap (subtypeAlternatingHom I.val) s)*x* + (B.fullGeometricSector (by omega) P h U (universalMap (subtypeAlternatingHom I.val) s))⁻¹ = + (if b then B.c (subtypeAlternatingHom I.val (universalProjection _ s)) else 1)*x* + (if b then B.c (subtypeAlternatingHom I.val (universalProjection _ s)) else 1)⁻¹ := by + have hspec := DFunLike.congr_fun (universalMap_spec (subtypeAlternatingHom I.val)) s + simp only [MonoidHom.comp_apply] at hspec + cases b with + | false => + have hh := B.chart_action_transfer hlarge P h U ⊥ W hU + (fun _ _ _ => Iff.rfl) hW (by simpa using he) f hf hc I s + simpa only [Bool.false_eq_true,↓reduceIte,B.fullGeometricSector_bot,MonoidHom.one_apply] using hh + | true => + have hh := B.chart_action_transfer hlarge P h U (wholePolygon a) W hU + (fun _ _ _ => Iff.rfl) hW (by change U ⊓ W=⊤ ⊓ W; simpa using he) f hf hc I s + simpa only [↓reduceIte,B.fullGeometricSector_whole,MonoidHom.comp_apply,hspec] using hh + +theorem cell_restrict_action (hlarge : 20 ≤ m+1) + (P : ι → Fin 5 × (CutRing × CutRing)) + (h : ∀ I, I.card ≤ 15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb P) + (U W : polygonAlgebra a) + (hU : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) P i).val) U.val) + (hW : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) P i).val) W.val) + (f : TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm)) + (hf : B.AlignedSmallSupported f) + (hc : SmallControlled B.c f (B.fullGeometricSector (by omega) P h W)) + (I : ControlAlphabet (Fin (m+1))) (s : UniversalExtension (alternatingGroup I.val)) : + ∀ x ∈ f.range, + B.fullGeometricSector (by omega) P h U (universalMap (subtypeAlternatingHom I.val) s)*x* + (B.fullGeometricSector (by omega) P h U (universalMap (subtypeAlternatingHom I.val) s))⁻¹ = + B.fullGeometricSector (by omega) P h (U ⊓ W) (universalMap (subtypeAlternatingHom I.val) s)*x* + (B.fullGeometricSector (by omega) P h (U ⊓ W) (universalMap (subtypeAlternatingHom I.val) s))⁻¹ := by + exact B.chart_action_transfer hlarge P h U (U ⊓ W) W hU + (fun x y hh => and_congr (hU x y hh) (hW x y hh)) hW + (by rw [inf_assoc,inf_idem]) f hf hc I s + +end InitialCoverSystem +end CellConstantActions + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/StarAtomLaw.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/StarAtomLaw.lean new file mode 100644 index 0000000000000000000000000000000000000000..acd2a4fbef9bc0bc1e539fa1101805ca363e71bb --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/StarAtomLaw.lean @@ -0,0 +1,169 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.ChartControlChain +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.LabelShiftedCharts + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section StarAtomLaw + +variable {E H Q Ω : Type*} [Group E] [Group H] [Group Q] + +theorem assignmentProjection_central : + (assignmentProjection (E := E) (Ω := Ω)).ker ≤ + Subgroup.center (Ω → UniversalExtension E) := by + intro x hx + apply Subgroup.mem_center_iff.mpr + intro y + funext ω + have hω : universalProjection E (x ω) = 1 := congrFun (show assignmentProjection x = 1 from hx) ω + exact Subgroup.mem_center_iff.mp (universalProjection_central E hω) (y ω) + +variable [Fintype Ω] + +theorem centralOn_of_star_atoms (q : H →* Q) (v : (Ω → E) →* Q) + (hv : Function.Injective v) (f : Ω → UniversalExtension E →* H) + (hc : Pairwise fun i j => ∀ s t, Commute (f i s) (f j t)) + (hf : ∀ ω, q.comp (f ω) = (v.comp (sectorMask {ω})).comp (universalProjection E)) : + CentralOn q (⨆ ω, (f ω).range) := by + classical + let ρ := MonoidHom.noncommPiCoprod f hc + have hρ : q.comp ρ = v.comp assignmentProjection := by + apply MonoidHom.pi_ext + intro ω s + change q (MonoidHom.noncommPiCoprod f hc (Pi.mulSingle ω s)) = + v (assignmentProjection (Pi.mulSingle ω s)) + rw [MonoidHom.noncommPiCoprod_mulSingle] + rw [show q (f ω s) = v (sectorMask {ω} (universalProjection E s)) from + DFunLike.congr_fun (hf ω) s] + congr 1 + ext ν + by_cases he : ν = ω + · subst ν + simp [assignmentProjection,sectorMask] + · simp [assignmentProjection,sectorMask,he] + rw [← MonoidHom.noncommPiCoprod_range f (hcomm := hc),centralOn_iff] + rintro x ⟨s,rfl⟩ hx y ⟨t,rfl⟩ + have hs : assignmentProjection s = 1 := by + apply hv + have he := DFunLike.congr_fun hρ s + change q (ρ s) = v (assignmentProjection s) at he + rw [← he,hx,map_one] + have hz := assignmentProjection_central (E := E) (Ω := Ω) hs + exact (show Commute s t from (Subgroup.mem_center_iff.mp hz t).symm).map ρ + +end StarAtomLaw + +section ChartOverlapBridge +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + +theorem old_rectangle_bridge_to_chart (hlarge : 20 ≤ m+1) + {K δ : ℝ} (hK : 0 ≤ K) (hδ : 0 < δ) + (k : ℕ) (q : Fin 2 → ℤ) (u : CutRing) (h : B.TangentChartLaws k q u) + (l v : Fin 2 → CutRing) + (hl : ∀ j, q j ≤ endpointLabel (l j) ∧ endpointLabel (l j) < q j+k) + (hv : ∀ j, q j ≤ endpointLabel (v j) ∧ endpointLabel (v j) < q j+k) + (hlen : ∀ j, ordinary (v j)-ordinary (l j) < 1) : + ∃ N : ℕ, 160 ≤ N ∧ ∀ n : ℕ, N ≤ n → ∀ g : B.CoordinateWindowLaw n, + ∀ (s : Fin 2 → ℕ) (hs : ∀ j, s j ≤ n) (p : Fin 2 → ℤ), + ∀ L V : Fin 2 → CutRing, + (∀ j, ordinary (L j) ≤ ordinary (V j)) → + (∀ j, p j ≤ endpointLabel (L j) ∧ endpointLabel (L j) < p j+s j) → + (∀ j, p j ≤ endpointLabel (V j) ∧ endpointLabel (V j) < p j+s j) → + ∀ (d : Fin 2) (e : Fin 5) (z : CutRing × CutRing), + (∀ j, ((pointLabel z j+q j-p j).natAbs:ℝ) ≤ (K+1)*(n:ℝ)) → + (∀ j, ordinary (l j)+ordinary (pointCoordinate z j) ≤ ordinary (L j)-δ) → + (∀ j, ordinary (V j)+δ ≤ ordinary (v j)+ordinary (pointCoordinate z j)) → + ∀ f : TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm), + B.AlignedSmallSupported f → + (∀ j, SmallControlled B.c f + (B.axisSector (by omega) n g j (s j) (hs j) (p j) (coordinateInterval a j (L j) (V j)))) → + SmallControlled B.c f (B.fullGeometricSector (by omega) + (translatedTemplate (tangentChartTemplate a k q d (signedShortSteps u e)) z) + (h d e z) (spatialTranslate z (coordinateRectangle a l v))) := by + obtain ⟨N,hN,hbridge⟩ := B.old_rectangle_bridge_control hlarge hK hδ + refine ⟨max N (8*k),le_trans hN (le_max_left _ _),?_⟩ + intro n hn g s hs p L V hLV hL hV d e z hpq hlo hup f hf hc + have hnN : N ≤ n := (le_max_left _ _).trans hn + have hkn : k ≤ n/8 := (Nat.le_div_iff_mul_le (by omega : 0 < 8)).mpr (by omega) + rw [B.tangentChartSector_eq_window (by omega) k q u h n (by omega) g d e z l v hl hv, + spatialTranslate_coordinateRectangle] + apply hbridge n hnN g s hs p (fun j => pointLabel z j+q j) hpq L V + (fun j => l j+pointCoordinate z j) (fun j => v j+pointCoordinate z j) hLV + · intro j + simpa only [map_add] using hlo j + · intro j + simpa only [map_add] using hup j + · intro j + simpa only [map_add,add_sub_add_right_eq_sub] using hlen j + · exact hL + · exact hV + · intro j + simp only [endpointLabel_add,pointLabel] + have hh := hl j + omega + · intro j + simp only [endpointLabel_add,pointLabel] + have hh := hv j + omega + · exact hf + · exact hc + +theorem tangent_chart_chain_control (hlarge : 20 ≤ m+1) + (hr : 0 < ordinary r ∧ ordinary r < 1/2) + {K δ : ℝ} (hK : 0 ≤ K) (hδ : 0 < δ) + (k : ℕ) (q : Fin 2 → ℤ) (u : CutRing) (h : B.TangentChartLaws k q u) + (l v : Fin 2 → CutRing) + (hl : ∀ j, q j ≤ endpointLabel (l j) ∧ endpointLabel (l j) < q j+k) + (hv : ∀ j, q j ≤ endpointLabel (v j) ∧ endpointLabel (v j) < q j+k) + (hlv : ∀ j, ordinary (l j) ≤ ordinary (v j)) + (hlen : ∀ j, ordinary (v j)-ordinary (l j) < 1) + (hbox : ∀ j, -ordinary r < ordinary (l j) ∧ ordinary (v j) < ordinary r) + (hbox' : ∀ (d : Fin 2) (e : Fin 5) (j : Fin 2), + -ordinary r < ordinary (l j)-ordinary (pointCoordinate (tangentOffset a d (signedShortSteps u e)) j) ∧ + ordinary (v j)-ordinary (pointCoordinate (tangentOffset a d (signedShortSteps u e)) j) < ordinary r) : + ∃ N : ℕ, 160 ≤ N ∧ ∀ n : ℕ, N ≤ n → ∀ g : B.CoordinateWindowLaw n, + ∀ (s : Fin 2 → ℕ) (hs : ∀ j, s j ≤ n) (p : Fin 2 → ℤ), + ∀ L V : Fin 2 → CutRing, + (∀ j, ordinary (L j) ≤ ordinary (V j)) → + (∀ j, p j ≤ endpointLabel (L j) ∧ endpointLabel (L j) < p j+s j) → + (∀ j, p j ≤ endpointLabel (V j) ∧ endpointLabel (V j) < p j+s j) → + ∀ (d : Fin 2) (T : ℕ) (z : ℕ → CutRing × CutRing) (e : ℕ → Fin 5), + (∀ i, i < T → z (i+1) = z i+tangentOffset a d (signedShortSteps u (e i))) → + (∀ i, i < T → ∀ j, ((pointLabel (z i) j+q j-p j).natAbs:ℝ) ≤ (K+1)*(n:ℝ)) → + (∀ i, i < T → ∀ j, ordinary (l j)+ordinary (pointCoordinate (z i) j) ≤ ordinary (L j)-δ) → + (∀ i, i < T → ∀ j, ordinary (V j)+δ ≤ ordinary (v j)+ordinary (pointCoordinate (z i) j)) → + ∀ f : TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm), + B.AlignedSmallSupported f → + (∀ j, SmallControlled B.c f + (B.axisSector (by omega) n g j (s j) (hs j) (p j) (coordinateInterval a j (L j) (V j)))) → + SmallControlled B.c f (B.tangentSign (by omega) k q u h d (z 0) true) → + SmallControlled B.c f (B.tangentSign (by omega) k q u h d (z T) true) := by + obtain ⟨N,hN,hbridge⟩ := B.old_rectangle_bridge_to_chart hlarge hK hδ k q u h l v hl hv hlen + refine ⟨N,hN,?_⟩ + intro n hn g s hs p L V hLV hL hV d T z e hz hpq hlo hup f hf hc hstart + apply small_control_action_chain B.c f + (fun i => B.tangentSign (by omega) k q u h d (z i) true) T hstart + intro i hi I t x hx + rw [hz i hi] + exact B.tangentSign_step_action hlarge hr k q u h d (e i) (z i) l v hl hv hlv hlen hbox + (hbox' d (e i)) f hf + (hbridge n hn g s hs p L V hLV hL hV d (e i) (z i) (hpq i hi) (hlo i hi) (hup i hi) f hf hc) + I t x hx + +end InitialCoverSystem +end ChartOverlapBridge + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/StarProjection.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/StarProjection.lean new file mode 100644 index 0000000000000000000000000000000000000000..192a15b00dab7ffe99ae0f630532b79ec71c2c85 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/StarProjection.lean @@ -0,0 +1,229 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.FormalCoordinates + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section ActualStarProjection +variable {a m : ℕ} {ι : Type*} [Finite ι] + +noncomputable def formalPolygonTable (U : ι → polygonAlgebra a) : + ((ι → Bool) → alternatingGroup (Fin (m+1))) →* polygonAlternatingGroup a (m+1) := + (actualPolygonTableHom U).comp (assignmentPullback (fun ω : Set.range (polygonAssignment U) => ω.val)) + +theorem formalPolygonTable_whole (U : ι → polygonAlgebra a) (s : alternatingGroup (Fin (m+1))) : + formalPolygonTable U (sectorMask Set.univ s) = conditionalAlternatingHom (wholePolygon a) s := by + change actualPolygonTableHom U _ = _ + have he : assignmentPullback (fun ω : Set.range (polygonAssignment U) => ω.val) + (sectorMask Set.univ s) = sectorMask Set.univ s := by + ext ω; simp [assignmentPullback,sectorMask] + rw [he] + exact actualPolygonTableHom_whole U s + +theorem formalPolygonTable_test (U : ι → polygonAlgebra a) (i : ι) (s : alternatingGroup (Fin (m+1))) : + formalPolygonTable U (sectorMask {σ | σ i = true} s) = conditionalAlternatingHom (U i) s := by + change actualPolygonTableHom U _ = _ + have he : assignmentPullback (fun ω : Set.range (polygonAssignment U) => ω.val) + (sectorMask {σ | σ i = true} s) = polygonTableInput U i s := by rfl + rw [he] + exact actualPolygonTableHom_input U i s + +theorem formalPolygonTable_eq_one (U : ι → polygonAlgebra a) + (f : (ι → Bool) → alternatingGroup (Fin (m+1))) (h : formalPolygonTable U f = 1) + (σ : ι → Bool) (hσ : σ ∈ Set.range (polygonAssignment U)) : f σ = 1 := by + have he := actualPolygonTableHom_injective U (h.trans (map_one _).symm) + exact congrFun he ⟨σ,hσ⟩ + +variable {E H : Type*} [Group E] [Group H] + +theorem actualStar_eval_projection (π : E →* alternatingGroup (Fin (m+1))) + (U : ι → polygonAlgebra a) (F : Option ι → E →* H) + (q : H →* polygonAlternatingGroup a (m+1)) + (hq : ∀ j, q.comp (F j) = + (conditionalAlternatingHom (match j with | none => wholePolygon a | some i => U i)).comp π) : + q.comp (copyFamilyEval F) = (formalPolygonTable U).comp (formalAssignmentEval π) := by + apply FreeGroup.ext_hom + rintro ⟨j,s⟩ + simp only [MonoidHom.comp_apply,copyFamilyEval_of,formalAssignmentEval,copySourceMap, + FreeGroup.map.of,assignmentEval] + have he := DFunLike.congr_fun (hq j) s + simp only [MonoidHom.comp_apply] at he + rw [he] + cases j with + | none => exact (formalPolygonTable_whole U (π s)).symm + | some i => exact (formalPolygonTable_test U i (π s)).symm + +end ActualStarProjection + +section PairProjection +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) {ι κ : Type*} [Finite ι] [Finite κ] + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + (hlarge : 15 < m+1) (P : ι → Fin 5 × (CutRing × CutRing)) + (h : ∀ i j I, I.card ≤ 15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb (primitivePair P i j)) + +omit [Finite ι] in +theorem pairStar_projection (j : Option ι) : + (coverMap M (alternatingGenerator a r m hm)).comp (B.pairStar hlarge P h j) = + (conditionalAlternatingHom (primitiveFamilyTests (a := a) (r := r) P j)).comp + (universalProjection (alternatingGroup (Fin (m+1)))) := by + cases j with + | none => + change (coverMap _ _).comp (B.c.comp _) = _ + rw [← MonoidHom.comp_assoc,B.c_projection] + rfl + | some i => + exact B.fullGeometricSector_projection hlarge _ _ _ (primitivePair_left_resolved P i i) + +omit [Finite ι] in + +theorem pairStar_subfamily_mem (v : κ → ι) + (hp : ∀ I, I.card ≤ 15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb (P ∘ v)) + (j : Option κ) (s : TrackStar (Fin (m+1))) : + B.pairStar hlarge P h (j.map v) s ∈ + (smallFamilyEval (B.smallPrimitiveInputs hlarge (P ∘ v))).range := by + cases j with + | none => exact B.constant_range_full hlarge (P ∘ v) ⟨_,rfl⟩ + | some j => + change B.fullGeometricSector hlarge (primitivePair P (v j) (v j)) (h (v j) (v j)) + (primitiveTests (a := a) (r := r) (primitivePair P (v j) (v j)) false) s ∈ _ + rw [B.fullGeometricSector_shared_primitive hlarge (primitivePair P (v j) (v j)) (P ∘ v) + false j rfl _ hp _ (resolved_test _ ())] + exact B.fullGeometricSector_mem hlarge _ hp _ s + +end InitialCoverSystem +end PairProjection + +section PairExclusionLocal +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) {ι κ : Type*} [Finite ι] [Finite κ] + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + (hlarge : 15 < m+1) (P : ι → Fin 5 × (CutRing × CutRing)) + (h : ∀ i j I, I.card ≤ 15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb (primitivePair P i j)) + +omit [Finite ι] in +theorem pairStar_subfamily_local (v : κ → ι) + (hp : ∀ I, I.card ≤ 15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb (P ∘ v)) + (w : FreeGroup (Option κ × TrackStar (Fin (m+1)))) + (hw : ((assignmentPullback (polygonAssignment (primitiveTests (a := a) (r := r) (P ∘ v)))).comp + (formalAssignmentEval (universalProjection (alternatingGroup (Fin (m+1)))))) w = 1) + (s : TrackStar (Fin (m+1))) : + Commute (copyFamilyEval (fun j => B.pairStar hlarge P h (j.map v)) w) + (B.pairStar hlarge P h none s) := by + let U := primitiveTests (a := a) (r := r) (P ∘ v) + let F := fun j : Option κ => B.pairStar hlarge P h (j.map v) + have hproj j : (coverMap M (alternatingGenerator a r m hm)).comp (F j) = + (conditionalAlternatingHom (match j with | none => wholePolygon a | some i => U i)).comp + (universalProjection (alternatingGroup (Fin (m+1)))) := by + rw [show F j = B.pairStar hlarge P h (j.map v) from rfl,B.pairStar_projection] + cases j <;> rfl + have he := DFunLike.congr_fun (actualStar_eval_projection + (universalProjection (alternatingGroup (Fin (m+1)))) U F _ hproj) w + simp only [MonoidHom.comp_apply] at he + have hz : (coverMap M (alternatingGenerator a r m hm)) (copyFamilyEval F w) = 1 := by + rw [he] + change actualPolygonTableHom U _ = 1 + have hz : assignmentPullback (fun ω : Set.range (polygonAssignment U) => ω.val) + (formalAssignmentEval (universalProjection (alternatingGroup (Fin (m+1)))) w) = 1 := by + funext ω + obtain ⟨p,hp⟩ := ω.property + have he := congrFun hw p + change formalAssignmentEval (universalProjection (alternatingGroup (Fin (m+1)))) w + (polygonAssignment U p) = 1 at he + simpa only [assignmentPullback,MonoidHom.coe_mk,OneHom.coe_mk,Function.comp_apply,hp,Pi.one_apply] using he + rw [hz,map_one] + have hm : (copyFamilyEval F).range ≤ (smallFamilyEval (B.smallPrimitiveInputs hlarge (P ∘ v))).range := by + rw [copyFamilyEval_range] + apply iSup_le + rintro j x ⟨t,rfl⟩ + exact B.pairStar_subfamily_mem hlarge P h v hp j t + exact (centralOn_iff _ _).mp (B.fullPrimitiveFamily_central hlarge (P ∘ v) hp) + _ (hm ⟨w,rfl⟩) hz _ (B.constant_range_full hlarge (P ∘ v) ⟨_,rfl⟩) + +end InitialCoverSystem +end PairExclusionLocal + +section PairActualLaw +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) {ι κ D : Type*} [Fintype ι] [Finite κ] + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + (hlarge : 15 < m+1) (P : ι → Fin 5 × (CutRing × CutRing)) + (h : ∀ i j I, I.card ≤ 15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb (primitivePair P i j)) + +include h in + +theorem pair_actual_central (h20 : 20 ≤ m+1) (v : D → κ → ι) + (hp : ∀ d I, I.card ≤ 15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb (P ∘ v d)) + (hexclude : ∀ σ : ι → Bool, + σ ∉ Set.range (polygonAssignment (primitiveTests (a := a) (r := r) P)) → + ∃ d, σ ∘ v d ∉ Set.range (polygonAssignment (primitiveTests (a := a) (r := r) (P ∘ v d)))) : + CentralOn (coverMap M (alternatingGenerator a r m hm)) + (smallFamilyEval (B.smallPrimitiveInputs hlarge P)).range := by + classical + let K := (smallFamilyEval (B.smallPrimitiveInputs hlarge P)).range + let : Group.IsPerfect K := smallFamilyEval_perfect _ + let π := universalProjection (alternatingGroup (Fin (m+1))) + let F := B.pairCarrierStar hlarge P h + let c := B.pairCarrierConstant hlarge P + let q := (coverMap M (alternatingGenerator a r m hm)).comp K.subtype + let U := primitiveTests (a := a) (r := r) P + obtain ⟨φ,hφ,hφc,hφi⟩ := B.pair_formal_quotient hlarge P h h20 + have hF : F none = c.comp π := rfl + have hgen : Function.Surjective (copyFamilyEval F) := by + apply MonoidHom.range_eq_top.mp + rw [copyFamilyEval_range] + exact codRestrict_iSup_top _ _ (B.pairStar_mem hlarge P h) (B.pairStar_range hlarge P h) + have hproj j : q.comp (F j) = + (conditionalAlternatingHom (match j with | none => wholePolygon a | some i => U i)).comp π := by + change (coverMap _ _).comp (B.pairStar hlarge P h j) = _ + rw [B.pairStar_projection] + cases j <;> rfl + have heval := actualStar_eval_projection π U F q hproj + apply formal_centralOn_of_exclusions π c F hF φ hφc hφi q + (Set.range (polygonAssignment U)) hgen + · intro w hw σ hσ + have he := DFunLike.congr_fun heval w + simp only [MonoidHom.comp_apply] at he + exact formalPolygonTable_eq_one U _ (he.symm.trans hw) σ hσ + · intro σ hσ + obtain ⟨d,hd⟩ := hexclude σ hσ + apply formal_exclusion_of_subfamily π c F hF φ hφ hφc hφi + (universalProjection_surjective _) (v d) σ + (polygonAssignment (primitiveTests (a := a) (r := r) (P ∘ v d))) hd + intro w hw t + apply Subtype.ext + have he := DFunLike.congr_fun (copyFamilyEval_comp (fun j => F (j.map (v d))) K.subtype) w + change copyFamilyEval (fun j => B.pairStar hlarge P h (j.map (v d))) w = + (copyFamilyEval (fun j => F (j.map (v d))) w).val at he + change (copyFamilyEval (fun j => F (j.map (v d))) w).val * B.pairStar hlarge P h none t = + B.pairStar hlarge P h none t * (copyFamilyEval (fun j => F (j.map (v d))) w).val + rw [← he] + exact (B.pairStar_subfamily_local hlarge P h (v d) (hp d) w hw t).eq + +include hlarge h in + +theorem pair_actual_law (h20 : 20 ≤ m+1) (v : D → κ → ι) + (hp : ∀ d I, I.card ≤ 15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb (P ∘ v d)) + (hexclude : ∀ σ : ι → Bool, + σ ∉ Set.range (polygonAssignment (primitiveTests (a := a) (r := r) P)) → + ∃ d, σ ∘ v d ∉ Set.range (polygonAssignment (primitiveTests (a := a) (r := r) (P ∘ v d)))) + (I : Finset (Fin (m+1))) (b : Fin (m+1)) (hb : b ∉ I) : B.PrimitiveFamilyLaw I b hb P := + (B.pair_actual_central hlarge P h h20 v hp hexclude).mono + (B.primitiveFamily_range_full_all hlarge P I b hb) + +end InitialCoverSystem +end PairActualLaw + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/TangentRectangleCommutation.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/TangentRectangleCommutation.lean new file mode 100644 index 0000000000000000000000000000000000000000..7c4783e8f1dfc494c3dd1e695ab6de4c86cb312c --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/TangentRectangleCommutation.lean @@ -0,0 +1,66 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Configurations.Rectangles +import OAI.GroupTheory.SimpleAmenable.CentralCovers.CoverUniformBridges + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section TangentRectangleCommutation +namespace InitialCoverSystem +variable {a m : ℕ} {r : CutRing} {hm : 2 ≤ m} + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + +theorem tangent_rectangle_commutation_uniform (hlarge : 20 ≤ m+1) + (hr : 0 < ordinary r ∧ ordinary r < 1/2) + (s u v : CutRing) (hs : 0 < ordinary s) (hsr : ordinary s < ordinary r/2) + (huv : u*v=1) + (hshort : (1+|ordinary (cutTau^a)|)*(|ordinary u|+|ordinary (cutTau*u)|) < ordinary s/4) + {A C D E : ℝ} (hA : 0 ≤ A) (hC : 0 ≤ C) (hD : 0 ≤ D) (hE : 0 ≤ E) : + ∃ N : ℕ, 160 ≤ N ∧ ∀ (M : ℕ) (B : InitialCoverSystem a r m hm M) + (_h : B.TangentChartLaws (symmetricWindowLength s) (symmetricWindowStart s) u), + ∀ n : ℕ, N ≤ n → ∀ g : B.CoordinateWindowLaw n, + ∀ (R S : LabelledRectangle n) (w : CutRing), + |ordinary w| ≤ A/(n:ℝ) → |(endpointLabel w:ℝ)| ≤ C*(n:ℝ) → + ∀ (d : Fin 2) (z : CutRing × CutRing), + (∀ j, |(pointLabel z j+symmetricWindowStart s j-R.start j:ℝ)| ≤ E*(n:ℝ)) → + (∀ j, |ordinary (R.lower j)-ordinary (pointCoordinate z j)| ≤ D/(n:ℝ)) → + (∀ j, |ordinary (R.upper j)-ordinary (pointCoordinate z j)| ≤ D/(n:ℝ)) → + Nonempty (R.ChartFit s z) → Nonempty (S.ChartFit s (z+tangentOffset a d w)) → + (∀ j, ordinary (signQuadrantLower s d true j)+ordinary (pointCoordinate z j) ≤ ordinary (R.lower j)) → + (∀ j, ordinary (R.upper j) ≤ ordinary (signQuadrantUpper s d true j)+ordinary (pointCoordinate z j)) → + (∀ j, ordinary (signQuadrantLower s d false j)+ordinary (pointCoordinate (z+tangentOffset a d w) j) ≤ ordinary (S.lower j)) → + (∀ j, ordinary (S.upper j) ≤ ordinary (signQuadrantUpper s d false j)+ordinary (pointCoordinate (z+tangentOffset a d w) j)) → + ∀ x y, Commute (B.rectangleCopy (by omega) g R x) (B.rectangleCopy (by omega) g S y) := by + obtain ⟨N,hN,htransport⟩ := tangent_transport_uniform_cover_uniform + (a := a) (hm := hm) hlarge hr s u v hs hsr huv hshort hA hC hD hE + refine ⟨N,hN,?_⟩ + intro M B h n hn g R S w hw hw' d z hp hlo hup hfit hfit' hRL hRU hSL hSU + obtain ⟨fit⟩ := hfit + obtain ⟨fit'⟩ := hfit' + have hsr' : ordinary s < ordinary r := by linarith [hr.1] + have hcR := B.rectangleCopy_quadrant_control hlarge hr s u ⟨hs,hsr'⟩ h g R d z true fit hRL hRU + have hcS := B.rectangleCopy_quadrant_control hlarge hr s u ⟨hs,hsr'⟩ h g S d + (z+tangentOffset a d w) false fit' hSL hSU + have hfinal := htransport M B h n hn g R.length R.length_le R.start R.lower R.upper + R.ordered R.lower_label R.upper_label w hw hw' d z hp hlo hup + (B.rectangleCopy (by omega) g R) (B.rectangleCopy_supported (by omega) g R) + (B.rectangleCopy_axes_control (by omega) g R) hcR + exact small_control_disjoint _ B.c B.constant_aligned B.disjoint_aligned + (by simpa using hlarge) _ _ _ _ + (B.rectangleCopy_supported (by omega) g R) (B.rectangleCopy_supported (by omega) g S) + (B.tangentSign_supported (by omega) _ _ u h d (z+tangentOffset a d w) true) + hfinal hcS (B.tangentSign_opposite_commute (by omega) _ _ u h d (z+tangentOffset a d w)) + +end InitialCoverSystem +end TangentRectangleCommutation + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/TemplateActualRelators.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/TemplateActualRelators.lean new file mode 100644 index 0000000000000000000000000000000000000000..7ddae5ef7854df06781d5ae3b1105ee01f7a7429 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/TemplateActualRelators.lean @@ -0,0 +1,158 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.TemplateRelators +import OAI.GroupTheory.SimpleAmenable.CentralCovers.FormalLaws + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section TemplateActualRelators +variable {E H Q ι Ω : Type*} [Group E] [Group H] [Group Q] [Group.IsPerfect E] +namespace ActualLawfulTable +variable {q : H →* Q} {v : (Ω → E) →* Q} (T : ActualLawfulTable q v) + +theorem template_relator_central_on (U : ι → Set Ω) (V : Set Ω) + (w : FreeGroup (Option ι × UniversalExtension E)) + (hw : ∀ ω ∈ V, formalAssignmentEval (universalProjection E) w (templateAssignment U ω)=1) : + copyFamilyEval (fun j : Option ι => T.sector (templateSides U V j)) w ∈ + Subgroup.centralizer (T.carrier : Set H) := by + let f := copyFamilyEval (fun j : Option ι => T.sector (templateSides U V j)) + have hf : f.range ≤ T.carrier := by + rw [copyFamilyEval_range] + apply iSup_le + rintro i y ⟨s,rfl⟩ + exact T.sector_mem _ _ + have hm : maskedAssignmentPullback (templateAssignment U) V + (formalAssignmentEval (universalProjection E) w)=1 := by + classical + ext ω + change (if ω ∈ V then _ else 1)=1 + split_ifs with hω + · exact hw ω hω + · rfl + have hq : q (f w)=1 := by + have hh := DFunLike.congr_fun (T.template_eval_projection U V) w + simpa only [MonoidHom.comp_apply,hm,map_one] using hh + have hc := T.law (show (⟨f w,hf ⟨w,rfl⟩⟩ : T.carrier) ∈ + (q.comp T.carrier.subtype).ker from hq) + intro x hx + exact congrArg Subtype.val (Subgroup.mem_center_iff.mp hc ⟨x,hx⟩) + +end ActualLawfulTable +end TemplateActualRelators + +section TemplateSupportedActualRelators +variable {α H Q ι Ω : Type*} [Fintype α] [DecidableEq α] [Group H] [Group Q] + [Group.IsPerfect (alternatingGroup α)] + +theorem template_supported_word_controls_on + (L : Finset α → Subgroup H) (hmono : Monotone L) (c : alternatingGroup α →* H) + (hc : ∀ σ I, ∀ x ∈ L I, c σ*x*(c σ)⁻¹ ∈ L (I.map σ.val.toEmbedding)) + (hd : ∀ I J, Disjoint I J → ∀ x ∈ L I, ∀ y ∈ L J, Commute x y) + {q : H →* Q} {v : (Ω → alternatingGroup α) →* Q} (T : ActualLawfulTable q v) + (U : ι → Set Ω) (V : Set Ω) + (hT : ∀ i : Option ι, SmallSupported L (T.sector (templateSides U V i))) + (f : TrackStar α →* H) (hf : SmallSupported L f) + (hcontrol : SmallControlled c f (T.sector V)) + (S : Finset α) (hS : S.card+10 ≤ Fintype.card α) + (w : SmallFamilyWord α ι) (hw : w ∈ smallFamilyLocal S) + (hrel : ∀ ω ∈ V, smallFamilyModel (fun i : ι => {σ : ι → Bool | σ i=true}) w + (templateAssignment U ω)=1) : + ∀ x ∈ f.range, Commute + (copyFamilyEval (fun i => T.sector (templateSides U V i)) (smallFamilyStarWord w)) x := by + have hm : ∀ ω ∈ V, formalAssignmentEval (universalProjection (alternatingGroup α)) + (smallFamilyStarWord w) (templateAssignment U ω)=1 := by + intro ω hω + have he := DFunLike.congr_fun (smallFamilyStarWord_model (α := α) (ι := ι)) w + exact (congrFun he (templateAssignment U ω)).trans (hrel ω hω) + have hz := T.template_relator_central_on U V _ hm + exact small_control_transfer L c hc hd f (T.sector V) hf hcontrol S _ + (smallFamilyStarWord_supported L hmono _ hT S w hw) hS + (fun J s => show Commute _ (T.sector V (universalMap (subtypeAlternatingHom J.val) s)) from + (hz _ (T.sector_mem _ _)).symm) + +end TemplateSupportedActualRelators + +section ActualTemplateActualWords + +theorem smallActualRelator_at {a : ℕ} {α ι : Type*} [Fintype α] [DecidableEq α] + (R : ι → polygonAlgebra a) (w : SmallFamilyWord α ι) + (hw : smallFamilyModel (actualTestMask R) w=1) + (σ : ι → Bool) (hσ : σ ∈ Set.range (polygonAssignment R)) : + smallFamilyModel (fun i : ι => {σ : ι → Bool | σ i=true}) w σ=1 := by + rw [smallActualModel_pullback] at hw + exact congrFun hw ⟨σ,hσ⟩ + +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) {ι κ : Type*} [Finite κ] + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + +theorem actual_template_actual_word_controls (hlarge : 25 ≤ m+1) + (P : κ → Fin 5 × (CutRing × CutRing)) + (h : ∀ I, I.card ≤ 15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb P) + (U : ι → polygonAlgebra a) (V : polygonAlgebra a) + (hU : ∀ i, ResolvedBy (fun j => (primitiveTests (a := a) (r := r) P j).val) (U i).val) + (hV : ResolvedBy (fun j => (primitiveTests (a := a) (r := r) P j).val) V.val) + (f : TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm)) + (hf : B.AlignedSmallSupported f) + (hc : SmallControlled B.c f (B.fullGeometricSector (by omega) P h V)) + (S : Finset (Fin (m+1))) (hS : S.card ≤ 15) + (w : SmallFamilyWord (Fin (m+1)) ι) (hw : w ∈ smallFamilyLocal S) + (R : ι → polygonAlgebra a) + (hreal : ∀ x ∈ V.val, polygonAssignment U x ∈ Set.range (polygonAssignment R)) + (hrel : smallFamilyModel (actualTestMask R) w=1) : + ∀ x ∈ f.range, Commute + (copyFamilyEval (fun i => B.fullGeometricSector (by omega) P h (marginFamily U V i)) + (smallFamilyStarWord w)) x := by + let masks := fun W : polygonAlgebra a => resolvedPolygonMask + (primitiveTests (a := a) (r := r) P) W.val + have he (i : Option ι) : masks (marginFamily U V i)=templateSides (fun i => masks (U i)) (masks V) i := by + cases i with + | none => rfl + | some i => exact resolvedPolygonMask_inter _ V.val (U i).val hV (hU i) + have hs i : SmallSupported (sourceAlignedGroup a r m hm M B.t) + ((B.fullPrimitiveTable (by omega) P h).sector + (templateSides (fun i => masks (U i)) (masks V) i)) := by + rw [← he i] + apply B.fullGeometricSector_supported + cases i with + | none => exact hV + | some i => exact fun x y hh => and_congr (hV x y hh) (hU i x y hh) + have hm : ∀ ω ∈ masks V, + smallFamilyModel (fun i : ι => {σ : ι → Bool | σ i=true}) w + (templateAssignment (fun i => masks (U i)) ω)=1 := by + rintro ⟨σ,x,rfl⟩ hx + have hxV := (resolvedPolygonMask_mem _ V.val hV x).mp hx + have he : templateAssignment (fun i => masks (U i)) + ⟨polygonAssignment (primitiveTests (a := a) (r := r) P) x,⟨x,rfl⟩⟩= + polygonAssignment U x := by + funext i + apply decide_eq_decide.mpr + exact resolvedPolygonMask_mem _ (U i).val (hU i) x + rw [he] + exact smallActualRelator_at R w hrel _ (hreal x hxV) + have hh := template_supported_word_controls_on _ (sourceAlignedGroup_mono B.t) + B.c B.constant_aligned B.disjoint_aligned (B.fullPrimitiveTable (by omega) P h) + (fun i => masks (U i)) (masks V) hs f hf hc S (by simp only [Fintype.card_fin]; omega) + w hw hm + have heval : (fun i => B.fullGeometricSector (by omega) P h (marginFamily U V i))= + (fun i => (B.fullPrimitiveTable (by omega) P h).sector + (templateSides (fun i => masks (U i)) (masks V) i)) := by + funext i + exact congrArg ((B.fullPrimitiveTable (by omega) P h).sector) (he i) + rw [heval] + exact hh + +end InitialCoverSystem +end ActualTemplateActualWords + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/TemplateFormalRelators.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/TemplateFormalRelators.lean new file mode 100644 index 0000000000000000000000000000000000000000..e4d31be4cdb9348671761840c0330aeadac7d436 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/TemplateFormalRelators.lean @@ -0,0 +1,163 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.PairControl +import OAI.GroupTheory.SimpleAmenable.CentralCovers.CentralRangeReflection + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section TemplateFormalRelators +variable {E H Q Ω ι : Type*} [Group E] [Group H] [Group Q] + +noncomputable def maskedAssignmentPullback (r : Ω → ι → Bool) (V : Set Ω) : + ((ι → Bool) → E) →* (Ω → E) := by + classical + exact { toFun := fun f ω => if ω ∈ V then f (r ω) else 1 + map_one' := by ext ω; simp + map_mul' := by intro f g; ext ω; by_cases h : ω ∈ V <;> simp [h] } + +noncomputable def templateSides (U : ι → Set Ω) (V : Set Ω) : Option ι → Set Ω + | none => V + | some i => V ∩ U i + +noncomputable def templateAssignment (U : ι → Set Ω) (ω : Ω) : ι → Bool := by + classical + exact fun i => decide (ω ∈ U i) + +theorem template_mask_eval (U : ι → Set Ω) (V : Set Ω) : + copyFamilyEval (fun j : Option ι => (sectorMask (templateSides U V j)).comp (universalProjection E)) = + (maskedAssignmentPullback (templateAssignment U) V).comp + (formalAssignmentEval (universalProjection E)) := by + classical + apply FreeGroup.ext_hom + rintro ⟨j,s⟩ + ext ω + cases j with + | none => + simp [copyFamilyEval_of,templateSides,formalAssignmentEval,assignmentEval, + copySourceMap,maskFamily,maskedAssignmentPullback,sectorMask]; rfl + | some i => + by_cases hV : ω ∈ V <;> by_cases hi : ω ∈ U i <;> + simp [copyFamilyEval_of,templateSides,formalAssignmentEval,assignmentEval, + copySourceMap,maskFamily,maskedAssignmentPullback,sectorMask,templateAssignment,hV,hi] + +namespace ActualLawfulTable +variable [Group.IsPerfect E] {q : H →* Q} {v : (Ω → E) →* Q} + (T : ActualLawfulTable q v) + +theorem template_eval_projection (U : ι → Set Ω) (V : Set Ω) : + q.comp (copyFamilyEval (fun j : Option ι => T.sector (templateSides U V j))) = + (v.comp (maskedAssignmentPullback (templateAssignment U) V)).comp + (formalAssignmentEval (universalProjection E)) := by + rw [MonoidHom.comp_assoc,← template_mask_eval] + apply FreeGroup.ext_hom + rintro ⟨j,s⟩ + simp only [MonoidHom.comp_apply,copyFamilyEval_of] + exact T.sector_projection_apply _ _ + +theorem template_relator_central (U : ι → Set Ω) (V : Set Ω) + (w : FreeGroup (Option ι × UniversalExtension E)) + (hw : formalAssignmentEval (universalProjection E) w=1) : + copyFamilyEval (fun j : Option ι => T.sector (templateSides U V j)) w ∈ + Subgroup.centralizer (T.carrier : Set H) := by + let f := copyFamilyEval (fun j : Option ι => T.sector (templateSides U V j)) + have hf : f.range ≤ T.carrier := by + rw [copyFamilyEval_range] + apply iSup_le + rintro i y ⟨s,rfl⟩ + exact T.sector_mem _ _ + have hq : q (f w)=1 := by + have hh := DFunLike.congr_fun (T.template_eval_projection U V) w + simpa only [MonoidHom.comp_apply,hw,map_one] using hh + have hc := T.law (show (⟨f w,hf ⟨w,rfl⟩⟩ : T.carrier) ∈ + (q.comp T.carrier.subtype).ker from hq) + intro x hx + exact congrArg Subtype.val (Subgroup.mem_center_iff.mp hc ⟨x,hx⟩) + +end ActualLawfulTable +end TemplateFormalRelators + +section TemplateControlledRelators +variable {E E' S S' H Ω ι : Type*} [Group E] [Group E'] [Group S] + [Group S'] [Group H] + +theorem copyFamilyEval_comp_source (F : Option ι → E →* H) (ψ : E' →* E) : + (copyFamilyEval F).comp (copySourceMap ψ)=copyFamilyEval (fun i => (F i).comp ψ) := by + apply FreeGroup.ext_hom + rintro ⟨i,x⟩ + simp [copySourceMap] + +theorem formalAssignmentEval_natural (π : E →* S) (π' : E' →* S') + (ψ : E' →* E) (ρ : S' →* S) (hπ : π.comp ψ=ρ.comp π') : + (formalAssignmentEval (ι := ι) π).comp (copySourceMap ψ)= + (assignmentPost ρ).comp (formalAssignmentEval π') := by + classical + apply FreeGroup.ext_hom + rintro ⟨i,x⟩ + ext σ + have hx := DFunLike.congr_fun hπ x + change π (ψ x)=ρ (π' x) at hx + cases i with + | none => + simpa [formalAssignmentEval,copySourceMap,assignmentEval,maskFamily,sectorMask, + assignmentPost] using hx + | some i => + cases hi : σ i <;> + simp [formalAssignmentEval,copySourceMap,assignmentEval,maskFamily,sectorMask, + assignmentPost,hi,hx] + +variable {α Q : Type*} [Fintype α] [DecidableEq α] [Group Q] + [Group.IsPerfect (alternatingGroup α)] + +theorem template_small_relator_controls + (L : Finset α → Subgroup H) (c : alternatingGroup α →* H) + (hc : ∀ σ I, ∀ x ∈ L I, c σ*x*(c σ)⁻¹ ∈ L (I.map σ.val.toEmbedding)) + (hd : ∀ I J, Disjoint I J → ∀ x ∈ L I, ∀ y ∈ L J, Commute x y) + (hα : 20 ≤ Fintype.card α) + {q : H →* Q} {v : (Ω → alternatingGroup α) →* Q} (T : ActualLawfulTable q v) + (U : ι → Set Ω) (V : Set Ω) + (hT : ∀ i : Option ι, SmallSupported L (T.sector (templateSides U V i))) + (f : TrackStar α →* H) (hf : SmallSupported L f) + (hcontrol : SmallControlled c f (T.sector V)) + (I : ControlAlphabet α) (w : FreeGroup (Option ι × UniversalExtension (alternatingGroup I.val))) + (hw : formalAssignmentEval (universalProjection (alternatingGroup I.val)) w=1) : + ∀ x ∈ f.range, Commute + (copyFamilyEval (fun i : Option ι => (T.sector (templateSides U V i)).comp + (universalMap (subtypeAlternatingHom I.val))) w) x := by + let ψ := universalMap (subtypeAlternatingHom I.val) + let F := fun i : Option ι => T.sector (templateSides U V i) + let u := copyFamilyEval (fun i => (F i).comp ψ) w + have hu : u ∈ L I.val := by + have he : (copyFamilyEval (fun i => (F i).comp ψ)).range ≤ L I.val := by + rw [copyFamilyEval_range] + apply iSup_le + intro i + exact hT i I + exact he ⟨w,rfl⟩ + have he : u=copyFamilyEval F (copySourceMap ψ w) := + (DFunLike.congr_fun (copyFamilyEval_comp_source F ψ) w).symm + have hw' : formalAssignmentEval (universalProjection (alternatingGroup α)) + (copySourceMap ψ w)=1 := by + have hh := DFunLike.congr_fun (formalAssignmentEval_natural + (universalProjection (alternatingGroup α)) (universalProjection (alternatingGroup I.val)) + ψ (subtypeAlternatingHom I.val) (universalMap_spec _)) w + simpa only [MonoidHom.comp_apply,hw,map_one] using hh + have hz : u ∈ Subgroup.centralizer (T.carrier : Set H) := by + rw [he] + exact T.template_relator_central U V _ hw' + exact small_control_transfer L c hc hd f (T.sector V) hf hcontrol I.val u hu + (by have hh := I.property.2; omega) + (fun J s => show Commute u (T.sector V (universalMap (subtypeAlternatingHom J.val) s)) from + (hz _ (T.sector_mem _ _)).symm) + +end TemplateControlledRelators + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/TemplateRelators.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/TemplateRelators.lean new file mode 100644 index 0000000000000000000000000000000000000000..c3e57128a1e3ff79cc902f65687995c8ac8360b8 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/TemplateRelators.lean @@ -0,0 +1,81 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.SmallStarRelators + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section ActualTemplateRelators + +theorem sourceAlignedGroup_mono {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (t : Multiplicative (FreeAbelianGroup (Fin m × Fin 2)) →* + BoundedRelationCover M (alternatingGenerator a r m hm)) : + Monotone (sourceAlignedGroup a r m hm M t) := by + intro I J hIJ + apply Subgroup.closure_mono + rintro y ⟨b,hb,u,rfl⟩ + exact ⟨b,hb.trans hIJ,u,rfl⟩ + +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) {ι κ : Type*} [Finite κ] + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + +noncomputable def marginFamily (U : ι → polygonAlgebra a) (V : polygonAlgebra a) : + Option ι → polygonAlgebra a + | none => V + | some i => V ⊓ U i + +theorem actual_template_word_controls (hlarge : 25 ≤ m+1) + (P : κ → Fin 5 × (CutRing × CutRing)) + (h : ∀ I, I.card ≤ 15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb P) + (U : ι → polygonAlgebra a) (V : polygonAlgebra a) + (hU : ∀ i, ResolvedBy (fun j => (primitiveTests (a := a) (r := r) P j).val) (U i).val) + (hV : ResolvedBy (fun j => (primitiveTests (a := a) (r := r) P j).val) V.val) + (f : TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm)) + (hf : B.AlignedSmallSupported f) + (hc : SmallControlled B.c f (B.fullGeometricSector (by omega) P h V)) + (S : Finset (Fin (m+1))) (hS : S.card ≤ 15) + (w : SmallFamilyWord (Fin (m+1)) ι) (hw : w ∈ smallFamilyLocal S) + (hrel : smallFamilyModel (fun i : ι => {σ : ι → Bool | σ i=true}) w=1) : + ∀ x ∈ f.range, Commute + (copyFamilyEval (fun i => B.fullGeometricSector (by omega) P h (marginFamily U V i)) + (smallFamilyStarWord w)) x := by + let masks := fun W : polygonAlgebra a => resolvedPolygonMask + (primitiveTests (a := a) (r := r) P) W.val + have he (i : Option ι) : masks (marginFamily U V i)=templateSides (fun i => masks (U i)) (masks V) i := by + cases i with + | none => rfl + | some i => exact resolvedPolygonMask_inter _ V.val (U i).val hV (hU i) + have hs i : SmallSupported (sourceAlignedGroup a r m hm M B.t) + ((B.fullPrimitiveTable (by omega) P h).sector + (templateSides (fun i => masks (U i)) (masks V) i)) := by + rw [← he i] + apply B.fullGeometricSector_supported + cases i with + | none => exact hV + | some i => exact fun x y hh => and_congr (hV x y hh) (hU i x y hh) + have hh := template_supported_word_controls _ (sourceAlignedGroup_mono B.t) + B.c B.constant_aligned B.disjoint_aligned (B.fullPrimitiveTable (by omega) P h) + (fun i => masks (U i)) (masks V) hs f hf hc S (by simp only [Fintype.card_fin]; omega) + w hw hrel + have heval : (fun i => B.fullGeometricSector (by omega) P h (marginFamily U V i))= + (fun i => (B.fullPrimitiveTable (by omega) P h).sector + (templateSides (fun i => masks (U i)) (masks V) i)) := by + funext i + exact congrArg ((B.fullPrimitiveTable (by omega) P h).sector) (he i) + rw [heval] + exact hh + +end InitialCoverSystem +end ActualTemplateRelators + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/TranslatedDisjoint.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/TranslatedDisjoint.lean new file mode 100644 index 0000000000000000000000000000000000000000..6299184b0217d6007f26bad152e553337f706e23 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/TranslatedDisjoint.lean @@ -0,0 +1,145 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.LiftedTranslationOrbits +import OAI.GroupTheory.SimpleAmenable.Arithmetic.LatticeRange +import OAI.GroupTheory.SimpleAmenable.Configurations.ConditionalTranslationStabilizers + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section TranslatedDisjoint + +theorem generator_commutations_eventually {α G : Type*} [Finite α] [Group G] + (f : α → G) : + ∃ L : ℕ, ∀ M : ℕ, L ≤ M → ∀ i j, Commute (f i) (f j) → + Commute (PresentedGroup.of i : BoundedRelationCover M f) (PresentedGroup.of j) := by + let β := {p : α × α // Commute (f p.1) (f p.2)} + obtain ⟨L,hL⟩ := finite_word_equalities_eventually f + (fun p : β => FreeGroup.of p.val.1 * FreeGroup.of p.val.2) + (fun p : β => FreeGroup.of p.val.2 * FreeGroup.of p.val.1) + (fun p => by simpa only [map_mul,FreeGroup.lift_apply_of] using p.property.eq) + refine ⟨L,fun M hM i j hij => ?_⟩ + have he := hL M hM ⟨(i,j),hij⟩ + change _*_ = _*_ + simpa only [map_mul,PresentedGroup.of] using he + +theorem lifted_common_shift_commute {A G H : Type*} [CommGroup A] [Group G] [Group H] + (q : A →* G) (t : A →* H) (x₁ x₂ : G) (y₁ y₂ : H) + (hc₁ : ∀ k, Commute (q k) x₁ → Commute (t k) y₁) + (hc₂ : ∀ k, Commute (q k) x₂ → Commute (t k) y₂) + (hy : Commute y₁ y₂) (u v w : A) + (hw₁ : q u*x₁*(q u)⁻¹ = q w*x₁*(q w)⁻¹) + (hw₂ : q v*x₂*(q v)⁻¹ = q w*x₂*(q w)⁻¹) : + Commute (t u*y₁*(t u)⁻¹) (t v*y₂*(t v)⁻¹) := by + rw [lifted_translation_orbit_independent q t x₁ y₁ hc₁ u w hw₁, + lifted_translation_orbit_independent q t x₂ y₂ hc₂ v w hw₂] + change _*_ = _*_ + calc + _ = t w*(y₁*y₂)*(t w)⁻¹ := by group + _ = t w*(y₂*y₁)*(t w)⁻¹ := by rw [hy.eq] + _ = _ := by group + +theorem conditionalHom_disjoint_alphabets {a m : ℕ} (U V : polygonAlgebra a) + (σ ρ : Equiv.Perm (Fin m)) (h : Disjoint σ.support ρ.support) : + Commute (conditionalHom U σ) (conditionalHom V ρ) := by + have hh := Equiv.Perm.Disjoint.commute (Equiv.Perm.disjoint_iff_disjoint_support.mpr h) + change _*_ = _*_ + apply Subtype.ext + apply Equiv.ext + intro p + change conditionalPerm U σ (conditionalPerm V ρ p) = + conditionalPerm V ρ (conditionalPerm U σ p) + have hp := DFunLike.congr_fun hh.eq p.1 + simp only [Equiv.Perm.mul_apply] at hp + by_cases hu : p.2 ∈ U.val <;> by_cases hv : p.2 ∈ V.val + all_goals simp [conditionalPerm,hu,hv,hp] + +variable (a : ℕ) (r : CutRing) (m : ℕ) (hm : 2 ≤ m) + +theorem source_disjoint_common_shift + (σ ρ : Equiv.Perm (Fin (m+1))) (hd : Disjoint σ.support ρ.support) + (hb : σ.support.card + ρ.support.card < m+1) + (U V : polygonAlgebra a) + (u v : Multiplicative (FreeAbelianGroup (Fin m × Fin 2))) : + ∃ w, sourceLatticeFullMap a r m hm u * conditionalHom U σ * + (sourceLatticeFullMap a r m hm u)⁻¹ = + sourceLatticeFullMap a r m hm w * conditionalHom U σ * + (sourceLatticeFullMap a r m hm w)⁻¹ ∧ + sourceLatticeFullMap a r m hm v * conditionalHom V ρ * + (sourceLatticeFullMap a r m hm v)⁻¹ = + sourceLatticeFullMap a r m hm w * conditionalHom V ρ * + (sourceLatticeFullMap a r m hm w)⁻¹ := by + classical + obtain ⟨d,hu⟩ := sourceLatticeFullMap_translation a r m hm u + obtain ⟨e,hv⟩ := sourceLatticeFullMap_translation a r m hm v + have hcard : (σ.support ∪ ρ.support).card < (Finset.univ : Finset (Fin (m+1))).card := by + simpa only [Finset.card_univ,Fintype.card_fin] using + lt_of_le_of_lt (Finset.card_union_le _ _) hb + obtain ⟨b,_,hbi⟩ := Finset.exists_mem_notMem_of_card_lt_card hcard + let z : Fin (m+1) → CutRing × CutRing := fun i => if i ∈ σ.support then d i else e i + obtain ⟨w,f,hw,hf⟩ := sourceLatticeFullMap_prescribed a r m hm + (σ.support ∪ ρ.support) b hbi z + refine ⟨w,?_,?_⟩ + · rw [hu,hw] + apply conditional_conjugation_support + intro i hi + have hi' : i ∈ σ.support := Equiv.Perm.mem_support.mpr hi + rw [hf i (Finset.mem_union_left _ hi')] + simp only [z,ite_eq_left hi'] + · rw [hv,hw] + apply conditional_conjugation_support + intro i hi + have hi' : i ∈ ρ.support := Equiv.Perm.mem_support.mpr hi + have hin : i ∉ σ.support := fun h => Finset.disjoint_left.mp hd h hi' + rw [hf i (Finset.mem_union_right _ hi')] + simp only [z,ite_eq_right hin] + +theorem source_translated_disjoint_eventually (hm' : 10 < m+1) : + ∃ L : ℕ, ∀ M : ℕ, L ≤ M → + ∃ t : Multiplicative (FreeAbelianGroup (Fin m × Fin 2)) →* + BoundedRelationCover M (alternatingGenerator a r m hm), + (∀ i, t (Multiplicative.ofAdd (FreeAbelianGroup.of i)) = PresentedGroup.of (Sum.inr i)) ∧ + (coverMap M (alternatingGenerator a r m hm)).comp t = sourceLatticeMap a r m hm ∧ + ∀ (j k : Fin 5) + (σ ρ : {σ : Equiv.Perm (Fin (m+1)) // + σ ∈ alternatingGroup (Fin (m+1)) ∧ σ.support.card ≤ 5}), + Disjoint σ.val.support ρ.val.support → ∀ u v, + Commute (t u * PresentedGroup.of (Sum.inl (j,σ)) * (t u)⁻¹) + (t v * PresentedGroup.of (Sum.inl (k,ρ)) * (t v)⁻¹) := by + obtain ⟨L₁,hL₁⟩ := source_centralizing_translation_lifts_eventually a r m hm + obtain ⟨L₂,hL₂⟩ := generator_commutations_eventually (alternatingGenerator a r m hm) + refine ⟨max L₁ L₂,fun M hM => ?_⟩ + obtain ⟨t,ht,htq,hc⟩ := hL₁ M (le_trans (le_max_left _ _) hM) + refine ⟨t,ht,htq,?_⟩ + intro j k σ ρ hd u v + have hy : Commute (PresentedGroup.of (Sum.inl (j,σ)) : + BoundedRelationCover M (alternatingGenerator a r m hm)) + (PresentedGroup.of (Sum.inl (k,ρ))) := by + apply hL₂ M (le_trans (le_max_right _ _) hM) + change _*_ = _*_ + apply Subtype.ext + exact (conditionalHom_disjoint_alphabets (initialTest a r j) + (initialTest a r k) σ.val ρ.val hd).eq + obtain ⟨w,hw₁,hw₂⟩ := source_disjoint_common_shift a r m hm σ.val ρ.val hd + (by have hσ := σ.property.2; have hρ := ρ.property.2; omega) + (initialTest a r j) (initialTest a r k) u v + apply lifted_common_shift_commute (sourceLatticeMap a r m hm) t + (alternatingGenerator a r m hm (Sum.inl (j,σ))) + (alternatingGenerator a r m hm (Sum.inl (k,ρ))) _ _ + (hc (Sum.inl (j,σ))) (hc (Sum.inl (k,ρ))) hy u v w + · apply Subtype.ext + exact hw₁ + · apply Subtype.ext + exact hw₂ + +end TranslatedDisjoint + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/UniformTangentTransport.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/UniformTangentTransport.lean new file mode 100644 index 0000000000000000000000000000000000000000..4970a44332a65f706b32b6f24a204409f6710aca --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/UniformTangentTransport.lean @@ -0,0 +1,166 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.StarAtomLaw +import OAI.GroupTheory.SimpleAmenable.Configurations.SymmetricCharts + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section UniformTangentTransport +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + +theorem tangent_transport_uniform (hlarge : 20 ≤ m+1) + (hr : 0 < ordinary r ∧ ordinary r < 1/2) + (s u v : CutRing) (hs : 0 < ordinary s) (hsr : ordinary s < ordinary r/2) + (huv : u*v=1) + (hshort : (1+|ordinary (cutTau^a)|)*(|ordinary u|+|ordinary (cutTau*u)|) < ordinary s/4) + (h : B.TangentChartLaws (symmetricWindowLength s) (symmetricWindowStart s) u) + {A C D E : ℝ} (hA : 0 ≤ A) (hC : 0 ≤ C) (hD : 0 ≤ D) (hE : 0 ≤ E) : + ∃ N : ℕ, 160 ≤ N ∧ ∀ n : ℕ, N ≤ n → ∀ g : B.CoordinateWindowLaw n, + ∀ (t : Fin 2 → ℕ) (ht : ∀ j, t j ≤ n) (p : Fin 2 → ℤ) (L V : Fin 2 → CutRing), + (∀ j, ordinary (L j) ≤ ordinary (V j)) → + (∀ j, p j ≤ endpointLabel (L j) ∧ endpointLabel (L j) < p j+t j) → + (∀ j, p j ≤ endpointLabel (V j) ∧ endpointLabel (V j) < p j+t j) → + ∀ w : CutRing, |ordinary w| ≤ A/(n:ℝ) → |(endpointLabel w:ℝ)| ≤ C*(n:ℝ) → + ∀ (d : Fin 2) (z₀ : CutRing × CutRing), + (∀ j, |(pointLabel z₀ j+symmetricWindowStart s j-p j:ℝ)| ≤ E*(n:ℝ)) → + (∀ j, |ordinary (L j)-ordinary (pointCoordinate z₀ j)| ≤ D/(n:ℝ)) → + (∀ j, |ordinary (V j)-ordinary (pointCoordinate z₀ j)| ≤ D/(n:ℝ)) → + ∀ f : TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm), + B.AlignedSmallSupported f → + (∀ j, SmallControlled B.c f + (B.axisSector (by omega) n g j (t j) (ht j) (p j) (coordinateInterval a j (L j) (V j)))) → + SmallControlled B.c f (B.tangentSign (by omega) (symmetricWindowLength s) + (symmetricWindowStart s) u h d z₀ true) → + SmallControlled B.c f (B.tangentSign (by omega) (symmetricWindowLength s) + (symmetricWindowStart s) u h d (z₀+tangentOffset a d w) true) := by + obtain ⟨K,hK,N₁,hN₁,hgeo⟩ := uniform_tangent_chart_geometry a u v s huv hs hshort hA hC hD hE + have hl := fun j => (symmetricWindow_labels s j).1 + have hv := fun j => (symmetricWindow_labels s j).2.2 + have hlen : ∀ _ : Fin 2, ordinary s-ordinary (-s) < 1 := by + intro j + rw [map_neg] + linarith [hr.2] + have hbox (j : Fin 2) : -ordinary r < ordinary (-s) ∧ ordinary s < ordinary r := by + rw [map_neg] + constructor <;> linarith [hr.1] + obtain ⟨N₂,hN₂,hchain⟩ := B.tangent_chart_chain_control hlarge hr hK + (by linarith : 0 < ordinary s/4) (symmetricWindowLength s) (symmetricWindowStart s) u h + (fun _ => -s) (fun _ => s) hl hv (fun _ => by rw [map_neg]; linarith) hlen hbox + (fun d e j => (symmetric_chart_overlap_boxes a r s u hs hsr hshort d e j).2) + refine ⟨max N₁ N₂,hN₂.trans (le_max_right _ _),?_⟩ + intro n hn g t ht p L V hLV hL hV w hw hw' d z₀ hp hLo hVo f hf hc hstart + have hn₁ : N₁ ≤ n := (le_max_left _ _).trans hn + have hn₂ : N₂ ≤ n := (le_max_right _ _).trans hn + obtain ⟨T,z,e,hz0,hzT,hstep,hpq,hlo,hup⟩ := hgeo n hn₁ w hw hw' d z₀ + (symmetricWindowStart s) p L V hp hLo hVo + have hh := hchain n hn₂ g t ht p L V hLV hL hV d T z e hstep + (fun i _ => hpq i) (fun i _ => by simpa only [map_neg] using hlo i) + (fun i _ => hup i) f hf hc (by simpa only [hz0] using hstart) + simpa only [hzT] using hh + +end InitialCoverSystem +end UniformTangentTransport + +section ContainingChartWindow +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + +theorem tangentChartSector_eq_containing_window (hlarge : 15 < m+1) + (k : ℕ) (q : Fin 2 → ℤ) (u : CutRing) (h : B.TangentChartLaws k q u) + (n : ℕ) (g : B.CoordinateWindowLaw n) (p : Fin 2 → ℤ) + (d : Fin 2) (e : Fin 5) (z : CutRing × CutRing) + (hstart : ∀ j, p j ≤ pointLabel z j+q j) + (hend : ∀ j, pointLabel z j+q j+k ≤ p j+n) + (l v : Fin 2 → CutRing) + (hl : ∀ j, q j ≤ endpointLabel (l j) ∧ endpointLabel (l j) < q j+k) + (hv : ∀ j, q j ≤ endpointLabel (v j) ∧ endpointLabel (v j) < q j+k) : + B.fullGeometricSector hlarge + (translatedTemplate (tangentChartTemplate a k q d (signedShortSteps u e)) z) (h d e z) + (spatialTranslate z (coordinateRectangle a l v)) = + B.windowSector hlarge n g p (spatialTranslate z (coordinateRectangle a l v)) := by + apply B.chartCoordinateSector_eq_window hlarge n g p + _ (h d e z) Sum.inr Prod.fst (fun i => z+(coordinateWindowPrimitives k q i).2) + · intro i + rfl + · intro i + change p i.1 ≤ pointLabel (z+(coordinateWindowPrimitives k q i).2) i.1 + simp only [pointLabel_add,coordinateWindow_pointLabel] + have hh := hstart i.1 + omega + · intro i + change pointLabel (z+(coordinateWindowPrimitives k q i).2) i.1 < p i.1+(n-1:ℕ) + simp only [pointLabel_add,coordinateWindow_pointLabel] + have hi := i.2.isLt + have hh := hend i.1 + omega + · intro x y he + apply (translatedTemplate_resolved (a := a) (r := r) (coordinateWindowPrimitives k q) + (coordinateRectangle a l v) (fun x y he => and_congr + (coordinateLabelWindow_resolved k q 0 (l 0) (v 0) (hl 0) (hv 0) x y he) + (coordinateLabelWindow_resolved k q 1 (l 1) (v 1) (hl 1) (hv 1) x y he)) z) x y + simpa only [primitiveTests,primitiveFamilyTests,translatedTemplate,coordinateWindowPrimitives, + initialTest_coordinate] using he + +theorem tangentSign_supported (hlarge : 15 < m+1) + (k : ℕ) (q : Fin 2 → ℤ) (u : CutRing) (h : B.TangentChartLaws k q u) + (d : Fin 2) (z : CutRing × CutRing) (positive : Bool) : + B.AlignedSmallSupported (B.tangentSign hlarge k q u h d z positive) := by + unfold tangentSign + apply B.fullGeometricSector_supported + have hh := tangentChart_first_resolved (a := a) (r := r) (k := k) q d (signedShortSteps u 0) z + cases positive with + | false => exact fun x y he => not_congr (hh x y he) + | true => exact hh + +theorem tangentSign_control_from_rectangle (hlarge : 20 ≤ m+1) + (k : ℕ) (q : Fin 2 → ℤ) (u : CutRing) (h : B.TangentChartLaws k q u) + (n : ℕ) (g : B.CoordinateWindowLaw n) (p : Fin 2 → ℤ) + (d : Fin 2) (z : CutRing × CutRing) (positive : Bool) + (hstart : ∀ j, p j ≤ pointLabel z j+q j) + (hend : ∀ j, pointLabel z j+q j+k ≤ p j+n) + (l v : Fin 2 → CutRing) + (hl : ∀ j, q j ≤ endpointLabel (l j) ∧ endpointLabel (l j) < q j+k) + (hv : ∀ j, q j ≤ endpointLabel (v j) ∧ endpointLabel (v j) < q j+k) + (hside : coordinateRectangle a l v ≤ if positive then clippedSlopePrimitive a r (slopeDirection d) + else (clippedSlopePrimitive a r (slopeDirection d))ᶜ) + (R : polygonAlgebra a) (hR : R ≤ spatialTranslate z (coordinateRectangle a l v)) + (f : TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm)) + (hf : B.AlignedSmallSupported f) + (hc : SmallControlled B.c f (B.windowSector (by omega) n g p R)) : + SmallControlled B.c f (B.tangentSign (by omega) k q u h d z positive) := by + let P := translatedTemplate (tangentChartTemplate a k q d (signedShortSteps u 0)) z + let V := spatialTranslate z (coordinateRectangle a l v) + have hV : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) P i).val) V.val := + tangentChart_rectangle_resolved q d _ z l v hl hv + have he := B.tangentChartSector_eq_containing_window (by omega) k q u h n g p d 0 z hstart hend l v hl hv + have hcV : SmallControlled B.c f (B.fullGeometricSector (by omega) P (h d 0 z) V) := by + rw [he] + refine B.control_trans hlarge f (B.windowSector (by omega) n g p R) _ hf ?_ hc ?_ + · rw [← he] + exact B.fullGeometricSector_supported (by omega) P (h d 0 z) V hV + · exact B.fullGeometricSector_small_control (by omega) _ _ R V hR + apply B.control_trans hlarge f _ _ hf (B.tangentSign_supported (by omega) k q u h d z positive) hcV + unfold tangentSign + apply B.fullGeometricSector_small_control + cases positive with + | false => exact spatialTranslate_mono z hside + | true => exact spatialTranslate_mono z hside + +end InitialCoverSystem +end ContainingChartWindow + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/WholeCoverCentrality.lean b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/WholeCoverCentrality.lean new file mode 100644 index 0000000000000000000000000000000000000000..41cfccfc1c787e839b8d31921258b402dd5467de --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/CentralCovers/WholeCoverCentrality.lean @@ -0,0 +1,181 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.FiniteSlotRefinement +import OAI.GroupTheory.SimpleAmenable.CentralCovers.PrimitiveCentralLaws +import OAI.GroupTheory.SimpleAmenable.RandomFields.RecoveredConstantCovariance +import OAI.GroupTheory.SimpleAmenable.Configurations.SlotInputGeneration + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section WholeCoverCentrality +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + (hlarge : 15 < m+1) (h : B.AllPrimitiveLaws) (hr : 0 (B.polygonStar hlarge h hr W).range) + (initialTest a r b.1) + refine ⟨universalMap (subtypeAlternatingHom I.val) (universalMap (orderedTrackHom ι) t),?_⟩ + rw [show B.polygonStar hlarge h hr (initialTest a r b.1) + (universalMap (subtypeAlternatingHom I.val) (universalMap (orderedTrackHom ι) t)) = + B.initialAlphabet I.val b.1 (universalProjection _ (universalMap (orderedTrackHom ι) t)) from + DFunLike.congr_fun (B.polygonStar_initial_alphabet hlarge h hr b.1 I) _] + rw [show universalProjection _ (universalMap (orderedTrackHom ι) t)=orderedTrackHom ι s from + (DFunLike.congr_fun (universalMap_spec (orderedTrackHom ι)) t).trans (by rw [MonoidHom.comp_apply,ht])] + change B.initialConditional b.1 (subtypeAlternatingHom (orderedTrackAlphabet ι) (orderedTrackHom ι s))=_ + have hh := DFunLike.congr_fun (orderedTrackHom_comp ι) s + change subtypeAlternatingHom (orderedTrackAlphabet ι) (orderedTrackHom ι s) = fiveAlternatingHom ι s at hh + rw [hh,hs,B.initialConditional_input _ _ b.2.property.2] + rfl + +variable (R : alternatingGroup (Fin (m+1)) → + Multiplicative (FreeAbelianGroup (Fin m × Fin 2)) →* + Multiplicative (FreeAbelianGroup (Fin m × Fin 2))) + (hR : ∀ s k, B.c s * B.t k * (B.c s)⁻¹ = B.t (R s k)) + (hwide : 100 ≤ m+1) +include R hR + +theorem uniformSlotTransport_initial (b : SmallConditional m) : + B.UniformSlotTransport hlarge h hr hwide (PresentedGroup.of (Sum.inl b)) := by + intro V i k u v htr hi hk + have hspatial : ∀ (j : Fin 5) (x : V.val), translate a (u j) x.val=translate a (v j) x.val := by + intro j x + have he := congrArg Prod.snd (htr j x) + have hp := coverMap_of M (alternatingGenerator a r m hm) (Sum.inl b) + have hh := congrArg (fun g : polygonAlternatingGroup a (m+1) => + (g.val.val (i j,translate a (u j) x.val)).2) hp + exact hh.symm.trans he + have heq : SlotMap a (m+1) V (fun j => (k j,u j))= + SlotMap a (m+1) V (fun j => (k j,v j)) := by + funext p + exact congrArg (fun z => (k p.1,z)) (hspatial p.1 p.2) + have hk' : Function.Injective (SlotMap a (m+1) V (fun j => (k j,u j))) := by + rw [heq]; exact hk + have htr' : ∀ (j : Fin 5) (x : V.val), + (coverMap M (alternatingGenerator a r m hm) (PresentedGroup.of (Sum.inl b))).val.val + (i j,translate a (u j) x.val)=(k j,translate a (u j) x.val) := by + intro j x + exact (htr j x).trans (congrArg (fun z => (k j,z)) (hspatial j x).symm) + have ht := B.slotStar_aligned_transport hlarge h hr R hR hwide V i k u hi hk' + b.2.val.support b.2.property.2 (PresentedGroup.of (Sum.inl b)) + (B.initial_input_mem_polygonStars hlarge h hr b) + (alignedGroup_input B.t _ _ b (Finset.Subset.refl _)) htr' + exact ht.trans (B.slotStar_parameterwise hlarge h hr R hR hwide V k k u v hk' hk + (fun j x => congrArg (fun z => (k j,z)) (hspatial j x))) + +theorem uniformSlotTransport_lattice + (k₀ : Multiplicative (FreeAbelianGroup (Fin m × Fin 2))) : + B.UniformSlotTransport hlarge h hr hwide (B.t k₀) := by + intro V i k u v htr hi hk + let d := sourceLatticeOffsets m (Multiplicative.toAdd k₀) + let u' := fun j => d (i j)+u j + have hi' := SlotMap_shift_injective V i u hi d + have ht := B.slotStar_translation_lattice hlarge h hr R hR hwide + (Multiplicative.toAdd k₀) V i u hi + apply ht.trans + apply B.slotStar_parameterwise hlarge h hr R hR hwide V i k u' v hi' hk + intro j x + have he := htr j x + rw [show coverMap M (alternatingGenerator a r m hm) (B.t k₀)=sourceLatticeMap a r m hm k₀ from + DFunLike.congr_fun B.t_projection k₀] at he + change (sourceLatticeFullMap a r m hm k₀).val (i j,translate a (u j) x.val)=_ at he + have hp := congrArg (fun g : polygonFullGroup a (m+1) => + g.val (i j,translate a (u j) x.val)) + (sourceLatticeFullMap_offsets a r m hm (Multiplicative.toAdd k₀)) + have hh := hp.symm.trans he + change (i j,translate a (d (i j)) (translate a (u j) x.val))=_ at hh + simpa only [u',translate_add] using hh + +theorem uniformSlotTransport_all + (z : BoundedRelationCover M (alternatingGenerator a r m hm)) : + B.UniformSlotTransport hlarge h hr hwide z := by + change z ∈ B.slotTransportSubgroup hlarge h hr hwide R hR + apply PresentedGroup.generated_by _ (B.slotTransportSubgroup hlarge h hr hwide R hR) _ z + intro j + cases j with + | inl b => exact B.uniformSlotTransport_initial hlarge h hr R hR hwide b + | inr k => + have he := B.uniformSlotTransport_lattice hlarge h hr R hR hwide + (Multiplicative.ofAdd (FreeAbelianGroup.of k)) + rw [B.t_base] at he + exact he + +include hlarge h hr hwide + +theorem coverMap_kernel_central : + (coverMap M (alternatingGenerator a r m hm)).ker ≤ + Subgroup.center (BoundedRelationCover M (alternatingGenerator a r m hm)) := by + intro w hw + have hw' : coverMap M (alternatingGenerator a r m hm) w=1 := hw + have hc : ∀ z∈ B.slotGroup hlarge h hr hwide, Commute w z := by + intro z hz + induction hz using Subgroup.closure_induction with + | mem z hz => + obtain ⟨V,i,u,hi,s,rfl⟩ := hz + have he := B.uniformSlotTransport_all hlarge h hr R hR hwide w V i i u u + (by intro j x; rw [hw']; rfl) hi hi + have hh := DFunLike.congr_fun he s + change w*B.slotStar hlarge h hr hwide V i u hi s*w⁻¹= + B.slotStar hlarge h hr hwide V i u hi s at hh + exact mul_inv_eq_iff_eq_mul.mp hh + | one => exact Commute.one_right w + | mul x y _ _ hx hy => exact hx.mul_right hy + | inv x _ hx => exact hx.inv_right + rw [Subgroup.mem_center_iff] + intro z + have hh : z∈B.slotGroup hlarge h hr hwide := by + rw [B.slotGroup_eq_top hlarge h hr R hR hwide] + trivial + exact (hc z hh).eq.symm + +end InitialCoverSystem +end WholeCoverCentrality + +section SourceCentralCover + +theorem source_cover_centrality {a m : ℕ} {r : CutRing} (hm : 2 ≤ m) + (ha : 0 face_smul i g.val x) (fun g x => face_smul j g.val x) + f (fun g => alternating_transitive f g hm) + +lemma altFace_H0_isIso (a m p : ℕ) (hm : 3*(p+1)+1 < m) (i : Fin (p+1)) : + IsIso ((groupHomology.functor ℤ (polygonAlternatingGroup a m) 0).map (altFaceHom a m p i)) := by + let f := standardLE a m (p+1) (by omega : p+1 ≤ m) + exact TransitiveInduction.isIso_map_equivariant_H0 (G:=polygonAlternatingGroup a m) + (face i) (fun g x => face_smul i g.val x) f + (fun g => alternating_transitive f g hm) (fun g => alternating_transitive _ g (by omega)) + +lemma altBoundary_two_H0_isIso (a m : ℕ) (hm : 10 < m) : + IsIso ((groupHomology.functor ℤ (polygonAlternatingGroup a m) 0).map (altBoundary a m 2)) := by + have he : altBoundary a m 2=altFaceHom a m 2 0-altFaceHom a m 2 1+altFaceHom a m 2 2 := by + change (Rep.resFunctor _).map (boundary a m 2)=_ + rw [boundary_three, Functor.map_add, Functor.map_sub] + rw [he, Functor.map_add, Functor.map_sub, + altFace_H0_eq a m 2 (by omega) 1 0, altFace_H0_eq a m 2 (by omega) 2 0, + sub_self,zero_add] + exact altFace_H0_isIso a m 2 hm 0 + +lemma altColumn_H1_isZero (a p n : ℕ) (hn : 32 ≤ n) (hm : 3*p+1 < p+n) : + IsZero (groupHomology (altColumn a (p+n) p) 1) := by + have := alternatingStabilizer_perfect a p n hn + exact (TrivialHomology.H1_isZero_of_perfect + (G:=MulAction.stabilizer (polygonAlternatingGroup a (p+n)) (standard a p n))).of_iso + (alternatingOrbitHomologyIso a p n hm 1) + +lemma altBoundary_zero_H2_epi (a m : ℕ) (hm : 34 ≤ m) : + Epi ((groupHomology.functor ℤ (polygonAlternatingGroup a m) 2).map (altBoundary a m 0)) := by + have := altBoundary_zero_epi a m (by omega) + have : IsIso (BoundedHomologyEdge.Hmap 0 (altBoundary a m 2)) := + altBoundary_two_H0_isIso a m (by omega) + have hz : IsZero (groupHomology (altColumn a m 2) 1) := by + have he : m=2+(m-2) := by omega + rw [he] + exact altColumn_H1_isZero a 2 (m-2) (by omega) (by omega) + exact BoundedHomologyEdge.chain_H2_epi (altBoundary a m 0) (altBoundary a m 1) + (altBoundary a m 2) (altBoundary_square a m 0) (altBoundary_square a m 1) + (altBoundary_exact a m 0 (by omega) (by omega)) + (altBoundary_exact a m 1 (by omega) (by omega)) hz + +end PolygonPlacement.Configuration +end SimpleAmenable + +end + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Configurations/BooleanStages.lean b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/BooleanStages.lean new file mode 100644 index 0000000000000000000000000000000000000000..6c2b597704110cf3d8edc35a0246bdeb4ce50891 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/BooleanStages.lean @@ -0,0 +1,179 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.PolygonDiagramRefinement +import OAI.GroupTheory.SimpleAmenable.Configurations.TrajectoryLabels + +namespace OAI + +section + +section + +open Classical Set CategoryTheory +namespace SimpleAmenable.PolygonObject + +structure BooleanPartition (a : ℕ) where + size : ℕ + color : GenericSquare a → Fin size + onto : Function.Surjective color + polygon : ∀ b, {x | color x=b}∈polygonAlgebra a + +namespace BooleanPartition +variable {a : ℕ} +noncomputable def cell (P : BooleanPartition a) (b : Fin P.size) : polygonAlgebra a := + ⟨_,P.polygon b⟩ +noncomputable def point (P : BooleanPartition a) (b : Fin P.size) : GenericSquare a := + (P.onto b).choose +@[simp] theorem color_point (P : BooleanPartition a) (b : Fin P.size) : + P.color (P.point b)=b := (P.onto b).choose_spec + +variable {ι : Type} [Fintype ι] (S : ι → polygonAlgebra a) +noncomputable def signature (x : GenericSquare a) : ι → Bool := fun i => decide (x∈(S i).val) + +theorem signature_fiber (b : ι → Bool) : {x | signature S x=b}∈polygonAlgebra a := by + have he : {x | signature S x=b} = ⋂ i, if b i then (S i).val else (S i).valᶜ := by + ext x + simp only [Set.mem_ofPred_eq,Set.mem_iInter] + constructor + · intro h i + have hx := congrFun h i + cases hb : b i <;> simp_all [signature] + · intro h + funext i + have hi := h i + cases hb : b i <;> simp_all [signature] + rw [he] + apply BooleanSubalgebra.iInf_mem + intro i + split_ifs + · exact (S i).property + · exact (polygonAlgebra a).compl_mem (S i).property + +noncomputable def generated : BooleanPartition a where + size := Fintype.card (Set.range (signature S)) + color x := Fintype.equivFin (Set.range (signature S)) ⟨_,⟨x,rfl⟩⟩ + onto b := by + obtain ⟨x,hx⟩ := ((Fintype.equivFin (Set.range (signature S))).symm b).property + refine ⟨x,?_⟩ + apply (Equiv.eq_symm_apply _).mp + exact Subtype.ext hx + polygon b := by + convert signature_fiber S (((Fintype.equivFin (Set.range (signature S))).symm b).val) using 1 + ext x + simp only [Set.mem_ofPred_eq] + rw [← Equiv.eq_symm_apply,Subtype.ext_iff] + +theorem generated_constant {x y : GenericSquare a} + (h : (generated S).color x=(generated S).color y) (i : ι) : + x∈(S i).val ↔ y∈(S i).val := by + have h' := congrArg (fun z : Set.range (signature S) => z.val) + ((Fintype.equivFin (Set.range (signature S))).injective h) + have hi := congrFun h' i + by_cases hx : x∈(S i).val <;> by_cases hy : y∈(S i).val <;> simp_all [signature] + +theorem exists_common (S : ι → polygonAlgebra a) : + ∃ P : BooleanPartition a, ∀ i x y, P.color x=P.color y → + (x∈(S i).val ↔ y∈(S i).val) := + ⟨generated S,fun i _ _ h => generated_constant S h i⟩ + +end BooleanPartition +end SimpleAmenable.PolygonObject + +end + +section + +open Classical Set CategoryTheory +namespace SimpleAmenable.PolygonObject + +namespace Labelled +variable {a n : ℕ} + +noncomputable def forget : Labelled a n ⥤ PolygonObject a where + obj U := U.polygon + map f := f.arrow + +@[simp] lemma inv_arrow {U V : Labelled a n} (f : U ⟶ V) : + (inv f).arrow=inv f.arrow := (forget (a:=a) (n:=n)).map_inv f + +def ObjectUniform (P : BooleanPartition a) (U : Labelled a n) : Prop := + ∀ j x y, P.color x=P.color y → (x∈(U.polygon.cell j).val ↔ y∈(U.polygon.cell j).val) + +def ArrowUniform (P : BooleanPartition a) {U V : Labelled a n} (f : U ⟶ V) : Prop := + ∀ x y, x.val.1=y.val.1 → P.color x.val.2=P.color y.val.2 → + (f.arrow.toEquiv x).val.1=(f.arrow.toEquiv y).val.1 + +lemma arrowUniform_id (P : BooleanPartition a) (U : Labelled a n) : + ArrowUniform P (𝟙 U) := fun _ _ h _ => h + +lemma arrowUniform_comp (P : BooleanPartition a) {U V W : Labelled a n} + {f : U ⟶ V} {g : V ⟶ W} (hf : ArrowUniform P f) (hg : ArrowUniform P g) : + ArrowUniform P (f≫g) := by + intro x y h hP + apply hg + · exact hf x y h hP + · rw [f.positional x,f.positional y] + exact hP + +lemma arrowUniform_inv (P : BooleanPartition a) {U V : Labelled a n} + (hU : ObjectUniform P U) {f : U ⟶ V} (hf : ArrowUniform P f) : + ArrowUniform P (inv f) := by + intro x y h hP + let x' := (inv f).arrow.toEquiv x + let y' := (inv f).arrow.toEquiv y + have hx : x'.val.2=x.val.2 := (inv f).positional x + have hy : y'.val.2=y.val.2 := (inv f).positional y + have hmem : y.val.2∈(U.polygon.cell x'.val.1).val := + (hU x'.val.1 x'.val.2 y.val.2 (by rw [hx]; exact hP)).mp x'.property + let z : U.polygon.Point := ⟨(x'.val.1,y.val.2),hmem⟩ + have htrack : (f.arrow.toEquiv z).val.1=y.val.1 := by + have h' := hf z x' rfl (by simp only [z,hx]; exact hP.symm) + rw [show f.arrow.toEquiv x'=x from by + dsimp only [x']; rw [inv_arrow,inv_arrow_apply,Equiv.apply_symm_apply]] at h' + exact h'.trans h + have hz : f.arrow.toEquiv z=y := by + apply Subtype.ext + exact Prod.ext htrack (f.positional z) + have he : z=y' := by + apply f.arrow.toEquiv.injective + rw [hz] + dsimp only [y']; rw [inv_arrow,inv_arrow_apply,Equiv.apply_symm_apply] + change x'.val.1=y'.val.1 + have ht := congrArg (fun w : U.polygon.Point => w.val.1) he + exact ht + +variable {κ τ : Type} [Fintype κ] [Fintype τ] + (U : κ → Labelled a n) (src dst : τ → κ) (f : ∀t,U (src t) ⟶ U (dst t)) + +theorem exists_uniform_partition : + ∃ P : BooleanPartition a, (∀ k,ObjectUniform P (U k)) ∧ + (∀ t,ArrowUniform P (f t)) := by + let I := (Σ k,Fin (U k).polygon.tracks) ⊕ + (Σ t,Fin (U (src t)).polygon.tracks × Fin (U (dst t)).polygon.tracks) + let S : I → polygonAlgebra a := Sum.elim + (fun kj => (U kj.1).polygon.cell kj.2) + (fun tij => ⟨{x | ∃hx : x∈((U (src tij.1)).polygon.cell tij.2.1).val, + ((f tij.1).arrow.toEquiv ⟨(tij.2.1,x),hx⟩).val.1=tij.2.2}, + targetTrack_fiber_polygon (f tij.1).arrow tij.2.1 tij.2.2⟩) + obtain ⟨P,hP⟩ := BooleanPartition.exists_common S + refine ⟨P,?_,?_⟩ + · intro k j x y h + exact hP (.inl ⟨k,j⟩) x y h + · intro t x y h hxy + have h' := hP (.inr ⟨t,x.val.1,(f t).arrow.toEquiv x |>.val.1⟩) x.val.2 y.val.2 hxy + have hx : x.val.2∈(S (.inr ⟨t,x.val.1,(f t).arrow.toEquiv x |>.val.1⟩)).val := + ⟨x.property,rfl⟩ + obtain ⟨hy,he⟩ := h'.mp hx + have hpt : (⟨(x.val.1,y.val.2),hy⟩ : (U (src t)).polygon.Point)=y := by + apply Subtype.ext + exact Prod.ext h rfl + rw [hpt] at he + exact he.symm + +end Labelled +end SimpleAmenable.PolygonObject + +end + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Configurations/CellFiber.lean b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/CellFiber.lean new file mode 100644 index 0000000000000000000000000000000000000000..c02d81386d296ff9e05ed524481edaf97e33cf12 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/CellFiber.lean @@ -0,0 +1,204 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Configurations.StageFiberSum +import OAI.GroupTheory.SimpleAmenable.Simplicial.TripleComposition +import OAI.GroupTheory.SimpleAmenable.Configurations.EmptyStage +import OAI.GroupTheory.SimpleAmenable.Configurations.PointFiberEvaluation +import OAI.GroupTheory.SimpleAmenable.Configurations.CellFunctor +import OAI.GroupTheory.SimpleAmenable.Simplicial.CellMonoidal +import OAI.GroupTheory.SimpleAmenable.Simplicial.PointFiberMonoidal +import OAI.GroupTheory.SimpleAmenable.Simplicial.StageMonoidal + +namespace OAI + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Classical MonoidalCategory +namespace SimpleAmenable.PolygonObject.Labelled.Cell +open BarFinitePower + +variable {a n : ℕ} (P : polygonAlgebra a) (l : LabelledStage.ReducedLabel n) +variable (c : GenericSquare a × (Fin n → CutRing × CutRing)) +variable (hp : c.1∈P.val) (hl : l.val=c.2) +noncomputable def fiber (U : FiniteSetGroupoid) : + Fin U.size ≃ PointFiber.Fiber (object P l U) c where + toFun i := ⟨⟨(i,c.1),hp⟩,rfl,hl⟩ + invFun y := y.val.val.1 + left_inv _ := rfl + right_inv y := by apply Subtype.ext; apply Subtype.ext; exact Prod.ext rfl y.property.1.symm +lemma fiber_natural {U V : FiniteSetGroupoid} (f : U ⟶ V) (x : Fin U.size) : + fiber P l c hp hl V (f x)= + PointFiber.fiberMap (arrow P l f) c (fiber P l c hp hl U x) := rfl +noncomputable def evaluationIso : + 𝟭 FiniteSetGroupoid ≅ functor P l ⋙ PointFiber.evaluation ⋙ project _ c := + NatIso.ofComponents (fun U => asIso (X := U) (Y := PointFiber.E.obj (object P l U) c) + ((fiber P l c hp hl U).trans (PointFiber.enumerate (object P l U) c))) (by + intro U V f + apply Equiv.ext; intro x + change PointFiber.enumerate (object P l V) c (fiber P l c hp hl V (f x)) = + PointFiber.E.map (arrow P l f) c (PointFiber.enumerate (object P l U) c + (fiber P l c hp hl U x)) + rw [PointFiber.E_map_enum,fiber_natural]) +lemma evaluationIso_apply (U : FiniteSetGroupoid) (x : Fin U.size) : + (evaluationIso P l c hp hl).hom.app U x = + PointFiber.enumerate (object P l U) c (fiber P l c hp hl U x) := rfl +lemma fiber_sum_left (U V : FiniteSetGroupoid) (x : Fin U.size) : + PointFiber.fiberMap (tensorArrow P l U V) c + (PointFiber.fiberSum (object P l U) (object P l V) c (.inl (fiber P l c hp hl U x))) = + fiber P l c hp hl (U⊗V) (FiniteSetGroupoid.sumEquiv U V (.inl x)) := rfl +lemma fiber_sum_right (U V : FiniteSetGroupoid) (x : Fin V.size) : + PointFiber.fiberMap (tensorArrow P l U V) c + (PointFiber.fiberSum (object P l U) (object P l V) c (.inr (fiber P l c hp hl V x))) = + fiber P l c hp hl (U⊗V) (FiniteSetGroupoid.sumEquiv U V (.inr x)) := rfl +noncomputable instance evaluationIsoMonoidal : NatTrans.IsMonoidal (evaluationIso P l c hp hl).hom where + unit := by apply Equiv.ext; intro x; exact Fin.elim0 x + tensor U V := by + apply Equiv.ext; intro x + change (evaluationIso P l c hp hl).hom.app (U⊗V) x = + PointFiber.E.map (tensorArrow P l U V) c + (PointFiber.mu (object P l U) (object P l V) c + (FiniteSetGroupoid.sumHom ((evaluationIso P l c hp hl).hom.app U) + ((evaluationIso P l c hp hl).hom.app V) x)) + obtain ⟨x,rfl⟩ := (FiniteSetGroupoid.sumEquiv U V).surjective x + cases x with + | inl x => erw [FiniteSetGroupoid.sumHom_inl,evaluationIso_apply,PointFiber.mu_inl, + PointFiber.E_map_enum,fiber_sum_left,evaluationIso_apply] + | inr x => erw [FiniteSetGroupoid.sumHom_inr,evaluationIso_apply,PointFiber.mu_inr, + PointFiber.E_map_enum,fiber_sum_right,evaluationIso_apply] + +variable {hp hl} +lemma fiber_empty (h : ¬(c.1∈P.val ∧ l.val=c.2)) (U : FiniteSetGroupoid) : + IsEmpty (PointFiber.Fiber (object P l U) c) := ⟨fun x => h + ⟨x.property.1 ▸ x.val.property,x.property.2⟩⟩ +lemma empty_size (h : ¬(c.1∈P.val ∧ l.val=c.2)) (U : FiniteSetGroupoid) : + (PointFiber.E.obj (object P l U) c).size=0 := by + have := fiber_empty P l c h U + exact @Fintype.card_eq_zero _ (PointFiber.instFintypeFiber (object P l U) c) _ +noncomputable def emptyIso (h : ¬(c.1∈P.val ∧ l.val=c.2)) : + FiniteSetGroupoid.terminal ⋙ FiniteSetGroupoid.emptyFunctor ≅ + functor P l ⋙ PointFiber.evaluation ⋙ project _ c := + NatIso.ofComponents (fun U => asIso (X := FiniteSetGroupoid.empty) + (Y := PointFiber.E.obj (object P l U) c) (finCongr (empty_size P l c h U).symm)) (by + intros; apply Equiv.ext; intro x; exact Fin.elim0 x) +noncomputable instance emptyIsoMonoidal (h : ¬(c.1∈P.val ∧ l.val=c.2)) : + NatTrans.IsMonoidal (emptyIso P l c h).hom where + unit := by apply Equiv.ext; intro x; exact Fin.elim0 x + tensor _ _ := by apply Equiv.ext; intro x; exact Fin.elim0 x +end SimpleAmenable.PolygonObject.Labelled.Cell + +end + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Classical MonoidalCategory +namespace SimpleAmenable.PolygonObject.LabelledStage.Stage +open UniformObject BarFinitePower + +variable {a n : ℕ} (S : Stage a n) +variable (b : Fin S.partition.size × Fin S.support.card) + (c : GenericSquare a × (Fin n → CutRing × CutRing)) + (hp : S.partition.color c.1=b.1) (hl : S.L b.2=c.2) + +noncomputable def pointFiber (U : S.Obj) : + UniformObject.Fiber U b ≃ Labelled.PointFiber.Fiber U.obj c where + toFun x := ⟨⟨(x.val.val.1,c.1), + (U.uniform x.val.val.1 x.val.val.2 c.1 (by + rw [x.property.1,S.partition.color_point,hp])).mp x.val.property⟩,rfl, + x.property.2.trans hl⟩ + invFun y := ⟨⟨(y.val.val.1,S.partition.point b.1), + (U.uniform y.val.val.1 y.val.val.2 (S.partition.point b.1) (by + rw [y.property.1,hp,S.partition.color_point])).mp y.val.property⟩,rfl, + y.property.2.trans hl.symm⟩ + left_inv x := by apply Subtype.ext; apply Subtype.ext; exact Prod.ext rfl x.property.1.symm + right_inv y := by apply Subtype.ext; apply Subtype.ext; exact Prod.ext rfl y.property.1.symm + +lemma pointFiber_natural {U V : S.Obj} (f : U ⟶ V) (x : Fiber U b) : + pointFiber S b c hp hl V (fiberMap f b x)= + Labelled.PointFiber.fiberMap f.arrow c (pointFiber S b c hp hl U x) := by + apply Subtype.ext + apply Subtype.ext + apply Prod.ext + · exact f.uniform x.val (pointFiber S b c hp hl U x).val rfl (by + change S.partition.color x.val.val.2=S.partition.color c.1 + rw [x.property.1,S.partition.color_point,hp]) + · exact (f.arrow.positional (pointFiber S b c hp hl U x).val).symm + +noncomputable def pointEvaluationIso : + evaluation (P:=S.partition) (L:=S.L) ⋙ project _ b ≅ + S.forget ⋙ Labelled.PointFiber.evaluation ⋙ project _ c := + NatIso.ofComponents (fun U => asIso (X := UniformObject.E.obj U b) + (Y := Labelled.PointFiber.E.obj U.obj c) + ((enumerate U b).symm.trans ((pointFiber S b c hp hl U).trans + (Labelled.PointFiber.enumerate U.obj c)))) (by + intro U V f + apply Equiv.ext + intro x + obtain ⟨x,rfl⟩ := (enumerate U b).surjective x + dsimp only [Functor.comp_map,Pi.eval,project,asIso_hom,Equiv.trans_apply,Equiv.symm_apply_apply] + change Labelled.PointFiber.enumerate V.obj c (pointFiber S b c hp hl V + ((enumerate V b).symm (UniformObject.E.map f b (enumerate U b x)))) = + Labelled.PointFiber.E.map f.arrow c (Labelled.PointFiber.enumerate U.obj c + (pointFiber S b c hp hl U ((enumerate U b).symm (enumerate U b x)))) + rw [E_map_enum,Equiv.symm_apply_apply,Equiv.symm_apply_apply, + Labelled.PointFiber.E_map_enum,pointFiber_natural]) + +lemma pointFiber_sum_inl (U V : S.Obj) (x : Fiber U b) : + pointFiber S b c hp hl (UniformObject.sum U V) (fiberSum U V b (.inl x)) = + Labelled.PointFiber.fiberSum U.obj V.obj c (.inl (pointFiber S b c hp hl U x)) := rfl +lemma pointFiber_sum_inr (U V : S.Obj) (x : Fiber V b) : + pointFiber S b c hp hl (UniformObject.sum U V) (fiberSum U V b (.inr x)) = + Labelled.PointFiber.fiberSum U.obj V.obj c (.inr (pointFiber S b c hp hl V x)) := rfl +lemma pointEvaluationIso_enum (U : S.Obj) (x : Fiber U b) : + (pointEvaluationIso S b c hp hl).hom.app U (enumerate U b x) = + Labelled.PointFiber.enumerate U.obj c (pointFiber S b c hp hl U x) := by + change Labelled.PointFiber.enumerate U.obj c (pointFiber S b c hp hl U + ((enumerate U b).symm (enumerate U b x)))=_ + rw [Equiv.symm_apply_apply] + +instance pointEvaluationIso_monoidal : NatTrans.IsMonoidal (pointEvaluationIso S b c hp hl).hom where + unit := by apply Equiv.ext; intro x; exact Fin.elim0 x + tensor U V := by + change ((𝟙 _ ≫ mu U V b) ≫ _) = (_ ≫ (𝟙 _ ≫ Labelled.PointFiber.mu U.obj V.obj c) ≫ + (Labelled.PointFiber.E.map (𝟙 (U.obj ⊗ V.obj))) c) + rw [CategoryTheory.Functor.map_id] + simp only [Category.id_comp] + apply Equiv.ext + intro x + change (pointEvaluationIso S b c hp hl).hom.app (UniformObject.sum U V) (mu U V b x) = + Labelled.PointFiber.mu U.obj V.obj c + (FiniteSetGroupoid.sumHom ((pointEvaluationIso S b c hp hl).hom.app U) + ((pointEvaluationIso S b c hp hl).hom.app V) x) + obtain ⟨x,rfl⟩ := (FiniteSetGroupoid.sumEquiv (UniformObject.E.obj U b) (UniformObject.E.obj V b)).surjective x + cases x with + | inl x => + obtain ⟨x,rfl⟩ := (enumerate U b).surjective x + erw [mu_inl,pointEvaluationIso_enum,pointFiber_sum_inl,FiniteSetGroupoid.sumHom_inl, + pointEvaluationIso_enum,Labelled.PointFiber.mu_inl] + | inr x => + obtain ⟨x,rfl⟩ := (enumerate V b).surjective x + erw [mu_inr,pointEvaluationIso_enum,pointFiber_sum_inr,FiniteSetGroupoid.sumHom_inr, + pointEvaluationIso_enum,Labelled.PointFiber.mu_inr] + +variable {S b hp hl} +lemma pointFiber_empty_of_new_label (hc : ∀j,S.L j ≠ c.2) (U : S.Obj) : + IsEmpty (Labelled.PointFiber.Fiber U.obj c) := ⟨by + intro x + obtain ⟨j,hj⟩ := U.supported x.val.val.1 + exact hc j (hj.trans x.property.2)⟩ +lemma point_new_label_size (hc : ∀j,S.L j ≠ c.2) (U : S.Obj) : + (Labelled.PointFiber.E.obj U.obj c).size=0 := by + have := pointFiber_empty_of_new_label c hc U + exact Fintype.card_eq_zero +noncomputable def emptyPointIso (hc : ∀j,S.L j ≠ c.2) : + FiniteSetGroupoid.terminal ⋙ FiniteSetGroupoid.emptyFunctor ≅ + S.forget ⋙ Labelled.PointFiber.evaluation ⋙ project _ c := + NatIso.ofComponents (fun U => asIso (X := FiniteSetGroupoid.empty) + (Y := Labelled.PointFiber.E.obj U.obj c) (finCongr (point_new_label_size c hc U).symm)) (by + intros; apply Equiv.ext; intro x; exact Fin.elim0 x) +noncomputable instance emptyPointIsoMonoidal (hc : ∀j,S.L j ≠ c.2) : + NatTrans.IsMonoidal (emptyPointIso c hc).hom where + unit := by apply Equiv.ext; intro x; exact Fin.elim0 x + tensor _ _ := by apply Equiv.ext; intro x; exact Fin.elim0 x + +end SimpleAmenable.PolygonObject.LabelledStage.Stage + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Configurations/CellFunctor.lean b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/CellFunctor.lean new file mode 100644 index 0000000000000000000000000000000000000000..dcae2060a8900df0d783b9bcec6f081843e3bda3 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/CellFunctor.lean @@ -0,0 +1,79 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.LabelledMonoidal +import OAI.GroupTheory.SimpleAmenable.Simplicial.FiniteSetMonoidal +import OAI.GroupTheory.SimpleAmenable.Configurations.StageOrder + +namespace OAI + +section +open CategoryTheory Classical MonoidalCategory +namespace SimpleAmenable.PolygonObject.Labelled.Cell + +variable {a n : ℕ} (P : polygonAlgebra a) (l : LabelledStage.ReducedLabel n) + +noncomputable abbrev object (U : FiniteSetGroupoid) : Labelled a n := + ⟨⟨U.size,fun _ => P⟩,fun _ => l.val,fun _ => l.property⟩ +noncomputable def pointMap {U V : FiniteSetGroupoid} (f : U ⟶ V) : + (object P l U).polygon.Point ≃ (object P l V).polygon.Point where + toFun x := ⟨(f x.val.1,x.val.2),x.property⟩ + invFun y := ⟨(f.symm y.val.1,y.val.2),y.property⟩ + left_inv x := by apply Subtype.ext; exact Prod.ext (f.symm_apply_apply _) rfl + right_inv y := by apply Subtype.ext; exact Prod.ext (f.apply_symm_apply _) rfl +noncomputable def arrow {U V : FiniteSetGroupoid} (f : U ⟶ V) : object P l U ⟶ object P l V where + arrow := relabelArrow (pointMap P l f) f (fun _ => rfl) + positional _ := rfl + labelled _ := rfl +noncomputable def functor : FiniteSetGroupoid ⥤ Labelled a n where + obj := object P l + map := arrow P l + map_id _ := by apply Hom.ext; apply Arrow.ext; apply Equiv.ext; intro x; rfl + map_comp _ _ := by apply Hom.ext; apply Arrow.ext; apply Equiv.ext; intro x; rfl +@[simp] lemma arrow_apply {U V : FiniteSetGroupoid} (f : U ⟶ V) + (x : (object P l U).polygon.Point) : + ((arrow P l f).arrow.toEquiv x).val = (f x.val.1,x.val.2) := rfl + +noncomputable def tensorPoint (U V : FiniteSetGroupoid) : + (sum (object P l U) (object P l V)).polygon.Point ≃ (object P l (U⊗V)).polygon.Point where + toFun x := ⟨x.val,by + obtain ⟨y,rfl⟩ := (sumPointEquiv (object P l U).polygon (object P l V).polygon).surjective x + cases y with + | inl y => simpa only [sumPointEquiv_inl,object] using y.property + | inr y => simpa only [sumPointEquiv_inr,object] using y.property⟩ + invFun x := ⟨x.val,by + change x.val.2 ∈ (Fin.addCases (motive := fun _ => polygonAlgebra a) + (fun _ => P) (fun _ => P) x.val.1).val + refine Fin.addCases (motive := fun i => x.val.2 ∈ (Fin.addCases + (motive := fun _ => polygonAlgebra a) (fun _ => P) (fun _ => P) i).val) + (fun i => ?_) (fun i => ?_) x.val.1 + · simpa only [Fin.addCases_left,object] using x.property + · simpa only [Fin.addCases_right,object] using x.property⟩ + left_inv _ := rfl + right_inv _ := rfl +noncomputable def tensorArrow (U V : FiniteSetGroupoid) : + (object P l U) ⊗ (object P l V) ⟶ object P l (U⊗V) where + arrow := relabelArrow (tensorPoint P l U V) id (fun _ => rfl) + positional _ := rfl + labelled x := by + change l.val = Fin.addCases (fun _ => l.val) (fun _ => l.val) x.val.1 + refine Fin.addCases (motive := fun i => l.val = Fin.addCases + (motive := fun _ => Fin n → CutRing × CutRing) (fun _ => l.val) (fun _ => l.val) i) + (fun i => ?_) (fun i => ?_) x.val.1 + · simp only [Fin.addCases_left] + · simp only [Fin.addCases_right] +@[simp] lemma tensorArrow_apply (U V : FiniteSetGroupoid) + (x : (sum (object P l U) (object P l V)).polygon.Point) : + ((tensorArrow P l U V).arrow.toEquiv x).val=x.val := rfl +noncomputable def unitArrow : 𝟙_ (Labelled a n) ⟶ object P l (𝟙_ FiniteSetGroupoid) where + arrow := relabelArrow { + toFun x := Fin.elim0 x.val.1 + invFun x := Fin.elim0 x.val.1 + left_inv x := Fin.elim0 x.val.1 + right_inv x := Fin.elim0 x.val.1 } Fin.elim0 (fun x => Fin.elim0 x.val.1) + positional x := Fin.elim0 x.val.1 + labelled x := Fin.elim0 x.val.1 + +end SimpleAmenable.PolygonObject.Labelled.Cell + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Configurations/CellRelabel.lean b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/CellRelabel.lean new file mode 100644 index 0000000000000000000000000000000000000000..243758c8a9f1b4f312bfa5bceeab95954210c45b --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/CellRelabel.lean @@ -0,0 +1,44 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.LabelRelabel +import OAI.GroupTheory.SimpleAmenable.Configurations.CellFunctor +import OAI.GroupTheory.SimpleAmenable.Simplicial.CellMonoidal + +namespace OAI + +section +open CategoryTheory MonoidalCategory +namespace SimpleAmenable.PolygonObject.Labelled.Cell + +variable {a n m : ℕ} +variable (f : (Fin n → CutRing × CutRing) → (Fin m → CutRing × CutRing)) + (hf : ∀g, Reduced g → Reduced (f g)) +variable (P : polygonAlgebra a) (l : LabelledStage.ReducedLabel n) +noncomputable def relabelIso : + functor P l ⋙ relabel f hf ≅ functor P ⟨f l.val,hf l.val l.property⟩ := + NatIso.ofComponents (fun U => asIso (X := (relabel f hf).obj (object P l U)) + (Y := object P ⟨f l.val,hf l.val l.property⟩ U) + { arrow := 𝟙 _ + positional _ := rfl + labelled _ := rfl }) (by + intro U V g + apply Hom.ext + change _ ≫ 𝟙 _ = 𝟙 _ ≫ _ + simp only [Category.comp_id] + rfl) +noncomputable instance relabelIsoMonoidal : NatTrans.IsMonoidal (relabelIso f hf P l).hom where + unit := by + apply Hom.ext + change (𝟙 _ ≫ (unitArrow P l).arrow) ≫ 𝟙 _ = (unitArrow P ⟨f l.val,hf l.val l.property⟩).arrow + simp only [Category.id_comp,Category.comp_id] + rfl + tensor U V := by + apply Hom.ext + change (𝟙 _ ≫ (tensorArrow P l U V).arrow) ≫ 𝟙 _ = + sumArrow (𝟙 _) (𝟙 _) ≫ (tensorArrow P ⟨f l.val,hf l.val l.property⟩ U V).arrow + simp only [Category.id_comp,Category.comp_id,sumArrow_id] + rfl +end SimpleAmenable.PolygonObject.Labelled.Cell + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Configurations/CofinalPowers.lean b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/CofinalPowers.lean new file mode 100644 index 0000000000000000000000000000000000000000..aac114fdb56ed4eb550e135e6fb5faf1f563c5c5 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/CofinalPowers.lean @@ -0,0 +1,55 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.FiniteGroupHomology + +namespace OAI + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits +namespace CofinalPowers + +variable {P:Type} [CommMonoid P] +noncomputable def sequence (x:P) : ℕ ⥤ ActionCategory P P where + obj n := (x^n:P) + map {n m} f := ⟨x^(m-n),by + change x^(m-n)*x^n=x^m + rw [←pow_add,Nat.sub_add_cancel (leOfHom f)]⟩ + map_id n := by + apply Functor.Elements.hom_ext + change x^(n-n)=1 + simp + map_comp {n m k} f g := by + apply Functor.Elements.hom_ext + change x^(k-n)=x^(k-m)*x^(m-n) + rw [←pow_add] + congr 1 + have h:=leOfHom f; have h':=leOfHom g; omega +lemma final (x:P) (hx:∀p:P,∃q n,p*q=x^n) : (sequence x).Final := by + apply Functor.final_of_exists_of_isFiltered + · intro p + obtain ⟨q,n,h⟩:=hx p.back + exact ⟨n,⟨⟨q,by change q*p.back=x^n; simpa only [mul_comm] using h⟩⟩⟩ + · intro p n f g + obtain ⟨q,k,h⟩:=hx p.back + refine ⟨n+k,homOfLE (Nat.le_add_right n k),?_⟩ + apply Functor.Elements.hom_ext + change x^(n+k-n)*f.hom=x^(n+k-n)*g.hom + rw [Nat.add_sub_cancel_left] + have eh : f.hom*p.back=g.hom*p.back:=f.map_val.trans g.map_val.symm + rw [←h] + simpa only [mul_assoc,mul_left_comm,mul_comm] using congrArg (fun p:P=>p*q) eh +noncomputable def colimitIso {A:Type*} [Category A] (x:P) (hx:∀p:P,∃q n,p*q=x^n) + (F:ActionCategory P P ⥤ A) [HasColimit F] [HasColimit (sequence x ⋙ F)] : + colimit (sequence x ⋙ F) ≅ colimit F := by + haveI := final x hx + exact Functor.Final.colimitIso (sequence x) F +lemma finite_colimit_iff {R:Type} [Ring R] (x:P) (hx:∀p:P,∃q n,p*q=x^n) + (F:ActionCategory P P ⥤ ModuleCat R) (N n:ℕ) (hn:N≤n) + (hf : ∀ m : ℕ, N ≤ m → IsIso (F.map ((sequence x).map (homOfLE (Nat.le_succ m))))) : + Module.Finite R (F.obj ((sequence x).obj n)) ↔ Module.Finite R (colimit F:ModuleCat R) := by + exact (FixedStageReturn.finite_stage_iff_colimit (sequence x ⋙ F) N n hf hn).trans + (Module.Finite.equiv_iff (colimitIso x hx F).toLinearEquiv) +end CofinalPowers + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Configurations/ConditionalIntervalDifference.lean b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/ConditionalIntervalDifference.lean new file mode 100644 index 0000000000000000000000000000000000000000..9e118e8950410d576a7f6554e5bffd7856acc5d9 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/ConditionalIntervalDifference.lean @@ -0,0 +1,43 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.CellGeometry + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section ConditionalIntervalDifference +variable {a m : ℕ} + +theorem conditionalAlternatingHom_union (U V : polygonAlgebra a) + (hd : Disjoint U.val V.val) (s : alternatingGroup (Fin m)) : + conditionalAlternatingHom (U ⊔ V) s = conditionalAlternatingHom U s*conditionalAlternatingHom V s := by + apply Subtype.ext + apply Subtype.ext + apply Equiv.ext + intro p + change conditionalPerm (U ⊔ V) s.val p = conditionalPerm U s.val (conditionalPerm V s.val p) + by_cases hu : p.2 ∈ U.val <;> by_cases hv : p.2 ∈ V.val + · exact False.elim (Set.disjoint_left.mp hd hu hv) + all_goals simp [conditionalPerm,hu,hv] + +theorem conditionalAlternatingHom_interval_difference (d : Fin 2) (u v w : CutRing) + (huv : ordinary u ≤ ordinary v) (hvw : ordinary v ≤ ordinary w) + (hlen : ordinary w-ordinary u < 1) (s : alternatingGroup (Fin m)) : + (conditionalAlternatingHom (coordinateInterval a d u v) s)⁻¹ * + conditionalAlternatingHom (coordinateInterval a d u w) s = + conditionalAlternatingHom (coordinateInterval a d v w) s := by + rw [coordinateInterval_union d u v w huv hvw hlen, + conditionalAlternatingHom_union _ _ (coordinateInterval_disjoint d u v v w huv le_rfl hvw hlen)] + group + +end ConditionalIntervalDifference + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Configurations/ConditionalTranslationStabilizers.lean b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/ConditionalTranslationStabilizers.lean new file mode 100644 index 0000000000000000000000000000000000000000..47fcb2393de7aafa9c4708d2358153d51cef3b69 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/ConditionalTranslationStabilizers.lean @@ -0,0 +1,57 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Configurations.FiveTrackGeneration + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section ConditionalTranslationStabilizers + +variable {a m : ℕ} + +theorem trackTranslation_conditional_commute (U : polygonAlgebra a) + (σ : Equiv.Perm (Fin m)) (d : Fin m → CutRing × CutRing) + (hd : ∀ i, σ i ≠ i → d i = 0) : + Commute (trackTranslation d) (conditionalHom U σ) := by + have he := conditional_translation_conjugate U σ d 0 hd + have hU : (⟨translate a (-0) ⁻¹' U.val,polygon_preimage_translate (-0) U.property⟩ : + polygonAlgebra a) = U := by + apply Subtype.ext + ext p + simp only [Set.mem_preimage,neg_zero,translate_zero] + rw [hU] at he + have hx := congrArg (fun z => z * trackTranslation d) he + change _*_ = _*_ + simpa only [mul_assoc,inv_mul_cancel,mul_one] using hx.symm + +theorem conditional_conjugation_support (U : polygonAlgebra a) + (σ : Equiv.Perm (Fin m)) (d e : Fin m → CutRing × CutRing) + (hde : ∀ i, σ i ≠ i → d i = e i) : + trackTranslation d * conditionalHom U σ * (trackTranslation d)⁻¹ = + trackTranslation e * conditionalHom U σ * (trackTranslation e)⁻¹ := by + have hc := trackTranslation_conditional_commute U σ (d-e) (by + intro i hi + change d i - e i = 0 + rw [hde i hi,sub_self]) + rw [trackTranslation_sub] at hc + have hcomm : Commute (trackTranslation (a := a) d) (trackTranslation e) := by + change _*_ = _*_ + rw [← trackTranslation_add,← trackTranslation_add,add_comm d e] + have he := congrArg (fun z => trackTranslation e * z * (trackTranslation d)⁻¹) hc.eq + rw [hcomm.inv_right.eq] at he + have hh : trackTranslation e * ((trackTranslation e)⁻¹ * trackTranslation d * conditionalHom U σ) * + (trackTranslation d)⁻¹ = trackTranslation d * conditionalHom U σ * (trackTranslation d)⁻¹ := by group + rw [hh] at he + convert he using 1; group + +end ConditionalTranslationStabilizers + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Configurations/DistinctSlotStars.lean b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/DistinctSlotStars.lean new file mode 100644 index 0000000000000000000000000000000000000000..bb36af5bd953ba5607e03526cce617fc29502724 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/DistinctSlotStars.lean @@ -0,0 +1,124 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.FrameDisjointness + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section DistinctSlotStars + +noncomputable def fiveAlternatingHom {m : ℕ} (ι : Fin 5 ↪ Fin m) : + alternatingGroup (Fin 5) →* alternatingGroup (Fin m) := + (fiveTrackHom ι).codRestrict _ (fiveTrack_sign ι) + +noncomputable def orderedTrackAlphabet {m : ℕ} (ι : Fin 5 ↪ Fin m) : Finset (Fin m) := + Finset.univ.map ι + +instance orderedTrackAlphabetPerfect {m : ℕ} (ι : Fin 5 ↪ Fin m) : + Group.IsPerfect (alternatingGroup (orderedTrackAlphabet ι)) := by + classical + apply Group.IsPerfect.mk + apply commutator_alternatingGroup_eq_top + rw [Nat.card_eq_fintype_card,Fintype.card_coe,orderedTrackAlphabet,Finset.card_map,Finset.card_univ,Fintype.card_fin] + +noncomputable def orderedTrackHom {m : ℕ} (ι : Fin 5 ↪ Fin m) : + alternatingGroup (Fin 5) →* alternatingGroup (orderedTrackAlphabet ι) := + (MonoidHom.ofInjective (subtypeAlternatingHom_injective (orderedTrackAlphabet ι))).symm.toMonoidHom.comp + ((fiveAlternatingHom ι).codRestrict (subtypeAlternatingHom (orderedTrackAlphabet ι)).range + (fun s => (subtypeAlternatingHom_mem_range _ _).mpr (alphabet_support_subset ι s))) + +@[simp] theorem orderedTrackHom_comp {m : ℕ} (ι : Fin 5 ↪ Fin m) : + (subtypeAlternatingHom (orderedTrackAlphabet ι)).comp (orderedTrackHom ι) = + fiveAlternatingHom ι := by + ext s : 1 + exact MonoidHom.apply_ofInjective_symm (subtypeAlternatingHom_injective _) _ + +@[simp] theorem orderedTrackAlphabet_mem {m : ℕ} (ι : Fin 5 ↪ Fin m) (j : Fin 5) : + ι j ∈ orderedTrackAlphabet ι := Finset.mem_map.mpr ⟨j,Finset.mem_univ _,rfl⟩ + +theorem orderedTrackHom_apply {m : ℕ} (ι : Fin 5 ↪ Fin m) + (s : alternatingGroup (Fin 5)) (j : Fin 5) : + ((orderedTrackHom ι s).val ⟨ι j,orderedTrackAlphabet_mem ι j⟩).val = ι (s.val j) := by + have he := congrArg (fun t : alternatingGroup (Fin m) => t.val (ι j)) + (DFunLike.congr_fun (orderedTrackHom_comp ι) s) + change Equiv.Perm.ofSubtype (orderedTrackHom ι s).val (ι j) = + Equiv.Perm.viaEmbedding s.val ι (ι j) at he + rw [Equiv.Perm.ofSubtype_apply_of_mem _ (orderedTrackAlphabet_mem ι j), + Equiv.Perm.viaEmbedding_apply] at he + exact he + +noncomputable def slotAlternatingHom {a m : ℕ} (V : polygonAlgebra a) + (slots : Fin 5 → Fin m × (CutRing × CutRing)) + (hinj : Function.Injective (SlotMap a m V slots)) : + alternatingGroup (Fin 5) →* polygonAlternatingGroup a m := + ((slotHom V slots hinj).comp (alternatingGroup (Fin 5)).subtype).codRestrict _ + (fun s => slotHom_alternating_mem V slots hinj s.property) + +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + (hlarge : 15 < m+1) (h : B.AllPrimitiveLaws) (hr : 0 (ι j,u (ι j))) + (slots_injective_of_tracks V _ ι.injective)).comp (universalProjection (alternatingGroup (Fin 5))) := by + ext s : 1 + apply Subtype.ext + apply Subtype.ext + apply Equiv.ext + intro p + by_cases hp : p ∈ Set.range (SlotMap a (m+1) V (fun j => (ι j,u (ι j)))) + · obtain ⟨⟨j,x⟩,rfl⟩ := hp + change (coverMap M (alternatingGenerator a r m hm) (B.distinctSlotStar hlarge h hr ι u F V s)).val.val + (ι j,translate a (u (ι j)) x.val) = + slotPerm V (fun j => (ι j,u (ι j))) _ (universalProjection _ s).val + (SlotMap a (m+1) V (fun j => (ι j,u (ι j))) (j,x)) + rw [slotPerm_apply] + exact B.distinctSlotStar_apply hlarge h hr ι u F V s j x + · have hp' : p ∉ frameDomain (orderedTrackAlphabet ι) u V := by + rintro ⟨i,hi,x,hx,rfl⟩ + obtain ⟨j,hj,rfl⟩ := Finset.mem_map.mp hi + exact hp ⟨(j,⟨x,hx⟩),rfl⟩ + have he := B.frameStar_supported hlarge h hr (orderedTrackAlphabet ι) u F V + (universalMap (orderedTrackHom ι) s) p hp' + change (coverMap M (alternatingGenerator a r m hm) (B.distinctSlotStar hlarge h hr ι u F V s)).val.val p = + slotPerm V (fun j => (ι j,u (ι j))) _ (universalProjection _ s).val p + rw [slotPerm_apply_of_notMem _ _ _ _ hp] + exact he + +end InitialCoverSystem +end DistinctSlotStars + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Configurations/EmptyStage.lean b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/EmptyStage.lean new file mode 100644 index 0000000000000000000000000000000000000000..ad9b3fc4eeb9c95134cf6c633ccd39bcd20bd3b2 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/EmptyStage.lean @@ -0,0 +1,68 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.BarContractible +import OAI.GroupTheory.SimpleAmenable.Simplicial.FiniteSetMonoidal + +namespace OAI + +section + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory MonoidalCategory +namespace IntervalBar.Diagram + +open FreeChains +lemma bar₃_acyclic {C:Type} [Groupoid.{0} C] [MonoidalCategory C] [SymmetricCategory C] + [∀x y:C,Subsingleton (x ⟶ y)] (hh:∀x y:C,Nonempty (x ⟶ y)) + (n:ℕ) (hn:0 ⟨homOfAll hh 0 x y⟩) q hq + · intro p q hq _ + exact bar₂_acyclic (fun x y => ⟨homOfAll hh p x y⟩) q hq + · exact hn + · omega +end IntervalBar.Diagram +namespace SimpleAmenable.PolygonObject.FiniteSetGroupoid +abbrev Terminal := Discrete PUnit +instance terminalSymmetric : SymmetricCategory Terminal where + braiding X Y := eqToIso (Subsingleton.elim _ _) + braiding_naturality_left := by intros; exact Subsingleton.elim _ _ + braiding_naturality_right := by intros; exact Subsingleton.elim _ _ + hexagon_forward := by intros; exact Subsingleton.elim _ _ + hexagon_reverse := by intros; exact Subsingleton.elim _ _ + symmetry := by intros; exact Subsingleton.elim _ _ +noncomputable def terminal {C:Type} [Category.{0} C] : C ⥤ Terminal := + (Functor.const C).obj ⟨PUnit.unit⟩ +noncomputable instance terminalMonoidal {C:Type} [Category.{0} C] [MonoidalCategory C] : + (terminal (C:=C)).Monoidal := Functor.CoreMonoidal.toMonoidal { + εIso := Iso.refl _ + μIso _ _ := Iso.refl _ + μIso_hom_natural_left := by intros; exact Subsingleton.elim _ _ + μIso_hom_natural_right := by intros; exact Subsingleton.elim _ _ + associativity := by intros; exact Subsingleton.elim _ _ + left_unitality := by intros; exact Subsingleton.elim _ _ + right_unitality := by intros; exact Subsingleton.elim _ _ } +noncomputable instance terminalBraided {C:Type} [Category.{0} C] [MonoidalCategory C] [BraidedCategory C] : + (terminal (C:=C)).Braided where + braided _ _ := Subsingleton.elim _ _ +noncomputable def emptyFunctor : Terminal ⥤ FiniteSetGroupoid := + (Functor.const _).obj empty +noncomputable instance emptyFunctorMonoidal : emptyFunctor.Monoidal := + Functor.CoreMonoidal.toMonoidal { + εIso := Iso.refl _ + μIso _ _ := Iso.refl _ + μIso_hom_natural_left := by intros; apply Equiv.ext; intro x; exact Fin.elim0 x + μIso_hom_natural_right := by intros; apply Equiv.ext; intro x; exact Fin.elim0 x + associativity := by intros; apply Equiv.ext; intro x; exact Fin.elim0 x + left_unitality := by intros; apply Equiv.ext; intro x; exact Fin.elim0 x + right_unitality := by intros; apply Equiv.ext; intro x; exact Fin.elim0 x } +noncomputable instance : emptyFunctor.Braided where + braided _ _ := by apply Equiv.ext; intro x; exact Fin.elim0 x +end SimpleAmenable.PolygonObject.FiniteSetGroupoid + +end + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Configurations/FiberAddition.lean b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/FiberAddition.lean new file mode 100644 index 0000000000000000000000000000000000000000..0f22a83b8d0bba733d3b3f6bfaab8b2e1796b937 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/FiberAddition.lean @@ -0,0 +1,172 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.TripleReindex +import OAI.GroupTheory.SimpleAmenable.Configurations.EmptyStage +import OAI.GroupTheory.SimpleAmenable.Simplicial.FiberSum + +namespace OAI + +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits MonoidalCategory +namespace BarFiberProduct + +universe homSource homTarget +variable {A C D:Type} [Category.{homSource} A] [Category.{homTarget} C] + [Category.{homTarget} D] + [MonoidalCategory A] [MonoidalCategory C] [MonoidalCategory D] + [BraidedCategory A] [BraidedCategory C] [BraidedCategory D] +noncomputable instance prodFunctorBraided (F:A⥤C) (G:A⥤D) [F.Braided] [G.Braided] : + (F.prod' G).Braided where + braided X Y := by + apply CategoryTheory.Prod.hom_ext + · simp only [CategoryTheory.prod_comp_fst,Functor.prod'_μ_fst] + change Functor.LaxMonoidal.μ F X Y ≫ F.map (β_ X Y).hom = + (β_ (F.obj X) (F.obj Y)).hom ≫ Functor.LaxMonoidal.μ F Y X + exact Functor.Braided.braided (F:=F) X Y + · simp only [CategoryTheory.prod_comp_snd,Functor.prod'_μ_snd] + change Functor.LaxMonoidal.μ G X Y ≫ G.map (β_ X Y).hom = + (β_ (G.obj X) (G.obj Y)).hom ≫ Functor.LaxMonoidal.μ G Y X + exact Functor.Braided.braided (F:=G) X Y +end BarFiberProduct +namespace IntervalBar.Diagram + +variable {C:Type} [Groupoid.{0} C] [MonoidalCategory C] [SymmetricCategory C] +lemma bar₃Map_id_homology (j:ℕ) : + SSet.homologyMap (bar₃Map (𝟭 C)) DiagonalResolution.Z j=𝟙 _ := by + have := bar₃Map_homology_isIso (𝟭 C) j + apply (cancel_epi (SSet.homologyMap (bar₃Map (𝟭 C)) DiagonalResolution.Z j)).mp + rw [Category.comp_id,← SSet.homologyMap_comp,←bar₃Map_comp] + exact bar₃Map_eq_of_monoidalNatTrans (Functor.leftUnitor (𝟭 C)).hom j +end IntervalBar.Diagram +namespace SimpleAmenable.PolygonObject.FiniteSetGroupoid +open BarFiberProduct IntervalBar.Diagram BarFinitePower +open LabelledStage.Stage + +noncomputable def merge : (Bool → FiniteSetGroupoid) ⥤ FiniteSetGroupoid := + (project Bool true).prod' (project Bool false) ⋙ tensor FiniteSetGroupoid +noncomputable instance : merge.Braided := by unfold merge; infer_instance +noncomputable def selected (b k:Bool) : FiniteSetGroupoid ⥤ FiniteSetGroupoid := + match b,k with + | false,false => 𝟭 _ + | true,true => 𝟭 _ + | _,_ => terminal.{0} ⋙ emptyFunctor.{0} +noncomputable instance selectedMonoidal (b k:Bool) : (selected b k).Monoidal := by + cases b <;> cases k <;> unfold selected <;> infer_instance +noncomputable instance selectedBraided (b k:Bool) : (selected b k).Braided := by + cases b <;> cases k <;> unfold selected <;> infer_instance +noncomputable def insertFiber (b:Bool) : FiniteSetGroupoid ⥤ (Bool→FiniteSetGroupoid) := + Functor.pi' (selected b) +noncomputable instance (b:Bool) : (insertFiber b).Braided := by unfold insertFiber; infer_instance +noncomputable def insertCoordinate (b k:Bool) : insertFiber b ⋙ project Bool k ≅ selected b k := Iso.refl _ +noncomputable instance (b k:Bool) : NatTrans.IsMonoidal (insertCoordinate b k).hom where + unit := by + simp [insertCoordinate,insertFiber,project,toEquiv] + cases b <;> cases k <;> rfl + tensor U V := by + change Functor.LaxMonoidal.μ (selected b k) U V ≫ 𝟙 _ = + (𝟙 _ ⊗ₘ 𝟙 _) ≫ Functor.LaxMonoidal.μ (selected b k) U V + rw [id_tensorHom_id,Category.comp_id,Category.id_comp] +lemma selected_homology (b k:Bool) (j:ℕ) (hj:0 cases k + · exact bar₃Map_id_homology j + · change SSet.homologyMap (bar₃Map (terminal.{0} ⋙ emptyFunctor.{0})) DiagonalResolution.Z j=0 + rw [bar₃Map_comp,SSet.homologyMap_comp] + have hz := bar₃_acyclic (C:=Terminal.{0}) (fun x y => ⟨eqToHom (Subsingleton.elim x y)⟩) j hj + rw [hz.eq_of_src (SSet.homologyMap (bar₃Map emptyFunctor.{0}) DiagonalResolution.Z j) 0,comp_zero] + · change SSet.homologyMap (bar₃Map (terminal.{0} ⋙ emptyFunctor.{0})) DiagonalResolution.Z j=0 + rw [bar₃Map_comp,SSet.homologyMap_comp] + have hz := bar₃_acyclic (C:=Terminal.{0}) (fun x y => ⟨eqToHom (Subsingleton.elim x y)⟩) j hj + rw [hz.eq_of_src (SSet.homologyMap (bar₃Map emptyFunctor.{0}) DiagonalResolution.Z j) 0,comp_zero] + · exact bar₃Map_id_homology j +noncomputable def mergeInsertIso (b:Bool) : insertFiber b ⋙ merge ≅ 𝟭 FiniteSetGroupoid := by + cases b + · exact NatIso.ofComponents (fun U => asIso (C := FiniteSetGroupoid) + (X := sum empty U) (Y := U) (left U)) (by + intro U V f + change sumHom (𝟙 empty) f ≫ left V = left U ≫ f + exact (leftUnitor_naturality f)) + · exact NatIso.ofComponents (fun U => asIso (C := FiniteSetGroupoid) + (X := sum U empty) (Y := U) (right U)) (by + intro U V f + change sumHom f (𝟙 empty) ≫ right V = right U ≫ f + exact (rightUnitor_naturality f)) +lemma merge_μ (U V:Bool→FiniteSetGroupoid) : + Functor.LaxMonoidal.μ merge U V=tensorμ (U true) (U false) (V true) (V false) := by + unfold merge + rw [Functor.LaxMonoidal.comp_μ] + change tensorμ (U true) (U false) (V true) (V false) ≫ + sumHom (Functor.LaxMonoidal.μ ((project Bool true).prod' (project Bool false)) U V).1 + (Functor.LaxMonoidal.μ ((project Bool true).prod' (project Bool false)) U V).2 = _ + rw [Functor.prod'_μ_fst,Functor.prod'_μ_snd] + change tensorμ (U true) (U false) (V true) (V false) ≫ sumHom (𝟙 _) (𝟙 _) = _ + rw [sumHom_id] + apply Equiv.ext; intro x; rfl +lemma mergeInsert_false_μ (U V:FiniteSetGroupoid) : + Functor.LaxMonoidal.μ (insertFiber false ⋙ merge) U V = tensorμ empty U empty V := by + rw [Functor.LaxMonoidal.comp_μ,merge_μ] + change tensorμ _ _ _ _ ≫ sumHom (𝟙 _) (𝟙 _) = _ + rw [sumHom_id] + apply Equiv.ext; intro x; rfl +lemma mergeInsert_true_μ (U V:FiniteSetGroupoid) : + Functor.LaxMonoidal.μ (insertFiber true ⋙ merge) U V = tensorμ U empty V empty := by + rw [Functor.LaxMonoidal.comp_μ,merge_μ] + change tensorμ _ _ _ _ ≫ sumHom (𝟙 _) (𝟙 _) = _ + rw [sumHom_id] + apply Equiv.ext; intro x; rfl +noncomputable instance mergeInsertMonoidal (b:Bool) : NatTrans.IsMonoidal (mergeInsertIso b).hom where + unit := by cases b <;> apply Equiv.ext <;> intro x <;> exact Fin.elim0 x + tensor U V := by + cases b + · rw [mergeInsert_false_μ] + change tensorμ empty U empty V ≫ left (sum U V) = sumHom (left U) (left V) ≫ 𝟙 _ + rw [Category.comp_id,tensorμ_eq] + dsimp only [CategoryStruct.comp,instGroupoid,toEquiv] + apply Equiv.ext; intro x + obtain ⟨z,rfl⟩ := (sumEquiv (sum empty U) (sum empty V)).surjective x + cases z with + | inl z => + obtain ⟨t,rfl⟩ := (sumEquiv empty U).surjective z + cases t with + | inl t => exact Fin.elim0 t + | inr t => + simp [toEquiv,sumHom,assoc,swap,left,inv_eq,Equiv.trans_apply,MonoidalCategory.tensorObj] + dsimp only [sum,empty] + rw [Equiv.symm_apply_apply] + rfl + | inr z => + obtain ⟨t,rfl⟩ := (sumEquiv empty V).surjective z + cases t with + | inl t => exact Fin.elim0 t + | inr t => + simp [toEquiv,sumHom,assoc,swap,left,inv_eq,Equiv.trans_apply,MonoidalCategory.tensorObj] + dsimp only [sum,empty] + rw [Equiv.symm_apply_apply] + rfl + · rw [mergeInsert_true_μ] + change tensorμ U empty V empty ≫ right (sum U V) = sumHom (right U) (right V) ≫ 𝟙 _ + rw [Category.comp_id,tensorμ_eq] + dsimp only [CategoryStruct.comp,instGroupoid,toEquiv] + apply Equiv.ext; intro x + obtain ⟨z,rfl⟩ := (sumEquiv (sum U empty) (sum V empty)).surjective x + cases z with + | inl z => + obtain ⟨t,rfl⟩ := (sumEquiv U empty).surjective z + cases t with + | inr t => exact Fin.elim0 t + | inl t => + simp [toEquiv,sumHom,assoc,swap,right,inv_eq,Equiv.trans_apply,MonoidalCategory.tensorObj] + dsimp only [sum,empty] + rw [Equiv.symm_apply_apply] + rfl + | inr z => + obtain ⟨t,rfl⟩ := (sumEquiv V empty).surjective z + cases t with + | inr t => exact Fin.elim0 t + | inl t => + simp [toEquiv,sumHom,assoc,swap,right,inv_eq,Equiv.trans_apply,MonoidalCategory.tensorObj] + dsimp only [sum,empty] + rw [Equiv.symm_apply_apply] + rfl +end SimpleAmenable.PolygonObject.FiniteSetGroupoid + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Configurations/FiberBinary.lean b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/FiberBinary.lean new file mode 100644 index 0000000000000000000000000000000000000000..aad39143e5f062a3bd047dff506719fcd68098ea --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/FiberBinary.lean @@ -0,0 +1,78 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Configurations.StageBinary +import OAI.GroupTheory.SimpleAmenable.Homology.PiBinary + +namespace OAI + +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits MonoidalCategory Simplicial Opposite +namespace SimpleAmenable.PolygonTracks +open FreeChains ComponentTranslation ComponentStable + +attribute [local instance 1200] Rep.hV2 Submodule.module Submodule.Quotient.module +lemma large_complement (a:ℕ) (p:Skeleton (PolygonObject a)) : + ∃n,32 ≤ n ∧ ∃r,r*p=componentGenerator a^n := by + obtain ⟨r,k,h⟩:=componentGenerator_cofinal a p + refine ⟨32+k,by omega,componentGenerator a^32*r,?_⟩ + rw [mul_assoc,mul_comm r p,h,pow_add] +noncomputable def fiberToStage (a:ℕ) (p:Skeleton (PolygonObject a)) (n:ℕ) + (r:Skeleton (PolygonObject a)) (h:r*p=componentGenerator a^n) : + Fiber p ⥤ SingleObj (polygonFullGroup a n) := + ComponentTranslation.translate r p (componentGenerator a^n) h ⋙ + (standardFiberInclusion a n).asEquivalence.inverse +noncomputable def fiberToStageGlobal (a:ℕ) (p:Skeleton (PolygonObject a)) (n:ℕ) + (r:Skeleton (PolygonObject a)) (h:r*p=componentGenerator a^n) : + fiberToStage a p n r h ⋙ standardNerveInclusion a n ≅ + (property p).ι ⋙ tensorLeft (repr r) := by + exact Functor.isoWhiskerRight + (Functor.isoWhiskerLeft (ComponentTranslation.translate r p _ h) + (standardFiberInclusion a n).asEquivalence.counitIso) (property (componentGenerator a^n)).ι +lemma fiber_value_mem (a:ℕ) (p q:Skeleton (PolygonObject a)) + (z:((nerve (Fiber p)⊗nerve (Fiber q)).homology Z 2:A)) : + pullD (nerveMap (property p).ι) (nerveMap (property q).ι) 2 z ∈ mixedImage a := by + obtain ⟨n,hn,r,hr⟩:=large_complement a p + obtain ⟨m,hm,s,hs⟩:=large_complement a q + let f:=fiberToStage a p n r hr + let g:=fiberToStage a q m s hs + have h : SSet.homologyMap (nerveMap f⊗ₘnerveMap g) Z 2 ≫ + pullD (nerveMap (standardNerveInclusion a n)) (nerveMap (standardNerveInclusion a m)) 2 = + pullD (nerveMap (property p).ι) (nerveMap (property q).ι) 2 := by + rw [pullD_comp] + change pullD (nerveMap (fiberToStage a p n r hr ⋙ standardNerveInclusion a n)) + (nerveMap (fiberToStage a q m s hs ⋙ standardNerveInclusion a m)) 2 = _ + rw [pullD_congr (fiberToStageGlobal a p n r hr) (fiberToStageGlobal a q m s hs)] + change pullD (nerveMap (property p).ι ≫ nerveMap (tensorLeft _)) + (nerveMap (property q).ι ≫ nerveMap (tensorLeft _)) 2 = _ + rw [pullD_left,pullD_right] + have hv:=stage_value_mem a n m hn hm (SSet.homologyMap (nerveMap f⊗ₘnerveMap g) Z 2 z) + have he:=congrArg (fun k=>k z) h + exact he ▸ hv +lemma binaryD_quotient_zero (a:ℕ) : binaryD (C:=PolygonObject a) 2 ≫ ModuleCat.ofHom (mixedImage a).mkQ=0 := by + apply (cancel_epi (SSet.homologyMap (PiSSet.binaryIso (fun _:Fin 2=>nerve (PolygonObject a))).hom Z 2)).mp + apply (PiFiber.homologyIsColimit (PolygonObject a) (Fin 2) 2).hom_ext + intro p + change SSet.homologyMap (PiFiber.inclusion (PolygonObject a) (Fin 2) p.as) Z 2 ≫ + (SSet.homologyMap (PiSSet.binaryIso (fun _:Fin 2=>nerve (PolygonObject a))).hom Z 2 ≫ + (binaryD 2 ≫ ModuleCat.ofHom (mixedImage a).mkQ)) = _ + erw [←SSet.homologyMap_comp_assoc,PiFiber.binary_inclusion,SSet.homologyMap_comp_assoc] + have hp : pullD (nerveMap (property (p.as 0)).ι) (nerveMap (property (p.as 1)).ι) 2 ≫ + ModuleCat.ofHom (mixedImage a).mkQ=0 := by + apply ModuleCat.hom_ext + apply LinearMap.ext + intro z + exact (Submodule.Quotient.mk_eq_zero (mixedImage a)).mpr (fiber_value_mem a (p.as 0) (p.as 1) z) + change SSet.homologyMap _ Z 2 ≫ (pullD _ _ 2 ≫ ModuleCat.ofHom (mixedImage a).mkQ)=_ + erw [hp,comp_zero] +lemma mixedImage_finite (a:ℕ) + [Module.Finite ℤ (groupHomology (Rep.trivial ℤ (polygonFullGroup a 32) ℤ) 1)] : + Module.Finite ℤ (mixedImage a) := by + let X:=nerve (SingleObj (polygonFullGroup a 32)) + have hf : ∀i,i<2 → Module.Finite ℤ (X.homology Z i:A) := by + intro i hi + interval_cases i + · exact BarFinitePower.homology_zero_finite X + · exact Module.Finite.equiv (GroupNerveCoordinates.homologyIso (polygonFullGroup a 32) 1).symm.toLinearEquiv + have :=ConnectedProduct.finite_projection_kernel X X 2 hf hf + exact Module.Finite.range _ +end SimpleAmenable.PolygonTracks + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Configurations/FiniteAlignedConfiguration.lean b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/FiniteAlignedConfiguration.lean new file mode 100644 index 0000000000000000000000000000000000000000..642e2118169ccb6938f38252231a83763c8de1a2 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/FiniteAlignedConfiguration.lean @@ -0,0 +1,50 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.FinitelyManyTranslationRelations + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section FiniteAlignedConfiguration + +variable {α β G : Type*} [Group G] [Finite β] (f : α → G) + +theorem finite_table_subgroup_inputs_eventually (L : ℕ) + (K : Subgroup (BoundedRelationCover L f)) {T : Type*} [Group T] [Finite T] + (φ : T →* G) (hφ : ∀ s, φ s ∈ K.map (coverMap L f)) + (input : β → T) (v : β → FreeGroup α) + (hv : ∀ b, FreeGroup.lift f (v b) = φ (input b)) : + ∃ B : ℕ, ∃ hLB : L ≤ B, ∀ M : ℕ, ∀ hBM : B ≤ M, + ∃ ρ : T →* BoundedRelationCover M f, + (coverMap M f).comp ρ = φ ∧ + ρ.range ≤ K.map (coverTransition f (le_trans hLB hBM)) ∧ + ∀ b, ρ (input b) = PresentedGroup.mk (shortRelations M f) (v b) := by + choose y hy hyq using hφ + choose w hw using fun s => PresentedGroup.mk_surjective (shortRelations L f) (y s) + have hwp : ∀ s, FreeGroup.lift f (w s) = φ s := by + intro s + rw [← coverMap_mk L f,hw s,hyq s] + obtain ⟨B₁,hB₁⟩ := finite_table_lift_eventually f φ w hwp + obtain ⟨B₂,hB₂⟩ := finite_word_equalities_eventually f (fun b => w (input b)) v + (fun b => (hwp (input b)).trans (hv b).symm) + refine ⟨L+B₁+B₂,by omega,fun M hM => ?_⟩ + obtain ⟨ρ,hρ,hρw⟩ := hB₁ M (by omega) + refine ⟨ρ,hρ,?_,?_⟩ + · rintro z ⟨s,rfl⟩ + refine ⟨y s,hy s,?_⟩ + rw [← hw s,coverTransition_mk,hρw s] + · intro b + rw [hρw] + exact hB₂ M (by omega) b + +end FiniteAlignedConfiguration + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Configurations/FiveTrackGeneration.lean b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/FiveTrackGeneration.lean new file mode 100644 index 0000000000000000000000000000000000000000..f901cf124292fbd64cc232cdef44313842734b9b --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/FiveTrackGeneration.lean @@ -0,0 +1,151 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.BooleanCoordinateGeneration +import OAI.GroupTheory.SimpleAmenable.CentralCovers.ConditionalBooleanGeneration + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section FiveTrackGeneration + +noncomputable def fiveTrackHom {m : ℕ} (ι : Fin 5 ↪ Fin m) : + alternatingGroup (Fin 5) →* Equiv.Perm (Fin m) := + (Equiv.Perm.viaEmbeddingHom ι).comp (alternatingGroup (Fin 5)).subtype + +instance fiveTrackPerfect : Group.IsPerfect (alternatingGroup (Fin 5)) := + ⟨commutator_alternatingGroup_eq_top (by norm_num)⟩ + +theorem fiveTrack_sign {m : ℕ} (ι : Fin 5 ↪ Fin m) + (g : alternatingGroup (Fin 5)) : fiveTrackHom ι g ∈ alternatingGroup (Fin m) := by + classical + change Equiv.Perm.sign (g.val.viaEmbedding ι) = 1 + rw [Equiv.Perm.viaEmbedding,Equiv.Perm.sign_extendDomain] + exact g.property + +theorem fiveTrack_support {m : ℕ} (ι : Fin 5 ↪ Fin m) + (g : alternatingGroup (Fin 5)) : (fiveTrackHom ι g).support.card ≤ 5 := by + classical + have hsub : (fiveTrackHom ι g).support ⊆ Finset.univ.map ι := by + intro i hi + by_contra hn + have hn' : i ∉ Set.range ι := by simpa using hn + exact (Equiv.Perm.mem_support.mp hi) (Equiv.Perm.viaEmbedding_apply_of_notMem g.val ι i hn') + simpa using Finset.card_le_card hsub + +theorem fiveTrack_initial_generated (a : ℕ) (r : CutRing) (m : ℕ) + (ι : Fin 5 ↪ Fin (m+1)) (j : Fin 5) : + ConditionalAvailable (fiveTrackHom ι) (sourceGenerated a r m) (initialTest a r j) := by + intro g + exact sourceGenerator_mem_generated a r m + (Sum.inl (j,⟨fiveTrackHom ι g,fiveTrack_sign ι g,fiveTrack_support ι g⟩)) + +theorem fiveTrack_whole_generated (a : ℕ) (r : CutRing) (m : ℕ) + (ι : Fin 5 ↪ Fin (m+1)) : + ConditionalAvailable (fiveTrackHom ι) (sourceGenerated a r m) (wholePolygon a) := + fiveTrack_initial_generated a r m ι 0 + +noncomputable def alphabetTranslation {m : ℕ} (ι : Fin 5 ↪ Fin m) + (b : Fin m) (u : CutRing × CutRing) : Fin m → CutRing × CutRing := + ∑ j : Fin 5, (Pi.single (ι j) u - Pi.single b u) + +theorem alphabetTranslation_generated (a : ℕ) (r : CutRing) (m : ℕ) + (ι : Fin 5 ↪ Fin (m+1)) (b : Fin (m+1)) (u : CutRing × CutRing) : + trackTranslation (a := a) (alphabetTranslation ι b u) ∈ sourceGenerated a r m := by + classical + unfold alphabetTranslation + induction (Finset.univ : Finset (Fin 5)) using Finset.induction_on with + | empty => simp + | @insert i s hi ih => + rw [Finset.sum_insert hi,trackTranslation_add] + exact (sourceGenerated a r m).mul_mem (balanced_difference_generated a r m b (ι i) u) ih + +theorem alphabetTranslation_apply {m : ℕ} (ι : Fin 5 ↪ Fin m) + (b : Fin m) (hb : b ∉ Set.range ι) (u : CutRing × CutRing) (j : Fin 5) : + alphabetTranslation ι b u (ι j) = u := by + classical + have hb' : ∀ k, ι k ≠ b := fun k h => hb ⟨k,h⟩ + simp [alphabetTranslation,Finset.sum_apply,Pi.single_apply,ι.injective.eq_iff,hb'] + +theorem conditional_translation_conjugate {a m : ℕ} (U : polygonAlgebra a) + (σ : Equiv.Perm (Fin m)) (d : Fin m → CutRing × CutRing) (u : CutRing × CutRing) + (hd : ∀ i, σ i ≠ i → d i = u) : + conditionalHom (⟨translate a (-u) ⁻¹' U.val, + polygon_preimage_translate (-u) U.property⟩ : polygonAlgebra a) σ = + trackTranslation d * conditionalHom U σ * (trackTranslation d)⁻¹ := by + classical + apply Subtype.ext + apply Equiv.ext + rintro ⟨i,p⟩ + change conditionalPerm (⟨_,_⟩ : polygonAlgebra a) σ (i,p) = + trackTranslationPerm d (conditionalPerm U σ ((trackTranslationPerm d).symm (i,p))) + by_cases hi : σ i = i + · simp [conditionalPerm,trackTranslationPerm,hi,← translate_add] + · have hi' : σ (σ i) ≠ σ i := fun h => hi (σ.injective h) + have hdi := hd i hi + have hdsi := hd (σ i) hi' + by_cases hp : translate a (-u) p ∈ U.val <;> + simp_all [conditionalPerm,trackTranslationPerm,← translate_add] + +theorem fiveTrack_translate_generated (a : ℕ) (r : CutRing) (m : ℕ) + (ι : Fin 5 ↪ Fin (m+1)) (b : Fin (m+1)) (hb : b ∉ Set.range ι) + (U : polygonAlgebra a) + (hU : ConditionalAvailable (fiveTrackHom ι) (sourceGenerated a r m) U) + (u : CutRing × CutRing) : + ConditionalAvailable (fiveTrackHom ι) (sourceGenerated a r m) + ⟨translate a u ⁻¹' U.val,polygon_preimage_translate u U.property⟩ := by + intro g + let d := alphabetTranslation ι b (-u) + have hd : ∀ i, fiveTrackHom ι g i ≠ i → d i = -u := by + intro i hi + have hi' : i ∈ Set.range ι := by + by_contra hn + exact hi (Equiv.Perm.viaEmbedding_apply_of_notMem g.val ι i hn) + obtain ⟨j,rfl⟩ := hi' + exact alphabetTranslation_apply ι b hb (-u) j + have he := conditional_translation_conjugate U (fiveTrackHom ι g) d (-u) hd + simp only [neg_neg] at he + rw [he] + have ht := alphabetTranslation_generated a r m ι b (-u) + exact (sourceGenerated a r m).mul_mem ((sourceGenerated a r m).mul_mem ht (hU g)) + ((sourceGenerated a r m).inv_mem ht) + +noncomputable def fiveTrackBoolean (a : ℕ) (r : CutRing) (m : ℕ) + (ι : Fin 5 ↪ Fin (m+1)) : BooleanSubalgebra (Set (GenericSquare a)) := + conditionalBoolean (fiveTrackHom ι) (sourceGenerated a r m) + (fiveTrack_whole_generated a r m ι) + +theorem fiveTrackBoolean_translate (a : ℕ) (r : CutRing) (m : ℕ) + (ι : Fin 5 ↪ Fin (m+1)) (b : Fin (m+1)) (hb : b ∉ Set.range ι) + (u : CutRing × CutRing) {U : Set (GenericSquare a)} + (hU : U ∈ fiveTrackBoolean a r m ι) : + translate a u ⁻¹' U ∈ fiveTrackBoolean a r m ι := by + obtain ⟨hU,hU'⟩ := hU + exact ⟨polygon_preimage_translate u hU, + fiveTrack_translate_generated a r m ι b hb ⟨U,hU⟩ hU' u⟩ + +theorem fiveTrackBoolean_initial (a : ℕ) (r : CutRing) (m : ℕ) + (ι : Fin 5 ↪ Fin (m+1)) (j : Fin 5) : + (initialTest a r j).val ∈ fiveTrackBoolean a r m ι := + ⟨(initialTest a r j).property,fiveTrack_initial_generated a r m ι j⟩ + +theorem fiveTrackBoolean_coordinate (a : ℕ) (r : CutRing) (m : ℕ) + (ι : Fin 5 ↪ Fin (m+1)) (b : Fin (m+1)) (hb : b ∉ Set.range ι) + (j : Fin 2) (z : CutRing) : + halfPlane a (Fin.castLE (by omega) j) z ∈ fiveTrackBoolean a r m ι := by + apply coordinate_cuts_generated _ j + (fun u _ hU => fiveTrackBoolean_translate a r m ι b hb u hU) + fin_cases j + · exact fiveTrackBoolean_initial a r m ι 1 + · exact fiveTrackBoolean_initial a r m ι 2 + +end FiveTrackGeneration + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Configurations/FlagExchangeAction.lean b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/FlagExchangeAction.lean new file mode 100644 index 0000000000000000000000000000000000000000..fcf7604e9e4ececd92a03af7a6954daf73685098 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/FlagExchangeAction.lean @@ -0,0 +1,130 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.FlagTranslation + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section FlagExchangeAction +open Classical + +theorem flagMem_top {a : ℕ} {v : ℝ×ℝ} (z : SquareFlag a v) : + flagMem (⊤ : polygonAlgebra a) z := by + have h := flagMem_compl (⊥ : polygonAlgebra a) z + simpa using h.mpr (flagMem_bot z) + +theorem flagMem_inf {a : ℕ} {v : ℝ×ℝ} (U V : polygonAlgebra a) (z : SquareFlag a v) : + flagMem (U⊓V) z ↔ flagMem U z ∧ flagMem V z := by + have he : U⊓V=(Uᶜ⊔Vᶜ)ᶜ := by simp + rw [he,flagMem_compl,flagMem_sup,flagMem_compl,flagMem_compl] + tauto + +theorem flagMem_nonempty {a : ℕ} {v : ℝ×ℝ} {U : polygonAlgebra a} + {z : SquareFlag a v} (hz : flagMem U z) : U.val.Nonempty := by + obtain ⟨N,hN,hzN,h⟩ := flagMem_iff U z + obtain ⟨p,hp,hpv⟩ := squareSector_generic z hN hzN + exact ⟨p,(h p hp hpv).mpr hz⟩ + +abbrev FlagTrackPoint (a m : ℕ) (v : ℝ×ℝ) := Fin m × SquareFlag a v + +theorem flagChart_exists {a m : ℕ} {v : ℝ×ℝ} (g : polygonFullGroup a m) + (z : FlagTrackPoint a m v) : + ∃ c : TableChart a m, c.Holds g.val ∧ z.1=c.source ∧ flagMem c.domain z.2 := by + obtain ⟨S,hS,hcover⟩ := g.property + obtain ⟨p,_,_,hp⟩ := flagValue_finite + (fun c : S => fun p : GenericSquare a => decide (p∈c.val.domain.val)) + (fun c => polygon_hasSquareArrangement c.val.domain.property) + z.2 isOpen_univ (Set.mem_univ _) + obtain ⟨c,hc,htrack,hcp⟩ := hcover (z.1,p) + refine ⟨c,hS c hc,htrack,?_⟩ + exact (hp ⟨c,hc⟩).symm.trans (decide_eq_true hcp) + +theorem flagChart_values_eq {a m : ℕ} {v : ℝ×ℝ} {f : TrackPoint a m → TrackPoint a m} + {c d : TableChart a m} (hc : c.Holds f) (hd : d.Holds f) + {z : FlagTrackPoint a m v} (hcs : z.1=c.source) (hds : z.1=d.source) + (hcz : flagMem c.domain z.2) (hdz : flagMem d.domain z.2) : + (c.target,flagTranslate c.shift z.2)=(d.target,flagTranslate d.shift z.2) := by + obtain ⟨p,hp⟩ := flagMem_nonempty ((flagMem_inf c.domain d.domain z.2).mpr ⟨hcz,hdz⟩) + have hev : (c.target,translate a c.shift p)=(d.target,translate a d.shift p) := by + have hsource : c.source=d.source := hcs.symm.trans hds + rw [← hc p hp.1,← hd p hp.2,hsource] + have ht := congrArg Prod.fst hev + have hu := orbitRepresentative_eq_of_translate_eq p (congrArg Prod.snd hev) + refine Prod.ext (show c.target=d.target from ht) ?_ + rw [flagTranslate_reduce c.shift,flagTranslate_reduce d.shift,hu] + +noncomputable def flagChart {a m : ℕ} {v : ℝ×ℝ} (g : polygonFullGroup a m) + (z : FlagTrackPoint a m v) : TableChart a m := Classical.choose (flagChart_exists g z) + +theorem flagChart_spec {a m : ℕ} {v : ℝ×ℝ} (g : polygonFullGroup a m) + (z : FlagTrackPoint a m v) : + (flagChart g z).Holds g.val ∧ z.1=(flagChart g z).source ∧ + flagMem (flagChart g z).domain z.2 := Classical.choose_spec (flagChart_exists g z) + +noncomputable def flagAction {a m : ℕ} {v : ℝ×ℝ} (g : polygonFullGroup a m) + (z : FlagTrackPoint a m v) : FlagTrackPoint a m v := + ((flagChart g z).target,flagTranslate (flagChart g z).shift z.2) + +theorem flagAction_apply {a m : ℕ} {v : ℝ×ℝ} (g : polygonFullGroup a m) + (z : FlagTrackPoint a m v) (c : TableChart a m) (hc : c.Holds g.val) + (hcs : z.1=c.source) (hcz : flagMem c.domain z.2) : + flagAction g z=(c.target,flagTranslate c.shift z.2) := by + exact flagChart_values_eq (flagChart_spec g z).1 hc (flagChart_spec g z).2.1 hcs + (flagChart_spec g z).2.2 hcz + +@[simp] theorem flagAction_one {a m : ℕ} {v : ℝ×ℝ} (z : FlagTrackPoint a m v) : + flagAction (1 : polygonFullGroup a m) z=z := by + let c : TableChart a m := ⟨z.1,z.1,0,⊤⟩ + have hc : c.Holds (1 : polygonFullGroup a m).val := by + intro p _ + simp [c] + have h := flagAction_apply 1 z c hc rfl (flagMem_top z.2) + simpa only [c,flagTranslate_zero,Prod.eta] using h + +theorem flagAction_mul {a m : ℕ} {v : ℝ×ℝ} (f g : polygonFullGroup a m) + (z : FlagTrackPoint a m v) : flagAction (f*g) z=flagAction f (flagAction g z) := by + let d := flagChart g z + let c := flagChart f (flagAction g z) + have hd : d.Holds g.val ∧ z.1=d.source ∧ flagMem d.domain z.2 := flagChart_spec g z + have hc : c.Holds f.val ∧ (flagAction g z).1=c.source ∧ + flagMem c.domain (flagAction g z).2 := flagChart_spec f (flagAction g z) + have hcd : c.source=d.target := hc.2.1.symm + have hcomp : (c.comp d).Holds (f*g).val := by + exact TableChart.comp_holds (f := f.val) (g := g.val) hc.1 hd.1 hcd + have hcdom : flagMem (c.comp d).domain z.2 := by + change flagMem (d.domain⊓⟨translate a d.shift ⁻¹' c.domain.val, + polygon_preimage_translate d.shift c.domain.property⟩) z.2 + rw [flagMem_inf,flagMem_preimage_translate] + exact ⟨hd.2.2,hc.2.2⟩ + calc + flagAction (f*g) z = ((c.comp d).target,flagTranslate (c.comp d).shift z.2) := + flagAction_apply (f*g) z (c.comp d) hcomp hd.2.1 hcdom + _ = flagAction f (flagAction g z) := by + change (c.target,flagTranslate (c.shift+d.shift) z.2)= + (c.target,flagTranslate c.shift (flagTranslate d.shift z.2)) + rw [flagTranslate_add] + +noncomputable def flagPermutation {a m : ℕ} {v : ℝ×ℝ} (g : polygonFullGroup a m) : + Equiv.Perm (FlagTrackPoint a m v) where + toFun := flagAction g + invFun := flagAction g⁻¹ + left_inv z := by rw [← flagAction_mul,inv_mul_cancel,flagAction_one] + right_inv z := by rw [← flagAction_mul,mul_inv_cancel,flagAction_one] + +noncomputable def flagRepresentation (a m : ℕ) (v : ℝ×ℝ) : + polygonFullGroup a m →* Equiv.Perm (FlagTrackPoint a m v) where + toFun := flagPermutation + map_one' := by apply Equiv.ext; intro z; exact flagAction_one z + map_mul' f g := by apply Equiv.ext; intro z; exact flagAction_mul f g z + +end FlagExchangeAction + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Configurations/FormalSectorProjection.lean b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/FormalSectorProjection.lean new file mode 100644 index 0000000000000000000000000000000000000000..ce703b012fda4954a53c5d51befea3ceef5192d7 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/FormalSectorProjection.lean @@ -0,0 +1,91 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.PairControl +import OAI.GroupTheory.SimpleAmenable.CentralCovers.FormalSectorSubfamily +import OAI.GroupTheory.SimpleAmenable.CentralCovers.FormalStarTables + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section FormalSectorProjection +variable {α ι Ω H Q : Type*} [Fintype α] [DecidableEq α] [Group H] [Group Q] + +theorem alternating_function_center (hα : 4 ≤ Nat.card α) : + Subgroup.center (Ω → alternatingGroup α)=⊥ := by + rw [Subgroup.center_pi] + simp only [alternatingGroup.center_eq_bot hα,Subgroup.pi_bot] + +theorem assignmentPullback_surjective {X Y E : Type*} [Group E] (v : X → Y) + (hv : Function.Injective v) : Function.Surjective (assignmentPullback (E := E) v) := by + classical + intro f + refine ⟨Function.extend v f (fun _ => 1),?_⟩ + ext x + exact congrFun (Function.extend_comp hv f (fun _ => 1)) x + +namespace FormalStarTable +variable [Group.IsPerfect (alternatingGroup α)] [Finite ι] + {F : Option ι → TrackStar α →* H} (T : FormalStarTable F) + +theorem sector_projection (hα : 4 ≤ Nat.card α) + (q : H →* Q) (ρ : (Ω → alternatingGroup α) →* Q) (hρ : Function.Injective ρ) + (δ : ((ι → Bool) → alternatingGroup α) →* (Ω → alternatingGroup α)) + (hδ : Function.Surjective δ) + (hp : ∀ i, q.comp (F i)=ρ.comp (δ.comp + ((maskFamily (fun j : ι => {σ : ι → Bool | σ j=true}) i).comp (universalProjection _)))) + (V : Set (ι → Bool)) (s : TrackStar α) : + q (T.sector V s)=ρ (δ (sectorMask V (universalProjection _ s))) := by + let e := copyFamilyEval T.input + let v := δ.comp (formalAssignmentEval (universalProjection (alternatingGroup α))) + have hv : Function.Surjective v := hδ.comp (formalAssignmentEval_surjective + (universalProjection (alternatingGroup α)) (universalProjection_surjective _)) + have he : (q.comp T.carrier.subtype).comp e=ρ.comp v := by + rw [MonoidHom.comp_assoc,T.input_eval] + apply FreeGroup.ext_hom + rintro ⟨i,t⟩ + have hh := DFunLike.congr_fun (hp i) t + simpa only [MonoidHom.comp_apply,v,formalAssignmentEval,copySourceMap,FreeGroup.map.of, + assignmentEval,copyFamilyEval_of] using hh + have hk : ∀ w, e w=1 → v w=1 := by + intro w hw + apply hρ + have hh := DFunLike.congr_fun he w + change q ((e w).val)=ρ (v w) at hh + rw [hw,Subgroup.coe_one,map_one] at hh + simpa only [map_one] using hh.symm + let γ : T.carrier →* (Ω → alternatingGroup α) := + e.liftOfSurjective T.input_surjective ⟨v,hk⟩ + have hγe : γ.comp e=v := e.liftOfRightInverse_comp _ _ _ + have hγ : Function.Surjective γ := by + intro x + obtain ⟨w,rfl⟩ := hv x + exact ⟨e w,DFunLike.congr_fun hγe w⟩ + have hγp : q.comp T.carrier.subtype=ρ.comp γ := by + apply (MonoidHom.cancel_right T.input_surjective).mp + change (q.comp T.carrier.subtype).comp e=(ρ.comp γ).comp e + change (q.comp T.carrier.subtype).comp e=ρ.comp (γ.comp e) + rw [hγe] + exact he + have hγi (i : Option ι) : γ.comp (T.input i)=δ.comp + ((maskFamily (fun j : ι => {σ : ι → Bool | σ j=true}) i).comp (universalProjection _)) := by + apply MonoidHom.ext + intro t + have hh := DFunLike.congr_fun hγe (FreeGroup.of (i,t)) + simpa only [MonoidHom.comp_apply,e,v,copyFamilyEval_of,formalAssignmentEval, + copySourceMap,FreeGroup.map.of,assignmentEval] using hh + have hs := T.sector_forward γ hγ (alternating_function_center hα) δ hγi V s + have hh := DFunLike.congr_fun hγp (centralSector T.model V s) + simpa only [MonoidHom.comp_apply,sector,hs] using hh + +end FormalStarTable +end FormalSectorProjection + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Configurations/LabelTranslation.lean b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/LabelTranslation.lean new file mode 100644 index 0000000000000000000000000000000000000000..e3606062e692333ed001ffaf0b73064cc16b52a0 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/LabelTranslation.lean @@ -0,0 +1,159 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.LabelledMonoidal + +namespace OAI + +open CategoryTheory MonoidalCategory +namespace SimpleAmenable.PolygonObject.Labelled + +variable {a n : ℕ} (d : (Fin n → CutRing × CutRing) → CutRing × CutRing) +noncomputable def translateObj (U : Labelled a n) : Labelled a n where + polygon := shifted U.polygon (fun i => d (U.label i)) + label := U.label + reduced := U.reduced +noncomputable abbrev translateArrow (U : Labelled a n) : U.polygon ⟶ (translateObj d U).polygon := + shiftArrow U.polygon (fun i => d (U.label i)) +noncomputable def translateHom {U V : Labelled a n} (f : U ⟶ V) : translateObj d U ⟶ translateObj d V where + arrow := inv (translateArrow d U) ≫ f.arrow ≫ translateArrow d V + positional x := by + obtain ⟨y,rfl⟩ := (translateArrow d U).toEquiv.surjective x + simp only [arrow_comp_apply,inv_arrow_apply,Equiv.symm_apply_apply] + change translate a (d (V.label (f.arrow.toEquiv y).val.1)) (f.arrow.toEquiv y).val.2 = + translate a (d (U.label y.val.1)) y.val.2 + rw [f.labelled,f.positional] + labelled x := by + obtain ⟨y,rfl⟩ := (translateArrow d U).toEquiv.surjective x + simp only [arrow_comp_apply,inv_arrow_apply,Equiv.symm_apply_apply] + exact f.labelled y +noncomputable def translateFunctor : Labelled a n ⥤ Labelled a n where + obj := translateObj d + map := translateHom d + map_id U := by + apply Hom.ext + change inv _ ≫ 𝟙 _ ≫ _ = _ + simp + rfl + map_comp f g := by + apply Hom.ext + change inv _ ≫ (f.arrow ≫ g.arrow) ≫ _ = (inv _ ≫ f.arrow ≫ _) ≫ (inv _ ≫ g.arrow ≫ _) + simp only [Category.assoc,IsIso.hom_inv_id_assoc] +noncomputable def translationIso : forget (a:=a) (n:=n) ≅ translateFunctor d ⋙ forget := + NatIso.ofComponents (fun U => by + let e := asIso (translateArrow d U) + exact e) (by + intro U V f + change f.arrow ≫ translateArrow d V = translateArrow d U ≫ + (inv (translateArrow d U) ≫ f.arrow ≫ translateArrow d V) + simp) +noncomputable def translationCore : (translateFunctor (a:=a) d ⋙ forget).CoreMonoidal := + Functor.Monoidal.coreMonoidalTransport (translationIso d) +lemma translationCore_unit : (translationCore (a:=a) d).εIso.hom=translateArrow d (𝟙_ _) := by + exact Category.id_comp (translateArrow d (𝟙_ _)) +lemma translationCore_tensor (U V:Labelled a n) : + ((translationCore d).μIso U V).hom = + inv (sumArrow (translateArrow d U) (translateArrow d V)) ≫ translateArrow d (U⊗V) := by + change (inv (translateArrow d U) ⊗ₘ inv (translateArrow d V)) ≫ 𝟙 _ ≫ _ = _ + erw [Category.id_comp] + congr 1 + apply (cancel_epi (sumArrow (translateArrow d U) (translateArrow d V))).mp + change (_ ⊗ₘ _) ≫ (_ ⊗ₘ _) = _ + rw [tensorHom_comp_tensorHom] + simp + rfl +noncomputable def translationUnit : 𝟙_ (Labelled a n) ⟶ (translateFunctor d).obj (𝟙_ _) where + arrow := translateArrow d (𝟙_ _) + positional x := by change Point PolygonObject.empty at x; exact isEmptyElim x + labelled x := by change Point PolygonObject.empty at x; exact isEmptyElim x +noncomputable def translationTensor (U V:Labelled a n) : + (translateFunctor d).obj U ⊗ (translateFunctor d).obj V ⟶ (translateFunctor d).obj (U⊗V) where + arrow := inv (sumArrow (translateArrow d U) (translateArrow d V)) ≫ translateArrow d (U⊗V) + positional x := by + erw [arrow_comp_apply,inv_arrow_apply] + change ((translateArrow d (sum U V)).toEquiv + ((sumArrow (translateArrow d U) (translateArrow d V)).toEquiv.symm x)).val.2 = x.val.2 + obtain ⟨y,rfl⟩ := (sumArrow (translateArrow d U) (translateArrow d V)).toEquiv.surjective x + rw [Equiv.symm_apply_apply] + change translate a (d ((sum U V).label y.val.1)) y.val.2 = + ((sumArrow (translateArrow d U) (translateArrow d V)).toEquiv y).val.2 + obtain ⟨z,rfl⟩ := (sumPointEquiv U.polygon V.polygon).surjective y + cases z <;> (first | erw [sumArrow_inl] | erw [sumArrow_inr]) <;> + simp only [sumPointEquiv_inl,sumPointEquiv_inr, + translateArrow,Fin.addCases_left,Fin.addCases_right] + all_goals rfl + labelled x := by + erw [arrow_comp_apply,inv_arrow_apply] + change (sum U V).label ((translateArrow d (sum U V)).toEquiv + ((sumArrow (translateArrow d U) (translateArrow d V)).toEquiv.symm x)).val.1 = + (sum (translateObj d U) (translateObj d V)).label x.val.1 + obtain ⟨y,rfl⟩ := (sumArrow (translateArrow d U) (translateArrow d V)).toEquiv.surjective x + rw [Equiv.symm_apply_apply] + change (sum U V).label y.val.1 = + (sum (translateObj d U) (translateObj d V)).label + ((sumArrow (translateArrow d U) (translateArrow d V)).toEquiv y).val.1 + obtain ⟨z,rfl⟩ := (sumPointEquiv U.polygon V.polygon).surjective y + cases z <;> (first | erw [sumArrow_inl] | erw [sumArrow_inr]) <;> rfl +lemma translationTensor_arrow (U V : Labelled a n) : + (translationTensor d U V).arrow=((translationCore d).μIso U V).hom := by + rw [translationCore_tensor]; rfl +lemma translationUnit_arrow : (translationUnit (a:=a) d).arrow=(translationCore d).εIso.hom := by + rw [translationCore_unit]; rfl +noncomputable instance translationMonoidal : (translateFunctor (a:=a) d).Monoidal := + Functor.CoreMonoidal.toMonoidal { + εIso := asIso (translationUnit d) + μIso U V := asIso (translationTensor d U V) + μIso_hom_natural_left := by + intro U V f W + apply Hom.ext + change sumArrow (translateHom d f).arrow (𝟙 _) ≫ (translationTensor d V W).arrow = + (translationTensor d U W).arrow ≫ (translateHom d (f ▷ W)).arrow + rw [translationTensor_arrow,translationTensor_arrow] + exact (translationCore d).μIso_hom_natural_left f W + μIso_hom_natural_right := by + intro U V W f + apply Hom.ext + change sumArrow (𝟙 _) (translateHom d f).arrow ≫ (translationTensor d W V).arrow = + (translationTensor d W U).arrow ≫ (translateHom d (W ◁ f)).arrow + rw [translationTensor_arrow,translationTensor_arrow] + exact (translationCore d).μIso_hom_natural_right W f + associativity := by + intro U V W + apply Hom.ext + change sumArrow (translationTensor d U V).arrow (𝟙 _) ≫ + (translationTensor d (U⊗V) W).arrow ≫ (translateHom d (α_ U V W).hom).arrow = + sumAssoc _ _ _ ≫ sumArrow (𝟙 _) (translationTensor d V W).arrow ≫ + (translationTensor d U (V⊗W)).arrow + simp only [translationTensor_arrow] + exact (translationCore d).associativity U V W + left_unitality := by + intro U + apply Hom.ext + change leftUnit _ = sumArrow (translationUnit d).arrow (𝟙 _) ≫ + (translationTensor d (𝟙_ _) U).arrow ≫ (translateHom d (λ_ U).hom).arrow + rw [translationUnit_arrow,translationTensor_arrow] + exact (translationCore d).left_unitality U + right_unitality := by + intro U + apply Hom.ext + change rightUnit _ = sumArrow (𝟙 _) (translationUnit d).arrow ≫ + (translationTensor d U (𝟙_ _)).arrow ≫ (translateHom d (ρ_ U).hom).arrow + rw [translationUnit_arrow,translationTensor_arrow] + exact (translationCore d).right_unitality U } +noncomputable instance translationBraided : (translateFunctor (a:=a) d).Braided where + braided U V := by + apply Hom.ext + change (translationTensor d U V).arrow ≫ (translateHom d (β_ U V).hom).arrow = + sumSwap _ _ ≫ (translationTensor d V U).arrow + change (inv (sumArrow (translateArrow d U) (translateArrow d V)) ≫ translateArrow d (U⊗V)) ≫ + (inv (translateArrow d (U⊗V)) ≫ sumSwap _ _ ≫ translateArrow d (V⊗U)) = + sumSwap _ _ ≫ inv (sumArrow (translateArrow d V) (translateArrow d U)) ≫ translateArrow d (V⊗U) + simp only [Category.assoc,IsIso.hom_inv_id_assoc] + apply (cancel_epi (sumArrow (translateArrow d U) (translateArrow d V))).mp + simp only [IsIso.hom_inv_id_assoc] + have h := BraidedCategory.braiding_naturality (translateArrow d U) (translateArrow d V) + change sumArrow (translateArrow d U) (translateArrow d V) ≫ sumSwap _ _ = + sumSwap _ _ ≫ sumArrow (translateArrow d V) (translateArrow d U) at h + rw [←Category.assoc (sumArrow (translateArrow d U) (translateArrow d V)),h] + simp +end SimpleAmenable.PolygonObject.Labelled + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Configurations/LabelledStringEquiv.lean b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/LabelledStringEquiv.lean new file mode 100644 index 0000000000000000000000000000000000000000..3ee288bdc1ad7a26cf559e6df9a79c769ed42fa7 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/LabelledStringEquiv.lean @@ -0,0 +1,150 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Configurations.TrajectoryStages +import OAI.GroupTheory.SimpleAmenable.Simplicial.TripleBarMaps + +namespace OAI + +section + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory MonoidalCategory +namespace SimpleAmenable.PolygonObject.Labelled + +variable {a n : ℕ} +noncomputable def initialCore : (toStrings (a:=a) (n:=n) ⋙ stringEval).CoreMonoidal := + Functor.Monoidal.coreMonoidalTransport initialIso +lemma initialCore_unit : (initialCore (a:=a) (n:=n)).εIso.hom=initial (𝟙_ _) := by + change 𝟙 _ ≫ initial (𝟙_ _) = _ + exact Category.id_comp _ +lemma initialCore_tensor (U V : Labelled a n) : + (initialCore.μIso U V).hom=tensorInitial U V := by + change (inv (initial U) ⊗ₘ inv (initial V)) ≫ 𝟙 _ ≫ initial (U⊗V) = + inv (sumArrow (initial U) (initial V)) ≫ initial (U⊗V) + simp only [Category.id_comp] + congr 1 + apply (cancel_epi (sumArrow (initial U) (initial V))).mp + change (initial U ⊗ₘ initial V) ≫ (inv (initial U) ⊗ₘ inv (initial V)) = _ + rw [tensorHom_comp_tensorHom] + simp + rfl +noncomputable def stringsCore : (toStrings (a:=a) (n:=n)).CoreMonoidal where + εIso := @asIso (StringGroupoid a n) _ _ _ unitLadder + (IsIso.of_groupoid (C := StringGroupoid a n) _) + μIso U V := @asIso (StringGroupoid a n) _ _ _ (tensorLadder U V) + (IsIso.of_groupoid (C := StringGroupoid a n) _) + μIso_hom_natural_left := by + intro U V f W + apply (stringEval (a:=a) (n:=n)).map_injective + change sumArrow ((ladder f).hom.app 0) (𝟙 _) ≫ (tensorLadder V W).hom.app 0 = + (tensorLadder U W).hom.app 0 ≫ (ladder (f ▷ W)).hom.app 0 + rw [tensorLadder_zero,tensorLadder_zero,←initialCore_tensor,←initialCore_tensor] + exact initialCore.μIso_hom_natural_left f W + μIso_hom_natural_right := by + intro U V W f + apply (stringEval (a:=a) (n:=n)).map_injective + change sumArrow (𝟙 _) ((ladder f).hom.app 0) ≫ (tensorLadder W V).hom.app 0 = + (tensorLadder W U).hom.app 0 ≫ (ladder (W ◁ f)).hom.app 0 + rw [tensorLadder_zero,tensorLadder_zero,←initialCore_tensor,←initialCore_tensor] + exact initialCore.μIso_hom_natural_right W f + associativity := by + intro U V W + apply (stringEval (a:=a) (n:=n)).map_injective + change sumArrow ((tensorLadder U V).hom.app 0) (𝟙 _) ≫ + (tensorLadder (U⊗V) W).hom.app 0 ≫ (ladder (α_ U V W).hom).hom.app 0 = + sumAssoc _ _ _ ≫ sumArrow (𝟙 _) ((tensorLadder V W).hom.app 0) ≫ + (tensorLadder U (V⊗W)).hom.app 0 + simp only [tensorLadder_zero,←initialCore_tensor] + exact initialCore.associativity U V W + left_unitality := by + intro U + apply (stringEval (a:=a) (n:=n)).map_injective + change leftUnit _ = sumArrow (unitLadder.hom.app 0) (𝟙 _) ≫ + (tensorLadder (𝟙_ _) U).hom.app 0 ≫ (ladder (λ_ U).hom).hom.app 0 + rw [unitLadder_zero,tensorLadder_zero,←initialCore_unit,←initialCore_tensor] + exact initialCore.left_unitality U + right_unitality := by + intro U + apply (stringEval (a:=a) (n:=n)).map_injective + change rightUnit _ = sumArrow (𝟙 _) (unitLadder.hom.app 0) ≫ + (tensorLadder U (𝟙_ _)).hom.app 0 ≫ (ladder (ρ_ U).hom).hom.app 0 + rw [unitLadder_zero,tensorLadder_zero,←initialCore_unit,←initialCore_tensor] + exact initialCore.right_unitality U +noncomputable instance : (toStrings (a:=a) (n:=n)).Monoidal := stringsCore.toMonoidal +noncomputable instance : (toStrings (a:=a) (n:=n)).Braided where + braided U V := by + apply (stringEval (a:=a) (n:=n)).map_injective + change (tensorLadder U V).hom.app 0 ≫ (ladder (β_ U V).hom).hom.app 0 = + sumSwap _ _ ≫ (tensorLadder V U).hom.app 0 + rw [tensorLadder_zero,tensorLadder_zero,ladder_zero] + change (inv (sumArrow (initial U) (initial V)) ≫ initial (U⊗V)) ≫ + (inv (initial (U⊗V)) ≫ sumSwap _ _ ≫ initial (V⊗U)) = + sumSwap _ _ ≫ inv (sumArrow (initial V) (initial U)) ≫ initial (V⊗U) + simp only [Category.assoc,IsIso.hom_inv_id_assoc] + apply (cancel_epi (sumArrow (initial U) (initial V))).mp + simp only [IsIso.hom_inv_id_assoc] + have h := BraidedCategory.braiding_naturality (initial U) (initial V) + change sumArrow (initial U) (initial V) ≫ sumSwap _ _ = + sumSwap _ _ ≫ sumArrow (initial V) (initial U) at h + rw [←Category.assoc (sumArrow (initial U) (initial V)),h] + simp + +lemma tripleBar_homology_isIso (j : ℕ) : + IsIso (SSet.homologyMap (IntervalBar.Diagram.bar₃Map (toStrings (a:=a) (n:=n))) + DiagonalResolution.Z j) := + IntervalBar.Diagram.bar₃Map_homology_isIso toStrings j +end SimpleAmenable.PolygonObject.Labelled + +end + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Classical +namespace SimpleAmenable.PolygonObject.LabelledStage + +variable {a n : ℕ} +variable {I : Type} [Category.{0} I] [Finite I] [∀i j:I,Finite (i ⟶ j)] + +theorem exists_common_stage (F : I ⥤ Labelled a n) : + ∃ (P : BooleanPartition a) (s : ℕ) (L : Fin s → Fin n → CutRing × CutRing), + (∀j i,orbitRepresentative (L j i)=L j i) ∧ Function.Injective L ∧ + ∃G : I ⥤ UniformObject P L, G ⋙ UniformObject.forget=F := by + let : Fintype I := Fintype.ofFinite I + let (i j : I) : Fintype (i ⟶ j) := Fintype.ofFinite (i ⟶ j) + let Ar := Σi:I,Σj:I,i ⟶ j + let u : Ar → I := fun t => t.1 + let v : Ar → I := fun t => t.2.1 + let f : ∀t:Ar,F.obj (u t) ⟶ F.obj (v t) := fun t => F.map t.2.2 + obtain ⟨P,hP,hf⟩ := Labelled.exists_uniform_partition F.obj u v f + let label : (Σi:I,Fin (F.obj i).polygon.tracks) → Fin n → CutRing × CutRing := + fun t => (F.obj t.1).label t.2 + let S := Set.range label + have : Fintype S := (Set.finite_range label).fintype + let L : Fin (Fintype.card S) → Fin n → CutRing × CutRing := + fun j => ((Fintype.equivFin S).symm j).val + have hL : ∀j i,orbitRepresentative (L j i)=L j i := by + intro j i + obtain ⟨⟨k,t⟩,hk⟩ := ((Fintype.equivFin S).symm j).property + change orbitRepresentative (((Fintype.equivFin S).symm j).val i)=(((Fintype.equivFin S).symm j).val i) + rw [←hk] + exact (F.obj k).reduced t i + have hLi : Function.Injective L := by + intro i j h + exact (Fintype.equivFin S).symm.injective (Subtype.ext h) + let obj (i : I) : UniformObject P L := { + obj := F.obj i + uniform := hP i + supported := fun j => ⟨Fintype.equivFin S ⟨label ⟨i,j⟩,⟨⟨i,j⟩,rfl⟩⟩,by + simp only [L,Equiv.symm_apply_apply]; rfl⟩ } + let G : I ⥤ UniformObject P L := { + obj := obj + map {i j} g := ⟨F.map g,hf ⟨i,j,g⟩⟩ + map_id i := UniformObject.Hom.ext _ _ (F.map_id i) + map_comp g h := UniformObject.Hom.ext _ _ (F.map_comp g h) } + refine ⟨P,Fintype.card S,L,hL,hLi,G,?_⟩ + rfl +end SimpleAmenable.PolygonObject.LabelledStage + +end + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Configurations/PointFiberEvaluation.lean b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/PointFiberEvaluation.lean new file mode 100644 index 0000000000000000000000000000000000000000..4c45fc088d3848e17ffdb7e73cee58cedfa5ee72 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/PointFiberEvaluation.lean @@ -0,0 +1,209 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.LabelledMonoidal +import OAI.GroupTheory.SimpleAmenable.Simplicial.FiniteSetMonoidal + +namespace OAI + +section +open CategoryTheory Classical Set MonoidalCategory +namespace SimpleAmenable.PolygonObject.Labelled.PointFiber + +variable {a n : ℕ} +abbrev Fiber (U : Labelled a n) (b : GenericSquare a × (Fin n → CutRing × CutRing)) := + {x : U.polygon.Point // x.val.2=b.1 ∧ U.label x.val.1=b.2} + +noncomputable instance (U : Labelled a n) (b : GenericSquare a × (Fin n → CutRing × CutRing)) : Fintype (Fiber U b) := + Fintype.ofInjective (fun x : Fiber U b => x.val.val.1) (by + intro x y h + apply Subtype.ext + apply Subtype.ext + exact Prod.ext h (x.property.1.trans y.property.1.symm)) + +noncomputable def fiberMap {U V : Labelled a n} (f : U ⟶ V) (b : GenericSquare a × (Fin n → CutRing × CutRing)) : + Fiber U b ≃ Fiber V b where + toFun x := ⟨f.arrow.toEquiv x.val, + (f.positional x.val).trans x.property.1, + (f.labelled x.val).trans x.property.2⟩ + invFun y := ⟨f.arrow.toEquiv.symm y.val,by + have h := f.positional (f.arrow.toEquiv.symm y.val) + rw [Equiv.apply_symm_apply] at h + exact h.symm.trans y.property.1,by + have h := f.labelled (f.arrow.toEquiv.symm y.val) + rw [Equiv.apply_symm_apply] at h + exact h.symm.trans y.property.2⟩ + left_inv _ := Subtype.ext (Equiv.symm_apply_apply _ _) + right_inv _ := Subtype.ext (Equiv.apply_symm_apply _ _) + +noncomputable def evaluation : Labelled a n ⥤ (GenericSquare a × (Fin n → CutRing × CutRing) → FiniteSetGroupoid) where + obj U b := ⟨Fintype.card (Fiber U b)⟩ + map {U V} f b := (Fintype.equivFin (Fiber U b)).symm.trans + ((fiberMap f b).trans (Fintype.equivFin (Fiber V b))) + map_id U := by + funext b + apply Equiv.ext + intro j + change (Fintype.equivFin (Fiber U b)) ((fiberMap (𝟙 U) b) + ((Fintype.equivFin (Fiber U b)).symm j))=j + change (Fintype.equivFin (Fiber U b)) ((Fintype.equivFin (Fiber U b)).symm j)=j + exact Equiv.apply_symm_apply _ _ + map_comp {U V W} f g := by + funext b + apply Equiv.ext + intro j + change (Fintype.equivFin (Fiber W b)) ((fiberMap (f≫g) b) _)= + (Fintype.equivFin (Fiber W b)) ((fiberMap g b) + ((Fintype.equivFin (Fiber V b)).symm ((Fintype.equivFin (Fiber V b)) _))) + rw [Equiv.symm_apply_apply] + rfl + +end SimpleAmenable.PolygonObject.Labelled.PointFiber + +end + +section +open CategoryTheory Classical Set MonoidalCategory +namespace SimpleAmenable.PolygonObject.Labelled.PointFiber + +variable {a n : ℕ} +variable (U V : Labelled a n) (b : GenericSquare a × (Fin n → CutRing × CutRing)) +noncomputable def fiberSumFun : Fiber U b ⊕ Fiber V b → Fiber (sum U V) b + | .inl x => ⟨sumPointEquiv U.polygon V.polygon (.inl x.val),by + simpa only [sumPointEquiv_inl] using x.property.1,by + simpa only [sum,sumPointEquiv_inl,Fin.addCases_left] using x.property.2⟩ + | .inr y => ⟨sumPointEquiv U.polygon V.polygon (.inr y.val),by + simpa only [sumPointEquiv_inr] using y.property.1,by + simpa only [sum,sumPointEquiv_inr,Fin.addCases_right] using y.property.2⟩ +noncomputable def fiberSum : Fiber U b ⊕ Fiber V b ≃ Fiber (sum U V) b := + Equiv.ofBijective (fiberSumFun U V b) ⟨by + intro x y h + have h' := congrArg Subtype.val h + cases x <;> cases y + · exact congrArg Sum.inl (Subtype.ext (Sum.inl.inj ((sumPointEquiv _ _).injective h'))) + · cases ((sumPointEquiv _ _).injective h') + · cases ((sumPointEquiv _ _).injective h') + · exact congrArg Sum.inr (Subtype.ext (Sum.inr.inj ((sumPointEquiv _ _).injective h'))),by + intro z + obtain ⟨x,hx⟩ := (sumPointEquiv U.polygon V.polygon).surjective z.val + cases x with + | inl x => + have hp : x.val.2=b.1 ∧ U.label x.val.1=b.2 := by + simpa only [←hx,sumPointEquiv_inl,sum,Fin.addCases_left] using z.property + exact ⟨.inl ⟨x,hp⟩,Subtype.ext hx⟩ + | inr x => + have hp : x.val.2=b.1 ∧ V.label x.val.1=b.2 := by + simpa only [←hx,sumPointEquiv_inr,sum,Fin.addCases_right] using z.property + exact ⟨.inr ⟨x,hp⟩,Subtype.ext hx⟩⟩ +@[simp] lemma fiberSum_inl (x : Fiber U b) : + (fiberSum U V b (.inl x)).val=sumPointEquiv U.polygon V.polygon (.inl x.val) := rfl +@[simp] lemma fiberSum_inr (x : Fiber V b) : + (fiberSum U V b (.inr x)).val=sumPointEquiv U.polygon V.polygon (.inr x.val) := rfl + +noncomputable abbrev E := evaluation (a:=a) (n:=n) +noncomputable def enumerate (U : Labelled a n) (b : GenericSquare a × (Fin n → CutRing × CutRing)) : Fiber U b ≃ Fin (E.obj U b).size := Fintype.equivFin (Fiber U b) +@[simp] lemma E_map_enum {U V : Labelled a n} (f : U ⟶ V) (b : GenericSquare a × (Fin n → CutRing × CutRing)) (x : Fiber U b) : + E.map f b (enumerate U b x)=enumerate V b (fiberMap f b x) := by + change enumerate V b (fiberMap f b ((enumerate U b).symm (enumerate U b x)))=_ + rw [Equiv.symm_apply_apply] +noncomputable def mu (U V : Labelled a n) : E.obj U ⊗ E.obj V ⟶ E.obj (U⊗V) := fun b => + (FiniteSetGroupoid.sumEquiv _ _).symm.trans + ((Equiv.sumCongr (enumerate U b).symm (enumerate V b).symm).trans + ((fiberSum U V b).trans (enumerate (sum U V) b))) +@[simp] lemma mu_inl (x : Fiber U b) : + mu U V b (FiniteSetGroupoid.sumEquiv _ _ (.inl (enumerate U b x)))= + enumerate (sum U V) b (fiberSum U V b (.inl x)) := by + change (enumerate (sum U V) b) ((fiberSum U V b) ((Equiv.sumCongr (enumerate U b).symm (enumerate V b).symm) + ((FiniteSetGroupoid.sumEquiv (E.obj U b) (E.obj V b)).symm + ((FiniteSetGroupoid.sumEquiv (E.obj U b) (E.obj V b)) _)))) = _ + rw [Equiv.symm_apply_apply] + simp only [Equiv.sumCongr_apply,Sum.map_inl,Equiv.symm_apply_apply] +@[simp] lemma mu_inr (x : Fiber V b) : + mu U V b (FiniteSetGroupoid.sumEquiv _ _ (.inr (enumerate V b x)))= + enumerate (sum U V) b (fiberSum U V b (.inr x)) := by + change (enumerate (sum U V) b) ((fiberSum U V b) ((Equiv.sumCongr (enumerate U b).symm (enumerate V b).symm) + ((FiniteSetGroupoid.sumEquiv (E.obj U b) (E.obj V b)).symm + ((FiniteSetGroupoid.sumEquiv (E.obj U b) (E.obj V b)) _)))) = _ + rw [Equiv.symm_apply_apply] + simp only [Equiv.sumCongr_apply,Sum.map_inr,Equiv.symm_apply_apply] +lemma fiberMap_sum_inl {U V W Z : Labelled a n} (f : U ⟶ W) (g : V ⟶ Z) + (b : GenericSquare a × (Fin n → CutRing × CutRing)) (x : Fiber U b) : + fiberMap (sumHom f g) b (fiberSum U V b (.inl x))= + fiberSum W Z b (.inl (fiberMap f b x)) := by + apply Subtype.ext + exact sumArrow_inl f.arrow g.arrow x.val +lemma fiberMap_sum_inr {U V W Z : Labelled a n} (f : U ⟶ W) (g : V ⟶ Z) + (b : GenericSquare a × (Fin n → CutRing × CutRing)) (x : Fiber V b) : + fiberMap (sumHom f g) b (fiberSum U V b (.inr x))= + fiberSum W Z b (.inr (fiberMap g b x)) := by + apply Subtype.ext + exact sumArrow_inr f.arrow g.arrow x.val +end SimpleAmenable.PolygonObject.Labelled.PointFiber + +end + +section +open CategoryTheory Classical Set MonoidalCategory +namespace SimpleAmenable.PolygonObject.Labelled.PointFiber + +variable {a n : ℕ} +instance fiberEmpty (b : GenericSquare a × (Fin n → CutRing × CutRing)) : IsEmpty (Fiber (empty (a:=a) (n:=n)) b) := + ⟨fun x => isEmptyElim x.val⟩ +noncomputable def eps : 𝟙_ ((GenericSquare a × (Fin n → CutRing × CutRing) → FiniteSetGroupoid)) ⟶ E.obj (𝟙_ (Labelled a n)) := fun b => + (Equiv.equivOfIsEmpty (Fin 0) (Fiber empty b)).trans (enumerate empty b) +@[simp] lemma fiberMap_id (U : Labelled a n) (b : GenericSquare a × (Fin n → CutRing × CutRing)) (x : Fiber U b) : + fiberMap (𝟙 U) b x=x := rfl +lemma mu_natural {U V W Z : Labelled a n} (f : U ⟶ W) (g : V ⟶ Z) : + (E.map f ⊗ₘ E.map g) ≫ mu W Z = mu U V ≫ E.map (f⊗ₘg) := by + funext b + apply Equiv.ext + intro x + obtain ⟨x,rfl⟩ := (FiniteSetGroupoid.sumEquiv (E.obj U b) (E.obj V b)).surjective x + cases x with + | inl x => + obtain ⟨x,rfl⟩ := (enumerate U b).surjective x + change mu W Z b (FiniteSetGroupoid.sumHom (E.map f b) (E.map g b) _) = E.map (sumHom f g) b _ + rw [FiniteSetGroupoid.sumHom_inl,E_map_enum,mu_inl,mu_inl,E_map_enum,fiberMap_sum_inl] + | inr x => + obtain ⟨x,rfl⟩ := (enumerate V b).surjective x + change mu W Z b (FiniteSetGroupoid.sumHom (E.map f b) (E.map g b) _) = E.map (sumHom f g) b _ + rw [FiniteSetGroupoid.sumHom_inr,E_map_enum,mu_inr,mu_inr,E_map_enum,fiberMap_sum_inr] + +variable (U V W : Labelled a n) (b : GenericSquare a × (Fin n → CutRing × CutRing)) +@[simp] lemma fiber_assoc_left (x : Fiber U b) : + fiberMap (assocHom U V W) b (fiberSum (sum U V) W b (.inl (fiberSum U V b (.inl x))))= + fiberSum U (sum V W) b (.inl x) := by + apply Subtype.ext + change sumAssocEquiv U.polygon V.polygon W.polygon _ = _ + exact sumAssocEquiv_left _ _ _ x.val +@[simp] lemma fiber_assoc_mid (x : Fiber V b) : + fiberMap (assocHom U V W) b (fiberSum (sum U V) W b (.inl (fiberSum U V b (.inr x))))= + fiberSum U (sum V W) b (.inr (fiberSum V W b (.inl x))) := by + apply Subtype.ext + change sumAssocEquiv U.polygon V.polygon W.polygon _ = _ + exact sumAssocEquiv_mid _ _ _ x.val +@[simp] lemma fiber_assoc_right (x : Fiber W b) : + fiberMap (assocHom U V W) b (fiberSum (sum U V) W b (.inr x))= + fiberSum U (sum V W) b (.inr (fiberSum V W b (.inr x))) := by + apply Subtype.ext + change sumAssocEquiv U.polygon V.polygon W.polygon _ = _ + exact sumAssocEquiv_right _ _ _ x.val +@[simp] lemma fiber_left (x : Fiber U b) : + fiberMap (leftHom U) b (fiberSum empty U b (.inr x))=x := by + apply Subtype.ext + exact leftUnitEquiv_apply _ x.val +@[simp] lemma fiber_right (x : Fiber U b) : + fiberMap (rightHom U) b (fiberSum U empty b (.inl x))=x := by + apply Subtype.ext + exact rightUnitEquiv_apply _ x.val +@[simp] lemma fiber_swap_left (x : Fiber U b) : + fiberMap (swapHom U V) b (fiberSum U V b (.inl x))=fiberSum V U b (.inr x) := by + apply Subtype.ext + exact sumSwapEquiv_inl _ _ x.val +@[simp] lemma fiber_swap_right (x : Fiber V b) : + fiberMap (swapHom U V) b (fiberSum U V b (.inr x))=fiberSum V U b (.inl x) := by + apply Subtype.ext + exact sumSwapEquiv_inr _ _ x.val +end SimpleAmenable.PolygonObject.Labelled.PointFiber + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Configurations/PointwisePolygonTables.lean b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/PointwisePolygonTables.lean new file mode 100644 index 0000000000000000000000000000000000000000..1665fd542e5c785dac13754368ed8af42011eba5 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/PointwisePolygonTables.lean @@ -0,0 +1,155 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.TupleChartDomain + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section PointwisePolygonTables + +variable {a m : ℕ} + +noncomputable def conditionalAlternatingHom (U : polygonAlgebra a) : + alternatingGroup (Fin m) →* polygonAlternatingGroup a m := + ((conditionalHom U).comp (alternatingGroup (Fin m)).subtype).codRestrict + (polygonAlternatingGroup a m) (fun s => conditionalHom_alternating_mem U s.property) + +theorem conditionalHom_disjoint_commute (U V : polygonAlgebra a) + (hUV : Disjoint U.val V.val) (σ ρ : Equiv.Perm (Fin m)) : + Commute (conditionalHom U σ) (conditionalHom V ρ) := by + change _ * _ = _ * _ + apply Subtype.ext + apply Equiv.ext + intro p + change conditionalPerm U σ (conditionalPerm V ρ p) = + conditionalPerm V ρ (conditionalPerm U σ p) + by_cases hu : p.2 ∈ U.val <;> by_cases hv : p.2 ∈ V.val + · exact False.elim (Set.disjoint_left.mp hUV hu hv) + all_goals simp [conditionalPerm, hu, hv] + +structure PolygonLabelling (a : ℕ) (Ω : Type*) where + label : GenericSquare a → Ω + fiber_mem : ∀ ω, {p | label p = ω} ∈ polygonAlgebra a + +noncomputable def PolygonLabelling.fiber {Ω : Type*} (v : PolygonLabelling a Ω) + (ω : Ω) : polygonAlgebra a := ⟨{p | v.label p = ω},v.fiber_mem ω⟩ + +theorem PolygonLabelling.fiber_disjoint {Ω : Type*} (v : PolygonLabelling a Ω) + {ω ν : Ω} (h : ω ≠ ν) : Disjoint (v.fiber ω).val (v.fiber ν).val := by + apply Set.disjoint_left.mpr + intro p hp hq + exact h (hp.symm.trans hq) + +noncomputable def PolygonLabelling.permutationHom {Ω : Type*} (v : PolygonLabelling a Ω) : + (Ω → alternatingGroup (Fin m)) →* Equiv.Perm (TrackPoint a m) where + toFun σ := { + toFun := fun p => ((σ (v.label p.2)).val p.1,p.2) + invFun := fun p => ((σ (v.label p.2)).val.symm p.1,p.2) + left_inv := by intro p; simp + right_inv := by intro p; simp } + map_one' := by apply Equiv.ext; intro p; rfl + map_mul' := by intro σ ρ; apply Equiv.ext; intro p; rfl + +@[simp] theorem PolygonLabelling.permutationHom_apply {Ω : Type*} + (v : PolygonLabelling a Ω) (σ : Ω → alternatingGroup (Fin m)) (p : TrackPoint a m) : + v.permutationHom σ p = ((σ (v.label p.2)).val p.1,p.2) := rfl + +noncomputable def PolygonLabelling.tableHom {Ω : Type*} [Fintype Ω] + (v : PolygonLabelling a Ω) : + (Ω → alternatingGroup (Fin m)) →* polygonAlternatingGroup a m := + MonoidHom.noncommPiCoprod (fun ω => conditionalAlternatingHom (v.fiber ω)) (by + intro ω ν h s t + change _ * _ = _ * _ + apply Subtype.ext + exact (conditionalHom_disjoint_commute (v.fiber ω) (v.fiber ν) + (v.fiber_disjoint h) s.val t.val).eq) + +@[simp] theorem PolygonLabelling.tableHom_single {Ω : Type*} [Fintype Ω] [DecidableEq Ω] + (v : PolygonLabelling a Ω) (ω : Ω) (s : alternatingGroup (Fin m)) : + v.tableHom (Pi.mulSingle ω s) = conditionalAlternatingHom (v.fiber ω) s := + MonoidHom.noncommPiCoprod_mulSingle _ _ _ + +theorem PolygonLabelling.tableHom_permutation {Ω : Type*} [Fintype Ω] + (v : PolygonLabelling a Ω) : + (polygonFullGroup a m).subtype.comp + ((polygonAlternatingGroup a m).subtype.comp v.tableHom) = v.permutationHom := by + classical + apply MonoidHom.pi_ext + intro ω s + simp only [MonoidHom.comp_apply, v.tableHom_single] + apply Equiv.ext + intro p + change conditionalPerm (v.fiber ω) s.val p = + (((Pi.mulSingle ω s : Ω → alternatingGroup (Fin m)) (v.label p.2)).val p.1,p.2) + by_cases hp : v.label p.2 = ω + · simp [conditionalPerm, PolygonLabelling.fiber, hp] + · simp [conditionalPerm, PolygonLabelling.fiber, hp] + +@[simp] theorem PolygonLabelling.tableHom_apply {Ω : Type*} [Fintype Ω] + (v : PolygonLabelling a Ω) (σ : Ω → alternatingGroup (Fin m)) (p : TrackPoint a m) : + (v.tableHom σ).val.val p = ((σ (v.label p.2)).val p.1,p.2) := by + have he := DFunLike.congr_fun v.tableHom_permutation σ + exact DFunLike.congr_fun he p + +theorem PolygonLabelling.tableHom_injective {Ω : Type*} [Fintype Ω] + (v : PolygonLabelling a Ω) (hv : Function.Surjective v.label) : + Function.Injective (v.tableHom (m := m)) := by + intro s t h + funext ω + apply Subtype.ext + apply Equiv.ext + intro i + obtain ⟨p,hp⟩ := hv ω + have he := congrArg (fun g : polygonAlternatingGroup a m => g.val.val (i,p)) h + simpa only [v.tableHom_apply, hp] using congrArg Prod.fst he + +noncomputable def polygonAssignment {ι : Type*} (U : ι → polygonAlgebra a) + (p : GenericSquare a) : ι → Bool := by + classical + exact fun i => decide (p ∈ (U i).val) + +theorem polygonAssignment_fiber_mem {ι : Type*} [Finite ι] + (U : ι → polygonAlgebra a) (ω : ι → Bool) : + {p | polygonAssignment U p = ω} ∈ polygonAlgebra a := by + classical + have he : {p | polygonAssignment U p = ω} = + ⋂ i, if ω i then (U i).val else (U i).valᶜ := by + ext p + simp only [Set.mem_ofPred_eq, Set.mem_iInter, funext_iff, polygonAssignment] + apply forall_congr' + intro i + cases ω i <;> simp + rw [he] + apply BooleanSubalgebra.iInf_mem + intro i + cases ω i + · exact BooleanSubalgebra.compl_mem (U i).property + · exact (U i).property + +noncomputable def actualPolygonLabelling {ι : Type*} [Finite ι] + (U : ι → polygonAlgebra a) : PolygonLabelling a (Set.range (polygonAssignment U)) where + label p := ⟨polygonAssignment U p,⟨p,rfl⟩⟩ + fiber_mem ω := by + have he : {p | (⟨polygonAssignment U p,⟨p,rfl⟩⟩ : Set.range (polygonAssignment U)) = ω} = + {p | polygonAssignment U p = ω.val} := by + ext p + exact Subtype.ext_iff + rw [he] + exact polygonAssignment_fiber_mem U ω.val + +theorem actualPolygonLabelling_surjective {ι : Type*} [Finite ι] + (U : ι → polygonAlgebra a) : Function.Surjective (actualPolygonLabelling U).label := by + rintro ⟨ω,p,rfl⟩ + exact ⟨p,rfl⟩ + +end PointwisePolygonTables + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Configurations/PolygonAlternatingConfigurations.lean b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/PolygonAlternatingConfigurations.lean new file mode 100644 index 0000000000000000000000000000000000000000..8b4536e1cdf540bf70acfc19c65ccd8b30c8867e --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/PolygonAlternatingConfigurations.lean @@ -0,0 +1,138 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Configurations.TransitiveInduction +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.PolygonBankEmbedding + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section PolygonAlternatingConfigurations + +open Classical CategoryTheory Set +namespace PolygonPlacement +variable {a m n : ℕ} + +noncomputable def bankEmbedding (f : Fin n → PolygonPlacement a m) + (hf : Pairwise (fun i j => Apart (f i) (f j))) : + PolygonObject.BankEmbedding (PolygonObject.whole a n) m where + emb := ⟨fun x => bank f hf x.val,fun x y h => Subtype.ext ((bank f hf).injective h)⟩ + table := by + choose S hS hcov using fun i => (f i).charts + let c (i : Fin n) (k : Fin m × (CutRing×CutRing) × polygonAlgebra a) : + PolygonObject.Chart (a:=a) n m := ⟨i,k.1,k.2.1,k.2.2⟩ + refine ⟨Finset.univ.biUnion (fun i => (S i).image (c i)),?_,?_⟩ + · intro k hk + obtain ⟨i,_,hk⟩ := Finset.mem_biUnion.mp hk + obtain ⟨d,hd,rfl⟩ := Finset.mem_image.mp hk + intro z hz + exact ⟨by trivial,hS i d hd z hz⟩ + · intro x + obtain ⟨d,hd,hz⟩ := hcov x.val.1 x.val.2 + exact ⟨c x.val.1 d,Finset.mem_biUnion.mpr ⟨x.val.1,Finset.mem_univ _, + Finset.mem_image.mpr ⟨d,hd,rfl⟩⟩,rfl,hz⟩ + +@[simp] theorem bankEmbedding_apply (f : Fin n → PolygonPlacement a m) + (hf : Pairwise (fun i j => Apart (f i) (f j))) + (x : (PolygonObject.whole a n).Point) : bankEmbedding f hf x=f x.val.1 x.val.2 := rfl + +theorem alternating_disjoint_configurations (f g : Fin n → PolygonPlacement a m) + (hf : Pairwise (fun i j => Apart (f i) (f j))) + (hg : Pairwise (fun i j => Apart (g i) (g j))) + (hfg : ∀i j,Apart (f i) (g j)) (hm : 3*n+1 < m) : + ∃c : polygonAlternatingGroup a m,∀i x,c.val.val (f i x)=g i x := by + let S := Finset.univ.image f ∪ Finset.univ.image g + have hS : S.card≤2*n := by + calc + _≤(Finset.univ.image f).card+(Finset.univ.image g).card := Finset.card_union_le _ _ + _≤(Finset.univ : Finset (Fin n)).card+(Finset.univ : Finset (Fin n)).card := + Nat.add_le_add Finset.card_image_le Finset.card_image_le + _=2*n := by simp; omega + obtain ⟨w,hw,hws⟩ := exists_configuration_avoiding S n (by omega) + have hwf (i j : Fin n) : Apart (w i) (f j) := + hws i (f j) (Finset.mem_union_left _ (Finset.mem_image.mpr ⟨j,Finset.mem_univ _,rfl⟩)) + have hwg (i j : Fin n) : Apart (w i) (g j) := + hws i (g j) (Finset.mem_union_right _ (Finset.mem_image.mpr ⟨j,Finset.mem_univ _,rfl⟩)) + obtain ⟨c,hc,_⟩ := PolygonObject.BankEmbedding.cycle_three + (bankEmbedding f hf) (bankEmbedding g hg) (bankEmbedding w hw) + (fun p q => (apart_iff _ _).mp (hfg p.val.1 q.val.1) p.val.2 q.val.2) + (fun p q => (apart_iff _ _).mp (hwf q.val.1 p.val.1).symm p.val.2 q.val.2) + (fun p q => (apart_iff _ _).mp (hwg q.val.1 p.val.1).symm p.val.2 q.val.2) + exact ⟨c,fun i x => hc ⟨(i,x),by trivial⟩⟩ + +theorem alternating_configuration_transitive_sharp (f g : Fin n → PolygonPlacement a m) + (hf : Pairwise (fun i j => Apart (f i) (f j))) + (hg : Pairwise (fun i j => Apart (g i) (g j))) (hm : 3*n+1 < m) : + ∃c : polygonAlternatingGroup a m,∀i,c.val • f i=g i := by + let S := Finset.univ.image f ∪ Finset.univ.image g + have hS : S.card≤2*n := by + calc + _≤(Finset.univ.image f).card+(Finset.univ.image g).card := Finset.card_union_le _ _ + _≤(Finset.univ : Finset (Fin n)).card+(Finset.univ : Finset (Fin n)).card := + Nat.add_le_add Finset.card_image_le Finset.card_image_le + _=2*n := by simp; omega + obtain ⟨w,hw,hws⟩ := exists_configuration_avoiding S n (by omega) + have hwf (i j : Fin n) : Apart (w i) (f j) := + hws i (f j) (Finset.mem_union_left _ (Finset.mem_image.mpr ⟨j,Finset.mem_univ _,rfl⟩)) + have hwg (i j : Fin n) : Apart (w i) (g j) := + hws i (g j) (Finset.mem_union_right _ (Finset.mem_image.mpr ⟨j,Finset.mem_univ _,rfl⟩)) + obtain ⟨u,hu⟩ := alternating_disjoint_configurations f w hf hw (fun i j => (hwf j i).symm) hm + obtain ⟨v,hv⟩ := alternating_disjoint_configurations w g hw hg hwg hm + refine ⟨v*u,fun i => ?_⟩ + apply PolygonPlacement.ext + intro x + change v.val.val (u.val.val (f i x))=g i x + rw [hu,hv] + +namespace Configuration + +theorem alternating_transitive {p : ℕ} (f g : Configuration a m p) (hm : 3*p+1 < m) : + ∃c : polygonAlternatingGroup a m,c.val • f=g := by + obtain ⟨c,hc⟩ := alternating_configuration_transitive_sharp f.val g.val f.property g.property hm + exact ⟨c,ext hc⟩ + +theorem alternating_stabilizer_standard (a p n : ℕ) : + MulAction.stabilizer (polygonAlternatingGroup a (p+n)) (standard a p n)= + (PolygonTracks.bankFixer a p n).comap (polygonAlternatingGroup a (p+n)).subtype := by + ext c + change c.val∈MulAction.stabilizer (polygonFullGroup a (p+n)) (standard a p n) ↔ + c.val∈PolygonTracks.bankFixer a p n + rw [stabilizer_standard] + +noncomputable def alternatingOrbitHomologyIso (a p n : ℕ) (hm : 3*p+1 < p+n) (q : ℕ) : + groupHomology (Rep.of (TransitiveInduction.permutationRep + (G:=polygonAlternatingGroup a (p+n)) (X:=Configuration a (p+n) p))) q ≅ + groupHomology (Rep.trivial ℤ (MulAction.stabilizer (polygonAlternatingGroup a (p+n)) + (standard a p n)) ℤ) q := + TransitiveInduction.homologyIso (standard a p n) (fun f => alternating_transitive _ f hm) q + +noncomputable def alternatingRepresentationIso (a m p : ℕ) : + Rep.of (TransitiveInduction.permutationRep + (G:=polygonAlternatingGroup a m) (X:=Configuration a m p)) ≅ + Rep.of ((configurationRepresentation a m p).comp (polygonAlternatingGroup a m).subtype) := + Rep.mkIso + { toLinearEquiv := chainEquiv a m p + isIntertwining' := fun g => chainEquiv_intertwines g.val } + +noncomputable def alternatingColumnHomologyIso (a p n : ℕ) (hm : 3*p+1 < p+n) (q : ℕ) : + groupHomology (Rep.of ((configurationRepresentation a (p+n) p).comp + (polygonAlternatingGroup a (p+n)).subtype)) q ≅ + groupHomology (Rep.trivial ℤ (MulAction.stabilizer (polygonAlternatingGroup a (p+n)) + (standard a p n)) ℤ) q := + (groupHomology.functor ℤ _ q).mapIso (alternatingRepresentationIso a (p+n) p).symm ≪≫ + alternatingOrbitHomologyIso a p n hm q + +end Configuration +end PolygonPlacement +end PolygonAlternatingConfigurations + +end SimpleAmenable + +end + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Configurations/PolygonAlternatingExtension.lean b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/PolygonAlternatingExtension.lean new file mode 100644 index 0000000000000000000000000000000000000000..89f7f302ecd94e73786e9930331f91b1a4f92525 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/PolygonAlternatingExtension.lean @@ -0,0 +1,76 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.PolygonBankEmbedding + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section PolygonAlternatingExtension + +open Classical Set +namespace PolygonObject +namespace BankEmbedding +variable {a m : ℕ} + +theorem alternating_extension (U B : Fin m → polygonAlgebra a) + (f : BankEmbedding (PolygonObject.mk m U) m) + (hU : ∀p : (PolygonObject.mk m U).Point,p.val.2∉(B p.val.1).val) + (hf : ∀p,(f p).2∉(B (f p).1).val) + (harea : 10*(∑i,PolygonArea.area (U i))<∑i,PolygonArea.area (B i)ᶜ) : + ∃c : polygonAlternatingGroup a m, + (∀p,c.val.val p.val=f p) ∧ + (∀y : TrackPoint a m,y.2∈(B y.1).val → c.val.val y=y) := by + let u := inclusion U + have hB : (∑i,PolygonArea.area (B i))≤(m:ENNReal) := by + calc + _≤∑_i : Fin m,(1:ENNReal) := Finset.sum_le_sum (fun i _ => PolygonArea.area_le_one (B i)) + _=_ := by simp + have hBn : (∑i,PolygonArea.area (B i))≠⊤ := ne_top_of_le_ne_top (by simp) hB + have htotal : (∑i,PolygonArea.area (B i))+(∑i,PolygonArea.area (B i)ᶜ)=m := by + rw [←Finset.sum_add_distrib] + simp only [PolygonArea.area_compl,Finset.sum_const,Finset.card_univ,Fintype.card_fin,nsmul_eq_mul,mul_one] + have guard (r : ENNReal) (hr : r≤10) : + (∑i,PolygonArea.area (B i))+r*(∑i,PolygonArea.area (U i)) < m := by + rw [←htotal] + exact ENNReal.add_lt_add_left hBn ((mul_le_mul hr le_rfl (by positivity) (by positivity)).trans_lt harea) + obtain ⟨w₁,hw₁B,hw₁⟩ := exists_away U B ![u,f] (by apply guard; norm_num) + obtain ⟨w₂,hw₂B,hw₂⟩ := exists_away U B ![u,f,w₁] (by apply guard; norm_num) + obtain ⟨w₃,hw₃B,hw₃⟩ := exists_away U B ![u,f,w₁,w₂] (by apply guard; norm_num) + obtain ⟨c₁,hc₁,hout₁⟩ := cycle_three u w₁ w₂ + (fun p q he => hw₁ 0 q p he.symm) + (fun p q he => hw₂ 0 q p he.symm) + (fun p q he => hw₂ 2 q p he.symm) + obtain ⟨c₂,hc₂,hout₂⟩ := cycle_three w₁ f w₃ + (fun p q he => hw₁ 1 p q he) + (fun p q he => hw₃ 2 q p he.symm) + (fun p q he => hw₃ 1 q p he.symm) + refine ⟨c₂*c₁,?_,?_⟩ + · intro p + change c₂.val.val (c₁.val.val (u p))=f p + rw [hc₁,hc₂] + · intro y hy + have avoid (e : BankEmbedding (PolygonObject.mk m U) m) + (he : ∀p,(e p).2∉(B (e p).1).val) : ∀p,e p≠y := by + intro p hp + exact he p (by simpa only [hp] using hy) + have hu : ∀p,u p≠y := avoid u hU + have hf' : ∀p,f p≠y := avoid f hf + have hw₁' := avoid w₁ hw₁B + have hw₂' := avoid w₂ hw₂B + have hw₃' := avoid w₃ hw₃B + change c₂.val.val (c₁.val.val y)=y + rw [hout₁ y hu hw₁' hw₂',hout₂ y hw₁' hf' hw₃'] + +end BankEmbedding +end PolygonObject +end PolygonAlternatingExtension + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Configurations/PolygonAlternatingStabilization.lean b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/PolygonAlternatingStabilization.lean new file mode 100644 index 0000000000000000000000000000000000000000..42605711a866865bddfd1b169668fb0dc4e29841 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/PolygonAlternatingStabilization.lean @@ -0,0 +1,86 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Configurations.PolygonPlacementAlternating + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section PolygonAlternatingStabilization +open Classical Set +namespace PolygonTracks +variable {a k n : ℕ} + +theorem stabilize_threeSlot {g : polygonFullGroup a n} (hg : IsThreeSlotCycle g) : + IsThreeSlotCycle (stabilize a k n g) := by + obtain ⟨U,s,hU,hs,hg,hfix⟩ := hg + let t : Fin 3 → Fin (k+n) × (CutRing × CutRing) := fun i => ((s i).1.natAdd k,(s i).2) + have ht (x : Fin 3 × U.val) : SlotMap a (k+n) U t x=rightIncl a k n (SlotMap a n U s x) := rfl + refine ⟨U,t,hU,?_,?_,?_⟩ + · intro x y hxy + apply hs + exact rightIncl_injective (by simpa only [ht] using hxy) + · intro i x + rw [ht,ht] + change (stabilize a k n g).val ((SlotMap a n U s (i,x)).1.natAdd k, + (SlotMap a n U s (i,x)).2)=_ + rw [stabilize_right,hg] + rfl + · intro p hp + obtain ⟨q,rfl⟩ := (join a k n).surjective p + cases q with + | inl q => exact stabilize_left g q + | inr q => + rw [join_inr,stabilize_right] + have hq : q∉Set.range (SlotMap a n U s) := by + rintro ⟨x,rfl⟩ + exact hp ⟨x,rfl⟩ + rw [hfix q hq] + +theorem stabilize_mem_alternating (g : polygonAlternatingGroup a n) : + stabilize a k n g.val∈polygonAlternatingGroup a (k+n) := by + have hl : polygonAlternatingGroup a n ≤ + (polygonAlternatingGroup a (k+n)).comap (stabilize a k n) := by + apply (Subgroup.closure_le _).mpr + intro f hf + exact Subgroup.subset_closure (stabilize_threeSlot hf) + exact hl g.property + +noncomputable def stabilizeAlternating (a k n : ℕ) : + polygonAlternatingGroup a n →* polygonAlternatingGroup a (k+n) := + (stabilize a k n).restrict (fun g hg => stabilize_mem_alternating ⟨g,hg⟩) + +@[simp] theorem stabilizeAlternating_val (g : polygonAlternatingGroup a n) : + (stabilizeAlternating a k n g).val=stabilize a k n g.val := rfl + +theorem stabilizeAlternating_injective : Function.Injective (stabilizeAlternating a k n) := by + intro g h he + apply Subtype.ext + exact stabilize_injective (congrArg Subtype.val he) + +theorem exists_alternating_agrees_right (f : polygonFullGroup a (k+n)) (hm : 6*n+7 PolygonPlacement.standard (i.natAdd k) + have he : Pairwise (fun i j => PolygonPlacement.Apart (e i) (e j)) := by + intro i j hij + exact PolygonPlacement.standard_apart (fun h => hij (Fin.ext (Nat.add_left_cancel + (congrArg Fin.val h)))) + have hf : Pairwise (fun i j => PolygonPlacement.Apart (f • e i) (f • e j)) := by + intro i j hij + exact (PolygonPlacement.apart_smul_iff f _ _).mpr (he hij) + obtain ⟨c,hc⟩ := PolygonPlacement.alternating_configuration_transitive e (fun i => f • e i) he hf hm + refine ⟨c,fun x => ?_⟩ + exact congrArg (fun z : PolygonPlacement a (k+n) => z x.2) (hc x.1) + +end PolygonTracks +end PolygonAlternatingStabilization + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Configurations/PolygonComponentStable.lean b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/PolygonComponentStable.lean new file mode 100644 index 0000000000000000000000000000000000000000..956cff8eb513ee65f0b740cd35aa1229b9fc9148 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/PolygonComponentStable.lean @@ -0,0 +1,183 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.PolygonComponentCompletion +import OAI.GroupTheory.SimpleAmenable.Homology.PolygonStableHomology +import OAI.GroupTheory.SimpleAmenable.Homology.GroupoidComponentHomology +import OAI.GroupTheory.SimpleAmenable.Homology.ComponentStable + +namespace OAI + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits MonoidalCategory Simplicial Opposite +namespace SimpleAmenable.PolygonTracks +open FreeChains ComponentTranslation GroupoidComponentHomology + +attribute [local instance 1200] Rep.hV2 +noncomputable abbrev componentGenerator (a:ℕ) := PolygonObject.component (PolygonObject.standard a 1) +lemma componentGenerator_cofinal (a:ℕ) : ∀p:Skeleton (PolygonObject a),∃q n,p*q=componentGenerator a^n := by + intro p + let U:=ComponentTranslation.repr p + refine ⟨PolygonObject.component (PolygonObject.complement U), U.tracks,?_⟩ + have h:=PolygonObject.component_complement U + rw [PolygonObject.component_standard_pow] at h + simpa only [U,PolygonObject.component,repr_component] using h +noncomputable def standardFiber (a n:ℕ) : Fiber (componentGenerator a^n) := + ⟨PolygonObject.standard a n,PolygonObject.component_standard_pow n⟩ +noncomputable def standardNerveInclusion (a n:ℕ) : + SingleObj (polygonFullGroup a n) ⥤ PolygonObject a := + (PolygonObject.standardAutEquiv a n).symm.toMonoidHom.toFunctor ⋙ + GroupoidComponentHomology.inclusion (PolygonObject.standard a n) +@[simp] lemma standardNerveInclusion_obj (a n:ℕ) (x:SingleObj (polygonFullGroup a n)) : + (standardNerveInclusion a n).obj x=PolygonObject.standard a n := rfl +@[simp] lemma standardNerveInclusion_map (a n:ℕ) {x y:SingleObj (polygonFullGroup a n)} (f:x⟶y) : + (standardNerveInclusion a n).map f=PolygonObject.fullGroupArrow f := rfl +noncomputable def standardFiberInclusion (a n:ℕ) : + SingleObj (polygonFullGroup a n) ⥤ Fiber (componentGenerator a^n) := + (property (componentGenerator a^n)).lift (standardNerveInclusion a n) + (fun _=>PolygonObject.component_standard_pow n) +noncomputable def standardHomologyIso (a n q:ℕ) : + groupHomology (Rep.trivial ℤ (polygonFullGroup a n) ℤ) q ≅ + (nerve (Fiber (componentGenerator a^n))).homology Z q := by + haveI:=TrivialHomology.isIso_equiv (PolygonObject.standardAutEquiv a n).symm q + exact asIso (TrivialHomology.map (PolygonObject.standardAutEquiv a n).symm.toMonoidHom q) ≪≫ + fiberIsoHomology (standardFiber a n) q +end SimpleAmenable.PolygonTracks +namespace SimpleAmenable.PolygonObject +open SimpleAmenable SimpleAmenable.PolygonTracks + +variable {a:ℕ} +lemma eqToHom_coord {U V:PolygonObject a} (h:U=V) (x:U.Point) : + (((eqToHom h:U⟶V).toEquiv x).val.1.val,((eqToHom h:U⟶V).toEquiv x).val.2)= + (x.val.1.val,x.val.2) := by subst V; rfl +lemma standardTensor_map (k n:ℕ) (f:polygonFullGroup a n) : + (tensorLeft (standard a k)).map (fullGroupArrow f) ≫ eqToHom (sum_standard k n) = + eqToHom (sum_standard k n) ≫ fullGroupArrow (stabilize a k n f) := by + apply Arrow.ext + apply Equiv.ext + intro x + apply Subtype.ext + apply Prod.ext + · apply Fin.ext + obtain ⟨y,rfl⟩ := (sumPointEquiv (standard a k) (standard a n)).surjective x + cases y with + | inl y => + have hx:=congrArg (fun z : ℕ × GenericSquare a => z.1) (eqToHom_coord (sum_standard k n) (sumPointEquiv (standard a k) (standard a n) (.inl y))) + simp only [arrow_comp_apply] + change ((eqToHom (sum_standard k n)).toEquiv + ((sumArrow (𝟙 _) (fullGroupArrow f)).toEquiv _)).val.1.val = _ + rw [sumArrow_inl,arrow_id_apply] + rw [show ((eqToHom (sum_standard k n)).toEquiv _).val.1.val = y.val.1.val from hx] + change _=((stabilize a k n f).val ((eqToHom (sum_standard k n)).toEquiv _).val).1.val + have hp : ((eqToHom (sum_standard k n)).toEquiv + (sumPointEquiv (standard a k) (standard a n) (.inl y))).val=(y.val.1.castAdd n,y.val.2) := by + apply Prod.ext + · apply Fin.ext; exact hx + · exact congrArg (fun z : ℕ × GenericSquare a => z.2) (eqToHom_coord (sum_standard k n) _) + erw [hp,stabilize_left] + rfl + | inr y => + have hp (z:(standard a n).Point) : ((eqToHom (sum_standard k n)).toEquiv + (sumPointEquiv (standard a k) (standard a n) (.inr z))).val=(z.val.1.natAdd k,z.val.2) := by + apply Prod.ext + · apply Fin.ext; exact congrArg (fun z : ℕ × GenericSquare a => z.1) (eqToHom_coord (sum_standard k n) _) + · exact congrArg (fun z : ℕ × GenericSquare a => z.2) (eqToHom_coord (sum_standard k n) _) + simp only [arrow_comp_apply] + change ((eqToHom (sum_standard k n)).toEquiv + ((sumArrow (𝟙 _) (fullGroupArrow f)).toEquiv _)).val.1.val = + ((stabilize a k n f).val ((eqToHom (sum_standard k n)).toEquiv _).val).1.val + erw [sumArrow_inr,hp,hp,stabilize_right] + rfl + · obtain ⟨y,rfl⟩ := (sumPointEquiv (standard a k) (standard a n)).surjective x + cases y with + | inl y => + have hp : ((eqToHom (sum_standard k n)).toEquiv + (sumPointEquiv (standard a k) (standard a n) (.inl y))).val=(y.val.1.castAdd n,y.val.2) := by + apply Prod.ext + · apply Fin.ext; exact congrArg (fun z : ℕ × GenericSquare a => z.1) (eqToHom_coord (sum_standard k n) _) + · exact congrArg (fun z : ℕ × GenericSquare a => z.2) (eqToHom_coord (sum_standard k n) _) + simp only [arrow_comp_apply] + change ((eqToHom (sum_standard k n)).toEquiv + ((sumArrow (𝟙 _) (fullGroupArrow f)).toEquiv _)).val.2 = + ((stabilize a k n f).val ((eqToHom (sum_standard k n)).toEquiv _).val).2 + erw [sumArrow_inl,arrow_id_apply,hp,stabilize_left] + | inr y => + have hp (z:(standard a n).Point) : ((eqToHom (sum_standard k n)).toEquiv + (sumPointEquiv (standard a k) (standard a n) (.inr z))).val=(z.val.1.natAdd k,z.val.2) := by + apply Prod.ext + · apply Fin.ext; exact congrArg (fun z : ℕ × GenericSquare a => z.1) (eqToHom_coord (sum_standard k n) _) + · exact congrArg (fun z : ℕ × GenericSquare a => z.2) (eqToHom_coord (sum_standard k n) _) + simp only [arrow_comp_apply] + change ((eqToHom (sum_standard k n)).toEquiv + ((sumArrow (𝟙 _) (fullGroupArrow f)).toEquiv _)).val.2 = + ((stabilize a k n f).val ((eqToHom (sum_standard k n)).toEquiv _).val).2 + erw [sumArrow_inr,hp,hp,stabilize_right] + rfl +noncomputable def standardTensorIso (k n:ℕ) : + standardNerveInclusion a n ⋙ tensorLeft (standard a k) ≅ + (stabilize a k n).toFunctor ⋙ standardNerveInclusion a (k+n) := + NatIso.ofComponents (fun _=>eqToIso (sum_standard k n)) (by + intro x y f + exact standardTensor_map k n f) +noncomputable def standardCastIso {m n:ℕ} (h:m=n) : standardNerveInclusion a m ≅ + (castFull a h).toMonoidHom.toFunctor ⋙ standardNerveInclusion a n := by + subst n + exact NatIso.ofComponents (fun _=>Iso.refl _) (by intro x y f; simp; rfl) +noncomputable def standardSuccessorIso (n:ℕ) : + standardNerveInclusion a n ⋙ tensorLeft (standard a 1) ≅ + (successorStabilize a n).toFunctor ⋙ standardNerveInclusion a (n+1) := + standardTensorIso 1 n ≪≫ + Functor.isoWhiskerLeft (stabilize a 1 n).toFunctor (standardCastIso (Nat.add_comm 1 n)) ≪≫ + (Functor.associator _ _ _).symm +end SimpleAmenable.PolygonObject +namespace SimpleAmenable.PolygonTracks +open FreeChains ComponentTranslation GroupoidComponentHomology + +instance standardFiberInclusion_faithful (a n:ℕ) : (standardFiberInclusion a n).Faithful where + map_injective h := PolygonObject.fullGroupArrow_injective + (congrArg (fun f : (standardFiberInclusion a n).obj _ ⟶ (standardFiberInclusion a n).obj _ => f.hom) h) +noncomputable instance standardFiberInclusion_full (a n:ℕ) : (standardFiberInclusion a n).Full where + map_surjective f := ⟨PolygonObject.fullGroupOfArrow f.hom,by + apply ObjectProperty.hom_ext + exact PolygonObject.arrow_fullGroup f.hom⟩ +instance standardFiberInclusion_essSurj (a n:ℕ) : (standardFiberInclusion a n).EssSurj where + mem_essImage V := ⟨SingleObj.star _,⟨fiberIso _ (standardFiber a n) V⟩⟩ +noncomputable instance standardFiberInclusion_isEquivalence (a n:ℕ) : + (standardFiberInclusion a n).IsEquivalence := ⟨inferInstance,inferInstance,inferInstance⟩ +noncomputable def representativeGeneratorIso (a:ℕ) : + repr (componentGenerator a) ≅ PolygonObject.standard a 1 := Skeleton.isoOfEq (repr_component _) +noncomputable def representativeSuccessorIso (a n:ℕ) : + standardNerveInclusion a n ⋙ tensorLeft (repr (componentGenerator a)) ≅ + (successorStabilize a n).toFunctor ⋙ standardNerveInclusion a (n+1) := + Functor.isoWhiskerLeft (standardNerveInclusion a n) + ((tensoringLeft (PolygonObject a)).mapIso (representativeGeneratorIso a)) ≪≫ + PolygonObject.standardSuccessorIso n +noncomputable def fiberSuccessorIso (a n:ℕ) : + standardFiberInclusion a n ⋙ + ComponentTranslation.translate (componentGenerator a) (componentGenerator a^n) (componentGenerator a^(n+1)) (pow_succ' _ _).symm ≅ + (successorStabilize a n).toFunctor ⋙ standardFiberInclusion a (n+1) := + NatIso.ofComponents (fun x=>ObjectProperty.isoMk _ ((representativeSuccessorIso a n).app x)) (by + intro x y f + apply ObjectProperty.hom_ext + exact (representativeSuccessorIso a n).hom.naturality f) +lemma component_successor_isIso (a n q:ℕ) [IsIso (TrivialHomology.map (successorStabilize a n) q)] : + IsIso (SSet.homologyMap (nerveMap + (ComponentTranslation.translate (componentGenerator a) (componentGenerator a^n) (componentGenerator a^(n+1)) (pow_succ' _ _).symm)) Z q) := by + have sourceInclusionIso := NerveHomotopy.homologyMap_isIso (standardFiberInclusion a n) Z q + have targetInclusionIso := NerveHomotopy.homologyMap_isIso (standardFiberInclusion a (n+1)) Z q + have hg:=GroupNerveCoordinates.homologyIso_natural (successorStabilize a n) q + have successorIso : IsIso (SSet.homologyMap (nerveMap (successorStabilize a n).toFunctor) Z q) := by + have successorCompositeIso : IsIso (SSet.homologyMap (nerveMap (successorStabilize a n).toFunctor) Z q ≫ + (GroupNerveCoordinates.homologyIso (polygonFullGroup a (n+1)) q).hom) := by rw [hg]; infer_instance + exact (isIso_comp_right_iff _ (GroupNerveCoordinates.homologyIso (polygonFullGroup a (n+1)) q).hom).mp inferInstance + have h:=(NerveHomotopy.ofNatTrans (fiberSuccessorIso a n).hom).congr_homologyMap Z q + rw [ComponentStable.map_comp,ComponentStable.map_comp] at h + have inclusionCompositeIso : IsIso (SSet.homologyMap (nerveMap (standardFiberInclusion a n)) Z q ≫ + SSet.homologyMap (nerveMap + (ComponentTranslation.translate (componentGenerator a) (componentGenerator a^n) (componentGenerator a^(n+1)) (pow_succ' _ _).symm)) Z q) := by + rw [h] + infer_instance + exact (isIso_comp_left_iff (SSet.homologyMap (nerveMap (standardFiberInclusion a n)) Z q) _).mp inferInstance +end SimpleAmenable.PolygonTracks + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Configurations/PolygonFixedReturn.lean b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/PolygonFixedReturn.lean new file mode 100644 index 0000000000000000000000000000000000000000..8ee4bb6c36b20f74b9ea4548f6bf68ea33436288 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/PolygonFixedReturn.lean @@ -0,0 +1,52 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Configurations.CofinalPowers +import OAI.GroupTheory.SimpleAmenable.Configurations.PolygonComponentStable +import OAI.GroupTheory.SimpleAmenable.Simplicial.FirstBarStableH1 + +namespace OAI + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits MonoidalCategory Simplicial Opposite +namespace SimpleAmenable.PolygonTracks +open FreeChains ComponentTranslation GroupoidComponentHomology + +attribute [local instance 1200] Rep.hV2 +lemma component_sequence_succ (a n q:ℕ) : + (homologyDiagram (C:=PolygonObject a) q).map + ((CofinalPowers.sequence (componentGenerator a)).map (homOfLE (Nat.le_succ n))) = + SSet.homologyMap (nerveMap (ComponentTranslation.translate (componentGenerator a) + (componentGenerator a^n) (componentGenerator a^(n+1)) (pow_succ' _ _).symm)) Z q := by + change SSet.homologyMap (nerveMap (ComponentTranslation.translate + (componentGenerator a ^ (n+1-n)) _ _ _)) Z q = _ + simp only [Nat.add_sub_cancel_left,pow_one] + rfl +lemma finite_fullH1_iff_stable (a m:ℕ) (hm : 32 ≤ m) : + Module.Finite ℤ (groupHomology (Rep.trivial ℤ (polygonFullGroup a m) ℤ) 1) ↔ + Module.Finite ℤ (ComponentStable.object (C:=PolygonObject a) 1 : A) := by + refine (Module.Finite.equiv_iff (standardHomologyIso a m 1).toLinearEquiv).trans ?_ + apply CofinalPowers.finite_colimit_iff (componentGenerator a) (componentGenerator_cofinal a) + (homologyDiagram 1) 32 m hm + intro n hn + rw [component_sequence_succ] + have successorIso := successor_H1_isIso a n hn + exact component_successor_isIso a n 1 +lemma finite_fullH2_iff_stable (a m:ℕ) (hm : 34 ≤ m) : + Module.Finite ℤ (groupHomology (Rep.trivial ℤ (polygonFullGroup a m) ℤ) 2) ↔ + Module.Finite ℤ (ComponentStable.object (C:=PolygonObject a) 2 : A) := by + refine (Module.Finite.equiv_iff (standardHomologyIso a m 2).toLinearEquiv).trans ?_ + apply CofinalPowers.finite_colimit_iff (componentGenerator a) (componentGenerator_cofinal a) + (homologyDiagram 2) 34 m hm + intro n hn + rw [component_sequence_succ] + have successorIso := successor_H2_isIso a n hn + exact component_successor_isIso a n 2 +lemma fullH1_finite_of_bar (a m:ℕ) (hm : 32 ≤ m) + [Module.Finite ℤ ((IntervalBar.Diagram.bar (C:=PolygonObject a)).homology Z 1 : A)] + [Module.Finite ℤ ((IntervalBar.Diagram.bar (C:=PolygonObject a)).homology Z 2 : A)] : + Module.Finite ℤ (groupHomology (Rep.trivial ℤ (polygonFullGroup a m) ℤ) 1) := + (finite_fullH1_iff_stable a m hm).mpr (MarkedH1.stableH1_finite (C:=PolygonObject a)) +end SimpleAmenable.PolygonTracks + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Configurations/PolygonFixedTrackProgress.lean b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/PolygonFixedTrackProgress.lean new file mode 100644 index 0000000000000000000000000000000000000000..b08dff06d685be53d2c2504735d0ee3d63809f54 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/PolygonFixedTrackProgress.lean @@ -0,0 +1,183 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.WholeCoverCentrality +import OAI.GroupTheory.SimpleAmenable.Amenability.SubgroupTestReiter + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section PolygonFixedTrackProgress + +theorem source_radius_valid : 0 ?_⟩ + obtain ⟨n,rfl⟩ : ∃n,m=n+1 := ⟨m-1,by omega⟩ + obtain ⟨hinf,hsimple,hfol⟩ := polygon_infinite_simple_folner ha (by omega : 15≤n+1) + obtain ⟨L,hpres,hsur,hcent⟩ := polygon_central_cover (by omega : 2≤n) ha hm + source_radius_valid (by linarith : 8000 GenericSquare a → TrackPoint a m) := + ⟨fun f => f.toEmbedding⟩ + +@[ext] theorem ext {f g : PolygonPlacement a m} (h : ∀x,f x=g x) : f=g := by + cases f; cases g + congr + exact Function.Embedding.ext h + +noncomputable def standard (i : Fin m) : PolygonPlacement a m where + toEmbedding := ⟨fun x => (i,x),fun _ _ h => congrArg Prod.snd h⟩ + charts := by + refine ⟨{(i,0,⊤)},?_,?_⟩ + · intro c hc x _ + obtain rfl := Finset.mem_singleton.mp hc + change (i,x)=(i,translate a 0 x) + rw [translate_zero] + · intro x + exact ⟨(i,0,⊤),Finset.mem_singleton_self _,by trivial⟩ + +@[simp] theorem standard_apply (i : Fin m) (x : GenericSquare a) : + standard i x=(i,x) := rfl + +noncomputable def postcompose (g : polygonFullGroup a m) (f : PolygonPlacement a m) : + PolygonPlacement a m where + toEmbedding := ⟨fun x => g.val (f x),g.val.injective.comp f.toEmbedding.injective⟩ + charts := by + obtain ⟨s,hs,hcover⟩ := g.property + obtain ⟨t,ht,tcover⟩ := f.charts + let pairs := (s×ˢt).filter (fun cd => cd.1.source=cd.2.1) + let conv : TableChart a m × (Fin m × (CutRing×CutRing) × polygonAlgebra a) → + Fin m × (CutRing×CutRing) × polygonAlgebra a := fun cd => + (cd.1.target,cd.1.shift+cd.2.2.1, + ⟨cd.2.2.2.val ∩ translate a cd.2.2.1 ⁻¹' cd.1.domain.val, + BooleanSubalgebra.inf_mem cd.2.2.2.property + (polygon_preimage_translate cd.2.2.1 cd.1.domain.property)⟩) + refine ⟨pairs.image conv,?_,?_⟩ + · intro c hc + obtain ⟨⟨d,e⟩,hde,rfl⟩ := Finset.mem_image.mp hc + obtain ⟨hp,he⟩ := Finset.mem_filter.mp hde + obtain ⟨hd,he'⟩ := Finset.mem_product.mp hp + intro x hx + change g.val (f x)=(d.target,translate a (d.shift+e.2.1) x) + rw [ht e he' x hx.1,←he,hs d hd _ hx.2,translate_add] + · intro x + obtain ⟨e,he,hx⟩ := tcover x + obtain ⟨d,hd,hfx⟩ := hcover (f x) + have hf := ht e he x hx + have hmatch : d.source=e.1 := hfx.1.symm.trans (congrArg Prod.fst hf) + refine ⟨conv (d,e),Finset.mem_image.mpr ⟨(d,e),?_,rfl⟩,hx,?_⟩ + · exact Finset.mem_filter.mpr ⟨Finset.mem_product.mpr ⟨hd,he⟩,hmatch⟩ + · change translate a e.2.1 x∈d.domain.val + simpa only [hf] using hfx.2 + +@[simp] theorem postcompose_apply (g : polygonFullGroup a m) (f : PolygonPlacement a m) + (x : GenericSquare a) : postcompose g f x=g.val (f x) := rfl + +noncomputable instance : MulAction (polygonFullGroup a m) (PolygonPlacement a m) where + smul := postcompose + one_smul _ := by apply PolygonPlacement.ext; intro _; rfl + mul_smul _ _ _ := by apply PolygonPlacement.ext; intro _; rfl + +@[simp] theorem smul_apply (g : polygonFullGroup a m) (f : PolygonPlacement a m) + (x : GenericSquare a) : (g • f) x=g.val (f x) := rfl + +theorem range_fiber_polygon (f : PolygonPlacement a m) (i : Fin m) : + {x | (i,x)∈Set.range f}∈polygonAlgebra a := by + obtain ⟨s,hs,hcover⟩ := f.charts + have he : {x | (i,x)∈Set.range f}= + ⋃c∈s.filter (fun c => c.1=i),translation a c.2.1 '' c.2.2.val := by + ext y + constructor + · rintro ⟨x,hx⟩ + obtain ⟨c,hc,hxc⟩ := hcover x + have h := (hs c hc x hxc).symm.trans hx + exact Set.mem_iUnion.mpr ⟨c,Set.mem_iUnion.mpr ⟨ + Finset.mem_filter.mpr ⟨hc,congrArg Prod.fst h⟩, + ⟨x,hxc,congrArg Prod.snd h⟩⟩⟩ + · intro hy + obtain ⟨c,hc,hy⟩ := Set.mem_iUnion₂.mp hy + obtain ⟨x,hx,hxy⟩ := hy + refine ⟨x,?_⟩ + rw [hs c (Finset.mem_filter.mp hc).1 x hx,(Finset.mem_filter.mp hc).2] + exact Prod.ext rfl hxy + rw [he] + apply BooleanSubalgebra.biSup_mem (Finset.finite_toSet _) + intro chart _ + exact polygon_image_translation _ chart.2.2.property + +def Apart (f g : PolygonPlacement a m) : Prop := Disjoint (Set.range f) (Set.range g) + +theorem apart_symm {f g : PolygonPlacement a m} (h : Apart f g) : Apart g f := h.symm + +theorem apart_iff (f g : PolygonPlacement a m) : Apart f g ↔ ∀x y,f x≠g y := by + constructor + · intro h x y he + exact Set.disjoint_left.mp h ⟨x,rfl⟩ ⟨y,he.symm⟩ + · intro h + apply Set.disjoint_left.mpr + rintro _ ⟨x,rfl⟩ ⟨y,he⟩ + exact h x y he.symm + +theorem apart_smul_iff (h : polygonFullGroup a m) (f g : PolygonPlacement a m) : + Apart (h • f) (h • g) ↔ Apart f g := by + simp only [apart_iff,smul_apply,h.val.injective.ne_iff] + +theorem standard_apart {i j : Fin m} (hij : i≠j) : + Apart (standard (a:=a) i) (standard j) := by + rw [apart_iff] + intro _ _ equality + exact hij (congrArg Prod.fst equality) + +noncomputable def bank {n : ℕ} (f : Fin n → PolygonPlacement a m) + (hf : Pairwise (fun i j => Apart (f i) (f j))) : TrackPoint a n ↪ TrackPoint a m where + toFun x := f x.1 x.2 + inj' := by + rintro ⟨i,x⟩ ⟨j,y⟩ he + have hij : i=j := by + by_contra hn + exact (apart_iff _ _).mp (hf hn) x y he + subst j + exact Prod.ext rfl ((f i).toEmbedding.injective he) + +end PolygonPlacement +end PolygonConfigurations + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Configurations/PolygonGrid.lean b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/PolygonGrid.lean new file mode 100644 index 0000000000000000000000000000000000000000..e2a1fead8c33e52f39403172d3dbbd849f0a0f87 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/PolygonGrid.lean @@ -0,0 +1,106 @@ +import Mathlib + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section PolygonGrid +open Classical Set MeasureTheory Metric +namespace PolygonGrid + +abbrev PlaneTracks := ℕ × ℝ × ℝ +abbrev Index (m N : ℕ) := Fin m × Fin N × Fin N +noncomputable def μ : Measure PlaneTracks := Measure.count.prod ((volume : Measure ℝ).prod volume) +noncomputable def interval (ε : ℝ) (i : ℕ) : Set ℝ := Ico (ε*i) (ε*(i+1)) +noncomputable def cell {m N : ℕ} (ε : ℝ) (i : Index m N) : Set PlaneTracks := + {i.1.val} ×ˢ interval ε i.2.1.val ×ˢ interval ε i.2.2.val +noncomputable def region (m : ℕ) : Set PlaneTracks := + {i : ℕ | i < m} ×ˢ Ico (0:ℝ) 1 ×ˢ Ico (0:ℝ) 1 + +@[simp] theorem measurable_cell {m N : ℕ} (ε : ℝ) (i : Index m N) : MeasurableSet (cell ε i) := + (measurableSet_singleton _).prod (measurableSet_Ico.prod measurableSet_Ico) + +@[simp] theorem volume_cell {m N : ℕ} (ε : ℝ) (i : Index m N) : + μ (cell ε i)=ENNReal.ofReal ε * ENNReal.ofReal ε := by + simp only [μ,cell,interval,Measure.prod_prod,Measure.count_singleton,one_mul,Real.volume_Ico] + congr 2 <;> ring + +theorem cells_disjoint {m N : ℕ} {ε : ℝ} (hε : 0 < ε) : + Pairwise (fun i j : Index m N => Disjoint (cell ε i) (cell ε j)) := by + intro i j hij + apply Set.disjoint_left.mpr + intro p hi hj + have ht : i.1=j.1 := Fin.ext (hi.1.symm.trans hj.1) + have coord {i j : ℕ} {x : ℝ} (hi : x∈interval ε i) (hj : x∈interval ε j) : i=j := by + rcases lt_trichotomy i j with h|h|h + · have h' : (i:ℝ)+1 ≤ j := by exact_mod_cast h + have := mul_le_mul_of_nonneg_left h' hε.le + change ε*i ≤ x ∧ x < ε*(i+1) at hi + change ε*j ≤ x ∧ x < ε*(j+1) at hj + linarith + · exact h + · have h' : (j:ℝ)+1 ≤ i := by exact_mod_cast h + have := mul_le_mul_of_nonneg_left h' hε.le + change ε*i ≤ x ∧ x < ε*(i+1) at hi + change ε*j ≤ x ∧ x < ε*(j+1) at hj + linarith + exact hij (Prod.ext ht (Prod.ext (Fin.ext (coord hi.2.1 hj.2.1)) (Fin.ext (coord hi.2.2 hj.2.2)))) + +theorem cell_dist {m N : ℕ} {ε : ℝ} (hε : 0 < ε) {i : Index m N} {p q : PlaneTracks} + (hp : p∈cell ε i) (hq : q∈cell ε i) : dist p q < ε := by + have coord {i : ℕ} {x y : ℝ} (hx : x∈interval ε i) (hy : y∈interval ε i) : dist x y < ε := by + rw [Real.dist_eq,abs_lt] + change ε*i ≤ x ∧ x < ε*(i+1) at hx + change ε*i ≤ y ∧ y < ε*(i+1) at hy + constructor <;> nlinarith + have ht : p.1=q.1 := hp.1.trans hq.1.symm + rw [Prod.dist_eq,Prod.dist_eq,ht,dist_self,max_lt_iff,max_lt_iff] + exact ⟨hε,coord hp.2.1 hq.2.1,coord hp.2.2 hq.2.2⟩ + +theorem region_covered {m N : ℕ} {ε : ℝ} (hε : 0 < ε) (hN : 1/ε < (N:ℝ)) : + region m⊆⋃i : Index m N,cell ε i := by + rintro ⟨t,x,y⟩ ⟨ht,hx,hy⟩ + have coord {x : ℝ} (hx : x∈Ico (0:ℝ) 1) : ∃i : Fin N,x∈interval ε i.val := by + have hnon : 0 ≤ x/ε := div_nonneg hx.1 hε.le + have hlt : x/ε < (N:ℝ) := (div_lt_div_of_pos_right hx.2 hε).trans hN + have hi : ⌊x/ε⌋₊ < N := by + exact_mod_cast lt_of_le_of_lt (Nat.floor_le hnon) hlt + refine ⟨⟨⌊x/ε⌋₊,hi⟩,?_,?_⟩ + · have h := (le_div_iff₀ hε).mp (Nat.floor_le hnon) + nlinarith + · have h := (div_lt_iff₀ hε).mp (Nat.lt_floor_add_one (x/ε)) + nlinarith + obtain ⟨i,hi⟩ := coord hx + obtain ⟨j,hj⟩ := coord hy + exact Set.mem_iUnion.mpr ⟨(⟨t,ht⟩,i,j),rfl,hi,hj⟩ + +theorem volume_cells {m N : ℕ} {ε : ℝ} (hε : 0 < ε) (I : Finset (Index m N)) : + μ (⋃i∈I,cell ε i)=I.card*(ENNReal.ofReal ε * ENNReal.ofReal ε) := by + rw [measure_biUnion_finset (fun i hi j hj hij => cells_disjoint hε hij) + (fun i _ => measurable_cell ε i)] + simp only [volume_cell,Finset.sum_const, nsmul_eq_mul] + +theorem matching_of_volume {m N : ℕ} {ε : ℝ} (hε : 0 < ε) + (I J : Finset (Index m N)) + (hμ : μ (⋃i∈I,cell ε i) < μ (⋃j∈J,cell ε j)) : Nonempty (I ↪ J) := by + have hc : I.card ≤ J.card := by + by_contra hn + have hnat : J.card ≤ I.card := by omega + have hcast : (J.card : ENNReal) ≤ I.card := by exact_mod_cast hnat + rw [volume_cells hε,volume_cells hε] at hμ + exact not_lt_of_ge (mul_le_mul hcast le_rfl (by positivity) (by positivity)) hμ + have hf : Fintype.card I ≤ Fintype.card J := by simpa using hc + exact Function.Embedding.nonempty_of_card_le hf + +end PolygonGrid +end PolygonGrid + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Configurations/PolygonGroupoid.lean b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/PolygonGroupoid.lean new file mode 100644 index 0000000000000000000000000000000000000000..00b211076a97b1276e0b54032f6e98889d6a54e9 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/PolygonGroupoid.lean @@ -0,0 +1,177 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Configurations.TrackPoint + +namespace OAI + +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open Classical Set CategoryTheory + +structure PolygonObject (a : ℕ) where + tracks : ℕ + cell : Fin tracks → polygonAlgebra a + +namespace PolygonObject +variable {a : ℕ} + +abbrev Point (U : PolygonObject a) := {x : TrackPoint a U.tracks // x.2 ∈ (U.cell x.1).val} + +structure Chart (m n : ℕ) where + source : Fin m + target : Fin n + shift : CutRing × CutRing + domain : polygonAlgebra a + +namespace Chart +variable {U V W : PolygonObject a} + +def Holds (c : Chart (a:=a) U.tracks V.tracks) (f : U.Point → V.Point) : Prop := + ∀ x∈c.domain.val, ∃hx : x∈(U.cell c.source).val, + (f ⟨(c.source,x),hx⟩).val=(c.target,translate a c.shift x) + +def Contains (c : Chart (a:=a) U.tracks V.tracks) (x : U.Point) : Prop := + x.val.1=c.source ∧ x.val.2∈c.domain.val + +noncomputable def comp (c : Chart (a:=a) V.tracks W.tracks) + (d : Chart (a:=a) U.tracks V.tracks) : Chart (a:=a) U.tracks W.tracks := + ⟨d.source,c.target,c.shift+d.shift, + ⟨d.domain.val ∩ translate a d.shift ⁻¹' c.domain.val, + BooleanSubalgebra.inf_mem d.domain.property (polygon_preimage_translate d.shift c.domain.property)⟩⟩ + +theorem comp_holds {c : Chart (a:=a) V.tracks W.tracks} + {d : Chart (a:=a) U.tracks V.tracks} {f : V.Point → W.Point} {g : U.Point → V.Point} + (hc : c.Holds f) (hd : d.Holds g) (hmatch : c.source=d.target) : + (c.comp d).Holds (f ∘ g) := by + rintro x ⟨hx,hcx⟩ + obtain ⟨hu,he⟩ := hd x hx + obtain ⟨hv,hf⟩ := hc (translate a d.shift x) hcx + refine ⟨hu,?_⟩ + have hp : g ⟨(d.source,x),hu⟩=⟨(c.source,translate a d.shift x),hv⟩ := by + apply Subtype.ext + simpa only [hmatch] using he + change (f (g ⟨(d.source,x),hu⟩)).val=(c.target,translate a (c.shift+d.shift) x) + rw [hp,hf,translate_add] + +noncomputable def inverse (c : Chart (a:=a) U.tracks V.tracks) : + Chart (a:=a) V.tracks U.tracks := + ⟨c.target,c.source,-c.shift, + ⟨translation a c.shift '' c.domain.val,polygon_image_translation _ c.domain.property⟩⟩ + +theorem inverse_holds (f : U.Point ≃ V.Point) {c : Chart (a:=a) U.tracks V.tracks} + (hc : c.Holds f) : c.inverse.Holds f.symm := by + rintro y ⟨x,hx,rfl⟩ + obtain ⟨hu,he⟩ := hc x hx + have hv : translate a c.shift x∈(V.cell c.target).val := by + have h := (f ⟨(c.source,x),hu⟩).property + rw [he] at h + exact h + refine ⟨hv,?_⟩ + have hp : (⟨(c.target,translate a c.shift x),hv⟩ : V.Point)=f ⟨(c.source,x),hu⟩ := + Subtype.ext he.symm + change (f.symm ⟨(c.target,translate a c.shift x),hv⟩).val = + (c.source,translate a (-c.shift) (translate a c.shift x)) + rw [hp,f.symm_apply_apply,←translate_add,neg_add_cancel,translate_zero] + +end Chart + +def HasTable {U V : PolygonObject a} (f : U.Point → V.Point) : Prop := + ∃s : Finset (Chart (a:=a) U.tracks V.tracks), + (∀c∈s,c.Holds f) ∧ ∀x,∃c∈s,c.Contains x + +theorem identity_hasTable (U : PolygonObject a) : HasTable (id : U.Point → U.Point) := by + let c : Fin U.tracks → Chart (a:=a) U.tracks U.tracks := fun i => ⟨i,i,0,U.cell i⟩ + refine ⟨Finset.univ.image c,?_,?_⟩ + · intro d hd + obtain ⟨i,-,rfl⟩ := Finset.mem_image.mp hd + intro x hx + exact ⟨hx,by change (i,x)=(i,translate a 0 x); rw [translate_zero]⟩ + · intro x + exact ⟨c x.val.1,Finset.mem_image.mpr ⟨_,Finset.mem_univ _,rfl⟩,rfl,x.property⟩ + +theorem comp_hasTable {U V W : PolygonObject a} {f : V.Point → W.Point} {g : U.Point → V.Point} + (hf : HasTable f) (hg : HasTable g) : HasTable (f ∘ g) := by + obtain ⟨s,hs,hcover⟩ := hf + obtain ⟨t,ht,tcover⟩ := hg + let pairs := (s×ˢt).filter (fun cd => cd.1.source=cd.2.target) + refine ⟨pairs.image (fun cd => cd.1.comp cd.2),?_,?_⟩ + · intro e he + obtain ⟨⟨c,d⟩,hcd,rfl⟩ := Finset.mem_image.mp he + obtain ⟨hmem,hmatch⟩ := Finset.mem_filter.mp hcd + obtain ⟨hc,hd⟩ := Finset.mem_product.mp hmem + exact Chart.comp_holds (hs c hc) (ht d hd) hmatch + · intro x + obtain ⟨d,hd,hx⟩ := tcover x + obtain ⟨c,hc,hgx⟩ := hcover (g x) + obtain ⟨hu,he⟩ := ht d hd x.val.2 hx.2 + have hxval : (⟨(d.source,x.val.2),hu⟩ : U.Point)=x := by + apply Subtype.ext + exact Prod.ext hx.1.symm rfl + rw [hxval] at he + have hmatch : c.source=d.target := by + change (g x).val.1=c.source ∧ (g x).val.2∈c.domain.val at hgx + rw [he] at hgx + exact hgx.1.symm + refine ⟨c.comp d,Finset.mem_image.mpr ⟨(c,d),?_,rfl⟩,hx.1,hx.2,?_⟩ + · exact Finset.mem_filter.mpr ⟨Finset.mem_product.mpr ⟨hc,hd⟩,hmatch⟩ + · change translate a d.shift x.val.2∈c.domain.val + simpa only [he] using hgx.2 + +theorem inverse_hasTable {U V : PolygonObject a} (f : U.Point ≃ V.Point) + (hf : HasTable f) : HasTable f.symm := by + obtain ⟨s,hs,hcover⟩ := hf + refine ⟨s.image Chart.inverse,?_,?_⟩ + · intro c hc + obtain ⟨d,hd,rfl⟩ := Finset.mem_image.mp hc + exact Chart.inverse_holds f (hs d hd) + · intro y + obtain ⟨c,hc,hx⟩ := hcover (f.symm y) + obtain ⟨hu,he⟩ := hs c hc (f.symm y).val.2 hx.2 + have hp : (⟨(c.source,(f.symm y).val.2),hu⟩ : U.Point)=f.symm y := by + apply Subtype.ext + exact Prod.ext hx.1.symm rfl + rw [hp,f.apply_symm_apply] at he + refine ⟨c.inverse,Finset.mem_image.mpr ⟨c,hc,rfl⟩,?_,?_⟩ + · exact congrArg Prod.fst he + · exact ⟨(f.symm y).val.2,hx.2,(congrArg Prod.snd he).symm⟩ + +structure Arrow (U V : PolygonObject a) where + toEquiv : U.Point ≃ V.Point + hasTable : HasTable toEquiv + +@[ext] theorem Arrow.ext {U V : PolygonObject a} {f g : Arrow U V} + (h : f.toEquiv=g.toEquiv) : f=g := by + cases f; cases g; cases h; rfl + +noncomputable instance : Groupoid (PolygonObject a) where + Hom := Arrow + id U := ⟨Equiv.refl _,identity_hasTable U⟩ + comp f g := ⟨f.toEquiv.trans g.toEquiv,comp_hasTable (f:=g.toEquiv) (g:=f.toEquiv) g.hasTable f.hasTable⟩ + id_comp f := Arrow.ext rfl + comp_id f := Arrow.ext rfl + assoc f g h := Arrow.ext rfl + inv f := ⟨f.toEquiv.symm,inverse_hasTable f.toEquiv f.hasTable⟩ + inv_comp f := by apply Arrow.ext; exact Equiv.symm_trans_self _ + comp_inv f := by apply Arrow.ext; exact Equiv.self_trans_symm _ + +def Positional {U V : PolygonObject a} (f : U ⟶ V) : Prop := + ∀x,(f.toEquiv x).val.2=x.val.2 + +noncomputable def positionalSubgroupoid (a : ℕ) : Subgroupoid (PolygonObject a) where + arrows U V := {f | Positional f} + inv := by + intro U V f hf y + change (f.toEquiv.symm y).val.2=y.val.2 + have h := hf (f.toEquiv.symm y) + simpa using h.symm + mul := by + intro U V W f hf g hg x + exact (hg (f.toEquiv x)).trans (hf x) + +theorem identity_positional (U : PolygonObject a) : Positional (𝟙 U) := fun _ => rfl + +end PolygonObject + +end SimpleAmenable + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Configurations/PolygonGroupoidTracks.lean b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/PolygonGroupoidTracks.lean new file mode 100644 index 0000000000000000000000000000000000000000..53f83b02b2ecd7896259893c47b3993621e8bb0a --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/PolygonGroupoidTracks.lean @@ -0,0 +1,94 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Configurations.PolygonGroupoid + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section PolygonGroupoidTracks +open Classical CategoryTheory +namespace PolygonObject +variable {a : ℕ} + +noncomputable def standard (a m : ℕ) : PolygonObject a := ⟨m,fun _ => ⊤⟩ + +noncomputable def standardPointEquiv (a m : ℕ) : (standard a m).Point ≃ TrackPoint a m where + toFun := Subtype.val + invFun x := ⟨x,by trivial⟩ + left_inv _ := rfl + right_inv _ := rfl + +noncomputable def fullGroupArrow {m : ℕ} (g : polygonFullGroup a m) : standard a m ⟶ standard a m where + toEquiv := (standardPointEquiv a m).trans (g.val.trans (standardPointEquiv a m).symm) + hasTable := by + obtain ⟨s,hs,hcover⟩ := g.property + let conv : TableChart a m → Chart (a:=a) m m := fun c => ⟨c.source,c.target,c.shift,c.domain⟩ + refine ⟨s.image conv,?_,?_⟩ + · intro c hc + obtain ⟨d,hd,rfl⟩ := Finset.mem_image.mp hc + intro x hx + refine ⟨by trivial,?_⟩ + exact hs d hd x hx + · intro x + obtain ⟨c,hc,hx⟩ := hcover x.val + exact ⟨conv c,Finset.mem_image.mpr ⟨c,hc,rfl⟩,hx⟩ + +noncomputable def fullGroupOfArrow {m : ℕ} (g : standard a m ⟶ standard a m) : polygonFullGroup a m := + ⟨(standardPointEquiv a m).symm.trans (g.toEquiv.trans (standardPointEquiv a m)),by + obtain ⟨s,hs,hcover⟩ := g.hasTable + let conv : Chart (a:=a) m m → TableChart a m := fun c => ⟨c.source,c.target,c.shift,c.domain⟩ + refine ⟨s.image conv,?_,?_⟩ + · intro c hc + obtain ⟨d,hd,rfl⟩ := Finset.mem_image.mp hc + intro x hx + obtain ⟨hu,he⟩ := hs d hd x hx + exact he + · intro x + obtain ⟨c,hc,hx⟩ := hcover ((standardPointEquiv _ _).symm x) + exact ⟨conv c,Finset.mem_image.mpr ⟨c,hc,rfl⟩,hx⟩⟩ + +@[simp] theorem arrow_fullGroup {m : ℕ} (g : standard a m ⟶ standard a m) : + fullGroupArrow (fullGroupOfArrow g)=g := by + apply Arrow.ext + apply Equiv.ext + intro x + rfl + +@[simp] theorem fullGroup_arrow {m : ℕ} (g : polygonFullGroup a m) : + fullGroupOfArrow (fullGroupArrow g)=g := by + apply Subtype.ext + apply Equiv.ext + intro x + rfl + +theorem fullGroupArrow_injective {m : ℕ} : Function.Injective (@fullGroupArrow a m) := by + intro g h he + simpa using congrArg fullGroupOfArrow he + +theorem fullGroupOfArrow_injective {m : ℕ} : Function.Injective (@fullGroupOfArrow a m) := by + intro g h he + simpa using congrArg fullGroupArrow he + +noncomputable def standardAutEquiv (a m : ℕ) : Aut (standard a m) ≃* polygonFullGroup a m where + toFun g := fullGroupOfArrow g.hom + invFun g := asIso (fullGroupArrow g) + left_inv g := by apply Iso.ext; exact arrow_fullGroup g.hom + right_inv g := fullGroup_arrow g + map_mul' g h := by + apply Subtype.ext + apply Equiv.ext + intro x + rfl + +end PolygonObject +end PolygonGroupoidTracks + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Configurations/PolygonPlacementAlternating.lean b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/PolygonPlacementAlternating.lean new file mode 100644 index 0000000000000000000000000000000000000000..402beed72b2a07db52dcdd19d8b07c82650b77e2 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/PolygonPlacementAlternating.lean @@ -0,0 +1,225 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Configurations.PolygonTrackStabilizer +import OAI.GroupTheory.SimpleAmenable.Configurations.PolygonPlacementPermutation + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section PolygonPlacementAlternating + +open Classical Set +namespace PolygonPlacement +variable {a m n : ℕ} + +theorem permHom_mem_alternating (f : Fin n → PolygonPlacement a m) + (hf : Pairwise (fun i j => Apart (f i) (f j))) (hm : 3*n+1 < m) + {σ : Equiv.Perm (Fin n)} (hσ : σ∈alternatingGroup (Fin n)) : + permHom f hf σ∈polygonAlternatingGroup a m := by + let ι : Fin n ↪ Fin m := Fin.castLEEmb (by omega) + let s : Fin n → PolygonPlacement a m := fun i => standard (ι i) + have hs : Pairwise (fun i j => Apart (s i) (s j)) := + fun _ _ hij => standard_apart (ι.injective.ne hij) + obtain ⟨g,hg⟩ := configuration_transitive s f hs hf hm + have hgs (i : Fin n) (x : GenericSquare a) : g.val (ι i,x)=f i x := + congrArg (fun e : PolygonPlacement a m => e x) (hg i) + let slots : Fin n → Fin m × (CutRing×CutRing) := fun i => (ι i,0) + have hinj : Function.Injective (SlotMap a m ⊤ slots) := + slots_injective_of_tracks ⊤ slots ι.injective + have hslot (i : Fin n) (x : (⊤ : polygonAlgebra a).val) : + SlotMap a m ⊤ slots (i,x)=(ι i,x.val) := by + change (ι i,translate a 0 x.val)=(ι i,x.val) + rw [translate_zero] + have he : g*slotHom ⊤ slots hinj σ*g⁻¹=permHom f hf σ := by + apply Subtype.ext; apply Equiv.ext + intro p + obtain ⟨q,rfl⟩ := g.val.surjective p + change g.val (slotPerm ⊤ slots hinj σ (g.val.symm (g.val q)))=perm f hf σ (g.val q) + rw [g.val.symm_apply_apply] + by_cases hq : q∈Set.range (SlotMap a m ⊤ slots) + · obtain ⟨⟨i,x⟩,rfl⟩ := hq + rw [slotPerm_apply,hslot,hslot,hgs,hgs,perm_apply] + · rw [slotPerm_apply_of_notMem _ _ _ _ hq] + symm + apply perm_fixed + intro i hmem + obtain ⟨x,hx⟩ := hmem + have hp : q=(ι i,x) := g.val.injective (hx.symm.trans (hgs i x).symm) + exact hq ⟨(i,⟨x,by trivial⟩),(hslot i ⟨x,by trivial⟩).trans hp.symm⟩ + rw [←he] + exact (polygonAlternatingGroup_normal a m).conj_mem _ (slotHom_alternating_mem _ _ _ hσ) g + +end PolygonPlacement +end PolygonPlacementAlternating + +section PolygonAlternatingTransitive + +open Classical Set +namespace PolygonPlacement +variable {a m n : ℕ} + +theorem familyPerm_mem_alternating {ι : Type*} [Fintype ι] [DecidableEq ι] + (f : ι → PolygonPlacement a m) (hf : Pairwise (fun i j => Apart (f i) (f j))) + (hm : 3*Fintype.card ι+1 < m) {σ : Equiv.Perm ι} + (hσ : σ∈alternatingGroup ι) : familyPerm f hf σ∈polygonAlternatingGroup a m := by + apply permHom_mem_alternating _ _ hm + change Equiv.Perm.sign (((Fintype.equivFin ι).symm.trans σ).trans (Fintype.equivFin ι))=1 + rw [Equiv.Perm.sign_symm_trans_trans] + exact hσ + +theorem alternating_move_to_bank (f : Fin n → PolygonPlacement a m) + (w : Fin (n+2) → PolygonPlacement a m) + (hf : Pairwise (fun i j => Apart (f i) (f j))) + (hw : Pairwise (fun i j => Apart (w i) (w j))) + (hfw : ∀i j,Apart (f i) (w j)) (hm : 6*n+7 < m) : + ∃h : polygonAlternatingGroup a m,∀i x,h.val.val (f i x)=w (i.castAdd 2) x := by + let e : Fin n ⊕ Fin (n+2) → PolygonPlacement a m := Sum.elim f w + have he : Pairwise (fun i j => Apart (e i) (e j)) := by + intro i j hij + cases i with + | inl i => + cases j with + | inl j => exact hf (fun hh => hij (congrArg Sum.inl hh)) + | inr j => exact hfw i j + | inr i => + cases j with + | inl j => exact (hfw j i).symm + | inr j => exact hw (fun hh => hij (congrArg Sum.inr hh)) + let s : Fin n ↪ Fin n ⊕ Fin (n+2) := ⟨Sum.inl,Sum.inl_injective⟩ + let t : Fin n ↪ Fin n ⊕ Fin (n+2) := + ⟨fun i => Sum.inr (i.castAdd 2),by + intro i j h + have hc : i.castAdd 2=j.castAdd 2 := Sum.inr_injective h + have hv := congrArg (fun x : Fin (n+2) => x.val) hc + exact Fin.ext hv⟩ + obtain ⟨σ,hσ⟩ := even_move_embedding (s:=s) (t:=t) (by simp [Nat.card_eq_fintype_card]) + have hb : 3*Fintype.card (Fin n ⊕ Fin (n+2))+1 < m := by + simp only [Fintype.card_sum,Fintype.card_fin] + omega + refine ⟨⟨familyPerm e he σ.val,familyPerm_mem_alternating e he hb σ.property⟩,?_⟩ + intro i x + have hh := familyPerm_apply e he σ.val (s i) x + rw [hσ] at hh + exact hh + +theorem alternating_configuration_transitive (f g : Fin n → PolygonPlacement a m) + (hf : Pairwise (fun i j => Apart (f i) (f j))) + (hg : Pairwise (fun i j => Apart (g i) (g j))) (hm : 6*n+7 < m) : + ∃h : polygonAlternatingGroup a m,∀i,h.val • f i=g i := by + let S := Finset.univ.image f ∪ Finset.univ.image g + have hS : S.card≤2*n := by + calc + _≤(Finset.univ.image f).card+(Finset.univ.image g).card := Finset.card_union_le _ _ + _≤(Finset.univ : Finset (Fin n)).card+(Finset.univ : Finset (Fin n)).card := + Nat.add_le_add (Finset.card_image_le) (Finset.card_image_le) + _=2*n := by simp; omega + obtain ⟨w,hw,hws⟩ := exists_configuration_avoiding S (n+2) (by omega) + have hfw (i : Fin n) (j : Fin (n+2)) : Apart (f i) (w j) := + (hws j (f i) (Finset.mem_union_left _ (Finset.mem_image.mpr ⟨i,Finset.mem_univ _,rfl⟩))).symm + have hgw (i : Fin n) (j : Fin (n+2)) : Apart (g i) (w j) := + (hws j (g i) (Finset.mem_union_right _ (Finset.mem_image.mpr ⟨i,Finset.mem_univ _,rfl⟩))).symm + obtain ⟨u,hu⟩ := alternating_move_to_bank f w hf hw hfw hm + obtain ⟨v,hv⟩ := alternating_move_to_bank g w hg hw hgw hm + refine ⟨v⁻¹*u,fun i => ?_⟩ + apply PolygonPlacement.ext + intro x + change v.val.val.symm (u.val.val (f i x))=g i x + rw [hu] + exact v.val.val.symm_apply_eq.mpr (hv i x).symm + +end PolygonPlacement +end PolygonAlternatingTransitive + +section PolygonConfigurationOrbit +open Classical Set +namespace PolygonPlacement + +def Configuration (a m p : ℕ) := + {f : Fin p → PolygonPlacement a m // Pairwise (fun i j => Apart (f i) (f j))} + +namespace Configuration +variable {a m p : ℕ} +instance : CoeFun (Configuration a m p) (fun _ => Fin p → PolygonPlacement a m) := ⟨Subtype.val⟩ + +@[ext] theorem ext {f g : Configuration a m p} (h : ∀i,f i=g i) : f=g := + Subtype.ext (funext h) + +noncomputable instance : MulAction (polygonFullGroup a m) (Configuration a m p) where + smul g f := ⟨fun i => g • f i,fun i j hij => (apart_smul_iff g _ _).mpr (f.property hij)⟩ + one_smul f := by apply ext; intro i; exact one_smul _ _ + mul_smul g h f := by apply ext; intro i; exact mul_smul g h _ + +@[simp] theorem smul_apply (g : polygonFullGroup a m) (f : Configuration a m p) (i : Fin p) : + (g • f) i=g • f i := rfl + +noncomputable def standard (a p n : ℕ) : Configuration a (p+n) p := + ⟨fun i => PolygonPlacement.standard (i.castAdd n),fun i j hij => standard_apart (by + intro hh + apply hij + have hv := congrArg (fun x : Fin (p+n) => x.val) hh + exact Fin.ext hv)⟩ + +@[simp] theorem standard_apply (i : Fin p) (x : GenericSquare a) (n : ℕ) : + standard a p n i x=(i.castAdd n,x) := rfl + +theorem stabilizer_standard (a p n : ℕ) : + MulAction.stabilizer (polygonFullGroup a (p+n)) (standard a p n)= + PolygonTracks.bankFixer a p n := by + ext g + change g • standard a p n=standard a p n ↔ _ + constructor + · intro he x + exact congrArg (fun f : Configuration a (p+n) p => f x.1 x.2) he + · intro he + apply ext + intro i + apply PolygonPlacement.ext + intro x + exact he (i,x) + +theorem transitive (f g : Configuration a m p) (hm : 3*p+1 < m) : + ∃u : polygonFullGroup a m,u • f=g := by + obtain ⟨u,hu⟩ := configuration_transitive f.val g.val f.property g.property hm + exact ⟨u,ext hu⟩ + +noncomputable def quotientStabilizerEquiv (a p n : ℕ) (hm : 3*p+1 < p+n) : + (polygonFullGroup a (p+n) ⧸ MulAction.stabilizer (polygonFullGroup a (p+n)) + (standard a p n)) ≃ Configuration a (p+n) p := + Equiv.ofBijective (MulAction.ofQuotientStabilizer (polygonFullGroup a (p+n)) (standard a p n)) + ⟨MulAction.injective_ofQuotientStabilizer _ _,by + intro f + obtain ⟨g,hg⟩ := transitive (standard a p n) f hm + exact ⟨g,hg⟩⟩ + +@[simp] theorem quotientStabilizerEquiv_apply (a p n : ℕ) (hm : 3*p+1 < p+n) + (g : polygonFullGroup a (p+n)) : + quotientStabilizerEquiv a p n hm g=g • standard a p n := rfl + +noncomputable def quotientBankEquiv (a p n : ℕ) (hm : 3*p+1 < p+n) : + (polygonFullGroup a (p+n) ⧸ PolygonTracks.bankFixer a p n) ≃ Configuration a (p+n) p := + (Subgroup.quotientEquivOfEq (stabilizer_standard a p n).symm).trans + (quotientStabilizerEquiv a p n hm) + +@[simp] theorem quotientBankEquiv_apply (a p n : ℕ) (hm : 3*p+1 < p+n) + (g : polygonFullGroup a (p+n)) : + quotientBankEquiv a p n hm g=g • standard a p n := rfl + +theorem quotientBankEquiv_smul (a p n : ℕ) (hm : 3*p+1 < p+n) + (g : polygonFullGroup a (p+n)) (x : polygonFullGroup a (p+n) ⧸ PolygonTracks.bankFixer a p n) : + quotientBankEquiv a p n hm (g • x)=g • quotientBankEquiv a p n hm x := by + induction x using Quotient.inductionOn' with + | h h => exact mul_smul g h _ + +end Configuration +end PolygonPlacement +end PolygonConfigurationOrbit + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Configurations/PolygonPlacementArea.lean b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/PolygonPlacementArea.lean new file mode 100644 index 0000000000000000000000000000000000000000..e38c3cc27bdbb1a5de5f0284ffe0c1424904afc0 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/PolygonPlacementArea.lean @@ -0,0 +1,169 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.ConfigurationResolution +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.PolygonGridEmbedding +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.PolygonAreaAlgebra + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section PolygonPlacementArea + +open Classical Set +namespace PolygonArea + +@[simp] theorem val_finset_sup {a : ℕ} {ι : Type*} (s : Finset ι) (f : ι → polygonAlgebra a) : + (s.sup f).val=⋃i∈s,(f i).val := by + induction s using Finset.induction_on with + | empty => simp + | @insert i s hi ih => simp [Finset.sup_insert,BooleanSubalgebra.val_sup,ih] + +end PolygonArea +namespace PolygonPlacement + +noncomputable def imageBank {a m : ℕ} (f : PolygonPlacement a m) (i : Fin m) : polygonAlgebra a := + ⟨{x | (i,x)∈Set.range f},range_fiber_polygon f i⟩ + +theorem imageBank_area_le {a m : ℕ} (f : PolygonPlacement a m) : + (∑i,PolygonArea.area (imageBank f i))≤1 := by + obtain ⟨s,hs,hcover⟩ := f.charts + let D : s → polygonAlgebra a := fun c => c.val.2.2 + obtain ⟨P,hP,hSup,hdisP⟩ := Fintype.exists_disjointed_le D + have hcoverP : (⊤ : polygonAlgebra a).val=⋃c,(P c).val := by + have hv := congrArg (fun A : polygonAlgebra a => A.val) hSup + simp only [PolygonArea.val_finset_sup,Finset.mem_univ,Set.iUnion_true] at hv + rw [hv] + ext x + simp only [BooleanSubalgebra.val_top,Set.top_eq_univ,Set.mem_univ,true_iff,Set.mem_iUnion] + obtain ⟨c,hc,hx⟩ := hcover x + exact ⟨⟨c,hc⟩,hx⟩ + have hsumP : (∑c,PolygonArea.area (P c))=1 := by + rw [←PolygonArea.area_top a] + symm + apply PolygonArea.area_eq_sum _ P hcoverP + intro i j hij + have h : Disjoint (P i) (P j) := hdisP hij + rw [disjoint_iff] at h + exact Set.disjoint_iff_inter_eq_empty.mpr (congrArg (fun A : polygonAlgebra a => A.val) h) + let Q (i : Fin m) (c : s) : polygonAlgebra a := + if c.val.1=i then translatedPolygon c.val.2.1 (P c) else ⊥ + have hbank (i : Fin m) : imageBank f i≤Finset.univ.sup (Q i) := by + intro y hy + obtain ⟨x,hxy⟩ := hy + have hx : x∈⋃c,(P c).val := by rw [←hcoverP]; trivial + obtain ⟨c,hc⟩ := Set.mem_iUnion.mp hx + have he := (hs c.val c.property x (hP c hc)).symm.trans hxy + have ht : c.val.1=i := congrArg Prod.fst he + rw [PolygonArea.val_finset_sup] + refine Set.mem_iUnion₂.mpr ⟨c,Finset.mem_univ _,?_⟩ + simp only [Q,ht,ite_true] + exact ⟨x,hc,congrArg Prod.snd he⟩ + calc + (∑i,PolygonArea.area (imageBank f i))≤∑i,∑c,PolygonArea.area (Q i c) := by + apply Finset.sum_le_sum + intro i _ + exact (PolygonArea.area_mono (hbank i)).trans (PolygonArea.area_finset_sup_le _ _) + _=∑c,PolygonArea.area (P c) := by + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro c _ + simp only [Q,apply_ite,PolygonArea.area_bot,PolygonArea.area_translation] + simp + _=1 := hsumP + +end PolygonPlacement +end PolygonPlacementArea + +section PolygonCommonNeighbor + +open Classical Set +namespace PolygonPlacement + +theorem placement_in_bank {a m : ℕ} (hm : 0 < m) (V : Fin m → polygonAlgebra a) + (hV : 1 < ∑i,PolygonArea.area (V i)) : + ∃ e : PolygonPlacement a m,∀x,(e x).2∈(V (e x).1).val := by + let i₀ : Fin m := ⟨0,hm⟩ + let U : Fin m → polygonAlgebra a := fun i => if i=i₀ then ⊤ else ⊥ + have hU : (∑i,PolygonArea.area (U i))=1 := by + simp [U,apply_ite,PolygonArea.area_bot,PolygonArea.area_top] + obtain ⟨f,hf⟩ := PolygonGrid.strict_comparison U V (by rwa [hU]) + let PU : PolygonObject a := ⟨m,U⟩ + let PV : PolygonObject a := ⟨m,V⟩ + let src (x : GenericSquare a) : PU.Point := ⟨(i₀,x),by simp [PU,U]⟩ + let ef : GenericSquare a ↪ TrackPoint a m := + ⟨fun x => (f (src x)).val,fun x y he => + congrArg (fun p : PU.Point => p.val.2) (f.injective (Subtype.ext he))⟩ + have hetab : ∃s : Finset (Fin m × (CutRing×CutRing) × polygonAlgebra a), + (∀c∈s,∀x∈c.2.2.val,ef x=(c.1,translate a c.2.1 x)) ∧ + ∀x,∃c∈s,x∈c.2.2.val := by + obtain ⟨s,hs,hcover⟩ := hf + let t := s.filter (fun c => c.source=i₀) + let conv : PolygonObject.Chart (a:=a) m m → Fin m × (CutRing×CutRing) × polygonAlgebra a := + fun c => (c.target,c.shift,c.domain) + refine ⟨t.image conv,?_,?_⟩ + · intro c hc + obtain ⟨d,hd,rfl⟩ := Finset.mem_image.mp hc + obtain ⟨hds,hdsrc⟩ := Finset.mem_filter.mp hd + intro x hx + obtain ⟨hu,he⟩ := hs d hds x hx + change (f (src x)).val=(d.target,translate a d.shift x) + simpa only [src,hdsrc] using he + · intro x + obtain ⟨c,hc,hx⟩ := hcover (src x) + refine ⟨conv c,Finset.mem_image.mpr ⟨c,?_,rfl⟩,hx.2⟩ + exact Finset.mem_filter.mpr ⟨hc,hx.1.symm⟩ + exact ⟨⟨ef,hetab⟩,fun x => (f (src x)).property⟩ + +theorem common_neighbor {a m : ℕ} (S : Finset (PolygonPlacement a m)) + (hm : S.card+1 < m) : ∃e : PolygonPlacement a m,∀f∈S,Apart e f := by + let B (i : Fin m) : polygonAlgebra a := S.sup (fun f => imageBank f i) + let V (i : Fin m) : polygonAlgebra a := (B i)ᶜ + have hB : (∑i,PolygonArea.area (B i))≤S.card := by + calc + _≤∑i,∑f∈S,PolygonArea.area (imageBank f i) := + Finset.sum_le_sum (fun i _ => PolygonArea.area_finset_sup_le S _) + _=∑f∈S,∑i,PolygonArea.area (imageBank f i) := Finset.sum_comm + _≤∑_∈S,(1:ENNReal) := Finset.sum_le_sum (fun f _ => imageBank_area_le f) + _=S.card := by simp + have hsum : (∑i,PolygonArea.area (B i))+(∑i,PolygonArea.area (V i))=m := by + rw [←Finset.sum_add_distrib] + simp only [V,PolygonArea.area_compl,Finset.sum_const,Finset.card_univ,Fintype.card_fin,nsmul_eq_mul,mul_one] + have hV : 1 < ∑i,PolygonArea.area (V i) := by + by_contra hn + have hh : (m:ENNReal)≤S.card+1 := + hsum.symm.trans_le (add_le_add hB (le_of_not_gt hn)) + have hml : (S.card:ENNReal)+1 < m := by exact_mod_cast hm + exact (not_le_of_gt hml) hh + obtain ⟨e,he⟩ := placement_in_bank (by omega : 0 < m) V hV + refine ⟨e,fun f hf => ?_⟩ + rw [apart_iff] + intro x y hxy + have hn := he x + change (e x).2∉(B (e x).1).val at hn + apply hn + have hin : (imageBank f (e x).1).val⊆(B (e x).1).val := by + change imageBank f (e x).1 ≤ S.sup (fun g => imageBank g (e x).1) + exact Finset.le_sup (f := fun g : PolygonPlacement a m => imageBank g (e x).1) hf + apply hin + refine ⟨y,?_⟩ + exact hxy.symm + +theorem configuration_lowDegree_exact {a m n : ℕ} (hm : 33 ≤ m) (hn : n ≤ 2) : + Function.Exact (ConfigurationChains.degreeBoundary (@Apart a m) (n+1)) + (ConfigurationChains.degreeBoundary (@Apart a m) n) := by + apply ConfigurationChains.lowDegree_exact _ hn + intro S hS + exact common_neighbor S (by omega) + +end PolygonPlacement +end PolygonCommonNeighbor + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Configurations/PolygonPlacementPermutation.lean b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/PolygonPlacementPermutation.lean new file mode 100644 index 0000000000000000000000000000000000000000..25856a61d4bdac20e0a96cd1b82cf9b15826a2e4 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/PolygonPlacementPermutation.lean @@ -0,0 +1,201 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Configurations.PolygonPlacementArea + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section PolygonPlacementPermutation + +open Classical Set +namespace PolygonPlacement +variable {a m n : ℕ} (f : Fin n → PolygonPlacement a m) + (hf : Pairwise (fun i j => Apart (f i) (f j))) + +noncomputable def perm (σ : Equiv.Perm (Fin n)) : Equiv.Perm (TrackPoint a m) := + Equiv.Perm.viaEmbedding (Equiv.prodCongr σ (Equiv.refl _)) (bank f hf) + +@[simp] theorem perm_apply (σ : Equiv.Perm (Fin n)) (i : Fin n) (x : GenericSquare a) : + perm f hf σ (f i x)=f (σ i) x := + Equiv.Perm.viaEmbedding_apply _ _ (i,x) + +theorem perm_fixed (σ : Equiv.Perm (Fin n)) (p : TrackPoint a m) + (hp : ∀i,p∉Set.range (f i)) : perm f hf σ p=p := by + apply Equiv.Perm.viaEmbedding_apply_of_notMem + rintro ⟨⟨i,x⟩,hi⟩ + exact hp i ⟨x,hi⟩ + +theorem perm_hasTable (σ : Equiv.Perm (Fin n)) : HasTranslationTable (perm f hf σ) := by + let s (i : Fin n) := (f i).charts.choose + have hs (i : Fin n) := (f i).charts.choose_spec.1 + have hc (i : Fin n) := (f i).charts.choose_spec.2 + let J := Σi : Fin n, {c // c∈s i} × {d // d∈s (σ i)} + let chart (j : J) : TableChart a m := + ⟨j.2.1.val.1,j.2.2.val.1,j.2.2.val.2.1-j.2.1.val.2.1, + translatedPolygon j.2.1.val.2.1 (j.2.1.val.2.2 ⊓ j.2.2.val.2.2)⟩ + let V (i : Fin m) : polygonAlgebra a := (Finset.univ.sup (fun j => imageBank (f j) i))ᶜ + have hV (p : TrackPoint a m) : p.2∈(V p.1).val ↔ ∀i,p∉Set.range (f i) := by + simp only [V,BooleanSubalgebra.val_compl,PolygonArea.val_finset_sup, + Set.mem_compl_iff,Set.mem_iUnion,Finset.mem_univ,not_exists,true_implies] + rfl + let void (i : Fin m) : TableChart a m := ⟨i,i,0,V i⟩ + refine ⟨Finset.univ.image chart ∪ Finset.univ.image void,?_,?_⟩ + · intro c hc' + rcases Finset.mem_union.mp hc' with hc'|hc' + · obtain ⟨j,-,rfl⟩ := Finset.mem_image.mp hc' + intro y hy + obtain ⟨x,⟨hx,hd⟩,rfl⟩ := hy + have hcval := hs j.1 j.2.1.val j.2.1.property x hx + have hdval := hs (σ j.1) j.2.2.val j.2.2.property x hd + change perm f hf σ (j.2.1.val.1,translate a j.2.1.val.2.1 x)= + (j.2.2.val.1,translate a (j.2.2.val.2.1-j.2.1.val.2.1) (translate a j.2.1.val.2.1 x)) + rw [←hcval,perm_apply,hdval,←translate_add,sub_add_cancel] + · obtain ⟨i,-,rfl⟩ := Finset.mem_image.mp hc' + intro x hx + change perm f hf σ (i,x)=(i,translate a 0 x) + rw [translate_zero] + exact perm_fixed f hf σ (i,x) ((hV (i,x)).mp hx) + · intro p + by_cases hp : ∃i,p∈Set.range (f i) + · obtain ⟨i,x,rfl⟩ := hp + obtain ⟨c,hcs,hcx⟩ := hc i x + obtain ⟨d,hds,hdx⟩ := hc (σ i) x + let j : J := ⟨i,⟨c,hcs⟩,⟨d,hds⟩⟩ + refine ⟨chart j,Finset.mem_union_left _ (Finset.mem_image.mpr ⟨j,Finset.mem_univ _,rfl⟩),?_,?_⟩ + · exact congrArg Prod.fst (hs i c hcs x hcx) + · refine ⟨x,⟨hcx,hdx⟩,?_⟩ + exact (congrArg Prod.snd (hs i c hcs x hcx)).symm + · exact ⟨void p.1,Finset.mem_union_right _ (Finset.mem_image.mpr ⟨p.1,Finset.mem_univ _,rfl⟩), + rfl,(hV p).mpr (by simpa only [not_exists] using hp)⟩ + +noncomputable def permHom : Equiv.Perm (Fin n) →* polygonFullGroup a m where + toFun σ := ⟨perm f hf σ,perm_hasTable f hf σ⟩ + map_one' := by + apply Subtype.ext; apply Equiv.ext + intro p + by_cases hp : ∃i,p∈Set.range (f i) + · obtain ⟨i,x,rfl⟩ := hp + exact perm_apply f hf 1 i x + · exact perm_fixed f hf 1 p (by simpa only [not_exists] using hp) + map_mul' σ ρ := by + apply Subtype.ext; apply Equiv.ext + intro p + change perm f hf (σ*ρ) p=perm f hf σ (perm f hf ρ p) + by_cases hp : ∃i,p∈Set.range (f i) + · obtain ⟨i,x,rfl⟩ := hp + simp only [perm_apply,Equiv.Perm.mul_apply] + · have h : ∀i,p∉Set.range (f i) := by simpa only [not_exists] using hp + rw [perm_fixed f hf _ p h,perm_fixed f hf _ p h,perm_fixed f hf _ p h] + +@[simp] theorem permHom_apply (σ : Equiv.Perm (Fin n)) (i : Fin n) (x : GenericSquare a) : + (permHom f hf σ).val (f i x)=f (σ i) x := perm_apply f hf σ i x + +end PolygonPlacement +end PolygonPlacementPermutation + +section PolygonConfigurationTransitive + +open Classical Set +namespace PolygonPlacement +variable {a m n : ℕ} + +noncomputable def familyPerm {ι : Type*} [Fintype ι] (f : ι → PolygonPlacement a m) + (hf : Pairwise (fun i j => Apart (f i) (f j))) (σ : Equiv.Perm ι) : polygonFullGroup a m := + let e := Fintype.equivFin ι + permHom (fun i => f (e.symm i)) + (fun _ _ h => hf (fun he => h (e.symm.injective he))) + (e.symm.trans (σ.trans e)) + +@[simp] theorem familyPerm_apply {ι : Type*} [Fintype ι] (f : ι → PolygonPlacement a m) + (hf : Pairwise (fun i j => Apart (f i) (f j))) (σ : Equiv.Perm ι) + (i : ι) (x : GenericSquare a) : (familyPerm f hf σ).val (f i x)=f (σ i) x := by + let e := Fintype.equivFin ι + have h := permHom_apply (fun j => f (e.symm j)) + (fun _ _ h => hf (fun he => h (e.symm.injective he))) + (e.symm.trans (σ.trans e)) (e i) x + simpa only [familyPerm,e,Equiv.symm_apply_apply,Equiv.trans_apply,Equiv.apply_symm_apply] using h + +theorem exists_configuration_avoiding (S : Finset (PolygonPlacement a m)) (n : ℕ) + (hm : S.card+n+1 < m) : + ∃w : Fin n → PolygonPlacement a m, + Pairwise (fun i j => Apart (w i) (w j)) ∧ ∀i f,f∈S → Apart (w i) f := by + induction n generalizing S with + | zero => exact ⟨Fin.elim0,by intro i; exact i.elim0,by intro i; exact i.elim0⟩ + | succ n ih => + obtain ⟨v,hv⟩ := common_neighbor S (by omega) + obtain ⟨w,hw,hws⟩ := ih (insert v S) (by + have hh := Finset.card_insert_le v S + omega) + refine ⟨Fin.cons v w,?_,?_⟩ + · intro i j hij + induction i using Fin.cases with + | zero => + induction j using Fin.cases with + | zero => exact (hij rfl).elim + | succ j => exact (hws j v (Finset.mem_insert_self _ _)).symm + | succ i => + induction j using Fin.cases with + | zero => exact hws i v (Finset.mem_insert_self _ _) + | succ j => exact hw (fun he => hij (congrArg Fin.succ he)) + · intro i f hf + induction i using Fin.cases with + | zero => exact hv f hf + | succ i => exact hws i f (Finset.mem_insert_of_mem hf) + +theorem swap_configurations (f g : Fin n → PolygonPlacement a m) + (hf : Pairwise (fun i j => Apart (f i) (f j))) + (hg : Pairwise (fun i j => Apart (g i) (g j))) + (hfg : ∀i j,Apart (f i) (g j)) : + ∃h : polygonFullGroup a m,∀i x,h.val (f i x)=g i x := by + let e : Fin n ⊕ Fin n → PolygonPlacement a m := Sum.elim f g + have he : Pairwise (fun i j => Apart (e i) (e j)) := by + intro i j hij + cases i with + | inl i => + cases j with + | inl j => exact hf (fun h => hij (congrArg Sum.inl h)) + | inr j => exact hfg i j + | inr i => + cases j with + | inl j => exact (hfg j i).symm + | inr j => exact hg (fun h => hij (congrArg Sum.inr h)) + refine ⟨familyPerm e he (Equiv.sumComm _ _),?_⟩ + intro i x + exact familyPerm_apply e he (Equiv.sumComm _ _) (.inl i) x + +theorem configuration_transitive (f g : Fin n → PolygonPlacement a m) + (hf : Pairwise (fun i j => Apart (f i) (f j))) + (hg : Pairwise (fun i j => Apart (g i) (g j))) (hm : 3*n+1 < m) : + ∃h : polygonFullGroup a m,∀i,h • f i=g i := by + let S := Finset.univ.image f ∪ Finset.univ.image g + have hS : S.card≤2*n := by + calc + _≤(Finset.univ.image f).card+(Finset.univ.image g).card := Finset.card_union_le _ _ + _≤(Finset.univ : Finset (Fin n)).card+(Finset.univ : Finset (Fin n)).card := + Nat.add_le_add (Finset.card_image_le) (Finset.card_image_le) + _=2*n := by simp; omega + obtain ⟨w,hw,hws⟩ := exists_configuration_avoiding S n (by omega) + have hwf (i j : Fin n) : Apart (w i) (f j) := + hws i (f j) (Finset.mem_union_left _ (Finset.mem_image.mpr ⟨j,Finset.mem_univ _,rfl⟩)) + have hwg (i j : Fin n) : Apart (w i) (g j) := + hws i (g j) (Finset.mem_union_right _ (Finset.mem_image.mpr ⟨j,Finset.mem_univ _,rfl⟩)) + obtain ⟨u,hu⟩ := swap_configurations f w hf hw (fun i j => (hwf j i).symm) + obtain ⟨v,hv⟩ := swap_configurations w g hw hg hwg + refine ⟨v*u,fun i => ?_⟩ + apply PolygonPlacement.ext + intro x + change v.val (u.val (f i x))=g i x + rw [hu,hv] + +end PolygonPlacement +end PolygonConfigurationTransitive + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Configurations/PolygonStrandReconstruction.lean b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/PolygonStrandReconstruction.lean new file mode 100644 index 0000000000000000000000000000000000000000..3d5ab5cf45f2d33bc64da7c817f2772c78be9058 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/PolygonStrandReconstruction.lean @@ -0,0 +1,122 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Configurations.PolygonStringNormalization + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section PolygonStrandReconstruction + +open Classical CategoryTheory +namespace PolygonObject +variable {a n : ℕ} + +theorem representative_sub (u v : CutRing × CutRing) : + orbitRepresentative (u-v)=orbitRepresentative u-orbitRepresentative v := by + simp [orbitRepresentative,sub_mul] + +theorem trajectoryShift_translationString (U : PolygonObject a) + (d : Fin (n+1) → Fin U.tracks → CutRing × CutRing) (x : U.Point) (i : Fin (n+1)) : + trajectoryShift (translationString U d) ((shiftArrow U (d 0)).toEquiv x) i= + orbitRepresentative (d i x.val.1-d 0 x.val.1) := by + apply pointShift_unique + change ((CategoryTheory.inv (shiftArrow U (d 0)) ≫ shiftArrow U (d i)).toEquiv + ((shiftArrow U (d 0)).toEquiv x)).val.2 = _ + simp only [arrow_comp_apply,inv_arrow_apply,Equiv.symm_apply_apply] + simp only [shiftArrow_apply] + rw [←translate_add,sub_add_cancel] + +theorem increments_translationString (U : PolygonObject a) + (d : Fin (n+1) → Fin U.tracks → CutRing × CutRing) (x : U.Point) (i : Fin n) : + increments (translationString U d) ((shiftArrow U (d 0)).toEquiv x) i= + orbitRepresentative (d i.succ x.val.1-d i.castSucc x.val.1) := by + unfold increments + rw [trajectoryShift_translationString,trajectoryShift_translationString,←representative_sub] + congr 1 + abel + +noncomputable def incrementString (U : PolygonObject a) + (γ : Fin U.tracks → Fin n → CutRing × CutRing) : RawString a n := + translationString U (fun i j => Fin.partialSum (γ j) i) + +noncomputable def incrementInitial (U : PolygonObject a) + (γ : Fin U.tracks → Fin n → CutRing × CutRing) : U ⟶ (incrementString U γ).obj 0 := + shiftArrow U (fun j => Fin.partialSum (γ j) 0) + +theorem incrementInitial_positional (U : PolygonObject a) + (γ : Fin U.tracks → Fin n → CutRing × CutRing) : Positional (incrementInitial U γ) := by + intro x + change translate a (Fin.partialSum (γ x.val.1) 0) x.val.2=x.val.2 + rw [Fin.partialSum_zero,translate_zero] + +theorem incrementString_spec (U : PolygonObject a) + (γ : Fin U.tracks → Fin n → CutRing × CutRing) (x : U.Point) (i : Fin n) : + increments (incrementString U γ) ((incrementInitial U γ).toEquiv x) i= + orbitRepresentative (γ x.val.1 i) := by + change increments (translationString U (fun i j => Fin.partialSum (γ j) i)) + ((shiftArrow U (fun j => Fin.partialSum (γ j) 0)).toEquiv x) i=_ + rw [increments_translationString,Fin.partialSum_succ] + congr 1 + abel + +theorem incrementString_spec_reduced (U : PolygonObject a) + (γ : Fin U.tracks → Fin n → CutRing × CutRing) + (hγ : ∀j i,orbitRepresentative (γ j i)=γ j i) (x : U.Point) : + increments (incrementString U γ) ((incrementInitial U γ).toEquiv x)=γ x.val.1 := by + funext i + rw [incrementString_spec,hγ] + +end PolygonObject +end PolygonStrandReconstruction + +section PolygonIncrementFibers + +open Classical CategoryTheory +namespace PolygonObject +variable {a n : ℕ} + +theorem partialSum_increments (F : RawString a n) (x : (F.obj 0).Point) (i : Fin (n+1)) : + Fin.partialSum (increments F x) i=trajectoryShift F x i := by + induction i using Fin.induction with + | zero => simp + | succ i hi => + rw [Fin.partialSum_succ,hi] + unfold increments + abel + +theorem trajectory_eq_of_increments {F G : RawString a n} (h : F.obj 0 ⟶ G.obj 0) + (hp : Positional h) (he : ∀x,increments G (h.toEquiv x)=increments F x) + (x : (F.obj 0).Point) : trajectory G (h.toEquiv x)=trajectory F x := by + funext i + unfold trajectory + rw [pointShift_spec (baseArrow G i),pointShift_spec (baseArrow F i)] + change translate a (trajectoryShift G (h.toEquiv x) i) (h.toEquiv x).val.2= + translate a (trajectoryShift F x i) x.val.2 + rw [hp x,←partialSum_increments,←partialSum_increments,he x] + +theorem extendLadder_positional_of_increments {F G : RawString a n} (h : F.obj 0 ⟶ G.obj 0) + (hp : Positional h) (he : ∀x,increments G (h.toEquiv x)=increments F x) : + (ladderProperty a n) (extendLadder h) := + extendLadder_positional h (trajectory_eq_of_increments h hp he) + +noncomputable def incrementLadderEquiv (F G : StringGroupoid a n) : + (F ⟶ G) ≃ {h : F.obj.obj 0 ⟶ G.obj.obj 0 // + Positional h ∧ ∀x,increments G.obj (h.toEquiv x)=increments F.obj x} where + toFun h := ⟨h.hom.app 0,h.property 0,ladder_preserves_increments h⟩ + invFun h := ⟨extendLadder h.val, + extendLadder_positional_of_increments h.val h.property.1 h.property.2⟩ + left_inv h := by apply WideSubcategory.hom_ext; exact extendLadder_app_zero h.hom + right_inv h := by apply Subtype.ext; exact extendLadder_zero h.val + +end PolygonObject +end PolygonIncrementFibers + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Configurations/PolygonStringGroupoid.lean b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/PolygonStringGroupoid.lean new file mode 100644 index 0000000000000000000000000000000000000000..c3a4543debcf80e33b23cd760f4b572c17ecdb19 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/PolygonStringGroupoid.lean @@ -0,0 +1,186 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.PolygonPositionalMonoidal + +namespace OAI + +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +section PolygonStringGroupoid + +open Classical CategoryTheory +open scoped MonoidalCategory +namespace PolygonObject +variable {a : ℕ} + +abbrev RawString (a n : ℕ) := Fin (n+1) ⥤ PolygonObject a + +def ladderProperty (a n : ℕ) : MorphismProperty (RawString a n) := + (positionalProperty a).functorCategory (Fin (n+1)) + +instance ladderProperty_multiplicative (n : ℕ) : (ladderProperty a n).IsMultiplicative where + id_mem F i := identity_positional (F.obj i) + comp_mem _ _ hf hg i := positional_comp (hf i) (hg i) + +instance ladderProperty_monoidal (n : ℕ) : (ladderProperty a n).IsMonoidalStable where + whiskerLeft F _ _ _ hg i := sumArrow_positional (identity_positional (F.obj i)) (hg i) + whiskerRight _ hf G i := sumArrow_positional (hf i) (identity_positional (G.obj i)) + associator_hom_mem F G H i := sumAssoc_positional (F.obj i) (G.obj i) (H.obj i) + associator_inv_mem F G H i := positional_inv (sumAssoc_positional (F.obj i) (G.obj i) (H.obj i)) + leftUnitor_hom_mem F i := leftUnit_positional (F.obj i) + leftUnitor_inv_mem F i := positional_inv (leftUnit_positional (F.obj i)) + rightUnitor_hom_mem F i := rightUnit_positional (F.obj i) + rightUnitor_inv_mem F i := positional_inv (rightUnit_positional (F.obj i)) + +instance ladderProperty_braided (n : ℕ) : (ladderProperty a n).IsStableUnderBraiding where + braiding_hom_mem F G i := sumSwap_positional (F.obj i) (G.obj i) + braiding_inv_mem F G i := positional_inv (sumSwap_positional (F.obj i) (G.obj i)) + +abbrev StringGroupoid (a n : ℕ) := WideSubcategory (ladderProperty a n) + +noncomputable instance stringGroupoid_isIso {n : ℕ} (F G : StringGroupoid a n) (f : F ⟶ G) : IsIso f := by + let : IsIso f.hom := NatIso.isIso_of_isIso_app f.hom + refine ⟨⟨⟨CategoryTheory.inv f.hom,?_⟩,?_,?_⟩⟩ + · intro i + rw [NatIso.isIso_inv_app] + exact positional_inv (f.property i) + · apply WideSubcategory.hom_ext + exact IsIso.hom_inv_id f.hom + · apply WideSubcategory.hom_ext + exact IsIso.inv_hom_id f.hom + +noncomputable instance stringGroupoid (n : ℕ) : Groupoid (StringGroupoid a n) := + Groupoid.ofIsIso (fun _ => inferInstance) + +noncomputable def stringReindex {n m : ℕ} (u : Fin (n+1) ⥤ Fin (m+1)) : + StringGroupoid a m ⥤ StringGroupoid a n where + obj F := ⟨u ⋙ F.obj⟩ + map f := ⟨CategoryTheory.Functor.whiskerLeft u f.hom,fun i => f.property (u.obj i)⟩ + map_id F := by apply WideSubcategory.hom_ext; rfl + map_comp f g := by apply WideSubcategory.hom_ext; rfl + +@[simp] theorem stringReindex_id (n : ℕ) : stringReindex (a:=a) (𝟭 (Fin (n+1)))=𝟭 _ := by + apply CategoryTheory.Functor.ext + · intro F G f; rfl + · intro F; cases F; rfl + +@[simp] theorem stringReindex_comp {n m k : ℕ} + (u : Fin (n+1) ⥤ Fin (m+1)) (v : Fin (m+1) ⥤ Fin (k+1)) : + stringReindex (a:=a) (u⋙v)=stringReindex v ⋙ stringReindex u := by + apply CategoryTheory.Functor.ext + · intro F G f; rfl + · intro F; rfl + +noncomputable instance stringReindex_monoidal {n m : ℕ} (u : Fin (n+1) ⥤ Fin (m+1)) : + (stringReindex (a:=a) u).Monoidal := + Functor.CoreMonoidal.toMonoidal { + εIso := Iso.refl _ + μIso := fun _ _ => Iso.refl _ + μIso_hom_natural_left := by intros; simp; apply WideSubcategory.hom_ext; rfl + μIso_hom_natural_right := by intros; simp; apply WideSubcategory.hom_ext; rfl + associativity := by + intro first second third + apply WideSubcategory.hom_ext + apply NatTrans.ext + funext point + change (𝟙 _ ▷ _ ≫ 𝟙 _ ≫ (α_ _ _ _).hom) = + ((α_ _ _ _).hom ≫ _ ◁ 𝟙 _ ≫ 𝟙 _) + simp + left_unitality := by + intro object + apply WideSubcategory.hom_ext + apply NatTrans.ext + funext point + change (λ_ _).hom = 𝟙 _ ▷ _ ≫ 𝟙 _ ≫ (λ_ _).hom + simp + right_unitality := by + intro object + apply WideSubcategory.hom_ext + apply NatTrans.ext + funext point + change (ρ_ _).hom = _ ◁ 𝟙 _ ≫ 𝟙 _ ≫ (ρ_ _).hom + simp } + +end PolygonObject +end PolygonStringGroupoid + +open Classical CategoryTheory +namespace PolygonObject +variable {a n : ℕ} + +def baseArrow (F : RawString a n) (i : Fin (n+1)) : F.obj 0 ⟶ F.obj i := + F.map (homOfLE (Fin.zero_le i)) + +@[simp] theorem baseArrow_zero (F : RawString a n) : baseArrow F 0=𝟙 _ := by + unfold baseArrow + exact (congrArg F.map (show homOfLE (Fin.zero_le (0 : Fin (n+1)))=𝟙 (0 : Fin (n+1)) + from Subsingleton.elim _ _)).trans (F.map_id _) + +@[simp, reassoc] theorem baseArrow_comp (F : RawString a n) {i j : Fin (n+1)} + (f : i ⟶ j) : baseArrow F i ≫ F.map f=baseArrow F j := by + rw [baseArrow,←F.map_comp] + congr 1 + +noncomputable def extendLadder {F G : RawString a n} (h : F.obj 0 ⟶ G.obj 0) : F ⟶ G where + app i := CategoryTheory.inv (baseArrow F i) ≫ h ≫ baseArrow G i + naturality i j f := by + have he : F.map f ≫ CategoryTheory.inv (baseArrow F j)=CategoryTheory.inv (baseArrow F i) := by + apply (cancel_epi (baseArrow F i)).mp + rw [←Category.assoc,baseArrow_comp] + simp + simp only [←Category.assoc,he] + simp only [Category.assoc,baseArrow_comp] + +@[simp] theorem extendLadder_zero {F G : RawString a n} (h : F.obj 0 ⟶ G.obj 0) : + (extendLadder h).app 0=h := by + simp [extendLadder] + +theorem ladder_ext {F G : RawString a n} {h k : F ⟶ G} + (h0 : h.app 0=k.app 0) : h=k := by + apply NatTrans.ext + funext i + apply (cancel_epi (baseArrow F i)).mp + rw [show baseArrow F i=F.map (homOfLE (Fin.zero_le i)) from rfl, + h.naturality,k.naturality,h0] + +@[simp] theorem extendLadder_app_zero {F G : RawString a n} (h : F ⟶ G) : + extendLadder (h.app 0)=h := ladder_ext (extendLadder_zero _) + +def trajectory (F : RawString a n) (x : (F.obj 0).Point) (i : Fin (n+1)) := + ((baseArrow F i).toEquiv x).val.2 + +theorem ladder_preserves_trajectory {F G : StringGroupoid a n} (h : F ⟶ G) + (x : (F.obj.obj 0).Point) : + trajectory G.obj ((h.hom.app 0).toEquiv x)=trajectory F.obj x := by + funext i + have he := congrArg (fun k : F.obj.obj 0 ⟶ G.obj.obj i => k.toEquiv x) + (h.hom.naturality (homOfLE (Fin.zero_le i))) + change (h.hom.app i).toEquiv ((baseArrow F.obj i).toEquiv x) = + (baseArrow G.obj i).toEquiv ((h.hom.app 0).toEquiv x) at he + unfold trajectory + rw [←he] + exact h.property i _ + +theorem extendLadder_positional {F G : RawString a n} (h : F.obj 0 ⟶ G.obj 0) + (he : ∀x,trajectory G (h.toEquiv x)=trajectory F x) : + (ladderProperty a n) (extendLadder h) := by + intro i y + let x := (baseArrow F i).toEquiv.symm y + have hi := congrFun (he x) i + change ((baseArrow G i).toEquiv (h.toEquiv x)).val.2= + ((baseArrow F i).toEquiv x).val.2 at hi + simpa only [extendLadder,arrow_comp_apply,inv_arrow_apply,x,Equiv.apply_symm_apply] using hi + +noncomputable def ladderEquiv (F G : StringGroupoid a n) : + (F ⟶ G) ≃ {h : F.obj.obj 0 ⟶ G.obj.obj 0 // + ∀x,trajectory G.obj (h.toEquiv x)=trajectory F.obj x} where + toFun h := ⟨h.hom.app 0,ladder_preserves_trajectory h⟩ + invFun h := ⟨extendLadder h.val,extendLadder_positional h.val h.property⟩ + left_inv h := by apply WideSubcategory.hom_ext; exact extendLadder_app_zero h.hom + right_inv h := by apply Subtype.ext; exact extendLadder_zero h.val + +end PolygonObject + +end SimpleAmenable + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Configurations/PolygonStringNormalization.lean b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/PolygonStringNormalization.lean new file mode 100644 index 0000000000000000000000000000000000000000..dfa3c8fa45836601be2d6311c5f0bd4eb0542c55 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/PolygonStringNormalization.lean @@ -0,0 +1,204 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Configurations.PolygonTrajectoryStrata +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.PolygonObjectRefinement + +namespace OAI + +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +section PolygonStringNormalization + +open Classical CategoryTheory Set +namespace PolygonObject +variable {a n : ℕ} + +abbrev TrajectoryLabel (F : RawString a n) := Set.range (trajectoryShift F) +noncomputable instance trajectoryLabel_fintype (F : RawString a n) : Fintype (TrajectoryLabel F) := + (trajectoryShift_finite_range F).fintype + +noncomputable def trajectoryLabel (F : RawString a n) (x : (F.obj 0).Point) : TrajectoryLabel F := + ⟨trajectoryShift F x,⟨x,rfl⟩⟩ + +theorem trajectoryLabel_fiber_polygon (F : RawString a n) (j : Fin (F.obj 0).tracks) + (u : TrajectoryLabel F) : + {z | ∃hz : z∈((F.obj 0).cell j).val,trajectoryLabel F ⟨(j,z),hz⟩=u}∈polygonAlgebra a := by + simpa only [Subtype.ext_iff,trajectoryLabel] using trajectoryShift_fiber_polygon F j u.val + +noncomputable def strandObject (F : RawString a n) : PolygonObject a := + refinement (F.obj 0) (trajectoryLabel F) (trajectoryLabel_fiber_polygon F) + +noncomputable def strandDrop (F : RawString a n) : strandObject F ⟶ F.obj 0 := + refinementArrow (F.obj 0) (trajectoryLabel F) (trajectoryLabel_fiber_polygon F) + +noncomputable def strandOffsets (F : RawString a n) (i : Fin (n+1)) + (j : Fin (strandObject F).tracks) : CutRing × CutRing := + ((Fintype.equivFin (Fin (F.obj 0).tracks × TrajectoryLabel F)).symm j).2.val i + +theorem strandOffsets_spec (F : RawString a n) (i : Fin (n+1)) (x : (strandObject F).Point) : + pointShift (baseArrow F i) ((strandDrop F).toEquiv x)=strandOffsets F i x.val.1 := + congrArg (fun (k : TrajectoryLabel F) => k.val i) + (refinementArrow_label (F.obj 0) (trajectoryLabel F) (trajectoryLabel_fiber_polygon F) x) + +noncomputable def translationString (U : PolygonObject a) + (d : Fin (n+1) → Fin U.tracks → CutRing × CutRing) : RawString a n where + obj i := shifted U (d i) + map {i j} _ := CategoryTheory.inv (shiftArrow U (d i)) ≫ shiftArrow U (d j) + map_id i := by simp + map_comp f g := by simp [Category.assoc] + +noncomputable def normalizedString (F : RawString a n) : RawString a n := + translationString (strandObject F) (strandOffsets F) +noncomputable def normalizationLadder (F : RawString a n) : normalizedString F ⟶ F where + app i := by + change shifted (strandObject F) (strandOffsets F i) ⟶ F.obj i + exact CategoryTheory.inv (shiftArrow (strandObject F) (strandOffsets F i)) ≫ + strandDrop F ≫ baseArrow F i + naturality i j f := by + change (CategoryTheory.inv (shiftArrow (strandObject F) (strandOffsets F i)) ≫ + shiftArrow (strandObject F) (strandOffsets F j)) ≫ + (CategoryTheory.inv (shiftArrow (strandObject F) (strandOffsets F j)) ≫ + strandDrop F ≫ baseArrow F j) = + (CategoryTheory.inv (shiftArrow (strandObject F) (strandOffsets F i)) ≫ + strandDrop F ≫ baseArrow F i) ≫ F.map f + simp [Category.assoc] + +theorem normalizationLadder_positional (F : RawString a n) : + (ladderProperty a n) (normalizationLadder F) := by + intro i y + obtain ⟨x,rfl⟩ := (shiftArrow (strandObject F) (strandOffsets F i)).toEquiv.surjective y + change ((CategoryTheory.inv (shiftArrow (strandObject F) (strandOffsets F i)) ≫ + strandDrop F ≫ baseArrow F i).toEquiv + ((shiftArrow (strandObject F) (strandOffsets F i)).toEquiv x)).val.2 = _ + simp only [arrow_comp_apply,inv_arrow_apply,Equiv.symm_apply_apply] + rw [pointShift_spec,strandOffsets_spec] + rfl + +noncomputable def normalizationIso (F : RawString a n) : + (⟨normalizedString F⟩ : StringGroupoid a n) ≅ ⟨F⟩ := + asIso ⟨normalizationLadder F,normalizationLadder_positional F⟩ + +theorem exists_finite_strand_normalization (F : RawString a n) : + ∃ (U : PolygonObject a) (d : Fin (n+1) → Fin U.tracks → CutRing × CutRing), + Nonempty ((⟨translationString U d⟩ : StringGroupoid a n) ≅ ⟨F⟩) := + ⟨strandObject F,strandOffsets F,⟨normalizationIso F⟩⟩ + +end PolygonObject +end PolygonStringNormalization + +open Classical CategoryTheory Set +namespace PolygonObject +variable {a n m : ℕ} + +@[simp] theorem trajectoryShift_zero (F : RawString a n) (x : (F.obj 0).Point) : + trajectoryShift F x 0=0 := by + change pointShift (baseArrow F 0) x=0 + rw [baseArrow_zero,pointShift_id] + +theorem trajectoryShift_reindex (F : RawString a m) + (u : Fin (n+1) ⥤ Fin (m+1)) (x : (F.obj 0).Point) (i : Fin (n+1)) : + trajectoryShift (u⋙F) ((baseArrow F (u.obj 0)).toEquiv x) i = + trajectoryShift F x (u.obj i)-trajectoryShift F x (u.obj 0) := by + have he := pointShift_comp (baseArrow F (u.obj 0)) + (F.map (u.map (homOfLE (Fin.zero_le i)))) x + rw [baseArrow_comp] at he + exact eq_sub_iff_add_eq.mpr he.symm + +noncomputable def increments (F : RawString a n) (x : (F.obj 0).Point) : + Fin n → CutRing × CutRing := fun i => + trajectoryShift F x i.succ - trajectoryShift F x i.castSucc + +theorem trajectory_successor (F : RawString a n) (x : (F.obj 0).Point) (i : Fin n) : + trajectory F x i.succ=translate a (increments F x i) (trajectory F x i.castSucc) := by + change ((baseArrow F i.succ).toEquiv x).val.2=_ + rw [pointShift_spec] + change translate a (trajectoryShift F x i.succ) x.val.2 = + translate a (trajectoryShift F x i.succ-trajectoryShift F x i.castSucc) + ((baseArrow F i.castSucc).toEquiv x).val.2 + rw [pointShift_spec,←translate_add] + simp only [trajectoryShift,sub_add_cancel] + +theorem increments_reindex (F : RawString a m) + (u : Fin (n+1) ⥤ Fin (m+1)) (x : (F.obj 0).Point) (i : Fin n) : + increments (u⋙F) ((baseArrow F (u.obj 0)).toEquiv x) i = + trajectoryShift F x (u.obj i.succ)-trajectoryShift F x (u.obj i.castSucc) := by + unfold increments + rw [trajectoryShift_reindex,trajectoryShift_reindex] + abel + +theorem increments_reindex_unchanged (F : RawString a m) + (u : Fin (n+1) ⥤ Fin (m+1)) (x : (F.obj 0).Point) (i : Fin n) (j : Fin m) + (hleft : u.obj i.castSucc=j.castSucc) (hright : u.obj i.succ=j.succ) : + increments (u⋙F) ((baseArrow F (u.obj 0)).toEquiv x) i=increments F x j := by + rw [increments_reindex,hleft,hright] + rfl + +theorem increments_reindex_compose (F : RawString a m) + (u : Fin (n+1) ⥤ Fin (m+1)) (x : (F.obj 0).Point) (i : Fin n) (j k : Fin m) + (hleft : u.obj i.castSucc=j.castSucc) (hmid : j.succ=k.castSucc) + (hright : u.obj i.succ=k.succ) : + increments (u⋙F) ((baseArrow F (u.obj 0)).toEquiv x) i= + increments F x j+increments F x k := by + rw [increments_reindex,hleft,hright] + unfold increments + rw [hmid] + abel + +theorem increments_reindex_duplicate (F : RawString a m) + (u : Fin (n+1) ⥤ Fin (m+1)) (x : (F.obj 0).Point) (i : Fin n) + (hi : u.obj i.succ=u.obj i.castSucc) : + increments (u⋙F) ((baseArrow F (u.obj 0)).toEquiv x) i=0 := by + rw [increments_reindex,hi,sub_self] + +theorem reindex_initial_position (F : RawString a m) + (u : Fin (n+1) ⥤ Fin (m+1)) (x : (F.obj 0).Point) : + ((baseArrow F (u.obj 0)).toEquiv x).val.2= + translate a (trajectoryShift F x (u.obj 0)) x.val.2 := pointShift_spec _ _ + +theorem increments_finite_range (F : RawString a n) : (Set.range (increments F)).Finite := by + exact (trajectoryShift_finite_range F).image (fun t i => t i.succ-t i.castSucc) |>.subset + (by rintro _ ⟨x,rfl⟩; exact ⟨trajectoryShift F x,⟨x,rfl⟩,rfl⟩) + +theorem increments_fiber_polygon (F : RawString a n) (j : Fin (F.obj 0).tracks) + (u : Fin n → CutRing × CutRing) : + {z | ∃hz : z∈((F.obj 0).cell j).val,increments F ⟨(j,z),hz⟩=u}∈polygonAlgebra a := by + let s := (trajectoryShift_finite_range F).toFinset + have he : {z | ∃hz : z∈((F.obj 0).cell j).val,increments F ⟨(j,z),hz⟩=u} = + ⋃t∈s.filter (fun t => (fun i : Fin n => t i.succ-t i.castSucc)=u), + {z | ∃hz : z∈((F.obj 0).cell j).val,trajectoryShift F ⟨(j,z),hz⟩=t} := by + ext z + constructor + · rintro ⟨hz,hu⟩ + refine Set.mem_iUnion₂.mpr ⟨trajectoryShift F ⟨(j,z),hz⟩, + Finset.mem_filter.mpr ⟨?_,hu⟩,hz,rfl⟩ + exact (Set.Finite.mem_toFinset _).mpr ⟨_,rfl⟩ + · intro hz + obtain ⟨t,ht,hzt⟩ := Set.mem_iUnion₂.mp hz + obtain ⟨hz',heq⟩ := hzt + refine ⟨hz',?_⟩ + change (fun i : Fin n => trajectoryShift F ⟨(j,z),hz'⟩ i.succ- + trajectoryShift F ⟨(j,z),hz'⟩ i.castSucc)=u + rw [heq] + exact (Finset.mem_filter.mp ht).2 + rw [he] + apply BooleanSubalgebra.biSup_mem (Finset.finite_toSet _) + intro t _ + exact trajectoryShift_fiber_polygon F j t + +theorem ladder_preserves_increments {F G : StringGroupoid a n} (h : F ⟶ G) + (x : (F.obj.obj 0).Point) : + increments G.obj ((h.hom.app 0).toEquiv x)=increments F.obj x := by + unfold increments + rw [ladder_preserves_trajectoryShift] + +def deleteVertex (j : Fin (n+2)) : Fin (n+1) ⥤ Fin (n+2) := + (Fin.succAboveOrderEmb j).monotone.functor + +noncomputable def stringFace (j : Fin (n+2)) : StringGroupoid a (n+1) ⥤ StringGroupoid a n := + stringReindex (deleteVertex j) + +end PolygonObject + +end SimpleAmenable + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Configurations/PolygonTrackArea.lean b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/PolygonTrackArea.lean new file mode 100644 index 0000000000000000000000000000000000000000..27dfda42746c1470917f6e6d913cc3dbe350f2e7 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/PolygonTrackArea.lean @@ -0,0 +1,110 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.PolygonArea +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.PolygonGridComparison + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section PolygonTrackArea +open Classical Set MeasureTheory +namespace PolygonGrid + +noncomputable def trackUnion {m : ℕ} (S : Fin m → Set (ℝ×ℝ)) : Set PlaneTracks := + ⋃i, {i.val} ×ˢ S i + +@[simp] theorem mem_trackUnion {m : ℕ} (S : Fin m → Set (ℝ×ℝ)) (i : Fin m) (x : ℝ×ℝ) : + (i.val,x)∈trackUnion S ↔ x∈S i := by + constructor + · intro h + obtain ⟨j,hj,hx⟩ := Set.mem_iUnion.mp h + have he : i=j := Fin.ext hj + simpa only [←he] using hx + · intro hx + exact Set.mem_iUnion.mpr ⟨i,rfl,hx⟩ + +theorem trackUnion_mono {m : ℕ} {S T : Fin m → Set (ℝ×ℝ)} (h : ∀i,S i⊆T i) : + trackUnion S⊆trackUnion T := by + intro p hp + obtain ⟨i,hi,hp⟩ := Set.mem_iUnion.mp hp + exact Set.mem_iUnion.mpr ⟨i,hi,h i hp⟩ + +theorem trackUnion_region {m : ℕ} {S : Fin m → Set (ℝ×ℝ)} + (h : ∀i,S i⊆PolygonArea.square) : trackUnion S⊆region m := by + intro p hp + obtain ⟨i,hi,hp⟩ := Set.mem_iUnion.mp hp + exact ⟨hi ▸ i.isLt,h i hp⟩ + +@[simp] theorem volume_trackUnion {m : ℕ} (S : Fin m → Set (ℝ×ℝ)) + (hS : ∀i,MeasurableSet (S i)) : μ (trackUnion S)=∑i,volume (S i) := by + have hdis : Pairwise (fun i j : Fin m => Disjoint ({i.val}×ˢ S i) ({j.val}×ˢ S j)) := by + intro i j hij + apply Set.disjoint_left.mpr + rintro p ⟨hi,-⟩ ⟨hj,-⟩ + exact hij (Fin.ext (hi.symm.trans hj)) + rw [trackUnion,measure_iUnion hdis (fun i => (measurableSet_singleton _).prod (hS i))] + simp only [μ,Measure.prod_prod,Measure.count_singleton,one_mul,tsum_fintype] + rfl + +theorem bank_representative {a m : ℕ} (U : Fin m → polygonAlgebra a) : + ∃ S : Set PlaneTracks, S⊆region m ∧ + (∀i : Fin m,∀x : GenericSquare a,(i.val,x.val)∈S ↔ x∈(U i).val) ∧ + μ (closure S)=∑i,PolygonArea.area (U i) ∧ + μ (interior S)=∑i,PolygonArea.area (U i) := by + choose R hR hm hn he using fun i => PolygonArea.representative (U i).property + have hmR : ∀i,MeasurableSet (R i) := hm + have harea (i : Fin m) : volume (R i)=PolygonArea.area (U i) := + (PolygonArea.area_eq_rep (U i) (hR i) (he i)).symm + have hvol : μ (trackUnion R)=∑i,PolygonArea.area (U i) := by + rw [volume_trackUnion R hmR] + exact Finset.sum_congr rfl (fun i _ => harea i) + have hclosure : closure (trackUnion R)⊆trackUnion (fun i => closure (R i)) := by + apply (isClosed_iUnion_of_finite (fun i => isClosed_singleton.prod isClosed_closure)).closure_subset_iff.mpr + exact trackUnion_mono (fun _ => subset_closure) + have hinterior : trackUnion (fun i => interior (R i))⊆interior (trackUnion R) := by + apply interior_maximal (trackUnion_mono (fun _ => interior_subset)) + exact isOpen_iUnion (fun i => (isOpen_discrete _).prod isOpen_interior) + have hvclosure : μ (trackUnion (fun i => closure (R i)))=∑i,PolygonArea.area (U i) := by + rw [volume_trackUnion _ (fun _ => isClosed_closure.measurableSet)] + apply Finset.sum_congr rfl + intro i _ + rw [measure_congr (PolygonArea.closure_ae_eq (hn i)),harea] + have hvinterior : μ (trackUnion (fun i => interior (R i)))=∑i,PolygonArea.area (U i) := by + rw [volume_trackUnion _ (fun _ => isOpen_interior.measurableSet)] + apply Finset.sum_congr rfl + intro i _ + rw [measure_congr (PolygonArea.interior_ae_eq (hn i)),harea] + refine ⟨trackUnion R,trackUnion_region hR,?_,?_,?_⟩ + · intro i x + exact (mem_trackUnion R i x.val).trans (he i x).symm + · exact le_antisymm ((measure_mono hclosure).trans_eq hvclosure) + (hvol.symm.trans_le (measure_mono subset_closure)) + · exact le_antisymm ((measure_mono interior_subset).trans_eq hvol) + (hvinterior.symm.trans_le (measure_mono hinterior)) + +theorem polygon_grid_comparison {a m : ℕ} (U V : Fin m → polygonAlgebra a) + (h : (∑i,PolygonArea.area (U i)) < ∑i,PolygonArea.area (V i)) : + ∃ (S T : Set PlaneTracks) (δ : ℝ), 0 < δ ∧ + (∀i : Fin m,∀x : GenericSquare a,(i.val,x.val)∈S ↔ x∈(U i).val) ∧ + (∀i : Fin m,∀x : GenericSquare a,(i.val,x.val)∈T ↔ x∈(V i).val) ∧ + ∀ε : ℝ, 0 < ε → ε < δ → + ∃ (N : ℕ) (I J : Finset (Index m N)), Nonempty (I ↪ J) ∧ + S⊆⋃i∈I,cell ε i ∧ ∀j∈J,cell ε j⊆T := by + obtain ⟨S,hS,heS,hcS,hiS⟩ := bank_representative U + obtain ⟨T,hT,heT,hcT,hiT⟩ := bank_representative V + have hh : μ (closure S)<μ (interior T) := by rwa [hcS,hiT] + obtain ⟨δ,hδ,hmatch⟩ := strict_grid_comparison hS hT hh + exact ⟨S,T,δ,hδ,heS,heT,hmatch⟩ + +end PolygonGrid +end PolygonTrackArea + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Configurations/PolygonTrackStabilizer.lean b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/PolygonTrackStabilizer.lean new file mode 100644 index 0000000000000000000000000000000000000000..775f06e8572e2f8f9db62958cc534cb62c5464d5 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/PolygonTrackStabilizer.lean @@ -0,0 +1,227 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Configurations.TrackPoint + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section PolygonTrackStabilizer +open Classical Set + +namespace PolygonTracks +variable {a k n : ℕ} +noncomputable def join (a k n : ℕ) : + TrackPoint a k ⊕ TrackPoint a n ≃ TrackPoint a (k+n) := + (Equiv.sumProdDistrib (Fin k) (Fin n) (GenericSquare a)).symm.trans + (Equiv.prodCongr finSumFinEquiv (Equiv.refl _)) + +@[simp] theorem join_inl (x : TrackPoint a k) : join a k n (.inl x)=(x.1.castAdd n,x.2) := rfl +@[simp] theorem join_inr (x : TrackPoint a n) : join a k n (.inr x)=(x.1.natAdd k,x.2) := rfl +@[simp] theorem join_symm_left (x : TrackPoint a k) : + (join a k n).symm (x.1.castAdd n,x.2)=.inl x := (join a k n).symm_apply_apply (.inl x) +@[simp] theorem join_symm_right (x : TrackPoint a n) : + (join a k n).symm (x.1.natAdd k,x.2)=.inr x := (join a k n).symm_apply_apply (.inr x) + +noncomputable def blockPerm (k : ℕ) (f : Equiv.Perm (TrackPoint a n)) : + Equiv.Perm (TrackPoint a (k+n)) := + (join a k n).symm.trans (((Equiv.refl _).sumCongr f).trans (join a k n)) + +@[simp] theorem blockPerm_left (f : Equiv.Perm (TrackPoint a n)) (x : TrackPoint a k) : + blockPerm k f (x.1.castAdd n,x.2)=(x.1.castAdd n,x.2) := by + simp [blockPerm] + +@[simp] theorem blockPerm_right (f : Equiv.Perm (TrackPoint a n)) (x : TrackPoint a n) : + blockPerm k f (x.1.natAdd k,x.2)=((f x).1.natAdd k,(f x).2) := by + simp [blockPerm] + +theorem blockPerm_hasTable (f : polygonFullGroup a n) : HasTranslationTable (blockPerm k f.val) := by + obtain ⟨s,hs,hcover⟩ := f.property + let leftChart : Fin k → TableChart a (k+n) := fun i => ⟨i.castAdd n,i.castAdd n,0,⊤⟩ + let rightChart : TableChart a n → TableChart a (k+n) := fun c => + ⟨c.source.natAdd k,c.target.natAdd k,c.shift,c.domain⟩ + refine ⟨Finset.univ.image leftChart ∪ s.image rightChart,?_,?_⟩ + · intro c hc + rcases Finset.mem_union.mp hc with hc|hc + · obtain ⟨i,-,rfl⟩ := Finset.mem_image.mp hc + intro x hx + change blockPerm k f.val (i.castAdd n,x)=(i.castAdd n,translate a 0 x) + rw [blockPerm_left (x:=(i,x)),translate_zero] + · obtain ⟨d,hd,rfl⟩ := Finset.mem_image.mp hc + intro x hx + change blockPerm k f.val (d.source.natAdd k,x)=(d.target.natAdd k,translate a d.shift x) + rw [blockPerm_right (x:=(d.source,x)),hs d hd x hx] + · rintro ⟨i,x⟩ + induction i using Fin.addCases with + | left i => + exact ⟨leftChart i,Finset.mem_union_left _ (Finset.mem_image.mpr ⟨i,Finset.mem_univ _,rfl⟩),rfl,by trivial⟩ + | right i => + obtain ⟨c,hc,hx⟩ := hcover (i,x) + refine ⟨rightChart c,Finset.mem_union_right _ (Finset.mem_image.mpr ⟨c,hc,rfl⟩),?_,hx.2⟩ + exact congrArg (Fin.natAdd k) hx.1 + +noncomputable def stabilize (a k n : ℕ) : polygonFullGroup a n →* polygonFullGroup a (k+n) where + toFun f := ⟨blockPerm k f.val,blockPerm_hasTable f⟩ + map_one' := by + apply Subtype.ext; apply Equiv.ext + intro x + obtain ⟨y,rfl⟩ := (join a k n).surjective x + cases y <;> simp [blockPerm] + map_mul' f g := by + apply Subtype.ext; apply Equiv.ext + intro x + obtain ⟨y,rfl⟩ := (join a k n).surjective x + cases y <;> simp [blockPerm,Equiv.Perm.mul_apply] + +@[simp] theorem stabilize_left (f : polygonFullGroup a n) (x : TrackPoint a k) : + (stabilize a k n f).val (x.1.castAdd n,x.2)=(x.1.castAdd n,x.2) := blockPerm_left f.val x +@[simp] theorem stabilize_right (f : polygonFullGroup a n) (x : TrackPoint a n) : + (stabilize a k n f).val (x.1.natAdd k,x.2)=((f.val x).1.natAdd k,(f.val x).2) := blockPerm_right f.val x + +theorem stabilize_injective : Function.Injective (stabilize a k n) := by + intro f g he + apply Subtype.ext; apply Equiv.ext + intro x + have h := congrArg (fun p : polygonFullGroup a (k+n) => p.val (x.1.natAdd k,x.2)) he + simp only [stabilize_right] at h + apply Prod.ext + · apply Fin.ext + exact Nat.add_left_cancel (congrArg (fun p : TrackPoint a (k+n) => p.1.val) h) + · exact congrArg (fun p : TrackPoint a (k+n) => p.2) h + +def bankFixer (a k n : ℕ) : Subgroup (polygonFullGroup a (k+n)) where + carrier := {g | ∀x : TrackPoint a k,g.val (x.1.castAdd n,x.2)=(x.1.castAdd n,x.2)} + one_mem' := fun _ => rfl + mul_mem' := by + intro f g hf hg x + change f.val (g.val (x.1.castAdd n,x.2))=_ + rw [hg x,hf x] + inv_mem' := by + intro g hg x + exact g.val.symm_apply_eq.mpr (hg x).symm + +@[simp] theorem mem_bankFixer (g : polygonFullGroup a (k+n)) : + g∈bankFixer a k n ↔ ∀x : TrackPoint a k,g.val (x.1.castAdd n,x.2)=(x.1.castAdd n,x.2) := Iff.rfl + +theorem stabilize_mem_bankFixer (g : polygonFullGroup a n) : + stabilize a k n g∈bankFixer a k n := stabilize_left g + +end PolygonTracks +end PolygonTrackStabilizer + +section PolygonTrackRestriction +open Classical Set +namespace PolygonTracks +variable {a k n : ℕ} + +def rightIncl (a k n : ℕ) (x : TrackPoint a n) : TrackPoint a (k+n) := + (x.1.natAdd k,x.2) + +theorem rightIncl_injective : Function.Injective (rightIncl a k n) := by + intro x y he + apply Prod.ext + · apply Fin.ext + exact Nat.add_left_cancel (congrArg (fun p : TrackPoint a (k+n) => p.1.val) he) + · exact congrArg (fun p : TrackPoint a (k+n) => p.2) he + +theorem bankFixer_preserves_right (g : bankFixer a k n) (x : TrackPoint a n) : + ∃y : TrackPoint a n,g.val.val (rightIncl a k n x)=rightIncl a k n y := by + obtain ⟨z,hz⟩ := (join a k n).surjective (g.val.val (rightIncl a k n x)) + cases z with + | inl z => + have he : rightIncl a k n x=(z.1.castAdd n,z.2) := + g.val.val.injective (hz.symm.trans (g.property z).symm) + have hf := congrArg (fun p : TrackPoint a (k+n) => p.1.val) he + have := z.1.isLt + change k+x.1.val=z.1.val at hf + omega + | inr y => exact ⟨y,hz.symm⟩ + +noncomputable def rightValue (g : bankFixer a k n) (x : TrackPoint a n) : TrackPoint a n := + (bankFixer_preserves_right g x).choose + +@[simp] theorem rightValue_spec (g : bankFixer a k n) (x : TrackPoint a n) : + rightIncl a k n (rightValue g x)=g.val.val (rightIncl a k n x) := + (bankFixer_preserves_right g x).choose_spec.symm + +noncomputable def restrictPerm (g : bankFixer a k n) : Equiv.Perm (TrackPoint a n) where + toFun := rightValue g + invFun := rightValue g⁻¹ + left_inv x := by + apply rightIncl_injective (a:=a) (k:=k) + rw [rightValue_spec,rightValue_spec] + exact g.val.val.symm_apply_apply _ + right_inv x := by + apply rightIncl_injective (a:=a) (k:=k) + rw [rightValue_spec,rightValue_spec] + exact g.val.val.apply_symm_apply _ + +@[simp] theorem restrictPerm_spec (g : bankFixer a k n) (x : TrackPoint a n) : + rightIncl a k n (restrictPerm g x)=g.val.val (rightIncl a k n x) := rightValue_spec g x + +theorem restrictPerm_hasTable (g : bankFixer a k n) : HasTranslationTable (restrictPerm g) := by + obtain ⟨s,hs,hcover⟩ := g.val.property + let admissible : Fin n × Fin n × TableChart a (k+n) → Prop := fun t => + t.2.2.source=t.1.natAdd k ∧ t.2.2.target=t.2.1.natAdd k + let conv : Fin n × Fin n × TableChart a (k+n) → TableChart a n := fun t => + ⟨t.1,t.2.1,t.2.2.shift,t.2.2.domain⟩ + let ts := ((Finset.univ : Finset (Fin n)).product ((Finset.univ : Finset (Fin n)).product s)).filter admissible + refine ⟨ts.image conv,?_,?_⟩ + · intro c hc + obtain ⟨⟨i,j,d⟩,hd,rfl⟩ := Finset.mem_image.mp hc + obtain ⟨hmem,hsource,htarget⟩ := Finset.mem_filter.mp hd + have hdmem : d∈s := (Finset.mem_product.mp (Finset.mem_product.mp hmem).2).2 + intro x hx + apply rightIncl_injective (a:=a) (k:=k) + rw [restrictPerm_spec] + change g.val.val (i.natAdd k,x)=(j.natAdd k,translate a d.shift x) + change d.source=i.natAdd k at hsource + change d.target=j.natAdd k at htarget + rw [← hsource,← htarget] + exact hs d hdmem x hx + · intro x + obtain ⟨d,hd,hsource,hx⟩ := hcover (rightIncl a k n x) + have he := hs d hd x.2 hx + have htarget : d.target=(restrictPerm g x).1.natAdd k := by + have hp := congrArg Prod.fst (restrictPerm_spec g x) + change x.1.natAdd k=d.source at hsource + rw [← hsource] at he + exact (congrArg Prod.fst he).symm.trans hp.symm + refine ⟨conv (x.1,(restrictPerm g x).1,d),Finset.mem_image.mpr ⟨_,?_,rfl⟩,rfl,hx⟩ + exact Finset.mem_filter.mpr ⟨Finset.mem_product.mpr ⟨Finset.mem_univ _, + Finset.mem_product.mpr ⟨Finset.mem_univ _,hd⟩⟩,hsource.symm,htarget⟩ + +noncomputable def restrict (g : bankFixer a k n) : polygonFullGroup a n := + ⟨restrictPerm g,restrictPerm_hasTable g⟩ + +@[simp] theorem stabilize_restrict (g : bankFixer a k n) : stabilize a k n (restrict g)=g.val := by + apply Subtype.ext; apply Equiv.ext + intro x + obtain ⟨z,rfl⟩ := (join a k n).surjective x + cases z with + | inl y => exact (stabilize_left _ y).trans (g.property y).symm + | inr y => exact (stabilize_right _ y).trans (restrictPerm_spec g y) + +@[simp] theorem restrict_stabilize (g : polygonFullGroup a n) : + restrict ⟨stabilize a k n g,stabilize_mem_bankFixer g⟩=g := by + apply stabilize_injective (k:=k) + exact stabilize_restrict _ + +noncomputable def stabilizerEquiv (a k n : ℕ) : polygonFullGroup a n ≃* bankFixer a k n where + toFun g := ⟨stabilize a k n g,stabilize_mem_bankFixer g⟩ + invFun := restrict + left_inv := restrict_stabilize + right_inv g := Subtype.ext (stabilize_restrict g) + map_mul' g h := Subtype.ext ((stabilize a k n).map_mul g h) + +end PolygonTracks +end PolygonTrackRestriction + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Configurations/PolygonTrajectoryStrata.lean b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/PolygonTrajectoryStrata.lean new file mode 100644 index 0000000000000000000000000000000000000000..11594e56c327bb5f0d58d72baeeb32e360d8f2f9 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/PolygonTrajectoryStrata.lean @@ -0,0 +1,167 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.PeriodicSlotStars +import OAI.GroupTheory.SimpleAmenable.Configurations.PolygonStringGroupoid + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section PolygonTrajectoryStrata + +open Classical CategoryTheory Set +namespace PolygonObject +variable {a n : ℕ} + +theorem representative_add (u v : CutRing × CutRing) : + orbitRepresentative (u+v)=orbitRepresentative u+orbitRepresentative v := by + simp [orbitRepresentative,add_mul] + +@[simp] theorem representative_idem (u : CutRing × CutRing) : + orbitRepresentative (orbitRepresentative u)=orbitRepresentative u := by + simp [orbitRepresentative,cutTau] + +theorem arrow_displacement_exists {U V : PolygonObject a} (f : U ⟶ V) (x : U.Point) : + ∃u,(f.toEquiv x).val.2=translate a u x.val.2 := by + obtain ⟨s,hs,hcover⟩ := f.hasTable + obtain ⟨c,hc,ht,hx⟩ := hcover x + obtain ⟨hu,he⟩ := hs c hc x.val.2 hx + have hpoint : (⟨(c.source,x.val.2),hu⟩ : U.Point)=x := + Subtype.ext (Prod.ext ht.symm rfl) + rw [hpoint] at he + exact ⟨c.shift,congrArg Prod.snd he⟩ + +noncomputable def pointShift {U V : PolygonObject a} (f : U ⟶ V) (x : U.Point) : + CutRing × CutRing := orbitRepresentative (arrow_displacement_exists f x).choose + +theorem pointShift_spec {U V : PolygonObject a} (f : U ⟶ V) (x : U.Point) : + (f.toEquiv x).val.2=translate a (pointShift f x) x.val.2 := + (arrow_displacement_exists f x).choose_spec.trans (translate_orbitRepresentative _ _ _) + +theorem pointShift_unique {U V : PolygonObject a} (f : U ⟶ V) (x : U.Point) + (u : CutRing × CutRing) (he : (f.toEquiv x).val.2=translate a u x.val.2) : + pointShift f x=orbitRepresentative u := + orbitRepresentative_eq_of_translate_eq x.val.2 + ((arrow_displacement_exists f x).choose_spec.symm.trans he) + +@[simp] theorem pointShift_reduced {U V : PolygonObject a} (f : U ⟶ V) (x : U.Point) : + orbitRepresentative (pointShift f x)=pointShift f x := representative_idem _ + +@[simp] theorem pointShift_id (U : PolygonObject a) (x : U.Point) : pointShift (𝟙 U) x=0 := by + change pointShift (𝟙 U) x=(0,0) + simpa [orbitRepresentative] using pointShift_unique (𝟙 U) x 0 (by simp [arrow_id_apply]) + +theorem pointShift_comp {U V W : PolygonObject a} (f : U ⟶ V) (g : V ⟶ W) (x : U.Point) : + pointShift (f≫g) x=pointShift g (f.toEquiv x)+pointShift f x := by + have he := pointShift_unique (f≫g) x (pointShift g (f.toEquiv x)+pointShift f x) (by + rw [arrow_comp_apply,pointShift_spec g,pointShift_spec f,translate_add]) + simpa only [representative_add,pointShift_reduced] using he + +theorem chart_pointShift {U V : PolygonObject a} (f : U ⟶ V) + (c : Chart (a:=a) U.tracks V.tracks) (hc : c.Holds f.toEquiv) (x : U.Point) + (hx : c.Contains x) : pointShift f x=orbitRepresentative c.shift := by + obtain ⟨hu,he⟩ := hc x.val.2 hx.2 + have hpoint : (⟨(c.source,x.val.2),hu⟩ : U.Point)=x := + Subtype.ext (Prod.ext hx.1.symm rfl) + rw [hpoint] at he + exact pointShift_unique f x _ (congrArg Prod.snd he) + +theorem pointShift_finite_range {U V : PolygonObject a} (f : U ⟶ V) : + (Set.range (pointShift f)).Finite := by + obtain ⟨s,hs,hcover⟩ := f.hasTable + apply (s.finite_toSet.image (fun c => orbitRepresentative c.shift)).subset + rintro _ ⟨x,rfl⟩ + obtain ⟨c,hc,hx⟩ := hcover x + exact ⟨c,hc,(chart_pointShift f c (hs c hc) x hx).symm⟩ + +theorem pointShift_fiber_polygon {U V : PolygonObject a} (f : U ⟶ V) + (i : Fin U.tracks) (u : CutRing × CutRing) : + {z | ∃hz : z∈(U.cell i).val, pointShift f ⟨(i,z),hz⟩=u}∈polygonAlgebra a := by + obtain ⟨s,hs,hcover⟩ := f.hasTable + have he : {z | ∃hz : z∈(U.cell i).val, pointShift f ⟨(i,z),hz⟩=u} = + ⋃c∈s.filter (fun c => c.source=i ∧ orbitRepresentative c.shift=u),c.domain.val := by + ext z + constructor + · rintro ⟨hz,hu⟩ + obtain ⟨c,hc,hz'⟩ := hcover ⟨(i,z),hz⟩ + exact Set.mem_iUnion₂.mpr ⟨c,Finset.mem_filter.mpr ⟨hc,hz'.1.symm, + (chart_pointShift f c (hs c hc) ⟨(i,z),hz⟩ hz').symm.trans hu⟩,hz'.2⟩ + · intro hz + obtain ⟨c,hcf,hcz⟩ := Set.mem_iUnion₂.mp hz + obtain ⟨hcs,hci,hcu⟩ := Finset.mem_filter.mp hcf + obtain ⟨hz',hf⟩ := hs c hcs z hcz + subst i + refine ⟨hz',?_⟩ + exact (chart_pointShift f c (hs c hcs) ⟨(c.source,z),hz'⟩ ⟨rfl,hcz⟩).trans hcu + rw [he] + apply BooleanSubalgebra.biSup_mem (Finset.finite_toSet _) + intro c _ + exact c.domain.property + +noncomputable def trajectoryShift (F : RawString a n) (x : (F.obj 0).Point) : + Fin (n+1) → CutRing × CutRing := fun i => pointShift (baseArrow F i) x + +theorem trajectoryShift_fiber_polygon (F : RawString a n) (j : Fin (F.obj 0).tracks) + (u : Fin (n+1) → CutRing × CutRing) : + {z | ∃hz : z∈((F.obj 0).cell j).val, trajectoryShift F ⟨(j,z),hz⟩=u}∈polygonAlgebra a := by + have he : {z | ∃hz : z∈((F.obj 0).cell j).val, trajectoryShift F ⟨(j,z),hz⟩=u} = + ⋂i : Fin (n+1),{z | ∃hz : z∈((F.obj 0).cell j).val, + pointShift (baseArrow F i) ⟨(j,z),hz⟩=u i} := by + ext z + constructor + · rintro ⟨hz,hu⟩ + exact Set.mem_iInter.mpr (fun i => ⟨hz,congrFun hu i⟩) + · intro hz + have h := Set.mem_iInter.mp hz + obtain ⟨hz',_⟩ := h 0 + refine ⟨hz',?_⟩ + funext i + exact (h i).choose_spec + rw [he] + exact BooleanSubalgebra.iInf_mem (fun i => pointShift_fiber_polygon (baseArrow F i) j (u i)) + +theorem trajectoryShift_finite_range (F : RawString a n) : + (Set.range (trajectoryShift F)).Finite := by + let S (i : Fin (n+1)) := Set.range (pointShift (baseArrow F i)) + let : ∀ index, Finite (S index) := fun index => + (pointShift_finite_range (baseArrow F index)).to_subtype + let val : (∀i,S i) → (Fin (n+1) → CutRing × CutRing) := fun t i => (t i).val + apply (Set.finite_range val).subset + rintro _ ⟨x,rfl⟩ + exact ⟨fun i => ⟨pointShift (baseArrow F i) x,⟨x,rfl⟩⟩,rfl⟩ + +theorem ladder_preserves_trajectoryShift {F G : StringGroupoid a n} (h : F ⟶ G) + (x : (F.obj.obj 0).Point) : + trajectoryShift G.obj ((h.hom.app 0).toEquiv x)=trajectoryShift F.obj x := by + funext i + have he : translate a (pointShift (baseArrow G.obj i) ((h.hom.app 0).toEquiv x)) x.val.2 = + translate a (pointShift (baseArrow F.obj i) x) x.val.2 := by + calc + _ = translate a (pointShift (baseArrow G.obj i) ((h.hom.app 0).toEquiv x)) + ((h.hom.app 0).toEquiv x).val.2 := congrArg _ (h.property 0 x).symm + _ = trajectory G.obj ((h.hom.app 0).toEquiv x) i := (pointShift_spec _ _).symm + _ = trajectory F.obj x i := congrFun (ladder_preserves_trajectory h x) i + _ = _ := pointShift_spec _ _ + exact (pointShift_reduced _ _).symm.trans + ((orbitRepresentative_eq_of_translate_eq x.val.2 he).trans (pointShift_reduced _ _)) + +theorem trajectory_stratification (F : RawString a n) : + ∃s : Finset (Fin (n+1) → CutRing × CutRing), + (∀x,trajectoryShift F x∈s) ∧ + (∀j u,{z | ∃hz : z∈((F.obj 0).cell j).val, + trajectoryShift F ⟨(j,z),hz⟩=u}∈polygonAlgebra a) := by + refine ⟨(trajectoryShift_finite_range F).toFinset,?_,trajectoryShift_fiber_polygon F⟩ + intro x + exact (Set.Finite.mem_toFinset _).mpr ⟨x,rfl⟩ + +end PolygonObject +end PolygonTrajectoryStrata + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Configurations/PolygonVerticalStrings.lean b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/PolygonVerticalStrings.lean new file mode 100644 index 0000000000000000000000000000000000000000..cb5ce3abb1585300148029a7fc3ea9ad749ccdfc --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/PolygonVerticalStrings.lean @@ -0,0 +1,77 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Configurations.PolygonStringGroupoid + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section PolygonVerticalStrings + +open Classical CategoryTheory +namespace PolygonObject +variable {a n m : ℕ} + +def verticalStringProperty (a n : ℕ) : ObjectProperty (RawString a n) := + fun F => ∀ (i j : Fin (n+1)) (f : i ⟶ j), Positional (F.map f) + +abbrev VerticalString (a n : ℕ) := (verticalStringProperty a n).FullSubcategory + +noncomputable def verticalEvaluation (a n : ℕ) : VerticalString a n ⥤ PolygonObject a where + obj F := F.obj.obj 0 + map f := f.hom.app 0 + +noncomputable def verticalConstant (a n : ℕ) : PolygonObject a ⥤ VerticalString a n where + obj U := ⟨(Functor.const (Fin (n+1))).obj U,fun _ _ _ => identity_positional U⟩ + map f := ObjectProperty.homMk ((Functor.const (Fin (n+1))).map f) + +noncomputable instance verticalEvaluation_full : (verticalEvaluation a n).Full where + map_surjective h := ⟨ObjectProperty.homMk (extendLadder h),extendLadder_zero h⟩ + +instance verticalEvaluation_faithful : (verticalEvaluation a n).Faithful where + map_injective h := by + apply ObjectProperty.hom_ext + exact ladder_ext h + +instance verticalEvaluation_essSurj : (verticalEvaluation a n).EssSurj where + mem_essImage U := ⟨(verticalConstant a n).obj U,⟨Iso.refl U⟩⟩ + +instance verticalEvaluation_isEquivalence : (verticalEvaluation a n).IsEquivalence where + +noncomputable def verticalEquivalence (a n : ℕ) : VerticalString a n ≌ PolygonObject a := + (verticalEvaluation a n).asEquivalence + +noncomputable def verticalReindex (u : Fin (n+1) ⥤ Fin (m+1)) : + VerticalString a m ⥤ VerticalString a n where + obj F := ⟨u⋙F.obj,fun i j f => F.property (u.obj i) (u.obj j) (u.map f)⟩ + map f := ObjectProperty.homMk (Functor.whiskerLeft u f.hom) + map_id F := by apply ObjectProperty.hom_ext; rfl + map_comp f g := by apply ObjectProperty.hom_ext; rfl + +@[simp] theorem verticalConstant_evaluation (a n : ℕ) : + verticalConstant a n ⋙ verticalEvaluation a n=𝟭 (PolygonObject a) := rfl + +instance verticalConstant_isEquivalence : (verticalConstant a n).IsEquivalence := by + have : (verticalConstant a n ⋙ verticalEvaluation a n).IsEquivalence := by + rw [verticalConstant_evaluation] + infer_instance + exact CategoryTheory.Functor.isEquivalence_of_comp_right + (verticalConstant a n) (verticalEvaluation a n) + +theorem verticalConstant_reindex (u : Fin (n+1) ⥤ Fin (m+1)) : + verticalConstant a m ⋙ verticalReindex u=verticalConstant a n := by + apply CategoryTheory.Functor.ext + · intro U V f; rfl + · intro U; rfl + +end PolygonObject +end PolygonVerticalStrings + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Configurations/Rectangles.lean b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/Rectangles.lean new file mode 100644 index 0000000000000000000000000000000000000000..ef6257e2b66c388b491a5747c01ea9bbf9668c28 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/Rectangles.lean @@ -0,0 +1,114 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.FiniteNestedLaw + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section OldRectangles + +structure LabelledRectangle (n : ℕ) where + length : Fin 2 → ℕ + length_le : ∀ j, length j ≤ n + start : Fin 2 → ℤ + lower : Fin 2 → CutRing + upper : Fin 2 → CutRing + ordered : ∀ j, ordinary (lower j) ≤ ordinary (upper j) + lower_label : ∀ j, start j ≤ endpointLabel (lower j) ∧ endpointLabel (lower j) < start j+length j + upper_label : ∀ j, start j ≤ endpointLabel (upper j) ∧ endpointLabel (upper j) < start j+length j + +namespace LabelledRectangle +variable {n : ℕ} (R : LabelledRectangle n) + +noncomputable def polygon (a : ℕ) : polygonAlgebra a := coordinateRectangle a R.lower R.upper + +theorem resolved (a : ℕ) (r : CutRing) : + ResolvedBy (fun i => (InitialCoverSystem.primitiveTests (a := a) (r := r) + (coordinateWindowPrimitives n R.start) i).val) (R.polygon a).val := by + have hl (j : Fin 2) : R.start j ≤ endpointLabel (R.lower j) ∧ endpointLabel (R.lower j) < R.start j+n := by + have hh := R.lower_label j; have hh' := R.length_le j; omega + have hv (j : Fin 2) : R.start j ≤ endpointLabel (R.upper j) ∧ endpointLabel (R.upper j) < R.start j+n := by + have hh := R.upper_label j; have hh' := R.length_le j; omega + intro x y he + exact and_congr (coordinateLabelWindow_resolved n R.start 0 _ _ (hl 0) (hv 0) x y he) + (coordinateLabelWindow_resolved n R.start 1 _ _ (hl 1) (hv 1) x y he) + +structure ChartFit (s : CutRing) (z : CutRing × CutRing) where + window : Fin 2 → ℤ + source_start : ∀ j, window j ≤ R.start j + source_end : ∀ j, R.start j+R.length j ≤ window j+n + chart_start : ∀ j, window j ≤ pointLabel z j+symmetricWindowStart s j + chart_end : ∀ j, pointLabel z j+symmetricWindowStart s j+symmetricWindowLength s ≤ window j+n + +theorem chartFit_of_near_labels (s : CutRing) (z : CutRing × CutRing) + (v : Fin 2 → ℤ) (d : Fin 2 → ℕ) + (hv : ∀ j, R.start j ≤ v j ∧ v j < R.start j+R.length j) + (hz : ∀ j, (pointLabel z j-v j).natAbs ≤ d j) + (hsize : ∀ j, R.length j+2*d j+2*(endpointLabel s).natAbs+2 ≤ n) : + Nonempty (R.ChartFit s z) := by + have hh (j : Fin 2) := source_chart_containing_window n (R.length j) (R.start j) + (pointLabel z j) (v j) (endpointLabel s).natAbs (d j) (hv j) (hz j) (hsize j) + refine ⟨⟨fun j => R.start j ⊓ (pointLabel z j-((endpointLabel s).natAbs:ℤ)), + fun j => (hh j).1,fun j => (hh j).2.1,?_,?_⟩⟩ + · intro j + simpa only [symmetricWindowStart,sub_eq_add_neg] using (hh j).2.2.1 + · intro j + simpa only [symmetricWindowStart,symmetricWindowLength,sub_eq_add_neg] using (hh j).2.2.2 + +end LabelledRectangle + +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + +noncomputable def rectangleCopy (hlarge : 15 < m+1) {n : ℕ} + (g : B.CoordinateWindowLaw n) (R : LabelledRectangle n) : + TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm) := + B.windowSector hlarge n g R.start (R.polygon a) + +theorem rectangleCopy_supported (hlarge : 15 < m+1) {n : ℕ} + (g : B.CoordinateWindowLaw n) (R : LabelledRectangle n) : + B.AlignedSmallSupported (B.rectangleCopy hlarge g R) := + B.fullGeometricSector_supported hlarge _ _ _ (R.resolved a r) + +theorem rectangleCopy_axes_control (hlarge : 15 < m+1) {n : ℕ} + (g : B.CoordinateWindowLaw n) (R : LabelledRectangle n) (j : Fin 2) : + SmallControlled B.c (B.rectangleCopy hlarge g R) + (B.axisSector hlarge n g j (R.length j) (R.length_le j) (R.start j) + (coordinateInterval a j (R.lower j) (R.upper j))) := by + rw [B.axisSector_in_window hlarge n g j _ (R.length_le j) _ R.start le_rfl + (by have hh := R.length_le j; omega) _ + (axisInterval_resolved j _ _ _ _ (R.lower_label j) (R.upper_label j))] + apply B.fullGeometricSector_small_control + fin_cases j + · exact inf_le_left + · exact inf_le_right + +theorem rectangleCopy_quadrant_control (hlarge : 20 ≤ m+1) + (hr : 0 < ordinary r ∧ ordinary r < 1/2) + (s u : CutRing) (hs : 0 < ordinary s ∧ ordinary s < ordinary r) + (h : B.TangentChartLaws (symmetricWindowLength s) (symmetricWindowStart s) u) + {n : ℕ} (g : B.CoordinateWindowLaw n) (R : LabelledRectangle n) + (d : Fin 2) (z : CutRing × CutRing) (positive : Bool) (fit : R.ChartFit s z) + (hlo : ∀ j, ordinary (signQuadrantLower s d positive j)+ordinary (pointCoordinate z j) ≤ ordinary (R.lower j)) + (hup : ∀ j, ordinary (R.upper j) ≤ ordinary (signQuadrantUpper s d positive j)+ordinary (pointCoordinate z j)) : + SmallControlled B.c (B.rectangleCopy (by omega) g R) + (B.tangentSign (by omega) (symmetricWindowLength s) (symmetricWindowStart s) u h d z positive) := + B.tangentSign_quadrant_control hlarge hr s u hs h n g R.length R.length_le R.start + fit.window fit.source_start fit.source_end d z positive fit.chart_start fit.chart_end + R.lower R.upper R.ordered R.lower_label R.upper_label hlo hup _ + (B.rectangleCopy_supported (by omega) g R) (B.rectangleCopy_axes_control (by omega) g R) + +end InitialCoverSystem +end OldRectangles + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Configurations/RepeatedTrackRouting.lean b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/RepeatedTrackRouting.lean new file mode 100644 index 0000000000000000000000000000000000000000..ac98ff50245267adccb9c69d3f74409d29f103d7 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/RepeatedTrackRouting.lean @@ -0,0 +1,210 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.TemplateRelators +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.PrivateBankWord + +namespace OAI + +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement + +structure PrivateRoutingBank {m : ℕ} (i : Fin 5 → Fin m) where + row : Fin 5 → Fin 5 ↪ Fin m + source : ∀ j, row j 0=i j + fresh : ∀ j k, k≠0 → ∀ l, row j k≠i l + separate : ∀ j k j' k', k≠0 → k'≠0 → row j k=row j' k' → j=j' ∧ k=k' + +namespace PrivateRoutingBank +variable {m : ℕ} {i : Fin 5 → Fin m} (P : PrivateRoutingBank i) + +def target : Fin 5 ↪ Fin m := + ⟨fun j => P.row j 1,fun _ _ he => (P.separate _ _ _ _ (by decide) (by decide) he).1⟩ + +noncomputable def alphabet : Finset (Fin m) := + Finset.univ.image (fun p : Fin 5 × Fin 5 => P.row p.1 p.2) + +theorem alphabet_card : P.alphabet.card ≤ 25 := by + classical + exact (Finset.card_image_le).trans (by simp) + +theorem row_subset (j : Fin 5) : orderedTrackAlphabet (P.row j) ⊆ P.alphabet := by + classical + intro t ht + obtain ⟨k,_,rfl⟩ := Finset.mem_map.mp ht + exact Finset.mem_image.mpr ⟨(j,k),Finset.mem_univ _,rfl⟩ + +theorem source_mem (j : Fin 5) : i j ∈ P.alphabet := by + rw [← P.source j] + exact P.row_subset j (orderedTrackAlphabet_mem _ _) + +theorem target_other_notmem (j l : Fin 5) (hjl : j≠l) : + P.target l ∉ orderedTrackAlphabet (P.row j) := by + intro ht + obtain ⟨k,_,he⟩ := Finset.mem_map.mp ht + by_cases hk : k=0 + · subst k + rw [P.source j] at he + exact P.fresh l 1 (by decide) j he.symm + · exact hjl (P.separate j k l 1 hk (by decide) he).1 + +theorem source_other_frame_notmem {a : ℕ} (V : polygonAlgebra a) + (u : Fin 5 → CutRing × CutRing) + (hinj : Function.Injective (SlotMap a m V (fun j => (i j,u j)))) + (j l : Fin 5) (hjl : j≠l) (x : V.val) : + (i l,translate a (u l) x.val) ∉ + frameDomain (orderedTrackAlphabet (P.row j)) (fun _ => u j) V := by + rintro ⟨t,ht,y,hy,he⟩ + obtain ⟨k,_,rfl⟩ := Finset.mem_map.mp ht + have ht := congrArg Prod.fst he + by_cases hk : k=0 + · subst k + rw [P.source j] at he + have hh : SlotMap a m V (fun j => (i j,u j)) (j,⟨y,hy⟩) = + SlotMap a m V (fun j => (i j,u j)) (l,x) := he.symm + exact hjl (congrArg Prod.fst (hinj hh)) + · exact P.fresh j k hk l ht.symm + +end PrivateRoutingBank + +theorem exists_privateRoutingBank {m : ℕ} (i : Fin 5 → Fin m) (J : Finset (Fin m)) + (hreserve : 20 ≤ ((Finset.univ : Finset (Fin m)) \ + (J ∪ Finset.univ.image i)).card) : + ∃ P : PrivateRoutingBank i, ∀ j k, k≠0 → P.row j k ∉ J := by + classical + let R := (Finset.univ : Finset (Fin m)) \ (J ∪ Finset.univ.image i) + have hc : Fintype.card (Fin 5 × {k : Fin 5 // k≠0}) ≤ Fintype.card R := by + have hfour : Fintype.card {k : Fin 5 // k≠0}=4 := by decide + rw [Fintype.card_prod,Fintype.card_fin,hfour,Fintype.card_coe] + exact hreserve + obtain ⟨p⟩ := Function.Embedding.nonempty_of_card_le hc + let f : Fin 5 → Fin 5 → Fin m := fun j k => + if hk : k=0 then i j else (p (j,⟨k,hk⟩)).val + have hfresh : ∀ j k hk l, (p (j,⟨k,hk⟩)).val ≠ i l := by + intro j k hk l he + exact (Finset.mem_sdiff.mp (p (j,⟨k,hk⟩)).property).2 + (Finset.mem_union_right _ (he.symm ▸ Finset.mem_image.mpr ⟨l,Finset.mem_univ _,rfl⟩)) + have hinj : ∀ j, Function.Injective (f j) := by + intro j k l he + by_cases hk : k=0 <;> by_cases hl : l=0 + · exact hk.trans hl.symm + · subst k + have hh : i j=(p (j,⟨l,hl⟩)).val := by simpa [f,hl] using he + exact (hfresh j l hl j hh.symm).elim + · subst l + have hh : (p (j,⟨k,hk⟩)).val=i j := by simpa [f,hk] using he + exact (hfresh j k hk j hh).elim + · have he' : p (j,⟨k,hk⟩)=p (j,⟨l,hl⟩) := + Subtype.ext (by simpa only [f,dite_eq_right hk,dite_eq_right hl] using he) + have hh := p.injective he' + exact congrArg (fun q : Fin 5 × {k : Fin 5 // k≠0} => q.2.val) hh + let P : PrivateRoutingBank i := { + row := fun j => ⟨f j,hinj j⟩ + source := by intro j; simp [f] + fresh := by + intro j k hk l + exact (show f j k≠i l from by simpa [f,hk] using hfresh j k hk l) + separate := by + intro j k j' k' hk hk' he + change f j k=f j' k' at he + have he' : p (j,⟨k,hk⟩)=p (j',⟨k',hk'⟩) := + Subtype.ext (by simpa only [f,dite_eq_right hk,dite_eq_right hk'] using he) + have hh := p.injective he' + exact ⟨congrArg Prod.fst hh,congrArg (fun q : Fin 5 × {k : Fin 5 // k≠0} => q.2.val) hh⟩ } + refine ⟨P,?_⟩ + intro j k hk hJ + have hh : (p (j,⟨k,hk⟩)).val ∈ J := by simpa [P,f,hk] using hJ + exact (Finset.mem_sdiff.mp (p (j,⟨k,hk⟩)).property).2 (Finset.mem_union_left _ hh) + +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + (hlarge : 15 < m+1) (h : B.AllPrimitiveLaws) (hr : 0 u j) + (balancedOffsetFrame a r m hm (orderedTrackAlphabet (P.row j)) b + (fun ht => hb (P.row_subset j ht)) (fun _ => u j)) V privateCycleStar + +noncomputable def privateRoutingWord (i : Fin 5 → Fin (m+1)) + (u : Fin 5 → CutRing × CutRing) (P : PrivateRoutingBank i) + (b : Fin (m+1)) (hb : b ∉ P.alphabet) (V : polygonAlgebra a) : + BoundedRelationCover M (alternatingGenerator a r m hm) := + ((List.finRange 5).map (B.privateRoutingFactor hlarge h hr i u P b hb V)).prod + +theorem privateRoutingWord_properties (i : Fin 5 → Fin (m+1)) (u : Fin 5 → CutRing × CutRing) + (P : PrivateRoutingBank i) (b : Fin (m+1)) (hb : b ∉ P.alphabet) + (V : polygonAlgebra a) + (hinj : Function.Injective (SlotMap a (m+1) V (fun j => (i j,u j)))) : + B.privateRoutingWord hlarge h hr i u P b hb V ∈ ⨆ W : polygonAlgebra a, (B.polygonStar hlarge h hr W).range ∧ + B.privateRoutingWord hlarge h hr i u P b hb V ∈ sourceAlignedGroup a r m hm M B.t P.alphabet ∧ + ∀ (j : Fin 5) (x : V.val), + (coverMap M (alternatingGenerator a r m hm) (B.privateRoutingWord hlarge h hr i u P b hb V)).val.val (i j,translate a (u j) x.val) = + (P.target j,translate a (u j) x.val) := by + classical + have hbrow (j : Fin 5) : b ∉ orderedTrackAlphabet (P.row j) := + fun ht => hb (P.row_subset j ht) + let F (j : Fin 5) := balancedOffsetFrame a r m hm (orderedTrackAlphabet (P.row j)) + b (hbrow j) (fun _ => u j) + let g : Fin 5 → BoundedRelationCover M (alternatingGenerator a r m hm) := fun j => + B.distinctSlotStar hlarge h hr (P.row j) (fun _ => u j) (F j) V privateCycleStar + let l := List.finRange 5 + let w := (l.map g).prod + change w ∈ _ ∧ w ∈ _ ∧ _ + refine ⟨?_,?_,?_⟩ + · apply Subgroup.list_prod_mem + intro t ht + obtain ⟨j,hj,rfl⟩ := List.mem_map.mp ht + exact B.distinctSlotStar_uniform_mem hlarge h hr (P.row j) b (hbrow j) + (fun _ => u j) (F j) (u j) (fun _ => rfl) V privateCycleStar + · apply Subgroup.list_prod_mem + intro t ht + obtain ⟨j,hj,rfl⟩ := List.mem_map.mp ht + exact sourceAlignedGroup_mono B.t (P.row_subset j) + (B.frameStar_alphabet_mem hlarge h hr (orderedTrackAlphabet (P.row j)) + (by simp [orderedTrackAlphabet]) b (hbrow j) (fun _ => u j) (F j) V + (universalMap (orderedTrackHom (P.row j)) privateCycleStar)) + · intro j x + let q : BoundedRelationCover M (alternatingGenerator a r m hm) →* Equiv.Perm (TrackPoint a (m+1)) := + (polygonFullGroup a (m+1)).subtype.comp + ((polygonAlternatingGroup a (m+1)).subtype.comp (coverMap M (alternatingGenerator a r m hm))) + change q w (i j,translate a (u j) x.val) = _ + change q ((l.map g).prod) _ = _ + rw [map_list_prod,List.map_map] + apply perm_list_prod_transport l (List.nodup_finRange 5) (fun k => q (g k)) j (by simp [l]) + · have he := B.distinctSlotStar_apply hlarge h hr (P.row j) (fun _ => u j) + (F j) V privateCycleStar 0 x + rw [privateCycleStar_projection,privateCycle_apply_zero,P.source j] at he + exact he + · intro k hk hkj + constructor + · exact B.frameStar_supported hlarge h hr _ (fun _ => u k) (F k) V + (universalMap (orderedTrackHom (P.row k)) privateCycleStar) _ + (P.source_other_frame_notmem V u hinj k j hkj x) + · apply B.frameStar_supported hlarge h hr _ (fun _ => u k) (F k) V + (universalMap (orderedTrackHom (P.row k)) privateCycleStar) + rintro ⟨t,ht,y,hy,he⟩ + have hte : P.target j=t := congrArg Prod.fst he + exact P.target_other_notmem k j hkj (hte.symm ▸ ht) + +theorem repeated_bank_routing (i : Fin 5 → Fin (m+1)) (u : Fin 5 → CutRing × CutRing) + (P : PrivateRoutingBank i) (b : Fin (m+1)) (hb : b ∉ P.alphabet) + (V : polygonAlgebra a) + (hinj : Function.Injective (SlotMap a (m+1) V (fun j => (i j,u j)))) : + ∃ w : BoundedRelationCover M (alternatingGenerator a r m hm), + w ∈ ⨆ W : polygonAlgebra a, (B.polygonStar hlarge h hr W).range ∧ + w ∈ sourceAlignedGroup a r m hm M B.t P.alphabet ∧ + ∀ (j : Fin 5) (x : V.val), + (coverMap M (alternatingGenerator a r m hm) w).val.val (i j,translate a (u j) x.val) = + (P.target j,translate a (u j) x.val) := + ⟨B.privateRoutingWord hlarge h hr i u P b hb V, + B.privateRoutingWord_properties hlarge h hr i u P b hb V hinj⟩ + +end InitialCoverSystem + +end SimpleAmenable + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Configurations/ReserveAtom.lean b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/ReserveAtom.lean new file mode 100644 index 0000000000000000000000000000000000000000..a20396bd00070708eec3f97e31256acadf033fe1 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/ReserveAtom.lean @@ -0,0 +1,68 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.AtomConjugation + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section ReserveAtomSupport + +variable {I : Type*} [Fintype I] [DecidableEq I] + +noncomputable def subtypeAlternatingHom (S : Finset I) : + alternatingGroup S →* alternatingGroup I := + { toFun := fun g => ⟨Equiv.Perm.ofSubtype g.val, by + rw [Equiv.Perm.mem_alternatingGroup, Equiv.Perm.sign_ofSubtype] + exact g.property⟩ + map_one' := Subtype.ext (map_one Equiv.Perm.ofSubtype) + map_mul' := fun x y => Subtype.ext (map_mul Equiv.Perm.ofSubtype x.val y.val) } + +theorem swapLabel_subtype (S : Finset I) (a : SwapLabel I) (ha : a.val.support ⊆ S) : + ∃ b : SwapLabel S, Equiv.Perm.ofSubtype b.val = a.val := by + obtain ⟨i,j,hij,heq⟩ := a.property + have hi : i ∈ S := ha (by rw [heq, Equiv.Perm.support_swap hij]; simp) + have hj : j ∈ S := ha (by rw [heq, Equiv.Perm.support_swap hij]; simp) + let b : SwapLabel S := ⟨Equiv.swap ⟨i,hi⟩ ⟨j,hj⟩, + ⟨i,hi⟩,⟨j,hj⟩,fun h => hij (congrArg Subtype.val h), rfl⟩ + exact ⟨b,by simp only [b, Equiv.Perm.ofSubtype_swap_eq,heq]⟩ + +theorem supported_reserveAtoms_generate (S : Finset I) (a : SwapLabel I) + (ha : a.val.support ⊆ S) (g : alternatingGroup I) (hg : g.val.support ⊆ S) : + g ∈ Subgroup.closure {h : alternatingGroup I | ∃ t : SwapLabel I, + t.val.support ⊆ S ∧ h = reserveAtom a t} := by + classical + let K := Subgroup.closure {h : alternatingGroup I | ∃ t : SwapLabel I, + t.val.support ⊆ S ∧ h = reserveAtom a t} + obtain ⟨aS,haS⟩ := swapLabel_subtype S a ha + obtain ⟨gS,hgS⟩ := Equiv.Perm.mem_range_ofSubtype_iff.mpr hg + have hgS' : gS ∈ alternatingGroup S := by + rw [Equiv.Perm.mem_alternatingGroup, ← Equiv.Perm.sign_ofSubtype, hgS] + exact g.property + have hle : Subgroup.closure (Set.range (reserveAtom aS)) ≤ + K.comap (subtypeAlternatingHom S) := by + apply (Subgroup.closure_le _).mpr + rintro _ ⟨t,rfl⟩ + let t' : SwapLabel I := ⟨Equiv.Perm.ofSubtype t.val,t.property.of_subtype_isSwap⟩ + apply Subgroup.subset_closure + refine ⟨t',?_,?_⟩ + · exact Equiv.Perm.mem_range_ofSubtype_iff.mp ⟨t.val,rfl⟩ + · apply Subtype.ext + change Equiv.Perm.ofSubtype (aS.val * t.val) = a.val * Equiv.Perm.ofSubtype t.val + rw [map_mul,haS] + have hm := hle (reserveAtoms_generate aS ▸ + Subgroup.mem_top (⟨gS,hgS'⟩ : alternatingGroup S)) + change subtypeAlternatingHom S ⟨gS,hgS'⟩ ∈ K at hm + have heq : subtypeAlternatingHom S ⟨gS,hgS'⟩ = g := Subtype.ext hgS + rwa [heq] at hm + +end ReserveAtomSupport + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Configurations/SlotInputGeneration.lean b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/SlotInputGeneration.lean new file mode 100644 index 0000000000000000000000000000000000000000..f6ee1f49ca904b35927fbc37cce0a6a3c96bfc8e --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/SlotInputGeneration.lean @@ -0,0 +1,143 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.LatticeTranslationTransport +import OAI.GroupTheory.SimpleAmenable.CentralCovers.GenerationUpstairs + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section SlotInputGeneration + +noncomputable def orderedTrackEquiv {m : ℕ} (ι : Fin 5 ↪ Fin m) : + Fin 5 ≃ orderedTrackAlphabet ι := + Equiv.ofBijective (fun j => ⟨ι j,orderedTrackAlphabet_mem ι j⟩) + ⟨fun j k he => ι.injective (congrArg Subtype.val he),by + intro x + obtain ⟨j,_,hj⟩ := Finset.mem_map.mp x.property + exact ⟨j,Subtype.ext hj⟩⟩ + +theorem orderedTrackHom_bijective {m : ℕ} (ι : Fin 5 ↪ Fin m) : + Function.Bijective (orderedTrackHom ι) := by + have hi : Function.Injective (orderedTrackHom ι) := by + intro s t he + apply Subtype.ext + apply Equiv.Perm.viaEmbeddingHom_injective ι + have hh := congrArg (subtypeAlternatingHom (orderedTrackAlphabet ι)) he + rw [← MonoidHom.comp_apply,← MonoidHom.comp_apply,orderedTrackHom_comp] at hh + exact congrArg Subtype.val hh + let e := (orderedTrackEquiv ι).altCongrHom + have hs := Finite.surjective_of_injective (e.symm.injective.comp hi) + refine ⟨hi,fun y => ?_⟩ + obtain ⟨x,hx⟩ := hs (e.symm y) + exact ⟨x,e.symm.injective hx⟩ + +theorem smallPermutation_fiveRepresentation {m : ℕ} (hm : 5 ≤ m) + (s : alternatingGroup (Fin m)) (hs : s.val.support.card≤5) : + ∃ (ι : Fin 5 ↪ Fin m) (t : alternatingGroup (Fin 5)), fiveAlternatingHom ι t=s := by + classical + obtain ⟨I,hSI,_,hI⟩ := Finset.exists_subsuperset_card_eq + (Finset.subset_univ s.val.support) hs (by simpa using hm : 5≤(Finset.univ : Finset (Fin m)).card) + let e : Fin 5 ≃ I := (Fintype.equivFinOfCardEq (by simpa using hI : Fintype.card I=5)).symm + let ι : Fin 5 ↪ Fin m := e.toEmbedding.trans (Function.Embedding.subtype _) + have hsub : s.val.support ⊆ orderedTrackAlphabet ι := by + intro x hx + exact Finset.mem_map.mpr ⟨e.symm ⟨x,hSI hx⟩,Finset.mem_univ _, + congrArg Subtype.val (e.apply_symm_apply _)⟩ + obtain ⟨v,hv⟩ := (subtypeAlternatingHom_mem_range (orderedTrackAlphabet ι) s).mpr hsub + obtain ⟨t,ht⟩ := (orderedTrackHom_bijective ι).2 v + refine ⟨ι,t,?_⟩ + rw [← DFunLike.congr_fun (orderedTrackHom_comp ι) t,MonoidHom.comp_apply,ht,hv] + +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + (hlarge : 15 < m+1) (h : B.AllPrimitiveLaws) (hr : 0 (j,0) + have hp : primitiveTests (a := a) (r := r) P ()=initialTest a r j := by + simp only [primitiveTests,primitiveFamilyTests,P,spatialTranslate_zero] + rw [← hp,B.polygonStar_eq hlarge h hr P _ (resolved_test _ ())] + rw [B.fullGeometricSector_small_input hlarge P (fun J _ b hb => h Unit P J b hb) P () () rfl I] + change (B.primitiveCopy I.val _ _ (j,0)).comp _ = _ + rw [B.primitiveCopy_zero] + +variable (R : alternatingGroup (Fin (m+1)) → + Multiplicative (FreeAbelianGroup (Fin m × Fin 2)) →* + Multiplicative (FreeAbelianGroup (Fin m × Fin 2))) + (hR : ∀ s k, B.c s * B.t k * (B.c s)⁻¹ = B.t (R s k)) + (hwide : 100 ≤ m+1) + +noncomputable def slotGroup : Subgroup (BoundedRelationCover M (alternatingGenerator a r m hm)) := + Subgroup.closure {z | ∃ (V : polygonAlgebra a) (i : Fin 5 → Fin (m+1)) + (u : Fin 5 → CutRing × CutRing) + (hi : Function.Injective (SlotMap a (m+1) V (fun j => (i j,u j)))) + (s : UniversalExtension (alternatingGroup (Fin 5))), z=B.slotStar hlarge h hr hwide V i u hi s} + +theorem slotGroup_mem (V : polygonAlgebra a) (i : Fin 5 → Fin (m+1)) + (u : Fin 5 → CutRing × CutRing) + (hi : Function.Injective (SlotMap a (m+1) V (fun j => (i j,u j)))) + (s : UniversalExtension (alternatingGroup (Fin 5))) : + B.slotStar hlarge h hr hwide V i u hi s ∈ B.slotGroup hlarge h hr hwide := + Subgroup.subset_closure ⟨V,i,u,hi,s,rfl⟩ + +include R hR + +theorem translated_initial_mem_slotGroup (b : SmallConditional m) + (k : Multiplicative (FreeAbelianGroup (Fin m × Fin 2))) : + B.t k*PresentedGroup.of (Sum.inl b)*(B.t k)⁻¹ ∈ B.slotGroup hlarge h hr hwide := by + obtain ⟨ι,s,hs⟩ := smallPermutation_fiveRepresentation (by omega : 5 ≤ m+1) + (⟨b.2.val,b.2.property.1⟩ : alternatingGroup (Fin (m+1))) b.2.property.2 + obtain ⟨t,ht⟩ := universalProjection_surjective (alternatingGroup (Fin 5)) s + let I : FiveAlphabet (Fin (m+1)) := ⟨orderedTrackAlphabet ι,Finset.subset_univ _,by + simp [orderedTrackAlphabet]⟩ + let d := sourceLatticeOffsets m (Multiplicative.toAdd k) + let F : OffsetFrame a r m hm (orderedTrackAlphabet ι) d := { + k := k + d := d + projection := sourceLatticeFullMap_offsets a r m hm (Multiplicative.toAdd k) + prescribed := fun _ _ => rfl } + have he : B.distinctSlotStar hlarge h hr ι d F (initialTest a r b.1) t = + B.t k*PresentedGroup.of (Sum.inl b)*(B.t k)⁻¹ := by + change B.t k * B.polygonStar hlarge h hr (initialTest a r b.1) + (universalMap (subtypeAlternatingHom I.val) (universalMap (orderedTrackHom ι) t)) * (B.t k)⁻¹ = _ + rw [show B.polygonStar hlarge h hr (initialTest a r b.1) + (universalMap (subtypeAlternatingHom I.val) (universalMap (orderedTrackHom ι) t)) = + B.initialAlphabet I.val b.1 (universalProjection _ (universalMap (orderedTrackHom ι) t)) from + DFunLike.congr_fun (B.polygonStar_initial_alphabet hlarge h hr b.1 I) _] + rw [show universalProjection _ (universalMap (orderedTrackHom ι) t)=orderedTrackHom ι s from + (DFunLike.congr_fun (universalMap_spec (orderedTrackHom ι)) t).trans (by rw [MonoidHom.comp_apply,ht])] + change B.t k*B.initialConditional b.1 (subtypeAlternatingHom (orderedTrackAlphabet ι) (orderedTrackHom ι s))*(B.t k)⁻¹=_ + have hh := DFunLike.congr_fun (orderedTrackHom_comp ι) s + change subtypeAlternatingHom (orderedTrackAlphabet ι) (orderedTrackHom ι s) = fiveAlternatingHom ι s at hh + rw [hh,hs,B.initialConditional_input _ _ b.2.property.2] + rfl + rw [← he,← DFunLike.congr_fun (B.slotStar_distinct hlarge h hr R hR hwide + (initialTest a r b.1) ι d F (slots_injective_of_tracks _ _ ι.injective)) t] + exact B.slotGroup_mem hlarge h hr hwide _ _ _ _ t + +theorem slotGroup_eq_top : B.slotGroup hlarge h hr hwide=⊤ := by + apply top_unique + rw [← B.sourceAlignedGroup_univ_eq_top] + change alignedGroup B.t (fun b : SmallConditional m => PresentedGroup.of (Sum.inl b)) + (fun b => b.2.val.support ⊆ Finset.univ) ≤ _ + apply (Subgroup.closure_le _).mpr + rintro z ⟨b,_,k,rfl⟩ + exact B.translated_initial_mem_slotGroup hlarge h hr R hR hwide b k + +end InitialCoverSystem +end SlotInputGeneration + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Configurations/StabilizationComposition.lean b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/StabilizationComposition.lean new file mode 100644 index 0000000000000000000000000000000000000000..f0d549f074b1cfeaa79b3a26163e8c5a0c677d7b --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/StabilizationComposition.lean @@ -0,0 +1,98 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.PolygonCommutingRepresentatives +import OAI.GroupTheory.SimpleAmenable.Homology.FullGroupStability + +namespace OAI + +section + +section + +open Classical CategoryTheory CategoryTheory.Limits Representation Rep Finsupp +namespace SimpleAmenable + +namespace PolygonTracks +variable {a m n : ℕ} + +noncomputable def castFull (a : ℕ) {m n : ℕ} (h : m=n) : + polygonFullGroup a m ≃* polygonFullGroup a n := h ▸ MulEquiv.refl _ + +@[simp] lemma castFull_apply (h : m=n) (f : polygonFullGroup a m) (x : TrackPoint a m) : + (castFull a h f).val (Fin.cast h x.1,x.2)= + (Fin.cast h (f.val x).1,(f.val x).2) := by subst n; rfl + +lemma stabilize_add (a k l n : ℕ) : stabilize a (k+l) n = + (castFull a (Nat.add_assoc k l n).symm).toMonoidHom.comp + ((stabilize a k (l+n)).comp (stabilize a l n)) := by + let h : k+(l+n)=(k+l)+n := (Nat.add_assoc k l n).symm + apply MonoidHom.ext + intro f + apply Subtype.ext + apply Equiv.ext + intro x + obtain ⟨i,hi⟩ := (finCongr h).surjective x.1 + change (stabilize a (k+l) n f).val x = + (castFull a h (stabilize a k (l+n) (stabilize a l n f))).val x + have hx : x=(Fin.cast h i,x.2) := Prod.ext hi.symm rfl + rw [hx, castFull_apply (x:=(i,x.2))] + induction i using Fin.addCases with + | left i => + have he : Fin.cast h (i.castAdd (l+n))=(i.castAdd l).castAdd n := Fin.ext rfl + rw [he, stabilize_left (x:=((i.castAdd l),x.2)), stabilize_left (x:=(i,x.2))] + exact Prod.ext he.symm rfl + | right i => + rw [stabilize_right (x:=(i,x.2))] + induction i using Fin.addCases with + | left i => + have he : Fin.cast h ((i.castAdd n).natAdd k)=(i.natAdd k).castAdd n := Fin.ext rfl + rw [he, stabilize_left (x:=(i.natAdd k,x.2)), stabilize_left (x:=(i,x.2))] + exact Prod.ext he.symm rfl + | right i => + have he : Fin.cast h ((i.natAdd l).natAdd k)=i.natAdd (k+l) := by + apply Fin.ext + simp only [Fin.val_cast,Fin.val_natAdd] + omega + rw [he, stabilize_right (x:=(i,x.2)), stabilize_right (x:=(i,x.2))] + apply Prod.ext + · apply Fin.ext + simp only [Fin.val_cast,Fin.val_natAdd] + omega + · rfl + +lemma stabilize_zero_bijective (a n : ℕ) : Function.Bijective (stabilize a 0 n) := by + refine ⟨stabilize_injective,?_⟩ + intro f + let g : bankFixer a 0 n := ⟨f,fun x => Fin.elim0 x.1⟩ + exact ⟨restrict g,stabilize_restrict g⟩ + +lemma stabilize_H1_isIso (a k n : ℕ) (hn : 32 ≤ n) : + IsIso (TrivialHomology.map (stabilize a k n) 1) := by + induction k with + | zero => + exact TrivialHomology.isIso_equiv + (MulEquiv.ofBijective (stabilize a 0 n) (stabilize_zero_bijective a n)) 1 + | succ k ih => + have he : IsIso (TrivialHomology.map (stabilize a (1+k) n) 1) := by + rw [stabilize_add, TrivialHomology.map_comp, TrivialHomology.map_comp] + have := TrivialHomology.isIso_equiv (castFull a (Nat.add_assoc 1 k n).symm) 1 + have := PolygonPlacement.Configuration.stabilize_H1_isIso a (k+n) (by omega) + have := ih + infer_instance + rw [show k+1=1+k by omega] + exact he + +lemma stabilize_alternating_comap (a k n : ℕ) (hn : 32 ≤ n) : + (polygonAlternatingGroup a (k+n)).comap (stabilize a k n)=polygonAlternatingGroup a n := by + have := stabilize_H1_isIso a k n hn + rw [← polygonFullGroup_commutator_eq a n (by omega), + ← polygonFullGroup_commutator_eq a (k+n) (by omega)] + exact TrivialHomology.commutator_comap_of_mono (stabilize a k n) + +end PolygonTracks +end SimpleAmenable + +end + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Configurations/StageBinary.lean b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/StageBinary.lean new file mode 100644 index 0000000000000000000000000000000000000000..f28b88753a19b03f35283664ad30c5a37835be0d --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/StageBinary.lean @@ -0,0 +1,96 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Configurations.PolygonFixedReturn +import OAI.GroupTheory.SimpleAmenable.Homology.ReducedNatural +import OAI.GroupTheory.SimpleAmenable.Homology.BinaryPullback + +namespace OAI + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits MonoidalCategory Simplicial Opposite +namespace GroupNerveCoordinates +variable (G:Type) [Monoid G] +instance zero_subsingleton : Subsingleton ((nerve (SingleObj G)).obj (op ⦋0⦌)) := + ⟨fun _ _=>nerveEquiv.injective (Subsingleton.elim _ _)⟩ +instance connected : (nerve (SingleObj G)).IsConnected where + nonempty:=⟨nerveEquiv.symm (SingleObj.star G)⟩ + allEq x y:=by + obtain ⟨x,rfl⟩:=SSet.π₀.mk_surjective x + obtain ⟨y,rfl⟩:=SSet.π₀.mk_surjective y + congr 1 + exact Subsingleton.elim _ _ +end GroupNerveCoordinates +namespace SimpleAmenable.PolygonTracks +open FreeChains ComponentTranslation ComponentStable + +attribute [local instance 1200] Rep.hV2 Submodule.module +noncomputable def stageTranslate (a m:ℕ) (hm:32 ≤ m) : + Fiber (componentGenerator a^32) ⥤ Fiber (componentGenerator a^m) := + ComponentTranslation.translate (componentGenerator a^(m-32)) _ _ + (by rw [←pow_add,Nat.sub_add_cancel hm]) +lemma stageTranslate_H1_iso (a m:ℕ) (hm:32 ≤ m) : + IsIso (SSet.homologyMap (nerveMap (stageTranslate a m hm)) Z 1) := by + let F:=CofinalPowers.sequence (componentGenerator a) ⋙ homologyDiagram (C:=PolygonObject a) 1 + have h: F.IsEventuallyConstantFrom 32 := Functor.isEventuallyConstantFrom_of_succ F 32 (by + intro n hn + change IsIso ((homologyDiagram (C:=PolygonObject a) 1).map + ((CofinalPowers.sequence (componentGenerator a)).map (homOfLE (Nat.le_succ n)))) + rw [component_sequence_succ] + have successorIso := successor_H1_isIso a n hn + exact component_successor_isIso a n 1) + exact h (homOfLE hm) +noncomputable def fixedToStage (a m:ℕ) (hm:32 ≤ m) : + SingleObj (polygonFullGroup a 32) ⥤ SingleObj (polygonFullGroup a m) := + standardFiberInclusion a 32 ⋙ stageTranslate a m hm ⋙ (standardFiberInclusion a m).asEquivalence.inverse +lemma fixedToStage_H1_iso (a m:ℕ) (hm:32 ≤ m) : + IsIso (SSet.homologyMap (nerveMap (fixedToStage a m hm)) Z 1) := by + have sourceInclusionIso := NerveHomotopy.homologyMap_isIso (standardFiberInclusion a 32) Z 1 + have targetInverseIso := NerveHomotopy.homologyMap_isIso (standardFiberInclusion a m).asEquivalence.inverse Z 1 + have translationIso := stageTranslate_H1_iso a m hm + change IsIso (SSet.homologyMap + (nerveMap (standardFiberInclusion a 32) ≫ nerveMap (stageTranslate a m hm) ≫ + nerveMap (standardFiberInclusion a m).asEquivalence.inverse) Z 1) + simp only [SSet.homologyMap_comp] + infer_instance +noncomputable def fixedToStageGlobal (a m:ℕ) (hm:32 ≤ m) : + fixedToStage a m hm ⋙ standardNerveInclusion a m ≅ + standardNerveInclusion a 32 ⋙ tensorLeft (repr (componentGenerator a^(m-32))) := by + let e := (standardFiberInclusion a m).asEquivalence + let α := Functor.isoWhiskerLeft (standardFiberInclusion a 32 ⋙ stageTranslate a m hm) e.counitIso + exact Functor.isoWhiskerRight α (property (componentGenerator a^m)).ι +lemma stage_pullD (a n m:ℕ) (hn:32 ≤ n) (hm:32 ≤ m) : + SSet.homologyMap (nerveMap (fixedToStage a n hn)⊗ₘnerveMap (fixedToStage a m hm)) Z 2 ≫ + pullD (nerveMap (standardNerveInclusion a n)) (nerveMap (standardNerveInclusion a m)) 2 = + pullD (nerveMap (standardNerveInclusion a 32)) (nerveMap (standardNerveInclusion a 32)) 2 := by + rw [pullD_comp] + change pullD (nerveMap (fixedToStage a n hn ⋙ standardNerveInclusion a n)) + (nerveMap (fixedToStage a m hm ⋙ standardNerveInclusion a m)) 2 = _ + rw [pullD_congr (fixedToStageGlobal a n hn) (fixedToStageGlobal a m hm)] + change pullD (nerveMap (standardNerveInclusion a 32) ≫ nerveMap (tensorLeft _)) + (nerveMap (standardNerveInclusion a 32) ≫ nerveMap (tensorLeft _)) 2 = _ + rw [pullD_left,pullD_right] +noncomputable def mixedImage (a:ℕ) : Submodule ℤ (object (C:=PolygonObject a) 2) := + LinearMap.range ((pullD (nerveMap (standardNerveInclusion a 32)) + (nerveMap (standardNerveInclusion a 32)) 2).hom.comp + (LinearMap.ker (ConnectedProduct.projection (nerve (SingleObj (polygonFullGroup a 32))) + (nerve (SingleObj (polygonFullGroup a 32))) 2).hom).subtype) +lemma stage_value_mem (a n m:ℕ) (hn:32 ≤ n) (hm:32 ≤ m) + (z:((nerve (SingleObj (polygonFullGroup a n))⊗nerve (SingleObj (polygonFullGroup a m))).homology Z 2:A)) : + pullD (nerveMap (standardNerveInclusion a n)) (nerveMap (standardNerveInclusion a m)) 2 z ∈ mixedImage a := by + obtain ⟨w,hw,he⟩:=pullD_kernel_value (nerveMap (standardNerveInclusion a n)) + (nerveMap (standardNerveInclusion a m)) (nerveEquiv.symm (SingleObj.star _)) + (nerveEquiv.symm (SingleObj.star _)) 2 (by decide) z + have leftStageIso := fixedToStage_H1_iso a n hn + have rightStageIso := fixedToStage_H1_iso a m hm + obtain ⟨v,hv,hve⟩:=ConnectedProduct.kernel_map_surjective + (nerveMap (fixedToStage a n hn)) (nerveMap (fixedToStage a m hm)) w hw + refine ⟨⟨v,hv⟩,?_⟩ + have h:=congrArg (fun f=>f v) (stage_pullD a n m hn hm) + change pullD (nerveMap (standardNerveInclusion a n)) (nerveMap (standardNerveInclusion a m)) 2 + (SSet.homologyMap (nerveMap (fixedToStage a n hn)⊗ₘnerveMap (fixedToStage a m hm)) Z 2 v)=_ at h + rw [hve] at h + exact h.symm.trans he +end SimpleAmenable.PolygonTracks + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Configurations/StageDiagramCoverage.lean b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/StageDiagramCoverage.lean new file mode 100644 index 0000000000000000000000000000000000000000..c3863f4393682d741f9440cc8b83bdf81ac077a5 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/StageDiagramCoverage.lean @@ -0,0 +1,107 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Configurations.StageOrder + +namespace OAI + +section + +section +open CategoryTheory Classical MonoidalCategory +namespace SimpleAmenable.PolygonObject.LabelledStage.Stage +open IntervalBar IntervalBar.Diagram + +variable {a n : ℕ} {I : Type} [Preorder I] [Fintype I] +private abbrev Interval := {t : I×I // t.1≤t.2} +private abbrev Triple := {t : I×I×I // t.1≤t.2.1 ∧ t.2.1≤t.2.2} + +lemma exists_lift_diagram (A : Diagram (Labelled a n) I) : + ∃S : Stage a n, ∃B : Diagram S.Obj I,(Diagram.map S.forget).obj B=A := by + let κ := Interval (I:=I) ⊕ (Unit ⊕ Triple (I:=I)) + let τ := I ⊕ Triple (I:=I) + let U : κ → Labelled a n := Sum.elim + (fun q => A.obj q.val.1 q.val.2 q.property) + (Sum.elim (fun _ => 𝟙_ (Labelled a n)) + (fun q => A.obj q.val.1 q.val.2.1 q.property.1 ⊗ A.obj q.val.2.1 q.val.2.2 q.property.2)) + let src : τ → κ := Sum.elim (fun i => .inl ⟨(i,i),le_rfl⟩) (fun t => .inr (.inr t)) + let dst : τ → κ := Sum.elim (fun _ => .inr (.inl ())) + (fun t => .inl ⟨(t.val.1,t.val.2.2),t.property.1.trans t.property.2⟩) + let f : ∀t,U (src t) ⟶ U (dst t) := Sum.rec (fun i => (A.unit i).hom) + (fun q => (A.cut q.val.1 q.val.2.1 q.val.2.2 q.property.1 q.property.2).hom) + obtain ⟨S,hP,hL,hf⟩ := exists_lift_family U src dst f + let hP' := fun i j h => hP (.inl ⟨(i,j),h⟩) + let hL' := fun i j h => hL (.inl ⟨(i,j),h⟩) + let hU := fun i => hf (.inl i) + let hC := fun i j k hij hjk => hf (.inr ⟨(i,j,k),hij,hjk⟩) + exact ⟨S,liftDiagram S A hP' hL' hU hC,liftDiagram_map S A hP' hL' hU hC⟩ + +noncomputable def liftDiagramHom (S : Stage a n) {A B : Diagram (Labelled a n) I} + (hPA : ∀i j h,Labelled.ObjectUniform S.partition (A.obj i j h)) + (hLA : ∀i j h t,∃l,S.L l=(A.obj i j h).label t) + (hUA : ∀i,Labelled.ArrowUniform S.partition (A.unit i).hom) + (hCA : ∀i j k hij hjk,Labelled.ArrowUniform S.partition (A.cut i j k hij hjk).hom) + (hPB : ∀i j h,Labelled.ObjectUniform S.partition (B.obj i j h)) + (hLB : ∀i j h t,∃l,S.L l=(B.obj i j h).label t) + (hUB : ∀i,Labelled.ArrowUniform S.partition (B.unit i).hom) + (hCB : ∀i j k hij hjk,Labelled.ArrowUniform S.partition (B.cut i j k hij hjk).hom) + (f : A ⟶ B) (hf : ∀i j h,Labelled.ArrowUniform S.partition (f.app i j h)) : + liftDiagram S A hPA hLA hUA hCA ⟶ liftDiagram S B hPB hLB hUB hCB where + app i j h := ⟨f.app i j h,hf i j h⟩ + unit i := UniformObject.Hom.ext _ _ (f.unit i) + cut i j k hij hjk := UniformObject.Hom.ext _ _ (f.cut i j k hij hjk) + +theorem exists_lift_diagram_family {K : Type} [Category.{0} K] [Fintype K] + [∀i j:K,Fintype (i ⟶ j)] (F : K ⥤ Diagram (Labelled a n) I) : + ∃S : Stage a n,∃G : K ⥤ Diagram S.Obj I,G ⋙ Diagram.map S.forget=F := by + let V := K × (Interval (I:=I) ⊕ (Unit ⊕ Triple (I:=I))) + let Arr := (K × (I ⊕ Triple (I:=I))) ⊕ ((Σk:K,Σl:K,k ⟶ l) × Interval (I:=I)) + let U : V → Labelled a n := fun v => Sum.elim + (fun q => (F.obj v.1).obj q.val.1 q.val.2 q.property) + (Sum.elim (fun _ => 𝟙_ (Labelled a n)) + (fun q => (F.obj v.1).obj q.val.1 q.val.2.1 q.property.1 ⊗ + (F.obj v.1).obj q.val.2.1 q.val.2.2 q.property.2)) v.2 + let src : Arr → V := Sum.elim + (fun v => (v.1,Sum.elim (fun i => .inl ⟨(i,i),le_rfl⟩) (fun t => .inr (.inr t)) v.2)) + (fun v => (v.1.1,.inl v.2)) + let dst : Arr → V := Sum.elim + (fun v => (v.1,Sum.elim (fun _ => .inr (.inl ())) + (fun t => .inl ⟨(t.val.1,t.val.2.2),t.property.1.trans t.property.2⟩) v.2)) + (fun v => (v.1.2.1,.inl v.2)) + let f : ∀t,U (src t) ⟶ U (dst t) := by + intro t + rcases t with ⟨k,i|q⟩ | v + · exact ((F.obj k).unit i).hom + · exact ((F.obj k).cut q.val.1 q.val.2.1 q.val.2.2 q.property.1 q.property.2).hom + · exact (F.map v.1.2.2).app v.2.val.1 v.2.val.2 v.2.property + obtain ⟨S,hP,hL,hf⟩ := exists_lift_family U src dst f + let p := fun k i j h => hP (k,.inl ⟨(i,j),h⟩) + let l := fun k i j h => hL (k,.inl ⟨(i,j),h⟩) + let u := fun k i => hf (.inl (k,.inl i)) + let c := fun k i j z hij hjz => hf (.inl (k,.inr ⟨(i,j,z),hij,hjz⟩)) + let G : K ⥤ Diagram S.Obj I := { + obj k := liftDiagram S (F.obj k) (p k) (l k) (u k) (c k) + map {k z} g := liftDiagramHom S (p k) (l k) (u k) (c k) (p z) (l z) (u z) (c z) + (F.map g) (fun i j h => hf (.inr (⟨k,z,g⟩,⟨(i,j),h⟩))) + map_id k := by + apply Hom.ext; intro i j h + apply UniformObject.Hom.ext + change (F.map (𝟙 k)).app i j h=𝟙 _ + rw [F.map_id]; rfl + map_comp g h := by + apply Hom.ext; intro i j hij + apply UniformObject.Hom.ext + change (F.map (g≫h)).app i j hij=(F.map g).app i j hij≫(F.map h).app i j hij + rw [F.map_comp]; rfl } + refine ⟨S,G,?_⟩ + refine CategoryTheory.Functor.ext (fun k => liftDiagram_map S (F.obj k) (p k) (l k) (u k) (c k)) ?_ + intro k z g + apply Hom.ext; intro i j h + simp only [Functor.comp_map, comp_app, Diagram.eqToHom_app] + change (F.map g).app i j h = 𝟙 _ ≫ (F.map g).app i j h ≫ 𝟙 _ + simp +end SimpleAmenable.PolygonObject.LabelledStage.Stage + +end + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Configurations/StageEvaluationEquiv.lean b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/StageEvaluationEquiv.lean new file mode 100644 index 0000000000000000000000000000000000000000..a38354608351475b50d8454704b1acadb928b550 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/StageEvaluationEquiv.lean @@ -0,0 +1,64 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Configurations.StageRealization +import OAI.GroupTheory.SimpleAmenable.Configurations.StageFiberSum + +namespace OAI + +section + +section +open CategoryTheory Classical MonoidalCategory +namespace SimpleAmenable.PolygonObject.LabelledStage + +variable {a n s : ℕ} (P : BooleanPartition a) (L : Fin s → Fin n → CutRing × CutRing) + (hL : ∀ j i, orbitRepresentative (L j i)=L j i) (hLi : Function.Injective L) +open UniformObject +lemma fiberMap_realize {U V : Obj P (s:=s)} (f : U ⟶ V) (b : Fin P.size × Fin s) + (x : Fin (U b).size) : + fiberMap ((realize P L hL).map f) b (fiberPoint P L hL U b x)=fiberPoint P L hL V b (f b x) := by + apply Subtype.ext + apply Subtype.ext + apply Prod.ext + · change indexMap P L hL f (index P U ⟨b,x⟩)=index P V ⟨b,f b x⟩ + change (index P V) ((trackMap P f) ((index P U).symm ((index P U) ⟨b,x⟩)))=_ + rw [Equiv.symm_apply_apply] + rfl + · rfl +noncomputable def evaluationRealize : 𝟭 (Obj P (s:=s)) ≅ realize P L hL ⋙ evaluation := by + refine NatIso.ofComponents (fun U => asIso (show U ⟶ E.obj ((realize P L hL).obj U) from + fun b => (fiberEquiv P L hL hLi U b).trans (enumerate ((realize P L hL).obj U) b))) ?_ + intro U V f + funext b + apply Equiv.ext + intro x + change enumerate ((realize P L hL).obj V) b (fiberPoint P L hL V b (f b x))= + E.map ((realize P L hL).map f) b (enumerate ((realize P L hL).obj U) b (fiberPoint P L hL U b x)) + exact ((E_map_enum ((realize P L hL).map f) b (fiberPoint P L hL U b x)).trans + (congrArg (enumerate ((realize P L hL).obj V) b) (fiberMap_realize P L hL f b x))).symm + +include hL hLi + +theorem evaluationEssSurj : (evaluation (P:=P) (L:=L)).EssSurj := { + mem_essImage U := ⟨(realize P L hL).obj U,⟨(evaluationRealize P L hL hLi).app U |>.symm⟩⟩ } + +theorem evaluationFull : (evaluation (P:=P) (L:=L)).Full := by + let R := realize P L hL + have : R.EssSurj := realize_essSurj P L hL hLi + have : (R ⋙ evaluation (P:=P) (L:=L)).IsEquivalence := + Functor.isEquivalence_of_iso (evaluationRealize P L hL hLi) + apply Functor.full_of_comp_essSurj (evaluation (P:=P) (L:=L)) R + intro X Y φ + refine ⟨R.map ((R ⋙ evaluation).preimage φ), ?_⟩ + exact (R ⋙ evaluation).map_preimage φ + +theorem evaluationIsEquivalence : (evaluation (P:=P) (L:=L)).IsEquivalence := { + faithful := inferInstance + full := evaluationFull P L hL hLi + essSurj := evaluationEssSurj P L hL hLi } +end SimpleAmenable.PolygonObject.LabelledStage + +end + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Configurations/StageFiberSum.lean b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/StageFiberSum.lean new file mode 100644 index 0000000000000000000000000000000000000000..f5d60d73f851471bd90204fedf0cafcdc6a698cc --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/StageFiberSum.lean @@ -0,0 +1,157 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.UniformMonoidal +import OAI.GroupTheory.SimpleAmenable.Simplicial.FiniteSetMonoidal + +namespace OAI + +section + +section +open CategoryTheory Classical MonoidalCategory +namespace SimpleAmenable.PolygonObject.LabelledStage.UniformObject + +variable {a n s : ℕ} {P : BooleanPartition a} {L : Fin s → Fin n → CutRing × CutRing} +variable (U V : UniformObject P L) (b : Fin P.size × Fin s) +noncomputable def fiberSumFun : Fiber U b ⊕ Fiber V b → Fiber (sum U V) b + | .inl x => ⟨sumPointEquiv U.obj.polygon V.obj.polygon (.inl x.val),by + simpa only [sumPointEquiv_inl] using x.property.1,by + simpa only [sum,Labelled.sum,sumPointEquiv_inl,Fin.addCases_left] using x.property.2⟩ + | .inr y => ⟨sumPointEquiv U.obj.polygon V.obj.polygon (.inr y.val),by + simpa only [sumPointEquiv_inr] using y.property.1,by + simpa only [sum,Labelled.sum,sumPointEquiv_inr,Fin.addCases_right] using y.property.2⟩ +noncomputable def fiberSum : Fiber U b ⊕ Fiber V b ≃ Fiber (sum U V) b := + Equiv.ofBijective (fiberSumFun U V b) ⟨by + intro x y h + have h' := congrArg Subtype.val h + cases x <;> cases y + · exact congrArg Sum.inl (Subtype.ext (Sum.inl.inj ((sumPointEquiv _ _).injective h'))) + · cases ((sumPointEquiv _ _).injective h') + · cases ((sumPointEquiv _ _).injective h') + · exact congrArg Sum.inr (Subtype.ext (Sum.inr.inj ((sumPointEquiv _ _).injective h'))),by + intro z + obtain ⟨x,hx⟩ := (sumPointEquiv U.obj.polygon V.obj.polygon).surjective z.val + cases x with + | inl x => + have hp : x.val.2=P.point b.1 ∧ U.obj.label x.val.1=L b.2 := by + simpa only [←hx,sumPointEquiv_inl,sum,Labelled.sum,Fin.addCases_left] using z.property + exact ⟨.inl ⟨x,hp⟩,Subtype.ext hx⟩ + | inr x => + have hp : x.val.2=P.point b.1 ∧ V.obj.label x.val.1=L b.2 := by + simpa only [←hx,sumPointEquiv_inr,sum,Labelled.sum,Fin.addCases_right] using z.property + exact ⟨.inr ⟨x,hp⟩,Subtype.ext hx⟩⟩ +@[simp] lemma fiberSum_inl (x : Fiber U b) : + (fiberSum U V b (.inl x)).val=sumPointEquiv U.obj.polygon V.obj.polygon (.inl x.val) := rfl +@[simp] lemma fiberSum_inr (x : Fiber V b) : + (fiberSum U V b (.inr x)).val=sumPointEquiv U.obj.polygon V.obj.polygon (.inr x.val) := rfl + +noncomputable abbrev E := evaluation (P:=P) (L:=L) +noncomputable def enumerate (U : UniformObject P L) (b : Fin P.size × Fin s) : Fiber U b ≃ Fin (E.obj U b).size := Fintype.equivFin (Fiber U b) +@[simp] lemma E_map_enum {U V : UniformObject P L} (f : U ⟶ V) (b : Fin P.size × Fin s) (x : Fiber U b) : + E.map f b (enumerate U b x)=enumerate V b (fiberMap f b x) := by + change enumerate V b (fiberMap f b ((enumerate U b).symm (enumerate U b x)))=_ + rw [Equiv.symm_apply_apply] +noncomputable def mu (U V : UniformObject P L) : E.obj U ⊗ E.obj V ⟶ E.obj (U⊗V) := fun b => + (FiniteSetGroupoid.sumEquiv _ _).symm.trans + ((Equiv.sumCongr (enumerate U b).symm (enumerate V b).symm).trans + ((fiberSum U V b).trans (enumerate (sum U V) b))) +@[simp] lemma mu_inl (x : Fiber U b) : + mu U V b (FiniteSetGroupoid.sumEquiv _ _ (.inl (enumerate U b x)))= + enumerate (sum U V) b (fiberSum U V b (.inl x)) := by + change (enumerate (sum U V) b) ((fiberSum U V b) ((Equiv.sumCongr (enumerate U b).symm (enumerate V b).symm) + ((FiniteSetGroupoid.sumEquiv (E.obj U b) (E.obj V b)).symm + ((FiniteSetGroupoid.sumEquiv (E.obj U b) (E.obj V b)) _)))) = _ + rw [Equiv.symm_apply_apply] + simp only [Equiv.sumCongr_apply,Sum.map_inl,Equiv.symm_apply_apply] +@[simp] lemma mu_inr (x : Fiber V b) : + mu U V b (FiniteSetGroupoid.sumEquiv _ _ (.inr (enumerate V b x)))= + enumerate (sum U V) b (fiberSum U V b (.inr x)) := by + change (enumerate (sum U V) b) ((fiberSum U V b) ((Equiv.sumCongr (enumerate U b).symm (enumerate V b).symm) + ((FiniteSetGroupoid.sumEquiv (E.obj U b) (E.obj V b)).symm + ((FiniteSetGroupoid.sumEquiv (E.obj U b) (E.obj V b)) _)))) = _ + rw [Equiv.symm_apply_apply] + simp only [Equiv.sumCongr_apply,Sum.map_inr,Equiv.symm_apply_apply] +lemma fiberMap_sum_inl {U V W Z : UniformObject P L} (f : U ⟶ W) (g : V ⟶ Z) + (b : Fin P.size × Fin s) (x : Fiber U b) : + fiberMap (sumHom f g) b (fiberSum U V b (.inl x))= + fiberSum W Z b (.inl (fiberMap f b x)) := by + apply Subtype.ext + exact sumArrow_inl f.arrow.arrow g.arrow.arrow x.val +lemma fiberMap_sum_inr {U V W Z : UniformObject P L} (f : U ⟶ W) (g : V ⟶ Z) + (b : Fin P.size × Fin s) (x : Fiber V b) : + fiberMap (sumHom f g) b (fiberSum U V b (.inr x))= + fiberSum W Z b (.inr (fiberMap g b x)) := by + apply Subtype.ext + exact sumArrow_inr f.arrow.arrow g.arrow.arrow x.val +end SimpleAmenable.PolygonObject.LabelledStage.UniformObject + +end + +section +open CategoryTheory Classical MonoidalCategory +namespace SimpleAmenable.PolygonObject.LabelledStage.UniformObject + +variable {a n s : ℕ} {P : BooleanPartition a} {L : Fin s → Fin n → CutRing × CutRing} +instance fiberEmpty (b : Fin P.size × Fin s) : IsEmpty (Fiber (empty (P:=P) (L:=L)) b) := + ⟨fun x => isEmptyElim x.val⟩ +noncomputable def eps : 𝟙_ (Obj P (s:=s)) ⟶ E.obj (𝟙_ (UniformObject P L)) := fun b => + (Equiv.equivOfIsEmpty (Fin 0) (Fiber empty b)).trans (enumerate empty b) +@[simp] lemma fiberMap_id (U : UniformObject P L) (b : Fin P.size × Fin s) (x : Fiber U b) : + fiberMap (𝟙 U) b x=x := rfl +lemma mu_natural {U V W Z : UniformObject P L} (f : U ⟶ W) (g : V ⟶ Z) : + (E.map f ⊗ₘ E.map g) ≫ mu W Z = mu U V ≫ E.map (f⊗ₘg) := by + funext b + apply Equiv.ext + intro x + obtain ⟨x,rfl⟩ := (FiniteSetGroupoid.sumEquiv (E.obj U b) (E.obj V b)).surjective x + cases x with + | inl x => + obtain ⟨x,rfl⟩ := (enumerate U b).surjective x + change mu W Z b (FiniteSetGroupoid.sumHom (E.map f b) (E.map g b) _) = E.map (sumHom f g) b _ + rw [FiniteSetGroupoid.sumHom_inl,E_map_enum,mu_inl,mu_inl,E_map_enum,fiberMap_sum_inl] + | inr x => + obtain ⟨x,rfl⟩ := (enumerate V b).surjective x + change mu W Z b (FiniteSetGroupoid.sumHom (E.map f b) (E.map g b) _) = E.map (sumHom f g) b _ + rw [FiniteSetGroupoid.sumHom_inr,E_map_enum,mu_inr,mu_inr,E_map_enum,fiberMap_sum_inr] + +variable (U V W : UniformObject P L) (b : Fin P.size × Fin s) +@[simp] lemma fiber_assoc_left (x : Fiber U b) : + fiberMap (assocHom U V W) b (fiberSum (sum U V) W b (.inl (fiberSum U V b (.inl x))))= + fiberSum U (sum V W) b (.inl x) := by + apply Subtype.ext + change sumAssocEquiv U.obj.polygon V.obj.polygon W.obj.polygon _ = _ + exact sumAssocEquiv_left _ _ _ x.val +@[simp] lemma fiber_assoc_mid (x : Fiber V b) : + fiberMap (assocHom U V W) b (fiberSum (sum U V) W b (.inl (fiberSum U V b (.inr x))))= + fiberSum U (sum V W) b (.inr (fiberSum V W b (.inl x))) := by + apply Subtype.ext + change sumAssocEquiv U.obj.polygon V.obj.polygon W.obj.polygon _ = _ + exact sumAssocEquiv_mid _ _ _ x.val +@[simp] lemma fiber_assoc_right (x : Fiber W b) : + fiberMap (assocHom U V W) b (fiberSum (sum U V) W b (.inr x))= + fiberSum U (sum V W) b (.inr (fiberSum V W b (.inr x))) := by + apply Subtype.ext + change sumAssocEquiv U.obj.polygon V.obj.polygon W.obj.polygon _ = _ + exact sumAssocEquiv_right _ _ _ x.val +@[simp] lemma fiber_left (x : Fiber U b) : + fiberMap (leftHom U) b (fiberSum empty U b (.inr x))=x := by + apply Subtype.ext + exact leftUnitEquiv_apply _ x.val +@[simp] lemma fiber_right (x : Fiber U b) : + fiberMap (rightHom U) b (fiberSum U empty b (.inl x))=x := by + apply Subtype.ext + exact rightUnitEquiv_apply _ x.val +@[simp] lemma fiber_swap_left (x : Fiber U b) : + fiberMap (swapHom U V) b (fiberSum U V b (.inl x))=fiberSum V U b (.inr x) := by + apply Subtype.ext + exact sumSwapEquiv_inl _ _ x.val +@[simp] lemma fiber_swap_right (x : Fiber V b) : + fiberMap (swapHom U V) b (fiberSum U V b (.inr x))=fiberSum V U b (.inl x) := by + apply Subtype.ext + exact sumSwapEquiv_inr _ _ x.val +end SimpleAmenable.PolygonObject.LabelledStage.UniformObject + +end + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Configurations/StageIteratedMaps2.lean b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/StageIteratedMaps2.lean new file mode 100644 index 0000000000000000000000000000000000000000..d5b1930ddc37a1c2fc642104af3473eb134168a3 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/StageIteratedMaps2.lean @@ -0,0 +1,137 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.IntervalPullback +import OAI.GroupTheory.SimpleAmenable.Simplicial.StageNerveColimit + +namespace OAI + +section + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory MonoidalCategory +namespace SimpleAmenable.PolygonObject.LabelledStage.Stage +open IntervalBar IntervalBar.Diagram + +variable {a n : ℕ} {I J K : Type} [Preorder I] [Preorder J] [Preorder K] +lemma map₂_inclusion_id (S : Stage a n) : + Diagram.map (I:=J) (Diagram.map (I:=I) (inclusion (le_refl S)))=𝟭 _ := by + have he (X : Diagram S.Obj I) : mapObj (inclusion (le_refl S)) X=X := + congrArg (fun F => F.obj X) (map_inclusion_id S) + refine CategoryTheory.Functor.ext (fun A => ?_) ?_ + · refine ext_heq ?_ ?_ ?_ + · funext i j h; exact he _ + · apply hfunext; intro i + apply iso_hext (he _) rfl + apply hom_hext (he _) rfl + intro j k h + apply heq_of_eq + change (inclusion (le_refl S)).map ((A.unit i).hom.app j k h) ≫ + (Functor.OplaxMonoidal.η (Diagram.map (I:=I) (inclusion (le_refl S)))).app j k h = + (A.unit i).hom.app j k h + rw [map_η_app,inclusion_η] + apply UniformObject.Hom.ext + exact Category.comp_id _ + · apply hfunext; intro i + apply hfunext; intro j + apply hfunext; intro k + apply hfunext; intro hij + apply hfunext; intro hjk + apply iso_hext (congrArg₂ (fun X Y => X ⊗ Y) (he _) (he _)) (he _) + apply hom_hext (congrArg₂ (fun X Y => X ⊗ Y) (he _) (he _)) (he _) + intro l m h + simp [mapObj]; rfl + · intro A B f + apply Hom.ext; intro i j h + apply Hom.ext; intro k l hkl + simp only [comp_app,Diagram.eqToHom_app] + change (f.app i j h).app k l hkl = 𝟙 _ ≫ (f.app i j h).app k l hkl ≫ 𝟙 _ + simp +lemma map₂_inclusion_comp_obj {S T U : Stage a n} (h : S≤T) (k : T≤U) + (A : Diagram (Diagram S.Obj I) J) : + mapObj (Diagram.map (I:=I) (inclusion (h.trans k))) A = + mapObj (Diagram.map (inclusion k)) (mapObj (Diagram.map (inclusion h)) A) := by + have he (X : Diagram S.Obj I) : mapObj (inclusion (h.trans k)) X= + mapObj (inclusion k) (mapObj (inclusion h) X) := + congrArg (fun F => F.obj X) (map_inclusion_comp h k) + refine ext_heq ?_ ?_ ?_ + · funext i j h; exact he _ + · apply hfunext; intro i + apply iso_hext (he _) rfl + apply hom_hext (he _) rfl + intro first last ordered + apply heq_of_eq + change (inclusion (h.trans k)).map ((A.unit i).hom.app first last ordered) ≫ + (Functor.OplaxMonoidal.η (Diagram.map (I:=I) (inclusion (h.trans k)))).app first last ordered = + (inclusion k).map ((inclusion h).map ((A.unit i).hom.app first last ordered) ≫ + (Functor.OplaxMonoidal.η (Diagram.map (I:=I) (inclusion h))).app first last ordered) ≫ + (Functor.OplaxMonoidal.η (Diagram.map (I:=I) (inclusion k))).app first last ordered + simp only [map_η_app,inclusion_η] + rfl + · apply hfunext; intro i + apply hfunext; intro j + apply hfunext; intro k + apply hfunext; intro hij + apply hfunext; intro hjk + apply iso_hext (congrArg₂ (fun X Y => X ⊗ Y) (he _) (he _)) (he _) + apply hom_hext (congrArg₂ (fun X Y => X ⊗ Y) (he _) (he _)) (he _) + intro l m h + simp [mapObj]; rfl +lemma map₂_inclusion_comp {S T U : Stage a n} (h : S≤T) (k : T≤U) : + Diagram.map (I:=J) (Diagram.map (I:=I) (inclusion (h.trans k)))= + Diagram.map (Diagram.map (inclusion h)) ⋙ Diagram.map (Diagram.map (inclusion k)) := by + refine CategoryTheory.Functor.hext (map₂_inclusion_comp_obj h k) ?_ + intro A B f + apply hom_hext (map₂_inclusion_comp_obj h k A) (map₂_inclusion_comp_obj h k B) + intro i j hij + apply hom_hext + (congrArg (fun F => F.obj (A.obj i j hij)) (map_inclusion_comp h k)) + (congrArg (fun F => F.obj (B.obj i j hij)) (map_inclusion_comp h k)) + intro l m hlm + rfl +lemma map₂_inclusion_forget_obj {S T : Stage a n} (h : S≤T) + (A : Diagram (Diagram S.Obj I) J) : + mapObj (Diagram.map T.forget) (mapObj (Diagram.map (I:=I) (inclusion h)) A)= + mapObj (Diagram.map S.forget) A := by + have he (X : Diagram S.Obj I) : mapObj T.forget (mapObj (inclusion h) X)=mapObj S.forget X := + congrArg (fun F => F.obj X) (map_inclusion_forget h) + refine ext_heq ?_ ?_ ?_ + · funext i j h; exact he _ + · apply hfunext; intro i + apply iso_hext (he _) rfl + apply hom_hext (he _) rfl + intro first last ordered + apply heq_of_eq + change T.forget.map ((inclusion h).map ((A.unit i).hom.app first last ordered) ≫ + (Functor.OplaxMonoidal.η (Diagram.map (I:=I) (inclusion h))).app first last ordered) ≫ + (Functor.OplaxMonoidal.η (Diagram.map (I:=I) T.forget)).app first last ordered = + S.forget.map ((A.unit i).hom.app first last ordered) ≫ + (Functor.OplaxMonoidal.η (Diagram.map (I:=I) S.forget)).app first last ordered + simp only [map_η_app,inclusion_η,forget_η] + rfl + · apply hfunext; intro i + apply hfunext; intro j + apply hfunext; intro k + apply hfunext; intro hij + apply hfunext; intro hjk + apply iso_hext (congrArg₂ (fun X Y => X ⊗ Y) (he _) (he _)) (he _) + apply hom_hext (congrArg₂ (fun X Y => X ⊗ Y) (he _) (he _)) (he _) + intro l m h + simp [mapObj]; rfl +lemma map₂_inclusion_forget {S T : Stage a n} (h : S≤T) : + Diagram.map (I:=J) (Diagram.map (I:=I) (inclusion h)) ⋙ + Diagram.map (Diagram.map T.forget)=Diagram.map (Diagram.map S.forget) := by + refine CategoryTheory.Functor.hext (map₂_inclusion_forget_obj h) ?_ + intro A B f + apply hom_hext (map₂_inclusion_forget_obj h A) (map₂_inclusion_forget_obj h B) + intro i j hij + apply hom_hext + (congrArg (fun F => F.obj (A.obj i j hij)) (map_inclusion_forget h)) + (congrArg (fun F => F.obj (B.obj i j hij)) (map_inclusion_forget h)) + intro l m hlm + rfl +end SimpleAmenable.PolygonObject.LabelledStage.Stage + +end + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Configurations/StageOrder.lean b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/StageOrder.lean new file mode 100644 index 0000000000000000000000000000000000000000..1fbfa1467e3d4fe28959ee8c7bb76b84a87a932b --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/StageOrder.lean @@ -0,0 +1,184 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.IntervalFunctor +import OAI.GroupTheory.SimpleAmenable.Configurations.TrajectoryStages +import OAI.GroupTheory.SimpleAmenable.Simplicial.UniformMonoidal + +namespace OAI + +section + +section +open CategoryTheory Classical Set +namespace SimpleAmenable.PolygonObject + +namespace BooleanPartition +variable {a : ℕ} +def Refines (P Q : BooleanPartition a) : Prop := + ∀x y,Q.color x=Q.color y → P.color x=P.color y +lemma refines_refl (P : BooleanPartition a) : Refines P P := fun _ _ h => h +lemma refines_trans {P Q T : BooleanPartition a} (h : Refines P Q) (k : Refines Q T) : + Refines P T := fun x y e => h x y (k x y e) +noncomputable def join (P Q : BooleanPartition a) : BooleanPartition a := + generated (Sum.elim P.cell Q.cell) +lemma le_join_left (P Q : BooleanPartition a) : Refines P (join P Q) := by + intro x y h + have e := generated_constant (Sum.elim P.cell Q.cell) h (Sum.inl (P.color x)) + exact ((e.mp rfl).symm) +lemma le_join_right (P Q : BooleanPartition a) : Refines Q (join P Q) := by + intro x y h + have e := generated_constant (Sum.elim P.cell Q.cell) h (Sum.inr (Q.color x)) + exact ((e.mp rfl).symm) +end BooleanPartition +namespace LabelledStage +abbrev ReducedLabel (n : ℕ) := {l : Fin n → CutRing × CutRing // ∀i,orbitRepresentative (l i)=l i} +structure Stage (a n : ℕ) where + partition : BooleanPartition a + support : Finset (ReducedLabel n) +namespace Stage +variable {a n : ℕ} +noncomputable def empty : Stage a n := ⟨BooleanPartition.generated (fun x : Fin 0 => Fin.elim0 x),∅⟩ +instance : Nonempty (Stage a n) := ⟨empty⟩ +noncomputable instance : Preorder (Stage a n) where + le S T := S.partition.Refines T.partition ∧ S.support ⊆ T.support + le_refl S := ⟨BooleanPartition.refines_refl _,Subset.rfl⟩ + le_trans S T U h k := ⟨BooleanPartition.refines_trans h.1 k.1,Subset.trans h.2 k.2⟩ +noncomputable def sup (S T : Stage a n) : Stage a n := + ⟨S.partition.join T.partition,S.support ∪ T.support⟩ +lemma le_sup_left (S T : Stage a n) : S ≤ sup S T := + ⟨BooleanPartition.le_join_left _ _,Finset.subset_union_left⟩ +lemma le_sup_right (S T : Stage a n) : T ≤ sup S T := + ⟨BooleanPartition.le_join_right _ _,Finset.subset_union_right⟩ +noncomputable instance : IsDirectedOrder (Stage a n) where + directed S T := ⟨sup S T,le_sup_left S T,le_sup_right S T⟩ +noncomputable instance : IsFiltered (Stage a n) := inferInstance +noncomputable abbrev L (S : Stage a n) : Fin S.support.card → Fin n → CutRing × CutRing := + fun i => ((Fintype.equivFin S.support).symm (Fin.cast (by simp) i)).val.val +lemma L_reduced (S : Stage a n) : ∀j i,orbitRepresentative (S.L j i)=S.L j i := + fun j => ((Fintype.equivFin S.support).symm (Fin.cast (by simp) j)).val.property +lemma L_injective (S : Stage a n) : Function.Injective S.L := by + intro i j h + have h' := (Fintype.equivFin S.support).symm.injective (Subtype.ext (Subtype.ext h)) + exact Fin.ext (show i.val=j.val from congrArg (fun x : Fin (Fintype.card S.support) => x.val) h') +lemma label_mem (S : Stage a n) (l : Fin n → CutRing × CutRing) (hl : ∀i,orbitRepresentative (l i)=l i) : + (∃j,S.L j=l) ↔ (⟨l,hl⟩ : ReducedLabel n)∈S.support := by + constructor + · rintro ⟨j,hj⟩ + have hm := ((Fintype.equivFin S.support).symm (Fin.cast (by simp) j)).property + convert hm using 1 + exact Subtype.ext hj.symm + · intro h + refine ⟨Fin.cast (by simp) (Fintype.equivFin S.support ⟨⟨l,hl⟩,h⟩),?_⟩ + simp [L] +noncomputable abbrev Obj (S : Stage a n) := UniformObject S.partition S.L +noncomputable def inclusion {S T : Stage a n} (h : S≤T) : S.Obj ⥤ T.Obj where + obj U := { + obj := U.obj + uniform := fun j x y hxy => U.uniform j x y (h.1 x y hxy) + supported := fun j => (label_mem T _ (U.obj.reduced j)).mpr + (h.2 ((label_mem S _ (U.obj.reduced j)).mp (U.supported j))) } + map f := ⟨f.arrow,fun x y hxy hP => f.uniform x y hxy (h.1 _ _ hP)⟩ + map_id _ := rfl + map_comp _ _ := rfl +lemma inclusion_id (S : Stage a n) : inclusion (le_refl S)=𝟭 S.Obj := by + refine CategoryTheory.Functor.ext (fun U => ?_) ?_ + · cases U; rfl + · intro X Y f; rfl +lemma inclusion_comp {S T U : Stage a n} (h : S≤T) (k : T≤U) : + inclusion (h.trans k)=inclusion h ⋙ inclusion k := by + refine CategoryTheory.Functor.ext (fun X => ?_) ?_ + · cases X; rfl + · intro X Y f; rfl +noncomputable def diagram : Stage a n ⥤ Cat.{0,0} where + obj S := Cat.of S.Obj + map h := (inclusion (leOfHom h)).toCatHom + map_id S := by apply Cat.ext; exact inclusion_id S + map_comp h k := by apply Cat.ext; exact inclusion_comp (leOfHom h) (leOfHom k) +end Stage +end LabelledStage +end SimpleAmenable.PolygonObject + +end + +section +open CategoryTheory Classical Set MonoidalCategory +namespace SimpleAmenable.PolygonObject.LabelledStage + +namespace Stage +variable {a n : ℕ} +noncomputable abbrev forget (S : Stage a n) : S.Obj ⥤ Labelled a n := UniformObject.forget +@[simp] lemma forget_ε (S : Stage a n) : Functor.LaxMonoidal.ε S.forget=𝟙 _ := rfl +@[simp] lemma forget_η (S : Stage a n) : Functor.OplaxMonoidal.η S.forget=𝟙 _ := rfl +@[simp] lemma forget_μ (S : Stage a n) (U V : S.Obj) : Functor.LaxMonoidal.μ S.forget U V=𝟙 _ := rfl +lemma forget_injective (S : Stage a n) : Function.Injective S.forget.obj := by + intro U V h; cases U; cases V; cases h; rfl +lemma inclusion_forget {S T : Stage a n} (h : S≤T) : inclusion h ⋙ T.forget=S.forget := rfl +noncomputable def cocone : CategoryTheory.Limits.Cocone (diagram (a:=a) (n:=n)) where + pt := Cat.of (Labelled a n) + ι := { + app S := S.forget.toCatHom + naturality S T h := by apply Cat.ext; exact inclusion_forget (leOfHom h) } + +theorem exists_lift_family {κ τ : Type} [Fintype κ] [Fintype τ] + (U : κ → Labelled a n) (src dst : τ → κ) (f : ∀t,U (src t) ⟶ U (dst t)) : + ∃S : Stage a n, (∀k,Labelled.ObjectUniform S.partition (U k)) ∧ + (∀k j,∃l,S.L l=(U k).label j) ∧ (∀t,Labelled.ArrowUniform S.partition (f t)) := by + obtain ⟨P,hP,hf⟩ := Labelled.exists_uniform_partition U src dst f + let lab : (Σk,Fin (U k).polygon.tracks) → ReducedLabel n := fun kj => + ⟨(U kj.1).label kj.2,(U kj.1).reduced kj.2⟩ + let S : Stage a n := ⟨P,Finset.univ.image lab⟩ + refine ⟨S,hP,?_,hf⟩ + intro k j + apply (label_mem S _ ((U k).reduced j)).mpr + exact Finset.mem_image.mpr ⟨⟨k,j⟩,Finset.mem_univ _,rfl⟩ + +theorem exists_lift {I : Type} [Category.{0} I] [Finite I] [∀i j:I,Finite (i ⟶ j)] + (F : I ⥤ Labelled a n) : ∃S : Stage a n, ∃G : I ⥤ S.Obj,G ⋙ S.forget=F := by + let : Fintype I := Fintype.ofFinite I + let (i j : I) : Fintype (i ⟶ j) := Fintype.ofFinite (i ⟶ j) + let Ar := Σi:I,Σj:I,i ⟶ j + let u : Ar → I := fun t => t.1 + let v : Ar → I := fun t => t.2.1 + let f : ∀t:Ar,F.obj (u t) ⟶ F.obj (v t) := fun t => F.map t.2.2 + obtain ⟨S,hP,hL,hf⟩ := exists_lift_family F.obj u v f + let G : I ⥤ S.Obj := { + obj i := ⟨F.obj i,hP i,hL i⟩ + map g := ⟨F.map g,hf ⟨_,_,g⟩⟩ + map_id i := UniformObject.Hom.ext _ _ (F.map_id i) + map_comp g h := UniformObject.Hom.ext _ _ (F.map_comp g h) } + exact ⟨S,G,rfl⟩ + +open IntervalBar IntervalBar.Diagram +variable {I : Type} [Preorder I] (S : Stage a n) (A : Diagram (Labelled a n) I) +variable (hP : ∀i j h,Labelled.ObjectUniform S.partition (A.obj i j h)) + (hL : ∀i j h t,∃l,S.L l=(A.obj i j h).label t) + (hU : ∀i,Labelled.ArrowUniform S.partition (A.unit i).hom) + (hC : ∀i j k hij hjk,Labelled.ArrowUniform S.partition (A.cut i j k hij hjk).hom) +noncomputable def liftDiagram : Diagram S.Obj I where + obj i j h := ⟨A.obj i j h,hP i j h,hL i j h⟩ + unit i := asIso (show (⟨A.obj i i le_rfl,hP i i _,hL i i _⟩ : S.Obj) ⟶ 𝟙_ S.Obj from + ⟨(A.unit i).hom,hU i⟩) + cut i j k hij hjk := asIso (show + (⟨A.obj i j hij,hP i j hij,hL i j hij⟩ : S.Obj) ⊗ ⟨A.obj j k hjk,hP j k hjk,hL j k hjk⟩ ⟶ + ⟨A.obj i k (hij.trans hjk),hP i k _,hL i k _⟩ from ⟨(A.cut i j k hij hjk).hom,hC i j k hij hjk⟩) + left_unit i j h := UniformObject.Hom.ext _ _ (A.left_unit i j h) + right_unit i j h := UniformObject.Hom.ext _ _ (A.right_unit i j h) + associativity i j k l hij hjk hkl := UniformObject.Hom.ext _ _ (A.associativity i j k l hij hjk hkl) +lemma liftDiagram_map : + (Diagram.map S.forget).obj (liftDiagram S A hP hL hU hC)=A := by + refine ext_heq rfl ?_ ?_ + · apply heq_of_eq; funext i + apply Iso.ext + simp [liftDiagram] + rfl + · apply heq_of_eq; funext i j k hij hjk + apply Iso.ext + simp [liftDiagram] + rfl +end Stage +end SimpleAmenable.PolygonObject.LabelledStage + +end + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Configurations/StageRealization.lean b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/StageRealization.lean new file mode 100644 index 0000000000000000000000000000000000000000..f446de6678a1704ef9f386bd17697022206ef74a --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/StageRealization.lean @@ -0,0 +1,269 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Configurations.TrajectoryStages + +namespace OAI + +section + +section + +open CategoryTheory Classical Set +namespace SimpleAmenable.PolygonObject + +namespace LabelledStage +variable {a n s : ℕ} (P : BooleanPartition a) + (L : Fin s → Fin n → CutRing × CutRing) + (hL : ∀ j i, orbitRepresentative (L j i)=L j i) + +noncomputable def realizeObject (U : Obj P (s:=s)) : UniformObject P L where + obj := object P L hL U + uniform j x y h := by + change (P.color x=_) ↔ (P.color y=_) + rw [h] + supported j := ⟨_,rfl⟩ + +noncomputable def realize : Obj P (s:=s) ⥤ UniformObject P L where + obj := realizeObject P L hL + map f := ⟨arrow P L hL f,fun _ _ h _ => congrArg (indexMap P L hL f) h⟩ + map_id U := UniformObject.Hom.ext _ _ ((functor P L hL).map_id U) + map_comp f g := UniformObject.Hom.ext _ _ ((functor P L hL).map_comp f g) + +namespace UniformObject +variable {P L} +noncomputable def labelIndex (U : UniformObject P L) (j : Fin U.obj.polygon.tracks) : Fin s := + (U.supported j).choose +lemma labelIndex_spec (U : UniformObject P L) (j : Fin U.obj.polygon.tracks) : + L (labelIndex U j)=U.obj.label j := (U.supported j).choose_spec + +variable (hLi : Function.Injective L) +include hLi in +lemma labelIndex_fiber (U : UniformObject P L) {b : Fin P.size × Fin s} (y : Fiber U b) : + labelIndex U y.val.val.1=b.2 := hLi ((labelIndex_spec U _).trans y.property.2) + +noncomputable abbrev evaluated (U : UniformObject P L) := (evaluation (P:=P) (L:=L)).obj U + +noncomputable def fiberIndex (U : UniformObject P L) : + Fin (Fintype.card (Track P (evaluated U))) ≃ Σ b : Fin P.size × Fin s,Fiber U b := + (index P (evaluated U)).symm.trans + (Equiv.sigmaCongrRight (fun b => (Fintype.equivFin (Fiber U b)).symm)) + +noncomputable abbrev trackFiber (U : UniformObject P L) + (j : Fin (Fintype.card (Track P (evaluated U)))) := (fiberIndex U j).2 + +noncomputable def sourceAtom (U : UniformObject P L) (x : U.obj.polygon.Point) : Fin P.size × Fin s := + (P.color x.val.2,labelIndex U x.val.1) + +noncomputable def sample (U : UniformObject P L) (x : U.obj.polygon.Point) : Fiber U (sourceAtom U x) := + ⟨⟨(x.val.1,P.point (P.color x.val.2)), + (U.uniform x.val.1 x.val.2 (P.point (P.color x.val.2)) (by simp)).mp x.property⟩, + rfl,(labelIndex_spec U _).symm⟩ + +noncomputable def sourceIndex (U : UniformObject P L) (x : U.obj.polygon.Point) : + Fin (Fintype.card (Track P (evaluated U))) := + (fiberIndex U).symm ⟨sourceAtom U x,sample U x⟩ + +@[simp] lemma sourceIndex_atom (U : UniformObject P L) (x : U.obj.polygon.Point) : + ((index P (evaluated U)).symm (sourceIndex U x)).1=sourceAtom U x := by + change (fiberIndex U ((fiberIndex U).symm ⟨sourceAtom U x,sample U x⟩)).1=_ + rw [Equiv.apply_symm_apply] + +@[simp] lemma sourceIndex_track (U : UniformObject P L) (x : U.obj.polygon.Point) : + (trackFiber U (sourceIndex U x)).val.val.1=x.val.1 := by + change (fiberIndex U ((fiberIndex U).symm ⟨sourceAtom U x,sample U x⟩)).2.val.val.1=_ + rw [Equiv.apply_symm_apply] + rfl + +variable (P L) +noncomputable def reconstructMap (U : UniformObject P L) + (x : (object P L hL (evaluated U)).polygon.Point) : U.obj.polygon.Point := + ⟨((trackFiber U x.val.1).val.val.1,x.val.2),by + have h := (trackFiber U x.val.1).val.property + have hc : P.color (trackFiber U x.val.1).val.val.2=P.color x.val.2 := by + rw [(trackFiber U x.val.1).property.1,BooleanPartition.color_point] + exact x.property.symm + exact (U.uniform _ _ _ hc).mp h⟩ + +noncomputable def reconstructInverse (U : UniformObject P L) (x : U.obj.polygon.Point) : + (object P L hL (evaluated U)).polygon.Point := + ⟨(sourceIndex U x,x.val.2),by + change P.color x.val.2=((index P (evaluated U)).symm (sourceIndex U x)).1.1 + rw [sourceIndex_atom] + rfl⟩ + +lemma reconstruct_right (U : UniformObject P L) (x : U.obj.polygon.Point) : + reconstructMap P L hL U (reconstructInverse P L hL U x)=x := by + apply Subtype.ext + apply Prod.ext + · exact sourceIndex_track U x + · rfl + +include hLi in +lemma reconstruct_left (U : UniformObject P L) + (x : (object P L hL (evaluated U)).polygon.Point) : + reconstructInverse P L hL U (reconstructMap P L hL U x)=x := by + apply Subtype.ext + apply Prod.ext + · change sourceIndex U (reconstructMap P L hL U x)=x.val.1 + apply (fiberIndex U).injective + change fiberIndex U ((fiberIndex U).symm _) = _ + rw [Equiv.apply_symm_apply] + have hb : sourceAtom U (reconstructMap P L hL U x)=(fiberIndex U x.val.1).1 := by + apply Prod.ext + · exact x.property + · exact labelIndex_fiber hLi U (trackFiber U x.val.1) + apply Sigma.ext hb + apply (Subtype.heq_iff_coe_eq (by intro y; dsimp only; rw [hb])).mpr + apply Subtype.ext + apply Prod.ext + · rfl + · change P.point (P.color x.val.2)=(trackFiber U x.val.1).val.val.2 + rw [show P.color x.val.2=(fiberIndex U x.val.1).1.1 from x.property] + exact (trackFiber U x.val.1).property.1.symm + + · rfl + +noncomputable def reconstructEquiv (U : UniformObject P L) : + (object P L hL (evaluated U)).polygon.Point ≃ U.obj.polygon.Point where + toFun := reconstructMap P L hL U + invFun := reconstructInverse P L hL U + left_inv := reconstruct_left P L hL hLi U + right_inv := reconstruct_right P L hL U + +end UniformObject +end LabelledStage +end SimpleAmenable.PolygonObject + +end + +section + +open CategoryTheory Classical Set +namespace SimpleAmenable.PolygonObject + +namespace LabelledStage +variable {a n s : ℕ} (P : BooleanPartition a) + (L : Fin s → Fin n → CutRing × CutRing) + (hL : ∀ j i, orbitRepresentative (L j i)=L j i) + (hLi : Function.Injective L) + +namespace UniformObject +noncomputable def reconstruct (U : UniformObject P L) : + (realize P L hL).obj (evaluated U) ⟶ U where + arrow := { + arrow := relabelArrow (reconstructEquiv P L hL hLi U) + (fun j => (trackFiber U j).val.val.1) (fun _ => rfl) + positional := fun _ => rfl + labelled := fun x => (trackFiber U x.val.1).property.2 } + uniform := fun _ _ h _ => congrArg (fun j => (trackFiber U j).val.val.1) h +end UniformObject + +open UniformObject +include hLi in +theorem realize_essSurj : (realize P L hL).EssSurj := { + mem_essImage U := ⟨evaluated U,⟨asIso (reconstruct P L hL hLi U)⟩⟩ } + +instance realize_faithful : (realize P L hL).Faithful where + map_injective equality := (functor P L hL).map_injective (congrArg Hom.arrow equality) + +noncomputable def fiberPoint (U : Obj P (s:=s)) (b : Fin P.size × Fin s) (k : Fin (U b).size) : + Fiber (realizeObject P L hL U) b := + ⟨⟨(index P U ⟨b,k⟩,P.point b.1),by + change P.color (P.point b.1)=((index P U).symm ((index P U) ⟨b,k⟩)).1.1 + rw [Equiv.symm_apply_apply,BooleanPartition.color_point]⟩,rfl,by + change L (((index P U).symm ((index P U) ⟨b,k⟩)).1.2)=L b.2 + rw [Equiv.symm_apply_apply]⟩ + +include hLi in +lemma fiber_base (U : Obj P (s:=s)) (b : Fin P.size × Fin s) + (y : Fiber (realizeObject P L hL U) b) : + ((index P U).symm y.val.val.1).1=b := by + apply Prod.ext + · have hp := y.val.property + change P.color y.val.val.2=((index P U).symm y.val.val.1).1.1 at hp + rw [y.property.1,BooleanPartition.color_point] at hp + exact hp.symm + · apply hLi + exact y.property.2 + +noncomputable def fiberFin (U : Obj P (s:=s)) (b : Fin P.size × Fin s) + (y : Fiber (realizeObject P L hL U) b) : Fin (U b).size := + (fiber_base P L hL hLi U b y) ▸ ((index P U).symm y.val.val.1).2 + +lemma fiberFin_spec (U : Obj P (s:=s)) (b : Fin P.size × Fin s) + (y : Fiber (realizeObject P L hL U) b) : + (⟨b,fiberFin P L hL hLi U b y⟩ : Track P U)=((index P U).symm y.val.val.1) := by + apply Sigma.ext (fiber_base P L hL hLi U b y).symm + dsimp only [fiberFin] + exact eqRec_heq (φ:=fun b => Fin (U b).size) _ _ + +noncomputable def fiberEquiv (U : Obj P (s:=s)) (b : Fin P.size × Fin s) : + Fin (U b).size ≃ Fiber (realizeObject P L hL U) b where + toFun := fiberPoint P L hL U b + invFun := fiberFin P L hL hLi U b + left_inv k := by + have h := fiberFin_spec P L hL hLi U b (fiberPoint P L hL U b k) + change (⟨b,_⟩ : Track P U)=(index P U).symm ((index P U) ⟨b,k⟩) at h + rw [Equiv.symm_apply_apply] at h + exact eq_of_heq (Sigma.mk.inj_iff.mp h).2 + right_inv y := by + apply Subtype.ext + apply Subtype.ext + apply Prod.ext + · change index P U ⟨b,fiberFin P L hL hLi U b y⟩=y.val.val.1 + rw [fiberFin_spec] + exact Equiv.apply_symm_apply (index P U) y.val.val.1 + · exact y.property.1.symm + +noncomputable def fromUniform {U V : Obj P (s:=s)} + (f : (realize P L hL).obj U ⟶ (realize P L hL).obj V) : ∀b,Fin (U b).size ≃ Fin (V b).size := + fun b => (fiberEquiv P L hL hLi U b).trans + ((fiberMap f b).trans (fiberEquiv P L hL hLi V b).symm) + +lemma fromUniform_spec {U V : Obj P (s:=s)} + (f : (realize P L hL).obj U ⟶ (realize P L hL).obj V) + (b : Fin P.size × Fin s) (k : Fin (U b).size) : + index P V ⟨b,fromUniform P L hL hLi f b k⟩ = + (f.arrow.arrow.toEquiv (fiberPoint P L hL U b k).val).val.1 := by + change (index P V) ⟨b,fiberFin P L hL hLi V b ((fiberMap f b) (fiberPoint P L hL U b k))⟩=_ + exact (congrArg (index P V) + (fiberFin_spec P L hL hLi V b ((fiberMap f b) (fiberPoint P L hL U b k)))).trans + ((index P V).apply_symm_apply _) + +include hLi in +theorem realize_full : (realize P L hL).Full := { + map_surjective {U V} f := ⟨fromUniform P L hL hLi f,by + apply Hom.ext + apply Labelled.Hom.ext + apply Arrow.ext + apply Equiv.ext + intro x + apply Subtype.ext + apply Prod.ext + · change indexMap P L hL (fromUniform P L hL hLi f) x.val.1=(f.arrow.arrow.toEquiv x).val.1 + let t := (index P U).symm x.val.1 + have h := fromUniform_spec P L hL hLi f t.1 t.2 + change (index P V) ⟨t.1,fromUniform P L hL hLi f t.1 t.2⟩=(f.arrow.arrow.toEquiv x).val.1 + rw [h] + apply f.uniform + · change (index P U) ((index P U).symm x.val.1)=x.val.1 + exact Equiv.apply_symm_apply _ _ + · change P.color (P.point t.1.1)=P.color x.val.2 + rw [BooleanPartition.color_point] + exact x.property.symm + · exact (f.arrow.positional x).symm⟩ } + +noncomputable def equivalence : Obj P (s:=s) ≌ UniformObject P L := by + letI := (inferInstance : (realize P L hL).Faithful) + letI := (realize_full P L hL hLi) + letI := (realize_essSurj P L hL hLi) + letI : (realize P L hL).IsEquivalence := {} + exact (realize P L hL).asEquivalence + +end LabelledStage +end SimpleAmenable.PolygonObject + +end + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Configurations/StageRefinement.lean b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/StageRefinement.lean new file mode 100644 index 0000000000000000000000000000000000000000..da00ea9bfc3e3905c51967f93e6d8b0aeb8ba4f7 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/StageRefinement.lean @@ -0,0 +1,78 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Configurations.StageFiberSum +import OAI.GroupTheory.SimpleAmenable.Simplicial.TripleComposition + +namespace OAI + +section + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Classical MonoidalCategory +namespace SimpleAmenable.PolygonObject.LabelledStage.Stage +open UniformObject + +variable {a n : ℕ} {S T : Stage a n} (h : S≤T) +variable (b : Fin S.partition.size × Fin S.support.card) + (c : Fin T.partition.size × Fin T.support.card) + (hp : S.partition.color (T.partition.point c.1)=b.1) + (hl : S.L b.2=T.L c.2) + +noncomputable def refineFiber (U : S.Obj) : Fiber U b ≃ Fiber ((inclusion h).obj U) c where + toFun x := ⟨⟨(x.val.val.1,T.partition.point c.1), + (U.uniform x.val.val.1 x.val.val.2 (T.partition.point c.1) (by + rw [x.property.1,S.partition.color_point,hp])).mp x.val.property⟩,rfl, + x.property.2.trans hl⟩ + invFun y := ⟨⟨(y.val.val.1,S.partition.point b.1), + (U.uniform y.val.val.1 y.val.val.2 (S.partition.point b.1) (by + rw [y.property.1,hp,S.partition.color_point])).mp y.val.property⟩,rfl, + y.property.2.trans hl.symm⟩ + left_inv x := by apply Subtype.ext; apply Subtype.ext; exact Prod.ext rfl x.property.1.symm + right_inv y := by apply Subtype.ext; apply Subtype.ext; exact Prod.ext rfl y.property.1.symm + +lemma refineFiber_natural {U V : S.Obj} (f : U ⟶ V) (x : Fiber U b) : + refineFiber h b c hp hl V (fiberMap f b x)= + fiberMap ((inclusion h).map f) c (refineFiber h b c hp hl U x) := by + apply Subtype.ext + apply Subtype.ext + apply Prod.ext + · exact f.uniform x.val (refineFiber h b c hp hl U x).val rfl (by + change S.partition.color x.val.val.2=S.partition.color (T.partition.point c.1) + rw [x.property.1,S.partition.color_point,hp]) + · exact (f.arrow.positional (refineFiber h b c hp hl U x).val).symm + +noncomputable def refineEvaluationIso : + evaluation (P:=S.partition) (L:=S.L) ⋙ BarFinitePower.project _ b ≅ + inclusion h ⋙ evaluation (P:=T.partition) (L:=T.L) ⋙ BarFinitePower.project _ c := + NatIso.ofComponents (fun U => asIso (C := FiniteSetGroupoid) + (X := E.obj U b) (Y := E.obj ((inclusion h).obj U) c) + (show (E.obj U b) ⟶ (E.obj ((inclusion h).obj U) c) from + ((enumerate U b).symm.trans ((refineFiber h b c hp hl U).trans (enumerate ((inclusion h).obj U) c))))) + (by + intro U V f + apply Equiv.ext + intro x + obtain ⟨x,rfl⟩ := (enumerate U b).surjective x + dsimp only [Functor.comp_map,Pi.eval,BarFinitePower.project,asIso_hom,Equiv.trans_apply,Equiv.symm_apply_apply] + change enumerate ((inclusion h).obj V) c (refineFiber h b c hp hl V + ((enumerate V b).symm (E.map f b (enumerate U b x)))) = + E.map ((inclusion h).map f) c (enumerate ((inclusion h).obj U) c + (refineFiber h b c hp hl U ((enumerate U b).symm (enumerate U b x)))) + rw [E_map_enum,Equiv.symm_apply_apply,Equiv.symm_apply_apply,E_map_enum,refineFiber_natural]) + +lemma fiber_empty_of_new_label (hc : ∀j,S.L j ≠ T.L c.2) (U : S.Obj) : + IsEmpty (Fiber ((inclusion h).obj U) c) := ⟨by + intro x + obtain ⟨j,hj⟩ := U.supported x.val.val.1 + exact hc j (hj.trans x.property.2)⟩ + +lemma new_label_size (hc : ∀j,S.L j ≠ T.L c.2) (U : S.Obj) : + (evaluation.obj ((inclusion h).obj U) c).size=0 := by + have := fiber_empty_of_new_label h c hc U + exact Fintype.card_eq_zero +end SimpleAmenable.PolygonObject.LabelledStage.Stage + +end + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Configurations/SymmetricCharts.lean b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/SymmetricCharts.lean new file mode 100644 index 0000000000000000000000000000000000000000..ef1eaa6b325e519e4fda08a859cc11a7b360b6af --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/SymmetricCharts.lean @@ -0,0 +1,78 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.TangentWalkCenters + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section SymmetricCharts + +@[simp] theorem endpointLabel_neg (z : CutRing) : endpointLabel (-z) = -endpointLabel z := rfl + +def symmetricWindowStart (s : CutRing) : Fin 2 → ℤ := fun _ => -(endpointLabel s).natAbs + +def symmetricWindowLength (s : CutRing) : ℕ := 2*(endpointLabel s).natAbs+2 + +theorem symmetricWindow_labels (s : CutRing) (j : Fin 2) : + (symmetricWindowStart s j ≤ endpointLabel (-s) ∧ + endpointLabel (-s) < symmetricWindowStart s j+symmetricWindowLength s) ∧ + (symmetricWindowStart s j ≤ endpointLabel 0 ∧ + endpointLabel 0 < symmetricWindowStart s j+symmetricWindowLength s) ∧ + (symmetricWindowStart s j ≤ endpointLabel s ∧ + endpointLabel s < symmetricWindowStart s j+symmetricWindowLength s) := by + have h₀ := Int.le_natAbs (a := endpointLabel s) + have h₁ : -(endpointLabel s) ≤ ((endpointLabel s).natAbs:ℤ) := by + simpa using (Int.le_natAbs (a := -endpointLabel s)) + simp only [symmetricWindowStart,symmetricWindowLength,endpointLabel_neg,Nat.cast_add,Nat.cast_mul,Nat.cast_ofNat] + change _ ∧ (_ ≤ (0:ℤ) ∧ (0:ℤ) < _) ∧ _ + omega + +theorem signedShortSteps_bound (u : CutRing) (e : Fin 5) : + |ordinary (signedShortSteps u e)| ≤ |ordinary u|+|ordinary (cutTau*u)| := by + have h₀ := abs_nonneg (ordinary u) + have h₁ := abs_nonneg (ordinary (cutTau*u)) + fin_cases e + · change |ordinary 0| ≤ _ + rw [map_zero,abs_zero] + linarith + · exact le_add_of_nonneg_right h₁ + · change |ordinary (-u)| ≤ _ + rw [map_neg,abs_neg] + exact le_add_of_nonneg_right h₁ + · exact le_add_of_nonneg_left h₀ + · change |ordinary (-(cutTau*u))| ≤ _ + rw [map_neg,abs_neg] + exact le_add_of_nonneg_left h₀ + +theorem exists_symmetric_short_chart (a : ℕ) (r : CutRing) (hr : 0 < ordinary r) : + ∃ s u v : CutRing, 0 < ordinary s ∧ ordinary s < ordinary r/2 ∧ u*v=1 ∧ + (1+|ordinary (cutTau^a)|)*(|ordinary u|+|ordinary (cutTau*u)|) < ordinary s/4 := by + obtain ⟨s,hs,hs'⟩ := exists_cut_between (by linarith : (0:ℝ) < ordinary r/2) + obtain ⟨u,v,huv,hshort⟩ := exists_short_tangent_basis (cutTau^a) (by linarith : 0 < ordinary s/4) + exact ⟨s,u,v,hs,hs',huv,hshort⟩ + +theorem symmetric_chart_overlap_boxes (a : ℕ) (r s u : CutRing) + (hs : 0 < ordinary s) (hsr : ordinary s < ordinary r/2) + (hshort : (1+|ordinary (cutTau^a)|)*(|ordinary u|+|ordinary (cutTau*u)|) < ordinary s/4) + (d : Fin 2) (e : Fin 5) (j : Fin 2) : + (-ordinary r < ordinary (-s) ∧ ordinary s < ordinary r) ∧ + (-ordinary r < ordinary (-s)-ordinary (pointCoordinate (tangentOffset a d (signedShortSteps u e)) j) ∧ + ordinary s-ordinary (pointCoordinate (tangentOffset a d (signedShortSteps u e)) j) < ordinary r) := by + have hh := (tangentOffset_ordinary_bound a d (signedShortSteps u e) j).trans + (mul_le_mul_of_nonneg_left (signedShortSteps_bound u e) (by positivity : 0 ≤ 1+|ordinary (cutTau^a)|)) + have hh' := lt_of_le_of_lt hh hshort + have hlim := abs_lt.mp hh' + rw [map_neg] + exact ⟨⟨by linarith,by linarith⟩,⟨by linarith,by linarith⟩⟩ + +end SymmetricCharts + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Configurations/SymmetricComponents.lean b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/SymmetricComponents.lean new file mode 100644 index 0000000000000000000000000000000000000000..dfaf27a95542d8db184036ea5afbb2debf6bc716 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/SymmetricComponents.lean @@ -0,0 +1,170 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Configurations.SymmetricStable +import OAI.GroupTheory.SimpleAmenable.Configurations.CofinalPowers +import OAI.GroupTheory.SimpleAmenable.Configurations.PolygonComponentStable +import OAI.GroupTheory.SimpleAmenable.Simplicial.FirstBarForwardLow + +namespace OAI + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits MonoidalCategory Simplicial Opposite +namespace SimpleAmenable.SymmetricConfiguration +open FreeChains ComponentTranslation GroupoidComponentHomology PolygonObject + +attribute [local instance 1200] Rep.hV2 +noncomputable abbrev generator : Skeleton FiniteSetGroupoid := toSkeleton ⟨1⟩ +lemma component_pow (n:ℕ) : toSkeleton (⟨n⟩:FiniteSetGroupoid)=generator^n := by + induction n with + | zero => rfl + | succ n ih => + rw [pow_succ,←ih] + exact Skeleton.toSkeleton_tensorObj (⟨n⟩:FiniteSetGroupoid) ⟨1⟩ +lemma generator_surjective : Function.Surjective (fun n:ℕ=>generator^n) := by + intro p + exact ⟨(repr p).size,(component_pow _).symm.trans (repr_component p)⟩ +lemma generator_cofinal : ∀p:Skeleton FiniteSetGroupoid,∃q n,p*q=generator^n := by + intro p + obtain ⟨n,rfl⟩:=generator_surjective p + exact ⟨1,n,mul_one _⟩ +noncomputable def standardNerveInclusion (n:ℕ) : SingleObj (G n) ⥤ FiniteSetGroupoid where + obj _ := ⟨n⟩ + map f := f + map_id _ := rfl + map_comp _ _ := rfl +noncomputable def standardFiberInclusion (n:ℕ) : SingleObj (G n) ⥤ Fiber (generator^n) := + (property (generator^n)).lift (standardNerveInclusion n) (fun _=>component_pow n) +instance standardFiberInclusion_faithful (n:ℕ) : (standardFiberInclusion n).Faithful where + map_injective h := congrArg (fun f : (standardFiberInclusion n).obj _ ⟶ (standardFiberInclusion n).obj _=>f.hom) h +noncomputable instance standardFiberInclusion_full (n:ℕ) : (standardFiberInclusion n).Full where + map_surjective f := ⟨f.hom,rfl⟩ +instance standardFiberInclusion_essSurj (n:ℕ) : (standardFiberInclusion n).EssSurj where + mem_essImage V := ⟨SingleObj.star _,⟨fiberIso _ ((standardFiberInclusion n).obj (SingleObj.star _)) V⟩⟩ +noncomputable instance standardFiberInclusion_isEquivalence (n:ℕ) : (standardFiberInclusion n).IsEquivalence := + ⟨inferInstance,inferInstance,inferInstance⟩ +noncomputable def standardHomologyIso (n q:ℕ) : + groupHomology (Rep.trivial ℤ (G n) ℤ) q ≅ (nerve (Fiber (generator^n))).homology Z q := by + haveI:=NerveHomotopy.homologyMap_isIso (standardFiberInclusion n) Z q + exact (GroupNerveCoordinates.homologyIso (G n) q).symm ≪≫ + asIso (SSet.homologyMap (nerveMap (standardFiberInclusion n)) Z q) +lemma tensor_stabilize (k n:ℕ) (f:G n) : + (tensorLeft (⟨k⟩:FiniteSetGroupoid)).map (show (⟨n⟩:FiniteSetGroupoid) ⟶ ⟨n⟩ from f)= + (show (⟨k+n⟩:FiniteSetGroupoid) ⟶ ⟨k+n⟩ from stabilize k n f) := by + apply Equiv.ext + intro x + obtain ⟨y,rfl⟩:=finSumFinEquiv.surjective x + cases y with + | inl i => + change FiniteSetGroupoid.sumHom (Equiv.refl (Fin k)) f (FiniteSetGroupoid.sumEquiv ⟨k⟩ ⟨n⟩ (.inl i))=stabilize k n f (Fin.castAdd n i) + rw [FiniteSetGroupoid.sumHom_inl,stabilize_apply_head] + rfl + | inr i => + change FiniteSetGroupoid.sumHom (Equiv.refl (Fin k)) f (FiniteSetGroupoid.sumEquiv ⟨k⟩ ⟨n⟩ (.inr i))=stabilize k n f (Fin.natAdd k i) + rw [FiniteSetGroupoid.sumHom_inr,stabilize_apply_tail] + rfl +noncomputable def standardTensorIso (k n:ℕ) : + standardNerveInclusion n ⋙ tensorLeft (⟨k⟩:FiniteSetGroupoid) ≅ + (stabilize k n).toFunctor ⋙ standardNerveInclusion (k+n) := + NatIso.ofComponents (fun _=>Iso.refl _) (by + intro X Y f + change FiniteSetGroupoid.sumHom (Equiv.refl (Fin k)) f = stabilize k n f + exact tensor_stabilize k n f) +noncomputable def standardCastIso {m n:ℕ} (h:m=n) : standardNerveInclusion m ≅ + (castGroup h).toMonoidHom.toFunctor ⋙ standardNerveInclusion n := by + subst n + exact Iso.refl _ +noncomputable def standardSuccessorIso (n:ℕ) : + standardNerveInclusion n ⋙ tensorLeft (⟨1⟩:FiniteSetGroupoid) ≅ + (successorStabilize n).toFunctor ⋙ standardNerveInclusion (n+1) := + standardTensorIso 1 n ≪≫ + Functor.isoWhiskerLeft (stabilize 1 n).toFunctor (standardCastIso (Nat.add_comm 1 n)) ≪≫ + (Functor.associator _ _ _).symm +end SimpleAmenable.SymmetricConfiguration + +end + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits MonoidalCategory Simplicial Opposite +namespace SimpleAmenable.SymmetricConfiguration +open FreeChains ComponentTranslation GroupoidComponentHomology PolygonObject + +attribute [local instance 1200] Rep.hV2 +noncomputable def representativeGeneratorIso : repr generator ≅ (⟨1⟩:FiniteSetGroupoid) := + Skeleton.isoOfEq (repr_component _) +noncomputable def representativeSuccessorIso (n:ℕ) : + standardNerveInclusion n ⋙ tensorLeft (repr generator) ≅ + (successorStabilize n).toFunctor ⋙ standardNerveInclusion (n+1) := + Functor.isoWhiskerLeft (standardNerveInclusion n) + ((tensoringLeft FiniteSetGroupoid).mapIso representativeGeneratorIso) ≪≫ standardSuccessorIso n +noncomputable def fiberSuccessorIso (n:ℕ) : + standardFiberInclusion n ⋙ + ComponentTranslation.translate generator (generator^n) (generator^(n+1)) (pow_succ' _ _).symm ≅ + (successorStabilize n).toFunctor ⋙ standardFiberInclusion (n+1) := + NatIso.ofComponents (fun x=>ObjectProperty.isoMk _ ((representativeSuccessorIso n).app x)) (by + intro x y f + apply ObjectProperty.hom_ext + exact (representativeSuccessorIso n).hom.naturality f) +lemma component_successor_isIso (n q:ℕ) [IsIso (TrivialHomology.map (successorStabilize n) q)] : + IsIso (SSet.homologyMap (nerveMap + (ComponentTranslation.translate generator (generator^n) (generator^(n+1)) (pow_succ' _ _).symm)) Z q) := by + have := NerveHomotopy.homologyMap_isIso (standardFiberInclusion n) Z q + have := NerveHomotopy.homologyMap_isIso (standardFiberInclusion (n+1)) Z q + have hg:=GroupNerveCoordinates.homologyIso_natural (successorStabilize n) q + have : IsIso (SSet.homologyMap (nerveMap (successorStabilize n).toFunctor) Z q) := by + have : IsIso (SSet.homologyMap (nerveMap (successorStabilize n).toFunctor) Z q ≫ + (GroupNerveCoordinates.homologyIso (G (n+1)) q).hom) := by rw [hg]; infer_instance + exact (isIso_comp_right_iff _ (GroupNerveCoordinates.homologyIso (G (n+1)) q).hom).mp inferInstance + have h:=(NerveHomotopy.ofNatTrans (fiberSuccessorIso n).hom).congr_homologyMap Z q + rw [ComponentStable.map_comp,ComponentStable.map_comp] at h + have : IsIso (SSet.homologyMap (nerveMap (standardFiberInclusion n)) Z q ≫ + SSet.homologyMap (nerveMap + (ComponentTranslation.translate generator (generator^n) (generator^(n+1)) (pow_succ' _ _).symm)) Z q) := by + rw [h] + infer_instance + exact (isIso_comp_left_iff (SSet.homologyMap (nerveMap (standardFiberInclusion n)) Z q) _).mp inferInstance +lemma component_sequence_succ (n q:ℕ) : + (homologyDiagram (C:=FiniteSetGroupoid) q).map + ((CofinalPowers.sequence generator).map (homOfLE (Nat.le_succ n))) = + SSet.homologyMap (nerveMap (ComponentTranslation.translate generator + (generator^n) (generator^(n+1)) (pow_succ' _ _).symm)) Z q := by + change SSet.homologyMap (nerveMap (ComponentTranslation.translate + (generator ^ (n+1-n)) _ _ _)) Z q = _ + simp only [Nat.add_sub_cancel_left,pow_one] + rfl +lemma componentStable_finite (q:ℕ) (N:ℕ) + (h:∀n,N≤n → IsIso (TrivialHomology.map (successorStabilize n) q)) : + Module.Finite ℤ (ComponentStable.object (C:=FiniteSetGroupoid) q:A) := by + have := FiniteGroupHomology.finite (Rep.trivial ℤ (G N) ℤ) q + have : Module.Finite ℤ ((nerve (Fiber (generator^N))).homology Z q:A) := + Module.Finite.equiv (standardHomologyIso N q).toLinearEquiv + apply (CofinalPowers.finite_colimit_iff generator generator_cofinal (homologyDiagram q) N N le_rfl ?_).mp + (inferInstanceAs (Module.Finite ℤ ((nerve (Fiber (generator^N))).homology Z q:A))) + intro n hn + rw [component_sequence_succ] + have := h n hn + exact component_successor_isIso n q +lemma componentStableH1_finite : Module.Finite ℤ (ComponentStable.object (C:=FiniteSetGroupoid) 1:A) := + componentStable_finite 1 32 successor_H1_isIso +lemma componentStableH2_finite : Module.Finite ℤ (ComponentStable.object (C:=FiniteSetGroupoid) 2:A) := + componentStable_finite 2 34 successor_H2_isIso +lemma component_fg : Monoid.FG (Skeleton FiniteSetGroupoid) := + Monoid.fg_of_surjective (powersHom (Skeleton FiniteSetGroupoid) generator) (by + intro p + obtain ⟨n,hn⟩:=generator_surjective p + exact ⟨Multiplicative.ofAdd n,hn⟩) +lemma component_homology_finite (n:ℕ) : + Module.Finite ℤ ((nerve (SingleObj (Skeleton FiniteSetGroupoid))).homology Z n:A) := by + have := component_fg + have : Group.FG (TranslationFiltered.Q (Skeleton FiniteSetGroupoid)) := Group.fg_iff_monoid_fg.mpr inferInstance + have := AbelianHomologyFinite.finite (TranslationFiltered.Q (Skeleton FiniteSetGroupoid)) n + exact Module.Finite.equiv (TranslationNerve.completionHomologyIso (Skeleton FiniteSetGroupoid) n).symm.toLinearEquiv +lemma triple_homology_finite (n:ℕ) (hn:n≤5) : + Module.Finite ℤ ((IntervalBar.Diagram.bar₃ (C:=FiniteSetGroupoid)).homology Z n:A) := by + have := componentStableH1_finite + have := componentStableH2_finite + exact IntervalBar.Diagram.triple_finite_of_bar + (IntervalBar.Diagram.bar_low_finite component_homology_finite) n hn +end SimpleAmenable.SymmetricConfiguration + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Configurations/SymmetricConfiguration.lean b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/SymmetricConfiguration.lean new file mode 100644 index 0000000000000000000000000000000000000000..f383f03577d54cdb71574928a77c08ac000b8734 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/SymmetricConfiguration.lean @@ -0,0 +1,149 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.HomologyAdditive + +namespace OAI + +section +open Classical CategoryTheory CategoryTheory.Limits Representation Rep Finsupp +namespace SimpleAmenable.SymmetricConfiguration + +attribute [local instance 1200] Rep.hV2 +abbrev G (m:ℕ) := Equiv.Perm (Fin m) +def Configuration (m p:ℕ) := {f:Fin p → Fin m // Function.Injective f} +variable {m p:ℕ} +instance : CoeFun (Configuration m p) (fun _=>Fin p → Fin m) := ⟨Subtype.val⟩ +@[ext] theorem ext {f g:Configuration m p} (h:∀i,f i=g i) : f=g := Subtype.ext (funext h) +noncomputable instance : MulAction (G m) (Configuration m p) where + smul g f := ⟨fun i=>g (f i), g.injective.comp f.property⟩ + one_smul f := by apply ext; intro i; rfl + mul_smul g h f := by apply ext; intro i; rfl +@[simp] theorem smul_apply (g:G m) (f:Configuration m p) (i:Fin p) : (g • f) i=g (f i) := rfl +noncomputable def standard (p n:ℕ) : Configuration (p+n) p := ⟨Fin.castAdd n,Fin.castAdd_injective p n⟩ +noncomputable def standardLE (m p:ℕ) (hp:p ≤ m) : Configuration m p := ⟨Fin.castLE hp,Fin.castLE_injective hp⟩ +theorem transitive (f g:Configuration m p) : ∃u:G m,u • f=g := by + obtain ⟨u,hu⟩ := Equiv.Perm.exists_extending_pair f.val g.val f.property g.property + exact ⟨u,ext hu⟩ +lemma ne_smul (g:G m) (v w:Fin m) (h:v ≠ w) : g • v ≠ g • w := fun hh=>h (g.injective hh) +noncomputable def configurationRepresentation (m p:ℕ) : Representation ℤ (G m) (ConfigurationChains.degree (Ne:Fin m → Fin m → Prop) p) := + ConfigurationChains.representation ne_smul p +lemma commonNeighbor (hm:32 ≤ m) (S:Finset (Fin m)) (hS:S.card ≤ 31) : ∃v,∀w ∈ S,v ≠ w := by + obtain ⟨v,hv⟩ := Finset.exists_mem_notMem_of_card_lt_card (s:=S) (t:=Finset.univ) (by simpa using (show S.card < m by omega)) + exact ⟨v,by intro w hw he; exact hv.2 (he ▸ hw)⟩ +lemma lowDegree_exact (hm:32 ≤ m) {n:ℕ} (hn:n ≤ 2) : + Function.Exact (ConfigurationChains.degreeBoundary (Ne:Fin m → Fin m → Prop) (n+1)) + (ConfigurationChains.degreeBoundary (Ne:Fin m → Fin m → Prop) n) := + ConfigurationChains.lowDegree_exact (commonNeighbor hm) hn +noncomputable def listEquiv (m p : ℕ) : Configuration m p ≃ + {l : List (Fin m) // l.Pairwise Ne ∧ l.length=p} where + toFun f := ⟨List.ofFn f.val,List.pairwise_ofFn.mpr (fun _ _ h => fun hh => (ne_of_lt h) (f.property hh)),List.length_ofFn⟩ + invFun l := ⟨fun i => l.val.get ⟨i.val,by rw [l.property.2];exact i.isLt⟩,by + intro i j hij + by_contra hne + rcases lt_or_gt_of_ne hne with h|h + · exact l.property.1.rel_get_of_lt h hij + · exact l.property.1.rel_get_of_lt h hij.symm⟩ + left_inv f := by apply ext; intro i; simp + right_inv l := by + apply Subtype.ext + apply List.ext_getElem + · simp [l.property.2] + · intro i hi hj + simp + +@[simp] theorem listEquiv_apply_val (f : Configuration m p) : + (listEquiv m p f).val=List.ofFn f.val := rfl + +noncomputable def chainEquiv (m p : ℕ) : + (Configuration m p →₀ ℤ) ≃ₗ[ℤ] ConfigurationChains.degree ((Ne:Fin m → Fin m → Prop)) p := + (Finsupp.domLCongr (listEquiv m p)).trans (ConfigurationChains.simplexModuleEquiv _ p).symm + +@[simp] theorem chainEquiv_single_val (f : Configuration m p) (z : ℤ) : + (chainEquiv m p (Finsupp.single f z)).val=Finsupp.single (List.ofFn f.val) z := by + unfold chainEquiv + rw [LinearEquiv.trans_apply,Finsupp.domLCongr_single] + simp [ConfigurationChains.simplexModuleEquiv] + exact Finsupp.supportedEquivFinsupp_symm_single _ _ _ + +theorem chainEquiv_intertwines (g : G m) : + (chainEquiv m p).toLinearMap.comp (TransitiveInduction.permutationRep + (G:=G m) (X:=Configuration m p) g)= + (configurationRepresentation m p g).comp (chainEquiv m p).toLinearMap := by + apply Finsupp.lhom_ext + intro f z + apply Subtype.ext + change (chainEquiv m p (TransitiveInduction.permutationRep g (Finsupp.single f z))).val= + ConfigurationChains.push (fun v => g • v) (chainEquiv m p (Finsupp.single f z)).val + rw [TransitiveInduction.permutationRep_single,chainEquiv_single_val,chainEquiv_single_val, + ConfigurationChains.push_single] + congr 1 + simp [List.map_ofFn] + rfl + +noncomputable def representationIso (m p : ℕ) : + Rep.of (TransitiveInduction.permutationRep (G:=G m) (X:=Configuration m p)) ≅ + Rep.of (configurationRepresentation m p) := + Rep.mkIso {toLinearEquiv:=chainEquiv m p,isIntertwining':=chainEquiv_intertwines} + +noncomputable abbrev column (m p : ℕ) := + Rep.of (TransitiveInduction.permutationRep + (G:=G m) (X:=Configuration m p)) + +noncomputable def face (i : Fin (p+1)) (f : Configuration m (p+1)) : + Configuration m p := + ⟨fun j => f (i.succAbove j),f.property.comp Fin.succAbove_right_injective⟩ + +@[simp] lemma face_apply (i : Fin (p+1)) (f : Configuration m (p+1)) (j : Fin p) : + face i f j=f (i.succAbove j) := rfl + +@[simp] lemma face_smul (i : Fin (p+1)) (g : G m) + (f : Configuration m (p+1)) : face i (g • f)=g • face i f := rfl + +noncomputable def faceHom (m p : ℕ) (i : Fin (p+1)) : + column m (p+1) ⟶ column m p := + TransitiveInduction.equivariantMap (face i) (face_smul i) + +noncomputable def boundary (m p : ℕ) : column m (p+1) ⟶ column m p := + (representationIso m (p+1)).hom ≫ + ConfigurationChains.boundaryRep ne_smul p ≫ + (representationIso m p).inv + +lemma boundary_chain (c : Configuration m (p+1) →₀ ℤ) : + chainEquiv m p ((boundary m p).hom c) = + ConfigurationChains.degreeBoundary ((Ne:Fin m → Fin m → Prop)) p (chainEquiv m (p+1) c) := by + change chainEquiv m p ((chainEquiv m p).symm _) = _ + exact (chainEquiv m p).apply_symm_apply _ + +lemma boundary_sum (m p : ℕ) : boundary m p = + ∑i : Fin (p+1), ((-1:ℤ)^i.val) • faceHom m p i := by + apply Rep.hom_ext + apply Representation.IntertwiningMap.ext + apply Finsupp.lhom_ext + intro c z + apply (chainEquiv m p).injective + change (chainEquiv m p) ((boundary m p).hom (Finsupp.single c z)) = _ + rw [boundary_chain] + apply Subtype.ext + change ConfigurationChains.boundary (chainEquiv m (p+1) (Finsupp.single c z)).val = _ + rw [chainEquiv_single_val, ConfigurationChains.boundary_single, + ConfigurationChains.faceSum_ofFn] + simp only [Finset.smul_sum] + change _ = (chainEquiv m p + ((∑i : Fin (p+1), ((-1:ℤ)^i.val) • faceHom m p i).hom (Finsupp.single c z))).val + simp only [Rep.sum_hom, Rep.smul_hom, Representation.IntertwiningMap.sum_apply, + Representation.IntertwiningMap.smul_apply, map_sum, map_smul, Submodule.coe_sum, + Submodule.coe_smul] + apply Finset.sum_congr rfl + intro i hi + change z • Finsupp.single _ ((-1:ℤ)^i.val) = + ((-1:ℤ)^i.val) • ((chainEquiv m p) + ((faceHom m p i).hom (Finsupp.single c z))).val + dsimp only [faceHom] + rw [TransitiveInduction.equivariantMap_single] + rw [chainEquiv_single_val] + simp [Finsupp.smul_single, mul_comm, face] + +end SimpleAmenable.SymmetricConfiguration + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Configurations/SymmetricFaces.lean b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/SymmetricFaces.lean new file mode 100644 index 0000000000000000000000000000000000000000..56bdc5f0429b02f63d745ffa2232da2092a99b6c --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/SymmetricFaces.lean @@ -0,0 +1,171 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.FullGroupStability +import OAI.GroupTheory.SimpleAmenable.Configurations.SymmetricConfiguration + +namespace OAI + +open Classical CategoryTheory CategoryTheory.Limits Representation Rep Finsupp +namespace SimpleAmenable.SymmetricConfiguration + +section + +attribute [local instance 1200] Rep.hV2 +variable {m p:ℕ} +noncomputable def facePermutation (i j : Fin (p+1)) : Equiv.Perm (Fin (p+1)) := + (finSuccEquiv' i).trans (finSuccEquiv' j).symm +@[simp] lemma facePermutation_apply (i j : Fin (p+1)) (k : Fin p) : + facePermutation i j (i.succAbove k)=j.succAbove k := by simp [facePermutation] +noncomputable def permHom (f:Configuration m p) (σ:Equiv.Perm (Fin p)) : G m := + σ.viaFintypeEmbedding ⟨f.val,f.property⟩ +lemma permHom_apply (f:Configuration m p) (σ:Equiv.Perm (Fin p)) (i:Fin p) : permHom f σ (f i)=f (σ i) := + Equiv.Perm.viaFintypeEmbedding_apply_image _ _ _ +lemma permHom_fixed (f:Configuration m p) (σ:Equiv.Perm (Fin p)) (x:Fin m) (hx:x∉Set.range f.val) : permHom f σ x=x := + Equiv.Perm.viaFintypeEmbedding_apply_notMem_range _ _ hx +lemma permHom_centralizes (f:Configuration m p) (σ:Equiv.Perm (Fin p)) + (h:MulAction.stabilizer (G m) f) : permHom f σ * h.val = h.val * permHom f σ := by + have hh (i:Fin p) : h.val (f i)=f i := congrArg (fun t:Configuration m p=>t i) h.property + exact (supported_fixer_commute (f:=h.val) (g:=permHom f σ) (U:=Set.range f.val) + (by rintro x ⟨i,rfl⟩; exact hh i) (permHom_fixed f σ)).symm.eq +lemma permHom_face (f:Configuration m (p+1)) (i j:Fin (p+1)) : + permHom f (facePermutation i j) • face i f=face j f := by + apply ext; intro k + change permHom f _ (f (i.succAbove k))=f (j.succAbove k) + rw [permHom_apply,facePermutation_apply] +lemma homology_face_eq (m p:ℕ) (hm:p+1 ≤ m) (q:ℕ) (i j:Fin (p+1)) : + (groupHomology.functor ℤ (G m) q).map (faceHom m p i)= + (groupHomology.functor ℤ (G m) q).map (faceHom m p j) := by + let f := standardLE m (p+1) hm + exact TransitiveInduction.map_equivariant_eq_of_centralizer (face j) (face i) + (face_smul j) (face_smul i) f (fun h=>transitive f h) + (permHom f (facePermutation j i)) (permHom_centralizes f _) (permHom_face f j i) q +lemma boundary_two (m : ℕ) : boundary m 1 = faceHom m 1 0 - faceHom m 1 1 := by + rw [boundary_sum, Fin.sum_univ_two] + simp [sub_eq_add_neg] + +lemma boundary_three (m : ℕ) : boundary m 2 = + faceHom m 2 0 - faceHom m 2 1 + faceHom m 2 2 := by + rw [boundary_sum, Fin.sum_univ_succ, Fin.sum_univ_two] + norm_num + abel + +lemma homology_boundary_two_zero (m : ℕ) (hm : 7 < m) (q : ℕ) : + (groupHomology.functor ℤ (G m) q).map (boundary m 1)=0 := by + rw [boundary_two, Functor.map_sub, homology_face_eq m 1 (by omega) q 1 0, sub_self] + +lemma homology_boundary_three (m : ℕ) (hm : 10 < m) (q : ℕ) : + (groupHomology.functor ℤ (G m) q).map (boundary m 2)= + (groupHomology.functor ℤ (G m) q).map (faceHom m 2 0) := by + rw [boundary_three, Functor.map_add, Functor.map_sub, + homology_face_eq m 2 (by omega) q 1 0, homology_face_eq m 2 (by omega) q 2 0, sub_self, zero_add] + +lemma boundary_square (m p : ℕ) : boundary m (p+1) ≫ boundary m p=0 := by + apply Rep.hom_ext + apply Representation.IntertwiningMap.ext + apply LinearMap.ext + intro c + apply (chainEquiv m p).injective + change chainEquiv m p ((boundary m p).hom ((boundary m (p+1)).hom c)) = + chainEquiv m p 0 + rw [boundary_chain, boundary_chain, ConfigurationChains.degreeBoundary_square, map_zero] + +lemma boundary_exact (m p : ℕ) (hm : 32 ≤ m) (hp : p ≤ 2) : + (ShortComplex.mk (boundary m (p+1)) (boundary m p) (boundary_square m p)).Exact := by + apply (ShortComplex.exact_map_iff_of_faithful _ (forget₂ (Rep.{0} ℤ (G m)) + (ModuleCat.{0} ℤ))).mp + rw [ShortComplex.moduleCat_exact_iff] + intro x hx + change (boundary m p).hom x=0 at hx + have hc : ConfigurationChains.degreeBoundary ((Ne:Fin m→Fin m→Prop)) p (chainEquiv m (p+1) x)=0 := by + rw [← boundary_chain, hx, map_zero] + obtain ⟨y,hy⟩ := (lowDegree_exact hm hp _).mp hc + refine ⟨(chainEquiv m (p+2)).symm y,?_⟩ + apply (chainEquiv m (p+1)).injective + change chainEquiv m (p+1) ((boundary m (p+1)).hom _) = _ + rw [boundary_chain, LinearEquiv.apply_symm_apply, hy] + +lemma boundary_zero_eq_face (m : ℕ) : boundary m 0=faceHom m 0 0 := by + rw [boundary_sum] + simp + +lemma boundary_zero_epi (m : ℕ) (hm : 0 < m) : Epi (boundary m 0) := by + rw [boundary_zero_eq_face, Rep.epi_iff_surjective] + change Function.Surjective (Finsupp.mapDomain (face (0:Fin 1))) + apply Finsupp.mapDomain_surjective + intro f + refine ⟨standardLE m 1 (by omega),?_⟩ + apply ext + intro i + exact Fin.elim0 i + +lemma face_H0_isIso (m p : ℕ) (hm : 3*(p+1)+1 < m) (i : Fin (p+1)) : + IsIso ((groupHomology.functor ℤ (G m) 0).map (faceHom m p i)) := by + let f := standardLE m (p+1) (by omega : p+1 ≤ m) + exact TransitiveInduction.isIso_map_equivariant_H0 (face i) (face_smul i) f + (fun h => transitive f h) (fun h => transitive _ h) + +lemma boundary_two_H0_isIso (m : ℕ) (hm : 10 < m) : + IsIso ((groupHomology.functor ℤ (G m) 0).map (boundary m 2)) := by + rw [homology_boundary_three m hm 0] + exact face_H0_isIso m 2 hm 0 +lemma boundary_zero_H1_isIso (m : ℕ) (hm : 32 ≤ m) : + IsIso ((groupHomology.functor ℤ (G m) 1).map (boundary m 0)) := by + let boundaryEpi := boundary_zero_epi m (by omega) + let boundaryIso : IsIso (BoundedHomologyEdge.Hmap 0 (boundary m 2)) := + boundary_two_H0_isIso m (by omega) + exact BoundedHomologyEdge.chain_H1_isIso (boundary m 0) (boundary m 1) + (boundary m 2) (boundary_square m 0) (boundary_square m 1) + (boundary_exact m 0 hm (by omega)) (boundary_exact m 1 hm (by omega)) + (homology_boundary_two_zero m (by omega) 1) + +end + +attribute [local instance 1200] Rep.hV2 +variable {m p:ℕ} +instance empty_subsingleton (m : ℕ) : Subsingleton (Configuration m 0) := + ⟨fun _ _ => ext (fun i => Fin.elim0 i)⟩ + +noncomputable def empty (m : ℕ) : Configuration m 0 := standardLE m 0 (by omega) + +noncomputable def emptyIso (m : ℕ) : column m 0 ≅ Rep.trivial ℤ (G m) ℤ := + Rep.mkIso (Representation.Equiv.mk (Finsupp.uniqueLinearEquiv ℤ ℤ (empty m)) (by + intro g + apply Finsupp.lhom_ext + intro x z + change (TransitiveInduction.permutationRep g (single x z)) (empty m)= + (single x z) (empty m) + rw [TransitiveInduction.permutationRep_single] + congr 2 + exact Subsingleton.elim _ _)) + +@[simp] lemma emptyIso_single (m : ℕ) (x : Configuration m 0) (z : ℤ) : + (emptyIso m).hom.hom (single x z)=z := by + change (single x z) (empty m)=z + simp [Subsingleton.elim (empty m) x] +lemma augmentation_pointMap (f : Configuration m 1) (q : ℕ) : + groupHomology.map (MulAction.stabilizer (G m) f).subtype + (TransitiveInduction.pointMap f) q ≫ + (groupHomology.functor ℤ (G m) q).map (boundary m 0) ≫ + (groupHomology.functor ℤ (G m) q).map (emptyIso m).hom = + TrivialHomology.map (MulAction.stabilizer (G m) f).subtype q := by + erw [← Functor.map_comp] + erw [groupHomology.functor_map, ← groupHomology.map_comp] + apply groupHomology.map_congr + · rfl + · apply LinearMap.ext + intro z + change (emptyIso m).hom.hom ((boundary m 0).hom (single f z))=z + rw [boundary_zero_eq_face] + dsimp only [faceHom] + rw [TransitiveInduction.equivariantMap_single, emptyIso_single] +lemma stabilizer_H1_isIso (m : ℕ) (hm : 33 ≤ m) (f : Configuration m 1) : + IsIso (TrivialHomology.map (MulAction.stabilizer (G m) f).subtype 1) := by + have pointIso := TransitiveInduction.isIso_map_pointMap f (fun g => transitive f g) 1 + have boundaryIso := boundary_zero_H1_isIso m (by omega) + erw [← augmentation_pointMap f 1] + have lastIso : IsIso ((groupHomology.functor ℤ (G m) 1).map (emptyIso m).hom) := inferInstance + have tailIso := IsIso.comp_isIso' boundaryIso lastIso + exact IsIso.comp_isIso' pointIso tailIso + +end SimpleAmenable.SymmetricConfiguration + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Configurations/SymmetricStabilizer.lean b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/SymmetricStabilizer.lean new file mode 100644 index 0000000000000000000000000000000000000000..3ba985d5d1599ad6b000beb5835ec6854d156d17 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/SymmetricStabilizer.lean @@ -0,0 +1,76 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Configurations.SymmetricFaces + +namespace OAI + +section +open Classical CategoryTheory CategoryTheory.Limits Representation Rep Finsupp +namespace SimpleAmenable.SymmetricConfiguration + +attribute [local instance 1200] Rep.hV2 +noncomputable def tailEquiv (p n:ℕ) : Fin n ≃ {x:Fin (p+n) // p≤x.val} where + toFun i := ⟨Fin.natAdd p i,by simp⟩ + invFun x := ⟨x.val.val-p,by omega⟩ + left_inv _ := by apply Fin.ext; simp + right_inv _ := by apply Subtype.ext; apply Fin.ext; dsimp; omega +noncomputable def stabilize (p n:ℕ) : G n →* G (p+n) := + Equiv.Perm.ofSubtype.comp (Equiv.permCongrHom (tailEquiv p n)).toMonoidHom +lemma stabilize_apply_tail (p n:ℕ) (g:G n) (i:Fin n) : + stabilize p n g (Fin.natAdd p i)=Fin.natAdd p (g i) := by + change Equiv.Perm.ofSubtype ((Equiv.permCongrHom (tailEquiv p n)) g) _ = _ + rw [Equiv.Perm.ofSubtype_apply_of_mem _ (by simp)] + change ((tailEquiv p n) (g ((tailEquiv p n).symm ((tailEquiv p n) i)))).val = _ + rw [Equiv.symm_apply_apply] + rfl +lemma stabilize_apply_head (p n:ℕ) (g:G n) (i:Fin p) : + stabilize p n g (Fin.castAdd n i)=Fin.castAdd n i := by + apply Equiv.Perm.ofSubtype_apply_of_not_mem + exact not_le.mpr i.isLt +lemma stabilize_injective (p n:ℕ) : Function.Injective (stabilize p n) := by + intro _ _ gh + apply Equiv.ext + intro i + have hi := congrArg (fun g:G (p+n)=>g (Fin.natAdd p i)) gh + simpa only [stabilize_apply_tail,Fin.natAdd_inj] using hi +lemma stabilize_range (p n:ℕ) : (stabilize p n).range = + MulAction.stabilizer (G (p+n)) (standard p n) := by + ext g + constructor + · rintro ⟨h,rfl⟩ + apply ext + intro i + exact stabilize_apply_head p n h i + · intro hg + have hfix (i:Fin p) : g (Fin.castAdd n i)=Fin.castAdd n i := + congrArg (fun f:Configuration (p+n) p=>f i) hg + have hr : g ∈ (Equiv.Perm.ofSubtype : Equiv.Perm {x:Fin (p+n)//p≤x.val} →* G (p+n)).range := by + rw [Equiv.Perm.mem_range_ofSubtype_iff] + intro x hx + change p≤x.val + by_contra hp + have he := hfix ⟨x.val,by omega⟩ + exact (Equiv.Perm.mem_support.mp hx) he + obtain ⟨h,hh⟩ := hr + refine ⟨(Equiv.permCongrHom (tailEquiv p n)).symm h,?_⟩ + change Equiv.Perm.ofSubtype ((Equiv.permCongrHom (tailEquiv p n)) ((Equiv.permCongrHom (tailEquiv p n)).symm h))=g + rw [MulEquiv.apply_symm_apply] + exact hh +noncomputable def standardStabilizerEquiv (p n:ℕ) : G n ≃* + MulAction.stabilizer (G (p+n)) (standard p n) := + (MulEquiv.ofBijective (stabilize p n).rangeRestrict ⟨fun _ _ h=>stabilize_injective p n (congrArg Subtype.val h), + fun x=>by obtain ⟨g,hg⟩:=x.property; exact ⟨g,Subtype.ext hg⟩⟩).trans + (MulEquiv.subgroupCongr (stabilize_range p n)) +lemma standardStabilizerEquiv_subtype (p n:ℕ) : + (MulAction.stabilizer (G (p+n)) (standard p n)).subtype.comp + (standardStabilizerEquiv p n).toMonoidHom = stabilize p n := rfl +lemma stabilize_one_H1_isIso (n:ℕ) (hn:32≤n) : + IsIso (TrivialHomology.map (stabilize 1 n) 1) := by + rw [← standardStabilizerEquiv_subtype,TrivialHomology.map_comp] + have equivalenceIso := TrivialHomology.isIso_equiv (standardStabilizerEquiv 1 n) 1 + have stabilizerIso := stabilizer_H1_isIso (1+n) (by omega) (standard 1 n) + infer_instance +end SimpleAmenable.SymmetricConfiguration + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Configurations/SymmetricStable.lean b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/SymmetricStable.lean new file mode 100644 index 0000000000000000000000000000000000000000..a0c9f72a8b94e8d8a4e63c3f22d423b812c9c7a2 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/SymmetricStable.lean @@ -0,0 +1,96 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.SymmetricH1 +import OAI.GroupTheory.SimpleAmenable.Homology.FiniteGroupHomology + +namespace OAI + +open _root_.CategoryTheory _root_.OAI.CategoryTheory CategoryTheory.Limits Representation Rep +namespace SimpleAmenable.SymmetricConfiguration + +attribute [local instance 1200] Rep.hV2 + +noncomputable def successorStabilize (n : ℕ) : + G n →* G (n+1) := + (castGroup (Nat.add_comm 1 n)).toMonoidHom.comp (stabilize 1 n) + +noncomputable def fullHomologySequence (j : ℕ) : ℕ ⥤ ModuleCat ℤ := + Functor.ofSequence (fun n => TrivialHomology.map (successorStabilize n) j) + +lemma successor_H1_isIso (n : ℕ) (hn : 32 ≤ n) : + IsIso (TrivialHomology.map (successorStabilize n) 1) := by + unfold successorStabilize + rw [TrivialHomology.map_comp] + have := stabilize_one_H1_isIso n hn + have := TrivialHomology.isIso_equiv (castGroup (Nat.add_comm 1 n)) 1 + infer_instance + +lemma successor_H2_isIso (n : ℕ) (hn : 34 ≤ n) : + IsIso (TrivialHomology.map (successorStabilize n) 2) := by + unfold successorStabilize + rw [TrivialHomology.map_comp] + have := stabilize_one_H2_isIso n hn + have := TrivialHomology.isIso_equiv (castGroup (Nat.add_comm 1 n)) 2 + infer_instance +lemma fullH1_eventuallyConstant : + (fullHomologySequence 1).IsEventuallyConstantFrom 32 := by + apply Functor.isEventuallyConstantFrom_of_succ + intro n hn + dsimp only [fullHomologySequence] + erw [Functor.ofSequence_map_homOfLE_succ] + exact successor_H1_isIso n hn +lemma fullH2_eventuallyConstant : + (fullHomologySequence 2).IsEventuallyConstantFrom 34 := by + apply Functor.isEventuallyConstantFrom_of_succ + intro n hn + dsimp only [fullHomologySequence] + erw [Functor.ofSequence_map_homOfLE_succ] + exact successor_H2_isIso n hn + +lemma fullH1_colimit_ι_isIso (m : ℕ) (hm : 32 ≤ m) : + IsIso (colimit.ι (fullHomologySequence 1) m) := + (fullH1_eventuallyConstant).isIso_ι_of_isColimit' + (colimit.isColimit _) m (homOfLE hm) + +lemma fullH2_colimit_ι_isIso (m : ℕ) (hm : 34 ≤ m) : + IsIso (colimit.ι (fullHomologySequence 2) m) := + (fullH2_eventuallyConstant).isIso_ι_of_isColimit' + (colimit.isColimit _) m (homOfLE hm) +noncomputable def fullH1_colimitIso (m : ℕ) (hm : 32 ≤ m) : + groupHomology (Rep.trivial ℤ (G m) ℤ) 1 ≅ + colimit (fullHomologySequence 1) := by + have := fullH1_colimit_ι_isIso m hm + let e := asIso (colimit.ι (fullHomologySequence 1) m) + exact e +noncomputable def fullH2_colimitIso (m : ℕ) (hm : 34 ≤ m) : + groupHomology (Rep.trivial ℤ (G m) ℤ) 2 ≅ + colimit (fullHomologySequence 2) := by + have := fullH2_colimit_ι_isIso m hm + let e := asIso (colimit.ι (fullHomologySequence 2) m) + exact e +lemma finite_fullH1_iff_colimit (m : ℕ) (hm : 32 ≤ m) : + Module.Finite ℤ (groupHomology (Rep.trivial ℤ (G m) ℤ) 1) ↔ + Module.Finite ℤ (colimit (fullHomologySequence 1) : ModuleCat ℤ) := by + have h := FixedStageReturn.finite_stage_iff_colimit (fullHomologySequence 1) 32 m + (fun n hn => by + dsimp only [fullHomologySequence] + erw [Functor.ofSequence_map_homOfLE_succ] + exact successor_H1_isIso n hn) hm + exact h +lemma finite_fullH2_iff_colimit (m : ℕ) (hm : 34 ≤ m) : + Module.Finite ℤ (groupHomology (Rep.trivial ℤ (G m) ℤ) 2) ↔ + Module.Finite ℤ (colimit (fullHomologySequence 2) : ModuleCat ℤ) := by + have h := FixedStageReturn.finite_stage_iff_colimit (fullHomologySequence 2) 34 m + (fun n hn => by + dsimp only [fullHomologySequence] + erw [Functor.ofSequence_map_homOfLE_succ] + exact successor_H2_isIso n hn) hm + exact h +lemma stableH1_finite : Module.Finite ℤ (colimit (fullHomologySequence 1) : ModuleCat ℤ) := by + have := FiniteGroupHomology.finite (Rep.trivial ℤ (G 32) ℤ) 1 + exact Module.Finite.equiv (fullH1_colimitIso 32 (by omega)).toLinearEquiv +lemma stableH2_finite : Module.Finite ℤ (colimit (fullHomologySequence 2) : ModuleCat ℤ) := by + have := FiniteGroupHomology.finite (Rep.trivial ℤ (G 34) ℤ) 2 + exact Module.Finite.equiv (fullH2_colimitIso 34 (by omega)).toLinearEquiv +end SimpleAmenable.SymmetricConfiguration + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Configurations/TrackPoint.lean b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/TrackPoint.lean new file mode 100644 index 0000000000000000000000000000000000000000..ee94655218f05b99d8a3b6b37f4e2024f8b00bdc --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/TrackPoint.lean @@ -0,0 +1,441 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.PolygonAction + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +section PolygonFullGroup + +attribute [local instance] Classical.propDecidable + +abbrev TrackPoint (a m : ℕ) := Fin m × GenericSquare a + +structure TableChart (a m : ℕ) where + source : Fin m + target : Fin m + shift : CutRing × CutRing + domain : polygonAlgebra a + +def TableChart.Holds {a m : ℕ} (c : TableChart a m) (f : TrackPoint a m → TrackPoint a m) : Prop := + ∀ x ∈ c.domain.val, f (c.source, x) = (c.target, translate a c.shift x) + +def TableChart.Contains {a m : ℕ} (c : TableChart a m) (p : TrackPoint a m) : Prop := + p.1 = c.source ∧ p.2 ∈ c.domain.val + +def HasTranslationTable {a m : ℕ} (f : TrackPoint a m → TrackPoint a m) : Prop := + ∃ s : Finset (TableChart a m), + (∀ c ∈ s, c.Holds f) ∧ (∀ p, ∃ c ∈ s, c.Contains p) + +private def identityChart (a m : ℕ) (i : Fin m) : TableChart a m := + ⟨i, i, 0, ⟨Set.univ, BooleanSubalgebra.top_mem⟩⟩ + +theorem identity_hasTable (a m : ℕ) : HasTranslationTable (id : TrackPoint a m → TrackPoint a m) := by + classical + refine ⟨Finset.univ.image (identityChart a m), ?_, ?_⟩ + · intro c hc + obtain ⟨i, _, rfl⟩ := Finset.mem_image.mp hc + intro x _ + simp [identityChart] + · intro p + exact ⟨identityChart a m p.1, Finset.mem_image.mpr ⟨p.1, Finset.mem_univ _, rfl⟩, + rfl, Set.mem_univ _⟩ + +noncomputable def TableChart.comp {a m : ℕ} (c d : TableChart a m) : TableChart a m := + ⟨d.source, c.target, c.shift + d.shift, + ⟨d.domain.val ∩ translate a d.shift ⁻¹' c.domain.val, + BooleanSubalgebra.inf_mem d.domain.property (polygon_preimage_translate _ c.domain.property)⟩⟩ + +theorem TableChart.comp_holds {a m : ℕ} {c d : TableChart a m} + {f g : TrackPoint a m → TrackPoint a m} + (hc : c.Holds f) (hd : d.Holds g) (hcd : c.source = d.target) : + (c.comp d).Holds (f ∘ g) := by + intro x hx + change f (g (d.source, x)) = (c.target, translate a (c.shift + d.shift) x) + rw [hd x hx.1, ← hcd, hc _ hx.2, translate_add] + +theorem comp_hasTable {a m : ℕ} {f g : TrackPoint a m → TrackPoint a m} + (hf : HasTranslationTable f) (hg : HasTranslationTable g) : HasTranslationTable (f ∘ g) := by + classical + obtain ⟨s, hs, hscover⟩ := hf + obtain ⟨t, ht, htcover⟩ := hg + let pairs := (s ×ˢ t).filter (fun cd => cd.1.source = cd.2.target) + refine ⟨pairs.image (fun cd => cd.1.comp cd.2), ?_, ?_⟩ + · intro e he + obtain ⟨⟨c, d⟩, hcd, rfl⟩ := Finset.mem_image.mp he + obtain ⟨hmem, hmatch⟩ := Finset.mem_filter.mp hcd + obtain ⟨hc, hd⟩ := Finset.mem_product.mp hmem + exact TableChart.comp_holds (hs c hc) (ht d hd) hmatch + · intro p + obtain ⟨d, hd, hp⟩ := htcover p + obtain ⟨c, hc, hgp⟩ := hscover (g p) + have hdvalue : g p = (d.target, translate a d.shift p.2) := by + convert ht d hd p.2 hp.2 using 1 + exact congrArg g (Prod.ext hp.1 rfl : p = (d.source, p.2)) + have hmatch : c.source = d.target := by + rw [hdvalue] at hgp + exact hgp.1.symm + refine ⟨c.comp d, Finset.mem_image.mpr ⟨(c,d), ?_, rfl⟩, hp.1, hp.2, ?_⟩ + · exact Finset.mem_filter.mpr ⟨Finset.mem_product.mpr ⟨hc,hd⟩, hmatch⟩ + · change translate a d.shift p.2 ∈ c.domain.val + simpa only [hdvalue] using hgp.2 + +noncomputable def TableChart.inverse {a m : ℕ} (c : TableChart a m) : TableChart a m := + ⟨c.target, c.source, -c.shift, + ⟨translation a c.shift '' c.domain.val, polygon_image_translation _ c.domain.property⟩⟩ + +theorem inverse_hasTable {a m : ℕ} (f : Equiv.Perm (TrackPoint a m)) + (hf : HasTranslationTable f) : HasTranslationTable f.symm := by + classical + obtain ⟨s, hs, hcover⟩ := hf + refine ⟨s.image TableChart.inverse, ?_, ?_⟩ + · intro c hc + obtain ⟨d, hd, rfl⟩ := Finset.mem_image.mp hc + intro y hy + obtain ⟨x, hx, rfl⟩ := hy + change f.symm (d.target, translate a d.shift x) = + (d.source, translate a (-d.shift) (translate a d.shift x)) + rw [← hs d hd x hx, f.symm_apply_apply, ← translate_add, neg_add_cancel, translate_zero] + · intro p + obtain ⟨c, hc, hp⟩ := hcover (f.symm p) + have hvalue : f (c.source, (f.symm p).2) = + (c.target, translate a c.shift (f.symm p).2) := hs c hc _ hp.2 + have hpair : (c.source, (f.symm p).2) = f.symm p := Prod.ext hp.1.symm rfl + rw [hpair, f.apply_symm_apply] at hvalue + refine ⟨c.inverse, Finset.mem_image.mpr ⟨c,hc,rfl⟩, ?_, ?_⟩ + · exact congrArg Prod.fst hvalue + · exact ⟨(f.symm p).2, hp.2, (congrArg Prod.snd hvalue).symm⟩ + +noncomputable def polygonFullGroup (a m : ℕ) : Subgroup (Equiv.Perm (TrackPoint a m)) where + carrier := {f | HasTranslationTable f} + one_mem' := identity_hasTable a m + mul_mem' := comp_hasTable + inv_mem' := fun {f} h => inverse_hasTable f h + +noncomputable def SlotMap (a m : ℕ) (U : polygonAlgebra a) {n : ℕ} + (slots : Fin n → Fin m × (CutRing × CutRing)) : + Fin n × U.val → TrackPoint a m := + fun ix => ((slots ix.1).1, translate a (slots ix.1).2 ix.2.val) + +def IsThreeSlotCycle {a m : ℕ} (g : polygonFullGroup a m) : Prop := + ∃ (U : polygonAlgebra a) (slots : Fin 3 → Fin m × (CutRing × CutRing)), + U.val.Nonempty ∧ Function.Injective (SlotMap a m U slots) ∧ + (∀ (i : Fin 3) (x : U.val), + g.val (SlotMap a m U slots (i,x)) = SlotMap a m U slots (i+1,x)) ∧ + (∀ p ∉ Set.range (SlotMap a m U slots), g.val p = p) + +noncomputable def polygonAlternatingGroup (a m : ℕ) : Subgroup (polygonFullGroup a m) := + Subgroup.closure {g | IsThreeSlotCycle g} + +noncomputable def conditionalPerm {a m : ℕ} (U : polygonAlgebra a) + (σ : Equiv.Perm (Fin m)) : Equiv.Perm (TrackPoint a m) := by + classical + exact { + toFun := fun p => (if p.2 ∈ U.val then σ p.1 else p.1, p.2) + invFun := fun p => (if p.2 ∈ U.val then σ.symm p.1 else p.1, p.2) + left_inv := by intro p; by_cases h : p.2 ∈ U.val <;> simp [h] + right_inv := by intro p; by_cases h : p.2 ∈ U.val <;> simp [h] } + +@[simp] theorem conditionalPerm_apply {a m : ℕ} (U : polygonAlgebra a) + (σ : Equiv.Perm (Fin m)) (p : TrackPoint a m) : + conditionalPerm U σ p = (if p.2 ∈ U.val then σ p.1 else p.1, p.2) := by + classical + rfl + +private noncomputable def conditionalChart {a m : ℕ} (U : polygonAlgebra a) + (σ : Equiv.Perm (Fin m)) (b : Bool) (i : Fin m) : TableChart a m := + ⟨i, if b then σ i else i, 0, + if b then U else ⟨U.valᶜ, BooleanSubalgebra.compl_mem U.property⟩⟩ + +theorem conditional_hasTable {a m : ℕ} (U : polygonAlgebra a) + (σ : Equiv.Perm (Fin m)) : HasTranslationTable (conditionalPerm U σ) := by + classical + refine ⟨Finset.univ.image (fun bi : Bool × Fin m => conditionalChart U σ bi.1 bi.2), ?_, ?_⟩ + · intro c hc + obtain ⟨⟨b,i⟩, _, rfl⟩ := Finset.mem_image.mp hc + cases b <;> intro x hx + · change x ∉ U.val at hx + simp [conditionalChart, hx] + · change x ∈ U.val at hx + simp [conditionalChart, hx] + · intro p + by_cases hp : p.2 ∈ U.val + · refine ⟨conditionalChart U σ true p.1, ?_, ?_⟩ + · exact Finset.mem_image.mpr ⟨(true,p.1), Finset.mem_univ _,rfl⟩ + · exact ⟨rfl,hp⟩ + · refine ⟨conditionalChart U σ false p.1, ?_, ?_⟩ + · exact Finset.mem_image.mpr ⟨(false,p.1), Finset.mem_univ _,rfl⟩ + · exact ⟨rfl,hp⟩ + +noncomputable def conditionalHom {a m : ℕ} (U : polygonAlgebra a) : + Equiv.Perm (Fin m) →* polygonFullGroup a m where + toFun σ := ⟨conditionalPerm U σ, conditional_hasTable U σ⟩ + map_one' := by + apply Subtype.ext + apply Equiv.ext + intro p + change conditionalPerm U 1 p = p + simp + map_mul' σ ρ := by + apply Subtype.ext + apply Equiv.ext + intro p + change conditionalPerm U (σ * ρ) p = conditionalPerm U σ (conditionalPerm U ρ p) + by_cases hp : p.2 ∈ U.val <;> simp [hp] + +noncomputable def slotPerm {a m n : ℕ} (U : polygonAlgebra a) + (slots : Fin n → Fin m × (CutRing × CutRing)) + (hinj : Function.Injective (SlotMap a m U slots)) + (σ : Equiv.Perm (Fin n)) : Equiv.Perm (TrackPoint a m) := + Equiv.Perm.viaEmbedding (Equiv.prodCongr σ (Equiv.refl U.val)) ⟨SlotMap a m U slots, hinj⟩ + +theorem slotPerm_apply {a m n : ℕ} (U : polygonAlgebra a) + (slots : Fin n → Fin m × (CutRing × CutRing)) + (hinj : Function.Injective (SlotMap a m U slots)) (σ : Equiv.Perm (Fin n)) + (i : Fin n) (x : U.val) : + slotPerm U slots hinj σ (SlotMap a m U slots (i,x)) = + SlotMap a m U slots (σ i,x) := + Equiv.Perm.viaEmbedding_apply _ _ _ + +theorem slotPerm_apply_of_notMem {a m n : ℕ} (U : polygonAlgebra a) + (slots : Fin n → Fin m × (CutRing × CutRing)) + (hinj : Function.Injective (SlotMap a m U slots)) (σ : Equiv.Perm (Fin n)) + {p : TrackPoint a m} (hp : p ∉ Set.range (SlotMap a m U slots)) : + slotPerm U slots hinj σ p = p := + Equiv.Perm.viaEmbedding_apply_of_notMem _ _ _ hp + +private noncomputable def slotChart {a m n : ℕ} (U : polygonAlgebra a) + (slots : Fin n → Fin m × (CutRing × CutRing)) (σ : Equiv.Perm (Fin n)) + (i : Fin n) : TableChart a m := + ⟨(slots i).1, (slots (σ i)).1, (slots (σ i)).2 - (slots i).2, + ⟨translate a (slots i).2 '' U.val, polygon_image_translation _ U.property⟩⟩ + +private def slotVoid {a m n : ℕ} (U : polygonAlgebra a) + (slots : Fin n → Fin m × (CutRing × CutRing)) (i : Fin m) : + Set (GenericSquare a) := + (⋃ j : Fin n, ⋃ (_ : (slots j).1 = i), translate a (slots j).2 '' U.val)ᶜ + +private theorem slotVoid_mem {a m n : ℕ} (U : polygonAlgebra a) + (slots : Fin n → Fin m × (CutRing × CutRing)) (i : Fin m) : + slotVoid U slots i ∈ polygonAlgebra a := by + apply BooleanSubalgebra.compl_mem + apply BooleanSubalgebra.iSup_mem + intro j + apply BooleanSubalgebra.iSup_mem + intro _ + exact polygon_image_translation _ U.property + +private theorem mem_slotVoid {a m n : ℕ} (U : polygonAlgebra a) + (slots : Fin n → Fin m × (CutRing × CutRing)) (p : TrackPoint a m) : + p.2 ∈ slotVoid U slots p.1 ↔ p ∉ Set.range (SlotMap a m U slots) := by + simp only [slotVoid, Set.mem_compl_iff, Set.mem_iUnion, Set.mem_image, Set.mem_range] + constructor + · rintro h ⟨⟨i,x⟩, he⟩ + apply h + exact ⟨i, congrArg Prod.fst he, x.val, x.property, congrArg Prod.snd he⟩ + · rintro h ⟨i, hi, x, hx, he⟩ + apply h + exact ⟨(i,⟨x,hx⟩), Prod.ext hi he⟩ + +private noncomputable def slotVoidChart {a m n : ℕ} (U : polygonAlgebra a) + (slots : Fin n → Fin m × (CutRing × CutRing)) (i : Fin m) : TableChart a m := + ⟨i,i,0,⟨slotVoid U slots i, slotVoid_mem U slots i⟩⟩ + +theorem slotPerm_hasTable {a m n : ℕ} (U : polygonAlgebra a) + (slots : Fin n → Fin m × (CutRing × CutRing)) + (hinj : Function.Injective (SlotMap a m U slots)) (σ : Equiv.Perm (Fin n)) : + HasTranslationTable (slotPerm U slots hinj σ) := by + classical + refine ⟨(Finset.univ.image (slotChart U slots σ)) ∪ + (Finset.univ.image (slotVoidChart U slots)), ?_, ?_⟩ + · intro c hc + rcases Finset.mem_union.mp hc with hc | hc + · obtain ⟨i, _, rfl⟩ := Finset.mem_image.mp hc + intro x hx + obtain ⟨y, hy, rfl⟩ := hx + change slotPerm U slots hinj σ (SlotMap a m U slots (i,⟨y,hy⟩)) = _ + rw [slotPerm_apply] + change ((slots (σ i)).1, translate a (slots (σ i)).2 y) = + ((slots (σ i)).1, translate a ((slots (σ i)).2 - (slots i).2) + (translate a (slots i).2 y)) + rw [← translate_add] + simp + · obtain ⟨i, _, rfl⟩ := Finset.mem_image.mp hc + intro x hx + change slotPerm U slots hinj σ (i,x) = (i,translate a 0 x) + rw [translate_zero] + exact slotPerm_apply_of_notMem U slots hinj σ ((mem_slotVoid U slots (i,x)).mp hx) + · intro p + by_cases hp : p ∈ Set.range (SlotMap a m U slots) + · obtain ⟨⟨i,x⟩, rfl⟩ := hp + refine ⟨slotChart U slots σ i, Finset.mem_union_left _ ?_, rfl, ?_⟩ + · exact Finset.mem_image.mpr ⟨i, Finset.mem_univ _, rfl⟩ + · exact ⟨x.val, x.property, rfl⟩ + · refine ⟨slotVoidChart U slots p.1, Finset.mem_union_right _ ?_, rfl, ?_⟩ + · exact Finset.mem_image.mpr ⟨p.1, Finset.mem_univ _, rfl⟩ + · exact (mem_slotVoid U slots p).mpr hp + +noncomputable def slotHom {a m n : ℕ} (U : polygonAlgebra a) + (slots : Fin n → Fin m × (CutRing × CutRing)) + (hinj : Function.Injective (SlotMap a m U slots)) : + Equiv.Perm (Fin n) →* polygonFullGroup a m where + toFun σ := ⟨slotPerm U slots hinj σ, slotPerm_hasTable U slots hinj σ⟩ + map_one' := by + apply Subtype.ext + apply Equiv.ext + intro p + by_cases hp : p ∈ Set.range (SlotMap a m U slots) + · obtain ⟨⟨i,x⟩, rfl⟩ := hp + exact slotPerm_apply U slots hinj 1 i x + · exact slotPerm_apply_of_notMem U slots hinj 1 hp + map_mul' σ ρ := by + apply Subtype.ext + apply Equiv.ext + intro p + change slotPerm U slots hinj (σ * ρ) p = + slotPerm U slots hinj σ (slotPerm U slots hinj ρ p) + by_cases hp : p ∈ Set.range (SlotMap a m U slots) + · obtain ⟨⟨i,x⟩, rfl⟩ := hp + simp only [slotPerm_apply, Equiv.Perm.mul_apply] + · simp only [slotPerm_apply_of_notMem U slots hinj _ hp] + +theorem SlotMap_injective_mono {a m n : ℕ} {U V : polygonAlgebra a} + (slots : Fin n → Fin m × (CutRing × CutRing)) (hVU : V.val ⊆ U.val) + (hU : Function.Injective (SlotMap a m U slots)) : + Function.Injective (SlotMap a m V slots) := by + rintro ⟨i,x⟩ ⟨j,y⟩ he + have ht := hU (show SlotMap a m U slots (i,⟨x.val,hVU x.property⟩) = + SlotMap a m U slots (j,⟨y.val,hVU y.property⟩) from he) + exact Prod.ext (congrArg (fun p : Fin n × U.val => p.1) ht) + (Subtype.ext (congrArg (fun p => p.2.val) ht)) + +private noncomputable def polygonInter {a : ℕ} (U V : polygonAlgebra a) : polygonAlgebra a := + ⟨U.val ∩ V.val, BooleanSubalgebra.inf_mem U.property V.property⟩ + +private noncomputable def polygonDiff {a : ℕ} (U V : polygonAlgebra a) : polygonAlgebra a := + ⟨U.val \ V.val, BooleanSubalgebra.inf_mem U.property (BooleanSubalgebra.compl_mem V.property)⟩ + +private theorem slotPerm_restrict_apply {a m n : ℕ} {U V : polygonAlgebra a} + (slots : Fin n → Fin m × (CutRing × CutRing)) (hVU : V.val ⊆ U.val) + (hU : Function.Injective (SlotMap a m U slots)) (σ : Equiv.Perm (Fin n)) + (i : Fin n) (x : U.val) : + slotPerm V slots (SlotMap_injective_mono slots hVU hU) σ (SlotMap a m U slots (i,x)) = + if x.val ∈ V.val then SlotMap a m U slots (σ i,x) else SlotMap a m U slots (i,x) := by + classical + split_ifs with hx + · exact slotPerm_apply V slots _ σ i ⟨x.val,hx⟩ + · apply slotPerm_apply_of_notMem + rintro ⟨⟨j,y⟩,he⟩ + have ht := hU (show SlotMap a m U slots (j,⟨y.val,hVU y.property⟩) = + SlotMap a m U slots (i,x) from he) + have hyx : y.val = x.val := congrArg (fun p => p.2.val) ht + exact hx (hyx ▸ y.property) + +theorem slotHom_split {a m n : ℕ} (U V : polygonAlgebra a) + (slots : Fin n → Fin m × (CutRing × CutRing)) + (hU : Function.Injective (SlotMap a m U slots)) (σ : Equiv.Perm (Fin n)) : + slotHom U slots hU σ = + slotHom (polygonInter U V) slots (SlotMap_injective_mono slots (fun _ h => h.1) hU) σ * + slotHom (polygonDiff U V) slots (SlotMap_injective_mono slots (fun _ h => h.1) hU) σ := by + classical + apply Subtype.ext + apply Equiv.ext + intro p + change slotPerm U slots hU σ p = + slotPerm (polygonInter U V) slots _ σ (slotPerm (polygonDiff U V) slots _ σ p) + by_cases hp : p ∈ Set.range (SlotMap a m U slots) + · obtain ⟨⟨i,x⟩,rfl⟩ := hp + rw [slotPerm_apply, slotPerm_restrict_apply slots (V := polygonDiff U V) (fun _ h => h.1) hU σ] + by_cases hx : x.val ∈ V.val + · simp only [polygonDiff, Set.mem_sdiff, x.property, hx, not_true_eq_false, and_false, + ↓reduceIte] + rw [slotPerm_restrict_apply slots (V := polygonInter U V) (fun _ h => h.1) hU σ] + simp [polygonInter, x.property, hx] + · simp only [polygonDiff, Set.mem_sdiff, x.property, hx, not_false_eq_true, and_self, + ↓reduceIte] + rw [slotPerm_restrict_apply slots (V := polygonInter U V) (fun _ h => h.1) hU σ] + simp [polygonInter, x.property, hx] + · have hout (W : polygonAlgebra a) (hW : W.val ⊆ U.val) : p ∉ Set.range (SlotMap a m W slots) := by + rintro ⟨⟨i,x⟩,he⟩ + exact hp ⟨(i,⟨x.val,hW x.property⟩),he⟩ + rw [slotPerm_apply_of_notMem _ _ _ _ hp, + slotPerm_apply_of_notMem _ _ _ _ (hout (polygonDiff U V) (fun _ h => h.1)), + slotPerm_apply_of_notMem _ _ _ _ (hout (polygonInter U V) (fun _ h => h.1))] + +theorem slotHom_empty {a m n : ℕ} (U : polygonAlgebra a) + (slots : Fin n → Fin m × (CutRing × CutRing)) + (hU : Function.Injective (SlotMap a m U slots)) (σ : Equiv.Perm (Fin n)) + (h_empty : U.val = ∅) : slotHom U slots hU σ = 1 := by + apply Subtype.ext + apply Equiv.ext + intro p + apply slotPerm_apply_of_notMem + rintro ⟨⟨i,x⟩,_⟩ + simpa [h_empty] using x.property + +theorem slotHom_of_finite_cover {a m n : ℕ} {β : Type*} + (s : Finset β) (cover : β → polygonAlgebra a) (U : polygonAlgebra a) + (slots : Fin n → Fin m × (CutRing × CutRing)) + (hU : Function.Injective (SlotMap a m U slots)) (σ : Equiv.Perm (Fin n)) + (N : Subgroup (polygonFullGroup a m)) + (hcover : ∀ x ∈ U.val, ∃ b ∈ s, x ∈ (cover b).val) + (hlocal : ∀ b ∈ s, ∀ V : polygonAlgebra a, ∀ hV : V.val ⊆ U.val, + V.val ⊆ (cover b).val → + slotHom V slots (SlotMap_injective_mono slots hV hU) σ ∈ N) : + slotHom U slots hU σ ∈ N := by + classical + induction s using Finset.induction_on generalizing U with + | empty => + have hu : U.val = ∅ := Set.eq_empty_iff_forall_notMem.mpr (by + intro x hx + obtain ⟨b,hb,_⟩ := hcover x hx + simp at hb) + rw [slotHom_empty U slots hU σ hu] + exact N.one_mem + | @insert b s hb ih => + rw [slotHom_split U (cover b) slots hU σ] + apply N.mul_mem + · exact hlocal b (Finset.mem_insert_self ..) (polygonInter U (cover b)) (fun _ h => h.1) (fun _ h => h.2) + · apply ih + · intro x hx + obtain ⟨c,hc,hxc⟩ := hcover x hx.1 + rcases Finset.mem_insert.mp hc with rfl | hc + · exact (hx.2 hxc).elim + · exact ⟨c,hc,hxc⟩ + · intro c hc V hV hVc + exact hlocal c (Finset.mem_insert_of_mem hc) V (fun x hx => (hV hx).1) hVc + +theorem slotHom_conjugate {a m n : ℕ} (U : polygonAlgebra a) + (slots targets : Fin n → Fin m × (CutRing × CutRing)) + (hU : Function.Injective (SlotMap a m U slots)) + (hT : Function.Injective (SlotMap a m U targets)) + (g : polygonFullGroup a m) + (htransport : ∀ (i : Fin n) (x : U.val), + g.val (SlotMap a m U slots (i,x)) = SlotMap a m U targets (i,x)) + (σ : Equiv.Perm (Fin n)) : + g * slotHom U slots hU σ * g⁻¹ = slotHom U targets hT σ := by + apply Subtype.ext + apply Equiv.ext + intro y + obtain ⟨p,rfl⟩ := g.val.surjective y + change g.val (slotPerm U slots hU σ (g.val.symm (g.val p))) = + slotPerm U targets hT σ (g.val p) + rw [g.val.symm_apply_apply] + by_cases hp : p ∈ Set.range (SlotMap a m U slots) + · obtain ⟨⟨i,x⟩,rfl⟩ := hp + rw [slotPerm_apply, htransport, htransport, slotPerm_apply] + · have hout : g.val p ∉ Set.range (SlotMap a m U targets) := by + rintro ⟨⟨i,x⟩,he⟩ + rw [← htransport] at he + exact hp ⟨(i,x),g.val.injective he⟩ + rw [slotPerm_apply_of_notMem U slots hU σ hp, + slotPerm_apply_of_notMem U targets hT σ hout] + +end PolygonFullGroup +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Configurations/TrackTranslationChart.lean b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/TrackTranslationChart.lean new file mode 100644 index 0000000000000000000000000000000000000000..b98e0aa1df5d8cb0b73f6e40fe55cd03923fbaa3 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/TrackTranslationChart.lean @@ -0,0 +1,178 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.TupleChartDomain + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +section PolygonFullGroup +attribute [local instance] Classical.propDecidable + +private noncomputable def trackTranslationChart {a m : ℕ} + (d : Fin m → CutRing × CutRing) (i : Fin m) : TableChart a m := + ⟨i,i,d i,⟨Set.univ,BooleanSubalgebra.top_mem⟩⟩ + +theorem trackTranslation_hasTable {a m : ℕ} (d : Fin m → CutRing × CutRing) : + HasTranslationTable (trackTranslationPerm (a := a) d) := by + classical + refine ⟨Finset.univ.image (trackTranslationChart d), ?_, ?_⟩ + · intro c hc + obtain ⟨i,_,rfl⟩ := Finset.mem_image.mp hc + intro x _ + rfl + · intro p + exact ⟨trackTranslationChart d p.1, + Finset.mem_image.mpr ⟨p.1,Finset.mem_univ _,rfl⟩,rfl,Set.mem_univ _⟩ + +noncomputable def trackTranslation {a m : ℕ} (d : Fin m → CutRing × CutRing) : + polygonFullGroup a m := ⟨trackTranslationPerm d,trackTranslation_hasTable d⟩ + +@[simp] theorem trackTranslation_apply {a m : ℕ} (d : Fin m → CutRing × CutRing) + (p : TrackPoint a m) : + (trackTranslation d).val p = (p.1,translate a (d p.1) p.2) := rfl + +@[simp] theorem trackTranslation_zero {a m : ℕ} : + trackTranslation (a := a) (m := m) 0 = 1 := by + apply Subtype.ext + apply Equiv.ext + intro p + simp + +@[simp] theorem trackTranslation_add {a m : ℕ} (d e : Fin m → CutRing × CutRing) : + trackTranslation (a := a) (d+e) = trackTranslation d * trackTranslation e := by + apply Subtype.ext + apply Equiv.ext + intro p + change (p.1,translate a (d p.1 + e p.1) p.2) = + (p.1,translate a (d p.1) (translate a (e p.1) p.2)) + rw [translate_add] + +@[simp] theorem trackTranslation_neg {a m : ℕ} (d : Fin m → CutRing × CutRing) : + trackTranslation (a := a) (-d) = (trackTranslation d)⁻¹ := by + apply Subtype.ext + apply Equiv.ext + intro p + rfl + +@[simp] theorem trackTranslation_sub {a m : ℕ} (d e : Fin m → CutRing × CutRing) : + trackTranslation (a := a) (d-e) = trackTranslation d * (trackTranslation e)⁻¹ := by + rw [sub_eq_add_neg,trackTranslation_add,trackTranslation_neg] + +noncomputable def wholePolygon (a : ℕ) : polygonAlgebra a := + ⟨Set.univ,BooleanSubalgebra.top_mem⟩ + +theorem constant_conjugate_translation {a m : ℕ} (ρ : Equiv.Perm (Fin m)) + (d : Fin m → CutRing × CutRing) : + conditionalHom (wholePolygon a) ρ * trackTranslation d * + (conditionalHom (wholePolygon a) ρ)⁻¹ = + trackTranslation (fun i => d (ρ.symm i)) := by + apply Subtype.ext + apply Equiv.ext + intro p + change conditionalPerm (wholePolygon a) ρ + (trackTranslationPerm d ((conditionalPerm (wholePolygon a) ρ).symm p)) = _ + simp [conditionalPerm,wholePolygon,trackTranslationPerm,trackTranslation] + +theorem constant_conjugate_point_translation {a m : ℕ} (ρ : Equiv.Perm (Fin m)) + (i : Fin m) (v : CutRing × CutRing) : + conditionalHom (wholePolygon a) ρ * trackTranslation (Pi.single i v) * + (conditionalHom (wholePolygon a) ρ)⁻¹ = + trackTranslation (Pi.single (ρ i) v) := by + rw [constant_conjugate_translation] + congr 1 + funext j + simp only [Pi.single_apply] + congr 1 + exact propext (Equiv.symm_apply_eq ρ) + +theorem trackTranslation_difference_mem {a m : ℕ} (hm : 3 ≤ m) + (i j : Fin m) (v : CutRing × CutRing) : + trackTranslation (a := a) (Pi.single j v - Pi.single i v) ∈ polygonAlternatingGroup a m := by + classical + by_cases hij : i = j + · subst j + simp + obtain ⟨k,hki,hkj⟩ := Fin.exists_ne_and_ne_of_two_lt i j (by omega) + let ι : Fin 3 ↪ Fin m := ⟨![i,j,k], by + intro s t h + fin_cases s <;> fin_cases t <;> simp_all⟩ + let c := conditionalHom (wholePolygon a) (trackCycle ι) + let t := trackTranslation (a := a) (Pi.single i v) + have hc : c ∈ polygonAlternatingGroup a m := conditional_cycle_mem _ _ + have hnormal := polygonAlternatingGroup_normal a m + have ht : c * t * c⁻¹ * t⁻¹ ∈ polygonAlternatingGroup a m := by + have hconj := hnormal.conj_mem c⁻¹ ((polygonAlternatingGroup a m).inv_mem hc) t + simpa only [mul_assoc] using (polygonAlternatingGroup a m).mul_mem hc hconj + have he : (trackCycle ι) i = j := trackCycle_apply ι 0 + have heq : c * t * c⁻¹ = trackTranslation (a := a) (Pi.single j v) := by + change conditionalHom (wholePolygon a) (trackCycle ι) * trackTranslation (Pi.single i v) * + (conditionalHom (wholePolygon a) (trackCycle ι))⁻¹ = _ + rw [constant_conjugate_point_translation,he] + rw [heq] at ht + simpa only [trackTranslation_sub,t] using ht + +noncomputable def coordinatePrimitive (a : ℕ) (j : Fin 2) : polygonAlgebra a := + ⟨halfPlane a (Fin.castLE (by omega) j) (cutTau-1) ∩ + (halfPlane a (Fin.castLE (by omega) j) 0)ᶜ, + BooleanSubalgebra.inf_mem (halfPlane_mem _ _ _) (BooleanSubalgebra.compl_mem + (halfPlane_mem _ _ _))⟩ + +noncomputable def circularBoxPiece (a : ℕ) (r : CutRing) (k : Fin 2 × Fin 2) : + polygonAlgebra a := + ⟨(halfPlane a 0 (r + (k.1.val : CutRing)) ∩ + (halfPlane a 0 (-r + (k.1.val : CutRing)))ᶜ) ∩ + (halfPlane a 1 (r + (k.2.val : CutRing)) ∩ + (halfPlane a 1 (-r + (k.2.val : CutRing)))ᶜ), by + apply BooleanSubalgebra.inf_mem <;> apply BooleanSubalgebra.inf_mem + · exact halfPlane_mem _ _ _ + · exact BooleanSubalgebra.compl_mem (halfPlane_mem _ _ _) + · exact halfPlane_mem _ _ _ + · exact BooleanSubalgebra.compl_mem (halfPlane_mem _ _ _)⟩ + +noncomputable def clippedSlopePrimitive (a : ℕ) (r : CutRing) (j : Fin 4) : + polygonAlgebra a := + ⟨⋃ k : Fin 2 × Fin 2, (circularBoxPiece a r k).val ∩ + (halfPlane a j (integralCutForm a j (k.1.val,k.2.val)))ᶜ, by + apply BooleanSubalgebra.iSup_mem + intro k + exact BooleanSubalgebra.inf_mem (circularBoxPiece a r k).property + (BooleanSubalgebra.compl_mem (halfPlane_mem _ _ _))⟩ + +noncomputable def initialTest (a : ℕ) (r : CutRing) : Fin 5 → polygonAlgebra a := + ![wholePolygon a,coordinatePrimitive a 0,coordinatePrimitive a 1, + clippedSlopePrimitive a r 2,clippedSlopePrimitive a r 3] + +def SourceGeneratorLabel (m : ℕ) := + (Fin 5 × {σ : Equiv.Perm (Fin (m+1)) // + σ ∈ alternatingGroup (Fin (m+1)) ∧ σ.support.card ≤ 5}) ⊕ (Fin m × Fin 2) + +instance (m : ℕ) : Finite (SourceGeneratorLabel m) := by + unfold SourceGeneratorLabel + infer_instance + +noncomputable def sourceGenerator (a : ℕ) (r : CutRing) (m : ℕ) : + SourceGeneratorLabel m → polygonFullGroup a (m+1) + | Sum.inl (j,σ) => conditionalHom (initialTest a r j) σ.val + | Sum.inr (i,j) => trackTranslation + (Pi.single i.castSucc (if j = 0 then (cutTau,0) else (0,cutTau)) - + Pi.single (Fin.last m) (if j = 0 then (cutTau,0) else (0,cutTau))) + +theorem sourceGenerator_mem (a : ℕ) (r : CutRing) (m : ℕ) (hm : 2 ≤ m) + (s : SourceGeneratorLabel m) : sourceGenerator a r m s ∈ polygonAlternatingGroup a (m+1) := by + cases s with + | inl s => exact conditionalHom_alternating_mem _ s.2.property.1 + | inr s => exact trackTranslation_difference_mem (by omega) _ _ _ + +noncomputable def alternatingGenerator (a : ℕ) (r : CutRing) (m : ℕ) (hm : 2 ≤ m) : + SourceGeneratorLabel m → polygonAlternatingGroup a (m+1) := + fun s => ⟨sourceGenerator a r m s,sourceGenerator_mem a r m hm s⟩ + +end PolygonFullGroup + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Configurations/TrajectoryCoordinates.lean b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/TrajectoryCoordinates.lean new file mode 100644 index 0000000000000000000000000000000000000000..a54b43eef649ded6f0cfae8bc97eedb9c91eb710 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/TrajectoryCoordinates.lean @@ -0,0 +1,67 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.ReindexHomology +import OAI.GroupTheory.SimpleAmenable.Configurations.TrajectoryFaces +import OAI.GroupTheory.SimpleAmenable.Homology.TrajectoryTensor + +namespace OAI + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory +open scoped TensorProduct +namespace SimpleAmenable.PolygonObject.LabelledStage +open Labelled + +variable {a n : ℕ} {K : Type} [AddCommGroup K] +abbrev RankTwo := Multiplicative (ℤ×ℤ) +noncomputable def negativeProjection (u : CutRing × CutRing) : RankTwo := + (SquareStep.orbitProjection (Multiplicative.ofAdd u))⁻¹ +lemma negativeProjection_add (u v : CutRing × CutRing) : + negativeProjection (u+v)=negativeProjection u*negativeProjection v := by + change (SquareStep.orbitProjection (Multiplicative.ofAdd u*Multiplicative.ofAdd v))⁻¹ = _ + rw [map_mul,mul_inv_rev,mul_comm] + rfl + +noncomputable def signedLabelEquiv (n : ℕ) : ReducedLabel n ≃ (Fin n → RankTwo) := + (reducedLabelEquiv n).trans (Equiv.piCongrRight (fun _ => Equiv.inv RankTwo)) +lemma signedLabelEquiv_apply (l : ReducedLabel n) (i : Fin n) : + signedLabelEquiv n l i=negativeProjection (l.val i) := rfl +lemma signedLabel_zero_face (l : ReducedLabel (n+1)) : + signedLabelEquiv n (labelMap (reindexLabel (faceFunctor 0)) + (reindexLabel_reduced (faceFunctor 0)) l)=Fin.tail (signedLabelEquiv (n+1) l) := by + change (fun i => negativeProjection (reindexLabel (faceFunctor 0) l.val i)) = _ + rw [reindexLabel_zero_face] + rfl +lemma signedLabel_succ_face (l : ReducedLabel (n+1)) (i : Fin (n+1)) : + signedLabelEquiv n (labelMap (reindexLabel (faceFunctor i.succ)) + (reindexLabel_reduced (faceFunctor i.succ)) l)=i.contractNth (·*·) (signedLabelEquiv (n+1) l) := by + change (fun k => negativeProjection (reindexLabel (faceFunctor i.succ) l.val k)) = _ + rw [reindexLabel_succ_face] + exact Fin.comp_contractNth (·+·) (·*·) negativeProjection_add i l.val +noncomputable def chainCoordinates (a n : ℕ) (K : Type) [AddCommGroup K] : + Coefficients a n K ≃ₗ[ℤ] ((Fin n → RankTwo) →₀ (SquareStep a ⊗[ℤ] K)) := + (Finsupp.mapRange.linearEquiv (BooleanStep.tensorEquiv (a:=a) (K:=K)).symm).trans + (Finsupp.domLCongr (signedLabelEquiv n)) +lemma chainCoordinates_single (l : ReducedLabel n) (v : BooleanStep a K) : + chainCoordinates a n K (Finsupp.single l v)= + Finsupp.single (signedLabelEquiv n l) ((BooleanStep.tensorEquiv (a:=a) (K:=K)).symm v) := by + simp [chainCoordinates] +lemma chainCoordinates_zero_face (l : ReducedLabel (n+1)) (v : BooleanStep a K) : + chainCoordinates a n K (reindexCoefficients (K:=K) (faceFunctor 0) (Finsupp.single l v)) = + Finsupp.single (Fin.tail (signedLabelEquiv (n+1) l)) + ((SquareStep.coefficientRep a K).ρ ((signedLabelEquiv (n+1) l 0)⁻¹) + ((BooleanStep.tensorEquiv (a:=a) (K:=K)).symm v)) := by + rw [reindexCoefficients_single,chainCoordinates_single,signedLabel_zero_face, + initialDisplacement_zero_face,tensorEquiv_symm_translation] + simp only [signedLabelEquiv_apply,negativeProjection,inv_inv] + rfl +lemma chainCoordinates_succ_face (l : ReducedLabel (n+1)) (v : BooleanStep a K) (i : Fin (n+1)) : + chainCoordinates a n K (reindexCoefficients (K:=K) (faceFunctor i.succ) (Finsupp.single l v)) = + Finsupp.single (i.contractNth (·*·) (signedLabelEquiv (n+1) l)) + ((BooleanStep.tensorEquiv (a:=a) (K:=K)).symm v) := by + rw [reindexCoefficients_single,chainCoordinates_single,signedLabel_succ_face, + initialDisplacement_succ_face,stepTranslate_zero] +end SimpleAmenable.PolygonObject.LabelledStage + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Configurations/TrajectoryFaces.lean b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/TrajectoryFaces.lean new file mode 100644 index 0000000000000000000000000000000000000000..39fa5a7c93e538de37b5506a5daa7e7d8cdeb7f4 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/TrajectoryFaces.lean @@ -0,0 +1,40 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.TrajectoryReindexLabels + +namespace OAI + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory +namespace SimpleAmenable.PolygonObject.Labelled + +variable {n : ℕ} +abbrev faceFunctor (i : Fin (n+2)) : Fin (n+1) ⥤ Fin (n+2) := + (SimplexCategory.δ i).toOrderHom.toFunctor +lemma faceFunctor_obj (i : Fin (n+2)) (k : Fin (n+1)) : + (faceFunctor i).obj k = i.succAbove k := rfl +lemma reindexLabel_zero_face (g : Fin (n+1) → CutRing × CutRing) : + reindexLabel (faceFunctor (0 : Fin (n+2))) g = Fin.tail g := by + funext k + simp only [reindexLabel,faceFunctor_obj,Fin.zero_succAbove,Fin.partialSum_succ'] + rw [show g 0 + Fin.partialSum (Fin.tail g) k.succ - + (g 0 + Fin.partialSum (Fin.tail g) k.castSucc) = + -Fin.partialSum (Fin.tail g) k.castSucc + Fin.partialSum (Fin.tail g) k.succ by abel] + rw [Fin.partialSum_succ] + abel +lemma reindexLabel_succ_face (g : Fin (n+1) → CutRing × CutRing) (i : Fin (n+1)) : + reindexLabel (faceFunctor i.succ) g = i.contractNth (·+·) g := by + funext k + simp only [reindexLabel,faceFunctor_obj,Fin.succ_succAbove_succ] + rw [sub_eq_add_neg,add_comm] + exact Fin.neg_partialSum_add_eq_contractNth g i k +lemma initialDisplacement_zero_face (g : Fin (n+1) → CutRing × CutRing) : + initialDisplacement (faceFunctor (0 : Fin (n+2))) g = g 0 := by + simp only [initialDisplacement,faceFunctor_obj,Fin.zero_succAbove,Fin.partialSum_succ',Fin.partialSum_zero,add_zero] +lemma initialDisplacement_succ_face (g : Fin (n+1) → CutRing × CutRing) (i : Fin (n+1)) : + initialDisplacement (faceFunctor i.succ) g = 0 := by + simp only [initialDisplacement,faceFunctor_obj,Fin.succ_succAbove_zero,Fin.partialSum_zero] +end SimpleAmenable.PolygonObject.Labelled + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Configurations/TrajectoryLabels.lean b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/TrajectoryLabels.lean new file mode 100644 index 0000000000000000000000000000000000000000..6bf671fa05a651ca1e839bba2a00725c33895a5e --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/TrajectoryLabels.lean @@ -0,0 +1,168 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Configurations.PolygonStrandReconstruction + +namespace OAI + +open CategoryTheory Classical Set +namespace SimpleAmenable.PolygonObject + +structure Labelled (a n : ℕ) where + polygon : PolygonObject a + label : Fin polygon.tracks → Fin n → CutRing × CutRing + reduced : ∀ j i, orbitRepresentative (label j i) = label j i + +namespace Labelled +variable {a n : ℕ} +structure Hom (U V : Labelled a n) where + arrow : U.polygon ⟶ V.polygon + positional : Positional arrow + labelled : ∀ x, V.label (arrow.toEquiv x).val.1 = U.label x.val.1 + +@[ext] theorem Hom.ext {U V : Labelled a n} (f g : Hom U V) (h : f.arrow = g.arrow) : f=g := by + cases f; cases g; cases h; rfl + +noncomputable instance : Category (Labelled a n) where + Hom := Hom + id object := ⟨𝟙 object.polygon, (fun _ => rfl), fun _ => rfl⟩ + comp f g := ⟨f.arrow ≫ g.arrow, positional_comp f.positional g.positional, + fun point => (g.labelled (f.arrow.toEquiv point)).trans (f.labelled point)⟩ + id_comp _ := Hom.ext _ _ (Category.id_comp _) + comp_id _ := Hom.ext _ _ (Category.comp_id _) + assoc _ _ _ := Hom.ext _ _ (Category.assoc _ _ _) + +noncomputable instance {U V : Labelled a n} (f : U ⟶ V) : IsIso f := by + refine ⟨⟨⟨inv f.arrow,positional_inv f.positional,?_⟩,?_,?_⟩⟩ + · intro x + obtain ⟨y,rfl⟩ := f.arrow.toEquiv.surjective x + simpa only [inv_arrow_apply,Equiv.symm_apply_apply] using (f.labelled y).symm + · apply Hom.ext; exact IsIso.hom_inv_id _ + · apply Hom.ext; exact IsIso.inv_hom_id _ + +noncomputable instance : Groupoid (Labelled a n) := Groupoid.ofIsIso (fun _ => inferInstance) + +noncomputable abbrev string (U : Labelled a n) : StringGroupoid a n := + ⟨incrementString U.polygon U.label⟩ +noncomputable abbrev initial (U : Labelled a n) := incrementInitial U.polygon U.label + +noncomputable def initialArrow {U V : Labelled a n} (f : U ⟶ V) : + (string U).obj.obj 0 ⟶ (string V).obj.obj 0 := + inv (initial U) ≫ f.arrow ≫ initial V + +theorem initialArrow_positional {U V : Labelled a n} (f : U ⟶ V) : + Positional (initialArrow f) := + positional_comp (positional_inv (incrementInitial_positional _ _)) + (positional_comp f.positional (incrementInitial_positional _ _)) + +theorem initialArrow_labelled {U V : Labelled a n} (f : U ⟶ V) + (x : ((string U).obj.obj 0).Point) : + increments (string V).obj ((initialArrow f).toEquiv x) = increments (string U).obj x := by + obtain ⟨y,rfl⟩ := (initial U).toEquiv.surjective x + simp only [initialArrow,arrow_comp_apply,inv_arrow_apply,Equiv.symm_apply_apply] + rw [incrementString_spec_reduced _ _ V.reduced,incrementString_spec_reduced _ _ U.reduced] + exact f.labelled y + +noncomputable def ladder {U V : Labelled a n} (f : U ⟶ V) : string U ⟶ string V := + ⟨extendLadder (initialArrow f),extendLadder_positional_of_increments _ + (initialArrow_positional f) (initialArrow_labelled f)⟩ + +@[simp] theorem ladder_zero {U V : Labelled a n} (f : U ⟶ V) : + (ladder f).hom.app 0 = initialArrow f := extendLadder_zero _ + +noncomputable def toStrings : Labelled a n ⥤ StringGroupoid a n where + obj := string + map := ladder + map_id U := by + apply WideSubcategory.hom_ext + apply ladder_ext + change (ladder (𝟙 U)).hom.app 0 = 𝟙 _ + rw [ladder_zero] + change inv (initial U) ≫ (𝟙 _) ≫ initial U = 𝟙 _ + simp + map_comp f g := by + apply WideSubcategory.hom_ext + apply ladder_ext + change (ladder (f ≫ g)).hom.app 0 = (ladder f).hom.app 0 ≫ (ladder g).hom.app 0 + rw [ladder_zero,ladder_zero,ladder_zero] + change inv _ ≫ (f.arrow ≫ g.arrow) ≫ _ = initialArrow f ≫ initialArrow g + simp [initialArrow,Category.assoc] + +noncomputable def fromLadder {U V : Labelled a n} (f : string U ⟶ string V) : U ⟶ V where + arrow := initial U ≫ f.hom.app 0 ≫ inv (initial V) + positional := positional_comp (incrementInitial_positional _ _) + (positional_comp (f.property 0) (positional_inv (incrementInitial_positional _ _))) + labelled x := by + have h := ladder_preserves_increments f ((initial U).toEquiv x) + rw [incrementString_spec_reduced _ _ U.reduced] at h + have hv := incrementString_spec_reduced V.polygon V.label V.reduced + ((initial V).toEquiv.symm ((f.hom.app 0).toEquiv ((initial U).toEquiv x))) + simp only [Equiv.apply_symm_apply] at hv + simpa only [arrow_comp_apply,inv_arrow_apply] using hv.symm.trans h + +noncomputable instance : toStrings (a:=a) (n:=n) |>.Full where + map_surjective f := ⟨fromLadder f,by + apply WideSubcategory.hom_ext + apply ladder_ext + change (ladder (fromLadder f)).hom.app 0 = f.hom.app 0 + rw [ladder_zero] + simp [initialArrow,fromLadder,Category.assoc]⟩ + +instance : toStrings (a:=a) (n:=n) |>.Faithful where + map_injective {U V} f g h := by + have h0 := congrArg (fun h : string U ⟶ string V => h.hom.app 0) h + change (ladder f).hom.app 0 = (ladder g).hom.app 0 at h0 + rw [ladder_zero,ladder_zero] at h0 + apply Hom.ext + simpa [initialArrow,Category.assoc] using congrArg (fun h => initial U ≫ h ≫ inv (initial V)) h0 + +theorem increments_reduced (F : RawString a n) (x : (F.obj 0).Point) (i : Fin n) : + orbitRepresentative (increments F x i) = increments F x i := by + simp only [increments,representative_sub,trajectoryShift,pointShift_reduced] + +abbrev Support (F : RawString a n) := Set.range (increments F) +noncomputable instance (F : RawString a n) : Fintype (Support F) := + (increments_finite_range F).fintype +noncomputable def supportLabel (F : RawString a n) (x : (F.obj 0).Point) : Support F := + ⟨increments F x,⟨x,rfl⟩⟩ +theorem supportLabel_polygon (F : RawString a n) (j : Fin (F.obj 0).tracks) (k : Support F) : + {z | ∃hz : z∈((F.obj 0).cell j).val,supportLabel F ⟨(j,z),hz⟩=k}∈polygonAlgebra a := by + simpa only [Subtype.ext_iff,supportLabel] using increments_fiber_polygon F j k.val + +noncomputable def refine (F : RawString a n) : Labelled a n where + polygon := refinement (F.obj 0) (supportLabel F) (supportLabel_polygon F) + label j := ((Fintype.equivFin (Fin (F.obj 0).tracks × Support F)).symm j).2.val + reduced j i := by + obtain ⟨x,hx⟩ := ((Fintype.equivFin (Fin (F.obj 0).tracks × Support F)).symm j).2.property + rw [←hx] + exact increments_reduced F x i + +noncomputable def drop (F : RawString a n) : (refine F).polygon ⟶ F.obj 0 := + refinementArrow (F.obj 0) (supportLabel F) (supportLabel_polygon F) + +theorem drop_label (F : RawString a n) (x : (refine F).polygon.Point) : + increments F ((drop F).toEquiv x) = (refine F).label x.val.1 := + congrArg Subtype.val (refinementArrow_label (F.obj 0) (supportLabel F) (supportLabel_polygon F) x) + +noncomputable def refinementLadder (F : RawString a n) : string (refine F) ⟶ (⟨F⟩ : StringGroupoid a n) := by + let h := inv (initial (refine F)) ≫ drop F + refine (incrementLadderEquiv _ _).symm ⟨h,?_,?_⟩ + · exact positional_comp (positional_inv (incrementInitial_positional _ _)) + (refinementArrow_positional _ _ _) + · intro x + obtain ⟨y,rfl⟩ := (initial (refine F)).toEquiv.surjective x + simp only [h,arrow_comp_apply,inv_arrow_apply,Equiv.symm_apply_apply] + rw [incrementString_spec_reduced _ _ (refine F).reduced] + exact drop_label F y +noncomputable instance : toStrings (a:=a) (n:=n) |>.EssSurj where + mem_essImage F := by + let e := asIso (refinementLadder F.obj) + exact ⟨refine F.obj,⟨e⟩⟩ + +noncomputable instance : toStrings (a:=a) (n:=n) |>.IsEquivalence where + +noncomputable def equivalence (a n : ℕ) : Labelled a n ≌ StringGroupoid a n := + toStrings.asEquivalence + +end Labelled +end SimpleAmenable.PolygonObject + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Configurations/TrajectoryStages.lean b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/TrajectoryStages.lean new file mode 100644 index 0000000000000000000000000000000000000000..26aba69521752f69d8610a6b9b7796d39cdfca90 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/TrajectoryStages.lean @@ -0,0 +1,260 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Configurations.BooleanStages + +namespace OAI + +section + +section + +open CategoryTheory Classical Set +namespace SimpleAmenable.PolygonObject + +structure FiniteSetGroupoid where + size : ℕ +namespace FiniteSetGroupoid +instance : Groupoid FiniteSetGroupoid where + Hom U V := Fin U.size ≃ Fin V.size + id object := Equiv.refl (Fin object.size) + comp f g := f.trans g + inv f := f.symm + id_comp _ := rfl + comp_id _ := rfl + assoc _ _ _ := rfl + inv_comp f := Equiv.symm_trans_self f + comp_inv f := Equiv.self_trans_symm f +end FiniteSetGroupoid + +namespace LabelledStage +variable {a n s : ℕ} (P : BooleanPartition a) + (L : Fin s → Fin n → CutRing × CutRing) + (hL : ∀ j i, orbitRepresentative (L j i)=L j i) + +abbrev Obj := (Fin P.size × Fin s) → FiniteSetGroupoid +abbrev Track (U : Obj P (s:=s)) := Σ b : Fin P.size × Fin s, Fin (U b).size +noncomputable abbrev index (U : Obj P (s:=s)) := Fintype.equivFin (Track P U) +noncomputable def object (U : Obj P (s:=s)) : Labelled a n where + polygon := ⟨Fintype.card (Track P U), fun j => P.cell (((index P U).symm j).1.1)⟩ + label j := L (((index P U).symm j).1.2) + reduced track := hL (((index P U).symm track).1.2) + +noncomputable def trackMap {U V : Obj P (s:=s)} (f : U ⟶ V) : Track P U ≃ Track P V := + Equiv.sigmaCongrRight f +noncomputable def indexMap {U V : Obj P (s:=s)} (f : U ⟶ V) : + Fin (object P L hL U).polygon.tracks ≃ Fin (object P L hL V).polygon.tracks := + (index P U).symm.trans ((trackMap P f).trans (index P V)) + +@[simp] theorem indexMap_atom {U V : Obj P (s:=s)} (f : U ⟶ V) + (j : Fin (object P L hL U).polygon.tracks) : + ((index P V).symm (indexMap P L hL f j)).1 = ((index P U).symm j).1 := by + change ((index P V).symm ((index P V) ((trackMap P f) ((index P U).symm j)))).1 = _ + rw [Equiv.symm_apply_apply] + rfl + +@[simp] theorem indexMap_id (U : Obj P (s:=s)) (j : Fin (object P L hL U).polygon.tracks) : + indexMap P L hL (𝟙 U) j=j := by + change (index P U) ((index P U).symm j)=j + exact Equiv.apply_symm_apply _ _ + +@[simp] theorem indexMap_comp {U V W : Obj P (s:=s)} (f : U ⟶ V) (g : V ⟶ W) + (j : Fin (object P L hL U).polygon.tracks) : + indexMap P L hL (f≫g) j = indexMap P L hL g (indexMap P L hL f j) := by + change (index P W) ((trackMap P (f≫g)) ((index P U).symm j)) = + (index P W) ((trackMap P g) ((index P V).symm + ((index P V) ((trackMap P f) ((index P U).symm j))))) + rw [Equiv.symm_apply_apply] + rfl + +noncomputable def pointMap {U V : Obj P (s:=s)} (f : U ⟶ V) : + (object P L hL U).polygon.Point ≃ (object P L hL V).polygon.Point where + toFun x := ⟨(indexMap P L hL f x.val.1,x.val.2), by + change P.color x.val.2 = ((index P V).symm (indexMap P L hL f x.val.1)).1.1 + rw [indexMap_atom] + exact x.property⟩ + invFun x := ⟨((indexMap P L hL f).symm x.val.1,x.val.2),by + have h := indexMap_atom P L hL f ((indexMap P L hL f).symm x.val.1) + rw [Equiv.apply_symm_apply] at h + change P.color x.val.2 = ((index P U).symm ((indexMap P L hL f).symm x.val.1)).1.1 + rw [←h] + exact x.property⟩ + left_inv x := by apply Subtype.ext; simp + right_inv x := by apply Subtype.ext; simp + +noncomputable def arrow {U V : Obj P (s:=s)} (f : U ⟶ V) : object P L hL U ⟶ object P L hL V where + arrow := relabelArrow (pointMap P L hL f) (indexMap P L hL f) (fun _ => rfl) + positional _ := rfl + labelled x := by + change L (((index P V).symm (indexMap P L hL f x.val.1)).1.2) = _ + rw [indexMap_atom] + rfl + +@[simp] theorem arrow_apply {U V : Obj P (s:=s)} (f : U ⟶ V) + (x : (object P L hL U).polygon.Point) : + ((arrow P L hL f).arrow.toEquiv x).val = (indexMap P L hL f x.val.1,x.val.2) := rfl + +noncomputable def functor : Obj P (s:=s) ⥤ Labelled a n where + obj := object P L hL + map := arrow P L hL + map_id U := by + apply Labelled.Hom.ext + apply Arrow.ext + apply Equiv.ext + intro x + apply Subtype.ext + rw [arrow_apply] + change (indexMap P L hL (𝟙 U) x.val.1,x.val.2) = x.val + rw [indexMap_id] + map_comp f g := by + apply Labelled.Hom.ext + apply Arrow.ext + apply Equiv.ext + intro x + apply Subtype.ext + change _ = ((arrow P L hL g).arrow.toEquiv ((arrow P L hL f).arrow.toEquiv x)).val + rw [arrow_apply,arrow_apply,arrow_apply,indexMap_comp] + +instance : (functor P L hL).Faithful where + map_injective {U V} f g h := by + funext b + apply Equiv.ext + intro k + let j := index P U ⟨b,k⟩ + let x : (object P L hL U).polygon.Point := + ⟨(j,P.point b.1),by simp [object,j,BooleanPartition.cell]⟩ + have hx := congrArg (fun f : object P L hL U ⟶ object P L hL V => + (f.arrow.toEquiv x).val.1) h + change indexMap P L hL f j = indexMap P L hL g j at hx + have hh := (index P V).injective hx + change trackMap P f ((index P U).symm j) = trackMap P g ((index P U).symm j) at hh + simp only [j,Equiv.symm_apply_apply] at hh + exact Sigma.mk.inj_iff.mp hh |>.2 |> eq_of_heq + +end LabelledStage +end SimpleAmenable.PolygonObject + +end + +section + +open CategoryTheory Classical Set +namespace SimpleAmenable.PolygonObject + +namespace LabelledStage +variable {a n s : ℕ} (P : BooleanPartition a) + (L : Fin s → Fin n → CutRing × CutRing) + +structure UniformObject where + obj : Labelled a n + uniform : Labelled.ObjectUniform P obj + supported : ∀ j,∃ l,L l=obj.label j + +namespace UniformObject +variable {P L} +structure Hom (U V : UniformObject P L) where + arrow : U.obj ⟶ V.obj + uniform : Labelled.ArrowUniform P arrow +@[ext] theorem Hom.ext {U V : UniformObject P L} (f g : Hom U V) (h : f.arrow=g.arrow) : f=g := by + cases f; cases g; cases h; rfl +noncomputable instance : Category (UniformObject P L) where + Hom := Hom + id U := ⟨𝟙 _,Labelled.arrowUniform_id P U.obj⟩ + comp f g := ⟨f.arrow≫g.arrow,Labelled.arrowUniform_comp P f.uniform g.uniform⟩ + id_comp _ := Hom.ext _ _ (Category.id_comp _) + comp_id _ := Hom.ext _ _ (Category.comp_id _) + assoc _ _ _ := Hom.ext _ _ (Category.assoc _ _ _) +noncomputable instance {U V : UniformObject P L} (f : U ⟶ V) : IsIso f := by + refine ⟨⟨⟨inv f.arrow,Labelled.arrowUniform_inv P U.uniform f.uniform⟩,?_,?_⟩⟩ + · exact Hom.ext _ _ (IsIso.hom_inv_id _) + · exact Hom.ext _ _ (IsIso.inv_hom_id _) +noncomputable instance : Groupoid (UniformObject P L) := Groupoid.ofIsIso (fun _ => inferInstance) + +noncomputable def forget : UniformObject P L ⥤ Labelled a n where + obj U := U.obj + map f := f.arrow +instance : (forget (P:=P) (L:=L)).Faithful where + map_injective h := Hom.ext _ _ h + +abbrev Fiber (U : UniformObject P L) (b : Fin P.size × Fin s) := + {x : U.obj.polygon.Point // x.val.2=P.point b.1 ∧ U.obj.label x.val.1=L b.2} + +noncomputable instance (U : UniformObject P L) (b : Fin P.size × Fin s) : Fintype (Fiber U b) := + Fintype.ofInjective (fun x : Fiber U b => x.val.val.1) (by + intro x y h + apply Subtype.ext + apply Subtype.ext + exact Prod.ext h (x.property.1.trans y.property.1.symm)) + +noncomputable def fiberMap {U V : UniformObject P L} (f : U ⟶ V) (b : Fin P.size × Fin s) : + Fiber U b ≃ Fiber V b where + toFun x := ⟨f.arrow.arrow.toEquiv x.val, + (f.arrow.positional x.val).trans x.property.1, + (f.arrow.labelled x.val).trans x.property.2⟩ + invFun y := ⟨f.arrow.arrow.toEquiv.symm y.val,by + have h := f.arrow.positional (f.arrow.arrow.toEquiv.symm y.val) + rw [Equiv.apply_symm_apply] at h + exact h.symm.trans y.property.1,by + have h := f.arrow.labelled (f.arrow.arrow.toEquiv.symm y.val) + rw [Equiv.apply_symm_apply] at h + exact h.symm.trans y.property.2⟩ + left_inv _ := Subtype.ext (Equiv.symm_apply_apply _ _) + right_inv _ := Subtype.ext (Equiv.apply_symm_apply _ _) + +noncomputable def evaluation : UniformObject P L ⥤ Obj P (s:=s) where + obj U b := ⟨Fintype.card (Fiber U b)⟩ + map {U V} f b := (Fintype.equivFin (Fiber U b)).symm.trans + ((fiberMap f b).trans (Fintype.equivFin (Fiber V b))) + map_id U := by + funext b + apply Equiv.ext + intro j + change (Fintype.equivFin (Fiber U b)) ((fiberMap (𝟙 U) b) + ((Fintype.equivFin (Fiber U b)).symm j))=j + change (Fintype.equivFin (Fiber U b)) ((Fintype.equivFin (Fiber U b)).symm j)=j + exact Equiv.apply_symm_apply _ _ + map_comp {U V W} f g := by + funext b + apply Equiv.ext + intro j + change (Fintype.equivFin (Fiber W b)) ((fiberMap (f≫g) b) _)= + (Fintype.equivFin (Fiber W b)) ((fiberMap g b) + ((Fintype.equivFin (Fiber V b)).symm ((Fintype.equivFin (Fiber V b)) _))) + rw [Equiv.symm_apply_apply] + rfl + +instance : (evaluation (P:=P) (L:=L)).Faithful where + map_injective {U V} f g h := by + apply Hom.ext + apply Labelled.Hom.ext + apply Arrow.ext + apply Equiv.ext + intro x + obtain ⟨l,hl⟩ := U.supported x.val.1 + let b := (P.color x.val.2,l) + have hm : P.point b.1∈(U.obj.polygon.cell x.val.1).val := + (U.uniform x.val.1 x.val.2 (P.point b.1) (by simp [b])).mp x.property + let y : Fiber U b := ⟨⟨(x.val.1,P.point b.1),hm⟩,rfl,hl.symm⟩ + have hh := congrFun h b + have hy := congrArg (fun e : Fin (Fintype.card (Fiber U b)) ≃ + Fin (Fintype.card (Fiber V b)) => e (Fintype.equivFin (Fiber U b) y)) hh + change (Fintype.equivFin (Fiber V b)) ((fiberMap f b) + ((Fintype.equivFin (Fiber U b)).symm ((Fintype.equivFin (Fiber U b)) y)))= + (Fintype.equivFin (Fiber V b)) ((fiberMap g b) + ((Fintype.equivFin (Fiber U b)).symm ((Fintype.equivFin (Fiber U b)) y))) at hy + simp only [Equiv.symm_apply_apply] at hy + have he := (Fintype.equivFin (Fiber V b)).injective hy + apply Subtype.ext + apply Prod.ext + · exact (f.uniform x y.val rfl (by simp [y,b])).trans + ((congrArg (fun z : Fiber V b => z.val.val.1) he).trans + (g.uniform x y.val rfl (by simp [y,b])).symm) + · exact (f.arrow.positional x).trans (g.arrow.positional x).symm + +end UniformObject +end LabelledStage +end SimpleAmenable.PolygonObject + +end + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Configurations/TransitiveInduction.lean b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/TransitiveInduction.lean new file mode 100644 index 0000000000000000000000000000000000000000..f3bd73767e9ef339a9d31e8e48e085a0adbb37db --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/TransitiveInduction.lean @@ -0,0 +1,182 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Configurations.PolygonPlacementAlternating + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section TransitiveInduction + +open Classical CategoryTheory Representation Finsupp +namespace TransitiveInduction +variable {G X : Type} [Group G] [MulAction G X] (x : X) + +noncomputable def permutationRep : Representation ℤ G (X →₀ ℤ) where + toFun g := Finsupp.lmapDomain ℤ ℤ (g • ·) + map_one' := by ext y z; simp + map_mul' g h := by ext y z; simp [mul_smul] + +@[simp] lemma permutationRep_single (g : G) (y : X) (z : ℤ) : + permutationRep (G:=G) (X:=X) g (Finsupp.single y z)=Finsupp.single (g • y) z := by + simp [permutationRep] + +noncomputable def pointMap : Rep.trivial ℤ (MulAction.stabilizer G x) ℤ ⟶ + Rep.res (MulAction.stabilizer G x).subtype (Rep.of (permutationRep (G:=G) (X:=X))) := + Rep.ofHom ⟨Finsupp.lsingle x,by + intro g + apply LinearMap.ext + intro z + change Finsupp.single x z=permutationRep (G:=G) (X:=X) g.val (Finsupp.single x z) + rw [permutationRep_single] + exact congrArg (fun y => Finsupp.single y z) g.property.symm⟩ + +noncomputable def toPermutation : + Rep.ind (MulAction.stabilizer G x).subtype (Rep.trivial ℤ (MulAction.stabilizer G x) ℤ) ⟶ + Rep.of (permutationRep (G:=G) (X:=X)) := + (Rep.indResHomEquiv _ _ _).symm (pointMap (G:=G) x) + +@[simp] theorem toPermutation_mk (g : G) (z : ℤ) : + toPermutation (G:=G) x (IndV.mk (MulAction.stabilizer G x).subtype + (Representation.trivial ℤ (MulAction.stabilizer G x) ℤ) g z)=Finsupp.single (g⁻¹ • x) z := by + simp [toPermutation,Rep.indResHomEquiv,pointMap] + +lemma mk_same {g h : G} (he : g⁻¹ • x=h⁻¹ • x) (z : ℤ) : + IndV.mk (MulAction.stabilizer G x).subtype + (Representation.trivial ℤ (MulAction.stabilizer G x) ℤ) g z= + IndV.mk (MulAction.stabilizer G x).subtype + (Representation.trivial ℤ (MulAction.stabilizer G x) ℤ) h z := by + have hs : h*g⁻¹∈MulAction.stabilizer G x := by + change (h*g⁻¹) • x=x + rw [mul_smul,he,smul_inv_smul] + have hh := Coinvariants.mk_self_apply + (Representation.tprod ((Representation.leftRegular ℤ G).comp (MulAction.stabilizer G x).subtype) + (Representation.trivial ℤ (MulAction.stabilizer G x) ℤ)) + (⟨h*g⁻¹,hs⟩ : MulAction.stabilizer G x) + (TensorProduct.tmul ℤ (MonoidAlgebra.single g (1:ℤ)) z) + simpa [IndV.mk,Representation.tprod_apply,mul_assoc] using hh.symm + +noncomputable def transport (ht : ∀y : X,∃g : G,g • x=y) (y : X) : G := (ht y).choose +@[simp] theorem transport_spec (ht : ∀y : X,∃g : G,g • x=y) (y : X) : + transport x ht y • x=y := (ht y).choose_spec + +noncomputable def fromPermutation (ht : ∀y : X,∃g : G,g • x=y) : + (X →₀ ℤ) →ₗ[ℤ] Representation.IndV (MulAction.stabilizer G x).subtype + (Representation.trivial ℤ (MulAction.stabilizer G x) ℤ) := + Finsupp.lsum ℤ (fun y => IndV.mk _ _ (transport x ht y)⁻¹) + +@[simp] theorem fromPermutation_single (ht : ∀y : X,∃g : G,g • x=y) (y : X) (z : ℤ) : + fromPermutation x ht (Finsupp.single y z)=IndV.mk _ _ (transport x ht y)⁻¹ z := by + exact Finsupp.lsum_single ℤ _ y z + +lemma from_to (ht : ∀y : X,∃g : G,g • x=y) : + (fromPermutation x ht).comp (toPermutation (G:=G) x).hom.toLinearMap=LinearMap.id := by + apply IndV.hom_ext + intro g + apply LinearMap.ext + intro z + change fromPermutation x ht (toPermutation (G:=G) x (IndV.mk _ _ g z))=IndV.mk _ _ g z + rw [toPermutation_mk,fromPermutation_single] + apply mk_same + simp + +lemma to_from (ht : ∀y : X,∃g : G,g • x=y) : + (toPermutation (G:=G) x).hom.toLinearMap.comp (fromPermutation x ht)=LinearMap.id := by + apply Finsupp.lhom_ext + intro y z + change toPermutation (G:=G) x (fromPermutation x ht (Finsupp.single y z))=Finsupp.single y z + rw [fromPermutation_single,toPermutation_mk] + simp + +noncomputable def iso (ht : ∀y : X,∃g : G,g • x=y) : + Rep.ind (MulAction.stabilizer G x).subtype (Rep.trivial ℤ (MulAction.stabilizer G x) ℤ) ≅ + Rep.of (permutationRep (G:=G) (X:=X)) := + Rep.mkIso (Representation.IntertwiningMap.ofBijective (toPermutation (G:=G) x).hom + ⟨by + intro u v he + exact (LinearMap.congr_fun (from_to x ht) u).symm.trans + ((congrArg (fromPermutation x ht) he).trans (LinearMap.congr_fun (from_to x ht) v)), + fun y => ⟨fromPermutation x ht y,LinearMap.congr_fun (to_from x ht) y⟩⟩) + +noncomputable def homologyIso (ht : ∀y : X,∃g : G,g • x=y) (q : ℕ) : + groupHomology (Rep.of (permutationRep (G:=G) (X:=X))) q ≅ + groupHomology (Rep.trivial ℤ (MulAction.stabilizer G x) ℤ) q := + (groupHomology.functor ℤ G q).mapIso (iso x ht).symm ≪≫ groupHomology.indIso _ _ q + +end TransitiveInduction +end TransitiveInduction + +section PolygonConfigurationModule + +open Classical CategoryTheory Finsupp +namespace PolygonPlacement.Configuration +variable {a m p : ℕ} + +noncomputable def listEquiv (a m p : ℕ) : Configuration a m p ≃ + {l : List (PolygonPlacement a m) // l.Pairwise Apart ∧ l.length=p} where + toFun f := ⟨List.ofFn f.val,List.pairwise_ofFn.mpr (fun _ _ h => f.property (ne_of_lt h)),List.length_ofFn⟩ + invFun l := ⟨fun i => l.val.get ⟨i.val,by rw [l.property.2];exact i.isLt⟩,by + intro i j hij + rcases lt_or_gt_of_ne hij with h|h + · exact l.property.1.rel_get_of_lt h + · exact (l.property.1.rel_get_of_lt h).symm⟩ + left_inv f := by apply ext; intro i; simp + right_inv l := by + apply Subtype.ext + apply List.ext_getElem + · simp [l.property.2] + · intro i hi hj + simp + +@[simp] theorem listEquiv_apply_val (f : Configuration a m p) : + (listEquiv a m p f).val=List.ofFn f.val := rfl + +noncomputable def chainEquiv (a m p : ℕ) : + (Configuration a m p →₀ ℤ) ≃ₗ[ℤ] ConfigurationChains.degree (@Apart a m) p := + (Finsupp.domLCongr (listEquiv a m p)).trans (ConfigurationChains.simplexModuleEquiv _ p).symm + +@[simp] theorem chainEquiv_single_val (f : Configuration a m p) (z : ℤ) : + (chainEquiv a m p (Finsupp.single f z)).val=Finsupp.single (List.ofFn f.val) z := by + unfold chainEquiv + rw [LinearEquiv.trans_apply,Finsupp.domLCongr_single] + simp [ConfigurationChains.simplexModuleEquiv] + exact Finsupp.supportedEquivFinsupp_symm_single _ _ _ + +theorem chainEquiv_intertwines (g : polygonFullGroup a m) : + (chainEquiv a m p).toLinearMap.comp (TransitiveInduction.permutationRep + (G:=polygonFullGroup a m) (X:=Configuration a m p) g)= + (configurationRepresentation a m p g).comp (chainEquiv a m p).toLinearMap := by + apply Finsupp.lhom_ext + intro f z + apply Subtype.ext + change (chainEquiv a m p (TransitiveInduction.permutationRep g (Finsupp.single f z))).val= + ConfigurationChains.push (fun v => g • v) (chainEquiv a m p (Finsupp.single f z)).val + rw [TransitiveInduction.permutationRep_single,chainEquiv_single_val,chainEquiv_single_val, + ConfigurationChains.push_single] + congr 1 + simp [List.map_ofFn] + rfl + +noncomputable def representationIso (a m p : ℕ) : + Rep.of (TransitiveInduction.permutationRep (G:=polygonFullGroup a m) (X:=Configuration a m p)) ≅ + Rep.of (configurationRepresentation a m p) := + Rep.mkIso {toLinearEquiv:=chainEquiv a m p,isIntertwining':=chainEquiv_intertwines} + +noncomputable def columnHomologyIso (a p n : ℕ) (hm : 3*p+1 < p+n) (q : ℕ) : + groupHomology (Rep.of (configurationRepresentation a (p+n) p)) q ≅ + groupHomology (Rep.trivial ℤ (MulAction.stabilizer (polygonFullGroup a (p+n)) + (standard a p n)) ℤ) q := + (groupHomology.functor ℤ _ q).mapIso (representationIso a (p+n) p).symm ≪≫ + TransitiveInduction.homologyIso (standard a p n) (fun f => transitive _ f hm) q + +end PolygonPlacement.Configuration +end PolygonConfigurationModule + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Configurations/TranslationFiber.lean b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/TranslationFiber.lean new file mode 100644 index 0000000000000000000000000000000000000000..a64e983d411c2033527657ef580baae85d709682 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Configurations/TranslationFiber.lean @@ -0,0 +1,74 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.TripleComposition +import OAI.GroupTheory.SimpleAmenable.Configurations.PointFiberEvaluation +import OAI.GroupTheory.SimpleAmenable.Configurations.LabelTranslation + +namespace OAI + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory MonoidalCategory Classical +namespace SimpleAmenable.PolygonObject.Labelled.PointFiber + +variable {a n : ℕ} (d : (Fin n → CutRing × CutRing) → CutRing × CutRing) +variable (c : GenericSquare a × (Fin n → CutRing × CutRing)) +noncomputable def backPoint : GenericSquare a × (Fin n → CutRing × CutRing) := + (SimpleAmenable.translate a (-d c.2) c.1,c.2) +lemma translated_predicate (U : Labelled a n) (x : U.polygon.Point) : + (x.val.2=(backPoint d c).1 ∧ U.label x.val.1=(backPoint d c).2) ↔ + (((translateArrow d U).toEquiv x).val.2=c.1 ∧ + (translateObj d U).label ((translateArrow d U).toEquiv x).val.1=c.2) := by + change (x.val.2=SimpleAmenable.translate a (-d c.2) c.1 ∧ U.label x.val.1=c.2) ↔ + (SimpleAmenable.translate a (d (U.label x.val.1)) x.val.2=c.1 ∧ U.label x.val.1=c.2) + constructor + · rintro ⟨hp,hl⟩ + refine ⟨?_,hl⟩ + rw [hl,hp,←SimpleAmenable.translate_add,add_neg_cancel,SimpleAmenable.translate_zero] + · rintro ⟨hp,hl⟩ + refine ⟨?_,hl⟩ + rw [hl] at hp + apply (translation a (d c.2)).injective + change SimpleAmenable.translate a (d c.2) x.val.2 = _ + rw [hp] + change _ = SimpleAmenable.translate a (d c.2) (SimpleAmenable.translate a (-d c.2) c.1) + rw [←SimpleAmenable.translate_add,add_neg_cancel,SimpleAmenable.translate_zero] +noncomputable def translateFiber (U : Labelled a n) : + Fiber U (backPoint d c) ≃ Fiber (translateObj d U) c := + (translateArrow d U).toEquiv.subtypeEquiv (translated_predicate d c U) +@[simp] lemma translateFiber_val (U : Labelled a n) (x : Fiber U (backPoint d c)) : + (translateFiber d c U x).val=(translateArrow d U).toEquiv x.val := rfl +lemma translateFiber_natural {U V : Labelled a n} (f : U ⟶ V) + (x : Fiber U (backPoint d c)) : + translateFiber d c V (fiberMap f (backPoint d c) x) = + fiberMap (translateHom d f) c (translateFiber d c U x) := by + apply Subtype.ext + change (translateArrow d V).toEquiv (f.arrow.toEquiv x.val) = + (inv (translateArrow d U) ≫ f.arrow ≫ translateArrow d V).toEquiv + ((translateArrow d U).toEquiv x.val) + simp only [arrow_comp_apply,inv_arrow_apply,Equiv.symm_apply_apply] +noncomputable def translationEvaluationIso : + evaluation ⋙ BarFinitePower.project _ (backPoint d c) ≅ + translateFunctor d ⋙ evaluation ⋙ BarFinitePower.project _ c := + NatIso.ofComponents (fun U => asIso (X := E.obj U (backPoint d c)) + (Y := E.obj (translateObj d U) c) + ((enumerate U (backPoint d c)).symm.trans ((translateFiber d c U).trans + (enumerate (translateObj d U) c)))) (by + intro U V f + apply Equiv.ext; intro x + obtain ⟨x,rfl⟩ := (enumerate U (backPoint d c)).surjective x + change enumerate (translateObj d V) c (translateFiber d c V + ((enumerate V (backPoint d c)).symm (E.map f (backPoint d c) + (enumerate U (backPoint d c) x)))) = E.map (translateHom d f) c + (enumerate (translateObj d U) c (translateFiber d c U + ((enumerate U (backPoint d c)).symm (enumerate U (backPoint d c) x)))) + rw [E_map_enum,Equiv.symm_apply_apply,Equiv.symm_apply_apply,E_map_enum,translateFiber_natural]) +@[simp] lemma translationEvaluationIso_enum (U : Labelled a n) (x : Fiber U (backPoint d c)) : + (translationEvaluationIso d c).hom.app U (enumerate U (backPoint d c) x) = + enumerate (translateObj d U) c (translateFiber d c U x) := by + change enumerate (translateObj d U) c (translateFiber d c U + ((enumerate U (backPoint d c)).symm (enumerate U (backPoint d c) x))) = _ + rw [Equiv.symm_apply_apply] +end SimpleAmenable.PolygonObject.Labelled.PointFiber + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/AbelianHomologyFinite.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/AbelianHomologyFinite.lean new file mode 100644 index 0000000000000000000000000000000000000000..4991a64a063680b2b862e2dba5e67af84786b028 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/AbelianHomologyFinite.lean @@ -0,0 +1,43 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.FullH2 +import OAI.GroupTheory.SimpleAmenable.Simplicial.TranslationCoinvariants + +namespace OAI + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits +namespace AbelianHomologyFinite +open FreeChains SimpleAmenable + +attribute [local instance 1200] Rep.hV2 +variable (G:Type) [CommGroup G] +lemma fg [Module.Finite ℤ (groupHomology (Rep.trivial ℤ G ℤ) 1)] : Group.FG G := by + have :=TrivialHomology.abelianization_fg G + exact Group.fg_of_surjective (f:=(Abelianization.equivOfComm (H:=G)).symm.toMonoidHom) + (Abelianization.equivOfComm (H:=G)).symm.surjective +lemma finite (n:ℕ) [Group.FG G] : Module.Finite ℤ (groupHomology (Rep.trivial ℤ G ℤ) n) := by + have : Algebra.FiniteType ℤ (MonoidAlgebra ℤ G) := MonoidAlgebra.finiteType_iff_group_fg.mpr inferInstance + have : IsNoetherianRing (MonoidAlgebra ℤ G) := Algebra.FiniteType.isNoetherianRing ℤ _ + have : Module.Finite ℤ (Rep.trivial ℤ G ℤ).ρ.asModule := by + exact Module.Finite.equiv (Representation.trivial ℤ G ℤ).asModuleEquiv.symm + have : Module.Finite (MonoidAlgebra ℤ G) (Rep.trivial ℤ G ℤ).ρ.asModule := + Module.Finite.of_restrictScalars_finite ℤ _ _ + exact RingCoinvariants.finite_groupHomology _ n +end AbelianHomologyFinite +namespace TranslationNerve +open FreeChains + +attribute [local instance 1200] Rep.hV2 +variable (P:Type) [CommMonoid P] +lemma homology_finite_of_one (n:ℕ) [Module.Finite ℤ ((nerve (SingleObj P)).homology Z 1 : A)] : + Module.Finite ℤ ((nerve (SingleObj P)).homology Z n : A) := by + have : Module.Finite ℤ (groupHomology (Rep.trivial ℤ (TranslationFiltered.Q P) ℤ) 1) := + Module.Finite.equiv (completionHomologyIso P 1).toLinearEquiv + have :=AbelianHomologyFinite.fg (TranslationFiltered.Q P) + have :=AbelianHomologyFinite.finite (TranslationFiltered.Q P) n + exact Module.Finite.equiv (completionHomologyIso P n).symm.toLinearEquiv +end TranslationNerve + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/AlternatingH2.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/AlternatingH2.lean new file mode 100644 index 0000000000000000000000000000000000000000..ef05b428472051ef501c91be824bdff6083ebb89 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/AlternatingH2.lean @@ -0,0 +1,211 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.PolygonHomologyAction +import OAI.GroupTheory.SimpleAmenable.Configurations.AlternatingStability + +namespace OAI + +section + +open Classical CategoryTheory CategoryTheory.Limits Representation Rep Finsupp +namespace SimpleAmenable + +attribute [local instance 1200] Rep.hV2 +namespace PolygonPlacement.Configuration +variable {a m : ℕ} + +noncomputable def altEmptyIso (a m : ℕ) : + altColumn a m 0 ≅ Rep.trivial ℤ (polygonAlternatingGroup a m) ℤ := + (Rep.resFunctor (polygonAlternatingGroup a m).subtype).mapIso (emptyIso a m) + +@[simp] lemma altEmptyIso_single (a m : ℕ) (x : Configuration a m 0) (z : ℤ) : + (altEmptyIso a m).hom.hom (single x z)=z := emptyIso_single a m x z +lemma altAugmentation_pointMap (f : Configuration a m 1) (q : ℕ) : + groupHomology.map (MulAction.stabilizer (polygonAlternatingGroup a m) f).subtype + (TransitiveInduction.pointMap f) q ≫ + (groupHomology.functor ℤ (polygonAlternatingGroup a m) q).map (altBoundary a m 0) ≫ + (groupHomology.functor ℤ (polygonAlternatingGroup a m) q).map (altEmptyIso a m).hom = + TrivialHomology.map (MulAction.stabilizer (polygonAlternatingGroup a m) f).subtype q := by + erw [← Functor.map_comp] + erw [groupHomology.functor_map, ← groupHomology.map_comp] + apply groupHomology.map_congr + · rfl + · apply LinearMap.ext + intro z + change (emptyIso a m).hom.hom ((boundary a m 0).hom (single f z))=z + rw [boundary_zero_eq_face] + dsimp only [faceHom] + rw [TransitiveInduction.equivariantMap_single, emptyIso_single] +lemma alternatingStabilizer_H2_epi (a m : ℕ) (hm : 34 ≤ m) (f : Configuration a m 1) : + Epi (TrivialHomology.map (MulAction.stabilizer (polygonAlternatingGroup a m) f).subtype 2) := by + have := TransitiveInduction.isIso_map_pointMap f (fun g => alternating_transitive f g (by omega)) 2 + have first : Epi (groupHomology.map + (MulAction.stabilizer (polygonAlternatingGroup a m) f).subtype + (TransitiveInduction.pointMap f) 2) := inferInstance + have second := altBoundary_zero_H2_epi a m hm + have third : Epi ((groupHomology.functor ℤ (polygonAlternatingGroup a m) 2).map + (altEmptyIso a m).hom) := inferInstance + rw [← altAugmentation_pointMap f 2] + have composite := epi_comp' first (epi_comp' second third) + exact composite + +lemma stabilizeAlternating_H2_epi (a n : ℕ) (hn : 33 ≤ n) : + Epi (TrivialHomology.map (PolygonTracks.stabilizeAlternating a 1 n) 2) := by + rw [← alternatingStabilizerEquiv_subtype a 1 n (by omega), TrivialHomology.map_comp] + have := TrivialHomology.isIso_equiv (alternatingStabilizerEquiv a 1 n (by omega)) 2 + have := alternatingStabilizer_H2_epi a (1+n) (by omega) (standard a 1 n) + infer_instance +end PolygonPlacement.Configuration + +namespace PolygonTracks +noncomputable def castAlternating (a : ℕ) {m n : ℕ} (h : m=n) : + polygonAlternatingGroup a m ≃* polygonAlternatingGroup a n := h ▸ MulEquiv.refl _ + +@[simp] lemma castAlternating_val (a : ℕ) {m n : ℕ} (h : m=n) (g : polygonAlternatingGroup a m) : + (castAlternating a h g).val=castFull a h g.val := by subst n; rfl + +lemma stabilizeAlternating_add (a k l n : ℕ) : stabilizeAlternating a (k+l) n = + (castAlternating a (Nat.add_assoc k l n).symm).toMonoidHom.comp + ((stabilizeAlternating a k (l+n)).comp (stabilizeAlternating a l n)) := by + apply MonoidHom.ext + intro g + apply Subtype.ext + change stabilize a (k+l) n g.val=_ + rw [stabilize_add] + simp only [MonoidHom.coe_comp,Function.comp_apply,MulEquiv.coe_toMonoidHom, + castAlternating_val,stabilizeAlternating_val] + +lemma stabilizeAlternating_zero_bijective (a n : ℕ) (hn : 32 ≤ n) : + Function.Bijective (stabilizeAlternating a 0 n) := by + refine ⟨stabilizeAlternating_injective,?_⟩ + intro g + obtain ⟨f,hf⟩ := (stabilize_zero_bijective a n).surjective g.val + have hg : f∈polygonAlternatingGroup a n := by + rw [← stabilize_alternating_comap a 0 n hn] + change stabilize a 0 n f∈polygonAlternatingGroup a (0+n) + rw [hf] + exact g.property + exact ⟨⟨f,hg⟩,Subtype.ext hf⟩ + +lemma stabilizeAlternating_H2_epi (a k n : ℕ) (hn : 33 ≤ n) : + Epi (TrivialHomology.map (stabilizeAlternating a k n) 2) := by + induction k with + | zero => + have : IsIso (TrivialHomology.map (stabilizeAlternating a 0 n) 2) := + TrivialHomology.isIso_equiv + (MulEquiv.ofBijective (stabilizeAlternating a 0 n) + (stabilizeAlternating_zero_bijective a n (by omega))) 2 + infer_instance + | succ k ih => + have he : Epi (TrivialHomology.map (stabilizeAlternating a (1+k) n) 2) := by + rw [stabilizeAlternating_add, TrivialHomology.map_comp, TrivialHomology.map_comp] + have := TrivialHomology.isIso_equiv (castAlternating a (Nat.add_assoc 1 k n).symm) 2 + have := PolygonPlacement.Configuration.stabilizeAlternating_H2_epi a (k+n) (by omega) + have := ih + infer_instance + rw [show k+1=1+k by omega] + exact he + +lemma stabilizeAlternating_mapH2_surjective (a k n : ℕ) (hn : 33 ≤ n) : + Function.Surjective (IntegralHomology.mapH2 (stabilizeAlternating a k n)) := by + have := stabilizeAlternating_H2_epi a k n hn + exact (ModuleCat.epi_iff_surjective (TrivialHomology.map (stabilizeAlternating a k n) 2)).mp inferInstance + +lemma fullAction_trivial (a m : ℕ) (hm : 205 < m) (f : polygonFullGroup a m) : + IntegralHomology.mapH2 (fullConjugation a m f)=LinearMap.id := by + obtain ⟨k,rfl⟩ : ∃k,m=k+33 := ⟨m-33,by omega⟩ + exact mapH2_fullConjugation_eq_id_of_surjective (by omega) + (stabilizeAlternating_mapH2_surjective a k 33 (by omega)) f +end PolygonTracks +end SimpleAmenable + +end + +open CategoryTheory CategoryTheory.Limits + +namespace FiniteHomologyReturn + +section +universe u +variable {R : Type u} [CommRing R] [IsNoetherianRing R] + +lemma finite_of_exact {X : ShortComplex (ModuleCat.{u} R)} (hX : X.Exact) + [Module.Finite R X.X₁] [Module.Finite R X.X₃] : Module.Finite R X.X₂ := by + have : Module.Finite R (LinearMap.range X.g.hom) := + Module.Finite.of_injective (LinearMap.range X.g.hom).subtype Subtype.val_injective + exact Module.Finite.of_exact (f:=X.f.hom) (g:=X.g.hom.rangeRestrict) + (by + rw [LinearMap.exact_iff] + simpa using hX.moduleCat_range_eq_ker.symm) + (by rintro ⟨y,x,rfl⟩; exact ⟨x,rfl⟩) + +lemma finite_range_of_exact {A B C D : ModuleCat.{u} R} + (p : A ⟶ B) (δ : B ⟶ C) (f : B ⟶ D) (w : p ≫ δ=0) + (hex : (ShortComplex.mk p δ w).Exact) (hpf : p ≫ f=0) + [Module.Finite R C] : Module.Finite R (LinearMap.range f.hom) := by + have : Module.Finite R (LinearMap.range δ.hom) := + Module.Finite.of_injective (LinearMap.range δ.hom).subtype Subtype.val_injective + have : Module.Finite R (B ⧸ LinearMap.ker δ.hom) := + Module.Finite.equiv δ.hom.quotKerEquivRange.symm + have hk : LinearMap.ker δ.hom ≤ LinearMap.ker f.hom := by + rw [← hex.moduleCat_range_eq_ker] + exact LinearMap.range_le_ker_iff.mpr (ModuleCat.hom_ext_iff.mp hpf) + let φ : (B ⧸ LinearMap.ker δ.hom) →ₗ[R] LinearMap.range f.hom := + (LinearMap.ker δ.hom).liftQ f.hom.rangeRestrict (by + intro x hx + exact Subtype.ext (hk hx)) + exact Module.Finite.of_surjective φ (by + rintro ⟨y,x,rfl⟩ + exact ⟨(LinearMap.ker δ.hom).mkQ x,rfl⟩) + +end + +open BoundedHomologyEdge +variable {R G : Type} [CommRing R] [IsNoetherianRing R] [Group G] + +variable {Z₁ Z₂ Z₃ C₀ C₁ C₂ C₃ C₄ : Rep R G} + {i₁ : Z₁ ⟶ C₁} {p₁ : C₁ ⟶ C₀} {i₂ : Z₂ ⟶ C₂} {p₂ : C₂ ⟶ Z₁} + {i₃ : Z₃ ⟶ C₃} {p₃ : C₃ ⟶ Z₂} + {w₁ : i₁ ≫ p₁ = 0} {w₂ : i₂ ≫ p₂ = 0} {w₃ : i₃ ≫ p₃ = 0} + (h₁ : (ShortComplex.mk i₁ p₁ w₁).ShortExact) + (h₂ : (ShortComplex.mk i₂ p₂ w₂).ShortExact) + (h₃ : (ShortComplex.mk i₃ p₃ w₃).ShortExact) + (e : C₄ ⟶ Z₃) [Epi e] + +include h₁ h₂ h₃ e + +lemma finite_H2 [Module.Finite R (groupHomology C₀ 2)] + [Module.Finite R (groupHomology C₄ 0)] + (hz₃ : IsZero (groupHomology C₃ 1)) + (hd : Hmap 2 (p₂ ≫ i₁)=0) : Module.Finite R (groupHomology C₁ 2) := by + have : Module.Finite R ((groupHomology.functor R G 0).obj C₄) := + ‹Module.Finite R (groupHomology C₄ 0)› + have : Module.Finite R ((groupHomology.functor R G 2).obj C₀) := + ‹Module.Finite R (groupHomology C₀ 2)› + let : Epi (Hmap 0 e) := epi_Hmap_zero e + have : Module.Finite R (groupHomology Z₃ 0) := + Module.Finite.of_surjective (Hmap 0 e).hom ((ModuleCat.epi_iff_surjective _).mp inferInstance) + let : Mono (groupHomology.δ h₃ 1 0 rfl) := + (exact₃ h₃ 0).mono_g_iff.mpr (hz₃.eq_zero_of_src _) + have : Module.Finite R (groupHomology Z₂ 1) := + Module.Finite.of_injective (groupHomology.δ h₃ 1 0 rfl).hom + ((ModuleCat.mono_iff_injective _).mp inferInstance) + have : Module.Finite R (LinearMap.range (Hmap 2 i₁).hom) := + finite_range_of_exact (Hmap 2 p₂) (groupHomology.δ h₂ 2 1 rfl) (Hmap 2 i₁) + (groupHomology.mapShortComplex₃ h₂ rfl).zero (exact₃ h₂ 1) + (by rw [← Hmap_comp]; exact hd) + exact finite_of_exact (X:=ShortComplex.mk + (ModuleCat.ofHom (LinearMap.range (Hmap 2 i₁).hom).subtype) (Hmap 2 p₁) + (by + apply ModuleCat.hom_ext + apply LinearMap.ext + intro x + change (Hmap 2 p₁).hom x.val=0 + exact (show LinearMap.range (Hmap 2 i₁).hom ≤ LinearMap.ker (Hmap 2 p₁).hom by + rw [(exact₂ h₁ 2).moduleCat_range_eq_ker]) x.property)) + (by + rw [ShortComplex.moduleCat_exact_iff_range_eq_ker] + simpa using (exact₂ h₁ 2).moduleCat_range_eq_ker) + +end FiniteHomologyReturn + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/ArithmeticTangentBasis.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/ArithmeticTangentBasis.lean new file mode 100644 index 0000000000000000000000000000000000000000..fbd8e718589ce2a0f03ad292b64db7489d852b2f --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/ArithmeticTangentBasis.lean @@ -0,0 +1,211 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Arithmetic.PropagationArithmetic + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section ArithmeticTangentBasis + +theorem cutRing_coefficients (z : CutRing) : + (z.re : CutRing) + (z.im : CutRing)*cutTau = z := by + apply QuadraticAlgebra.ext <;> simp [cutTau] + +theorem cutTau_inverse_mul : (cutTau-1)*cutTau = 1 := by + apply ordinary_injective + simp only [map_mul,map_sub,map_one,ordinary_cutTau] + nlinarith [Real.goldenRatio_sq] + +theorem cutRing_coefficients_bound (z : CutRing) : + |(z.re : ℝ)| + |(z.im : ℝ)| ≤ 4 * (|ordinary z| + |conjugate z|) := by + have hs : 1 ≤ Real.sqrt 5 := by + nlinarith [Real.sq_sqrt (by norm_num : (0:ℝ) ≤ 5), Real.sqrt_nonneg 5] + have hq : |(z.im : ℝ)| ≤ |ordinary z| + |conjugate z| := by + have he : (z.im : ℝ) * Real.sqrt 5 = ordinary z - conjugate z := by + have := (eq_div_iff (by positivity : Real.sqrt 5 ≠ 0)).mp (endpointLabel_embedding z) + exact this + have ht : |ordinary z - conjugate z| ≤ |ordinary z| + |conjugate z| := + abs_sub _ _ + rw [← he,abs_mul,abs_of_nonneg (le_trans zero_le_one hs)] at ht + nlinarith [abs_nonneg (z.im : ℝ)] + have hp : |(z.re : ℝ)| ≤ |ordinary z| + 2*|(z.im : ℝ)| := by + have he : (z.re : ℝ) = ordinary z - (z.im : ℝ)*Real.goldenRatio := by + rw [ordinary_apply] + ring + rw [he] + calc + _ ≤ |ordinary z| + |(z.im : ℝ)*Real.goldenRatio| := abs_sub _ _ + _ = |ordinary z| + |(z.im : ℝ)| * Real.goldenRatio := by + rw [abs_mul, abs_of_pos Real.goldenRatio_pos] + _ ≤ _ := by nlinarith [Real.goldenRatio_lt_two,abs_nonneg (z.im : ℝ)] + nlinarith [abs_nonneg (conjugate z)] + +theorem tangent_basis_coefficients (u v : CutRing) (huv : u*v = 1) (d : CutRing) : + ∃ p q : ℤ, d = (p : CutRing)*u + (q : CutRing)*(cutTau*u) ∧ + |(p : ℝ)| + |(q : ℝ)| ≤ + (4*(|ordinary v|+|conjugate v|+1))*(|ordinary d|+|conjugate d|) := by + let z := d*v + refine ⟨z.re,z.im,?_,?_⟩ + · have he : z*u = d := by dsimp [z]; calc + d*v*u = d*(u*v) := by ring + _ = d := by rw [huv,mul_one] + calc + d = z*u := he.symm + _ = ((z.re : CutRing) + (z.im : CutRing)*cutTau)*u := + congrArg (fun w : CutRing => w*u) (cutRing_coefficients z).symm + _ = _ := by ring + · have hb := cutRing_coefficients_bound z + have ho : |ordinary z| = |ordinary d| * |ordinary v| := by simp [z,abs_mul] + have hc : |conjugate z| = |conjugate d| * |conjugate v| := by simp [z,abs_mul] + rw [ho,hc] at hb + nlinarith [abs_nonneg (ordinary d),abs_nonneg (conjugate d), + abs_nonneg (ordinary v),abs_nonneg (conjugate v), + mul_nonneg (abs_nonneg (ordinary d)) (abs_nonneg (conjugate v)), + mul_nonneg (abs_nonneg (conjugate d)) (abs_nonneg (ordinary v))] + +theorem exists_short_tangent_basis (l : CutRing) {δ : ℝ} (hδ : 0 < δ) : + ∃ u v : CutRing, u*v = 1 ∧ + (1+|ordinary l|)*(|ordinary u|+|ordinary (cutTau*u)|) < δ := by + have hsmall : Real.goldenRatio-1 < 1 := by linarith [Real.goldenRatio_lt_two] + have hpos : 0 < Real.goldenRatio-1 := by linarith [Real.one_lt_goldenRatio] + have hk : 0 < 3*(1+|ordinary l|) := by positivity + obtain ⟨b,hb⟩ := exists_pow_lt_of_lt_one (div_pos hδ hk) hsmall + refine ⟨(cutTau-1)^b,cutTau^b,?_,?_⟩ + · rw [← mul_pow,cutTau_inverse_mul,one_pow] + · simp only [map_pow,map_sub,map_one,map_mul,ordinary_cutTau,abs_mul, + abs_pow,abs_of_pos Real.goldenRatio_pos,abs_of_pos hpos] + have hpow : 0 < (Real.goldenRatio-1)^b := pow_pos hpos b + have hb' := (lt_div_iff₀ hk).mp hb + nlinarith [Real.goldenRatio_lt_two,abs_nonneg (ordinary l), + mul_pos (by positivity : 0 < 1+|ordinary l|) hpow] + +end ArithmeticTangentBasis + +section FiniteTangentChains + +noncomputable def integerSteps (k : ℤ) (u : CutRing) : List CutRing := + if 0 ≤ k then List.replicate k.toNat u else List.replicate (-k).toNat (-u) + +@[simp]theorem integerSteps_sum (k : ℤ) (u : CutRing) : + (integerSteps k u).sum = (k : CutRing)*u := by + by_cases hk : 0 ≤ k + · have hc : (k.toNat : CutRing) = (k : CutRing) := by + exact_mod_cast Int.toNat_of_nonneg hk + simp [integerSteps,hk,List.sum_replicate,nsmul_eq_mul,hc] + · have hn : 0 ≤ -k := by omega + have hc : ((-k).toNat : CutRing) = -(k : CutRing) := by + exact_mod_cast Int.toNat_of_nonneg hn + simp [integerSteps,hk,List.sum_replicate,nsmul_eq_mul,hc] + +theorem integerSteps_length (k : ℤ) (u : CutRing) : + ((integerSteps k u).length : ℝ) = |(k : ℝ)| := by + by_cases hk : 0 ≤ k + · have hc : (k.toNat : ℝ) = (k : ℝ) := by exact_mod_cast Int.toNat_of_nonneg hk + simp [integerSteps,hk,hc,abs_of_nonneg (by exact_mod_cast hk : (0:ℝ) ≤ k)] + · have hn : 0 ≤ -k := by omega + have hc : ((-k).toNat : ℝ) = -(k : ℝ) := by exact_mod_cast Int.toNat_of_nonneg hn + simp [integerSteps,hk,hc,abs_of_nonpos (by exact_mod_cast (le_of_not_ge hk) : (k:ℝ) ≤ 0)] + +theorem integerSteps_mem (k : ℤ) (u e : CutRing) (he : e ∈ integerSteps k u) : + e = u ∨ e = -u := by + by_cases hk : 0 ≤ k + · left + exact (List.mem_replicate.mp (by simpa only [integerSteps,ite_eq_left hk] using he)).2 + · right + exact (List.mem_replicate.mp (by simpa only [integerSteps,ite_eq_right hk] using he)).2 + +private theorem sum_abs_bound_by_length {α : Type*} (v : α → ℝ) + (xs : List α) {B : ℝ} (hs : ∀ x ∈ xs, |v x| ≤ B) : + |(xs.map v).sum| ≤ (xs.length : ℝ)*B := by + induction xs with + | nil => simp + | cons x xs ih => + have hx := hs x (by simp) + have ht := ih (fun y hy => hs y (by simp [hy])) + simp only [List.map_cons,List.sum_cons,List.length_cons,Nat.cast_add,Nat.cast_one] + calc + |v x + (xs.map v).sum| ≤ |v x| + |(xs.map v).sum| := abs_add_le _ _ + _ ≤ B + (xs.length : ℝ)*B := add_le_add hx ht + _ = _ := by ring + +@[simp]theorem endpointLabel_list_sum (xs : List CutRing) : + (endpointLabel xs.sum : ℝ) = (xs.map (fun z => (endpointLabel z : ℝ))).sum := by + induction xs with + | nil => simp [endpointLabel] + | cons x xs ih => simpa only [List.sum_cons,endpointLabel_add,Int.cast_add, + List.map_cons] using congrArg (fun r => (endpointLabel x : ℝ)+r) ih + +theorem tangent_chain (u v : CutRing) (huv : u*v = 1) (d : CutRing) : + ∃ w : List CutRing, + w.sum = d ∧ + (∀ e ∈ w, e = u ∨ e = -u ∨ e = cutTau*u ∨ e = -(cutTau*u)) ∧ + (w.length : ℝ) ≤ (4*(|ordinary v|+|conjugate v|+1))*(|ordinary d|+|conjugate d|) ∧ + (∀ n : ℕ, + min 0 (ordinary d) - (|ordinary u|+|ordinary (cutTau*u)|) ≤ + ordinary (w.take n).sum ∧ + ordinary (w.take n).sum ≤ + max 0 (ordinary d) + (|ordinary u|+|ordinary (cutTau*u)|)) ∧ + ∀ n : ℕ, |(endpointLabel (w.take n).sum : ℝ)| ≤ + (4*(|ordinary v|+|conjugate v|+1))*(|ordinary d|+|conjugate d|)* + (|(endpointLabel u : ℝ)|+|(endpointLabel (cutTau*u) : ℝ)|) := by + obtain ⟨p,q,hd,hpq⟩ := tangent_basis_coefficients u v huv d + let xs := integerSteps p u ++ integerSteps q (cutTau*u) + have hsum : xs.sum = d := by simp only [xs,List.sum_append,integerSteps_sum]; exact hd.symm + have hmem : ∀ e ∈ xs, e = u ∨ e = -u ∨ e = cutTau*u ∨ e = -(cutTau*u) := by + intro e he + rcases List.mem_append.mp he with he | he + · rcases integerSteps_mem p u e he with rfl | rfl + · exact Or.inl rfl + · exact Or.inr (Or.inl rfl) + · rcases integerSteps_mem q (cutTau*u) e he with rfl | rfl + · exact Or.inr (Or.inr (Or.inl rfl)) + · exact Or.inr (Or.inr (Or.inr rfl)) + have ho : ∀ e ∈ xs, |ordinary e| ≤ |ordinary u|+|ordinary (cutTau*u)| := by + intro e he + rcases hmem e he with he | he | he | he + · rw [he]; exact le_add_of_nonneg_right (abs_nonneg _) + · rw [he,map_neg,abs_neg]; exact le_add_of_nonneg_right (abs_nonneg _) + · rw [he]; exact le_add_of_nonneg_left (abs_nonneg _) + · rw [he,map_neg,abs_neg]; exact le_add_of_nonneg_left (abs_nonneg _) + obtain ⟨w,hw,hbound⟩ := exists_step_order_near_segment ordinary xs (by positivity) ho + have hwsum : w.sum = d := hw.sum_eq.trans hsum + have hwm : ∀ e ∈ w, e = u ∨ e = -u ∨ e = cutTau*u ∨ e = -(cutTau*u) := + fun e he => hmem e (hw.mem_iff.mp he) + have hlen : (w.length : ℝ) ≤ + (4*(|ordinary v|+|conjugate v|+1))*(|ordinary d|+|conjugate d|) := by + rw [hw.length_eq] + simpa only [xs,List.length_append,Nat.cast_add,integerSteps_length] using hpq + refine ⟨w,hwsum,hwm,hlen,?_,?_⟩ + · intro n + simpa only [← map_list_sum,hsum] using hbound n + · intro n + let B := |(endpointLabel u : ℝ)|+|(endpointLabel (cutTau*u) : ℝ)| + have hB : 0 ≤ B := by dsimp [B]; positivity + have hb : ∀ e ∈ w.take n, |(endpointLabel e : ℝ)| ≤ B := by + intro e he + have hew := List.mem_of_mem_take he + have hneg : ∀ z : CutRing, |(endpointLabel (-z) : ℝ)| = |(endpointLabel z : ℝ)| := by + intro z + simp only [endpointLabel,QuadraticAlgebra.im_neg,Int.cast_neg,abs_neg] + rcases hwm e hew with he | he | he | he + · rw [he]; exact le_add_of_nonneg_right (abs_nonneg _) + · rw [he,hneg]; exact le_add_of_nonneg_right (abs_nonneg _) + · rw [he]; exact le_add_of_nonneg_left (abs_nonneg _) + · rw [he,hneg]; exact le_add_of_nonneg_left (abs_nonneg _) + rw [endpointLabel_list_sum] + calc + _ ≤ ((w.take n).length : ℝ)*B := sum_abs_bound_by_length _ _ hb + _ ≤ (w.length : ℝ)*B := mul_le_mul_of_nonneg_right (by exact_mod_cast (show (w.take n).length ≤ w.length by simp only [List.length_take]; exact min_le_right _ _)) hB + _ ≤ _ := mul_le_mul_of_nonneg_right hlen hB + +end FiniteTangentChains + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/AssemblyMap.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/AssemblyMap.lean new file mode 100644 index 0000000000000000000000000000000000000000..b72f41d5c37d485475751f7d1ae7e6831400e1eb --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/AssemblyMap.lean @@ -0,0 +1,100 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.TotalSingle + +namespace OAI + +section +open CategoryTheory Limits SimplicialObject Simplicial Opposite AlgebraicTopology +open HomologicalComplex HomologicalComplex₂ +namespace ModelAssembly + +open DiagonalResolution +variable {X Y : Dᵒᵖ ⥤ Type} (φ : X ⟶ Y) +noncomputable def mapCocone (F : D ⥤ A) : Cocone (projection X ⋙ F) where + pt := (assembly Y).obj F + ι := { + app e := colimit.ι (projection Y ⋙ F) (φ.mapElements.op.obj e) + naturality e e' f := by + simpa [projection,NatTrans.mapElements,assembly] using + colimit.w (projection Y ⋙ F) (φ.mapElements.op.map f) } +noncomputable def assemblyMapF (F : D ⥤ A) : (assembly X).obj F ⟶ (assembly Y).obj F := + colimit.desc (projection X ⋙ F) (mapCocone φ F) +@[reassoc (attr := simp)] lemma ι_assemblyMapF (F : D ⥤ A) (e : X.Elementsᵒᵖ) : + colimit.ι (projection X ⋙ F) e ≫ assemblyMapF φ F = + colimit.ι (projection Y ⋙ F) (φ.mapElements.op.obj e) := + colimit.ι_desc _ _ +noncomputable def assemblyMap : assembly X ⟶ assembly Y where + app := assemblyMapF φ + naturality F G α := by + apply colimit.hom_ext + intro e + change colimit.ι (projection X ⋙ F) e ≫ + colim.map (Functor.whiskerLeft (projection X) α) ≫ assemblyMapF φ G = + colimit.ι (projection X ⋙ F) e ≫ assemblyMapF φ F ≫ + colim.map (Functor.whiskerLeft (projection Y) α) + erw [colimit.ι_map_assoc,ι_assemblyMapF,←Category.assoc,ι_assemblyMapF,colimit.ι_map] + rfl +@[reassoc (attr := simp)] lemma ι_assemblyMap (F : D ⥤ A) (e : X.Elementsᵒᵖ) : + colimit.ι (projection X ⋙ F) e ≫ (assemblyMap φ).app F = + colimit.ι (projection Y ⋙ F) (φ.mapElements.op.obj e) := + ι_assemblyMapF φ F e +@[reassoc] lemma map_forward (d : D) : + (assemblyMap φ).app (free d) ≫ forward Y d = + forward X d ≫ (sigmaConst.obj Z).map (φ.app (op d)) := by + apply colimit.hom_ext + intro e + apply Sigma.hom_ext + intro f + change Sigma.ι (fun _ : d ⟶ e.unop.1.unop => Z) f ≫ colimit.ι (projection X ⋙ free d) e ≫ _ = _ + erw [← Category.assoc (colimit.ι (projection X ⋙ free d) e) + ((assemblyMap φ).app (free d)) (forward Y d), ι_assemblyMap, ι_to] + change Sigma.ι (fun _ : d ⟶ e.unop.1.unop => Z) f ≫ + (freeCocone Y d).ι.app (φ.mapElements.op.obj e) = + Sigma.ι (fun _ : d ⟶ e.unop.1.unop => Z) f ≫ + colimit.ι (projection X ⋙ free d) e ≫ forward X d ≫ _ + erw [← Category.assoc (colimit.ι (projection X ⋙ free d) e) (forward X d) + ((sigmaConst.obj Z).map (φ.app (op d))), ι_to] + dsimp only [freeCocone] + erw [Sigma.ι_comp_desc, Sigma.ι_comp_desc_assoc] + dsimp only [sigmaConst] + erw [Sigma.ι_comp_map', Category.id_comp] + congr 1 + exact (ConcreteCategory.congr_hom (φ.naturality f.op) e.unop.2).symm +end ModelAssembly + +end + +open CategoryTheory Limits HomologicalComplex HomologicalComplex₂ +namespace TotalFunctor + +universe u v u' v' +variable {C : Type u} [Category.{v} C] [Preadditive C] [HasCoproducts.{0} C] + {E : Type u'} [Category.{v'} E] [Preadditive E] [HasCoproducts.{0} E] +open TotalHomotopy +variable {F G : C ⥤ E} [F.Additive] [G.Additive] (α : F ⟶ G) +noncomputable abbrev nat₂ (K : HomologicalComplex₂ C c c) : map₂ F K ⟶ map₂ G K := + ((α.mapHomologicalComplex c).mapHomologicalComplex c).app K +@[reassoc] lemma comparison_natural (K : HomologicalComplex₂ C c c) : + total.map (nat₂ α K) c ≫ comparison G K = + comparison F K ≫ (α.mapHomologicalComplex c).app (K.total c) := by + apply HomologicalComplex.Hom.ext + funext n + apply total.hom_ext + intro p q hpq + change (map₂ F K).ιTotal c p q n hpq ≫ (total.map (nat₂ α K) c).f n ≫ comparisonF G K n = + (map₂ F K).ιTotal c p q n hpq ≫ comparisonF F K n ≫ α.app _ + rw [ιTotal_map_assoc,ι_comparisonF,ι_comparisonF_assoc] + exact (α.naturality _).symm +@[reassoc] lemma iso_natural [PreservesColimitsOfSize.{0,0} F] [PreservesColimitsOfSize.{0,0} G] + (K : HomologicalComplex₂ C c c) : + (α.mapHomologicalComplex c).app (K.total c) ≫ (iso G K).hom = + (iso F K).hom ≫ total.map (nat₂ α K) c := by + apply (cancel_mono (comparison G K)).mp + simp only [Category.assoc] + change _ ≫ inv (comparison G K) ≫ comparison G K = + inv (comparison F K) ≫ total.map (nat₂ α K) c ≫ comparison G K + rw [IsIso.inv_hom_id,Category.comp_id,comparison_natural,←Category.assoc, + IsIso.inv_hom_id,Category.id_comp] +end TotalFunctor + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/BiProjective.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/BiProjective.lean new file mode 100644 index 0000000000000000000000000000000000000000..80e81cce2d10ba14f4f978da6ef3033128b977d1 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/BiProjective.lean @@ -0,0 +1,234 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.TotalSingle + +namespace OAI + +section + +section + +open CategoryTheory Limits SimplicialObject Simplicial Opposite AlgebraicTopology +open HomologicalComplex HomologicalComplex₂ +namespace BiResolution + +open DiagonalResolution TotalHomotopy + +noncomputable def aug₀ : total.X 0 ⟶ (Functor.const D).obj Z := + complex.totalDesc (fun p q hpq => eqToHom (by + change p+q=0 at hpq + obtain ⟨rfl,rfl⟩ := Nat.add_eq_zero_iff.mp hpq + rfl) ≫ DiagonalResolution.augmentation.app (op ⦋0⦌)) + +@[reassoc (attr := simp)] lemma ι_aug₀ : + complex.ιTotal c 0 0 0 (by simp) ≫ aug₀ = + DiagonalResolution.augmentation.app (op ⦋0⦌) := by + simp [aug₀,ι_totalDesc] + change (𝟙 _) ≫ DiagonalResolution.augmentation.app (op ⦋0⦌) = _ + exact Category.id_comp _ + +lemma d_aug₀ : total.d 1 0 ≫ aug₀=0 := by + change (complex.total c).d 1 0 ≫ aug₀=0 + apply HomologicalComplex₂.total.hom_ext + intro p q hpq + change p+q=1 at hpq + have hpq' : (p=0 ∧ q=1) ∨ (p=1 ∧ q=0) := by omega + rcases hpq' with ⟨rfl,rfl⟩ | ⟨rfl,rfl⟩ + all_goals + simp only [comp_zero] + erw [←Category.assoc] + first | erw [ι_d_leftZero] | erw [ι_d_rightZero] + erw [Category.assoc,ι_aug₀] + apply NatTrans.ext + funext d + apply Sigma.hom_ext + intro f + simp [complex,chains,row,rowMap,AlternatingFaceMapComplex.objD, + DiagonalResolution.augmentation,pre,SimplicialObject.δ] + erw [NatTrans.comp_app,NatTrans.app_add,NatTrans.app_neg] + · change Sigma.ι (fun _ : (⦋0⦌,⦋1⦌) ⟶ d => Z) f ≫ + ((Limits.Sigma.desc (fun index : (⦋0⦌,⦋1⦌) ⟶ d => + Sigma.ι (fun _ : (⦋0⦌,⦋0⦌) ⟶ d => Z) + (Prod.mkHom index.1 (SimplexCategory.δ 0 ≫ index.2))) + + -Limits.Sigma.desc (fun index : (⦋0⦌,⦋1⦌) ⟶ d => + Sigma.ι (fun _ : (⦋0⦌,⦋0⦌) ⟶ d => Z) + (Prod.mkHom index.1 (SimplexCategory.δ 1 ≫ index.2)))) ≫ + Sigma.desc (fun _ : (⦋0⦌,⦋0⦌) ⟶ d => 𝟙 Z)) = 0 + simp [Preadditive.add_comp,Preadditive.comp_add,Preadditive.neg_comp, + Preadditive.comp_neg] + · change Sigma.ι (fun _ : (⦋1⦌,⦋0⦌) ⟶ d => Z) f ≫ + ((Limits.Sigma.desc (fun index : (⦋1⦌,⦋0⦌) ⟶ d => + Sigma.ι (fun _ : (⦋0⦌,⦋0⦌) ⟶ d => Z) + (Prod.mkHom (SimplexCategory.δ 0 ≫ index.1) index.2)) + + -Limits.Sigma.desc (fun index : (⦋1⦌,⦋0⦌) ⟶ d => + Sigma.ι (fun _ : (⦋0⦌,⦋0⦌) ⟶ d => Z) + (Prod.mkHom (SimplexCategory.δ 1 ≫ index.1) index.2))) ≫ + Sigma.desc (fun _ : (⦋0⦌,⦋0⦌) ⟶ d => 𝟙 Z)) = 0 + simp [Preadditive.add_comp,Preadditive.comp_add,Preadditive.neg_comp, + Preadditive.comp_neg] + +noncomputable def pi : total ⟶ (ChainComplex.single₀ (D ⥤ A)).obj ((Functor.const D).obj Z) := + (ChainComplex.toSingle₀Equiv total ((Functor.const D).obj Z)).symm ⟨aug₀,d_aug₀⟩ + +@[simp] lemma pi_f_zero : pi.f 0 = aug₀ := ChainComplex.toSingle₀Equiv_symm_apply_f_zero _ _ + +noncomputable def evalComplexIso (d : D) : + TotalFunctor.map₂ ((evaluation D A).obj d) complex ≅ complexAt d := by + let E := (evaluation D A).obj d + let F := E.mapHomologicalComplex c + refine eqToIso ?_ + change ((alternatingFaceMapComplex (ChainComplex (D ⥤ A) ℕ) ⋙ F.mapHomologicalComplex c).obj + (chains ⋙ alternatingFaceMapComplex (D ⥤ A))) = _ + rw [map_alternatingFaceMapComplex F] + change AlternatingFaceMapComplex.obj (chains ⋙ alternatingFaceMapComplex (D ⥤ A) ⋙ F) = _ + rw [map_alternatingFaceMapComplex E] + rfl + +noncomputable def evalTotalIso (d : D) : + (((evaluation D A).obj d).mapHomologicalComplex c).obj total ≅ (complexAt d).total c := + TotalFunctor.iso ((evaluation D A).obj d) complex ≪≫ total.mapIso (evalComplexIso d) c + +end BiResolution + +end + +section + +open CategoryTheory Limits SimplicialObject Simplicial Opposite AlgebraicTopology +open HomologicalComplex HomologicalComplex₂ +namespace BiResolution + +open DiagonalResolution TotalHomotopy + +lemma contraction_aug (d : D) : + (complexAt d).ιTotal c 0 0 0 (by simp) ≫ ((totalAtEquiv d).hom.f 0) = + Sigma.desc (fun _ : (⦋0⦌,⦋0⦌) ⟶ d => 𝟙 Z) := by + change (complexAt d).ιTotal c 0 0 0 (by simp) ≫ + (total.map (complexAtEquiv d).hom c).f 0 ≫ + (TotalHomotopy.singleIso (AlternatingFaceMapComplex.obj (point d))).hom.f 0 ≫ + (pointExtra d).homotopyEquiv.hom.f 0 = _ + rw [ιTotal_map_assoc] + have hs : (TotalHomotopy.single (AlternatingFaceMapComplex.obj (point d))).ιTotal c 0 0 0 (by simp) ≫ + (TotalHomotopy.singleIso (AlternatingFaceMapComplex.obj (point d))).hom.f 0 = 𝟙 _ := by + change (TotalHomotopy.singleIn _).f 0 ≫ _ = _ + have h := congrArg (fun f : AlternatingFaceMapComplex.obj (point d) ⟶ _ => f.f 0) + (Iso.inv_hom_id (TotalHomotopy.singleIso (AlternatingFaceMapComplex.obj (point d)))) + exact h + erw [←Category.assoc _ ((TotalHomotopy.singleIso (AlternatingFaceMapComplex.obj (point d))).hom.f 0) + ((pointExtra d).homotopyEquiv.hom.f 0),hs,Category.id_comp] + dsimp [complexAtEquiv,complexAtIso,pointExtra] + simp [HomotopyEquiv.ofIso,CategoryTheory.eqToIso,HomologicalComplex.eqToHom_f,HomologicalComplex.singleMapHomologicalComplex, + SimplicialObject.Augmented.ExtraDegeneracy.homotopyEquiv, + extra,augmentedAt,augmentation,pointAugmented,pointAugmentation] + apply Sigma.hom_ext + intro f + erw [eqToHom_refl,Category.id_comp] + change Sigma.ι (fun _ : (⦋0⦌,⦋0⦌) ⟶ d => Z) f ≫ + Sigma.desc (fun index : (⦋0⦌,⦋0⦌) ⟶ d => + Sigma.ι (fun _ : ⦋0⦌ ⟶ d.2 => Z) index.2) ≫ + Sigma.desc (fun _ : ⦋0⦌ ⟶ d.2 => 𝟙 Z) = + Sigma.ι (fun _ : (⦋0⦌,⦋0⦌) ⟶ d => Z) f ≫ + Sigma.desc (fun _ : (⦋0⦌,⦋0⦌) ⟶ d => 𝟙 Z) + simp + +lemma eval_inverse_aug (d : D) : + (complexAt d).ιTotal c 0 0 0 (by simp) ≫ (evalTotalIso d).inv.f 0 ≫ + ((((evaluation D A).obj d).mapHomologicalComplex c).map pi).f 0 = + Sigma.desc (fun _ : (⦋0⦌,⦋0⦌) ⟶ d => 𝟙 Z) := by + change (complexAt d).ιTotal c 0 0 0 (by simp) ≫ + (total.map (evalComplexIso d).inv c).f 0 ≫ + TotalFunctor.comparisonF ((evaluation D A).obj d) complex 0 ≫ (pi.f 0).app d = _ + rw [ιTotal_map_assoc] + simp only [evalComplexIso,CategoryTheory.eqToIso,HomologicalComplex.eqToHom_f] + change _ ≫ (TotalFunctor.comparisonF ((evaluation D A).obj d) complex 0) ≫ (pi.f 0).app d = _ + erw [←Category.assoc,TotalFunctor.ι_comparisonF,pi_f_zero] + change (complex.ιTotal c 0 0 0 (by simp)).app d ≫ aug₀.app d = _ + erw [←NatTrans.comp_app,ι_aug₀] + rfl + +instance pi_quasiIso : QuasiIso pi := by + rw [HomologicalComplex.quasiIso_iff_evaluation] + intro d + let f := (((evaluation D A).obj d).mapHomologicalComplex c).map pi + have h : (evalTotalIso d).inv ≫ f ≫ (DiagonalResolution.singleAtIso d).hom = + (totalAtEquiv d).hom := by + apply HomologicalComplex.to_single_hom_ext + apply HomologicalComplex₂.total.hom_ext + intro p q hpq + change p+q=0 at hpq + obtain ⟨rfl,rfl⟩ := Nat.add_eq_zero_iff.mp hpq + simp only [HomologicalComplex.comp_f,←Category.assoc,contraction_aug] + dsimp only [f] + rw [Category.assoc ((complexAt d).ιTotal c 0 0 0 hpq),eval_inverse_aug] + simp [DiagonalResolution.singleAtIso,HomologicalComplex.singleMapHomologicalComplex] + change (Sigma.desc (fun _ : (⦋0⦌,⦋0⦌) ⟶ d => 𝟙 Z)) ≫ 𝟙 Z = _ + exact Category.comp_id _ + change QuasiIso f + rw [←quasiIso_iff_comp_left (evalTotalIso d).inv f, + ←quasiIso_iff_comp_right ((evalTotalIso d).inv ≫ f) (DiagonalResolution.singleAtIso d).hom, + Category.assoc,h] + infer_instance + +noncomputable def resolution : ProjectiveResolution ((Functor.const D).obj Z) where + complex := total + π := pi + quasiIso := pi_quasiIso + +end BiResolution + +end + +section + +open CategoryTheory Limits SimplicialObject Simplicial Opposite AlgebraicTopology +open HomologicalComplex HomologicalComplex₂ +namespace ModelAssembly + +open DiagonalResolution +variable (X : Dᵒᵖ ⥤ Type) + +@[reassoc (attr := simp)] lemma pre_forward {a b : D} (k : a ⟶ b) : + (assembly X).map (pre k) ≫ forward X a = + forward X b ≫ (sigmaConst.obj Z).map (X.map k.op) := by + apply colimit.hom_ext + intro e + apply Sigma.hom_ext + intro f + change Sigma.ι (fun _ : b ⟶ e.unop.1.unop => Z) f ≫ + colimit.ι (projection X ⋙ free b) e ≫ + colim.map (Functor.whiskerLeft (projection X) (pre k)) ≫ forward X a = _ + erw [colimit.ι_map_assoc] + change Sigma.ι (fun _ : b ⟶ e.unop.1.unop => Z) f ≫ + (pre k).app e.unop.1.unop ≫ colimit.ι (projection X ⋙ free a) e ≫ forward X a = _ + erw [←Category.assoc,ι_pre,ι_to] + erw [ι_to_assoc] + dsimp [freeCocone,sigmaConst] + erw [Sigma.ι_comp_desc,←Category.assoc,Sigma.ι_comp_desc,Sigma.ι_comp_map',Category.id_comp] + congr 1 + change X.map (k ≫ f).op e.unop.2 = X.map k.op (X.map f.op e.unop.2) + rw [op_comp,X.map_comp] + rfl + +noncomputable def models : Dᵒᵖ ⥤ (D ⥤ A) where + obj d := free d.unop + map f := pre f.unop + map_id d := pre_id _ + map_comp f g := by simp only [unop_comp,pre_comp] + +noncomputable def freeNatIso : models ⋙ assembly X ≅ X ⋙ sigmaConst.obj Z := + NatIso.ofComponents (fun d => freeIso X d.unop) (fun f => pre_forward X f.unop) + +noncomputable def modelEquiv : HomotopyEquiv DiagonalResolution.complex BiResolution.total := + ProjectiveResolution.homotopyEquiv DiagonalResolution.resolution BiResolution.resolution + +noncomputable def assembledEquiv : HomotopyEquiv + (((assembly X).mapHomologicalComplex (ComplexShape.down ℕ)).obj DiagonalResolution.complex) + (((assembly X).mapHomologicalComplex (ComplexShape.down ℕ)).obj BiResolution.total) := + (assembly X).mapHomotopyEquiv modelEquiv + +end ModelAssembly + +end + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/BiResolution.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/BiResolution.lean new file mode 100644 index 0000000000000000000000000000000000000000..31b9713c8fa7721b299043d0062b59ffc4b36ef2 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/BiResolution.lean @@ -0,0 +1,171 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.DiagonalResolution + +namespace OAI + +open CategoryTheory Limits SimplicialObject Simplicial Opposite AlgebraicTopology +open HomologicalComplex HomologicalComplex₂ +namespace BiResolution + +open DiagonalResolution + +noncomputable def row (p : SimplexCategory) : SimplicialObject (D ⥤ A) where + obj q := free (p,q.unop) + map f := pre (Prod.mkHom (𝟙 p) f.unop) + map_id q := by simpa only [unop_id,←prod_id] using pre_id (p,q.unop) + map_comp f g := by + simpa only [prod_comp, Prod.mkHom, unop_comp, Category.id_comp] using + pre_comp (Prod.mkHom (𝟙 p) g.unop) (Prod.mkHom (𝟙 p) f.unop) + +noncomputable def rowMap {p p' : SimplexCategory} (f : p ⟶ p') : row p' ⟶ row p where + app q := pre (Prod.mkHom f (𝟙 q.unop)) + naturality q q' g := by + dsimp [row] + rw [←pre_comp,←pre_comp] + congr 1 + +noncomputable def chains : SimplicialObject (SimplicialObject (D ⥤ A)) where + obj p := row p.unop + map f := rowMap f.unop + map_id p := by + apply NatTrans.ext + funext q + dsimp [rowMap] + simpa only [unop_id,←prod_id,row] using pre_id (p.unop,q.unop) + map_comp f g := by + apply NatTrans.ext + funext q + dsimp [rowMap, row] + simpa only [prod_comp,Prod.mkHom,unop_comp,Category.id_comp] using + pre_comp (Prod.mkHom g.unop (𝟙 q.unop)) (Prod.mkHom f.unop (𝟙 q.unop)) + +noncomputable def complex : HomologicalComplex₂ (D ⥤ A) (ComplexShape.down ℕ) (ComplexShape.down ℕ) := + AlternatingFaceMapComplex.obj (chains ⋙ alternatingFaceMapComplex (D ⥤ A)) + +noncomputable def total : ChainComplex (D ⥤ A) ℕ := complex.total (ComplexShape.down ℕ) + +instance projective (n : ℕ) : Projective (total.X n) := by + change Projective (∐ (fun ij : {ij : ℕ × ℕ // ij.1+ij.2=n} => free (⦋ij.1.1⦌,⦋ij.1.2⦌))) + have (ij : {ij : ℕ × ℕ // ij.1+ij.2=n}) : Projective (free (⦋ij.1.1⦌,⦋ij.1.2⦌)) := + (evaluationAdjunctionRight A _).map_projective Z inferInstance + infer_instance + +noncomputable def rowAt (d : D) (p : SimplexCategory) : SimplicialObject A := + row p ⋙ (evaluation D A).obj d + +noncomputable def chainsAt (d : D) : SimplicialObject (SimplicialObject A) := + chains ⋙ (SimplicialObject.whiskering _ _).obj ((evaluation D A).obj d) + +noncomputable def point (d : D) : SimplicialObject A where + obj q := ∐ (fun _ : q.unop ⟶ d.2 => Z) + map f := Sigma.desc (fun g => Sigma.ι (fun _ : _ ⟶ d.2 => Z) (f.unop ≫ g)) + map_id q := by apply Sigma.hom_ext; intro g; simp + map_comp f g := by apply Sigma.hom_ext; intro h; simp [Category.assoc] + +@[simp] lemma chainsAt_obj_map (d : D) (p : SimplexCategoryᵒᵖ) + {q q' : SimplexCategoryᵒᵖ} (f : q ⟶ q') : + ((chainsAt d).obj p).map f = (pre (Prod.mkHom (𝟙 p.unop) f.unop)).app d := rfl +@[simp] lemma chainsAt_map_app (d : D) {p p' : SimplexCategoryᵒᵖ} (f : p ⟶ p') + (q : SimplexCategoryᵒᵖ) : + ((chainsAt d).map f).app q = (pre (Prod.mkHom f.unop (𝟙 q.unop))).app d := rfl +noncomputable def augmentation (d : D) : chainsAt d ⟶ (SimplicialObject.const _).obj (point d) where + app p := + { app q := Sigma.desc (fun f : (p.unop,q.unop) ⟶ d => Sigma.ι (fun _ : q.unop ⟶ d.2 => Z) f.2) + naturality q q' f := by + apply Sigma.hom_ext + intro g + simp [point,pre] + erw [Sigma.ι_comp_desc_assoc, Sigma.ι_comp_desc, + Sigma.ι_comp_desc_assoc, Sigma.ι_comp_desc] } + naturality p p' f := by + apply NatTrans.ext + funext q + apply Sigma.hom_ext + intro g + simp [pre] + erw [Sigma.ι_comp_desc_assoc, Sigma.ι_comp_desc] + rfl + +noncomputable def augmentedAt (d : D) : SimplicialObject.Augmented (SimplicialObject A) where + left := chainsAt d + right := point d + hom := augmentation d +noncomputable def section_ (d : D) : point d ⟶ (chainsAt d).obj (op ⦋0⦌) where + app q := Sigma.desc (fun f : q.unop ⟶ d.2 => + Sigma.ι (fun _ : (⦋0⦌,q.unop) ⟶ d => Z) (zeroSimplex d.1,f)) + naturality q q' f := by + apply Sigma.hom_ext + intro g + simp [point,pre] + erw [Sigma.ι_comp_desc_assoc, Sigma.ι_comp_desc] + rfl + +open SSet.Augmented.StandardSimplex in +noncomputable def shift_ (d : D) (n : ℕ) : + (chainsAt d).obj (op ⦋n⦌) ⟶ (chainsAt d).obj (op ⦋n+1⦌) where + app q := Sigma.desc (fun f : (⦋n⦌,q.unop) ⟶ d => + Sigma.ι (fun _ : (⦋n+1⦌,q.unop) ⟶ d => Z) (shift f.1,f.2)) + naturality q q' f := by + apply Sigma.hom_ext + intro g + simp [pre] + erw [Sigma.ι_comp_desc_assoc, Sigma.ι_comp_desc, + Sigma.ι_comp_desc_assoc, Sigma.ι_comp_desc] +noncomputable def extra (d : D) : (augmentedAt d).ExtraDegeneracy where + s' := section_ d + s := shift_ d + s'_comp_ε := by + apply NatTrans.ext + funext q + apply Sigma.hom_ext + intro f + dsimp only [augmentedAt,section_,shift_,augmentation,SimplicialObject.δ,SimplicialObject.σ,NatTrans.comp_app,NatTrans.id_app] + simp + erw [Sigma.ι_comp_desc_assoc, Sigma.ι_comp_desc, Category.comp_id] + s₀_comp_δ₁ := by + apply NatTrans.ext + funext q + apply Sigma.hom_ext + intro f + dsimp only [augmentedAt,section_,shift_,augmentation,SimplicialObject.δ,SimplicialObject.σ,NatTrans.comp_app,NatTrans.id_app] + simp only [Quiver.Hom.unop_op, chainsAt_map_app, pre, prod_comp, Prod.mkHom, Category.id_comp] + erw [Sigma.ι_comp_desc_assoc, Sigma.ι_comp_desc, + Sigma.ι_comp_desc_assoc, Sigma.ι_comp_desc] + simp only [shift_δ₁] + rfl + s_comp_δ₀ n := by + apply NatTrans.ext + funext q + apply Sigma.hom_ext + intro f + dsimp only [augmentedAt,section_,shift_,augmentation,SimplicialObject.δ,SimplicialObject.σ,NatTrans.comp_app,NatTrans.id_app] + simp only [Quiver.Hom.unop_op, chainsAt_map_app, pre, prod_comp, Prod.mkHom, Category.id_comp] + erw [Sigma.ι_comp_desc_assoc, Sigma.ι_comp_desc] + simp only [shift_δ₀, Prod.eta] + exact (Category.comp_id _).symm + s_comp_δ n i := by + apply NatTrans.ext + funext q + apply Sigma.hom_ext + intro f + dsimp only [augmentedAt,section_,shift_,augmentation,SimplicialObject.δ,SimplicialObject.σ,NatTrans.comp_app,NatTrans.id_app] + simp only [Quiver.Hom.unop_op, chainsAt_map_app, pre, prod_comp, Prod.mkHom, Category.id_comp] + erw [Sigma.ι_comp_desc_assoc, Sigma.ι_comp_desc, + Sigma.ι_comp_desc_assoc, Sigma.ι_comp_desc] + simp only [shift_δ_succ] + rfl + s_comp_σ n i := by + apply NatTrans.ext + funext q + apply Sigma.hom_ext + intro f + dsimp only [augmentedAt,section_,shift_,augmentation,SimplicialObject.δ,SimplicialObject.σ,NatTrans.comp_app,NatTrans.id_app] + simp only [Quiver.Hom.unop_op, chainsAt_map_app, pre, prod_comp, Prod.mkHom, Category.id_comp] + erw [Sigma.ι_comp_desc_assoc, Sigma.ι_comp_desc, + Sigma.ι_comp_desc_assoc, Sigma.ι_comp_desc] + simp only [shift_σ_succ] + rfl + +end BiResolution + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/BinaryPullback.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/BinaryPullback.lean new file mode 100644 index 0000000000000000000000000000000000000000..825fd8f3c37f8712b3452fac3ac1b63b1f00fed5 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/BinaryPullback.lean @@ -0,0 +1,73 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.NerveProduct + +namespace OAI + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits MonoidalCategory Simplicial Opposite +namespace ComponentStable +open FreeChains ComponentTranslation ConnectedProduct + +variable {C:Type} [Groupoid.{0} C] [MonoidalCategory C] [SymmetricCategory C] +variable {X Y X' Y':SSet} +noncomputable def pullD (f:X⟶nerve C) (g:Y⟶nerve C) (q:ℕ) : + (X⊗Y).homology Z q ⟶ object (C:=C) q := SSet.homologyMap (f⊗ₘg) Z q ≫ binaryD q +omit [SymmetricCategory C] in +@[reassoc] lemma pullD_comp (f:X⟶X') (g:Y⟶Y') (F:X'⟶nerve C) (G:Y'⟶nerve C) (q:ℕ) : + SSet.homologyMap (f⊗ₘg) Z q ≫ pullD F G q=pullD (f≫F) (g≫G) q := by + rw [pullD,←SSet.homologyMap_comp_assoc,tensorHom_comp_tensorHom, pullD] +omit [SymmetricCategory C] in +lemma pullD_congr {D E:Type} [Category.{0} D] [Category.{0} E] + {f f':D⥤C} {g g':E⥤C} (α:f≅f') (β:g≅g') (q:ℕ) : + pullD (nerveMap f) (nerveMap g) q=pullD (nerveMap f') (nerveMap g') q := by + rw [pullD,pullD,NerveProduct.homology_congr α β] +omit [SymmetricCategory C] in +lemma pullD_left (f:X⟶nerve C) (g:Y⟶nerve C) (U:C) (q:ℕ) : + pullD (f≫nerveMap (tensorLeft U)) g q=pullD f g q := by + conv_lhs => rw [←Category.comp_id g] + rw [pullD,←tensorHom_comp_tensorHom,SSet.homologyMap_comp,Category.assoc,binaryD_left] + rfl +lemma pullD_right (f:X⟶nerve C) (g:Y⟶nerve C) (U:C) (q:ℕ) : + pullD f (g≫nerveMap (tensorLeft U)) q=pullD f g q := by + conv_lhs => rw [←Category.comp_id f] + rw [pullD,←tensorHom_comp_tensorHom,SSet.homologyMap_comp,Category.assoc,binaryD_second_left] + rfl +lemma pairLeft_tensor (f:X⟶X') (g:Y⟶Y') (y:Y.obj (op ⦋0⦌)) : + pairLeft X Y y ≫ (f⊗ₘg)=f≫pairLeft X' Y' (g.app _ y) := by + apply CartesianMonoidalCategory.hom_ext + · simp [pairLeft] + · simp [pairLeft,SSet.const_comp] +lemma pairRight_tensor (f:X⟶X') (g:Y⟶Y') (x:X.obj (op ⦋0⦌)) : + pairRight X Y x ≫ (f⊗ₘg)=g≫pairRight X' Y' (f.app _ x) := by + apply CartesianMonoidalCategory.hom_ext + · simp [pairRight,SSet.const_comp] + · simp [pairRight] +@[reassoc] lemma inclusion_pullD (f:X⟶nerve C) (g:Y⟶nerve C) + (x:X.obj (op ⦋0⦌)) (y:Y.obj (op ⦋0⦌)) (q:ℕ) (hq:q≠0) : + ConnectedProduct.inclusion X Y x y q ≫ pullD f g q=0 := by + apply biprod.hom_ext' + · simp only [ConnectedProduct.inclusion,biprod.inl_desc_assoc,pullD] + rw [←SSet.homologyMap_comp_assoc,pairLeft_tensor,SSet.homologyMap_comp_assoc,pairLeft_binaryD _ q hq,comp_zero] + simp + · simp only [ConnectedProduct.inclusion,biprod.inr_desc_assoc,pullD] + rw [←SSet.homologyMap_comp_assoc,pairRight_tensor,SSet.homologyMap_comp_assoc,pairRight_binaryD _ q hq,comp_zero] + simp +lemma pullD_kernel_value (f:X⟶nerve C) (g:Y⟶nerve C) + (x:X.obj (op ⦋0⦌)) (y:Y.obj (op ⦋0⦌)) (q:ℕ) (hq:q≠0) + (z:((X⊗Y).homology Z q:A)) : + ∃w:((X⊗Y).homology Z q:A), projection X Y q w=0 ∧ pullD f g q w=pullD f g q z := by + let inc:=ConnectedProduct.inclusion X Y x y q + refine ⟨z-inc (projection X Y q z),?_,?_⟩ + · rw [map_sub] + have h:=congrArg (fun k=>k (projection X Y q z)) (inclusion_projection X Y x y q hq) + change projection X Y q (inc (projection X Y q z))=projection X Y q z at h + rw [h,sub_self] + · rw [map_sub] + have h:=congrArg (fun k=>k (projection X Y q z)) (inclusion_pullD f g x y q hq) + change pullD f g q (inc (projection X Y q z))=0 at h + rw [h,sub_zero] +end ComponentStable + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/BooleanStepCoefficients.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/BooleanStepCoefficients.lean new file mode 100644 index 0000000000000000000000000000000000000000..b0e72623174f5c20f7cdb0c087dc9b52b794bd4a --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/BooleanStepCoefficients.lean @@ -0,0 +1,184 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.TorusStepFunctions +import OAI.GroupTheory.SimpleAmenable.Configurations.BooleanStages +import OAI.GroupTheory.SimpleAmenable.Configurations.StageOrder + +namespace OAI + +section + +section +open CategoryTheory Classical Set +namespace SimpleAmenable.PolygonObject + +namespace BooleanPartition +variable {a:ℕ} +lemma arrangement_color (P:BooleanPartition a) : HasSquareArrangement P.color := by + choose S hS using fun b => polygon_hasSquareArrangement (P.polygon b) + refine ⟨Finset.univ.biUnion S,fun p q hpq => ?_⟩ + have h := hS (P.color p) p q (fun l hl => hpq l (Finset.mem_biUnion.mpr ⟨_,Finset.mem_univ _,hl⟩)) + exact ((decide_eq_decide.mp h).mp rfl).symm +lemma arrangement_values (P:BooleanPartition a) {K:Type*} (v:Fin P.size→K) : + HasSquareArrangement (fun p => v (P.color p)) := by + obtain ⟨S,hS⟩ := P.arrangement_color + exact ⟨S,fun p q h => congrArg v (hS p q h)⟩ + +lemma exists_arrangement_partition {ι K:Type} [Fintype ι] (f:ι→GenericSquare a→K) + (hf:∀i,HasSquareArrangement (f i)) : + ∃P:BooleanPartition a,∀i p q,P.color p=P.color q → f i p=f i q := by + choose S hS using hf + let T := Finset.univ.biUnion S + let C : T → polygonAlgebra a := fun l => ⟨_,halfPlane_mem a l.val.1 l.val.2⟩ + refine ⟨generated C,fun i p q hpq => hS i p q (fun l hl => ?_)⟩ + have h := generated_constant C hpq (⟨l,Finset.mem_biUnion.mpr ⟨i,Finset.mem_univ _,hl⟩⟩:T) + exact decide_eq_decide.mpr h +end BooleanPartition +variable (a:ℕ) (K:Type) [AddCommGroup K] [Module ℤ K] +noncomputable def booleanStepSubmodule : Submodule ℤ (GenericSquare a→K) where + carrier := {f | HasSquareArrangement f} + zero_mem' := ⟨∅,fun _ _ _ => rfl⟩ + add_mem' := by + rintro f g ⟨S,hS⟩ ⟨T,hT⟩ + exact ⟨S∪T,fun p q h => congrArg₂ (·+·) + (hS p q (fun l hl => h l (Finset.mem_union_left T hl))) + (hT p q (fun l hl => h l (Finset.mem_union_right S hl)))⟩ + smul_mem' := by + rintro r f ⟨S,hS⟩ + exact ⟨S,fun p q h => congrArg (r • ·) (hS p q h)⟩ +noncomputable abbrev BooleanStep := ↥(booleanStepSubmodule a K) +namespace BooleanStep +variable {a K} +noncomputable def inflate (P:BooleanPartition a) : (Fin P.size→K) →ₗ[ℤ] BooleanStep a K where + toFun v := ⟨fun p => v (P.color p),P.arrangement_values v⟩ + map_add' _ _ := rfl + map_smul' _ _ := rfl +noncomputable def evaluate (P:BooleanPartition a) : BooleanStep a K →ₗ[ℤ] (Fin P.size→K) where + toFun f b := f.val (P.point b) + map_add' _ _ := rfl + map_smul' _ _ := rfl +omit [Module ℤ K] in +@[simp] lemma inflate_apply (P:BooleanPartition a) (v:Fin P.size→K) (p:GenericSquare a) : + (inflate (K:=K) P v).val p=v (P.color p) := rfl +omit [Module ℤ K] in +@[simp] lemma evaluate_apply (P:BooleanPartition a) (v:BooleanStep a K) (b:Fin P.size) : + evaluate (K:=K) P v b=v.val (P.point b) := rfl +omit [Module ℤ K] in +lemma evaluate_inflate (P:BooleanPartition a) : (evaluate (K:=K) P).comp (inflate (K:=K) P)=LinearMap.id := by + apply LinearMap.ext; intro v; funext i + simp only [LinearMap.comp_apply,evaluate_apply,inflate_apply,BooleanPartition.color_point,LinearMap.id_apply] +omit [Module ℤ K] in +lemma inflate_injective (P:BooleanPartition a) : Function.Injective (inflate (K:=K) P) := by + intro x y h + have hh := congrArg (evaluate (K:=K) P) h + change ((evaluate (K:=K) P).comp (inflate (K:=K) P)) x=((evaluate (K:=K) P).comp (inflate (K:=K) P)) y at hh + simpa only [evaluate_inflate,LinearMap.id_apply] using hh +noncomputable def refinement {P Q:BooleanPartition a} (_h:P.Refines Q) : + (Fin P.size→K) →ₗ[ℤ] (Fin Q.size→K) := (evaluate (K:=K) Q).comp (inflate (K:=K) P) +omit [Module ℤ K] in +lemma inflate_refinement {P Q:BooleanPartition a} (h:P.Refines Q) : + (inflate (K:=K) Q).comp (refinement h)=inflate (K:=K) P := by + apply LinearMap.ext; intro v; apply Subtype.ext; funext p + change v (P.color (Q.point (Q.color p)))=v (P.color p) + exact congrArg v (h _ _ (Q.color_point (Q.color p))) +omit [Module ℤ K] in +lemma exists_common {ι:Type} [Fintype ι] (f:ι→BooleanStep a K) : + ∃P:BooleanPartition a,∀i,inflate (K:=K) P (evaluate (K:=K) P (f i))=f i := by + obtain ⟨P,hP⟩ := BooleanPartition.exists_arrangement_partition (fun i => (f i).val) (fun i => (f i).property) + refine ⟨P,fun i => ?_⟩ + apply Subtype.ext; funext p + exact hP i _ _ (P.color_point (P.color p)) +end BooleanStep +end SimpleAmenable.PolygonObject + +end + +section +open CategoryTheory Classical Set TensorProduct +namespace SimpleAmenable.PolygonObject.BooleanStep + +variable {a:ℕ} {K:Type} [AddCommGroup K] +noncomputable def multiply : BooleanStep a ℤ →ₗ[ℤ] K →ₗ[ℤ] BooleanStep a K where + toFun f := { + toFun k := ⟨fun p => f.val p • k,by + obtain ⟨S,hS⟩ := f.property + exact ⟨S,fun p q h => congrArg (· • k) (hS p q h)⟩⟩ + map_add' x y := by apply Subtype.ext; funext p; change f.val p • (x+y)=f.val p • x+f.val p • y; exact smul_add _ _ _ + map_smul' r k := by apply Subtype.ext; funext p; change f.val p • (r • k)=r • (f.val p • k); exact smul_comm _ _ _ } + map_add' f g := by ext k p; exact add_smul _ _ _ + map_smul' r f := by + apply LinearMap.ext; intro k; apply Subtype.ext; funext p + change (r • f.val p) • k = r • (f.val p • k) + exact smul_assoc r (f.val p) k +noncomputable def tensorMap : BooleanStep a ℤ ⊗[ℤ] K →ₗ[ℤ] BooleanStep a K := + TensorProduct.lift multiply +@[simp] lemma tensorMap_tmul (f:BooleanStep a ℤ) (k:K) (p:GenericSquare a) : + (tensorMap (a:=a) (K:=K) (f ⊗ₜ[ℤ] k)).val p=f.val p • k := rfl +noncomputable def finiteTensorEquiv (P:BooleanPartition a) : + (Fin P.size→ℤ) ⊗[ℤ] K ≃ₗ[ℤ] (Fin P.size→K) := + TensorProduct.comm ℤ _ _ ≪≫ₗ TensorProduct.piScalarRight ℤ ℤ K (Fin P.size) +@[simp] lemma finiteTensorEquiv_tmul (P:BooleanPartition a) (v:Fin P.size→ℤ) (k:K) : + finiteTensorEquiv (K:=K) P (v ⊗ₜ[ℤ] k)=fun i => v i • k := by + change TensorProduct.piScalarRightHom ℤ ℤ K (Fin P.size) (k ⊗ₜ[ℤ] v)=_ + exact TensorProduct.piScalarRightHom_tmul ℤ ℤ K (Fin P.size) k v +noncomputable def tensorInflate (P:BooleanPartition a) : + (Fin P.size→ℤ) ⊗[ℤ] K →ₗ[ℤ] BooleanStep a ℤ ⊗[ℤ] K := + TensorProduct.map (inflate (K:=ℤ) P) LinearMap.id +lemma tensorMap_inflate (P:BooleanPartition a) : + (tensorMap (a:=a) (K:=K)).comp (tensorInflate P) = + (inflate (K:=K) P).comp (finiteTensorEquiv (K:=K) P).toLinearMap := by + apply TensorProduct.ext'; intro v k; apply Subtype.ext; funext p + change v (P.color p) • k=finiteTensorEquiv (K:=K) P (v ⊗ₜ[ℤ] k) (P.color p) + rw [finiteTensorEquiv_tmul] +lemma tensorInflate_refinement {P Q:BooleanPartition a} (h:P.Refines Q) : + (tensorInflate (K:=K) Q).comp (TensorProduct.map (refinement (K:=ℤ) h) LinearMap.id)= + tensorInflate P := by + apply TensorProduct.ext'; intro v k + exact congrArg (fun f => f ⊗ₜ[ℤ] k) (LinearMap.congr_fun (inflate_refinement (K:=ℤ) h) v) +lemma exists_tensor_stage (x:BooleanStep a ℤ ⊗[ℤ] K) : + ∃P:BooleanPartition a,∃v:(Fin P.size→ℤ) ⊗[ℤ] K,tensorInflate P v=x := by + induction x using TensorProduct.inductionOn with + | tmul f k => + obtain ⟨P,hP⟩ := exists_common (fun _:Fin 1 => f) + refine ⟨P,evaluate (K:=ℤ) P f ⊗ₜ[ℤ] k,?_⟩ + change inflate (K:=ℤ) P (evaluate (K:=ℤ) P f) ⊗ₜ[ℤ] k = f ⊗ₜ[ℤ] k + rw [hP 0] + | add x y hx hy => + obtain ⟨P,v,rfl⟩ := hx + obtain ⟨Q,w,rfl⟩ := hy + let T := P.join Q + let hP : P.Refines T := P.le_join_left Q + let hQ : Q.Refines T := P.le_join_right Q + refine ⟨T,TensorProduct.map (refinement hP) LinearMap.id v+ + TensorProduct.map (refinement hQ) LinearMap.id w,?_⟩ + rw [map_add] + exact congrArg₂ (·+·) (LinearMap.congr_fun (tensorInflate_refinement (K:=K) hP) v) + (LinearMap.congr_fun (tensorInflate_refinement (K:=K) hQ) w) +lemma tensorMap_injective : Function.Injective (tensorMap (a:=a) (K:=K)) := by + apply (tensorMap (a:=a) (K:=K)).ker_eq_bot.mp + rw [LinearMap.ker_eq_bot'] + intro x hx + obtain ⟨P,v,rfl⟩ := exists_tensor_stage x + have hv : inflate (K:=K) P (finiteTensorEquiv (K:=K) P v)=0 := by + change ((inflate (K:=K) P).comp (finiteTensorEquiv (K:=K) P).toLinearMap) v=0 + rw [←tensorMap_inflate] + exact hx + have hv0 : finiteTensorEquiv (K:=K) P v=0 := inflate_injective P (hv.trans (map_zero _).symm) + have h := (finiteTensorEquiv (K:=K) P).injective (hv0.trans (map_zero _).symm) + rw [h,map_zero] +lemma tensorMap_surjective : Function.Surjective (tensorMap (a:=a) (K:=K)) := by + intro f + obtain ⟨P,hP⟩ := exists_common (fun _:Fin 1 => f) + refine ⟨tensorInflate P ((finiteTensorEquiv (K:=K) P).symm (evaluate (K:=K) P f)),?_⟩ + change ((tensorMap (a:=a) (K:=K)).comp (tensorInflate P)) _ = _ + rw [tensorMap_inflate,LinearMap.comp_apply,LinearEquiv.coe_coe,LinearEquiv.apply_symm_apply] + exact hP 0 + +noncomputable def tensorEquiv : SquareStep a ⊗[ℤ] K ≃ₗ[ℤ] BooleanStep a K := + LinearEquiv.ofBijective tensorMap ⟨tensorMap_injective,tensorMap_surjective⟩ +end SimpleAmenable.PolygonObject.BooleanStep + +end + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/BoundedHomologyEdge.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/BoundedHomologyEdge.lean new file mode 100644 index 0000000000000000000000000000000000000000..d205115958a807dc6187c1c112dcc1954a3ccefc --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/BoundedHomologyEdge.lean @@ -0,0 +1,273 @@ +import Mathlib + +namespace OAI + +section + +section + +open CategoryTheory CategoryTheory.Limits + +namespace BoundedHomologyEdge + +universe u +variable {k G : Type u} [CommRing k] [Group G] + +noncomputable abbrev Hmap {A B : Rep k G} (n : ℕ) (f : A ⟶ B) : + groupHomology A n ⟶ groupHomology B n := + (groupHomology.functor k G n).map f + +lemma Hmap_comp {A B C : Rep k G} (n : ℕ) (f : A ⟶ B) (g : B ⟶ C) : + Hmap n (f ≫ g) = Hmap n f ≫ Hmap n g := + (groupHomology.functor k G n).map_comp f g + +lemma epi_Hmap_zero {A B : Rep k G} (f : A ⟶ B) [Epi f] : Epi (Hmap 0 f) := + groupHomology.epi_map_0_of_epi f + +lemma exact₂ {X : ShortComplex (Rep k G)} (hX : X.ShortExact) (n : ℕ) : + (ShortComplex.mk (Hmap n X.f) (Hmap n X.g) + (by rw [← Hmap_comp, X.zero]; exact (groupHomology.functor k G n).map_zero _ _)).Exact := + groupHomology.mapShortComplex₂_exact hX n + +lemma exact₁ {X : ShortComplex (Rep k G)} (hX : X.ShortExact) (n : ℕ) : + (ShortComplex.mk (groupHomology.δ hX (n+1) n rfl) (Hmap n X.f) + (groupHomology.mapShortComplex₁ hX rfl).zero).Exact := + groupHomology.mapShortComplex₁_exact hX rfl + +lemma exact₃ {X : ShortComplex (Rep k G)} (hX : X.ShortExact) (n : ℕ) : + (ShortComplex.mk (Hmap (n+1) X.g) (groupHomology.δ hX (n+1) n rfl) + (groupHomology.mapShortComplex₃ hX rfl).zero).Exact := + groupHomology.mapShortComplex₃_exact hX rfl + +lemma epi_Hmap_succ_of_mono {X : ShortComplex (Rep k G)} (hX : X.ShortExact) (n : ℕ) + [Mono (Hmap n X.f)] : Epi (Hmap (n+1) X.g) := by + exact (exact₃ hX n).epi_f ((exact₁ hX n).mono_g_iff.mp (show Mono (Hmap n X.f) from inferInstance)) + +lemma epi_Hmap_succ_of_isZero {X : ShortComplex (Rep k G)} (hX : X.ShortExact) (n : ℕ) + (h : IsZero (groupHomology X.X₁ n)) : Epi (Hmap (n+1) X.g) := by + exact (exact₃ hX n).epi_f (h.eq_zero_of_tgt _) + +lemma mono_Hmap_of_zero {X : ShortComplex (Rep k G)} (hX : X.ShortExact) (n : ℕ) + (h : Hmap n X.f = 0) : Mono (Hmap n X.g) := + (exact₂ hX n).mono_g_iff.mpr h + +lemma isZero_H0_quotient {X : ShortComplex (Rep k G)} (hX : X.ShortExact) + [Epi (Hmap 0 X.f)] : IsZero (groupHomology X.X₃ 0) := by + let : Epi X.g := hX.epi_g + let : Epi (Hmap 0 X.g) := epi_Hmap_zero X.g + exact IsZero.of_epi_eq_zero (Hmap 0 X.g) ((exact₂ hX 0).epi_f_iff.mp (show Epi (Hmap 0 X.f) from inferInstance)) + +lemma isIso_right_of_epi_left {A B C : ModuleCat k} (f : A ⟶ B) (g : B ⟶ C) + [Epi f] [IsIso (f ≫ g)] : IsIso g := by + let : Mono f := mono_of_mono f g + let : IsIso f := isIso_of_mono_of_epi f + exact IsIso.of_isIso_comp_left f g + +section TwoKernels +variable {Z₁ Z₂ C₀ C₁ C₂ C₃ : Rep k G} + {i₁ : Z₁ ⟶ C₁} {p₁ : C₁ ⟶ C₀} {i₂ : Z₂ ⟶ C₂} {p₂ : C₂ ⟶ Z₁} + {w₁ : i₁ ≫ p₁ = 0} {w₂ : i₂ ≫ p₂ = 0} + (h₁ : (ShortComplex.mk i₁ p₁ w₁).ShortExact) + (h₂ : (ShortComplex.mk i₂ p₂ w₂).ShortExact) + (e : C₃ ⟶ Z₂) [Epi e] + +lemma isIso_H0_i₂ [IsIso (Hmap 0 (e ≫ i₂))] : IsIso (Hmap 0 i₂) := by + let : Epi (Hmap 0 e) := epi_Hmap_zero e + let : IsIso (Hmap 0 e ≫ Hmap 0 i₂) := by rw [← Hmap_comp]; infer_instance + exact isIso_right_of_epi_left (Hmap 0 e) (Hmap 0 i₂) + +include h₂ + +lemma isZero_H0_kernel [IsIso (Hmap 0 (e ≫ i₂))] : + IsZero (groupHomology Z₁ 0) := by + let : IsIso (Hmap 0 i₂) := isIso_H0_i₂ e + exact isZero_H0_quotient h₂ + +include h₁ + +lemma H1_isIso [IsIso (Hmap 0 (e ≫ i₂))] + (hodd : Hmap 1 (p₂ ≫ i₁) = 0) : IsIso (Hmap 1 p₁) := by + let : IsIso (Hmap 0 i₂) := isIso_H0_i₂ e + let : Epi (Hmap 1 p₂) := epi_Hmap_succ_of_mono h₂ 0 + have hi : Hmap 1 i₁ = 0 := zero_of_epi_comp (Hmap 1 p₂) (by + rw [← Hmap_comp]; exact hodd) + let : Mono (Hmap 1 p₁) := mono_Hmap_of_zero h₁ 1 hi + let : Epi (Hmap 1 p₁) := epi_Hmap_succ_of_isZero h₁ 0 (isZero_H0_kernel h₂ e) + exact isIso_of_mono_of_epi (Hmap 1 p₁) + +lemma H2_epi_of_isZero [IsIso (Hmap 0 (e ≫ i₂))] + (hperfect : IsZero (groupHomology C₂ 1)) : Epi (Hmap 2 p₁) := by + let : IsIso (Hmap 0 i₂) := isIso_H0_i₂ e + let : Epi (Hmap 1 p₂) := epi_Hmap_succ_of_mono h₂ 0 + have hz : IsZero (groupHomology Z₁ 1) := IsZero.of_epi (Hmap 1 p₂) hperfect + exact epi_Hmap_succ_of_isZero h₁ 1 hz + +lemma H2_epi_of_epi [IsIso (Hmap 0 (e ≫ i₂))] + [Epi (Hmap 1 (e ≫ i₂))] : Epi (Hmap 2 p₁) := by + let : IsIso (Hmap 0 i₂) := isIso_H0_i₂ e + let : Epi (Hmap 1 p₂) := epi_Hmap_succ_of_mono h₂ 0 + let : Epi (Hmap 1 e ≫ Hmap 1 i₂) := by rw [← Hmap_comp]; infer_instance + let : Epi (Hmap 1 i₂) := epi_of_epi (Hmap 1 e) (Hmap 1 i₂) + have hp : Hmap 1 p₂ = 0 := (exact₂ h₂ 1).epi_f_iff.mp inferInstance + have hz : IsZero (groupHomology Z₁ 1) := IsZero.of_epi_eq_zero (Hmap 1 p₂) hp + exact epi_Hmap_succ_of_isZero h₁ 1 hz + +end TwoKernels + +section ThreeKernels +variable {Z₁ Z₂ Z₃ C₀ C₁ C₂ C₃ C₄ C₅ : Rep k G} + {i₁ : Z₁ ⟶ C₁} {p₁ : C₁ ⟶ C₀} {i₂ : Z₂ ⟶ C₂} {p₂ : C₂ ⟶ Z₁} + {i₃ : Z₃ ⟶ C₃} {p₃ : C₃ ⟶ Z₂} + {w₁ : i₁ ≫ p₁ = 0} {w₂ : i₂ ≫ p₂ = 0} {w₃ : i₃ ≫ p₃ = 0} + (h₁ : (ShortComplex.mk i₁ p₁ w₁).ShortExact) + (h₂ : (ShortComplex.mk i₂ p₂ w₂).ShortExact) + (h₃ : (ShortComplex.mk i₃ p₃ w₃).ShortExact) + (e₄ : C₄ ⟶ Z₃) [Epi e₄] (d₅ : C₅ ⟶ C₄) (w₅ : d₅ ≫ e₄ = 0) + +include w₅ + +lemma isZero_H0_third_kernel [Epi (Hmap 0 d₅)] : + IsZero (groupHomology Z₃ 0) := by + let : Epi (Hmap 0 e₄) := epi_Hmap_zero e₄ + have he : Hmap 0 e₄ = 0 := zero_of_epi_comp (Hmap 0 d₅) (by + rw [← Hmap_comp, w₅]; exact (groupHomology.functor k G 0).map_zero _ _) + exact IsZero.of_epi_eq_zero (Hmap 0 e₄) he + +include h₁ h₂ h₃ + +lemma H2_isIso [IsIso (Hmap 0 (p₃ ≫ i₂))] [IsIso (Hmap 1 (p₃ ≫ i₂))] + [Epi (Hmap 0 d₅)] (hodd : Hmap 2 (p₂ ≫ i₁) = 0) : IsIso (Hmap 2 p₁) := by + let : Epi p₃ := h₃.epi_g + let : Epi (Hmap 2 p₁) := H2_epi_of_epi h₁ h₂ p₃ + have hz : IsZero (groupHomology Z₃ 0) := isZero_H0_third_kernel e₄ d₅ w₅ + let : Epi (Hmap 1 p₃) := epi_Hmap_succ_of_isZero h₃ 0 hz + let : IsIso (Hmap 1 p₃ ≫ Hmap 1 i₂) := by rw [← Hmap_comp]; infer_instance + let : IsIso (Hmap 1 i₂) := isIso_right_of_epi_left (Hmap 1 p₃) (Hmap 1 i₂) + let : Epi (Hmap 2 p₂) := epi_Hmap_succ_of_mono h₂ 1 + have hi : Hmap 2 i₁ = 0 := zero_of_epi_comp (Hmap 2 p₂) (by + rw [← Hmap_comp]; exact hodd) + let : Mono (Hmap 2 p₁) := mono_Hmap_of_zero h₁ 2 hi + exact isIso_of_mono_of_epi (Hmap 2 p₁) +end ThreeKernels + +section KernelWindow + +lemma exact_of_comp_mono {𝒞 : Type*} [Category 𝒞] [HasZeroMorphisms 𝒞] + {A B C D : 𝒞} (f : A ⟶ B) (g : B ⟶ C) (i : C ⟶ D) [Mono i] + (w : f ≫ g = 0) (w' : f ≫ (g ≫ i) = 0) + (h : (ShortComplex.mk f (g ≫ i) w').Exact) : + (ShortComplex.mk f g w).Exact := by + let φ : ShortComplex.mk f g w ⟶ ShortComplex.mk f (g ≫ i) w' := + { τ₁ := 𝟙 A, τ₂ := 𝟙 B, τ₃ := i, comm₁₂ := by simp, comm₂₃ := by simp } + exact (ShortComplex.exact_iff_of_epi_of_isIso_of_mono φ).mpr h + +lemma kernel_shortExact {A B : Rep k G} (f : A ⟶ B) [Epi f] : + (ShortComplex.mk (kernel.ι f) f (kernel.condition f)).ShortExact := + { exact := ShortComplex.exact_kernel f, mono_f := inferInstance, epi_g := inferInstance } + +variable {C₀ C₁ C₂ C₃ C₄ C₅ : Rep k G} + (d₁ : C₁ ⟶ C₀) (d₂ : C₂ ⟶ C₁) (d₃ : C₃ ⟶ C₂) (d₄ : C₄ ⟶ C₃) (d₅ : C₅ ⟶ C₄) + (w₂ : d₂ ≫ d₁ = 0) (w₃ : d₃ ≫ d₂ = 0) (w₄ : d₄ ≫ d₃ = 0) (w₅ : d₅ ≫ d₄ = 0) + +noncomputable def lift₂ := kernel.lift d₁ d₂ w₂ + +@[simp] lemma lift₂_ι : lift₂ d₁ d₂ w₂ ≫ kernel.ι d₁ = d₂ := kernel.lift_ι _ _ _ + +include w₃ in +lemma comp_lift₂_zero : d₃ ≫ lift₂ d₁ d₂ w₂ = 0 := by + apply zero_of_comp_mono (kernel.ι d₁) + simpa only [Category.assoc, lift₂_ι] using w₃ + +noncomputable def lift₃ := + kernel.lift (lift₂ d₁ d₂ w₂) d₃ (comp_lift₂_zero d₁ d₂ d₃ w₂ w₃) + +@[simp] lemma lift₃_ι : lift₃ d₁ d₂ d₃ w₂ w₃ ≫ kernel.ι (lift₂ d₁ d₂ w₂) = d₃ := + kernel.lift_ι _ _ _ + +include w₄ in +lemma comp_lift₃_zero : d₄ ≫ lift₃ d₁ d₂ d₃ w₂ w₃ = 0 := by + apply zero_of_comp_mono (kernel.ι (lift₂ d₁ d₂ w₂)) + simpa only [Category.assoc, lift₃_ι] using w₄ + +noncomputable def lift₄ := + kernel.lift (lift₃ d₁ d₂ d₃ w₂ w₃) d₄ (comp_lift₃_zero d₁ d₂ d₃ d₄ w₂ w₃ w₄) + +@[simp] lemma lift₄_ι : lift₄ d₁ d₂ d₃ d₄ w₂ w₃ w₄ ≫ + kernel.ι (lift₃ d₁ d₂ d₃ w₂ w₃) = d₄ := kernel.lift_ι _ _ _ + +include w₅ in +lemma comp_lift₄_zero : d₅ ≫ lift₄ d₁ d₂ d₃ d₄ w₂ w₃ w₄ = 0 := by + apply zero_of_comp_mono (kernel.ι (lift₃ d₁ d₂ d₃ w₂ w₃)) + simpa only [Category.assoc, lift₄_ι] using w₅ + +lemma epi_lift₂ (h : (ShortComplex.mk d₂ d₁ w₂).Exact) : Epi (lift₂ d₁ d₂ w₂) := + h.epi_kernelLift + +lemma epi_lift₃ (h : (ShortComplex.mk d₃ d₂ w₃).Exact) : Epi (lift₃ d₁ d₂ d₃ w₂ w₃) := by + have hh : (ShortComplex.mk d₃ (lift₂ d₁ d₂ w₂) + (comp_lift₂_zero d₁ d₂ d₃ w₂ w₃)).Exact := by + apply exact_of_comp_mono d₃ (lift₂ d₁ d₂ w₂) (kernel.ι d₁) + (comp_lift₂_zero d₁ d₂ d₃ w₂ w₃) (by simpa using w₃) + simpa using h + exact hh.epi_kernelLift + +lemma epi_lift₄ (h : (ShortComplex.mk d₄ d₃ w₄).Exact) : + Epi (lift₄ d₁ d₂ d₃ d₄ w₂ w₃ w₄) := by + have hh : (ShortComplex.mk d₄ (lift₃ d₁ d₂ d₃ w₂ w₃) + (comp_lift₃_zero d₁ d₂ d₃ d₄ w₂ w₃ w₄)).Exact := by + apply exact_of_comp_mono d₄ (lift₃ d₁ d₂ d₃ w₂ w₃) (kernel.ι (lift₂ d₁ d₂ w₂)) + (comp_lift₃_zero d₁ d₂ d₃ d₄ w₂ w₃ w₄) (by simpa using w₄) + simpa using h + exact hh.epi_kernelLift + +lemma chain_H2_epi [Epi d₁] + (h₁ : (ShortComplex.mk d₂ d₁ w₂).Exact) + (h₂ : (ShortComplex.mk d₃ d₂ w₃).Exact) + [IsIso (Hmap 0 d₃)] (hz : IsZero (groupHomology C₂ 1)) : Epi (Hmap 2 d₁) := by + let : Epi (lift₂ d₁ d₂ w₂) := epi_lift₂ d₁ d₂ w₂ h₁ + let : Epi (lift₃ d₁ d₂ d₃ w₂ w₃) := epi_lift₃ d₁ d₂ d₃ w₂ w₃ h₂ + let : IsIso (Hmap 0 (lift₃ d₁ d₂ d₃ w₂ w₃ ≫ kernel.ι (lift₂ d₁ d₂ w₂))) := by + simpa only [lift₃_ι] using (inferInstance : IsIso (Hmap 0 d₃)) + exact H2_epi_of_isZero (kernel_shortExact d₁) (kernel_shortExact (lift₂ d₁ d₂ w₂)) + (lift₃ d₁ d₂ d₃ w₂ w₃) hz + +lemma chain_H1_isIso [Epi d₁] + (h₁ : (ShortComplex.mk d₂ d₁ w₂).Exact) + (h₂ : (ShortComplex.mk d₃ d₂ w₃).Exact) + [IsIso (Hmap 0 d₃)] (hodd : Hmap 1 d₂ = 0) : IsIso (Hmap 1 d₁) := by + let : Epi (lift₂ d₁ d₂ w₂) := epi_lift₂ d₁ d₂ w₂ h₁ + let : Epi (lift₃ d₁ d₂ d₃ w₂ w₃) := epi_lift₃ d₁ d₂ d₃ w₂ w₃ h₂ + let : IsIso (Hmap 0 (lift₃ d₁ d₂ d₃ w₂ w₃ ≫ kernel.ι (lift₂ d₁ d₂ w₂))) := by + simpa only [lift₃_ι] using (inferInstance : IsIso (Hmap 0 d₃)) + apply H1_isIso (kernel_shortExact d₁) (kernel_shortExact (lift₂ d₁ d₂ w₂)) + (lift₃ d₁ d₂ d₃ w₂ w₃) + simpa only [lift₂_ι] using hodd + +include w₅ in + +lemma chain_H2_isIso [Epi d₁] + (h₁ : (ShortComplex.mk d₂ d₁ w₂).Exact) + (h₂ : (ShortComplex.mk d₃ d₂ w₃).Exact) + (h₃ : (ShortComplex.mk d₄ d₃ w₄).Exact) + [IsIso (Hmap 0 d₃)] [IsIso (Hmap 1 d₃)] [Epi (Hmap 0 d₅)] + (hodd : Hmap 2 d₂ = 0) : IsIso (Hmap 2 d₁) := by + let : Epi (lift₂ d₁ d₂ w₂) := epi_lift₂ d₁ d₂ w₂ h₁ + let : Epi (lift₃ d₁ d₂ d₃ w₂ w₃) := epi_lift₃ d₁ d₂ d₃ w₂ w₃ h₂ + let : Epi (lift₄ d₁ d₂ d₃ d₄ w₂ w₃ w₄) := epi_lift₄ d₁ d₂ d₃ d₄ w₂ w₃ w₄ h₃ + let : IsIso (Hmap 0 (lift₃ d₁ d₂ d₃ w₂ w₃ ≫ kernel.ι (lift₂ d₁ d₂ w₂))) := by + simpa only [lift₃_ι] using (inferInstance : IsIso (Hmap 0 d₃)) + let : IsIso (Hmap 1 (lift₃ d₁ d₂ d₃ w₂ w₃ ≫ kernel.ι (lift₂ d₁ d₂ w₂))) := by + simpa only [lift₃_ι] using (inferInstance : IsIso (Hmap 1 d₃)) + apply H2_isIso (kernel_shortExact d₁) (kernel_shortExact (lift₂ d₁ d₂ w₂)) + (kernel_shortExact (lift₃ d₁ d₂ d₃ w₂ w₃)) + (lift₄ d₁ d₂ d₃ d₄ w₂ w₃ w₄) d₅ (comp_lift₄_zero d₁ d₂ d₃ d₄ d₅ w₂ w₃ w₄ w₅) + simpa only [lift₂_ι] using hodd +end KernelWindow + +end BoundedHomologyEdge + +end + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/CanonicalProduct.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/CanonicalProduct.lean new file mode 100644 index 0000000000000000000000000000000000000000..5ed4d6467c4172f0beb798674b8e4d96dd2ea00c --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/CanonicalProduct.lean @@ -0,0 +1,78 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.ConeHomology +import OAI.GroupTheory.SimpleAmenable.Homology.ConnectedProduct +import OAI.GroupTheory.SimpleAmenable.Simplicial.SimplicialConnectedProduct + +namespace OAI + +section + +section +open CategoryTheory Limits MonoidalCategory HomologicalComplex SimplicialObject Simplicial Opposite AlgebraicTopology +namespace ConnectedProduct +open FreeChains AugmentedSplit + +abbrev one : SSet := (Functor.const SimplexCategoryᵒᵖ).obj PUnit +lemma one_homology_zero (n : ℕ) (hn : n≠0) : IsZero (one.homology Z n) := by + let V := (sigmaConst.obj Z).obj PUnit + let e := (SimplicialObject.Augmented.ExtraDegeneracy.const V).homotopyEquiv + have hz : IsZero (((ChainComplex.single₀ A).obj V).homology n) := by + apply ShortComplex.isZero_homology_of_isZero_X₂ + exact HomologicalComplex.isZero_single_obj_X c 0 V n hn + let ei : one.chainComplex Z ≅ AlternatingFaceMapComplex.obj ((Functor.const SimplexCategoryᵒᵖ).obj V) := + (alternatingFaceMapComplex A).mapIso + (Functor.constComp SimplexCategoryᵒᵖ PUnit (sigmaConst.obj Z)) + exact IsZero.of_iso hz (((homologyFunctor A c n).mapIso ei) ≪≫ e.toHomologyIso n) +lemma const_homology_zero {X Y : SSet} (y : Y.obj (op ⦋0⦌)) (n : ℕ) (hn : n≠0) : + SSet.homologyMap (SSet.const (X:=X) y) Z n = 0 := by + have hh : SSet.const (X:=X) y = SSet.const (X:=X) (Y:=one) PUnit.unit ≫ SSet.const y := by simp + rw [hh,SSet.homologyMap_comp] + have hz := one_homology_zero n hn + rw [hz.eq_of_src (SSet.homologyMap (SSet.const (X:=one) y) Z n) 0,comp_zero] +variable (X Y : SSet) +noncomputable def diagonalProductIso : EilenbergZilber.diag ⋙ ProductChains.product X Y ≅ X⊗Y := + NatIso.ofComponents (fun _ => Iso.refl _) (by intros; rfl) +noncomputable def projection (n : ℕ) : (X⊗Y).homology Z n ⟶ X.homology Z n ⊞ Y.homology Z n := + biprod.lift (SSet.homologyMap (CartesianMonoidalCategory.fst X Y) Z n) + (SSet.homologyMap (CartesianMonoidalCategory.snd X Y) Z n) +noncomputable def inclusion (x : X.obj (op ⦋0⦌)) (y : Y.obj (op ⦋0⦌)) (n : ℕ) : + X.homology Z n ⊞ Y.homology Z n ⟶ (X⊗Y).homology Z n := + biprod.desc (SSet.homologyMap (pairLeft X Y y) Z n) (SSet.homologyMap (pairRight X Y x) Z n) +lemma inclusion_projection (x : X.obj (op ⦋0⦌)) (y : Y.obj (op ⦋0⦌)) (n : ℕ) (hn : n≠0) : + inclusion X Y x y n ≫ projection X Y n=𝟙 _ := by + apply biprod.hom_ext' <;> apply biprod.hom_ext + all_goals simp only [inclusion,projection,Category.assoc,biprod.inl_desc_assoc, + biprod.inr_desc_assoc,biprod.lift_fst,biprod.lift_snd,biprod.inl_fst,biprod.inl_snd, + biprod.inr_fst,biprod.inr_snd,Category.comp_id,←SSet.homologyMap_comp] + all_goals simp [pairLeft,pairRight,CartesianMonoidalCategory.lift_fst, + CartesianMonoidalCategory.lift_snd,const_homology_zero _ n hn] +lemma finite_biprod {R : Type} [CommRing R] (M N : ModuleCat R) + [Module.Finite R M] [Module.Finite R N] : Module.Finite R (M ⊞ N : ModuleCat R) := + Module.Finite.equiv (ModuleCat.biprodIsoProd M N).symm.toLinearEquiv +lemma projection_isIso [X.IsConnected] [Y.IsConnected] + (a b n : ℕ) (hn : 0 f z) (inclusion_projection X Y (point X) (point Y) n (by omega)) + have : Module.Finite ℤ (X.homology Z n ⊞ Y.homology Z n : A) := + finite_biprod _ _ + exact (ConcreteCategory.isIso_iff_bijective _).mpr + ⟨IsNoetherian.injective_of_surjective_of_injective e.toLinearEquiv.toLinearMap + (projection X Y n).hom e.toLinearEquiv.injective hsurj,hsurj⟩ +end ConnectedProduct + +end + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/ChainPositiveCokernel.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/ChainPositiveCokernel.lean new file mode 100644 index 0000000000000000000000000000000000000000..d173d9b1c833871598243b855c861bc19ef8a7c9 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/ChainPositiveCokernel.lean @@ -0,0 +1,28 @@ +import Mathlib + +namespace OAI + +section +open CategoryTheory Limits HomologicalComplex +namespace ChainComplex +open scoped _root_.ChainComplex + +variable {R:Type} [CommRing R] (K:ChainComplex (ModuleCat.{0} R) ℕ) +variable (n:ℕ) (hn:K.d (n+1) n=0) +noncomputable def positiveπ : K.X (n+1) ⟶ K.homology (n+1) := + K.pOpcycles (n+1) ≫ (K.isoHomologyι (n+1) n (by simp) hn).inv +instance : Epi (positiveπ K n hn) := by dsimp only [positiveπ]; infer_instance +@[reassoc (attr:=simp)] lemma d_positiveπ : K.d (n+2) (n+1) ≫ positiveπ K n hn=0 := by + simp [positiveπ] +noncomputable def positiveDesc {V:ModuleCat.{0} R} (f:K.X (n+1) ⟶ V) + (hf:K.d (n+2) (n+1) ≫ f=0) : K.homology (n+1) ⟶ V := + (K.isoHomologyι (n+1) n (by simp) hn).hom ≫ + K.descOpcycles f (n+2) (by simp) hf +@[reassoc (attr:=simp)] lemma positiveπ_desc {V:ModuleCat.{0} R} (f:K.X (n+1) ⟶ V) + (hf:K.d (n+2) (n+1) ≫ f=0) : positiveπ K n hn ≫ positiveDesc K n hn f hf=f := by + simp [positiveπ,positiveDesc] +end ChainComplex + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/ChartControlChain.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/ChartControlChain.lean new file mode 100644 index 0000000000000000000000000000000000000000..901064f13162ee3227daacb75824ba7f3400d494 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/ChartControlChain.lean @@ -0,0 +1,91 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.RandomFields.PrimitiveCovariance +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.SmallControlTransfer +import OAI.GroupTheory.SimpleAmenable.CentralCovers.CoordinateFamilyCompare +import OAI.GroupTheory.SimpleAmenable.CentralCovers.ControlCalculus + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section ChartControlChain + +variable {α H : Type*} [Fintype α] [DecidableEq α] [Group H] + [Group.IsPerfect (alternatingGroup α)] + +theorem small_control_action_chain (c : alternatingGroup α →* H) + (f : TrackStar α →* H) (g : ℕ → TrackStar α →* H) (n : ℕ) + (hstart : SmallControlled c f (g 0)) + (hstep : ∀ k, k < n → ∀ (I : ControlAlphabet α) s, ∀ x ∈ f.range, + g k (universalMap (subtypeAlternatingHom I.val) s)*x* + (g k (universalMap (subtypeAlternatingHom I.val) s))⁻¹ = + g (k+1) (universalMap (subtypeAlternatingHom I.val) s)*x* + (g (k+1) (universalMap (subtypeAlternatingHom I.val) s))⁻¹) : + SmallControlled c f (g n) := by + have h (k : ℕ) (hk : k ≤ n) : SmallControlled c f (g k) := by + induction k with + | zero => exact hstart + | succ k ih => + intro I s x hx + dsimp only [MonoidHom.comp_apply] + rw [← hstep k (by omega) I s x hx] + exact ih (by omega) I s x hx + exact h n le_rfl + +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) {ι κ : Type*} [Finite ι] [Finite κ] + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + +theorem chartCoordinateSector_eq_window (hlarge : 15 < m+1) + (n : ℕ) (h : B.CoordinateWindowLaw n) (q : Fin 2 → ℤ) + (P : ι → Fin 5 × (CutRing × CutRing)) + (hP : ∀ I, I.card ≤ 15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb P) + (v : κ → ι) (j : κ → Fin 2) (u : κ → CutRing × CutRing) + (hv : ∀ i, P (v i) = (coordinateTestIndex (j i),u i)) + (hs : ∀ i, q (j i) ≤ endpointLabel (if j i=0 then (u i).1 else (u i).2)) + (he : ∀ i, endpointLabel (if j i=0 then (u i).1 else (u i).2) < q (j i)+(n-1:ℕ)) + (V : polygonAlgebra a) + (hV : ResolvedBy (fun i => (spatialTranslate (u i) (coordinatePrimitive a (j i))).val) V.val) : + B.fullGeometricSector hlarge P hP V = B.windowSector hlarge n h q V := by + let Q := fun i => (coordinateTestIndex (j i),u i) + have heq : P ∘ v = Q := funext hv + have hQ : ∀ I, I.card ≤ 15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb Q := by + intro I hI b hb + rw [← heq] + exact PrimitiveFamilyLaw.reindex B I b hb P (hP I hI b hb) v + have hVQ : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) Q i).val) V.val := by + simpa only [Q,primitiveTests,primitiveFamilyTests,initialTest_coordinate] using hV + rw [← B.fullGeometricSector_subfamily hlarge P Q v heq hP hQ V hVQ] + exact B.coordinateFamilySector_eq_window hlarge n h q j u hs he hQ V hV + +theorem chart_chain_disjoint_control (hlarge : 20 ≤ m+1) + (f g : TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm)) + (hf : B.AlignedSmallSupported f) (hg : B.AlignedSmallSupported g) + (c : ℕ → TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm)) + (n : ℕ) (hc : B.AlignedSmallSupported (c n)) + (d : TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm)) + (hstart : SmallControlled B.c f (c 0)) + (hstep : ∀ k, k < n → ∀ (I : ControlAlphabet (Fin (m+1))) s, ∀ x ∈ f.range, + c k (universalMap (subtypeAlternatingHom I.val) s)*x* + (c k (universalMap (subtypeAlternatingHom I.val) s))⁻¹ = + c (k+1) (universalMap (subtypeAlternatingHom I.val) s)*x* + (c (k+1) (universalMap (subtypeAlternatingHom I.val) s))⁻¹) + (hfinish : SmallControlled B.c g d) (hsplit : ∀ s t, Commute (c n s) (d t)) : + ∀ s t, Commute (f s) (g t) := by + apply small_control_disjoint _ B.c B.constant_aligned B.disjoint_aligned + (by simpa using hlarge) f g (c n) d hf hg hc + (small_control_action_chain B.c f c n hstart hstep) hfinish hsplit + +end InitialCoverSystem +end ChartControlChain + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/ClippedLineSlide.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/ClippedLineSlide.lean new file mode 100644 index 0000000000000000000000000000000000000000..514169633efa24c7aea484ac8bd036e156aef38d --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/ClippedLineSlide.lean @@ -0,0 +1,142 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.ClosedChartOverlap + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section ClippedLineSlide + +theorem coordinateRectangle_in_clippingOverlap {a : ℕ} (r : CutRing) + (hr : 0 < ordinary r ∧ ordinary r < 1/2) + (z t : CutRing × CutRing) (L V : Fin 2 → CutRing) + (hLV : ∀ j, ordinary (L j) ≤ ordinary (V j)) + (ht : ∀ j, |ordinary (pointCoordinate t j)| ≤ 2*ordinary r) + (hz : ∀ j, -ordinary r ≤ ordinary (L j)-ordinary (pointCoordinate z j) ∧ + ordinary (V j)-ordinary (pointCoordinate z j) ≤ ordinary r) + (hzt : ∀ j, -ordinary r ≤ ordinary (L j)-ordinary (pointCoordinate (z+t) j) ∧ + ordinary (V j)-ordinary (pointCoordinate (z+t) j) ≤ ordinary r) : + coordinateRectangle a L V ≤ spatialTranslate z + (coordinateRectangle a (clippingOverlapLower r t) (clippingOverlapUpper r t)) := by + rw [spatialTranslate_coordinateRectangle] + apply coordinateRectangle_mono L V _ _ _ hLV _ _ + · intro j + have h0 := hz j + have h1 := hzt j + simp only [pointCoordinate_add,map_add] at h1 + change ordinary (clippingOverlapLower r t j + pointCoordinate z j) ≤ ordinary (L j) + simp only [clippingOverlapLower,ordinary_orderedCutMax,map_add,map_sub,map_neg] + have hh : max (-ordinary r) (ordinary (pointCoordinate t j)-ordinary r) ≤ + ordinary (L j)-ordinary (pointCoordinate z j) := max_le (by linarith) (by linarith) + linarith + · intro j + have h0 := hz j + have h1 := hzt j + simp only [pointCoordinate_add,map_add] at h1 + change ordinary (V j) ≤ ordinary (clippingOverlapUpper r t j + pointCoordinate z j) + simp only [clippingOverlapUpper,ordinary_orderedCutMin,map_add] + have hh : ordinary (V j)-ordinary (pointCoordinate z j) ≤ + min (ordinary r) (ordinary (pointCoordinate t j)+ordinary r) := le_min (by linarith) (by linarith) + linarith + · intro j + simpa only [map_add,add_sub_add_right_eq_sub] using (clippingOverlap_bounds r t hr ht j).2.1 + +noncomputable def tangentCoefficient (a : ℕ) (d j : Fin 2) : ℝ := + ordinary (pointCoordinate (tangentOffset a d 1) j) + +theorem tangentCoefficient_pos (a : ℕ) (d j : Fin 2) : 0 < tangentCoefficient a d j := by + fin_cases d <;> fin_cases j <;> simp [tangentCoefficient,pointCoordinate,tangentOffset, + pow_pos Real.goldenRatio_pos] + +theorem tangentCoefficient_bound (a : ℕ) (d j : Fin 2) : + tangentCoefficient a d j ≤ 1+|ordinary (cutTau^a)| := by + fin_cases d <;> fin_cases j <;> simp [tangentCoefficient,pointCoordinate,tangentOffset, + abs_of_pos (pow_pos Real.goldenRatio_pos a)] <;> positivity + +@[simp] theorem tangentOffset_coordinate (a : ℕ) (d j : Fin 2) (x : CutRing) : + ordinary (pointCoordinate (tangentOffset a d x) j) = tangentCoefficient a d j*ordinary x := by + fin_cases d <;> fin_cases j <;> simp [tangentCoefficient,pointCoordinate,tangentOffset] + +noncomputable def tangentAllowedLower (a : ℕ) (r : CutRing) (d : Fin 2) + (z : CutRing × CutRing) (V : Fin 2 → CutRing) : ℝ := + max ((ordinary (V 0)-ordinary (pointCoordinate z 0)-ordinary r)/tangentCoefficient a d 0) + ((ordinary (V 1)-ordinary (pointCoordinate z 1)-ordinary r)/tangentCoefficient a d 1) + +noncomputable def tangentAllowedUpper (a : ℕ) (r : CutRing) (d : Fin 2) + (z : CutRing × CutRing) (L : Fin 2 → CutRing) : ℝ := + min ((ordinary (L 0)-ordinary (pointCoordinate z 0)+ordinary r)/tangentCoefficient a d 0) + ((ordinary (L 1)-ordinary (pointCoordinate z 1)+ordinary r)/tangentCoefficient a d 1) + +theorem tangentAllowed_iff (a : ℕ) (r : CutRing) (d : Fin 2) + (z : CutRing × CutRing) (L V : Fin 2 → CutRing) (t : ℝ) : + (tangentAllowedLower a r d z V ≤ t ∧ t ≤ tangentAllowedUpper a r d z L) ↔ + ∀ j : Fin 2, -ordinary r ≤ ordinary (L j)-(ordinary (pointCoordinate z j)+tangentCoefficient a d j*t) ∧ + ordinary (V j)-(ordinary (pointCoordinate z j)+tangentCoefficient a d j*t) ≤ ordinary r := by + constructor + · rintro ⟨hl,hu⟩ j + have hl' : (ordinary (V j)-ordinary (pointCoordinate z j)-ordinary r)/tangentCoefficient a d j ≤ t := by + fin_cases j + · exact (le_max_left _ _).trans hl + · exact (le_max_right _ _).trans hl + have hu' : t ≤ (ordinary (L j)-ordinary (pointCoordinate z j)+ordinary r)/tangentCoefficient a d j := by + fin_cases j + · exact hu.trans (min_le_left _ _) + · exact hu.trans (min_le_right _ _) + have hlo := (div_le_iff₀ (tangentCoefficient_pos a d j)).mp hl' + have hup := (le_div_iff₀ (tangentCoefficient_pos a d j)).mp hu' + constructor <;> nlinarith + · intro h + have hlo (j : Fin 2) : + (ordinary (V j)-ordinary (pointCoordinate z j)-ordinary r)/tangentCoefficient a d j ≤ t := by + apply (div_le_iff₀ (tangentCoefficient_pos a d j)).mpr + have hh := (h j).2 + nlinarith + have hup (j : Fin 2) : + t ≤ (ordinary (L j)-ordinary (pointCoordinate z j)+ordinary r)/tangentCoefficient a d j := by + apply (le_div_iff₀ (tangentCoefficient_pos a d j)).mpr + have hh := (h j).1 + nlinarith + exact ⟨max_le (hlo 0) (hlo 1),le_min (hup 0) (hup 1)⟩ + +theorem tangentAllowed_wide (a : ℕ) (r u : CutRing) (hr : 0 < ordinary r) + (d : Fin 2) (z : CutRing × CutRing) (L V : Fin 2 → CutRing) (c : ℝ) + (hshort : 4*(1+|ordinary (cutTau^a)|)*(|ordinary u|+|ordinary (cutTau*u)|) ≤ ordinary r) + (hnear : ∀ j : Fin 2, + |ordinary (L j)-(ordinary (pointCoordinate z j)+tangentCoefficient a d j*c)| ≤ ordinary r/4 ∧ + |ordinary (V j)-(ordinary (pointCoordinate z j)+tangentCoefficient a d j*c)| ≤ ordinary r/4) : + 4*(|ordinary u|+|ordinary (cutTau*u)|) ≤ + tangentAllowedUpper a r d z L-tangentAllowedLower a r d z V := by + let b : ℝ := |ordinary u|+|ordinary (cutTau*u)| + have hb : 0 ≤ b := add_nonneg (abs_nonneg _) (abs_nonneg _) + have he (j : Fin 2) : 2*tangentCoefficient a d j*b ≤ ordinary r/2 := by + have hm := mul_le_mul_of_nonneg_right (tangentCoefficient_bound a d j) hb + change 4*(1+|ordinary (cutTau^a)|)*b ≤ ordinary r at hshort + nlinarith + have hl := (tangentAllowed_iff a r d z L V (c-2*b)).mpr (by + intro j + have hn0 := abs_le.mp (hnear j).1 + have hn1 := abs_le.mp (hnear j).2 + have hh := he j + have hp := mul_nonneg (tangentCoefficient_pos a d j).le hb + constructor <;> nlinarith) + have hu := (tangentAllowed_iff a r d z L V (c+2*b)).mpr (by + intro j + have hn0 := abs_le.mp (hnear j).1 + have hn1 := abs_le.mp (hnear j).2 + have hh := he j + have hp := mul_nonneg (tangentCoefficient_pos a d j).le hb + constructor <;> nlinarith) + change 4*b ≤ _ + linarith + +end ClippedLineSlide + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/Coefficient.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/Coefficient.lean new file mode 100644 index 0000000000000000000000000000000000000000..db9521899a468c4a59e8e699d847a8390320462c --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/Coefficient.lean @@ -0,0 +1,92 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.CoefficientFiltered + +namespace OAI + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits Simplicial SimplicialObject Opposite AlgebraicTopology HomologicalComplex +namespace ChainComplex +open scoped _root_.ChainComplex + +variable {R:Type} [CommRing R] (K:ChainComplex (ModuleCat.{0} R) ℕ) +noncomputable def zeroπ : K.X 0 ⟶ K.homology 0 := K.pOpcycles 0 ≫ K.isoHomologyι₀.inv +instance : Epi (zeroπ K) := by dsimp [zeroπ]; infer_instance +@[reassoc (attr:=simp)] lemma d_zeroπ : K.d 1 0 ≫ zeroπ K=0 := by simp [zeroπ] +noncomputable def zeroDesc {V:ModuleCat.{0} R} (f:K.X 0 ⟶ V) (hf:K.d 1 0 ≫ f=0) : + K.homology 0 ⟶ V := K.isoHomologyι₀.hom ≫ K.descOpcycles f 1 ((ComplexShape.down ℕ).prev_eq' rfl) hf +@[reassoc (attr:=simp)] lemma zeroπ_desc {V:ModuleCat.{0} R} (f:K.X 0 ⟶ V) (hf:K.d 1 0 ≫ f=0) : + zeroπ K ≫ zeroDesc K f hf=f := by simp [zeroπ,zeroDesc] +end ChainComplex +namespace CoefficientNerve + +variable {C:Type} [Category.{0} C] (F:C ⥤ ModuleCat.{0} ℤ) +noncomputable def point (x:C) : F.obj x ⟶ Obj F 0 := single F (ComposableArrows.mk₀ (op x)) +noncomputable def zeroι (x:C) : F.obj x ⟶ (complex F).homology 0 := + single F (ComposableArrows.mk₀ (op x)) ≫ (_root_.OAI.ChainComplex.zeroπ (complex F)) +lemma d10 : (complex F).d 1 0=map F (SimplexCategory.δ 0)-map F (SimplexCategory.δ 1) := by + change (∑ i:Fin 2, (-1:ℤ)^i.val • map F (SimplexCategory.δ i))=_ + simp [Fin.sum_univ_two] + exact (sub_eq_add_neg _ _).symm +noncomputable def edge (s:Simplex C 1) : s.right.unop ⟶ s.left.unop := + (s.map (homOfLE (Fin.zero_le (Fin.last 1)))).unop +lemma single_d10 (s:Simplex C 1) : + single F s ≫ (complex F).d 1 0 = + point F s.right.unop- + F.map (edge s) ≫ + point F s.left.unop := by + dsimp only [point] + erw [d10,Preadditive.comp_sub,single_map,single_map] + have h0 : trunc (SimplexCategory.δ (0:Fin 2)) s=ComposableArrows.mk₀ s.right := + ComposableArrows.ext₀ rfl + have h1 : trunc (SimplexCategory.δ (1:Fin 2)) s=ComposableArrows.mk₀ s.left := + ComposableArrows.ext₀ rfl + have t0 : tail (SimplexCategory.δ (0:Fin 2)) s=𝟙 _ := by + change (s.map (𝟙 _)).unop=𝟙 _ + rw [s.map_id]; rfl + erw [t0,F.map_id,Category.id_comp] + have e0:=single_eq F h0 rfl + have e1:=single_eq F h1 rfl + erw [eqToHom_refl,Category.id_comp] at e0 e1 + rw [e0,e1] + rfl +lemma zeroι_naturality {x y:C} (f:x⟶y) : F.map f ≫ zeroι F y=zeroι F x := by + have h:=congrArg (fun k=>single F (ComposableArrows.mk₁ f.op) ≫ k) (ChainComplex.d_zeroπ (complex F)) + erw [←Category.assoc,single_d10,Preadditive.sub_comp,comp_zero] at h + change zeroι F x - F.map f ≫ zeroι F y=0 at h + exact (sub_eq_zero.mp h).symm +noncomputable def zeroCocone : Cocone F where + pt := (complex F).homology 0 + ι := { app := zeroι F + naturality x y f := by simpa using zeroι_naturality F f } +lemma desc_d10 (d:Cocone F) : (complex F).d 1 0 ≫ desc F (fun s=>d.ι.app s.right.unop)=0 := by + apply hom_ext; intro s + erw [←Category.assoc,single_d10,Preadditive.sub_comp] + dsimp only [point] + erw [single_desc,Category.assoc,single_desc,comp_zero] + exact sub_eq_zero.mpr (d.w (s.map (homOfLE (Fin.zero_le (Fin.last 1)))).unop).symm +noncomputable def zeroIsColimit : IsColimit (zeroCocone F) where + desc d := _root_.OAI.ChainComplex.zeroDesc (complex F) (desc F (fun s=>d.ι.app s.right.unop)) (desc_d10 F d) + fac d x := by + dsimp only [zeroCocone,zeroι] + erw [Category.assoc,ChainComplex.zeroπ_desc,single_desc] + rfl + uniq d m hm := by + change (complex F).homology 0 ⟶ d.pt at m + apply (cancel_epi (_root_.OAI.ChainComplex.zeroπ (complex F))).mp + erw [ChainComplex.zeroπ_desc] + apply hom_ext; intro s + rw [single_desc] + have he : single F s = single F (ComposableArrows.mk₀ s.right) := by + have single_equality := + single_eq F (ComposableArrows.ext₀ (F:=s) (G:=ComposableArrows.mk₀ s.right) rfl) rfl + erw [eqToHom_refl,Category.id_comp] at single_equality + exact single_equality + rw [he] + exact hm s.right.unop +noncomputable def zeroIso : (complex F).homology 0 ≅ colimit F := + (zeroIsColimit F).coconePointUniqueUpToIso (colimit.isColimit F) +end CoefficientNerve + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/CoefficientContraction.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/CoefficientContraction.lean new file mode 100644 index 0000000000000000000000000000000000000000..2fa3bfb9d949e028023a11854ab6527983fc7bb5 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/CoefficientContraction.lean @@ -0,0 +1,117 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.CoefficientNerve + +namespace OAI + +open CategoryTheory Limits Simplicial SimplicialObject Opposite AlgebraicTopology +namespace SemiExtra +variable {C:Type*} [Category* C] +structure Data (X:Augmented C) where + s' : X.right ⟶ X.left _⦋0⦌ + s : ∀n:ℕ, X.left _⦋n⦌ ⟶ X.left _⦋n+1⦌ + s'_comp_ε : s' ≫ X.hom.app (op ⦋0⦌)=𝟙 X.right + s₀_comp_δ₁ : s 0 ≫ X.left.δ 1=X.hom.app (op ⦋0⦌) ≫ s' + s_comp_δ₀ : ∀n:ℕ, s n ≫ X.left.δ 0=𝟙 _ + s_comp_δ : ∀ (n:ℕ) (i:Fin (n+2)),s (n+1) ≫ X.left.δ i.succ=X.left.δ i ≫ s n +attribute [reassoc] Data.s₀_comp_δ₁ Data.s_comp_δ +attribute [reassoc (attr:=simp)] Data.s'_comp_ε Data.s_comp_δ₀ + +noncomputable def homotopyEquiv [Preadditive C] [HasZeroObject C] + {X:Augmented C} (ed:Data X) : + HomotopyEquiv (AlternatingFaceMapComplex.obj (Augmented.drop.obj X)) + ((ChainComplex.single₀ C).obj (Augmented.point.obj X)) where + hom := AlternatingFaceMapComplex.ε.app X + inv := (ChainComplex.fromSingle₀Equiv _ _).symm (by exact ed.s') + homotopyInvHomId := Homotopy.ofEq (by + ext + simp [dsimp% ChainComplex.fromSingle₀Equiv_symm_apply_f_zero + (C:=AlternatingFaceMapComplex.obj X.left)]) + homotopyHomInvId := + { hom i := Pi.single (i+1) (-ed.s i) + zero i j hij := Pi.single_eq_of_ne (Ne.symm hij) _ + comm i := by + cases i with + | zero => + rw [Homotopy.prevD_chainComplex,Homotopy.dNext_zero_chainComplex] + simp [dsimp% ChainComplex.fromSingle₀Equiv_symm_apply_f_zero + (C:=AlternatingFaceMapComplex.obj X.left),Data.s_comp_δ₀,Data.s₀_comp_δ₁] + | succ i => + rw [Homotopy.prevD_chainComplex,Homotopy.dNext_succ_chainComplex] + simp [Fin.sum_univ_succ (n:=i+2),Data.s_comp_δ₀,Preadditive.sum_comp, + Preadditive.comp_sum,Data.s_comp_δ,pow_succ] } +end SemiExtra +namespace CoefficientNerve + +variable {R:Type} [CommRing R] {C:Type} [Category.{0} C] +variable (F:C ⥤ ModuleCat.{0} R) +lemma weighted_eq {n:ℕ} {s t:Simplex C n} (h:s=t) {x:C} + (f:x ⟶ s.right.unop) (g:x ⟶ t.right.unop) + (w:f ≫ eqToHom (congrArg (fun s:Simplex C n => s.right.unop) h)=g) : + F.map f ≫ single F s=F.map g ≫ single F t := by + subst t + simpa only [eqToHom_refl,Category.comp_id] using congrArg (fun v=>F.map v ≫ single F s) w +variable {d:C} (hd:IsTerminal d) +noncomputable def augmentation : simplicial F ⟶ (SimplicialObject.const _).obj (F.obj d) where + app n := desc F (fun s=>F.map (hd.from s.right.unop)) + naturality n m f := by + apply hom_ext; intro s + change single F s ≫ map F f.unop ≫ desc F _ = single F s ≫ desc F _ ≫ 𝟙 _ + rw [single_map_assoc,single_desc,Category.comp_id,single_desc,←F.map_comp] + congr 1 + exact hd.hom_ext _ _ +noncomputable def augmented : Augmented (ModuleCat.{0} R) := + { left := simplicial F, right := F.obj d, hom := augmentation F hd } +noncomputable def extra (n:ℕ) : Obj F n ⟶ Obj F (n+1) := + desc F (fun s=>single F (NervePrefix.extra hd.op s)) +@[reassoc (attr:=simp)] lemma single_extra {n:ℕ} (s:Simplex C n) : + single F s ≫ extra F hd n=single F (NervePrefix.extra hd.op s) := single_desc _ _ _ +lemma extra_zero (n:ℕ) : extra F hd n ≫ (simplicial F).δ 0=𝟙 _ := by + apply hom_ext; intro s + change single F s ≫ extra F hd n ≫ map F (SimplexCategory.δ 0)=single F s ≫ 𝟙 _ + erw [single_extra_assoc,single_map,Category.comp_id] + change F.map ((s.map (𝟙 _)).unop) ≫ single F s=single F s + simp +lemma extra_tail_map {n:ℕ} (s:Simplex C n) (i j:Fin (n+1)) (hij:i≤j) + (k:Fin (n+2)) (hk:k=i.succ) (hkj:k≤j.succ) + (he:((NervePrefix.extra hd.op s).obj k).unop=(s.obj i).unop) : + ((NervePrefix.extra hd.op s).map (homOfLE hkj)).unop ≫ eqToHom he = + (s.map (homOfLE hij)).unop := by + subst k + change (s.map (homOfLE hij)).unop ≫ eqToHom _ = (s.map (homOfLE hij)).unop + simp +lemma extra_succ (n:ℕ) (i:Fin (n+2)) : + extra F hd (n+1) ≫ (simplicial F).δ i.succ=(simplicial F).δ i ≫ extra F hd n := by + apply hom_ext; intro s + change single F s ≫ extra F hd (n+1) ≫ map F (SimplexCategory.δ i.succ) = + single F s ≫ map F (SimplexCategory.δ i) ≫ extra F hd n + erw [single_extra_assoc,single_map,single_map_assoc,single_extra] + apply weighted_eq F (NervePrefix.precomp_delta hd.op s i) + change ((NervePrefix.extra hd.op s).map (homOfLE + (show i.succ.succAbove (Fin.last n).succ ≤ (Fin.last (n+1)).succ from Fin.le_last _))).unop ≫ eqToHom _ = + (s.map (homOfLE (Fin.le_last (i.succAbove (Fin.last n))))).unop + exact extra_tail_map hd s (i.succAbove (Fin.last n)) (Fin.last (n+1)) _ _ + (Fin.succ_succAbove_succ i (Fin.last n)) _ _ +noncomputable def contraction : SemiExtra.Data (augmented F hd) where + s' := single F (ComposableArrows.mk₀ (op d)) + s := extra F hd + s'_comp_ε := by + change single F _ ≫ desc F _=𝟙 _ + erw [single_desc] + change F.map (hd.from d)=𝟙 (F.obj d) + rw [show hd.from d=𝟙 d from hd.hom_ext _ _,F.map_id] + s₀_comp_δ₁ := by + apply hom_ext; intro s + change single F s ≫ extra F hd 0 ≫ map F (SimplexCategory.δ 1) = + single F s ≫ desc F _ ≫ single F (ComposableArrows.mk₀ (op d)) + erw [single_extra_assoc,single_map,single_desc_assoc] + have hs : trunc (SimplexCategory.δ 1) (NervePrefix.extra hd.op s) = ComposableArrows.mk₀ (op d) := ComposableArrows.ext₀ rfl + apply weighted_eq F hs + exact hd.hom_ext _ _ + s_comp_δ₀ := extra_zero F hd + s_comp_δ := extra_succ F hd +noncomputable def terminalHomotopyEquiv : HomotopyEquiv (complex F) + ((ChainComplex.single₀ (ModuleCat R)).obj (F.obj d)) := + SemiExtra.homotopyEquiv (contraction F hd) +end CoefficientNerve + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/CoefficientUCT.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/CoefficientUCT.lean new file mode 100644 index 0000000000000000000000000000000000000000..4246f7e3d204c45d67ecb657f0b37414c785866d --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/CoefficientUCT.lean @@ -0,0 +1,158 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.AlternatingH2 +import OAI.GroupTheory.SimpleAmenable.Homology.TotalFiniteness +import OAI.GroupTheory.SimpleAmenable.Homology.FreeChains + +namespace OAI + +section + +section + +open CategoryTheory Limits MonoidalCategory HomologicalComplex +namespace TensorCoefficient + +variable {R : Type} [CommRing R] [IsDomain R] [IsPrincipalIdealRing R] + +lemma presentation (A : ModuleCat.{0} R) [Module.Finite R A] : + ∃ S : ShortComplex (ModuleCat.{0} R), S.X₃=A ∧ S.ShortExact ∧ + Module.Finite R S.X₁ ∧ Module.Free R S.X₁ ∧ Module.Finite R S.X₂ ∧ Module.Free R S.X₂ := by + obtain ⟨n,φ,hφ⟩ := Module.Finite.exists_fin' R A + let B : ModuleCat R := ModuleCat.of R (Fin n → R) + let C : ModuleCat R := ModuleCat.of R φ.ker + let i : C ⟶ B := ModuleCat.ofHom φ.ker.subtype + let p : B ⟶ A := ModuleCat.ofHom φ + have hi : Mono i := (ModuleCat.mono_iff_injective _).mpr Subtype.val_injective + have hp : Epi p := (ModuleCat.epi_iff_surjective _).mpr hφ + have hz : i≫p=0 := by + apply ModuleCat.hom_ext + apply LinearMap.ext + intro x + exact x.property + let S : ShortComplex (ModuleCat R) := ShortComplex.mk i p hz + have he : S.ShortExact := { + mono_f := hi + epi_g := hp + exact := (S.moduleCat_exact_iff).mpr (by + intro x hx + exact ⟨⟨x,hx⟩,rfl⟩) } + have : Module.Finite R C := Module.Finite.of_injective φ.ker.subtype Subtype.val_injective + have : Module.Free R C := Module.free_of_finite_type_torsion_free' + exact ⟨S,rfl,he,inferInstance,inferInstance,inferInstance,inferInstance⟩ + +variable (K : ChainComplex (ModuleCat.{0} R) ℕ) [∀n,Module.Flat R (K.X n)] + +lemma finite_coefficient_succ (A : ModuleCat.{0} R) [Module.Finite R A] (n : ℕ) + [Module.Finite R (K.homology n)] [Module.Finite R (K.homology (n+1))] : + Module.Finite R ((homologyFunctor K (n+1)).obj A) := by + obtain ⟨S,hA,hS,h1,hf1,h2,hf2⟩ := presentation A + have := h1; have := hf1; have := h2; have := hf2 + rw [←hA] + have : Module.Finite R ((S.map (functor K)).X₁.homology n) := free_finite K S.X₁ n + have : Module.Finite R ((S.map (functor K)).X₂.homology (n+1)) := free_finite K S.X₂ (n+1) + exact FiniteHomologyReturn.finite_of_exact + ((shortExact K hS).homology_exact₃ (n+1) n rfl) + +lemma finite_coefficient_zero (A : ModuleCat.{0} R) [Module.Finite R A] + [Module.Finite R (K.homology 0)] : Module.Finite R ((homologyFunctor K 0).obj A) := by + obtain ⟨S,hA,hS,h1,hf1,h2,hf2⟩ := presentation A + have := h1; have := hf1; have := h2; have := hf2 + rw [←hA] + have : Module.Finite R ((S.map (functor K)).X₂.homology 0) := free_finite K S.X₂ 0 + have hs := shortExact K hS + have := hs.epi_g + have : Epi (homologyMap (S.map (functor K)).g 0) := + epi_homologyMap_of_epi_of_not_rel _ 0 (by intro _; simp [ComplexShape.down_Rel]) + exact Module.Finite.of_surjective (homologyMap (S.map (functor K)).g 0).hom + ((ModuleCat.epi_iff_surjective _).mp inferInstance) + +lemma zero_coefficient_succ (A : ModuleCat.{0} R) [Module.Finite R A] (n : ℕ) + (h0 : IsZero (K.homology n)) (h1 : IsZero (K.homology (n+1))) : + IsZero ((homologyFunctor K (n+1)).obj A) := by + obtain ⟨S,hA,hS,hf1,hfr1,hf2,hfr2⟩ := presentation A + have := hf1; have := hfr1; have := hf2; have := hfr2 + rw [←hA] + exact ((shortExact K hS).homology_exact₃ (n+1) n rfl).isZero_X₂ + ((free_isZero K S.X₂ (n+1) h1).eq_of_src _ _) + ((free_isZero K S.X₁ n h0).eq_of_tgt _ _) + +lemma zero_coefficient_zero (A : ModuleCat.{0} R) [Module.Finite R A] + (h : IsZero (K.homology 0)) : IsZero ((homologyFunctor K 0).obj A) := by + obtain ⟨S,hA,hS,h1,hf1,h2,hf2⟩ := presentation A + have := h1; have := hf1; have := h2; have := hf2 + rw [←hA] + have hs := shortExact K hS + have := hs.epi_g + have homology_epi : Epi (homologyMap (S.map (functor K)).g 0) := + epi_homologyMap_of_epi_of_not_rel _ 0 (by intro _; simp [ComplexShape.down_Rel]) + exact @IsZero.of_epi _ _ _ _ _ (homologyMap (S.map (functor K)).g 0) + homology_epi (free_isZero K S.X₂ 0 h) + +end TensorCoefficient + +end + +section + +open CategoryTheory Limits MonoidalCategory HomologicalComplex HomologicalComplex₂ +namespace TensorProductHomology + +variable {R : Type} [CommRing R] +abbrev c := ComplexShape.down ℕ +variable (K L : ChainComplex (ModuleCat.{0} R) ℕ) +noncomputable def bicomplex : HomologicalComplex₂ (ModuleCat.{0} R) c c := + (((curriedTensor (ModuleCat.{0} R)).mapBifunctorHomologicalComplex c c).obj K).obj L + +noncomputable def rowIso [∀n,Module.Flat R (K.X n)] (q : ℕ) : + TotalFiniteness.row (bicomplex K L) q ≅ (TensorCoefficient.functor K).obj (L.homology q) := by + refine HomologicalComplex.Hom.isoOfComponents + (fun p => (L.sc q).mapHomologyIso (tensorLeft (K.X p))) ?_ + intro p p' _ + symm + change ShortComplex.homologyMap ((L.sc q).mapNatTrans + ((tensoringLeft (ModuleCat R)).map (K.d p p'))) ≫ _ = _ + apply (Iso.eq_comp_inv ((L.sc q).mapHomologyIso (tensorLeft (K.X p')))).mp + exact (ShortComplex.homologyMap_mapNatTrans (L.sc q) + ((tensoringLeft (ModuleCat R)).map (K.d p p'))).trans (Category.assoc _ _ _).symm + +lemma finite [IsDomain R] [IsPrincipalIdealRing R] [∀n,Module.Flat R (K.X n)] + (n : ℕ) (hK : ∀i,i≤n → Module.Finite R (K.homology i)) + (hL : ∀i,i≤n → Module.Finite R (L.homology i)) : + Module.Finite R (((bicomplex K L).total c).homology n) := by + apply TotalFiniteness.finite + intro p q hpq + have := hL q (by omega) + have := hK p (by omega) + have : Module.Finite R ((homologyFunctor (ModuleCat R) c p).obj ((TensorCoefficient.functor K).obj (L.homology q))) := by + cases p with + | zero => exact TensorCoefficient.finite_coefficient_zero K _ + | succ p => + have := hK p (by omega) + exact TensorCoefficient.finite_coefficient_succ K _ p + exact Module.Finite.equiv ((homologyFunctor _ c p).mapIso (rowIso K L q)).symm.toLinearEquiv + +lemma isZero [IsDomain R] [IsPrincipalIdealRing R] [∀n,Module.Flat R (K.X n)] + (a b n : ℕ) (hn : n exact TensorCoefficient.zero_coefficient_zero K _ (hK 0 (by omega)) + | succ p => exact TensorCoefficient.zero_coefficient_succ K _ p (hK p (by omega)) (hK (p+1) (by omega)) + +end TensorProductHomology + +end + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/ComponentStable.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/ComponentStable.lean new file mode 100644 index 0000000000000000000000000000000000000000..5ce678ae8653be4c95a15c51773d72bf808e6e99 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/ComponentStable.lean @@ -0,0 +1,62 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.ExactShapeHomology + +namespace OAI + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits MonoidalCategory Simplicial Opposite +namespace ComponentStable +open FreeChains ComponentTranslation + +variable {C:Type} [Groupoid.{0} C] [MonoidalCategory C] [SymmetricCategory C] +noncomputable abbrev H (q:ℕ) := SSet.homologyFunctor Z q +noncomputable abbrev object (q:ℕ) := colimit (homologyDiagram (C:=C) q) +noncomputable def inclusion (p:Skeleton C) (q:ℕ) : + (nerve (Fiber p)).homology Z q ⟶ (nerve C).homology Z q := + SSet.homologyMap (nerveMap (property p).ι) Z q +noncomputable def unionCocone (q:ℕ) : + Cocone (ComponentCoproduct.diagram C ⋙ H q) where + pt := object (C:=C) q + ι := Discrete.natTrans (fun p=>colimit.ι (homologyDiagram (C:=C) q) ((ActionCategory.objEquiv _ _) p.as)) +noncomputable def toStable (q:ℕ) : (nerve C).homology Z q ⟶ object (C:=C) q := + (ComponentCoproduct.homologyIsColimit C q).desc (unionCocone q) +omit [SymmetricCategory C] in +@[reassoc (attr:=simp)] lemma inclusion_toStable (p:Skeleton C) (q:ℕ) : + inclusion p q ≫ toStable q=colimit.ι (homologyDiagram q) ((ActionCategory.objEquiv _ _) p) := + (ComponentCoproduct.homologyIsColimit C q).fac (unionCocone q) ⟨p⟩ +instance epi_toStable (q:ℕ) : Epi (toStable (C:=C) q) where + left_cancellation f g h := by + apply colimit.hom_ext + intro stage + obtain ⟨component,rfl⟩ := (ActionCategory.objEquiv (Skeleton C) (Skeleton C)).surjective stage + have hp:=congrArg (fun k=>inclusion component q ≫ k) h + simp only [←Category.assoc,inclusion_toStable] at hp + change colimit.ι (homologyDiagram (C:=C) q) ((ActionCategory.objEquiv _ _) component) ≫ f = + colimit.ι (homologyDiagram (C:=C) q) ((ActionCategory.objEquiv _ _) component) ≫ g + exact hp +omit [SymmetricCategory C] in +lemma translate_toStable (r p s:Skeleton C) (h:r*p=s) (q:ℕ) : + SSet.homologyMap (nerveMap (translate r p s h)) Z q ≫ inclusion s q ≫ toStable q = + inclusion p q ≫ toStable q := by + rw [inclusion_toStable,inclusion_toStable] + exact colimit.w (homologyDiagram q) (show (ActionCategory.objEquiv _ _) p ⟶ + (ActionCategory.objEquiv _ _) s from ⟨r,h⟩) +variable {D E:Type} [Category.{0} D] [Category.{0} E] +omit [MonoidalCategory C] [SymmetricCategory C] in +lemma map_comp (F:C⥤D) (G:D⥤E) (q:ℕ) : + SSet.homologyMap (nerveMap (F⋙G)) Z q= + SSet.homologyMap (nerveMap F) Z q ≫ SSet.homologyMap (nerveMap G) Z q := + by + change SSet.homologyMap (nerveMap F ≫ nerveMap G) Z q=_ + rw [SSet.homologyMap_comp] +omit [MonoidalCategory C] [SymmetricCategory C] in +lemma map_const (U:D) (q:ℕ) (hq:q≠0) : SSet.homologyMap (nerveMap ((Functor.const C).obj U)) Z q=0 := by + have h : nerveMap ((Functor.const C).obj U)=SSet.const (nerveEquiv.symm U) := by + ext n x; rfl + rw [h] + exact ConnectedProduct.const_homology_zero _ q hq +end ComponentStable + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/ConcreteHomology.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/ConcreteHomology.lean new file mode 100644 index 0000000000000000000000000000000000000000..d2c5b872aac1b5a78e9bfc6e51c477a5927819f3 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/ConcreteHomology.lean @@ -0,0 +1,176 @@ +import Mathlib + +namespace OAI + +section + +section + +open CategoryTheory Limits HomologicalComplex +namespace ConcreteHomology + +universe u +variable {R : Type u} [CommRing R] +abbrev c := ComplexShape.down ℕ +abbrev CC := ChainComplex (ModuleCat.{u} R) ℕ +variable (K L : CC (R:=R)) (n : ℕ) +def S := K.sc' (n+1) n (n-1) +abbrev Cycles := LinearMap.ker ((K.d n (n-1)).hom) +abbrev boundary := (S K n).moduleCatToCycles +abbrev H := Cycles K n ⧸ LinearMap.range (boundary K n) +def π : Cycles K n →ₗ[R] H K n := (LinearMap.range (boundary K n)).mkQ + +@[simp] lemma π_eq_zero (x : Cycles K n) : π K n x=0 ↔ ∃ y, boundary K n y=x := + Submodule.Quotient.mk_eq_zero _ + +lemma π_surjective : Function.Surjective (π K n) := + Submodule.mkQ_surjective (LinearMap.range (boundary K n)) + +noncomputable def sFunctor : ShortComplex (ModuleCat.{u} R) ⥤ ModuleCat.{u} R where + obj T := T.moduleCatLeftHomologyData.H + map f := ShortComplex.leftHomologyMap' f _ _ + map_id _ := ShortComplex.leftHomologyMap'_id _ + map_comp _ _ := ShortComplex.leftHomologyMap'_comp _ _ _ _ _ + +instance : (sFunctor (R:=R)).Additive where + map_add {X Y} f g := by + exact ShortComplex.leftHomologyMap'_add X.moduleCatLeftHomologyData Y.moduleCatLeftHomologyData + +noncomputable def sIso : ShortComplex.homologyFunctor (ModuleCat.{u} R) ≅ sFunctor (R:=R) := + NatIso.ofComponents (fun T => T.moduleCatHomologyIso) (fun f => + (ShortComplex.LeftHomologyData.leftHomologyIso_hom_naturality f _ _).symm) + +noncomputable def functor (n : ℕ) : CC (R:=R) ⥤ ModuleCat.{u} R := + shortComplexFunctor' _ c (n+1) n (n-1) ⋙ sFunctor + +instance : (functor (R:=R) n).Additive where + map_add {X Y} f g := by + change ShortComplex.leftHomologyMap' ((shortComplexFunctor' (ModuleCat.{u} R) c (n+1) n (n-1)).map (f+g)) (S X n).moduleCatLeftHomologyData (S Y n).moduleCatLeftHomologyData = _ + have h : (shortComplexFunctor' (ModuleCat.{u} R) c (n+1) n (n-1)).map (f+g) = + (shortComplexFunctor' (ModuleCat.{u} R) c (n+1) n (n-1)).map f + + (shortComplexFunctor' (ModuleCat.{u} R) c (n+1) n (n-1)).map g := by + ext <;> rfl + rw [h] + exact ShortComplex.leftHomologyMap'_add (S X n).moduleCatLeftHomologyData + (S Y n).moduleCatLeftHomologyData + +lemma prev (n : ℕ) : c.prev n=n+1 := c.prev_eq' rfl +lemma next (n : ℕ) : c.next n=n-1 := by + cases n with + | zero => exact c.next_eq_self' 0 (by intro k; change ¬k+1=0; omega) + | succ n => exact c.next_eq' rfl + +noncomputable def naturalIso (n : ℕ) : homologyFunctor (ModuleCat.{u} R) c n ≅ functor n := + homologyFunctorIso' _ c (n+1) n (n-1) (prev n) (next n) ≪≫ + Functor.isoWhiskerLeft _ sIso + +noncomputable def iso : K.homology n ≅ ModuleCat.of R (H K n) := (naturalIso n).app K + +variable {K L} +noncomputable def cyclesMap (f : K ⟶ L) (n : ℕ) : Cycles K n →ₗ[R] Cycles L n := + (ShortComplex.cyclesMap' ((shortComplexFunctor' _ c (n+1) n (n-1)).map f) + (S K n).moduleCatLeftHomologyData (S L n).moduleCatLeftHomologyData).hom + +@[simp] lemma cyclesMap_val (f : K ⟶ L) (n : ℕ) (x : Cycles K n) : + (cyclesMap f n x).val=(f.f n).hom x := by + have h := ShortComplex.cyclesMap'_i ((shortComplexFunctor' _ c (n+1) n (n-1)).map f) + (S K n).moduleCatLeftHomologyData (S L n).moduleCatLeftHomologyData + exact congrArg (fun g : ModuleCat.of R (Cycles K n) ⟶ L.X n => g.hom x) h + +@[simp] lemma map_π (f : K ⟶ L) (n : ℕ) (x : Cycles K n) : + ((functor n).map f).hom (π K n x)=π L n (cyclesMap f n x) := by + have h := ShortComplex.leftHomologyπ_naturality' ((shortComplexFunctor' _ c (n+1) n (n-1)).map f) + (S K n).moduleCatLeftHomologyData (S L n).moduleCatLeftHomologyData + exact congrArg (fun g : ModuleCat.of R (Cycles K n) ⟶ ModuleCat.of R (H L n) => g.hom x) h + +end ConcreteHomology + +end + +section +open CategoryTheory Limits HomologicalComplex +namespace ConeCoordinates + +universe u +variable {R : Type u} [CommRing R] +open ConcreteHomology +variable {F G : CC (R:=R)} (φ : F ⟶ G) +noncomputable abbrev C := homotopyCofiber φ +noncomputable abbrev left (n : ℕ) : F.X n ⟶ (C φ).X (n+1) := homotopyCofiber.inlX φ n (n+1) rfl +noncomputable abbrev right (n : ℕ) : G.X n ⟶ (C φ).X n := homotopyCofiber.inrX φ n +noncomputable abbrev fst (n : ℕ) : (C φ).X (n+1) ⟶ F.X n := homotopyCofiber.fstX φ (n+1) n rfl +noncomputable abbrev snd (n : ℕ) : (C φ).X n ⟶ G.X n := homotopyCofiber.sndX φ n +lemma zero_next : ¬ c.Rel 0 (c.next 0) := by change ¬ c.next 0+1=0; omega +@[simp] lemma fst_left (n : ℕ) (x : F.X n) : fst φ n (left φ n x)=x := by + exact congrArg (fun f : F.X n ⟶ F.X n => f x) (homotopyCofiber.inlX_fstX φ n (n+1) rfl) +@[simp] lemma snd_right (n : ℕ) (x : G.X n) : snd φ n (right φ n x)=x := by + exact congrArg (fun f : G.X n ⟶ G.X n => f x) (homotopyCofiber.inrX_sndX φ n) +@[simp] lemma fst_right (n : ℕ) (x : G.X (n+1)) : fst φ n (right φ (n+1) x)=0 := by + exact congrArg (fun f : G.X (n+1) ⟶ F.X n => f x) (homotopyCofiber.inrX_fstX φ (n+1) n rfl) +@[simp] lemma snd_left (n : ℕ) (x : F.X n) : snd φ (n+1) (left φ n x)=0 := by + exact congrArg (fun f : F.X n ⟶ G.X (n+1) => f x) (homotopyCofiber.inlX_sndX φ n (n+1) rfl) +lemma ext {n : ℕ} {x y : (C φ).X (n+1)} (hfst : fst φ n x=fst φ n y) + (hsnd : snd φ (n+1) x=snd φ (n+1) y) : x=y := by + have hrel : c.Rel (n+1) n := rfl + apply (homotopyCofiber.XIsoBiprod φ (n+1) n hrel).toLinearEquiv.injective + apply (ModuleCat.biprodIsoProd (F.X n) (G.X (n+1))).toLinearEquiv.injective + apply Prod.ext + · exact hfst + · change (biprod.snd : F.X n ⊞ G.X (n+1) ⟶ G.X (n+1)) ((homotopyCofiber.XIsoBiprod φ (n+1) n hrel).hom x) = + (biprod.snd : F.X n ⊞ G.X (n+1) ⟶ G.X (n+1)) ((homotopyCofiber.XIsoBiprod φ (n+1) n hrel).hom y) + have he : (homotopyCofiber.XIsoBiprod φ (n+1) n hrel).hom ≫ biprod.snd = snd φ (n+1) := by + apply homotopyCofiber.ext_from_X φ n (n+1) hrel + · simp only [homotopyCofiber.inlX_XIsoBiprod_hom_assoc,biprod.inl_snd, + homotopyCofiber.inlX_sndX] + · simp only [homotopyCofiber.inrX_XIsoBiprod_hom_assoc,biprod.inr_snd, + homotopyCofiber.inrX_sndX] + change ((homotopyCofiber.XIsoBiprod φ (n+1) n hrel).hom ≫ biprod.snd) x = + ((homotopyCofiber.XIsoBiprod φ (n+1) n hrel).hom ≫ biprod.snd) y + rw [he]; exact hsnd +lemma ext_zero {x y : (C φ).X 0} (h : snd φ 0 x=snd φ 0 y) : x=y := + (homotopyCofiber.XIso φ 0 zero_next).toLinearEquiv.injective h +lemma decomp (n : ℕ) (x : (C φ).X (n+1)) : + left φ n (fst φ n x)+right φ (n+1) (snd φ (n+1) x)=x := by + apply ext φ + · simp only [map_add,fst_left φ n _,fst_right φ n _,add_zero] + · simp only [map_add,snd_left φ n _,snd_right φ (n+1) _,zero_add] +lemma decomp_zero (x : (C φ).X 0) : right φ 0 (snd φ 0 x)=x := by + apply ext_zero φ; exact snd_right φ 0 _ +lemma d_snd (n : ℕ) (x : (C φ).X (n+1)) : + snd φ n ((C φ).d (n+1) n x)=φ.f n (fst φ n x)+G.d (n+1) n (snd φ (n+1) x) := by + exact congrArg (fun f : (C φ).X (n+1) ⟶ G.X n => f x) + (homotopyCofiber.d_sndX φ (n+1) n rfl) +lemma d_fst (n : ℕ) (x : (C φ).X (n+2)) : + fst φ n ((C φ).d (n+2) (n+1) x) = -F.d (n+1) n (fst φ (n+1) x) := by + exact congrArg (fun f : (C φ).X (n+2) ⟶ F.X n => f x) + (homotopyCofiber.d_fstX φ (n+2) (n+1) n rfl rfl) +lemma d_right (n m : ℕ) (x : G.X n) : + (C φ).d n m (right φ n x)=right φ m (G.d n m x) := by + exact congrArg (fun f : G.X n ⟶ (C φ).X m => f x) + (homotopyCofiber.inrX_d φ n m) +lemma d_left (n : ℕ) (x : F.X (n+1)) : + (C φ).d (n+2) (n+1) (left φ (n+1) x) = + -left φ n (F.d (n+1) n x)+right φ (n+1) (φ.f (n+1) x) := by + apply ext φ + · rw [d_fst φ n, fst_left φ (n+1)] + simp only [map_add,map_neg,fst_left φ n _,fst_right φ n _,add_zero] + · rw [d_snd φ (n+1),fst_left φ (n+1),snd_left φ (n+1)] + simp only [map_add,map_neg,map_zero,snd_left φ n _,snd_right φ (n+1) _,neg_zero,zero_add,add_zero] +lemma d_left_zero (x : F.X 0) : (C φ).d 1 0 (left φ 0 x)=right φ 0 (φ.f 0 x) := by + apply ext_zero φ + rw [d_snd φ 0,fst_left φ 0,snd_left φ 0,map_zero,add_zero,snd_right φ 0] +lemma d_left_cycle (n : ℕ) (x : Cycles F n) : + (C φ).d (n+1) n (left φ n x)=right φ n (φ.f n x) := by + cases n with + | zero => exact d_left_zero φ x + | succ n => + rw [d_left] + have hx : F.d (n+1) n x=0 := x.property + rw [hx,map_zero,neg_zero,zero_add] +end ConeCoordinates + +end + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/ConeHomology.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/ConeHomology.lean new file mode 100644 index 0000000000000000000000000000000000000000..b3c042a3873226d2286cdeead8fa516fc6e3ab16 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/ConeHomology.lean @@ -0,0 +1,278 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.ModelAssembly +import OAI.GroupTheory.SimpleAmenable.Homology.ConcreteHomology + +namespace OAI + +section + +section +open CategoryTheory Limits HomologicalComplex +namespace ConeCoordinates + +universe u +variable {R : Type u} [CommRing R] +open ConcreteHomology +variable {F G : CC (R:=R)} (φ : F ⟶ G) +lemma right_cycle (n : ℕ) (y : Cycles G n) : + (C φ).d n (n-1) (right φ n y)=0 := by + rw [d_right φ n (n-1),y.property,map_zero] +lemma fst_cycle (n : ℕ) (w : (C φ).X (n+1)) (y : G.X n) + (hw : (C φ).d (n+1) n w=right φ n y) : F.d n (n-1) (fst φ n w)=0 := by + cases n with + | zero => rw [F.shape 0 (0-1) (by decide)]; rfl + | succ n => + have h := congrArg (fst φ n) hw + rw [d_fst φ n,fst_right φ n] at h + exact neg_eq_zero.mp h +lemma surjective_of_cone_zero (n : ℕ) [Subsingleton (H (C φ) n)] : + Function.Surjective ((functor n).map φ).hom := by + intro z + obtain ⟨y,rfl⟩ := π_surjective G n z + let yc : Cycles (C φ) n := ⟨right φ n y,right_cycle φ n y⟩ + obtain ⟨w,hw⟩ := (π_eq_zero (C φ) n yc).mp (Subsingleton.elim _ _) + change (C φ).X (n+1) at w + have hw' : (C φ).d (n+1) n w=right φ n y := congrArg Subtype.val hw + let x : Cycles F n := ⟨fst φ n w,fst_cycle φ n w y hw'⟩ + refine ⟨π F n x,?_⟩ + rw [map_π] + apply (Submodule.Quotient.eq _).mpr + refine ⟨-snd φ (n+1) w,?_⟩ + apply Subtype.ext + have hs := congrArg (snd φ n) hw' + rw [d_snd φ n,snd_right φ n] at hs + change G.d (n+1) n (-snd φ (n+1) w)=φ.f n x-y + rw [map_neg] + change -(G.d (n+1) n (snd φ (n+1) w))=φ.f n (fst φ n w)-y + rw [←hs] + abel +lemma injective_of_cone_zero (n : ℕ) [Subsingleton (H (C φ) (n+1))] : + Function.Injective ((functor n).map φ).hom := by + apply (LinearMap.ker_eq_bot).mp + apply le_antisymm _ bot_le + intro z hz + obtain ⟨x,rfl⟩ := π_surjective F n z + have hz' : π G n (cyclesMap φ n x)=0 := by + rw [←map_π]; exact hz + obtain ⟨y,hy⟩ := (π_eq_zero G n _).mp hz' + change G.X (n+1) at y + have hy' : G.d (n+1) n y=φ.f n x := by + have hh := congrArg Subtype.val hy + change G.d (n+1) n y=(cyclesMap φ n x).val at hh + rw [cyclesMap_val] at hh + exact hh + let w := left φ n x-right φ (n+1) y + have hw : (C φ).d (n+1) n w=0 := by + change (C φ).d (n+1) n (left φ n x-right φ (n+1) y)=0 + rw [map_sub,d_left_cycle φ n x,d_right φ (n+1) n,hy',sub_self] + let wc : Cycles (C φ) (n+1) := ⟨w,hw⟩ + obtain ⟨a,ha⟩ := (π_eq_zero (C φ) (n+1) wc).mp (Subsingleton.elim _ _) + change (C φ).X (n+2) at a + have ha' : (C φ).d (n+2) (n+1) a=w := congrArg Subtype.val ha + have hf := congrArg (fst φ n) ha' + rw [d_fst φ n] at hf + change -F.d (n+1) n (fst φ (n+1) a)=fst φ n (left φ n x-right φ (n+1) y) at hf + rw [map_sub,fst_left φ n,fst_right φ n,sub_zero] at hf + apply (Submodule.mem_bot R).mpr + apply (π_eq_zero F n x).mpr + refine ⟨-fst φ (n+1) a,?_⟩ + apply Subtype.ext + change F.d (n+1) n (-fst φ (n+1) a)=x + rw [map_neg]; exact hf +lemma cone_subsingleton_of_iso [IsIso φ] (n : ℕ) : Subsingleton (H (C φ) n) := by + apply subsingleton_of_forall_eq 0 + intro z + obtain ⟨x,rfl⟩ := π_surjective (C φ) n z + apply (π_eq_zero (C φ) n x).mpr + refine ⟨left φ n ((inv φ).f n (snd φ n x)),?_⟩ + apply Subtype.ext + change (C φ).d (n+1) n (left φ n ((inv φ).f n (snd φ n x)))=x + cases n with + | zero => + rw [d_left_zero φ] + have hi : φ.f 0 ((inv φ).f 0 (snd φ 0 x))=snd φ 0 x := by + have h := congrArg (fun f : G ⟶ G => f.f 0 (snd φ 0 x)) (IsIso.inv_hom_id φ) + exact h + rw [hi]; exact decomp_zero φ x + | succ n => + rw [d_left φ] + apply ext φ + · simp only [map_add,map_neg,fst_left φ n _,fst_right φ n _,add_zero] + have hx : (C φ).d (n+1) n x=0 := x.property + have hs := congrArg (snd φ n) hx + rw [d_snd φ n,map_zero] at hs + have hc := congrArg (fun f : G.X (n+1) ⟶ F.X n => f (snd φ (n+1) x)) + ((inv φ).comm (n+1) n) + have hi : (inv φ).f n (φ.f n (fst φ n x))=fst φ n x := by + exact congrArg (fun f : F ⟶ F => f.f n (fst φ n x)) (IsIso.hom_inv_id φ) + have hs' := congrArg ((inv φ).f n) hs + rw [map_add,hi,map_zero] at hs' + change -(F.d (n+1) n ((inv φ).f (n+1) (snd φ (n+1) x)))=fst φ n x + change F.d (n+1) n ((inv φ).f (n+1) (snd φ (n+1) x)) = + (inv φ).f n (G.d (n+1) n (snd φ (n+1) x)) at hc + rw [hc] + exact (eq_neg_of_add_eq_zero_left hs').symm + · simp only [map_add,map_neg,snd_left φ n _,snd_right φ (n+1) _,neg_zero,zero_add] + exact congrArg (fun f : G ⟶ G => f.f (n+1) (snd φ (n+1) x)) (IsIso.inv_hom_id φ) +end ConeCoordinates + +end + +section +open CategoryTheory Limits HomologicalComplex HomologicalComplex₂ +namespace TotalCone + +universe u +variable {R : Type u} [CommRing R] +abbrev c := ComplexShape.down ℕ +variable {K L : HomologicalComplex₂ (ModuleCat.{u} R) c c} (φ : K ⟶ L) +noncomputable abbrev B : HomologicalComplex₂ (ModuleCat.{u} R) c c := homotopyCofiber φ +noncomputable abbrev f := total.map φ c +noncomputable abbrev inr := total.map (homotopyCofiber.inr φ) c +lemma total_zero {K L : HomologicalComplex₂ (ModuleCat.{u} R) c c} : total.map (0 : K ⟶ L) c=0 := by + apply HomologicalComplex.Hom.ext + funext n + apply total.hom_ext + intro p q hpq + simp only [ιTotal_map,HomologicalComplex.zero_f,zero_comp,comp_zero] +noncomputable def h : Homotopy (f φ ≫ inr φ) 0 := by + let t := TotalHomotopy.total (homotopyCofiber.inrCompHomotopy φ (fun j => ⟨j+1,rfl⟩)) + exact { + hom := t.hom + zero := t.zero + comm n := by + simpa only [total.map_comp,total_zero] using t.comm n } +noncomputable def comparison : homotopyCofiber (f φ) ⟶ (B φ).total c := + homotopyCofiber.desc (f φ) (inr φ) (h φ) +@[reassoc] lemma right_comparison (n : ℕ) : + homotopyCofiber.inrX (f φ) n ≫ (comparison φ).f n=(inr φ).f n := + homotopyCofiber.inrX_desc_f _ _ _ _ +@[reassoc] lemma left_comparison (p q n : ℕ) (hpq : p+q=n) : + K.ιTotal c p q n hpq ≫ homotopyCofiber.inlX (f φ) n (n+1) rfl ≫ (comparison φ).f (n+1)= + (homotopyCofiber.inlX φ p (p+1) rfl).f q ≫ + (B φ).ιTotal c (p+1) q (n+1) (by dsimp;omega) := by + have hn : c.Rel (n+1) n := rfl + have hp : c.Rel (p+1) p := rfl + change K.ιTotal c p q n hpq ≫ homotopyCofiber.inlX (f φ) n (n+1) hn ≫ + (comparison φ).f (n+1) = (homotopyCofiber.inlX φ p (p+1) hp).f q ≫ + (B φ).ιTotal c (p+1) q (n+1) _ + dsimp only [comparison] + rw [homotopyCofiber.inlX_desc_f] + change K.ιTotal c p q n hpq ≫ + TotalHomotopy.hom (homotopyCofiber.inrCompHomotopy φ (fun j => ⟨j+1,rfl⟩)) n (n+1)=_ + rw [TotalHomotopy.hom_diag,TotalHomotopy.ι_step,homotopyCofiber.inrCompHomotopy_hom] + +noncomputable def inverseFZero : ((B φ).total c).X 0 ⟶ (homotopyCofiber (f φ)).X 0 := + (B φ).totalDesc (fun p q hpq => (homotopyCofiber.sndX φ p).f q ≫ + L.ιTotal c p q 0 hpq ≫ homotopyCofiber.inrX (f φ) 0) +noncomputable def inverseFSucc (n : ℕ) : ((B φ).total c).X (n+1) ⟶ (homotopyCofiber (f φ)).X (n+1) := + (B φ).totalDesc (fun p q hpq => + (if hp : p=0 then 0 else + (homotopyCofiber.fstX φ p (p-1) (by change p-1+1=p;omega)).f q ≫ + K.ιTotal c (p-1) q n (by dsimp at hpq ⊢;omega) ≫ + homotopyCofiber.inlX (f φ) n (n+1) rfl) + + (homotopyCofiber.sndX φ p).f q ≫ L.ιTotal c p q (n+1) hpq ≫ + homotopyCofiber.inrX (f φ) (n+1)) +noncomputable def inverseF : ∀ n, ((B φ).total c).X n ⟶ (homotopyCofiber (f φ)).X n + | 0 => inverseFZero φ + | n+1 => inverseFSucc φ n +@[reassoc] lemma zero_inverse (q n : ℕ) (hq : q=n) : + (B φ).ιTotal c 0 q n (by dsimp;omega) ≫ inverseF φ n = + (homotopyCofiber.sndX φ 0).f q ≫ L.ιTotal c 0 q n (by dsimp;omega) ≫ + homotopyCofiber.inrX (f φ) n := by + cases n with + | zero => simp only [inverseF,inverseFZero,ι_totalDesc] + | succ n => + simp only [inverseF,inverseFSucc,ι_totalDesc,dite_true,zero_add] +@[reassoc] lemma succ_inverse (p q n : ℕ) (hpq : p+q=n) : + (B φ).ιTotal c (p+1) q (n+1) (by dsimp;omega) ≫ inverseF φ (n+1)= + (homotopyCofiber.fstX φ (p+1) p rfl).f q ≫ K.ιTotal c p q n hpq ≫ + homotopyCofiber.inlX (f φ) n (n+1) rfl + + (homotopyCofiber.sndX φ (p+1)).f q ≫ L.ιTotal c (p+1) q (n+1) (by dsimp;omega) ≫ + homotopyCofiber.inrX (f φ) (n+1) := by + simp only [inverseF,inverseFSucc,ι_totalDesc,dite_eq_right (Nat.succ_ne_zero p),Nat.add_one_sub_one] +@[reassoc] lemma inr_snd (p q : ℕ) : + (homotopyCofiber.inrX φ p).f q ≫ (homotopyCofiber.sndX φ p).f q = 𝟙 _ := by + rw [←HomologicalComplex.comp_f,homotopyCofiber.inrX_sndX,HomologicalComplex.id_f] +@[reassoc] lemma inr_fst (p q : ℕ) : + (homotopyCofiber.inrX φ (p+1)).f q ≫ (homotopyCofiber.fstX φ (p+1) p rfl).f q = 0 := by + exact congrArg (fun morphism => morphism.f q) (homotopyCofiber.inrX_fstX φ (p+1) p rfl) +@[reassoc] lemma inl_snd (p q : ℕ) : + (homotopyCofiber.inlX φ p (p+1) rfl).f q ≫ (homotopyCofiber.sndX φ (p+1)).f q = 0 := by + exact congrArg (fun morphism => morphism.f q) (homotopyCofiber.inlX_sndX φ p (p+1) rfl) +@[reassoc] lemma inl_fst (p q : ℕ) : + (homotopyCofiber.inlX φ p (p+1) rfl).f q ≫ (homotopyCofiber.fstX φ (p+1) p rfl).f q = 𝟙 _ := by + exact congrArg (fun morphism => morphism.f q) (homotopyCofiber.inlX_fstX φ p (p+1) rfl) +lemma decomp (p q : ℕ) : + (homotopyCofiber.fstX φ (p+1) p rfl).f q ≫ (homotopyCofiber.inlX φ p (p+1) rfl).f q + + (homotopyCofiber.sndX φ (p+1)).f q ≫ (homotopyCofiber.inrX φ (p+1)).f q = 𝟙 _ := by + have hrel : c.Rel (p+1) p := rfl + have hh : homotopyCofiber.fstX φ (p+1) p hrel ≫ homotopyCofiber.inlX φ p (p+1) hrel + + homotopyCofiber.sndX φ (p+1) ≫ homotopyCofiber.inrX φ (p+1) = 𝟙 _ := by + apply homotopyCofiber.ext_from_X φ p (p+1) hrel <;> simp + exact congrArg (fun h => h.f q) hh +lemma decomp_zero (q : ℕ) : + (homotopyCofiber.sndX φ 0).f q ≫ (homotopyCofiber.inrX φ 0).f q = 𝟙 _ := by + rw [←HomologicalComplex.comp_f,homotopyCofiber.sndX_inrX _ _ (by simp [c]),HomologicalComplex.id_f] +@[reassoc] lemma right_inverse (n : ℕ) : + (inr φ).f n ≫ inverseF φ n = homotopyCofiber.inrX (f φ) n := by + apply total.hom_ext + intro p q hpq + rw [ιTotal_map_assoc] + change (homotopyCofiber.inrX φ p).f q ≫ (B φ).ιTotal c p q n hpq ≫ inverseF φ n = _ + cases p with + | zero => + rw [zero_inverse φ q n (by simpa using hpq),inr_snd_assoc] + | succ p => + obtain ⟨n,rfl⟩ : ∃ n',n=n'+1 := ⟨p+q,by dsimp at hpq;omega⟩ + rw [succ_inverse φ p q n (by dsimp at hpq;omega),Preadditive.comp_add, + inr_fst_assoc,zero_comp,inr_snd_assoc,zero_add] +@[reassoc] lemma left_inverse (p q n : ℕ) (hpq : p+q=n) : + (homotopyCofiber.inlX φ p (p+1) rfl).f q ≫ + (B φ).ιTotal c (p+1) q (n+1) (by dsimp;omega) ≫ inverseF φ (n+1) = + K.ιTotal c p q n hpq ≫ homotopyCofiber.inlX (f φ) n (n+1) rfl := by + rw [succ_inverse,Preadditive.comp_add,inl_fst_assoc,inl_snd_assoc,zero_comp,add_zero] +lemma comparison_inverse (n : ℕ) : (comparison φ).f n ≫ inverseF φ n=𝟙 _ := by + cases n with + | zero => + apply homotopyCofiber.ext_from_X' (f φ) 0 (by simp [c]) + rw [←Category.assoc,right_comparison,right_inverse] + simp + | succ n => + apply homotopyCofiber.ext_from_X (f φ) n (n+1) rfl + · apply total.hom_ext + intro p q hpq + rw [left_comparison_assoc φ p q n hpq,left_inverse φ p q n hpq] + simp + · rw [←Category.assoc,right_comparison,right_inverse] + simp +lemma inverse_comparison (n : ℕ) : inverseF φ n ≫ (comparison φ).f n=𝟙 _ := by + apply total.hom_ext + intro p q hpq + cases p with + | zero => + rw [zero_inverse_assoc φ q n (by simpa using hpq),right_comparison,ιTotal_map] + change (homotopyCofiber.sndX φ 0).f q ≫ (homotopyCofiber.inrX φ 0).f q ≫ _ = _ + rw [←Category.assoc,decomp_zero] + simp + | succ p => + obtain ⟨n,rfl⟩ : ∃ n',n=n'+1 := ⟨p+q,by dsimp at hpq;omega⟩ + rw [succ_inverse_assoc φ p q n (by dsimp at hpq;omega),Preadditive.add_comp] + simp only [Category.assoc] + rw [left_comparison,right_comparison,ιTotal_map] + change (homotopyCofiber.fstX φ (p+1) p rfl).f q ≫ + (homotopyCofiber.inlX φ p (p+1) rfl).f q ≫ _ + + (homotopyCofiber.sndX φ (p+1)).f q ≫ (homotopyCofiber.inrX φ (p+1)).f q ≫ _ = _ + simp only [←Category.assoc,←Preadditive.add_comp,decomp,Category.id_comp,Category.comp_id] +noncomputable def iso : homotopyCofiber (f φ) ≅ (B φ).total c := by + haveI : ∀ n,IsIso ((comparison φ).f n) := fun n => + ⟨⟨inverseF φ n,comparison_inverse φ n,inverse_comparison φ n⟩⟩ + haveI : IsIso (comparison φ) := HomologicalComplex.Hom.isIso_of_components _ + exact asIso (comparison φ) +end TotalCone + +end + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/Configuration.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/Configuration.lean new file mode 100644 index 0000000000000000000000000000000000000000..125d7e98e880e41834b88b1b28198d8b555339c7 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/Configuration.lean @@ -0,0 +1,281 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.IntegralHomologyFunctorial + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section ConfigurationSupport +open Classical Finsupp +namespace ConfigurationChains +variable {V : Type*} + +theorem linear_expansion (f : Chain V →ₗ[ℤ] Chain V) (c : Chain V) : + f c=c.sum (fun l n => n • f (single l 1)) := by + conv_lhs => rw [← Finsupp.sum_single c] + rw [map_finsuppSum] + apply Finsupp.sum_congr + intro l hl + rw [←map_smul,Finsupp.smul_single,smul_eq_mul,mul_one] + +theorem linear_support_subset (f : Chain V →ₗ[ℤ] Chain V) (c : Chain V) : + (f c).support⊆c.support.biUnion (fun l => (f (single l 1)).support) := by + rw [linear_expansion f c] + intro s hs + obtain ⟨l,hl,hs⟩ := Finset.mem_biUnion.mp (Finsupp.support_sum hs) + exact Finset.mem_biUnion.mpr ⟨l,hl,Finsupp.support_smul hs⟩ + +theorem vertices_linear_subset (f : Chain V →ₗ[ℤ] Chain V) (c : Chain V) : + vertices (f c)⊆c.support.biUnion (fun l => vertices (f (single l 1))) := by + intro v hv + obtain ⟨s,hs,hv⟩ := mem_vertices.mp hv + obtain ⟨l,hl,hs⟩ := Finset.mem_biUnion.mp (linear_support_subset f c hs) + exact Finset.mem_biUnion.mpr ⟨l,hl,mem_vertices.mpr ⟨s,hs,hv⟩⟩ + +theorem vertices_linear_card (f : Chain V →ₗ[ℤ] Chain V) (c : Chain V) + (b : ℕ) (hb : ∀l∈c.support,(vertices (f (single l 1))).card≤b) : + (vertices (f c)).card≤c.support.card*b := by + calc + _ ≤ (c.support.biUnion (fun l => vertices (f (single l 1)))).card := + Finset.card_le_card (vertices_linear_subset f c) + _ ≤ ∑l∈c.support,(vertices (f (single l 1))).card := Finset.card_biUnion_le + _ ≤ ∑l∈c.support,b := Finset.sum_le_sum hb + _ = _ := by simp + +def Admissible (R : V → V → Prop) (n : ℕ) (c : Chain V) : Prop := + ∀l∈c.support,List.Pairwise R l ∧ l.length=n + +@[simp] theorem admissible_zero (R : V → V → Prop) (n : ℕ) : + Admissible R n (0 : Chain V) := by simp [Admissible] + +theorem admissible_single {R : V → V → Prop} {n : ℕ} {l : List V} + (hl : List.Pairwise R l) (hn : l.length=n) (k : ℤ) : + Admissible R n (single l k) := by + intro s hs + have he : s=l := Finset.mem_singleton.mp (Finsupp.support_single_subset hs) + subst s + exact ⟨hl,hn⟩ + +theorem admissible_sub {R : V → V → Prop} {n : ℕ} {c d : Chain V} + (hc : Admissible R n c) (hd : Admissible R n d) : Admissible R n (c-d) := by + intro l hl + rcases Finset.mem_union.mp (Finsupp.support_sub hl) with hl|hl + · exact hc l hl + · exact hd l hl + +theorem admissible_linear {R : V → V → Prop} {n k : ℕ} {c : Chain V} + (f : Chain V →ₗ[ℤ] Chain V) (hc : Admissible R n c) + (hf : ∀l,List.Pairwise R l → l.length=n → Admissible R k (f (single l 1))) : + Admissible R k (f c) := by + intro s hs + obtain ⟨l,hl,hs⟩ := Finset.mem_biUnion.mp (linear_support_subset f c hs) + exact hf l (hc l hl).1 (hc l hl).2 s hs + +theorem admissible_faceSum {R : V → V → Prop} {n : ℕ} {l : List V} + (hl : List.Pairwise R l) (hn : l.length=n+1) : Admissible R n (faceSum l) := by + intro s hs + obtain ⟨hsub,hlen⟩ := faceSum_support hs + exact ⟨hl.sublist hsub,by omega⟩ + +theorem admissible_boundary {R : V → V → Prop} {n : ℕ} {c : Chain V} + (hc : Admissible R (n+1) c) : Admissible R n (boundary c) := by + apply admissible_linear boundary hc + intro l hl hn + simpa using admissible_faceSum hl hn + +theorem admissible_cone {R : V → V → Prop} {n : ℕ} {c : Chain V} + (hc : Admissible R n c) (v : V) (hv : ∀w∈vertices c,R v w) : + Admissible R (n+1) (cone v c) := by + intro l hl + obtain ⟨s,hs,rfl⟩ := Finset.mem_image.mp (cone_support_subset v c hl) + have h := hc s hs + refine ⟨List.pairwise_cons.mpr ⟨?_,h.1⟩,by simp [h.2]⟩ + intro w hw + exact hv w (mem_vertices.mpr ⟨s,hs,hw⟩) + +theorem vertices_boundary_subset (c : Chain V) : vertices (boundary c)⊆vertices c := by + intro v hv + obtain ⟨l,hl,hv⟩ := Finset.mem_biUnion.mp (vertices_linear_subset boundary c hv) + simp only [boundary_single,one_smul] at hv + obtain ⟨s,hs,hv⟩ := mem_vertices.mp hv + exact mem_vertices.mpr ⟨l,hl,(faceSum_support hs).1.subset hv⟩ + +theorem linear_eq_on_admissible {R : V → V → Prop} {n : ℕ} + (f g : Chain V →ₗ[ℤ] Chain V) + (h : ∀l,List.Pairwise R l → l.length=n → f (single l 1)=g (single l 1)) + {c : Chain V} (hc : Admissible R n c) : f c=g c := by + rw [linear_expansion f c,linear_expansion g c] + apply Finsupp.sum_congr + intro l hl + rw [h l (hc l hl).1 (hc l hl).2] + +end ConfigurationChains +end ConfigurationSupport + +section BoundedConfigurationContraction +open Classical Finsupp +namespace ConfigurationChains +variable {V : Type*} {R : V → V → Prop} + +structure Step (R : V → V → Prop) (n b : ℕ) where + previous : Chain V →ₗ[ℤ] Chain V + current : Chain V →ₗ[ℤ] Chain V + equation : ∀c,Admissible R n c → boundary (current c)+previous (boundary c)=c + admissible : ∀l,List.Pairwise R l → l.length=n → + Admissible R (n+1) (current (single l 1)) + bounded : ∀l,List.Pairwise R l → l.length=n → + (vertices (current (single l 1))).card≤b + +namespace Step +variable {n b : ℕ} (D : Step R n b) + +noncomputable def base (v : V) : Step R 0 1 where + previous := 0 + current := cone v + equation c hc := by + have he : boundary c=0 := by + have hz : ∀l,List.Pairwise R l → l.length=0 → boundary (single l 1)=(0 : Chain V) := by + intro l hl hn + have : l=[] := List.length_eq_zero_iff.mp hn + simp [this,faceSum] + exact linear_eq_on_admissible boundary 0 hz hc + simp [boundary_cone,he] + admissible l hl hn := by + have : l=[] := List.length_eq_zero_iff.mp hn + simp only [this,cone_single] + exact admissible_single (by simp) (by simp) _ + bounded l hl hn := by + have : l=[] := List.length_eq_zero_iff.mp hn + simp only [this,cone_single] + exact (Finset.card_le_card (vertices_single_subset [v] (1:ℤ))).trans (by simp) + +noncomputable def residual (l : List V) : Chain V := single l 1-D.current (faceSum l) + +theorem residual_admissible {l : List V} (hl : List.Pairwise R l) (hn : l.length=n+1) : + Admissible R (n+1) (D.residual l) := by + apply admissible_sub (admissible_single hl hn 1) + exact admissible_linear D.current (admissible_faceSum hl hn) D.admissible + +theorem residual_cycle {l : List V} (hl : List.Pairwise R l) (hn : l.length=n+1) : + boundary (D.residual l)=0 := by + have he := D.equation (faceSum l) (admissible_faceSum hl hn) + simp only [boundary_faceSum,map_zero,add_zero] at he + simp [residual,he] + +theorem residual_bound {l : List V} (hl : List.Pairwise R l) (hn : l.length=n+1) : + (vertices (D.residual l)).card≤(n+1)+(n+1)*b := by + have hb : (vertices (D.current (faceSum l))).card≤(n+1)*b := by + apply (vertices_linear_card D.current (faceSum l) b ?_).trans + (Nat.mul_le_mul_right b ((faceSum_support_card l).trans hn.le)) + intro s hs + have had := admissible_faceSum hl hn s hs + exact D.bounded s had.1 had.2 + calc + _ ≤ (vertices (single l 1)∪vertices (D.current (faceSum l))).card := + Finset.card_le_card (vertices_sub_subset _ _) + _ ≤ (vertices (single l 1)).card+(vertices (D.current (faceSum l))).card := Finset.card_union_le _ _ + _ ≤ l.toFinset.card+(n+1)*b := Nat.add_le_add + (Finset.card_le_card (vertices_single_subset _ _)) hb + _ ≤ (n+1)+(n+1)*b := Nat.add_le_add_right ((List.toFinset_card_le l).trans hn.le) _ + +variable (hc : ∀S : Finset V,S.card≤(n+1)+(n+1)*b → ∃v,∀w∈S,R v w) + +noncomputable def nextVertex (l : List V) (hl : List.Pairwise R l ∧ l.length=n+1) : V := + (hc (vertices (D.residual l)) (D.residual_bound hl.1 hl.2)).choose + +theorem nextVertex_rel (l : List V) (hl : List.Pairwise R l ∧ l.length=n+1) : + ∀w∈vertices (D.residual l),R (D.nextVertex hc l hl) w := + (hc _ (D.residual_bound hl.1 hl.2)).choose_spec + +noncomputable def nextGenerator (l : List V) : Chain V := + if hl : List.Pairwise R l ∧ l.length=n+1 then + cone (D.nextVertex hc l hl) (D.residual l) else 0 + +noncomputable def next : Chain V →ₗ[ℤ] Chain V := + Finsupp.linearCombination ℤ (D.nextGenerator hc) + +@[simp] theorem next_single (l : List V) : + D.next hc (single l 1)=D.nextGenerator hc l := by simp [next] + +theorem next_contraction {l : List V} (hl : List.Pairwise R l) (hn : l.length=n+1) : + boundary (D.next hc (single l 1))+D.current (boundary (single l 1))=single l 1 := by + rw [next_single,nextGenerator,dite_eq_left ⟨hl,hn⟩,boundary_cone,D.residual_cycle hl hn] + simp [residual] + +theorem next_admissible {l : List V} (hl : List.Pairwise R l) (hn : l.length=n+1) : + Admissible R (n+1+1) (D.next hc (single l 1)) := by + rw [next_single,nextGenerator,dite_eq_left ⟨hl,hn⟩] + exact admissible_cone (D.residual_admissible hl hn) _ (D.nextVertex_rel hc l ⟨hl,hn⟩) + +theorem next_bounded {l : List V} (hl : List.Pairwise R l) (hn : l.length=n+1) : + (vertices (D.next hc (single l 1))).card≤1+(n+1)+(n+1)*b := by + rw [next_single,nextGenerator,dite_eq_left ⟨hl,hn⟩] + have hi := Finset.card_le_card (vertices_cone_subset (D.nextVertex hc l ⟨hl,hn⟩) (D.residual l)) + have hj := Finset.card_insert_le (D.nextVertex hc l ⟨hl,hn⟩) (vertices (D.residual l)) + have hb := D.residual_bound hl hn + omega + +noncomputable def extend : Step R (n+1) (1+(n+1)+(n+1)*b) where + previous := D.current + current := D.next hc + equation c h := by + have he : (boundary.comp (D.next hc)+D.current.comp boundary) c=LinearMap.id c := + linear_eq_on_admissible _ _ (fun _ hl hn => D.next_contraction hc hl hn) h + exact he + admissible _ := D.next_admissible hc + bounded _ := D.next_bounded hc + +include D in + +theorem fills {c : Chain V} (hc : Admissible R n c) (hz : boundary c=0) : + ∃d,Admissible R (n+1) d ∧ boundary d=c := by + refine ⟨D.current c,admissible_linear D.current hc D.admissible,?_⟩ + have he := D.equation c hc + simpa [hz] using he + +end Step + +def bankBound : ℕ → ℕ + | 0 => 1 + | n+1 => 1+(n+1)+(n+1)*bankBound n + +theorem bankBound_mono : Monotone bankBound := by + apply monotone_nat_of_le_succ + intro n + rw [bankBound] + have hh : bankBound n≤(n+1)*bankBound n := by nlinarith + omega + +theorem exists_step (N : ℕ) + (hc : ∀S : Finset V,S.card≤bankBound N → ∃v,∀w∈S,R v w) : + ∀n≤N,Nonempty (Step R n (bankBound n)) := by + intro n hn + induction n with + | zero => + obtain ⟨v,hv⟩ := hc ∅ (by simp) + exact ⟨Step.base v⟩ + | succ n ih => + obtain ⟨D⟩ := ih (by omega) + refine ⟨D.extend (fun S hS => hc S ?_)⟩ + apply hS.trans + apply le_trans (by simp only [bankBound]; omega) (bankBound_mono hn) + +theorem low_degree_filling + (hc : ∀S : Finset V,S.card≤31 → ∃v,∀w∈S,R v w) + {n : ℕ} (hn : n≤3) {c : Chain V} (had : Admissible R n c) (hz : boundary c=0) : + ∃d,Admissible R (n+1) d ∧ boundary d=c := by + obtain ⟨D⟩ := exists_step (R:=R) 3 (by simpa [bankBound] using hc) n hn + exact D.fills had hz + +end ConfigurationChains +end BoundedConfigurationContraction + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/ConfigurationEquivariance.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/ConfigurationEquivariance.lean new file mode 100644 index 0000000000000000000000000000000000000000..994236200c93fdae617c13e39d722cd1b3910123 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/ConfigurationEquivariance.lean @@ -0,0 +1,111 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.Configuration + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section ConfigurationEquivariance +open Classical Finsupp +namespace ConfigurationChains +variable {V W Z : Type*} + +noncomputable def push (f : V → W) : Chain V →ₗ[ℤ] Chain W := + Finsupp.lmapDomain ℤ ℤ (List.map f) + +@[simp] theorem push_single (f : V → W) (l : List V) (n : ℤ) : + push f (single l n)=single (l.map f) n := by simp [push] + +@[simp] theorem push_id (c : Chain V) : push id c=c := by + induction c using Finsupp.induction with + | zero => simp + | @single_add l n c hl hn ih => simp [ih] + +@[simp] theorem push_comp (g : W → Z) (f : V → W) (c : Chain V) : + push g (push f c)=push (g ∘ f) c := by + induction c using Finsupp.induction with + | zero => simp + | @single_add l n c hl hn ih => simp [ih, List.map_map] + +theorem push_cone (f : V → W) (v : V) (c : Chain V) : + push f (cone v c)=cone (f v) (push f c) := by + induction c using Finsupp.induction with + | zero => simp + | @single_add l n c hl hn ih => simp [ih] + +theorem push_faceSum (f : V → W) (l : List V) : + push f (faceSum l)=faceSum (l.map f) := by + induction l with + | nil => simp [faceSum] + | cons v l ih => simp [faceSum,push_cone,ih] + +theorem push_boundary (f : V → W) (c : Chain V) : + push f (boundary c)=boundary (push f c) := by + induction c using Finsupp.induction with + | zero => simp + | @single_add l n c hl hn ih => simp [push_faceSum,ih] + +theorem push_admissible {R : V → V → Prop} {S : W → W → Prop} + (f : V → W) (hf : ∀v w,R v w → S (f v) (f w)) {n : ℕ} {c : Chain V} + (hc : Admissible R n c) : Admissible S n (push f c) := by + intro l hl + obtain ⟨k,hk,rfl⟩ := Finset.mem_image.mp (Finsupp.mapDomain_support hl) + exact ⟨List.pairwise_map.mpr ((hc k hk).1.imp (fun h => hf _ _ h)), + by simpa only [List.length_map] using (hc k hk).2⟩ + +noncomputable def degree (R : V → V → Prop) (n : ℕ) : Submodule ℤ (Chain V) where + carrier := {c | Admissible R n c} + zero_mem' := admissible_zero R n + add_mem' := by + intro c d hc hd l hl + rcases Finset.mem_union.mp (Finsupp.support_add hl) with hl|hl + · exact hc l hl + · exact hd l hl + smul_mem' := by + intro k c hc l hl + exact hc l (Finsupp.support_smul hl) + +@[simp] theorem mem_degree {R : V → V → Prop} {n : ℕ} {c : Chain V} : + c∈degree R n ↔ Admissible R n c := Iff.rfl + +noncomputable def degreeBoundary (R : V → V → Prop) (n : ℕ) : + degree R (n+1) →ₗ[ℤ] degree R n := + boundary.restrict (fun _ h => admissible_boundary h) + +@[simp] theorem degreeBoundary_val {R : V → V → Prop} {n : ℕ} + (c : degree R (n+1)) : (degreeBoundary R n c).val=boundary c.val := rfl + +@[simp] theorem degreeBoundary_square (R : V → V → Prop) (n : ℕ) + (c : degree R (n+2)) : degreeBoundary R n (degreeBoundary R (n+1) c)=0 := by + apply Subtype.ext + exact boundary_boundary c.val + +noncomputable def degreePush {R : V → V → Prop} {S : W → W → Prop} + (f : V → W) (hf : ∀v w,R v w → S (f v) (f w)) (n : ℕ) : + degree R n →ₗ[ℤ] degree S n := + (push f).restrict (fun _ h => push_admissible f hf h) + +@[simp] theorem degreePush_val {R : V → V → Prop} {S : W → W → Prop} + (f : V → W) (hf : ∀v w,R v w → S (f v) (f w)) (n : ℕ) + (c : degree R n) : (degreePush f hf n c).val=push f c.val := rfl + +theorem degreePush_boundary {R : V → V → Prop} {S : W → W → Prop} + (f : V → W) (hf : ∀v w,R v w → S (f v) (f w)) (n : ℕ) + (c : degree R (n+1)) : + degreePush f hf n (degreeBoundary R n c)= + degreeBoundary S n (degreePush f hf (n+1) c) := by + apply Subtype.ext + exact push_boundary f c.val + +end ConfigurationChains +end ConfigurationEquivariance + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/ConfigurationResolution.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/ConfigurationResolution.lean new file mode 100644 index 0000000000000000000000000000000000000000..1e78bcc74f98ead870ba3dc56c13187a11042fae --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/ConfigurationResolution.lean @@ -0,0 +1,88 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Configurations.PolygonFixedTrackProgress +import OAI.GroupTheory.SimpleAmenable.Homology.ConfigurationEquivariance + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section ConfigurationResolution +open Classical CategoryTheory Finsupp +namespace ConfigurationChains +variable {V : Type*} {R : V → V → Prop} + +noncomputable def complex (R : V → V → Prop) : ChainComplex (ModuleCat ℤ) ℕ := + ChainComplex.of (fun n => ModuleCat.of ℤ (degree R n)) + (fun n => ModuleCat.ofHom (degreeBoundary R n)) (fun n => by + apply ModuleCat.hom_ext + apply LinearMap.ext + intro c + exact degreeBoundary_square R n c) + +noncomputable def representation {G : Type*} [Monoid G] [MulAction G V] + (hR : ∀g : G,∀v w,R v w → R (g • v) (g • w)) (n : ℕ) : + Representation ℤ G (degree R n) where + toFun g := degreePush (fun v => g • v) (hR g) n + map_one' := by + apply LinearMap.ext + intro c + apply Subtype.ext + change push (fun v : V => (1:G) • v) c.val=c.val + have he : (fun v : V => (1:G) • v)=id := funext (fun v => one_smul G v) + rw [he] + exact push_id c.val + map_mul' g h := by + apply LinearMap.ext + intro c + apply Subtype.ext + change push (fun v : V => (g*h) • v) c.val=push (fun v => g • v) (push (fun v => h • v) c.val) + rw [push_comp] + simp only [Function.comp_def, mul_smul] + +@[simp] theorem representation_boundary {G : Type*} [Monoid G] [MulAction G V] + (hR : ∀g : G,∀v w,R v w → R (g • v) (g • w)) (g : G) (n : ℕ) + (c : degree R (n+1)) : + representation hR n g (degreeBoundary R n c)= + degreeBoundary R n (representation hR (n+1) g c) := + degreePush_boundary _ (hR g) n c + +noncomputable def simplexModuleEquiv (R : V → V → Prop) (n : ℕ) : + degree R n ≃ₗ[ℤ] ({l : List V // l.Pairwise R ∧ l.length=n} →₀ ℤ) := by + have he : degree R n=Finsupp.supported ℤ ℤ {l : List V | l.Pairwise R ∧ l.length=n} := by + ext c + rw [Finsupp.mem_supported] + rfl + exact (LinearEquiv.ofEq _ _ he).trans (Finsupp.supportedEquivFinsupp _) + +theorem lowDegree_exact + (hc : ∀S : Finset V,S.card≤31 → ∃v,∀w∈S,R v w) + {n : ℕ} (hn : n≤2) : + Function.Exact (degreeBoundary R (n+1)) (degreeBoundary R n) := by + intro c + constructor + · intro hz + have hz' : boundary c.val=0 := congrArg Subtype.val hz + obtain ⟨d,hd,he⟩ := low_degree_filling hc (by omega : n+1≤3) c.property hz' + exact ⟨⟨d,hd⟩,Subtype.ext he⟩ + · rintro ⟨d,rfl⟩ + exact degreeBoundary_square R n d + +end ConfigurationChains + +namespace PolygonPlacement + +noncomputable def configurationRepresentation (a m n : ℕ) : + Representation ℤ (polygonFullGroup a m) (ConfigurationChains.degree (@Apart a m) n) := + ConfigurationChains.representation (fun g v w h => (apart_smul_iff g v w).mpr h) n +end PolygonPlacement +end ConfigurationResolution + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/ConnectedProduct.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/ConnectedProduct.lean new file mode 100644 index 0000000000000000000000000000000000000000..cbe05be9e22e3f4f58137ef5691aefa766fbe2c7 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/ConnectedProduct.lean @@ -0,0 +1,53 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.TensorSplit +import OAI.GroupTheory.SimpleAmenable.Simplicial.SimplicialAugment + +namespace OAI + +section + +section +open CategoryTheory Limits MonoidalCategory HomologicalComplex SimplicialObject Simplicial Opposite AlgebraicTopology +namespace ConnectedProduct +open FreeChains AugmentedSplit + +variable (X : SSet) [X.IsConnected] +noncomputable def point : X.obj (op ⦋0⦌) := Classical.arbitrary _ +lemma reduced_zero : IsZero ((red (SimplicialAugment.aug X)).homology 0) := by + let e := SimplicialAugment.aug X + let s := SimplicialAugment.sec X (point X) + have hs : s ≫ e=𝟙 U := SimplicialAugment.section_aug X _ + have h : homologyMap (kernel.ι e) 0 = 0 := by + apply (cancel_mono (homologyMap e 0)).mp + rw [←homologyMap_comp,kernel.condition,homologyMap_zero,Limits.zero_comp] + apply (IsZero.iff_id_eq_zero _).mpr + have hsplit := congrArg (fun f => homologyMap f 0) (splitting e s hs).f_r + change homologyMap (sc e).f 0 = 0 at h + rw [homologyMap_comp,homologyMap_id,h,Limits.zero_comp] at hsplit + exact hsplit.symm +variable (Y : SSet) [Y.IsConnected] +noncomputable def additiveIso (a b n : ℕ) (hn : 0 homologyMap f 0) (chainMap_aug _) + have compositeIso : IsIso (homologyMap (aug X) 0 ≫ homologyMap (SimplicialAugment.aug one) 0) := by + rw [he]; infer_instance + exact (isIso_comp_right_iff _ (homologyMap (SimplicialAugment.aug one) 0)).mp inferInstance +lemma red_zero (X:SSet) [X.IsConnected] (a:ℕ) + (hv : ∀ i, 0 < i → i < a → IsZero ((complex X).homology i)) : + ∀ i, i < a → IsZero (((sc X).X₁).homology i) := by + intro i hi + let s := splitting X (ConnectedProduct.point X) + have hz : homologyMap (sc X).f i=0 := by + by_cases h:i=0 + · subst i + change homologyMap (kernel.ι (aug X)) 0 = 0 + apply (cancel_mono (homologyMap (aug X) 0)).mp + rw [←homologyMap_comp,kernel.condition,homologyMap_zero,zero_comp] + · exact (hv i (by omega) hi).eq_of_tgt _ _ + apply (IsZero.iff_id_eq_zero _).mpr + have hh := congrArg (fun f => homologyMap f i) s.f_r + rw [homologyMap_comp,homologyMap_id,hz,zero_comp] at hh + exact hh.symm +instance red_flat (X:SSet) (i:ℕ) : Module.Flat ℤ (((sc X).X₁).X i) := by + have hi : Function.Injective ((kernel.ι (aug X)).f i) := + (ModuleCat.mono_iff_injective _).mp inferInstance + have reducedTorsionFree : Module.IsTorsionFree ℤ (((sc X).X₁).X i) := + hi.moduleIsTorsionFree _ (fun r x => ((kernel.ι (aug X)).f i).hom.map_smul r x) + infer_instance +end ConstantSplit + +end + +section +open CategoryTheory Limits MonoidalCategory HomologicalComplex SimplicialObject Simplicial Opposite +namespace ConnectedProduct +open FreeChains ProductChains + +variable (X Y:SSet) [X.IsConnected] [Y.IsConnected] +lemma projection_kernel_aux (a b n:ℕ) (hab:n (biprod.fst : X.homology Z n ⊞ Y.homology Z n ⟶ X.homology Z n) z) hx + simp only [map_zero] at h + change (projection X Y n ≫ biprod.fst) x=0 at h + simpa only [projection,biprod.lift_fst] using h + have hg : SSet.homologyMap (CartesianMonoidalCategory.snd X Y) Z n x=0 := by + have h := congrArg (fun z => (biprod.snd : X.homology Z n ⊞ Y.homology Z n ⟶ Y.homology Z n) z) hx + simp only [map_zero] at h + change (projection X Y n ≫ biprod.snd) x=0 at h + simpa only [projection,biprod.lift_snd] using h + let e := homologyIsoN X Y n + have h1 : homologyMap (𝟙 (complex X)⊗ₘConstantSplit.aug Y) n (e.hom x)=0 := by + have hn := homology_natural (𝟙 X) (SSet.const (X:=Y) (Y:=one) PUnit.unit) n + rw [chainMap_id] at hn + have he : (𝟙 X)⊗ₘ(SSet.const (X:=Y) (Y:=one) PUnit.unit) = + CartesianMonoidalCategory.fst X Y ≫ pairLeft X one PUnit.unit := by ext d z <;> rfl + rw [he,SSet.homologyMap_comp] at hn + have hh := congrArg (fun f => f x) hn + change (homologyIsoN X one n).hom + (SSet.homologyMap (pairLeft X one PUnit.unit) Z n + (SSet.homologyMap (CartesianMonoidalCategory.fst X Y) Z n x)) = _ at hh + simpa only [hf,map_zero,ConstantSplit.aug,ConstantSplit.one,e,ModuleCat.comp_apply] using hh.symm + have h2 : homologyMap (ConstantSplit.aug X⊗ₘ𝟙 (complex Y)) n (e.hom x)=0 := by + have hn := homology_natural (SSet.const (X:=X) (Y:=one) PUnit.unit) (𝟙 Y) n + rw [chainMap_id] at hn + have he : (SSet.const (X:=X) (Y:=one) PUnit.unit)⊗ₘ(𝟙 Y) = + CartesianMonoidalCategory.snd X Y ≫ pairRight one Y PUnit.unit := by ext d z <;> rfl + rw [he,SSet.homologyMap_comp] at hn + have hh := congrArg (fun f => f x) hn + change (homologyIsoN one Y n).hom + (SSet.homologyMap (pairRight one Y PUnit.unit) Z n + (SSet.homologyMap (CartesianMonoidalCategory.snd X Y) Z n x)) = _ at hh + simpa only [hg,map_zero,ConstantSplit.aug,ConstantSplit.one,e,ModuleCat.comp_apply] using hh.symm + have hz : IsZero ((((ConstantSplit.sc X).X₁)⊗((ConstantSplit.sc Y).X₁)).homology n) := + TensorProductHomology.arbitrary_isZero _ _ a b n hab + (ConstantSplit.red_zero X a hX) (ConstantSplit.red_zero Y b hY) + have hh := ChainTensor.homology_joint_kernel (ConstantSplit.sc X) (ConstantSplit.sc Y) + (ConstantSplit.splitting X (point X)) (ConstantSplit.splitting Y (point Y)) n hz (e.hom x) h1 h2 + exact e.toLinearEquiv.injective (hh.trans (map_zero e.toLinearEquiv).symm) + +lemma projection_isIso_arbitrary (a b n:ℕ) (hn:0 f z) (inclusion_projection X Y (point X) (point Y) n (by omega)) +end ConnectedProduct + +end + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/DoubleCoordinates.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/DoubleCoordinates.lean new file mode 100644 index 0000000000000000000000000000000000000000..a3980d6c5f581f3305c7705b109a2c5ae339adaa --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/DoubleCoordinates.lean @@ -0,0 +1,263 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.PiH1Coproduct +import OAI.GroupTheory.SimpleAmenable.Simplicial.IntervalBinary +import OAI.GroupTheory.SimpleAmenable.Homology.ComponentStable +import OAI.GroupTheory.SimpleAmenable.Homology.RegularBlock + +namespace OAI + +namespace DoubleCoordinates +variable {P:Type} {n:ℕ} +abbrev Index (P:Type) (n:ℕ) := Σhv:{hv:ℕ×ℕ // hv.1+hv.2=n},(Fin hv.val.2→P) × P × (Fin hv.val.1→P) +def toSplit (s:Index P n) : MarkedCoordinates.Split P n := + ⟨⟨s.1.val.2,by have:=s.1.property; omega⟩,s.2.1,s.2.2.1, + fun j=>s.2.2.2 ⟨j.val,by have:=s.1.property; dsimp at *; omega⟩⟩ +def ofSplit (s:MarkedCoordinates.Split P n) : Index P n := + ⟨⟨(n-s.1.val,s.1.val),by omega⟩,s.2.1,s.2.2.1,s.2.2.2⟩ +lemma payload_heq {m n v:ℕ} (e:m=n) (y:Fin v→P) (p:P) (x:Fin n→P) + (hp:∀j:Fin m,j.valx ⟨j.val,hp j⟩) (y,p,x) := by + subst n + rfl +lemma left_inv (s:Index P n) : ofSplit (toSplit s)=s := by + rcases s with ⟨⟨⟨h,v⟩,hn⟩,y,p,x⟩ + subst n + change Fin v→P at y + change Fin h→P at x + dsimp [toSplit,ofSplit] + apply Sigma.ext + · exact Subtype.ext (Prod.ext (Nat.add_sub_cancel h v) rfl) + · exact payload_heq (Nat.add_sub_cancel h v) y p x _ +lemma right_inv (s:MarkedCoordinates.Split P n) : toSplit (ofSplit s)=s := by + rcases s with ⟨i,y,p,x⟩ + rfl +noncomputable def equiv (P:Type) (n:ℕ) : Index P n ≃ MarkedCoordinates.Split P n where + toFun:=toSplit + invFun:=ofSplit + left_inv:=left_inv + right_inv:=right_inv +noncomputable def words (P:Type) (n:ℕ) : Index P n ≃ (Σ_:Fin (n+1),Fin (n+1)→P) := + (equiv P n).trans (MarkedCoordinates.equiv P n) +lemma center (s:Index P n) : (words P n s).2 (words P n s).1=s.2.2.1 := + MarkedCoordinates.word_center _ _ _ _ +end DoubleCoordinates + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits Simplicial Opposite HomologicalComplex AlgebraicTopology +namespace RegularLabels +open FreeChains + +variable {P:Type} [CommMonoid P] (F:ActionCategory P P ⥤ A) +noncomputable def totalInj {n:ℕ} (s:DoubleCoordinates.Index P n) : + fiber F s.2.2.1 ⟶ ((RegularCoefficient.double F).total c).X n := + inj F s.2 ≫ (RegularCoefficient.double F).ιTotal c s.1.val.1 s.1.val.2 n s.1.property +noncomputable def totalDesc {n:ℕ} {M:A} + (f:∀s:DoubleCoordinates.Index P n,fiber F s.2.2.1 ⟶ M) : + ((RegularCoefficient.double F).total c).X n ⟶ M := + (RegularCoefficient.double F).totalDesc (fun h v hn=>desc F (fun w=>f ⟨⟨(h,v),hn⟩,w⟩)) +@[reassoc (attr:=simp)] lemma totalInj_desc {n:ℕ} {M:A} + (f:∀s:DoubleCoordinates.Index P n,fiber F s.2.2.1 ⟶ M) (s:DoubleCoordinates.Index P n) : + totalInj F s ≫ totalDesc F f=f s := by + dsimp only [totalInj,totalDesc] + rw [Category.assoc,HomologicalComplex₂.ι_totalDesc,include_desc] +lemma total_hom_ext {n:ℕ} {M:A} {f g:((RegularCoefficient.double F).total c).X n ⟶ M} + (hh:∀s:DoubleCoordinates.Index P n,totalInj F s ≫ f=totalInj F s ≫ g) : f=g := by + apply HomologicalComplex₂.total.hom_ext + intro h v hn + apply hom_ext F + intro w + exact (Category.assoc _ _ _).symm.trans ((hh ⟨⟨(h,v),hn⟩,w⟩).trans (Category.assoc _ _ _)) +noncomputable def totalIsColimit (n:ℕ) : IsColimit (Cofan.mk _ (totalInj F (n:=n))) := + Cofan.IsColimit.mk _ (fun s=>totalDesc F s.inj) (fun _ _=>totalInj_desc F _ _) + (fun s _ hh=>total_hom_ext F (fun w=>(hh w).trans (totalInj_desc F s.inj w).symm)) +end RegularLabels + +end + +namespace MarkedH1 + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits MonoidalCategory Simplicial Opposite +open FreeChains ComponentTranslation + +variable {C:Type} [Groupoid.{0} C] [MonoidalCategory C] [SymmetricCategory C] +noncomputable def wordInclude {n:ℕ} (p:Fin n→Skeleton C) (i:Fin n) : Fiber (p i) ⥤ (Fin n→C) := by + classical + exact Functor.pi' (fun j=>if i=j then (property (p i)).ι else (Functor.const _).obj (repr (p j))) +omit [MonoidalCategory C] [SymmetricCategory C] in +lemma wordInclude_nerve {n:ℕ} (p:Fin n→Skeleton C) (i:Fin n) : + nerveMap (wordInclude p i) ≫ (PiSSet.nervePiIso (fun _:Fin n=>C)).hom = + PiSSet.incl (fun j=>nerve (Fiber (p j))) (points p) i ≫ PiFiber.inclusion C (Fin n) p := by + classical + apply NatTrans.ext; funext d + apply ConcreteCategory.hom_ext; intro s + funext j + change (s ⋙ wordInclude p i ⋙ Pi.eval _ j) = + ((PiSSet.incl (fun j=>nerve (Fiber (p j))) (points p) i ≫ PiSSet.proj _ j ≫ + nerveMap (property (p j)).ι).app d s) + dsimp only [wordInclude] + rw [Functor.pi'_eval] + by_cases h:i=j + · subst j + rw [ite_eq_left rfl, ←Category.assoc, PiSSet.incl_self] + rfl + · rw [ite_eq_right h, ←Category.assoc, PiSSet.incl_other _ _ h, SSet.const_comp] + rfl +noncomputable def wordDiagram {n:ℕ} (p:Fin n→Skeleton C) (i:Fin n) : + Fiber (p i) ⥤ IntervalBar.Diagram C (Fin (n+1)) := + wordInclude p i ⋙ (IntervalBar.Diagram.eval (C:=C) n).asEquivalence.inverse +omit [SymmetricCategory C] in +lemma primitive_eq {n:ℕ} (p:Fin n→Skeleton C) (i:Fin n) : + primitive p i=SSet.homologyMap (nerveMap (wordDiagram p i)) Z 1 := by + have:=NerveHomotopy.homologyMap_isIso ((IntervalBar.Diagram.eval (C:=C) n).asEquivalence.functor) Z 1 + apply (cancel_mono (evalIso (C:=C) n).hom).mp + dsimp only [primitive] + erw [Category.assoc, Category.assoc, Iso.inv_hom_id, Category.comp_id] + erw [←SSet.homologyMap_comp,←wordInclude_nerve] + erw [SSet.homologyMap_comp] + dsimp only [wordDiagram,evalIso,Iso.trans_hom,Functor.mapIso_hom,asIso_hom] + have h:=(NerveHomotopy.ofNatTrans + (Functor.isoWhiskerLeft (wordInclude p i) (IntervalBar.Diagram.eval (C:=C) n).asEquivalence.counitIso).hom).congr_homologyMap Z 1 + have hh : SSet.homologyMap (nerveMap (wordDiagram p i)) Z 1 ≫ + SSet.homologyMap (nerveMap (IntervalBar.Diagram.eval (C:=C) n)) Z 1 = + SSet.homologyMap (nerveMap (wordInclude p i)) Z 1 := by + rw [←SSet.homologyMap_comp] + exact h + change SSet.homologyMap (nerveMap (wordInclude p i)) Z 1 ≫ _ = + SSet.homologyMap (nerveMap (wordDiagram p i)) Z 1 ≫ + SSet.homologyMap (nerveMap (IntervalBar.Diagram.eval (C:=C) n)) Z 1 ≫ _ + rw [←Category.assoc,hh] + rfl +end + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits MonoidalCategory Simplicial Opposite +open FreeChains ComponentTranslation IntervalBar.Diagram + +variable {C:Type} [Groupoid.{0} C] [MonoidalCategory C] [SymmetricCategory C] +omit [MonoidalCategory C] [SymmetricCategory C] in +lemma wordInclude_proj {n:ℕ} (p:Fin n→Skeleton C) (i j:Fin n) : + wordInclude p i ⋙ Pi.eval (fun _:Fin n=>C) j = + if i=j then (property (p i)).ι else (Functor.const _).obj (repr (p j)) := by + classical + exact Functor.pi'_eval _ _ +noncomputable def oneIncludeIso (p:Fin 1→Skeleton C) : + wordDiagram p 0 ⋙ oneEval ≅ (property (p 0)).ι := by + classical + change (wordInclude p 0 ⋙ (eval 1).asEquivalence.inverse) ⋙ + (eval 1 ⋙ Pi.eval (fun _:Fin 1=>C) 0) ≅ _ + exact Functor.associator _ _ _ ≪≫ + Functor.isoWhiskerLeft (wordInclude p 0) + ((Functor.associator _ _ _).symm ≪≫ + Functor.isoWhiskerRight (eval 1).asEquivalence.counitIso _ ≪≫ Functor.leftUnitor _) ≪≫ + eqToIso (by rw [wordInclude_proj,ite_eq_left rfl]) +noncomputable def binaryLeft (p:Fin 2→Skeleton C) : + wordInclude p 0 ⋙ tensorPair ≅ (property (p 0)).ι ⋙ tensorRight (repr (p 1)) := by + classical + apply eqToIso + refine CategoryTheory.Functor.ext ?_ ?_ + · intro object + simp [wordInclude, tensorPair, tensorRight, Functor.pi'] + · intro source target morphism + simp [wordInclude, tensorPair, tensorRight, Functor.pi'] + change morphism.hom ▷ repr (p 1) = 𝟙 _ ≫ morphism.hom ▷ repr (p 1) + exact (Category.id_comp _).symm +noncomputable def binaryRight (p:Fin 2→Skeleton C) : + wordInclude p 1 ⋙ tensorPair ≅ (property (p 1)).ι ⋙ tensorLeft (repr (p 0)) := by + classical + apply eqToIso + refine CategoryTheory.Functor.ext ?_ ?_ + · intro object + simp [wordInclude, tensorPair, tensorLeft, Functor.pi'] + · intro source target morphism + simp [wordInclude, tensorPair, tensorLeft, Functor.pi'] + change repr (p 0) ◁ morphism.hom = 𝟙 _ ≫ repr (p 0) ◁ morphism.hom + exact (Category.id_comp _).symm +noncomputable def binaryLeftTranslate (p:Fin 2→Skeleton C) : + wordInclude p 0 ⋙ tensorPair ≅ + translate (p 1) (p 0) (p 1*p 0) rfl ⋙ (property (p 1*p 0)).ι := + binaryLeft p ≪≫ Functor.isoWhiskerLeft (property (p 0)).ι + (BraidedCategory.tensorLeftIsoTensorRight (repr (p 1))).symm +noncomputable def binaryRightTranslate (p:Fin 2→Skeleton C) : + wordInclude p 1 ⋙ tensorPair ≅ + translate (p 0) (p 1) (p 0*p 1) rfl ⋙ (property (p 0*p 1)).ι := binaryRight p +omit [SymmetricCategory C] in +@[reassoc] lemma binary_primitive_face (p:Fin 2→Skeleton C) (i:Fin 2) (k:Fin 3) : + primitive p i ≫ SSet.homologyMap (nerveMap (reindex (SimplexCategory.δ k).toOrderHom)) Z 1 ≫ + SSet.homologyMap (nerveMap oneEval) Z 1 = + SSet.homologyMap (nerveMap (wordInclude p i ⋙ binaryFace k)) Z 1 := by + rw [primitive_eq] + change SSet.homologyMap (nerveMap (wordDiagram p i)) Z 1 ≫ + SSet.homologyMap (nerveMap (reindex (SimplexCategory.δ k).toOrderHom)) Z 1 ≫ + SSet.homologyMap (nerveMap oneEval) Z 1 = + SSet.homologyMap (nerveMap (wordDiagram p i) ≫ + nerveMap (reindex (SimplexCategory.δ k).toOrderHom) ≫ nerveMap oneEval) Z 1 + simp only [SSet.homologyMap_comp] +omit [SymmetricCategory C] in +@[reassoc] lemma binary_primitive_zero (p:Fin 2→Skeleton C) : + primitive p 1 ≫ SSet.homologyMap (nerveMap (reindex (SimplexCategory.δ (0:Fin 3)).toOrderHom)) Z 1 ≫ + SSet.homologyMap (nerveMap oneEval) Z 1=ComponentStable.inclusion (p 1) 1 := by + rw [binary_primitive_face] + have h:=(NerveHomotopy.ofNatTrans (Functor.isoWhiskerLeft (wordInclude p 1) (binaryFaceZero (C:=C))).hom).congr_homologyMap Z 1 + rw [h] + rw [wordInclude_proj,ite_eq_left rfl] + rfl +omit [SymmetricCategory C] in +@[reassoc] lemma binary_primitive_last (p:Fin 2→Skeleton C) : + primitive p 0 ≫ SSet.homologyMap (nerveMap (reindex (SimplexCategory.δ (2:Fin 3)).toOrderHom)) Z 1 ≫ + SSet.homologyMap (nerveMap oneEval) Z 1=ComponentStable.inclusion (p 0) 1 := by + rw [binary_primitive_face] + have h:=(NerveHomotopy.ofNatTrans (Functor.isoWhiskerLeft (wordInclude p 0) (binaryFaceLast (C:=C))).hom).congr_homologyMap Z 1 + rw [h] + rw [wordInclude_proj,ite_eq_left rfl] + rfl +omit [SymmetricCategory C] in +@[reassoc] lemma binary_primitive_zero_other (p:Fin 2→Skeleton C) : + primitive p 0 ≫ SSet.homologyMap (nerveMap (reindex (SimplexCategory.δ (0:Fin 3)).toOrderHom)) Z 1 ≫ + SSet.homologyMap (nerveMap oneEval) Z 1=0 := by + rw [binary_primitive_face] + have h:=(NerveHomotopy.ofNatTrans (Functor.isoWhiskerLeft (wordInclude p 0) (binaryFaceZero (C:=C))).hom).congr_homologyMap Z 1 + rw [h,wordInclude_proj,ite_eq_right (by decide)] + have hc : nerveMap ((Functor.const (Fiber (p 0))).obj (repr (p 1))) = + SSet.const (nerveEquiv.symm (repr (p 1))) := by ext n x; rfl + rw [hc] + exact ConnectedProduct.const_homology_zero _ 1 (by decide) +omit [SymmetricCategory C] in +@[reassoc] lemma binary_primitive_last_other (p:Fin 2→Skeleton C) : + primitive p 1 ≫ SSet.homologyMap (nerveMap (reindex (SimplexCategory.δ (2:Fin 3)).toOrderHom)) Z 1 ≫ + SSet.homologyMap (nerveMap oneEval) Z 1=0 := by + rw [binary_primitive_face] + have h:=(NerveHomotopy.ofNatTrans (Functor.isoWhiskerLeft (wordInclude p 1) (binaryFaceLast (C:=C))).hom).congr_homologyMap Z 1 + rw [h,wordInclude_proj,ite_eq_right (by decide)] + have hc : nerveMap ((Functor.const (Fiber (p 1))).obj (repr (p 0))) = + SSet.const (nerveEquiv.symm (repr (p 0))) := by ext n x; rfl + rw [hc] + exact ConnectedProduct.const_homology_zero _ 1 (by decide) +lemma binary_primitive_middle_stable (p:Fin 2→Skeleton C) (i:Fin 2) : + primitive p i ≫ SSet.homologyMap (nerveMap (reindex (SimplexCategory.δ (1:Fin 3)).toOrderHom)) Z 1 ≫ + SSet.homologyMap (nerveMap oneEval) Z 1 ≫ ComponentStable.toStable 1 = + ComponentStable.inclusion (p i) 1 ≫ ComponentStable.toStable 1 := by + rw [binary_primitive_face_assoc] + have h:=(NerveHomotopy.ofNatTrans (Functor.isoWhiskerLeft (wordInclude p i) (binaryFaceMiddle (C:=C))).hom).congr_homologyMap Z 1 + rw [h] + fin_cases i + · change SSet.homologyMap (nerveMap (wordInclude p 0 ⋙ tensorPair)) Z 1 ≫ ComponentStable.toStable 1 = + ComponentStable.inclusion (p 0) 1 ≫ ComponentStable.toStable 1 + have ht:=(NerveHomotopy.ofNatTrans (binaryLeftTranslate p).hom).congr_homologyMap Z 1 + rw [ht] + change SSet.homologyMap (nerveMap (translate (p 1) (p 0) (p 1*p 0) rfl) ≫ + nerveMap (property (p 1*p 0)).ι) Z 1 ≫ _ = _ + rw [SSet.homologyMap_comp,Category.assoc] + exact ComponentStable.translate_toStable _ _ _ rfl 1 + · change SSet.homologyMap (nerveMap (wordInclude p 1 ⋙ tensorPair)) Z 1 ≫ ComponentStable.toStable 1 = + ComponentStable.inclusion (p 1) 1 ≫ ComponentStable.toStable 1 + have ht:=(NerveHomotopy.ofNatTrans (binaryRightTranslate p).hom).congr_homologyMap Z 1 + rw [ht] + change SSet.homologyMap (nerveMap (translate (p 0) (p 1) (p 0*p 1) rfl) ≫ + nerveMap (property (p 0*p 1)).ι) Z 1 ≫ _ = _ + rw [SSet.homologyMap_comp,Category.assoc] + exact ComponentStable.translate_toStable _ _ _ rfl 1 +end + +end MarkedH1 + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/E2Boundary.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/E2Boundary.lean new file mode 100644 index 0000000000000000000000000000000000000000..ad9e1deff0ba02a3cb656c0ccba6c5b9f121233e --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/E2Boundary.lean @@ -0,0 +1,203 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.TotalFiltration + +namespace OAI + +section + +section + +open CategoryTheory Limits HomologicalComplex HomologicalComplex₂ +namespace E2Leading + +universe u +variable {R : Type u} [CommRing R] +open TotalProjection +variable (K : HomologicalComplex₂ (ModuleCat.{u} R) c c) + +lemma entry_inclusion (p q n : ℕ) (h : p+q=n) (x : (K.X p).X q) : + projection K p q n (K.ιTotal c p q n h x)=x := + congrArg (fun f : (K.X p).X q ⟶ (K.X p).X q => f.hom x) (inclusion_projection K p q n h) + +lemma entry_inclusion_ne (i j p q n : ℕ) (h : i+j=n) (hne : (i,j)≠(p,q)) (x : (K.X i).X j) : + projection K p q n (K.ιTotal c i j n h x)=0 := + congrArg (fun f : (K.X i).X j ⟶ (K.X p).X q => f.hom x) + (inclusion_projection_of_ne K i j p q n h hne) + +lemma lower_filtration (p q : ℕ) {x : (K.total c).X (p+q)} + (hx : x∈filtration K (p+q) ((p:ℤ)+1)) (htop : projection K p q (p+q) x=0) : + x∈filtration K (p+q) p := by + intro i hi + by_cases he : i.val.1=p + · obtain ⟨⟨i,j⟩,hij⟩ := i + dsimp at he + subst i + have hj : j=q := by have := Finset.HasAntidiagonal.mem_antidiagonal.mp hij; omega + subst j + exact htop + · exact hx i (by omega) + +lemma lower_filtration' (p q n : ℕ) (hn : p+q=n) {x : (K.total c).X n} + (hx : x∈filtration K n ((p:ℤ)+1)) (htop : projection K p q n x=0) : + x∈filtration K n p := by + subst n + exact lower_filtration K p q hx htop + +lemma linear_units_smul {A B : Type*} [AddCommGroup A] [AddCommGroup B] + [Module R A] [Module R B] (f : A →ₗ[R] B) (a : ℤˣ) (x : A) : + f (a • x)=a • f x := by simp [Units.smul_def] + +noncomputable def lift (p q : ℕ) (y : (K.X (p+1)).X q) (z : (K.X p).X (q+1)) : + (K.total c).X (p+q+1) := + K.ιTotal c (p+1) q (p+q+1) (by dsimp; omega) y + + ((-1 : ℤˣ)^p) • K.ιTotal c p (q+1) (p+q+1) (by dsimp; omega) z + +lemma lift_mem (p q : ℕ) (y : (K.X (p+1)).X q) (z : (K.X p).X (q+1)) : + lift K p q y z ∈ filtration K (p+q+1) ((p:ℤ)+2) := by + apply Submodule.add_mem + · exact inclusion_mem K (by omega) y (by omega) + · change ((-1 : ℤˣ)^p) • _ ∈ _ + rw [Units.smul_def] + exact (filtration K (p+q+1) ((p:ℤ)+2)).toAddSubgroup.zsmul_mem + (inclusion_mem K (by omega) z (by omega)) _ + +@[simp] lemma lift_left (p q : ℕ) (y : (K.X (p+1)).X q) (z : (K.X p).X (q+1)) : + projection K (p+1) q (p+q+1) (lift K p q y z)=y := by + simp only [lift,map_add,Units.smul_def,map_zsmul,entry_inclusion, + entry_inclusion_ne K p (q+1) (p+1) q _ _ (by intro h; have := congrArg Prod.fst h; omega), + smul_zero,add_zero] + +@[simp] lemma lift_right (p q : ℕ) (y : (K.X (p+1)).X q) (z : (K.X p).X (q+1)) : + projection K p (q+1) (p+q+1) (lift K p q y z)=((-1 : ℤˣ)^p) • z := by + simp only [lift,map_add,Units.smul_def,map_zsmul,entry_inclusion, + entry_inclusion_ne K (p+1) q p (q+1) _ _ (by intro h; have := congrArg Prod.fst h; omega), + zero_add] + +lemma neg_pow_smul_twice {A : Type*} [AddCommGroup A] (p : ℕ) (a : A) : + ((-1 : ℤˣ)^p) • (((-1 : ℤˣ)^p) • a)=a := by + rw [smul_smul,←mul_pow] + simp + +lemma d_lift_top (p q : ℕ) (y : (K.X (p+1)).X q) (z : (K.X p).X (q+1)) : + projection K p q (p+q) ((K.total c).d (p+q+1) (p+q) (lift K p q y z))= + (K.d (p+1) p).f q y + (K.X p).d (q+1) q z := by + rw [d_entry,lift_left,lift_right] + congr 1 + change ((-1 : ℤˣ)^p) • ((K.X p).d (q+1) q).hom (((-1 : ℤˣ)^p) • z) = _ + rw [linear_units_smul,neg_pow_smul_twice] + +lemma d_lift_mem (p q : ℕ) (y : ConcreteHomology.Cycles (K.X (p+1)) q) + (z : (K.X p).X (q+1)) : + (K.total c).d (p+q+1) (p+q) (lift K p q y.val z) ∈ filtration K (p+q) ((p:ℤ)+1) := by + cases q with + | zero => + simpa only [Nat.add_zero,filtration_top] using + (show (K.total c).d (p+1) p (lift K p 0 y.val z)∈(⊤ : Submodule R _) from trivial) + | succ q => + apply lower_filtration' K (p+1) q (p+(q+1)) (by omega) + · exact d_filtration K (lift_mem K p (q+1) y.val z) + · have he := d_entry' K (p+1) q (p+(q+1)+1) (p+(q+1)) (by omega) (by omega) (lift K p (q+1) y.val z) + have hz : projection K (p+1+1) q (p+(q+1)+1) (lift K p (q+1) y.val z)=0 := + entry_zero K (lift_mem K p (q+1) y.val z) (by omega) + rw [hz,map_zero,zero_add] at he + have hy : projection K (p+1) (q+1) (p+(q+1)+1) (lift K p (q+1) y.val z)=y.val := + lift_left K p (q+1) y.val z + rw [hy] at he + have hcyc : (K.X (p+1)).d (q+1) q y.val=0 := y.property + rw [hcyc,smul_zero] at he + exact he + +end E2Leading + +end + +section + +open CategoryTheory Limits HomologicalComplex HomologicalComplex₂ +namespace E2Leading + +universe u +variable {R : Type u} [CommRing R] +open TotalProjection +variable (K : HomologicalComplex₂ (ModuleCat.{u} R) c c) + +lemma lead_zero_boundary (p q : ℕ) (x : (filteredData K (p+q)).Z₂ ((p:ℤ)+1)) + (hx : lead K p q x=0) : x.val∈(filteredData K (p+q)).B₂ ((p:ℤ)+1) := by + obtain ⟨u,hu⟩ := (ConcreteHomology.π_eq_zero (row K q) p (topRowCycle K p q x)).mp hx + obtain ⟨y,rfl⟩ := ConcreteHomology.π_surjective (K.X (p+1)) q u + have he : ConcreteHomology.π (K.X p) q (ConcreteHomology.cyclesMap (K.d (p+1) p) q y)= + ConcreteHomology.π (K.X p) q (topCycle K p q x) := by + have h := congrArg Subtype.val hu + change ((ConcreteHomology.functor q).map (K.d (p+1) p)).hom + (ConcreteHomology.π (K.X (p+1)) q y)= _ at h + rw [ConcreteHomology.map_π] at h + exact h + have hπ : ConcreteHomology.π (K.X p) q + (topCycle K p q x - ConcreteHomology.cyclesMap (K.d (p+1) p) q y)=0 := by + rw [map_sub,he,sub_self] + obtain ⟨z,hz⟩ := (ConcreteHomology.π_eq_zero _ _ _).mp hπ + have hzval : (K.X p).d (q+1) q z = projection K p q (p+q) x.val - (K.d (p+1) p).f q y.val := by + have h := congrArg Subtype.val hz + change (K.X p).d (q+1) q z = (topCycle K p q x).val - (ConcreteHomology.cyclesMap (K.d (p+1) p) q y).val at h + rw [ConcreteHomology.cyclesMap_val] at h + exact h + let w := lift K p q y.val z + have hw : w∈(filteredData K (p+q)).FA (((p:ℤ)+1)+1) := by + change w∈filtration K (p+q+1) (((p:ℤ)+1)+1) + simpa only [Int.add_assoc,Int.reduceAdd] using lift_mem K p q y.val z + have hdw := d_lift_mem K p q y z + have htop : projection K p q (p+q) ((K.total c).d (p+q+1) (p+q) w) = + projection K p q (p+q) x.val := by + calc + _ = (K.d (p+1) p).f q y.val + (K.X p).d (q+1) q z := d_lift_top K p q y.val z + _ = _ := by rw [hzval]; abel + have hlower : x.val - (K.total c).d (p+q+1) (p+q) w∈filtration K (p+q) p := by + apply lower_filtration K p q ((filtration K _ _).sub_mem x.property.1 hdw) + rw [map_sub,htop,sub_self] + refine Submodule.mem_sup.mpr ⟨x.val-(K.total c).d (p+q+1) (p+q) w,⟨?_,?_⟩, + (K.total c).d (p+q+1) (p+q) w,⟨⟨w,hw,rfl⟩,hdw⟩,sub_add_cancel _ _⟩ + · change x.val-(K.total c).d (p+q+1) (p+q) w∈filtration K (p+q) (((p:ℤ)+1)-1) + simpa using hlower + · change (K.total c).d (p+q) (p+q-1) (x.val-(K.total c).d (p+q+1) (p+q) w)∈ + filtration K (p+q-1) (((p:ℤ)+1)-2) + rw [map_sub] + have hd : (K.total c).d (p+q) (p+q-1) ((K.total c).d (p+q+1) (p+q) w)=0 := + congrArg (fun f : (K.total c).X (p+q+1) ⟶ (K.total c).X (p+q-1) => f.hom w) + ((K.total c).d_comp_d _ _ _) + rw [hd,sub_zero] + exact x.property.2 + +lemma finite_E₂ [IsNoetherianRing R] (p q : ℕ) + [Module.Finite R (ConcreteHomology.H (row K q) p)] : + Module.Finite R ((filteredData K (p+q)).E₂ ((p:ℤ)+1)) := by + apply FilteredFiniteness.finite_of_ker_le + (((filteredData K (p+q)).B₂ ((p:ℤ)+1)).comap + ((filteredData K (p+q)).Z₂ ((p:ℤ)+1)).subtype).mkQ (lead K p q) + (Submodule.mkQ_surjective _) + intro x hx + exact (Submodule.Quotient.mk_eq_zero _).mpr (lead_zero_boundary K p q x hx) + +lemma finite_total_concrete [IsNoetherianRing R] (n : ℕ) + (hfinite : ∀ p q, p+q=n → Module.Finite R (ConcreteHomology.H (row K q) p)) : + Module.Finite R (ConcreteHomology.H (K.total c) n) := by + change Module.Finite R (filteredData K n).H + apply FilteredFiniteness.Data.finite_H _ n (filtration_zero K n) (filtration_top K n) + intro p hp + have hn : p+(n-p)=n := Nat.add_sub_of_le hp + have := hfinite p (n-p) hn + have h := finite_E₂ K p (n-p) + rwa [hn] at h + +lemma finite_total [IsNoetherianRing R] (n : ℕ) + (hfinite : ∀ p q, p+q=n → Module.Finite R (ConcreteHomology.H (row K q) p)) : + Module.Finite R ((K.total c).homology n) := by + have := finite_total_concrete K n hfinite + exact Module.Finite.equiv (CategoryTheory.Iso.toLinearEquiv (ConcreteHomology.iso (K.total c) n)).symm + +end E2Leading + +end + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/E2Descend.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/E2Descend.lean new file mode 100644 index 0000000000000000000000000000000000000000..f9c274db53a6ff4d017d9e7428e862d0735a1f29 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/E2Descend.lean @@ -0,0 +1,171 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.FilteredEdgeReturn + +namespace OAI + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits HomologicalComplex HomologicalComplex₂ +namespace E2Leading +open TotalProjection + +universe u +variable {R : Type u} [CommRing R] +variable (K : HomologicalComplex₂ (ModuleCat.{u} R) c c) +lemma boundary_top_cycle (p q : ℕ) (w : (K.total c).X (p+q+1)) + (hw : w∈filtration K (p+q+1) (p+2)) + (hdw : (K.total c).d (p+q+1) (p+q) w∈filtration K (p+q) (p+1)) : + (K.X (p+1)).d q (q-1) (projection K (p+1) q (p+q+1) w)=0 := by + cases q with + | zero => rw [(K.X (p+1)).shape 0 (0-1) (by decide)]; rfl + | succ q => + rw [Nat.add_sub_cancel] + have hd := d_entry' K (p+1) q (p+(q+1)+1) (p+(q+1)) (by omega) (by omega) w + have hz : projection K (p+1) q (p+(q+1)) ((K.total c).d (p+(q+1)+1) (p+(q+1)) w)=0 := + entry_zero K hdw (by omega) + have hf : projection K (p+1+1) q (p+(q+1)+1) w=0 := entry_zero K hw (by omega) + rw [hz,hf,map_zero,zero_add] at hd + have hh := congrArg (fun z => (((-1 : ℤˣ)^(p+1))⁻¹) • z) hd.symm + rw [inv_smul_smul,smul_zero] at hh + exact hh +lemma boundary_lead_zero (p q : ℕ) (w : (K.total c).X (p+q+1)) + (hw : w∈filtration K (p+q+1) (p+2)) + (x : (filteredData K (p+q)).Z₂ ((p:ℤ)+1)) + (hx : x.val=(K.total c).d (p+q+1) (p+q) w) : lead K p q x=0 := by + have hdw : (K.total c).d (p+q+1) (p+q) w∈filtration K (p+q) (p+1) := hx ▸ x.property.1 + let y : ConcreteHomology.Cycles (K.X (p+1)) q := + ⟨projection K (p+1) q (p+q+1) w,boundary_top_cycle K p q w hw hdw⟩ + apply (ConcreteHomology.π_eq_zero (row K q) p (topRowCycle K p q x)).mpr + refine ⟨ConcreteHomology.π (K.X (p+1)) q y,?_⟩ + apply Subtype.ext + change ((ConcreteHomology.functor q).map (K.d (p+1) p)).hom + (ConcreteHomology.π (K.X (p+1)) q y) = ConcreteHomology.π (K.X p) q (topCycle K p q x) + rw [ConcreteHomology.map_π] + apply (Submodule.Quotient.eq _).mpr + refine ⟨- (((-1 : ℤˣ)^p) • projection K p (q+1) (p+q+1) w),?_⟩ + apply Subtype.ext + change (K.X p).d (q+1) q (- (((-1 : ℤˣ)^p) • projection K p (q+1) (p+q+1) w))= + (ConcreteHomology.cyclesMap (K.d (p+1) p) q y).val - (topCycle K p q x).val + rw [ConcreteHomology.cyclesMap_val] + change _ = (K.d (p+1) p).f q (projection K (p+1) q (p+q+1) w) - projection K p q (p+q) x.val + rw [hx,d_entry,map_neg,linear_units_smul] + abel +lemma boundary_lead (p q : ℕ) (x : (filteredData K (p+q)).Z₂ ((p:ℤ)+1)) + (hx : x.val∈(filteredData K (p+q)).B₂ ((p:ℤ)+1)) : lead K p q x=0 := by + obtain ⟨y,hy,z,hz,hyz⟩ := Submodule.mem_sup.mp hx + have hz' := (filteredData K (p+q)).B₂_le_Z₂ ((p:ℤ)+1) + (show z∈(filteredData K (p+q)).B₂ ((p:ℤ)+1) from Submodule.mem_sup_right hz) + let z' : (filteredData K (p+q)).Z₂ ((p:ℤ)+1) := ⟨z,hz'⟩ + let y' : (filteredData K (p+q)).Z₂ ((p:ℤ)+1) := x-z' + have hy' : y'.val=y := by change x.val-z=y; rw [←hyz]; abel + have hly : lead K p q y'=0 := by + have ht : projection K p q (p+q) y'.val=0 := by + rw [hy'] + exact entry_zero K hy.1 (by omega) + have hc : topCycle K p q y'=0 := by apply Subtype.ext; exact ht + change ConcreteHomology.π (row K q) p (topRowCycle K p q y')=0 + have hr : topRowCycle K p q y'=0 := by + apply Subtype.ext + change ConcreteHomology.π (K.X p) q (topCycle K p q y')=0 + rw [hc,map_zero] + rw [hr,map_zero] + have hlz : lead K p q z'=0 := by + obtain ⟨w,hw,hwe⟩ := hz.1 + apply boundary_lead_zero K p q w _ z' hwe.symm + change w∈filtration K (p+q+1) (((p:ℤ)+1)+1) at hw + simpa only [Int.add_assoc,Int.reduceAdd] using hw + rw [show x=y'+z' by dsimp [y']; abel,map_add,hly,hlz,add_zero] +noncomputable def descendedLead (p q : ℕ) : + (filteredData K (p+q)).E₂ ((p:ℤ)+1) →ₗ[R] ConcreteHomology.H (row K q) p := + (((filteredData K (p+q)).B₂ ((p:ℤ)+1)).comap + ((filteredData K (p+q)).Z₂ ((p:ℤ)+1)).subtype).liftQ (lead K p q) + (fun x hx => boundary_lead K p q x hx) +lemma descendedLead_injective (p q : ℕ) : Function.Injective (descendedLead K p q) := by + apply LinearMap.ker_eq_bot.mp + apply le_antisymm _ bot_le + intro x hx + obtain ⟨y,rfl⟩ := Submodule.mkQ_surjective _ x + exact (Submodule.Quotient.mk_eq_zero _).mpr (lead_zero_boundary K p q y hx) +lemma first_descendedLead_surjective (q : ℕ) : Function.Surjective (descendedLead K 1 q) := by + intro y + obtain ⟨x,hx⟩ := first_lead_surjective K q y + exact ⟨Submodule.Quotient.mk x,hx⟩ +end E2Leading + +end + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits HomologicalComplex HomologicalComplex₂ +namespace TotalProjection + +universe u +variable {R : Type u} [CommRing R] +variable (K : HomologicalComplex₂ (ModuleCat.{u} R) c c) +noncomputable def edgeData (n : ℕ) : FilteredEdge.Data + (R:=R) (D:=(K.total c).X (n+2)) (A:=(K.total c).X (n+1)) + (B:=(K.total c).X n) (C:=(K.total c).X (n-1)) where + s := ((K.total c).d (n+2) (n+1)).hom + d := ((K.total c).d (n+1) n).hom + e := ((K.total c).d n (n-1)).hom + ds := ModuleCat.hom_ext_iff.mp ((K.total c).d_comp_d (n+2) (n+1) n) + ed := ModuleCat.hom_ext_iff.mp ((K.total c).d_comp_d (n+1) n (n-1)) + FD := filtration K (n+2) + FA := filtration K (n+1) + FB := filtration K n + FC := filtration K (n-1) + monoA := filtration_mono K (n+1) + monoB := filtration_mono K n +lemma edgeData_current (n : ℕ) : (edgeData K n).current=filteredData K n := rfl +lemma edgeData_previous (n : ℕ) : (edgeData K n).previous=filteredData K (n+1) := rfl +end TotalProjection +namespace E2Leading +open TotalProjection + +universe u +variable {R : Type u} [CommRing R] [IsNoetherianRing R] +variable (K : HomologicalComplex₂ (ModuleCat.{u} R) c c) +lemma finite_first (q : ℕ) + [Module.Finite R (ConcreteHomology.H (K.total c) (1+q))] + (hf : ∀ p r, p+r=q+2 → 3≤p → Module.Finite R (ConcreteHomology.H (row K r) p)) : + Module.Finite R (ConcreteHomology.H (row K q) 1) := by + let E := edgeData K (1+q) + have : Module.Finite R E.current.H := ‹Module.Finite R (ConcreteHomology.H (K.total c) (1+q))› + have : Module.Finite R (E.tower 2 (2+(q:ℤ)+1)) := by + apply E.finite_tower 2 q + intro i hi + have hpq : (i+3)+(q-1-i)=1+q+1 := by omega + have := hf (i+3) (q-1-i) (by omega) (by omega) + have ht := finite_E₂ K (i+3) (q-1-i) + rw [hpq] at ht + change Module.Finite R ((filteredData K (1+q+1)).E₂ (2+(i:ℤ)+2)) + rw [show ((i+3:ℕ):ℤ)+1=2+(i:ℤ)+2 by omega] at ht + exact ht + have hzero : E.FC (2-2)=⊥ := filtration_zero K (1+q-1) + have htop : E.FA (2+(q:ℤ)+1)=⊤ := by + change filtration K (1+q+1) (2+(q:ℤ)+1)=⊤ + rw [show 2+(q:ℤ)+1=((1+q+1:ℕ):ℤ)+1 by omega] + exact filtration_top K (1+q+1) + have : Module.Finite R ((filteredData K (1+q)).E₂ ((1:ℤ)+1)) := + E.finite_edge 2 hzero (2+(q:ℤ)+1) htop + exact Module.Finite.of_surjective (descendedLead K 1 q) (first_descendedLead_surjective K q) +end E2Leading +namespace TotalFiniteness + +universe u +variable {R : Type u} [CommRing R] [IsNoetherianRing R] +variable (K : HomologicalComplex₂ (ModuleCat.{u} R) c c) +lemma finite_first (q : ℕ) [Module.Finite R ((K.total c).homology (1+q))] + (hf : ∀ p r, p+r=q+2 → 3≤p → Module.Finite R ((row K r).homology p)) : + Module.Finite R ((row K q).homology 1) := by + have : Module.Finite R (ConcreteHomology.H (K.total c) (1+q)) := + Module.Finite.equiv (ConcreteHomology.iso (K.total c) (1+q)).toLinearEquiv + have : Module.Finite R (ConcreteHomology.H (E2Leading.row K q) 1) := by + apply E2Leading.finite_first K q + intro p r hpr hp + have := hf p r hpr hp + exact Module.Finite.equiv (rowHomologyIso K p r).toLinearEquiv + exact Module.Finite.equiv (rowHomologyIso K 1 q).symm.toLinearEquiv +end TotalFiniteness + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/ExactShapeHomology.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/ExactShapeHomology.lean new file mode 100644 index 0000000000000000000000000000000000000000..b0f599b36ede00da8ea4c643df59735439bd2100 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/ExactShapeHomology.lean @@ -0,0 +1,161 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.PiSSet + +namespace OAI + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits +namespace ExactShapeHomology + +section + +variable {J : Type} [Category.{0} J] +abbrev A := ModuleCat.{0} ℤ +abbrev c := ComplexShape.down ℕ +variable [HasExactColimitsOfShape J A] +noncomputable def complex (F : J ⥤ ChainComplex A ℕ) : ChainComplex (J ⥤ A) ℕ where + X i := F ⋙ HomologicalComplex.eval A c i + d i j := { app t := (F.obj t).d i j + naturality _ _ f := (F.map f).comm i j } + shape i j h := by apply NatTrans.ext; funext t; exact (F.obj t).shape i j h + d_comp_d' i j k _ _ := by apply NatTrans.ext; funext t; exact (F.obj t).d_comp_d i j k +noncomputable def injection (j : J) : (evaluation J A).obj j ⟶ colim where + app F := colimit.ι F j + naturality _ _ f := (colimit.ι_map f j).symm +noncomputable def cocone (F : J ⥤ ChainComplex A ℕ) : Cocone F where + pt := (colim.mapHomologicalComplex c).obj (complex F) + ι := { + app j := { + f i := colimit.ι ((complex F).X i) j + comm' i k _ := colimit.ι_map ((complex F).d i k) j } + naturality _ _ f := by + apply HomologicalComplex.Hom.ext; funext n + exact colimit.w (F ⋙ HomologicalComplex.eval A c n) f } +noncomputable def isColimit (F : J ⥤ ChainComplex A ℕ) : IsColimit (cocone F) := + HomologicalComplex.isColimitOfEval F (cocone F) (fun _ => colimit.isColimit _) +noncomputable def evaluationHomology (F : J ⥤ ChainComplex A ℕ) (n : ℕ) (j:J) : + (F.obj j).homology n ≅ ((complex F).homology n).obj j := + ((complex F).sc n).mapHomologyIso ((evaluation J A).obj j) +noncomputable def colimitHomology (F : J ⥤ ChainComplex A ℕ) (n : ℕ) : + (cocone F).pt.homology n ≅ colimit ((complex F).homology n) := + ((complex F).sc n).mapHomologyIso colim +lemma homology_injection (F : J ⥤ ChainComplex A ℕ) (n : ℕ) (j:J) : + HomologicalComplex.homologyMap ((cocone F).ι.app j) n = + (evaluationHomology F n j).hom ≫ colimit.ι ((complex F).homology n) j ≫ + (colimitHomology F n).inv := + ShortComplex.homologyMap_mapNatTrans ((complex F).sc n) (injection j) +omit [HasExactColimitsOfShape J A] in +lemma evaluationHomology_naturality (F : J ⥤ ChainComplex A ℕ) (n : ℕ) {i j:J} (f:i⟶j) : + HomologicalComplex.homologyMap (F.map f) n ≫ (evaluationHomology F n j).hom = + (evaluationHomology F n i).hom ≫ ((complex F).homology n).map f := by + have h := ShortComplex.homologyMap_mapNatTrans ((complex F).sc n) ((evaluation J A).map f) + change HomologicalComplex.homologyMap (F.map f) n = + (evaluationHomology F n i).hom ≫ ((complex F).homology n).map f ≫ + (evaluationHomology F n j).inv at h + rw [h] + simp [Category.assoc] +noncomputable def homologyCocone (F : J ⥤ ChainComplex A ℕ) (n : ℕ) + (d : Cocone (F ⋙ HomologicalComplex.homologyFunctor A c n)) : + Cocone ((complex F).homology n) where + pt := d.pt + ι := { app j := (evaluationHomology F n j).inv ≫ d.ι.app j + naturality i _ f := by + have h := evaluationHomology_naturality F n f + rw [←Iso.inv_comp_eq] at h + rw [←h] + simp only [Category.assoc,Functor.const_obj_map] + erw [Iso.hom_inv_id_assoc,Category.comp_id] + exact congrArg (fun t => (evaluationHomology F n i).inv ≫ t) (d.w f) } +noncomputable def homologyIsColimit (F : J ⥤ ChainComplex A ℕ) (n : ℕ) : + IsColimit ((HomologicalComplex.homologyFunctor A c n).mapCocone (cocone F)) where + desc d := (colimitHomology F n).hom ≫ colimit.desc _ (homologyCocone F n d) + fac d j := by + change HomologicalComplex.homologyMap ((cocone F).ι.app j) n ≫ + ((colimitHomology F n).hom ≫ colimit.desc _ (homologyCocone F n d)) = d.ι.app j + rw [homology_injection] + simp only [Category.assoc] + erw [Iso.inv_hom_id_assoc,colimit.ι_desc] + exact Iso.hom_inv_id_assoc _ _ + uniq d m hm := by + change m = (colimitHomology F n).hom ≫ colimit.desc _ (homologyCocone F n d) + apply (Iso.inv_comp_eq (colimitHomology F n)).mp + apply colimit.hom_ext + intro j + erw [colimit.ι_desc] + change colimit.ι ((complex F).homology n) j ≫ ((colimitHomology F n).inv ≫ m) = + (evaluationHomology F n j).inv ≫ d.ι.app j + apply (Iso.eq_inv_comp (evaluationHomology F n j)).mpr + have h := hm j + change HomologicalComplex.homologyMap ((cocone F).ι.app j) n ≫ m = _ at h + rw [homology_injection] at h + erw [Category.assoc,Category.assoc] at h + exact h +noncomputable instance homology_preserves (n : ℕ) : + PreservesColimitsOfShape J (HomologicalComplex.homologyFunctor A c n) where + preservesColimit {F} := preservesColimit_of_preserves_colimit_cocone (isColimit F) (homologyIsColimit F n) +end +variable {J : Type} [Category.{0} J] [HasExactColimitsOfShape J A] +noncomputable instance sset_homology_preserves (Z:A) (n:ℕ) : + PreservesColimitsOfShape J (SSet.homologyFunctor Z n) := by + change PreservesColimitsOfShape J (((SSet.chainComplexFunctor A).obj Z) ⋙ + HomologicalComplex.homologyFunctor A c n) + infer_instance +end ExactShapeHomology + +end + +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits Simplicial Opposite +namespace ComponentCoproduct +open ComponentTranslation FreeChains + +variable (C:Type) [Groupoid.{0} C] +noncomputable def diagram : Discrete (Skeleton C) ⥤ SSet := + Discrete.functor (fun p=>nerve (Fiber p)) +noncomputable def cocone : Cocone (diagram C) := + Cofan.mk (nerve C) (fun p=>nerveMap (property p).ι) +noncomputable def lift {n:ℕ} (s:ComposableArrows C n) : + ComposableArrows (Fiber (toSkeleton s.left)) n := + (property (toSkeleton s.left)).lift s (fun i=> + (congr_toSkeleton_of_iso (asIso (s.map (homOfLE (Fin.zero_le i))))).symm) +lemma lift_forget {n:ℕ} (s:ComposableArrows C n) : + lift C s ⋙ (property (toSkeleton s.left)).ι=s := rfl +lemma inclusion_injective (p:Skeleton C) {n:ℕ} : + Function.Injective (fun s:ComposableArrows (Fiber p) n=>s ⋙ (property p).ι) := by + intro s t h + have object_eq : ∀ index, s.obj index = t.obj index := by + intro index + apply ObjectProperty.FullSubcategory.ext + exact CategoryTheory.Functor.congr_obj h index + refine CategoryTheory.Functor.ext object_eq ?_ + intro source target arrow + apply ObjectProperty.hom_ext + simpa using CategoryTheory.Functor.congr_hom h arrow +noncomputable def pointwiseIsColimit (n:ℕ) : + IsColimit (((evaluation _ (Type)).obj (op ⦋n⦌)).mapCocone (cocone C)) := by + let cf : Cofan (fun p:Skeleton C=>ComposableArrows (Fiber p) n) := + Cofan.mk (ComposableArrows C n) (fun p=>↾fun s=>s ⋙ (property p).ι) + let s := (((evaluation _ (Type)).obj (op ⦋n⦌)).mapCocone (cocone C)) + let e : diagram C ⋙ (evaluation _ (Type)).obj (op ⦋n⦌) ≅ Discrete.functor (fun p:Skeleton C=>ComposableArrows (Fiber p) n) := Discrete.natIso (fun _=>Iso.refl _) + let pointIso : s.pt ≅ cf.pt := Iso.refl _ + apply ColimitTransfer.ofIsos s cf e.hom pointIso.hom (fun _=>by simp [s,e,cf,cocone,pointIso]; rfl) + apply Classical.choice + rw [←cf.isColimit_cofanTypes_iff] + apply CofanTypes.isColimit_mk + · intro s + exact ⟨toSkeleton s.left,lift C s,rfl⟩ + · intro p; exact inclusion_injective C p + · intro p q s t h + have he := CategoryTheory.Functor.congr_obj h (0:Fin (n+1)) + exact s.left.property.symm.trans ((congrArg toSkeleton he).trans t.left.property) +noncomputable def isColimit : IsColimit (cocone C) := + evaluationJointlyReflectsColimits _ (fun n=>pointwiseIsColimit C n.unop.len) +noncomputable def homologyIsColimit (q:ℕ) : + IsColimit ((SSet.homologyFunctor Z q).mapCocone (cocone C)) := + isColimitOfPreserves _ (isColimit C) +noncomputable def homologyIso (q:ℕ) : + (nerve C).homology Z q ≅ ∐ (fun p:Skeleton C=>(nerve (Fiber p)).homology Z q) := + (homologyIsColimit C q).coconePointUniqueUpToIso (colimit.isColimit _) ≪≫ + HasColimit.isoOfNatIso (Discrete.natIsoFunctor) +end ComponentCoproduct + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/Face200.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/Face200.lean new file mode 100644 index 0000000000000000000000000000000000000000..ae32c9565a496fcc40138a618bdde4a4ee002280 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/Face200.lean @@ -0,0 +1,462 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.Id + +namespace OAI + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits MonoidalCategory Simplicial Opposite +namespace MarkedH1 +open FreeChains ComponentTranslation IntervalBar.Diagram NerveHomology + +variable {C:Type} [Groupoid.{0} C] [MonoidalCategory C] [SymmetricCategory C] +omit [SymmetricCategory C] in +@[reassoc] lemma face_2_0_0 (a b:Skeleton C) : + primitive ![a,b] 0 ≫ NerveHomology.map (reindex (SimplexCategory.δ (0:Fin 3)).toOrderHom) 1 = + 0 := by + apply face_recognition_const ![a,b] 0 0 (fun j=>repr (![b] j)) + intro j + apply Classical.choice + fin_cases j + · refine ⟨?_⟩ + change wordInclude ![a,b] 0 ⋙ (Pi.eval _ (1:Fin 2)) ≅ (Functor.const (Fiber a)).obj (repr b) + exact eqToIso (by rw [wordInclude_proj,ite_eq_right (by decide)]; rfl) +@[reassoc] lemma face_2_0_1 (a b:Skeleton C) : + primitive ![a,b] 0 ≫ NerveHomology.map (reindex (SimplexCategory.δ (1:Fin 3)).toOrderHom) 1 = + NerveHomology.map (translate b a (a*b) (mul_comm _ _)) 1 ≫ primitive ![(a*b)] 0 := by + have hh := face_recognition ![a,b] 0 1 ![(a*b)] 0 (translate b a (a*b) (mul_comm _ _)) (by + intro j + apply Classical.choice + fin_cases j + · refine ⟨?_⟩ + change wordInclude ![a,b] 0 ⋙ (pairAt (0:Fin 2) (1:Fin 2)) ≅ + (translate b a (a*b) (mul_comm _ _)) ⋙ (wordInclude ![(a*b)] 0 ⋙ Pi.eval _ (0:Fin 1)) + erw [wordInclude_proj,ite_eq_left rfl] + exact wordPair_left ![a,b] 0 1 (by decide) ≪≫ + Functor.isoWhiskerLeft (property a).ι + (BraidedCategory.tensorLeftIsoTensorRight (repr b)).symm + ) + exact hh +omit [SymmetricCategory C] in +@[reassoc] lemma face_2_0_2 (a b:Skeleton C) : + primitive ![a,b] 0 ≫ NerveHomology.map (reindex (SimplexCategory.δ (2:Fin 3)).toOrderHom) 1 = + primitive ![a] 0 := by + have hh := face_recognition ![a,b] 0 2 ![a] 0 (𝟭 (Fiber a)) (by + intro j + apply Classical.choice + fin_cases j + · refine ⟨?_⟩ + change wordInclude ![a,b] 0 ⋙ (Pi.eval _ (0:Fin 2)) ≅ + (𝟭 (Fiber a)) ⋙ (wordInclude ![a] 0 ⋙ Pi.eval _ (0:Fin 1)) + rw [wordInclude_proj,ite_eq_left rfl] + exact eqToIso (by erw [wordInclude_proj,ite_eq_left rfl]; rfl) + ) + erw [NerveHomology.id (D:=Fiber a)] at hh + exact hh.trans (Category.id_comp _) +omit [SymmetricCategory C] in +@[reassoc] lemma face_2_1_0 (a b:Skeleton C) : + primitive ![a,b] 1 ≫ NerveHomology.map (reindex (SimplexCategory.δ (0:Fin 3)).toOrderHom) 1 = + primitive ![b] 0 := by + have hh := face_recognition ![a,b] 1 0 ![b] 0 (𝟭 (Fiber b)) (by + intro j + apply Classical.choice + fin_cases j + · refine ⟨?_⟩ + change wordInclude ![a,b] 1 ⋙ (Pi.eval _ (1:Fin 2)) ≅ + (𝟭 (Fiber b)) ⋙ (wordInclude ![b] 0 ⋙ Pi.eval _ (0:Fin 1)) + rw [wordInclude_proj,ite_eq_left rfl] + exact eqToIso (by erw [wordInclude_proj,ite_eq_left rfl]; rfl) + ) + erw [NerveHomology.id (D:=Fiber b)] at hh + exact hh.trans (Category.id_comp _) +omit [SymmetricCategory C] in +@[reassoc] lemma face_2_1_1 (a b:Skeleton C) : + primitive ![a,b] 1 ≫ NerveHomology.map (reindex (SimplexCategory.δ (1:Fin 3)).toOrderHom) 1 = + NerveHomology.map (translate a b (a*b) rfl) 1 ≫ primitive ![(a*b)] 0 := by + have hh := face_recognition ![a,b] 1 1 ![(a*b)] 0 (translate a b (a*b) rfl) (by + intro j + apply Classical.choice + fin_cases j + · refine ⟨?_⟩ + change wordInclude ![a,b] 1 ⋙ (pairAt (0:Fin 2) (1:Fin 2)) ≅ + (translate a b (a*b) rfl) ⋙ (wordInclude ![(a*b)] 0 ⋙ Pi.eval _ (0:Fin 1)) + erw [wordInclude_proj,ite_eq_left rfl] + exact wordPair_right ![a,b] 0 1 (by decide) + ) + exact hh +omit [SymmetricCategory C] in +@[reassoc] lemma face_2_1_2 (a b:Skeleton C) : + primitive ![a,b] 1 ≫ NerveHomology.map (reindex (SimplexCategory.δ (2:Fin 3)).toOrderHom) 1 = + 0 := by + apply face_recognition_const ![a,b] 1 2 (fun j=>repr (![a] j)) + intro j + apply Classical.choice + fin_cases j + · refine ⟨?_⟩ + change wordInclude ![a,b] 1 ⋙ (Pi.eval _ (0:Fin 2)) ≅ (Functor.const (Fiber b)).obj (repr a) + exact eqToIso (by rw [wordInclude_proj,ite_eq_right (by decide)]; rfl) +omit [SymmetricCategory C] in +@[reassoc] lemma face_3_0_0 (a b d:Skeleton C) : + primitive ![a,b,d] 0 ≫ NerveHomology.map (reindex (SimplexCategory.δ (0:Fin 4)).toOrderHom) 1 = + 0 := by + apply face_recognition_const ![a,b,d] 0 0 (fun j=>repr (![b,d] j)) + intro j + apply Classical.choice + fin_cases j + · refine ⟨?_⟩ + change wordInclude ![a,b,d] 0 ⋙ (Pi.eval _ (1:Fin 3)) ≅ (Functor.const (Fiber a)).obj (repr b) + exact eqToIso (by rw [wordInclude_proj,ite_eq_right (by decide)]; rfl) + · refine ⟨?_⟩ + change wordInclude ![a,b,d] 0 ⋙ (Pi.eval _ (2:Fin 3)) ≅ (Functor.const (Fiber a)).obj (repr d) + exact eqToIso (by rw [wordInclude_proj,ite_eq_right (by decide)]; rfl) +@[reassoc] lemma face_3_0_1 (a b d:Skeleton C) : + primitive ![a,b,d] 0 ≫ NerveHomology.map (reindex (SimplexCategory.δ (1:Fin 4)).toOrderHom) 1 = + NerveHomology.map (translate b a (a*b) (mul_comm _ _)) 1 ≫ primitive ![(a*b),d] 0 := by + have hh := face_recognition ![a,b,d] 0 1 ![(a*b),d] 0 (translate b a (a*b) (mul_comm _ _)) (by + intro j + apply Classical.choice + fin_cases j + · refine ⟨?_⟩ + change wordInclude ![a,b,d] 0 ⋙ (pairAt (0:Fin 3) (1:Fin 3)) ≅ + (translate b a (a*b) (mul_comm _ _)) ⋙ (wordInclude ![(a*b),d] 0 ⋙ Pi.eval _ (0:Fin 2)) + erw [wordInclude_proj,ite_eq_left rfl] + exact wordPair_left ![a,b,d] 0 1 (by decide) ≪≫ + Functor.isoWhiskerLeft (property a).ι + (BraidedCategory.tensorLeftIsoTensorRight (repr b)).symm + · refine ⟨?_⟩ + change wordInclude ![a,b,d] 0 ⋙ (Pi.eval _ (2:Fin 3)) ≅ + (translate b a (a*b) (mul_comm _ _)) ⋙ (wordInclude ![(a*b),d] 0 ⋙ Pi.eval _ (1:Fin 2)) + rw [wordInclude_proj,ite_eq_right (by decide)] + exact eqToIso (by erw [wordInclude_proj,ite_eq_right (by decide)]; rfl) + ) + exact hh +omit [SymmetricCategory C] in +@[reassoc] lemma face_3_0_2 (a b d:Skeleton C) : + primitive ![a,b,d] 0 ≫ NerveHomology.map (reindex (SimplexCategory.δ (2:Fin 4)).toOrderHom) 1 = + primitive ![a,(b*d)] 0 := by + have hh := face_recognition ![a,b,d] 0 2 ![a,(b*d)] 0 (𝟭 (Fiber a)) (by + intro j + apply Classical.choice + fin_cases j + · refine ⟨?_⟩ + change wordInclude ![a,b,d] 0 ⋙ (Pi.eval _ (0:Fin 3)) ≅ + (𝟭 (Fiber a)) ⋙ (wordInclude ![a,(b*d)] 0 ⋙ Pi.eval _ (0:Fin 2)) + rw [wordInclude_proj,ite_eq_left rfl] + exact eqToIso (by erw [wordInclude_proj,ite_eq_left rfl]; rfl) + · refine ⟨?_⟩ + change wordInclude ![a,b,d] 0 ⋙ (pairAt (1:Fin 3) (2:Fin 3)) ≅ + (𝟭 (Fiber a)) ⋙ (wordInclude ![a,(b*d)] 0 ⋙ Pi.eval _ (1:Fin 2)) + erw [wordInclude_proj,ite_eq_right (by decide)] + exact wordPair_other ![a,b,d] 1 2 0 (by decide) (by decide) ≪≫ + (Functor.const (Fiber a)).mapIso (reprMul b d) + ) + erw [NerveHomology.id (D:=Fiber a)] at hh + exact hh.trans (Category.id_comp _) +omit [SymmetricCategory C] in +@[reassoc] lemma face_3_0_3 (a b d:Skeleton C) : + primitive ![a,b,d] 0 ≫ NerveHomology.map (reindex (SimplexCategory.δ (3:Fin 4)).toOrderHom) 1 = + primitive ![a,b] 0 := by + have hh := face_recognition ![a,b,d] 0 3 ![a,b] 0 (𝟭 (Fiber a)) (by + intro j + apply Classical.choice + fin_cases j + · refine ⟨?_⟩ + change wordInclude ![a,b,d] 0 ⋙ (Pi.eval _ (0:Fin 3)) ≅ + (𝟭 (Fiber a)) ⋙ (wordInclude ![a,b] 0 ⋙ Pi.eval _ (0:Fin 2)) + rw [wordInclude_proj,ite_eq_left rfl] + exact eqToIso (by erw [wordInclude_proj,ite_eq_left rfl]; rfl) + · refine ⟨?_⟩ + change wordInclude ![a,b,d] 0 ⋙ (Pi.eval _ (1:Fin 3)) ≅ + (𝟭 (Fiber a)) ⋙ (wordInclude ![a,b] 0 ⋙ Pi.eval _ (1:Fin 2)) + rw [wordInclude_proj,ite_eq_right (by decide)] + exact eqToIso (by erw [wordInclude_proj,ite_eq_right (by decide)]; rfl) + ) + erw [NerveHomology.id (D:=Fiber a)] at hh + exact hh.trans (Category.id_comp _) +omit [SymmetricCategory C] in +@[reassoc] lemma face_3_1_0 (a b d:Skeleton C) : + primitive ![a,b,d] 1 ≫ NerveHomology.map (reindex (SimplexCategory.δ (0:Fin 4)).toOrderHom) 1 = + primitive ![b,d] 0 := by + have hh := face_recognition ![a,b,d] 1 0 ![b,d] 0 (𝟭 (Fiber b)) (by + intro j + apply Classical.choice + fin_cases j + · refine ⟨?_⟩ + change wordInclude ![a,b,d] 1 ⋙ (Pi.eval _ (1:Fin 3)) ≅ + (𝟭 (Fiber b)) ⋙ (wordInclude ![b,d] 0 ⋙ Pi.eval _ (0:Fin 2)) + rw [wordInclude_proj,ite_eq_left rfl] + exact eqToIso (by erw [wordInclude_proj,ite_eq_left rfl]; rfl) + · refine ⟨?_⟩ + change wordInclude ![a,b,d] 1 ⋙ (Pi.eval _ (2:Fin 3)) ≅ + (𝟭 (Fiber b)) ⋙ (wordInclude ![b,d] 0 ⋙ Pi.eval _ (1:Fin 2)) + rw [wordInclude_proj,ite_eq_right (by decide)] + exact eqToIso (by erw [wordInclude_proj,ite_eq_right (by decide)]; rfl) + ) + erw [NerveHomology.id (D:=Fiber b)] at hh + exact hh.trans (Category.id_comp _) +omit [SymmetricCategory C] in +@[reassoc] lemma face_3_1_1 (a b d:Skeleton C) : + primitive ![a,b,d] 1 ≫ NerveHomology.map (reindex (SimplexCategory.δ (1:Fin 4)).toOrderHom) 1 = + NerveHomology.map (translate a b (a*b) rfl) 1 ≫ primitive ![(a*b),d] 0 := by + have hh := face_recognition ![a,b,d] 1 1 ![(a*b),d] 0 (translate a b (a*b) rfl) (by + intro j + apply Classical.choice + fin_cases j + · refine ⟨?_⟩ + change wordInclude ![a,b,d] 1 ⋙ (pairAt (0:Fin 3) (1:Fin 3)) ≅ + (translate a b (a*b) rfl) ⋙ (wordInclude ![(a*b),d] 0 ⋙ Pi.eval _ (0:Fin 2)) + erw [wordInclude_proj,ite_eq_left rfl] + exact wordPair_right ![a,b,d] 0 1 (by decide) + · refine ⟨?_⟩ + change wordInclude ![a,b,d] 1 ⋙ (Pi.eval _ (2:Fin 3)) ≅ + (translate a b (a*b) rfl) ⋙ (wordInclude ![(a*b),d] 0 ⋙ Pi.eval _ (1:Fin 2)) + rw [wordInclude_proj,ite_eq_right (by decide)] + exact eqToIso (by erw [wordInclude_proj,ite_eq_right (by decide)]; rfl) + ) + exact hh +@[reassoc] lemma face_3_1_2 (a b d:Skeleton C) : + primitive ![a,b,d] 1 ≫ NerveHomology.map (reindex (SimplexCategory.δ (2:Fin 4)).toOrderHom) 1 = + NerveHomology.map (translate d b (b*d) (mul_comm _ _)) 1 ≫ primitive ![a,(b*d)] 1 := by + have hh := face_recognition ![a,b,d] 1 2 ![a,(b*d)] 1 (translate d b (b*d) (mul_comm _ _)) (by + intro j + apply Classical.choice + fin_cases j + · refine ⟨?_⟩ + change wordInclude ![a,b,d] 1 ⋙ (Pi.eval _ (0:Fin 3)) ≅ + (translate d b (b*d) (mul_comm _ _)) ⋙ (wordInclude ![a,(b*d)] 1 ⋙ Pi.eval _ (0:Fin 2)) + rw [wordInclude_proj,ite_eq_right (by decide)] + exact eqToIso (by erw [wordInclude_proj,ite_eq_right (by decide)]; rfl) + · refine ⟨?_⟩ + change wordInclude ![a,b,d] 1 ⋙ (pairAt (1:Fin 3) (2:Fin 3)) ≅ + (translate d b (b*d) (mul_comm _ _)) ⋙ (wordInclude ![a,(b*d)] 1 ⋙ Pi.eval _ (1:Fin 2)) + erw [wordInclude_proj,ite_eq_left rfl] + exact wordPair_left ![a,b,d] 1 2 (by decide) ≪≫ + Functor.isoWhiskerLeft (property b).ι + (BraidedCategory.tensorLeftIsoTensorRight (repr d)).symm + ) + exact hh +omit [SymmetricCategory C] in +@[reassoc] lemma face_3_1_3 (a b d:Skeleton C) : + primitive ![a,b,d] 1 ≫ NerveHomology.map (reindex (SimplexCategory.δ (3:Fin 4)).toOrderHom) 1 = + primitive ![a,b] 1 := by + have hh := face_recognition ![a,b,d] 1 3 ![a,b] 1 (𝟭 (Fiber b)) (by + intro j + apply Classical.choice + fin_cases j + · refine ⟨?_⟩ + change wordInclude ![a,b,d] 1 ⋙ (Pi.eval _ (0:Fin 3)) ≅ + (𝟭 (Fiber b)) ⋙ (wordInclude ![a,b] 1 ⋙ Pi.eval _ (0:Fin 2)) + rw [wordInclude_proj,ite_eq_right (by decide)] + exact eqToIso (by erw [wordInclude_proj,ite_eq_right (by decide)]; rfl) + · refine ⟨?_⟩ + change wordInclude ![a,b,d] 1 ⋙ (Pi.eval _ (1:Fin 3)) ≅ + (𝟭 (Fiber b)) ⋙ (wordInclude ![a,b] 1 ⋙ Pi.eval _ (1:Fin 2)) + rw [wordInclude_proj,ite_eq_left rfl] + exact eqToIso (by erw [wordInclude_proj,ite_eq_left rfl]; rfl) + ) + erw [NerveHomology.id (D:=Fiber b)] at hh + exact hh.trans (Category.id_comp _) +omit [SymmetricCategory C] in +@[reassoc] lemma face_3_2_0 (a b d:Skeleton C) : + primitive ![a,b,d] 2 ≫ NerveHomology.map (reindex (SimplexCategory.δ (0:Fin 4)).toOrderHom) 1 = + primitive ![b,d] 1 := by + have hh := face_recognition ![a,b,d] 2 0 ![b,d] 1 (𝟭 (Fiber d)) (by + intro j + apply Classical.choice + fin_cases j + · refine ⟨?_⟩ + change wordInclude ![a,b,d] 2 ⋙ (Pi.eval _ (1:Fin 3)) ≅ + (𝟭 (Fiber d)) ⋙ (wordInclude ![b,d] 1 ⋙ Pi.eval _ (0:Fin 2)) + rw [wordInclude_proj,ite_eq_right (by decide)] + exact eqToIso (by erw [wordInclude_proj,ite_eq_right (by decide)]; rfl) + · refine ⟨?_⟩ + change wordInclude ![a,b,d] 2 ⋙ (Pi.eval _ (2:Fin 3)) ≅ + (𝟭 (Fiber d)) ⋙ (wordInclude ![b,d] 1 ⋙ Pi.eval _ (1:Fin 2)) + rw [wordInclude_proj,ite_eq_left rfl] + exact eqToIso (by erw [wordInclude_proj,ite_eq_left rfl]; rfl) + ) + erw [NerveHomology.id (D:=Fiber d)] at hh + exact hh.trans (Category.id_comp _) +omit [SymmetricCategory C] in +@[reassoc] lemma face_3_2_1 (a b d:Skeleton C) : + primitive ![a,b,d] 2 ≫ NerveHomology.map (reindex (SimplexCategory.δ (1:Fin 4)).toOrderHom) 1 = + primitive ![(a*b),d] 1 := by + have hh := face_recognition ![a,b,d] 2 1 ![(a*b),d] 1 (𝟭 (Fiber d)) (by + intro j + apply Classical.choice + fin_cases j + · refine ⟨?_⟩ + change wordInclude ![a,b,d] 2 ⋙ (pairAt (0:Fin 3) (1:Fin 3)) ≅ + (𝟭 (Fiber d)) ⋙ (wordInclude ![(a*b),d] 1 ⋙ Pi.eval _ (0:Fin 2)) + erw [wordInclude_proj,ite_eq_right (by decide)] + exact wordPair_other ![a,b,d] 0 1 2 (by decide) (by decide) ≪≫ + (Functor.const (Fiber d)).mapIso (reprMul a b) + · refine ⟨?_⟩ + change wordInclude ![a,b,d] 2 ⋙ (Pi.eval _ (2:Fin 3)) ≅ + (𝟭 (Fiber d)) ⋙ (wordInclude ![(a*b),d] 1 ⋙ Pi.eval _ (1:Fin 2)) + rw [wordInclude_proj,ite_eq_left rfl] + exact eqToIso (by erw [wordInclude_proj,ite_eq_left rfl]; rfl) + ) + erw [NerveHomology.id (D:=Fiber d)] at hh + exact hh.trans (Category.id_comp _) +omit [SymmetricCategory C] in +@[reassoc] lemma face_3_2_2 (a b d:Skeleton C) : + primitive ![a,b,d] 2 ≫ NerveHomology.map (reindex (SimplexCategory.δ (2:Fin 4)).toOrderHom) 1 = + NerveHomology.map (translate b d (b*d) rfl) 1 ≫ primitive ![a,(b*d)] 1 := by + have hh := face_recognition ![a,b,d] 2 2 ![a,(b*d)] 1 (translate b d (b*d) rfl) (by + intro j + apply Classical.choice + fin_cases j + · refine ⟨?_⟩ + change wordInclude ![a,b,d] 2 ⋙ (Pi.eval _ (0:Fin 3)) ≅ + (translate b d (b*d) rfl) ⋙ (wordInclude ![a,(b*d)] 1 ⋙ Pi.eval _ (0:Fin 2)) + rw [wordInclude_proj,ite_eq_right (by decide)] + exact eqToIso (by erw [wordInclude_proj,ite_eq_right (by decide)]; rfl) + · refine ⟨?_⟩ + change wordInclude ![a,b,d] 2 ⋙ (pairAt (1:Fin 3) (2:Fin 3)) ≅ + (translate b d (b*d) rfl) ⋙ (wordInclude ![a,(b*d)] 1 ⋙ Pi.eval _ (1:Fin 2)) + erw [wordInclude_proj,ite_eq_left rfl] + exact wordPair_right ![a,b,d] 1 2 (by decide) + ) + exact hh +omit [SymmetricCategory C] in +@[reassoc] lemma face_3_2_3 (a b d:Skeleton C) : + primitive ![a,b,d] 2 ≫ NerveHomology.map (reindex (SimplexCategory.δ (3:Fin 4)).toOrderHom) 1 = + 0 := by + apply face_recognition_const ![a,b,d] 2 3 (fun j=>repr (![a,b] j)) + intro j + apply Classical.choice + fin_cases j + · refine ⟨?_⟩ + change wordInclude ![a,b,d] 2 ⋙ (Pi.eval _ (0:Fin 3)) ≅ (Functor.const (Fiber d)).obj (repr a) + exact eqToIso (by rw [wordInclude_proj,ite_eq_right (by decide)]; rfl) + · refine ⟨?_⟩ + change wordInclude ![a,b,d] 2 ⋙ (Pi.eval _ (1:Fin 3)) ≅ (Functor.const (Fiber d)).obj (repr b) + exact eqToIso (by rw [wordInclude_proj,ite_eq_right (by decide)]; rfl) +omit [SymmetricCategory C] in +@[reassoc] lemma face_4_0_0 (a b d e:Skeleton C) : + primitive ![a,b,d,e] 0 ≫ NerveHomology.map (reindex (SimplexCategory.δ (0:Fin 5)).toOrderHom) 1 = + 0 := by + apply face_recognition_const ![a,b,d,e] 0 0 (fun j=>repr (![b,d,e] j)) + intro j + apply Classical.choice + fin_cases j + · refine ⟨?_⟩ + change wordInclude ![a,b,d,e] 0 ⋙ (Pi.eval _ (1:Fin 4)) ≅ (Functor.const (Fiber a)).obj (repr b) + exact eqToIso (by rw [wordInclude_proj,ite_eq_right (by decide)]; rfl) + · refine ⟨?_⟩ + change wordInclude ![a,b,d,e] 0 ⋙ (Pi.eval _ (2:Fin 4)) ≅ (Functor.const (Fiber a)).obj (repr d) + exact eqToIso (by rw [wordInclude_proj,ite_eq_right (by decide)]; rfl) + · refine ⟨?_⟩ + change wordInclude ![a,b,d,e] 0 ⋙ (Pi.eval _ (3:Fin 4)) ≅ (Functor.const (Fiber a)).obj (repr e) + exact eqToIso (by rw [wordInclude_proj,ite_eq_right (by decide)]; rfl) +@[reassoc] lemma face_4_0_1 (a b d e:Skeleton C) : + primitive ![a,b,d,e] 0 ≫ NerveHomology.map (reindex (SimplexCategory.δ (1:Fin 5)).toOrderHom) 1 = + NerveHomology.map (translate b a (a*b) (mul_comm _ _)) 1 ≫ primitive ![(a*b),d,e] 0 := by + have hh := face_recognition ![a,b,d,e] 0 1 ![(a*b),d,e] 0 (translate b a (a*b) (mul_comm _ _)) (by + intro j + apply Classical.choice + fin_cases j + · refine ⟨?_⟩ + change wordInclude ![a,b,d,e] 0 ⋙ (pairAt (0:Fin 4) (1:Fin 4)) ≅ + (translate b a (a*b) (mul_comm _ _)) ⋙ (wordInclude ![(a*b),d,e] 0 ⋙ Pi.eval _ (0:Fin 3)) + erw [wordInclude_proj,ite_eq_left rfl] + exact wordPair_left ![a,b,d,e] 0 1 (by decide) ≪≫ + Functor.isoWhiskerLeft (property a).ι + (BraidedCategory.tensorLeftIsoTensorRight (repr b)).symm + · refine ⟨?_⟩ + change wordInclude ![a,b,d,e] 0 ⋙ (Pi.eval _ (2:Fin 4)) ≅ + (translate b a (a*b) (mul_comm _ _)) ⋙ (wordInclude ![(a*b),d,e] 0 ⋙ Pi.eval _ (1:Fin 3)) + rw [wordInclude_proj,ite_eq_right (by decide)] + exact eqToIso (by erw [wordInclude_proj,ite_eq_right (by decide)]; rfl) + · refine ⟨?_⟩ + change wordInclude ![a,b,d,e] 0 ⋙ (Pi.eval _ (3:Fin 4)) ≅ + (translate b a (a*b) (mul_comm _ _)) ⋙ (wordInclude ![(a*b),d,e] 0 ⋙ Pi.eval _ (2:Fin 3)) + rw [wordInclude_proj,ite_eq_right (by decide)] + exact eqToIso (by erw [wordInclude_proj,ite_eq_right (by decide)]; rfl) + ) + exact hh +omit [SymmetricCategory C] in +@[reassoc] lemma face_4_0_2 (a b d e:Skeleton C) : + primitive ![a,b,d,e] 0 ≫ NerveHomology.map (reindex (SimplexCategory.δ (2:Fin 5)).toOrderHom) 1 = + primitive ![a,(b*d),e] 0 := by + have hh := face_recognition ![a,b,d,e] 0 2 ![a,(b*d),e] 0 (𝟭 (Fiber a)) (by + intro j + apply Classical.choice + fin_cases j + · refine ⟨?_⟩ + change wordInclude ![a,b,d,e] 0 ⋙ (Pi.eval _ (0:Fin 4)) ≅ + (𝟭 (Fiber a)) ⋙ (wordInclude ![a,(b*d),e] 0 ⋙ Pi.eval _ (0:Fin 3)) + rw [wordInclude_proj,ite_eq_left rfl] + exact eqToIso (by erw [wordInclude_proj,ite_eq_left rfl]; rfl) + · refine ⟨?_⟩ + change wordInclude ![a,b,d,e] 0 ⋙ (pairAt (1:Fin 4) (2:Fin 4)) ≅ + (𝟭 (Fiber a)) ⋙ (wordInclude ![a,(b*d),e] 0 ⋙ Pi.eval _ (1:Fin 3)) + erw [wordInclude_proj,ite_eq_right (by decide)] + exact wordPair_other ![a,b,d,e] 1 2 0 (by decide) (by decide) ≪≫ + (Functor.const (Fiber a)).mapIso (reprMul b d) + · refine ⟨?_⟩ + change wordInclude ![a,b,d,e] 0 ⋙ (Pi.eval _ (3:Fin 4)) ≅ + (𝟭 (Fiber a)) ⋙ (wordInclude ![a,(b*d),e] 0 ⋙ Pi.eval _ (2:Fin 3)) + rw [wordInclude_proj,ite_eq_right (by decide)] + exact eqToIso (by erw [wordInclude_proj,ite_eq_right (by decide)]; rfl) + ) + erw [NerveHomology.id (D:=Fiber a)] at hh + exact hh.trans (Category.id_comp _) +omit [SymmetricCategory C] in +@[reassoc] lemma face_4_0_3 (a b d e:Skeleton C) : + primitive ![a,b,d,e] 0 ≫ NerveHomology.map (reindex (SimplexCategory.δ (3:Fin 5)).toOrderHom) 1 = + primitive ![a,b,(d*e)] 0 := by + have hh := face_recognition ![a,b,d,e] 0 3 ![a,b,(d*e)] 0 (𝟭 (Fiber a)) (by + intro j + apply Classical.choice + fin_cases j + · refine ⟨?_⟩ + change wordInclude ![a,b,d,e] 0 ⋙ (Pi.eval _ (0:Fin 4)) ≅ + (𝟭 (Fiber a)) ⋙ (wordInclude ![a,b,(d*e)] 0 ⋙ Pi.eval _ (0:Fin 3)) + rw [wordInclude_proj,ite_eq_left rfl] + exact eqToIso (by erw [wordInclude_proj,ite_eq_left rfl]; rfl) + · refine ⟨?_⟩ + change wordInclude ![a,b,d,e] 0 ⋙ (Pi.eval _ (1:Fin 4)) ≅ + (𝟭 (Fiber a)) ⋙ (wordInclude ![a,b,(d*e)] 0 ⋙ Pi.eval _ (1:Fin 3)) + rw [wordInclude_proj,ite_eq_right (by decide)] + exact eqToIso (by erw [wordInclude_proj,ite_eq_right (by decide)]; rfl) + · refine ⟨?_⟩ + change wordInclude ![a,b,d,e] 0 ⋙ (pairAt (2:Fin 4) (3:Fin 4)) ≅ + (𝟭 (Fiber a)) ⋙ (wordInclude ![a,b,(d*e)] 0 ⋙ Pi.eval _ (2:Fin 3)) + erw [wordInclude_proj,ite_eq_right (by decide)] + exact wordPair_other ![a,b,d,e] 2 3 0 (by decide) (by decide) ≪≫ + (Functor.const (Fiber a)).mapIso (reprMul d e) + ) + erw [NerveHomology.id (D:=Fiber a)] at hh + exact hh.trans (Category.id_comp _) +omit [SymmetricCategory C] in +@[reassoc] lemma face_4_0_4 (a b d e:Skeleton C) : + primitive ![a,b,d,e] 0 ≫ NerveHomology.map (reindex (SimplexCategory.δ (4:Fin 5)).toOrderHom) 1 = + primitive ![a,b,d] 0 := by + have hh := face_recognition ![a,b,d,e] 0 4 ![a,b,d] 0 (𝟭 (Fiber a)) (by + intro j + apply Classical.choice + fin_cases j + · refine ⟨?_⟩ + change wordInclude ![a,b,d,e] 0 ⋙ (Pi.eval _ (0:Fin 4)) ≅ + (𝟭 (Fiber a)) ⋙ (wordInclude ![a,b,d] 0 ⋙ Pi.eval _ (0:Fin 3)) + rw [wordInclude_proj,ite_eq_left rfl] + exact eqToIso (by erw [wordInclude_proj,ite_eq_left rfl]; rfl) + · refine ⟨?_⟩ + change wordInclude ![a,b,d,e] 0 ⋙ (Pi.eval _ (1:Fin 4)) ≅ + (𝟭 (Fiber a)) ⋙ (wordInclude ![a,b,d] 0 ⋙ Pi.eval _ (1:Fin 3)) + rw [wordInclude_proj,ite_eq_right (by decide)] + exact eqToIso (by erw [wordInclude_proj,ite_eq_right (by decide)]; rfl) + · refine ⟨?_⟩ + change wordInclude ![a,b,d,e] 0 ⋙ (Pi.eval _ (2:Fin 4)) ≅ + (𝟭 (Fiber a)) ⋙ (wordInclude ![a,b,d] 0 ⋙ Pi.eval _ (2:Fin 3)) + rw [wordInclude_proj,ite_eq_right (by decide)] + exact eqToIso (by erw [wordInclude_proj,ite_eq_right (by decide)]; rfl) + ) + erw [NerveHomology.id (D:=Fiber a)] at hh + exact hh.trans (Category.id_comp _) + +end MarkedH1 +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/Face410.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/Face410.lean new file mode 100644 index 0000000000000000000000000000000000000000..1d71f3026d27c26ffa7d16cc129402614913bd64 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/Face410.lean @@ -0,0 +1,361 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.Id + +namespace OAI + +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits MonoidalCategory Simplicial Opposite +namespace MarkedH1 +open FreeChains ComponentTranslation IntervalBar.Diagram NerveHomology +variable {C:Type} [Groupoid.{0} C] [MonoidalCategory C] [SymmetricCategory C] +omit [SymmetricCategory C] in +@[reassoc] lemma face_4_1_0 (a b d e:Skeleton C) : + primitive ![a,b,d,e] 1 ≫ NerveHomology.map (reindex (SimplexCategory.δ (0:Fin 5)).toOrderHom) 1 = + primitive ![b,d,e] 0 := by + have hh := face_recognition ![a,b,d,e] 1 0 ![b,d,e] 0 (𝟭 (Fiber b)) (by + intro j + apply Classical.choice + fin_cases j + · refine ⟨?_⟩ + change wordInclude ![a,b,d,e] 1 ⋙ (Pi.eval _ (1:Fin 4)) ≅ + (𝟭 (Fiber b)) ⋙ (wordInclude ![b,d,e] 0 ⋙ Pi.eval _ (0:Fin 3)) + erw [wordInclude_proj,ite_eq_left rfl] + · refine ⟨?_⟩ + change wordInclude ![a,b,d,e] 1 ⋙ (Pi.eval _ (2:Fin 4)) ≅ + (𝟭 (Fiber b)) ⋙ (wordInclude ![b,d,e] 0 ⋙ Pi.eval _ (1:Fin 3)) + erw [wordInclude_proj,ite_eq_right (by decide)] + · refine ⟨?_⟩ + change wordInclude ![a,b,d,e] 1 ⋙ (Pi.eval _ (3:Fin 4)) ≅ + (𝟭 (Fiber b)) ⋙ (wordInclude ![b,d,e] 0 ⋙ Pi.eval _ (2:Fin 3)) + erw [wordInclude_proj,ite_eq_right (by decide)] + ) + erw [NerveHomology.id (D:=Fiber b)] at hh + exact hh.trans (Category.id_comp _) +omit [SymmetricCategory C] in +@[reassoc] lemma face_4_1_1 (a b d e:Skeleton C) : + primitive ![a,b,d,e] 1 ≫ NerveHomology.map (reindex (SimplexCategory.δ (1:Fin 5)).toOrderHom) 1 = + NerveHomology.map (translate a b (a*b) rfl) 1 ≫ primitive ![(a*b),d,e] 0 := by + have hh := face_recognition ![a,b,d,e] 1 1 ![(a*b),d,e] 0 (translate a b (a*b) rfl) (by + intro j + apply Classical.choice + fin_cases j + · refine ⟨?_⟩ + change wordInclude ![a,b,d,e] 1 ⋙ (pairAt (0:Fin 4) (1:Fin 4)) ≅ + (translate a b (a*b) rfl) ⋙ (wordInclude ![(a*b),d,e] 0 ⋙ Pi.eval _ (0:Fin 3)) + erw [wordInclude_proj,ite_eq_left rfl] + exact wordPair_right ![a,b,d,e] 0 1 (by decide) + · refine ⟨?_⟩ + change wordInclude ![a,b,d,e] 1 ⋙ (Pi.eval _ (2:Fin 4)) ≅ + (translate a b (a*b) rfl) ⋙ (wordInclude ![(a*b),d,e] 0 ⋙ Pi.eval _ (1:Fin 3)) + erw [wordInclude_proj,ite_eq_right (by decide)] + · refine ⟨?_⟩ + change wordInclude ![a,b,d,e] 1 ⋙ (Pi.eval _ (3:Fin 4)) ≅ + (translate a b (a*b) rfl) ⋙ (wordInclude ![(a*b),d,e] 0 ⋙ Pi.eval _ (2:Fin 3)) + erw [wordInclude_proj,ite_eq_right (by decide)] + ) + exact hh +@[reassoc] lemma face_4_1_2 (a b d e:Skeleton C) : + primitive ![a,b,d,e] 1 ≫ NerveHomology.map (reindex (SimplexCategory.δ (2:Fin 5)).toOrderHom) 1 = + NerveHomology.map (translate d b (b*d) (mul_comm _ _)) 1 ≫ primitive ![a,(b*d),e] 1 := by + have hh := face_recognition ![a,b,d,e] 1 2 ![a,(b*d),e] 1 (translate d b (b*d) (mul_comm _ _)) (by + intro j + apply Classical.choice + fin_cases j + · refine ⟨?_⟩ + change wordInclude ![a,b,d,e] 1 ⋙ (Pi.eval _ (0:Fin 4)) ≅ + (translate d b (b*d) (mul_comm _ _)) ⋙ (wordInclude ![a,(b*d),e] 1 ⋙ Pi.eval _ (0:Fin 3)) + erw [wordInclude_proj,ite_eq_right (by decide)] + · refine ⟨?_⟩ + change wordInclude ![a,b,d,e] 1 ⋙ (pairAt (1:Fin 4) (2:Fin 4)) ≅ + (translate d b (b*d) (mul_comm _ _)) ⋙ (wordInclude ![a,(b*d),e] 1 ⋙ Pi.eval _ (1:Fin 3)) + erw [wordInclude_proj,ite_eq_left rfl] + exact wordPair_left ![a,b,d,e] 1 2 (by decide) ≪≫ + Functor.isoWhiskerLeft (property b).ι + (BraidedCategory.tensorLeftIsoTensorRight (repr d)).symm + · refine ⟨?_⟩ + change wordInclude ![a,b,d,e] 1 ⋙ (Pi.eval _ (3:Fin 4)) ≅ + (translate d b (b*d) (mul_comm _ _)) ⋙ (wordInclude ![a,(b*d),e] 1 ⋙ Pi.eval _ (2:Fin 3)) + erw [wordInclude_proj,ite_eq_right (by decide)] + ) + exact hh +omit [SymmetricCategory C] in +@[reassoc] lemma face_4_1_3 (a b d e:Skeleton C) : + primitive ![a,b,d,e] 1 ≫ NerveHomology.map (reindex (SimplexCategory.δ (3:Fin 5)).toOrderHom) 1 = + primitive ![a,b,(d*e)] 1 := by + have hh := face_recognition ![a,b,d,e] 1 3 ![a,b,(d*e)] 1 (𝟭 (Fiber b)) (by + intro j + apply Classical.choice + fin_cases j + · refine ⟨?_⟩ + change wordInclude ![a,b,d,e] 1 ⋙ (Pi.eval _ (0:Fin 4)) ≅ + (𝟭 (Fiber b)) ⋙ (wordInclude ![a,b,(d*e)] 1 ⋙ Pi.eval _ (0:Fin 3)) + erw [wordInclude_proj,ite_eq_right (by decide)] + · refine ⟨?_⟩ + change wordInclude ![a,b,d,e] 1 ⋙ (Pi.eval _ (1:Fin 4)) ≅ + (𝟭 (Fiber b)) ⋙ (wordInclude ![a,b,(d*e)] 1 ⋙ Pi.eval _ (1:Fin 3)) + erw [wordInclude_proj,ite_eq_left rfl] + · refine ⟨?_⟩ + change wordInclude ![a,b,d,e] 1 ⋙ (pairAt (2:Fin 4) (3:Fin 4)) ≅ + (𝟭 (Fiber b)) ⋙ (wordInclude ![a,b,(d*e)] 1 ⋙ Pi.eval _ (2:Fin 3)) + erw [wordInclude_proj,ite_eq_right (by decide)] + exact wordPair_other ![a,b,d,e] 2 3 1 (by decide) (by decide) ≪≫ + (Functor.const (Fiber b)).mapIso (reprMul d e) + ) + erw [NerveHomology.id (D:=Fiber b)] at hh + exact hh.trans (Category.id_comp _) +omit [SymmetricCategory C] in +@[reassoc] lemma face_4_1_4 (a b d e:Skeleton C) : + primitive ![a,b,d,e] 1 ≫ NerveHomology.map (reindex (SimplexCategory.δ (4:Fin 5)).toOrderHom) 1 = + primitive ![a,b,d] 1 := by + have hh := face_recognition ![a,b,d,e] 1 4 ![a,b,d] 1 (𝟭 (Fiber b)) (by + intro j + apply Classical.choice + fin_cases j + · refine ⟨?_⟩ + change wordInclude ![a,b,d,e] 1 ⋙ (Pi.eval _ (0:Fin 4)) ≅ + (𝟭 (Fiber b)) ⋙ (wordInclude ![a,b,d] 1 ⋙ Pi.eval _ (0:Fin 3)) + erw [wordInclude_proj,ite_eq_right (by decide)] + · refine ⟨?_⟩ + change wordInclude ![a,b,d,e] 1 ⋙ (Pi.eval _ (1:Fin 4)) ≅ + (𝟭 (Fiber b)) ⋙ (wordInclude ![a,b,d] 1 ⋙ Pi.eval _ (1:Fin 3)) + erw [wordInclude_proj,ite_eq_left rfl] + · refine ⟨?_⟩ + change wordInclude ![a,b,d,e] 1 ⋙ (Pi.eval _ (2:Fin 4)) ≅ + (𝟭 (Fiber b)) ⋙ (wordInclude ![a,b,d] 1 ⋙ Pi.eval _ (2:Fin 3)) + erw [wordInclude_proj,ite_eq_right (by decide)] + ) + erw [NerveHomology.id (D:=Fiber b)] at hh + exact hh.trans (Category.id_comp _) +omit [SymmetricCategory C] in +@[reassoc] lemma face_4_2_0 (a b d e:Skeleton C) : + primitive ![a,b,d,e] 2 ≫ NerveHomology.map (reindex (SimplexCategory.δ (0:Fin 5)).toOrderHom) 1 = + primitive ![b,d,e] 1 := by + have hh := face_recognition ![a,b,d,e] 2 0 ![b,d,e] 1 (𝟭 (Fiber d)) (by + intro j + apply Classical.choice + fin_cases j + · refine ⟨?_⟩ + change wordInclude ![a,b,d,e] 2 ⋙ (Pi.eval _ (1:Fin 4)) ≅ + (𝟭 (Fiber d)) ⋙ (wordInclude ![b,d,e] 1 ⋙ Pi.eval _ (0:Fin 3)) + erw [wordInclude_proj,ite_eq_right (by decide)] + · refine ⟨?_⟩ + change wordInclude ![a,b,d,e] 2 ⋙ (Pi.eval _ (2:Fin 4)) ≅ + (𝟭 (Fiber d)) ⋙ (wordInclude ![b,d,e] 1 ⋙ Pi.eval _ (1:Fin 3)) + erw [wordInclude_proj,ite_eq_left rfl] + · refine ⟨?_⟩ + change wordInclude ![a,b,d,e] 2 ⋙ (Pi.eval _ (3:Fin 4)) ≅ + (𝟭 (Fiber d)) ⋙ (wordInclude ![b,d,e] 1 ⋙ Pi.eval _ (2:Fin 3)) + erw [wordInclude_proj,ite_eq_right (by decide)] + ) + erw [NerveHomology.id (D:=Fiber d)] at hh + exact hh.trans (Category.id_comp _) +omit [SymmetricCategory C] in +@[reassoc] lemma face_4_2_1 (a b d e:Skeleton C) : + primitive ![a,b,d,e] 2 ≫ NerveHomology.map (reindex (SimplexCategory.δ (1:Fin 5)).toOrderHom) 1 = + primitive ![(a*b),d,e] 1 := by + have hh := face_recognition ![a,b,d,e] 2 1 ![(a*b),d,e] 1 (𝟭 (Fiber d)) (by + intro j + apply Classical.choice + fin_cases j + · refine ⟨?_⟩ + change wordInclude ![a,b,d,e] 2 ⋙ (pairAt (0:Fin 4) (1:Fin 4)) ≅ + (𝟭 (Fiber d)) ⋙ (wordInclude ![(a*b),d,e] 1 ⋙ Pi.eval _ (0:Fin 3)) + erw [wordInclude_proj,ite_eq_right (by decide)] + exact wordPair_other ![a,b,d,e] 0 1 2 (by decide) (by decide) ≪≫ + (Functor.const (Fiber d)).mapIso (reprMul a b) + · refine ⟨?_⟩ + change wordInclude ![a,b,d,e] 2 ⋙ (Pi.eval _ (2:Fin 4)) ≅ + (𝟭 (Fiber d)) ⋙ (wordInclude ![(a*b),d,e] 1 ⋙ Pi.eval _ (1:Fin 3)) + erw [wordInclude_proj,ite_eq_left rfl] + · refine ⟨?_⟩ + change wordInclude ![a,b,d,e] 2 ⋙ (Pi.eval _ (3:Fin 4)) ≅ + (𝟭 (Fiber d)) ⋙ (wordInclude ![(a*b),d,e] 1 ⋙ Pi.eval _ (2:Fin 3)) + erw [wordInclude_proj,ite_eq_right (by decide)] + ) + erw [NerveHomology.id (D:=Fiber d)] at hh + exact hh.trans (Category.id_comp _) +omit [SymmetricCategory C] in +@[reassoc] lemma face_4_2_2 (a b d e:Skeleton C) : + primitive ![a,b,d,e] 2 ≫ NerveHomology.map (reindex (SimplexCategory.δ (2:Fin 5)).toOrderHom) 1 = + NerveHomology.map (translate b d (b*d) rfl) 1 ≫ primitive ![a,(b*d),e] 1 := by + have hh := face_recognition ![a,b,d,e] 2 2 ![a,(b*d),e] 1 (translate b d (b*d) rfl) (by + intro j + apply Classical.choice + fin_cases j + · refine ⟨?_⟩ + change wordInclude ![a,b,d,e] 2 ⋙ (Pi.eval _ (0:Fin 4)) ≅ + (translate b d (b*d) rfl) ⋙ (wordInclude ![a,(b*d),e] 1 ⋙ Pi.eval _ (0:Fin 3)) + erw [wordInclude_proj,ite_eq_right (by decide)] + · refine ⟨?_⟩ + change wordInclude ![a,b,d,e] 2 ⋙ (pairAt (1:Fin 4) (2:Fin 4)) ≅ + (translate b d (b*d) rfl) ⋙ (wordInclude ![a,(b*d),e] 1 ⋙ Pi.eval _ (1:Fin 3)) + erw [wordInclude_proj,ite_eq_left rfl] + exact wordPair_right ![a,b,d,e] 1 2 (by decide) + · refine ⟨?_⟩ + change wordInclude ![a,b,d,e] 2 ⋙ (Pi.eval _ (3:Fin 4)) ≅ + (translate b d (b*d) rfl) ⋙ (wordInclude ![a,(b*d),e] 1 ⋙ Pi.eval _ (2:Fin 3)) + erw [wordInclude_proj,ite_eq_right (by decide)] + ) + exact hh +@[reassoc] lemma face_4_2_3 (a b d e:Skeleton C) : + primitive ![a,b,d,e] 2 ≫ NerveHomology.map (reindex (SimplexCategory.δ (3:Fin 5)).toOrderHom) 1 = + NerveHomology.map (translate e d (d*e) (mul_comm _ _)) 1 ≫ primitive ![a,b,(d*e)] 2 := by + have hh := face_recognition ![a,b,d,e] 2 3 ![a,b,(d*e)] 2 (translate e d (d*e) (mul_comm _ _)) (by + intro j + apply Classical.choice + fin_cases j + · refine ⟨?_⟩ + change wordInclude ![a,b,d,e] 2 ⋙ (Pi.eval _ (0:Fin 4)) ≅ + (translate e d (d*e) (mul_comm _ _)) ⋙ (wordInclude ![a,b,(d*e)] 2 ⋙ Pi.eval _ (0:Fin 3)) + erw [wordInclude_proj,ite_eq_right (by decide)] + · refine ⟨?_⟩ + change wordInclude ![a,b,d,e] 2 ⋙ (Pi.eval _ (1:Fin 4)) ≅ + (translate e d (d*e) (mul_comm _ _)) ⋙ (wordInclude ![a,b,(d*e)] 2 ⋙ Pi.eval _ (1:Fin 3)) + erw [wordInclude_proj,ite_eq_right (by decide)] + · refine ⟨?_⟩ + change wordInclude ![a,b,d,e] 2 ⋙ (pairAt (2:Fin 4) (3:Fin 4)) ≅ + (translate e d (d*e) (mul_comm _ _)) ⋙ (wordInclude ![a,b,(d*e)] 2 ⋙ Pi.eval _ (2:Fin 3)) + erw [wordInclude_proj,ite_eq_left rfl] + exact wordPair_left ![a,b,d,e] 2 3 (by decide) ≪≫ + Functor.isoWhiskerLeft (property d).ι + (BraidedCategory.tensorLeftIsoTensorRight (repr e)).symm + ) + exact hh +omit [SymmetricCategory C] in +@[reassoc] lemma face_4_2_4 (a b d e:Skeleton C) : + primitive ![a,b,d,e] 2 ≫ NerveHomology.map (reindex (SimplexCategory.δ (4:Fin 5)).toOrderHom) 1 = + primitive ![a,b,d] 2 := by + have hh := face_recognition ![a,b,d,e] 2 4 ![a,b,d] 2 (𝟭 (Fiber d)) (by + intro j + apply Classical.choice + fin_cases j + · refine ⟨?_⟩ + change wordInclude ![a,b,d,e] 2 ⋙ (Pi.eval _ (0:Fin 4)) ≅ + (𝟭 (Fiber d)) ⋙ (wordInclude ![a,b,d] 2 ⋙ Pi.eval _ (0:Fin 3)) + erw [wordInclude_proj,ite_eq_right (by decide)] + · refine ⟨?_⟩ + change wordInclude ![a,b,d,e] 2 ⋙ (Pi.eval _ (1:Fin 4)) ≅ + (𝟭 (Fiber d)) ⋙ (wordInclude ![a,b,d] 2 ⋙ Pi.eval _ (1:Fin 3)) + erw [wordInclude_proj,ite_eq_right (by decide)] + · refine ⟨?_⟩ + change wordInclude ![a,b,d,e] 2 ⋙ (Pi.eval _ (2:Fin 4)) ≅ + (𝟭 (Fiber d)) ⋙ (wordInclude ![a,b,d] 2 ⋙ Pi.eval _ (2:Fin 3)) + erw [wordInclude_proj,ite_eq_left rfl] + ) + erw [NerveHomology.id (D:=Fiber d)] at hh + exact hh.trans (Category.id_comp _) +omit [SymmetricCategory C] in +@[reassoc] lemma face_4_3_0 (a b d e:Skeleton C) : + primitive ![a,b,d,e] 3 ≫ NerveHomology.map (reindex (SimplexCategory.δ (0:Fin 5)).toOrderHom) 1 = + primitive ![b,d,e] 2 := by + have hh := face_recognition ![a,b,d,e] 3 0 ![b,d,e] 2 (𝟭 (Fiber e)) (by + intro j + apply Classical.choice + fin_cases j + · refine ⟨?_⟩ + change wordInclude ![a,b,d,e] 3 ⋙ (Pi.eval _ (1:Fin 4)) ≅ + (𝟭 (Fiber e)) ⋙ (wordInclude ![b,d,e] 2 ⋙ Pi.eval _ (0:Fin 3)) + erw [wordInclude_proj,ite_eq_right (by decide)] + · refine ⟨?_⟩ + change wordInclude ![a,b,d,e] 3 ⋙ (Pi.eval _ (2:Fin 4)) ≅ + (𝟭 (Fiber e)) ⋙ (wordInclude ![b,d,e] 2 ⋙ Pi.eval _ (1:Fin 3)) + erw [wordInclude_proj,ite_eq_right (by decide)] + · refine ⟨?_⟩ + change wordInclude ![a,b,d,e] 3 ⋙ (Pi.eval _ (3:Fin 4)) ≅ + (𝟭 (Fiber e)) ⋙ (wordInclude ![b,d,e] 2 ⋙ Pi.eval _ (2:Fin 3)) + erw [wordInclude_proj,ite_eq_left rfl] + ) + erw [NerveHomology.id (D:=Fiber e)] at hh + exact hh.trans (Category.id_comp _) +omit [SymmetricCategory C] in +@[reassoc] lemma face_4_3_1 (a b d e:Skeleton C) : + primitive ![a,b,d,e] 3 ≫ NerveHomology.map (reindex (SimplexCategory.δ (1:Fin 5)).toOrderHom) 1 = + primitive ![(a*b),d,e] 2 := by + have hh := face_recognition ![a,b,d,e] 3 1 ![(a*b),d,e] 2 (𝟭 (Fiber e)) (by + intro j + apply Classical.choice + fin_cases j + · refine ⟨?_⟩ + change wordInclude ![a,b,d,e] 3 ⋙ (pairAt (0:Fin 4) (1:Fin 4)) ≅ + (𝟭 (Fiber e)) ⋙ (wordInclude ![(a*b),d,e] 2 ⋙ Pi.eval _ (0:Fin 3)) + erw [wordInclude_proj,ite_eq_right (by decide)] + exact wordPair_other ![a,b,d,e] 0 1 3 (by decide) (by decide) ≪≫ + (Functor.const (Fiber e)).mapIso (reprMul a b) + · refine ⟨?_⟩ + change wordInclude ![a,b,d,e] 3 ⋙ (Pi.eval _ (2:Fin 4)) ≅ + (𝟭 (Fiber e)) ⋙ (wordInclude ![(a*b),d,e] 2 ⋙ Pi.eval _ (1:Fin 3)) + erw [wordInclude_proj,ite_eq_right (by decide)] + · refine ⟨?_⟩ + change wordInclude ![a,b,d,e] 3 ⋙ (Pi.eval _ (3:Fin 4)) ≅ + (𝟭 (Fiber e)) ⋙ (wordInclude ![(a*b),d,e] 2 ⋙ Pi.eval _ (2:Fin 3)) + erw [wordInclude_proj,ite_eq_left rfl] + ) + erw [NerveHomology.id (D:=Fiber e)] at hh + exact hh.trans (Category.id_comp _) +omit [SymmetricCategory C] in +@[reassoc] lemma face_4_3_2 (a b d e:Skeleton C) : + primitive ![a,b,d,e] 3 ≫ NerveHomology.map (reindex (SimplexCategory.δ (2:Fin 5)).toOrderHom) 1 = + primitive ![a,(b*d),e] 2 := by + have hh := face_recognition ![a,b,d,e] 3 2 ![a,(b*d),e] 2 (𝟭 (Fiber e)) (by + intro j + apply Classical.choice + fin_cases j + · refine ⟨?_⟩ + change wordInclude ![a,b,d,e] 3 ⋙ (Pi.eval _ (0:Fin 4)) ≅ + (𝟭 (Fiber e)) ⋙ (wordInclude ![a,(b*d),e] 2 ⋙ Pi.eval _ (0:Fin 3)) + erw [wordInclude_proj,ite_eq_right (by decide)] + · refine ⟨?_⟩ + change wordInclude ![a,b,d,e] 3 ⋙ (pairAt (1:Fin 4) (2:Fin 4)) ≅ + (𝟭 (Fiber e)) ⋙ (wordInclude ![a,(b*d),e] 2 ⋙ Pi.eval _ (1:Fin 3)) + erw [wordInclude_proj,ite_eq_right (by decide)] + exact wordPair_other ![a,b,d,e] 1 2 3 (by decide) (by decide) ≪≫ + (Functor.const (Fiber e)).mapIso (reprMul b d) + · refine ⟨?_⟩ + change wordInclude ![a,b,d,e] 3 ⋙ (Pi.eval _ (3:Fin 4)) ≅ + (𝟭 (Fiber e)) ⋙ (wordInclude ![a,(b*d),e] 2 ⋙ Pi.eval _ (2:Fin 3)) + erw [wordInclude_proj,ite_eq_left rfl] + ) + erw [NerveHomology.id (D:=Fiber e)] at hh + exact hh.trans (Category.id_comp _) +omit [SymmetricCategory C] in +@[reassoc] lemma face_4_3_3 (a b d e:Skeleton C) : + primitive ![a,b,d,e] 3 ≫ NerveHomology.map (reindex (SimplexCategory.δ (3:Fin 5)).toOrderHom) 1 = + NerveHomology.map (translate d e (d*e) rfl) 1 ≫ primitive ![a,b,(d*e)] 2 := by + have hh := face_recognition ![a,b,d,e] 3 3 ![a,b,(d*e)] 2 (translate d e (d*e) rfl) (by + intro j + apply Classical.choice + fin_cases j + · refine ⟨?_⟩ + change wordInclude ![a,b,d,e] 3 ⋙ (Pi.eval _ (0:Fin 4)) ≅ + (translate d e (d*e) rfl) ⋙ (wordInclude ![a,b,(d*e)] 2 ⋙ Pi.eval _ (0:Fin 3)) + erw [wordInclude_proj,ite_eq_right (by decide)] + · refine ⟨?_⟩ + change wordInclude ![a,b,d,e] 3 ⋙ (Pi.eval _ (1:Fin 4)) ≅ + (translate d e (d*e) rfl) ⋙ (wordInclude ![a,b,(d*e)] 2 ⋙ Pi.eval _ (1:Fin 3)) + erw [wordInclude_proj,ite_eq_right (by decide)] + · refine ⟨?_⟩ + change wordInclude ![a,b,d,e] 3 ⋙ (pairAt (2:Fin 4) (3:Fin 4)) ≅ + (translate d e (d*e) rfl) ⋙ (wordInclude ![a,b,(d*e)] 2 ⋙ Pi.eval _ (2:Fin 3)) + erw [wordInclude_proj,ite_eq_left rfl] + exact wordPair_right ![a,b,d,e] 2 3 (by decide) + ) + exact hh +omit [SymmetricCategory C] in +@[reassoc] lemma face_4_3_4 (a b d e:Skeleton C) : + primitive ![a,b,d,e] 3 ≫ NerveHomology.map (reindex (SimplexCategory.δ (4:Fin 5)).toOrderHom) 1 = + 0 := by + apply face_recognition_const ![a,b,d,e] 3 4 (fun j=>repr (![a,b,d] j)) + intro j + apply Classical.choice + fin_cases j + · refine ⟨?_⟩ + change wordInclude ![a,b,d,e] 3 ⋙ (Pi.eval _ (0:Fin 4)) ≅ (Functor.const (Fiber e)).obj (repr a) + exact eqToIso (by erw [wordInclude_proj,ite_eq_right (by decide)]; rfl) + · refine ⟨?_⟩ + change wordInclude ![a,b,d,e] 3 ⋙ (Pi.eval _ (1:Fin 4)) ≅ (Functor.const (Fiber e)).obj (repr b) + exact eqToIso (by erw [wordInclude_proj,ite_eq_right (by decide)]; rfl) + · refine ⟨?_⟩ + change wordInclude ![a,b,d,e] 3 ⋙ (Pi.eval _ (2:Fin 4)) ≅ (Functor.const (Fiber e)).obj (repr d) + exact eqToIso (by erw [wordInclude_proj,ite_eq_right (by decide)]; rfl) +end MarkedH1 + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/FiberSumHomology.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/FiberSumHomology.lean new file mode 100644 index 0000000000000000000000000000000000000000..cc514291019127ab0d8e75b356b36b8b995f245d --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/FiberSumHomology.lean @@ -0,0 +1,69 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.StageHomologyCoordinates +import OAI.GroupTheory.SimpleAmenable.Configurations.FiberAddition + +namespace OAI + +section + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits MonoidalCategory +namespace SimpleAmenable.PolygonObject.FiniteSetGroupoid +open BarFiberProduct IntervalBar.Diagram BarFinitePower FreeChains +open LabelledStage.Stage + +attribute [local instance 1200] Pi.module Prod.instModule +noncomputable def fiberCoordinates (j:ℕ) : + (bar₃ (C:=Bool→FiniteSetGroupoid)).homology Z j ⟶ ModuleCat.of ℤ (Bool→K j) := + SSet.homologyMap (triplePowerComparison Bool) Z j ≫ coordinates Bool E j +lemma fiberCoordinates_isIso (j:ℕ) (hj:0 rfl +lemma merge_insert_homology (b:Bool) (j:ℕ) (x:K j) : + SSet.homologyMap (bar₃Map merge) Z j + (SSet.homologyMap (bar₃Map (insertFiber b)) Z j x) = x := by + change (SSet.homologyMap (bar₃Map (insertFiber b)) Z j ≫ + SSet.homologyMap (bar₃Map merge) Z j) x = _ + rw [←SSet.homologyMap_comp,←bar₃Map_comp, + bar₃Map_eq_of_monoidalNatTrans (mergeInsertIso b).hom j,bar₃Map_id_homology] + rfl + +lemma merge_homology_addition (j:ℕ) (hj:0 simp [fiberCoordinates_insert _ _ j hj] + rw [hx,map_add,merge_insert_homology,merge_insert_homology] + simp only [map_add,Pi.add_apply,fiberCoordinates_insert _ _ j hj] + simp +end SimpleAmenable.PolygonObject.FiniteSetGroupoid + +end + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/FilteredEdgeReturn.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/FilteredEdgeReturn.lean new file mode 100644 index 0000000000000000000000000000000000000000..6d0489be27b9039738a89150b3d0c3c9e2dae434 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/FilteredEdgeReturn.lean @@ -0,0 +1,158 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.RegularTotalDifferential + +namespace OAI + +section +namespace FilteredEdge.Data +open FilteredFiniteness + +universe u +variable {R : Type u} [CommRing R] [IsNoetherianRing R] +variable {D A B C : Type u} [AddCommGroup D] [Module R D] + [AddCommGroup A] [Module R A] [AddCommGroup B] [Module R B] + [AddCommGroup C] [Module R C] +variable (K : FilteredEdge.Data (R:=R) (D:=D) (A:=A) (B:=B) (C:=C)) +variable (p : ℤ) (hp : K.FC (p-2)=⊥) +def edgeCycles : K.current.Z₂ p →ₗ[R] LinearMap.ker K.current.e := + (K.current.Z₂ p).subtype.codRestrict _ (fun x => by + have hx := x.property.2 + change K.e x.val∈K.FC (p-2) at hx + rw [hp] at hx + exact hx) +def edgeLift : K.current.Z₂ p →ₗ[R] K.current.H ⧸ K.current.filtration (p-1) := + (K.current.filtration (p-1)).mkQ.comp (K.current.π.comp (K.edgeCycles p hp)) +omit [IsNoetherianRing R] in +lemma boundary_in_edge_kernel : + (K.current.B₂ p).comap (K.current.Z₂ p).subtype ≤ LinearMap.ker (K.edgeLift p hp) := by + intro x hx + obtain ⟨y,hy,z,hz,hyz⟩ := Submodule.mem_sup.mp hx + obtain ⟨a,ha,haz⟩ := hz.1 + change y+z=x.val at hyz + change K.d a=z at haz + have hez : K.e z=0 := by + rw [←haz]; exact congrArg (fun f : A →ₗ[R] C => f a) K.ed + have hex : K.e x.val=0 := (K.edgeCycles p hp x).property + have hey : K.e y=0 := by + rw [←hyz,map_add,hez,add_zero] at hex + exact hex + change K.edgeLift p hp x=0 + apply (Submodule.Quotient.mk_eq_zero _).mpr + refine ⟨⟨⟨y,hey⟩,hy.1⟩,?_⟩ + change K.current.π ⟨y,hey⟩=K.current.π (K.edgeCycles p hp x) + apply (Submodule.Quotient.eq _).mpr + refine ⟨-a,?_⟩ + apply Subtype.ext + change K.d (-a)=y-x.val + rw [map_neg,haz,←hyz] + abel +def edgeMap : K.current.E₂ p →ₗ[R] K.current.H ⧸ K.current.filtration (p-1) := + ((K.current.B₂ p).comap (K.current.Z₂ p).subtype).liftQ + (K.edgeLift p hp) (K.boundary_in_edge_kernel p hp) +omit [IsNoetherianRing R] in +lemma edge_kernel_le_tower (N : ℤ) (hN : K.FA N=⊤) : + LinearMap.ker (K.edgeMap p hp) ≤ K.tower p N := by + intro z hz + obtain ⟨x,rfl⟩ := Submodule.mkQ_surjective + ((K.current.B₂ p).comap (K.current.Z₂ p).subtype) z + have hx : K.edgeLift p hp x=0 := hz + have hx' : K.current.π (K.edgeCycles p hp x)∈K.current.filtration (p-1) := + (Submodule.Quotient.mk_eq_zero _).mp hx + obtain ⟨y,hy⟩ := hx' + have hxy : K.current.π (K.edgeCycles p hp x-y.val)=0 := by + rw [map_sub,show K.current.π y.val=K.current.π (K.edgeCycles p hp x) from hy,sub_self] + obtain ⟨a,ha⟩ := (Submodule.Quotient.mk_eq_zero _).mp hxy + have hav : K.d a=x.val-y.val.val := congrArg Subtype.val ha + have had : K.d a∈K.FB p := by + rw [hav] + exact (K.FB p).sub_mem x.property.1 (K.monoB (by omega) y.property) + refine ⟨⟨a,by rw [hN]; trivial,had⟩,?_⟩ + apply (Submodule.Quotient.eq _).mpr + change K.d a-x.val∈K.current.B₂ p + rw [hav,sub_sub_cancel_left] + apply Submodule.mem_sup_left + refine ⟨(K.FB (p-1)).neg_mem y.property,?_⟩ + change K.e (-y.val.val)∈K.FC (p-2) + have hey : K.e y.val.val=0 := y.val.property + rw [map_neg,hey,neg_zero] + exact Submodule.zero_mem _ +include hp in +lemma finite_edge (N : ℤ) (hN : K.FA N=⊤) + [Module.Finite R K.current.H] [Module.Finite R (K.tower p N)] : + Module.Finite R (K.current.E₂ p) := by + let f := K.edgeMap p hp + have : Module.Finite R (LinearMap.ker f) := + Module.Finite.of_injective (Submodule.inclusion (K.edge_kernel_le_tower p hp N hN)) + (Submodule.inclusion_injective _) + have : Module.Finite R (LinearMap.range f) := + Module.Finite.of_injective (LinearMap.range f).subtype Subtype.val_injective + have : Module.Finite R (K.current.E₂ p ⧸ LinearMap.ker f) := + Module.Finite.equiv f.quotKerEquivRange.symm + exact Module.Finite.of_submodule_quotient (LinearMap.ker f) +lemma finite_tower (r : ℕ) + (hfinite : ∀i:ℕ, i rw [Nat.cast_zero,add_zero,K.tower_start]; infer_instance + | succ r ih => + have := ih (fun i hi => hfinite i (by omega)) + have := hfinite r (by omega) + have he : p+(r+1:ℕ)+1=p+r+2 := by push_cast; omega + rw [he] + have : Module.Finite R (K.tower p (p+r+2-1)) := by + rw [show p+(r:ℤ)+2-1=p+r+1 by ring] + exact ih (fun i hi => hfinite i (by omega)) + exact K.finite_tower_step p (p+r+2) (by omega) +end FilteredEdge.Data + +end + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits HomologicalComplex HomologicalComplex₂ +namespace E2Leading +open TotalProjection + +universe u +variable {R : Type u} [CommRing R] +variable (K : HomologicalComplex₂ (ModuleCat.{u} R) c c) +lemma lift_first_cycle (q : ℕ) (y : ConcreteHomology.Cycles (K.X 1) q) + (z : (K.X 0).X (q+1)) (hz : (K.X 0).d (q+1) q z=(K.d 1 0).f q y.val) : + ∃ x : (filteredData K (1+q)).Z₂ 2, projection K 1 q (1+q) x.val=y.val := by + have hw : (K.total c).d (0+q+1) (0+q) (lift K 0 q y.val (-z))=0 := by + apply (Submodule.mem_bot R).mp + rw [←filtration_zero K (0+q)] + apply lower_filtration K 0 q (d_lift_mem K 0 q y (-z)) + rw [d_lift_top,map_neg,hz,add_neg_cancel] + have aux : ∃ x : (filteredData K (0+q+1)).Z₂ 2, + projection K 1 q (0+q+1) x.val=y.val := by + refine ⟨⟨lift K 0 q y.val (-z),lift_mem K 0 q y.val (-z),?_⟩,lift_left K 0 q y.val (-z)⟩ + change (K.total c).d (0+q+1) (0+q+1-1) (lift K 0 q y.val (-z))∈filtration K (0+q+1-1) (2-2) + rw [Nat.add_sub_cancel,hw] + exact Submodule.zero_mem _ + rw [show 1+q=0+q+1 by omega] + exact aux +lemma first_lead_surjective (q : ℕ) : Function.Surjective (lead K 1 q) := by + intro v + obtain ⟨w,rfl⟩ := ConcreteHomology.π_surjective (row K q) 1 v + obtain ⟨y,hy⟩ := ConcreteHomology.π_surjective (K.X 1) q w.val + have hdy : ConcreteHomology.π (K.X 0) q + (ConcreteHomology.cyclesMap (K.d 1 0) q y)=0 := by + rw [←ConcreteHomology.map_π,hy] + exact w.property + obtain ⟨z,hz⟩ := (ConcreteHomology.π_eq_zero _ _ _).mp hdy + have hzv : (K.X 0).d (q+1) q z=(K.d 1 0).f q y.val := by + have h := congrArg Subtype.val hz + change (K.X 0).d (q+1) q z=(K.d 1 0).f q y.val at h + exact h + obtain ⟨x,hx⟩ := lift_first_cycle K q y z hzv + refine ⟨x,?_⟩ + change ConcreteHomology.π (row K q) 1 (topRowCycle K 1 q x)=_ + congr 1 + apply Subtype.ext + change ConcreteHomology.π (K.X 1) q (topCycle K 1 q x)=w.val + rw [show topCycle K 1 q x=y by apply Subtype.ext; exact hx,hy] +end E2Leading + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/FilteredHomology.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/FilteredHomology.lean new file mode 100644 index 0000000000000000000000000000000000000000..fea5c5b8decf131ba7bf1ae2439768450e7c2bc3 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/FilteredHomology.lean @@ -0,0 +1,210 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.StageNerveColimit + +namespace OAI + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory CategoryTheory.Limits +namespace FilteredHomology + +variable {J : Type} [Category.{0} J] [IsFiltered J] +abbrev A := ModuleCat.{0} ℤ +abbrev c := ComplexShape.down ℕ +noncomputable def complex (F : J ⥤ ChainComplex A ℕ) : ChainComplex (J ⥤ A) ℕ where + X i := F ⋙ HomologicalComplex.eval A c i + d i j := { app t := (F.obj t).d i j + naturality _ _ f := (F.map f).comm i j } + shape i j h := by apply NatTrans.ext; funext t; exact (F.obj t).shape i j h + d_comp_d' i j k _ _ := by apply NatTrans.ext; funext t; exact (F.obj t).d_comp_d i j k +noncomputable def injection (j : J) : (evaluation J A).obj j ⟶ colim where + app F := colimit.ι F j + naturality _ _ f := (colimit.ι_map f j).symm +noncomputable def cocone (F : J ⥤ ChainComplex A ℕ) : Cocone F where + pt := (colim.mapHomologicalComplex c).obj (complex F) + ι := { + app j := { + f i := colimit.ι ((complex F).X i) j + comm' i k _ := colimit.ι_map ((complex F).d i k) j } + naturality i j f := by + apply HomologicalComplex.Hom.ext; funext n + exact colimit.w (F ⋙ HomologicalComplex.eval A c n) f } +noncomputable def isColimit (F : J ⥤ ChainComplex A ℕ) : IsColimit (cocone F) := + HomologicalComplex.isColimitOfEval F (cocone F) (fun _ => colimit.isColimit _) +noncomputable def evaluationHomology (F : J ⥤ ChainComplex A ℕ) (n : ℕ) (j:J) : + (F.obj j).homology n ≅ ((complex F).homology n).obj j := + ((complex F).sc n).mapHomologyIso ((evaluation J A).obj j) +noncomputable def colimitHomology (F : J ⥤ ChainComplex A ℕ) (n : ℕ) : + (cocone F).pt.homology n ≅ colimit ((complex F).homology n) := + ((complex F).sc n).mapHomologyIso colim +lemma homology_injection (F : J ⥤ ChainComplex A ℕ) (n : ℕ) (j:J) : + HomologicalComplex.homologyMap ((cocone F).ι.app j) n = + (evaluationHomology F n j).hom ≫ colimit.ι ((complex F).homology n) j ≫ + (colimitHomology F n).inv := + ShortComplex.homologyMap_mapNatTrans ((complex F).sc n) (injection j) +omit [IsFiltered J] in +lemma evaluationHomology_naturality (F : J ⥤ ChainComplex A ℕ) (n : ℕ) {i j:J} (f:i⟶j) : + HomologicalComplex.homologyMap (F.map f) n ≫ (evaluationHomology F n j).hom = + (evaluationHomology F n i).hom ≫ ((complex F).homology n).map f := by + have h := ShortComplex.homologyMap_mapNatTrans ((complex F).sc n) ((evaluation J A).map f) + change HomologicalComplex.homologyMap (F.map f) n = + (evaluationHomology F n i).hom ≫ ((complex F).homology n).map f ≫ + (evaluationHomology F n j).inv at h + rw [h] + simp [Category.assoc] +noncomputable def homologyCocone (F : J ⥤ ChainComplex A ℕ) (n : ℕ) + (d : Cocone (F ⋙ HomologicalComplex.homologyFunctor A c n)) : + Cocone ((complex F).homology n) where + pt := d.pt + ι := { app j := (evaluationHomology F n j).inv ≫ d.ι.app j + naturality i j f := by + have h := evaluationHomology_naturality F n f + rw [←Iso.inv_comp_eq] at h + erw [Category.assoc ((evaluationHomology F n i).inv), ←h] + erw [Category.assoc ((evaluationHomology F n i).inv), + Category.assoc (HomologicalComplex.homologyMap (F.map f) n), + Iso.hom_inv_id_assoc (evaluationHomology F n j)] + simp only [Functor.const_obj_map] + exact congrArg (fun t => (evaluationHomology F n i).inv ≫ t) (d.w f) } +noncomputable def homologyIsColimit (F : J ⥤ ChainComplex A ℕ) (n : ℕ) : + IsColimit ((HomologicalComplex.homologyFunctor A c n).mapCocone (cocone F)) where + desc d := (colimitHomology F n).hom ≫ colimit.desc _ (homologyCocone F n d) + fac d j := by + change HomologicalComplex.homologyMap ((cocone F).ι.app j) n ≫ _ = _ + rw [homology_injection] + erw [Category.assoc (evaluationHomology F n j).hom, + Category.assoc (colimit.ι ((complex F).homology n) j), + Iso.inv_hom_id_assoc (colimitHomology F n), colimit.ι_desc] + change (evaluationHomology F n j).hom ≫ ((evaluationHomology F n j).inv ≫ d.ι.app j) = _ + exact Iso.hom_inv_id_assoc _ _ + uniq d m hm := by + apply (cancel_epi (colimitHomology F n).inv).mp + erw [Iso.inv_hom_id_assoc] + apply colimit.hom_ext + intro j + have h := hm j + change HomologicalComplex.homologyMap ((cocone F).ι.app j) n ≫ m = _ at h + rw [homology_injection] at h + have he := congrArg (fun t => (evaluationHomology F n j).inv ≫ t) h + erw [Category.assoc (evaluationHomology F n j).hom, + Iso.inv_hom_id_assoc (evaluationHomology F n j), + Category.assoc (colimit.ι ((complex F).homology n) j)] at he + erw [colimit.ι_desc] + exact he +noncomputable instance homology_preserves (n : ℕ) : + PreservesColimitsOfShape J (HomologicalComplex.homologyFunctor A c n) where + preservesColimit {F} := preservesColimit_of_preserves_colimit_cocone (isColimit F) (homologyIsColimit F n) +end FilteredHomology + +end + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory CategoryTheory.Limits Opposite Simplicial +namespace FilteredHomology + +variable {J : Type} [Category.{0} J] +noncomputable instance chain_preserves (Z : A) : + PreservesColimitsOfShape J ((SSet.chainComplexFunctor A).obj Z) := by + apply HomologicalComplex.preservesColimitsOfShape_of_eval + intro n + change PreservesColimitsOfShape J ((evaluation SimplexCategoryᵒᵖ (Type)).obj (op ⦋n⦌) ⋙ sigmaConst.obj Z) + infer_instance +noncomputable instance sset_homology_preserves [IsFiltered J] (Z : A) (n:ℕ) : + PreservesColimitsOfShape J (SSet.homologyFunctor Z n) := by + change PreservesColimitsOfShape J (((SSet.chainComplexFunctor A).obj Z) ⋙ + HomologicalComplex.homologyFunctor A c n) + infer_instance +end FilteredHomology +namespace SimpleAmenable.PolygonObject.LabelledStage.Stage +variable {a n : ℕ} + +noncomputable def homologyIsColimit (q:ℕ) : IsColimit + ((SSet.homologyFunctor (ModuleCat.of ℤ ℤ) q).mapCocone (nerveCocone (a:=a) (n:=n))) := + isColimitOfPreserves _ nerveIsColimit + +noncomputable def barHomologyIsColimit (p q:ℕ) : IsColimit + ((SSet.homologyFunctor (ModuleCat.of ℤ ℤ) q).mapCocone + (barNerveCocone (a:=a) (n:=n) (I:=Fin (p+1)))) := + isColimitOfPreserves _ (barNerveIsColimit p) +end SimpleAmenable.PolygonObject.LabelledStage.Stage + +end + +open _root_.CategoryTheory _root_.OAI.CategoryTheory CategoryTheory.Limits Opposite +namespace StageProductColimit + +variable {C D E : Type} [Category.{0} C] [Category.{0} D] [Category.{0} E] +variable (κ : Type) +def powerMap (F : C ⥤ D) : (κ → C) ⥤ (κ → D) where + obj U i := F.obj (U i) + map f i := F.map (f i) + map_id _ := by funext i; exact F.map_id _ + map_comp _ _ := by funext i; exact F.map_comp _ _ +lemma powerMap_id : powerMap κ (𝟭 C)=𝟭 _ := rfl +lemma powerMap_comp (F : C ⥤ D) (G : D ⥤ E) : + powerMap κ (F⋙G)=powerMap κ F ⋙ powerMap κ G := rfl +instance (F : C ⥤ D) [F.Faithful] : (powerMap κ F).Faithful where + map_injective h := by funext i; exact F.map_injective (congrFun h i) +lemma powerMap_injective (F : C ⥤ D) (hF : Function.Injective F.obj) : + Function.Injective (powerMap κ F).obj := by + intro U V h; funext i; exact hF (congrFun h i) +end StageProductColimit +namespace SimpleAmenable.PolygonObject.LabelledStage.Stage +open StageProductColimit + +variable {a n : ℕ} (κ : Type) +noncomputable def productStage : Stage a n ⥤ Cat.{0,0} where + obj S := Cat.of (κ → S.Obj) + map h := (powerMap κ (inclusion (leOfHom h))).toCatHom + map_id S := by + apply Cat.ext + change powerMap κ (inclusion (le_refl S))=𝟭 _ + rw [inclusion_id]; rfl + map_comp h k := by + apply Cat.ext + change powerMap κ (inclusion ((leOfHom h).trans (leOfHom k)))= + powerMap κ (inclusion (leOfHom h)) ⋙ powerMap κ (inclusion (leOfHom k)) + rw [←powerMap_comp,←inclusion_comp] +noncomputable def productCocone : Cocone (productStage (a:=a) (n:=n) κ) where + pt := Cat.of (κ → Labelled a n) + ι := { + app S := (powerMap κ S.forget).toCatHom + naturality S T h := by + apply Cat.ext + change powerMap κ (inclusion (leOfHom h)) ⋙ powerMap κ T.forget=powerMap κ S.forget + rw [←powerMap_comp,inclusion_forget] } +noncomputable def productNerveCocone : Cocone (productStage (a:=a) (n:=n) κ ⋙ nerveFunctor) := + nerveFunctor.mapCocone (productCocone κ) +lemma exists_lift_product [Fintype κ] {K : Type} [Category.{0} K] [Fintype K] + [∀i j:K,Fintype (i ⟶ j)] (F : K ⥤ (κ → Labelled a n)) : + ∃S : Stage a n,∃G : K ⥤ (κ → S.Obj),G ⋙ powerMap κ S.forget=F := by + let τ := κ × (Σk:K,Σl:K,k ⟶ l) + let U : κ × K → Labelled a n := fun t => F.obj t.2 t.1 + let src : τ → κ × K := fun t => (t.1,t.2.1) + let dst : τ → κ × K := fun t => (t.1,t.2.2.1) + let f : ∀t,U (src t) ⟶ U (dst t) := fun t => F.map t.2.2.2 t.1 + obtain ⟨S,hP,hL,hf⟩ := exists_lift_family U src dst f + let G : K ⥤ (κ → S.Obj) := { + obj k i := ⟨F.obj k i,hP (i,k),hL (i,k)⟩ + map {k l} g i := ⟨F.map g i,hf (i,⟨k,l,g⟩)⟩ + map_id k := by funext i; apply UniformObject.Hom.ext; exact congrFun (F.map_id k) i + map_comp g h := by funext i; apply UniformObject.Hom.ext; exact congrFun (F.map_comp g h) i } + exact ⟨S,G,rfl⟩ +noncomputable def productNerveIsColimit [Fintype κ] : + IsColimit (productNerveCocone (a:=a) (n:=n) κ) := by + apply evaluationJointlyReflectsColimits + intro p + apply Types.FilteredColimit.isColimitOf' + · intro x + obtain ⟨S,G,h⟩ := exists_lift_product κ x + exact ⟨S,G,h.symm⟩ + · intro S x y h + have he : x=y := StageNerveColimit.comp_injective (powerMap κ S.forget) + (powerMap_injective κ S.forget (forget_injective S)) h + exact ⟨S,𝟙 S,congrArg _ he⟩ +noncomputable def productHomologyIsColimit [Fintype κ] (q:ℕ) : IsColimit + ((SSet.homologyFunctor (ModuleCat.of ℤ ℤ) q).mapCocone + (productNerveCocone (a:=a) (n:=n) κ)) := + isColimitOfPreserves _ (productNerveIsColimit κ) +end SimpleAmenable.PolygonObject.LabelledStage.Stage + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/FiniteCokernelExtension.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/FiniteCokernelExtension.lean new file mode 100644 index 0000000000000000000000000000000000000000..1c2ec82bab2259906a05a4315a884cb4273fa53c --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/FiniteCokernelExtension.lean @@ -0,0 +1,28 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.ReducedTensorTwo + +namespace OAI + +section +open CategoryTheory Limits HomologicalComplex +namespace ChainComplex +open scoped _root_.ChainComplex + +variable {R:Type} [CommRing R] (K:ChainComplex (ModuleCat.{0} R) ℕ) +lemma finite_of_boundary_annihilation (hK:K.d 1 0=0) {S:ModuleCat.{0} R} (T:K.X 1⟶S) [Epi T] + (N:Submodule R S) [Module.Finite R N] [Module.Finite R (K.homology 1)] + (h:K.d 2 1 ≫ T ≫ ModuleCat.ofHom N.mkQ=0) : Module.Finite R S := by + let c:=CokernelCofork.ofπ (T≫ModuleCat.ofHom N.mkQ) h + let f:K.homology 1 ⟶ ModuleCat.of R (S⧸N):=(positiveIsCokernel K 0 hK).desc c + have hf:positiveπ K 0 hK ≫ f=T≫ModuleCat.ofHom N.mkQ:= + Cofork.IsColimit.π_desc (positiveIsCokernel K 0 hK) (t := c) + have : Epi (ModuleCat.ofHom N.mkQ):=(ModuleCat.epi_iff_surjective _).mpr N.mkQ_surjective + have : Epi (positiveπ K 0 hK ≫ f):=by rw [hf]; infer_instance + have : Epi f:=epi_of_epi (positiveπ K 0 hK) _ + have : Module.Finite R (S⧸N):=Module.Finite.of_surjective f.hom ((ModuleCat.epi_iff_surjective f).mp inferInstance) + exact Module.Finite.of_submodule_quotient N +end ChainComplex + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/FiniteCutResolution.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/FiniteCutResolution.lean new file mode 100644 index 0000000000000000000000000000000000000000..8f290d5787b83ea645127ee541ba0b981a54b75f --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/FiniteCutResolution.lean @@ -0,0 +1,57 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.FinitePrimitiveResolution + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section FiniteCutResolution + +theorem finite_cut_resolution {a : ℕ} {κ : Type*} [Finite κ] (R : κ → polygonAlgebra a) : + ∃ S : Finset (Fin 4 × CutRing), ∀ i, + ResolvedBy (fun p : S => halfPlane a p.val.1 p.val.2) (R i).val := by + classical + let _ := Fintype.ofFinite κ + have hgen : {U : Set (GenericSquare a) | ∃ j z, U=halfPlane a j z}= + Set.range (fun p : Fin 4 × CutRing => halfPlane a p.1 p.2) := by + ext U + constructor + · rintro ⟨j,z,rfl⟩; exact ⟨(j,z),rfl⟩ + · rintro ⟨⟨j,z⟩,rfl⟩; exact ⟨j,z,rfl⟩ + have h (i : κ) : ∃ S : Finset (Fin 4 × CutRing), + ResolvedBy (fun p : S => halfPlane a p.val.1 p.val.2) (R i).val := by + apply finite_resolving_subfamily (fun p : Fin 4 × CutRing => halfPlane a p.1 p.2) + have hp := (R i).property + change (R i).val ∈ BooleanSubalgebra.closure _ at hp + rwa [hgen] at hp + choose S hS using h + refine ⟨Finset.univ.biUnion S,fun i x y hh => ?_⟩ + apply hS i x y + intro p + exact hh ⟨p.val,Finset.mem_biUnion.mpr ⟨i,Finset.mem_univ i,p.property⟩⟩ + +theorem finite_cut_resolution_extend {a : ℕ} {κ η : Type*} [Finite κ] [Finite η] + (R : κ → polygonAlgebra a) (j : η → Fin 4) (c : η → CutRing) : + ∃ S : Finset (Fin 4 × CutRing), + (∀ i, ResolvedBy (fun p : S => halfPlane a p.val.1 p.val.2) (R i).val) ∧ + ∀ e, (j e,c e) ∈ S := by + classical + let _ := Fintype.ofFinite η + obtain ⟨S,hS⟩ := finite_cut_resolution R + refine ⟨S ∪ Finset.univ.image (fun e => (j e,c e)),?_,?_⟩ + · intro i x y hh + exact hS i x y (fun p => hh ⟨p.val,Finset.mem_union_left _ p.property⟩) + · intro e + exact Finset.mem_union_right _ (Finset.mem_image.mpr ⟨e,Finset.mem_univ e,rfl⟩) + +end FiniteCutResolution + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/FiniteGroupHomology.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/FiniteGroupHomology.lean new file mode 100644 index 0000000000000000000000000000000000000000..d6ea731432e38315412f99e8469be4be2afd24d7 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/FiniteGroupHomology.lean @@ -0,0 +1,73 @@ +import Mathlib + +namespace OAI + +section +open CategoryTheory Limits +namespace FiniteGroupHomology +universe u +variable {R G : Type u} [CommRing R] [IsNoetherianRing R] [Group G] +lemma of_finite_chains (K : ChainComplex (ModuleCat R) ℕ) (n : ℕ) + [Module.Finite R (K.X n)] : Module.Finite R (K.homology n) := by + have : Module.Finite R (K.cycles n) := + Module.Finite.of_injective (K.iCycles n).hom ((ModuleCat.mono_iff_injective _).mp inferInstance) + exact Module.Finite.of_surjective (K.homologyπ n).hom ((ModuleCat.epi_iff_surjective _).mp inferInstance) + +lemma finite (A : Rep R G) [Finite G] [Module.Finite R A] (n : ℕ) : + Module.Finite R (groupHomology A n) := by + change Module.Finite R ((groupHomology.inhomogeneousChains A).homology n) + apply of_finite_chains +end FiniteGroupHomology + +end + +section +open CategoryTheory CategoryTheory.Limits +namespace CategoryTheory.Functor +open scoped _root_.CategoryTheory _root_.CategoryTheory.Functor +variable {C : Type*} [Category* C] + +lemma isEventuallyConstantFrom_of_succ (F : ℕ ⥤ C) (N : ℕ) + (h : ∀ n, N ≤ n → _root_.CategoryTheory.IsIso (F.map (_root_.CategoryTheory.homOfLE (Nat.le_succ n)))) : + F.IsEventuallyConstantFrom N := by + intro n f + have hn : N ≤ n := _root_.CategoryTheory.leOfHom f + obtain ⟨k, rfl⟩ := Nat.exists_eq_add_of_le hn + induction k with + | zero => + have hf : f = 𝟙 N := Subsingleton.elim _ _ + rw [hf, F.map_id] + infer_instance + | succ k ih => + have : _root_.CategoryTheory.IsIso (F.map (_root_.CategoryTheory.homOfLE (show N ≤ N+k by omega))) := ih _ (by omega) + have := h (N+k) (by omega) + have hf : f = (_root_.CategoryTheory.homOfLE (show N ≤ N+k by omega)) ≫ + (_root_.CategoryTheory.homOfLE (Nat.le_succ (N+k))) := Subsingleton.elim _ _ + rw [hf, F.map_comp] + infer_instance +end CategoryTheory.Functor + +namespace FixedStageReturn + +lemma stage_ι_isIso {R : Type*} [Ring R] (F : ℕ ⥤ ModuleCat R) (N m : ℕ) + (h : ∀ n, N ≤ n → IsIso (F.map (homOfLE (Nat.le_succ n)))) (hm : N ≤ m) : + IsIso (colimit.ι F m) := by + exact (_root_.OAI.CategoryTheory.Functor.isEventuallyConstantFrom_of_succ F N h).isIso_ι_of_isColimit' + (colimit.isColimit F) m (homOfLE hm) + +lemma finite_stage_iff_colimit {R : Type*} [Ring R] (F : ℕ ⥤ ModuleCat R) (N m : ℕ) + (h : ∀ n, N ≤ n → IsIso (F.map (homOfLE (Nat.le_succ n)))) (hm : N ≤ m) : + Module.Finite R (F.obj m) ↔ Module.Finite R (colimit F : ModuleCat R) := by + have := stage_ι_isIso F N m h hm + constructor + · intro hfin + exact Module.Finite.of_surjective (colimit.ι F m).hom + ((ModuleCat.epi_iff_surjective _).mp inferInstance) + · intro hfin + exact Module.Finite.of_surjective (inv (colimit.ι F m)).hom + ((ModuleCat.epi_iff_surjective _).mp inferInstance) +end FixedStageReturn + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/FinitePrimitiveResolution.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/FinitePrimitiveResolution.lean new file mode 100644 index 0000000000000000000000000000000000000000..2474f19571f9c4c6c3f68c76adb03efbc92dec50 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/FinitePrimitiveResolution.lean @@ -0,0 +1,105 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.ResolvedBoolean + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section FinitePrimitiveResolution +variable {X ι : Type*} + +theorem finite_resolving_subfamily (U : ι → Set X) {V : Set X} + (hV : V ∈ BooleanSubalgebra.closure (Set.range U)) : + ∃ S : Finset ι, ResolvedBy (fun i : S => U i.val) V := by + classical + induction hV using BooleanSubalgebra.closure_bot_sup_induction with + | mem V h => + obtain ⟨i,rfl⟩ := h + exact ⟨{i},fun x y he => he ⟨i,Finset.mem_singleton_self i⟩⟩ + | bot => exact ⟨∅,fun _ _ _ => Iff.rfl⟩ + | sup V W _ _ ihV ihW => + obtain ⟨S,hS⟩ := ihV + obtain ⟨T,hT⟩ := ihW + refine ⟨S ∪ T,fun x y he => or_congr (hS x y ?_) (hT x y ?_)⟩ + · intro i + exact he ⟨i.val,Finset.mem_union_left _ i.property⟩ + · intro i + exact he ⟨i.val,Finset.mem_union_right _ i.property⟩ + | compl V _ ih => + obtain ⟨S,hS⟩ := ih + exact ⟨S,fun x y he => not_congr (hS x y he)⟩ + +noncomputable def translatedPrimitiveAlgebra (a : ℕ) (r : CutRing) : + BooleanSubalgebra (Set (GenericSquare a)) := + BooleanSubalgebra.closure (Set.range fun p : Fin 5 × (CutRing × CutRing) => + (spatialTranslate p.2 (initialTest a r p.1)).val) + +theorem translatedPrimitiveAlgebra_test (a : ℕ) (r : CutRing) + (p : Fin 5 × (CutRing × CutRing)) : + (spatialTranslate p.2 (initialTest a r p.1)).val ∈ translatedPrimitiveAlgebra a r := + BooleanSubalgebra.subset_closure ⟨p,rfl⟩ + +theorem translatedPrimitiveAlgebra_translate (a : ℕ) (r : CutRing) + (u : CutRing × CutRing) {V : Set (GenericSquare a)} + (hV : V ∈ translatedPrimitiveAlgebra a r) : + translate a u ⁻¹' V ∈ translatedPrimitiveAlgebra a r := by + induction hV using BooleanSubalgebra.closure_bot_sup_induction with + | mem V h => + obtain ⟨p,rfl⟩ := h + have he : translate a u ⁻¹' (spatialTranslate p.2 (initialTest a r p.1)).val = + (spatialTranslate (p.2-u) (initialTest a r p.1)).val := by + ext x + simp only [spatialTranslate,Set.mem_preimage,← translate_add] + abel_nf + rw [he] + exact translatedPrimitiveAlgebra_test a r (p.1,p.2-u) + | bot => exact BooleanSubalgebra.bot_mem + | sup V W _ _ ihV ihW => exact BooleanSubalgebra.sup_mem ihV ihW + | compl V _ ih => exact BooleanSubalgebra.compl_mem ih + +theorem translatedPrimitiveAlgebra_initial (a : ℕ) (r : CutRing) (j : Fin 5) : + (initialTest a r j).val ∈ translatedPrimitiveAlgebra a r := by + have h := translatedPrimitiveAlgebra_test a r (j,0) + have he : (spatialTranslate (0:CutRing × CutRing) (initialTest a r j)).val = + (initialTest a r j).val := by + ext p + simp [spatialTranslate,translate_zero] + rwa [he] at h + +theorem polygon_finite_primitive_resolution {a : ℕ} (r : CutRing) + (hr : 0 < ordinary r ∧ ordinary r < 1/2) (V : polygonAlgebra a) : + ∃ S : Finset (Fin 5 × (CutRing × CutRing)), + ResolvedBy (fun p : S => (spatialTranslate p.val.2 (initialTest a r p.val.1)).val) V.val := by + apply finite_resolving_subfamily (fun p : Fin 5 × (CutRing × CutRing) => + (spatialTranslate p.2 (initialTest a r p.1)).val) + let B := translatedPrimitiveAlgebra a r + have ht := fun u U hU => translatedPrimitiveAlgebra_translate a r u (V := U) hU + have hcoord (j : Fin 2) (z : CutRing) : + halfPlane a (Fin.castLE (by omega) j) z ∈ B := by + apply coordinate_cuts_generated B j ht + fin_cases j + · exact translatedPrimitiveAlgebra_initial a r 1 + · exact translatedPrimitiveAlgebra_initial a r 2 + apply polygon_induction (P := fun U => U ∈ B) ?_ BooleanSubalgebra.bot_mem + (fun _ _ hU hV => BooleanSubalgebra.sup_mem hU hV) + (fun _ hU => BooleanSubalgebra.compl_mem hU) V.property + intro j z + fin_cases j + · exact hcoord 0 z + · exact hcoord 1 z + · exact slope_cuts_generated r hr B ht hcoord 2 (Or.inl rfl) + (translatedPrimitiveAlgebra_initial a r 3) z + · exact slope_cuts_generated r hr B ht hcoord 3 (Or.inr rfl) + (translatedPrimitiveAlgebra_initial a r 4) z + +end FinitePrimitiveResolution + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/FreeChains.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/FreeChains.lean new file mode 100644 index 0000000000000000000000000000000000000000..7506df2a5067778cef7861b1f8a3f25fbdd1c4e2 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/FreeChains.lean @@ -0,0 +1,178 @@ +import Mathlib + +namespace OAI + +section + +section + +open CategoryTheory Limits MonoidalCategory SimplicialObject AlgebraicTopology +namespace FreeChains + +abbrev A := ModuleCat.{0} ℤ +abbrev Z : A := ModuleCat.of ℤ ℤ +abbrev c := ComplexShape.down ℕ + +noncomputable def forward (X : Type) : (sigmaConst.obj Z).obj X ⟶ (ModuleCat.free ℤ).obj X := + Sigma.desc (fun x => ModuleCat.ofHom (Finsupp.lsingle x)) +noncomputable def backward (X : Type) : (ModuleCat.free ℤ).obj X ⟶ (sigmaConst.obj Z).obj X := + ModuleCat.freeDesc (↾fun x => (Sigma.ι (fun _ : X => Z) x) (1:ℤ)) +@[reassoc (attr := simp)] lemma ι_forward (X : Type) (x : X) : + Sigma.ι (fun _ : X => Z) x ≫ forward X = ModuleCat.ofHom (Finsupp.lsingle x) := + Sigma.ι_comp_desc _ _ +@[simp] lemma backward_mk (X : Type) (x : X) : + backward X (ModuleCat.freeMk x)=(Sigma.ι (fun _ : X => Z) x) (1:ℤ) := by + simp [backward] + +noncomputable def iso (X : Type) : (sigmaConst.obj Z).obj X ≅ (ModuleCat.free ℤ).obj X where + hom := forward X + inv := backward X + hom_inv_id := by + apply Sigma.hom_ext + intro x + apply ModuleCat.hom_ext + apply LinearMap.ext_ring + have h := congrArg (fun f : Z ⟶ (ModuleCat.free ℤ).obj X => f (1:ℤ)) (ι_forward X x) + change backward X (forward X ((Sigma.ι (fun _ : X => Z) x) (1:ℤ))) = _ + rw [show forward X ((Sigma.ι (fun _ : X => Z) x) (1:ℤ))=ModuleCat.freeMk x from h] + exact backward_mk X x + inv_hom_id := by + apply ModuleCat.free_hom_ext + intro x + change forward X (backward X (ModuleCat.freeMk x)) = ModuleCat.freeMk x + rw [backward_mk] + exact congrArg (fun f : Z ⟶ (ModuleCat.free ℤ).obj X => f (1:ℤ)) (ι_forward X x) + +noncomputable def naturalIso : sigmaConst.obj Z ≅ ModuleCat.free ℤ := + NatIso.ofComponents iso (by + intro X Y f + apply Sigma.hom_ext + intro x + dsimp only [iso,sigmaConst] + erw [Sigma.ι_comp_map'_assoc] + rw [Category.id_comp,ι_forward,ι_forward_assoc] + apply ModuleCat.hom_ext + apply LinearMap.ext_ring + change Finsupp.single (f x) 1 = (ModuleCat.free ℤ).map f (ModuleCat.freeMk x) + exact (ModuleCat.free_map_apply f x).symm) + +noncomputable def complex (X : SSet) : ChainComplex A ℕ := + AlternatingFaceMapComplex.obj (X ⋙ ModuleCat.free ℤ) +noncomputable def complexIso (X : SSet) : SSet.chainComplex X Z ≅ complex X := + (alternatingFaceMapComplex A).mapIso (Functor.isoWhiskerLeft X naturalIso) + +end FreeChains + +end + +section + +open CategoryTheory Limits Classical +namespace AdditiveFinite + +variable {R : Type} [CommRing R] [Nontrivial R] [IsNoetherianRing R] + (F : ModuleCat R ⥤ ModuleCat R) [F.Additive] + (A : ModuleCat R) [Module.Free R A] [Module.Finite R A] + +noncomputable abbrev basis := Module.finBasis R A +noncomputable abbrev I := Fin (Module.finrank R A) +noncomputable def incl (i : I A) : ModuleCat.of R R ⟶ A := + ModuleCat.ofHom (LinearMap.toSpanSingleton R A (basis A i)) +noncomputable def proj (i : I A) : A ⟶ ModuleCat.of R R := + ModuleCat.ofHom ((basis A).coord i) +omit [IsNoetherianRing R] in +lemma sum_proj_incl : ∑ i : I A, proj A i ≫ incl A i = 𝟙 A := by + apply ModuleCat.hom_ext + apply LinearMap.ext + intro x + simp [proj,incl] + +omit [IsNoetherianRing R] in +lemma isZero (h : IsZero (F.obj (ModuleCat.of R R))) : IsZero (F.obj A) := by + apply (IsZero.iff_id_eq_zero _).mpr + rw [← F.map_id, ← sum_proj_incl A,F.map_sum] + apply Finset.sum_eq_zero + intro i hi + rw [F.map_comp,h.eq_zero_of_tgt (F.map (proj A i)),zero_comp] + +lemma finite [Module.Finite R (F.obj (ModuleCat.of R R))] : + Module.Finite R (F.obj A) := by + let φ : F.obj A →ₗ[R] (I A → F.obj (ModuleCat.of R R)) := + LinearMap.pi (fun i => (F.map (proj A i)).hom) + apply Module.Finite.of_injective φ + apply (LinearMap.ker_eq_bot).mp + rw [Submodule.eq_bot_iff] + intro x hx + have hp : ∀i : I A, (F.map (proj A i)).hom x=0 := fun i => congrFun hx i + have he : ∑ i : I A, (F.map (proj A i) ≫ F.map (incl A i))=𝟙 _ := by + simp only [← F.map_comp, ← F.map_sum,sum_proj_incl,F.map_id] + have ht := congrArg (fun t => t.hom x) he + simpa [hp] using ht.symm + +end AdditiveFinite + +end + +section + +open CategoryTheory Limits MonoidalCategory HomologicalComplex +namespace TensorCoefficient + +variable {R : Type} [CommRing R] +abbrev c := ComplexShape.down ℕ +variable (K : ChainComplex (ModuleCat.{0} R) ℕ) + +noncomputable def functor : ModuleCat.{0} R ⥤ ChainComplex (ModuleCat.{0} R) ℕ where + obj A := ((tensorRight A).mapHomologicalComplex c).obj K + map f := (NatTrans.mapHomologicalComplex ((tensoringRight (ModuleCat.{0} R)).map f) c).app K + map_id A := by apply HomologicalComplex.Hom.ext; funext n; change K.X n ◁ 𝟙 A=𝟙 _; simp + map_comp f g := by apply HomologicalComplex.Hom.ext; funext n; change K.X n ◁ (f≫g)=(K.X n ◁ f)≫(K.X n ◁ g); simp + +instance : (functor K).Additive where + map_add := by + intros + apply HomologicalComplex.Hom.ext + funext n + exact MonoidalPreadditive.whiskerLeft_add _ _ + +noncomputable def unitIso : (functor K).obj (ModuleCat.of R R) ≅ K := + (NatIso.mapHomologicalComplex (rightUnitorNatIso (ModuleCat.{0} R)) c).app K ≪≫ + (Functor.mapHomologicalComplexIdIso _ _).app K + +noncomputable def homologyFunctor (n : ℕ) : ModuleCat.{0} R ⥤ ModuleCat.{0} R := + functor K ⋙ HomologicalComplex.homologyFunctor _ c n + +instance (n : ℕ) : (homologyFunctor K n).Additive := by + unfold homologyFunctor + infer_instance + +noncomputable def homologyUnitIso (n : ℕ) : + (homologyFunctor K n).obj (ModuleCat.of R R) ≅ K.homology n := + (HomologicalComplex.homologyFunctor _ c n).mapIso (unitIso K) + +lemma shortExact [∀n,Module.Flat R (K.X n)] {S : ShortComplex (ModuleCat.{0} R)} + (hS : S.ShortExact) : (S.map (functor K)).ShortExact := by + rw [HomologicalComplex.shortExact_iff_degreewise_shortExact] + intro n + change (S.map (tensorLeft (K.X n))).ShortExact + exact hS.map_of_exact _ + +lemma free_finite [Nontrivial R] [IsNoetherianRing R] (A : ModuleCat.{0} R) + [Module.Free R A] [Module.Finite R A] (n : ℕ) + [Module.Finite R (K.homology n)] : Module.Finite R ((homologyFunctor K n).obj A) := by + have : Module.Finite R ((homologyFunctor K n).obj (ModuleCat.of R R)) := + Module.Finite.equiv (homologyUnitIso K n).symm.toLinearEquiv + exact AdditiveFinite.finite _ _ + +lemma free_isZero [Nontrivial R] [IsNoetherianRing R] (A : ModuleCat.{0} R) + [Module.Free R A] [Module.Finite R A] (n : ℕ) + (h : IsZero (K.homology n)) : IsZero ((homologyFunctor K n).obj A) := by + exact AdditiveFinite.isZero _ _ (h.of_iso (homologyUnitIso K n)) + +end TensorCoefficient + +end + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/FullGroupStability.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/FullGroupStability.lean new file mode 100644 index 0000000000000000000000000000000000000000..25700bfd99543e3ab3ff6e38c0d1427057648129 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/FullGroupStability.lean @@ -0,0 +1,159 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.HomologyAdditive + +namespace OAI + +section + +open Classical CategoryTheory CategoryTheory.Limits Representation Rep Finsupp +namespace SimpleAmenable + +attribute [local instance 1200] Rep.hV2 + +namespace TrivialHomology +variable {G H K : Type} [Group G] [Group H] [Group K] +noncomputable abbrev map (f : G →* H) (q : ℕ) := + groupHomology.map f (TransitiveInduction.trivialMap f) q + +@[simp] lemma map_id (q : ℕ) : map (MonoidHom.id G) q=𝟙 _ := by + exact groupHomology.map_id (A:=Rep.trivial ℤ G ℤ) (n:=q) + +lemma map_comp (f : G →* H) (g : H →* K) (q : ℕ) : + map (g.comp f) q = map f q ≫ map g q := by + exact groupHomology.map_comp f g (TransitiveInduction.trivialMap f) + (TransitiveInduction.trivialMap g) q + +lemma map_congr (f g : G →* H) (h : f=g) (q : ℕ) : map f q=map g q := by rw [h] + +lemma isIso_equiv (e : G ≃* H) (q : ℕ) : IsIso (map e.toMonoidHom q) := by + refine ⟨⟨map e.symm.toMonoidHom q,?_,?_⟩⟩ + · rw [← map_comp] + have he : e.symm.toMonoidHom.comp e.toMonoidHom=MonoidHom.id G := by ext; simp + rw [he, map_id] + · rw [← map_comp] + have he : e.toMonoidHom.comp e.symm.toMonoidHom=MonoidHom.id H := by ext; simp + rw [he, map_id] +end TrivialHomology + +namespace PolygonPlacement.Configuration +instance empty_subsingleton (a m : ℕ) : Subsingleton (Configuration a m 0) := + ⟨fun _ _ => ext (fun index => Fin.elim0 index)⟩ + +noncomputable def empty (a m : ℕ) : Configuration a m 0 := standardLE a m 0 (by omega) + +noncomputable def emptyIso (a m : ℕ) : column a m 0 ≅ Rep.trivial ℤ (polygonFullGroup a m) ℤ := + Rep.mkIso (Representation.Equiv.mk (Finsupp.uniqueLinearEquiv ℤ ℤ (empty a m)) (by + intro g + apply Finsupp.lhom_ext + intro x z + change (TransitiveInduction.permutationRep g (single x z)) (empty a m)= + (single x z) (empty a m) + rw [TransitiveInduction.permutationRep_single] + congr 2 + exact Subsingleton.elim _ _)) + +@[simp] lemma emptyIso_single (a m : ℕ) (x : Configuration a m 0) (z : ℤ) : + (emptyIso a m).hom.hom (single x z)=z := by + change (single x z) (empty a m)=z + simp [Subsingleton.elim (empty a m) x] +lemma augmentation_pointMap {a m : ℕ} (f : Configuration a m 1) (q : ℕ) : + groupHomology.map (MulAction.stabilizer (polygonFullGroup a m) f).subtype + (TransitiveInduction.pointMap f) q ≫ + (groupHomology.functor ℤ (polygonFullGroup a m) q).map (boundary a m 0) ≫ + (groupHomology.functor ℤ (polygonFullGroup a m) q).map (emptyIso a m).hom = + TrivialHomology.map (MulAction.stabilizer (polygonFullGroup a m) f).subtype q := by + erw [← Functor.map_comp] + erw [groupHomology.functor_map, ← groupHomology.map_comp] + apply groupHomology.map_congr + · rfl + · apply LinearMap.ext + intro z + change (emptyIso a m).hom.hom ((boundary a m 0).hom (single f z))=z + rw [boundary_zero_eq_face] + dsimp only [faceHom] + rw [TransitiveInduction.equivariantMap_single, emptyIso_single] +lemma stabilizer_H1_isIso (a m : ℕ) (hm : 33 ≤ m) (f : Configuration a m 1) : + IsIso (TrivialHomology.map (MulAction.stabilizer (polygonFullGroup a m) f).subtype 1) := by + have first := TransitiveInduction.isIso_map_pointMap f (fun g => transitive f g (by omega)) 1 + have second := boundary_zero_H1_isIso a m hm + have third : IsIso ((groupHomology.functor ℤ (polygonFullGroup a m) 1).map + (emptyIso a m).hom) := inferInstance + rw [← augmentation_pointMap f 1] + have composite := IsIso.comp_isIso' first (IsIso.comp_isIso' second third) + exact composite + +noncomputable def standardStabilizerEquiv (a p n : ℕ) : + polygonFullGroup a n ≃* MulAction.stabilizer (polygonFullGroup a (p+n)) (standard a p n) := + (PolygonTracks.stabilizerEquiv a p n).trans (MulEquiv.subgroupCongr (stabilizer_standard a p n).symm) + +lemma standardStabilizerEquiv_subtype (a p n : ℕ) : + (MulAction.stabilizer (polygonFullGroup a (p+n)) (standard a p n)).subtype.comp + (standardStabilizerEquiv a p n).toMonoidHom = PolygonTracks.stabilize a p n := rfl + +lemma stabilize_H1_isIso (a n : ℕ) (hn : 32 ≤ n) : + IsIso (TrivialHomology.map (PolygonTracks.stabilize a 1 n) 1) := by + rw [← standardStabilizerEquiv_subtype a 1 n, TrivialHomology.map_comp] + have := TrivialHomology.isIso_equiv (standardStabilizerEquiv a 1 n) 1 + have := stabilizer_H1_isIso a (1+n) (by omega) (standard a 1 n) + infer_instance + +end PolygonPlacement.Configuration +end SimpleAmenable + +end + +open Classical CategoryTheory CategoryTheory.Limits Representation Rep Finsupp +namespace SimpleAmenable.TrivialHomology + +attribute [local instance 1200] Rep.hV2 +variable {G H : Type} [Group G] [Group H] + +noncomputable def abelianizationEquiv (G : Type) [Group G] : + groupHomology.H1 (Rep.trivial ℤ G ℤ) ≃+ Additive (Abelianization G) := + (groupHomology.H1AddEquivOfIsTrivial (Rep.trivial ℤ G ℤ)).trans + (TensorProduct.rid ℤ (Additive (Abelianization G))).toAddEquiv + +noncomputable def cycle (g : G) : groupHomology.H1 (Rep.trivial ℤ G ℤ) := + groupHomology.H1π _ ((groupHomology.cycles₁IsoOfIsTrivial _).inv (single g (1:ℤ))) + +@[simp] lemma abelianizationEquiv_cycle (g : G) : + abelianizationEquiv G (cycle g)=Additive.ofMul (Abelianization.of g) := by + change (TensorProduct.rid ℤ (Additive (Abelianization G))) + ((groupHomology.H1AddEquivOfIsTrivial (Rep.trivial ℤ G ℤ)) + (groupHomology.H1π _ ((groupHomology.cycles₁IsoOfIsTrivial _).inv (single g (1:ℤ))))) = _ + rw [groupHomology.H1AddEquivOfIsTrivial_single, TensorProduct.rid_tmul] + simp + +lemma cycle_map (f : G →* H) (g : G) : map f 1 (cycle g)=cycle (f g) := by + unfold cycle + rw [groupHomology.H1π_comp_map_apply] + congr 1 + apply Subtype.ext + change groupHomology.chainsMap₁ f (TransitiveInduction.trivialMap f) (single g (1:ℤ))= + single (f g) (1:ℤ) + simp [groupHomology.chainsMap₁, TransitiveInduction.trivialMap] + +lemma cycle_eq_zero_iff (g : G) : cycle g=0 ↔ g∈_root_.commutator G := by + rw [← (abelianizationEquiv G).map_eq_zero_iff, abelianizationEquiv_cycle] + change Abelianization.of g=1 ↔ _ + change g∈(Abelianization.of : G →* Abelianization G).ker ↔ _ + rw [Abelianization.ker_of] + +lemma commutator_comap_of_mono (f : G →* H) [Mono (map f 1)] : + (_root_.commutator H).comap f=_root_.commutator G := by + ext g + change f g∈_root_.commutator H ↔ g∈_root_.commutator G + rw [← cycle_eq_zero_iff, ← cycle_eq_zero_iff, ← cycle_map] + exact (ModuleCat.mono_iff_injective (map f 1)).mp inferInstance |>.eq_iff' (map_zero _) + +lemma H1_isZero_of_perfect [Group.IsPerfect G] : + IsZero (groupHomology.H1 (Rep.trivial ℤ G ℤ)) := by + have : Group.IsPerfect (Abelianization G) := Group.IsPerfect.ofSurjective + (f:=Abelianization.of) (QuotientGroup.mk'_surjective (_root_.commutator G)) + have : Subsingleton (Abelianization G) := inferInstance + have : Subsingleton (groupHomology.H1 (Rep.trivial ℤ G ℤ)) := + (abelianizationEquiv G).injective.subsingleton + exact ModuleCat.isZero_of_subsingleton _ +end SimpleAmenable.TrivialHomology + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/FullH2.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/FullH2.lean new file mode 100644 index 0000000000000000000000000000000000000000..b114f4abd9064a2bf53394a304fb2b96de477009 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/FullH2.lean @@ -0,0 +1,167 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.RegularAugmentation + +namespace OAI + +section + +open Classical CategoryTheory CategoryTheory.Limits Representation Rep Finsupp +namespace SimpleAmenable.PolygonPlacement.Configuration + +attribute [local instance 1200] Rep.hV2 +lemma columnAugmentation_H1_isIso (a p n : ℕ) (hn : 32 ≤ n) (hm : 3*p+1 < p+n) : + IsIso ((groupHomology.functor ℤ (polygonFullGroup a (p+n)) 1).map + (TransitiveInduction.augmentation (polygonFullGroup a (p+n)) (Configuration a (p+n) p))) := by + have pointIso := TransitiveInduction.isIso_map_pointMap (standard a p n) + (fun f => transitive _ f hm) 1 + have stabilizerIso : IsIso (TrivialHomology.map + (MulAction.stabilizer (polygonFullGroup a (p+n)) (standard a p n)).subtype 1) := by + have := PolygonTracks.stabilize_H1_isIso a p n hn + have := TrivialHomology.isIso_equiv (standardStabilizerEquiv a p n) 1 + have he : TrivialHomology.map (standardStabilizerEquiv a p n).toMonoidHom 1 ≫ + TrivialHomology.map (MulAction.stabilizer (polygonFullGroup a (p+n)) + (standard a p n)).subtype 1 = TrivialHomology.map (PolygonTracks.stabilize a p n) 1 := by + rw [← TrivialHomology.map_comp, standardStabilizerEquiv_subtype] + exact IsIso.of_isIso_fac_left he + exact @IsIso.of_isIso_fac_left _ _ _ _ _ _ _ _ pointIso stabilizerIso + (TransitiveInduction.augmentation_pointMap (standard a p n) 1) + +lemma face_H1_isIso (a m p : ℕ) (hn : p+33 ≤ m) (hm : 3*(p+1)+1 < m) (i : Fin (p+1)) : + IsIso ((groupHomology.functor ℤ (polygonFullGroup a m) 1).map (faceHom a m p i)) := by + have hc (t : ℕ) (ht : t ≤ p+1) : + IsIso ((groupHomology.functor ℤ (polygonFullGroup a m) 1).map + (TransitiveInduction.augmentation (polygonFullGroup a m) (Configuration a m t))) := by + obtain ⟨n,rfl⟩ : ∃n,m=t+n := ⟨m-t,by omega⟩ + exact columnAugmentation_H1_isIso a t n (by omega) (by omega) + have := hc p (by omega) + have := hc (p+1) (by omega) + have he := congrArg ((groupHomology.functor ℤ (polygonFullGroup a m) 1).map) + (TransitiveInduction.augmentation_natural (face i) (face_smul i)) + rw [Functor.map_comp] at he + exact IsIso.of_isIso_fac_right he + +lemma boundary_two_H1_isIso (a m : ℕ) (hm : 35 ≤ m) : + IsIso ((groupHomology.functor ℤ (polygonFullGroup a m) 1).map (boundary a m 2)) := by + rw [homology_boundary_three a m (by omega) 1] + exact face_H1_isIso a m 2 (by omega) (by omega) 0 + +lemma boundary_five (a m : ℕ) : boundary a m 4 = + faceHom a m 4 0 - faceHom a m 4 1 + faceHom a m 4 2 - faceHom a m 4 3 + faceHom a m 4 4 := by + rw [boundary_sum] + simp only [Fin.sum_univ_succ] + norm_num + abel + +lemma boundary_four_H0_isIso (a m : ℕ) (hm : 16 < m) : + IsIso ((groupHomology.functor ℤ (polygonFullGroup a m) 0).map (boundary a m 4)) := by + rw [boundary_five,Functor.map_add,Functor.map_sub,Functor.map_add,Functor.map_sub] + rw [homology_face_eq a m 4 hm 0 1 0, homology_face_eq a m 4 hm 0 2 0, + homology_face_eq a m 4 hm 0 3 0, homology_face_eq a m 4 hm 0 4 0] + simp only [sub_self,zero_add] + exact face_H0_isIso a m 4 hm 0 + +lemma boundary_zero_H2_isIso (a m : ℕ) (hm : 35 ≤ m) : + IsIso ((groupHomology.functor ℤ (polygonFullGroup a m) 2).map (boundary a m 0)) := by + have := boundary_zero_epi a m (by omega) + have : IsIso (BoundedHomologyEdge.Hmap 0 (boundary a m 2)) := + boundary_two_H0_isIso a m (by omega) + have : IsIso (BoundedHomologyEdge.Hmap 1 (boundary a m 2)) := + boundary_two_H1_isIso a m hm + have : IsIso (BoundedHomologyEdge.Hmap 0 (boundary a m 4)) := + boundary_four_H0_isIso a m (by omega) + exact BoundedHomologyEdge.chain_H2_isIso (boundary a m 0) (boundary a m 1) + (boundary a m 2) (boundary a m 3) (boundary a m 4) + (boundary_square a m 0) (boundary_square a m 1) (boundary_square a m 2) + (boundary_square a m 3) (boundary_exact a m 0 (by omega) (by omega)) + (boundary_exact a m 1 (by omega) (by omega)) + (boundary_exact a m 2 (by omega) (by omega)) + (homology_boundary_two_zero a m (by omega) 2) +lemma stabilizer_H2_isIso (a m : ℕ) (hm : 35 ≤ m) (f : Configuration a m 1) : + IsIso (TrivialHomology.map (MulAction.stabilizer (polygonFullGroup a m) f).subtype 2) := by + have first := TransitiveInduction.isIso_map_pointMap f (fun g => transitive f g (by omega)) 2 + have second := boundary_zero_H2_isIso a m hm + have third : IsIso ((groupHomology.functor ℤ (polygonFullGroup a m) 2).map + (emptyIso a m).hom) := inferInstance + rw [← augmentation_pointMap f 2] + have composite := IsIso.comp_isIso' first (IsIso.comp_isIso' second third) + exact composite + +lemma stabilize_H2_isIso (a n : ℕ) (hn : 34 ≤ n) : + IsIso (TrivialHomology.map (PolygonTracks.stabilize a 1 n) 2) := by + rw [← standardStabilizerEquiv_subtype a 1 n, TrivialHomology.map_comp] + have := TrivialHomology.isIso_equiv (standardStabilizerEquiv a 1 n) 2 + have := stabilizer_H2_isIso a (1+n) (by omega) (standard a 1 n) + infer_instance +end SimpleAmenable.PolygonPlacement.Configuration + +end + +open Classical CategoryTheory CategoryTheory.Limits Representation Rep +namespace SimpleAmenable + +attribute [local instance 1200] Rep.hV2 + +namespace TrivialHomology +variable (G : Type) [Group G] +lemma abelianization_fg [Module.Finite ℤ (groupHomology (Rep.trivial ℤ G ℤ) 1)] : + Group.FG (Abelianization G) := by + let e : groupHomology (Rep.trivial ℤ G ℤ) 1 ≃ₗ[ℤ] Additive (Abelianization G) := + (abelianizationEquiv G).toIntLinearEquiv + have : Module.Finite ℤ (Additive (Abelianization G)) := + Module.Finite.of_surjective e.toLinearMap e.surjective + have : AddGroup.FG (Additive (Abelianization G)) := + Module.Finite.iff_addGroup_fg.mp inferInstance + exact GroupFG.iff_add_fg.mpr inferInstance + +lemma abelianization_ring_noetherian + [Module.Finite ℤ (groupHomology (Rep.trivial ℤ G ℤ) 1)] : + IsNoetherianRing (MonoidAlgebra ℤ (Abelianization G)) := by + have := abelianization_fg G + have : Algebra.FiniteType ℤ (MonoidAlgebra ℤ (Abelianization G)) := + MonoidAlgebra.finiteType_iff_group_fg.mpr inferInstance + exact Algebra.FiniteType.isNoetherianRing ℤ _ +end TrivialHomology + +namespace PolygonTracks +noncomputable def abelianKernelEquiv (a m : ℕ) (hm : 5 ≤ m) : + (Abelianization.of : polygonFullGroup a m →* Abelianization (polygonFullGroup a m)).ker ≃* + polygonAlternatingGroup a m := + MulEquiv.subgroupCongr ((Abelianization.ker_of (polygonFullGroup a m)).trans (polygonFullGroup_commutator_eq a m hm)) + +lemma finite_alternating_H2_of_full (a m : ℕ) (hm : 205 < m) + [Module.Finite ℤ (groupHomology (Rep.trivial ℤ (polygonFullGroup a m) ℤ) 1)] + [Module.Finite ℤ (groupHomology (Rep.trivial ℤ (polygonFullGroup a m) ℤ) 2)] : + Module.Finite ℤ (groupHomology.H2 (IntegralHomology.coefficients (polygonAlternatingGroup a m))) := by + let f : polygonFullGroup a m →* Abelianization (polygonFullGroup a m) := Abelianization.of + let e := abelianKernelEquiv a m (by omega) + have : IsNoetherianRing (MonoidAlgebra ℤ (Abelianization (polygonFullGroup a m))) := + TrivialHomology.abelianization_ring_noetherian _ + have : Group.IsPerfect (polygonAlternatingGroup a m) := polygonAlternatingGroup_perfect a m (by omega) + have : Group.IsPerfect f.ker := Group.IsPerfect.ofSurjective (f:=e.symm.toMonoidHom) e.symm.surjective + have ha : ∀g : polygonFullGroup a m, + TrivialHomology.map (QuotientRegular.conjugate f g).toMonoidHom 2 = 𝟙 _ := by + intro g + have := TrivialHomology.isIso_equiv e 2 + apply (cancel_mono (TrivialHomology.map e.toMonoidHom 2)).mp + rw [Category.id_comp, ← TrivialHomology.map_comp] + have he : e.toMonoidHom.comp (QuotientRegular.conjugate f g).toMonoidHom = + (fullConjugation a m g).comp e.toMonoidHom := by + apply MonoidHom.ext + intro x + apply Subtype.ext + rfl + rw [he,TrivialHomology.map_comp] + have hg : TrivialHomology.map (fullConjugation a m g) 2=𝟙 _ := by + apply ModuleCat.hom_ext + exact fullAction_trivial a m hm g + rw [hg,Category.comp_id] + have : Module.Finite ℤ (groupHomology (Rep.trivial ℤ f.ker ℤ) 2) := + QuotientRegular.finite_kernel_H2 f (QuotientGroup.mk'_surjective _) + (TrivialHomology.H1_isZero_of_perfect) ha + have := TrivialHomology.isIso_equiv e 2 + exact Module.Finite.of_surjective (TrivialHomology.map e.toMonoidHom 2).hom + ((ModuleCat.epi_iff_surjective _).mp inferInstance) +end PolygonTracks +end SimpleAmenable + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/GlobalTangentChain.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/GlobalTangentChain.lean new file mode 100644 index 0000000000000000000000000000000000000000..74367a0462a0e87e4227060963a8b12d9d081342 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/GlobalTangentChain.lean @@ -0,0 +1,121 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.LabelShiftedCharts +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.RectangularBound + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section GlobalTangentChain + +theorem translated_rectangle_window {a k : ℕ} {r : CutRing} + (p : Fin 2 → ℤ) (z : CutRing × CutRing) (l v : Fin 2 → CutRing) + (hl : ∀ j, p j ≤ endpointLabel (l j) ∧ endpointLabel (l j) < p j+k) + (hv : ∀ j, p j ≤ endpointLabel (v j) ∧ endpointLabel (v j) < p j+k) : + ResolvedBy (fun i => (InitialCoverSystem.primitiveTests (a := a) (r := r) + (coordinateWindowPrimitives k (fun j => pointLabel z j+p j)) i).val) + (spatialTranslate z (coordinateRectangle a l v)).val := by + rw [spatialTranslate_coordinateRectangle] + have hL j : pointLabel z j+p j ≤ endpointLabel (l j+pointCoordinate z j) ∧ + endpointLabel (l j+pointCoordinate z j) < pointLabel z j+p j+k := by + simp only [endpointLabel_add,pointLabel] + have hh := hl j + omega + have hV j : pointLabel z j+p j ≤ endpointLabel (v j+pointCoordinate z j) ∧ + endpointLabel (v j+pointCoordinate z j) < pointLabel z j+p j+k := by + simp only [endpointLabel_add,pointLabel] + have hh := hv j + omega + intro x y he + exact and_congr + (coordinateInterval_window k _ 0 _ _ (hL 0) (hV 0) x y he) + (coordinateInterval_window k _ 1 _ _ (hL 1) (hV 1) x y he) + +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + +theorem all_rectangle_control_to_chart (hlarge : 20 ≤ m+1) + (g : ∀ n, B.CoordinateWindowLaw n) + (k : ℕ) (p : Fin 2 → ℤ) (u : CutRing) (h : B.TangentChartLaws k p u) + (d : Fin 2) (e : Fin 5) (z : CutRing × CutRing) (l v : Fin 2 → CutRing) + (hl : ∀ j, p j ≤ endpointLabel (l j) ∧ endpointLabel (l j) < p j+k) + (hv : ∀ j, p j ≤ endpointLabel (v j) ∧ endpointLabel (v j) < p j+k) + (n : ℕ) (q : Fin 2 → ℤ) (W : polygonAlgebra a) + (hW : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) + (coordinateWindowPrimitives n q) i).val) W.val) + (hinc : W ≤ spatialTranslate z (coordinateRectangle a l v)) + (f : TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm)) + (hf : B.AlignedSmallSupported f) + (hc : SmallControlled B.c f (B.windowSector (by omega) n (g n) q W)) : + SmallControlled B.c f (B.fullGeometricSector (by omega) + (translatedTemplate (tangentChartTemplate a k p d (signedShortSteps u e)) z) + (h d e z) (spatialTranslate z (coordinateRectangle a l v))) := by + apply B.control_trans hlarge f _ _ hf + (B.fullGeometricSector_supported (by omega) _ _ _ + (tangentChart_rectangle_resolved p d _ z l v hl hv)) hc + rw [B.tangentChartSector_eq_window (by omega) k p u h k le_rfl (g k) d e z l v hl hv] + exact B.all_window_control (by omega) g n k q (fun j => pointLabel z j+p j) + W _ hinc hW (translated_rectangle_window p z l v hl hv) + +theorem tangent_chain_unbounded (hlarge : 20 ≤ m+1) + (hr : 0 < ordinary r ∧ ordinary r < 1/2) + (g : ∀ n, B.CoordinateWindowLaw n) + (k : ℕ) (p : Fin 2 → ℤ) (u : CutRing) (h : B.TangentChartLaws k p u) + (l v : Fin 2 → CutRing) + (hl : ∀ j, p j ≤ endpointLabel (l j) ∧ endpointLabel (l j) < p j+k) + (hv : ∀ j, p j ≤ endpointLabel (v j) ∧ endpointLabel (v j) < p j+k) + (hlv : ∀ j, ordinary (l j) ≤ ordinary (v j)) + (hlen : ∀ j, ordinary (v j)-ordinary (l j) < 1) + (hbox : ∀ j, -ordinary r < ordinary (l j) ∧ ordinary (v j) < ordinary r) + (hbox' : ∀ (d : Fin 2) (e : Fin 5) (j : Fin 2), + -ordinary r < ordinary (l j)-ordinary (pointCoordinate (tangentOffset a d (signedShortSteps u e)) j) ∧ + ordinary (v j)-ordinary (pointCoordinate (tangentOffset a d (signedShortSteps u e)) j) < ordinary r) + (n : ℕ) (q : Fin 2 → ℤ) (W : polygonAlgebra a) + (hW : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) + (coordinateWindowPrimitives n q) i).val) W.val) + (d : Fin 2) (T : ℕ) (z : ℕ → CutRing × CutRing) (e : ℕ → Fin 5) + (hz : ∀ i, i < T → z (i+1) = z i+tangentOffset a d (signedShortSteps u (e i))) + (hinc : ∀ i, i < T → W ≤ spatialTranslate (z i) (coordinateRectangle a l v)) + (f : TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm)) + (hf : B.AlignedSmallSupported f) + (hc : SmallControlled B.c f (B.windowSector (by omega) n (g n) q W)) + (I : ControlAlphabet (Fin (m+1))) (s : UniversalExtension (alternatingGroup I.val)) + (x : BoundedRelationCover M (alternatingGenerator a r m hm)) (hx : x ∈ f.range) : + B.tangentSign (by omega) k p u h d (z 0) true (universalMap (subtypeAlternatingHom I.val) s)*x* + (B.tangentSign (by omega) k p u h d (z 0) true (universalMap (subtypeAlternatingHom I.val) s))⁻¹ = + B.tangentSign (by omega) k p u h d (z T) true (universalMap (subtypeAlternatingHom I.val) s)*x* + (B.tangentSign (by omega) k p u h d (z T) true (universalMap (subtypeAlternatingHom I.val) s))⁻¹ := by + have hstep i (hi : i < T) : + B.tangentSign (by omega) k p u h d (z i) true (universalMap (subtypeAlternatingHom I.val) s)*x* + (B.tangentSign (by omega) k p u h d (z i) true (universalMap (subtypeAlternatingHom I.val) s))⁻¹ = + B.tangentSign (by omega) k p u h d (z (i+1)) true (universalMap (subtypeAlternatingHom I.val) s)*x* + (B.tangentSign (by omega) k p u h d (z (i+1)) true (universalMap (subtypeAlternatingHom I.val) s))⁻¹ := by + rw [hz i hi] + exact B.tangentSign_step_action hlarge hr k p u h d (e i) (z i) l v hl hv hlv hlen hbox + (hbox' d (e i)) f hf + (B.all_rectangle_control_to_chart hlarge g k p u h d (e i) (z i) l v hl hv n q W hW (hinc i hi) f hf hc) + I s x hx + have he t (ht : t ≤ T) : + B.tangentSign (by omega) k p u h d (z 0) true (universalMap (subtypeAlternatingHom I.val) s)*x* + (B.tangentSign (by omega) k p u h d (z 0) true (universalMap (subtypeAlternatingHom I.val) s))⁻¹ = + B.tangentSign (by omega) k p u h d (z t) true (universalMap (subtypeAlternatingHom I.val) s)*x* + (B.tangentSign (by omega) k p u h d (z t) true (universalMap (subtypeAlternatingHom I.val) s))⁻¹ := by + induction t with + | zero => rfl + | succ t ih => exact (ih (by omega)).trans (hstep t (by omega)) + exact he T le_rfl + +end InitialCoverSystem +end GlobalTangentChain + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/GroupoidComponentHomology.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/GroupoidComponentHomology.lean new file mode 100644 index 0000000000000000000000000000000000000000..2b6a23d571a0dceba55555bc6ffb51c4b194f5f0 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/GroupoidComponentHomology.lean @@ -0,0 +1,82 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.GroupNerveCoordinates +import OAI.GroupTheory.SimpleAmenable.Simplicial.PiFiber + +namespace OAI + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits Simplicial Opposite +namespace GroupoidComponentHomology +open FreeChains ComponentTranslation SimpleAmenable + +variable {C:Type} [Groupoid.{0} C] +noncomputable def inclusion (U:C) : SingleObj (Aut U) ⥤ C := + SingleObj.functor (Aut.toEnd U) +@[simp] lemma inclusion_obj (U:C) (x:SingleObj (Aut U)) : (inclusion U).obj x=U := rfl +@[simp] lemma inclusion_map (U:C) {x y:SingleObj (Aut U)} (f:x⟶y) : + (inclusion U).map f=f.hom := rfl +instance inclusion_faithful (U:C) : (inclusion U).Faithful where + map_injective h := Iso.ext h +noncomputable instance inclusion_full (U:C) : (inclusion U).Full where + map_surjective f := ⟨(Groupoid.isoEquivHom U U).symm f,rfl⟩ +noncomputable def fiberInclusion {p:Skeleton C} (U:Fiber p) : SingleObj (Aut U.obj) ⥤ Fiber p := + (property p).lift (inclusion U.obj) (fun _=>U.property) +instance fiberInclusion_faithful {p:Skeleton C} (U:Fiber p) : (fiberInclusion U).Faithful where + map_injective h := Iso.ext (congrArg (fun f : (fiberInclusion U).obj _ ⟶ (fiberInclusion U).obj _ => f.hom) h) +noncomputable instance fiberInclusion_full {p:Skeleton C} (U:Fiber p) : (fiberInclusion U).Full where + map_surjective f := ⟨(Groupoid.isoEquivHom U.obj U.obj).symm f.hom,rfl⟩ +instance fiberInclusion_essSurj {p:Skeleton C} (U:Fiber p) : (fiberInclusion U).EssSurj where + mem_essImage V := ⟨SingleObj.star _,⟨fiberIso p U V⟩⟩ +noncomputable instance fiberInclusion_isEquivalence {p:Skeleton C} (U:Fiber p) : + (fiberInclusion U).IsEquivalence := ⟨inferInstance,inferInstance,inferInstance⟩ +noncomputable def fiberIsoHomology {p:Skeleton C} (U:Fiber p) (q:ℕ) : + groupHomology (Rep.trivial ℤ (Aut U.obj) ℤ) q ≅ (nerve (Fiber p)).homology Z q := by + haveI := NerveHomotopy.homologyMap_isIso (fiberInclusion U) Z q + exact (GroupNerveCoordinates.homologyIso (Aut U.obj) q).symm ≪≫ + asIso (SSet.homologyMap (nerveMap (fiberInclusion U)) Z q) +end GroupoidComponentHomology + +end + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory +namespace TranslationFiltered + +variable (P:Type) [CommMonoid P] +instance regular_filtered : IsFiltered (ActionCategory P P) where + cocone_objs x y := ⟨(x.back*y.back:P),⟨y.back, by change y.back*x.back=x.back*y.back; exact mul_comm _ _⟩,⟨x.back,rfl⟩,trivial⟩ + cocone_maps {x y} f g := by + refine ⟨(x.back*y.back:P),⟨x.back,rfl⟩,?_⟩ + apply Functor.Elements.Hom.ext + change x.back*f.hom=x.back*g.hom + have h:f.hom*x.back=g.hom*x.back:=f.map_val.trans g.map_val.symm + simpa only [mul_comm] using h + nonempty := inferInstance +abbrev Q := Algebra.GrothendieckGroup P +noncomputable instance completed_action : MulAction P (Q P) := + MulAction.compHom (Q P) Algebra.GrothendieckGroup.of +lemma common_target (x y:Q P) : ∃ r s:P, + Algebra.GrothendieckGroup.of r*x=Algebra.GrothendieckGroup.of s*y := by + let f:=Localization.monoidOf (⊤:Submonoid P) + let t:=f.sec (x*y⁻¹) + refine ⟨t.2.val,t.1,?_⟩ + calc + _ = ((x*y⁻¹)*f t.2)*y := by change f t.2*x=_; simp [mul_assoc,mul_comm,mul_left_comm] + _ = _ := congrArg (fun q:Q P => q*y) (f.sec_spec (x*y⁻¹)) +noncomputable instance completed_filtered : IsFiltered (ActionCategory P (Q P)) where + cocone_objs x y := by + obtain ⟨r,s,h⟩:=common_target P x.back y.back + exact ⟨(Algebra.GrothendieckGroup.of r*x.back:Q P),⟨r,rfl⟩,⟨s,h.symm⟩,trivial⟩ + cocone_maps {x y} f g := by + have he : Algebra.GrothendieckGroup.of f.hom=Algebra.GrothendieckGroup.of g.hom := by + apply mul_right_cancel (b:=x.back) + exact f.map_val.trans g.map_val.symm + obtain ⟨c,hc⟩ := (Localization.monoidOf (⊤:Submonoid P)).exists_of_eq he + refine ⟨(Algebra.GrothendieckGroup.of c.val*y.back:Q P),⟨c.val,rfl⟩,?_⟩ + exact Functor.Elements.Hom.ext hc + nonempty := inferInstance +end TranslationFiltered + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/HomologyAdditive.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/HomologyAdditive.lean new file mode 100644 index 0000000000000000000000000000000000000000..f428f762066491bc5b17781a0f305271a274037c --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/HomologyAdditive.lean @@ -0,0 +1,274 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.TransitiveCanonical +import OAI.GroupTheory.SimpleAmenable.Homology.BoundedHomologyEdge + +namespace OAI + +section + +open CategoryTheory Representation Rep Finsupp +universe u +namespace HomologyAdditive +variable {k G H : Type u} [CommRing k] [Group G] [Group H] + +lemma chainsMap_add (f : G →* H) {A : Rep.{u} k G} {B : Rep.{u} k H} + (φ ψ : A ⟶ Rep.res f B) : + groupHomology.chainsMap f (φ+ψ) = groupHomology.chainsMap f φ + groupHomology.chainsMap f ψ := by + apply HomologicalComplex.hom_ext + intro n + apply ModuleCat.hom_ext + apply Finsupp.lhom_ext + intro x a + change (groupHomology.chainsMap f (φ+ψ)).f n (single x a) = + (groupHomology.chainsMap f φ).f n (single x a) + + (groupHomology.chainsMap f ψ).f n (single x a) + rw [groupHomology.chainsMap_f_single, groupHomology.chainsMap_f_single, + groupHomology.chainsMap_f_single] + change single _ (φ.hom a + ψ.hom a)=_ + exact Finsupp.single_add _ _ _ + +instance additive (n : ℕ) : (groupHomology.functor k G n).Additive where + map_add {A B φ ψ} := by + change HomologicalComplex.homologyMap (groupHomology.chainsMap (MonoidHom.id G) (φ+ψ)) n = _ + rw [chainsMap_add, HomologicalComplex.homologyMap_add] + rfl + +end HomologyAdditive + +end + +open Classical CategoryTheory CategoryTheory.Limits Representation Rep Finsupp +namespace SimpleAmenable + +namespace ConfigurationChains +variable {V : Type*} + +lemma faceSum_ofFn (n : ℕ) (f : Fin (n+1) → V) : + faceSum (List.ofFn f) = ∑i : Fin (n+1), + Finsupp.single (List.ofFn (fun j => f (i.succAbove j))) ((-1:ℤ)^i.val) := by + induction n with + | zero => simp [List.ofFn_succ, faceSum] + | succ n ih => + rw [List.ofFn_succ, faceSum, ih] + conv_rhs => rw [Fin.sum_univ_succ] + simp only [Fin.val_zero, pow_zero, Fin.val_succ, pow_succ, Fin.zero_succAbove, + map_sum, cone_single] + rw [sub_eq_add_neg, ← Finset.sum_neg_distrib] + congr 1 + apply Finset.sum_congr rfl + intro i hi + rw [← Finsupp.single_neg] + congr 1 + · simp [List.ofFn_succ] + · ring + +noncomputable def boundaryRep {G : Type*} [Monoid G] [MulAction G V] + {R : V → V → Prop} (hR : ∀g : G,∀v w,R v w → R (g • v) (g • w)) (n : ℕ) : + Rep.of (representation hR (n+1)) ⟶ Rep.of (representation hR n) := + Rep.ofHom ⟨degreeBoundary R n, by + intro g + apply LinearMap.ext + intro x + exact (representation_boundary hR g n x).symm⟩ +end ConfigurationChains + +namespace PolygonPlacement.Configuration +attribute [local instance 1200] Rep.hV2 +variable {a m p : ℕ} + +noncomputable abbrev column (a m p : ℕ) := + Rep.of (TransitiveInduction.permutationRep + (G:=polygonFullGroup a m) (X:=Configuration a m p)) + +noncomputable def face (i : Fin (p+1)) (f : Configuration a m (p+1)) : + Configuration a m p := + ⟨fun j => f (i.succAbove j),fun j k hjk => f.property (by + intro h + exact hjk (Fin.succAbove_right_injective h))⟩ + +@[simp] lemma face_apply (i : Fin (p+1)) (f : Configuration a m (p+1)) (j : Fin p) : + face i f j=f (i.succAbove j) := rfl + +@[simp] lemma face_smul (i : Fin (p+1)) (g : polygonFullGroup a m) + (f : Configuration a m (p+1)) : face i (g • f)=g • face i f := rfl + +noncomputable def faceHom (a m p : ℕ) (i : Fin (p+1)) : + column a m (p+1) ⟶ column a m p := + TransitiveInduction.equivariantMap (face i) (face_smul i) + +noncomputable def boundary (a m p : ℕ) : column a m (p+1) ⟶ column a m p := + (representationIso a m (p+1)).hom ≫ + ConfigurationChains.boundaryRep (fun g v w h => (apart_smul_iff g v w).mpr h) p ≫ + (representationIso a m p).inv + +lemma boundary_chain (c : Configuration a m (p+1) →₀ ℤ) : + chainEquiv a m p ((boundary a m p).hom c) = + ConfigurationChains.degreeBoundary (@Apart a m) p (chainEquiv a m (p+1) c) := by + change chainEquiv a m p ((chainEquiv a m p).symm _) = _ + exact (chainEquiv a m p).apply_symm_apply _ + +lemma boundary_sum (a m p : ℕ) : boundary a m p = + ∑i : Fin (p+1), ((-1:ℤ)^i.val) • faceHom a m p i := by + apply Rep.hom_ext + apply Representation.IntertwiningMap.ext + apply Finsupp.lhom_ext + intro c z + apply (chainEquiv a m p).injective + change (chainEquiv a m p) ((boundary a m p).hom (Finsupp.single c z)) = _ + rw [boundary_chain] + apply Subtype.ext + change ConfigurationChains.boundary (chainEquiv a m (p+1) (Finsupp.single c z)).val = _ + rw [chainEquiv_single_val, ConfigurationChains.boundary_single, + ConfigurationChains.faceSum_ofFn] + simp only [Finset.smul_sum] + change _ = (chainEquiv a m p + ((∑i : Fin (p+1), ((-1:ℤ)^i.val) • faceHom a m p i).hom (Finsupp.single c z))).val + simp only [Rep.sum_hom, Rep.smul_hom, Representation.IntertwiningMap.sum_apply, + Representation.IntertwiningMap.smul_apply, map_sum, map_smul, Submodule.coe_sum, + Submodule.coe_smul] + apply Finset.sum_congr rfl + intro i hi + change z • Finsupp.single _ ((-1:ℤ)^i.val) = + ((-1:ℤ)^i.val) • ((chainEquiv a m p) + ((faceHom a m p i).hom (Finsupp.single c z))).val + dsimp only [faceHom] + rw [TransitiveInduction.equivariantMap_single] + rw [chainEquiv_single_val] + simp [Finsupp.smul_single, mul_comm, face] + +noncomputable def facePermutation (i j : Fin (p+1)) : Equiv.Perm (Fin (p+1)) := + (finSuccEquiv' i).trans (finSuccEquiv' j).symm + +@[simp] lemma facePermutation_apply (i j : Fin (p+1)) (k : Fin p) : + facePermutation i j (i.succAbove k)=j.succAbove k := by + simp [facePermutation] + +lemma permHom_centralizes (f : Configuration a m p) (σ : Equiv.Perm (Fin p)) + (h : MulAction.stabilizer (polygonFullGroup a m) f) : + permHom f.val f.property σ * h.val = h.val * permHom f.val f.property σ := by + apply Subtype.ext + apply Equiv.ext + intro x + have hh (i : Fin p) (y : GenericSquare a) : h.val.val (f i y)=f i y := + congrArg (fun t : Configuration a m p => t i y) h.property + have hs : SupportedIn (permHom f.val f.property σ).val (Set.range (bank f.val f.property)) := by + intro x hx + apply perm_fixed + intro i hi + obtain ⟨y,rfl⟩ := hi + exact hx ⟨(i,y),rfl⟩ + have he := supported_fixer_commute (f:=h.val.val) (by + rintro x ⟨⟨i,y⟩,rfl⟩ + exact hh i y) hs + exact congrArg (fun e : Equiv.Perm (TrackPoint a m) => e x) he.symm.eq + +lemma permHom_face (f : Configuration a m (p+1)) (i j : Fin (p+1)) : + permHom f.val f.property (facePermutation i j) • face i f=face j f := by + apply ext + intro k + apply PolygonPlacement.ext + intro x + change (permHom f.val f.property (facePermutation i j)).val (f (i.succAbove k) x) = + f (j.succAbove k) x + rw [permHom_apply, facePermutation_apply] + +lemma homology_face_eq (a m p : ℕ) (hm : 3*(p+1)+1 < m) (q : ℕ) + (i j : Fin (p+1)) : + (groupHomology.functor ℤ (polygonFullGroup a m) q).map (faceHom a m p i) = + (groupHomology.functor ℤ (polygonFullGroup a m) q).map (faceHom a m p j) := by + have hm' : p+1 ≤ m := by omega + let f : Configuration a m (p+1) := + ⟨fun k => PolygonPlacement.standard (Fin.castLE hm' k),fun k l hkl => + standard_apart (fun he => hkl (Fin.castLE_injective hm' he))⟩ + exact TransitiveInduction.map_equivariant_eq_of_centralizer (face j) (face i) + (face_smul j) (face_smul i) f (fun h => transitive f h hm) + (permHom f.val f.property (facePermutation j i)) + (permHom_centralizes f _) (permHom_face f j i) q + +lemma boundary_two (a m : ℕ) : boundary a m 1 = faceHom a m 1 0 - faceHom a m 1 1 := by + rw [boundary_sum, Fin.sum_univ_two] + simp [sub_eq_add_neg] + +lemma boundary_three (a m : ℕ) : boundary a m 2 = + faceHom a m 2 0 - faceHom a m 2 1 + faceHom a m 2 2 := by + rw [boundary_sum, Fin.sum_univ_succ, Fin.sum_univ_two] + norm_num + abel + +lemma homology_boundary_two_zero (a m : ℕ) (hm : 7 < m) (q : ℕ) : + (groupHomology.functor ℤ (polygonFullGroup a m) q).map (boundary a m 1)=0 := by + rw [boundary_two, Functor.map_sub, homology_face_eq a m 1 hm q 1 0, sub_self] + +lemma homology_boundary_three (a m : ℕ) (hm : 10 < m) (q : ℕ) : + (groupHomology.functor ℤ (polygonFullGroup a m) q).map (boundary a m 2)= + (groupHomology.functor ℤ (polygonFullGroup a m) q).map (faceHom a m 2 0) := by + rw [boundary_three, Functor.map_add, Functor.map_sub, + homology_face_eq a m 2 hm q 1 0, homology_face_eq a m 2 hm q 2 0, sub_self, zero_add] + +noncomputable def standardLE (a m p : ℕ) (hp : p ≤ m) : Configuration a m p := + ⟨fun k => PolygonPlacement.standard (Fin.castLE hp k),fun _ _ hkl => + standard_apart (fun he => hkl (Fin.castLE_injective hp he))⟩ + +lemma boundary_square (a m p : ℕ) : boundary a m (p+1) ≫ boundary a m p=0 := by + apply Rep.hom_ext + apply Representation.IntertwiningMap.ext + apply LinearMap.ext + intro c + apply (chainEquiv a m p).injective + change chainEquiv a m p ((boundary a m p).hom ((boundary a m (p+1)).hom c)) = + chainEquiv a m p 0 + rw [boundary_chain, boundary_chain, ConfigurationChains.degreeBoundary_square, map_zero] + +lemma boundary_exact (a m p : ℕ) (hm : 33 ≤ m) (hp : p ≤ 2) : + (ShortComplex.mk (boundary a m (p+1)) (boundary a m p) (boundary_square a m p)).Exact := by + apply (ShortComplex.exact_map_iff_of_faithful _ (forget₂ (Rep.{0} ℤ (polygonFullGroup a m)) + (ModuleCat.{0} ℤ))).mp + rw [ShortComplex.moduleCat_exact_iff] + intro x hx + change (boundary a m p).hom x=0 at hx + have hc : ConfigurationChains.degreeBoundary (@Apart a m) p (chainEquiv a m (p+1) x)=0 := by + rw [← boundary_chain, hx, map_zero] + obtain ⟨y,hy⟩ := (configuration_lowDegree_exact hm hp _).mp hc + refine ⟨(chainEquiv a m (p+2)).symm y,?_⟩ + apply (chainEquiv a m (p+1)).injective + change chainEquiv a m (p+1) ((boundary a m (p+1)).hom _) = _ + rw [boundary_chain, LinearEquiv.apply_symm_apply, hy] + +lemma boundary_zero_eq_face (a m : ℕ) : boundary a m 0=faceHom a m 0 0 := by + rw [boundary_sum] + simp + +lemma boundary_zero_epi (a m : ℕ) (hm : 0 < m) : Epi (boundary a m 0) := by + rw [boundary_zero_eq_face, Rep.epi_iff_surjective] + change Function.Surjective (Finsupp.mapDomain (face (0:Fin 1))) + apply Finsupp.mapDomain_surjective + intro f + refine ⟨standardLE a m 1 (by omega),?_⟩ + apply ext + intro i + exact Fin.elim0 i + +lemma face_H0_isIso (a m p : ℕ) (hm : 3*(p+1)+1 < m) (i : Fin (p+1)) : + IsIso ((groupHomology.functor ℤ (polygonFullGroup a m) 0).map (faceHom a m p i)) := by + let f := standardLE a m (p+1) (by omega : p+1 ≤ m) + exact TransitiveInduction.isIso_map_equivariant_H0 (face i) (face_smul i) f + (fun h => transitive f h hm) (fun h => transitive _ h (by omega)) + +lemma boundary_two_H0_isIso (a m : ℕ) (hm : 10 < m) : + IsIso ((groupHomology.functor ℤ (polygonFullGroup a m) 0).map (boundary a m 2)) := by + rw [homology_boundary_three a m hm 0] + exact face_H0_isIso a m 2 hm 0 +lemma boundary_zero_H1_isIso (a m : ℕ) (hm : 33 ≤ m) : + IsIso ((groupHomology.functor ℤ (polygonFullGroup a m) 1).map (boundary a m 0)) := by + let boundaryEpi := boundary_zero_epi a m (by omega) + let boundaryIso : IsIso (BoundedHomologyEdge.Hmap 0 (boundary a m 2)) := + boundary_two_H0_isIso a m (by omega) + exact BoundedHomologyEdge.chain_H1_isIso (boundary a m 0) (boundary a m 1) + (boundary a m 2) (boundary_square a m 0) (boundary_square a m 1) + (boundary_exact a m 0 hm (by omega)) (boundary_exact a m 1 hm (by omega)) + (homology_boundary_two_zero a m (by omega) 1) + +end PolygonPlacement.Configuration +end SimpleAmenable + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/IntegralHomologyFunctorial.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/IntegralHomologyFunctorial.lean new file mode 100644 index 0000000000000000000000000000000000000000..92b773de8bf99e9e0497572ecff85ca1a21c3340 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/IntegralHomologyFunctorial.lean @@ -0,0 +1,192 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.IntegralTransgressionFinite + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section IntegralHomologyFunctorial +open Classical CategoryTheory Finsupp groupHomology +namespace IntegralHomology +variable {E F G : Type} [Group E] [Group F] [Group G] + +lemma chainsMap2_eq (f : E →* F) : + (chainsMap₂ f (coefficientMap f)).hom=mapC2 f := by + apply Finsupp.lhom_ext + intro xy n + simp [chainsMap₂,coefficientMap,mapC2] + +lemma cyclesMap2_val (f : E →* F) (x : cycles₂ (coefficients E)) : + (mapCycles₂ f (coefficientMap f) x).val=mapC2 f x.val := by + rw [coe_mapCycles₂] + exact LinearMap.congr_fun (chainsMap2_eq f) x.val + +theorem mapH2_inner (c : E) : mapH2 (MulAut.conj c).toMonoidHom=LinearMap.id := by + apply LinearMap.ext + intro z + induction z using H2_induction_on with + | h x => + change groupHomology.map (MulAut.conj c).toMonoidHom _ 2 (H2π (coefficients E) x)= + H2π (coefficients E) x + rw [H2π_comp_map_apply] + apply (H2π_eq_iff _ _).mpr + change ∃y, d₃₂ (coefficients E) y= + (mapCycles₂ (MulAut.conj c).toMonoidHom (coefficientMap _) x).val-x.val + rw [cyclesMap2_val] + refine ⟨-prism2 c x.val,?_⟩ + have ht := LinearMap.congr_fun (prism_identity c) x.val + change d₃₂ (coefficients E) (prism2 c x.val) + prism1 c (d₂₁ (coefficients E) x.val) = + x.val-mapC2 (MulAut.conj c).toMonoidHom x.val at ht + have hx : d₂₁ (coefficients E) x.val=0 := x.property + rw [hx,map_zero,add_zero] at ht + rw [map_neg,ht] + abel + +@[simp] theorem mapH2_id : mapH2 (MonoidHom.id E)=LinearMap.id := by + have he : coefficientMap (MonoidHom.id E)=𝟙 (coefficients E) := rfl + unfold mapH2 + rw [he,groupHomology.map_id] + rfl + +theorem mapH2_comp (f : E →* F) (g : F →* G) : + mapH2 (g.comp f)=(mapH2 g).comp (mapH2 f) := by + have he : coefficientMap (g.comp f)=coefficientMap f ≫ (Rep.resFunctor f).map (coefficientMap g) := by + apply Rep.hom_ext + ext + rfl + unfold mapH2 + rw [he,groupHomology.map_comp] + rfl + +theorem mapH2_conjugate (c : F) (f : E →* F) : + mapH2 ((MulAut.conj c).toMonoidHom.comp f)=mapH2 f := by + rw [mapH2_comp,mapH2_inner,LinearMap.id_comp] + +end IntegralHomology +end IntegralHomologyFunctorial + +section ConfigurationChains +open Classical Finsupp +namespace ConfigurationChains +variable {V : Type*} +abbrev Chain (V : Type*) := List V →₀ ℤ + +noncomputable def cone (v : V) : Chain V →ₗ[ℤ] Chain V := + Finsupp.lmapDomain ℤ ℤ (List.cons v) + +@[simp] theorem cone_single (v : V) (l : List V) (n : ℤ) : + cone v (single l n)=single (v::l) n := by + simp [cone] + +noncomputable def faceSum : List V → Chain V + | [] => 0 + | v::l => single l 1-cone v (faceSum l) + +noncomputable def boundary : Chain V →ₗ[ℤ] Chain V := + Finsupp.linearCombination ℤ faceSum + +@[simp] theorem boundary_single (l : List V) (n : ℤ) : + boundary (single l n)=n • faceSum l := by + simp [boundary] + +theorem boundary_cone (v : V) (c : Chain V) : + boundary (cone v c)=c-cone v (boundary c) := by + induction c using Finsupp.induction with + | zero => simp + | @single_add l n c hl hn ih => + simp only [map_add,cone_single,boundary_single,faceSum,smul_sub,map_smul,ih] + rw [Finsupp.smul_single,smul_eq_mul,mul_one] + abel + +@[simp] theorem boundary_faceSum (l : List V) : boundary (faceSum l)=0 := by + induction l with + | nil => simp [faceSum] + | cons v l ih => simp [faceSum,boundary_cone,ih] + +@[simp] theorem boundary_boundary (c : Chain V) : boundary (boundary c)=0 := by + induction c using Finsupp.induction with + | zero => simp + | @single_add l n c hl hn ih => simp [ih] + +noncomputable def vertices (c : Chain V) : Finset V := c.support.biUnion List.toFinset + +@[simp] theorem vertices_zero : vertices (0 : Chain V)=∅ := by simp [vertices] + +theorem mem_vertices {c : Chain V} {v : V} : v∈vertices c ↔ ∃l∈c.support,v∈l := by + simp [vertices] + +theorem vertices_single_subset (l : List V) (n : ℤ) : + vertices (single l n)⊆l.toFinset := by + intro v hv + obtain ⟨s,hs,hv⟩ := mem_vertices.mp hv + have he : s=l := Finset.mem_singleton.mp (Finsupp.support_single_subset hs) + simpa [he] using hv + +theorem vertices_add_subset (c d : Chain V) : vertices (c+d)⊆vertices c∪vertices d := by + intro v hv + obtain ⟨l,hl,hv⟩ := mem_vertices.mp hv + rcases Finset.mem_union.mp (Finsupp.support_add hl) with hl|hl + · exact Finset.mem_union.mpr (Or.inl (mem_vertices.mpr ⟨l,hl,hv⟩)) + · exact Finset.mem_union.mpr (Or.inr (mem_vertices.mpr ⟨l,hl,hv⟩)) + +@[simp] theorem vertices_neg (c : Chain V) : vertices (-c)=vertices c := by + simp [vertices] + +theorem vertices_sub_subset (c d : Chain V) : vertices (c-d)⊆vertices c∪vertices d := by + simpa [sub_eq_add_neg] using vertices_add_subset c (-d) + +theorem cone_support_subset (v : V) (c : Chain V) : + (cone v c).support⊆c.support.image (List.cons v) := by + exact Finsupp.mapDomain_support + +theorem vertices_cone_subset (v : V) (c : Chain V) : + vertices (cone v c)⊆insert v (vertices c) := by + intro x hx + obtain ⟨l,hl,hx⟩ := mem_vertices.mp hx + obtain ⟨s,hs,rfl⟩ := Finset.mem_image.mp (cone_support_subset v c hl) + rcases List.mem_cons.mp hx with rfl|hx + · exact Finset.mem_insert_self _ _ + · exact Finset.mem_insert_of_mem (mem_vertices.mpr ⟨s,hs,hx⟩) + +theorem faceSum_support {l s : List V} (hs : s∈(faceSum l).support) : + s.Sublist l ∧ s.length+1=l.length := by + induction l generalizing s with + | nil => simp [faceSum] at hs + | cons v l ih => + have hu := Finsupp.support_sub hs + rcases Finset.mem_union.mp hu with hs|hs + · have he : s=l := Finset.mem_singleton.mp (Finsupp.support_single_subset hs) + subst s + exact ⟨List.sublist_cons_self _ _,by simp⟩ + · obtain ⟨t,ht,rfl⟩ := Finset.mem_image.mp (cone_support_subset v _ hs) + obtain ⟨hts,htl⟩ := ih ht + exact ⟨hts.cons_cons _,by simp; omega⟩ + +theorem faceSum_support_card (l : List V) : (faceSum l).support.card≤l.length := by + induction l with + | nil => simp [faceSum] + | cons v l ih => + calc + (faceSum (v::l)).support.card ≤ + ((single l (1:ℤ)).support∪(cone v (faceSum l)).support).card := + Finset.card_le_card Finsupp.support_sub + _ ≤ (single l (1:ℤ)).support.card+(cone v (faceSum l)).support.card := Finset.card_union_le _ _ + _ ≤ 1+(faceSum l).support.card := by + have hc := Finset.card_le_card (cone_support_subset v (faceSum l)) + have hi := Finset.card_image_le (s:=(faceSum l).support) (f:=List.cons v) + simp only [Finsupp.support_single _ (by decide : (1:ℤ)≠0),Finset.card_singleton] + omega + _ ≤ (v::l).length := by simp; omega + +end ConfigurationChains +end ConfigurationChains + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/IntegralTransgressionFinite.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/IntegralTransgressionFinite.lean new file mode 100644 index 0000000000000000000000000000000000000000..dd4ed05cf1cf5bf9123feb0d91504bc80b4de4b0 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/IntegralTransgressionFinite.lean @@ -0,0 +1,155 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.FiniteCentralKernel +import OAI.GroupTheory.SimpleAmenable.Homology.IntegralTransgressionHomology + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section IntegralTransgressionFinite +open Classical +namespace IntegralTransgression +open groupHomology CategoryTheory +variable {H E : Type} [Group H] [Group E] +variable (q : H →* E) (hq : Function.Surjective q) (hc : q.ker ≤ Subgroup.center H) + + theorem onCycles_kills_homology_kernel : + (H2π (coefficients E)).hom.ker ≤ (onCycles q hq hc).ker := by + intro x hx + have hb := (H2π_eq_zero_iff x).mp hx + obtain ⟨y,hy⟩ := hb + change onChains q hq hc x.val=0 + rw [←hy] + exact LinearMap.congr_fun (onChains_d3 q hq hc) y + +theorem cycles_to_h2_surjective : Function.Surjective (H2π (coefficients E)) := by + intro x + induction x using H2_induction_on with + | h x => exact ⟨x,rfl⟩ + +noncomputable def transgression : H2 (coefficients E) →ₗ[ℤ] Additive (Kernel q hc) := +by + let f : cycles₂ (coefficients E) →ₗ[ℤ] H2 (coefficients E) := (H2π (coefficients E)).hom + have hf : Function.Surjective f := cycles_to_h2_surjective + have hk : f.ker ≤ (onCycles q hq hc).ker := onCycles_kills_homology_kernel q hq hc + exact factorThrough f hf (onCycles q hq hc) hk + +@[simp] theorem transgression_cycle (x : cycles₂ (coefficients E)) : + transgression q hq hc (H2π (coefficients E) x)=onCycles q hq hc x := + factorThrough_apply _ _ _ _ x + +theorem transgression_surjective [Group.IsPerfect H] : + Function.Surjective (transgression q hq hc) := by + intro k + obtain ⟨x,hx⟩ := onCycles_surjective q hq hc k + exact ⟨H2π (coefficients E) x,(transgression_cycle q hq hc x).trans hx⟩ + +include hq hc in + +theorem kernel_fg [Group.IsPerfect H] [Module.Finite ℤ (H2 (coefficients E))] : + Group.FG q.ker := by + have : Module.Finite ℤ (Additive (Kernel q hc)) := + Module.Finite.of_surjective (transgression q hq hc) (transgression_surjective q hq hc) + have : AddGroup.FG (Additive (Kernel q hc)) := Module.Finite.iff_addGroup_fg.mp inferInstance + have : Group.FG (Kernel q hc) := GroupFG.iff_add_fg.mpr inferInstance + exact this + +end IntegralTransgression +end IntegralTransgressionFinite + +section HomologyFinitePresentation + +theorem universalKernel_fg_of_integral_h2 {E : Type} [Group E] [Group.IsPerfect E] + [Module.Finite ℤ (groupHomology.H2 (IntegralTransgression.coefficients E))] : + Group.FG (universalProjection E).ker := + IntegralTransgression.kernel_fg (universalProjection E) + (universalProjection_surjective E) (universalProjection_central E) + +theorem finitelyPresented_of_central_cover_h2 {H E : Type} [Group H] [Group E] + [Group.IsPerfect E] [Group.IsFinitelyPresented H] + [Module.Finite ℤ (groupHomology.H2 (IntegralTransgression.coefficients E))] + (q : H →* E) (hq : Function.Surjective q) (hc : q.ker ≤ Subgroup.center H) : + Group.IsFinitelyPresented E := by + have := universalKernel_fg_of_integral_h2 (E:=E) + exact finitelyPresented_of_central_cover q hq hc + +end HomologyFinitePresentation + +section IntegralHomologyConjugation +open Classical CategoryTheory Finsupp groupHomology +namespace IntegralHomology + +abbrev coefficients (E : Type) [Group E] := IntegralTransgression.coefficients E + +variable {E F : Type} [Group E] [Group F] + +noncomputable def coefficientMap (f : E →* F) : coefficients E ⟶ Rep.res f (coefficients F) := + Rep.ofHom ⟨LinearMap.id,fun _ => rfl⟩ + +noncomputable def mapH2 (f : E →* F) : H2 (coefficients E) →ₗ[ℤ] H2 (coefficients F) := + (groupHomology.map f (coefficientMap f) 2).hom + +noncomputable def mapC2 (f : E →* F) : (E×E →₀ ℤ) →ₗ[ℤ] (F×F →₀ ℤ) := + Finsupp.lmapDomain ℤ ℤ (Prod.map f f) + +@[simp] theorem mapC2_single (f : E →* F) (x y : E) (n : ℤ) : + mapC2 f (single (x,y) n)=single (f x,f y) n := by + simp [mapC2] + +noncomputable def prism1 (c : E) : (E →₀ ℤ) →ₗ[ℤ] (E×E →₀ ℤ) := + Finsupp.linearCombination ℤ (fun x => single (c,x) 1 - single (MulAut.conj c x,c) 1) + +noncomputable def prism2 (c : E) : (E×E →₀ ℤ) →ₗ[ℤ] (E×E×E →₀ ℤ) := + Finsupp.linearCombination ℤ (fun xy => + single (c,xy.1,xy.2) 1 - single (MulAut.conj c xy.1,c,xy.2) 1 + + single (MulAut.conj c xy.1,MulAut.conj c xy.2,c) 1) + +@[simp] theorem prism1_single (c x : E) (n : ℤ) : + prism1 c (single x n)=single (c,x) n-single (MulAut.conj c x,c) n := by + simp [prism1,smul_sub,Finsupp.smul_single] + +@[simp] theorem prism2_single (c x y : E) (n : ℤ) : + prism2 c (single (x,y) n)=single (c,x,y) n-single (MulAut.conj c x,c,y) n+ + single (MulAut.conj c x,MulAut.conj c y,c) n := by + simp [prism2,smul_sub,smul_add,Finsupp.smul_single] + +lemma boundary2_single (x y : E) (n : ℤ) : + d₂₁ (coefficients E) (single (x,y) n)=single y n-single (x*y) n+single x n := by + rw [d₂₁_single] + rfl + +lemma boundary3_single (x y z : E) (n : ℤ) : + d₃₂ (coefficients E) (single (x,y,z) n)= + single (y,z) n-single (x*y,z) n+single (x,y*z) n-single (x,y) n := by + rw [d₃₂_single] + rfl + +theorem prism_identity (c : E) : + (d₃₂ (coefficients E)).hom.comp (prism2 c) + + (prism1 c).comp (d₂₁ (coefficients E)).hom = + LinearMap.id - mapC2 (MulAut.conj c).toMonoidHom := by + apply Finsupp.lhom_ext + intro xy n + rcases xy with ⟨x,y⟩ + change d₃₂ (coefficients E) (prism2 c (single (x,y) n)) + + prism1 c (d₂₁ (coefficients E) (single (x,y) n)) = + single (x,y) n-mapC2 (MulAut.conj c).toMonoidHom (single (x,y) n) + rw [prism2_single, map_add, map_sub, boundary3_single, boundary3_single, + boundary3_single, boundary2_single, map_add, map_sub, prism1_single, + prism1_single, prism1_single, mapC2_single] + simp only [MulEquiv.toMonoidHom_eq_coe,MonoidHom.coe_coe,MulAut.conj_apply,mul_assoc, + inv_mul_cancel_left,inv_mul_cancel,mul_one] + abel + +end IntegralHomology +end IntegralHomologyConjugation + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/IntegralTransgressionHomology.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/IntegralTransgressionHomology.lean new file mode 100644 index 0000000000000000000000000000000000000000..98fb27c861059cc6e8d77e2ec3f22b3494da295d --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/IntegralTransgressionHomology.lean @@ -0,0 +1,161 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.VerticalStringResolution + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section IntegralTransgressionHomology +open Classical +open scoped TensorProduct +namespace IntegralTransgression +open groupHomology +variable {H E : Type} [Group H] [Group E] + +abbrev coefficients (E : Type) [Group E] := Rep.trivial ℤ E ℤ + +theorem d2_surjective [Group.IsPerfect E] : + Function.Surjective (d₂₁ (coefficients E)) := by + intro z + let c : cycles₁ (coefficients E) := (cycles₁IsoOfIsTrivial (coefficients E)).inv z + have hz : H1π (coefficients E) c = 0 := by + apply (H1AddEquivOfIsTrivial (coefficients E)).injective + have : Group.IsPerfect (Abelianization E) := + Group.IsPerfect.ofSurjective (f := Abelianization.of) (QuotientGroup.mk'_surjective (commutator E)) + have : Subsingleton (Abelianization E) := inferInstance + have : Subsingleton (Additive (Abelianization E) ⊗[ℤ] ℤ) := inferInstance + exact Subsingleton.elim _ _ + have h := (H1π_eq_zero_iff c).mp hz + exact h + +variable (q : H →* E) (hq : Function.Surjective q) (hc : q.ker ≤ Subgroup.center H) + +noncomputable def onChains : (E × E →₀ ℤ) →ₗ[ℤ] Additive (Kernel q hc) := + Finsupp.linearCombination ℤ (fun xy : E×E => Additive.ofMul (factor q hq hc xy.1 xy.2)) + +@[simp] theorem onChains_single (x y : E) (n : ℤ) : + onChains q hq hc (Finsupp.single (x,y) n)= n • Additive.ofMul (factor q hq hc x y) := by + simp only [onChains,Finsupp.linearCombination_single] + +theorem additive_cocycle (x y z : E) : + Additive.ofMul (factor q hq hc y z) - Additive.ofMul (factor q hq hc (x*y) z) + + Additive.ofMul (factor q hq hc x (y*z)) - Additive.ofMul (factor q hq hc x y)=0 := by + have he : Additive.ofMul (factor q hq hc x y) + Additive.ofMul (factor q hq hc (x*y) z) = + Additive.ofMul (factor q hq hc y z) + Additive.ofMul (factor q hq hc x (y*z)) := + congrArg Additive.ofMul (factor_cocycle q hq hc x y z) + calc + _ = (Additive.ofMul (factor q hq hc y z) + Additive.ofMul (factor q hq hc x (y*z))) - + (Additive.ofMul (factor q hq hc x y) + Additive.ofMul (factor q hq hc (x*y) z)) := by abel + _ = 0 := sub_eq_zero.mpr he.symm + +theorem onChains_d3 : + (onChains q hq hc).comp (d₃₂ (coefficients E)).hom = 0 := by + apply Finsupp.lhom_ext + intro xyz n + rcases xyz with ⟨x,y,z⟩ + change onChains q hq hc (d₃₂ (coefficients E) (Finsupp.single (x,y,z) n)) = 0 + rw [d₃₂_single (A := coefficients E) (x,y,z) n] + change onChains q hq hc ((Finsupp.single (y,z) n - Finsupp.single (x*y,z) n) + + Finsupp.single (x,y*z) n - Finsupp.single (x,y) n)=0 + rw [(onChains q hq hc).map_sub, (onChains q hq hc).map_add, + (onChains q hq hc).map_sub] + simp only [onChains_single] + simpa only [zsmul_sub,zsmul_add,zsmul_zero] using + congrArg (fun v : Additive (Kernel q hc) => (n : ℤ) • v) (additive_cocycle q hq hc x y z) + +noncomputable def onCycles : cycles₂ (coefficients E) →ₗ[ℤ] Additive (Kernel q hc) := + (onChains q hq hc).comp (cycles₂ (coefficients E)).subtype + +end IntegralTransgression +end IntegralTransgressionHomology + +section IntegralTransgressionSurjective +open Classical +namespace IntegralTransgression +open groupHomology + +noncomputable def factorThrough {R : Type*} [CommRing R] {M N P : Type*} [AddCommGroup M] [AddCommGroup N] + [AddCommGroup P] [Module R M] [Module R N] [Module R P] (f : M →ₗ[R] N) (hf : Function.Surjective f) + (g : M →ₗ[R] P) (hg : f.ker ≤ g.ker) : N →ₗ[R] P := + (f.ker.liftQ g hg).comp (f.quotKerEquivOfSurjective hf).symm.toLinearMap + +@[simp] theorem factorThrough_apply {R : Type*} [CommRing R] {M N P : Type*} [AddCommGroup M] [AddCommGroup N] + [AddCommGroup P] [Module R M] [Module R N] [Module R P] (f : M →ₗ[R] N) (hf : Function.Surjective f) + (g : M →ₗ[R] P) (hg : f.ker ≤ g.ker) (x : M) : + factorThrough f hf g hg (f x)=g x := by + simp [factorThrough] + +variable {H E : Type} [Group H] [Group E] +variable (q : H →* E) (hq : Function.Surjective q) (hc : q.ker ≤ Subgroup.center H) + +theorem onCycles_surjective [Group.IsPerfect H] : + Function.Surjective (onCycles q hq hc) := by + let : Group.IsPerfect E := Group.IsPerfect.ofSurjective (f := q) hq + let R := (onCycles q hq hc).range + let Q := Additive (Kernel q hc) ⧸ R + let u : (E×E →₀ ℤ) →ₗ[ℤ] Q := R.mkQ.comp (onChains q hq hc) + have hu : (d₂₁ (coefficients E)).hom.ker ≤ u.ker := by + intro x hx + change R.mkQ (onChains q hq hc x)=0 + apply (Submodule.Quotient.mk_eq_zero R).mpr + exact ⟨⟨x,hx⟩,rfl⟩ + let b : (E →₀ ℤ) →ₗ[ℤ] Q := + factorThrough (d₂₁ (coefficients E)).hom d2_surjective u hu + have hb (x : E×E →₀ ℤ) : b (d₂₁ (coefficients E) x)=u x := + factorThrough_apply _ _ _ _ x + have hp (x y : E) : + R.mkQ (Additive.ofMul (factor q hq hc x y)) = + b (Finsupp.single y 1) - b (Finsupp.single (x*y) 1) + b (Finsupp.single x 1) := by + have ht := hb (Finsupp.single (x,y) 1) + change b (d₂₁ (coefficients E) (Finsupp.single (x,y) (1:ℤ))) = + R.mkQ (onChains q hq hc (Finsupp.single (x,y) 1)) at ht + rw [d₂₁_single (A:=coefficients E) (x,y) (1:ℤ)] at ht + change b (Finsupp.single y 1 - Finsupp.single (x*y) 1 + Finsupp.single x 1) = + R.mkQ (onChains q hq hc (Finsupp.single (x,y) 1)) at ht + simpa only [map_add,map_sub,onChains_single,one_smul] using ht.symm + have hb1 : b (Finsupp.single 1 1)=0 := by + simpa using (hp 1 1).symm + let t : H →* Multiplicative Q := + { toFun := fun h => Multiplicative.ofAdd + (R.mkQ (Additive.ofMul (remainder q hq hc h)) + b (Finsupp.single (q h) 1)) + map_one' := by + apply Multiplicative.toAdd.injective + change R.mkQ (Additive.ofMul (remainder q hq hc 1)) + b (Finsupp.single (q 1) 1)=0 + simp [hb1] + map_mul' h k := by + apply Multiplicative.toAdd.injective + change R.mkQ (Additive.ofMul (remainder q hq hc (h*k))) + + b (Finsupp.single (q (h*k)) 1) = + (R.mkQ (Additive.ofMul (remainder q hq hc h)) + b (Finsupp.single (q h) 1)) + + (R.mkQ (Additive.ofMul (remainder q hq hc k)) + b (Finsupp.single (q k) 1)) + rw [remainder_mul] + change R.mkQ (Additive.ofMul (remainder q hq hc h) + + Additive.ofMul (remainder q hq hc k) + Additive.ofMul (factor q hq hc (q h) (q k))) + + b (Finsupp.single (q (h*k)) 1) = _ + rw [map_add,map_add,hp,map_mul] + abel } + have ht (h : H) : t h=1 := by + let : Group.IsPerfect t.range := Group.IsPerfect.range t + have : Subsingleton t.range := inferInstance + exact congrArg Subtype.val (Subsingleton.elim (⟨t h,h,rfl⟩ : t.range) 1) + intro k + have hz : R.mkQ k=0 := by + have he := congrArg Multiplicative.toAdd (ht (inclusion q hc k.toMul)) + change R.mkQ (Additive.ofMul (remainder q hq hc (inclusion q hc k.toMul))) + + b (Finsupp.single (q (inclusion q hc k.toMul)) 1)=0 at he + have hk : q (inclusion q hc k.toMul)=1 := k.toMul.property + simpa only [remainder_inclusion,ofMul_toMul,hk,hb1,add_zero] using he + exact (Submodule.Quotient.mk_eq_zero R).mp hz + +end IntegralTransgression +end IntegralTransgressionSurjective + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/InwardTemplateResolutions.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/InwardTemplateResolutions.lean new file mode 100644 index 0000000000000000000000000000000000000000..2e5020db8d5f9fa857a9a3746559c631dc67ad81 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/InwardTemplateResolutions.lean @@ -0,0 +1,83 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.CrossingCellActions +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.ConcurrentInwardModel + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section InwardTemplateResolutions +namespace InitialCoverSystem.PatchAtlas +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + {B : InitialCoverSystem a r m hm M} + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] (A : B.PatchAtlas) + +omit [Group.IsPerfect (alternatingGroup (Fin (m+1)))] in +theorem concurrent_margin_resolved (t : VertexType (commonVertexDenominator a)) + (u : CutRing × CutRing) : + ResolvedBy (fun i => (primitiveTests (a := a) (r := r) (A.concurrentPrimitives t u) i).val) + (A.geometry.marginPolygon t u).val := by + intro x y hh + exact translatedTemplate_resolved (Sum.elim + (fun j : Fin 4 => (⟨j.val+1,by omega⟩,A.geometry.anchors t j)) + (coordinateWindowPrimitives A.geometry.window A.geometry.start)) + (coordinateRectangle a (A.geometry.margins t).lower (A.geometry.margins t).upper) + (fun x y hh => A.geometry.margin_resolved t x y (fun i => hh (Sum.inr i))) u x y hh + +omit [Group.IsPerfect (alternatingGroup (Fin (m+1)))] in +theorem concurrent_positive_resolved (t : VertexType (commonVertexDenominator a)) + (u : CutRing × CutRing) (j : Fin 4) : + ResolvedBy (fun i => (primitiveTests (a := a) (r := r) (A.concurrentPrimitives t u) i).val) + (A.geometry.positiveDecision t u j).val := by + intro x y hh + exact hh (Sum.inl j) + +omit [Group.IsPerfect (alternatingGroup (Fin (m+1)))] in +theorem concurrent_inward_resolved (t : VertexType (commonVertexDenominator a)) + (u : CutRing × CutRing) (z : ℝ × ℝ) : + ResolvedBy (fun i => (primitiveTests (a := a) (r := r) (A.concurrentPrimitives t u) i).val) + (A.geometry.inwardMargin t u z).val := by + intro x y hh + have hgate k : x ∈ (A.geometry.inwardGate t u z k).val ↔ y ∈ (A.geometry.inwardGate t u z k).val := by + dsimp only [ConcurrentGeometry.inwardGate] + split_ifs + · exact A.concurrent_positive_resolved t u (axisDirection k) x y hh + · exact not_congr (A.concurrent_positive_resolved t u (axisDirection k) x y hh) + · exact Iff.rfl + exact and_congr (and_congr (A.concurrent_margin_resolved t u x y hh) (hgate 0)) (hgate 1) + +omit [Group.IsPerfect (alternatingGroup (Fin (m+1)))] in +theorem concurrent_localDecision_resolved (t : VertexType (commonVertexDenominator a)) + (u : CutRing × CutRing) (z : ℝ × ℝ) (j : Fin 4) (c : CutRing) : + ResolvedBy (fun i => (primitiveTests (a := a) (r := r) (A.concurrentPrimitives t u) i).val) + (A.geometry.localDecision t u z j c).val := by + intro x y hh + dsimp only [ConcurrentGeometry.localDecision] + split_ifs + · exact not_congr (A.concurrent_positive_resolved t u j x y hh) + · exact Iff.rfl + · exact Iff.rfl + +end InitialCoverSystem.PatchAtlas + +theorem polygonBooleanPullback_resolved {a : ℕ} {ι κ : Type*} [Finite κ] + (U : ι → polygonAlgebra a) (V : κ → polygonAlgebra a) + (h : ∀ i, ResolvedBy (fun j => (U j).val) (V i).val) (S : Set (κ → Bool)) : + ResolvedBy (fun j => (U j).val) (polygonBooleanPullback V S).val := by + intro x y hxy + have he : polygonAssignment V x=polygonAssignment V y := + (polygonAssignment_eq_iff V x y).mpr (fun i => h i x y hxy) + change polygonAssignment V x ∈ S ↔ polygonAssignment V y ∈ S + rw [he] + +end InwardTemplateResolutions + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/LabelRelabel.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/LabelRelabel.lean new file mode 100644 index 0000000000000000000000000000000000000000..16676112901951fcd3bf75433fbca33ad049f31a --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/LabelRelabel.lean @@ -0,0 +1,78 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.LabelledMonoidal + +namespace OAI + +section +open CategoryTheory MonoidalCategory +namespace SimpleAmenable.PolygonObject.Labelled + +variable {a n m : ℕ} +abbrev Reduced (g : Fin n → CutRing × CutRing) : Prop := + ∀ i, orbitRepresentative (g i)=g i +variable (f : (Fin n → CutRing × CutRing) → (Fin m → CutRing × CutRing)) + (hf : ∀g, Reduced g → Reduced (f g)) +noncomputable def relabel : Labelled a n ⥤ Labelled a m where + obj U := ⟨U.polygon,fun k => f (U.label k),fun k => hf _ (U.reduced k)⟩ + map g := ⟨g.arrow,g.positional,fun x => congrArg f (g.labelled x)⟩ + map_id _ := Hom.ext _ _ rfl + map_comp _ _ := Hom.ext _ _ rfl +noncomputable def relabelUnit : 𝟙_ (Labelled a m) ⟶ (relabel f hf).obj (𝟙_ (Labelled a n)) where + arrow := 𝟙 _ + positional _ := rfl + labelled x := by + change Point PolygonObject.empty at x + exact isEmptyElim x +noncomputable def relabelTensor (U V : Labelled a n) : + (relabel f hf).obj U ⊗ (relabel f hf).obj V ⟶ (relabel f hf).obj (U ⊗ V) where + arrow := 𝟙 _ + positional _ := rfl + labelled x := by + change f ((sum U V).label x.val.1) = + (sum ((relabel f hf).obj U) ((relabel f hf).obj V)).label x.val.1 + obtain ⟨y,rfl⟩ := (sumPointEquiv U.polygon V.polygon).surjective x + cases y <;> simp only [relabel,sumPointEquiv_inl,sumPointEquiv_inr,Fin.addCases_left,Fin.addCases_right] +noncomputable instance relabelMonoidal : (relabel (a:=a) f hf).Monoidal := + Functor.CoreMonoidal.toMonoidal { + εIso := asIso (relabelUnit f hf) + μIso U V := asIso (relabelTensor f hf U V) + μIso_hom_natural_left := by + intros; apply Hom.ext + change _ ≫ 𝟙 _ = 𝟙 _ ≫ _ + simp only [Category.comp_id] + rfl + μIso_hom_natural_right := by + intros; apply Hom.ext + change _ ≫ 𝟙 _ = 𝟙 _ ≫ _ + simp only [Category.comp_id] + rfl + associativity := by + intros; apply Hom.ext + change sumArrow (𝟙 _) (𝟙 _) ≫ 𝟙 _ ≫ _ = _ ≫ sumArrow (𝟙 _) (𝟙 _) ≫ 𝟙 _ + simp only [sumArrow_id,Category.id_comp,Category.comp_id] + rfl + left_unitality := by + intros; apply Hom.ext + change _ = sumArrow (𝟙 _) (𝟙 _) ≫ 𝟙 _ ≫ _ + simp only [sumArrow_id,Category.id_comp] + rfl + right_unitality := by + intros; apply Hom.ext + change _ = sumArrow (𝟙 _) (𝟙 _) ≫ 𝟙 _ ≫ _ + simp only [sumArrow_id,Category.id_comp] + rfl } +noncomputable instance relabelBraided : (relabel (a:=a) f hf).Braided where + braided U V := by + apply Hom.ext + change 𝟙 _ ≫ sumSwap U.polygon V.polygon = sumSwap U.polygon V.polygon ≫ 𝟙 _ + simp only [Category.id_comp,Category.comp_id] +@[simp] lemma relabel_map_arrow {U V : Labelled a n} (g:U⟶V) : + ((relabel f hf).map g).arrow=g.arrow := rfl +@[simp] lemma relabel_ε_arrow : (Functor.LaxMonoidal.ε (relabel (a:=a) f hf)).arrow=𝟙 _ := rfl +@[simp] lemma relabel_μ_arrow (U V : Labelled a n) : + (Functor.LaxMonoidal.μ (relabel f hf) U V).arrow=𝟙 _ := rfl +end SimpleAmenable.PolygonObject.Labelled + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/MarkedBlockDifferentials.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/MarkedBlockDifferentials.lean new file mode 100644 index 0000000000000000000000000000000000000000..a95bcae48c510f9a39428bb8de6c4a62757ab672 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/MarkedBlockDifferentials.lean @@ -0,0 +1,202 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.MarkedGradedFinite +import OAI.GroupTheory.SimpleAmenable.Homology.MarkedPrimitiveFaces +import OAI.GroupTheory.SimpleAmenable.Homology.RegularTotalFiniteDifferentials + +namespace OAI + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits MonoidalCategory Simplicial SimplicialObject Opposite AlgebraicTopology HomologicalComplex +namespace MarkedH1 +open FreeChains ComponentTranslation IntervalBar.Diagram RegularLabels RegularCoordinates MonoidNerveCoordinates RegularFiniteFaces + +variable {C:Type} [Groupoid.{0} C] [MonoidalCategory C] [SymmetricCategory C] +@[reassoc] lemma imageP00 (a:Skeleton C) : + totalInj (homologyDiagram (C:=C) 1) ⟨⟨(0,0),rfl⟩,![],a,![]⟩ ≫ (gradedIso 0).hom = P10 a := image00 a +@[reassoc] lemma imageP01 (a b:Skeleton C) : + totalInj (homologyDiagram (C:=C) 1) ⟨⟨(0,1),rfl⟩,![a],b,![]⟩ ≫ (gradedIso 1).hom = P21 a b := image01 a b +@[reassoc] lemma imageP10 (a b:Skeleton C) : + totalInj (homologyDiagram (C:=C) 1) ⟨⟨(1,0),rfl⟩,![],a,![b]⟩ ≫ (gradedIso 1).hom = P20 a b := image10 a b +@[reassoc] lemma imageP02 (a b d:Skeleton C) : + totalInj (homologyDiagram (C:=C) 1) ⟨⟨(0,2),rfl⟩,![a,b],d,![]⟩ ≫ (gradedIso 2).hom = P32 a b d := image02 a b d +@[reassoc] lemma imageP11 (a b d:Skeleton C) : + totalInj (homologyDiagram (C:=C) 1) ⟨⟨(1,1),rfl⟩,![a],b,![d]⟩ ≫ (gradedIso 2).hom = -P31 a b d := image11 a b d +@[reassoc] lemma imageP20 (a b d:Skeleton C) : + totalInj (homologyDiagram (C:=C) 1) ⟨⟨(2,0),rfl⟩,![],a,![d,b]⟩ ≫ (gradedIso 2).hom = -P30 a b d := image20 a b d +@[reassoc] lemma imageP03 (a b d e:Skeleton C) : + totalInj (homologyDiagram (C:=C) 1) ⟨⟨(0,3),rfl⟩,![a,b,d],e,![]⟩ ≫ (gradedIso 3).hom = P43 a b d e := image03 a b d e +@[reassoc] lemma imageP12 (a b d e:Skeleton C) : + totalInj (homologyDiagram (C:=C) 1) ⟨⟨(1,2),rfl⟩,![a,b],d,![e]⟩ ≫ (gradedIso 3).hom = P42 a b d e := image12 a b d e +@[reassoc] lemma imageP21 (a b d e:Skeleton C) : + totalInj (homologyDiagram (C:=C) 1) ⟨⟨(2,1),rfl⟩,![a],b,![e,d]⟩ ≫ (gradedIso 3).hom = -P41 a b d e := image21 a b d e +@[reassoc] lemma imageP30 (a b d e:Skeleton C) : + totalInj (homologyDiagram (C:=C) 1) ⟨⟨(3,0),rfl⟩,![],a,![e,d,b]⟩ ≫ (gradedIso 3).hom = -P40 a b d e := image30 a b d e +@[reassoc] lemma map_arrow_T (r p:Skeleton C) : + (homologyDiagram (C:=C) 1).map (arrow r p) = T r p (r*p) rfl := rfl +omit [SymmetricCategory C] in +lemma T_comp_congr {M:A} (r p q q':Skeleton C) (h:r*p=q) (h':r*p=q') + (e:q=q') (f:∀s:Skeleton C,H s ⟶ M) : T r p q h ≫ f q = T r p q' h' ≫ f q' := by + cases e + rfl +lemma compat01 (a b:Skeleton C) : + totalInj (homologyDiagram (C:=C) 1) ⟨⟨(0,1),rfl⟩,![a],b,![]⟩ ≫ ((RegularCoefficient.double (homologyDiagram (C:=C) 1)).total c).d 1 0 ≫ (gradedIso 0).hom = + totalInj (homologyDiagram (C:=C) 1) ⟨⟨(0,1),rfl⟩,![a],b,![]⟩ ≫ (gradedIso 1).hom ≫ (homologyRow (C:=C) 1).d 2 1 := by + erw [imageP01_assoc] + erw [Pd_2_1] + erw [block_d01_assoc] + simp only [Preadditive.add_comp,Preadditive.neg_comp,Category.assoc] + erw [imageP00 b] + erw [imageP00 (a*b)] + simp only [map_arrow_T] + try erw [mul_comm b a] + try abel +lemma compat10 (a b:Skeleton C) : + totalInj (homologyDiagram (C:=C) 1) ⟨⟨(1,0),rfl⟩,![],a,![b]⟩ ≫ ((RegularCoefficient.double (homologyDiagram (C:=C) 1)).total c).d 1 0 ≫ (gradedIso 0).hom = + totalInj (homologyDiagram (C:=C) 1) ⟨⟨(1,0),rfl⟩,![],a,![b]⟩ ≫ (gradedIso 1).hom ≫ (homologyRow (C:=C) 1).d 2 1 := by + erw [imageP10_assoc] + erw [Pd_2_0] + erw [block_d10_assoc] + simp only [Preadditive.add_comp,Preadditive.neg_comp,Category.assoc] + erw [imageP00 a] + erw [imageP00 (b*a)] + simp only [map_arrow_T] + erw [T_comp_congr b a (b*a) (a*b) rfl (mul_comm _ _) (mul_comm _ _) (fun t=>P10 t)] + try erw [mul_comm b a] + try abel +lemma compat02 (a b d:Skeleton C) : + totalInj (homologyDiagram (C:=C) 1) ⟨⟨(0,2),rfl⟩,![a,b],d,![]⟩ ≫ ((RegularCoefficient.double (homologyDiagram (C:=C) 1)).total c).d 2 1 ≫ (gradedIso 1).hom = + totalInj (homologyDiagram (C:=C) 1) ⟨⟨(0,2),rfl⟩,![a,b],d,![]⟩ ≫ (gradedIso 2).hom ≫ (homologyRow (C:=C) 1).d 3 2 := by + erw [imageP02_assoc] + erw [Pd_3_2] + erw [block_d02_assoc] + simp only [Preadditive.add_comp,Preadditive.neg_comp,Category.assoc] + erw [imageP01 b d] + erw [imageP01 (a*b) d] + erw [imageP01 a (b*d)] + simp only [map_arrow_T] + try erw [mul_comm b a] + try erw [mul_comm d a] + try erw [mul_comm d b] + try abel +lemma compat11 (a b d:Skeleton C) : + totalInj (homologyDiagram (C:=C) 1) ⟨⟨(1,1),rfl⟩,![a],b,![d]⟩ ≫ ((RegularCoefficient.double (homologyDiagram (C:=C) 1)).total c).d 2 1 ≫ (gradedIso 1).hom = + totalInj (homologyDiagram (C:=C) 1) ⟨⟨(1,1),rfl⟩,![a],b,![d]⟩ ≫ (gradedIso 2).hom ≫ (homologyRow (C:=C) 1).d 3 2 := by + erw [imageP11_assoc] + erw [Preadditive.neg_comp,Pd_3_1] + erw [block_d11_assoc] + simp only [Preadditive.add_comp,Preadditive.neg_comp,Category.assoc] + erw [imageP01 a b] + erw [imageP01 a (d*b)] + erw [imageP10 b d] + erw [imageP10 (a*b) d] + simp only [map_arrow_T] + erw [T_comp_congr d b (d*b) (b*d) rfl (mul_comm _ _) (mul_comm _ _) (fun t=>P21 a t)] + try erw [mul_comm b a] + try erw [mul_comm d a] + try erw [mul_comm d b] + try abel +lemma compat20 (a b d:Skeleton C) : + totalInj (homologyDiagram (C:=C) 1) ⟨⟨(2,0),rfl⟩,![],a,![d,b]⟩ ≫ ((RegularCoefficient.double (homologyDiagram (C:=C) 1)).total c).d 2 1 ≫ (gradedIso 1).hom = + totalInj (homologyDiagram (C:=C) 1) ⟨⟨(2,0),rfl⟩,![],a,![d,b]⟩ ≫ (gradedIso 2).hom ≫ (homologyRow (C:=C) 1).d 3 2 := by + erw [imageP20_assoc] + erw [Preadditive.neg_comp,Pd_3_0] + erw [block_d20_assoc] + simp only [Preadditive.add_comp,Preadditive.neg_comp,Category.assoc] + erw [imageP10 a b] + erw [imageP10 a (d*b)] + erw [imageP10 (b*a) d] + simp only [map_arrow_T] + erw [T_comp_congr b a (b*a) (a*b) rfl (mul_comm _ _) (mul_comm _ _) (fun t=>P20 t d)] + try erw [mul_comm b a] + try erw [mul_comm d a] + try erw [mul_comm d b] + try abel +lemma compat03 (a b d e:Skeleton C) : + totalInj (homologyDiagram (C:=C) 1) ⟨⟨(0,3),rfl⟩,![a,b,d],e,![]⟩ ≫ ((RegularCoefficient.double (homologyDiagram (C:=C) 1)).total c).d 3 2 ≫ (gradedIso 2).hom = + totalInj (homologyDiagram (C:=C) 1) ⟨⟨(0,3),rfl⟩,![a,b,d],e,![]⟩ ≫ (gradedIso 3).hom ≫ (homologyRow (C:=C) 1).d 4 3 := by + erw [imageP03_assoc] + erw [Pd_4_3] + erw [block_d03_assoc] + simp only [Preadditive.add_comp,Preadditive.neg_comp,Category.assoc] + erw [imageP02 b d e] + erw [imageP02 (a*b) d e] + erw [imageP02 a (b*d) e] + erw [imageP02 a b (d*e)] + simp only [map_arrow_T] + try erw [mul_comm b a] + try erw [mul_comm d a] + try erw [mul_comm e a] + try erw [mul_comm d b] + try erw [mul_comm e b] + try erw [mul_comm e d] + try abel +lemma compat12 (a b d e:Skeleton C) : + totalInj (homologyDiagram (C:=C) 1) ⟨⟨(1,2),rfl⟩,![a,b],d,![e]⟩ ≫ ((RegularCoefficient.double (homologyDiagram (C:=C) 1)).total c).d 3 2 ≫ (gradedIso 2).hom = + totalInj (homologyDiagram (C:=C) 1) ⟨⟨(1,2),rfl⟩,![a,b],d,![e]⟩ ≫ (gradedIso 3).hom ≫ (homologyRow (C:=C) 1).d 4 3 := by + erw [imageP12_assoc] + erw [Pd_4_2] + erw [block_d12_assoc] + simp only [Preadditive.add_comp,Preadditive.neg_comp,Category.assoc] + erw [imageP02 a b d] + erw [imageP02 a b (e*d)] + erw [imageP11 b d e] + erw [imageP11 (a*b) d e] + erw [imageP11 a (b*d) e] + simp only [map_arrow_T] + repeat erw [Preadditive.comp_neg] + erw [T_comp_congr e d (e*d) (d*e) rfl (mul_comm _ _) (mul_comm _ _) (fun t=>P32 a b t)] + try erw [mul_comm b a] + try erw [mul_comm d a] + try erw [mul_comm e a] + try erw [mul_comm d b] + try erw [mul_comm e b] + try erw [mul_comm e d] + try abel +lemma compat21 (a b d e:Skeleton C) : + totalInj (homologyDiagram (C:=C) 1) ⟨⟨(2,1),rfl⟩,![a],b,![e,d]⟩ ≫ ((RegularCoefficient.double (homologyDiagram (C:=C) 1)).total c).d 3 2 ≫ (gradedIso 2).hom = + totalInj (homologyDiagram (C:=C) 1) ⟨⟨(2,1),rfl⟩,![a],b,![e,d]⟩ ≫ (gradedIso 3).hom ≫ (homologyRow (C:=C) 1).d 4 3 := by + erw [imageP21_assoc] + erw [Preadditive.neg_comp,Pd_4_1] + erw [block_d21_assoc] + simp only [Preadditive.add_comp,Preadditive.neg_comp,Category.assoc] + erw [imageP11 a b d] + erw [imageP11 a b (e*d)] + erw [imageP11 a (d*b) e] + erw [imageP20 b d e] + erw [imageP20 (a*b) d e] + simp only [map_arrow_T] + repeat erw [Preadditive.comp_neg] + erw [T_comp_congr d b (d*b) (b*d) rfl (mul_comm _ _) (mul_comm _ _) (fun t=>P31 a t e)] + try erw [mul_comm b a] + try erw [mul_comm d a] + try erw [mul_comm e a] + try erw [mul_comm d b] + try erw [mul_comm e b] + try erw [mul_comm e d] + try abel +lemma compat30 (a b d e:Skeleton C) : + totalInj (homologyDiagram (C:=C) 1) ⟨⟨(3,0),rfl⟩,![],a,![e,d,b]⟩ ≫ ((RegularCoefficient.double (homologyDiagram (C:=C) 1)).total c).d 3 2 ≫ (gradedIso 2).hom = + totalInj (homologyDiagram (C:=C) 1) ⟨⟨(3,0),rfl⟩,![],a,![e,d,b]⟩ ≫ (gradedIso 3).hom ≫ (homologyRow (C:=C) 1).d 4 3 := by + erw [imageP30_assoc] + erw [Preadditive.neg_comp,Pd_4_0] + erw [block_d30_assoc] + simp only [Preadditive.add_comp,Preadditive.neg_comp,Category.assoc] + erw [imageP20 a b d] + erw [imageP20 a b (e*d)] + erw [imageP20 a (d*b) e] + erw [imageP20 (b*a) d e] + simp only [map_arrow_T] + repeat erw [Preadditive.comp_neg] + erw [T_comp_congr b a (b*a) (a*b) rfl (mul_comm _ _) (mul_comm _ _) (fun t=>P30 t d e)] + try erw [mul_comm b a] + try erw [mul_comm d a] + try erw [mul_comm e a] + try erw [mul_comm d b] + try erw [mul_comm e b] + try erw [mul_comm e d] + try abel +end MarkedH1 + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/MarkedGradedFinite.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/MarkedGradedFinite.lean new file mode 100644 index 0000000000000000000000000000000000000000..8377353db0f692b6b57edfa6b855ce5ec5e28eaf --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/MarkedGradedFinite.lean @@ -0,0 +1,314 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.MarkedSigns + +namespace OAI + +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits MonoidalCategory Simplicial Opposite +namespace MarkedH1 +open FreeChains ComponentTranslation + +variable {C:Type} [Groupoid.{0} C] [MonoidalCategory C] [SymmetricCategory C] +omit [SymmetricCategory C] in +lemma primitive_transport {n:ℕ} {a b:Σ_:Fin n,Fin n→Skeleton C} (e:a=b) : + eqToHom (congrArg (fun z:Σ_:Fin n,Fin n→Skeleton C=>H (z.2 z.1)) e.symm) ≫ + primitive a.2 a.1 = primitive b.2 b.1 := by + subst b + simp +def s00 (a:Skeleton C) : DoubleCoordinates.Index (Skeleton C) 0 := ⟨⟨(0,0),rfl⟩,![],a,![]⟩ +omit [MonoidalCategory C] [SymmetricCategory C] in +lemma words00 (a:Skeleton C) : DoubleCoordinates.words _ 0 (s00 a)=⟨0,![a]⟩ := by + dsimp [s00,DoubleCoordinates.words,DoubleCoordinates.equiv,DoubleCoordinates.toSplit,MarkedCoordinates.equiv] + refine Sigma.ext rfl ?_ + apply heq_of_eq + funext j + fin_cases j + rfl +omit [MonoidalCategory C] [SymmetricCategory C] in +lemma label00 (a:Skeleton C) : (labelIso (s00 a)).hom = (-1:ℤ)^0 • 𝟙 (H a) := by + dsimp only [labelIso,Iso.trans_hom,signIso,s00] + rw [show MarkedSigns.exponent 0 0=0 from by decide] + change ((-1:ℤ)^0 • 𝟙 (H a)) ≫ eqToHom (rfl: H a=H a) = _ + exact Category.comp_id _ +omit [SymmetricCategory C] in +lemma primitive00 (a:Skeleton C) : + primitive (DoubleCoordinates.words _ 0 (s00 a)).2 (DoubleCoordinates.words _ 0 (s00 a)).1 = + primitive ![a] 0 := by + have hh:=primitive_transport (words00 a) + change (𝟙 (H a)) ≫ _ = _ at hh + erw [Category.id_comp] at hh + exact hh +@[reassoc] lemma image00 (a:Skeleton C) : + RegularLabels.totalInj (homologyDiagram (C:=C) 1) ⟨⟨(0,0),rfl⟩,![],a,![]⟩ ≫ + (gradedIso 0).hom = primitive ![a] 0 := by + change RegularLabels.totalInj (homologyDiagram (C:=C) 1) (s00 a) ≫ _ = _ + rw [totalInj_gradedIso,label00,primitive00] + norm_num + try exact Category.id_comp _ +def s10 (a b:Skeleton C) : DoubleCoordinates.Index (Skeleton C) 1 := ⟨⟨(1,0),rfl⟩,![],a,![b]⟩ +omit [MonoidalCategory C] [SymmetricCategory C] in +lemma words10 (a b:Skeleton C) : DoubleCoordinates.words _ 1 (s10 a b)=⟨0,![a,b]⟩ := by + dsimp [s10,DoubleCoordinates.words,DoubleCoordinates.equiv,DoubleCoordinates.toSplit,MarkedCoordinates.equiv] + refine Sigma.ext rfl ?_ + apply heq_of_eq + funext j + fin_cases j <;> rfl +omit [MonoidalCategory C] [SymmetricCategory C] in +lemma label10 (a b:Skeleton C) : (labelIso (s10 a b)).hom = (-1:ℤ)^2 • 𝟙 (H a) := by + dsimp only [labelIso,Iso.trans_hom,signIso,s10] + rw [show MarkedSigns.exponent 1 0=2 from by decide] + change ((-1:ℤ)^2 • 𝟙 (H a)) ≫ eqToHom (rfl: H a=H a) = _ + exact Category.comp_id _ +omit [SymmetricCategory C] in +lemma primitive10 (a b:Skeleton C) : + primitive (DoubleCoordinates.words _ 1 (s10 a b)).2 (DoubleCoordinates.words _ 1 (s10 a b)).1 = + primitive ![a,b] 0 := by + have hh:=primitive_transport (words10 a b) + change (𝟙 (H a)) ≫ _ = _ at hh + erw [Category.id_comp] at hh + exact hh +@[reassoc] lemma image10 (a b:Skeleton C) : + RegularLabels.totalInj (homologyDiagram (C:=C) 1) ⟨⟨(1,0),rfl⟩,![],a,![b]⟩ ≫ + (gradedIso 1).hom = primitive ![a,b] 0 := by + change RegularLabels.totalInj (homologyDiagram (C:=C) 1) (s10 a b) ≫ _ = _ + rw [totalInj_gradedIso,label10,primitive10] + norm_num + try exact Category.id_comp _ +def s01 (a b:Skeleton C) : DoubleCoordinates.Index (Skeleton C) 1 := ⟨⟨(0,1),rfl⟩,![a],b,![]⟩ +omit [MonoidalCategory C] [SymmetricCategory C] in +lemma words01 (a b:Skeleton C) : DoubleCoordinates.words _ 1 (s01 a b)=⟨1,![a,b]⟩ := by + dsimp [s01,DoubleCoordinates.words,DoubleCoordinates.equiv,DoubleCoordinates.toSplit,MarkedCoordinates.equiv] + refine Sigma.ext rfl ?_ + apply heq_of_eq + funext j + fin_cases j <;> rfl +omit [MonoidalCategory C] [SymmetricCategory C] in +lemma label01 (a b:Skeleton C) : (labelIso (s01 a b)).hom = (-1:ℤ)^0 • 𝟙 (H b) := by + dsimp only [labelIso,Iso.trans_hom,signIso,s01] + rw [show MarkedSigns.exponent 0 1=0 from by decide] + change ((-1:ℤ)^0 • 𝟙 (H b)) ≫ eqToHom (rfl: H b=H b) = _ + exact Category.comp_id _ +omit [SymmetricCategory C] in +lemma primitive01 (a b:Skeleton C) : + primitive (DoubleCoordinates.words _ 1 (s01 a b)).2 (DoubleCoordinates.words _ 1 (s01 a b)).1 = + primitive ![a,b] 1 := by + have hh:=primitive_transport (words01 a b) + change (𝟙 (H b)) ≫ _ = _ at hh + erw [Category.id_comp] at hh + exact hh +@[reassoc] lemma image01 (a b:Skeleton C) : + RegularLabels.totalInj (homologyDiagram (C:=C) 1) ⟨⟨(0,1),rfl⟩,![a],b,![]⟩ ≫ + (gradedIso 1).hom = primitive ![a,b] 1 := by + change RegularLabels.totalInj (homologyDiagram (C:=C) 1) (s01 a b) ≫ _ = _ + rw [totalInj_gradedIso,label01,primitive01] + norm_num + try exact Category.id_comp _ +def s20 (a b d:Skeleton C) : DoubleCoordinates.Index (Skeleton C) 2 := ⟨⟨(2,0),rfl⟩,![],a,![d,b]⟩ +omit [MonoidalCategory C] [SymmetricCategory C] in +lemma words20 (a b d:Skeleton C) : DoubleCoordinates.words _ 2 (s20 a b d)=⟨0,![a,b,d]⟩ := by + dsimp [s20,DoubleCoordinates.words,DoubleCoordinates.equiv,DoubleCoordinates.toSplit,MarkedCoordinates.equiv] + refine Sigma.ext rfl ?_ + apply heq_of_eq + funext j + fin_cases j <;> rfl +omit [MonoidalCategory C] [SymmetricCategory C] in +lemma label20 (a b d:Skeleton C) : (labelIso (s20 a b d)).hom = (-1:ℤ)^5 • 𝟙 (H a) := by + dsimp only [labelIso,Iso.trans_hom,signIso,s20] + rw [show MarkedSigns.exponent 2 0=5 from by decide] + change ((-1:ℤ)^5 • 𝟙 (H a)) ≫ eqToHom (rfl: H a=H a) = _ + exact Category.comp_id _ +omit [SymmetricCategory C] in +lemma primitive20 (a b d:Skeleton C) : + primitive (DoubleCoordinates.words _ 2 (s20 a b d)).2 (DoubleCoordinates.words _ 2 (s20 a b d)).1 = + primitive ![a,b,d] 0 := by + have hh:=primitive_transport (words20 a b d) + change (𝟙 (H a)) ≫ _ = _ at hh + erw [Category.id_comp] at hh + exact hh +@[reassoc] lemma image20 (a b d:Skeleton C) : + RegularLabels.totalInj (homologyDiagram (C:=C) 1) ⟨⟨(2,0),rfl⟩,![],a,![d,b]⟩ ≫ + (gradedIso 2).hom = -primitive ![a,b,d] 0 := by + change RegularLabels.totalInj (homologyDiagram (C:=C) 1) (s20 a b d) ≫ _ = _ + rw [totalInj_gradedIso,label20,primitive20] + norm_num + erw [Preadditive.neg_comp, Category.id_comp] + rfl +def s11 (a b d:Skeleton C) : DoubleCoordinates.Index (Skeleton C) 2 := ⟨⟨(1,1),rfl⟩,![a],b,![d]⟩ +omit [MonoidalCategory C] [SymmetricCategory C] in +lemma words11 (a b d:Skeleton C) : DoubleCoordinates.words _ 2 (s11 a b d)=⟨1,![a,b,d]⟩ := by + dsimp [s11,DoubleCoordinates.words,DoubleCoordinates.equiv,DoubleCoordinates.toSplit,MarkedCoordinates.equiv] + refine Sigma.ext rfl ?_ + apply heq_of_eq + funext j + fin_cases j <;> rfl +omit [MonoidalCategory C] [SymmetricCategory C] in +lemma label11 (a b d:Skeleton C) : (labelIso (s11 a b d)).hom = (-1:ℤ)^3 • 𝟙 (H b) := by + dsimp only [labelIso,Iso.trans_hom,signIso,s11] + rw [show MarkedSigns.exponent 1 1=3 from by decide] + change ((-1:ℤ)^3 • 𝟙 (H b)) ≫ eqToHom (rfl: H b=H b) = _ + exact Category.comp_id _ +omit [SymmetricCategory C] in +lemma primitive11 (a b d:Skeleton C) : + primitive (DoubleCoordinates.words _ 2 (s11 a b d)).2 (DoubleCoordinates.words _ 2 (s11 a b d)).1 = + primitive ![a,b,d] 1 := by + have hh:=primitive_transport (words11 a b d) + change (𝟙 (H b)) ≫ _ = _ at hh + erw [Category.id_comp] at hh + exact hh +@[reassoc] lemma image11 (a b d:Skeleton C) : + RegularLabels.totalInj (homologyDiagram (C:=C) 1) ⟨⟨(1,1),rfl⟩,![a],b,![d]⟩ ≫ + (gradedIso 2).hom = -primitive ![a,b,d] 1 := by + change RegularLabels.totalInj (homologyDiagram (C:=C) 1) (s11 a b d) ≫ _ = _ + rw [totalInj_gradedIso,label11,primitive11] + norm_num + erw [Preadditive.neg_comp, Category.id_comp] + rfl +def s02 (a b d:Skeleton C) : DoubleCoordinates.Index (Skeleton C) 2 := ⟨⟨(0,2),rfl⟩,![a,b],d,![]⟩ +omit [MonoidalCategory C] [SymmetricCategory C] in +lemma words02 (a b d:Skeleton C) : DoubleCoordinates.words _ 2 (s02 a b d)=⟨2,![a,b,d]⟩ := by + dsimp [s02,DoubleCoordinates.words,DoubleCoordinates.equiv,DoubleCoordinates.toSplit,MarkedCoordinates.equiv] + refine Sigma.ext rfl ?_ + apply heq_of_eq + funext j + fin_cases j <;> rfl +omit [MonoidalCategory C] [SymmetricCategory C] in +lemma label02 (a b d:Skeleton C) : (labelIso (s02 a b d)).hom = (-1:ℤ)^0 • 𝟙 (H d) := by + dsimp only [labelIso,Iso.trans_hom,signIso,s02] + rw [show MarkedSigns.exponent 0 2=0 from by decide] + change ((-1:ℤ)^0 • 𝟙 (H d)) ≫ eqToHom (rfl: H d=H d) = _ + exact Category.comp_id _ +omit [SymmetricCategory C] in +lemma primitive02 (a b d:Skeleton C) : + primitive (DoubleCoordinates.words _ 2 (s02 a b d)).2 (DoubleCoordinates.words _ 2 (s02 a b d)).1 = + primitive ![a,b,d] 2 := by + have hh:=primitive_transport (words02 a b d) + change (𝟙 (H d)) ≫ _ = _ at hh + erw [Category.id_comp] at hh + exact hh +@[reassoc] lemma image02 (a b d:Skeleton C) : + RegularLabels.totalInj (homologyDiagram (C:=C) 1) ⟨⟨(0,2),rfl⟩,![a,b],d,![]⟩ ≫ + (gradedIso 2).hom = primitive ![a,b,d] 2 := by + change RegularLabels.totalInj (homologyDiagram (C:=C) 1) (s02 a b d) ≫ _ = _ + rw [totalInj_gradedIso,label02,primitive02] + norm_num + try exact Category.id_comp _ +def s30 (a b d e:Skeleton C) : DoubleCoordinates.Index (Skeleton C) 3 := ⟨⟨(3,0),rfl⟩,![],a,![e,d,b]⟩ +omit [MonoidalCategory C] [SymmetricCategory C] in +lemma words30 (a b d e:Skeleton C) : DoubleCoordinates.words _ 3 (s30 a b d e)=⟨0,![a,b,d,e]⟩ := by + dsimp [s30,DoubleCoordinates.words,DoubleCoordinates.equiv,DoubleCoordinates.toSplit,MarkedCoordinates.equiv] + refine Sigma.ext rfl ?_ + apply heq_of_eq + funext j + fin_cases j <;> rfl +omit [MonoidalCategory C] [SymmetricCategory C] in +lemma label30 (a b d e:Skeleton C) : (labelIso (s30 a b d e)).hom = (-1:ℤ)^9 • 𝟙 (H a) := by + dsimp only [labelIso,Iso.trans_hom,signIso,s30] + rw [show MarkedSigns.exponent 3 0=9 from by decide] + change ((-1:ℤ)^9 • 𝟙 (H a)) ≫ eqToHom (rfl: H a=H a) = _ + exact Category.comp_id _ +omit [SymmetricCategory C] in +lemma primitive30 (a b d e:Skeleton C) : + primitive (DoubleCoordinates.words _ 3 (s30 a b d e)).2 (DoubleCoordinates.words _ 3 (s30 a b d e)).1 = + primitive ![a,b,d,e] 0 := by + have hh:=primitive_transport (words30 a b d e) + change (𝟙 (H a)) ≫ _ = _ at hh + erw [Category.id_comp] at hh + exact hh +@[reassoc] lemma image30 (a b d e:Skeleton C) : + RegularLabels.totalInj (homologyDiagram (C:=C) 1) ⟨⟨(3,0),rfl⟩,![],a,![e,d,b]⟩ ≫ + (gradedIso 3).hom = -primitive ![a,b,d,e] 0 := by + change RegularLabels.totalInj (homologyDiagram (C:=C) 1) (s30 a b d e) ≫ _ = _ + rw [totalInj_gradedIso,label30,primitive30] + norm_num + erw [Preadditive.neg_comp, Category.id_comp] + rfl +def s21 (a b d e:Skeleton C) : DoubleCoordinates.Index (Skeleton C) 3 := ⟨⟨(2,1),rfl⟩,![a],b,![e,d]⟩ +omit [MonoidalCategory C] [SymmetricCategory C] in +lemma words21 (a b d e:Skeleton C) : DoubleCoordinates.words _ 3 (s21 a b d e)=⟨1,![a,b,d,e]⟩ := by + dsimp [s21,DoubleCoordinates.words,DoubleCoordinates.equiv,DoubleCoordinates.toSplit,MarkedCoordinates.equiv] + refine Sigma.ext rfl ?_ + apply heq_of_eq + funext j + fin_cases j <;> rfl +omit [MonoidalCategory C] [SymmetricCategory C] in +lemma label21 (a b d e:Skeleton C) : (labelIso (s21 a b d e)).hom = (-1:ℤ)^7 • 𝟙 (H b) := by + dsimp only [labelIso,Iso.trans_hom,signIso,s21] + rw [show MarkedSigns.exponent 2 1=7 from by decide] + change ((-1:ℤ)^7 • 𝟙 (H b)) ≫ eqToHom (rfl: H b=H b) = _ + exact Category.comp_id _ +omit [SymmetricCategory C] in +lemma primitive21 (a b d e:Skeleton C) : + primitive (DoubleCoordinates.words _ 3 (s21 a b d e)).2 (DoubleCoordinates.words _ 3 (s21 a b d e)).1 = + primitive ![a,b,d,e] 1 := by + have hh:=primitive_transport (words21 a b d e) + change (𝟙 (H b)) ≫ _ = _ at hh + erw [Category.id_comp] at hh + exact hh +@[reassoc] lemma image21 (a b d e:Skeleton C) : + RegularLabels.totalInj (homologyDiagram (C:=C) 1) ⟨⟨(2,1),rfl⟩,![a],b,![e,d]⟩ ≫ + (gradedIso 3).hom = -primitive ![a,b,d,e] 1 := by + change RegularLabels.totalInj (homologyDiagram (C:=C) 1) (s21 a b d e) ≫ _ = _ + rw [totalInj_gradedIso,label21,primitive21] + norm_num + erw [Preadditive.neg_comp, Category.id_comp] + rfl +def s12 (a b d e:Skeleton C) : DoubleCoordinates.Index (Skeleton C) 3 := ⟨⟨(1,2),rfl⟩,![a,b],d,![e]⟩ +omit [MonoidalCategory C] [SymmetricCategory C] in +lemma words12 (a b d e:Skeleton C) : DoubleCoordinates.words _ 3 (s12 a b d e)=⟨2,![a,b,d,e]⟩ := by + dsimp [s12,DoubleCoordinates.words,DoubleCoordinates.equiv,DoubleCoordinates.toSplit,MarkedCoordinates.equiv] + refine Sigma.ext rfl ?_ + apply heq_of_eq + funext j + fin_cases j <;> rfl +omit [MonoidalCategory C] [SymmetricCategory C] in +lemma label12 (a b d e:Skeleton C) : (labelIso (s12 a b d e)).hom = (-1:ℤ)^4 • 𝟙 (H d) := by + dsimp only [labelIso,Iso.trans_hom,signIso,s12] + rw [show MarkedSigns.exponent 1 2=4 from by decide] + change ((-1:ℤ)^4 • 𝟙 (H d)) ≫ eqToHom (rfl: H d=H d) = _ + exact Category.comp_id _ +omit [SymmetricCategory C] in +lemma primitive12 (a b d e:Skeleton C) : + primitive (DoubleCoordinates.words _ 3 (s12 a b d e)).2 (DoubleCoordinates.words _ 3 (s12 a b d e)).1 = + primitive ![a,b,d,e] 2 := by + have hh:=primitive_transport (words12 a b d e) + change (𝟙 (H d)) ≫ _ = _ at hh + erw [Category.id_comp] at hh + exact hh +@[reassoc] lemma image12 (a b d e:Skeleton C) : + RegularLabels.totalInj (homologyDiagram (C:=C) 1) ⟨⟨(1,2),rfl⟩,![a,b],d,![e]⟩ ≫ + (gradedIso 3).hom = primitive ![a,b,d,e] 2 := by + change RegularLabels.totalInj (homologyDiagram (C:=C) 1) (s12 a b d e) ≫ _ = _ + rw [totalInj_gradedIso,label12,primitive12] + norm_num + try exact Category.id_comp _ +def s03 (a b d e:Skeleton C) : DoubleCoordinates.Index (Skeleton C) 3 := ⟨⟨(0,3),rfl⟩,![a,b,d],e,![]⟩ +omit [MonoidalCategory C] [SymmetricCategory C] in +lemma words03 (a b d e:Skeleton C) : DoubleCoordinates.words _ 3 (s03 a b d e)=⟨3,![a,b,d,e]⟩ := by + dsimp [s03,DoubleCoordinates.words,DoubleCoordinates.equiv,DoubleCoordinates.toSplit,MarkedCoordinates.equiv] + refine Sigma.ext rfl ?_ + apply heq_of_eq + funext j + fin_cases j <;> rfl +omit [MonoidalCategory C] [SymmetricCategory C] in +lemma label03 (a b d e:Skeleton C) : (labelIso (s03 a b d e)).hom = (-1:ℤ)^0 • 𝟙 (H e) := by + dsimp only [labelIso,Iso.trans_hom,signIso,s03] + rw [show MarkedSigns.exponent 0 3=0 from by decide] + change ((-1:ℤ)^0 • 𝟙 (H e)) ≫ eqToHom (rfl: H e=H e) = _ + exact Category.comp_id _ +omit [SymmetricCategory C] in +lemma primitive03 (a b d e:Skeleton C) : + primitive (DoubleCoordinates.words _ 3 (s03 a b d e)).2 (DoubleCoordinates.words _ 3 (s03 a b d e)).1 = + primitive ![a,b,d,e] 3 := by + have hh:=primitive_transport (words03 a b d e) + change (𝟙 (H e)) ≫ _ = _ at hh + erw [Category.id_comp] at hh + exact hh +@[reassoc] lemma image03 (a b d e:Skeleton C) : + RegularLabels.totalInj (homologyDiagram (C:=C) 1) ⟨⟨(0,3),rfl⟩,![a,b,d],e,![]⟩ ≫ + (gradedIso 3).hom = primitive ![a,b,d,e] 3 := by + change RegularLabels.totalInj (homologyDiagram (C:=C) 1) (s03 a b d e) ≫ _ = _ + rw [totalInj_gradedIso,label03,primitive03] + norm_num + try exact Category.id_comp _ +end MarkedH1 + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/MarkedLowHomology.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/MarkedLowHomology.lean new file mode 100644 index 0000000000000000000000000000000000000000..3f1e5a370161b6aa1cb6a7d413e501001c0b5030 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/MarkedLowHomology.lean @@ -0,0 +1,132 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.MarkedBlockDifferentials + +namespace OAI + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits MonoidalCategory Simplicial Opposite HomologicalComplex +namespace MarkedH1 +open FreeChains ComponentTranslation IntervalBar.Diagram RegularLabels + +variable {C:Type} [Groupoid.{0} C] [MonoidalCategory C] [SymmetricCategory C] +lemma differential1 : + ((RegularCoefficient.double (homologyDiagram (C:=C) 1)).total c).d 1 0 ≫ (gradedIso 0).hom = + (gradedIso 1).hom ≫ (homologyRow (C:=C) 1).d 2 1 := by + apply total_hom_ext (homologyDiagram (C:=C) 1) + rintro ⟨⟨⟨h,v⟩,hn⟩,y,p,x⟩ + change h+v=1 at hn + have hh:h≤1:=by omega + interval_cases h + · have hv:v=1:=by omega + subst v + have hy:y=![y 0]:=by ext index; fin_cases index; rfl + have hx:x=![]:=Subsingleton.elim _ _ + rw [hy,hx] + exact compat01 (y 0) (p) + · have hv:v=0:=by omega + subst v + have hy:y=![]:=Subsingleton.elim _ _ + have hx:x=![x 0]:=by ext index; fin_cases index; rfl + rw [hy,hx] + exact compat10 (p) (x 0) +lemma differential2 : + ((RegularCoefficient.double (homologyDiagram (C:=C) 1)).total c).d 2 1 ≫ (gradedIso 1).hom = + (gradedIso 2).hom ≫ (homologyRow (C:=C) 1).d 3 2 := by + apply total_hom_ext (homologyDiagram (C:=C) 1) + rintro ⟨⟨⟨h,v⟩,hn⟩,y,p,x⟩ + change h+v=2 at hn + have hh:h≤2:=by omega + interval_cases h + · have hv:v=2:=by omega + subst v + have hy:y=![y 0,y 1]:=by ext i; fin_cases i <;> rfl + have hx:x=![]:=Subsingleton.elim _ _ + rw [hy,hx] + exact compat02 (y 0) (y 1) (p) + · have hv:v=1:=by omega + subst v + have hy:y=![y 0]:=by ext index; fin_cases index; rfl + have hx:x=![x 0]:=by ext index; fin_cases index; rfl + rw [hy,hx] + exact compat11 (y 0) (p) (x 0) + · have hv:v=0:=by omega + subst v + have hy:y=![]:=Subsingleton.elim _ _ + have hx:x=![x 0,x 1]:=by ext i; fin_cases i <;> rfl + rw [hy,hx] + exact compat20 (p) (x 1) (x 0) +lemma differential3 : + ((RegularCoefficient.double (homologyDiagram (C:=C) 1)).total c).d 3 2 ≫ (gradedIso 2).hom = + (gradedIso 3).hom ≫ (homologyRow (C:=C) 1).d 4 3 := by + apply total_hom_ext (homologyDiagram (C:=C) 1) + rintro ⟨⟨⟨h,v⟩,hn⟩,y,p,x⟩ + change h+v=3 at hn + have hh:h≤3:=by omega + interval_cases h + · have hv:v=3:=by omega + subst v + have hy:y=![y 0,y 1,y 2]:=by ext i; fin_cases i <;> rfl + have hx:x=![]:=Subsingleton.elim _ _ + rw [hy,hx] + exact compat03 (y 0) (y 1) (y 2) (p) + · have hv:v=2:=by omega + subst v + have hy:y=![y 0,y 1]:=by ext i; fin_cases i <;> rfl + have hx:x=![x 0]:=by ext index; fin_cases index; rfl + rw [hy,hx] + exact compat12 (y 0) (y 1) (p) (x 0) + · have hv:v=1:=by omega + subst v + have hy:y=![y 0]:=by ext index; fin_cases index; rfl + have hx:x=![x 0,x 1]:=by ext i; fin_cases i <;> rfl + rw [hy,hx] + exact compat21 (y 0) (p) (x 1) (x 0) + · have hv:v=0:=by omega + subst v + have hy:y=![]:=Subsingleton.elim _ _ + have hx:x=![x 0,x 1,x 2]:=by ext i; fin_cases i <;> rfl + rw [hy,hx] + exact compat30 (p) (x 2) (x 1) (x 0) +noncomputable def lowHomologyIso : + ((RegularCoefficient.double (homologyDiagram (C:=C) 1)).total c).homology 2 ≅ + (homologyRow (C:=C) 1).homology 3 := + by + let K := (RegularCoefficient.double (homologyDiagram (C:=C) 1)).total c + let L := homologyRow (C:=C) 1 + let e : K.sc' 3 2 1 ≅ L.sc' 4 3 2 := + ShortComplex.isoMk (gradedIso 3) (gradedIso 2) (gradedIso 1) + (differential3 (C:=C)).symm (differential2 (C:=C)).symm + exact (ShortComplex.homologyFunctor A).mapIso + (K.isoSc' 3 2 1 (c.prev_eq' rfl) (c.next_eq' rfl) ≪≫ e ≪≫ + (L.isoSc' 4 3 2 (c.prev_eq' rfl) (c.next_eq' rfl)).symm) +end MarkedH1 + +end + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits Opposite +namespace CommMonoidOpposite +open FreeChains + +variable (P:Type) [CommMonoid P] +def functor : (SingleObj P)ᵒᵖ ⥤ SingleObj P where + obj _ := SingleObj.star _ + map f := f.unop + map_id _ := rfl + map_comp _ _ := mul_comm _ _ +instance : (functor P).Faithful where + map_injective h := Quiver.Hom.unop_inj h +instance : (functor P).Full where + map_surjective morphism := ⟨morphism.op,rfl⟩ +instance : (functor P).EssSurj where + mem_essImage _ := ⟨op (SingleObj.star _), ⟨eqToIso (Subsingleton.elim _ _)⟩⟩ +instance : (functor P).IsEquivalence := ⟨inferInstance,inferInstance,inferInstance⟩ +noncomputable def homologyIso (n:ℕ) : + (nerve (SingleObj P)ᵒᵖ).homology Z n ≅ (nerve (SingleObj P)).homology Z n := by + haveI:=NerveHomotopy.homologyMap_isIso (functor P) Z n + exact asIso (SSet.homologyMap (nerveMap (functor P)) Z n) +end CommMonoidOpposite + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/MarkedPrimitiveFaces.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/MarkedPrimitiveFaces.lean new file mode 100644 index 0000000000000000000000000000000000000000..24c2f6c259fbb3b811b07db4706ce5bcb6cfe3ed --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/MarkedPrimitiveFaces.lean @@ -0,0 +1,237 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.MarkedSigns +import OAI.GroupTheory.SimpleAmenable.Homology.Face200 +import OAI.GroupTheory.SimpleAmenable.Homology.Face410 +import OAI.GroupTheory.SimpleAmenable.Simplicial.FirstBarComponentsFinite + +namespace OAI + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits MonoidalCategory Simplicial SimplicialObject Opposite AlgebraicTopology HomologicalComplex +namespace MarkedH1 +open FreeChains ComponentTranslation IntervalBar.Diagram RegularLabels RegularCoordinates MonoidNerveCoordinates RegularFiniteFaces + +variable {C:Type} [Groupoid.{0} C] [MonoidalCategory C] +noncomputable def T (r p s:Skeleton C) (h:r*p=s) : H p ⟶ H s := NerveHomology.map (translate r p s h) 1 +noncomputable def R (n:ℕ) (k:Fin (n+2)) : (homologyRow (C:=C) 1).X (n+1) ⟶ (homologyRow (C:=C) 1).X n := + NerveHomology.map (reindex (SimplexCategory.δ k).toOrderHom) 1 +noncomputable def P10 (a:Skeleton C) : H a ⟶ (homologyRow (C:=C) 1).X 1 := primitive ![a] 0 +noncomputable def P20 (a b:Skeleton C) : H a ⟶ (homologyRow (C:=C) 1).X 2 := primitive ![a,b] 0 +noncomputable def P21 (a b:Skeleton C) : H b ⟶ (homologyRow (C:=C) 1).X 2 := primitive ![a,b] 1 +noncomputable def P30 (a b d:Skeleton C) : H a ⟶ (homologyRow (C:=C) 1).X 3 := primitive ![a,b,d] 0 +noncomputable def P31 (a b d:Skeleton C) : H b ⟶ (homologyRow (C:=C) 1).X 3 := primitive ![a,b,d] 1 +noncomputable def P32 (a b d:Skeleton C) : H d ⟶ (homologyRow (C:=C) 1).X 3 := primitive ![a,b,d] 2 +noncomputable def P40 (a b d e:Skeleton C) : H a ⟶ (homologyRow (C:=C) 1).X 4 := primitive ![a,b,d,e] 0 +noncomputable def P41 (a b d e:Skeleton C) : H b ⟶ (homologyRow (C:=C) 1).X 4 := primitive ![a,b,d,e] 1 +noncomputable def P42 (a b d e:Skeleton C) : H d ⟶ (homologyRow (C:=C) 1).X 4 := primitive ![a,b,d,e] 2 +noncomputable def P43 (a b d e:Skeleton C) : H e ⟶ (homologyRow (C:=C) 1).X 4 := primitive ![a,b,d,e] 3 +@[reassoc] lemma Pface_2_0_0 (a b:Skeleton C) : + P20 a b ≫ R 1 0 = 0 := + face_2_0_0 a b +@[reassoc] lemma Pface_2_0_1 [SymmetricCategory C] (a b:Skeleton C) : + P20 a b ≫ R 1 1 = T b a (a*b) (mul_comm _ _) ≫ P10 (a*b) := + face_2_0_1 a b +@[reassoc] lemma Pface_2_0_2 (a b:Skeleton C) : + P20 a b ≫ R 1 2 = P10 a := + face_2_0_2 a b +@[reassoc] lemma Pface_2_1_0 (a b:Skeleton C) : + P21 a b ≫ R 1 0 = P10 b := + face_2_1_0 a b +@[reassoc] lemma Pface_2_1_1 (a b:Skeleton C) : + P21 a b ≫ R 1 1 = T a b (a*b) rfl ≫ P10 (a*b) := + face_2_1_1 a b +@[reassoc] lemma Pface_2_1_2 (a b:Skeleton C) : + P21 a b ≫ R 1 2 = 0 := + face_2_1_2 a b +@[reassoc] lemma Pface_3_0_0 (a b d:Skeleton C) : + P30 a b d ≫ R 2 0 = 0 := + face_3_0_0 a b d +@[reassoc] lemma Pface_3_0_1 [SymmetricCategory C] (a b d:Skeleton C) : + P30 a b d ≫ R 2 1 = T b a (a*b) (mul_comm _ _) ≫ P20 (a*b) d := + face_3_0_1 a b d +@[reassoc] lemma Pface_3_0_2 (a b d:Skeleton C) : + P30 a b d ≫ R 2 2 = P20 a (b*d) := + face_3_0_2 a b d +@[reassoc] lemma Pface_3_0_3 (a b d:Skeleton C) : + P30 a b d ≫ R 2 3 = P20 a b := + face_3_0_3 a b d +@[reassoc] lemma Pface_3_1_0 (a b d:Skeleton C) : + P31 a b d ≫ R 2 0 = P20 b d := + face_3_1_0 a b d +@[reassoc] lemma Pface_3_1_1 (a b d:Skeleton C) : + P31 a b d ≫ R 2 1 = T a b (a*b) rfl ≫ P20 (a*b) d := + face_3_1_1 a b d +@[reassoc] lemma Pface_3_1_2 [SymmetricCategory C] (a b d:Skeleton C) : + P31 a b d ≫ R 2 2 = T d b (b*d) (mul_comm _ _) ≫ P21 a (b*d) := + face_3_1_2 a b d +@[reassoc] lemma Pface_3_1_3 (a b d:Skeleton C) : + P31 a b d ≫ R 2 3 = P21 a b := + face_3_1_3 a b d +@[reassoc] lemma Pface_3_2_0 (a b d:Skeleton C) : + P32 a b d ≫ R 2 0 = P21 b d := + face_3_2_0 a b d +@[reassoc] lemma Pface_3_2_1 (a b d:Skeleton C) : + P32 a b d ≫ R 2 1 = P21 (a*b) d := + face_3_2_1 a b d +@[reassoc] lemma Pface_3_2_2 (a b d:Skeleton C) : + P32 a b d ≫ R 2 2 = T b d (b*d) rfl ≫ P21 a (b*d) := + face_3_2_2 a b d +@[reassoc] lemma Pface_3_2_3 (a b d:Skeleton C) : + P32 a b d ≫ R 2 3 = 0 := + face_3_2_3 a b d +@[reassoc] lemma Pface_4_0_0 (a b d e:Skeleton C) : + P40 a b d e ≫ R 3 0 = 0 := + face_4_0_0 a b d e +@[reassoc] lemma Pface_4_0_1 [SymmetricCategory C] (a b d e:Skeleton C) : + P40 a b d e ≫ R 3 1 = T b a (a*b) (mul_comm _ _) ≫ P30 (a*b) d e := + face_4_0_1 a b d e +@[reassoc] lemma Pface_4_0_2 (a b d e:Skeleton C) : + P40 a b d e ≫ R 3 2 = P30 a (b*d) e := + face_4_0_2 a b d e +@[reassoc] lemma Pface_4_0_3 (a b d e:Skeleton C) : + P40 a b d e ≫ R 3 3 = P30 a b (d*e) := + face_4_0_3 a b d e +@[reassoc] lemma Pface_4_0_4 (a b d e:Skeleton C) : + P40 a b d e ≫ R 3 4 = P30 a b d := + face_4_0_4 a b d e +@[reassoc] lemma Pface_4_1_0 (a b d e:Skeleton C) : + P41 a b d e ≫ R 3 0 = P30 b d e := + face_4_1_0 a b d e +@[reassoc] lemma Pface_4_1_1 (a b d e:Skeleton C) : + P41 a b d e ≫ R 3 1 = T a b (a*b) rfl ≫ P30 (a*b) d e := + face_4_1_1 a b d e +@[reassoc] lemma Pface_4_1_2 [SymmetricCategory C] (a b d e:Skeleton C) : + P41 a b d e ≫ R 3 2 = T d b (b*d) (mul_comm _ _) ≫ P31 a (b*d) e := + face_4_1_2 a b d e +@[reassoc] lemma Pface_4_1_3 (a b d e:Skeleton C) : + P41 a b d e ≫ R 3 3 = P31 a b (d*e) := + face_4_1_3 a b d e +@[reassoc] lemma Pface_4_1_4 (a b d e:Skeleton C) : + P41 a b d e ≫ R 3 4 = P31 a b d := + face_4_1_4 a b d e +@[reassoc] lemma Pface_4_2_0 (a b d e:Skeleton C) : + P42 a b d e ≫ R 3 0 = P31 b d e := + face_4_2_0 a b d e +@[reassoc] lemma Pface_4_2_1 (a b d e:Skeleton C) : + P42 a b d e ≫ R 3 1 = P31 (a*b) d e := + face_4_2_1 a b d e +@[reassoc] lemma Pface_4_2_2 (a b d e:Skeleton C) : + P42 a b d e ≫ R 3 2 = T b d (b*d) rfl ≫ P31 a (b*d) e := + face_4_2_2 a b d e +@[reassoc] lemma Pface_4_2_3 [SymmetricCategory C] (a b d e:Skeleton C) : + P42 a b d e ≫ R 3 3 = T e d (d*e) (mul_comm _ _) ≫ P32 a b (d*e) := + face_4_2_3 a b d e +@[reassoc] lemma Pface_4_2_4 (a b d e:Skeleton C) : + P42 a b d e ≫ R 3 4 = P32 a b d := + face_4_2_4 a b d e +@[reassoc] lemma Pface_4_3_0 (a b d e:Skeleton C) : + P43 a b d e ≫ R 3 0 = P32 b d e := + face_4_3_0 a b d e +@[reassoc] lemma Pface_4_3_1 (a b d e:Skeleton C) : + P43 a b d e ≫ R 3 1 = P32 (a*b) d e := + face_4_3_1 a b d e +@[reassoc] lemma Pface_4_3_2 (a b d e:Skeleton C) : + P43 a b d e ≫ R 3 2 = P32 a (b*d) e := + face_4_3_2 a b d e +@[reassoc] lemma Pface_4_3_3 (a b d e:Skeleton C) : + P43 a b d e ≫ R 3 3 = T d e (d*e) rfl ≫ P32 a b (d*e) := + face_4_3_3 a b d e +@[reassoc] lemma Pface_4_3_4 (a b d e:Skeleton C) : + P43 a b d e ≫ R 3 4 = 0 := + face_4_3_4 a b d e +end MarkedH1 + +end + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits MonoidalCategory Simplicial SimplicialObject Opposite AlgebraicTopology HomologicalComplex +namespace MarkedH1 +open FreeChains ComponentTranslation IntervalBar.Diagram RegularLabels RegularCoordinates MonoidNerveCoordinates RegularFiniteFaces + +variable {C:Type} [Groupoid.{0} C] [MonoidalCategory C] +@[reassoc] lemma Pd_2_0 [SymmetricCategory C] (a b:Skeleton C) : + P20 a b ≫ (homologyRow (C:=C) 1).d 2 1 = -(T b a (a*b) (mul_comm _ _) ≫ P10 (a*b)) + (P10 a) := by + have hd : (homologyRow (C:=C) 1).d 2 1 = (R 1 0) + -(R 1 1) + (R 1 2) := by + calc + _ = ∑k:Fin 3,(-1:ℤ)^k.val • R 1 k := AlternatingFaceMapComplex.obj_d_eq _ _ + _ = _ := by simp [Fin.sum_univ_succ,add_assoc] + rw [hd] + simp only [Preadditive.comp_add,Preadditive.comp_neg,Pface_2_0_0,Pface_2_0_1,Pface_2_0_2] + try abel +@[reassoc] lemma Pd_2_1 (a b:Skeleton C) : + P21 a b ≫ (homologyRow (C:=C) 1).d 2 1 = (P10 b) + -(T a b (a*b) rfl ≫ P10 (a*b)) := by + have hd : (homologyRow (C:=C) 1).d 2 1 = (R 1 0) + -(R 1 1) + (R 1 2) := by + calc + _ = ∑k:Fin 3,(-1:ℤ)^k.val • R 1 k := AlternatingFaceMapComplex.obj_d_eq _ _ + _ = _ := by simp [Fin.sum_univ_succ,add_assoc] + rw [hd] + simp only [Preadditive.comp_add,Preadditive.comp_neg,Pface_2_1_0,Pface_2_1_1,Pface_2_1_2] + try abel +@[reassoc] lemma Pd_3_0 [SymmetricCategory C] (a b d:Skeleton C) : + P30 a b d ≫ (homologyRow (C:=C) 1).d 3 2 = -(T b a (a*b) (mul_comm _ _) ≫ P20 (a*b) d) + (P20 a (b*d)) + -(P20 a b) := by + have hd : (homologyRow (C:=C) 1).d 3 2 = (R 2 0) + -(R 2 1) + (R 2 2) + -(R 2 3) := by + calc + _ = ∑k:Fin 4,(-1:ℤ)^k.val • R 2 k := AlternatingFaceMapComplex.obj_d_eq _ _ + _ = _ := by simp [Fin.sum_univ_succ,add_assoc] + rw [hd] + simp only [Preadditive.comp_add,Preadditive.comp_neg,Pface_3_0_0,Pface_3_0_1,Pface_3_0_2,Pface_3_0_3] + try abel +@[reassoc] lemma Pd_3_1 [SymmetricCategory C] (a b d:Skeleton C) : + P31 a b d ≫ (homologyRow (C:=C) 1).d 3 2 = (P20 b d) + -(T a b (a*b) rfl ≫ P20 (a*b) d) + (T d b (b*d) (mul_comm _ _) ≫ P21 a (b*d)) + -(P21 a b) := by + have hd : (homologyRow (C:=C) 1).d 3 2 = (R 2 0) + -(R 2 1) + (R 2 2) + -(R 2 3) := by + calc + _ = ∑k:Fin 4,(-1:ℤ)^k.val • R 2 k := AlternatingFaceMapComplex.obj_d_eq _ _ + _ = _ := by simp [Fin.sum_univ_succ,add_assoc] + rw [hd] + simp only [Preadditive.comp_add,Preadditive.comp_neg,Pface_3_1_0,Pface_3_1_1,Pface_3_1_2,Pface_3_1_3] + try abel +@[reassoc] lemma Pd_3_2 (a b d:Skeleton C) : + P32 a b d ≫ (homologyRow (C:=C) 1).d 3 2 = (P21 b d) + -(P21 (a*b) d) + (T b d (b*d) rfl ≫ P21 a (b*d)) := by + have hd : (homologyRow (C:=C) 1).d 3 2 = (R 2 0) + -(R 2 1) + (R 2 2) + -(R 2 3) := by + calc + _ = ∑k:Fin 4,(-1:ℤ)^k.val • R 2 k := AlternatingFaceMapComplex.obj_d_eq _ _ + _ = _ := by simp [Fin.sum_univ_succ,add_assoc] + rw [hd] + simp only [Preadditive.comp_add,Preadditive.comp_neg,Pface_3_2_0,Pface_3_2_1,Pface_3_2_2,Pface_3_2_3] + try abel +@[reassoc] lemma Pd_4_0 [SymmetricCategory C] (a b d e:Skeleton C) : + P40 a b d e ≫ (homologyRow (C:=C) 1).d 4 3 = -(T b a (a*b) (mul_comm _ _) ≫ P30 (a*b) d e) + (P30 a (b*d) e) + -(P30 a b (d*e)) + (P30 a b d) := by + have hd : (homologyRow (C:=C) 1).d 4 3 = (R 3 0) + -(R 3 1) + (R 3 2) + -(R 3 3) + (R 3 4) := by + calc + _ = ∑k:Fin 5,(-1:ℤ)^k.val • R 3 k := AlternatingFaceMapComplex.obj_d_eq _ _ + _ = _ := by simp [Fin.sum_univ_succ,add_assoc] + rw [hd] + simp only [Preadditive.comp_add,Preadditive.comp_neg,Pface_4_0_0,Pface_4_0_1,Pface_4_0_2,Pface_4_0_3,Pface_4_0_4] + try abel +@[reassoc] lemma Pd_4_1 [SymmetricCategory C] (a b d e:Skeleton C) : + P41 a b d e ≫ (homologyRow (C:=C) 1).d 4 3 = (P30 b d e) + -(T a b (a*b) rfl ≫ P30 (a*b) d e) + (T d b (b*d) (mul_comm _ _) ≫ P31 a (b*d) e) + -(P31 a b (d*e)) + (P31 a b d) := by + have hd : (homologyRow (C:=C) 1).d 4 3 = (R 3 0) + -(R 3 1) + (R 3 2) + -(R 3 3) + (R 3 4) := by + calc + _ = ∑k:Fin 5,(-1:ℤ)^k.val • R 3 k := AlternatingFaceMapComplex.obj_d_eq _ _ + _ = _ := by simp [Fin.sum_univ_succ,add_assoc] + rw [hd] + simp only [Preadditive.comp_add,Preadditive.comp_neg,Pface_4_1_0,Pface_4_1_1,Pface_4_1_2,Pface_4_1_3,Pface_4_1_4] + try abel +@[reassoc] lemma Pd_4_2 [SymmetricCategory C] (a b d e:Skeleton C) : + P42 a b d e ≫ (homologyRow (C:=C) 1).d 4 3 = (P31 b d e) + -(P31 (a*b) d e) + (T b d (b*d) rfl ≫ P31 a (b*d) e) + -(T e d (d*e) (mul_comm _ _) ≫ P32 a b (d*e)) + (P32 a b d) := by + have hd : (homologyRow (C:=C) 1).d 4 3 = (R 3 0) + -(R 3 1) + (R 3 2) + -(R 3 3) + (R 3 4) := by + calc + _ = ∑k:Fin 5,(-1:ℤ)^k.val • R 3 k := AlternatingFaceMapComplex.obj_d_eq _ _ + _ = _ := by simp [Fin.sum_univ_succ,add_assoc] + rw [hd] + simp only [Preadditive.comp_add,Preadditive.comp_neg,Pface_4_2_0,Pface_4_2_1,Pface_4_2_2,Pface_4_2_3,Pface_4_2_4] + try abel +@[reassoc] lemma Pd_4_3 (a b d e:Skeleton C) : + P43 a b d e ≫ (homologyRow (C:=C) 1).d 4 3 = (P32 b d e) + -(P32 (a*b) d e) + (P32 a (b*d) e) + -(T d e (d*e) rfl ≫ P32 a b (d*e)) := by + have hd : (homologyRow (C:=C) 1).d 4 3 = (R 3 0) + -(R 3 1) + (R 3 2) + -(R 3 3) + (R 3 4) := by + calc + _ = ∑k:Fin 5,(-1:ℤ)^k.val • R 3 k := AlternatingFaceMapComplex.obj_d_eq _ _ + _ = _ := by simp [Fin.sum_univ_succ,add_assoc] + rw [hd] + simp only [Preadditive.comp_add,Preadditive.comp_neg,Pface_4_3_0,Pface_4_3_1,Pface_4_3_2,Pface_4_3_3,Pface_4_3_4] + try abel +end MarkedH1 + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/MarkedSigns.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/MarkedSigns.lean new file mode 100644 index 0000000000000000000000000000000000000000..59aaec05fe959013a01bac98202661524bcded15 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/MarkedSigns.lean @@ -0,0 +1,95 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.DoubleCoordinates + +namespace OAI + +section +namespace MarkedSigns + +def exponent (h v:ℕ) : ℕ := h*v+h*(h+3)/2 +lemma triangular_step (h:ℕ) : (h+1)*(h+1+3)/2 = h*(h+3)/2+h+2 := by + have he : (h+1)*(h+1+3)=h*(h+3)+2*(h+2) := by ring + rw [he,Nat.add_mul_div_left] + all_goals omega +lemma vertical_step (h v:ℕ) : exponent h (v+1)=exponent h v+h := by + unfold exponent + ring +lemma horizontal_step (h v:ℕ) : exponent (h+1) v=exponent h v+h+v+2 := by + unfold exponent + rw [triangular_step] + ring +lemma vertical (h v i:ℕ) : + (-1:ℤ)^h*((-1)^i*(-1)^(exponent h v)) = + (-1)^(exponent h (v+1)) * (-1)^i := by + rw [vertical_step,pow_add] + ring +lemma square (n:ℕ) : (-1:ℤ)^n * (-1)^n=1 := by + rw [←mul_pow]; norm_num +lemma horizontal (h v j:ℕ) (hj:j≤h+v+2) : + (-1:ℤ)^j*(-1)^(exponent h v) = + (-1)^(exponent (h+1) v) * (-1)^(h+v+2-j) := by + rw [horizontal_step,pow_add,pow_add,pow_add] + have hs : (-1:ℤ)^(h+v+2)*(-1:ℤ)^(h+v+2-j)=(-1:ℤ)^j := by + have he:h+v+2=j+(h+v+2-j):=by omega + rw [he,pow_add] + have hend : j+(h+v+2-j)-j=h+v+2-j:=by omega + rw [hend,mul_assoc,square,mul_one] + have hpow : (-1:ℤ)^h * (-1)^v * (-1)^2=(-1:ℤ)^(h+v+2) := by rw [pow_add,pow_add] + calc + _ = (-1:ℤ)^(exponent h v)*((-1:ℤ)^j) := by ring + _ = (-1:ℤ)^(exponent h v)*((-1:ℤ)^(h+v+2)*(-1:ℤ)^(h+v+2-j)) := by rw [hs] + _ = _ := by rw [←hpow]; ring +end MarkedSigns + +end + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits MonoidalCategory Simplicial Opposite +namespace MarkedH1 +open FreeChains ComponentTranslation + +variable {C:Type} [Groupoid.{0} C] [MonoidalCategory C] [SymmetricCategory C] +noncomputable abbrev H (p:Skeleton C) : A := (nerve (Fiber p)).homology Z 1 +noncomputable def isColimit (n:ℕ) : + IsColimit (Cofan.mk _ (fun s:Σ_:Fin n,Fin n→Skeleton C => primitive s.2 s.1)) := + Cofan.IsColimit.mk _ (fun t=>desc (fun p i=>t.inj ⟨i,p⟩)) + (fun _ s=>primitive_desc _ s.2 s.1) + (fun t _ hh=>hom_ext (fun p i=>(hh ⟨i,p⟩).trans (primitive_desc (fun p i=>t.inj ⟨i,p⟩) p i).symm)) +noncomputable def signIso (h v:ℕ) (M:A) : M≅M where + hom := (-1:ℤ)^(MarkedSigns.exponent h v) • 𝟙 M + inv := (-1:ℤ)^(MarkedSigns.exponent h v) • 𝟙 M + hom_inv_id := by simp only [Preadditive.zsmul_comp,Preadditive.comp_zsmul,Category.id_comp, + smul_smul,MarkedSigns.square,one_smul] + inv_hom_id := by simp only [Preadditive.zsmul_comp,Preadditive.comp_zsmul,Category.id_comp, + smul_smul,MarkedSigns.square,one_smul] +noncomputable def labelIso {n:ℕ} (s:DoubleCoordinates.Index (Skeleton C) n) : + H s.2.2.1 ≅ H ((DoubleCoordinates.words _ _ s).2 (DoubleCoordinates.words _ _ s).1) := + signIso s.1.val.1 s.1.val.2 _ ≪≫ eqToIso (congrArg H (DoubleCoordinates.center s).symm) +noncomputable def labelDiagramIso (n:ℕ) : + Discrete.functor (fun s:DoubleCoordinates.Index (Skeleton C) n=>H s.2.2.1) ≅ + Discrete.functor (fun s:DoubleCoordinates.Index (Skeleton C) n=> + H ((DoubleCoordinates.words _ _ s).2 (DoubleCoordinates.words _ _ s).1)) := + Discrete.natIso (fun s=>labelIso s.as) +noncomputable def reindexedCofan (n:ℕ) := Cofan.mk _ + (fun s:DoubleCoordinates.Index (Skeleton C) n => primitive + (DoubleCoordinates.words _ _ s).2 (DoubleCoordinates.words _ _ s).1) +noncomputable def labelledCofan (n:ℕ) := (Cocone.precompose (labelDiagramIso (C:=C) n).hom).obj (reindexedCofan n) +noncomputable def labelledIsColimit (n:ℕ) : IsColimit (labelledCofan (C:=C) n) := + (IsColimit.precomposeHomEquiv (labelDiagramIso n) (reindexedCofan n)).symm + ((Cofan.isColimitEquivOfEquiv (DoubleCoordinates.words (Skeleton C) n) _) + (isColimit (C:=C) (n+1))) +noncomputable def gradedIso (n:ℕ) : + ((RegularCoefficient.double (homologyDiagram (C:=C) 1)).total c).X n ≅ + (nerve (IntervalBar.Diagram C (Fin (n+1+1)))).homology Z 1 := + (RegularLabels.totalIsColimit (homologyDiagram (C:=C) 1) n).coconePointUniqueUpToIso + (labelledIsColimit n) +@[reassoc] lemma totalInj_gradedIso {n:ℕ} (s:DoubleCoordinates.Index (Skeleton C) n) : + RegularLabels.totalInj (homologyDiagram (C:=C) 1) s ≫ (gradedIso n).hom = + (labelIso s).hom ≫ primitive (DoubleCoordinates.words _ _ s).2 (DoubleCoordinates.words _ _ s).1 := + (RegularLabels.totalIsColimit (homologyDiagram (C:=C) 1) n).comp_coconePointUniqueUpToIso_hom + (labelledIsColimit n) ⟨s⟩ +end MarkedH1 + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/ModelAssembly.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/ModelAssembly.lean new file mode 100644 index 0000000000000000000000000000000000000000..aed8f702b6b2005d16c19d866ce2d35f76e6a26e --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/ModelAssembly.lean @@ -0,0 +1,254 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.DiagonalResolution + +namespace OAI + +section + +open CategoryTheory Limits Opposite +namespace ModelAssembly + +open DiagonalResolution +variable (X : Dᵒᵖ ⥤ Type) + +abbrev projection : X.Elementsᵒᵖ ⥤ D := (Functor.Elements.π X).leftOp + +noncomputable def assembly : (D ⥤ A) ⥤ A := + (Functor.whiskeringLeft _ _ _).obj (projection X) ⋙ colim + +instance assembly_additive : (assembly X).Additive := by + unfold assembly + infer_instance + +instance assembly_preservesColimits : PreservesColimitsOfSize.{0,0} (assembly X) := by + unfold assembly + infer_instance +noncomputable def freeCocone (d : D) : Cocone (projection X ⋙ free d) where + pt := ∐ (fun _ : X.obj (op d) => Z) + ι := + { app e := Sigma.desc (fun f : d ⟶ e.unop.1.unop => + Sigma.ι (fun _ : X.obj (op d) => Z) (X.map f.op e.unop.2)) + naturality e e' f := by + apply Sigma.hom_ext + intro g + simp only [Functor.const_obj_obj,Functor.const_obj_map,Category.comp_id, + Functor.comp_map,projection,Functor.leftOp_map,Functor.Elements.π_map, + free,evaluationLeftAdjoint] + simp only [← Category.assoc,Sigma.ι_comp_desc] + congr 1 + change X.map (g ≫ f.unop.hom.unop).op e'.unop.2 = X.map g.op e.unop.2 + rw [op_comp, X.map_comp] + change X.map g.op (X.map f.unop.hom e'.unop.2) = _ + rw [f.unop.map_val] } + +noncomputable def forward (d : D) : (assembly X).obj (free d) ⟶ ∐ (fun _ : X.obj (op d) => Z) := + colimit.desc _ (freeCocone X d) + +noncomputable def backward (d : D) : (∐ (fun _ : X.obj (op d) => Z)) ⟶ (assembly X).obj (free d) := + Sigma.desc (fun x => Sigma.ι (fun _ : d ⟶ d => Z) (𝟙 d) ≫ + colimit.ι (projection X ⋙ free d) (op (X.elementsMk (op d) x))) + +@[reassoc (attr := simp)] lemma ι_to (d : D) (e : X.Elementsᵒᵖ) : + colimit.ι (projection X ⋙ free d) e ≫ forward X d = (freeCocone X d).ι.app e := by + apply colimit.ι_desc +lemma from_to (d : D) : backward X d ≫ forward X d = 𝟙 _ := by + apply Sigma.hom_ext + intro x + dsimp only [backward] + erw [Sigma.ι_comp_desc_assoc, Category.assoc, ι_to] + change Sigma.ι (fun _ : d ⟶ d => Z) (𝟙 d) ≫ Sigma.desc + (fun f : d ⟶ d => Sigma.ι (fun _ : X.obj (op d) => Z) (X.map f.op x)) = _ + simp +lemma to_from (d : D) : forward X d ≫ backward X d = 𝟙 _ := by + apply colimit.hom_ext + intro e + apply Sigma.hom_ext + intro f + change Sigma.ι (fun _ : d ⟶ e.unop.1.unop => Z) f ≫ + colimit.ι (projection X ⋙ free d) e ≫ forward X d ≫ backward X d = + Sigma.ι (fun _ : d ⟶ e.unop.1.unop => Z) f ≫ colimit.ι (projection X ⋙ free d) e ≫ 𝟙 _ + erw [← Category.assoc (colimit.ι (projection X ⋙ free d) e) (forward X d) + (backward X d), ι_to] + dsimp only [freeCocone] + dsimp only [backward] + erw [Sigma.ι_comp_desc_assoc, Sigma.ι_comp_desc, Category.comp_id] + let k := (show e.unop ⟶ X.elementsMk (op d) (X.map f.op e.unop.2) from + { hom := f.op, map_val := rfl }).op + have h := congrArg (fun g => Sigma.ι (fun _ : d ⟶ d => Z) (𝟙 d) ≫ g) + (colimit.w (projection X ⋙ free d) k) + change Sigma.ι (fun _ : d ⟶ d => Z) (𝟙 d) ≫ + (Sigma.desc (fun g : d ⟶ d => Sigma.ι (fun _ : d ⟶ e.unop.1.unop => Z) (g ≫ f))) ≫ + colimit.ι (projection X ⋙ free d) e = + Sigma.ι (fun _ : d ⟶ d => Z) (𝟙 d) ≫ + colimit.ι (projection X ⋙ free d) (op (X.elementsMk (op d) (X.map f.op e.unop.2))) at h + erw [Sigma.ι_comp_desc_assoc, Category.id_comp] at h + change _ = _ at h + exact h.symm + +noncomputable def freeIso (d : D) : (assembly X).obj (free d) ≅ ∐ (fun _ : X.obj (op d) => Z) where + hom := forward X d + inv := backward X d + hom_inv_id := to_from X d + inv_hom_id := from_to X d + +end ModelAssembly + +end + +open CategoryTheory Limits HomologicalComplex HomologicalComplex₂ +namespace TotalHomotopy + +universe u v +variable {C : Type u} [Category.{v} C] [Preadditive C] [HasCoproducts.{0} C] +abbrev c := ComplexShape.down ℕ +variable {K L : HomologicalComplex₂ C c c} {f g : K ⟶ L} + +@[simp] lemma sign₁ (p q : ℕ) : ComplexShape.ε₁ c c c (p,q)=1 := rfl +@[simp] lemma sign₂ (p q : ℕ) : ComplexShape.ε₂ c c c (p,q)=(-1 : ℤˣ)^p := rfl +@[simp] lemma π_add (p q : ℕ) : ComplexShape.π c c c (p,q)=p+q := rfl + +noncomputable def step (h : Homotopy f g) (n : ℕ) : (K.total c).X n ⟶ (L.total c).X (n+1) := + K.totalDesc (fun p q hpq => (h.hom p (p+1)).f q ≫ L.ιTotal c (p+1) q (n+1) (by + dsimp at hpq ⊢; omega)) + +@[reassoc (attr := simp)] lemma ι_step (h : Homotopy f g) (p q n : ℕ) (hpq : p+q=n) : + K.ιTotal c p q n hpq ≫ step h n = + (h.hom p (p+1)).f q ≫ L.ιTotal c (p+1) q (n+1) (by dsimp; omega) := by + apply ι_totalDesc + +lemma ι_d₁_zero (q n : ℕ) : K.ιTotal c 0 q q (by simp) ≫ K.D₁ c q n=0 := by + rw [ι_D₁] + apply d₁_eq_zero + simp [c] + +lemma ι_d₂_zero (p n : ℕ) : K.ιTotal c p 0 p (by simp) ≫ K.D₂ c p n=0 := by + rw [ι_D₂] + apply d₂_eq_zero + simp [c] + +@[reassoc] lemma ι_d₁_succ (p q n : ℕ) (hpq : p+q=n) : + K.ιTotal c (p+1) q (n+1) (by dsimp; omega) ≫ K.D₁ c (n+1) n = + (K.d (p+1) p).f q ≫ K.ιTotal c p q n hpq := by + rw [ι_D₁, d₁_eq K c (by rfl : c.Rel (p+1) p) q n hpq,sign₁,one_smul] + +@[reassoc] lemma ι_d₂_succ (p q n : ℕ) (hpq : p+q=n) : + K.ιTotal c p (q+1) (n+1) (by dsimp; omega) ≫ K.D₂ c (n+1) n = + ((-1 : ℤˣ)^p) • ((K.X p).d (q+1) q ≫ K.ιTotal c p q n hpq) := by + rw [ι_D₂,d₂_eq K c p (by rfl : c.Rel (q+1) q) n hpq,sign₂] + +@[reassoc] lemma ι_d (p q n m : ℕ) (hpq : p+q=n) : + K.ιTotal c p q n hpq ≫ (K.total c).d n m = K.d₁ c p q m+K.d₂ c p q m := by + change _ ≫ (_+_)=_ + rw [Preadditive.comp_add,ι_D₁,ι_D₂] + +omit [HasCoproducts C] in +lemma comm_zero (h : Homotopy f g) (q : ℕ) : + (f.f 0).f q = (h.hom 0 1).f q ≫ (L.d 1 0).f q +(g.f 0).f q := by + have e := congrArg (fun k : K.X 0 ⟶ L.X 0 => k.f q) (h.comm 0) + simpa only [Homotopy.dNext_zero_chainComplex,Homotopy.prevD_chainComplex, + zero_add, HomologicalComplex.comp_f,HomologicalComplex.add_f_apply] using e + +omit [HasCoproducts C] in +lemma comm_succ (h : Homotopy f g) (p q : ℕ) : + (f.f (p+1)).f q = (K.d (p+1) p).f q ≫ (h.hom p (p+1)).f q + + (h.hom (p+1) (p+2)).f q ≫ (L.d (p+2) (p+1)).f q +(g.f (p+1)).f q := by + have e := congrArg (fun k : K.X (p+1) ⟶ L.X (p+1) => k.f q) (h.comm (p+1)) + simpa only [Homotopy.dNext_succ_chainComplex,Homotopy.prevD_chainComplex, + HomologicalComplex.comp_f,HomologicalComplex.add_f_apply] using e + +noncomputable def hom (h : Homotopy f g) : + ∀ n m, (K.total c).X n ⟶ (L.total c).X m := + fun n => Pi.single (n+1) (step h n) + +@[simp] lemma hom_diag (h : Homotopy f g) (n : ℕ) : hom h n (n+1)=step h n := by + simp [hom] + +@[reassoc] lemma ι_d_rightZero (p : ℕ) : + K.ιTotal c (p+1) 0 (p+1) (by simp) ≫ (K.total c).d (p+1) p = + (K.d (p+1) p).f 0 ≫ K.ιTotal c p 0 p (by simp) := by + rw [ι_d,d₁_eq K c (by rfl : c.Rel (p+1) p) 0 p (by simp),sign₁,one_smul, + d₂_eq_zero K c (p+1) 0 p (by simp [c]),add_zero] + +@[reassoc] lemma ι_d_leftZero (q : ℕ) : + K.ιTotal c 0 (q+1) (q+1) (by simp) ≫ (K.total c).d (q+1) q = + (K.X 0).d (q+1) q ≫ K.ιTotal c 0 q q (by simp) := by + rw [ι_d,d₁_eq_zero K c 0 (q+1) q (by simp [c]),zero_add, + d₂_eq K c 0 (by rfl : c.Rel (q+1) q) q (by simp),sign₂,pow_zero,one_smul] + +@[reassoc] lemma ι_d_both (p q n : ℕ) (hpq : p+q+1=n) : + K.ιTotal c (p+1) (q+1) (n+1) (by dsimp; omega) ≫ (K.total c).d (n+1) n = + (K.d (p+1) p).f (q+1) ≫ K.ιTotal c p (q+1) n (by dsimp; omega) + + ((-1 : ℤˣ)^(p+1)) • ((K.X (p+1)).d (q+1) q ≫ K.ιTotal c (p+1) q n (by dsimp; omega)) := by + rw [ι_d,d₁_eq K c (by rfl : c.Rel (p+1) p) (q+1) n (by dsimp; omega), + d₂_eq K c (p+1) (by rfl : c.Rel (q+1) q) n (by dsimp; omega),sign₁,one_smul,sign₂] + +lemma total_comm_zero (h : Homotopy f g) : + (total.map f c).f 0 = dNext 0 (hom h) + prevD 0 (hom h) + + (total.map g c).f 0 := by + rw [Homotopy.dNext_zero_chainComplex,Homotopy.prevD_chainComplex,hom_diag,zero_add] + apply total.hom_ext + intro p q hpq + obtain ⟨rfl,rfl⟩ := Nat.add_eq_zero_iff.mp hpq + simp only [Preadditive.comp_add,←Category.assoc,ι_step,ιTotal_map] + rw [Category.assoc,ι_d_rightZero,←Category.assoc,comm_zero h 0,Preadditive.add_comp] + +lemma neg_pow_smul_succ {A : Type*} [AddCommGroup A] (p : ℕ) (a : A) : + ((-1 : ℤˣ)^(p+1)) • a = - (((-1 : ℤˣ)^p) • a) := by + rw [pow_succ',mul_smul,Units.neg_smul,one_smul] + +lemma total_comm_succ (h : Homotopy f g) (n : ℕ) : + (total.map f c).f (n+1) = (K.total c).d (n+1) n ≫ step h n + + step h (n+1) ≫ (L.total c).d (n+2) (n+1) + (total.map g c).f (n+1) := by + apply total.hom_ext + intro p q hpq + change p+q=n+1 at hpq + cases p with + | zero => + cases q with + | zero => omega + | succ q => + have : q=n := by omega + subst q + simp only [Preadditive.comp_add,←Category.assoc,ι_d_leftZero,ι_step,ιTotal_map] + simp only [Category.assoc,ι_step,ι_d_both 0 n (n+1) (by omega)] + simp only [Preadditive.comp_add,Linear.comp_units_smul] + rw [←Category.assoc, ←Category.assoc, ←(h.hom 0 1).comm] + rw [comm_zero h (n+1),Preadditive.add_comp] + simp only [Nat.zero_add, pow_one, Units.neg_smul, one_smul, Category.assoc] + abel + | succ p => + cases q with + | zero => + have : p=n := by omega + subst p + simp only [Preadditive.comp_add,←Category.assoc,ι_d_rightZero,ι_step,ιTotal_map] + simp only [Category.assoc,ι_step,ι_d_rightZero] + rw [comm_succ h n 0] + simp only [Preadditive.add_comp,Category.assoc] + | succ q => + have hn : p+q+1=n := by omega + simp only [Preadditive.comp_add,←Category.assoc, + ι_d_both p q n hn,Preadditive.add_comp,Linear.units_smul_comp, + ι_step,ιTotal_map] + simp only [Category.assoc,ι_step,ι_d_both (p+1) q (n+1) (by omega)] + simp only [Preadditive.comp_add,Linear.comp_units_smul] + rw [←Category.assoc, ←Category.assoc, ←(h.hom (p+1) (p+2)).comm] + rw [comm_succ h p (q+1)] + simp only [Preadditive.add_comp,Category.assoc,neg_pow_smul_succ,neg_neg] + abel + +noncomputable def total (h : Homotopy f g) : Homotopy (total.map f c) (total.map g c) where + hom := hom h + zero i j hij := by + have hne : i+1 ≠ j := by simpa [c,eq_comm] using hij + exact Pi.single_eq_of_ne hne.symm _ + comm i := by + cases i with + | zero => exact total_comm_zero h + | succ n => + rw [Homotopy.dNext_succ_chainComplex,Homotopy.prevD_chainComplex,hom_diag,hom_diag] + exact total_comm_succ h n + +end TotalHomotopy + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/NoetherianTor.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/NoetherianTor.lean new file mode 100644 index 0000000000000000000000000000000000000000..0793ea8908fcf19a9081091f81182e201594e2dd --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/NoetherianTor.lean @@ -0,0 +1,292 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.PolygonCoefficientFinite + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section NoetherianTor +open CategoryTheory CategoryTheory.Limits CategoryTheory.MonoidalCategory +universe nt + +namespace NoetherianResolution +variable {R : Type nt} [CommRing R] + +theorem homologyMap_smul {C D : ChainComplex (ModuleCat.{nt} R) ℕ} + (f : C ⟶ D) (r : R) (n : ℕ) : + HomologicalComplex.homologyMap (r • f) n = + r • HomologicalComplex.homologyMap f n := by + exact ShortComplex.homologyMap_smul + ((HomologicalComplex.shortComplexFunctor (ModuleCat R) _ n).map f) r + +noncomputable def annihilatorHomotopy {M : ModuleCat.{nt} R} + (P : ProjectiveResolution M) (r : R) (hr : ∀ x : M, r • x = 0) : + Homotopy (r • 𝟙 P.complex) 0 := by + apply ProjectiveResolution.liftHomotopyZero + apply HomologicalComplex.to_single_hom_ext + ext x + change (P.π.f 0).hom (r • x) = 0 + rw [map_smul] + exact hr (P.π.f 0 x) + +theorem annihilator_homology {M : ModuleCat.{nt} R} + (P : ProjectiveResolution M) (F : ModuleCat.{nt} R ⥤ ModuleCat.{nt} R) + [F.Additive] [Functor.Linear R F] (r : R) (hr : ∀ x : M, r • x = 0) + (n : ℕ) (x : ((F.mapHomologicalComplex _).obj P.complex).homology n) : + r • x = 0 := by + have h := (F.mapHomotopy (annihilatorHomotopy P r hr)).homologyMap_eq n + rw [Functor.map_smul, CategoryTheory.Functor.map_id, Functor.map_zero, + homologyMap_smul, HomologicalComplex.homologyMap_id, + HomologicalComplex.homologyMap_zero] at h + exact DFunLike.congr_fun (ModuleCat.hom_ext_iff.mp h) x + +variable [IsNoetherianRing R] + +theorem finite_tensor_resolution_homology (L M : FGModuleCat.{nt} R) (n : ℕ) : + Module.Finite R + (((((tensoringLeft (ModuleCat R)).obj L.obj).mapHomologicalComplex _).obj + (resolution M).complex).homology n) := by + have : Module.Finite R + (((((tensoringLeft (ModuleCat R)).obj L.obj).mapHomologicalComplex _).obj + (resolution M).complex).X n) := + Module.Finite.tensorProduct R L ((resolution M).complex.X n) + exact finite_homology _ n + +end NoetherianResolution + +theorem module_finite_int_of_augmentation {R : Type*} [Ring R] + {M : Type*} [AddCommGroup M] [Module R M] [Module.Finite R M] + (ε : R →+* ℤ) (h : ∀ (r : R) (x : M), r • x = ε r • x) : + Module.Finite ℤ M := by + obtain ⟨s,hs⟩ := (Module.Finite.fg_top (R := R) (M := M)) + refine ⟨s, ?_⟩ + apply top_unique + intro x hx + have hx' : x ∈ Submodule.span R (s : Set M) := by rw [hs]; trivial + clear hx + induction hx' using Submodule.span_induction with + | mem x hx => exact Submodule.subset_span hx + | zero => exact Submodule.zero_mem _ + | add x y _ _ hx hy => exact Submodule.add_mem _ hx hy + | smul r x _ hx => rw [h]; exact Submodule.smul_mem _ _ hx + +end NoetherianTor + +section AugmentationTor +open CategoryTheory CategoryTheory.Limits CategoryTheory.MonoidalCategory +namespace NoetherianResolution +variable {R : Type} [CommRing R] [IsNoetherianRing R] + +noncomputable abbrev augmentationModule (ε : R →+* ℤ) : ModuleCat R := + (ModuleCat.restrictScalars ε).obj (ModuleCat.of ℤ ℤ) + +instance finite_augmentationModule (ε : R →+* ℤ) : + Module.Finite R (augmentationModule ε) := by + have : Module.Finite ℤ (augmentationModule ε) := inferInstanceAs (Module.Finite ℤ ℤ) + exact Module.Finite.of_restrictScalars_finite ℤ R (augmentationModule ε) + +noncomputable def augmentationResolution (ε : R →+* ℤ) : + ProjectiveResolution (augmentationModule ε) := + resolution (FGModuleCat.of R (augmentationModule ε)) + +noncomputable def augmentationComplex (ε : R →+* ℤ) (L : FGModuleCat R) : + ChainComplex (ModuleCat R) ℕ := + ((((tensoringLeft (ModuleCat R)).obj L.obj).mapHomologicalComplex _).obj + (augmentationResolution ε).complex) + +instance finite_augmentation_homology (ε : R →+* ℤ) (L : FGModuleCat R) (n : ℕ) : + Module.Finite R ((augmentationComplex ε L).homology n) := + finite_tensor_resolution_homology L (FGModuleCat.of R (augmentationModule ε)) n + +theorem augmentation_homology_smul (ε : R →+* ℤ) (L : FGModuleCat R) (n : ℕ) + (r : R) (x : (augmentationComplex ε L).homology n) : + r • x = ε r • x := by + have h0 : ∀ z : augmentationModule ε, (r - (ε r : R)) • z = 0 := by + intro z + change ε (r - (ε r : R)) • z = 0 + simp only [map_sub, map_intCast, Int.cast_id, sub_self, zero_smul] + have h := annihilator_homology (augmentationResolution ε) + ((tensoringLeft (ModuleCat R)).obj L.obj) (r - (ε r : R)) h0 n x + have h' : (r - (ε r : R)) • x = 0 := h + rw [sub_smul, sub_eq_zero] at h' + simpa only [Int.cast_smul_eq_zsmul] using h' + +theorem finite_int_augmentation_homology (ε : R →+* ℤ) (L : FGModuleCat R) (n : ℕ) : + Module.Finite ℤ ((augmentationComplex ε L).homology n) := + module_finite_int_of_augmentation ε (augmentation_homology_smul ε L n) + +theorem finite_int_Tor_augmentation (ε : R →+* ℤ) (L : FGModuleCat R) (n : ℕ) : + Module.Finite ℤ (((Tor (ModuleCat R) n).obj L.obj).obj (augmentationModule ε)) := by + have := finite_int_augmentation_homology ε L n + let e : (((Tor (ModuleCat R) n).obj L.obj).obj (augmentationModule ε)) ≅ + (augmentationComplex ε L).homology n := + (augmentationResolution ε).isoLeftDerivedObj + ((tensoringLeft (ModuleCat R)).obj L.obj) n + exact Module.Finite.of_surjective (e.inv.hom.restrictScalars ℤ) + e.toLinearEquiv.symm.surjective + +end NoetherianResolution +end AugmentationTor + +section RingCoinvariants + +open CategoryTheory CategoryTheory.MonoidalCategory +open scoped TensorProduct +attribute [local instance 1200] Rep.hV2 +namespace RingCoinvariants +variable {G : Type} [CommGroup G] +local notation "R" => MonoidAlgebra ℤ G + +noncomputable abbrev inverseRep (M : ModuleCat R) : Rep ℤ G := + Rep.of ((Representation.ofModule' (k := ℤ) (G := G) M).comp (invMonoidHom : G →* G)) + +noncomputable abbrev moduleRep (M : ModuleCat R) : Rep ℤ G := + Rep.of (Representation.ofModule' (k := ℤ) (G := G) M) + +@[simp] theorem inverseRep_apply (M : ModuleCat R) (g : G) (x : M) : + (inverseRep M).ρ g x = (MonoidAlgebra.single g⁻¹ 1 : R) • x := rfl + +@[simp] theorem moduleRep_apply (M : ModuleCat R) (g : G) (x : M) : + (moduleRep M).ρ g x = (MonoidAlgebra.single g 1 : R) • x := rfl + +noncomputable def forwardTensor (L M : ModuleCat R) : + (↑(inverseRep L) ⊗[ℤ] ↑(moduleRep M)) →ₗ[ℤ] (L ⊗[R] M) := + TensorProduct.lift ((TensorProduct.mk R L M).restrictScalars₁₂ ℤ ℤ) + +theorem forwardTensor_invariant (L M : ModuleCat R) (g : G) : + (forwardTensor L M).comp ((inverseRep L).ρ.tprod (moduleRep M).ρ g) = + forwardTensor L M := by + apply TensorProduct.ext + ext x y + change ((MonoidAlgebra.single g⁻¹ 1 : R) • x) ⊗ₜ[R] + ((MonoidAlgebra.single g 1 : R) • y) = x ⊗ₜ[R] y + rw [TensorProduct.smul_tmul, ← smul_assoc] + simp [MonoidAlgebra.single_mul_single, ← MonoidAlgebra.one_def] + +noncomputable def forward (L M : ModuleCat R) : + ((Rep.coinvariantsTensor ℤ G).obj (inverseRep L)).obj (moduleRep M) →ₗ[ℤ] + (L ⊗[R] M) := + Representation.Coinvariants.lift _ (forwardTensor L M) + (forwardTensor_invariant L M) + +@[simp] theorem forward_mk (L M : ModuleCat R) (x : L) (y : M) : + forward L M (Rep.coinvariantsTensorMk (inverseRep L) (moduleRep M) x y) = + x ⊗ₜ[R] y := rfl + +theorem mk_act_left {k H : Type} [CommRing k] [Group H] (A B : Rep k H) + (g : H) (x : A) (y : B) : + Rep.coinvariantsTensorMk A B (A.ρ g⁻¹ x) y = + Rep.coinvariantsTensorMk A B x (B.ρ g y) := by + have h := Representation.Coinvariants.mk_self_apply (A.ρ.tprod B.ρ) g + ((A.ρ g⁻¹ x) ⊗ₜ[k] y) + change Representation.Coinvariants.mk _ + ((A.ρ g (A.ρ g⁻¹ x)) ⊗ₜ[k] (B.ρ g y)) = _ at h + have hx : A.ρ g (A.ρ g⁻¹ x) = x := by + rw [← Module.End.mul_apply, ← map_mul, mul_inv_cancel, map_one, Module.End.one_apply] + rw [hx] at h + exact h.symm + +theorem mk_balanced_group (L M : ModuleCat R) (g : G) (x : L) (y : M) : + Rep.coinvariantsTensorMk (inverseRep L) (moduleRep M) + ((MonoidAlgebra.single g 1 : R) • x) y = + Rep.coinvariantsTensorMk (inverseRep L) (moduleRep M) + x ((MonoidAlgebra.single g 1 : R) • y) := by + have h := mk_act_left (inverseRep L) (moduleRep M) g x y + change Rep.coinvariantsTensorMk (inverseRep L) (moduleRep M) + ((MonoidAlgebra.single (g⁻¹)⁻¹ 1 : R) • x) y = + Rep.coinvariantsTensorMk (inverseRep L) (moduleRep M) + x ((MonoidAlgebra.single g 1 : R) • y) at h + simpa only [inv_inv] using h + +noncomputable def backward (L M : ModuleCat R) : + (L ⊗[R] M) →ₗ[ℤ] + ((Rep.coinvariantsTensor ℤ G).obj (inverseRep L)).obj (moduleRep M) := + (TensorProduct.liftAddHom + (LinearMap.toAddMonoidHom'.comp + (Rep.coinvariantsTensorMk (inverseRep L) (moduleRep M)).toAddMonoidHom) + (by + intro r x y + induction r using MonoidAlgebra.induction_on with + | of g => exact mk_balanced_group L M g x y + | add r s hr hs => simpa only [add_smul, map_add, LinearMap.add_apply, AddMonoidHom.add_apply] using congrArg₂ (· + ·) hr hs + | smul n r hr => + simpa only [smul_assoc, map_zsmul, AddMonoidHom.zsmul_apply] using congrArg (n • ·) hr + )).toIntLinearMap + +@[simp] theorem backward_mk (L M : ModuleCat R) (x : L) (y : M) : + backward L M (x ⊗ₜ[R] y) = + Rep.coinvariantsTensorMk (inverseRep L) (moduleRep M) x y := rfl + +noncomputable def equiv (L M : ModuleCat R) : + ((Rep.coinvariantsTensor ℤ G).obj (inverseRep L)).obj (moduleRep M) ≃ₗ[ℤ] + (L ⊗[R] M) := by + refine LinearEquiv.ofLinearMap (forward L M) (backward L M) ?_ ?_ + · apply LinearMap.ext + intro z + induction z using TensorProduct.inductionOn with + | tmul x y => rfl + | add x y hx hy => simpa only [map_add] using congrArg₂ (· + ·) hx hy + · apply Representation.Coinvariants.hom_ext + apply TensorProduct.ext + ext x y + rfl + +@[simp] theorem equiv_mk (L M : ModuleCat R) (x : L) (y : M) : + equiv L M (Rep.coinvariantsTensorMk (inverseRep L) (moduleRep M) x y) = + x ⊗ₜ[R] y := rfl + +noncomputable def moduleRepIso (M : ModuleCat R) : + moduleRep M ≅ Rep.ofModuleMonoidAlgebra.obj M := + @Rep.mkIso ℤ G _ _ (moduleRep M) (Rep.ofModuleMonoidAlgebra.obj M) _ _ + (moduleRep M).hV2 (Rep.ofModuleMonoidAlgebra.obj M).hV2 _ _ { + toFun := fun x => x + invFun := fun x => x + left_inv := fun _ => rfl + right_inv := fun _ => rfl + map_add' := fun _ _ => rfl + map_smul' := fun n x => by + change n • x = (algebraMap ℤ R n) • x + exact (IsScalarTower.algebraMap_smul R n x).symm + isIntertwining' := fun g => rfl } + +noncomputable def intRestrictionIso {S : Type} [Ring S] (M : ModuleCat S) : + ModuleCat.of ℤ M ≅ (ModuleCat.restrictScalars (Int.castRingHom S)).obj M := by + let A := ModuleCat.of ℤ M + let B := (ModuleCat.restrictScalars (Int.castRingHom S)).obj M + let e : A ≃ₗ[ℤ] B := { + toFun := fun x => x + invFun := fun x => x + left_inv := fun _ => rfl + right_inv := fun _ => rfl + map_add' := fun _ _ => rfl + map_smul' := fun integer element => by + change integer • element = (integer : S) • (show M from element) + exact (Int.cast_smul_eq_zsmul S integer (show M from element)).symm } + exact e.toModuleIso + +noncomputable def functorIso (L : ModuleCat R) : + Rep.ofModuleMonoidAlgebra ⋙ (Rep.coinvariantsTensor ℤ G).obj (inverseRep L) ≅ + (tensoringLeft (ModuleCat R)).obj L ⋙ + ModuleCat.restrictScalars (Int.castRingHom R) := + NatIso.ofComponents (fun M => + (((Rep.coinvariantsTensor ℤ G).obj (inverseRep L)).mapIso (moduleRepIso M)).symm ≪≫ + (equiv L M).toModuleIso ≪≫ intRestrictionIso (ModuleCat.of R (L ⊗[R] M))) (by + intro M N f + apply Rep.coinvariantsTensor_hom_ext + apply DFunLike.ext + intro x + apply DFunLike.ext + intro y + rfl) +end RingCoinvariants +end RingCoinvariants + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/PermutationAugmentation.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/PermutationAugmentation.lean new file mode 100644 index 0000000000000000000000000000000000000000..1b2e23124ad45220f22e73392461facc0668e921 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/PermutationAugmentation.lean @@ -0,0 +1,65 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.FullGroupStability + +namespace OAI + +open Classical CategoryTheory CategoryTheory.Limits Representation Rep Finsupp +namespace SimpleAmenable.TransitiveInduction + +attribute [local instance 1200] Rep.hV2 +variable {G X Y : Type} [Group G] [MulAction G X] [MulAction G Y] + +noncomputable def augmentation (G X : Type) [Group G] [MulAction G X] : + Rep.of (permutationRep (G:=G) (X:=X)) ⟶ Rep.trivial ℤ G ℤ := + Rep.ofHom ⟨Finsupp.lsum ℤ (fun _ => (LinearMap.id : ℤ →ₗ[ℤ] ℤ)), by + intro g + apply Finsupp.lhom_ext + intro x z + change (Finsupp.lsum ℤ (fun _ : X => (LinearMap.id : ℤ →ₗ[ℤ] ℤ))) + (permutationRep (G:=G) (X:=X) g (single x z))= + (Finsupp.lsum ℤ (fun _ : X => (LinearMap.id : ℤ →ₗ[ℤ] ℤ))) (single x z) + rw [permutationRep_single] + simp⟩ + +@[simp] lemma augmentation_single (x : X) (z : ℤ) : + (augmentation G X).hom (single x z)=z := by simp [augmentation] + +lemma augmentation_natural (f : X → Y) (hf : ∀g : G,∀x,f (g • x)=g • f x) : + equivariantMap f hf ≫ augmentation G Y=augmentation G X := by + apply Rep.hom_ext + apply Representation.IntertwiningMap.ext + apply Finsupp.lhom_ext + intro x z + change (augmentation G Y).hom ((equivariantMap f hf).hom (single x z))= + (augmentation G X).hom (single x z) + rw [equivariantMap_single, augmentation_single, augmentation_single] +lemma augmentation_pointMap (x : X) (q : ℕ) : + groupHomology.map (MulAction.stabilizer G x).subtype (pointMap x) q ≫ + (groupHomology.functor ℤ G q).map (augmentation G X) = + TrivialHomology.map (MulAction.stabilizer G x).subtype q := by + erw [groupHomology.functor_map, ← groupHomology.map_comp] + apply groupHomology.map_congr + · rfl + · apply LinearMap.ext + intro z + change (augmentation G X).hom (single x z)=z + exact augmentation_single x z +lemma isIso_H0_augmentation (x : X) (ht : ∀y:X,∃g:G,g • x=y) : + IsIso ((groupHomology.functor ℤ G 0).map (augmentation G X)) := by + have pointIso := isIso_map_pointMap x ht 0 + have trivialIso := isIso_map_trivial_H0 (MulAction.stabilizer G x).subtype + exact @IsIso.of_isIso_fac_left _ _ _ _ _ _ _ _ pointIso trivialIso + (augmentation_pointMap x 0) + +lemma map_equivariant_H0_eq (f₀ f₁ : X → Y) + (h₀ : ∀g : G,∀x,f₀ (g • x)=g • f₀ x) + (h₁ : ∀g : G,∀x,f₁ (g • x)=g • f₁ x) + (y : Y) (ht : ∀z:Y,∃g:G,g • y=z) : + (groupHomology.functor ℤ G 0).map (equivariantMap f₀ h₀)= + (groupHomology.functor ℤ G 0).map (equivariantMap f₁ h₁) := by + have := isIso_H0_augmentation y ht + apply (cancel_mono ((groupHomology.functor ℤ G 0).map (augmentation G Y))).1 + rw [← Functor.map_comp, ← Functor.map_comp, augmentation_natural, augmentation_natural] +end SimpleAmenable.TransitiveInduction + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/PiBinary.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/PiBinary.lean new file mode 100644 index 0000000000000000000000000000000000000000..e375ddbc8e8a25f96cb8aecd2a9ad9b859192191 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/PiBinary.lean @@ -0,0 +1,31 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.PiFiber + +namespace OAI + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits MonoidalCategory Simplicial Opposite +namespace PiSSet + +noncomputable def binaryIso (X:Fin 2→SSet) : obj X ≅ X 0⊗X 1 where + hom := {app _:=↾fun z=>(z 0,z 1) + naturality _ _ _:=rfl} + inv := {app _:=↾fun z=>Fin.cases z.1 (Fin.cases z.2 (fun i=>i.elim0)) + naturality _ _ _:=by apply ConcreteCategory.hom_ext; intro z; funext i; fin_cases i <;> rfl} + hom_inv_id:=by apply NatTrans.ext; funext p; apply ConcreteCategory.hom_ext; intro z; funext i; fin_cases i <;> rfl + inv_hom_id:=by ext p z <;> rfl +@[simp] lemma binaryIso_fst (X:Fin 2→SSet) : (binaryIso X).hom ≫ CartesianMonoidalCategory.fst _ _=proj X 0 := rfl +@[simp] lemma binaryIso_snd (X:Fin 2→SSet) : (binaryIso X).hom ≫ CartesianMonoidalCategory.snd _ _=proj X 1 := rfl +end PiSSet +namespace PiFiber + +variable (C:Type) [Groupoid.{0} C] +lemma binary_inclusion (p:Fin 2→Skeleton C) : + inclusion C (Fin 2) p ≫ (PiSSet.binaryIso (fun _:Fin 2=>nerve C)).hom = + (PiSSet.binaryIso (fun i=>nerve (ComponentTranslation.Fiber (p i)))).hom ≫ + (nerveMap (ComponentTranslation.property (p 0)).ι⊗ₘnerveMap (ComponentTranslation.property (p 1)).ι) := rfl +end PiFiber + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/PiH1Coproduct.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/PiH1Coproduct.lean new file mode 100644 index 0000000000000000000000000000000000000000..fcae7e617734a1221dc754600241767fc549b0af --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/PiH1Coproduct.lean @@ -0,0 +1,125 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.PiFiber + +namespace OAI + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits MonoidalCategory Simplicial Opposite +namespace PiSSet +open FreeChains + +variable {n:ℕ} (X:Fin n→SSet) (x:∀i,(X i).obj (op ⦋0⦌)) +noncomputable def h1Cocone : Cofan (fun i=>(X i).homology Z 1) := + Cofan.mk ((obj X).homology Z 1) (fun i=>SSet.homologyMap (incl X x i) Z 1) +lemma incl_proj_h1 (i j:Fin n) : + SSet.homologyMap (incl X x i) Z 1 ≫ SSet.homologyMap (proj X j) Z 1= + if h:i=j then eqToHom (congrArg (fun i=>(X i).homology Z 1) h) else 0 := by + classical + rw [←SSet.homologyMap_comp] + by_cases h:i=j + · subst j; simp + · rw [incl_other X x h,ConnectedProduct.const_homology_zero _ 1 (by decide)] + simp [h] +lemma h1_decomposition (hX:∀i,(X i).IsConnected) : + ∑ i:Fin n,SSet.homologyMap (proj X i) Z 1 ≫ SSet.homologyMap (incl X x i) Z 1=𝟙 _ := by + classical + apply ModuleCat.hom_ext + apply LinearMap.ext + intro a + apply homology_ext n X hX + intro j + change ((∑ i:Fin n, SSet.homologyMap (proj X i) Z 1 ≫ SSet.homologyMap (incl X x i) Z 1) ≫ + SSet.homologyMap (proj X j) Z 1) a=SSet.homologyMap (proj X j) Z 1 a + rw [Preadditive.sum_comp] + simp_rw [Category.assoc] + rw [Finset.sum_eq_single j] + · rw [incl_proj_h1]; simp + · intro i hi hij; rw [incl_proj_h1]; simp [hij] + · simp +noncomputable def h1IsColimit (hX:∀i,(X i).IsConnected) : IsColimit (h1Cocone X x) where + desc s := ∑ i:Fin n,SSet.homologyMap (proj X i) Z 1 ≫ s.ι.app ⟨i⟩ + fac s j := by + classical + cases j with | mk j => + change SSet.homologyMap (incl X x j) Z 1 ≫ + (∑ i:Fin n,SSet.homologyMap (proj X i) Z 1 ≫ s.ι.app ⟨i⟩)=s.ι.app ⟨j⟩ + rw [Preadditive.comp_sum,Finset.sum_eq_single j] + · rw [←Category.assoc,incl_proj_h1]; simp + · intro i hi hij; rw [←Category.assoc,incl_proj_h1]; simp [Ne.symm hij] + · simp + uniq s f hf := by + dsimp only [h1Cocone, Cofan.mk_pt] at f hf ⊢ + change f = ∑ i:Fin n,SSet.homologyMap (proj X i) Z 1 ≫ s.ι.app ⟨i⟩ + rw [←Category.id_comp f,←h1_decomposition X x hX,Preadditive.sum_comp] + apply Finset.sum_congr rfl + intro i hi + rw [Category.assoc] + exact congrArg (fun g=>SSet.homologyMap (proj X i) Z 1 ≫ g) (hf ⟨i⟩) +end PiSSet + +end + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits MonoidalCategory Simplicial Opposite +namespace MarkedH1 +open FreeChains ComponentTranslation + +variable {C:Type} [Groupoid.{0} C] [MonoidalCategory C] [SymmetricCategory C] +noncomputable def evalIso (n:ℕ) : + (nerve (IntervalBar.Diagram C (Fin (n+1)))).homology Z 1 ≅ + (PiFiber.prod C (Fin n)).homology Z 1 := by + haveI := NerveHomotopy.homologyMap_isIso (IntervalBar.Diagram.eval (C:=C) n) Z 1 + exact asIso (SSet.homologyMap (nerveMap (IntervalBar.Diagram.eval (C:=C) n)) Z 1) ≪≫ + (SSet.homologyFunctor Z 1).mapIso (PiSSet.nervePiIso (fun _:Fin n=>C)) +noncomputable def points {n:ℕ} (p:Fin n→Skeleton C) : + ∀i,(nerve (Fiber (p i))).obj (op ⦋0⦌) := fun i=>nerveEquiv.symm (base (p i)) +noncomputable def primitive {n:ℕ} (p:Fin n→Skeleton C) (i:Fin n) : + (nerve (Fiber (p i))).homology Z 1 ⟶ + (nerve (IntervalBar.Diagram C (Fin (n+1)))).homology Z 1 := + SSet.homologyMap (PiSSet.incl (fun j=>nerve (Fiber (p j))) (points p) i) Z 1 ≫ + SSet.homologyMap (PiFiber.inclusion C (Fin n) p) Z 1 ≫ (evalIso n).inv +omit [SymmetricCategory C] in +lemma hom_ext {n:ℕ} {M:A} + {f g:(nerve (IntervalBar.Diagram C (Fin (n+1)))).homology Z 1 ⟶ M} + (h:∀ (p:Fin n→Skeleton C) (i:Fin n),primitive p i ≫ f=primitive p i ≫ g) : f=g := by + apply (cancel_epi (evalIso n).inv).mp + apply (PiFiber.homologyIsColimit C (Fin n) 1).hom_ext + intro p + apply (PiSSet.h1IsColimit (fun i=>nerve (Fiber (p.as i))) (points p.as) (fun _=>inferInstance)).hom_ext + intro i + exact (Category.assoc _ _ _).symm.trans ((h p.as i.as).trans (Category.assoc _ _ _)) +noncomputable def descCocone {n:ℕ} {M:A} + (f:∀ (p:Fin n→Skeleton C) (i:Fin n),(nerve (Fiber (p i))).homology Z 1 ⟶ M) : + Cocone (PiFiber.diagram C (Fin n) ⋙ SSet.homologyFunctor Z 1) where + pt := M + ι := Discrete.natTrans (fun p => (PiSSet.h1IsColimit (fun i=>nerve (Fiber (p.as i))) (points p.as) (fun _=>inferInstance)).desc + (Cofan.mk M (f p.as))) +noncomputable def desc {n:ℕ} {M:A} + (f:∀ (p:Fin n→Skeleton C) (i:Fin n),(nerve (Fiber (p i))).homology Z 1 ⟶ M) : + (nerve (IntervalBar.Diagram C (Fin (n+1)))).homology Z 1 ⟶ M := + (evalIso n).hom ≫ (PiFiber.homologyIsColimit C (Fin n) 1).desc (descCocone f) +omit [SymmetricCategory C] in +@[reassoc (attr:=simp)] lemma primitive_desc {n:ℕ} {M:A} + (f:∀ (p:Fin n→Skeleton C) (i:Fin n),(nerve (Fiber (p i))).homology Z 1 ⟶ M) + (p:Fin n→Skeleton C) (i:Fin n) : primitive p i ≫ desc f=f p i := by + let coordinateMap : (nerve (Fiber (p i))).homology Z 1 ⟶ + (PiFiber.piece C (Fin n) p).homology Z 1 := + SSet.homologyMap (PiSSet.incl (fun j=>nerve (Fiber (p j))) (points p) i) Z 1 + let inclusionMap : (PiFiber.piece C (Fin n) p).homology Z 1 ⟶ + (PiFiber.prod C (Fin n)).homology Z 1 := + SSet.homologyMap (PiFiber.inclusion C (Fin n) p) Z 1 + let coconeDesc : (PiFiber.prod C (Fin n)).homology Z 1 ⟶ M := + (PiFiber.homologyIsColimit C (Fin n) 1).desc (descCocone f) + change (coordinateMap ≫ inclusionMap ≫ (evalIso n).inv) ≫ + (evalIso n).hom ≫ coconeDesc = f p i + simp only [Category.assoc,Iso.inv_hom_id_assoc] + have h:=(PiFiber.homologyIsColimit C (Fin n) 1).fac (descCocone f) ⟨p⟩ + change inclusionMap ≫ coconeDesc = _ at h + rw [h] + exact (PiSSet.h1IsColimit (fun j=>nerve (Fiber (p j))) (points p) (fun _=>inferInstance)).fac + (Cofan.mk M (f p)) ⟨i⟩ +end MarkedH1 + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/PiSSet.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/PiSSet.lean new file mode 100644 index 0000000000000000000000000000000000000000..5cb205663e82e92179dc1f4a3cfd31a87989f0ee --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/PiSSet.lean @@ -0,0 +1,204 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.StageCoordinateMaps +import OAI.GroupTheory.SimpleAmenable.Homology.ConstantSplit + +namespace OAI + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits MonoidalCategory Simplicial Opposite +namespace PiSSet +open FreeChains + +variable {ι:Type} (X:ι→SSet) +noncomputable def obj : SSet where + obj p := ∀i,(X i).obj p + map f := ↾fun s i=>(X i).map f (s i) + map_id p := by apply ConcreteCategory.hom_ext; intro s; funext i; exact congrArg (fun f=>f (s i)) ((X i).map_id p) + map_comp f g := by apply ConcreteCategory.hom_ext; intro s; funext i; exact congrArg (fun f=>f (s i)) ((X i).map_comp f g) +noncomputable def proj (i:ι) : obj X ⟶ X i where + app _ := ↾fun s=>s i + naturality _ _ _ := rfl +noncomputable def lift {Y:SSet} (f:∀i,Y⟶X i) : Y⟶obj X where + app p := ↾fun s i=>(f i).app p s + naturality p q g := by apply ConcreteCategory.hom_ext; intro s; funext i; exact congrArg (fun f=>f s) ((f i).naturality g) +@[simp] lemma lift_proj {Y:SSet} (f:∀i,Y⟶X i) (i:ι) : lift X f ≫ proj X i=f i := rfl +noncomputable def incl (x:∀i,(X i).obj (op ⦋0⦌)) (i:ι) : X i ⟶ obj X := by + classical + exact lift X (fun j=>if h:i=j then eqToHom (congrArg X h) else SSet.const (x j)) +@[simp] lemma incl_self (x:∀i,(X i).obj (op ⦋0⦌)) (i:ι) : incl X x i ≫ proj X i=𝟙 _ := by + classical + simp [incl] +lemma incl_other (x:∀i,(X i).obj (op ⦋0⦌)) {i j:ι} (h:i≠j) : + incl X x i ≫ proj X j=SSet.const (x j) := by + classical + simp [incl,h] +noncomputable def finSuccIso {n:ℕ} (X:Fin (n+1)→SSet) : + obj X ≅ X 0 ⊗ obj (fun i:Fin n=>X i.succ) where + hom := {app _ := ↾fun x=>(x 0,fun i=>x i.succ) + naturality _ _ _ := rfl} + inv := {app _ := ↾fun x=>Fin.cases x.1 x.2 + naturality _ _ _ := by + apply ConcreteCategory.hom_ext; intro x; funext i + cases i using Fin.cases <;> rfl} + hom_inv_id := by + apply NatTrans.ext; funext p; apply ConcreteCategory.hom_ext; intro x; funext i + cases i using Fin.cases <;> rfl + inv_hom_id := by ext p x <;> rfl +noncomputable def finZeroIso (X:Fin 0→SSet) : obj X ≅ ConnectedProduct.one where + hom := { app _ := ↾fun _=>PUnit.unit + naturality _ _ _ := rfl } + inv := { app _ := ↾fun _ i=>Fin.elim0 i + naturality _ _ _ := by apply ConcreteCategory.hom_ext; intro x; funext i; exact i.elim0 } + hom_inv_id := by apply NatTrans.ext; funext p; apply ConcreteCategory.hom_ext; intro x; funext i; exact i.elim0 + inv_hom_id := by ext p x; rfl +lemma fin_connected (n:ℕ) (X:Fin n→SSet) (hX:∀i,(X i).IsConnected) : (obj X).IsConnected := by + induction n with + | zero => exact BarFinitePower.connected_of_iso _ (finZeroIso X) + | succ n ih => + have := hX 0 + have := ih (fun i=>X i.succ) (fun i=>hX i.succ) + exact BarFinitePower.connected_of_iso _ (finSuccIso X) +@[simp] lemma finSucc_fst {n:ℕ} (X:Fin (n+1)→SSet) : + (finSuccIso X).hom ≫ CartesianMonoidalCategory.fst _ _=proj X 0 := rfl +@[simp] lemma finSucc_snd {n:ℕ} (X:Fin (n+1)→SSet) (i:Fin n) : + (finSuccIso X).hom ≫ CartesianMonoidalCategory.snd _ _ ≫ proj (fun j:Fin n=>X j.succ) i=proj X i.succ := rfl +lemma biprod_element_ext {M N:A} (a b:(M ⊞ N : A)) + (hf:(biprod.fst : M ⊞ N ⟶ M) a=(biprod.fst : M ⊞ N ⟶ M) b) + (hs:(biprod.snd : M ⊞ N ⟶ N) a=(biprod.snd : M ⊞ N ⟶ N) b) : a=b := by + have ha:=congrArg (fun f:(M ⊞ N)⟶(M ⊞ N)=>f a) (biprod.total (X:=M) (Y:=N)) + have hb:=congrArg (fun f:(M ⊞ N)⟶(M ⊞ N)=>f b) (biprod.total (X:=M) (Y:=N)) + change (biprod.inl : M ⟶ M ⊞ N) ((biprod.fst : M ⊞ N ⟶ M) a) + + (biprod.inr : N ⟶ M ⊞ N) ((biprod.snd : M ⊞ N ⟶ N) a)=a at ha + change (biprod.inl : M ⟶ M ⊞ N) ((biprod.fst : M ⊞ N ⟶ M) b) + + (biprod.inr : N ⟶ M ⊞ N) ((biprod.snd : M ⊞ N ⟶ N) b)=b at hb + rw [←ha,←hb,hf,hs] +lemma homology_ext (n:ℕ) (X:Fin n→SSet) (hX:∀i,(X i).IsConnected) + (a b:((obj X).homology Z 1 : A)) (h:∀i,SSet.homologyMap (proj X i) Z 1 a=SSet.homologyMap (proj X i) Z 1 b) : a=b := by + induction n with + | zero => + have hz : IsZero ((obj X).homology Z 1) := + IsZero.of_iso (ConnectedProduct.one_homology_zero 1 (by decide)) + ((SSet.homologyFunctor Z 1).mapIso (finZeroIso X)) + have := ModuleCat.isZero_iff_subsingleton.mp hz + exact Subsingleton.elim _ _ + | succ n ih => + have := hX 0 + have := fin_connected n (fun i=>X i.succ) (fun i=>hX i.succ) + have := ConnectedProduct.projection_isIso_arbitrary (X 0) (obj (fun i:Fin n=>X i.succ)) + 1 1 1 (by omega) (by omega) (by intros; omega) (by intros; omega) + let e := (SSet.homologyFunctor Z 1).mapIso (finSuccIso X) + apply e.toLinearEquiv.injective + apply (ConcreteCategory.bijective_of_isIso (ConnectedProduct.projection (X 0) (obj (fun i:Fin n=>X i.succ)) 1)).1 + apply biprod_element_ext + · change (ConnectedProduct.projection (X 0) (obj (fun i:Fin n=>X i.succ)) 1 ≫ biprod.fst) (e.hom a)= + (ConnectedProduct.projection (X 0) (obj (fun i:Fin n=>X i.succ)) 1 ≫ biprod.fst) (e.hom b) + rw [ConnectedProduct.projection,biprod.lift_fst] + change (SSet.homologyMap (finSuccIso X).hom Z 1 ≫ + SSet.homologyMap (CartesianMonoidalCategory.fst _ _) Z 1) a = + (SSet.homologyMap (finSuccIso X).hom Z 1 ≫ + SSet.homologyMap (CartesianMonoidalCategory.fst _ _) Z 1) b + rw [←SSet.homologyMap_comp,finSucc_fst] + exact h 0 + · change (ConnectedProduct.projection (X 0) (obj (fun i:Fin n=>X i.succ)) 1 ≫ biprod.snd) (e.hom a)= + (ConnectedProduct.projection (X 0) (obj (fun i:Fin n=>X i.succ)) 1 ≫ biprod.snd) (e.hom b) + rw [ConnectedProduct.projection,biprod.lift_snd] + apply ih (fun i=>X i.succ) (fun i=>hX i.succ) + intro i + change (SSet.homologyMap (finSuccIso X).hom Z 1 ≫ + SSet.homologyMap (CartesianMonoidalCategory.snd _ _) Z 1 ≫ + SSet.homologyMap (proj (fun i:Fin n=>X i.succ) i) Z 1) a = + (SSet.homologyMap (finSuccIso X).hom Z 1 ≫ + SSet.homologyMap (CartesianMonoidalCategory.snd _ _) Z 1 ≫ + SSet.homologyMap (proj (fun i:Fin n=>X i.succ) i) Z 1) b + rw [←SSet.homologyMap_comp,←SSet.homologyMap_comp,finSucc_snd] + exact h i.succ +noncomputable def homologyPi {n:ℕ} (X:Fin n→SSet) : A := by + letI : Module ℤ (∀i,((X i).homology Z 1 : A)) := Pi.module _ _ ℤ + exact ModuleCat.of ℤ (∀i,((X i).homology Z 1 : A)) +noncomputable def homologyProj (n:ℕ) (X:Fin n→SSet) : + (obj X).homology Z 1 ⟶ homologyPi X := by + letI : Module ℤ (∀i,((X i).homology Z 1 : A)) := Pi.module _ _ ℤ + exact ModuleCat.ofHom (LinearMap.pi (fun i=>(SSet.homologyMap (proj X i) Z 1).hom)) +lemma homologyProj_isIso (n:ℕ) (X:Fin n→SSet) (hX:∀i,(X i).IsConnected) : IsIso (homologyProj n X) := by + classical + apply (ConcreteCategory.isIso_iff_bijective _).mpr + constructor + · intro a b h + apply homology_ext n X hX a b + intro i + exact congrFun h i + · let x : ∀i,(X i).obj (op ⦋0⦌) := fun i=>by + haveI:=hX i + exact Classical.arbitrary _ + intro a + refine ⟨∑ i:Fin n,SSet.homologyMap (incl X x i) Z 1 (a i),?_⟩ + funext j + change SSet.homologyMap (proj X j) Z 1 (∑ i:Fin n,SSet.homologyMap (incl X x i) Z 1 (a i))=a j + rw [map_sum] + rw [Finset.sum_eq_single j] + · simp only [←ModuleCat.comp_apply,←SSet.homologyMap_comp,incl_self,SSet.homologyMap_id,ModuleCat.id_apply] + · intro i hi hij + rw [←ModuleCat.comp_apply,←SSet.homologyMap_comp,incl_other X x hij, + ConnectedProduct.const_homology_zero _ 1 (by decide)] + rfl + · simp +end PiSSet + +end + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits MonoidalCategory Simplicial Opposite +namespace ComponentTranslation +open FreeChains + +variable {C:Type} [Groupoid.{0} C] [MonoidalCategory C] [SymmetricCategory C] +abbrev P (C:Type) [Category.{0} C] := Skeleton C +noncomputable def repr (p:P C) : C := (fromSkeleton C).obj p +omit [MonoidalCategory C] [SymmetricCategory C] in +@[simp] lemma repr_component (p:P C) : toSkeleton (repr p)=p := toSkeleton_fromSkeleton_obj p +abbrev property (p:P C) : ObjectProperty C := fun U=>toSkeleton U=p +abbrev Fiber (p:P C) := (property p).FullSubcategory +noncomputable def reprMul (r s:P C) : repr r ⊗ repr s ≅ repr (r*s) := + Skeleton.isoOfEq (by simp [Skeleton.toSkeleton_tensorObj]) +noncomputable def reprOne : repr (1:P C) ≅ 𝟙_ C := + Skeleton.isoOfEq (by simp [Skeleton.one_eq]) +noncomputable def translate (r p q:P C) (h:r*p=q) : Fiber p ⥤ Fiber q := + (property q).lift ((property p).ι ⋙ tensorLeft (repr r)) (fun U=>by + change toSkeleton (repr r ⊗ U.obj)=q + rw [Skeleton.toSkeleton_tensorObj,repr_component,U.property,h]) +noncomputable def translateOne (p:P C) (h:(1:P C)*p=p) : translate 1 p p h ⟶ 𝟭 (Fiber p) := by + let α : tensorLeft (repr (1:P C)) ⟶ 𝟭 C := + (tensoringLeft C).map (reprOne (C:=C)).hom ≫ (leftUnitorNatIso C).hom + exact { app U := ObjectProperty.homMk (α.app U.obj) + naturality U V f := by apply ObjectProperty.hom_ext; exact α.naturality f.hom } +noncomputable def translateComp {p q t:P C} (r s:P C) (h:r*p=q) (k:s*q=t) + (l:(s*r)*p=t) : translate (s*r) p t l ⟶ translate r p q h ⋙ translate s q t k := by + let α : tensorLeft (repr (s*r)) ⟶ tensorLeft (repr r) ⋙ tensorLeft (repr s) := + (tensoringLeft C).map (reprMul s r).inv ≫ (tensorLeftTensor (repr s) (repr r)).hom + exact { app U := ObjectProperty.homMk (α.app U.obj) + naturality U V f := by apply ObjectProperty.hom_ext; exact α.naturality f.hom } +omit [SymmetricCategory C] in +lemma homology_one (p:P C) (h:(1:P C)*p=p) (j:ℕ) : + SSet.homologyMap (nerveMap (translate 1 p p h)) Z j=𝟙 _ := by + have h:=(NerveHomotopy.ofNatTrans (translateOne p h)).congr_homologyMap Z j + change SSet.homologyMap (nerveMap (translate 1 p p _)) Z j=SSet.homologyMap (𝟙 _) Z j at h + simpa only [SSet.homologyMap_id] using h +omit [SymmetricCategory C] in +lemma homology_comp {p q t:P C} (r s:P C) (h:r*p=q) (k:s*q=t) (l:(s*r)*p=t) (j:ℕ) : + SSet.homologyMap (nerveMap (translate (s*r) p t l)) Z j = + SSet.homologyMap (nerveMap (translate r p q h)) Z j ≫ + SSet.homologyMap (nerveMap (translate s q t k)) Z j := by + have hh:=(NerveHomotopy.ofNatTrans (translateComp r s h k l)).congr_homologyMap Z j + change SSet.homologyMap (nerveMap (translate (s*r) p t l)) Z j = + SSet.homologyMap (nerveMap (translate r p q h) ≫ nerveMap (translate s q t k)) Z j at hh + simpa only [SSet.homologyMap_comp] using hh +noncomputable def homologyDiagram (j:ℕ) : ActionCategory (P C) (P C) ⥤ A where + obj p := (nerve (Fiber p.back)).homology Z j + map {p q} f := SSet.homologyMap (nerveMap (translate f.hom p.back q.back f.map_val)) Z j + map_id p := homology_one p.back _ j + map_comp f g := homology_comp (f.hom:P C) (g.hom:P C) f.map_val g.map_val _ j +end ComponentTranslation + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/PointFiberHomology.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/PointFiberHomology.lean new file mode 100644 index 0000000000000000000000000000000000000000..9cc46fbb49e1c8a392c23cfe6c35927811df05cb --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/PointFiberHomology.lean @@ -0,0 +1,172 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.StageHomologyCoordinates +import OAI.GroupTheory.SimpleAmenable.Configurations.FiberAddition +import OAI.GroupTheory.SimpleAmenable.Configurations.CellFiber + +namespace OAI + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits MonoidalCategory +namespace SimpleAmenable.PolygonObject.LabelledStage +open IntervalBar.Diagram BarFinitePower FreeChains + +variable {a n : ℕ} {K : Type} [AddCommGroup K] +variable {modK : Module ℤ K} +noncomputable def pointValue (c : GenericSquare a × ReducedLabel n) : + Coefficients a n K →ₗ[ℤ] K where + toFun f := (f c.2).val c.1 + map_add' _ _ := rfl + map_smul' r f := by + let h : Coefficients a n K →+ K := { + toFun f := (f c.2).val c.1 + map_zero' := rfl + map_add' _ _ := rfl } + exact map_intCast_smul h ℤ ℤ r f +namespace Stage +variable (S : Stage a n) +lemma homologyCoefficientIso_stage (j : ℕ) (hj : 0 hc + ((S.label_range c.2).mp ⟨k,Subtype.ext hk⟩))).hom j, + bar₃Map_comp,SSet.homologyMap_comp] + have hz := bar₃_acyclic (C:=FiniteSetGroupoid.Terminal) + (fun x y => ⟨eqToHom (Subsingleton.elim x y)⟩) j hj + rw [hz.eq_of_src (SSet.homologyMap (bar₃Map FiniteSetGroupoid.emptyFunctor) Z j) 0,comp_zero] + apply ModuleCat.hom_ext; apply LinearMap.ext; intro x + change (S.realize (K:=Stage.K j) (S.homologyCoordinates j x) c.2).val c.1 = 0 + erw [S.realize_outside _ _ hc] + rfl +end Stage +end SimpleAmenable.PolygonObject.LabelledStage + +end + +namespace SimpleAmenable.PolygonObject.Labelled.Cell +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Classical + +variable {a n : ℕ} {K : Type} [AddCommGroup K] +noncomputable def step (P : polygonAlgebra a) (x : K) : BooleanStep a K := + ⟨fun p => if p∈P.val then x else 0,by + obtain ⟨S,hS⟩ := polygon_hasSquareArrangement P.property + refine ⟨S,fun p q h => ?_⟩ + have hh := decide_eq_decide.mp (hS p q h) + simp only [hh]⟩ +@[simp] lemma step_apply (P : polygonAlgebra a) (x : K) (p : GenericSquare a) : + (step P x).val p=if p∈P.val then x else 0 := rfl +@[simp] lemma step_zero (P : polygonAlgebra a) : step P (0:K)=0 := by + apply Subtype.ext; funext p; simp [step] +@[simp] lemma step_add (P : polygonAlgebra a) (x y : K) : step P (x+y)=step P x+step P y := by + apply Subtype.ext; funext p + change (if p∈P.val then x+y else 0) = + (if p∈P.val then x else 0)+(if p∈P.val then y else 0) + split_ifs <;> simp +variable {modK : Module ℤ K} +noncomputable def coefficient (P : polygonAlgebra a) (l : LabelledStage.ReducedLabel n) : + K →ₗ[ℤ] LabelledStage.Coefficients a n K where + toFun x := Finsupp.single l (step P x) + map_add' _ _ := by rw [step_add,Finsupp.single_add] + map_smul' r x := by + let h : K →+ LabelledStage.Coefficients a n K := { + toFun x := Finsupp.single l (step P x) + map_zero' := by rw [step_zero,Finsupp.single_zero] + map_add' _ _ := by rw [step_add,Finsupp.single_add] } + exact map_intCast_smul h ℤ ℤ r x +@[simp] lemma coefficient_apply (P : polygonAlgebra a) (l : LabelledStage.ReducedLabel n) (x : K) : + coefficient (K:=K) (modK:=modK) P l x=Finsupp.single l (step P x) := rfl + +lemma coefficient_ext {T : Type} [AddCommGroup T] {f g : LabelledStage.Coefficients a n K →+ T} + (h : ∀P l x,f (Finsupp.single l (step P x))=g (Finsupp.single l (step P x))) : f=g := by + apply AddMonoidHom.ext; intro v + induction v using Finsupp.induction with + | zero => simp only [map_zero] + | @single_add l s v hl hs ih => + rw [map_add,map_add,ih] + congr 1 + obtain ⟨Q,hQ⟩ := BooleanStep.exists_common (fun _ : Unit => s) + have hsQ := hQ () + have he : s = ∑i:Fin Q.size,step ⟨_,Q.polygon i⟩ ((s.val) (Q.point i)) := by + apply Subtype.ext; funext p + have hv := congrArg (fun w : BooleanStep a K => w.val p) hsQ + change (BooleanStep.inflate (K:=K) Q (BooleanStep.evaluate (K:=K) Q s)).val p=s.val p at hv + rw [BooleanStep.inflate_apply,BooleanStep.evaluate_apply] at hv + rw [←hv] + rw [Submodule.coe_sum,Finset.sum_apply] + simp only [step,Set.mem_ofPred_eq] + rw [Finset.sum_eq_single (Q.color p)] + · simp + · intro index _ hindex + simp [Ne.symm hindex] + · simp + rw [he,Finsupp.single_finsetSum,map_sum,map_sum] + apply Finset.sum_congr rfl; intro i _; exact h _ _ _ +end + +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits MonoidalCategory Classical +open IntervalBar.Diagram BarFinitePower FreeChains LabelledStage + +variable {a n : ℕ} (P : polygonAlgebra a) (l : ReducedLabel n) +lemma homology_point (j : ℕ) (hj : 0 h ⟨hh.1,Subtype.ext hh.2⟩)).hom j, + bar₃Map_comp,SSet.homologyMap_comp] + have hz := bar₃_acyclic (C:=FiniteSetGroupoid.Terminal) + (fun x y => ⟨eqToHom (Subsingleton.elim x y)⟩) j hj + rw [hz.eq_of_src (SSet.homologyMap (bar₃Map FiniteSetGroupoid.emptyFunctor) Z j) 0,comp_zero] +lemma homology_coefficient (j : ℕ) (hj : 0 f x) + (congrArg (fun f => SSet.homologyMap (bar₃Map (functor P l)) Z j ≫ f) + (Stage.homologyCoefficientIso_point (a:=a) (n:=n) j hj hj5 (p,k))) + rw [←SSet.homologyMap_comp,←bar₃Map_comp,homology_point P l j hj (p,k)] at h + change _ = (Finsupp.single l (step P x) k).val p + refine h.trans ?_ + by_cases hl:l=k + · subst k + simp only [and_true,Finsupp.single_eq_same,step_apply] + split_ifs <;> rfl + · simp only [hl,and_false,ite_false,Finsupp.single_eq_of_ne (Ne.symm hl)] + rfl +end SimpleAmenable.PolygonObject.Labelled.Cell + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/PolygonCoefficientFinite.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/PolygonCoefficientFinite.lean new file mode 100644 index 0000000000000000000000000000000000000000..63eb5c07d6f6e6b1417f2902ad1a99b42ddf20df --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/PolygonCoefficientFinite.lean @@ -0,0 +1,159 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.PlaneCornerCoordinates + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section PolygonCoefficientFinite +open Classical + +noncomputable def planeCornerLinear {a : ℕ} (ha : 0 simp [planeVertexPosition,sub_eq_add_neg] <;> ring + +noncomputable def planeCornerEmbedding {a : ℕ} (ha : 0 ?_⟩ + let F := forget₂ (FGModuleCat.{nr} R) (ModuleCat.{nr} R) + have hi : Epi (F.map e) := inferInstance + have hp : Projective (F.obj M) := ModuleCat.projective_of_free (Module.Free.chooseBasis R M) + obtain ⟨g,hg⟩ := Projective.factors (F.map f) (F.map e) + refine ⟨FGModuleCat.ofHom g.hom, ?_⟩ + apply F.map_injective + exact hg + +theorem finitePresentation (M : FGModuleCat.{nr} R) : Nonempty (ProjectivePresentation M) := by + obtain ⟨n,f,hf⟩ := Module.Finite.exists_fin' R M + have hp : Projective (FGModuleCat.of R (Fin n → R)) := fg_projective_of_free _ + have he : Epi (FGModuleCat.ofHom f) := by + apply ConcreteCategory.epi_of_surjective + exact hf + exact ⟨⟨FGModuleCat.of R (Fin n → R),FGModuleCat.ofHom f⟩⟩ + +noncomputable local instance : EnoughProjectives (FGModuleCat.{nr} R) where + presentation := finitePresentation + +omit [IsNoetherianRing R] in +theorem forget_projective (M : FGModuleCat.{nr} R) [Projective M] : Projective M.obj := by + obtain ⟨n,f,hf⟩ := Module.Finite.exists_fin' R M + let q : FGModuleCat.of R (Fin n → R) ⟶ M := FGModuleCat.ofHom f + have he : Epi q := ConcreteCategory.epi_of_surjective q hf + obtain ⟨s,hs⟩ := Projective.factors (𝟙 M) q + have hlin : f.comp s.hom.hom = LinearMap.id := by + exact congrArg (fun g => g.hom.hom) hs + have hp : Module.Projective R M := + Module.Projective.of_split s.hom.hom f hlin + exact ModuleCat.projective_of_categoryTheory_projective M.obj + +noncomputable local instance : + (forget₂ (FGModuleCat.{nr} R) (ModuleCat.{nr} R)).PreservesProjectiveObjects where + projective_obj {X} h := by + let := h + exact forget_projective X + +noncomputable def resolution (M : FGModuleCat.{nr} R) : ProjectiveResolution M.obj := + (forget₂ (FGModuleCat.{nr} R) (ModuleCat.{nr} R)).mapProjectiveResolution + (ProjectiveResolution.of M) + +instance finite_resolution (M : FGModuleCat.{nr} R) (n : ℕ) : + Module.Finite R ((resolution M).complex.X n) := + inferInstanceAs (Module.Finite R ((ProjectiveResolution.of M).complex.X n)) + +theorem finite_short_homology (S : ShortComplex (ModuleCat.{nr} R)) + [Module.Finite R S.X₂] : Module.Finite R S.homology := by + have : Module.Finite R (LinearMap.ker S.g.hom) := + Module.Finite.of_injective (LinearMap.ker S.g.hom).subtype Subtype.val_injective + have : Module.Finite R S.moduleCatLeftHomologyData.H := by + exact Module.Finite.of_surjective (LinearMap.range S.moduleCatToCycles).mkQ + (LinearMap.range S.moduleCatToCycles).mkQ_surjective + exact Module.Finite.of_surjective S.moduleCatHomologyIso.inv.hom + S.moduleCatHomologyIso.toLinearEquiv.symm.surjective + +theorem finite_homology (C : ChainComplex (ModuleCat.{nr} R) ℕ) (n : ℕ) + [Module.Finite R (C.X n)] : Module.Finite R (C.homology n) := by + have : Module.Finite R (C.sc n).X₂ := ‹Module.Finite R (C.X n)› + exact finite_short_homology (C.sc n) + +end NoetherianResolution +end NoetherianResolution + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/PolygonHomologyAction.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/PolygonHomologyAction.lean new file mode 100644 index 0000000000000000000000000000000000000000..a7f5f8d133b805ea8067c368b3af6d29974cac4d --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/PolygonHomologyAction.lean @@ -0,0 +1,95 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Configurations.PolygonAlternatingStabilization + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section PolygonHomologyAction + +open Classical Set +namespace PolygonTracks +variable {a k n : ℕ} + +theorem stabilize_fix_outside (g : polygonFullGroup a n) (x : TrackPoint a (k+n)) + (hx : x∉Set.range (rightIncl a k n)) : (stabilize a k n g).val x=x := by + obtain ⟨y,rfl⟩ := (join a k n).surjective x + cases y with + | inl y => exact stabilize_left g y + | inr y => exact False.elim (hx ⟨y,rfl⟩) + +theorem conjugate_stabilize_eq (f c : polygonFullGroup a (k+n)) + (hc : ∀x : TrackPoint a n,c.val (rightIncl a k n x)=f.val (rightIncl a k n x)) + (g : polygonFullGroup a n) : + f*stabilize a k n g*f⁻¹=c*stabilize a k n g*c⁻¹ := by + apply Subtype.ext + apply Equiv.ext + intro y + obtain ⟨x,rfl⟩ := f.val.surjective y + change f.val ((stabilize a k n g).val (f.val.symm (f.val x)))= + c.val ((stabilize a k n g).val (c.val.symm (f.val x))) + rw [f.val.symm_apply_apply] + by_cases hx : x∈Set.range (rightIncl a k n) + · obtain ⟨z,rfl⟩ := hx + rw [←hc z,c.val.symm_apply_apply] + change f.val ((stabilize a k n g).val (z.1.natAdd k,z.2))= + c.val ((stabilize a k n g).val (z.1.natAdd k,z.2)) + rw [stabilize_right] + exact (hc (g.val z)).symm + · have hz : c.val.symm (f.val x)∉Set.range (rightIncl a k n) := by + rintro ⟨z,hz⟩ + have hg : f.val (rightIncl a k n z)=f.val x := by + rw [←hc z,hz,c.val.apply_symm_apply] + exact hx ⟨z,f.val.injective hg⟩ + rw [stabilize_fix_outside g x hx,stabilize_fix_outside g _ hz,c.val.apply_symm_apply] + +noncomputable def fullConjugation (a m : ℕ) (f : polygonFullGroup a m) : + polygonAlternatingGroup a m →* polygonAlternatingGroup a m := + (MulAut.conj f).toMonoidHom.restrict (fun g hg => + (polygonAlternatingGroup_normal a m).conj_mem g hg f) + +@[simp] theorem fullConjugation_val (f : polygonFullGroup a (k+n)) + (g : polygonAlternatingGroup a (k+n)) : + (fullConjugation a (k+n) f g).val=f*g.val*f⁻¹ := rfl + +theorem conjugation_stabilize_inner (f : polygonFullGroup a (k+n)) (hm : 6*n+7 TrivialHomology.map (successorStabilize a n) j) + +lemma successor_H1_isIso (a n : ℕ) (hn : 32 ≤ n) : + IsIso (TrivialHomology.map (successorStabilize a n) 1) := by + unfold successorStabilize + rw [TrivialHomology.map_comp] + have := PolygonPlacement.Configuration.stabilize_H1_isIso a n hn + have := TrivialHomology.isIso_equiv (castFull a (Nat.add_comm 1 n)) 1 + infer_instance + +lemma successor_H2_isIso (a n : ℕ) (hn : 34 ≤ n) : + IsIso (TrivialHomology.map (successorStabilize a n) 2) := by + unfold successorStabilize + rw [TrivialHomology.map_comp] + have := PolygonPlacement.Configuration.stabilize_H2_isIso a n hn + have := TrivialHomology.isIso_equiv (castFull a (Nat.add_comm 1 n)) 2 + infer_instance +lemma fullH1_eventuallyConstant (a : ℕ) : + (fullHomologySequence a 1).IsEventuallyConstantFrom 32 := by + apply Functor.isEventuallyConstantFrom_of_succ + intro n hn + dsimp only [fullHomologySequence] + erw [Functor.ofSequence_map_homOfLE_succ] + exact successor_H1_isIso a n hn +lemma fullH2_eventuallyConstant (a : ℕ) : + (fullHomologySequence a 2).IsEventuallyConstantFrom 34 := by + apply Functor.isEventuallyConstantFrom_of_succ + intro n hn + dsimp only [fullHomologySequence] + erw [Functor.ofSequence_map_homOfLE_succ] + exact successor_H2_isIso a n hn + +lemma fullH1_colimit_ι_isIso (a m : ℕ) (hm : 32 ≤ m) : + IsIso (colimit.ι (fullHomologySequence a 1) m) := + (fullH1_eventuallyConstant a).isIso_ι_of_isColimit' + (colimit.isColimit _) m (homOfLE hm) + +lemma fullH2_colimit_ι_isIso (a m : ℕ) (hm : 34 ≤ m) : + IsIso (colimit.ι (fullHomologySequence a 2) m) := + (fullH2_eventuallyConstant a).isIso_ι_of_isColimit' + (colimit.isColimit _) m (homOfLE hm) +noncomputable def fullH1_colimitIso (a m : ℕ) (hm : 32 ≤ m) : + groupHomology (Rep.trivial ℤ (polygonFullGroup a m) ℤ) 1 ≅ + colimit (fullHomologySequence a 1) := by + haveI := fullH1_colimit_ι_isIso a m hm + let e := asIso (colimit.ι (fullHomologySequence a 1) m) + exact e +noncomputable def fullH2_colimitIso (a m : ℕ) (hm : 34 ≤ m) : + groupHomology (Rep.trivial ℤ (polygonFullGroup a m) ℤ) 2 ≅ + colimit (fullHomologySequence a 2) := by + haveI := fullH2_colimit_ι_isIso a m hm + let e := asIso (colimit.ι (fullHomologySequence a 2) m) + exact e +lemma finite_fullH1_iff_colimit (a m : ℕ) (hm : 32 ≤ m) : + Module.Finite ℤ (groupHomology (Rep.trivial ℤ (polygonFullGroup a m) ℤ) 1) ↔ + Module.Finite ℤ (colimit (fullHomologySequence a 1) : ModuleCat ℤ) := by + have h := FixedStageReturn.finite_stage_iff_colimit (fullHomologySequence a 1) 32 m + (fun n hn => by + dsimp only [fullHomologySequence] + erw [Functor.ofSequence_map_homOfLE_succ] + exact successor_H1_isIso a n hn) hm + exact h +lemma finite_fullH2_iff_colimit (a m : ℕ) (hm : 34 ≤ m) : + Module.Finite ℤ (groupHomology (Rep.trivial ℤ (polygonFullGroup a m) ℤ) 2) ↔ + Module.Finite ℤ (colimit (fullHomologySequence a 2) : ModuleCat ℤ) := by + have h := FixedStageReturn.finite_stage_iff_colimit (fullHomologySequence a 2) 34 m + (fun n hn => by + dsimp only [fullHomologySequence] + erw [Functor.ofSequence_map_homOfLE_succ] + exact successor_H2_isIso a n hn) hm + exact h +end SimpleAmenable.PolygonTracks + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/PowerEquivalence.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/PowerEquivalence.lean new file mode 100644 index 0000000000000000000000000000000000000000..15266a0174916842759df9bd304d467f713f6ceb --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/PowerEquivalence.lean @@ -0,0 +1,104 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.FilteredHomology + +namespace OAI + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory +namespace StageProductColimit + +variable {C D : Type} [Category.{0} C] [Category.{0} D] (κ ι : Type) +noncomputable instance (F : C ⥤ D) [F.Full] : (powerMap κ F).Full where + map_surjective f := ⟨fun i => F.preimage (f i),by funext i; exact F.map_preimage (f i)⟩ +noncomputable instance (F : C ⥤ D) [F.EssSurj] : (powerMap κ F).EssSurj where + mem_essImage X := ⟨fun i => F.objPreimage (X i),⟨{ + hom i := (F.objObjPreimageIso (X i)).hom + inv i := (F.objObjPreimageIso (X i)).inv + hom_inv_id := by funext i; exact Iso.hom_inv_id _ + inv_hom_id := by funext i; exact Iso.inv_hom_id _ }⟩⟩ +noncomputable instance (F : C ⥤ D) [F.IsEquivalence] : (powerMap κ F).IsEquivalence where + +def uncurry : (κ → ι → C) ⥤ (κ × ι → C) where + obj U i := U i.1 i.2 + map f i := f i.1 i.2 +def curry : (κ × ι → C) ⥤ (κ → ι → C) where + obj U i j := U (i,j) + map f i j := f (i,j) +noncomputable def curryEquiv : (κ → ι → C) ≌ (κ × ι → C) where + functor := uncurry κ ι + inverse := curry κ ι + unitIso := NatIso.ofComponents (fun _ => Iso.refl _) (by + intros + simp only [Iso.refl_hom] + erw [Category.id_comp, Category.comp_id] + rfl) + counitIso := NatIso.ofComponents (fun _ => Iso.refl _) (by + intros + simp only [Iso.refl_hom] + erw [Category.id_comp, Category.comp_id] + rfl) + functor_unitIso_comp := by + intro X + funext i + change 𝟙 (X i.1 i.2) ≫ 𝟙 (X i.1 i.2) = 𝟙 (X i.1 i.2) + exact Category.id_comp _ +instance : (uncurry (C:=C) κ ι).IsEquivalence := (curryEquiv κ ι).isEquivalence_functor +end StageProductColimit +namespace IntervalBar.Diagram +open StageProductColimit MonoidalCategory + +variable {C D : Type} [Groupoid.{0} C] [Groupoid.{0} D] + [MonoidalCategory C] [MonoidalCategory D] [SymmetricCategory C] [SymmetricCategory D] +noncomputable def eval₂ (m n:ℕ) : Diagram (Diagram C (Fin (n+1))) (Fin (m+1)) ⥤ + (Fin m × Fin n → C) := eval m ⋙ powerMap (Fin m) (eval n) ⋙ uncurry (Fin m) (Fin n) +noncomputable def eval₃ (l m n:ℕ) : Diagram (Diagram (Diagram C (Fin (n+1))) (Fin (m+1))) + (Fin (l+1)) ⥤ (Fin l × (Fin m × Fin n) → C) := + eval l ⋙ powerMap (Fin l) (eval₂ m n) ⋙ uncurry (Fin l) (Fin m × Fin n) +noncomputable instance (m n:ℕ) : (eval₂ (C:=C) m n).IsEquivalence := by + dsimp [eval₂]; infer_instance +noncomputable instance (l m n:ℕ) : (eval₃ (C:=C) l m n).IsEquivalence := by + dsimp [eval₃]; infer_instance +lemma eval₂_natural (F : C ⥤ D) [F.Braided] (m n:ℕ) : + map (I:=Fin (m+1)) (map (I:=Fin (n+1)) F) ⋙ eval₂ m n = + eval₂ m n ⋙ powerMap (Fin m × Fin n) F := rfl +lemma eval₃_natural (F : C ⥤ D) [F.Braided] (l m n:ℕ) : + map (I:=Fin (l+1)) (map (I:=Fin (m+1)) (map (I:=Fin (n+1)) F)) ⋙ eval₃ l m n = + eval₃ l m n ⋙ powerMap (Fin l × (Fin m × Fin n)) F := rfl +end IntervalBar.Diagram + +end + +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits +namespace ColimitTransfer + +universe u v w z +variable {J : Type u} [Category.{v} J] {C : Type w} [Category.{z} C] +noncomputable def ofIsos {F G : J ⥤ C} (s : Cocone F) (t : Cocone G) + (u : F ⟶ G) [IsIso u] (f : s.pt ⟶ t.pt) [IsIso f] + (comm : ∀j,s.ι.app j ≫ f=u.app j ≫ t.ι.app j) (ht : IsColimit t) : IsColimit s := by + let e := asIso u + have hnat (j:J) : (((Cocone.precompose e.inv).obj s).ι.app j) ≫ f=t.ι.app j := by + change ((inv u).app j ≫ s.ι.app j) ≫ f = _ + rw [Category.assoc,comm] + simp + exact (IsColimit.equivOfNatIsoOfIso e s t (Cocone.ext (asIso f) hnat)).symm ht +noncomputable abbrev H (q:ℕ) : Cat.{0,0} ⥤ ModuleCat ℤ := + nerveFunctor ⋙ SSet.homologyFunctor (ModuleCat.of ℤ ℤ) q +noncomputable def ofEquivalences {J : Type} [Category.{0} J] {F G : J ⥤ Cat.{0,0}} + (s : Cocone F) (t : Cocone G) (u : F ⟶ G) (f : s.pt ⟶ t.pt) + [∀j,(u.app j).toFunctor.IsEquivalence] [f.toFunctor.IsEquivalence] + (comm : ∀j,s.ι.app j ≫ f=u.app j ≫ t.ι.app j) (q:ℕ) + (ht : IsColimit ((H q).mapCocone t)) : IsColimit ((H q).mapCocone s) := by + haveI (j:J) : IsIso ((Functor.whiskerRight u (H q)).app j) := by + change IsIso (SSet.homologyMap (nerveMap (u.app j).toFunctor) (ModuleCat.of ℤ ℤ) q) + infer_instance + haveI : IsIso (Functor.whiskerRight u (H q)) := (NatTrans.isIso_iff_isIso_app _).mpr (fun _ => inferInstance) + haveI : IsIso ((H q).map f) := by + change IsIso (SSet.homologyMap (nerveMap f.toFunctor) (ModuleCat.of ℤ ℤ) q) + infer_instance + apply ofIsos ((H q).mapCocone s) ((H q).mapCocone t) (Functor.whiskerRight u (H q)) ((H q).map f) _ ht + intro j + exact (Functor.map_comp _ _ _).symm.trans ((congrArg (H q).map (comm j)).trans (Functor.map_comp _ _ _)) +end ColimitTransfer + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/ProductChains.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/ProductChains.lean new file mode 100644 index 0000000000000000000000000000000000000000..419d87059637cc56ddd6726fa6a500a9fee1ac88 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/ProductChains.lean @@ -0,0 +1,186 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.CoefficientUCT + +namespace OAI + +section + +section + +open CategoryTheory Limits MonoidalCategory SimplicialObject Simplicial Opposite AlgebraicTopology +open HomologicalComplex HomologicalComplex₂ +namespace ProductChains + +open FreeChains +lemma sum_f {K L : ChainComplex A ℕ} {ι : Type} (s : Finset ι) (f : ι → (K ⟶ L)) (q : ℕ) : + (∑ i∈s,f i).f q=∑ i∈s,(f i).f q := map_sum (HomologicalComplex.Hom.fAddMonoidHom q) f s +abbrev D := SimplexCategory × SimplexCategory +variable (X Y : SSet) +def product : Dᵒᵖ ⥤ Type where + obj a := X.obj (op a.unop.1) × Y.obj (op a.unop.2) + map f := ↾fun z => (X.map f.unop.1.op z.1,Y.map f.unop.2.op z.2) + map_id _ := by ext z <;> simp + map_comp f g := by ext z <;> simp + +noncomputable def twoFree : HomologicalComplex₂ A c c := + AlternatingFaceMapComplex.obj (EilenbergZilber.bisimplicial (product X Y ⋙ ModuleCat.free ℤ) ⋙ + alternatingFaceMapComplex A) + +noncomputable def freeIso : EilenbergZilber.twoComplex (product X Y) ≅ twoFree X Y := + (alternatingFaceMapComplex (ChainComplex A ℕ)).mapIso + (Functor.isoWhiskerRight + ((Functor.curry.mapIso (Functor.isoWhiskerLeft + (CategoryTheory.prodOpEquiv SimplexCategory (D:=SimplexCategory)).inverse + (Functor.isoWhiskerLeft (product X Y) FreeChains.naturalIso)))) + (alternatingFaceMapComplex A)) + +noncomputable def rowIso (p : ℕ) : + (TensorProductHomology.bicomplex (complex X) (complex Y)).X p ≅ (twoFree X Y).X p := by + refine HomologicalComplex.Hom.isoOfComponents + (fun q => Functor.Monoidal.μIso (ModuleCat.free ℤ) (X.obj (op ⦋p⦌)) (Y.obj (op ⦋q⦌))) ?_ + intro q q' h + obtain rfl : q=q'+1 := h.symm + change Functor.LaxMonoidal.μ (ModuleCat.free ℤ) (X.obj (op ⦋p⦌)) (Y.obj (op ⦋q'+1⦌)) ≫ + (AlternatingFaceMapComplex.obj ((EilenbergZilber.bisimplicial (product X Y ⋙ ModuleCat.free ℤ)).obj (op ⦋p⦌))).d (q'+1) q' = + (tensorLeft ((ModuleCat.free ℤ).obj (X.obj (op ⦋p⦌)))).map ((AlternatingFaceMapComplex.obj (Y ⋙ ModuleCat.free ℤ)).d (q'+1) q') ≫ + Functor.LaxMonoidal.μ (ModuleCat.free ℤ) (X.obj (op ⦋p⦌)) (Y.obj (op ⦋q'⦌)) + simp only [AlternatingFaceMapComplex.obj_d_eq, + Functor.map_sum,Functor.map_zsmul,Preadditive.sum_comp,Preadditive.zsmul_comp] + refine (Preadditive.comp_sum _ _ _).trans ?_ + apply Finset.sum_congr rfl + intro _ _ + refine (Preadditive.comp_zsmul _ _ _).trans ?_ + congr 1 + simp [EilenbergZilber.bisimplicial,product,SimplicialObject.δ] + rfl + +noncomputable def tensorIso : + TensorProductHomology.bicomplex (complex X) (complex Y) ≅ twoFree X Y := by + refine HomologicalComplex.Hom.isoOfComponents (rowIso X Y) ?_ + intro p p' h + obtain rfl : p=p'+1 := h.symm + apply HomologicalComplex.Hom.ext + funext q + change Functor.LaxMonoidal.μ (ModuleCat.free ℤ) (X.obj (op ⦋p'+1⦌)) (Y.obj (op ⦋q⦌)) ≫ + ((twoFree X Y).d (p'+1) p').f q = + (tensorRight ((ModuleCat.free ℤ).obj (Y.obj (op ⦋q⦌)))).map ((complex X).d (p'+1) p') ≫ + Functor.LaxMonoidal.μ (ModuleCat.free ℤ) (X.obj (op ⦋p'⦌)) (Y.obj (op ⦋q⦌)) + simp only [twoFree,complex,AlternatingFaceMapComplex.obj_d_eq, + sum_f,HomologicalComplex.zsmul_f_apply, + Functor.map_sum,Functor.map_zsmul,Preadditive.sum_comp,Preadditive.zsmul_comp] + refine (Preadditive.comp_sum _ _ _).trans ?_ + apply Finset.sum_congr rfl + intro _ _ + refine (Preadditive.comp_zsmul _ _ _).trans ?_ + congr 1 + simp [EilenbergZilber.bisimplicial,product,SimplicialObject.δ] + rfl + +noncomputable def homologyIso (n : ℕ) : + SSet.homology (EilenbergZilber.diag ⋙ product X Y) Z n ≅ + ((TensorProductHomology.bicomplex (complex X) (complex Y)).total c).homology n := + EilenbergZilber.homologyIso (product X Y) n ≪≫ + (homologyFunctor _ c n).mapIso + (total.mapIso (freeIso X Y ≪≫ (tensorIso X Y).symm) c) + +end ProductChains + +end + +section +open CategoryTheory Limits MonoidalCategory HomologicalComplex HomologicalComplex₂ +namespace ChainTensor +open FreeChains +attribute [local instance] preservesBinaryBiproducts_of_preservesBiproducts + +instance leftAdditive (K : ChainComplex A ℕ) : (tensorLeft K).Additive where + map_add {L M} f g := by + apply HomologicalComplex.Hom.ext + funext n + apply total.hom_ext + intro p q hpq + change ιMapBifunctor K L (curriedTensor A) c p q n hpq ≫ + (mapBifunctorMap (𝟙 K) (f+g) (curriedTensor A) c).f n = + ιMapBifunctor K L (curriedTensor A) c p q n hpq ≫ + ((mapBifunctorMap (𝟙 K) f (curriedTensor A) c).f n + (mapBifunctorMap (𝟙 K) g (curriedTensor A) c).f n) + simp [Preadditive.comp_add] +instance rightAdditive (K : ChainComplex A ℕ) : (tensorRight K).Additive where + map_add {L M} f g := by + apply HomologicalComplex.Hom.ext + funext n + apply total.hom_ext + intro p q hpq + change ιMapBifunctor L K (curriedTensor A) c p q n hpq ≫ + (mapBifunctorMap (f+g) (𝟙 K) (curriedTensor A) c).f n = + ιMapBifunctor L K (curriedTensor A) c p q n hpq ≫ + ((mapBifunctorMap f (𝟙 K) (curriedTensor A) c).f n + (mapBifunctorMap g (𝟙 K) (curriedTensor A) c).f n) + simp [Preadditive.comp_add] +noncomputable def leftDistrib (K L M : ChainComplex A ℕ) : + K ⊗ (L ⊞ M) ≅ (K ⊗ L) ⊞ (K ⊗ M) := (tensorLeft K).mapBiprod L M +noncomputable def rightDistrib (K L M : ChainComplex A ℕ) : + (K ⊞ L) ⊗ M ≅ (K ⊗ M) ⊞ (L ⊗ M) := (tensorRight M).mapBiprod K L +end ChainTensor + +end + +section +open CategoryTheory Limits MonoidalCategory HomologicalComplex +namespace AugmentedSplit +open FreeChains +attribute [local instance] preservesBinaryBiproducts_of_preservesBiproducts + +noncomputable abbrev U : ChainComplex A ℕ := 𝟙_ (ChainComplex A ℕ) +variable {K : ChainComplex A ℕ} (e : K ⟶ U) (s : U ⟶ K) (hs : s ≫ e=𝟙 U) +noncomputable abbrev red := kernel e +noncomputable def sc : ShortComplex (ChainComplex A ℕ) := + ShortComplex.mk (kernel.ι e) e (kernel.condition e) +noncomputable def splitting : (sc e).Splitting := + ShortComplex.Splitting.ofExactOfSection (sc e) + ((sc e).exact_of_f_is_kernel (kernelIsKernel e)) s hs (by dsimp [sc]; infer_instance) +noncomputable def iso : K ≅ red e ⊞ U := (splitting e s hs).isoBinaryBiproduct + +lemma flat [∀n,Module.Flat ℤ (K.X n)] (n : ℕ) : Module.Flat ℤ ((red e).X n) := by + have hf : Function.Injective ((kernel.ι e).f n) := + (ModuleCat.mono_iff_injective _).mp inferInstance + have : Module.IsTorsionFree ℤ ((red e).X n) := + hf.moduleIsTorsionFree _ (fun r x => ((kernel.ι e).f n).hom.map_smul r x) + infer_instance + +include s hs in +lemma finite (n : ℕ) [Module.Finite ℤ (K.homology n)] : + Module.Finite ℤ ((red e).homology n) := by + let i := homologyMap (kernel.ι e) n + let r := homologyMap (splitting e s hs).r n + have hi : Function.Injective i := by + apply Function.LeftInverse.injective (f:=i) (g:=r) + intro x + have h : i ≫ r = 𝟙 _ := by + change homologyMap (sc e).f n ≫ homologyMap (splitting e s hs).r n = _ + rw [←homologyMap_comp,(splitting e s hs).f_r,homologyMap_id] + rfl + exact congrArg (fun f => f x) h + exact Module.Finite.of_injective i.hom hi + +lemma uni_isZero (n : ℕ) (hn : n≠0) : IsZero (U.homology n) := by + apply ShortComplex.isZero_homology_of_isZero_X₂ + exact HomologicalComplex.isZero_single_obj_X c 0 _ n hn + +noncomputable def homologyIso (n : ℕ) (hn : n≠0) : K.homology n ≅ (red e).homology n := + (homologyFunctor A c n).mapIso (iso e s hs) ≪≫ + (homologyFunctor A c n).mapBiprod _ _ ≪≫ (isoBiprodZero (uni_isZero n hn)).symm + +include s hs in +lemma vanishing (a : ℕ) (h0 : IsZero ((red e).homology 0)) + (hK : ∀ i, 0 < i → i < a → IsZero (K.homology i)) : + ∀ i, i < a → IsZero ((red e).homology i) := by + intro i hi + by_cases h : i=0 + · simpa [h] using h0 + · exact IsZero.of_iso (hK i (by omega) hi) (homologyIso e s hs i h).symm +end AugmentedSplit + +end + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/ProductHomologyMaps.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/ProductHomologyMaps.lean new file mode 100644 index 0000000000000000000000000000000000000000..2784119c012d728130bcf82f3a9117c708fb8eb3 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/ProductHomologyMaps.lean @@ -0,0 +1,58 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.CanonicalProduct + +namespace OAI + +section + +section +open CategoryTheory Limits MonoidalCategory HomologicalComplex SimplicialObject Simplicial Opposite AlgebraicTopology +namespace ConnectedProduct +open FreeChains AugmentedSplit + +variable (X Y : SSet) (x : X.obj (op ⦋0⦌)) (y : Y.obj (op ⦋0⦌)) (n : ℕ) +lemma projection_inclusion (hn : n≠0) [IsIso (projection X Y n)] : + projection X Y n ≫ inclusion X Y x y n=𝟙 _ := by + apply (cancel_mono (projection X Y n)).mp + simp only [Category.assoc,inclusion_projection X Y x y n hn,Category.comp_id,Category.id_comp] +noncomputable def canonicalIso [IsIso (projection X Y n)] : + (X⊗Y).homology Z n ≅ X.homology Z n ⊞ Y.homology Z n := asIso (projection X Y n) +lemma homologyMap_eq (T : SSet) (f : X⊗Y ⟶ T) (hn : n≠0) + [IsIso (projection X Y n)] : + SSet.homologyMap f Z n = projection X Y n ≫ + biprod.desc (SSet.homologyMap (pairLeft X Y y ≫ f) Z n) + (SSet.homologyMap (pairRight X Y x ≫ f) Z n) := by + rw [SSet.homologyMap_comp,SSet.homologyMap_comp] + have hd : biprod.desc (SSet.homologyMap (pairLeft X Y y) Z n ≫ SSet.homologyMap f Z n) + (SSet.homologyMap (pairRight X Y x) Z n ≫ SSet.homologyMap f Z n) = + inclusion X Y x y n ≫ SSet.homologyMap f Z n := by + apply biprod.hom_ext' <;> simp [inclusion] + rw [hd] + rw [←Category.assoc,projection_inclusion X Y x y n hn,Category.id_comp] +lemma diagonal_homology_projection (f : X ⟶ X⊗X) + (h₁ : f ≫ CartesianMonoidalCategory.fst X X=𝟙 X) + (h₂ : f ≫ CartesianMonoidalCategory.snd X X=𝟙 X) : + SSet.homologyMap f Z n ≫ projection X X n=biprod.lift (𝟙 _) (𝟙 _) := by + apply biprod.hom_ext + · simp only [projection,Category.assoc,biprod.lift_fst,←SSet.homologyMap_comp,h₁,SSet.homologyMap_id] + · simp only [projection,Category.assoc,biprod.lift_snd,←SSet.homologyMap_comp,h₂,SSet.homologyMap_id] +lemma unit_product_homology (μ : X⊗X ⟶ X) + (hl : pairLeft X X x ≫ μ=𝟙 X) (hr : pairRight X X x ≫ μ=𝟙 X) + (hn : n≠0) [IsIso (projection X X n)] : + SSet.homologyMap μ Z n=projection X X n ≫ biprod.desc (𝟙 _) (𝟙 _) := by + rw [homologyMap_eq X X x x n X μ hn,hl,hr,SSet.homologyMap_id] +lemma product_naturality {X' Y' : SSet} (f : X ⟶ X') (g : Y ⟶ Y') : + SSet.homologyMap (f⊗ₘg) Z n ≫ projection X' Y' n= + projection X Y n ≫ biprod.map (SSet.homologyMap f Z n) (SSet.homologyMap g Z n) := by + apply biprod.hom_ext + · simp [projection,Category.assoc,← SSet.homologyMap_comp, + CartesianMonoidalCategory.tensorHom_fst] + · simp [projection,Category.assoc,← SSet.homologyMap_comp, + CartesianMonoidalCategory.tensorHom_snd] +end ConnectedProduct + +end + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/ProductNatural.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/ProductNatural.lean new file mode 100644 index 0000000000000000000000000000000000000000..e2c00312ed09cb13b371d18988235dafe899b0e7 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/ProductNatural.lean @@ -0,0 +1,172 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.EZNatural +import OAI.GroupTheory.SimpleAmenable.Homology.ProductChains + +namespace OAI + +section + +section +open CategoryTheory Limits MonoidalCategory HomologicalComplex HomologicalComplex₂ SimplicialObject Simplicial Opposite AlgebraicTopology +namespace ProductChains +open FreeChains + +variable {X Y X' Y':SSet} +def map (f:X⟶X') (g:Y⟶Y') : product X Y ⟶ product X' Y' where + app d := ↾fun z => (f.app (op d.unop.1) z.1,g.app (op d.unop.2) z.2) + naturality _ _ h := by ext z; exact Prod.ext (congrArg (fun k => k z.1) (f.naturality h.unop.1.op)) (congrArg (fun k => k z.2) (g.naturality h.unop.2.op)) +noncomputable def chainMap (f:X⟶X') : complex X ⟶ complex X' := + (alternatingFaceMapComplex A).map (Functor.whiskerRight f (ModuleCat.free ℤ)) +noncomputable def twoFreeMap (f:X⟶X') (g:Y⟶Y') : twoFree X Y ⟶ twoFree X' Y' := + (alternatingFaceMapComplex (ChainComplex A ℕ)).map + (Functor.whiskerRight (Functor.curry.map + (Functor.whiskerLeft (CategoryTheory.prodOpEquiv SimplexCategory (D:=SimplexCategory)).inverse + (Functor.whiskerRight (map f g) (ModuleCat.free ℤ)))) (alternatingFaceMapComplex A)) +@[reassoc] lemma free_natural (f:X⟶X') (g:Y⟶Y') : + EilenbergZilber.twoMap (map f g) ≫ (freeIso X' Y').hom = + (freeIso X Y).hom ≫ twoFreeMap f g := by + apply HomologicalComplex.Hom.ext; funext p + apply HomologicalComplex.Hom.ext; funext q + exact (FreeChains.naturalIso.hom.naturality ((map f g).app (op (SimplexCategory.mk p,SimplexCategory.mk q)))) +noncomputable def tensorBiMap (f:X⟶X') (g:Y⟶Y') : + TensorProductHomology.bicomplex (complex X) (complex Y) ⟶ + TensorProductHomology.bicomplex (complex X') (complex Y') := + (((curriedTensor A).mapBifunctorHomologicalComplex c c).map (chainMap f)).app (complex Y) ≫ + (((curriedTensor A).mapBifunctorHomologicalComplex c c).obj (complex X')).map (chainMap g) +@[reassoc] lemma tensor_natural (f:X⟶X') (g:Y⟶Y') : + tensorBiMap f g ≫ (tensorIso X' Y').hom = (tensorIso X Y).hom ≫ twoFreeMap f g := by + apply HomologicalComplex.Hom.ext; funext p + apply HomologicalComplex.Hom.ext; funext q + simp only [tensorBiMap,tensorIso,rowIso,twoFreeMap,HomologicalComplex.comp_f, + HomologicalComplex.Hom.isoOfComponents_hom_f] + change (((ModuleCat.free ℤ).map (f.app (op ⦋p⦌))) ▷ ((ModuleCat.free ℤ).obj (Y.obj (op ⦋q⦌))) ≫ + ((ModuleCat.free ℤ).obj (X'.obj (op ⦋p⦌))) ◁ ((ModuleCat.free ℤ).map (g.app (op ⦋q⦌)))) ≫ + Functor.LaxMonoidal.μ (ModuleCat.free ℤ) _ _ = + Functor.LaxMonoidal.μ (ModuleCat.free ℤ) _ _ ≫ + (ModuleCat.free ℤ).map (f.app (op ⦋p⦌) ⊗ₘ g.app (op ⦋q⦌)) + rw [←MonoidalCategory.tensorHom_def] + exact Functor.LaxMonoidal.μ_natural (ModuleCat.free ℤ) _ _ +noncomputable def homologyIsoN (X Y:SSet) (n:ℕ) : + (X⊗Y).homology Z n ≅ ((complex X⊗complex Y).homology n) := + EilenbergZilber.homologyIsoN (product X Y) n ≪≫ + (homologyFunctor A c n).mapIso (total.mapIso (freeIso X Y ≪≫ (tensorIso X Y).symm) c) +@[reassoc] lemma homology_natural (f:X⟶X') (g:Y⟶Y') (n:ℕ) : + SSet.homologyMap (f⊗ₘg) Z n ≫ (homologyIsoN X' Y' n).hom = + (homologyIsoN X Y n).hom ≫ homologyMap (chainMap f⊗ₘchainMap g) n := by + have ht : EilenbergZilber.twoMap (map f g) ≫ + (freeIso X' Y' ≪≫ (tensorIso X' Y').symm).hom = + (freeIso X Y ≪≫ (tensorIso X Y).symm).hom ≫ tensorBiMap f g := by + simp only [Iso.trans_hom,Iso.symm_hom] + rw [←Category.assoc,free_natural,Category.assoc] + apply (cancel_mono (tensorIso X' Y').hom).mp + simp only [Category.assoc,Iso.inv_hom_id,Category.comp_id] + rw [tensor_natural] + simp + have hh := EilenbergZilber.homology_natural (map f g) n + have ht' := congrArg (fun φ => homologyMap (total.map φ c) n) ht + simp only [total.map_comp,homologyMap_comp] at ht' + simp only [homologyIsoN] + + change homologyMap (EilenbergZilber.diagonalMap (map f g)) n ≫ + (EilenbergZilber.homologyIsoN (product X' Y') n).hom ≫ + homologyMap (total.map (freeIso X' Y' ≪≫ (tensorIso X' Y').symm).hom c) n = + (EilenbergZilber.homologyIsoN (product X Y) n).hom ≫ + homologyMap (total.map (freeIso X Y ≪≫ (tensorIso X Y).symm).hom c) n ≫ + homologyMap (total.map (tensorBiMap f g) c) n + rw [reassoc_of% hh,ht'] +end ProductChains + +end + +section +open CategoryTheory Limits MonoidalCategory HomologicalComplex +namespace TensorCoefficient + +variable {R:Type} [CommRing R] [IsDomain R] [IsPrincipalIdealRing R] + +lemma flatPresentation (A:ModuleCat.{0} R) : + ∃S:ShortComplex (ModuleCat.{0} R),S.X₃=A ∧ S.ShortExact ∧ + Module.Flat R S.X₁ ∧ Module.Flat R S.X₂ := by + let φ : (A→₀R) →ₗ[R] A := Finsupp.linearCombination R (fun x:A => x) + have hφ : Function.Surjective φ := by + intro x; exact ⟨Finsupp.single x 1,by simp [φ]⟩ + let B : ModuleCat R := ModuleCat.of R (A→₀R) + let C : ModuleCat R := ModuleCat.of R φ.ker + let i : C ⟶ B := ModuleCat.ofHom φ.ker.subtype + let p : B ⟶ A := ModuleCat.ofHom φ + have hi : Mono i := (ModuleCat.mono_iff_injective _).mpr Subtype.val_injective + have hp : Epi p := (ModuleCat.epi_iff_surjective _).mpr hφ + have hz : i≫p=0 := by + apply ModuleCat.hom_ext; apply LinearMap.ext; intro x; exact x.property + let S : ShortComplex (ModuleCat R) := ShortComplex.mk i p hz + have he : S.ShortExact := { + mono_f := hi + epi_g := hp + exact := (S.moduleCat_exact_iff).mpr (by intro x hx; exact ⟨⟨x,hx⟩,rfl⟩) } + exact ⟨S,rfl,he,inferInstance,inferInstance⟩ +variable (K:ChainComplex (ModuleCat.{0} R) ℕ) +omit [IsDomain R] [IsPrincipalIdealRing R] in +lemma flat_isZero (A:ModuleCat.{0} R) [Module.Flat R A] (n:ℕ) + (h:IsZero (K.homology n)) : IsZero ((homologyFunctor K n).obj A) := by + exact IsZero.of_iso (Functor.map_isZero (tensorRight A) h) + ((K.sc n).mapHomologyIso (tensorRight A)) +variable [∀n,Module.Flat R (K.X n)] +lemma arbitrary_zero_succ (A:ModuleCat.{0} R) (n:ℕ) + (h0:IsZero (K.homology n)) (h1:IsZero (K.homology (n+1))) : + IsZero ((homologyFunctor K (n+1)).obj A) := by + obtain ⟨S,hA,hS,h1f,h2f⟩ := flatPresentation A + have := h1f; have := h2f + rw [←hA] + exact ((shortExact K hS).homology_exact₃ (n+1) n rfl).isZero_X₂ + ((flat_isZero K S.X₂ (n+1) h1).eq_of_src _ _) + ((flat_isZero K S.X₁ n h0).eq_of_tgt _ _) +lemma arbitrary_zero_zero (A:ModuleCat.{0} R) (h:IsZero (K.homology 0)) : + IsZero ((homologyFunctor K 0).obj A) := by + obtain ⟨S,hA,hS,h1f,h2f⟩ := flatPresentation A + have := h1f; have := h2f + rw [←hA] + have hs := shortExact K hS + have := hs.epi_g + have homology_epi : Epi (homologyMap (S.map (functor K)).g 0) := + epi_homologyMap_of_epi_of_not_rel _ 0 (by intro _; simp [ComplexShape.down_Rel]) + exact @IsZero.of_epi _ _ _ _ _ (homologyMap (S.map (functor K)).g 0) + homology_epi (flat_isZero K S.X₂ 0 h) +end TensorCoefficient + +end + +section +open CategoryTheory Limits MonoidalCategory HomologicalComplex HomologicalComplex₂ +namespace TensorProductHomology + +variable {R:Type} [CommRing R] [IsDomain R] [IsPrincipalIdealRing R] +lemma arbitrary_isZero (K L:ChainComplex (ModuleCat.{0} R) ℕ) + [∀n,Module.Flat R (K.X n)] (a b n:ℕ) (hn:n exact TensorCoefficient.arbitrary_zero_zero K _ (hK 0 (by omega)) + | succ p => exact TensorCoefficient.arbitrary_zero_succ K _ p (hK p (by omega)) (hK (p+1) (by omega)) +end TensorProductHomology +namespace ChainTensor +open FreeChains + +instance monoidalPreadditive : MonoidalPreadditive (ChainComplex A ℕ) where + whiskerLeft_zero := fun {K L M} => (tensorLeft K).map_zero L M + zero_whiskerRight := fun {K L M} => (tensorRight K).map_zero L M + whiskerLeft_add := fun {K _ _} f g => (tensorLeft K).map_add (f:=f) (g:=g) + add_whiskerRight := fun {K _ _} f g => (tensorRight K).map_add (f:=f) (g:=g) +end ChainTensor + +end + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/QuotientRegular.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/QuotientRegular.lean new file mode 100644 index 0000000000000000000000000000000000000000..670e6f82f0c4d8edad7e1a984a6bc6a8b6c0378f --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/QuotientRegular.lean @@ -0,0 +1,234 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.FullGroupStability + +namespace OAI + +section + +section + +open Classical CategoryTheory CategoryTheory.Limits Representation Rep Finsupp +open SimpleAmenable +namespace QuotientRegular + +attribute [local instance 1200] Rep.hV2 +variable {G Q : Type} [Group G] [Group Q] (f : G →* Q) + +noncomputable abbrev regular : Rep ℤ G := + Rep.res f (Rep.of (Representation.leftRegular ℤ Q)) + +noncomputable def point : Rep.trivial ℤ f.ker ℤ ⟶ Rep.res f.ker.subtype (regular f) := + Rep.ofHom ⟨(MonoidAlgebra.coeffLinearEquiv ℤ).symm.toLinearMap.comp (Finsupp.lsingle (1:Q)),by + intro g + apply LinearMap.ext + intro z + change MonoidAlgebra.single (1:Q) z=Representation.leftRegular ℤ Q (f g.val) (MonoidAlgebra.single (1:Q) z) + rw [g.property] + simp⟩ + +noncomputable def kernelEquivStabilizer : + letI : MulAction G Q := MulAction.compHom Q f + f.ker ≃* MulAction.stabilizer G (1:Q) := by + letI : MulAction G Q := MulAction.compHom Q f + exact MulEquiv.subgroupCongr (by + ext g + change f g=1 ↔ f g*1=1 + simp) + +noncomputable def permutationIso : + letI : MulAction G Q := MulAction.compHom Q f + regular f ≅ Rep.of (TransitiveInduction.permutationRep (G:=G) (X:=Q)) := by + letI : MulAction G Q := MulAction.compHom Q f + refine Rep.mkIso (.mk (MonoidAlgebra.coeffLinearEquiv ℤ) ?_) + intro g + apply MonoidAlgebra.lhom_ext' + intro x + apply LinearMap.ext + intro z + simp [TransitiveInduction.permutationRep] + rfl + +lemma isIso_point (hf : Function.Surjective f) (n : ℕ) : + IsIso (groupHomology.map f.ker.subtype (point f) n) := by + let : MulAction G Q := MulAction.compHom Q f + have ht : ∀q:Q,∃g:G,g • (1:Q)=q := by + intro q + obtain ⟨g,rfl⟩ := hf q + exact ⟨g,mul_one _⟩ + have he : groupHomology.map f.ker.subtype (point f) n ≫ + groupHomology.map (MonoidHom.id G) (permutationIso f).hom n = + TrivialHomology.map (kernelEquivStabilizer f).toMonoidHom n ≫ + groupHomology.map (MulAction.stabilizer G (1:Q)).subtype + (TransitiveInduction.pointMap (1:Q)) n := by + rw [← groupHomology.map_comp, ← groupHomology.map_comp] + apply groupHomology.map_congr + · ext g; rfl + · apply LinearMap.ext; intro z; simp [point,permutationIso,TransitiveInduction.pointMap,TransitiveInduction.trivialMap] + have := TrivialHomology.isIso_equiv (kernelEquivStabilizer f) n + have := TransitiveInduction.isIso_map_pointMap (G:=G) (1:Q) ht n + have : IsIso (groupHomology.map f.ker.subtype (point f) n ≫ + groupHomology.map (B:=Rep.of (TransitiveInduction.permutationRep (G:=G) (X:=Q))) + (MonoidHom.id G) (permutationIso f).hom n) := by + rw [he] + infer_instance + have : IsIso (groupHomology.map + (B:=Rep.of (TransitiveInduction.permutationRep (G:=G) (X:=Q))) + (MonoidHom.id G) (permutationIso f).hom n) := + inferInstanceAs (IsIso ((groupHomology.functor ℤ G n).mapIso (permutationIso f)).hom) + exact IsIso.of_isIso_comp_right _ + (groupHomology.map (B:=Rep.of (TransitiveInduction.permutationRep (G:=G) (X:=Q))) + (MonoidHom.id G) (permutationIso f).hom n) + +noncomputable def right (q : Q) : regular f ⟶ regular f := + Rep.ofHom ⟨MonoidAlgebra.mapDomainLinearMap ℤ ℤ (·*q),by + intro g + apply MonoidAlgebra.lhom_ext' + intro x + apply LinearMap.ext + intro z + simp [Representation.leftRegular, mul_assoc]⟩ + +@[simp] lemma right_single (q x : Q) (z : ℤ) : + (right f q).hom (MonoidAlgebra.single x z)=MonoidAlgebra.single (x*q) z := by + simp [right] + +noncomputable def conjugate (g : G) : f.ker ≃* f.ker := + (MulAut.conjNormal g : f.ker ≃* f.ker) + +lemma right_homology_identity (hf : Function.Surjective f) (n : ℕ) + (hact : ∀g:G,TrivialHomology.map (conjugate f g).toMonoidHom n=𝟙 _) (q : Q) : + (groupHomology.functor ℤ G n).map (right f q)=𝟙 _ := by + obtain ⟨g,rfl⟩ := hf q + have := isIso_point f hf n + apply (cancel_epi (groupHomology.map f.ker.subtype (point f) n)).mp + change _ = groupHomology.map f.ker.subtype (point f) n ≫ 𝟙 (groupHomology (regular f) n) + rw [Category.comp_id] + have hc := HomologyConjugation.map_after_conjugation f.ker.subtype (point f) g n + have he : + groupHomology.map ((MulAut.conj g).toMonoidHom.comp f.ker.subtype) + (point f ≫ (Rep.resFunctor f.ker.subtype).map + (HomologyConjugation.conjugationCoeff g (regular f))) n = + TrivialHomology.map (conjugate f g).toMonoidHom n ≫ + groupHomology.map f.ker.subtype (point f) n ≫ + (groupHomology.functor ℤ G n).map (right f (f g)) := by + dsimp only [groupHomology.functor] + rw [← groupHomology.map_comp, ← groupHomology.map_comp] + apply groupHomology.map_congr + · ext h; rfl + · apply LinearMap.ext + intro z + simp [point,right,TransitiveInduction.trivialMap, + HomologyConjugation.conjugationCoeff,regular,Representation.ofMulAction_def] + rw [he,hact,Category.id_comp] at hc + exact hc + +lemma H1_isZero (hf : Function.Surjective f) + (hz : IsZero (groupHomology (Rep.trivial ℤ f.ker ℤ) 1)) : + IsZero (groupHomology (regular f) 1) := by + have := isIso_point f hf 1 + exact hz.of_iso (asIso (groupHomology.map f.ker.subtype (point f) 1)).symm + +lemma H2_finite_of_regular (hf : Function.Surjective f) + [Module.Finite ℤ (groupHomology (regular f) 2)] : + Module.Finite ℤ (groupHomology (Rep.trivial ℤ f.ker ℤ) 2) := by + have := isIso_point f hf 2 + exact Module.Finite.of_injective (groupHomology.map f.ker.subtype (point f) 2).hom + ((ModuleCat.mono_iff_injective _).mp inferInstance) + +end QuotientRegular + +end + +section + +open Classical CategoryTheory CategoryTheory.Limits Representation Finsupp +namespace FiniteFreeRep + +attribute [local instance 1200] Rep.hV2 +variable {k Q : Type} [CommRing k] [Group Q] + +noncomputable def incl (A : Rep.{0} k Q) {n : ℕ} (i : Fin n) : A ⟶ Rep.finsupp (Fin n) A := + Rep.ofHom ⟨Finsupp.lsingle i,by + intro g + apply LinearMap.ext + intro x + simp⟩ + +noncomputable def proj (A : Rep.{0} k Q) {n : ℕ} (i : Fin n) : Rep.finsupp (Fin n) A ⟶ A := + Rep.ofHom ⟨Finsupp.lapply i,by + intro g + apply Finsupp.lhom_ext + intro j x + by_cases h : i=j + · subst j; simp + · simp [h]⟩ + +lemma sum_proj_incl (A : Rep.{0} k Q) (n : ℕ) : + ∑ i:Fin n,proj A i ≫ incl A i=𝟙 (Rep.finsupp (Fin n) A) := by + apply Rep.hom_ext + apply Representation.IntertwiningMap.ext + apply Finsupp.lhom_ext + intro i x + simp [Rep.sum_hom, incl,proj,Representation.IntertwiningMap.sum_apply] + +lemma functor_isZero (F : Rep.{0} k Q ⥤ ModuleCat k) [F.Additive] + (A : Rep.{0} k Q) (h : IsZero (F.obj A)) (n : ℕ) : IsZero (F.obj (Rep.finsupp (Fin n) A)) := by + apply (IsZero.iff_id_eq_zero _).mpr + rw [← F.map_id, ← sum_proj_incl,F.map_sum] + apply Finset.sum_eq_zero + intro i hi + rw [F.map_comp,h.eq_zero_of_tgt (F.map (proj A i)),zero_comp] + +lemma functor_finite [IsNoetherianRing k] (F : Rep.{0} k Q ⥤ ModuleCat k) [F.Additive] + (A : Rep.{0} k Q) [Module.Finite k (F.obj A)] (n : ℕ) : + Module.Finite k (F.obj (Rep.finsupp (Fin n) A)) := by + let φ : F.obj (Rep.finsupp (Fin n) A) →ₗ[k] (Fin n → F.obj A) := + LinearMap.pi (fun i => (F.map (proj A i)).hom) + apply Module.Finite.of_injective φ + apply (LinearMap.ker_eq_bot).mp + rw [Submodule.eq_bot_iff] + intro x hx + have hp : ∀i:Fin n,(F.map (proj A i)).hom x=0 := fun i => congrFun hx i + have he : ∑ i:Fin n,(F.map (proj A i) ≫ F.map (incl A i))=𝟙 _ := by + simp only [← F.map_comp, ← F.map_sum,sum_proj_incl,F.map_id] + have ht := congrArg (fun t => t.hom x) he + simpa [hp] using ht.symm + +instance finite_free (n : ℕ) : + Module.Finite (MonoidAlgebra k Q) (Rep.free k Q (Fin n)).ρ.asModule := + Module.Finite.of_basis (Representation.freeAsModuleBasis k Q (Fin n)) + +lemma exists_cover (A : Rep.{0} k Q) + [Module.Finite (MonoidAlgebra k Q) A.ρ.asModule] : + ∃n:ℕ,∃e:Rep.free k Q (Fin n) ⟶ A,Epi e := by + obtain ⟨n,φ,hφ⟩ := Module.Finite.exists_fin' (MonoidAlgebra k Q) A.ρ.asModule + let ψ : (Rep.free k Q (Fin n)).ρ.asModule →ₗ[MonoidAlgebra k Q] A.ρ.asModule := + φ.comp ((Finsupp.linearEquivFunOnFinite (MonoidAlgebra k Q) (MonoidAlgebra k Q) (Fin n)).toLinearMap.comp + (Representation.finsuppLEquivFreeAsModule k Q (Fin n)).symm.toLinearMap) + have hψ : Function.Surjective ψ := hφ.comp + ((Finsupp.linearEquivFunOnFinite (MonoidAlgebra k Q) (MonoidAlgebra k Q) (Fin n)).surjective.comp + (Representation.finsuppLEquivFreeAsModule k Q (Fin n)).symm.surjective) + let p : Rep.toModuleMonoidAlgebra.obj (Rep.free k Q (Fin n)) ⟶ Rep.toModuleMonoidAlgebra.obj A := + ModuleCat.ofHom ψ + have : Epi p := (ModuleCat.epi_iff_surjective _).mpr hψ + let e : Rep.free k Q (Fin n) ⟶ A := + (Rep.unitIso _).hom ≫ Rep.ofModuleMonoidAlgebra.map p ≫ (Rep.unitIso _).inv + exact ⟨n,e,by dsimp only [e]; infer_instance⟩ + +lemma finite_kernel {A B : Rep.{0} k Q} (d : A ⟶ B) + [IsNoetherianRing (MonoidAlgebra k Q)] + [Module.Finite (MonoidAlgebra k Q) A.ρ.asModule] : + Module.Finite (MonoidAlgebra k Q) (kernel d).ρ.asModule := by + have : Module.Finite (MonoidAlgebra k Q) (Rep.toModuleMonoidAlgebra.obj A) := + ‹Module.Finite (MonoidAlgebra k Q) A.ρ.asModule› + let p := Rep.toModuleMonoidAlgebra.map (kernel.ι d) + have : Mono p := inferInstanceAs (Mono (Rep.toModuleMonoidAlgebra.map (kernel.ι d))) + exact Module.Finite.of_injective p.hom ((ModuleCat.mono_iff_injective _).mp inferInstance) + +end FiniteFreeRep + +end + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/ReducedNatural.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/ReducedNatural.lean new file mode 100644 index 0000000000000000000000000000000000000000..327b9ca1a04b8f452961b4ba7be5b44fa0344f6c --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/ReducedNatural.lean @@ -0,0 +1,188 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.GroupNerveCoordinates +import OAI.GroupTheory.SimpleAmenable.Homology.ReducedTensorFinite +import OAI.GroupTheory.SimpleAmenable.Homology.ReducedTensorTwo + +namespace OAI + +section +open CategoryTheory Limits MonoidalCategory HomologicalComplex SimplicialObject Simplicial Opposite +namespace ConstantSplit +open FreeChains ProductChains + +variable {X Y:SSet} +@[reassoc] lemma aug_natural (f:X⟶Y) : chainMap f ≫ aug Y=aug X := by + rw [aug,←chainMap_comp] + congr 1 +noncomputable def redMap (f:X⟶Y) : (sc X).X₁ ⟶ (sc Y).X₁ := + kernel.map (aug X) (aug Y) (chainMap f) (𝟙 _) (by simp [aug_natural]) +@[reassoc (attr:=simp)] lemma redMap_inclusion (f:X⟶Y) : redMap f ≫ (sc Y).f=(sc X).f ≫ chainMap f := + kernel.lift_ι _ _ _ +lemma one_positive (n:ℕ) (hn:n≠0) : IsZero ((complex one).homology n) := by + exact IsZero.of_iso (ConnectedProduct.one_homology_zero n hn) + ((homologyFunctor A c n).mapIso (complexIso one)).symm +noncomputable def inclusionIso (X:SSet) (x:X.obj (op ⦋0⦌)) (n:ℕ) (hn:n≠0) : + ((sc X).X₁).homology n ≅ (complex X).homology n where + hom := homologyMap (sc X).f n + inv := homologyMap (splitting X x).r n + hom_inv_id := by erw [←homologyMap_comp,(splitting X x).f_r,homologyMap_id] + inv_hom_id := by + have h:=congrArg (fun f=>homologyMap f n) (splitting X x).id + rw [homologyMap_add,homologyMap_comp,homologyMap_comp,homologyMap_id] at h + have hz : homologyMap (sc X).g n=0 := (one_positive n hn).eq_of_tgt _ _ + rw [hz,zero_comp,add_zero] at h + exact h +lemma redMap_epi (f:X⟶Y) (x:X.obj (op ⦋0⦌)) (y:Y.obj (op ⦋0⦌)) (n:ℕ) (hn:n≠0) + [chainMapEpi : Epi (homologyMap (chainMap f) n)] : Epi (homologyMap (redMap f) n) := by + have h:=congrArg (fun f=>homologyMap f n) (redMap_inclusion f) + erw [homologyMap_comp (redMap f) (sc Y).f, + homologyMap_comp (sc X).f (chainMap f)] at h + have : IsIso (homologyMap (sc X).f n):=(inclusionIso X x n hn).isIso_hom + have : IsIso (homologyMap (sc Y).f n):=(inclusionIso Y y n hn).isIso_hom + have : Epi (homologyMap (redMap f) n ≫ homologyMap (sc Y).f n):=by + erw [h] + exact epi_comp' (inferInstanceAs (Epi (homologyMap (sc X).f n))) chainMapEpi + exact (epi_comp_iff_of_isIso _ (homologyMap (sc Y).f n)).mp inferInstance +lemma red_X_zero (X:SSet) [Subsingleton (X.obj (op ⦋0⦌))] (x:X.obj (op ⦋0⦌)) : + IsZero (((sc X).X₁).X 0) := by + have he : (aug X).f 0 ≫ (sec X x).f 0=𝟙 ((complex X).X 0) := by + change (ModuleCat.free ℤ).map ((SSet.const (Y:=one) PUnit.unit).app (op ⦋0⦌)) ≫ + (ModuleCat.free ℤ).map ((SSet.const (X:=one) x).app (op ⦋0⦌))=𝟙 _ + rw [←Functor.map_comp,←(ModuleCat.free ℤ).map_id (X.obj (op ⦋0⦌))] + congr 1 + ext z + exact Subsingleton.elim _ _ + apply (IsZero.iff_id_eq_zero _).mpr + have : Mono ((sc X).f.f 0) := by change Mono ((kernel.ι (aug X)).f 0); infer_instance + apply (cancel_mono ((sc X).f.f 0)).mp + simp only [Category.id_comp,zero_comp] + have h:=congrArg (fun f=>f.f 0) (sc X).zero + simp only [HomologicalComplex.comp_f,HomologicalComplex.zero_f] at h + have hh:=congrArg (fun f=>f≫(sec X x).f 0) h + change ((sc X).f.f 0 ≫ (aug X).f 0) ≫ (sec X x).f 0 = _ at hh + erw [Category.assoc,he,zero_comp] at hh + change (kernel.ι (aug X)).f 0 ≫ 𝟙 ((complex X).X 0)=0 at hh + rw [Category.comp_id] at hh + exact hh +end ConstantSplit + +end + +section +open CategoryTheory Limits MonoidalCategory HomologicalComplex SimplicialObject Simplicial Opposite +namespace ConnectedProduct +open FreeChains ProductChains ConstantSplit + +variable (X Y:SSet) [X.IsConnected] [Y.IsConnected] +noncomputable def redInclusion (n:ℕ) : + (((sc X).X₁)⊗((sc Y).X₁)).homology n ⟶ ((X⊗Y).homology Z n : A) := + homologyMap ((sc X).f⊗ₘ(sc Y).f) n ≫ (homologyIsoN X Y n).inv +@[reassoc (attr:=simp)] lemma redInclusion_redProjection (n:ℕ) : + redInclusion X Y n ≫ redProjection X Y n=𝟙 _ := by + simp only [redInclusion,redProjection,ConstantSplit.sc,Category.assoc,Iso.inv_hom_id_assoc] + erw [←homologyMap_comp,tensorHom_comp_tensorHom,(splitting X (point X)).f_r, + (splitting Y (point Y)).f_r,id_tensorHom_id,homologyMap_id] +omit [X.IsConnected] [Y.IsConnected] in +@[reassoc] lemma redInclusion_fst (n:ℕ) : + redInclusion X Y n ≫ SSet.homologyMap (CartesianMonoidalCategory.fst X Y) Z n=0 := by + let f:=SSet.const (X:=Y) (Y:=one) PUnit.unit + have h:=(homology_natural (𝟙 X) f n) + have he : (𝟙 X)⊗ₘf=CartesianMonoidalCategory.fst X Y ≫ pairLeft X one PUnit.unit := by ext d z <;> rfl + rw [he,SSet.homologyMap_comp,chainMap_id] at h + have ht : ((sc X).f⊗ₘ(sc Y).f) ≫ (𝟙 (complex X)⊗ₘchainMap f)=0 := by + change ((sc X).f⊗ₘ(sc Y).f) ≫ (𝟙 (sc X).X₂⊗ₘ(sc Y).g)=0 + rw [tensorHom_comp_tensorHom,Category.comp_id] + rw [(sc Y).zero]; simp + have hh:=congrArg (fun k=>redInclusion X Y n≫k) h + simp only [redInclusion,ConstantSplit.sc,Category.assoc,Iso.inv_hom_id_assoc] at hh + erw [←homologyMap_comp,ht,homologyMap_zero] at hh + have : Mono (SSet.homologyMap (pairLeft X one PUnit.unit) Z n) := by + have he : pairLeft X one PUnit.unit ≫ CartesianMonoidalCategory.fst X one=𝟙 X := by ext d z; rfl + exact (SplitMono.mk _ (by rw [←SSet.homologyMap_comp,he,SSet.homologyMap_id])).mono + have : Mono (SSet.homologyMap (pairLeft X one PUnit.unit) Z n ≫ (homologyIsoN X one n).hom) := inferInstance + apply (cancel_mono (SSet.homologyMap (pairLeft X one PUnit.unit) Z n ≫ (homologyIsoN X one n).hom)).mp + erw [zero_comp] + simp only [redInclusion,ConstantSplit.sc,Category.assoc] + exact hh +omit [X.IsConnected] [Y.IsConnected] in +@[reassoc] lemma redInclusion_snd (n:ℕ) : + redInclusion X Y n ≫ SSet.homologyMap (CartesianMonoidalCategory.snd X Y) Z n=0 := by + let f:=SSet.const (X:=X) (Y:=one) PUnit.unit + have h:=(homology_natural f (𝟙 Y) n) + have he : f⊗ₘ(𝟙 Y)=CartesianMonoidalCategory.snd X Y ≫ pairRight one Y PUnit.unit := by ext d z <;> rfl + rw [he,SSet.homologyMap_comp,chainMap_id] at h + have ht : ((sc X).f⊗ₘ(sc Y).f) ≫ (chainMap f⊗ₘ𝟙 (complex Y))=0 := by + change ((sc X).f⊗ₘ(sc Y).f) ≫ ((sc X).g⊗ₘ𝟙 (sc Y).X₂)=0 + rw [tensorHom_comp_tensorHom,Category.comp_id] + rw [(sc X).zero]; simp + have hh:=congrArg (fun k=>redInclusion X Y n≫k) h + simp only [redInclusion,ConstantSplit.sc,Category.assoc,Iso.inv_hom_id_assoc] at hh + erw [←homologyMap_comp,ht,homologyMap_zero] at hh + have : Mono (SSet.homologyMap (pairRight one Y PUnit.unit) Z n) := by + have he : pairRight one Y PUnit.unit ≫ CartesianMonoidalCategory.snd one Y=𝟙 Y := by ext d z; rfl + exact (SplitMono.mk _ (by rw [←SSet.homologyMap_comp,he,SSet.homologyMap_id])).mono + have : Mono (SSet.homologyMap (pairRight one Y PUnit.unit) Z n ≫ (homologyIsoN one Y n).hom) := inferInstance + apply (cancel_mono (SSet.homologyMap (pairRight one Y PUnit.unit) Z n ≫ (homologyIsoN one Y n).hom)).mp + erw [zero_comp] + simp only [redInclusion,ConstantSplit.sc,Category.assoc] + exact hh +omit [X.IsConnected] [Y.IsConnected] in +@[reassoc (attr:=simp)] lemma redInclusion_projection (n:ℕ) : + redInclusion X Y n ≫ projection X Y n=0 := by + apply biprod.hom_ext <;> simp [projection,redInclusion_fst,redInclusion_snd] +lemma red_projection_recover (n:ℕ) (x:((X⊗Y).homology Z n : A)) + (hx:projection X Y n x=0) : redInclusion X Y n (redProjection X Y n x)=x := by + apply sub_eq_zero.mp + apply projection_joint_zero X Y n + · rw [map_sub,hx,sub_zero] + change (redInclusion X Y n≫projection X Y n) _=0 + rw [redInclusion_projection]; rfl + · rw [map_sub] + change (redInclusion X Y n≫redProjection X Y n) _ - _=0 + rw [redInclusion_redProjection] + exact sub_self _ +variable {X Y} {X' Y':SSet} [X'.IsConnected] [Y'.IsConnected] +omit [X.IsConnected] [Y.IsConnected] [X'.IsConnected] [Y'.IsConnected] in +@[reassoc] lemma redInclusion_natural (f:X⟶X') (g:Y⟶Y') (n:ℕ) : + redInclusion X Y n ≫ SSet.homologyMap (f⊗ₘg) Z n = + homologyMap (redMap f⊗ₘredMap g) n ≫ redInclusion X' Y' n := by + apply (cancel_mono (homologyIsoN X' Y' n).hom).mp + simp only [redInclusion,ConstantSplit.sc,Category.assoc,Iso.inv_hom_id,Category.comp_id] + erw [homology_natural, Iso.inv_hom_id_assoc,←homologyMap_comp,←homologyMap_comp, + tensorHom_comp_tensorHom, tensorHom_comp_tensorHom,redMap_inclusion,redMap_inclusion] + rfl +lemma kernel_map_surjective (f:X⟶X') (g:Y⟶Y') + [Subsingleton (X.obj (op ⦋0⦌))] [Subsingleton (Y.obj (op ⦋0⦌))] + [Subsingleton (X'.obj (op ⦋0⦌))] [Subsingleton (Y'.obj (op ⦋0⦌))] + [Epi (SSet.homologyMap f Z 1)] [Epi (SSet.homologyMap g Z 1)] + (x:((X'⊗Y').homology Z 2 : A)) (hx:projection X' Y' 2 x=0) : + ∃y:((X⊗Y).homology Z 2 : A), projection X Y 2 y=0 ∧ SSet.homologyMap (f⊗ₘg) Z 2 y=x := by + have hf:=FreeChains.complexIso_natural f + have : Epi (homologyMap (chainMap f) 1) := by + have hh:=congrArg (fun k=>homologyMap k 1) hf + simp only [homologyMap_comp] at hh + have : Epi (homologyMap (FreeChains.complexIso X).hom 1 ≫ homologyMap (chainMap f) 1):=by rw [←hh]; infer_instance + exact epi_of_epi (homologyMap (FreeChains.complexIso X).hom 1) _ + have : Epi (homologyMap (chainMap g) 1) := by + have hh:=congrArg (fun k=>homologyMap k 1) (FreeChains.complexIso_natural g) + simp only [homologyMap_comp] at hh + have : Epi (homologyMap (FreeChains.complexIso Y).hom 1 ≫ homologyMap (chainMap g) 1):=by rw [←hh]; infer_instance + exact epi_of_epi (homologyMap (FreeChains.complexIso Y).hom 1) _ + have :=redMap_epi f (point X) (point X') 1 (by decide) + have :=redMap_epi g (point Y) (point Y') 1 (by decide) + have :=ReducedTensorTwo.homology_epi (redMap f) (redMap g) + (red_X_zero X (point X)) (red_X_zero Y (point Y)) + (red_X_zero X' (point X')) (red_X_zero Y' (point Y')) + obtain ⟨y,hy⟩:=((ModuleCat.epi_iff_surjective (homologyMap (redMap f⊗ₘredMap g) 2)).mp inferInstance) (redProjection X' Y' 2 x) + refine ⟨redInclusion X Y 2 y,?_,?_⟩ + · change (redInclusion X Y 2≫projection X Y 2) y=0 + rw [redInclusion_projection]; rfl + · change (redInclusion X Y 2≫SSet.homologyMap (f⊗ₘg) Z 2) y=x + rw [redInclusion_natural] + change redInclusion X' Y' 2 (homologyMap (redMap f⊗ₘredMap g) 2 y)=x + rw [hy,red_projection_recover X' Y' 2 x hx] +end ConnectedProduct + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/ReducedTensorFinite.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/ReducedTensorFinite.lean new file mode 100644 index 0000000000000000000000000000000000000000..58ba07d6c15877ae311676f5b597853d86fb5a59 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/ReducedTensorFinite.lean @@ -0,0 +1,162 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.ConstantSplit + +namespace OAI + +section +open CategoryTheory Limits MonoidalCategory HomologicalComplex HomologicalComplex₂ +namespace TensorProductHomology + +variable {R:Type} [CommRing R] [IsDomain R] [IsPrincipalIdealRing R] +lemma finite_reduced (K L:ChainComplex (ModuleCat.{0} R) ℕ) + [∀i,Module.Flat R (K.X i)] (n:ℕ) + (hK0:IsZero (K.homology 0)) (hL0:IsZero (L.homology 0)) + (hK:∀i,i + have hz := TensorCoefficient.arbitrary_zero_zero K (L.homology q) hK0 + have zeroHomologySubsingleton := ModuleCat.isZero_iff_subsingleton.mp hz + infer_instance + | succ p => + have rightHomologyFinite := hL q (by omega) + have leftHomologyFinite := hK p (by omega) + have leftSuccessorFinite := hK (p+1) (by omega) + exact TensorCoefficient.finite_coefficient_succ K (L.homology q) p + exact Module.Finite.equiv e.symm.toLinearEquiv +end TensorProductHomology +namespace ConstantSplit +open FreeChains ProductChains + +lemma red_finite (X:SSet) [X.IsConnected] (n:ℕ) [Module.Finite ℤ ((complex X).homology n)] : + Module.Finite ℤ (((sc X).X₁).homology n) := by + let s := splitting X (ConnectedProduct.point X) + have originalHomologyFinite : Module.Finite ℤ (((sc X).X₂).homology n) := + ‹Module.Finite ℤ ((complex X).homology n)› + let f := (homologyMap (sc X).f n).hom + apply Module.Finite.of_injective f + intro x y h + have he := congrArg (fun t => homologyMap t n) s.f_r + rw [homologyMap_comp,homologyMap_id] at he + have he' : Function.LeftInverse (homologyMap s.r n) f := by + intro z + exact congrArg (fun t => t z) he + exact he'.injective h +lemma red_homology_zero (X:SSet) [X.IsConnected] : IsZero (((sc X).X₁).homology 0) := + red_zero X 1 (by intro i hi hi'; omega) 0 (by omega) +end ConstantSplit +namespace ChainTensor +open FreeChains + +variable (S T:ShortComplex (ChainComplex A ℕ)) (s:S.Splitting) (t:T.Splitting) +lemma homology_joint_kernel' (n:ℕ) (x:(S.X₂⊗T.X₂).homology n) + (h0:homologyMap (s.r⊗ₘt.r) n x=0) + (h1:homologyMap (𝟙 S.X₂⊗ₘT.g) n x=0) + (h2:homologyMap (S.g⊗ₘ𝟙 T.X₂) n x=0) : x=0 := by + have hid := congrArg (fun f => homologyMap f n) (splitting_tensor_identity S T s t) + simp only [homologyMap_add,homologyMap_comp,homologyMap_id] at hid + have hh := congrArg (fun f => f x) hid + change homologyMap (S.f⊗ₘT.f) n (homologyMap (s.r⊗ₘt.r) n x) + + homologyMap ((s.r≫S.f)⊗ₘt.s) n (homologyMap (𝟙 S.X₂⊗ₘT.g) n x) + + homologyMap (s.s⊗ₘ𝟙 T.X₂) n (homologyMap (S.g⊗ₘ𝟙 T.X₂) n x) = x at hh + simpa only [h0,h1,h2,map_zero,add_zero] using hh.symm +end ChainTensor + +end + +section +open CategoryTheory Limits MonoidalCategory HomologicalComplex SimplicialObject Simplicial Opposite +namespace ConnectedProduct +open FreeChains ProductChains + +attribute [local instance 1200] Submodule.module +variable (X Y:SSet) [X.IsConnected] [Y.IsConnected] +noncomputable def redProjection (n:ℕ) : + ((X⊗Y).homology Z n : A) ⟶ + (((ConstantSplit.sc X).X₁)⊗((ConstantSplit.sc Y).X₁)).homology n := + (homologyIsoN X Y n).hom ≫ homologyMap + ((ConstantSplit.splitting X (point X)).r⊗ₘ(ConstantSplit.splitting Y (point Y)).r) n +lemma projection_joint_zero (n:ℕ) (x:((X⊗Y).homology Z n : A)) + (hx:projection X Y n x=0) (hr:redProjection X Y n x=0) : x=0 := by + have hf : SSet.homologyMap (CartesianMonoidalCategory.fst X Y) Z n x=0 := by + have h := congrArg (fun z => (biprod.fst : X.homology Z n ⊞ Y.homology Z n ⟶ X.homology Z n) z) hx + simp only [map_zero] at h + change (projection X Y n ≫ biprod.fst) x=0 at h + simpa only [projection,biprod.lift_fst] using h + have hg : SSet.homologyMap (CartesianMonoidalCategory.snd X Y) Z n x=0 := by + have h := congrArg (fun z => (biprod.snd : X.homology Z n ⊞ Y.homology Z n ⟶ Y.homology Z n) z) hx + simp only [map_zero] at h + change (projection X Y n ≫ biprod.snd) x=0 at h + simpa only [projection,biprod.lift_snd] using h + let e := homologyIsoN X Y n + have h1 : homologyMap (𝟙 (complex X)⊗ₘConstantSplit.aug Y) n (e.hom x)=0 := by + have hn := homology_natural (𝟙 X) (SSet.const (X:=Y) (Y:=one) PUnit.unit) n + rw [chainMap_id] at hn + have he : (𝟙 X)⊗ₘ(SSet.const (X:=Y) (Y:=one) PUnit.unit) = + CartesianMonoidalCategory.fst X Y ≫ pairLeft X one PUnit.unit := by ext d z <;> rfl + rw [he,SSet.homologyMap_comp] at hn + have hh := congrArg (fun f => f x) hn + change (homologyIsoN X one n).hom + (SSet.homologyMap (pairLeft X one PUnit.unit) Z n + (SSet.homologyMap (CartesianMonoidalCategory.fst X Y) Z n x)) = _ at hh + simpa only [hf,map_zero,ConstantSplit.aug,ConstantSplit.one,e,ModuleCat.comp_apply] using hh.symm + have h2 : homologyMap (ConstantSplit.aug X⊗ₘ𝟙 (complex Y)) n (e.hom x)=0 := by + have hn := homology_natural (SSet.const (X:=X) (Y:=one) PUnit.unit) (𝟙 Y) n + rw [chainMap_id] at hn + have he : (SSet.const (X:=X) (Y:=one) PUnit.unit)⊗ₘ(𝟙 Y) = + CartesianMonoidalCategory.snd X Y ≫ pairRight one Y PUnit.unit := by ext d z <;> rfl + rw [he,SSet.homologyMap_comp] at hn + have hh := congrArg (fun f => f x) hn + change (homologyIsoN one Y n).hom + (SSet.homologyMap (pairRight one Y PUnit.unit) Z n + (SSet.homologyMap (CartesianMonoidalCategory.snd X Y) Z n x)) = _ at hh + simpa only [hg,map_zero,ConstantSplit.aug,ConstantSplit.one,e,ModuleCat.comp_apply] using hh.symm + have hh := ChainTensor.homology_joint_kernel' (ConstantSplit.sc X) (ConstantSplit.sc Y) + (ConstantSplit.splitting X (point X)) (ConstantSplit.splitting Y (point Y)) n + (e.hom x) hr h1 h2 + exact e.toLinearEquiv.injective (hh.trans (map_zero e.toLinearEquiv).symm) +lemma finite_projection_kernel (n:ℕ) + (hX:∀ i,i⟨positiveDesc K n hn f hf,positiveπ_desc K n hn f hf⟩) +end ChainComplex +namespace ReducedTensorTwo + +section +open FreeChains + +variable (K L:ChainComplex A ℕ) (hK:IsZero (K.X 0)) (hL:IsZero (L.X 0)) +noncomputable abbrev inc (p q n:ℕ) (h:p+q=n) : K.X p ⊗ L.X q ⟶ (K⊗L).X n := + ιMapBifunctor K L (curriedTensor A) c p q n h +include hK hL +lemma total_one_zero : IsZero ((K⊗L).X 1) := by + apply (IsZero.iff_id_eq_zero _).mpr + apply total.hom_ext + intro p q hpq + change inc K L p q 1 hpq ≫ 𝟙 _ = inc K L p q 1 hpq ≫ 0 + have hpq':p+q=1:=hpq + by_cases hp:p=0 + · subst p + exact (Functor.map_isZero (tensorRight (L.X q)) hK).eq_of_src _ _ + · have hq:q=0:=by omega + subst q + exact (Functor.map_isZero (tensorLeft (K.X p)) hL).eq_of_src _ _ +lemma d21_zero : (K⊗L).d 2 1=0 := (total_one_zero K L hK hL).eq_of_tgt _ _ +lemma inc_epi : Epi (inc K L 1 1 2 rfl) where + left_cancellation f g h := by + apply total.hom_ext + intro p q hpq + change inc K L p q 2 hpq ≫ f=inc K L p q 2 hpq ≫ g + have hpq':p+q=2:=hpq + by_cases hp:p=0 + · subst p; exact (Functor.map_isZero (tensorRight (L.X q)) hK).eq_of_src _ _ + · by_cases hq:q=0 + · subst q; exact (Functor.map_isZero (tensorLeft (K.X p)) hL).eq_of_src _ _ + · have he:p=1:=by omega + have he':q=1:=by omega + subst p q + exact h +noncomputable def raw : K.X 1⊗L.X 1 ⟶ (K⊗L).homology 2 := + inc K L 1 1 2 rfl ≫ ChainComplex.positiveπ (K⊗L) 1 (d21_zero K L hK hL) +lemma raw_epi : Epi (raw K L hK hL) := by + have :=inc_epi K L hK hL + dsimp only [raw]; infer_instance +omit hK in +lemma inc21_d : inc K L 2 1 3 rfl ≫ (K⊗L).d 3 2 = + (K.d 2 1 ▷ L.X 1) ≫ inc K L 1 1 2 rfl := by + change ιMapBifunctor K L (curriedTensor A) c _ _ _ _ ≫ (mapBifunctor K L (curriedTensor A) c).d 3 2 = _ + rw [mapBifunctor.d_eq,Preadditive.comp_add,mapBifunctor.ι_D₁,mapBifunctor.ι_D₂, + mapBifunctor.d₁_eq K L (curriedTensor A) c (show c.Rel 2 1 from rfl) 1 2 rfl, + mapBifunctor.d₂_eq K L (curriedTensor A) c 2 (show c.Rel 1 0 from rfl) 2 rfl] + have h:L.d 1 0=0:=hL.eq_of_tgt _ _ + simp [h,ComplexShape.ε₁,ComplexShape.ε₂] +omit hL in +lemma inc12_d : inc K L 1 2 3 rfl ≫ (K⊗L).d 3 2 = + -((K.X 1 ◁ L.d 2 1) ≫ inc K L 1 1 2 rfl) := by + change ιMapBifunctor K L (curriedTensor A) c _ _ _ _ ≫ (mapBifunctor K L (curriedTensor A) c).d 3 2 = _ + rw [mapBifunctor.d_eq,Preadditive.comp_add,mapBifunctor.ι_D₁,mapBifunctor.ι_D₂, + mapBifunctor.d₁_eq K L (curriedTensor A) c (show c.Rel 1 0 from rfl) 2 2 rfl, + mapBifunctor.d₂_eq K L (curriedTensor A) c 1 (show c.Rel 2 1 from rfl) 2 rfl] + have h:K.d 1 0=0:=hK.eq_of_tgt _ _ + simp [h,ComplexShape.ε₁,ComplexShape.ε₂] +lemma d_left_raw : (K.d 2 1 ▷ L.X 1) ≫ raw K L hK hL=0 := by + rw [raw,←Category.assoc,←inc21_d K L hL,Category.assoc,ChainComplex.d_positiveπ,comp_zero] +lemma d_right_raw : (K.X 1 ◁ L.d 2 1) ≫ raw K L hK hL=0 := by + have h:=congrArg (fun f=>f≫ChainComplex.positiveπ (K⊗L) 1 (d21_zero K L hK hL)) (inc12_d K L hK) + simpa only [raw,Category.assoc,ChainComplex.d_positiveπ,comp_zero,Preadditive.neg_comp,neg_eq_zero] using h.symm +end + +open FreeChains + +variable (K L:ChainComplex A ℕ) (hK:IsZero (K.X 0)) (hL:IsZero (L.X 0)) +noncomputable abbrev πK := ChainComplex.positiveπ K 0 (hK.eq_of_tgt (K.d 1 0) 0) +noncomputable abbrev πL := ChainComplex.positiveπ L 0 (hL.eq_of_tgt (L.d 1 0) 0) +noncomputable def leftColimit := isColimitCoforkMapOfIsColimit' (tensorRight (L.X 1)) + (ChainComplex.d_positiveπ K 0 (hK.eq_of_tgt (K.d 1 0) 0)) + (ChainComplex.positiveIsCokernel K 0 (hK.eq_of_tgt (K.d 1 0) 0)) +noncomputable def leftDesc : K.homology 1⊗L.X 1 ⟶ (K⊗L).homology 2 := + (leftColimit K L hK).desc (CokernelCofork.ofπ (raw K L hK hL) (d_left_raw K L hK hL)) +@[reassoc] lemma π_leftDesc : (πK K hK ▷ L.X 1) ≫ leftDesc K L hK hL=raw K L hK hL := + (leftColimit K L hK).fac _ WalkingParallelPair.one +lemma d_leftDesc : (K.homology 1 ◁ L.d 2 1) ≫ leftDesc K L hK hL=0 := by + have : Epi (πK K hK ▷ L.X 2) := Cofork.IsColimit.epi + (isColimitCoforkMapOfIsColimit' (tensorRight (L.X 2)) + (ChainComplex.d_positiveπ K 0 (hK.eq_of_tgt (K.d 1 0) 0)) + (ChainComplex.positiveIsCokernel K 0 (hK.eq_of_tgt (K.d 1 0) 0))) + apply (cancel_epi (πK K hK ▷ L.X 2)).mp + rw [comp_zero,←Category.assoc,←MonoidalCategory.whisker_exchange,Category.assoc,π_leftDesc,d_right_raw] +noncomputable def rightColimit := isColimitCoforkMapOfIsColimit' (tensorLeft (K.homology 1)) + (ChainComplex.d_positiveπ L 0 (hL.eq_of_tgt (L.d 1 0) 0)) + (ChainComplex.positiveIsCokernel L 0 (hL.eq_of_tgt (L.d 1 0) 0)) +noncomputable def generator : K.homology 1⊗L.homology 1 ⟶ (K⊗L).homology 2 := + (rightColimit K L hL).desc (CokernelCofork.ofπ (leftDesc K L hK hL) (d_leftDesc K L hK hL)) +@[reassoc] lemma π_generator : (πK K hK ⊗ₘ πL L hL) ≫ generator K L hK hL=raw K L hK hL := by + rw [MonoidalCategory.tensorHom_def,Category.assoc] + have h : (K.homology 1 ◁ πL L hL) ≫ generator K L hK hL=leftDesc K L hK hL := + (rightColimit K L hL).fac _ WalkingParallelPair.one + rw [h,π_leftDesc] +lemma generator_epi : Epi (generator K L hK hL) := by + have : Epi ((πK K hK ⊗ₘ πL L hL) ≫ generator K L hK hL):=by + rw [π_generator]; exact raw_epi K L hK hL + exact epi_of_epi (πK K hK ⊗ₘ πL L hL) _ +end ReducedTensorTwo + +end + +open CategoryTheory Limits MonoidalCategory HomologicalComplex HomologicalComplex₂ +namespace ChainComplex +open scoped _root_.ChainComplex + +variable {R:Type} [CommRing R] {K L:ChainComplex (ModuleCat.{0} R) ℕ} +@[reassoc] lemma positiveπ_natural (f:K⟶L) (n:ℕ) (hK:K.d (n+1) n=0) (hL:L.d (n+1) n=0) : + positiveπ K n hK ≫ homologyMap f (n+1)=f.f (n+1) ≫ positiveπ L n hL := by + apply (cancel_mono (L.homologyι (n+1))).mp + simp only [positiveπ,Category.assoc,homologyι_naturality,isoHomologyι_inv_hom_id_assoc, + isoHomologyι_inv_hom_id,Category.comp_id,p_opcyclesMap] +end ChainComplex +namespace ModuleCat +open scoped _root_.ModuleCat +lemma tensor_epi {R:Type} [CommRing R] {M N P Q:ModuleCat.{0} R} (f:M⟶N) (g:P⟶Q) + [Epi f] [Epi g] : Epi (f⊗ₘg) := by + apply (_root_.ModuleCat.epi_iff_surjective _).mpr + exact TensorProduct.map_surjective ((_root_.ModuleCat.epi_iff_surjective f).mp inferInstance) + ((_root_.ModuleCat.epi_iff_surjective g).mp inferInstance) +end ModuleCat +namespace ReducedTensorTwo +open FreeChains + +variable {K L K' L':ChainComplex A ℕ} (f:K⟶K') (g:L⟶L') +variable (hK:IsZero (K.X 0)) (hL:IsZero (L.X 0)) (hK':IsZero (K'.X 0)) (hL':IsZero (L'.X 0)) +@[reassoc] lemma inc_natural (p q n:ℕ) (h:p+q=n) : + inc K L p q n h ≫ (f⊗ₘg).f n=(f.f p ⊗ₘg.f q) ≫ inc K' L' p q n h := by + change ιMapBifunctor K L (curriedTensor A) c p q n h ≫ + (mapBifunctorMap f g (curriedTensor A) c).f n=_ + rw [ι_mapBifunctorMap] + change (f.f p ▷ L.X q) ≫ (K'.X p ◁ g.f q) ≫ _ = _ + rw [←Category.assoc,←MonoidalCategory.tensorHom_def] +@[reassoc] lemma raw_natural : raw K L hK hL ≫ homologyMap (f⊗ₘg) 2= + (f.f 1⊗ₘg.f 1) ≫ raw K' L' hK' hL' := by + rw [raw,Category.assoc,ChainComplex.positiveπ_natural,←Category.assoc,inc_natural,Category.assoc] + rfl +@[reassoc] lemma generator_natural : generator K L hK hL ≫ homologyMap (f⊗ₘg) 2= + (homologyMap f 1⊗ₘhomologyMap g 1) ≫ generator K' L' hK' hL' := by + have :=ModuleCat.tensor_epi (πK K hK) (πL L hL) + apply (cancel_epi (πK K hK⊗ₘπL L hL)).mp + rw [π_generator_assoc,raw_natural,←Category.assoc,tensorHom_comp_tensorHom] + rw [ChainComplex.positiveπ_natural f 0 _ (hK'.eq_of_tgt _ _), + ChainComplex.positiveπ_natural g 0 _ (hL'.eq_of_tgt _ _),←tensorHom_comp_tensorHom, + Category.assoc,π_generator] +include hK hL hK' hL' in +lemma homology_epi [Epi (homologyMap f 1)] [Epi (homologyMap g 1)] : + Epi (homologyMap (f⊗ₘg) 2) := by + have :=ModuleCat.tensor_epi (homologyMap f 1) (homologyMap g 1) + have :=generator_epi K' L' hK' hL' + have : Epi (generator K L hK hL ≫ homologyMap (f⊗ₘg) 2):=by rw [generator_natural f g hK hL hK' hL']; infer_instance + exact epi_of_epi (generator K L hK hL) _ +end ReducedTensorTwo + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/RegularAugmentation.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/RegularAugmentation.lean new file mode 100644 index 0000000000000000000000000000000000000000..87d40d22785a6053de54fe6ee4380a4477f0e629 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/RegularAugmentation.lean @@ -0,0 +1,195 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.AlternatingH2 +import OAI.GroupTheory.SimpleAmenable.Homology.QuotientRegular + +namespace OAI + +section + +section + +open Classical CategoryTheory CategoryTheory.Limits Representation Rep Finsupp +open SimpleAmenable +namespace QuotientRegular + +attribute [local instance 1200] Rep.hV2 +variable {G Q : Type} [Group G] [Group Q] + +noncomputable def augment : Rep.leftRegular ℤ Q ⟶ Rep.trivial ℤ Q ℤ := + Rep.ofHom ⟨(MonoidAlgebra.lift ℤ ℤ Q (1:Q →* ℤ)).toLinearMap,by + intro g + apply MonoidAlgebra.lhom_ext' + intro q + apply LinearMap.ext + intro z + simp⟩ + +@[simp] lemma augment_single (q:Q) (z:ℤ) : + (augment (Q:=Q)).hom (MonoidAlgebra.single q z)=z := by + simp [augment,MonoidAlgebra.lift_single] + +instance augment_epi : Epi (augment (Q:=Q)) := by + apply ConcreteCategory.epi_of_surjective + intro z + exact ⟨MonoidAlgebra.single 1 z,augment_single 1 z⟩ + +lemma regular_ext {A : Rep ℤ Q} (t u : Rep.leftRegular ℤ Q ⟶ A) + (h : t.hom (MonoidAlgebra.single 1 1)=u.hom (MonoidAlgebra.single 1 1)) : t=u := by + apply Rep.hom_ext + apply Representation.IntertwiningMap.ext + apply MonoidAlgebra.lhom_ext' + intro q + apply LinearMap.ext + intro z + have ht := congrArg (fun T => T (MonoidAlgebra.single 1 1)) (t.hom.isIntertwining' q) + have hu := congrArg (fun T => T (MonoidAlgebra.single 1 1)) (u.hom.isIntertwining' q) + have hv : t.hom (MonoidAlgebra.single q 1)=u.hom (MonoidAlgebra.single q 1) := by + change t.hom ((Rep.leftRegular ℤ Q).ρ q (MonoidAlgebra.single 1 1)) = A.ρ q (t.hom (MonoidAlgebra.single 1 1)) at ht + change u.hom ((Rep.leftRegular ℤ Q).ρ q (MonoidAlgebra.single 1 1)) = A.ρ q (u.hom (MonoidAlgebra.single 1 1)) at hu + rw [h] at ht + simpa using ht.trans hu.symm + change t.hom (MonoidAlgebra.single q z)=u.hom (MonoidAlgebra.single q z) + have he : MonoidAlgebra.single q z = z • (MonoidAlgebra.single q 1 : MonoidAlgebra ℤ Q) := by simp + rw [he] + change t.hom.toLinearMap _ = u.hom.toLinearMap _ + rw [LinearMap.map_smul,LinearMap.map_smul] + exact congrArg _ hv + +lemma regular_sum_right (t : Rep.leftRegular ℤ Q ⟶ Rep.leftRegular ℤ Q) : + t = ∑q∈(t.hom (MonoidAlgebra.single 1 1)).coeff.support, + (t.hom (MonoidAlgebra.single 1 1)).coeff q • right (MonoidHom.id Q) q := by + apply regular_ext + simp only [Rep.sum_hom,Rep.zsmul_hom,Representation.IntertwiningMap.sum_apply, + Representation.IntertwiningMap.smul_apply] + change _ = ∑q∈(t.hom (MonoidAlgebra.single 1 1)).coeff.support, + (t.hom (MonoidAlgebra.single 1 1)).coeff q • + (right (MonoidHom.id Q) q).hom (MonoidAlgebra.single 1 1) + have hr (q:Q) : (right (MonoidHom.id Q) q).hom (MonoidAlgebra.single 1 1)= + MonoidAlgebra.single q 1 := by simpa using right_single (MonoidHom.id Q) q 1 1 + simp only [hr,MonoidAlgebra.smul_single,smul_eq_mul,mul_one] + simpa only [Finsupp.sum] using + (MonoidAlgebra.sum_coeff_single (t.hom (MonoidAlgebra.single 1 1))).symm + +lemma map_regular_zero (f : G →* Q) (hf : Function.Surjective f) (n : ℕ) + (hact : ∀g:G,TrivialHomology.map (conjugate f g).toMonoidHom n=𝟙 _) + (t : Rep.leftRegular ℤ Q ⟶ Rep.leftRegular ℤ Q) (ht : t ≫ augment=0) : + (groupHomology.functor ℤ G n).map ((Rep.resFunctor f).map t)=0 := by + let F := Rep.resFunctor f ⋙ groupHomology.functor ℤ G n + have ha : ∑q∈(t.hom (MonoidAlgebra.single 1 1)).coeff.support, + (t.hom (MonoidAlgebra.single 1 1)).coeff q=0 := by + have hh := congrArg (fun s => s.hom (MonoidAlgebra.single 1 1)) ht + simpa [augment,MonoidAlgebra.lift_apply,Finsupp.sum] using hh + change F.map t=0 + rw [regular_sum_right t,F.map_sum] + simp_rw [F.map_zsmul] + have hr : ∀q:Q,F.map (right (MonoidHom.id Q) q)=𝟙 _ := fun q => + right_homology_identity f hf n hact q + simp_rw [hr] + rw [← Finset.sum_smul,ha,zero_smul] + +lemma map_free_zero (f : G →* Q) (hf : Function.Surjective f) (n : ℕ) + (hact : ∀g:G,TrivialHomology.map (conjugate f g).toMonoidHom n=𝟙 _) + (k : ℕ) (t : Rep.free ℤ Q (Fin k) ⟶ Rep.leftRegular ℤ Q) (ht : t ≫ augment=0) : + (groupHomology.functor ℤ G n).map ((Rep.resFunctor f).map t)=0 := by + let F := Rep.resFunctor f ⋙ groupHomology.functor ℤ G n + have hi : ∀i:Fin k,F.map (FiniteFreeRep.incl (Rep.leftRegular ℤ Q) i ≫ t)=0 := by + intro i + exact map_regular_zero f hf n hact _ (by rw [Category.assoc,ht,comp_zero]) + change F.map t=0 + rw [← Category.id_comp t,← FiniteFreeRep.sum_proj_incl (Rep.leftRegular ℤ Q) k, + Preadditive.sum_comp,F.map_sum] + apply Finset.sum_eq_zero + intro i hi' + rw [Category.assoc,F.map_comp,hi,comp_zero] + +end QuotientRegular + +end + +section + +open Classical CategoryTheory CategoryTheory.Limits Representation Rep Finsupp +open SimpleAmenable +namespace QuotientRegular + +attribute [local instance 1200] Rep.hV2 +variable {G Q : Type} [Group G] [Group Q] + +instance finite_regular_module : + Module.Finite (MonoidAlgebra ℤ Q) (Rep.leftRegular ℤ Q).ρ.asModule := by + let p : Rep.free ℤ Q (Fin 1) ⟶ Rep.leftRegular ℤ Q := FiniteFreeRep.proj (Rep.leftRegular ℤ Q) (n:=1) 0 + have : Epi p := ConcreteCategory.epi_of_surjective p (by + intro x + exact ⟨Finsupp.single 0 x,by simp [p,FiniteFreeRep.proj]⟩) + let q := Rep.toModuleMonoidAlgebra.map p + have : Epi q := inferInstanceAs (Epi (Rep.toModuleMonoidAlgebra.map p)) + have : Module.Finite (MonoidAlgebra ℤ Q) + (Rep.toModuleMonoidAlgebra.obj (Rep.free ℤ Q (Fin 1))) := + inferInstanceAs (Module.Finite (MonoidAlgebra ℤ Q) (Rep.free ℤ Q (Fin 1)).ρ.asModule) + exact Module.Finite.of_surjective q.hom ((ModuleCat.epi_iff_surjective _).mp inferInstance) + +lemma H0_finite (f : G →* Q) (hf : Function.Surjective f) : + Module.Finite ℤ (groupHomology (regular f) 0) := by + have : Module.Finite ℤ (groupHomology (Rep.trivial ℤ f.ker ℤ) 0) := + Module.Finite.of_surjective + (groupHomology.H0IsoOfIsTrivial (Rep.trivial ℤ f.ker ℤ)).inv.hom + (groupHomology.H0IsoOfIsTrivial (Rep.trivial ℤ f.ker ℤ)).toLinearEquiv.symm.surjective + have := isIso_point f hf 0 + exact Module.Finite.of_surjective (groupHomology.map f.ker.subtype (point f) 0).hom + ((ModuleCat.epi_iff_surjective _).mp inferInstance) + +lemma finite_kernel_H2 (f : G →* Q) (hf : Function.Surjective f) + [IsNoetherianRing (MonoidAlgebra ℤ Q)] + [Module.Finite ℤ (groupHomology (Rep.trivial ℤ G ℤ) 2)] + (hz : IsZero (groupHomology (Rep.trivial ℤ f.ker ℤ) 1)) + (hact : ∀g:G,TrivialHomology.map (conjugate f g).toMonoidHom 2=𝟙 _) : + Module.Finite ℤ (groupHomology (Rep.trivial ℤ f.ker ℤ) 2) := by + let ε := augment (Q:=Q) + have : Module.Finite (MonoidAlgebra ℤ Q) (kernel ε).ρ.asModule := + FiniteFreeRep.finite_kernel ε + obtain ⟨n₂,e₂,he₂⟩ := FiniteFreeRep.exists_cover (kernel ε) + let := he₂ + have : Module.Finite (MonoidAlgebra ℤ Q) (kernel e₂).ρ.asModule := + FiniteFreeRep.finite_kernel e₂ + obtain ⟨n₃,e₃,he₃⟩ := FiniteFreeRep.exists_cover (kernel e₂) + let := he₃ + have : Module.Finite (MonoidAlgebra ℤ Q) (kernel e₃).ρ.asModule := + FiniteFreeRep.finite_kernel e₃ + obtain ⟨n₄,e₄,he₄⟩ := FiniteFreeRep.exists_cover (kernel e₃) + let := he₄ + let T : Rep.{0} ℤ Q ⥤ Rep.{0} ℤ G := Rep.resFunctor f + let F₀ := T ⋙ groupHomology.functor ℤ G 0 + let F₁ := T ⋙ groupHomology.functor ℤ G 1 + have : Module.Finite ℤ (F₀.obj (Rep.leftRegular ℤ Q)) := H0_finite f hf + have : Module.Finite ℤ (groupHomology (T.obj (Rep.free ℤ Q (Fin n₄))) 0) := + FiniteFreeRep.functor_finite F₀ (Rep.leftRegular ℤ Q) n₄ + have hz₃ : IsZero (groupHomology (T.obj (Rep.free ℤ Q (Fin n₃))) 1) := + FiniteFreeRep.functor_isZero F₁ (Rep.leftRegular ℤ Q) (H1_isZero f hf hz) n₃ + have hd : BoundedHomologyEdge.Hmap 2 (T.map e₂ ≫ T.map (kernel.ι ε))=0 := by + rw [← T.map_comp] + exact map_free_zero f hf 2 hact n₂ (e₂ ≫ kernel.ι ε) + (by rw [Category.assoc,kernel.condition,comp_zero]) + let e₀ : Rep.trivial ℤ G ℤ ≅ T.obj (Rep.trivial ℤ Q ℤ) := + Rep.mkIso (.mk (LinearEquiv.refl ℤ ℤ) (by intro g; rfl)) + let eH := (groupHomology.functor ℤ G 2).mapIso e₀ + have : Module.Finite ℤ ((groupHomology.functor ℤ G 2).obj (Rep.trivial ℤ G ℤ)) := + inferInstanceAs (Module.Finite ℤ (groupHomology (Rep.trivial ℤ G ℤ) 2)) + have : Module.Finite ℤ (groupHomology (T.obj (Rep.trivial ℤ Q ℤ)) 2) := + Module.Finite.of_surjective eH.hom.hom eH.toLinearEquiv.surjective + have : Epi (T.map e₄) := (Rep.epi_iff_surjective _).mpr + ((Rep.epi_iff_surjective e₄).mp he₄) + have : Module.Finite ℤ (groupHomology (regular f) 2) := + FiniteHomologyReturn.finite_H2 + ((Rep.shortExact_res f).mpr (BoundedHomologyEdge.kernel_shortExact ε)) + ((Rep.shortExact_res f).mpr (BoundedHomologyEdge.kernel_shortExact e₂)) + ((Rep.shortExact_res f).mpr (BoundedHomologyEdge.kernel_shortExact e₃)) + (T.map e₄) hz₃ hd + exact H2_finite_of_regular f hf + +end QuotientRegular + +end + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/RegularBlock.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/RegularBlock.lean new file mode 100644 index 0000000000000000000000000000000000000000..59d5aefb25288a6a589d1d4b8848b4efec3411fb --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/RegularBlock.lean @@ -0,0 +1,148 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.RegularCoefficientDouble +import OAI.GroupTheory.SimpleAmenable.Simplicial.MonoidNerveCoordinates + +namespace OAI + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits Simplicial Opposite HomologicalComplex AlgebraicTopology +namespace RegularCoefficient +open CoefficientNerve FreeChains + +variable {P:Type} [CommMonoid P] (F:ActionCategory P P ⥤ A) +noncomputable def block {h v:ℕ} (s:Simplex (SingleObj P) h) (t:Simplex (ActionCategory P P) v) : + F.obj t.right.unop ⟶ ((double F).X h).X v := + single F t ≫ single ((coeffComplex F).X v) s +lemma block_hom_ext {h v:ℕ} {M:A} {f g:((double F).X h).X v ⟶ M} + (hh:∀s t,block F s t ≫ f=block F s t ≫ g) : f=g := by + apply CoefficientNerve.hom_ext + intro s + apply CoefficientNerve.hom_ext + intro t + exact (Category.assoc _ _ _).symm.trans ((hh s t).trans (Category.assoc _ _ _)) +noncomputable def blockDesc {h v:ℕ} {M:A} + (f:∀(_:Simplex (SingleObj P) h) (t:Simplex (ActionCategory P P) v),F.obj t.right.unop ⟶ M) : + ((double F).X h).X v ⟶ M := + CoefficientNerve.desc ((coeffComplex F).X v) (fun s=>CoefficientNerve.desc F (f s)) +@[reassoc (attr:=simp)] lemma block_desc {h v:ℕ} {M:A} + (f:∀(_:Simplex (SingleObj P) h) (t:Simplex (ActionCategory P P) v),F.obj t.right.unop ⟶ M) (s) (t) : + block F s t ≫ blockDesc F f=f s t := by + dsimp only [block,blockDesc] + exact (Category.assoc _ _ _).trans + ((congrArg (fun g => CoefficientNerve.single F t ≫ g) + (CoefficientNerve.single_desc ((coeffComplex F).X v) + (fun s => CoefficientNerve.desc F (f s)) s)).trans + (CoefficientNerve.single_desc F (f s) t)) +noncomputable def totalBlock {h v n:ℕ} (hn:h+v=n) + (s:Simplex (SingleObj P) h) (t:Simplex (ActionCategory P P) v) : + F.obj t.right.unop ⟶ ((double F).total c).X n := + block F s t ≫ (double F).ιTotal c h v n hn +lemma totalBlock_hom_ext {n:ℕ} {M:A} {f g:((double F).total c).X n ⟶ M} + (hh:∀h v (hn:h+v=n) s t,totalBlock F hn s t ≫ f=totalBlock F hn s t ≫ g) : f=g := by + apply HomologicalComplex₂.total.hom_ext + intro h v hn + apply block_hom_ext + intro s t + exact (Category.assoc _ _ _).symm.trans ((hh h v hn s t).trans (Category.assoc _ _ _)) +noncomputable def totalBlockDesc {n:ℕ} {M:A} + (f:∀h v (_:h+v=n) (_:Simplex (SingleObj P) h) (t:Simplex (ActionCategory P P) v),F.obj t.right.unop ⟶ M) : + ((double F).total c).X n ⟶ M := + (double F).totalDesc (fun h v hn=>blockDesc F (f h v hn)) +@[reassoc (attr:=simp)] lemma totalBlock_desc {n:ℕ} {M:A} + (f:∀h v (_:h+v=n) (_:Simplex (SingleObj P) h) (t:Simplex (ActionCategory P P) v),F.obj t.right.unop ⟶ M) + (h v:ℕ) (hn:h+v=n) (s) (t) : + totalBlock F hn s t ≫ totalBlockDesc F f=f h v hn s t := by + dsimp only [totalBlock,totalBlockDesc] + rw [Category.assoc,HomologicalComplex₂.ι_totalDesc,block_desc] +end RegularCoefficient + +namespace RegularLabels +open FreeChains CoefficientNerve RegularCoordinates MonoidNerveCoordinates + +variable {P:Type} [CommMonoid P] (F:ActionCategory P P ⥤ A) +abbrev W (h v:ℕ) := (Fin v→P) × P × (Fin h→P) +abbrev fiber (p:P) : A := F.obj (ActionCategory.objEquiv P P p) +lemma rightEq {v:ℕ} (p:P) (y:Fin v→P) : + (lift p (ofLabels y)).right.unop = ActionCategory.objEquiv P P p := by + apply (ActionCategory.objEquiv P P).symm.injective + exact lift_right p (ofLabels y) +noncomputable def inj {h v:ℕ} (w:W (P:=P) h v) : + fiber F w.2.1 ⟶ ((RegularCoefficient.double F).X h).X v := + eqToHom (congrArg F.obj (rightEq w.2.1 w.1).symm) ≫ + RegularCoefficient.block F (ofLabels w.2.2) (lift w.2.1 (ofLabels w.1)) +noncomputable def desc {h v:ℕ} {M:A} (f:∀w:W (P:=P) h v,fiber F w.2.1 ⟶ M) : + ((RegularCoefficient.double F).X h).X v ⟶ M := + RegularCoefficient.blockDesc F (fun s t=> f (labels (t ⋙ (ActionCategory.π P P).op),t.right.unop.back,labels s)) +@[reassoc (attr:=simp)] lemma include_desc {h v:ℕ} {M:A} + (f:∀w:W (P:=P) h v,fiber F w.2.1 ⟶ M) (w:W (P:=P) h v) : + inj F w ≫ desc F f=f w := by + dsimp only [inj,desc] + erw [Category.assoc,RegularCoefficient.block_desc] + have hr:=lift_right w.2.1 (ofLabels w.1) + change eqToHom (congrArg (fiber F) hr.symm) ≫ + f (labels (lift w.2.1 (ofLabels w.1) ⋙ (ActionCategory.π P P).op), + (lift w.2.1 (ofLabels w.1)).right.unop.back,labels (ofLabels w.2.2)) = f w + rw [lift_project,labels_ofLabels,labels_ofLabels] + generalize (lift w.2.1 (ofLabels w.1)).right.unop.back = p at * + cases hr + simp +lemma hom_ext {h v:ℕ} {M:A} {f g:((RegularCoefficient.double F).X h).X v ⟶ M} + (hh:∀w:W (P:=P) h v,inj F w ≫ f=inj F w ≫ g) : f=g := by + apply RegularCoefficient.block_hom_ext + intro s t + obtain ⟨x,rfl⟩ := (MonoidNerveCoordinates.equiv P h).symm.surjective s + obtain ⟨⟨p,y⟩,rfl⟩ := (RegularCoordinates.coordinates v).symm.surjective t + obtain ⟨z,rfl⟩ := (MonoidNerveCoordinates.equiv P v).symm.surjective y + change RegularCoefficient.block F (ofLabels x) (lift p (ofLabels z)) ≫ f = + RegularCoefficient.block F (ofLabels x) (lift p (ofLabels z)) ≫ g + exact (cancel_epi (eqToHom (congrArg F.obj (rightEq p z).symm))).mp + (by simpa only [inj,Category.assoc] using hh (z,p,x)) +noncomputable def isColimit (h v:ℕ) : IsColimit (Cofan.mk _ (inj F (h:=h) (v:=v))) := + Cofan.IsColimit.mk _ (fun s=>desc F s.inj) (fun _ _=>include_desc F _ _) + (fun s _ hh=>hom_ext F (fun w=>(hh w).trans (include_desc F s.inj w).symm)) +end RegularLabels + +end + +namespace MarkedCoordinates +variable {P:Type} {n:ℕ} +abbrev Split (P:Type) (n:ℕ) := Σi:Fin (n+1),(Fin i.val→P) × P × (Fin (n-i.val)→P) +def word (i:Fin (n+1)) (y:Fin i.val→P) (p:P) (x:Fin (n-i.val)→P) : Fin (n+1)→P := + fun j=>if h:j.val < i.val then y ⟨j.val,h⟩ else + if h':j.val = i.val then p else x ⟨n-j.val,by omega⟩ +@[simp] lemma word_center (i:Fin (n+1)) (y:Fin i.val→P) (p:P) (x:Fin (n-i.val)→P) : + word i y p x i=p := by simp [word] +lemma word_left (i:Fin (n+1)) (y:Fin i.val→P) (p:P) (x:Fin (n-i.val)→P) (j:Fin i.val) : + word i y p x ⟨j.val,by omega⟩=y j := by simp [word,j.isLt] +lemma word_right (i:Fin (n+1)) (y:Fin i.val→P) (p:P) (x:Fin (n-i.val)→P) (j:Fin (n-i.val)) : + word i y p x ⟨n-j.val,by omega⟩=x j := by + simp only [word,dite_eq_right (show ¬n-j.val < i.val from by omega),dite_eq_right (show ¬n-j.val = i.val from by omega)] + congr 1 + apply Fin.ext + dsimp + omega +def vertical (w:Fin (n+1)→P) (i:Fin (n+1)) : Fin i.val→P := fun j=>w ⟨j.val,by omega⟩ +def horizontal (w:Fin (n+1)→P) (i:Fin (n+1)) : Fin (n-i.val)→P := fun j=>w ⟨n-j.val,by omega⟩ +lemma word_recover (w:Fin (n+1)→P) (i:Fin (n+1)) : word i (vertical w i) (w i) (horizontal w i)=w := by + funext j + dsimp only [word] + split_ifs with h h' + · rfl + · congr 1; exact Fin.ext h'.symm + · dsimp only [horizontal] + congr 1 + apply Fin.ext + dsimp + omega +lemma vertical_word (i:Fin (n+1)) (y:Fin i.val→P) (p:P) (x:Fin (n-i.val)→P) : + vertical (word i y p x) i=y := by funext j; exact word_left i y p x j +lemma horizontal_word (i:Fin (n+1)) (y:Fin i.val→P) (p:P) (x:Fin (n-i.val)→P) : + horizontal (word i y p x) i=x := by funext j; exact word_right i y p x j +noncomputable def equiv (P:Type) (n:ℕ) : Split P n ≃ (Σ_:Fin (n+1),(Fin (n+1)→P)) where + toFun s := ⟨s.1,word s.1 s.2.1 s.2.2.1 s.2.2.2⟩ + invFun s := ⟨s.1,vertical s.2 s.1,s.2 s.1,horizontal s.2 s.1⟩ + left_inv := by rintro ⟨i,y,p,x⟩; simp only [vertical_word,word_center,horizontal_word] + right_inv := by rintro ⟨i,w⟩; simp only [word_recover] +end MarkedCoordinates + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/RegularCoefficientDouble.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/RegularCoefficientDouble.lean new file mode 100644 index 0000000000000000000000000000000000000000..d473d7034d33a5de7a35928e495bdbade1316d2a --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/RegularCoefficientDouble.lean @@ -0,0 +1,150 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.TranslationCoefficientAction +import OAI.GroupTheory.SimpleAmenable.Simplicial.ConstantCoefficient +import OAI.GroupTheory.SimpleAmenable.Homology.GroupoidComponentHomology + +namespace OAI + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits Simplicial Opposite HomologicalComplex AlgebraicTopology +namespace RegularCoefficient +open CoefficientNerve FreeChains + +private lemma iso_transport_cancel {V : Type*} [Category V] {A B C D : V} + (a : A ≅ B) (b : C ≅ D) (f : A ⟶ C) (g : B ⟶ D) + (h : f = a.hom ≫ g ≫ b.inv) : f ≫ b.hom = a.hom ≫ g := by + rw [h] + simp only [Category.assoc, Iso.inv_hom_id, Category.comp_id] + +private lemma inverse_square_of_identity {V : Type*} [Category V] {X Y Z T : V} + (a : X ≅ Y) (b : X ≅ Z) (f : Y ⟶ Z) (g : X ⟶ T) + (h : 𝟙 X ≫ b.hom = a.hom ≫ f) : f ≫ b.inv ≫ g = a.inv ≫ g ≫ 𝟙 T := by + simp only [Category.id_comp] at h + apply (cancel_epi a.hom).mp + simp only [← Category.assoc, ← h, Iso.hom_inv_id, Category.id_comp, Category.comp_id] + +variable {P:Type} [CommMonoid P] (F:ActionCategory P P ⥤ A) +noncomputable def coeffComplex : ChainComplex (SingleObj P ⥤ A) ℕ := + ExactShapeHomology.complex (representation F ⋙ alternatingFaceMapComplex A) +noncomputable def evalHomology (n:ℕ) (p:SingleObj P) : + (CoefficientNerve.complex F).homology n ≅ ((coeffComplex F).homology n).obj p := + ExactShapeHomology.evaluationHomology (representation F ⋙ alternatingFaceMapComplex A) n p +lemma evalHomology_natural (n:ℕ) {p q:SingleObj P} (f:p⟶q) : + homologyMap (((representation F ⋙ alternatingFaceMapComplex A).map f)) n ≫ + (evalHomology F n q).hom = + (evalHomology F n p).hom ≫ ((coeffComplex F).homology n).map f := by + have h:=ShortComplex.homologyMap_mapNatTrans ((coeffComplex F).sc n) + ((evaluation (SingleObj P) A).map f) + change homologyMap (((representation F ⋙ alternatingFaceMapComplex A).map f)) n = + (evalHomology F n p).hom ≫ ((coeffComplex F).homology n).map f ≫ + (evalHomology F n q).inv at h + exact iso_transport_cancel _ _ _ _ h +noncomputable def homologyZeroIso : (coeffComplex F).homology 0 ≅ + constant (C:=SingleObj P) (colimit F) := + NatIso.ofComponents (fun p=>(evalHomology F 0 p).symm ≪≫ zeroIso F) (by + intro p q f + have h:=evalHomology_natural F 0 f + change homologyMap ((alternatingFaceMapComplex A).map (action F f)) 0 ≫ + (evalHomology F 0 q).hom = (evalHomology F 0 p).hom ≫ ((coeffComplex F).homology 0).map f at h + rw [homology_action_zero] at h + exact inverse_square_of_identity (evalHomology F 0 p) (evalHomology F 0 q) + _ (zeroIso F).hom h) + +lemma positive_isZero (n:ℕ) (hn:n≠0) : IsZero ((coeffComplex F).homology n) := by + apply Functor.isZero + intro p + exact IsZero.of_iso (positive_acyclic F n hn) (evalHomology F n p).symm +noncomputable def double : HomologicalComplex₂ A c c := CoefficientNerve.double (coeffComplex F) +noncomputable def rowZeroIso : TotalFiniteness.row (double F) 0 ≅ complex (constant (C:=SingleObj P) (colimit F)) := + CoefficientNerve.rowIso (coeffComplex F) 0 ≪≫ + (alternatingFaceMapComplex A).mapIso (CoefficientNerve.functor.mapIso (homologyZeroIso F)) +lemma row_positive_isZero (n q:ℕ) (hq:q≠0) : IsZero ((TotalFiniteness.row (double F) q).homology n) := by + apply IsZero.of_iso _ ((homologyFunctor A c n).mapIso (CoefficientNerve.rowIso (coeffComplex F) q)) + exact Functor.map_isZero (CoefficientNerve.functor ⋙ alternatingFaceMapComplex A ⋙ homologyFunctor A c n) + (positive_isZero F q hq) +lemma total_finite [Module.Finite ℤ (colimit F : A)] (n:ℕ) + (h:∀i,i≤n → Module.Finite ℤ ((nerve (SingleObj P)ᵒᵖ).homology Z i : A)) : + Module.Finite ℤ (((double F).total c).homology n) := by + apply TotalFiniteness.finite + intro p q hpq + by_cases hq:q=0 + · subst q + apply (Module.Finite.equiv_iff ((homologyFunctor A c p).mapIso (rowZeroIso F)).symm.toLinearEquiv).mp + exact constant_finite (C:=SingleObj P) (colimit F) p (fun i hi=>h i (by omega)) + · have :=ModuleCat.isZero_iff_subsingleton.mp (row_positive_isZero F p q hq) + infer_instance +end RegularCoefficient + +end + +open _root_.CategoryTheory _root_.OAI.CategoryTheory Simplicial Opposite +namespace RegularCoordinates +open CoefficientNerve RegularTranslation + +variable {P:Type} [CommMonoid P] +abbrev B (n:ℕ) := Simplex (SingleObj P) n +lemma opposite_eqToHom_val {x y:Opposite (C (P:=P))} (h:x=y) : (eqToHom h).unop.hom=(1:P) := by subst y; rfl +lemma single_eqToHom_val {x y:Opposite (SingleObj P)} (h:x=y) : (eqToHom h).unop=(1:P) := by subst y; rfl +noncomputable def lift {n:ℕ} (p:P) (s:B (P:=P) n) : Simplex (C (P:=P)) n where + obj i := op ((ActionCategory.objEquiv P P) ((s.map (homOfLE (Fin.le_last i))).unop * p)) + map {i j} f := (show ((ActionCategory.objEquiv P P) ((s.map (homOfLE (Fin.le_last j))).unop * p)) ⟶ + ((ActionCategory.objEquiv P P) ((s.map (homOfLE (Fin.le_last i))).unop * p)) from + ⟨(s.map f).unop,by + change (s.map f).unop * ((s.map (homOfLE (Fin.le_last j))).unop * p)=_ + rw [←mul_assoc] + have h:=congrArg Quiver.Hom.unop (s.map_comp f (homOfLE (Fin.le_last j))) + change (s.map (f ≫ homOfLE (Fin.le_last j))).unop= + (s.map f).unop * (s.map (homOfLE (Fin.le_last j))).unop at h + rw [←h] + rfl⟩).op + map_id i := by apply Quiver.Hom.unop_inj; apply Functor.Elements.hom_ext; exact congrArg Quiver.Hom.unop (s.map_id i) + map_comp f g := by apply Quiver.Hom.unop_inj; apply Functor.Elements.hom_ext; exact congrArg Quiver.Hom.unop (s.map_comp f g) +lemma lift_right {n:ℕ} (p:P) (s:B (P:=P) n) : (lift p s).right.unop.back=p := by + change (s.map (𝟙 _)).unop * p=p + rw [s.map_id] + exact one_mul _ +lemma lift_project {n:ℕ} (p:P) (s:B (P:=P) n) : lift p s ⋙ (ActionCategory.π P P).op=s := by + apply CategoryTheory.Functor.ext + · intro i j f + apply Quiver.Hom.unop_inj + simp only [unop_comp,single_eqToHom_val,SingleObj.comp_as_mul,one_mul,mul_one] + rfl + · intro i; exact Subsingleton.elim _ _ +lemma lift_recover {n:ℕ} (s:Simplex (C (P:=P)) n) : + lift s.right.unop.back (s ⋙ (ActionCategory.π P P).op)=s := by + apply CategoryTheory.Functor.ext + · intro i j f + apply Quiver.Hom.unop_inj + apply Functor.Elements.hom_ext + simp only [unop_comp,ActionCategory.comp_hom,opposite_eqToHom_val,one_mul,mul_one] + rfl + · intro i + apply unop_injective + apply (ActionCategory.objEquiv P P).symm.injective + exact (s.map (homOfLE (Fin.le_last i))).unop.map_val +noncomputable def coordinates (n:ℕ) : Simplex (C (P:=P)) n ≃ P × B (P:=P) n where + toFun s := (s.right.unop.back,s ⋙ (ActionCategory.π P P).op) + invFun x := lift x.1 x.2 + left_inv := lift_recover + right_inv x := Prod.ext (lift_right x.1 x.2) (lift_project x.1 x.2) +lemma shift_right {n:ℕ} (q:P) (s:Simplex (C (P:=P)) n) : + (ComposableArrows.right (s ⋙ (shift q).op)).unop.back=q*s.right.unop.back := rfl +lemma shift_project {n:ℕ} (q:P) (s:Simplex (C (P:=P)) n) : + (s ⋙ (shift q).op) ⋙ (ActionCategory.π P P).op = s ⋙ (ActionCategory.π P P).op := by + apply CategoryTheory.Functor.ext + · intro i j f + apply Quiver.Hom.unop_inj + simp only [unop_comp,single_eqToHom_val,SingleObj.comp_as_mul,one_mul,mul_one] + rfl + · intro i; exact Subsingleton.elim _ _ +lemma shift_lift {n:ℕ} (q p:P) (s:B (P:=P) n) : + lift p s ⋙ (shift q).op=lift (q*p) s := by + apply (coordinates n).injective + apply Prod.ext + · change (ComposableArrows.right (lift p s ⋙ (shift q).op)).unop.back=(lift (q*p) s).right.unop.back + rw [shift_right,lift_right,lift_right] + · change (lift p s ⋙ (shift q).op) ⋙ (ActionCategory.π P P).op=lift (q*p) s ⋙ (ActionCategory.π P P).op + rw [shift_project,lift_project,lift_project] +end RegularCoordinates + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/RegularLiftFaces.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/RegularLiftFaces.lean new file mode 100644 index 0000000000000000000000000000000000000000..14139926fdf838b70a259f88fc7ea6e3eae5543f --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/RegularLiftFaces.lean @@ -0,0 +1,80 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.RegularBlock +import OAI.GroupTheory.SimpleAmenable.Simplicial.MonoidFaceLabels + +namespace OAI + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits Simplicial SimplicialObject Opposite +namespace RegularCoordinates +open CoefficientNerve MonoidNerveCoordinates + +variable {P:Type} [CommMonoid P] +lemma trunc_lift {m n:ℕ} (f:⦋m⦌⟶⦋n⦌) (p:P) (s:B (P:=P) n) : + trunc f (lift p s)=lift (tail f s * p) (trunc f s) := by + apply (coordinates m).injective + apply Prod.ext + · change (trunc f (lift p s)).right.unop.back=(lift _ _).right.unop.back + rw [lift_right] + rfl + · change trunc f (lift p s) ⋙ (ActionCategory.π P P).op=lift _ _ ⋙ (ActionCategory.π P P).op + rw [lift_project] + change (SimplexCategory.toCat.map f).toFunctor ⋙ (lift p s ⋙ (ActionCategory.π P P).op)=_ + erw [lift_project] + rfl +noncomputable def arrow (a p:P) : ActionCategory.objEquiv P P p ⟶ ActionCategory.objEquiv P P (a*p) := ⟨a,rfl⟩ +lemma arrow_one (p:P) : arrow (1:P) p=eqToHom (congrArg (ActionCategory.objEquiv P P) (one_mul p).symm) := by + apply Functor.Elements.Hom.ext + exact (RegularTranslation.eqToHom_val _).symm +end RegularCoordinates +namespace RegularLabels +open CoefficientNerve RegularCoordinates MonoidNerveCoordinates + +variable {P:Type} [CommMonoid P] (F:ActionCategory P P ⥤ FreeChains.A) +noncomputable def singleLabel {n:ℕ} (p:P) (y:Fin n→P) : fiber F p ⟶ Obj F n := + eqToHom (congrArg F.obj (rightEq p y).symm) ≫ single F (lift p (ofLabels y)) +lemma singleLabel_map_general {m n:ℕ} (f:⦋m⦌⟶⦋n⦌) (p:P) (y:Fin n→P) : + singleLabel F p y ≫ map F f = + F.map (arrow (tail f (ofLabels y)) p) ≫ + singleLabel F (tail f (ofLabels y)*p) (labels (trunc f (ofLabels y))) := by + dsimp only [singleLabel] + rw [←eqToHom_map F (rightEq p y).symm, + ←eqToHom_map F (rightEq (tail f (ofLabels y)*p) (labels (trunc f (ofLabels y)))).symm] + simp only [Category.assoc,single_map,←F.map_comp_assoc] + apply weighted_eq F (by rw [trunc_lift,ofLabels_labels]) + apply Functor.Elements.Hom.ext + simp only [ActionCategory.comp_hom,RegularTranslation.eqToHom_val,one_mul,mul_one] + rfl +noncomputable def faceWeight {n:ℕ} (k:Fin (n+2)) (y:Fin (n+1)→P) : P := + if k=Fin.last (n+1) then y (Fin.last n) else 1 +lemma tail_face {n:ℕ} (k:Fin (n+2)) (y:Fin (n+1)→P) : + tail (SimplexCategory.δ k) (ofLabels y)=faceWeight k y := by + dsimp only [faceWeight] + split_ifs with h + · subst k + exact (tail_face_last_val (ofLabels y)).trans (congrFun (labels_ofLabels y) (Fin.last n)) + · exact tail_face_val (ofLabels y) k h +@[reassoc] lemma singleLabel_face {n:ℕ} (k:Fin (n+2)) (p:P) (y:Fin (n+1)→P) : + singleLabel F p y ≫ (simplicial F).δ k = + F.map (arrow (faceWeight k y) p) ≫ + singleLabel F (faceWeight k y*p) (faceLabels k y) := by + change singleLabel F p y ≫ map F (SimplexCategory.δ k)=_ + rw [singleLabel_map_general,tail_face] + congr 2 + exact (labels_face (ofLabels y) k).trans (congrArg (faceLabels k) (labels_ofLabels y)) +@[reassoc] lemma singleLabel_action (a p:P) {n:ℕ} (y:Fin n→P) : + singleLabel F p y ≫ (RegularCoefficient.action F a).app (op ⦋n⦌) = + F.map (arrow a p) ≫ singleLabel F (a*p) y := by + dsimp only [singleLabel] + rw [←eqToHom_map F (rightEq p y).symm,←eqToHom_map F (rightEq (a*p) y).symm] + erw [Category.assoc,RegularCoefficient.single_action] + erw [←F.map_comp_assoc,←F.map_comp_assoc] + apply weighted_eq F (shift_lift a p (ofLabels y)) + apply Functor.Elements.Hom.ext + simp only [ActionCategory.comp_hom,RegularTranslation.eqToHom_val,one_mul,mul_one] + rfl +end RegularLabels + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/RegularTotalDifferential.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/RegularTotalDifferential.lean new file mode 100644 index 0000000000000000000000000000000000000000..5e030952948c87602dbcb54880bbb81f44dd7f16 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/RegularTotalDifferential.lean @@ -0,0 +1,241 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.DoubleCoordinates +import OAI.GroupTheory.SimpleAmenable.Homology.RegularLiftFaces +import OAI.GroupTheory.SimpleAmenable.Simplicial.RegularBlockFaces + +namespace OAI + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits Simplicial Opposite HomologicalComplex AlgebraicTopology +namespace RegularLabels +open FreeChains RegularCoordinates MonoidNerveCoordinates + +variable {P:Type} [CommMonoid P] (F:ActionCategory P P ⥤ A) +@[reassoc] lemma totalInj_d_parts {n:ℕ} (s:DoubleCoordinates.Index P (n+1)) : + totalInj F s ≫ ((RegularCoefficient.double F).total c).d (n+1) n = + inj F s.2 ≫ (RegularCoefficient.double F).d₁ c s.1.val.1 s.1.val.2 n + + inj F s.2 ≫ (RegularCoefficient.double F).d₂ c s.1.val.1 s.1.val.2 n := by + dsimp only [totalInj] + rw [Category.assoc,HomologicalComplex₂.total_d,Preadditive.comp_add, + HomologicalComplex₂.ι_D₁,HomologicalComplex₂.ι_D₂,Preadditive.comp_add] +@[reassoc] lemma totalInj_d_hor (h:ℕ) (y:Fin 0→P) (p:P) (x:Fin (h+1)→P) : + totalInj F ⟨⟨(h+1,0),rfl⟩,y,p,x⟩ ≫ ((RegularCoefficient.double F).total c).d (h+1) h = + ∑k:Fin (h+2),(-1:ℤ)^k.val • (F.map (arrow (faceWeight k x) p) ≫ + totalInj F ⟨⟨(h,0),rfl⟩,y,faceWeight k x*p,faceLabels k x⟩) := by + rw [totalInj_d_parts] + rw [HomologicalComplex₂.d₂_eq_zero _ _ _ _ _ (by simp)] + rw [HomologicalComplex₂.d₁_eq _ _ (show c.Rel (h+1) h from rfl) 0 h rfl] + simp only [comp_zero,add_zero,show c.ε₁ c c (h+1,0) = 1 from rfl,one_smul] + change inj F (y,p,x) ≫ ((RegularCoefficient.double F).d (h+1) h).f 0 ≫ + (RegularCoefficient.double F).ιTotal c h 0 h rfl = _ + rw [inj_dH_assoc] + simp only [Preadditive.sum_comp,Preadditive.zsmul_comp,Category.assoc,totalInj] + rfl +@[reassoc] lemma totalInj_d_ver (v:ℕ) (y:Fin (v+1)→P) (p:P) (x:Fin 0→P) : + totalInj F ⟨⟨(0,v+1),by omega⟩,y,p,x⟩ ≫ ((RegularCoefficient.double F).total c).d (v+1) v = + ∑k:Fin (v+2),(-1:ℤ)^k.val • (F.map (arrow (faceWeight k y) p) ≫ + totalInj F ⟨⟨(0,v),by omega⟩,faceLabels k y,faceWeight k y*p,x⟩) := by + rw [totalInj_d_parts] + rw [HomologicalComplex₂.d₁_eq_zero _ _ _ _ _ (by simp)] + rw [HomologicalComplex₂.d₂_eq _ _ 0 (show c.Rel (v+1) v from rfl) v (by change 0+v=v; omega)] + simp only [comp_zero,zero_add,show c.ε₂ c c (0,v+1) = 1 from rfl,one_smul] + change inj F (y,p,x) ≫ ((RegularCoefficient.double F).X 0).d (v+1) v ≫ + (RegularCoefficient.double F).ιTotal c 0 v v (by change 0+v=v; omega) = _ + rw [inj_dV_assoc] + simp only [Preadditive.sum_comp,Preadditive.zsmul_comp,Category.assoc,totalInj] +@[reassoc] lemma totalInj_d_both (h v:ℕ) (y:Fin (v+1)→P) (p:P) (x:Fin (h+1)→P) : + totalInj F ⟨⟨(h+1,v+1),by omega⟩,y,p,x⟩ ≫ + ((RegularCoefficient.double F).total c).d (h+v+2) (h+v+1) = + (∑k:Fin (h+2),(-1:ℤ)^k.val • (F.map (arrow (faceWeight k x) p) ≫ + totalInj F ⟨⟨(h,v+1),by omega⟩,y,faceWeight k x*p,faceLabels k x⟩)) + + (-1:ℤ)^(h+1) • (∑k:Fin (v+2),(-1:ℤ)^k.val • (F.map (arrow (faceWeight k y) p) ≫ + totalInj F ⟨⟨(h+1,v),by omega⟩,faceLabels k y,faceWeight k y*p,x⟩)) := by + rw [totalInj_d_parts] + rw [HomologicalComplex₂.d₁_eq _ _ (show c.Rel (h+1) h from rfl) (v+1) (h+v+1) (by change h+(v+1)=h+v+1; omega)] + rw [HomologicalComplex₂.d₂_eq _ _ (h+1) (show c.Rel (v+1) v from rfl) (h+v+1) (by change (h+1)+v=h+v+1; omega)] + simp only [show c.ε₁ c c (h+1,v+1) = 1 from rfl,one_smul] + change inj F (y,p,x) ≫ ((RegularCoefficient.double F).d (h+1) h).f (v+1) ≫ + (RegularCoefficient.double F).ιTotal c h (v+1) (h+v+1) (by change h+(v+1)=h+v+1; omega) + + inj F (y,p,x) ≫ ((ComplexShape.ε₂ c c c (h+1,v+1)) • + (((RegularCoefficient.double F).X (h+1)).d (v+1) v ≫ + (RegularCoefficient.double F).ιTotal c (h+1) v (h+v+1) (by change (h+1)+v=h+v+1; omega))) = _ + rw [Units.smul_def] + change _ + inj F (y,p,x) ≫ ((-1:ℤ)^(h+1) • _) = _ + rw [Preadditive.comp_zsmul,inj_dH_assoc,inj_dV_assoc] + simp only [Preadditive.sum_comp,Preadditive.zsmul_comp,Category.assoc,totalInj] +end RegularLabels + +end + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits Simplicial Opposite HomologicalComplex AlgebraicTopology +namespace RegularLabels +open FreeChains RegularCoordinates MonoidNerveCoordinates + +variable {P:Type} [CommMonoid P] (F:ActionCategory P P ⥤ A) +lemma totalInj_transport {h v n:ℕ} (hn:h+v=n) (y:Fin v→P) (x:Fin h→P) {p q:P} (e:p=q) : + eqToHom (congrArg (fiber F) e) ≫ totalInj F ⟨⟨(h,v),hn⟩,y,q,x⟩ = + totalInj F ⟨⟨(h,v),hn⟩,y,p,x⟩ := by + subst q + simp +@[reassoc] lemma one_totalInj {h v n:ℕ} (hn:h+v=n) (y:Fin v→P) (p:P) (x:Fin h→P) : + F.map (arrow 1 p) ≫ totalInj F ⟨⟨(h,v),hn⟩,y,1*p,x⟩ = + totalInj F ⟨⟨(h,v),hn⟩,y,p,x⟩ := by + rw [arrow_one,eqToHom_map] + exact totalInj_transport F hn y x (one_mul p).symm +end RegularLabels +namespace RegularFiniteFaces +open RegularLabels RegularCoordinates MonoidNerveCoordinates +variable {P:Type} [CommMonoid P] +@[simp] lemma labels1_0 (a:P) : faceLabels (0:Fin 2) ![a]=![] := by + funext j + fin_cases j +@[simp] lemma weight1_0 (a:P) : faceWeight (0:Fin 2) ![a]=1 := by + simp [faceWeight] +@[simp] lemma labels1_1 (a:P) : faceLabels (1:Fin 2) ![a]=![] := by + funext j + fin_cases j +@[simp] lemma weight1_1 (a:P) : faceWeight (1:Fin 2) ![a]=a := by + simp [faceWeight] +@[simp] lemma labels2_0 (a b:P) : faceLabels (0:Fin 3) ![a,b]=![b] := by + funext j + fin_cases j + rfl +@[simp] lemma weight2_0 (a b:P) : faceWeight (0:Fin 3) ![a,b]=1 := by + simp [faceWeight] +@[simp] lemma labels2_1 (a b:P) : faceLabels (1:Fin 3) ![a,b]=![(a*b)] := by + funext j + fin_cases j + rfl +@[simp] lemma weight2_1 (a b:P) : faceWeight (1:Fin 3) ![a,b]=1 := by + simp [faceWeight] +@[simp] lemma labels2_2 (a b:P) : faceLabels (2:Fin 3) ![a,b]=![a] := by + funext j + fin_cases j + rfl +@[simp] lemma weight2_2 (a b:P) : faceWeight (2:Fin 3) ![a,b]=b := by + simp [faceWeight] +@[simp] lemma labels3_0 (a b d:P) : faceLabels (0:Fin 4) ![a,b,d]=![b,d] := by + funext j + fin_cases j <;> rfl +@[simp] lemma weight3_0 (a b d:P) : faceWeight (0:Fin 4) ![a,b,d]=1 := by + simp [faceWeight] +@[simp] lemma labels3_1 (a b d:P) : faceLabels (1:Fin 4) ![a,b,d]=![(a*b),d] := by + funext j + fin_cases j <;> rfl +@[simp] lemma weight3_1 (a b d:P) : faceWeight (1:Fin 4) ![a,b,d]=1 := by + simp [faceWeight] +@[simp] lemma labels3_2 (a b d:P) : faceLabels (2:Fin 4) ![a,b,d]=![a,(b*d)] := by + funext j + fin_cases j <;> rfl +@[simp] lemma weight3_2 (a b d:P) : faceWeight (2:Fin 4) ![a,b,d]=1 := by + simp [faceWeight] +@[simp] lemma labels3_3 (a b d:P) : faceLabels (3:Fin 4) ![a,b,d]=![a,b] := by + funext j + fin_cases j <;> rfl +@[simp] lemma weight3_3 (a b d:P) : faceWeight (3:Fin 4) ![a,b,d]=d := by + simp [faceWeight] +end RegularFiniteFaces + +end + +section + +namespace FilteredEdge +open FilteredFiniteness + +universe u +variable {R : Type u} [CommRing R] [IsNoetherianRing R] +variable {D A B C : Type u} [AddCommGroup D] [Module R D] + [AddCommGroup A] [Module R A] [AddCommGroup B] [Module R B] + [AddCommGroup C] [Module R C] +structure Data where + s : D →ₗ[R] A + d : A →ₗ[R] B + e : B →ₗ[R] C + ds : d.comp s = 0 + ed : e.comp d = 0 + FD : ℤ → Submodule R D + FA : ℤ → Submodule R A + FB : ℤ → Submodule R B + FC : ℤ → Submodule R C + monoA : Monotone FA + monoB : Monotone FB +namespace Data +variable (K : Data (R:=R) (D:=D) (A:=A) (B:=B) (C:=C)) +def current : FilteredFiniteness.Data (R:=R) (A:=A) (B:=B) (C:=C) := + ⟨K.d,K.e,K.ed,K.FA,K.FB,K.FC,K.monoB⟩ +def previous : FilteredFiniteness.Data (R:=R) (A:=D) (B:=A) (C:=B) := + ⟨K.s,K.d,K.ds,K.FD,K.FA,K.FB,K.monoA⟩ +variable (p : ℤ) +def inputs (k : ℤ) : Submodule R A := K.FA k ⊓ (K.FB p).comap K.d +def boundaryCycle (k : ℤ) : K.inputs p k →ₗ[R] K.current.Z₂ p := + (K.d.comp (K.inputs p k).subtype).codRestrict _ (fun x => by + refine ⟨x.property.2,?_⟩ + change K.e (K.d x.val) ∈ K.FC (p-2) + have he : K.e (K.d x.val)=0 := congrArg (fun f : A →ₗ[R] C => f x.val) K.ed + rw [he]; exact Submodule.zero_mem _) +def boundaryMap (k : ℤ) : K.inputs p k →ₗ[R] K.current.E₂ p := + ((K.current.B₂ p).comap (K.current.Z₂ p).subtype).mkQ.comp (K.boundaryCycle p k) +def tower (k : ℤ) : Submodule R (K.current.E₂ p) := LinearMap.range (K.boundaryMap p k) +omit [IsNoetherianRing R] in +lemma tower_mono : Monotone (K.tower p) := by + intro k l hkl y hy + obtain ⟨x,rfl⟩ := hy + exact ⟨⟨x.val, K.monoA hkl x.property.1,x.property.2⟩,rfl⟩ +omit [IsNoetherianRing R] in +lemma tower_start : K.tower p (p+1)=⊥ := by + apply le_antisymm _ bot_le + rintro y ⟨x,rfl⟩ + apply (Submodule.mem_bot R).mpr + apply (Submodule.Quotient.mk_eq_zero _).mpr + change K.d x.val∈K.current.B₂ p + exact (show (K.FA (p+1)).map K.d ⊓ K.FB p ≤ K.current.B₂ p from le_sup_right) + ⟨⟨x.val,x.property.1,rfl⟩,x.property.2⟩ +def inputLeading (k : ℤ) (hk : p≤k-2) : K.inputs p k →ₗ[R] K.previous.E₂ k := + ((K.previous.B₂ k).comap (K.previous.Z₂ k).subtype).mkQ.comp + (((K.inputs p k).subtype).codRestrict _ (fun x => + ⟨x.property.1,K.monoB hk x.property.2⟩)) +omit [IsNoetherianRing R] in +lemma lower_of_leading_zero (k : ℤ) (hk : p≤k-2) (x : K.inputs p k) + (hx : K.inputLeading p k hk x=0) : + K.boundaryMap p k x∈K.tower p (k-1) := by + have hx' : x.val∈K.previous.B₂ k := (Submodule.Quotient.mk_eq_zero ((K.previous.B₂ k).comap (K.previous.Z₂ k).subtype)).mp hx + obtain ⟨y,hy,z,hz,hyz⟩ := Submodule.mem_sup.mp hx' + obtain ⟨w,hw,hwz⟩ := hz.1 + have hd : K.d z = 0 := by + rw [←hwz] + exact congrArg (fun f : D →ₗ[R] B => f w) K.ds + have hxy : K.d y=K.d x.val := by + rw [←hyz,map_add,hd,add_zero] + refine ⟨⟨y,hy.1,?_⟩,?_⟩ + · change K.d y∈K.FB p + rw [hxy]; exact x.property.2 + · change Submodule.Quotient.mk _ = Submodule.Quotient.mk _ + congr 1 + apply Subtype.ext + exact hxy +lemma finite_tower_step (k : ℤ) (hk : p≤k-2) + [Module.Finite R (K.tower p (k-1))] + [Module.Finite R (K.previous.E₂ k)] : Module.Finite R (K.tower p k) := by + let S : Submodule R (K.tower p k) := (K.tower p (k-1)).submoduleOf (K.tower p k) + have : Module.Finite R S := Module.Finite.equiv + (Submodule.submoduleOfEquivOfLe (K.tower_mono p (by omega : k-1≤k))).symm + let f : K.inputs p k →ₗ[R] K.tower p k ⧸ S := + S.mkQ.comp (K.boundaryMap p k).rangeRestrict + have hf : Function.Surjective f := (Submodule.mkQ_surjective S).comp + (by rintro ⟨y,x,rfl⟩; exact ⟨x,rfl⟩) + have hker : LinearMap.ker (K.inputLeading p k hk) ≤ LinearMap.ker f := by + intro x hx + change f x=0 + apply (Submodule.Quotient.mk_eq_zero S).mpr + exact K.lower_of_leading_zero p k hk x hx + have : Module.Finite R (K.tower p k ⧸ S) := + finite_of_ker_le f (K.inputLeading p k hk) hf hker + exact Module.Finite.of_submodule_quotient S +end Data +end FilteredEdge + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/RegularTotalFiniteDifferentials.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/RegularTotalFiniteDifferentials.lean new file mode 100644 index 0000000000000000000000000000000000000000..585f061389c4fa4ab25f32dbbe37e549e8cb7934 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/RegularTotalFiniteDifferentials.lean @@ -0,0 +1,163 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.RegularTotalDifferential + +namespace OAI + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits Simplicial Opposite HomologicalComplex AlgebraicTopology +namespace RegularLabels +open FreeChains RegularCoordinates MonoidNerveCoordinates RegularFiniteFaces + +variable {P:Type} [CommMonoid P] (F:ActionCategory P P ⥤ A) +@[reassoc] lemma block_d01 (a b:P) : + totalInj F ⟨⟨(0,1),rfl⟩,![a],b,![]⟩ ≫ ((RegularCoefficient.double F).total c).d 1 0 = + (totalInj F ⟨⟨(0,0),rfl⟩,![],b,![]⟩) + -(F.map (arrow a b) ≫ totalInj F ⟨⟨(0,0),rfl⟩,![],(a*b),![]⟩) := by + rw [totalInj_d_ver] + simp only [Fin.sum_univ_succ,Fin.sum_univ_zero] + norm_num + try erw [labels1_0 a] + try erw [labels1_1 a] + try erw [weight1_0 a] + try erw [weight1_1 a] + try erw [one_totalInj F (h:=0) (v:=0) rfl ![] b ![]] + try abel +@[reassoc] lemma block_d10 (a b:P) : + totalInj F ⟨⟨(1,0),rfl⟩,![],a,![b]⟩ ≫ ((RegularCoefficient.double F).total c).d 1 0 = + (totalInj F ⟨⟨(0,0),rfl⟩,![],a,![]⟩) + -(F.map (arrow b a) ≫ totalInj F ⟨⟨(0,0),rfl⟩,![],(b*a),![]⟩) := by + rw [totalInj_d_hor] + simp only [Fin.sum_univ_succ,Fin.sum_univ_zero] + norm_num + try erw [labels1_0 b] + try erw [labels1_1 b] + try erw [weight1_0 b] + try erw [weight1_1 b] + try erw [one_totalInj F (h:=0) (v:=0) rfl ![] a ![]] + try abel +@[reassoc] lemma block_d02 (a b d:P) : + totalInj F ⟨⟨(0,2),rfl⟩,![a,b],d,![]⟩ ≫ ((RegularCoefficient.double F).total c).d 2 1 = + (totalInj F ⟨⟨(0,1),rfl⟩,![b],d,![]⟩) + -(totalInj F ⟨⟨(0,1),rfl⟩,![(a*b)],d,![]⟩) + (F.map (arrow b d) ≫ totalInj F ⟨⟨(0,1),rfl⟩,![a],(b*d),![]⟩) := by + rw [totalInj_d_ver] + simp only [Fin.sum_univ_succ,Fin.sum_univ_zero] + norm_num + try erw [labels2_0 a b] + try erw [labels2_1 a b] + try erw [labels2_2 a b] + try erw [weight2_0 a b] + try erw [weight2_1 a b] + try erw [weight2_2 a b] + try erw [one_totalInj F (h:=0) (v:=1) rfl ![b] d ![]] + try erw [one_totalInj F (h:=0) (v:=1) rfl ![(a*b)] d ![]] + try abel +@[reassoc] lemma block_d11 (a b d:P) : + totalInj F ⟨⟨(1,1),rfl⟩,![a],b,![d]⟩ ≫ ((RegularCoefficient.double F).total c).d 2 1 = + (totalInj F ⟨⟨(0,1),rfl⟩,![a],b,![]⟩) + -(F.map (arrow d b) ≫ totalInj F ⟨⟨(0,1),rfl⟩,![a],(d*b),![]⟩) + -(totalInj F ⟨⟨(1,0),rfl⟩,![],b,![d]⟩) + (F.map (arrow a b) ≫ totalInj F ⟨⟨(1,0),rfl⟩,![],(a*b),![d]⟩) := by + rw [totalInj_d_both] + simp only [Fin.sum_univ_succ,Fin.sum_univ_zero] + norm_num + try erw [labels1_0 d] + try erw [labels1_1 d] + try erw [labels1_0 a] + try erw [labels1_1 a] + try erw [weight1_0 d] + try erw [weight1_1 d] + try erw [weight1_0 a] + try erw [weight1_1 a] + try erw [one_totalInj F (h:=0) (v:=1) rfl ![a] b ![]] + try erw [one_totalInj F (h:=1) (v:=0) rfl ![] b ![d]] + try abel +@[reassoc] lemma block_d20 (a b d:P) : + totalInj F ⟨⟨(2,0),rfl⟩,![],a,![b,d]⟩ ≫ ((RegularCoefficient.double F).total c).d 2 1 = + (totalInj F ⟨⟨(1,0),rfl⟩,![],a,![d]⟩) + -(totalInj F ⟨⟨(1,0),rfl⟩,![],a,![(b*d)]⟩) + (F.map (arrow d a) ≫ totalInj F ⟨⟨(1,0),rfl⟩,![],(d*a),![b]⟩) := by + rw [totalInj_d_hor] + simp only [Fin.sum_univ_succ,Fin.sum_univ_zero] + norm_num + try erw [labels2_0 b d] + try erw [labels2_1 b d] + try erw [labels2_2 b d] + try erw [weight2_0 b d] + try erw [weight2_1 b d] + try erw [weight2_2 b d] + try erw [one_totalInj F (h:=1) (v:=0) rfl ![] a ![d]] + try erw [one_totalInj F (h:=1) (v:=0) rfl ![] a ![(b*d)]] + try abel +@[reassoc] lemma block_d03 (a b d e:P) : + totalInj F ⟨⟨(0,3),rfl⟩,![a,b,d],e,![]⟩ ≫ ((RegularCoefficient.double F).total c).d 3 2 = + (totalInj F ⟨⟨(0,2),rfl⟩,![b,d],e,![]⟩) + -(totalInj F ⟨⟨(0,2),rfl⟩,![(a*b),d],e,![]⟩) + (totalInj F ⟨⟨(0,2),rfl⟩,![a,(b*d)],e,![]⟩) + -(F.map (arrow d e) ≫ totalInj F ⟨⟨(0,2),rfl⟩,![a,b],(d*e),![]⟩) := by + rw [totalInj_d_ver] + simp only [Fin.sum_univ_succ,Fin.sum_univ_zero] + norm_num + try erw [labels3_0 a b d] + try erw [labels3_1 a b d] + try erw [labels3_2 a b d] + try erw [labels3_3 a b d] + try erw [weight3_0 a b d] + try erw [weight3_1 a b d] + try erw [weight3_2 a b d] + try erw [weight3_3 a b d] + try erw [one_totalInj F (h:=0) (v:=2) rfl ![b,d] e ![]] + try erw [one_totalInj F (h:=0) (v:=2) rfl ![(a*b),d] e ![]] + try erw [one_totalInj F (h:=0) (v:=2) rfl ![a,(b*d)] e ![]] + try abel +@[reassoc] lemma block_d12 (a b d e:P) : + totalInj F ⟨⟨(1,2),rfl⟩,![a,b],d,![e]⟩ ≫ ((RegularCoefficient.double F).total c).d 3 2 = + (totalInj F ⟨⟨(0,2),rfl⟩,![a,b],d,![]⟩) + -(F.map (arrow e d) ≫ totalInj F ⟨⟨(0,2),rfl⟩,![a,b],(e*d),![]⟩) + -(totalInj F ⟨⟨(1,1),rfl⟩,![b],d,![e]⟩) + (totalInj F ⟨⟨(1,1),rfl⟩,![(a*b)],d,![e]⟩) + -(F.map (arrow b d) ≫ totalInj F ⟨⟨(1,1),rfl⟩,![a],(b*d),![e]⟩) := by + rw [totalInj_d_both] + simp only [Fin.sum_univ_succ,Fin.sum_univ_zero] + norm_num + try erw [labels1_0 e] + try erw [labels1_1 e] + try erw [labels2_0 a b] + try erw [labels2_1 a b] + try erw [labels2_2 a b] + try erw [weight1_0 e] + try erw [weight1_1 e] + try erw [weight2_0 a b] + try erw [weight2_1 a b] + try erw [weight2_2 a b] + try erw [one_totalInj F (h:=0) (v:=2) rfl ![a,b] d ![]] + try erw [one_totalInj F (h:=1) (v:=1) rfl ![b] d ![e]] + try erw [one_totalInj F (h:=1) (v:=1) rfl ![(a*b)] d ![e]] + try abel +@[reassoc] lemma block_d21 (a b d e:P) : + totalInj F ⟨⟨(2,1),rfl⟩,![a],b,![d,e]⟩ ≫ ((RegularCoefficient.double F).total c).d 3 2 = + (totalInj F ⟨⟨(1,1),rfl⟩,![a],b,![e]⟩) + -(totalInj F ⟨⟨(1,1),rfl⟩,![a],b,![(d*e)]⟩) + (F.map (arrow e b) ≫ totalInj F ⟨⟨(1,1),rfl⟩,![a],(e*b),![d]⟩) + (totalInj F ⟨⟨(2,0),rfl⟩,![],b,![d,e]⟩) + -(F.map (arrow a b) ≫ totalInj F ⟨⟨(2,0),rfl⟩,![],(a*b),![d,e]⟩) := by + rw [totalInj_d_both] + simp only [Fin.sum_univ_succ,Fin.sum_univ_zero] + norm_num + try erw [labels2_0 d e] + try erw [labels2_1 d e] + try erw [labels2_2 d e] + try erw [labels1_0 a] + try erw [labels1_1 a] + try erw [weight2_0 d e] + try erw [weight2_1 d e] + try erw [weight2_2 d e] + try erw [weight1_0 a] + try erw [weight1_1 a] + try erw [one_totalInj F (h:=1) (v:=1) rfl ![a] b ![e]] + try erw [one_totalInj F (h:=1) (v:=1) rfl ![a] b ![(d*e)]] + try erw [one_totalInj F (h:=2) (v:=0) rfl ![] b ![d,e]] + try abel +@[reassoc] lemma block_d30 (a b d e:P) : + totalInj F ⟨⟨(3,0),rfl⟩,![],a,![b,d,e]⟩ ≫ ((RegularCoefficient.double F).total c).d 3 2 = + (totalInj F ⟨⟨(2,0),rfl⟩,![],a,![d,e]⟩) + -(totalInj F ⟨⟨(2,0),rfl⟩,![],a,![(b*d),e]⟩) + (totalInj F ⟨⟨(2,0),rfl⟩,![],a,![b,(d*e)]⟩) + -(F.map (arrow e a) ≫ totalInj F ⟨⟨(2,0),rfl⟩,![],(e*a),![b,d]⟩) := by + rw [totalInj_d_hor] + simp only [Fin.sum_univ_succ,Fin.sum_univ_zero] + norm_num + try erw [labels3_0 b d e] + try erw [labels3_1 b d e] + try erw [labels3_2 b d e] + try erw [labels3_3 b d e] + try erw [weight3_0 b d e] + try erw [weight3_1 b d e] + try erw [weight3_2 b d e] + try erw [weight3_3 b d e] + try erw [one_totalInj F (h:=2) (v:=0) rfl ![] a ![d,e]] + try erw [one_totalInj F (h:=2) (v:=0) rfl ![] a ![(b*d),e]] + try erw [one_totalInj F (h:=2) (v:=0) rfl ![] a ![b,(d*e)]] + try abel +end RegularLabels + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/RelabelCoefficients.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/RelabelCoefficients.lean new file mode 100644 index 0000000000000000000000000000000000000000..9b4d72e36c61e0a0d0e0173f2017f2bdc7c71f95 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/RelabelCoefficients.lean @@ -0,0 +1,72 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.PointFiberHomology +import OAI.GroupTheory.SimpleAmenable.Configurations.CellRelabel + +namespace OAI + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Classical +namespace SimpleAmenable.PolygonObject.LabelledStage + +variable {a n m : ℕ} {K : Type} [AddCommGroup K] +def labelMap (f : (Fin n → CutRing × CutRing) → (Fin m → CutRing × CutRing)) + (hf : ∀g,Labelled.Reduced g → Labelled.Reduced (f g)) : ReducedLabel n → ReducedLabel m := + fun l => ⟨f l.val,hf l.val l.property⟩ +variable (f : (Fin n → CutRing × CutRing) → (Fin m → CutRing × CutRing)) + (hf : ∀g,Labelled.Reduced g → Labelled.Reduced (f g)) +noncomputable def relabelCoefficients : Coefficients a n K →ₗ[ℤ] Coefficients a m K where + toFun := Finsupp.mapDomain (labelMap f hf) + map_add' _ _ := Finsupp.mapDomain_add + map_smul' r x := by + let h : Coefficients a n K →+ Coefficients a m K := { + toFun := Finsupp.mapDomain (labelMap f hf) + map_zero' := Finsupp.mapDomain_zero + map_add' _ _ := Finsupp.mapDomain_add } + exact map_intCast_smul h ℤ ℤ r x +@[simp] lemma relabelCoefficients_single (l : ReducedLabel n) (s : BooleanStep a K) : + relabelCoefficients (a:=a) (K:=K) f hf (Finsupp.single l s)=Finsupp.single (labelMap f hf l) s := + Finsupp.mapDomain_single +end SimpleAmenable.PolygonObject.LabelledStage + +end + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits MonoidalCategory Classical +namespace SimpleAmenable.PolygonObject.LabelledStage.Stage +open IntervalBar.Diagram BarFinitePower FreeChains Labelled + +variable {a n m : ℕ} +variable (f : (Fin n → CutRing × CutRing) → (Fin m → CutRing × CutRing)) + (hf : ∀g, Reduced g → Reduced (f g)) +lemma homologyCoefficientIso_relabel (j : ℕ) (hj : 0 k x) + (Cell.homology_coefficient P l j hj hj5) + change (SSet.homologyMap (bar₃Map (Cell.functor P l)) Z j ≫ + (homologyCoefficientIso j hj hj5).hom) x = Finsupp.single l (Cell.step P x) at he + change ((homologyCoefficientIso j hj hj5).inv ≫ + SSet.homologyMap (bar₃Map (relabel f hf)) Z j ≫ (homologyCoefficientIso j hj hj5).hom) + (Finsupp.single l (Cell.step P x)) = _ + conv_lhs => rw [←he] + change (SSet.homologyMap (bar₃Map (Cell.functor P l)) Z j ≫ + (homologyCoefficientIso j hj hj5).hom ≫ (homologyCoefficientIso j hj hj5).inv ≫ + SSet.homologyMap (bar₃Map (relabel f hf)) Z j ≫ + (homologyCoefficientIso j hj hj5).hom) x = _ + rw [Iso.hom_inv_id_assoc,←Category.assoc,←SSet.homologyMap_comp,←bar₃Map_comp, + bar₃Map_eq_of_monoidalNatTrans (Cell.relabelIso f hf P l).hom j] + erw [Cell.homology_coefficient P (labelMap f hf l) j hj hj5] + exact (relabelCoefficients_single f hf l (Cell.step P x)).symm +end SimpleAmenable.PolygonObject.LabelledStage.Stage + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/RestrictedPolygon.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/RestrictedPolygon.lean new file mode 100644 index 0000000000000000000000000000000000000000..06c96e8e2b12de3ce501c90936831189f0d6132a --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/RestrictedPolygon.lean @@ -0,0 +1,23 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.PolygonStringSimplicial +import OAI.GroupTheory.SimpleAmenable.Simplicial.RestrictedNerve + +namespace OAI + +section + +section +open CategoryTheory +namespace SimpleAmenable.PolygonObject + +noncomputable def stringResolutionHomologyIso (a j : ℕ) : + (SimplicialDiagonal.diagonal.obj (stringDoubleNerve a)).homology DiagonalResolution.Z j ≅ + (nerve (PolygonObject a)).homology DiagonalResolution.Z j := + RestrictedNerve.homologyIso (positionalProperty a) j +end SimpleAmenable.PolygonObject + +end + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/RingGroupHomology.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/RingGroupHomology.lean new file mode 100644 index 0000000000000000000000000000000000000000..53037604ce62b3bdc213cca55310612dd7ca82e5 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/RingGroupHomology.lean @@ -0,0 +1,123 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.NoetherianTor + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section RingGroupHomology + +open CategoryTheory CategoryTheory.Limits CategoryTheory.MonoidalCategory +open scoped TensorProduct +attribute [local instance 1200] Rep.hV2 +namespace RingCoinvariants +variable {G : Type} [CommGroup G] +local notation "R" => MonoidAlgebra ℤ G + +noncomputable def augmentation : R →+* ℤ := + (MonoidAlgebra.lift ℤ ℤ G (1 : G →* ℤ)).toRingHom + +@[simp] theorem augmentation_of (g : G) : + augmentation (MonoidAlgebra.of ℤ G g) = 1 := + MonoidAlgebra.lift_of _ _ + +noncomputable def augmentationTrivialIso : + Rep.ofModuleMonoidAlgebra.obj (NoetherianResolution.augmentationModule + (augmentation (G := G))) ≅ Rep.trivial ℤ G ℤ := by + refine (moduleRepIso _).symm ≪≫ Rep.mkIso ?_ + refine { (LinearEquiv.refl ℤ ℤ) with isIntertwining' := ?_ } + intro g + apply LinearMap.ext + intro x + change augmentation (MonoidAlgebra.of ℤ G g) • x = x + rw [augmentation_of, one_smul] + +instance : (Rep.ofModuleMonoidAlgebra (k := ℤ) (G := G)).Additive where + map_add := by intros; rfl + +variable [IsNoetherianRing (MonoidAlgebra ℤ G)] + +noncomputable def groupResolution : ProjectiveResolution (Rep.trivial ℤ G ℤ) := by + let Q := Rep.ofModuleMonoidAlgebra.mapProjectiveResolution + (NoetherianResolution.augmentationResolution (augmentation (G := G))) + exact { + complex := Q.complex + projective := Q.projective + π := Q.π ≫ (ChainComplex.single₀ (Rep ℤ G)).map augmentationTrivialIso.hom } + +noncomputable def complexIso (L : FGModuleCat R) : + (groupResolution (G := G)).complex.coinvariantsTensorObj (inverseRep L.obj) ≅ + ((ModuleCat.restrictScalars (Int.castRingHom R)).mapHomologicalComplex _).obj + (NoetherianResolution.augmentationComplex augmentation L) := + (CategoryTheory.Functor.mapHomologicalComplexCompIso (functorIso L.obj) + (ComplexShape.down ℕ)).app + (NoetherianResolution.augmentationResolution (augmentation (G := G))).complex + +theorem finite_groupHomology_inverse (L : FGModuleCat R) (n : ℕ) : + Module.Finite ℤ (groupHomology (inverseRep L.obj) n) := by + classical + let C := NoetherianResolution.augmentationComplex (augmentation (G := G)) L + let F := ModuleCat.restrictScalars (Int.castRingHom R) + let := NoetherianResolution.finite_int_augmentation_homology augmentation L n + let e0 : ModuleCat.of ℤ (C.homology n) ≅ F.obj (C.homology n) := intRestrictionIso _ + have : Module.Finite ℤ (F.obj (C.homology n)) := + Module.Finite.of_surjective e0.hom.hom e0.toLinearEquiv.surjective + let e1 : ((F.mapHomologicalComplex _).obj C).homology n ≅ + F.obj (C.homology n) := (C.sc n).mapHomologyIso F + have : Module.Finite ℤ (((F.mapHomologicalComplex _).obj C).homology n) := + Module.Finite.of_surjective e1.inv.hom e1.toLinearEquiv.symm.surjective + let e2 := HomologicalComplex.homologyMapIso (complexIso L) n + have : Module.Finite ℤ (((groupResolution (G := G)).complex.coinvariantsTensorObj + (inverseRep L.obj)).homology n) := + Module.Finite.of_surjective e2.inv.hom e2.toLinearEquiv.symm.surjective + let e3 := groupHomologyIso (inverseRep L.obj) n (groupResolution (G := G)) + exact Module.Finite.of_surjective e3.inv.hom e3.toLinearEquiv.symm.surjective + +end RingCoinvariants +end RingGroupHomology + +section FiniteAbelianHomology + +open CategoryTheory +attribute [local instance 1200] Rep.hV2 +namespace RingCoinvariants +variable {G : Type} [CommGroup G] [IsNoetherianRing (MonoidAlgebra ℤ G)] + +noncomputable def inverseHomologyIso (A : Rep ℤ G) (n : ℕ) : + groupHomology (inverseRep (ModuleCat.of (MonoidAlgebra ℤ G) A.ρ.asModule)) n ≅ + groupHomology A n := by + let e : (inverseRep (ModuleCat.of (MonoidAlgebra ℤ G) A.ρ.asModule)) ≃+ A := { + toFun := fun x => x + invFun := fun x => x + left_inv := fun _ => rfl + right_inv := fun _ => rfl + map_add' := fun _ _ => rfl } + refine groupHomology.mapIso + (A := inverseRep (ModuleCat.of (MonoidAlgebra ℤ G) A.ρ.asModule)) (B := A) + (MulEquiv.inv G) (e.toIntLinearEquiv) ?_ n + intro g + apply DFunLike.ext + intro x + change A.ρ.asAlgebraHom (MonoidAlgebra.single g⁻¹ 1) x = A.ρ g⁻¹ x + rw [Representation.asAlgebraHom_single_one] + +theorem finite_groupHomology (A : Rep ℤ G) + [Module.Finite (MonoidAlgebra ℤ G) A.ρ.asModule] (n : ℕ) : + Module.Finite ℤ (groupHomology A n) := by + let L := FGModuleCat.of (MonoidAlgebra ℤ G) A.ρ.asModule + have := finite_groupHomology_inverse L n + let e := inverseHomologyIso A n + exact Module.Finite.of_surjective e.hom.hom e.toLinearEquiv.surjective + +end RingCoinvariants +end FiniteAbelianHomology + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/StageCoefficients.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/StageCoefficients.lean new file mode 100644 index 0000000000000000000000000000000000000000..305bb3706e894feac8b261163b959eaf2e36a926 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/StageCoefficients.lean @@ -0,0 +1,140 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Configurations.StageRealization +import OAI.GroupTheory.SimpleAmenable.Configurations.StageOrder +import OAI.GroupTheory.SimpleAmenable.Homology.BooleanStepCoefficients + +namespace OAI + +section + +section +open CategoryTheory Classical Set +namespace SimpleAmenable.PolygonObject.LabelledStage + +variable {a n:ℕ} {K:Type} [AddCommGroup K] +noncomputable abbrev Coefficients (a n:ℕ) (K:Type) [AddCommGroup K] := + ReducedLabel n →₀ BooleanStep a K +namespace Stage +variable (S:Stage a n) +noncomputable def label (j:Fin S.support.card) : ReducedLabel n := ⟨S.L j,S.L_reduced j⟩ +lemma label_injective : Function.Injective S.label := fun _ _ equality => S.L_injective (congrArg Subtype.val equality) +lemma label_mem_support (j:Fin S.support.card) : S.label j∈S.support := + (S.label_mem _ _).mp ⟨j,rfl⟩ +lemma label_range (l:ReducedLabel n) : (∃j,S.label j=l) ↔ l∈S.support := by + simpa only [label,Subtype.ext_iff] using S.label_mem l.val l.property +noncomputable def realize : (Fin S.partition.size × Fin S.support.card → K) →ₗ[ℤ] Coefficients a n K := + ∑j:Fin S.support.card, + (Finsupp.lsingle (S.label j)).comp + ((BooleanStep.inflate (K:=K) S.partition).comp (LinearMap.funLeft ℤ K (fun i => (i,j)))) +lemma realize_at_label (v:Fin S.partition.size × Fin S.support.card → K) (j:Fin S.support.card) : + (S.realize (K:=K) v) (S.label j) = BooleanStep.inflate (K:=K) S.partition (fun i => v (i,j)) := by + simp only [realize,LinearMap.sum_apply,LinearMap.comp_apply,Finsupp.lsingle_apply,Finsupp.finsetSum_apply] + rw [Finset.sum_eq_single j] + · rw [Finsupp.single_eq_same]; rfl + · intro k hk hkj + exact Finsupp.single_eq_of_ne (fun e => hkj (S.label_injective e.symm)) + · intro h; exact False.elim (h (Finset.mem_univ _)) +lemma realize_outside (v:Fin S.partition.size × Fin S.support.card → K) (l:ReducedLabel n) + (hl:l∉S.support) : (S.realize (K:=K) v) l=0 := by + simp only [realize,LinearMap.sum_apply,LinearMap.comp_apply,Finsupp.lsingle_apply,Finsupp.finsetSum_apply] + apply Finset.sum_eq_zero; intro j hj + exact Finsupp.single_eq_of_ne (fun e => hl (e.symm ▸ S.label_mem_support j)) +noncomputable def coefficientEvaluate : Coefficients a n K →ₗ[ℤ] (Fin S.partition.size × Fin S.support.card → K) where + toFun f c := (f (S.label c.2)).val (S.partition.point c.1) + map_add' _ _ := rfl + map_smul' _ _ := rfl +lemma coefficientEvaluate_realize : + (S.coefficientEvaluate (K:=K)).comp S.realize=LinearMap.id := by + apply LinearMap.ext; intro v; funext c + change (S.realize (K:=K) v (S.label c.2)).val (S.partition.point c.1)=v c + rw [realize_at_label,BooleanStep.inflate_apply,S.partition.color_point] +lemma realize_injective : Function.Injective (S.realize (K:=K)) := by + intro v w h + have hh := congrArg (S.coefficientEvaluate (K:=K)) h + change ((S.coefficientEvaluate (K:=K)).comp S.realize) v=((S.coefficientEvaluate (K:=K)).comp S.realize) w at hh + simpa only [coefficientEvaluate_realize,LinearMap.id_apply] using hh + +def Admissible (f:Coefficients a n K) : Prop := + f.support ⊆ S.support ∧ ∀l p q,S.partition.color p=S.partition.color q → (f l).val p=(f l).val q +lemma realize_admissible (v:Fin S.partition.size × Fin S.support.card → K) : S.Admissible (S.realize (K:=K) v) := by + constructor + · intro l hl + by_contra hn + exact (Finsupp.mem_support_iff.mp hl) (S.realize_outside v l hn) + · intro l p q hpq + by_cases hl:l∈S.support + · obtain ⟨j,rfl⟩ := (S.label_range l).mpr hl + rw [S.realize_at_label,BooleanStep.inflate_apply,BooleanStep.inflate_apply,hpq] + · rw [S.realize_outside v l hl]; rfl +lemma realize_coefficientEvaluate (f:Coefficients a n K) (hf:S.Admissible f) : + S.realize (K:=K) (S.coefficientEvaluate (K:=K) f)=f := by + apply Finsupp.ext; intro l + by_cases hl:l∈S.support + · obtain ⟨j,rfl⟩ := (S.label_range l).mpr hl + rw [realize_at_label] + apply Subtype.ext; funext p + exact hf.2 _ _ _ (S.partition.color_point (S.partition.color p)) + · rw [realize_outside _ _ _ hl] + exact (Finsupp.notMem_support_iff.mp (fun h => hl (hf.1 h))).symm +lemma admissible_mono {T:Stage a n} (h:S≤T) {f:Coefficients a n K} (hf:S.Admissible f) : + T.Admissible f := ⟨hf.1.trans h.2,fun l p q hpq => hf.2 l p q (h.1 p q hpq)⟩ +variable {S} +noncomputable def coefficientRefinement {T:Stage a n} (_h:S≤T) : + (Fin S.partition.size × Fin S.support.card →K) →ₗ[ℤ] (Fin T.partition.size × Fin T.support.card →K) := + (T.coefficientEvaluate (K:=K)).comp S.realize +lemma realize_refinement {T:Stage a n} (h:S≤T) : + (T.realize (K:=K)).comp (coefficientRefinement h)=S.realize (K:=K) := by + apply LinearMap.ext; intro v + exact T.realize_coefficientEvaluate _ (S.admissible_mono h (S.realize_admissible v)) +lemma exists_coefficient_stage (f:Coefficients a n K) : ∃S:Stage a n,S.Admissible f := by + obtain ⟨P,hP⟩ := BooleanStep.exists_common (fun l:f.support => f l.val) + refine ⟨⟨P,f.support⟩,Subset.rfl,?_⟩ + intro l p q hpq + by_cases hl:l∈f.support + · have h := congrArg Subtype.val (hP ⟨l,hl⟩) + exact (congrFun h p).symm.trans ((congrArg (fun i => (BooleanStep.evaluate (K:=K) P (f l)) i) hpq).trans (congrFun h q)) + · rw [Finsupp.notMem_support_iff.mp hl]; rfl +end Stage +end SimpleAmenable.PolygonObject.LabelledStage + +end + +section +open CategoryTheory Limits Classical Set +namespace SimpleAmenable.PolygonObject.LabelledStage.Stage + +variable {a n:ℕ} (K:Type) [AddCommGroup K] +noncomputable def coefficientDiagram : Stage a n ⥤ ModuleCat ℤ where + obj S := ModuleCat.of ℤ (Fin S.partition.size × Fin S.support.card→K) + map h := ModuleCat.ofHom (coefficientRefinement (K:=K) (leOfHom h)) + map_id S := by + apply ModuleCat.hom_ext + exact coefficientEvaluate_realize S + map_comp {S T U} h k := by + apply ModuleCat.hom_ext + apply LinearMap.ext; intro v + change U.coefficientEvaluate (K:=K) (S.realize (K:=K) v) = + U.coefficientEvaluate (K:=K) (T.realize (K:=K) (coefficientRefinement (K:=K) (leOfHom h) v)) + exact congrArg (U.coefficientEvaluate (K:=K)) (LinearMap.congr_fun (realize_refinement (K:=K) (leOfHom h)) v).symm +noncomputable def coefficientCocone : Cocone (coefficientDiagram (a:=a) (n:=n) K) where + pt := ModuleCat.of ℤ (Coefficients a n K) + ι := { + app S := ModuleCat.ofHom (S.realize (K:=K)) + naturality _ _ h := ModuleCat.hom_ext (realize_refinement (K:=K) (leOfHom h)) } + +noncomputable def coefficientIsColimit : IsColimit (coefficientCocone (a:=a) (n:=n) K) := by + apply isColimitOfReflects (CategoryTheory.forget (ModuleCat ℤ)) + apply Types.FilteredColimit.isColimitOf' + · intro f + obtain ⟨S,hS⟩ := exists_coefficient_stage f + exact ⟨S,S.coefficientEvaluate (K:=K) f,(S.realize_coefficientEvaluate f hS).symm⟩ + · intro S v w h + have hvw := S.realize_injective h + exact ⟨S,𝟙 S,congrArg _ hvw⟩ +end SimpleAmenable.PolygonObject.LabelledStage.Stage + +end + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/StageHomologyCoordinates.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/StageHomologyCoordinates.lean new file mode 100644 index 0000000000000000000000000000000000000000..b7fa2643b9511654e434fa610a03cd529bff9a4b --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/StageHomologyCoordinates.lean @@ -0,0 +1,133 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.RandomFields.PeriodizationCovariance +import OAI.GroupTheory.SimpleAmenable.Configurations.LabelledStringEquiv +import OAI.GroupTheory.SimpleAmenable.Simplicial.FinitePowerConnected +import OAI.GroupTheory.SimpleAmenable.Homology.StageCoefficients +import OAI.GroupTheory.SimpleAmenable.Simplicial.StageSimplicialColimit + +namespace OAI + +section + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits MonoidalCategory Simplicial Opposite +namespace SimpleAmenable.PolygonObject.LabelledStage.Stage +open IntervalBar.Diagram BarFinitePower FreeChains + +attribute [local instance 1200] Pi.module Prod.instModule +variable {a n:ℕ} +noncomputable abbrev E := bar₃ (C:=FiniteSetGroupoid) +lemma E_low_connected : LowConnected E := fun j hj h3 => bar₃_low_zero j hj h3 +noncomputable abbrev K (j:ℕ) : ModuleCat ℤ := E.homology Z j +noncomputable def coefficientVectorIso (S:Stage a n) (j:ℕ) : + ModuleCat.of ℤ (Fin S.partition.size × Fin S.support.card → K j) ≅ + (coefficientDiagram (a:=a) (n:=n) (K j)).obj S := + (AddEquiv.refl (Fin S.partition.size × Fin S.support.card → K j)).toIntLinearEquiv.toModuleIso +noncomputable def homologyCoordinates (S:Stage a n) (j:ℕ) : + (bar₃ (C:=S.Obj)).homology Z j ⟶ (coefficientDiagram (a:=a) (n:=n) (K j)).obj S := + SSet.homologyMap S.finiteProductComparison Z j ≫ coordinates _ E j ≫ (S.coefficientVectorIso j).hom +lemma homologyCoordinates_isIso (S:Stage a n) (j:ℕ) (hj:0 hl ((S.label_range (T.label c.2)).mp ⟨b,Subtype.ext hb⟩)) j hj] + erw [S.realize_outside _ _ hl] + rfl +noncomputable def homologyCoordinateIso (j:ℕ) (hj:0 by + haveI := S.homologyCoordinates_isIso j hj hj5 + exact asIso (C := ModuleCat ℤ) (X := (bar₃ (C:=S.Obj)).homology Z j) + (Y := (coefficientDiagram (a:=a) (n:=n) (K j)).obj S) + (S.homologyCoordinates j)) (fun h => homologyCoordinates_refinement (leOfHom h) j hj) + +noncomputable def homologyCoefficientIso (j:ℕ) (hj:0 (SquareStep.orbitLift (l i)).toAdd,by + intro i + change orbitRepresentative (((l i).toAdd.1:CutRing)*cutTau,((l i).toAdd.2:CutRing)*cutTau)=_ + simp [orbitRepresentative,cutTau] + rfl⟩ + left_inv l := by + apply Subtype.ext; funext i + exact l.property i + right_inv l := by + funext i + change Multiplicative.ofAdd ((((l i).toAdd.1:CutRing)*cutTau).im, + (((l i).toAdd.2:CutRing)*cutTau).im) = l i + simp [cutTau] + +noncomputable def trajectoryCoefficientEquiv (a n:ℕ) (K:Type) [AddCommGroup K] : + Coefficients a n K ≃ₗ[ℤ] + ((Fin n → Multiplicative (ℤ×ℤ)) →₀ (SquareStep a ⊗[ℤ] K)) := + (Finsupp.mapRange.linearEquiv (BooleanStep.tensorEquiv (a:=a) (K:=K)).symm).trans + (Finsupp.domLCongr (reducedLabelEquiv n)) +end SimpleAmenable.PolygonObject.LabelledStage + +end + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits MonoidalCategory +open scoped TensorProduct +namespace SimpleAmenable.PolygonObject +open IntervalBar.Diagram LabelledStage FreeChains + +noncomputable def trajectoryHomologyIso (a p j:ℕ) (hj:0 apply Subsingleton.elim +lemma trajectoryRows_low_zero (a p j:ℕ) (hj:0 + have he : Fin.cast h (i.castAdd (l+n))=(i.castAdd l).castAdd n := Fin.ext rfl + rw [he,stabilize_apply_head,stabilize_apply_head] + exact he.symm + | right i => + rw [stabilize_apply_tail] + induction i using Fin.addCases with + | left i => + have he : Fin.cast h ((i.castAdd n).natAdd k)=(i.natAdd k).castAdd n := Fin.ext rfl + rw [he,stabilize_apply_head,stabilize_apply_head] + exact he.symm + | right i => + have he : Fin.cast h ((i.natAdd l).natAdd k)=i.natAdd (k+l) := by + apply Fin.ext + simp only [Fin.val_cast,Fin.val_natAdd] + omega + rw [he,stabilize_apply_tail,stabilize_apply_tail] + apply Fin.ext + simp only [Fin.val_cast,Fin.val_natAdd] + omega +lemma stabilize_zero_bijective (n:ℕ) : Function.Bijective (stabilize 0 n) := by + refine ⟨stabilize_injective 0 n,?_⟩ + intro g + have hg : g ∈ (stabilize 0 n).range := by + rw [stabilize_range] + exact Subsingleton.elim _ _ + exact hg +lemma stabilize_H1_isIso (k n:ℕ) (hn:32≤n) : + IsIso (TrivialHomology.map (stabilize k n) 1) := by + induction k with + | zero => + exact TrivialHomology.isIso_equiv + (MulEquiv.ofBijective (stabilize 0 n) (stabilize_zero_bijective n)) 1 + | succ k ih => + rw [show k+1=1+k by omega,stabilize_add,TrivialHomology.map_comp,TrivialHomology.map_comp] + have := TrivialHomology.isIso_equiv (castGroup (Nat.add_assoc 1 k n).symm) 1 + have := stabilize_one_H1_isIso (k+n) (by omega) + have := ih + infer_instance +end + +attribute [local instance 1200] Rep.hV2 +lemma columnAugmentation_H1_isIso (p n : ℕ) (hn : 32 ≤ n) : + IsIso ((groupHomology.functor ℤ (G (p+n)) 1).map + (TransitiveInduction.augmentation (G (p+n)) (Configuration (p+n) p))) := by + have pointIso := TransitiveInduction.isIso_map_pointMap (standard p n) + (fun f => transitive _ f) 1 + have subtypeIso : IsIso (TrivialHomology.map + (MulAction.stabilizer (G (p+n)) (standard p n)).subtype 1) := by + have := stabilize_H1_isIso p n hn + have := TrivialHomology.isIso_equiv (standardStabilizerEquiv p n) 1 + have he : TrivialHomology.map (standardStabilizerEquiv p n).toMonoidHom 1 ≫ + TrivialHomology.map (MulAction.stabilizer (G (p+n)) + (standard p n)).subtype 1 = TrivialHomology.map (stabilize p n) 1 := by + rw [← TrivialHomology.map_comp, standardStabilizerEquiv_subtype] + exact IsIso.of_isIso_fac_left he + exact @IsIso.of_isIso_fac_left _ _ _ _ _ _ _ _ pointIso subtypeIso + (TransitiveInduction.augmentation_pointMap (standard p n) 1) + +lemma face_H1_isIso (m p : ℕ) (hn : p+33 ≤ m) (i : Fin (p+1)) : + IsIso ((groupHomology.functor ℤ (G m) 1).map (faceHom m p i)) := by + have hc (t : ℕ) (ht : t ≤ p+1) : + IsIso ((groupHomology.functor ℤ (G m) 1).map + (TransitiveInduction.augmentation (G m) (Configuration m t))) := by + obtain ⟨n,rfl⟩ : ∃n,m=t+n := ⟨m-t,by omega⟩ + exact columnAugmentation_H1_isIso t n (by omega) + have := hc p (by omega) + have := hc (p+1) (by omega) + have he := congrArg ((groupHomology.functor ℤ (G m) 1).map) + (TransitiveInduction.augmentation_natural (face i) (face_smul i)) + rw [Functor.map_comp] at he + exact IsIso.of_isIso_fac_right he + +lemma boundary_two_H1_isIso (m : ℕ) (hm : 35 ≤ m) : + IsIso ((groupHomology.functor ℤ (G m) 1).map (boundary m 2)) := by + rw [homology_boundary_three m (by omega) 1] + exact face_H1_isIso m 2 (by omega) 0 + +lemma boundary_five (m : ℕ) : boundary m 4 = + faceHom m 4 0 - faceHom m 4 1 + faceHom m 4 2 - faceHom m 4 3 + faceHom m 4 4 := by + rw [boundary_sum] + simp only [Fin.sum_univ_succ] + norm_num + abel + +lemma boundary_four_H0_isIso (m : ℕ) (hm : 16 < m) : + IsIso ((groupHomology.functor ℤ (G m) 0).map (boundary m 4)) := by + rw [boundary_five,Functor.map_add,Functor.map_sub,Functor.map_add,Functor.map_sub] + rw [homology_face_eq m 4 (by omega) 0 1 0, homology_face_eq m 4 (by omega) 0 2 0, + homology_face_eq m 4 (by omega) 0 3 0, homology_face_eq m 4 (by omega) 0 4 0] + simp only [sub_self,zero_add] + exact face_H0_isIso m 4 hm 0 +lemma boundary_zero_H2_isIso (m : ℕ) (hm : 35 ≤ m) : + IsIso ((groupHomology.functor ℤ (G m) 2).map (boundary m 0)) := by + have := boundary_zero_epi m (by omega) + have boundaryTwoH0 : IsIso (BoundedHomologyEdge.Hmap 0 (boundary m 2)) := + boundary_two_H0_isIso m (by omega) + have boundaryTwoH1 : IsIso (BoundedHomologyEdge.Hmap 1 (boundary m 2)) := + boundary_two_H1_isIso m hm + have boundaryFourH0 : IsIso (BoundedHomologyEdge.Hmap 0 (boundary m 4)) := + boundary_four_H0_isIso m (by omega) + exact BoundedHomologyEdge.chain_H2_isIso (boundary m 0) (boundary m 1) + (boundary m 2) (boundary m 3) (boundary m 4) + (boundary_square m 0) (boundary_square m 1) (boundary_square m 2) + (boundary_square m 3) (boundary_exact m 0 (by omega) (by omega)) + (boundary_exact m 1 (by omega) (by omega)) + (boundary_exact m 2 (by omega) (by omega)) + (homology_boundary_two_zero m (by omega) 2) +lemma stabilizer_H2_isIso (m : ℕ) (hm : 35 ≤ m) (f : Configuration m 1) : + IsIso (TrivialHomology.map (MulAction.stabilizer (G m) f).subtype 2) := by + have pointIso := TransitiveInduction.isIso_map_pointMap f (fun g => transitive f g) 2 + have boundaryIso := boundary_zero_H2_isIso m hm + erw [← augmentation_pointMap f 2] + have lastIso : IsIso ((groupHomology.functor ℤ (G m) 2).map (emptyIso m).hom) := inferInstance + have tailIso := IsIso.comp_isIso' boundaryIso lastIso + exact IsIso.comp_isIso' pointIso tailIso + +lemma stabilize_one_H2_isIso (n : ℕ) (hn : 34 ≤ n) : + IsIso (TrivialHomology.map (stabilize 1 n) 2) := by + rw [← standardStabilizerEquiv_subtype 1 n, TrivialHomology.map_comp] + have := TrivialHomology.isIso_equiv (standardStabilizerEquiv 1 n) 2 + have := stabilizer_H2_isIso (1+n) (by omega) (standard 1 n) + infer_instance +end SimpleAmenable.SymmetricConfiguration + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/TensorJoint.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/TensorJoint.lean new file mode 100644 index 0000000000000000000000000000000000000000..661e30fe07600d0d0a0151a7016dfcc7d96bb586 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/TensorJoint.lean @@ -0,0 +1,66 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.FreeChains + +namespace OAI + +section + +section +open CategoryTheory Limits MonoidalCategory HomologicalComplex +namespace ChainTensor +open FreeChains + +variable (S T:ShortComplex (ChainComplex A ℕ)) (s:S.Splitting) (t:T.Splitting) +lemma splitting_tensor_identity : + (s.r⊗ₘt.r) ≫ (S.f⊗ₘT.f) + + (𝟙 S.X₂⊗ₘT.g) ≫ ((s.r≫S.f)⊗ₘt.s) + + (S.g⊗ₘ𝟙 T.X₂) ≫ (s.s⊗ₘ𝟙 T.X₂) = 𝟙 (S.X₂⊗T.X₂) := by + have tensor_add {sourceLeft targetLeft sourceRight targetRight : ChainComplex A ℕ} + (left : sourceLeft ⟶ targetLeft) (right₁ right₂ : sourceRight ⟶ targetRight) : + left ⊗ₘ (right₁ + right₂) = left ⊗ₘ right₁ + left ⊗ₘ right₂ := by + apply HomologicalComplex.Hom.ext + funext degree + apply mapBifunctor.hom_ext + intro leftDegree rightDegree totalDegree + change ιMapBifunctor sourceLeft sourceRight (curriedTensor A) c leftDegree rightDegree degree totalDegree ≫ + (mapBifunctorMap left (right₁ + right₂) (curriedTensor A) c).f degree = + ιMapBifunctor sourceLeft sourceRight (curriedTensor A) c leftDegree rightDegree degree totalDegree ≫ + ((mapBifunctorMap left right₁ (curriedTensor A) c).f degree + + (mapBifunctorMap left right₂ (curriedTensor A) c).f degree) + simp [Preadditive.comp_add] + have add_tensor {sourceLeft targetLeft sourceRight targetRight : ChainComplex A ℕ} + (left₁ left₂ : sourceLeft ⟶ targetLeft) (right : sourceRight ⟶ targetRight) : + (left₁ + left₂) ⊗ₘ right = left₁ ⊗ₘ right + left₂ ⊗ₘ right := by + apply HomologicalComplex.Hom.ext + funext degree + apply mapBifunctor.hom_ext + intro leftDegree rightDegree totalDegree + change ιMapBifunctor sourceLeft sourceRight (curriedTensor A) c leftDegree rightDegree degree totalDegree ≫ + (mapBifunctorMap (left₁ + left₂) right (curriedTensor A) c).f degree = + ιMapBifunctor sourceLeft sourceRight (curriedTensor A) c leftDegree rightDegree degree totalDegree ≫ + ((mapBifunctorMap left₁ right (curriedTensor A) c).f degree + + (mapBifunctorMap left₂ right (curriedTensor A) c).f degree) + simp [Preadditive.comp_add] + simp only [tensorHom_comp_tensorHom,Category.id_comp,Category.comp_id] + rw [←tensor_add,t.id,←add_tensor,s.id,id_tensorHom_id] +include s t in +lemma homology_joint_kernel (n:ℕ) (hz:IsZero ((S.X₁⊗T.X₁).homology n)) + (x:(S.X₂⊗T.X₂).homology n) + (h1:homologyMap (𝟙 S.X₂⊗ₘT.g) n x=0) + (h2:homologyMap (S.g⊗ₘ𝟙 T.X₂) n x=0) : x=0 := by + have hm : homologyMap ((s.r⊗ₘt.r) ≫ (S.f⊗ₘT.f)) n=0 := by + rw [homologyMap_comp,hz.eq_of_src (homologyMap (S.f⊗ₘT.f) n) 0,comp_zero] + have hid := congrArg (fun f => homologyMap f n) (splitting_tensor_identity S T s t) + simp only [homologyMap_add] at hid + rw [hm,homologyMap_comp,homologyMap_comp,homologyMap_id] at hid + have hh := congrArg (fun f => f x) hid + change 0 + homologyMap ((s.r≫S.f)⊗ₘt.s) n (homologyMap (𝟙 S.X₂⊗ₘT.g) n x) + + homologyMap (s.s⊗ₘ𝟙 T.X₂) n (homologyMap (S.g⊗ₘ𝟙 T.X₂) n x) = x at hh + simpa only [h1,h2,map_zero,add_zero] using hh.symm +end ChainTensor + +end + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/TensorSplit.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/TensorSplit.lean new file mode 100644 index 0000000000000000000000000000000000000000..9c1ffcd8822edf42860f6219756d1da6a0002da0 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/TensorSplit.lean @@ -0,0 +1,48 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.ProductChains + +namespace OAI + +section + +section +open CategoryTheory Limits MonoidalCategory HomologicalComplex +namespace TensorSplit +open FreeChains AugmentedSplit +attribute [local instance] preservesBinaryBiproducts_of_preservesBiproducts + +variable {K L : ChainComplex A ℕ} (e : K ⟶ U) (s : U ⟶ K) (hs : s ≫ e=𝟙 U) + (f : L ⟶ U) (t : U ⟶ L) (ht : t ≫ f=𝟙 U) +noncomputable def decompose : + K ⊗ L ≅ ((red e ⊗ red f) ⊞ red e) ⊞ (red f ⊞ U) := + (AugmentedSplit.iso e s hs ⊗ᵢ AugmentedSplit.iso f t ht) ≪≫ + ChainTensor.rightDistrib _ _ _ ≪≫ + biprod.mapIso + (ChainTensor.leftDistrib _ _ _ ≪≫ biprod.mapIso (Iso.refl _) (ρ_ _)) + (ChainTensor.leftDistrib _ _ _ ≪≫ biprod.mapIso (λ_ _) (λ_ _)) + +noncomputable def additiveIso [∀n,Module.Flat ℤ (K.X n)] + (a b n : ℕ) (hn : 0 AugmentedSplit.flat e i + have hf' : ∀i,i≤n → Module.Finite ℤ ((red f).homology i) := fun i hi => by + have := hf i hi + exact AugmentedSplit.finite f t ht i + have hz : IsZero ((red e ⊗ red f).homology n) := + TensorProductHomology.isZero (red e) (red f) a b n hab hK hL hf' + let H := homologyFunctor A c n + exact H.mapIso (decompose e s hs f t ht) ≪≫ H.mapBiprod _ _ ≪≫ + biprod.mapIso (H.mapBiprod _ _ ≪≫ (isoZeroBiprod hz).symm) + (H.mapBiprod _ _ ≪≫ (isoBiprodZero (AugmentedSplit.uni_isZero n (by omega))).symm) ≪≫ + biprod.mapIso (AugmentedSplit.homologyIso e s hs n (by omega)).symm + (AugmentedSplit.homologyIso f t ht n (by omega)).symm +end TensorSplit + +end + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/TorusCoefficientFinite.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/TorusCoefficientFinite.lean new file mode 100644 index 0000000000000000000000000000000000000000..20726522653c7ccec0e932a5ee05b3f376222b9c --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/TorusCoefficientFinite.lean @@ -0,0 +1,129 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.RingGroupHomology +import OAI.GroupTheory.SimpleAmenable.RandomFields.PeriodizationCovariance + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section TorusCoefficientFinite + +open Classical +namespace SquareStep + +abbrev OrbitGroupRing := MonoidAlgebra ℤ (Multiplicative (ℤ×ℤ)) + +noncomputable def orbitGroupRing : PolygonGroupRing →+* OrbitGroupRing := + MonoidAlgebra.mapDomainRingHom ℤ orbitProjection + +noncomputable def periodizeModule {a : ℕ} : + (PlaneStep.representation a).asModule →ₛₗ[orbitGroupRing] + (orbitRepresentation a).asModule where + toFun := periodize + map_add' := periodize.map_add + map_smul' r x := by + change PlaneStep a at x + change periodize ((PlaneStep.representation a).asAlgebraHom r x) = + (orbitRepresentation a).asAlgebraHom (orbitGroupRing r) (periodize x) + induction r using MonoidAlgebra.induction_linear with + | zero => simp + | add r s hr hs => simp [hr,hs] + | single g c => + simp only [orbitGroupRing,MonoidAlgebra.mapDomainRingHom_apply, + MonoidAlgebra.mapDomain_single,Representation.asAlgebraHom_single, + LinearMap.smul_apply,map_smul] + congr 1 + change periodize (PlaneStep.translate g.toAdd x) = + orbitRepresentation a (orbitProjection g) (periodize x) + rw [← representation_reduce] + exact periodize_translate x g.toAdd + +theorem periodizeModule_surjective {a : ℕ} : + Function.Surjective (periodizeModule (a := a)) := periodize_surjective + +theorem orbit_coefficient_finite {a : ℕ} (ha : 0 MonoidAlgebra ℤ G + +noncomputable def trivialTensorEquiv (ρ : Representation ℤ G M) : + (ρ.asModule ⊗[ℤ] K) ≃ₗ[ℤ] (ρ.tprod (Representation.trivial ℤ G K)).asModule := + (TensorProduct.congr ρ.asModuleEquiv (LinearEquiv.refl ℤ K)).trans + (ρ.tprod (Representation.trivial ℤ G K)).asModuleEquiv.symm + +noncomputable def trivialTensorMap (ρ : Representation ℤ G M) : + (ρ.asModule ⊗[ℤ] K) →ₗ[R] (ρ.tprod (Representation.trivial ℤ G K)).asModule := + MonoidAlgebra.equivariantOfLinearOfComm (trivialTensorEquiv ρ).toLinearMap (by + intro g x + induction x using TensorProduct.inductionOn with + | add x y hx hy => simp only [smul_add,map_add,hx,hy] + | tmul x y => + apply (ρ.tprod (Representation.trivial ℤ G K)).asModuleEquiv.injective + simp [trivialTensorEquiv,TensorProduct.smul_tmul'] + rfl) + +theorem finite_trivialTensor (ρ : Representation ℤ G M) + [Module.Finite R ρ.asModule] [Module.Finite ℤ K] : + Module.Finite R (ρ.tprod (Representation.trivial ℤ G K)).asModule := by + let : Module.Finite R (ρ.asModule ⊗[ℤ] K) := finite_tensor ℤ R ρ.asModule K + exact Module.Finite.of_surjective (trivialTensorMap ρ) (trivialTensorEquiv ρ).surjective + +end RingCoinvariants +end TensorCoefficientFinite + +section PolygonCoefficientHomology + +attribute [local instance 1200] Rep.hV2 Representation.instModuleAsModule TensorProduct.instModule +namespace SquareStep + +noncomputable def coefficientRep (a : ℕ) (K : Type) [AddCommGroup K] [Module ℤ K] : + Rep ℤ (Multiplicative (ℤ×ℤ)) := + Rep.of ((orbitRepresentation a).tprod (Representation.trivial ℤ _ K)) + +theorem coefficient_homology_finite {a : ℕ} (ha : 0 hφ p q) + have := ConeCoordinates.cone_subsingleton_of_iso (rowMap φ q) p + let e := (homologyFunctor (ModuleCat.{u} R) c p).mapIso (rowConeIso φ q) ≪≫ + ConcreteHomology.iso _ p + exact e.toLinearEquiv.injective.subsingleton +lemma cone_zero (hφ : ∀ p q,IsIso (homologyMap (φ.f p) q)) (n : ℕ) : + Subsingleton (ConcreteHomology.H (homotopyCofiber (total.map φ c)) n) := by + have := TotalFiniteness.subsingleton (TotalCone.B φ) n (fun p q _ => rowCone_zero φ hφ p q) + let e := (ConcreteHomology.functor (R:=R) n).mapIso (TotalCone.iso φ) ≪≫ + (ConcreteHomology.iso ((TotalCone.B φ).total c) n).symm + exact e.toLinearEquiv.injective.subsingleton +lemma total_homology_isIso (hφ : ∀ p q,IsIso (homologyMap (φ.f p) q)) (n : ℕ) : + IsIso (homologyMap (total.map φ c) n) := by + have := cone_zero φ hφ n + have := cone_zero φ hφ (n+1) + have : IsIso ((ConcreteHomology.functor n).map (total.map φ c)) := + (ConcreteCategory.isIso_iff_bijective _).mpr + ⟨ConeCoordinates.injective_of_cone_zero _ n,ConeCoordinates.surjective_of_cone_zero _ n⟩ + exact (NatIso.isIso_map_iff (ConcreteHomology.naturalIso (R:=R) n) (total.map φ c)).mpr inferInstance +end TotalComparison + +end + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/TotalFiltration.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/TotalFiltration.lean new file mode 100644 index 0000000000000000000000000000000000000000..436ea4deb636ce68a3aadd6ea7759b3b2d3bddac --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/TotalFiltration.lean @@ -0,0 +1,197 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.ConcreteHomology +import OAI.GroupTheory.SimpleAmenable.Homology.TotalProjection + +namespace OAI + +section + +section + +open CategoryTheory Limits HomologicalComplex HomologicalComplex₂ +namespace TotalProjection + +universe u +variable {R : Type u} [CommRing R] +variable (K : HomologicalComplex₂ (ModuleCat.{u} R) c c) + +lemma projection_eq_zero (p q n : ℕ) (h : p+q≠n) : projection K p q n = 0 := by + apply total.hom_ext + intro i j hij + rw [inclusion_projection_of_ne] + · simp + · intro h' + obtain ⟨rfl,rfl⟩ := Prod.mk.inj h' + exact h hij + +lemma element_ext {n : ℕ} {x y : (K.total c).X n} + (h : ∀ i : Index n,proj K n i x = proj K n i y) : x=y := by + have hx := congrArg (fun f : (K.total c).X n ⟶ (K.total c).X n => f x) + (sum_projection_inclusion K n) + have hy := congrArg (fun f : (K.total c).X n ⟶ (K.total c).X n => f y) + (sum_projection_inclusion K n) + simp only [ModuleCat.hom_sum,LinearMap.sum_apply,ModuleCat.comp_apply,ModuleCat.id_apply] at hx hy + rw [←hx,←hy] + exact Finset.sum_congr rfl (fun i _ => congrArg (inclusion K n i) (h i)) + +def filtration (n : ℕ) (p : ℤ) : Submodule R ((K.total c).X n) where + carrier := { x | ∀ i : Index n, p ≤ (i.val.1:ℤ) → proj K n i x=0 } + zero_mem' := by simp + add_mem' := by intro x y hx hy i hi; simp [map_add,hx i hi,hy i hi] + smul_mem' := by intro r x hx i hi; simp [map_smul,hx i hi] + +lemma filtration_mono (n : ℕ) : Monotone (filtration K n) := by + intro p q hpq x hx i hi + exact hx i (hpq.trans hi) + +lemma filtration_zero (n : ℕ) : filtration K n 0=⊥ := by + apply le_antisymm _ bot_le + intro x hx + apply (Submodule.mem_bot R).mpr + apply element_ext K + intro i + simpa using hx i (by omega) + +lemma filtration_top (n : ℕ) : filtration K n (n+1)=⊤ := by + apply top_unique + intro x _ i hi + have hs := Finset.HasAntidiagonal.mem_antidiagonal.mp i.property + omega + +lemma entry_zero {n p q : ℕ} {k : ℤ} {x : (K.total c).X n} + (hx : x∈filtration K n k) (hp : k≤(p:ℤ)) : projection K p q n x=0 := by + by_cases h : p+q=n + · exact hx ⟨(p,q),Finset.HasAntidiagonal.mem_antidiagonal.mpr h⟩ hp + · rw [projection_eq_zero K p q n h]; rfl + +lemma inclusion_mem {p q n : ℕ} (h : p+q=n) (x : (K.X p).X q) {k : ℤ} + (hp : (p:ℤ) f x) he + +lemma d_filtration {n m : ℕ} {k : ℤ} {x : (K.total c).X n} + (hx : x∈filtration K n k) : (K.total c).d n m x∈filtration K m k := by + by_cases h : m+1=n + · subst n + intro i hi + obtain ⟨⟨p,q⟩,hpq⟩ := i + have hpq' : p+q=m := Finset.HasAntidiagonal.mem_antidiagonal.mp hpq + subst m + have hd := congrArg (fun f : (K.total c).X (p+q+1) ⟶ (K.X p).X q => f x) + (d_projection K p q) + change projection K p q (p+q) ((K.total c).d (p+q+1) (p+q) x)=0 + simp only [ModuleCat.comp_apply] at hd + rw [hd] + change (projection K (p+1) q (p+q+1) ≫ (K.d (p+1) p).f q + + ((-1 : ℤˣ)^p) • (projection K p (q+1) (p+q+1) ≫ (K.X p).d (q+1) q)).hom x=0 + simp only [ModuleCat.hom_add,LinearMap.add_apply,ModuleCat.hom_comp,LinearMap.comp_apply,Units.smul_def,ModuleCat.hom_zsmul,LinearMap.smul_apply, + entry_zero K hx (by dsimp at hi; omega : k≤((p+1:ℕ):ℤ)),entry_zero K hx hi,map_zero,smul_zero,add_zero] + · rw [(K.total c).shape n m (by exact h)] + exact (filtration K m k).zero_mem + +noncomputable def filteredData (n : ℕ) : FilteredFiniteness.Data + (R:=R) (A:=(K.total c).X (n+1)) (B:=(K.total c).X n) (C:=(K.total c).X (n-1)) where + d := ((K.total c).d (n+1) n).hom + e := ((K.total c).d n (n-1)).hom + de := by exact ModuleCat.hom_ext_iff.mp ((K.total c).d_comp_d (n+1) n (n-1)) + FA := filtration K (n+1) + FB := filtration K n + FC := filtration K (n-1) + monoB := filtration_mono K n + +end TotalProjection + +end + +section + +open CategoryTheory Limits HomologicalComplex HomologicalComplex₂ +namespace E2Leading + +universe u +variable {R : Type u} [CommRing R] +open TotalProjection +variable (K : HomologicalComplex₂ (ModuleCat.{u} R) c c) + +lemma d_entry (p q : ℕ) (x : (K.total c).X (p+q+1)) : + projection K p q (p+q) ((K.total c).d (p+q+1) (p+q) x) = + (K.d (p+1) p).f q (projection K (p+1) q (p+q+1) x) + + ((-1 : ℤˣ)^p) • (K.X p).d (q+1) q (projection K p (q+1) (p+q+1) x) := by + have h := congrArg (fun f : (K.total c).X (p+q+1) ⟶ (K.X p).X q => f.hom x) + (d_projection K p q) + simpa only [ModuleCat.hom_add,ModuleCat.hom_comp,LinearMap.comp_apply,LinearMap.add_apply, + Units.smul_def,ModuleCat.hom_zsmul,LinearMap.smul_apply] using h + +lemma d_entry' (p q n m : ℕ) (hn : p+q+1=n) (hm : p+q=m) (x : (K.total c).X n) : + projection K p q m ((K.total c).d n m x) = + (K.d (p+1) p).f q (projection K (p+1) q n x) + + ((-1 : ℤˣ)^p) • (K.X p).d (q+1) q (projection K p (q+1) n x) := by + subst n; subst m; exact d_entry K p q x + +lemma z₂_top_cycle (p q : ℕ) (x : (filteredData K (p+q)).Z₂ ((p:ℤ)+1)) : + (K.X p).d q (q-1) (projection K p q (p+q) x)=0 := by + cases q with + | zero => rw [(K.X p).shape 0 (0-1) (by decide)]; rfl + | succ q => + rw [show q+1-1=q by omega] + have hd := d_entry K p q x.val + have hz : projection K p q (p+q) ((K.total c).d (p+q+1) (p+q) x.val)=0 := by + apply entry_zero K x.property.2 + omega + have hf : projection K (p+1) q (p+q+1) x.val=0 := entry_zero K x.property.1 (by omega) + rw [hz,hf,map_zero,zero_add] at hd + have hs : ((-1 : ℤˣ)^p) • (K.X p).d (q+1) q (projection K p (q+1) (p+q+1) x.val)=0 := hd.symm + have hh := congrArg (fun z => (((-1 : ℤˣ)^p)⁻¹) • z) hs + rw [inv_smul_smul,smul_zero] at hh + exact hh + +noncomputable def topCycle (p q : ℕ) : (filteredData K (p+q)).Z₂ ((p:ℤ)+1) →ₗ[R] + ConcreteHomology.Cycles (K.X p) q := + ((projection K p q (p+q)).hom.comp ((filteredData K (p+q)).Z₂ ((p:ℤ)+1)).subtype).codRestrict + _ (z₂_top_cycle K p q) + +noncomputable def row (q : ℕ) : ChainComplex (ModuleCat.{u} R) ℕ := + ((ConcreteHomology.functor q).mapHomologicalComplex c).obj K + +lemma z₂_top_horizontal (p q : ℕ) (x : (filteredData K (p+q)).Z₂ ((p:ℤ)+1)) : + (row K q).d p (p-1) (ConcreteHomology.π (K.X p) q (topCycle K p q x))=0 := by + cases p with + | zero => rw [(row K q).shape 0 (0-1) (by decide)]; rfl + | succ p => + change ((ConcreteHomology.functor q).map (K.d (p+1) p)).hom + (ConcreteHomology.π (K.X (p+1)) q (topCycle K (p+1) q x))=0 + rw [ConcreteHomology.map_π] + apply (ConcreteHomology.π_eq_zero (K.X p) q _).mpr + have hd := d_entry' K p q (p+1+q) (p+1+q-1) (by omega) (by omega) x.val + have hz : projection K p q (p+1+q-1) ((K.total c).d (p+1+q) (p+1+q-1) x.val)=0 := by + apply entry_zero K x.property.2 + omega + rw [hz] at hd + refine ⟨- ((-1 : ℤˣ)^p) • (projection K p (q+1) (p+1+q) x.val),?_⟩ + apply Subtype.ext + rw [ConcreteHomology.cyclesMap_val] + change (K.X p).d (q+1) q (- ((-1 : ℤˣ)^p) • (projection K p (q+1) (p+1+q) x.val))= + (K.d (p+1) p).f q (projection K (p+1) q (p+1+q) x.val) + simp only [Units.smul_def,map_zsmul,Units.val_neg,neg_smul,map_neg] + simpa only [Units.smul_def] using (eq_neg_of_add_eq_zero_left hd.symm).symm + +noncomputable def topRowCycle (p q : ℕ) : (filteredData K (p+q)).Z₂ ((p:ℤ)+1) →ₗ[R] + ConcreteHomology.Cycles (row K q) p := + ((ConcreteHomology.π (K.X p) q).comp (topCycle K p q)).codRestrict _ (z₂_top_horizontal K p q) + +noncomputable def lead (p q : ℕ) : (filteredData K (p+q)).Z₂ ((p:ℤ)+1) →ₗ[R] + ConcreteHomology.H (row K q) p := + (ConcreteHomology.π (row K q) p).comp (topRowCycle K p q) + +end E2Leading + +end + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/TotalFiniteness.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/TotalFiniteness.lean new file mode 100644 index 0000000000000000000000000000000000000000..8516ed019a728a0a8c073e52332cbaad40f557a9 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/TotalFiniteness.lean @@ -0,0 +1,159 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.EilenbergZilber +import OAI.GroupTheory.SimpleAmenable.Homology.E2Boundary + +namespace OAI + +section + +section + +open CategoryTheory Limits HomologicalComplex HomologicalComplex₂ +namespace TotalFiniteness + +universe u +variable {R : Type u} [CommRing R] +abbrev c := ComplexShape.down ℕ +variable (K : HomologicalComplex₂ (ModuleCat.{u} R) c c) + +noncomputable def row (q : ℕ) : ChainComplex (ModuleCat.{u} R) ℕ := + ((homologyFunctor (ModuleCat.{u} R) c q).mapHomologicalComplex c).obj K + +noncomputable def rowIso (q : ℕ) : row K q ≅ E2Leading.row K q := + (NatIso.mapHomologicalComplex (ConcreteHomology.naturalIso q) c).app K + +noncomputable def rowHomologyIso (p q : ℕ) : (row K q).homology p ≅ + ModuleCat.of R (ConcreteHomology.H (E2Leading.row K q) p) := + (homologyFunctor _ c p).mapIso (rowIso K q) ≪≫ ConcreteHomology.iso _ _ + +lemma finite [IsNoetherianRing R] (n : ℕ) + (hfinite : ∀ p q, p+q=n → Module.Finite R ((row K q).homology p)) : + Module.Finite R ((K.total c).homology n) := by + apply E2Leading.finite_total K n + intro p q hpq + have := hfinite p q hpq + exact Module.Finite.equiv (rowHomologyIso K p q).toLinearEquiv + +end TotalFiniteness + +namespace EilenbergZilber +open DiagonalResolution ModelAssembly +variable (X : Dᵒᵖ ⥤ Type) + +lemma finite_diagonal (n : ℕ) + (hfinite : ∀ p q, p+q=n → Module.Finite ℤ + ((TotalFiniteness.row (twoComplex X) q).homology p)) : + Module.Finite ℤ (SSet.homology (C := A) (diag ⋙ X) Z n) := by + have := TotalFiniteness.finite (twoComplex X) n hfinite + exact Module.Finite.equiv (homologyIso X n).symm.toLinearEquiv + +end EilenbergZilber + +end + +section + +namespace FilteredFiniteness.Data + +universe u +variable {R : Type u} [CommRing R] +variable {A B C : Type u} [AddCommGroup A] [Module R A] + [AddCommGroup B] [Module R B] [AddCommGroup C] [Module R C] +variable (K : FilteredFiniteness.Data (R:=R) (A:=A) (B:=B) (C:=C)) + +lemma subsingleton_H (N : ℕ) (hzero : K.FB 0=⊥) (htop : K.FB (N+1)=⊤) + (hzeroE : ∀ p : ℕ, p≤N → Subsingleton (K.E₂ (p+1))) : Subsingleton K.H := by + have hz : K.filtration 0=⊥ := by + apply le_antisymm _ bot_le + rintro y ⟨x,rfl⟩ + have hx : x=0 := by + apply Subtype.ext; apply Subtype.ext + exact (Submodule.mem_bot R).mp (hzero ▸ x.property) + rw [hx,map_zero] + exact Submodule.zero_mem _ + have hf : ∀ p : ℕ, p≤N+1 → K.filtration p=⊥ := by + intro p hp + induction p with + | zero => exact hz + | succ p ih => + have hl := ih (by omega) + have := hzeroE p (by omega) + apply le_antisymm _ bot_le + rintro y ⟨x,rfl⟩ + have he : K.lead ((p:ℤ)+1) x=0 := Subsingleton.elim _ _ + have hh := K.lower_of_lead_zero x he + change K.π x.val∈K.filtration (((p+1:ℕ):ℤ)-1) at hh + have hidx : ((p+1:ℕ):ℤ)-1=(p:ℤ) := by omega + rw [hidx,hl] at hh + exact hh + apply subsingleton_of_forall_eq 0 + intro y + obtain ⟨z,rfl⟩ := Submodule.mkQ_surjective (LinearMap.range K.dCycles) y + have hy : K.π z∈K.filtration ((N+1:ℕ):ℤ) := by + refine ⟨⟨z,?_⟩,rfl⟩ + change z.val∈K.FB ((N+1:ℕ):ℤ) + rw [Nat.cast_add,Nat.cast_one,htop]; trivial + rw [hf (N+1) le_rfl] at hy + exact hy +end FilteredFiniteness.Data + +open CategoryTheory HomologicalComplex HomologicalComplex₂ +namespace E2Leading + +universe u +variable {R : Type u} [CommRing R] +open TotalProjection +variable (K : HomologicalComplex₂ (ModuleCat.{u} R) c c) + +lemma subsingleton_E₂ (p q : ℕ) [Subsingleton (ConcreteHomology.H (row K q) p)] : + Subsingleton ((filteredData K (p+q)).E₂ ((p:ℤ)+1)) := by + apply subsingleton_of_forall_eq 0 + intro y + obtain ⟨x,rfl⟩ := Submodule.mkQ_surjective _ y + exact (Submodule.Quotient.mk_eq_zero _).mpr + (lead_zero_boundary K p q x (Subsingleton.elim _ _)) + +lemma subsingleton_total_concrete (n : ℕ) + (hzero : ∀ p q, p+q=n → Subsingleton (ConcreteHomology.H (row K q) p)) : + Subsingleton (ConcreteHomology.H (K.total c) n) := by + change Subsingleton (filteredData K n).H + apply FilteredFiniteness.Data.subsingleton_H _ n (filtration_zero K n) (filtration_top K n) + intro p hp + have hn : p+(n-p)=n := Nat.add_sub_of_le hp + have := hzero p (n-p) hn + have h := subsingleton_E₂ K p (n-p) + rwa [hn] at h +end E2Leading + +namespace TotalFiniteness + +universe u +variable {R : Type u} [CommRing R] +variable (K : HomologicalComplex₂ (ModuleCat.{u} R) c c) +lemma subsingleton (n : ℕ) + (hzero : ∀ p q, p+q=n → Subsingleton ((row K q).homology p)) : + Subsingleton ((K.total c).homology n) := by + have : Subsingleton (ConcreteHomology.H (K.total c) n) := by + apply E2Leading.subsingleton_total_concrete K n + intro p q hpq + have := hzero p q hpq + exact (rowHomologyIso K p q).toLinearEquiv.symm.injective.subsingleton + exact (ConcreteHomology.iso (K.total c) n).toLinearEquiv.injective.subsingleton +end TotalFiniteness + +namespace EilenbergZilber +open DiagonalResolution ModelAssembly +variable (X : Dᵒᵖ ⥤ Type) +lemma subsingleton_diagonal (n : ℕ) + (hzero : ∀ p q, p+q=n → Subsingleton + ((TotalFiniteness.row (twoComplex X) q).homology p)) : + Subsingleton (SSet.homology (C:=A) (diag ⋙ X) Z n) := by + have := TotalFiniteness.subsingleton (twoComplex X) n hzero + exact (homologyIso X n).toLinearEquiv.injective.subsingleton +end EilenbergZilber + +end + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/TotalProjection.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/TotalProjection.lean new file mode 100644 index 0000000000000000000000000000000000000000..9ac2f6f1f92d17f611c132479ef77251d39179bc --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/TotalProjection.lean @@ -0,0 +1,281 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.ModelAssembly + +namespace OAI + +section + +section + +open CategoryTheory Limits HomologicalComplex HomologicalComplex₂ +namespace TotalProjection + +universe u v +variable {C : Type u} [Category.{v} C] [Preadditive C] [HasCoproducts.{0} C] +abbrev c := ComplexShape.down ℕ +variable (K : HomologicalComplex₂ C c c) + +noncomputable def projection (p q n : ℕ) : (K.total c).X n ⟶ (K.X p).X q := + K.totalDesc (fun i j _ => if hi : i=p then if hj : j=q then + eqToHom (by subst i; subst j; rfl) else 0 else 0) + +@[reassoc (attr := simp)] lemma inclusion_projection (p q n : ℕ) (h : p+q=n) : + K.ιTotal c p q n h ≫ projection K p q n = 𝟙 _ := by + simp [projection] + +@[reassoc] lemma inclusion_projection_of_ne (i j p q n : ℕ) (h : i+j=n) + (hne : (i,j) ≠ (p,q)) : + K.ιTotal c i j n h ≫ projection K p q n = 0 := by + simp only [projection,ι_totalDesc] + split_ifs with hi hj + · exact False.elim (hne (Prod.ext hi hj)) + all_goals rfl + +abbrev Index (n : ℕ) := ↥(Finset.HasAntidiagonal.antidiagonal n) +noncomputable abbrev inclusion (n : ℕ) (i : Index n) := + K.ιTotal c i.val.1 i.val.2 n (Finset.HasAntidiagonal.mem_antidiagonal.mp i.property) +noncomputable abbrev proj (n : ℕ) (i : Index n) := projection K i.val.1 i.val.2 n + +lemma sum_projection_inclusion (n : ℕ) : + (∑ i : Index n,proj K n i ≫ inclusion K n i) = 𝟙 _ := by + apply total.hom_ext + intro p q hpq + let j : Index n := ⟨(p,q),Finset.HasAntidiagonal.mem_antidiagonal.mpr hpq⟩ + rw [Preadditive.comp_sum] + rw [Finset.sum_eq_single j] + · change K.ιTotal c p q n hpq ≫ (proj K n j ≫ inclusion K n j) = _ + simp [j,←Category.assoc] + · intro i _ hij + rw [←Category.assoc,inclusion_projection_of_ne] + · simp + · exact fun h => hij (Subtype.ext h.symm) + · simp + +lemma hom_ext {A : C} {n : ℕ} {f g : A ⟶ (K.total c).X n} + (h : ∀ i : Index n,f ≫ proj K n i = g ≫ proj K n i) : f=g := by + rw [←Category.comp_id f,←Category.comp_id g,←sum_projection_inclusion K n] + simp only [Preadditive.comp_sum,←Category.assoc,h] + +@[reassoc] lemma D₁_projection (p q : ℕ) : + K.D₁ c (p+q+1) (p+q) ≫ projection K p q (p+q) = + projection K (p+1) q (p+q+1) ≫ (K.d (p+1) p).f q := by + apply total.hom_ext + intro i j hij + change i+j=p+q+1 at hij + cases i with + | zero => + have hj : j=p+q+1 := by omega + subst j + rw [←Category.assoc,TotalHomotopy.ι_d₁_zero,zero_comp, + inclusion_projection_of_ne_assoc K 0 (p+q+1) (p+1) q _ _ (by intro h; have := congrArg Prod.fst h; omega),zero_comp] + | succ i => + rw [←Category.assoc,TotalHomotopy.ι_d₁_succ i j (p+q) (by omega),Category.assoc] + by_cases hi : i=p + · subst i + have : j=q := by omega + subst j + simp + · rw [inclusion_projection_of_ne K i j p q _ _ (by intro h; exact hi (congrArg Prod.fst h)),comp_zero, + inclusion_projection_of_ne_assoc K (i+1) j (p+1) q _ _ (by intro h; have := congrArg Prod.fst h; omega),zero_comp] + +@[reassoc] lemma D₂_projection (p q : ℕ) : + K.D₂ c (p+q+1) (p+q) ≫ projection K p q (p+q) = + ((-1 : ℤˣ)^p) • (projection K p (q+1) (p+q+1) ≫ (K.X p).d (q+1) q) := by + apply total.hom_ext + intro i j hij + change i+j=p+q+1 at hij + cases j with + | zero => + have hi : i=p+q+1 := by omega + subst i + rw [←Category.assoc,TotalHomotopy.ι_d₂_zero,zero_comp,Linear.comp_units_smul,←Category.assoc, + inclusion_projection_of_ne K (p+q+1) 0 p (q+1) _ _ (by intro h; have := congrArg Prod.snd h; omega),zero_comp,smul_zero] + | succ j => + rw [←Category.assoc,TotalHomotopy.ι_d₂_succ i j (p+q) (by omega)] + simp only [Linear.units_smul_comp,Linear.comp_units_smul,Category.assoc] + by_cases hi : i=p + · subst i + have : j=q := by omega + subst j + simp + · rw [inclusion_projection_of_ne K i j p q _ _ (by intro h; exact hi (congrArg Prod.fst h)),comp_zero,smul_zero, + inclusion_projection_of_ne_assoc K i (j+1) p (q+1) _ _ (by intro h; exact hi (congrArg Prod.fst h)),zero_comp,smul_zero] + +@[reassoc] lemma d_projection (p q : ℕ) : + (K.total c).d (p+q+1) (p+q) ≫ projection K p q (p+q) = + projection K (p+1) q (p+q+1) ≫ (K.d (p+1) p).f q + + ((-1 : ℤˣ)^p) • (projection K p (q+1) (p+q+1) ≫ (K.X p).d (q+1) q) := by + change (K.D₁ _ _ _ + K.D₂ _ _ _) ≫ _ = _ + rw [Preadditive.add_comp,D₁_projection,D₂_projection] + +end TotalProjection + +end + +section + +namespace FilteredFiniteness + +universe u +variable {R : Type u} [CommRing R] +variable {A B C E : Type u} [AddCommGroup A] [Module R A] + [AddCommGroup B] [Module R B] [AddCommGroup C] [Module R C] + [AddCommGroup E] [Module R E] + +lemma finite_of_ker_le [IsNoetherianRing R] (f : A →ₗ[R] B) (g : A →ₗ[R] E) + (hf : Function.Surjective f) (hker : LinearMap.ker g ≤ LinearMap.ker f) + [Module.Finite R E] : Module.Finite R B := by + have : Module.Finite R (LinearMap.range g) := + Module.Finite.of_injective (LinearMap.range g).subtype Subtype.val_injective + have : Module.Finite R (A ⧸ LinearMap.ker g) := + Module.Finite.equiv g.quotKerEquivRange.symm + let φ := (LinearMap.ker g).liftQ f hker + exact Module.Finite.of_surjective φ (by + intro b + obtain ⟨a,rfl⟩ := hf b + exact ⟨(LinearMap.ker g).mkQ a,rfl⟩) + +structure Data where + d : A →ₗ[R] B + e : B →ₗ[R] C + de : e.comp d=0 + FA : ℤ → Submodule R A + FB : ℤ → Submodule R B + FC : ℤ → Submodule R C + monoB : Monotone FB + +namespace Data +variable (K : Data (R:=R) (A:=A) (B:=B) (C:=C)) + +def dCycles : A →ₗ[R] LinearMap.ker K.e := + K.d.codRestrict _ (fun x => by + change K.e (K.d x)=0 + exact congrArg (fun f : A →ₗ[R] C => f x) K.de) + +abbrev H := LinearMap.ker K.e ⧸ LinearMap.range K.dCycles + +def π : LinearMap.ker K.e →ₗ[R] K.H := (LinearMap.range K.dCycles).mkQ + +def cycles (p : ℤ) : Submodule R (LinearMap.ker K.e) := + (K.FB p).comap (LinearMap.ker K.e).subtype + +def πp (p : ℤ) : K.cycles p →ₗ[R] K.H := K.π.comp (K.cycles p).subtype + +def filtration (p : ℤ) : Submodule R K.H := LinearMap.range (K.πp p) + +lemma filtration_mono : Monotone K.filtration := by + intro p q hpq y hy + obtain ⟨x,rfl⟩ := hy + exact ⟨⟨x.val,K.monoB hpq x.property⟩,rfl⟩ + +def Z₂ (p : ℤ) : Submodule R B := K.FB p ⊓ (K.FC (p-2)).comap K.e + +def B₂ (p : ℤ) : Submodule R B := + (K.FB (p-1) ⊓ (K.FC (p-2)).comap K.e) ⊔ ((K.FA (p+1)).map K.d ⊓ K.FB p) + +lemma B₂_le_Z₂ (p : ℤ) : K.B₂ p ≤ K.Z₂ p := by + apply sup_le + · exact inf_le_inf (K.monoB (by omega)) le_rfl + · intro x hx + obtain ⟨y,hy,rfl⟩ := hx.1 + refine ⟨hx.2,?_⟩ + change K.e (K.d y) ∈ K.FC (p-2) + have he : K.e (K.d y)=0 := congrArg (fun f : A →ₗ[R] C => f y) K.de + rw [he] + exact (K.FC _).zero_mem + +abbrev E₂ (p : ℤ) := K.Z₂ p ⧸ (K.B₂ p).comap (K.Z₂ p).subtype + +def lead (p : ℤ) : K.cycles p →ₗ[R] K.E₂ p := + ((K.B₂ p).comap (K.Z₂ p).subtype).mkQ.comp + (((LinearMap.ker K.e).subtype.comp (K.cycles p).subtype).codRestrict _ (fun x => by + refine ⟨x.property,?_⟩ + change K.e x.val.val∈K.FC (p-2) + rw [x.val.property] + exact (K.FC _).zero_mem)) + +lemma lead_eq_zero {p : ℤ} (x : K.cycles p) : + K.lead p x=0 ↔ x.val.val∈K.B₂ p := by + exact Submodule.Quotient.mk_eq_zero ((K.B₂ p).comap (K.Z₂ p).subtype) + +lemma lower_of_lead_zero {p : ℤ} (x : K.cycles p) (hx : K.lead p x=0) : + K.πp p x∈K.filtration (p-1) := by + obtain ⟨y,hy,z,hz,hyz⟩ := Submodule.mem_sup.mp ((K.lead_eq_zero x).mp hx) + obtain ⟨a,ha,haz⟩ := hz.1 + have hza : K.e z=0 := by + rw [←haz] + exact congrArg (fun f : A →ₗ[R] C => f a) K.de + have hey : K.e y=0 := by + have he := congrArg K.e hyz + rw [map_add,hza,add_zero,x.val.property] at he + exact he + let y' : K.cycles (p-1) := ⟨⟨y,hey⟩,hy.1⟩ + refine ⟨y',?_⟩ + change K.π ⟨y,hey⟩=K.π x.val + apply (Submodule.Quotient.eq _).mpr + refine ⟨-a,?_⟩ + apply Subtype.ext + change K.d (-a)=y-x.val.val + rw [map_neg,haz,←hyz] + abel + +variable [IsNoetherianRing R] + +lemma finite_step (p : ℤ) [Module.Finite R (K.filtration (p-1))] + [Module.Finite R (K.E₂ p)] : Module.Finite R (K.filtration p) := by + let S : Submodule R (K.filtration p) := + (K.filtration (p-1)).submoduleOf (K.filtration p) + have : Module.Finite R S := Module.Finite.equiv + (Submodule.submoduleOfEquivOfLe (K.filtration_mono (by omega : p-1≤p))).symm + let f : K.cycles p →ₗ[R] (K.filtration p ⧸ S) := S.mkQ.comp (K.πp p).rangeRestrict + have hf : Function.Surjective f := (Submodule.mkQ_surjective S).comp + (by rintro ⟨y,x,rfl⟩; exact ⟨x,rfl⟩) + have hk : LinearMap.ker (K.lead p) ≤ LinearMap.ker f := by + intro x hx + change f x=0 + apply (Submodule.Quotient.mk_eq_zero S).mpr + exact K.lower_of_lead_zero x hx + have : Module.Finite R (K.filtration p ⧸ S) := finite_of_ker_le f (K.lead p) hf hk + exact Module.Finite.of_submodule_quotient S + +lemma finite_H (N : ℕ) (hzero : K.FB 0=⊥) (htop : K.FB (N+1)=⊤) + (hfinite : ∀ p : ℕ, p≤N → Module.Finite R (K.E₂ (p+1))) : Module.Finite R K.H := by + have hz : K.filtration 0=⊥ := by + apply le_antisymm _ bot_le + rintro y ⟨x,rfl⟩ + have hx : x=0 := by + apply Subtype.ext; apply Subtype.ext + exact (Submodule.mem_bot R).mp (hzero ▸ x.property) + rw [hx,map_zero] + exact Submodule.zero_mem _ + have hfg : ∀ p : ℕ, p≤N+1 → Module.Finite R (K.filtration p) := by + intro p hp + induction p with + | zero => rw [Nat.cast_zero,hz]; infer_instance + | succ p ih => + have := ih (by omega) + have := hfinite p (by omega) + have he : (p:ℤ)+1-1=(p:ℤ) := by omega + have : Module.Finite R (K.filtration ((p:ℤ)+1-1)) := by rw [he]; infer_instance + exact K.finite_step (p+1) + have hh : K.filtration (N+1)=⊤ := by + apply top_le_iff.mp + intro y _ + obtain ⟨z,rfl⟩ := Submodule.mkQ_surjective (LinearMap.range K.dCycles) y + exact ⟨⟨z,by change z.val∈K.FB (N+1); rw [htop]; trivial⟩,rfl⟩ + have := hfg (N+1) le_rfl + exact Module.Finite.of_surjective (K.filtration ((N+1:ℕ):ℤ)).subtype (by + intro x + refine ⟨⟨x,?_⟩,rfl⟩ + have he : ((N+1:ℕ):ℤ)=(N:ℤ)+1 := by omega + rw [he,hh] + trivial) + +end Data +end FilteredFiniteness + +end + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/TotalSingle.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/TotalSingle.lean new file mode 100644 index 0000000000000000000000000000000000000000..2b6e6eeeda64477d218d174a5062ae3784ce7314 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/TotalSingle.lean @@ -0,0 +1,210 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.ModelAssembly +import OAI.GroupTheory.SimpleAmenable.Homology.BiResolution + +namespace OAI + +section + +open CategoryTheory Limits HomologicalComplex HomologicalComplex₂ +namespace TotalHomotopy + +universe u v +variable {C : Type u} [Category.{v} C] [Preadditive C] [HasZeroObject C] [HasCoproducts.{0} C] + +noncomputable def equiv {K L : HomologicalComplex₂ C c c} (e : HomotopyEquiv K L) : + HomotopyEquiv (K.total c) (L.total c) where + hom := HomologicalComplex₂.total.map e.hom c + inv := HomologicalComplex₂.total.map e.inv c + homotopyHomInvId := by simpa using total e.homotopyHomInvId + homotopyInvHomId := by simpa using total e.homotopyInvHomId + +noncomputable abbrev single (K : ChainComplex C ℕ) : HomologicalComplex₂ C c c := (ChainComplex.single₀ (ChainComplex C ℕ)).obj K + +noncomputable def singleIn (K : ChainComplex C ℕ) : K ⟶ (single K).total c where + f n := (single K).ιTotal c 0 n n (by simp) + comm' i j h := by + change j+1=i at h + subst i + exact ι_d_leftZero (K := single K) j + +noncomputable def singleOutF (K : ChainComplex C ℕ) (n : ℕ) : + ((single K).total c).X n ⟶ K.X n := + (single K).totalDesc (fun p q hpq => if hp : p=0 then by + subst p + have hq : q=n := by simpa using hpq + subst q + exact 𝟙 _ + else 0) +@[reassoc, simp] lemma singleIn_out (K : ChainComplex C ℕ) (n : ℕ) : + (singleIn K).f n ≫ singleOutF K n = 𝟙 _ := by + dsimp only [singleIn, singleOutF] + erw [ι_totalDesc] + simp +@[reassoc, simp] lemma singleOut_in (K : ChainComplex C ℕ) (n : ℕ) : + singleOutF K n ≫ (singleIn K).f n = 𝟙 _ := by + apply HomologicalComplex₂.total.hom_ext + intro p q hpq + simp only [←Category.assoc,singleOutF,ι_totalDesc] + split_ifs with hp + · subst p + have : q=n := by simpa using hpq + subst q + dsimp only [singleIn] + erw [Category.id_comp, Category.comp_id] + · have hz : IsZero (((single K).X p).X q) := by + exact ((eval C c q).map_isZero + (isZero_single_obj_X c 0 K p hp)) + exact hz.eq_of_src _ _ + +instance singleIn_isIso (K : ChainComplex C ℕ) : IsIso (singleIn K) := by + have (n : ℕ) : IsIso ((singleIn K).f n) := + ⟨⟨singleOutF K n, singleIn_out K n, singleOut_in K n⟩⟩ + exact HomologicalComplex.Hom.isIso_of_components (singleIn K) + +noncomputable def singleIso (K : ChainComplex C ℕ) : (single K).total c ≅ K := + (asIso (singleIn K)).symm + +end TotalHomotopy + +end + +section + +open CategoryTheory Limits SimplicialObject Simplicial Opposite AlgebraicTopology +open HomologicalComplex HomologicalComplex₂ +namespace BiResolution + +open DiagonalResolution SSet.Augmented.StandardSimplex +abbrev c := ComplexShape.down ℕ + +noncomputable def pointAugmentation (d : D) : point d ⟶ (SimplicialObject.const A).obj Z where + app q := Sigma.desc (fun _ : q.unop ⟶ d.2 => 𝟙 Z) + naturality q q' f := by apply Sigma.hom_ext; intro g; simp [point] + +noncomputable def pointAugmented (d : D) : SimplicialObject.Augmented A where + left := point d + right := Z + hom := pointAugmentation d + +noncomputable def pointExtra (d : D) : (pointAugmented d).ExtraDegeneracy where + s' := Sigma.ι (fun _ : ⦋0⦌ ⟶ d.2 => Z) (zeroSimplex d.2) + s n := Sigma.desc (fun f : ⦋n⦌ ⟶ d.2 => Sigma.ι (fun _ : ⦋n+1⦌ ⟶ d.2 => Z) (shift f)) + s'_comp_ε := by exact Sigma.ι_comp_desc _ _ + s₀_comp_δ₁ := by + apply Sigma.hom_ext + intro f + dsimp only [pointAugmented,pointAugmentation,SimplicialObject.δ,point] + simp only [Sigma.ι_comp_desc_assoc,Sigma.ι_comp_desc,Quiver.Hom.unop_op,shift_δ₁,Category.id_comp] + s_comp_δ₀ n := by + apply Sigma.hom_ext + intro f + dsimp only [pointAugmented,pointAugmentation,SimplicialObject.δ,point] + simp only [Sigma.ι_comp_desc_assoc,Sigma.ι_comp_desc,Quiver.Hom.unop_op,shift_δ₀,Category.comp_id] + s_comp_δ n i := by + apply Sigma.hom_ext + intro f + dsimp only [pointAugmented,pointAugmentation,SimplicialObject.δ,point] + simp only [Sigma.ι_comp_desc_assoc,Sigma.ι_comp_desc,Quiver.Hom.unop_op,shift_δ_succ] + s_comp_σ n i := by + apply Sigma.hom_ext + intro f + dsimp only [pointAugmented,pointAugmentation,SimplicialObject.σ,point] + simp only [Sigma.ι_comp_desc_assoc,Sigma.ι_comp_desc,Quiver.Hom.unop_op,shift_σ_succ] + +noncomputable def complexAt (d : D) : HomologicalComplex₂ A c c := + AlternatingFaceMapComplex.obj (chainsAt d ⋙ alternatingFaceMapComplex A) + +noncomputable def complexAtIso (d : D) : + (((alternatingFaceMapComplex A).mapHomologicalComplex c).obj + (AlternatingFaceMapComplex.obj (chainsAt d))) ≅ complexAt d := + eqToIso (congrArg (fun F => F.obj (chainsAt d)) + (map_alternatingFaceMapComplex (alternatingFaceMapComplex A))) + +noncomputable def complexAtEquiv (d : D) : HomotopyEquiv (complexAt d) + (TotalHomotopy.single (AlternatingFaceMapComplex.obj (point d))) := + (HomotopyEquiv.ofIso (complexAtIso d).symm).trans + (((alternatingFaceMapComplex A).mapHomotopyEquiv (extra d).homotopyEquiv).trans + (HomotopyEquiv.ofIso ((HomologicalComplex.singleMapHomologicalComplex + (alternatingFaceMapComplex A) c 0).app (point d)))) + +noncomputable def totalAtEquiv (d : D) : HomotopyEquiv ((complexAt d).total c) + ((ChainComplex.single₀ A).obj Z) := + (TotalHomotopy.equiv (complexAtEquiv d)).trans + ((HomotopyEquiv.ofIso (TotalHomotopy.singleIso _)).trans (pointExtra d).homotopyEquiv) + +end BiResolution + +end + +open CategoryTheory Limits HomologicalComplex HomologicalComplex₂ +namespace TotalFunctor + +universe u v u' v' +variable {C : Type u} [Category.{v} C] [Preadditive C] [HasCoproducts.{0} C] + {E : Type u'} [Category.{v'} E] [Preadditive E] [HasCoproducts.{0} E] +open TotalHomotopy +variable (F : C ⥤ E) [F.Additive] +noncomputable abbrev map₂ (K : HomologicalComplex₂ C c c) : HomologicalComplex₂ E c c := + ((F.mapHomologicalComplex c).mapHomologicalComplex c).obj K + +noncomputable def comparisonF (K : HomologicalComplex₂ C c c) (n : ℕ) : + ((map₂ F K).total c).X n ⟶ F.obj ((K.total c).X n) := + (map₂ F K).totalDesc (fun p q hpq => F.map (K.ιTotal c p q n hpq)) + +@[reassoc (attr := simp)] lemma ι_comparisonF (K : HomologicalComplex₂ C c c) + (p q n : ℕ) (hpq : p+q=n) : + (map₂ F K).ιTotal c p q n hpq ≫ comparisonF F K n = F.map (K.ιTotal c p q n hpq) := by + apply ι_totalDesc + +noncomputable def comparison (K : HomologicalComplex₂ C c c) : + (map₂ F K).total c ⟶ (F.mapHomologicalComplex c).obj (K.total c) where + f := comparisonF F K + comm' i j h := by + change j+1=i at h + subst i + apply total.hom_ext + intro p q hpq + change p+q=j+1 at hpq + cases p with + | zero => + have hq : q=j+1 := by omega + subst q + simp only [←Category.assoc,Functor.mapHomologicalComplex_obj_d] + rw [ι_comparisonF,←F.map_comp,ι_d_leftZero,ι_d_leftZero, + F.map_comp,Category.assoc,ι_comparisonF] + rfl + | succ p => + cases q with + | zero => + have hp : p=j := by omega + subst p + simp only [←Category.assoc,Functor.mapHomologicalComplex_obj_d] + rw [ι_comparisonF,←F.map_comp,ι_d_rightZero,ι_d_rightZero, + F.map_comp,Category.assoc,ι_comparisonF] + rfl + | succ q => + have h : p+q+1=j := by omega + simp only [←Category.assoc,Functor.mapHomologicalComplex_obj_d] + rw [ι_comparisonF,←F.map_comp,ι_d_both p q j h,ι_d_both p q j h] + simp only [F.map_add,F.map_units_smul,F.map_comp,Preadditive.add_comp, + Linear.units_smul_comp,Category.assoc,ι_comparisonF] + rfl + +instance comparisonF_isIso [PreservesColimitsOfSize.{0,0} F] + (K : HomologicalComplex₂ C c c) (n : ℕ) : IsIso (comparisonF F K n) := by + change IsIso (sigmaComparison F (fun ij : {ij : ℕ×ℕ // ij.1+ij.2=n} => (K.X ij.1.1).X ij.1.2)) + infer_instance + +instance comparison_isIso [PreservesColimitsOfSize.{0,0} F] + (K : HomologicalComplex₂ C c c) : IsIso (comparison F K) := by + have (n : ℕ) : IsIso ((comparison F K).f n) := comparisonF_isIso F K n + exact HomologicalComplex.Hom.isIso_of_components _ + +noncomputable def iso [PreservesColimitsOfSize.{0,0} F] (K : HomologicalComplex₂ C c c) : + (F.mapHomologicalComplex c).obj (K.total c) ≅ (map₂ F K).total c := + (asIso (comparison F K)).symm + +end TotalFunctor + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/TrajectoryDifferential.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/TrajectoryDifferential.lean new file mode 100644 index 0000000000000000000000000000000000000000..658eeb67da4254a6b91b55c81077c058ff48c63d --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/TrajectoryDifferential.lean @@ -0,0 +1,86 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.Supplemental +import OAI.GroupTheory.SimpleAmenable.Configurations.TrajectoryCoordinates + +namespace OAI + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory AlgebraicTopology +open scoped BigOperators TensorProduct +namespace SimpleAmenable.PolygonObject.LabelledStage +open Labelled IntervalBar.Diagram FreeChains + +attribute [local instance 1200] Rep.hV2 Representation.instModuleAsModule TensorProduct.instModule +variable {a n : ℕ} {K : Type} [AddCommGroup K] +noncomputable def coefficientDifferential (a n : ℕ) (K : Type) [AddCommGroup K] : + Coefficients a (n+1) K →ₗ[ℤ] Coefficients a n K := + ∑ i : Fin (n+2), (-1:ℤ)^(i:ℕ) • reindexCoefficients (a:=a) (K:=K) (faceFunctor i) +lemma chainCoordinates_d : + (chainCoordinates a n K).toLinearMap.comp (coefficientDifferential a n K) = + (groupHomology.inhomogeneousChains.d (SquareStep.coefficientRep a K) n).hom.comp + (chainCoordinates a (n+1) K).toLinearMap := by + classical + apply Finsupp.lhom_ext' + intro l + apply LinearMap.ext + intro v + change chainCoordinates a n K (coefficientDifferential a n K (Finsupp.single l v)) = + groupHomology.inhomogeneousChains.d (SquareStep.coefficientRep a K) n + (chainCoordinates a (n+1) K (Finsupp.single l v)) + simp only [coefficientDifferential,LinearMap.sum_apply,LinearMap.smul_apply, + map_sum,map_smul,chainCoordinates_single] + rw [Fin.sum_univ_succ] + simp only [Fin.val_zero,pow_zero,chainCoordinates_zero_face,Fin.val_succ, + chainCoordinates_succ_face] + erw [one_smul] + exact (groupHomology.inhomogeneousChains.d_single (A:=SquareStep.coefficientRep a K) + n (signedLabelEquiv (n+1) l) ((BooleanStep.tensorEquiv (a:=a) (K:=K)).symm v)).symm +noncomputable def trajectoryRep (a j : ℕ) := + @SquareStep.coefficientRep a (Stage.K j) inferInstance (AddCommGroup.toIntModule _) +noncomputable def trajectoryRow (a j : ℕ) : SimplicialObject (ModuleCat ℤ) := + RestrictedNerve.stringBarRows (positionalProperty a) ⋙ SSet.homologyFunctor Z j +noncomputable def rowCoordinateIso (a n j : ℕ) (hj : 0 rowCoordinateIso a n j hj hj5) ?_ + rintro n m rfl + symm + change _ ≫ (stringCoefficientIso a m j hj hj5).hom ≫ + ModuleCat.ofHom (chainCoordinates a m (Stage.K j)).toLinearMap = + ((stringCoefficientIso a (m+1) j hj hj5).hom ≫ + ModuleCat.ofHom (chainCoordinates a (m+1) (Stage.K j)).toLinearMap) ≫ _ + erw [←Category.assoc,trajectoryRow_d,Category.assoc,groupHomology.inhomogeneousChains.d_def] + apply ModuleCat.hom_ext + exact congrArg + (fun linear => LinearMap.comp linear (stringCoefficientIso a (m+1) j hj hj5).hom.hom) + (chainCoordinates_d (a:=a) (n:=m) (K:=Stage.K j)) +end SimpleAmenable.PolygonObject.LabelledStage + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/TrajectoryTensor.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/TrajectoryTensor.lean new file mode 100644 index 0000000000000000000000000000000000000000..35b3e999ea9bc467032a2ad54a9c964d4449b68e --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/TrajectoryTensor.lean @@ -0,0 +1,47 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.TorusCoefficientFinite +import OAI.GroupTheory.SimpleAmenable.Homology.TranslationCoefficients + +namespace OAI + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory +open scoped TensorProduct +namespace SimpleAmenable.PolygonObject.LabelledStage + +variable {a : ℕ} {K : Type} [AddCommGroup K] +lemma tensorEquiv_translation (u : CutRing × CutRing) (v : SquareStep a ⊗[ℤ] K) : + (BooleanStep.tensorEquiv (a:=a) (K:=K)) + ((SquareStep.coefficientRep a K).ρ (SquareStep.orbitProjection (Multiplicative.ofAdd u)) v) = + stepTranslate (K:=K) u ((BooleanStep.tensorEquiv (a:=a) (K:=K)) v) := by + induction v using TensorProduct.inductionOn with + | add left right left_eq right_eq => + let action : (SquareStep a ⊗[ℤ] K) →ₗ[ℤ] (SquareStep a ⊗[ℤ] K) := + (SquareStep.coefficientRep a K).ρ (SquareStep.orbitProjection (Multiplicative.ofAdd u)) + change BooleanStep.tensorEquiv (a:=a) (K:=K) (action (left + right)) = _ + change BooleanStep.tensorEquiv (a:=a) (K:=K) (action left) = _ at left_eq + change BooleanStep.tensorEquiv (a:=a) (K:=K) (action right) = _ at right_eq + simp only [map_add,left_eq,right_eq] + | tmul f k => + change (BooleanStep.tensorMap (a:=a) (K:=K)) + (SquareStep.orbitRepresentation a (SquareStep.orbitProjection (Multiplicative.ofAdd u)) f ⊗ₜ[ℤ] k) = _ + rw [←SquareStep.representation_reduce] + apply Subtype.ext + funext p + rfl +lemma tensorEquiv_symm_translation (u : CutRing × CutRing) (v : BooleanStep a K) : + (BooleanStep.tensorEquiv (a:=a) (K:=K)).symm (stepTranslate (K:=K) u v) = + (SquareStep.coefficientRep a K).ρ (SquareStep.orbitProjection (Multiplicative.ofAdd u)) + ((BooleanStep.tensorEquiv (a:=a) (K:=K)).symm v) := by + apply (BooleanStep.tensorEquiv (a:=a) (K:=K)).injective + rw [LinearEquiv.apply_symm_apply,tensorEquiv_translation,LinearEquiv.apply_symm_apply] +@[simp] lemma stepTranslate_zero (v : BooleanStep a K) : stepTranslate (K:=K) 0 v=v := by + apply Subtype.ext + funext p + change v.val (SimpleAmenable.translate a (-0) p)=v.val p + simp +end SimpleAmenable.PolygonObject.LabelledStage + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/TransitiveCanonical.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/TransitiveCanonical.lean new file mode 100644 index 0000000000000000000000000000000000000000..41a385fb8fbbb69136187066c5fde674571a44f0 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/TransitiveCanonical.lean @@ -0,0 +1,122 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Configurations.TransitiveInduction +import OAI.GroupTheory.SimpleAmenable.Simplicial.ConjugationNatural + +namespace OAI + +open CategoryTheory CategoryTheory.Limits Representation Rep Finsupp +namespace SimpleAmenable.TransitiveInduction +variable {G X Y : Type} [Group G] [MulAction G X] [MulAction G Y] + +lemma pointMap_factorization (x : X) (ht : ∀y : X, ∃g : G, g • x=y) : + pointMap (G:=G) x = + CanonicalShapiro.indUnit (MulAction.stabilizer G x).subtype + (Rep.trivial ℤ (MulAction.stabilizer G x) ℤ) ≫ + (Rep.resFunctor.{0,0,0,0} (MulAction.stabilizer G x).subtype).map (iso x ht).hom := by + apply Rep.hom_ext + apply Representation.IntertwiningMap.ext + apply LinearMap.ext + intro z + change Finsupp.single x z = + toPermutation x ((CanonicalShapiro.indUnit _ _).hom z) + rw [CanonicalShapiro.indUnit_apply, toPermutation_mk] + simp +lemma isIso_map_pointMap (x : X) (ht : ∀y : X, ∃g : G, g • x=y) (q : ℕ) : + IsIso (groupHomology.map (MulAction.stabilizer G x).subtype (pointMap x) q) := by + rw [pointMap_factorization x ht] + have hn : groupHomology.map (MulAction.stabilizer G x).subtype + (CanonicalShapiro.indUnit _ (Rep.trivial ℤ (MulAction.stabilizer G x) ℤ) ≫ + (Rep.resFunctor.{0,0,0,0} (MulAction.stabilizer G x).subtype).map (iso x ht).hom) q = + groupHomology.map (MulAction.stabilizer G x).subtype + (CanonicalShapiro.indUnit _ (Rep.trivial ℤ (MulAction.stabilizer G x) ℤ)) q ≫ + (groupHomology.functor ℤ G q).map (iso x ht).hom := + groupHomology.map_comp (C:=Rep.of (permutationRep (G:=G) (X:=X))) + (MulAction.stabilizer G x).subtype (MonoidHom.id G) + (CanonicalShapiro.indUnit _ (Rep.trivial ℤ (MulAction.stabilizer G x) ℤ)) + (iso x ht).hom q + rw [hn] + have first := CanonicalShapiro.isIso_map_indUnit (MulAction.stabilizer G x) + (Rep.trivial ℤ (MulAction.stabilizer G x) ℤ) q + have second : IsIso ((groupHomology.functor ℤ G q).map (iso x ht).hom) := inferInstance + have composite := IsIso.comp_isIso' first second + exact composite + +noncomputable def equivariantMap (f : X → Y) (hf : ∀g : G,∀x,f (g • x)=g • f x) : + Rep.of (permutationRep (G:=G) (X:=X)) ⟶ + Rep.of (permutationRep (G:=G) (X:=Y)) := + Rep.ofHom ⟨Finsupp.lmapDomain ℤ ℤ f, by + intro g + apply Finsupp.lhom_ext + intro x z + simp [permutationRep, hf]⟩ + +@[simp] lemma equivariantMap_single (f : X → Y) (hf : ∀g : G,∀x,f (g • x)=g • f x) + (x : X) (z : ℤ) : (equivariantMap f hf).hom (Finsupp.single x z) = + Finsupp.single (f x) z := by + simp [equivariantMap] + +def stabilizerMap (f : X → Y) (hf : ∀g : G,∀x,f (g • x)=g • f x) (x : X) : + MulAction.stabilizer G x →* MulAction.stabilizer G (f x) := + (MulAction.stabilizer G x).inclusion (by + intro g hg + change g • f x=f x + rw [← hf, hg]) + +noncomputable def trivialMap {K L : Type} [Group K] [Group L] (f : K →* L) : + Rep.trivial ℤ K ℤ ⟶ Rep.res f (Rep.trivial ℤ L ℤ) := + Rep.ofHom ⟨LinearMap.id, fun _ => rfl⟩ +lemma pointMap_natural (f : X → Y) (hf : ∀g : G,∀x,f (g • x)=g • f x) (x : X) (q : ℕ) : + groupHomology.map (MulAction.stabilizer G x).subtype (pointMap x) q ≫ + (groupHomology.functor ℤ G q).map (equivariantMap f hf) = + groupHomology.map (A:=Rep.trivial ℤ (MulAction.stabilizer G x) ℤ) (B:=Rep.trivial ℤ (MulAction.stabilizer G (f x)) ℤ) (stabilizerMap f hf x) (trivialMap (stabilizerMap f hf x)) q ≫ + groupHomology.map (MulAction.stabilizer G (f x)).subtype (pointMap (f x)) q := by + rw [groupHomology.functor_map] + erw [← groupHomology.map_comp, ← groupHomology.map_comp] + apply groupHomology.map_congr + · rfl + · apply LinearMap.ext + intro z + change (equivariantMap f hf).hom (Finsupp.single x z) = Finsupp.single (f x) z + exact equivariantMap_single f hf x z + +lemma isIso_map_trivial_H0 {K L : Type} [Group K] [Group L] (f : K →* L) : + IsIso (groupHomology.map f (trivialMap f) 0) := by + have he : (groupHomology.H0IsoOfIsTrivial (Rep.trivial ℤ K ℤ)).inv ≫ + groupHomology.map f (trivialMap f) 0 = + (groupHomology.H0IsoOfIsTrivial (Rep.trivial ℤ L ℤ)).inv := by + rw [groupHomology.H0IsoOfIsTrivial_inv_eq_π, + groupHomology.H0π_comp_map, groupHomology.H0IsoOfIsTrivial_inv_eq_π] + change 𝟙 _ ≫ _ = _ + exact Category.id_comp _ + exact IsIso.of_isIso_fac_left he +lemma map_equivariant_eq_of_centralizer + (f₀ f₁ : X → Y) (h₀ : ∀g : G,∀x,f₀ (g • x)=g • f₀ x) + (h₁ : ∀g : G,∀x,f₁ (g • x)=g • f₁ x) + (x : X) (ht : ∀y : X, ∃g : G,g • x=y) (c : G) + (hc : ∀h : MulAction.stabilizer G x,c*h.val=h.val*c) + (hx : c • f₀ x=f₁ x) (q : ℕ) : + (groupHomology.functor ℤ G q).map (equivariantMap f₁ h₁) = + (groupHomology.functor ℤ G q).map (equivariantMap f₀ h₀) := by + let := isIso_map_pointMap x ht q + apply (cancel_epi (groupHomology.map (MulAction.stabilizer G x).subtype (pointMap x) q)).1 + rw [groupHomology.functor_map, groupHomology.functor_map] + erw [← groupHomology.map_comp, ← groupHomology.map_comp] + apply HomologyConjugation.map_eq_of_centralizer _ _ _ c hc + intro z + change (equivariantMap f₁ h₁).hom (Finsupp.single x z) = + permutationRep c ((equivariantMap f₀ h₀).hom (Finsupp.single x z)) + rw [equivariantMap_single, equivariantMap_single, permutationRep_single, hx] +lemma isIso_map_equivariant_H0 (f : X → Y) (hf : ∀g : G,∀x,f (g • x)=g • f x) + (x : X) (htx : ∀y:X,∃g:G,g • x=y) + (hty : ∀y:Y,∃g:G,g • f x=y) : + IsIso ((groupHomology.functor ℤ G 0).map (equivariantMap f hf)) := by + have sourceIso := isIso_map_pointMap x htx 0 + have targetIso := isIso_map_pointMap (f x) hty 0 + have trivialIso := isIso_map_trivial_H0 (stabilizerMap f hf x) + have composite := IsIso.comp_isIso' trivialIso targetIso + exact @IsIso.of_isIso_fac_left _ _ _ _ _ _ _ _ sourceIso composite + (pointMap_natural f hf x 0) + +end SimpleAmenable.TransitiveInduction + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/TranslationCoefficientAction.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/TranslationCoefficientAction.lean new file mode 100644 index 0000000000000000000000000000000000000000..07560c93a06d03f3256506ea0b14b7fe43ec33af --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/TranslationCoefficientAction.lean @@ -0,0 +1,117 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.Coefficient +import OAI.GroupTheory.SimpleAmenable.Simplicial.CoefficientNaturality + +namespace OAI + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits Simplicial Opposite +namespace RegularTranslation + +variable {P:Type} [CommMonoid P] +abbrev C := ActionCategory P P +lemma eqToHom_val {x y:C (P:=P)} (h:x=y) : (eqToHom h).hom=(1:P) := by subst y; rfl +noncomputable def shift (p:P) : C (P:=P) ⥤ C (P:=P) where + obj x := (p*x.back:P) + map f := ⟨f.hom,by change f.hom*(p*_)=_; rw [mul_left_comm]; exact congrArg (p*·) f.map_val⟩ + map_id _ := rfl + map_comp _ _ := rfl +lemma shift_one : shift (1:P)=𝟭 (C (P:=P)) := by + apply CategoryTheory.Functor.ext + · intro x y f; apply Functor.Elements.hom_ext + simp only [ActionCategory.comp_hom,eqToHom_val,one_mul,mul_one]; rfl + · intro x; apply (ActionCategory.objEquiv P P).symm.injective; exact one_mul _ +lemma shift_mul (p q:P) : shift (p*q)=shift p ⋙ shift q := by + apply CategoryTheory.Functor.ext + · intro x y f; apply Functor.Elements.hom_ext + simp only [ActionCategory.comp_hom,eqToHom_val,one_mul,mul_one]; rfl + · intro x; apply (ActionCategory.objEquiv P P).symm.injective + change (p*q)*x.back=q*(p*x.back) + simp only [mul_assoc,mul_left_comm] +noncomputable def forward (p:P) : 𝟭 (C (P:=P)) ⟶ shift p where + app x := ⟨p,rfl⟩ + naturality x y f := by apply Functor.Elements.hom_ext; exact mul_comm _ _ +end RegularTranslation +namespace RegularCoefficient +open CoefficientNerve RegularTranslation + +private lemma comp_step {V : Type*} [Category V] {A B C D E : V} + {i : A ⟶ B} {f : B ⟶ C} {g : C ⟶ D} {a : A ⟶ E} + {j : E ⟶ C} {k : E ⟶ D} + (hf : i ≫ f = a ≫ j) (hg : j ≫ g = k) : i ≫ f ≫ g = a ≫ k := by + rw [← Category.assoc, hf, Category.assoc, hg] + +private lemma comp_pair {V : Type*} [Category V] {A B C D E F : V} + {i : A ⟶ B} {f : B ⟶ C} {g : C ⟶ D} {a : A ⟶ E} + {j : E ⟶ C} {b : E ⟶ F} {k : F ⟶ D} + (h₁ : i ≫ f = a ≫ j) (h₂ : j ≫ g = b ≫ k) : + i ≫ f ≫ g = (a ≫ b) ≫ k := by + rw [← Category.assoc, h₁, Category.assoc, h₂, ← Category.assoc] + +variable {P:Type} [CommMonoid P] {R:Type} [CommRing R] +variable (F:ActionCategory P P ⥤ ModuleCat.{0} R) +noncomputable def action (p:P) : simplicial F ⟶ simplicial F := + mapNat (Functor.whiskerRight (forward p) F) ≫ post (shift p) F +@[reassoc] lemma single_action (p:P) {n:ℕ} (s:Simplex (ActionCategory P P) n) : + single F s ≫ (action F p).app (op ⦋n⦌)=F.map ((forward p).app s.right.unop) ≫ single F (s ⋙ (shift p).op) := by + simp only [action,NatTrans.comp_app] + exact comp_step (single_mapNat (Functor.whiskerRight (forward p) F) s) + (single_post (shift p) F n s) +lemma action_one : action F (1:P)=𝟙 _ := by + apply NatTrans.ext; funext n + apply hom_ext; intro s + change single F s ≫ (action F 1).app (op ⦋n.unop.len⦌)=single F s ≫ 𝟙 _ + rw [single_action,Category.comp_id] + conv_rhs => rw [←Category.id_comp (single F s),←F.map_id s.right.unop] + apply weighted_eq F (by rw [shift_one]; rfl) + apply Functor.Elements.hom_ext + simp only [ActionCategory.comp_hom,eqToHom_val,one_mul] + rfl +lemma action_mul (p q:P) : action F (p*q)=action F p ≫ action F q := by + apply NatTrans.ext; funext n + apply hom_ext; intro s + change single F s ≫ (action F (p*q)).app (op ⦋n.unop.len⦌)= + single F s ≫ (action F p).app (op ⦋n.unop.len⦌) ≫ (action F q).app (op ⦋n.unop.len⦌) + have hc := comp_pair (single_action F p s) (single_action F q (s ⋙ (shift p).op)) + refine (single_action F (p*q) s).trans (Eq.trans ?_ hc.symm) + rw [← F.map_comp] + apply weighted_eq F (by rw [shift_mul]; rfl) + apply Functor.Elements.hom_ext + simp only [ActionCategory.comp_hom,eqToHom_val,one_mul] + exact mul_comm p q +noncomputable def representation : SingleObj P ⥤ SimplicialObject (ModuleCat.{0} R) where + obj _ := simplicial F + map p := action F p + map_id _ := action_one F + map_comp p q := by change action F (q*p)=_; rw [mul_comm q p]; exact action_mul F p q +end RegularCoefficient + +end + +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits Simplicial Opposite HomologicalComplex AlgebraicTopology +namespace ChainComplex +open scoped _root_.ChainComplex + +variable {R:Type} [CommRing R] {K L:ChainComplex (ModuleCat.{0} R) ℕ} +@[reassoc] lemma zeroπ_natural (f:K⟶L) : f.f 0 ≫ zeroπ L=zeroπ K ≫ homologyMap f 0 := by + simp only [zeroπ,Category.assoc,_root_.ChainComplex.isoHomologyι₀_inv_naturality,HomologicalComplex.p_opcyclesMap_assoc] +end ChainComplex +namespace RegularCoefficient +open CoefficientNerve RegularTranslation + +variable {P:Type} [CommMonoid P] (F:ActionCategory P P ⥤ ModuleCat.{0} ℤ) +lemma zeroι_action (p:P) (x:ActionCategory P P) : + zeroι F x ≫ homologyMap ((alternatingFaceMapComplex _).map (action F p)) 0=zeroι F x := by + dsimp only [zeroι] + erw [Category.assoc,←ChainComplex.zeroπ_natural,←Category.assoc] + change (single F (ComposableArrows.mk₀ (op x)) ≫ (action F p).app (op ⦋0⦌)) ≫ _ = _ + erw [single_action,Category.assoc] + exact zeroι_naturality F ((forward p).app x) +lemma homology_action_zero (p:P) : + homologyMap ((alternatingFaceMapComplex _).map (action F p)) 0=𝟙 _ := by + apply (zeroIsColimit F).hom_ext + intro x + exact (zeroι_action F p x).trans (Category.comp_id _).symm +end RegularCoefficient + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/TranslationCoefficients.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/TranslationCoefficients.lean new file mode 100644 index 0000000000000000000000000000000000000000..b2c70f59c1987141acb364e5e8dcc997a5fd7421 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/TranslationCoefficients.lean @@ -0,0 +1,79 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.PointFiberHomology +import OAI.GroupTheory.SimpleAmenable.Configurations.TranslationFiber +import OAI.GroupTheory.SimpleAmenable.Simplicial.TranslationFiberMonoidal + +namespace OAI + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Classical +namespace SimpleAmenable.PolygonObject.LabelledStage + +variable {a n : ℕ} {K : Type} [AddCommGroup K] +noncomputable def stepTranslate (u : CutRing × CutRing) : BooleanStep a K →ₗ[ℤ] BooleanStep a K where + toFun f := ⟨fun p => f.val (SimpleAmenable.translate a (-u) p), + squareArrangement_translate f.property (-u)⟩ + map_add' _ _ := rfl + map_smul' _ _ := rfl +@[simp] lemma stepTranslate_apply (u : CutRing × CutRing) (f : BooleanStep a K) (p : GenericSquare a) : + (stepTranslate (K:=K) u f).val p = f.val (SimpleAmenable.translate a (-u) p) := rfl +variable (d : (Fin n → CutRing × CutRing) → CutRing × CutRing) +noncomputable def translateCoefficients : Coefficients a n K →ₗ[ℤ] Coefficients a n K := + Finsupp.lsum ℤ (fun l : ReducedLabel n => (Finsupp.lsingle l).comp (stepTranslate (d l.val))) +@[simp] lemma translateCoefficients_single (l : ReducedLabel n) (s : BooleanStep a K) : + translateCoefficients (K:=K) d (Finsupp.single l s)= + Finsupp.single l (stepTranslate (K:=K) (d l.val) s) := Finsupp.lsum_single _ _ _ _ +lemma translateCoefficients_at (f : Coefficients a n K) (l : ReducedLabel n) : + translateCoefficients (K:=K) d f l=stepTranslate (K:=K) (d l.val) (f l) := by + induction f using Finsupp.induction with + | zero => simp + | single_add k s f hk hs ih => + simp only [map_add,Finsupp.add_apply,ih] + congr 1 + rw [translateCoefficients_single] + by_cases h:k=l + · subst l; simp only [Finsupp.single_eq_same] + · simp only [Finsupp.single_eq_of_ne (Ne.symm h),map_zero] +end SimpleAmenable.PolygonObject.LabelledStage + +end + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits MonoidalCategory Classical +namespace SimpleAmenable.PolygonObject.LabelledStage.Stage +open IntervalBar.Diagram BarFinitePower FreeChains Labelled + +variable {a n : ℕ} +variable (d : (Fin n → CutRing × CutRing) → CutRing × CutRing) +lemma translation_evaluation_homology (j : ℕ) + (c : GenericSquare a × (Fin n → CutRing × CutRing)) : + SSet.homologyMap (bar₃Map (translateFunctor d ⋙ PointFiber.evaluation ⋙ project _ c)) Z j = + SSet.homologyMap (bar₃Map (PointFiber.evaluation ⋙ project _ (SimpleAmenable.translate a (-d c.2) c.1,c.2))) Z j := + (bar₃Map_eq_of_monoidalNatTrans (PointFiber.translationEvaluationIso d c).hom j).symm +lemma homologyCoefficientIso_translate_point (j : ℕ) (hj : 0 k x) + (homologyCoefficientIso_translate_point d j hj hj5 (p,l)) + change _ = (translateCoefficients (a:=a) (K:=K j) d ((homologyCoefficientIso j hj hj5).hom x) l).val p + rw [translateCoefficients_at,stepTranslate_apply] + exact h +end SimpleAmenable.PolygonObject.LabelledStage.Stage + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/UniformConcurrentMesh.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/UniformConcurrentMesh.lean new file mode 100644 index 0000000000000000000000000000000000000000..461d656f2d710789cc2dbce965a1b76661cb855f --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/UniformConcurrentMesh.lean @@ -0,0 +1,96 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.WindowRectangles + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section UniformConcurrentMesh + +noncomputable def lineIntersectionCoefficient (a : ℕ) (i j : Fin 4) : ℝ := + ((|ordinary (lineNormal a i).1|+|ordinary (lineNormal a i).2|+ + |ordinary (lineNormal a j).1|+|ordinary (lineNormal a j).2|)/ + |ordinary (lineDet a i j)|)* + max (|ordinary (lineNormal a i).1|+|ordinary (lineNormal a i).2|) + (|ordinary (lineNormal a j).1|+|ordinary (lineNormal a j).2|) + +noncomputable def lineIntersectionConstant (a : ℕ) : ℝ := + 1+∑ i : Fin 4, ∑ j : Fin 4, lineIntersectionCoefficient a i j + +theorem lineIntersectionCoefficient_nonneg (a : ℕ) (i j : Fin 4) : + 0≤lineIntersectionCoefficient a i j := by + unfold lineIntersectionCoefficient + positivity + +theorem lineIntersectionConstant_ge_one (a : ℕ) : 1≤lineIntersectionConstant a := by + unfold lineIntersectionConstant + have h : 0≤∑ i : Fin 4, ∑ j : Fin 4, lineIntersectionCoefficient a i j := + Finset.sum_nonneg (fun i _ => Finset.sum_nonneg (fun j _ => lineIntersectionCoefficient_nonneg a i j)) + linarith + +theorem lineIntersectionCoefficient_le (a : ℕ) (i j : Fin 4) : + lineIntersectionCoefficient a i j≤lineIntersectionConstant a := by + have h₁ := Finset.single_le_sum (fun k (_ : k ∈ (Finset.univ : Finset (Fin 4))) => + lineIntersectionCoefficient_nonneg a i k) (Finset.mem_univ j) + have h₂ := Finset.single_le_sum (fun k (_ : k ∈ (Finset.univ : Finset (Fin 4))) => + Finset.sum_nonneg (fun l (_ : l ∈ (Finset.univ : Finset (Fin 4))) => + lineIntersectionCoefficient_nonneg a k l)) (Finset.mem_univ i) + unfold lineIntersectionConstant + linarith + +theorem exists_uniform_concurrent_mesh (a : ℕ) (r : CutRing) (ε : ℝ) (hε : 0<ε) : + ∃ n : ℕ, 201≤n ∧ symmetricWindowLength r≤n ∧ + 200/(n:ℝ)<ε ∧ + ∀ i j : Fin 4, lineIntersectionCoefficient a i j*(200/(n:ℝ))<ε := by + obtain ⟨N,hN⟩ := exists_nat_gt (200*lineIntersectionConstant a/ε) + let n := max 201 (max N (symmetricWindowLength r)) + have hn : 201≤n := le_max_left _ _ + have hNN : N≤n := (le_max_left _ _).trans (le_max_right _ _) + have hn' : 0<(n:ℝ) := by exact_mod_cast (show 0 hP c⟩ + map f := ⟨(Functor.const (Fin (n+1))).map f⟩ + map_id _ := rfl + map_comp _ _ := rfl + +noncomputable def comparison (P : Subgroupoid C) + (hP : ∀c, (𝟙 c)∈P.arrows c c) (n : ℕ) : + evaluation P n ⋙ constant P hP n ≅ 𝟭 (Object P n) := by + refine NatIso.ofComponents (fun F => ?_) ?_ + · + refine ⟨⟨{ app := fun i => F.obj.map (homOfLE (Fin.zero_le i)) + naturality := ?_ }⟩, + ⟨{ app := fun i => Groupoid.inv (F.obj.map (homOfLE (Fin.zero_le i))) + naturality := ?_ }⟩,?_,?_⟩ + · intro i j f + change (𝟙 (F.obj.obj 0)) ≫ F.obj.map (homOfLE (Fin.zero_le j)) = + F.obj.map (homOfLE (Fin.zero_le i)) ≫ F.obj.map f + rw [Category.id_comp,←F.obj.map_comp] + congr 1 + · intro i j f + change F.obj.map f ≫ Groupoid.inv (F.obj.map (homOfLE (Fin.zero_le j))) = + Groupoid.inv (F.obj.map (homOfLE (Fin.zero_le i))) ≫ 𝟙 (F.obj.obj 0) + rw [Category.comp_id] + apply (cancel_mono (F.obj.map (homOfLE (Fin.zero_le j)))).mp + simp only [Category.assoc,Groupoid.inv_comp,Category.comp_id] + have he : F.obj.map (homOfLE (Fin.zero_le j))= + F.obj.map (homOfLE (Fin.zero_le i)) ≫ F.obj.map f := by + rw [←F.obj.map_comp]; congr 1 + rw [he,←Category.assoc,Groupoid.inv_comp,Category.id_comp] + · apply (ObjectProperty.hom_ext _) + ext i + exact Groupoid.comp_inv _ + · apply (ObjectProperty.hom_ext _) + ext i + exact Groupoid.inv_comp _ + · intro F G f + apply (ObjectProperty.hom_ext _) + ext i + change f.hom.app 0 ≫ G.obj.map (homOfLE (Fin.zero_le i)) = + F.obj.map (homOfLE (Fin.zero_le i)) ≫ f.hom.app i + exact (f.hom.naturality _).symm + +noncomputable def evaluationEquivalence (P : Subgroupoid C) + (hP : ∀c, (𝟙 c)∈P.arrows c c) (n : ℕ) : Object P n ≌ C where + functor := evaluation P n + inverse := constant P hP n + unitIso := (comparison P hP n).symm + counitIso := Iso.refl _ + functor_unitIso_comp F := by + change Groupoid.inv (F.obj.map (homOfLE (Fin.zero_le 0))) ≫ 𝟙 _ = 𝟙 _ + have he : (homOfLE (Fin.zero_le (0 : Fin (n+1))))=𝟙 0 := Subsingleton.elim _ _ + rw [he,F.obj.map_id] + simp + +noncomputable def polygonEvaluationEquivalence (a n : ℕ) : + Object (PolygonObject.positionalSubgroupoid a) n ≌ PolygonObject a := + evaluationEquivalence _ (PolygonObject.identity_positional) n + +end VerticalString +end VerticalStringResolution + +section IntegralTransgression +open Classical + +namespace IntegralTransgression +variable {H E : Type*} [Group H] [Group E] + +def Kernel (q : H →* E) (_hc : q.ker ≤ Subgroup.center H) : Type _ := q.ker + +instance kernelCommGroup (q : H →* E) (hc : q.ker ≤ Subgroup.center H) : + CommGroup (Kernel q hc) := by + change CommGroup q.ker + exact { (inferInstance : Group q.ker) with + mul_comm := fun x y => Subtype.ext (Subgroup.mem_center_iff.mp (hc x.property) y.val).symm } + +noncomputable def inclusion (q : H →* E) (hc : q.ker ≤ Subgroup.center H) : Kernel q hc →* H := + q.ker.subtype + +variable (q : H →* E) (hq : Function.Surjective q) (hc : q.ker ≤ Subgroup.center H) + +noncomputable def sectionMap (x : E) : H := if x=1 then 1 else Classical.choose (hq x) + +@[simp] theorem section_one : sectionMap q hq 1 = 1 := by simp [sectionMap] +@[simp] theorem section_projection (x : E) : q (sectionMap q hq x)=x := by + by_cases hx : x=1 + · simp [sectionMap,hx] + · simpa [sectionMap,hx] using Classical.choose_spec (hq x) + +noncomputable def factor (x y : E) : Kernel q hc := + ⟨sectionMap q hq x * sectionMap q hq y * (sectionMap q hq (x*y))⁻¹,by + change q (sectionMap q hq x * sectionMap q hq y * (sectionMap q hq (x*y))⁻¹) = 1 + simp⟩ + +noncomputable def remainder (h : H) : Kernel q hc := + ⟨h * (sectionMap q hq (q h))⁻¹,by + change q (h * (sectionMap q hq (q h))⁻¹) = 1 + simp⟩ + +@[simp] theorem factor_one_left (x : E) : factor q hq hc 1 x=1 := by + apply Subtype.ext; simp only [factor,section_one,one_mul,mul_inv_cancel]; rfl +@[simp] theorem factor_one_right (x : E) : factor q hq hc x 1=1 := by + apply Subtype.ext; simp only [factor,section_one,mul_one,mul_inv_cancel]; rfl +@[simp] theorem remainder_one : remainder q hq hc 1=1 := by + apply Subtype.ext; simp only [remainder,map_one,section_one,inv_one,mul_one]; rfl +@[simp] theorem remainder_inclusion (k : Kernel q hc) : + remainder q hq hc (inclusion q hc k)=k := by + apply Subtype.ext + change k.val * (sectionMap q hq (q k.val))⁻¹=k.val + have hk : q k.val=1 := k.property + simp [hk] + +theorem factor_cocycle (x y z : E) : + factor q hq hc x y * factor q hq hc (x*y) z = + factor q hq hc y z * factor q hq hc x (y*z) := by + apply Subtype.ext + change (sectionMap q hq x * sectionMap q hq y * (sectionMap q hq (x*y))⁻¹) * + (sectionMap q hq (x*y) * sectionMap q hq z * (sectionMap q hq (x*y*z))⁻¹) = + (factor q hq hc y z).val * + (sectionMap q hq x * sectionMap q hq (y*z) * (sectionMap q hq (x*(y*z)))⁻¹) + have hcomm := Subgroup.mem_center_iff.mp (hc (factor q hq hc y z).property) + (sectionMap q hq x) + simp only [mul_assoc x y z] + calc + _ = sectionMap q hq x * sectionMap q hq y * sectionMap q hq z * + (sectionMap q hq (x*(y*z)))⁻¹ := by group + _ = sectionMap q hq x * (factor q hq hc y z).val * + sectionMap q hq (y*z) * (sectionMap q hq (x*(y*z)))⁻¹ := by + dsimp [factor]; group + _ = _ := by rw [hcomm]; group + +theorem remainder_mul (h k : H) : + remainder q hq hc (h*k)=remainder q hq hc h * remainder q hq hc k * + factor q hq hc (q h) (q k) := by + apply Subtype.ext + change h*k*(sectionMap q hq (q (h*k)))⁻¹ = + (h*(sectionMap q hq (q h))⁻¹) * (remainder q hq hc k).val * + (sectionMap q hq (q h)*sectionMap q hq (q k)* + (sectionMap q hq (q h*q k))⁻¹) + have hcomm := Subgroup.mem_center_iff.mp (hc (remainder q hq hc k).property) + (sectionMap q hq (q h))⁻¹ + symm + calc + _ = h * ((sectionMap q hq (q h))⁻¹ * (remainder q hq hc k).val) * + (sectionMap q hq (q h)*sectionMap q hq (q k)* + (sectionMap q hq (q h*q k))⁻¹) := by group + _ = h * ((remainder q hq hc k).val * (sectionMap q hq (q h))⁻¹) * + (sectionMap q hq (q h)*sectionMap q hq (q k)* + (sectionMap q hq (q h*q k))⁻¹) := by rw [hcomm] + _ = _ := by dsimp [remainder]; rw [map_mul]; group + +end IntegralTransgression +end IntegralTransgression + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Homology/WindowEnclosureChains.lean b/lean/OAI/GroupTheory/SimpleAmenable/Homology/WindowEnclosureChains.lean new file mode 100644 index 0000000000000000000000000000000000000000..d3d13eb9c20900b760bb80497ab10c5cc149114e --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Homology/WindowEnclosureChains.lean @@ -0,0 +1,127 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.WindowEnclosureGeometry + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section WindowEnclosureChains + +structure WindowBracket (n : ℕ) (q : ℤ) (t : ℝ) where + lower : CutRing + upper : CutRing + lower_label : q ≤ endpointLabel lower ∧ endpointLabel lower < q+n + upper_label : q ≤ endpointLabel upper ∧ endpointLabel upper < q+n + lower_bound : t-201/(n:ℝ) ≤ ordinary lower + lower_lt : ordinary lower < t + upper_lt : t < ordinary upper + upper_bound : ordinary upper ≤ t+201/(n:ℝ) + +noncomputable def windowBracket (n : ℕ) (hn : 1 ≤ n) (q : ℤ) (t : ℝ) : + WindowBracket n q t := Classical.choice (by + obtain ⟨u,v,hu,hv,huL,huR,hvL,hvR⟩ := coordinate_window_brackets n hn q t + exact ⟨⟨u,v,hu,hv,huL,huR,hvL,hvR⟩⟩) + +noncomputable def lowerEnclosure (n : ℕ) (hn : 1 ≤ n) (q : ℕ → ℤ) (a : ℝ) : + ℕ → CutRing + | 0 => (windowBracket n hn (q 0) a).lower + | k+1 => (windowBracket n hn (q (k+1)) (ordinary (lowerEnclosure n hn q a k))).lower + +noncomputable def upperEnclosure (n : ℕ) (hn : 1 ≤ n) (q : ℕ → ℤ) (b : ℝ) : + ℕ → CutRing + | 0 => (windowBracket n hn (q 0) b).upper + | k+1 => (windowBracket n hn (q (k+1)) (ordinary (upperEnclosure n hn q b k))).upper + +theorem lowerEnclosure_label (n : ℕ) (hn : 1 ≤ n) (q : ℕ → ℤ) (a : ℝ) (k : ℕ) : + q k ≤ endpointLabel (lowerEnclosure n hn q a k) ∧ + endpointLabel (lowerEnclosure n hn q a k) < q k+n := by + cases k with + | zero => exact (windowBracket n hn (q 0) a).lower_label + | succ k => exact (windowBracket n hn (q (k+1)) _).lower_label + +theorem upperEnclosure_label (n : ℕ) (hn : 1 ≤ n) (q : ℕ → ℤ) (b : ℝ) (k : ℕ) : + q k ≤ endpointLabel (upperEnclosure n hn q b k) ∧ + endpointLabel (upperEnclosure n hn q b k) < q k+n := by + cases k with + | zero => exact (windowBracket n hn (q 0) b).upper_label + | succ k => exact (windowBracket n hn (q (k+1)) _).upper_label + +theorem lowerEnclosure_step (n : ℕ) (hn : 1 ≤ n) (q : ℕ → ℤ) (a : ℝ) (k : ℕ) : + ordinary (lowerEnclosure n hn q a k) - 201/(n:ℝ) ≤ + ordinary (lowerEnclosure n hn q a (k+1)) ∧ + ordinary (lowerEnclosure n hn q a (k+1)) < ordinary (lowerEnclosure n hn q a k) := + ⟨(windowBracket n hn (q (k+1)) _).lower_bound, + (windowBracket n hn (q (k+1)) _).lower_lt⟩ + +theorem upperEnclosure_step (n : ℕ) (hn : 1 ≤ n) (q : ℕ → ℤ) (b : ℝ) (k : ℕ) : + ordinary (upperEnclosure n hn q b k) < ordinary (upperEnclosure n hn q b (k+1)) ∧ + ordinary (upperEnclosure n hn q b (k+1)) ≤ + ordinary (upperEnclosure n hn q b k) + 201/(n:ℝ) := + ⟨(windowBracket n hn (q (k+1)) _).upper_lt, + (windowBracket n hn (q (k+1)) _).upper_bound⟩ + +theorem lowerEnclosure_bounds (n : ℕ) (hn : 1 ≤ n) (q : ℕ → ℤ) (a : ℝ) (k : ℕ) : + a - ((k:ℝ)+1)*201/(n:ℝ) ≤ ordinary (lowerEnclosure n hn q a k) ∧ + ordinary (lowerEnclosure n hn q a k) < a := by + induction k with + | zero => + simpa [lowerEnclosure] using And.intro (windowBracket n hn (q 0) a).lower_bound + (windowBracket n hn (q 0) a).lower_lt + | succ k ih => + have hs := lowerEnclosure_step n hn q a k + constructor + · simp only [Nat.cast_add,Nat.cast_one] + have he : ((k:ℝ)+1+1)*201/(n:ℝ) = ((k:ℝ)+1)*201/(n:ℝ) + 201/(n:ℝ) := by ring + rw [he] + linarith [ih.1,hs.1] + · exact lt_trans hs.2 ih.2 + +theorem upperEnclosure_bounds (n : ℕ) (hn : 1 ≤ n) (q : ℕ → ℤ) (b : ℝ) (k : ℕ) : + b < ordinary (upperEnclosure n hn q b k) ∧ + ordinary (upperEnclosure n hn q b k) ≤ b + ((k:ℝ)+1)*201/(n:ℝ) := by + induction k with + | zero => + simpa [upperEnclosure] using And.intro (windowBracket n hn (q 0) b).upper_lt + (windowBracket n hn (q 0) b).upper_bound + | succ k ih => + have hs := upperEnclosure_step n hn q b k + constructor + · exact lt_trans ih.1 hs.1 + · simp only [Nat.cast_add,Nat.cast_one] + have he : ((k:ℝ)+1+1)*201/(n:ℝ) = ((k:ℝ)+1)*201/(n:ℝ) + 201/(n:ℝ) := by ring + rw [he] + linarith [ih.2,hs.2] + +theorem window_enclosure_chain (n : ℕ) (hn : 1 ≤ n) (q : ℕ → ℤ) (a b : ℝ) + (_hab : a ≤ b) : + ∃ u v : ℕ → CutRing, + (∀ k, (q k ≤ endpointLabel (u k) ∧ endpointLabel (u k) < q k+n) ∧ + (q k ≤ endpointLabel (v k) ∧ endpointLabel (v k) < q k+n)) ∧ + (∀ k, Set.Icc a b ⊆ Set.Ioo (ordinary (u k)) (ordinary (v k))) ∧ + (∀ k, Set.Icc (ordinary (u k)) (ordinary (v k)) ⊆ + Set.Ioo (ordinary (u (k+1))) (ordinary (v (k+1)))) ∧ + ∀ k : ℕ, a-((k:ℝ)+1)*201/(n:ℝ) ≤ ordinary (u k) ∧ + ordinary (v k) ≤ b+((k:ℝ)+1)*201/(n:ℝ) := by + refine ⟨lowerEnclosure n hn q a,upperEnclosure n hn q b,?_,?_,?_,?_⟩ + · intro k + exact ⟨lowerEnclosure_label n hn q a k,upperEnclosure_label n hn q b k⟩ + · intro k x hx + exact ⟨lt_of_lt_of_le (lowerEnclosure_bounds n hn q a k).2 hx.1, + lt_of_le_of_lt hx.2 (upperEnclosure_bounds n hn q b k).1⟩ + · intro k x hx + exact ⟨lt_of_lt_of_le (lowerEnclosure_step n hn q a k).2 hx.1, + lt_of_le_of_lt hx.2 (upperEnclosure_step n hn q b k).1⟩ + · intro k + exact ⟨(lowerEnclosure_bounds n hn q a k).1,(upperEnclosure_bounds n hn q b k).2⟩ + +end WindowEnclosureChains + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Main.lean b/lean/OAI/GroupTheory/SimpleAmenable/Main.lean new file mode 100644 index 0000000000000000000000000000000000000000..2f635943ed1ae0efb2057339bdef4e4fc65db0a7 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Main.lean @@ -0,0 +1,116 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.AlignedFiniteTables +import OAI.GroupTheory.SimpleAmenable.Configurations.FiniteAlignedConfiguration +import OAI.GroupTheory.SimpleAmenable.CentralCovers.FullSectorCompatibility +import OAI.GroupTheory.SimpleAmenable.CentralCovers.ControlCalculus +import OAI.GroupTheory.SimpleAmenable.CentralCovers.CoordinateFamilyCompare +import OAI.GroupTheory.SimpleAmenable.CentralCovers.UniformTangentTransport +import OAI.GroupTheory.SimpleAmenable.CentralCovers.PolygonAtomLaw +import OAI.GroupTheory.SimpleAmenable.CentralCovers.AxisSplitting +import OAI.GroupTheory.SimpleAmenable.CentralCovers.SectorDifferenceRange +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.AnchorConstants +import OAI.GroupTheory.SimpleAmenable.CentralCovers.GrowthGeneration +import OAI.GroupTheory.SimpleAmenable.CentralCovers.ClippedLineSlideAction +import OAI.GroupTheory.SimpleAmenable.CentralCovers.GlobalSignControl +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.InactiveQuadrantAction +import OAI.GroupTheory.SimpleAmenable.CentralCovers.AllWindowAction +import OAI.GroupTheory.SimpleAmenable.CentralCovers.ConcurrentCellSlopeAction +import OAI.GroupTheory.SimpleAmenable.CentralCovers.PrimitiveChartActions +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.ConcurrentCellDecisions +import OAI.GroupTheory.SimpleAmenable.CentralCovers.ConstantCellTemplates +import OAI.GroupTheory.SimpleAmenable.CentralCovers.GridPrimitiveInputs +import OAI.GroupTheory.SimpleAmenable.RandomFields.FormalLawCovariance +import OAI.GroupTheory.SimpleAmenable.Simplicial.FormalLawReindex +import OAI.GroupTheory.SimpleAmenable.CentralCovers.FormalSectorSubfamily +import OAI.GroupTheory.SimpleAmenable.CentralCovers.TemplateActualRelators +import OAI.GroupTheory.SimpleAmenable.CentralCovers.ClosedLocalAssignments +import OAI.GroupTheory.SimpleAmenable.CentralCovers.SimultaneousActiveActions +import OAI.GroupTheory.SimpleAmenable.CentralCovers.CoordinateTemplateControl +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.InwardMargins +import OAI.GroupTheory.SimpleAmenable.CentralCovers.InitialGridActions +import OAI.GroupTheory.SimpleAmenable.CentralCovers.SelectedInwardActions +import OAI.GroupTheory.SimpleAmenable.CentralCovers.ConcurrentCoordinateGates +import OAI.GroupTheory.SimpleAmenable.CentralCovers.PrimitiveStarCoherence +import OAI.GroupTheory.SimpleAmenable.CentralCovers.ExteriorClippedModels +import OAI.GroupTheory.SimpleAmenable.CentralCovers.FarClippedModels +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.ExteriorPhaseGeometry +import OAI.GroupTheory.SimpleAmenable.CentralCovers.PhaseClippedModels +import OAI.GroupTheory.SimpleAmenable.CentralCovers.PrimitiveGermActions +import OAI.GroupTheory.SimpleAmenable.CentralCovers.PrimitiveGlobalTemplates +import OAI.GroupTheory.SimpleAmenable.CentralCovers.GlobalAlignedCentrality +import OAI.GroupTheory.SimpleAmenable.RandomFields.CanonicalPolygonCovariance +import OAI.GroupTheory.SimpleAmenable.CentralCovers.FrameCentrality +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.FrameCompatibility +import OAI.GroupTheory.SimpleAmenable.CentralCovers.CommonFrameTransport +import OAI.GroupTheory.SimpleAmenable.CentralCovers.PrivateBankFixer +import OAI.GroupTheory.SimpleAmenable.CentralCovers.DistinctSlotFixer +import OAI.GroupTheory.SimpleAmenable.Simplicial.SmallEvenRouting +import OAI.GroupTheory.SimpleAmenable.CentralCovers.CanonicalSlotStars +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.TranslationTransport +import OAI.GroupTheory.SimpleAmenable.CentralCovers.GenerationUpstairs +import OAI.GroupTheory.SimpleAmenable.Amenability.LocalBarrierTransport +import OAI.GroupTheory.SimpleAmenable.Amenability.ChartLineTransport +import OAI.GroupTheory.SimpleAmenable.Configurations.PolygonVerticalStrings +import OAI.GroupTheory.SimpleAmenable.Simplicial.PolygonBarFaces +import OAI.GroupTheory.SimpleAmenable.Simplicial.IntervalEssSurj +import OAI.GroupTheory.SimpleAmenable.Homology.RestrictedPolygon +import OAI.GroupTheory.SimpleAmenable.Simplicial.StageMonoidal +import OAI.GroupTheory.SimpleAmenable.Homology.ProductHomologyMaps +import OAI.GroupTheory.SimpleAmenable.Homology.FiberSumHomology +import OAI.GroupTheory.SimpleAmenable.Simplicial.TripleAllNatural +import OAI.GroupTheory.SimpleAmenable.Simplicial.RegularBlockFaces +import OAI.GroupTheory.SimpleAmenable.Simplicial.PointFiberMonoidal +import OAI.GroupTheory.SimpleAmenable.Simplicial.CellMonoidal +import OAI.GroupTheory.SimpleAmenable.Simplicial.TranslationFiberMonoidal +import OAI.GroupTheory.SimpleAmenable.Homology.RegularTotalFiniteDifferentials +import OAI.GroupTheory.SimpleAmenable.Configurations.SymmetricComponents +import OAI.GroupTheory.SimpleAmenable.Simplicial.BarBinaryBoundary + +namespace OAI + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits MonoidalCategory Simplicial Opposite +namespace SimpleAmenable +open FreeChains IntervalBar.Diagram + +attribute [local instance 1200] Rep.hV2 + +lemma polygon_triple_homology_finite (a:ℕ) (ha:0 g * d)) ∆ D).card : ℝ) < ε * D.card + +def MainStatement : Prop := ∃ (G : Type) (_ : Group G), + Infinite G ∧ Group.IsFinitelyPresented G ∧ IsSimpleGroup G ∧ FolnerAmenable G + +end SimpleAmenable + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/AffineIntegrability.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/AffineIntegrability.lean new file mode 100644 index 0000000000000000000000000000000000000000..84d3263706e0a8a702ad158e6a7bc58d70019362 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/AffineIntegrability.lean @@ -0,0 +1,69 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.RandomFields.AffineDensityDerivative + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section AffineIntegrability +open Classical MeasureTheory Matrix + +theorem integrable_matrix_affine {ι : Type*} [Fintype ι] + (A : Matrix ι ι ℝ) (a : ι → ℝ) (hA : IsUnit A.det) + {f : (ι → ℝ) → ℝ} (hf : Integrable f) : + Integrable (fun x => f (a+A*ᵥx)) := by + have hm : Integrable f (Measure.map (matrixAffineEquiv A a hA) volume) := by + rw [show (matrixAffineEquiv A a hA : (ι → ℝ) → (ι → ℝ))= + (fun x => a+A*ᵥx) from funext (fun x => matrixAffineEquiv_apply A a x hA), + map_matrix_affine_volume A a hA] + exact hf.smul_measure ENNReal.ofReal_ne_top + convert! (integrable_map_equiv (matrixAffineEquiv A a hA) f).mp hm using 1 + +theorem integrable_matrix_affine_inverse {ι : Type*} [Fintype ι] + (A : Matrix ι ι ℝ) (a : ι → ℝ) (hA : IsUnit A.det) + {f : (ι → ℝ) → ℝ} (hf : Integrable f) : + Integrable (fun y => f (A⁻¹*ᵥ(y-a))) := by + have h := integrable_matrix_affine A⁻¹ (-(A⁻¹*ᵥa)) + (isUnit_iff_ne_zero.mpr (by + rw [Matrix.det_nonsing_inv,Ring.inverse_eq_inv] + exact inv_ne_zero hA.ne_zero)) hf + convert! h using 1 + ext y + rw [Matrix.mulVec_sub] + simp only [sub_eq_add_neg,add_comm] + +theorem affineNoiseRoot_integrable_square {ι : Type*} [Fintype ι] + {f : ℝ → ℝ} (hf : Continuous f) (hc : HasCompactSupport f) + (A : Matrix ι ι ℝ) (a : ι → ℝ) (hA : IsUnit A.det) : + Integrable (fun y : ι → ℝ => affineNoiseRoot f A a y^2) := by + have ht : Integrable (fun x : ι → ℝ => noiseTensor (fun _ : ι => f) x^2) := by + convert! noiseTensor_integrable_inner (fun _ : ι => f) + (fun _ : ι => f) (fun _ => ((hf.mul hf).integrable_of_hasCompactSupport + (hc.mul_right (f' := f)))) using 1 + ext x + simp only [pow_two] + simpa only [affineNoiseRoot,div_pow] using + (integrable_matrix_affine_inverse A a hA ht).div_const ((Real.sqrt A.det)^2) + +theorem integrable_square_add {X : Type*} [MeasurableSpace X] + (μ : Measure X) {f g : X → ℝ} (hf : AEStronglyMeasurable f μ) + (hg : AEStronglyMeasurable g μ) + (hf2 : Integrable (fun x => f x^2) μ) (hg2 : Integrable (fun x => g x^2) μ) : + Integrable (fun x => (f x+g x)^2) μ := by + apply ((hf2.add hg2).const_mul 2).mono' ((hf.add hg).pow 2) + filter_upwards with x + rw [Real.norm_eq_abs,abs_of_nonneg (sq_nonneg _)] + simp only [Pi.add_apply,Pi.pow_apply] + nlinarith [sq_nonneg (f x-g x)] + +end AffineIntegrability + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/AlignedFiniteTables.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/AlignedFiniteTables.lean new file mode 100644 index 0000000000000000000000000000000000000000..b49ac74b99493db67f79c0f00868479759118ba4 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/AlignedFiniteTables.lean @@ -0,0 +1,89 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.AlignedPolygonGeneration + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section AlignedFiniteTables + +variable {α G : Type*} [Group G] (f : α → G) + +theorem finite_table_lift_in_subgroup_eventually (L : ℕ) + (K : Subgroup (BoundedRelationCover L f)) {T : Type*} [Group T] [Finite T] + (φ : T →* G) (hφ : ∀ s, φ s ∈ K.map (coverMap L f)) : + ∃ B : ℕ, ∃ hLB : L ≤ B, ∀ M : ℕ, ∀ hBM : B ≤ M, + ∃ ρ : T →* BoundedRelationCover M f, + (coverMap M f).comp ρ = φ ∧ + ρ.range ≤ K.map (coverTransition f (le_trans hLB hBM)) := by + choose y hy hyq using hφ + choose w hw using fun s => PresentedGroup.mk_surjective (shortRelations L f) (y s) + have hwp : ∀ s, FreeGroup.lift f (w s) = φ s := by + intro s + rw [← coverMap_mk L f,hw s,hyq s] + obtain ⟨B,hB⟩ := finite_table_lift_eventually f φ w hwp + refine ⟨max L B,le_max_left _ _,fun M hM => ?_⟩ + obtain ⟨ρ,hρ,hρw⟩ := hB M (le_trans (le_max_right _ _) hM) + refine ⟨ρ,hρ,?_⟩ + rintro z ⟨s,rfl⟩ + refine ⟨y s,hy s,?_⟩ + rw [← hw s,coverTransition_mk,hρw s] + +end AlignedFiniteTables + +section SourceAlignedTableCompatibility + +variable (a : ℕ) (r : CutRing) (m : ℕ) (hm : 2 ≤ m) + +theorem sourceAlignedGroup_map_full (M : ℕ) + (t : Multiplicative (FreeAbelianGroup (Fin m × Fin 2)) →* + BoundedRelationCover M (alternatingGenerator a r m hm)) + (ht : (coverMap M (alternatingGenerator a r m hm)).comp t = sourceLatticeMap a r m hm) + (I : Finset (Fin (m+1))) : + (sourceAlignedGroup a r m hm M t I).map + ((polygonAlternatingGroup a (m+1)).subtype.comp + (coverMap M (alternatingGenerator a r m hm))) = polygonAlignedGroup a r m hm I := by + rw [sourceAlignedGroup,alignedGroup_map] + have htrans : ((polygonAlternatingGroup a (m+1)).subtype.comp + (coverMap M (alternatingGenerator a r m hm))).comp t = + sourceLatticeFullMap a r m hm := by + rw [MonoidHom.comp_assoc,ht] + rfl + rw [htrans] + rfl + +theorem sourceAlignedGroup_transition {L M : ℕ} (hLM : L ≤ M) + (t : Multiplicative (FreeAbelianGroup (Fin m × Fin 2)) →* + BoundedRelationCover L (alternatingGenerator a r m hm)) (I : Finset (Fin (m+1))) : + (sourceAlignedGroup a r m hm L t I).map + (coverTransition (alternatingGenerator a r m hm) hLM) = + sourceAlignedGroup a r m hm M + ((coverTransition (alternatingGenerator a r m hm) hLM).comp t) I := by + rw [sourceAlignedGroup,alignedGroup_map] + rfl + +theorem fiveTrack_conditional_preimage_aligned + (hr : 0 < ordinary r ∧ ordinary r < 1/2) (M : ℕ) + (t : Multiplicative (FreeAbelianGroup (Fin m × Fin 2)) →* + BoundedRelationCover M (alternatingGenerator a r m hm)) + (ht : (coverMap M (alternatingGenerator a r m hm)).comp t = sourceLatticeMap a r m hm) + (ι : Fin 5 ↪ Fin (m+1)) (b : Fin (m+1)) (hb : b ∉ Set.range ι) + (U : polygonAlgebra a) (g : alternatingGroup (Fin 5)) : + ∃ y ∈ sourceAlignedGroup a r m hm M t (Finset.univ.map ι), + ((coverMap M (alternatingGenerator a r m hm) y).val : polygonFullGroup a (m+1)) = + conditionalHom U (fiveTrackHom ι g) := by + have hh := fiveTrack_polygon_aligned a r m hm hr ι b hb U g + rw [← sourceAlignedGroup_map_full a r m hm M t ht] at hh + exact hh + +end SourceAlignedTableCompatibility + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/AlignedGroups.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/AlignedGroups.lean new file mode 100644 index 0000000000000000000000000000000000000000..bed7a3b6aa268c9ac6d3962089f0e30a681fe177 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/AlignedGroups.lean @@ -0,0 +1,108 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.TranslatedDisjoint + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section AlignedGroups + +variable {A H : Type*} [Group A] [Group H] {B : Type*} + +noncomputable def alignedGroup (t : A →* H) (x : B → H) (P : B → Prop) : Subgroup H := + Subgroup.closure {y | ∃ b, P b ∧ ∃ u, y = t u*x b*(t u)⁻¹} + +theorem alignedGroup_generator (t : A →* H) (x : B → H) (P : B → Prop) + (b : B) (hb : P b) (u : A) : t u*x b*(t u)⁻¹ ∈ alignedGroup t x P := + Subgroup.subset_closure ⟨b,hb,u,rfl⟩ + +theorem alignedGroup_input (t : A →* H) (x : B → H) (P : B → Prop) + (b : B) (hb : P b) : x b ∈ alignedGroup t x P := by + simpa only [map_one,inv_one,one_mul,mul_one] using alignedGroup_generator t x P b hb 1 + +theorem alignedGroup_conjugate (t : A →* H) (x : B → H) (P : B → Prop) + (u : A) {y : H} (hy : y ∈ alignedGroup t x P) : + t u*y*(t u)⁻¹ ∈ alignedGroup t x P := by + let f : H →* H := (MulAut.conj (t u)).toMonoidHom + have hh : alignedGroup t x P ≤ (alignedGroup t x P).comap f := by + apply (Subgroup.closure_le _).mpr + rintro z ⟨b,hb,v,rfl⟩ + change t u*(t v*x b*(t v)⁻¹)*(t u)⁻¹ ∈ alignedGroup t x P + have he : t u*(t v*x b*(t v)⁻¹)*(t u)⁻¹ = t (u*v)*x b*(t (u*v))⁻¹ := by + rw [map_mul]; group + rw [he] + exact alignedGroup_generator t x P b hb (u*v) + exact hh hy + +theorem alignedGroup_commute (t : A →* H) (x : B → H) (P Q : B → Prop) + (hc : ∀ b, P b → ∀ c, Q c → ∀ u v, + Commute (t u*x b*(t u)⁻¹) (t v*x c*(t v)⁻¹)) : + ∀ g ∈ alignedGroup t x P, ∀ h ∈ alignedGroup t x Q, Commute g h := by + have hh : alignedGroup t x P ≤ Subgroup.centralizer (alignedGroup t x Q) := by + apply (Subgroup.closure_le _).mpr + rintro g ⟨b,hb,u,rfl⟩ + rw [alignedGroup,Subgroup.centralizer_closure] + intro h hh + obtain ⟨c,hc',v,rfl⟩ := hh + exact (hc b hb c hc' u v).symm.eq + intro g hg h hmem + exact (hh hg h hmem).symm + +theorem alignedGroup_map {G : Type*} [Group G] (q : H →* G) + (t : A →* H) (x : B → H) (P : B → Prop) : + (alignedGroup t x P).map q = alignedGroup (q.comp t) (fun b => q (x b)) P := by + rw [alignedGroup,MonoidHom.map_closure] + congr 1 + ext y + constructor + · rintro ⟨z,⟨b,hb,u,rfl⟩,rfl⟩ + exact ⟨b,hb,u,by simp⟩ + · rintro ⟨b,hb,u,rfl⟩ + exact ⟨t u*x b*(t u)⁻¹,⟨b,hb,u,rfl⟩,by simp⟩ + +end AlignedGroups + +section SourceAlignedGroups + +def SmallConditional (m : ℕ) := Fin 5 × {σ : Equiv.Perm (Fin (m+1)) // + σ ∈ alternatingGroup (Fin (m+1)) ∧ σ.support.card ≤ 5} + +instance (m : ℕ) : Finite (SmallConditional m) := by unfold SmallConditional; infer_instance + +noncomputable def sourceAlignedGroup (a : ℕ) (r : CutRing) (m : ℕ) (hm : 2 ≤ m) + (M : ℕ) (t : Multiplicative (FreeAbelianGroup (Fin m × Fin 2)) →* + BoundedRelationCover M (alternatingGenerator a r m hm)) (I : Finset (Fin (m+1))) : + Subgroup (BoundedRelationCover M (alternatingGenerator a r m hm)) := + alignedGroup t (fun b : SmallConditional m => PresentedGroup.of (Sum.inl b)) + (fun b => b.2.val.support ⊆ I) + +theorem source_aligned_disjoint_eventually (a : ℕ) (r : CutRing) (m : ℕ) + (hm : 2 ≤ m) (hm' : 10 < m+1) : + ∃ L : ℕ, ∀ M : ℕ, L ≤ M → + ∃ t : Multiplicative (FreeAbelianGroup (Fin m × Fin 2)) →* + BoundedRelationCover M (alternatingGenerator a r m hm), + (∀ i, t (Multiplicative.ofAdd (FreeAbelianGroup.of i)) = PresentedGroup.of (Sum.inr i)) ∧ + (coverMap M (alternatingGenerator a r m hm)).comp t = sourceLatticeMap a r m hm ∧ + ∀ (I J : Finset (Fin (m+1))), Disjoint I J → + ∀ g ∈ sourceAlignedGroup a r m hm M t I, + ∀ h ∈ sourceAlignedGroup a r m hm M t J, Commute g h := by + obtain ⟨L,hL⟩ := source_translated_disjoint_eventually a r m hm hm' + refine ⟨L,fun M hM => ?_⟩ + obtain ⟨t,ht,htq,hc⟩ := hL M hM + refine ⟨t,ht,htq,?_⟩ + intro I J hIJ + apply alignedGroup_commute + intro b hb c hc' u v + exact hc b.1 c.1 b.2 c.2 (hIJ.mono hb hc') u v + +end SourceAlignedGroups + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/AnchorConstants.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/AnchorConstants.lean new file mode 100644 index 0000000000000000000000000000000000000000..362cf9819f460728e2bf1f484772bfc6d50e83b4 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/AnchorConstants.lean @@ -0,0 +1,52 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.AxisAnchorFamily +import OAI.GroupTheory.SimpleAmenable.CentralCovers.SectorDifferenceRange + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section AnchorConstants +namespace AxisAnchorFamily +variable {n l : ℕ} {q : ℤ} (A : AxisAnchorFamily n l q) +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + (hlarge : 15 < m+1) (g : B.CoordinateWindowLaw n) (d : Fin 2) + +theorem constant_range_prefixGroup (hl : 201 ≤ l) (hln : l ≤ n) : + B.c.range ≤ A.prefixGroup B hlarge g d := by + have hh := B.fullGeometricSector_partition_range hlarge (axisWindowPrimitives d l q) + (fun I _ b hb => B.axisFamilyLaw n g d l hln q I b hb) (wholePolygon a) + (windowCell a d l q) (windowCell_axis_resolved d l (by omega) q) + (windowCell_pairwise_disjoint d l hl q) (by + intro x; constructor + · intro _; exact windowCell_cover d l hl q x + · intro _; trivial) + rw [B.fullGeometricSector_whole] at hh + have hr : (B.c.comp (universalProjection (alternatingGroup (Fin (m+1))))).range = B.c.range := by + apply le_antisymm + · rintro x ⟨s,rfl⟩; exact ⟨_,rfl⟩ + rintro x ⟨s,rfl⟩ + obtain ⟨t,ht⟩ := universalProjection_surjective (alternatingGroup (Fin (m+1))) s + exact ⟨t,by simp only [MonoidHom.comp_apply,ht]⟩ + rw [hr] at hh + apply hh.trans + apply iSup_le + intro i + change (B.axisSector hlarge n g d l hln q (windowCell a d l q i)).range ≤ _ + rw [← A.anchorCopy_eq_cell B hlarge g d hl hln i] + exact A.anchor_range_prefixGroup B hlarge g d i + +end AxisAnchorFamily +end AnchorConstants + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/AxisAnchorFamily.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/AxisAnchorFamily.lean new file mode 100644 index 0000000000000000000000000000000000000000..5b46bbfd227d528fe132bf1ed46bc79863beee8c --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/AxisAnchorFamily.lean @@ -0,0 +1,248 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.DisjointPolygonAtoms +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.SortedAxisCuts + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section AxisAnchorFamily + +structure AxisAnchorFamily (n l : ℕ) (q : ℤ) where + count : Fin l → ℕ + cuts : ∀ i, AxisCutSequence n (count i) + lower : ∀ i, (cuts i).cut 0 = windowCut l q i.castSucc + upper : ∀ i, (cuts i).cut (Fin.last (count i)) = windowCut l q i.succ + +namespace AxisAnchorFamily +variable {n l : ℕ} {q : ℤ} (A : AxisAnchorFamily n l q) + +theorem intervalLength (hl : 201 ≤ l) (i : Fin l) : + ordinary ((A.cuts i).cut (Fin.last (A.count i)))-ordinary ((A.cuts i).cut 0) < 1 := by + rw [A.lower,A.upper] + have hl' : (200:ℝ) < l := by exact_mod_cast (show 200 < l by omega) + exact (windowCut_mesh l q i).trans_lt ((div_lt_one (by linarith)).mpr hl') + +theorem atom_le_cell {a : ℕ} (d : Fin 2) (hl : 201 ≤ l) (i : Fin l) (j : Fin (A.count i)) : + (A.cuts i).atomPolygon (a := a) d j ≤ windowCell a d l q i := by + have h₁ := (A.cuts i).ordered j.castSucc + have h₂ := (A.cuts i).ordered j.succ + change coordinateInterval a d _ _ ≤ coordinateInterval a d _ _ + rw [← A.lower,← A.upper] + exact coordinateInterval_mono d _ _ _ _ h₁.1 + ((A.cuts i).strictMono (Fin.castSucc_lt_succ (i := j))).le h₂.2 (A.intervalLength hl i) + +theorem atom_disjoint {a : ℕ} (d : Fin 2) (hl : 201 ≤ l) : + Pairwise fun i j : (Σ i : Fin l, Fin (A.count i)) => + Disjoint ((A.cuts i.1).atomPolygon (a := a) d i.2).val ((A.cuts j.1).atomPolygon d j.2).val := by + rintro ⟨i,k⟩ ⟨j,k'⟩ hij + by_cases he : i=j + · subst j + apply (A.cuts i).atomPolygon_disjoint d (A.intervalLength hl i) + intro hk + change k=k' at hk + subst k' + exact hij rfl + · exact (windowCell_pairwise_disjoint d l (by omega) q he).mono + (A.atom_le_cell d hl i k) (A.atom_le_cell d hl j k') + +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + (hlarge : 15 < m+1) (g : B.CoordinateWindowLaw n) + (d : Fin 2) (hl : 201 ≤ l) (hln : l ≤ n) + +include hl in +theorem anchorCopy_eq_cell (i : Fin l) : + (A.cuts i).anchorCopy B hlarge g d = B.axisSector hlarge n g d l hln q (windowCell a d l q i) := by + change B.axisSector hlarge n g d _ _ _ (coordinateInterval a d _ _) = + B.axisSector hlarge n g d l hln q (coordinateInterval a d _ _) + rw [← A.lower,← A.upper] + apply B.axisInterval_copy_eq + · exact (A.cuts i).lower_label 0 + · exact (A.cuts i).upper_label 0 + · rw [A.lower]; exact windowCut_label l q (by omega) _ + · rw [A.upper]; exact windowCut_label l q (by omega) _ + +include hl hln in +theorem anchorCopies_commute {i j : Fin l} (hij : i ≠ j) (x y : TrackStar (Fin (m+1))) : + Commute ((A.cuts i).anchorCopy B hlarge g d x) ((A.cuts j).anchorCopy B hlarge g d y) := by + rw [A.anchorCopy_eq_cell B hlarge g d hl hln i,A.anchorCopy_eq_cell B hlarge g d hl hln j] + exact B.fullGeometricSector_commute hlarge _ _ _ _ + (windowCell_axis_resolved d l (by omega) q i) (windowCell_pairwise_disjoint d l (by omega) q hij) x y + +variable (hc : ∀ (i : Fin l) (j k : ℕ), j ≤ k → ∀ x y, + Commute ((A.cuts i).prefixCopy B hlarge g d j x) ((A.cuts i).suffix B hlarge g d k y)) + +include hl hln in +theorem atoms_commute (h20 : 20 ≤ m+1) : + Pairwise fun i j : (Σ i : Fin l, Fin (A.count i)) => ∀ x y, + Commute ((A.cuts i.1).atomCopy B hlarge g d (A.intervalLength hl i.1) (hc i.1) i.2 x) + ((A.cuts j.1).atomCopy B hlarge g d (A.intervalLength hl j.1) (hc j.1) j.2 y) := by + rintro ⟨i,k⟩ ⟨j,k'⟩ hij x y + by_cases he : i=j + · subst j + apply (A.cuts i).atomCopy_commute B hlarge g d (A.intervalLength hl i) (hc i) + · intro hk; change k=k' at hk; subst k'; exact hij rfl + · apply small_control_disjoint _ B.c B.constant_aligned B.disjoint_aligned (by simpa using h20) + _ _ ((A.cuts i).anchorCopy B hlarge g d) ((A.cuts j).anchorCopy B hlarge g d) + · exact (A.cuts i).atomCopy_supported B hlarge g d (A.intervalLength hl i) (hc i) k + · exact (A.cuts j).atomCopy_supported B hlarge g d (A.intervalLength hl j) (hc j) k' + · exact (A.cuts i).anchorCopy_small_supported B hlarge g d + · exact (A.cuts i).atomCopy_controlled B hlarge g d (A.intervalLength hl i) (hc i) k + · exact (A.cuts j).atomCopy_controlled B hlarge g d (A.intervalLength hl j) (hc j) k' + · exact A.anchorCopies_commute B hlarge g d hl hln he + +include hl hln hc in + +theorem prefixes_central (h20 : 20 ≤ m+1) : + CentralOn (coverMap M (alternatingGenerator a r m hm)) + (⨆ i : Fin l, ⨆ j : Fin (A.count i+1), ((A.cuts i).prefixCopy B hlarge g d j.val).range) := by + let f (i : Σ i : Fin l, Fin (A.count i)) := + (A.cuts i.1).atomCopy B hlarge g d (A.intervalLength hl i.1) (hc i.1) i.2 + have hcentral := centralOn_disjoint_polygon_atoms + (coverMap M (alternatingGenerator a r m hm)) + (fun i : Σ i : Fin l, Fin (A.count i) => (A.cuts i.1).atomPolygon d i.2) + (A.atom_disjoint d hl) + (fun i => (A.cuts i.1).atomPolygon_nonempty d (A.intervalLength hl i.1) i.2) + f (A.atoms_commute B hlarge g d hl hln hc h20) + (fun i => (A.cuts i.1).atomCopy_projection B hlarge g d (A.intervalLength hl i.1) (hc i.1) i.2) + apply hcentral.mono + apply iSup_le + intro i + apply iSup_le + intro j + apply (prefix_range_le_differences ((A.cuts i).anchorCopy B hlarge g d) _ _ + ((A.cuts i).prefix_suffix B hlarge g d (A.intervalLength hl i)) (hc i) + ((A.cuts i).prefix_zero B hlarge g d) (A.count i) j.val (by omega)).trans + apply iSup_le + intro k + exact le_iSup (fun z => (f z).range) ⟨i,k⟩ + +end AxisAnchorFamily +end AxisAnchorFamily + +section GrowthAnchors +attribute [local instance] cutOrdinaryOrder + +def growthOldLength (n : ℕ) := n*9/10 + +def growthNewLength (n : ℕ) := n*6/5 + +def growthAnchorLength (n : ℕ) := 2*growthOldLength n-growthNewLength n + +def growthAnchorStart (n : ℕ) (p : ℤ) := p+(growthNewLength n:ℤ)-growthOldLength n + +theorem growth_lengths {n : ℕ} (hn : 1005 ≤ n) : + growthOldLength n ≤ n ∧ growthOldLength n ≤ growthNewLength n ∧ + growthNewLength n ≤ 2*growthOldLength n ∧ 201 ≤ growthAnchorLength n ∧ + growthAnchorLength n ≤ n ∧ n ≤ 2*growthAnchorLength n := by + simp only [growthAnchorLength,growthOldLength,growthNewLength] + omega + +theorem growth_anchor_label {n : ℕ} (hn : 1005 ≤ n) (p : ℤ) (i : Fin (growthAnchorLength n+1)) : + p+(growthNewLength n:ℤ)-growthOldLength n ≤ endpointLabel (windowCut (growthAnchorLength n) (growthAnchorStart n p) i) ∧ + endpointLabel (windowCut (growthAnchorLength n) (growthAnchorStart n p) i) < p+growthOldLength n := by + have h := windowCut_label (growthAnchorLength n) (growthAnchorStart n p) (by have := growth_lengths hn; omega) i + have hh := growth_lengths hn + have he : (growthAnchorLength n:ℤ) = 2*(growthOldLength n:ℤ)-growthNewLength n := by + unfold growthAnchorLength + rw [Nat.cast_sub (by omega)] + push_cast + rfl + unfold growthAnchorStart at h ⊢ + rw [he] at h + omega + +noncomputable def growthAnchorFamily (n : ℕ) (hn : 1005 ≤ n) (p : ℤ) : + AxisAnchorFamily n (growthAnchorLength n) (growthAnchorStart n p) := by + let l := growthAnchorLength n + let q := growthAnchorStart n p + let u (i : Fin l) := windowCut l q i.castSucc + let v (i : Fin l) := windowCut l q i.succ + let S (i : Fin l) := anchorCutSet (growthNewLength n) p (u i) (v i) + have hlens := growth_lengths hn + have hl (i : Fin l) : ordinary (u i) ≤ ordinary (v i) := + (windowCut_strictMono l q (Fin.castSucc_lt_succ (i := i))).le + have hu (i : Fin l) := growth_anchor_label hn p i.castSucc + have hv (i : Fin l) := growth_anchor_label hn p i.succ + have hu' (i : Fin l) : p ≤ endpointLabel (u i) ∧ endpointLabel (u i) < p+growthNewLength n := by + have := hu i; dsimp [u,l,q]; constructor <;> omega + have hv' (i : Fin l) : p ≤ endpointLabel (v i) ∧ endpointLabel (v i) < p+growthNewLength n := by + have := hv i; dsimp [v,l,q]; constructor <;> omega + let D (i : Fin l) := sortedAxisCutSequence n (growthOldLength n) (growthNewLength n) p (u i) (v i) (S i) + (anchorCutSet_lower _ _ _ _) (anchorCutSet_upper _ _ _ _) + (anchorCutSet_bounds _ _ _ _ (hl i)) (anchorCutSet_labels _ _ _ _ (hu' i) (hv' i)) + (hu i) (hv i) hlens.2.1 hlens.2.2.1 (by rfl) + exact ⟨fun i => (S i).card-1,D,fun i => sortedAxisCutSequence_lower .., + fun i => sortedAxisCutSequence_upper ..⟩ + +namespace growthAnchorFamily +variable (n : ℕ) (hn : 1005 ≤ n) (p : ℤ) +local notation "A" => growthAnchorFamily n hn p + +theorem length (i : Fin (growthAnchorLength n)) (j : Fin ((A).count i+1)) : + ((A).cuts i).length j = growthOldLength n := rfl + +theorem start (i : Fin (growthAnchorLength n)) (j : Fin ((A).count i+1)) : + ((A).cuts i).start j = if endpointLabel (((A).cuts i).cut j) omega + · have hh := growth_anchor_label hn p i.succ + have hlens := growth_lengths hn + constructor <;> omega + +theorem label_difference (i : Fin (growthAnchorLength n)) (j k : Fin ((A).count i+1)) : + |(endpointLabel (((A).cuts i).cut k-((A).cuts i).cut j):ℝ)| ≤ 6*(n:ℝ)/5 := by + have hj := labels n hn p i j + have hk := labels n hn p i k + have hh : growthNewLength n*5 ≤ n*6 := by unfold growthNewLength; omega + rw [endpointLabel_sub,Int.cast_sub] + have hj' : (p:ℝ) ≤ endpointLabel (((A).cuts i).cut j) ∧ + (endpointLabel (((A).cuts i).cut j):ℝ) < (p:ℝ)+growthNewLength n := by exact_mod_cast hj + have hk' : (p:ℝ) ≤ endpointLabel (((A).cuts i).cut k) ∧ + (endpointLabel (((A).cuts i).cut k):ℝ) < (p:ℝ)+growthNewLength n := by exact_mod_cast hk + have hh' : (growthNewLength n:ℝ)*5 ≤ (n:ℝ)*6 := by exact_mod_cast hh + rw [abs_le]; constructor <;> linarith + +theorem width (i : Fin (growthAnchorLength n)) : + ordinary (((A).cuts i).cut (Fin.last ((A).count i)))-ordinary (((A).cuts i).cut 0) ≤ 400/(n:ℝ) := by + rw [(A).lower,(A).upper] + apply (windowCut_mesh _ _ i).trans + have hh := growth_lengths hn + have hpos : (0:ℝ) < growthAnchorLength n := by exact_mod_cast (show 0 < growthAnchorLength n by omega) + have hn' : (0:ℝ) < n := by exact_mod_cast (show 0 < n by omega) + have hle : (n:ℝ) ≤ 2*growthAnchorLength n := by exact_mod_cast hh.2.2.2.2.2 + apply (div_le_div_iff₀ hpos hn').mpr + linarith + +end growthAnchorFamily +end GrowthAnchors + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/AxisCutSequences.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/AxisCutSequences.lean new file mode 100644 index 0000000000000000000000000000000000000000..1ac75e19cced2aaa26673310985d0e9522c0835c --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/AxisCutSequences.lean @@ -0,0 +1,152 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.AxisSplitting +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.SeparatedAxisSectors + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section AxisCutSequences + +structure AxisCutSequence (n K : ℕ) where + cut : Fin (K+1) → CutRing + strictMono : StrictMono (fun i => ordinary (cut i)) + length : Fin (K+1) → ℕ + start : Fin (K+1) → ℤ + length_le : ∀ i, length i ≤ n*9/10 + lower_label : ∀ i, start i ≤ endpointLabel (cut 0) ∧ endpointLabel (cut 0) < start i+length i + upper_label : ∀ i, start i ≤ endpointLabel (cut (Fin.last K)) ∧ endpointLabel (cut (Fin.last K)) < start i+length i + cut_label : ∀ i, start i ≤ endpointLabel (cut i) ∧ endpointLabel (cut i) < start i+length i + +namespace AxisCutSequence +variable {n K : ℕ} (D : AxisCutSequence n K) + +def index (_D : AxisCutSequence n K) (i : ℕ) : Fin (K+1) := ⟨min i K,by omega⟩ +@[simp] theorem index_zero : D.index 0 = 0 := by ext; simp [index] +@[simp] theorem index_fin (i : Fin (K+1)) : D.index i.val = i := by ext; simp [index]; omega + +theorem index_mono : Monotone D.index := by + intro i j hij + exact min_le_min_right K hij + +theorem ordered (i : Fin (K+1)) : + ordinary (D.cut 0) ≤ ordinary (D.cut i) ∧ ordinary (D.cut i) ≤ ordinary (D.cut (Fin.last K)) := + ⟨D.strictMono.monotone (Fin.zero_le i),D.strictMono.monotone (Fin.le_last i)⟩ + +theorem length_old (i : Fin (K+1)) : D.length i ≤ n := by have hh := D.length_le i; omega + +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + (hlarge : 15 < m+1) (g : B.CoordinateWindowLaw n) (d : Fin 2) + +noncomputable def anchorCopy : TrackStar (Fin (m+1)) →* + BoundedRelationCover M (alternatingGenerator a r m hm) := + B.axisSector hlarge n g d (D.length 0) (D.length_old 0) (D.start 0) + (coordinateInterval a d (D.cut 0) (D.cut (Fin.last K))) + +noncomputable def prefixCopy (i : ℕ) : TrackStar (Fin (m+1)) →* + BoundedRelationCover M (alternatingGenerator a r m hm) := + B.axisSector hlarge n g d (D.length (D.index i)) (D.length_old _) (D.start (D.index i)) + (coordinateInterval a d (D.cut 0) (D.cut (D.index i))) + +noncomputable def suffix (i : ℕ) : TrackStar (Fin (m+1)) →* + BoundedRelationCover M (alternatingGenerator a r m hm) := + B.axisSector hlarge n g d (D.length (D.index i)) (D.length_old _) (D.start (D.index i)) + (coordinateInterval a d (D.cut (D.index i)) (D.cut (Fin.last K))) + +theorem anchorCopy_eq (i : Fin (K+1)) : + D.anchorCopy B hlarge g d = + B.axisSector hlarge n g d (D.length i) (D.length_old i) (D.start i) + (coordinateInterval a d (D.cut 0) (D.cut (Fin.last K))) := + B.axisInterval_copy_eq hlarge n g d _ _ _ _ _ _ _ _ + (D.lower_label 0) (D.upper_label 0) (D.lower_label i) (D.upper_label i) + +theorem prefix_suffix (hlen : ordinary (D.cut (Fin.last K))-ordinary (D.cut 0) < 1) (i : ℕ) + (s : TrackStar (Fin (m+1))) : + D.anchorCopy B hlarge g d s = D.prefixCopy B hlarge g d i s*D.suffix B hlarge g d i s := by + rw [D.anchorCopy_eq B hlarge g d (D.index i)] + exact B.axisSector_split hlarge n g d _ _ _ _ _ _ + (D.ordered _).1 (D.ordered _).2 hlen (D.lower_label _) (D.cut_label _) s + +@[simp] theorem prefix_zero : D.prefixCopy B hlarge g d 0 = 1 := by + simp only [prefixCopy,index_zero,InitialCoverSystem.axisSector_self] + +theorem prefix_last : D.prefixCopy B hlarge g d K = D.anchorCopy B hlarge g d := by + have hi : D.index K = Fin.last K := by ext; simp [index] + simp only [prefixCopy,hi] + exact (D.anchorCopy_eq B hlarge g d (Fin.last K)).symm + +theorem prefix_projection (i : ℕ) : + (coverMap M (alternatingGenerator a r m hm)).comp (D.prefixCopy B hlarge g d i) = + (conditionalAlternatingHom (coordinateInterval a d (D.cut 0) (D.cut (D.index i)))).comp + (universalProjection (alternatingGroup (Fin (m+1)))) := + B.axisSector_projection hlarge n g d _ _ _ _ _ (D.lower_label _) (D.cut_label _) + +theorem suffix_projection (i : ℕ) : + (coverMap M (alternatingGenerator a r m hm)).comp (D.suffix B hlarge g d i) = + (conditionalAlternatingHom (coordinateInterval a d (D.cut (D.index i)) (D.cut (Fin.last K)))).comp + (universalProjection (alternatingGroup (Fin (m+1)))) := + B.axisSector_projection hlarge n g d _ _ _ _ _ (D.cut_label _) (D.upper_label _) + +theorem prefix_small_supported (i : ℕ) : + B.AlignedSmallSupported (D.prefixCopy B hlarge g d i) := + B.axisSector_supported hlarge n g d _ _ _ _ + (axisInterval_resolved d _ _ _ _ (D.lower_label _) (D.cut_label _)) + +theorem anchorCopy_small_supported : B.AlignedSmallSupported (D.anchorCopy B hlarge g d) := + B.axisSector_supported hlarge n g d _ _ _ _ + (axisInterval_resolved d _ _ _ _ (D.lower_label 0) (D.upper_label 0)) + +theorem prefix_small_controlled (hlen : ordinary (D.cut (Fin.last K))-ordinary (D.cut 0) < 1) (i : ℕ) : + SmallControlled B.c (D.prefixCopy B hlarge g d i) (D.anchorCopy B hlarge g d) := by + rw [D.anchorCopy_eq B hlarge g d (D.index i)] + exact B.fullGeometricSector_small_control hlarge _ _ _ _ + (coordinateInterval_mono d _ _ _ _ le_rfl (D.ordered _).1 (D.ordered _).2 hlen) + +theorem prefix_suffix_self_commute (hlen : ordinary (D.cut (Fin.last K))-ordinary (D.cut 0) < 1) + (i : ℕ) (s t : TrackStar (Fin (m+1))) : + Commute (D.prefixCopy B hlarge g d i s) (D.suffix B hlarge g d i t) := + B.axisSector_split_commute hlarge n g d _ _ _ _ _ _ + (D.ordered _).1 (D.ordered _).2 hlen (D.lower_label _) (D.cut_label _) s t + +end AxisCutSequence +end AxisCutSequences + +section NestedSupport +variable {α H Q : Type*} [Fintype α] [DecidableEq α] [Group H] [Group Q] + [Group.IsPerfect (alternatingGroup α)] + +variable (L : Finset α → Subgroup H) (c : alternatingGroup α →* H) + (f : TrackStar α →* H) (l h : ℕ → TrackStar α →* H) + (hf : ∀ i s, f s = l i s*h i s) + (hc : ∀ i j, i ≤ j → ∀ s t, Commute (l i s) (h j t)) + +theorem cutDifference_small_supported (hs : ∀ i, SmallSupported L (l i)) (i : ℕ) : + SmallSupported L (cutDifference f l h hf hc i) := by + intro I x hx + obtain ⟨s,rfl⟩ := hx + change (l i (universalMap (subtypeAlternatingHom I.val) s))⁻¹ * + l (i+1) (universalMap (subtypeAlternatingHom I.val) s) ∈ L I.val + exact (L I.val).mul_mem ((L I.val).inv_mem (hs i I ⟨s,rfl⟩)) (hs (i+1) I ⟨s,rfl⟩) + +theorem cutDifference_small_controlled (hs : ∀ i, SmallControlled c (l i) f) (i : ℕ) : + SmallControlled c (cutDifference f l h hf hc i) f := by + intro I t x hx + obtain ⟨s,rfl⟩ := hx + apply (same_conj_iff _ _ _).mpr + change Commute _ ((l i s)⁻¹*l (i+1) s) + exact ((same_conj_iff _ _ _).mp (hs i I t _ ⟨s,rfl⟩)).inv_right.mul_right + ((same_conj_iff _ _ _).mp (hs (i+1) I t _ ⟨s,rfl⟩)) + +end NestedSupport + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/CanonicalSectors.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/CanonicalSectors.lean new file mode 100644 index 0000000000000000000000000000000000000000..49dcbbd9449ae5e11200693d90f99dbe704953bd --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/CanonicalSectors.lean @@ -0,0 +1,224 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.FiniteCentralKernel + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section CanonicalSectors +open scoped commutatorElement + +variable {E H Q : Type*} [Group E] [Group H] [Group Q] + +theorem perfect_maps_commute_of_central [Group.IsPerfect E] + {P : Type*} [Group P] (q : H →* Q) (hc : q.ker ≤ Subgroup.center H) + (f : E →* H) (g : P →* H) + (hfg : ∀ x y, Commute (q (f x)) (q (g y))) : + ∀ x y, Commute (f x) (g y) := by + let : Group.IsPerfect f.range := Group.IsPerfect.range f + have hh : ⁅f.range,g.range⁆ ≤ Subgroup.center H := by + apply Subgroup.commutator_le.mpr + rintro _ ⟨x,rfl⟩ _ ⟨y,rfl⟩ + apply hc + change q ⁅f x,g y⁆ = 1 + rw [map_commutatorElement] + exact (hfg x y).commutator_eq + have hzero := perfect_commutator_central_trivial f.range g.range hh + intro x y + apply commutatorElement_eq_one_iff_mul_comm.mp + have hh' := Subgroup.commutator_mem_commutator + (show f x ∈ f.range from ⟨x,rfl⟩) (show g y ∈ g.range from ⟨y,rfl⟩) + simpa [hzero] using hh' + +theorem perfect_finite_pi {ι : Type*} [Finite ι] {F : ι → Type*} + [∀ i, Group (F i)] [∀ i, Group.IsPerfect (F i)] : Group.IsPerfect (∀ i, F i) := by + classical + have he : (Abelianization.of : (∀ i, F i) →* Abelianization (∀ i, F i)) = 1 := by + apply MonoidHom.pi_ext + intro i x + exact perfect_hom_to_commGroup + (Abelianization.of.comp (MonoidHom.mulSingle F i)) x + constructor + rw [← Abelianization.ker_of, he, MonoidHom.ker_one] + +variable {Ω : Type*} + +noncomputable def sectorMask (U : Set Ω) : E →* (Ω → E) := by + classical + exact { toFun := fun s ω => if ω ∈ U then s else 1 + map_one' := by funext ω; simp + map_mul' := by intro s t; funext ω; by_cases h : ω ∈ U <;> simp [h] } + +@[simp] theorem sectorMask_of_mem (U : Set Ω) (s : E) (ω : Ω) (h : ω ∈ U) : + sectorMask U s ω = s := by + classical + simp [sectorMask, h] + +@[simp] theorem sectorMask_of_not_mem (U : Set Ω) (s : E) (ω : Ω) (h : ω ∉ U) : + sectorMask U s ω = 1 := by + classical + simp [sectorMask, h] + +theorem sectorMask_commute {U V : Set Ω} (huv : Disjoint U V) (s t : E) : + Commute (sectorMask U s) (sectorMask V t) := by + classical + funext ω + change sectorMask U s ω * sectorMask V t ω = sectorMask V t ω * sectorMask U s ω + have hd := Set.disjoint_left.mp huv + by_cases hu : ω ∈ U <;> by_cases hv : ω ∈ V <;> simp_all [sectorMask] + +theorem sectorMask_disjoint_union {U V : Set Ω} (huv : Disjoint U V) (s : E) : + sectorMask (U ∪ V) s = sectorMask U s * sectorMask V s := by + classical + funext ω + have hd := Set.disjoint_left.mp huv + by_cases hu : ω ∈ U <;> by_cases hv : ω ∈ V <;> simp_all [sectorMask, Pi.mul_apply] + +variable [Group.IsPerfect E] + +noncomputable def centralSector (φ : (Ω → E) →* H ⧸ Subgroup.center H) (U : Set Ω) : + UniversalExtension E →* H := + universalLift (QuotientGroup.mk' (Subgroup.center H)) + (QuotientGroup.mk'_surjective (Subgroup.center H)) + (by rw [QuotientGroup.ker_mk']) (φ.comp (sectorMask U)) + +theorem centralSector_spec (φ : (Ω → E) →* H ⧸ Subgroup.center H) (U : Set Ω) + (s : UniversalExtension E) : + QuotientGroup.mk' (Subgroup.center H) (centralSector φ U s) = + φ (sectorMask U (universalProjection E s)) := + DFunLike.congr_fun (universalLift_spec (QuotientGroup.mk' (Subgroup.center H)) + (QuotientGroup.mk'_surjective (Subgroup.center H)) + (by rw [QuotientGroup.ker_mk']) (φ.comp (sectorMask U))) s + +theorem centralSector_commute (φ : (Ω → E) →* H ⧸ Subgroup.center H) + {U V : Set Ω} (huv : Disjoint U V) (s t : UniversalExtension E) : + Commute (centralSector φ U s) (centralSector φ V t) := by + apply perfect_maps_commute_of_central (QuotientGroup.mk' (Subgroup.center H)) + (by rw [QuotientGroup.ker_mk']) (centralSector φ U) (centralSector φ V) ?_ s t + intro x y + rw [centralSector_spec, centralSector_spec] + exact (sectorMask_commute huv _ _).map φ + +def commutingProduct (f g : E →* H) (hc : ∀ s t, Commute (f s) (g t)) : E →* H := + (f.noncommCoprod g hc).comp ((MonoidHom.id E).prod (MonoidHom.id E)) + +omit [Group.IsPerfect E] in +@[simp] theorem commutingProduct_apply (f g : E →* H) + (hc : ∀ s t, Commute (f s) (g t)) (s : E) : + commutingProduct f g hc s = f s * g s := rfl + +theorem centralSector_union (φ : (Ω → E) →* H ⧸ Subgroup.center H) + {U V : Set Ω} (huv : Disjoint U V) (s : UniversalExtension E) : + centralSector φ (U ∪ V) s = centralSector φ U s * centralSector φ V s := by + let p := commutingProduct (centralSector φ U) (centralSector φ V) + (centralSector_commute φ huv) + have hp : centralSector φ (U ∪ V) = p := by + apply perfect_lift_unique (QuotientGroup.mk' (Subgroup.center H)) + (by rw [QuotientGroup.ker_mk']) + ext t + simp only [MonoidHom.comp_apply, p, commutingProduct_apply, map_mul, centralSector_spec] + rw [sectorMask_disjoint_union huv, map_mul] + exact DFunLike.congr_fun hp s + +@[simp] theorem centralSector_empty (φ : (Ω → E) →* H ⧸ Subgroup.center H) : + centralSector φ ∅ = 1 := by + apply perfect_lift_unique (QuotientGroup.mk' (Subgroup.center H)) + (by rw [QuotientGroup.ker_mk']) + ext s + simp only [MonoidHom.comp_apply, centralSector_spec, MonoidHom.one_apply, map_one] + have h : sectorMask (∅ : Set Ω) (universalProjection E s) = 1 := by ext ω; simp + rw [h, map_one] + +theorem centralSector_trivial (φ : (Ω → E) →* H ⧸ Subgroup.center H) + (U : Set Ω) (hU : φ.comp (sectorMask U) = 1) : centralSector φ U = 1 := by + apply perfect_lift_unique (QuotientGroup.mk' (Subgroup.center H)) + (by rw [QuotientGroup.ker_mk']) + ext s + rw [MonoidHom.comp_apply, centralSector_spec] + have ht := DFunLike.congr_fun hU (universalProjection E s) + simpa only [MonoidHom.comp_apply, MonoidHom.one_apply, map_one] using ht + +def assignmentPullback {Ω' : Type*} (r : Ω' → Ω) : (Ω → E) →* (Ω' → E) where + toFun f := f ∘ r + map_one' := rfl + map_mul' _ _ := rfl + +theorem centralSector_refine {Ω' : Type*} (r : Ω' → Ω) + (φ : (Ω' → E) →* H ⧸ Subgroup.center H) (U : Set Ω) : + centralSector (φ.comp (assignmentPullback r)) U = centralSector φ (r ⁻¹' U) := by + apply perfect_lift_unique (QuotientGroup.mk' (Subgroup.center H)) + (by rw [QuotientGroup.ker_mk']) + ext s + simp only [MonoidHom.comp_apply, centralSector_spec] + congr 1 + +noncomputable def centralSectorProduct [Fintype Ω] + (φ : (Ω → E) →* H ⧸ Subgroup.center H) : (Ω → UniversalExtension E) →* H := + MonoidHom.noncommPiCoprod (fun ω => centralSector φ {ω}) + (fun _ _ h => centralSector_commute φ (Set.disjoint_singleton.mpr h)) + +@[simp] theorem centralSectorProduct_single [Fintype Ω] [DecidableEq Ω] + (φ : (Ω → E) →* H ⧸ Subgroup.center H) (ω : Ω) (s : UniversalExtension E) : + centralSectorProduct φ (Pi.mulSingle ω s) = centralSector φ {ω} s := by + classical + exact MonoidHom.noncommPiCoprod_mulSingle _ _ _ + +def assignmentProjection : (Ω → UniversalExtension E) →* (Ω → E) where + toFun s ω := universalProjection E (s ω) + map_one' := by ext ω; exact map_one _ + map_mul' s t := by ext ω; exact map_mul _ _ _ + +theorem assignmentProjection_surjective : + Function.Surjective (assignmentProjection (E := E) (Ω := Ω)) := by + intro f + choose s hs using fun ω => universalProjection_surjective E (f ω) + exact ⟨s, funext hs⟩ + +theorem centralSectorProduct_spec [Fintype Ω] + (φ : (Ω → E) →* H ⧸ Subgroup.center H) : + (QuotientGroup.mk' (Subgroup.center H)).comp (centralSectorProduct φ) = + φ.comp assignmentProjection := by + classical + apply MonoidHom.pi_ext + intro ω s + simp only [MonoidHom.comp_apply, centralSectorProduct_single, centralSector_spec] + congr 1 + ext ν + by_cases h : ν = ω + · subst ν + simp [assignmentProjection] + · simp [sectorMask, assignmentProjection, h] + +theorem centralSectorProduct_surjective [Fintype Ω] [Group.IsPerfect H] + (φ : (Ω → E) →* H ⧸ Subgroup.center H) (hφ : Function.Surjective φ) : + Function.Surjective (centralSectorProduct φ) := by + let : Group.IsPerfect (Ω → UniversalExtension E) := perfect_finite_pi + have hs : Function.Surjective + ((QuotientGroup.mk' (Subgroup.center H)).comp (centralSectorProduct φ)) := by + rw [centralSectorProduct_spec] + exact hφ.comp assignmentProjection_surjective + apply MonoidHom.range_eq_top.mp + rw [perfect_lift_range (centralSectorProduct φ) (QuotientGroup.mk' (Subgroup.center H)) + hs (by rw [QuotientGroup.ker_mk']), Group.IsPerfect.commutator_eq_top] + +theorem centralSector_generate [Fintype Ω] [Group.IsPerfect H] + (φ : (Ω → E) →* H ⧸ Subgroup.center H) (hφ : Function.Surjective φ) : + (⨆ ω : Ω, (centralSector φ {ω}).range) = ⊤ := by + have hr := MonoidHom.range_eq_top.mpr (centralSectorProduct_surjective φ hφ) + calc + _ = (centralSectorProduct φ).range := by + unfold centralSectorProduct + exact (MonoidHom.noncommPiCoprod_range _).symm + _ = ⊤ := hr + +end CanonicalSectors + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/CellGeometry.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/CellGeometry.lean new file mode 100644 index 0000000000000000000000000000000000000000..20bdafb1f70347e350529f32645a5769b9ab5143 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/CellGeometry.lean @@ -0,0 +1,71 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.WindowCellPartition + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section CellGeometry + +theorem coordinateInterval_union {a : ℕ} (j : Fin 2) (u v w : CutRing) + (huv : ordinary u ≤ ordinary v) (hvw : ordinary v ≤ ordinary w) + (hlen : ordinary w-ordinary u < 1) : + coordinateInterval a j u w = coordinateInterval a j u v ⊔ coordinateInterval a j v w := by + apply Subtype.ext + ext p + change p ∈ coordinateBetween a j u w ↔ p ∈ coordinateBetween a j u v ∨ p ∈ coordinateBetween a j v w + rw [mem_coordinateBetween_iff j u w (huv.trans hvw) hlen, + mem_coordinateBetween_iff j u v huv (by linarith), + mem_coordinateBetween_iff j v w hvw (by linarith)] + constructor + · rintro ⟨k,hk,hk'⟩ + by_cases hh : coordinate j p+(k:ℝ) < ordinary v + · exact Or.inl ⟨k,hk,hh⟩ + · exact Or.inr ⟨k,le_of_not_gt hh,hk'⟩ + · rintro (⟨k,hk,hk'⟩|⟨k,hk,hk'⟩) + · exact ⟨k,hk,hk'.trans_le hvw⟩ + · exact ⟨k,huv.trans hk,hk'⟩ + +theorem coordinateInterval_nonempty {a : ℕ} (j : Fin 2) (u v : CutRing) + (huv : ordinary u < ordinary v) (hlen : ordinary v-ordinary u < 1) : + (coordinateInterval a j u v).val.Nonempty := by + have hd : 0 < ordinary v-ordinary u := sub_pos.mpr huv + have hp : ∃ p : GenericSquare a, coordinate j p < ordinary v-ordinary u := by + fin_cases j + · obtain ⟨p,hp,_⟩ := generic_rectangle a 0 (ordinary v-ordinary u) 0 1 + (by norm_num) hlen.le hd (by norm_num) (by norm_num) (by norm_num) + exact ⟨p,hp.2⟩ + · obtain ⟨p,_,hp⟩ := generic_rectangle a 0 1 0 (ordinary v-ordinary u) + (by norm_num) (by norm_num) (by norm_num) (by norm_num) hlen.le hd + exact ⟨p,hp.2⟩ + obtain ⟨p,hp⟩ := hp + refine ⟨translate a (coordinateShift j u) p,?_⟩ + change translate a (-coordinateShift j u) (translate a (coordinateShift j u) p) ∈ coordinateArc a j (v-u) + rw [← translate_add,neg_add_cancel,translate_zero] + change coordinate j p < Int.fract (ordinary (v-u)) + rw [map_sub,Int.fract_eq_self.mpr ⟨hd.le,hlen⟩] + exact hp + +theorem windowCell_nonempty {a : ℕ} (j : Fin 2) (n : ℕ) (hn : 201 ≤ n) (q : ℤ) (i : Fin n) : + (windowCell a j n q i).val.Nonempty := by + apply coordinateInterval_nonempty + · exact windowCut_strictMono n q (Fin.castSucc_lt_succ (i := i)) + · have hn' : (200:ℝ) < n := by exact_mod_cast (by omega : 200 < n) + exact (windowCut_mesh n q i).trans_lt ((div_lt_one (by linarith)).mpr hn') + +theorem windowCell_axis_resolved {a : ℕ} {r : CutRing} (j : Fin 2) (n : ℕ) (hn : 0 < n) (q : ℤ) (i : Fin n) : + ResolvedBy (fun z => (InitialCoverSystem.primitiveTests (a := a) (r := r) + (axisWindowPrimitives j n q) z).val) (windowCell a j n q i).val := + axisInterval_resolved j n q _ _ (windowCut_label n q hn i.castSucc) (windowCut_label n q hn i.succ) + +end CellGeometry + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/ChartBoundaryEndpoints.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/ChartBoundaryEndpoints.lean new file mode 100644 index 0000000000000000000000000000000000000000..b541f898d465875218931f0dccd88ae8824c52e6 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/ChartBoundaryEndpoints.lean @@ -0,0 +1,99 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.OpenAffineCharts + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section ChartBoundaryEndpoints +open Classical Set + +def squareBoundaryCuts : Finset PlaneCut := {(0,0),(0,1),(1,0),(1,1)} + +theorem interval_endpoints_closed {X : Type*} [TopologicalSpace X] {f : ℝ → X} + (hf : Continuous f) {A : Set X} (hA : IsClosed A) {L U : ℝ} (hLU : L < U) + (h : ∀r ∈ Ioo L U,f r ∈ A) : f L ∈ A ∧ f U ∈ A := by + have hs : closure (Ioo L U) ⊆ f ⁻¹' A := (hA.preimage hf).closure_subset_iff.mpr h + rw [closure_Ioo hLU.ne] at hs + exact ⟨hs (left_mem_Icc.mpr hLU.le),hs (right_mem_Icc.mpr hLU.le)⟩ + +theorem squareBoundaryCuts_of_closed_not_open {a : ℕ} {p : ℝ×ℝ} + (hp : p ∈ Icc (0:ℝ) 1 ×ˢ Icc (0:ℝ) 1) (hn : p ∉ squareInterior) : + ∃l ∈ squareBoundaryCuts,cutForm a l.1 p=ordinary l.2 := by + by_cases hx₀ : p.1=0 + · exact ⟨(0,0),by simp [squareBoundaryCuts],by simp [cutForm,hx₀]⟩ + by_cases hx₁ : p.1=1 + · exact ⟨(0,1),by simp [squareBoundaryCuts],by simp [cutForm,hx₁]⟩ + by_cases hy₀ : p.2=0 + · exact ⟨(1,0),by simp [squareBoundaryCuts],by simp [cutForm,hy₀]⟩ + by_cases hy₁ : p.2=1 + · exact ⟨(1,1),by simp [squareBoundaryCuts],by simp [cutForm,hy₁]⟩ + exact False.elim (hn ⟨⟨lt_of_le_of_ne hp.1.1 (Ne.symm hx₀),lt_of_le_of_ne hp.1.2 hx₁⟩, + ⟨lt_of_le_of_ne hp.2.1 (Ne.symm hy₀),lt_of_le_of_ne hp.2.2 hy₁⟩⟩) + +theorem squareBoundaryCuts_nonzero_on_interior {a : ℕ} {p : ℝ×ℝ} + (hp : p ∈ squareInterior) {l : PlaneCut} (hl : l ∈ squareBoundaryCuts) : + cutForm a l.1 p ≠ ordinary l.2 := by + simp only [squareBoundaryCuts,Finset.mem_insert,Finset.mem_singleton] at hl + rcases hl with rfl|rfl|rfl|rfl + · simpa [cutForm] using ne_of_gt hp.1.1 + · simpa [cutForm] using ne_of_lt hp.1.2 + · simpa [cutForm] using ne_of_gt hp.2.1 + · simpa [cutForm] using ne_of_lt hp.2.2 + +theorem barrier_geometric_endpoint_cut {a : ℕ} {j : Fin 4} {c : CutRing} {N r : ℝ} + (hc : c ∈ barrierCandidate a j N) + (hr : r=barrierLineLower a j c ∨ r=barrierLineUpper a j c) : + ∃l ∈ squareBoundaryCuts,j ≠ l.1 ∧ cutForm a l.1 (barrierLinePoint a j c r)=ordinary l.2 := by + have hgap := barrierLineLower_lt_upper hc + have hh := interval_endpoints_closed (barrierLinePoint_continuous a j c) + (isClosed_Icc.prod isClosed_Icc) hgap + (fun t ht => let hp := (barrierLinePoint_interior_iff hc t).mpr ht + show barrierLinePoint a j c t ∈ Icc (0:ℝ) 1 ×ˢ Icc (0:ℝ) 1 from + ⟨⟨hp.1.1.le,hp.1.2.le⟩,⟨hp.2.1.le,hp.2.2.le⟩⟩) + have hclosed : barrierLinePoint a j c r ∈ Icc (0:ℝ) 1 ×ˢ Icc (0:ℝ) 1 := + hr.elim (fun h => h ▸ hh.1) (fun h => h ▸ hh.2) + have hn : barrierLinePoint a j c r ∉ squareInterior := by + rw [barrierLinePoint_interior_iff hc r] + rcases hr with rfl|rfl <;> simp + obtain ⟨l,hl,hcut⟩ := squareBoundaryCuts_of_closed_not_open hclosed hn + refine ⟨l,hl,?_,hcut⟩ + intro he + obtain ⟨p,hp,hpc⟩ := hc.2 + have hjc := cutForm_barrierLinePoint a j c r + rw [←he] at hcut + have hp' := hpc.trans (hjc.symm.trans hcut) + rw [he] at hp' + exact squareBoundaryCuts_nonzero_on_interior hp hl hp' + +theorem chart_line_endpoints_forced {a : ℕ} (T : Finset PlaneCut) (p : GenericSquare a) + {j : Fin 4} {c : CutRing} {N x : ℝ} (hc : c ∈ barrierCandidate a j N) + (hx : barrierLinePoint a j c x ∈ openSquareChart T p) : + ∃L U : ℝ,x ∈ Ioo L U ∧ + L ∈ Icc (barrierLineLower a j c) (barrierLineUpper a j c) ∧ + U ∈ Icc (barrierLineLower a j c) (barrierLineUpper a j c) ∧ + (∀r ∈ Ioo L U,barrierLinePoint a j c r ∈ openSquareChart T p) ∧ + (∀r ∈ ({L,U} : Finset ℝ),∃l ∈ T ∪ squareBoundaryCuts,j ≠ l.1 ∧ + cutForm a l.1 (barrierLinePoint a j c r)=ordinary l.2) := by + obtain ⟨L,U,hx,hL,hU,hchart,hend⟩ := openSquareChart_line_interval T p hc hx + refine ⟨L,U,hx,hL,hU,hchart,?_⟩ + intro r hr + rcases hend r hr with h | h | h + · obtain ⟨l,hl,hj,hc⟩ := barrier_geometric_endpoint_cut hc (Or.inl h) + exact ⟨l,Finset.mem_union_right _ hl,hj,hc⟩ + · obtain ⟨l,hl,hj,hc⟩ := barrier_geometric_endpoint_cut hc (Or.inr h) + exact ⟨l,Finset.mem_union_right _ hl,hj,hc⟩ + · obtain ⟨l,hl,hj,hc⟩ := h + exact ⟨l,Finset.mem_union_left _ hl,hj,hc⟩ + +end ChartBoundaryEndpoints + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/ChartQuadrants.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/ChartQuadrants.lean new file mode 100644 index 0000000000000000000000000000000000000000..0e21e0d507ff351313507fbf1903680e49f01f2a --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/ChartQuadrants.lean @@ -0,0 +1,171 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.IntersectionControl + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section ChartQuadrants + +theorem coordinateRectangle_lift {a : ℕ} (u v : Fin 2 → CutRing) + (huv : ∀ j, ordinary (u j) ≤ ordinary (v j)) + (hlen : ∀ j, ordinary (v j)-ordinary (u j) < 1) + (p : GenericSquare a) (hp : p ∈ (coordinateRectangle a u v).val) : + ∃ t : ℝ × ℝ, p.val = (Int.fract t.1,Int.fract t.2) ∧ + (ordinary (u 0) ≤ t.1 ∧ t.1 < ordinary (v 0)) ∧ + (ordinary (u 1) ≤ t.2 ∧ t.2 < ordinary (v 1)) := by + change p ∈ coordinateBetween a 0 (u 0) (v 0) ∧ + p ∈ coordinateBetween a 1 (u 1) (v 1) at hp + obtain ⟨k,hk⟩ := (mem_coordinateBetween_iff 0 (u 0) (v 0) (huv 0) (hlen 0) p).mp hp.1 + obtain ⟨l,hl⟩ := (mem_coordinateBetween_iff 1 (u 1) (v 1) (huv 1) (hlen 1) p).mp hp.2 + refine ⟨(coordinate 0 p+(k:ℝ),coordinate 1 p+(l:ℝ)),?_,hk,hl⟩ + simp only [Int.fract_add_intCast,Int.fract_eq_self.mpr (coordinate_bounds 0 p), + Int.fract_eq_self.mpr (coordinate_bounds 1 p)] + rfl + +theorem coordinateRectangle_sign {a : ℕ} (r : CutRing) (j : Fin 4) + (hr : 0 < ordinary r ∧ ordinary r < 1/2) (u v : Fin 2 → CutRing) + (huv : ∀ k, ordinary (u k) ≤ ordinary (v k)) + (hu : ∀ k, -ordinary r < ordinary (u k)) + (hv : ∀ k, ordinary (v k) < ordinary r) + (hside : ∀ t : ℝ × ℝ, + (ordinary (u 0) ≤ t.1 ∧ t.1 < ordinary (v 0)) → + (ordinary (u 1) ≤ t.2 ∧ t.2 < ordinary (v 1)) → 0 ≤ cutForm a j t) : + coordinateRectangle a u v ≤ clippedSlopePrimitive a r j := by + intro p hp + obtain ⟨t,ht,hx,hy⟩ := coordinateRectangle_lift u v huv + (fun k => by have h1 := hu k; have h2 := hv k; linarith [hr.2]) p hp + apply (mem_clippedSlope_lift r j hr p t ?_ ht).mpr + · exact hside t hx hy + · exact ⟨⟨(hu 0).trans_le hx.1,hx.2.trans (hv 0)⟩, + ⟨(hu 1).trans_le hy.1,hy.2.trans (hv 1)⟩⟩ + +theorem coordinateRectangle_negative_sign {a : ℕ} (r : CutRing) (j : Fin 4) + (hr : 0 < ordinary r ∧ ordinary r < 1/2) (u v : Fin 2 → CutRing) + (huv : ∀ k, ordinary (u k) ≤ ordinary (v k)) + (hu : ∀ k, -ordinary r < ordinary (u k)) + (hv : ∀ k, ordinary (v k) < ordinary r) + (hside : ∀ t : ℝ × ℝ, + (ordinary (u 0) ≤ t.1 ∧ t.1 < ordinary (v 0)) → + (ordinary (u 1) ≤ t.2 ∧ t.2 < ordinary (v 1)) → cutForm a j t < 0) : + coordinateRectangle a u v ≤ (clippedSlopePrimitive a r j)ᶜ := by + intro p hp hpos + obtain ⟨t,ht,hx,hy⟩ := coordinateRectangle_lift u v huv + (fun k => by have h1 := hu k; have h2 := hv k; linarith [hr.2]) p hp + have hR : (-ordinary r < t.1 ∧ t.1 < ordinary r) ∧ + (-ordinary r < t.2 ∧ t.2 < ordinary r) := + ⟨⟨(hu 0).trans_le hx.1,hx.2.trans (hv 0)⟩, + ⟨(hu 1).trans_le hy.1,hy.2.trans (hv 1)⟩⟩ + have hh := (mem_clippedSlope_lift r j hr p t hR ht).mp hpos + exact (not_lt_of_ge hh) (hside t hx hy) + +theorem northwest_quadrant_sign {a : ℕ} (r s : CutRing) + (hr : 0 < ordinary r ∧ ordinary r < 1/2) + (hs : 0 < ordinary s ∧ ordinary s < ordinary r) : + coordinateRectangle a ![-s,0] ![0,s] ≤ clippedSlopePrimitive a r 2 := by + apply coordinateRectangle_sign r 2 hr + · intro k; fin_cases k <;> simp <;> linarith [hs.1] + · intro k; fin_cases k <;> simp <;> linarith [hr.1,hs.2] + · intro k; fin_cases k <;> simp <;> linarith [hr.1,hs.2] + · intro t hx hy + change ordinary (-s) ≤ t.1 ∧ t.1 < ordinary 0 at hx + change ordinary 0 ≤ t.2 ∧ t.2 < ordinary s at hy + have hlambda : 0 ≤ Real.goldenRatio^a := pow_nonneg Real.goldenRatio_pos.le _ + have hx' : t.1 ≤ 0 := by simpa using hx.2.le + have hy' : 0 ≤ t.2 := by simpa using hy.1 + change 0 ≤ t.2-Real.goldenRatio^a*t.1 + exact sub_nonneg.mpr ((mul_nonpos_of_nonneg_of_nonpos hlambda hx').trans hy') + +theorem southeast_quadrant_sign {a : ℕ} (r s : CutRing) + (hr : 0 < ordinary r ∧ ordinary r < 1/2) + (hs : 0 < ordinary s ∧ ordinary s < ordinary r) : + coordinateRectangle a ![0,-s] ![s,0] ≤ (clippedSlopePrimitive a r 2)ᶜ := by + apply coordinateRectangle_negative_sign r 2 hr + · intro k; fin_cases k <;> simp <;> linarith [hs.1] + · intro k; fin_cases k <;> simp <;> linarith [hr.1,hs.2] + · intro k; fin_cases k <;> simp <;> linarith [hr.1,hs.2] + · intro t hx hy + change ordinary 0 ≤ t.1 ∧ t.1 < ordinary s at hx + change ordinary (-s) ≤ t.2 ∧ t.2 < ordinary 0 at hy + have hlambda : 0 ≤ Real.goldenRatio^a := pow_nonneg Real.goldenRatio_pos.le _ + have hx' : 0 ≤ t.1 := by simpa using hx.1 + have hy' : t.2 < 0 := by simpa using hy.2 + change t.2-Real.goldenRatio^a*t.1 < 0 + exact sub_neg.mpr (hy'.trans_le (mul_nonneg hlambda hx')) + +end ChartQuadrants + +section ChartAction +namespace ActualLawfulTable +variable {E H Q Ω : Type*} [Group E] [Group H] [Group Q] [Group.IsPerfect E] + {q : H →* Q} {v : (Ω → E) →* Q} (T : ActualLawfulTable q v) + +theorem sector_same_action (U V W : Set Ω) (he : U ∩ W = V ∩ W) : + SameActionOn (T.sector U) (T.sector V) (T.sector W).range := by + intro s x hx + obtain ⟨t,rfl⟩ := hx + rw [T.sector_split U W s,T.sector_split V W s] + rw [conj_mul_of_commute _ _ _ + (T.sector_commute (Set.disjoint_left.mpr (by aesop)) s t)] + rw [conj_mul_of_commute _ _ _ + (T.sector_commute (Set.disjoint_left.mpr (by aesop)) s t)] + rw [he] +end ActualLawfulTable + +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) {ι : Type*} [Finite ι] + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + +theorem fullGeometricSector_same_action (hlarge : 15 < m+1) + (P : ι → Fin 5 × (CutRing × CutRing)) + (h : ∀ I, I.card ≤ 15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb P) + (U V W : polygonAlgebra a) + (hU : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) P i).val) U.val) + (hV : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) P i).val) V.val) + (hW : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) P i).val) W.val) + (he : U ⊓ W = V ⊓ W) : + SameActionOn (B.fullGeometricSector hlarge P h U) + (B.fullGeometricSector hlarge P h V) (B.fullGeometricSector hlarge P h W).range := by + apply (B.fullPrimitiveTable hlarge P h).sector_same_action + rw [← resolvedPolygonMask_inter _ U.val W.val hU hW, + ← resolvedPolygonMask_inter _ V.val W.val hV hW] + exact congrArg (resolvedPolygonMask (primitiveTests (a := a) (r := r) P)) + (congrArg Subtype.val he) + +theorem chart_action_transfer (hlarge : 20 ≤ m+1) + (P : ι → Fin 5 × (CutRing × CutRing)) + (h : ∀ I, I.card ≤ 15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb P) + (U V W : polygonAlgebra a) + (hU : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) P i).val) U.val) + (hV : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) P i).val) V.val) + (hW : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) P i).val) W.val) + (he : U ⊓ W = V ⊓ W) + (f : TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm)) + (hf : B.AlignedSmallSupported f) + (hcontrol : SmallControlled B.c f (B.fullGeometricSector (by omega) P h W)) + (I : ControlAlphabet (Fin (m+1))) (s : UniversalExtension (alternatingGroup I.val)) : + ∀ x ∈ f.range, + B.fullGeometricSector (by omega) P h U (universalMap (subtypeAlternatingHom I.val) s)*x* + (B.fullGeometricSector (by omega) P h U (universalMap (subtypeAlternatingHom I.val) s))⁻¹ = + B.fullGeometricSector (by omega) P h V (universalMap (subtypeAlternatingHom I.val) s)*x* + (B.fullGeometricSector (by omega) P h V (universalMap (subtypeAlternatingHom I.val) s))⁻¹ := by + apply small_control_comparison _ B.c B.constant_aligned B.disjoint_aligned f _ hf hcontrol I.val _ _ + (B.fullGeometricSector_supported (by omega) P h U hU I ⟨s,rfl⟩) + (B.fullGeometricSector_supported (by omega) P h V hV I ⟨s,rfl⟩) + (by have hh := I.property.2; simp only [Fintype.card_fin]; omega) + intro J t + exact B.fullGeometricSector_same_action (by omega) P h U V W hU hV hW he _ _ ⟨_,rfl⟩ + +end InitialCoverSystem +end ChartAction + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/ClippedGerms.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/ClippedGerms.lean new file mode 100644 index 0000000000000000000000000000000000000000..178d54cca6c507177f33fdb7ba4e73112ccc8998 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/ClippedGerms.lean @@ -0,0 +1,178 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.ConcurrentCoordinateGates +import OAI.GroupTheory.SimpleAmenable.Homology.InwardTemplateResolutions +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.InwardGermTransport + +namespace OAI + +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +section ClippedGerms + +structure ClippedGerm (a : ℕ) (r : CutRing) (j : Fin 4) + (u : CutRing × CutRing) (z : ℝ × ℝ) where + period : Fin 2 → ℤ + radius : ℝ + radius_pos : 0 halfPlane a (j i) (c i)) + (spatialTranslate u (clippedSlopePrimitive a r slope)).val) + (p : GenericSquare a) (hp : p ∈ (C.inwardMargin T.vertex T.offset z).val) : + p ∈ (T.polygons (fun _ : Unit => spatialTranslate u (clippedSlopePrimitive a r slope)) ()).val ↔ + (∀ d, p ∉ (C.localDecision T.vertex T.offset z (j (lo d)) (c (lo d))).val ∧ + p ∈ (C.localDecision T.vertex T.offset z (j (hi d)) (c (hi d))).val) ∧ + p ∉ (C.localDecision T.vertex T.offset z (j s) (c s)).val := by + obtain ⟨q,hq,he⟩ := T.assignment_realized hr hz₁ hz₂ p hp + (Metric.ball z G.radius) Metric.isOpen_ball (Metric.mem_ball_self G.radius_pos) + have hd (i : ι) : q ∈ (cutPolygon a (j i) (c i)).val ↔ + p ∈ (C.localDecision T.vertex T.offset z (j i) (c i)).val := by + simpa only [polygonAssignment,decide_eq_true_eq] using Bool.eq_iff_iff.mp (congrFun he i) + have hmodel : p ∈ (T.polygons (fun _ : Unit => spatialTranslate u (clippedSlopePrimitive a r slope)) ()).val ↔ + q ∈ (spatialTranslate u (clippedSlopePrimitive a r slope)).val := by + change polygonAssignment (fun i => C.localDecision T.vertex T.offset z (j i) (c i)) p ∈ + polygonFormalMask (fun i => cutPolygon a (j i) (c i)) _ ↔ _ + rw [← he] + exact polygonFormalMask_mem _ _ hR q + rw [hmodel,G.valid q hq] + apply and_congr + · apply forall_congr' + intro d + apply and_congr + · simpa only [cutPolygon,halfPlane,Set.mem_ofPred_eq,(hlo d).1,(hlo d).2,cutForm_axis,not_lt,offset] + using not_congr (hd (lo d)) + · simpa only [cutPolygon,halfPlane,Set.mem_ofPred_eq,(hhi d).1,(hhi d).2,cutForm_axis,offset] + using hd (hi d) + · simpa only [cutPolygon,halfPlane,Set.mem_ofPred_eq,hs.1,hs.2,not_lt,offset] using not_congr (hd s) + +end ClippedGerm +end ClippedGerms + +namespace ConcurrentGeometry +variable {a : ℕ} {r : CutRing} (C : ConcurrentGeometry a r) {κ : Type*} [Finite κ] + +noncomputable def coordinateGate (t : VertexType (commonVertexDenominator a)) + (u : CutRing × CutRing) (z : ℝ × ℝ) (j : κ → Fin 2) (c : κ → CutRing) (σ : κ → Bool) : polygonAlgebra a := + C.inwardMargin t u z ⊓ polygonBooleanPullback + (fun i => C.localDecision t u z (axisDirection (j i)) (c i)) {σ} + +theorem coordinateGate_mem (t : VertexType (commonVertexDenominator a)) + (u : CutRing × CutRing) (z : ℝ × ℝ) (j : κ → Fin 2) (c : κ → CutRing) (σ : κ → Bool) + (p : GenericSquare a) : + p ∈ (C.coordinateGate t u z j c σ).val ↔ p ∈ (C.inwardMargin t u z).val ∧ + polygonAssignment (fun i => C.localDecision t u z (axisDirection (j i)) (c i)) p=σ := Iff.rfl + +end ConcurrentGeometry + +namespace InitialCoverSystem.PatchAtlas +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} {B : InitialCoverSystem a r m hm M} + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] (A : B.PatchAtlas) + {κ : Type*} [Finite κ] + +omit [Group.IsPerfect (alternatingGroup (Fin (m+1)))] in +theorem coordinateGate_resolved (t : VertexType (commonVertexDenominator a)) + (u : CutRing × CutRing) (z : ℝ × ℝ) (j : κ → Fin 2) (c : κ → CutRing) (σ : κ → Bool) : + ResolvedBy (fun i => (primitiveTests (a := a) (r := r) (A.concurrentCoordinates t u) i).val) + (A.geometry.coordinateGate t u z j c σ).val := by + intro x y hh + apply and_congr (A.coordinate_inward_resolved t u z x y hh) + exact polygonBooleanPullback_resolved _ _ + (fun i => A.coordinate_localDecision_resolved t u z (j i) (c i)) {σ} x y hh + +theorem coordinateGate_control (hlarge : 20 ≤ m+1) + (t : VertexType (commonVertexDenominator a)) (u : CutRing × CutRing) (z : ℝ × ℝ) + (j : κ → Fin 2) (c : κ → CutRing) (σ : κ → Bool) + (n : ℕ) (q : Fin 2 → ℤ) (W : polygonAlgebra a) + (hW : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) (coordinateWindowPrimitives n q) i).val) W.val) + (hinc : W ≤ A.geometry.coordinateGate t u z j c σ) + (f : TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm)) + (hf : B.AlignedSmallSupported f) + (hc : SmallControlled B.c f (B.windowSector (by omega) n (A.rectangles.rectangles n) q W)) : + SmallControlled B.c f (B.fullGeometricSector (by omega) (A.concurrentPrimitives t u) (A.concurrentLaw t u) + (A.geometry.coordinateGate t u z j c σ)) := + A.coordinate_control_inward_gate hlarge t u _ (A.coordinateGate_resolved t u z j c σ) n q W hW hinc f hf hc + +end InitialCoverSystem.PatchAtlas + +namespace ClippedGerm +variable {a : ℕ} {r : CutRing} {slope : Fin 4} {u : CutRing × CutRing} {z : ℝ × ℝ} + (G : ClippedGerm a r slope u z) + +noncomputable def axialCut (i : Fin 2 × Bool) : CutRing := + if i.2 then pointCoordinate G.offset i.1+r else pointCoordinate G.offset i.1-r + +theorem model_restrict_gate {ι : Type*} [Finite ι] {C : ConcurrentGeometry a r} + {j : ι → Fin 4} {c : ι → CutRing} + (T : C.InwardChart j c z) (hr : 0 halfPlane a (j i) (c i)) + (spatialTranslate u (clippedSlopePrimitive a r slope)).val) + (σ : Fin 2 × Bool → Bool) : + T.polygons (fun _ : Unit => spatialTranslate u (clippedSlopePrimitive a r slope)) () ⊓ + C.coordinateGate T.vertex T.offset z Prod.fst G.axialCut σ = + (if ∀ d, σ (d,false)=false ∧ σ (d,true)=true then + (C.localDecision T.vertex T.offset z (j s) (c s))ᶜ else ⊥) ⊓ + C.coordinateGate T.vertex T.offset z Prod.fst G.axialCut σ := by + classical + apply Subtype.ext + ext p + by_cases hgate : p ∈ (C.coordinateGate T.vertex T.offset z Prod.fst G.axialCut σ).val + · have hmargin := hgate.1 + have hassign := hgate.2 + have hlo' (d : Fin 2) : p ∉ (C.localDecision T.vertex T.offset z (j (lo d)) (c (lo d))).val ↔ + σ (d,false)=false := by + have he := congrFun hassign (d,false) + simpa only [polygonAssignment,axialCut,Bool.false_eq_true,↓reduceIte,Prod.fst, + (hlo d).1,(hlo d).2,decide_eq_false_iff_not] using (congrArg (fun b => b=false) he).to_iff + have hhi' (d : Fin 2) : p ∈ (C.localDecision T.vertex T.offset z (j (hi d)) (c (hi d))).val ↔ + σ (d,true)=true := by + have he := congrFun hassign (d,true) + simpa only [polygonAssignment,axialCut,↓reduceIte,Prod.fst, + (hhi d).1,(hhi d).2,decide_eq_true_eq] using (congrArg (fun b => b=true) he).to_iff + have he := G.model_formula T hr hz₁ hz₂ lo hi s hlo hhi hs hR p hmargin + have hc : (∀ d, p ∉ (C.localDecision T.vertex T.offset z (j (lo d)) (c (lo d))).val ∧ + p ∈ (C.localDecision T.vertex T.offset z (j (hi d)) (c (hi d))).val) ↔ + ∀ d, σ (d,false)=false ∧ σ (d,true)=true := + forall_congr' (fun d => and_congr (hlo' d) (hhi' d)) + change (_ ∧ _) ↔ (_ ∧ _) + simp only [hgate,and_true] + rw [he,hc] + split_ifs with HH <;> simp only [HH,forall_const,true_and,false_and] <;> rfl + · change (_ ∧ _) ↔ (_ ∧ _) + simp only [hgate,and_false] + +end ClippedGerm + +end SimpleAmenable + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/ClippedIntervals.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/ClippedIntervals.lean new file mode 100644 index 0000000000000000000000000000000000000000..95e37bad0486dec423b8bb3e8ad1ba7292e44b6b --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/ClippedIntervals.lean @@ -0,0 +1,133 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.SortedAxisCuts + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section ClippedIntervals +attribute [local instance] cutOrdinaryOrder + +theorem coordinateInterval_mem_lifted {a : ℕ} (d : Fin 2) (b u v : CutRing) + (hbu : ordinary b ≤ ordinary u) (huv : ordinary u ≤ ordinary v) + (hvb : ordinary v < ordinary b+1) (x : GenericSquare a) : + x ∈ (coordinateInterval a d u v).val ↔ + ordinary u ≤ liftedCoordinate d b x ∧ liftedCoordinate d b x < ordinary v := by + change x ∈ coordinateBetween a d u v ↔ _ + rw [mem_coordinateBetween_iff d u v huv (by linarith) x] + constructor + · rintro ⟨k,hk,hk'⟩ + have hf : (⌊coordinate d x-ordinary b⌋:ℤ) = -k := by + apply Int.floor_eq_iff.mpr + simp only [Int.cast_neg] + constructor <;> linarith + simp only [liftedCoordinate,hf,Int.cast_neg,sub_neg_eq_add] + exact ⟨hk,hk'⟩ + · rintro ⟨hk,hk'⟩ + refine ⟨-⌊coordinate d x-ordinary b⌋,?_,?_⟩ + · simpa only [liftedCoordinate,Int.cast_neg,sub_eq_add_neg] using hk + · simpa only [liftedCoordinate,Int.cast_neg,sub_eq_add_neg] using hk' + +theorem coordinateInterval_prefix_difference {a : ℕ} (d : Fin 2) (b u v : CutRing) + (hbu : ordinary b ≤ ordinary u) (huv : ordinary u ≤ ordinary v) + (hvb : ordinary v < ordinary b+1) : + coordinateInterval a d u v = coordinateInterval a d b v \ coordinateInterval a d b u := by + apply Subtype.ext + ext x + change x ∈ (coordinateInterval a d u v).val ↔ + x ∈ (coordinateInterval a d b v).val ∧ x ∉ (coordinateInterval a d b u).val + rw [coordinateInterval_mem_lifted d b u v hbu huv hvb, + coordinateInterval_mem_lifted d b b v le_rfl (hbu.trans huv) hvb, + coordinateInterval_mem_lifted d b b u le_rfl hbu (by linarith)] + have hb := (liftedCoordinate_bounds d b x).1 + constructor + · rintro ⟨h,h'⟩; exact ⟨⟨hb,h'⟩,by rintro ⟨_,h''⟩; linarith⟩ + · rintro ⟨⟨_,h'⟩,h⟩; exact ⟨by by_contra hh; exact h ⟨hb,lt_of_not_ge hh⟩,h'⟩ + +theorem coordinateInterval_prefix_clip {a : ℕ} (d : Fin 2) (u v z : CutRing) + (huv : ordinary u ≤ ordinary v) (hv : ordinary v < ordinary u+1) + (huz : ordinary u ≤ ordinary z) (hz : ordinary z < ordinary u+1) : + coordinateInterval a d u v ⊓ coordinateInterval a d u z = coordinateInterval a d u (min v z) := by + by_cases h : ordinary v ≤ ordinary z + · have hh : v ≤ z := h + rw [min_eq_left hh] + exact inf_eq_left.mpr (coordinateInterval_mono d u v u z le_rfl huv h (by linarith)) + · have hh : z ≤ v := le_of_not_ge h + rw [min_eq_right hh] + exact inf_eq_right.mpr (coordinateInterval_mono d u z u v le_rfl huz hh (by linarith)) + +theorem coordinateInterval_label_eq {a : ℕ} (d : Fin 2) (u v u' v' : CutRing) + (hu : endpointLabel u=endpointLabel u') (hv : endpointLabel v=endpointLabel v') : + coordinateInterval a d u v = coordinateInterval a d u' v' := by + have hu' : u = u'+((u.re-u'.re:ℤ):CutRing) := by + apply QuadraticAlgebra.ext <;> simp [show u.im = u'.im from hu] + have hv' : v = v'+((v.re-v'.re:ℤ):CutRing) := by + apply QuadraticAlgebra.ext <;> simp [show v.im = v'.im from hv] + apply Subtype.ext + change coordinateBetween a d u v = coordinateBetween a d u' v' + rw [hu',hv',coordinateBetween_period] + +noncomputable def clippedLabel (u v : CutRing) (q : ℤ) : CutRing := min v (labelLift u q) + +theorem clippedLabel_bounds (u v : CutRing) (q : ℤ) (huv : ordinary u ≤ ordinary v) : + ordinary u ≤ ordinary (clippedLabel u v q) ∧ ordinary (clippedLabel u v q) ≤ ordinary v := by + change u ≤ min v (labelLift u q) ∧ min v (labelLift u q) ≤ v + exact ⟨le_min huv (labelLift_bounds u q).1,min_le_left _ _⟩ + +theorem clippedLabel_label (u v : CutRing) (q : ℤ) : + endpointLabel (clippedLabel u v q)=endpointLabel v ∨ endpointLabel (clippedLabel u v q)=q := by + unfold clippedLabel + rcases le_total v (labelLift u q) with h|h + · rw [min_eq_left h]; exact Or.inl rfl + · rw [min_eq_right h]; exact Or.inr (endpointLabel_labelLift u q) + +theorem clippedLabel_mem (N : ℕ) (p : ℤ) (u v : CutRing) (q : ℤ) + (huv : ordinary u ≤ ordinary v) (hlen : ordinary v-ordinary u < 1) + (hv : p ≤ endpointLabel v ∧ endpointLabel v < p+N) + (hq : p ≤ q ∧ q < p+N) : clippedLabel u v q ∈ anchorCutSet N p u v := by + apply mem_anchorCutSet N p u v _ ?_ (clippedLabel_bounds u v q huv) hlen + rcases clippedLabel_label u v q with h|h <;> rw [h] <;> assumption + +theorem coordinateInterval_anchor_formula {a : ℕ} (d : Fin 2) (u v s t : CutRing) + (huv : ordinary u ≤ ordinary v) (hlen : ordinary v-ordinary u < 1) : + coordinateInterval a d u v ⊓ coordinateInterval a d s t = + if ordinary (labelLift u (endpointLabel s)) ≤ ordinary (labelLift u (endpointLabel t)) then + coordinateInterval a d u (clippedLabel u v (endpointLabel t)) \ + coordinateInterval a d u (clippedLabel u v (endpointLabel s)) + else coordinateInterval a d u v \ (coordinateInterval a d u (clippedLabel u v (endpointLabel s)) \ + coordinateInterval a d u (clippedLabel u v (endpointLabel t))) := by + let s' := labelLift u (endpointLabel s) + let t' := labelLift u (endpointLabel t) + have hs := labelLift_bounds u (endpointLabel s) + have ht := labelLift_bounds u (endpointLabel t) + rw [coordinateInterval_label_eq d s t s' t' (by simp [s']) (by simp [t'])] + split_ifs with h + · rw [coordinateInterval_prefix_difference d u s' t' hs.1 h ht.2] + have hset : ∀ (A B C : polygonAlgebra a), A ⊓ (B \ C) = (A ⊓ B) \ (A ⊓ C) := by + intro A B C; apply Subtype.ext; ext x; change _ ∧ (_ ∧ ¬_) ↔ (_ ∧ _) ∧ ¬(_ ∧ _); tauto + rw [hset,coordinateInterval_prefix_clip d u v t' huv (by linarith) ht.1 ht.2, + coordinateInterval_prefix_clip d u v s' huv (by linarith) hs.1 hs.2] + rfl + · have hts : ordinary t' < ordinary s' := lt_of_not_ge h + have he : coordinateInterval a d s' t' = (coordinateInterval a d t' s')ᶜ := by + apply Subtype.ext + exact coordinateBetween_reverse d t' s' (by + rw [map_sub,Int.fract_eq_self.mpr ⟨by linarith,by linarith⟩]; linarith) + rw [he,coordinateInterval_prefix_difference d u t' s' ht.1 hts.le hs.2] + have hset : ∀ (A B C : polygonAlgebra a), A ⊓ (B \ C)ᶜ = A \ ((A ⊓ B) \ (A ⊓ C)) := by + intro A B C; apply Subtype.ext; ext x; change _ ∧ ¬(_ ∧ ¬_) ↔ _ ∧ ¬((_ ∧ _) ∧ ¬(_ ∧ _)); tauto + rw [hset,coordinateInterval_prefix_clip d u v s' huv (by linarith) hs.1 hs.2, + coordinateInterval_prefix_clip d u v t' huv (by linarith) ht.1 ht.2] + rfl + +end ClippedIntervals + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/ClosedChartOverlap.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/ClosedChartOverlap.lean new file mode 100644 index 0000000000000000000000000000000000000000..337ab4d3c1f30068903ea51a4b7fc9a214303ba0 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/ClosedChartOverlap.lean @@ -0,0 +1,190 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.RectangularBound + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section ClosedChartOverlap + +theorem planar_lift_avoidsCuts {a : ℕ} (p : GenericSquare a) (t : ℝ × ℝ) + (ht : p.val = (Int.fract t.1,Int.fract t.2)) : AvoidsCuts a t := by + have h := avoidsCuts_translate p.property.2.2 + ((⌊t.1⌋ : CutRing),(⌊t.2⌋ : CutRing)) + have he : p.val+(ordinary (⌊t.1⌋ : CutRing),ordinary (⌊t.2⌋ : CutRing)) = t := by + rw [ht] + apply Prod.ext + · change Int.fract t.1+ordinary (⌊t.1⌋ : CutRing) = t.1 + rw [map_intCast] + exact sub_add_cancel _ _ + · change Int.fract t.2+ordinary (⌊t.2⌋ : CutRing) = t.2 + rw [map_intCast] + exact sub_add_cancel _ _ + rwa [he] at h + +theorem coordinateRectangle_strict_lift {a : ℕ} (l h : Fin 2 → CutRing) + (hlh : ∀ j, ordinary (l j) ≤ ordinary (h j)) + (hlen : ∀ j, ordinary (h j)-ordinary (l j) < 1) + (p : GenericSquare a) (hp : p ∈ (coordinateRectangle a l h).val) : + ∃ t : ℝ × ℝ, p.val = (Int.fract t.1,Int.fract t.2) ∧ + (ordinary (l 0) < t.1 ∧ t.1 < ordinary (h 0)) ∧ + (ordinary (l 1) < t.2 ∧ t.2 < ordinary (h 1)) := by + obtain ⟨t,ht,hx,hy⟩ := coordinateRectangle_lift l h hlh hlen p hp + have hx' := planar_lift_avoidsCuts p t ht 0 (l 0) + have hy' := planar_lift_avoidsCuts p t ht 1 (l 1) + simp only [cutForm,Matrix.cons_val_zero,Matrix.cons_val_one] at hx' hy' + exact ⟨t,ht,⟨lt_of_le_of_ne hx.1 (Ne.symm hx'),hx.2⟩, + ⟨lt_of_le_of_ne hy.1 (Ne.symm hy'),hy.2⟩⟩ + +theorem clippedSlope_agree_on_closed_rectangle {a : ℕ} (r : CutRing) (j : Fin 4) + (hr : 0 < ordinary r ∧ ordinary r < 1/2) + (u v : CutRing × CutRing) (l h : Fin 2 → CutRing) + (hlh : ∀ k, ordinary (l k) ≤ ordinary (h k)) + (hlen : ∀ k, ordinary (h k)-ordinary (l k) < 1) + (hu : ∀ k, -ordinary r ≤ ordinary (l k)-ordinary (pointCoordinate u k) ∧ + ordinary (h k)-ordinary (pointCoordinate u k) ≤ ordinary r) + (hv : ∀ k, -ordinary r ≤ ordinary (l k)-ordinary (pointCoordinate v k) ∧ + ordinary (h k)-ordinary (pointCoordinate v k) ≤ ordinary r) + (hline : integralCutForm a j u = integralCutForm a j v) : + spatialTranslate u (clippedSlopePrimitive a r j) ⊓ coordinateRectangle a l h = + spatialTranslate v (clippedSlopePrimitive a r j) ⊓ coordinateRectangle a l h := by + apply Subtype.ext + ext p + change (p ∈ (spatialTranslate u (clippedSlopePrimitive a r j)).val ∧ + p ∈ (coordinateRectangle a l h).val) ↔ + (p ∈ (spatialTranslate v (clippedSlopePrimitive a r j)).val ∧ + p ∈ (coordinateRectangle a l h).val) + by_cases hp : p ∈ (coordinateRectangle a l h).val + · obtain ⟨t,ht,hx,hy⟩ := coordinateRectangle_strict_lift l h hlh hlen p hp + have hbox (w : CutRing × CutRing) + (hw : ∀ k : Fin 2, -ordinary r ≤ ordinary (l k)-ordinary (pointCoordinate w k) ∧ + ordinary (h k)-ordinary (pointCoordinate w k) ≤ ordinary r) : + (-ordinary r < t.1-ordinary w.1 ∧ t.1-ordinary w.1 < ordinary r) ∧ + (-ordinary r < t.2-ordinary w.2 ∧ t.2-ordinary w.2 < ordinary r) := by + have hw0 := hw 0 + have hw1 := hw 1 + simp only [pointCoordinate,ite_true,Fin.isValue,show (1:Fin 2) ≠ 0 by decide,ite_false] at hw0 hw1 + constructor <;> constructor <;> linarith + rw [translated_clippedSlope_lift r j hr u p t ht (hbox u hu), + translated_clippedSlope_lift r j hr v p t ht (hbox v hv),hline] + · simp only [hp,and_false] + +end ClosedChartOverlap + +section FullTangentOverlap + +noncomputable def orderedCutMax (x y : CutRing) : CutRing := + if ordinary x ≤ ordinary y then y else x +noncomputable def orderedCutMin (x y : CutRing) : CutRing := + if ordinary x ≤ ordinary y then x else y + +@[simp] theorem ordinary_orderedCutMax (x y : CutRing) : + ordinary (orderedCutMax x y) = max (ordinary x) (ordinary y) := by + unfold orderedCutMax + split_ifs with h + · exact (max_eq_right h).symm + · exact (max_eq_left (le_of_not_ge h)).symm + +@[simp] theorem ordinary_orderedCutMin (x y : CutRing) : + ordinary (orderedCutMin x y) = min (ordinary x) (ordinary y) := by + unfold orderedCutMin + split_ifs with h + · exact (min_eq_left h).symm + · exact (min_eq_right (le_of_not_ge h)).symm + +noncomputable def clippingOverlapLower (r : CutRing) (t : CutRing × CutRing) (j : Fin 2) : CutRing := + orderedCutMax (-r) (pointCoordinate t j-r) +noncomputable def clippingOverlapUpper (r : CutRing) (t : CutRing × CutRing) (j : Fin 2) : CutRing := + orderedCutMin r (pointCoordinate t j+r) + +theorem clippingOverlap_bounds (r : CutRing) (t : CutRing × CutRing) + (hr : 0 < ordinary r ∧ ordinary r < 1/2) + (ht : ∀ j, |ordinary (pointCoordinate t j)| ≤ 2*ordinary r) (j : Fin 2) : + ordinary (clippingOverlapLower r t j) ≤ ordinary (clippingOverlapUpper r t j) ∧ + ordinary (clippingOverlapUpper r t j)-ordinary (clippingOverlapLower r t j) < 1 ∧ + (-ordinary r ≤ ordinary (clippingOverlapLower r t j) ∧ + ordinary (clippingOverlapUpper r t j) ≤ ordinary r) ∧ + (-ordinary r ≤ ordinary (clippingOverlapLower r t j)-ordinary (pointCoordinate t j) ∧ + ordinary (clippingOverlapUpper r t j)-ordinary (pointCoordinate t j) ≤ ordinary r) := by + have hh := abs_le.mp (ht j) + simp only [clippingOverlapLower,clippingOverlapUpper,ordinary_orderedCutMax, + ordinary_orderedCutMin,map_sub,map_neg,map_add] + have h1 := le_max_left (-ordinary r) (ordinary (pointCoordinate t j)-ordinary r) + have h2 := le_max_right (-ordinary r) (ordinary (pointCoordinate t j)-ordinary r) + have h3 := min_le_left (ordinary r) (ordinary (pointCoordinate t j)+ordinary r) + have h4 := min_le_right (ordinary r) (ordinary (pointCoordinate t j)+ordinary r) + refine ⟨max_le (le_min (by linarith [hr.1]) (by linarith)) + (le_min (by linarith) (by linarith [hr.1])),by linarith [hr.2],⟨h1,h3⟩,?_,?_⟩ <;> linarith + +theorem exists_full_overlap_window (a : ℕ) (r u : CutRing) : + ∃ k : ℕ, ∃ p : Fin 2 → ℤ, ∀ d : Fin 2, ∀ e : Fin 5, ∀ j : Fin 2, + (p j ≤ endpointLabel (clippingOverlapLower r (tangentOffset a d (signedShortSteps u e)) j) ∧ + endpointLabel (clippingOverlapLower r (tangentOffset a d (signedShortSteps u e)) j) < p j+k) ∧ + (p j ≤ endpointLabel (clippingOverlapUpper r (tangentOffset a d (signedShortSteps u e)) j) ∧ + endpointLabel (clippingOverlapUpper r (tangentOffset a d (signedShortSteps u e)) j) < p j+k) := by + let q (i : Fin 2 × Fin 5 × Bool) (j : Fin 2) : ℤ := + endpointLabel (if i.2.2 then clippingOverlapUpper r (tangentOffset a i.1 (signedShortSteps u i.2.1)) j + else clippingOverlapLower r (tangentOffset a i.1 (signedShortSteps u i.2.1)) j) + obtain ⟨k,p,hp⟩ := finite_coordinate_windows_container (fun _ : Fin 2 × Fin 5 × Bool => 1) q + refine ⟨k,p,fun d e j => ?_⟩ + have hL := hp (d,e,false) j + have hU := hp (d,e,true) j + dsimp [q] at hL hU + omega + +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + +theorem tangentSign_step_action_closed (hlarge : 20 ≤ m+1) + (hr : 0 < ordinary r ∧ ordinary r < 1/2) + (k : ℕ) (p : Fin 2 → ℤ) (u : CutRing) (h : B.TangentChartLaws k p u) + (d : Fin 2) (e : Fin 5) (z : CutRing × CutRing) + (l v : Fin 2 → CutRing) + (hl : ∀ j, p j ≤ endpointLabel (l j) ∧ endpointLabel (l j) < p j+k) + (hv : ∀ j, p j ≤ endpointLabel (v j) ∧ endpointLabel (v j) < p j+k) + (hlv : ∀ j, ordinary (l j) ≤ ordinary (v j)) + (hlen : ∀ j, ordinary (v j)-ordinary (l j) < 1) + (hbox : ∀ j, -ordinary r ≤ ordinary (l j) ∧ ordinary (v j) ≤ ordinary r) + (hbox' : ∀ j, -ordinary r ≤ ordinary (l j)-ordinary + (pointCoordinate (tangentOffset a d (signedShortSteps u e)) j) ∧ + ordinary (v j)-ordinary + (pointCoordinate (tangentOffset a d (signedShortSteps u e)) j) ≤ ordinary r) + (f : TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm)) + (hf : B.AlignedSmallSupported f) + (hc : SmallControlled B.c f (B.fullGeometricSector (by omega) + (translatedTemplate (tangentChartTemplate a k p d (signedShortSteps u e)) z) + (h d e z) (spatialTranslate z (coordinateRectangle a l v)))) + (I : ControlAlphabet (Fin (m+1))) (s : UniversalExtension (alternatingGroup I.val)) : + ∀ x ∈ f.range, + B.tangentSign (by omega) k p u h d z true (universalMap (subtypeAlternatingHom I.val) s)*x* + (B.tangentSign (by omega) k p u h d z true (universalMap (subtypeAlternatingHom I.val) s))⁻¹ = + B.tangentSign (by omega) k p u h d (z+tangentOffset a d (signedShortSteps u e)) true + (universalMap (subtypeAlternatingHom I.val) s)*x* + (B.tangentSign (by omega) k p u h d (z+tangentOffset a d (signedShortSteps u e)) true + (universalMap (subtypeAlternatingHom I.val) s))⁻¹ := by + rw [B.tangentSign_first (by omega) k p u h d z e true, + B.tangentSign_second (by omega) k p u h d z e true] + apply B.chart_action_transfer hlarge _ (h d e z) _ _ _ + (tangentChart_first_resolved p d _ z) (tangentChart_second_resolved p d _ z) + (tangentChart_rectangle_resolved p d _ z l v hl hv) _ f hf hc I s + have he := clippedSlope_agree_on_closed_rectangle (a := a) r (slopeDirection d) hr + (0 : CutRing × CutRing) (tangentOffset a d (signedShortSteps u e)) l v hlv hlen + (by simpa [pointCoordinate] using hbox) hbox' + (by simp only [integralCutForm_zero,integralCutForm_tangentOffset]) + have he' := congrArg (spatialTranslate z) he + simpa only [spatialTranslate_inter,← spatialTranslate_add,add_zero] using he' + +end InitialCoverSystem +end FullTangentOverlap + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/ClosedSquareGerms.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/ClosedSquareGerms.lean new file mode 100644 index 0000000000000000000000000000000000000000..dafbb3a028dadbc0eabdca7118f2e08e073d181e --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/ClosedSquareGerms.lean @@ -0,0 +1,64 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.FiniteArrangementGerms + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section ClosedSquareGerms + +theorem finite_arrangement_germ_square {ι : Type*} [Finite ι] (a : ℕ) + (j : ι → Fin 4) (c : ι → ℝ) (z : ℝ × ℝ) (y : GenericSquare a) (σ : ι → Bool) + (hz₁ : z.1 ∈ Set.Icc (0:ℝ) 1) (hz₂ : z.2 ∈ Set.Icc (0:ℝ) 1) + (hactive : ∀ i, cutForm a (j i) z=c i → + if σ i then cutForm a (j i) y.val < c i else c i < cutForm a (j i) y.val) + (hinactive : ∀ i, cutForm a (j i) z≠c i → + if σ i then cutForm a (j i) z < c i else c i < cutForm a (j i) z) + (N : Set (ℝ × ℝ)) (hN : IsOpen N) (hz : z ∈ N) : + ∃ p : GenericSquare a, p.val ∈ N ∧ p.val ∈ strictLineCell a j c σ := by + classical + let J : Sum ι (Fin 2 × Bool) → Fin 4 := Sum.elim j (fun d => Fin.castLE (by omega) d.1) + let C : Sum ι (Fin 2 × Bool) → ℝ := Sum.elim c (fun d => if d.2 then 1 else 0) + let S : Sum ι (Fin 2 × Bool) → Bool := Sum.elim σ Prod.snd + have hyv := generic_coordinates_pos y + have ha : ∀ i, cutForm a (J i) z=C i → + if S i then cutForm a (J i) y.val < C i else C i < cutForm a (J i) y.val := by + intro i hi + cases i with + | inl i => exact hactive i hi + | inr d => + rcases d with ⟨d,b⟩ + fin_cases d <;> cases b + · exact hyv.1 + · exact y.property.1.2 + · exact hyv.2 + · exact y.property.2.1.2 + have hn : ∀ i, cutForm a (J i) z≠C i → + if S i then cutForm a (J i) z < C i else C i < cutForm a (J i) z := by + intro i hi + cases i with + | inl i => exact hinactive i hi + | inr d => + rcases d with ⟨d,b⟩ + fin_cases d <;> cases b <;> + simp [J,C,S,cutForm] at hi ⊢ + · exact lt_of_le_of_ne hz₁.1 (Ne.symm hi) + · exact lt_of_le_of_ne hz₁.2 hi + · exact lt_of_le_of_ne hz₂.1 (Ne.symm hi) + · exact lt_of_le_of_ne hz₂.2 hi + obtain ⟨p,hp,hcell,hgeneric⟩ := finite_arrangement_germ a J C z y.val S ha hn N hN hz + have hp₁ : p.1 ∈ Set.Ioo (0:ℝ) 1 := ⟨hcell (.inr (0,false)),hcell (.inr (0,true))⟩ + have hp₂ : p.2 ∈ Set.Ioo (0:ℝ) 1 := ⟨hcell (.inr (1,false)),hcell (.inr (1,true))⟩ + exact ⟨⟨p,⟨hp₁.1.le,hp₁.2⟩,⟨hp₂.1.le,hp₂.2⟩,hgeneric⟩,hp,fun i => hcell (.inl i)⟩ + +end ClosedSquareGerms + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/CommonTranslatedCopies.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/CommonTranslatedCopies.lean new file mode 100644 index 0000000000000000000000000000000000000000..66fcfa826c510e1352a02fb71b09c0834c797435 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/CommonTranslatedCopies.lean @@ -0,0 +1,114 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Configurations.ReserveAtom +import OAI.GroupTheory.SimpleAmenable.CentralCovers.InitialCoverSystem +import OAI.GroupTheory.SimpleAmenable.CentralCovers.PrimitiveCopies + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section CommonTranslatedCopies + +structure CommonFrame (a : ℕ) (r : CutRing) (m : ℕ) (hm : 2 ≤ m) + (I : Finset (Fin (m+1))) (u : CutRing × CutRing) where + k : Multiplicative (FreeAbelianGroup (Fin m × Fin 2)) + d : Fin (m+1) → CutRing × CutRing + projection : sourceLatticeFullMap a r m hm k = trackTranslation d + common : ∀ i ∈ I, d i = u + +noncomputable def commonFrame (a : ℕ) (r : CutRing) (m : ℕ) (hm : 2 ≤ m) + (I : Finset (Fin (m+1))) (b : Fin (m+1)) (hb : b ∉ I) (u : CutRing × CutRing) : + CommonFrame a r m hm I u := by + let h := sourceLatticeFullMap_prescribed a r m hm I b hb (fun _ => u) + exact { + k := h.choose + d := h.choose_spec.choose + projection := h.choose_spec.choose_spec.1 + common := h.choose_spec.choose_spec.2 } + +noncomputable def spatialTranslate {a : ℕ} (u : CutRing × CutRing) + (U : polygonAlgebra a) : polygonAlgebra a := + ⟨translate a (-u) ⁻¹' U.val,polygon_preimage_translate (-u) U.property⟩ + +namespace CommonFrame + +variable {a m : ℕ} {r : CutRing} {hm : 2 ≤ m} + {I : Finset (Fin (m+1))} {u : CutRing × CutRing} + (F : CommonFrame a r m hm I u) + +theorem conditional_projection (U : polygonAlgebra a) (s : alternatingGroup I) : + sourceLatticeMap a r m hm F.k * conditionalAlternatingHom U (subtypeAlternatingHom I s) * + (sourceLatticeMap a r m hm F.k)⁻¹ = + conditionalAlternatingHom (spatialTranslate u U) (subtypeAlternatingHom I s) := by + apply Subtype.ext + change sourceLatticeFullMap a r m hm F.k * conditionalHom U (subtypeAlternatingHom I s).val * + (sourceLatticeFullMap a r m hm F.k)⁻¹ = _ + rw [F.projection] + apply (conditional_translation_conjugate U (subtypeAlternatingHom I s).val F.d u ?_).symm + intro i hi + exact F.common i ((Equiv.Perm.mem_range_ofSubtype_iff.mp ⟨s.val,rfl⟩) + (Equiv.Perm.mem_support.mpr hi)) + +end CommonFrame + +namespace InitialCoverSystem + +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + +theorem commonTranslatedAlphabet_projection {I : Finset (Fin (m+1))} + {u : CutRing × CutRing} (F : CommonFrame a r m hm I u) (j : Fin 5) : + (coverMap M (alternatingGenerator a r m hm)).comp (B.translatedAlphabet I j F.k) = + (conditionalAlternatingHom (spatialTranslate u (initialTest a r j))).comp + (subtypeAlternatingHom I) := by + apply MonoidHom.ext + intro s + change coverMap M (alternatingGenerator a r m hm) + (B.t F.k * B.initialConditional j (subtypeAlternatingHom I s) * (B.t F.k)⁻¹) = _ + rw [map_mul,map_mul,map_inv] + rw [show coverMap M (alternatingGenerator a r m hm) (B.t F.k) = + sourceLatticeMap a r m hm F.k from DFunLike.congr_fun B.t_projection F.k] + rw [show coverMap M (alternatingGenerator a r m hm) + (B.initialConditional j (subtypeAlternatingHom I s)) = + conditionalAlternatingHom (initialTest a r j) (subtypeAlternatingHom I s) from + DFunLike.congr_fun (B.initialConditional_projection j) (subtypeAlternatingHom I s)] + exact F.conditional_projection _ s + +theorem commonTranslatedAlphabet_independent {I : Finset (Fin (m+1))} + {u v : CutRing × CutRing} (F : CommonFrame a r m hm I u) + (G : CommonFrame a r m hm I v) (j : Fin 5) + (huv : spatialTranslate u (initialTest a r j) = spatialTranslate v (initialTest a r j)) : + B.translatedAlphabet I j F.k = B.translatedAlphabet I j G.k := by + apply B.initialAlphabet_orbit_independent + intro s + rw [F.conditional_projection,G.conditional_projection,huv] + +noncomputable def primitiveCopy (I : Finset (Fin (m+1))) + (b : Fin (m+1)) (hb : b ∉ I) (p : Fin 5 × (CutRing × CutRing)) : + alternatingGroup I →* BoundedRelationCover M (alternatingGenerator a r m hm) := + B.translatedAlphabet I p.1 (commonFrame a r m hm I b hb p.2).k + +theorem primitiveCopy_projection (I : Finset (Fin (m+1))) + (b : Fin (m+1)) (hb : b ∉ I) (p : Fin 5 × (CutRing × CutRing)) : + (coverMap M (alternatingGenerator a r m hm)).comp (B.primitiveCopy I b hb p) = + (conditionalAlternatingHom (spatialTranslate p.2 (initialTest a r p.1))).comp + (subtypeAlternatingHom I) := + B.commonTranslatedAlphabet_projection (commonFrame a r m hm I b hb p.2) p.1 + +theorem primitiveCopy_aligned (I : Finset (Fin (m+1))) + (b : Fin (m+1)) (hb : b ∉ I) (p : Fin 5 × (CutRing × CutRing)) (s : alternatingGroup I) : + B.primitiveCopy I b hb p s ∈ sourceAlignedGroup a r m hm M B.t I := + B.translatedAlphabet_aligned I p.1 _ s + +end InitialCoverSystem +end CommonTranslatedCopies + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/CompactCommonRefinement.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/CompactCommonRefinement.lean new file mode 100644 index 0000000000000000000000000000000000000000..4b4fd02e85a0900acfbb1d4382438c6766bd0861 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/CompactCommonRefinement.lean @@ -0,0 +1,52 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.CompactFineGrid +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.RefinedEndpointDecisions + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section CompactCommonRefinement + +def closedRefinedBox (N : ℕ) (e : Fin (N+1) → CutRing) (cell : Fin 2 → Fin N) : Set (ℝ × ℝ) := + {p | ∀ j, ordinary (e (cell j).castSucc)≤realCoordinate p j ∧ + realCoordinate p j≤ordinary (e (cell j).succ)} + +theorem compact_common_refining_grid {ι κ : Type*} [Fintype ι] + (S : Finset CutRing) (size : ι → ℕ) (hs : ∀ i, 201 ≤ size i) + (q : ι → Fin 2 → ℤ) (v : ι → CutRing × CutRing) + (O : κ → Set (ℝ × ℝ)) (hO : ∀ i, IsOpen (O i)) + (hcover : Set.Icc (0:ℝ) 1 ×ˢ Set.Icc (0:ℝ) 1 ⊆ ⋃ i, O i) + (ε : κ → ℝ) (hε : ∀ i, 0<ε i) : + ∃ N : ℕ, 0 ordinary (e i)) ∧ e 0=0 ∧ e (Fin.last N)=1 ∧ + (∀ i : Fin N, ordinary (e i.succ)-ordinary (e i.castSucc)<1) ∧ + (∀ c ∈ S, cutFraction c ∈ Set.range e) ∧ + (∀ i, ∀ j : Fin 2, ∀ k : Fin (size i+1), + cutFraction (windowCut (size i) (q i j) k+pointCoordinate (v i) j) ∈ Set.range e) ∧ + (∀ cell : Fin 2 → Fin N, ∃ k, closedRefinedBox N e cell ⊆ O k ∧ + ∀ j, ordinary (e (cell j).succ)-ordinary (e (cell j).castSucc)<ε k) := by + obtain ⟨n,hn,hfine⟩ := compact_local_bounds_fine_grid O hO hcover ε hε + obtain ⟨N,hN,e,he,hzero,hlast,hmesh,hS,hcuts,href⟩ := common_translated_grid S n hn size hs q v + have hnpos : (200:ℝ) (hmesh i).trans_lt + ((div_lt_one (by linarith)).mpr hnpos),hS,hcuts,?_⟩ + intro cell + have hh (j : Fin 2) := href (cell j) + choose old hold using hh + obtain ⟨k,hδ,hk⟩ := hfine n le_rfl old + refine ⟨k,fun p hp => hk (fun j => ⟨(hold j).1.trans (hp j).1,(hp j).2.trans (hold j).2⟩),?_⟩ + intro j + exact (hmesh (cell j)).trans_lt hδ + +end CompactCommonRefinement + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/CompactFineGrid.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/CompactFineGrid.lean new file mode 100644 index 0000000000000000000000000000000000000000..04a6a922e862e2cd7431c1c18dd2359acbb14471 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/CompactFineGrid.lean @@ -0,0 +1,201 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.ConcurrentGeometry + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section CompactFineGrid + +def closedWindowBox (n : ℕ) (cell : Fin 2 → Fin n) : Set (ℝ × ℝ) := + {p | ∀ j, ordinary (windowCut n 0 (cell j).castSucc) ≤ realCoordinate p j ∧ + realCoordinate p j ≤ ordinary (windowCut n 0 (cell j).succ)} + +theorem closedWindowBox_subset (n : ℕ) (cell : Fin 2 → Fin n) : + closedWindowBox n cell ⊆ Set.Icc (0:ℝ) 1 ×ˢ Set.Icc (0:ℝ) 1 := by + intro p hp + have h (j : Fin 2) : realCoordinate p j ∈ Set.Icc (0:ℝ) 1 := by + have hl := (windowCut_bounds n 0 (cell j).castSucc).1 + have hu := (windowCut_bounds n 0 (cell j).succ).2 + simp only [Int.cast_zero,zero_mul,map_zero,zero_add] at hl hu + exact ⟨hl.trans (hp j).1,(hp j).2.trans hu⟩ + exact ⟨h 0,h 1⟩ + +theorem closedWindowBox_nonempty (n : ℕ) (cell : Fin 2 → Fin n) : + (closedWindowBox n cell).Nonempty := by + refine ⟨(ordinary (windowCut n 0 (cell 0).castSucc), + ordinary (windowCut n 0 (cell 1).castSucc)),?_⟩ + intro j + have he : realCoordinate + (ordinary (windowCut n 0 (cell 0).castSucc), + ordinary (windowCut n 0 (cell 1).castSucc)) j = + ordinary (windowCut n 0 (cell j).castSucc) := by fin_cases j <;> rfl + rw [he] + exact ⟨le_rfl,(windowCut_strictMono n 0 (Fin.castSucc_lt_succ (i := cell j))).le⟩ + +theorem windowPlanarLift_zero {a : ℕ} (p : GenericSquare a) : + windowPlanarLift (fun _ => 0) p=p.val := by + apply Prod.ext + · change p.val.1-⌊p.val.1-ordinary ((0:CutRing)*cutTau)⌋=p.val.1 + simp only [zero_mul,map_zero,sub_zero,Int.floor_eq_zero_iff.mpr p.property.1,Int.cast_zero] + · change p.val.2-⌊p.val.2-ordinary ((0:CutRing)*cutTau)⌋=p.val.2 + simp only [zero_mul,map_zero,sub_zero,Int.floor_eq_zero_iff.mpr p.property.2.1,Int.cast_zero] + +theorem windowRectangle_subset_closed {a : ℕ} (n : ℕ) (hn : 201 ≤ n) + (cell : Fin 2 → Fin n) (p : GenericSquare a) + (hp : p ∈ (windowRectangle a n (fun _ => 0) cell).val) : + p.val ∈ closedWindowBox n cell := by + intro j + have h := (windowRectangle_mem n hn (fun _ => 0) cell p).mp hp j + rw [windowPlanarLift_zero] at h + exact ⟨h.1,h.2.le⟩ + +theorem compact_open_cover_fine_grid {ι : Type*} + (O : ι → Set (ℝ × ℝ)) (hO : ∀ i, IsOpen (O i)) + (hcover : Set.Icc (0:ℝ) 1 ×ˢ Set.Icc (0:ℝ) 1 ⊆ ⋃ i, O i) + (ε : ℝ) (hε : 0 < ε) : + ∃ N : ℕ, 201 ≤ N ∧ ∀ n : ℕ, N ≤ n → + 200/(n:ℝ) < ε ∧ ∀ cell : Fin 2 → Fin n, ∃ i, + closedWindowBox n cell ⊆ O i := by + obtain ⟨δ,hδ,hlocal⟩ := lebesgue_number_lemma_of_metric + (isCompact_Icc.prod isCompact_Icc) hO hcover + have hmin : 0 < min δ ε := lt_min hδ hε + obtain ⟨N,hN⟩ := exists_nat_gt (200/min δ ε) + refine ⟨max 201 N,le_max_left _ _,fun n hn => ?_⟩ + have hnN : N ≤ n := (le_max_right _ _).trans hn + have hnpos : (0:ℝ) < n := by exact_mod_cast (show 0 < n by omega) + have hmesh : 200/(n:ℝ) < min δ ε := by + rw [div_lt_iff₀ hnpos] + have hNN : (N:ℝ) ≤ n := by exact_mod_cast hnN + have hlt := (div_lt_iff₀ hmin).mp hN + nlinarith + refine ⟨hmesh.trans_le (min_le_right _ _),fun cell => ?_⟩ + obtain ⟨x,hx⟩ := closedWindowBox_nonempty n cell + obtain ⟨i,hi⟩ := hlocal x (closedWindowBox_subset n cell hx) + refine ⟨i,fun p hp => hi ?_⟩ + apply Metric.mem_ball.mpr + exact (closedWindow_diameter n (fun _ => 0) cell p x hp hx).trans_lt + (hmesh.trans_le (min_le_left _ _)) + +theorem compact_local_bounds_fine_grid {ι : Type*} + (O : ι → Set (ℝ × ℝ)) (hO : ∀ i, IsOpen (O i)) + (hcover : Set.Icc (0:ℝ) 1 ×ˢ Set.Icc (0:ℝ) 1 ⊆ ⋃ i, O i) + (ε : ι → ℝ) (hε : ∀ i, 0 < ε i) : + ∃ N : ℕ, 201 ≤ N ∧ ∀ n : ℕ, N ≤ n → + ∀ cell : Fin 2 → Fin n, ∃ i, + 200/(n:ℝ) < ε i ∧ closedWindowBox n cell ⊆ O i := by + classical + obtain ⟨s,hs⟩ := (isCompact_Icc.prod isCompact_Icc).elim_finite_subcover O hO hcover + have hspos : s.Nonempty := by + have hh := hs (show ((0,0) : ℝ × ℝ) ∈ Set.Icc (0:ℝ) 1 ×ˢ Set.Icc (0:ℝ) 1 from + ⟨⟨le_rfl,by norm_num⟩,⟨le_rfl,by norm_num⟩⟩) + obtain ⟨i,hi⟩ := Set.mem_iUnion.mp hh + obtain ⟨hi,_⟩ := Set.mem_iUnion.mp hi + exact ⟨i,hi⟩ + obtain ⟨i₀,_,hi₀⟩ := s.exists_min_image ε hspos + have hcov : Set.Icc (0:ℝ) 1 ×ˢ Set.Icc (0:ℝ) 1 ⊆ ⋃ i : s, O i.val := by + intro x hx + obtain ⟨i,hi⟩ := Set.mem_iUnion.mp (hs hx) + obtain ⟨hi,hx⟩ := Set.mem_iUnion.mp hi + exact Set.mem_iUnion.mpr ⟨⟨i,hi⟩,hx⟩ + obtain ⟨N,hN,hfine⟩ := compact_open_cover_fine_grid (fun i : s => O i.val) + (fun i => hO i.val) hcov (ε i₀) (hε i₀) + refine ⟨N,hN,fun n hn cell => ?_⟩ + obtain ⟨hmesh,hcells⟩ := hfine n hn + obtain ⟨i,hi⟩ := hcells cell + exact ⟨i.val,hmesh.trans_le (hi₀ i.val i.property),hi⟩ + +end CompactFineGrid + +section SimultaneousConcurrentTemplates + +theorem vertex_type_zero (D : ℕ) (hD : 0 < D) : + ∃ t : VertexType D, vertexRepresentative D t=0 := by + let f : Fin D := ⟨0,hD⟩ + refine ⟨((f,f),(f,f)),?_⟩ + simp [vertexRepresentative,finiteCutResidue,ordinary_apply,f] + +theorem ordinary_pair_near (z : ℝ × ℝ) (ε : ℝ) (hε : 0 < ε) : + ∃ u : CutRing × CutRing, dist (ordinary u.1,ordinary u.2) z < ε := by + obtain ⟨u,hu,hu'⟩ := exists_cut_between (x := z.1-ε) (y := z.1+ε) (by linarith) + obtain ⟨v,hv,hv'⟩ := exists_cut_between (x := z.2-ε) (y := z.2+ε) (by linarith) + refine ⟨(u,v),?_⟩ + rw [Prod.dist_eq,Real.dist_eq,Real.dist_eq,max_lt_iff] + exact ⟨abs_lt.mpr ⟨by linarith,by linarith⟩,abs_lt.mpr ⟨by linarith,by linarith⟩⟩ + +namespace ConcurrentGeometry +variable {a : ℕ} {r : CutRing} (C : ConcurrentGeometry a r) + +theorem simultaneous_active_template {ι : Type*} (ha : 0 < a) + (j : ι → Fin 4) (c : ι → CutRing) (z : ℝ × ℝ) : + ∃ t : VertexType (commonVertexDenominator a), ∃ u : CutRing × CutRing, + dist (vertexRepresentative (commonVertexDenominator a) t+(ordinary u.1,ordinary u.2)) z < C.epsilon/4 ∧ + ∀ i, cutForm a (j i) z=ordinary (c i) → + integralCutForm a (j i) (u+C.anchors t (j i))=c i ∧ + dist (ordinary (u+C.anchors t (j i)).1,ordinary (u+C.anchors t (j i)).2) + (vertexRepresentative (commonVertexDenominator a) t+(ordinary u.1,ordinary u.2)) < C.epsilon := by + classical + have hε : 0 < C.epsilon/4 := by linarith [C.positive] + by_cases htwo : ∃ i k, cutForm a (j i) z=ordinary (c i) ∧ + cutForm a (j k) z=ordinary (c k) ∧ j i≠j k + · obtain ⟨i,k,hi,hk,hik⟩ := htwo + obtain ⟨t,u,v,hz⟩ := all_intersections_finite_templates ha (j i) (j k) hik (c i) (c k) z hi hk + refine ⟨t,(u,v),by simpa only [← hz,dist_self] using hε,fun e he => ?_⟩ + have hh := translated_vertex_anchors a (commonVertexDenominator a) C.anchors C.anchors_spec + t (u,v) (j e) (c e) z hz he + simpa only [hz] using hh + obtain ⟨t,ht⟩ := vertex_type_zero (commonVertexDenominator a) (commonVertexDenominator_pos ha) + by_cases hone : ∃ i, cutForm a (j i) z=ordinary (c i) + · obtain ⟨i,hi⟩ := hone + obtain ⟨u,hu,hclose⟩ := allowable_line_anchor a (j i) (c i) z hi hε + have hcenter : (ordinary u.1,ordinary u.2)= + vertexRepresentative (commonVertexDenominator a) t+(ordinary u.1,ordinary u.2) := by simp only [ht,zero_add] + refine ⟨t,u,by simpa only [ht,zero_add] using hclose,fun k hk => ?_⟩ + have hdir : j i=j k := by + by_contra hn + exact htwo ⟨i,k,hi,hk,hn⟩ + have hc : c i=c k := ordinary_injective (hi.symm.trans (hdir ▸ hk)) + have hline : cutForm a (j k) (ordinary u.1,ordinary u.2)=ordinary (c k) := by + rw [cutForm_ordinary,← hdir,hu,hc] + have hh := translated_vertex_anchors a (commonVertexDenominator a) C.anchors C.anchors_spec + t u (j k) (c k) (ordinary u.1,ordinary u.2) hcenter hline + simpa only [ht,zero_add] using hh + · obtain ⟨u,hu⟩ := ordinary_pair_near z (C.epsilon/4) hε + refine ⟨t,u,by simpa only [ht,zero_add] using hu,fun i hi => ?_⟩ + exact (hone ⟨i,hi⟩).elim + +theorem simultaneous_active_neighborhood {ι : Type*} (ha : 0 < a) + (j : ι → Fin 4) (c : ι → CutRing) (z : ℝ × ℝ) : + ∃ t : VertexType (commonVertexDenominator a), ∃ u : CutRing × CutRing, + (∀ p : ℝ × ℝ, dist p z < C.epsilon/2 → ∀ k, + ordinary ((C.margins t).lower k+pointCoordinate u k) ⟨(hactive i hi).1,?_⟩⟩ + · intro p hp k + apply (C.margins t).translated_inner u p ?_ k + have htri := dist_triangle p z + (vertexRepresentative (commonVertexDenominator a) t+(ordinary u.1,ordinary u.2)) + rw [dist_comm z] at htri + linarith [C.positive] + · intro p hp k + exact (C.margins t).translated_outer u (u+C.anchors t (j i)) p (hactive i hi).2 hp k + +end ConcurrentGeometry +end SimultaneousConcurrentTemplates + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/ConcurrentAnchors.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/ConcurrentAnchors.lean new file mode 100644 index 0000000000000000000000000000000000000000..93501f012c50763472fa2936284c93e9d0824510 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/ConcurrentAnchors.lean @@ -0,0 +1,166 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.TangentChartTemplates +import OAI.GroupTheory.SimpleAmenable.Arithmetic.ConcurrentDenominators + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section ConcurrentAnchors + +theorem allowable_line_anchor (a : ℕ) (j : Fin 4) (c : CutRing) + (z : ℝ × ℝ) (hz : cutForm a j z=ordinary c) {ε : ℝ} (hε : 0<ε) : + ∃ u : CutRing × CutRing, integralCutForm a j u=c ∧ + dist (ordinary u.1,ordinary u.2) z<ε := by + by_cases hj : j=2 ∨ j=3 + · exact slope_line_anchor a j hj c z hz hε + fin_cases j + · obtain ⟨y,hy,hy'⟩ := exists_cut_between (x := z.2-ε) (y := z.2+ε) (by linarith) + refine ⟨(c,y),by simp [integralCutForm],?_⟩ + have hx : z.1=ordinary c := hz + rw [Prod.dist_eq,Real.dist_eq,Real.dist_eq,← hx,sub_self,abs_zero,max_eq_right (abs_nonneg _)] + exact abs_lt.mpr ⟨by linarith,by linarith⟩ + · obtain ⟨x,hx,hx'⟩ := exists_cut_between (x := z.1-ε) (y := z.1+ε) (by linarith) + refine ⟨(x,c),by simp [integralCutForm],?_⟩ + have hy : z.2=ordinary c := hz + rw [Prod.dist_eq,Real.dist_eq,Real.dist_eq,← hy,sub_self,abs_zero,max_eq_left (abs_nonneg _)] + exact abs_lt.mpr ⟨by linarith,by linarith⟩ + · exact False.elim (hj (Or.inl rfl)) + · exact False.elim (hj (Or.inr rfl)) + +abbrev VertexType (D : ℕ) := (Fin D × Fin D) × (Fin D × Fin D) + +def AllowableVertexLine (a : ℕ) (z : ℝ × ℝ) (j : Fin 4) : Prop := + ∃ c : CutRing, cutForm a j z=ordinary c + +theorem finite_vertex_anchors (a D : ℕ) {ε : ℝ} (hε : 0<ε) : + ∃ U : VertexType D → Fin 4 → CutRing × CutRing, + ∀ t j, AllowableVertexLine a (vertexRepresentative D t) j → + cutForm a j (vertexRepresentative D t)=ordinary (integralCutForm a j (U t j)) ∧ + dist (ordinary (U t j).1,ordinary (U t j).2) (vertexRepresentative D t)<ε := by + classical + have h (t : VertexType D) (j : Fin 4) : ∃ u : CutRing × CutRing, + AllowableVertexLine a (vertexRepresentative D t) j → + cutForm a j (vertexRepresentative D t)=ordinary (integralCutForm a j u) ∧ + dist (ordinary u.1,ordinary u.2) (vertexRepresentative D t)<ε := by + by_cases h : AllowableVertexLine a (vertexRepresentative D t) j + · obtain ⟨c,hc⟩ := h + obtain ⟨u,hu,hd⟩ := allowable_line_anchor a j c _ hc hε + exact ⟨u,fun _ => ⟨by rw [hu]; exact hc,hd⟩⟩ + · exact ⟨0,fun hh => (h hh).elim⟩ + choose U hU using h + exact ⟨U,hU⟩ + +theorem representative_line_allowable (a D : ℕ) (t : VertexType D) + (u : CutRing × CutRing) (j : Fin 4) (c : CutRing) (z : ℝ × ℝ) + (hz : z=vertexRepresentative D t+(ordinary u.1,ordinary u.2)) + (hc : cutForm a j z=ordinary c) : AllowableVertexLine a (vertexRepresentative D t) j := by + refine ⟨c-integralCutForm a j u,?_⟩ + rw [hz,cutForm_add,cutForm_ordinary] at hc + rw [map_sub] + linarith + +theorem translated_vertex_anchors (a D : ℕ) {ε : ℝ} + (U : VertexType D → Fin 4 → CutRing × CutRing) + (hU : ∀ t j, AllowableVertexLine a (vertexRepresentative D t) j → + cutForm a j (vertexRepresentative D t)=ordinary (integralCutForm a j (U t j)) ∧ + dist (ordinary (U t j).1,ordinary (U t j).2) (vertexRepresentative D t)<ε) + (t : VertexType D) (u : CutRing × CutRing) (j : Fin 4) (c : CutRing) (z : ℝ × ℝ) + (hz : z=vertexRepresentative D t+(ordinary u.1,ordinary u.2)) + (hc : cutForm a j z=ordinary c) : + integralCutForm a j (u+U t j)=c ∧ + dist (ordinary (u+U t j).1,ordinary (u+U t j).2) z<ε := by + obtain ⟨he,hd⟩ := hU t j (representative_line_allowable a D t u j c z hz hc) + constructor + · apply ordinary_injective + rw [← cutForm_ordinary] + have hpair : (ordinary (u+U t j).1,ordinary (u+U t j).2)= + (ordinary (U t j).1,ordinary (U t j).2)+(ordinary u.1,ordinary u.2) := by + ext <;> simp [add_comm] + rw [hpair,cutForm_add,cutForm_ordinary,← he,← cutForm_add,← hz,hc] + · have hpair : (ordinary (u+U t j).1,ordinary (u+U t j).2)= + (ordinary (U t j).1,ordinary (U t j).2)+(ordinary u.1,ordinary u.2) := by + ext <;> simp [add_comm] + rwa [hpair,hz,dist_add_right] + +theorem concurrent_chart_tables_eventually {a m D : ℕ} {r : CutRing} {hm : 2 ≤ m} + {ι : Type*} [Finite ι] + (hr : 0 < ordinary r ∧ ordinary r < 1/2) (hm' : 15 ≤ m+1) + (U : VertexType D → Fin 4 → CutRing × CutRing) + (P : VertexType D → ι → Fin 5 × (CutRing × CutRing)) : + ∃ L : ℕ, ∀ M : ℕ, L ≤ M → ∀ B : InitialCoverSystem a r m hm M, + ∀ t u I b hb, B.PrimitiveFamilyLaw I b hb + (translatedTemplate (Sum.elim + (fun j : Fin 4 => (⟨j.val+1,by omega⟩,U t j)) (P t)) u) := by + exact fixedChartTables_eventually hr hm' + (fun t => Sum.elim (fun j : Fin 4 => (⟨j.val+1,by omega⟩,U t j)) (P t)) + +end ConcurrentAnchors + +section LineIntersectionBounds + +theorem real_two_lines_intersect (A B C E c d : ℝ) (h : A*E-C*B ≠ 0) : + ∃ z : ℝ × ℝ, A*z.1+B*z.2=c ∧ C*z.1+E*z.2=d := by + refine ⟨((c*E-d*B)/(A*E-C*B),(A*d-C*c)/(A*E-C*B)),?_,?_⟩ <;> + dsimp only <;> rw [← mul_div_assoc, ← mul_div_assoc, ← add_div] <;> + apply (div_eq_iff h).mpr <;> ring + +theorem real_two_lines_distance_bound (A B C E c d : ℝ) (h : A*E-C*B ≠ 0) + (z p : ℝ × ℝ) (hz : A*z.1+B*z.2=c) (hz' : C*z.1+E*z.2=d) + (δ : ℝ) (hδ : 0≤δ) + (hp : |c-(A*p.1+B*p.2)| ≤ δ) (hp' : |d-(C*p.1+E*p.2)| ≤ δ) : + dist z p ≤ ((|A| + |B| + |C| + |E|)/|A*E-C*B|)*δ := by + have hd : 0 < |A*E-C*B| := abs_pos.mpr h + have hx : (A*E-C*B)*(z.1-p.1)=E*(c-(A*p.1+B*p.2))-B*(d-(C*p.1+E*p.2)) := by + linear_combination E*hz-B*hz' + have hy : (A*E-C*B)*(z.2-p.2)=A*(d-(C*p.1+E*p.2))-C*(c-(A*p.1+B*p.2)) := by + linear_combination A*hz'-C*hz + have hx' : |A*E-C*B| * |z.1-p.1| ≤ (|E| + |B|)*δ := by + rw [← abs_mul,hx] + calc + _ ≤ |E*(c-(A*p.1+B*p.2))| + |B*(d-(C*p.1+E*p.2))| := abs_sub _ _ + _ ≤ |E| * δ+|B| * δ := by + rw [abs_mul,abs_mul] + exact add_le_add (mul_le_mul_of_nonneg_left hp (abs_nonneg _)) + (mul_le_mul_of_nonneg_left hp' (abs_nonneg _)) + _ = _ := by ring + have hy' : |A*E-C*B| * |z.2-p.2| ≤ (|A| + |C|)*δ := by + rw [← abs_mul,hy] + calc + _ ≤ |A*(d-(C*p.1+E*p.2))| + |C*(c-(A*p.1+B*p.2))| := abs_sub _ _ + _ ≤ |A| * δ+|C| * δ := by + rw [abs_mul,abs_mul] + exact add_le_add (mul_le_mul_of_nonneg_left hp' (abs_nonneg _)) + (mul_le_mul_of_nonneg_left hp (abs_nonneg _)) + _ = _ := by ring + rw [Prod.dist_eq,Real.dist_eq,Real.dist_eq,max_le_iff] + rw [div_mul_eq_mul_div] + constructor + · apply (le_div_iff₀ hd).mpr + nlinarith [abs_nonneg A,abs_nonneg C] + · apply (le_div_iff₀ hd).mpr + nlinarith [abs_nonneg B,abs_nonneg E] + +theorem real_lineDet_ne_zero {a : ℕ} (ha : 0 + ⟨((windowRectangle_mem C.mesh C.mesh_large q cell p).mp hp k).1, + ((windowRectangle_mem C.mesh C.mesh_large q cell p).mp hp k).2.le⟩) + have hh := C.axis_on_margin j u (u+C.anchors t (axisDirection j)) t hnear p + (windowPlanarLift q p) (windowPlanarLift_spec q p) (fun k => ⟨(hz k).1.le,(hz k).2.le⟩) + rw [integralCutForm_axis] at haxis + rw [haxis] at hh + cases positive <;> simp only [Bool.false_eq_true,↓reduceIte] at hc ⊢ + · change (_ ∧ _) ↔ (¬ p ∈ (spatialTranslate (u+C.anchors t (axisDirection j)) (coordinatePrimitive a j)).val ∧ _) + exact and_congr ((hc p hp).trans ((not_le).symm.trans (not_congr hh).symm)) Iff.rfl + · change (_ ∧ _) ↔ (p ∈ (spatialTranslate (u+C.anchors t (axisDirection j)) (coordinatePrimitive a j)).val ∧ _) + exact and_congr ((hc p hp).trans hh.symm) Iff.rfl + · change (_ ∧ _) ↔ (_ ∧ _) + simp only [hp,and_false] + +end ConcurrentGeometry +end ConcurrentCellDecisions + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/ConcurrentGeometry.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/ConcurrentGeometry.lean new file mode 100644 index 0000000000000000000000000000000000000000..20d2a6878718a43975ed146dcc2ddc93e5ed8a0b --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/ConcurrentGeometry.lean @@ -0,0 +1,260 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.RectangularAtlas +import OAI.GroupTheory.SimpleAmenable.Homology.UniformConcurrentMesh +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.VertexMargins + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section ConcurrentGeometry + +structure ConcurrentGeometryData (a D : ℕ) (r : CutRing) where + epsilon : ℝ + positive : 0 1) p + refine ⟨⟨ε,hε,hr',hg,hg',U,hU,V,n,hn,(le_max_right _ _).trans (le_max_right _ _),hmesh,k,q,?_⟩⟩ + intro t j + have hL := hq (t,false) j + have hV := hq (t,true) j + simp only [p, Bool.false_eq_true, ↓reduceIte] at hL + simp only [p, ↓reduceIte] at hV + constructor <;> constructor <;> omega + +namespace ConcurrentGeometry +variable {a : ℕ} {r : CutRing} (C : ConcurrentGeometry a r) + +theorem mesh_small : 200/(C.mesh:ℝ) (InitialCoverSystem.primitiveTests (a := a) (r := r) + (coordinateWindowPrimitives C.window C.start) s).val) + (coordinateRectangle a (C.margins t).lower (C.margins t).upper).val := by + intro x y hxy + exact and_congr + (coordinateLabelWindow_resolved C.window C.start 0 _ _ (C.labels t 0).1 (C.labels t 0).2 x y hxy) + (coordinateLabelWindow_resolved C.window C.start 1 _ _ (C.labels t 1).1 (C.labels t 1).2 x y hxy) + +end ConcurrentGeometry + +noncomputable def initialPatchPrimitives (r : CutRing) (n : ℕ) : + Sum (Fin 5) (Fin 2 × Fin (n-1)) → Fin 5 × (CutRing × CutRing) := + Sum.elim (fun j => (j,0)) (coordinateWindowPrimitives n (symmetricWindowStart r)) + +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + +structure PatchAtlas where + rectangles : B.RectangularAtlas + geometry : ConcurrentGeometry a r + initial : ∀ u I b hb, B.PrimitiveFamilyLaw I b hb + (translatedTemplate (initialPatchPrimitives r geometry.mesh) u) + concurrent : ∀ t u I b hb, B.PrimitiveFamilyLaw I b hb + (translatedTemplate (Sum.elim + (fun j : Fin 4 => (⟨j.val+1,by omega⟩,geometry.anchors t j)) + (coordinateWindowPrimitives geometry.window geometry.start)) u) + +end InitialCoverSystem + +theorem patchAtlas_eventually {a m : ℕ} {r : CutRing} {hm : 2 ≤ m} + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] (hlarge : 20 ≤ m+1) + (hr : 0 initialPatchPrimitives r C.mesh) + obtain ⟨L₃,hL₃⟩ := concurrent_chart_tables_eventually (hm := hm) hr (by omega) + C.anchors (fun _ => coordinateWindowPrimitives C.window C.start) + refine ⟨L₁+L₂+L₃,fun M hM B => ?_⟩ + obtain ⟨A⟩ := hL₁ M (by omega) B + exact ⟨⟨A,C,(fun u I b hb => hL₂ M (by omega) B () u I b hb),hL₃ M (by omega) B⟩⟩ + +end ConcurrentGeometry + +section ClosedCellTemplates + +theorem closedWindow_diameter (n : ℕ) (q : Fin 2 → ℤ) (cell : Fin 2 → Fin n) + (x y : ℝ × ℝ) + (hx : ∀ d, ordinary (windowCut n (q d) (cell d).castSucc) ≤ realCoordinate x d ∧ + realCoordinate x d ≤ ordinary (windowCut n (q d) (cell d).succ)) + (hy : ∀ d, ordinary (windowCut n (q d) (cell d).castSucc) ≤ realCoordinate y d ∧ + realCoordinate y d ≤ ordinary (windowCut n (q d) (cell d).succ)) : + dist x y ≤ 200/(n:ℝ) := by + have h (d : Fin 2) : |realCoordinate x d-realCoordinate y d| ≤ 200/(n:ℝ) := by + have hh := windowCut_mesh n (q d) (cell d) + have hx' := hx d + have hy' := hy d + apply abs_le.mpr + constructor <;> linarith + rw [Prod.dist_eq,Real.dist_eq,Real.dist_eq,max_le_iff] + exact ⟨h 0,h 1⟩ + +theorem windowRectangle_closed_intersection_near {a : ℕ} (ha : 0 ?_⟩ + have hc (t : GenericSquare a) (ht : t ∈ (windowRectangle a n q cell).val) : + dist p (windowPlanarLift q t) ≤ 200/(n:ℝ) := by + apply closedWindow_diameter n q cell p (windowPlanarLift q t) hp + intro k + exact ⟨((windowRectangle_mem n hn q cell t).mp ht k).1, + ((windowRectangle_mem n hn q cell t).mp ht k).2.le⟩ + have h₁ := crossing_level_bound (ordinary (lineNormal a i).1) (ordinary (lineNormal a i).2) + (ordinary c) (200/(n:ℝ)) p (windowPlanarLift q x) (windowPlanarLift q y) + (by simpa only [cutForm_normal] using hcx) (by simpa only [cutForm_normal] using hcy) + (hc x hx) (hc y hy) + have h₂ := crossing_level_bound (ordinary (lineNormal a j).1) (ordinary (lineNormal a j).2) + (ordinary d) (200/(n:ℝ)) p (windowPlanarLift q u) (windowPlanarLift q v) + (by simpa only [cutForm_normal] using hdu) (by simpa only [cutForm_normal] using hdv) + (hc u hu) (hc v hv) + have hδ : 0 ≤ 200/(n:ℝ) := by positivity + have hm₁ := mul_le_mul_of_nonneg_right (le_max_left + (|ordinary (lineNormal a i).1|+|ordinary (lineNormal a i).2|) + (|ordinary (lineNormal a j).1|+|ordinary (lineNormal a j).2|)) hδ + have hm₂ := mul_le_mul_of_nonneg_right (le_max_right + (|ordinary (lineNormal a i).1|+|ordinary (lineNormal a i).2|) + (|ordinary (lineNormal a j).1|+|ordinary (lineNormal a j).2|)) hδ + have hh := real_two_lines_distance_bound _ _ _ _ (ordinary c) (ordinary d) + (real_lineDet_ne_zero ha i j hij) z p (by simpa only [cutForm_normal] using hz) + (by simpa only [cutForm_normal] using hz') _ (by positivity) (h₁.trans hm₁) (h₂.trans hm₂) + have hh' : dist z p ≤ lineIntersectionCoefficient a i j*(200/(n:ℝ)) := by + simpa only [lineIntersectionCoefficient,lineDet,map_sub,map_mul,mul_assoc] using hh + exact hh'.trans (mul_le_mul_of_nonneg_right (lineIntersectionCoefficient_le a i j) hδ) + +namespace ConcurrentGeometry +variable {a : ℕ} {r : CutRing} (C : ConcurrentGeometry a r) + +theorem crossing_cell_template (ha : 0 cutPolygon a (j i) (c i)) q= + polygonAssignment (fun i => C.localDecision t u z (j i) (c i)) p := by + classical + have hpM : p ∈ (C.marginPolygon t u).val := hp.1.1 + have hpG (k : Fin 2) : p ∈ (C.inwardGate t u z k).val := by + fin_cases k + · exact hp.1.2 + · exact hp.2 + obtain ⟨y,hy,ha,hcell⟩ := C.marginPolygon_lift hr.2 t u p hpM + have hzero : ∀ k, realCoordinate z k=0 → 0 ⟨(hcell k).1.le,(hcell k).2.le⟩)).mp h + rw [integralCutForm_axis,hboundary k (Or.inl hk),hk] at hd + have haxis : cutForm a (axisDirection k) y=realCoordinate y k := by fin_cases k <;> rfl + rw [haxis] at hd + apply lt_of_le_of_ne hd + intro he + have hn := ha (axisDirection k) 0 + simp only [map_zero,haxis] at hn + exact hn he.symm + have hone : ∀ k, realCoordinate z k=1 → realCoordinate y k<1 := by + intro k hk + have h := hpG k + have hn : realCoordinate z k≠0 := by rw [hk]; norm_num + simp only [inwardGate,ite_eq_right hn,ite_eq_left hk] at h + have hd := (not_congr (C.positiveDecision_planar hr t u (axisDirection k) (hnearB k (Or.inr hk)) p y hy + (fun k => ⟨(hcell k).1.le,(hcell k).2.le⟩))).mp h + rw [integralCutForm_axis,hboundary k (Or.inr hk),hk] at hd + have haxis : cutForm a (axisDirection k) y=realCoordinate y k := by fin_cases k <;> rfl + rw [haxis] at hd + exact lt_of_not_ge hd + let σ := polygonAssignment (fun i => C.localDecision t u z (j i) (c i)) p + have hactive : ∀ i, cutForm a (j i) z=ordinary (c i) → + if σ i then cutForm a (j i) y ⟨(hcell k).1.le,(hcell k).2.le⟩) + rw [hline i hi] at hd + have hσ : σ i=decide (¬ordinary (c i)≤cutForm a (j i) y) := by + apply decide_eq_decide.mpr + change (p ∈ (C.localDecision t u z (j i) (c i)).val) ↔ _ + simp only [localDecision,ite_eq_left hi] + exact not_congr hd + rw [hσ] + split_ifs with h + · exact lt_of_not_ge (of_decide_eq_true h) + · have hh := of_decide_eq_false (Bool.eq_false_iff.mpr h) + exact lt_of_le_of_ne (not_not.mp hh) (ha (j i) (c i)).symm + have hinactive : ∀ i, cutForm a (j i) z≠ordinary (c i) → + if σ i then cutForm a (j i) z ordinary (c i)) + z y σ hz₁ hz₂ hzero hone hactive hinactive N hN hz + refine ⟨q,hq,?_⟩ + funext i + change decide (cutForm a (j i) q.val cutPolygon a (j i) (c i)) q= + polygonAssignment (fun i => C.localDecision t u z (j i) (c i)) p := by + classical + let J : Sum ι (Fin 2 × Bool) → Fin 4 := Sum.elim j (fun d => axisDirection d.1) + let K : Sum ι (Fin 2 × Bool) → CutRing := Sum.elim c (fun d => if d.2 then 1 else 0) + obtain ⟨t,u,hcell,hactive⟩ := C.simultaneous_active_neighborhood ha J K z + have hb (k : Fin 2) (hk : realCoordinate z k=0 ∨ realCoordinate z k=1) : + ∃ b : Bool, cutForm a (J (.inr (k,b))) z=ordinary (K (.inr (k,b))) := by + have haxis : cutForm a (axisDirection k) z=realCoordinate z k := by fin_cases k <;> rfl + rcases hk with hk | hk + · exact ⟨false,by simpa only [J,K,Sum.elim_inr,Bool.false_eq_true,↓reduceIte,map_zero,haxis] using hk⟩ + · exact ⟨true,by simpa only [J,K,Sum.elim_inr,↓reduceIte,map_one,haxis] using hk⟩ + refine ⟨t,u,hcell,fun p hp N hN hz => + C.localDecision_assignment_realized hr t u j c z hz₁ hz₂ + (fun i hi => (hactive (.inl i) hi).1) ?_ + (fun i hi => (hactive (.inl i) hi).2) ?_ p hp N hN hz⟩ + · intro k hk + obtain ⟨b,hb⟩ := hb k hk + have he := congrArg ordinary (hactive (.inr (k,b)) hb).1 + have haxis : cutForm a (axisDirection k) z=realCoordinate z k := by fin_cases k <;> rfl + change ordinary (integralCutForm a (axisDirection k) (u+C.anchors t (axisDirection k)))=_ at he + rw [integralCutForm_axis] at he + exact he.trans (by simpa only [J,Sum.elim_inr,haxis] using hb.symm) + · intro k hk + obtain ⟨b,hb⟩ := hb k hk + exact (hactive (.inr (k,b)) hb).2 + +end ConcurrentGeometry +end ConcurrentInwardModel + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/ConjugationTransport.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/ConjugationTransport.lean new file mode 100644 index 0000000000000000000000000000000000000000..8401b89125ed574f9e6571ab1767ee5c4abc252e --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/ConjugationTransport.lean @@ -0,0 +1,82 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.AlphabetAlignedGeneration + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section ConjugationTransport + +variable {J M H T : Type*} [Group M] [Group H] [MulAction M T] + +theorem word_conjugates_differences (p : J → M) (f : J → H) (Y : T → H) + (R : T → T → Prop) + (hR : ∀ (g : M) t u, R t u → R (g • t) (g • u)) + (hgen : ∀ j t u, R t u → + f j * (Y t)⁻¹ * Y u * (f j)⁻¹ = + (Y (p j • t))⁻¹ * Y (p j • u)) + (w : FreeGroup J) : ∀ t u, R t u → + FreeGroup.lift f w * (Y t)⁻¹ * Y u * (FreeGroup.lift f w)⁻¹ = + (Y (FreeGroup.lift p w • t))⁻¹ * Y (FreeGroup.lift p w • u) := by + induction w using FreeGroup.induction_on with + | one => + intro t u _ + simp + | of j => + simpa only [FreeGroup.lift_apply_of] using hgen j + | inv_of j ih => + intro t u htu + have h := ih ((p j)⁻¹ • t) ((p j)⁻¹ • u) (hR _ _ _ htu) + simp only [FreeGroup.lift_apply_of, smul_inv_smul] at h + simp only [map_inv, FreeGroup.lift_apply_of] + calc + (f j)⁻¹ * (Y t)⁻¹ * Y u * ((f j)⁻¹)⁻¹ = + (f j)⁻¹ * (f j * (Y ((p j)⁻¹ • t))⁻¹ * + Y ((p j)⁻¹ • u) * (f j)⁻¹) * f j := by rw [h]; group + _ = _ := by group + | mul x y ihx ihy => + intro t u htu + simp only [map_mul, mul_smul] + calc + (FreeGroup.lift f x * FreeGroup.lift f y) * (Y t)⁻¹ * Y u * + (FreeGroup.lift f x * FreeGroup.lift f y)⁻¹ = + FreeGroup.lift f x * + (FreeGroup.lift f y * (Y t)⁻¹ * Y u * (FreeGroup.lift f y)⁻¹) * + (FreeGroup.lift f x)⁻¹ := by group + _ = FreeGroup.lift f x * + ((Y (FreeGroup.lift p y • t))⁻¹ * Y (FreeGroup.lift p y • u)) * + (FreeGroup.lift f x)⁻¹ := by rw [ihy t u htu] + _ = _ := by + simpa only [mul_assoc] using + ihx _ _ (hR (FreeGroup.lift p y) t u htu) + +theorem centralLaw_of_difference_conjugations + (p : J → M) (f : J → H) (Y : T → H) (R : T → T → Prop) + (hR : ∀ (g : M) t u, R t u → R (g • t) (g • u)) + (hgen : ∀ j t u, R t u → + f j * (Y t)⁻¹ * Y u * (f j)⁻¹ = + (Y (p j • t))⁻¹ * Y (p j • u)) + (hgenerate : Subgroup.closure {h : H | ∃ t u, R t u ∧ h = (Y t)⁻¹ * Y u} = ⊤) : + HasCentralLaw (FreeGroup.lift p) (FreeGroup.lift f) := by + rw [hasCentralLaw_iff] + intro w hw + rw [← Subgroup.centralizer_univ, ← Subgroup.coe_top, ← hgenerate, + Subgroup.centralizer_closure] + apply Subgroup.mem_centralizer_iff.mpr + rintro z ⟨t,u,htu,rfl⟩ + have h := word_conjugates_differences p f Y R hR hgen w t u htu + rw [hw, one_smul, one_smul] at h + have h' := congrArg (fun x => x * FreeGroup.lift f w) h + simpa only [mul_assoc, inv_mul_cancel, mul_one] using h'.symm + +end ConjugationTransport + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/ControlledPatching.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/ControlledPatching.lean new file mode 100644 index 0000000000000000000000000000000000000000..a593a3fade4e9d69db1c4404b741d5e5b389da81 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/ControlledPatching.lean @@ -0,0 +1,62 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.SmallControlTransfer +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.InvariantPatching + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section ControlledPatching +variable {α H ι : Type*} [Fintype α] [DecidableEq α] [Group H] + [Group.IsPerfect (alternatingGroup α)] + +theorem controlled_cell_normalizes (L : Finset α → Subgroup H) + (c : alternatingGroup α →* H) + (hc : ∀ σ I, ∀ x ∈ L I, c σ*x*(c σ)⁻¹ ∈ L (I.map σ.val.toEmbedding)) + (hd : ∀ I J, Disjoint I J → ∀ x ∈ L I, ∀ y ∈ L J, Commute x y) + (hα : 20 ≤ Fintype.card α) + (F p v : ι → TrackStar α →* H) (j k : TrackStar α →* H) + (hp : ∀ i, SmallSupported L (p i)) (hv : ∀ i, SmallSupported L (v i)) + (hj : SmallSupported L j) (hpc : ∀ i, SmallControlled c (p i) j) + (hvc : ∀ i, SmallControlled c (v i) k) + (hjk : ∀ s t, Commute (j s) (k t)) + (hsplit : ∀ i s, F i s=p i s*v i s) : + ∀ i s, F i s ∈ Subgroup.normalizer ((⨆ i, (p i).range : Subgroup H) : Set H) := by + have hcomm (i i' : ι) (s t : TrackStar α) : Commute (p i s) (v i' t) := + small_control_disjoint L c hc hd hα _ _ _ _ (hp i) (hv i') hj + (hpc i) (hvc i') hjk s t + have ho (i : ι) (s : TrackStar α) : + v i s ∈ Subgroup.centralizer ((⨆ i, (p i).range : Subgroup H) : Set H) := by + have hle : (⨆ i, (p i).range : Subgroup H) ≤ Subgroup.centralizer ({v i s} : Set H) := by + apply iSup_le + rintro i' x ⟨t,rfl⟩ y hy + obtain rfl := Set.mem_singleton_iff.mp hy + exact (hcomm i' i t s).eq.symm + intro x hx + exact (hle hx _ rfl).symm + intro i s + exact normalizes_of_cell_split _ _ _ _ (hsplit i s) + ((le_iSup (fun i => (p i).range) i) ⟨s,rfl⟩) (ho i s) + +theorem sameActionOn_iSup {D : Type*} (f g : D → H) (P : ι → Subgroup H) + (h : ∀ i, SameActionOn f g (P i)) : SameActionOn f g (⨆ i, P i) := by + intro d x hx + let F : H →* H := (MulAut.conj (f d)).toMonoidHom + let J : H →* H := (MulAut.conj (g d)).toMonoidHom + have hle : (⨆ i, P i) ≤ F.eqLocus J := by + apply iSup_le + intro i y hy + exact h i d y hy + exact hle hx + +end ControlledPatching + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/CoordinateModels.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/CoordinateModels.lean new file mode 100644 index 0000000000000000000000000000000000000000..30ac34b27287734eb66666949777c31d94b7be34 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/CoordinateModels.lean @@ -0,0 +1,233 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.ActiveClippedModelActions + +namespace OAI + +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +section CoordinateModels + +structure CoordinateGerm (a : ℕ) (d : Fin 2) (u : CutRing × CutRing) (z : ℝ × ℝ) where + period : ℤ + radius : ℝ + radius_pos : 0 halfPlane a (j i) (c i)) (spatialTranslate u (coordinatePrimitive a d)).val) + (p : GenericSquare a) (hp : p ∈ (C.inwardMargin T.vertex T.offset z).val) : + p ∈ (T.polygons (fun _ : Unit => spatialTranslate u (coordinatePrimitive a d)) ()).val ↔ + p ∉ (C.localDecision T.vertex T.offset z (j lo) (c lo)).val ∧ + p ∈ (C.localDecision T.vertex T.offset z (j hi) (c hi)).val := by + obtain ⟨q,hq,he⟩ := T.assignment_realized hr hz₁ hz₂ p hp + (Metric.ball z G.radius) Metric.isOpen_ball (Metric.mem_ball_self G.radius_pos) + have hd (i : ι) : q ∈ (cutPolygon a (j i) (c i)).val ↔ + p ∈ (C.localDecision T.vertex T.offset z (j i) (c i)).val := by + simpa only [polygonAssignment,decide_eq_true_eq] using Bool.eq_iff_iff.mp (congrFun he i) + have hmodel : p ∈ (T.polygons (fun _ : Unit => spatialTranslate u (coordinatePrimitive a d)) ()).val ↔ + q ∈ (spatialTranslate u (coordinatePrimitive a d)).val := by + change polygonAssignment (fun i => C.localDecision T.vertex T.offset z (j i) (c i)) p ∈ + polygonFormalMask (fun i => cutPolygon a (j i) (c i)) _ ↔ _ + rw [← he] + exact polygonFormalMask_mem _ _ hR q + rw [hmodel,G.valid q hq] + apply and_congr + · simpa only [cutPolygon,halfPlane,Set.mem_ofPred_eq,hlo.1,hlo.2,cutForm_axis,not_lt,lower] + using not_congr (hd lo) + · simpa only [cutPolygon,halfPlane,Set.mem_ofPred_eq,hhi.1,hhi.2,cutForm_axis,upper,lower] + using hd hi + +end CoordinateGerm + +namespace InitialCoverSystem.PatchAtlas +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} {B : InitialCoverSystem a r m hm M} + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] (A : B.PatchAtlas) + +theorem coordinate_model_action_neighborhood {ι : Type*} [Finite ι] + (hlarge : 20 ≤ m+1) (hr : 0 halfPlane a (j i) (c i)) (spatialTranslate u (coordinatePrimitive a d)).val) : + ∃ N : Set (ℝ × ℝ), IsOpen N ∧ z ∈ N ∧ + ∀ n q (W : polygonAlgebra a), + ResolvedBy (fun i => (primitiveTests (a := a) (r := r) (coordinateWindowPrimitives n q) i).val) W.val → + (∀ p : GenericSquare a, p ∈ W.val → p.val ∈ N) → + ∀ f : TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm), + B.AlignedSmallSupported f → + SmallControlled B.c f (B.windowSector (by omega) n (A.rectangles.rectangles n) q W) → + ∀ (I : ControlAlphabet (Fin (m+1))) (s : UniversalExtension (alternatingGroup I.val)), + ∀ x ∈ f.range, + A.primitiveStar (by omega) (coordinateTestIndex d,u) (universalMap (subtypeAlternatingHom I.val) s)*x* + (A.primitiveStar (by omega) (coordinateTestIndex d,u) (universalMap (subtypeAlternatingHom I.val) s))⁻¹ = + B.fullGeometricSector (by omega) (A.concurrentPrimitives T.vertex T.offset) (A.concurrentLaw T.vertex T.offset) + (T.polygons (fun _ : Unit => spatialTranslate u (coordinatePrimitive a d)) ()) + (universalMap (subtypeAlternatingHom I.val) s)*x* + (B.fullGeometricSector (by omega) (A.concurrentPrimitives T.vertex T.offset) (A.concurrentLaw T.vertex T.offset) + (T.polygons (fun _ : Unit => spatialTranslate u (coordinatePrimitive a d)) ()) + (universalMap (subtypeAlternatingHom I.val) s))⁻¹ := by + let R : Unit → polygonAlgebra a := fun _ => spatialTranslate u (coordinatePrimitive a d) + obtain ⟨N,hN,hz,hlocal⟩ := T.polygons_locally_eq hr R (fun _ => hR) + let V : polygonAlgebra a := (A.geometry.localDecision T.vertex T.offset z (j lo) (c lo))ᶜ ⊓ + A.geometry.localDecision T.vertex T.offset z (j hi) (c hi) + have hV : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) + (A.concurrentCoordinates T.vertex T.offset) i).val) V.val := by + intro p q hh + apply and_congr + · exact not_congr (by simpa only [hlo.1] using + A.coordinate_localDecision_resolved T.vertex T.offset z d (c lo) p q hh) + · simpa only [hhi.1] using A.coordinate_localDecision_resolved T.vertex T.offset z d (c hi) p q hh + have he (p : GenericSquare a) (hp : p ∈ (A.geometry.inwardMargin T.vertex T.offset z).val) : + p ∈ (T.polygons R ()).val ↔ p ∈ V.val := + G.model_formula T hr hz₁ hz₂ lo hi hlo hhi hR p hp + have hrestrict : V ⊓ A.geometry.inwardMargin T.vertex T.offset z= + T.polygons R () ⊓ A.geometry.inwardMargin T.vertex T.offset z := by + apply Subtype.ext + ext p + change (_ ∧ _) ↔ (_ ∧ _) + by_cases hp : p ∈ (A.geometry.inwardMargin T.vertex T.offset z).val + · simp only [hp,and_true,he p hp] + · simp only [hp,and_false] + refine ⟨N,hN,hz,?_⟩ + intro n q W hW hWN f hf hc I s x hx + have hinc : W ≤ A.geometry.inwardMargin T.vertex T.offset z := fun p hp => (hlocal p (hWN p hp)).1 + have heW : spatialTranslate u (coordinatePrimitive a d) ⊓ W=V ⊓ W := by + apply Subtype.ext + ext p + change (_ ∧ _) ↔ (_ ∧ _) + by_cases hp : p ∈ W.val + · have hh := (hlocal p (hWN p hp)).2 () + simpa only [hp,and_true] using hh.symm.trans (he p (hinc hp)) + · simp only [hp,and_false] + apply (A.coordinate_concurrent_action hlarge d u T.vertex T.offset V hV n q W hW heW f hf hc I s x hx).trans + exact B.chart_action_transfer hlarge _ (A.concurrentLaw T.vertex T.offset) V (T.polygons R ()) _ + (fun p q hh => hV p q (fun i => hh (A.concurrentCoordinateEmbedding i))) + (A.inward_model_resolved T R ()) (A.concurrent_inward_resolved T.vertex T.offset z) hrestrict f hf + (A.coordinate_control_inward_gate hlarge T.vertex T.offset _ (A.coordinate_inward_resolved T.vertex T.offset z) + n q W hW hinc f hf hc) I s x hx + +end InitialCoverSystem.PatchAtlas +end CoordinateModels + +namespace ClippedGerm +variable {a : ℕ} {r : CutRing} {slope : Fin 4} {u : CutRing × CutRing} {z : ℝ × ℝ} + (G : ClippedGerm a r slope u z) + +theorem inactive_model_restrict_gate {ι : Type*} [Finite ι] {C : ConcurrentGeometry a r} + {j : ι → Fin 4} {c : ι → CutRing} + (T : C.InwardChart j c z) (hr : 0 halfPlane a (j i) (c i)) + (spatialTranslate u (clippedSlopePrimitive a r slope)).val) + (hinactive : cutForm a slope z ≠ ordinary (integralCutForm a slope G.offset)) + (σ : Fin 2 × Bool → Bool) : + T.polygons (fun _ : Unit => spatialTranslate u (clippedSlopePrimitive a r slope)) () ⊓ + C.coordinateGate T.vertex T.offset z Prod.fst G.axialCut σ = + if (∀ d, σ (d,false)=false ∧ σ (d,true)=true) ∧ + ordinary (integralCutForm a slope G.offset) halfPlane a (j i) (c i)) + (spatialTranslate u (clippedSlopePrimitive a r (slopeDirection d))).val) + (hinactive : cutForm a (slopeDirection d) z ≠ ordinary (integralCutForm a (slopeDirection d) G.offset)) + (hnearline : |cutForm a (slopeDirection d) z-ordinary (integralCutForm a (slopeDirection d) G.offset)| (primitiveTests (a := a) (r := r) + (coordinateWindowPrimitives n q) e).val) (coordinateRectangle a L V).val) → + (coordinateRectangle a L V ≤ + A.geometry.coordinateGate T.vertex T.offset z Prod.fst G.axialCut σ) → + ∀ (f : TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm)), + B.AlignedSmallSupported f → + (SmallControlled B.c f (B.windowSector (by omega) n (A.rectangles.rectangles n) q + (coordinateRectangle a L V))) → + ∀ (I : ControlAlphabet (Fin (m+1))) (s : UniversalExtension (alternatingGroup I.val)), + ∀ x ∈ f.range, + A.primitiveStar (by omega) (slopeTestIndex d,u) (universalMap (subtypeAlternatingHom I.val) s)*x* + (A.primitiveStar (by omega) (slopeTestIndex d,u) (universalMap (subtypeAlternatingHom I.val) s))⁻¹ = + B.fullGeometricSector (by omega) (A.concurrentPrimitives T.vertex T.offset) (A.concurrentLaw T.vertex T.offset) + (T.polygons (fun _ : Unit => spatialTranslate u (clippedSlopePrimitive a r (slopeDirection d))) ()) + (universalMap (subtypeAlternatingHom I.val) s)*x* + (B.fullGeometricSector (by omega) (A.concurrentPrimitives T.vertex T.offset) (A.concurrentLaw T.vertex T.offset) + (T.polygons (fun _ : Unit => spatialTranslate u (clippedSlopePrimitive a r (slopeDirection d))) ()) + (universalMap (subtypeAlternatingHom I.val) s))⁻¹ := by + obtain ⟨δ,hδ,b,hb,h⟩ := A.rectangles.inactive_near_action_neighborhood hlarge hr d G.offset z hinactive hnearline + refine ⟨δ,hδ,?_⟩ + intro L V hLV hclip hnear n q hW hinc f hf hc I s x hx + have hperiod := A.primitiveStar_periodic (by omega) (slopeTestIndex d) u G.period + change A.primitiveStar (by omega) (slopeTestIndex d,G.offset)=_ at hperiod + rw [← hperiod,A.primitiveStar_slope] + apply (h L V hLV hclip hnear n q hW f hf hc I s x hx).trans + symm + apply B.cell_constant_action hlarge _ (A.concurrentLaw T.vertex T.offset) _ _ + (A.inward_model_resolved T _ ()) + (A.concurrent_coordinateGate_resolved T.vertex T.offset z Prod.fst G.axialCut σ) b ?_ f hf + (A.coordinateGate_control hlarge T.vertex T.offset z Prod.fst G.axialCut σ n q _ hW hinc f hf hc) I s x hx + rw [G.inactive_model_restrict_gate T hr hz₁ hz₂ lo hi slope hlo hhi hs hR hinactive σ] + simp only [hσ,forall_const,true_and,← hb] + +end InitialCoverSystem.PatchAtlas + +end SimpleAmenable + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/CoordinateProductPatterns.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/CoordinateProductPatterns.lean new file mode 100644 index 0000000000000000000000000000000000000000..bb2620cb9c8df2bf11237d545720afbd92f47bb6 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/CoordinateProductPatterns.lean @@ -0,0 +1,105 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.Supported +import OAI.GroupTheory.SimpleAmenable.CentralCovers.BooleanCoordinateGeneration +import OAI.GroupTheory.SimpleAmenable.Configurations.PointwisePolygonTables + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section CoordinateProductPatterns + +theorem generic_fixed_x {a : ℕ} (p : GenericSquare a) (l r : ℝ) + (hl : 0 ≤ l) (hr : r ≤ 1) (hlr : l < r) : + ∃ q : GenericSquare a, q.val.1 = p.val.1 ∧ q.val.2 ∈ Set.Ioo l r := by + let x := p.val.1 + let t := Real.goldenRatio^a + have ht : t ≠ 0 := ne_of_gt (pow_pos Real.goldenRatio_pos a) + let S := Set.range ordinary ∪ Set.range (fun z : CutRing => ordinary z+t*x) ∪ + Set.range (fun z : CutRing => (x-ordinary z)/t) + have hS : S.Countable := ((Set.countable_range ordinary).union + (Set.countable_range _)).union (Set.countable_range _) + obtain ⟨y,hy,hy'⟩ : ∃ y ∈ Set.Ioo l r, y ∉ S := by + apply Set.not_subset.mp + intro hh + have := Cardinal.Real.Ioo_countable_iff.mp (hS.mono hh) + linarith + have hav : AvoidsCuts a (x,y) := by + intro j z hz + fin_cases j + · exact p.property.2.2 0 z hz + · exact hy' (Or.inl (Or.inl ⟨z,by simpa [cutForm] using hz.symm⟩)) + · apply hy' + apply Or.inl ∘ Or.inr + refine ⟨z,?_⟩ + change ordinary z+t*x=y + change y-t*x=ordinary z at hz + linarith + · apply hy' + apply Or.inr + refine ⟨z,?_⟩ + apply (div_eq_iff ht).mpr + change x-t*y=ordinary z at hz + linarith + exact ⟨⟨(x,y),p.property.1,⟨by linarith [hy.1],by linarith [hy.2]⟩,hav⟩,rfl,hy⟩ + +def genericSwap {a : ℕ} (p : GenericSquare a) : GenericSquare a := + ⟨p.val.swap,p.property.2.1,p.property.1,by + intro j z + fin_cases j + · exact p.property.2.2 1 z + · exact p.property.2.2 0 z + · exact p.property.2.2 3 z + · exact p.property.2.2 2 z⟩ + +theorem generic_fixed_y {a : ℕ} (p : GenericSquare a) (l r : ℝ) + (hl : 0 ≤ l) (hr : r ≤ 1) (hlr : l < r) : + ∃ q : GenericSquare a, q.val.2 = p.val.2 ∧ q.val.1 ∈ Set.Ioo l r := by + obtain ⟨q,hq,hqr⟩ := generic_fixed_x (genericSwap p) l r hl hr hlr + exact ⟨genericSwap q,hq,hqr⟩ + +theorem coordinate_patterns_product {a : ℕ} {ι : Type*} [Finite ι] + (U : Fin 2 × ι → polygonAlgebra a) + (hcoord : ∀ j i (p q : GenericSquare a), coordinate j p = coordinate j q → + (p ∈ (U (j,i)).val ↔ q ∈ (U (j,i)).val)) + (σ : Fin 2 × ι → Bool) + (hσ : ∀ j : Fin 2, (fun i => σ (j,i)) ∈ Set.range (polygonAssignment (fun i => U (j,i)))) : + σ ∈ Set.range (polygonAssignment U) := by + classical + let V : Fin 2 → polygonAlgebra a := fun j => + ⟨{q | polygonAssignment (fun i => U (j,i)) q = fun i => σ (j,i)}, + polygonAssignment_fiber_mem _ _⟩ + have hV (j : Fin 2) : (V j).val.Nonempty := hσ j + obtain ⟨l₀,r₀,hl₀,hlr₀,hr₀,hl₀',hlr₀',hr₀',hbox₀⟩ := polygon_contains_rectangle (V 0) (hV 0) + obtain ⟨l₁,r₁,hl₁,hlr₁,hr₁,hl₁',hlr₁',hr₁',hbox₁⟩ := polygon_contains_rectangle (V 1) (hV 1) + obtain ⟨p,hpx,hpy⟩ := generic_rectangle a (ordinary l₀.1) (ordinary r₀.1) + (ordinary l₁.2) (ordinary r₁.2) hl₀.le hr₀.le hlr₀ hl₁'.le hr₁'.le hlr₁' + obtain ⟨q₀,hq₀,hq₀y⟩ := generic_fixed_x p (ordinary l₀.2) (ordinary r₀.2) hl₀'.le hr₀'.le hlr₀' + obtain ⟨q₁,hq₁,hq₁x⟩ := generic_fixed_y p (ordinary l₁.1) (ordinary r₁.1) hl₁.le hr₁.le hlr₁ + have hq₀mem := hbox₀ q₀ (by rwa [hq₀]) hq₀y + have hq₁mem := hbox₁ q₁ hq₁x (by rwa [hq₁]) + refine ⟨p,?_⟩ + funext ⟨j,i⟩ + fin_cases j + · have he := congrFun hq₀mem i + change decide (p ∈ (U (0,i)).val) = _ + change decide (q₀ ∈ (U (0,i)).val) = _ at he + rw [decide_eq_decide.mpr (hcoord 0 i p q₀ hq₀.symm)] + exact he + · have he := congrFun hq₁mem i + change decide (p ∈ (U (1,i)).val) = _ + change decide (q₁ ∈ (U (1,i)).val) = _ at he + rw [decide_eq_decide.mpr (hcoord 1 i p q₁ hq₁.symm)] + exact he + +end CoordinateProductPatterns + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/CoordinateWindowTarget.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/CoordinateWindowTarget.lean new file mode 100644 index 0000000000000000000000000000000000000000..c56a7ed6d50cb9a41c2a6cfd4e42906bffd4bec5 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/CoordinateWindowTarget.lean @@ -0,0 +1,54 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.CommonTranslatedCopies +import OAI.GroupTheory.SimpleAmenable.CentralCovers.PrimitiveWords + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section CoordinateWindowTarget + +def coordinateTestIndex (j : Fin 2) : Fin 5 := ⟨j.val+1,by omega⟩ + +@[simp] theorem initialTest_coordinate (a : ℕ) (r : CutRing) (j : Fin 2) : + initialTest a r (coordinateTestIndex j) = coordinatePrimitive a j := by + fin_cases j <;> rfl + +noncomputable def coordinateWindowPrimitives (n : ℕ) (q : Fin 2 → ℤ) : + Fin 2 × Fin (n-1) → Fin 5 × (CutRing × CutRing) := fun i => + (coordinateTestIndex i.1,coordinateShift i.1 (((q i.1 + (i.2.val : ℤ)) : CutRing)*cutTau)) + +namespace InitialCoverSystem + +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + +def CoordinateWindowLaw (n : ℕ) : Prop := + ∀ (I : Finset (Fin (m+1))) (b : Fin (m+1)) (hb : b ∉ I) (q : Fin 2 → ℤ), + B.PrimitiveFamilyLaw I b hb (coordinateWindowPrimitives n q) + +end InitialCoverSystem + +theorem coordinatePrimitive_translate_eq {a : ℕ} (j : Fin 2) + (u v : CutRing × CutRing) (h : (if j = 0 then u.1 else u.2) = + (if j = 0 then v.1 else v.2)) : + spatialTranslate u (coordinatePrimitive a j) = spatialTranslate v (coordinatePrimitive a j) := by + apply Subtype.ext + ext p + fin_cases j + · change u.1 = v.1 at h + simp [spatialTranslate,coordinatePrimitive,halfPlane,cutForm,translate_val,h] + · change u.2 = v.2 at h + simp [spatialTranslate,coordinatePrimitive,halfPlane,cutForm,translate_val,h] + +end CoordinateWindowTarget + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/DirectionStripCounts.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/DirectionStripCounts.lean new file mode 100644 index 0000000000000000000000000000000000000000..e04d719508da614aaa71f87563efab9861889212 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/DirectionStripCounts.lean @@ -0,0 +1,235 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.FlagSiteCounts + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section DirectionStripCounts +open Classical + +noncomputable def cutCoordinates (a : ℕ) (j : Fin 4) : (CutRing×CutRing) ≃ (CutRing×CutRing) where + toFun p := ![p,(p.2,p.1),(p.2-cutTau^a*p.1,p.1),(p.1-cutTau^a*p.2,p.2)] j + invFun q := ![q,(q.2,q.1),(q.2,q.1+cutTau^a*q.2),(q.1+cutTau^a*q.2,q.2)] j + left_inv p := by fin_cases j <;> simp + right_inv p := by fin_cases j <;> simp + +@[simp] theorem cutCoordinates_fst (a : ℕ) (j : Fin 4) (p : CutRing×CutRing) : + (cutCoordinates a j p).1=integralCutForm a j p := by + fin_cases j <;> simp [cutCoordinates,integralCutForm] + +theorem cutCoordinates_conjugate_bound (a : ℕ) (j : Fin 4) (p : CutRing×CutRing) + {R : ℝ} (hR : 0 ≤ R) (hx : |conjugate p.1| ≤ R) (hy : |conjugate p.2| ≤ R) : + |conjugate (cutCoordinates a j p).1| ≤ (1+|conjugate (cutTau^a)|)*R := by + have hmulx := mul_le_mul_of_nonneg_left hx (abs_nonneg (conjugate (cutTau^a))) + have hmuly := mul_le_mul_of_nonneg_left hy (abs_nonneg (conjugate (cutTau^a))) + have hn : 0 ≤ |conjugate (cutTau^a)| * R := mul_nonneg (abs_nonneg _) hR + fin_cases j + · change |conjugate p.1| ≤ (1+|conjugate (cutTau^a)|)*R + nlinarith + · change |conjugate p.2| ≤ (1+|conjugate (cutTau^a)|)*R + nlinarith + · change |conjugate (p.2-cutTau^a*p.1)| ≤ (1+|conjugate (cutTau^a)|)*R + rw [map_sub,map_mul] + calc + |conjugate p.2-conjugate (cutTau^a)*conjugate p.1| ≤ + |conjugate p.2| + |conjugate (cutTau^a)| * |conjugate p.1| := by + simpa only [abs_mul] using abs_sub (conjugate p.2) (conjugate (cutTau^a)*conjugate p.1) + _ ≤ _ := by nlinarith + · change |conjugate (p.1-cutTau^a*p.2)| ≤ (1+|conjugate (cutTau^a)|)*R + rw [map_sub,map_mul] + calc + |conjugate p.1-conjugate (cutTau^a)*conjugate p.2| ≤ + |conjugate p.1| + |conjugate (cutTau^a)| * |conjugate p.2| := by + simpa only [abs_mul] using abs_sub (conjugate p.1) (conjugate (cutTau^a)*conjugate p.2) + _ ≤ _ := by nlinarith + +def flagDirectionStrip {a m D : ℕ} {v : ℝ×ℝ} (j : Fin 4) (c ε R : ℝ) : + Set (FlagSite a m D v) := + {z | z∈flagSiteBox R ∧ |cutForm a j z.val.2.val-c| ≤ ε} + +theorem flagDirectionStrip_numerators {a m D : ℕ} {v : ℝ×ℝ} (hD : 0 < D) + (j : Fin 4) {c ε R : ℝ} (hR : 0 ≤ R) (z : FlagSite a m D v) + (hz : z∈flagDirectionStrip j c ε R) : + (cutCoordinates a j (flagSiteNumerator z)).1∈ + cutRectangle (D*(c-ε)) (-(D:ℝ)*(1+|conjugate (cutTau^a)|)*R) + (2*D*ε) (2*D*(1+|conjugate (cutTau^a)|)*R) ∧ + (cutCoordinates a j (flagSiteNumerator z)).2∈ + cutRectangle 0 (-(D:ℝ)*R) D (2*D*R) := by + have hd : (0:ℝ) < D := by exact_mod_cast hD + have hb := flagSiteNumerator_box hD z hz.1 + have hx : |conjugate (flagSiteNumerator z).1| ≤ (D:ℝ)*R := by + exact abs_le.mpr ⟨by linarith [hb.1.2.1],by linarith [hb.1.2.2]⟩ + have hy : |conjugate (flagSiteNumerator z).2| ≤ (D:ℝ)*R := by + exact abs_le.mpr ⟨by linarith [hb.2.2.1],by linarith [hb.2.2.2]⟩ + have hc := abs_le.mp (cutCoordinates_conjugate_bound a j (flagSiteNumerator z) + (mul_nonneg hd.le hR) hx hy) + have he : ordinary (cutCoordinates a j (flagSiteNumerator z)).1 = + (D:ℝ)*cutForm a j z.val.2.val := by + rw [cutCoordinates_fst,← cutForm_ordinary,← cutForm_smul] + congr 1 + have hh := flagSiteNumerator_spec z + apply Prod.ext + · have hh₁ := congrArg Prod.fst hh + change ordinary (flagSiteNumerator z).1/(D:ℝ)=z.val.2.val.1 at hh₁ + simpa [smul_eq_mul,mul_comm] using (div_eq_iff hd.ne').mp hh₁ + · have hh₂ := congrArg Prod.snd hh + change ordinary (flagSiteNumerator z).2/(D:ℝ)=z.val.2.val.2 at hh₂ + simpa [smul_eq_mul,mul_comm] using (div_eq_iff hd.ne').mp hh₂ + constructor + · have hs := abs_le.mp hz.2 + constructor <;> constructor <;> nlinarith [hs.1,hs.2,hc.1,hc.2] + · fin_cases j <;> first | simpa [cutCoordinates] using hb.1 | simpa [cutCoordinates] using hb.2 + +theorem flagDirectionStrip_card_bound {a m D : ℕ} {v : ℝ×ℝ} (hD : 0 < D) + (j : Fin 4) {c ε R : ℝ} (hε : 0 ≤ ε) (hR : 0 < R) + (S : Finset (FlagSite a m D v)) (hS : ∀z∈S,z∈flagDirectionStrip j c ε R) : + (S.card:ℝ) ≤ m*(4*(D:ℝ)^2*(1+|conjugate (cutTau^a)|)*ε*R+2)*(2*(D:ℝ)^2*R+2) := by + have hd : (0:ℝ) < D := by exact_mod_cast hD + have hl : 0 < 1+|conjugate (cutTau^a)| := by positivity + let T₁ := (cutRectangle_finite (D*(c-ε)) (-(D:ℝ)*(1+|conjugate (cutTau^a)|)*R) + (2*D*ε) (2*D*(1+|conjugate (cutTau^a)|)*R) (by positivity)).toFinset + let T₂ := (cutRectangle_finite 0 (-(D:ℝ)*R) D (2*D*R) (by positivity)).toFinset + have hc₁ : (T₁.card:ℝ) < 4*(D:ℝ)^2*(1+|conjugate (cutTau^a)|)*ε*R+2 := by + have hh := cutRectangle_card_bound T₁ _ _ _ _ (by positivity) (by positivity) + (fun u hu => (Set.Finite.mem_toFinset _).mp hu) + dsimp [T₁] at hh ⊢ + convert hh using 1 + ring + have hc₂ : (T₂.card:ℝ) < 2*(D:ℝ)^2*R+2 := by + have hh := cutRectangle_card_bound T₂ 0 (-(D:ℝ)*R) D (2*D*R) hd.le (by positivity) + (fun u hu => (Set.Finite.mem_toFinset _).mp hu) + nlinarith + let key := fun z : FlagSite a m D v => (z.val.1,cutCoordinates a j (flagSiteNumerator z)) + have hi : Function.Injective key := by + intro z w h + have ht : z.val.1=w.val.1 := congrArg (fun x : Fin m × (CutRing×CutRing) => x.1) h + have hn : cutCoordinates a j (flagSiteNumerator z)=cutCoordinates a j (flagSiteNumerator w) := + congrArg (fun x : Fin m × (CutRing×CutRing) => x.2) h + exact flagSite_key_injective (Prod.ext ht ((cutCoordinates a j).injective hn)) + have hn : S.card ≤ m*T₁.card*T₂.card := by + rw [← Finset.card_image_of_injective _ hi] + have hh : S.image key ⊆ (Finset.univ : Finset (Fin m)) ×ˢ (T₁ ×ˢ T₂) := by + intro x hx + obtain ⟨z,hz,rfl⟩ := Finset.mem_image.mp hx + have hz' := flagDirectionStrip_numerators hD j hR.le z (hS z hz) + simpa only [Finset.mem_product,Finset.mem_univ,true_and,key,T₁,T₂, + Set.Finite.mem_toFinset] using hz' + simpa only [Finset.card_product,Finset.card_univ,Fintype.card_fin,mul_assoc] + using Finset.card_le_card hh + have hn' : (S.card:ℝ) ≤ m*(T₁.card:ℝ)*(T₂.card:ℝ) := by exact_mod_cast hn + exact hn'.trans (mul_le_mul + (mul_le_mul_of_nonneg_left hc₁.le (Nat.cast_nonneg _)) hc₂.le + (Nat.cast_nonneg _) (by positivity)) + +end DirectionStripCounts + +section ExceptionalRowCounts +open Classical + +theorem flagDirectionStrip_union_card_bound {a m D : ℕ} {v : ℝ×ℝ} (hD : 0 < D) + (j : Fin 4) (T : Finset CutRing) {ε R : ℝ} (hε : 0 ≤ ε) (hR : 0 < R) + (S : Finset (FlagSite a m D v)) + (hS : ∀z∈S,∃c∈T,z∈flagDirectionStrip j (ordinary c) ε R) : + (S.card:ℝ) ≤ T.card*(m*(4*(D:ℝ)^2*(1+|conjugate (cutTau^a)|)*ε*R+2)* + (2*(D:ℝ)^2*R+2)) := by + let rows := fun c => S.filter (fun z => z∈flagDirectionStrip j (ordinary c) ε R) + have hh : S ⊆ T.biUnion rows := by + intro z hz + obtain ⟨c,hc,hzc⟩ := hS z hz + exact Finset.mem_biUnion.mpr ⟨c,hc,Finset.mem_filter.mpr ⟨hz,hzc⟩⟩ + have hn : S.card ≤ ∑c∈T,(rows c).card := + (Finset.card_le_card hh).trans (Finset.card_biUnion_le) + have hn' : (S.card:ℝ) ≤ ∑c∈T,((rows c).card:ℝ) := by exact_mod_cast hn + calc + (S.card:ℝ) ≤ ∑c∈T,((rows c).card:ℝ) := hn' + _ ≤ ∑c∈T,(m*(4*(D:ℝ)^2*(1+|conjugate (cutTau^a)|)*ε*R+2)* + (2*(D:ℝ)^2*R+2)) := by + apply Finset.sum_le_sum + intro c hc + exact flagDirectionStrip_card_bound hD j hε hR (rows c) + (fun z hz => (Finset.mem_filter.mp hz).2) + _ = _ := by simp [nsmul_eq_mul] + +def boundedCutLevels (A B : ℝ) : Set CutRing := + {c | |ordinary c| ≤ A ∧ |conjugate c| ≤ B} + +theorem boundedCutLevels_eq (A B : ℝ) : + boundedCutLevels A B = cutRectangle (-A) (-B) (2*A) (2*B) := by + ext c + simp only [boundedCutLevels,cutRectangle,Set.mem_ofPred_eq,Set.mem_Icc,abs_le] + constructor <;> rintro ⟨⟨h₁,h₂⟩,⟨h₃,h₄⟩⟩ <;> constructor <;> constructor <;> linarith + +theorem boundedCutLevels_finite (A : ℝ) {B : ℝ} (hB : 0 < B) : + (boundedCutLevels A B).Finite := by + rw [boundedCutLevels_eq] + exact cutRectangle_finite _ _ _ _ (by positivity) + +theorem boundedCutLevels_card_bound {A B : ℝ} (hA : 0 ≤ A) (hB : 0 < B) + (T : Finset CutRing) (hT : ∀c∈T,c∈boundedCutLevels A B) : + (T.card:ℝ) < 4*A*B+2 := by + have hh := cutRectangle_card_bound T (-A) (-B) (2*A) (2*B) (by positivity) + (by positivity) (fun c hc => by rw [← boundedCutLevels_eq]; exact hT c hc) + convert hh using 1 + ring + +theorem exceptional_direction_rows {a m D : ℕ} {v : ℝ×ℝ} (hD : 0 < D) + (j : Fin 4) {A C Q κ s N : ℝ} (hA : 0 ≤ A) (hC : 0 ≤ C) (hQ : 0 < Q) + (hκ : 0 < κ) (hs : 0 < s) (hN : 1 ≤ N) (hscale : 1 ≤ s*N) + (S : Finset (FlagSite a m D v)) + (hS : ∀z∈S,∃c : CutRing, |ordinary c| ≤ A ∧ |conjugate c| ≤ 2*κ/s ∧ + z∈flagDirectionStrip j (ordinary c) (C*s) (Q*N)) : + (S.card:ℝ) ≤ + (m*(4*(D:ℝ)^2*(1+|conjugate (cutTau^a)|)*C*Q+2)*(2*(D:ℝ)^2*Q+2)*(8*A+2))* + (κ+s)*N^2 := by + have hd : (0:ℝ) < D := by exact_mod_cast hD + have hN' : 0 < N := lt_of_lt_of_le zero_lt_one hN + let T := (boundedCutLevels_finite A (show 0 < 2*κ/s by positivity)).toFinset + have hTc : (T.card:ℝ) ≤ 8*A*κ/s+2 := by + have hh := boundedCutLevels_card_bound hA (show 0 < 2*κ/s by positivity) T + (fun c hc => (Set.Finite.mem_toFinset _).mp hc) + have he : 4*A*(2*κ/s)+2=8*A*κ/s+2 := by ring + rw [he] at hh + exact hh.le + have hTu := flagDirectionStrip_union_card_bound hD j T + (mul_nonneg hC hs.le) (mul_pos hQ hN') S (by + intro z hz + obtain ⟨c,hc₁,hc₂,hzc⟩ := hS z hz + exact ⟨c,(Set.Finite.mem_toFinset _).mpr ⟨hc₁,hc₂⟩,hzc⟩) + let U := 4*(D:ℝ)^2*(1+|conjugate (cutTau^a)|)*C*Q + let V := 2*(D:ℝ)^2*Q + have hU : 0 ≤ U := by dsimp [U]; positivity + have hV : 0 ≤ V := by dsimp [V]; positivity + have he₁ : 4*(D:ℝ)^2*(1+|conjugate (cutTau^a)|)*(C*s)*(Q*N)+2 ≤ (U+2)*(s*N) := by + dsimp [U] + nlinarith + have he₂ : 2*(D:ℝ)^2*(Q*N)+2 ≤ (V+2)*N := by + dsimp [V] + nlinarith + have hf : 8*A*κ+2*s ≤ (8*A+2)*(κ+s) := by + nlinarith [mul_nonneg hA hs.le] + calc + (S.card:ℝ) ≤ T.card*(m*(4*(D:ℝ)^2*(1+|conjugate (cutTau^a)|)*(C*s)*(Q*N)+2)* + (2*(D:ℝ)^2*(Q*N)+2)) := hTu + _ ≤ (8*A*κ/s+2)*(m*((U+2)*(s*N))*((V+2)*N)) := by + apply mul_le_mul hTc + · exact mul_le_mul (mul_le_mul_of_nonneg_left he₁ (Nat.cast_nonneg _)) he₂ + (by positivity) (by positivity) + · positivity + · positivity + _ = (m*(U+2)*(V+2))*(8*A*κ+2*s)*N^2 := by field_simp + _ ≤ (m*(U+2)*(V+2))*((8*A+2)*(κ+s))*N^2 := + mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left hf (by positivity)) (sq_nonneg N) + _ = _ := by dsimp [U,V]; ring + +end ExceptionalRowCounts + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/EvaluationTable.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/EvaluationTable.lean new file mode 100644 index 0000000000000000000000000000000000000000..e8c359bae6e4200c528fe8de43fdf60a19212674 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/EvaluationTable.lean @@ -0,0 +1,66 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.Sectors + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section EvaluationTable +variable {D H Q T : Type*} [Group D] [Group H] [Group Q] [Group T] + +noncomputable def evaluationModel (q : H →* Q) (e : D →* H) + (v : D →* T) (ρ : T →* Q) (hρ : Function.Injective ρ) + (he : q.comp e = ρ.comp v) : e.range →* T := + e.rangeRestrict.liftOfSurjective e.rangeRestrict_surjective + ⟨v,by + intro w hw + apply hρ + have hh := DFunLike.congr_fun he w + change q (e w) = ρ (v w) at hh + have hw' : e w = 1 := congrArg Subtype.val hw + rw [hw',map_one] at hh + simpa only [map_one] using hh.symm⟩ + +theorem evaluationModel_comp (q : H →* Q) (e : D →* H) + (v : D →* T) (ρ : T →* Q) (hρ : Function.Injective ρ) + (he : q.comp e = ρ.comp v) : + (evaluationModel q e v ρ hρ he).comp e.rangeRestrict = v := + e.rangeRestrict.liftOfRightInverse_comp _ _ _ + +theorem evaluationModel_projection (q : H →* Q) (e : D →* H) + (v : D →* T) (ρ : T →* Q) (hρ : Function.Injective ρ) + (he : q.comp e = ρ.comp v) : + q.comp e.range.subtype = ρ.comp (evaluationModel q e v ρ hρ he) := by + apply MonoidHom.ext + intro x + obtain ⟨w,rfl⟩ := e.rangeRestrict_surjective x + have hh := DFunLike.congr_fun (evaluationModel_comp q e v ρ hρ he) w + change evaluationModel q e v ρ hρ he (e.rangeRestrict w) = v w at hh + simp only [MonoidHom.comp_apply,hh] + exact DFunLike.congr_fun he w + +noncomputable def evaluationTable {Ω E : Type*} [Group E] + (q : H →* Q) (e : D →* H) (v : D →* (Ω → E)) + (ρ : (Ω → E) →* Q) (hρ : Function.Injective ρ) + (he : q.comp e = ρ.comp v) (hv : Function.Surjective v) + (h : CentralOn q e.range) : ActualLawfulTable q ρ where + carrier := e.range + law := h + model := evaluationModel q e v ρ hρ he + onto := by + intro s + obtain ⟨w,rfl⟩ := hv s + exact ⟨e.rangeRestrict w,DFunLike.congr_fun (evaluationModel_comp q e v ρ hρ he) w⟩ + projection := evaluationModel_projection q e v ρ hρ he + +end EvaluationTable + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/ExteriorPhaseGeometry.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/ExteriorPhaseGeometry.lean new file mode 100644 index 0000000000000000000000000000000000000000..84fe2b8087d11b32f4e022e3390accae6e0b3ea4 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/ExteriorPhaseGeometry.lean @@ -0,0 +1,82 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.ClippedGerms +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.FarClippingGeometry +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.LocalClippedBoxFormula + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section ExteriorPhaseGeometry +namespace ClippedGerm +variable {a : ℕ} {r : CutRing} {slope : Fin 4} {u : CutRing × CutRing} {z : ℝ × ℝ} + (G : ClippedGerm a r slope u z) + +theorem gate_box_iff {ι : Type*} {C : ConcurrentGeometry a r} + {j : ι → Fin 4} {c : ι → CutRing} (T : C.InwardChart j c z) + (hbox : G.BoxValid) (lo hi : Fin 2 → ι) + (hlo : ∀ k, j (lo k)=axisDirection k ∧ c (lo k)=pointCoordinate G.offset k-r) + (hhi : ∀ k, j (hi k)=axisDirection k ∧ c (hi k)=pointCoordinate G.offset k+r) + (σ : Fin 2 × Bool → Bool) (p : GenericSquare a) + (hp : p ∈ (C.coordinateGate T.vertex T.offset z Prod.fst G.axialCut σ).val) + (hpnear : dist p.val z -r) (fun _ => r))).val ↔ + ∀ k, σ (k,false)=false ∧ σ (k,true)=true := by + classical + rw [hbox p hpnear] + apply forall_congr' + intro k + have hL := hlocal (lo k) + have hH := hlocal (hi k) + rw [(hlo k).1,(hlo k).2] at hL + rw [(hhi k).1,(hhi k).2] at hH + have hsL : decide (p ∈ (C.localDecision T.vertex T.offset z (axisDirection k) + (pointCoordinate G.offset k-r)).val)=σ (k,false) := congrFun hp.2 (k,false) + have hsH : decide (p ∈ (C.localDecision T.vertex T.offset z (axisDirection k) + (pointCoordinate G.offset k+r)).val)=σ (k,true) := congrFun hp.2 (k,true) + change (p ∈ (C.localDecision T.vertex T.offset z (axisDirection k) (pointCoordinate G.offset k-r)).val ↔ + cutForm a (axisDirection k) p.val -r) (fun _ => r)) := by + have hout : p ∉ (spatialTranslate u (coordinateRectangle a (fun _ => -r) (fun _ => r))).val := + fun hh => hσ ((G.gate_box_iff T hbox lo hi hlo hhi σ p hp hpnear hlocal).mp hh) + exact windowRectangle_exterior_of_point r hr n hn q cell hb he (translate a (-u) p) hinitial hout + +end ClippedGerm +end ExteriorPhaseGeometry + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/FarClippingGeometry.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/FarClippingGeometry.lean new file mode 100644 index 0000000000000000000000000000000000000000..860d9167c2f1c68d88e7cd79ae37d5b163c99584 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/FarClippingGeometry.lean @@ -0,0 +1,131 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.FinePatchAtlas + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section FarClippingGeometry + +theorem windowRectangle_clipping_chart_at_lift {a : ℕ} (r : CutRing) + (n : ℕ) (hn : 201≤n) (q : Fin 2 → ℤ) (cell : Fin 2 → Fin n) + (hb : ∀ d, q d≤endpointLabel (-r) ∧ endpointLabel (-r) linarith [(hk d),(hclip d).1,(hclip d).2]) + simpa only [map_neg] using h + · apply Prod.ext + · change (windowPlanarLift q p).1+(k 0:ℝ)=z.1 + have h := hk 0 + change z.1-(windowPlanarLift q p).1=(k 0:ℝ) at h + linarith + · change (windowPlanarLift q p).2+(k 1:ℝ)=z.2 + have h := hk 1 + change z.2-(windowPlanarLift q p).2=(k 1:ℝ) at h + linarith + +theorem far_cut_neighborhood (a : ℕ) (j : Fin 4) (z : ℝ × ℝ) (c R E : ℝ) + (hR : 0 -r) (fun _ => r) := by + intro p hp + have hb (d : Fin 2) : p ∈ coordinateBetween a d (-r) r := by + apply (mem_coordinateBetween_iff d (-r) r (by rw [map_neg]; linarith [hr.1]) + (by rw [map_neg]; linarith [hr.2]) p).mpr + refine ⟨k d-⌊coordinate d p-ordinary ((q d:CutRing)*cutTau)⌋,?_⟩ + have hh := (windowRectangle_mem n hn q cell p).mp hp d + simp only [windowPlanarLift_coordinate,liftedCoordinate] at hh + simp only [map_neg,Int.cast_sub] + constructor <;> linarith [(hk d).1,(hk d).2,hh.1,hh.2] + exact ⟨hb 0,hb 1⟩ + +theorem windowRectangle_clipping_dichotomy {a : ℕ} (r : CutRing) + (hr : 0 -r) (fun _ => r)) ∨ + windowRectangle a n q cell ≤ coordinateRectangle a (fun _ => -r) (fun _ => r) := by + classical + by_cases h : ∃ p : GenericSquare a, p ∈ (windowRectangle a n q cell).val ∧ + p ∈ (coordinateRectangle a (fun _ => -r) (fun _ => r)).val + · obtain ⟨p,hp,hbox⟩ := h + obtain ⟨k,hk⟩ := windowRectangle_clipping_chart r hr n hn q cell hb he p hp hbox + exact Or.inr (windowRectangle_le_clipping_box r hr n hn q cell k hk) + · left + rw [disjoint_iff_inf_le] + exact fun p hp => h ⟨p,hp.1,hp.2⟩ + +theorem windowRectangle_exterior_of_point {a : ℕ} (r : CutRing) + (hr : 0 -r) (fun _ => r)).val) : + Disjoint (windowRectangle a n q cell) (coordinateRectangle a (fun _ => -r) (fun _ => r)) := by + rcases windowRectangle_clipping_dichotomy r hr n hn q cell hb he with h | h + · exact h + · exact False.elim (hout (h hp)) + +end WindowBoxDichotomy + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/FinePatchAtlas.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/FinePatchAtlas.lean new file mode 100644 index 0000000000000000000000000000000000000000..a90985eb241147a2a5cfeb358714bc63c85c2457 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/FinePatchAtlas.lean @@ -0,0 +1,187 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.WindowClipping +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.ConcurrentGeometry + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section FinePatchAtlas + +namespace ConcurrentGeometry +variable {a : ℕ} {r : CutRing} (C : ConcurrentGeometry a r) + +noncomputable def refineMesh (n : ℕ) (hn : C.mesh ≤ n) : ConcurrentGeometry a r := + { C with + mesh := n + mesh_large := C.mesh_large.trans hn + clipping := C.clipping.trans hn + mesh_fine := by + have hpos : (0:ℝ) < C.mesh := by exact_mod_cast (show 0 < C.mesh by have := C.mesh_large; omega) + have hle : (C.mesh:ℝ) ≤ n := by exact_mod_cast hn + have h := div_le_div_of_nonneg_left (by norm_num : (0:ℝ) ≤ 200) hpos hle + exact (mul_le_mul_of_nonneg_left h (by linarith [lineIntersectionConstant_ge_one a])).trans_lt C.mesh_fine } + +theorem exists_finer (C : ConcurrentGeometry a r) (K δ : ℝ) (hδ : 0 < δ) : + ∃ D : ConcurrentGeometry a r, K*(200/(D.mesh:ℝ)) < δ := by + obtain ⟨N,hN⟩ := exists_nat_gt (200*K/δ) + let n := max C.mesh N + let D := C.refineMesh n (le_max_left _ _) + refine ⟨D,?_⟩ + change K*(200/(n:ℝ)) < δ + have hn : 0 < (n:ℝ) := by exact_mod_cast (show 0 < n by have := C.mesh_large; dsimp [n]; omega) + rw [← mul_div_assoc,div_lt_iff₀ hn] + have h := (div_lt_iff₀ hδ).mp hN + have hNn : (N:ℝ) ≤ n := by exact_mod_cast (le_max_right C.mesh N) + nlinarith + +end ConcurrentGeometry + +theorem rectangularAtlas_fixed_radius_eventually {a m : ℕ} {r : CutRing} {hm : 2 ≤ m} + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] (hlarge : 20 ≤ m+1) + (hr : 0 < ordinary r ∧ ordinary r < 1/2) + (hSlope : 8000 < ordinary (cutTau^a)) (hconj : |conjugate (cutTau^a)| < 1/1000) : + ∃ s : CutRing, 0 < ordinary s ∧ ordinary s < ordinary r/8 ∧ + ∃ L : ℕ, ∀ M : ℕ, L ≤ M → ∀ B : InitialCoverSystem a r m hm M, + ∃ A : B.RectangularAtlas, A.radius=s := by + obtain ⟨s,u,v,hs,hsr,huv,hshort⟩ := exists_symmetric_short_chart a r hr.1 + obtain ⟨k,p,hp⟩ := exists_full_overlap_window a r u + obtain ⟨s₁,hs₁,hs₁'⟩ := exists_cut_between (by linarith : (0:ℝ) < ordinary r/8) + obtain ⟨L₁,hL₁⟩ := coordinate_all_eventually (hm := hm) hlarge hr hSlope hconj + obtain ⟨L₂,hL₂⟩ := tangentChartTables_eventually (hm := hm) hr (by omega) k p u + obtain ⟨L₃,hL₃⟩ := tangentChartTables_eventually (hm := hm) hr (by omega) + (symmetricWindowLength s₁) (symmetricWindowStart s₁) u + refine ⟨s₁,hs₁,hs₁',L₁+L₂+L₃,fun M hM B => ?_⟩ + refine ⟨⟨k,p,u,v,huv,?_,hp,hL₁ M (by omega) B,?_,s₁,hs₁,hs₁',?_⟩,rfl⟩ + · nlinarith + · intro d e z I _ b hb + exact hL₂ M (by omega) B d e z I b hb + · intro d e z I _ b hb + exact hL₃ M (by omega) B d e z I b hb + +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + +structure FinePatchAtlas extends B.PatchAtlas where + far_mesh : (1+|ordinary (cutTau^a)|)*(200/(geometry.mesh:ℝ)) < ordinary rectangles.radius/4 + +end InitialCoverSystem + +theorem finePatchAtlas_eventually {a m : ℕ} {r : CutRing} {hm : 2 ≤ m} + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] (hlarge : 20 ≤ m+1) + (hr : 0 < ordinary r ∧ ordinary r < 1/2) + (hSlope : 8000 < ordinary (cutTau^a)) (hconj : |conjugate (cutTau^a)| < 1/1000) : + ∃ L : ℕ, ∀ M : ℕ, L ≤ M → ∀ B : InitialCoverSystem a r m hm M, + Nonempty B.FinePatchAtlas := by + obtain ⟨s,hs,_hsr,L₁,hL₁⟩ := rectangularAtlas_fixed_radius_eventually (hm := hm) hlarge hr hSlope hconj + obtain ⟨C₀⟩ := concurrentGeometry_exists a r hr.1 + obtain ⟨C,hC⟩ := C₀.exists_finer (1+|ordinary (cutTau^a)|) (ordinary s/4) (by positivity) + obtain ⟨L₂,hL₂⟩ := fixedChartTables_eventually (hm := hm) hr (by omega) + (fun _ : Unit => initialPatchPrimitives r C.mesh) + obtain ⟨L₃,hL₃⟩ := concurrent_chart_tables_eventually (hm := hm) hr (by omega) + C.anchors (fun _ => coordinateWindowPrimitives C.window C.start) + refine ⟨L₁+L₂+L₃,fun M hM B => ?_⟩ + obtain ⟨A,hA⟩ := hL₁ M (by omega) B + refine ⟨{ rectangles := A + geometry := C + initial := fun u I b hb => hL₂ M (by omega) B () u I b hb + concurrent := hL₃ M (by omega) B + far_mesh := ?_ }⟩ + simpa only [hA] using hC + +end FinePatchAtlas + +section FarGridActions + +theorem cutForm_dist_bound (a : ℕ) (j : Fin 4) (x y : ℝ × ℝ) : + |cutForm a j x-cutForm a j y| ≤ (1+|ordinary (cutTau^a)|)*dist x y := by + have hc : 0 ≤ |ordinary (cutTau^a)| *dist x y := mul_nonneg (abs_nonneg _) dist_nonneg + have hslope : ordinary (cutTau^a)=Real.goldenRatio^a := by simp + fin_cases j + · have h := linear_form_dist_bound 1 0 x y + simp only [one_mul,zero_mul,add_zero,abs_one,abs_zero] at h + change |x.1-y.1| ≤ _ + nlinarith + · have h := linear_form_dist_bound 0 1 x y + simp only [one_mul,zero_mul,zero_add,abs_one,abs_zero] at h + change |x.2-y.2| ≤ _ + nlinarith + · have h := linear_form_dist_bound (-Real.goldenRatio^a) 1 x y + change |(x.2-Real.goldenRatio^a*x.1)-(y.2-Real.goldenRatio^a*y.1)| ≤ _ + simpa only [one_mul,neg_mul,sub_eq_add_neg,abs_neg,abs_one,hslope,add_comm] using h + · have h := linear_form_dist_bound 1 (-Real.goldenRatio^a) x y + change |(x.1-Real.goldenRatio^a*x.2)-(y.1-Real.goldenRatio^a*y.2)| ≤ _ + simpa only [one_mul,neg_mul,sub_eq_add_neg,abs_neg,abs_one,hslope] using h + +theorem windowRectangle_far_sign {a : ℕ} (j : Fin 4) + (n : ℕ) (hn : 201 ≤ n) (q : Fin 2 → ℤ) (cell : Fin 2 → Fin n) + (z : ℝ × ℝ) (hz : ∀ d, + ordinary (windowCut n (q d) (cell d).castSucc) ≤ realCoordinate z d ∧ + realCoordinate z d ≤ ordinary (windowCut n (q d) (cell d).succ)) + (c : ℝ) (hfar : (1+|ordinary (cutTau^a)|)*(200/(n:ℝ)) < |cutForm a j z-c|) + (p : GenericSquare a) (hp : p ∈ (windowRectangle a n q cell).val) : + (c ≤ cutForm a j (windowPlanarLift q p)) ↔ c ≤ cutForm a j z := by + have hh := (windowRectangle_mem n hn q cell p).mp hp + have hd := closedWindow_diameter n q cell (windowPlanarLift q p) z + (fun d => ⟨(hh d).1,(hh d).2.le⟩) hz + have hb := (cutForm_dist_bound a j (windowPlanarLift q p) z).trans + (mul_le_mul_of_nonneg_left hd (by positivity)) + by_cases h : c ≤ cutForm a j z + · rw [abs_of_nonneg (sub_nonneg.mpr h)] at hfar + have h' := (abs_le.mp hb).1 + constructor + · intro _; exact h + · intro _; linarith + · have hc : cutForm a j z < c := lt_of_not_ge h + rw [abs_of_neg (sub_neg.mpr hc)] at hfar + have h' := (abs_le.mp hb).2 + exact iff_of_false (by intro hh; linarith) h + +theorem windowRectangle_far_clipped {a : ℕ} (r : CutRing) (j : Fin 4) + (hr : 0 < ordinary r ∧ ordinary r < 1/2) + (n : ℕ) (hn : 201 ≤ n) (q : Fin 2 → ℤ) (cell : Fin 2 → Fin n) + (k : Fin 2 → ℤ) + (hk : ∀ d, -ordinary r ≤ ordinary (windowCut n (q d) (cell d).castSucc)+(k d:ℝ) ∧ + ordinary (windowCut n (q d) (cell d).succ)+(k d:ℝ) ≤ ordinary r) + (z : ℝ × ℝ) (hz : ∀ d, + ordinary (windowCut n (q d) (cell d).castSucc) ≤ realCoordinate z d ∧ + realCoordinate z d ≤ ordinary (windowCut n (q d) (cell d).succ)) + (hfar : (1+|ordinary (cutTau^a)|)*(200/(n:ℝ)) < + |cutForm a j z+cutForm a j ((k 0:ℝ),(k 1:ℝ))|) : + clippedSlopePrimitive a r j ⊓ windowRectangle a n q cell = + if 0 ≤ cutForm a j z+cutForm a j ((k 0:ℝ),(k 1:ℝ)) + then windowRectangle a n q cell else ⊥ := by + classical + apply Subtype.ext + ext p + have hside (hp : p ∈ (windowRectangle a n q cell).val) : + (p ∈ (clippedSlopePrimitive a r j).val) ↔ + 0 ≤ cutForm a j z+cutForm a j ((k 0:ℝ),(k 1:ℝ)) := by + have hf := windowRectangle_far_sign j n hn q cell z hz + (-cutForm a j ((k 0:ℝ),(k 1:ℝ))) (by simpa only [sub_neg_eq_add] using hfar) p hp + have he := windowRectangle_clipped_sign r j hr n hn q cell k hk p hp + change (p ∈ (clippedSlopePrimitive a r j).val) ↔ + 0 ≤ cutForm a j (windowPlanarLift q p+((k 0:ℝ),(k 1:ℝ))) at he + rw [cutForm_add] at he + rw [he,← neg_le_iff_add_nonneg,hf,neg_le_iff_add_nonneg] + by_cases h : 0 ≤ cutForm a j z+cutForm a j ((k 0:ℝ),(k 1:ℝ)) + · simp only [h,↓reduceIte] + change (p ∈ (clippedSlopePrimitive a r j).val ∧ p ∈ (windowRectangle a n q cell).val) ↔ + p ∈ (windowRectangle a n q cell).val + exact ⟨And.right,fun hp => ⟨(hside hp).mpr h,hp⟩⟩ + · simp only [h,↓reduceIte] + change (p ∈ (clippedSlopePrimitive a r j).val ∧ p ∈ (windowRectangle a n q cell).val) ↔ False + exact ⟨fun hp => h ((hside hp.2).mp hp.1),False.elim⟩ + +end FarGridActions + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/FiniteArrangementGerms.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/FiniteArrangementGerms.lean new file mode 100644 index 0000000000000000000000000000000000000000..f8f1dac2f6be4ac44fe99385405e04d73be3f0d9 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/FiniteArrangementGerms.lean @@ -0,0 +1,143 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.PrimitiveGeometricGeneration + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section FiniteArrangementGerms + +theorem exists_interval_avoiding_countable (l r : ℝ) (hlr : l < r) + (S : Set ℝ) (hS : S.Countable) : ∃ x ∈ Set.Ioo l r, x ∉ S := by + apply Set.not_subset.mp + intro h + have := Cardinal.Real.Ioo_countable_iff.mp (hS.mono h) + linarith + +theorem avoidsCuts_rectangle (a : ℕ) (l₁ r₁ l₂ r₂ : ℝ) + (h₁ : l₁ < r₁) (h₂ : l₂ < r₂) : + ∃ p : ℝ × ℝ, p.1 ∈ Set.Ioo l₁ r₁ ∧ p.2 ∈ Set.Ioo l₂ r₂ ∧ AvoidsCuts a p := by + obtain ⟨x, hx, hx'⟩ := exists_interval_avoiding_countable l₁ r₁ h₁ + (Set.range ordinary) (Set.countable_range ordinary) + let t := Real.goldenRatio ^ a + have ht : t ≠ 0 := ne_of_gt (pow_pos Real.goldenRatio_pos a) + let S := Set.range ordinary ∪ Set.range (fun z : CutRing => ordinary z + t*x) ∪ + Set.range (fun z : CutRing => (x - ordinary z)/t) + have hS : S.Countable := ((Set.countable_range ordinary).union + (Set.countable_range _)).union (Set.countable_range _) + obtain ⟨y, hy, hy'⟩ := exists_interval_avoiding_countable l₂ r₂ h₂ S hS + have hav : AvoidsCuts a (x,y) := by + intro j z hz + fin_cases j + · exact hx' ⟨z, by simpa [cutForm] using hz.symm⟩ + · apply hy' + exact Or.inl (Or.inl ⟨z, by simpa [cutForm] using hz.symm⟩) + · apply hy' + apply Or.inl ∘ Or.inr + refine ⟨z, ?_⟩ + change ordinary z + t*x = y + change y - t*x = ordinary z at hz + linarith + · apply hy' + apply Or.inr + refine ⟨z, ?_⟩ + apply (div_eq_iff ht).mpr + change x - t*y = ordinary z at hz + linarith + exact ⟨(x,y),hx,hy,hav⟩ + +theorem avoidsCuts_dense (a : ℕ) : Dense {p : ℝ × ℝ | AvoidsCuts a p} := by + apply dense_iff_inter_open.mpr + intro U hU ⟨z,hz⟩ + obtain ⟨l,h,hl,hsub⟩ := exists_box_in_open hU z hz + obtain ⟨p,hp₁,hp₂,hp⟩ := avoidsCuts_rectangle a + (ordinary l.1) (ordinary h.1) (ordinary l.2) (ordinary h.2) + (hl.1.1.trans hl.1.2) (hl.2.1.trans hl.2.2) + exact ⟨p,hsub ⟨hp₁,hp₂⟩,hp⟩ + +theorem cutForm_smul (a : ℕ) (j : Fin 4) (t : ℝ) (p : ℝ × ℝ) : + cutForm a j (t • p) = t * cutForm a j p := by + fin_cases j <;> simp [cutForm] <;> ring + +def strictLineCell {ι : Type*} (a : ℕ) (j : ι → Fin 4) (c : ι → ℝ) + (σ : ι → Bool) : Set (ℝ × ℝ) := + {p | ∀ i, if σ i then cutForm a (j i) p < c i else c i < cutForm a (j i) p} + +theorem strictLineCell_open {ι : Type*} [Finite ι] (a : ℕ) + (j : ι → Fin 4) (c : ι → ℝ) (σ : ι → Bool) : + IsOpen (strictLineCell a j c σ) := by + classical + have he : strictLineCell a j c σ = ⋂ i, {p | if σ i then cutForm a (j i) p < c i else c i < cutForm a (j i) p} := by + ext p; simp only [strictLineCell,Set.mem_ofPred_eq,Set.mem_iInter] + rw [he] + apply isOpen_iInter_of_finite + intro i + cases σ i + · exact isOpen_lt continuous_const (cutForm_continuous a (j i)) + · exact isOpen_lt (cutForm_continuous a (j i)) continuous_const + +theorem finite_arrangement_germ {ι : Type*} [Finite ι] (a : ℕ) + (j : ι → Fin 4) (c : ι → ℝ) (z y : ℝ × ℝ) (σ : ι → Bool) + (hactive : ∀ i, cutForm a (j i) z=c i → + if σ i then cutForm a (j i) y < c i else c i < cutForm a (j i) y) + (hinactive : ∀ i, cutForm a (j i) z≠c i → + if σ i then cutForm a (j i) z < c i else c i < cutForm a (j i) z) + (N : Set (ℝ × ℝ)) (hN : IsOpen N) (hz : z ∈ N) : + ∃ p ∈ N, p ∈ strictLineCell a j c σ ∧ AvoidsCuts a p := by + classical + let U : Set (ℝ × ℝ) := N ∩ ⋂ i, if cutForm a (j i) z=c i then Set.univ + else {p | if σ i then cutForm a (j i) p < c i else c i < cutForm a (j i) p} + have hU : IsOpen U := by + apply hN.inter + apply isOpen_iInter_of_finite + intro i + by_cases hi : cutForm a (j i) z=c i + · rw [ite_eq_left hi]; exact isOpen_univ + · rw [ite_eq_right hi] + cases σ i + · exact isOpen_lt continuous_const (cutForm_continuous a (j i)) + · exact isOpen_lt (cutForm_continuous a (j i)) continuous_const + have hzU : z ∈ U := by + refine ⟨hz,Set.mem_iInter.mpr fun i => ?_⟩ + by_cases hi : cutForm a (j i) z=c i + · rw [ite_eq_left hi]; trivial + · rw [ite_eq_right hi]; exact hinactive i hi + let ray : ℝ → ℝ × ℝ := fun t => z+t • (y-z) + have hray : Continuous ray := continuous_const.add (continuous_id.smul continuous_const) + have he : ray ⁻¹' U ∈ nhds (0:ℝ) := by + apply hray.continuousAt.preimage_mem_nhds + simpa [ray] using hU.mem_nhds hzU + obtain ⟨ε,hε,hεU⟩ := Metric.mem_nhds_iff.mp he + let t := ε/2 + have ht : 0 simp only [hσ,Bool.false_eq_true,↓reduceIte] at ha ⊢ + · rw [heq]; nlinarith + · rw [heq]; nlinarith + · have hh := Set.mem_iInter.mp htU.2 i + simpa only [ite_eq_right hi,Set.mem_ofPred_eq] using hh + obtain ⟨p,hp,hpg⟩ := (avoidsCuts_dense a).inter_open_nonempty + (N ∩ strictLineCell a j c σ) (hN.inter (strictLineCell_open a j c σ)) + ⟨ray t,htU.1,hcell⟩ + exact ⟨p,hp.1,hp.2,hpg⟩ + +end FiniteArrangementGerms + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/FiniteNestedLaw.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/FiniteNestedLaw.lean new file mode 100644 index 0000000000000000000000000000000000000000..549c6802e7760accbfef0212640eb820c334c7cb --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/FiniteNestedLaw.lean @@ -0,0 +1,236 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.StarAtomLaw +import OAI.GroupTheory.SimpleAmenable.Configurations.SymmetricCharts +import OAI.GroupTheory.SimpleAmenable.CentralCovers.UniformTangentTransport + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section FiniteNestedLaw +variable {E H Q : Type*} [Group E] [Group H] [Group Q] + +theorem prefix_range_le_differences (f : E →* H) (l h : ℕ → E →* H) + (hf : ∀ i s, f s = l i s*h i s) + (hc : ∀ i j, i ≤ j → ∀ s t, Commute (l i s) (h j t)) + (hl : l 0 = 1) (N : ℕ) (j : ℕ) (hj : j ≤ N) : + (l j).range ≤ ⨆ i : Fin N, (cutDifference f l h hf hc i.val).range := by + let K : Subgroup H := ⨆ i : Fin N, (cutDifference f l h hf hc i.val).range + rintro x ⟨s,rfl⟩ + have he := cutDifference_telescope f l h hf hc j s + rw [hl] at he + simp only [MonoidHom.one_apply,inv_one,one_mul] at he + rw [← he] + apply K.list_prod_mem + intro y hy + obtain ⟨i,hi,rfl⟩ := List.mem_map.mp hy + have hi' : i < j := List.mem_range.mp hi + exact (le_iSup (fun i : Fin N => (cutDifference f l h hf hc i.val).range) + ⟨i,by omega⟩) ⟨s,rfl⟩ + +theorem centralOn_of_nested_star_cuts (q : H →* Q) + (N : ℕ) (v : (Fin N → E) →* Q) (hv : Function.Injective v) + (f : UniversalExtension E →* H) (l h : ℕ → UniversalExtension E →* H) + (hf : ∀ i s, f s = l i s*h i s) + (hc : ∀ i j, i ≤ j → ∀ s t, Commute (l i s) (h j t)) + (hl : l 0 = 1) + (hproj : ∀ i : Fin N, q.comp (cutDifference f l h hf hc i.val) = + (v.comp (sectorMask {i})).comp (universalProjection E)) : + CentralOn q (⨆ j : Fin (N+1), (l j.val).range) := by + have hpair : Pairwise fun i j : Fin N => ∀ s t, + Commute (cutDifference f l h hf hc i.val s) (cutDifference f l h hf hc j.val t) := by + intro i j hij s t + rcases lt_or_gt_of_ne hij with hij | hij + · exact cutDifference_pairwise f l h hf hc i.val j.val hij s t + · exact (cutDifference_pairwise f l h hf hc j.val i.val hij t s).symm + have hcentral := centralOn_of_star_atoms q v hv (fun i : Fin N => cutDifference f l h hf hc i.val) hpair hproj + apply hcentral.mono + apply iSup_le + intro j + exact prefix_range_le_differences f l h hf hc hl N j.val (by omega) + +end FiniteNestedLaw + +section CommonContainingWindows + +theorem source_chart_containing_window (n t : ℕ) (p z v : ℤ) (b d : ℕ) + (hv : p ≤ v ∧ v < p+t) + (hz : (z-v).natAbs ≤ d) + (hsize : t+2*d+2*b+2 ≤ n) : + p ⊓ (z-(b:ℤ)) ≤ p ∧ p+t ≤ (p ⊓ (z-(b:ℤ)))+n ∧ + p ⊓ (z-(b:ℤ)) ≤ z-(b:ℤ) ∧ + z-(b:ℤ)+(2*b+2:ℕ) ≤ (p ⊓ (z-(b:ℤ)))+n := by + have hh : |z-v| ≤ (d:ℤ) := by + simpa only [Int.natCast_natAbs] using (show ((z-v).natAbs:ℤ) ≤ (d:ℤ) by exact_mod_cast hz) + have ha := abs_le.mp hh + have hn : (t:ℤ)+2*(d:ℤ)+2*(b:ℤ)+2 ≤ (n:ℤ) := by exact_mod_cast hsize + constructor + · exact inf_le_left + constructor + · rw [min_def] + split_ifs <;> omega + constructor + · exact inf_le_right + · rw [min_def] + split_ifs <;> omega + +theorem fixed_chart_margin_eventually (b : ℕ) : + ∃ N : ℕ, ∀ n : ℕ, N ≤ n → n*9/10+2*b+2 ≤ n := by + refine ⟨20*b+20,?_⟩ + intro n hn + have hh := Nat.mul_div_le (n*9) 10 + omega + +theorem transverse_chart_margin_eventually (b : ℕ) : + ∃ N : ℕ, ∀ n : ℕ, N ≤ n → n/4+2*(n/10+1)+2*b+2 ≤ n := by + refine ⟨20*b+40,?_⟩ + intro n hn + have h₀ := Nat.mul_div_le n 4 + have h₁ := Nat.mul_div_le n 10 + omega + +end CommonContainingWindows + +section QuadrantControl + +def signQuadrantLower (s : CutRing) (d : Fin 2) (positive : Bool) (j : Fin 2) : CutRing := + if positive then (if j=d then -s else 0) else (if j=d then 0 else -s) + +def signQuadrantUpper (s : CutRing) (d : Fin 2) (positive : Bool) (j : Fin 2) : CutRing := + if positive then (if j=d then 0 else s) else (if j=d then s else 0) + +theorem signQuadrant_side {a : ℕ} (r s : CutRing) + (hr : 0 < ordinary r ∧ ordinary r < 1/2) + (hs : 0 < ordinary s ∧ ordinary s < ordinary r) (d : Fin 2) (positive : Bool) : + coordinateRectangle a (signQuadrantLower s d positive) (signQuadrantUpper s d positive) ≤ + if positive then clippedSlopePrimitive a r (slopeDirection d) + else (clippedSlopePrimitive a r (slopeDirection d))ᶜ := by + have hSlope : 0 ≤ Real.goldenRatio^a := pow_nonneg Real.goldenRatio_pos.le _ + cases positive with + | true => + apply coordinateRectangle_sign r (slopeDirection d) hr + · intro j; fin_cases d <;> fin_cases j <;> simp [signQuadrantLower,signQuadrantUpper] <;> linarith [hs.1] + · intro j; fin_cases d <;> fin_cases j <;> simp [signQuadrantLower] <;> linarith [hs.2,hr.1] + · intro j; fin_cases d <;> fin_cases j <;> simp [signQuadrantUpper] <;> linarith [hs.2,hr.1] + · intro t hx hy + fin_cases d + · simp [signQuadrantLower,signQuadrantUpper] at hx hy + change 0 ≤ t.2-Real.goldenRatio^a*t.1 + exact sub_nonneg.mpr ((mul_nonpos_of_nonneg_of_nonpos hSlope hx.2.le).trans hy.1) + · simp [signQuadrantLower,signQuadrantUpper] at hx hy + change 0 ≤ t.1-Real.goldenRatio^a*t.2 + exact sub_nonneg.mpr ((mul_nonpos_of_nonneg_of_nonpos hSlope hy.2.le).trans hx.1) + | false => + apply coordinateRectangle_negative_sign r (slopeDirection d) hr + · intro j; fin_cases d <;> fin_cases j <;> simp [signQuadrantLower,signQuadrantUpper] <;> linarith [hs.1] + · intro j; fin_cases d <;> fin_cases j <;> simp [signQuadrantLower] <;> linarith [hs.2,hr.1] + · intro j; fin_cases d <;> fin_cases j <;> simp [signQuadrantUpper] <;> linarith [hs.2,hr.1] + · intro t hx hy + fin_cases d + · simp [signQuadrantLower,signQuadrantUpper] at hx hy + change t.2-Real.goldenRatio^a*t.1 < 0 + exact sub_neg.mpr (hy.2.trans_le (mul_nonneg hSlope hx.1)) + · simp [signQuadrantLower,signQuadrantUpper] at hx hy + change t.1-Real.goldenRatio^a*t.2 < 0 + exact sub_neg.mpr (hx.2.trans_le (mul_nonneg hSlope hy.1)) + +theorem coordinateRectangle_mono {a : ℕ} (L V l v : Fin 2 → CutRing) + (hL : ∀ j, ordinary (l j) ≤ ordinary (L j)) + (hLV : ∀ j, ordinary (L j) ≤ ordinary (V j)) + (hV : ∀ j, ordinary (V j) ≤ ordinary (v j)) + (hlen : ∀ j, ordinary (v j)-ordinary (l j) < 1) : + coordinateRectangle a L V ≤ coordinateRectangle a l v := by + exact inf_le_inf (coordinateInterval_mono 0 _ _ _ _ (hL 0) (hLV 0) (hV 0) (hlen 0)) + (coordinateInterval_mono 1 _ _ _ _ (hL 1) (hLV 1) (hV 1) (hlen 1)) + +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + +theorem rectangle_control_from_axes (hlarge : 15 < m+1) + (n : ℕ) (g : B.CoordinateWindowLaw n) + (t : Fin 2 → ℕ) (ht : ∀ j, t j ≤ n) (p q : Fin 2 → ℤ) + (hp : ∀ j, q j ≤ p j) (hq : ∀ j, p j+t j ≤ q j+n) + (L V : Fin 2 → CutRing) + (hL : ∀ j, p j ≤ endpointLabel (L j) ∧ endpointLabel (L j) < p j+t j) + (hV : ∀ j, p j ≤ endpointLabel (V j) ∧ endpointLabel (V j) < p j+t j) + (f : TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm)) + (hc : ∀ j, SmallControlled B.c f + (B.axisSector hlarge n g j (t j) (ht j) (p j) (coordinateInterval a j (L j) (V j)))) : + SmallControlled B.c f (B.windowSector hlarge n g q (coordinateRectangle a L V)) := by + have hsmall (j : Fin 2) := axisInterval_resolved (a := a) (r := r) + j (t j) (p j) (L j) (V j) (hL j) (hV j) + have hlargeL (j : Fin 2) : q j ≤ endpointLabel (L j) ∧ endpointLabel (L j) < q j+n := by + have hh := hL j; have hh' := hp j; have hh'' := hq j; omega + have hlargeV (j : Fin 2) : q j ≤ endpointLabel (V j) ∧ endpointLabel (V j) < q j+n := by + have hh := hV j; have hh' := hp j; have hh'' := hq j; omega + have he (j : Fin 2) := B.axisSector_in_window hlarge n g j (t j) (ht j) (p j) q + (hp j) (hq j) (coordinateInterval a j (L j) (V j)) (hsmall j) + change SmallControlled B.c f (B.fullGeometricSector hlarge _ _ + (coordinateInterval a 0 (L 0) (V 0) ⊓ coordinateInterval a 1 (L 1) (V 1))) + apply B.fullGeometricSector_intersection_control hlarge _ _ _ _ + (coordinateInterval_window n q 0 _ _ (hlargeL 0) (hlargeV 0)) + (coordinateInterval_window n q 1 _ _ (hlargeL 1) (hlargeV 1)) f + · change SmallControlled B.c f (B.windowSector hlarge n g q (coordinateInterval a 0 (L 0) (V 0))) + rw [← he 0]; exact hc 0 + · change SmallControlled B.c f (B.windowSector hlarge n g q (coordinateInterval a 1 (L 1) (V 1))) + rw [← he 1]; exact hc 1 + +theorem tangentSign_quadrant_control (hlarge : 20 ≤ m+1) + (hr : 0 < ordinary r ∧ ordinary r < 1/2) + (s u : CutRing) (hs : 0 < ordinary s ∧ ordinary s < ordinary r) + (h : B.TangentChartLaws (symmetricWindowLength s) (symmetricWindowStart s) u) + (n : ℕ) (g : B.CoordinateWindowLaw n) + (t : Fin 2 → ℕ) (ht : ∀ j, t j ≤ n) (p q : Fin 2 → ℤ) + (hp : ∀ j, q j ≤ p j) (hq : ∀ j, p j+t j ≤ q j+n) + (d : Fin 2) (z : CutRing × CutRing) (positive : Bool) + (hstart : ∀ j, q j ≤ pointLabel z j+symmetricWindowStart s j) + (hend : ∀ j, pointLabel z j+symmetricWindowStart s j+symmetricWindowLength s ≤ q j+n) + (L V : Fin 2 → CutRing) + (hLV : ∀ j, ordinary (L j) ≤ ordinary (V j)) + (hL : ∀ j, p j ≤ endpointLabel (L j) ∧ endpointLabel (L j) < p j+t j) + (hV : ∀ j, p j ≤ endpointLabel (V j) ∧ endpointLabel (V j) < p j+t j) + (hlo : ∀ j, ordinary (signQuadrantLower s d positive j)+ordinary (pointCoordinate z j) ≤ ordinary (L j)) + (hup : ∀ j, ordinary (V j) ≤ ordinary (signQuadrantUpper s d positive j)+ordinary (pointCoordinate z j)) + (f : TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm)) + (hf : B.AlignedSmallSupported f) + (hc : ∀ j, SmallControlled B.c f + (B.axisSector (by omega) n g j (t j) (ht j) (p j) (coordinateInterval a j (L j) (V j)))) : + SmallControlled B.c f (B.tangentSign (by omega) (symmetricWindowLength s) + (symmetricWindowStart s) u h d z positive) := by + have hlab (j : Fin 2) : + symmetricWindowStart s j ≤ endpointLabel (signQuadrantLower s d positive j) ∧ + endpointLabel (signQuadrantLower s d positive j) < symmetricWindowStart s j+symmetricWindowLength s := by + unfold signQuadrantLower + split <;> split <;> first | exact (symmetricWindow_labels s j).1 | exact (symmetricWindow_labels s j).2.1 + have hvab (j : Fin 2) : + symmetricWindowStart s j ≤ endpointLabel (signQuadrantUpper s d positive j) ∧ + endpointLabel (signQuadrantUpper s d positive j) < symmetricWindowStart s j+symmetricWindowLength s := by + unfold signQuadrantUpper + split <;> split <;> first | exact (symmetricWindow_labels s j).2.1 | exact (symmetricWindow_labels s j).2.2 + apply B.tangentSign_control_from_rectangle hlarge _ _ u h n g q d z positive hstart hend + _ _ hlab hvab (signQuadrant_side r s hr hs d positive) (coordinateRectangle a L V) ?_ f hf + (B.rectangle_control_from_axes (by omega) n g t ht p q hp hq L V hL hV f hc) + rw [spatialTranslate_coordinateRectangle] + apply coordinateRectangle_mono L V _ _ + · intro j; simpa only [map_add,pointCoordinate] using hlo j + · exact hLV + · intro j; simpa only [map_add,pointCoordinate] using hup j + · intro j + simp only [map_add,add_sub_add_right_eq_sub] + unfold signQuadrantUpper signQuadrantLower + split <;> split <;> simp only [map_zero,map_neg] <;> linarith [hs.2,hr.2] + +end InitialCoverSystem +end QuadrantControl + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/FiniteRefiningGrid.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/FiniteRefiningGrid.lean new file mode 100644 index 0000000000000000000000000000000000000000..5d59c2b1a6d093385838e75feb51aaecb9e45351 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/FiniteRefiningGrid.lean @@ -0,0 +1,193 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.RectangularBound + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section FiniteRefiningGrid +attribute [local instance] cutOrdinaryOrder + +theorem finite_refining_grid (S : Finset CutRing) (n : ℕ) (_hn : 0 ordinary (e i)) ∧ e 0=0 ∧ e (Fin.last N)=1 ∧ + (∀ c ∈ S, cutFraction c ∈ Set.range e) ∧ + (∀ i : Fin (n+1), windowCut n 0 i ∈ Set.range e) := by + classical + let T : Finset CutRing := insert 1 (insert 0 ((S.image cutFraction) ∪ windowEndpointSet n)) + have h0 : (0:CutRing) ∈ T := by simp [T] + have h1 : (1:CutRing) ∈ T := by simp [T] + have hcard : 2 ≤ T.card := by + have hh : ({0,1} : Finset CutRing) ⊆ T := by simp only [Finset.insert_subset_iff,Finset.singleton_subset_iff]; exact ⟨h0,h1⟩ + have hh' := Finset.card_le_card hh + simpa only [Finset.card_insert_of_notMem (by simp : (0:CutRing) ∉ ({1} : Finset CutRing)),Finset.card_singleton] using hh' + let N := T.card-1 + have hN : 0 ordinary (e i))) (i : Fin N) {c : CutRing} + (hc : c ∈ Set.range e) : + ¬(ordinary (e i.castSucc) ordinary (e i))) + (hzero : e 0=0) (hlast : e (Fin.last N)=1) + (hcuts : ∀ j : Fin (n+1), windowCut n 0 j ∈ Set.range e) (i : Fin N) : + ∃ j : Fin n, + ordinary (windowCut n 0 j.castSucc)≤ordinary (e i.castSucc) ∧ + ordinary (e i.succ)≤ordinary (windowCut n 0 j.succ) := by + have h0 : 0≤ordinary (e i.castSucc) := by + have hh := he.monotone (Fin.zero_le i.castSucc); simpa only [hzero,map_zero] using hh + have h1 : ordinary (e i.castSucc)<1 := by + have hh := he (show i.castSucc ordinary (windowCut n 0 j)) (by rwa [hz]) (by rwa [ht]) + refine ⟨j,hj.1,?_⟩ + exact le_of_not_gt (fun h => finite_grid_no_between he i (hcuts j.succ) ⟨hj.2,h⟩) + +end FiniteRefiningGrid + +section RefinementPartition + +theorem coordinateInterval_mem_preferred {a : ℕ} (j : Fin 2) (u v : CutRing) + (hlo : 0≤ordinary u) (huv : ordinary u≤ordinary v) (hup : ordinary v≤1) + (hlen : ordinary v-ordinary u<1) (p : GenericSquare a) : + p ∈ (coordinateInterval a j u v).val ↔ + ordinary u≤coordinate j p ∧ coordinate j p ⟨0,by simpa using h.1,by simpa using h.2⟩ + +noncomputable def refinedGridRectangle (a N : ℕ) (e : Fin (N+1) → CutRing) + (cell : Fin 2 → Fin N) : polygonAlgebra a := + coordinateRectangle a (fun j => e (cell j).castSucc) (fun j => e (cell j).succ) + +theorem refinedGridRectangle_mem {a N : ℕ} (e : Fin (N+1) → CutRing) + (he : StrictMono (fun i => ordinary (e i))) (hzero : e 0=0) (hlast : e (Fin.last N)=1) + (hmesh : ∀ i : Fin N, ordinary (e i.succ)-ordinary (e i.castSucc)<1) + (cell : Fin 2 → Fin N) (p : GenericSquare a) : + p ∈ (refinedGridRectangle a N e cell).val ↔ ∀ j : Fin 2, + ordinary (e (cell j).castSucc)≤coordinate j p ∧ coordinate j p ordinary (e i))) (hzero : e 0=0) (hlast : e (Fin.last N)=1) + (hmesh : ∀ i : Fin N, ordinary (e i.succ)-ordinary (e i.castSucc)<1) + (p : GenericSquare a) : ∃ cell : Fin 2 → Fin N, p ∈ (refinedGridRectangle a N e cell).val := by + have h (j : Fin 2) : ∃ i : Fin N, + ordinary (e i.castSucc)≤coordinate j p ∧ coordinate j p ordinary (e i)) hN (coordinate j p) + (by simpa only [hzero,map_zero] using (coordinate_bounds j p).1) + (by simpa only [hlast,map_one] using (coordinate_bounds j p).2) + choose cell hc using h + exact ⟨cell,(refinedGridRectangle_mem e he hzero hlast hmesh cell p).mpr hc⟩ + +theorem refinedGridRectangle_disjoint {a N : ℕ} (e : Fin (N+1) → CutRing) + (he : StrictMono (fun i => ordinary (e i))) (hzero : e 0=0) (hlast : e (Fin.last N)=1) + (hmesh : ∀ i : Fin N, ordinary (e i.succ)-ordinary (e i.castSucc)<1) : + Pairwise fun i k : Fin 2 → Fin N => Disjoint (refinedGridRectangle a N e i).val + (refinedGridRectangle a N e k).val := by + intro i k hik + obtain ⟨j,hj⟩ := Function.ne_iff.mp hik + apply Set.disjoint_left.mpr + intro p hp hq + have hi := (refinedGridRectangle_mem e he hzero hlast hmesh i p).mp hp j + have hk := (refinedGridRectangle_mem e he hzero hlast hmesh k p).mp hq j + rcases lt_or_gt_of_ne hj with hh | hh + · have hle := he.monotone (show (i j).succ≤(k j).castSucc from by change (i j).val+1≤(k j).val; exact hh) + linarith + · have hle := he.monotone (show (k j).succ≤(i j).castSucc from by change (k j).val+1≤(i j).val; exact hh) + linarith + +theorem refinedGridRectangle_resolved {a N : ℕ} (r : CutRing) (e : Fin (N+1) → CutRing) : + ∃ n : ℕ, ∃ q : Fin 2 → ℤ, ∀ cell : Fin 2 → Fin N, + ResolvedBy (fun i => (InitialCoverSystem.primitiveTests (a := a) (r := r) + (coordinateWindowPrimitives n q) i).val) (refinedGridRectangle a N e cell).val := by + obtain ⟨n,q,hq⟩ := finite_coordinate_windows_container (fun _ : Fin (N+1) => 1) + (fun i _ => endpointLabel (e i)) + have hl (i : Fin (N+1)) (j : Fin 2) : q j≤endpointLabel (e i) ∧ endpointLabel (e i) omega + refine ⟨n,q,fun cell x y hh => ?_⟩ + exact and_congr + (coordinateInterval_window n q 0 _ _ (hl _ 0) (hl _ 0) x y hh) + (coordinateInterval_window n q 1 _ _ (hl _ 1) (hl _ 1) x y hh) + +end RefinementPartition + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/FiniteSectorPartition.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/FiniteSectorPartition.lean new file mode 100644 index 0000000000000000000000000000000000000000..cfab114e6e2f11f9cfe30f90fc0c61e766001d07 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/FiniteSectorPartition.lean @@ -0,0 +1,244 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.CellGeometry + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section FiniteSectorPartition +namespace ActualLawfulTable +variable {E H Q Ω κ : Type*} [Group E] [Group H] [Group Q] [Group.IsPerfect E] + {q : H →* Q} {v : (Ω → E) →* Q} (T : ActualLawfulTable q v) + +theorem sector_range_le_biUnion (W : κ → Set Ω) (S : Finset κ) + (hdisjoint : Pairwise fun i j => Disjoint (W i) (W j)) (K : Subgroup H) + (hK : ∀ i ∈ S, (T.sector (W i)).range ≤ K) : + (T.sector (⋃ i ∈ S, W i)).range ≤ K := by + classical + induction S using Finset.induction_on with + | empty => simp + | @insert i S hi ih => + have hd : Disjoint (W i) (⋃ j ∈ S, W j) := by + apply Set.disjoint_iUnion_right.mpr + intro j + apply Set.disjoint_iUnion_right.mpr + intro hj + exact hdisjoint (by intro he; subst j; exact hi hj) + have he : (⋃ j ∈ insert i S, W j) = W i ∪ ⋃ j ∈ S, W j := by + ext x + simp only [Set.mem_iUnion,Finset.mem_insert,Set.mem_union] + constructor + · rintro ⟨j,(rfl|hj),hx⟩ + · exact Or.inl hx + · exact Or.inr ⟨j,hj,hx⟩ + · rintro (hx|⟨j,hj,hx⟩) + · exact ⟨i,Or.inl rfl,hx⟩ + · exact ⟨j,Or.inr hj,hx⟩ + rw [he,T.sector_union hd] + rintro x ⟨s,rfl⟩ + exact K.mul_mem (hK i (Finset.mem_insert_self i S) ⟨s,rfl⟩) + (ih (fun j hj => hK j (Finset.mem_insert_of_mem hj)) ⟨s,rfl⟩) + +theorem sector_range_le_partition [Fintype κ] (W : κ → Set Ω) (V : Set Ω) + (hdisjoint : Pairwise fun i j => Disjoint (W i) (W j)) + (hcover : ∀ ω, ω ∈ V ↔ ∃ i, ω ∈ W i) : + (T.sector V).range ≤ ⨆ i, (T.sector (W i)).range := by + have he : V = ⋃ i ∈ (Finset.univ : Finset κ), W i := by + ext ω + simpa only [Set.mem_iUnion,Finset.mem_univ,exists_true_left] using hcover ω + rw [he] + exact T.sector_range_le_biUnion W Finset.univ hdisjoint _ + (fun i _ => le_iSup (fun j => (T.sector (W j)).range) i) + +end ActualLawfulTable + +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) {ι κ : Type*} [Finite ι] [Fintype κ] + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + +theorem fullGeometricSector_union (hlarge : 15 < m+1) + (P : ι → Fin 5 × (CutRing × CutRing)) + (h : ∀ I, I.card ≤ 15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb P) + (V W : polygonAlgebra a) + (hV : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) P i).val) V.val) + (hd : Disjoint V.val W.val) (s : TrackStar (Fin (m+1))) : + B.fullGeometricSector hlarge P h (V ⊔ W) s = + B.fullGeometricSector hlarge P h V s * B.fullGeometricSector hlarge P h W s := by + unfold fullGeometricSector + change (B.fullPrimitiveTable hlarge P h).sector (resolvedPolygonMask _ (V.val ∪ W.val)) s = _ + rw [resolvedPolygonMask_union] + exact DFunLike.congr_fun ((B.fullPrimitiveTable hlarge P h).sector_union + (resolvedPolygonMask_disjoint _ hV hd)) s + +theorem fullGeometricSector_partition_range (hlarge : 15 < m+1) + (P : ι → Fin 5 × (CutRing × CutRing)) + (h : ∀ I, I.card ≤ 15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb P) + (V : polygonAlgebra a) (W : κ → polygonAlgebra a) + (hW : ∀ i, ResolvedBy (fun z => (primitiveTests (a := a) (r := r) P z).val) (W i).val) + (hdisjoint : Pairwise fun i j => Disjoint (W i).val (W j).val) + (hcover : ∀ p, p ∈ V.val ↔ ∃ i, p ∈ (W i).val) : + (B.fullGeometricSector hlarge P h V).range ≤ + ⨆ i, (B.fullGeometricSector hlarge P h (W i)).range := by + apply (B.fullPrimitiveTable hlarge P h).sector_range_le_partition + · intro i j hij + exact resolvedPolygonMask_disjoint _ (hW i) (hdisjoint hij) + · intro ω + constructor + · rintro ⟨p,hp,hpV⟩ + obtain ⟨i,hi⟩ := (hcover p).mp hpV + exact ⟨i,p,hp,hi⟩ + · rintro ⟨i,p,hp,hi⟩ + exact ⟨p,hp,(hcover p).mpr ⟨i,hi⟩⟩ + +end InitialCoverSystem + +theorem commute_of_range_iSup {G X Y : Type*} [Group G] [Group X] [Group Y] + {ι κ : Type*} (f : ι → X →* G) (g : κ → Y →* G) + (hc : ∀ i j s t, Commute (f i s) (g j t)) + {x y : G} (hx : x ∈ ⨆ i, (f i).range) (hy : y ∈ ⨆ j, (g j).range) : Commute x y := by + have hleft (j : κ) (t : Y) : (⨆ i, (f i).range) ≤ Subgroup.centralizer {g j t} := by + apply iSup_le + intro i z hz w hw + obtain ⟨s,rfl⟩ := hz + obtain rfl := Set.mem_singleton_iff.mp hw + exact (hc i j s t).eq.symm + have hright : (⨆ j, (g j).range) ≤ Subgroup.centralizer {x} := by + apply iSup_le + intro j z hz w hw + obtain ⟨t,rfl⟩ := hz + obtain rfl := Set.mem_singleton_iff.mp hw + exact (hleft j t hx _ (Set.mem_singleton _)).symm + exact hright hy _ (Set.mem_singleton _) + +end FiniteSectorPartition + +section AxisCellSplitting + +def otherAxis (d : Fin 2) : Fin 2 := if d=0 then 1 else 0 +@[simp] theorem otherAxis_ne (d : Fin 2) : otherAxis d ≠ d := by fin_cases d <;> decide + +noncomputable def axisCellRectangle {n : ℕ} (d : Fin 2) + (k l : ℕ) (hk : k ≤ n) (hl : l ≤ n) (hlpos : 0 < l) + (p q : ℤ) (u v : CutRing) (huv : ordinary u ≤ ordinary v) + (hu : p ≤ endpointLabel u ∧ endpointLabel u < p+k) + (hv : p ≤ endpointLabel v ∧ endpointLabel v < p+k) (i : Fin l) : LabelledRectangle n where + length j := if j=d then k else l + length_le j := by split <;> assumption + start j := if j=d then p else q + lower j := if j=d then u else windowCut l q i.castSucc + upper j := if j=d then v else windowCut l q i.succ + ordered j := by + split + · exact huv + · exact (windowCut_strictMono l q (Fin.castSucc_lt_succ (i := i))).le + lower_label j := by + split_ifs + · exact hu + · exact windowCut_label l q hlpos i.castSucc + upper_label j := by + split_ifs + · exact hv + · exact windowCut_label l q hlpos i.succ + +theorem axisCellRectangle_polygon {a n : ℕ} (d : Fin 2) + (k l : ℕ) (hk : k ≤ n) (hl : l ≤ n) (hlpos : 0 < l) + (p q : ℤ) (u v : CutRing) (huv : ordinary u ≤ ordinary v) + (hu : p ≤ endpointLabel u ∧ endpointLabel u < p+k) + (hv : p ≤ endpointLabel v ∧ endpointLabel v < p+k) (i : Fin l) : + (axisCellRectangle d k l hk hl hlpos p q u v huv hu hv i).polygon a = + coordinateInterval a d u v ⊓ windowCell a (otherAxis d) l q i := by + fin_cases d + · rfl + · change coordinateInterval a 0 _ _ ⊓ coordinateInterval a 1 u v = + coordinateInterval a 1 u v ⊓ coordinateInterval a 0 _ _ + exact inf_comm _ _ + +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + +theorem axisSector_range_cells (hlarge : 15 < m+1) (n : ℕ) (g : B.CoordinateWindowLaw n) + (d : Fin 2) (k l : ℕ) (hk : k ≤ n) (hl : l ≤ n) (hlpos : 201 ≤ l) + (p q : ℤ) (u v : CutRing) (huv : ordinary u ≤ ordinary v) + (hu : p ≤ endpointLabel u ∧ endpointLabel u < p+k) + (hv : p ≤ endpointLabel v ∧ endpointLabel v < p+k) : + (B.axisSector hlarge n g d k hk p (coordinateInterval a d u v)).range ≤ + ⨆ i : Fin l, (B.rectangleCopy hlarge g + (axisCellRectangle d k l hk hl (by omega) p q u v huv hu hv i)).range := by + let R := axisCellRectangle d k l hk hl (by omega) p q u v huv hu hv + let z : Fin 2 → ℤ := fun j => if j=d then p else q + rw [B.axisSector_in_window hlarge n g d k hk p z + (by simp [z]) (by simp [z]; omega) _ (axisInterval_resolved d k p u v hu hv)] + change (B.fullGeometricSector hlarge (coordinateWindowPrimitives n z) _ _).range ≤ _ + apply B.fullGeometricSector_partition_range hlarge (coordinateWindowPrimitives n z) + (fun I _ b hb => g I b hb z) (coordinateInterval a d u v) (fun i => (R i).polygon a) + · intro i + exact (R i).resolved a r + · intro i j hij + rw [axisCellRectangle_polygon,axisCellRectangle_polygon] + exact (windowCell_pairwise_disjoint (a := a) (otherAxis d) l hlpos q hij).mono + (Set.inter_subset_right) (Set.inter_subset_right) + · intro x + constructor + · intro hx + obtain ⟨i,hi⟩ := windowCell_cover (a := a) (otherAxis d) l hlpos q x + refine ⟨i,?_⟩ + rw [axisCellRectangle_polygon] + exact ⟨hx,hi⟩ + · rintro ⟨i,hi⟩ + rw [axisCellRectangle_polygon] at hi + exact hi.1 + +theorem axisCellRectangle_grid_control (hlarge : 15 < m+1) (n : ℕ) (g : B.CoordinateWindowLaw n) + (d : Fin 2) (k l : ℕ) (hk : k ≤ n) (hl : l ≤ n) (hlpos : 0 < l) + (p q : ℤ) (u v : CutRing) (huv : ordinary u ≤ ordinary v) + (hu : p ≤ endpointLabel u ∧ endpointLabel u < p+k) + (hv : p ≤ endpointLabel v ∧ endpointLabel v < p+k) (i : Fin l) : + SmallControlled B.c (B.rectangleCopy hlarge g + (axisCellRectangle d k l hk hl hlpos p q u v huv hu hv i)) + (B.axisSector hlarge n g (otherAxis d) l hl q (windowCell a (otherAxis d) l q i)) := by + simpa only [axisCellRectangle,otherAxis_ne,ite_false,windowCell] using + B.rectangleCopy_axes_control hlarge g + (axisCellRectangle d k l hk hl hlpos p q u v huv hu hv i) (otherAxis d) + +theorem axisCellRectangle_distinct_commute (hlarge : 20 ≤ m+1) (n : ℕ) (g : B.CoordinateWindowLaw n) + (d : Fin 2) (k k' l : ℕ) (hk : k ≤ n) (hk' : k' ≤ n) (hl : l ≤ n) (hlpos : 201 ≤ l) + (p p' q : ℤ) (u v u' v' : CutRing) + (huv : ordinary u ≤ ordinary v) (huv' : ordinary u' ≤ ordinary v') + (hu : p ≤ endpointLabel u ∧ endpointLabel u < p+k) + (hv : p ≤ endpointLabel v ∧ endpointLabel v < p+k) + (hu' : p' ≤ endpointLabel u' ∧ endpointLabel u' < p'+k') + (hv' : p' ≤ endpointLabel v' ∧ endpointLabel v' < p'+k') + (i j : Fin l) (hij : i ≠ j) (s t : TrackStar (Fin (m+1))) : + Commute (B.rectangleCopy (by omega) g (axisCellRectangle d k l hk hl (by omega) p q u v huv hu hv i) s) + (B.rectangleCopy (by omega) g (axisCellRectangle d k' l hk' hl (by omega) p' q u' v' huv' hu' hv' j) t) := by + let R := axisCellRectangle d k l hk hl (by omega) p q u v huv hu hv i + let R' := axisCellRectangle d k' l hk' hl (by omega) p' q u' v' huv' hu' hv' j + refine (small_control_disjoint _ B.c B.constant_aligned B.disjoint_aligned + (by simpa using hlarge) (B.rectangleCopy (by omega) g R) (B.rectangleCopy (by omega) g R') + (B.axisSector (by omega) n g (otherAxis d) l hl q (windowCell a (otherAxis d) l q i)) + (B.axisSector (by omega) n g (otherAxis d) l hl q (windowCell a (otherAxis d) l q j)) + (B.rectangleCopy_supported (by omega) g R) (B.rectangleCopy_supported (by omega) g R') + (B.axisSector_supported (by omega) n g (otherAxis d) l hl q _ + (windowCell_axis_resolved _ _ (by omega) _ _)) + (B.axisCellRectangle_grid_control (by omega) n g d k l hk hl (by omega) p q u v huv hu hv i) + (B.axisCellRectangle_grid_control (by omega) n g d k' l hk' hl (by omega) p' q u' v' huv' hu' hv' j) ?_) s t + intro x y + exact B.fullGeometricSector_commute (by omega) (axisWindowPrimitives (otherAxis d) l q) _ _ _ + (windowCell_axis_resolved _ _ (by omega) _ _) + (windowCell_pairwise_disjoint (otherAxis d) l hlpos q hij) x y + +end InitialCoverSystem +end AxisCellSplitting + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/FixedChartTables.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/FixedChartTables.lean new file mode 100644 index 0000000000000000000000000000000000000000..08a7e8fadebc77d78156f9e704fd08cb438309b3 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/FixedChartTables.lean @@ -0,0 +1,35 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.RandomFields.PrimitiveCovariance + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section FixedChartTables + +theorem fixedChartTables_eventually {a m : ℕ} {r : CutRing} {hm : 2 ≤ m} + {η : Type*} [Finite η] {ι : η → Type*} [∀ z, Finite (ι z)] + (hr : 0 < ordinary r ∧ ordinary r < 1/2) (hm' : 15 ≤ m+1) + (P : (z : η) → ι z → Fin 5 × (CutRing × CutRing)) : + ∃ L : ℕ, ∀ M : ℕ, L ≤ M → ∀ B : InitialCoverSystem a r m hm M, + ∀ z u I b hb, B.PrimitiveFamilyLaw I b hb (fun i => ((P z i).1,u+(P z i).2)) := by + classical + let Z := Σ (_ : η), Σ (I : Finset (Fin (m+1))), {b : Fin (m+1) // b ∉ I} + have he (z : Z) := primitiveFamilyLaw_eventually (a := a) (hm := hm) hr hm' + z.2.1 z.2.2.val z.2.2.property (P z.1) + choose L hL using he + let _ := Fintype.ofFinite Z + refine ⟨Finset.univ.sup L,fun M hM B z u I b hb => ?_⟩ + apply InitialCoverSystem.PrimitiveFamilyLaw.translate B I b hb (P z) _ u + exact hL ⟨z,I,⟨b,hb⟩⟩ M ((Finset.le_sup (f := L) (Finset.mem_univ _)).trans hM) B +end FixedChartTables + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/FlagArrangementControl.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/FlagArrangementControl.lean new file mode 100644 index 0000000000000000000000000000000000000000..d110d54c59014b774a844094b92125c8655f79e9 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/FlagArrangementControl.lean @@ -0,0 +1,185 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.FlagSites +import OAI.GroupTheory.SimpleAmenable.RandomFields.UniformThresholdCDF + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section FlagArrangementControl +open Classical MeasureTheory + +theorem flagValue_arrangement {a : ℕ} {v : ℝ×ℝ} {K : Type*} + (f : GenericSquare a → K) (S : Finset PlaneCut) + (hS : ∀p q,(∀l∈S,squareSign l p=squareSign l q) → f p=f q) + (z w : SquareFlag a v) + (hs : ∀l∈S,¬ FlagSeparates l.1 l.2 z w) : + flagValue f ⟨S,hS⟩ z=flagValue f ⟨S,hS⟩ w := by + obtain ⟨N,hN,hz,hf⟩ := flagValue_spec f ⟨S,hS⟩ z + obtain ⟨M,hM,hw,hg⟩ := flagValue_spec f ⟨S,hS⟩ w + obtain ⟨p,hp,hpv⟩ := squareSector_generic z (hN.inter (arrangementNeighborhood_open a S z.val)) + ⟨hz,self_mem_arrangementNeighborhood a S z.val⟩ + obtain ⟨q,hq,hqv⟩ := squareSector_generic w (hM.inter (arrangementNeighborhood_open a S w.val)) + ⟨hw,self_mem_arrangementNeighborhood a S w.val⟩ + rw [← hf p hp.1 hpv,← hg q hq.1 hqv] + apply hS p q + intro l hl + have h₁ := planeSign_neighborhood (p:=⟨p.val,p.property.2.2⟩) hp.2 hpv hl + have h₂ := planeSign_neighborhood (p:=⟨q.val,q.property.2.2⟩) hq.2 hqv hl + change squareSign l p=_ at h₁ + change squareSign l q=_ at h₂ + rw [h₁,h₂] + apply decide_eq_decide.mpr + have h := not_not.mp (hs l hl) + simpa only [flagMem_halfPlane] using h + +theorem flagMem_arrangement {a : ℕ} {v : ℝ×ℝ} (U : polygonAlgebra a) : + ∃S : Finset PlaneCut,∀z w : SquareFlag a v, + (∀l∈S,¬ FlagSeparates l.1 l.2 z w) → (flagMem U z ↔ flagMem U w) := by + obtain ⟨S,hS⟩ := polygon_hasSquareArrangement U.property + refine ⟨S,fun z w h => ?_⟩ + unfold flagMem + rw [flagValue_arrangement (fun p => decide (p∈U.val)) S hS z w h] + +theorem separatorMatrix_zero_of_cut {a : ℕ} {v : ℝ×ℝ} + {s κ : ℝ} (hs : 0 < s) (hκ : 0 < κ) (z w : SquareFlag a v) + (j : Fin 4) (c : CutRing) (hc : FlagSeparates j c z w) + (hcut : |conjugate c| ≤ κ/s) : + separatorMatrix (thresholdLaw s κ) z w=0 := by + obtain ⟨d,hd,hdmin⟩ := flagSeparates_exists_min j z w ⟨c,hc⟩ + have h : κ/s < 2*κ/s := (div_lt_div_iff_of_pos_right hs).mpr (by linarith) + have hd' : |conjugate d| ≤ κ/s := (hdmin c hc).trans hcut + have hp : directionNoCutProbability s κ j z w=0 := by + rw [directionNoCutProbability,directionNoCut_of_min j z w d hd hdmin, + uniformInterval_Iio h,intervalCDF] + rw [max_eq_right (by linarith [min_le_right (2*κ/s) |conjugate d|]),zero_div] + rw [separatorMatrix_product hs hκ] + exact Finset.prod_eq_zero (Finset.mem_univ j) hp + +theorem separatorMatrix_ne_zero_signs {a : ℕ} {v : ℝ×ℝ} + {s κ : ℝ} (hs : 0 < s) (hκ : 0 < κ) (S : Finset PlaneCut) + (hS : ∀l∈S,|conjugate l.2| ≤ κ/s) (z w : SquareFlag a v) + (hp : separatorMatrix (thresholdLaw s κ) z w ≠ 0) : + ∀l∈S,¬ FlagSeparates l.1 l.2 z w := by + intro l hl hsep + exact hp (separatorMatrix_zero_of_cut hs hκ z w l.1 l.2 hsep (hS l hl)) + +theorem separatorMatrix_controls_step {a : ℕ} {v : ℝ×ℝ} {K : Type*} + (f : GenericSquare a → K) (hf : HasSquareArrangement f) : + ∃R : ℝ, 0 ≤ R ∧ ∀(s κ : ℝ),0 < s → 0 < κ → R ≤ κ/s → + ∀z w : SquareFlag a v,separatorMatrix (thresholdLaw s κ) z w ≠ 0 → + flagValue f hf z=flagValue f hf w := by + obtain ⟨S,hS⟩ := hf + let R := ∑l∈S,|conjugate l.2| + have hR : 0 ≤ R := Finset.sum_nonneg (fun _ _ => abs_nonneg _) + refine ⟨R,hR,fun s κ hs hκ hRs z w hp => ?_⟩ + apply flagValue_arrangement f S hS z w + apply separatorMatrix_ne_zero_signs hs hκ S _ z w hp + intro l hl + exact (Finset.single_le_sum (fun _ _ => abs_nonneg _) hl).trans hRs + +end FlagArrangementControl + +section SquareAffineCharts +open Classical + +theorem floor_add_unit {x : ℝ} (hx₀ : 0 ≤ x) (hx₁ : x < 1) (y : ℝ) : + ⌊x+y⌋ = ⌊y⌋ + if x < 1-Int.fract y then 0 else 1 := by + have hy₀ := Int.floor_le y + have hy₁ := Int.lt_floor_add_one y + by_cases h : x < 1-Int.fract y + · rw [ite_eq_left h,add_zero] + simp only [Int.fract] at h + apply Int.floor_eq_iff.mpr + constructor <;> linarith + · rw [ite_eq_right h] + simp only [Int.fract] at h + apply Int.floor_eq_iff.mpr + push_cast + constructor <;> linarith + +noncomputable def squareTranslationPeriod {a : ℕ} (u : CutRing×CutRing) + (p : GenericSquare a) : ℤ×ℤ := + (⌊p.val.1+ordinary u.1⌋,⌊p.val.2+ordinary u.2⌋) + +theorem squareTranslationPeriod_arrangement {a : ℕ} (u : CutRing×CutRing) : + HasSquareArrangement (squareTranslationPeriod (a:=a) u) := by + let c₁ : CutRing := (⌊ordinary u.1⌋:CutRing)+1-u.1 + let c₂ : CutRing := (⌊ordinary u.2⌋:CutRing)+1-u.2 + have hc₁ : ordinary c₁=1-Int.fract (ordinary u.1) := by simp only [c₁,map_sub,map_add,map_intCast,map_one,Int.fract]; ring + have hc₂ : ordinary c₂=1-Int.fract (ordinary u.2) := by simp only [c₂,map_sub,map_add,map_intCast,map_one,Int.fract]; ring + refine ⟨{(0,c₁),(1,c₂)},fun p q h => ?_⟩ + have h₁ := decide_eq_decide.mp (h (0,c₁) (by simp)) + have h₂ := decide_eq_decide.mp (h (1,c₂) (by simp)) + change (p.val.1 simp only [flagTranslate_val,flagFract_eq,b,t,k,flagShiftPeriod,SquareStep.intPair, + Prod.fst_sub,Prod.snd_sub,Prod.fst_add,Prod.snd_add,map_sub,map_intCast] <;> ring + let M : Set (ℝ×ℝ) := (fun p => p+b) ⁻¹' arrangementNeighborhood a SquareStep.squareEdgeCuts (flagTranslate u z).val + refine ⟨M,(arrangementNeighborhood_open _ _ _).preimage (continuous_id.add continuous_const),?_,fun p hp hpv => ?_⟩ + · change z.val+b ∈ arrangementNeighborhood a SquareStep.squareEdgeCuts (flagTranslate u z).val + rw [← hbase] + exact self_mem_arrangementNeighborhood _ _ _ + · let q : GenericPlane a := GenericPlane.shift t ⟨p.val,p.property.2.2⟩ + have hqv : q.val ∈ planeSector a (flagTranslate u z).val v := by + rw [hbase] + exact (planeSector_add_iff z.val v b p.val).mpr hpv + have hpq : q.val ∈ arrangementNeighborhood a SquareStep.squareEdgeCuts (flagTranslate u z).val := hp + have hqs := sector_enters_square (flagTranslate u z).property.2 hpq hqv + have hx : 0 ≤ p.val.1+ordinary u.1-(k.1:ℝ) ∧ p.val.1+ordinary u.1-(k.1:ℝ) < 1 := by + simpa only [q,GenericPlane.shift,t,SquareStep.intPair,Prod.fst_add,Prod.fst_sub,map_sub,map_intCast,← add_sub_assoc,Set.mem_Ico] using hqs.1 + have hy : 0 ≤ p.val.2+ordinary u.2-(k.2:ℝ) ∧ p.val.2+ordinary u.2-(k.2:ℝ) < 1 := by + simpa only [q,GenericPlane.shift,t,SquareStep.intPair,Prod.snd_add,Prod.snd_sub,map_sub,map_intCast,← add_sub_assoc,Set.mem_Ico] using hqs.2 + apply Prod.ext + · exact Int.floor_eq_iff.mpr ⟨by linarith [hx.1],by linarith [hx.2]⟩ + · exact Int.floor_eq_iff.mpr ⟨by linarith [hy.1],by linarith [hy.2]⟩ + +theorem squareTranslationPeriod_flagValue {a : ℕ} {v : ℝ×ℝ} + (u : CutRing×CutRing) (z : SquareFlag a v) : + flagValue (squareTranslationPeriod u) (squareTranslationPeriod_arrangement u) z=flagShiftPeriod u z := + flagValue_eq _ _ _ (squareTranslationPeriod_germ u z) + +theorem squareArrangement_pair {a : ℕ} {K J : Type*} {f : GenericSquare a → K} {g : GenericSquare a → J} + (hf : HasSquareArrangement f) (hg : HasSquareArrangement g) : + HasSquareArrangement (fun p => (f p,g p)) := by + obtain ⟨S,hS⟩ := hf + obtain ⟨T,hT⟩ := hg + refine ⟨S∪T,fun p q h => Prod.ext (hS p q (fun l hl => h l (Finset.mem_union_left _ hl))) + (hT p q (fun l hl => h l (Finset.mem_union_right _ hl)))⟩ + +theorem squareArrangement_finite_family {a : ℕ} {ι K : Type*} [Finite ι] + (f : ι → GenericSquare a → K) (hf : ∀i,HasSquareArrangement (f i)) : + HasSquareArrangement (fun p i => f i p) := by + let := Fintype.ofFinite ι + choose S hS using hf + refine ⟨Finset.univ.biUnion S,fun p q h => funext (fun i => hS i p q (fun l hl => ?_))⟩ + exact h l (Finset.mem_biUnion.mpr ⟨i,Finset.mem_univ _,hl⟩) + +end SquareAffineCharts + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/FlagGerms.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/FlagGerms.lean new file mode 100644 index 0000000000000000000000000000000000000000..7cfd7aab8296eaed0172ef04cd5ecdbbe75e959d --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/FlagGerms.lean @@ -0,0 +1,215 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.TorusStepFunctions + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section FlagGerms +open Classical + +def FlagDirections (a : ℕ) (v w : ℝ × ℝ) : Prop := + ∀ j : Fin 4, cutForm a j v ≠ 0 ∨ cutForm a j w ≠ 0 + +theorem flagDirections_sector {a : ℕ} {v w : ℝ×ℝ} (h : FlagDirections a v w) : + ∃ d : ℝ×ℝ, TransverseDirection a d ∧ ∀ j, + (cutForm a j d<0 ↔ if cutForm a j v=0 then cutForm a j w<0 else cutForm a j v<0) := by + let σ : Fin 4 → Bool := fun j => + decide (if cutForm a j v=0 then cutForm a j w<0 else cutForm a j v<0) + have ha (j : Fin 4) (hj : cutForm a j v=0) : + if σ j then cutForm a j (v+w)<0 else 0 0) v (v+w) σ + ha hi Set.univ isOpen_univ (Set.mem_univ _) + refine ⟨d,fun j => ?_,fun j => ?_⟩ + · simpa using hg j 0 + · have hh := hd j + by_cases ht : if cutForm a j v=0 then cutForm a j w<0 else cutForm a j v<0 + · simpa [σ,ht] using hh + · have hh' : 0 hS q p ?_⟩ + intro l hl + exact (planeSign_neighborhood (p:=⟨q.val,q.property.2.2⟩) hq hqv hl).trans + (planeSign_neighborhood (p:=⟨p.val,p.property.2.2⟩) hp hpv hl).symm + +theorem IsSquareGerm.unique {a : ℕ} {v : ℝ×ℝ} {K : Type*} + {f : GenericSquare a → K} {z : SquareFlag a v} {c d : K} + (hc : IsSquareGerm f z c) (hd : IsSquareGerm f z d) : c=d := by + obtain ⟨N,hN,hz,hc⟩ := hc + obtain ⟨M,hM,hz',hd⟩ := hd + obtain ⟨p,hp,hpv⟩ := squareSector_generic z (hN.inter hM) ⟨hz,hz'⟩ + exact (hc p hp.1 hpv).symm.trans (hd p hp.2 hpv) + +noncomputable def flagValue {a : ℕ} {v : ℝ×ℝ} {K : Type*} + (f : GenericSquare a → K) (hf : HasSquareArrangement f) (z : SquareFlag a v) : K := + Classical.choose (exists_squareGerm f hf z) + +theorem flagValue_spec {a : ℕ} {v : ℝ×ℝ} {K : Type*} + (f : GenericSquare a → K) (hf : HasSquareArrangement f) (z : SquareFlag a v) : + IsSquareGerm f z (flagValue f hf z) := Classical.choose_spec (exists_squareGerm f hf z) + +theorem flagValue_eq {a : ℕ} {v : ℝ×ℝ} {K : Type*} + (f : GenericSquare a → K) (hf : HasSquareArrangement f) (z : SquareFlag a v) + {c : K} (hc : IsSquareGerm f z c) : flagValue f hf z=c := (flagValue_spec f hf z).unique hc + +theorem flagValue_map {a : ℕ} {v : ℝ×ℝ} {K J : Type*} + (f : GenericSquare a → K) (hf : HasSquareArrangement f) (t : K → J) + (ht : HasSquareArrangement (t ∘ f)) (z : SquareFlag a v) : + flagValue (t ∘ f) ht z=t (flagValue f hf z) := by + obtain ⟨N,hN,hz,hf'⟩ := flagValue_spec f hf z + exact flagValue_eq _ _ _ ⟨N,hN,hz,fun p hp hpv => congrArg t (hf' p hp hpv)⟩ + +theorem flagValue_finite {a : ℕ} {v : ℝ×ℝ} {ι K : Type*} [Finite ι] + (f : ι → GenericSquare a → K) (hf : ∀ i, HasSquareArrangement (f i)) + (z : SquareFlag a v) {N : Set (ℝ×ℝ)} (hN : IsOpen N) (hz : z.val∈N) : + ∃ p : GenericSquare a, p.val∈N ∧ p.val∈planeSector a z.val v ∧ + ∀ i, f i p=flagValue (f i) (hf i) z := by + choose M hM hzM hfg using fun i => flagValue_spec (f i) (hf i) z + obtain ⟨p,hp,hpv⟩ := squareSector_generic z + (hN.inter (isOpen_iInter_of_finite hM)) ⟨hz,Set.mem_iInter.mpr hzM⟩ + exact ⟨p,hp.1,hpv,fun i => hfg i p (Set.mem_iInter.mp hp.2 i) hpv⟩ + +noncomputable def flagMem {a : ℕ} {v : ℝ×ℝ} (U : polygonAlgebra a) + (z : SquareFlag a v) : Prop := + flagValue (fun p => decide (p∈U.val)) (polygon_hasSquareArrangement U.property) z=true + +theorem flagMem_iff {a : ℕ} {v : ℝ×ℝ} (U : polygonAlgebra a) (z : SquareFlag a v) : + ∃ N : Set (ℝ×ℝ), IsOpen N ∧ z.val∈N ∧ + ∀ p : GenericSquare a, p.val∈N → p.val∈planeSector a z.val v → + (p∈U.val ↔ flagMem U z) := by + obtain ⟨N,hN,hz,hf⟩ := flagValue_spec (fun p => decide (p∈U.val)) + (polygon_hasSquareArrangement U.property) z + refine ⟨N,hN,hz,fun p hp hpv => ?_⟩ + unfold flagMem + rw [← hf p hp hpv] + simp + +@[simp] theorem flagMem_bot {a : ℕ} {v : ℝ×ℝ} (z : SquareFlag a v) : + ¬flagMem (⊥ : polygonAlgebra a) z := by + have h := flagValue_eq (fun p : GenericSquare a => decide (p∈(⊥ : polygonAlgebra a).val)) + (polygon_hasSquareArrangement (⊥ : polygonAlgebra a).property) z + (c:=false) ⟨Set.univ,isOpen_univ,Set.mem_univ _,fun _ _ _ => by simp⟩ + intro hm + exact Bool.false_ne_true (h.symm.trans hm) + +theorem flagMem_sup {a : ℕ} {v : ℝ×ℝ} (U V : polygonAlgebra a) (z : SquareFlag a v) : + flagMem (U⊔V) z ↔ flagMem U z ∨ flagMem V z := by + obtain ⟨N,hN,hz,h⟩ := flagMem_iff (U⊔V) z + obtain ⟨M,hM,hz',h'⟩ := flagMem_iff U z + obtain ⟨L,hL,hz'',h''⟩ := flagMem_iff V z + obtain ⟨p,hp,hpv⟩ := squareSector_generic z ((hN.inter hM).inter hL) ⟨⟨hz,hz'⟩,hz''⟩ + rw [← h p hp.1.1 hpv,← h' p hp.1.2 hpv,← h'' p hp.2 hpv] + rfl + +theorem flagMem_compl {a : ℕ} {v : ℝ×ℝ} (U : polygonAlgebra a) (z : SquareFlag a v) : + flagMem Uᶜ z ↔ ¬flagMem U z := by + obtain ⟨N,hN,hz,h⟩ := flagMem_iff Uᶜ z + obtain ⟨M,hM,hz',h'⟩ := flagMem_iff U z + obtain ⟨p,hp,hpv⟩ := squareSector_generic z (hN.inter hM) ⟨hz,hz'⟩ + rw [← h p hp.1 hpv,← h' p hp.2 hpv] + rfl + +theorem flagMem_halfPlane {a : ℕ} {v : ℝ×ℝ} (j : Fin 4) (c : CutRing) + (z : SquareFlag a v) : + flagMem ⟨halfPlane a j c,halfPlane_mem a j c⟩ z ↔ + (if cutForm a j z.val=ordinary c then cutForm a j v<0 + else cutForm a j z.val decide (p∈U.val)) + (polygon_hasSquareArrangement U.property) z = + decide (if cutForm a j z.val=ordinary c then cutForm a j v<0 + else cutForm a j z.val ?_⟩ + exact planeSign_neighborhood (p:=⟨p.val,p.property.2.2⟩) hp hpv (Finset.mem_singleton_self _) + change flagValue _ _ z=true ↔ _ + rw [hg] + simp + +end FlagGerms + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/FlagSeparatingLevels.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/FlagSeparatingLevels.lean new file mode 100644 index 0000000000000000000000000000000000000000..0068e9e5026c2f427fec3e326e148fa37ad7ecc8 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/FlagSeparatingLevels.lean @@ -0,0 +1,110 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.FlagGerms +import OAI.GroupTheory.SimpleAmenable.Arithmetic.QuadraticRectangleCounts + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section FlagSeparatingLevels +open Classical + +def FlagSeparates {a : ℕ} {v : ℝ×ℝ} (j : Fin 4) (c : CutRing) + (z w : SquareFlag a v) : Prop := + ¬ (flagMem ⟨halfPlane a j c,halfPlane_mem a j c⟩ z ↔ + flagMem ⟨halfPlane a j c,halfPlane_mem a j c⟩ w) + +theorem flagSeparates_ordinary_bound {a : ℕ} {v : ℝ×ℝ} {j : Fin 4} {c : CutRing} + {z w : SquareFlag a v} (h : FlagSeparates j c z w) : + ordinary c ∈ Set.Icc (min (cutForm a j z.val) (cutForm a j w.val)) + (max (cutForm a j z.val) (cutForm a j w.val)) := by + unfold FlagSeparates at h + simp only [flagMem_halfPlane] at h + constructor + · by_contra hn + have hz : ordinary c < cutForm a j z.val := lt_of_lt_of_le (lt_of_not_ge hn) (min_le_left _ _) + have hw : ordinary c < cutForm a j w.val := lt_of_lt_of_le (lt_of_not_ge hn) (min_le_right _ _) + simp [ne_of_gt hz,ne_of_gt hw,not_lt_of_ge hz.le,not_lt_of_ge hw.le] at h + · by_contra hn + have hz : cutForm a j z.val < ordinary c := lt_of_le_of_lt (le_max_left _ _) (lt_of_not_ge hn) + have hw : cutForm a j w.val < ordinary c := lt_of_le_of_lt (le_max_right _ _) (lt_of_not_ge hn) + simp [ne_of_lt hz,ne_of_lt hw,hz,hw] at h + +theorem flagSeparates_bounded_finite {a : ℕ} {v : ℝ×ℝ} (j : Fin 4) + (z w : SquareFlag a v) (R : ℝ) : + {c : CutRing | FlagSeparates j c z w ∧ |conjugate c| ≤ R}.Finite := by + let b := |R|+1 + have hb : 0 < b := by dsimp [b]; positivity + let x := min (cutForm a j z.val) (cutForm a j w.val) + let y := max (cutForm a j z.val) (cutForm a j w.val) + apply (cutRectangle_finite x (-b) (y-x) (2*b) (by positivity)).subset + intro c hc + have ho := flagSeparates_ordinary_bound hc.1 + have ht := abs_le.mp hc.2 + change _ ∧ _ + constructor + · simpa [x,y] using ho + · constructor <;> dsimp [b] <;> linarith [le_abs_self R] + +theorem flagSeparates_exists_min {a : ℕ} {v : ℝ×ℝ} (j : Fin 4) + (z w : SquareFlag a v) (h : ∃ c,FlagSeparates j c z w) : + ∃ c,FlagSeparates j c z w ∧ ∀ d,FlagSeparates j d z w → + |conjugate c| ≤ |conjugate d| := by + obtain ⟨c,hc⟩ := h + let S : Set CutRing := {d : CutRing | FlagSeparates j d z w ∧ |conjugate d| ≤ |conjugate c|} + have hS : S.Finite := flagSeparates_bounded_finite j z w _ + have hn : S.Nonempty := ⟨c,hc,le_rfl⟩ + obtain ⟨d,hd,hmin⟩ := Set.exists_min_image S (fun e => |conjugate e|) hS hn + refine ⟨d,hd.1,fun e he => ?_⟩ + by_cases hec : |conjugate e| ≤ |conjugate c| + · exact hmin e ⟨he,hec⟩ + · exact hd.2.trans (le_of_not_ge hec) + +theorem flagMem_halfPlane_local_translation {a : ℕ} {v : ℝ×ℝ} + (u : CutRing×CutRing) (j : Fin 4) (c : CutRing) (z z' : SquareFlag a v) + (hz : z'.val=z.val+(ordinary u.1,ordinary u.2)) : + flagMem ⟨halfPlane a j (c+integralCutForm a j u),halfPlane_mem _ _ _⟩ z' ↔ + flagMem ⟨halfPlane a j c,halfPlane_mem _ _ _⟩ z := by + rw [flagMem_halfPlane,flagMem_halfPlane,hz,cutForm_add,cutForm_ordinary,map_add] + simp only [add_left_inj,add_lt_add_iff_right] + +theorem flagSeparates_local_translation {a : ℕ} {v : ℝ×ℝ} + (u : CutRing×CutRing) (j : Fin 4) (c : CutRing) (z w z' w' : SquareFlag a v) + (hz : z'.val=z.val+(ordinary u.1,ordinary u.2)) + (hw : w'.val=w.val+(ordinary u.1,ordinary u.2)) : + FlagSeparates j (c+integralCutForm a j u) z' w' ↔ FlagSeparates j c z w := by + unfold FlagSeparates + rw [flagMem_halfPlane_local_translation u j c z z' hz, + flagMem_halfPlane_local_translation u j c w w' hw] + +theorem separating_min_translation_bound {a : ℕ} {v : ℝ×ℝ} + (u : CutRing×CutRing) (j : Fin 4) (z w z' w' : SquareFlag a v) + (hz : z'.val=z.val+(ordinary u.1,ordinary u.2)) + (hw : w'.val=w.val+(ordinary u.1,ordinary u.2)) + (c d : CutRing) (hc : FlagSeparates j c z w) (hd : FlagSeparates j d z' w') + (hcmin : ∀ e,FlagSeparates j e z w → |conjugate c| ≤ |conjugate e|) + (hdmin : ∀ e,FlagSeparates j e z' w' → |conjugate d| ≤ |conjugate e|) : + abs (|conjugate c|-|conjugate d|) ≤ |conjugate (integralCutForm a j u)| := by + have hd' := hdmin (c+integralCutForm a j u) + ((flagSeparates_local_translation u j c z w z' w' hz hw).mpr hc) + have hc' := hcmin (d-integralCutForm a j u) (by + apply (flagSeparates_local_translation u j (d-integralCutForm a j u) z w z' w' hz hw).mp + simpa only [sub_add_cancel] using hd) + have h₁ := abs_add_le (conjugate c) (conjugate (integralCutForm a j u)) + have h₂ : |conjugate d-conjugate (integralCutForm a j u)| ≤ |conjugate d|+|conjugate (integralCutForm a j u)| := by + simpa only [sub_zero,zero_sub,abs_neg] using abs_sub_le (conjugate d) 0 (conjugate (integralCutForm a j u)) + simp only [map_add,map_sub] at hd' hc' + apply abs_le.mpr + constructor <;> linarith + +end FlagSeparatingLevels + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/FlagSiteCounts.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/FlagSiteCounts.lean new file mode 100644 index 0000000000000000000000000000000000000000..8d868f4a9440a73c8cfe9361bff15c74c80c382a --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/FlagSiteCounts.lean @@ -0,0 +1,159 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.FlagSites +import OAI.GroupTheory.SimpleAmenable.Arithmetic.QuadraticRectangleCounts + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section FlagSiteCounts +open Classical + +theorem flagSite_key_injective {a m D : ℕ} {v : ℝ×ℝ} : + Function.Injective (fun z : FlagSite a m D v => (z.val.1,flagSiteNumerator z)) := by + intro z w h + apply Subtype.ext + apply Prod.ext + · exact congrArg (fun p : Fin m × (CutRing×CutRing) => p.1) h + · apply Subtype.ext + rw [← flagSiteNumerator_spec z,← flagSiteNumerator_spec w] + exact congrArg (scaledOrdinary D) (congrArg (fun p : Fin m × (CutRing×CutRing) => p.2) h) + +noncomputable def flagSiteBox {a m D : ℕ} {v : ℝ×ℝ} (R : ℝ) : Set (FlagSite a m D v) := + {z | |(flagSiteConjugate z).1|≤R ∧ |(flagSiteConjugate z).2|≤R} + +theorem flagSiteNumerator_box {a m D : ℕ} {v : ℝ×ℝ} (hD : 0 constructor <;> constructor <;> + simp only [Set.mem_Icc] at * <;> nlinarith + +theorem flagSiteBox_finite {a m D : ℕ} {v : ℝ×ℝ} (hD : 0 (z.val.1,flagSiteNumerator z)) '' flagSiteBox R).Finite := by + refine ((Set.finite_univ : (Set.univ : Set (Fin m)).Finite).prod (hf.prod hf)).subset ?_ + rintro _ ⟨z,hz,rfl⟩ + exact ⟨Set.mem_univ _,flagSiteNumerator_box hD z hz⟩ + exact hi.of_finite_image flagSite_key_injective.injOn + +theorem flagSiteBox_card_bound {a m D : ℕ} {v : ℝ×ℝ} (hD : 0 (ht u).mp hu) + nlinarith + have hn : S.card ≤ m *T.card^2 := by + rw [← Finset.card_image_of_injective _ flagSite_key_injective] + have hi : S.image (fun z => (z.val.1,flagSiteNumerator z)) ⊆ + (Finset.univ : Finset (Fin m)) ×ˢ (T ×ˢ T) := by + intro x hx + obtain ⟨z,hz,rfl⟩ := Finset.mem_image.mp hx + have hh := flagSiteNumerator_box hD z (hS z hz) + simp only [Finset.mem_product,Finset.mem_univ,true_and] + exact ⟨(ht _).mpr hh.1,(ht _).mpr hh.2⟩ + simpa [Finset.card_product,pow_two] using Finset.card_le_card hi + have hn' : (S.card:ℝ) ≤ m *(T.card:ℝ)^2 := by exact_mod_cast hn + have hh : (T.card:ℝ)^2≤(2*(D:ℝ)^2*R+2)^2 := by + nlinarith [Nat.cast_nonneg (α:=ℝ) T.card] + exact hn'.trans (mul_le_mul_of_nonneg_left hh (Nat.cast_nonneg _)) + +end FlagSiteCounts + +section FlagWindowCounts +open Classical + +def flagWindow {a m D : ℕ} {v : ℝ×ℝ} (x y : ℝ×ℝ) (B C : ℝ) : Set (FlagSite a m D v) := + {z | z.val.2.val.1∈Set.Icc x.1 (x.1+B) ∧ z.val.2.val.2∈Set.Icc x.2 (x.2+B) ∧ + (flagSiteConjugate z).1∈Set.Icc y.1 (y.1+C) ∧ + (flagSiteConjugate z).2∈Set.Icc y.2 (y.2+C)} + +theorem flagWindow_numerators {a m D : ℕ} {v : ℝ×ℝ} (hD : 0 < D) + {x y : ℝ×ℝ} {B C : ℝ} (z : FlagSite a m D v) (hz : z∈flagWindow x y B C) : + (flagSiteNumerator z).1∈cutRectangle (D*x.1) (D*y.1) (D*B) (D*C) ∧ + (flagSiteNumerator z).2∈cutRectangle (D*x.2) (D*y.2) (D*B) (D*C) := by + have hd : (0:ℝ) constructor <;> constructor <;> nlinarith + +theorem flagWindow_card_bound {a m D : ℕ} {v : ℝ×ℝ} (hD : 0 < D) + (t : Fin m) {x y : ℝ×ℝ} {B C : ℝ} (hB : 0 ≤ B) (hC : 0 < C) + (S : Finset (FlagSite a m D v)) (hT : ∀z∈S,z.val.1=t) + (hS : ∀z∈S,z∈flagWindow x y B C) : + (S.card:ℝ) ≤ ((D:ℝ)^2*B*C+2)^2 := by + have hd : (0:ℝ) (Set.Finite.mem_toFinset _).mp hu) + nlinarith + have hc₂ : (T₂.card:ℝ)<(D:ℝ)^2*B*C+2 := by + have hh := cutRectangle_card_bound T₂ (D*x.2) (D*y.2) (D*B) (D*C) + (mul_nonneg hd.le hB) (mul_pos hd hC) (fun u hu => (Set.Finite.mem_toFinset _).mp hu) + nlinarith + have hi : Set.InjOn (flagSiteNumerator (a:=a) (m:=m) (D:=D) (v:=v)) (↑S : Set (FlagSite a m D v)) := by + intro z hz w hw hn + apply flagSite_key_injective + exact Prod.ext ((hT z hz).trans (hT w hw).symm) hn + have hn : S.card ≤ T₁.card*T₂.card := by + rw [← Finset.card_image_of_injOn hi,← Finset.card_product] + apply Finset.card_le_card + intro n hn + obtain ⟨z,hz,rfl⟩ := Finset.mem_image.mp hn + have hh := flagWindow_numerators hD z (hS z hz) + simpa only [Finset.mem_product,T₁,T₂,Set.Finite.mem_toFinset] using hh + have hn' : (S.card:ℝ) ≤ (T₁.card:ℝ)*(T₂.card:ℝ) := by exact_mod_cast hn + calc + (S.card:ℝ) ≤ (T₁.card:ℝ)*(T₂.card:ℝ) := hn' + _ ≤ ((D:ℝ)^2*B*C+2)*((D:ℝ)^2*B*C+2) := + mul_le_mul hc₁.le hc₂.le (Nat.cast_nonneg _) (by positivity) + _ = _ := (pow_two _).symm + +end FlagWindowCounts + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/FlagSites.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/FlagSites.lean new file mode 100644 index 0000000000000000000000000000000000000000..3ffeb35b9652693d4947aa65d4909d939af601d4 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/FlagSites.lean @@ -0,0 +1,143 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Configurations.FlagExchangeAction + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section FlagSites +open Classical + +noncomputable def scaledOrdinary (D : ℕ) (u : CutRing×CutRing) : ℝ×ℝ := + (ordinary u.1/D,ordinary u.2/D) + +noncomputable def scaledConjugate (D : ℕ) (u : CutRing×CutRing) : ℝ×ℝ := + (conjugate u.1/D,conjugate u.2/D) + +theorem scaledOrdinary_injective {D : ℕ} (hD : 0 (z.val.1,flagSiteNumerator z)) + intro z w h + apply Subtype.ext + have ht : z.val.1=w.val.1 := congrArg (fun p : Fin m × (CutRing×CutRing) => p.1) h + have hn : flagSiteNumerator z=flagSiteNumerator w := + congrArg (fun p : Fin m × (CutRing×CutRing) => p.2) h + apply Prod.ext + · exact ht + · apply Subtype.ext + rw [← flagSiteNumerator_spec z,← flagSiteNumerator_spec w,hn] + +noncomputable def flagShiftPeriod {a : ℕ} {v : ℝ×ℝ} (u : CutRing×CutRing) + (z : SquareFlag a v) : ℤ×ℤ := + (flagFloor (z.val.1+ordinary u.1) v.1,flagFloor (z.val.2+ordinary u.2) v.2) + +noncomputable def flagShiftNumerator (D : ℕ) (n u : CutRing×CutRing) (k : ℤ×ℤ) : + CutRing×CutRing := + (n.1+(D:CutRing)*u.1-(D:CutRing)*(k.1:CutRing), + n.2+(D:CutRing)*u.2-(D:CutRing)*(k.2:CutRing)) + +theorem scaledOrdinary_shift {D : ℕ} (hD : 0 + simp only [scaledOrdinary,flagShiftNumerator,Prod.fst_sub,Prod.snd_sub, + Prod.fst_add,Prod.snd_add,map_sub,map_add,map_mul,map_natCast,map_intCast] <;> + field_simp + +theorem flagTranslate_lattice {a D : ℕ} {v : ℝ×ℝ} (hD : 0 + simp only [scaledConjugate,flagShiftNumerator,Prod.fst_sub,Prod.snd_sub, + Prod.fst_add,Prod.snd_add,map_sub,map_add,map_mul,map_natCast,map_intCast] <;> + field_simp + +end FlagSites + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/FlagTentMass.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/FlagTentMass.lean new file mode 100644 index 0000000000000000000000000000000000000000..3f6e3ac8fe8cd8df15b7d91595076866c98ff2a6 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/FlagTentMass.lean @@ -0,0 +1,185 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.RandomFields.FlagAveragingMatrices +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.GoodRowSeparators + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section FlagTentMass +open Classical + +noncomputable def flagRowTent {a m D : ℕ} {v : ℝ×ℝ} (s t : ℝ) + (z w : FlagSite a m D v) : ℝ := + if z.val.1=w.val.1 then planeTent s (flagSiteOrdinary z) (flagSiteOrdinary w)* + planeTent t (flagSiteConjugate z) (flagSiteConjugate w) else 0 + +noncomputable def latticeRowTent (D : ℕ) (s t : ℝ) (x y : ℝ×ℝ) (u : CutRing×CutRing) : ℝ := + planeTent s x (scaledOrdinary D u)*planeTent t y (scaledConjugate D u) + +noncomputable def tentRowOffset (s t : ℝ) (x y : ℝ×ℝ) : (Fin 2 → ℝ)×(Fin 2 → ℝ) := + (![-x.1/s,-y.1/t],![-x.2/s,-y.2/t]) + +theorem latticeRowTent_eq (D : ℕ) (s t : ℝ) (x y : ℝ×ℝ) (u : CutRing×CutRing) : + latticeRowTent D s t x y u= + pairedUnitTent (tentRowOffset s t x y+pairedQuadraticEmbedding D s t u) := by + simp only [latticeRowTent,planeTent,scaledOrdinary,scaledConjugate,pairedUnitTent, + doubleUnitTent,Fin.prod_univ_two,unitTent,tentRowOffset,pairedQuadraticEmbedding, + LinearMap.prodMap_apply,quadraticScaledEmbedding,LinearMap.coe_mk,AddHom.coe_mk, + Prod.fst_add,Prod.snd_add,Pi.add_apply,Matrix.cons_val_zero,Matrix.cons_val_one] + have h (a b d c : ℝ) : |(a-b/d)/c|=|-a/c+b/(d*c)| := by + have he : -a/c+b/(d*c) = -((a-b/d)/c) := by rw [div_mul_eq_div_div]; ring + rw [he,abs_neg] + rw [h,h,h,h] + ring + +theorem squareBoundary_of_interior {v x : ℝ×ℝ} + (hx : 0 (ne_of_gt hx.1 h).elim),(fun h => (ne_of_lt hx.2.1 h).elim), + (fun h => (ne_of_gt hx.2.2.1 h).elim),(fun h => (ne_of_lt hx.2.2.2 h).elim)⟩ + +noncomputable def flagSiteFromNumerator {a m D : ℕ} {v : ℝ×ℝ} + (hv : TransverseDirection a v) (k : Fin m) (u : CutRing×CutRing) + (hu : SquareBoundary v (scaledOrdinary D u)) : FlagSite a m D v := + ⟨(k,⟨scaledOrdinary D u,hv,hu⟩),u,rfl⟩ + +@[simp] theorem flagSiteFromNumerator_numerator {a m D : ℕ} {v : ℝ×ℝ} (hD : 0 by by_contra hh; exact hw (hT w hh),?_⟩ + apply Finset.sum_bij_ne_zero (fun w _ _ => flagSiteNumerator w) + · intro w hw hnz + exact by_contra (fun hh => (hn w hnz).2 (hS _ hh)) + · intro w hw hnw w' hw' hnw' he + apply Subtype.ext + apply Prod.ext + · exact (hn w hnw).1.symm.trans (hn w' hnw').1 + · apply Subtype.ext + rw [← flagSiteNumerator_spec w,← flagSiteNumerator_spec w',he] + · intro u hu hnu + let w := flagSiteFromNumerator z.val.2.property.1 z.val.1 u (latticeRowTent_interior hs z hi u hnu) + have he : flagRowTent s t z w=latticeRowTent D s t (flagSiteOrdinary z) (flagSiteConjugate z) u := by + rw [flagRowTent,ite_eq_left (show z.val.1=w.val.1 from rfl)] + change planeTent s _ (scaledOrdinary D u)*planeTent t _ (flagSiteConjugate (flagSiteFromNumerator _ _ _ _)) = _ + rw [flagSiteFromNumerator_conjugate hD] + rfl + have hw : flagRowTent s t z w≠0 := by rwa [he] + exact ⟨w,hT w hw,hw,flagSiteFromNumerator_numerator hD _ _ _ _⟩ + · intro w hw hnw + simp only [flagRowTent,ite_eq_left (hn w hnw).1,latticeRowTent, + flagSiteNumerator_spec,flagSiteOrdinary,flagSiteConjugate] + +theorem flagRowTent_mass {a m D : ℕ} {v : ℝ×ℝ} (hD : 0 θ (x+δ)-θ x + have hf (x : E) : HasFDerivAt F (fderiv ℝ θ (x+δ)-fderiv ℝ θ x) x := by + have hh := (hasFDerivAt_comp_add_right δ).mpr (hθ (x+δ)).hasFDerivAt + exact hh.sub (hθ x).hasFDerivAt + have hb (z : E) : ‖fderiv ℝ F z‖ ≤ (L:ℝ)*‖δ‖ := by + rw [(hf z).fderiv] + simpa only [add_sub_cancel_left] using hL.norm_sub_le (z+δ) z + have hh := Convex.norm_image_sub_le_of_norm_fderiv_le (𝕜:=ℝ) + (f:=F) (s:=Set.univ) (fun z _ => (hf z).differentiableAt) (fun z _ => hb z) + convex_univ (Set.mem_univ y) (Set.mem_univ x) + simpa only [F,Real.norm_eq_abs] using hh + +theorem compactSignal_uniform_constants {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + (ψ : E → ℝ) (hψ : ContDiff ℝ 2 ψ) (hs : HasCompactSupport ψ) : + ∃L₀ L₁ : NNReal,LipschitzWith L₀ ψ ∧ ∀δ x y : E, + |(ψ (x+δ)-ψ x)-(ψ (y+δ)-ψ y)| ≤ (L₁:ℝ)*‖δ‖*‖x-y‖ := by + obtain ⟨L₀,hL₀⟩ := hψ.lipschitzWith_of_hasCompactSupport hs (by norm_num) + have hd : ContDiff ℝ 1 (fderiv ℝ ψ) := hψ.fderiv_right (by norm_num) + obtain ⟨L₁,hL₁⟩ := hd.lipschitzWith_of_hasCompactSupport (hs.fderiv ℝ) (by norm_num) + exact ⟨L₀,L₁,hL₀,finiteDifference_lipschitz ψ (hψ.differentiable (by norm_num)) hL₁⟩ + +end FiniteDifference + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/FlagTranslation.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/FlagTranslation.lean new file mode 100644 index 0000000000000000000000000000000000000000..6f93f4712b2b2c065b79ef13950f963050bc581f --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/FlagTranslation.lean @@ -0,0 +1,180 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.PeriodicSlotStars +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.FlagGerms + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section FlagTranslation +open Classical + +noncomputable def flagFloor (x d : ℝ) : ℤ := + if d<0 then -1-⌊-x⌋ else ⌊x⌋ + +noncomputable def flagFract (x d : ℝ) : ℝ := + if d<0 then 1-Int.fract (-x) else Int.fract x + +theorem flagFract_eq (x d : ℝ) : flagFract x d=x-(flagFloor x d:ℝ) := by + unfold flagFract flagFloor + split_ifs <;> simp only [Int.fract,Int.cast_sub,Int.cast_neg,Int.cast_one] + ring + +theorem flagFract_add_int (x d : ℝ) (n : ℤ) : flagFract (x+n) d=flagFract x d := by + unfold flagFract + split_ifs + · rw [neg_add,← sub_eq_add_neg,Int.fract_sub_intCast] + · rw [Int.fract_add_intCast] + +theorem flagFract_sub_int (x d : ℝ) (n : ℤ) : flagFract (x-n) d=flagFract x d := by + simpa [sub_eq_add_neg] using flagFract_add_int x d (-n) + +theorem flagFract_flagFract_add (x y d : ℝ) : + flagFract (flagFract x d+y) d=flagFract (x+y) d := by + rw [flagFract_eq x d,sub_add_eq_add_sub,flagFract_sub_int] + +theorem flagFract_boundary (x d : ℝ) (hd : d≠0) : + flagFract x d∈Set.Icc (0:ℝ) 1 ∧ + (flagFract x d=0 → 0 by linarith,fun _ => ht⟩ + · exact ⟨⟨h₀,le_of_lt h₁⟩,fun _ => lt_of_le_of_ne (le_of_not_gt ht) hd.symm, + fun he => by linarith⟩ + +theorem flagFract_self {x d : ℝ} (hx : x∈Set.Icc (0:ℝ) 1) + (h₀ : x=0 → 0 ht (h₁ he))⟩ + +noncomputable def flagTranslate {a : ℕ} {v : ℝ×ℝ} (u : CutRing×CutRing) + (z : SquareFlag a v) : SquareFlag a v := by + have hv₁ : v.1≠0 := by simpa [cutForm] using z.property.1 0 + have hv₂ : v.2≠0 := by simpa [cutForm] using z.property.1 1 + have hx := flagFract_boundary (z.val.1+ordinary u.1) v.1 hv₁ + have hy := flagFract_boundary (z.val.2+ordinary u.2) v.2 hv₂ + exact ⟨(flagFract (z.val.1+ordinary u.1) v.1,flagFract (z.val.2+ordinary u.2) v.2), + z.property.1,hx.1,hy.1,hx.2.1,hx.2.2,hy.2.1,hy.2.2⟩ + +@[simp] theorem flagTranslate_val {a : ℕ} {v : ℝ×ℝ} (u : CutRing×CutRing) + (z : SquareFlag a v) : (flagTranslate u z).val= + (flagFract (z.val.1+ordinary u.1) v.1,flagFract (z.val.2+ordinary u.2) v.2) := rfl + +@[simp] theorem flagTranslate_zero {a : ℕ} {v : ℝ×ℝ} (z : SquareFlag a v) : + flagTranslate 0 z=z := by + apply Subtype.ext + simp only [flagTranslate_val,Prod.fst_zero,Prod.snd_zero,map_zero,add_zero] + exact Prod.ext (flagFract_self z.property.2.1 z.property.2.2.2.1 z.property.2.2.2.2.1) + (flagFract_self z.property.2.2.1 z.property.2.2.2.2.2.1 z.property.2.2.2.2.2.2) + +theorem flagTranslate_add {a : ℕ} {v : ℝ×ℝ} (u w : CutRing×CutRing) + (z : SquareFlag a v) : flagTranslate (u+w) z=flagTranslate u (flagTranslate w z) := by + apply Subtype.ext + simp only [flagTranslate_val,Prod.fst_add,Prod.snd_add,map_add] + rw [flagFract_flagFract_add,flagFract_flagFract_add] + congr 1 <;> congr 1 <;> ring + +theorem flagTranslate_period {a : ℕ} {v : ℝ×ℝ} (u : CutRing×CutRing) (k : ℤ×ℤ) + (z : SquareFlag a v) : flagTranslate (u+SquareStep.intPair k) z=flagTranslate u z := by + apply Subtype.ext + simp only [flagTranslate_val,SquareStep.intPair,Prod.fst_add,Prod.snd_add,map_add,map_intCast] + rw [← add_assoc,← add_assoc,flagFract_add_int,flagFract_add_int] + +theorem flagTranslate_reduce {a : ℕ} {v : ℝ×ℝ} (u : CutRing×CutRing) + (z : SquareFlag a v) : flagTranslate u z=flagTranslate (orbitRepresentative u) z := by + have hu : u=orbitRepresentative u+SquareStep.intPair (u.1.re,u.2.re) := by + apply Prod.ext <;> apply QuadraticAlgebra.ext <;> simp [orbitRepresentative,SquareStep.intPair,cutTau] + calc + _ = flagTranslate (orbitRepresentative u+SquareStep.intPair (u.1.re,u.2.re)) z := congrArg (fun t => flagTranslate t z) hu + _ = _ := flagTranslate_period _ _ _ + +theorem planeSector_add_iff {a : ℕ} (z v t p : ℝ×ℝ) : + p+t∈planeSector a (z+t) v ↔ p∈planeSector a z v := by + unfold planeSector + simp only [Set.mem_ofPred_eq,cutForm_add] + apply forall_congr' + intro j + split_ifs <;> simp + +theorem flagTranslate_neighborhood {a : ℕ} {v : ℝ×ℝ} (u : CutRing×CutRing) + (z : SquareFlag a v) {N : Set (ℝ×ℝ)} (hN : IsOpen N) + (hz : (flagTranslate u z).val∈N) : + ∃ M : Set (ℝ×ℝ), IsOpen M ∧ z.val∈M ∧ + ∀ p : GenericSquare a, p.val∈M → p.val∈planeSector a z.val v → + (translate a u p).val∈N ∧ + (translate a u p).val∈planeSector a (flagTranslate u z).val v := by + let k : ℤ×ℤ := (flagFloor (z.val.1+ordinary u.1) v.1, + flagFloor (z.val.2+ordinary u.2) v.2) + let t : CutRing×CutRing := u-SquareStep.intPair k + let b : ℝ×ℝ := (ordinary t.1,ordinary t.2) + have hbase : (flagTranslate u z).val=z.val+b := by + apply Prod.ext <;> simp only [flagTranslate_val,flagFract_eq,b,t,k,SquareStep.intPair, + Prod.fst_sub,Prod.snd_sub,Prod.fst_add,Prod.snd_add,map_sub,map_intCast] <;> ring + let L := N ∩ arrangementNeighborhood a SquareStep.squareEdgeCuts (flagTranslate u z).val + let M : Set (ℝ×ℝ) := (fun p => p+b) ⁻¹' L + have hL : IsOpen L := hN.inter (arrangementNeighborhood_open _ _ _) + have hzL : (flagTranslate u z).val∈L := ⟨hz,self_mem_arrangementNeighborhood _ _ _⟩ + refine ⟨M,hL.preimage (continuous_id.add continuous_const),?_,fun p hp hpv => ?_⟩ + · change z.val+b∈L + rw [← hbase]; exact hzL + · let q : GenericPlane a := GenericPlane.shift t ⟨p.val,p.property.2.2⟩ + have hqv : q.val∈planeSector a (flagTranslate u z).val v := by + rw [hbase] + exact (planeSector_add_iff z.val v b p.val).mpr hpv + have hqs : SquareStep.InSquare q := sector_enters_square (flagTranslate u z).property.2 hp.2 hqv + have hqp : (translate a u p).val=q.val := by + apply Prod.ext + · change Int.fract (p.val.1+ordinary u.1)=p.val.1+ordinary t.1 + have he : p.val.1+ordinary t.1=p.val.1+ordinary u.1-(k.1:ℝ) := by + simp only [t,SquareStep.intPair,Prod.fst_sub,map_sub,map_intCast]; ring + rw [he] + rw [← Int.fract_sub_intCast (p.val.1+ordinary u.1) k.1] + exact Int.fract_eq_self.mpr (by simpa only [q,GenericPlane.shift,Prod.fst_add,he,Set.mem_Ico] using hqs.1) + · change Int.fract (p.val.2+ordinary u.2)=p.val.2+ordinary t.2 + have he : p.val.2+ordinary t.2=p.val.2+ordinary u.2-(k.2:ℝ) := by + simp only [t,SquareStep.intPair,Prod.snd_sub,map_sub,map_intCast]; ring + rw [he] + rw [← Int.fract_sub_intCast (p.val.2+ordinary u.2) k.2] + exact Int.fract_eq_self.mpr (by simpa only [q,GenericPlane.shift,Prod.snd_add,he,Set.mem_Ico] using hqs.2) + rw [hqp] + exact ⟨hp.1,hqv⟩ + +theorem flagValue_translate {a : ℕ} {v : ℝ×ℝ} {K : Type*} + (f : GenericSquare a → K) (hf : HasSquareArrangement f) (u : CutRing×CutRing) + (z : SquareFlag a v) : + flagValue (fun p => f (translate a u p)) (squareArrangement_translate hf u) z = + flagValue f hf (flagTranslate u z) := by + obtain ⟨N,hN,hz,hf'⟩ := flagValue_spec f hf (flagTranslate u z) + obtain ⟨M,hM,hzM,hg⟩ := flagTranslate_neighborhood u z hN hz + exact flagValue_eq _ _ _ ⟨M,hM,hzM,fun p hp hpv => + hf' (translate a u p) (hg p hp hpv).1 (hg p hp hpv).2⟩ + +theorem flagMem_preimage_translate {a : ℕ} {v : ℝ×ℝ} (U : polygonAlgebra a) + (u : CutRing×CutRing) (z : SquareFlag a v) : + flagMem ⟨translate a u ⁻¹' U.val,polygon_preimage_translate u U.property⟩ z ↔ + flagMem U (flagTranslate u z) := by + change flagValue (fun p => decide (translate a u p∈U.val)) + (squareArrangement_translate (polygon_hasSquareArrangement U.property) u) z=true ↔ _ + rw [flagValue_translate (fun p => decide (p∈U.val)) (polygon_hasSquareArrangement U.property)] + rfl + +end FlagTranslation + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/FrameCompatibility.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/FrameCompatibility.lean new file mode 100644 index 0000000000000000000000000000000000000000..79e0d585b2f43aa65e653c86e02dd85939757ecf --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/FrameCompatibility.lean @@ -0,0 +1,82 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.OffsetFrames + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section FrameCompatibility + +namespace OffsetFrame +variable {a m : ℕ} {r : CutRing} {hm : 2 ≤ m} {I : Finset (Fin (m+1))} + {u : Fin (m+1) → CutRing × CutRing} + +def shift (F : OffsetFrame a r m hm I u) + (k : Multiplicative (FreeAbelianGroup (Fin m × Fin 2))) + (d : Fin (m+1) → CutRing × CutRing) + (hd : sourceLatticeFullMap a r m hm k = trackTranslation d) : + OffsetFrame a r m hm I (d+u) where + k := k*F.k + d := d+F.d + projection := by rw [map_mul,hd,F.projection,trackTranslation_add] + prescribed := by intro i hi; simp only [Pi.add_apply,F.prescribed i hi] + +end OffsetFrame + +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + (hlarge : 15 < m+1) (h : B.AllPrimitiveLaws) (hr : 0 u i-v)) (V : polygonAlgebra a) : + B.frameStar hlarge h hr I u F V = + B.frameStar hlarge h hr I (fun i => u i-v) G (spatialTranslate v V) := by + let T := commonFrame a r m hm I b hb v + let K : OffsetFrame a r m hm I u := { + k := G.k*T.k + d := G.d+T.d + projection := by rw [map_mul,G.projection,T.projection,trackTranslation_add] + prescribed := by + intro i hi + simp only [Pi.add_apply,G.prescribed i hi,T.common i hi,sub_add_cancel] } + rw [B.frameStar_independent hlarge h hr I hI b hb u u F K (fun _ _ => rfl) V] + ext s : 1 + have he := DFunLike.congr_fun (B.polygonStar_common_translate hlarge h hr I hI b hb v T V) s + change B.t T.k * B.polygonStar hlarge h hr V (universalMap (subtypeAlternatingHom I) s) * (B.t T.k)⁻¹ = + B.polygonStar hlarge h hr (spatialTranslate v V) (universalMap (subtypeAlternatingHom I) s) at he + change B.t (G.k*T.k) * B.polygonStar hlarge h hr V (universalMap (subtypeAlternatingHom I) s) * + (B.t (G.k*T.k))⁻¹ = B.t G.k * + B.polygonStar hlarge h hr (spatialTranslate v V) (universalMap (subtypeAlternatingHom I) s) * (B.t G.k)⁻¹ + rw [← he] + simp only [map_mul,mul_inv_rev,mul_assoc] + +end InitialCoverSystem +end FrameCompatibility + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/FrameDisjointness.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/FrameDisjointness.lean new file mode 100644 index 0000000000000000000000000000000000000000..0c1989f554405fe80805e13402dbf71e3826dfe3 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/FrameDisjointness.lean @@ -0,0 +1,183 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.SectorControl +import OAI.GroupTheory.SimpleAmenable.Homology.FinitePrimitiveResolution +import OAI.GroupTheory.SimpleAmenable.CentralCovers.FrameActions + +namespace OAI + +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +section FrameDisjointness + +namespace OffsetFrame +variable {a m : ℕ} {r : CutRing} {hm : 2 ≤ m} + {I J : Finset (Fin (m+1))} {u : Fin (m+1) → CutRing × CutRing} + +def restrict (F : OffsetFrame a r m hm J u) (hIJ : I ⊆ J) : OffsetFrame a r m hm I u where + k := F.k + d := F.d + projection := F.projection + prescribed := fun i hi => F.prescribed i (hIJ hi) + +end OffsetFrame + +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + (hlarge : 15 < m+1) (h : B.AllPrimitiveLaws) (hr : 0 p.val + have hV : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) P i).val) V.val := hS + rw [B.polygonStar_eq hlarge h hr P V hV] + have he := DFunLike.congr_fun (B.fullGeometricSector_inclusion hlarge P (fun J _ d hd => h S P J d hd) I hI b hb + (h S P I b hb) V hV) s + change B.fullGeometricSector hlarge P (fun J _ d hd => h S P J d hd) V (universalMap (subtypeAlternatingHom I) s) = _ at he + rw [he] + exact B.geometricSector_aligned I b hb P _ V s + +theorem frameStar_subalphabet {I J : Finset (Fin (m+1))} + [Group.IsPerfect (alternatingGroup I)] [Group.IsPerfect (alternatingGroup J)] + (hIJ : I ⊆ J) (u : Fin (m+1) → CutRing × CutRing) + (F : OffsetFrame a r m hm J u) (V : polygonAlgebra a) : + (B.frameStar hlarge h hr J u F V).comp (universalMap (subalphabetHom hIJ)) = + B.frameStar hlarge h hr I u (F.restrict hIJ) V := by + unfold frameStar + rw [MonoidHom.comp_assoc,MonoidHom.comp_assoc,← universalMap_comp,subtypeAlternatingHom_comp] + rfl + +theorem frameStar_disjoint_alphabets (I J : Finset (Fin (m+1))) + (hI : 5 ≤ I.card) (hJ : 5 ≤ J.card) + [Group.IsPerfect (alternatingGroup I)] [Group.IsPerfect (alternatingGroup J)] + (hIJ : Disjoint I J) (b : Fin (m+1)) (hb : b ∉ I ∪ J) + (u v : Fin (m+1) → CutRing × CutRing) + (F : OffsetFrame a r m hm I u) (G : OffsetFrame a r m hm J v) + (V W : polygonAlgebra a) (s : UniversalExtension (alternatingGroup I)) + (t : UniversalExtension (alternatingGroup J)) : + Commute (B.frameStar hlarge h hr I u F V s) (B.frameStar hlarge h hr J v G W t) := by + classical + have hbI : b ∉ I := fun hi => hb (Finset.mem_union_left _ hi) + have hbJ : b ∉ J := fun hj => hb (Finset.mem_union_right _ hj) + let w : Fin (m+1) → CutRing × CutRing := fun i => if i ∈ I then u i else v i + let K := balancedOffsetFrame a r m hm (I ∪ J) b hb w + let F' : OffsetFrame a r m hm I u := { + k := K.k + d := K.d + projection := K.projection + prescribed := by + intro i hi + rw [K.prescribed i (Finset.mem_union_left _ hi)] + simp only [w,hi,ite_eq_left] } + let G' : OffsetFrame a r m hm J v := { + k := K.k + d := K.d + projection := K.projection + prescribed := by + intro i hi + rw [K.prescribed i (Finset.mem_union_right _ hi)] + have hn : i ∉ I := fun hI => Finset.disjoint_left.mp hIJ hI hi + simp only [w,hn,ite_false] } + rw [B.frameStar_independent hlarge h hr I hI b hbI u u F F' (fun _ _ => rfl) V, + B.frameStar_independent hlarge h hr J hJ b hbJ v v G G' (fun _ _ => rfl) W] + exact (B.disjoint_aligned I J hIJ _ + (B.polygonStar_alphabet_aligned hlarge h hr I hI b hbI V s) _ + (B.polygonStar_alphabet_aligned hlarge h hr J hJ b hbJ W t)).map (MulAut.conj (B.t K.k)).toMonoidHom + +end InitialCoverSystem +end FrameDisjointness + +theorem supported_fixer_commute {α : Type*} {f g : Equiv.Perm α} {U : Set α} + (hf : ∀ p ∈ U, f p = p) (hg : SupportedIn g U) : Commute f g := by + apply Equiv.Perm.Disjoint.commute + intro p + by_cases hp : p ∈ U + · exact Or.inl (hf p hp) + · exact Or.inr (hg p hp) + +theorem conditional_alphabet_supported {a m : ℕ} (I : Finset (Fin m)) + (V : polygonAlgebra a) (s : alternatingGroup I) : + SupportedIn (conditionalHom V (subtypeAlternatingHom I s).val).val + {p : TrackPoint a m | p.1 ∈ I ∧ p.2 ∈ V.val} := by + classical + rintro ⟨i,x⟩ hp + change (if x∈V.val then (subtypeAlternatingHom I s).val i else i,x) = (i,x) + by_cases hx : x ∈ V.val + · have hi : i ∉ I := fun hi => hp ⟨hi,hx⟩ + have he : (subtypeAlternatingHom I s).val i = i := by + change Equiv.Perm.ofSubtype s.val i = i + exact Equiv.Perm.ofSubtype_apply_of_not_mem _ hi + rw [ite_eq_left hx,he] + · rw [ite_eq_right hx] + +def frameDomain {a m : ℕ} (I : Finset (Fin m)) (u : Fin m → CutRing × CutRing) + (V : polygonAlgebra a) : Set (TrackPoint a m) := + {p | ∃ i ∈ I, ∃ x ∈ V.val, p = (i,translate a (u i) x)} + +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + (hlarge : 15 < m+1) (h : B.AllPrimitiveLaws) (hr : 0 (B.polygonStar hlarge h hr W).range) V) + ⟨universalMap (subtypeAlternatingHom I) t,rfl⟩ + · intro t + have hp := DFunLike.congr_fun (B.polygonStar_projection hlarge h hr V) + (universalMap (subtypeAlternatingHom I) t) + change coverMap M (alternatingGenerator a r m hm) + (B.polygonStar hlarge h hr V (universalMap (subtypeAlternatingHom I) t)) = + conditionalAlternatingHom V (universalProjection _ (universalMap (subtypeAlternatingHom I) t)) at hp + rw [show universalProjection _ (universalMap (subtypeAlternatingHom I) t) = + subtypeAlternatingHom I (universalProjection _ t) from + DFunLike.congr_fun (universalMap_spec (subtypeAlternatingHom I)) t] at hp + change Commute (coverMap M (alternatingGenerator a r m hm) z) + (coverMap M (alternatingGenerator a r m hm) + (B.polygonStar hlarge h hr V (universalMap (subtypeAlternatingHom I) t))) + rw [hp] + have hc := supported_fixer_commute (fun (p : TrackPoint a (m+1)) (hp : p.1 ∈ I ∧ p.2 ∈ V.val) => hfix _ hp.1 _ hp.2) + (conditional_alphabet_supported I V (universalProjection _ t)) + exact show _*_ = _*_ from Subtype.ext (Subtype.ext hc.eq) + +end InitialCoverSystem + +end SimpleAmenable + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/FreshEvenBank.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/FreshEvenBank.lean new file mode 100644 index 0000000000000000000000000000000000000000..038a52aa13d760662f36ea2222ebcbb778fcaad2 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/FreshEvenBank.lean @@ -0,0 +1,80 @@ +import Mathlib + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section FreshEvenBank + +theorem even_move_embedding {α : Type*} [Fintype α] [DecidableEq α] {n : ℕ} + (hn : n + 2 ≤ Nat.card α) (s t : Fin n ↪ α) : + ∃ σ : alternatingGroup α, ∀ i, σ.val (s i) = t i := by + let := alternatingGroup.isMultiplyPretransitive α + let : MulAction.IsMultiplyPretransitive (alternatingGroup α) α n := + MulAction.isMultiplyPretransitive_of_le (by omega : n ≤ Nat.card α - 2) + (Nat.sub_le _ _) + obtain ⟨σ,hσ⟩ := MulAction.exists_smul_eq (alternatingGroup α) s t + exact ⟨σ,fun i => congrArg (fun e : Fin n ↪ α => e i) hσ⟩ + +theorem fresh_five_bank {α : Type*} [Fintype α] [DecidableEq α] (J : Finset α) + (hJ : J.card + 5 ≤ Fintype.card α) : + ∃ t : Fin 5 ↪ α, Disjoint (Finset.univ.map t) J := by + classical + have hc : 5 ≤ Jᶜ.card := by rw [Finset.card_compl]; omega + have he : Nonempty (Fin 5 ↪ {x : α // x ∈ Jᶜ}) := by + rw [Function.Embedding.nonempty_iff_card_le,Fintype.card_fin,Fintype.card_coe] + exact hc + obtain ⟨e⟩ := he + refine ⟨e.trans (Function.Embedding.subtype _),?_⟩ + apply Finset.disjoint_left.mpr + intro x hx hj + obtain ⟨i,_,rfl⟩ := Finset.mem_map.mp hx + exact Finset.mem_compl.mp (e i).property hj + +theorem even_move_disjoint_banks {α : Type*} [Fintype α] [DecidableEq α] + (s t : Fin 5 ↪ α) (hd : Disjoint (Finset.univ.map s) (Finset.univ.map t)) : + ∃ σ : alternatingGroup α, + (∀ i, σ.val (s i) = t i) ∧ + σ.val.support ⊆ (Finset.univ.map s) ∪ (Finset.univ.map t) := by + classical + let S := (Finset.univ.map s) ∪ (Finset.univ.map t) + let T := {x : α // x ∈ S} + let s' : Fin 5 ↪ T := ⟨fun i => ⟨s i,Finset.mem_union_left _ (Finset.mem_map.mpr + ⟨i,Finset.mem_univ _,rfl⟩)⟩,fun _ _ h => s.injective (congrArg Subtype.val h)⟩ + let t' : Fin 5 ↪ T := ⟨fun i => ⟨t i,Finset.mem_union_right _ (Finset.mem_map.mpr + ⟨i,Finset.mem_univ _,rfl⟩)⟩,fun _ _ h => t.injective (congrArg Subtype.val h)⟩ + have hT : Nat.card T = 10 := by + rw [Nat.card_eq_fintype_card,Fintype.card_coe] + dsimp only [S] + rw [Finset.card_union_of_disjoint hd,Finset.card_map,Finset.card_map] + simp + obtain ⟨ρ,hρ⟩ := even_move_embedding (by omega : 5+2 ≤ Nat.card T) s' t' + let e : T ↪ α := Function.Embedding.subtype _ + let σ := ρ.val.viaEmbedding e + have hσ : σ ∈ alternatingGroup α := by + change Equiv.Perm.sign (ρ.val.viaEmbedding e) = 1 + rw [Equiv.Perm.viaEmbedding,Equiv.Perm.sign_extendDomain] + exact ρ.property + refine ⟨⟨σ,hσ⟩,?_,?_⟩ + · intro i + change ρ.val.viaEmbedding e (e (s' i)) = t i + rw [Equiv.Perm.viaEmbedding_apply,hρ] + rfl + · intro x hx + by_contra hn + have he : x ∉ Set.range e := by + rintro ⟨y,rfl⟩ + exact hn y.property + exact Equiv.Perm.mem_support.mp hx (Equiv.Perm.viaEmbedding_apply_of_notMem _ _ _ he) + +end FreshEvenBank + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/FullGroupAffineData.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/FullGroupAffineData.lean new file mode 100644 index 0000000000000000000000000000000000000000..6a84e6521fc932ffb27347cb48193fc379427c88 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/FullGroupAffineData.lean @@ -0,0 +1,203 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.FlagArrangementControl + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section FullGroupAffineData +open Classical + +theorem fullGroupSquareShift_exists {a m : ℕ} (g : polygonFullGroup a m) + (i : Fin m) (p : GenericSquare a) : + ∃u : CutRing×CutRing,(g.val (i,p)).2.val=p.val+(ordinary u.1,ordinary u.2) := by + obtain ⟨S,hS,hcover⟩ := g.property + obtain ⟨c,hc,hi,hp⟩ := hcover (i,p) + change i=c.source at hi + refine ⟨c.shift-SquareStep.intPair (squareTranslationPeriod c.shift p),?_⟩ + rw [hi,hS c hc p hp] + apply Prod.ext <;> + simp only [translate,Int.fract,squareTranslationPeriod,SquareStep.intPair, + Prod.fst_sub,Prod.snd_sub,Prod.fst_add,Prod.snd_add,map_sub,map_intCast] <;> ring + +noncomputable def fullGroupSquareShift {a m : ℕ} (g : polygonFullGroup a m) + (i : Fin m) (p : GenericSquare a) : CutRing×CutRing := + (fullGroupSquareShift_exists g i p).choose + +theorem fullGroupSquareShift_spec {a m : ℕ} (g : polygonFullGroup a m) + (i : Fin m) (p : GenericSquare a) : + (g.val (i,p)).2.val=p.val+(ordinary (fullGroupSquareShift g i p).1, + ordinary (fullGroupSquareShift g i p).2) := (fullGroupSquareShift_exists g i p).choose_spec + +noncomputable def fullGroupAffineData {a m : ℕ} (g : polygonFullGroup a m) + (i : Fin m) (p : GenericSquare a) : Fin m × (CutRing×CutRing) := + ((g.val (i,p)).1,fullGroupSquareShift g i p) + +theorem fullGroupAffineData_chart {a m : ℕ} (g : polygonFullGroup a m) + (i : Fin m) (p : GenericSquare a) (c : TableChart a m) (hc : c.Holds g.val) + (hi : i=c.source) (hp : p∈c.domain.val) : + fullGroupAffineData g i p=(c.target,c.shift-SquareStep.intPair (squareTranslationPeriod c.shift p)) := by + have he : g.val (i,p)=(c.target,translate a c.shift p) := by rw [hi,hc p hp] + unfold fullGroupAffineData + apply Prod.ext + · change (g.val (i,p)).1=c.target + exact congrArg Prod.fst he + · have hv := fullGroupSquareShift_spec g i p + rw [he] at hv + apply Prod.ext + · apply ordinary_injective + have hx := congrArg Prod.fst hv + simpa only [translate,Int.fract,squareTranslationPeriod,SquareStep.intPair, + Prod.fst_sub,Prod.fst_add,map_sub,map_intCast,add_sub_assoc,add_right_inj] using hx.symm + · apply ordinary_injective + have hx := congrArg Prod.snd hv + simpa only [translate,Int.fract,squareTranslationPeriod,SquareStep.intPair, + Prod.snd_sub,Prod.snd_add,map_sub,map_intCast,add_sub_assoc,add_right_inj] using hx.symm + +theorem fullGroupAffineData_arrangement {a m : ℕ} (g : polygonFullGroup a m) + (i : Fin m) : HasSquareArrangement (fullGroupAffineData g i) := by + obtain ⟨S,hS,hcover⟩ := g.property + let f (c : S) (p : GenericSquare a) := (decide (p∈c.val.domain.val),squareTranslationPeriod c.val.shift p) + have hf (c : S) : HasSquareArrangement (f c) := + squareArrangement_pair (polygon_hasSquareArrangement c.val.domain.property) + (squareTranslationPeriod_arrangement c.val.shift) + obtain ⟨T,hT⟩ := squareArrangement_finite_family f hf + refine ⟨T,fun p q h => ?_⟩ + obtain ⟨c,hc,hi,hp⟩ := hcover (i,p) + have he := congrFun (hT p q h) ⟨c,hc⟩ + have hq : q∈c.domain.val := (decide_eq_decide.mp (congrArg Prod.fst he)).mp hp + rw [fullGroupAffineData_chart g i p c (hS c hc) hi hp, + fullGroupAffineData_chart g i q c (hS c hc) hi hq] + exact congrArg (fun k => (c.target,c.shift-SquareStep.intPair k)) (congrArg Prod.snd he) + +noncomputable def flagAffineData {a m : ℕ} {v : ℝ×ℝ} (g : polygonFullGroup a m) + (i : Fin m) (z : SquareFlag a v) : Fin m × (CutRing×CutRing) := + flagValue (fullGroupAffineData g i) (fullGroupAffineData_arrangement g i) z + +theorem flagAffineData_chart {a m : ℕ} {v : ℝ×ℝ} (g : polygonFullGroup a m) + (i : Fin m) (z : SquareFlag a v) (c : TableChart a m) (hc : c.Holds g.val) + (hi : i=c.source) (hz : flagMem c.domain z) : + flagAffineData g i z=(c.target,c.shift-SquareStep.intPair (flagShiftPeriod c.shift z)) := by + obtain ⟨N,hN,hzN,hf⟩ := flagMem_iff c.domain z + obtain ⟨M,hM,hzM,hp⟩ := squareTranslationPeriod_germ c.shift z + apply flagValue_eq + refine ⟨N∩M,hN.inter hM,⟨hzN,hzM⟩,fun p hpm hpv => ?_⟩ + rw [fullGroupAffineData_chart g i p c hc hi ((hf p hpm.1 hpv).mpr hz),hp p hpm.2 hpv] + +theorem flagAffineData_selected {a m : ℕ} {v : ℝ×ℝ} (g : polygonFullGroup a m) + (z : FlagTrackPoint a m v) : + flagAffineData g z.1 z.2=((flagChart g z).target, + (flagChart g z).shift-SquareStep.intPair (flagShiftPeriod (flagChart g z).shift z.2)) := + flagAffineData_chart g z.1 z.2 (flagChart g z) (flagChart_spec g z).1 + (flagChart_spec g z).2.1 (flagChart_spec g z).2.2 + +theorem flagAffineData_action {a m : ℕ} {v : ℝ×ℝ} (g : polygonFullGroup a m) + (z : FlagTrackPoint a m v) : + (flagAction g z).1=(flagAffineData g z.1 z.2).1 ∧ + (flagAction g z).2.val=z.2.val+ + (ordinary (flagAffineData g z.1 z.2).2.1,ordinary (flagAffineData g z.1 z.2).2.2) := by + rw [flagAffineData_selected] + refine ⟨rfl,?_⟩ + apply Prod.ext <;> + simp only [flagAction,flagTranslate_val,flagFract_eq,flagShiftPeriod,SquareStep.intPair, + Prod.fst_sub,Prod.snd_sub,Prod.fst_add,Prod.snd_add,map_sub,map_intCast] <;> ring + +theorem flagAffineData_conjugate {a m D : ℕ} {v : ℝ×ℝ} (hD : 0 + simp only [SquareStep.intPair,Prod.fst_sub,Prod.snd_sub,Prod.fst_add,Prod.snd_add, + map_sub,map_intCast] <;> ring + +end FullGroupAffineData + +section FlagAffineControl +open Classical + +theorem squareArrangement_finite_range {a : ℕ} {K : Type*} (f : GenericSquare a → K) + (hf : HasSquareArrangement f) : (Set.range f).Finite := by + obtain ⟨S,hS⟩ := hf + let p (k : Set.range f) : GenericSquare a := k.property.choose + have hp (k : Set.range f) : f (p k)=k.val := k.property.choose_spec + let q (k : Set.range f) : S → Bool := fun l => squareSign l.val (p k) + have hq : Function.Injective q := by + intro k j h + apply Subtype.ext + rw [← hp k,← hp j] + exact hS (p k) (p j) (fun l hl => congrFun h ⟨l,hl⟩) + have : Finite (Set.range f) := Finite.of_injective q hq + exact Set.toFinite _ + +theorem flagValue_mem_range {a : ℕ} {v : ℝ×ℝ} {K : Type*} (f : GenericSquare a → K) + (hf : HasSquareArrangement f) (z : SquareFlag a v) : flagValue f hf z∈Set.range f := by + obtain ⟨N,hN,hz,hf'⟩ := flagValue_spec f hf z + obtain ⟨p,hp,hpv⟩ := squareSector_generic z hN hz + exact ⟨p,hf' p hp hpv⟩ + +theorem flagValue_finite_range {a : ℕ} {v : ℝ×ℝ} {K : Type*} (f : GenericSquare a → K) + (hf : HasSquareArrangement f) : (Set.range (flagValue (v:=v) f hf)).Finite := + (squareArrangement_finite_range f hf).subset (by rintro _ ⟨z,rfl⟩; exact flagValue_mem_range f hf z) + +theorem flagAffineData_finite_range {a m : ℕ} {v : ℝ×ℝ} (g : polygonFullGroup a m) : + (Set.range (fun z : FlagTrackPoint a m v => flagAffineData g z.1 z.2)).Finite := by + have h (i : Fin m) : (Set.range (flagAffineData (v:=v) g i)).Finite := + flagValue_finite_range (fullGroupAffineData g i) (fullGroupAffineData_arrangement g i) + apply (Set.finite_iUnion h).subset + rintro _ ⟨z,rfl⟩ + exact Set.mem_iUnion.mpr ⟨z.1,⟨z.2,rfl⟩⟩ + +theorem flagAffineData_bounded {a m : ℕ} {v : ℝ×ℝ} (g : polygonFullGroup a m) + (f : (CutRing×CutRing) → ℝ) : + ∃C : ℝ,0 ≤ C ∧ ∀z : FlagTrackPoint a m v,|f (flagAffineData g z.1 z.2).2| ≤ C := by + let S := (flagAffineData_finite_range (v:=v) g).toFinset + refine ⟨∑d∈S,|f d.2|,Finset.sum_nonneg (fun _ _ => abs_nonneg _),fun z => ?_⟩ + apply Finset.single_le_sum (f:=fun d : Fin m × (CutRing×CutRing) => |f d.2|) (fun _ _ => abs_nonneg _) + change flagAffineData g z.1 z.2∈(flagAffineData_finite_range (v:=v) g).toFinset + exact (Set.Finite.mem_toFinset _).mpr ⟨z,rfl⟩ + +theorem flagAffineData_separator_control {a m : ℕ} {v : ℝ×ℝ} (g : polygonFullGroup a m) : + ∃R : ℝ,0 ≤ R ∧ ∀(s κ : ℝ),0 < s → 0 < κ → R ≤ κ/s → + ∀(i : Fin m) (z w : SquareFlag a v),separatorMatrix (thresholdLaw s κ) z w ≠ 0 → + flagAffineData g i z=flagAffineData g i w := by + choose R hR hcontrol using fun i : Fin m => separatorMatrix_controls_step (v:=v) + (fullGroupAffineData g i) (fullGroupAffineData_arrangement g i) + refine ⟨∑i,R i,Finset.sum_nonneg (fun i _ => hR i),fun s κ hs hκ hbound i z w hp => ?_⟩ + exact hcontrol i s κ hs hκ ((Finset.single_le_sum + (fun j _ => hR j) (Finset.mem_univ i)).trans hbound) z w hp + +theorem flagAffineData_inverse {a m : ℕ} {v : ℝ×ℝ} (g : polygonFullGroup a m) + (z : FlagTrackPoint a m v) : + flagAffineData g⁻¹ (flagAction g z).1 (flagAction g z).2=(z.1,-(flagAffineData g z.1 z.2).2) := by + have he : flagAction g⁻¹ (flagAction g z)=z := by rw [← flagAction_mul,inv_mul_cancel,flagAction_one] + have hf := flagAffineData_action g z + have hb := flagAffineData_action g⁻¹ (flagAction g z) + rw [he] at hb + apply Prod.ext + · exact hb.1.symm + · rw [hf.2] at hb + apply Prod.ext + · apply ordinary_injective + have hh := congrArg Prod.fst hb.2 + simp only [Prod.fst_add] at hh + simp only [Prod.fst_neg,map_neg] + linarith + · apply ordinary_injective + have hh := congrArg Prod.snd hb.2 + simp only [Prod.snd_add] at hh + simp only [Prod.snd_neg,map_neg] + linarith + +end FlagAffineControl + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/GoodRowSeparators.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/GoodRowSeparators.lean new file mode 100644 index 0000000000000000000000000000000000000000..16e31dee6aa2c4e5a310fc6735c56dda37803bd4 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/GoodRowSeparators.lean @@ -0,0 +1,275 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.FinePatchAtlas +import OAI.GroupTheory.SimpleAmenable.RandomFields.UniformThresholdCDF +import OAI.GroupTheory.SimpleAmenable.Arithmetic.UniformLatticeRiemann +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.DirectionStripCounts + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section GoodRowSeparators +open Classical MeasureTheory ProbabilityTheory + +theorem flagSeparates_near_row {a : ℕ} {v : ℝ×ℝ} {j : Fin 4} {c : CutRing} + {z w : SquareFlag a v} (h : FlagSeparates j c z w) : + |cutForm a j z.val-ordinary c| ≤ (1+|ordinary (cutTau^a)|)*dist z.val w.val := by + have hc := flagSeparates_ordinary_bound h + have hb := abs_le.mp (cutForm_dist_bound a j z.val w.val) + rcases le_total (cutForm a j z.val) (cutForm a j w.val) with hh|hh + · rw [min_eq_left hh,max_eq_right hh] at hc + exact abs_le.mpr ⟨by linarith [hc.1,hc.2],by linarith [hc.1,hc.2]⟩ + · rw [min_eq_right hh,max_eq_left hh] at hc + exact abs_le.mpr ⟨by linarith [hc.1,hc.2],by linarith [hc.1,hc.2]⟩ + +theorem directionNoCutProbability_eq_one {a : ℕ} {v : ℝ×ℝ} {s κ : ℝ} + (hs : 0 < s) (hκ : 0 < κ) (j : Fin 4) (z w : SquareFlag a v) + (h : ∀c, |conjugate c| ≤ 2*κ/s → ¬ FlagSeparates j c z w) : + directionNoCutProbability s κ j z w=1 := by + have hi : κ/s < 2*κ/s := (div_lt_div_iff_of_pos_right hs).mpr (by linarith) + have hinter : Set.Icc (κ/s) (2*κ/s) ∩ directionNoCut j z w = Set.Icc (κ/s) (2*κ/s) := by + apply Set.inter_eq_left.mpr + intro t ht c hc + exact h c (hc.trans ht.2) + have he : cond volume (Set.Icc (κ/s) (2*κ/s)) (directionNoCut j z w)=1 := by + calc + _ = cond volume (Set.Icc (κ/s) (2*κ/s)) (Set.Icc (κ/s) (2*κ/s)) := by + rw [cond_apply measurableSet_Icc,cond_apply measurableSet_Icc,hinter,Set.inter_self] + _ = 1 := cond_apply_self + (by rw [Real.volume_Icc]; exact ENNReal.ofReal_ne_zero_iff.mpr (sub_pos.mpr hi)) + (by rw [Real.volume_Icc]; exact ENNReal.ofReal_ne_top) + exact congrArg ENNReal.toReal he + +theorem separatorMatrix_eq_one_on_good_row {a : ℕ} {v : ℝ×ℝ} {s κ : ℝ} + (hs : 0 < s) (hκ : 0 < κ) (z w : SquareFlag a v) (hw : dist z.val w.val ≤ s) + (hz : ∀j c, |conjugate c| ≤ 2*κ/s → + (1+|ordinary (cutTau^a)|)*s < |cutForm a j z.val-ordinary c|) : + separatorMatrix (thresholdLaw s κ) z w=1 := by + rw [separatorMatrix_product hs hκ] + suffices ∀j,directionNoCutProbability s κ j z w=1 by simp [this] + intro j + apply directionNoCutProbability_eq_one hs hκ + intro c hc hsep + have hb := (flagSeparates_near_row hsep).trans + (mul_le_mul_of_nonneg_left hw (by positivity)) + exact (not_le_of_gt (hz j c hc)) hb + +theorem squareFlag_cutForm_bound {a : ℕ} {v : ℝ×ℝ} (j : Fin 4) (z : SquareFlag a v) : + |cutForm a j z.val| ≤ 1+|ordinary (cutTau^a)| := by + have hn : ‖z.val‖ ≤ (1:ℝ) := by + rw [Prod.norm_def] + apply max_le + · rw [Real.norm_eq_abs,abs_of_nonneg z.property.2.1.1] + exact z.property.2.1.2 + · rw [Real.norm_eq_abs,abs_of_nonneg z.property.2.2.1.1] + exact z.property.2.2.1.2 + have hz : cutForm a j 0=0 := by fin_cases j <;> simp [cutForm] + have hh := cutForm_dist_bound a j z.val 0 + rw [hz,sub_zero,dist_zero_right] at hh + exact hh.trans (by nlinarith [abs_nonneg (ordinary (cutTau^a))]) + +def flagBadSeparatorRow {a m D : ℕ} {v : ℝ×ℝ} (s κ R : ℝ) : Set (FlagSite a m D v) := + {z | z∈flagSiteBox R ∧ ∃j c, |conjugate c| ≤ 2*κ/s ∧ + |cutForm a j z.val.2.val-ordinary c| ≤ (1+|ordinary (cutTau^a)|)*s} + +theorem flagBadSeparatorRow_card_bound {a m D : ℕ} {v : ℝ×ℝ} (hD : 0 < D) + {Q κ s N : ℝ} (hQ : 0 < Q) (hκ : 0 < κ) (hs : 0 < s) + (hs₁ : s ≤ 1) (hN : 1 ≤ N) (hscale : 1 ≤ s*N) + (S : Finset (FlagSite a m D v)) (hS : ∀z∈S,z∈flagBadSeparatorRow s κ (Q*N)) : + (S.card:ℝ) ≤ 4*(m*(4*(D:ℝ)^2*(1+|conjugate (cutTau^a)|)*(1+|ordinary (cutTau^a)|)*Q+2)* + (2*(D:ℝ)^2*Q+2)*(16*(1+|ordinary (cutTau^a)|)+2))*(κ+s)*N^2 := by + let L : ℝ := 1+|ordinary (cutTau^a)| + have hL : 0 ≤ L := by dsimp [L]; positivity + let row := fun j : Fin 4 => S.filter (fun z => ∃c : CutRing, |conjugate c| ≤ 2*κ/s ∧ + |cutForm a j z.val.2.val-ordinary c| ≤ L*s) + have hh : S ⊆ Finset.univ.biUnion row := by + intro z hz + obtain ⟨j,c,hc,hd⟩ := (hS z hz).2 + exact Finset.mem_biUnion.mpr ⟨j,Finset.mem_univ _,Finset.mem_filter.mpr ⟨hz,c,hc,hd⟩⟩ + have hc j := exceptional_direction_rows hD j (show 0 ≤ 2*L by positivity) hL hQ hκ hs hN hscale + (row j) (by + intro z hz + obtain ⟨hzS,c,hc,hd⟩ := Finset.mem_filter.mp hz + refine ⟨c,?_,hc,(hS z hzS).1,hd⟩ + have hb := squareFlag_cutForm_bound j z.val.2 + have htri := abs_sub_le (ordinary c) (cutForm a j z.val.2.val) 0 + rw [sub_zero,sub_zero,abs_sub_comm (ordinary c)] at htri + change |cutForm a j z.val.2.val| ≤ L at hb + exact htri.trans (by nlinarith)) + have hn : S.card ≤ ∑j : Fin 4,(row j).card := + (Finset.card_le_card hh).trans Finset.card_biUnion_le + have hn' : (S.card:ℝ) ≤ ∑j : Fin 4,((row j).card:ℝ) := by exact_mod_cast hn + refine hn'.trans ((Finset.sum_le_sum (fun j _ => hc j)).trans_eq ?_) + simp only [Finset.sum_const,Finset.card_univ,Fintype.card_fin,nsmul_eq_mul] + dsimp [L] + ring + +end GoodRowSeparators + +section NormalizedTentMass +open Classical MeasureTheory + +noncomputable def unitTent (x : ℝ) : ℝ := max (1-|x|) 0 + +theorem unitTent_bounds (x : ℝ) : 0 ≤ unitTent x ∧ unitTent x ≤ 1 := by + constructor + · exact le_max_right _ _ + · exact max_le (by linarith [abs_nonneg x]) zero_le_one + +theorem unitTent_lipschitz : LipschitzWith 1 unitTent := by + apply LipschitzWith.of_dist_le_mul + intro x y + simp only [Real.dist_eq,NNReal.coe_one,one_mul] + calc + _ ≤ |(1-|x|)-(1-|y|)| := abs_max_sub_max_le_abs _ _ 0 + _ = abs (abs x - abs y) := by rw [show (1-|x|)-(1-|y|)=-(abs x - abs y) by ring,abs_neg] + _ ≤ |x-y| := abs_abs_sub_abs_le_abs_sub x y + +theorem unitTent_zero {x : ℝ} (hx : 1 ≤ |x|) : unitTent x=0 := + max_eq_right (by linarith) + +theorem unitTent_compact : HasCompactSupport unitTent := by + apply HasCompactSupport.intro (isCompact_Icc (a:=(-1:ℝ)) (b:=1)) + intro x hx + by_contra hn + have hh : |x| < 1 := lt_of_not_ge (fun h => hn (unitTent_zero h)) + exact hx ⟨(abs_lt.mp hh).1.le,(abs_lt.mp hh).2.le⟩ + +theorem unitTent_integral : ∫x,unitTent x=1 := by + have hsupp : Function.support unitTent ⊆ Set.Ioc (-1) 1 := by + intro x hx + have hh : |x| < 1 := lt_of_not_ge (fun h => hx (unitTent_zero h)) + exact ⟨(abs_lt.mp hh).1,(abs_lt.mp hh).2.le⟩ + rw [← intervalIntegral.integral_eq_integral_of_support_subset hsupp] + rw [← intervalIntegral.integral_add_adjacent_intervals + (unitTent_lipschitz.continuous.intervalIntegrable (-1) 0) + (unitTent_lipschitz.continuous.intervalIntegrable 0 1)] + have hneg : Set.EqOn unitTent (fun x => 1+x) (Set.uIcc (-1) 0) := by + intro x hx + rw [Set.uIcc_of_le (by norm_num)] at hx + simp only [unitTent,abs_of_nonpos hx.2,sub_neg_eq_add] + exact max_eq_left (by linarith [hx.1]) + have hpos : Set.EqOn unitTent (fun x => 1-x) (Set.uIcc 0 1) := by + intro x hx + rw [Set.uIcc_of_le (by norm_num)] at hx + simp only [unitTent,abs_of_nonneg hx.1] + exact max_eq_left (by linarith [hx.2]) + rw [intervalIntegral.integral_congr hneg,intervalIntegral.integral_congr hpos, + intervalIntegral.integral_add (f:=fun _ : ℝ => (1:ℝ)) (g:=fun x : ℝ => x) (continuous_const.intervalIntegrable _ _) + (continuous_id.intervalIntegrable _ _), + intervalIntegral.integral_sub (f:=fun _ : ℝ => (1:ℝ)) (g:=fun x : ℝ => x) (continuous_const.intervalIntegrable _ _) + (continuous_id.intervalIntegrable _ _)] + norm_num [intervalIntegral.integral_const,integral_id] + +noncomputable def doubleUnitTent (x : Fin 2 → ℝ) : ℝ := ∏i,unitTent (x i) + +theorem doubleUnitTent_bounds (x : Fin 2 → ℝ) : 0 ≤ doubleUnitTent x ∧ doubleUnitTent x ≤ 1 := by + exact ⟨Finset.prod_nonneg (fun i _ => (unitTent_bounds (x i)).1), + Finset.prod_le_one₀ (fun i _ => (unitTent_bounds (x i)).1) (fun i _ => (unitTent_bounds (x i)).2)⟩ + +theorem doubleUnitTent_lipschitz : LipschitzWith 2 doubleUnitTent := by + apply LipschitzWith.of_dist_le_mul + intro x y + rw [Real.dist_eq] + have hp := unit_product_sub_bound Finset.univ (fun i => unitTent (x i)) (fun i => unitTent (y i)) + (fun i _ => unitTent_bounds (x i)) (fun i _ => unitTent_bounds (y i)) + calc + _ ≤ ∑i : Fin 2,|unitTent (x i)-unitTent (y i)| := hp + _ ≤ ∑i : Fin 2,dist x y := by + apply Finset.sum_le_sum + intro i _ + have hh := unitTent_lipschitz.dist_le_mul (x i) (y i) + rw [Real.dist_eq,NNReal.coe_one,one_mul] at hh + exact hh.trans (dist_le_pi_dist x y i) + _ = _ := by simp + +theorem doubleUnitTent_zero {x : Fin 2 → ℝ} (hx : 1 < ‖x‖) : doubleUnitTent x=0 := by + have hh : ∃i,1 < |x i| := by + by_contra hn + push Not at hn + have he : ‖x‖ ≤ (1:ℝ) := by + rw [← dist_zero_right] + exact (dist_pi_le_iff zero_le_one).mpr (fun i => by simpa [Real.dist_eq] using hn i) + exact (not_le_of_gt hx) he + obtain ⟨i,hi⟩ := hh + exact Finset.prod_eq_zero (Finset.mem_univ i) (unitTent_zero hi.le) + +theorem doubleUnitTent_integral : ∫x,doubleUnitTent x=1 := by + unfold doubleUnitTent + rw [integral_fintype_prod_volume_eq_prod] + simp [unitTent_integral] + +noncomputable def pairedUnitTent (x : (Fin 2 → ℝ)×(Fin 2 → ℝ)) : ℝ := + doubleUnitTent x.1*doubleUnitTent x.2 + +theorem pairedUnitTent_bounds (x : (Fin 2 → ℝ)×(Fin 2 → ℝ)) : + 0 ≤ pairedUnitTent x ∧ pairedUnitTent x ≤ 1 := by + exact ⟨mul_nonneg (doubleUnitTent_bounds x.1).1 (doubleUnitTent_bounds x.2).1, + (mul_le_of_le_one_left (doubleUnitTent_bounds x.2).1 + (doubleUnitTent_bounds x.1).2).trans (doubleUnitTent_bounds x.2).2⟩ + +theorem unit_mul_sub_bound {a b c d : ℝ} (ha : a∈Set.Icc (0:ℝ) 1) (hb : b∈Set.Icc (0:ℝ) 1) + (hc : c∈Set.Icc (0:ℝ) 1) (hd : d∈Set.Icc (0:ℝ) 1) : + |a*b-c*d| ≤ |a-c|+|b-d| := by + have h := unit_product_sub_bound (Finset.univ : Finset (Fin 2)) ![a,b] ![c,d] + (by intro i _; fin_cases i <;> assumption) (by intro i _; fin_cases i <;> assumption) + simpa [Fin.prod_univ_two,Fin.sum_univ_two] using h + +theorem pairedUnitTent_lipschitz : LipschitzWith 4 pairedUnitTent := by + apply LipschitzWith.of_dist_le_mul + intro x y + rw [Real.dist_eq] + have hh := unit_mul_sub_bound (doubleUnitTent_bounds x.1) (doubleUnitTent_bounds x.2) + (doubleUnitTent_bounds y.1) (doubleUnitTent_bounds y.2) + have h₁ := doubleUnitTent_lipschitz.dist_le_mul x.1 y.1 + have h₂ := doubleUnitTent_lipschitz.dist_le_mul x.2 y.2 + rw [Real.dist_eq] at h₁ h₂ + change |pairedUnitTent x-pairedUnitTent y| ≤ _ at hh + have hd₁ : dist x.1 y.1 ≤ dist x y := by rw [Prod.dist_eq]; exact le_max_left _ _ + have hd₂ : dist x.2 y.2 ≤ dist x y := by rw [Prod.dist_eq]; exact le_max_right _ _ + norm_num at h₁ h₂ ⊢ + linarith + +theorem pairedUnitTent_zero {x : (Fin 2 → ℝ)×(Fin 2 → ℝ)} (hx : 1 < ‖x‖) : + pairedUnitTent x=0 := by + rw [Prod.norm_def,lt_max_iff] at hx + rcases hx with hh|hh + · simp [pairedUnitTent,doubleUnitTent_zero hh] + · simp [pairedUnitTent,doubleUnitTent_zero hh] + +theorem pairedUnitTent_integrable : Integrable pairedUnitTent := by + apply pairedUnitTent_lipschitz.continuous.integrable_of_hasCompactSupport + apply HasCompactSupport.intro (isCompact_closedBall (0 : (Fin 2 → ℝ)×(Fin 2 → ℝ)) 1) + intro x hx + exact pairedUnitTent_zero (lt_of_not_ge (by simpa only [Metric.mem_closedBall,dist_zero_right] using hx)) + +theorem pairedUnitTent_integral : ∫x,pairedUnitTent x=1 := by + change (∫x : (Fin 2 → ℝ)×(Fin 2 → ℝ),doubleUnitTent x.1*doubleUnitTent x.2 ∂ + (volume.prod volume))=1 + rw [integral_prod_mul,doubleUnitTent_integral,mul_one] + +theorem pairedQuadratic_tent_mass {d s t : ℝ} (hd : 1 ≤ d) (hs : 0 < s) (ht : 0 < t) + (hst : 36 ≤ s*t) (q : (Fin 2 → ℝ)×(Fin 2 → ℝ)) : + ∃S : Finset (CutRing×CutRing), + (∀z,z∉S → pairedUnitTent (q+pairedQuadraticEmbedding d s t z)=0) ∧ + |(5/(d^4*s^2*t^2))*(∑z∈S,pairedUnitTent (q+pairedQuadraticEmbedding d s t z))-1| ≤ + 38880/(d*Real.sqrt (s*t)) := by + obtain ⟨S,hS,hh⟩ := pairedQuadratic_riemann_uniform hd hs ht hst (show 0 ≤ (1:ℝ) by norm_num) + pairedUnitTent_integrable pairedUnitTent_lipschitz (fun x hx => pairedUnitTent_zero hx) q + refine ⟨S,hS,?_⟩ + rw [pairedUnitTent_integral] at hh + convert hh using 1 + norm_num + ring + +end NormalizedTentMass + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/InactiveNeighborhoodActions.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/InactiveNeighborhoodActions.lean new file mode 100644 index 0000000000000000000000000000000000000000..91dc58881c400e0de4eb3b4b131f5841e25984d1 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/InactiveNeighborhoodActions.lean @@ -0,0 +1,239 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.InactiveQuadrantAction +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.InactiveQuadrantAnchors +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.ConcurrentInwardModel +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.InwardMargins + +namespace OAI + +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +section InactiveNeighborhoodActions + +theorem strict_rectangle_ball (l v : Fin 2 → ℝ) (z : ℝ × ℝ) + (hz : ∀ k, l k realCoordinate y k) := by + fin_cases k + · exact continuous_fst + · exact continuous_snd + exact (isOpen_lt continuous_const hc).inter (isOpen_lt hc continuous_const) + obtain ⟨δ,hδ,hball⟩ := Metric.isOpen_iff.mp hO z (Set.mem_iInter.mpr hz) + exact ⟨δ,hδ,fun y hy => Set.mem_iInter.mp (hball hy)⟩ + +namespace InitialCoverSystem.RectangularAtlas +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + {B : InitialCoverSystem a r m hm M} + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] (A : B.RectangularAtlas) + +theorem inactive_near_action_neighborhood (hlarge : 20 ≤ m+1) + (hr : 0 (primitiveTests (a := a) (r := r) + (coordinateWindowPrimitives n q) e).val) (coordinateRectangle a L V).val → + ∀ f : TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm), + B.AlignedSmallSupported f → + SmallControlled B.c f (B.windowSector (by omega) n (A.rectangles n) q (coordinateRectangle a L V)) → + ∀ (I : ControlAlphabet (Fin (m+1))) (s : UniversalExtension (alternatingGroup I.val)), + ∀ x ∈ f.range, + A.slope (by omega) d v (universalMap (subtypeAlternatingHom I.val) s)*x* + (A.slope (by omega) d v (universalMap (subtypeAlternatingHom I.val) s))⁻¹ = + (if positive then B.c (subtypeAlternatingHom I.val (universalProjection _ s)) else 1)*x* + (if positive then B.c (subtypeAlternatingHom I.val (universalProjection _ s)) else 1)⁻¹ := by + obtain ⟨u,positive,hline,hsign,hquad⟩ := inactive_slope_quadrant_anchor a d + (integralCutForm a (slopeDirection d) v) A.radius z hinactive hnear + obtain ⟨δ,hδ,hball⟩ := strict_rectangle_ball + (fun k => ordinary (pointCoordinate u k)+ordinary (signQuadrantLower A.radius d positive k)) + (fun k => ordinary (pointCoordinate u k)+ordinary (signQuadrantUpper A.radius d positive k)) z hquad + refine ⟨δ,hδ,positive,hsign,?_⟩ + intro L V hLV hclip hsmall n q hW f hf hc I s x hx + have hL : dist (ordinary (L 0),ordinary (L 1)) z<δ := by + rw [Prod.dist_eq,Real.dist_eq,Real.dist_eq,max_lt_iff] + exact ⟨(hsmall 0).1,(hsmall 1).1⟩ + have hV : dist (ordinary (V 0),ordinary (V 1)) z<δ := by + rw [Prod.dist_eq,Real.dist_eq,Real.dist_eq,max_lt_iff] + exact ⟨(hsmall 0).2,(hsmall 1).2⟩ + have hlo (k : Fin 2) := (hball (ordinary (L 0),ordinary (L 1)) hL k).1.le + have hup (k : Fin 2) := (hball (ordinary (V 0),ordinary (V 1)) hV k).2.le + exact A.inactive_quadrant_action hlarge hr d v u positive hline.symm L V hLV hclip + (fun k => by have he : realCoordinate (ordinary (L 0),ordinary (L 1)) k=ordinary (L k) := by fin_cases k <;> rfl + simpa only [he] using hlo k) + (fun k => by have he : realCoordinate (ordinary (V 0),ordinary (V 1)) k=ordinary (V k) := by fin_cases k <;> rfl + simpa only [he] using hup k) n q hW f hf hc I s x hx + +end InitialCoverSystem.RectangularAtlas +end InactiveNeighborhoodActions + +namespace ConcurrentGeometry +variable {a : ℕ} {r : CutRing} (C : ConcurrentGeometry a r) {ι : Type*} + +def InwardChartNeighborhood (t : VertexType (commonVertexDenominator a)) (u : CutRing × CutRing) + (z : ℝ × ℝ) : Prop := + ∀ y : ℝ × ℝ, dist y z axisDirection d.1) + let K : Sum ι (Fin 2 × Bool) → CutRing := Sum.elim c (fun d => if d.2 then 1 else 0) + obtain ⟨t,u,hcell,hactive⟩ := C.simultaneous_active_neighborhood ha J K z + have hb (k : Fin 2) (hk : realCoordinate z k=0 ∨ realCoordinate z k=1) : + ∃ b : Bool, cutForm a (J (.inr (k,b))) z=ordinary (K (.inr (k,b))) := by + have haxis : cutForm a (axisDirection k) z=realCoordinate z k := by fin_cases k <;> rfl + rcases hk with hk | hk + · exact ⟨false,by simpa only [J,K,Sum.elim_inr,Bool.false_eq_true,↓reduceIte,map_zero,haxis] using hk⟩ + · exact ⟨true,by simpa only [J,K,Sum.elim_inr,↓reduceIte,map_one,haxis] using hk⟩ + refine ⟨⟨(t,u),hcell,(fun i hi => (hactive (.inl i) hi).1), + (fun i hi => (hactive (.inl i) hi).2),?_,?_⟩⟩ + · intro k hk + obtain ⟨b,hb⟩ := hb k hk + have he := congrArg ordinary (hactive (.inr (k,b)) hb).1 + have haxis : cutForm a (axisDirection k) z=realCoordinate z k := by fin_cases k <;> rfl + change ordinary (integralCutForm a (axisDirection k) (u+C.anchors t (axisDirection k)))=_ at he + rw [integralCutForm_axis] at he + exact he.trans (by simpa only [J,Sum.elim_inr,haxis] using hb.symm) + · intro k hk + obtain ⟨b,hb⟩ := hb k hk + exact (hactive (.inr (k,b)) hb).2 + +namespace InwardChart +variable {C} {j : ι → Fin 4} {c : ι → CutRing} {z : ℝ × ℝ} (T : C.InwardChart j c z) + +theorem canonical_mem (hr : 0 ⟨(T.neighborhood p.val hp k).1.le,(T.neighborhood p.val hp k).2⟩) + +theorem assignment_realized [Finite ι] (hr : 0 cutPolygon a (j i) (c i)) q= + polygonAssignment (fun i => C.localDecision T.vertex T.offset z (j i) (c i)) p := + C.localDecision_assignment_realized hr T.vertex T.offset j c z hz₁ hz₂ + T.active_anchor T.boundary_anchor T.active_bound T.boundary_bound p hp N hN hz + +theorem local_decisions_eq (hr : 0 C.localDecision T.vertex T.offset z (j i) (c i)) p= + polygonAssignment (localCutFamily j c z) p := by + classical + have hy : p.val=(Int.fract p.val.1,Int.fract p.val.2) := by + rw [Int.fract_eq_self.mpr p.property.1,Int.fract_eq_self.mpr p.property.2.1] + have hcell k := (T.neighborhood p.val hp k).imp le_of_lt le_of_lt + funext i + apply decide_eq_decide.mpr + by_cases hi : cutForm a (j i) z=ordinary (c i) + · have hd := C.positiveDecision_planar hr T.vertex T.offset (j i) (T.active_bound i hi) p p.val hy hcell + rw [T.active_anchor i hi] at hd + simp only [localDecision,localCutFamily,ite_eq_left hi] + change (p ∉ (C.positiveDecision T.vertex T.offset (j i)).val) ↔ cutForm a (j i) p.val C.localDecision T.vertex T.offset z (j i) (c i)) + (polygonFormalMask (fun i => cutPolygon a (j i) (c i)) (R i)) + +theorem polygons_assignment_realized [Finite ι] {κ : Type*} + (hr : 0 halfPlane a (j i) (c i)) (R k).val) + (p : GenericSquare a) (hp : p ∈ (C.inwardMargin T.vertex T.offset z).val) + (N : Set (ℝ × ℝ)) (hN : IsOpen N) (hz : z ∈ N) : + ∃ q : GenericSquare a, q.val ∈ N ∧ polygonAssignment R q=polygonAssignment (T.polygons R) p := by + obtain ⟨q,hq,he⟩ := T.assignment_realized hr hz₁ hz₂ p hp N hN hz + refine ⟨q,hq,?_⟩ + funext k + apply decide_eq_decide.mpr + change (q ∈ (R k).val) ↔ polygonAssignment (fun i => C.localDecision T.vertex T.offset z (j i) (c i)) p ∈ + polygonFormalMask (fun i => cutPolygon a (j i) (c i)) (R k) + rw [← he] + exact (polygonFormalMask_mem _ (R k) (hR k) q).symm + +theorem polygons_locally_eq [Finite ι] {κ : Type*} + (hr : 0 halfPlane a (j i) (c i)) (R k).val) : + ∃ N : Set (ℝ × ℝ), IsOpen N ∧ z ∈ N ∧ ∀ p : GenericSquare a, p.val ∈ N → + p ∈ (C.inwardMargin T.vertex T.offset z).val ∧ ∀ k, p ∈ (T.polygons R k).val ↔ p ∈ (R k).val := by + obtain ⟨O,hO,hz,hlocal⟩ := localPolygonFamily_locally_eq j c z R hR + refine ⟨O ∩ Metric.ball z (C.epsilon/2),hO.inter Metric.isOpen_ball, + ⟨hz,by simp only [Metric.mem_ball,dist_self]; linarith [C.positive]⟩,?_⟩ + intro p hp + refine ⟨T.canonical_mem hr p hp.2,fun k => ?_⟩ + have he := T.local_decisions_eq hr p hp.2 + change polygonAssignment (fun i => C.localDecision T.vertex T.offset z (j i) (c i)) p ∈ + polygonFormalMask (fun i => cutPolygon a (j i) (c i)) (R k) ↔ _ + rw [he] + exact hlocal p hp.1 k + +end InwardChart +end ConcurrentGeometry + +end SimpleAmenable + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/InactiveQuadrantAction.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/InactiveQuadrantAction.lean new file mode 100644 index 0000000000000000000000000000000000000000..2846ddddc06b759838a6222bc85c886c9e7a8d4e --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/InactiveQuadrantAction.lean @@ -0,0 +1,105 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.RectangularAtlas +import OAI.GroupTheory.SimpleAmenable.CentralCovers.GlobalSignControl + +namespace OAI + +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement + +theorem signQuadrant_bounds (s : CutRing) (hs : 0 ≤ ordinary s) + (d : Fin 2) (positive : Bool) (j : Fin 2) : + -ordinary s ≤ ordinary (signQuadrantLower s d positive j) ∧ + ordinary (signQuadrantUpper s d positive j) ≤ ordinary s := by + cases positive <;> by_cases h : j=d <;> + simp [signQuadrantLower,signQuadrantUpper,h] <;> linarith + +namespace InitialCoverSystem +namespace RectangularAtlas +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + {B : InitialCoverSystem a r m hm M} + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] (A : B.RectangularAtlas) + +theorem inactive_quadrant_action (hlarge : 20 ≤ m+1) + (hr : 0 < ordinary r ∧ ordinary r < 1/2) + (d : Fin 2) (z z' : CutRing × CutRing) (positive : Bool) + (hline : integralCutForm a (slopeDirection d) z=integralCutForm a (slopeDirection d) z') + (L V : Fin 2 → CutRing) (hLV : ∀ j, ordinary (L j) ≤ ordinary (V j)) + (hz : ∀ j, -ordinary r ≤ ordinary (L j)-ordinary (pointCoordinate z j) ∧ + ordinary (V j)-ordinary (pointCoordinate z j) ≤ ordinary r) + (hlo : ∀ j, ordinary (pointCoordinate z' j)+ordinary (signQuadrantLower A.radius d positive j) ≤ ordinary (L j)) + (hup : ∀ j, ordinary (V j) ≤ ordinary (pointCoordinate z' j)+ordinary (signQuadrantUpper A.radius d positive j)) + (n : ℕ) (q : Fin 2 → ℤ) + (hW : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) + (coordinateWindowPrimitives n q) i).val) (coordinateRectangle a L V).val) + (f : TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm)) + (hf : B.AlignedSmallSupported f) + (hc : SmallControlled B.c f (B.windowSector (by omega) n (A.rectangles n) q (coordinateRectangle a L V))) + (I : ControlAlphabet (Fin (m+1))) (s : UniversalExtension (alternatingGroup I.val)) + (t : BoundedRelationCover M (alternatingGenerator a r m hm)) (ht : t ∈ f.range) : + A.slope (by omega) d z (universalMap (subtypeAlternatingHom I.val) s)*t* + (A.slope (by omega) d z (universalMap (subtypeAlternatingHom I.val) s))⁻¹ = + (if positive then B.c (subtypeAlternatingHom I.val (universalProjection (alternatingGroup I.val) s)) else 1)*t* + (if positive then B.c (subtypeAlternatingHom I.val (universalProjection (alternatingGroup I.val) s)) else 1)⁻¹ := by + have hbound (j : Fin 2) := signQuadrant_bounds A.radius A.radius_pos.le d positive j + have hdiff (j : Fin 2) : + |ordinary (L j)-ordinary (pointCoordinate z' j)| ≤ ordinary A.radius ∧ + |ordinary (V j)-ordinary (pointCoordinate z' j)| ≤ ordinary A.radius := by + have hb := hbound j + have hl := hlo j + have hu := hup j + have hlv := hLV j + constructor <;> apply abs_le.mpr <;> constructor <;> linarith + have hz' (j : Fin 2) : -ordinary r ≤ ordinary (L j)-ordinary (pointCoordinate z' j) ∧ + ordinary (V j)-ordinary (pointCoordinate z' j) ≤ ordinary r := by + have hh := hdiff j + have h₁ := (abs_le.mp hh.1).1 + have h₂ := (abs_le.mp hh.2).2 + constructor <;> linarith [A.radius_small] + have he := A.slope_line_action hlarge hr d z z' hline L V hLV hz hz' + (ordinary z'.1,ordinary z'.2) (by rw [cutForm_ordinary,hline]) + (fun j => by + have hh := hdiff j + have hh' : realCoordinate (ordinary z'.1,ordinary z'.2) j=ordinary (pointCoordinate z' j) := by + fin_cases j <;> rfl + rw [hh'] + constructor <;> linarith [A.radius_small]) n q hW f hf hc I s t ht + rw [he] + have hlab (j : Fin 2) : + symmetricWindowStart A.radius j ≤ endpointLabel (signQuadrantLower A.radius d positive j) ∧ + endpointLabel (signQuadrantLower A.radius d positive j) < + symmetricWindowStart A.radius j+symmetricWindowLength A.radius := by + unfold signQuadrantLower + split <;> split <;> first | exact (symmetricWindow_labels A.radius j).1 | exact (symmetricWindow_labels A.radius j).2.1 + have hvab (j : Fin 2) : + symmetricWindowStart A.radius j ≤ endpointLabel (signQuadrantUpper A.radius d positive j) ∧ + endpointLabel (signQuadrantUpper A.radius d positive j) < + symmetricWindowStart A.radius j+symmetricWindowLength A.radius := by + unfold signQuadrantUpper + split <;> split <;> first | exact (symmetricWindow_labels A.radius j).2.1 | exact (symmetricWindow_labels A.radius j).2.2 + have hside := signQuadrant_side (a := a) r A.radius hr + ⟨A.radius_pos,by linarith [A.radius_small]⟩ d positive + have hinc : coordinateRectangle a L V ≤ spatialTranslate z' + (coordinateRectangle a (signQuadrantLower A.radius d positive) (signQuadrantUpper A.radius d positive)) := by + rw [spatialTranslate_coordinateRectangle] + apply coordinateRectangle_mono L V _ _ + · intro j; simpa only [map_add,pointCoordinate,add_comm] using hlo j + · exact hLV + · intro j; simpa only [map_add,pointCoordinate,add_comm] using hup j + · intro j + have hb := hbound j + simp only [map_add,add_sub_add_right_eq_sub] + linarith [A.radius_small,hr.2] + have hc' := B.all_rectangle_control_to_sign hlarge A.rectangles _ _ A.u A.quadrants + d z' positive _ _ hlab hvab hside n q _ hW hinc f hf hc + have ht' := B.tangentSign_constant_action hlarge _ _ A.u A.quadrants d z' positive f hf hc' I s t ht + have hs := B.tangentSign_eq (by omega) A.k _ A.p _ A.u A.u A.charts A.quadrants d z' true + simpa only [slope,hs] using ht' + +end RectangularAtlas +end InitialCoverSystem + +end SimpleAmenable + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/InactiveQuadrantAnchors.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/InactiveQuadrantAnchors.lean new file mode 100644 index 0000000000000000000000000000000000000000..a799e227a527f3b67df19043e4409dc328491381 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/InactiveQuadrantAnchors.lean @@ -0,0 +1,104 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.LocalChartDecisions + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section InactiveQuadrantAnchors + +theorem positive_slope_quadrant_anchor (b c : CutRing) (hb : 1 ≤ ordinary b) + (x y : ℝ) (h : 0 < y-ordinary b*x-ordinary c) : + ∃ u v : CutRing, v-b*u=c ∧ + 0 < ordinary u-x ∧ ordinary u-x < y-ordinary b*x-ordinary c ∧ + 0 < y-ordinary v ∧ y-ordinary v < y-ordinary b*x-ordinary c := by + let δ := y-ordinary b*x-ordinary c + have hb' : 0 < ordinary b := by linarith + have hδ : 0 < δ := h + have hinterval : x+(δ/4)/ordinary b < x+(3*δ/4)/ordinary b := by + apply add_lt_add_right + exact (div_lt_div_iff_of_pos_right hb').mpr (by linarith) + obtain ⟨u,hu,hu'⟩ := exists_cut_between hinterval + have hL : δ/4 < (ordinary u-x)*ordinary b := + (div_lt_iff₀ hb').mp (by linarith) + have hU : (ordinary u-x)*ordinary b < 3*δ/4 := + (lt_div_iff₀ hb').mp (by linarith) + have hux : 0 < ordinary u-x := by nlinarith + refine ⟨u,b*u+c,by ring,hux,?_,?_,?_⟩ + · nlinarith + · simp only [map_add,map_mul] + dsimp [δ] at hL hU + nlinarith + · simp only [map_add,map_mul] + dsimp [δ] at hL hU + nlinarith + +theorem negative_slope_quadrant_anchor (b c : CutRing) (hb : 1 ≤ ordinary b) + (x y : ℝ) (h : y-ordinary b*x-ordinary c < 0) : + ∃ u v : CutRing, v-b*u=c ∧ + 0 < x-ordinary u ∧ x-ordinary u < -(y-ordinary b*x-ordinary c) ∧ + 0 < ordinary v-y ∧ ordinary v-y < -(y-ordinary b*x-ordinary c) := by + obtain ⟨u,v,he,hx,hx',hy,hy'⟩ := positive_slope_quadrant_anchor b (-c) hb (-x) (-y) + (by simp only [map_neg]; linarith) + refine ⟨-u,-v,?_,?_,?_,?_,?_⟩ + · linear_combination -he + all_goals simp only [map_neg] at *; linarith + +theorem inactive_slope_quadrant_anchor (a : ℕ) (d : Fin 2) (c s : CutRing) + (x : ℝ × ℝ) (hx : cutForm a (slopeDirection d) x ≠ ordinary c) + (hs : |cutForm a (slopeDirection d) x-ordinary c| < ordinary s) : + ∃ u : CutRing × CutRing, ∃ positive : Bool, + integralCutForm a (slopeDirection d) u=c ∧ + (positive=true ↔ ordinary c < cutForm a (slopeDirection d) x) ∧ + ∀ j : Fin 2, + ordinary (pointCoordinate u j)+ordinary (signQuadrantLower s d positive j) < realCoordinate x j ∧ + realCoordinate x j < ordinary (pointCoordinate u j)+ordinary (signQuadrantUpper s d positive j) := by + have hb : 1 ≤ ordinary (cutTau^a) := by + simpa using one_le_pow₀ Real.one_lt_goldenRatio.le + fin_cases d + · change x.2-Real.goldenRatio^a*x.1 ≠ ordinary c at hx + change |x.2-Real.goldenRatio^a*x.1-ordinary c| < ordinary s at hs + rcases lt_or_gt_of_ne hx with h | h + · obtain ⟨u,v,he,hx₀,hx₁,hy₀,hy₁⟩ := negative_slope_quadrant_anchor (cutTau^a) c hb x.1 x.2 + (by simpa only [map_pow,ordinary_cutTau] using sub_neg.mpr h) + refine ⟨(u,v),false,by simpa [integralCutForm,slopeDirection] using he,by simp [cutForm,slopeDirection]; linarith,?_⟩ + rw [abs_of_neg (sub_neg.mpr h)] at hs + simp only [map_pow,ordinary_cutTau] at hx₁ hy₁ + intro j; fin_cases j <;> simp [realCoordinate,pointCoordinate,signQuadrantLower,signQuadrantUpper] <;> + constructor <;> linarith + · obtain ⟨u,v,he,hx₀,hx₁,hy₀,hy₁⟩ := positive_slope_quadrant_anchor (cutTau^a) c hb x.1 x.2 + (by simpa only [map_pow,ordinary_cutTau] using sub_pos.mpr h) + refine ⟨(u,v),true,by simpa [integralCutForm,slopeDirection] using he,by simp; exact h,?_⟩ + rw [abs_of_pos (sub_pos.mpr h)] at hs + simp only [map_pow,ordinary_cutTau] at hx₁ hy₁ + intro j; fin_cases j <;> simp [realCoordinate,pointCoordinate,signQuadrantLower,signQuadrantUpper] <;> + constructor <;> linarith + · change x.1-Real.goldenRatio^a*x.2 ≠ ordinary c at hx + change |x.1-Real.goldenRatio^a*x.2-ordinary c| < ordinary s at hs + rcases lt_or_gt_of_ne hx with h | h + · obtain ⟨u,v,he,hx₀,hx₁,hy₀,hy₁⟩ := negative_slope_quadrant_anchor (cutTau^a) c hb x.2 x.1 + (by simpa only [map_pow,ordinary_cutTau] using sub_neg.mpr h) + refine ⟨(v,u),false,by simpa [integralCutForm,slopeDirection] using he,by simp [cutForm,slopeDirection]; linarith,?_⟩ + rw [abs_of_neg (sub_neg.mpr h)] at hs + simp only [map_pow,ordinary_cutTau] at hx₁ hy₁ + intro j; fin_cases j <;> simp [realCoordinate,pointCoordinate,signQuadrantLower,signQuadrantUpper] <;> + constructor <;> linarith + · obtain ⟨u,v,he,hx₀,hx₁,hy₀,hy₁⟩ := positive_slope_quadrant_anchor (cutTau^a) c hb x.2 x.1 + (by simpa only [map_pow,ordinary_cutTau] using sub_pos.mpr h) + refine ⟨(v,u),true,by simpa [integralCutForm,slopeDirection] using he,by simp; exact h,?_⟩ + rw [abs_of_pos (sub_pos.mpr h)] at hs + simp only [map_pow,ordinary_cutTau] at hx₁ hy₁ + intro j; fin_cases j <;> simp [realCoordinate,pointCoordinate,signQuadrantLower,signQuadrantUpper] <;> + constructor <;> linarith + +end InactiveQuadrantAnchors + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/InitialPointwiseTable.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/InitialPointwiseTable.lean new file mode 100644 index 0000000000000000000000000000000000000000..3fa9b4baf7681e25dc47d98962593d06a80d3a31 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/InitialPointwiseTable.lean @@ -0,0 +1,120 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.FinitelyManyTranslationRelations +import OAI.GroupTheory.SimpleAmenable.CentralCovers.GenuineFiniteGeneration +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.CanonicalSectors +import OAI.GroupTheory.SimpleAmenable.Configurations.PointwisePolygonTables + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section SourceInitialPointwiseTable + +variable {a m : ℕ} {ι : Type*} [Finite ι] + +noncomputable def actualPolygonTableHom (U : ι → polygonAlgebra a) : + (Set.range (polygonAssignment U) → alternatingGroup (Fin m)) →* + polygonAlternatingGroup a m := by + classical + let := Fintype.ofFinite (Set.range (polygonAssignment U)) + exact (actualPolygonLabelling U).tableHom + +@[simp] theorem actualPolygonTableHom_apply (U : ι → polygonAlgebra a) + (σ : Set.range (polygonAssignment U) → alternatingGroup (Fin m)) + (p : TrackPoint a m) : + (actualPolygonTableHom U σ).val.val p = + ((σ ⟨polygonAssignment U p.2,⟨p.2,rfl⟩⟩).val p.1,p.2) := by + classical + let := Fintype.ofFinite (Set.range (polygonAssignment U)) + exact (actualPolygonLabelling U).tableHom_apply σ p + +theorem actualPolygonTableHom_injective (U : ι → polygonAlgebra a) : + Function.Injective (actualPolygonTableHom (m := m) U) := by + classical + let := Fintype.ofFinite (Set.range (polygonAssignment U)) + exact (actualPolygonLabelling U).tableHom_injective (actualPolygonLabelling_surjective U) + +noncomputable def polygonTableInput (U : ι → polygonAlgebra a) (i : ι) : + alternatingGroup (Fin m) →* (Set.range (polygonAssignment U) → alternatingGroup (Fin m)) := + sectorMask {ω | ω.val i = true} + +@[simp] theorem actualPolygonTableHom_input (U : ι → polygonAlgebra a) (i : ι) + (σ : alternatingGroup (Fin m)) : + actualPolygonTableHom U (polygonTableInput U i σ) = conditionalAlternatingHom (U i) σ := by + classical + apply Subtype.ext + apply Subtype.ext + apply Equiv.ext + intro p + rw [actualPolygonTableHom_apply] + change ((polygonTableInput U i σ ⟨polygonAssignment U p.2,⟨p.2,rfl⟩⟩).val p.1,p.2) = + conditionalPerm (U i) σ.val p + rw [conditionalPerm_apply] + by_cases hp : p.2 ∈ (U i).val + · have hω : (⟨polygonAssignment U p.2,⟨p.2,rfl⟩⟩ : + Set.range (polygonAssignment U)) ∈ {ω | ω.val i = true} := by + change decide (p.2 ∈ (U i).val) = true + exact decide_eq_true hp + rw [polygonTableInput, sectorMask_of_mem _ _ _ hω, ite_eq_left hp] + · have hω : (⟨polygonAssignment U p.2,⟨p.2,rfl⟩⟩ : + Set.range (polygonAssignment U)) ∉ {ω | ω.val i = true} := by + change ¬decide (p.2 ∈ (U i).val) = true + simpa only [decide_eq_true_eq] using hp + rw [polygonTableInput, sectorMask_of_not_mem _ _ _ hω, ite_eq_right hp] + rfl + +def sourceConditionalLabel (m : ℕ) + (b : Fin 5 × {σ : Equiv.Perm (Fin (m+1)) // + σ ∈ alternatingGroup (Fin (m+1)) ∧ σ.support.card ≤ 5}) : + SourceGeneratorLabel m := Sum.inl b + +theorem source_initial_table_lifts_eventually (a : ℕ) (r : CutRing) (m : ℕ) + (hr : 0 < ordinary r ∧ ordinary r < 1/2) (hm : 15 ≤ m+1) (hm' : 2 ≤ m) : + ∃ L : ℕ, ∀ M : ℕ, L ≤ M → + ∃ ρ : (Set.range (polygonAssignment (initialTest a r)) → + alternatingGroup (Fin (m+1))) →* + BoundedRelationCover M (alternatingGenerator a r m hm'), + (coverMap M (alternatingGenerator a r m hm')).comp ρ = + actualPolygonTableHom (initialTest a r) ∧ + Function.Injective ρ ∧ + ∀ b, ρ (polygonTableInput (initialTest a r) b.1 + (⟨b.2.val,b.2.property.1⟩ : alternatingGroup (Fin (m+1)))) = + PresentedGroup.of (sourceConditionalLabel m b) := by + let β := Fin 5 × {σ : Equiv.Perm (Fin (m+1)) // + σ ∈ alternatingGroup (Fin (m+1)) ∧ σ.support.card ≤ 5} + let input : β → (Set.range (polygonAssignment (initialTest a r)) → + alternatingGroup (Fin (m+1))) := fun b => + polygonTableInput (initialTest a r) b.1 ⟨b.2.val,b.2.property.1⟩ + let w : β → FreeGroup (SourceGeneratorLabel m) := + fun b => FreeGroup.of (sourceConditionalLabel m b) + have hw : ∀ b, FreeGroup.lift (alternatingGenerator a r m hm') (w b) = + actualPolygonTableHom (initialTest a r) (input b) := by + intro b + rw [show w b = FreeGroup.of (sourceConditionalLabel m b) from rfl, + FreeGroup.lift_apply_of] + change _ = actualPolygonTableHom (initialTest a r) + (polygonTableInput (initialTest a r) b.1 ⟨b.2.val,b.2.property.1⟩) + rw [actualPolygonTableHom_input] + rfl + obtain ⟨L,hL⟩ := finite_table_with_inputs_eventually (alternatingGenerator a r m hm') + (actualPolygonTableHom (initialTest a r)) input w hw + (alternatingGenerator_surjective a r m hr hm hm') + refine ⟨L,fun M hM => ?_⟩ + obtain ⟨ρ,hρ,hi⟩ := hL M hM + refine ⟨ρ,hρ,?_,hi⟩ + intro s t hst + apply actualPolygonTableHom_injective (initialTest a r) + have hst' := congrArg (coverMap M (alternatingGenerator a r m hm')) hst + exact (DFunLike.congr_fun hρ s).symm.trans (hst'.trans (DFunLike.congr_fun hρ t)) + +end SourceInitialPointwiseTable + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/IntersectionControl.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/IntersectionControl.lean new file mode 100644 index 0000000000000000000000000000000000000000..4a07d4a17561dddb6de0d66b0b424b78e337a95b --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/IntersectionControl.lean @@ -0,0 +1,168 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.SmallControlTransfer +import OAI.GroupTheory.SimpleAmenable.CentralCovers.FullSector +import OAI.GroupTheory.SimpleAmenable.CentralCovers.ControlCalculus + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section IntersectionControl +namespace ActualLawfulTable +variable {E H Q Ω : Type*} [Group E] [Group H] [Group Q] [Group.IsPerfect E] + {q : H →* Q} {v : (Ω → E) →* Q} (T : ActualLawfulTable q v) + +theorem sector_split (U V : Set Ω) (s : UniversalExtension E) : + T.sector U s = T.sector (U ∩ V) s*T.sector (U \ V) s := by + have hd : Disjoint (U ∩ V) (U \ V) := Set.disjoint_left.mpr (by aesop) + have he : (U ∩ V) ∪ (U \ V) = U := by ext x; simp only [Set.mem_union,Set.mem_inter_iff,Set.mem_sdiff]; tauto + have hh := DFunLike.congr_fun (T.sector_union hd) s + simpa only [he,commutingProduct_apply] using hh + +theorem sector_four_factors (U V : Set Ω) (s : UniversalExtension E) : + T.sector Set.univ s = T.sector (U ∩ V) s*T.sector (U \ V) s* + T.sector (V \ U) s*T.sector (U ∪ V)ᶜ s := by + rw [T.sector_split Set.univ U s] + rw [Set.univ_inter, ← Set.compl_eq_univ_sdiff] + rw [T.sector_split U V s,T.sector_split Uᶜ V s] + have he₁ : Uᶜ ∩ V = V \ U := by ext x; simp only [Set.mem_inter_iff,Set.mem_compl_iff,Set.mem_sdiff]; tauto + have he₂ : Uᶜ \ V = (U ∪ V)ᶜ := by ext x; simp only [Set.mem_union,Set.mem_compl_iff,Set.mem_sdiff]; tauto + simp only [he₁,he₂,mul_assoc] + +end ActualLawfulTable + +variable {α H Q Ω : Type*} [Fintype α] [DecidableEq α] [Group H] [Group Q] + [Group.IsPerfect (alternatingGroup α)] + {q : H →* Q} {v : (Ω → alternatingGroup α) →* Q} + (T : ActualLawfulTable q v) (c : alternatingGroup α →* H) + +theorem table_small_control_intersection + (hwhole : T.sector Set.univ = c.comp (universalProjection (alternatingGroup α))) + (f : TrackStar α →* H) (U V : Set Ω) + (hU : SmallControlled c f (T.sector U)) (hV : SmallControlled c f (T.sector V)) : + SmallControlled c f (T.sector (U ∩ V)) := by + refine small_control_intersection c f (T.sector (U ∩ V)) (T.sector (U \ V)) + (T.sector (V \ U)) (T.sector (U ∪ V)ᶜ) ?_ ?_ ?_ ?_ ?_ ?_ + · exact T.sector_commute (Set.disjoint_left.mpr (by aesop)) + · exact T.sector_commute (Set.disjoint_left.mpr (by aesop)) + · exact T.sector_commute (Set.disjoint_left.mpr (by aesop)) + · intro s + rw [← T.sector_four_factors U V s,hwhole] + rfl + · intro I t x hx + dsimp only + rw [← T.sector_split U V] + exact hU I t x hx + · intro I t x hx + dsimp only + have he : V ∩ U = U ∩ V := Set.inter_comm _ _ + have hh := T.sector_split V U (universalMap (subtypeAlternatingHom I.val) t) + rw [he] at hh + rw [← hh] + exact hV I t x hx + +variable {a : ℕ} {ι : Type*} + +theorem resolvedPolygonMask_inter (U : ι → polygonAlgebra a) (V W : Set (GenericSquare a)) + (hV : ResolvedBy (fun i => (U i).val) V) (hW : ResolvedBy (fun i => (U i).val) W) : + resolvedPolygonMask U (V ∩ W) = resolvedPolygonMask U V ∩ resolvedPolygonMask U W := by + ext ω + obtain ⟨x,hx⟩ := ω.property + obtain rfl : ω = ⟨polygonAssignment U x,⟨x,rfl⟩⟩ := Subtype.ext hx.symm + have hVW : ResolvedBy (fun i => (U i).val) (V ∩ W) := by + intro x y he + exact and_congr (hV x y he) (hW x y he) + simp only [Set.mem_inter_iff,resolvedPolygonMask_mem U _ hVW x, + resolvedPolygonMask_mem U _ hV x,resolvedPolygonMask_mem U _ hW x] + +namespace InitialCoverSystem +variable {m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) [Finite ι] + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + +theorem fullGeometricSector_intersection_control (hlarge : 15 < m+1) + (P : ι → Fin 5 × (CutRing × CutRing)) + (h : ∀ I, I.card ≤ 15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb P) + (V W : polygonAlgebra a) + (hV : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) P i).val) V.val) + (hW : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) P i).val) W.val) + (f : TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm)) + (hfV : SmallControlled B.c f (B.fullGeometricSector hlarge P h V)) + (hfW : SmallControlled B.c f (B.fullGeometricSector hlarge P h W)) : + SmallControlled B.c f (B.fullGeometricSector hlarge P h (V ⊓ W)) := by + have hw := B.fullGeometricSector_whole hlarge P h + unfold fullGeometricSector at hw hfV hfW ⊢ + change (B.fullPrimitiveTable hlarge P h).sector + (resolvedPolygonMask (primitiveTests (a := a) (r := r) P) Set.univ) = _ at hw + rw [resolvedPolygonMask_univ] at hw + change SmallControlled _ _ ((B.fullPrimitiveTable hlarge P h).sector + (resolvedPolygonMask (primitiveTests (a := a) (r := r) P) (V.val ∩ W.val))) + rw [resolvedPolygonMask_inter _ _ _ hV hW] + exact table_small_control_intersection _ B.c hw f _ _ hfV hfW + +end InitialCoverSystem +end IntersectionControl + +section ActualRectangleBridge + +noncomputable def coordinateRectangle (a : ℕ) (u v : Fin 2 → CutRing) : polygonAlgebra a := + coordinateInterval a 0 (u 0) (v 0) ⊓ coordinateInterval a 1 (u 1) (v 1) + +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + +theorem old_rectangle_bridge_control (hlarge : 20 ≤ m+1) + {K δ : ℝ} (hK : 0 ≤ K) (hδ : 0 < δ) : + ∃ N : ℕ, 160 ≤ N ∧ ∀ n : ℕ, N ≤ n → ∀ h : B.CoordinateWindowLaw n, + ∀ (s : Fin 2 → ℕ) (hs : ∀ j, s j ≤ n) (p q : Fin 2 → ℤ), + (∀ j, ((q j-p j).natAbs:ℝ) ≤ (K+1)*(n:ℝ)) → + ∀ u v U V : Fin 2 → CutRing, + (∀ j, ordinary (u j) ≤ ordinary (v j)) → + (∀ j, ordinary (U j) ≤ ordinary (u j)-δ) → + (∀ j, ordinary (v j)+δ ≤ ordinary (V j)) → + (∀ j, ordinary (V j)-ordinary (U j) < 1) → + (∀ j, p j ≤ endpointLabel (u j) ∧ endpointLabel (u j) < p j+s j) → + (∀ j, p j ≤ endpointLabel (v j) ∧ endpointLabel (v j) < p j+s j) → + (∀ j, q j ≤ endpointLabel (U j) ∧ endpointLabel (U j) < q j+(n/8:ℕ)) → + (∀ j, q j ≤ endpointLabel (V j) ∧ endpointLabel (V j) < q j+(n/8:ℕ)) → + ∀ f : TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm), + B.AlignedSmallSupported f → + (∀ j, SmallControlled B.c f + (B.axisSector (by omega) n h j (s j) (hs j) (p j) (coordinateInterval a j (u j) (v j)))) → + SmallControlled B.c f (B.windowSector (by omega) n h q (coordinateRectangle a U V)) := by + obtain ⟨N,hN,hbridge⟩ := B.old_axis_bridge_control hlarge hK hδ + refine ⟨N,hN,?_⟩ + intro n hn h s hs p q hpq u v U V huv hU hV hlen hlu hlv hlU hlV f hf hstart + have hc (j : Fin 2) : SmallControlled B.c f + (B.windowSector (by omega) n h q (coordinateInterval a j (U j) (V j))) := by + have hh := hbridge n hn h j (s j) (hs j) (p j) (q j) (hpq j) + (u j) (v j) (U j) (V j) (huv j) (hU j) (hV j) (hlen j) + (hlu j) (hlv j) (hlU j) (hlV j) f hf (hstart j) + rw [B.axisSector_in_window (by omega) n h j (n/8) (Nat.div_le_self n 8) + (q j) q le_rfl (by omega) (coordinateInterval a j (U j) (V j)) + (axisInterval_resolved j (n/8) (q j) (U j) (V j) (hlU j) (hlV j))] at hh + exact hh + apply B.fullGeometricSector_intersection_control (by omega) (coordinateWindowPrimitives n q) + (fun I _ b hb => h I b hb q) (coordinateInterval a 0 (U 0) (V 0)) + (coordinateInterval a 1 (U 1) (V 1)) ?_ ?_ f (hc 0) (hc 1) + · exact coordinateLabelWindow_resolved n q 0 (U 0) (V 0) + ⟨(hlU 0).1,by have h' := (hlU 0).2; omega⟩ + ⟨(hlV 0).1,by have h' := (hlV 0).2; omega⟩ + · exact coordinateLabelWindow_resolved n q 1 (U 1) (V 1) + ⟨(hlU 1).1,by have h' := (hlU 1).2; omega⟩ + ⟨(hlV 1).1,by have h' := (hlV 1).2; omega⟩ + +end InitialCoverSystem +end ActualRectangleBridge + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/IntervalTangentConnectivity.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/IntervalTangentConnectivity.lean new file mode 100644 index 0000000000000000000000000000000000000000..b0f1e7b4555520be6a52c7446f637b98dcfb630b --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/IntervalTangentConnectivity.lean @@ -0,0 +1,182 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.ArithmeticTangentBasis +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.TangentChartTemplates + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section IntervalTangentConnectivity + +def TangentIntervalStep (u : CutRing) (L H : ℝ) (x y : CutRing) : Prop := + L ≤ ordinary x ∧ ordinary x ≤ H ∧ L ≤ ordinary y ∧ ordinary y ≤ H ∧ + (y-x=u ∨ y-x= -u ∨ y-x=cutTau*u ∨ y-x= -(cutTau*u)) + +def TangentIntervalReach (u : CutRing) (L H : ℝ) (x y : CutRing) : Prop := + Relation.ReflTransGen (TangentIntervalStep u L H) x y + +theorem tangentIntervalStep_symm {u x y : CutRing} {L H : ℝ} + (h : TangentIntervalStep u L H x y) : TangentIntervalStep u L H y x := by + rcases h with ⟨h1,h2,h3,h4,h⟩ + refine ⟨h3,h4,h1,h2,?_⟩ + have he : x-y= -(y-x) := by abel + rw [he] + rcases h with h | h | h | h + · exact Or.inr (Or.inl (congrArg Neg.neg h)) + · left; simpa using congrArg Neg.neg h + · exact Or.inr (Or.inr (Or.inr (congrArg Neg.neg h))) + · right; right; left; simpa using congrArg Neg.neg h + +theorem tangentIntervalReach_symm {u x y : CutRing} {L H : ℝ} + (h : TangentIntervalReach u L H x y) : TangentIntervalReach u L H y x := by + induction h with + | refl => exact .refl + | tail _ hstep ih => exact ih.head (tangentIntervalStep_symm hstep) + +theorem tangentIntervalStep_index {u x y : CutRing} {L H : ℝ} + (h : TangentIntervalStep u L H x y) : + ∃ e : Fin 5, y=x+signedShortSteps u e := by + rcases h.2.2.2.2 with h | h | h | h + · exact ⟨1,by change y=x+u; linear_combination h⟩ + · exact ⟨2,by change y=x+ -u; linear_combination h⟩ + · exact ⟨3,by change y=x+cutTau*u; linear_combination h⟩ + · exact ⟨4,by change y=x+ -(cutTau*u); linear_combination h⟩ + +theorem tangentInterval_natural (u v x : CutRing) (L H : ℝ) (n : ℕ) + (hv : v=u ∨ v= -u) + (hx : L ≤ ordinary x ∧ ordinary x ≤ H) + (hy : L ≤ ordinary (x+(n:CutRing)*v) ∧ ordinary (x+(n:CutRing)*v) ≤ H) : + TangentIntervalReach u L H x (x+(n:CutRing)*v) := by + have hi (i : ℕ) (hin : i ≤ n) : + L ≤ ordinary (x+(i:CutRing)*v) ∧ ordinary (x+(i:CutRing)*v) ≤ H := by + have hi' : (i:ℝ) ≤ n := by exact_mod_cast hin + simp only [map_add,map_mul,map_natCast] at hy ⊢ + by_cases hv0 : 0 ≤ ordinary v + · have hm := mul_le_mul_of_nonneg_right hi' hv0 + have hp : 0 ≤ (i:ℝ)*ordinary v := mul_nonneg (Nat.cast_nonneg _) hv0 + constructor <;> linarith + · have hm := mul_le_mul_of_nonpos_right hi' (le_of_not_ge hv0) + have hp : (i:ℝ)*ordinary v ≤ 0 := mul_nonpos_of_nonneg_of_nonpos + (Nat.cast_nonneg _) (le_of_not_ge hv0) + constructor <;> linarith + have hpath i (hin : i ≤ n) : TangentIntervalReach u L H x (x+(i:CutRing)*v) := by + induction i with + | zero => simpa [TangentIntervalReach] using (Relation.ReflTransGen.refl (a := x) (r := TangentIntervalStep u L H)) + | succ i ih => + apply (ih (by omega)).tail + refine ⟨(hi i (by omega)).1,(hi i (by omega)).2,(hi (i+1) hin).1,(hi (i+1) hin).2,?_⟩ + have he : x+((i+1:ℕ):CutRing)*v-(x+(i:CutRing)*v)=v := by push_cast; ring + rw [he] + rcases hv with hv | hv + · exact Or.inl hv + · exact Or.inr (Or.inl hv) + exact hpath n le_rfl + +theorem tangentInterval_integer (u v x : CutRing) (L H : ℝ) (n : ℤ) + (hv : v=u ∨ v= -u) + (hx : L ≤ ordinary x ∧ ordinary x ≤ H) + (hy : L ≤ ordinary (x+(n:CutRing)*v) ∧ ordinary (x+(n:CutRing)*v) ≤ H) : + TangentIntervalReach u L H x (x+(n:CutRing)*v) := by + by_cases hn : 0 ≤ n + · have he : (n.toNat:CutRing)=(n:CutRing) := by exact_mod_cast Int.toNat_of_nonneg hn + simpa only [he] using tangentInterval_natural u v x L H n.toNat hv hx (by simpa only [he] using hy) + · have hev : -v=u ∨ -v= -u := by + rcases hv with rfl | rfl + · exact Or.inr rfl + · exact Or.inl (neg_neg u) + have he : ((-n).toNat:CutRing)= -(n:CutRing) := by + exact_mod_cast Int.toNat_of_nonneg (by omega : 0 ≤ -n) + simpa only [he,neg_mul_neg] using tangentInterval_natural u (-v) x L H (-n).toNat hev hx + (by simpa only [he,neg_mul_neg] using hy) + +theorem tangentInterval_list (u x : CutRing) (L H : ℝ) (w : List CutRing) + (hw : ∀ e ∈ w, e=u ∨ e= -u ∨ e=cutTau*u ∨ e= -(cutTau*u)) + (hb : ∀ n, L ≤ ordinary (x+(w.take n).sum) ∧ ordinary (x+(w.take n).sum) ≤ H) : + TangentIntervalReach u L H x (x+w.sum) := by + have hp n (hn : n ≤ w.length) : TangentIntervalReach u L H x (x+(w.take n).sum) := by + induction n with + | zero => simpa [TangentIntervalReach] using (Relation.ReflTransGen.refl (a := x) (r := TangentIntervalStep u L H)) + | succ n ih => + have hn' : n < w.length := by omega + apply (ih (by omega)).tail + refine ⟨(hb n).1,(hb n).2,(hb (n+1)).1,(hb (n+1)).2,?_⟩ + have he : x+(w.take (n+1)).sum-(x+(w.take n).sum)=w[n] := by + rw [List.take_add_one,List.getElem?_eq_getElem hn',Option.toList_some,List.sum_append,List.sum_singleton] + abel + rw [he] + exact hw _ (List.getElem_mem hn') + simpa using hp w.length le_rfl + +theorem tangentInterval_recenter (u v : CutRing) (huv : u*v=1) + (L H c : ℝ) (x : CutRing) (hx : L ≤ ordinary x ∧ ordinary x ≤ H) + (hL : L ≤ c-|ordinary u|) (hH : c ≤ H) : + ∃ y : CutRing, c-|ordinary u| < ordinary y ∧ ordinary y ≤ c ∧ + TangentIntervalReach u L H x y := by + have hu0 : u ≠ 0 := by intro h; simp [h] at huv + have huo : ordinary u ≠ 0 := by simpa using ordinary_injective.ne hu0 + let u' : CutRing := if 0 ≤ ordinary u then u else -u + have hu' : u'=u ∨ u'= -u := by dsimp [u']; split <;> simp + have hpos : ordinary u'=|ordinary u| := by + dsimp [u']; split_ifs with h + · exact (abs_of_nonneg h).symm + · rw [map_neg,abs_of_neg (lt_of_not_ge h)] + have hα : 0 < ordinary u' := by rw [hpos]; exact abs_pos.mpr huo + let n : ℤ := ⌊(c-ordinary x)/ordinary u'⌋ + let y : CutRing := x+(n:CutRing)*u' + have hny : c-ordinary u' < ordinary y ∧ ordinary y ≤ c := by + have hl := Int.floor_le ((c-ordinary x)/ordinary u') + have hh := Int.lt_floor_add_one ((c-ordinary x)/ordinary u') + have hl' := (le_div_iff₀ hα).mp hl + have hh' := (div_lt_iff₀ hα).mp hh + dsimp only [y] + simp only [map_add,map_mul,map_intCast] + dsimp only [n] at * + constructor <;> linarith + refine ⟨y,by simpa only [hpos] using hny.1,hny.2,?_⟩ + exact tangentInterval_integer u u' x L H n hu' hx + ⟨hL.trans (by rw [← hpos]; exact hny.1.le),hny.2.trans hH⟩ + +theorem tangentInterval_connected (u v : CutRing) (huv : u*v=1) + (L H : ℝ) (hwidth : 4*(|ordinary u|+|ordinary (cutTau*u)|) ≤ H-L) + (x y : CutRing) + (hx : L ≤ ordinary x ∧ ordinary x ≤ H) + (hy : L ≤ ordinary y ∧ ordinary y ≤ H) : TangentIntervalReach u L H x y := by + let c : ℝ := (L+H)/2 + let b : ℝ := |ordinary u|+|ordinary (cutTau*u)| + have hb : 0 ≤ b := add_nonneg (abs_nonneg _) (abs_nonneg _) + have hub : |ordinary u| ≤ b := le_add_of_nonneg_right (abs_nonneg _) + have hlo : L ≤ c-|ordinary u| := by dsimp [c]; dsimp [b] at hub; linarith + have hup : c ≤ H := by dsimp [c]; dsimp [b] at hb; linarith + obtain ⟨x',hxL,hxH,hxx'⟩ := tangentInterval_recenter u v huv L H c x hx hlo hup + obtain ⟨y',hyL,hyH,hyy'⟩ := tangentInterval_recenter u v huv L H c y hy hlo hup + obtain ⟨w,hws,hwm,_,hwb,_⟩ := tangent_chain u v huv (y'-x') + have hm : TangentIntervalReach u L H x' y' := by + have he : x'+w.sum=y' := by rw [hws]; abel + rw [← he] + apply tangentInterval_list u x' L H w hwm + intro n + have hn := hwb n + simp only [map_add,map_sub] at hn ⊢ + change min 0 (ordinary y'-ordinary x')-b ≤ ordinary (w.take n).sum ∧ + ordinary (w.take n).sum ≤ max 0 (ordinary y'-ordinary x')+b at hn + have hw' : 4*b ≤ H-L := hwidth + have hcL : L ≤ c-2*b := by dsimp [c]; linarith + have hcH : c+2*b ≤ H := by dsimp [c]; linarith + by_cases hh : ordinary x' ≤ ordinary y' + · rw [min_eq_left (by linarith),max_eq_right (by linarith)] at hn + constructor <;> linarith + · rw [min_eq_right (by linarith),max_eq_left (by linarith)] at hn + constructor <;> linarith + exact hxx'.trans (hm.trans (tangentIntervalReach_symm hyy')) + +end IntervalTangentConnectivity + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/InvariantPatching.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/InvariantPatching.lean new file mode 100644 index 0000000000000000000000000000000000000000..c43020f9afa77b12f98e5ecced12395b859a3efc --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/InvariantPatching.lean @@ -0,0 +1,105 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.NestedCutCalculus + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section InvariantPatching +variable {G D α ι : Type*} [Group G] [Group D] + +theorem normalizes_of_cell_split (P : Subgroup G) (x y z : G) + (hx : x=y*z) (hy : y ∈ P) (hz : z ∈ Subgroup.centralizer (P : Set G)) : + x ∈ (Subgroup.normalizer (P : Set G)) := by + rw [hx] + exact (Subgroup.normalizer (P : Set G)).mul_mem (Subgroup.le_normalizer hy) + (Subgroup.centralizer_le_normalizer _ hz) + +theorem sameActionOn_free_lift (P : Subgroup G) (f g : α → G) + (hf : ∀ i, f i ∈ (Subgroup.normalizer (P : Set G))) (hg : ∀ i, g i ∈ (Subgroup.normalizer (P : Set G))) + (h : SameActionOn f g P) : + SameActionOn (FreeGroup.lift f) (FreeGroup.lift g) P := by + let F : FreeGroup α →* (Subgroup.normalizer (P : Set G)) := FreeGroup.lift (fun i => ⟨f i,hf i⟩) + let J : FreeGroup α →* (Subgroup.normalizer (P : Set G)) := FreeGroup.lift (fun i => ⟨g i,hg i⟩) + have hF : (Subgroup.normalizer (P : Set G)).subtype.comp F = FreeGroup.lift f := by + apply FreeGroup.ext_hom + intro i + simp [F] + have hJ : (Subgroup.normalizer (P : Set G)).subtype.comp J = FreeGroup.lift g := by + apply FreeGroup.ext_hom + intro i + simp [J] + have he : P.normalizerMonoidHom.comp F = P.normalizerMonoidHom.comp J := by + apply FreeGroup.ext_hom + intro i + apply MulEquiv.ext + intro x + apply Subtype.ext + simpa [F,J] using h i x.val x.property + intro w x hx + have hh := congrArg (fun k : FreeGroup α →* MulAut P => ((k w) ⟨x,hx⟩).val) he + change (F w).val*x*(F w).val⁻¹ = (J w).val*x*(J w).val⁻¹ at hh + have hf' : (F w).val = FreeGroup.lift f w := DFunLike.congr_fun hF w + have hg' : (J w).val = FreeGroup.lift g w := DFunLike.congr_fun hJ w + simpa only [hf',hg'] using hh + +theorem normalizes_of_same_action (P : Subgroup G) (x y : G) + (hx : x ∈ (Subgroup.normalizer (P : Set G))) (h : ∀ z ∈ P, x*z*x⁻¹=y*z*y⁻¹) : + y ∈ (Subgroup.normalizer (P : Set G)) := by + intro z + constructor + · intro hz + rw [← h z hz] + exact (hx z).mp hz + · intro hz + have hu : x⁻¹*(y*z*y⁻¹)*x ∈ P := by + have hu' := ((Subgroup.normalizer (P : Set G)).inv_mem hx (y*z*y⁻¹)).mp hz + rw [inv_inv] at hu' + exact hu' + have hh := h _ hu + have he : x*(x⁻¹*(y*z*y⁻¹)*x)*x⁻¹ = y*z*y⁻¹ := by group + rw [he] at hh + have hv : z=x⁻¹*(y*z*y⁻¹)*x := by + have ht := congrArg (fun q => y⁻¹*q*y) hh + simpa only [mul_assoc,inv_mul_cancel,inv_mul_cancel_left,mul_inv_cancel_left,mul_one] using ht + rwa [← hv] at hu + +theorem patching_centrality (f : α → G) (P : ι → Subgroup G) + (hgen : (FreeGroup.lift f).range ≤ ⨆ i, P i) + (hinv : ∀ i j, f j ∈ (Subgroup.normalizer (P i : Set G))) + (w : FreeGroup α) + (hlocal : ∀ i, ∃ g : α → G, SameActionOn f g (P i) ∧ + FreeGroup.lift g w ∈ Subgroup.centralizer (P i : Set G)) : + ∀ x ∈ (FreeGroup.lift f).range, Commute (FreeGroup.lift f w) x := by + have hc : ∀ i, FreeGroup.lift f w ∈ Subgroup.centralizer (P i : Set G) := by + intro i + obtain ⟨g,hg,hgw⟩ := hlocal i + have hact := sameActionOn_free_lift (P i) f g (hinv i) + (fun j => normalizes_of_same_action (P i) _ _ (hinv i j) (hg j)) hg + intro x hx + have he := hact w x hx + have he' : FreeGroup.lift g w*x*(FreeGroup.lift g w)⁻¹=x := by + rw [← hgw x hx]; group + rw [he'] at he + have ht := congrArg (fun z => z*FreeGroup.lift f w) he + exact (by simpa only [mul_assoc,inv_mul_cancel,mul_one] using ht : + FreeGroup.lift f w*x=x*FreeGroup.lift f w).symm + have hs : (⨆ i, P i) ≤ Subgroup.centralizer {FreeGroup.lift f w} := by + apply iSup_le + intro i x hx y hy + obtain rfl : y=FreeGroup.lift f w := Set.mem_singleton_iff.mp hy + exact (hc i x hx).symm + intro x hx + exact show FreeGroup.lift f w*x=x*FreeGroup.lift f w from hs (hgen hx) _ rfl + +end InvariantPatching + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/InwardGermTransport.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/InwardGermTransport.lean new file mode 100644 index 0000000000000000000000000000000000000000..2c77a971238891b3892af83b293ef4832e3fb799 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/InwardGermTransport.lean @@ -0,0 +1,193 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.IndividualGridSplits +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.InactiveNeighborhoodActions + +namespace OAI + +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +namespace ConcurrentGeometry.InwardChart +variable {a : ℕ} {r : CutRing} {C : ConcurrentGeometry a r} + {ι κ : Type*} [Finite ι] {j : ι → Fin 4} {c : ι → CutRing} {z : ℝ × ℝ} + (T : C.InwardChart j c z) + +theorem germ_rule (hr : 0 halfPlane a (j i) (c i)) (R k).val) + (N : Set (ℝ × ℝ)) (hN : IsOpen N) (hz : z ∈ N) + (rule : (κ → Bool) → Prop) + (h : ∀ q : GenericSquare a, q.val ∈ N → rule (polygonAssignment R q)) + (p : GenericSquare a) (hp : p ∈ (C.inwardMargin T.vertex T.offset z).val) : + rule (polygonAssignment (T.polygons R) p) := by + obtain ⟨q,hq,he⟩ := T.polygons_assignment_realized hr hz₁ hz₂ R hR p hp N hN hz + rw [← he] + exact h q hq + +theorem polygons_cut_on_margin (hr : 0 cutPolygon a (j i) (c i)) i).val ↔ + p ∈ (C.localDecision T.vertex T.offset z (j i) (c i)).val := by + obtain ⟨q,_,he⟩ := T.assignment_realized hr hz₁ hz₂ p hp Set.univ isOpen_univ (Set.mem_univ z) + change polygonAssignment (fun i => C.localDecision T.vertex T.offset z (j i) (c i)) p ∈ + polygonFormalMask (fun i => cutPolygon a (j i) (c i)) (cutPolygon a (j i) (c i)) ↔ _ + rw [← he,polygonFormalMask_mem _ _ (fun x y h => h i) q] + simpa only [polygonAssignment,decide_eq_true_eq] using (Bool.eq_iff_iff.mp (congrFun he i)) + +theorem model_mem_iff_germ_rule (hr : 0 halfPlane a (j i) (c i)) R.val) + (N : Set (ℝ × ℝ)) (hN : IsOpen N) (hz : z ∈ N) + (rule : (ι → Bool) → Prop) + (h : ∀ q : GenericSquare a, q.val ∈ N → + (q ∈ R.val ↔ rule (polygonAssignment (fun i => cutPolygon a (j i) (c i)) q))) + (p : GenericSquare a) (hp : p ∈ (C.inwardMargin T.vertex T.offset z).val) : + p ∈ (T.polygons (fun _ : Unit => R) ()).val ↔ + rule (polygonAssignment (fun i => C.localDecision T.vertex T.offset z (j i) (c i)) p) := by + obtain ⟨q,hq,he⟩ := T.assignment_realized hr hz₁ hz₂ p hp N hN hz + change polygonAssignment (fun i => C.localDecision T.vertex T.offset z (j i) (c i)) p ∈ + polygonFormalMask (fun i => cutPolygon a (j i) (c i)) R ↔ _ + rw [← he,polygonFormalMask_mem _ R hR q] + exact h q hq + +end ConcurrentGeometry.InwardChart + +section LocalPeriodicIntervals + +theorem local_periodic_interval {a : ℕ} (j : Fin 2) (l v : CutRing) + (hpos : ordinary l linarith [hn.1,hn.2] + · intro hp + refine ⟨-k,?_⟩ + simp only [Int.cast_neg] + constructor <;> linarith [hp.1,hp.2] + +theorem local_periodic_rectangle {a : ℕ} (l v : Fin 2 → CutRing) + (hpos : ∀ j, ordinary (l j) -r+pointCoordinate u d + let h := fun d => r+pointCoordinate u d + obtain ⟨k,δ,hδ,hlocal⟩ := local_periodic_rectangle (a := a) l h + (fun d => by dsimp [l,h]; simp only [map_add,map_neg]; linarith [hr.1]) + (fun d => by dsimp [l,h]; simp only [map_add,map_neg]; linarith [hr.2]) z + let v := u+((k 0:CutRing),(k 1:CutRing)) + have hperiod : spatialTranslate v (clippedSlopePrimitive a r j)= + spatialTranslate u (clippedSlopePrimitive a r j) := by + rw [show v=u+((k 0:CutRing),(k 1:CutRing)) from rfl,spatialTranslate_add,spatialTranslate_integral] + have hbox : spatialTranslate u (coordinateRectangle a (fun _ => -r) (fun _ => r))= + coordinateRectangle a l h := by + simpa only [l,h,pointCoordinate] using spatialTranslate_coordinateRectangle u (fun _ => -r) (fun _ => r) + have hlift (p : GenericSquare a) (hp : dist p.val z<δ) : + p ∈ (spatialTranslate u (coordinateRectangle a (fun _ => -r) (fun _ => r))).val ↔ + ∀ d, ordinary (pointCoordinate v d-r)≤realCoordinate p.val d ∧ + realCoordinate p.val d simp [v,pointCoordinate] + simp only [l,h,map_add,map_neg,map_sub,hv] + constructor <;> rintro ⟨h₁,h₂⟩ <;> constructor <;> linarith + have hs (p : GenericSquare a) + (hp : ∀ d, ordinary (pointCoordinate v d-r)≤realCoordinate p.val d ∧ + realCoordinate p.val d exact hh + have hlo := lt_of_le_of_ne (hp d).1 hne.symm + have hup := (hp d).2 + simp only [map_sub,map_add] at hlo hup + rw [abs_lt] + constructor <;> linarith + rw [← hperiod] + exact translated_clippedSlope_planar r j hr v p p.val + (by rw [Int.fract_eq_self.mpr p.property.1,Int.fract_eq_self.mpr p.property.2.1]) + ⟨hnear 0,hnear 1⟩ + refine ⟨k,δ,hδ,?_⟩ + dsimp only + intro p hp + constructor + · intro hmem + have hc : p ∈ (spatialTranslate u (coordinateRectangle a (fun _ => -r) (fun _ => r))).val := + clippedSlope_le_box r j hr hmem + have hc' := (hlift p hp).mp hc + exact ⟨hc',(hs p hc').mp hmem⟩ + · rintro ⟨hc,hside⟩ + exact (hs p hc).mpr hside + +end SimpleAmenable + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/InwardMargins.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/InwardMargins.lean new file mode 100644 index 0000000000000000000000000000000000000000..40c670158d79f3716b345ff58509ce3aac52acb9 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/InwardMargins.lean @@ -0,0 +1,92 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.ConcurrentInwardModel + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section InwardMargins +namespace ConcurrentGeometry +variable {a : ℕ} {r : CutRing} (C : ConcurrentGeometry a r) + +theorem mem_marginPolygon_of_planar (hr : ordinary r<1/2) + (t : VertexType (commonVertexDenominator a)) (u : CutRing × CutRing) + (p : GenericSquare a) (y : ℝ × ℝ) (hy : p.val=(Int.fract y.1,Int.fract y.2)) + (hcell : ∀ k, ordinary ((C.margins t).lower k+pointCoordinate u k)≤realCoordinate y k ∧ + realCoordinate y k realCoordinate q k) hy + have hh : coordinate k p=Int.fract (realCoordinate y k) := by fin_cases k <;> exact h + rw [hh] + exact sub_add_cancel _ _ + rw [he] + exact hcell k + change p ∈ (spatialTranslate u (coordinateRectangle a (C.margins t).lower (C.margins t).upper)).val + rw [spatialTranslate_coordinateRectangle] + exact ⟨hh 0,hh 1⟩ + +theorem mem_inwardMargin_of_planar (hr : 0 ⟨(hcell k).1,(hcell k).2.le⟩) + rw [integralCutForm_axis,hboundary k (Or.inl hzero),hzero] at hd + apply hd.mpr + have haxis : cutForm a (axisDirection k) p.val=coordinate k p := by fin_cases k <;> rfl + rw [haxis] + exact (coordinate_bounds k p).1 + · by_cases hone : realCoordinate z k=1 + · simp only [inwardGate,ite_eq_right hzero,ite_eq_left hone] + have hd := C.positiveDecision_planar hr t u (axisDirection k) + (hnearB k (Or.inr hone)) p p.val hy (fun k => ⟨(hcell k).1,(hcell k).2.le⟩) + rw [integralCutForm_axis,hboundary k (Or.inr hone),hone] at hd + apply (not_congr hd).mpr + have haxis : cutForm a (axisDirection k) p.val=coordinate k p := by fin_cases k <;> rfl + rw [haxis] + exact not_le_of_gt (coordinate_bounds k p).2 + · simp [inwardGate,hzero,hone,wholePolygon] + exact ⟨⟨hpM,hgate 0⟩,hgate 1⟩ + +end ConcurrentGeometry +end InwardMargins + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/InwardPlanarGerms.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/InwardPlanarGerms.lean new file mode 100644 index 0000000000000000000000000000000000000000..9cde02e1131e94ee0c0d59f708504b52618b6fcf --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/InwardPlanarGerms.lean @@ -0,0 +1,135 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.ConcurrentGeometry +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.FiniteArrangementGerms +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.SupportedCellPatching + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section InwardPlanarGerms + +theorem finite_arrangement_germ_inward {ι : Type*} [Finite ι] (a : ℕ) + (j : ι → Fin 4) (c : ι → ℝ) (z y : ℝ × ℝ) (σ : ι → Bool) + (hz₁ : z.1 ∈ Set.Icc (0:ℝ) 1) (hz₂ : z.2 ∈ Set.Icc (0:ℝ) 1) + (hzero : ∀ k, realCoordinate z k=0 → 0 Fin.castLE (by omega) d.1) + let C : Sum ι (Fin 2 × Bool) → ℝ := Sum.elim c (fun d => if d.2 then 1 else 0) + let S : Sum ι (Fin 2 × Bool) → Bool := Sum.elim σ Prod.snd + have ha : ∀ i, cutForm a (J i) z=C i → + if S i then cutForm a (J i) y < C i else C i < cutForm a (J i) y := by + intro i hi + cases i with + | inl i => exact hactive i hi + | inr d => + rcases d with ⟨d,b⟩ + fin_cases d <;> cases b + · exact hzero 0 hi + · exact hone 0 hi + · exact hzero 1 hi + · exact hone 1 hi + have hn : ∀ i, cutForm a (J i) z≠C i → + if S i then cutForm a (J i) z < C i else C i < cutForm a (J i) z := by + intro i hi + cases i with + | inl i => exact hinactive i hi + | inr d => + rcases d with ⟨d,b⟩ + fin_cases d <;> cases b <;> + simp [J,C,S,cutForm] at hi ⊢ + · exact lt_of_le_of_ne hz₁.1 (Ne.symm hi) + · exact lt_of_le_of_ne hz₁.2 hi + · exact lt_of_le_of_ne hz₂.1 (Ne.symm hi) + · exact lt_of_le_of_ne hz₂.2 hi + obtain ⟨p,hp,hcell,hgeneric⟩ := finite_arrangement_germ a J C z y S ha hn N hN hz + have hp₁ : p.1 ∈ Set.Ioo (0:ℝ) 1 := ⟨hcell (.inr (0,false)),hcell (.inr (0,true))⟩ + have hp₂ : p.2 ∈ Set.Ioo (0:ℝ) 1 := ⟨hcell (.inr (1,false)),hcell (.inr (1,true))⟩ + exact ⟨⟨p,⟨hp₁.1.le,hp₁.2⟩,⟨hp₂.1.le,hp₂.2⟩,hgeneric⟩,hp,fun i => hcell (.inl i)⟩ + +end InwardPlanarGerms + +section ConcurrentPositiveDecisions +namespace ConcurrentGeometry +variable {a : ℕ} {r : CutRing} (C : ConcurrentGeometry a r) + +noncomputable def positiveDecision (t : VertexType (commonVertexDenominator a)) + (u : CutRing × CutRing) (j : Fin 4) : polygonAlgebra a := + spatialTranslate (u+C.anchors t j) (initialTest a r ⟨j.val+1,by omega⟩) + +noncomputable def marginPolygon (t : VertexType (commonVertexDenominator a)) + (u : CutRing × CutRing) : polygonAlgebra a := + spatialTranslate u (coordinateRectangle a (C.margins t).lower (C.margins t).upper) + +theorem positiveDecision_planar (hr : 0 linarith + fin_cases j + · exact C.axis_on_margin 0 u (u+C.anchors t 0) t hnear p y hy hcell + · exact C.axis_on_margin 1 u (u+C.anchors t 1) t hnear p y hy hcell + · exact translated_clippedSlope_planar r 2 hr (u+C.anchors t 2) p y hy hs + · exact translated_clippedSlope_planar r 3 hr (u+C.anchors t 3) p y hy hs + +theorem marginPolygon_lift (hr : ordinary r<1/2) + (t : VertexType (commonVertexDenominator a)) (u : CutRing × CutRing) + (p : GenericSquare a) (hp : p ∈ (C.marginPolygon t u).val) : + ∃ y : ℝ × ℝ, p.val=(Int.fract y.1,Int.fract y.2) ∧ AvoidsCuts a y ∧ + ∀ k, ordinary ((C.margins t).lower k+pointCoordinate u k) (C.margins t).lower k+pointCoordinate u k) + (fun k => (C.margins t).upper k+pointCoordinate u k)).val := by + simpa only [marginPolygon,spatialTranslate_coordinateRectangle,pointCoordinate] using hp + obtain ⟨y,hy,hy₀,hy₁⟩ := coordinateRectangle_strict_lift _ _ hle hlen p hp' + refine ⟨y,hy,planar_lift_avoidsCuts p y hy,?_⟩ + intro k + fin_cases k + · exact hy₀ + · exact hy₁ + +end ConcurrentGeometry +end ConcurrentPositiveDecisions + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/LabelShiftedCharts.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/LabelShiftedCharts.lean new file mode 100644 index 0000000000000000000000000000000000000000..e821f254dcd4afc1c4b62992468d95428390c40e --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/LabelShiftedCharts.lean @@ -0,0 +1,84 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Arithmetic.PropagationArithmetic +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.TangentChartTemplates +import OAI.GroupTheory.SimpleAmenable.Homology.ChartControlChain + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section LabelShiftedCharts + +noncomputable def pointCoordinate (z : CutRing × CutRing) (j : Fin 2) : CutRing := + if j=0 then z.1 else z.2 + +noncomputable def pointLabel (z : CutRing × CutRing) (j : Fin 2) : ℤ := endpointLabel (pointCoordinate z j) + +@[simp] theorem pointCoordinate_add (z w : CutRing × CutRing) (j : Fin 2) : + pointCoordinate (z+w) j = pointCoordinate z j+pointCoordinate w j := by + fin_cases j <;> rfl + +@[simp] theorem pointLabel_add (z w : CutRing × CutRing) (j : Fin 2) : + pointLabel (z+w) j = pointLabel z j+pointLabel w j := by + simp only [pointLabel,pointCoordinate_add,endpointLabel_add] + +@[simp] theorem endpointLabel_int_mul_tau (i : ℤ) : + endpointLabel ((i : CutRing)*cutTau) = i := by simp [endpointLabel,cutTau] + +@[simp] theorem coordinateWindow_pointLabel (k : ℕ) (p : Fin 2 → ℤ) + (i : Fin 2 × Fin (k-1)) : + pointLabel (coordinateWindowPrimitives k p i).2 i.1 = p i.1+(i.2.val:ℤ) := by + simp only [coordinateWindowPrimitives,pointLabel,pointCoordinate,coordinateShift] + split <;> rw [← Int.cast_add, endpointLabel_int_mul_tau] + +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + +theorem tangentChartSector_eq_window (hlarge : 15 < m+1) + (k : ℕ) (p : Fin 2 → ℤ) (u : CutRing) (h : B.TangentChartLaws k p u) + (n : ℕ) (hn : k ≤ n) (g : B.CoordinateWindowLaw n) + (d : Fin 2) (e : Fin 5) (z : CutRing × CutRing) + (l v : Fin 2 → CutRing) + (hl : ∀ j, p j ≤ endpointLabel (l j) ∧ endpointLabel (l j) < p j+k) + (hv : ∀ j, p j ≤ endpointLabel (v j) ∧ endpointLabel (v j) < p j+k) : + B.fullGeometricSector hlarge + (translatedTemplate (tangentChartTemplate a k p d (signedShortSteps u e)) z) (h d e z) + (spatialTranslate z (coordinateRectangle a l v)) = + B.windowSector hlarge n g (fun j => pointLabel z j+p j) + (spatialTranslate z (coordinateRectangle a l v)) := by + apply B.chartCoordinateSector_eq_window hlarge n g (fun j => pointLabel z j+p j) + _ (h d e z) Sum.inr Prod.fst (fun i => z+(coordinateWindowPrimitives k p i).2) + · intro i + rfl + · intro i + change pointLabel z i.1+p i.1 ≤ pointLabel (z+(coordinateWindowPrimitives k p i).2) i.1 + simp only [pointLabel_add,coordinateWindow_pointLabel] + omega + · intro i + change pointLabel (z+(coordinateWindowPrimitives k p i).2) i.1 < + pointLabel z i.1+p i.1+(n-1:ℕ) + simp only [pointLabel_add,coordinateWindow_pointLabel] + have hi := i.2.isLt + omega + · intro x y he + apply (translatedTemplate_resolved (a := a) (r := r) (coordinateWindowPrimitives k p) + (coordinateRectangle a l v) (fun x y he => and_congr + (coordinateLabelWindow_resolved k p 0 (l 0) (v 0) (hl 0) (hv 0) x y he) + (coordinateLabelWindow_resolved k p 1 (l 1) (v 1) (hl 1) (hv 1) x y he)) z) x y + simpa only [primitiveTests,primitiveFamilyTests,translatedTemplate,coordinateWindowPrimitives, + initialTest_coordinate] using he + +end InitialCoverSystem +end LabelShiftedCharts + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/LiftedTranslationOrbits.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/LiftedTranslationOrbits.lean new file mode 100644 index 0000000000000000000000000000000000000000..6cb3c330503a9585a680c5f5a9b50bda3c10a172 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/LiftedTranslationOrbits.lean @@ -0,0 +1,36 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.NestedCutCalculus + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section LiftedTranslationOrbits + +variable {A G H : Type*} [CommGroup A] [Group G] [Group H] + +theorem lifted_translation_orbit_independent (q : A →* G) (t : A →* H) + (x : G) (y : H) + (hc : ∀ k, Commute (q k) x → Commute (t k) y) + (u v : A) (h : q u*x*(q u)⁻¹ = q v*x*(q v)⁻¹) : + t u*y*(t u)⁻¹ = t v*y*(t v)⁻¹ := by + have hc₀ : Commute (q (v⁻¹*u)) x := by + simpa only [map_mul,map_inv] using (commute_ratio_of_conjugation h).symm + have hc₁ : Commute (t v⁻¹*t u) y := by + simpa only [map_mul,map_inv] using hc (v⁻¹*u) hc₀ + calc + t u*y*(t u)⁻¹ = t v*((t v⁻¹*t u)*y)*(t u)⁻¹ := by rw [map_inv]; group + _ = t v*(y*(t v⁻¹*t u))*(t u)⁻¹ := by rw [hc₁.eq] + _ = t v*y*(t v)⁻¹ := by rw [map_inv]; group + +end LiftedTranslationOrbits + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/LocalChartDecisions.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/LocalChartDecisions.lean new file mode 100644 index 0000000000000000000000000000000000000000..03aa40d56cb3e91027810cbd232e82f4e85cac95 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/LocalChartDecisions.lean @@ -0,0 +1,125 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.ClippedLineSlide + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section LocalChartDecisions + +theorem fract_fract_add_eq (x y : ℝ) : + Int.fract (Int.fract x+y)=Int.fract (x+y) := by + change Int.fract (x-(⌊x⌋:ℝ)+y)=_ + rw [sub_add_eq_add_sub,Int.fract_sub_intCast] + +theorem translate_planar_lift {a : ℕ} (p : GenericSquare a) (z : ℝ × ℝ) + (hz : p.val=(Int.fract z.1,Int.fract z.2)) (u : CutRing × CutRing) : + (translate a u p).val=(Int.fract (z.1+ordinary u.1),Int.fract (z.2+ordinary u.2)) := by + simp only [translate_val,hz,fract_fract_add_eq] + +theorem translated_clippedSlope_planar {a : ℕ} (r : CutRing) (j : Fin 4) + (hr : 0 rfl + simp only [hform,map_sub,ordinary_cutTau,map_one,map_zero,not_lt, + (coordinate_bounds j (translate a (-u) p)).1,and_true] + rw [hmem,hc,fract_coordinate_sign _ hl hu] + exact sub_nonneg + +end LocalChartDecisions + +section LineParameters + +theorem slope_same_intercept (a : ℕ) (d : Fin 2) (z z' : CutRing × CutRing) + (h : integralCutForm a (slopeDirection d) z = integralCutForm a (slopeDirection d) z') : + ∃ w : CutRing, z'=z+tangentOffset a d w := by + fin_cases d + · refine ⟨z'.1-z.1,?_⟩ + change z.2-cutTau^a*z.1=z'.2-cutTau^a*z'.1 at h + apply Prod.ext + · simp [tangentOffset] + · simp [tangentOffset] + linear_combination -h + · refine ⟨z'.2-z.2,?_⟩ + change z.1-cutTau^a*z.2=z'.1-cutTau^a*z'.2 at h + apply Prod.ext + · simp [tangentOffset] + linear_combination -h + · simp [tangentOffset] + +theorem real_slope_parameter (a : ℕ) (d : Fin 2) (u : CutRing × CutRing) (z : ℝ × ℝ) + (h : cutForm a (slopeDirection d) z=ordinary (integralCutForm a (slopeDirection d) u)) : + ∃ c : ℝ, ∀ j : Fin 2, + realCoordinate z j=ordinary (pointCoordinate u j)+tangentCoefficient a d j*c := by + fin_cases d + · refine ⟨z.1-ordinary u.1,?_⟩ + change z.2-Real.goldenRatio^a*z.1=ordinary (u.2-cutTau^a*u.1) at h + simp only [map_sub,map_mul,map_pow,ordinary_cutTau] at h + intro j; fin_cases j + · simp [realCoordinate,pointCoordinate,tangentCoefficient,tangentOffset] + · simp [realCoordinate,pointCoordinate,tangentCoefficient,tangentOffset] + linear_combination h + · refine ⟨z.2-ordinary u.2,?_⟩ + change z.1-Real.goldenRatio^a*z.2=ordinary (u.1-cutTau^a*u.2) at h + simp only [map_sub,map_mul,map_pow,ordinary_cutTau] at h + intro j; fin_cases j + · simp [realCoordinate,pointCoordinate,tangentCoefficient,tangentOffset] + linear_combination h + · simp [realCoordinate,pointCoordinate,tangentCoefficient,tangentOffset] + +end LineParameters + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/LocalClippedBoxFormula.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/LocalClippedBoxFormula.lean new file mode 100644 index 0000000000000000000000000000000000000000..5c8736089f0185373c0cde74e3ab0b5ffcd61f43 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/LocalClippedBoxFormula.lean @@ -0,0 +1,192 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.RefinedEndpointDecisions +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.ClippedGerms + +namespace OAI + +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +section LocalClippedBoxFormula + +theorem local_clipped_formula_with_box {a : ℕ} (r : CutRing) (j : Fin 4) + (hr : 0 -r) (fun _ => r))).val ↔ + ∀ d, ordinary (pointCoordinate v d-r)≤realCoordinate p.val d ∧ + realCoordinate p.val d -r+pointCoordinate u d + let h := fun d => r+pointCoordinate u d + obtain ⟨k,δ,hδ,hlocal⟩ := local_periodic_rectangle (a := a) l h + (fun d => by dsimp [l,h]; simp only [map_add,map_neg]; linarith [hr.1]) + (fun d => by dsimp [l,h]; simp only [map_add,map_neg]; linarith [hr.2]) z + let v := u+((k 0:CutRing),(k 1:CutRing)) + have hperiod : spatialTranslate v (clippedSlopePrimitive a r j)= + spatialTranslate u (clippedSlopePrimitive a r j) := by + rw [show v=u+((k 0:CutRing),(k 1:CutRing)) from rfl,spatialTranslate_add,spatialTranslate_integral] + have hbox : spatialTranslate u (coordinateRectangle a (fun _ => -r) (fun _ => r))= + coordinateRectangle a l h := by + simpa only [l,h,pointCoordinate] using spatialTranslate_coordinateRectangle u (fun _ => -r) (fun _ => r) + have hlift (p : GenericSquare a) (hp : dist p.val z<δ) : + p ∈ (spatialTranslate u (coordinateRectangle a (fun _ => -r) (fun _ => r))).val ↔ + ∀ d, ordinary (pointCoordinate v d-r)≤realCoordinate p.val d ∧ + realCoordinate p.val d simp [v,pointCoordinate] + simp only [l,h,map_add,map_neg,map_sub,hv] + constructor <;> rintro ⟨h₁,h₂⟩ <;> constructor <;> linarith + have hs (p : GenericSquare a) + (hp : ∀ d, ordinary (pointCoordinate v d-r)≤realCoordinate p.val d ∧ + realCoordinate p.val d exact hh + have hlo := lt_of_le_of_ne (hp d).1 hne.symm + have hup := (hp d).2 + simp only [map_sub,map_add] at hlo hup + rw [abs_lt] + constructor <;> linarith + rw [← hperiod] + exact translated_clippedSlope_planar r j hr v p p.val + (by rw [Int.fract_eq_self.mpr p.property.1,Int.fract_eq_self.mpr p.property.2.1]) + ⟨hnear 0,hnear 1⟩ + refine ⟨k,δ,hδ,?_⟩ + dsimp only + intro p hp + refine ⟨hlift p hp,?_⟩ + constructor + · intro hmem + have hc : p ∈ (spatialTranslate u (coordinateRectangle a (fun _ => -r) (fun _ => r))).val := + clippedSlope_le_box r j hr hmem + have hc' := (hlift p hp).mp hc + exact ⟨hc',(hs p hc').mp hmem⟩ + · rintro ⟨hc,hside⟩ + exact (hs p hc).mpr hside + +namespace ClippedGerm + +def BoxValid {a : ℕ} {r : CutRing} {j : Fin 4} {u : CutRing × CutRing} {z : ℝ × ℝ} + (G : ClippedGerm a r j u z) : Prop := + ∀ p : GenericSquare a, dist p.val z -r) (fun _ => r))).val ↔ + ∀ d, ordinary (pointCoordinate G.offset d-r)≤realCoordinate p.val d ∧ + realCoordinate p.val d (h p hp).2⟩,?_⟩ + exact fun p hp => (h p hp).1 + +end LocalClippedBoxFormula + +namespace ConcurrentGeometry.InwardChart +variable {a : ℕ} {r : CutRing} {C : ConcurrentGeometry a r} {ι : Type*} [Finite ι] + {j : ι → Fin 4} {c : ι → CutRing} {z : ℝ × ℝ} (T : C.InwardChart j c z) + +theorem decisions_locally_eq (hr : 0 ?_⟩ + have he := (T.local_decisions_eq hr p hp.2).trans (hlocal p hp.1) + simpa only [polygonAssignment,decide_eq_true_eq] using Bool.eq_iff_iff.mp (congrFun he i) + +omit [Finite ι] in + +theorem refined_coordinate_phase {κ : Type*} [Finite κ] + {N : ℕ} (e : Fin (N+1) → CutRing) + (he : StrictMono (fun i => ordinary (e i))) (hzero : e 0=0) (hlast : e (Fin.last N)=1) + (hmesh : ∀ i : Fin N, ordinary (e i.succ)-ordinary (e i.castSucc)<1) + (cell : Fin 2 → Fin N) (d : κ → Fin 2) (v : κ → CutRing) (f : κ → ι) + (hf : ∀ k, j (f k)=axisDirection (d k) ∧ c (f k)=v k) + (hv : ∀ k, cutFraction (v k) ∈ Set.range e) + (hlocal : ∀ p : GenericSquare a, p ∈ (refinedGridRectangle a N e cell).val → + p ∈ (C.inwardMargin T.vertex T.offset z).val ∧ ∀ i, + p ∈ (C.localDecision T.vertex T.offset z (j i) (c i)).val ↔ + p ∈ (cutPolygon a (j i) (c i)).val) : + ∃ σ : κ → Bool, refinedGridRectangle a N e cell ≤ + C.coordinateGate T.vertex T.offset z d v σ := by + classical + obtain ⟨x,hx⟩ := refinedGridRectangle_nonempty e he hzero hlast hmesh cell + let σ := polygonAssignment (fun k => C.localDecision T.vertex T.offset z (axisDirection (d k)) (v k)) x + refine ⟨σ,fun y hy => ⟨(hlocal y hy).1,?_⟩⟩ + funext k + apply decide_eq_decide.mpr + have hxy := finite_grid_endpoint_decision e he hzero hlast (cell (d k)) (v k) (hv k) 0 (d k) y x + ((refinedGridRectangle_mem e he hzero hlast hmesh cell y).mp hy (d k)) + ((refinedGridRectangle_mem e he hzero hlast hmesh cell x).mp hx (d k)) + have hy' := (hlocal y hy).2 (f k) + have hx' := (hlocal x hx).2 (f k) + rw [(hf k).1,(hf k).2] at hy' hx' + refine Iff.trans hy' (Iff.trans ?_ hx'.symm) + simpa only [cutPolygon,halfPlane,Set.mem_ofPred_eq,cutForm_axis,coordinate,realCoordinate, + Int.cast_zero,add_zero] using hxy + +omit [Finite ι] in + +theorem refined_interior_phase_bounds {N : ℕ} (e : Fin (N+1) → CutRing) + (he : StrictMono (fun i => ordinary (e i))) (hzero : e 0=0) (hlast : e (Fin.last N)=1) + (hmesh : ∀ i : Fin N, ordinary (e i.succ)-ordinary (e i.castSucc)<1) + (cell : Fin 2 → Fin N) (v : CutRing × CutRing) + (lo hi : Fin 2 → ι) + (hlo : ∀ d, j (lo d)=axisDirection d ∧ c (lo d)=pointCoordinate v d-r) + (hhi : ∀ d, j (hi d)=axisDirection d ∧ c (hi d)=pointCoordinate v d+r) + (hlor : ∀ d, cutFraction (pointCoordinate v d-r) ∈ Set.range e) + (hhir : ∀ d, cutFraction (pointCoordinate v d+r) ∈ Set.range e) + (σ : Fin 2 × Bool → Bool) (hσ : ∀ d, σ (d,false)=false ∧ σ (d,true)=true) + (hgate : refinedGridRectangle a N e cell ≤ C.coordinateGate T.vertex T.offset z Prod.fst + (fun k => if k.2 then pointCoordinate v k.1+r else pointCoordinate v k.1-r) σ) + (hlocal : ∀ p : GenericSquare a, p ∈ (refinedGridRectangle a N e cell).val → ∀ i, + p ∈ (C.localDecision T.vertex T.offset z (j i) (c i)).val ↔ + p ∈ (cutPolygon a (j i) (c i)).val) : + ∀ d, -ordinary r≤ordinary (e (cell d).castSucc)-ordinary (pointCoordinate v d) ∧ + ordinary (e (cell d).succ)-ordinary (pointCoordinate v d)≤ordinary r := by + obtain ⟨x,hx⟩ := refinedGridRectangle_nonempty e he hzero hlast hmesh cell + have hassign := (hgate hx).2 + intro d + have hl := congrFun hassign (d,false) + have hh := congrFun hassign (d,true) + have hlocalL := hlocal x hx (lo d) + have hlocalH := hlocal x hx (hi d) + rw [(hlo d).1,(hlo d).2] at hlocalL + rw [(hhi d).1,(hhi d).2] at hlocalH + have hl' : ¬ x ∈ (C.localDecision T.vertex T.offset z (axisDirection d) (pointCoordinate v d-r)).val := by + simpa only [polygonAssignment,Bool.false_eq_true,↓reduceIte,(hσ d).1,decide_eq_false_iff_not] using hl + have hh' : x ∈ (C.localDecision T.vertex T.offset z (axisDirection d) (pointCoordinate v d+r)).val := by + simpa only [polygonAssignment,↓reduceIte,(hσ d).2,decide_eq_true_eq] using hh + simp only [cutPolygon,halfPlane,Set.mem_ofPred_eq,cutForm_axis] at hlocalL hlocalH + have hb : ordinary (pointCoordinate v d-r) ≤ coordinate d x ∧ + coordinate d x < ordinary (pointCoordinate v d+r) := by + exact ⟨le_of_not_gt (fun h => hl' (hlocalL.mpr h)),hlocalH.mp hh'⟩ + have hf := finite_grid_interval_lift e he hzero hlast (cell d) + (pointCoordinate v d-r) (pointCoordinate v d+r) (hlor d) (hhir d) (coordinate d x) + ((refinedGridRectangle_mem e he hzero hlast hmesh cell x).mp hx d) 0 + (by simpa only [Int.cast_zero,add_zero] using hb) + simp only [Int.cast_zero,add_zero,map_sub,map_add] at hf + constructor <;> linarith [hf.1,hf.2] + +end ConcurrentGeometry.InwardChart + +end SimpleAmenable + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/LocalCoordinateClassifier.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/LocalCoordinateClassifier.lean new file mode 100644 index 0000000000000000000000000000000000000000..a51f15f3dcdd82baafb8d8312bff4f5bc86ed69b --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/LocalCoordinateClassifier.lean @@ -0,0 +1,215 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.WindowRectangles + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section LocalCoordinateClassifier + +theorem circular_interval_on_short_cell (t l u v : ℝ) (_ht : 0 intro hh <;> linarith + · have hx' : Int.fract (x-v)=x-v-((k:ℝ)+1) := by + have he : ⌊x-v⌋=k+1 := Int.floor_eq_iff.mpr (by push_cast; constructor <;> linarith [hk.2,_ht.2]) + rw [Int.fract,he] + push_cast + rfl + rw [hx'] + push_cast + constructor <;> intro hh <;> linarith [hk.2] + · right; right; left + refine ⟨k,by linarith,by linarith,?_⟩ + intro x hxl hxu + rw [hf x (by linarith [hk.1]) (by linarith)] + constructor <;> intro hh <;> linarith + +end LocalCoordinateClassifier + +section ActualCoordinateClassifier + +theorem translated_coordinate_fract {a : ℕ} (j : Fin 2) (u : CutRing × CutRing) + (p : GenericSquare a) (z : ℝ × ℝ) (hz : p.val=(Int.fract z.1,Int.fract z.2)) : + p ∈ (spatialTranslate u (coordinatePrimitive a j)).val ↔ + Int.fract (realCoordinate z j-ordinary (pointCoordinate u j)) rfl + simp only [hform,map_sub,ordinary_cutTau,map_one,map_zero,not_lt, + hc,Int.fract_nonneg,and_true] + +theorem windowRectangle_coordinate_classify {a : ℕ} (n : ℕ) (hn : 201≤n) + (hmesh₁ : 200/(n:ℝ) intro hx <;> linarith + · have hu : u≤ordinary e+(k:ℝ) := by + by_contra hu + exact hkn ⟨by linarith,by linarith⟩ + exact iff_of_true (by linarith) (by linarith) + · rw [h x hxl hxu,h y hyl hyu] + have hkn := hn b hb k + by_cases hh : ordinary b+(k:ℝ)≤l + · exact iff_of_true (by linarith) (by linarith) + · have hu : u≤ordinary b+(k:ℝ) := by + by_contra hu + exact hkn ⟨by linarith,by linarith⟩ + constructor <;> intro hx <;> linarith + +theorem coordinateInterval_planar {a : ℕ} (j : Fin 2) (b e : CutRing) + (hbe : 0≤ordinary e-ordinary b ∧ ordinary e-ordinary b<1) + (p : GenericSquare a) (z : ℝ × ℝ) (hz : p.val=(Int.fract z.1,Int.fract z.2)) : + p ∈ (coordinateInterval a j b e).val ↔ + Int.fract (realCoordinate z j-ordinary b) (A s).det) t := by + convert! (determinantMultilinear.hasFDerivAt (A t)).differentiableAt.comp t hA using 1 + +theorem matrix_differentiableAt_inverse {ι : Type*} [Fintype ι] + {A : ℝ → Matrix ι ι ℝ} {t : ℝ} (hA : DifferentiableAt ℝ A t) + (hunit : IsUnit (A t).det) : DifferentiableAt ℝ (fun s => (A s)⁻¹) t := by + apply differentiableAt_pi.mpr + intro i + apply differentiableAt_pi.mpr + intro j + have hAj : DifferentiableAt ℝ (fun s => (A s).adjugate i j) t := by + simp only [Matrix.adjugate_apply] + apply matrix_differentiableAt_det + apply differentiableAt_pi.mpr + intro k + apply differentiableAt_pi.mpr + intro l + by_cases hk : k=j + · subst k + simpa only [Matrix.updateRow_self] using differentiableAt_const ((Pi.single i (1 : ℝ) : ι → ℝ) l) + · simpa only [Matrix.updateRow_ne hk] using + (differentiableAt_pi.mp (differentiableAt_pi.mp hA k) l) + have hd := (matrix_differentiableAt_det hA).inv hunit.ne_zero + convert! hd.mul hAj using 1 + ext s + simp only [Matrix.inv_def,Ring.inverse_eq_inv,Matrix.smul_apply,smul_eq_mul,Pi.mul_apply,Pi.inv_apply] + +theorem matrix_hasDerivAt_mul {ι : Type*} [Fintype ι] + {A B : ℝ → Matrix ι ι ℝ} {A' B' : Matrix ι ι ℝ} {t : ℝ} + (hA : HasDerivAt A A' t) (hB : HasDerivAt B B' t) : + HasDerivAt (fun s => A s*B s) (A'*B t+A t*B') t := by + apply hasDerivAt_pi.mpr + intro i + apply hasDerivAt_pi.mpr + intro j + have h (k : ι) := ((hasDerivAt_pi.mp (hasDerivAt_pi.mp hA i)) k).mul + ((hasDerivAt_pi.mp (hasDerivAt_pi.mp hB k)) j) + convert! HasDerivAt.fun_sum (fun k (_ : k∈Finset.univ) => h k) using 1 + simp only [Matrix.add_apply,Matrix.mul_apply,Finset.sum_add_distrib] + +theorem matrix_hasDerivAt_inverse {ι : Type*} [Fintype ι] + {A : ℝ → Matrix ι ι ℝ} {A' : Matrix ι ι ℝ} {t : ℝ} + (hA : HasDerivAt A A' t) (hunit : IsUnit (A t).det) : + HasDerivAt (fun s => (A s)⁻¹) (-(A t)⁻¹*A'*(A t)⁻¹) t := by + have hd : HasDerivAt (fun s => (A s)⁻¹) (deriv (fun s => (A s)⁻¹) t) t := by + apply DifferentiableAt.hasDerivAt + convert! matrix_differentiableAt_inverse hA.differentiableAt hunit using 1 + let D := deriv (fun s => (A s)⁻¹) t + have he : ∀ᶠs in 𝓝 t,A s*(A s)⁻¹=1 := by + have hn := (matrix_differentiableAt_det hA.differentiableAt).continuousAt.eventually_ne hunit.ne_zero + filter_upwards [hn] with s hs + exact Matrix.mul_nonsing_inv _ (isUnit_iff_ne_zero.mpr hs) + have hp := matrix_hasDerivAt_mul hA hd + have hz : A'*(A t)⁻¹+A t*D=0 := by + exact (hp.congr_of_eventuallyEq (Filter.EventuallyEq.symm he)).unique (hasDerivAt_const t (1 : Matrix ι ι ℝ)) + have hm := congrArg (fun M : Matrix ι ι ℝ => (A t)⁻¹*M) hz + have heq : D=-(A t)⁻¹*A'*(A t)⁻¹ := by + simp only [Matrix.mul_add,← Matrix.mul_assoc,Matrix.nonsing_inv_mul _ hunit, + one_mul,mul_zero] at hm + rw [neg_mul,neg_mul] + exact eq_neg_of_add_eq_zero_right hm + rw [← heq] + exact hd + +theorem matrix_hasDerivAt_mulVec {ι : Type*} [Fintype ι] + {A : ℝ → Matrix ι ι ℝ} {x : ℝ → ι → ℝ} + {A' : Matrix ι ι ℝ} {x' : ι → ℝ} {t : ℝ} + (hA : HasDerivAt A A' t) (hx : HasDerivAt x x' t) : + HasDerivAt (fun s => A s*ᵥx s) (A'*ᵥx t+A t*ᵥx') t := by + apply hasDerivAt_pi.mpr + intro i + have h (j : ι) := ((hasDerivAt_pi.mp (hasDerivAt_pi.mp hA i)) j).mul + ((hasDerivAt_pi.mp hx) j) + convert! HasDerivAt.fun_sum (fun j (_ : j∈Finset.univ) => h j) using 1 + simp only [Pi.add_apply,Matrix.mulVec,dotProduct,Finset.sum_add_distrib] + +end MatrixInverseCalculus + +section AffineVolume +open Classical Matrix MeasureTheory +open scoped ENNReal + +noncomputable def matrixAffineEquiv {ι : Type*} [Fintype ι] + (A : Matrix ι ι ℝ) (a : ι → ℝ) (hA : IsUnit A.det) : + (ι → ℝ) ≃ᵐ (ι → ℝ) := + ((Matrix.toLinearEquiv (Pi.basisFun ℝ ι) A hA).toContinuousLinearEquiv.toHomeomorph.trans + (Homeomorph.addLeft a)).toMeasurableEquiv + +theorem matrixAffineEquiv_apply {ι : Type*} [Fintype ι] + (A : Matrix ι ι ℝ) (a x : ι → ℝ) (hA : IsUnit A.det) : + matrixAffineEquiv A a hA x=a+A*ᵥx := by + change a+Matrix.toLin (Pi.basisFun ℝ ι) (Pi.basisFun ℝ ι) A x=_ + rw [Matrix.toLin_eq_toLin',Matrix.toLin'_apply] + +theorem matrixAffineEquiv_symm_apply {ι : Type*} [Fintype ι] + (A : Matrix ι ι ℝ) (a y : ι → ℝ) (hA : IsUnit A.det) : + (matrixAffineEquiv A a hA).symm y=A⁻¹*ᵥ(y-a) := by + apply (matrixAffineEquiv A a hA).injective + rw [MeasurableEquiv.apply_symm_apply,matrixAffineEquiv_apply, + Matrix.mulVec_mulVec,Matrix.mul_nonsing_inv _ hA,Matrix.one_mulVec] + abel + +theorem map_matrix_affine_volume {ι : Type*} [Fintype ι] + (A : Matrix ι ι ℝ) (a : ι → ℝ) (hA : IsUnit A.det) : + Measure.map (fun x => a+A*ᵥx) (volume : Measure (ι → ℝ))= + ENNReal.ofReal |A.det⁻¹| • volume := by + change Measure.map ((fun y => a+y) ∘ (Matrix.toLin' A)) volume=_ + rw [← Measure.map_map (by fun_prop) (by fun_prop), + Real.map_matrix_volume_pi_eq_smul_volume_pi hA.ne_zero, + Measure.map_smul _ (by fun_prop),map_add_left_eq_self] + +theorem integral_matrix_affine {ι : Type*} [Fintype ι] + (A : Matrix ι ι ℝ) (a : ι → ℝ) (hA : IsUnit A.det) (f : (ι → ℝ) → ℝ) : + (∫x,f (a+A*ᵥx))=|A.det⁻¹| *(∫y,f y) := by + have h := integral_map_equiv (μ := (volume : Measure (ι → ℝ))) + (matrixAffineEquiv A a hA) f + rw [show (matrixAffineEquiv A a hA : (ι → ℝ) → (ι → ℝ))= + (fun x => a+A*ᵥx) from funext (fun x => matrixAffineEquiv_apply A a x hA),map_matrix_affine_volume A a hA, + integral_smul_measure,ENNReal.toReal_ofReal (abs_nonneg _),smul_eq_mul] at h + exact h.symm + +theorem integral_matrix_affine_inverse {ι : Type*} [Fintype ι] + (A : Matrix ι ι ℝ) (a : ι → ℝ) (hA : IsUnit A.det) (f : (ι → ℝ) → ℝ) : + (∫y,f (A⁻¹*ᵥ(y-a)))=|A.det| *(∫x,f x) := by + have h := integral_matrix_affine A⁻¹ (-(A⁻¹*ᵥa)) + (isUnit_iff_ne_zero.mpr (by rw [Matrix.det_nonsing_inv,Ring.inverse_eq_inv]; exact inv_ne_zero hA.ne_zero)) f + convert! h using 1 + · congr 1 + ext y + rw [Matrix.mulVec_sub] + simp only [sub_eq_add_neg,add_comm] + · rw [Matrix.det_nonsing_inv,Ring.inverse_eq_inv,inv_inv] + +end AffineVolume + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/NestedCutCalculus.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/NestedCutCalculus.lean new file mode 100644 index 0000000000000000000000000000000000000000..881d4755788586240713a44edc1dc72d9c7e96c0 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/NestedCutCalculus.lean @@ -0,0 +1,248 @@ +import Mathlib + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +section NestedCutCalculus + +variable {E H : Type*} [Group E] [Group H] + +theorem commute_ratio_of_conjugation {u v x : H} + (h : v*x*v⁻¹ = u*x*u⁻¹) : Commute x (u⁻¹*v) := by + change x*(u⁻¹*v) = (u⁻¹*v)*x + have ht := congrArg (fun z => u⁻¹*z*v) h + simpa only [mul_assoc, inv_mul_cancel, mul_one, inv_mul_cancel_left] using ht.symm + +def differenceHom (l g : E →* H) + (h : ∀ s t, Commute (l s) ((l t)⁻¹*g t)) : E →* H where + toFun t := (l t)⁻¹*g t + map_one' := by simp + map_mul' s t := by + simp only [map_mul, mul_inv_rev] + calc + (l t)⁻¹*(l s)⁻¹*(g s*g t) = (l t)⁻¹*((l s)⁻¹*g s)*g t := by group + _ = ((l s)⁻¹*g s)*(l t)⁻¹*g t := by rw [(h t s).inv_left.eq] + _ = ((l s)⁻¹*g s)*((l t)⁻¹*g t) := by group + +@[simp] theorem differenceHom_apply (l g : E →* H) + (h : ∀ s t, Commute (l s) ((l t)⁻¹*g t)) (t : E) : + differenceHom l g h t = (l t)⁻¹*g t := rfl + +theorem split_conjugation (l k : E →* H) (h : ∀ s t, Commute (l s) (k t)) + (s t : E) : (l t*k t)*l s*(l t*k t)⁻¹ = l t*l s*(l t)⁻¹ := by + calc + (l t*k t)*l s*(l t*k t)⁻¹ = l t*(k t*l s)*(k t)⁻¹*(l t)⁻¹ := by group + _ = l t*(l s*k t)*(k t)⁻¹*(l t)⁻¹ := by rw [(h s t).symm.eq] + _ = l t*l s*(l t)⁻¹ := by group + +theorem nested_cut_commute_ratio (f l₁ h₁ l₂ h₂ : E →* H) + (hf₁ : ∀ s, f s = l₁ s*h₁ s) (hf₂ : ∀ s, f s = l₂ s*h₂ s) + (hc₁ : ∀ s t, Commute (l₁ s) (h₁ t)) + (hc₁₂ : ∀ s t, Commute (l₁ s) (h₂ t)) : + ∀ s t, Commute (l₁ s) ((l₂ t)⁻¹*f t) ∧ + Commute (l₁ s) ((l₁ t)⁻¹*l₂ t) := by + intro s t + constructor + · simpa [hf₂] using hc₁₂ s t + · apply commute_ratio_of_conjugation + calc + l₂ t*l₁ s*(l₂ t)⁻¹ = f t*l₁ s*(f t)⁻¹ := by + rw [hf₂] + calc + l₂ t*l₁ s*(l₂ t)⁻¹ = l₂ t*(l₁ s*h₂ t)*(h₂ t)⁻¹*(l₂ t)⁻¹ := by group + _ = l₂ t*(h₂ t*l₁ s)*(h₂ t)⁻¹*(l₂ t)⁻¹ := by rw [(hc₁₂ s t).eq] + _ = (l₂ t*h₂ t)*l₁ s*(l₂ t*h₂ t)⁻¹ := by group + _ = l₁ t*l₁ s*(l₁ t)⁻¹ := by rw [hf₁]; exact split_conjugation l₁ h₁ hc₁ s t + +theorem nested_cut_difference (f l₁ h₁ l₂ h₂ : E →* H) + (hf₁ : ∀ s, f s = l₁ s*h₁ s) (hf₂ : ∀ s, f s = l₂ s*h₂ s) + (hc₁ : ∀ s t, Commute (l₁ s) (h₁ t)) + (hc₁₂ : ∀ s t, Commute (l₁ s) (h₂ t)) : + ∃ d : E →* H, (∀ s, l₂ s = l₁ s*d s) ∧ + (∀ s t, Commute (l₁ s) (d t)) := by + let hc := fun s t => (nested_cut_commute_ratio f l₁ h₁ l₂ h₂ hf₁ hf₂ hc₁ hc₁₂ s t).2 + refine ⟨differenceHom l₁ l₂ hc, ?_, hc⟩ + intro s + simp + +theorem ordered_differences_telescope (l : ℕ → H) (n : ℕ) : + ((List.range n).map (fun i => (l i)⁻¹*l (i+1))).prod = (l 0)⁻¹*l n := by + induction n with + | zero => simp + | succ n ih => + rw [List.range_succ, List.map_append, List.prod_append, ih] + simp + +theorem difference_commutes_with_prefix (earlier l g : E →* H) + (h : ∀ s t, g t*earlier s*(g t)⁻¹ = l t*earlier s*(l t)⁻¹) + (hc : ∀ s t, Commute (l s) ((l t)⁻¹*g t)) (s t : E) : + Commute (earlier s) (differenceHom l g hc t) := + commute_ratio_of_conjugation (h s t) + +end NestedCutCalculus + +open scoped commutatorElement +section ConditionalControl +variable {E H : Type*} [Group E] [Group H] + +theorem same_conj_iff (u v k : H) : + u*k*u⁻¹ = v*k*v⁻¹ ↔ Commute (u⁻¹*v) k := by + constructor + · intro h + apply commutatorElement_eq_one_iff_commute.mp + rw [commutatorElement_def] + calc + _ = u⁻¹*(v*k*v⁻¹)*u*k⁻¹ := by group + _ = u⁻¹*(u*k*u⁻¹)*u*k⁻¹ := by rw [← h] + _ = 1 := by group + · intro h + have hc := h.eq + calc + u*k*u⁻¹ = u*(k*(u⁻¹*v))*v⁻¹ := by group + _ = u*((u⁻¹*v)*k)*v⁻¹ := by rw [hc] + _ = v*k*v⁻¹ := by group + +theorem commute_of_conditional_move (u v k : H) (hv : Commute u v) + (hk : Commute u (v*k*v⁻¹)) : Commute u k := by + have h := (hv.inv_right.mul_right hk).mul_right hv + simpa only [mul_assoc,inv_mul_cancel_left,mul_inv_cancel_right,inv_mul_cancel,mul_one] using h + +private theorem commutator_four (b c d e : H) + (hcb : Commute c b) (hce : Commute c e) (hdb : Commute d b) + (hcd : Commute c d) (hbe : Commute b e) : + ⁅c*d,b*e⁆ = ⁅d,e⁆ := by + rw [commutatorElement_mul_left_eq_conj_mul, + (hcb.mul_right hce).commutator_eq,mul_one, + commutatorElement_mul_right_eq_mul_conj,hdb.commutator_eq,one_mul] + have hb : Commute b ⁅d,e⁆ := by + rw [commutatorElement_def] + exact ((hdb.symm.mul_right hbe).mul_right hdb.symm.inv_right).mul_right hbe.inv_right + have hc : Commute c ⁅d,e⁆ := by + rw [commutatorElement_def] + exact ((hcd.mul_right hce).mul_right hcd.inv_right).mul_right hce.inv_right + calc + _ = c* ⁅d,e⁆ *c⁻¹ := by rw [hb.eq]; group + _ = ⁅d,e⁆ := by rw [hc.eq]; group + +theorem four_factor_in_subgroup [Group.IsPerfect E] + (b c d : E →* H) (C : Subgroup H) + (hbc : ∀ s t, Commute (b s) (c t)) + (hbd : ∀ s t, Commute (b s) (d t)) + (hcd : ∀ s t, Commute (c s) (d t)) + (hJ : ∀ s, c s*d s ∈ C) (hK : ∀ s, b s*d s ∈ C) : + d.range ≤ C := by + have hh : ⁅d.range,d.range⁆ ≤ C := by + apply Subgroup.commutator_le.mpr + rintro _ ⟨s,rfl⟩ _ ⟨t,rfl⟩ + rw [← commutator_four (b t) (c s) (d s) (d t) + (hbc t s).symm (hcd s t) (hbd t s).symm (hcd s s) (hbd t t)] + exact C.mul_mem (C.mul_mem (C.mul_mem (hJ s) (hK t)) (C.inv_mem (hJ s))) + (C.inv_mem (hK t)) + have he : (commutator E).map d = d.range := by + rw [Group.IsPerfect.commutator_eq_top,← MonoidHom.range_eq_map] + rw [← he,map_commutator_eq] + exact hh + +def SameActionOn (f g : E → H) (P : Subgroup H) : Prop := + ∀ s, ∀ k ∈ P, f s*k*(f s)⁻¹ = g s*k*(g s)⁻¹ + +theorem intersection_control [Group.IsPerfect E] + (a b c d f : E →* H) (P : Subgroup H) + (hbc : ∀ s t, Commute (b s) (c t)) + (hbd : ∀ s t, Commute (b s) (d t)) + (hcd : ∀ s t, Commute (c s) (d t)) + (hf : ∀ s, f s = a s*b s*c s*d s) + (hJ : SameActionOn (fun s => a s*b s) f P) + (hK : SameActionOn (fun s => a s*c s) f P) : + SameActionOn a f P := by + let C := Subgroup.centralizer (P : Set H) + have hJ' (s : E) : c s*d s ∈ C := by + intro k hk + have he := (same_conj_iff _ _ _).mp (hJ s k hk) + rw [hf] at he + have hu : (a s*b s)⁻¹*(a s*b s*c s*d s) = c s*d s := by group + rw [hu] at he + exact he.eq.symm + have hK' (s : E) : b s*d s ∈ C := by + intro k hk + have he := (same_conj_iff _ _ _).mp (hK s k hk) + rw [hf] at he + have hu : (a s*c s)⁻¹*(a s*b s*c s*d s) = b s*d s := by + calc + _ = (c s)⁻¹*b s*c s*d s := by group + _ = (c s)⁻¹*c s*b s*d s := by + simp only [mul_assoc] + rw [← mul_assoc (b s) (c s) (d s), (hbc s s).eq, mul_assoc] + _ = b s*d s := by group + rw [hu] at he + exact he.eq.symm + have hd := four_factor_in_subgroup b c d C hbc hbd hcd hJ' hK' + have hb (s : E) : b s ∈ C := by + simpa using C.mul_mem (hK' s) (C.inv_mem (hd ⟨s,rfl⟩)) + have hc (s : E) : c s ∈ C := by + simpa using C.mul_mem (hJ' s) (C.inv_mem (hd ⟨s,rfl⟩)) + intro s k hk + apply (same_conj_iff _ _ _).mpr + rw [hf] + have hu : (a s)⁻¹*(a s*b s*c s*d s) = b s*c s*d s := by group + rw [hu] + exact (C.mul_mem (C.mul_mem (hb s) (hc s)) + (hd ⟨s,rfl⟩) k hk).symm + +theorem conj_mul_of_commute (a b k : H) (h : Commute b k) : + (a*b)*k*(a*b)⁻¹ = a*k*a⁻¹ := by + calc + _ = a*(b*k*b⁻¹)*a⁻¹ := by group + _ = a*k*a⁻¹ := by rw [h.eq]; group + +section NestedCuts +variable (f : E →* H) (l h : ℕ → E →* H) + (hf : ∀ i s, f s = l i s*h i s) + (hc : ∀ i j, i ≤ j → ∀ s t, Commute (l i s) (h j t)) + +def cutDifference (i : ℕ) : E →* H := + differenceHom (l i) (l (i+1)) (fun s t => + (nested_cut_commute_ratio f (l i) (h i) (l (i+1)) (h (i+1)) + (hf i) (hf (i+1)) (hc i i le_rfl) (hc i (i+1) (by omega)) s t).2) + +theorem cutDifference_commute_prefix (i j : ℕ) (hij : j ≤ i) (s t : E) : + Commute (cutDifference f l h hf hc i t) (l j s) := by + change Commute ((l i t)⁻¹*l (i+1) t) (l j s) + apply (same_conj_iff _ _ _).mp + calc + _ = f t*l j s*(f t)⁻¹ := by + rw [hf i] + exact (conj_mul_of_commute _ _ _ (hc j i hij s t).symm).symm + _ = _ := by + rw [hf (i+1)] + exact conj_mul_of_commute _ _ _ (hc j (i+1) (by omega) s t).symm + +theorem cutDifference_pairwise (i j : ℕ) (hij : i < j) (s t : E) : + Commute (cutDifference f l h hf hc i s) (cutDifference f l h hf hc j t) := by + change Commute ((l i s)⁻¹*l (i+1) s) (cutDifference f l h hf hc j t) + exact ((cutDifference_commute_prefix f l h hf hc j i (by omega) s t).symm.inv_left).mul_left + (cutDifference_commute_prefix f l h hf hc j (i+1) (by omega) s t).symm + +theorem cutDifference_telescope (n : ℕ) (s : E) : + ((List.range n).map (fun i => cutDifference f l h hf hc i s)).prod = + (l 0 s)⁻¹*l n s := by + induction n with + | zero => simp + | succ n ih => + rw [List.range_succ,List.map_append,List.prod_append,ih] + simp only [List.map_singleton,List.prod_singleton] + change (l 0 s)⁻¹*l n s*((l n s)⁻¹*l (n+1) s) = _ + group + +end NestedCuts + +end ConditionalControl + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/ObservableDistance.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/ObservableDistance.lean new file mode 100644 index 0000000000000000000000000000000000000000..db8362aee6e90ce4b8ac9bc960c1e448ced814e2 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/ObservableDistance.lean @@ -0,0 +1,144 @@ +import Mathlib + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section ObservableDistance +open Classical MeasureTheory Set + +def ObservableClose {X : Type*} [MeasurableSpace X] (μ ν : Measure X) (ε : ℝ) : Prop := + ∀f : X → ℝ,Measurable f → (∀x,f x∈Icc (0:ℝ) 1) → + |(∫x,f x ∂μ)-(∫x,f x ∂ν)| ≤ ε + +theorem boundedObservable_integrable {X : Type*} [MeasurableSpace X] + (μ : Measure X) [IsFiniteMeasure μ] {f : X → ℝ} + (hf : Measurable f) (hb : ∀x,f x∈Icc (0:ℝ) 1) : Integrable f μ := by + apply (integrable_const (1:ℝ)).mono' hf.aestronglyMeasurable + filter_upwards with x + simpa only [Real.norm_eq_abs,abs_of_nonneg (hb x).1] using (hb x).2 + +theorem ObservableClose.mono {X : Type*} [MeasurableSpace X] + {μ ν : Measure X} {ε δ : ℝ} (h : ObservableClose μ ν ε) (he : ε ≤ δ) : + ObservableClose μ ν δ := fun f hf hb => (h f hf hb).trans he + +theorem ObservableClose.symm {X : Type*} [MeasurableSpace X] + {μ ν : Measure X} {ε : ℝ} (h : ObservableClose μ ν ε) : + ObservableClose ν μ ε := by + intro f hf hb + rw [abs_sub_comm] + exact h f hf hb + +theorem ObservableClose.map {X Y : Type*} [MeasurableSpace X] [MeasurableSpace Y] + {μ ν : Measure X} {ε : ℝ} (h : ObservableClose μ ν ε) {g : X → Y} (hg : Measurable g) : + ObservableClose (μ.map g) (ν.map g) ε := by + intro f hf hb + rw [integral_map hg.aemeasurable hf.aestronglyMeasurable, + integral_map hg.aemeasurable hf.aestronglyMeasurable] + exact h (f ∘ g) (hf.comp hg) (fun x => hb (g x)) + +theorem ObservableClose.event {X : Type*} [MeasurableSpace X] + {μ ν : Measure X} [IsFiniteMeasure μ] [IsFiniteMeasure ν] + {ε : ℝ} (h : ObservableClose μ ν ε) {s : Set X} (hs : MeasurableSet s) : + |μ.real s-ν.real s| ≤ ε := by + have hh := h (s.indicator (fun _ => (1:ℝ))) (measurable_const.indicator hs) (by + intro x + by_cases hx : x∈s <;> simp [hx]) + simpa only [integral_indicator hs,integral_const,smul_eq_mul,mul_one,Measure.real,Measure.restrict_apply_univ] using hh + +theorem ObservableClose.prod_right {X Y : Type*} [MeasurableSpace X] [MeasurableSpace Y] + {μ ν : Measure X} [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] + (ρ : Measure Y) [IsProbabilityMeasure ρ] {ε : ℝ} (h : ObservableClose μ ν ε) : + ObservableClose (μ.prod ρ) (ν.prod ρ) ε := by + intro f hf hb + have hiμ := boundedObservable_integrable (μ.prod ρ) hf hb + have hiν := boundedObservable_integrable (ν.prod ρ) hf hb + rw [integral_prod f hiμ,integral_prod f hiν] + apply h (fun x => ∫y,f (x,y) ∂ρ) + · have hh : StronglyMeasurable (Function.uncurry (fun (x : X) (y : Y) => f (x,y))) := + hf.stronglyMeasurable + exact hh.integral_prod_right.measurable + · intro x + refine ⟨integral_nonneg (fun y => (hb (x,y)).1),?_⟩ + have hi := boundedObservable_integrable ρ (hf.comp (measurable_const.prodMk measurable_id)) + (fun y => hb (x,y)) + calc + _ ≤ ∫_ : Y,(1:ℝ) ∂ρ := integral_mono hi (integrable_const 1) (fun y => (hb (x,y)).2) + _ = 1 := by simp + +theorem observableClose_of_density {X : Type*} [MeasurableSpace X] + (μ : Measure X) {p q : X → ℝ} (hp : Measurable p) (hq : Measurable q) + (hp₀ : ∀x,0 ≤ p x) (hq₀ : ∀x,0 ≤ q x) + (hip : Integrable p μ) (hiq : Integrable q μ) : + ObservableClose (μ.withDensity (fun x => ENNReal.ofReal (p x))) + (μ.withDensity (fun x => ENNReal.ofReal (q x))) (∫x,|p x-q x| ∂μ) := by + intro f hf hb + have hb' : ∀ᵐx ∂μ,‖f x‖ ≤ (1:ℝ) := ae_of_all _ (fun x => by + simpa only [Real.norm_eq_abs,abs_of_nonneg (hb x).1] using (hb x).2) + have hipf := hip.mul_bdd hf.aestronglyMeasurable hb' + have hiqf := hiq.mul_bdd hf.aestronglyMeasurable hb' + rw [integral_withDensity_eq_integral_toReal_smul hp.ennreal_ofReal + (ae_of_all _ (fun _ => ENNReal.ofReal_lt_top)), + integral_withDensity_eq_integral_toReal_smul hq.ennreal_ofReal + (ae_of_all _ (fun _ => ENNReal.ofReal_lt_top))] + simp only [ENNReal.toReal_ofReal (hp₀ _),ENNReal.toReal_ofReal (hq₀ _),smul_eq_mul] + rw [← integral_sub hipf hiqf] + calc + _ ≤ ∫x,|p x*f x-q x*f x| ∂μ := abs_integral_le_integral_abs + _ ≤ _ := by + apply integral_mono (hipf.sub hiqf).abs (hip.sub hiq).abs + intro x + change |p x*f x-q x*f x| ≤ |p x-q x| + rw [← sub_mul,abs_mul,abs_of_nonneg (hb x).1] + exact mul_le_of_le_one_right (abs_nonneg _) (hb x).2 + +end ObservableDistance + +section InfiniteSplit +open Classical MeasureTheory Set + +theorem infinitePi_split {ι X : Type*} [MeasurableSpace X] + (μ : Measure X) [IsProbabilityMeasure μ] (p : ι → Prop) : + ((Measure.infinitePi (fun _ : Subtype p => μ)).prod + (Measure.infinitePi (fun _ : Subtype (fun i => ¬p i) => μ))).map + (MeasurableEquiv.piEquivPiSubtypeProd (fun _ : ι => X) p).symm= + Measure.infinitePi (fun _ : ι => μ) := by + apply Measure.eq_infinitePi + intro s t ht + let e := (MeasurableEquiv.piEquivPiSubtypeProd (fun _ : ι => X) p).symm + rw [Measure.map_apply e.measurable (MeasurableSet.pi s.countable_toSet (fun i _ => ht i))] + have he (x : (Subtype p → X) × (Subtype (fun i => ¬p i) → X)) (i : ι) : + e x i=(if h : p i then x.1 ⟨i,h⟩ else x.2 ⟨i,h⟩) := rfl + have hpre : (e : _ → _) ⁻¹' ((s : Set ι).pi t)= + ((s.subtype p : Set (Subtype p)).pi (fun i => t i.val)) ×ˢ + ((s.subtype (fun i => ¬p i) : Set (Subtype (fun i => ¬p i))).pi (fun i => t i.val)) := by + ext x + simp only [mem_preimage,mem_pi,Finset.mem_coe,mem_prod,Finset.mem_subtype] + constructor + · intro h + constructor + · intro i hi + simpa only [he,dite_eq_left i.property] using h i.val hi + · intro i hi + simpa only [he,dite_eq_right i.property] using h i.val hi + · rintro ⟨h₁,h₂⟩ i hi + by_cases hp : p i + · simpa only [he,dite_eq_left hp] using h₁ ⟨i,hp⟩ hi + · simpa only [he,dite_eq_right hp] using h₂ ⟨i,hp⟩ hi + rw [hpre,Measure.prod_prod,Measure.infinitePi_pi (fun _ : Subtype p => μ) (fun i _ => ht i.val), + Measure.infinitePi_pi (fun _ : Subtype (fun i => ¬p i) => μ) (fun i _ => ht i.val)] + rw [Finset.prod_subtype_eq_prod_filter (s:=s) (p:=p) (fun i => μ (t i)), + Finset.prod_subtype_eq_prod_filter (s:=s) (p:=fun i => ¬p i) (fun i => μ (t i))] + exact Finset.prod_filter_mul_prod_filter_not s p (fun i => μ (t i)) + +end InfiniteSplit + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/ObservableProducts.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/ObservableProducts.lean new file mode 100644 index 0000000000000000000000000000000000000000..04e37f8117513da61db6c098d6891b49a016aaa8 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/ObservableProducts.lean @@ -0,0 +1,66 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.ObservableDistance + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section ObservableProducts +open Classical MeasureTheory Set + +theorem ObservableClose.refl {X : Type*} [MeasurableSpace X] (μ : Measure X) : + ObservableClose μ μ 0 := by + intro f hf hb + simp + +theorem ObservableClose.trans {X : Type*} [MeasurableSpace X] + {μ ν ρ : Measure X} {ε δ : ℝ} (h : ObservableClose μ ν ε) (k : ObservableClose ν ρ δ) : + ObservableClose μ ρ (ε+δ) := by + intro f hf hb + exact (abs_sub_le _ _ _).trans (add_le_add (h f hf hb) (k f hf hb)) + +theorem ObservableClose.prod_left {X Y : Type*} [MeasurableSpace X] [MeasurableSpace Y] + {μ ν : Measure Y} [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] + (ρ : Measure X) [IsProbabilityMeasure ρ] {ε : ℝ} (h : ObservableClose μ ν ε) : + ObservableClose (ρ.prod μ) (ρ.prod ν) ε := by + have hh := (h.prod_right ρ).map measurable_swap + simpa only [Measure.prod_swap] using hh + +theorem ObservableClose.prod {X Y : Type*} [MeasurableSpace X] [MeasurableSpace Y] + {μ ν : Measure X} [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] + {ρ σ : Measure Y} [IsProbabilityMeasure ρ] [IsProbabilityMeasure σ] + {ε δ : ℝ} (h : ObservableClose μ ν ε) (k : ObservableClose ρ σ δ) : + ObservableClose (μ.prod ρ) (ν.prod σ) (ε+δ) := + (h.prod_right ρ).trans (k.prod_left ν) + +theorem ObservableClose.fin_pi (n : ℕ) {X : Fin n → Type*} [∀i,MeasurableSpace (X i)] + (μ ν : ∀i,Measure (X i)) [∀i,IsProbabilityMeasure (μ i)] [∀i,IsProbabilityMeasure (ν i)] + (ε : Fin n → ℝ) (h : ∀i,ObservableClose (μ i) (ν i) (ε i)) : + ObservableClose (Measure.pi μ) (Measure.pi ν) (∑i,ε i) := by + induction n with + | zero => + have he : μ=ν := by funext i; exact Fin.elim0 i + subst ν + simpa using ObservableClose.refl (Measure.pi μ) + | succ n ih => + let e := MeasurableEquiv.piFinSuccAbove X (0 : Fin (n+1)) + have hμ := (measurePreserving_piFinSuccAbove μ (0 : Fin (n+1))).symm.map_eq + have hν := (measurePreserving_piFinSuccAbove ν (0 : Fin (n+1))).symm.map_eq + have hi := ih (fun i => μ ((0 : Fin (n+1)).succAbove i)) + (fun i => ν ((0 : Fin (n+1)).succAbove i)) + (fun i => ε ((0 : Fin (n+1)).succAbove i)) (fun i => h _) + have hh := ((h 0).prod hi).map e.symm.measurable + rw [hμ,hν] at hh + simpa only [Fin.succAbove_zero,Fin.sum_univ_succ] using hh + +end ObservableProducts + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/OffsetFrames.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/OffsetFrames.lean new file mode 100644 index 0000000000000000000000000000000000000000..908c795307ff2654d88d9db8d12a0fb2633c764b --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/OffsetFrames.lean @@ -0,0 +1,92 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.PrimitiveCentralLaws +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.CommonTranslatedCopies +import OAI.GroupTheory.SimpleAmenable.RandomFields.CanonicalPolygonCovariance + +namespace OAI + +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement + +structure OffsetFrame (a : ℕ) (r : CutRing) (m : ℕ) (hm : 2 ≤ m) + (I : Finset (Fin (m+1))) (u : Fin (m+1) → CutRing × CutRing) where + k : Multiplicative (FreeAbelianGroup (Fin m × Fin 2)) + d : Fin (m+1) → CutRing × CutRing + projection : sourceLatticeFullMap a r m hm k = trackTranslation d + prescribed : ∀ i ∈ I, d i = u i + +noncomputable def balancedOffsetFrame (a : ℕ) (r : CutRing) (m : ℕ) (hm : 2 ≤ m) + (I : Finset (Fin (m+1))) (b : Fin (m+1)) (hb : b ∉ I) + (u : Fin (m+1) → CutRing × CutRing) : OffsetFrame a r m hm I u := by + let h := sourceLatticeFullMap_prescribed a r m hm I b hb u + exact ⟨h.choose,h.choose_spec.choose,h.choose_spec.choose_spec.1,h.choose_spec.choose_spec.2⟩ + +namespace OffsetFrame +variable {a m : ℕ} {r : CutRing} {hm : 2 ≤ m} {I : Finset (Fin (m+1))} + {u v : Fin (m+1) → CutRing × CutRing} + +def difference (F : OffsetFrame a r m hm I u) (G : OffsetFrame a r m hm I v) + (huv : ∀ i ∈ I, u i = v i) : CommonFrame a r m hm I 0 where + k := F.k⁻¹ * G.k + d := -F.d + G.d + projection := by rw [map_mul,map_inv,F.projection,G.projection,trackTranslation_add,trackTranslation_neg] + common := by intro i hi; simp only [Pi.add_apply,Pi.neg_apply,F.prescribed i hi,G.prescribed i hi,huv i hi,neg_add_cancel] + +end OffsetFrame + +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + (hlarge : 15 < m+1) (h : B.AllPrimitiveLaws) (hr : 0 l.val.1) + (fun l => ordinary l.val.2) (fun l => squareSign l.val p) + +theorem openSquareChart_open {a : ℕ} (T : Finset PlaneCut) (p : GenericSquare a) : + IsOpen (openSquareChart T p) := by + apply ((isOpen_Ioo : IsOpen (Ioo (0:ℝ) 1)).prod isOpen_Ioo).inter + have he : strictLineCell a (fun l : T => l.val.1) (fun l => ordinary l.val.2) + (fun l => squareSign l.val p)=⋂l : T,{x | if squareSign l.val p then + cutForm a l.val.1 x < ordinary l.val.2 else ordinary l.val.2 < cutForm a l.val.1 x} := by + ext x + simp [strictLineCell] + rw [he] + apply isOpen_iInter_of_finite + intro l + split_ifs + · exact isOpen_lt (cutForm_continuous a l.val.1) continuous_const + · exact isOpen_lt continuous_const (cutForm_continuous a l.val.1) + +theorem openSquareChart_convex {a : ℕ} (T : Finset PlaneCut) (p : GenericSquare a) : + Convex ℝ (openSquareChart T p) := + ((convex_Ioo (0:ℝ) 1).prod (convex_Ioo (0:ℝ) 1)).inter (strictLineCell_convex _ _ _ _) + +theorem self_mem_openSquareChart {a : ℕ} (T : Finset PlaneCut) (p : GenericSquare a) : + p.val ∈ openSquareChart T p := by + refine ⟨generic_mem_squareInterior p,?_⟩ + intro l + by_cases h : cutForm a l.val.1 p.val < ordinary l.val.2 + · simp [squareSign,h] + · simpa [squareSign,h] using + lt_of_le_of_ne (le_of_not_gt h) (p.property.2.2 l.val.1 l.val.2).symm + +theorem openSquareChart_signs {a : ℕ} {T : Finset PlaneCut} {p : GenericSquare a} + {x : ℝ×ℝ} (hx : x ∈ openSquareChart T p) {l : PlaneCut} (hl : l ∈ T) : + cutForm a l.1 x ≠ ordinary l.2 ∧ + (cutForm a l.1 x < ordinary l.2 ↔ cutForm a l.1 p.val < ordinary l.2) := by + have hh := hx.2 ⟨l,hl⟩ + by_cases h : cutForm a l.1 p.val < ordinary l.2 + · have ht : cutForm a l.1 x < ordinary l.2 := by simpa [squareSign,h] using hh + exact ⟨ne_of_lt ht,iff_of_true ht h⟩ + · have ht : ordinary l.2 < cutForm a l.1 x := by simpa [squareSign,h] using hh + exact ⟨ne_of_gt ht,iff_of_false (not_lt_of_gt ht) h⟩ + +theorem squareArrangement_on_openChart {a : ℕ} {K : Type*} + (f : GenericSquare a → K) (T : Finset PlaneCut) + (hT : ∀p q,(∀l ∈ T,squareSign l p=squareSign l q) → f p=f q) + (p q : GenericSquare a) (hq : q.val ∈ openSquareChart T p) : f q=f p := + hT q p (fun _ hl => decide_eq_decide.mpr (openSquareChart_signs hq hl).2) + +theorem open_subset_closed_of_dense {X : Type*} [TopologicalSpace X] + {D C A : Set X} (hD : Dense D) (hC : IsOpen C) (hA : IsClosed A) + (h : C ∩ D ⊆ A) : C ⊆ A := by + intro x hx + by_contra hn + have hne : (C ∩ Aᶜ).Nonempty := ⟨x,hx,hn⟩ + obtain ⟨y,hy,hyD⟩ := hD.inter_open_nonempty (C ∩ Aᶜ) (hC.inter hA.isOpen_compl) hne + exact hy.2 (h ⟨hy.1,hyD⟩) + +theorem open_translation_square {a : ℕ} {C : Set (ℝ×ℝ)} (hC : IsOpen C) + (hCs : C ⊆ squareInterior) (u : CutRing×CutRing) + (hgen : ∀p : GenericSquare a,p.val ∈ C → p.val+(ordinary u.1,ordinary u.2) ∈ squareInterior) : + (fun x => x+(ordinary u.1,ordinary u.2)) '' C ⊆ squareInterior := by + let v := (ordinary u.1,ordinary u.2) + let W := (fun x => x+v) '' C + have hW : IsOpen W := (Homeomorph.addRight v).isOpenMap C hC + have hWclosed : W ⊆ Icc (0:ℝ) 1 ×ˢ Icc (0:ℝ) 1 := by + apply open_subset_closed_of_dense (avoidsCuts_dense a) hW (isClosed_Icc.prod isClosed_Icc) + rintro y ⟨⟨x,hx,rfl⟩,hy⟩ + have hg : AvoidsCuts a x := by + have hh := avoidsCuts_translate hy (-u) + simpa [v,map_neg,←Prod.neg_mk] using hh + have hp : x.1 ∈ Ico (0:ℝ) 1 ∧ x.2 ∈ Ico (0:ℝ) 1 ∧ AvoidsCuts a x := + ⟨⟨(hCs hx).1.1.le,(hCs hx).1.2⟩,⟨(hCs hx).2.1.le,(hCs hx).2.2⟩,hg⟩ + have hi := hgen ⟨x,hp⟩ hx + exact ⟨⟨hi.1.1.le,hi.1.2.le⟩,⟨hi.2.1.le,hi.2.2.le⟩⟩ + have hh := hW.subset_interior_iff.mpr hWclosed + simpa only [interior_prod_eq,interior_Icc,squareInterior] using hh + +theorem fullGroupAffineChart_square {a m : ℕ} (g : polygonFullGroup a m) (i : Fin m) + (T : Finset PlaneCut) + (hT : ∀p q,(∀l ∈ T,squareSign l p=squareSign l q) → + fullGroupAffineData g i p=fullGroupAffineData g i q) (p : GenericSquare a) : + (fun x => x+(ordinary (fullGroupAffineData g i p).2.1, + ordinary (fullGroupAffineData g i p).2.2)) '' openSquareChart T p ⊆ squareInterior := by + apply open_translation_square (openSquareChart_open T p) (fun _ h => h.1) + intro q hq + have hf := squareArrangement_on_openChart (fullGroupAffineData g i) T hT p q hq + have hg := fullGroupSquareShift_spec g i q + change (g.val (i,q)).2.val=q.val+(ordinary (fullGroupAffineData g i q).2.1, + ordinary (fullGroupAffineData g i q).2.2) at hg + rw [hf] at hg + rw [←hg] + exact generic_mem_squareInterior _ + +end OpenAffineCharts + +section ChartLineIntervals +open Classical Set + +noncomputable def chartCrossingParameter (a : ℕ) (j : Fin 4) (c : CutRing) (l : PlaneCut) : ℝ := + (ordinary l.2-cutForm a l.1 (barrierLinePoint a j c 0))/cutForm a l.1 (barrierTangent a j) + +theorem chartCrossingParameter_spec (a : ℕ) (j : Fin 4) (c : CutRing) (l : PlaneCut) + (hl : cutForm a l.1 (barrierTangent a j) ≠ 0) : + cutForm a l.1 (barrierLinePoint a j c (chartCrossingParameter a j c l))=ordinary l.2 := by + rw [barrier_cut_difference a j l.1 c 0] + simp only [sub_zero,chartCrossingParameter,div_mul_cancel₀ _ hl] + ring + +theorem chartCrossingParameter_unique (a : ℕ) (j : Fin 4) (c : CutRing) (l : PlaneCut) + (hl : cutForm a l.1 (barrierTangent a j) ≠ 0) {r : ℝ} + (hr : cutForm a l.1 (barrierLinePoint a j c r)=ordinary l.2) : + r=chartCrossingParameter a j c l := by + have hd := barrier_cut_difference a j l.1 c 0 r + dsimp [chartCrossingParameter] + apply (eq_div_iff hl).mpr + simpa only [sub_zero] using (eq_sub_iff_add_eq.mpr (by linarith : + r*cutForm a l.1 (barrierTangent a j)+cutForm a l.1 (barrierLinePoint a j c 0)=ordinary l.2)) + +theorem openSquareChart_line_interval {a : ℕ} (T : Finset PlaneCut) (p : GenericSquare a) + {j : Fin 4} {c : CutRing} {N x : ℝ} (hc : c ∈ barrierCandidate a j N) + (hx : barrierLinePoint a j c x ∈ openSquareChart T p) : + ∃L U : ℝ,x ∈ Ioo L U ∧ + L ∈ Icc (barrierLineLower a j c) (barrierLineUpper a j c) ∧ + U ∈ Icc (barrierLineLower a j c) (barrierLineUpper a j c) ∧ + (∀r ∈ Ioo L U,barrierLinePoint a j c r ∈ openSquareChart T p) ∧ + (∀r ∈ ({L,U} : Finset ℝ),r=barrierLineLower a j c ∨ r=barrierLineUpper a j c ∨ + ∃l ∈ T,j ≠ l.1 ∧ cutForm a l.1 (barrierLinePoint a j c r)=ordinary l.2) := by + let lo := barrierLineLower a j c + let hi := barrierLineUpper a j c + let R := T.filter (fun l => cutForm a l.1 (barrierTangent a j) ≠ 0) + let E := (({lo,hi} : Finset ℝ) ∪ R.image (chartCrossingParameter a j c)).filter (fun r => r ∈ Icc lo hi) + have hxin : x ∈ Ioo lo hi := (barrierLinePoint_interior_iff hc x).mp hx.1 + have hgap : lo ≤ hi := hxin.1.le.trans hxin.2.le + have hlo : lo ∈ E := by simp [E,hgap] + have hhi : hi ∈ E := by simp [E,hgap] + have hxE : x ∉ E := by + intro he + have hh := (Finset.mem_filter.mp he).1 + rcases Finset.mem_union.mp hh with hh | hh + · simp only [Finset.mem_insert,Finset.mem_singleton] at hh + rcases hh with hh | hh + · exact (ne_of_gt hxin.1) hh + · exact (ne_of_lt hxin.2) hh + · obtain ⟨l,hl,he⟩ := Finset.mem_image.mp hh + obtain ⟨hlT,hlne⟩ := Finset.mem_filter.mp hl + exact (openSquareChart_signs hx hlT).1 (he ▸ chartCrossingParameter_spec a j c l hlne) + obtain ⟨L,U,hLU,hxLU⟩ := exists_consecutiveSubdivision E hlo hhi ⟨hxin.1.le,hxin.2⟩ + have hxL : L < x := lt_of_le_of_ne hxLU.1 (fun h => hxE (h ▸ hLU.1)) + have hxU : x < U := lt_of_le_of_ne hxLU.2 (fun h => hxE (h.symm ▸ hLU.2.1)) + have hL := (Finset.mem_filter.mp hLU.1).2 + have hU := (Finset.mem_filter.mp hLU.2.1).2 + have hn (l : PlaneCut) (hl : l ∈ T) (r : ℝ) (hr : r ∈ Ioo L U) : + cutForm a l.1 (barrierLinePoint a j c r) ≠ ordinary l.2 := by + intro he + by_cases hzero : cutForm a l.1 (barrierTangent a j)=0 + · have hh := barrier_cut_difference a j l.1 c r x + rw [hzero,mul_zero,add_zero,he] at hh + exact (openSquareChart_signs hx hl).1 hh + · have hre : r ∈ E := by + apply Finset.mem_filter.mpr + refine ⟨Finset.mem_union_right _ (Finset.mem_image.mpr ⟨l,Finset.mem_filter.mpr ⟨hl,hzero⟩,?_⟩), + ⟨hL.1.trans hr.1.le,hr.2.le.trans hU.2⟩⟩ + exact (chartCrossingParameter_unique a j c l hzero he).symm + exact not_le_of_gt hr.2 (hLU.2.2.2 r hre hr.1) + refine ⟨L,U,⟨hxL,hxU⟩,hL,hU,?_,?_⟩ + · intro r hr + refine ⟨(barrierLinePoint_interior_iff hc r).mpr ⟨hL.1.trans_lt hr.1,hr.2.trans_le hU.2⟩,?_⟩ + intro l + have hs := continuous_nonzero_sign isPreconnected_Ioo + (((cutForm_continuous a l.val.1).comp (barrierLinePoint_continuous a j c)).sub continuous_const).continuousOn + (fun t ht => sub_ne_zero.mpr (hn l.val l.property t ht)) hr ⟨hxL,hxU⟩ + have hsg : (cutForm a l.val.1 (barrierLinePoint a j c r) < ordinary l.val.2 ↔ + cutForm a l.val.1 (barrierLinePoint a j c x) < ordinary l.val.2) := by simpa only [Pi.sub_apply,Function.comp_apply,sub_lt_zero] using hs + have hh := hx.2 l + by_cases hl : squareSign l.val p=true + · simpa [hl] using hsg.mpr (by simpa [hl] using hh) + · have hnot : ¬cutForm a l.val.1 (barrierLinePoint a j c r) < ordinary l.val.2 := + fun h => not_lt_of_gt (by simpa [hl] using hh) (hsg.mp h) + simpa [hl] using lt_of_le_of_ne (le_of_not_gt hnot) (hn l.val l.property r hr).symm + · intro r hr + have hre : r ∈ E := by + simp only [Finset.mem_insert,Finset.mem_singleton] at hr + rcases hr with rfl|rfl + · exact hLU.1 + · exact hLU.2.1 + rcases Finset.mem_union.mp (Finset.mem_filter.mp hre).1 with he | he + · simp only [Finset.mem_insert,Finset.mem_singleton] at he + exact he.elim Or.inl (fun h => Or.inr (Or.inl h)) + · obtain ⟨l,hl,rfl⟩ := Finset.mem_image.mp he + obtain ⟨hlT,hlne⟩ := Finset.mem_filter.mp hl + refine Or.inr (Or.inr ⟨l,hlT,?_,chartCrossingParameter_spec a j c l hlne⟩) + intro he + exact hlne (he ▸ barrierTangent_cut a j) + +end ChartLineIntervals + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/OperationalControl.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/OperationalControl.lean new file mode 100644 index 0000000000000000000000000000000000000000..bb50388141ff4cca636721adf419d53fcc236f0a --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/OperationalControl.lean @@ -0,0 +1,51 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.NestedCutCalculus +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.FreshEvenBank + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section OperationalControl + +variable {α H : Type*} [Fintype α] [DecidableEq α] [Group H] + +theorem fresh_bank_conditional_control (L : Finset α → Subgroup H) + (c : alternatingGroup α →* H) + (hc : ∀ σ I, ∀ x ∈ L I, c σ*x*(c σ)⁻¹ ∈ L (I.map σ.val.toEmbedding)) + (hd : ∀ I J, Disjoint I J → ∀ x ∈ L I, ∀ y ∈ L J, Commute x y) + (s : Fin 5 ↪ α) (J : Finset α) (u x : H) (hu : u ∈ L J) + (hx : x ∈ L (Finset.univ.map s)) + (hreserve : (J ∪ Finset.univ.map s).card + 5 ≤ Fintype.card α) + (hv : ∀ (σ : alternatingGroup α), σ.val.support.card ≤ 10 → + ∃ v : H, Commute u v ∧ v*x*v⁻¹ = c σ*x*(c σ)⁻¹) : Commute u x := by + obtain ⟨t,ht⟩ := fresh_five_bank (J ∪ Finset.univ.map s) hreserve + have hst : Disjoint (Finset.univ.map s) (Finset.univ.map t) := + (ht.mono_right Finset.subset_union_right).symm + obtain ⟨σ,hσ,hsupp⟩ := even_move_disjoint_banks s t hst + have hcard : σ.val.support.card ≤ 10 := by + apply (Finset.card_le_card hsupp).trans + rw [Finset.card_union_of_disjoint hst,Finset.card_map,Finset.card_map] + simp + obtain ⟨v,huv,hv⟩ := hv σ hcard + apply commute_of_conditional_move u v x huv + rw [hv] + have hem : (Finset.univ.map s).map σ.val.toEmbedding = Finset.univ.map t := by + rw [Finset.map_map] + congr 1 + exact Function.Embedding.ext hσ + have hm := hc σ (Finset.univ.map s) x hx + rw [hem] at hm + exact hd J (Finset.univ.map t) (ht.mono_right Finset.subset_union_left).symm u hu _ hm + +end OperationalControl + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/OrderedSubdivision.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/OrderedSubdivision.lean new file mode 100644 index 0000000000000000000000000000000000000000..6007d19f0d9878a5af515861bf12a3bfd9244650 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/OrderedSubdivision.lean @@ -0,0 +1,85 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Amenability.BarrierAlgorithm + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section OrderedSubdivision +open Classical Set + +theorem exists_consecutiveSubdivision (E : Finset ℝ) {L U x : ℝ} + (hL : L∈E) (hU : U∈E) (hx : x∈Ico L U) : + ∃s t,ConsecutiveSubdivision E s t ∧ x∈Icc s t := by + let E₀ := E.filter (fun s => s≤x) + have h₀ : E₀.Nonempty := ⟨L,Finset.mem_filter.mpr ⟨hL,hx.1⟩⟩ + let s := E₀.max' h₀ + have hs₀ : s∈E₀ := Finset.max'_mem E₀ h₀ + have hs := Finset.mem_filter.mp hs₀ + let E₁ := E.filter (fun t => s by rw [hzp,hs]; rfl) id) + have hactivation : barrierActivation ha i j c (b j) s=true := by + rw [barrierActivation_at_site ha i j c (b j) s z hzt hzp,hzb] + refine ⟨⟨j,⟨c,hc⟩⟩,(s,t),?_,x,hx,hpx⟩ + apply Finset.mem_filter.mpr + exact ⟨Finset.mem_product.mpr ⟨hst.1,hst.2.1⟩,hst,hactivation⟩ + +theorem barrierActiveIntervals_empty {a m : ℕ} (ha : 0 e x) (translation_reduce a u) + +theorem cut_im_eq_of_fract_eq (x : ℝ) (u v : CutRing) + (he : Int.fract (x+ordinary u)=Int.fract (x+ordinary v)) : u.im=v.im := by + obtain ⟨n,hn⟩ := Int.fract_eq_fract.mp he + have huv : u-v=(n : CutRing) := by + apply ordinary_injective + simp only [map_sub,map_intCast] + linarith + have him : u.im-v.im=0 := by simpa using congrArg (fun z : CutRing => z.im) huv + omega + +theorem orbitRepresentative_eq_of_translate_eq {a : ℕ} {u v : CutRing × CutRing} + (x : GenericSquare a) (he : translate a u x=translate a v x) : + orbitRepresentative u=orbitRepresentative v := by + have hx := congrArg (fun p : GenericSquare a => p.val.1) he + have hy := congrArg (fun p : GenericSquare a => p.val.2) he + have hu := cut_im_eq_of_fract_eq x.val.1 u.1 v.1 hx + have hv := cut_im_eq_of_fract_eq x.val.2 u.2 v.2 hy + simp only [orbitRepresentative,hu,hv] + +theorem SlotMap_orbitRepresentative {a m : ℕ} (V : polygonAlgebra a) + (i : Fin 5 → Fin m) (u : Fin 5 → CutRing × CutRing) : + SlotMap a m V (fun j => (i j,u j))= + SlotMap a m V (fun j => (i j,orbitRepresentative (u j))) := by + funext p + exact congrArg (fun z => (i p.1,z)) (translate_orbitRepresentative a (u p.1) p.2.val) + +noncomputable def OffsetFrame.reduce {a m : ℕ} {r : CutRing} {hm : 2 ≤ m} + {I : Finset (Fin (m+1))} {u : Fin (m+1) → CutRing × CutRing} + (F : OffsetFrame a r m hm I u) : + OffsetFrame a r m hm I (fun t => orbitRepresentative (u t)) where + k := F.k + d := fun t => orbitRepresentative (F.d t) + projection := F.projection.trans (trackTranslation_reduce _) + prescribed := fun t ht => congrArg orbitRepresentative (F.prescribed t ht) + +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + (hlarge : 15 < m+1) (h : B.AllPrimitiveLaws) (hr : 0 orbitRepresentative (u j)) where + alphabet := ρ.alphabet + card_le := ρ.card_le + source_mem := ρ.source_mem + target := ρ.target + target_mem := ρ.target_mem + offsets := fun t => orbitRepresentative (ρ.offsets t) + offsets_spec := fun j => congrArg orbitRepresentative (ρ.offsets_spec j) + frame := ρ.frame.reduce + word := ρ.word + aligned := ρ.aligned + supported := ρ.supported + transport := by + intro j x + rw [← translate_orbitRepresentative a (u j)] + exact ρ.transport j x + +theorem reduce_star {V : polygonAlgebra a} {i : Fin 5 → Fin (m+1)} + {u : Fin 5 → CutRing × CutRing} (ρ : B.SlotRouting hlarge h hr V i u) : + ρ.reduce.star=ρ.star := rfl + +theorem star_empty {i : Fin 5 → Fin (m+1)} {u : Fin 5 → CutRing × CutRing} + (ρ : B.SlotRouting hlarge h hr ⊥ i u) : ρ.star=1 := by + ext s : 1 + change ρ.word⁻¹*B.frameStar hlarge h hr (orderedTrackAlphabet ρ.target) ρ.offsets ρ.frame ⊥ + (universalMap (orderedTrackHom ρ.target) s)*(ρ.word⁻¹)⁻¹=1 + rw [B.frameStar_empty hlarge h hr] + simp + +end SlotRouting + +variable (R : alternatingGroup (Fin (m+1)) → + Multiplicative (FreeAbelianGroup (Fin m × Fin 2)) →* + Multiplicative (FreeAbelianGroup (Fin m × Fin 2))) + (hR : ∀ s k, B.c s * B.t k * (B.c s)⁻¹ = B.t (R s k)) + (hwide : 100 ≤ m+1) + +include R hR + +theorem slotStar_reduce (V : polygonAlgebra a) (i : Fin 5 → Fin (m+1)) + (u : Fin 5 → CutRing × CutRing) + (hinj : Function.Injective (SlotMap a (m+1) V (fun j => (i j,u j)))) : + B.slotStar hlarge h hr hwide V i u hinj= + B.slotStar hlarge h hr hwide V i (fun j => orbitRepresentative (u j)) + (by rw [← SlotMap_orbitRepresentative]; exact hinj) := by + let ρ := (B.slotRouting_nonempty hlarge h hr (by omega) V i u hinj).some + rw [B.slotStar_eq_routing hlarge h hr R hR hwide V i u hinj ρ, + B.slotStar_eq_routing hlarge h hr R hR hwide V i _ _ ρ.reduce,ρ.reduce_star] + +theorem slotStar_empty (i : Fin 5 → Fin (m+1)) (u : Fin 5 → CutRing × CutRing) + (hinj : Function.Injective (SlotMap a (m+1) (⊥ : polygonAlgebra a) (fun j => (i j,u j)))) : + B.slotStar hlarge h hr hwide ⊥ i u hinj=1 := by + let ρ := (B.slotRouting_nonempty hlarge h hr (by omega) ⊥ i u hinj).some + rw [B.slotStar_eq_routing hlarge h hr R hR hwide ⊥ i u hinj ρ,ρ.star_empty] + +theorem slotStar_parameterwise (V : polygonAlgebra a) + (i k : Fin 5 → Fin (m+1)) (u v : Fin 5 → CutRing × CutRing) + (hinj : Function.Injective (SlotMap a (m+1) V (fun j => (i j,u j)))) + (hkinj : Function.Injective (SlotMap a (m+1) V (fun j => (k j,v j)))) + (he : ∀ j, ∀ x : V.val, (i j,translate a (u j) x.val)=(k j,translate a (v j) x.val)) : + B.slotStar hlarge h hr hwide V i u hinj=B.slotStar hlarge h hr hwide V k v hkinj := by + by_cases hV : V.val.Nonempty + · obtain ⟨x,hx⟩ := hV + have hik : i=k := funext (fun j => congrArg Prod.fst (he j ⟨x,hx⟩)) + have huv : (fun j => orbitRepresentative (u j))=(fun j => orbitRepresentative (v j)) := by + funext j + exact orbitRepresentative_eq_of_translate_eq x (congrArg Prod.snd (he j ⟨x,hx⟩)) + rw [B.slotStar_reduce hlarge h hr R hR hwide V i u hinj, + B.slotStar_reduce hlarge h hr R hR hwide V k v hkinj] + congr 1 + · have hbot : V=⊥ := Subtype.ext (Set.not_nonempty_iff_eq_empty.mp hV) + subst V + rw [B.slotStar_empty hlarge h hr R hR hwide,B.slotStar_empty hlarge h hr R hR hwide] + +end InitialCoverSystem + +end SimpleAmenable + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/PlaneCornerCoordinates.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/PlaneCornerCoordinates.lean new file mode 100644 index 0000000000000000000000000000000000000000..13890968866d6079dbc1ec74e07cd6cc92eae5a7 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/PlaneCornerCoordinates.lean @@ -0,0 +1,150 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.ConcurrentAnchors +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.PlaneCornerKernel + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section PlaneCornerCoordinates +open Classical + +abbrev PlaneSectorIndex := Fin 4 → Bool +noncomputable def planeDirectionSign (a : ℕ) (v : ℝ × ℝ) : PlaneSectorIndex := + fun j => decide (cutForm a j v<0) + +noncomputable def planeDirectionRep (a : ℕ) (σ : PlaneSectorIndex) : ℝ × ℝ := + if h : ∃ v, TransverseDirection a v ∧ planeDirectionSign a v=σ then + Classical.choose h else (-1,1) + +theorem planeDirectionRep_transverse (a : ℕ) (σ : PlaneSectorIndex) : + TransverseDirection a (planeDirectionRep a σ) := by + unfold planeDirectionRep + split_ifs with h + · exact (Classical.choose_spec h).1 + · exact plane_antidiagonal_transverse a + +theorem planeDirectionRep_sign {a : ℕ} {v : ℝ × ℝ} (hv : TransverseDirection a v) : + planeDirectionSign a (planeDirectionRep a (planeDirectionSign a v))=planeDirectionSign a v := by + have he : ∃ w, TransverseDirection a w ∧ planeDirectionSign a w=planeDirectionSign a v := + ⟨v,hv,rfl⟩ + rw [planeDirectionRep,dite_eq_left he] + exact (Classical.choose_spec he).2 + +theorem transverse_neg_sign_congr {a : ℕ} {v w : ℝ × ℝ} + (hv : TransverseDirection a v) (hw : TransverseDirection a w) + (he : ∀ j, (cutForm a j v<0 ↔ cutForm a j w<0)) : + ∀ j, (cutForm a j (-v)<0 ↔ cutForm a j (-w)<0) := by + intro j + simp only [cutForm_neg,neg_lt_zero] + constructor <;> intro h + · by_contra! hh + have ht := (he j).mpr (lt_of_le_of_ne hh (hw j)) + linarith + · by_contra! hh + have ht := (he j).mp (lt_of_le_of_ne hh (hv j)) + linarith + +theorem planeCornerValue_congr_direction {a : ℕ} (f : PlaneStep a) (z : ℝ × ℝ) + {v w : ℝ × ℝ} (hv : TransverseDirection a v) (hw : TransverseDirection a w) + (he : ∀ j, (cutForm a j v<0 ↔ cutForm a j w<0)) : + planeCornerValue f z v=planeCornerValue f z w := by + unfold planeCornerValue planePairValue + rw [planeGerm_congr_direction f z hv hw he, + planeGerm_congr_direction f z hv.neg hw.neg (transverse_neg_sign_congr hv hw he)] + +theorem planeCornerValue_rep {a : ℕ} (f : PlaneStep a) (z : ℝ × ℝ) + {v : ℝ × ℝ} (hv : TransverseDirection a v) : + planeCornerValue f z (planeDirectionRep a (planeDirectionSign a v))=planeCornerValue f z v := by + apply planeCornerValue_congr_direction f z (planeDirectionRep_transverse _ _) hv + intro j + exact decide_eq_decide.mp (congrFun (planeDirectionRep_sign hv) j) + +theorem planeGerm_translate {a : ℕ} (f : PlaneStep a) (u : CutRing × CutRing) + (z v : ℝ × ℝ) : + planeGerm (PlaneStep.translate u f) z v= + planeGerm f (z-(ordinary u.1,ordinary u.2)) v := by + by_cases hv : TransverseDirection a v + · apply planeGerm_eq hv + obtain ⟨N,hN,hz,hf⟩ := planeGerm_spec f (z-(ordinary u.1,ordinary u.2)) v hv + refine ⟨(fun p => p-(ordinary u.1,ordinary u.2)) ⁻¹' N, + hN.preimage (continuous_id.sub continuous_const),hz,fun p hp hpv => ?_⟩ + have he : (GenericPlane.shift (-u) p).val=p.val-(ordinary u.1,ordinary u.2) := by + ext <;> simp [GenericPlane.shift,sub_eq_add_neg] + apply hf (GenericPlane.shift (-u) p) + · rw [he]; exact hp + · intro j + have hj := hpv j + rw [he,cutForm_sub,cutForm_sub] + split_ifs with ht + · rw [ite_eq_left ht] at hj; linarith + · rw [ite_eq_right ht] at hj; linarith + · simp [planeGerm,hv] + +theorem planeCornerValue_translate {a : ℕ} (f : PlaneStep a) (u : CutRing × CutRing) + (z v : ℝ × ℝ) : + planeCornerValue (PlaneStep.translate u f) z v= + planeCornerValue f (z-(ordinary u.1,ordinary u.2)) v := by + simp only [planeCornerValue,planePairValue,planeGerm_translate] + +abbrev PlaneCornerIndex (a : ℕ) := VertexType (commonVertexDenominator a) × PlaneSectorIndex + +noncomputable def planeVertexPosition (a : ℕ) (t : VertexType (commonVertexDenominator a)) + (u : Multiplicative (CutRing × CutRing)) : ℝ × ℝ := + vertexRepresentative (commonVertexDenominator a) t+(ordinary u.toAdd.1,ordinary u.toAdd.2) + +theorem planeVertexPosition_injective (a : ℕ) (t : VertexType (commonVertexDenominator a)) : + Function.Injective (planeVertexPosition a t) := by + intro u v h + have he := add_left_cancel h + have h₁ := ordinary_injective (congrArg Prod.fst he) + have h₂ := ordinary_injective (congrArg Prod.snd he) + exact congrArg Multiplicative.ofAdd (Prod.ext h₁ h₂) + +theorem planeCorner_coordinates_finite {a : ℕ} (ha : 0 planeCornerValue f (planeVertexPosition a t.1 u) + (planeDirectionRep a t.2))).Finite := by + obtain ⟨S,hS⟩ := PlaneStep.hasArrangement f + apply ((planeArrangementVertices a S).finite_toSet.preimage + (planeVertexPosition_injective a t.1).injOn).subset + intro u hu + exact planeCornerValue_mem_vertices ha f hS (planeDirectionRep_transverse a t.2) hu + +noncomputable def planeCornerCoordinates {a : ℕ} (ha : 0 planeCornerValue f (planeVertexPosition a t.1 u) (planeDirectionRep a t.2)) + (planeCorner_coordinates_finite ha f t)) + +@[simp] theorem planeCornerCoordinates_coeff {a : ℕ} (ha : 0 q.coeff (Multiplicative.ofAdd (x,y))) + (hc (t,planeDirectionSign a v)) + change planeCornerValue f (planeVertexPosition a t (Multiplicative.ofAdd (x,y))) + (planeDirectionRep a (planeDirectionSign a v))=0 at he + rw [planeCornerValue_rep f _ hv] at he + exact hn (hz ▸ he) + +end PlaneCornerCoordinates + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/PlaneCornerInjectivity.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/PlaneCornerInjectivity.lean new file mode 100644 index 0000000000000000000000000000000000000000..eb2358063645a7696531fc3e3405640d5c75f291 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/PlaneCornerInjectivity.lean @@ -0,0 +1,196 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.PlaneStepFunctions + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section PlaneCornerInjectivity +open Classical + +@[simp] theorem cutForm_zero (a : ℕ) (j : Fin 4) : cutForm a j (0,0)=0 := by + fin_cases j <;> simp [cutForm] + +@[simp] theorem cutForm_neg (a : ℕ) (j : Fin 4) (v : ℝ × ℝ) : + cutForm a j (-v) = -cutForm a j v := by + fin_cases j <;> simp [cutForm] <;> ring + +theorem TransverseDirection.neg {a : ℕ} {v : ℝ × ℝ} (hv : TransverseDirection a v) : + TransverseDirection a (-v) := by + intro j + simpa only [cutForm_neg,neg_ne_zero] using hv j + +theorem genericPlane_transverse {a : ℕ} (p : GenericPlane a) : + TransverseDirection a p.val := by + intro j hj + exact p.property j 0 (by simpa using hj) + +theorem planeGerm_evaluate_incident {a : ℕ} (f : PlaneStep a) {S : Finset PlaneCut} + (hS : ∀ p q, (∀ l∈S, planeSign l p=planeSign l q) → f.val p=f.val q) + {z v : ℝ × ℝ} (hv : TransverseDirection a v) {p : GenericPlane a} + (hp : p.val∈arrangementNeighborhood a S z) + (hpv : ∀ l∈S, cutForm a l.1 z=ordinary l.2 → + (cutForm a l.1 p.val ?_⟩ + have hh := Set.mem_iInter₂.mp hv l hl + rw [ite_eq_left he] at hh + by_cases ht : cutForm a l.1 p.val ?_⟩ + obtain ⟨v,hv,hpv⟩ := exists_incident_direction S z p + exact (planeGerm_evaluate_incident f hS hv hp hpv).trans (h v hv) + +noncomputable def planeHeight (p : ℝ × ℝ) : ℝ := p.1+p.2 + +theorem planeHeight_continuous : Continuous planeHeight := continuous_fst.add continuous_snd + +theorem planeSector_generic_descending {a : ℕ} {z v : ℝ × ℝ} + (hv : TransverseDirection a v) (hdesc : planeHeight v<0) + {N : Set (ℝ × ℝ)} (hN : IsOpen N) (hz : z∈N) : + ∃ p : GenericPlane a, p.val∈N ∧ p.val∈planeSector a z v ∧ + planeHeight p.val z+t • v + have hray : Continuous ray := continuous_const.add (continuous_id.smul continuous_const) + have he : ray ⁻¹' N∈nhds (0:ℝ) := by + apply hray.continuousAt.preimage_mem_nhds + simpa [ray] using hN.mem_nhds hz + obtain ⟨ε,hε,hεN⟩ := Metric.mem_nhds_iff.mp he + let t := ε/2 + have ht : 0 simp [cutForm] <;> linarith + +theorem transverse_negative_perturbation {a : ℕ} {v : ℝ × ℝ} + (hv : TransverseDirection a v) (hh : planeHeight v≤0) : + ∃ w : ℝ × ℝ, TransverseDirection a w ∧ planeHeight w<0 ∧ + ∀ j, (cutForm a j v<0 ↔ cutForm a j w<0) := by + let U := planeSector a (0,0) v + have hvU : v∈U := by + intro j + simp only [cutForm_zero] + split_ifs with hj + · exact hj + · exact lt_of_le_of_ne (le_of_not_gt hj) (hv j).symm + let ray : ℝ → ℝ × ℝ := fun t => v-t • (1,1) + have hray : Continuous ray := continuous_const.sub (continuous_id.smul continuous_const) + have he : ray ⁻¹' U∈nhds (0:ℝ) := by + apply hray.continuousAt.preimage_mem_nhds + have hz : ray 0=v := by ext <;> simp [ray] + rw [hz] + exact (planeSector_open a (0,0) v).mem_nhds hvU + obtain ⟨ε,hε,hεU⟩ := Metric.mem_nhds_iff.mp he + let t := ε/2 + have ht : 0 (hs j).2,?_,fun j => (hs j).1⟩ + change (v.1-t*1)+(v.2-t*1)<0 + change v.1+v.2≤0 at hh + linarith + +end PlaneCornerInjectivity + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/PlaneCornerKernel.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/PlaneCornerKernel.lean new file mode 100644 index 0000000000000000000000000000000000000000..355166712a2ace2dc9919f8657e80b0a8b6b5b89 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/PlaneCornerKernel.lean @@ -0,0 +1,265 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Arithmetic.ConcurrentDenominators +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.PlaneCornerInjectivity + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section PlaneCornerKernel +open Classical + +noncomputable def planePairValue {a : ℕ} (f : PlaneStep a) (z v : ℝ × ℝ) : ℤ := + planeGerm f z v+planeGerm f z (-v) + +noncomputable def planeCornerValue {a : ℕ} (f : PlaneStep a) (z v : ℝ × ℝ) : ℤ := + planePairValue f z v-planePairValue f z (-1,1) + +@[simp] theorem planeCornerValue_zero {a : ℕ} (z v : ℝ × ℝ) : + planeCornerValue (0 : PlaneStep a) z v=0 := by simp [planeCornerValue,planePairValue] + +@[simp] theorem planeCornerValue_add {a : ℕ} (f g : PlaneStep a) (z v : ℝ × ℝ) : + planeCornerValue (f+g) z v=planeCornerValue f z v+planeCornerValue g z v := by + simp only [planeCornerValue,planePairValue,planeGerm_add]; ring + +@[simp] theorem planeCornerValue_smul {a : ℕ} (c : ℤ) (f : PlaneStep a) (z v : ℝ × ℝ) : + planeCornerValue (c • f) z v=c • planeCornerValue f z v := by + simp only [planeCornerValue,planePairValue,planeGerm_smul,smul_add,smul_sub] + +def planeSupportClosure {a : ℕ} (f : PlaneStep a) : Set (ℝ × ℝ) := + closure {z | ∃ p : GenericPlane a, p.val=z ∧ f.val p≠0} + +theorem planeSupportClosure_compact {a : ℕ} (f : PlaneStep a) : + IsCompact (planeSupportClosure f) := by + obtain ⟨R,hR⟩ := PlaneStep.compactSupport f + have hcompact : IsCompact (Set.Icc (-R) R ×ˢ Set.Icc (-R) R) := + isCompact_Icc.prod isCompact_Icc + apply hcompact.of_isClosed_subset isClosed_closure + apply closure_minimal _ (isClosed_Icc.prod isClosed_Icc) + rintro _ ⟨p,rfl,hp⟩ + have h : |p.val.1|≤R ∧ |p.val.2|≤R := by + constructor + · by_contra! hh + exact hp (hR p (Or.inl hh)) + · by_contra! hh + exact hp (hR p (Or.inr hh)) + exact ⟨abs_le.mp h.1,abs_le.mp h.2⟩ + +theorem planeSupportClosure_nonempty {a : ℕ} {f : PlaneStep a} (hf : f≠0) : + (planeSupportClosure f).Nonempty := by + have hh : ∃ p : GenericPlane a, f.val p≠0 := by + by_contra! h + apply hf + apply Subtype.ext + funext p + exact h p + obtain ⟨p,hp⟩ := hh + exact ⟨p.val,subset_closure ⟨p,rfl,hp⟩⟩ + +theorem planeGerm_zero_at_minimum {a : ℕ} (f : PlaneStep a) {z v : ℝ × ℝ} + (hmin : ∀ p : GenericPlane a, f.val p≠0 → planeHeight z≤planeHeight p.val) + (hv : TransverseDirection a v) (hdesc : planeHeight v<0) : + planeGerm f z v=0 := by + obtain ⟨N,hN,hz,hf⟩ := planeGerm_spec f z v hv + obtain ⟨p,hp,hpv,hdown⟩ := planeSector_generic_descending hv hdesc hN hz + by_contra hh + have hp' : f.val p≠0 := by rwa [hf p hp hpv] + exact (not_lt_of_ge (hmin p hp')) hdown + +theorem planeGerm_zero_at_minimum_le {a : ℕ} (f : PlaneStep a) {z v : ℝ × ℝ} + (hmin : ∀ p : GenericPlane a, f.val p≠0 → planeHeight z≤planeHeight p.val) + (hv : TransverseDirection a v) (hdesc : planeHeight v≤0) : + planeGerm f z v=0 := by + obtain ⟨w,hw,hdown,hvw⟩ := transverse_negative_perturbation hv hdesc + exact (planeGerm_congr_direction f z hv hw hvw).trans + (planeGerm_zero_at_minimum f hmin hw hdown) + +theorem planeCornerValue_injective_zero {a : ℕ} (f : PlaneStep a) + (hc : ∀ z v, TransverseDirection a v → planeCornerValue f z v=0) : f=0 := by + by_contra hf + obtain ⟨z,hz,hmin⟩ := (planeSupportClosure_compact f).exists_isMinOn + (planeSupportClosure_nonempty hf) planeHeight_continuous.continuousOn + have hminimum : ∀ p : GenericPlane a, f.val p≠0 → planeHeight z≤planeHeight p.val := by + intro p hp + exact hmin (subset_closure ⟨p,rfl,hp⟩) + have hbase : planePairValue f z (-1,1)=0 := by + unfold planePairValue + rw [planeGerm_zero_at_minimum_le f hminimum (plane_antidiagonal_transverse a) + (by norm_num [planeHeight])] + rw [planeGerm_zero_at_minimum_le f hminimum (plane_antidiagonal_transverse a).neg + (by norm_num [planeHeight])] + simp + have hzero : ∀ v, TransverseDirection a v → planeGerm f z v=0 := by + intro v hv + have he := hc z v hv + unfold planeCornerValue at he + rw [hbase,sub_zero] at he + change planeGerm f z v+planeGerm f z (-v)=0 at he + by_cases hh : planeHeight v≤0 + · exact planeGerm_zero_at_minimum_le f hminimum hv hh + · have hn : planeHeight (-v)≤0 := by + change -v.1+-v.2≤0 + change ¬v.1+v.2≤0 at hh + linarith + rw [planeGerm_zero_at_minimum_le f hminimum hv.neg hn,add_zero] at he + exact he + obtain ⟨N,hN,hzN,hfN⟩ := planeGerm_zero_neighborhood f z hzero + obtain ⟨_,hpN,p,rfl,hp⟩ := mem_closure_iff.mp hz N hN hzN + exact hp (hfN p hpN) + +end PlaneCornerKernel + +section PlaneCornerSupport +open Classical + +theorem planeGerm_congr_incident {a : ℕ} (f : PlaneStep a) {S : Finset PlaneCut} + (hS : ∀ p q, (∀ l∈S, planeSign l p=planeSign l q) → f.val p=f.val q) + (z : ℝ × ℝ) {v w : ℝ × ℝ} (hv : TransverseDirection a v) + (hw : TransverseDirection a w) + (he : ∀ l∈S, cutForm a l.1 z=ordinary l.2 → + (cutForm a l.1 v<0 ↔ cutForm a l.1 w<0)) : + planeGerm f z v=planeGerm f z w := by + obtain ⟨p,hp,hpv⟩ := planeSector_generic hv (arrangementNeighborhood_open a S z) + (self_mem_arrangementNeighborhood a S z) + obtain ⟨q,hq,hqv⟩ := planeSector_generic hw (arrangementNeighborhood_open a S z) + (self_mem_arrangementNeighborhood a S z) + rw [← planeGerm_evaluate f hS hv hp hpv,← planeGerm_evaluate f hS hw hq hqv] + apply hS + intro l hl + rw [planeSign_neighborhood hp hpv hl,planeSign_neighborhood hq hqv hl] + apply decide_eq_decide.mpr + split_ifs with hh + · exact he l hl hh + · rfl + +theorem planeCornerValue_zero_of_one_direction {a : ℕ} (f : PlaneStep a) + {S : Finset PlaneCut} + (hS : ∀ p q, (∀ l∈S, planeSign l p=planeSign l q) → f.val p=f.val q) + (z : ℝ × ℝ) (j : Fin 4) + (hj : ∀ l∈S, cutForm a l.1 z=ordinary l.2 → l.1=j) + {v : ℝ × ℝ} (hv : TransverseDirection a v) : planeCornerValue f z v=0 := by + let w : ℝ × ℝ := (-1,1) + have hw : TransverseDirection a w := plane_antidiagonal_transverse a + have hcompare : ∀ {x y : ℝ × ℝ}, TransverseDirection a x → TransverseDirection a y → + (cutForm a j x<0 ↔ cutForm a j y<0) → planeGerm f z x=planeGerm f z y := by + intro x y hx hy he + apply planeGerm_congr_incident f hS z hx hy + intro l hl hz + simpa only [hj l hl hz] using he + by_cases he : (cutForm a j v<0 ↔ cutForm a j w<0) + · have he' : (cutForm a j (-v)<0 ↔ cutForm a j (-w)<0) := by + simp only [cutForm_neg,neg_lt_zero] + constructor + · intro h + by_contra! hh + have hw' := hw j + have hh' : cutForm a j w<0 := lt_of_le_of_ne hh hw' + have := he.mpr hh'; linarith + · intro h + by_contra! hh + have hv' := hv j + have hh' : cutForm a j v<0 := lt_of_le_of_ne hh hv' + have := he.mp hh'; linarith + have h₁ := hcompare hv hw he + have h₂ := hcompare hv.neg hw.neg he' + unfold planeCornerValue planePairValue + change planeGerm f z v+planeGerm f z (-v)-(planeGerm f z w+planeGerm f z (-w))=0 + rw [h₁,h₂,sub_self] + · have he₁ : (cutForm a j v<0 ↔ cutForm a j (-w)<0) := by + rw [cutForm_neg,neg_lt_zero] + have hv' := hv j + have hw' := hw j + constructor <;> intro hh + · by_contra! ht + have hwlt : cutForm a j w<0 := lt_of_le_of_ne ht hw' + exact he (iff_of_true hh hwlt) + · by_contra! ht + have hvlt : 0 intro hh + · by_contra! ht + have hwlt : 0 + lineDet_ne_zero ha i j hij (ordinary_injective (by simpa using hh)) + rw [cutForm_normal,cutForm_normal] at hi hj + have h₁ : ordinary (lineDet a i j)*(p.1-q.1)=0 := by + simp only [lineDet,map_sub,map_mul] + linear_combination ordinary (lineNormal a j).2*hi-ordinary (lineNormal a i).2*hj + have h₂ : ordinary (lineDet a i j)*(p.2-q.2)=0 := by + simp only [lineDet,map_sub,map_mul] + linear_combination ordinary (lineNormal a i).1*hj-ordinary (lineNormal a j).1*hi + exact Prod.ext (sub_eq_zero.mp ((mul_eq_zero.mp h₁).resolve_left hd)) + (sub_eq_zero.mp ((mul_eq_zero.mp h₂).resolve_left hd)) + +noncomputable def planeLineIntersection (a : ℕ) (l k : PlaneCut) : ℝ × ℝ := + if h : ∃ z, cutForm a l.1 z=ordinary l.2 ∧ cutForm a k.1 z=ordinary k.2 then + Classical.choose h else 0 + +theorem planeLineIntersection_eq {a : ℕ} (ha : 0 planeLineIntersection a lk.1 lk.2) + +theorem planeCornerValue_exists_incident {a : ℕ} (f : PlaneStep a) {S : Finset PlaneCut} + (hS : ∀ p q, (∀ l∈S, planeSign l p=planeSign l q) → f.val p=f.val q) + {z v : ℝ × ℝ} (hv : TransverseDirection a v) (hc : planeCornerValue f z v≠0) : + ∃ l∈S, ∃ k∈S, l.1≠k.1 ∧ cutForm a l.1 z=ordinary l.2 ∧ + cutForm a k.1 z=ordinary k.2 := by + by_contra! h + by_cases hinc : ∃ l∈S, cutForm a l.1 z=ordinary l.2 + · obtain ⟨l,hl,hzl⟩ := hinc + apply hc + apply planeCornerValue_zero_of_one_direction f hS z l.1 _ hv + intro k hk hzk + by_contra hdir + exact (h k hk l hl hdir hzk) hzl + · apply hc + apply planeCornerValue_zero_of_one_direction f hS z 0 _ hv + intro l hl hzl + exact (hinc ⟨l,hl,hzl⟩).elim + +theorem planeCornerValue_mem_vertices {a : ℕ} (ha : 0 slice n f) := by + obtain ⟨R,hR⟩ := PlaneStep.compactSupport f + let N : ℤ := ⌈R+1⌉ + refine (Set.finite_Icc (-N,-N) (N,N)).subset ?_ + intro n hn + have hp : ∃ p : GenericSquare a, (slice n f).val p ≠ 0 := by + by_contra! h + apply hn + apply Subtype.ext + exact funext h + obtain ⟨p,hp⟩ := hp + rw [slice_apply] at hp + have hb : |p.val.1+(n.1:ℝ)| ≤ R ∧ |p.val.2+(n.2:ℝ)| ≤ R := by + by_contra! h + apply hp + apply hR + have hh : R < |p.val.1+(n.1:ℝ)| ∨ R < |p.val.2+(n.2:ℝ)| := by + by_cases hx : |p.val.1+(n.1:ℝ)| ≤ R + · exact Or.inr (h hx) + · exact Or.inl (lt_of_not_ge hx) + simpa only [GenericPlane.shift,intPair,Prod.fst_add,Prod.snd_add,map_intCast] using hh + have hx : |(n.1:ℝ)| ≤ R+1 := by + have ht := abs_add_le (p.val.1+(n.1:ℝ)) (-p.val.1) + have he : p.val.1+(n.1:ℝ)+ -p.val.1=(n.1:ℝ) := by ring + rw [he,abs_neg,abs_of_nonneg p.property.1.1] at ht + linarith [p.property.1.2] + have hy : |(n.2:ℝ)| ≤ R+1 := by + have ht := abs_add_le (p.val.2+(n.2:ℝ)) (-p.val.2) + have he : p.val.2+(n.2:ℝ)+ -p.val.2=(n.2:ℝ) := by ring + rw [he,abs_neg,abs_of_nonneg p.property.2.1.1] at ht + linarith [p.property.2.1.2] + have hx' : -N ≤ n.1 ∧ n.1 ≤ N := by + exact_mod_cast abs_le.mp (hx.trans (Int.le_ceil (R+1))) + have hy' : -N ≤ n.2 ∧ n.2 ≤ N := by + exact_mod_cast abs_le.mp (hy.trans (Int.le_ceil (R+1))) + exact ⟨⟨hx'.1,hy'.1⟩,⟨hx'.2,hy'.2⟩⟩ + +noncomputable def periodize : PlaneStep a →ₗ[ℤ] SquareStep a where + toFun f := ∑ᶠ n : ℤ×ℤ, slice n f + map_add' f g := by + simp only [map_add] + exact finsum_add_distrib (slice_finite f) (slice_finite g) + map_smul' c f := by + simp only [map_smul] + exact (map_finsum (DistribSMul.toAddMonoidHom (SquareStep a) c) (slice_finite f)).symm + +noncomputable def eval (p : GenericSquare a) : SquareStep a →ₗ[ℤ] ℤ := + (LinearMap.proj p).comp (squareStepSubmodule a).subtype + +theorem periodize_apply (f : PlaneStep a) (p : GenericSquare a) : + (periodize f).val p = ∑ᶠ n : ℤ×ℤ, (slice n f).val p := + map_finsum (eval p) (slice_finite f) + +theorem slice_extend (f : SquareStep a) (n : ℤ×ℤ) (hn : n≠0) : + slice n (extend f)=0 := by + apply Subtype.ext + funext p + rw [slice_apply,extend_apply] + apply dite_eq_right + intro h + have h' : (0 ≤ p.val.1+(n.1:ℝ) ∧ p.val.1+(n.1:ℝ)<1) ∧ + (0 ≤ p.val.2+(n.2:ℝ) ∧ p.val.2+(n.2:ℝ)<1) := by + simpa [InSquare,GenericPlane.shift,intPair] using h + have hx : (-1:ℤ) slice_extend f n hn),slice_zero,restrict_extend] + +theorem periodize_surjective : Function.Surjective (periodize (a := a)) := + fun f => ⟨extend f,periodize_extend f⟩ + +end SquareStep +end PlanePeriodization + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/PlaneStepFunctions.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/PlaneStepFunctions.lean new file mode 100644 index 0000000000000000000000000000000000000000..243dfb5b44244e8047fe77aba5d680855a683999 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/PlaneStepFunctions.lean @@ -0,0 +1,327 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.FiniteArrangementGerms + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section PlaneStepFunctions + +def GenericPlane (a : ℕ) := {p : ℝ × ℝ // AvoidsCuts a p} + +namespace GenericPlane +noncomputable def shift {a : ℕ} (u : CutRing × CutRing) (p : GenericPlane a) : + GenericPlane a := ⟨p.val+(ordinary u.1,ordinary u.2),avoidsCuts_translate p.property u⟩ +@[simp] theorem shift_zero {a : ℕ} (p : GenericPlane a) : shift 0 p=p := by + apply Subtype.ext + simp [shift] +@[simp] theorem shift_add {a : ℕ} (u v : CutRing × CutRing) (p : GenericPlane a) : + shift u (shift v p)=shift (u+v) p := by + apply Subtype.ext + simp only [shift,Prod.fst_add,Prod.snd_add,map_add] + ext <;> simp only [Prod.fst_add,Prod.snd_add] <;> ring +end GenericPlane + +abbrev PlaneCut := Fin 4 × CutRing + +noncomputable def planeSign {a : ℕ} (l : PlaneCut) (p : GenericPlane a) : Bool := + decide (cutForm a l.1 p.val < ordinary l.2) + +def HasPlaneArrangement {a : ℕ} (f : GenericPlane a → ℤ) : Prop := + ∃ S : Finset PlaneCut, ∀ p q, (∀ l∈S, planeSign l p=planeSign l q) → f p=f q + +def PlaneCompactSupport {a : ℕ} (f : GenericPlane a → ℤ) : Prop := + ∃ R : ℝ, ∀ p, R < |p.val.1| ∨ R < |p.val.2| → f p=0 + +noncomputable def planeStepSubmodule (a : ℕ) : Submodule ℤ (GenericPlane a → ℤ) where + carrier := {f | HasPlaneArrangement f ∧ PlaneCompactSupport f} + zero_mem' := by + refine ⟨⟨∅,fun _ _ _ => rfl⟩,⟨0,fun _ _ => rfl⟩⟩ + add_mem' := by + classical + rintro f g ⟨⟨S,hS⟩,⟨R,hR⟩⟩ ⟨⟨T,hT⟩,⟨Q,hQ⟩⟩ + constructor + · refine ⟨S∪T,fun p q hpq => ?_⟩ + exact congrArg₂ (·+·) (hS p q (fun l hl => hpq l (Finset.mem_union_left T hl))) + (hT p q (fun l hl => hpq l (Finset.mem_union_right S hl))) + · refine ⟨max R Q,fun p hp => ?_⟩ + have h₁ : R < |p.val.1| ∨ R < |p.val.2| := hp.imp + (lt_of_le_of_lt (le_max_left _ _)) (lt_of_le_of_lt (le_max_left _ _)) + have h₂ : Q < |p.val.1| ∨ Q < |p.val.2| := hp.imp + (lt_of_le_of_lt (le_max_right _ _)) (lt_of_le_of_lt (le_max_right _ _)) + change f p+g p=0 + rw [hR p h₁,hQ p h₂,add_zero] + smul_mem' := by + rintro c f ⟨⟨S,hS⟩,⟨R,hR⟩⟩ + refine ⟨⟨S,fun p q hpq => congrArg (c • ·) (hS p q hpq)⟩,⟨R,fun p hp => ?_⟩⟩ + change c • f p=0 + rw [hR p hp,smul_zero] + +noncomputable abbrev PlaneStep (a : ℕ) : Type := ↥(planeStepSubmodule a) + +namespace PlaneStep +variable {a : ℕ} + +theorem hasArrangement (f : PlaneStep a) : HasPlaneArrangement f.val := f.property.1 +theorem compactSupport (f : PlaneStep a) : PlaneCompactSupport f.val := f.property.2 + +@[simp] theorem translated_sign (l : PlaneCut) (u : CutRing × CutRing) + (p : GenericPlane a) : planeSign l (GenericPlane.shift (-u) p)= + planeSign (l.1,l.2+integralCutForm a l.1 u) p := by + unfold planeSign + apply decide_eq_decide.mpr + have he : integralCutForm a l.1 (-u) = -integralCutForm a l.1 u := by + rcases l with ⟨j,c⟩ + fin_cases j <;> simp [integralCutForm] <;> ring + simp only [GenericPlane.shift,cutForm_add,cutForm_ordinary,he,map_neg,map_add] + constructor <;> intro h <;> linarith + +theorem translated_arrangement (f : PlaneStep a) (u : CutRing × CutRing) : + HasPlaneArrangement (fun p => f.val (GenericPlane.shift (-u) p)) := by + classical + obtain ⟨S,hS⟩ := hasArrangement f + refine ⟨S.image (fun l => (l.1,l.2+integralCutForm a l.1 u)),fun p q hpq => ?_⟩ + apply hS + intro l hl + rw [translated_sign,translated_sign] + exact hpq _ (Finset.mem_image_of_mem _ hl) + +theorem translated_compact (f : PlaneStep a) (u : CutRing × CutRing) : + PlaneCompactSupport (fun p => f.val (GenericPlane.shift (-u) p)) := by + obtain ⟨R,hR⟩ := compactSupport f + refine ⟨R + |ordinary u.1|+|ordinary u.2|,fun p hp => ?_⟩ + apply hR + have h₁ : |p.val.1| ≤ |p.val.1-ordinary u.1|+|ordinary u.1| := by + simpa using abs_add_le (p.val.1-ordinary u.1) (ordinary u.1) + have h₂ : |p.val.2| ≤ |p.val.2-ordinary u.2|+|ordinary u.2| := by + simpa using abs_add_le (p.val.2-ordinary u.2) (ordinary u.2) + change R < |p.val.1+ordinary (-u).1| ∨ R < |p.val.2+ordinary (-u).2| + simp only [Prod.fst_neg,Prod.snd_neg,map_neg,← sub_eq_add_neg] + rcases hp with hp|hp + · left; linarith [abs_nonneg (ordinary u.2)] + · right; linarith [abs_nonneg (ordinary u.1)] + +noncomputable def translate (u : CutRing × CutRing) : PlaneStep a →ₗ[ℤ] PlaneStep a where + toFun f := ⟨fun p => f.val (GenericPlane.shift (-u) p), + translated_arrangement f u,translated_compact f u⟩ + map_add' _ _ := rfl + map_smul' _ _ := rfl + +@[simp] theorem translate_apply (u : CutRing × CutRing) (f : PlaneStep a) (p : GenericPlane a) : + (translate u f).val p=f.val (GenericPlane.shift (-u) p) := rfl + +noncomputable def representation (a : ℕ) : + Representation ℤ (Multiplicative (CutRing × CutRing)) (PlaneStep a) where + toFun u := translate u.toAdd + map_one' := by + ext f p + simp [translate] + map_mul' u v := by + ext f p + change f.val (GenericPlane.shift (-(u.toAdd+v.toAdd)) p)= + f.val (GenericPlane.shift (-v.toAdd) (GenericPlane.shift (-u.toAdd) p)) + rw [GenericPlane.shift_add] + abel_nf + +end PlaneStep + +abbrev PolygonGroupRing := MonoidAlgebra ℤ (Multiplicative (CutRing × CutRing)) + +noncomputable def PolygonCoefficientModule (a : ℕ) := (PlaneStep.representation a).asModule + +instance : AddGroup.FG CutRing := by + apply Module.Finite.iff_addGroup_fg.mp + infer_instance + +instance : IsNoetherianRing PolygonGroupRing := by + let : Algebra.FiniteType ℤ PolygonGroupRing := + MonoidAlgebra.finiteType_iff_group_fg.mpr inferInstance + exact Algebra.FiniteType.isNoetherianRing ℤ PolygonGroupRing + +end PlaneStepFunctions + +section PlaneArrangementGerms + +open Classical + +def TransverseDirection (a : ℕ) (v : ℝ × ℝ) : Prop := + ∀ j : Fin 4, cutForm a j v ≠ 0 + +noncomputable def planeSector (a : ℕ) (z v : ℝ × ℝ) : Set (ℝ × ℝ) := + {p | ∀ j : Fin 4, if cutForm a j v < 0 then cutForm a j p < cutForm a j z + else cutForm a j z < cutForm a j p} + +theorem planeSector_open (a : ℕ) (z v : ℝ × ℝ) : IsOpen (planeSector a z v) := by + have he : planeSector a z v = ⋂ j : Fin 4, + {p | if cutForm a j v < 0 then cutForm a j p < cutForm a j z + else cutForm a j z < cutForm a j p} := by ext; simp [planeSector] + rw [he] + apply isOpen_iInter_of_finite + intro j + split_ifs + · exact isOpen_lt (cutForm_continuous a j) continuous_const + · exact isOpen_lt continuous_const (cutForm_continuous a j) + +theorem planeSector_generic {a : ℕ} {z v : ℝ × ℝ} (hv : TransverseDirection a v) + {N : Set (ℝ × ℝ)} (hN : IsOpen N) (hz : z∈N) : + ∃ p : GenericPlane a, p.val∈N ∧ p.val∈planeSector a z v := by + let σ : Fin 4 → Bool := fun j => decide (cutForm a j v < 0) + have hactive (j : Fin 4) (_ : cutForm a j z=cutForm a j z) : + if σ j then cutForm a j (z+v) cutForm a j z) + z (z+v) σ hactive (fun _ hh => (hh rfl).elim) N hN hz + refine ⟨⟨p,hpg⟩,hp,?_⟩ + intro j + have hh := hσ j + simpa [σ] using hh + +noncomputable def arrangementNeighborhood (a : ℕ) (S : Finset PlaneCut) (z : ℝ × ℝ) : + Set (ℝ × ℝ) := ⋂ l∈S, if cutForm a l.1 z=ordinary l.2 then Set.univ + else if cutForm a l.1 z ?_⟩ + apply hS + intro l hl + rw [planeSign_neighborhood hq hqv hl,planeSign_neighborhood hp hpv hl] + +theorem IsPlaneGerm.unique {a : ℕ} {f : PlaneStep a} {z v : ℝ × ℝ} {m n : ℤ} + (hv : TransverseDirection a v) (hm : IsPlaneGerm f z v m) (hn : IsPlaneGerm f z v n) : + m=n := by + obtain ⟨N,hN,hz,hf⟩ := hm + obtain ⟨M,hM,hz',hg⟩ := hn + obtain ⟨p,hp,hpv⟩ := planeSector_generic hv (hN.inter hM) ⟨hz,hz'⟩ + exact (hf p hp.1 hpv).symm.trans (hg p hp.2 hpv) + +noncomputable def planeGerm {a : ℕ} (f : PlaneStep a) (z v : ℝ × ℝ) : ℤ := + if hv : TransverseDirection a v then Classical.choose (exists_planeGerm f z v hv) else 0 + +theorem planeGerm_spec {a : ℕ} (f : PlaneStep a) (z v : ℝ × ℝ) + (hv : TransverseDirection a v) : IsPlaneGerm f z v (planeGerm f z v) := by + rw [planeGerm,dite_eq_left hv] + exact Classical.choose_spec (exists_planeGerm f z v hv) + +theorem planeGerm_eq {a : ℕ} {f : PlaneStep a} {z v : ℝ × ℝ} {n : ℤ} + (hv : TransverseDirection a v) (hn : IsPlaneGerm f z v n) : planeGerm f z v=n := + (planeGerm_spec f z v hv).unique hv hn + +@[simp] theorem planeGerm_zero {a : ℕ} (z v : ℝ × ℝ) : + planeGerm (0 : PlaneStep a) z v=0 := by + by_cases hv : TransverseDirection a v + · exact planeGerm_eq hv ⟨Set.univ,isOpen_univ,Set.mem_univ z,fun _ _ _ => rfl⟩ + · simp [planeGerm,hv] + +@[simp] theorem planeGerm_add {a : ℕ} (f g : PlaneStep a) (z v : ℝ × ℝ) : + planeGerm (f+g) z v=planeGerm f z v+planeGerm g z v := by + by_cases hv : TransverseDirection a v + · obtain ⟨N,hN,hz,hf⟩ := planeGerm_spec f z v hv + obtain ⟨M,hM,hz',hg⟩ := planeGerm_spec g z v hv + apply planeGerm_eq hv + refine ⟨N∩M,hN.inter hM,⟨hz,hz'⟩,fun p hp hpv => ?_⟩ + exact congrArg₂ (·+·) (hf p hp.1 hpv) (hg p hp.2 hpv) + · simp [planeGerm,hv] + +@[simp] theorem planeGerm_smul {a : ℕ} (c : ℤ) (f : PlaneStep a) (z v : ℝ × ℝ) : + planeGerm (c • f) z v=c • planeGerm f z v := by + by_cases hv : TransverseDirection a v + · obtain ⟨N,hN,hz,hf⟩ := planeGerm_spec f z v hv + apply planeGerm_eq hv + exact ⟨N,hN,hz,fun p hp hpv => congrArg (c • ·) (hf p hp hpv)⟩ + · simp [planeGerm,hv] + +theorem planeGerm_evaluate {a : ℕ} (f : PlaneStep a) {S : Finset PlaneCut} + (hS : ∀ p q, (∀ l∈S, planeSign l p=planeSign l q) → f.val p=f.val q) + {z v : ℝ × ℝ} (hv : TransverseDirection a v) {p : GenericPlane a} + (hp : p.val∈arrangementNeighborhood a S z) (hpv : p.val∈planeSector a z v) : + f.val p=planeGerm f z v := by + obtain ⟨N,hN,hz,hf⟩ := planeGerm_spec f z v hv + obtain ⟨q,hq,hqv⟩ := planeSector_generic hv + ((arrangementNeighborhood_open a S z).inter hN) + ⟨self_mem_arrangementNeighborhood a S z,hz⟩ + have hpq : f.val p=f.val q := hS p q (fun l hl => + (planeSign_neighborhood hp hpv hl).trans (planeSign_neighborhood hq.1 hqv hl).symm) + exact hpq.trans (hf q hq.2 hqv) + +theorem planeGerm_congr_direction {a : ℕ} (f : PlaneStep a) (z : ℝ × ℝ) + {v w : ℝ × ℝ} (hv : TransverseDirection a v) (hw : TransverseDirection a w) + (hvw : ∀ j, (cutForm a j v<0 ↔ cutForm a j w<0)) : + planeGerm f z v=planeGerm f z w := by + apply planeGerm_eq hv + obtain ⟨N,hN,hz,hf⟩ := planeGerm_spec f z w hw + refine ⟨N,hN,hz,fun p hp hpv => hf p hp ?_⟩ + intro j + have hh := hpv j + simpa only [hvw j] using hh + +end PlaneArrangementGerms + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/PolygonAction.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/PolygonAction.lean new file mode 100644 index 0000000000000000000000000000000000000000..fec960b965a511a7765e061e57e17de026a4e987 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/PolygonAction.lean @@ -0,0 +1,222 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Arithmetic.PolygonArithmetic + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +section PolygonAction + +instance : Countable CutRing := Countable.of_equiv (ℤ × ℤ) (QuadraticAlgebra.equivProd 1 1).symm + +theorem fract_fract_add (x y : ℝ) : Int.fract (Int.fract x + y) = Int.fract (x + y) := by + change Int.fract (x - (⌊x⌋ : ℝ) + y) = _ + rw [sub_add_eq_add_sub, Int.fract_sub_intCast] + +noncomputable def translate (a : ℕ) (u : CutRing × CutRing) (p : GenericSquare a) : + GenericSquare a := by + let k : CutRing × CutRing := + ((⌊p.val.1 + ordinary u.1⌋ : ℤ), (⌊p.val.2 + ordinary u.2⌋ : ℤ)) + refine ⟨(Int.fract (p.val.1 + ordinary u.1), Int.fract (p.val.2 + ordinary u.2)), + ⟨Int.fract_nonneg _, Int.fract_lt_one _⟩, + ⟨Int.fract_nonneg _, Int.fract_lt_one _⟩, ?_⟩ + have h := avoidsCuts_translate p.property.2.2 (u - k) + convert h using 1 + simp only [k, Int.fract, Prod.fst_sub, Prod.snd_sub, map_sub, map_intCast] + apply Prod.ext <;> simp only [Prod.fst_add, Prod.snd_add] <;> ring + +@[simp] theorem translate_val (a : ℕ) (u : CutRing × CutRing) (p : GenericSquare a) : + (translate a u p).val = + (Int.fract (p.val.1 + ordinary u.1), Int.fract (p.val.2 + ordinary u.2)) := rfl + +@[simp] theorem translate_zero (a : ℕ) (p : GenericSquare a) : translate a 0 p = p := by + apply Subtype.ext + simp only [translate_val, Prod.fst_zero, Prod.snd_zero, map_zero, add_zero] + exact Prod.ext (Int.fract_eq_self.mpr p.property.1) (Int.fract_eq_self.mpr p.property.2.1) + +theorem translate_add (a : ℕ) (u v : CutRing × CutRing) (p : GenericSquare a) : + translate a (u + v) p = translate a u (translate a v p) := by + apply Subtype.ext + simp only [translate_val, Prod.fst_add, Prod.snd_add, map_add] + rw [fract_fract_add, fract_fract_add] + congr 1 <;> congr 1 <;> ring + +noncomputable def translation (a : ℕ) (u : CutRing × CutRing) : Equiv.Perm (GenericSquare a) where + toFun := translate a u + invFun := translate a (-u) + left_inv p := by rw [← translate_add, neg_add_cancel, translate_zero] + right_inv p := by rw [← translate_add, add_neg_cancel, translate_zero] + +@[simp] theorem translation_apply (a : ℕ) (u : CutRing × CutRing) (p : GenericSquare a) : + translation a u p = translate a u p := rfl + +@[simp] theorem translation_mul (a : ℕ) (u v : CutRing × CutRing) : + translation a (u + v) = translation a u * translation a v := by + ext p + exact translate_add a u v p + +theorem translation_period (a : ℕ) (u : CutRing × CutRing) (k : ℤ × ℤ) : + translation a (u + ((k.1 : CutRing), (k.2 : CutRing))) = translation a u := by + ext p + apply Subtype.ext + simp [translate_val] + +theorem translation_reduce (a : ℕ) (u : CutRing × CutRing) : + translation a u = translation a + ((u.1.im : CutRing) * cutTau, (u.2.im : CutRing) * cutTau) := by + have hu : u = ((u.1.im : CutRing) * cutTau, (u.2.im : CutRing) * cutTau) + + ((u.1.re : CutRing), (u.2.re : CutRing)) := by + apply Prod.ext <;> apply QuadraticAlgebra.ext <;> simp [cutTau] + calc + _ = translation a (((u.1.im : CutRing) * cutTau, (u.2.im : CutRing) * cutTau) + + ((u.1.re : CutRing), (u.2.re : CutRing))) := congrArg (translation a) hu + _ = _ := translation_period _ _ (u.1.re, u.2.re) + +theorem halfPlane_mem (a : ℕ) (j : Fin 4) (z : CutRing) : + halfPlane a j z ∈ polygonAlgebra a := + BooleanSubalgebra.subset_closure ⟨j, z, rfl⟩ + +noncomputable def wrapIndices (u : CutRing × CutRing) : Finset (ℤ × ℤ) := + (Finset.Icc ⌊ordinary u.1⌋ (⌊ordinary u.1⌋ + 1)) ×ˢ + (Finset.Icc ⌊ordinary u.2⌋ (⌊ordinary u.2⌋ + 1)) + +def wrapCell (a : ℕ) (u : CutRing × CutRing) (k : ℤ × ℤ) : Set (GenericSquare a) := + (halfPlane a 0 ((k.1 : CutRing) + 1 - u.1) ∩ + (halfPlane a 0 ((k.1 : CutRing) - u.1))ᶜ) ∩ + (halfPlane a 1 ((k.2 : CutRing) + 1 - u.2) ∩ + (halfPlane a 1 ((k.2 : CutRing) - u.2))ᶜ) + +theorem wrapCell_mem (a : ℕ) (u : CutRing × CutRing) (k : ℤ × ℤ) : + wrapCell a u k ∈ polygonAlgebra a := + BooleanSubalgebra.inf_mem + (BooleanSubalgebra.inf_mem (halfPlane_mem _ _ _) (BooleanSubalgebra.compl_mem (halfPlane_mem _ _ _))) + (BooleanSubalgebra.inf_mem (halfPlane_mem _ _ _) (BooleanSubalgebra.compl_mem (halfPlane_mem _ _ _))) + +theorem mem_wrapCell {a : ℕ} (u : CutRing × CutRing) (k : ℤ × ℤ) (p : GenericSquare a) : + p ∈ wrapCell a u k ↔ + ⌊p.val.1 + ordinary u.1⌋ = k.1 ∧ ⌊p.val.2 + ordinary u.2⌋ = k.2 := by + simp only [wrapCell, Set.mem_inter_iff, halfPlane, Set.mem_ofPred_eq, + Set.mem_compl_iff, cutForm, Matrix.cons_val_zero, Matrix.cons_val_one, + map_sub, map_add, map_one, map_intCast, not_lt, Int.floor_eq_iff] + constructor + · rintro ⟨⟨hx, hx'⟩, ⟨hy, hy'⟩⟩ + exact ⟨⟨by linarith, by linarith⟩, ⟨by linarith, by linarith⟩⟩ + · rintro ⟨⟨hx, hx'⟩, ⟨hy, hy'⟩⟩ + exact ⟨⟨by linarith, by linarith⟩, ⟨by linarith, by linarith⟩⟩ + +private theorem floor_wrap_mem {x : ℝ} (hx : x ∈ Set.Ico (0 : ℝ) 1) (t : ℝ) : + ⌊x + t⌋ ∈ Finset.Icc ⌊t⌋ (⌊t⌋ + 1) := by + rw [Finset.mem_Icc] + exact ⟨Int.floor_mono (by linarith [hx.1]), + (Int.floor_mono (show x + t ≤ t + 1 by linarith [hx.2])).trans_eq (Int.floor_add_one t)⟩ + +theorem point_wrap_mem {a : ℕ} (u : CutRing × CutRing) (p : GenericSquare a) : + (⌊p.val.1 + ordinary u.1⌋, ⌊p.val.2 + ordinary u.2⌋) ∈ wrapIndices u := by + exact Finset.mem_product.mpr + ⟨floor_wrap_mem p.property.1 _, floor_wrap_mem p.property.2.1 _⟩ + +theorem translate_on_wrap {a : ℕ} (u : CutRing × CutRing) (k : ℤ × ℤ) + {p : GenericSquare a} (hp : p ∈ wrapCell a u k) : + (translate a u p).val = p.val + + (ordinary (u.1 - (k.1 : CutRing)), ordinary (u.2 - (k.2 : CutRing))) := by + obtain ⟨h1, h2⟩ := (mem_wrapCell u k p).mp hp + simp only [translate_val, Int.fract, h1, h2, map_sub, map_intCast] + apply Prod.ext <;> simp only [Prod.fst_add, Prod.snd_add] <;> ring + +theorem preimage_halfPlane (a : ℕ) (u : CutRing × CutRing) (j : Fin 4) (z : CutRing) : + translate a u ⁻¹' halfPlane a j z = + ⋃ k ∈ wrapIndices u, wrapCell a u k ∩ + halfPlane a j (z - integralCutForm a j + (u.1 - (k.1 : CutRing), u.2 - (k.2 : CutRing))) := by + ext p + simp only [Set.mem_preimage, Set.mem_iUnion, Set.mem_inter_iff] + constructor + · intro hp + let k := (⌊p.val.1 + ordinary u.1⌋, ⌊p.val.2 + ordinary u.2⌋) + have hk : p ∈ wrapCell a u k := (mem_wrapCell u k p).mpr ⟨rfl, rfl⟩ + refine ⟨k, point_wrap_mem u p, hk, ?_⟩ + change cutForm a j (translate a u p).val < ordinary z at hp + rw [translate_on_wrap u k hk, cutForm_add, cutForm_ordinary a j (u.1 - (k.1 : CutRing), u.2 - (k.2 : CutRing))] at hp + change cutForm a j p.val < ordinary (z - _) + rw [map_sub] + linarith + · rintro ⟨k, _, hk, hp⟩ + change cutForm a j p.val < ordinary (z - _) at hp + rw [map_sub] at hp + change cutForm a j (translate a u p).val < ordinary z + rw [translate_on_wrap u k hk, cutForm_add, + cutForm_ordinary a j (u.1 - (k.1 : CutRing), u.2 - (k.2 : CutRing))] + linarith + +theorem polygon_preimage_translate {a : ℕ} (u : CutRing × CutRing) + {U : Set (GenericSquare a)} (hU : U ∈ polygonAlgebra a) : + translate a u ⁻¹' U ∈ polygonAlgebra a := by + apply polygon_induction (P := fun V => translate a u ⁻¹' V ∈ polygonAlgebra a) ?_ ?_ ?_ ?_ hU + · intro j z + rw [preimage_halfPlane] + exact BooleanSubalgebra.biSup_mem (wrapIndices u).finite_toSet + (fun k _ => BooleanSubalgebra.inf_mem (wrapCell_mem a u k) (halfPlane_mem _ _ _)) + · simpa using (BooleanSubalgebra.bot_mem : (∅ : Set (GenericSquare a)) ∈ polygonAlgebra a) + · intro U V hU hV; exact BooleanSubalgebra.sup_mem hU hV + · intro U hU; exact BooleanSubalgebra.compl_mem hU + +theorem polygon_image_translation {a : ℕ} (u : CutRing × CutRing) + {U : Set (GenericSquare a)} (hU : U ∈ polygonAlgebra a) : + translation a u '' U ∈ polygonAlgebra a := by + rw [(translation a u).image_eq_preimage_symm] + exact polygon_preimage_translate (-u) hU + +private theorem exists_in_interval_avoiding (l r : ℝ) (hlr : l < r) + (S : Set ℝ) (hS : S.Countable) : ∃ x ∈ Set.Ioo l r, x ∉ S := by + apply Set.not_subset.mp + intro h + have := Cardinal.Real.Ioo_countable_iff.mp (hS.mono h) + linarith + +theorem generic_rectangle (a : ℕ) (l₁ r₁ l₂ r₂ : ℝ) + (hl₁ : 0 ≤ l₁) (hr₁ : r₁ ≤ 1) (h₁ : l₁ < r₁) + (hl₂ : 0 ≤ l₂) (hr₂ : r₂ ≤ 1) (h₂ : l₂ < r₂) : + ∃ p : GenericSquare a, p.val.1 ∈ Set.Ioo l₁ r₁ ∧ p.val.2 ∈ Set.Ioo l₂ r₂ := by + obtain ⟨x, hx, hx'⟩ := exists_in_interval_avoiding l₁ r₁ h₁ + (Set.range ordinary) (Set.countable_range ordinary) + let t := Real.goldenRatio ^ a + have ht : t ≠ 0 := ne_of_gt (pow_pos Real.goldenRatio_pos a) + let S := Set.range ordinary ∪ Set.range (fun z : CutRing => ordinary z + t*x) ∪ + Set.range (fun z : CutRing => (x - ordinary z)/t) + have hS : S.Countable := ((Set.countable_range ordinary).union + (Set.countable_range _)).union (Set.countable_range _) + obtain ⟨y, hy, hy'⟩ := exists_in_interval_avoiding l₂ r₂ h₂ S hS + have hav : AvoidsCuts a (x,y) := by + intro j z hz + fin_cases j + · exact hx' ⟨z, by simpa [cutForm] using hz.symm⟩ + · apply hy' + exact Or.inl (Or.inl ⟨z, by simpa [cutForm] using hz.symm⟩) + · apply hy' + apply Or.inl ∘ Or.inr + refine ⟨z, ?_⟩ + change ordinary z + t*x = y + change y - t*x = ordinary z at hz + linarith + · apply hy' + apply Or.inr + refine ⟨z, ?_⟩ + apply (div_eq_iff ht).mpr + change x - t*y = ordinary z at hz + linarith + exact ⟨⟨(x,y), ⟨by linarith [hx.1], by linarith [hx.2]⟩, + ⟨by linarith [hy.1], by linarith [hy.2]⟩, hav⟩, hx, hy⟩ + +instance (a : ℕ) : Nonempty (GenericSquare a) := by + obtain ⟨p, _⟩ := generic_rectangle a 0 1 0 1 le_rfl le_rfl zero_lt_one le_rfl le_rfl zero_lt_one + exact ⟨p⟩ + +end PolygonAction + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/PolygonArea.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/PolygonArea.lean new file mode 100644 index 0000000000000000000000000000000000000000..81266c111cecc1ee36e177e5cb954d9843b555e5 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/PolygonArea.lean @@ -0,0 +1,235 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Arithmetic.PolygonArithmetic + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section PolygonArea +open Classical Set MeasureTheory + +local instance : Countable CutRing := + (QuadraticAlgebra.equivProd (1 : ℤ) 1).injective.countable + +theorem continuous_cutForm (a : ℕ) (j : Fin 4) : Continuous (cutForm a j) := by + change Continuous (fun p => cutForm a j p) + fin_cases j <;> dsimp [cutForm] <;> fun_prop + +theorem measurableSet_avoidsCuts (a : ℕ) : MeasurableSet {p : ℝ×ℝ | AvoidsCuts a p} := by + change MeasurableSet {p | ∀j z,cutForm a j p≠ordinary z} + simp only [ofPred_forall] + apply MeasurableSet.iInter + intro j + apply MeasurableSet.iInter + intro z + exact ((continuous_cutForm a j).measurable (measurableSet_singleton (ordinary z))).compl + +theorem volume_cut_level (a : ℕ) (j : Fin 4) (r : ℝ) : + volume {p : ℝ×ℝ | cutForm a j p=r}=0 := by + have hm : MeasurableSet {p : ℝ×ℝ | cutForm a j p=r} := + (continuous_cutForm a j).measurable (measurableSet_singleton r) + change ((volume : Measure ℝ).prod volume) _=0 + fin_cases j + · rw [Measure.prod_apply_symm hm] + simp [cutForm] + · rw [Measure.prod_apply hm] + simp [cutForm] + · rw [Measure.prod_apply hm] + have hy (x : ℝ) : {y : ℝ | y-Real.goldenRatio^a*x=r}={r+Real.goldenRatio^a*x} := by + ext y + simp only [mem_ofPred_eq,mem_singleton_iff] + constructor <;> intro h <;> linarith + simp only [cutForm,Set.preimage] + simp [hy] + · rw [Measure.prod_apply_symm hm] + have hx (y : ℝ) : {x : ℝ | x-Real.goldenRatio^a*y=r}={r+Real.goldenRatio^a*y} := by + ext x + simp only [mem_ofPred_eq,mem_singleton_iff] + constructor <;> intro h <;> linarith + simp only [cutForm,Set.preimage] + simp [hx] + +theorem ae_avoidsCuts (a : ℕ) : ∀ᵐp : ℝ×ℝ, AvoidsCuts a p := by + rw [ae_iff] + have he : {p : ℝ×ℝ | ¬AvoidsCuts a p}=⋃j : Fin 4,⋃z : CutRing,{p | cutForm a j p=ordinary z} := by + ext p + simp [AvoidsCuts] + rw [he] + exact measure_iUnion_null (fun j => measure_iUnion_null (fun z => volume_cut_level a j (ordinary z))) + +theorem measurableSet_genericSquare (a : ℕ) : + MeasurableSet {p : ℝ×ℝ | p.1∈Ico 0 1 ∧ p.2∈Ico 0 1 ∧ AvoidsCuts a p} := + (measurable_fst measurableSet_Ico).inter + ((measurable_snd measurableSet_Ico).inter (measurableSet_avoidsCuts a)) + +theorem volume_genericSquare (a : ℕ) : + volume {p : ℝ×ℝ | p.1∈Ico 0 1 ∧ p.2∈Ico 0 1 ∧ AvoidsCuts a p}=1 := by + have he : {p : ℝ×ℝ | p.1∈Ico 0 1 ∧ p.2∈Ico 0 1 ∧ AvoidsCuts a p} + =ᵐ[volume] (Ico (0:ℝ) 1)×ˢ(Ico (0:ℝ) 1) := by + filter_upwards [ae_avoidsCuts a] with p hp + apply propext + change (p.1∈Ico 0 1 ∧ p.2∈Ico 0 1 ∧ AvoidsCuts a p) ↔ + (p.1∈Ico 0 1 ∧ p.2∈Ico 0 1) + simp only [hp,and_true] + rw [measure_congr he] + change ((volume : Measure ℝ).prod volume) (Ico 0 1 ×ˢ Ico 0 1)=1 + rw [Measure.prod_prod] + simp + +end PolygonArea + +section PolygonJordan +open Classical Set MeasureTheory +namespace PolygonArea + +noncomputable def square : Set (ℝ×ℝ) := Ico (0:ℝ) 1 ×ˢ Ico (0:ℝ) 1 + +theorem null_frontier_inter {S T : Set (ℝ×ℝ)} + (hS : volume (frontier S)=0) (hT : volume (frontier T)=0) : + volume (frontier (S∩T))=0 := by + apply measure_mono_null (subset_trans (frontier_inter_subset S T) ?_) + (measure_union_null hS hT) + exact Set.union_subset_union Set.inter_subset_left Set.inter_subset_right + +theorem null_frontier_union {S T : Set (ℝ×ℝ)} + (hS : volume (frontier S)=0) (hT : volume (frontier T)=0) : + volume (frontier (S∪T))=0 := by + apply measure_mono_null (subset_trans (frontier_union_subset S T) ?_) + (measure_union_null hS hT) + exact Set.union_subset_union Set.inter_subset_left Set.inter_subset_right + +theorem null_frontier_diff {S T : Set (ℝ×ℝ)} + (hS : volume (frontier S)=0) (hT : volume (frontier T)=0) : + volume (frontier (S\T))=0 := by + change volume (frontier (S ∩ Tᶜ))=0 + exact null_frontier_inter hS (by simpa only [frontier_compl] using hT) + +theorem null_frontier_cut (a : ℕ) (j : Fin 4) (r : ℝ) : + volume (frontier {p : ℝ×ℝ | cutForm a j p ∃S : Set (ℝ×ℝ), S⊆square ∧ MeasurableSet S ∧ + volume (frontier S)=0 ∧ ∀x : GenericSquare a,x∈U ↔ x.val∈S) ?_ ?_ ?_ ?_ hU + · intro j z + refine ⟨square∩{p | cutForm a j p ⟨⟨x.property.1,x.property.2.1⟩,hx⟩,And.right⟩ + · exact ⟨∅,Set.empty_subset _,MeasurableSet.empty,by simp,by simp⟩ + · intro U V hU hV + obtain ⟨S,hS,hmS,hbS,heS⟩ := hU + obtain ⟨T,hT,hmT,hbT,heT⟩ := hV + exact ⟨S∪T,Set.union_subset hS hT,hmS.union hmT,null_frontier_union hbS hbT, + fun x => or_congr (heS x) (heT x)⟩ + · intro U hU + obtain ⟨S,hS,hmS,hbS,heS⟩ := hU + refine ⟨square\S,Set.sdiff_subset,(measurableSet_Ico.prod measurableSet_Ico).diff hmS, + null_frontier_diff null_frontier_square hbS,?_⟩ + intro x + change x∉U ↔ x.val∈square ∧ x.val∉S + exact ⟨fun hx => ⟨⟨x.property.1,x.property.2.1⟩,fun hs => hx ((heS x).mpr hs)⟩, + fun hx hu => hx.2 ((heS x).mp hu)⟩ + +noncomputable def area {a : ℕ} (U : polygonAlgebra a) : ENNReal := + volume (Subtype.val '' U.val) + +theorem image_eq_rep {a : ℕ} (U : polygonAlgebra a) {S : Set (ℝ×ℝ)} + (hS : S⊆square) (he : ∀x : GenericSquare a,x∈U.val ↔ x.val∈S) : + Subtype.val '' U.val=S∩{p | AvoidsCuts a p} := by + ext p + constructor + · rintro ⟨x,hx,rfl⟩ + exact ⟨(he x).mp hx,x.property.2.2⟩ + · rintro ⟨hp,hcut⟩ + have hsq := hS hp + exact ⟨⟨p,hsq.1,hsq.2,hcut⟩,(he _).mpr hp,rfl⟩ + +theorem area_eq_rep {a : ℕ} (U : polygonAlgebra a) {S : Set (ℝ×ℝ)} + (hS : S⊆square) (he : ∀x : GenericSquare a,x∈U.val ↔ x.val∈S) : area U=volume S := by + rw [area,image_eq_rep U hS he] + apply measure_congr + filter_upwards [ae_avoidsCuts a] with p hp + apply propext + exact ⟨And.left,fun h => ⟨h,hp⟩⟩ + +theorem measurable_image {a : ℕ} (U : polygonAlgebra a) : + MeasurableSet (Subtype.val '' U.val) := by + obtain ⟨S,hS,hm,hn,he⟩ := representative U.property + rw [image_eq_rep U hS he] + exact hm.inter (measurableSet_avoidsCuts a) + +theorem area_le_one {a : ℕ} (U : polygonAlgebra a) : area U≤1 := by + obtain ⟨S,hS,hm,hn,he⟩ := representative U.property + rw [area_eq_rep U hS he] + calc + volume S≤volume square := measure_mono hS + _=1 := by change ((volume : Measure ℝ).prod volume) (Ico 0 1 ×ˢ Ico 0 1)=1; simp + +theorem area_top (a : ℕ) : area (⊤ : polygonAlgebra a)=1 := by + change volume (Subtype.val '' (⊤ : polygonAlgebra a).val)=1 + have he : Subtype.val '' (⊤ : polygonAlgebra a).val= + {p : ℝ×ℝ | p.1∈Ico 0 1 ∧ p.2∈Ico 0 1 ∧ AvoidsCuts a p} := by + ext p + constructor + · rintro ⟨x,-,rfl⟩; exact x.property + · intro h; exact ⟨⟨p,h⟩,by trivial,rfl⟩ + rw [he] + exact volume_genericSquare a + +theorem closure_ae_eq {S : Set (ℝ×ℝ)} (hS : volume (frontier S)=0) : closure S=ᵐ[volume] S := by + have hn : ∀ᵐp : ℝ×ℝ,p∉frontier S := by + rw [ae_iff] + simpa only [not_not, Set.ofPred_mem_eq] using hS + filter_upwards [hn] with p hp + apply propext + constructor + · intro hx + exact interior_subset (show p∈interior S from by + by_contra hn + exact hp ⟨hx,hn⟩) + · intro hx + exact subset_closure hx + +theorem interior_ae_eq {S : Set (ℝ×ℝ)} (hS : volume (frontier S)=0) : interior S=ᵐ[volume] S := by + have hn : ∀ᵐp : ℝ×ℝ,p∉frontier S := by + rw [ae_iff] + simpa only [not_not, Set.ofPred_mem_eq] using hS + filter_upwards [hn] with p hp + apply propext + constructor + · intro hx + exact interior_subset hx + · intro hx + by_contra hn + exact hp ⟨subset_closure hx,hn⟩ + +end PolygonArea +end PolygonJordan + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/PolygonAreaAlgebra.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/PolygonAreaAlgebra.lean new file mode 100644 index 0000000000000000000000000000000000000000..a00148e6de5a6fad0ad4558edcf253f569675ad9 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/PolygonAreaAlgebra.lean @@ -0,0 +1,123 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.Supported +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.PolygonArea + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section PolygonAreaAlgebra + +open Classical Set MeasureTheory +namespace PolygonArea + +@[simp] theorem area_bot (a : ℕ) : area (⊥ : polygonAlgebra a)=0 := by + change volume ((fun point : GenericSquare a => point.val) '' (∅ : Set (GenericSquare a)))=0 + simp + +theorem area_mono {a : ℕ} {U V : polygonAlgebra a} (h : U≤V) : area U≤area V := + measure_mono (Set.image_mono h) + +theorem area_eq_sum {a : ℕ} {ι : Type*} [Fintype ι] (U : polygonAlgebra a) + (f : ι → polygonAlgebra a) (he : U.val=⋃i,(f i).val) + (hd : Pairwise (fun i j => Disjoint (f i).val (f j).val)) : + area U=∑i,area (f i) := by + have hd' : Pairwise (fun i j => + Disjoint ((fun point : GenericSquare a => point.val) '' (f i).val) + ((fun point : GenericSquare a => point.val) '' (f j).val)) := by + intro i j hij + apply Set.disjoint_left.mpr + rintro _ ⟨x,hx,rfl⟩ ⟨y,hy,hyx⟩ + have : y=x := Subtype.ext hyx + exact Set.disjoint_left.mp (hd hij) hx (by simpa only [this] using hy) + change volume ((fun point : GenericSquare a => point.val) '' U.val)=_ + rw [he,Set.image_iUnion,measure_iUnion hd' (fun i => measurable_image (f i)),tsum_fintype] + rfl + +theorem area_sup_add_inf {a : ℕ} (U V : polygonAlgebra a) : + area (U⊔V)+area (U⊓V)=area U+area V := by + change volume ((fun point : GenericSquare a => point.val) '' (U.val∪V.val))+ + volume ((fun point : GenericSquare a => point.val) '' (U.val∩V.val))=_ + rw [Set.image_union,Set.image_inter (f := fun point : GenericSquare a => point.val) + Subtype.val_injective] + exact measure_union_add_inter _ (measurable_image V) + +theorem area_compl {a : ℕ} (U : polygonAlgebra a) : area U+area Uᶜ=1 := by + have h := area_sup_add_inf U Uᶜ + simpa only [sup_compl_eq_top,inf_compl_eq_bot,area_top,area_bot,add_zero] using h.symm + +theorem area_sup_le {a : ℕ} (U V : polygonAlgebra a) : area (U⊔V)≤area U+area V := by + change volume ((fun point : GenericSquare a => point.val) '' (U.val∪V.val))≤_ + rw [Set.image_union] + exact measure_union_le _ _ + +theorem area_finset_sup_le {a : ℕ} {ι : Type*} (s : Finset ι) (f : ι → polygonAlgebra a) : + area (s.sup f)≤∑i∈s,area (f i) := by + induction s using Finset.induction_on with + | empty => simp + | @insert i s hi ih => + rw [Finset.sup_insert,Finset.sum_insert hi] + exact (area_sup_le _ _).trans (add_le_add le_rfl ih) + +theorem area_translation_wrap {a : ℕ} (u : CutRing×CutRing) (k : ℤ×ℤ) + (U : polygonAlgebra a) (hU : U.val⊆wrapCell a u k) : + area (translatedPolygon u U)=area U := by + let v : ℝ×ℝ := (ordinary (u.1-(k.1:CutRing)),ordinary (u.2-(k.2:CutRing))) + have he : Subtype.val '' (translatedPolygon u U).val= + (fun p : ℝ×ℝ => p+v) '' (Subtype.val '' U.val) := by + ext p + constructor + · rintro ⟨y,⟨x,hx,rfl⟩,rfl⟩ + exact ⟨x.val,⟨x,hx,rfl⟩,(translate_on_wrap u k (hU hx)).symm⟩ + · rintro ⟨_,⟨x,hx,rfl⟩,rfl⟩ + exact ⟨translate a u x,⟨x,hx,rfl⟩,translate_on_wrap u k (hU hx)⟩ + change volume (Subtype.val '' (translatedPolygon u U).val)=_ + rw [he,Set.image_add_right,measure_preimage_add_right] + rfl + +theorem area_translation {a : ℕ} (u : CutRing×CutRing) (U : polygonAlgebra a) : + area (translatedPolygon u U)=area U := by + let W (k : wrapIndices u) : polygonAlgebra a := + U ⊓ ⟨wrapCell a u k.val,wrapCell_mem a u k.val⟩ + have hcov : U.val=⋃k,(W k).val := by + ext x + constructor + · intro hx + let k : wrapIndices u := ⟨(⌊x.val.1+ordinary u.1⌋,⌊x.val.2+ordinary u.2⌋),point_wrap_mem u x⟩ + exact Set.mem_iUnion.mpr ⟨k,hx,(mem_wrapCell u k.val x).mpr ⟨rfl,rfl⟩⟩ + · intro hx + obtain ⟨k,hk⟩ := Set.mem_iUnion.mp hx + exact hk.1 + have hdis : Pairwise (fun k l : wrapIndices u => Disjoint (W k).val (W l).val) := by + intro k l hkl + apply Set.disjoint_left.mpr + intro x hx hy + obtain ⟨hx₁,hx₂⟩ := (mem_wrapCell u k.val x).mp hx.2 + obtain ⟨hy₁,hy₂⟩ := (mem_wrapCell u l.val x).mp hy.2 + exact hkl (Subtype.ext (Prod.ext (hx₁.symm.trans hy₁) (hx₂.symm.trans hy₂))) + have he : (translatedPolygon u U).val=⋃k,(translatedPolygon u (W k)).val := by + change translation a u '' U.val=⋃k,translation a u '' (W k).val + rw [hcov,Set.image_iUnion] + have hd : Pairwise (fun k l : wrapIndices u => + Disjoint (translatedPolygon u (W k)).val (translatedPolygon u (W l)).val) := by + intro k l hkl + apply Set.disjoint_image_image + intro x hx y hy he + have heq := (translation a u).injective he + subst y + exact Set.disjoint_left.mp (hdis hkl) hx hy + rw [area_eq_sum _ _ he hd,area_eq_sum _ _ hcov hdis] + exact Finset.sum_congr rfl (fun k _ => area_translation_wrap u k.val (W k) (fun _ hx => hx.2)) + +end PolygonArea +end PolygonAreaAlgebra + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/PolygonBankEmbedding.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/PolygonBankEmbedding.lean new file mode 100644 index 0000000000000000000000000000000000000000..07392a684dcbe25160639bd5f407efc9da9edfe2 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/PolygonBankEmbedding.lean @@ -0,0 +1,240 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.PolygonPiecewiseSlots + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section PolygonBankEmbedding + +open Classical Set +namespace PolygonObject + +structure BankEmbedding {a : ℕ} (U : PolygonObject a) (m : ℕ) where + emb : U.Point ↪ TrackPoint a m + table : HasTable (fun x => (⟨emb x,by trivial⟩ : (whole a m).Point)) + +namespace BankEmbedding +variable {a m : ℕ} {U : PolygonObject a} +instance : CoeFun (BankEmbedding U m) (fun _ => U.Point → TrackPoint a m) := ⟨fun f => f.emb⟩ + +theorem injective (f : BankEmbedding U m) : Function.Injective f := f.emb.injective + +theorem range_fiber_polygon (f : BankEmbedding U m) (i : Fin m) : + {x | (i,x)∈Set.range f}∈polygonAlgebra a := by + obtain ⟨S,hS,hcov⟩ := f.table + change Finset (Chart (a:=a) U.tracks m) at S + let Q (c : Chart (a:=a) U.tracks m) : polygonAlgebra a := + if c.target=i then translatedPolygon c.shift c.domain else ⊥ + have he : {x | (i,x)∈Set.range f}=(S.sup Q).val := by + rw [PolygonArea.val_finset_sup] + ext y + constructor + · rintro ⟨p,hp⟩ + obtain ⟨c,hc,hs,hx⟩ := hcov p + obtain ⟨hu,hf⟩ := hS c hc p.val.2 hx + have he : (⟨(c.source,p.val.2),hu⟩ : U.Point)=p := Subtype.ext (Prod.ext hs.symm rfl) + change f ⟨(c.source,p.val.2),hu⟩=(c.target,translate a c.shift p.val.2) at hf + rw [he,hp] at hf + refine Set.mem_iUnion₂.mpr ⟨c,hc,?_⟩ + have ht : c.target=i := (congrArg Prod.fst hf).symm + simp only [Q,ht,ite_true] + exact ⟨p.val.2,hx,(congrArg Prod.snd hf).symm⟩ + · intro hy + obtain ⟨c,hc,hy⟩ := Set.mem_iUnion₂.mp hy + by_cases ht : c.target=i + · simp only [Q,ht,ite_true] at hy + obtain ⟨x,hx,rfl⟩ := hy + obtain ⟨hu,he⟩ := hS c hc x hx + refine ⟨⟨(c.source,x),hu⟩,?_⟩ + change f ⟨(c.source,x),hu⟩=(c.target,translate a c.shift x) at he + change f ⟨(c.source,x),hu⟩=(i,translate a c.shift x) + exact he.trans (congrArg (fun j => (j,translate a c.shift x)) ht) + · simp only [Q,ht,ite_false] at hy + exact False.elim hy + rw [he] + exact (S.sup Q).property + +noncomputable def imageBank (f : BankEmbedding U m) (i : Fin m) : polygonAlgebra a := + ⟨{x | (i,x)∈Set.range f},range_fiber_polygon f i⟩ + +theorem imageBank_area_le (f : BankEmbedding U m) : + (∑i,PolygonArea.area (imageBank f i))≤∑r,PolygonArea.area (U.cell r) := by + obtain ⟨S,hS,hcov⟩ := f.table + change Finset (Chart (a:=a) U.tracks m) at S + let D (r : Fin U.tracks) (c : S) : polygonAlgebra a := + if c.val.source=r then c.val.domain else ⊥ + have hD (r : Fin U.tracks) (c : S) (x : GenericSquare a) : + x∈(D r c).val ↔ c.val.source=r ∧ x∈c.val.domain.val := by + by_cases h : c.val.source=r <;> simp [D,h] + have hd_sub (r : Fin U.tracks) (c : S) : D r c≤U.cell r := by + intro x hx + obtain ⟨hr,hx⟩ := (hD r c x).mp hx + have hu := (hS c.val c.property x hx).1 + simpa only [hr] using hu + have hd_cover (r : Fin U.tracks) (x : GenericSquare a) (hx : x∈(U.cell r).val) : + ∃c : S,x∈(D r c).val := by + obtain ⟨c,hc,hr,hd⟩ := hcov ⟨(r,x),hx⟩ + exact ⟨⟨c,hc⟩,(hD r ⟨c,hc⟩ x).mpr ⟨hr.symm,hd⟩⟩ + have ex (r : Fin U.tracks) := Fintype.exists_disjointed_le (D r) + choose P hP hSup hdisP using ex + have hcoverP (r : Fin U.tracks) : (U.cell r).val=⋃c,(P r c).val := by + have hv := congrArg (fun A : polygonAlgebra a => A.val) (hSup r) + simp only [PolygonArea.val_finset_sup,Finset.mem_univ,Set.iUnion_true] at hv + rw [hv] + ext x + exact ⟨fun hx => Set.mem_iUnion.mpr (hd_cover r x hx),fun hx => + by obtain ⟨c,hc⟩ := Set.mem_iUnion.mp hx;exact hd_sub r c hc⟩ + have hsumP (r : Fin U.tracks) : (∑c,PolygonArea.area (P r c))=PolygonArea.area (U.cell r) := by + symm + apply PolygonArea.area_eq_sum _ (P r) (hcoverP r) + intro c d hcd + have h : Disjoint (P r c) (P r d) := hdisP r hcd + rw [disjoint_iff] at h + exact Set.disjoint_iff_inter_eq_empty.mpr (congrArg (fun A : polygonAlgebra a => A.val) h) + let Q (i : Fin m) (r : Fin U.tracks) (c : S) : polygonAlgebra a := + if c.val.target=i then translatedPolygon c.val.shift (P r c) else ⊥ + have hbank (i : Fin m) : imageBank f i≤Finset.univ.sup (fun r => Finset.univ.sup (Q i r)) := by + intro y hy + obtain ⟨p,hpy⟩ := hy + have hx : p.val.2∈⋃c,(P p.val.1 c).val := by rw [←hcoverP];exact p.property + obtain ⟨c,hc⟩ := Set.mem_iUnion.mp hx + obtain ⟨hr,hd⟩ := (hD p.val.1 c p.val.2).mp (hP p.val.1 c hc) + obtain ⟨hu,he⟩ := hS c.val c.property p.val.2 hd + have he' : (⟨(c.val.source,p.val.2),hu⟩ : U.Point)=p := Subtype.ext (Prod.ext hr rfl) + change f ⟨(c.val.source,p.val.2),hu⟩=(c.val.target,translate a c.val.shift p.val.2) at he + rw [he',hpy] at he + simp only [PolygonArea.val_finset_sup] + refine Set.mem_iUnion₂.mpr ⟨p.val.1,Finset.mem_univ _,Set.mem_iUnion₂.mpr ⟨c,Finset.mem_univ _,?_⟩⟩ + have ht : c.val.target=i := (congrArg Prod.fst he).symm + simp only [Q,ht,ite_true] + exact ⟨p.val.2,hc,(congrArg Prod.snd he).symm⟩ + calc + (∑i,PolygonArea.area (imageBank f i)) ≤ ∑i,∑r,∑c,PolygonArea.area (Q i r c) := by + apply Finset.sum_le_sum + intro i _ + exact (PolygonArea.area_mono (hbank i)).trans ((PolygonArea.area_finset_sup_le _ _).trans + (Finset.sum_le_sum (fun r _ => PolygonArea.area_finset_sup_le _ _))) + _ = ∑r,∑c,PolygonArea.area (P r c) := by + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro r _ + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro c _ + simp [Q,apply_ite,PolygonArea.area_bot,PolygonArea.area_translation] + _ = ∑r,PolygonArea.area (U.cell r) := Finset.sum_congr rfl (fun r _ => hsumP r) + +theorem exists_into {U V : Fin m → polygonAlgebra a} + (h : (∑i,PolygonArea.area (U i))<∑i,PolygonArea.area (V i)) : + ∃f : BankEmbedding (PolygonObject.mk m U) m,∀p,(f p).2∈(V (f p).1).val := by + obtain ⟨f,hf⟩ := PolygonGrid.strict_comparison U V h + exact ⟨⟨⟨fun p => (f p).val,fun _ _ he => f.injective (Subtype.ext he)⟩,hf⟩,fun p => (f p).property⟩ + +end BankEmbedding +end PolygonObject +end PolygonBankEmbedding + +section PolygonBankReserve + +open Classical Set +namespace PolygonObject +namespace BankEmbedding +variable {a m b : ℕ} + +noncomputable def inclusion (U : Fin m → polygonAlgebra a) : BankEmbedding (PolygonObject.mk m U) m := + ⟨⟨Subtype.val,Subtype.val_injective⟩,intoWhole_hasTable (identity_hasTable _)⟩ + +theorem exists_away (U B : Fin m → polygonAlgebra a) + (f : Fin b → BankEmbedding (PolygonObject.mk m U) m) + (h : (∑i,PolygonArea.area (B i))+(b+1:ENNReal)*(∑i,PolygonArea.area (U i)) < m) : + ∃g : BankEmbedding (PolygonObject.mk m U) m, + (∀p,(g p).2∉(B (g p).1).val) ∧ ∀j p q,g p≠f j q := by + let D (i : Fin m) : polygonAlgebra a := + B i ⊔ Finset.univ.sup (fun j => imageBank (f j) i) + let V (i : Fin m) : polygonAlgebra a := (D i)ᶜ + have hD : (∑i,PolygonArea.area (D i))≤ + (∑i,PolygonArea.area (B i))+(b:ENNReal)*(∑i,PolygonArea.area (U i)) := by + calc + _≤∑i,(PolygonArea.area (B i)+∑j,PolygonArea.area (imageBank (f j) i)) := by + apply Finset.sum_le_sum + intro i _ + exact (PolygonArea.area_sup_le _ _).trans (add_le_add le_rfl (PolygonArea.area_finset_sup_le _ _)) + _=(∑i,PolygonArea.area (B i))+∑j,∑i,PolygonArea.area (imageBank (f j) i) := by + rw [Finset.sum_add_distrib,Finset.sum_comm] + _≤(∑i,PolygonArea.area (B i))+∑_j : Fin b,∑i,PolygonArea.area (U i) := + add_le_add le_rfl (Finset.sum_le_sum (fun j _ => imageBank_area_le (f j))) + _=_ := by simp + have hDV : (∑i,PolygonArea.area (D i))+(∑i,PolygonArea.area (V i))=m := by + rw [←Finset.sum_add_distrib] + simp only [V,PolygonArea.area_compl,Finset.sum_const,Finset.card_univ,Fintype.card_fin,nsmul_eq_mul,mul_one] + have hV : (∑i,PolygonArea.area (U i))<∑i,PolygonArea.area (V i) := by + by_contra hn + have hh := (add_le_add hD (le_of_not_gt hn)) + rw [hDV] at hh + have he : (∑i,PolygonArea.area (B i))+(b:ENNReal)*(∑i,PolygonArea.area (U i))+ + (∑i,PolygonArea.area (U i)) = + (∑i,PolygonArea.area (B i))+(b+1:ENNReal)*(∑i,PolygonArea.area (U i)) := by + rw [add_mul,one_mul,add_assoc] + rw [he] at hh + exact (not_le_of_gt h) hh + obtain ⟨g,hg⟩ := exists_into hV + refine ⟨g,?_,?_⟩ + · intro p hB + exact hg p (Or.inl hB) + · intro j p q he + apply hg p + right + rw [PolygonArea.val_finset_sup] + refine Set.mem_iUnion₂.mpr ⟨j,Finset.mem_univ _,?_⟩ + exact ⟨q,he.symm⟩ + +theorem cycle_three {U : PolygonObject a} (f g h : BankEmbedding U m) + (hfg : ∀p q,f p≠g q) (hfh : ∀p q,f p≠h q) (hgh : ∀p q,g p≠h q) : + ∃ c : polygonAlternatingGroup a m, + (∀p,c.val.val (f p)=g p) ∧ + (∀y,(∀p,f p≠y) → (∀p,g p≠y) → (∀p,h p≠y) → c.val.val y=y) := by + let slots : Fin 3 → BankEmbedding U m := ![f,g,h] + have hinj : Function.Injective (fun p : Fin 3 × U.Point => slots p.1 p.2) := by + rintro ⟨i,p⟩ ⟨j,q⟩ he + have hij : i=j := by + fin_cases i <;> fin_cases j <;> simp only [slots] at he ⊢ + · exact False.elim (hfg p q he) + · exact False.elim (hfh p q he) + · exact False.elim (hfg q p he.symm) + · exact False.elim (hgh p q he) + · exact False.elim (hfh q p he.symm) + · exact False.elim (hgh q p he.symm) + subst j + exact Prod.ext rfl ((slots i).injective he) + let σ : Equiv.Perm (Fin 3) := Equiv.swap 0 1 * Equiv.swap 1 2 + have hσ : σ∈alternatingGroup (Fin 3) := by + simp [σ,Equiv.Perm.mem_alternatingGroup,Equiv.Perm.sign_mul] + obtain ⟨c,hc,hout⟩ := PolygonPiecewise.even_slots U (fun i => slots i) hinj (fun i => (slots i).table) σ hσ + refine ⟨c,?_,?_⟩ + · intro p + have hz : σ 0=1 := by decide + have hu := hc 0 p + rw [hz] at hu + exact hu + · intro y hyf hyg hyh + apply hout y + rintro ⟨⟨i,p⟩,he⟩ + fin_cases i + · exact hyf p he + · exact hyg p he + · exact hyh p he + +end BankEmbedding +end PolygonObject +end PolygonBankReserve + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/PolygonComponentCompletion.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/PolygonComponentCompletion.lean new file mode 100644 index 0000000000000000000000000000000000000000..fc0fc7610939f7193889dc18a0252aad7a865140 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/PolygonComponentCompletion.lean @@ -0,0 +1,101 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.PolygonMonoidalData + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section PolygonComponentCompletion + +open Classical CategoryTheory +namespace PolygonObject +variable {a : ℕ} + +abbrev Component (a : ℕ) := Skeleton (PolygonObject a) +noncomputable abbrev component (U : PolygonObject a) : Component a := toSkeleton U + +@[simp] theorem component_sum (U V : PolygonObject a) : + component (sum U V)=component U*component V := + Skeleton.toSkeleton_tensorObj U V + +theorem sum_standard (m n : ℕ) : sum (standard a m) (standard a n)=standard a (m+n) := by + unfold sum standard + congr 1 + funext i + induction i using Fin.addCases <;> simp only [Fin.addCases_left,Fin.addCases_right] + +@[simp] theorem component_standard_zero : component (standard a 0)=1 := by + rw [Skeleton.one_eq] + apply congrArg toSkeleton + change standard a 0=empty + unfold standard empty + congr 1 + funext i + exact Fin.elim0 i + +@[simp] theorem component_standard_add (m n : ℕ) : + component (standard a (m+n))=component (standard a m)*component (standard a n) := by + rw [←sum_standard,component_sum] + +theorem component_standard_pow (n : ℕ) : + component (standard a n)=component (standard a 1)^n := by + induction n with + | zero => simp + | succ n hn => rw [component_standard_add,hn,pow_succ] + +theorem component_complement (U : PolygonObject a) : + component U * component (complement U)=component (standard a U.tracks) := by + rw [←component_sum] + exact congr_toSkeleton_of_iso (complementIso U) + +abbrev CompletedComponent (a : ℕ) := Algebra.GrothendieckGroup (Component a) +noncomputable abbrev completedComponent (U : PolygonObject a) : CompletedComponent a := + Algebra.GrothendieckGroup.of (component U) + +theorem completion_eq_iff (U V : PolygonObject a) : + completedComponent U=completedComponent V ↔ + ∃ W : PolygonObject a, Nonempty (sum U W ≅ sum V W) := by + change (Localization.monoidOf (⊤ : Submonoid (Component a))) (component U)= + (Localization.monoidOf (⊤ : Submonoid (Component a))) (component V) ↔ _ + rw [Submonoid.LocalizationMap.eq_iff_exists] + constructor + · rintro ⟨c,hc⟩ + let W : PolygonObject a := (fromSkeleton (PolygonObject a)).obj c.val + refine ⟨W,⟨Skeleton.isoOfEq ?_⟩⟩ + change component (sum U W)=component (sum V W) + rw [component_sum,component_sum] + have he : component W=c.val := toSkeleton_fromSkeleton_obj c.val + rw [he,mul_comm (component U),mul_comm (component V)] + exact hc + · rintro ⟨W,hW⟩ + refine ⟨⟨component W,Submonoid.mem_top _⟩,?_⟩ + have hh := toSkeleton_eq_toSkeleton_iff.mpr hW + change component (sum U W)=component (sum V W) at hh + rw [component_sum,component_sum] at hh + simpa [mul_comm] using hh + +theorem neutral_component_eventually_standard (U : PolygonObject a) (r : ℕ) + (hU : completedComponent U=completedComponent (standard a r)) : + ∃ k : ℕ, Nonempty (sum U (standard a k) ≅ standard a (r+k)) := by + obtain ⟨V,hV⟩ := (completion_eq_iff U (standard a r)).mp hU + refine ⟨V.tracks,toSkeleton_eq_toSkeleton_iff.mp ?_⟩ + have hh := toSkeleton_eq_toSkeleton_iff.mpr hV + change component (sum U V)=component (sum (standard a r) V) at hh + rw [component_sum,component_sum] at hh + have he := congrArg (fun x : Component a => x*component (complement V)) hh + change component (sum U (standard a V.tracks))=component (standard a (r+V.tracks)) + rw [component_sum,component_standard_add] + simpa only [mul_assoc,component_complement] using he + +end PolygonObject +end PolygonComponentCompletion + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/PolygonDiagramRefinement.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/PolygonDiagramRefinement.lean new file mode 100644 index 0000000000000000000000000000000000000000..d974e27ab9b1024b0d39d3859464b46a74b7e8e3 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/PolygonDiagramRefinement.lean @@ -0,0 +1,131 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Configurations.PolygonTrajectoryStrata +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.PolygonObjectRefinement + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section PolygonDiagramRefinement + +open Classical CategoryTheory Set +namespace PolygonObject +variable {a : ℕ} + +theorem chart_target_track {U V : PolygonObject a} (f : U ⟶ V) + (c : Chart (a:=a) U.tracks V.tracks) (hc : c.Holds f.toEquiv) (x : U.Point) + (hx : c.Contains x) : (f.toEquiv x).val.1=c.target := by + obtain ⟨hu,he⟩ := hc x.val.2 hx.2 + have hpoint : (⟨(c.source,x.val.2),hu⟩ : U.Point)=x := + Subtype.ext (Prod.ext hx.1.symm rfl) + rw [hpoint] at he + exact congrArg Prod.fst he + +theorem targetTrack_fiber_polygon {U V : PolygonObject a} (f : U ⟶ V) + (i : Fin U.tracks) (j : Fin V.tracks) : + {z | ∃hz : z∈(U.cell i).val,(f.toEquiv ⟨(i,z),hz⟩).val.1=j}∈polygonAlgebra a := by + obtain ⟨s,hs,hcover⟩ := f.hasTable + have he : {z | ∃hz : z∈(U.cell i).val,(f.toEquiv ⟨(i,z),hz⟩).val.1=j} = + ⋃c∈s.filter (fun c => c.source=i ∧ c.target=j),c.domain.val := by + ext z + constructor + · rintro ⟨hz,hj⟩ + obtain ⟨c,hc,hz'⟩ := hcover ⟨(i,z),hz⟩ + exact Set.mem_iUnion₂.mpr ⟨c,Finset.mem_filter.mpr ⟨hc,hz'.1.symm, + (chart_target_track f c (hs c hc) ⟨(i,z),hz⟩ hz').symm.trans hj⟩,hz'.2⟩ + · intro hz + obtain ⟨c,hcf,hcz⟩ := Set.mem_iUnion₂.mp hz + obtain ⟨hcs,hci,hcj⟩ := Finset.mem_filter.mp hcf + obtain ⟨hz',hf⟩ := hs c hcs z hcz + subst i + exact ⟨hz',(chart_target_track f c (hs c hcs) ⟨(c.source,z),hz'⟩ ⟨rfl,hcz⟩).trans hcj⟩ + rw [he] + apply BooleanSubalgebra.biSup_mem (Finset.finite_toSet _) + intro c _ + exact c.domain.property + +abbrev ArrowLabel {U V : PolygonObject a} (f : U ⟶ V) := + Fin V.tracks × Set.range (pointShift f) + +noncomputable instance arrowLabel_fintype {U V : PolygonObject a} (f : U ⟶ V) : + Fintype (ArrowLabel f) := by + letI := (pointShift_finite_range f).fintype + exact inferInstance + +noncomputable def arrowLabel {U V : PolygonObject a} (f : U ⟶ V) (x : U.Point) : + ArrowLabel f := ⟨(f.toEquiv x).val.1,⟨pointShift f x,⟨x,rfl⟩⟩⟩ + +theorem arrowLabel_fiber_polygon {U V : PolygonObject a} (f : U ⟶ V) + (i : Fin U.tracks) (j : ArrowLabel f) : + {z | ∃hz : z∈(U.cell i).val,arrowLabel f ⟨(i,z),hz⟩=j}∈polygonAlgebra a := by + have he : {z | ∃hz : z∈(U.cell i).val,arrowLabel f ⟨(i,z),hz⟩=j} = + {z | ∃hz : z∈(U.cell i).val,(f.toEquiv ⟨(i,z),hz⟩).val.1=j.1} ∩ + {z | ∃hz : z∈(U.cell i).val,pointShift f ⟨(i,z),hz⟩=j.2.val} := by + ext z + constructor + · rintro ⟨hz,he⟩ + exact ⟨⟨hz,congrArg Prod.fst he⟩,⟨hz,congrArg (fun t => t.2.val) he⟩⟩ + · rintro ⟨⟨hz,ht⟩,⟨hz',hs⟩⟩ + exact ⟨hz,Prod.ext ht (Subtype.ext hs)⟩ + rw [he] + exact (polygonAlgebra a).inf_mem (targetTrack_fiber_polygon f i j.1) + (pointShift_fiber_polygon f i j.2.val) + +variable {κ : Type} [Fintype κ] {U : PolygonObject a} + {V : κ → PolygonObject a} + +noncomputable def diagramLabel (f : ∀k,U ⟶ V k) (x : U.Point) : + ∀k,ArrowLabel (f k) := fun k => arrowLabel (f k) x + +theorem diagramLabel_fiber_polygon (f : ∀k,U ⟶ V k) + (i : Fin U.tracks) (j : ∀k,ArrowLabel (f k)) : + {z | ∃hz : z∈(U.cell i).val,diagramLabel f ⟨(i,z),hz⟩=j}∈polygonAlgebra a := by + have he : {z | ∃hz : z∈(U.cell i).val,diagramLabel f ⟨(i,z),hz⟩=j} = + (U.cell i).val ∩ ⋂k : κ,{z | ∃hz : z∈(U.cell i).val,arrowLabel (f k) ⟨(i,z),hz⟩=j k} := by + ext z + constructor + · rintro ⟨hz,he⟩ + exact ⟨hz,Set.mem_iInter.mpr (fun k => ⟨hz,congrFun he k⟩)⟩ + · rintro ⟨hz,he⟩ + refine ⟨hz,?_⟩ + funext k + exact (Set.mem_iInter.mp he k).choose_spec + rw [he] + exact (polygonAlgebra a).inf_mem (U.cell i).property + (BooleanSubalgebra.iInf_mem (fun k => arrowLabel_fiber_polygon (f k) i (j k))) + +theorem exists_common_arrow_refinement (f : ∀k,U ⟶ V k) : + ∃ (W : PolygonObject a) (h : W ⟶ U), Positional h ∧ + ∃ (t : ∀k,Fin W.tracks → Fin (V k).tracks) + (d : κ → Fin W.tracks → CutRing × CutRing), + ∀k x,((h≫f k).toEquiv x).val= + (t k x.val.1,translate a (d k x.val.1) x.val.2) := by + let W := refinement U (diagramLabel f) (diagramLabel_fiber_polygon f) + let h := refinementArrow U (diagramLabel f) (diagramLabel_fiber_polygon f) + let lab (j : Fin W.tracks) := + ((Fintype.equivFin (Fin U.tracks × (∀k,ArrowLabel (f k)))).symm j).2 + refine ⟨W,h,refinementArrow_positional _ _ _, + (fun k j => (lab j k).1),(fun k j => (lab j k).2.val),?_⟩ + intro k x + have he := congrFun + (refinementArrow_label U (diagramLabel f) (diagramLabel_fiber_polygon f) x) k + apply Prod.ext + · change ((f k).toEquiv (h.toEquiv x)).val.1 = (lab x.val.1 k).1 + exact congrArg (fun t : ArrowLabel (f k) => t.1) he + · rw [arrow_comp_apply,pointShift_spec] + change translate a (pointShift (f k) (h.toEquiv x)) x.val.2 = _ + rw [show pointShift (f k) (h.toEquiv x)=(lab x.val.1 k).2.val from + congrArg (fun t => t.2.val) he] + +end PolygonObject +end PolygonDiagramRefinement + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/PolygonGridComparison.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/PolygonGridComparison.lean new file mode 100644 index 0000000000000000000000000000000000000000..b69a03f8f507ef440e778f7db8531aa9e824b5c2 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/PolygonGridComparison.lean @@ -0,0 +1,97 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Configurations.PolygonGrid + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section PolygonGridComparison +open Classical Set MeasureTheory Metric +namespace PolygonGrid + +instance : IsLocallyFiniteMeasure (Measure.count : Measure ℕ) where + finiteAtNhds n := ⟨{n}, (isOpen_discrete _).mem_nhds rfl, by simp⟩ + +instance : IsLocallyFiniteMeasure μ := by + unfold μ + infer_instance + +instance : Measure.OuterRegular μ := by + unfold μ + infer_instance + +instance : Measure.InnerRegularCompactLTTop μ := by + unfold μ + infer_instance + +@[simp] theorem volume_region (m : ℕ) : μ (region m)=m := by + have he : {i : ℕ | i < m}=(Finset.range m : Set ℕ) := by ext i; simp + simp only [μ,region,Measure.prod_prod,he,Measure.count_apply_finset,Finset.card_range] + simp + +theorem compact_closure {m : ℕ} {S : Set PlaneTracks} (hS : S⊆region m) : IsCompact (closure S) := by + let K : Set PlaneTracks := (Finset.range m : Set ℕ) ×ˢ Icc (0:ℝ) 1 ×ˢ Icc (0:ℝ) 1 + have hK : IsCompact K := (Finset.finite_toSet _).isCompact.prod (isCompact_Icc.prod isCompact_Icc) + apply hK.of_isClosed_subset isClosed_closure + apply hK.isClosed.closure_subset_iff.mpr + intro p hp + have h := hS hp + exact ⟨by simpa using h.1,⟨h.2.1.1,h.2.1.2.le⟩,⟨h.2.2.1,h.2.2.2.le⟩⟩ + +theorem strict_grid_comparison {m : ℕ} {S T : Set PlaneTracks} + (hS : S⊆region m) (hT : T⊆region m) + (hμ : μ (closure S) < μ (interior T)) : + ∃ δ : ℝ, 0 < δ ∧ ∀ε : ℝ, 0 < ε → ε < δ → + ∃ (N : ℕ) (I J : Finset (Index m N)), Nonempty (I ↪ J) ∧ + S⊆⋃i∈I,cell ε i ∧ ∀j∈J,cell ε j⊆T := by + obtain ⟨r,hrS,hrT⟩ := exists_between hμ + obtain ⟨O,hSO,hO,hOr⟩ := (closure S).exists_isOpen_lt_of_lt r hrS + have hfinite : μ (interior T)≠⊤ := by + apply ne_top_of_le_ne_top (by simp : μ (region m)≠⊤) + exact measure_mono (Set.Subset.trans interior_subset hT) + obtain ⟨K,hKT,hK,hrK⟩ := isOpen_interior.measurableSet.exists_lt_isCompact_of_ne_top hfinite hrT + obtain ⟨δS,hδS,hOS⟩ := (compact_closure hS).exists_thickening_subset_open hO hSO + obtain ⟨δK,hδK,hTK⟩ := hK.exists_thickening_subset_open isOpen_interior hKT + refine ⟨min δS δK,lt_min hδS hδK,fun ε hε hδ => ?_⟩ + let N : ℕ := ⌈1/ε⌉₊+1 + have hN : 1/ε < (N:ℝ) := by + have h := Nat.le_ceil (1/ε) + dsimp [N] + simp only [Nat.cast_add,Nat.cast_one] + linarith + let hits (A : Set PlaneTracks) : Finset (Index m N) := Finset.univ.filter (fun i => (cell ε i∩A).Nonempty) + have cover (A : Set PlaneTracks) (hA : A⊆region m) : A⊆⋃i∈hits A,cell ε i := by + intro p hp + obtain ⟨i,hi⟩ := Set.mem_iUnion.mp (region_covered hε hN (hA hp)) + exact Set.mem_iUnion₂.mpr ⟨i,Finset.mem_filter.mpr ⟨Finset.mem_univ _,p,hi,hp⟩,hi⟩ + have inO : (⋃i∈hits S,cell ε i)⊆O := by + intro p hp + obtain ⟨i,hi,hp⟩ := Set.mem_iUnion₂.mp hp + obtain ⟨q,hq,hqS⟩ := (Finset.mem_filter.mp hi).2 + apply hOS + rw [mem_thickening_iff] + exact ⟨q,subset_closure hqS,(cell_dist hε hp hq).trans (hδ.trans_le (min_le_left _ _))⟩ + have inT : ∀j∈hits K,cell ε j⊆T := by + intro j hj p hp + obtain ⟨q,hq,hqK⟩ := (Finset.mem_filter.mp hj).2 + apply interior_subset + apply hTK + rw [mem_thickening_iff] + exact ⟨q,hqK,(cell_dist hε hp hq).trans (hδ.trans_le (min_le_right _ _))⟩ + have hKregion : K⊆region m := Set.Subset.trans hKT (Set.Subset.trans interior_subset hT) + have hmass : μ (⋃i∈hits S,cell ε i) < μ (⋃j∈hits K,cell ε j) := + lt_of_le_of_lt (measure_mono inO) ((hOr.trans hrK).trans_le (measure_mono (cover K hKregion))) + exact ⟨N,hits S,hits K,matching_of_volume hε _ _ hmass,cover S hS,inT⟩ + +end PolygonGrid +end PolygonGridComparison + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/PolygonGridEmbedding.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/PolygonGridEmbedding.lean new file mode 100644 index 0000000000000000000000000000000000000000..1899d0f1a70c3c6b36d1dda35744898a82ba1bee --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/PolygonGridEmbedding.lean @@ -0,0 +1,167 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.TupleChartDomain +import OAI.GroupTheory.SimpleAmenable.Configurations.PolygonGroupoid +import OAI.GroupTheory.SimpleAmenable.Configurations.PolygonTrackArea + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section PolygonGridEmbedding +open Classical Set +namespace PolygonGrid + +noncomputable def rectangle (a : ℕ) (r : CutRing) (i j : ℕ) : polygonAlgebra a := + ⟨(halfPlane a 0 (r*(i+1)) ∩ (halfPlane a 0 (r*i))ᶜ) ∩ + (halfPlane a 1 (r*(j+1)) ∩ (halfPlane a 1 (r*j))ᶜ), + BooleanSubalgebra.inf_mem + (BooleanSubalgebra.inf_mem (halfPlane_mem _ _ _) (BooleanSubalgebra.compl_mem (halfPlane_mem _ _ _))) + (BooleanSubalgebra.inf_mem (halfPlane_mem _ _ _) (BooleanSubalgebra.compl_mem (halfPlane_mem _ _ _)))⟩ + +@[simp] theorem mem_rectangle (a : ℕ) (r : CutRing) (i j : ℕ) (x : GenericSquare a) : + x∈(rectangle a r i j).val ↔ + x.val.1∈interval (ordinary r) i ∧ x.val.2∈interval (ordinary r) j := by + simp only [rectangle,halfPlane,interval,Set.mem_inter_iff,Set.mem_compl_iff, + Set.mem_ofPred_eq,Set.mem_Ico,cutForm,Matrix.cons_val_zero,Matrix.cons_val_one, + map_mul,map_add,map_natCast,map_one,not_lt] + tauto + +noncomputable def displacement {m N : ℕ} (r : CutRing) (i j : Index m N) : CutRing×CutRing := + (r*((j.2.1.val:CutRing)-i.2.1.val),r*((j.2.2.val:CutRing)-i.2.2.val)) + +theorem displacement_mem_cell {m N : ℕ} (r : CutRing) (i j : Index m N) + {x : ℝ×ℝ} (hx : (i.1.val,x)∈cell (ordinary r) i) : + (j.1.val,x+(ordinary (displacement r i j).1,ordinary (displacement r i j).2))∈ + cell (ordinary r) j := by + refine ⟨rfl,?_,?_⟩ + · have hxi := hx.2.1 + change ordinary r*i.2.1.val ≤ x.1 ∧ x.1 < ordinary r*(i.2.1.val+1) at hxi + change ordinary r*j.2.1.val ≤ x.1+ordinary (displacement r i j).1 ∧ + x.1+ordinary (displacement r i j).1 < ordinary r*(j.2.1.val+1) + simp only [displacement,map_mul,map_sub,map_natCast] + constructor <;> nlinarith [hxi.1,hxi.2] + · have hxi := hx.2.2 + change ordinary r*i.2.2.val ≤ x.2 ∧ x.2 < ordinary r*(i.2.2.val+1) at hxi + change ordinary r*j.2.2.val ≤ x.2+ordinary (displacement r i j).2 ∧ + x.2+ordinary (displacement r i j).2 < ordinary r*(j.2.2.val+1) + simp only [displacement,map_mul,map_sub,map_natCast] + constructor <;> nlinarith [hxi.1,hxi.2] + +theorem translate_displacement_mem {a m N : ℕ} (r : CutRing) (i j : Index m N) + {x : GenericSquare a} (hx : (i.1.val,x.val)∈cell (ordinary r) i) + (hj : cell (ordinary r) j⊆region m) : + (j.1.val,(translate a (displacement r i j) x).val)∈cell (ordinary r) j := by + have hd := displacement_mem_cell r i j hx + have hs := hj hd + have he : (translate a (displacement r i j) x).val = + x.val+(ordinary (displacement r i j).1,ordinary (displacement r i j).2) := by + apply Prod.ext + · exact Int.fract_eq_self.mpr hs.2.1 + · exact Int.fract_eq_self.mpr hs.2.2 + rwa [he] + +theorem exists_grid_side {δ : ℝ} (hδ : 0 < δ) : + ∃ b : ℕ, 0 < ordinary (shrinkingLevel b) ∧ ordinary (shrinkingLevel b)<δ := by + have hp : 0 < Real.goldenRatio-1 := sub_pos.mpr Real.one_lt_goldenRatio + have hlt : Real.goldenRatio-1<1 := by linarith [Real.goldenRatio_lt_two] + obtain ⟨b,hb⟩ := exists_pow_lt_of_lt_one hδ hlt + refine ⟨b,(shrinkingLevel_bounds b).1,?_⟩ + rw [ordinary_shrinkingLevel,pow_succ] + exact (mul_le_of_le_one_right (pow_nonneg hp.le _) hlt.le).trans_lt hb + +end PolygonGrid +end PolygonGridEmbedding + +section PolygonStrictComparison +open Classical Set +namespace PolygonGrid + +theorem strict_comparison {a m : ℕ} (U V : Fin m → polygonAlgebra a) + (harea : (∑i,PolygonArea.area (U i)) < ∑i,PolygonArea.area (V i)) : + ∃ f : (PolygonObject.mk m U).Point ↪ (PolygonObject.mk m V).Point, + PolygonObject.HasTable f := by + let PU : PolygonObject a := ⟨m,U⟩ + let PV : PolygonObject a := ⟨m,V⟩ + obtain ⟨S,hS,heS,hcS,hiS⟩ := bank_representative U + obtain ⟨T,hT,heT,hcT,hiT⟩ := bank_representative V + have hh : MeasureTheory.Measure.count.prod ((MeasureTheory.volume : MeasureTheory.Measure ℝ).prod + MeasureTheory.volume) (closure S) < μ (interior T) := by + change μ (closure S)<μ (interior T) + rwa [hcS,hiT] + obtain ⟨δ,hδ,hmatch⟩ := strict_grid_comparison hS hT hh + obtain ⟨b,hr,hrδ⟩ := exists_grid_side hδ + let r := shrinkingLevel b + obtain ⟨N,I,J,⟨route⟩,hcover,hinto⟩ := hmatch (ordinary r) hr hrδ + have getsrc (p : PU.Point) : ∃i : I,(p.val.1.val,p.val.2.val)∈cell (ordinary r) i.val := by + have hs : (p.val.1.val,p.val.2.val)∈S := (heS p.val.1 p.val.2).mpr p.property + obtain ⟨i,hi,hp⟩ := Set.mem_iUnion₂.mp (hcover hs) + exact ⟨⟨i,hi⟩,hp⟩ + choose src hsrc using getsrc + have src_eq (p : PU.Point) (i : I) (hi : (p.val.1.val,p.val.2.val)∈cell (ordinary r) i.val) : + src p=i := by + apply Subtype.ext + by_contra hn + exact Set.disjoint_left.mp (cells_disjoint hr hn) (hsrc p) hi + let out (p : PU.Point) : TrackPoint a m := + ((route (src p)).val.1,translate a (displacement r (src p).val (route (src p)).val) p.val.2) + have houtCell (p : PU.Point) : ( (out p).1.val,(out p).2.val)∈ + cell (ordinary r) (route (src p)).val := by + apply translate_displacement_mem r _ _ ⟨rfl,(hsrc p).2⟩ + exact Set.Subset.trans (hinto _ (route (src p)).property) hT + have houtV (p : PU.Point) : (out p).2∈(V (out p).1).val := by + apply (heT _ _).mp + exact hinto _ (route (src p)).property (houtCell p) + have hout_inj : Function.Injective out := by + intro p q hpq + have ht : (route (src p)).val=(route (src q)).val := by + by_contra hn + exact Set.disjoint_left.mp (cells_disjoint hr hn) (houtCell p) + (by simpa only [hpq] using houtCell q) + have hs : src p=src q := route.injective (Subtype.ext ht) + have htrack : p.val.1=q.val.1 := by + apply Fin.ext + exact (hsrc p).1.trans (by simpa only [hs] using (hsrc q).1.symm) + have hpoint : p.val.2=q.val.2 := by + have he := congrArg Prod.snd hpq + change translate a (displacement r (src p).val (route (src p)).val) p.val.2 = + translate a (displacement r (src q).val (route (src q)).val) q.val.2 at he + rw [hs] at he + exact (translation a _).injective he + exact Subtype.ext (Prod.ext htrack hpoint) + let f : PU.Point ↪ PV.Point := + ⟨fun p => ⟨out p,houtV p⟩,fun _ _ h => hout_inj (congrArg Subtype.val h)⟩ + let chart (i : I) : PolygonObject.Chart (a:=a) m m := + ⟨i.val.1,(route i).val.1,displacement r i.val (route i).val, + U i.val.1 ⊓ rectangle a r i.val.2.1.val i.val.2.2.val⟩ + refine ⟨f,Finset.univ.image chart,?_,?_⟩ + · intro c hc + obtain ⟨i,-,rfl⟩ := Finset.mem_image.mp hc + intro x hx + change x∈(U i.val.1).val ∧ x∈(rectangle a r i.val.2.1.val i.val.2.2.val).val at hx + refine ⟨hx.1,?_⟩ + have hcell : (i.val.1.val,x.val)∈cell (ordinary r) i.val := + ⟨rfl,(mem_rectangle a r _ _ x).mp hx.2⟩ + have hs := src_eq ⟨(i.val.1,x),hx.1⟩ i hcell + change out ⟨(i.val.1,x),hx.1⟩ = ((route i).val.1,translate a (displacement r i.val (route i).val) x) + simp only [out,hs] + · intro p + refine ⟨chart (src p),Finset.mem_image.mpr ⟨src p,Finset.mem_univ _,rfl⟩,?_,?_⟩ + · exact Fin.ext (hsrc p).1 + · change p.val.2∈(U (src p).val.1).val ∧ + p.val.2∈(rectangle a r (src p).val.2.1.val (src p).val.2.2.val).val + refine ⟨?_,(mem_rectangle a r _ _ _).mpr (hsrc p).2⟩ + have ht : p.val.1=(src p).val.1 := Fin.ext (hsrc p).1 + simpa only [←ht] using p.property + +end PolygonGrid +end PolygonStrictComparison + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/PolygonMatchingLaw.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/PolygonMatchingLaw.lean new file mode 100644 index 0000000000000000000000000000000000000000..bcd4ad7675154aa7d76a45b83bd718ce4027cb82 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/PolygonMatchingLaw.lean @@ -0,0 +1,101 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Amenability.SuccessfulLawCovariance + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section PolygonMatchingLaw +open Classical MeasureTheory Filter Set +open scoped Topology + +theorem matchingLaw_finite_weights {X : Type*} [MeasurableSpace X] [MeasurableSingletonClass X] + {a m : ℕ} (μ : Measure X) [IsProbabilityMeasure μ] (T : Finset X) + (hT : ∀ᵐx ∂μ,x∈T) (P : X → TrackPolygonPartition a m) : + ∃(S : Finset (polygonFullGroup a m)) (p : polygonFullGroup a m → ℝ), + (∀g,0 ≤ p g) ∧ (∀g∉S,p g=0) ∧ (∑g∈S,p g)=1 ∧ + ∀f : polygonFullGroup a m → ℝ,(∑g∈S,p g*f g)=∫x,matchingAverage (P x) f ∂μ := by + have hmass : (∑x∈T,μ.real {x})=1 := by + have hh := integral_of_finite_support μ T hT (fun _ => (1:ℝ)) + simpa using hh.symm + obtain ⟨S,p,hp,hs,hm,ht⟩ := finite_uniform_mixture T (fun x => μ.real {x}) + (fun x => matchingSupport (P x)) (fun _ _ => measureReal_nonneg) hmass + (fun x _ => matchingSupport_nonempty (P x)) + refine ⟨S,p,hp,hs,hm,?_⟩ + intro f + rw [integral_of_finite_support μ T hT] + exact ht f + +namespace BarrierMenu +variable {a m : ℕ} {ha : 0 < a} {F : Finset (polygonFullGroup a m)} (M : BarrierMenu a m ha F) + +theorem matching_expectation_covariance {η κ : ℝ} {n : ℕ} + (hQ : M.Q < sourceDyadicN n) (hB : M.B ≤ sourceDyadicN n) + (g : polygonFullGroup a m) (hg : g∈F) {δ : ℝ} + (hc : ObservableClose (jointBitFieldLaw (a:=a) (m:=m) (barrierEightDirections ha) + M.signals.eight (commonVertexDenominator_pos ha) η κ n) + ((jointBitFieldLaw (a:=a) (m:=m) (barrierEightDirections ha) M.signals.eight + (commonVertexDenominator_pos ha) η κ n).map (barrierBitsTransport g)) δ) + (f : polygonFullGroup a m → ℝ) (hf : ∀x,f x∈Icc (0:ℝ) 1) : + let μ := jointBitFieldLaw (a:=a) (m:=m) (barrierEightDirections ha) M.signals.eight + (commonVertexDenominator_pos ha) η κ n + |(∫b,matchingAverage (M.signals.sampledPartition n b) f ∂μ)- + (∫b,matchingAverage (M.signals.sampledPartition n b) (fun x => f (g*x)) ∂μ)| ≤ + 2*μ.real {b | ¬jointFieldSuccess (barrierEightDirections ha) M.signals.eight n b}+2*δ := by + dsimp only + obtain ⟨T,hT⟩ := jointBitFieldLaw_finite_support (a:=a) (m:=m) (barrierEightDirections ha) + M.signals.eight M.signals.eight_q (commonVertexDenominator_pos ha) η κ n + apply successful_law_covariance _ T hT (barrierBitsTransport g) + (jointBitReindex_measurable _ _ g) + {b | jointFieldSuccess (barrierEightDirections ha) M.signals.eight n b} + (jointFieldSuccess_measurable _ _ n) hc + (fun b => matchingAverage (M.signals.sampledPartition n b) f) + (fun b => matchingAverage (M.signals.sampledPartition n b) (fun x => f (g*x))) + (fun b => matchingAverage_range _ hf) + (fun b => matchingAverage_range _ (fun x => hf (g*x))) + intro b hb hb' + exact matchingAverage_transport (M.sampledPartition_arrow (sourceDyadicN_one_le n) hQ hB g hg b hb hb') f + +end BarrierMenu + +theorem polygonFullGroup_finiteTestReiter {a m : ℕ} (ha : 0 < a) : + FiniteTestReiter (polygonFullGroup a m) := by + intro F ε hε + obtain ⟨M⟩ := exists_barrierMenu ha F + obtain ⟨η,κ,hη,hη₁,hκ,ht⟩ := jointBitFieldLaw_transport (a:=a) (m:=m) + (barrierEightDirections ha) M.signals.eight (commonVertexDenominator_pos ha) F + (show 0 < ε/8 by linarith) + let μ (n : ℕ) := jointBitFieldLaw (a:=a) (m:=m) (barrierEightDirections ha) M.signals.eight + (commonVertexDenominator_pos ha) η κ n + have hs : ∀ᶠn : ℕ in atTop,(μ n).real + {b | ¬jointFieldSuccess (barrierEightDirections ha) M.signals.eight n b} < ε/8 := + (jointBitFieldLaw_success (a:=a) (m:=m) (barrierEightDirections ha) M.signals.eight + (commonVertexDenominator_pos ha) hη hκ).eventually (gt_mem_nhds (by linarith)) + have hscale : ∀ᶠn : ℕ in atTop,M.Q < sourceDyadicN n ∧ M.B ≤ sourceDyadicN n := by + filter_upwards [sourceDyadic_radius_eventually (max (M.Q+1) M.B)] with n hn + have hnN : (2:ℝ)^n ≤ sourceDyadicN n := by + unfold sourceDyadicN + exact pow_le_pow_right₀ (by norm_num) (by omega) + exact ⟨lt_of_lt_of_le (by linarith [(le_max_left (M.Q+1) M.B).trans hn]) hnN, + ((le_max_right (M.Q+1) M.B).trans hn).trans hnN⟩ + obtain ⟨n,hn,hsn,hN⟩ := (ht.and (hs.and hscale)).exists + obtain ⟨T,hT⟩ := jointBitFieldLaw_finite_support (a:=a) (m:=m) (barrierEightDirections ha) + M.signals.eight M.signals.eight_q (commonVertexDenominator_pos ha) η κ n + obtain ⟨S,p,hp,hsupp,hm,havg⟩ := matchingLaw_finite_weights (μ n) T hT (M.signals.sampledPartition n) + refine ⟨S,p,hp,hsupp,hm,?_⟩ + intro g hg f hf + rw [havg,havg] + have hh := M.matching_expectation_covariance hN.1 hN.2 g hg (hn g hg) f hf + exact hh.trans (by change 2*(μ n).real _+2*(ε/8) ≤ ε; linarith) + +end PolygonMatchingLaw + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/PolygonObjectRefinement.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/PolygonObjectRefinement.lean new file mode 100644 index 0000000000000000000000000000000000000000..dbd2b8e334aed8669c410213a5a3e2a5ca1111b0 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/PolygonObjectRefinement.lean @@ -0,0 +1,128 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.PairLawAssembly +import OAI.GroupTheory.SimpleAmenable.Configurations.PolygonGroupoid + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section PolygonObjectRefinement + +open Classical CategoryTheory Set +namespace PolygonObject +variable {a : ℕ} + +noncomputable def shifted (U : PolygonObject a) (d : Fin U.tracks → CutRing × CutRing) : + PolygonObject a := ⟨U.tracks,fun i => ⟨translation a (d i) '' (U.cell i).val, + polygon_image_translation _ (U.cell i).property⟩⟩ + +noncomputable def shiftEquiv (U : PolygonObject a) (d : Fin U.tracks → CutRing × CutRing) : + U.Point ≃ (shifted U d).Point where + toFun x := ⟨(x.val.1,translate a (d x.val.1) x.val.2),⟨x.val.2,x.property,rfl⟩⟩ + invFun y := ⟨(y.val.1,translate a (-d y.val.1) y.val.2),by + obtain ⟨x,hx,he⟩ := y.property + change translate a (-d y.val.1) y.val.2∈(U.cell y.val.1).val + rw [←he] + simpa only [translation_apply,←translate_add,neg_add_cancel,translate_zero] using hx⟩ + left_inv x := by + apply Subtype.ext + exact Prod.ext rfl (by + change translate a (-d x.val.1) (translate a (d x.val.1) x.val.2)=x.val.2 + rw [←translate_add,neg_add_cancel,translate_zero]) + right_inv y := by + apply Subtype.ext + exact Prod.ext rfl (by + change translate a (d y.val.1) (translate a (-d y.val.1) y.val.2)=y.val.2 + rw [←translate_add,add_neg_cancel,translate_zero]) + +noncomputable def shiftArrow (U : PolygonObject a) (d : Fin U.tracks → CutRing × CutRing) : + U ⟶ shifted U d where + toEquiv := shiftEquiv U d + hasTable := by + let c : Fin U.tracks → Chart (a:=a) U.tracks U.tracks := fun i => ⟨i,i,d i,U.cell i⟩ + refine ⟨Finset.univ.image c,?_,?_⟩ + · intro k hk + obtain ⟨i,_,rfl⟩ := Finset.mem_image.mp hk + intro x hx + exact ⟨hx,rfl⟩ + · intro x + exact ⟨c x.val.1,Finset.mem_image.mpr ⟨_,Finset.mem_univ _,rfl⟩,rfl,x.property⟩ + +@[simp] theorem shiftArrow_apply (U : PolygonObject a) (d : Fin U.tracks → CutRing × CutRing) + (x : U.Point) : (shiftArrow U d).toEquiv x= + ⟨(x.val.1,translate a (d x.val.1) x.val.2),⟨x.val.2,x.property,rfl⟩⟩ := rfl + +variable {κ : Type} [Fintype κ] + +noncomputable def refinement (U : PolygonObject a) (label : U.Point → κ) + (hpoly : ∀i k,{z | ∃hz : z∈(U.cell i).val,label ⟨(i,z),hz⟩=k}∈polygonAlgebra a) : + PolygonObject a := + ⟨Fintype.card (Fin U.tracks × κ),fun j => + let ik := (Fintype.equivFin (Fin U.tracks × κ)).symm j + ⟨{z | ∃hz : z∈(U.cell ik.1).val,label ⟨(ik.1,z),hz⟩=ik.2},hpoly ik.1 ik.2⟩⟩ + +noncomputable def refinementEquiv (U : PolygonObject a) (label : U.Point → κ) + (hpoly : ∀i k,{z | ∃hz : z∈(U.cell i).val,label ⟨(i,z),hz⟩=k}∈polygonAlgebra a) : + (refinement U label hpoly).Point ≃ U.Point where + toFun x := + ⟨(((Fintype.equivFin (Fin U.tracks × κ)).symm x.val.1).1,x.val.2),x.property.choose⟩ + invFun y := ⟨((Fintype.equivFin _) (y.val.1,label y),y.val.2),by + change ∃hz : _∈(U.cell _).val,label ⟨(_,y.val.2),hz⟩=_ + simp only [Equiv.symm_apply_apply] + exact ⟨y.property,True.intro⟩⟩ + left_inv x := by + apply Subtype.ext + change ((Fintype.equivFin (Fin U.tracks × κ)) + (((Fintype.equivFin (Fin U.tracks × κ)).symm x.val.1).1, + label ⟨(((Fintype.equivFin (Fin U.tracks × κ)).symm x.val.1).1,x.val.2),x.property.choose⟩),x.val.2)= + (x.val.1,x.val.2) + apply Prod.ext + · apply (Fintype.equivFin (Fin U.tracks × κ)).symm.injective + simp only [Equiv.symm_apply_apply] + exact Prod.ext rfl x.property.choose_spec + · rfl + right_inv y := by + apply Subtype.ext + exact Prod.ext (by simp) rfl + +noncomputable def refinementArrow (U : PolygonObject a) (label : U.Point → κ) + (hpoly : ∀i k,{z | ∃hz : z∈(U.cell i).val,label ⟨(i,z),hz⟩=k}∈polygonAlgebra a) : + refinement U label hpoly ⟶ U where + toEquiv := refinementEquiv U label hpoly + hasTable := by + let V := refinement U label hpoly + let c : Fin V.tracks → Chart (a:=a) V.tracks U.tracks := fun j => + ⟨j,((Fintype.equivFin (Fin U.tracks × κ)).symm j).1,0,V.cell j⟩ + refine ⟨Finset.univ.image c,?_,?_⟩ + · intro k hk + obtain ⟨j,_,rfl⟩ := Finset.mem_image.mp hk + intro x hx + refine ⟨hx,?_⟩ + change (((Fintype.equivFin (Fin U.tracks × κ)).symm j).1,x)= + (((Fintype.equivFin (Fin U.tracks × κ)).symm j).1,translate a 0 x) + rw [translate_zero] + · intro x + exact ⟨c x.val.1,Finset.mem_image.mpr ⟨_,Finset.mem_univ _,rfl⟩,rfl,x.property⟩ + +theorem refinementArrow_positional (U : PolygonObject a) (label : U.Point → κ) + (hpoly : ∀i k,{z | ∃hz : z∈(U.cell i).val,label ⟨(i,z),hz⟩=k}∈polygonAlgebra a) : + Positional (refinementArrow U label hpoly) := fun _ => rfl + +theorem refinementArrow_label (U : PolygonObject a) (label : U.Point → κ) + (hpoly : ∀i k,{z | ∃hz : z∈(U.cell i).val,label ⟨(i,z),hz⟩=k}∈polygonAlgebra a) + (x : (refinement U label hpoly).Point) : + label ((refinementArrow U label hpoly).toEquiv x)= + ((Fintype.equivFin (Fin U.tracks × κ)).symm x.val.1).2 := x.property.choose_spec + +end PolygonObject +end PolygonObjectRefinement + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/PolygonObjectSum.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/PolygonObjectSum.lean new file mode 100644 index 0000000000000000000000000000000000000000..733164a98484a24a8e61670712f5dfad31bb8c68 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/PolygonObjectSum.lean @@ -0,0 +1,200 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Configurations.PolygonGroupoidTracks + +namespace OAI + +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +section PolygonObjectSum + +open Classical Set CategoryTheory +namespace PolygonObject +variable {a : ℕ} + +@[simp] theorem arrow_id_apply (U : PolygonObject a) (x : U.Point) : (𝟙 U : U ⟶ U).toEquiv x=x := rfl +@[simp] theorem arrow_comp_apply {U V W : PolygonObject a} (f : U ⟶ V) (g : V ⟶ W) (x : U.Point) : + (f≫g).toEquiv x=g.toEquiv (f.toEquiv x) := rfl + +noncomputable def sum (U V : PolygonObject a) : PolygonObject a := + ⟨U.tracks+V.tracks,Fin.addCases U.cell V.cell⟩ + +noncomputable def sumPointEquiv (U V : PolygonObject a) : + U.Point ⊕ V.Point ≃ (sum U V).Point where + toFun := Sum.elim + (fun x => ⟨(x.val.1.castAdd V.tracks,x.val.2),by simpa [sum] using x.property⟩) + (fun x => ⟨(x.val.1.natAdd U.tracks,x.val.2),by simpa [sum] using x.property⟩) + invFun x := Fin.addCases (motive:=fun i => x.val.2∈((sum U V).cell i).val → U.Point ⊕ V.Point) + (fun i => fun h : x.val.2∈((sum U V).cell (i.castAdd V.tracks)).val => + Sum.inl ⟨(i,x.val.2),by simpa [sum] using h⟩) + (fun i => fun h : x.val.2∈((sum U V).cell (i.natAdd U.tracks)).val => + Sum.inr ⟨(i,x.val.2),by simpa [sum] using h⟩) x.val.1 x.property + left_inv x := by cases x <;> simp + right_inv x := by + obtain ⟨⟨i,x⟩,hx⟩ := x + induction i using Fin.addCases <;> simp + +@[simp] theorem sumPointEquiv_inl (U V : PolygonObject a) (x : U.Point) : + (sumPointEquiv U V (.inl x)).val=(x.val.1.castAdd V.tracks,x.val.2) := rfl +@[simp] theorem sumPointEquiv_inr (U V : PolygonObject a) (x : V.Point) : + (sumPointEquiv U V (.inr x)).val=(x.val.1.natAdd U.tracks,x.val.2) := rfl + +theorem positional_hasTable {U V : PolygonObject a} (f : U.Point → V.Point) + (hf : ∀x,(f x).val.2=x.val.2) + (hpoly : ∀i j,{x : GenericSquare a | ∃hx : x∈(U.cell i).val, + (f ⟨(i,x),hx⟩).val.1=j} ∈ polygonAlgebra a) : HasTable f := by + let c : Fin U.tracks × Fin V.tracks → Chart (a:=a) U.tracks V.tracks := + fun ij => ⟨ij.1,ij.2,0,⟨_,hpoly ij.1 ij.2⟩⟩ + refine ⟨Finset.univ.image c,?_,?_⟩ + · intro d hd + obtain ⟨⟨i,j⟩,_,rfl⟩ := Finset.mem_image.mp hd + rintro x ⟨hx,hj⟩ + refine ⟨hx,?_⟩ + apply Prod.ext hj + exact (hf ⟨(i,x),hx⟩).trans (translate_zero a x).symm + · intro x + refine ⟨c (x.val.1,(f x).val.1),Finset.mem_image.mpr ⟨_,Finset.mem_univ _,rfl⟩,rfl,?_⟩ + exact ⟨x.property,rfl⟩ + +noncomputable def sumArrow {U V W Z : PolygonObject a} (f : U ⟶ W) (g : V ⟶ Z) : + sum U V ⟶ sum W Z where + toEquiv := (sumPointEquiv U V).symm.trans ((Equiv.sumCongr f.toEquiv g.toEquiv).trans (sumPointEquiv W Z)) + hasTable := by + obtain ⟨s,hs,hcover⟩ := f.hasTable + obtain ⟨t,ht,htcover⟩ := g.hasTable + let L : Chart (a:=a) U.tracks W.tracks → Chart (a:=a) (U.tracks+V.tracks) (W.tracks+Z.tracks) := + fun c => ⟨c.source.castAdd V.tracks,c.target.castAdd Z.tracks,c.shift,c.domain⟩ + let R : Chart (a:=a) V.tracks Z.tracks → Chart (a:=a) (U.tracks+V.tracks) (W.tracks+Z.tracks) := + fun c => ⟨c.source.natAdd U.tracks,c.target.natAdd W.tracks,c.shift,c.domain⟩ + refine ⟨s.image L ∪ t.image R,?_,?_⟩ + · intro c hc + rcases Finset.mem_union.mp hc with hc|hc + · obtain ⟨d,hd,rfl⟩ := Finset.mem_image.mp hc + intro x hx + obtain ⟨hu,he⟩ := hs d hd x hx + refine ⟨by simpa [sum,L] using hu,?_⟩ + change (sumPointEquiv W Z (Equiv.sumCongr f.toEquiv g.toEquiv + ((sumPointEquiv U V).symm (sumPointEquiv U V (.inl ⟨(d.source,x),hu⟩))))).val=_ + rw [Equiv.symm_apply_apply] + change (sumPointEquiv W Z (.inl (f.toEquiv ⟨(d.source,x),hu⟩))).val=_ + rw [sumPointEquiv_inl,he] + rfl + · obtain ⟨d,hd,rfl⟩ := Finset.mem_image.mp hc + intro x hx + obtain ⟨hv,he⟩ := ht d hd x hx + refine ⟨by simpa [sum,R] using hv,?_⟩ + change (sumPointEquiv W Z (Equiv.sumCongr f.toEquiv g.toEquiv + ((sumPointEquiv U V).symm (sumPointEquiv U V (.inr ⟨(d.source,x),hv⟩))))).val=_ + rw [Equiv.symm_apply_apply] + change (sumPointEquiv W Z (.inr (g.toEquiv ⟨(d.source,x),hv⟩))).val=_ + rw [sumPointEquiv_inr,he] + rfl + · intro x + obtain ⟨y,rfl⟩ := (sumPointEquiv U V).surjective x + cases y with + | inl y => + obtain ⟨c,hc,hy⟩ := hcover y + exact ⟨L c,Finset.mem_union_left _ (Finset.mem_image_of_mem L hc), + congrArg (Fin.castAdd V.tracks) hy.1,hy.2⟩ + | inr y => + obtain ⟨c,hc,hy⟩ := htcover y + exact ⟨R c,Finset.mem_union_right _ (Finset.mem_image_of_mem R hc), + congrArg (Fin.natAdd U.tracks) hy.1,hy.2⟩ + +@[simp] theorem sumArrow_inl {U V W Z : PolygonObject a} (f : U ⟶ W) (g : V ⟶ Z) (x : U.Point) : + (sumArrow f g).toEquiv (sumPointEquiv U V (.inl x))=sumPointEquiv W Z (.inl (f.toEquiv x)) := by + change sumPointEquiv W Z (Equiv.sumCongr f.toEquiv g.toEquiv ((sumPointEquiv U V).symm (sumPointEquiv U V (.inl x))))=_ + rw [Equiv.symm_apply_apply];rfl +@[simp] theorem sumArrow_inr {U V W Z : PolygonObject a} (f : U ⟶ W) (g : V ⟶ Z) (x : V.Point) : + (sumArrow f g).toEquiv (sumPointEquiv U V (.inr x))=sumPointEquiv W Z (.inr (g.toEquiv x)) := by + change sumPointEquiv W Z (Equiv.sumCongr f.toEquiv g.toEquiv ((sumPointEquiv U V).symm (sumPointEquiv U V (.inr x))))=_ + rw [Equiv.symm_apply_apply];rfl + +theorem sumArrow_id (U V : PolygonObject a) : sumArrow (𝟙 U) (𝟙 V)=𝟙 (sum U V) := by + apply Arrow.ext;apply Equiv.ext;intro x + obtain ⟨y,rfl⟩ := (sumPointEquiv U V).surjective x + cases y <;> simp + +theorem sumArrow_comp {U U' U'' V V' V'' : PolygonObject a} + (f : U ⟶ U') (f' : U' ⟶ U'') (g : V ⟶ V') (g' : V' ⟶ V'') : + sumArrow (f≫f') (g≫g')=sumArrow f g ≫ sumArrow f' g' := by + apply Arrow.ext;apply Equiv.ext;intro x + obtain ⟨y,rfl⟩ := (sumPointEquiv U V).surjective x + cases y <;> simp only [arrow_comp_apply,sumArrow_inl,sumArrow_inr] + +end PolygonObject +end PolygonObjectSum + +open Classical Set CategoryTheory +namespace PolygonObject +variable {a : ℕ} + +noncomputable def complement (U : PolygonObject a) : PolygonObject a := + ⟨U.tracks,fun i => (U.cell i)ᶜ⟩ + +noncomputable def splitPointEquiv (U : PolygonObject a) : + U.Point ⊕ (complement U).Point ≃ TrackPoint a U.tracks where + toFun := Sum.elim Subtype.val Subtype.val + invFun x := if hx : x.2∈(U.cell x.1).val then .inl ⟨x,hx⟩ else .inr ⟨x,hx⟩ + left_inv := by + rintro (x|x) + · dsimp only + exact dite_eq_left x.property + · dsimp only + exact dite_eq_right x.property + right_inv x := by dsimp;split <;> rfl + +@[simp] theorem splitPointEquiv_inl (U : PolygonObject a) (x : U.Point) : + splitPointEquiv U (.inl x)=x.val := rfl +@[simp] theorem splitPointEquiv_inr (U : PolygonObject a) (x : (complement U).Point) : + splitPointEquiv U (.inr x)=x.val := rfl + +noncomputable def complementArrow (U : PolygonObject a) : sum U (complement U) ⟶ standard a U.tracks where + toEquiv := (sumPointEquiv U (complement U)).symm.trans ((splitPointEquiv U).trans (standardPointEquiv a U.tracks).symm) + hasTable := by + let L (i : Fin U.tracks) : Chart (a:=a) (U.tracks+U.tracks) U.tracks := ⟨i.castAdd _,i,0,U.cell i⟩ + let R (i : Fin U.tracks) : Chart (a:=a) (U.tracks+U.tracks) U.tracks := ⟨i.natAdd _,i,0,(U.cell i)ᶜ⟩ + refine ⟨Finset.univ.image L ∪ Finset.univ.image R,?_,?_⟩ + · intro c hc + rcases Finset.mem_union.mp hc with hc|hc + · obtain ⟨i,_,rfl⟩ := Finset.mem_image.mp hc + intro x hx + refine ⟨by simpa [sum,complement,L] using hx,?_⟩ + change (splitPointEquiv U ((sumPointEquiv U (complement U)).symm + (sumPointEquiv U (complement U) (.inl ⟨(i,x),hx⟩))))=(i,translate a 0 x) + rw [Equiv.symm_apply_apply,splitPointEquiv_inl,translate_zero] + · obtain ⟨i,_,rfl⟩ := Finset.mem_image.mp hc + intro x hx + refine ⟨(sumPointEquiv U (complement U) (.inr ⟨(i,x),hx⟩)).property,?_⟩ + change (splitPointEquiv U ((sumPointEquiv U (complement U)).symm + (sumPointEquiv U (complement U) (.inr ⟨(i,x),hx⟩))))=(i,translate a 0 x) + rw [Equiv.symm_apply_apply,splitPointEquiv_inr,translate_zero] + rfl + · intro x + obtain ⟨y,rfl⟩ := (sumPointEquiv U (complement U)).surjective x + cases y with + | inl y => exact ⟨L y.val.1,Finset.mem_union_left _ (Finset.mem_image_of_mem L (Finset.mem_univ _)),rfl,y.property⟩ + | inr y => exact ⟨R y.val.1,Finset.mem_union_right _ (Finset.mem_image_of_mem R (Finset.mem_univ _)),rfl,y.property⟩ + +@[simp] theorem complementArrow_inl (U : PolygonObject a) (x : U.Point) : + ((complementArrow U).toEquiv (sumPointEquiv U (complement U) (.inl x))).val=x.val := by + change splitPointEquiv U ((sumPointEquiv U (complement U)).symm (sumPointEquiv U (complement U) (.inl x)))=x.val + rw [Equiv.symm_apply_apply];rfl +@[simp] theorem complementArrow_inr (U : PolygonObject a) (x : (complement U).Point) : + ((complementArrow U).toEquiv (sumPointEquiv U (complement U) (.inr x))).val=x.val := by + change splitPointEquiv U ((sumPointEquiv U (complement U)).symm (sumPointEquiv U (complement U) (.inr x)))=x.val + rw [Equiv.symm_apply_apply];rfl + +theorem complementArrow_positional (U : PolygonObject a) : Positional (complementArrow U) := by + intro x + obtain ⟨y,rfl⟩ := (sumPointEquiv U (complement U)).surjective x + cases y <;> simp only [complementArrow_inl,complementArrow_inr,sumPointEquiv_inl,sumPointEquiv_inr] + +noncomputable def complementIso (U : PolygonObject a) : sum U (complement U) ≅ standard a U.tracks := + asIso (complementArrow U) + +end PolygonObject + +end SimpleAmenable + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/PolygonPiecewiseSlots.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/PolygonPiecewiseSlots.lean new file mode 100644 index 0000000000000000000000000000000000000000..9837e2b3823a4490fe37857805f1fee07520239b --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/PolygonPiecewiseSlots.lean @@ -0,0 +1,175 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Configurations.PolygonPlacementArea + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section PolygonPiecewiseSlots + +open Classical Set +namespace PolygonArea + +@[simp] theorem val_finset_inf {a : ℕ} {ι : Type*} (s : Finset ι) (f : ι → polygonAlgebra a) : + (s.inf f).val=⋂i∈s,(f i).val := by + induction s using Finset.induction_on with + | empty => simp + | @insert i s hi ih => simp [Finset.inf_insert,BooleanSubalgebra.val_inf,ih] + +end PolygonArea +namespace PolygonObject + +noncomputable def whole (a m : ℕ) : PolygonObject a := ⟨m,fun _ => ⊤⟩ + +theorem intoWhole_hasTable {a : ℕ} {U V : PolygonObject a} {f : U.Point → V.Point} + (hf : HasTable f) : + HasTable (fun x => (⟨(f x).val,by trivial⟩ : (whole a V.tracks).Point)) := hf + +end PolygonObject +namespace PolygonPiecewise +variable {a m n : ℕ} + +theorem even_slots (U : PolygonObject a) (f : Fin n → U.Point → TrackPoint a m) + (hf : Function.Injective (fun p : Fin n × U.Point => f p.1 p.2)) + (ht : ∀i, PolygonObject.HasTable + (fun x => (⟨f i x,by trivial⟩ : (PolygonObject.whole a m).Point))) + (σ : Equiv.Perm (Fin n)) (hσ : σ∈alternatingGroup (Fin n)) : + ∃g : polygonAlternatingGroup a m, + (∀i x,g.val.val (f i x)=f (σ i) x) ∧ + (∀y∉Set.range (fun p : Fin n × U.Point => f p.1 p.2),g.val.val y=y) := by + change ∀i, ∃S : Finset (PolygonObject.Chart U.tracks m), + (∀c∈S,c.Holds (fun x => (⟨f i x,by trivial⟩ : (PolygonObject.whole a m).Point))) ∧ + (∀x : U.Point, ∃c∈S,c.Contains (V:=PolygonObject.whole a m) x) at ht + choose S hS hcover using ht + let C := ∀i : Fin n,{c : PolygonObject.Chart U.tracks m // c∈S i} + let D (r : Fin U.tracks) (c : C) : polygonAlgebra a := + U.cell r ⊓ Finset.univ.inf (fun i => if (c i).val.source=r then (c i).val.domain else ⊥) + have memD (r : Fin U.tracks) (c : C) (x : GenericSquare a) : + x∈(D r c).val ↔ x∈(U.cell r).val ∧ ∀i,(c i).val.source=r ∧ x∈(c i).val.domain.val := by + simp only [D,BooleanSubalgebra.val_inf,PolygonArea.val_finset_inf] + constructor + · rintro ⟨hx,hc⟩ + refine ⟨hx,fun i => ?_⟩ + have h := Set.mem_iInter₂.mp hc i (Finset.mem_univ i) + split_ifs at h with hi + · exact ⟨hi,h⟩ + · exact False.elim h + · rintro ⟨hx,hc⟩ + exact ⟨hx,Set.mem_iInter₂.mpr (fun i _ => by simp only [(hc i).1,ite_true];exact (hc i).2)⟩ + have covD (r : Fin U.tracks) (x : GenericSquare a) (hx : x∈(U.cell r).val) : + ∃c : C,x∈(D r c).val := by + have hc (i : Fin n) : ∃c : {c : PolygonObject.Chart U.tracks m // c∈S i}, + c.val.source=r ∧ x∈c.val.domain.val := by + obtain ⟨c,hc,hh⟩ := hcover i ⟨(r,x),hx⟩ + exact ⟨⟨c,hc⟩,hh.1.symm,hh.2⟩ + choose c hc using hc + exact ⟨c,(memD r c x).mpr ⟨hx,hc⟩⟩ + have hp (r : Fin U.tracks) := Fintype.exists_disjointed_le (D r) + choose P hP hSup hdis using hp + have coverP (r : Fin U.tracks) (x : GenericSquare a) (hx : x∈(U.cell r).val) : + ∃c : C,x∈(P r c).val := by + obtain ⟨c,hc⟩ := covD r x hx + have he := congrArg (fun Q : polygonAlgebra a => Q.val) (hSup r) + simp only [PolygonArea.val_finset_sup,Finset.mem_univ,Set.iUnion_true] at he + have hh : x∈⋃c,(D r c).val := Set.mem_iUnion.mpr ⟨c,hc⟩ + rw [←he] at hh + exact Set.mem_iUnion.mp hh + let J := Fin U.tracks × C + let cell (j : J) := P j.1 j.2 + let member (j : J) (p : U.Point) : Prop := p.val.1=j.1 ∧ p.val.2∈(cell j).val + have cell_sub (j : J) : (cell j).val⊆(U.cell j.1).val := + fun x hx => ((memD j.1 j.2 x).mp (hP j.1 j.2 hx)).1 + have member_unique (j l : J) (p : U.Point) (hj : member j p) (hl : member l p) : j=l := by + have hr : j.1=l.1 := hj.1.symm.trans hl.1 + apply Prod.ext hr + by_contra hc + have h : Disjoint (P j.1 j.2) (P j.1 l.2) := hdis j.1 hc + rw [disjoint_iff] at h + have he := congrArg (fun Q : polygonAlgebra a => Q.val) h + have hh : p.val.2∈(P j.1 j.2 ⊓ P j.1 l.2).val := ⟨hj.2,by simpa only [hr] using hl.2⟩ + rw [he] at hh + exact hh + let slots (j : J) (i : Fin n) : Fin m × (CutRing×CutRing) := ((j.2 i).val.target,(j.2 i).val.shift) + have chart_eq (j : J) (i : Fin n) (x : (cell j).val) : + f i ⟨(j.1,x.val),cell_sub j x.property⟩=SlotMap a m (cell j) (slots j) (i,x) := by + have hd := (memD j.1 j.2 x.val).mp (hP j.1 j.2 x.property) + obtain ⟨hu,he⟩ := hS i (j.2 i).val (j.2 i).property x.val (hd.2 i).2 + have hx : (⟨((j.2 i).val.source,x.val),hu⟩ : U.Point)= + ⟨(j.1,x.val),cell_sub j x.property⟩ := Subtype.ext (Prod.ext (hd.2 i).1 rfl) + change f i ⟨((j.2 i).val.source,x.val),hu⟩=SlotMap a m (cell j) (slots j) (i,x) at he + rwa [hx] at he + have slot_inj (j : J) : Function.Injective (SlotMap a m (cell j) (slots j)) := by + rintro ⟨i,x⟩ ⟨l,y⟩ h + rw [←chart_eq j i x,←chart_eq j l y] at h + have hh := @hf (i,⟨(j.1,x.val),cell_sub j x.property⟩) + (l,⟨(j.1,y.val),cell_sub j y.property⟩) h + apply Prod.ext + · exact congrArg (fun p : Fin n × U.Point => p.1) hh + · exact Subtype.ext (congrArg (fun p : Fin n × U.Point => p.2.val.2) hh) + let piece (j : J) : polygonAlternatingGroup a m := + ⟨slotHom (cell j) (slots j) (slot_inj j) σ,slotHom_alternating_mem _ _ _ hσ⟩ + have piece_on (j : J) (i : Fin n) (p : U.Point) : + (piece j).val.val (f i p)=if member j p then f (σ i) p else f i p := by + by_cases hp : member j p + · rw [ite_eq_left hp] + let x : (cell j).val := ⟨p.val.2,hp.2⟩ + have he : p=⟨(j.1,x.val),cell_sub j x.property⟩ := Subtype.ext (Prod.ext hp.1 rfl) + rw [he,chart_eq j i x] + exact (slotPerm_apply _ _ _ _ i x).trans (chart_eq j (σ i) x).symm + · rw [ite_eq_right hp] + apply slotPerm_apply_of_notMem + rintro ⟨⟨l,x⟩,he⟩ + rw [←chart_eq j l x] at he + have hh := @hf (l,⟨(j.1,x.val),cell_sub j x.property⟩) (i,p) he + have he' : (⟨(j.1,x.val),cell_sub j x.property⟩ : U.Point)=p := congrArg Prod.snd hh + exact hp ⟨(congrArg (fun p : U.Point => p.val.1) he').symm, + by simpa only [←he'] using x.property⟩ + have piece_out (j : J) (y : TrackPoint a m) + (hy : y∉Set.range (fun p : Fin n × U.Point => f p.1 p.2)) : (piece j).val.val y=y := by + apply slotPerm_apply_of_notMem + rintro ⟨⟨i,x⟩,he⟩ + exact hy ⟨(i,⟨(j.1,x.val),cell_sub j x.property⟩),(chart_eq j i x).trans he⟩ + have assemble (s : Finset J) : ∃g : polygonAlternatingGroup a m, + (∀i p,g.val.val (f i p)=if ∃j∈s,member j p then f (σ i) p else f i p) ∧ + (∀y∉Set.range (fun p : Fin n × U.Point => f p.1 p.2),g.val.val y=y) := by + induction s using Finset.induction_on with + | empty => exact ⟨1,by simp,fun _ _ => rfl⟩ + | @insert j s hj ih => + obtain ⟨g,hg,hout⟩ := ih + refine ⟨piece j*g,?_,?_⟩ + · intro i p + change (piece j).val.val (g.val.val (f i p))=_ + rw [hg] + by_cases hp : member j p + · have hn : ¬∃l∈s,member l p := by + rintro ⟨l,hl,hlp⟩ + exact hj ((member_unique j l p hp hlp).symm ▸ hl) + rw [ite_eq_right hn,piece_on,ite_eq_left hp,ite_eq_left ⟨j,Finset.mem_insert_self _ _,hp⟩] + · by_cases hs : ∃l∈s,member l p + · rw [ite_eq_left hs,piece_on,ite_eq_right hp] + rw [ite_eq_left (by obtain ⟨l,hl,hlp⟩ := hs;exact ⟨l,Finset.mem_insert_of_mem hl,hlp⟩)] + · have hn : ¬∃l∈insert j s,member l p := by simpa only [Finset.mem_insert,exists_prop, + or_and_right,exists_or,exists_eq_left] using not_or.mpr ⟨hp,hs⟩ + rw [ite_eq_right hs,piece_on,ite_eq_right hp,ite_eq_right hn] + · intro y hy + change (piece j).val.val (g.val.val y)=y + rw [hout y hy,piece_out j y hy] + obtain ⟨g,hg,hout⟩ := assemble Finset.univ + refine ⟨g,?_,hout⟩ + intro i p + rw [hg] + obtain ⟨c,hc⟩ := coverP p.val.1 p.val.2 p.property + exact ite_eq_left ⟨(p.val.1,c),Finset.mem_univ _,rfl,hc⟩ + +end PolygonPiecewise +end PolygonPiecewiseSlots + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/PolygonSmallPartition.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/PolygonSmallPartition.lean new file mode 100644 index 0000000000000000000000000000000000000000..b1eb3721abcc9516944409f946705df0364b0337 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/PolygonSmallPartition.lean @@ -0,0 +1,164 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Configurations.PolygonAlternatingExtension + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section PolygonSmallPartition + +open Classical Set MeasureTheory +namespace PolygonGrid + +noncomputable def strip (a : ℕ) (r : CutRing) (i : ℕ) : polygonAlgebra a := + ⟨halfPlane a 0 (r*(i+1)) ∩ (halfPlane a 0 (r*i))ᶜ, + BooleanSubalgebra.inf_mem (halfPlane_mem _ _ _) (BooleanSubalgebra.compl_mem (halfPlane_mem _ _ _))⟩ + +theorem mem_strip (a : ℕ) (r : CutRing) (i : ℕ) (x : GenericSquare a) : + x∈(strip a r i).val ↔ x.val.1∈interval (ordinary r) i := by + simp only [strip,halfPlane,interval,Set.mem_inter_iff,Set.mem_compl_iff,Set.mem_ofPred_eq, + Set.mem_Ico,cutForm,Matrix.cons_val_zero,map_mul,map_add,map_natCast,map_one,not_lt] + tauto + +theorem strip_area_le (a : ℕ) (r : CutRing) (i : ℕ) : + PolygonArea.area (strip a r i)≤ENNReal.ofReal (ordinary r) := by + have hs : Subtype.val '' (strip a r i).val⊆interval (ordinary r) i ×ˢ Ico (0:ℝ) 1 := by + rintro _ ⟨x,hx,rfl⟩ + exact ⟨(mem_strip a r i x).mp hx,x.property.2.1⟩ + calc + _≤(volume : Measure (ℝ×ℝ)) (interval (ordinary r) i ×ˢ Ico (0:ℝ) 1) := measure_mono hs + _=ENNReal.ofReal (ordinary r) := by + rw [show (volume : Measure (ℝ×ℝ))=Measure.prod (volume : Measure ℝ) volume from rfl] + simp only [Measure.prod_prod,interval,Real.volume_Ico,sub_zero,ENNReal.ofReal_one,mul_one] + congr 1 + ring + +theorem small_bank_cover {a m : ℕ} {ε : ℝ} (hε : 0<ε) : + ∃N : ℕ,∃P : Fin m × Fin N → Fin m → polygonAlgebra a, + (∀p : TrackPoint a m,∃j,p.2∈(P j p.1).val) ∧ + ∀j,(∑i,PolygonArea.area (P j i)) f.val p.val,fun _ _ he => Subtype.ext (f.val.injective he)⟩ + table := by + obtain ⟨S,hS,hcover⟩ := f.property + let conv (c : TableChart a m) : PolygonObject.Chart (a:=a) m m := + ⟨c.source,c.target,c.shift,U c.source ⊓ c.domain⟩ + refine ⟨S.image conv,?_,?_⟩ + · intro c hc + obtain ⟨d,hd,rfl⟩ := Finset.mem_image.mp hc + intro x hx + exact ⟨hx.1,hS d hd x hx.2⟩ + · intro p + obtain ⟨c,hc,hr,hx⟩ := hcover p.val + refine ⟨conv c,Finset.mem_image.mpr ⟨c,hc,rfl⟩,hr,?_,hx⟩ + simpa only [←hr] using p.property + +@[simp] theorem full_restrict_apply (f : polygonFullGroup a m) (U : Fin m → polygonAlgebra a) + (p : (PolygonObject.mk m U).Point) : full_restrict f U p=f.val p.val := rfl + +end PolygonObject.BankEmbedding +end PolygonSmallPartition + +section PolygonSmallSupport + +open Classical Set +namespace PolygonObject.BankEmbedding +variable {a m : ℕ} + +theorem small_support_coset (f : polygonFullGroup a m) {δ : ℝ} (hδ : 0<δ) : + ∃a₀ : polygonAlternatingGroup a m,∃S : Fin m → polygonAlgebra a, + (∑i,PolygonArea.area (S i)) s.sup (fun j => P j i)) := by + induction s using Finset.induction_on with + | empty => exact ⟨1,fun _ => ⊥,fun _ hp => False.elim hp,Or.inr (by simp)⟩ + | @insert j s hj ih => + obtain ⟨a₀,B,hfix,hB⟩ := ih + by_cases hsmallB : (∑i,PolygonArea.area (B i)ᶜ) p.property.2 + have hg : ∀p : (PolygonObject.mk m U).Point, + (g.val p.val).2∉(B (g.val p.val).1).val := by + intro p hp + have he : g.val (g.val p.val)=g.val p.val := hfix (g.val p.val) hp + have hh : g.val p.val=p.val := g.val.injective he + exact hU p (by simpa only [hh] using hp) + have harea : 10*(∑i,PolygonArea.area (U i))<∑i,PolygonArea.area (B i)ᶜ := by + have hle : (∑i,PolygonArea.area (U i))≤ENNReal.ofReal (δ/20) := + (Finset.sum_le_sum (fun i _ => PolygonArea.area_mono inf_le_left)).trans (hsmall j).le + exact ((mul_le_mul le_rfl hle (by positivity) (by positivity)).trans_lt hnum).trans_le + (le_of_not_gt hsmallB) + obtain ⟨c,hc,hcB⟩ := alternating_extension U B (full_restrict g U) hU hg harea + let B' (i : Fin m) : polygonAlgebra a := P j i ⊔ B i + refine ⟨c⁻¹*a₀,B',?_,Or.inr ?_⟩ + · intro y hy + change c.val.val.symm (g.val y)=y + apply (c.val.val.symm_apply_eq).mpr + by_cases hyB : y.2∈(B y.1).val + · rw [show g.val y=y from hfix y hyB,hcB y hyB] + · have hyP : y.2∈(P j y.1).val := hy.resolve_right hyB + let p : (PolygonObject.mk m U).Point := ⟨y,hyP,hyB⟩ + exact (hc p).symm + · funext i + simp only [B',hBeq,Finset.sup_insert] + obtain ⟨a₀,B,hfix,hB⟩ := step Finset.univ + refine ⟨a₀,fun i => (B i)ᶜ,?_,?_⟩ + · rcases hB with hB|rfl + · exact hB + · have hall (i : Fin m) : Finset.univ.sup (fun j => P j i)=⊤ := by + apply top_unique + intro x _ + obtain ⟨j,hj⟩ := hcover (i,x) + exact (Finset.le_sup (f:=fun j => P j i) (Finset.mem_univ j)) hj + simp only [hall,compl_top,PolygonArea.area_bot,Finset.sum_const_zero] + exact ENNReal.ofReal_pos.mpr hδ + · intro y hy + exact hfix y (not_not.mp hy) + +end PolygonObject.BankEmbedding +end PolygonSmallSupport + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/PrivateBankReserve.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/PrivateBankReserve.lean new file mode 100644 index 0000000000000000000000000000000000000000..8052b52217cf097e4ff0a529185eb1b5c55349c1 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/PrivateBankReserve.lean @@ -0,0 +1,62 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Configurations.DistinctSlotStars + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section PrivateBankReserve + +theorem exists_private_bank {m : ℕ} (ι : Fin 5 ↪ Fin m) (J : Finset (Fin m)) + (hreserve : 20 ≤ ((Finset.univ : Finset (Fin m)) \ (J ∪ orderedTrackAlphabet ι)).card) : + ∃ e : (Fin 5 × Fin 5) ↪ Fin m, + (∀ i, e (i,0)=ι i) ∧ ∀ i j : Fin 5, j≠0 → e (i,j) ∉ J := by + classical + let R := (Finset.univ : Finset (Fin m)) \ (J ∪ orderedTrackAlphabet ι) + have hc : Fintype.card (Fin 5 × {j : Fin 5 // j≠0}) ≤ Fintype.card R := by + rw [Fintype.card_prod,Fintype.card_fin] + have hfour : Fintype.card {j : Fin 5 // j≠0}=4 := by decide + rw [hfour] + rw [Fintype.card_coe] + exact hreserve + obtain ⟨k⟩ : Nonempty ((Fin 5 × {j : Fin 5 // j≠0}) ↪ R) := + Function.Embedding.nonempty_of_card_le hc + let f : Fin 5 × Fin 5 → Fin m := fun p => if h : p.2=0 then ι p.1 else (k (p.1,⟨p.2,h⟩)).val + have hnot : ∀ i j hj, (k (i,⟨j,hj⟩)).val ∉ orderedTrackAlphabet ι := by + intro i j hj + exact fun hv => (Finset.mem_sdiff.mp (k (i,⟨j,hj⟩)).property).2 (Finset.mem_union_right _ hv) + have hf : Function.Injective f := by + rintro ⟨i,j⟩ ⟨i',j'⟩ he + by_cases hj : j=0 <;> by_cases hj' : j'=0 + · subst j; subst j' + have hi : ι i=ι i' := by simpa [f] using he + exact Prod.ext (ι.injective hi) rfl + · subst j + have he' : ι i=(k (i',⟨j',hj'⟩)).val := by simpa [f,hj'] using he + exact False.elim (hnot i' j' hj' (he' ▸ orderedTrackAlphabet_mem ι i)) + · subst j' + have he' : (k (i,⟨j,hj⟩)).val=ι i' := by simpa [f,hj] using he + exact False.elim (hnot i j hj (he'.symm ▸ orderedTrackAlphabet_mem ι i')) + · have he' : k (i,⟨j,hj⟩)=k (i',⟨j',hj'⟩) := Subtype.ext (by simpa [f,hj,hj'] using he) + have hx := k.injective he' + have hi : i=i' := congrArg (fun p : Fin 5 × {j : Fin 5 // j≠0} => p.1) hx + have hjj : j=j' := congrArg (fun p : Fin 5 × {j : Fin 5 // j≠0} => p.2.val) hx + exact Prod.ext hi hjj + refine ⟨⟨f,hf⟩,?_,?_⟩ + · intro i; simp [f] + · intro i j hj + change f (i,j) ∉ J + simp only [f,hj,dite_false] + exact fun hv => (Finset.mem_sdiff.mp (k (i,⟨j,hj⟩)).property).2 (Finset.mem_union_left _ hv) + +end PrivateBankReserve + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/PrivateBankWord.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/PrivateBankWord.lean new file mode 100644 index 0000000000000000000000000000000000000000..d40cdb039c2f0e02a0674bbd5a526bff1eded193 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/PrivateBankWord.lean @@ -0,0 +1,150 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Configurations.DistinctSlotStars +import OAI.GroupTheory.SimpleAmenable.CentralCovers.CommonFrameTransport + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section PrivateBankWord + +theorem perm_list_prod_fix {α X : Type*} (l : List α) (f : α → Equiv.Perm X) (x : X) + (h : ∀ i ∈ l, f i x=x) : (l.map f).prod x=x := by + induction l with + | nil => rfl + | cons i l ih => + simp only [List.map_cons,List.prod_cons,Equiv.Perm.mul_apply] + rw [ih (fun j hj => h j (List.mem_cons_of_mem _ hj)),h i List.mem_cons_self] + +theorem perm_list_prod_transport {α X : Type*} [DecidableEq α] + (l : List α) (hl : l.Nodup) (f : α → Equiv.Perm X) (j : α) (hj : j ∈ l) + (x y : X) (he : f j x=y) + (hs : ∀ i ∈ l, i≠j → f i x=x ∧ f i y=y) : (l.map f).prod x=y := by + induction l with + | nil => simp at hj + | cons i l ih => + have hn := (List.nodup_cons.mp hl).1 + have ht := (List.nodup_cons.mp hl).2 + by_cases hij : i=j + · subst i + simp only [List.map_cons,List.prod_cons,Equiv.Perm.mul_apply] + rw [perm_list_prod_fix l f x (fun i hi => (hs i (List.mem_cons_of_mem _ hi) + (fun he => hn (he ▸ hi))).1),he] + · have hj' : j ∈ l := (List.mem_cons.mp hj).resolve_left (Ne.symm hij) + simp only [List.map_cons,List.prod_cons,Equiv.Perm.mul_apply] + rw [ih ht hj' (fun k hk => hs k (List.mem_cons_of_mem _ hk)), + (hs i List.mem_cons_self hij).2] + +def bankRow {m : ℕ} (e : (Fin 5 × Fin 5) ↪ Fin m) (j : Fin 5) : Fin 5 ↪ Fin m := + ⟨fun i => e (j,i),fun _ _ he => congrArg Prod.snd (e.injective he)⟩ + +def bankColumn {m : ℕ} (e : (Fin 5 × Fin 5) ↪ Fin m) (j : Fin 5) : Fin 5 ↪ Fin m := + ⟨fun i => e (i,j),fun _ _ he => congrArg Prod.fst (e.injective he)⟩ + +noncomputable def bankAlphabet {m : ℕ} (e : (Fin 5 × Fin 5) ↪ Fin m) : Finset (Fin m) := + Finset.univ.map e + +theorem bankRow_subset {m : ℕ} (e : (Fin 5 × Fin 5) ↪ Fin m) (j : Fin 5) : + orderedTrackAlphabet (bankRow e j) ⊆ bankAlphabet e := by + intro i hi + obtain ⟨k,_,rfl⟩ := Finset.mem_map.mp hi + exact Finset.mem_map.mpr ⟨(j,k),Finset.mem_univ _,rfl⟩ + +theorem bankColumn_subset {m : ℕ} (e : (Fin 5 × Fin 5) ↪ Fin m) (j : Fin 5) : + orderedTrackAlphabet (bankColumn e j) ⊆ bankAlphabet e := by + intro i hi + obtain ⟨k,_,rfl⟩ := Finset.mem_map.mp hi + exact Finset.mem_map.mpr ⟨(k,j),Finset.mem_univ _,rfl⟩ + +def privateCycle : alternatingGroup (Fin 5) := + ⟨Equiv.swap 0 1 * Equiv.swap 1 2,by + rw [Equiv.Perm.mem_alternatingGroup,map_mul] + norm_num⟩ + +@[simp] theorem privateCycle_apply_zero : privateCycle.val 0=1 := by + decide + +noncomputable def privateCycleStar : UniversalExtension (alternatingGroup (Fin 5)) := + (universalProjection_surjective _ privateCycle).choose + +@[simp] theorem privateCycleStar_projection : universalProjection _ privateCycleStar=privateCycle := + (universalProjection_surjective _ privateCycle).choose_spec + +theorem bank_other_frame_notmem {a m : ℕ} (e : (Fin 5 × Fin 5) ↪ Fin m) + (u : Fin m → CutRing × CutRing) (V : polygonAlgebra a) (i j k : Fin 5) (hij : i≠j) + (x : GenericSquare a) : (e (j,k),x) ∉ frameDomain (orderedTrackAlphabet (bankRow e i)) u V := by + rintro ⟨t,ht,y,hy,he⟩ + obtain ⟨l,_,rfl⟩ := Finset.mem_map.mp ht + have hh := e.injective (congrArg Prod.fst he) + exact hij (congrArg Prod.fst hh).symm + +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + (hlarge : 15 < m+1) (h : B.AllPrimitiveLaws) (hr : 0 + B.distinctSlotStar hlarge h hr (bankRow e j) u (F.restrict (bankRow_subset e j)) V privateCycleStar + let l := List.finRange 5 + let w := (l.map g).prod + refine ⟨w,?_,?_,?_⟩ + · apply Subgroup.list_prod_mem + intro t ht + obtain ⟨j,hj,rfl⟩ := List.mem_map.mp ht + exact B.distinctSlotStar_mem_geometricFrameGroup hlarge h hr (bankRow e j) u + (F.restrict (bankRow_subset e j)) V privateCycleStar + · apply Commute.list_prod_right + intro t ht + obtain ⟨j,hj,rfl⟩ := List.mem_map.mp ht + exact B.distinctSlotStar_uniform_fixer hlarge h hr (bankRow e j) b + (fun hi => hb (bankRow_subset e j hi)) u (F.restrict (bankRow_subset e j)) (v j) + (hu j) V z hz (hfix j) privateCycleStar + · intro j x + let q : BoundedRelationCover M (alternatingGenerator a r m hm) →* Equiv.Perm (TrackPoint a (m+1)) := + (polygonFullGroup a (m+1)).subtype.comp + ((polygonAlternatingGroup a (m+1)).subtype.comp (coverMap M (alternatingGenerator a r m hm))) + change q w (e (j,0),translate a (u (e (j,0))) x.val) = _ + change q ((l.map g).prod) _ = _ + rw [map_list_prod,List.map_map] + apply perm_list_prod_transport l (List.nodup_finRange 5) (fun i => q (g i)) j (by simp [l]) + · have he := B.distinctSlotStar_apply hlarge h hr (bankRow e j) u + (F.restrict (bankRow_subset e j)) V privateCycleStar 0 x + rw [privateCycleStar_projection,privateCycle_apply_zero] at he + exact he + · intro i hi hij + constructor + · exact B.frameStar_supported hlarge h hr _ u (F.restrict (bankRow_subset e i)) V + (universalMap (orderedTrackHom (bankRow e i)) privateCycleStar) _ + (bank_other_frame_notmem e u V i j 0 hij _) + · exact B.frameStar_supported hlarge h hr _ u (F.restrict (bankRow_subset e i)) V + (universalMap (orderedTrackHom (bankRow e i)) privateCycleStar) _ + (bank_other_frame_notmem e u V i j 1 hij _) + +end InitialCoverSystem +end PrivateBankWord + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/RectangularBound.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/RectangularBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..3cc32152091b03de68489c987125c90cf30793c7 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/RectangularBound.lean @@ -0,0 +1,110 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.CoordinateJointLaw + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section RectangularBound +variable {a m : ℕ} {r : CutRing} {hm : 2 ≤ m} + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + +theorem coordinate_all_eventually (hlarge : 20 ≤ m+1) + (hr : 0 < ordinary r ∧ ordinary r < 1/2) + (hSlope : 8000 < ordinary (cutTau^a)) + (hconj : |conjugate (cutTau^a)| < 1/1000) : + ∃ L : ℕ, ∀ M : ℕ, L ≤ M → ∀ B : InitialCoverSystem a r m hm M, + ∀ n, B.CoordinateWindowLaw n := by + obtain ⟨s,w,z,hs,hsr,hwz,hshort⟩ := exists_symmetric_short_chart a r hr.1 + obtain ⟨N,hN,hstep⟩ := InitialCoverSystem.coordinate_growth (hm := hm) hlarge hr + s w z hs hsr hwz hshort (show (1000:ℝ) ≤ 1000 from le_rfl) + (by convert hSlope using 1; norm_num) hconj + obtain ⟨L₁,hL₁⟩ := coordinateWindowLaw_eventually (a := a) (hm := hm) hr (by omega) N + obtain ⟨L₂,hL₂⟩ := tangentChartTables_eventually (a := a) (hm := hm) hr (by omega) + (symmetricWindowLength s) (symmetricWindowStart s) w + refine ⟨L₁+L₂,?_⟩ + intro M hM B + apply B.coordinate_iteration N (by omega) (hL₁ M (by omega) B) + intro n hn g + exact hstep M B (fun d e z I _ b hb => hL₂ M (by omega) B d e z I b hb) n hn g + +theorem exists_coordinate_cover (m : ℕ) (hm : 2 ≤ m) (hlarge : 20 ≤ m+1) + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + (r : CutRing) (hr : 0 < ordinary r ∧ ordinary r < 1/2) : + ∃ a : ℕ, 0 < a ∧ ordinary (cutTau^a)*(1/4) > 1000*(1000+1) ∧ + |conjugate (cutTau^a)| < 1/1000 ∧ + ∃ M : ℕ, ∃ B : InitialCoverSystem a r m hm M, ∀ n, B.CoordinateWindowLaw n := by + obtain ⟨a,ha,hslope,hconj⟩ := exists_source_slope (1/4) 1000 (by norm_num) + obtain ⟨L₁,hL₁⟩ := coordinate_all_eventually (a := a) (hm := hm) hlarge hr (by linarith) hconj + obtain ⟨L₂,hL₂⟩ := initialCoverSystem_eventually a r m hm hr (by omega) + obtain ⟨B⟩ := hL₂ (L₁+L₂) (by omega) + exact ⟨a,ha,hslope,hconj,L₁+L₂,B,hL₁ (L₁+L₂) (by omega) B⟩ + +end RectangularBound + +section GlobalWindowCoherence + +theorem finite_coordinate_windows_container {ι : Type*} [Fintype ι] + (k : ι → ℕ) (p : ι → Fin 2 → ℤ) : + ∃ n : ℕ, ∃ q : Fin 2 → ℤ, ∀ i j, q j ≤ p i j ∧ p i j+(k i:ℤ) ≤ q j+n := by + let N := Finset.univ.sup (fun i => k i+(p i 0).natAbs+(p i 1).natAbs) + have hb i : k i+(p i 0).natAbs+(p i 1).natAbs ≤ N := Finset.le_sup (f := fun i => k i+(p i 0).natAbs+(p i 1).natAbs) (Finset.mem_univ i) + refine ⟨3*N+1,fun _ => -(N:ℤ),?_⟩ + intro i j + have hk : k i ≤ N := by have := hb i; omega + have hp : (p i j).natAbs ≤ N := by fin_cases j <;> dsimp <;> have := hb i <;> omega + have hp₀ := (Int.le_natAbs : -p i j ≤ ((-p i j).natAbs : ℤ)) + simp only [Int.natAbs_neg] at hp₀ + have hp₁ := (Int.le_natAbs : p i j ≤ ((p i j).natAbs : ℤ)) + dsimp only + constructor <;> omega + +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + +theorem all_windowSector_eq (hlarge : 15 < m+1) + (h : ∀ n, B.CoordinateWindowLaw n) (k l : ℕ) (p q : Fin 2 → ℤ) + (V : polygonAlgebra a) + (hV : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) + (coordinateWindowPrimitives k p) i).val) V.val) + (hV' : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) + (coordinateWindowPrimitives l q) i).val) V.val) : + B.windowSector hlarge k (h k) p V = B.windowSector hlarge l (h l) q V := by + obtain ⟨n,z,hz⟩ := finite_coordinate_windows_container (fun b : Bool => if b then l else k) + (fun b : Bool => if b then q else p) + have hp j := hz false j + have hq j := hz true j + simp only [Bool.false_eq_true,ite_false,ite_true] at hp hq + rw [B.windowSector_inclusion hlarge n k (h n) (h k) z p (fun j => (hp j).1) (fun j => (hp j).2) V hV, + B.windowSector_inclusion hlarge n l (h n) (h l) z q (fun j => (hq j).1) (fun j => (hq j).2) V hV'] + +theorem all_window_control (hlarge : 15 < m+1) + (h : ∀ n, B.CoordinateWindowLaw n) (k l : ℕ) (p q : Fin 2 → ℤ) + (V W : polygonAlgebra a) (hVW : V ≤ W) + (hV : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) + (coordinateWindowPrimitives k p) i).val) V.val) + (hW : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) + (coordinateWindowPrimitives l q) i).val) W.val) : + SmallControlled B.c (B.windowSector hlarge k (h k) p V) (B.windowSector hlarge l (h l) q W) := by + obtain ⟨n,z,hz⟩ := finite_coordinate_windows_container (fun b : Bool => if b then l else k) + (fun b : Bool => if b then q else p) + have hp j := hz false j + have hq j := hz true j + simp only [Bool.false_eq_true,ite_false,ite_true] at hp hq + exact B.windowSector_overlap_control hlarge n k l (h n) (h k) (h l) z p q + (fun j => (hp j).1) (fun j => (hp j).2) (fun j => (hq j).1) (fun j => (hq j).2) V W hVW hV hW + +end InitialCoverSystem +end GlobalWindowCoherence + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/RefinedEndpointDecisions.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/RefinedEndpointDecisions.lean new file mode 100644 index 0000000000000000000000000000000000000000..3e91868e7053c9a5c3287e48ebb1c684d0f16596 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/RefinedEndpointDecisions.lean @@ -0,0 +1,199 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.WindowRectangles +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.FiniteArrangementGerms +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.FiniteRefiningGrid + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section RefinedEndpointDecisions + +theorem finite_grid_endpoint_sides {N : ℕ} (e : Fin (N+1) → CutRing) + (he : StrictMono (fun i => ordinary (e i))) (hzero : e 0=0) (hlast : e (Fin.last N)=1) + (i : Fin N) (c : CutRing) (hc : cutFraction c ∈ Set.range e) (k : ℤ) : + ordinary c-(k:ℝ)≤ordinary (e i.castSucc) ∨ ordinary (e i.succ)≤ordinary c-(k:ℝ) := by + by_contra hh + push Not at hh + have hlo : 0≤ordinary (e i.castSucc) := by + have h := he.monotone (Fin.zero_le i.castSucc) + simpa only [hzero,map_zero] using h + have hup : ordinary (e i.succ)≤1 := by + have h := he.monotone (Fin.le_last i.succ) + simpa only [hlast,map_one] using h + have hf : ⌊ordinary c⌋=k := Int.floor_eq_iff.mpr ⟨by linarith,by linarith⟩ + have hfrac : ordinary (cutFraction c)=ordinary c-(k:ℝ) := by rw [ordinary_cutFraction,Int.fract,hf] + exact finite_grid_no_between he i hc (by rw [hfrac]; exact ⟨hh.1,hh.2⟩) + +theorem finite_grid_endpoint_decision {a N : ℕ} (e : Fin (N+1) → CutRing) + (he : StrictMono (fun i => ordinary (e i))) (hzero : e 0=0) (hlast : e (Fin.last N)=1) + (i : Fin N) (c : CutRing) (hc : cutFraction c ∈ Set.range e) (k : ℤ) + (j : Fin 2) (x y : GenericSquare a) + (hx : ordinary (e i.castSucc)≤coordinate j x ∧ coordinate j x ordinary (e i))) (hzero : e 0=0) (hlast : e (Fin.last N)=1) + (hmesh : ∀ i : Fin N, ordinary (e i.succ)-ordinary (e i.castSucc)<1) + (cell : Fin 2 → Fin N) (j : Fin 2) (u v : CutRing) + (hu : cutFraction u ∈ Set.range e) (hv : cutFraction v ∈ Set.range e) + (huv : ordinary u≤ordinary v) (hlen : ordinary v-ordinary u<1) + (x y : GenericSquare a) + (hx : x ∈ (refinedGridRectangle a N e cell).val) + (hy : y ∈ (refinedGridRectangle a N e cell).val) : + x ∈ (coordinateInterval a j u v).val ↔ y ∈ (coordinateInterval a j u v).val := by + have hx' := (refinedGridRectangle_mem e he hzero hlast hmesh cell x).mp hx j + have hy' := (refinedGridRectangle_mem e he hzero hlast hmesh cell y).mp hy j + change x ∈ coordinateBetween a j u v ↔ y ∈ coordinateBetween a j u v + rw [mem_coordinateBetween_iff j u v huv hlen,mem_coordinateBetween_iff j u v huv hlen] + apply exists_congr + intro k + have h₁ := finite_grid_endpoint_decision e he hzero hlast (cell j) u hu k j x y hx' hy' + have h₂ := finite_grid_endpoint_decision e he hzero hlast (cell j) v hv k j x y hx' hy' + rw [← not_lt,← not_lt (a := coordinate j y+(k:ℝ))] + exact and_congr (not_congr h₁) h₂ + +end RefinedEndpointDecisions + +section ClosedRefinementContainment + +theorem finite_grid_interval_lift {N : ℕ} (e : Fin (N+1) → CutRing) + (he : StrictMono (fun i => ordinary (e i))) (hzero : e 0=0) (hlast : e (Fin.last N)=1) + (i : Fin N) (u v : CutRing) + (hu : cutFraction u ∈ Set.range e) (hv : cutFraction v ∈ Set.range e) + (x : ℝ) (hx : ordinary (e i.castSucc)≤x ∧ x ordinary (e i))) (hzero : e 0=0) (hlast : e (Fin.last N)=1) + (hmesh : ∀ i : Fin N, ordinary (e i.succ)-ordinary (e i.castSucc)<1) + (cell : Fin 2 → Fin N) : (refinedGridRectangle a N e cell).val.Nonempty := by + let O : Set (ℝ × ℝ) := (Set.Ioo (ordinary (e (cell 0).castSucc)) (ordinary (e (cell 0).succ))) ×ˢ + (Set.Ioo (ordinary (e (cell 1).castSucc)) (ordinary (e (cell 1).succ))) + have hO : IsOpen O := isOpen_Ioo.prod isOpen_Ioo + have hne : O.Nonempty := Set.Nonempty.prod + (Set.nonempty_Ioo.mpr (he (Fin.castSucc_lt_succ (i := cell 0)))) + (Set.nonempty_Ioo.mpr (he (Fin.castSucc_lt_succ (i := cell 1)))) + obtain ⟨p,hp,hg⟩ := (avoidsCuts_dense a).inter_open_nonempty O hO hne + have hbounds (j : Fin 2) : 0≤ordinary (e (cell j).castSucc) ∧ ordinary (e (cell j).succ)≤1 := by + constructor + · have hh := he.monotone (Fin.zero_le (cell j).castSucc); simpa only [hzero,map_zero] using hh + · have hh := he.monotone (Fin.le_last (cell j).succ); simpa only [hlast,map_one] using hh + have hsq : p.1 ∈ Set.Ico (0:ℝ) 1 ∧ p.2 ∈ Set.Ico (0:ℝ) 1 := + ⟨⟨(hbounds 0).1.trans hp.1.1.le,hp.1.2.trans_le (hbounds 0).2⟩, + ⟨(hbounds 1).1.trans hp.2.1.le,hp.2.2.trans_le (hbounds 1).2⟩⟩ + let x : GenericSquare a := ⟨p,hsq.1,hsq.2,hg⟩ + refine ⟨x,(refinedGridRectangle_mem e he hzero hlast hmesh cell x).mpr ?_⟩ + intro j + fin_cases j + · exact ⟨hp.1.1.le,hp.1.2⟩ + · exact ⟨hp.2.1.le,hp.2.2⟩ + +theorem refinedGridRectangle_closed_lift {a N : ℕ} (e : Fin (N+1) → CutRing) + (he : StrictMono (fun i => ordinary (e i))) (hzero : e 0=0) (hlast : e (Fin.last N)=1) + (hmesh : ∀ i : Fin N, ordinary (e i.succ)-ordinary (e i.castSucc)<1) + (cell : Fin 2 → Fin N) (u v : Fin 2 → CutRing) + (hu : ∀ j, cutFraction (u j) ∈ Set.range e) (hv : ∀ j, cutFraction (v j) ∈ Set.range e) + (huv : ∀ j, ordinary (u j)≤ordinary (v j)) + (hlen : ∀ j, ordinary (v j)-ordinary (u j)<1) + (x : GenericSquare a) (hx : x ∈ (refinedGridRectangle a N e cell).val) + (hR : x ∈ (coordinateRectangle a u v).val) : + ∃ k : Fin 2 → ℤ, ∀ j, + ordinary (u j)≤ordinary (e (cell j).castSucc)+(k j:ℝ) ∧ + ordinary (e (cell j).succ)+(k j:ℝ)≤ordinary (v j) := by + have hp (j : Fin 2) : x ∈ coordinateBetween a j (u j) (v j) := by + fin_cases j + · exact hR.1 + · exact hR.2 + have hh (j : Fin 2) := (mem_coordinateBetween_iff j (u j) (v j) (huv j) (hlen j) x).mp (hp j) + choose k hk using hh + exact ⟨k,fun j => finite_grid_interval_lift e he hzero hlast (cell j) (u j) (v j) + (hu j) (hv j) (coordinate j x) + ((refinedGridRectangle_mem e he hzero hlast hmesh cell x).mp hx j) (k j) (hk j)⟩ + +end ClosedRefinementContainment + +section CommonTranslatedGrid + +theorem refinedGridRectangle_translated_window {a N : ℕ} (e : Fin (N+1) → CutRing) + (he : StrictMono (fun i => ordinary (e i))) (hzero : e 0=0) (hlast : e (Fin.last N)=1) + (hmesh : ∀ i : Fin N, ordinary (e i.succ)-ordinary (e i.castSucc)<1) + (cell : Fin 2 → Fin N) (n : ℕ) (hn : 201≤n) (q : Fin 2 → ℤ) (v : CutRing × CutRing) + (hcuts : ∀ j : Fin 2, ∀ i : Fin (n+1), + cutFraction (windowCut n (q j) i+pointCoordinate v j) ∈ Set.range e) : + ∃ old : Fin 2 → Fin n, ∃ k : Fin 2 → ℤ, ∀ j, + ordinary (windowCut n (q j) (old j).castSucc+pointCoordinate v j)≤ + ordinary (e (cell j).castSucc)+(k j:ℝ) ∧ + ordinary (e (cell j).succ)+(k j:ℝ)≤ + ordinary (windowCut n (q j) (old j).succ+pointCoordinate v j) := by + obtain ⟨x,hx⟩ := refinedGridRectangle_nonempty (a := a) e he hzero hlast hmesh cell + obtain ⟨old,ho⟩ := windowRectangle_cover n hn q (translate a (-v) x) + have hR : x ∈ (spatialTranslate v (windowRectangle a n q old)).val := ho + rw [windowRectangle,spatialTranslate_coordinateRectangle] at hR + have hpos : (200:ℝ) hcuts j _) (fun j => hcuts j _) hle hlen x hx (by simpa only [pointCoordinate] using hR)⟩ + +theorem common_translated_grid {ι : Type*} [Fintype ι] + (S : Finset CutRing) (n : ℕ) (hn : 201≤n) + (size : ι → ℕ) (_hs : ∀ i, 201 ≤ size i) (q : ι → Fin 2 → ℤ) (v : ι → CutRing × CutRing) : + ∃ N : ℕ, 0 ordinary (e i)) ∧ e 0=0 ∧ e (Fin.last N)=1 ∧ + (∀ i : Fin N, ordinary (e i.succ)-ordinary (e i.castSucc)≤200/(n:ℝ)) ∧ + (∀ c ∈ S, cutFraction c ∈ Set.range e) ∧ + (∀ i, ∀ j : Fin 2, ∀ k : Fin (size i+1), + cutFraction (windowCut (size i) (q i j) k+pointCoordinate (v i) j) ∈ Set.range e) ∧ + (∀ i : Fin N, ∃ k : Fin n, + ordinary (windowCut n 0 k.castSucc)≤ordinary (e i.castSucc) ∧ + ordinary (e i.succ)≤ordinary (windowCut n 0 k.succ)) := by + classical + let U : Finset CutRing := S ∪ Finset.univ.biUnion (fun i : ι => + Finset.univ.biUnion (fun j : Fin 2 => (Finset.univ : Finset (Fin (size i+1))).image + (fun k => windowCut (size i) (q i j) k+pointCoordinate (v i) j))) + obtain ⟨N,hN,e,he,hzero,hlast,hcuts,hfine⟩ := finite_refining_grid U n (by omega) + have href := finite_grid_refines_window (by omega : 0 ordinary (e i))) (hzero : e 0=0) (hlast : e (Fin.last N)=1) + (hmesh : ∀ i : Fin N, ordinary (e i.succ)-ordinary (e i.castSucc)<1) + (cell : Fin 2 → Fin N) (z : ℝ × ℝ) (δ : ℝ) + (hnear : ∀ k, |ordinary (e (cell k).castSucc)-realCoordinate z k|<δ ∧ + |ordinary (e (cell k).succ)-realCoordinate z k|<δ) + (p : GenericSquare a) (hp : p ∈ (refinedGridRectangle a N e cell).val) : dist p.val z<δ := by + have hb := (refinedGridRectangle_mem e he hzero hlast hmesh cell p).mp hp + have hd (k : Fin 2) : |realCoordinate p.val k-realCoordinate z k|<δ := by + have hl := (abs_lt.mp (hnear k).1).1 + have hr := (abs_lt.mp (hnear k).2).2 + have hk := hb k + change ordinary (e (cell k).castSucc)≤realCoordinate p.val k ∧ + realCoordinate p.val k linarith [hk.1,hk.2] + rw [Prod.dist_eq,Real.dist_eq,Real.dist_eq,max_lt_iff] + exact ⟨hd 0,hd 1⟩ + +namespace ConcurrentGeometry.InwardChart +variable {a : ℕ} {r : CutRing} {C : ConcurrentGeometry a r} {ι : Type*} [Finite ι] + {j : ι → Fin 4} {c : ι → CutRing} {z : ℝ × ℝ} (T : C.InwardChart j c z) + +theorem refined_cells_locally_decided (hr : 0 ordinary (e i)) → e 0=0 → e (Fin.last N)=1 → + (∀ i : Fin N, ordinary (e i.succ)-ordinary (e i.castSucc)<1) → + ∀ cell : Fin 2 → Fin N, + (∀ k, |ordinary (e (cell k).castSucc)-realCoordinate z k|<δ ∧ + |ordinary (e (cell k).succ)-realCoordinate z k|<δ) → + ∀ p : GenericSquare a, p ∈ (refinedGridRectangle a N e cell).val → + p ∈ (C.inwardMargin T.vertex T.offset z).val ∧ + ∀ i, p ∈ (C.localDecision T.vertex T.offset z (j i) (c i)).val ↔ + p ∈ (cutPolygon a (j i) (c i)).val := by + obtain ⟨O,hO,hz,hlocal⟩ := T.decisions_locally_eq hr + obtain ⟨δ,hδ,hball⟩ := Metric.isOpen_iff.mp hO z hz + refine ⟨δ,hδ,?_⟩ + intro N e he hzero hlast hmesh cell hnear p hp + exact hlocal p (hball (refinedGridRectangle_point_near e he hzero hlast hmesh cell z δ hnear p hp)) + +end ConcurrentGeometry.InwardChart +end RefinedLocalDecisions + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/RefinementNeighborhoods.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/RefinementNeighborhoods.lean new file mode 100644 index 0000000000000000000000000000000000000000..a1a8783ae64de158bcbaa30d4d7adae793044dbb --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/RefinementNeighborhoods.lean @@ -0,0 +1,70 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.CompactCommonRefinement + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section RefinementNeighborhoods + +theorem refinedGridRectangle_subset_translated_window {a N : ℕ} (e : Fin (N+1) → CutRing) + (he : StrictMono (fun i => ordinary (e i))) (hzero : e 0=0) (hlast : e (Fin.last N)=1) + (hmesh : ∀ i : Fin N, ordinary (e i.succ)-ordinary (e i.castSucc)<1) + (cell : Fin 2 → Fin N) (n : ℕ) (hn : 201≤n) (q : Fin 2 → ℤ) (v : CutRing × CutRing) + (hcuts : ∀ j : Fin 2, ∀ i : Fin (n+1), + cutFraction (windowCut n (q j) i+pointCoordinate v j) ∈ Set.range e) : + ∃ old : Fin 2 → Fin n, + refinedGridRectangle a N e cell ≤ spatialTranslate v (windowRectangle a n q old) := by + obtain ⟨old,k,hk⟩ := refinedGridRectangle_translated_window (a := a) e he hzero hlast hmesh cell n hn q v hcuts + refine ⟨old,?_⟩ + intro p hp + have hpm := (refinedGridRectangle_mem e he hzero hlast hmesh cell p).mp hp + rw [windowRectangle,spatialTranslate_coordinateRectangle] + have h (j : Fin 2) : p ∈ coordinateBetween a j + (windowCut n (q j) (old j).castSucc+pointCoordinate v j) + (windowCut n (q j) (old j).succ+pointCoordinate v j) := by + have hle : ordinary (windowCut n (q j) (old j).castSucc+pointCoordinate v j)≤ + ordinary (windowCut n (q j) (old j).succ+pointCoordinate v j) := by + simp only [map_add,add_le_add_iff_right] + exact (windowCut_strictMono n (q j) (Fin.castSucc_lt_succ (i := old j))).le + have hlen : ordinary (windowCut n (q j) (old j).succ+pointCoordinate v j)- + ordinary (windowCut n (q j) (old j).castSucc+pointCoordinate v j)<1 := by + simp only [map_add,add_sub_add_right_eq_sub] + have hn' : (200:ℝ) ordinary (e i))) (cell : Fin 2 → Fin N) + (z : ℝ × ℝ) (δ : ℝ) (h : closedRefinedBox N e cell ⊆ Metric.ball z δ) : + ∀ k, |ordinary (e (cell k).castSucc)-realCoordinate z k|<δ ∧ + |ordinary (e (cell k).succ)-realCoordinate z k|<δ := by + have hl : (ordinary (e (cell 0).castSucc),ordinary (e (cell 1).castSucc)) ∈ closedRefinedBox N e cell := by + intro k + fin_cases k <;> exact ⟨le_rfl,(he (Fin.castSucc_lt_succ (i := cell _))).le⟩ + have hu : (ordinary (e (cell 0).succ),ordinary (e (cell 1).succ)) ∈ closedRefinedBox N e cell := by + intro k + fin_cases k <;> exact ⟨(he (Fin.castSucc_lt_succ (i := cell _))).le,le_rfl⟩ + have hL := h hl + have hU := h hu + rw [Metric.mem_ball,Prod.dist_eq,Real.dist_eq,Real.dist_eq,max_lt_iff] at hL hU + intro k + fin_cases k + · exact ⟨hL.1,hU.1⟩ + · exact ⟨hL.2,hU.2⟩ + +end RefinementNeighborhoods + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/ResolvedBoolean.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/ResolvedBoolean.lean new file mode 100644 index 0000000000000000000000000000000000000000..3cb47a82dfec4efe098ef68a0497ed2f268c66a2 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/ResolvedBoolean.lean @@ -0,0 +1,200 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.CoordinateWindowTarget +import OAI.GroupTheory.SimpleAmenable.CentralCovers.PrimitiveTable + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section ResolvedBoolean + +variable {X ι : Type*} + +def ResolvedBy (U : ι → Set X) (V : Set X) : Prop := + ∀ x y, (∀ i, x ∈ U i ↔ y ∈ U i) → (x ∈ V ↔ y ∈ V) + +def resolvedAlgebra (U : ι → Set X) : BooleanSubalgebra (Set X) where + carrier := {V | ResolvedBy U V} + supClosed' := by + intro V hV W hW x y h + exact or_congr (hV x y h) (hW x y h) + infClosed' := by + intro V hV W hW x y h + exact and_congr (hV x y h) (hW x y h) + compl_mem' := by + intro V hV x y h + exact not_congr (hV x y h) + bot_mem' := by intro x y h; rfl + +theorem resolved_test (U : ι → Set X) (i : ι) : U i ∈ resolvedAlgebra U := by + intro x y h + exact h i + +theorem resolved_mono {κ : Type*} (U : ι → Set X) (V : κ → Set X) + (h : ∀ i, U i ∈ resolvedAlgebra V) : resolvedAlgebra U ≤ resolvedAlgebra V := by + intro S hS x y he + apply hS x y + intro i + exact h i x y he + +variable {a : ℕ} + +noncomputable def resolvedPolygonMask (U : ι → polygonAlgebra a) + (V : Set (GenericSquare a)) : Set (Set.range (polygonAssignment U)) := + {ω | ∃ x, polygonAssignment U x = ω.val ∧ x ∈ V} + +theorem polygonAssignment_eq_iff (U : ι → polygonAlgebra a) (x y : GenericSquare a) : + polygonAssignment U x = polygonAssignment U y ↔ + ∀ i, x ∈ (U i).val ↔ y ∈ (U i).val := by + classical + constructor + · intro h i + have hi := congrFun h i + simpa only [polygonAssignment,decide_eq_decide] using hi + · intro h + funext i + exact decide_eq_decide.mpr (h i) + +theorem resolvedPolygonMask_mem (U : ι → polygonAlgebra a) + (V : Set (GenericSquare a)) (hV : ResolvedBy (fun i => (U i).val) V) + (x : GenericSquare a) : + (⟨polygonAssignment U x,⟨x,rfl⟩⟩ : Set.range (polygonAssignment U)) ∈ + resolvedPolygonMask U V ↔ x ∈ V := by + constructor + · rintro ⟨y,he,hy⟩ + exact (hV y x ((polygonAssignment_eq_iff U y x).mp he)).mp hy + · intro hx + exact ⟨x,rfl,hx⟩ + +theorem resolvedPolygonMask_mono (U : ι → polygonAlgebra a) + {V W : Set (GenericSquare a)} (h : V ⊆ W) : + resolvedPolygonMask U V ⊆ resolvedPolygonMask U W := by + rintro ω ⟨x,he,hx⟩ + exact ⟨x,he,h hx⟩ + +theorem resolvedPolygonMask_disjoint (U : ι → polygonAlgebra a) + {V W : Set (GenericSquare a)} (hV : ResolvedBy (fun i => (U i).val) V) + (h : Disjoint V W) : Disjoint (resolvedPolygonMask U V) (resolvedPolygonMask U W) := by + apply Set.disjoint_left.mpr + rintro ω ⟨x,hx,hxV⟩ ⟨y,hy,hyW⟩ + have hyV := (hV x y ((polygonAssignment_eq_iff U x y).mp (hx.trans hy.symm))).mp hxV + exact Set.disjoint_left.mp h hyV hyW + +theorem resolvedPolygonMask_union (U : ι → polygonAlgebra a) + (V W : Set (GenericSquare a)) : + resolvedPolygonMask U (V ∪ W) = resolvedPolygonMask U V ∪ resolvedPolygonMask U W := by + ext ω + constructor + · rintro ⟨x,he,hx | hx⟩ + · exact Or.inl ⟨x,he,hx⟩ + · exact Or.inr ⟨x,he,hx⟩ + · rintro (⟨x,he,hx⟩ | ⟨x,he,hx⟩) + · exact ⟨x,he,Or.inl hx⟩ + · exact ⟨x,he,Or.inr hx⟩ + +end ResolvedBoolean + +section FiniteCoordinateAlgebra + +@[simp] theorem coordinateShift_add (j : Fin 2) (u v : CutRing) : + coordinateShift j (u+v) = coordinateShift j u + coordinateShift j v := by + fin_cases j <;> simp [coordinateShift] + +@[simp] theorem coordinateShift_neg (j : Fin 2) (u : CutRing) : + coordinateShift j (-u) = -coordinateShift j u := by + fin_cases j <;> simp [coordinateShift] + +theorem coordinateArc_tau {a : ℕ} (j : Fin 2) : + coordinateArc a j cutTau = (coordinatePrimitive a j).val := by + have hfloor : ⌊Real.goldenRatio⌋ = (1 : ℤ) := + Int.floor_eq_iff.mpr ⟨by norm_num; exact Real.one_lt_goldenRatio.le, + by norm_num; exact Real.goldenRatio_lt_two⟩ + ext p + have hp := (coordinate_bounds j p).1 + fin_cases j <;> + simp [coordinateArc,coordinate,coordinatePrimitive,halfPlane,cutForm, + Int.fract,hfloor,ordinary_cutTau] <;> intro _ <;> exact hp + +theorem coordinate_preimage_add {a : ℕ} (j : Fin 2) (u v : CutRing) + (V : Set (GenericSquare a)) : + translate a (-coordinateShift j u) ⁻¹' (translate a (-coordinateShift j v) ⁻¹' V) = + translate a (-coordinateShift j (u+v)) ⁻¹' V := by + ext p + simp only [Set.mem_preimage,coordinateShift_add,neg_add_rev,translate_add] + +noncomputable def coordinateBetween (a : ℕ) (j : Fin 2) (u v : CutRing) : + Set (GenericSquare a) := + translate a (-coordinateShift j u) ⁻¹' coordinateArc a j (v-u) + +theorem coordinate_prefix_generated {a : ℕ} + (B : BooleanSubalgebra (Set (GenericSquare a))) (j : Fin 2) (u : CutRing) + (n : ℕ) + (h : ∀ i : ℕ, i < n → + (spatialTranslate (coordinateShift j (u+(i:CutRing)*cutTau)) + (coordinatePrimitive a j)).val ∈ B) : + coordinateBetween a j u (u+(n:CutRing)*cutTau) ∈ B := by + have hs {V W : Set (GenericSquare a)} (hV : V ∈ B) (hW : W ∈ B) : symmDiff V W ∈ B := by + rw [Set.symmDiff_def] + exact BooleanSubalgebra.sup_mem (BooleanSubalgebra.sdiff_mem hV hW) + (BooleanSubalgebra.sdiff_mem hW hV) + change translate a (-coordinateShift j u) ⁻¹' coordinateArc a j + (u+(n:CutRing)*cutTau-u) ∈ B + rw [add_sub_cancel_left] + induction n with + | zero => + rw [Nat.cast_zero,zero_mul,coordinateArc_zero_of_fract j 0 (by simp),Set.preimage_empty] + exact BooleanSubalgebra.bot_mem + | succ n ih => + have hi := ih (fun i hi => h i (by omega)) + rw [Nat.cast_succ,add_mul,one_mul,coordinateArc_add] + have he := h n (by omega) + change translate a (-coordinateShift j (u+(n:CutRing)*cutTau)) ⁻¹' + (coordinatePrimitive a j).val ∈ B at he + split_ifs + · rw [Set.preimage_symmDiff,coordinateShift_neg,coordinate_preimage_add, + coordinateArc_tau] + exact hs hi he + · rw [Set.preimage_compl,Set.preimage_symmDiff,coordinateShift_neg, + coordinate_preimage_add,coordinateArc_tau] + exact BooleanSubalgebra.compl_mem (hs hi he) + +theorem coordinate_window_between_resolved {a : ℕ} {r : CutRing} + (n : ℕ) (q : Fin 2 → ℤ) (j : Fin 2) (i k : ℕ) (hik : i ≤ k) (hk : k < n) : + coordinateBetween a j (((q j+(i:ℤ)):CutRing)*cutTau) + (((q j+(k:ℤ)):CutRing)*cutTau) ∈ + resolvedAlgebra (fun z => (InitialCoverSystem.primitiveTests (a := a) (r := r) + (coordinateWindowPrimitives n q) z).val) := by + let B := resolvedAlgebra (fun z => (InitialCoverSystem.primitiveTests (a := a) (r := r) + (coordinateWindowPrimitives n q) z).val) + have hp := coordinate_prefix_generated B j (((q j+(i:ℤ)):CutRing)*cutTau) (k-i) + have he : (((q j+(i:ℤ)):CutRing)*cutTau) + ((k-i:ℕ):CutRing)*cutTau = + (((q j+(k:ℤ)):CutRing)*cutTau) := by + push_cast + rw [Nat.cast_sub hik] + ring + rw [he] at hp + apply hp + intro t ht + have ht' : i+t < n-1 := by omega + have hh := resolved_test (fun z => (InitialCoverSystem.primitiveTests (a := a) (r := r) + (coordinateWindowPrimitives n q) z).val) (j,⟨i+t,ht'⟩) + change (spatialTranslate (coordinateShift j + (((q j+((i+t:ℕ):ℤ)):CutRing)*cutTau)) + (initialTest a r (coordinateTestIndex j))).val ∈ B at hh + rw [initialTest_coordinate] at hh + convert hh using 1 + congr 3 + push_cast + ring + +end FiniteCoordinateAlgebra + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/RoutingIndependence.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/RoutingIndependence.lean new file mode 100644 index 0000000000000000000000000000000000000000..d9261778b55e909ed1017053f0d6aaaf2c7fa3ab --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/RoutingIndependence.lean @@ -0,0 +1,170 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Configurations.RepeatedTrackRouting +import OAI.GroupTheory.SimpleAmenable.Simplicial.SmallEvenRouting + +namespace OAI + +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement + +noncomputable def orderedOffsets {m : ℕ} (ι : Fin 5 ↪ Fin m) + (u : Fin 5 → CutRing × CutRing) : Fin m → CutRing × CutRing := + Function.extend ι u 0 + +@[simp] theorem orderedOffsets_apply {m : ℕ} (ι : Fin 5 ↪ Fin m) + (u : Fin 5 → CutRing × CutRing) (j : Fin 5) : orderedOffsets ι u (ι j)=u j := + ι.injective.extend_apply u 0 j + +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + (hlarge : 15 < m+1) (h : B.AllPrimitiveLaws) (hr : 0 (i j,u j)))) : + Nonempty (B.SlotRouting hlarge h hr V i u) := by + classical + have hres : 20 ≤ ((Finset.univ : Finset (Fin (m+1))) \ + (∅ ∪ Finset.univ.image i)).card := by + rw [Finset.empty_union,Finset.card_sdiff_of_subset (Finset.subset_univ _)] + have hc := Finset.card_image_le (f := i) (s := Finset.univ) + simp only [Finset.card_univ,Fintype.card_fin] at hc ⊢ + omega + obtain ⟨P,_⟩ := exists_privateRoutingBank i ∅ hres + obtain ⟨b,_,hb⟩ := Finset.exists_mem_notMem_of_card_lt_card + (show P.alphabet.card < (Finset.univ : Finset (Fin (m+1))).card by + have hc := P.alphabet_card + simp only [Finset.card_univ,Fintype.card_fin] + omega) + have ht (j : Fin 5) : P.target j ∈ P.alphabet := + P.row_subset j (orderedTrackAlphabet_mem (P.row j) 1) + have hbt : b ∉ orderedTrackAlphabet P.target := by + intro hh + obtain ⟨j,_,rfl⟩ := Finset.mem_map.mp hh + exact hb (ht j) + obtain ⟨w,hw,hwJ,hwt⟩ := B.repeated_bank_routing hlarge h hr i u P b hb V hinj + exact ⟨{ + alphabet := P.alphabet + card_le := P.alphabet_card + source_mem := P.source_mem + target := P.target + target_mem := ht + offsets := orderedOffsets P.target u + offsets_spec := orderedOffsets_apply P.target u + frame := balancedOffsetFrame a r m hm _ b hbt (orderedOffsets P.target u) + word := w + aligned := hw + supported := hwJ + transport := hwt }⟩ + +namespace SlotRouting +variable {B hlarge h hr} + +noncomputable def star {V : polygonAlgebra a} {i : Fin 5 → Fin (m+1)} + {u : Fin 5 → CutRing × CutRing} (ρ : B.SlotRouting hlarge h hr V i u) : + UniversalExtension (alternatingGroup (Fin 5)) →* + BoundedRelationCover M (alternatingGenerator a r m hm) := + (MulAut.conj ρ.word⁻¹).toMonoidHom.comp + (B.distinctSlotStar hlarge h hr ρ.target ρ.offsets ρ.frame V) + +theorem aligned_transport + (R : alternatingGroup (Fin (m+1)) → + Multiplicative (FreeAbelianGroup (Fin m × Fin 2)) →* + Multiplicative (FreeAbelianGroup (Fin m × Fin 2))) + (hR : ∀ s k, B.c s * B.t k * (B.c s)⁻¹ = B.t (R s k)) + {V : polygonAlgebra a} {i k : Fin 5 → Fin (m+1)} {u : Fin 5 → CutRing × CutRing} + (ρ : B.SlotRouting hlarge h hr V i u) (σ : B.SlotRouting hlarge h hr V k u) + (J : Finset (Fin (m+1))) (hwide : J.card+88 ≤ m+1) + (z : BoundedRelationCover M (alternatingGenerator a r m hm)) + (hz : z ∈ ⨆ W : polygonAlgebra a, (B.polygonStar hlarge h hr W).range) + (hzJ : z ∈ sourceAlignedGroup a r m hm M B.t J) + (htransport : ∀ (j : Fin 5) (x : V.val), + (coverMap M (alternatingGenerator a r m hm) z).val.val (i j,translate a (u j) x.val) = + (k j,translate a (u j) x.val)) : + (MulAut.conj z).toMonoidHom.comp ρ.star = σ.star := by + classical + let S := ⨆ W : polygonAlgebra a, (B.polygonStar hlarge h hr W).range + let K := σ.alphabet ∪ J ∪ ρ.alphabet + let L := sourceAlignedGroup a r m hm M B.t K + let w := σ.word*z*ρ.word⁻¹ + have hwS : w ∈ S := S.mul_mem (S.mul_mem σ.aligned hz) (S.inv_mem ρ.aligned) + have hσL : σ.word ∈ L := sourceAlignedGroup_mono B.t + (Finset.Subset.trans Finset.subset_union_left Finset.subset_union_left) σ.supported + have hρL : ρ.word ∈ L := sourceAlignedGroup_mono B.t Finset.subset_union_right ρ.supported + have hzL : z ∈ L := sourceAlignedGroup_mono B.t + (Finset.Subset.trans Finset.subset_union_right Finset.subset_union_left) hzJ + have hwL : w ∈ L := L.mul_mem (L.mul_mem hσL hzL) (L.inv_mem hρL) + have hK : K.card+38 ≤ m+1 := by + have h₁ := Finset.card_union_le σ.alphabet J + have h₂ := Finset.card_union_le (σ.alphabet∪J) ρ.alphabet + have hρ := ρ.card_le + have hσ := σ.card_le + dsimp [K] + omega + have hwt : ∀ (j : Fin 5) (x : V.val), + (coverMap M (alternatingGenerator a r m hm) w).val.val + (ρ.target j,translate a (ρ.offsets (ρ.target j)) x.val) = + (σ.target j,translate a (σ.offsets (σ.target j)) x.val) := by + intro j x + rw [ρ.offsets_spec j,σ.offsets_spec j] + change (coverMap M (alternatingGenerator a r m hm) (σ.word*z*ρ.word⁻¹)).val.val _ = _ + rw [map_mul,map_mul,map_inv] + change (coverMap M (alternatingGenerator a r m hm) σ.word).val.val + ((coverMap M (alternatingGenerator a r m hm) z).val.val + ((coverMap M (alternatingGenerator a r m hm) ρ.word).val.val.symm _)) = _ + rw [← ρ.transport j x,Equiv.symm_apply_apply,htransport j x,σ.transport j x] + have he := B.distinctSlotStar_aligned_transport hlarge h hr R hR ρ.target σ.target + ρ.offsets σ.offsets (fun j => (ρ.offsets_spec j).trans (σ.offsets_spec j).symm) + ρ.frame σ.frame V K hK w hwS hwL hwt + ext s : 1 + have hh := DFunLike.congr_fun he s + change w*B.distinctSlotStar hlarge h hr ρ.target ρ.offsets ρ.frame V s*w⁻¹ = + B.distinctSlotStar hlarge h hr σ.target σ.offsets σ.frame V s at hh + change z*(ρ.word⁻¹*B.distinctSlotStar hlarge h hr ρ.target ρ.offsets ρ.frame V s*(ρ.word⁻¹)⁻¹)*z⁻¹ = + σ.word⁻¹*B.distinctSlotStar hlarge h hr σ.target σ.offsets σ.frame V s*(σ.word⁻¹)⁻¹ + simp only [inv_inv] + rw [← hh] + dsimp [w] + group + +theorem independent + (R : alternatingGroup (Fin (m+1)) → + Multiplicative (FreeAbelianGroup (Fin m × Fin 2)) →* + Multiplicative (FreeAbelianGroup (Fin m × Fin 2))) + (hR : ∀ s k, B.c s * B.t k * (B.c s)⁻¹ = B.t (R s k)) + (hwide : 88 ≤ m+1) {V : polygonAlgebra a} {i : Fin 5 → Fin (m+1)} + {u : Fin 5 → CutRing × CutRing} + (ρ σ : B.SlotRouting hlarge h hr V i u) : ρ.star=σ.star := by + have he := ρ.aligned_transport R hR σ ∅ (by simpa using hwide) 1 + (Subgroup.one_mem _) (Subgroup.one_mem _) (by intro j x; simp) + ext s : 1 + have hh := DFunLike.congr_fun he s + change 1*ρ.star s*1⁻¹=σ.star s at hh + simpa using hh + +end SlotRouting +end InitialCoverSystem + +end SimpleAmenable + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/SectorControl.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/SectorControl.lean new file mode 100644 index 0000000000000000000000000000000000000000..4cdf1b08495e55d41938be394a6a2738fe00c5bb --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/SectorControl.lean @@ -0,0 +1,213 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.GeometricSectors +import OAI.GroupTheory.SimpleAmenable.RandomFields.PrimitiveCovariance + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section ActualSectorControl + +variable {E H Q Ω : Type*} [Group E] [Group H] [Group Q] [Group.IsPerfect E] + +namespace ActualLawfulTable +variable {q : H →* Q} {v : (Ω → E) →* Q} (T : ActualLawfulTable q v) + +theorem sector_control {U V : Set Ω} (hUV : U ⊆ V) : + SameActionOn (T.sector V) (T.sector Set.univ) (T.sector U).range := by + classical + intro s x hx + obtain ⟨t,rfl⟩ := hx + have hd : Disjoint V Vᶜ := disjoint_compl_right_iff.mpr le_rfl + have he := DFunLike.congr_fun (T.sector_union hd) s + rw [Set.union_compl_self] at he + rw [he] + change _ = (T.sector V s*T.sector Vᶜ s) * _ * (T.sector V s*T.sector Vᶜ s)⁻¹ + exact (conj_mul_of_commute _ _ _ + (T.sector_commute (disjoint_compl_left_iff.mpr hUV) s t)).symm + +end ActualLawfulTable + +variable {a : ℕ} {ι : Type*} + +theorem resolvedPolygonMask_univ (U : ι → polygonAlgebra a) : + resolvedPolygonMask U Set.univ = Set.univ := by + ext ω + simp only [resolvedPolygonMask,Set.mem_ofPred_eq,Set.mem_univ,iff_true,and_true] + exact ω.property + +namespace InitialCoverSystem +variable {m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) [Finite ι] + +theorem geometricSector_whole (I : Finset (Fin (m+1))) + [Group.IsPerfect (alternatingGroup I)] + (b : Fin (m+1)) (hb : b ∉ I) (P : ι → Fin 5 × (CutRing × CutRing)) + (h : B.PrimitiveFamilyLaw I b hb P) : + B.geometricSector I b hb P h (wholePolygon a) = + (B.initialAlphabet I 0).comp (universalProjection (alternatingGroup I)) := by + apply CentralOn.lift_unique (coverMap M (alternatingGenerator a r m hm)) + (copyFamilyEval (B.primitiveFamily I b hb P)).range h + · rintro x ⟨s,rfl⟩ + exact B.geometricSector_mem I b hb P h _ s + · rintro x ⟨s,rfl⟩ + rw [copyFamilyEval_range] + exact (le_iSup (fun z => (B.primitiveFamily I b hb P z).range) none) + ⟨universalProjection (alternatingGroup I) s,rfl⟩ + · rw [B.geometricSector_projection I b hb P h _ + (show ResolvedBy _ (wholePolygon a).val from fun x y he => Iff.rfl)] + rw [← MonoidHom.comp_assoc] + congr 1 + rw [initialAlphabet,← MonoidHom.comp_assoc,B.initialConditional_projection] + rfl + +theorem geometricSector_control (I : Finset (Fin (m+1))) + [Group.IsPerfect (alternatingGroup I)] + (b : Fin (m+1)) (hb : b ∉ I) (P : ι → Fin 5 × (CutRing × CutRing)) + (h : B.PrimitiveFamilyLaw I b hb P) (V W : polygonAlgebra a) (hVW : V ≤ W) : + SameActionOn (B.geometricSector I b hb P h W) + ((B.initialAlphabet I 0).comp (universalProjection (alternatingGroup I))) + (B.geometricSector I b hb P h V).range := by + rw [← B.geometricSector_whole I b hb P h] + unfold geometricSector + change SameActionOn _ ((B.primitiveTable I b hb P h).sector + (resolvedPolygonMask (primitiveTests (a := a) (r := r) P) Set.univ)) _ + rw [resolvedPolygonMask_univ] + exact (B.primitiveTable I b hb P h).sector_control (resolvedPolygonMask_mono _ hVW) + +theorem geometricSector_input (I : Finset (Fin (m+1))) + [Group.IsPerfect (alternatingGroup I)] + (b : Fin (m+1)) (hb : b ∉ I) (P : ι → Fin 5 × (CutRing × CutRing)) + (h : B.PrimitiveFamilyLaw I b hb P) (i : ι) : + B.geometricSector I b hb P h (primitiveTests (a := a) (r := r) P i) = + (B.primitiveCopy I b hb (P i)).comp (universalProjection (alternatingGroup I)) := by + apply CentralOn.lift_unique (coverMap M (alternatingGenerator a r m hm)) + (copyFamilyEval (B.primitiveFamily I b hb P)).range h + · rintro x ⟨s,rfl⟩ + exact B.geometricSector_mem I b hb P h _ s + · rintro x ⟨s,rfl⟩ + rw [copyFamilyEval_range] + exact (le_iSup (fun z => (B.primitiveFamily I b hb P z).range) (some i)) + ⟨universalProjection (alternatingGroup I) s,rfl⟩ + · rw [B.geometricSector_projection I b hb P h _ (resolved_test _ i)] + rw [← MonoidHom.comp_assoc,B.primitiveCopy_projection] + rfl + +end InitialCoverSystem +end ActualSectorControl + +section AlphabetInclusion + +variable {α : Type*} [Fintype α] [DecidableEq α] + +theorem subtypeAlternatingHom_mem_range (I : Finset α) (s : alternatingGroup α) : + s ∈ (subtypeAlternatingHom I).range ↔ s.val.support ⊆ I := by + constructor + · rintro ⟨t,rfl⟩ + exact Equiv.Perm.mem_range_ofSubtype_iff.mp ⟨t.val,rfl⟩ + · intro hs + obtain ⟨t,ht⟩ := Equiv.Perm.mem_range_ofSubtype_iff.mpr hs + have hat : t ∈ alternatingGroup I := by + rw [Equiv.Perm.mem_alternatingGroup,← Equiv.Perm.sign_ofSubtype,ht] + exact s.property + exact ⟨⟨t,hat⟩,Subtype.ext ht⟩ + +noncomputable def subalphabetHom {I J : Finset α} (hIJ : I ⊆ J) : + alternatingGroup I →* alternatingGroup J := + (MonoidHom.ofInjective (subtypeAlternatingHom_injective J)).symm.toMonoidHom.comp + ((subtypeAlternatingHom I).codRestrict (subtypeAlternatingHom J).range + (fun s => (subtypeAlternatingHom_mem_range J _).mpr + ((subtypeAlternatingHom_mem_range I _).mp ⟨s,rfl⟩ |>.trans hIJ))) + +@[simp] theorem subtypeAlternatingHom_comp {I J : Finset α} (hIJ : I ⊆ J) : + (subtypeAlternatingHom J).comp (subalphabetHom hIJ) = subtypeAlternatingHom I := by + apply MonoidHom.ext + intro s + exact MonoidHom.apply_ofInjective_symm (subtypeAlternatingHom_injective J) _ + +namespace CommonFrame +variable {a m : ℕ} {r : CutRing} {hm : 2 ≤ m} + {I J : Finset (Fin (m+1))} {u : CutRing × CutRing} + +noncomputable def restrict (F : CommonFrame a r m hm J u) (hIJ : I ⊆ J) : + CommonFrame a r m hm I u where + k := F.k + d := F.d + projection := F.projection + common := fun i hi => F.common i (hIJ hi) + +end CommonFrame + +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + +theorem initialAlphabet_inclusion {I J : Finset (Fin (m+1))} (hIJ : I ⊆ J) (j : Fin 5) : + (B.initialAlphabet J j).comp (subalphabetHom hIJ) = B.initialAlphabet I j := by + rw [initialAlphabet,MonoidHom.comp_assoc,subtypeAlternatingHom_comp] + rfl + +theorem primitiveCopy_inclusion {I J : Finset (Fin (m+1))} (hIJ : I ⊆ J) + (b c : Fin (m+1)) (hb : b ∉ I) (hc : c ∉ J) (p : Fin 5 × (CutRing × CutRing)) : + (B.primitiveCopy J c hc p).comp (subalphabetHom hIJ) = B.primitiveCopy I b hb p := by + let F := commonFrame a r m hm J c hc p.2 + rw [B.primitiveCopy_frame J c hc p F,B.primitiveCopy_frame I b hb p (F.restrict hIJ)] + change ((MulAut.conj (B.t F.k)).toMonoidHom.comp (B.initialAlphabet J p.1)).comp _ = + (MulAut.conj (B.t F.k)).toMonoidHom.comp (B.initialAlphabet I p.1) + rw [MonoidHom.comp_assoc,B.initialAlphabet_inclusion hIJ] + +theorem primitiveFamily_inclusion {ι : Type*} {I J : Finset (Fin (m+1))} (hIJ : I ⊆ J) + (b c : Fin (m+1)) (hb : b ∉ I) (hc : c ∉ J) + (P : ι → Fin 5 × (CutRing × CutRing)) (i : Option ι) : + (B.primitiveFamily J c hc P i).comp (subalphabetHom hIJ) = B.primitiveFamily I b hb P i := by + cases i with + | none => exact B.initialAlphabet_inclusion hIJ 0 + | some i => exact B.primitiveCopy_inclusion hIJ b c hb hc (P i) + +theorem primitiveFamily_range_inclusion {ι : Type*} {I J : Finset (Fin (m+1))} (hIJ : I ⊆ J) + (b c : Fin (m+1)) (hb : b ∉ I) (hc : c ∉ J) + (P : ι → Fin 5 × (CutRing × CutRing)) : + (copyFamilyEval (B.primitiveFamily I b hb P)).range ≤ + (copyFamilyEval (B.primitiveFamily J c hc P)).range := by + rw [copyFamilyEval_range,copyFamilyEval_range] + apply iSup_le + intro i x hx + obtain ⟨s,rfl⟩ := hx + apply le_iSup (fun z => (B.primitiveFamily J c hc P z).range) i + exact ⟨subalphabetHom hIJ s,DFunLike.congr_fun (B.primitiveFamily_inclusion hIJ b c hb hc P i) s⟩ + +theorem geometricSector_inclusion {ι : Type*} [Finite ι] + {I J : Finset (Fin (m+1))} [Group.IsPerfect (alternatingGroup I)] + [Group.IsPerfect (alternatingGroup J)] (hIJ : I ⊆ J) + (b c : Fin (m+1)) (hb : b ∉ I) (hc : c ∉ J) + (P : ι → Fin 5 × (CutRing × CutRing)) + (h : B.PrimitiveFamilyLaw I b hb P) (g : B.PrimitiveFamilyLaw J c hc P) + (V : polygonAlgebra a) + (hV : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) P i).val) V.val) : + (B.geometricSector J c hc P g V).comp (universalMap (subalphabetHom hIJ)) = + B.geometricSector I b hb P h V := by + apply CentralOn.lift_unique (coverMap M (alternatingGenerator a r m hm)) + (copyFamilyEval (B.primitiveFamily J c hc P)).range g + · rintro x ⟨s,rfl⟩ + exact B.geometricSector_mem J c hc P g V _ + · rintro x ⟨s,rfl⟩ + exact B.primitiveFamily_range_inclusion hIJ b c hb hc P + (B.geometricSector_mem I b hb P h V s) + · rw [← MonoidHom.comp_assoc,B.geometricSector_projection J c hc P g V hV, + B.geometricSector_projection I b hb P h V hV,MonoidHom.comp_assoc,universalMap_spec] + rw [← MonoidHom.comp_assoc] + congr 1 + rw [MonoidHom.comp_assoc,subtypeAlternatingHom_comp] + +end InitialCoverSystem +end AlphabetInclusion + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/SectorOffsetCoherence.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/SectorOffsetCoherence.lean new file mode 100644 index 0000000000000000000000000000000000000000..ecbfd211d726c544b4e9cca2ce37d130a8316c0e --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/SectorOffsetCoherence.lean @@ -0,0 +1,126 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.FullSector + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section SectorOffsetCoherence + +theorem spatialTranslate_reduce {a : ℕ} (u : CutRing × CutRing) (V : polygonAlgebra a) : + spatialTranslate u V = spatialTranslate + ((u.1.im:CutRing)*cutTau,(u.2.im:CutRing)*cutTau) V := by + apply Subtype.ext + ext p + change (translation a u).symm p ∈ V.val ↔ + (translation a ((u.1.im:CutRing)*cutTau,(u.2.im:CutRing)*cutTau)).symm p ∈ V.val + rw [translation_reduce a u] + +theorem coordinatePrimitive_translate_label_eq {a : ℕ} (j : Fin 2) + (u v : CutRing × CutRing) + (h : endpointLabel (if j = 0 then u.1 else u.2) = + endpointLabel (if j = 0 then v.1 else v.2)) : + spatialTranslate u (coordinatePrimitive a j) = spatialTranslate v (coordinatePrimitive a j) := by + rw [spatialTranslate_reduce u,spatialTranslate_reduce v] + apply coordinatePrimitive_translate_eq j + fin_cases j + · change u.1.im = v.1.im at h + change (u.1.im:CutRing)*cutTau = (v.1.im:CutRing)*cutTau + exact congrArg (fun z : ℤ => (z:CutRing)*cutTau) h + · change u.2.im = v.2.im at h + change (u.2.im:CutRing)*cutTau = (v.2.im:CutRing)*cutTau + exact congrArg (fun z : ℤ => (z:CutRing)*cutTau) h + +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) {ι κ : Type*} + +theorem primitiveFamily_congr_offsets (I : Finset (Fin (m+1))) + (b : Fin (m+1)) (hb : b ∉ I) (P Q : ι → Fin 5 × (CutRing × CutRing)) + (hj : ∀ i, (P i).1 = (Q i).1) + (hp : ∀ i, spatialTranslate (P i).2 (initialTest a r (P i).1) = + spatialTranslate (Q i).2 (initialTest a r (Q i).1)) : + B.primitiveFamily I b hb P = B.primitiveFamily I b hb Q := by + funext i + cases i with + | none => rfl + | some i => + change B.primitiveCopy I b hb (P i) = B.primitiveCopy I b hb (Q i) + have he : P i = ((Q i).1,(P i).2) := Prod.ext (hj i) rfl + rw [he] + exact B.primitiveCopy_translate_eq I b hb (Q i).1 (P i).2 (Q i).2 + (by simpa only [hj i] using hp i) + +variable [Finite ι] [Finite κ] + +theorem geometricSector_congr_offsets (I : Finset (Fin (m+1))) + [Group.IsPerfect (alternatingGroup I)] (b : Fin (m+1)) (hb : b ∉ I) + (P Q : ι → Fin 5 × (CutRing × CutRing)) + (hj : ∀ i, (P i).1 = (Q i).1) + (hp : ∀ i, spatialTranslate (P i).2 (initialTest a r (P i).1) = + spatialTranslate (Q i).2 (initialTest a r (Q i).1)) + (h : B.PrimitiveFamilyLaw I b hb P) (g : B.PrimitiveFamilyLaw I b hb Q) + (V : polygonAlgebra a) + (hV : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) P i).val) V.val) : + B.geometricSector I b hb P h V = B.geometricSector I b hb Q g V := by + have he := B.primitiveFamily_congr_offsets I b hb P Q hj hp + have hV' : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) Q i).val) V.val := by + intro x y hxy + apply hV x y + intro i + change x ∈ (spatialTranslate (P i).2 (initialTest a r (P i).1)).val ↔ + y ∈ (spatialTranslate (P i).2 (initialTest a r (P i).1)).val + rw [hp i] + exact hxy i + apply CentralOn.lift_unique (coverMap M (alternatingGenerator a r m hm)) + (copyFamilyEval (B.primitiveFamily I b hb Q)).range g + · rintro x ⟨s,rfl⟩ + rw [← he] + exact B.geometricSector_mem I b hb P h V s + · rintro x ⟨s,rfl⟩ + exact B.geometricSector_mem I b hb Q g V s + · rw [B.geometricSector_projection I b hb P h V hV, + B.geometricSector_projection I b hb Q g V hV'] + +variable [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + +theorem fullGeometricSector_congr_offsets (hlarge : 15 < m+1) + (P Q : ι → Fin 5 × (CutRing × CutRing)) + (hj : ∀ i, (P i).1 = (Q i).1) + (hp : ∀ i, spatialTranslate (P i).2 (initialTest a r (P i).1) = + spatialTranslate (Q i).2 (initialTest a r (Q i).1)) + (h : ∀ I, I.card ≤ 15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb P) + (g : ∀ I, I.card ≤ 15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb Q) + (V : polygonAlgebra a) + (hV : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) P i).val) V.val) : + B.fullGeometricSector hlarge P h V = B.fullGeometricSector hlarge Q g V := by + have hV' : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) Q i).val) V.val := by + intro x y hxy + apply hV x y + intro i + change x ∈ (spatialTranslate (P i).2 (initialTest a r (P i).1)).val ↔ + y ∈ (spatialTranslate (P i).2 (initialTest a r (P i).1)).val + rw [hp i] + exact hxy i + apply universal_five_alphabet_hom_ext (by simp; omega) + intro I + let b := smallAlphabetBalance hlarge I.val (by rw [I.property.2]; omega) + have hb : b ∉ I.val := smallAlphabetBalance_notMem hlarge I.val _ + rw [B.fullGeometricSector_inclusion hlarge P h I.val (by rw [I.property.2]) b hb + (h _ (by rw [I.property.2]; omega) b hb) V hV, + B.fullGeometricSector_inclusion hlarge Q g I.val (by rw [I.property.2]) b hb + (g _ (by rw [I.property.2]; omega) b hb) V hV'] + exact B.geometricSector_congr_offsets I.val b hb P Q hj hp _ _ V hV + +end InitialCoverSystem +end SectorOffsetCoherence + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/Sectors.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/Sectors.lean new file mode 100644 index 0000000000000000000000000000000000000000..e7f71a19bb48696a7157240fe6a758bdfdf49d34 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/Sectors.lean @@ -0,0 +1,172 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.ConditionalFamilyLaws + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section ActualSectors + +variable {P E H Q Ω : Type*} [Group P] [Group E] [Group H] [Group Q] + +theorem CentralOn.lift_unique [Group.IsPerfect P] (q : H →* Q) (S : Subgroup H) + (h : CentralOn q S) (f g : P →* H) (hf : f.range ≤ S) (hg : g.range ≤ S) + (he : q.comp f = q.comp g) : f = g := by + let f' : P →* S := f.codRestrict S (fun x => hf ⟨x,rfl⟩) + let g' : P →* S := g.codRestrict S (fun x => hg ⟨x,rfl⟩) + have hh : f' = g' := perfect_lift_unique (q.comp S.subtype) h f' g' he + ext x + exact congrArg Subtype.val (DFunLike.congr_fun hh x) + +structure ActualLawfulTable (q : H →* Q) (v : (Ω → E) →* Q) where + carrier : Subgroup H + law : CentralOn q carrier + model : carrier →* (Ω → E) + onto : Function.Surjective model + projection : q.comp carrier.subtype = v.comp model + +namespace ActualLawfulTable + +variable {q : H →* Q} {v : (Ω → E) →* Q} (T : ActualLawfulTable q v) + +theorem kernel_central : T.model.ker ≤ Subgroup.center T.carrier := by + intro x hx + apply T.law + change q x.val = 1 + have he := DFunLike.congr_fun T.projection x + change q x.val = v (T.model x) at he + rw [he,show T.model x = 1 from hx,map_one] + +variable [Group.IsPerfect E] + +noncomputable def sector (U : Set Ω) : UniversalExtension E →* H := + T.carrier.subtype.comp (universalLift T.model T.onto T.kernel_central (sectorMask U)) + +theorem sector_mem (U : Set Ω) (s : UniversalExtension E) : T.sector U s ∈ T.carrier := + (universalLift T.model T.onto T.kernel_central (sectorMask U) s).property + +theorem sector_projection (U : Set Ω) : + q.comp (T.sector U) = (v.comp (sectorMask U)).comp (universalProjection E) := by + unfold sector + rw [← MonoidHom.comp_assoc,T.projection,MonoidHom.comp_assoc, + universalLift_spec,← MonoidHom.comp_assoc] + +@[simp] theorem sector_projection_apply (U : Set Ω) (s : UniversalExtension E) : + q (T.sector U s) = v (sectorMask U (universalProjection E s)) := + DFunLike.congr_fun (T.sector_projection U) s + +theorem sector_commute {U V : Set Ω} (h : Disjoint U V) + (s t : UniversalExtension E) : Commute (T.sector U s) (T.sector V t) := by + have hc := perfect_maps_commute_of_central T.model T.kernel_central + (universalLift T.model T.onto T.kernel_central (sectorMask U)) + (universalLift T.model T.onto T.kernel_central (sectorMask V)) + (fun s t => by + have hU := DFunLike.congr_fun (universalLift_spec T.model T.onto T.kernel_central (sectorMask U)) s + have hV := DFunLike.congr_fun (universalLift_spec T.model T.onto T.kernel_central (sectorMask V)) t + simp only [MonoidHom.comp_apply] at hU hV + rw [hU,hV] + exact sectorMask_commute h _ _) s t + exact congrArg Subtype.val hc.eq + +theorem sector_union {U V : Set Ω} (h : Disjoint U V) : + T.sector (U ∪ V) = commutingProduct (T.sector U) (T.sector V) + (T.sector_commute h) := by + apply T.law.lift_unique q T.carrier + · rintro x ⟨s,rfl⟩ + exact T.sector_mem _ s + · rintro x ⟨s,rfl⟩ + exact T.carrier.mul_mem (T.sector_mem _ s) (T.sector_mem _ s) + · ext s + simp only [MonoidHom.comp_apply, commutingProduct_apply, map_mul] + rw [T.sector_projection_apply,T.sector_projection_apply,T.sector_projection_apply] + simp only [sectorMask_disjoint_union h,map_mul] + +@[simp] theorem sector_empty : T.sector ∅ = 1 := by + apply T.law.lift_unique q T.carrier + · rintro x ⟨s,rfl⟩ + exact T.sector_mem _ s + · intro x hx + rw [MonoidHom.range_one] at hx + have hx' : x = 1 := hx + rw [hx'] + exact T.carrier.one_mem + · rw [T.sector_projection] + ext s + simp only [MonoidHom.comp_apply,MonoidHom.one_apply,map_one] + have he : sectorMask (∅ : Set Ω) (universalProjection E s) = 1 := by ext ω; simp [sectorMask] + rw [he,map_one] + +theorem sector_eq (U : Set Ω) (f : UniversalExtension E →* H) + (hf : f.range ≤ T.carrier) + (hp : q.comp f = (v.comp (sectorMask U)).comp (universalProjection E)) : + T.sector U = f := + T.law.lift_unique q T.carrier _ _ (by rintro x ⟨s,rfl⟩; exact T.sector_mem U s) hf + ((T.sector_projection U).trans hp.symm) + +end ActualLawfulTable + +section FamilyModel +variable {ι : Type*} (U : ι → Set Ω) (F : Option ι → E →* H) + (q : H →* Q) (v : (Ω → E) →* Q) + (hv : Function.Injective v) + (hcompat : ∀ i, q.comp (F i) = v.comp (maskFamily U i)) + +include hcompat in +theorem copyFamilyEval_projection : q.comp (copyFamilyEval F) = v.comp (assignmentEval U) := by + apply FreeGroup.ext_hom + rintro ⟨i,s⟩ + simpa only [MonoidHom.comp_apply,assignmentEval,copyFamilyEval_of] using + DFunLike.congr_fun (hcompat i) s + +noncomputable def actualFamilyModel : (copyFamilyEval F).range →* (Ω → E) := + (copyFamilyEval F).rangeRestrict.liftOfSurjective + (copyFamilyEval F).rangeRestrict_surjective ⟨assignmentEval U, by + intro w hw + apply hv + have hh := DFunLike.congr_fun (copyFamilyEval_projection U F q v hcompat) w + change q (copyFamilyEval F w) = v (assignmentEval U w) at hh + have hw' : copyFamilyEval F w = 1 := congrArg Subtype.val hw + rw [hw',map_one] at hh + simpa only [map_one] using hh.symm⟩ + +theorem actualFamilyModel_comp : + (actualFamilyModel U F q v hv hcompat).comp (copyFamilyEval F).rangeRestrict = + assignmentEval U := + (copyFamilyEval F).rangeRestrict.liftOfRightInverse_comp _ _ _ + +theorem actualFamilyModel_projection : + q.comp (copyFamilyEval F).range.subtype = v.comp (actualFamilyModel U F q v hv hcompat) := by + ext x + obtain ⟨w,rfl⟩ := (copyFamilyEval F).rangeRestrict_surjective x + have he := DFunLike.congr_fun (actualFamilyModel_comp U F q v hv hcompat) w + change actualFamilyModel U F q v hv hcompat ((copyFamilyEval F).rangeRestrict w) = + assignmentEval U w at he + simp only [MonoidHom.comp_apply] + rw [he] + exact DFunLike.congr_fun (copyFamilyEval_projection U F q v hcompat) w + +noncomputable def actualFamilyTable [Group.IsPerfect E] [Finite ι] [Finite Ω] + (hsep : ∀ ω ν, (∀ i, ω ∈ U i ↔ ν ∈ U i) → ω = ν) + (h : CentralOn q (copyFamilyEval F).range) : ActualLawfulTable q v where + carrier := (copyFamilyEval F).range + law := h + model := actualFamilyModel U F q v hv hcompat + onto := by + intro s + obtain ⟨w,rfl⟩ := assignmentEval_surjective U hsep s + exact ⟨(copyFamilyEval F).rangeRestrict w, + DFunLike.congr_fun (actualFamilyModel_comp U F q v hv hcompat) w⟩ + projection := actualFamilyModel_projection U F q v hv hcompat + +end FamilyModel +end ActualSectors + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/SeparatedAxisSectors.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/SeparatedAxisSectors.lean new file mode 100644 index 0000000000000000000000000000000000000000..4f6c9700b1dd67c0c5a1c9d9cad77d9dd11647ba --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/SeparatedAxisSectors.lean @@ -0,0 +1,205 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.FiniteSectorPartition + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section SeparatedAxisSectors + +noncomputable def axisCellStripPair {n : ℕ} (d : Fin 2) + (k k' l : ℕ) (hk : k ≤ n) (hk' : k' ≤ n) (hl : l ≤ n) (hlpos : 0 < l) + (p p' q : ℤ) (u v u' v' : CutRing) + (huv : ordinary u ≤ ordinary v) (hgap : ordinary v < ordinary u') + (huv' : ordinary u' ≤ ordinary v') + (hu : p ≤ endpointLabel u ∧ endpointLabel u < p+k) + (hv : p ≤ endpointLabel v ∧ endpointLabel v < p+k) + (hu' : p' ≤ endpointLabel u' ∧ endpointLabel u' < p'+k') + (hv' : p' ≤ endpointLabel v' ∧ endpointLabel v' < p'+k') + (hkn : k ≤ n*9/10) (hkn' : k' ≤ n*9/10) (hln : l ≤ n/4) (i : Fin l) : OldStripPair n d where + left := axisCellRectangle d k l hk hl hlpos p q u v huv hu hv i + right := axisCellRectangle d k' l hk' hl hlpos p' q u' v' huv' hu' hv' i + lo := u + cutLeft := v + cutRight := u' + hi := v' + bottom := windowCut l q i.castSucc + top := windowCut l q i.succ + left_lower _ := rfl + left_upper _ := rfl + right_lower _ := rfl + right_upper _ := rfl + ordered_left := huv + ordered_gap := hgap + ordered_right := huv' + ordered_cross := (windowCut_strictMono l q (Fin.castSucc_lt_succ (i := i))).le + left_length j := by change (if j=d then k else l) ≤ _; split <;> assumption + right_length j := by change (if j=d then k' else l) ≤ _; split <;> assumption + +theorem transverse_window_mesh (n : ℕ) (hn : 1005 ≤ n) (q : ℤ) (i : Fin (n/4)) : + ordinary (windowCut (n/4) q i.succ)-ordinary (windowCut (n/4) q i.castSucc) ≤ 1000/(n:ℝ) := by + apply (windowCut_mesh (n/4) q i).trans + have hp : (0:ℝ) < ((n/4:ℕ):ℝ) := by exact_mod_cast (show 0 < n/4 by omega) + have hnp : (0:ℝ) < (n:ℝ) := by exact_mod_cast (show 0 < n by omega) + have hb : (n:ℝ) ≤ 5*((n/4:ℕ):ℝ) := by exact_mod_cast (show n ≤ 5*(n/4) by omega) + apply (div_le_div_iff₀ hp hnp).mpr + linarith + +namespace InitialCoverSystem +variable {a m : ℕ} {r : CutRing} {hm : 2 ≤ m} + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + +theorem separated_axis_sectors_commute (hlarge : 20 ≤ m+1) + (hr : 0 < ordinary r ∧ ordinary r < 1/2) + (s w z : CutRing) (hs : 0 < ordinary s) (hsr : ordinary s < ordinary r/2) + (hwz : w*z=1) + (hshort : (1+|ordinary (cutTau^a)|)*(|ordinary w|+|ordinary (cutTau*w)|) < ordinary s/4) + {C : ℝ} (hC : 1000 ≤ C) (hSlope : 8*C < ordinary (cutTau^a)) + (hconj : |conjugate (cutTau^a)| < 1/1000) : + ∃ N : ℕ, 1005 ≤ N ∧ ∀ (M : ℕ) (B : InitialCoverSystem a r m hm M) + (_h : B.TangentChartLaws (symmetricWindowLength s) (symmetricWindowStart s) w), + ∀ n : ℕ, N ≤ n → ∀ g : B.CoordinateWindowLaw n, + ∀ (d : Fin 2) (k k' : ℕ) (hk : k ≤ n*9/10) (hk' : k' ≤ n*9/10) + (p p' : ℤ) (u v u' v' : CutRing) + (_huv : ordinary u ≤ ordinary v) (_hgap : ordinary v < ordinary u') + (_huv' : ordinary u' ≤ ordinary v') + (_hu : p ≤ endpointLabel u ∧ endpointLabel u < p+k) + (_hv : p ≤ endpointLabel v ∧ endpointLabel v < p+k) + (_hu' : p' ≤ endpointLabel u' ∧ endpointLabel u' < p'+k') + (_hv' : p' ≤ endpointLabel v' ∧ endpointLabel v' < p'+k'), + ordinary v'-ordinary u ≤ C/(n:ℝ) → + |(endpointLabel (u'-v):ℝ)| ≤ 6*(n:ℝ)/5 → + ∀ x y, Commute + (B.axisSector (by omega) n g d k (by omega) p (coordinateInterval a d u v) x) + (B.axisSector (by omega) n g d k' (by omega) p' (coordinateInterval a d u' v') y) := by + obtain ⟨N₀,hN₀,hcomm⟩ := separated_old_rectangles_commute + (a := a) (hm := hm) hlarge hr s w z hs hsr hwz hshort (by linarith : 0 ≤ C) hSlope hconj + refine ⟨max 1005 N₀,by omega,?_⟩ + intro M B h n hn g d k k' hk hk' p p' u v u' v' huv hgap huv' hu hv hu' hv' hwidth hlabels x y + have hnpos : 1005 ≤ n := by omega + let f (i : Fin (n/4)) := B.rectangleCopy (by omega) g + (axisCellRectangle d k (n/4) (by omega) (by omega) (by omega) p 0 u v huv hu hv i) + let f' (i : Fin (n/4)) := B.rectangleCopy (by omega) g + (axisCellRectangle d k' (n/4) (by omega) (by omega) (by omega) p' 0 u' v' huv' hu' hv' i) + have hc (i j : Fin (n/4)) (x y : TrackStar (Fin (m+1))) : Commute (f i x) (f' j y) := by + by_cases hij : i=j + · subst j + let P := axisCellStripPair d k k' (n/4) (by omega) (by omega) (by omega) (by omega) + p p' 0 u v u' v' huv hgap huv' hu hv hu' hv' hk hk' le_rfl i + exact hcomm M B h n (by omega) g d P hwidth + ((transverse_window_mesh n hnpos 0 i).trans + (div_le_div_of_nonneg_right hC (by positivity))) hlabels x y + · exact B.axisCellRectangle_distinct_commute hlarge n g d k k' (n/4) + (by omega) (by omega) (by omega) (by omega) p p' 0 u v u' v' huv huv' hu hv hu' hv' i j hij x y + exact commute_of_range_iSup f f' hc + (B.axisSector_range_cells (by omega) n g d k (n/4) (by omega) (by omega) (by omega) + p 0 u v huv hu hv ⟨x,rfl⟩) + (B.axisSector_range_cells (by omega) n g d k' (n/4) (by omega) (by omega) (by omega) + p' 0 u' v' huv' hu' hv' ⟨y,rfl⟩) + +end InitialCoverSystem +end SeparatedAxisSectors + +section AxisCoherence + +@[simp] theorem coordinateInterval_self {a : ℕ} (d : Fin 2) (u : CutRing) : + coordinateInterval a d u u = ⊥ := by + apply Subtype.ext + exact coordinateBetween_empty d u u (by simp) + +noncomputable def endpointPairStart (u v : CutRing) : ℤ := min (endpointLabel u) (endpointLabel v) +noncomputable def endpointPairLength (u v : CutRing) : ℕ := + (max (endpointLabel u) (endpointLabel v)-endpointPairStart u v).toNat+1 + +theorem endpointPairLength_cast (u v : CutRing) : + (endpointPairLength u v : ℤ) = max (endpointLabel u) (endpointLabel v)-endpointPairStart u v+1 := by + have hh : 0 ≤ max (endpointLabel u) (endpointLabel v)-endpointPairStart u v := by + simp only [endpointPairStart]; omega + simp only [endpointPairLength,Nat.cast_add,Nat.cast_one,Int.toNat_of_nonneg hh] + +theorem endpointPair_labels (u v : CutRing) : + (endpointPairStart u v ≤ endpointLabel u ∧ endpointLabel u < endpointPairStart u v+endpointPairLength u v) ∧ + (endpointPairStart u v ≤ endpointLabel v ∧ endpointLabel v < endpointPairStart u v+endpointPairLength u v) := by + rw [endpointPairLength_cast] + simp only [endpointPairStart] + omega + +theorem endpointPair_in_window (u v : CutRing) (p : ℤ) (k : ℕ) + (hu : p ≤ endpointLabel u ∧ endpointLabel u < p+k) + (hv : p ≤ endpointLabel v ∧ endpointLabel v < p+k) : + p ≤ endpointPairStart u v ∧ endpointPairStart u v+endpointPairLength u v ≤ p+k ∧ + endpointPairLength u v ≤ k := by + have hh := endpointPairLength_cast u v + simp only [endpointPairStart] at hh ⊢ + omega + +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + +theorem axisSector_subwindow (hlarge : 15 < m+1) (n : ℕ) (g : B.CoordinateWindowLaw n) + (d : Fin 2) (k l : ℕ) (hk : k ≤ n) (hl : l ≤ n) (p q : ℤ) + (hs : p ≤ q) (he : q+l ≤ p+k) (V : polygonAlgebra a) + (hV : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) (axisWindowPrimitives d k p) i).val) V.val) + (hV' : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) (axisWindowPrimitives d l q) i).val) V.val) : + B.axisSector hlarge n g d k hk p V = B.axisSector hlarge n g d l hl q V := by + rw [B.axisSector_in_window hlarge n g d k hk p (fun _ => p) le_rfl (by omega) V hV, + B.axisSector_in_window hlarge n g d l hl q (fun _ => p) hs (by omega) V hV'] + +theorem axisInterval_copy_eq (hlarge : 15 < m+1) (n : ℕ) (g : B.CoordinateWindowLaw n) + (d : Fin 2) (k l : ℕ) (hk : k ≤ n) (hl : l ≤ n) (p q : ℤ) (u v : CutRing) + (hu : p ≤ endpointLabel u ∧ endpointLabel u < p+k) + (hv : p ≤ endpointLabel v ∧ endpointLabel v < p+k) + (hu' : q ≤ endpointLabel u ∧ endpointLabel u < q+l) + (hv' : q ≤ endpointLabel v ∧ endpointLabel v < q+l) : + B.axisSector hlarge n g d k hk p (coordinateInterval a d u v) = + B.axisSector hlarge n g d l hl q (coordinateInterval a d u v) := by + have hp := endpointPair_in_window u v p k hu hv + have hq := endpointPair_in_window u v q l hu' hv' + have hend := endpointPair_labels u v + rw [B.axisSector_subwindow hlarge n g d k (endpointPairLength u v) hk (by omega) + p (endpointPairStart u v) hp.1 hp.2.1 _ (axisInterval_resolved d k p u v hu hv) + (axisInterval_resolved d _ _ u v hend.1 hend.2), + B.axisSector_subwindow hlarge n g d l (endpointPairLength u v) hl (by omega) + q (endpointPairStart u v) hq.1 hq.2.1 _ (axisInterval_resolved d l q u v hu' hv') + (axisInterval_resolved d _ _ u v hend.1 hend.2)] + +@[simp] theorem fullGeometricSector_bot {ι : Type*} [Finite ι] (hlarge : 15 < m+1) + (P : ι → Fin 5 × (CutRing × CutRing)) + (h : ∀ I, I.card ≤ 15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb P) : + B.fullGeometricSector hlarge P h ⊥ = 1 := by + unfold fullGeometricSector + have he : resolvedPolygonMask (primitiveTests (a := a) (r := r) P) (⊥ : polygonAlgebra a).val = ∅ := by + ext ω + simp [resolvedPolygonMask] + rw [he,ActualLawfulTable.sector_empty] + +@[simp] theorem axisSector_self (hlarge : 15 < m+1) (n : ℕ) (g : B.CoordinateWindowLaw n) + (d : Fin 2) (k : ℕ) (hk : k ≤ n) (p : ℤ) (u : CutRing) : + B.axisSector hlarge n g d k hk p (coordinateInterval a d u u) = 1 := by + rw [coordinateInterval_self] + exact B.fullGeometricSector_bot hlarge _ _ + +theorem axisSector_projection (hlarge : 15 < m+1) (n : ℕ) (g : B.CoordinateWindowLaw n) + (d : Fin 2) (k : ℕ) (hk : k ≤ n) (p : ℤ) (u v : CutRing) + (hu : p ≤ endpointLabel u ∧ endpointLabel u < p+k) + (hv : p ≤ endpointLabel v ∧ endpointLabel v < p+k) : + (coverMap M (alternatingGenerator a r m hm)).comp + (B.axisSector hlarge n g d k hk p (coordinateInterval a d u v)) = + (conditionalAlternatingHom (coordinateInterval a d u v)).comp + (universalProjection (alternatingGroup (Fin (m+1)))) := + B.fullGeometricSector_projection hlarge _ _ _ (axisInterval_resolved d k p u v hu hv) + +end InitialCoverSystem +end AxisCoherence + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/ShapeTranslationUnique.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/ShapeTranslationUnique.lean new file mode 100644 index 0000000000000000000000000000000000000000..1b2f12993aae6111fb82ddf28ab31fa3f137b04a --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/ShapeTranslationUnique.lean @@ -0,0 +1,52 @@ +import Mathlib + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section ShapeTranslationUnique +open Classical Set + +theorem real_sSup_translate {A : Set ℝ} (hne : A.Nonempty) (hb : BddAbove A) (u : ℝ) : + sSup ((fun x => x+u) '' A)=sSup A+u := by + have hi : ((fun x => x+u) '' A).Nonempty := hne.image _ + have hbi : BddAbove ((fun x => x+u) '' A) := by + obtain ⟨M,hM⟩ := hb + exact ⟨M+u,by rintro y ⟨x,hx,rfl⟩; dsimp; linarith [hM hx]⟩ + apply le_antisymm + · apply csSup_le hi + rintro y ⟨x,hx,rfl⟩ + dsimp; linarith [le_csSup hb hx] + · have h : sSup A ≤ sSup ((fun x => x+u) '' A)-u := by + apply csSup_le hne + intro x hx + have hh := le_csSup hbi (show x+u∈(fun x => x+u) '' A from ⟨x,hx,rfl⟩) + linarith + linarith + +theorem bounded_coordinate_shift_unique {X Y : Type*} (A : Set X) (φ : X → ℝ) (ψ : Y → ℝ) + (hne : A.Nonempty) (hb : BddAbove (φ '' A)) (f h : X → Y) + (he : f '' A=h '' A) (u v : ℝ) + (hu : ∀x∈A,ψ (f x)=φ x+u) (hv : ∀x∈A,ψ (h x)=φ x+v) : u=v := by + have him (f : X → Y) (u : ℝ) (hf : ∀x∈A,ψ (f x)=φ x+u) : + ψ '' (f '' A)=(fun x => x+u) '' (φ '' A) := by + rw [Set.image_image,Set.image_image] + apply Set.image_congr + intro x hx + exact hf x hx + have hx := congrArg (fun T : Set Y => sSup (ψ '' T)) he + rw [him f u hu,him h v hv,real_sSup_translate (hne.image φ) hb, + real_sSup_translate (hne.image φ) hb] at hx + linarith + +end ShapeTranslationUnique + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/ShiftedSlots.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/ShiftedSlots.lean new file mode 100644 index 0000000000000000000000000000000000000000..b3e755af913a98c7a5a82a7ebb1b6335c1fcd885 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/ShiftedSlots.lean @@ -0,0 +1,280 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.Supported + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +section LocalDisplacement + +theorem supported_inv {α : Type*} {g : Equiv.Perm α} {U : Set α} + (h : SupportedIn g U) : SupportedIn g⁻¹ U := by + intro p hp + apply g.injective + change g (g.symm p) = g p + rw [g.apply_symm_apply,h p hp] + +theorem slotHom_supported {a m n : ℕ} (U : polygonAlgebra a) + (s : Fin n → Fin m × (CutRing × CutRing)) (hs : Function.Injective (SlotMap a m U s)) + (σ : Equiv.Perm (Fin n)) : + SupportedIn (slotHom U s hs σ).val (Set.range (SlotMap a m U s)) := by + intro p hp + exact slotPerm_apply_of_notMem U s hs σ hp + +theorem SupportedIn.mono {α : Type*} {g : Equiv.Perm α} {U V : Set α} + (h : SupportedIn g U) (hUV : U ⊆ V) : SupportedIn g V := + fun p hp => h p (fun hu => hp (hUV hu)) + +theorem subslots_injective {a m n : ℕ} (U : polygonAlgebra a) + (s : Fin n → Fin m × (CutRing × CutRing)) (hs : Function.Injective (SlotMap a m U s)) + (ι : Fin 3 ↪ Fin n) : Function.Injective (SlotMap a m U (s ∘ ι)) := by + rintro ⟨i,x⟩ ⟨j,y⟩ he + change SlotMap a m U s (ι i,x) = SlotMap a m U s (ι j,y) at he + have he' := hs he + exact Prod.ext (ι.injective (congrArg Prod.fst he')) (congrArg (fun p : Fin n × U.val => p.2) he') + +theorem slotHom_subcycle {a m n : ℕ} (U : polygonAlgebra a) + (s : Fin n → Fin m × (CutRing × CutRing)) (hs : Function.Injective (SlotMap a m U s)) + (ι : Fin 3 ↪ Fin n) : + slotHom U s hs (trackCycle ι) = + slotHom U (s ∘ ι) (subslots_injective U s hs ι) (trackCycle (Function.Embedding.refl _)) := by + apply Subtype.ext + apply Equiv.ext + intro p + by_cases hp : p ∈ Set.range (SlotMap a m U (s ∘ ι)) + · obtain ⟨⟨i,x⟩,rfl⟩ := hp + change slotPerm U s hs _ (SlotMap a m U s (ι i,x)) = + slotPerm U (s ∘ ι) _ _ (SlotMap a m U (s ∘ ι) (i,x)) + rw [slotPerm_apply,slotPerm_apply,trackCycle_apply] + have hi : trackCycle (Function.Embedding.refl (Fin 3)) i = i+1 := + trackCycle_apply (Function.Embedding.refl _) i + rw [hi] + rfl + · rw [slotHom_supported U (s ∘ ι) _ _ p hp] + by_cases hP : p ∈ Set.range (SlotMap a m U s) + · obtain ⟨⟨j,x⟩,rfl⟩ := hP + change slotPerm U s hs _ _ = _ + rw [slotPerm_apply] + have hj : j ∉ Set.range ι := by + rintro ⟨i,rfl⟩ + exact hp ⟨(i,x),rfl⟩ + rw [trackCycle_apply_of_notMem ι hj] + · exact slotHom_supported U s hs _ p hP + +open scoped commutatorElement in +theorem relative_normal_commutator_mem {G : Type*} [Group G] + (N A : Subgroup G) + (hN : ∀ n ∈ N, ∀ g ∈ A, g*n*g⁻¹ ∈ N) + {n g : G} (hn : n ∈ N) (hg : g ∈ A) : ⁅n,g⁆ ∈ N := by + have h := N.mul_mem hn (hN n⁻¹ (N.inv_mem hn) g hg) + simpa only [commutatorElement_def,mul_assoc] using h + +open scoped commutatorElement in + +theorem displaced_five_slot_cycle_mem {a m : ℕ} + (N : Subgroup (polygonFullGroup a m)) + (hN : ∀ n ∈ N, ∀ g ∈ polygonAlternatingGroup a m, g*n*g⁻¹ ∈ N) + (n : polygonFullGroup a m) (hn : n ∈ N) + (D : Set (TrackPoint a m)) (hD : Disjoint D (n.val '' D)) + (U : polygonAlgebra a) (hU : U.val.Nonempty) + (s : Fin 5 → Fin m × (CutRing × CutRing)) (hs : Function.Injective (SlotMap a m U s)) + (hUD : Set.range (SlotMap a m U s) ⊆ D) : + slotHom U s hs (trackCycle threeInFive) ∈ N := by + let B := slotHom U s hs (trackCycle leftThreeInFive) + let C := slotHom U s hs (trackCycle rightThreeInFive) + have hB : B ∈ polygonAlternatingGroup a m := + Subgroup.subset_closure (slotHom_cycle_isThreeSlotCycle U hU s hs _) + have hC : C ∈ polygonAlternatingGroup a m := + Subgroup.subset_closure (slotHom_cycle_isThreeSlotCycle U hU s hs _) + have hBs : SupportedIn B.val D := (slotHom_supported U s hs _).mono hUD + have hCs : SupportedIn C.val D := (slotHom_supported U s hs _).mono hUD + have he : ⁅⁅n,B⁻¹⁆,C⁆ = ⁅B,C⁆ := by + apply Subtype.ext + change ⁅⁅n.val,B.val⁻¹⁆,C.val⁆ = ⁅B.val,C.val⁆ + simpa only [inv_inv] using supported_double_commutator n.val B.val⁻¹ C.val D + (supported_inv hBs) hCs hD + have hh := relative_normal_commutator_mem N _ hN + (relative_normal_commutator_mem N _ hN hn ((polygonAlternatingGroup a m).inv_mem hB)) hC + rw [he] at hh + change ⁅slotHom U s hs (trackCycle leftThreeInFive), + slotHom U s hs (trackCycle rightThreeInFive)⁆ ∈ N at hh + rwa [← map_commutatorElement,five_cycle_commutator] at hh + +theorem polygon_separates {a : ℕ} (p q : GenericSquare a) (hpq : p ≠ q) : + ∃ U : polygonAlgebra a, p ∈ U.val ∧ q ∉ U.val := by + have hs (j : Fin 4) (hl : cutForm a j p.val < cutForm a j q.val) : + ∃ U : polygonAlgebra a, p ∈ U.val ∧ q ∉ U.val := by + obtain ⟨c,hpc,hcq⟩ := exists_cut_between hl + exact ⟨⟨halfPlane a j c,halfPlane_mem a j c⟩,hpc,not_lt.mpr hcq.le⟩ + have hr (j : Fin 4) (hl : cutForm a j q.val < cutForm a j p.val) : + ∃ U : polygonAlgebra a, p ∈ U.val ∧ q ∉ U.val := by + obtain ⟨c,hqc,hcp⟩ := exists_cut_between hl + exact ⟨⟨(halfPlane a j c)ᶜ,BooleanSubalgebra.compl_mem (halfPlane_mem a j c)⟩, + not_lt.mpr hcp.le,fun h => h hqc⟩ + by_cases hx : p.val.1 = q.val.1 + · have hy : p.val.2 ≠ q.val.2 := by + intro h + exact hpq (Subtype.ext (Prod.ext hx h)) + rcases lt_or_gt_of_ne hy with hy | hy + · exact hs 1 hy + · exact hr 1 hy + · rcases lt_or_gt_of_ne hx with hx | hx + · exact hs 0 hx + · exact hr 0 hx + +theorem exists_displaced_polygon {a m : ℕ} (n : polygonFullGroup a m) (hn : n ≠ 1) : + ∃ (t : Fin m) (U : polygonAlgebra a), U.val.Nonempty ∧ + Disjoint {p : TrackPoint a m | p.1 = t ∧ p.2 ∈ U.val} + (n.val '' {p : TrackPoint a m | p.1 = t ∧ p.2 ∈ U.val}) := by + have hex : ∃ p, n.val p ≠ p := by + by_contra! h + apply hn + apply Subtype.ext + exact Equiv.ext h + obtain ⟨p,hp⟩ := hex + obtain ⟨cs,hcs,hcover⟩ := n.property + obtain ⟨c,hc,hcp⟩ := hcover p + have hscene : n.val p = (c.target,translate a c.shift p.2) := by + have h := hcs c hc p.2 hcp.2 + simpa only [← hcp.1] using h + by_cases htrack : c.target = c.source + · have hneq : p.2 ≠ translate a c.shift p.2 := by + intro h + apply hp + rw [hscene] + exact Prod.ext (htrack.trans hcp.1.symm) h.symm + obtain ⟨V,hpV,hqV⟩ := polygon_separates p.2 (translate a c.shift p.2) hneq + let U : polygonAlgebra a := + ⟨c.domain.val ∩ V.val ∩ translate a c.shift ⁻¹' V.valᶜ, + BooleanSubalgebra.inf_mem (BooleanSubalgebra.inf_mem c.domain.property V.property) + (polygon_preimage_translate _ (BooleanSubalgebra.compl_mem V.property))⟩ + refine ⟨c.source,U,⟨p.2,⟨hcp.2,hpV⟩,hqV⟩,?_⟩ + apply Set.disjoint_left.mpr + rintro z hz ⟨y,hy,rfl⟩ + have he : n.val y = (c.target,translate a c.shift y.2) := by + simpa only [← hy.1] using hcs c hc y.2 hy.2.1.1 + rw [he] at hz + exact hy.2.2 hz.2.1.2 + · refine ⟨c.source,c.domain,⟨p.2,hcp.2⟩,?_⟩ + apply Set.disjoint_left.mpr + rintro z hz ⟨y,hy,rfl⟩ + have he : n.val y = (c.target,translate a c.shift y.2) := by + simpa only [← hy.1] using hcs c hc y.2 hy.2 + rw [he] at hz + exact htrack hz.1 + +noncomputable def shiftedSlots {m n : ℕ} (u : CutRing × CutRing) + (s : Fin n → Fin m × (CutRing × CutRing)) : Fin n → Fin m × (CutRing × CutRing) := + fun i => ((s i).1,(s i).2-u) + +private theorem untranslate_mem {a : ℕ} {U V : polygonAlgebra a} + (u : CutRing × CutRing) (hVU : V.val ⊆ (translatedPolygon u U).val) + (x : V.val) : translate a (-u) x.val ∈ U.val := by + obtain ⟨y,hy,he⟩ := hVU x.property + change translate a u y = x.val at he + rw [← he,← translate_add,neg_add_cancel,translate_zero] + exact hy + +private theorem slotMap_shifted {a m n : ℕ} {U V : polygonAlgebra a} + (u : CutRing × CutRing) (hVU : V.val ⊆ (translatedPolygon u U).val) + (s : Fin n → Fin m × (CutRing × CutRing)) (i : Fin n) (x : V.val) : + SlotMap a m V (shiftedSlots u s) (i,x) = + SlotMap a m U s (i,⟨translate a (-u) x.val,untranslate_mem u hVU x⟩) := by + simp only [SlotMap,shiftedSlots,sub_eq_add_neg,translate_add] + +private theorem shiftedSlots_injective {a m n : ℕ} {U V : polygonAlgebra a} + (u : CutRing × CutRing) (hVU : V.val ⊆ (translatedPolygon u U).val) + (s : Fin n → Fin m × (CutRing × CutRing)) + (hs : Function.Injective (SlotMap a m U s)) : + Function.Injective (SlotMap a m V (shiftedSlots u s)) := by + rintro ⟨i,x⟩ ⟨j,y⟩ he + rw [slotMap_shifted u hVU,slotMap_shifted u hVU] at he + have hh := hs he + refine Prod.ext (congrArg (fun p : Fin n × U.val => p.1) hh) (Subtype.ext ?_) + exact (translation a (-u)).injective (congrArg (fun p => p.2.val) hh) + +theorem threeSlot_eq_slotHom {a m : ℕ} {g : polygonFullGroup a m} + (hg : IsThreeSlotCycle g) : + ∃ (U : polygonAlgebra a) (s : Fin 3 → Fin m × (CutRing × CutRing)) + (hs : Function.Injective (SlotMap a m U s)), + g = slotHom U s hs (trackCycle (Function.Embedding.refl _)) := by + obtain ⟨U,s,hU,hs,hact,hfix⟩ := hg + refine ⟨U,s,hs,?_⟩ + apply Subtype.ext + apply Equiv.ext + intro p + by_cases hp : p ∈ Set.range (SlotMap a m U s) + · obtain ⟨⟨i,x⟩,rfl⟩ := hp + change g.val (SlotMap a m U s (i,x)) = slotPerm U s hs _ _ + rw [hact,slotPerm_apply] + exact (congrArg (fun j => SlotMap a m U s (j,x)) + (trackCycle_apply (Function.Embedding.refl (Fin 3)) i)).symm + · exact (hfix p hp).trans (slotPerm_apply_of_notMem U s hs _ hp).symm + +theorem alternating_le_of_nontrivial_relative_normal {a m : ℕ} (hm : 15 ≤ m) + (N : Subgroup (polygonFullGroup a m)) + (hN : ∀ n ∈ N, ∀ g ∈ polygonAlternatingGroup a m, g*n*g⁻¹ ∈ N) + (n : polygonFullGroup a m) (hn : n ∈ N) (hne : n ≠ 1) : + polygonAlternatingGroup a m ≤ N := by + obtain ⟨t,U,hU,hdis⟩ := exists_displaced_polygon n hne + obtain ⟨d,hd,hd1,s,hs,hD⟩ := five_slots_in_polygon U hU t + obtain ⟨cover,hcover⟩ := smallSquare_finite_translated_cover a d hd hd1 + apply (Subgroup.closure_le _).mpr + intro f hf + obtain ⟨V,v,hv,rfl⟩ := threeSlot_eq_slotHom hf + apply slotHom_of_finite_cover cover (fun u => translatedPolygon u (smallSquare a d)) + V v hv _ N + · intro x _ + exact hcover x + · intro u _ W hWV hWu + by_cases hW : W.val.Nonempty + · let s' := shiftedSlots u s + have hs' : Function.Injective (SlotMap a m W s') := shiftedSlots_injective u hWu s hs + have hD' : Set.range (SlotMap a m W s') ⊆ {p | p.1 = t ∧ p.2 ∈ U.val} := by + rintro p ⟨⟨i,x⟩,rfl⟩ + rw [slotMap_shifted u hWu] + exact hD ⟨_,rfl⟩ + have hlocal := displaced_five_slot_cycle_mem N hN n hn _ hdis W hW s' hs' hD' + rw [slotHom_subcycle] at hlocal + let targets := s' ∘ threeInFive + have ht := subslots_injective W s' hs' threeInFive + have hvW := SlotMap_injective_mono v hWV hv + obtain ⟨g,hg,hgact⟩ := transport_three_slots hm W v targets hvW ht + have heq := slotHom_conjugate W v targets hvW ht g hgact + (trackCycle (Function.Embedding.refl (Fin 3))) + have hc := hN _ hlocal g⁻¹ ((polygonAlternatingGroup a m).inv_mem hg) + rw [← heq] at hc + simpa only [inv_inv,mul_assoc,inv_mul_cancel_left,mul_inv_cancel_right,inv_mul_cancel,mul_one] using hc + · rw [slotHom_empty W v _ _ (Set.not_nonempty_iff_eq_empty.mp hW)] + exact N.one_mem + +theorem polygonAlternatingGroup_simple (a m : ℕ) (hm : 15 ≤ m) : + IsSimpleGroup (polygonAlternatingGroup a m) := by + rw [Subgroup.isSimpleGroup_iff] + have hinf := polygonAlternatingGroup_infinite a m (by omega) + let : Infinite (polygonAlternatingGroup a m) := hinf + refine ⟨(polygonAlternatingGroup a m).nontrivial_iff_ne_bot.mp inferInstance,?_⟩ + intro N hNA hnormal + by_cases hN : N = ⊥ + · exact Or.inl hN + · right + apply le_antisymm hNA + have hex : ∃ n ∈ N, n ≠ 1 := by + by_contra! h + exact hN ((Subgroup.eq_bot_iff_forall N).mpr h) + obtain ⟨n,hn,hne⟩ := hex + apply alternating_le_of_nontrivial_relative_normal hm N ?_ n hn hne + intro x hx g hg + have hh := hnormal.conj_mem (⟨x,hNA hx⟩ : polygonAlternatingGroup a m) hx + (⟨g,hg⟩ : polygonAlternatingGroup a m) + exact hh + +end LocalDisplacement + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/SmallControlCalculus.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/SmallControlCalculus.lean new file mode 100644 index 0000000000000000000000000000000000000000..34642f39a17c478775ae0f509a94234d34e75389 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/SmallControlCalculus.lean @@ -0,0 +1,114 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.OperationalControl +import OAI.GroupTheory.SimpleAmenable.CentralCovers.FullAlphabetGeneration + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section SmallControlCalculus +variable {α H : Type*} [Fintype α] [DecidableEq α] [Group H] + [Group.IsPerfect (alternatingGroup α)] + +abbrev ControlAlphabet (α : Type*) [Fintype α] [DecidableEq α] := + {I : Finset α // 5 ≤ I.card ∧ I.card ≤ 10} + +instance controlAlphabet_perfect (I : ControlAlphabet α) : + Group.IsPerfect (alternatingGroup I.val) := alphabetPerfect I.val I.property.1 + +abbrev TrackStar (α : Type*) [Fintype α] [DecidableEq α] := + UniversalExtension (alternatingGroup α) + +def SmallSupported (L : Finset α → Subgroup H) (f : TrackStar α →* H) : Prop := + ∀ I : ControlAlphabet α, (f.comp (universalMap (subtypeAlternatingHom I.val))).range ≤ L I.val + +def SmallControlled (c : alternatingGroup α →* H) (f g : TrackStar α →* H) : Prop := + ∀ I : ControlAlphabet α, + SameActionOn (g.comp (universalMap (subtypeAlternatingHom I.val))) + ((c.comp (universalProjection (alternatingGroup α))).comp + (universalMap (subtypeAlternatingHom I.val))) f.range + +omit [Fintype α] [DecidableEq α] [Group.IsPerfect (alternatingGroup α)] in +theorem five_bank_of_card (I : Finset α) (hI : I.card = 5) : + ∃ s : Fin 5 ↪ α, Finset.univ.map s = I := by + classical + let e : Fin 5 ≃ I := (Fintype.equivFinOfCardEq (by simpa using hI)).symm + let s := e.toEmbedding.trans (Function.Embedding.subtype (· ∈ I)) + refine ⟨s,?_⟩ + ext x + constructor + · rintro hx + obtain ⟨i,_,rfl⟩ := Finset.mem_map.mp hx + exact (e i).property + · intro hx + obtain ⟨i,hi⟩ := e.surjective ⟨x,hx⟩ + exact Finset.mem_map.mpr ⟨i,Finset.mem_univ _,congrArg Subtype.val hi⟩ + +omit [Group.IsPerfect (alternatingGroup α)] in + +theorem small_star_representative (hα : 10 ≤ Fintype.card α) + (σ : alternatingGroup α) (hσ : σ.val.support.card ≤ 10) : + ∃ (I : ControlAlphabet α) (t : UniversalExtension (alternatingGroup I.val)), + subtypeAlternatingHom I.val (universalProjection (alternatingGroup I.val) t) = σ := by + obtain ⟨I,hSI,_,hI⟩ := Finset.exists_subsuperset_card_eq + (Finset.subset_univ σ.val.support) hσ (by simpa using hα) + let J : ControlAlphabet α := ⟨I,by omega,by omega⟩ + obtain ⟨s,hs⟩ := (subtypeAlternatingHom_mem_range I σ).mpr hSI + let := alphabetPerfect I (by omega) + obtain ⟨t,ht⟩ := universalProjection_surjective (alternatingGroup J.val) s + exact ⟨J,t,by simpa only [ht] using hs⟩ + +theorem small_control_transfer (L : Finset α → Subgroup H) + (c : alternatingGroup α →* H) + (hc : ∀ σ I, ∀ x ∈ L I, c σ*x*(c σ)⁻¹ ∈ L (I.map σ.val.toEmbedding)) + (hd : ∀ I J, Disjoint I J → ∀ x ∈ L I, ∀ y ∈ L J, Commute x y) + (f g : TrackStar α →* H) (hf : SmallSupported L f) (hfg : SmallControlled c f g) + (J : Finset α) (u : H) (hu : u ∈ L J) (hreserve : J.card+10 ≤ Fintype.card α) + (hug : ∀ (I : ControlAlphabet α) t, Commute u (g (universalMap (subtypeAlternatingHom I.val) t))) : + ∀ x ∈ f.range, Commute u x := by + classical + let C := Subgroup.centralizer ({u} : Set H) + have hC : f.range ≤ C := by + rw [MonoidHom.range_eq_map,← universal_five_alphabet_generate (by omega : 5 ≤ Fintype.card α), + Subgroup.map_iSup] + apply iSup_le + intro I + rw [← MonoidHom.range_comp] + rintro x ⟨t,rfl⟩ + let A : ControlAlphabet α := ⟨I.val,by have hh := I.property.2; omega,by have hh := I.property.2; omega⟩ + have hx : f (universalMap (subtypeAlternatingHom I.val) t) ∈ L I.val := + hf A ⟨t,rfl⟩ + obtain ⟨s,hs⟩ := five_bank_of_card I.val I.property.2 + have hx' : f (universalMap (subtypeAlternatingHom I.val) t) ∈ L (Finset.univ.map s) := by + rwa [hs] + have hres : (J ∪ Finset.univ.map s).card + 5 ≤ Fintype.card α := by + rw [hs] + have hh := Finset.card_union_le J I.val + rw [I.property.2] at hh + omega + have hh := fresh_bank_conditional_control L c hc hd s J u + (f (universalMap (subtypeAlternatingHom I.val) t)) hu hx' hres ?_ + · intro y hy + obtain rfl := Set.mem_singleton_iff.mp hy + exact hh.eq + · intro σ hσ + obtain ⟨K,v,hv⟩ := small_star_representative (by omega : 10 ≤ Fintype.card α) σ hσ + refine ⟨g (universalMap (subtypeAlternatingHom K.val) v),hug K v,?_⟩ + have hh := hfg K v _ ⟨universalMap (subtypeAlternatingHom I.val) t,rfl⟩ + have he := DFunLike.congr_fun (universalMap_spec (subtypeAlternatingHom K.val)) v + change universalProjection (alternatingGroup α) (universalMap (subtypeAlternatingHom K.val) v) = _ at he + simpa only [MonoidHom.comp_apply,he,hv] using hh + intro x hx + exact hC hx u (Set.mem_singleton u) + +end SmallControlCalculus + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/SmallControlTransfer.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/SmallControlTransfer.lean new file mode 100644 index 0000000000000000000000000000000000000000..8cbeb49b67d3dbdacc3e7d28c7272ebd386e57be --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/SmallControlTransfer.lean @@ -0,0 +1,115 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.SmallControlCalculus + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section SmallControlTransfer +variable {α H : Type*} [Fintype α] [DecidableEq α] [Group H] + [Group.IsPerfect (alternatingGroup α)] + (L : Finset α → Subgroup H) (c : alternatingGroup α →* H) + (hc : ∀ σ I, ∀ x ∈ L I, c σ*x*(c σ)⁻¹ ∈ L (I.map σ.val.toEmbedding)) + (hd : ∀ I J, Disjoint I J → ∀ x ∈ L I, ∀ y ∈ L J, Commute x y) + +include hc hd in + +theorem small_control_comparison (f g : TrackStar α →* H) + (hf : SmallSupported L f) (hfg : SmallControlled c f g) + (J : Finset α) (u v : H) (hu : u ∈ L J) (hv : v ∈ L J) + (hreserve : J.card+10 ≤ Fintype.card α) + (hact : ∀ (I : ControlAlphabet α) t, + u*g (universalMap (subtypeAlternatingHom I.val) t)*u⁻¹ = + v*g (universalMap (subtypeAlternatingHom I.val) t)*v⁻¹) : + ∀ x ∈ f.range, u*x*u⁻¹ = v*x*v⁻¹ := by + have hh := small_control_transfer L c hc hd f g hf hfg J (u⁻¹*v) + ((L J).mul_mem ((L J).inv_mem hu) hv) hreserve + (fun I t => (same_conj_iff _ _ _).mp (hact I t)) + intro x hx + exact (same_conj_iff _ _ _).mpr (hh x hx) + +include hc hd in + +theorem small_control_trans (hα : 20 ≤ Fintype.card α) + (hconst : SmallSupported L (c.comp (universalProjection (alternatingGroup α)))) + (f g k : TrackStar α →* H) (hf : SmallSupported L f) (hk : SmallSupported L k) + (hfg : SmallControlled c f g) (hgk : SmallControlled c g k) : + SmallControlled c f k := by + intro I t x hx + apply small_control_comparison L c hc hd f g hf hfg I.val + (k (universalMap (subtypeAlternatingHom I.val) t)) + (c (universalProjection (alternatingGroup α) (universalMap (subtypeAlternatingHom I.val) t))) + (hk I ⟨t,rfl⟩) (hconst I ⟨t,rfl⟩) (by have hh := I.property.2; omega) ?_ x hx + intro J s + exact hgk I t _ ⟨universalMap (subtypeAlternatingHom J.val) s,rfl⟩ + +include hc hd in + +theorem small_control_disjoint (hα : 20 ≤ Fintype.card α) + (f g j k : TrackStar α →* H) + (hf : SmallSupported L f) (hg : SmallSupported L g) (hj : SmallSupported L j) + (hfj : SmallControlled c f j) (hgk : SmallControlled c g k) + (hjk : ∀ s t, Commute (j s) (k t)) : ∀ s t, Commute (f s) (g t) := by + have hjg (I : ControlAlphabet α) (s : UniversalExtension (alternatingGroup I.val)) : + ∀ x ∈ g.range, Commute (j (universalMap (subtypeAlternatingHom I.val) s)) x := + small_control_transfer L c hc hd g k hg hgk I.val _ (hj I ⟨s,rfl⟩) + (by have hh := I.property.2; omega) (fun J t => hjk _ _) + have hfg (I : ControlAlphabet α) (t : UniversalExtension (alternatingGroup I.val)) : + ∀ x ∈ f.range, Commute (g (universalMap (subtypeAlternatingHom I.val) t)) x := + small_control_transfer L c hc hd f j hf hfj I.val _ (hg I ⟨t,rfl⟩) + (by have hh := I.property.2; omega) + (fun J s => (hjg J s _ ⟨universalMap (subtypeAlternatingHom I.val) t,rfl⟩).symm) + intro s + let C := Subgroup.centralizer ({f s} : Set H) + have hC : g.range ≤ C := by + rw [MonoidHom.range_eq_map,← universal_five_alphabet_generate (by omega : 5 ≤ Fintype.card α), + Subgroup.map_iSup] + apply iSup_le + intro I + rw [← MonoidHom.range_comp] + rintro x ⟨t,rfl⟩ y hy + obtain rfl := Set.mem_singleton_iff.mp hy + let J : ControlAlphabet α := ⟨I.val,by have hh := I.property.2; omega, + by have hh := I.property.2; omega⟩ + exact (hfg J t _ ⟨s,rfl⟩).eq.symm + intro t + exact hC ⟨t,rfl⟩ (f s) (Set.mem_singleton _) + +theorem small_control_intersection (f a b d e : TrackStar α →* H) + (hbd : ∀ s t, Commute (b s) (d t)) + (hbe : ∀ s t, Commute (b s) (e t)) + (hde : ∀ s t, Commute (d s) (e t)) + (hwhole : ∀ s, c (universalProjection (alternatingGroup α) s) = a s*b s*d s*e s) + (hJ : ∀ I : ControlAlphabet α, + SameActionOn (fun t => a (universalMap (subtypeAlternatingHom I.val) t)* + b (universalMap (subtypeAlternatingHom I.val) t)) + ((c.comp (universalProjection (alternatingGroup α))).comp + (universalMap (subtypeAlternatingHom I.val))) f.range) + (hK : ∀ I : ControlAlphabet α, + SameActionOn (fun t => a (universalMap (subtypeAlternatingHom I.val) t)* + d (universalMap (subtypeAlternatingHom I.val) t)) + ((c.comp (universalProjection (alternatingGroup α))).comp + (universalMap (subtypeAlternatingHom I.val))) f.range) : + SmallControlled c f a := by + intro I + exact intersection_control + (a.comp (universalMap (subtypeAlternatingHom I.val))) + (b.comp (universalMap (subtypeAlternatingHom I.val))) + (d.comp (universalMap (subtypeAlternatingHom I.val))) + (e.comp (universalMap (subtypeAlternatingHom I.val))) + ((c.comp (universalProjection (alternatingGroup α))).comp + (universalMap (subtypeAlternatingHom I.val))) f.range + (fun s t => hbd _ _) (fun s t => hbe _ _) (fun s t => hde _ _) + (fun s => hwhole _) (hJ I) (hK I) + +end SmallControlTransfer + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/SmallFamilyWords.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/SmallFamilyWords.lean new file mode 100644 index 0000000000000000000000000000000000000000..17e55b2a8492c0725f462d199e6357baf4e604db --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/SmallFamilyWords.lean @@ -0,0 +1,193 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.SmallSectorGeneration + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section SmallFamilyWords + +variable {α ι Ω H : Type*} [Fintype α] [DecidableEq α] [Group H] + +abbrev FiveAlphabet (α : Type*) [Fintype α] [DecidableEq α] := + FiveSubalphabet (Finset.univ : Finset α) + +abbrev SmallFamilyLabel (α ι : Type*) [Fintype α] [DecidableEq α] := + Σ I : FiveAlphabet α, Option ι × alternatingGroup I.val + +abbrev SmallFamilyWord (α ι : Type*) [Fintype α] [DecidableEq α] := + FreeGroup (SmallFamilyLabel α ι) + +noncomputable def smallFamilyEval + (F : (I : FiveAlphabet α) → Option ι → alternatingGroup I.val →* H) : + SmallFamilyWord α ι →* H := FreeGroup.lift (fun l => F l.1 l.2.1 l.2.2) + +@[simp] theorem smallFamilyEval_of + (F : (I : FiveAlphabet α) → Option ι → alternatingGroup I.val →* H) + (I : FiveAlphabet α) (i : Option ι) (s : alternatingGroup I.val) : + smallFamilyEval F (FreeGroup.of ⟨I,i,s⟩) = F I i s := FreeGroup.lift_apply_of + +theorem smallFamilyEval_range + (F : (I : FiveAlphabet α) → Option ι → alternatingGroup I.val →* H) : + (smallFamilyEval F).range = ⨆ I, ⨆ i, (F I i).range := by + rw [smallFamilyEval,FreeGroup.range_lift_eq_closure] + apply le_antisymm + · apply (Subgroup.closure_le _).mpr + rintro _ ⟨⟨I,i,s⟩,rfl⟩ + exact (le_iSup (fun I => ⨆ i, (F I i).range) I) + ((le_iSup (fun i => (F I i).range) i) ⟨s,rfl⟩) + · apply iSup_le + intro I + apply iSup_le + rintro i x ⟨s,rfl⟩ + exact Subgroup.subset_closure ⟨⟨I,i,s⟩,rfl⟩ + +theorem smallFamilyEval_perfect + (F : (I : FiveAlphabet α) → Option ι → alternatingGroup I.val →* H) : + Group.IsPerfect (smallFamilyEval F).range := by + rw [smallFamilyEval_range] + let (I : FiveAlphabet α) (i : Option ι) : Group.IsPerfect (F I i).range := + Group.IsPerfect.range (F I i) + let (I : FiveAlphabet α) : Group.IsPerfect ↥(⨆ i, (F I i).range) := + perfect_iSup (fun i => (F I i).range) + exact perfect_iSup (fun I => ⨆ i, (F I i).range) + +noncomputable def smallFamilyLocal (S : Finset α) : Subgroup (SmallFamilyWord α ι) := + Subgroup.closure {w | ∃ l : SmallFamilyLabel α ι, l.1.val ⊆ S ∧ w = FreeGroup.of l} + +theorem smallFamilyLocal_mono : Monotone (smallFamilyLocal (α := α) (ι := ι)) := by + intro S T hST + apply Subgroup.closure_mono + rintro w ⟨l,hl,rfl⟩ + exact ⟨l,hl.trans hST,rfl⟩ + +theorem smallFamilyLocal_of (l : SmallFamilyLabel α ι) {S : Finset α} (h : l.1.val ⊆ S) : + FreeGroup.of l ∈ smallFamilyLocal (ι := ι) S := + Subgroup.subset_closure ⟨l,h,rfl⟩ + +theorem smallFamilyLocal_generate : + Subgroup.closure {w : SmallFamilyWord α ι | ∃ S : Finset α, + S.card ≤ 5 ∧ w ∈ smallFamilyLocal S} = ⊤ := by + apply top_unique + rw [← FreeGroup.closure_range_of] + apply Subgroup.closure_mono + rintro w ⟨l,rfl⟩ + exact ⟨l.1.val,by rw [l.1.property.2],smallFamilyLocal_of l (Finset.Subset.refl _)⟩ + +noncomputable def alphabetAssignment (I : Finset α) : + (Ω → alternatingGroup I) →* (Ω → alternatingGroup α) where + toFun g ω := subtypeAlternatingHom I (g ω) + map_one' := by funext ω; exact map_one _ + map_mul' g h := by funext ω; exact map_mul _ _ _ + +theorem alphabetAssignment_support (I : Finset α) (g : Ω → alternatingGroup I) (ω : Ω) : + ((alphabetAssignment I g) ω).val.support ⊆ I := + (subtypeAlternatingHom_mem_range I _).mp ⟨g ω,rfl⟩ + +theorem alphabetAssignment_range (I : Finset α) (g : Ω → alternatingGroup α) : + g ∈ (alphabetAssignment (Ω := Ω) I).range ↔ ∀ ω, (g ω).val.support ⊆ I := by + constructor + · rintro ⟨g,rfl⟩ + exact alphabetAssignment_support I g + · intro h + choose f hf using fun ω => (subtypeAlternatingHom_mem_range I (g ω)).mpr (h ω) + exact ⟨f,funext hf⟩ + +theorem alphabetAssignment_mask (I : Finset α) (U : ι → Set Ω) (i : Option ι) : + (alphabetAssignment I).comp (maskFamily U i) = + (maskFamily U i).comp (subtypeAlternatingHom I) := by + classical + ext s ω + cases i with + | none => simp [alphabetAssignment,maskFamily,sectorMask] + | some i => by_cases h : ω ∈ U i <;> simp [alphabetAssignment,maskFamily,sectorMask,h] + +noncomputable def smallFamilyModel (U : ι → Set Ω) : + SmallFamilyWord α ι →* (Ω → alternatingGroup α) := + smallFamilyEval (fun I i => (maskFamily U i).comp (subtypeAlternatingHom I.val)) + +theorem smallFamilyModel_support (U : ι → Set Ω) (S : Finset α) + (w : SmallFamilyWord α ι) (hw : w ∈ smallFamilyLocal S) : + ∀ ω, ((smallFamilyModel U w) ω).val.support ⊆ S := by + apply (alphabetAssignment_range S _).mp + have hh : smallFamilyLocal (ι := ι) S ≤ + ((alphabetAssignment (Ω := Ω) S).range).comap (smallFamilyModel U) := by + apply (Subgroup.closure_le _).mpr + rintro x ⟨l,hl,rfl⟩ + apply (alphabetAssignment_range S _).mpr + intro ω + classical + have hs := (subtypeAlternatingHom_mem_range l.1.val _).mp ⟨l.2.2,rfl⟩ + change ((maskFamily U l.2.1 (subtypeAlternatingHom l.1.val l.2.2)) ω).val.support ⊆ S + cases l.2.1 with + | none => simpa [maskFamily,sectorMask] using hs.trans hl + | some i => + by_cases h : ω ∈ U i + · simpa [maskFamily,sectorMask,h] using hs.trans hl + · simp [maskFamily,sectorMask,h] + exact hh hw + +end SmallFamilyWords + +section SmallFamilyComplete +variable {α ι Ω H : Type*} [Fintype α] [DecidableEq α] [Group H] + +theorem smallFamilyModel_mask_mem (U : ι → Set Ω) (S : Finset α) (hS : 5 ≤ S.card) + (i : Option ι) (s : alternatingGroup S) : + maskFamily U i (subtypeAlternatingHom S s) ∈ + (smallFamilyLocal S).map (smallFamilyModel U) := by + let K := ((smallFamilyLocal S).map (smallFamilyModel U)).comap + ((maskFamily U i).comp (subtypeAlternatingHom S)) + have hK : K = ⊤ := by + apply top_unique + rw [← subalphabet_five_generate S hS] + apply iSup_le + intro I x hx + obtain ⟨t,rfl⟩ := hx + let I' : FiveAlphabet α := ⟨I.val,Finset.subset_univ _,I.property.2⟩ + refine ⟨FreeGroup.of ⟨I',i,t⟩,smallFamilyLocal_of _ I.property.1,?_⟩ + change maskFamily U i (subtypeAlternatingHom I.val t) = + maskFamily U i (subtypeAlternatingHom S (subalphabetHom I.property.1 t)) + exact congrArg (maskFamily U i) + (DFunLike.congr_fun (subtypeAlternatingHom_comp I.property.1) t).symm + exact (show s ∈ K from hK ▸ Subgroup.mem_top s) + +theorem smallFamilyModel_complete [Finite ι] [Finite Ω] + (U : ι → Set Ω) (hsep : ∀ ω ν, (∀ i, ω ∈ U i ↔ ν ∈ U i) → ω = ν) + (S : Finset α) (hS : 5 ≤ S.card) (g : Ω → alternatingGroup α) + (hg : ∀ ω, (g ω).val.support ⊆ S) : + ∃ w ∈ smallFamilyLocal S, smallFamilyModel U w = g := by + let : Group.IsPerfect (alternatingGroup S) := alphabetPerfect S hS + obtain ⟨t,ht⟩ := (alphabetAssignment_range S g).mpr hg + let K := ((smallFamilyLocal S).map (smallFamilyModel U)).comap (alphabetAssignment S) + have hm (i : Option ι) (s : alternatingGroup S) : maskFamily U i s ∈ K := by + change alphabetAssignment S (maskFamily U i s) ∈ + (smallFamilyLocal S).map (smallFamilyModel U) + rw [← MonoidHom.comp_apply,alphabetAssignment_mask] + exact smallFamilyModel_mask_mem U S hS i s + have hK : K = ⊤ := assignment_group_generated U hsep K (hm none) (fun i => hm (some i)) + have htK : t ∈ K := hK ▸ Subgroup.mem_top t + change alphabetAssignment S t ∈ (smallFamilyLocal S).map (smallFamilyModel U) at htK + rwa [ht] at htK + +theorem smallFamilyLocal_map_le + (F : (I : FiveAlphabet α) → Option ι → alternatingGroup I.val →* H) + (S : Finset α) (K : Subgroup H) + (h : ∀ I, I.val ⊆ S → ∀ i, (F I i).range ≤ K) : + (smallFamilyLocal S).map (smallFamilyEval F) ≤ K := by + apply (Subgroup.map_le_iff_le_comap).mpr + apply (Subgroup.closure_le _).mpr + rintro x ⟨l,hl,rfl⟩ + exact h l.1 hl l.2.1 ⟨l.2.2,(FreeGroup.lift_apply_of).symm⟩ + +end SmallFamilyComplete + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/SortedAxisCuts.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/SortedAxisCuts.lean new file mode 100644 index 0000000000000000000000000000000000000000..a528fa78479b14e05f6950827e41aaf46613989a --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/SortedAxisCuts.lean @@ -0,0 +1,193 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.AxisCutSequences + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section SortedAxisCuts +attribute [local instance] cutOrdinaryOrder + +noncomputable def sortedAxisCutSequence (n k N : ℕ) (p : ℤ) (u v : CutRing) + (S : Finset CutRing) (hu : u ∈ S) (hv : v ∈ S) + (hbound : ∀ z ∈ S, ordinary u ≤ ordinary z ∧ ordinary z ≤ ordinary v) + (hlabels : ∀ z ∈ S, p ≤ endpointLabel z ∧ endpointLabel z < p+N) + (hoveru : p+(N:ℤ)-k ≤ endpointLabel u ∧ endpointLabel u < p+k) + (hoverv : p+(N:ℤ)-k ≤ endpointLabel v ∧ endpointLabel v < p+k) + (_hkN : k ≤ N) (_hNk : N ≤ 2*k) (hkn : k ≤ n*9/10) : AxisCutSequence n (S.card-1) := by + classical + have hS : 0 < S.card := Finset.card_pos.mpr ⟨u,hu⟩ + have hcard : S.card = S.card-1+1 := by omega + let f : Fin (S.card-1+1) ↪o CutRing := S.orderEmbOfFin hcard + have hmem (i) : f i ∈ S := Finset.orderEmbOfFin_mem S hcard i + have hsurj : ∀ z ∈ S, ∃ i, f i=z := by + intro z hz + have hh : z ∈ Set.range f := by + change z ∈ Set.range (S.orderEmbOfFin hcard) + rw [Finset.range_orderEmbOfFin] + exact hz + exact hh + have hzero : f 0=u := by + obtain ⟨i,hi⟩ := hsurj u hu + apply ordinary_injective + apply le_antisymm + · have hh := f.monotone (Fin.zero_le i) + change ordinary (f 0) ≤ ordinary (f i) at hh + simpa only [hi] using hh + · exact (hbound _ (hmem 0)).1 + have hlast : f (Fin.last (S.card-1))=v := by + obtain ⟨i,hi⟩ := hsurj v hv + apply ordinary_injective + apply le_antisymm + · exact (hbound _ (hmem _)).2 + · have hh := f.monotone (Fin.le_last i) + change ordinary (f i) ≤ ordinary (f (Fin.last (S.card-1))) at hh + simpa only [hi] using hh + refine { + cut := f + strictMono := f.strictMono + length := fun _ => k + start := fun i => if endpointLabel (f i) < p+k then p else p+(N:ℤ)-k + length_le := fun _ => hkn + lower_label := ?_ + upper_label := ?_ + cut_label := ?_ } + · intro i + rw [hzero] + split_ifs <;> have hh := hlabels u hu <;> constructor <;> omega + · intro i + rw [hlast] + split_ifs <;> have hh := hlabels v hv <;> constructor <;> omega + · intro i + have hh := hlabels (f i) (hmem i) + split_ifs <;> constructor <;> omega + +noncomputable def labelLift (u : CutRing) (q : ℤ) : CutRing := + u+cutFraction ((q:CutRing)*cutTau-u) + +@[simp] theorem endpointLabel_labelLift (u : CutRing) (q : ℤ) : endpointLabel (labelLift u q)=q := by + simp [labelLift,endpointLabel_add,endpointLabel_sub] + +theorem labelLift_bounds (u : CutRing) (q : ℤ) : + ordinary u ≤ ordinary (labelLift u q) ∧ ordinary (labelLift u q) < ordinary u+1 := by + simp only [labelLift,map_add,ordinary_cutFraction] + have hh := Int.fract_nonneg (ordinary ((q:CutRing)*cutTau-u)) + have hh' := Int.fract_lt_one (ordinary ((q:CutRing)*cutTau-u)) + constructor <;> linarith + +theorem labelLift_eq (u z : CutRing) (hz : ordinary u ≤ ordinary z ∧ ordinary z < ordinary u+1) : + labelLift u (endpointLabel z)=z := by + have hc : cutFraction (((endpointLabel z:CutRing)*cutTau)-u) = cutFraction (z-u) := by + rw [cutFraction_label (((endpointLabel z:CutRing)*cutTau)-u),cutFraction_label (z-u)] + simp only [endpointLabel_sub,endpointLabel_labelTau] + rw [labelLift,hc,cutFraction_eq_self (z-u) (by simp only [map_sub]; constructor <;> linarith)] + ring + +noncomputable def anchorCutSet (N : ℕ) (p : ℤ) (u v : CutRing) : Finset CutRing := by + classical + exact insert u (insert v ((Finset.univ.image fun i : Fin N => labelLift u (p+(i.val:ℤ))).filter + fun z => ordinary z ≤ ordinary v)) + +theorem anchorCutSet_lower (N : ℕ) (p : ℤ) (u v : CutRing) : u ∈ anchorCutSet N p u v := by + classical + simp only [anchorCutSet,Finset.mem_insert_self] + +theorem anchorCutSet_upper (N : ℕ) (p : ℤ) (u v : CutRing) : v ∈ anchorCutSet N p u v := by + classical + simp [anchorCutSet] + +theorem anchorCutSet_bounds (N : ℕ) (p : ℤ) (u v : CutRing) (huv : ordinary u ≤ ordinary v) : + ∀ z ∈ anchorCutSet N p u v, ordinary u ≤ ordinary z ∧ ordinary z ≤ ordinary v := by + classical + intro z hz + simp only [anchorCutSet,Finset.mem_insert,Finset.mem_filter,Finset.mem_image,Finset.mem_univ,true_and] at hz + rcases hz with rfl | rfl | ⟨⟨i,rfl⟩,hz⟩ + · exact ⟨le_rfl,huv⟩ + · exact ⟨huv,le_rfl⟩ + · exact ⟨(labelLift_bounds u _).1,hz⟩ + +theorem anchorCutSet_labels (N : ℕ) (p : ℤ) (u v : CutRing) + (hu : p ≤ endpointLabel u ∧ endpointLabel u < p+N) + (hv : p ≤ endpointLabel v ∧ endpointLabel v < p+N) : + ∀ z ∈ anchorCutSet N p u v, p ≤ endpointLabel z ∧ endpointLabel z < p+N := by + classical + intro z hz + simp only [anchorCutSet,Finset.mem_insert,Finset.mem_filter,Finset.mem_image,Finset.mem_univ,true_and] at hz + rcases hz with rfl | rfl | ⟨⟨i,rfl⟩,_⟩ + · exact hu + · exact hv + · rw [endpointLabel_labelLift]; constructor <;> omega + +theorem mem_anchorCutSet (N : ℕ) (p : ℤ) (u v z : CutRing) + (hl : p ≤ endpointLabel z ∧ endpointLabel z < p+N) + (hz : ordinary u ≤ ordinary z ∧ ordinary z ≤ ordinary v) + (hlen : ordinary v-ordinary u < 1) : z ∈ anchorCutSet N p u v := by + classical + apply Finset.mem_insert_of_mem + apply Finset.mem_insert_of_mem + apply Finset.mem_filter.mpr + refine ⟨?_,hz.2⟩ + have hn : (endpointLabel z-p).toNat < N := by omega + apply Finset.mem_image.mpr + refine ⟨⟨(endpointLabel z-p).toNat,hn⟩,Finset.mem_univ _,?_⟩ + have hh : p+(((endpointLabel z-p).toNat:ℕ):ℤ) = endpointLabel z := by omega + rw [hh] + exact labelLift_eq u z ⟨hz.1,by linarith⟩ + +end SortedAxisCuts + +section SortedAxisCutSpecs +attribute [local instance] cutOrdinaryOrder +variable (n k N : ℕ) (p : ℤ) (u v : CutRing) + (S : Finset CutRing) (hu : u ∈ S) (hv : v ∈ S) + (hbound : ∀ z ∈ S, ordinary u ≤ ordinary z ∧ ordinary z ≤ ordinary v) + (hlabels : ∀ z ∈ S, p ≤ endpointLabel z ∧ endpointLabel z < p+N) + (hoveru : p+(N:ℤ)-k ≤ endpointLabel u ∧ endpointLabel u < p+k) + (hoverv : p+(N:ℤ)-k ≤ endpointLabel v ∧ endpointLabel v < p+k) + (hkN : k ≤ N) (hNk : N ≤ 2*k) (hkn : k ≤ n*9/10) +local notation "D" => sortedAxisCutSequence n k N p u v S hu hv hbound hlabels hoveru hoverv hkN hNk hkn + +theorem sortedAxisCutSequence_mem (i) : (D).cut i ∈ S := by + exact Finset.orderEmbOfFin_mem S _ i + +theorem sortedAxisCutSequence_range : Set.range (D).cut = (S : Set CutRing) := by + exact Finset.range_orderEmbOfFin S _ + +theorem sortedAxisCutSequence_lower : (D).cut 0=u := by + have hh : u ∈ Set.range (D).cut := by + rw [sortedAxisCutSequence_range] + exact hu + obtain ⟨i,hi⟩ := hh + apply ordinary_injective + apply le_antisymm + · have hh := ((D).ordered i).1 + simpa only [hi] using hh + · exact (hbound _ (sortedAxisCutSequence_mem n k N p u v S hu hv hbound hlabels hoveru hoverv hkN hNk hkn 0)).1 + +theorem sortedAxisCutSequence_upper : (D).cut (Fin.last (S.card-1))=v := by + have hh : v ∈ Set.range (D).cut := by + rw [sortedAxisCutSequence_range] + exact hv + obtain ⟨i,hi⟩ := hh + apply ordinary_injective + apply le_antisymm + · exact (hbound _ (sortedAxisCutSequence_mem n k N p u v S hu hv hbound hlabels hoveru hoverv hkN hNk hkn _)).2 + · have hh := ((D).ordered i).2 + simpa only [hi] using hh + +theorem sortedAxisCutSequence_length (i) : (D).length i=k := rfl + +theorem sortedAxisCutSequence_start (i) : (D).start i = + if endpointLabel ((D).cut i) constructor <;> linarith + rw [translated_clippedSlope_lift r j hr u p t ht (hbox u hu), + translated_clippedSlope_lift r j hr v p t ht (hbox v hv),hline] + · simp only [hp,and_false] + +theorem integralCutForm_tangent (a : ℕ) (d : CutRing) : + integralCutForm a 2 (d,cutTau^a*d) = 0 := by + simp [integralCutForm] + +theorem integralCutForm_tangent_swapped (a : ℕ) (d : CutRing) : + integralCutForm a 3 (cutTau^a*d,d) = 0 := by + simp [integralCutForm] + +end SpatialChartGeometry + +section ChartTransforms + +@[simp] theorem spatialTranslate_inter {a : ℕ} (z : CutRing × CutRing) + (U V : polygonAlgebra a) : spatialTranslate z (U ⊓ V) = + spatialTranslate z U ⊓ spatialTranslate z V := rfl + +@[simp] theorem spatialTranslate_compl {a : ℕ} (z : CutRing × CutRing) + (U : polygonAlgebra a) : spatialTranslate z Uᶜ = (spatialTranslate z U)ᶜ := rfl + +theorem spatialTranslate_mono {a : ℕ} (z : CutRing × CutRing) + {U V : polygonAlgebra a} (h : U ≤ V) : spatialTranslate z U ≤ spatialTranslate z V := + fun _ hp => h hp + +theorem spatialTranslate_resolved {a : ℕ} {ι : Type*} + (U : ι → polygonAlgebra a) (V : polygonAlgebra a) + (hV : ResolvedBy (fun i => (U i).val) V.val) (z : CutRing × CutRing) : + ResolvedBy (fun i => (spatialTranslate z (U i)).val) (spatialTranslate z V).val := by + intro x y he + exact hV (translate a (-z) x) (translate a (-z) y) he + +theorem spatialTranslate_coordinateInterval {a : ℕ} (z : CutRing × CutRing) + (j : Fin 2) (u v : CutRing) : + spatialTranslate z (coordinateInterval a j u v) = + coordinateInterval a j (u+(if j=0 then z.1 else z.2)) + (v+(if j=0 then z.1 else z.2)) := by + apply Subtype.ext + ext p + have hfract (x y : ℝ) : Int.fract (Int.fract x+y) = Int.fract (x+y) := by + change Int.fract (x-(⌊x⌋:ℝ)+y) = _ + rw [sub_add_eq_add_sub,Int.fract_sub_intCast] + have hsub (x y : CutRing) : v+x-(u+y) = v-u+(x-y) := by ring + fin_cases j <;> + simp [spatialTranslate,coordinateInterval,coordinateBetween,coordinateArc, + coordinate,coordinateShift,translate_val,hfract,hsub,sub_eq_add_neg,add_assoc] + +theorem spatialTranslate_coordinateRectangle {a : ℕ} (z : CutRing × CutRing) + (u v : Fin 2 → CutRing) : + spatialTranslate z (coordinateRectangle a u v) = + coordinateRectangle a (fun j => u j+(if j=0 then z.1 else z.2)) + (fun j => v j+(if j=0 then z.1 else z.2)) := by + simp [coordinateRectangle,spatialTranslate_coordinateInterval] + +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) {ι κ : Type*} [Finite ι] [Finite κ] + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + +theorem fullGeometricSector_shared_primitive (hlarge : 15 < m+1) + (P : ι → Fin 5 × (CutRing × CutRing)) (Q : κ → Fin 5 × (CutRing × CutRing)) + (i : ι) (j : κ) (he : P i = Q j) + (h : ∀ I, I.card ≤ 15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb P) + (g : ∀ I, I.card ≤ 15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb Q) + (V : polygonAlgebra a) + (hV : ResolvedBy (fun _ : Unit => (primitiveTests (a := a) (r := r) P i).val) V.val) : + B.fullGeometricSector hlarge P h V = B.fullGeometricSector hlarge Q g V := by + let S : Unit → Fin 5 × (CutRing × CutRing) := fun _ => P i + have hS : ∀ I, I.card ≤ 15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb S := + fun I hI b hb => PrimitiveFamilyLaw.reindex B I b hb P (h I hI b hb) (fun _ => i) + rw [← B.fullGeometricSector_subfamily hlarge P S (fun _ => i) rfl h hS V hV] + apply B.fullGeometricSector_subfamily hlarge Q S (fun _ => j) _ g hS V hV + exact funext (fun _ => he.symm) + +end InitialCoverSystem +end ChartTransforms + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/Supported.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/Supported.lean new file mode 100644 index 0000000000000000000000000000000000000000..b1d4e7294768afb69a302b5c66568bf9ef946d65 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/Supported.lean @@ -0,0 +1,459 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.TupleChartDomain + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +section LocalDisplacement + +def SupportedIn {α : Type*} (g : Equiv.Perm α) (U : Set α) : Prop := + ∀ p ∉ U, g p = p + +theorem supported_disjoint_commute {α : Type*} {f g : Equiv.Perm α} + {U V : Set α} (hf : SupportedIn f U) (hg : SupportedIn g V) + (hUV : Disjoint U V) : Commute f g := by + apply Equiv.Perm.Disjoint.commute + intro p + by_cases hp : p ∈ U + · exact Or.inr (hg p (fun h => Set.disjoint_left.mp hUV hp h)) + · exact Or.inl (hf p hp) + +theorem supported_conjugate {α : Type*} (n : Equiv.Perm α) + {g : Equiv.Perm α} {U : Set α} (hg : SupportedIn g U) : + SupportedIn (n * g * n⁻¹) (n '' U) := by + intro p hp + have hx : n.symm p ∉ U := by + intro h + exact hp ⟨n.symm p,h,n.apply_symm_apply p⟩ + change n (g (n.symm p)) = p + rw [hg _ hx, n.apply_symm_apply] + +open scoped commutatorElement in +theorem double_commutator_of_displacement {G : Type*} [Group G] (n a b : G) + (ha : Commute (n*a*n⁻¹) a) (hb : Commute (n*a*n⁻¹) b) : + ⁅⁅n,a⁆,b⁆ = ⁅a⁻¹,b⁆ := by + have hc : Commute (n*a*n⁻¹) ⁅a⁻¹,b⁆ := by + simpa only [commutatorElement_def, inv_inv] using + ((ha.inv_right.mul_right hb).mul_right ha).mul_right hb.inv_right + change ⁅(n*a*n⁻¹)*a⁻¹,b⁆ = _ + rw [commutatorElement_mul_left_eq_conj_mul, hb.commutator_eq, mul_one, + hc.eq, mul_assoc, mul_inv_cancel, mul_one] + +open scoped commutatorElement in + +theorem supported_double_commutator {α : Type*} (n a b : Equiv.Perm α) + (U : Set α) (ha : SupportedIn a U) (hb : SupportedIn b U) + (hdis : Disjoint U (n '' U)) : ⁅⁅n,a⁆,b⁆ = ⁅a⁻¹,b⁆ := by + exact double_commutator_of_displacement n a b + (supported_disjoint_commute (supported_conjugate n ha) ha hdis.symm) + (supported_disjoint_commute (supported_conjugate n ha) hb hdis.symm) + +theorem ordinary_denseRange : DenseRange ordinary := by + have hd : Dense (AddSubgroup.closure {Real.goldenRatio, (1 : ℝ)} : Set ℝ) := + dense_addSubgroupClosure_pair_iff.mpr (by simpa using Real.goldenRatio_irrational) + apply hd.mono + change AddSubgroup.closure {Real.goldenRatio, (1 : ℝ)} ≤ ordinary.toAddMonoidHom.range + apply (AddSubgroup.closure_le _).mpr + intro x hx + rcases hx with rfl | hx + · exact ⟨cutTau, ordinary_cutTau⟩ + · have hx' : x = 1 := by simpa using hx + subst x + exact ⟨1,map_one ordinary⟩ + +theorem exists_cut_between {x y : ℝ} (hxy : x < y) : + ∃ c : CutRing, x < ordinary c ∧ ordinary c < y := + ordinary_denseRange.exists_mem_open isOpen_Ioo (Set.nonempty_Ioo.mpr hxy) + +instance (a : ℕ) : TopologicalSpace (GenericSquare a) := inferInstanceAs + (TopologicalSpace {p : ℝ × ℝ // p.1 ∈ Set.Ico 0 1 ∧ p.2 ∈ Set.Ico 0 1 ∧ AvoidsCuts a p}) + +instance (a : ℕ) : MetricSpace (GenericSquare a) := inferInstanceAs + (MetricSpace {p : ℝ × ℝ // p.1 ∈ Set.Ico 0 1 ∧ p.2 ∈ Set.Ico 0 1 ∧ AvoidsCuts a p}) + +theorem cutForm_continuous (a : ℕ) (j : Fin 4) : Continuous (cutForm a j) := by + fin_cases j + · exact continuous_fst + · exact continuous_snd + · exact continuous_snd.sub (continuous_const.mul continuous_fst) + · exact continuous_fst.sub (continuous_const.mul continuous_snd) + +theorem halfPlane_isClopen (a : ℕ) (j : Fin 4) (c : CutRing) : + IsClopen (halfPlane a j c) := by + have hc : Continuous (fun p : GenericSquare a => cutForm a j p.val) := + (cutForm_continuous a j).comp continuous_subtype_val + have hopen : IsOpen (halfPlane a j c) := isOpen_lt hc continuous_const + have he : (halfPlane a j c)ᶜ = {p : GenericSquare a | ordinary c < cutForm a j p.val} := by + ext p + simp only [Set.mem_compl_iff, halfPlane, Set.mem_ofPred_eq, not_lt] + exact ⟨fun h => lt_of_le_of_ne h (p.property.2.2 j c).symm, le_of_lt⟩ + exact ⟨isOpen_compl_iff.mp (he ▸ isOpen_lt continuous_const hc), hopen⟩ + +theorem polygon_isClopen {a : ℕ} (U : polygonAlgebra a) : IsClopen U.val := by + apply polygon_induction (P := IsClopen) (fun j c => halfPlane_isClopen a j c) + isClopen_empty (fun _ _ h k => h.union k) (fun _ h => h.compl) U.property + +theorem generic_coordinates_pos {a : ℕ} (p : GenericSquare a) : + 0 < p.val.1 ∧ 0 < p.val.2 := by + constructor + · exact lt_of_le_of_ne p.property.1.1 (by simpa [cutForm] using (p.property.2.2 0 0).symm) + · exact lt_of_le_of_ne p.property.2.1.1 (by simpa [cutForm] using (p.property.2.2 1 0).symm) + +theorem polygon_contains_rectangle {a : ℕ} (U : polygonAlgebra a) + (hU : U.val.Nonempty) : + ∃ l r : CutRing × CutRing, + 0 < ordinary l.1 ∧ ordinary l.1 < ordinary r.1 ∧ ordinary r.1 < 1 ∧ + 0 < ordinary l.2 ∧ ordinary l.2 < ordinary r.2 ∧ ordinary r.2 < 1 ∧ + ∀ p : GenericSquare a, + (ordinary l.1 < p.val.1 ∧ p.val.1 < ordinary r.1) → + (ordinary l.2 < p.val.2 ∧ p.val.2 < ordinary r.2) → p ∈ U.val := by + obtain ⟨p,hp⟩ := hU + obtain ⟨ε,hε,hball⟩ := Metric.isOpen_iff.mp (polygon_isClopen U).isOpen p hp + have hp0 := generic_coordinates_pos p + obtain ⟨l₁,hl₁,hlp⟩ := exists_cut_between + (show max 0 (p.val.1-ε) < p.val.1 by exact max_lt hp0.1 (sub_lt_self _ hε)) + obtain ⟨l₂,hl₂,hlq⟩ := exists_cut_between + (show max 0 (p.val.2-ε) < p.val.2 by exact max_lt hp0.2 (sub_lt_self _ hε)) + obtain ⟨r₁,hpr,hr₁⟩ := exists_cut_between + (show p.val.1 < min 1 (p.val.1+ε) by exact lt_min p.property.1.2 (lt_add_of_pos_right _ hε)) + obtain ⟨r₂,hqr,hr₂⟩ := exists_cut_between + (show p.val.2 < min 1 (p.val.2+ε) by exact lt_min p.property.2.1.2 (lt_add_of_pos_right _ hε)) + refine ⟨(l₁,l₂),(r₁,r₂),lt_of_le_of_lt (le_max_left _ _) hl₁, + hlp.trans hpr,(lt_min_iff.mp hr₁).1,?_,hlq.trans hqr,(lt_min_iff.mp hr₂).1,?_⟩ + · exact lt_of_le_of_lt (le_max_left _ _) hl₂ + · intro q hqx hqy + apply hball + change max (dist q.val.1 p.val.1) (dist q.val.2 p.val.2) < ε + rw [max_lt_iff, Real.dist_eq, Real.dist_eq, abs_lt, abs_lt] + have hx := (max_lt_iff.mp hl₁).2 + have hy := (max_lt_iff.mp hl₂).2 + have hx' := (lt_min_iff.mp hr₁).2 + have hy' := (lt_min_iff.mp hr₂).2 + constructor <;> constructor <;> linarith + +noncomputable def smallSquare (a : ℕ) (d : CutRing) : polygonAlgebra a := + ⟨halfPlane a 0 d ∩ halfPlane a 1 d, + BooleanSubalgebra.inf_mem (halfPlane_mem a 0 d) (halfPlane_mem a 1 d)⟩ + +theorem mem_smallSquare {a : ℕ} (d : CutRing) (p : GenericSquare a) : + p ∈ (smallSquare a d).val ↔ p.val.1 < ordinary d ∧ p.val.2 < ordinary d := Iff.rfl + +theorem smallSquare_nonempty (a : ℕ) {d : CutRing} + (hd : 0 < ordinary d) (hd1 : ordinary d ≤ 1) : + (smallSquare a d).val.Nonempty := by + obtain ⟨p,hx,hy⟩ := generic_rectangle a 0 (ordinary d) 0 (ordinary d) + le_rfl hd1 hd le_rfl hd1 hd + exact ⟨p,hx.2,hy.2⟩ + +noncomputable def fiveRectangleShifts (l : CutRing × CutRing) (d : CutRing) + (i : Fin 5) : CutRing × CutRing := (l.1 + 2 * (i.val : CutRing)*d, l.2) + +theorem fiveRectangleShifts_val {a : ℕ} (l : CutRing × CutRing) (d : CutRing) + (hlx : 0 < ordinary l.1) (hly : 0 < ordinary l.2) + (hd : 0 < ordinary d) (hx1 : ordinary l.1 + 9*ordinary d < 1) + (hy1 : ordinary l.2 + ordinary d < 1) (i : Fin 5) + (p : (smallSquare a d).val) : + (translate a (fiveRectangleShifts l d i) p.val).val = + (p.val.val.1 + ordinary l.1 + 2*(i.val : ℝ)*ordinary d, + p.val.val.2 + ordinary l.2) := by + have hp0 := generic_coordinates_pos p.val + have hpd := (mem_smallSquare d p.val).mp p.property + have hi : (i.val : ℝ) ≤ 4 := by exact_mod_cast (show i.val ≤ 4 by omega) + have hi0 : (0 : ℝ) ≤ i.val := Nat.cast_nonneg _ + simp only [translate_val, fiveRectangleShifts, map_add, map_mul, map_ofNat, map_natCast] + rw [Int.fract_eq_self.mpr ⟨by nlinarith, by nlinarith⟩, + Int.fract_eq_self.mpr ⟨by linarith, by linarith⟩] + congr 1 + ring + +theorem five_slots_in_polygon {a m : ℕ} (U : polygonAlgebra a) + (hU : U.val.Nonempty) (t : Fin m) : + ∃ d : CutRing, 0 < ordinary d ∧ ordinary d < 1 ∧ + ∃ slots : Fin 5 → Fin m × (CutRing × CutRing), + Function.Injective (SlotMap a m (smallSquare a d) slots) ∧ + Set.range (SlotMap a m (smallSquare a d) slots) ⊆ {p | p.1 = t ∧ p.2 ∈ U.val} := by + obtain ⟨l,r,hlx,hlr,hrx,hly,hlr',hry,hrect⟩ := polygon_contains_rectangle U hU + obtain ⟨d,hd,hdlim⟩ := exists_cut_between + (show (0:ℝ) < min ((ordinary r.1-ordinary l.1)/10) ((ordinary r.2-ordinary l.2)/2) by + exact lt_min (div_pos (sub_pos.mpr hlr) (by norm_num)) + (div_pos (sub_pos.mpr hlr') (by norm_num))) + have hxlim := (lt_min_iff.mp hdlim).1 + have hylim := (lt_min_iff.mp hdlim).2 + have hsmall : ordinary d < 1 := by linarith + have hx1 : ordinary l.1 + 9*ordinary d < 1 := by linarith + have hy1 : ordinary l.2 + ordinary d < 1 := by linarith + let slots : Fin 5 → Fin m × (CutRing × CutRing) := fun i => (t,fiveRectangleShifts l d i) + have hv (i : Fin 5) (p : (smallSquare a d).val) := + fiveRectangleShifts_val l d hlx hly hd hx1 hy1 i p + refine ⟨d,hd,hsmall,slots,?_,?_⟩ + · rintro ⟨i,x⟩ ⟨j,y⟩ he + have hx := (mem_smallSquare d x.val).mp x.property + have hy := (mem_smallSquare d y.val).mp y.property + have hx0 := generic_coordinates_pos x.val + have hy0 := generic_coordinates_pos y.val + have hh := congrArg (fun p : TrackPoint a m => p.2.val.1) he + change (translate a (fiveRectangleShifts l d i) x.val).val.1 = + (translate a (fiveRectangleShifts l d j) y.val).val.1 at hh + rw [hv i x,hv j y] at hh + have hij : i = j := by + apply Fin.ext + rcases lt_trichotomy i.val j.val with h | h | h + · have h' : (i.val : ℝ)+1 ≤ j.val := by exact_mod_cast h + nlinarith + · exact h + · have h' : (j.val : ℝ)+1 ≤ i.val := by exact_mod_cast h + nlinarith + subst j + refine Prod.ext rfl ?_ + apply Subtype.ext + exact (translation a (fiveRectangleShifts l d i)).injective (congrArg Prod.snd he) + · rintro p ⟨⟨i,x⟩,rfl⟩ + refine ⟨rfl,?_⟩ + apply hrect + · change ordinary l.1 < (translate a (fiveRectangleShifts l d i) x.val).val.1 ∧ + (translate a (fiveRectangleShifts l d i) x.val).val.1 < ordinary r.1 + rw [hv i x] + have hi0 : (0 : ℝ) ≤ i.val := Nat.cast_nonneg _ + have hi4 : (i.val : ℝ) ≤ 4 := by exact_mod_cast (show i.val ≤ 4 by omega) + have hx := (mem_smallSquare d x.val).mp x.property + have hx0 := generic_coordinates_pos x.val + constructor <;> nlinarith + · change ordinary l.2 < (translate a (fiveRectangleShifts l d i) x.val).val.2 ∧ + (translate a (fiveRectangleShifts l d i) x.val).val.2 < ordinary r.2 + rw [hv i x] + have hx := (mem_smallSquare d x.val).mp x.property + have hx0 := generic_coordinates_pos x.val + constructor <;> linarith + +noncomputable def translatedPolygon {a : ℕ} (u : CutRing × CutRing) + (U : polygonAlgebra a) : polygonAlgebra a := + ⟨translation a u '' U.val,polygon_image_translation u U.property⟩ + +private theorem floor_remainder_bounds {a : ℕ} (d : CutRing) (hd : 0 < ordinary d) + (p : GenericSquare a) (j : Fin 2) : + let x := ![p.val.1,p.val.2] j + 0 < x - (⌊x/ordinary d⌋ : ℝ)*ordinary d ∧ + x - (⌊x/ordinary d⌋ : ℝ)*ordinary d < ordinary d := by + dsimp + let x := ![p.val.1,p.val.2] j + have hlo : (⌊x/ordinary d⌋ : ℝ)*ordinary d ≤ x := + (le_div_iff₀ hd).mp (Int.floor_le _) + have hhi : x < ((⌊x/ordinary d⌋ : ℝ)+1)*ordinary d := + (div_lt_iff₀ hd).mp (Int.lt_floor_add_one _) + have hne : x ≠ (⌊x/ordinary d⌋ : ℝ)*ordinary d := by + fin_cases j + · simpa [x,cutForm] using p.property.2.2 0 ((⌊p.val.1/ordinary d⌋ : ℤ)*d) + · simpa [x,cutForm] using p.property.2.2 1 ((⌊p.val.2/ordinary d⌋ : ℤ)*d) + constructor <;> dsimp [x] at * + · exact sub_pos.mpr (lt_of_le_of_ne hlo (fun h => hne h.symm)) + · linarith + +theorem smallSquare_finite_translated_cover (a : ℕ) (d : CutRing) + (hd : 0 < ordinary d) (hd1 : ordinary d < 1) : + ∃ s : Finset (CutRing × CutRing), ∀ p : GenericSquare a, + ∃ u ∈ s, p ∈ (translatedPolygon u (smallSquare a d)).val := by + classical + let I := Finset.Icc (0 : ℤ) ⌈1/ordinary d⌉ + let shift : ℤ × ℤ → CutRing × CutRing := fun k => ((k.1 : CutRing)*d,(k.2 : CutRing)*d) + refine ⟨(I ×ˢ I).image shift,?_⟩ + intro p + let k : ℤ × ℤ := (⌊p.val.1/ordinary d⌋,⌊p.val.2/ordinary d⌋) + have hk : k ∈ I ×ˢ I := by + have hb (x : ℝ) (hx : x ∈ Set.Ico 0 1) : ⌊x/ordinary d⌋ ∈ I := by + rw [Finset.mem_Icc] + refine ⟨Int.floor_nonneg.mpr (div_nonneg hx.1 hd.le),?_⟩ + exact (Int.floor_mono (div_le_div_of_nonneg_right hx.2.le hd.le)).trans + (Int.floor_le_ceil (1/ordinary d)) + exact Finset.mem_product.mpr ⟨hb _ p.property.1,hb _ p.property.2.1⟩ + have hx := floor_remainder_bounds d hd p 0 + have hy := floor_remainder_bounds d hd p 1 + dsimp at hx hy + let q := translate a (-(shift k)) p + have hq : q.val = (p.val.1-(k.1:ℝ)*ordinary d,p.val.2-(k.2:ℝ)*ordinary d) := by + simp only [q,translate_val, Prod.fst_neg,Prod.snd_neg,map_neg,shift,map_mul,map_intCast] + rw [← sub_eq_add_neg,← sub_eq_add_neg] + rw [Int.fract_eq_self.mpr ⟨hx.1.le,hx.2.trans hd1⟩, + Int.fract_eq_self.mpr ⟨hy.1.le,hy.2.trans hd1⟩] + refine ⟨shift k,Finset.mem_image.mpr ⟨k,hk,rfl⟩,q,?_,?_⟩ + · rw [mem_smallSquare,hq] + exact ⟨hx.2,hy.2⟩ + · change translate a (shift k) (translate a (-(shift k)) p) = p + rw [← translate_add, add_neg_cancel, translate_zero] + +def bankIndex : Fin 3 × Fin 3 ≃ Fin 9 := finProdFinEquiv + +def bankPermutation : Equiv.Perm (Fin 9) := + bankIndex.permCongr (Equiv.prodCongr (Equiv.addRight (1 : Fin 3)) (Equiv.refl (Fin 3))) + +theorem bankPermutation_even : bankPermutation ∈ alternatingGroup (Fin 9) := by + rw [Equiv.Perm.mem_alternatingGroup] + decide + +@[simp] theorem bankPermutation_apply (i j : Fin 3) : + bankPermutation (bankIndex (i,j)) = bankIndex (i+1,j) := by + simp [bankPermutation,Equiv.permCongr_apply] + +noncomputable def bankSlots {m : ℕ} + (b : Fin 3 → Fin 3 → Fin m × (CutRing × CutRing)) (i : Fin 9) : + Fin m × (CutRing × CutRing) := b (bankIndex.symm i).1 (bankIndex.symm i).2 + +@[simp] theorem bankSlots_apply {m : ℕ} + (b : Fin 3 → Fin 3 → Fin m × (CutRing × CutRing)) (i j : Fin 3) : + bankSlots b (bankIndex (i,j)) = b i j := by + simp [bankSlots] + +theorem bankSlots_injective {a m : ℕ} (U : polygonAlgebra a) + (b : Fin 3 → Fin 3 → Fin m × (CutRing × CutRing)) + (hb : ∀ i, Function.Injective (SlotMap a m U (b i))) + (hdis : ∀ i j, i ≠ j → Disjoint (Set.range (SlotMap a m U (b i))) + (Set.range (SlotMap a m U (b j)))) : + Function.Injective (SlotMap a m U (bankSlots b)) := by + rintro ⟨i,x⟩ ⟨j,y⟩ he + obtain ⟨⟨i₁,i₂⟩,rfl⟩ := bankIndex.surjective i + obtain ⟨⟨j₁,j₂⟩,rfl⟩ := bankIndex.surjective j + have he' : SlotMap a m U (b i₁) (i₂,x) = SlotMap a m U (b j₁) (j₂,y) := by + simpa only [SlotMap,bankSlots_apply] using he + have hij : i₁ = j₁ := by + by_contra hn + exact Set.disjoint_left.mp (hdis i₁ j₁ hn) ⟨(i₂,x),rfl⟩ ⟨(j₂,y),he'.symm⟩ + subst j₁ + have hh := hb i₁ he' + obtain ⟨h₁,h₂⟩ := Prod.mk.inj hh + subst j₂ + subst y + rfl + +theorem transport_bank {a m : ℕ} (U : polygonAlgebra a) + (b : Fin 3 → Fin 3 → Fin m × (CutRing × CutRing)) + (hb : ∀ i, Function.Injective (SlotMap a m U (b i))) + (hdis : ∀ i j, i ≠ j → Disjoint (Set.range (SlotMap a m U (b i))) + (Set.range (SlotMap a m U (b j)))) : + ∃ g ∈ polygonAlternatingGroup a m, ∀ (i : Fin 3) (x : U.val), + g.val (SlotMap a m U (b 0) (i,x)) = SlotMap a m U (b 1) (i,x) := by + let h := bankSlots_injective U b hb hdis + refine ⟨slotHom U (bankSlots b) h bankPermutation, + slotHom_alternating_mem U _ h bankPermutation_even,?_⟩ + intro i x + have he (k : Fin 3) : SlotMap a m U (b k) (i,x) = + SlotMap a m U (bankSlots b) (bankIndex (k,i),x) := by simp [SlotMap] + rw [he 0,he 1] + change slotPerm _ _ _ _ _ = _ + rw [slotPerm_apply,bankPermutation_apply,zero_add] + +theorem slot_ranges_disjoint_of_tracks {a m n k : ℕ} (U : polygonAlgebra a) + (s : Fin n → Fin m × (CutRing × CutRing)) + (t : Fin k → Fin m × (CutRing × CutRing)) + (h : ∀ i j, (s i).1 ≠ (t j).1) : + Disjoint (Set.range (SlotMap a m U s)) (Set.range (SlotMap a m U t)) := by + apply Set.disjoint_left.mpr + rintro p ⟨⟨i,x⟩,rfl⟩ ⟨⟨j,y⟩,he⟩ + exact h i j (congrArg Prod.fst he).symm + +theorem slots_injective_of_tracks {a m n : ℕ} (U : polygonAlgebra a) + (s : Fin n → Fin m × (CutRing × CutRing)) (h : Function.Injective (fun i => (s i).1)) : + Function.Injective (SlotMap a m U s) := by + rintro ⟨i,x⟩ ⟨j,y⟩ he + have htrack : (s i).1 = (s j).1 := congrArg (fun p : TrackPoint a m => p.1) he + have hij := h htrack + subst j + refine Prod.ext rfl ?_ + apply Subtype.ext + exact (translation a (s i).2).injective (congrArg Prod.snd he) + +theorem fresh_nine_tracks {m : ℕ} (hm : 15 ≤ m) (s t : Fin 3 → Fin m) : + ∃ e : Fin 9 ↪ Fin m, ∀ i j, e i ≠ s j ∧ e i ≠ t j := by + classical + let used := Finset.univ.image s ∪ Finset.univ.image t + have hu : used.card ≤ 6 := by + apply (Finset.card_union_le _ _).trans + change _ + _ ≤ 3 + 3 + apply add_le_add <;> exact Finset.card_image_le.trans (by simp) + have hc : 9 ≤ usedᶜ.card := by + rw [Finset.card_compl] + simp only [Fintype.card_fin] + omega + have he : Nonempty (Fin 9 ↪ {x : Fin m // x ∈ usedᶜ}) := by + rw [Function.Embedding.nonempty_iff_card_le,Fintype.card_fin,Fintype.card_coe] + exact hc + obtain ⟨e⟩ := he + refine ⟨e.trans (Function.Embedding.subtype _),?_⟩ + intro i j + have hn : (e i).val ∉ used := Finset.mem_compl.mp (e i).property + constructor <;> intro heq <;> apply hn + · exact Finset.mem_union_left _ (Finset.mem_image.mpr ⟨j,Finset.mem_univ _,heq.symm⟩) + · exact Finset.mem_union_right _ (Finset.mem_image.mpr ⟨j,Finset.mem_univ _,heq.symm⟩) + +theorem transport_three_slots {a m : ℕ} (hm : 15 ≤ m) (U : polygonAlgebra a) + (s t : Fin 3 → Fin m × (CutRing × CutRing)) + (hs : Function.Injective (SlotMap a m U s)) + (ht : Function.Injective (SlotMap a m U t)) : + ∃ g ∈ polygonAlternatingGroup a m, ∀ (i : Fin 3) (x : U.val), + g.val (SlotMap a m U s (i,x)) = SlotMap a m U t (i,x) := by + obtain ⟨e,he⟩ := fresh_nine_tracks hm (fun i => (s i).1) (fun i => (t i).1) + let b : Fin 3 → Fin 3 → Fin m × (CutRing × CutRing) := + fun k i => (e (bankIndex (k,i)),0) + have hb (k : Fin 3) : Function.Injective (SlotMap a m U (b k)) := by + apply slots_injective_of_tracks + intro i j hij + exact congrArg Prod.snd (bankIndex.injective (e.injective hij)) + have hbb (k l : Fin 3) (hkl : k ≠ l) : + Disjoint (Set.range (SlotMap a m U (b k))) (Set.range (SlotMap a m U (b l))) := by + apply slot_ranges_disjoint_of_tracks + intro i j hij + exact hkl (congrArg Prod.fst (bankIndex.injective (e.injective hij))) + have hsb (k : Fin 3) : Disjoint (Set.range (SlotMap a m U s)) + (Set.range (SlotMap a m U (b k))) := by + apply slot_ranges_disjoint_of_tracks + intro i j + exact (he (bankIndex (k,j)) i).1.symm + have htb (k : Fin 3) : Disjoint (Set.range (SlotMap a m U t)) + (Set.range (SlotMap a m U (b k))) := by + apply slot_ranges_disjoint_of_tracks + intro i j + exact (he (bankIndex (k,j)) i).2.symm + have hi₁ : ∀ i, Function.Injective (SlotMap a m U (![s,b 0,b 1] i)) := by + intro i + fin_cases i + · exact hs + · exact hb 0 + · exact hb 1 + have hd₁ : ∀ i j : Fin 3, i ≠ j → + Disjoint (Set.range (SlotMap a m U (![s,b 0,b 1] i))) + (Set.range (SlotMap a m U (![s,b 0,b 1] j))) := by + intro i j h + fin_cases i <;> fin_cases j + all_goals first | exact False.elim (h rfl) | exact hsb 0 | exact hsb 1 | + exact (hsb 0).symm | exact (hsb 1).symm | exact hbb 0 1 (by decide) | + exact hbb 1 0 (by decide) + obtain ⟨g₁,hg₁,hg₁act⟩ := transport_bank U ![s,b 0,b 1] hi₁ hd₁ + have hi₂ : ∀ i, Function.Injective (SlotMap a m U (![b 0,t,b 2] i)) := by + intro i + fin_cases i + · exact hb 0 + · exact ht + · exact hb 2 + have hd₂ : ∀ i j : Fin 3, i ≠ j → + Disjoint (Set.range (SlotMap a m U (![b 0,t,b 2] i))) + (Set.range (SlotMap a m U (![b 0,t,b 2] j))) := by + intro i j h + fin_cases i <;> fin_cases j + all_goals first | exact False.elim (h rfl) | exact htb 0 | exact htb 2 | + exact (htb 0).symm | exact (htb 2).symm | exact hbb 0 2 (by decide) | + exact hbb 2 0 (by decide) + obtain ⟨g₂,hg₂,hg₂act⟩ := transport_bank U ![b 0,t,b 2] hi₂ hd₂ + refine ⟨g₂*g₁,(polygonAlternatingGroup a m).mul_mem hg₂ hg₁,?_⟩ + intro i x + change g₂.val (g₁.val _) = _ + have h₁ : g₁.val (SlotMap a m U s (i,x)) = SlotMap a m U (b 0) (i,x) := hg₁act i x + have h₂ : g₂.val (SlotMap a m U (b 0) (i,x)) = SlotMap a m U t (i,x) := hg₂act i x + rw [h₁,h₂] + +end LocalDisplacement +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/SupportedCellPatching.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/SupportedCellPatching.lean new file mode 100644 index 0000000000000000000000000000000000000000..df15c9b5a0298b66170eabcbc3e79c8281037023 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/SupportedCellPatching.lean @@ -0,0 +1,146 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.InvariantPatching +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.LocalCoordinateClassifier +import OAI.GroupTheory.SimpleAmenable.CentralCovers.SmallFormalGlobal +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.ConcurrentGeometry +import OAI.GroupTheory.SimpleAmenable.CentralCovers.SmallStarRelators + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section SupportedCellPatching +variable {α ι D H : Type*} [Fintype α] [DecidableEq α] [Finite ι] [Group H] + [Group.IsPerfect (alternatingGroup α)] + +theorem supported_cell_patching + (F : Option ι → TrackStar α →* H) + (f : (I : FiveAlphabet α) → Option ι → alternatingGroup I.val →* H) + (hspec : ∀ I i, (F i).comp (universalMap (subtypeAlternatingHom I.val))= + (f I i).comp (universalProjection (alternatingGroup I.val))) + (P : D → Subgroup H) + (hgen : (copyFamilyEval F).range ≤ ⨆ d, P d) + (hinv : ∀ d i s, F i s ∈ Subgroup.normalizer (P d : Set H)) + (G : D → Option ι → TrackStar α →* H) + (hact : ∀ d (I : FiveAlphabet α) i s, + ∀ x ∈ P d, + F i (universalMap (subtypeAlternatingHom I.val) s)*x* + (F i (universalMap (subtypeAlternatingHom I.val) s))⁻¹ = + G d i (universalMap (subtypeAlternatingHom I.val) s)*x* + (G d i (universalMap (subtypeAlternatingHom I.val) s))⁻¹) + (hlocal : ∀ d (S : Finset α), S.card ≤ 15 → ∀ w ∈ smallFamilyLocal (ι := ι) S, + smallFamilyModel (fun i : ι => {σ : ι → Bool | σ i=true}) w=1 → + ∀ x ∈ P d, Commute (copyFamilyEval (G d) (smallFamilyStarWord w)) x) + (hα : 5 ≤ Fintype.card α) : + HasCentralLaw (smallFamilyModel (fun i : ι => {σ : ι → Bool | σ i=true})) + (smallFamilyEval f).rangeRestrict := by + classical + let f₀ : SmallFamilyLabel α ι → H := fun l => f l.1 l.2.1 l.2.2 + have hfs (I : FiveAlphabet α) (i : Option ι) (s : alternatingGroup I.val) : + f I i s=F i (alphabetStarLift I s) := by + have hh := DFunLike.congr_fun (hspec I i) + (Classical.choose (universalProjection_surjective (alternatingGroup I.val) s)) + simpa only [MonoidHom.comp_apply,alphabetStarLift, + Classical.choose_spec (universalProjection_surjective (alternatingGroup I.val) s)] using hh.symm + have hgen' : (FreeGroup.lift f₀).range ≤ ⨆ d, P d := by + rintro x ⟨w,rfl⟩ + apply hgen + refine ⟨smallFamilyStarWord w,?_⟩ + exact DFunLike.congr_fun (smallFamilyStarWord_eval F f hspec) w + apply smallFamily_assignment_law _ ?_ f ?_ hα + · intro σ τ h + funext i + exact Bool.eq_iff_iff.mpr (h i) + · intro S hS w hw hrel v _hv + have hc := patching_centrality f₀ P hgen' (fun d l => by + rw [show f₀ l=F l.2.1 (alphabetStarLift l.1 l.2.2) from hfs _ _ _] + exact hinv _ _ _) w ?_ + · exact hc _ ⟨v,rfl⟩ + · intro d + let g : SmallFamilyLabel α ι → H := fun l => G d l.2.1 (alphabetStarLift l.1 l.2.2) + have hg : (FreeGroup.lift g)=(copyFamilyEval (G d)).comp smallFamilyStarWord := by + apply FreeGroup.ext_hom + rintro ⟨I,i,s⟩ + simp [g,smallFamilyStarWord] + refine ⟨g,?_,?_⟩ + · intro l x hx + rw [show f₀ l=F l.2.1 (alphabetStarLift l.1 l.2.2) from hfs _ _ _] + exact hact d l.1 l.2.1 _ x hx + · rw [hg] + intro x hx + exact (hlocal d S hS w hw hrel x hx).eq.symm + +end SupportedCellPatching + +section ConcurrentAxisDecisions + +namespace ConcurrentGeometry +variable {a : ℕ} {r : CutRing} (C : ConcurrentGeometry a r) + +theorem axis_on_margin (j : Fin 2) (u b : CutRing × CutRing) + (t : VertexType (commonVertexDenominator a)) + (hnear : ∀ z : ℝ × ℝ, + (∀ k, ordinary ((C.margins t).lower k+pointCoordinate u k)≤realCoordinate z k ∧ + realCoordinate z k≤ordinary ((C.margins t).upper k+pointCoordinate u k)) → + ∀ k, |realCoordinate z k-ordinary (pointCoordinate b k)|<3*C.epsilon) + (p : GenericSquare a) (z : ℝ × ℝ) (hz : p.val=(Int.fract z.1,Int.fract z.2)) + (hcell : ∀ k, ordinary ((C.margins t).lower k+pointCoordinate u k)≤realCoordinate z k ∧ + realCoordinate z k≤ordinary ((C.margins t).upper k+pointCoordinate u k)) : + p ∈ (spatialTranslate b (coordinatePrimitive a j)).val ↔ + ordinary (pointCoordinate b j)≤realCoordinate z j := by + have hh := abs_lt.mp (hnear z hcell j) + apply translated_coordinate_planar j b p z hz + · have hg := C.second_gap + have hp := C.positive + linarith + · have hg := C.first_gap + have hp := C.positive + linarith + +theorem cell_le_margin (hr : ordinary r<1/2) + (q : Fin 2 → ℤ) (cell : Fin 2 → Fin C.mesh) + (t : VertexType (commonVertexDenominator a)) (u : CutRing × CutRing) + (hmargin : ∀ z : ℝ × ℝ, + (∀ k, ordinary (windowCut C.mesh (q k) (cell k).castSucc)≤realCoordinate z k ∧ + realCoordinate z k≤ordinary (windowCut C.mesh (q k) (cell k).succ)) → + ∀ k, ordinary ((C.margins t).lower k+pointCoordinate u k) + ⟨((windowRectangle_mem C.mesh C.mesh_large q cell p).mp hp k).1, + ((windowRectangle_mem C.mesh C.mesh_large q cell p).mp hp k).2.le⟩) + have hc (j : Fin 2) : p ∈ (coordinateInterval a j + ((C.margins t).lower j+pointCoordinate u j) + ((C.margins t).upper j+pointCoordinate u j)).val := by + have hw := (C.margins t).width C.positive j + have hrad := C.radius + have hwidth : 0≤ordinary ((C.margins t).upper j+pointCoordinate u j)- + ordinary ((C.margins t).lower j+pointCoordinate u j) ∧ + ordinary ((C.margins t).upper j+pointCoordinate u j)- + ordinary ((C.margins t).lower j+pointCoordinate u j)<1 := by + simp only [map_add] + constructor <;> linarith + rw [coordinateInterval_planar j _ _ hwidth p _ (windowPlanarLift_spec q p)] + rw [Int.fract_eq_self.mpr (show 0≤realCoordinate (windowPlanarLift q p) j- + ordinary ((C.margins t).lower j+pointCoordinate u j) ∧ + realCoordinate (windowPlanarLift q p) j- + ordinary ((C.margins t).lower j+pointCoordinate u j)<1 from + ⟨by linarith [(hmb j).1],by linarith [(hmb j).2,hwidth.2]⟩)] + linarith [(hmb j).2] + exact ⟨hc 0,hc 1⟩ + +end ConcurrentGeometry +end ConcurrentAxisDecisions + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/TangentChartTemplates.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/TangentChartTemplates.lean new file mode 100644 index 0000000000000000000000000000000000000000..035b10a3cc15d6cf3168791d5f919c1bcac9ee7a --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/TangentChartTemplates.lean @@ -0,0 +1,243 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.FixedChartTables +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.SpatialChartGeometry + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section TangentChartTemplates + +def slopeDirection (d : Fin 2) : Fin 4 := ⟨d.val+2,by omega⟩ +def slopeTestIndex (d : Fin 2) : Fin 5 := ⟨d.val+3,by omega⟩ + +@[simp] theorem initialTest_slope (a : ℕ) (r : CutRing) (d : Fin 2) : + initialTest a r (slopeTestIndex d) = clippedSlopePrimitive a r (slopeDirection d) := by + fin_cases d <;> rfl + +noncomputable def tangentOffset (a : ℕ) (d : Fin 2) (e : CutRing) : CutRing × CutRing := + if d=0 then (e,cutTau^a*e) else (cutTau^a*e,e) + +@[simp] theorem tangentOffset_zero (a : ℕ) (d : Fin 2) : tangentOffset a d 0 = 0 := by + simp [tangentOffset] + +@[simp] theorem tangentOffset_add (a : ℕ) (d : Fin 2) (e f : CutRing) : + tangentOffset a d (e+f) = tangentOffset a d e+tangentOffset a d f := by + fin_cases d <;> simp [tangentOffset,mul_add] + +@[simp] theorem integralCutForm_tangentOffset (a : ℕ) (d : Fin 2) (e : CutRing) : + integralCutForm a (slopeDirection d) (tangentOffset a d e) = 0 := by + fin_cases d <;> simp [slopeDirection,tangentOffset,integralCutForm] + +noncomputable def tangentChartTemplate (a k : ℕ) (p : Fin 2 → ℤ) (d : Fin 2) (e : CutRing) : + Fin 2 ⊕ (Fin 2 × Fin (k-1)) → Fin 5 × (CutRing × CutRing) + | Sum.inl i => (slopeTestIndex d,if i=0 then 0 else tangentOffset a d e) + | Sum.inr i => coordinateWindowPrimitives k p i + +noncomputable def translatedTemplate {ι : Type*} + (P : ι → Fin 5 × (CutRing × CutRing)) (z : CutRing × CutRing) : + ι → Fin 5 × (CutRing × CutRing) := fun i => ((P i).1,z+(P i).2) + +noncomputable def signedShortSteps (u : CutRing) : Fin 5 → CutRing := ![0,u,-u,cutTau*u,-(cutTau*u)] + +theorem tangentChartTables_eventually {a m : ℕ} {r : CutRing} {hm : 2 ≤ m} + (hr : 0 < ordinary r ∧ ordinary r < 1/2) (hm' : 15 ≤ m+1) + (k : ℕ) (p : Fin 2 → ℤ) (u : CutRing) : + ∃ L : ℕ, ∀ M : ℕ, L ≤ M → ∀ B : InitialCoverSystem a r m hm M, + ∀ d e z I b hb, B.PrimitiveFamilyLaw I b hb + (translatedTemplate (tangentChartTemplate a k p d (signedShortSteps u e)) z) := by + exact fixedChartTables_eventually hr hm' + (fun de : Fin 2 × Fin 5 => tangentChartTemplate a k p de.1 (signedShortSteps u de.2)) |>.imp + (fun L hL M hM B d e z I b hb => hL M hM B (d,e) z I b hb) + +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + +def TangentChartLaws (k : ℕ) (p : Fin 2 → ℤ) (u : CutRing) : Prop := + ∀ d e z I, I.card ≤ 15 → ∀ b hb, B.PrimitiveFamilyLaw I b hb + (translatedTemplate (tangentChartTemplate a k p d (signedShortSteps u e)) z) + +noncomputable def tangentSign (hlarge : 15 < m+1) (k : ℕ) (p : Fin 2 → ℤ) (u : CutRing) + (h : B.TangentChartLaws k p u) (d : Fin 2) (z : CutRing × CutRing) (positive : Bool) : + TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm) := + B.fullGeometricSector hlarge (translatedTemplate (tangentChartTemplate a k p d (signedShortSteps u 0)) z) + (h d 0 z) (if positive then spatialTranslate z (clippedSlopePrimitive a r (slopeDirection d)) + else (spatialTranslate z (clippedSlopePrimitive a r (slopeDirection d)))ᶜ) + +theorem tangentSign_first (hlarge : 15 < m+1) (k : ℕ) (p : Fin 2 → ℤ) (u : CutRing) + (h : B.TangentChartLaws k p u) (d : Fin 2) (z : CutRing × CutRing) (e : Fin 5) (positive : Bool) : + B.tangentSign hlarge k p u h d z positive = + B.fullGeometricSector hlarge + (translatedTemplate (tangentChartTemplate a k p d (signedShortSteps u e)) z) (h d e z) + (if positive then spatialTranslate z (clippedSlopePrimitive a r (slopeDirection d)) + else (spatialTranslate z (clippedSlopePrimitive a r (slopeDirection d)))ᶜ) := by + unfold tangentSign + refine B.fullGeometricSector_shared_primitive hlarge + (translatedTemplate (tangentChartTemplate a k p d (signedShortSteps u 0)) z) + (translatedTemplate (tangentChartTemplate a k p d (signedShortSteps u e)) z) + (Sum.inl (0 : Fin 2)) (Sum.inl (0 : Fin 2)) ?_ (h d 0 z) (h d e z) _ ?_ + · simp only [translatedTemplate,tangentChartTemplate,ite_true] + · intro x y he + have hh := he () + change x ∈ (spatialTranslate (z+0) (initialTest a r (slopeTestIndex d))).val ↔ + y ∈ (spatialTranslate (z+0) (initialTest a r (slopeTestIndex d))).val at hh + simp only [add_zero,initialTest_slope] at hh + cases positive with + | false => simpa using (not_congr hh) + | true => simpa using hh + +theorem tangentSign_second (hlarge : 15 < m+1) (k : ℕ) (p : Fin 2 → ℤ) (u : CutRing) + (h : B.TangentChartLaws k p u) (d : Fin 2) (z : CutRing × CutRing) (e : Fin 5) (positive : Bool) : + B.tangentSign hlarge k p u h d (z+tangentOffset a d (signedShortSteps u e)) positive = + B.fullGeometricSector hlarge + (translatedTemplate (tangentChartTemplate a k p d (signedShortSteps u e)) z) (h d e z) + (if positive then spatialTranslate (z+tangentOffset a d (signedShortSteps u e)) + (clippedSlopePrimitive a r (slopeDirection d)) + else (spatialTranslate (z+tangentOffset a d (signedShortSteps u e)) + (clippedSlopePrimitive a r (slopeDirection d)))ᶜ) := by + unfold tangentSign + refine B.fullGeometricSector_shared_primitive hlarge + (translatedTemplate (tangentChartTemplate a k p d (signedShortSteps u 0)) + (z+tangentOffset a d (signedShortSteps u e))) + (translatedTemplate (tangentChartTemplate a k p d (signedShortSteps u e)) z) + (Sum.inl (0 : Fin 2)) (Sum.inl (1 : Fin 2)) ?_ (h d 0 _) (h d e z) _ ?_ + · simp [translatedTemplate,tangentChartTemplate] + · intro x y he + have hh := he () + change x ∈ (spatialTranslate ((z+tangentOffset a d (signedShortSteps u e))+0) + (initialTest a r (slopeTestIndex d))).val ↔ + y ∈ (spatialTranslate ((z+tangentOffset a d (signedShortSteps u e))+0) + (initialTest a r (slopeTestIndex d))).val at hh + simp only [add_zero,initialTest_slope] at hh + cases positive with + | false => simpa using (not_congr hh) + | true => simpa using hh + +end InitialCoverSystem +end TangentChartTemplates + +section TangentChartAction + +@[simp] theorem integralCutForm_zero (a : ℕ) (j : Fin 4) : + integralCutForm a j (0 : CutRing × CutRing) = 0 := by + fin_cases j <;> simp [integralCutForm] + +@[simp] theorem integralCutForm_add (a : ℕ) (j : Fin 4) (u v : CutRing × CutRing) : + integralCutForm a j (u+v) = integralCutForm a j u+integralCutForm a j v := by + fin_cases j <;> simp [integralCutForm,mul_add] <;> ring + +theorem translatedTemplate_resolved {a : ℕ} {r : CutRing} {ι : Type*} + (P : ι → Fin 5 × (CutRing × CutRing)) (V : polygonAlgebra a) + (hV : ResolvedBy (fun i => (InitialCoverSystem.primitiveTests (a := a) (r := r) P i).val) V.val) + (z : CutRing × CutRing) : + ResolvedBy (fun i => (InitialCoverSystem.primitiveTests (a := a) (r := r) + (translatedTemplate P z) i).val) (spatialTranslate z V).val := by + simpa only [InitialCoverSystem.primitiveTests,primitiveFamilyTests,translatedTemplate, + ← spatialTranslate_add] using spatialTranslate_resolved + (InitialCoverSystem.primitiveTests (a := a) (r := r) P) V hV z + +theorem tangentChart_first_resolved {a k : ℕ} {r : CutRing} + (p : Fin 2 → ℤ) (d : Fin 2) (e : CutRing) (z : CutRing × CutRing) : + ResolvedBy (fun i => (InitialCoverSystem.primitiveTests (a := a) (r := r) + (translatedTemplate (tangentChartTemplate a k p d e) z) i).val) + (spatialTranslate z (clippedSlopePrimitive a r (slopeDirection d))).val := by + intro x y he + have hh := he (Sum.inl 0) + simpa [InitialCoverSystem.primitiveTests,primitiveFamilyTests,translatedTemplate, + tangentChartTemplate] using hh + +theorem tangentChart_second_resolved {a k : ℕ} {r : CutRing} + (p : Fin 2 → ℤ) (d : Fin 2) (e : CutRing) (z : CutRing × CutRing) : + ResolvedBy (fun i => (InitialCoverSystem.primitiveTests (a := a) (r := r) + (translatedTemplate (tangentChartTemplate a k p d e) z) i).val) + (spatialTranslate (z+tangentOffset a d e) (clippedSlopePrimitive a r (slopeDirection d))).val := by + intro x y he + have hh := he (Sum.inl 1) + simpa [InitialCoverSystem.primitiveTests,primitiveFamilyTests,translatedTemplate, + tangentChartTemplate] using hh + +theorem tangentChart_rectangle_resolved {a k : ℕ} {r : CutRing} + (p : Fin 2 → ℤ) (d : Fin 2) (e : CutRing) (z : CutRing × CutRing) + (l v : Fin 2 → CutRing) + (hl : ∀ j, p j ≤ endpointLabel (l j) ∧ endpointLabel (l j) < p j+k) + (hv : ∀ j, p j ≤ endpointLabel (v j) ∧ endpointLabel (v j) < p j+k) : + ResolvedBy (fun i => (InitialCoverSystem.primitiveTests (a := a) (r := r) + (translatedTemplate (tangentChartTemplate a k p d e) z) i).val) + (spatialTranslate z (coordinateRectangle a l v)).val := by + apply translatedTemplate_resolved + intro x y he + exact and_congr + (coordinateLabelWindow_resolved k p 0 (l 0) (v 0) (hl 0) (hv 0) x y + (fun i => he (Sum.inr i))) + (coordinateLabelWindow_resolved k p 1 (l 1) (v 1) (hl 1) (hv 1) x y + (fun i => he (Sum.inr i))) + +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + +theorem tangentSign_step_action (hlarge : 20 ≤ m+1) + (hr : 0 < ordinary r ∧ ordinary r < 1/2) + (k : ℕ) (p : Fin 2 → ℤ) (u : CutRing) (h : B.TangentChartLaws k p u) + (d : Fin 2) (e : Fin 5) (z : CutRing × CutRing) + (l v : Fin 2 → CutRing) + (hl : ∀ j, p j ≤ endpointLabel (l j) ∧ endpointLabel (l j) < p j+k) + (hv : ∀ j, p j ≤ endpointLabel (v j) ∧ endpointLabel (v j) < p j+k) + (hlv : ∀ j, ordinary (l j) ≤ ordinary (v j)) + (hlen : ∀ j, ordinary (v j)-ordinary (l j) < 1) + (hbox : ∀ j, -ordinary r < ordinary (l j) ∧ ordinary (v j) < ordinary r) + (hbox' : ∀ j, -ordinary r < ordinary (l j)-ordinary + (if j=0 then (tangentOffset a d (signedShortSteps u e)).1 + else (tangentOffset a d (signedShortSteps u e)).2) ∧ + ordinary (v j)-ordinary + (if j=0 then (tangentOffset a d (signedShortSteps u e)).1 + else (tangentOffset a d (signedShortSteps u e)).2) < ordinary r) + (f : TrackStar (Fin (m+1)) →* BoundedRelationCover M (alternatingGenerator a r m hm)) + (hf : B.AlignedSmallSupported f) + (hc : SmallControlled B.c f (B.fullGeometricSector (by omega) + (translatedTemplate (tangentChartTemplate a k p d (signedShortSteps u e)) z) + (h d e z) (spatialTranslate z (coordinateRectangle a l v)))) + (I : ControlAlphabet (Fin (m+1))) (s : UniversalExtension (alternatingGroup I.val)) : + ∀ x ∈ f.range, + B.tangentSign (by omega) k p u h d z true (universalMap (subtypeAlternatingHom I.val) s)*x* + (B.tangentSign (by omega) k p u h d z true (universalMap (subtypeAlternatingHom I.val) s))⁻¹ = + B.tangentSign (by omega) k p u h d (z+tangentOffset a d (signedShortSteps u e)) true + (universalMap (subtypeAlternatingHom I.val) s)*x* + (B.tangentSign (by omega) k p u h d (z+tangentOffset a d (signedShortSteps u e)) true + (universalMap (subtypeAlternatingHom I.val) s))⁻¹ := by + rw [B.tangentSign_first (by omega) k p u h d z e true, + B.tangentSign_second (by omega) k p u h d z e true] + apply B.chart_action_transfer hlarge _ (h d e z) _ _ _ + (tangentChart_first_resolved p d _ z) (tangentChart_second_resolved p d _ z) + (tangentChart_rectangle_resolved p d _ z l v hl hv) _ f hf hc I s + have he := clippedSlope_agree_on_rectangle (a := a) r (slopeDirection d) hr + (0 : CutRing × CutRing) (tangentOffset a d (signedShortSteps u e)) l v hlv hlen + (by simpa using hbox) hbox' (by simp only [integralCutForm_zero,integralCutForm_tangentOffset]) + have he' := congrArg (spatialTranslate z) he + simpa only [spatialTranslate_inter,← spatialTranslate_add,add_zero] using he' + +theorem tangentSign_opposite_commute (hlarge : 15 < m+1) + (k : ℕ) (p : Fin 2 → ℤ) (u : CutRing) (h : B.TangentChartLaws k p u) + (d : Fin 2) (z : CutRing × CutRing) (s t : TrackStar (Fin (m+1))) : + Commute (B.tangentSign hlarge k p u h d z true s) + (B.tangentSign hlarge k p u h d z false t) := by + unfold tangentSign + apply B.fullGeometricSector_commute + · exact tangentChart_first_resolved p d _ z + · exact disjoint_compl_right + +end InitialCoverSystem +end TangentChartAction + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/TangentWalkCenters.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/TangentWalkCenters.lean new file mode 100644 index 0000000000000000000000000000000000000000..e99fb33e8aae08c1c23351e6df1e103fb542871d --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/TangentWalkCenters.lean @@ -0,0 +1,171 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.UniformPropagationBounds +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.LabelShiftedCharts + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section TangentWalkCenters + +@[simp] theorem pointCoordinate_zero (j : Fin 2) : pointCoordinate (0 : CutRing × CutRing) j = 0 := by + simp [pointCoordinate] + +@[simp] theorem pointCoordinate_sub (z w : CutRing × CutRing) (j : Fin 2) : + pointCoordinate (z-w) j = pointCoordinate z j-pointCoordinate w j := by + fin_cases j <;> rfl + +@[simp] theorem pointLabel_zero (j : Fin 2) : pointLabel (0 : CutRing × CutRing) j = 0 := by + simp [pointLabel,endpointLabel] + +@[simp] theorem pointLabel_sub (z w : CutRing × CutRing) (j : Fin 2) : + pointLabel (z-w) j = pointLabel z j-pointLabel w j := by + simp only [pointLabel,pointCoordinate_sub,endpointLabel_sub] + +theorem tangentOffset_ordinary_bound (a : ℕ) (d : Fin 2) (w : CutRing) (j : Fin 2) : + |ordinary (pointCoordinate (tangentOffset a d w) j)| ≤ + (1+|ordinary (cutTau^a)|)*|ordinary w| := by + have h0 := abs_nonneg (ordinary w) + have h1 := abs_nonneg (ordinary (cutTau^a)) + fin_cases d <;> fin_cases j + · change |ordinary w| ≤ _ + nlinarith [mul_nonneg h0 h1] + · change |ordinary (cutTau^a*w)| ≤ _ + rw [map_mul,abs_mul] + nlinarith + · change |ordinary (cutTau^a*w)| ≤ _ + rw [map_mul,abs_mul] + nlinarith + · change |ordinary w| ≤ _ + nlinarith [mul_nonneg h0 h1] + +theorem tangentOffset_label_bound (a : ℕ) (d : Fin 2) (w : CutRing) (j : Fin 2) : + |(pointLabel (tangentOffset a d w) j : ℝ)| ≤ + |(endpointLabel w : ℝ)|+|(endpointLabel (cutTau^a*w) : ℝ)| := by + have h0 := abs_nonneg (endpointLabel w : ℝ) + have h1 := abs_nonneg (endpointLabel (cutTau^a*w) : ℝ) + fin_cases d <;> fin_cases j + · exact le_add_of_nonneg_right h1 + · exact le_add_of_nonneg_left h0 + · exact le_add_of_nonneg_left h0 + · exact le_add_of_nonneg_right h1 + +theorem tangent_centers_uniform (a : ℕ) (u v : CutRing) (huv : u*v=1) + {A B : ℝ} (hA : 0 ≤ A) (hB : 0 ≤ B) : + ∃ K : ℝ, 0 < K ∧ ∀ n : ℕ, 1 ≤ n → ∀ w : CutRing, + |ordinary w| ≤ A/(n:ℝ) → |(endpointLabel w : ℝ)| ≤ B*(n:ℝ) → + ∀ (d : Fin 2) (z₀ : CutRing × CutRing), + ∃ (T : ℕ) (z : ℕ → CutRing × CutRing) (e : ℕ → Fin 5), + z 0 = z₀ ∧ z T = z₀+tangentOffset a d w ∧ + (∀ i, i < T → z (i+1) = z i+tangentOffset a d (signedShortSteps u (e i))) ∧ + (∀ i j, |ordinary (pointCoordinate (z i-z₀) j)| ≤ + (1+|ordinary (cutTau^a)|)*(A/(n:ℝ)+(|ordinary u|+|ordinary (cutTau*u)|))) ∧ + (∀ i j, |(pointLabel (z i-z₀) j : ℝ)| ≤ K*(n:ℝ)) := by + obtain ⟨K,hK,hwalk⟩ := tangent_chain_uniform (cutTau^a) u v huv hA hB + refine ⟨K,hK,fun n hn w hw hw' d z₀ => ?_⟩ + obtain ⟨xs,hxs,hm,_hlen,ho,hq⟩ := hwalk n hn w hw hw' + have he : ∀ i : ℕ, ∃ e : Fin 5, ∀ hi : i < xs.length, xs[i]'hi = signedShortSteps u e := by + intro i + by_cases hi : i < xs.length + · obtain hh | hh | hh | hh := hm xs[i] (List.getElem_mem hi) + · exact ⟨1,fun _ => by simpa [signedShortSteps] using hh⟩ + · exact ⟨2,fun _ => by simpa [signedShortSteps] using hh⟩ + · exact ⟨3,fun _ => by simpa [signedShortSteps] using hh⟩ + · exact ⟨4,fun _ => by simpa [signedShortSteps] using hh⟩ + · exact ⟨0,fun h => (hi h).elim⟩ + choose e he using he + let z := fun i => z₀+tangentOffset a d (xs.take i).sum + refine ⟨xs.length,z,e,?_,?_,?_,?_,?_⟩ + · simp [z] + · simp [z,hxs] + · intro i hi + have hs : (xs.take (i+1)).sum = (xs.take i).sum+xs[i] := by + rw [List.take_add_one] + simp only [List.getElem?_eq_getElem hi,Option.toList_some,List.sum_append,List.sum_singleton] + dsimp [z] + rw [hs,he i hi,tangentOffset_add,add_assoc] + · intro i j + have hh := tangentOffset_ordinary_bound a d (xs.take i).sum j + have hh' := mul_le_mul_of_nonneg_left (ho i) (by positivity : 0 ≤ 1+|ordinary (cutTau^a)|) + simpa only [z,add_sub_cancel_left] using hh.trans hh' + · intro i j + simpa only [z,add_sub_cancel_left] using (tangentOffset_label_bound a d (xs.take i).sum j).trans (hq i) + +end TangentWalkCenters + +section UniformChartGeometry + +theorem uniform_tangent_chart_geometry (a : ℕ) (u v s : CutRing) (huv : u*v=1) + (hs : 0 < ordinary s) + (hshort : (1+|ordinary (cutTau^a)|)*(|ordinary u|+|ordinary (cutTau*u)|) < ordinary s/4) + {A B D E : ℝ} (hA : 0 ≤ A) (hB : 0 ≤ B) (_hD : 0 ≤ D) (hE : 0 ≤ E) : + ∃ K : ℝ, 0 ≤ K ∧ ∃ N : ℕ, 1 ≤ N ∧ ∀ n : ℕ, N ≤ n → + ∀ w : CutRing, |ordinary w| ≤ A/(n:ℝ) → |(endpointLabel w:ℝ)| ≤ B*(n:ℝ) → + ∀ (d : Fin 2) (z₀ : CutRing × CutRing) (q p : Fin 2 → ℤ) (L V : Fin 2 → CutRing), + (∀ j, |(pointLabel z₀ j+q j-p j:ℝ)| ≤ E*(n:ℝ)) → + (∀ j, |ordinary (L j)-ordinary (pointCoordinate z₀ j)| ≤ D/(n:ℝ)) → + (∀ j, |ordinary (V j)-ordinary (pointCoordinate z₀ j)| ≤ D/(n:ℝ)) → + ∃ (T : ℕ) (z : ℕ → CutRing × CutRing) (e : ℕ → Fin 5), + z 0 = z₀ ∧ z T = z₀+tangentOffset a d w ∧ + (∀ i, i < T → z (i+1) = z i+tangentOffset a d (signedShortSteps u (e i))) ∧ + (∀ i j, ((pointLabel (z i) j+q j-p j).natAbs:ℝ) ≤ (K+1)*(n:ℝ)) ∧ + (∀ i j, -ordinary s+ordinary (pointCoordinate (z i) j) ≤ ordinary (L j)-ordinary s/4) ∧ + (∀ i j, ordinary (V j)+ordinary s/4 ≤ ordinary s+ordinary (pointCoordinate (z i) j)) := by + obtain ⟨K,hK,hwalk⟩ := tangent_centers_uniform a u v huv hA hB + let H := (1+|ordinary (cutTau^a)|)*A+D + obtain ⟨N,hN⟩ := exists_nat_gt (max 1 (4*H/ordinary s)) + have hN1 : 1 ≤ N := by + have hh := lt_of_le_of_lt (le_max_left _ _) hN + exact_mod_cast (by linarith : (1:ℝ) ≤ N) + refine ⟨K+E,by linarith,N,hN1,?_⟩ + intro n hn w hw hw' d z₀ q p L V hp hL hV + have hn1 : 1 ≤ n := hN1.trans hn + have hn0 : (0:ℝ) < n := by exact_mod_cast (lt_of_lt_of_le Nat.zero_lt_one hn1) + have hn' : (N:ℝ) ≤ n := by exact_mod_cast hn + have hbig : 4*H/ordinary s < (n:ℝ) := lt_of_lt_of_le (lt_of_le_of_lt (le_max_right _ _) hN) hn' + have hfrac : H/(n:ℝ) < ordinary s/4 := by + have hh := (div_lt_iff₀ hs).mp hbig + apply (div_lt_iff₀ hn0).mpr + nlinarith + obtain ⟨T,z,e,hz0,hzT,hstep,ho,hq⟩ := hwalk n hn1 w hw hw' d z₀ + refine ⟨T,z,e,hz0,hzT,hstep,?_,?_,?_⟩ + · intro i j + have he : ((pointLabel (z i) j+q j-p j:ℤ):ℝ) = + (pointLabel (z i-z₀) j:ℝ)+(pointLabel z₀ j+q j-p j:ℝ) := by + simp only [pointLabel_sub,Int.cast_sub,Int.cast_add] + ring + rw [Nat.cast_natAbs,Int.cast_abs,he] + calc + _ ≤ |(pointLabel (z i-z₀) j:ℝ)|+|(pointLabel z₀ j+q j-p j:ℝ)| := abs_add_le _ _ + _ ≤ K*(n:ℝ)+E*(n:ℝ) := add_le_add (hq i j) (hp j) + _ ≤ (K+E+1)*(n:ℝ) := by nlinarith + · intro i j + have hz := (abs_le.mp (ho i j)).2 + have hl := (abs_le.mp (hL j)).1 + simp only [pointCoordinate_sub,map_sub] at hz + have he : (1+|ordinary (cutTau^a)|)*(A/(n:ℝ)+(|ordinary u|+|ordinary (cutTau*u)|))+D/(n:ℝ) = + H/(n:ℝ)+(1+|ordinary (cutTau^a)|)*(|ordinary u|+|ordinary (cutTau*u)|) := by + dsimp [H] + ring + linarith + · intro i j + have hz := (abs_le.mp (ho i j)).1 + have hv := (abs_le.mp (hV j)).2 + simp only [pointCoordinate_sub,map_sub] at hz + have he : (1+|ordinary (cutTau^a)|)*(A/(n:ℝ)+(|ordinary u|+|ordinary (cutTau*u)|))+D/(n:ℝ) = + H/(n:ℝ)+(1+|ordinary (cutTau^a)|)*(|ordinary u|+|ordinary (cutTau*u)|) := by + dsimp [H] + ring + linarith + +end UniformChartGeometry + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/TentMatrixPositivity.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/TentMatrixPositivity.lean new file mode 100644 index 0000000000000000000000000000000000000000..8b84d48af57798fa2c26756da85828ed5dc5bda3 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/TentMatrixPositivity.lean @@ -0,0 +1,211 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.FlagGerms + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section TentMatrixPositivity +open Classical MeasureTheory + +theorem integral_posSemidef {Ω ι : Type*} [MeasurableSpace Ω] (μ : Measure Ω) + (A : Ω → Matrix ι ι ℝ) (hA : ∀ᵐ ω∂μ,(A ω).PosSemidef) + (hi : ∀i j,Integrable (fun ω => A ω i j) μ) : + Matrix.PosSemidef (fun i j => ∫ω,A ω i j ∂μ) := by + refine ⟨?_,fun x => ?_⟩ + · ext i j + change star (∫ω,A ω j i ∂μ)=∫ω,A ω i j ∂μ + simp only [star_trivial] + apply integral_congr_ae + filter_upwards [hA] with ω hω + have he := congrFun (congrFun hω.isHermitian i) j + simpa using he + · have hi' (i j : ι) : Integrable (fun ω => x i*A ω i j*x j) μ := + ((hi i j).const_mul _).mul_const _ + have he : (∫ω,x.sum (fun i xi => x.sum (fun j xj => star xi*A ω i j*xj)) ∂μ)= + x.sum (fun i xi => x.sum (fun j xj => star xi*(∫ω,A ω i j ∂μ)*xj)) := by + simp only [star_trivial,Finsupp.sum] + rw [integral_finsetSum _ (fun i _ => integrable_finsetSum _ (fun j _ => hi' i j))] + apply Finset.sum_congr rfl + intro i _ + rw [integral_finsetSum _ (fun j _ => hi' i j)] + simp only [integral_mul_const,integral_const_mul] + rw [← he] + apply integral_nonneg_of_ae + filter_upwards [hA] with ω hω + exact hω.2 x + +noncomputable def intervalMark (x t : ℝ) : ℝ := + (Set.Icc x (x+1)).indicator (fun _ => 1) t + +theorem intervalMark_mul (x y : ℝ) : + (fun t => intervalMark x t*intervalMark y t)= + (Set.Icc (max x y) (min (x+1) (y+1))).indicator (fun _ => (1:ℝ)) := by + funext t + have hm : t∈Set.Icc (max x y) (min (x+1) (y+1)) ↔ + t∈Set.Icc x (x+1) ∧ t∈Set.Icc y (y+1) := by + simp only [Set.mem_Icc,max_le_iff,le_min_iff] + tauto + by_cases hx : t∈Set.Icc x (x+1) <;> by_cases hy : t∈Set.Icc y (y+1) <;> + simp [intervalMark,Set.indicator,hm,hx,hy] + +theorem intervalMark_mul_integrable (x y : ℝ) : + Integrable (fun t => intervalMark x t*intervalMark y t) := by + rw [intervalMark_mul] + exact (integrable_indicator_iff measurableSet_Icc).mpr (integrableOn_const (by rw [Real.volume_Icc]; exact ENNReal.ofReal_ne_top)) + +theorem tent_eq_intervalMark_integral (x y : ℝ) : + max (1-|x-y|) 0=∫t,intervalMark x t*intervalMark y t := by + rw [intervalMark_mul,integral_indicator_const 1 measurableSet_Icc] + simp only [smul_eq_mul,mul_one,Real.volume_real_Icc] + congr 1 + rcases le_total x y with h|h + · rw [max_eq_right h,min_eq_left (by linarith),abs_of_nonpos (sub_nonpos.mpr h)] + ring + · rw [max_eq_left h,min_eq_right (by linarith),abs_of_nonneg (sub_nonneg.mpr h)] + ring + +theorem real_rankOne_posSemidef {ι : Type*} (a : ι → ℝ) : + Matrix.PosSemidef (fun i j => a i*a j) := by + refine ⟨?_,fun x => ?_⟩ + · ext i j + change a j*a i=a i*a j + exact mul_comm _ _ + · calc + 0≤(x.sum (fun i xi => xi*a i))^2 := sq_nonneg _ + _=x.sum (fun i xi => x.sum (fun j xj => star xi*(a i*a j)*xj)) := by + simp only [pow_two,Finsupp.sum,Finset.sum_mul,Finset.mul_sum,star_trivial] + apply Finset.sum_congr rfl + intro i _ + apply Finset.sum_congr rfl + intro j _ + ring + +theorem tentMatrix_posSemidef {ι : Type*} (x : ι → ℝ) : + Matrix.PosSemidef (fun i j => max (1-|x i-x j|) 0) := by + have hp (t : ℝ) : Matrix.PosSemidef (fun i j => intervalMark (x i) t*intervalMark (x j) t) := + real_rankOne_posSemidef _ + have h := integral_posSemidef volume + (fun t i j => intervalMark (x i) t*intervalMark (x j) t) + (Filter.Eventually.of_forall hp) (fun i j => intervalMark_mul_integrable (x i) (x j)) + simpa only [← tent_eq_intervalMark_integral] using h + +theorem planeTentMatrix_posSemidef {ι : Type*} (x : ι → ℝ×ℝ) (s : ℝ) : + Matrix.PosSemidef (fun i j => max (1-|(x i).1/s-(x j).1/s|) 0 * + max (1-|(x i).2/s-(x j).2/s|) 0) := by + exact (tentMatrix_posSemidef (fun i => (x i).1/s)).hadamard + (tentMatrix_posSemidef (fun i => (x i).2/s)) + +end TentMatrixPositivity + +section FlagSeparatorMatrices +open Classical MeasureTheory + +noncomputable def flagChamber {a : ℕ} {v : ℝ×ℝ} (t : Fin 4 → ℝ) + (z : SquareFlag a v) : (Fin 4 × CutRing) → Bool := fun l => + if |conjugate l.2|≤t l.1 then + decide (flagMem ⟨halfPlane a l.1 l.2,halfPlane_mem a l.1 l.2⟩ z) else false + +theorem flagChamber_eq_iff {a : ℕ} {v : ℝ×ℝ} (t : Fin 4 → ℝ) + (z w : SquareFlag a v) : flagChamber t z=flagChamber t w ↔ + ∀j c,|conjugate c|≤t j → + (flagMem ⟨halfPlane a j c,halfPlane_mem a j c⟩ z ↔ + flagMem ⟨halfPlane a j c,halfPlane_mem a j c⟩ w) := by + constructor + · intro he j c hc + have h := congrFun he (j,c) + simpa only [flagChamber,hc,ite_true,decide_eq_decide] using h + · intro h + funext l + simp only [flagChamber] + split_ifs with hl + · exact propext (h l.1 l.2 hl) ▸ rfl + · rfl + +theorem measurableSet_flagChamber_eq {a : ℕ} {v : ℝ×ℝ} (z w : SquareFlag a v) : + MeasurableSet {t : Fin 4 → ℝ | flagChamber t z=flagChamber t w} := by + have he : {t : Fin 4 → ℝ | flagChamber t z=flagChamber t w}= + ⋂l : Fin 4 × CutRing, {t | flagChamber t z l=flagChamber t w l} := by + ext t + simp only [Set.mem_ofPred_eq,Set.mem_iInter] + exact funext_iff + rw [he] + apply MeasurableSet.iInter + intro l + by_cases hz : flagMem ⟨halfPlane a l.1 l.2,halfPlane_mem a l.1 l.2⟩ z <;> + by_cases hw : flagMem ⟨halfPlane a l.1 l.2,halfPlane_mem a l.1 l.2⟩ w + · simp only [flagChamber,hz,hw,decide_true,Set.ofPred_true] + exact MeasurableSet.univ + · simpa [flagChamber,hz,hw] using + (measurableSet_lt (measurable_pi_apply l.1) (measurable_const (a := |conjugate l.2|)) : + MeasurableSet {t : Fin 4 → ℝ | t l.1 < |conjugate l.2|}) + · simpa [flagChamber,hz,hw] using + (measurableSet_lt (measurable_pi_apply l.1) (measurable_const (a := |conjugate l.2|)) : + MeasurableSet {t : Fin 4 → ℝ | t l.1 < |conjugate l.2|}) + · simp only [flagChamber,hz,hw,decide_false,ite_self,Set.ofPred_true] + exact MeasurableSet.univ + +theorem equalityMatrix_posSemidef {ι κ : Type*} (f : ι → κ) : + Matrix.PosSemidef (fun i j => if f i=f j then (1:ℝ) else 0) := by + have h := (Matrix.PosSemidef.one (n := κ) (R := ℝ)).submatrix f + have he : (1 : Matrix κ κ ℝ).submatrix f f=(fun i j => if f i=f j then 1 else 0) := by + funext i j + exact Matrix.one_apply (α := ℝ) (n := κ) (i := f i) (j := f j) + rw [he] at h + exact h + +noncomputable def separatorMatrix {a : ℕ} {v : ℝ×ℝ} + (μ : Measure (Fin 4 → ℝ)) (z w : SquareFlag a v) : ℝ := + ∫t,if flagChamber t z=flagChamber t w then 1 else 0 ∂μ + +theorem separatorMatrix_integrand_integrable {a : ℕ} {v : ℝ×ℝ} + (μ : Measure (Fin 4 → ℝ)) [IsFiniteMeasure μ] (z w : SquareFlag a v) : + Integrable (fun t => if flagChamber t z=flagChamber t w then (1:ℝ) else 0) μ := by + exact (integrable_indicator_iff (measurableSet_flagChamber_eq z w)).mpr integrableOn_const + +theorem separatorMatrix_eq_measure {a : ℕ} {v : ℝ×ℝ} + (μ : Measure (Fin 4 → ℝ)) (z w : SquareFlag a v) : + separatorMatrix μ z w=μ.real {t|flagChamber t z=flagChamber t w} := + integral_indicator_one (measurableSet_flagChamber_eq z w) + +theorem separatorMatrix_posSemidef {a : ℕ} {v : ℝ×ℝ} + (μ : Measure (Fin 4 → ℝ)) [IsFiniteMeasure μ] : + Matrix.PosSemidef (separatorMatrix (a:=a) (v:=v) μ) := by + apply integral_posSemidef + · exact Filter.Eventually.of_forall fun t => equalityMatrix_posSemidef (flagChamber t) + · exact separatorMatrix_integrand_integrable μ + +noncomputable def thresholdLaw (s κ : ℝ) : Measure (Fin 4 → ℝ) := + Measure.pi fun _ => ProbabilityTheory.cond volume (Set.Icc (κ/s) (2*κ/s)) + +theorem thresholdLaw_isProbability {s κ : ℝ} (hs : 0 decide (p∈U)) := by + refine polygon_induction (P := fun U => HasSquareArrangement (fun p => decide (p∈U))) + ?_ ?_ ?_ ?_ hU + · intro j z + exact ⟨{(j,z)},fun p q h => h _ (Finset.mem_singleton_self _)⟩ + · exact ⟨∅,fun _ _ _ => rfl⟩ + · rintro U V ⟨S,hS⟩ ⟨T,hT⟩ + refine ⟨S∪T,fun p q h => ?_⟩ + have h₁ := decide_eq_decide.mp (hS p q (fun l hl => h l (Finset.mem_union_left T hl))) + have h₂ := decide_eq_decide.mp (hT p q (fun l hl => h l (Finset.mem_union_right S hl))) + exact decide_eq_decide.mpr (or_congr h₁ h₂) + · rintro U ⟨S,hS⟩ + refine ⟨S,fun p q h => ?_⟩ + exact decide_eq_decide.mpr (not_congr (decide_eq_decide.mp (hS p q h))) + +theorem squareArrangement_precomp {a : ℕ} {K : Type*} {f : GenericSquare a → K} + (hf : HasSquareArrangement f) (t : GenericSquare a → GenericSquare a) + (ht : ∀ l, HasSquareArrangement (fun p => squareSign l (t p))) : + HasSquareArrangement (f ∘ t) := by + choose S hS using ht + obtain ⟨T,hT⟩ := hf + refine ⟨T.biUnion S,fun p q hpq => hT (t p) (t q) (fun l hl => ?_)⟩ + exact hS l p q (fun k hk => hpq k (Finset.mem_biUnion.mpr ⟨l,hl,hk⟩)) + +theorem squareArrangement_translate {a : ℕ} {K : Type*} {f : GenericSquare a → K} + (hf : HasSquareArrangement f) (u : CutRing × CutRing) : + HasSquareArrangement (fun p => f (translate a u p)) := by + apply squareArrangement_precomp hf + intro l + exact polygon_hasSquareArrangement (polygon_preimage_translate u (halfPlane_mem a l.1 l.2)) + +noncomputable def squareStepSubmodule (a : ℕ) : Submodule ℤ (GenericSquare a → ℤ) where + carrier := {f | HasSquareArrangement f} + zero_mem' := ⟨∅,fun _ _ _ => rfl⟩ + add_mem' := by + rintro f g ⟨S,hS⟩ ⟨T,hT⟩ + exact ⟨S∪T,fun p q h => congrArg₂ (·+·) + (hS p q (fun l hl => h l (Finset.mem_union_left T hl))) + (hT p q (fun l hl => h l (Finset.mem_union_right S hl)))⟩ + smul_mem' := by + rintro c f ⟨S,hS⟩ + exact ⟨S,fun p q hpq => congrArg (c • ·) (hS p q hpq)⟩ + +noncomputable abbrev SquareStep (a : ℕ) := ↥(squareStepSubmodule a) + +namespace SquareStep +variable {a : ℕ} + +noncomputable def translate (u : CutRing × CutRing) : SquareStep a →ₗ[ℤ] SquareStep a where + toFun f := ⟨fun p => f.val (SimpleAmenable.translate a (-u) p), + squareArrangement_translate f.property (-u)⟩ + map_add' _ _ := rfl + map_smul' _ _ := rfl + +@[simp] theorem translate_apply (u : CutRing × CutRing) (f : SquareStep a) (p : GenericSquare a) : + (translate u f).val p = f.val (SimpleAmenable.translate a (-u) p) := rfl + +@[simp] theorem translate_zero (f : SquareStep a) : translate 0 f=f := by + apply Subtype.ext + funext p + simp + +@[simp] theorem translate_add (u v : CutRing × CutRing) (f : SquareStep a) : + translate (u+v) f=translate u (translate v f) := by + apply Subtype.ext + funext p + simp only [translate_apply,neg_add_rev,SimpleAmenable.translate_add] + +noncomputable def representation (a : ℕ) : + Representation ℤ (Multiplicative (CutRing × CutRing)) (SquareStep a) where + toFun u := translate u.toAdd + map_one' := by ext f p; exact congrFun (congrArg Subtype.val (translate_zero f)) p + map_mul' u v := by ext f p; exact congrFun (congrArg Subtype.val (translate_add u.toAdd v.toAdd f)) p + +noncomputable def restrict : PlaneStep a →ₗ[ℤ] SquareStep a where + toFun f := ⟨fun p => f.val ⟨p.val,p.property.2.2⟩,by + obtain ⟨S,hS⟩ := PlaneStep.hasArrangement f + exact ⟨S,fun p q hpq => hS ⟨p.val,p.property.2.2⟩ ⟨q.val,q.property.2.2⟩ hpq⟩⟩ + map_add' _ _ := rfl + map_smul' _ _ := rfl + +@[simp] theorem restrict_apply (f : PlaneStep a) (p : GenericSquare a) : + (restrict f).val p=f.val ⟨p.val,p.property.2.2⟩ := rfl + +end SquareStep +end TorusStepFunctions + +section SquareZeroExtension + +open Classical +namespace SquareStep +variable {a : ℕ} + +def InSquare (p : GenericPlane a) : Prop := + p.val.1 ∈ Set.Ico (0:ℝ) 1 ∧ p.val.2 ∈ Set.Ico (0:ℝ) 1 + +noncomputable def squareEdgeCuts : Finset PlaneCut := {(0,0),(0,1),(1,0),(1,1)} + +theorem square_signs {p q : GenericPlane a} + (h : ∀ l∈squareEdgeCuts, planeSign l p=planeSign l q) : + InSquare p ↔ InSquare q := by + have hx₀ : p.val.1 < 0 ↔ q.val.1 < 0 := by + simpa [planeSign,cutForm] using decide_eq_decide.mp + (h (0,0) (by simp [squareEdgeCuts])) + have hx₁ : p.val.1 < 1 ↔ q.val.1 < 1 := by + simpa [planeSign,cutForm] using decide_eq_decide.mp + (h (0,1) (by simp [squareEdgeCuts])) + have hy₀ : p.val.2 < 0 ↔ q.val.2 < 0 := by + simpa [planeSign,cutForm] using decide_eq_decide.mp + (h (1,0) (by simp [squareEdgeCuts])) + have hy₁ : p.val.2 < 1 ↔ q.val.2 < 1 := by + simpa [planeSign,cutForm] using decide_eq_decide.mp + (h (1,1) (by simp [squareEdgeCuts])) + have hx₀' := not_congr hx₀ + have hy₀' := not_congr hy₀ + simp only [not_lt] at hx₀' hy₀' + exact and_congr (and_congr hx₀' hx₁) (and_congr hy₀' hy₁) + +noncomputable def extendFun (f : SquareStep a) (p : GenericPlane a) : ℤ := + if h : InSquare p then f.val ⟨p.val,h.1,h.2,p.property⟩ else 0 + +theorem extend_arrangement (f : SquareStep a) : HasPlaneArrangement (extendFun f) := by + obtain ⟨S,hS⟩ := f.property + refine ⟨S∪squareEdgeCuts,fun p q hpq => ?_⟩ + have hiff := square_signs (fun l hl => hpq l (Finset.mem_union_right S hl)) + by_cases hp : InSquare p + · have hq := hiff.mp hp + simp only [extendFun,dite_eq_left hp,dite_eq_left hq] + exact hS _ _ (fun l hl => hpq l (Finset.mem_union_left squareEdgeCuts hl)) + · have hq := mt hiff.mpr hp + simp only [extendFun,dite_eq_right hp,dite_eq_right hq] + +theorem extend_compact (f : SquareStep a) : PlaneCompactSupport (extendFun f) := by + refine ⟨1,fun p hp => ?_⟩ + have hn : ¬ InSquare p := by + rintro ⟨⟨hx,hx'⟩,⟨hy,hy'⟩⟩ + rw [abs_of_nonneg hx,abs_of_nonneg hy] at hp + rcases hp with hp|hp <;> linarith + exact dite_eq_right hn + +noncomputable def extend : SquareStep a →ₗ[ℤ] PlaneStep a where + toFun f := ⟨extendFun f,extend_arrangement f,extend_compact f⟩ + map_add' f g := by + apply Subtype.ext + funext p + by_cases hp : InSquare p <;> simp [extendFun,hp] + rfl + map_smul' n f := by + apply Subtype.ext + funext p + by_cases hp : InSquare p <;> simp [extendFun,hp] + rfl + +@[simp] theorem extend_apply (f : SquareStep a) (p : GenericPlane a) : + (extend f).val p = extendFun f p := rfl + +@[simp] theorem restrict_extend (f : SquareStep a) : restrict (extend f)=f := by + apply Subtype.ext + funext p + exact dite_eq_left ⟨p.property.1,p.property.2.1⟩ + +noncomputable def intPair (n : ℤ × ℤ) : CutRing × CutRing := ((n.1:CutRing),(n.2:CutRing)) + +@[simp] theorem intPair_zero : intPair (0:ℤ×ℤ)=0 := by ext <;> simp [intPair] +@[simp] theorem intPair_add (n m : ℤ×ℤ) : intPair (n+m)=intPair n+intPair m := by + ext <;> simp [intPair] +@[simp] theorem intPair_neg (n : ℤ×ℤ) : intPair (-n) = - intPair n := by + ext <;> simp [intPair] + +noncomputable def slice (n : ℤ×ℤ) : PlaneStep a →ₗ[ℤ] SquareStep a := + restrict.comp (PlaneStep.translate (-intPair n)) + +@[simp] theorem slice_apply (n : ℤ×ℤ) (f : PlaneStep a) (p : GenericSquare a) : + (slice n f).val p=f.val (GenericPlane.shift (intPair n) ⟨p.val,p.property.2.2⟩) := by + change f.val (GenericPlane.shift (- -intPair n) ⟨p.val,p.property.2.2⟩)=_ + rw [neg_neg] + +@[simp] theorem slice_zero (f : PlaneStep a) : slice 0 f=restrict f := by + apply Subtype.ext + funext p + rw [slice_apply] + rw [intPair_zero] + exact congrArg f.val (GenericPlane.shift_zero ⟨p.val,p.property.2.2⟩) + +end SquareStep +end SquareZeroExtension + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/TranslationLifts.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/TranslationLifts.lean new file mode 100644 index 0000000000000000000000000000000000000000..0c8d44ae12cd8a4e752e5f516a290eed7901dae0 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/TranslationLifts.lean @@ -0,0 +1,47 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.FinitelyManyTranslationRelations + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section ActualTranslationLifts + +def sourceTranslationLabel (m : ℕ) (i : Fin m × Fin 2) : SourceGeneratorLabel m := Sum.inr i + +variable (a : ℕ) (r : CutRing) (m : ℕ) (hm : 2 ≤ m) + +theorem source_translation_commute (i j : Fin m × Fin 2) : + Commute (alternatingGenerator a r m hm (Sum.inr i)) + (alternatingGenerator a r m hm (Sum.inr j)) := by + change _ * _ = _ * _ + apply Subtype.ext + change trackTranslation _ * trackTranslation _ = trackTranslation _ * trackTranslation _ + rw [← trackTranslation_add, ← trackTranslation_add] + congr 1 + exact add_comm _ _ + +theorem source_translation_lifts_eventually : + ∃ L : ℕ, ∀ M : ℕ, L ≤ M → + ∃ t : Multiplicative (FreeAbelianGroup (Fin m × Fin 2)) →* + BoundedRelationCover M (alternatingGenerator a r m hm), + ∀ i, t (Multiplicative.ofAdd (FreeAbelianGroup.of i)) = + PresentedGroup.of (Sum.inr i) := by + obtain ⟨L,hL⟩ := commuting_words_lift_eventually (alternatingGenerator a r m hm) + (fun i : Fin m × Fin 2 => FreeGroup.of (sourceTranslationLabel m i)) (by + intro i j + rw [FreeGroup.lift_apply_of, FreeGroup.lift_apply_of] + exact source_translation_commute a r m hm i j) + exact ⟨L,fun M hM => let ⟨t,ht,_⟩ := hL M hM; ⟨t,ht⟩⟩ + +end ActualTranslationLifts + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/TranslationRoutingHelpers.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/TranslationRoutingHelpers.lean new file mode 100644 index 0000000000000000000000000000000000000000..ade91e248cf052e3632b85e6c8a5edc45720f5f7 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/TranslationRoutingHelpers.lean @@ -0,0 +1,180 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Configurations.RepeatedTrackRouting +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.FrameCompatibility + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section TranslationRoutingHelpers + +namespace PrivateRoutingBank +variable {m : ℕ} {i : Fin 5 → Fin m} (P : PrivateRoutingBank i) + +noncomputable def blockOffsets (d : Fin m → CutRing × CutRing) : Fin m → CutRing × CutRing := + Function.extend (fun p : Fin 5 × Fin 5 => P.row p.1 p.2) (fun p => d (i p.1)) 0 + +@[simp] theorem blockOffsets_apply (d : Fin m → CutRing × CutRing) (j k : Fin 5) : + P.blockOffsets d (P.row j k)=d (i j) := by + have hf : Function.FactorsThrough (fun p : Fin 5 × Fin 5 => d (i p.1)) + (fun p : Fin 5 × Fin 5 => P.row p.1 p.2) := by + intro p q he + obtain ⟨j,k⟩ := p + obtain ⟨l,t⟩ := q + change P.row j k=P.row l t at he + change d (i j)=d (i l) + by_cases hk : k=0 <;> by_cases ht : t=0 + · subst k; subst t + rw [P.source j,P.source l] at he + exact congrArg d he + · subst k + rw [P.source j] at he + exact (P.fresh l t ht j he.symm).elim + · subst t + rw [P.source l] at he + exact (P.fresh j k hk l he).elim + · exact congrArg (fun q => d (i q)) (P.separate j k l t hk ht he).1 + exact hf.extend_apply 0 (j,k) + +end PrivateRoutingBank + +noncomputable def finiteBalancedVector {m : ℕ} (I : Finset (Fin m)) (b : Fin m) + (u : Fin m → CutRing × CutRing) : Fin m → CutRing × CutRing := + ∑ i ∈ I, (Pi.single i (u i) - Pi.single b (u i)) + +theorem finiteBalancedVector_apply {m : ℕ} (I : Finset (Fin m)) (b : Fin m) (hb : b ∉ I) + (u : Fin m → CutRing × CutRing) (i : Fin m) (hi : i ∈ I) : + finiteBalancedVector I b u i=u i := by + classical + have hib : i≠b := fun he => hb (he ▸ hi) + simp [finiteBalancedVector,Finset.sum_apply,Pi.sub_apply,Pi.single_apply,hib,hi] + +theorem finiteBalancedVector_supported {m : ℕ} (I : Finset (Fin m)) (b : Fin m) + (u : Fin m → CutRing × CutRing) (i : Fin m) (hi : i ∉ insert b I) : + finiteBalancedVector I b u i=0 := by + classical + have hib : i≠b := fun he => hi (he ▸ Finset.mem_insert_self b I) + have hiI : i∉I := fun hh => hi (Finset.mem_insert_of_mem hh) + simp only [finiteBalancedVector,Finset.sum_apply,Pi.sub_apply] + apply Finset.sum_eq_zero + intro j hj + have hij : i≠j := fun he => hiI (he ▸ hj) + simp [hib,hij] + +theorem finiteBalancedVector_range (a : ℕ) (r : CutRing) (m : ℕ) (hm : 2 ≤ m) + (I : Finset (Fin (m+1))) (b : Fin (m+1)) (u : Fin (m+1) → CutRing × CutRing) : + trackTranslation (a := a) (finiteBalancedVector I b u) ∈ + (sourceLatticeFullMap a r m hm).range := by + classical + unfold finiteBalancedVector + induction I using Finset.induction_on with + | empty => simp + | @insert i I hi ih => + rw [Finset.sum_insert hi,trackTranslation_add] + exact (sourceLatticeFullMap a r m hm).range.mul_mem + (sourceLatticeFullMap_difference a r m hm b i (u i)) ih + +theorem SlotMap_shift_injective {a m : ℕ} (V : polygonAlgebra a) + (i : Fin 5 → Fin m) (u : Fin 5 → CutRing × CutRing) + (hinj : Function.Injective (SlotMap a m V (fun j => (i j,u j)))) + (d : Fin m → CutRing × CutRing) : + Function.Injective (SlotMap a m V (fun j => (i j,d (i j)+u j))) := by + have he (p : Fin 5 × V.val) : (trackTranslation d).val (SlotMap a m V (fun j => (i j,u j)) p) = + SlotMap a m V (fun j => (i j,d (i j)+u j)) p := by + simp [SlotMap,translate_add] + intro p q hpq + apply hinj + apply (trackTranslation d).val.injective + rwa [he,he] + +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + (hlarge : 15 < m+1) (h : B.AllPrimitiveLaws) (hr : 0 hb (P.row_subset j ht) + let F := balancedOffsetFrame a r m hm (orderedTrackAlphabet (P.row j)) b hbj (fun _ => u j) + have he := DFunLike.congr_fun (B.frameStar_shift hlarge h hr (orderedTrackAlphabet (P.row j)) + (fun _ => u j) F k d hd V) (universalMap (orderedTrackHom (P.row j)) privateCycleStar) + change B.distinctSlotStar hlarge h hr (P.row j) (d+(fun _ => u j)) (F.shift k d hd) V privateCycleStar = + (MulAut.conj (B.t k)) (B.privateRoutingFactor hlarge h hr i u P b hb V j) at he + rw [← he] + constructor + · exact B.distinctSlotStar_uniform_mem hlarge h hr (P.row j) b hbj _ (F.shift k d hd) + (d (i j)+u j) (fun l => by simp only [Pi.add_apply,hblock l]) V privateCycleStar + · exact sourceAlignedGroup_mono B.t (P.row_subset j) + (B.frameStar_alphabet_mem hlarge h hr _ (by simp [orderedTrackAlphabet]) b hbj _ + (F.shift k d hd) V (universalMap (orderedTrackHom (P.row j)) privateCycleStar)) + +theorem privateRoutingWord_shift_mem (i : Fin 5 → Fin (m+1)) + (u : Fin 5 → CutRing × CutRing) (P : PrivateRoutingBank i) + (b : Fin (m+1)) (hb : b ∉ P.alphabet) (V : polygonAlgebra a) + (k : Multiplicative (FreeAbelianGroup (Fin m × Fin 2))) + (d : Fin (m+1) → CutRing × CutRing) + (hd : sourceLatticeFullMap a r m hm k=trackTranslation d) + (hblock : ∀ j l, d (P.row j l)=d (i j)) : + (MulAut.conj (B.t k)) (B.privateRoutingWord hlarge h hr i u P b hb V) ∈ + ⨆ W : polygonAlgebra a, (B.polygonStar hlarge h hr W).range ∧ + (MulAut.conj (B.t k)) (B.privateRoutingWord hlarge h hr i u P b hb V) ∈ + sourceAlignedGroup a r m hm M B.t P.alphabet := by + have he : (MulAut.conj (B.t k)) (B.privateRoutingWord hlarge h hr i u P b hb V) = + ((List.finRange 5).map (fun j => + (MulAut.conj (B.t k)) (B.privateRoutingFactor hlarge h hr i u P b hb V j))).prod := by + exact (MulAut.conj (B.t k)).toMonoidHom.map_list_prod _ |>.trans (by rw [List.map_map]; rfl) + rw [he] + constructor + · apply Subgroup.list_prod_mem + intro t ht + obtain ⟨j,_,rfl⟩ := List.mem_map.mp ht + exact (B.privateRoutingFactor_shift_mem hlarge h hr i u P b hb V j k d hd (hblock j)).1 + · apply Subgroup.list_prod_mem + intro t ht + obtain ⟨j,_,rfl⟩ := List.mem_map.mp ht + exact (B.privateRoutingFactor_shift_mem hlarge h hr i u P b hb V j k d hd (hblock j)).2 + +end InitialCoverSystem +end TranslationRoutingHelpers + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/TranslationTransport.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/TranslationTransport.lean new file mode 100644 index 0000000000000000000000000000000000000000..950790f846cc37e017a4a7944b57e18d31e33f9a --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/TranslationTransport.lean @@ -0,0 +1,175 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.TranslationRoutingHelpers +import OAI.GroupTheory.SimpleAmenable.CentralCovers.ShiftedRouting +import OAI.GroupTheory.SimpleAmenable.CentralCovers.CanonicalSlotStars + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section TranslationTransport + +namespace PrivateRoutingBank +variable {m : ℕ} {i : Fin 5 → Fin m} (P : PrivateRoutingBank i) + +noncomputable def balancedShift (b : Fin m) (d : Fin m → CutRing × CutRing) : + Fin m → CutRing × CutRing := finiteBalancedVector P.alphabet b (P.blockOffsets d) + +theorem balancedShift_row (b : Fin m) (hb : b ∉ P.alphabet) + (d : Fin m → CutRing × CutRing) (j l : Fin 5) : + P.balancedShift b d (P.row j l)=d (i j) := by + rw [balancedShift,finiteBalancedVector_apply P.alphabet b hb _ _ + (P.row_subset j (orderedTrackAlphabet_mem _ l)),P.blockOffsets_apply] + +theorem balancedShift_source (b : Fin m) (hb : b ∉ P.alphabet) + (d : Fin m → CutRing × CutRing) (j : Fin 5) : + P.balancedShift b d (i j)=d (i j) := + (congrArg (P.balancedShift b d) (P.source j)).symm.trans (P.balancedShift_row b hb d j 0) + +theorem balancedShift_block (b : Fin m) (hb : b ∉ P.alphabet) + (d : Fin m → CutRing × CutRing) (j l : Fin 5) : + P.balancedShift b d (P.row j l)=P.balancedShift b d (i j) := + (P.balancedShift_row b hb d j l).trans (P.balancedShift_source b hb d j).symm + +theorem difference_support (b : Fin m) (d : Fin m → CutRing × CutRing) + (J : Finset (Fin m)) (hsupp : ∀ t, t∉J → d t=0) + (t : Fin m) (ht : t∉J ∪ insert b P.alphabet) : (d-P.balancedShift b d) t=0 := by + have htJ : t∉J := fun hh => ht (Finset.mem_union_left _ hh) + have htP : t∉insert b P.alphabet := fun hh => ht (Finset.mem_union_right _ hh) + rw [Pi.sub_apply] + exact sub_eq_zero.mpr ((hsupp t htJ).trans + (finiteBalancedVector_supported P.alphabet b (P.blockOffsets d) t htP).symm) + +theorem difference_source (b : Fin m) (hb : b ∉ P.alphabet) + (d : Fin m → CutRing × CutRing) (j : Fin 5) : + (d - P.balancedShift b d) (i j)=0 := by + rw [Pi.sub_apply,P.balancedShift_source b hb d j,sub_self] + +theorem difference_alphabet_card (b : Fin m) (J : Finset (Fin m)) (hJ : J.card≤2) : + (J ∪ insert b P.alphabet).card≤28 := by + have hc := P.alphabet_card + have h₁ := Finset.card_union_le J (insert b P.alphabet) + have h₂ := Finset.card_insert_le b P.alphabet + omega + +end PrivateRoutingBank + +theorem exists_privateRoutingBank_with_balance {m : ℕ} (i : Fin 5 → Fin m) + (hwide : 26 ≤ m) : ∃ P : PrivateRoutingBank i, ∃ b : Fin m, b ∉ P.alphabet := by + classical + have hres : 20 ≤ ((Finset.univ : Finset (Fin m)) \ + (∅ ∪ Finset.univ.image i)).card := by + rw [Finset.empty_union,Finset.card_sdiff_of_subset (Finset.subset_univ _)] + have hc := Finset.card_image_le (f := i) (s := Finset.univ) + simp only [Finset.card_univ,Fintype.card_fin] at hc ⊢ + omega + obtain ⟨P,_⟩ := exists_privateRoutingBank i ∅ hres + obtain ⟨b,_,hb⟩ := Finset.exists_mem_notMem_of_card_lt_card + (show P.alphabet.card < (Finset.univ : Finset (Fin m)).card by + have hc := P.alphabet_card + simp only [Finset.card_univ,Fintype.card_fin] + omega) + exact ⟨P,b,hb⟩ + +theorem translation_conjugate_eq {A H : Type*} [CommGroup A] [Group H] + (t : A →* H) (k l : A) (x : H) (hc : Commute (t (k*l⁻¹)) x) : + t k*x*(t k)⁻¹=t l*x*(t l)⁻¹ := by + let δ := k*l⁻¹ + have hkk : k=l*δ := by dsimp [δ]; simp only [mul_comm k l⁻¹,← mul_assoc,mul_inv_cancel,one_mul] + have hcc : t δ*x*(t δ)⁻¹=x := by rw [hc.eq,mul_assoc,mul_inv_cancel,mul_one] + calc + t k*x*(t k)⁻¹ = t l*(t δ*x*(t δ)⁻¹)*(t l)⁻¹ := by rw [hkk,map_mul]; group + _ = t l*x*(t l)⁻¹ := by rw [hcc] + +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + (hlarge : 15 < m+1) (h : B.AllPrimitiveLaws) (hr : 0 (i j,u j)))) + (P : PrivateRoutingBank i) (b : Fin (m+1)) (hb : b ∉ P.alphabet) + (k : Multiplicative (FreeAbelianGroup (Fin m × Fin 2))) + (d : Fin (m+1) → CutRing × CutRing) + (hd : sourceLatticeFullMap a r m hm k=trackTranslation d) + (hblock : ∀ j l, d (P.row j l)=d (i j)) : + (MulAut.conj (B.t k)).toMonoidHom.comp (B.slotStar hlarge h hr hwide V i u hinj) = + B.slotStar hlarge h hr hwide V i (fun j => d (i j)+u j) + (SlotMap_shift_injective V i u hinj d) := by + let ρ := SlotRouting.privateBank (B := B) (hlarge := hlarge) (h := h) (hr := hr) + V i u P b hb hinj + have htarget (j : Fin 5) : d (ρ.target j)=d (i j) := hblock j 1 + have hmem := B.privateRoutingWord_shift_mem hlarge h hr i u P b hb V k d hd hblock + let σ := ρ.shift k d hd htarget hmem.1 hmem.2 + rw [B.slotStar_eq_routing hlarge h hr R hR hwide V i u hinj ρ, + B.slotStar_eq_routing hlarge h hr R hR hwide V i _ _ σ] + exact (ρ.shift_star k d hd htarget hmem.1 hmem.2).symm + +theorem slotStar_translation_difference_commute (V : polygonAlgebra a) + (i : Fin 5 → Fin (m+1)) (u : Fin 5 → CutRing × CutRing) + (hinj : Function.Injective (SlotMap a (m+1) V (fun j => (i j,u j)))) + (P : PrivateRoutingBank i) (b : Fin (m+1)) (hb : b ∉ P.alphabet) + (k k' : Multiplicative (FreeAbelianGroup (Fin m × Fin 2))) + (d : Fin (m+1) → CutRing × CutRing) + (hd : sourceLatticeFullMap a r m hm k=trackTranslation d) + (hk' : sourceLatticeFullMap a r m hm k'=trackTranslation (P.balancedShift b d)) + (J : Finset (Fin (m+1))) (hJ : J.card≤2) (hsupp : ∀ t, t∉J → d t=0) + (s : UniversalExtension (alternatingGroup (Fin 5))) : + Commute (B.t (k*k'⁻¹)) (B.slotStar hlarge h hr hwide V i u hinj s) := by + have hδ : sourceLatticeFullMap a r m hm (k*k'⁻¹)= + trackTranslation (d-P.balancedShift b d) := by + rw [map_mul,map_inv,hd,hk',trackTranslation_sub] + exact B.slotStar_zero_commute hlarge h hr R hR hwide V i u hinj (k*k'⁻¹) + (d-P.balancedShift b d) hδ (J ∪ insert b P.alphabet) + (P.difference_alphabet_card b J hJ) (P.difference_support b d J hsupp) + (P.difference_source b hb d) s + +theorem slotStar_translation_two_support (V : polygonAlgebra a) + (i : Fin 5 → Fin (m+1)) (u : Fin 5 → CutRing × CutRing) + (hinj : Function.Injective (SlotMap a (m+1) V (fun j => (i j,u j)))) + (k : Multiplicative (FreeAbelianGroup (Fin m × Fin 2))) + (d : Fin (m+1) → CutRing × CutRing) + (hd : sourceLatticeFullMap a r m hm k=trackTranslation d) + (J : Finset (Fin (m+1))) (hJ : J.card≤2) + (hsupp : ∀ t, t∉J → d t=0) : + (MulAut.conj (B.t k)).toMonoidHom.comp (B.slotStar hlarge h hr hwide V i u hinj) = + B.slotStar hlarge h hr hwide V i (fun j => d (i j)+u j) + (SlotMap_shift_injective V i u hinj d) := by + obtain ⟨P,b,hb⟩ := exists_privateRoutingBank_with_balance i (by omega) + let v := P.balancedShift b d + obtain ⟨k',hk'⟩ := finiteBalancedVector_range a r m hm P.alphabet b (P.blockOffsets d) + have hv : sourceLatticeFullMap a r m hm k'=trackTranslation v := hk' + have he := B.slotStar_translation_bank hlarge h hr R hR hwide V i u hinj P b hb k' v hv + (P.balancedShift_block b hb d) + have hoff : (fun j => v (i j)+u j)=(fun j => d (i j)+u j) := + funext (fun j => congrArg (fun z => z+u j) (P.balancedShift_source b hb d j)) + have he' : (MulAut.conj (B.t k')).toMonoidHom.comp (B.slotStar hlarge h hr hwide V i u hinj) = + B.slotStar hlarge h hr hwide V i (fun j => d (i j)+u j) + (SlotMap_shift_injective V i u hinj d) := by simpa only [hoff] using he + rw [← he'] + ext s : 1 + apply translation_conjugate_eq B.t k k' + exact B.slotStar_translation_difference_commute hlarge h hr R hR hwide V i u hinj + P b hb k k' d hd hk' J hJ hsupp s + +end InitialCoverSystem +end TranslationTransport + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/TupleChartDomain.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/TupleChartDomain.lean new file mode 100644 index 0000000000000000000000000000000000000000..48df8de5ac88378bad72243779e4f082594c2418 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/TupleChartDomain.lean @@ -0,0 +1,422 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Configurations.TrackPoint + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +section PolygonFullGroup +attribute [local instance] Classical.propDecidable + +private noncomputable def tupleChartDomain {a m n : ℕ} + (slots : Fin n → Fin m × (CutRing × CutRing)) + (cs : Fin n → TableChart a m) : polygonAlgebra a := by + classical + refine ⟨⋂ i, if (slots i).1 = (cs i).source then + translate a (slots i).2 ⁻¹' (cs i).domain.val else ∅, ?_⟩ + apply BooleanSubalgebra.iInf_mem + intro i + split_ifs + · exact polygon_preimage_translate _ (cs i).domain.property + · exact BooleanSubalgebra.bot_mem + +private theorem mem_tupleChartDomain {a m n : ℕ} + (slots : Fin n → Fin m × (CutRing × CutRing)) + (cs : Fin n → TableChart a m) (x : GenericSquare a) : + x ∈ (tupleChartDomain slots cs).val ↔ + ∀ i, (cs i).Contains ((slots i).1, translate a (slots i).2 x) := by + classical + simp only [tupleChartDomain, Set.mem_iInter, TableChart.Contains] + apply forall_congr' + intro i + by_cases h : (slots i).1 = (cs i).source <;> simp [h] + +def trackCycle {m : ℕ} (ι : Fin 3 ↪ Fin m) : Equiv.Perm (Fin m) := + Equiv.swap (ι 0) (ι 1) * Equiv.swap (ι 1) (ι 2) + +theorem trackCycle_apply {m : ℕ} (ι : Fin 3 ↪ Fin m) (i : Fin 3) : + trackCycle ι (ι i) = ι (i+1) := by + fin_cases i <;> simp [trackCycle, Equiv.Perm.mul_apply, Equiv.swap_apply_def, + ι.injective.eq_iff] + +theorem trackCycle_apply_of_notMem {m : ℕ} (ι : Fin 3 ↪ Fin m) + {j : Fin m} (hj : j ∉ Set.range ι) : trackCycle ι j = j := by + have hne (i : Fin 3) : j ≠ ι i := by + intro h + exact hj ⟨i,h.symm⟩ + simp [trackCycle, Equiv.Perm.mul_apply, Equiv.swap_apply_def, hne] + +theorem slotHom_cycle_isThreeSlotCycle {a m n : ℕ} (U : polygonAlgebra a) + (hU : U.val.Nonempty) (slots : Fin n → Fin m × (CutRing × CutRing)) + (hinj : Function.Injective (SlotMap a m U slots)) (ι : Fin 3 ↪ Fin n) : + IsThreeSlotCycle (slotHom U slots hinj (trackCycle ι)) := by + let subslots : Fin 3 → Fin m × (CutRing × CutRing) := slots ∘ ι + have he (i : Fin 3) (x : U.val) : + SlotMap a m U subslots (i,x) = SlotMap a m U slots (ι i,x) := rfl + refine ⟨U,subslots,hU,?_,?_,?_⟩ + · rintro ⟨i,x⟩ ⟨j,y⟩ h + rw [he, he] at h + have hi := hinj h + exact Prod.ext (ι.injective (congrArg Prod.fst hi)) (congrArg (fun z : Fin n × U.val => z.2) hi) + · intro i x + rw [he,he] + change slotPerm U slots hinj (trackCycle ι) (SlotMap a m U slots (ι i,x)) = _ + rw [slotPerm_apply,trackCycle_apply] + · intro p hp + change slotPerm U slots hinj (trackCycle ι) p = p + by_cases h : p ∈ Set.range (SlotMap a m U slots) + · obtain ⟨⟨j,x⟩, rfl⟩ := h + rw [slotPerm_apply] + have hj : j ∉ Set.range ι := by + rintro ⟨i,rfl⟩ + exact hp ⟨(i,x),rfl⟩ + rw [trackCycle_apply_of_notMem ι hj] + · exact slotPerm_apply_of_notMem U slots hinj _ h + +def threeInFive : Fin 3 ↪ Fin 5 := ⟨![0,1,2], by decide⟩ +def leftThreeInFive : Fin 3 ↪ Fin 5 := ⟨![0,1,3], by decide⟩ +def rightThreeInFive : Fin 3 ↪ Fin 5 := ⟨![0,2,4], by decide⟩ + +open scoped commutatorElement in +theorem five_cycle_commutator : + ⁅trackCycle leftThreeInFive, trackCycle rightThreeInFive⁆ = trackCycle threeInFive := by + decide + +theorem two_spare_tracks {m : ℕ} (hm : 5 ≤ m) (s : Fin 3 → Fin m) : + ∃ k l : Fin m, k ≠ l ∧ (∀ i, s i ≠ k) ∧ (∀ i, s i ≠ l) := by + classical + let used := Finset.univ.image s + have hc : used.card ≤ 3 := by + exact Finset.card_image_le.trans (by simp) + have hleft : 1 < usedᶜ.card := by + rw [Finset.card_compl] + simp only [Fintype.card_fin] + omega + obtain ⟨k,hk⟩ := Finset.card_pos.mp (by omega : 0 < usedᶜ.card) + obtain ⟨l,hl,hlk⟩ := Finset.exists_mem_ne hleft k + refine ⟨k,l,Ne.symm hlk,?_,?_⟩ + · intro i he + have hi : k ∈ used := Finset.mem_image.mpr ⟨i,Finset.mem_univ _,he⟩ + exact Finset.mem_compl.mp hk hi + · intro i he + have hi : l ∈ used := Finset.mem_image.mpr ⟨i,Finset.mem_univ _,he⟩ + exact Finset.mem_compl.mp hl hi + +noncomputable def extendSlots {m : ℕ} + (s : Fin 3 → Fin m × (CutRing × CutRing)) (k l : Fin m) (i : Fin 5) : + Fin m × (CutRing × CutRing) := + if h : i.val < 3 then s ⟨i.val,h⟩ else if i.val = 3 then (k,0) else (l,0) + +theorem extendSlots_three {m : ℕ} + (s : Fin 3 → Fin m × (CutRing × CutRing)) (k l : Fin m) (i : Fin 3) : + extendSlots s k l (threeInFive i) = s i := by + fin_cases i <;> simp [extendSlots, threeInFive] + +theorem extendSlots_injective {a m : ℕ} (U : polygonAlgebra a) + (s : Fin 3 → Fin m × (CutRing × CutRing)) + (hs : Function.Injective (SlotMap a m U s)) (k l : Fin m) + (hkl : k ≠ l) (hk : ∀ i, (s i).1 ≠ k) (hl : ∀ i, (s i).1 ≠ l) : + Function.Injective (SlotMap a m U (extendSlots s k l)) := by + rintro ⟨i,x⟩ ⟨j,y⟩ he + have htrack := congrArg Prod.fst he + change (extendSlots s k l i).1 = (extendSlots s k l j).1 at htrack + have hij : i = j := by + by_cases hi : i.val < 3 + · by_cases hj : j.val < 3 + · have hh : SlotMap a m U s (⟨i.val,hi⟩,x) = + SlotMap a m U s (⟨j.val,hj⟩,y) := by + simpa [SlotMap, extendSlots, hi, hj] using he + have hh' := congrArg (fun z : Fin 3 × U.val => z.1.val) (hs hh) + exact Fin.ext hh' + · by_cases hj3 : j.val = 3 + · exact False.elim (hk ⟨i.val,hi⟩ (by simpa [extendSlots,hi,hj,hj3] using htrack)) + · exact False.elim (hl ⟨i.val,hi⟩ (by simpa [extendSlots,hi,hj,hj3] using htrack)) + · by_cases hj : j.val < 3 + · by_cases hi3 : i.val = 3 + · exact False.elim (hk ⟨j.val,hj⟩ (by simpa [extendSlots,hi,hj,hi3] using htrack.symm)) + · exact False.elim (hl ⟨j.val,hj⟩ (by simpa [extendSlots,hi,hj,hi3] using htrack.symm)) + · by_cases hi3 : i.val = 3 <;> by_cases hj3 : j.val = 3 + · exact Fin.ext (hi3.trans hj3.symm) + · exact False.elim (hkl (by simpa [extendSlots,hi,hj,hi3,hj3] using htrack)) + · exact False.elim (hkl (by simpa [extendSlots,hi,hj,hi3,hj3] using htrack.symm)) + · apply Fin.ext + omega + subst j + refine Prod.ext rfl ?_ + apply Subtype.ext + exact (translation a (extendSlots s k l i).2).injective (congrArg Prod.snd he) + +open scoped commutatorElement in + +theorem threeSlotCycle_is_commutator {a m : ℕ} (hm : 5 ≤ m) + {g : polygonFullGroup a m} (hg : IsThreeSlotCycle g) : + ∃ b c : polygonFullGroup a m, + IsThreeSlotCycle b ∧ IsThreeSlotCycle c ∧ ⁅b,c⁆ = g := by + obtain ⟨U,s,hU,hs,hgact,hgfix⟩ := hg + obtain ⟨k,l,hkl,hk,hl⟩ := two_spare_tracks hm (fun i => (s i).1) + let S := extendSlots s k l + have hS := extendSlots_injective U s hs k l hkl hk hl + let φ := slotHom U S hS + refine ⟨φ (trackCycle leftThreeInFive), φ (trackCycle rightThreeInFive), + slotHom_cycle_isThreeSlotCycle U hU S hS _, + slotHom_cycle_isThreeSlotCycle U hU S hS _, ?_⟩ + rw [← map_commutatorElement, five_cycle_commutator] + have he (i : Fin 3) (x : U.val) : + SlotMap a m U S (threeInFive i,x) = SlotMap a m U s (i,x) := by + simp only [SlotMap, S, extendSlots_three] + apply Subtype.ext + apply Equiv.ext + intro p + change slotPerm U S hS (trackCycle threeInFive) p = g.val p + by_cases hp : p ∈ Set.range (SlotMap a m U s) + · obtain ⟨⟨i,x⟩,rfl⟩ := hp + rw [← he i x, slotPerm_apply, trackCycle_apply, he, he, hgact] + · rw [hgfix p hp] + by_cases hP : p ∈ Set.range (SlotMap a m U S) + · obtain ⟨⟨j,x⟩,rfl⟩ := hP + rw [slotPerm_apply] + have hj : j ∉ Set.range threeInFive := by + rintro ⟨i,rfl⟩ + exact hp ⟨(i,x),(he i x).symm⟩ + rw [trackCycle_apply_of_notMem threeInFive hj] + · exact slotPerm_apply_of_notMem U S hS _ hP + +theorem polygonAlternatingGroup_perfect (a m : ℕ) (hm : 5 ≤ m) : + Group.IsPerfect (polygonAlternatingGroup a m) := by + apply Subgroup.isPerfect_iff.mpr + apply le_antisymm (Subgroup.commutator_le_self _) + change Subgroup.closure _ ≤ _ + apply (Subgroup.closure_le _).mpr + intro g hg + obtain ⟨b,c,hb,hc,rfl⟩ := threeSlotCycle_is_commutator hm hg + exact Subgroup.commutator_mem_commutator (Subgroup.subset_closure hb) + (Subgroup.subset_closure hc) + +theorem conditional_isThreeSlotCycle {a m : ℕ} (U : polygonAlgebra a) + (hU : U.val.Nonempty) (ι : Fin 3 ↪ Fin m) : + IsThreeSlotCycle (conditionalHom U (trackCycle ι)) := by + classical + let slots : Fin 3 → Fin m × (CutRing × CutRing) := fun i => (ι i, 0) + have hslot (i : Fin 3) (x : U.val) : + SlotMap a m U slots (i,x) = (ι i,x.val) := by + simp [SlotMap, slots] + refine ⟨U, slots, hU, ?_, ?_, ?_⟩ + · rintro ⟨i,x⟩ ⟨j,y⟩ h + simp only [hslot, Prod.mk.injEq] at h + exact Prod.ext (ι.injective h.1) (Subtype.ext h.2) + · intro i x + rw [hslot, hslot] + change conditionalPerm U (trackCycle ι) (ι i, x.val) = _ + simp [x.property, trackCycle_apply] + · intro p hp + have hn (i : Fin 3) (hx : p.2 ∈ U.val) : p.1 ≠ ι i := by + intro h + apply hp + exact ⟨(i,⟨p.2,hx⟩), by rw [hslot]; exact Prod.ext h.symm rfl⟩ + change conditionalPerm U (trackCycle ι) p = p + by_cases hx : p.2 ∈ U.val + · simp [hx, trackCycle, Equiv.Perm.mul_apply, Equiv.swap_apply_def, hn _ hx] + · simp [hx] + +theorem conditional_cycle_mem {a m : ℕ} (U : polygonAlgebra a) + (ι : Fin 3 ↪ Fin m) : conditionalHom U (trackCycle ι) ∈ polygonAlternatingGroup a m := by + classical + by_cases hU : U.val.Nonempty + · exact Subgroup.subset_closure (conditional_isThreeSlotCycle U hU ι) + · have hz : conditionalHom U (trackCycle ι) = 1 := by + apply Subtype.ext + apply Equiv.ext + intro p + have hp : p.2 ∉ U.val := fun h => hU ⟨p.2,h⟩ + change conditionalPerm U (trackCycle ι) p = p + simp [hp] + rw [hz] + exact (polygonAlternatingGroup a m).one_mem + +theorem conditional_cycle_injective {a m : ℕ} (ι : Fin 3 ↪ Fin m) : + Function.Injective (fun U : polygonAlgebra a => conditionalHom U (trackCycle ι)) := by + classical + intro U V h + apply Subtype.ext + ext x + have he := congrArg (fun g : polygonFullGroup a m => g.val (ι 0,x)) h + change conditionalPerm U (trackCycle ι) (ι 0,x) = + conditionalPerm V (trackCycle ι) (ι 0,x) at he + have h01 : ι 0 ≠ ι 1 := ι.injective.ne (by decide) + by_cases hu : x ∈ U.val <;> by_cases hv : x ∈ V.val <;> + simp [hu, hv, trackCycle_apply] at he ⊢ + +noncomputable def shrinkingLevel (n : ℕ) : CutRing := (cutTau - 1) ^ (n+1) + +@[simp] theorem ordinary_shrinkingLevel (n : ℕ) : + ordinary (shrinkingLevel n) = (Real.goldenRatio - 1) ^ (n+1) := by + simp [shrinkingLevel] + +theorem shrinkingLevel_bounds (n : ℕ) : + 0 < ordinary (shrinkingLevel n) ∧ ordinary (shrinkingLevel n) < 1 := by + have hpos : 0 < Real.goldenRatio - 1 := sub_pos.mpr Real.one_lt_goldenRatio + have hlt : Real.goldenRatio - 1 < 1 := by linarith [Real.goldenRatio_lt_two] + simpa using And.intro (pow_pos hpos (n+1)) (pow_lt_one₀ hpos.le hlt (Nat.succ_ne_zero n)) + +theorem shrinkingLevel_strictAnti : StrictAnti (fun n => ordinary (shrinkingLevel n)) := by + intro n k hnk + simp only [ordinary_shrinkingLevel] + exact pow_lt_pow_right_of_lt_one₀ (sub_pos.mpr Real.one_lt_goldenRatio) + (by linarith [Real.goldenRatio_lt_two]) (by omega) + +noncomputable def shrinkingPolygon (a n : ℕ) : polygonAlgebra a := + ⟨halfPlane a 0 (shrinkingLevel n), BooleanSubalgebra.subset_closure ⟨0,shrinkingLevel n,rfl⟩⟩ + +theorem shrinkingPolygon_injective (a : ℕ) : Function.Injective (shrinkingPolygon a) := by + suffices h : ∀ n k : ℕ, n < k → shrinkingPolygon a n ≠ shrinkingPolygon a k by + intro n k he + rcases lt_trichotomy n k with hlt | heq | hgt + · exact False.elim (h n k hlt he) + · exact heq + · exact False.elim (h k n hgt he.symm) + intro n k hnk he + obtain ⟨p,hx,_⟩ := generic_rectangle a (ordinary (shrinkingLevel k)) + (ordinary (shrinkingLevel n)) 0 1 (shrinkingLevel_bounds k).1.le + (shrinkingLevel_bounds n).2.le (shrinkingLevel_strictAnti hnk) + le_rfl le_rfl zero_lt_one + have hn : p ∈ (shrinkingPolygon a n).val := by + exact hx.2 + have hk : p ∉ (shrinkingPolygon a k).val := by + change ¬ p.val.1 < ordinary (shrinkingLevel k) + linarith [hx.1] + exact hk (he ▸ hn) + +theorem polygonAlternatingGroup_infinite (a m : ℕ) (hm : 3 ≤ m) : + Infinite (polygonAlternatingGroup a m) := by + let ι := Fin.castLEEmb hm + let f : ℕ → polygonAlternatingGroup a m := fun n => + ⟨conditionalHom (shrinkingPolygon a n) (trackCycle ι), + conditional_cycle_mem (shrinkingPolygon a n) ι⟩ + apply Infinite.of_injective f + intro n k h + apply shrinkingPolygon_injective a + apply conditional_cycle_injective ι + exact congrArg Subtype.val h + +theorem conjugate_threeSlot_mem {a m : ℕ} (g h : polygonFullGroup a m) + (hh : IsThreeSlotCycle h) : g * h * g⁻¹ ∈ polygonAlternatingGroup a m := by + classical + obtain ⟨U,slots,hne,hinj,hcycle,hfix⟩ := hh + let σ := trackCycle (Function.Embedding.refl (Fin 3)) + have heq : h = slotHom U slots hinj σ := by + apply Subtype.ext + apply Equiv.ext + intro p + by_cases hp : p ∈ Set.range (SlotMap a m U slots) + · obtain ⟨⟨i,x⟩,rfl⟩ := hp + change h.val (SlotMap a m U slots (i,x)) = slotPerm U slots hinj σ _ + rw [hcycle, slotPerm_apply] + exact (congrArg (fun j => SlotMap a m U slots (j,x)) + (trackCycle_apply (Function.Embedding.refl (Fin 3)) i)).symm + · exact (hfix p hp).trans (slotPerm_apply_of_notMem U slots hinj σ hp).symm + rw [heq] + let N := (polygonAlternatingGroup a m).comap (MulAut.conj g).toMonoidHom + change slotHom U slots hinj σ ∈ N + obtain ⟨s,hs,hcover⟩ := g.property + let β := Fin 3 → {c // c ∈ s} + let cover : β → polygonAlgebra a := fun cs => tupleChartDomain slots (fun i => (cs i).val) + apply slotHom_of_finite_cover (Finset.univ : Finset β) cover U slots hinj σ N + · intro x hx + have hc (i : Fin 3) : ∃ c : {c // c ∈ s}, c.val.Contains ((slots i).1,translate a (slots i).2 x) := by + obtain ⟨c,hc,hcp⟩ := hcover ((slots i).1,translate a (slots i).2 x) + exact ⟨⟨c,hc⟩,hcp⟩ + choose cs hcs using hc + exact ⟨cs,Finset.mem_univ _,(mem_tupleChartDomain slots _ x).mpr hcs⟩ + · intro cs _ V hVU hVC + let targets : Fin 3 → Fin m × (CutRing × CutRing) := + fun i => ((cs i).val.target, (cs i).val.shift + (slots i).2) + have htrans (i : Fin 3) (x : V.val) : + g.val (SlotMap a m V slots (i,x)) = SlotMap a m V targets (i,x) := by + have hx := (mem_tupleChartDomain slots _ x.val).mp (hVC x.property) i + change g.val ((slots i).1,translate a (slots i).2 x.val) = + ((cs i).val.target,translate a ((cs i).val.shift + (slots i).2) x.val) + rw [hx.1, hs (cs i).val (cs i).property _ hx.2, translate_add] + have hinjV := SlotMap_injective_mono slots hVU hinj + have hinjT : Function.Injective (SlotMap a m V targets) := by + rintro ⟨i,x⟩ ⟨j,y⟩ he + rw [← htrans, ← htrans] at he + exact hinjV (g.val.injective he) + change g * slotHom V slots hinjV σ * g⁻¹ ∈ polygonAlternatingGroup a m + rw [slotHom_conjugate V slots targets hinjV hinjT g htrans σ] + by_cases hV : V.val.Nonempty + · apply Subgroup.subset_closure + exact slotHom_cycle_isThreeSlotCycle V hV targets hinjT (Function.Embedding.refl (Fin 3)) + · rw [slotHom_empty V targets hinjT σ (Set.not_nonempty_iff_eq_empty.mp hV)] + exact Subgroup.one_mem _ + +theorem polygonAlternatingGroup_normal (a m : ℕ) : (polygonAlternatingGroup a m).Normal := by + constructor + intro h hh g + change h ∈ Subgroup.closure {h | IsThreeSlotCycle h} at hh + have hc : Subgroup.closure {h : polygonFullGroup a m | IsThreeSlotCycle h} ≤ + (polygonAlternatingGroup a m).comap (MulAut.conj g).toMonoidHom := by + apply (Subgroup.closure_le _).mpr + intro h hh + exact conjugate_threeSlot_mem g h hh + exact hc hh + +theorem isThreeCycle_eq_trackCycle {m : ℕ} {σ : Equiv.Perm (Fin m)} + (hσ : σ.IsThreeCycle) : ∃ ι : Fin 3 ↪ Fin m, σ = trackCycle ι := by + classical + obtain ⟨i,hi⟩ := Finset.card_pos.mp (show 0 < σ.support.card by rw [hσ.card_support]; decide) + have hn := hσ.nodup_iff_mem_support.mpr hi + simp only [List.nodup_cons, List.mem_cons, List.not_mem_nil, not_or, + List.nodup_nil, not_false_eq_true, and_true] at hn + have h01 : i ≠ σ i := hn.1.1 + have h02 : i ≠ σ (σ i) := hn.1.2 + have h12 : σ i ≠ σ (σ i) := hn.2 + let ι : Fin 3 ↪ Fin m := ⟨![i,σ i,σ (σ i)], by + intro j k h + fin_cases j <;> fin_cases k <;> simp_all⟩ + exact ⟨ι,hσ.eq_swap_mul_swap_iff_mem_support.mpr hi⟩ + +theorem slotHom_alternating_mem {a m n : ℕ} (U : polygonAlgebra a) + (slots : Fin n → Fin m × (CutRing × CutRing)) + (hinj : Function.Injective (SlotMap a m U slots)) + {σ : Equiv.Perm (Fin n)} (hσ : σ ∈ alternatingGroup (Fin n)) : + slotHom U slots hinj σ ∈ polygonAlternatingGroup a m := by + have hle : alternatingGroup (Fin n) ≤ + (polygonAlternatingGroup a m).comap (slotHom U slots hinj) := by + rw [← Equiv.Perm.closure_three_cycles_eq_alternating] + apply (Subgroup.closure_le _).mpr + intro ρ hρ + obtain ⟨ι,rfl⟩ := isThreeCycle_eq_trackCycle hρ + change slotHom U slots hinj (trackCycle ι) ∈ polygonAlternatingGroup a m + by_cases hU : U.val.Nonempty + · exact Subgroup.subset_closure (slotHom_cycle_isThreeSlotCycle U hU slots hinj ι) + · rw [slotHom_empty U slots hinj _ (Set.not_nonempty_iff_eq_empty.mp hU)] + exact Subgroup.one_mem _ + exact hle hσ + +theorem conditionalHom_alternating_mem {a m : ℕ} (U : polygonAlgebra a) + {σ : Equiv.Perm (Fin m)} (hσ : σ ∈ alternatingGroup (Fin m)) : + conditionalHom U σ ∈ polygonAlternatingGroup a m := by + have hle : alternatingGroup (Fin m) ≤ + (polygonAlternatingGroup a m).comap (conditionalHom U) := by + rw [← Equiv.Perm.closure_three_cycles_eq_alternating] + apply (Subgroup.closure_le _).mpr + intro ρ hρ + obtain ⟨ι,rfl⟩ := isThreeCycle_eq_trackCycle hρ + exact conditional_cycle_mem U ι + exact hle hσ + +noncomputable def trackTranslationPerm {a m : ℕ} + (d : Fin m → CutRing × CutRing) : Equiv.Perm (TrackPoint a m) where + toFun p := (p.1, translate a (d p.1) p.2) + invFun p := (p.1, translate a (-d p.1) p.2) + left_inv p := by simp only [← translate_add, neg_add_cancel, translate_zero] + right_inv p := by simp only [← translate_add, add_neg_cancel, translate_zero] + +end PolygonFullGroup +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/UniformPropagationBounds.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/UniformPropagationBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..560093c8b1e94428b88db69918cba131e99461f2 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/UniformPropagationBounds.lean @@ -0,0 +1,220 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.ArithmeticTangentBasis +import OAI.GroupTheory.SimpleAmenable.Homology.WindowEnclosureChains + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section UniformPropagationBounds + +theorem conjugate_eq_label (z : CutRing) : + conjugate z = ordinary z - (endpointLabel z : ℝ) * Real.sqrt 5 := by + have h := (eq_div_iff (by positivity : Real.sqrt 5 ≠ 0)).mp (endpointLabel_embedding z) + linarith + +theorem contracted_transverse_label (l : CutRing) (hl : |conjugate l| < 1/1000) + {C : ℝ} (_hC : 0 ≤ C) : + ∃ N : ℕ, 1 ≤ N ∧ ∀ n : ℕ, N ≤ n → ∀ d : CutRing, + |(endpointLabel d : ℝ)| ≤ 6*(n:ℝ)/5 → + |ordinary d| ≤ 2*C/(n:ℝ) → |(endpointLabel (l*d) : ℝ)| < (n:ℝ)/10 := by + obtain ⟨N,hN⟩ := exists_nat_gt (max 100 (2*C*|(endpointLabel l : ℝ)|)) + have hNpos : 1 ≤ N := by + have : (100:ℝ) < N := lt_of_le_of_lt (le_max_left _ _) hN + exact_mod_cast (by linarith : (1:ℝ) ≤ N) + refine ⟨N,hNpos,fun n hn d hd hd' => ?_⟩ + have hnr : (N:ℝ) ≤ n := by exact_mod_cast hn + have hn100 : (100:ℝ) < n := lt_of_lt_of_le (lt_of_le_of_lt (le_max_left _ _) hN) hnr + have hn0 : (0:ℝ) < n := by linarith + have hsmall : |(endpointLabel l : ℝ)| * (2*C/(n:ℝ)) < 1 := by + rw [← mul_div_assoc,div_lt_one hn0] + nlinarith [lt_of_lt_of_le (lt_of_le_of_lt (le_max_right _ _) hN) hnr] + have hb := endpointLabel_mul_bound l d hd hd' + have hc : |conjugate l| *(6*(n:ℝ)/5) < (1/1000)*(6*(n:ℝ)/5) := + mul_lt_mul_of_pos_right hl (by positivity) + linarith + +theorem tangent_displacement_embeddings (d : CutRing) {A B : ℝ} + (hA : 0 ≤ A) (_hB : 0 ≤ B) (n : ℕ) (hn : 1 ≤ n) + (hd : |ordinary d| ≤ A/(n:ℝ)) + (hq : |(endpointLabel d : ℝ)| ≤ B*(n:ℝ)) : + |ordinary d| + |conjugate d| ≤ (2*A+3*B)*(n:ℝ) := by + have hn1 : (1:ℝ) ≤ n := by exact_mod_cast hn + have hdn : |ordinary d| ≤ A*(n:ℝ) := by + calc + _ ≤ A/(n:ℝ) := hd + _ ≤ A := div_le_self hA hn1 + _ ≤ A*(n:ℝ) := le_mul_of_one_le_right hA hn1 + have hs : Real.sqrt 5 ≤ 3 := by + nlinarith [Real.sq_sqrt (by norm_num : (0:ℝ) ≤ 5), Real.sqrt_nonneg 5] + have hc : |conjugate d| ≤ A*(n:ℝ)+3*B*(n:ℝ) := by + rw [conjugate_eq_label] + calc + _ ≤ |ordinary d| + |(endpointLabel d : ℝ) * Real.sqrt 5| := abs_sub _ _ + _ = |ordinary d| + |(endpointLabel d : ℝ)| * Real.sqrt 5 := by + rw [abs_mul,abs_of_nonneg (Real.sqrt_nonneg 5)] + _ ≤ A*(n:ℝ) + (B*(n:ℝ))*3 := by gcongr + _ = _ := by ring + linarith + +theorem tangent_chain_uniform (l u v : CutRing) (huv : u*v = 1) + {A B : ℝ} (hA : 0 ≤ A) (hB : 0 ≤ B) : + ∃ K : ℝ, 0 < K ∧ ∀ n : ℕ, 1 ≤ n → ∀ d : CutRing, + |ordinary d| ≤ A/(n:ℝ) → |(endpointLabel d : ℝ)| ≤ B*(n:ℝ) → + ∃ w : List CutRing, + w.sum = d ∧ + (∀ e ∈ w, e = u ∨ e = -u ∨ e = cutTau*u ∨ e = -(cutTau*u)) ∧ + (w.length : ℝ) ≤ K*(n:ℝ) ∧ + (∀ k : ℕ, |ordinary (w.take k).sum| ≤ + A/(n:ℝ)+(|ordinary u|+|ordinary (cutTau*u)|)) ∧ + ∀ k : ℕ, |(endpointLabel (w.take k).sum : ℝ)| + + |(endpointLabel (l*(w.take k).sum) : ℝ)| ≤ K*(n:ℝ) := by + let M := 4*(|ordinary v|+|conjugate v|+1) + let L := M*(2*A+3*B) + let H := |(endpointLabel u : ℝ)|+|(endpointLabel (cutTau*u) : ℝ)| + let σ := |ordinary u|+|ordinary (cutTau*u)| + let J := L*H + |conjugate l| *(L*H) + |(endpointLabel l : ℝ)| *(A+σ) + let K := L+J+1 + have hM : 0 ≤ M := by dsimp [M]; positivity + have hL : 0 ≤ L := mul_nonneg hM (by positivity) + have hH : 0 ≤ H := by dsimp [H]; positivity + have hσ : 0 ≤ σ := by dsimp [σ]; positivity + have hJ : 0 ≤ J := by dsimp [J]; positivity + refine ⟨K,by dsimp [K]; positivity,fun n hn d hd hq => ?_⟩ + have hn1 : (1:ℝ) ≤ n := by exact_mod_cast hn + have hn0 : (0:ℝ) ≤ n := by positivity + have he := tangent_displacement_embeddings d hA hB n hn hd hq + obtain ⟨w,hw,hm,hlen,hwalk,hlab⟩ := tangent_chain u v huv d + have hsize : M*(|ordinary d|+|conjugate d|) ≤ L*(n:ℝ) := by + calc + _ ≤ M*((2*A+3*B)*(n:ℝ)) := mul_le_mul_of_nonneg_left he hM + _ = _ := by dsimp [L]; ring + have hkL : L ≤ K := by dsimp [K]; linarith + have hkJ : J ≤ K := by dsimp [K]; linarith + have ho : ∀ k : ℕ, |ordinary (w.take k).sum| ≤ A/(n:ℝ)+σ := by + intro k + have hb := hwalk k + have hleft : -|ordinary d| ≤ min 0 (ordinary d) := + le_min (by linarith [abs_nonneg (ordinary d)]) (neg_abs_le _) + have hright : max 0 (ordinary d) ≤ |ordinary d| := + max_le (abs_nonneg _) (le_abs_self _) + apply abs_le.mpr + constructor <;> linarith [hd] + refine ⟨w,hw,hm,(hlen.trans hsize).trans (mul_le_mul_of_nonneg_right hkL hn0),ho,?_⟩ + intro k + have hx : |(endpointLabel (w.take k).sum : ℝ)| ≤ (L*H)*(n:ℝ) := by + calc + _ ≤ (M*(|ordinary d|+|conjugate d|))*H := hlab k + _ ≤ (L*(n:ℝ))*H := mul_le_mul_of_nonneg_right hsize hH + _ = _ := by ring + have ho' : |ordinary (w.take k).sum| ≤ (A+σ)*(n:ℝ) := by + calc + _ ≤ A/(n:ℝ)+σ := ho k + _ ≤ A+σ := add_le_add (div_le_self hA hn1) le_rfl + _ ≤ (A+σ)*(n:ℝ) := le_mul_of_one_le_right (add_nonneg hA hσ) hn1 + have hy := endpointLabel_mul_bound l (w.take k).sum hx ho' + calc + _ ≤ (L*H)*(n:ℝ) + + (|conjugate l| *((L*H)*(n:ℝ)) + |(endpointLabel l : ℝ)| *((A+σ)*(n:ℝ))) := + add_le_add hx hy + _ = J*(n:ℝ) := by dsimp [J]; ring + _ ≤ K*(n:ℝ) := mul_le_mul_of_nonneg_right hkJ hn0 + +end UniformPropagationBounds + +section OldWindowBridgeGeometry + +theorem short_window_scale (n : ℕ) (hn : 160 ≤ n) : + 1 ≤ n/8 ∧ 1 ≤ (n/8)/2 ∧ (n:ℝ)/9 ≤ (n/8:ℕ) ∧ + (n:ℝ)/20 ≤ ((n/8)/2:ℕ) ∧ + (n/8:ℕ) + ((n/8)/2:ℕ) ≤ n/4 := by + have h₁ := Nat.mod_add_div n 8 + have h₂ := Nat.mod_lt n (by norm_num : 0 < 8) + have h₃ := Nat.mod_add_div (n/8) 2 + have h₄ := Nat.mod_lt (n/8) (by norm_num : 0 < 2) + have h₅ := Nat.mod_add_div n 4 + have h₆ := Nat.mod_lt n (by norm_num : 0 < 4) + have ha : n ≤ 9*(n/8) := by omega + have hb : n ≤ 20*((n/8)/2) := by omega + refine ⟨by omega,by omega,?_,?_,by omega⟩ + · have : (n:ℝ) ≤ 9*(n/8:ℕ) := by exact_mod_cast ha + linarith + · have : (n:ℝ) ≤ 20*((n/8)/2:ℕ) := by exact_mod_cast hb + linarith + +theorem short_window_path {K : ℝ} (_hK : 0 ≤ K) (n : ℕ) (hn : 160 ≤ n) + (p q : ℤ) (hpq : ((q-p).natAbs:ℝ) ≤ (K+1)*(n:ℝ)) : + ∃ T : ℕ, ∃ w : ℕ → ℤ, + w 0 = p ∧ w T = q ∧ (T:ℝ) ≤ 20*(K+2) ∧ + (∀ i, |w (i+1)-w i| ≤ (((n/8)/2:ℕ):ℤ)) ∧ + ∀ i, min p q ≤ w i ∧ w i ≤ max p q := by + obtain ⟨_,hS,_,hSn,_⟩ := short_window_scale n hn + obtain ⟨T,w,h₀,hT,hbound,hstep,hrange⟩ := integer_window_path p q ((n/8)/2) hS + refine ⟨T,w,h₀,hT,?_,hstep,hrange⟩ + have hn0 : (0:ℝ) < n := by exact_mod_cast (show 0 < n by omega) + have hS0 : (0:ℝ) < ((n/8)/2:ℕ) := by exact_mod_cast hS + have hdiv : (((q-p).natAbs / ((n/8)/2):ℕ):ℝ) ≤ 20*(K+1) := by + have hmul : (((q-p).natAbs / ((n/8)/2):ℕ):ℝ) * ((n/8)/2:ℕ) ≤ + ((q-p).natAbs:ℝ) := by exact_mod_cast Nat.div_mul_le_self (q-p).natAbs ((n/8)/2) + have hfloor : (0:ℝ) ≤ (((q-p).natAbs / ((n/8)/2):ℕ):ℝ) := by positivity + nlinarith + have hb : (T:ℝ) ≤ (((q-p).natAbs / ((n/8)/2):ℕ):ℝ)+1 := by exact_mod_cast hbound + linarith + +theorem old_window_bridge_geometry {K δ : ℝ} (hK : 0 ≤ K) (hδ : 0 < δ) + (B : ℕ) : + ∃ N : ℕ, 160 ≤ N ∧ ∀ n : ℕ, N ≤ n → ∀ p q : ℤ, + ((q-p).natAbs:ℝ) ≤ (K+1)*(n:ℝ) → ∀ a b : ℝ, a ≤ b → + ∃ T : ℕ, ∃ w : ℕ → ℤ, ∃ u v : ℕ → CutRing, + w 0 = p ∧ w T = q ∧ (T:ℝ) ≤ 20*(K+2) ∧ + (∀ i, (w i ≤ endpointLabel (u i) ∧ endpointLabel (u i) < w i+(n/8:ℕ)) ∧ + (w i ≤ endpointLabel (v i) ∧ endpointLabel (v i) < w i+(n/8:ℕ))) ∧ + (∀ i, |w (i+1)-w i| + (n/8:ℕ) + (2*B:ℕ) < (n:ℤ)) ∧ + (∀ i, Set.Icc a b ⊆ Set.Ioo (ordinary (u i)) (ordinary (v i))) ∧ + (∀ i, Set.Icc (ordinary (u i)) (ordinary (v i)) ⊆ + Set.Ioo (ordinary (u (i+1))) (ordinary (v (i+1)))) ∧ + ∀ i, i ≤ T → Set.Icc (ordinary (u i)) (ordinary (v i)) ⊆ + Set.Ioo (a-δ) (b+δ) := by + obtain ⟨N,hN⟩ := exists_nat_gt (max 160 (max (40*(B:ℝ)) + ((20*(K+2)+1)*201*9/δ))) + have hN160 : 160 ≤ N := by + have : (160:ℝ) < N := lt_of_le_of_lt (le_max_left _ _) hN + exact_mod_cast (le_of_lt this) + refine ⟨N,hN160,fun n hn p q hpq a b hab => ?_⟩ + have hn160 : 160 ≤ n := hN160.trans hn + have hnr : (N:ℝ) ≤ n := by exact_mod_cast hn + have hn0 : (0:ℝ) < n := by exact_mod_cast (show 0 < n by omega) + have hnB : 40*(B:ℝ) < n := lt_of_lt_of_le + (lt_of_le_of_lt ((le_max_left _ _).trans (le_max_right _ _)) hN) hnr + have hnδ : (20*(K+2)+1)*201*9/δ < (n:ℝ) := lt_of_lt_of_le + (lt_of_le_of_lt ((le_max_right _ _).trans (le_max_right _ _)) hN) hnr + obtain ⟨hL,_,hLn,_,hLS⟩ := short_window_scale n hn160 + obtain ⟨T,w,h₀,hT,hbound,hstep,hrange⟩ := short_window_path hK n hn160 p q hpq + obtain ⟨u,v,hlabel,hinc,hnest,herror⟩ := window_enclosure_chain (n/8) hL w a b hab + refine ⟨T,w,u,v,h₀,hT,hbound,hlabel,?_,hinc,hnest,?_⟩ + · intro i + have hBn : 40*B < n := by exact_mod_cast hnB + have hspan : (n/8)+((n/8)/2)+2*B < n := by omega + have hspan' : ((n/8:ℕ):ℤ)+(((n/8)/2:ℕ):ℤ)+(2*B:ℕ) < (n:ℤ) := by exact_mod_cast hspan + linarith [hstep i] + · intro i hi x hx + have hiT : (i:ℝ) ≤ T := by exact_mod_cast hi + have hL0 : (0:ℝ) < (n/8:ℕ) := by exact_mod_cast hL + have hb₀ : 0 ≤ 20*(K+2)+1 := by linarith + have he : ((i:ℝ)+1)*201/(n/8:ℕ) < δ := by + apply (div_lt_iff₀ hL0).mpr + have hd : (20*(K+2)+1)*201*9 < (n:ℝ)*δ := (div_lt_iff₀ hδ).mp hnδ + nlinarith + exact ⟨by linarith [(herror i).1,hx.1],by linarith [(herror i).2,hx.2]⟩ + +end OldWindowBridgeGeometry + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/VaryingCellClassification.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/VaryingCellClassification.lean new file mode 100644 index 0000000000000000000000000000000000000000..9ed5b1145f8b48ca308c5d9ad4e0a829ec7a80db --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/VaryingCellClassification.lean @@ -0,0 +1,113 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.LocalCoordinateClassifier +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.WindowClipping +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.ConcurrentGeometry + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section VaryingCellClassification + +def axisDirection (j : Fin 2) : Fin 4 := Fin.castLE (by omega) j + +@[simp] theorem integralCutForm_axis (a : ℕ) (j : Fin 2) (u : CutRing × CutRing) : + integralCutForm a (axisDirection j) u=pointCoordinate u j := by + fin_cases j <;> rfl + +@[simp] theorem cutForm_axis (a : ℕ) (j : Fin 2) (z : ℝ × ℝ) : + cutForm a (axisDirection j) z=realCoordinate z j := by + fin_cases j <;> rfl + +theorem slopeDirection_ne_axisDirection (d j : Fin 2) : slopeDirection d≠axisDirection j := by + intro h + have hh := congrArg Fin.val h + simp only [slopeDirection,axisDirection,Fin.val_castLE] at hh + omega + +theorem varying_cell_classification {a : ℕ} (r : CutRing) + (hr : 0 simp only [Bool.false_eq_true,↓reduceIte] at hh ⊢ + · change (p ∈ E.val ∧ p ∈ W.val) ↔ False + exact ⟨fun hp => (hh p hp.2).mp hp.1,False.elim⟩ + · change (p ∈ E.val ∧ p ∈ W.val) ↔ p ∈ W.val + exact ⟨And.right,fun hp => ⟨(hh p hp).mpr trivial,hp⟩⟩ + by_cases hp : ∀ p ∈ W.val, p ∈ U.val + · exact Or.inl ⟨true,hconst U true (fun p h => iff_of_true (hp p h) rfl)⟩ + by_cases hp' : ∀ p ∈ W.val, p ∉ U.val + · exact Or.inl ⟨false,hconst U false (fun p h => iff_of_false (hp' p h) Bool.noConfusion)⟩ + by_cases hv : ∀ p ∈ W.val, p ∈ V.val + · exact Or.inr (Or.inl ⟨true,hconst V true (fun p h => iff_of_true (hv p h) rfl)⟩) + by_cases hv' : ∀ p ∈ W.val, p ∉ V.val + · exact Or.inr (Or.inl ⟨false,hconst V false (fun p h => iff_of_false (hv' p h) Bool.noConfusion)⟩) + push Not at hp hp' hv hv' + obtain ⟨x,hx,hxn⟩ := hp + obtain ⟨y,hy,hyp⟩ := hp' + obtain ⟨v',hvv,hvn⟩ := hv + obtain ⟨w,hw,hwp⟩ := hv' + obtain hs | ⟨k,hk,hks⟩ := windowRectangle_slope_classifier r (slopeDirection d) hr C.mesh C.mesh_large q cell hb he + · exact (hs y hy hyp).elim + have hcx := le_of_lt (lt_of_not_ge (fun heq => hxn ((hks x hx).mpr heq))) + have hcy := (hks y hy).mp hyp + have hgap₁ : 200/(C.mesh:ℝ) hvn ((hc v' hvv).mpr hh))) + · refine Or.inr (Or.inr ⟨k,c,true,hk,by simpa only [↓reduceIte] using hc, + x,y,v',w,hx,hy,hvv,hw,hcx,hcy,?_,?_⟩) + · simpa only [cutForm_axis] using (le_of_lt (lt_of_not_ge (fun hh => hvn ((hc v' hvv).mpr hh)))) + · simpa only [cutForm_axis] using (hc w hw).mp hwp + +end VaryingCellClassification + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/VertexMargins.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/VertexMargins.lean new file mode 100644 index 0000000000000000000000000000000000000000..d9ea367cd518bfc0ccdb8cd1c105236219ea02d6 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/VertexMargins.lean @@ -0,0 +1,97 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.ConcurrentAnchors +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.LocalChartDecisions + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section VertexMargins + +structure VertexMargin (z : ℝ × ℝ) (ε : ℝ) where + lower : Fin 2 → CutRing + upper : Fin 2 → CutRing + lower_outer : ∀ j, realCoordinate z j-2*ε < ordinary (lower j) + lower_inner : ∀ j, ordinary (lower j) < realCoordinate z j-ε + upper_inner : ∀ j, realCoordinate z j+ε < ordinary (upper j) + upper_outer : ∀ j, ordinary (upper j) < realCoordinate z j+2*ε + +theorem vertexMargin_exists (z : ℝ × ℝ) {ε : ℝ} (hε : 0<ε) : + Nonempty (VertexMargin z ε) := by + choose L hL hL' using fun j : Fin 2 => + exists_cut_between (x := realCoordinate z j-2*ε) (y := realCoordinate z j-ε) (by linarith) + choose V hV hV' using fun j : Fin 2 => + exists_cut_between (x := realCoordinate z j+ε) (y := realCoordinate z j+2*ε) (by linarith) + exact ⟨⟨L,V,hL,hL',hV,hV'⟩⟩ + +theorem realCoordinate_dist_le (x y : ℝ × ℝ) (j : Fin 2) : + |realCoordinate x j-realCoordinate y j| ≤ dist x y := by + rw [Prod.dist_eq,Real.dist_eq,Real.dist_eq] + fin_cases j + · exact le_max_left _ _ + · exact le_max_right _ _ + +theorem realCoordinate_add (x y : ℝ × ℝ) (j : Fin 2) : + realCoordinate (x+y) j=realCoordinate x j+realCoordinate y j := by + fin_cases j <;> rfl + +theorem realCoordinate_ordinary (u : CutRing × CutRing) (j : Fin 2) : + realCoordinate (ordinary u.1,ordinary u.2) j=ordinary (pointCoordinate u j) := by + fin_cases j <;> rfl + +namespace VertexMargin +variable {z : ℝ × ℝ} {ε : ℝ} (V : VertexMargin z ε) + +theorem width (_hε : 0<ε) (j : Fin 2) : + ordinary (V.lower j) linarith + +theorem translated_inner (u : CutRing × CutRing) (x : ℝ × ℝ) + (hx : dist x (z+(ordinary u.1,ordinary u.2))≤ε) (j : Fin 2) : + ordinary (V.lower j+pointCoordinate u j) linarith + +theorem translated_outer (u b : CutRing × CutRing) (x : ℝ × ℝ) + (hb : dist (ordinary b.1,ordinary b.2) (z+(ordinary u.1,ordinary u.2))<ε) + (hx : ∀ j, ordinary (V.lower j+pointCoordinate u j)≤realCoordinate x j ∧ + realCoordinate x j≤ordinary (V.upper j+pointCoordinate u j)) (j : Fin 2) : + |realCoordinate x j-ordinary (pointCoordinate b j)|<3*ε := by + have hh := (abs_lt.mp ((realCoordinate_dist_le (ordinary b.1,ordinary b.2) + (z+(ordinary u.1,ordinary u.2)) j).trans_lt hb)) + rw [realCoordinate_add,realCoordinate_ordinary,realCoordinate_ordinary] at hh + have hk := hx j + rw [map_add,map_add] at hk + have h₁ := V.lower_outer j + have h₂ := V.upper_outer j + apply abs_lt.mpr + constructor <;> linarith + +end VertexMargin + +theorem finite_vertex_margins (D : ℕ) {ε : ℝ} (hε : 0<ε) : + Nonempty (∀ t : VertexType D, VertexMargin (vertexRepresentative D t) ε) := by + classical + exact ⟨fun t => Classical.choice (vertexMargin_exists (vertexRepresentative D t) hε)⟩ + +end VertexMargins + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/WindowCellPartition.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/WindowCellPartition.lean new file mode 100644 index 0000000000000000000000000000000000000000..a1a00780abd5ec103ca5ae57bb4f9deba973675b --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/WindowCellPartition.lean @@ -0,0 +1,343 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.TangentRectangleCommutation +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.WindowCells + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section WindowCellPartition + +theorem finite_interval_cell {n : ℕ} {x : Fin (n+1) → ℝ} + (_hn : 1 ≤ n) (t : ℝ) (hl : x 0 ≤ t) (hu : t < x (Fin.last n)) : + ∃ i : Fin n, x i.castSucc ≤ t ∧ t < x i.succ := by + classical + let S : Finset (Fin (n+1)) := Finset.univ.filter fun i => x i ≤ t + have hS : S.Nonempty := ⟨0,by simpa only [S,Finset.mem_filter,Finset.mem_univ,true_and] using hl⟩ + let i := S.max' hS + have hi : x i ≤ t := (Finset.mem_filter.mp (Finset.max'_mem S hS)).2 + have hin : i.val < n := by + have hil : i.val ≤ n := Nat.le_of_lt_succ i.isLt + by_contra hh + have he : i = Fin.last n := Fin.ext (by change i.val = n; omega) + rw [he] at hi + linarith + refine ⟨⟨i.val,hin⟩,hi,?_⟩ + by_contra hh + have hj : (⟨i.val+1,by omega⟩ : Fin (n+1)) ∈ S := by + simp only [S,Finset.mem_filter,Finset.mem_univ,true_and] + exact le_of_not_gt hh + have he := Finset.le_max' S _ hj + change i.val+1 ≤ i.val at he + omega + +noncomputable def windowCell (a : ℕ) (j : Fin 2) (n : ℕ) (q : ℤ) (i : Fin n) : + polygonAlgebra a := coordinateInterval a j (windowCut n q i.castSucc) (windowCut n q i.succ) + +noncomputable def liftedCoordinate {a : ℕ} (j : Fin 2) (z : CutRing) (p : GenericSquare a) : ℝ := + coordinate j p - (⌊coordinate j p-ordinary z⌋:ℤ) + +theorem liftedCoordinate_bounds {a : ℕ} (j : Fin 2) (z : CutRing) (p : GenericSquare a) : + ordinary z ≤ liftedCoordinate j z p ∧ liftedCoordinate j z p < ordinary z+1 := by + have hh := Int.fract_nonneg (coordinate j p-ordinary z) + have hh' := Int.fract_lt_one (coordinate j p-ordinary z) + simp only [Int.fract,liftedCoordinate] at * + constructor <;> linarith + +theorem windowCell_mem {a : ℕ} (j : Fin 2) (n : ℕ) (hn : 201 ≤ n) (q : ℤ) + (i : Fin n) (p : GenericSquare a) : + p ∈ (windowCell a j n q i).val ↔ + ordinary (windowCut n q i.castSucc) ≤ liftedCoordinate j ((q:CutRing)*cutTau) p ∧ + liftedCoordinate j ((q:CutRing)*cutTau) p < ordinary (windowCut n q i.succ) := by + have hn' : (200:ℝ) < n := by exact_mod_cast (by omega : 200 < n) + have hlen : ordinary (windowCut n q i.succ)-ordinary (windowCut n q i.castSucc) < 1 := + (windowCut_mesh n q i).trans_lt ((div_lt_one (by linarith)).mpr hn') + have hord := (windowCut_strictMono n q (Fin.castSucc_lt_succ (i := i))).le + change p ∈ coordinateBetween _ _ _ _ ↔ _ + rw [mem_coordinateBetween_iff j _ _ hord hlen p] + constructor + · rintro ⟨k,hk,hk'⟩ + have hb := windowCut_bounds n q i.castSucc + have hb' := windowCut_bounds n q i.succ + have hfloor : (⌊coordinate j p-ordinary ((q:CutRing)*cutTau)⌋:ℤ) = -k := by + apply Int.floor_eq_iff.mpr + simp only [Int.cast_neg] + constructor <;> linarith + simp only [liftedCoordinate,hfloor,Int.cast_neg,sub_neg_eq_add] + exact ⟨hk,hk'⟩ + · rintro ⟨hl,hu⟩ + refine ⟨-⌊coordinate j p-ordinary ((q:CutRing)*cutTau)⌋,?_,?_⟩ + · simpa only [Int.cast_neg,sub_eq_add_neg,liftedCoordinate] using hl + · simpa only [Int.cast_neg,sub_eq_add_neg,liftedCoordinate] using hu + +theorem windowCell_cover {a : ℕ} (j : Fin 2) (n : ℕ) (hn : 201 ≤ n) (q : ℤ) + (p : GenericSquare a) : ∃ i : Fin n, p ∈ (windowCell a j n q i).val := by + have hb := liftedCoordinate_bounds j ((q:CutRing)*cutTau) p + have hz := windowCut_zero n q (by omega) + have hh := windowCut_last n q + obtain ⟨i,hi⟩ := finite_interval_cell (x := fun i => ordinary (windowCut n q i)) + (by omega) (liftedCoordinate j ((q:CutRing)*cutTau) p) + (by simpa only [hz] using hb.1) (by simpa only [hh,map_add,map_one] using hb.2) + exact ⟨i,(windowCell_mem j n hn q i p).mpr hi⟩ + +theorem windowCell_pairwise_disjoint {a : ℕ} (j : Fin 2) (n : ℕ) (hn : 201 ≤ n) (q : ℤ) : + Pairwise fun i k : Fin n => Disjoint (windowCell a j n q i).val (windowCell a j n q k).val := by + intro i k hik + apply Set.disjoint_left.mpr + intro p hp hp' + have hi := (windowCell_mem j n hn q i p).mp hp + have hk := (windowCell_mem j n hn q k p).mp hp' + rcases lt_or_gt_of_ne hik with hh | hh + · have he := (windowCut_strictMono n q).monotone + (show i.succ ≤ k.castSucc from by change i.val+1 ≤ k.val; change i.val < k.val at hh; omega) + linarith + · have he := (windowCut_strictMono n q).monotone + (show k.succ ≤ i.castSucc from by change k.val+1 ≤ i.val; change k.val < i.val at hh; omega) + linarith + +end WindowCellPartition + +section SeparatedOldRectangles + +noncomputable def orientedPoint (d : Fin 2) (x y : CutRing) : CutRing × CutRing := + if d=0 then (x,y) else (y,x) + +@[simp] theorem orientedPoint_coordinate (d j : Fin 2) (x y : CutRing) : + pointCoordinate (orientedPoint d x y) j = if j=d then x else y := by + fin_cases d <;> fin_cases j <;> simp [orientedPoint,pointCoordinate] + +@[simp] theorem orientedPoint_label (d j : Fin 2) (x y : CutRing) : + pointLabel (orientedPoint d x y) j = if j=d then endpointLabel x else endpointLabel y := by + simp only [pointLabel,orientedPoint_coordinate] + split <;> rfl + +@[simp] theorem orientedPoint_tangent (a : ℕ) (d : Fin 2) (x y b : CutRing) : + orientedPoint d x y+tangentOffset a d (b-x) = orientedPoint d b (y+cutTau^a*(b-x)) := by + fin_cases d <;> simp [orientedPoint,tangentOffset] + +structure OldStripPair (n : ℕ) (d : Fin 2) where + left : LabelledRectangle n + right : LabelledRectangle n + lo : CutRing + cutLeft : CutRing + cutRight : CutRing + hi : CutRing + bottom : CutRing + top : CutRing + left_lower : ∀ j, left.lower j = if j=d then lo else bottom + left_upper : ∀ j, left.upper j = if j=d then cutLeft else top + right_lower : ∀ j, right.lower j = if j=d then cutRight else bottom + right_upper : ∀ j, right.upper j = if j=d then hi else top + ordered_left : ordinary lo ≤ ordinary cutLeft + ordered_gap : ordinary cutLeft < ordinary cutRight + ordered_right : ordinary cutRight ≤ ordinary hi + ordered_cross : ordinary bottom ≤ ordinary top + left_length : ∀ j, left.length j ≤ if j=d then n*9/10 else n/4 + right_length : ∀ j, right.length j ≤ if j=d then n*9/10 else n/4 + +namespace OldStripPair +variable {n : ℕ} {d : Fin 2} (P : OldStripPair n d) + +noncomputable def displacement : CutRing := P.cutRight-P.cutLeft + +noncomputable def firstCenter : CutRing × CutRing := orientedPoint d P.cutLeft P.bottom + +@[simp] theorem displacement_ordinary : ordinary P.displacement = ordinary P.cutRight-ordinary P.cutLeft := by + simp [displacement] + +theorem left_center_label (j : Fin 2) : + P.left.start j ≤ pointLabel P.firstCenter j ∧ + pointLabel P.firstCenter j < P.left.start j+P.left.length j := by + simp only [firstCenter,orientedPoint_label] + by_cases hj : j=d + · simpa only [P.left_upper j,ite_eq_left hj] using P.left.upper_label j + · simpa only [P.left_lower j,ite_eq_right hj] using P.left.lower_label j + +theorem right_base_label (j : Fin 2) : + P.right.start j ≤ pointLabel (orientedPoint d P.cutRight P.bottom) j ∧ + pointLabel (orientedPoint d P.cutRight P.bottom) j < P.right.start j+P.right.length j := by + simpa only [orientedPoint_label,P.right_lower j,apply_ite] using P.right.lower_label j + +end OldStripPair + +theorem int_natAbs_le_div_succ (z : ℤ) (n : ℕ) (hz : |(z:ℝ)| < (n:ℝ)/10) : + z.natAbs ≤ n/10+1 := by + have hh : n < (n/10+1)*10 := by omega + have hh' : (n:ℝ) < ((n/10+1:ℕ):ℝ)*10 := by exact_mod_cast hh + have ha : (z.natAbs:ℝ) = |(z:ℝ)| := by simp + have hb : (z.natAbs:ℝ) < ((n/10+1:ℕ):ℝ) := by rw [ha]; linarith + exact_mod_cast hb.le + +namespace InitialCoverSystem +variable {a m : ℕ} {r : CutRing} {hm : 2 ≤ m} + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + +theorem separated_old_rectangles_commute (hlarge : 20 ≤ m+1) + (hr : 0 < ordinary r ∧ ordinary r < 1/2) + (s u v : CutRing) (hs : 0 < ordinary s) (hsr : ordinary s < ordinary r/2) + (huv : u*v=1) + (hshort : (1+|ordinary (cutTau^a)|)*(|ordinary u|+|ordinary (cutTau*u)|) < ordinary s/4) + {C : ℝ} (hC : 0 ≤ C) (hSlope : 8*C < ordinary (cutTau^a)) + (hconj : |conjugate (cutTau^a)| < 1/1000) : + ∃ N : ℕ, 201 ≤ N ∧ ∀ (M : ℕ) (B : InitialCoverSystem a r m hm M) + (_h : B.TangentChartLaws (symmetricWindowLength s) (symmetricWindowStart s) u), + ∀ n : ℕ, N ≤ n → ∀ g : B.CoordinateWindowLaw n, + ∀ (d : Fin 2) (P : OldStripPair n d), + ordinary P.hi-ordinary P.lo ≤ C/(n:ℝ) → + ordinary P.top-ordinary P.bottom ≤ C/(n:ℝ) → + |(endpointLabel P.displacement:ℝ)| ≤ 6*(n:ℝ)/5 → + ∀ x y, Commute (B.rectangleCopy (by omega) g P.left x) + (B.rectangleCopy (by omega) g P.right y) := by + obtain ⟨N₀,hN₀,hcomm⟩ := tangent_rectangle_commutation_uniform + (a := a) (hm := hm) hlarge hr s u v hs hsr huv hshort hC + (show (0:ℝ) ≤ 6/5 by norm_num) hC (show (0:ℝ) ≤ 2 by norm_num) + obtain ⟨N₁,hN₁,hlabel⟩ := contracted_transverse_label (cutTau^a) hconj hC + obtain ⟨N₂,hN₂⟩ := fixed_chart_margin_eventually (endpointLabel s).natAbs + obtain ⟨N₃,hN₃⟩ := transverse_chart_margin_eventually (endpointLabel s).natAbs + obtain ⟨N₄,hN₄⟩ := exists_nat_gt (max C ((1+ordinary (cutTau^a))*C/ordinary s)) + refine ⟨max 201 (max N₀ (max N₁ (max N₂ (max N₃ (max N₄ (endpointLabel s).natAbs))))),by omega,?_⟩ + intro M B h n hn g d P hwid hheight hdisp + have hn₀ : N₀ ≤ n := by omega + have hn₁ : N₁ ≤ n := by omega + have hn₂ : N₂ ≤ n := by omega + have hn₃ : N₃ ≤ n := by omega + have hn₄ : N₄ ≤ n := by omega + have hnb : (endpointLabel s).natAbs ≤ n := by omega + have hnpos : (0:ℝ) < n := by exact_mod_cast (by omega : 0 < n) + have hlam : 0 < ordinary (cutTau^a) := by linarith + have hnC : C < (n:ℝ) := (lt_of_le_of_lt (le_max_left _ _) hN₄).trans_le (by exact_mod_cast hn₄) + have hnmargin : (1+ordinary (cutTau^a))*C/ordinary s < (n:ℝ) := + (lt_of_le_of_lt (le_max_right _ _) hN₄).trans_le (by exact_mod_cast hn₄) + have hsmall : (1+ordinary (cutTau^a))*C/(n:ℝ) < ordinary s := by + apply (div_lt_iff₀ hnpos).mpr + have hh := (div_lt_iff₀ hs).mp hnmargin + nlinarith + have hCn : C/(n:ℝ) < ordinary s := by + have hh : 0 ≤ ordinary (cutTau^a)*C/(n:ℝ) := by positivity + rw [add_mul,one_mul,add_div] at hsmall + linarith + have hlamCn : ordinary (cutTau^a)*(C/(n:ℝ)) < ordinary s := by + have hh : 0 ≤ C/(n:ℝ) := by positivity + rw [add_mul,one_mul,add_div] at hsmall + rw [← mul_div_assoc] + linarith + have hdpos : 0 < ordinary P.displacement := by rw [P.displacement_ordinary]; linarith [P.ordered_gap] + have hd : |ordinary P.displacement| ≤ C/(n:ℝ) := by + rw [abs_of_pos hdpos,P.displacement_ordinary] + linarith [P.ordered_left,P.ordered_right] + have hdlabel := hlabel n hn₁ P.displacement hdisp (hd.trans (by gcongr; linarith)) + have hdnat := int_natAbs_le_div_succ _ n hdlabel + have hgap : 1/(8*(n:ℝ)) ≤ ordinary P.displacement := by + have hh := endpoint_separation (z := P.displacement) (by intro he; rw [he,map_zero] at hdpos; linarith) + (n := 2*n) (by omega) (hd.trans ((div_le_one hnpos).mpr hnC.le)) + (show |(endpointLabel P.displacement:ℝ)| ≤ (2*n:ℕ) by push_cast; linarith) + norm_num only [Nat.cast_mul,Nat.cast_ofNat,abs_of_pos hdpos,← mul_assoc] at hh + exact hh + have hseparate : ordinary P.top-ordinary P.bottom < ordinary (cutTau^a*P.displacement) := by + rw [map_mul] + calc + _ ≤ C/(n:ℝ) := hheight + _ = (8*C)/(8*(n:ℝ)) := by ring + _ < ordinary (cutTau^a)/(8*(n:ℝ)) := div_lt_div_of_pos_right hSlope (by positivity) + _ = ordinary (cutTau^a)*(1/(8*(n:ℝ))) := by ring + _ ≤ _ := mul_le_mul_of_nonneg_left hgap hlam.le + have hshift : ordinary (cutTau^a*P.displacement) < ordinary s := by + rw [map_mul] + exact (mul_le_mul_of_nonneg_left (by simpa only [abs_of_pos hdpos] using hd) hlam.le).trans_lt hlamCn + have hfit : Nonempty (P.left.ChartFit s P.firstCenter) := by + apply P.left.chartFit_of_near_labels s P.firstCenter (fun j => pointLabel P.firstCenter j) 0 + P.left_center_label + · intro j; simp + · intro j + have hp := P.left_length j + have hh : n/4 ≤ n*9/10 := by omega + have hh' := hN₂ n hn₂ + split_ifs at hp <;> simp only [Pi.zero_apply,mul_zero,add_zero] <;> omega + have hfit' : Nonempty (P.right.ChartFit s (P.firstCenter+tangentOffset a d P.displacement)) := by + have he : P.firstCenter+tangentOffset a d P.displacement = + orientedPoint d P.cutRight (P.bottom+cutTau^a*P.displacement) := by + exact orientedPoint_tangent a d P.cutLeft P.bottom P.cutRight + rw [he] + apply P.right.chartFit_of_near_labels s _ (fun j => pointLabel (orientedPoint d P.cutRight P.bottom) j) + (fun j => if j=d then 0 else n/10+1) P.right_base_label + · intro j + simp only [orientedPoint_label] + by_cases hj : j=d + · simp [hj] + · simpa only [ite_eq_right hj,endpointLabel_add,add_sub_cancel_left] using hdnat + · intro j + have hp := P.right_length j + by_cases hj : j=d + · simp only [ite_eq_left hj] at hp ⊢ + have hh := hN₂ n hn₂ + omega + · simp only [ite_eq_right hj] at hp ⊢ + have hh := hN₃ n hn₃ + omega + apply hcomm M B h n hn₀ g P.left P.right P.displacement hd (by nlinarith [hdisp]) d P.firstCenter + · intro j + have hh := P.left_center_label j + have hl := P.left.length_le j + have hh' : |pointLabel P.firstCenter j+symmetricWindowStart s j-P.left.start j| ≤ (2*n:ℕ) := by + simp only [symmetricWindowStart] + apply abs_le.mpr + constructor <;> omega + exact_mod_cast hh' + · intro j + simp only [P.left_lower j,OldStripPair.firstCenter,orientedPoint_coordinate] + by_cases hj : j=d + · simp only [ite_eq_left hj] + rw [abs_of_nonpos (by linarith [P.ordered_left])] + linarith [P.ordered_gap,P.ordered_right] + · simp only [ite_eq_right hj,sub_self,abs_zero]; positivity + · intro j + simp only [P.left_upper j,OldStripPair.firstCenter,orientedPoint_coordinate] + by_cases hj : j=d + · simp only [ite_eq_left hj,sub_self,abs_zero]; positivity + · simp only [ite_eq_right hj] + rw [abs_of_nonneg (by linarith [P.ordered_cross])] + exact hheight + · exact hfit + · exact hfit' + · intro j + simp only [signQuadrantLower,P.left_lower j,OldStripPair.firstCenter,orientedPoint_coordinate,ite_true] + by_cases hj : j=d + · simp only [ite_eq_left hj,map_neg] + linarith [P.ordered_gap,P.ordered_right] + · simp [hj] + · intro j + simp only [signQuadrantUpper,P.left_upper j,OldStripPair.firstCenter,orientedPoint_coordinate,ite_true] + by_cases hj : j=d + · simp [hj] + · simp only [ite_eq_right hj]; linarith + · intro j + have he : P.firstCenter+tangentOffset a d P.displacement = + orientedPoint d P.cutRight (P.bottom+cutTau^a*P.displacement) := + orientedPoint_tangent a d P.cutLeft P.bottom P.cutRight + rw [he] + simp only [signQuadrantLower,P.right_lower j,orientedPoint_coordinate,Bool.false_eq_true,ite_false] + by_cases hj : j=d + · simp [hj] + · simp only [ite_eq_right hj,map_neg,map_add]; linarith + · intro j + have he : P.firstCenter+tangentOffset a d P.displacement = + orientedPoint d P.cutRight (P.bottom+cutTau^a*P.displacement) := + orientedPoint_tangent a d P.cutLeft P.bottom P.cutRight + rw [he] + simp only [signQuadrantUpper,P.right_upper j,orientedPoint_coordinate,Bool.false_eq_true,ite_false] + by_cases hj : j=d + · simp only [ite_eq_left hj]; linarith [P.ordered_left,P.ordered_gap] + · simp only [ite_eq_right hj,map_zero,zero_add,map_add]; linarith + +end InitialCoverSystem +end SeparatedOldRectangles + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/WindowCells.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/WindowCells.lean new file mode 100644 index 0000000000000000000000000000000000000000..d5ddd93226c89774a0800ed0a6382f56c14fc715 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/WindowCells.lean @@ -0,0 +1,221 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Arithmetic.LatticeCounting +import OAI.GroupTheory.SimpleAmenable.Arithmetic.PropagationArithmetic + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section WindowCells + +noncomputable def cutFraction (z : CutRing) : CutRing := z-(⌊ordinary z⌋:ℤ) + +@[simp] theorem ordinary_cutFraction (z : CutRing) : + ordinary (cutFraction z) = Int.fract (ordinary z) := by + simp only [cutFraction,map_sub,map_intCast,Int.fract] + +@[simp] theorem endpointLabel_cutFraction (z : CutRing) : + endpointLabel (cutFraction z) = endpointLabel z := by + simp [cutFraction,endpointLabel_sub] + +@[simp] theorem endpointLabel_labelTau (q : ℤ) : + endpointLabel ((q:CutRing)*cutTau) = q := by + simp [endpointLabel,cutTau,QuadraticAlgebra.im_mul] + +@[simp] theorem cutFraction_zero : cutFraction 0 = 0 := by + simp [cutFraction] + +noncomputable def windowEndpointSet (n : ℕ) : Finset CutRing := by + classical + exact Finset.univ.image fun i : Fin n => cutFraction ((i.val:CutRing)*cutTau) + +theorem windowEndpointSet_card (n : ℕ) : (windowEndpointSet n).card = n := by + classical + rw [windowEndpointSet,Finset.card_image_of_injective] + · simp + · intro i j hij + have hh := congrArg endpointLabel hij + simp only [endpointLabel_cutFraction] at hh + have he (k : ℕ) : endpointLabel ((k:CutRing)*cutTau) = (k:ℤ) := by + exact_mod_cast endpointLabel_labelTau (k:ℤ) + simp only [he] at hh + exact Fin.ext (by omega) + +@[instance_reducible] noncomputable def cutOrdinaryOrder : LinearOrder CutRing := + LinearOrder.lift' ordinary ordinary_injective + +attribute [local instance] cutOrdinaryOrder + +noncomputable def windowInterior (n : ℕ) : Fin n ↪o CutRing := + (windowEndpointSet n).orderEmbOfFin (windowEndpointSet_card n) + +theorem windowInterior_mem (n : ℕ) (i : Fin n) : + windowInterior n i ∈ windowEndpointSet n := Finset.orderEmbOfFin_mem _ _ _ + +theorem windowInterior_bounds (n : ℕ) (i : Fin n) : + 0 ≤ ordinary (windowInterior n i) ∧ ordinary (windowInterior n i) < 1 := by + have hh := windowInterior_mem n i + simp only [windowEndpointSet,Finset.mem_image,Finset.mem_univ,true_and] at hh + obtain ⟨j,hj⟩ := hh + rw [← hj,ordinary_cutFraction] + exact ⟨Int.fract_nonneg _,Int.fract_lt_one _⟩ + +theorem windowInterior_label (n : ℕ) (i : Fin n) : + 0 ≤ endpointLabel (windowInterior n i) ∧ endpointLabel (windowInterior n i) < n := by + have hh := windowInterior_mem n i + simp only [windowEndpointSet,Finset.mem_image,Finset.mem_univ,true_and] at hh + obtain ⟨j,hj⟩ := hh + rw [← hj,endpointLabel_cutFraction] + have he : endpointLabel ((j.val:CutRing)*cutTau) = (j.val:ℤ) := by + exact_mod_cast endpointLabel_labelTau (j.val:ℤ) + rw [he] + exact ⟨by omega,by omega⟩ + +theorem windowInterior_zero (n : ℕ) (hn : 0 < n) : + windowInterior n ⟨0,hn⟩ = 0 := by + have hmem : (0:CutRing) ∈ windowEndpointSet n := by + apply Finset.mem_image.mpr + exact ⟨⟨0,hn⟩,Finset.mem_univ _,by simp⟩ + have hrange := Finset.range_orderEmbOfFin (windowEndpointSet n) (windowEndpointSet_card n) + have hx : (0:CutRing) ∈ Set.range (windowInterior n) := by + change (0:CutRing) ∈ Set.range ((windowEndpointSet n).orderEmbOfFin (windowEndpointSet_card n)) + rw [hrange]; exact hmem + obtain ⟨i,hi⟩ := hx + apply ordinary_injective + have hle := (windowInterior n).monotone (show (⟨0,hn⟩:Fin n) ≤ i by exact Nat.zero_le _) + change ordinary (windowInterior n ⟨0,hn⟩) ≤ ordinary (windowInterior n i) at hle + rw [hi,map_zero] at hle + rw [map_zero] + exact le_antisymm hle (windowInterior_bounds n ⟨0,hn⟩).1 + +noncomputable def windowCut (n : ℕ) (q : ℤ) (i : Fin (n+1)) : CutRing := + (q:CutRing)*cutTau+if hi : i.val < n then windowInterior n ⟨i.val,hi⟩ else 1 + +theorem windowCut_zero (n : ℕ) (q : ℤ) (hn : 0 < n) : + windowCut n q 0 = (q:CutRing)*cutTau := by + simp only [windowCut,Fin.val_zero,dite_eq_left hn,windowInterior_zero n hn,add_zero] + +theorem windowCut_last (n : ℕ) (q : ℤ) : + windowCut n q (Fin.last n) = (q:CutRing)*cutTau+1 := by + simp [windowCut] + +theorem windowCut_label (n : ℕ) (q : ℤ) (hn : 0 < n) (i : Fin (n+1)) : + q ≤ endpointLabel (windowCut n q i) ∧ endpointLabel (windowCut n q i) < q+n := by + unfold windowCut + split_ifs with hi + · rw [endpointLabel_add,endpointLabel_labelTau] + have hh := windowInterior_label n ⟨i.val,hi⟩ + omega + · simp only [endpointLabel_add,endpointLabel_labelTau] + change q ≤ q+0 ∧ q+0 < q+n + omega + +theorem windowCut_strictMono (n : ℕ) (q : ℤ) : + StrictMono fun i => ordinary (windowCut n q i) := by + intro i j hij + have hi : i.val < n := by have hh := j.isLt; change i.val < j.val at hij; omega + simp only [windowCut,dite_eq_left hi,map_add] + split_ifs with hj + · apply add_lt_add_right + exact (windowInterior n).strictMono (show (⟨i.val,hi⟩:Fin n) < ⟨j.val,hj⟩ from hij) + · simpa only [map_one] using add_lt_add_right (windowInterior_bounds n ⟨i.val,hi⟩).2 + (ordinary ((q:CutRing)*cutTau)) + +@[simp] theorem cutFraction_eq_self (z : CutRing) + (hz : 0 ≤ ordinary z ∧ ordinary z < 1) : cutFraction z = z := by + apply ordinary_injective + rw [ordinary_cutFraction,Int.fract_eq_self.mpr hz] + +theorem cutFraction_label (z : CutRing) : + cutFraction z = cutFraction ((endpointLabel z:CutRing)*cutTau) := by + have he : z = ((endpointLabel z:CutRing)*cutTau)+(z.re:CutRing) := by + apply QuadraticAlgebra.ext <;> simp [endpointLabel,cutTau] + apply ordinary_injective + simp only [ordinary_cutFraction] + conv_lhs => rw [he,map_add,map_intCast,Int.fract_add_intCast] + +theorem windowEndpointSet_of_bounds (n : ℕ) (z : CutRing) + (hl : 0 ≤ endpointLabel z ∧ endpointLabel z < n) + (ho : 0 ≤ ordinary z ∧ ordinary z < 1) : z ∈ windowEndpointSet n := by + classical + have hi : (endpointLabel z).toNat < n := by omega + have he : ((endpointLabel z).toNat:ℤ) = endpointLabel z := Int.toNat_of_nonneg hl.1 + apply Finset.mem_image.mpr + refine ⟨⟨(endpointLabel z).toNat,hi⟩,Finset.mem_univ _,?_⟩ + change cutFraction (((endpointLabel z).toNat:CutRing)*cutTau) = z + have hc : ((endpointLabel z).toNat:CutRing) = (endpointLabel z:CutRing) := by + exact_mod_cast he + rw [hc,← cutFraction_label,cutFraction_eq_self z ho] + +theorem windowCut_bounds (n : ℕ) (q : ℤ) (i : Fin (n+1)) : + ordinary ((q:CutRing)*cutTau) ≤ ordinary (windowCut n q i) ∧ + ordinary (windowCut n q i) ≤ ordinary ((q:CutRing)*cutTau)+1 := by + unfold windowCut + split_ifs with hi + · simp only [map_add] + have hh := windowInterior_bounds n ⟨i.val,hi⟩ + constructor <;> linarith + · simp only [map_add,map_one] + constructor <;> linarith + +theorem windowCut_no_between (n : ℕ) (q : ℤ) (i : Fin n) (z : CutRing) + (hz : q ≤ endpointLabel z ∧ endpointLabel z < q+n) : + ¬(ordinary (windowCut n q i.castSucc) < ordinary z ∧ + ordinary z < ordinary (windowCut n q i.succ)) := by + rintro ⟨hlo,hup⟩ + let z' : CutRing := z-(q:CutRing)*cutTau + have hzl : 0 ≤ endpointLabel z' ∧ endpointLabel z' < n := by + simp only [z',endpointLabel_sub,endpointLabel_labelTau] + omega + have hzo : 0 ≤ ordinary z' ∧ ordinary z' < 1 := by + simp only [z',map_sub] + have hh := (windowCut_bounds n q i.castSucc).1 + have hh' := (windowCut_bounds n q i.succ).2 + constructor <;> linarith + have hmem := windowEndpointSet_of_bounds n z' hzl hzo + have hx : z' ∈ Set.range (windowInterior n) := by + change z' ∈ Set.range ((windowEndpointSet n).orderEmbOfFin (windowEndpointSet_card n)) + rw [Finset.range_orderEmbOfFin]; exact hmem + obtain ⟨j,hj⟩ := hx + have hlow : ordinary (windowInterior n i) < ordinary (windowInterior n j) := by + simp only [windowCut,Fin.val_castSucc,dite_eq_left i.isLt,map_add] at hlo + rw [hj] + dsimp only [z'] + rw [map_sub] + linarith + have hij : i < j := (windowInterior n).lt_iff_lt.mp hlow + have hin : i.val+1 < n := by have h := j.isLt; change i.val < j.val at hij; omega + have hupper : ordinary (windowInterior n j) < ordinary (windowInterior n ⟨i.val+1,hin⟩) := by + simp only [windowCut,Fin.val_succ,dite_eq_left hin,map_add] at hup + rw [hj] + dsimp only [z'] + rw [map_sub] + linarith + have hji : j < (⟨i.val+1,hin⟩:Fin n) := (windowInterior n).lt_iff_lt.mp hupper + change j.val < i.val+1 at hji + change i.val < j.val at hij + omega + +theorem windowCut_mesh (n : ℕ) (q : ℤ) (i : Fin n) : + ordinary (windowCut n q i.succ)-ordinary (windowCut n q i.castSucc) ≤ 200/(n:ℝ) := by + by_contra hbad + have hn : 1 ≤ n := by have hh := i.isLt; omega + have hg : 200/(n:ℝ) < ordinary (windowCut n q i.succ)-ordinary (windowCut n q i.castSucc) := lt_of_not_ge hbad + obtain ⟨z,hzl,hzu,hz⟩ := coordinate_window_net n hn q + ((ordinary (windowCut n q i.castSucc)+ordinary (windowCut n q i.succ))/2) + have hab := abs_le.mp hz + have hden : 200/(n:ℝ)=2*(100/(n:ℝ)) := by ring + rw [hden] at hg + exact windowCut_no_between n q i z ⟨hzl,hzu⟩ ⟨by linarith,by linarith⟩ + +end WindowCells + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/WindowClipping.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/WindowClipping.lean new file mode 100644 index 0000000000000000000000000000000000000000..8500456691896a02cf14ffee736c7dc93218d200 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/WindowClipping.lean @@ -0,0 +1,167 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.WindowRectangles + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section WindowClipping + +theorem window_cell_enclosure (n : ℕ) (q : ℤ) (i : Fin n) (b e : CutRing) + (hb : q≤endpointLabel b ∧ endpointLabel b -r) (fun _ => r) := by + intro p hp + obtain ⟨k,hk,_⟩ := Set.mem_iUnion.mp hp + have hb := (mem_circularBoxPiece r k p).mp hk + change (p ∈ coordinateBetween a 0 (-r) r ∧ p ∈ coordinateBetween a 1 (-r) r) + constructor + · apply (mem_coordinateBetween_iff 0 (-r) r (by rw [map_neg]; linarith) + (by rw [map_neg]; linarith) p).mpr + refine ⟨-(k.1.val:ℤ),?_⟩ + simpa only [coordinate,Matrix.cons_val_zero,Matrix.cons_val_one,map_neg,Int.cast_neg,Int.cast_natCast,← sub_eq_add_neg] using hb.1 + · apply (mem_coordinateBetween_iff 1 (-r) r (by rw [map_neg]; linarith) + (by rw [map_neg]; linarith) p).mpr + refine ⟨-(k.2.val:ℤ),?_⟩ + simpa only [coordinate,Matrix.cons_val_zero,Matrix.cons_val_one,map_neg,Int.cast_neg,Int.cast_natCast,← sub_eq_add_neg] using hb.2 + +theorem windowRectangle_clipping_chart {a : ℕ} (r : CutRing) + (hr : 0 -r) (fun _ => r)).val) : + ∃ k : Fin 2 → ℤ, ∀ j, + -ordinary r≤ordinary (windowCut n (q j) (cell j).castSucc)+(k j:ℝ) ∧ + ordinary (windowCut n (q j) (cell j).succ)+(k j:ℝ)≤ordinary r := by + have hc (j : Fin 2) : p ∈ coordinateBetween a j (-r) r := by + fin_cases j + · exact hclip.1 + · exact hclip.2 + have hi (j : Fin 2) := (mem_coordinateBetween_iff j (-r) r + (by rw [map_neg]; linarith) (by rw [map_neg]; linarith) p).mp (hc j) + choose k hk using hi + refine ⟨fun j => k j+⌊coordinate j p-ordinary ((q j:CutRing)*cutTau)⌋,?_⟩ + intro j + have hh := window_cell_enclosure n (q j) (cell j) (-r) r (hb j) (he j) + (realCoordinate (windowPlanarLift q p) j) + (k j+⌊coordinate j p-ordinary ((q j:CutRing)*cutTau)⌋) + ((windowRectangle_mem n hn q cell p).mp hp j) ?_ + · simpa only [map_neg] using hh + · simp only [windowPlanarLift_coordinate,liftedCoordinate,Int.cast_add] + constructor <;> linarith [(hk j).1,(hk j).2] + +theorem windowRectangle_clipped_sign {a : ℕ} (r : CutRing) (j : Fin 4) + (hr : 0 rfl + have hne := planar_lift_avoidsCuts p z hz (Fin.castLE (by omega) d) (-r) + have hf : cutForm a (Fin.castLE (by omega) d) z=realCoordinate z d := by + fin_cases d <;> rfl + rw [hf,map_neg] at hne + rw [he] at hne ⊢ + constructor + · exact lt_of_le_of_ne (by linarith) (Ne.symm hne) + · linarith + apply mem_clippedSlope_lift r j hr p z ⟨hbounds 0,hbounds 1⟩ hz + +end WindowClipping + +section ActualSlopeClassifier + +theorem windowRectangle_slope_classifier {a : ℕ} (r : CutRing) (j : Fin 4) + (hr : 0 h ⟨p,hp,hpp⟩) + +theorem windowRectangle_crossing_line_point {a : ℕ} + (n : ℕ) (hn : 201≤n) (q : Fin 2 → ℤ) (cell : Fin 2 → Fin n) + (j : Fin 4) (c : CutRing) (x y : GenericSquare a) + (hx : x ∈ (windowRectangle a n q cell).val) + (hy : y ∈ (windowRectangle a n q cell).val) + (hcx : cutForm a j (windowPlanarLift q x)≤ordinary c) + (hcy : ordinary c≤cutForm a j (windowPlanarLift q y)) : + ∃ z : ℝ × ℝ, cutForm a j z=ordinary c ∧ ∀ d, + ordinary (windowCut n (q d) (cell d).castSucc)≤realCoordinate z d ∧ + realCoordinate z d≤ordinary (windowCut n (q d) (cell d).succ) := by + rw [cutForm_normal] at hcx hcy + obtain ⟨z,hz,hb⟩ := line_point_in_box (ordinary (lineNormal a j).1) + (ordinary (lineNormal a j).2) (ordinary c) + (fun d => ordinary (windowCut n (q d) (cell d).castSucc)) + (fun d => ordinary (windowCut n (q d) (cell d).succ)) + (windowPlanarLift q x) (windowPlanarLift q y) + (fun d => ⟨((windowRectangle_mem n hn q cell x).mp hx d).1, + ((windowRectangle_mem n hn q cell x).mp hx d).2.le⟩) + (fun d => ⟨((windowRectangle_mem n hn q cell y).mp hy d).1, + ((windowRectangle_mem n hn q cell y).mp hy d).2.le⟩) hcx hcy + exact ⟨z,by rwa [cutForm_normal],hb⟩ + +end ActualSlopeClassifier + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/WindowEnclosureGeometry.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/WindowEnclosureGeometry.lean new file mode 100644 index 0000000000000000000000000000000000000000..02ebb9e933fbe03092c745ff817a35d63d5040c2 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/WindowEnclosureGeometry.lean @@ -0,0 +1,116 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Arithmetic.LatticeCounting + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section WindowEnclosureGeometry + +theorem coordinate_window_brackets (n : ℕ) (hn : 1 ≤ n) (q : ℤ) (t : ℝ) : + ∃ u v : CutRing, + (q ≤ endpointLabel u ∧ endpointLabel u < q+n) ∧ + (q ≤ endpointLabel v ∧ endpointLabel v < q+n) ∧ + t-201/(n:ℝ) ≤ ordinary u ∧ ordinary u < t ∧ + t < ordinary v ∧ ordinary v ≤ t+201/(n:ℝ) := by + have hn' : (0:ℝ) < n := by exact_mod_cast hn + obtain ⟨u,hu₁,hu₂,hu⟩ := coordinate_window_net n hn q (t-101/(n:ℝ)) + obtain ⟨v,hv₁,hv₂,hv⟩ := coordinate_window_net n hn q (t+101/(n:ℝ)) + have hpos : 0 < 1/(n:ℝ) := div_pos zero_lt_one hn' + rcases abs_le.mp hu with ⟨huL,huR⟩ + rcases abs_le.mp hv with ⟨hvL,hvR⟩ + refine ⟨u,v,⟨hu₁,hu₂⟩,⟨hv₁,hv₂⟩,?_,?_,?_,?_⟩ <;> + simp only [div_eq_mul_inv,one_mul] at * <;> linarith + +theorem coordinate_window_enclosure (n : ℕ) (hn : 1 ≤ n) (q : ℤ) (a b : ℝ) + (hab : a ≤ b) : + ∃ u v : CutRing, + (q ≤ endpointLabel u ∧ endpointLabel u < q+n) ∧ + (q ≤ endpointLabel v ∧ endpointLabel v < q+n) ∧ + Set.Icc a b ⊆ Set.Ioo (ordinary u) (ordinary v) ∧ + a-201/(n:ℝ) ≤ ordinary u ∧ ordinary u < ordinary v ∧ + ordinary v ≤ b+201/(n:ℝ) := by + obtain ⟨u,_,hu,_,huL,huR,_,_⟩ := coordinate_window_brackets n hn q a + obtain ⟨_,v,_,hv,_,_,hvL,hvR⟩ := coordinate_window_brackets n hn q b + refine ⟨u,v,hu,hv,?_,huL,lt_trans huR (lt_of_le_of_lt hab hvL),hvR⟩ + intro x hx + exact ⟨lt_of_lt_of_le huR hx.1,lt_of_le_of_lt hx.2 hvL⟩ + +theorem integer_window_path (p q : ℤ) (S : ℕ) (hS : 1 ≤ S) : + ∃ T : ℕ, ∃ w : ℕ → ℤ, + w 0 = p ∧ w T = q ∧ + T ≤ (q-p).natAbs / S + 1 ∧ + (∀ i, |w (i+1)-w i| ≤ (S:ℤ)) ∧ + ∀ i, min p q ≤ w i ∧ w i ≤ max p q := by + suffices h : ∀ p q : ℤ, p ≤ q → + ∃ T : ℕ, ∃ w : ℕ → ℤ, + w 0 = p ∧ w T = q ∧ T ≤ (q-p).natAbs / S + 1 ∧ + (∀ i, |w (i+1)-w i| ≤ (S:ℤ)) ∧ + ∀ i, p ≤ w i ∧ w i ≤ q by + by_cases hpq : p ≤ q + · obtain ⟨T,w,h₀,hT,hb,hs,hw⟩ := h p q hpq + exact ⟨T,w,h₀,hT,hb,hs,fun i => by simpa [hpq] using hw i⟩ + · have hqp : q ≤ p := le_of_not_ge hpq + obtain ⟨T,w,h₀,hT,hb,hs,hw⟩ := h (-p) (-q) (by omega) + refine ⟨T,fun i => -w i,by simp [h₀],by simp [hT],?_,?_,?_⟩ + · have he : -q - -p = -(q-p) := by ring + rw [he,Int.natAbs_neg] at hb + exact hb + · intro i + simpa only [neg_sub_neg,abs_sub_comm] using hs i + · intro i + simp only [min_eq_right hqp,max_eq_left hqp] + constructor <;> linarith [(hw i).1,(hw i).2] + intro p q hpq + let D := (q-p).toNat + have hD : (D:ℤ) = q-p := Int.toNat_of_nonneg (by omega) + let T := D/S+1 + let w : ℕ → ℤ := fun i => p + (min (i*S) D : ℕ) + have hTS : D ≤ T*S := by + have hd : D/S*S ≤ D := Nat.div_mul_le_self D S + have hr : D%S < S := Nat.mod_lt D (by omega) + have he := Nat.mod_add_div D S + rw [Nat.mul_comm S (D/S)] at he + dsimp [T] + rw [Nat.add_mul,Nat.one_mul] + omega + refine ⟨T,w,by simp [w],?_,?_,?_,?_⟩ + · simp only [w,Nat.min_eq_right hTS] + omega + · dsimp [T,D] + have he : (q-p).toNat = (q-p).natAbs := by + have ha := Int.natAbs_of_nonneg (show 0 ≤ q-p by omega) + omega + rw [he] + · intro i + have ha : min (i*S) D ≤ min ((i+1)*S) D := + min_le_min_right D (Nat.mul_le_mul_right S (by omega)) + have hb : min ((i+1)*S) D ≤ min (i*S) D + S := by + by_cases hi : i*S ≤ D + · rw [Nat.min_eq_left hi,Nat.add_mul,Nat.one_mul] + exact min_le_left _ _ + · rw [Nat.min_eq_right (le_of_not_ge hi)] + omega + change |(p+(min ((i+1)*S) D : ℕ):ℤ) - (p+(min (i*S) D : ℕ))| ≤ S + rw [add_sub_add_left_eq_sub,abs_of_nonneg (by exact sub_nonneg.mpr (by exact_mod_cast ha) : + (0:ℤ) ≤ (min ((i+1)*S) D : ℕ) - (min (i*S) D : ℕ))] + apply sub_le_iff_le_add.mpr + have hb' : ((min ((i+1)*S) D : ℕ):ℤ) ≤ ((min (i*S) D : ℕ):ℤ) + (S:ℤ) := by + exact_mod_cast hb + simpa only [add_comm] using hb' + · intro i + dsimp [w] + have hi := min_le_right (i*S) D + constructor <;> omega + +end WindowEnclosureGeometry + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/WindowIntervals.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/WindowIntervals.lean new file mode 100644 index 0000000000000000000000000000000000000000..5d41d5000c152a374d3473ced1e024b2af9ee41a --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/WindowIntervals.lean @@ -0,0 +1,165 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.SectorControl + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section WindowIntervals + +@[simp] theorem coordinateShift_sub (j : Fin 2) (u v : CutRing) : + coordinateShift j (u-v) = coordinateShift j u-coordinateShift j v := by + rw [sub_eq_add_neg,coordinateShift_add,coordinateShift_neg,sub_eq_add_neg] + +theorem coordinateBetween_reverse {a : ℕ} (j : Fin 2) (u v : CutRing) + (h : Int.fract (ordinary (v-u)) ≠ 0) : + coordinateBetween a j v u = (coordinateBetween a j u v)ᶜ := by + unfold coordinateBetween + rw [show u-v = -(v-u) by ring,coordinateArc_neg j (v-u) h,Set.preimage_compl] + congr 1 + ext p + simp only [Set.mem_preimage] + rw [← translate_add] + rw [coordinateShift_sub] + abel_nf + +theorem coordinateBetween_empty {a : ℕ} (j : Fin 2) (u v : CutRing) + (h : Int.fract (ordinary (v-u)) = 0) : coordinateBetween a j u v = ∅ := by + rw [coordinateBetween,coordinateArc_zero_of_fract j _ h,Set.preimage_empty] + +theorem coordinate_window_between_resolved_all {a : ℕ} {r : CutRing} + (n : ℕ) (q : Fin 2 → ℤ) (j : Fin 2) (i k : ℕ) (hi : i < n) (hk : k < n) : + coordinateBetween a j (((q j+(i:ℤ)):CutRing)*cutTau) + (((q j+(k:ℤ)):CutRing)*cutTau) ∈ resolvedAlgebra + (fun z => (InitialCoverSystem.primitiveTests (a := a) (r := r) + (coordinateWindowPrimitives n q) z).val) := by + by_cases hik : i ≤ k + · exact coordinate_window_between_resolved n q j i k hik hk + · let u : CutRing := ((q j+(i:ℤ)):CutRing)*cutTau + let v : CutRing := ((q j+(k:ℤ)):CutRing)*cutTau + by_cases h : Int.fract (ordinary (v-u)) = 0 + · rw [coordinateBetween_empty j u v h] + exact BooleanSubalgebra.bot_mem + · have hr := coordinateBetween_reverse (a := a) j u v h + have hh := coordinate_window_between_resolved (a := a) (r := r) n q j k i (by omega) hi + rw [hr] at hh + simpa only [compl_compl] using BooleanSubalgebra.compl_mem hh + +theorem coordinateBetween_period {a : ℕ} (j : Fin 2) (u v : CutRing) (p q : ℤ) : + coordinateBetween a j (u+p) (v+q) = coordinateBetween a j u v := by + unfold coordinateBetween + have he : coordinateArc a j (v+q-(u+p)) = coordinateArc a j (v-u) := by + ext x + simp only [coordinateArc,Set.mem_ofPred_eq,map_sub,map_add,map_intCast] + rw [show ordinary v+(q:ℝ)-(ordinary u+(p:ℝ)) = ordinary v-ordinary u+((q-p:ℤ):ℝ) by push_cast; ring] + rw [Int.fract_add_intCast] + rw [he] + ext x + simp only [Set.mem_preimage] + have ht : translate a (-coordinateShift j (u+p)) x = translate a (-coordinateShift j u) x := by + change translation a (-coordinateShift j (u+p)) x = translation a (-coordinateShift j u) x + fin_cases j + · have hp := DFunLike.congr_fun (translation_period a (-u,0) (-p,0)) x + simpa [coordinateShift,add_comm] using hp + · have hp := DFunLike.congr_fun (translation_period a (0,-u) (0,-p)) x + simpa [coordinateShift,add_comm] using hp + rw [ht] + +theorem coordinateLabelWindow_resolved {a : ℕ} {r : CutRing} + (n : ℕ) (q : Fin 2 → ℤ) (j : Fin 2) (u v : CutRing) + (hu : q j ≤ endpointLabel u ∧ endpointLabel u < q j+n) + (hv : q j ≤ endpointLabel v ∧ endpointLabel v < q j+n) : + coordinateBetween a j u v ∈ resolvedAlgebra + (fun z => (InitialCoverSystem.primitiveTests (a := a) (r := r) + (coordinateWindowPrimitives n q) z).val) := by + let i := (endpointLabel u-q j).toNat + let k := (endpointLabel v-q j).toNat + have hi : (i:ℤ) = endpointLabel u-q j := Int.toNat_of_nonneg (by omega) + have hk : (k:ℤ) = endpointLabel v-q j := Int.toNat_of_nonneg (by omega) + have hi' : i < n := by omega + have hk' : k < n := by omega + have hu' : u = (((q j+(i:ℤ)):CutRing)*cutTau)+(u.re:CutRing) := by + apply QuadraticAlgebra.ext <;> simp [cutTau,hi,endpointLabel] + have hv' : v = (((q j+(k:ℤ)):CutRing)*cutTau)+(v.re:CutRing) := by + apply QuadraticAlgebra.ext <;> simp [cutTau,hk,endpointLabel] + rw [hu',hv',coordinateBetween_period] + exact coordinate_window_between_resolved_all n q j i k hi' hk' + +end WindowIntervals + +section EnlargedControl + +namespace SameActionOn +variable {E H : Type*} [Group H] {f g : E → H} {P Q : Subgroup H} + +theorem mono (h : SameActionOn f g Q) (hPQ : P ≤ Q) : SameActionOn f g P := + fun s x hx => h s x (hPQ hx) + +theorem comp {F : Type*} (h : SameActionOn f g P) (v : F → E) : + SameActionOn (f ∘ v) (g ∘ v) P := fun s x hx => h (v s) x hx + +end SameActionOn + +theorem alphabetPerfect {α : Type*} [Fintype α] [DecidableEq α] + (J : Finset α) (hJ : 5 ≤ J.card) : Group.IsPerfect (alternatingGroup J) := + ⟨commutator_alternatingGroup_eq_top (by simpa using hJ)⟩ + +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) {ι : Type*} [Finite ι] + +theorem initialAlphabet_zero (I : Finset (Fin (m+1))) : + B.initialAlphabet I 0 = B.c.comp (subtypeAlternatingHom I) := by + rw [initialAlphabet,B.initialConditional_zero] + +theorem geometricSector_control_enlarged + {I J : Finset (Fin (m+1))} [Group.IsPerfect (alternatingGroup I)] + [Group.IsPerfect (alternatingGroup J)] (hIJ : I ⊆ J) + (b c : Fin (m+1)) (hb : b ∉ I) (hc : c ∉ J) + (P : ι → Fin 5 × (CutRing × CutRing)) + (h : B.PrimitiveFamilyLaw I b hb P) (g : B.PrimitiveFamilyLaw J c hc P) + (V W : polygonAlgebra a) + (hV : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) P i).val) V.val) + (hVW : V ≤ W) : + SameActionOn (B.geometricSector J c hc P g W) + ((B.c.comp (subtypeAlternatingHom J)).comp (universalProjection (alternatingGroup J))) + (B.geometricSector I b hb P h V).range := by + rw [← B.initialAlphabet_zero J] + apply SameActionOn.mono (B.geometricSector_control J c hc P g V W hVW) + rintro x ⟨s,rfl⟩ + refine ⟨universalMap (subalphabetHom hIJ) s,?_⟩ + exact DFunLike.congr_fun (B.geometricSector_inclusion hIJ b c hb hc P h g V hV) s + +theorem geometricSector_conditional_move + {I J : Finset (Fin (m+1))} [Group.IsPerfect (alternatingGroup I)] + [Group.IsPerfect (alternatingGroup J)] (hIJ : I ⊆ J) + (b c : Fin (m+1)) (hb : b ∉ I) (hc : c ∉ J) + (P : ι → Fin 5 × (CutRing × CutRing)) + (h : B.PrimitiveFamilyLaw I b hb P) (g : B.PrimitiveFamilyLaw J c hc P) + (V W : polygonAlgebra a) + (hV : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) P i).val) V.val) + (hVW : V ≤ W) (σ : alternatingGroup (Fin (m+1))) (hσ : σ.val.support ⊆ J) : + ∃ v ∈ (B.geometricSector J c hc P g W).range, + v ∈ sourceAlignedGroup a r m hm M B.t J ∧ + ∀ x ∈ (B.geometricSector I b hb P h V).range, + v*x*v⁻¹ = B.c σ*x*(B.c σ)⁻¹ := by + obtain ⟨s,hs⟩ := (subtypeAlternatingHom_mem_range J σ).mpr hσ + obtain ⟨t,ht⟩ := universalProjection_surjective (alternatingGroup J) s + refine ⟨B.geometricSector J c hc P g W t,⟨t,rfl⟩, + B.geometricSector_aligned J c hc P g W t,?_⟩ + intro x hx + have hh := B.geometricSector_control_enlarged hIJ b c hb hc P h g V W hV hVW t x hx + simpa only [MonoidHom.comp_apply,ht,hs] using hh + +end InitialCoverSystem +end EnlargedControl + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/WindowRectangles.lean b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/WindowRectangles.lean new file mode 100644 index 0000000000000000000000000000000000000000..bdc87bbee132f1910bb297737c8b9527c3705a22 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/PolygonGeometry/WindowRectangles.lean @@ -0,0 +1,193 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.ConcurrentAnchors +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.LocalChartDecisions + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section WindowRectangles + +noncomputable def windowRectangle (a n : ℕ) (q : Fin 2 → ℤ) (i : Fin 2 → Fin n) : + polygonAlgebra a := + coordinateRectangle a (fun j => windowCut n (q j) (i j).castSucc) + (fun j => windowCut n (q j) (i j).succ) + +noncomputable def windowPlanarLift {a : ℕ} (q : Fin 2 → ℤ) (p : GenericSquare a) : ℝ × ℝ := + (liftedCoordinate 0 ((q 0:CutRing)*cutTau) p, + liftedCoordinate 1 ((q 1:CutRing)*cutTau) p) + +theorem windowPlanarLift_coordinate {a : ℕ} (q : Fin 2 → ℤ) (p : GenericSquare a) + (j : Fin 2) : realCoordinate (windowPlanarLift q p) j = + liftedCoordinate j ((q j:CutRing)*cutTau) p := by fin_cases j <;> rfl + +theorem windowPlanarLift_spec {a : ℕ} (q : Fin 2 → ℤ) (p : GenericSquare a) : + p.val=(Int.fract (windowPlanarLift q p).1,Int.fract (windowPlanarLift q p).2) := by + simp only [windowPlanarLift,liftedCoordinate,Int.fract_sub_intCast] + apply Prod.ext + · exact (Int.fract_eq_self.mpr p.property.1).symm + · exact (Int.fract_eq_self.mpr p.property.2.1).symm + +theorem windowRectangle_mem {a : ℕ} (n : ℕ) (hn : 201 ≤ n) (q : Fin 2 → ℤ) + (i : Fin 2 → Fin n) (p : GenericSquare a) : + p ∈ (windowRectangle a n q i).val ↔ ∀ j : Fin 2, + ordinary (windowCut n (q j) (i j).castSucc) ≤ realCoordinate (windowPlanarLift q p) j ∧ + realCoordinate (windowPlanarLift q p) j < ordinary (windowCut n (q j) (i j).succ) := by + change (p ∈ (windowCell a 0 n (q 0) (i 0)).val ∧ + p ∈ (windowCell a 1 n (q 1) (i 1)).val) ↔ _ + simp only [windowCell_mem _ n hn,windowPlanarLift_coordinate] + rw [Fin.forall_fin_two] + +theorem windowRectangle_cover {a : ℕ} (n : ℕ) (hn : 201 ≤ n) (q : Fin 2 → ℤ) + (p : GenericSquare a) : ∃ i : Fin 2 → Fin n, p ∈ (windowRectangle a n q i).val := by + have hh (j : Fin 2) := windowCell_cover (a := a) j n hn (q j) p + choose i hi using hh + refine ⟨i,hi 0,hi 1⟩ + +theorem windowRectangle_pairwise_disjoint {a : ℕ} (n : ℕ) (hn : 201 ≤ n) (q : Fin 2 → ℤ) : + Pairwise fun i k : Fin 2 → Fin n => Disjoint (windowRectangle a n q i).val (windowRectangle a n q k).val := by + intro i k hik + obtain ⟨j,hj⟩ := Function.ne_iff.mp hik + apply Set.disjoint_left.mpr + intro p hp hk + have hi' := (windowRectangle_mem n hn q i p).mp hp j + have hk' := (windowRectangle_mem n hn q k p).mp hk j + simp only [windowPlanarLift_coordinate] at hi' hk' + exact Set.disjoint_left.mp (windowCell_pairwise_disjoint (a := a) j n hn (q j) hj) + ((windowCell_mem j n hn (q j) (i j) p).mpr hi') + ((windowCell_mem j n hn (q j) (k j) p).mpr hk') + +theorem windowRectangle_resolved {a : ℕ} {r : CutRing} (n : ℕ) (hn : 0 (InitialCoverSystem.primitiveTests (a := a) (r := r) + (coordinateWindowPrimitives n q) z).val) (windowRectangle a n q i).val := by + intro x y he + have hx := coordinateLabelWindow_resolved (a := a) (r := r) n q 0 _ _ + (windowCut_label n (q 0) hn (i 0).castSucc) (windowCut_label n (q 0) hn (i 0).succ) x y he + have hy := coordinateLabelWindow_resolved (a := a) (r := r) n q 1 _ _ + (windowCut_label n (q 1) hn (i 1).castSucc) (windowCut_label n (q 1) hn (i 1).succ) x y he + exact and_congr hx hy + +theorem windowRectangle_diameter {a : ℕ} (n : ℕ) (hn : 201 ≤ n) (q : Fin 2 → ℤ) + (i : Fin 2 → Fin n) (p t : GenericSquare a) + (hp : p ∈ (windowRectangle a n q i).val) (ht : t ∈ (windowRectangle a n q i).val) : + dist (windowPlanarLift q p) (windowPlanarLift q t) ≤ 200/(n:ℝ) := by + have hd (j : Fin 2) : |realCoordinate (windowPlanarLift q p) j- + realCoordinate (windowPlanarLift q t) j| ≤ 200/(n:ℝ) := by + have hp' := (windowRectangle_mem n hn q i p).mp hp j + have ht' := (windowRectangle_mem n hn q i t).mp ht j + have hm := windowCut_mesh n (q j) (i j) + apply abs_le.mpr + constructor <;> linarith + rw [Prod.dist_eq,Real.dist_eq,Real.dist_eq,max_le_iff] + exact ⟨hd 0,hd 1⟩ + +end WindowRectangles + +section CellLineIntersections + +theorem linear_form_dist_bound (A B : ℝ) (x y : ℝ × ℝ) : + |(A*x.1+B*x.2)-(A*y.1+B*y.2)| ≤ (|A|+|B|)*dist x y := by + have hx : |x.1-y.1| ≤ dist x y := by + rw [Prod.dist_eq,Real.dist_eq,Real.dist_eq] + exact le_max_left _ _ + have hy : |x.2-y.2| ≤ dist x y := by + rw [Prod.dist_eq,Real.dist_eq,Real.dist_eq] + exact le_max_right _ _ + calc + _ = |A*(x.1-y.1)+B*(x.2-y.2)| := by congr 1; ring + _ ≤ |A*(x.1-y.1)|+|B*(x.2-y.2)| := abs_add_le _ _ + _ ≤ |A| *dist x y+|B| *dist x y := by + rw [abs_mul,abs_mul] + exact add_le_add (mul_le_mul_of_nonneg_left hx (abs_nonneg _)) + (mul_le_mul_of_nonneg_left hy (abs_nonneg _)) + _ = _ := by ring + +theorem crossing_level_bound (A B c δ : ℝ) (p x y : ℝ × ℝ) + (hx : A*x.1+B*x.2≤c) (hy : c≤A*y.1+B*y.2) + (hpx : dist p x≤δ) (hpy : dist p y≤δ) : + |c-(A*p.1+B*p.2)| ≤ (|A|+|B|)*δ := by + have h₁ := (linear_form_dist_bound A B x p).trans + (mul_le_mul_of_nonneg_left (by simpa only [dist_comm] using hpx) (by positivity)) + have h₂ := (linear_form_dist_bound A B y p).trans + (mul_le_mul_of_nonneg_left (by simpa only [dist_comm] using hpy) (by positivity)) + have h₁' := (abs_le.mp h₁).1 + have h₂' := (abs_le.mp h₂).2 + apply abs_le.mpr + constructor <;> linarith + +theorem line_point_in_box (A B c : ℝ) (L V : Fin 2 → ℝ) (x y : ℝ × ℝ) + (hx : ∀ j, L j≤realCoordinate x j ∧ realCoordinate x j≤V j) + (hy : ∀ j, L j≤realCoordinate y j ∧ realCoordinate y j≤V j) + (hcx : A*x.1+B*x.2≤c) (hcy : c≤A*y.1+B*y.2) : + ∃ z : ℝ × ℝ, A*z.1+B*z.2=c ∧ + ∀ j, L j≤realCoordinate z j ∧ realCoordinate z j≤V j := by + let f : ℝ → ℝ := fun t => A*((1-t)*x.1+t*y.1)+B*((1-t)*x.2+t*y.2) + have hf : Continuous f := by unfold f; fun_prop + obtain ⟨t,ht,he⟩ := intermediate_value_Icc (by norm_num : (0:ℝ)≤1) hf.continuousOn + (show c ∈ Set.Icc (f 0) (f 1) from by simpa [f] using And.intro hcx hcy) + refine ⟨((1-t)*x.1+t*y.1,(1-t)*x.2+t*y.2),he,?_⟩ + intro j + have hx' := hx j + have hy' := hy j + have hform : realCoordinate ((1-t)*x.1+t*y.1,(1-t)*x.2+t*y.2) j= + (1-t)*realCoordinate x j+t*realCoordinate y j := by fin_cases j <;> rfl + rw [hform] + constructor <;> nlinarith [mul_nonneg (sub_nonneg.mpr ht.2) (sub_nonneg.mpr hx'.1), + mul_nonneg ht.1 (sub_nonneg.mpr hy'.1), + mul_nonneg (sub_nonneg.mpr ht.2) (sub_nonneg.mpr hx'.2), + mul_nonneg ht.1 (sub_nonneg.mpr hy'.2)] + +theorem windowRectangle_intersection_near {a : ℕ} (ha : 0 + (i.1,⟨(p i.1-q i.1).toNat+i.2.val,by + have hi := i.2.isLt + have he : ((p i.1-q i.1).toNat:ℤ) = p i.1-q i.1 := Int.toNat_of_nonneg (by linarith [hstart i.1]) + have hn := hend i.1 + omega⟩) + +theorem coordinateWindowEmbedding_spec (n k : ℕ) (q p : Fin 2 → ℤ) + (hs : ∀ j, q j ≤ p j) (he : ∀ j, p j+(k:ℤ) ≤ q j+n) : + coordinateWindowPrimitives n q ∘ coordinateWindowEmbedding n k q p hs he = + coordinateWindowPrimitives k p := by + funext i + apply Prod.ext + · rfl + · change coordinateShift i.1 (((q i.1+(((p i.1-q i.1).toNat+i.2.val:ℕ):ℤ)):CutRing)*cutTau) = _ + have ht : ((p i.1-q i.1).toNat:ℤ) = p i.1-q i.1 := Int.toNat_of_nonneg (by linarith [hs i.1]) + simp only [Nat.cast_add,ht] + congr 2 + push_cast + ring + +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + +theorem geometricSector_subfamily {ι κ : Type*} [Finite ι] [Finite κ] + (I : Finset (Fin (m+1))) [Group.IsPerfect (alternatingGroup I)] + (b : Fin (m+1)) (hb : b ∉ I) + (P : ι → Fin 5 × (CutRing × CutRing)) (Q : κ → Fin 5 × (CutRing × CutRing)) + (v : κ → ι) (hv : P ∘ v = Q) + (h : B.PrimitiveFamilyLaw I b hb P) (g : B.PrimitiveFamilyLaw I b hb Q) + (V : polygonAlgebra a) + (hV : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) Q i).val) V.val) : + B.geometricSector I b hb Q g V = B.geometricSector I b hb P h V := by + subst Q + exact B.geometricSector_reindex I b hb P v h g V hV + +theorem geometricSector_window_inclusion + (I : Finset (Fin (m+1))) [Group.IsPerfect (alternatingGroup I)] + (b : Fin (m+1)) (hb : b ∉ I) (n k : ℕ) (q p : Fin 2 → ℤ) + (hs : ∀ j, q j ≤ p j) (he : ∀ j, p j+(k:ℤ) ≤ q j+n) + (h : B.PrimitiveFamilyLaw I b hb (coordinateWindowPrimitives n q)) + (g : B.PrimitiveFamilyLaw I b hb (coordinateWindowPrimitives k p)) + (V : polygonAlgebra a) + (hV : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) + (coordinateWindowPrimitives k p) i).val) V.val) : + B.geometricSector I b hb (coordinateWindowPrimitives k p) g V = + B.geometricSector I b hb (coordinateWindowPrimitives n q) h V := + B.geometricSector_subfamily I b hb _ _ (coordinateWindowEmbedding n k q p hs he) + (coordinateWindowEmbedding_spec n k q p hs he) h g V hV + +end InitialCoverSystem +end WindowSubfamilies + +section CircularIntervals + +theorem coordinateArc_mem (a : ℕ) (j : Fin 2) (z : CutRing) : + coordinateArc a j z ∈ polygonAlgebra a := by + have he : coordinateArc a j z = halfPlane a (Fin.castLE (by omega) j) + (z-(⌊ordinary z⌋:ℤ)) := by + ext p + have hc : cutForm a (Fin.castLE (by omega) j) p.val = coordinate j p := by + fin_cases j <;> rfl + simp only [coordinateArc,halfPlane,Set.mem_ofPred_eq,hc,map_sub,map_intCast] + rfl + rw [he] + exact halfPlane_mem _ _ _ + +theorem coordinateBetween_mem (a : ℕ) (j : Fin 2) (u v : CutRing) : + coordinateBetween a j u v ∈ polygonAlgebra a := + polygon_preimage_translate (-coordinateShift j u) (coordinateArc_mem a j (v-u)) + +noncomputable def coordinateInterval (a : ℕ) (j : Fin 2) (u v : CutRing) : polygonAlgebra a := + ⟨coordinateBetween a j u v,coordinateBetween_mem a j u v⟩ + +theorem mem_coordinateBetween_iff {a : ℕ} (j : Fin 2) (u v : CutRing) + (h₀ : ordinary u ≤ ordinary v) (h₁ : ordinary v-ordinary u < 1) + (p : GenericSquare a) : + p ∈ coordinateBetween a j u v ↔ + ∃ k : ℤ, ordinary u ≤ coordinate j p+(k:ℝ) ∧ coordinate j p+(k:ℝ) < ordinary v := by + change coordinate j (translate a (-coordinateShift j u) p) < Int.fract (ordinary (v-u)) ↔ _ + rw [← coordinateShift_neg,coordinate_translate,map_neg,map_sub, + Int.fract_eq_self.mpr ⟨sub_nonneg.mpr h₀,h₁⟩] + change Int.fract (coordinate j p-ordinary u) < ordinary v-ordinary u ↔ _ + constructor + · intro h + refine ⟨-⌊coordinate j p-ordinary u⌋,?_,?_⟩ + · have hn := Int.fract_nonneg (coordinate j p-ordinary u) + simp only [Int.fract,Int.cast_neg] at * + linarith + · simp only [Int.fract,Int.cast_neg] at * + linarith + · rintro ⟨k,hk₀,hk₁⟩ + have he : Int.fract (coordinate j p-ordinary u+(k:ℝ)) = + coordinate j p-ordinary u+(k:ℝ) := + Int.fract_eq_self.mpr ⟨by linarith,by linarith⟩ + rw [Int.fract_add_intCast] at he + rw [he] + linarith + +theorem coordinateInterval_mono {a : ℕ} (j : Fin 2) (u v u' v' : CutRing) + (hu : ordinary u' ≤ ordinary u) (huv : ordinary u ≤ ordinary v) + (hv : ordinary v ≤ ordinary v') (hlen : ordinary v'-ordinary u' < 1) : + coordinateInterval a j u v ≤ coordinateInterval a j u' v' := by + intro p hp + obtain ⟨k,hk⟩ := (mem_coordinateBetween_iff j u v huv (by linarith) p).mp hp + exact (mem_coordinateBetween_iff j u' v' (by linarith) hlen p).mpr + ⟨k,hu.trans hk.1,hk.2.trans_le hv⟩ + +theorem coordinateInterval_disjoint {a : ℕ} (j : Fin 2) (u v w z : CutRing) + (huv : ordinary u ≤ ordinary v) (hvw : ordinary v ≤ ordinary w) + (hwz : ordinary w ≤ ordinary z) (hlen : ordinary z-ordinary u < 1) : + Disjoint (coordinateInterval a j u v).val (coordinateInterval a j w z).val := by + apply Set.disjoint_left.mpr + intro p hp hq + obtain ⟨k,hk₀,hk₁⟩ := (mem_coordinateBetween_iff j u v huv (by linarith) p).mp hp + obtain ⟨l,hl₀,hl₁⟩ := (mem_coordinateBetween_iff j w z hwz (by linarith) p).mp hq + have hk : (k:ℝ)-(l:ℝ) < 1 := by linarith + have hl : (l:ℝ)-(k:ℝ) < 1 := by linarith + have hk' : k-l < (1:ℤ) := by exact_mod_cast hk + have hl' : l-k < (1:ℤ) := by exact_mod_cast hl + have he : k = l := by omega + subst l + linarith + +theorem coordinateInterval_window {a : ℕ} {r : CutRing} + (n : ℕ) (q : Fin 2 → ℤ) (j : Fin 2) (u v : CutRing) + (hu : q j ≤ endpointLabel u ∧ endpointLabel u < q j+n) + (hv : q j ≤ endpointLabel v ∧ endpointLabel v < q j+n) : + ResolvedBy (fun i => (InitialCoverSystem.primitiveTests (a := a) (r := r) + (coordinateWindowPrimitives n q) i).val) (coordinateInterval a j u v).val := + coordinateLabelWindow_resolved n q j u v hu hv + +end CircularIntervals + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/AffineDensityDerivative.lean b/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/AffineDensityDerivative.lean new file mode 100644 index 0000000000000000000000000000000000000000..52359fcd8e54a97dbf29dca54da52ec7a71c5914 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/AffineDensityDerivative.lean @@ -0,0 +1,109 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.MatrixInverseCalculus + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section AffineDensityDerivative +open Classical Matrix +open scoped Matrix.Norms.Elementwise + +noncomputable def affineNoiseRoot {ι : Type*} [Fintype ι] + (f : ℝ → ℝ) (A : Matrix ι ι ℝ) (a y : ι → ℝ) : ℝ := + noiseTensor (fun _ : ι => f) (A⁻¹*ᵥ(y-a))/Real.sqrt A.det + +theorem inverse_affine_hasDerivAt {ι : Type*} [Fintype ι] + {A : ℝ → Matrix ι ι ℝ} {a : ℝ → ι → ℝ} + {A' : Matrix ι ι ℝ} {a' : ι → ℝ} {t : ℝ} + (hA : HasDerivAt A A' t) (ha : HasDerivAt a a' t) + (hunit : IsUnit (A t).det) (y : ι → ℝ) : + HasDerivAt (fun s => (A s)⁻¹*ᵥ(y-a s)) + (-(((A t)⁻¹*A')*ᵥ((A t)⁻¹*ᵥ(y-a t))+(A t)⁻¹*ᵥa')) t := by + have h := matrix_hasDerivAt_mulVec (matrix_hasDerivAt_inverse hA hunit) + ((hasDerivAt_const t y).sub ha) + convert! h using 1 + simp only [zero_sub,Matrix.mulVec_neg,Matrix.neg_mulVec,Matrix.mulVec_mulVec, + neg_mul,neg_add_rev] + abel + +theorem inverse_sqrt_det_hasDerivAt {ι : Type*} [Fintype ι] + {A : ℝ → Matrix ι ι ℝ} {A' : Matrix ι ι ℝ} {t : ℝ} + (hA : HasDerivAt A A' t) (hpos : 0<(A t).det) : + HasDerivAt (fun s => (Real.sqrt (A s).det)⁻¹) + (-(Real.sqrt (A t).det)⁻¹*Matrix.trace ((A t)⁻¹*A')/2) t := by + have hd := matrix_hasDerivAt_det hA (isUnit_iff_ne_zero.mpr hpos.ne') + have hs := (hd.sqrt hpos.ne').inv (Real.sqrt_pos.mpr hpos).ne' + convert! hs using 1 + rw [Matrix.trace_mul_comm A' (A t)⁻¹] + have hh := Real.sq_sqrt hpos.le + field_simp + rw [hh] + ring + +theorem affineNoiseRoot_hasDerivAt {ι : Type*} [Fintype ι] + {f : ℝ → ℝ} (hf : Differentiable ℝ f) + {A : ℝ → Matrix ι ι ℝ} {a : ℝ → ι → ℝ} + {A' : Matrix ι ι ℝ} {a' : ι → ℝ} {t : ℝ} + (hA : HasDerivAt A A' t) (ha : HasDerivAt a a' t) + (hpos : 0<(A t).det) (y : ι → ℝ) : + HasDerivAt (fun s => affineNoiseRoot f (A s) (a s) y) + (-affineNoiseGenerator f ((A t)⁻¹*A') ((A t)⁻¹*ᵥa') + ((A t)⁻¹*ᵥ(y-a t))/Real.sqrt (A t).det) t := by + have hx := inverse_affine_hasDerivAt hA ha (isUnit_iff_ne_zero.mpr hpos.ne') y + have hF := noiseTensor_hasDerivAt hf hx + have hh := hF.mul (inverse_sqrt_det_hasDerivAt hA hpos) + convert! hh using 1 + rw [affineNoiseGenerator_eq] + simp only [Pi.neg_apply,Pi.add_apply,neg_mul,Finset.sum_neg_distrib] + ring + +end AffineDensityDerivative + +section AffineDensityEnergy +open Classical Matrix MeasureTheory +open scoped Matrix.Norms.Elementwise + +theorem affineNoiseRoot_normalized {ι : Type*} [Fintype ι] + {f : ℝ → ℝ} (hf : (∫x : ℝ,f x^2)=1) + (A : Matrix ι ι ℝ) (a : ι → ℝ) (hpos : 0 noiseTensor (fun _ : ι => f) x^2)] + have ht : (∫x : ι → ℝ,noiseTensor (fun _ : ι => f) x^2)=1 := by + rw [show (volume : Measure (ι → ℝ))=Measure.pi (fun _ : ι => (volume : Measure ℝ)) from rfl, + noiseTensor_energy] + simp only [hf,Finset.prod_const_one] + rw [ht,mul_one,abs_of_pos hpos,div_self hpos.ne'] + +theorem affineNoiseRoot_derivative_energy {ι : Type*} [Fintype ι] + {f : ℝ → ℝ} (hf : ContDiff ℝ 1 f) (hc : HasCompactSupport f) + (hn : (∫x : ℝ,f x^2)=1) (he : Function.Even f) + {A : ℝ → Matrix ι ι ℝ} {a : ℝ → ι → ℝ} + {A' : Matrix ι ι ℝ} {a' : ι → ℝ} {t : ℝ} + (hA : HasDerivAt A A' t) (ha : HasDerivAt a a' t) + (hpos : 0<(A t).det) : + (∫y : ι → ℝ,deriv (fun s => affineNoiseRoot f (A s) (a s) y) t^2)≤ + affineNoiseEnergyConstant f*((∑i,∑j,((A t)⁻¹*A') i j^2)+ + ∑i,((A t)⁻¹*ᵥa') i^2) := by + have hd (y : ι → ℝ) := (affineNoiseRoot_hasDerivAt (hf.differentiable (by norm_num)) + hA ha hpos y).deriv + simp_rw [hd,div_pow,neg_sq,Real.sq_sqrt hpos.le] + rw [integral_div,integral_matrix_affine_inverse (A t) (a t) + (isUnit_iff_ne_zero.mpr hpos.ne') + (fun x => affineNoiseGenerator f ((A t)⁻¹*A') ((A t)⁻¹*ᵥa') x^2), + abs_of_pos hpos,mul_div_cancel_left₀ _ hpos.ne'] + exact affineNoiseGenerator_energy hf hc he hn _ _ + +end AffineDensityEnergy + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/AffineGeneratorIntegrability.lean b/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/AffineGeneratorIntegrability.lean new file mode 100644 index 0000000000000000000000000000000000000000..d12fb130babaf3c0ea2559d60dd4d52f50e87428 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/AffineGeneratorIntegrability.lean @@ -0,0 +1,177 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.AffineIntegrability +import OAI.GroupTheory.SimpleAmenable.RandomFields.NoiseContinuity + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section AffineGeneratorIntegrability +open Classical MeasureTheory Matrix + +theorem affineNoiseGenerator_integrable_square {ι : Type*} [Fintype ι] + {f : ℝ → ℝ} (hf : ContDiff ℝ 1 f) (hc : HasCompactSupport f) + (L : Matrix ι ι ℝ) (v : ι → ℝ) : + Integrable (fun x : ι → ℝ => affineNoiseGenerator f L v x^2) := by + let a : (ι → ℝ) → ℝ := fun x => ∑i,L i i*singletonNoise f .diagonal i x + let b : (ι → ℝ) → ℝ := fun x => ∑i,v i*singletonNoise f .score i x + let c : (ι → ℝ) → ℝ := fun x => ∑p : NoisePair ι,L p.val.1 p.val.2*pairNoise f p x + have h : ∀u∈({a,b,c} : Finset ((ι → ℝ) → ℝ)), + ∀w∈({a,b,c} : Finset ((ι → ℝ) → ℝ)),Integrable (fun x => u x*w x) + (Measure.pi (fun _ : ι => (volume : Measure ℝ))) := by + intro u hu w hw + simp only [Finset.mem_insert,Finset.mem_singleton] at hu hw + rcases hu with rfl|rfl|rfl <;> rcases hw with rfl|rfl|rfl <;> + dsimp only [a,b,c,singletonNoise,pairNoise] <;> apply noise_sum_integrable_product hf hc + have haa := h a (by simp) a (by simp) + have hbb := h b (by simp) b (by simp) + have hcc := h c (by simp) c (by simp) + have hab := h a (by simp) b (by simp) + have hac := h a (by simp) c (by simp) + have hbc := h b (by simp) c (by simp) + convert! ((((haa.add hbb).add hcc).add (hab.const_mul 2)).add + ((hac.const_mul 2).add (hbc.const_mul 2))).congr (Filter.Eventually.of_forall (fun x => ?_)) using 1 + change a x*a x+b x*b x+c x*c x+2*(a x*b x)+(2*(a x*c x)+2*(b x*c x))= + (a x+b x+c x)^2 + ring + +theorem affineNoiseRootDerivative_integrable_square {ι : Type*} [Fintype ι] + {f : ℝ → ℝ} (hf : ContDiff ℝ 1 f) (hc : HasCompactSupport f) + (A L : Matrix ι ι ℝ) (a v : ι → ℝ) (hA : IsUnit A.det) : + Integrable (fun y => (-affineNoiseGenerator f L v (A⁻¹*ᵥ(y-a))/Real.sqrt A.det)^2) := by + simpa only [div_pow,neg_sq] using + (integrable_matrix_affine_inverse A a hA (affineNoiseGenerator_integrable_square hf hc L v)).div_const + ((Real.sqrt A.det)^2) + +end AffineGeneratorIntegrability + +section NoiseInterpolation +open Classical Matrix MeasureTheory Set +open scoped Matrix.Norms.Elementwise + +noncomputable def noiseInterpolationRoot {ι : Type*} [Fintype ι] + (f : ℝ → ℝ) (B C : Matrix ι ι ℝ) (a h : ι → ℝ) (t : ℝ) : (ι → ℝ) → ℝ := + affineNoiseRoot f (1+covarianceSegment B C t) (a+t • h) + +noncomputable def noiseInterpolationDerivative {ι : Type*} [Fintype ι] + (f : ℝ → ℝ) (B C : Matrix ι ι ℝ) (a h : ι → ℝ) (t : ℝ) (y : ι → ℝ) : ℝ := + let T := 1+covarianceSegment B C t; + -affineNoiseGenerator f (T⁻¹*(C-B)) (T⁻¹*ᵥh) (T⁻¹*ᵥ(y-(a+t • h)))/Real.sqrt T.det + +theorem covarianceSegment_hasDerivAt {ι : Type*} [Fintype ι] + (B C : Matrix ι ι ℝ) (t : ℝ) : + HasDerivAt (fun s => 1+covarianceSegment B C s) (C-B) t := by + simp_rw [covarianceSegment_affine] + convert! (hasDerivAt_const t (1+B)).add ((hasDerivAt_id t).smul_const (C-B)) using 1 + simp + +theorem noiseInterpolation_hasDerivAt {ι : Type*} [Fintype ι] + {f : ℝ → ℝ} (hf : ContDiff ℝ 1 f) (B C : Matrix ι ι ℝ) + (hB : B.PosSemidef) (hC : C.PosSemidef) (a h y : ι → ℝ) + {t : ℝ} (ht : t∈Icc (0:ℝ) 1) : + HasDerivAt (fun s => noiseInterpolationRoot f B C a h s y) + (noiseInterpolationDerivative f B C a h t y) t := by + have hp := (Matrix.PosDef.one.add_posSemidef (covarianceSegment_posSemidef B C hB hC ht)).det_pos + exact affineNoiseRoot_hasDerivAt (hf.differentiable (by norm_num)) + (covarianceSegment_hasDerivAt B C t) + (by convert! (hasDerivAt_const t a).add ((hasDerivAt_id t).smul_const h) using 1 + simp) hp y + +local instance {ι : Type*} : MeasurableSpace (Matrix ι ι ℝ) := + inferInstanceAs (MeasurableSpace (ι → ι → ℝ)) +local instance {ι : Type*} [Fintype ι] : BorelSpace (Matrix ι ι ℝ) := + inferInstanceAs (BorelSpace (ι → ι → ℝ)) + +theorem noiseInterpolationDerivative_measurable {ι : Type*} [Fintype ι] + {f : ℝ → ℝ} (hf : ContDiff ℝ 1 f) (B C : Matrix ι ι ℝ) (a h : ι → ℝ) : + Measurable (Function.uncurry (noiseInterpolationDerivative f B C a h)) := by + let T : (ℝ×(ι → ℝ)) → Matrix ι ι ℝ := fun p => 1+covarianceSegment B C p.1 + have hT : Continuous T := by unfold T covarianceSegment; fun_prop + have hi := matrix_inverse_measurable hT.measurable + have hg : Continuous (fun p : (Matrix ι ι ℝ)×(ι → ℝ)×(ι → ℝ) => + affineNoiseGenerator f p.1 p.2.1 p.2.2) := + affineNoiseGenerator_continuous_comp hf continuous_fst + continuous_snd.fst continuous_snd.snd + have hx : Measurable (fun p : ℝ×(ι → ℝ) => p.2-(a+p.1 • h)) := by fun_prop + have hij (i j : ι) : Measurable (fun p => (T p)⁻¹ i j) := + (measurable_pi_apply j).comp ((measurable_pi_apply i).comp hi) + have hL : Measurable (fun p => (T p)⁻¹*(C-B)) := by + apply Measurable.of_eval + intro i + apply Measurable.of_eval + intro j + simp only [Matrix.mul_apply] + exact Finset.measurable_sum _ (fun k _ => (hij i k).mul_const _) + have hv : Measurable (fun p => (T p)⁻¹*ᵥh) := by + apply Measurable.of_eval + intro i + simp only [Matrix.mulVec,dotProduct] + exact Finset.measurable_sum _ (fun k _ => (hij i k).mul_const _) + have hxx : Measurable (fun p => (T p)⁻¹*ᵥ(p.2-(a+p.1 • h))) := by + apply Measurable.of_eval + intro i + simp only [Matrix.mulVec,dotProduct] + exact Finset.measurable_sum _ (fun k _ => (hij i k).mul ((measurable_pi_apply k).comp hx)) + exact (hg.measurable.comp (hL.prodMk (hv.prodMk hxx))).neg.div + (hT.matrix_det.measurable.sqrt) + +theorem noiseInterpolationDerivative_continuousOn {ι : Type*} [Fintype ι] + {f : ℝ → ℝ} (hf : ContDiff ℝ 1 f) (B C : Matrix ι ι ℝ) + (hB : B.PosSemidef) (hC : C.PosSemidef) (a h y : ι → ℝ) : + ContinuousOn (fun t => noiseInterpolationDerivative f B C a h t y) (Icc (0:ℝ) 1) := by + intro t ht + let T : ℝ → Matrix ι ι ℝ := fun s => 1+covarianceSegment B C s + have hT : Continuous T := by unfold T covarianceSegment; fun_prop + have hp : 0<(T t).det := + (Matrix.PosDef.one.add_posSemidef (covarianceSegment_posSemidef B C hB hC ht)).det_pos + have hi := matrix_inverse_continuousAt hT.continuousAt hp.ne' + have hg : Continuous (fun p : (Matrix ι ι ℝ)×(ι → ℝ)×(ι → ℝ) => + affineNoiseGenerator f p.1 p.2.1 p.2.2) := + affineNoiseGenerator_continuous_comp hf continuous_fst + continuous_snd.fst continuous_snd.snd + have hL : ContinuousAt (fun s => (T s)⁻¹*(C-B)) t := by fun_prop + have hv : ContinuousAt (fun s => (T s)⁻¹*ᵥh) t := by + fun_prop + have hx : ContinuousAt (fun s => (T s)⁻¹*ᵥ(y-(a+s • h))) t := by + fun_prop + exact ((hg.continuousAt.comp (hL.prodMk (hv.prodMk hx))).neg.div + hT.matrix_det.continuousAt.sqrt (Real.sqrt_ne_zero'.mpr hp)).continuousWithinAt + +theorem noiseInterpolationDerivative_energy {ι : Type*} [Fintype ι] + {f : ℝ → ℝ} (hf : ContDiff ℝ 1 f) (hc : HasCompactSupport f) + (hn : (∫x : ℝ,f x^2)=1) (he : Function.Even f) + (B C : Matrix ι ι ℝ) (hB : B.PosSemidef) (hC : C.PosSemidef) (a h : ι → ℝ) + {t : ℝ} (ht : t∈Icc (0:ℝ) 1) : + (∫y : ι → ℝ,noiseInterpolationDerivative f B C a h t y^2)≤ + affineNoiseEnergyConstant f*(matrixHSNorm (C-B)^2+ + ((1+matrixHSNorm (C-B))*finiteL2Norm ((1+B)⁻¹*ᵥh))^2) := by + let P := covarianceSegment B C t + have hP := covarianceSegment_posSemidef B C hB hC ht + have hp := (Matrix.PosDef.one.add_posSemidef hP).det_pos + have hd : (∫y : ι → ℝ,noiseInterpolationDerivative f B C a h t y^2)≤ + affineNoiseEnergyConstant f*(matrixHSNorm ((1+P)⁻¹*(C-B))^2+ + finiteL2Norm ((1+P)⁻¹*ᵥh)^2) := by + simp only [noiseInterpolationDerivative,div_pow,neg_sq,Real.sq_sqrt hp.le] + rw [integral_div,integral_matrix_affine_inverse (1+covarianceSegment B C t) (a+t • h) + (isUnit_iff_ne_zero.mpr hp.ne') + (fun x => affineNoiseGenerator f ((1+covarianceSegment B C t)⁻¹*(C-B)) + ((1+covarianceSegment B C t)⁻¹*ᵥh) x^2),abs_of_pos hp,mul_div_cancel_left₀ _ hp.ne'] + rw [matrixHSNorm_sq,finiteL2Norm_sq] + convert! affineNoiseGenerator_energy hf hc he hn ((1+P)⁻¹*(C-B)) ((1+P)⁻¹*ᵥh) using 1 + apply hd.trans + apply mul_le_mul_of_nonneg_left _ (affineNoiseEnergyConstant_nonneg f) + exact add_le_add + (pow_le_pow_left₀ (matrixHSNorm_nonneg _) (matrixHSNorm_inverse_contraction P (C-B) hP) 2) + (pow_le_pow_left₀ (finiteL2Norm_nonneg _) (covarianceSegment_inverse_signal B C hB hC h ht) 2) + +end NoiseInterpolation + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/AffineNoiseEnergy.lean b/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/AffineNoiseEnergy.lean new file mode 100644 index 0000000000000000000000000000000000000000..760cd58523c9388ea67e2ba49e8a516a1d1220a6 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/AffineNoiseEnergy.lean @@ -0,0 +1,231 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.RandomFields.FiniteOrthogonalEnergy + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section AffineNoiseEnergy +open Classical MeasureTheory + +theorem noise_centered_integrable_product {ι : Type*} [Fintype ι] + {f : ℝ → ℝ} (hf : ContDiff ℝ 1 f) (hc : HasCompactSupport f) + (s t : Finset ι) (p q : ι → NoiseFactor) : + Integrable (fun x : ι → ℝ => + centeredNoiseTensor f s (fun i => noiseFactor f (p i)) x* + centeredNoiseTensor f t (fun i => noiseFactor f (q i)) x) + (Measure.pi (fun _ : ι => (volume : Measure ℝ))) := by + apply noiseTensor_integrable_inner + intro i + split_ifs + · exact noiseFactor_integrable_product hf hc _ _ + · exact noiseFactor_integrable_product hf hc (p i) .base + · exact noiseFactor_integrable_product hf hc .base (q i) + · exact noiseFactor_integrable_product hf hc .base .base + +theorem integrable_sum_product {I J X : Type*} [Fintype I] [Fintype J] [MeasurableSpace X] + (μ : Measure X) (f : I → X → ℝ) (g : J → X → ℝ) + (h : ∀i j,Integrable (fun x => f i x*g j x) μ) : + Integrable (fun x => (∑i,f i x)*(∑j,g j x)) μ := by + simp only [Finset.sum_mul_sum] + exact integrable_finsetSum _ (fun i _ => integrable_finsetSum _ (fun j _ => h i j)) + +theorem integrable_three_energy {X : Type*} [MeasurableSpace X] (μ : Measure X) + (a b c : X → ℝ) (h : ∀u∈({a,b,c} : Finset (X → ℝ)), + ∀v∈({a,b,c} : Finset (X → ℝ)),Integrable (fun x => u x*v x) μ) : + (∫x,(a x+b x+c x)^2 ∂μ)≤ + 3*((∫x,a x^2 ∂μ)+(∫x,b x^2 ∂μ)+(∫x,c x^2 ∂μ)) := by + have haa := h a (by simp) a (by simp) + have hbb := h b (by simp) b (by simp) + have hcc := h c (by simp) c (by simp) + have hab := h a (by simp) b (by simp) + have hac := h a (by simp) c (by simp) + have hbc := h b (by simp) c (by simp) + have hleft : Integrable (fun x => (a x+b x+c x)^2) μ := by + apply ((((haa.add hbb).add hcc).add (hab.const_mul 2)).add + ((hac.const_mul 2).add (hbc.const_mul 2))).congr + filter_upwards with x + dsimp only [Pi.add_apply] + ring + have hright : Integrable (fun x => 3*(a x^2+b x^2+c x^2)) μ := by + convert! ((haa.add hbb).add hcc).const_mul 3 using 1 + ext x + simp only [Pi.add_apply,pow_two] + have hh := integral_mono hleft hright (fun x => by + nlinarith [sq_nonneg (a x-b x),sq_nonneg (b x-c x),sq_nonneg (a x-c x)]) + rwa [integral_const_mul,integral_add (by convert! haa.add hbb using 1; ext x; simp only [Pi.add_apply,pow_two]) + (by convert! hcc using 1; ext x; simp only [pow_two]),integral_add + (by convert! haa using 1; ext x; simp only [pow_two]) (by convert! hbb using 1; ext x; simp only [pow_two])] at hh + +noncomputable def affineNoiseGenerator {ι : Type*} [Fintype ι] + (f : ℝ → ℝ) (L : Matrix ι ι ℝ) (v : ι → ℝ) (x : ι → ℝ) : ℝ := + (∑i,L i i*singletonNoise f .diagonal i x)+ + (∑i,v i*singletonNoise f .score i x)+ + ∑p : NoisePair ι,L p.val.1 p.val.2*pairNoise f p x + +noncomputable def affineNoiseEnergyConstant (f : ℝ → ℝ) : ℝ := + 3*(noiseEnergy f .diagonal+noiseEnergy f .score+2*(noiseEnergy f .score*noiseEnergy f .position)) + +theorem affineNoiseEnergyConstant_nonneg (f : ℝ → ℝ) : 0≤affineNoiseEnergyConstant f := by + unfold affineNoiseEnergyConstant + have := noiseEnergy_nonneg f .diagonal + have := noiseEnergy_nonneg f .score + have := noiseEnergy_nonneg f .position + positivity + +theorem noise_sum_integrable_product {ι I J : Type*} [Fintype ι] [Fintype I] [Fintype J] + {f : ℝ → ℝ} (hf : ContDiff ℝ 1 f) (hc : HasCompactSupport f) + (s : I → Finset ι) (t : J → Finset ι) (p : I → ι → NoiseFactor) + (q : J → ι → NoiseFactor) (u : I → ℝ) (w : J → ℝ) : + Integrable (fun x : ι → ℝ => + (∑i,u i*centeredNoiseTensor f (s i) (fun j => noiseFactor f (p i j)) x)* + (∑i,w i*centeredNoiseTensor f (t i) (fun j => noiseFactor f (q i j)) x)) + (Measure.pi (fun _ : ι => (volume : Measure ℝ))) := by + apply integrable_sum_product + intro i j + apply ((noise_centered_integrable_product hf hc (s i) (t j) (p i) (q j)).const_mul (u i*w j)).congr + filter_upwards with x + ring + +theorem affineNoiseGenerator_energy {ι : Type*} [Fintype ι] + {f : ℝ → ℝ} (hf : ContDiff ℝ 1 f) (hc : HasCompactSupport f) (he : Function.Even f) + (hn : (∫x : ℝ,f x^2)=1) (L : Matrix ι ι ℝ) (v : ι → ℝ) : + (∫x : ι → ℝ,affineNoiseGenerator f L v x^2 + ∂(Measure.pi (fun _ : ι => (volume : Measure ℝ))))≤ + affineNoiseEnergyConstant f*((∑i,∑j,L i j^2)+∑i,v i^2) := by + let a : (ι → ℝ) → ℝ := fun x => ∑i,L i i*singletonNoise f .diagonal i x + let b : (ι → ℝ) → ℝ := fun x => ∑i,v i*singletonNoise f .score i x + let c : (ι → ℝ) → ℝ := fun x => ∑p : NoisePair ι,L p.val.1 p.val.2*pairNoise f p x + have habc : ∀u∈({a,b,c} : Finset ((ι → ℝ) → ℝ)), + ∀w∈({a,b,c} : Finset ((ι → ℝ) → ℝ)),Integrable (fun x => u x*w x) + (Measure.pi (fun _ : ι => (volume : Measure ℝ))) := by + intro u hu w hw + simp only [Finset.mem_insert,Finset.mem_singleton] at hu hw + rcases hu with rfl|rfl|rfl <;> rcases hw with rfl|rfl|rfl <;> + dsimp only [a,b,c,singletonNoise,pairNoise] <;> apply noise_sum_integrable_product hf hc + have H := integrable_three_energy (Measure.pi (fun _ : ι => (volume : Measure ℝ))) a b c habc + have ha := singletonNoise_energy_bound hf hc he hn .diagonal (by decide) (fun i => L i i) + have hb := singletonNoise_energy_bound hf hc he hn .score (by decide) v + have hc' := pairNoise_energy_bound hf hc he hn (fun p : NoisePair ι => L p.val.1 p.val.2) + let M := ∑i,∑j,L i j^2 + let V := ∑i,v i^2 + have hM : 0≤M := Finset.sum_nonneg (fun _ _ => Finset.sum_nonneg (fun _ _ => sq_nonneg _)) + have hV : 0≤V := Finset.sum_nonneg (fun _ _ => sq_nonneg _) + have hdiag : (∑i,L i i^2)≤M := Finset.sum_le_sum (fun i _ => + Finset.single_le_sum (fun j _ => sq_nonneg (L i j)) (Finset.mem_univ i)) + have hoff : (∑p : NoisePair ι,L p.val.1 p.val.2^2)≤M := by + change (∑p : {p : ι×ι // p.1≠p.2},L p.val.1 p.val.2^2)≤M + rw [← Finset.sum_subtype (Finset.univ.filter (fun p : ι×ι => p.1≠p.2)) (by simp) (fun p : ι×ι => L p.1 p.2^2),Finset.sum_filter] + calc + _ ≤ ∑p : ι×ι,L p.1 p.2^2 := by + apply Finset.sum_le_sum + intro p _ + split_ifs + · exact le_rfl + · exact sq_nonneg _ + _ = M := by simp only [Fintype.sum_prod_type,M] + have hD := noiseEnergy_nonneg f .diagonal + have hS := noiseEnergy_nonneg f .score + have hP := noiseEnergy_nonneg f .position + have hSP : 0≤2*(noiseEnergy f .score*noiseEnergy f .position) := by positivity + have ha' := ha.trans (mul_le_mul_of_nonneg_left hdiag hD) + have hc'' := hc'.trans (mul_le_mul_of_nonneg_left hoff hSP) + change (∫x : ι → ℝ,(a x+b x+c x)^2 ∂(Measure.pi (fun _ : ι => (volume : Measure ℝ))))≤_ + apply H.trans + have hs : (∫x,a x^2 ∂(Measure.pi (fun _ : ι => (volume : Measure ℝ))))+ + (∫x,b x^2 ∂(Measure.pi (fun _ : ι => (volume : Measure ℝ))))+ + (∫x,c x^2 ∂(Measure.pi (fun _ : ι => (volume : Measure ℝ))))≤ + noiseEnergy f .diagonal*M+noiseEnergy f .score*V+2*(noiseEnergy f .score*noiseEnergy f .position)*M := + add_le_add (add_le_add ha' hb) hc'' + unfold affineNoiseEnergyConstant + change 3*_≤3*_*(M+V) + nlinarith [mul_nonneg hD hV,mul_nonneg hS hM,mul_nonneg hSP hV] + +end AffineNoiseEnergy + +section ActualNoiseLaw +open Classical MeasureTheory ProbabilityTheory +open scoped ContDiff ENNReal + +noncomputable def smoothNoiseDensity (x : ℝ) : ℝ≥0∞ := ENNReal.ofReal (smoothNoiseRoot x^2) + +noncomputable def smoothNoiseLaw : Measure ℝ := volume.withDensity smoothNoiseDensity + +theorem smoothNoiseDensity_measurable : Measurable smoothNoiseDensity := + (smoothNoiseRoot_contDiff.continuous.pow 2).measurable.ennreal_ofReal + +instance smoothNoiseLaw_probability : IsProbabilityMeasure smoothNoiseLaw := by + constructor + rw [smoothNoiseLaw,withDensity_apply _ MeasurableSet.univ,Measure.restrict_univ] + have hi : Integrable (fun x : ℝ => smoothNoiseRoot x^2) := by + have hc := smoothNoiseRoot_contDiff.continuous.pow 2 + apply hc.integrable_of_hasCompactSupport + convert! smoothNoiseRoot_compact.mul_right (f':=smoothNoiseRoot) using 1 + ext x + simp only [Pi.mul_apply,pow_two] + change (∫⁻x : ℝ,ENNReal.ofReal (smoothNoiseRoot x^2))=1 + rw [← ofReal_integral_eq_lintegral_ofReal hi (ae_of_all _ (fun _ => sq_nonneg _)), + smoothNoiseRoot_normalized,ENNReal.ofReal_one] + +theorem smoothNoiseLaw_bounded : ∀ᵐx ∂smoothNoiseLaw,x∈Set.Icc (-1:ℝ) 1 := by + rw [smoothNoiseLaw,ae_withDensity_iff smoothNoiseDensity_measurable] + filter_upwards with x hx + by_contra h + have hh : 1≤|x| := by + have hn : ¬ |x|≤1 := by simpa only [abs_le,Set.mem_Icc] using h + exact (lt_of_not_ge hn).le + have hz := smoothNoiseRoot_zero hh + exact hx (by simp [smoothNoiseDensity,hz]) + +theorem smoothNoiseLaw_centered : (∫x : ℝ,x ∂smoothNoiseLaw)=0 := by + rw [smoothNoiseLaw,integral_withDensity_eq_integral_toReal_smul smoothNoiseDensity_measurable + (ae_of_all _ (fun _ => ENNReal.ofReal_lt_top))] + simp only [smoothNoiseDensity,ENNReal.toReal_ofReal (sq_nonneg _),smul_eq_mul] + have h := noiseFactor_centered (smoothNoiseRoot_contDiff.of_le (by norm_num)) + smoothNoiseRoot_compact smoothNoiseRoot_even .position (by decide) + convert! h using 1 + congr 1 + ext x + simp only [noiseFactor] + ring + +noncomputable def independentSmoothNoiseLaw (ι : Type*) : Measure (ι → ℝ) := + Measure.infinitePi (fun _ : ι => smoothNoiseLaw) + +instance independentSmoothNoiseLaw_probability (ι : Type*) : + IsProbabilityMeasure (independentSmoothNoiseLaw ι) := by + unfold independentSmoothNoiseLaw + infer_instance + +theorem independentSmoothNoiseLaw_independent (ι : Type*) : + iIndepFun (fun (i : ι) (x : ι → ℝ) => x i) (independentSmoothNoiseLaw ι) := + iIndepFun_infinitePi (fun _ => measurable_id) + +theorem independentSmoothNoiseLaw_map (ι : Type*) (i : ι) : + (independentSmoothNoiseLaw ι).map (fun x => x i)=smoothNoiseLaw := + Measure.infinitePi_map_eval _ i + +theorem independentSmoothNoiseLaw_bounded (ι : Type*) (i : ι) : + ∀ᵐx ∂independentSmoothNoiseLaw ι,x i∈Set.Icc (-1:ℝ) 1 := by + have hh := smoothNoiseLaw_bounded + rw [← independentSmoothNoiseLaw_map ι i] at hh + exact (ae_map_iff (measurable_pi_apply i).aemeasurable (by measurability)).mp hh + +theorem independentSmoothNoiseLaw_centered (ι : Type*) (i : ι) : + (∫x : ι → ℝ,x i ∂independentSmoothNoiseLaw ι)=0 := by + have hh := smoothNoiseLaw_centered + rw [← independentSmoothNoiseLaw_map ι i] at hh + rw [integral_map (measurable_pi_apply i).aemeasurable (by fun_prop)] at hh + exact hh + +end ActualNoiseLaw + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/AlignedCovariance.lean b/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/AlignedCovariance.lean new file mode 100644 index 0000000000000000000000000000000000000000..a689f4fcafc3b32665ea30c6a79b3e278f775141 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/AlignedCovariance.lean @@ -0,0 +1,67 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.RandomFields.FiniteCovariance + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section AlignedCovariance + +variable {A B H : Type*} [Group A] [Group H] + +theorem alignedGroup_reindex (t : A →* H) (x : B → H) (P Q : B → Prop) + (c : H) (R : A →* A) (b : B → B) + (ht : ∀ u, c*t u*c⁻¹ = t (R u)) (hx : ∀ i, c*x i*c⁻¹ = x (b i)) + (hb : ∀ i, P i → Q (b i)) {y : H} (hy : y ∈ alignedGroup t x P) : + c*y*c⁻¹ ∈ alignedGroup t x Q := by + let f : H →* H := (MulAut.conj c).toMonoidHom + have hh : alignedGroup t x P ≤ (alignedGroup t x Q).comap f := by + apply (Subgroup.closure_le _).mpr + rintro z ⟨i,hi,u,rfl⟩ + change c*(t u*x i*(t u)⁻¹)*c⁻¹ ∈ alignedGroup t x Q + have he : c*(t u*x i*(t u)⁻¹)*c⁻¹ = t (R u)*x (b i)*(t (R u))⁻¹ := by + rw [← ht,← hx] + group + rw [he] + exact alignedGroup_generator t x Q (b i) (hb i hi) (R u) + exact hh hy + +end AlignedCovariance + +section SourceAlignedCovariance + +variable (a : ℕ) (r : CutRing) (m : ℕ) (hm : 2 ≤ m) (M : ℕ) + +theorem source_aligned_constant_conjugation + (t : Multiplicative (FreeAbelianGroup (Fin m × Fin 2)) →* + BoundedRelationCover M (alternatingGenerator a r m hm)) + (c : alternatingGroup (Fin (m+1)) →* + BoundedRelationCover M (alternatingGenerator a r m hm)) + (R : alternatingGroup (Fin (m+1)) → + Multiplicative (FreeAbelianGroup (Fin m × Fin 2)) →* + Multiplicative (FreeAbelianGroup (Fin m × Fin 2))) + (ht : ∀ s k, c s*t k*(c s)⁻¹ = t (R s k)) + (hx : ∀ s (b : SmallConditional m), c s*PresentedGroup.of (Sum.inl b)*(c s)⁻¹ = + PresentedGroup.of (Sum.inl (reindexSmallConditional m s b))) + (s : alternatingGroup (Fin (m+1))) (I : Finset (Fin (m+1))) + {y : BoundedRelationCover M (alternatingGenerator a r m hm)} + (hy : y ∈ sourceAlignedGroup a r m hm M t I) : + c s*y*(c s)⁻¹ ∈ sourceAlignedGroup a r m hm M t (I.map s.val.toEmbedding) := by + apply alignedGroup_reindex t (fun b : SmallConditional m => PresentedGroup.of (Sum.inl b)) + (fun b => b.2.val.support ⊆ I) (fun b => b.2.val.support ⊆ I.map s.val.toEmbedding) + (c s) (R s) (reindexSmallConditional m s) (ht s) (hx s) _ hy + intro b hb + rw [reindexSmallConditional_support] + exact Finset.map_subset_map.mpr hb + +end SourceAlignedCovariance + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/AveragingAffinePairs.lean b/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/AveragingAffinePairs.lean new file mode 100644 index 0000000000000000000000000000000000000000..adef4a762e00d22072a30a9bb2733e4c153a0670 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/AveragingAffinePairs.lean @@ -0,0 +1,208 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.RandomFields.FlagAveragingMatrices +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.FullGroupAffineData + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section AveragingAffinePairs +open Classical MeasureTheory + +def SameAffineBranch {a m : ℕ} {v : ℝ×ℝ} (g : polygonFullGroup a m) + (z w : FlagTrackPoint a m v) : Prop := + z.1=w.1 ∧ flagAffineData g z.1 z.2=flagAffineData g w.1 w.2 + +theorem sameAffineBranch_inverse_iff {a m : ℕ} {v : ℝ×ℝ} (g : polygonFullGroup a m) + (z w : FlagTrackPoint a m v) : + SameAffineBranch g⁻¹ (flagAction g z) (flagAction g w) ↔ SameAffineBranch g z w := by + simp only [SameAffineBranch,flagAffineData_inverse,Prod.mk.injEq,neg_inj] + rw [(flagAffineData_action g z).1,(flagAffineData_action g w).1] + constructor + · rintro ⟨ht,hzw,hu⟩ + exact ⟨hzw,Prod.ext ht hu⟩ + · rintro ⟨hzw,he⟩ + exact ⟨congrArg Prod.fst he,hzw,congrArg Prod.snd he⟩ + +theorem flagAveragingMatrix_nezero_separator {a m D : ℕ} {v : ℝ×ℝ} + (χ : (ℝ×ℝ) → ℝ) (ρ N r η κ : ℝ) (z w : FlagSite a m D v) + (h : flagAveragingMatrix χ ρ N r η κ z w ≠ 0) : + z.val.1=w.val.1 ∧ separatorMatrix (thresholdLaw (r/N) κ) z.val.2 w.val.2 ≠ 0 := by + have ht : z.val.1=w.val.1 := by + by_contra ht + exact h (by simp [flagAveragingMatrix,ht]) + refine ⟨ht,fun hp => h ?_⟩ + simp [flagAveragingMatrix,hp] + +theorem flagAveragingMatrix_common_branch {a m D : ℕ} {v : ℝ×ℝ} (hD : 0 ?_⟩ + rcases hm with hm|hm + · obtain ⟨ht,hp⟩ := flagAveragingMatrix_nezero_separator χ ρ N r η κ z w hm + refine ⟨ht,?_⟩ + rw [← ht] + exact hcontrol (r/N) κ (div_pos hr hN) hκ ((le_max_left _ _).trans hbound) z.val.1 _ _ hp + · obtain ⟨ht,hp⟩ := flagAveragingMatrix_nezero_separator χ ρ N r η κ + (flagSiteAction hD g z) (flagSiteAction hD g w) hm + apply (sameAffineBranch_inverse_iff g z.val w.val).mp + refine ⟨ht,?_⟩ + change (flagAction g z.val).1=(flagAction g w.val).1 at ht + rw [← ht] + exact hcontrol' (r/N) κ (div_pos hr hN) hκ ((le_max_right _ _).trans hbound) + (flagAction g z.val).1 _ _ hp + +theorem planeTent_common_translation (s : ℝ) (x y b : ℝ×ℝ) : + planeTent s (x+b) (y+b)=planeTent s x y := by + simp only [planeTent,Prod.fst_add,Prod.snd_add,add_sub_add_right_eq_sub] + +theorem sameAffineBranch_kernels {a m D : ℕ} {v : ℝ×ℝ} (hD : 0 abs_nonneg _)) + +theorem flagAffineData_cost_bound {a m : ℕ} {v : ℝ×ℝ} (g : polygonFullGroup a m) : + ∃C : ℝ,0 ≤ C ∧ ∀z : FlagTrackPoint a m v,affineConjugateCost a (flagAffineData g z.1 z.2).2 ≤ C := by + obtain ⟨C,hC,h⟩ := flagAffineData_bounded (v:=v) g (affineConjugateCost a) + exact ⟨C,hC,fun z => (abs_le.mp (h z)).2⟩ + +end AveragingAffinePairs + +section AveragingEntryCovariance +open Classical MeasureTheory + +theorem unit_pair_sub_bound {a b c d : ℝ} + (hb : b∈Set.Icc (0:ℝ) 1) (hc : c∈Set.Icc (0:ℝ) 1) : + |a*b-c*d| ≤ |a-c|+|b-d| := by + calc + _ = |(a-c)*b+c*(b-d)| := by congr 1; ring + _ ≤ |(a-c)*b|+|c*(b-d)| := abs_add_le _ _ + _ = |a-c| *b+c*|b-d| := by rw [abs_mul,abs_mul,abs_of_nonneg hb.1,abs_of_nonneg hc.1] + _ ≤ _ := by nlinarith [abs_nonneg (a-c),abs_nonneg (b-d),hb.2,hc.2] + +theorem unit_triple_sub_bound {a b c d e f : ℝ} + (_ha : a∈Set.Icc (0:ℝ) 1) (hb : b∈Set.Icc (0:ℝ) 1) + (hc : c∈Set.Icc (0:ℝ) 1) (hd : d∈Set.Icc (0:ℝ) 1) + (he : e∈Set.Icc (0:ℝ) 1) : + |a*b*c-d*e*f| ≤ |a-d|+|b-e|+|c-f| := by + have hde : d*e∈Set.Icc (0:ℝ) 1 := ⟨mul_nonneg hd.1 he.1, + (mul_le_mul hd.2 he.2 he.1 zero_le_one).trans_eq (one_mul 1)⟩ + have h₁ : |a*b*c-d*e*f| ≤ |a*b-d*e|+|c-f| := unit_pair_sub_bound hc hde + have h₂ : |a*b-d*e| ≤ |a-d|+|b-e| := unit_pair_sub_bound hb hd + linarith + +theorem scaledSiteConjugate_action_diff {a m D : ℕ} {v : ℝ×ℝ} (hD : 0 abs_nonneg _) + have hz := cutoff_action_bound hD g z hN χ hLip + have hw := cutoff_action_bound hD g w hN χ hLip + rw [← hf.2] at hw + have hp := separatorMatrix_translation_bound (div_pos hr hN) hκ u z.val.2 w.val.2 + (flagAction g z.val).2 (flagAction g w.val).2 + (flagAffineData_action g z.val).2 (by rw [(flagAffineData_action g w.val).2,← hf.2]) + have ht : (flagSiteAction hD g z).val.1=(flagSiteAction hD g w).val.1 := by + change (flagAction g z.val).1=(flagAction g w.val).1 + rw [(flagAffineData_action g z.val).1,(flagAffineData_action g w.val).1,hf.2] + have hk := sameAffineBranch_kernels hD g z w hf (r/N) (N*η) + let T := planeTent (r/N) (flagSiteOrdinary z) (flagSiteOrdinary w)* + planeTent (N*η) (flagSiteConjugate z) (flagSiteConjugate w) + have hT₀ : 0 ≤ T := mul_nonneg (planeTent_nonneg _ _ _) (planeTent_nonneg _ _ _) + have hT₁ : T ≤ 1 := (mul_le_mul (planeTent_le_one _ _ _) (planeTent_le_one _ _ _) + (planeTent_nonneg _ _ _) zero_le_one).trans_eq (one_mul 1) + have he : (flagAveragingMatrix χ ρ N r η κ z w- + flagAveragingMatrix χ ρ N r η κ (flagSiteAction hD g z) (flagSiteAction hD g w))= + (χ (scaledSiteConjugate N z)*χ (scaledSiteConjugate N w)* + separatorMatrix (thresholdLaw (r/N) κ) z.val.2 w.val.2- + χ (scaledSiteConjugate N (flagSiteAction hD g z))*χ (scaledSiteConjugate N (flagSiteAction hD g w))* + separatorMatrix (thresholdLaw (r/N) κ) (flagAction g z.val).2 (flagAction g w.val).2)*T/d := by + rw [flagAveragingMatrix,flagAveragingMatrix,ite_eq_left hf.1,ite_eq_left ht,hk.1,hk.2] + change _=(_-_*separatorMatrix (thresholdLaw (r/N) κ) (flagSiteAction hD g z).val.2 + (flagSiteAction hD g w).val.2)*T/d + dsimp only [T,d] + ring + rw [he,abs_div,abs_mul,abs_of_pos hd,abs_of_nonneg hT₀] + have htrip := unit_triple_sub_bound (f:=separatorMatrix (thresholdLaw (r/N) κ) (flagAction g z.val).2 (flagAction g w.val).2) (hχ (scaledSiteConjugate N z)) (hχ (scaledSiteConjugate N w)) + (separatorMatrix_bounds (thresholdLaw (r/N) κ) z.val.2 w.val.2) + (hχ (scaledSiteConjugate N (flagSiteAction hD g z))) + (hχ (scaledSiteConjugate N (flagSiteAction hD g w))) + have hh := add_le_add (add_le_add hz hw) hp + have hmain := htrip.trans hh + change _ ≤ L*A/N+L*A/N+B*(r/N)/κ at hmain + calc + _ ≤ (L*A/N+L*A/N+B*(r/N)/κ)/d := by + apply (div_le_div_iff_of_pos_right hd).mpr + exact (mul_le_mul_of_nonneg_left hT₁ (abs_nonneg _)).trans (by simpa only [mul_one] using hmain) + _ = (2*L*A+B*(r/κ))/(N*d) := by field_simp; ring + _ ≤ (A+B)*(2*L+r/κ)/(N*d) := by + apply (div_le_div_iff_of_pos_right (mul_pos hN hd)).mpr + nlinarith [mul_nonneg hA (div_nonneg hr.le hκ.le),mul_nonneg hB hL] + _ = _ := rfl + +end AveragingEntryCovariance + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/AveragingUniformCovariance.lean b/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/AveragingUniformCovariance.lean new file mode 100644 index 0000000000000000000000000000000000000000..21ffecf2fb6a89b67bce67c0528a865ff06cf346 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/AveragingUniformCovariance.lean @@ -0,0 +1,250 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.RandomFields.AveragingAffinePairs + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section AveragingUniformCovariance +open Classical + +theorem flagAveragingMatrix_uniform_difference {a m D : ℕ} {v : ℝ×ℝ} (hD : 0 ?_⟩ + have hr₀ : 0 hm (Or.inl h)) + have hw : flagAveragingMatrix χ ρ N r η κ (flagSiteAction hD g z) (flagSiteAction hD g w)=0 := + not_not.mp (fun h => hm (Or.inr h)) + rw [hz,hw,sub_self,abs_zero] + positivity + +end AveragingUniformCovariance + +section AveragingSupportCounts +open Classical + +theorem pair_card_of_row_bound {α β : Type*} (T : Finset (α×β)) {B : ℝ} + (hB : ∀x∈T.image Prod.fst, ((T.filter (fun p => p.1=x)).image Prod.snd).card ≤ B) : + (T.card:ℝ) ≤ (T.image Prod.fst).card*B := by + have hrow (x : α) : ((T.filter (fun p => p.1=x)).image Prod.snd).card= + (T.filter (fun p => p.1=x)).card := by + apply Finset.card_image_of_injOn + intro p hp q hq he + exact Prod.ext ((Finset.mem_filter.mp hp).2.trans (Finset.mem_filter.mp hq).2.symm) he + rw [Finset.card_eq_sum_card_image Prod.fst T,Nat.cast_sum] + calc + _ ≤ ∑x∈T.image Prod.fst,B := Finset.sum_le_sum (fun x hx => by rw [← hrow x]; exact hB x hx) + _ = _ := by simp + +theorem flagAveragingMatrix_support_card {a m D : ℕ} {v : ℝ×ℝ} (hD : 0 hT (z,w) hp + (flagAveragingMatrix_cutoff_left χ ρ N r η κ z w h) + have hn : ‖scaledSiteConjugate N z‖ < K := lt_of_not_ge (fun he => hcz (hχ _ he)) + have hx := (norm_fst_le (scaledSiteConjugate N z)).trans_lt hn + have hy := (norm_snd_le (scaledSiteConjugate N z)).trans_lt hn + simp only [scaledSiteConjugate,Real.norm_eq_abs,abs_div,abs_of_pos hN] at hx hy + exact ⟨by nlinarith [(div_lt_iff₀ hN).mp hx],by nlinarith [(div_lt_iff₀ hN).mp hy]⟩ + have hc := pair_card_of_row_bound T (B:=(4*(D:ℝ)^2*r*η+2)^2) (fun z _ => ?_) + · exact hc.trans (mul_le_mul_of_nonneg_right hrows (sq_nonneg _)) + · apply flagAveragingMatrix_row_card hD χ ρ κ hN hr hη z + intro w hw + obtain ⟨⟨z',w⟩,hp,rfl⟩ := Finset.mem_image.mp hw + have he : z'=z := (Finset.mem_filter.mp hp).2 + subst z' + exact hT (z,w) (Finset.mem_filter.mp hp).1 + +theorem flagAveragingMatrix_support_quadratic {a m D : ℕ} {v : ℝ×ℝ} (hD : 0 flagAveragingMatrix χ ρ N r η κ p.1 p.2 ≠ 0) + let V := T.filter (fun p => flagAveragingMatrix χ ρ N r η κ (flagSiteAction hD g p.1) (flagSiteAction hD g p.2) ≠ 0) + have he : T ⊆ U∪V := by + intro p hp + by_cases h : flagAveragingMatrix χ ρ N r η κ p.1 p.2 ≠ 0 + · exact Finset.mem_union_left _ (Finset.mem_filter.mpr ⟨hp,h⟩) + · apply Finset.mem_union_right + apply Finset.mem_filter.mpr + refine ⟨hp,fun h' => hT p hp ?_⟩ + rw [not_not.mp h,h',sub_self] + have hu := flagAveragingMatrix_support_quadratic hD χ hK hχ ρ κ hN hr hη U + (fun p hp => (Finset.mem_filter.mp hp).2) + let e := (flagSitePermutation (v:=v) hD g).prodCongr (flagSitePermutation (v:=v) hD g) + have hv := flagAveragingMatrix_support_quadratic hD χ hK hχ ρ κ hN hr hη (V.image e) + (by intro p hp; obtain ⟨q,hq,rfl⟩ := Finset.mem_image.mp hp; exact (Finset.mem_filter.mp hq).2) + rw [Finset.card_image_of_injective V e.injective] at hv + have hn : (T.card:ℝ) ≤ U.card+V.card := by + exact_mod_cast (Finset.card_le_card he).trans (Finset.card_union_le _ _) + nlinarith + +end AveragingSupportCounts + +section FiniteCovarianceEnergy +open Classical + +theorem finite_correlation_bound {α : Type*} (T : Finset α) (f g : α → ℝ) + {A B H : ℝ} (hA : 0≤A) (hB : 0≤B) + (hf : ∀x∈T,|f x|≤A) (hg : ∀x∈T,|g x|≤B) + (hc : ∀S⊆T,(∀x∈S,f x≠0) → (S.card:ℝ)≤H) : + |∑x∈T,f x*g x| ≤ H*A*B := by + let S := T.filter (fun x => f x≠0) + have he : (∑x∈T,f x*g x)=∑x∈S,f x*g x := by + symm + apply Finset.sum_subset (Finset.filter_subset _ _) + intro x hx hxS + have hh : f x=0 := by simpa [S,hx] using hxS + simp [hh] + rw [he] + calc + _ ≤ ∑x∈S,|f x*g x| := Finset.abs_sum_le_sum_abs _ _ + _ ≤ ∑_x∈S,A*B := Finset.sum_le_sum (fun x hx => by + rw [abs_mul] + exact mul_le_mul (hf x (Finset.mem_filter.mp hx).1) + (hg x (Finset.mem_filter.mp hx).1) (abs_nonneg _) hA) + _ = (S.card:ℝ)*A*B := by simp; ring + _ ≤ H*A*B := by + have hh := hc S (Finset.filter_subset _ _) (fun x hx => (Finset.mem_filter.mp hx).2) + gcongr + +theorem finite_half_geometric_sum (I : Finset ℕ) : + ∑i∈I,(1/2:ℝ)^i ≤ 2 := by + have hi : I ⊆ Finset.range (I.sup id+1) := by + intro i hi + exact Finset.mem_range.mpr (Nat.lt_succ_of_le (Finset.le_sup (f:=id) hi)) + calc + _ ≤ ∑i∈Finset.range (I.sup id+1),(1/2:ℝ)^i := + Finset.sum_le_sum_of_subset_of_nonneg hi (fun _ _ _ => by positivity) + _ ≤ 2 := by + have h := geom_sum_Ico_le_of_lt_one (m:=0) (n:=I.sup id+1) + (show (0:ℝ) ≤ 1/2 by norm_num) (show (1/2:ℝ)<1 by norm_num) + norm_num at h ⊢ + exact h + +theorem finite_dyadic_row (I : Finset ℕ) (i : ℕ) : + ∑j∈I,(1/2:ℝ)^(Nat.dist i j) ≤ 4 := by + let J := I.filter (fun j => j ≤ i) + let K := I.filter (fun j => ¬j ≤ i) + have hJ : Set.InjOn (Nat.dist i) J := by + intro j hj k hk he + have hj' := (Finset.mem_filter.mp hj).2 + have hk' := (Finset.mem_filter.mp hk).2 + rw [Nat.dist_eq_sub_of_le_right hj',Nat.dist_eq_sub_of_le_right hk'] at he + omega + have hK : Set.InjOn (Nat.dist i) K := by + intro j hj k hk he + have hj' : i ≤ j := by have := (Finset.mem_filter.mp hj).2; omega + have hk' : i ≤ k := by have := (Finset.mem_filter.mp hk).2; omega + rw [Nat.dist_eq_sub_of_le hj',Nat.dist_eq_sub_of_le hk'] at he + omega + have hj : ∑j∈J,(1/2:ℝ)^(Nat.dist i j) ≤ 2 := by + rw [← Finset.sum_image hJ] + exact finite_half_geometric_sum _ + have hk : ∑j∈K,(1/2:ℝ)^(Nat.dist i j) ≤ 2 := by + rw [← Finset.sum_image hK] + exact finite_half_geometric_sum _ + have he := Finset.sum_filter_add_sum_filter_not I (fun j => j ≤ i) (fun j => (1/2:ℝ)^(Nat.dist i j)) + change (∑j∈J,_) + (∑j∈K,_) = _ at he + linarith + +theorem finite_dyadic_energy {α : Type*} (T : Finset α) (I : Finset ℕ) + (d : ℕ → α → ℝ) {C : ℝ} (hC : 0≤C) + (hc : ∀i∈I,∀j∈I,i ≤ j → |∑x∈T,d i x*d j x| ≤ C*((2:ℝ)^i/(2:ℝ)^j)) + (w : ℝ) : + ∑x∈T,(w*∑i∈I,d i x)^2 ≤ 4*C*(I.card:ℝ)*w^2 := by + have he (i j : ℕ) (hi : i∈I) (hj : j∈I) : + ∑x∈T,d i x*d j x ≤ C*(1/2:ℝ)^(Nat.dist i j) := by + have aux (i j : ℕ) (hij : i ≤ j) : (2:ℝ)^i/(2:ℝ)^j=(1/2:ℝ)^(Nat.dist i j) := by + rw [Nat.dist_eq_sub_of_le hij,div_pow,one_pow] + have hh : (2:ℝ)^j=(2:ℝ)^i*(2:ℝ)^(j-i) := by + rw [← pow_add,Nat.add_sub_of_le hij] + rw [hh] + field_simp + by_cases hij : i ≤ j + · exact (le_abs_self _).trans ((hc i hi j hj hij).trans_eq (by rw [aux i j hij])) + · have hji : j ≤ i := by omega + have h := (le_abs_self _).trans (hc j hj i hi hji) + simpa only [mul_comm, Nat.dist_comm,aux j i hji] using h + have hsum : ∑i∈I,∑j∈I,∑x∈T,d i x*d j x ≤ 4*C*(I.card:ℝ) := by + calc + _ ≤ ∑i∈I,∑j∈I,C*(1/2:ℝ)^(Nat.dist i j) := + Finset.sum_le_sum (fun i hi => Finset.sum_le_sum (fun j hj => he i j hi hj)) + _ = ∑i∈I,C*(∑j∈I,(1/2:ℝ)^(Nat.dist i j)) := by simp_rw [Finset.mul_sum] + _ ≤ ∑_i∈I,C*4 := Finset.sum_le_sum (fun i _ => mul_le_mul_of_nonneg_left (finite_dyadic_row I i) hC) + _ = _ := by simp; ring + have hid : (∑x∈T,(w*∑i∈I,d i x)^2)=w^2*(∑i∈I,∑j∈I,∑x∈T,d i x*d j x) := by + simp_rw [mul_pow,pow_two,Finset.sum_mul_sum] + rw [← Finset.mul_sum] + congr 1 + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro i hi + rw [Finset.sum_comm] + rw [hid] + nlinarith [mul_le_mul_of_nonneg_left hsum (sq_nonneg w)] + +end FiniteCovarianceEnergy + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/CanonicalPolygonCovariance.lean b/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/CanonicalPolygonCovariance.lean new file mode 100644 index 0000000000000000000000000000000000000000..fe2c014192a472904d5fcd7b5012b4cd77f0881e --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/CanonicalPolygonCovariance.lean @@ -0,0 +1,104 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.FinitePrimitiveResolution +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.TangentChartTemplates +import OAI.GroupTheory.SimpleAmenable.CentralCovers.PrimitiveCentralLaws + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section CanonicalPolygonCovariance +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + +theorem geometricSector_translate {ι : Type*} [Finite ι] + (I : Finset (Fin (m+1))) [Group.IsPerfect (alternatingGroup I)] + (b : Fin (m+1)) (hb : b ∉ I) (P : ι → Fin 5 × (CutRing × CutRing)) + (h : B.PrimitiveFamilyLaw I b hb P) (u : CutRing × CutRing) + (F : CommonFrame a r m hm I u) + (g : B.PrimitiveFamilyLaw I b hb (translatedTemplate P u)) + (V : polygonAlgebra a) + (hV : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) P i).val) V.val) : + (MulAut.conj (B.t F.k)).toMonoidHom.comp (B.geometricSector I b hb P h V) = + B.geometricSector I b hb (translatedTemplate P u) g (spatialTranslate u V) := by + apply CentralOn.lift_unique (coverMap M (alternatingGenerator a r m hm)) + (copyFamilyEval (B.primitiveFamily I b hb (translatedTemplate P u))).range g + · rintro x ⟨s,rfl⟩ + change ∃ w, copyFamilyEval (B.primitiveFamily I b hb (translatedTemplate P u)) w = + (MulAut.conj (B.t F.k)).toMonoidHom (B.geometricSector I b hb P h V s) + change ∃ w, copyFamilyEval (B.primitiveFamily I b hb (fun i => ((P i).1,u+(P i).2))) w = _ + rw [B.primitiveFamily_conjugate I b hb P u F,copyFamilyEval_comp] + obtain ⟨w,hw⟩ := B.geometricSector_mem I b hb P h V s + exact ⟨w,congrArg (MulAut.conj (B.t F.k)).toMonoidHom hw⟩ + · rintro x ⟨s,rfl⟩ + exact B.geometricSector_mem I b hb _ g _ s + · ext s : 1 + change coverMap M (alternatingGenerator a r m hm) + (B.t F.k * B.geometricSector I b hb P h V s * (B.t F.k)⁻¹) = + coverMap M (alternatingGenerator a r m hm) + (B.geometricSector I b hb (translatedTemplate P u) g (spatialTranslate u V) s) + rw [map_mul,map_mul,map_inv, + show coverMap M (alternatingGenerator a r m hm) (B.t F.k) = + sourceLatticeMap a r m hm F.k from DFunLike.congr_fun B.t_projection F.k, + show coverMap M (alternatingGenerator a r m hm) (B.geometricSector I b hb P h V s) = + conditionalAlternatingHom V (subtypeAlternatingHom I (universalProjection _ s)) from + DFunLike.congr_fun (B.geometricSector_projection I b hb P h V hV) s, + show coverMap M (alternatingGenerator a r m hm) + (B.geometricSector I b hb (translatedTemplate P u) g (spatialTranslate u V) s) = + conditionalAlternatingHom (spatialTranslate u V) + (subtypeAlternatingHom I (universalProjection _ s)) from + DFunLike.congr_fun (B.geometricSector_projection I b hb _ g _ + (translatedTemplate_resolved P V hV u)) s] + exact F.conditional_projection V _ + +variable [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + (hlarge : 15 < m+1) (h : B.AllPrimitiveLaws) (hr : 0 p.val + have hV : ResolvedBy (fun i => (primitiveTests (a := a) (r := r) P i).val) V.val := hS + rw [B.polygonStar_eq hlarge h hr P V hV, + B.polygonStar_eq hlarge h hr (translatedTemplate P u) (spatialTranslate u V) + (translatedTemplate_resolved P V hV u), + B.fullGeometricSector_inclusion hlarge P _ I hI b hb (h S P I b hb) V hV, + B.fullGeometricSector_inclusion hlarge (translatedTemplate P u) _ I hI b hb + (h S (translatedTemplate P u) I b hb) (spatialTranslate u V) + (translatedTemplate_resolved P V hV u)] + exact B.geometricSector_translate I b hb P _ u F _ V hV + +theorem polygonStar_frame_zero_commute + (I : Finset (Fin (m+1))) (hI : 5 ≤ I.card) [Group.IsPerfect (alternatingGroup I)] + (b : Fin (m+1)) (hb : b ∉ I) (F : CommonFrame a r m hm I 0) + (V : polygonAlgebra a) (s : UniversalExtension (alternatingGroup I)) : + Commute (B.t F.k) (B.polygonStar hlarge h hr V (universalMap (subtypeAlternatingHom I) s)) := by + have he := DFunLike.congr_fun (B.polygonStar_common_translate hlarge h hr I hI b hb 0 F V) s + have hz : spatialTranslate (0 : CutRing × CutRing) V = V := by + apply Subtype.ext + ext p + simp [spatialTranslate,translate_zero] + rw [hz] at he + change B.t F.k * B.polygonStar hlarge h hr V (universalMap (subtypeAlternatingHom I) s) * + (B.t F.k)⁻¹ = B.polygonStar hlarge h hr V (universalMap (subtypeAlternatingHom I) s) at he + have hh := congrArg (fun x => x * B.t F.k) he + exact show _*_ = _*_ from by simpa only [mul_assoc,inv_mul_cancel,mul_one] using hh + +end InitialCoverSystem +end CanonicalPolygonCovariance + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/CompactSignalEnergy.lean b/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/CompactSignalEnergy.lean new file mode 100644 index 0000000000000000000000000000000000000000..b44b10c6696c69544a5ff1206c1601a555733744 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/CompactSignalEnergy.lean @@ -0,0 +1,174 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Arithmetic.DyadicArithmetic +import OAI.GroupTheory.SimpleAmenable.RandomFields.PolygonApproxIdentity + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section CompactSignalEnergy +open Classical + +theorem compactSignal_energy {a m D : ℕ} {v : ℝ×ℝ} (hD : 0 q+ψ x) N z)^2 ≤ C^2 := by + obtain ⟨K,hK,hcompact⟩ := hs.exists_pos_le_norm + obtain ⟨L₀,L₁,hL₀,hL₁⟩ := compactSignal_uniform_constants ψ hψ hs + obtain ⟨C,hC,henergy⟩ := flagSignalDifference_energy (v:=v) hD g (fun x => q+ψ x) hK + (by intro x hx; rw [hcompact x hx,add_zero]) L₀.coe_nonneg (by + intro x y + simp only [add_sub_add_left_eq_sub] + have hh := hL₀.dist_le_mul x y + rw [Real.dist_eq,dist_eq_norm,Prod.norm_def] at hh + refine hh.trans (mul_le_mul_of_nonneg_left ?_ L₀.coe_nonneg) + simp only [Prod.fst_sub,Prod.snd_sub,Real.norm_eq_abs] + exact max_le (le_add_of_nonneg_right (abs_nonneg _)) (le_add_of_nonneg_left (abs_nonneg _))) + refine ⟨Real.sqrt C,Real.sqrt_nonneg _,?_⟩ + simpa only [Real.sq_sqrt hC] using henergy + +end CompactSignalEnergy + +section SourceSignalScales +open Classical Filter +open scoped Topology + +noncomputable def sourceDyadicMass (n : ℕ) : ℝ := + sourceDyadicWeight n*((sourceDyadicIndices n).card:ℝ) + +theorem sourceDyadicWeight_nonneg (n : ℕ) : 0 ≤ sourceDyadicWeight n := + Real.rpow_nonneg (Real.log_nonneg (sourceDyadicN_one_le n)) _ + +theorem sourceDyadicMass_nonneg (n : ℕ) : 0 ≤ sourceDyadicMass n := + mul_nonneg (sourceDyadicWeight_nonneg n) (Nat.cast_nonneg _) + +theorem sourceDyadicMass_tendsto : Tendsto sourceDyadicMass atTop atTop := by + let c := (4*Real.log 2)^(-3/4:ℝ) + have hc : 0 c*(n:ℝ)^(1/4:ℝ)) atTop atTop := + ((tendsto_rpow_atTop (show (0:ℝ)<1/4 by norm_num)).comp + (tendsto_natCast_atTop_atTop (R:=ℝ))).const_mul_atTop hc + apply tendsto_atTop_mono' atTop _ ht + filter_upwards [eventually_ge_atTop 1] with n hn + have hn' : (0:ℝ) lhs; rw [← Real.rpow_one (n:ℝ)] + rw [← Real.rpow_add hn'] + norm_num + calc + _ = sourceDyadicWeight n*(n:ℝ) := by rw [hw,← he]; ring + _ ≤ _ := by + unfold sourceDyadicMass + rw [sourceDyadicIndices_card,Nat.cast_add,Nat.cast_one] + exact mul_le_mul_of_nonneg_left (by linarith) (sourceDyadicWeight_nonneg n) + +theorem sourceDyadic_radius_eventually (A : ℝ) : + ∀ᶠn : ℕ in atTop,A ≤ (2:ℝ)^n := + (tendsto_pow_atTop_atTop_of_one_lt (show (1:ℝ)<2 by norm_num)).eventually_ge_atTop A + +theorem sourceDyadic_scale_bounds {n i : ℕ} (hi : i∈sourceDyadicIndices n) : + 1 ≤ (2:ℝ)^i ∧ (2:ℝ)^i ≤ sourceDyadicN n ∧ + (2:ℝ)^i/sourceDyadicN n ≤ (1/4:ℝ)^n := by + obtain ⟨hi₀,hi₁⟩ := Finset.mem_Icc.mp hi + have hp := pow_le_pow_right₀ (show (1:ℝ)≤2 by norm_num) hi₁ + have hN : sourceDyadicN n=((2:ℝ)^(2*n))^2 := by + unfold sourceDyadicN; rw [← pow_mul]; congr 1; omega + have h4 : (4:ℝ)^n=(2:ℝ)^(2*n) := by rw [pow_mul]; norm_num + refine ⟨one_le_pow₀ (by norm_num),?_,?_⟩ + · unfold sourceDyadicN + exact pow_le_pow_right₀ (by norm_num) (by omega) + · calc + _ ≤ (2:ℝ)^(2*n)/sourceDyadicN n := div_le_div_of_nonneg_right hp (sourceDyadicN_pos n).le + _ = _ := by rw [hN,div_pow,one_pow,h4]; field_simp + +end SourceSignalScales + +section WeightedResolvent +open Classical Matrix + +theorem finiteL2Norm_sum {ι α : Type*} [Fintype ι] (I : Finset α) (f : α → ι → ℝ) : + finiteL2Norm (∑i∈I,f i) ≤ ∑i∈I,finiteL2Norm (f i) := by + induction I using Finset.induction_on with + | empty => simp [finiteL2Norm] + | @insert i I hi ih => + rw [Finset.sum_insert hi,Finset.sum_insert hi] + exact (finiteL2Norm_add _ _).trans (add_le_add le_rfl ih) + +theorem finite_weighted_resolvent {ι α : Type*} [Fintype ι] [DecidableEq ι] + (I : Finset α) (M : α → Matrix ι ι ℝ) (hM : ∀i∈I,(M i).PosSemidef) + {w E : ℝ} (hw : 0 ≤ w) (hE : 0 ≤ E) (h : ι → ℝ) + (he : ∀i∈I,finiteL2Norm (M i*ᵥh-h) ≤ E) : + let B := w • ∑i∈I,M i + let W := w*(I.card:ℝ) + finiteL2Norm ((1+B)⁻¹*ᵥh) ≤ finiteL2Norm h/(1+W)+E := by + dsimp only + let B := w • ∑i∈I,M i + let W := w*(I.card:ℝ) + have hB : B.PosSemidef := (Matrix.posSemidef_sum I hM).smul hw + have hW : 0 ≤ W := mul_nonneg hw (Nat.cast_nonneg _) + have herr : B*ᵥh-W • h = w • ∑i∈I,(M i*ᵥh-h) := by + simp only [B,W,Matrix.smul_mulVec,Matrix.sum_mulVec,Finset.sum_sub_distrib, + Finset.sum_const, ← Nat.cast_smul_eq_nsmul ℝ,smul_sub,smul_smul] + have hb : finiteL2Norm (B*ᵥh-W • h) ≤ W*E := by + rw [herr,finiteL2Norm_smul,abs_of_nonneg hw] + calc + _ ≤ w*(∑i∈I,finiteL2Norm (M i*ᵥh-h)) := mul_le_mul_of_nonneg_left (finiteL2Norm_sum _ _) hw + _ ≤ w*(∑_i∈I,E) := mul_le_mul_of_nonneg_left (Finset.sum_le_sum he) hw + _ = _ := by simp [W,mul_assoc] + change finiteL2Norm ((1+B)⁻¹*ᵥh) ≤ finiteL2Norm h/(1+W)+E + have hi := finiteL2Norm_inverse_signal B hB W hW h + refine hi.trans ?_ + rw [add_div] + apply add_le_add le_rfl + apply (div_le_iff₀ (show 0<1+W by linarith)).mpr + exact hb.trans (by nlinarith) + +end WeightedResolvent + +section FiniteSupportEnergy +open Classical Matrix + +theorem finite_support_error_energy {ι : Type*} (J T : Finset ι) (hJT : J⊆T) + (M : Matrix ι ι ℝ) (h : ι → ℝ) + (hcol : ∀x y,y∉J → M x y*h y=0) + (e : ι → ℝ) (he : ∀x,e x=(∑y∈J,M x y*h y)-h x) + (hesupp : ∀x,x∉J → e x=0) : + finiteL2Norm ((fun (x y : T) => M x y)*ᵥ(fun x : T => h x)-(fun x : T => h x))^2= + ∑x∈J,(e x)^2 := by + have hsum (x : ι) : (∑y : T,M x y*h y)=∑y∈J,M x y*h y := by + rw [Finset.sum_coe_sort T (fun y => M x y*h y)] + exact (Finset.sum_subset hJT (fun y _ hy => hcol x y hy)).symm + have herr (x : T) : (((fun (x y : T) => M x y)*ᵥ(fun x : T => h x))- + (fun x : T => h x)) x=e x := by + simp only [Pi.sub_apply,Matrix.mulVec,dotProduct,hsum,he] + rw [finiteL2Norm_sq] + simp_rw [herr] + rw [Finset.sum_coe_sort T (fun x => (e x)^2)] + exact (Finset.sum_subset hJT (fun x _ hx => by rw [hesupp x hx]; norm_num)).symm + +theorem finiteL2Norm_le_of_energy {ι : Type*} [Fintype ι] {x : ι → ℝ} {A B c d : ℝ} + (hA : 0≤A) (hB : 0≤B) (hc : 0≤c) (hd : 0≤d) + (he : finiteL2Norm x^2 ≤ A*c^2+B*d^2) : + finiteL2Norm x ≤ Real.sqrt A*c+Real.sqrt B*d := by + have hsA := Real.sq_sqrt hA + have hsB := Real.sq_sqrt hB + have hnon : 0≤Real.sqrt A*c+Real.sqrt B*d := by positivity + apply (sq_le_sq₀ (finiteL2Norm_nonneg _) hnon).mp + refine he.trans ?_ + nlinarith [mul_nonneg (mul_nonneg (Real.sqrt_nonneg A) hc) (mul_nonneg (Real.sqrt_nonneg B) hd)] + +end FiniteSupportEnergy + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/CovarianceLimit.lean b/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/CovarianceLimit.lean new file mode 100644 index 0000000000000000000000000000000000000000..681baf28192dd90f25d44d48f3b1be5b0200a3c2 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/CovarianceLimit.lean @@ -0,0 +1,169 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.RandomFields.PolygonCovarianceEnergy +import OAI.GroupTheory.SimpleAmenable.RandomFields.FiniteFieldConcentration +import OAI.GroupTheory.SimpleAmenable.Arithmetic.DyadicArithmetic + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section SourceCovarianceLimit +open Classical Filter +open scoped Topology + +noncomputable def sourceFlagMatrix {a m D : ℕ} {v : ℝ×ℝ} + (χ : (ℝ×ℝ) → ℝ) (ρ η κ : ℝ) (n : ℕ) + (z y : FlagSite a m D v) : ℝ := + sourceDyadicWeight n*∑i∈sourceDyadicIndices n, + flagAveragingMatrix χ ρ (sourceDyadicN n) ((2:ℝ)^i) η κ z y + +theorem sourceFlagMatrix_covariance {a m D : ℕ} {v : ℝ×ℝ} (hD : 0 ∑p∈T n,(sourceFlagMatrix χ ρ η κ n p.1 p.2- + sourceFlagMatrix χ ρ η κ n (flagSiteAction hD g p.1) (flagSiteAction hD g p.2))^2) + atTop (nhds 0) := by + obtain ⟨R,C,hR,hC,he⟩ := flagMatrixDifference_dyadic_energy (v:=v) hD g χ hχ + hK hcompact hL hρ hη hκ hLip + have ht := sourceDyadicWeight_energy_tendsto.const_mul (4*C) + simp only [mul_zero] at ht + apply squeeze_zero' (Eventually.of_forall (fun n => Finset.sum_nonneg (fun _ _ => sq_nonneg _))) _ ht + filter_upwards [sourceDyadic_fine_eventually R hκ] with n hn + have h := he (sourceDyadicN n) (sourceDyadicN_one_le n) (sourceDyadicIndices n) hn + (sourceDyadicWeight n) (T n) + simpa only [sourceFlagMatrix,flagMatrixDifference,Finset.sum_sub_distrib,mul_sub,mul_assoc] using h + +end SourceCovarianceLimit + +section SourceFieldConcentration +open Classical Filter MeasureTheory ProbabilityTheory +open scoped Topology + +noncomputable def sourceActiveSites {a m D : ℕ} {v : ℝ×ℝ} + (hD : 0 (Set.Finite.mem_toFinset _).mp hz) + have hN := sourceDyadicN_one_le n + have hp : 2*(D:ℝ)^2*(sourceDyadicN n*K)+2 ≤ (2*(D:ℝ)^2*K+2)*sourceDyadicN n := by + nlinarith + calc + _ ≤ (m:ℝ)*(2*(D:ℝ)^2*(sourceDyadicN n*K)+2)^2 := hc + _ ≤ (m:ℝ)*((2*(D:ℝ)^2*K+2)*sourceDyadicN n)^2 := by gcongr + _ = _ := by ring + +theorem sourceDyadicWeight_eventually_sq_le_one : + ∀ᶠn : ℕ in atTop,(sourceDyadicWeight n)^2 ≤ 1 := by + filter_upwards [sourceDyadicWeight_energy_tendsto.eventually_lt_const zero_lt_one] with n hn + rw [sourceDyadicIndices_card,Nat.cast_add,Nat.cast_one] at hn + nlinarith [sq_nonneg (sourceDyadicWeight n),Nat.cast_nonneg (α:=ℝ) n] + +theorem sourceFlagMatrix_concentration {a m D : ℕ} {v : ℝ×ℝ} (hD : 0 μ.real {ω | ∃z : FlagSite a m D v, + ε ≤ |∑y∈sourceActiveSites hD hK n,sourceFlagMatrix χ ρ η κ n z y*X y ω|}) + atTop (nhds 0) := by + let C := 2*flagRowConstant D ρ η + let A := (m:ℝ)*(2*(D:ℝ)^2*K+2)^2 + let c := ε^2/(2*C^2) + have hC : 0 2*A*((4:ℝ)^n)^4*Real.exp (-c*(4:ℝ)^n)) atTop (nhds 0) := by + have ht := (tendsto_rpow_mul_exp_neg_mul_atTop_nhds_zero (4:ℝ) c hc₀).comp ht4 + have ht' := ht.const_mul (2*A) + simpa only [Real.rpow_ofNat,mul_zero,mul_assoc,Function.comp_def] using ht' + apply squeeze_zero' (Eventually.of_forall (fun _ => measureReal_nonneg)) _ ht + filter_upwards [sourceDyadicWeight_eventually_sq_le_one] with n hw + let S : Finset (FlagSite a m D v) := sourceActiveSites hD hK n + have heq : {ω | ∃z : FlagSite a m D v, + ε ≤ |∑y∈S,sourceFlagMatrix χ ρ η κ n z y*X y ω|} = + {ω | ∃z∈S,ε ≤ |∑y∈S,sourceFlagMatrix χ ρ η κ n z y*X y ω|} := by + ext ω + constructor + · rintro ⟨z,hz⟩ + refine ⟨z,?_,hz⟩ + by_contra hn + have hzero (y : FlagSite a m D v) := sourceFlagMatrix_support hD χ hK hcompact ρ η κ n z y hn + simp only [hzero,zero_mul,Finset.sum_const_zero,abs_zero] at hz + exact (not_le.mpr hε) hz + · rintro ⟨z,_,hz⟩; exact ⟨z,hz⟩ + have hrow (z : FlagSite a m D v) : ∑y∈S,(sourceFlagMatrix χ ρ η κ n z y)^2 ≤ C^2/(4:ℝ)^n := by + have h := flagAveragingMatrix_dyadic_row_energy hD χ hχ hρ (sourceDyadicN_pos n) hη hκ + (sourceDyadicIndices n) n (fun i hi => (Finset.mem_Icc.mp hi).1) (sourceDyadicWeight n) z S + have hpow : ((2:ℝ)^n)^2=(4:ℝ)^n := by rw [← pow_mul,pow_mul']; norm_num + calc + _ ≤ (C*sourceDyadicWeight n/(2:ℝ)^n)^2 := h + _ = C^2*(sourceDyadicWeight n)^2/(4:ℝ)^n := by rw [div_pow,mul_pow,hpow] + _ ≤ _ := by + apply div_le_div_of_nonneg_right _ (by positivity) + simpa only [mul_one] using mul_le_mul_of_nonneg_left hw (sq_nonneg C) + rw [heq] + calc + _ ≤ 2*(S.card:ℝ)*Real.exp (-ε^2/(2*(C^2/(4:ℝ)^n))) := + finite_matrix_noise_tail μ X hind hm hb hc S S (sourceFlagMatrix χ ρ η κ n) + (by positivity) (fun z _ => hrow z) hε.le + _ ≤ 2*(A*(sourceDyadicN n)^2)*Real.exp (-ε^2/(2*(C^2/(4:ℝ)^n))) := by + gcongr + exact sourceActiveSites_card hD hK n + _ = _ := by + have hexp : -ε^2/(2*(C^2/(4:ℝ)^n)) = -c*(4:ℝ)^n := by dsimp [c]; field_simp + rw [hexp] + have hpow : (sourceDyadicN n)^2=((4:ℝ)^n)^4 := by + unfold sourceDyadicN + rw [← pow_mul,← pow_mul] + rw [show (4:ℝ)=2^2 by norm_num,← pow_mul] + congr 1 + omega + rw [hpow] + ring + +end SourceFieldConcentration + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/FieldHS.lean b/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/FieldHS.lean new file mode 100644 index 0000000000000000000000000000000000000000..da0ebb13a02bd522a65d73fe6d0eaee13f4f15b0 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/FieldHS.lean @@ -0,0 +1,235 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.RandomFields.CovarianceLimit +import OAI.GroupTheory.SimpleAmenable.RandomFields.CompactSignalEnergy +import OAI.GroupTheory.SimpleAmenable.RandomFields.FiniteLawDistance + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section SourceFieldHS +open Classical Filter Matrix +open scoped Topology + +theorem sourceFlagMatrix_HS_tendsto {a m D : ℕ} {v : ℝ×ℝ} (hD : 0 matrixHSNorm (Matrix.of (fun (z w : T n) => + sourceFlagMatrix χ ρ η κ n (flagSiteAction hD g⁻¹ z.val) (flagSiteAction hD g⁻¹ w.val)- + sourceFlagMatrix χ ρ η κ n z.val w.val))) atTop (nhds 0) := by + have hh := (sourceFlagMatrix_covariance hD g⁻¹ χ hχ hK hcompact hL hρ hη hκ hLip + (fun n => (T n).product (T n))).sqrt + rw [Real.sqrt_zero] at hh + convert hh using 1 + funext n + unfold matrixHSNorm + congr 1 + change (∑z : T n,∑w : T n,(sourceFlagMatrix χ ρ η κ n (flagSiteAction hD g⁻¹ z.val) + (flagSiteAction hD g⁻¹ w.val)-sourceFlagMatrix χ ρ η κ n z.val w.val)^2)=_ + let f : FlagSite a m D v × FlagSite a m D v → ℝ := fun p => + (sourceFlagMatrix χ ρ η κ n p.1 p.2-sourceFlagMatrix χ ρ η κ n + (flagSiteAction hD g⁻¹ p.1) (flagSiteAction hD g⁻¹ p.2))^2 + symm + calc + _ = ∑z∈T n,∑w∈T n,f (z,w) := by + convert! Finset.sum_product (T n) (T n) f using 1 + _ = ∑z : T n,∑w : T n,f (z.val,w.val) := by + rw [← Finset.sum_coe_sort (T n)] + apply Finset.sum_congr rfl + intro z _ + exact (Finset.sum_coe_sort (T n) _).symm + _ = _ := by + apply Finset.sum_congr rfl + intro z _ + apply Finset.sum_congr rfl + intro w _ + exact sub_sq_comm _ _ + +end SourceFieldHS + +section SmallTransportParameters +open Classical + +theorem smallTransportParameters {M C₁ C₂ ε : ℝ} (hM : 0 x (e.symm z) + +theorem fieldReindex_measurable {ι : Type*} (e : ι ≃ ι) : Measurable (fieldReindex e) := + Measurable.of_eval (fun z => measurable_pi_apply (e.symm z)) + +theorem independentSmoothNoiseLaw_reindex {ι : Type*} (e : ι ≃ ι) : + (independentSmoothNoiseLaw ι).map (fieldReindex e)=independentSmoothNoiseLaw ι := by + convert! Measure.infinitePi_map_piCongrLeft (fun _ : ι => smoothNoiseLaw) e using 1 + congr 1 + funext x z + simpa only [Equiv.apply_symm_apply,fieldReindex] using + (MeasurableEquiv.piCongrLeft_apply_apply (β:=fun _ : ι => ℝ) e x (e.symm z)).symm + +theorem finiteCoefficientField_enlarge {ι : Type*} (J T : Finset ι) (hJT : J⊆T) + (a : ι → ℝ) (B : Matrix ι ι ℝ) (hcol : ∀z w,w∉J → B z w=0) : + finiteCoefficientField T a B=finiteCoefficientField J a B := by + ext x z + unfold finiteCoefficientField + congr 1 + exact (Finset.sum_subset hJT (fun w _ hw => by rw [hcol z w hw,zero_mul])).symm + +theorem finiteCoefficientField_covariance {ι : Type*} (J : Finset ι) + (a : ι → ℝ) (B : Matrix ι ι ℝ) (e : ι ≃ ι) : + ((independentSmoothNoiseLaw ι).map (finiteCoefficientField J a B)).map (fieldReindex e)= + (independentSmoothNoiseLaw ι).map + (finiteCoefficientField (J.image e) (fun z => a (e.symm z)) + (fun z w => B (e.symm z) (e.symm w))) := by + rw [Measure.map_map (fieldReindex_measurable e) (finiteCoefficientField_measurable J a B)] + have he : fieldReindex e ∘ finiteCoefficientField J a B= + finiteCoefficientField (J.image e) (fun z => a (e.symm z)) + (fun z w => B (e.symm z) (e.symm w)) ∘ fieldReindex e := by + ext x z + simp only [Function.comp_apply,fieldReindex,finiteCoefficientField] + rw [Finset.sum_image] + · simp only [Equiv.symm_apply_apply] + · intro i _ j _ hh + exact e.injective hh + rw [he] + have hh := Measure.map_map + (finiteCoefficientField_measurable (J.image e) (fun z => a (e.symm z)) + (fun z w => B (e.symm z) (e.symm w))) (fieldReindex_measurable e) + (μ:=independentSmoothNoiseLaw ι) + rw [independentSmoothNoiseLaw_reindex] at hh + exact hh.symm + +end FiniteFieldCovariance + +section SourceFieldLaw +open Classical Matrix MeasureTheory Filter +open scoped Topology + +theorem sourceFlagMatrix_posSemidef {a m D : ℕ} {v : ℝ×ℝ} + (χ : (ℝ×ℝ) → ℝ) {ρ η κ : ℝ} (hρ : 0<ρ) (hκ : 0<κ) (n : ℕ) : + (Matrix.of (sourceFlagMatrix (a:=a) (m:=m) (D:=D) (v:=v) χ ρ η κ n)).PosSemidef := by + have hh := (Matrix.posSemidef_sum (sourceDyadicIndices n) (fun i _ => + flagAveragingMatrix_posSemidef (a:=a) (m:=m) (D:=D) (v:=v) (η:=η) χ hρ + (sourceDyadicN_pos n) (show 0<(2:ℝ)^i by positivity) hκ)).smul (sourceDyadicWeight_nonneg n) + convert! hh using 1 + ext z w + simp only [Matrix.of_apply,sourceFlagMatrix,Matrix.smul_apply,smul_eq_mul,Matrix.sum_apply] + +theorem sourceFlagMatrix_box_support {a m D : ℕ} {v : ℝ×ℝ} (hD : 0 flagMeanSignal θ (sourceDyadicN n) (flagSiteAction hD g⁻¹ z)) + (Matrix.of (fun z w => sourceFlagMatrix χ ρ η κ n (flagSiteAction hD g⁻¹ z) (flagSiteAction hD g⁻¹ w)))) := by + unfold sourceSmoothFieldLaw + rw [finiteCoefficientField_covariance] + congr 1 + symm + apply finiteCoefficientField_enlarge + · exact Finset.subset_union_right + · intro z w hw + apply sourceFlagMatrix_box_support hD χ hL hχc ρ η κ n _ _ + right + intro hm + apply hw + exact Finset.mem_image.mpr ⟨(flagSitePermutation hD g).symm w,hm, + (flagSitePermutation hD g).apply_symm_apply w⟩ + +end SourceFieldLaw + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/FieldSignalData.lean b/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/FieldSignalData.lean new file mode 100644 index 0000000000000000000000000000000000000000..4f310d45eedd3df5edc82b0649b8a5b58bbeb6a7 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/FieldSignalData.lean @@ -0,0 +1,80 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.RandomFields.ThresholdField + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section FieldSignalData +open Classical Set +open scoped ContDiff + +structure FieldSignalData where + ψ : (ℝ×ℝ) → ℝ + χ : (ℝ×ℝ) → ℝ + smooth : ContDiff ℝ 2 ψ + compact : HasCompactSupport ψ + q : ℝ + K : ℝ + L : ℝ + Λ : ℝ + L_pos : 0 ⟨χ.nonneg,χ.le_one⟩,?_,?_,Λ.coe_nonneg,?_⟩,rfl,rfl⟩ + · intro x hx + exact χ.one_of_mem_closedBall (by simpa only [Metric.mem_closedBall,dist_zero_right,χ] using hx) + · intro x hx + exact χ.zero_of_le_dist (by simpa only [dist_zero_right,χ] using hx) + · intro x y + have hh := hΛ.dist_le_mul x y + rw [Real.dist_eq,dist_eq_norm,Prod.norm_def] at hh + apply hh.trans + apply mul_le_mul_of_nonneg_left _ Λ.coe_nonneg + simp only [Prod.fst_sub,Prod.snd_sub,Real.norm_eq_abs] + exact max_le (le_add_of_nonneg_right (abs_nonneg _)) (le_add_of_nonneg_left (abs_nonneg _)) + +namespace FieldSignalData +noncomputable def signal (S : FieldSignalData) (x : ℝ×ℝ) : ℝ := S.q+S.ψ x + +noncomputable def realLaw (S : FieldSignalData) {a m D : ℕ} {v : ℝ×ℝ} (hD : 0 FreeGroup.lift f (w j)) ht k * + (c s)⁻¹ = commutingFamilyHom (fun j => FreeGroup.lift f (w j)) ht (R s k)) : + ∃ L : ℕ, ∀ M : ℕ, L ≤ M → + ∃ c' : C →* BoundedRelationCover M f, + (coverMap M f).comp c' = c ∧ + (∀ s, c' s = PresentedGroup.mk (shortRelations M f) (W s)) ∧ + ∀ t : Multiplicative (FreeAbelianGroup β) →* BoundedRelationCover M f, + (∀ i, t (Multiplicative.ofAdd (FreeAbelianGroup.of i)) = + PresentedGroup.mk (shortRelations M f) (w i)) → + (∀ s k, c' s*t k*(c' s)⁻¹ = t (R s k)) ∧ + (∀ s i, c' s*PresentedGroup.mk (shortRelations M f) (v i)*(c' s)⁻¹ = + PresentedGroup.mk (shortRelations M f) (v (b s i))) := by + classical + let T := Multiplicative (FreeAbelianGroup β) + let q : T →* G := commutingFamilyHom (fun j => FreeGroup.lift f (w j)) ht + let P : FreeGroup β →* FreeGroup α := FreeGroup.lift w + have he : (FreeGroup.lift f).comp P = q.comp (translationWordMap β) := by + ext j + simp only [MonoidHom.comp_apply,P,translationWordMap,FreeGroup.lift_apply_of] + exact (commutingFamilyHom_of (fun j => FreeGroup.lift f (w j)) ht j).symm + choose V hV using fun z : C × β => translationWordMap_surjective + (R z.1 (Multiplicative.ofAdd (FreeAbelianGroup.of z.2))) + obtain ⟨L₁,hL₁⟩ := finite_table_lift_eventually f c W hW + obtain ⟨L₂,hL₂⟩ := finite_word_equalities_eventually f + (fun z : C × β => W z.1*w z.2*(W z.1)⁻¹) (fun z => P (V z)) (by + rintro ⟨s,i⟩ + simp only [map_mul,map_inv,hW] + have hv := DFunLike.congr_fun he (V (s,i)) + simp only [MonoidHom.comp_apply,hV] at hv + rw [hv,← hR s] + congr 2 + exact (commutingFamilyHom_of (fun j => FreeGroup.lift f (w j)) ht i).symm) + obtain ⟨L₃,hL₃⟩ := finite_word_equalities_eventually f + (fun z : C × ι => W z.1*v z.2*(W z.1)⁻¹) (fun z => v (b z.1 z.2)) (by + intro z + simpa only [map_mul,map_inv,hW] using hx z.1 z.2) + refine ⟨max L₁ (max L₂ L₃),fun M hM => ?_⟩ + obtain ⟨c',hc',hcW⟩ := hL₁ M ((le_max_left _ _).trans hM) + refine ⟨c',hc',hcW,fun t ht' => ⟨?_,?_⟩⟩ + · have he' : t.comp (translationWordMap β) = + (PresentedGroup.mk (shortRelations M f)).comp P := by + ext j + simpa [translationWordMap,P] using ht' j + intro s k + have hh : (MulAut.conj (c' s)).toMonoidHom.comp t = t.comp (R s) := by + apply freeAbelianHom_ext + intro i + change c' s*t (Multiplicative.ofAdd (FreeAbelianGroup.of i))*(c' s)⁻¹ = _ + rw [hcW,ht'] + have hv := DFunLike.congr_fun he' (V (s,i)) + simp only [MonoidHom.comp_apply,hV] at hv + rw [MonoidHom.comp_apply,hv] + simpa only [map_mul,map_inv] using hL₂ M + ((le_max_left _ _).trans ((le_max_right _ _).trans hM)) (s,i) + exact DFunLike.congr_fun hh k + · intro s i + rw [hcW] + simpa only [map_mul,map_inv] using hL₃ M + ((le_max_right _ _).trans ((le_max_right _ _).trans hM)) (s,i) + +end FiniteCovariance + +section SourceConstantCovariance + +variable (a : ℕ) (r : CutRing) (m : ℕ) (hm : 2 ≤ m) + +noncomputable def reindexSmallConditional (s : alternatingGroup (Fin (m+1))) + (b : SmallConditional m) : SmallConditional m := + (b.1,⟨s.val*b.2.val*s.val⁻¹, (alternatingGroup (Fin (m+1))).mul_mem + ((alternatingGroup (Fin (m+1))).mul_mem s.property b.2.property.1) + ((alternatingGroup (Fin (m+1))).inv_mem s.property), + by simpa only [Equiv.Perm.card_support_conj] using b.2.property.2⟩) + +@[simp] theorem reindexSmallConditional_support (s : alternatingGroup (Fin (m+1))) + (b : SmallConditional m) : + (reindexSmallConditional m s b).2.val.support = b.2.val.support.map s.val.toEmbedding := + Equiv.Perm.support_conj + +theorem constant_conjugate_conditional (U : polygonAlgebra a) + (s z : Equiv.Perm (Fin (m+1))) : + conditionalHom (wholePolygon a) s * conditionalHom U z * + (conditionalHom (wholePolygon a) s)⁻¹ = conditionalHom U (s*z*s⁻¹) := by + apply Subtype.ext + apply Equiv.ext + intro p + change conditionalPerm (wholePolygon a) s + (conditionalPerm U z ((conditionalPerm (wholePolygon a) s).symm p)) = + conditionalPerm U (s*z*s⁻¹) p + by_cases hp : p.2 ∈ U.val <;> + simp [conditionalPerm,wholePolygon,hp,Equiv.Perm.mul_apply] + +theorem source_constant_lattice_action : + ∃ R : alternatingGroup (Fin (m+1)) → + Multiplicative (FreeAbelianGroup (Fin m × Fin 2)) →* + Multiplicative (FreeAbelianGroup (Fin m × Fin 2)), + ∀ s k, conditionalAlternatingHom (wholePolygon a) s * + sourceLatticeMap a r m hm k * + (conditionalAlternatingHom (wholePolygon a) s)⁻¹ = + sourceLatticeMap a r m hm (R s k) := by + classical + let T := Multiplicative (FreeAbelianGroup (Fin m × Fin 2)) + let q := sourceLatticeMap a r m hm + let c := conditionalAlternatingHom (a := a) (m := m+1) (wholePolygon a) + have hb : ∀ (s : alternatingGroup (Fin (m+1))) (i : Fin m × Fin 2), + ∃ k : T, q k = c s*q (Multiplicative.ofAdd (FreeAbelianGroup.of i))*(c s)⁻¹ := by + intro s i + let v : CutRing × CutRing := if i.2 = 0 then (cutTau,0) else (0,cutTau) + obtain ⟨k,hk⟩ := sourceLatticeFullMap_difference a r m hm + (s.val (Fin.last m)) (s.val i.1.castSucc) v + refine ⟨k,?_⟩ + apply Subtype.ext + change sourceLatticeFullMap a r m hm k = + conditionalHom (wholePolygon a) s.val * + sourceLatticeFullMap a r m hm (Multiplicative.ofAdd (FreeAbelianGroup.of i)) * + (conditionalHom (wholePolygon a) s.val)⁻¹ + rw [hk,sourceLatticeFullMap_of] + change trackTranslation (a := a) _ = conditionalHom (wholePolygon a) s.val * + trackTranslation (Pi.single i.1.castSucc v - Pi.single (Fin.last m) v) * + (conditionalHom (wholePolygon a) s.val)⁻¹ + rw [constant_conjugate_translation] + congr 1 + funext j + simp only [Pi.sub_apply,Pi.single_apply] + congr 1 <;> congr 1 <;> exact propext (Equiv.symm_apply_eq s.val).symm + choose B hB using hb + let R := fun s => commutingFamilyHom (B s) (fun _ _ => Commute.all _ _) + refine ⟨R,fun s k => ?_⟩ + have he : (MulAut.conj (c s)).toMonoidHom.comp q = q.comp (R s) := by + apply freeAbelianHom_ext + intro i + rw [MonoidHom.comp_apply,MonoidHom.comp_apply] + change c s*q (Multiplicative.ofAdd (FreeAbelianGroup.of i))*(c s)⁻¹ = + q ((commutingFamilyHom (B s) (fun _ _ => Commute.all _ _)) + (Multiplicative.ofAdd (FreeAbelianGroup.of i))) + rw [commutingFamilyHom_of,hB] + exact DFunLike.congr_fun he k + +theorem source_constant_covariance_eventually + (hr : 0 < ordinary r ∧ ordinary r < 1/2) (hm' : 15 ≤ m+1) : + ∃ L : ℕ, ∀ M : ℕ, L ≤ M → + ∃ c : alternatingGroup (Fin (m+1)) →* + BoundedRelationCover M (alternatingGenerator a r m hm), + (coverMap M (alternatingGenerator a r m hm)).comp c = + conditionalAlternatingHom (wholePolygon a) ∧ + (∀ b : {σ : Equiv.Perm (Fin (m+1)) // σ ∈ alternatingGroup (Fin (m+1)) ∧ + σ.support.card ≤ 5}, c ⟨b.val,b.property.1⟩ = + PresentedGroup.of (sourceConditionalLabel m (0,b))) ∧ + ∃ R : alternatingGroup (Fin (m+1)) → + Multiplicative (FreeAbelianGroup (Fin m × Fin 2)) →* + Multiplicative (FreeAbelianGroup (Fin m × Fin 2)), + ∀ t : Multiplicative (FreeAbelianGroup (Fin m × Fin 2)) →* + BoundedRelationCover M (alternatingGenerator a r m hm), + (∀ i, t (Multiplicative.ofAdd (FreeAbelianGroup.of i)) = + PresentedGroup.of (Sum.inr i)) → + (∀ s k, c s*t k*(c s)⁻¹ = t (R s k)) ∧ + (∀ s (b : SmallConditional m), c s*PresentedGroup.of (Sum.inl b)*(c s)⁻¹ = + PresentedGroup.of (Sum.inl (reindexSmallConditional m s b))) := by + classical + let f := alternatingGenerator a r m hm + let c := conditionalAlternatingHom (a := a) (m := m+1) (wholePolygon a) + choose W hW using fun s => alternatingGenerator_surjective a r m hr hm' hm (c s) + obtain ⟨R,hR⟩ := source_constant_lattice_action a r m hm + obtain ⟨L,hL⟩ := finite_covariance_eventually f c W hW + (fun i : Fin m × Fin 2 => FreeGroup.of (show SourceGeneratorLabel m from Sum.inr i)) + (fun b : SmallConditional m => FreeGroup.of (show SourceGeneratorLabel m from Sum.inl b)) + (fun i j => by + change Commute (f (Sum.inr i)) (f (Sum.inr j)) + exact source_translation_commute a r m hm i j) + R (reindexSmallConditional m) (by + intro s b + change c s*f (Sum.inl b)*(c s)⁻¹ = f (Sum.inl (reindexSmallConditional m s b)) + apply Subtype.ext + exact constant_conjugate_conditional a m (initialTest a r b.1) s.val b.2.val) + hR + obtain ⟨L₀,hL₀⟩ := finite_word_equalities_eventually f + (fun b : {σ : Equiv.Perm (Fin (m+1)) // σ ∈ alternatingGroup (Fin (m+1)) ∧ + σ.support.card ≤ 5} => W ⟨b.val,b.property.1⟩) + (fun b => FreeGroup.of (sourceConditionalLabel m (0,b))) (by + intro b + rw [hW,FreeGroup.lift_apply_of] + rfl) + refine ⟨max L L₀,fun M hM => ?_⟩ + obtain ⟨c',hc',hcW,hc⟩ := hL M ((le_max_left _ _).trans hM) + refine ⟨c',hc',?_,R,hc⟩ + intro b + rw [hcW] + exact hL₀ M ((le_max_right _ _).trans hM) b + +end SourceConstantCovariance + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/FiniteFieldConcentration.lean b/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/FiniteFieldConcentration.lean new file mode 100644 index 0000000000000000000000000000000000000000..d61871242cbdfb3e6711102ab8028d90e777c244 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/FiniteFieldConcentration.lean @@ -0,0 +1,79 @@ +import Mathlib + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section FiniteFieldConcentration +open Classical MeasureTheory ProbabilityTheory +open scoped NNReal + +theorem subgaussian_parameter_mono {Ω : Type*} [MeasurableSpace Ω] {μ : Measure Ω} + {X : Ω → ℝ} {c d : ℝ≥0} (h : HasSubgaussianMGF X c μ) (hcd : c≤d) : + HasSubgaussianMGF X d μ where + integrable_exp_mul := h.integrable_exp_mul + mgf_le t := (h.mgf_le t).trans (Real.exp_le_exp.mpr (by + exact div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_right (by exact_mod_cast hcd) (sq_nonneg t)) (by norm_num))) + +theorem finite_weighted_noise_tail {Ω ι : Type*} [MeasurableSpace Ω] (μ : Measure Ω) + [IsProbabilityMeasure μ] (X : ι → Ω → ℝ) (hind : iIndepFun X μ) + (hm : ∀i,AEMeasurable (X i) μ) (hb : ∀i,∀ᵐω ∂μ,X i ω∈Set.Icc (-1:ℝ) 1) + (hc : ∀i,∫ω,X i ω ∂μ=0) (S : Finset ι) (b : ι → ℝ) + {V ε : ℝ} (hV : 0≤V) (he : ∑i∈S,(b i)^2 ≤ V) (hε : 0≤ε) : + μ.real {ω | ε ≤ |∑i∈S,b i*X i ω|} ≤ 2*Real.exp (-ε^2/(2*V)) := by + have hsub (i : ι) : HasSubgaussianMGF (X i) 1 μ := by + have h := hasSubgaussianMGF_of_mem_Icc_of_integral_eq_zero (hm i) (hb i) (hc i) + norm_num at h + exact h + have hi := hind.comp (fun i x => b i*x) (fun i => measurable_const.mul measurable_id) + have hs : HasSubgaussianMGF (fun ω => ∑i∈S,b i*X i ω) + (∑i∈S,NNReal.mk ((b i)^2) (sq_nonneg _)) μ := by + apply HasSubgaussianMGF.sum_of_iIndepFun hi + intro i hi + have h := (hsub i).const_mul (b i) + change HasSubgaussianMGF (fun ω => b i*X i ω) ((NNReal.mk ((b i)^2) (sq_nonneg _))*1) μ at h + simpa only [mul_one,Function.comp_def] using h + have hv : HasSubgaussianMGF (fun ω => ∑i∈S,b i*X i ω) (NNReal.mk V hV) μ := by + apply subgaussian_parameter_mono hs + apply NNReal.coe_le_coe.mp + simpa only [NNReal.coe_sum,NNReal.coe_mk] using he + have hset : {ω | ε ≤ |∑i∈S,b i*X i ω|} ⊆ + {ω | ε ≤ ∑i∈S,b i*X i ω} ∪ {ω | ε ≤ -(∑i∈S,b i*X i ω)} := by + intro ω hω + change ε ≤ |∑i∈S,b i*X i ω| at hω + rcases le_abs.mp hω with h|h + · exact Or.inl h + · exact Or.inr h + have hh := (measureReal_mono (μ:=μ) hset).trans (measureReal_union_le _ _) + have hpos := hv.measure_ge_le hε + have hneg := hv.neg.measure_ge_le hε + dsimp at hpos hneg + linarith + +theorem finite_matrix_noise_tail {Ω ι ζ : Type*} [MeasurableSpace Ω] (μ : Measure Ω) + [IsProbabilityMeasure μ] (X : ι → Ω → ℝ) (hind : iIndepFun X μ) + (hm : ∀i,AEMeasurable (X i) μ) (hb : ∀i,∀ᵐω ∂μ,X i ω∈Set.Icc (-1:ℝ) 1) + (hc : ∀i,∫ω,X i ω ∂μ=0) (S : Finset ι) (T : Finset ζ) (B : ζ → ι → ℝ) + {V ε : ℝ} (hV : 0≤V) (he : ∀z∈T,∑i∈S,(B z i)^2 ≤ V) (hε : 0≤ε) : + μ.real {ω | ∃z∈T,ε ≤ |∑i∈S,B z i*X i ω|} ≤ + 2*(T.card:ℝ)*Real.exp (-ε^2/(2*V)) := by + have heq : {ω | ∃z∈T,ε ≤ |∑i∈S,B z i*X i ω|}= + ⋃z∈T,{ω | ε ≤ |∑i∈S,B z i*X i ω|} := by ext; simp + rw [heq] + calc + _ ≤ ∑z∈T,μ.real {ω | ε ≤ |∑i∈S,B z i*X i ω|} := measureReal_biUnion_finset_le _ _ + _ ≤ ∑_z∈T,2*Real.exp (-ε^2/(2*V)) := Finset.sum_le_sum (fun z hz => + finite_weighted_noise_tail μ X hind hm hb hc S (B z) hV (he z hz) hε) + _ = _ := by simp; ring + +end FiniteFieldConcentration + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/FiniteLawDistance.lean b/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/FiniteLawDistance.lean new file mode 100644 index 0000000000000000000000000000000000000000..4b55049da65bf173418ebb384ba6985c59df5307 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/FiniteLawDistance.lean @@ -0,0 +1,175 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.RandomFields.HellingerDistance +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.ObservableDistance + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section FiniteLawDistance +open Classical Matrix MeasureTheory + +noncomputable def smoothNoiseTransportError {ι : Type*} [Fintype ι] + (B C : Matrix ι ι ℝ) (h : ι → ℝ) : ℝ := + 2*Real.sqrt (affineNoiseEnergyConstant smoothNoiseRoot*(matrixHSNorm (C-B)^2+ + ((1+matrixHSNorm (C-B))*finiteL2Norm ((1+B)⁻¹*ᵥh))^2)) + +theorem finiteAffineNoiseLaw_close {ι : Type*} [Fintype ι] + (B C : Matrix ι ι ℝ) (hB : B.PosSemidef) (hC : C.PosSemidef) (a h : ι → ℝ) : + ObservableClose (finiteAffineNoiseLaw (1+B) a) (finiteAffineNoiseLaw (1+C) (a+h)) + (smoothNoiseTransportError B C h) := by + rw [finiteAffineNoiseLaw_density _ _ (Matrix.PosDef.one.add_posSemidef hB).det_pos, + finiteAffineNoiseLaw_density _ _ (Matrix.PosDef.one.add_posSemidef hC).det_pos] + have hf : ContDiff ℝ 1 smoothNoiseRoot := smoothNoiseRoot_contDiff.of_le (by norm_num) + have hp := affineNoiseRoot_continuous smoothNoiseRoot_contDiff.continuous (1+B) a + have hq := affineNoiseRoot_continuous smoothNoiseRoot_contDiff.continuous (1+C) (a+h) + have hh := (observableClose_of_density (volume : Measure (ι → ℝ)) + (hq.pow 2).measurable (hp.pow 2).measurable (fun _ => sq_nonneg _) (fun _ => sq_nonneg _) + (affineNoiseRoot_integrable_square smoothNoiseRoot_contDiff.continuous smoothNoiseRoot_compact + _ _ (one_add_psd_isUnit_det C hC)) + (affineNoiseRoot_integrable_square smoothNoiseRoot_contDiff.continuous smoothNoiseRoot_compact + _ _ (one_add_psd_isUnit_det B hB))).symm + apply hh.mono + exact affineNoiseDensity_L1_distance hf smoothNoiseRoot_compact + smoothNoiseRoot_normalized smoothNoiseRoot_even B C hB hC a h + +end FiniteLawDistance + +section FiniteField +open Classical Matrix MeasureTheory + +noncomputable def finiteCoefficientField {ι : Type*} (J : Finset ι) + (a : ι → ℝ) (B : Matrix ι ι ℝ) (x : ι → ℝ) : ι → ℝ := + fun z => a z+x z+∑w∈J,B z w*x w + +theorem finiteCoefficientField_measurable {ι : Type*} (J : Finset ι) + (a : ι → ℝ) (B : Matrix ι ι ℝ) : Measurable (finiteCoefficientField J a B) := by + apply Measurable.of_eval + intro z + exact (measurable_const.add (measurable_pi_apply z)).add + (Finset.measurable_sum _ (fun w _ => measurable_const.mul (measurable_pi_apply w))) + +noncomputable def joinedNoiseField {ι : Type*} (J : Finset ι) (q : ℝ) + (x : (J → ℝ) × ({z : ι // z∉J} → ℝ)) : ι → ℝ := + fun z => if hz : z∈J then x.1 ⟨z,hz⟩ else q+x.2 ⟨z,hz⟩ + +theorem joinedNoiseField_measurable {ι : Type*} (J : Finset ι) (q : ℝ) : + Measurable (joinedNoiseField J q) := by + apply Measurable.of_eval + intro z + by_cases hz : z∈J + · simpa only [joinedNoiseField,dite_eq_left hz,Function.comp_def] using + (measurable_pi_apply (⟨z,hz⟩ : J)).comp measurable_fst + · simp only [joinedNoiseField,dite_eq_right hz] + fun_prop + +theorem finiteCoefficientField_law {ι : Type*} (J : Finset ι) + (a : ι → ℝ) (B : Matrix ι ι ℝ) (q : ℝ) + (ha : ∀z,z∉J → a z=q) (hB : ∀z,z∉J → ∀w,B z w=0) : + (independentSmoothNoiseLaw ι).map (finiteCoefficientField J a B)= + ((finiteAffineNoiseLaw (1+(B.submatrix (fun z : J => z.val) (fun z : J => z.val))) + (fun z : J => a z)).prod (independentSmoothNoiseLaw {z : ι // z∉J})).map + (joinedNoiseField J q) := by + let e := (MeasurableEquiv.piEquivPiSubtypeProd (fun _ : ι => ℝ) (fun z => z∈J)).symm + have hsplit : (independentSmoothNoiseLaw ι)= + ((independentSmoothNoiseLaw J).prod (independentSmoothNoiseLaw {z : ι // z∉J})).map e := by + convert! (infinitePi_split smoothNoiseLaw (fun z => z∈J)).symm using 1 + congr 2 + apply MeasurableEquiv.ext + funext x + funext z + by_cases hz : z∈J <;> simp [e,MeasurableEquiv.piEquivPiSubtypeProd,Equiv.piEquivPiSubtypeProd,hz] + rw [hsplit,Measure.map_map (finiteCoefficientField_measurable J a B) e.measurable] + let A : Matrix J J ℝ := 1+B.submatrix (fun z : J => z.val) (fun z : J => z.val) + let f : (J → ℝ) → (J → ℝ) := fun x => (fun z : J => a z)+A*ᵥx + have hf : Measurable f := by fun_prop + change _=((independentSmoothNoiseLaw J).map f |>.prod + (independentSmoothNoiseLaw {z : ι // z∉J})).map (joinedNoiseField J q) + have hid : (independentSmoothNoiseLaw {z : ι // z∉J}).map id= + independentSmoothNoiseLaw {z : ι // z∉J} := Measure.map_id + conv_rhs => rw [← hid] + rw [Measure.map_prod_map _ _ hf measurable_id, + Measure.map_map (joinedNoiseField_measurable J q) (hf.prodMap measurable_id)] + congr 1 + ext x z + have he (w : ι) : e x w=(if hw : w∈J then x.1 ⟨w,hw⟩ else x.2 ⟨w,hw⟩) := rfl + have hs : (∑w : J,B z w*x.1 w)=∑w∈J,B z w*e x w := by + rw [← Finset.sum_coe_sort J (fun w => B z w*e x w)] + apply Finset.sum_congr rfl + intro w _ + rw [he,dite_eq_left w.property] + by_cases hz : z∈J + · change a z+e x z+(∑w∈J,B z w*e x w)=joinedNoiseField J q (f x.1,x.2) z + simp only [joinedNoiseField,dite_eq_left hz,f,A,Matrix.add_mulVec,Matrix.one_mulVec,Pi.add_apply] + change a z+e x z+(∑w∈J,B z w*e x w)=a z+(x.1 ⟨z,hz⟩+∑w : J,B z w*x.1 w) + rw [hs,he,dite_eq_left hz,add_assoc] + · simp only [Function.comp_apply,finiteCoefficientField,joinedNoiseField,dite_eq_right hz, + Prod.map_snd,id_eq,he,ha z hz,hB z hz,zero_mul,Finset.sum_const_zero,add_zero] + +end FiniteField + +section WholeFieldDistance +open Classical Matrix MeasureTheory + +theorem finiteCoefficientField_close {ι : Type*} (J : Finset ι) + (a b : ι → ℝ) (B C : Matrix ι ι ℝ) (q : ℝ) + (ha : ∀z,z∉J → a z=q) (hb : ∀z,z∉J → b z=q) + (hBr : ∀z,z∉J → ∀w,B z w=0) (hCr : ∀z,z∉J → ∀w,C z w=0) + (hB : B.PosSemidef) (hC : C.PosSemidef) : + ObservableClose + ((independentSmoothNoiseLaw ι).map (finiteCoefficientField J a B)) + ((independentSmoothNoiseLaw ι).map (finiteCoefficientField J b C)) + (smoothNoiseTransportError (B.submatrix (fun z : J => z.val) (fun z : J => z.val)) + (C.submatrix (fun z : J => z.val) (fun z : J => z.val)) + (fun z : J => b z-a z)) := by + rw [finiteCoefficientField_law J a B q ha hBr,finiteCoefficientField_law J b C q hb hCr] + have hh := finiteAffineNoiseLaw_close + (B.submatrix (fun z : J => z.val) (fun z : J => z.val)) + (C.submatrix (fun z : J => z.val) (fun z : J => z.val)) + (hB.submatrix _) (hC.submatrix _) (fun z : J => a z) (fun z : J => b z-a z) + have he : (fun z : J => a z)+(fun z : J => b z-a z)=(fun z : J => b z) := by ext z; simp + rw [he] at hh + convert! (hh.prod_right (independentSmoothNoiseLaw {z : ι // z∉J})).map + (joinedNoiseField_measurable J q) using 1 <;> congr! + +noncomputable def smoothNoiseTransportConstant : ℝ := + 2*Real.sqrt (affineNoiseEnergyConstant smoothNoiseRoot)+1 + +theorem smoothNoiseTransportConstant_pos : 0 F i x*F j x) μ) : + (∫x,(∑i,F i x)^2 ∂μ)=∑i,∑j,∫x,F i x*F j x ∂μ := by + simp only [pow_two,Finset.sum_mul_sum] + rw [integral_finsetSum _ (fun i _ => integrable_finsetSum _ (fun j _ => h i j))] + apply Finset.sum_congr rfl + intro i _ + rw [integral_finsetSum _ (fun j _ => h i j)] + +theorem integral_product_le_half_energy {X : Type*} [MeasurableSpace X] + (μ : Measure X) (f g : X → ℝ) + (hf : Integrable (fun x => f x*f x) μ) + (hg : Integrable (fun x => g x*g x) μ) + (hfg : Integrable (fun x => f x*g x) μ) : + (∫x,f x*g x ∂μ)≤((∫x,(f x)^2 ∂μ)+(∫x,(g x)^2 ∂μ))/2 := by + have hh : Integrable (fun x => f x*f x+g x*g x) μ := hf.add hg + have hb : Integrable (fun x => 2*(f x*g x)) μ := hfg.const_mul 2 + have hp : 0 ≤ ∫x,f x*f x+g x*g x-2*(f x*g x) ∂μ := by + apply integral_nonneg + intro x + change 0 ≤ f x*f x+g x*g x-2*(f x*g x) + nlinarith [sq_nonneg (f x-g x)] + rw [integral_sub hh hb,integral_add hf hg,integral_const_mul] at hp + simp only [pow_two] + linarith + +theorem finite_overlap_energy {I X S : Type*} [Fintype I] [MeasurableSpace X] + (μ : Measure X) (F : I → X → ℝ) (s : I → S) + (h : ∀i j,Integrable (fun x => F i x*F j x) μ) + (ho : ∀i j,s i≠s j → (∫x,F i x*F j x ∂μ)=0) + (k : ℕ) (hcard : ∀i,(Finset.univ.filter (fun j => s i=s j)).card≤k) : + (∫x,(∑i,F i x)^2 ∂μ)≤(k:ℝ)*∑i,∫x,F i x^2 ∂μ := by + let E := fun i => ∫x,F i x^2 ∂μ + have hE (i : I) : 0≤E i := integral_nonneg (fun _ => sq_nonneg _) + have hc (i : I) : (∑j,if s i=s j then E i else 0)≤(k:ℝ)*E i := by + rw [← Finset.sum_filter] + simp only [Finset.sum_const,nsmul_eq_mul] + exact mul_le_mul_of_nonneg_right (by exact_mod_cast hcard i) (hE i) + have hsum : (∑i,∑j,if s i=s j then E i else 0)≤(k:ℝ)*∑i,E i := by + rw [Finset.mul_sum] + exact Finset.sum_le_sum (fun i _ => hc i) + have hswap : (∑i,∑j,if s i=s j then E j else 0)=(∑i,∑j,if s i=s j then E i else 0) := by + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro i _ + apply Finset.sum_congr rfl + intro j _ + simp only [eq_comm] + rw [integral_finite_energy μ F h] + calc + _ ≤ ∑i,∑j,((if s i=s j then E i else 0)+(if s i=s j then E j else 0))/2 := by + apply Finset.sum_le_sum + intro i _ + apply Finset.sum_le_sum + intro j _ + split_ifs with hij + · exact integral_product_le_half_energy μ (F i) (F j) (h i i) (h j j) (h i j) + · rw [ho i j hij] + norm_num + _ = ((∑i,∑j,if s i=s j then E i else 0)+(∑i,∑j,if s i=s j then E j else 0))/2 := by + simp only [← Finset.sum_div,Finset.sum_add_distrib] + _ ≤ (k:ℝ)*∑i,E i := by rw [hswap]; linarith + +end FiniteOrthogonalEnergy + +section SmoothNoise +open Classical MeasureTheory +open scoped ContDiff + +noncomputable def rawNoiseBump : ContDiffBump (0 : ℝ) := + ⟨1/2,1,by norm_num,by norm_num⟩ + +noncomputable def rawNoiseMass : ℝ := ∫x : ℝ,(rawNoiseBump x)^2 + +theorem rawNoiseMass_pos : 0 (rawNoiseBump x)^2) := rawNoiseBump.continuous.pow 2 + have hs : HasCompactSupport (fun x : ℝ => (rawNoiseBump x)^2) := by + convert! rawNoiseBump.hasCompactSupport.mul_right (f':=rawNoiseBump) using 1 + ext x + simp only [pow_two,Pi.mul_apply] + apply integral_pos_of_integrable_nonneg_nonzero (x:=(0:ℝ)) hc (hc.integrable_of_hasCompactSupport hs) + (fun _ => sq_nonneg _) + have hh : rawNoiseBump (0 : ℝ)=1 := rawNoiseBump.one_of_mem_closedBall (by + simp [rawNoiseBump]) + simp [hh] + +noncomputable def smoothNoiseRoot (x : ℝ) : ℝ := rawNoiseBump x/Real.sqrt rawNoiseMass + +theorem smoothNoiseRoot_nonneg (x : ℝ) : 0 ≤ smoothNoiseRoot x := + div_nonneg rawNoiseBump.nonneg (Real.sqrt_nonneg _) + +theorem smoothNoiseRoot_even : Function.Even smoothNoiseRoot := by + intro x + simp only [smoothNoiseRoot,rawNoiseBump.neg] + +theorem smoothNoiseRoot_contDiff : ContDiff ℝ ∞ smoothNoiseRoot := + rawNoiseBump.contDiff.div_const _ + +theorem smoothNoiseRoot_compact : HasCompactSupport smoothNoiseRoot := by + convert! rawNoiseBump.hasCompactSupport.mul_right (f':=fun _ => (Real.sqrt rawNoiseMass)⁻¹) using 1 + +theorem smoothNoiseRoot_zero {x : ℝ} (hx : 1≤|x|) : smoothNoiseRoot x=0 := by + rw [smoothNoiseRoot] + have hh : rawNoiseBump x=0 := rawNoiseBump.zero_of_le_dist (by + simpa only [rawNoiseBump,Real.dist_eq,sub_zero] using hx) + rw [hh,zero_div] + +theorem smoothNoiseRoot_pos {x : ℝ} (hx : |x|<1) : 0 sq_nonneg _) + +theorem noise_centered_energy {ι I : Type*} [Fintype ι] [Fintype I] + {f : ℝ → ℝ} (hf : ContDiff ℝ 1 f) (hc : HasCompactSupport f) (he : Function.Even f) + (hn : (∫x : ℝ,f x^2)=1) (s : I → Finset ι) (p : I → ι → NoiseFactor) (c : I → ℝ) + (hp : ∀i j,j∈s i → p i j≠.base) + (k : ℕ) (hcard : ∀i,(Finset.univ.filter (fun j => s i=s j)).card≤k) : + (∫x : ι → ℝ,(∑i,c i*centeredNoiseTensor f (s i) (fun j => noiseFactor f (p i j)) x)^2 + ∂(Measure.pi (fun _ : ι => (volume : Measure ℝ)))) ≤ + (k:ℝ)*∑i,c i^2*∏j∈s i,noiseEnergy f (p i j) := by + let T := fun i => centeredNoiseTensor f (s i) (fun j => noiseFactor f (p i j)) + have hT (i j : I) : Integrable (fun x : ι → ℝ => T i x*T j x) + (Measure.pi (fun _ : ι => (volume : Measure ℝ))) := by + apply noiseTensor_integrable_inner + intro l + split_ifs + · exact noiseFactor_integrable_product hf hc _ _ + · exact noiseFactor_integrable_product hf hc (p i l) .base + · exact noiseFactor_integrable_product hf hc .base (p j l) + · exact noiseFactor_integrable_product hf hc .base .base + have hF (i j : I) : Integrable (fun x : ι → ℝ => (c i*T i x)*(c j*T j x)) + (Measure.pi (fun _ : ι => (volume : Measure ℝ))) := by + apply ((hT i j).const_mul (c i*c j)).congr + filter_upwards with x + ring + have ho (i j : I) (hne : s i≠s j) : + (∫x : ι → ℝ,(c i*T i x)*(c j*T j x) ∂(Measure.pi (fun _ : ι => (volume : Measure ℝ))))=0 := by + have hh := centeredNoiseTensor_orthogonal f (s i) (s j) + (fun l => noiseFactor f (p i l)) (fun l => noiseFactor f (p j l)) + (fun l hl => noiseFactor_centered hf hc he _ (hp i l hl)) + (fun l hl => noiseFactor_centered hf hc he _ (hp j l hl)) hne + rw [show (fun x : ι → ℝ => (c i*T i x)*(c j*T j x))= + (fun x : ι → ℝ => (c i*c j)*(T i x*T j x)) by ext x; ring, + integral_const_mul,hh,mul_zero] + have hbound := finite_overlap_energy (Measure.pi (fun _ : ι => (volume : Measure ℝ))) + (fun i x => c i*T i x) s hF ho k (by convert! hcard) + convert hbound using 1 + congr 1 + apply Finset.sum_congr rfl + intro i _ + rw [show (fun x : ι → ℝ => (c i*T i x)^2)= + (fun x : ι → ℝ => c i^2*(T i x)^2) by ext x; ring,integral_const_mul] + rw [centeredNoiseTensor_energy f hn] + rfl + +noncomputable def singletonNoise {ι : Type*} [Fintype ι] (f : ℝ → ℝ) + (q : NoiseFactor) (i : ι) : (ι → ℝ) → ℝ := centeredNoiseTensor f {i} (fun _ => noiseFactor f q) + +theorem singletonNoise_energy_bound {ι : Type*} [Fintype ι] + {f : ℝ → ℝ} (hf : ContDiff ℝ 1 f) (hc : HasCompactSupport f) (he : Function.Even f) + (hn : (∫x : ℝ,f x^2)=1) (q : NoiseFactor) (hq : q≠.base) (c : ι → ℝ) : + (∫x : ι → ℝ,(∑i,c i*singletonNoise f q i x)^2 + ∂(Measure.pi (fun _ : ι => (volume : Measure ℝ))))≤ + noiseEnergy f q*∑i,c i^2 := by + have h := noise_centered_energy hf hc he hn (fun i : ι => {i}) (fun _ _ => q) c + (fun _ _ _ => hq) 1 (by + intro i + apply Finset.card_le_one.mpr + intro a ha b hb + have ha' := (Finset.mem_filter.mp ha).2 + have hb' := (Finset.mem_filter.mp hb).2 + exact Finset.singleton_inj.mp (ha'.symm.trans hb')) + simpa only [singletonNoise,Finset.prod_singleton,Nat.cast_one,one_mul,Finset.mul_sum,mul_comm] using h + +def NoisePair (ι : Type*) := {p : ι×ι // p.1≠p.2} + +instance {ι : Type*} [Fintype ι] [DecidableEq ι] : Fintype (NoisePair ι) := + inferInstanceAs (Fintype {p : ι×ι // p.1≠p.2}) + +def noisePairSwap {ι : Type*} (p : NoisePair ι) : NoisePair ι := ⟨(p.val.2,p.val.1),Ne.symm p.property⟩ + +theorem noisePair_card {ι : Type*} [Fintype ι] (p : NoisePair ι) : + (Finset.univ.filter (fun q : NoisePair ι => ({p.val.1,p.val.2} : Finset ι)={q.val.1,q.val.2})).card≤2 := by + have hsub : Finset.univ.filter (fun q : NoisePair ι => ({p.val.1,p.val.2} : Finset ι)={q.val.1,q.val.2}) + ⊆ {p,noisePairSwap p} := by + intro q hq + have he := (Finset.mem_filter.mp hq).2 + have h₁ : p.val.1=q.val.1 ∨ p.val.1=q.val.2 := by + have hh : p.val.1∈({q.val.1,q.val.2} : Finset ι) := by rw [← he]; simp + simpa using hh + have h₂ : p.val.2=q.val.1 ∨ p.val.2=q.val.2 := by + have hh : p.val.2∈({q.val.1,q.val.2} : Finset ι) := by rw [← he]; simp + simpa using hh + rcases h₁ with h₁ | h₁ <;> rcases h₂ with h₂ | h₂ + · exact (p.property (h₁.trans h₂.symm)).elim + · have hqp : q=p := Subtype.ext (Prod.ext h₁.symm h₂.symm) + simp [hqp] + · have hqp : q=noisePairSwap p := Subtype.ext (Prod.ext h₂.symm h₁.symm) + simp [hqp] + · exact (p.property (h₁.trans h₂.symm)).elim + exact (Finset.card_le_card hsub).trans Finset.card_le_two + +noncomputable def pairNoise {ι : Type*} [Fintype ι] (f : ℝ → ℝ) + (p : NoisePair ι) : (ι → ℝ) → ℝ := centeredNoiseTensor f {p.val.1,p.val.2} + (fun i => noiseFactor f (if i=p.val.1 then .score else .position)) + +theorem pairNoise_energy_bound {ι : Type*} [Fintype ι] + {f : ℝ → ℝ} (hf : ContDiff ℝ 1 f) (hc : HasCompactSupport f) (he : Function.Even f) + (hn : (∫x : ℝ,f x^2)=1) (c : NoisePair ι → ℝ) : + (∫x : ι → ℝ,(∑i,c i*pairNoise f i x)^2 + ∂(Measure.pi (fun _ : ι => (volume : Measure ℝ))))≤ + 2*(noiseEnergy f .score*noiseEnergy f .position)*∑i,c i^2 := by + have h := noise_centered_energy hf hc he hn (fun p : NoisePair ι => {p.val.1,p.val.2}) + (fun p i => if i=p.val.1 then .score else .position) c + (by intro i j _; split_ifs <;> decide) 2 noisePair_card + have he (p : NoisePair ι) : + (∏j∈({p.val.1,p.val.2} : Finset ι),noiseEnergy f (if j=p.val.1 then .score else .position))= + noiseEnergy f .score*noiseEnergy f .position := by + rw [Finset.prod_pair p.property] + simp only [ite_true,ite_eq_right (Ne.symm p.property)] + simp_rw [he] at h + simpa only [pairNoise,Nat.cast_ofNat,← Finset.sum_mul,mul_assoc,mul_comm,mul_left_comm] using h + +end NoiseCenteredEnergy + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/FlagAveragingMatrices.lean b/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/FlagAveragingMatrices.lean new file mode 100644 index 0000000000000000000000000000000000000000..616627834211d337d13f7e5982bea7cccf36e1f9 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/FlagAveragingMatrices.lean @@ -0,0 +1,234 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.TentMatrixPositivity +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.FlagSiteCounts + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section FlagAveragingMatrices +open Classical MeasureTheory + +noncomputable def planeTent (s : ℝ) (x y : ℝ×ℝ) : ℝ := + max (1-|(x.1-y.1)/s|) 0 * max (1-|(x.2-y.2)/s|) 0 + +theorem planeTent_posSemidef {ι : Type*} (s : ℝ) (x : ι → ℝ×ℝ) : + Matrix.PosSemidef (fun i j => planeTent s (x i) (x j)) := by + simpa only [planeTent,sub_div] using planeTentMatrix_posSemidef x s + +theorem planeTent_nonneg (s : ℝ) (x y : ℝ×ℝ) : 0 ≤ planeTent s x y := + mul_nonneg (le_max_right _ _) (le_max_right _ _) + +theorem planeTent_le_one (s : ℝ) (x y : ℝ×ℝ) : planeTent s x y ≤ 1 := by + have h₁ : max (1-|(x.1-y.1)/s|) 0 ≤ 1 := max_le (by linarith [abs_nonneg ((x.1-y.1)/s)]) zero_le_one + have h₂ : max (1-|(x.2-y.2)/s|) 0 ≤ 1 := max_le (by linarith [abs_nonneg ((x.2-y.2)/s)]) zero_le_one + exact (mul_le_mul h₁ h₂ (le_max_right _ _) zero_le_one).trans_eq (one_mul 1) + +@[simp] theorem planeTent_self (s : ℝ) (x : ℝ×ℝ) : planeTent s x x=1 := by + simp [planeTent] + +noncomputable def flagSiteOrdinary {a m D : ℕ} {v : ℝ×ℝ} (z : FlagSite a m D v) : ℝ×ℝ := + z.val.2.val + +noncomputable def scaledSiteConjugate {a m D : ℕ} {v : ℝ×ℝ} + (N : ℝ) (z : FlagSite a m D v) : ℝ×ℝ := + ((flagSiteConjugate z).1/N,(flagSiteConjugate z).2/N) + +noncomputable def flagAveragingMatrix {a m D : ℕ} {v : ℝ×ℝ} + (χ : (ℝ×ℝ) → ℝ) (ρ N r η κ : ℝ) : Matrix (FlagSite a m D v) (FlagSite a m D v) ℝ := fun z w => + if z.val.1=w.val.1 then + (χ (scaledSiteConjugate N z)*χ (scaledSiteConjugate N w)/(ρ*(r*η)^2)) * + planeTent (r/N) (flagSiteOrdinary z) (flagSiteOrdinary w) * + planeTent (N*η) (flagSiteConjugate z) (flagSiteConjugate w) * + separatorMatrix (thresholdLaw (r/N) κ) z.val.2 w.val.2 + else 0 + +theorem flagAveragingMatrix_posSemidef {a m D : ℕ} {v : ℝ×ℝ} + (χ : (ℝ×ℝ) → ℝ) {ρ N r η κ : ℝ} (hρ : 0 < ρ) (hN : 0 < N) + (hr : 0 < r) (hκ : 0 < κ) : + (flagAveragingMatrix (a:=a) (m:=m) (D:=D) (v:=v) χ ρ N r η κ).PosSemidef := by + classical + have : IsProbabilityMeasure (thresholdLaw (r/N) κ) := thresholdLaw_isProbability (div_pos hr hN) hκ + have hcut := (real_rankOne_posSemidef (fun z : FlagSite a m D v => χ (scaledSiteConjugate N z))).smul + (show 0 ≤ (ρ*(r*η)^2)⁻¹ from inv_nonneg.mpr (mul_nonneg hρ.le (sq_nonneg _))) + have hsep := (separatorMatrix_posSemidef (a:=a) (v:=v) (thresholdLaw (r/N) κ)).submatrix + (fun z : FlagSite a m D v => z.val.2) + have htrack := equalityMatrix_posSemidef (fun z : FlagSite a m D v => z.val.1) + let M : Matrix (FlagSite a m D v) (FlagSite a m D v) ℝ := + Matrix.hadamard (Matrix.hadamard (Matrix.hadamard (Matrix.hadamard + ((ρ*(r*η)^2)⁻¹ • (fun (z w : FlagSite a m D v) => + χ (scaledSiteConjugate N z)*χ (scaledSiteConjugate N w))) + (fun z w => planeTent (r/N) (flagSiteOrdinary z) (flagSiteOrdinary w))) + (fun z w => planeTent (N*η) (flagSiteConjugate z) (flagSiteConjugate w))) + (Matrix.submatrix (separatorMatrix (a:=a) (v:=v) (thresholdLaw (r/N) κ)) + (fun z : FlagSite a m D v => z.val.2) (fun z : FlagSite a m D v => z.val.2))) + (fun z w => @ite ℝ (z.val.1=w.val.1) (Classical.propDecidable _) 1 0) + have h : M.PosSemidef := + (((hcut.hadamard (planeTent_posSemidef (r/N) flagSiteOrdinary)).hadamard + (planeTent_posSemidef (N*η) flagSiteConjugate)).hadamard hsep).hadamard htrack + have he : flagAveragingMatrix (a:=a) (m:=m) (D:=D) (v:=v) χ ρ N r η κ = M := by + ext z w + dsimp only [flagAveragingMatrix, M, Matrix.hadamard, Matrix.submatrix, Matrix.of, Equiv.refl, DFunLike.coe, EquivLike.toFunLike, Equiv.instEquivLike, EquivLike.coe, Matrix, id] + simp only [Pi.smul_apply, smul_eq_mul] + split_ifs <;> ring + rw [he] + exact h + +theorem flagAveragingMatrix_cutoff_left {a m D : ℕ} {v : ℝ×ℝ} + (χ : (ℝ×ℝ) → ℝ) (ρ N r η κ : ℝ) (z w : FlagSite a m D v) + (hz : χ (scaledSiteConjugate N z)=0) : flagAveragingMatrix χ ρ N r η κ z w=0 := by + simp [flagAveragingMatrix,hz] + +theorem flagAveragingMatrix_cutoff_right {a m D : ℕ} {v : ℝ×ℝ} + (χ : (ℝ×ℝ) → ℝ) (ρ N r η κ : ℝ) (z w : FlagSite a m D v) + (hw : χ (scaledSiteConjugate N w)=0) : flagAveragingMatrix χ ρ N r η κ z w=0 := by + simp [flagAveragingMatrix,hw] + +theorem flagSite_cutoff_finite {a m D : ℕ} {v : ℝ×ℝ} (hD : 0 < D) + {χ : (ℝ×ℝ) → ℝ} (hχ : HasCompactSupport χ) {N : ℝ} (hN : 0 < N) : + (Function.support (fun z : FlagSite a m D v => χ (scaledSiteConjugate N z))).Finite := by + obtain ⟨R,hR,hzero⟩ := hχ.exists_pos_le_norm + refine (flagSiteBox_finite (a:=a) (m:=m) (v:=v) hD (mul_pos hN hR)).subset ?_ + intro z hz + have hn : ‖scaledSiteConjugate N z‖ < R := lt_of_not_ge (fun h => hz (hzero _ h)) + have h₁ := norm_fst_le (scaledSiteConjugate N z) + have h₂ := norm_snd_le (scaledSiteConjugate N z) + simp only [scaledSiteConjugate,Real.norm_eq_abs,abs_div,abs_of_pos hN] at h₁ h₂ + constructor + · have hh := (div_lt_iff₀ hN).mp (lt_of_le_of_lt h₁ hn) + nlinarith + · have hh := (div_lt_iff₀ hN).mp (lt_of_le_of_lt h₂ hn) + nlinarith + +theorem flagAveragingMatrix_finite_support {a m D : ℕ} {v : ℝ×ℝ} (hD : 0 < D) + {χ : (ℝ×ℝ) → ℝ} (hχ : HasCompactSupport χ) {N : ℝ} (hN : 0 < N) : + ∃ S : Finset (FlagSite a m D v), ∀ ρ r η κ z w, + z∉S ∨ w∉S → flagAveragingMatrix χ ρ N r η κ z w=0 := by + let S := (flagSite_cutoff_finite (a:=a) (m:=m) (v:=v) hD hχ hN).toFinset + refine ⟨S,fun ρ r η κ z w hz => ?_⟩ + rcases hz with hz|hw + · apply flagAveragingMatrix_cutoff_left + simpa only [S,Set.Finite.mem_toFinset,Function.mem_support,not_not] using hz + · apply flagAveragingMatrix_cutoff_right + simpa only [S,Set.Finite.mem_toFinset,Function.mem_support,not_not] using hw + +end FlagAveragingMatrices + +section AveragingRowBounds +open Classical MeasureTheory + +theorem tentFactor_ne_zero {s d : ℝ} (hs : 0 < s) : + max (1-|d/s|) 0 ≠ 0 ↔ |d| < s := by + rw [ne_eq,max_eq_right_iff,not_le,abs_div,abs_of_pos hs] + have he : 0 < 1-|d|/s ↔ |d|/s < 1 := by constructor <;> intro h <;> linarith + rw [he,div_lt_iff₀ hs,one_mul] + +theorem planeTent_ne_zero {s : ℝ} (hs : 0 < s) (x y : ℝ×ℝ) : + planeTent s x y ≠ 0 ↔ |x.1-y.1| + simp only [flagSiteOrdinary] at hx₁ hx₂ <;> constructor <;> linarith + +theorem flagAveragingMatrix_row_card {a m D : ℕ} {v : ℝ×ℝ} (hD : 0 < D) + (χ : (ℝ×ℝ) → ℝ) (ρ κ : ℝ) {N r η : ℝ} (hN : 0 < N) (hr : 0 < r) + (hη : 0 < η) (z : FlagSite a m D v) (S : Finset (FlagSite a m D v)) + (hS : ∀w∈S,flagAveragingMatrix χ ρ N r η κ z w ≠ 0) : + (S.card:ℝ) ≤ (4*(D:ℝ)^2*r*η+2)^2 := by + have hloc := fun w hw => flagAveragingMatrix_localization χ ρ κ hN hr hη z w (hS w hw) + have hc := flagWindow_card_bound hD z.val.1 + (show 0 ≤ 2*(r/N) by positivity) (show 0 < 2*(N*η) by positivity) S + (fun w hw => (hloc w hw).1) (fun w hw => (hloc w hw).2) + have he : (D:ℝ)^2*(2*(r/N))*(2*(N*η))+2=4*(D:ℝ)^2*r*η+2 := by + field_simp + ring + rwa [he] at hc + +theorem flagAveragingMatrix_entry_bounds {a m D : ℕ} {v : ℝ×ℝ} + (χ : (ℝ×ℝ) → ℝ) (hχ : ∀x,χ x∈Set.Icc (0:ℝ) 1) + {ρ N r η κ : ℝ} (hρ : 0 < ρ) (hN : 0 < N) (hr : 0 < r) + (hη : 0 < η) (hκ : 0 < κ) (z w : FlagSite a m D v) : + 0 ≤ flagAveragingMatrix χ ρ N r η κ z w ∧ + flagAveragingMatrix χ ρ N r η κ z w ≤ (ρ*(r*η)^2)⁻¹ := by + have : IsProbabilityMeasure (thresholdLaw (r/N) κ) := thresholdLaw_isProbability (div_pos hr hN) hκ + have hp := separatorMatrix_bounds (thresholdLaw (r/N) κ) z.val.2 w.val.2 + have hk₁ := planeTent_nonneg (r/N) (flagSiteOrdinary z) (flagSiteOrdinary w) + have hk₂ := planeTent_nonneg (N*η) (flagSiteConjugate z) (flagSiteConjugate w) + have hk₁' := planeTent_le_one (r/N) (flagSiteOrdinary z) (flagSiteOrdinary w) + have hk₂' := planeTent_le_one (N*η) (flagSiteConjugate z) (flagSiteConjugate w) + have hχz := hχ (scaledSiteConjugate N z) + have hχw := hχ (scaledSiteConjugate N w) + have hd : 0 < ρ*(r*η)^2 := mul_pos hρ (sq_pos_of_pos (mul_pos hr hη)) + unfold flagAveragingMatrix + split_ifs + · constructor + · exact mul_nonneg (mul_nonneg (mul_nonneg + (div_nonneg (mul_nonneg hχz.1 hχw.1) hd.le) hk₁) hk₂) hp.1 + · have hc : χ (scaledSiteConjugate N z)*χ (scaledSiteConjugate N w) ≤ 1 := + (mul_le_mul hχz.2 hχw.2 hχw.1 zero_le_one).trans_eq (one_mul 1) + calc + _ ≤ (1/(ρ*(r*η)^2))*1*1*1 := by gcongr <;> first | exact hp.1 | exact hp.2 + _ = _ := by ring + · exact ⟨le_rfl,inv_nonneg.mpr hd.le⟩ + +theorem flagAveragingMatrix_row_energy {a m D : ℕ} {v : ℝ×ℝ} (hD : 0 < D) + (χ : (ℝ×ℝ) → ℝ) (hχ : ∀x,χ x∈Set.Icc (0:ℝ) 1) + {ρ N r η κ : ℝ} (hρ : 0 < ρ) (hN : 0 < N) (hr : 0 < r) + (hη : 0 < η) (hκ : 0 < κ) (z : FlagSite a m D v) (S : Finset (FlagSite a m D v)) : + ∑w∈S,(flagAveragingMatrix χ ρ N r η κ z w)^2 ≤ + (4*(D:ℝ)^2*r*η+2)^2 / (ρ*(r*η)^2)^2 := by + let T := S.filter (fun w => flagAveragingMatrix χ ρ N r η κ z w ≠ 0) + have he : (∑w∈S,(flagAveragingMatrix χ ρ N r η κ z w)^2)= + ∑w∈T,(flagAveragingMatrix χ ρ N r η κ z w)^2 := by + symm + apply Finset.sum_subset (Finset.filter_subset _ _) + intro w hw hwt + have hh : flagAveragingMatrix χ ρ N r η κ z w=0 := by simpa [T,hw] using hwt + simp [hh] + rw [he] + have hc := flagAveragingMatrix_row_card hD χ ρ κ hN hr hη z T + (fun w hw => (Finset.mem_filter.mp hw).2) + have hb (w : FlagSite a m D v) : + (flagAveragingMatrix χ ρ N r η κ z w)^2 ≤ ((ρ*(r*η)^2)⁻¹)^2 := by + have hh := flagAveragingMatrix_entry_bounds χ hχ hρ hN hr hη hκ z w + exact pow_le_pow_left₀ hh.1 hh.2 2 + calc + _ ≤ ∑_w∈T,((ρ*(r*η)^2)⁻¹)^2 := Finset.sum_le_sum (fun w _ => hb w) + _ = (T.card:ℝ)*((ρ*(r*η)^2)⁻¹)^2 := by simp + _ ≤ (4*(D:ℝ)^2*r*η+2)^2*((ρ*(r*η)^2)⁻¹)^2 := + mul_le_mul_of_nonneg_right hc (sq_nonneg _) + _ = _ := by rw [div_eq_mul_inv,inv_pow] + +end AveragingRowBounds + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/FlagSignalEnergy.lean b/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/FlagSignalEnergy.lean new file mode 100644 index 0000000000000000000000000000000000000000..5282093c9d6ef87ed973010e4284c68555302ef0 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/FlagSignalEnergy.lean @@ -0,0 +1,159 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.RandomFields.FlagAveragingMatrices +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.FullGroupAffineData + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section FlagSignalEnergy +open Classical + +noncomputable def flagMeanSignal {a m D : ℕ} {v : ℝ×ℝ} + (θ : (ℝ×ℝ) → ℝ) (N : ℝ) (z : FlagSite a m D v) : ℝ := + θ (scaledSiteConjugate N z) + +noncomputable def flagSignalDifference {a m D : ℕ} {v : ℝ×ℝ} (hD : 0 |conjugate u.1|+|conjugate u.2|) + refine ⟨Q,hQ,fun z => ?_⟩ + have hh := hb z.val + rw [abs_of_nonneg (add_nonneg (abs_nonneg _) (abs_nonneg _))] at hh + simpa only [flagAffineData_conjugate hD,Prod.fst_add,Prod.snd_add,add_sub_cancel_left] using hh + +theorem flagSignalDifference_amplitude {a m D : ℕ} {v : ℝ×ℝ} (hD : 0 ?_⟩ + have h := hLip (scaledSiteConjugate N (flagSiteAction hD g⁻¹ z)) (scaledSiteConjugate N z) + simp only [scaledSiteConjugate,← sub_div,abs_div,abs_of_pos hN,← add_div] at h + change |flagSignalDifference hD g θ N z| ≤ _ at h + calc + _ ≤ _ := h + _ ≤ L*(Q/N) := mul_le_mul_of_nonneg_left + (div_le_div_of_nonneg_right (hdisp z) hN.le) hL + _ = _ := (mul_div_assoc _ _ _).symm + +theorem flagMeanSignal_outside {a m D : ℕ} {v : ℝ×ℝ} + (θ : (ℝ×ℝ) → ℝ) {q K N : ℝ} (hN : 0 (Set.Finite.mem_toFinset _).mp hz) + have hn : 2*(D:ℝ)^2*(N*K)+2 ≤ (2*(D:ℝ)^2*K+2)*N := by nlinarith + calc + _ ≤ 2*(S.card:ℝ) := hc + _ ≤ 2*((m:ℝ)*(2*(D:ℝ)^2*(N*K)+2)^2) := by linarith + _ ≤ 2*((m:ℝ)*((2*(D:ℝ)^2*K+2)*N)^2) := by gcongr + _ = _ := by ring + +theorem flagSignalDifference_energy {a m D : ℕ} {v : ℝ×ℝ} (hD : 0 ?_⟩ + have hN₀ : 0 sq_nonneg _) + have hb (z : FlagSite a m D v) : (flagSignalDifference hD g θ N z)^2 ≤ (B/N)^2 := + by + have hh := (sq_le_sq₀ (abs_nonneg _) (div_nonneg hB hN₀.le)).mpr (hamp N hN₀ z) + simpa only [sq_abs] using hh + calc + _ ≤ ∑z∈S,(flagSignalDifference hD g θ N z)^2 := hsub + _ ≤ ∑_z∈S,(B/N)^2 := Finset.sum_le_sum (fun z _ => hb z) + _ = (S.card:ℝ)*(B/N)^2 := by simp + _ ≤ (2*(m:ℝ)*(2*(D:ℝ)^2*K+2)^2*N^2)*(B/N)^2 := + mul_le_mul_of_nonneg_right (flagSignalSupport_card hD g hK hN₀ hN) (sq_nonneg _) + _ = _ := by field_simp + +end FlagSignalEnergy + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/FormalLawCovariance.lean b/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/FormalLawCovariance.lean new file mode 100644 index 0000000000000000000000000000000000000000..f231bdf76d8bb5f27a113129b296e72eeec0a18d --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/FormalLawCovariance.lean @@ -0,0 +1,88 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.SmallFormalGlobal +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.ConcurrentGeometry +import OAI.GroupTheory.SimpleAmenable.CentralCovers.GridPrimitiveInputs + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section FormalLawCovariance +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) {ι : Type*} [Finite ι] + +omit [Finite ι] in + +theorem smallPrimitiveEval_translate_local (hlarge : 15 < m+1) + (P : ι → Fin 5 × (CutRing × CutRing)) (u : CutRing × CutRing) + (S : Finset (Fin (m+1))) (F : CommonFrame a r m hm S u) + (w : SmallFamilyWord (Fin (m+1)) ι) (hw : w ∈ smallFamilyLocal S) : + smallFamilyEval (B.smallPrimitiveInputs hlarge (translatedTemplate P u)) w= + (MulAut.conj (B.t F.k)).toMonoidHom + (smallFamilyEval (B.smallPrimitiveInputs hlarge P) w) := by + apply MonoidHom.eqOn_closure (f := smallFamilyEval (B.smallPrimitiveInputs hlarge (translatedTemplate P u))) + (g := (MulAut.conj (B.t F.k)).toMonoidHom.comp (smallFamilyEval (B.smallPrimitiveInputs hlarge P))) ?_ hw + rintro w ⟨⟨I,i,s⟩,hIS,rfl⟩ + simp only [MonoidHom.comp_apply,smallFamilyEval_of] + let FI : CommonFrame a r m hm I.val u := + ⟨F.k,F.d,F.projection,fun k hk => F.common k (hIS hk)⟩ + have hh := congrFun (B.primitiveFamily_conjugate I.val + (smallAlphabetBalance hlarge I.val (by rw [I.property.2]; omega)) + (smallAlphabetBalance_notMem hlarge I.val (by rw [I.property.2]; omega)) P u FI) i + exact DFunLike.congr_fun hh s + +theorem smallPrimitive_formal_translate (hlarge : 15 < m+1) + (P : ι → Fin 5 × (CutRing × CutRing)) + (h : HasCentralLaw (smallFamilyModel (fun i : ι => {σ : ι → Bool | σ i=true})) + (smallFamilyEval (B.smallPrimitiveInputs hlarge P)).rangeRestrict) + (u : CutRing × CutRing) : + HasCentralLaw (smallFamilyModel (fun i : ι => {σ : ι → Bool | σ i=true})) + (smallFamilyEval (B.smallPrimitiveInputs hlarge (translatedTemplate P u))).rangeRestrict := by + apply smallFamily_assignment_law _ (fun σ τ he => funext (fun i => Bool.eq_iff_iff.mpr (he i))) _ ?_ + (by simpa using (by omega : 5 ≤ m+1)) + intro S hS w hw hv v hvS + let F := commonFrame a r m hm S (smallAlphabetBalance hlarge S hS) + (smallAlphabetBalance_notMem hlarge S hS) u + rw [B.smallPrimitiveEval_translate_local hlarge P u S F w hw, + B.smallPrimitiveEval_translate_local hlarge P u S F v hvS] + apply Commute.map + have hz := (hasCentralLaw_iff _ _).mp h w hv + have he := Subgroup.mem_center_iff.mp hz ((smallFamilyEval (B.smallPrimitiveInputs hlarge P)).rangeRestrict v) + exact (show Commute (smallFamilyEval (B.smallPrimitiveInputs hlarge P) v) + (smallFamilyEval (B.smallPrimitiveInputs hlarge P) w) from congrArg Subtype.val he).symm + +namespace PatchAtlas +variable {B} (A : B.PatchAtlas) + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + +include A in + +theorem translated_slope_coordinate_formal_law (hlarge : 25 ≤ m+1) + (hr : 0 {σ : Fin 2 → Bool | σ i=true})) + (smallFamilyEval (B.smallPrimitiveInputs (by omega) + ![(slopeTestIndex d,u),(coordinateTestIndex j,v)])).rangeRestrict := by + have hh := B.smallPrimitive_formal_translate (by omega) + ![(slopeTestIndex d,0),(coordinateTestIndex j,v-u)] + (A.slope_coordinate_formal_law hlarge hr ha d j (v-u)) u + have he : translatedTemplate ![(slopeTestIndex d,0),(coordinateTestIndex j,v-u)] u= + ![(slopeTestIndex d,u),(coordinateTestIndex j,v)] := by + funext i + fin_cases i <;> simp [translatedTemplate,add_sub_cancel] + rwa [he] at hh + +end PatchAtlas +end InitialCoverSystem +end FormalLawCovariance + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/HellingerDistance.lean b/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/HellingerDistance.lean new file mode 100644 index 0000000000000000000000000000000000000000..fda83e77c1116e300938c6b3e6ab84a3f4e9a34a --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/HellingerDistance.lean @@ -0,0 +1,202 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.RandomFields.AffineGeneratorIntegrability + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section HellingerDistance +open Classical MeasureTheory + +theorem integral_abs_mul_le_sqrt {X : Type*} [MeasurableSpace X] + (μ : Measure X) {f g : X → ℝ} (hf : MemLp f 2 μ) (hg : MemLp g 2 μ) : + (∫x,|f x| *|g x| ∂μ)≤ Real.sqrt (∫x,f x^2 ∂μ)*Real.sqrt (∫x,g x^2 ∂μ) := by + have h := integral_mul_norm_le_Lp_mul_Lq (by + apply Real.holderConjugate_iff.mpr + norm_num : (2:ℝ).HolderConjugate 2) + (by simpa using hf) (by simpa using hg) + norm_num only [ENNReal.ofReal_ofNat,Real.norm_eq_abs,Real.rpow_ofNat,abs_sq, + one_div,← Real.sqrt_eq_rpow] at h + simpa only [sq_abs] using h + +theorem density_L1_le_twice_root_distance {X : Type*} [MeasurableSpace X] + (μ : Measure X) {R S : X → ℝ} (hR : MemLp R 2 μ) (hS : MemLp S 2 μ) + (hnR : (∫x,R x^2 ∂μ)=1) (hnS : (∫x,S x^2 ∂μ)=1) : + (∫x,|R x^2-S x^2| ∂μ)≤2*Real.sqrt (∫x,(R x-S x)^2 ∂μ) := by + have hab := integral_abs_mul_le_sqrt μ (hR.sub hS) (hR.add hS) + have heq (x : X) : |R x^2-S x^2|=|R x-S x| *|R x+S x| := by + rw [← abs_mul] + congr 1 + ring + simp only [Pi.sub_apply,Pi.add_apply] at hab + have hi : (∫x,(R x+S x)^2 ∂μ)≤4 := by + calc + _ ≤ ∫x,2*(R x^2+S x^2) ∂μ := integral_mono (hR.add hS).integrable_sq + ((hR.integrable_sq.add hS.integrable_sq).const_mul 2) + (fun x => by + change (R x+S x)^2≤2*(R x^2+S x^2) + nlinarith [sq_nonneg (R x-S x)]) + _ = 4 := by + rw [integral_const_mul,integral_add hR.integrable_sq hS.integrable_sq,hnR,hnS] + norm_num + simp_rw [heq] + apply hab.trans + have hh : Real.sqrt (∫x,(R x+S x)^2 ∂μ)≤2 := by + exact (Real.sqrt_le_iff).mpr ⟨by norm_num,by norm_num at *; exact hi⟩ + nlinarith [Real.sqrt_nonneg (∫x,(R x-S x)^2 ∂μ)] + +end HellingerDistance + +section AffineDensityDistance +open Classical Matrix MeasureTheory Set + +theorem affineNoiseRoot_memLp {ι : Type*} [Fintype ι] + {f : ℝ → ℝ} (hf : Continuous f) (hc : HasCompactSupport f) + (A : Matrix ι ι ℝ) (a : ι → ℝ) (hA : IsUnit A.det) : + MemLp (affineNoiseRoot f A a) 2 (volume : Measure (ι → ℝ)) := by + apply (memLp_two_iff_integrable_sq (affineNoiseRoot_continuous hf A a).aestronglyMeasurable).mpr + exact affineNoiseRoot_integrable_square hf hc A a hA + +theorem affineNoiseRoot_square_distance {ι : Type*} [Fintype ι] + {f : ℝ → ℝ} (hf : ContDiff ℝ 1 f) (hc : HasCompactSupport f) + (hn : (∫x : ℝ,f x^2)=1) (he : Function.Even f) + (B C : Matrix ι ι ℝ) (hB : B.PosSemidef) (hC : C.PosSemidef) (a h : ι → ℝ) : + (∫y : ι → ℝ,(affineNoiseRoot f (1+C) (a+h) y-affineNoiseRoot f (1+B) a y)^2)≤ + affineNoiseEnergyConstant f*(matrixHSNorm (C-B)^2+ + ((1+matrixHSNorm (C-B))*finiteL2Norm ((1+B)⁻¹*ᵥh))^2) := by + have hR (t : ℝ) (ht : t∈Icc (0:ℝ) 1) : + MemLp (noiseInterpolationRoot f B C a h t) 2 (volume : Measure (ι → ℝ)) := + affineNoiseRoot_memLp hf.continuous hc _ _ + (one_add_psd_isUnit_det _ (covarianceSegment_posSemidef B C hB hC ht)) + have H := rootPath_energy_distance (volume : Measure (ι → ℝ)) + (noiseInterpolationRoot f B C a h) (noiseInterpolationDerivative f B C a h) + (affineNoiseEnergyConstant f*(matrixHSNorm (C-B)^2+ + ((1+matrixHSNorm (C-B))*finiteL2Norm ((1+B)⁻¹*ᵥh))^2)) + (noiseInterpolationDerivative_measurable hf B C a h) + (fun t ht y => noiseInterpolation_hasDerivAt hf B C hB hC a h y ht) + (fun y => noiseInterpolationDerivative_continuousOn hf B C hB hC a h y) + (fun t ht => affineNoiseRootDerivative_integrable_square hf hc _ _ _ _ + (one_add_psd_isUnit_det _ (covarianceSegment_posSemidef B C hB hC ht))) + (fun t ht => noiseInterpolationDerivative_energy hf hc hn he B C hB hC a h ht) + ((hR 1 (by norm_num)).sub (hR 0 (by norm_num))).integrable_sq + simpa only [noiseInterpolationRoot,covarianceSegment,sub_self,zero_smul,add_zero, + zero_add,one_smul,sub_zero] using H + +theorem affineNoiseDensity_L1_distance {ι : Type*} [Fintype ι] + {f : ℝ → ℝ} (hf : ContDiff ℝ 1 f) (hc : HasCompactSupport f) + (hn : (∫x : ℝ,f x^2)=1) (he : Function.Even f) + (B C : Matrix ι ι ℝ) (hB : B.PosSemidef) (hC : C.PosSemidef) (a h : ι → ℝ) : + (∫y : ι → ℝ,|affineNoiseRoot f (1+C) (a+h) y^2-affineNoiseRoot f (1+B) a y^2|)≤ + 2*Real.sqrt (affineNoiseEnergyConstant f*(matrixHSNorm (C-B)^2+ + ((1+matrixHSNorm (C-B))*finiteL2Norm ((1+B)⁻¹*ᵥh))^2)) := by + have H := density_L1_le_twice_root_distance (volume : Measure (ι → ℝ)) + (affineNoiseRoot_memLp hf.continuous hc (1+C) (a+h) (one_add_psd_isUnit_det C hC)) + (affineNoiseRoot_memLp hf.continuous hc (1+B) a (one_add_psd_isUnit_det B hB)) + (affineNoiseRoot_normalized hn (1+C) (a+h) (Matrix.PosDef.one.add_posSemidef hC).det_pos) + (affineNoiseRoot_normalized hn (1+B) a (Matrix.PosDef.one.add_posSemidef hB).det_pos) + exact H.trans (mul_le_mul_of_nonneg_left + (Real.sqrt_le_sqrt (affineNoiseRoot_square_distance hf hc hn he B C hB hC a h)) (by norm_num)) + +end AffineDensityDistance + +section FiniteAffineLaw +open Classical MeasureTheory Matrix Set +open scoped ENNReal + +theorem measurableEquiv_map_withDensity {X Y : Type*} [MeasurableSpace X] [MeasurableSpace Y] + (μ : Measure X) (e : X ≃ᵐ Y) {f : X → ℝ≥0∞} (hf : Measurable f) : + (μ.withDensity f).map e=(μ.map e).withDensity (fun y => f (e.symm y)) := by + ext s hs + rw [Measure.map_apply e.measurable hs,withDensity_apply _ (e.measurable hs), + withDensity_apply _ hs] + simpa only [Function.comp_apply,MeasurableEquiv.symm_apply_apply] using + (setLIntegral_map (μ := μ) hs (hf.comp e.symm.measurable) e.measurable).symm + +theorem smoothNoiseLaw_pi_density (ι : Type*) [Fintype ι] : + Measure.pi (fun _ : ι => smoothNoiseLaw)= + (volume : Measure (ι → ℝ)).withDensity + (fun x => ENNReal.ofReal (noiseTensor (fun _ : ι => smoothNoiseRoot) x^2)) := by + have hi : Integrable (fun x : ℝ => smoothNoiseRoot x^2) := by + have hh := noiseFactor_integrable_product + (smoothNoiseRoot_contDiff.of_le (by norm_num)) smoothNoiseRoot_compact .base .base + simpa only [noiseFactor,pow_two] using hh + apply Measure.pi_eq + intro s hs + rw [withDensity_apply _ (MeasurableSet.univ_pi hs)] + change (∫⁻x,ENNReal.ofReal (noiseTensor (fun _ : ι => smoothNoiseRoot) x^2) + ∂((Measure.pi (fun _ : ι => (volume : Measure ℝ))).restrict (univ.pi s)))=_ + rw [Measure.restrict_pi_pi] + have hint : Integrable (fun x : ι → ℝ => noiseTensor (fun _ : ι => smoothNoiseRoot) x^2) + (Measure.pi (fun i => (volume : Measure ℝ).restrict (s i))) := by + simpa only [noiseTensor,← Finset.prod_pow] using Integrable.fintype_prod (fun i => hi.restrict (s := s i)) + rw [← ofReal_integral_eq_lintegral_ofReal hint (ae_of_all _ (fun _ => sq_nonneg _))] + have he : (∫x : ι → ℝ,noiseTensor (fun _ : ι => smoothNoiseRoot) x^2 + ∂Measure.pi (fun i => (volume : Measure ℝ).restrict (s i)))= + ∏i,∫t : ℝ,smoothNoiseRoot t^2 ∂(volume.restrict (s i)) := by + simp only [noiseTensor,← Finset.prod_pow] + convert! integral_fintype_prod_eq_prod + (μ := fun i => (volume : Measure ℝ).restrict (s i)) + (fun (_ : ι) (x : ℝ) => smoothNoiseRoot x^2) using 1 + rw [he,ENNReal.ofReal_prod_of_nonneg (fun i _ => integral_nonneg (fun _ => sq_nonneg _))] + apply Finset.prod_congr rfl + intro i _ + rw [smoothNoiseLaw,withDensity_apply _ (hs i)] + exact ofReal_integral_eq_lintegral_ofReal (hi.restrict (s := s i)) (ae_of_all _ (fun _ => sq_nonneg _)) + +theorem independentSmoothNoiseLaw_finite_density (ι : Type*) [Fintype ι] : + independentSmoothNoiseLaw ι=(volume : Measure (ι → ℝ)).withDensity + (fun x => ENNReal.ofReal (noiseTensor (fun _ : ι => smoothNoiseRoot) x^2)) := by + rw [independentSmoothNoiseLaw,Measure.infinitePi_eq_pi,smoothNoiseLaw_pi_density] + +noncomputable def finiteAffineNoiseLaw {ι : Type*} [Fintype ι] + (A : Matrix ι ι ℝ) (a : ι → ℝ) : Measure (ι → ℝ) := + (independentSmoothNoiseLaw ι).map (fun x => a+A*ᵥx) + +instance finiteAffineNoiseLaw_probability {ι : Type*} [Fintype ι] + (A : Matrix ι ι ℝ) (a : ι → ℝ) : IsProbabilityMeasure (finiteAffineNoiseLaw A a) := by + unfold finiteAffineNoiseLaw + infer_instance + +theorem finiteAffineNoiseLaw_density {ι : Type*} [Fintype ι] + (A : Matrix ι ι ℝ) (a : ι → ℝ) (hpos : 0 ENNReal.ofReal (affineNoiseRoot smoothNoiseRoot A a y^2)) := by + let hA : IsUnit A.det := isUnit_iff_ne_zero.mpr hpos.ne' + let e := matrixAffineEquiv A a hA + have hf : Measurable (fun x : ι → ℝ => ENNReal.ofReal + (noiseTensor (fun _ : ι => smoothNoiseRoot) x^2)) := + ((noiseTensor_continuous smoothNoiseRoot_contDiff.continuous).pow 2).measurable.ennreal_ofReal + unfold finiteAffineNoiseLaw + rw [independentSmoothNoiseLaw_finite_density] + rw [show (fun x => a+A*ᵥx)=(e : (ι → ℝ) → (ι → ℝ)) from + (funext (fun x => matrixAffineEquiv_apply A a x hA)).symm, + measurableEquiv_map_withDensity _ e hf] + have hm : Measure.map e volume=ENNReal.ofReal |A.det⁻¹| • volume := by + rw [show (e : (ι → ℝ) → (ι → ℝ))=(fun x => a+A*ᵥx) from + funext (fun x => matrixAffineEquiv_apply A a x hA),map_matrix_affine_volume A a hA] + rw [hm,withDensity_smul_measure] + have hr := withDensity_smul (μ := (volume : Measure (ι → ℝ))) + (ENNReal.ofReal |A.det⁻¹|) (hf.comp e.symm.measurable) + trans volume.withDensity + (ENNReal.ofReal |A.det⁻¹| • (fun y => ENNReal.ofReal + (noiseTensor (fun _ : ι => smoothNoiseRoot) (e.symm y)^2))) + · convert! hr.symm using 1 + congr 1 + ext y + simp only [Pi.smul_apply,smul_eq_mul,matrixAffineEquiv_symm_apply,e, + affineNoiseRoot,div_pow,Real.sq_sqrt hpos.le] + rw [abs_of_pos (inv_pos.mpr hpos),← ENNReal.ofReal_mul (inv_nonneg.mpr hpos.le)] + congr 1 + ring + +end FiniteAffineLaw + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/JointBitField.lean b/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/JointBitField.lean new file mode 100644 index 0000000000000000000000000000000000000000..da4528ea1dc349cc9c9743114a792a2c399d70d8 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/JointBitField.lean @@ -0,0 +1,162 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.ObservableProducts +import OAI.GroupTheory.SimpleAmenable.RandomFields.TransportEstimate + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section JointBitField +open Classical MeasureTheory Filter +open scoped Topology + +noncomputable def jointBitFieldLaw {k a m D : ℕ} (v : Fin k → ℝ×ℝ) + (S : Fin k → FieldSignalData) (hD : 0 (S j).bitLaw (a:=a) (m:=m) (v:=v j) hD η κ n) + +instance jointBitFieldLaw_probability {k a m D : ℕ} (v : Fin k → ℝ×ℝ) + (S : Fin k → FieldSignalData) (hD : 0 bitReindex (flagSitePermutation hD g) (b j) + +theorem jointBitReindex_measurable {k a m D : ℕ} (v : Fin k → ℝ×ℝ) + (hD : 0 (bitReindex_measurable _).comp (measurable_pi_apply j)) + +theorem finiteSignalFields_transport {k a m D : ℕ} (v : Fin k → ℝ×ℝ) + (S : Fin k → FieldSignalData) (hD : 0 (S i.1).bitLaw_transport_constants (v:=v i.1) hD i.2.val) + let A := ∑i,C₁ i + let B := ∑i,C₂ i + have hA : 0≤A := Finset.sum_nonneg (fun i _ => hC₁ i) + have hB : 0≤B := Finset.sum_nonneg (fun i _ => hC₂ i) + obtain ⟨η,κ,δ,d,hη,hη₁,hκ,hδ,hd,hsmall⟩ := + smallTransportParameters smoothNoiseTransportConstant_pos hA hB hε + refine ⟨η,κ,hη,hη₁,hκ,?_⟩ + have hh : ∀ᶠn : ℕ in atTop,∀i : Fin k×F, + ObservableClose ((S i.1).bitLaw (v:=v i.1) hD η κ n) + (((S i.1).bitLaw (v:=v i.1) hD η κ n).map (bitReindex (flagSitePermutation hD i.2.val))) ε := by + apply eventually_all.mpr + intro i + filter_upwards [ht i η hη hη₁ κ hκ δ d hδ hd] with n hn + apply hn.mono + have hi₁ : C₁ i≤A := Finset.single_le_sum (fun t _ => hC₁ t) (Finset.mem_univ i) + have hi₂ : C₂ i≤B := Finset.single_le_sum (fun t _ => hC₂ t) (Finset.mem_univ i) + have he : C₁ i*η+C₂ i*Real.sqrt κ+δ≤A*η+B*Real.sqrt κ+δ := + add_le_add (add_le_add (mul_le_mul_of_nonneg_right hi₁ hη.le) + (mul_le_mul_of_nonneg_right hi₂ (Real.sqrt_nonneg κ))) le_rfl + exact (hsmall d (C₁ i*η+C₂ i*Real.sqrt κ+δ) hd.le le_rfl (add_nonneg (add_nonneg (mul_nonneg (hC₁ i) hη.le) + (mul_nonneg (hC₂ i) (Real.sqrt_nonneg κ))) hδ.le) he).le + filter_upwards [hh] with n hn g hg j + exact hn (j,⟨g,hg⟩) + +theorem jointBitFieldLaw_transport {k a m D : ℕ} (v : Fin k → ℝ×ℝ) + (S : Fin k → FieldSignalData) (hD : 0 (μ j).map (bitReindex (flagSitePermutation hD g))) + (fun _ => ε/((k:ℝ)+1)) (fun j => hn g hg j) + rw [← Measure.pi_map_pi (fun j => (bitReindex_measurable (flagSitePermutation (v:=v j) hD g)).aemeasurable)] at hh + apply hh.mono + simp only [Finset.sum_const,Finset.card_univ,Fintype.card_fin,nsmul_eq_mul] + rw [← mul_div_assoc] + exact (div_le_iff₀ hk).mpr (by nlinarith) + +end JointBitField + +section JointFieldSuccess +open Classical MeasureTheory Filter Set +open scoped Topology + +noncomputable def jointFieldSuccess {k a m D : ℕ} (v : Fin k → ℝ×ℝ) + (S : Fin k → FieldSignalData) (n : ℕ) (b : ∀j,FlagSite a m D (v j) → Bool) : Prop := + ∀j,signalSuccess (flagMeanSignal (S j).signal (sourceDyadicN n)) (b j) + +theorem jointFieldSuccess_measurable {k a m D : ℕ} (v : Fin k → ℝ×ℝ) + (S : Fin k → FieldSignalData) (n : ℕ) : + MeasurableSet {b : ∀j,FlagSite a m D (v j) → Bool | jointFieldSuccess v S n b} := by + simp only [jointFieldSuccess,Set.ofPred_forall] + apply MeasurableSet.iInter + intro j + exact (measurable_pi_apply (X:=fun j : Fin k => FlagSite a m D (v j) → Bool) j) (signalSuccess_measurable + (flagMeanSignal (S j).signal (sourceDyadicN n) : FlagSite a m D (v j) → ℝ)) + +theorem jointBitFieldLaw_success {k a m D : ℕ} (v : Fin k → ℝ×ℝ) + (S : Fin k → FieldSignalData) (hD : 0 (jointBitFieldLaw (a:=a) (m:=m) v S hD η κ n).real + {b | ¬jointFieldSuccess v S n b}) atTop (nhds 0) := by + let μ (n : ℕ) (j : Fin k) := (S j).bitLaw (a:=a) (m:=m) (v:=v j) hD η κ n + let E (n : ℕ) (j : Fin k) := {b : FlagSite a m D (v j) → Bool | + ¬signalSuccess (flagMeanSignal (S j).signal (sourceDyadicN n)) b} + have ht (j : Fin k) : Tendsto (fun n => (μ n j).real (E n j)) atTop (nhds 0) := + sourceBitFieldLaw_success hD (S j).signal (S j).χ (S j).χ_range (S j).L_pos (S j).χ_zero + (by positivity) hη hκ + have hs : Tendsto (fun n => ∑j,(μ n j).real (E n j)) atTop (nhds 0) := by + simpa only [Finset.sum_const_zero] using tendsto_finsetSum Finset.univ (fun j _ => ht j) + apply squeeze_zero (fun _ => measureReal_nonneg) _ hs + intro n + have he : {b : ∀j,FlagSite a m D (v j) → Bool | ¬jointFieldSuccess v S n b}= + ⋃j,Function.eval j ⁻¹' E n j := by ext b; simp [jointFieldSuccess,E] + rw [he] + apply (measureReal_iUnion_fintype_le _).trans + apply Finset.sum_le_sum + intro j _ + have hp := measurePreserving_eval (μ n) j + have hm : MeasurableSet (E n j) := (signalSuccess_measurable _).compl + have hh := map_measureReal_apply (μ:=Measure.pi (μ n)) hp.measurable hm + rw [hp.map_eq] at hh + exact hh.symm.le + +theorem jointBitFieldLaw_finite_support {k a m D : ℕ} (v : Fin k → ℝ×ℝ) + (S : Fin k → FieldSignalData) (hq : ∀j,(S j).q=-3) (hD : 0 sourceBitFieldLaw_finite_support (a:=a) (m:=m) (v:=v j) + hD (S j).signal (S j).χ (S j).L_pos (S j).χ_zero (hc j) ((D:ℝ)^4/5) η κ n) + have hf : Set.Finite (Set.univ.pi (fun j => (T j : Set (FlagSite a m D (v j) → Bool)))) := + Set.Finite.pi (fun j => (T j).finite_toSet) + refine ⟨hf.toFinset,?_⟩ + simp only [Set.Finite.mem_toFinset,Set.mem_pi,Set.mem_univ,true_implies,Finset.mem_coe] + apply ae_all_iff.mpr + intro j + exact (measurePreserving_eval μ j).quasiMeasurePreserving.ae (hT j) + +end JointFieldSuccess + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/MatrixDensityCalculus.lean b/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/MatrixDensityCalculus.lean new file mode 100644 index 0000000000000000000000000000000000000000..e85ed9f60fc97f7ed149e687946b114ba074e5f1 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/MatrixDensityCalculus.lean @@ -0,0 +1,181 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.RandomFields.AffineNoiseEnergy + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section MatrixDensityCalculus +open Classical Matrix + +noncomputable def determinantMultilinear {ι : Type*} [Fintype ι] : + ContinuousMultilinearMap ℝ (fun _ : ι => ι → ℝ) ℝ where + toMultilinearMap := Matrix.detRowAlternating.toMultilinearMap + cont := continuous_id.matrix_det + +theorem determinantMultilinear_apply {ι : Type*} [Fintype ι] (A : Matrix ι ι ℝ) : + determinantMultilinear A=A.det := rfl + +theorem matrix_hasDerivAt_det {ι : Type*} [Fintype ι] + {A : ℝ → Matrix ι ι ℝ} {A' : Matrix ι ι ℝ} {t : ℝ} + (hA : HasDerivAt A A' t) (hunit : IsUnit (A t).det) : + HasDerivAt (fun s => (A s).det) ((A t).det*Matrix.trace (A'*(A t)⁻¹)) t := by + let M := A t + let L := A'*M⁻¹ + have hmul : L*M=A' := by + rw [mul_assoc,Matrix.nonsing_inv_mul _ hunit,mul_one] + have hrow (i : ι) : A' i=∑j,L i j • M j := by + ext k + rw [← hmul] + simp only [Matrix.mul_apply,Finset.sum_apply,Pi.smul_apply,smul_eq_mul] + have hd := (determinantMultilinear.hasFDerivAt (A t)).comp_hasDerivAt t hA + have he : determinantMultilinear.linearDeriv (A t) A'=M.det*Matrix.trace L := by + have hlin : determinantMultilinear.linearDeriv (A t) A'= + ∑i,determinantMultilinear (Function.update (A t) i (A' i)) := by + convert! ContinuousMultilinearMap.linearDeriv_apply determinantMultilinear + (fun i j => A t i j) (fun i j => A' i j) using 1 + rw [hlin] + calc + _ = ∑i,(M.updateRow i (∑j,L i j • M j)).det := by + apply Finset.sum_congr rfl + intro i _ + rw [hrow i] + rfl + _ = ∑i,L i i*M.det := by + apply Finset.sum_congr rfl + intro i _ + rw [Matrix.det_updateRow_sum,smul_eq_mul] + _ = M.det*Matrix.trace L := by + simp only [Matrix.trace,Matrix.diag,Finset.mul_sum,mul_comm] + rw [he] at hd + convert! hd using 1 + +end MatrixDensityCalculus + +section AffineNoiseIdentity +open Classical Matrix + +noncomputable def noiseGradientCoordinate {ι : Type*} [Fintype ι] + (f : ℝ → ℝ) (i : ι) (x : ι → ℝ) : ℝ := + deriv f (x i)*∏j∈Finset.univ.erase i,f (x j) + +theorem singletonNoise_eq {ι : Type*} [Fintype ι] (f : ℝ → ℝ) + (q : NoiseFactor) (i : ι) (x : ι → ℝ) : + singletonNoise f q i x=noiseFactor f q (x i)*∏j∈Finset.univ.erase i,f (x j) := by + unfold singletonNoise centeredNoiseTensor noiseTensor + rw [← Finset.mul_prod_erase Finset.univ (fun j => (if j∈({i} : Finset ι) then + (fun _ => noiseFactor f q) j else f) (x j)) (Finset.mem_univ i)] + simp only [Finset.mem_singleton] + congr 1 + apply Finset.prod_congr rfl + intro j hj + rw [ite_eq_right (Finset.mem_erase.mp hj).1] + +theorem singletonNoise_score {ι : Type*} [Fintype ι] (f : ℝ → ℝ) (i : ι) (x : ι → ℝ) : + singletonNoise f .score i x=noiseGradientCoordinate f i x := by + rw [singletonNoise_eq] + rfl + +theorem singletonNoise_diagonal {ι : Type*} [Fintype ι] (f : ℝ → ℝ) (i : ι) (x : ι → ℝ) : + singletonNoise f .diagonal i x= + x i*noiseGradientCoordinate f i x+noiseTensor (fun _ : ι => f) x/2 := by + rw [singletonNoise_eq] + unfold noiseFactor noiseGradientCoordinate noiseTensor + rw [← Finset.mul_prod_erase Finset.univ (fun j => f (x j)) (Finset.mem_univ i)] + ring + +theorem pairNoise_gradient {ι : Type*} [Fintype ι] (f : ℝ → ℝ) + (p : NoisePair ι) (x : ι → ℝ) : + pairNoise f p x=x p.val.2*noiseGradientCoordinate f p.val.1 x := by + rw [← singletonNoise_score] + unfold pairNoise singletonNoise centeredNoiseTensor noiseTensor + rw [← Finset.mul_prod_erase Finset.univ _ (Finset.mem_univ p.val.2), + ← Finset.mul_prod_erase Finset.univ (fun i => (if i∈({p.val.1} : Finset ι) then + (fun _ => noiseFactor f .score) i else f) (x i)) (Finset.mem_univ p.val.2)] + simp only [Finset.mem_insert,Finset.mem_singleton,or_true,ite_true, + ite_eq_right (Ne.symm p.property),noiseFactor] + have hp : (∏i∈Finset.univ.erase p.val.2, + (if i∈({p.val.1,p.val.2} : Finset ι) then + (fun i => noiseFactor f (if i=p.val.1 then .score else .position)) i else f) (x i))= + ∏i∈Finset.univ.erase p.val.2,(if i=p.val.1 then deriv f else f) (x i) := by + apply Finset.prod_congr rfl + intro i hi + have hne := (Finset.mem_erase.mp hi).1 + by_cases he : i=p.val.1 + · simp [he,noiseFactor] + · simp [he,hne] + simp only [Finset.mem_insert,Finset.mem_singleton,noiseFactor] at hp + rw [hp] + ring + +theorem affineNoiseGenerator_eq {ι : Type*} [Fintype ι] + (f : ℝ → ℝ) (L : Matrix ι ι ℝ) (v x : ι → ℝ) : + affineNoiseGenerator f L v x= + (∑i,((L*ᵥx) i+v i)*noiseGradientCoordinate f i x)+ + Matrix.trace L*noiseTensor (fun _ : ι => f) x/2 := by + have hsplit : (∑i,L i i*x i*noiseGradientCoordinate f i x)+ + (∑p : NoisePair ι,L p.val.1 p.val.2*x p.val.2*noiseGradientCoordinate f p.val.1 x)= + ∑i,∑j,L i j*x j*noiseGradientCoordinate f i x := by + have ho : (∑p : NoisePair ι,L p.val.1 p.val.2*x p.val.2*noiseGradientCoordinate f p.val.1 x)= + ∑i,∑j,if i≠j then L i j*x j*noiseGradientCoordinate f i x else 0 := by + change (∑p : {p : ι×ι // p.1≠p.2},L p.val.1 p.val.2*x p.val.2*noiseGradientCoordinate f p.val.1 x)=_ + rw [← Finset.sum_subtype (Finset.univ.filter (fun p : ι×ι => p.1≠p.2)) (by simp) + (fun p : ι×ι => L p.1 p.2*x p.2*noiseGradientCoordinate f p.1 x),Finset.sum_filter, + Fintype.sum_prod_type] + rw [ho,← Finset.sum_add_distrib] + apply Finset.sum_congr rfl + intro i _ + calc + _ = (∑j,if i=j then L i j*x j*noiseGradientCoordinate f i x else 0)+ + (∑j,if i≠j then L i j*x j*noiseGradientCoordinate f i x else 0) := by simp + _ = _ := by + rw [← Finset.sum_add_distrib] + apply Finset.sum_congr rfl + intro j _ + split_ifs <;> simp_all + simp_rw [affineNoiseGenerator,singletonNoise_diagonal,singletonNoise_score,pairNoise_gradient] + simp only [mul_add,Finset.sum_add_distrib] + have ht : (∑i,L i i*(noiseTensor (fun _ : ι => f) x/2))= + Matrix.trace L*noiseTensor (fun _ : ι => f) x/2 := by + rw [← Finset.sum_mul] + simp only [Matrix.trace,Matrix.diag] + ring + rw [ht] + have hh : (∑p : NoisePair ι,L p.val.1 p.val.2*(x p.val.2*noiseGradientCoordinate f p.val.1 x))= + ∑p : NoisePair ι,L p.val.1 p.val.2*x p.val.2*noiseGradientCoordinate f p.val.1 x := by + simp only [mul_assoc] + rw [hh] + simp only [← mul_assoc] at hsplit ⊢ + rw [show (∑i,L i i*x i*noiseGradientCoordinate f i x)+ + Matrix.trace L*noiseTensor (fun _ : ι => f) x/2+ + (∑i,v i*noiseGradientCoordinate f i x)+ + (∑p : NoisePair ι,L p.val.1 p.val.2*x p.val.2*noiseGradientCoordinate f p.val.1 x)= + ((∑i,L i i*x i*noiseGradientCoordinate f i x)+ + (∑p : NoisePair ι,L p.val.1 p.val.2*x p.val.2*noiseGradientCoordinate f p.val.1 x))+ + (∑i,v i*noiseGradientCoordinate f i x)+Matrix.trace L*noiseTensor (fun _ : ι => f) x/2 by ring, + hsplit] + simp only [Matrix.mulVec,dotProduct,Finset.sum_mul,add_mul,Finset.sum_add_distrib] + +theorem noiseTensor_hasDerivAt {ι : Type*} [Fintype ι] + {f : ℝ → ℝ} (hf : Differentiable ℝ f) {x : ℝ → ι → ℝ} {x' : ι → ℝ} {t : ℝ} + (hx : HasDerivAt x x' t) : + HasDerivAt (fun s => noiseTensor (fun _ : ι => f) (x s)) + (∑i,x' i*noiseGradientCoordinate f i (x t)) t := by + have h (i : ι) := ((hf (x t i)).hasDerivAt).comp t ((hasDerivAt_pi.mp hx) i) + convert! HasDerivAt.fun_finsetProd (fun i (_ : i∈Finset.univ) => h i) using 1 + apply Finset.sum_congr rfl + intro i _ + simp only [noiseGradientCoordinate,smul_eq_mul,Function.comp_apply] + ring + +end AffineNoiseIdentity + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/NoiseContinuity.lean b/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/NoiseContinuity.lean new file mode 100644 index 0000000000000000000000000000000000000000..e5ac58e7a77f62a88941d23eda789eecfb81d66e --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/NoiseContinuity.lean @@ -0,0 +1,225 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.RandomFields.PolygonApproxIdentity +import OAI.GroupTheory.SimpleAmenable.RandomFields.AffineDensityDerivative + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section NoiseContinuity +open Classical Matrix MeasureTheory + +@[fun_prop] theorem noiseTensor_continuous {ι : Type*} [Fintype ι] + {f : ℝ → ℝ} (hf : Continuous f) : Continuous (noiseTensor (fun _ : ι => f)) := by + unfold noiseTensor + fun_prop + +@[fun_prop] theorem noiseGradientCoordinate_continuous {ι : Type*} [Fintype ι] + {f : ℝ → ℝ} (hf : ContDiff ℝ 1 f) (i : ι) : Continuous (noiseGradientCoordinate f i) := by + have hd : Continuous (deriv f) := hf.continuous_deriv (by norm_num) + have hc := hf.continuous + unfold noiseGradientCoordinate + fun_prop + +@[fun_prop] theorem affineNoiseGenerator_continuous_comp {ι X : Type*} [Fintype ι] + [TopologicalSpace X] {f : ℝ → ℝ} (hf : ContDiff ℝ 1 f) + {L : X → Matrix ι ι ℝ} {v x : X → ι → ℝ} + (hL : Continuous L) (hv : Continuous v) (hx : Continuous x) : + Continuous (fun z => affineNoiseGenerator f (L z) (v z) (x z)) := by + simp only [affineNoiseGenerator_eq] + have hF := (noiseTensor_continuous hf.continuous).comp hx + have hg (i : ι) := (noiseGradientCoordinate_continuous hf i).comp hx + unfold Matrix.trace Matrix.diag Matrix.mulVec dotProduct + fun_prop + +@[fun_prop] theorem affineNoiseRoot_continuous {ι : Type*} [Fintype ι] + {f : ℝ → ℝ} (hf : Continuous f) (A : Matrix ι ι ℝ) (a : ι → ℝ) : + Continuous (affineNoiseRoot f A a) := by + unfold affineNoiseRoot + apply Continuous.div_const + exact (noiseTensor_continuous hf).comp (by fun_prop) + +local instance {ι : Type*} : MeasurableSpace (Matrix ι ι ℝ) := + inferInstanceAs (MeasurableSpace (ι → ι → ℝ)) + +local instance {ι : Type*} [Fintype ι] : BorelSpace (Matrix ι ι ℝ) := + inferInstanceAs (BorelSpace (ι → ι → ℝ)) + +theorem matrix_inverse_measurable {ι : Type*} [Fintype ι] + {X : Type*} [MeasurableSpace X] {A : X → Matrix ι ι ℝ} + (hA : Measurable A) : Measurable (fun x => (A x)⁻¹) := by + have hd := continuous_id.matrix_det.measurable.comp hA + have ha := continuous_id.matrix_adjugate.measurable.comp hA + simp only [Matrix.inv_def,Ring.inverse_eq_inv] + exact hd.inv.smul ha + +theorem matrix_inverse_continuousAt {ι : Type*} [Fintype ι] + {X : Type*} [TopologicalSpace X] {A : X → Matrix ι ι ℝ} {x : X} + (hA : ContinuousAt A x) (hn : (A x).det≠0) : ContinuousAt (fun y => (A y)⁻¹) x := by + apply (continuousAt_matrix_inv (A x) ?_).comp hA + convert! (continuousAt_inv₀ hn) using 1 + ext x + exact Ring.inverse_eq_inv x + +end NoiseContinuity + +section CovarianceResolvent +open Classical Matrix + +noncomputable def matrixHSNorm {ι : Type*} [Fintype ι] (A : Matrix ι ι ℝ) : ℝ := + Real.sqrt (∑i,∑j,A i j^2) + +theorem matrixHSNorm_nonneg {ι : Type*} [Fintype ι] (A : Matrix ι ι ℝ) : + 0≤ matrixHSNorm A := Real.sqrt_nonneg _ + +theorem matrixHSNorm_sq {ι : Type*} [Fintype ι] (A : Matrix ι ι ℝ) : + matrixHSNorm A^2=∑i,∑j,A i j^2 := + Real.sq_sqrt (Finset.sum_nonneg (fun i _ => Finset.sum_nonneg (fun j _ => sq_nonneg (A i j)))) + +theorem finiteL2Norm_matrix_mulVec {ι : Type*} [Fintype ι] + (A : Matrix ι ι ℝ) (x : ι → ℝ) : + finiteL2Norm (A*ᵥx)≤ matrixHSNorm A*finiteL2Norm x := by + apply (sq_le_sq₀ (finiteL2Norm_nonneg _) (mul_nonneg (matrixHSNorm_nonneg _) (finiteL2Norm_nonneg _))).mp + rw [mul_pow,matrixHSNorm_sq,finiteL2Norm_sq,finiteL2Norm_sq,Finset.sum_mul] + apply Finset.sum_le_sum + intro i _ + exact Finset.sum_mul_sq_le_sq_mul_sq Finset.univ (fun j => A i j) x + +theorem matrixHSNorm_inverse_contraction {ι : Type*} [Fintype ι] + (B D : Matrix ι ι ℝ) (hB : B.PosSemidef) : + matrixHSNorm ((1+B)⁻¹*D)≤ matrixHSNorm D := by + apply (sq_le_sq₀ (matrixHSNorm_nonneg _) (matrixHSNorm_nonneg _)).mp + rw [matrixHSNorm_sq,matrixHSNorm_sq,Finset.sum_comm,Finset.sum_comm (f:=fun i j => D i j^2)] + apply Finset.sum_le_sum + intro j _ + have h := pow_le_pow_left₀ (finiteL2Norm_nonneg _) (finiteL2Norm_inverse_contraction B hB (fun i => D i j)) 2 + simpa only [finiteL2Norm_sq,Matrix.mul_apply,Matrix.mulVec,dotProduct] using h + +noncomputable def covarianceSegment {ι : Type*} [Fintype ι] + (B C : Matrix ι ι ℝ) (t : ℝ) : Matrix ι ι ℝ := (1-t) • B+t • C + +theorem covarianceSegment_posSemidef {ι : Type*} [Fintype ι] + (B C : Matrix ι ι ℝ) (hB : B.PosSemidef) (hC : C.PosSemidef) + {t : ℝ} (ht : t∈Set.Icc (0:ℝ) 1) : (covarianceSegment B C t).PosSemidef := + (hB.smul (sub_nonneg.mpr ht.2)).add (hC.smul ht.1) + +theorem covarianceSegment_affine {ι : Type*} [Fintype ι] + (B C : Matrix ι ι ℝ) (t : ℝ) : 1+covarianceSegment B C t=(1+B)+t • (C-B) := by + unfold covarianceSegment + module + +theorem covarianceSegment_inverse_signal {ι : Type*} [Fintype ι] + (B C : Matrix ι ι ℝ) (hB : B.PosSemidef) (hC : C.PosSemidef) + (h : ι → ℝ) {t : ℝ} (ht : t∈Set.Icc (0:ℝ) 1) : + finiteL2Norm ((1+covarianceSegment B C t)⁻¹*ᵥh)≤ + (1+matrixHSNorm (C-B))*finiteL2Norm ((1+B)⁻¹*ᵥh) := by + let P := covarianceSegment B C t + let x := (1+B)⁻¹*ᵥh + let y := (1+P)⁻¹*ᵥ((C-B)*ᵥx) + have hP := covarianceSegment_posSemidef B C hB hC ht + have hx : (1+B)*ᵥx=h := by + rw [Matrix.mulVec_mulVec,Matrix.mul_nonsing_inv _ (one_add_psd_isUnit_det B hB),Matrix.one_mulVec] + have he : (1+P)*ᵥx=h+t • ((C-B)*ᵥx) := by + rw [show 1+P=(1+B)+t • (C-B) from covarianceSegment_affine B C t, + Matrix.add_mulVec,Matrix.smul_mulVec,hx] + have hi := congrArg (fun v => (1+P)⁻¹*ᵥv) he + rw [Matrix.mulVec_mulVec,Matrix.nonsing_inv_mul _ (one_add_psd_isUnit_det P hP), + Matrix.one_mulVec,Matrix.mulVec_add,Matrix.mulVec_smul] at hi + have hv : (1+P)⁻¹*ᵥh=x-t • y := by + exact eq_sub_of_add_eq (Eq.symm hi) + rw [hv] + calc + _ ≤ finiteL2Norm x+finiteL2Norm (t • y) := finiteL2Norm_sub _ _ + _ = finiteL2Norm x+t*finiteL2Norm y := by rw [finiteL2Norm_smul,abs_of_nonneg ht.1] + _ ≤ finiteL2Norm x+finiteL2Norm y := by + exact add_le_add le_rfl (mul_le_of_le_one_left (finiteL2Norm_nonneg y) ht.2) + _ ≤ finiteL2Norm x+matrixHSNorm (C-B)*finiteL2Norm x := by + apply add_le_add le_rfl + exact (finiteL2Norm_inverse_contraction P hP _).trans (finiteL2Norm_matrix_mulVec _ _) + _ = _ := by ring + +end CovarianceResolvent + +section RootPathEnergy +open Classical MeasureTheory Set + +theorem square_integral_le_integral_square {X : Type*} [MeasurableSpace X] + (μ : Measure X) [IsProbabilityMeasure μ] {f : X → ℝ} + (hf : Integrable f μ) (hf2 : Integrable (fun x => f x^2) μ) : + (∫x,f x ∂μ)^2≤∫x,f x^2 ∂μ := by + let c := ∫x,f x ∂μ + have hz : 0≤∫x,(f x)^2-2*c*f x+c^2 ∂μ := by + apply integral_nonneg + intro x + change (0:ℝ)≤f x^2-2*c*f x+c^2 + nlinarith [sq_nonneg (f x-c)] + have hs : Integrable (fun x => f x^2-2*c*f x) μ := hf2.sub (hf.const_mul (2*c)) + rw [integral_add hs (integrable_const _),integral_sub hf2 (hf.const_mul (2*c)), + integral_const_mul,integral_const] at hz + simp only [probReal_univ,one_smul] at hz + change 0≤(∫x,f x^2 ∂μ)-2*c*c+c^2 at hz + change c^2≤∫x,f x^2 ∂μ + nlinarith + +theorem unitInterval_probability : IsProbabilityMeasure + ((volume : Measure ℝ).restrict (Ioc 0 1)) := by + constructor + simp + +theorem rootPath_energy_distance {X : Type*} [MeasurableSpace X] + (μ : Measure X) [SFinite μ] (R D : ℝ → X → ℝ) (C : ℝ) + (hDmeas : Measurable (Function.uncurry D)) + (hderiv : ∀t∈Icc (0:ℝ) 1,∀x,HasDerivAt (fun s => R s x) (D t x) t) + (hDcont : ∀x,ContinuousOn (fun t => D t x) (Icc (0:ℝ) 1)) + (hDint : ∀t∈Icc (0:ℝ) 1,Integrable (fun x => D t x^2) μ) + (henergy : ∀t∈Icc (0:ℝ) 1,(∫x,D t x^2 ∂μ)≤C) + (hRint : Integrable (fun x => (R 1 x-R 0 x)^2) μ) : + (∫x,(R 1 x-R 0 x)^2 ∂μ)≤C := by + let ν := (volume : Measure ℝ).restrict (Ioc 0 1) + let : IsProbabilityMeasure ν := unitInterval_probability + have ht : ∀ᵐt∂ν,t∈Icc (0:ℝ) 1 := by + filter_upwards [ae_restrict_mem measurableSet_Ioc] with t ht + exact ⟨ht.1.le,ht.2⟩ + have hmeas : AEStronglyMeasurable (fun p : ℝ×X => D p.1 p.2^2) (ν.prod μ) := + (hDmeas.pow_const 2).aestronglyMeasurable + have heint : Integrable (fun t => ∫x,D t x^2 ∂μ) ν := by + apply (integrable_const C).mono' hmeas.integral_prod_right' + filter_upwards [ht] with t ht + rw [Real.norm_eq_abs,abs_of_nonneg (integral_nonneg (fun _ => sq_nonneg _))] + exact henergy t ht + have hj : Integrable (fun p : ℝ×X => D p.1 p.2^2) (ν.prod μ) := by + apply (integrable_prod_iff hmeas).mpr + constructor + · filter_upwards [ht] with t ht + exact hDint t ht + · simpa only [Real.norm_eq_abs,abs_sq] using heint + have hpoint (x : X) : (R 1 x-R 0 x)^2≤∫t,D t x^2 ∂ν := by + have hd : IntervalIntegrable (fun t => D t x) volume 0 1 := + (hDcont x).intervalIntegrable_of_Icc (by norm_num) + have hd2 : IntervalIntegrable (fun t => D t x^2) volume 0 1 := + ((hDcont x).pow 2).intervalIntegrable_of_Icc (by norm_num) + have hf := intervalIntegral.integral_eq_sub_of_hasDerivAt + (fun t ht => hderiv t (by simpa only [uIcc_of_le (by norm_num : (0:ℝ)≤1)] using ht) x) hd + have hc := square_integral_le_integral_square ν hd.1 hd2.1 + rw [intervalIntegral.integral_of_le (by norm_num : (0:ℝ)≤1)] at hf + rw [← hf] + exact hc + calc + _ ≤ ∫x,∫t,D t x^2 ∂ν ∂μ := integral_mono hRint hj.integral_prod_right hpoint + _ = ∫t,∫x,D t x^2 ∂μ ∂ν := (integral_integral_swap hj).symm + _ ≤ ∫_t,C ∂ν := integral_mono_ae heint (integrable_const _) (by + filter_upwards [ht] with t ht + exact henergy t ht) + _ = C := by simp + +end RootPathEnergy + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/NoiseTensor.lean b/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/NoiseTensor.lean new file mode 100644 index 0000000000000000000000000000000000000000..d8cbb9e9deb3e22d84fd9d101d1ac89bafe3ab61 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/NoiseTensor.lean @@ -0,0 +1,168 @@ +import Mathlib + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section NoiseTensor +open Classical MeasureTheory + +noncomputable def noiseTensor {ι : Type*} [Fintype ι] (u : ι → ℝ → ℝ) + (x : ι → ℝ) : ℝ := ∏i,u i (x i) + +theorem noiseTensor_inner {ι : Type*} [Fintype ι] (u v : ι → ℝ → ℝ) : + (∫x : ι → ℝ,noiseTensor u x*noiseTensor v x ∂(Measure.pi (fun _ : ι => (volume : Measure ℝ))))=∏i,∫t : ℝ,u i t*v i t := by + simp only [noiseTensor,← Finset.prod_mul_distrib] + exact integral_fintype_prod_eq_prod (fun i x => u i x*v i x) + +theorem noiseTensor_integrable_inner {ι : Type*} [Fintype ι] (u v : ι → ℝ → ℝ) + (h : ∀i,Integrable (fun t : ℝ => u i t*v i t)) : + Integrable (fun x : ι → ℝ => noiseTensor u x*noiseTensor v x) (Measure.pi (fun _ : ι => (volume : Measure ℝ))) := by + simpa only [noiseTensor,← Finset.prod_mul_distrib] using Integrable.fintype_prod h + +theorem noiseTensor_energy {ι : Type*} [Fintype ι] (u : ι → ℝ → ℝ) : + (∫x : ι → ℝ,noiseTensor u x^2 ∂(Measure.pi (fun _ : ι => (volume : Measure ℝ))))=∏i,∫t : ℝ,u i t^2 := by + simpa only [pow_two] using noiseTensor_inner u u + +noncomputable def centeredNoiseTensor {ι : Type*} [Fintype ι] (f : ℝ → ℝ) + (s : Finset ι) (u : ι → ℝ → ℝ) : (ι → ℝ) → ℝ := + noiseTensor (fun i => if i∈s then u i else f) + +theorem centeredNoiseTensor_orthogonal {ι : Type*} [Fintype ι] + (f : ℝ → ℝ) (s t : Finset ι) (u v : ι → ℝ → ℝ) + (hu : ∀i∈s,(∫x : ℝ,u i x*f x)=0) + (hv : ∀i∈t,(∫x : ℝ,v i x*f x)=0) (hne : s≠t) : + (∫x : ι → ℝ,centeredNoiseTensor f s u x*centeredNoiseTensor f t v x ∂(Measure.pi (fun _ : ι => (volume : Measure ℝ))))=0 := by + rw [centeredNoiseTensor,centeredNoiseTensor,noiseTensor_inner] + obtain ⟨i,hi⟩ := not_forall.mp (Finset.ext_iff.not.mp hne) + apply Finset.prod_eq_zero (Finset.mem_univ i) + by_cases hs : i∈s + · have ht : i∉t := by tauto + simpa only [ite_eq_left hs,ite_eq_right ht] using hu i hs + · have ht : i∈t := by tauto + simpa only [ite_eq_right hs,ite_eq_left ht,mul_comm] using hv i ht + +theorem centeredNoiseTensor_energy {ι : Type*} [Fintype ι] (f : ℝ → ℝ) + (hf : (∫x : ℝ,f x^2)=1) (s : Finset ι) (u : ι → ℝ → ℝ) : + (∫x : ι → ℝ,centeredNoiseTensor f s u x^2 ∂(Measure.pi (fun _ : ι => (volume : Measure ℝ))))=∏i∈s,∫t : ℝ,u i t^2 := by + rw [centeredNoiseTensor,noiseTensor_energy] + calc + _ = ∏i : ι,if i∈s then (∫t : ℝ,u i t^2) else 1 := by + apply Finset.prod_congr rfl + intro i _ + split_ifs with hi + · rfl + · exact hf + _ = _ := by simp + +end NoiseTensor + +section NoiseMoments +open Classical MeasureTheory + +inductive NoiseFactor + | base | score | position | diagonal + deriving DecidableEq + +noncomputable def noiseFactor (f : ℝ → ℝ) : NoiseFactor → ℝ → ℝ + | .base => f + | .score => deriv f + | .position => fun x => x*f x + | .diagonal => fun x => x*deriv f x+f x/2 + +theorem noiseFactor_continuous {f : ℝ → ℝ} (hf : ContDiff ℝ 1 f) (i : NoiseFactor) : + Continuous (noiseFactor f i) := by + have hc := hf.continuous + have hd := hf.continuous_deriv le_rfl + cases i <;> dsimp [noiseFactor] <;> fun_prop + +theorem noiseFactor_compact {f : ℝ → ℝ} (hf : HasCompactSupport f) (i : NoiseFactor) : + HasCompactSupport (noiseFactor f i) := by + cases i + · exact hf + · exact hf.deriv + · exact hf.mul_left + · have hh : HasCompactSupport (fun x => f x/2) := by + convert! (hf.mul_right (f':=fun _ => (2:ℝ)⁻¹)) using 1 + exact hf.deriv.mul_left.add hh + +theorem noiseFactor_integrable_product {f : ℝ → ℝ} (hf : ContDiff ℝ 1 f) + (hc : HasCompactSupport f) (i j : NoiseFactor) : + Integrable (fun x => noiseFactor f i x*noiseFactor f j x) := + ((noiseFactor_continuous hf i).mul (noiseFactor_continuous hf j)).integrable_of_hasCompactSupport + (noiseFactor_compact hc i).mul_right + +theorem noiseFactor_centered {f : ℝ → ℝ} (hf : ContDiff ℝ 1 f) + (hc : HasCompactSupport f) (he : Function.Even f) (i : NoiseFactor) (hi : i≠.base) : + (∫x : ℝ,noiseFactor f i x*f x)=0 := by + have hd (x : ℝ) : HasDerivAt f (deriv f x) x := (hf.differentiable (by norm_num) x).hasDerivAt + have hff := noiseFactor_integrable_product hf hc .base .base + have hfd := noiseFactor_integrable_product hf hc .base .score + have hdf := noiseFactor_integrable_product hf hc .score .base + dsimp only [noiseFactor] at hff hfd hdf + cases i + · exact (hi rfl).elim + · have h := integral_mul_deriv_eq_deriv_mul_of_integrable + (fun x _ => hd x) (fun x _ => hd x) hfd hdf hff + have heq : (∫x : ℝ,f x*deriv f x)=(∫x : ℝ,deriv f x*f x) := by + congr 1 + funext x + ring + dsimp [noiseFactor] at h ⊢ + linarith + · have h := integral_neg_eq_self (fun x : ℝ => x*f x*f x) volume + have heq : (fun x : ℝ => (-x)*f (-x)*f (-x))=(fun x : ℝ => -(x*f x*f x)) := by + funext x + rw [he x] + ring + change (∫x : ℝ,(-x)*f (-x)*f (-x))=(∫x : ℝ,x*f x*f x) at h + rw [heq,integral_neg] at h + dsimp [noiseFactor] + linarith + · have hup (x : ℝ) : HasDerivAt (fun x => x*f x) (f x+x*deriv f x) x := by + convert! (hasDerivAt_id x).mul (hd x) using 1; simp only [one_mul,id_eq] + have hp := noiseFactor_integrable_product hf hc .position .score + have hp₀ := noiseFactor_integrable_product hf hc .position .base + dsimp only [noiseFactor] at hp hp₀ + have hp' : Integrable (fun x : ℝ => (f x+x*deriv f x)*f x) := by + have hj := noiseFactor_integrable_product hf hc .diagonal .base + apply (hj.add (hff.div_const 2)).congr + filter_upwards with x + dsimp [noiseFactor] + ring + have h := integral_mul_deriv_eq_deriv_mul_of_integrable + (fun x _ => hup x) (fun x _ => hd x) hp hp' hp₀ + let I := ∫x : ℝ,x*f x*deriv f x + have hright : (∫x : ℝ,(f x+x*deriv f x)*f x)=(∫x : ℝ,f x*f x)+I := by + have hi : Integrable (fun x : ℝ => x*deriv f x*f x) := by + apply hp.congr + filter_upwards with x + ring + rw [show (fun x : ℝ => (f x+x*deriv f x)*f x)= + (fun x : ℝ => f x*f x+x*deriv f x*f x) by ext x; ring,integral_add hff hi] + congr 1 + apply integral_congr_ae + filter_upwards with x + ring + change I=-(∫x : ℝ,(f x+x*deriv f x)*f x) at h + rw [hright] at h + have hgoal : (∫x : ℝ,noiseFactor f .diagonal x*f x)=I+(∫x : ℝ,f x*f x)/2 := by + have hi : Integrable (fun x : ℝ => x*f x*deriv f x) := hp + have hb : Integrable (fun x : ℝ => (f x*f x)/2) := hff.div_const 2 + rw [show (fun x : ℝ => noiseFactor f .diagonal x*f x)= + (fun x : ℝ => x*f x*deriv f x+(f x*f x)/2) by ext x; dsimp [noiseFactor]; ring, + integral_add hi hb,integral_div] + rw [hgoal] + linarith + +end NoiseMoments + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/PeriodizationCovariance.lean b/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/PeriodizationCovariance.lean new file mode 100644 index 0000000000000000000000000000000000000000..353a4a9a7ce6d259d81108a800487e3060ea9922 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/PeriodizationCovariance.lean @@ -0,0 +1,79 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.PlanePeriodization + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section PeriodizationCovariance + +open Classical +namespace SquareStep +variable {a : ℕ} + +theorem periodize_translate (f : PlaneStep a) (u : CutRing × CutRing) : + periodize (PlaneStep.translate u f)=translate u (periodize f) := by + apply Subtype.ext + funext p + simp only [translate_apply, periodize_apply] + let k : ℤ×ℤ := (⌊p.val.1-ordinary u.1⌋,⌊p.val.2-ordinary u.2⌋) + calc + (∑ᶠ n : ℤ×ℤ, (slice n (PlaneStep.translate u f)).val p) = + ∑ᶠ n : ℤ×ℤ, (slice (n+k) f).val (SimpleAmenable.translate a (-u) p) := by + apply finsum_congr + intro n + simp only [slice_apply,PlaneStep.translate_apply] + apply congrArg f.val + apply Subtype.ext + simp only [GenericPlane.shift,SimpleAmenable.translate_val,intPair,Prod.fst_add,Prod.snd_add, + Prod.fst_neg,Prod.snd_neg,map_neg,map_intCast,Int.cast_add,Int.fract] + dsimp [k] + ext <;> simp only [Prod.fst_add,Prod.snd_add,Int.fract,map_add,map_intCast] <;> ring_nf + _ = _ := finsum_comp_equiv (Equiv.addRight k) + (f := fun n => (slice n f).val (SimpleAmenable.translate a (-u) p)) + +noncomputable def orbitProjection : Multiplicative (CutRing × CutRing) →* + Multiplicative (ℤ×ℤ) where + toFun u := Multiplicative.ofAdd (u.toAdd.1.im,u.toAdd.2.im) + map_one' := rfl + map_mul' _ _ := rfl + +noncomputable def orbitLift : Multiplicative (ℤ×ℤ) →* + Multiplicative (CutRing × CutRing) where + toFun n := Multiplicative.ofAdd ((n.toAdd.1:CutRing)*cutTau,(n.toAdd.2:CutRing)*cutTau) + map_one' := by ext <;> simp + map_mul' n m := by + change Multiplicative.ofAdd + (((n.toAdd.1+m.toAdd.1:ℤ):CutRing)*cutTau,((n.toAdd.2+m.toAdd.2:ℤ):CutRing)*cutTau) = + Multiplicative.ofAdd (((n.toAdd.1:CutRing)*cutTau,(n.toAdd.2:CutRing)*cutTau) + + ((m.toAdd.1:CutRing)*cutTau,(m.toAdd.2:CutRing)*cutTau)) + congr 1 + ext <;> simp [add_mul] + +noncomputable def orbitRepresentation (a : ℕ) : + Representation ℤ (Multiplicative (ℤ×ℤ)) (SquareStep a) := + (representation a).comp orbitLift + +theorem representation_reduce (u : Multiplicative (CutRing × CutRing)) : + representation a u = orbitRepresentation a (orbitProjection u) := by + ext f p + change f.val (SimpleAmenable.translate a (-u.toAdd) p) = + f.val (SimpleAmenable.translate a (-((u.toAdd.1.im:CutRing)*cutTau, + (u.toAdd.2.im:CutRing)*cutTau)) p) + have he := translation_reduce a (-u.toAdd) + have he' := Equiv.congr_fun he p + simpa only [translation_apply,Prod.fst_neg,Prod.snd_neg,QuadraticAlgebra.im_neg, + Int.cast_neg,neg_mul,Prod.neg_mk] using congrArg f.val he' + +end SquareStep +end PeriodizationCovariance + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/PolygonApproxIdentity.lean b/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/PolygonApproxIdentity.lean new file mode 100644 index 0000000000000000000000000000000000000000..4e499b4646d5bcf464f07007b2b903268a9f3ae7 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/PolygonApproxIdentity.lean @@ -0,0 +1,166 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.RandomFields.SignalGoodRows + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section PolygonApproxIdentity +open Classical + +theorem polygon_signal_approx_identity {a m D : ℕ} {v : ℝ×ℝ} (hD : 0 q+ψ x) N + let e := fun z => (∑w∈J,flagAveragingMatrix χ ((D:ℝ)^4/5) N r η κ z w*h w)-h z + let δ := 38880/((D:ℝ)*Real.sqrt (r*η)) + (∀z,z∉J → e z=0) ∧ + ∑z∈J,(e z)^2 ≤ flagVolumeConstant m D L*(Cv*η*(1+δ)+Ca*δ)^2+ + flagExceptionalConstant a m D L*(κ+r/N)*(flagRowSumConstant D*Ca)^2 := by + obtain ⟨R,Q₁,Cv,Ca,hR,hQ₁,hCv,hCa,hamp,hgood⟩ := + flagSignal_good_row_constants (v:=v) hD g ψ χ hψ hsψ q K hcompact hχ₁ + obtain ⟨Q₂,hQ₂,hsupp⟩ := flagSignal_box_support (v:=v) hD g ψ q hL (by linarith) hcompact + refine ⟨R,max Q₁ Q₂,Cv,Ca,hR,(hQ₁.trans (le_max_left _ _)),hCv,hCa, + fun N r η κ hN hQN hr hrN hη hη₁ hκ hscale hline hRf => ?_⟩ + have hN' : 0 q+ψ x) N + let e := fun z => (∑w∈J,flagAveragingMatrix χ ((D:ℝ)^4/5) N r η κ z w*h w)-h z + let δ := 38880/((D:ℝ)*Real.sqrt (r*η)) + change (∀z,z∉J → e z=0) ∧ _ + have hprod (z w : FlagSite a m D v) (hw : w∉J) : + flagAveragingMatrix χ ((D:ℝ)^4/5) N r η κ z w*h w=0 := by + rw [flagAveragingMatrix_box_support hD χ hL hN' hχc _ _ _ _ z w (Or.inr hw),zero_mul] + refine ⟨?_,?_⟩ + · intro z hz + have hh := hsupp N hN' ((le_max_right _ _).trans hQN) z hz + dsimp [e,h] + rw [hh,sub_zero] + apply Finset.sum_eq_zero + intro w hw + rw [flagAveragingMatrix_box_support hD χ hL hN' hχc _ _ _ _ z w (Or.inl hz),zero_mul] + · apply flag_good_bad_energy hD hL hκ (div_pos hr' hN') ((div_le_one hN').mpr hrN) hN + (by rwa [div_mul_cancel₀ _ hN'.ne']) + (show 0 ≤ Cv*η*(1+δ)+Ca*δ by dsimp [δ]; positivity) + (show 0 ≤ flagRowSumConstant D*Ca by dsimp [flagRowSumConstant]; positivity) J + (fun z hz => by simpa only [mul_comm N L] using (mem_flagBoxFinset _ _ _).mp hz) e + · intro z hz hzg + have hh := hgood N r η κ hN' ((le_max_left _ _).trans hQN) hr' hη hη₁ hκ + hscale hline hRf z J hzg (hprod z) + convert hh using 1 + dsimp [e,h,δ] + ring + · intro z hz + have hh := flagAveragingMatrix_crude_error hD χ hχ h hρ hN' hr' hη hκ + (show 1 ≤ r*η by linarith) (div_nonneg hCa hN'.le) (hamp N hN') z J + convert hh using 1 + dsimp [e,flagRowSumConstant] + ring + +end PolygonApproxIdentity + +section FiniteResolvent +open Classical Matrix + +noncomputable def finiteL2Norm {ι : Type*} [Fintype ι] (x : ι → ℝ) : ℝ := + ‖WithLp.toLp 2 x‖ + +theorem finiteL2Norm_nonneg {ι : Type*} [Fintype ι] (x : ι → ℝ) : 0 ≤ finiteL2Norm x := norm_nonneg _ + +theorem finiteL2Norm_sq {ι : Type*} [Fintype ι] (x : ι → ℝ) : + finiteL2Norm x^2=∑i,x i^2 := by + simp [finiteL2Norm,PiLp.norm_sq_eq_of_L2,Real.norm_eq_abs,sq_abs] + +theorem finiteL2Norm_add {ι : Type*} [Fintype ι] (x y : ι → ℝ) : + finiteL2Norm (x+y) ≤ finiteL2Norm x+finiteL2Norm y := by + simpa only [finiteL2Norm,WithLp.toLp_add] using norm_add_le (WithLp.toLp 2 x) (WithLp.toLp 2 y) + +theorem finiteL2Norm_sub {ι : Type*} [Fintype ι] (x y : ι → ℝ) : + finiteL2Norm (x-y) ≤ finiteL2Norm x+finiteL2Norm y := by + simpa only [finiteL2Norm,WithLp.toLp_sub] using norm_sub_le (WithLp.toLp 2 x) (WithLp.toLp 2 y) + +theorem finiteL2Norm_smul {ι : Type*} [Fintype ι] (c : ℝ) (x : ι → ℝ) : + finiteL2Norm (c • x)=|c| * finiteL2Norm x := by + simp only [finiteL2Norm,WithLp.toLp_smul,norm_smul,Real.norm_eq_abs] + +theorem finiteL2Norm_one_add_le {ι : Type*} [Fintype ι] [DecidableEq ι] + (B : Matrix ι ι ℝ) (hB : B.PosSemidef) (x : ι → ℝ) : + finiteL2Norm x ≤ finiteL2Norm ((1+B)*ᵥx) := by + let y := (1+B)*ᵥx + let S := ∑i,x i^2 + let T := ∑i,y i^2 + let P := ∑i,x i*y i + have hS : 0 ≤ S := Finset.sum_nonneg (fun i _ => sq_nonneg _) + have hT : 0 ≤ T := Finset.sum_nonneg (fun i _ => sq_nonneg _) + have hp : 0 ≤ ∑i,x i*(B*ᵥx) i := by + simpa only [dotProduct,star_trivial] using hB.dotProduct_mulVec_nonneg x + have he : P=S+(∑i,x i*(B*ᵥx) i) := by + simp only [P,S,y,Matrix.add_mulVec,Matrix.one_mulVec,Pi.add_apply,mul_add,Finset.sum_add_distrib,pow_two] + have hSP : S ≤ P := by linarith + have hP : 0 ≤ P := hS.trans hSP + have hcs : P^2 ≤ S*T := Finset.sum_mul_sq_le_sq_mul_sq Finset.univ x y + have hST : S ≤ T := by + by_cases h : S=0 + · simpa only [h] using hT + · have hS' : 0 hb r hr hfine p) (fun p _ => hb r' hr' hfine' p) (fun S _ hh => hs S hh) + _ = _ := by field_simp + +theorem flagMatrixDifference_dyadic_energy {a m D : ℕ} {v : ℝ×ℝ} (hD : 0 ?_⟩ + apply finite_dyadic_energy T I _ hC + intro i hi j hj _ + exact hcorr N ((2:ℝ)^i) ((2:ℝ)^j) hN (one_le_pow₀ (by norm_num)) + (one_le_pow₀ (by norm_num)) (hfine i hi) (hfine j hj) T + +end PolygonCovarianceEnergy + +section PolygonDyadicRowEnergy +open Classical + +theorem finite_sum_row_energy {α ι : Type*} (S : Finset α) (I : Finset ι) + (f : ι → α → ℝ) (b : ι → ℝ) (hb : ∀i∈I,0 ≤ b i) + (he : ∀i∈I,∑x∈S,(f i x)^2 ≤ (b i)^2) : + ∑x∈S,(∑i∈I,f i x)^2 ≤ (∑i∈I,b i)^2 := by + have hpair (i j : ι) (hi : i∈I) (hj : j∈I) : ∑x∈S,f i x*f j x ≤ b i*b j := by + apply le_of_sq_le_sq _ (mul_nonneg (hb i hi) (hb j hj)) + calc + _ ≤ (∑x∈S,(f i x)^2)*(∑x∈S,(f j x)^2) := Finset.sum_mul_sq_le_sq_mul_sq _ _ _ + _ ≤ (b i)^2*(b j)^2 := mul_le_mul (he i hi) (he j hj) + (Finset.sum_nonneg (fun _ _ => sq_nonneg _)) (sq_nonneg _) + _ = _ := (mul_pow _ _ _).symm + calc + _ = ∑i∈I,∑j∈I,∑x∈S,f i x*f j x := by + simp_rw [pow_two,Finset.sum_mul_sum] + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro i hi + rw [Finset.sum_comm] + _ ≤ ∑i∈I,∑j∈I,b i*b j := + Finset.sum_le_sum (fun i hi => Finset.sum_le_sum (fun j hj => hpair i j hi hj)) + _ = _ := by rw [pow_two,Finset.sum_mul_sum] + +theorem finite_half_geometric_tail (I : Finset ℕ) (n : ℕ) (hn : ∀i∈I,n ≤ i) : + ∑i∈I,(1/2:ℝ)^i ≤ 2*(1/2:ℝ)^n := by + have hi : Set.InjOn (fun i => i-n) I := by + intro i hi j hj he + have hi₀ := hn i hi + have hj₀ := hn j hj + change i-n=j-n at he + omega + have he : (∑i∈I,(1/2:ℝ)^i)=(1/2:ℝ)^n*(∑j∈I.image (fun i => i-n),(1/2:ℝ)^j) := by + rw [Finset.sum_image hi,Finset.mul_sum] + apply Finset.sum_congr rfl + intro i hi + rw [← pow_add,Nat.add_sub_of_le (hn i hi)] + rw [he] + have hh := mul_le_mul_of_nonneg_left (finite_half_geometric_sum (I.image (fun i => i-n))) + (pow_nonneg (by norm_num : (0:ℝ) ≤ 1/2) n) + simpa [mul_comm] using hh + +noncomputable def flagRowConstant (D : ℕ) (ρ η : ℝ) : ℝ := + (4*(D:ℝ)^2*η+2)/(ρ*η^2) + +theorem flagAveragingMatrix_row_energy_uniform {a m D : ℕ} {v : ℝ×ℝ} (hD : 0 flagAveragingMatrix χ ρ N ((2:ℝ)^i) η κ z y) + (fun i => flagRowConstant D ρ η/(2:ℝ)^i) + (by intro i hi; positivity) + (fun i _ => flagAveragingMatrix_row_energy_uniform hD χ hχ hρ hN + (one_le_pow₀ (by norm_num)) hη hκ z S) + have hsum : ∑i∈I,flagRowConstant D ρ η/(2:ℝ)^i ≤ 2*flagRowConstant D ρ η/(2:ℝ)^n := by + have h : (∑i∈I,flagRowConstant D ρ η/(2:ℝ)^i)=flagRowConstant D ρ η*(∑i∈I,(1/2:ℝ)^i) := by + simp [Finset.mul_sum,div_eq_mul_inv] + rw [h] + have hh := mul_le_mul_of_nonneg_left (finite_half_geometric_tail I n hn) hC + simpa [div_pow,div_eq_mul_inv,mul_assoc,mul_left_comm,mul_comm] using hh + have hsum₀ : 0 ≤ ∑i∈I,flagRowConstant D ρ η/(2:ℝ)^i := + Finset.sum_nonneg (fun _ _ => by positivity) + calc + _ = w^2*(∑y∈S,(∑i∈I,flagAveragingMatrix χ ρ N ((2:ℝ)^i) η κ z y)^2) := by + simp_rw [mul_pow,Finset.mul_sum] + _ ≤ w^2*(∑i∈I,flagRowConstant D ρ η/(2:ℝ)^i)^2 := + mul_le_mul_of_nonneg_left hei (sq_nonneg _) + _ ≤ w^2*(2*flagRowConstant D ρ η/(2:ℝ)^n)^2 := by gcongr + _ = _ := by ring + +end PolygonDyadicRowEnergy + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/PrimitiveCovariance.lean b/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/PrimitiveCovariance.lean new file mode 100644 index 0000000000000000000000000000000000000000..29ea8ff34a365b43aa37093d43d4fe28c9e716fa --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/PrimitiveCovariance.lean @@ -0,0 +1,188 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.PrimitiveWords + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section PrimitiveCovariance + +@[simp] theorem spatialTranslate_zero {a : ℕ} (U : polygonAlgebra a) : + spatialTranslate 0 U = U := by + apply Subtype.ext + ext x + simp [spatialTranslate] + +theorem spatialTranslate_add {a : ℕ} (u v : CutRing × CutRing) (U : polygonAlgebra a) : + spatialTranslate (u+v) U = spatialTranslate u (spatialTranslate v U) := by + apply Subtype.ext + ext x + change translate a (-(u+v)) x ∈ U.val ↔ translate a (-v) (translate a (-u) x) ∈ U.val + rw [← translate_add,neg_add,add_comm] + +@[simp] theorem spatialTranslate_whole {a : ℕ} (u : CutRing × CutRing) : + spatialTranslate u (wholePolygon a) = wholePolygon a := by + apply Subtype.ext + rfl + +namespace CommonFrame + +variable {a m : ℕ} {r : CutRing} {hm : 2 ≤ m} + {I : Finset (Fin (m+1))} {u v : CutRing × CutRing} + +noncomputable def mul (F : CommonFrame a r m hm I u) (G : CommonFrame a r m hm I v) : + CommonFrame a r m hm I (u+v) where + k := F.k * G.k + d := F.d + G.d + projection := by rw [map_mul,F.projection,G.projection,trackTranslation_add] + common i hi := by simp only [Pi.add_apply,F.common i hi,G.common i hi] + +end CommonFrame + +namespace InitialCoverSystem + +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + +theorem primitiveCopy_frame (I : Finset (Fin (m+1))) + (b : Fin (m+1)) (hb : b ∉ I) (p : Fin 5 × (CutRing × CutRing)) + (F : CommonFrame a r m hm I p.2) : + B.primitiveCopy I b hb p = B.translatedAlphabet I p.1 F.k := + B.commonTranslatedAlphabet_independent (commonFrame a r m hm I b hb p.2) F p.1 rfl + +theorem primitiveCopy_translate_eq (I : Finset (Fin (m+1))) + (b : Fin (m+1)) (hb : b ∉ I) (j : Fin 5) (u v : CutRing × CutRing) + (huv : spatialTranslate u (initialTest a r j) = spatialTranslate v (initialTest a r j)) : + B.primitiveCopy I b hb (j,u) = B.primitiveCopy I b hb (j,v) := + B.commonTranslatedAlphabet_independent (commonFrame a r m hm I b hb u) + (commonFrame a r m hm I b hb v) j huv + +theorem translatedAlphabet_mul (I : Finset (Fin (m+1))) (j : Fin 5) + (k l : Multiplicative (FreeAbelianGroup (Fin m × Fin 2))) : + B.translatedAlphabet I j (k*l) = + (MulAut.conj (B.t k)).toMonoidHom.comp (B.translatedAlphabet I j l) := by + ext s + change B.t (k*l) * B.initialAlphabet I j s * (B.t (k*l))⁻¹ = + B.t k * (B.t l * B.initialAlphabet I j s * (B.t l)⁻¹) * (B.t k)⁻¹ + rw [map_mul] + group + +theorem primitiveCopy_conjugate (I : Finset (Fin (m+1))) + (b : Fin (m+1)) (hb : b ∉ I) (u : CutRing × CutRing) + (F : CommonFrame a r m hm I u) (p : Fin 5 × (CutRing × CutRing)) : + B.primitiveCopy I b hb (p.1,u+p.2) = + (MulAut.conj (B.t F.k)).toMonoidHom.comp (B.primitiveCopy I b hb p) := by + rw [B.primitiveCopy_frame I b hb _ (F.mul (commonFrame a r m hm I b hb p.2))] + exact B.translatedAlphabet_mul I p.1 F.k _ + +theorem primitiveCopy_zero (I : Finset (Fin (m+1))) + (b : Fin (m+1)) (hb : b ∉ I) (j : Fin 5) : + B.primitiveCopy I b hb (j,0) = B.initialAlphabet I j := by + let F : CommonFrame a r m hm I 0 := { + k := 1 + d := 0 + projection := by simp + common := by simp } + rw [B.primitiveCopy_frame I b hb _ F] + ext s + change B.t 1 * B.initialAlphabet I j s * (B.t 1)⁻¹ = B.initialAlphabet I j s + simp + +theorem initialAlphabet_conjugate_common (I : Finset (Fin (m+1))) + (b : Fin (m+1)) (hb : b ∉ I) (u : CutRing × CutRing) + (F : CommonFrame a r m hm I u) : + (MulAut.conj (B.t F.k)).toMonoidHom.comp (B.initialAlphabet I 0) = B.initialAlphabet I 0 := by + rw [← B.primitiveCopy_zero I b hb 0,← B.primitiveCopy_conjugate I b hb u F] + have hz : spatialTranslate (u+0) (initialTest a r 0) = + spatialTranslate 0 (initialTest a r 0) := by + change spatialTranslate (u+0) (wholePolygon a) = spatialTranslate 0 (wholePolygon a) + simp + rw [B.primitiveCopy_translate_eq I b hb 0 (u+0) 0 hz] + +end InitialCoverSystem +end PrimitiveCovariance + +section FamilyCovariance + +variable {ι E H Q : Type*} [Group E] [Group H] [Group Q] + +theorem copyFamilyEval_comp (F : ι → E →* H) (f : H →* Q) : + copyFamilyEval (fun i => f.comp (F i)) = f.comp (copyFamilyEval F) := by + apply FreeGroup.ext_hom + rintro ⟨i,s⟩ + simp + +theorem copyFamilyEval_reindex_range {κ : Type*} (F : ι → E →* H) (v : κ → ι) : + (copyFamilyEval (F ∘ v)).range ≤ (copyFamilyEval F).range := by + rw [copyFamilyEval_range,copyFamilyEval_range] + apply iSup_le + intro i + exact le_iSup (fun j => (F j).range) (v i) + +namespace InitialCoverSystem + +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + +theorem primitiveFamily_conjugate (I : Finset (Fin (m+1))) + (b : Fin (m+1)) (hb : b ∉ I) (P : ι → Fin 5 × (CutRing × CutRing)) + (u : CutRing × CutRing) (F : CommonFrame a r m hm I u) : + B.primitiveFamily I b hb (fun i => ((P i).1,u+(P i).2)) = + fun i => (MulAut.conj (B.t F.k)).toMonoidHom.comp (B.primitiveFamily I b hb P i) := by + funext i + cases i with + | none => exact (B.initialAlphabet_conjugate_common I b hb u F).symm + | some i => exact B.primitiveCopy_conjugate I b hb u F (P i) + +theorem PrimitiveFamilyLaw.translate (I : Finset (Fin (m+1))) + (b : Fin (m+1)) (hb : b ∉ I) (P : ι → Fin 5 × (CutRing × CutRing)) + (h : B.PrimitiveFamilyLaw I b hb P) (u : CutRing × CutRing) : + B.PrimitiveFamilyLaw I b hb (fun i => ((P i).1,u+(P i).2)) := by + unfold PrimitiveFamilyLaw + rw [B.primitiveFamily_conjugate I b hb P u (commonFrame a r m hm I b hb u), + copyFamilyEval_comp,MonoidHom.range_comp] + exact centralOn_conjugate _ _ _ h + +theorem PrimitiveFamilyLaw.reindex {κ : Type*} (I : Finset (Fin (m+1))) + (b : Fin (m+1)) (hb : b ∉ I) (P : ι → Fin 5 × (CutRing × CutRing)) + (h : B.PrimitiveFamilyLaw I b hb P) (v : κ → ι) : + B.PrimitiveFamilyLaw I b hb (P ∘ v) := by + apply CentralOn.mono h + have he : B.primitiveFamily I b hb (P ∘ v) = + B.primitiveFamily I b hb P ∘ Option.map v := by + funext i + cases i <;> rfl + rw [he] + exact copyFamilyEval_reindex_range _ _ + +theorem PrimitiveFamilyLaw.congr_offsets (I : Finset (Fin (m+1))) + (b : Fin (m+1)) (hb : b ∉ I) (P Q : ι → Fin 5 × (CutRing × CutRing)) + (hj : ∀ i, (P i).1 = (Q i).1) + (hp : ∀ i, spatialTranslate (P i).2 (initialTest a r (P i).1) = + spatialTranslate (Q i).2 (initialTest a r (Q i).1)) + (h : B.PrimitiveFamilyLaw I b hb P) : B.PrimitiveFamilyLaw I b hb Q := by + have he : B.primitiveFamily I b hb P = B.primitiveFamily I b hb Q := by + funext i + cases i with + | none => rfl + | some i => + change B.primitiveCopy I b hb (P i) = B.primitiveCopy I b hb (Q i) + have he : P i = ((Q i).1,(P i).2) := Prod.ext (hj i) rfl + rw [he] + exact B.primitiveCopy_translate_eq I b hb (Q i).1 (P i).2 (Q i).2 + (by simpa only [hj i] using hp i) + unfold PrimitiveFamilyLaw at h ⊢ + rwa [← he] + +end InitialCoverSystem +end FamilyCovariance + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/RecoveredConstantCovariance.lean b/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/RecoveredConstantCovariance.lean new file mode 100644 index 0000000000000000000000000000000000000000..a0e09f138ac0a7b1a35d9ad085158858c1eb15dd --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/RecoveredConstantCovariance.lean @@ -0,0 +1,154 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Configurations.DistinctSlotStars +import OAI.GroupTheory.SimpleAmenable.CentralCovers.CommonFrameTransport + +namespace OAI + +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement + +theorem initial_constant_covariance_eventually (a : ℕ) (r : CutRing) (m : ℕ) + (hm : 2 ≤ m) (hr : 0 < ordinary r ∧ ordinary r < 1/2) (hm' : 15 ≤ m+1) : + ∃ L : ℕ, ∀ M : ℕ, L ≤ M → ∀ B : InitialCoverSystem a r m hm M, + ∃ R : alternatingGroup (Fin (m+1)) → + Multiplicative (FreeAbelianGroup (Fin m × Fin 2)) →* + Multiplicative (FreeAbelianGroup (Fin m × Fin 2)), + ∀ s k, B.c s * B.t k * (B.c s)⁻¹ = B.t (R s k) := by + obtain ⟨L,hL⟩ := source_constant_covariance_eventually a r m hm hr hm' + refine ⟨L,fun M hM B => ?_⟩ + obtain ⟨c,hcp,hcb,R,hc⟩ := hL M hM + have he : c = B.c := by + apply MonoidHom.eq_of_eqOn_dense alternatingGroup.closure_isThreeCycles_eq_top + intro s hs + have hs' : s.val.support.card ≤ 5 := by rw [hs.card_support]; omega + exact (hcb ⟨s.val,s.property,hs'⟩).trans (B.c_base ⟨s.val,s.property,hs'⟩).symm + subst c + exact ⟨R,(hc B.t B.t_base).1⟩ + +namespace OffsetFrame +variable {a m : ℕ} {r : CutRing} {hm : 2 ≤ m} + +def zero (I : Finset (Fin (m+1))) : OffsetFrame a r m hm I (fun _ => 0) where + k := 1 + d := 0 + projection := by rw [map_one,trackTranslation_zero] + prescribed := by intros; rfl + +end OffsetFrame + +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + (hlarge : 15 < m+1) (h : B.AllPrimitiveLaws) (hr : 0 (B.polygonStar hlarge h hr V).range) (wholePolygon a)) + refine ⟨x,?_⟩ + rw [B.polygonStar_whole hlarge h hr] + exact congrArg B.c hx + +theorem distinctSlotStar_zero_constant (ι κ : Fin 5 ↪ Fin (m+1)) + (c : alternatingGroup (Fin (m+1))) (hc : ∀ j, c.val (ι j) = κ j) + (V : polygonAlgebra a) : + (MulAut.conj (B.c c)).toMonoidHom.comp + (B.distinctSlotStar hlarge h hr ι (fun _ => 0) (OffsetFrame.zero _) V) = + B.distinctSlotStar hlarge h hr κ (fun _ => 0) (OffsetFrame.zero _) V := by + apply B.distinctSlotStar_common_frame_transport hlarge h hr ι κ + (fun _ => 0) (fun _ => 0) (OffsetFrame.zero _) (OffsetFrame.zero _) rfl V (B.c c) + · change B.c c ∈ (⨆ V : polygonAlgebra a, (B.polygonStar hlarge h hr V).range).map + (MulAut.conj (B.t 1)).toMonoidHom + refine ⟨B.c c,B.constant_mem_polygonStars hlarge h hr c,?_⟩ + simp + · intro j x + rw [show coverMap M (alternatingGenerator a r m hm) (B.c c) = + conditionalAlternatingHom (wholePolygon a) c from DFunLike.congr_fun B.c_projection c] + change conditionalPerm (wholePolygon a) c.val (ι j,translate a 0 x.val) = + (κ j,translate a 0 x.val) + simp [conditionalPerm,wholePolygon,hc] + +theorem distinctSlotStar_offset_formula (ι : Fin 5 ↪ Fin (m+1)) + (u : Fin (m+1) → CutRing × CutRing) + (F : OffsetFrame a r m hm (orderedTrackAlphabet ι) u) (V : polygonAlgebra a) : + B.distinctSlotStar hlarge h hr ι u F V = + (MulAut.conj (B.t F.k)).toMonoidHom.comp + (B.distinctSlotStar hlarge h hr ι (fun _ => 0) (OffsetFrame.zero _) V) := by + ext s : 1 + simp [distinctSlotStar,frameStar,OffsetFrame.zero] + +def constantReindexedFrame + (R : alternatingGroup (Fin (m+1)) → + Multiplicative (FreeAbelianGroup (Fin m × Fin 2)) →* + Multiplicative (FreeAbelianGroup (Fin m × Fin 2))) + (hR : ∀ s k, B.c s * B.t k * (B.c s)⁻¹ = B.t (R s k)) + (ι κ : Fin 5 ↪ Fin (m+1)) (c : alternatingGroup (Fin (m+1))) + (hc : ∀ j, c.val (ι j) = κ j) + (u : Fin (m+1) → CutRing × CutRing) + (F : OffsetFrame a r m hm (orderedTrackAlphabet ι) u) : + OffsetFrame a r m hm (orderedTrackAlphabet κ) (fun i => u (c.val.symm i)) where + k := R c F.k + d := fun i => F.d (c.val.symm i) + projection := by + have he := congrArg (coverMap M (alternatingGenerator a r m hm)) (hR c F.k) + simp only [map_mul,map_inv] at he + rw [show coverMap M (alternatingGenerator a r m hm) (B.c c) = + conditionalAlternatingHom (wholePolygon a) c from DFunLike.congr_fun B.c_projection c, + show coverMap M (alternatingGenerator a r m hm) (B.t F.k) = + sourceLatticeMap a r m hm F.k from DFunLike.congr_fun B.t_projection F.k, + show coverMap M (alternatingGenerator a r m hm) (B.t (R c F.k)) = + sourceLatticeMap a r m hm (R c F.k) from DFunLike.congr_fun B.t_projection (R c F.k)] at he + have hf := congrArg Subtype.val he + change conditionalHom (wholePolygon a) c.val * sourceLatticeFullMap a r m hm F.k * + (conditionalHom (wholePolygon a) c.val)⁻¹ = sourceLatticeFullMap a r m hm (R c F.k) at hf + rw [F.projection,constant_conjugate_translation] at hf + exact hf.symm + prescribed := by + intro i hi + obtain ⟨j,_,rfl⟩ := Finset.mem_map.mp hi + have he : c.val.symm (κ j) = ι j := by rw [← hc j]; exact c.val.symm_apply_apply _ + rw [he] + exact F.prescribed (ι j) (orderedTrackAlphabet_mem ι j) + +theorem distinctSlotStar_constant_transport + (R : alternatingGroup (Fin (m+1)) → + Multiplicative (FreeAbelianGroup (Fin m × Fin 2)) →* + Multiplicative (FreeAbelianGroup (Fin m × Fin 2))) + (hR : ∀ s k, B.c s * B.t k * (B.c s)⁻¹ = B.t (R s k)) + (ι κ : Fin 5 ↪ Fin (m+1)) (c : alternatingGroup (Fin (m+1))) + (hc : ∀ j, c.val (ι j) = κ j) + (b : Fin (m+1)) (hb : b ∉ orderedTrackAlphabet κ) + (u v : Fin (m+1) → CutRing × CutRing) + (huv : ∀ j, u (ι j) = v (κ j)) + (F : OffsetFrame a r m hm (orderedTrackAlphabet ι) u) + (G : OffsetFrame a r m hm (orderedTrackAlphabet κ) v) (V : polygonAlgebra a) : + (MulAut.conj (B.c c)).toMonoidHom.comp (B.distinctSlotStar hlarge h hr ι u F V) = + B.distinctSlotStar hlarge h hr κ v G V := by + let H := B.constantReindexedFrame R hR ι κ c hc u F + have hG : B.distinctSlotStar hlarge h hr κ (fun i => u (c.val.symm i)) H V = + B.distinctSlotStar hlarge h hr κ v G V := by + unfold distinctSlotStar + rw [B.frameStar_independent hlarge h hr (orderedTrackAlphabet κ) + (by rw [orderedTrackAlphabet,Finset.card_map,Finset.card_univ,Fintype.card_fin]) + b hb (fun i => u (c.val.symm i)) v H G (by + intro i hi + obtain ⟨j,_,rfl⟩ := Finset.mem_map.mp hi + rw [← hc j,c.val.symm_apply_apply] + simpa only [hc j] using huv j) V] + rw [← hG,B.distinctSlotStar_offset_formula hlarge h hr ι u F V, + B.distinctSlotStar_offset_formula hlarge h hr κ (fun i => u (c.val.symm i)) H V] + ext s : 1 + have hz := DFunLike.congr_fun (B.distinctSlotStar_zero_constant hlarge h hr ι κ c hc V) s + change B.c c * B.distinctSlotStar hlarge h hr ι (fun _ => 0) (OffsetFrame.zero _) V s * (B.c c)⁻¹ = + B.distinctSlotStar hlarge h hr κ (fun _ => 0) (OffsetFrame.zero _) V s at hz + change B.c c * (B.t F.k * _ * (B.t F.k)⁻¹) * (B.c c)⁻¹ = B.t (R c F.k) * _ * (B.t (R c F.k))⁻¹ + rw [← hR c F.k,← hz] + group + +end InitialCoverSystem + +end SimpleAmenable + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/SignalCutoff.lean b/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/SignalCutoff.lean new file mode 100644 index 0000000000000000000000000000000000000000..86c491f50159b705ddfd0b852bc8fce609785705 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/SignalCutoff.lean @@ -0,0 +1,156 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.RandomFields.WeightedAveragingError + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section SignalCutoff +open Classical + +theorem scaledSiteConjugate_displacement {a m D : ℕ} {v : ℝ×ℝ} (hD : 0 ?_⟩ + rw [Prod.norm_def] + apply max_le <;> simp only [scaledSiteConjugate,Prod.fst_sub,Prod.snd_sub,Real.norm_eq_abs, + ← sub_div,abs_div,abs_of_pos hN] + · apply div_le_div_of_nonneg_right _ hN.le + exact (le_add_of_nonneg_right (abs_nonneg _)).trans (hb z) + · apply div_le_div_of_nonneg_right _ hN.le + exact (le_add_of_nonneg_left (abs_nonneg _)).trans (hb z) + +theorem flagSignalDifference_ne_zero_near {a m D : ℕ} {v : ℝ×ℝ} (hD : 0 q+ψ x) N z≠0) : + ‖scaledSiteConjugate N z‖ < K+Q/N := by + rw [flagSignalDifference_add_constant] at hz + by_cases hh : ψ (scaledSiteConjugate N z)=0 + · have hi : ψ (scaledSiteConjugate N (flagSiteAction hD g⁻¹ z))≠0 := by + intro he + exact hz (by simp [flagSignalDifference,flagMeanSignal,he,hh]) + have hn : ‖scaledSiteConjugate N (flagSiteAction hD g⁻¹ z)‖ hi (hcompact _ he)) + have ht := norm_le_norm_add_norm_sub (scaledSiteConjugate N (flagSiteAction hD g⁻¹ z)) + (scaledSiteConjugate N z) + linarith [hdisp z] + · have hn : ‖scaledSiteConjugate N z‖ hh (hcompact _ he)) + exact hn.trans_le (le_add_of_nonneg_right (div_nonneg hQ hN.le)) + +theorem flagSignalDifference_cutoff {a m D : ℕ} {v : ℝ×ℝ} (hD : 0 q+ψ x) N w≠0 → + χ (scaledSiteConjugate N z)=1 ∧ χ (scaledSiteConjugate N w)=1 := by + obtain ⟨Q,hQ,hdisp⟩ := scaledSiteConjugate_displacement (v:=v) hD g⁻¹ + refine ⟨Q,hQ,fun N r η hN hQN hη hη₁ z w hkw hw => ?_⟩ + have hwn := flagSignalDifference_ne_zero_near hD g ψ q hcompact hQ hN (hdisp N hN) w hw + have hQN' : Q/N ≤ 1 := (div_le_one hN).mpr hQN + have hn := planeTent_scaled_near hN hη z w + ((flagRowTent_ne_zero_iff _ _ _ _).mp hkw).2.2 + have hz := norm_le_norm_add_norm_sub (scaledSiteConjugate N w) (scaledSiteConjugate N z) + rw [norm_sub_rev] at hz + exact ⟨hχ _ (by linarith),hχ _ (by linarith)⟩ + +theorem compactSignal_amplitude {a m D : ℕ} {v : ℝ×ℝ} (hD : 0 q+ψ x) N z| ≤ C/N := by + obtain ⟨L₀,L₁,hL₀,hL₁⟩ := compactSignal_uniform_constants ψ hψ hs + obtain ⟨C,hC,hamp⟩ := flagSignalDifference_amplitude (v:=v) hD g ψ L₀.coe_nonneg (by + intro x y + have hh := hL₀.dist_le_mul x y + rw [Real.dist_eq,dist_eq_norm,Prod.norm_def] at hh + refine hh.trans (mul_le_mul_of_nonneg_left ?_ L₀.coe_nonneg) + simp only [Prod.fst_sub,Prod.snd_sub,Real.norm_eq_abs] + exact max_le (le_add_of_nonneg_right (abs_nonneg _)) (le_add_of_nonneg_left (abs_nonneg _))) + refine ⟨C,hC,fun N hN z => ?_⟩ + rw [flagSignalDifference_add_constant] + exact hamp N hN z + +end SignalCutoff + +section AveragingL1Rows +open Classical + +theorem flagAveragingMatrix_row_sum {a m D : ℕ} {v : ℝ×ℝ} (hD : 0 flagAveragingMatrix χ ρ N r η κ z w≠0) + have he : (∑w∈S,flagAveragingMatrix χ ρ N r η κ z w)= + ∑w∈T,flagAveragingMatrix χ ρ N r η κ z w := by + symm + apply Finset.sum_subset (Finset.filter_subset _ _) + intro w hw hwt + simpa [T,hw] using hwt + rw [he] + have hc := flagAveragingMatrix_row_card hD χ ρ κ hN hr hη z T + (fun w hw => (Finset.mem_filter.mp hw).2) + calc + _ ≤ ∑_w∈T,(ρ*(r*η)^2)⁻¹ := Finset.sum_le_sum + (fun w _ => (flagAveragingMatrix_entry_bounds χ hχ hρ hN hr hη hκ z w).2) + _ = (T.card:ℝ)*(ρ*(r*η)^2)⁻¹ := by simp + _ ≤ (4*(D:ℝ)^2*r*η+2)^2*(ρ*(r*η)^2)⁻¹ := mul_le_mul_of_nonneg_right hc (by positivity) + _ = _ := by rw [div_eq_mul_inv] + +theorem flagAveragingMatrix_row_sum_uniform {a m D : ℕ} {v : ℝ×ℝ} (hD : 0 hS i hi) + _ = _ := (Finset.sum_subset Finset.subset_union_right (fun i _ hi => hT i hi)).symm + +theorem flagSignal_good_row_constants {a m D : ℕ} {v : ℝ×ℝ} (hD : 0 q+ψ x) N z| ≤ Ca/N) ∧ + ∀(N r η κ : ℝ),0 q+ψ x) N w=0) → + |(∑w∈J,flagAveragingMatrix χ ((D:ℝ)^4/5) N r η κ z w* + flagSignalDifference hD g (fun x => q+ψ x) N w)- + flagSignalDifference hD g (fun x => q+ψ x) N z| ≤ + (Cv*η/N)*(1+38880/((D:ℝ)*Real.sqrt (r*η)))+ + (Ca/N)*(38880/((D:ℝ)*Real.sqrt (r*η))) := by + obtain ⟨R,hR,hcharts⟩ := flagAffineData_separator_control (v:=v) g⁻¹ + obtain ⟨Q,hQ,hcutoff⟩ := flagSignalDifference_cutoff (v:=v) hD g ψ χ q hcompact hχ + obtain ⟨Cv,hCv,hvar⟩ := flagSignalDifference_chart_variation (v:=v) hD g ψ hψ hsψ q + obtain ⟨Ca,hCa,hamp⟩ := compactSignal_amplitude (v:=v) hD g ψ hψ hsψ q + refine ⟨R,Q,Cv,Ca,hR,hQ,hCv,hCa,hamp,fun N r η κ hN hQN hr hη hη₁ hκ hscale hline hRf z J hz hJ => ?_⟩ + let h := flagSignalDifference (v:=v) hD g (fun x => q+ψ x) N + obtain ⟨T,hT,herror⟩ := flagAveragingMatrix_good_row_error hD χ h hN hr hη hκ hscale hline + (show 0 ≤ Cv*η/N by positivity) z hz (hamp N hN z) (hcutoff N r η hN hQN hη hη₁ z) (by + intro w hw + obtain ⟨ht,hord,hconj⟩ := (flagRowTent_ne_zero_iff _ _ _ _).mp hw + have hsep := flagRowTent_separator_one (div_pos hr hN) hκ (N*η) z w hz hw + have hchart : flagAffineData g⁻¹ z.val.1 z.val.2=flagAffineData g⁻¹ w.val.1 w.val.2 := by + rw [← ht] + exact hcharts (r/N) κ (div_pos hr hN) hκ hRf z.val.1 z.val.2 w.val.2 (by rw [hsep]; norm_num) + have hv := hvar N η hN hη.le z w hchart (planeTent_scaled_near hN hη z w hconj) + simpa only [abs_sub_comm] using hv) + have he := finset_sum_eq_of_zero_outside + (fun w => flagAveragingMatrix χ ((D:ℝ)^4/5) N r η κ z w*h w) J T hJ hT + change |(∑w∈J,flagAveragingMatrix χ ((D:ℝ)^4/5) N r η κ z w*h w)-h z| ≤ _ + rw [he] + exact herror + +end SignalGoodRows + +section SignalActiveBox +open Classical + +noncomputable def flagBoxFinset {a m D : ℕ} {v : ℝ×ℝ} (hD : 0 q+ψ x) N z=0 := by + obtain ⟨Q,hQ,hdisp⟩ := scaledSiteConjugate_displacement (v:=v) hD g⁻¹ + refine ⟨Q,hQ,fun N hN hQN z hz => ?_⟩ + by_contra hh + have hn := flagSignalDifference_ne_zero_near hD g ψ q hcompact hQ hN (hdisp N hN) z hh + simp only [scaledSiteConjugate] at hn + have hqn : Q/N ≤ 1 := (div_le_one hN).mpr hQN + have hx := norm_fst_le (scaledSiteConjugate N z) + have hy := norm_snd_le (scaledSiteConjugate N z) + simp only [scaledSiteConjugate,Real.norm_eq_abs,abs_div,abs_of_pos hN] at hx hy + apply hz + rw [mem_flagBoxFinset] + have hxL : |(flagSiteConjugate z).1|/N ≤ L := by linarith + have hyL : |(flagSiteConjugate z).2|/N ≤ L := by linarith + exact ⟨by simpa only [mul_comm L N] using (div_le_iff₀ hN).mp hxL, + by simpa only [mul_comm L N] using (div_le_iff₀ hN).mp hyL⟩ + +theorem flagBoxFinset_card_quadratic {a m D : ℕ} {v : ℝ×ℝ} (hD : 0 (mem_flagBoxFinset _ _ _).mp hz) + have he : 2*(D:ℝ)^2*(N*L)+2 ≤ (2*(D:ℝ)^2*L+2)*N := by nlinarith + refine hh.trans ?_ + calc + _ ≤ m*((2*(D:ℝ)^2*L+2)*N)^2 := by gcongr + _ = _ := by ring + +end SignalActiveBox + +section ApproximationEnergy +open Classical + +noncomputable def flagVolumeConstant (m D : ℕ) (Q : ℝ) : ℝ := m*(2*(D:ℝ)^2*Q+2)^2 +noncomputable def flagExceptionalConstant (a m D : ℕ) (Q : ℝ) : ℝ := + 4*(m*(4*(D:ℝ)^2*(1+|conjugate (cutTau^a)|)*(1+|ordinary (cutTau^a)|)*Q+2)* + (2*(D:ℝ)^2*Q+2)*(16*(1+|ordinary (cutTau^a)|)+2)) +noncomputable def flagRowSumConstant (D : ℕ) : ℝ := (4*(D:ℝ)^2+2)^2/((D:ℝ)^4/5)+1 + +theorem flag_good_bad_energy {a m D : ℕ} {v : ℝ×ℝ} (hD : 0 ¬flagGoodRow s κ z) + have hb : (B.card:ℝ) ≤ flagExceptionalConstant a m D Q*(κ+s)*N^2 := by + apply flagBadSeparatorRow_card_bound hD hQ hκ hs hs₁ hN hscale B + intro z hz + obtain ⟨hzt,hzb⟩ := Finset.mem_filter.mp hz + refine ⟨hT z hzt,?_⟩ + simp only [flagGoodRow,not_forall,not_lt] at hzb + obtain ⟨j,c,hc,he⟩ := hzb + exact ⟨j,c,hc,he⟩ + have ht : (T.card:ℝ) ≤ flagVolumeConstant m D Q*N^2 := by + have hh := flagSiteBox_card_bound hD (mul_pos hQ hN') T hT + have he : 2*(D:ℝ)^2*(Q*N)+2 ≤ (2*(D:ℝ)^2*Q+2)*N := by nlinarith + refine hh.trans ?_ + calc + _ ≤ m*((2*(D:ℝ)^2*Q+2)*N)^2 := by gcongr + _ = _ := by dsimp [flagVolumeConstant]; ring + have hh := squared_error_good_bad T B e (div_nonneg hE hN'.le) (div_nonneg hH hN'.le) + (by + intro z hz hzb + apply hgood z hz + by_contra he + exact hzb (Finset.mem_filter.mpr ⟨hz,he⟩)) hbad + refine hh.trans ?_ + calc + _ ≤ (flagVolumeConstant m D Q*N^2)*(E/N)^2+ + (flagExceptionalConstant a m D Q*(κ+s)*N^2)*(H/N)^2 := by + gcongr + _ = _ := by field_simp + +end ApproximationEnergy + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/SignalRemainder.lean b/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/SignalRemainder.lean new file mode 100644 index 0000000000000000000000000000000000000000..4e7a277d1c92608dc4428188a8ee254b91a95f29 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/SignalRemainder.lean @@ -0,0 +1,187 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.RandomFields.CovarianceLimit +import OAI.GroupTheory.SimpleAmenable.RandomFields.CompactSignalEnergy + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section SourceSignalRemainder +open Classical Filter +open scoped Topology + +noncomputable def sourceSignalDelta (D : ℕ) (η : ℝ) (n : ℕ) : ℝ := + 38880/((D:ℝ)*Real.sqrt ((2:ℝ)^n*η)) + +noncomputable def sourceSignalError (A B Cv Ca Cr η κ : ℝ) (D n : ℕ) : ℝ := + Real.sqrt A*(Cv*η*(1+sourceSignalDelta D η n)+Ca*sourceSignalDelta D η n)+ + Real.sqrt B*Real.sqrt (κ+(1/4:ℝ)^n)*(Cr*Ca) + +theorem sourceSignalDelta_nonneg (D n : ℕ) (η : ℝ) : 0 ≤ sourceSignalDelta D η n := by + unfold sourceSignalDelta; positivity + +theorem sourceSignalDelta_tendsto {D : ℕ} (hD : 0 38880/((D:ℝ)*Real.sqrt ((2:ℝ)^n*η))) atTop (nhds 0) + simpa only [div_eq_mul_inv,mul_zero,Function.comp_apply,Pi.inv_apply] using hh + +theorem sourceSignalDelta_bound {D n i : ℕ} {η : ℝ} (hD : 0 (1/4:ℝ)^n) atTop (nhds 0) := + tendsto_pow_atTop_nhds_zero_of_lt_one (by norm_num) (by norm_num) + have hh := ((hδ.const_add 1).const_mul (Cv*η) |>.add (hδ.const_mul Ca) |>.const_mul (Real.sqrt A)).add + (((hs.const_add κ).sqrt.const_mul (Real.sqrt B)).mul_const (Cr*Ca)) + change Tendsto (fun n => Real.sqrt A*(Cv*η*(1+sourceSignalDelta D η n)+Ca*sourceSignalDelta D η n)+ + Real.sqrt B*Real.sqrt (κ+(1/4:ℝ)^n)*(Cr*Ca)) atTop _ + simpa only [mul_zero,add_zero,mul_one,mul_assoc,mul_left_comm,mul_comm] using hh + +theorem sourceSignalBound_tendsto {D : ℕ} (hD : 0 C/(1+sourceDyadicMass n)+sourceSignalError A B Cv Ca Cr η κ D n) + atTop (nhds (Real.sqrt A*Cv*η+Real.sqrt B*Cr*Ca*Real.sqrt κ)) := by + have hm : Tendsto (fun n => 1+sourceDyadicMass n) atTop atTop := + tendsto_atTop_mono (fun n => by linarith : ∀n,sourceDyadicMass n ≤ 1+sourceDyadicMass n) sourceDyadicMass_tendsto + have ht := hm.inv_tendsto_atTop.const_mul C + have ht' : Tendsto (fun n => C/(1+sourceDyadicMass n)) atTop (nhds 0) := by + simpa only [div_eq_mul_inv,mul_zero,Pi.inv_apply] using ht + simpa only [zero_add] using ht'.add (sourceSignalError_tendsto hD A B Cv Ca Cr κ hη) + +end SourceSignalRemainder + +section PolygonSignalInverse +open Classical Filter Matrix +open scoped Topology + +theorem sourceFlagMatrix_inverse_signal {a m D : ℕ} {v : ℝ×ℝ} (hD : 0 sourceFlagMatrix (v:=v) χ ((D:ℝ)^4/5) η κ n z.val w.val)))⁻¹*ᵥ + (fun z : T => flagSignalDifference (v:=v) hD g (fun x => q+ψ x) (sourceDyadicN n) z.val)) ≤ + C₁*η+C₂*Real.sqrt κ+ε := by + obtain ⟨R,Q,Cv,Ca,hR,hQ,hCv,hCa,happrox⟩ := + polygon_signal_approx_identity (v:=v) hD g ψ χ hψ hsψ q K L hL hKL hcompact hχ hχ₁ hχc + obtain ⟨C,hC,henergy⟩ := compactSignal_energy (v:=v) hD g ψ hψ hsψ q + let A := flagVolumeConstant m D L + let B := flagExceptionalConstant a m D L + let Cr := flagRowSumConstant D + have hA : 0≤A := by dsimp [A,flagVolumeConstant]; positivity + have hB : 0≤B := by dsimp [B,flagExceptionalConstant]; positivity + have hCr : 0≤Cr := by dsimp [Cr,flagRowSumConstant]; positivity + refine ⟨Real.sqrt A*Cv,Real.sqrt B*Cr*Ca,by positivity,by positivity, + fun η hη hη₁ κ hκ ε hε => ?_⟩ + have ht := sourceSignalBound_tendsto hD A B Cv Ca Cr C κ hη + have ht' := ht.eventually_lt_const + (show Real.sqrt A*Cv*η+Real.sqrt B*Cr*Ca*Real.sqrt κ < + (Real.sqrt A*Cv)*η+(Real.sqrt B*Cr*Ca)*Real.sqrt κ+ε by linarith) + filter_upwards [ht',sourceDyadic_radius_eventually Q,sourceDyadic_radius_eventually (36/η), + sourceDyadic_fine_eventually (max R 1) hκ] with n hn hQN hrad hf + intro T hJT + let N := sourceDyadicN n + have hN : 0 q+ψ x) N + let M : ℕ → Matrix T T ℝ := fun i => (fun (z w : T) => flagAveragingMatrix (a:=a) (m:=m) (D:=D) (v:=v) χ ((D:ℝ)^4/5) N ((2:ℝ)^i) η κ z.val w.val) + have hd : (0:ℝ) z.val) + have he (i : ℕ) (hi : i∈sourceDyadicIndices n) : + finiteL2Norm (M i*ᵥ(fun z : T => h z)-(fun z : T => h z)) ≤ + sourceSignalError A B Cv Ca Cr η κ D n := by + have his := sourceDyadic_scale_bounds hi + have hiv := (Finset.mem_Icc.mp hi).1 + have hri : 36≤(2:ℝ)^i*η := by + apply (div_le_iff₀ hη).mp + exact hrad.trans (pow_le_pow_right₀ (by norm_num) hiv) + have hfR := (le_max_left R 1).trans (hf i hi) + have hf1 := (le_max_right R 1).trans (hf i hi) + have hline : 1≤2*κ/((2:ℝ)^i/N) := by + rw [mul_div_assoc] + linarith + obtain ⟨hesupp,herr⟩ := happrox N ((2:ℝ)^i) η κ hN₁ hQN' his.1 his.2.1 hη hη₁ hκ hri hline hfR + let ei := fun z => (∑w∈J,flagAveragingMatrix χ ((D:ℝ)^4/5) N ((2:ℝ)^i) η κ z w*h w)-h z + have hee := finite_support_error_energy J T hJT + (flagAveragingMatrix χ ((D:ℝ)^4/5) N ((2:ℝ)^i) η κ) h + (by + intro z w hw + rw [flagAveragingMatrix_box_support hD χ hL hN hχc _ _ _ _ z w (Or.inr hw),zero_mul]) + ei (fun _ => rfl) hesupp + let δ := 38880/((D:ℝ)*Real.sqrt ((2:ℝ)^i*η)) + have hc : 0≤Cv*η*(1+δ)+Ca*δ := by dsimp [δ]; positivity + have hκs : 0≤κ+(2:ℝ)^i/N := by positivity + have hb : finiteL2Norm (M i*ᵥ(fun z : T => h z)-(fun z : T => h z)) ≤ + Real.sqrt A*(Cv*η*(1+δ)+Ca*δ)+Real.sqrt (B*(κ+(2:ℝ)^i/N))*(Cr*Ca) := by + apply finiteL2Norm_le_of_energy hA (mul_nonneg hB hκs) hc (mul_nonneg hCr hCa) + rw [hee] + exact herr + rw [Real.sqrt_mul hB] at hb + refine hb.trans ?_ + have hd := sourceSignalDelta_bound hD hη hiv + change δ ≤ sourceSignalDelta D η n at hd + dsimp only [sourceSignalError] + gcongr + exact his.2.2 + have hs := finite_weighted_resolvent (sourceDyadicIndices n) M hM + (sourceDyadicWeight_nonneg n) (sourceSignalError_nonneg hCv hCa hCr hη.le D n) + (fun z : T => h z) he + have hnorm : finiteL2Norm (fun z : T => h z) ≤ C := by + apply (sq_le_sq₀ (finiteL2Norm_nonneg _) hC).mp + rw [finiteL2Norm_sq] + rw [show (∑i : T,h i.val^2) = ∑i∈T,h i^2 from Finset.sum_coe_sort T (fun i => h i^2)] + exact henergy N hN₁ T + have hmatrix : (sourceDyadicWeight n • ∑i∈sourceDyadicIndices n,M i)= + (fun (z w : T) => sourceFlagMatrix (v:=v) χ ((D:ℝ)^4/5) η κ n z.val w.val) := by + ext z w + simp only [Matrix.smul_apply,smul_eq_mul,Matrix.sum_apply] + simp only [M,N,sourceFlagMatrix] + dsimp only at hs + rw [hmatrix] at hs + change _ ≤ finiteL2Norm (fun z : T => h z)/(1+sourceDyadicMass n)+_ at hs + refine hs.trans ((add_le_add ?_ le_rfl).trans hn.le) + apply div_le_div_of_nonneg_right hnorm + linarith [sourceDyadicMass_nonneg n] + +end PolygonSignalInverse + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/ThresholdField.lean b/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/ThresholdField.lean new file mode 100644 index 0000000000000000000000000000000000000000..805dded27afc22a85110c7eace3c9f12937aa6c3 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/ThresholdField.lean @@ -0,0 +1,194 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.RandomFields.FieldHS + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section ThresholdField +open Classical MeasureTheory Set + +noncomputable def thresholdField {ι : Type*} (x : ι → ℝ) : ι → Bool := + fun z => if 0 thresholdField x (e.symm z)) := rfl + +def signalSuccess {ι : Type*} (a : ι → ℝ) (b : ι → Bool) : Prop := + ∀z,(2≤a z → b z=true) ∧ (a z≤-2 → b z=false) + +theorem signalSuccess_measurable {ι : Type*} [Countable ι] (a : ι → ℝ) : + MeasurableSet {b : ι → Bool | signalSuccess a b} := by + unfold signalSuccess + measurability + +theorem signalSuccess_of_noise {ι : Type*} (J : Finset ι) (a : ι → ℝ) + (B : Matrix ι ι ℝ) (x : ι → ℝ) (hx : ∀z,x z∈Icc (-1:ℝ) 1) + (hB : ∀z,|∑w∈J,B z w*x w|<1/2) : + signalSuccess a (thresholdField (finiteCoefficientField J a B x)) := by + intro z + have hn := abs_lt.mp (hB z) + have hxz := hx z + rcases hxz with ⟨hxlo,hxhi⟩ + constructor + · intro ha + have hh : 0 sourceFlagMatrix χ ρ η κ n z.val w.val) + let C : Matrix T T ℝ := Matrix.of (fun z w => sourceFlagMatrix χ ρ η κ n + (flagSiteAction hD g⁻¹ z.val) (flagSiteAction hD g⁻¹ w.val)) + ObservableClose (sourceSmoothFieldLaw (v:=v) hD θ χ hL ρ η κ n) + ((sourceSmoothFieldLaw (v:=v) hD θ χ hL ρ η κ n).map (fieldReindex (flagSitePermutation hD g))) + (smoothNoiseTransportError B C (fun z : T => flagSignalDifference hD g θ (sourceDyadicN n) z.val)) := by + let J := flagBoxFinset (a:=a) (m:=m) (v:=v) hD (mul_pos (sourceDyadicN_pos n) hL) + let T := sourceCommonSites (v:=v) hD g hL n + let e := flagSitePermutation (v:=v) hD g + have hout (z : FlagSite a m D v) (hz : z∉T) : z∉J := + fun hh => hz (Finset.mem_union_left _ hh) + have hinv (z : FlagSite a m D v) (hz : z∉T) : e.symm z∉J := by + intro hh + apply hz + exact Finset.mem_union_right _ (Finset.mem_image.mpr ⟨e.symm z,hh,e.apply_symm_apply z⟩) + have hmean (z : FlagSite a m D v) (hz : z∉J) : flagMeanSignal θ (sourceDyadicN n) z=q := + flagMeanSignal_outside θ (sourceDyadicN_pos n) hθc z (by simpa only [J,mem_flagBoxFinset] using hz) + have hrow (z : FlagSite a m D v) (hz : z∉J) (w : FlagSite a m D v) : + sourceFlagMatrix χ ρ η κ n z w=0 := + sourceFlagMatrix_box_support hD χ hL hχc ρ η κ n z w (Or.inl hz) + have hpsd := sourceFlagMatrix_posSemidef (a:=a) (m:=m) (D:=D) (v:=v) (η:=η) χ hρ hκ n + rw [sourceSmoothFieldLaw_transported hD g θ χ hL hχc, + sourceSmoothFieldLaw_as_common hD g θ χ hL hχc] + convert! finiteCoefficientField_close T (flagMeanSignal θ (sourceDyadicN n)) + (fun z => flagMeanSignal θ (sourceDyadicN n) (e.symm z)) + (Matrix.of (sourceFlagMatrix χ ρ η κ n)) + ((Matrix.of (sourceFlagMatrix χ ρ η κ n)).submatrix e.symm e.symm) q + (fun z hz => hmean z (hout z hz)) + (fun z hz => hmean (e.symm z) (hinv z hz)) + (fun z hz w => hrow z (hout z hz) w) + (fun z hz w => hrow (e.symm z) (hinv z hz) (e.symm w)) + hpsd (hpsd.submatrix e.symm) using 1 + +end SourceFieldClose + +section SourceBitField +open Classical MeasureTheory Filter Set +open scoped Topology + +noncomputable def sourceBitFieldLaw {a m D : ℕ} {v : ℝ×ℝ} (hD : 0 (sourceBitFieldLaw (a:=a) (m:=m) (v:=v) hD θ χ hL ρ η κ n).real + {b | ¬signalSuccess (flagMeanSignal θ (sourceDyadicN n)) b}) atTop (nhds 0) := by + let μ := independentSmoothNoiseLaw (FlagSite a m D v) + have ht := sourceFlagMatrix_concentration (v:=v) hD χ hχ hL hχc hρ hη hκ + (show (0:ℝ)<1/2 by norm_num) μ (fun i x => x i) + (independentSmoothNoiseLaw_independent _) (fun i => (measurable_pi_apply i).aemeasurable) + (independentSmoothNoiseLaw_bounded _) (independentSmoothNoiseLaw_centered _) + apply squeeze_zero (fun n => measureReal_nonneg) _ ht + intro n + unfold sourceBitFieldLaw sourceSmoothFieldLaw + have hs : MeasurableSet {b : FlagSite a m D v → Bool | ¬signalSuccess (flagMeanSignal θ (sourceDyadicN n)) b} := + (signalSuccess_measurable _).compl + rw [map_measureReal_apply thresholdField_measurable hs, + map_measureReal_apply (finiteCoefficientField_measurable _ _ _) + (thresholdField_measurable hs)] + apply ENNReal.toReal_mono (measure_ne_top μ _) + apply measure_mono_ae + have hb : ∀ᵐx ∂μ,∀z,x z∈Icc (-1:ℝ) 1 := ae_all_iff.mpr (independentSmoothNoiseLaw_bounded _) + filter_upwards [hb] with x hx + intro hbad + by_contra hnone + apply hbad + apply signalSuccess_of_noise _ _ _ _ hx + intro z + have hh : ¬(1/2:ℝ)≤|∑y∈sourceActiveSites (v:=v) hD hL n,sourceFlagMatrix χ ρ η κ n z y*x y| := + fun hz => hnone ⟨z,hz⟩ + exact lt_of_not_ge hh + +noncomputable def extendFiniteBits {ι : Type*} (J : Finset ι) (b : J → Bool) : ι → Bool := + fun z => if hz : z∈J then b ⟨z,hz⟩ else false + +theorem finiteBitWindow_finite {ι : Type*} (J : Finset ι) : + Set.Finite {b : ι → Bool | ∀z,z∉J → b z=false} := by + apply (Set.finite_range (extendFiniteBits J)).subset + intro b hb + refine ⟨fun z => b z.val,?_⟩ + funext z + by_cases hz : z∈J + · simp only [extendFiniteBits,dite_eq_left hz] + · simp only [extendFiniteBits,dite_eq_right hz,hb z hz] + +theorem sourceBitFieldLaw_finite_support {a m D : ℕ} {v : ℝ×ℝ} (hD : 0 sourceFlagMatrix χ ρ η κ n z.val w.val) + let C : Matrix T T ℝ := Matrix.of (fun z w => sourceFlagMatrix χ ρ η κ n + (flagSiteAction hD g⁻¹ z.val) (flagSiteAction hD g⁻¹ w.val)) + let h : T → ℝ := fun z => flagSignalDifference hD g θ (sourceDyadicN n) z.val + matrixHSNorm (C-B) ≤ d → finiteL2Norm ((1+B)⁻¹*ᵥh) ≤ b → + ObservableClose (sourceSmoothFieldLaw (v:=v) hD θ χ hL ρ η κ n) + ((sourceSmoothFieldLaw (v:=v) hD θ χ hL ρ η κ n).map + (fieldReindex (flagSitePermutation hD g))) + (smoothNoiseTransportConstant*(d+(1+d)*b)) := by + intro T B C h hh hi + have hc := sourceSmoothFieldLaw_close (v:=v) (η:=η) hD g θ χ hL hχc q hθc hρ hκ n + exact hc.mono (smoothNoiseTransportError_of_bounds B C h hd hh hi) + +end SourceTransportEstimate + +section SourceTransportConstants +open Classical Matrix MeasureTheory Filter +open scoped Topology + +theorem sourceSmoothFieldLaw_transport_constants {a m D : ℕ} {v : ℝ×ℝ} (hD : 0 q+ψ x) χ hL ((D:ℝ)^4/5) η κ n) + ((sourceSmoothFieldLaw (v:=v) hD (fun x => q+ψ x) χ hL ((D:ℝ)^4/5) η κ n).map + (fieldReindex (flagSitePermutation hD g))) + (smoothNoiseTransportConstant*(d+(1+d)*(C₁*η+C₂*Real.sqrt κ+δ))) := by + obtain ⟨C₁,C₂,hC₁,hC₂,hinv⟩ := sourceFlagMatrix_inverse_signal (v:=v) hD g ψ χ hψ hsψ q K L hL hKL hcompact hχ hχ₁ hχc + refine ⟨C₁,C₂,hC₁,hC₂,?_⟩ + intro η hη hη₁ κ hκ δ d hδ hd + have hD' : (0:ℝ) + sourceFlagMatrix χ ((D:ℝ)^4/5) η κ n z.val w.val) + let C (n : ℕ) : Matrix (T n) (T n) ℝ := Matrix.of (fun z w => + sourceFlagMatrix χ ((D:ℝ)^4/5) η κ n (flagSiteAction hD g⁻¹ z.val) (flagSiteAction hD g⁻¹ w.val)) + let h (n : ℕ) : T n → ℝ := fun z => flagSignalDifference hD g (fun x => q+ψ x) (sourceDyadicN n) z.val + have hhs : Tendsto (fun n => matrixHSNorm (C n-B n)) atTop (nhds 0) := by + convert! sourceFlagMatrix_HS_tendsto hD g χ hχ hL hχc hΛ hρ hη hκ hLip T using 1 + filter_upwards [hinv η hη hη₁ κ hκ δ hδ,hhs.eventually_lt_const hd] with n hn hdn + have hi : finiteL2Norm ((1+B n)⁻¹*ᵥh n)≤C₁*η+C₂*Real.sqrt κ+δ := by + exact hn (T n) Finset.subset_union_left + have hθc : ∀x,L≤‖x‖ → q+ψ x=q := by + intro x hx + rw [hcompact x (by linarith only [hx,hKL]),add_zero] + exact sourceSmoothFieldLaw_transportEstimate (v:=v) (η:=η) hD g (fun x => q+ψ x) χ + hL hχc q hθc hρ hκ n d (C₁*η+C₂*Real.sqrt κ+δ) hd.le hdn.le hi + +end SourceTransportConstants + +section SignalTransport +open Classical MeasureTheory Filter +open scoped Topology +namespace FieldSignalData + +theorem realLaw_transport_constants (S : FieldSignalData) + {a m D : ℕ} {v : ℝ×ℝ} (hD : 0 ?_⟩ + filter_upwards [h η hη hη₁ κ hκ δ d hδ hd] with n hn + exact hn.threshold_transport _ _ + +end FieldSignalData +end SignalTransport + +section SourceFieldTransport +open Classical Matrix MeasureTheory Filter +open scoped Topology + +theorem sourceSmoothFieldLaw_transport {a m D : ℕ} {v : ℝ×ℝ} (hD : 0 q+ψ x) χ hL ((D:ℝ)^4/5) η κ n) + ((sourceSmoothFieldLaw (v:=v) hD (fun x => q+ψ x) χ hL ((D:ℝ)^4/5) η κ n).map + (fieldReindex (flagSitePermutation hD g))) ε := by + obtain ⟨C₁,C₂,hC₁,hC₂,ht⟩ := sourceSmoothFieldLaw_transport_constants (v:=v) hD g ψ χ + hψ hsψ q K L Λ hL hKL hcompact hχ hχ₁ hχc hΛ hLip + obtain ⟨η,κ,δ,d,hη,hη₁,hκ,hδ,hd,hparameters⟩ := + smallTransportParameters smoothNoiseTransportConstant_pos hC₁ hC₂ hε + refine ⟨η,κ,hη,hη₁,hκ,?_⟩ + filter_upwards [ht η hη hη₁ κ hκ δ d hδ hd] with n hn + exact hn.mono (hparameters d (C₁*η+C₂*Real.sqrt κ+δ) hd.le le_rfl (by positivity) le_rfl).le + +end SourceFieldTransport + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/UniformThresholdCDF.lean b/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/UniformThresholdCDF.lean new file mode 100644 index 0000000000000000000000000000000000000000..a31b93b478da0b2bde2869bef1974d5f6afbaeca --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/UniformThresholdCDF.lean @@ -0,0 +1,192 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.TentMatrixPositivity +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.FlagSeparatingLevels + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section UniformThresholdCDF +open Classical MeasureTheory ProbabilityTheory + +noncomputable def intervalCDF (lo hi d : ℝ) : ℝ := max (min hi d-lo) 0 / (hi-lo) + +theorem intervalCDF_bounds {lo hi d : ℝ} (h : lo < hi) : + 0 ≤ intervalCDF lo hi d ∧ intervalCDF lo hi d ≤ 1 := by + have hh := sub_pos.mpr h + constructor + · exact div_nonneg (le_max_right _ _) hh.le + · apply (div_le_one hh).mpr + exact max_le (sub_le_sub_right (min_le_left _ _) _) hh.le + +theorem intervalCDF_lipschitz {lo hi : ℝ} (h : lo < hi) (d e : ℝ) : + |intervalCDF lo hi d-intervalCDF lo hi e| ≤ |d-e|/(hi-lo) := by + have hh := sub_pos.mpr h + simp only [intervalCDF,← sub_div,abs_div,abs_of_pos hh] + apply (div_le_div_iff_of_pos_right hh).mpr + have h₁ := abs_max_sub_max_le_abs (min hi d-lo) (min hi e-lo) 0 + have h₂ := abs_min_sub_min_le_max hi d hi e + calc + _ ≤ |(min hi d-lo)-(min hi e-lo)| := h₁ + _ = |min hi d-min hi e| := by congr 1; ring + _ ≤ |d-e| := by simpa only [sub_self,abs_zero,max_eq_right (abs_nonneg (d-e))] using h₂ + +theorem uniformInterval_Iio {lo hi : ℝ} (h : lo < hi) (d : ℝ) : + (cond volume (Set.Icc lo hi)).real (Set.Iio d)=intervalCDF lo hi d := by + rw [measureReal_def,cond_apply measurableSet_Icc,ENNReal.toReal_mul, + ENNReal.toReal_inv,Real.volume_Icc,ENNReal.toReal_ofReal (sub_nonneg.mpr h.le)] + by_cases hd : d ≤ hi + · have he : Set.Icc lo hi ∩ Set.Iio d = Set.Ico lo d := by + ext x + exact ⟨fun hx => ⟨hx.1.1,hx.2⟩,fun hx => ⟨⟨hx.1,hx.2.le.trans hd⟩,hx.2⟩⟩ + rw [he,Real.volume_Ico,ENNReal.toReal_ofReal'] + simp [intervalCDF,min_eq_right hd,div_eq_mul_inv,mul_comm] + · have he : Set.Icc lo hi ∩ Set.Iio d = Set.Icc lo hi := by + ext x + exact ⟨fun hx => hx.1,fun hx => ⟨hx,lt_of_le_of_lt hx.2 (lt_of_not_ge hd)⟩⟩ + rw [he,Real.volume_Icc,ENNReal.toReal_ofReal'] + simp [intervalCDF,min_eq_left (le_of_not_ge hd),div_eq_mul_inv,mul_comm] + +theorem unit_product_sub_bound {ι : Type*} (S : Finset ι) (f g : ι → ℝ) + (hf : ∀i∈S,0 ≤ f i ∧ f i ≤ 1) (hg : ∀i∈S,0 ≤ g i ∧ g i ≤ 1) : + |(∏i∈S,f i)-(∏i∈S,g i)| ≤ ∑i∈S,|f i-g i| := by + induction S using Finset.induction_on with + | empty => simp + | @insert i S hi ih => + have hfS (j) (hj : j∈S) := hf j (Finset.mem_insert_of_mem hj) + have hgS (j) (hj : j∈S) := hg j (Finset.mem_insert_of_mem hj) + have hfi := hf i (Finset.mem_insert_self _ _) + have hgi := hg i (Finset.mem_insert_self _ _) + have hp₀ : 0 ≤ ∏j∈S,g j := Finset.prod_nonneg (fun j hj => (hgS j hj).1) + have hp₁ : (∏j∈S,g j) ≤ 1 := Finset.prod_le_one₀ (fun j hj => (hgS j hj).1) (fun j hj => (hgS j hj).2) + simp only [Finset.prod_insert hi,Finset.sum_insert hi] + calc + _ = |f i*((∏j∈S,f j)-(∏j∈S,g j))+(f i-g i)*(∏j∈S,g j)| := by congr 1; ring + _ ≤ |f i*((∏j∈S,f j)-(∏j∈S,g j))|+|(f i-g i)*(∏j∈S,g j)| := abs_add_le _ _ + _ ≤ |(∏j∈S,f j)-(∏j∈S,g j)|+|f i-g i| := by + rw [abs_mul,abs_mul,abs_of_nonneg hfi.1,abs_of_nonneg hp₀] + exact add_le_add (mul_le_of_le_one_left (abs_nonneg _) hfi.2) + (mul_le_of_le_one_right (abs_nonneg _) hp₁) + _ ≤ _ := by linarith [ih hfS hgS] + +end UniformThresholdCDF + +section SeparatorCovariance +open Classical MeasureTheory ProbabilityTheory + +def directionNoCut {a : ℕ} {v : ℝ×ℝ} (j : Fin 4) (z w : SquareFlag a v) : Set ℝ := + {t | ∀c, |conjugate c| ≤ t → ¬ FlagSeparates j c z w} + +theorem directionNoCut_of_none {a : ℕ} {v : ℝ×ℝ} (j : Fin 4) + (z w : SquareFlag a v) (h : ¬ ∃c,FlagSeparates j c z w) : + directionNoCut j z w = Set.univ := by + ext t + simp only [directionNoCut,Set.mem_ofPred_eq,Set.mem_univ,iff_true] + exact fun c _ hc => h ⟨c,hc⟩ + +theorem directionNoCut_of_min {a : ℕ} {v : ℝ×ℝ} (j : Fin 4) + (z w : SquareFlag a v) (c : CutRing) (hc : FlagSeparates j c z w) + (hmin : ∀ d,FlagSeparates j d z w → |conjugate c| ≤ |conjugate d|) : + directionNoCut j z w = Set.Iio |conjugate c| := by + ext t + constructor + · intro ht + exact lt_of_not_ge (fun hle => ht c hle hc) + · intro ht d hd hsep + exact not_le_of_gt ht ((hmin d hsep).trans hd) + +theorem uniformInterval_isProbability {lo hi : ℝ} (h : lo < hi) : + IsProbabilityMeasure (cond volume (Set.Icc lo hi)) := + cond_isProbabilityMeasure_of_finite + (by rw [Real.volume_Icc]; exact ENNReal.ofReal_ne_zero_iff.mpr (sub_pos.mpr h)) + (by rw [Real.volume_Icc]; exact ENNReal.ofReal_ne_top) + +noncomputable def directionNoCutProbability {a : ℕ} {v : ℝ×ℝ} + (s κ : ℝ) (j : Fin 4) (z w : SquareFlag a v) : ℝ := + (cond volume (Set.Icc (κ/s) (2*κ/s))).real (directionNoCut j z w) + +theorem directionNoCutProbability_bounds {a : ℕ} {v : ℝ×ℝ} + {s κ : ℝ} (hs : 0 < s) (hκ : 0 < κ) (j : Fin 4) (z w : SquareFlag a v) : + 0 ≤ directionNoCutProbability s κ j z w ∧ directionNoCutProbability s κ j z w ≤ 1 := by + have h : κ/s < 2*κ/s := (div_lt_div_iff_of_pos_right hs).mpr (by linarith) + have := uniformInterval_isProbability h + exact ⟨ENNReal.toReal_nonneg,measureReal_le_one⟩ + +theorem separatorMatrix_product {a : ℕ} {v : ℝ×ℝ} + {s κ : ℝ} (hs : 0 < s) (hκ : 0 < κ) (z w : SquareFlag a v) : + separatorMatrix (thresholdLaw s κ) z w = ∏j,directionNoCutProbability s κ j z w := by + have h : κ/s < 2*κ/s := (div_lt_div_iff_of_pos_right hs).mpr (by linarith) + have := uniformInterval_isProbability h + have he : {t : Fin 4 → ℝ | flagChamber t z=flagChamber t w}= + Set.univ.pi (fun j => directionNoCut j z w) := by + ext t + rw [Set.mem_ofPred_eq,flagChamber_eq_iff] + simp only [Set.mem_pi,Set.mem_univ,forall_true_left,directionNoCut,Set.mem_ofPred_eq, + FlagSeparates,not_not] + rw [separatorMatrix_eq_measure,measureReal_def,he] + change (Measure.pi (fun _ : Fin 4 => cond volume (Set.Icc (κ/s) (2*κ/s))) + (Set.univ.pi (fun j => directionNoCut j z w))).toReal = _ + rw [Measure.pi_pi,ENNReal.toReal_prod] + rfl + +theorem directionNoCutProbability_translation_bound {a : ℕ} {v : ℝ×ℝ} + {s κ : ℝ} (hs : 0 < s) (hκ : 0 < κ) + (u : CutRing×CutRing) (j : Fin 4) (z w z' w' : SquareFlag a v) + (hz : z'.val=z.val+(ordinary u.1,ordinary u.2)) + (hw : w'.val=w.val+(ordinary u.1,ordinary u.2)) : + |directionNoCutProbability s κ j z w-directionNoCutProbability s κ j z' w'| ≤ + |conjugate (integralCutForm a j u)| *s/κ := by + have he : (∃c,FlagSeparates j c z w) ↔ ∃c,FlagSeparates j c z' w' := by + constructor + · rintro ⟨c,hc⟩ + exact ⟨c+integralCutForm a j u, + (flagSeparates_local_translation u j c z w z' w' hz hw).mpr hc⟩ + · rintro ⟨c,hc⟩ + refine ⟨c-integralCutForm a j u,?_⟩ + apply (flagSeparates_local_translation u j (c-integralCutForm a j u) z w z' w' hz hw).mp + simpa only [sub_add_cancel] using hc + by_cases hc : ∃c,FlagSeparates j c z w + · obtain ⟨c,hc,hcmin⟩ := flagSeparates_exists_min j z w hc + obtain ⟨d,hd,hdmin⟩ := flagSeparates_exists_min j z' w' (he.mp ⟨c,hc⟩) + have h : κ/s < 2*κ/s := (div_lt_div_iff_of_pos_right hs).mpr (by linarith) + simp only [directionNoCutProbability,directionNoCut_of_min j z w c hc hcmin, + directionNoCut_of_min j z' w' d hd hdmin,uniformInterval_Iio h] + have hmin := separating_min_translation_bound u j z w z' w' hz hw c d hc hd hcmin hdmin + calc + _ ≤ abs (|conjugate c|-|conjugate d|)/(2*κ/s-κ/s) := intervalCDF_lipschitz h _ _ + _ ≤ |conjugate (integralCutForm a j u)|/(2*κ/s-κ/s) := + (div_le_div_iff_of_pos_right (sub_pos.mpr h)).mpr hmin + _ = _ := by field_simp; ring + · have hc' := he.not.mp hc + simp only [directionNoCutProbability,directionNoCut_of_none j z w hc, + directionNoCut_of_none j z' w' hc',sub_self,abs_zero] + positivity + +theorem separatorMatrix_translation_bound {a : ℕ} {v : ℝ×ℝ} + {s κ : ℝ} (hs : 0 < s) (hκ : 0 < κ) + (u : CutRing×CutRing) (z w z' w' : SquareFlag a v) + (hz : z'.val=z.val+(ordinary u.1,ordinary u.2)) + (hw : w'.val=w.val+(ordinary u.1,ordinary u.2)) : + |separatorMatrix (thresholdLaw s κ) z w-separatorMatrix (thresholdLaw s κ) z' w'| ≤ + (∑j : Fin 4,|conjugate (integralCutForm a j u)|)*s/κ := by + rw [separatorMatrix_product hs hκ,separatorMatrix_product hs hκ] + calc + _ ≤ ∑j : Fin 4,|directionNoCutProbability s κ j z w-directionNoCutProbability s κ j z' w'| := + unit_product_sub_bound Finset.univ _ _ + (fun j _ => directionNoCutProbability_bounds hs hκ j z w) + (fun j _ => directionNoCutProbability_bounds hs hκ j z' w') + _ ≤ ∑j : Fin 4,|conjugate (integralCutForm a j u)| *s/κ := + Finset.sum_le_sum (fun j _ => directionNoCutProbability_translation_bound hs hκ u j z w z' w' hz hw) + _ = _ := by rw [← Finset.sum_div,← Finset.sum_mul] + +end SeparatorCovariance + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/WeightedAveragingError.lean b/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/WeightedAveragingError.lean new file mode 100644 index 0000000000000000000000000000000000000000..9825f108d43862310dacfa62b199b0597a5b5559 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/RandomFields/WeightedAveragingError.lean @@ -0,0 +1,240 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.RandomFields.FlagSignalEnergy +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.FlagTentMass + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section WeightedAveragingError +open Classical + +theorem weighted_average_error {ι : Type*} (T : Finset ι) (k h : ι → ℝ) (h₀ E H δ : ℝ) + (hk : ∀i∈T,0≤k i) (hE : 0≤E) (hH : |h₀|≤H) + (hmass : |(∑i∈T,k i)-1|≤δ) + (hnear : ∀i∈T,k i≠0 → |h i-h₀|≤E) : + |(∑i∈T,k i*h i)-h₀| ≤ E*(1+δ)+H*δ := by + have hδ : 0≤δ := (abs_nonneg _).trans hmass + have hH₀ : 0≤H := (abs_nonneg _).trans hH + have he : (∑i∈T,k i*h i)-h₀= + (∑i∈T,k i*(h i-h₀))+h₀*((∑i∈T,k i)-1) := by + simp only [mul_sub,Finset.sum_sub_distrib,← Finset.sum_mul] + ring + have hb : |∑i∈T,k i*(h i-h₀)| ≤ E*(∑i∈T,k i) := by + calc + _ ≤ ∑i∈T,|k i*(h i-h₀)| := Finset.abs_sum_le_sum_abs _ _ + _ ≤ ∑i∈T,k i*E := by + apply Finset.sum_le_sum + intro i hi + rw [abs_mul,abs_of_nonneg (hk i hi)] + by_cases hh : k i=0 + · simp [hh] + · exact mul_le_mul_of_nonneg_left (hnear i hi hh) (hk i hi) + _ = _ := by rw [← Finset.sum_mul,mul_comm] + rw [he] + calc + _ ≤ |∑i∈T,k i*(h i-h₀)|+|h₀*((∑i∈T,k i)-1)| := abs_add_le _ _ + _ ≤ E*(∑i∈T,k i)+H*δ := add_le_add hb (by rw [abs_mul]; exact mul_le_mul hH hmass (abs_nonneg _) hH₀) + _ ≤ _ := by nlinarith [(abs_le.mp hmass).2] + +theorem squared_error_good_bad {ι : Type*} (T B : Finset ι) (e : ι → ℝ) + {E H : ℝ} (hE : 0≤E) (hH : 0≤H) + (hgood : ∀i∈T,i∉B → |e i|≤E) (hbad : ∀i∈T,|e i|≤H) : + ∑i∈T,(e i)^2 ≤ (T.card:ℝ)*E^2+(B.card:ℝ)*H^2 := by + have hh : ∀i∈T,(e i)^2 ≤ E^2 + (if i∈B then H^2 else 0) := by + intro i hi + by_cases hb : i∈B + · rw [ite_eq_left hb] + have he := (sq_le_sq₀ (abs_nonneg _) hH).mpr (hbad i hi) + rw [sq_abs] at he + linarith [sq_nonneg E] + · rw [ite_eq_right hb,add_zero] + simpa only [sq_abs] using (sq_le_sq₀ (abs_nonneg _) hE).mpr (hgood i hi hb) + calc + _ ≤ ∑i∈T,(E^2+(if i∈B then H^2 else 0)) := Finset.sum_le_sum hh + _ = (T.card:ℝ)*E^2+((T.filter (·∈B)).card:ℝ)*H^2 := by + rw [Finset.sum_add_distrib,← Finset.sum_filter] + simp only [Finset.sum_const,nsmul_eq_mul] + _ ≤ _ := by + have hc : ((T.filter (·∈B)).card:ℝ) ≤ (B.card:ℝ) := by + exact_mod_cast Finset.card_le_card (show T.filter (·∈B) ⊆ B from fun i hi => (Finset.mem_filter.mp hi).2) + linarith [mul_le_mul_of_nonneg_right hc (sq_nonneg H)] + +end WeightedAveragingError + +section SignalChartVariation +open Classical + +theorem flagSignalDifference_add_constant {a m D : ℕ} {v : ℝ×ℝ} (hD : 0 q+ψ x) N z=flagSignalDifference hD g ψ N z := by + unfold flagSignalDifference flagMeanSignal + ring + +theorem flagSignalDifference_vector_chart {a m D : ℕ} {v : ℝ×ℝ} (hD : 0 q+ψ x) N z- + flagSignalDifference hD g (fun x => q+ψ x) N w| ≤ C*η/N := by + obtain ⟨L₀,L₁,hL₀,hL₁⟩ := compactSignal_uniform_constants ψ hψ hs + obtain ⟨Q,hQ,hbound⟩ := flagAffineData_bounded (v:=v) g⁻¹ + (fun u => ‖(conjugate u.1,conjugate u.2)‖) + refine ⟨(L₁:ℝ)*Q,mul_nonneg L₁.coe_nonneg hQ,fun N η hN hη z w hchart hnear => ?_⟩ + rw [flagSignalDifference_add_constant,flagSignalDifference_add_constant, + flagSignalDifference_vector_chart hD,flagSignalDifference_vector_chart hD,← hchart] + let u := (conjugate (flagAffineData g⁻¹ z.val.1 z.val.2).2.1, + conjugate (flagAffineData g⁻¹ z.val.1 z.val.2).2.2) + have hu : ‖u‖ ≤ Q := by simpa only [abs_of_nonneg (norm_nonneg _)] using hbound z.val + have hd : ‖N⁻¹ • u‖ ≤ Q/N := by + rw [norm_smul,Real.norm_eq_abs,abs_of_pos (inv_pos.mpr hN),div_eq_mul_inv] + exact (mul_le_mul_of_nonneg_left hu (inv_pos.mpr hN).le).trans_eq (mul_comm _ _) + calc + _ ≤ (L₁:ℝ)*‖N⁻¹ • u‖*‖scaledSiteConjugate N z-scaledSiteConjugate N w‖ := hL₁ _ _ _ + _ ≤ (L₁:ℝ)*(Q/N)*η := by gcongr + _ = _ := by ring + +theorem planeTent_scaled_near {a m D : ℕ} {v : ℝ×ℝ} {N η : ℝ} (hN : 0 simp only [scaledSiteConjugate,Prod.fst_sub,Prod.snd_sub,Real.norm_eq_abs, + ← sub_div,abs_div,abs_of_pos hN] + · exact (div_le_iff₀ hN).mpr (by nlinarith [hh.1.le]) + · exact (div_le_iff₀ hN).mpr (by nlinarith [hh.2.le]) + +end SignalChartVariation + +section GoodRowAveraging +open Classical + +def flagGoodRow {a m D : ℕ} {v : ℝ×ℝ} (s κ : ℝ) (z : FlagSite a m D v) : Prop := + ∀j c,|conjugate c| ≤ 2*κ/s → + (1+|ordinary (cutTau^a)|)*s < |cutForm a j z.val.2.val-ordinary c| + +theorem flagGoodRow_interior {a m D : ℕ} {v : ℝ×ℝ} {s κ : ℝ} (hs : 0 simp [flagRowTent,ht] + +theorem flagRowTent_separator_one {a m D : ℕ} {v : ℝ×ℝ} {s κ : ℝ} (hs : 0 ring + +theorem flagAveragingMatrix_good_action {a m D : ℕ} {v : ℝ×ℝ} + (χ : (ℝ×ℝ) → ℝ) (h : FlagSite a m D v → ℝ) {N r η κ : ℝ} + (hN : 0 ?_,?_⟩ + · rw [hact w,hT w hw,mul_zero,zero_mul] + · simp_rw [hact] + have hh := weighted_average_error T (fun w => c*flagRowTent (r/N) (N*η) z w) h (h z) E H + (38880/((D:ℝ)*Real.sqrt (r*η))) + (fun w _ => mul_nonneg hc (flagRowTent_nonneg _ _ _ _)) hE hH + (by simpa only [← Finset.mul_sum,hst] using hmass) + (fun w _ hn => hnear w (fun he => hn (by simp [he]))) + exact hh + +end GoodRowAveraging + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/BarBinaryBoundary.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/BarBinaryBoundary.lean new file mode 100644 index 0000000000000000000000000000000000000000..2831b6e443e4b97f70f42d4b40f165fb3dae925a --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/BarBinaryBoundary.lean @@ -0,0 +1,85 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.FirstBarDegreeTwoFinite +import OAI.GroupTheory.SimpleAmenable.Configurations.FiberBinary +import OAI.GroupTheory.SimpleAmenable.Homology.FiniteCokernelExtension + +namespace OAI + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits MonoidalCategory Simplicial Opposite +namespace IntervalBar.Diagram +open FreeChains ComponentStable + +variable {C:Type} [Groupoid.{0} C] [MonoidalCategory C] [SymmetricCategory C] +noncomputable def binaryMap : nerve (Diagram C (Fin 3)) ⟶ nerve C⊗nerve C := + nerveMap (eval 2) ≫ (PiSSet.nervePiIso (fun _:Fin 2=>C)).hom ≫ + (PiSSet.binaryIso (fun _:Fin 2=>nerve C)).hom +omit [SymmetricCategory C] in +lemma binaryMap_fst : binaryMap (C:=C) ≫ CartesianMonoidalCategory.fst _ _= + nerveMap (reindex (SimplexCategory.δ (2:Fin 3)).toOrderHom) ≫ nerveMap oneEval := rfl +omit [SymmetricCategory C] in +lemma binaryMap_snd : binaryMap (C:=C) ≫ CartesianMonoidalCategory.snd _ _= + nerveMap (reindex (SimplexCategory.δ (0:Fin 3)).toOrderHom) ≫ nerveMap oneEval := rfl +omit [SymmetricCategory C] in +lemma binaryMap_mult : binaryMap (C:=C) ≫ multiplication=nerveMap (eval 2 ⋙ tensorPair) := rfl +omit [SymmetricCategory C] in +@[reassoc] lemma binaryMap_middle (q:ℕ) : + SSet.homologyMap (binaryMap (C:=C)) Z q ≫ SSet.homologyMap multiplication Z q = + SSet.homologyMap (nerveMap (reindex (SimplexCategory.δ (1:Fin 3)).toOrderHom)) Z q ≫ + SSet.homologyMap (nerveMap oneEval) Z q := by + rw [←SSet.homologyMap_comp,binaryMap_mult,←SSet.homologyMap_comp] + exact (NerveHomotopy.ofNatTrans binaryCutIso.hom).congr_homologyMap Z q +private lemma defect_rearrange {M:Type} [AddCommGroup M] (x y z:M) : x-y+z=z+x-y := by abel +omit [SymmetricCategory C] in +lemma d21_binaryD (q:ℕ) : (homologyRow (C:=C) q).d 2 1 ≫ (StableBarOne.oneIso q).hom ≫ toStable q = + SSet.homologyMap (binaryMap (C:=C)) Z q ≫ binaryD q := by + let faceMap (index : Fin 3) : + (nerve (Diagram C (Fin 3))).homology Z q ⟶ (nerve (Diagram C (Fin 2))).homology Z q := + SSet.homologyMap (nerveMap (reindex (SimplexCategory.δ index).toOrderHom)) Z q + rw [SimplicialFirstFinite.d21] + change (faceMap 0 - faceMap 1 + faceMap 2) ≫ + SSet.homologyMap (nerveMap oneEval) Z q ≫ toStable q = + SSet.homologyMap (binaryMap (C:=C)) Z q ≫ binaryD q + simp only [Preadditive.add_comp,Preadditive.sub_comp,binaryD,Preadditive.comp_add, + Preadditive.comp_sub] + rw [binaryMap_middle_assoc, + ←SSet.homologyMap_comp_assoc (f:=binaryMap) (g:=CartesianMonoidalCategory.fst _ _),binaryMap_fst, + SSet.homologyMap_comp_assoc,←SSet.homologyMap_comp_assoc (f:=binaryMap) (g:=CartesianMonoidalCategory.snd _ _), + binaryMap_snd,SSet.homologyMap_comp_assoc] + exact defect_rearrange + (M := (nerve (Diagram C (Fin 3))).homology Z q ⟶ object (C:=C) q) _ _ _ +end IntervalBar.Diagram + +end + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits MonoidalCategory Simplicial Opposite +namespace SimpleAmenable.PolygonTracks +open FreeChains ComponentStable IntervalBar.Diagram + +attribute [local instance 1200] Rep.hV2 Submodule.module Submodule.Quotient.module +lemma stableH2_finite_of_bar (a:ℕ) + [Module.Finite ℤ ((bar (C:=PolygonObject a)).homology Z 1:A)] + [Module.Finite ℤ ((bar (C:=PolygonObject a)).homology Z 2:A)] + [Module.Finite ℤ ((bar (C:=PolygonObject a)).homology Z 3:A)] : + Module.Finite ℤ (object (C:=PolygonObject a) 2:A) := by + have fullH1Finite := fullH1_finite_of_bar a 32 (by omega) + have mixedImageFinite := mixedImage_finite a + have firstRowTwoFinite := first_row_two_finite (C:=PolygonObject a) + apply ChainComplex.finite_of_boundary_annihilation (homologyRow (C:=PolygonObject a) 2) + (StableBarOne.row_d10 2 (by decide)) ((StableBarOne.oneIso 2).hom ≫ toStable 2) (mixedImage a) + rw [←Category.assoc,d21_binaryD] + change (SSet.homologyMap (binaryMap (C:=PolygonObject a)) Z 2 ≫ binaryD 2) ≫ + ModuleCat.ofHom (mixedImage a).mkQ = 0 + rw [Category.assoc,binaryD_quotient_zero,comp_zero] +lemma fullH2_finite_of_bar (a m:ℕ) (hm:34 ≤ m) + [Module.Finite ℤ ((bar (C:=PolygonObject a)).homology Z 1:A)] + [Module.Finite ℤ ((bar (C:=PolygonObject a)).homology Z 2:A)] + [Module.Finite ℤ ((bar (C:=PolygonObject a)).homology Z 3:A)] : + Module.Finite ℤ (groupHomology (Rep.trivial ℤ (polygonFullGroup a m) ℤ) 2) := + (finite_fullH2_iff_stable a m hm).mpr (stableH2_finite_of_bar a) +end SimpleAmenable.PolygonTracks + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/BarComponents.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/BarComponents.lean new file mode 100644 index 0000000000000000000000000000000000000000..64f4fe907d3d6e7f5eab47e0895aea7ddb412a9f --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/BarComponents.lean @@ -0,0 +1,192 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.BarRowFiniteness + +namespace OAI + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits MonoidalCategory Simplicial Opposite +namespace IntervalBar.Diagram + +section +open NerveComponents FreeChains + +variable {C:Type} [Groupoid.{0} C] [MonoidalCategory C] [SymmetricCategory C] +lemma single_eqToHom {P:Type} [Monoid P] {x y:SingleObj P} (h:x=y) : eqToHom h=(1:P) := by subst y; rfl +noncomputable def componentSimplex {n:ℕ} (D:Diagram C (Fin (n+1))) : + ComposableArrows (SingleObj (Skeleton C)) n where + obj _ := SingleObj.star _ + map {i j} f := toSkeleton (D.obj i j (leOfHom f)) + map_id i := congr_toSkeleton_of_iso (D.unit i) + map_comp {i j k} f g := by + change toSkeleton (D.obj i k _) = toSkeleton (D.obj j k _) * toSkeleton (D.obj i j _) + rw [mul_comm,←Skeleton.toSkeleton_tensorObj] + exact (congr_toSkeleton_of_iso (D.cut i j k (leOfHom f) (leOfHom g))).symm +lemma componentSimplex_iso {n:ℕ} {D E:Diagram C (Fin (n+1))} (e:D≅E) : + componentSimplex D=componentSimplex E := by + apply ComposableArrows.ext (F:=componentSimplex D) (G:=componentSimplex E) (fun _=>rfl) + intro i hi + simp only [single_eqToHom,SingleObj.comp_as_mul,one_mul,mul_one] + exact congr_toSkeleton_of_iso (asIso (e.hom.app _ _ _)) +noncomputable def skeletonSimplex (n:ℕ) : Skeleton (Diagram C (Fin (n+1))) → + ComposableArrows (SingleObj (Skeleton C)) n := + Quotient.lift componentSimplex (by rintro D E ⟨e⟩; exact componentSimplex_iso e) +@[simp] lemma skeletonSimplex_mk {n:ℕ} (D:Diagram C (Fin (n+1))) : + skeletonSimplex n (toSkeleton D)=componentSimplex D := rfl +lemma componentSimplex_reindex {n m:ℕ} (u:⦋m⦌⟶⦋n⦌) (D:Diagram C (Fin (n+1))) : + componentSimplex ((reindex u.toOrderHom).obj D)= + (nerve (SingleObj (Skeleton C))).map u.op (componentSimplex D) := rfl +lemma skeletonSimplex_natural {n m:ℕ} (u:⦋m⦌⟶⦋n⦌) (p:Skeleton (Diagram C (Fin (n+1)))) : + skeletonSimplex m (NerveComponents.map (reindex u.toOrderHom) p)= + (nerve (SingleObj (Skeleton C))).map u.op (skeletonSimplex n p) := by + obtain ⟨D,rfl⟩ := Quotient.exists_rep p + rfl +lemma skeletonSimplex_injective (n:ℕ) : Function.Injective (skeletonSimplex (C:=C) n) := by + intro D E h + obtain ⟨D,rfl⟩ := Quotient.exists_rep D + obtain ⟨E,rfl⟩ := Quotient.exists_rep E + apply congr_toSkeleton_of_iso + apply (eval n).preimageIso + refine { hom := fun i=>?_,inv:=fun i=>?_,hom_inv_id:=?_,inv_hom_id:=?_ } + · exact (Skeleton.isoOfEq (congrArg (fun s:ComposableArrows (SingleObj (Skeleton C)) n=> + s.map (homOfLE (Fin.castSucc_le_succ i))) h)).hom + · exact (Skeleton.isoOfEq (congrArg (fun s:ComposableArrows (SingleObj (Skeleton C)) n=> + s.map (homOfLE (Fin.castSucc_le_succ i))) h)).inv + · funext i; exact Iso.hom_inv_id _ + · funext i; exact Iso.inv_hom_id _ +lemma skeletonSimplex_surjective (n:ℕ) : Function.Surjective (skeletonSimplex (C:=C) n) := by + intro s + let U : Fin n → C := fun i=>(fromSkeleton C).obj (s.map (homOfLE (Fin.castSucc_le_succ i))) + refine ⟨toSkeleton ((eval n).objPreimage U),?_⟩ + apply ComposableArrows.ext (fun _=>Subsingleton.elim _ _) + intro i hi + have e := ((eval n).objObjPreimageIso U) + simp only [single_eqToHom,SingleObj.comp_as_mul,one_mul,mul_one] + exact (congr_toSkeleton_of_iso (asIso (e.hom ⟨i,hi⟩))).trans (toSkeleton_fromSkeleton_obj _) +noncomputable def skeletonSimplexEquiv (n:ℕ) : Skeleton (Diagram C (Fin (n+1))) ≃ + ComposableArrows (SingleObj (Skeleton C)) n := + Equiv.ofBijective (skeletonSimplex n) ⟨skeletonSimplex_injective n,skeletonSimplex_surjective n⟩ +noncomputable def componentsZeroIso (n:ℕ) : + (nerve (Diagram C (Fin (n+1)))).homology Z 0 ≅ + (ModuleCat.free ℤ).obj ((nerve (SingleObj (Skeleton C))).obj (op ⦋n⦌)) := + NerveComponents.zeroIso ≪≫ (ModuleCat.free ℤ).mapIso (skeletonSimplexEquiv n).toIso +end + +open NerveComponents FreeChains AlgebraicTopology + +variable {C:Type} [Groupoid.{0} C] [MonoidalCategory C] [SymmetricCategory C] +lemma componentsZeroIso_natural {n m:ℕ} (u:⦋m⦌⟶⦋n⦌) : + SSet.homologyMap (nerveMap (reindex (C:=C) u.toOrderHom)) Z 0 ≫ (componentsZeroIso m).hom = + (componentsZeroIso n).hom ≫ (ModuleCat.free ℤ).map ((nerve (SingleObj (Skeleton C))).map u.op) := by + change SSet.homologyMap (nerveMap (reindex (C:=C) u.toOrderHom)) Z 0 ≫ + ((zeroIso (C:=Diagram C (Fin (m+1)))).hom ≫ + (ModuleCat.free ℤ).map (skeletonSimplexEquiv m).toIso.hom) = + ((zeroIso (C:=Diagram C (Fin (n+1)))).hom ≫ + (ModuleCat.free ℤ).map (skeletonSimplexEquiv n).toIso.hom) ≫ + (ModuleCat.free ℤ).map ((nerve (SingleObj (Skeleton C))).map u.op) + rw [←Category.assoc,NerveComponents.zeroIso_natural,Category.assoc,←Functor.map_comp, + Category.assoc] + erw [←Functor.map_comp] + congr 2 + apply ConcreteCategory.hom_ext + intro p + exact skeletonSimplex_natural u p +noncomputable def componentRowIso : + simplicial (C:=C) ⋙ nerveFunctor ⋙ SSet.homologyFunctor Z 0 ≅ + nerve (SingleObj (Skeleton C)) ⋙ ModuleCat.free ℤ := + NatIso.ofComponents (fun p=>componentsZeroIso p.unop.len) (fun {_ _} u=>componentsZeroIso_natural u.unop) +noncomputable def componentRowChainIso : + AlternatingFaceMapComplex.obj (simplicial (C:=C) ⋙ nerveFunctor ⋙ SSet.homologyFunctor Z 0) ≅ + FreeChains.complex (nerve (SingleObj (Skeleton C))) := + (alternatingFaceMapComplex A).mapIso componentRowIso +end IntervalBar.Diagram + +end + +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits Simplicial Opposite +namespace FilteredNerve +open FreeChains + +variable (C:Type) [Category.{0} C] +def diagram : C ⥤ SSet := Over.mapFunctor C ⋙ nerveFunctor +def cocone : Cocone (diagram C) where + pt := nerve C + ι := { app x := nerveMap (Over.forget x) + naturality x y f := by change nerveMap (Over.map f ⋙ Over.forget y)=_; rfl } +def lastCocone {n:ℕ} (s:ComposableArrows C n) : s ⟶ (Functor.const _).obj s.right where + app i := s.map (homOfLE (Fin.le_last i)) + naturality i j f := by + change s.map f ≫ s.map (homOfLE (Fin.le_last j)) = s.map (homOfLE (Fin.le_last i)) ≫ 𝟙 _ + rw [Category.comp_id,←s.map_comp] + congr 1 +def lift {n:ℕ} (s:ComposableArrows C n) : ComposableArrows (Over s.right) n := + Over.lift s (lastCocone C s) +lemma lift_forget {n:ℕ} (s:ComposableArrows C n) : lift C s ⋙ Over.forget s.right=s := rfl +lemma lift_map {n:ℕ} {x:C} (s:ComposableArrows (Over x) n) : + lift C (s ⋙ Over.forget x) ⋙ Over.map s.right.hom=s := by + apply CategoryTheory.Functor.ext + case h_obj => + intro i + refine Comma.ext (x:=(lift C (s ⋙ Over.forget x) ⋙ Over.map s.right.hom).obj i) + (y:=s.obj i) rfl (Subsingleton.elim _ _) ?_ + apply heq_of_eq + change (s.map (homOfLE (Fin.le_last i))).left ≫ s.right.hom=(s.obj i).hom + exact (s.map (homOfLE (Fin.le_last i))).w + case h_map => + intro i j f + apply Over.OverMorphism.ext + simp only [Functor.comp_map,Over.comp_left] + erw [Over.eqToHom_left,Over.eqToHom_left] + simp [lift,Over.lift] + erw [eqToHom_refl,Category.id_comp] +noncomputable def pointwiseIsColimit (n:ℕ) : + IsColimit (((evaluation _ (Type)).obj (op ⦋n⦌)).mapCocone (cocone C)) where + desc d := ↾fun s => d.ι.app s.right (lift C s) + fac d x := by + ext s + have h:=congrArg (fun k => k (lift C (s ⋙ Over.forget x))) (d.w s.right.hom) + change d.ι.app x (lift C (s ⋙ Over.forget x) ⋙ Over.map s.right.hom)=_ at h + erw [lift_map] at h + exact h.symm + uniq d m hm := by + ext s + have h:=congrArg (fun k => k (lift C s)) (hm s.right) + exact h +noncomputable def isColimit : IsColimit (cocone C) := + evaluationJointlyReflectsColimits _ (fun n => pointwiseIsColimit C n.unop.len) +lemma terminal_acyclic {D:Type} [Category.{0} D] (d:D) (hd:IsTerminal d) + (n:ℕ) (hn:n≠0) : IsZero ((nerve D).homology Z n) := by + let α : 𝟭 D ⟶ (Functor.const D).obj d := + { app x := hd.from x + naturality x y f := hd.hom_ext _ _ } + have h := (NerveHomotopy.ofNatTrans α).congr_homologyMap Z n + change SSet.homologyMap (𝟙 (nerve D)) Z n = SSet.homologyMap (nerveMap ((Functor.const D).obj d)) Z n at h + rw [SSet.homologyMap_id,CategoryTheory.nerve.const_map] at h + erw [ConnectedProduct.const_homology_zero _ n hn] at h + exact (IsZero.iff_id_eq_zero _).mpr h +instance connected [IsFiltered C] : (nerve C).IsConnected where + allEq u v := by + obtain ⟨x,rfl⟩ := SSet.π₀.mk_surjective u + obtain ⟨y,rfl⟩ := SSet.π₀.mk_surjective v + let a := nerveEquiv x + let b := nerveEquiv y + have h₁ := SSet.π₀.sound (nerve.edgeMk (IsFiltered.leftToMax a b)) + have h₂ := SSet.π₀.sound (nerve.edgeMk (IsFiltered.rightToMax a b)) + have component_eq := h₁.trans h₂.symm + change SSet.π₀.mk (X:=nerve C) (nerveEquiv.symm (nerveEquiv x)) = + SSet.π₀.mk (X:=nerve C) (nerveEquiv.symm (nerveEquiv y)) at component_eq + erw [Equiv.symm_apply_apply,Equiv.symm_apply_apply] at component_eq + exact component_eq + nonempty := by + let := IsFiltered.nonempty (C:=C) + exact ⟨nerveEquiv.symm (Classical.arbitrary C)⟩ +lemma positive_acyclic [IsFiltered C] (n:ℕ) (hn:n≠0) : IsZero ((nerve C).homology Z n) := by + let h:=isColimitOfPreserves (SSet.homologyFunctor Z n) (isColimit C) + apply (IsZero.iff_id_eq_zero _).mpr + apply h.hom_ext + intro x + have hz : IsZero ((nerve (Over x)).homology Z n) := + terminal_acyclic (Over.mk (𝟙 x)) Over.mkIdTerminal n hn + exact hz.eq_of_src _ _ +end FilteredNerve + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/BarContractible.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/BarContractible.lean new file mode 100644 index 0000000000000000000000000000000000000000..193ddb2eeb7b83f2a02af62c9ceb767bacbab696 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/BarContractible.lean @@ -0,0 +1,215 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.IteratedBarMaps +import OAI.GroupTheory.SimpleAmenable.Homology.CanonicalProduct +import OAI.GroupTheory.SimpleAmenable.Simplicial.SimplicialH0 + +namespace OAI + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits SimplicialObject Simplicial Opposite MonoidalCategory +namespace SimplicialDiagonal +open FreeChains + +lemma connected_of_iso {X Y : SSet} (e : X ≅ Y) [Y.IsConnected] : X.IsConnected where + allEq u v := by + have h := congrArg (SSet.mapπ₀ e.inv) (Subsingleton.elim (SSet.mapπ₀ e.hom u) (SSet.mapπ₀ e.hom v)) + simpa only [←SSet.mapπ₀_comp_apply,Iso.hom_inv_id,SSet.mapπ₀_id_apply] using h + nonempty := ⟨e.inv.app _ (Classical.arbitrary _)⟩ +lemma connectivity (X : I ⥤ SSet) (d : ℕ) + (hc : ∀ p,(X.obj p).IsConnected) + (hz : ∀ q,0 (eval 0).map_injective (funext (fun i => Fin.elim0 i))⟩ +instance zero_hom_nonempty (X Y : Diagram C (Fin 1)) : Nonempty (X ⟶ Y) := ⟨zeroHom C X Y⟩ +instance hom_thin [∀ x y : C,Subsingleton (x ⟶ y)] (n : ℕ) + (X Y : Diagram C (Fin (n+1))) : Subsingleton (X ⟶ Y) := + ⟨fun _ _ => Hom.ext (fun _ _ _ => Subsingleton.elim _ _)⟩ +noncomputable def homOfAll (hh : ∀ x y : C,Nonempty (x ⟶ y)) (n : ℕ) + (X Y : Diagram C (Fin (n+1))) : X ⟶ Y := + (eval n).preimage (fun _ => Classical.choice (hh _ _)) +omit [SymmetricCategory C] in +lemma bar_acyclic [∀ x y : C,Subsingleton (x ⟶ y)] + (hh : ∀ x y : C,Nonempty (x ⟶ y)) (n : ℕ) (hn : 0 ⟨homOfAll hh _ x y⟩) + have hz (p : ℕ) (q : ℕ) (hq : 0 ⟨homOfAll hh p x y⟩) q (by omega) + exact SimplicialDiagonal.connectivity X n hc (hz 0) (fun p q hq _ => hz p q hq) n hn (by omega) +lemma zero_bar_acyclic (n : ℕ) (hn : 0 inferInstance) n hn +end IntervalBar.Diagram + +end + +open _root_.CategoryTheory _root_.OAI.CategoryTheory MonoidalCategory SimplicialObject Simplicial Opposite +namespace IntervalBar.Diagram + +variable {C : Type} [Groupoid.{0} C] [MonoidalCategory C] [SymmetricCategory C] +variable {I J K L M : Type} [Preorder I] [Preorder J] [Preorder K] [Preorder L] [Preorder M] +private lemma map_map_reindex_unit_app (f : I →o J) + (A : Diagram (Diagram (Diagram C J) L) M) (i : M) + (j k : L) (h : j ≤ k) (l m : I) (hlm : l ≤ m) : + ((((map (map (reindex f))).obj A).unit i).hom.app j k h).app l m hlm = + ((A.unit i).hom.app j k h).app (f l) (f m) (f.monotone hlm) := by + change (((map (reindex f)).map (A.unit i).hom ≫ + Functor.OplaxMonoidal.η (map (reindex f))).app j k h).app l m hlm = _ + erw [comp_app, map_η_app (I:=L) (reindex (C:=C) f)] + change ((A.unit i).hom.app j k h).app (f l) (f m) (f.monotone hlm) ≫ 𝟙 _ = _ + exact Category.comp_id _ + +lemma map_map_reindex_comp (f : I →o J) (g : J →o K) : + map (I:=M) (map (I:=L) (reindex (C:=C) (g.comp f))) = + map (map (reindex g)) ⋙ map (map (reindex f)) := by + have he (X : Diagram (Diagram C K) L) : mapObj (reindex (g.comp f)) X= + mapObj (reindex f) (mapObj (reindex g) X) := + congrArg (fun F => F.obj X) (map_reindex_comp f g) + refine CategoryTheory.Functor.ext (fun A => ?_) ?_ + · refine ext_heq ?_ ?_ ?_ + · funext i j h; exact he _ + · apply hfunext; intro i + apply iso_hext (he _) rfl + apply hom_hext (he _) rfl + intro j k h + apply hom_hext rfl rfl + intro l m hlm + apply heq_of_eq + erw [map_map_reindex_unit_app, map_map_reindex_unit_app, map_map_reindex_unit_app] + rfl + · apply hfunext; intro i + apply hfunext; intro j + apply hfunext; intro k + apply hfunext; intro hij + apply hfunext; intro hjk + apply iso_hext (congrArg₂ (fun X Y => X ⊗ Y) (he _) (he _)) (he _) + apply hom_hext (congrArg₂ (fun X Y => X ⊗ Y) (he _) (he _)) (he _) + intro l m hlm + apply hom_hext rfl rfl + intro n p hnp + apply heq_of_eq + change 𝟙 _ ≫ ((A.cut i j k hij hjk).hom.app l m hlm).app (g (f n)) (g (f p)) _ = + 𝟙 _ ≫ (𝟙 _ ≫ ((A.cut i j k hij hjk).hom.app l m hlm).app (g (f n)) (g (f p)) _) + simp only [Category.id_comp] + · intro A B h + apply Hom.ext; intro i j hij + erw [comp_app, comp_app, eqToHom_app, eqToHom_app] + apply Hom.ext; intro k l hkl + erw [comp_app, comp_app, eqToHom_app, eqToHom_app] + apply Hom.ext; intro m n hmn + erw [comp_app, comp_app, eqToHom_app, eqToHom_app] + simp only [map,reindex] + erw [Category.id_comp, Category.comp_id] + rfl +lemma barMap_map_reindex_id : barMap (map (I:=J) (reindex (C:=C) (OrderHom.id (α:=I))))=𝟙 _ := by + have he : simplicialMap (map (I:=J) (reindex (C:=C) (OrderHom.id (α:=I))))=𝟙 _ := by + apply NatTrans.ext; funext p; apply Cat.ext + exact map_map_reindex_id + simp only [barMap,he] + rfl +lemma barMap_map_reindex_comp (f : I →o J) (g : J →o K) : + barMap (map (I:=L) (reindex (C:=C) (g.comp f))) = + barMap (map (reindex g)) ≫ barMap (map (reindex f)) := by + have he : simplicialMap (map (I:=L) (reindex (C:=C) (g.comp f))) = + simplicialMap (map (reindex g)) ≫ simplicialMap (map (reindex f)) := by + apply NatTrans.ext; funext p; apply Cat.ext + exact map_map_reindex_comp f g + simp only [barMap,he,Functor.map_comp] + rfl +lemma bar₂Map_reindex_id : bar₂Map (reindex (C:=C) (OrderHom.id (α:=I)))=𝟙 _ := by + have he : rows₂Map (reindex (C:=C) (OrderHom.id (α:=I)))=𝟙 _ := by + apply NatTrans.ext; funext p + exact barMap_map_reindex_id + simp only [bar₂Map,he] + rfl +lemma bar₂Map_reindex_comp (f : I →o J) (g : J →o K) : + bar₂Map (reindex (C:=C) (g.comp f)) = bar₂Map (reindex g) ≫ bar₂Map (reindex f) := by + have he : rows₂Map (reindex (C:=C) (g.comp f)) = rows₂Map (reindex g) ≫ rows₂Map (reindex f) := by + apply NatTrans.ext; funext p + exact barMap_map_reindex_comp f g + simp only [bar₂Map,he,Functor.map_comp] + rfl +noncomputable def rows₃ : SimplexCategoryᵒᵖ ⥤ SSet where + obj p := bar₂ (C:=Diagram C (Fin (p.unop.len+1))) + map f := bar₂Map (reindex f.unop.toOrderHom) + map_id _ := bar₂Map_reindex_id + map_comp f g := bar₂Map_reindex_comp g.unop.toOrderHom f.unop.toOrderHom +noncomputable def bar₃ : SSet := SimplicialDiagonal.diagonal.obj (rows₃ (C:=C)) +instance bar₃_connected : (bar₃ (C:=C)).IsConnected := by + have : ((rows₃ (C:=C)).obj (op ⦋0⦌)).IsConnected := bar₂_connected + exact SimplicialDiagonal.diagonal_connected (rows₃ (C:=C)) +open FreeChains +lemma bar₂_acyclic [∀ x y : C,Subsingleton (x ⟶ y)] + (hh : ∀ x y : C,Nonempty (x ⟶ y)) (n : ℕ) (hn : 0 ⟨homOfAll hh 0 x y⟩) q hq + · intro p q hq _ + exact bar_acyclic (fun x y => ⟨homOfAll hh p x y⟩) q hq + · exact hn + · omega +lemma bar₂_H1_zero (n : ℕ) (hn : 0 inferInstance) q hq + · intro _ q hq hd; exact bar₂_H1_zero q hq hd + · exact hn + · exact hd +end IntervalBar.Diagram + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/BarRowFiniteness.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/BarRowFiniteness.lean new file mode 100644 index 0000000000000000000000000000000000000000..4c73800c62f375350e246c00935d252bc3a46dc8 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/BarRowFiniteness.lean @@ -0,0 +1,177 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.BarSegal +import OAI.GroupTheory.SimpleAmenable.Simplicial.TrajectoryFinite + +namespace OAI + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits MonoidalCategory Simplicial Opposite +namespace BarFinitePower +open IntervalBar IntervalBar.Diagram FreeChains + +variable {C:Type} [Groupoid.{0} C] [MonoidalCategory C] [SymmetricCategory C] +noncomputable def singleRowComparison (p:ℕ) : + bar (C:=Diagram C (Fin (p+1))) ⟶ (power (Fin p)).obj (bar (C:=C)) := + barMap (eval p) ≫ singlePowerComparison (Fin p) +lemma singleRowComparison_isIso (p n:ℕ) : + IsIso (SSet.homologyMap (singleRowComparison (C:=C) p) Z n) := by + rw [singleRowComparison,SSet.homologyMap_comp] + have := barMap_homology_isIso (eval (C:=C) p) n + have := singlePowerComparison_homology_isIso (C:=C) (Fin p) n + infer_instance +noncomputable def doubleRowComparison (p:ℕ) : + bar₂ (C:=Diagram C (Fin (p+1))) ⟶ (power (Fin p)).obj (bar₂ (C:=C)) := + bar₂Map (eval p) ≫ doublePowerComparison (Fin p) +lemma doubleRowComparison_isIso (p n:ℕ) : + IsIso (SSet.homologyMap (doubleRowComparison (C:=C) p) Z n) := by + rw [doubleRowComparison,SSet.homologyMap_comp] + have := bar₂Map_homology_isIso (eval (C:=C) p) n + have := doublePowerComparison_homology_isIso (C:=C) (Fin p) n + infer_instance +lemma singleRow_finite (p n:ℕ) + (h:∀i,i≤n → Module.Finite ℤ ((bar (C:=C)).homology Z i : A)) : + Module.Finite ℤ ((bar (C:=Diagram C (Fin (p+1)))).homology Z n : A) := by + have := finite_power (bar (C:=C)) (Fin p) n h + have := singleRowComparison_isIso (C:=C) p n + exact Module.Finite.equiv (asIso (SSet.homologyMap (singleRowComparison (C:=C) p) Z n)).symm.toLinearEquiv +lemma doubleRow_finite (p n:ℕ) + (h:∀i,i≤n → Module.Finite ℤ ((bar₂ (C:=C)).homology Z i : A)) : + Module.Finite ℤ ((bar₂ (C:=Diagram C (Fin (p+1)))).homology Z n : A) := by + have := finite_power (bar₂ (C:=C)) (Fin p) n h + have := doubleRowComparison_isIso (C:=C) p n + exact Module.Finite.equiv (asIso (SSet.homologyMap (doubleRowComparison (C:=C) p) Z n)).symm.toLinearEquiv +noncomputable def firstRowHomologyIso (n:ℕ) : + ((bar (C:=Diagram C (Fin 2))).homology Z n : A) ≅ (bar (C:=C)).homology Z n := by + haveI := singleRowComparison_isIso (C:=C) 1 n + exact asIso (SSet.homologyMap (singleRowComparison (C:=C) 1) Z n) ≪≫ + (SSet.homologyFunctor Z n).mapIso (powerOneIso (bar (C:=C))) +noncomputable def firstDoubleRowHomologyIso (n:ℕ) : + ((bar₂ (C:=Diagram C (Fin 2))).homology Z n : A) ≅ (bar₂ (C:=C)).homology Z n := by + haveI := doubleRowComparison_isIso (C:=C) 1 n + exact asIso (SSet.homologyMap (doubleRowComparison (C:=C) 1) Z n) ≪≫ + (SSet.homologyFunctor Z n).mapIso (powerOneIso (bar₂ (C:=C))) +end BarFinitePower + +end + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits MonoidalCategory Simplicial Opposite +namespace IntervalBar.Diagram +open FreeChains BarFinitePower SimplicialDiagonal + +variable {C:Type} [Groupoid.{0} C] [MonoidalCategory C] [SymmetricCategory C] +lemma bar₂_finite_reverse (r:ℕ) + (hf:∀n,n≤r+1 → Module.Finite ℤ ((bar₂ (C:=C)).homology Z n : A)) : + ∀q,q≤r → Module.Finite ℤ ((bar (C:=C)).homology Z q : A) := by + have h := finite_reverse (rows₂ (C:=C)) r (fun _=>bar_connected _) zero_bar_acyclic + (fun q _=>rows₂_segal_homology_isIso q) (fun q h p=>by + apply singleRow_finite p q + intro i hi + have : Module.Finite ℤ ((bar (C:=Diagram C (Fin 2))).homology Z i:A) := h i hi + exact Module.Finite.equiv (firstRowHomologyIso (C:=C) i).toLinearEquiv) hf + intro q hq + have : Module.Finite ℤ ((bar (C:=Diagram C (Fin 2))).homology Z q:A) := h q hq + exact Module.Finite.equiv (firstRowHomologyIso (C:=C) q).toLinearEquiv +lemma bar₃_finite_reverse (r:ℕ) + (hf:∀n,n≤r+1 → Module.Finite ℤ ((bar₃ (C:=C)).homology Z n : A)) : + ∀q,q≤r → Module.Finite ℤ ((bar₂ (C:=C)).homology Z q : A) := by + have h := finite_reverse (rows₃ (C:=C)) r (fun _=>bar₂_connected) + (fun q hq=>by + change IsZero (SSet.homology (C:=A) (bar₂ (C:=Diagram C (Fin 1))) Z q) + exact bar₂_acyclic (fun _ _=>inferInstance) q hq) + (fun q _=>rows₃_segal_homology_isIso q) (fun q h p=>by + apply doubleRow_finite p q + intro i hi + have : Module.Finite ℤ ((bar₂ (C:=Diagram C (Fin 2))).homology Z i:A) := h i hi + exact Module.Finite.equiv (firstDoubleRowHomologyIso (C:=C) i).toLinearEquiv) hf + intro q hq + have : Module.Finite ℤ ((bar₂ (C:=Diagram C (Fin 2))).homology Z q:A) := h q hq + exact Module.Finite.equiv (firstDoubleRowHomologyIso (C:=C) q).toLinearEquiv +lemma bar_finite_of_triple + (hf:∀n,n≤5 → Module.Finite ℤ ((bar₃ (C:=C)).homology Z n : A)) : + ∀q,q≤3 → Module.Finite ℤ ((bar (C:=C)).homology Z q : A) := + bar₂_finite_reverse 3 (bar₃_finite_reverse 4 hf) +end IntervalBar.Diagram + +end + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits Simplicial Opposite +namespace NerveComponents +open FreeChains + +variable {C D:Type} [Groupoid.{0} C] [Groupoid.{0} D] +noncomputable def toSkeletonπ : (nerve C).π₀ → Skeleton C := + SSet.π₀.lift (fun x=>toSkeleton (nerveEquiv x)) (fun {_ _} e=>congr_toSkeleton_of_iso (asIso (nerve.homEquiv e))) +noncomputable def fromSkeletonπ (p:Skeleton C) : (nerve C).π₀ := + SSet.π₀.mk (nerveEquiv.symm ((fromSkeleton C).obj p)) +lemma roundtrip (x:(nerve C).π₀) : fromSkeletonπ (toSkeletonπ x)=x := by + obtain ⟨x,rfl⟩ := SSet.π₀.mk_surjective x + have e : (fromSkeleton C).obj (toSkeleton (nerveEquiv x)) ≅ nerveEquiv x := + Skeleton.isoOfEq (toSkeleton_fromSkeleton_obj _) + exact (SSet.π₀.sound (nerve.edgeMk e.hom)).trans (by erw [Equiv.symm_apply_apply]) +noncomputable def componentEquiv : (nerve C).π₀ ≃ Skeleton C where + toFun := toSkeletonπ + invFun := fromSkeletonπ + left_inv := roundtrip + right_inv p := toSkeleton_fromSkeleton_obj p +noncomputable def map (F:C⥤D) : Skeleton C → Skeleton D := + Quotient.lift (fun x=>toSkeleton (F.obj x)) (by rintro x y ⟨e⟩; exact congr_toSkeleton_of_iso (F.mapIso e)) +@[simp] lemma map_mk (F:C⥤D) (x:C) : map F (toSkeleton x)=toSkeleton (F.obj x) := rfl +lemma naturality (F:C⥤D) (x:(nerve C).π₀) : + toSkeletonπ (SSet.mapπ₀ (nerveMap F) x)=map F (toSkeletonπ x) := by + obtain ⟨x,rfl⟩ := SSet.π₀.mk_surjective x + rfl +noncomputable def zeroIso : (nerve C).homology Z 0 ≅ (ModuleCat.free ℤ).obj (Skeleton C) := + (nerve C).homology₀Iso Z ≪≫ FreeChains.iso _ ≪≫ (ModuleCat.free ℤ).mapIso (Equiv.toIso componentEquiv) +noncomputable def vertex (x:C) : Z ⟶ (nerve C).homology Z 0 := + ( (nerve C).chainComplex Z).liftCycles ((nerve C).ιChainComplex (nerveEquiv.symm x)) 0 (by simp) (by simp) ≫ + ((nerve C).chainComplex Z).homologyπ 0 +@[reassoc (attr:=simp)] lemma vertex_zeroIso (x:C) : vertex x ≫ (zeroIso (C:=C)).hom = + ModuleCat.ofHom (Finsupp.lsingle (toSkeleton x)) := by + dsimp only [vertex,zeroIso,Iso.trans_hom] + simp only [Category.assoc] + erw [SSet.liftCycles_ιChainComplex_homologyπ_homology₀Iso_hom_assoc] + change Sigma.ι (fun _:(nerve C).π₀=>Z) (SSet.π₀.mk (nerveEquiv.symm x)) ≫ + FreeChains.forward _ ≫ (ModuleCat.free ℤ).map (↾componentEquiv)=_ + rw [FreeChains.ι_forward_assoc] + apply ModuleCat.hom_ext + apply LinearMap.ext_ring + exact ModuleCat.free_map_apply _ _ +lemma vertex_natural (F:C⥤D) (x:C) : vertex x ≫ SSet.homologyMap (nerveMap F) Z 0=vertex (F.obj x) := by + dsimp only [vertex,SSet.homologyMap] + rw [Category.assoc,HomologicalComplex.homologyπ_naturality,←Category.assoc, + HomologicalComplex.liftCycles_comp_cyclesMap] + erw [SSet.ι_chainComplexMap_f] + have he : (nerveMap F).app (op ⦋0⦌) (nerveEquiv.symm x)=nerveEquiv.symm (F.obj x) := + ComposableArrows.ext₀ rfl + rw [he] +lemma hom_ext {M:A} {f g:(nerve C).homology Z 0 ⟶ M} + (h:∀x:C,vertex x ≫ f=vertex x ≫ g) : f=g := by + apply (cancel_epi (zeroIso (C:=C)).inv).mp + apply ModuleCat.free_hom_ext + intro p + obtain ⟨x,rfl⟩ := Quotient.exists_rep p + have hh:=congrArg (fun k:Z⟶M=>k (1:ℤ)) (h x) + have hv : ModuleCat.ofHom (Finsupp.lsingle (toSkeleton x)) ≫ (zeroIso (C:=C)).inv=vertex x := by + erw [←vertex_zeroIso,Category.assoc,Iso.hom_inv_id,Category.comp_id] + have ht:=congrArg (fun k:Z⟶(nerve C).homology Z 0=>k (1:ℤ)) hv + change f ((zeroIso (C:=C)).inv (ModuleCat.freeMk (toSkeleton x))) = + g ((zeroIso (C:=C)).inv (ModuleCat.freeMk (toSkeleton x))) + change (zeroIso (C:=C)).inv (ModuleCat.freeMk (toSkeleton x))=vertex x (1:ℤ) at ht + rw [ht] + exact hh +lemma zeroIso_natural (F:C⥤D) : SSet.homologyMap (nerveMap F) Z 0 ≫ (zeroIso (C:=D)).hom = + (zeroIso (C:=C)).hom ≫ (ModuleCat.free ℤ).map (↾(map F)) := by + apply hom_ext; intro x + rw [←Category.assoc,vertex_natural,vertex_zeroIso,vertex_zeroIso_assoc] + apply ModuleCat.hom_ext + apply LinearMap.ext_ring + change ModuleCat.freeMk (toSkeleton (F.obj x)) = + (ModuleCat.free ℤ).map (↾(map F)) (ModuleCat.freeMk (toSkeleton x)) + exact (ModuleCat.free_map_apply (R:=ℤ) (↾(map F)) (toSkeleton x)).symm +end NerveComponents + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/BarSegal.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/BarSegal.lean new file mode 100644 index 0000000000000000000000000000000000000000..71748b97d1089deae4ee8b676828aab42dd54126 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/BarSegal.lean @@ -0,0 +1,97 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.NestedPosReindex +import OAI.GroupTheory.SimpleAmenable.Simplicial.FinitePowerGeneral +import OAI.GroupTheory.SimpleAmenable.Simplicial.LowerBarComposition + +namespace OAI + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory MonoidalCategory Simplicial Opposite +namespace IntervalBar.Diagram +open BarFinitePower SimplicialDiagonal StageProductColimit + +variable {C:Type} [Groupoid.{0} C] [MonoidalCategory C] [SymmetricCategory C] +omit [SymmetricCategory C] in +lemma outer_project (i:Fin 2) : outerFunctor (C:=C) ⋙ project _ i = reindex (outerOrder i) := rfl +lemma outer_project_ε (i:Fin 2) : Functor.LaxMonoidal.ε (outerFunctor (C:=C) ⋙ project _ i) = 𝟙 _ := by + rw [Functor.LaxMonoidal.comp_ε] + change 𝟙 _ ≫ 𝟙 _ = 𝟙 _ + simp +lemma outer_project_μ (i:Fin 2) (A B:Diagram C (Fin 3)) : + Functor.LaxMonoidal.μ (outerFunctor (C:=C) ⋙ project _ i) A B = 𝟙 _ := by + rw [Functor.LaxMonoidal.comp_μ] + change 𝟙 _ ≫ 𝟙 _ = 𝟙 _ + simp +instance outer_project_monoidal (i:Fin 2) : NatTrans.IsMonoidal (eqToHom (outer_project (C:=C) i)) where + unit := by + rw [outer_project_ε, reindex_ε] + change 𝟙 _ ≫ 𝟙 _ = 𝟙 _ + simp + tensor A B := by + rw [outer_project_μ,reindex_μ] + change 𝟙 _ ≫ 𝟙 _ = (𝟙 _ ⊗ₘ 𝟙 _) ≫ 𝟙 _ + simp +variable {D:Type} [Groupoid.{0} D] [MonoidalCategory D] [SymmetricCategory D] +omit [SymmetricCategory C] [SymmetricCategory D] in +lemma barMap_congr {F G:C⥤D} [hF:F.Monoidal] [hG:G.Monoidal] (e:F=G) + (h:NatTrans.IsMonoidal (eqToHom e)) : barMap F=barMap G := by + have hm := monoidal_congr e h + cases e + have hh : hF=hG := eq_of_heq hm + cases hh + rfl +lemma bar₂Map_congr {F G:C⥤D} [hF:F.Braided] [hG:G.Braided] (e:F=G) + (h:NatTrans.IsMonoidal (eqToHom e)) : bar₂Map F=bar₂Map G := by + have hm := monoidal_congr e h + cases e + have hh : hF.toMonoidal=hG.toMonoidal := eq_of_heq hm + have hb : hF = hG := Functor.Braided.ext + (congrArg (fun t : F.Monoidal => t.ε) hh) + (congrArg (fun t : F.Monoidal => t.μ) hh) + (congrArg (fun t : F.Monoidal => t.η) hh) + (congrArg (fun t : F.Monoidal => t.δ) hh) + cases hb + rfl +lemma rows₂_segal : segalTwo (rows₂ (C:=C)) = barMap (outerFunctor (C:=C)) ≫ + singlePowerComparison (Fin 2) ≫ (powerTwoIso _).hom := by + ext n x + · change (barMap (reindex (SimplexCategory.δ (0:Fin 3)).toOrderHom)).app n x = + (barMap (outerFunctor (C:=C)) ≫ barMap (project (Fin 2) (0:Fin 2))).app n x + rw [←barMap_comp,barMap_congr (outer_project _) inferInstance] + rfl + · change (barMap (reindex (SimplexCategory.δ (2:Fin 3)).toOrderHom)).app n x = + (barMap (outerFunctor (C:=C)) ≫ barMap (project (Fin 2) (1:Fin 2))).app n x + rw [←barMap_comp,barMap_congr (outer_project _) inferInstance] + rfl +lemma rows₃_segal : segalTwo (rows₃ (C:=C)) = bar₂Map (outerFunctor (C:=C)) ≫ + doublePowerComparison (Fin 2) ≫ (powerTwoIso _).hom := by + ext n x + · change (bar₂Map (reindex (SimplexCategory.δ (0:Fin 3)).toOrderHom)).app n x = + (bar₂Map (outerFunctor (C:=C)) ≫ bar₂Map (project (Fin 2) (0:Fin 2))).app n x + rw [←bar₂Map_comp,bar₂Map_congr (outer_project _) inferInstance] + rfl + · change (bar₂Map (reindex (SimplexCategory.δ (2:Fin 3)).toOrderHom)).app n x = + (bar₂Map (outerFunctor (C:=C)) ≫ bar₂Map (project (Fin 2) (1:Fin 2))).app n x + rw [←bar₂Map_comp,bar₂Map_congr (outer_project _) inferInstance] + rfl +lemma rows₂_segal_homology_isIso (q:ℕ) : IsIso (SSet.homologyMap (segalTwo (rows₂ (C:=C))) DiagonalResolution.Z q) := by + rw [rows₂_segal] + change IsIso (SSet.homologyMap (barMap (outerFunctor (C:=C)) ≫ + singlePowerComparison (Fin 2) ≫ (powerTwoIso _).hom) DiagonalResolution.Z q) + rw [SSet.homologyMap_comp,SSet.homologyMap_comp] + have := barMap_homology_isIso (outerFunctor (C:=C)) q + have := singlePowerComparison_homology_isIso (C:=Diagram C (Fin 2)) (Fin 2) q + infer_instance +lemma rows₃_segal_homology_isIso (q:ℕ) : IsIso (SSet.homologyMap (segalTwo (rows₃ (C:=C))) DiagonalResolution.Z q) := by + rw [rows₃_segal] + change IsIso (SSet.homologyMap (bar₂Map (outerFunctor (C:=C)) ≫ + doublePowerComparison (Fin 2) ≫ (powerTwoIso _).hom) DiagonalResolution.Z q) + rw [SSet.homologyMap_comp,SSet.homologyMap_comp] + have := bar₂Map_homology_isIso (outerFunctor (C:=C)) q + have := doublePowerComparison_homology_isIso (C:=Diagram C (Fin 2)) (Fin 2) q + infer_instance +end IntervalBar.Diagram + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/BitReindex.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/BitReindex.lean new file mode 100644 index 0000000000000000000000000000000000000000..a6729749d36a44238e1a3b2f20989bc24917cdca --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/BitReindex.lean @@ -0,0 +1,41 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.RandomFields.ThresholdField + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section BitReindex +open Classical MeasureTheory + +noncomputable def bitReindex {ι : Type*} (e : ι ≃ ι) (b : ι → Bool) : ι → Bool := + fun z => b (e.symm z) + +theorem bitReindex_measurable {ι : Type*} (e : ι ≃ ι) : Measurable (bitReindex e) := + Measurable.of_eval (fun z => measurable_pi_apply (e.symm z)) + +theorem thresholdField_transport {ι : Type*} (μ : Measure (ι → ℝ)) (e : ι ≃ ι) : + (μ.map (fieldReindex e)).map thresholdField= + (μ.map thresholdField).map (bitReindex e) := by + rw [Measure.map_map thresholdField_measurable (fieldReindex_measurable e), + Measure.map_map (bitReindex_measurable e) thresholdField_measurable] + rfl + +theorem ObservableClose.threshold_transport {ι : Type*} (μ : Measure (ι → ℝ)) + (e : ι ≃ ι) {ε : ℝ} (h : ObservableClose μ (μ.map (fieldReindex e)) ε) : + ObservableClose (μ.map thresholdField) ((μ.map thresholdField).map (bitReindex e)) ε := by + have hh := h.map thresholdField_measurable + rw [thresholdField_transport] at hh + exact hh + +end BitReindex + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/CanonicalShapiro.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/CanonicalShapiro.lean new file mode 100644 index 0000000000000000000000000000000000000000..c4f714fe6cc1fc974ca51a3b24c3c94da17859f5 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/CanonicalShapiro.lean @@ -0,0 +1,225 @@ +import Mathlib + +namespace OAI + +open CategoryTheory CategoryTheory.Limits Finsupp Representation Rep TensorProduct + +universe u +namespace CanonicalShapiro +variable {k G H : Type u} [CommRing k] [Group G] [Group H] + +noncomputable def barLift (f : G →* H) (n : ℕ) : + Rep.free k G (Fin n → G) ⟶ Rep.res f (Rep.free k H (Fin n → H)) := + Rep.freeLift k G _ (fun x => Finsupp.single (f ∘ x) (MonoidAlgebra.single 1 1)) + +@[simp] lemma barLift_single (f : G →* H) (n : ℕ) (x : Fin n → G) (g : G) (r : k) : + (barLift (k:=k) f n).hom (single x (MonoidAlgebra.single g r)) = + single (f ∘ x) (MonoidAlgebra.single (f g) r) := by + simp [barLift, Representation.freeLift_single_single] + +lemma barLift_d (f : G →* H) (n : ℕ) : + Rep.barComplex.d k G n ≫ barLift f n = + barLift f (n+1) ≫ (Rep.resFunctor.{u,u,u,u} f).map (Rep.barComplex.d k H n) := by + apply Rep.free_ext + intro x + change (barLift (k:=k) f n).hom + ((Rep.barComplex.d k G n).hom (single x (MonoidAlgebra.single 1 1))) = + (Rep.barComplex.d k H n).hom + ((barLift (k:=k) f (n+1)).hom (single x (MonoidAlgebra.single 1 1))) + rw [Rep.barComplex.d_single, barLift_single, map_one, Rep.barComplex.d_single] + simp only [map_add, map_sum] + congr 1 + · rw [barLift_single] + rfl + · apply Finset.sum_congr rfl + intro j hj + rw [barLift_single, map_one] + congr 1 + simp [Fin.comp_contractNth] + +noncomputable def barMap (f : G →* H) : Rep.barComplex k G ⟶ + ((Rep.resFunctor.{u,u,u,u} f).mapHomologicalComplex (ComplexShape.down ℕ)).obj + (Rep.barComplex k H) where + f n := barLift f n + comm' i j h := by + subst h + simpa [ChainComplex.of.d] using + (barLift_d (k:=k) f j).symm + +lemma diagonal_inv_single (n : ℕ) (x : Fin n → G) (g : G) (r : k) : + (Rep.diagonalSuccIsoFree k G n).inv.hom (single x (MonoidAlgebra.single g r)) = + MonoidAlgebra.single (g • Fin.partialProd x) r := by + simp only [Rep.diagonalSuccIsoFree, Rep.diagonalSuccIsoTensorTrivial, + Iso.trans_inv, Rep.hom_comp, Representation.IntertwiningMap.comp_apply] + have step1 : (Rep.Hom.hom (Rep.leftRegularTensorTrivialIsoFree k G (Fin n → G)).inv) + (single x (MonoidAlgebra.single g r)) = + MonoidAlgebra.single g 1 ⊗ₜ[k] MonoidAlgebra.single x r := + Representation.leftRegularTensorTrivialIsoFree_symm_apply_single_single x g r + rw [step1] + simp only [Action.tensorObj_V, Rep.tensor_V, Rep.tensor_ρ] + have key₁ := Representation.linearizeMap_single (k := k) + (Action.diagonalSuccIsoTensorTrivial G n).inv (g, x) ((1 : k) * r) + have key₂ := Representation.LinearizeMonoidal.μ_apply_single_single (k := k) + (X := Action.leftRegular G) (Y := Action.trivial G (Fin n → G)) g x 1 r + exact ((congrArg (fun z => (Representation.linearizeMap + (Action.diagonalSuccIsoTensorTrivial G n).inv) z) key₂).trans key₁).trans (by + simp only [one_mul] + congr 1 + exact Action.diagonalSuccIsoTensorTrivial_inv_hom_apply g x) + +@[simp] lemma bar_π_zero_single (x : Fin 0 → G) (g : G) (r : k) : + ((Rep.barResolution k G).π.f 0).hom (single x (MonoidAlgebra.single g r)) = r := by + change (Rep.standardComplex.ε k G).hom + ((Rep.diagonalSuccIsoFree k G 0).inv.hom (single x (MonoidAlgebra.single g r))) = r + rw [diagonal_inv_single] + simp [Rep.standardComplex.ε] + +lemma barMap_π (S : Subgroup G) : + barMap (k:=k) S.subtype ≫ + ((Rep.resFunctor.{u,u,u,u} S.subtype).mapProjectiveResolution (Rep.barResolution k G)).π = + (Rep.barResolution k S).π := by + apply (ChainComplex.toSingle₀Equiv _ _).injective + apply Subtype.ext + apply Rep.free_ext + intro x + change (((Rep.resFunctor.{u,u,u,u} S.subtype).mapProjectiveResolution + (Rep.barResolution k G)).π.f 0).hom + ((barLift S.subtype 0).hom (single x (MonoidAlgebra.single 1 1))) = _ + rw [barLift_single] + change ((Rep.barResolution k G).π.f 0).hom + (single (S.subtype ∘ x) (MonoidAlgebra.single (S.subtype 1) 1)) = _ + change ((Rep.barResolution k G).π.f 0).hom + (single (S.subtype ∘ x) (MonoidAlgebra.single (S.subtype 1) 1)) = + ((Rep.barResolution k S).π.f 0).hom (single x (MonoidAlgebra.single 1 1)) + rw [bar_π_zero_single, bar_π_zero_single] +noncomputable def barComparison (S : Subgroup G) : + HomotopyEquiv (Rep.barComplex k S) + (((Rep.resFunctor.{u,u,u,u} S.subtype).mapProjectiveResolution (Rep.barResolution k G)).complex) := + (ProjectiveResolution.homotopyEquiv (Rep.barResolution k S) + ((Rep.resFunctor.{u,u,u,u} S.subtype).mapProjectiveResolution (Rep.barResolution k G))).copy + (ProjectiveResolution.liftHomotopy (𝟙 (Rep.trivial k S k)) _ (barMap S.subtype) + (by + change _ = (Rep.barResolution k S).π ≫ + (ChainComplex.single₀ (Rep k S)).map (𝟙 (Rep.trivial k S k)) + rw [CategoryTheory.Functor.map_id, Category.comp_id] + exact ProjectiveResolution.homotopyEquiv_hom_π _ _) + (by + change _ = (Rep.barResolution k S).π ≫ + (ChainComplex.single₀ (Rep k S)).map (𝟙 (Rep.trivial k S k)) + rw [CategoryTheory.Functor.map_id, Category.comp_id] + exact barMap_π (k:=k) S)) + +@[simp] lemma barComparison_hom (S : Subgroup G) : + (barComparison (k:=k) S).hom = barMap S.subtype := rfl + +noncomputable def indUnit (f : G →* H) (A : Rep.{u} k G) : A ⟶ Rep.res f (Rep.ind.{u,u,u,u} f A) := + Rep.indResHomEquiv f A (Rep.ind.{u,u,u,u} f A) (𝟙 _) + +@[simp] lemma indUnit_apply (f : G →* H) (A : Rep.{u} k G) (a : A) : + (indUnit f A).hom a = Representation.IndV.mk f A.ρ 1 a := by + simp [indUnit, Rep.indResHomEquiv] + +@[simp] lemma coinvariantsTensor_map_mk {A B C : Rep.{u} k G} (f : B ⟶ C) (a : A) (b : B) : + (((Rep.coinvariantsTensor k G).obj A).map f) (Rep.coinvariantsTensorMk A B a b) = + Rep.coinvariantsTensorMk A C a (f.hom b) := by + simp [Rep.coinvariantsTensor, Rep.coinvariantsTensorMk] + +noncomputable def tensorBarMap (S : Subgroup G) (A : Rep.{u} k S) : + (Rep.barComplex k S).coinvariantsTensorObj A ⟶ + (((Rep.resFunctor.{u,u,u,u} S.subtype).mapProjectiveResolution + (Rep.barResolution k G)).complex).coinvariantsTensorObj A := + (((Rep.coinvariantsTensor k S).obj A).mapHomologicalComplex _).map (barMap S.subtype) + +lemma chainsIso_hom_single (A : Rep.{u} k G) [DecidableEq G] + (n : ℕ) (x : Fin n → G) (a : A) : + (groupHomology.inhomogeneousChainsIso A).hom.f n (single x a) = + Rep.coinvariantsTensorMk A (Rep.free k G (Fin n → G)) a + (single x (MonoidAlgebra.single 1 1)) := by + change (Rep.coinvariantsTensorFreeLEquiv A (Fin n → G)).symm (single x a) = _ + exact Rep.finsuppToCoinvariantsTensorFree_single x a + +lemma chainsIso_inv_mk_single (A : Rep.{u} k G) [DecidableEq G] + (n : ℕ) (x : Fin n → G) (a : A) : + (groupHomology.inhomogeneousChainsIso A).inv.f n + (Rep.coinvariantsTensorMk A (Rep.free k G (Fin n → G)) a + (single x (MonoidAlgebra.single 1 1))) = single x a := by + rw [← chainsIso_hom_single] + exact congrArg (fun f : groupHomology.inhomogeneousChains A ⟶ + groupHomology.inhomogeneousChains A => f.f n (single x a)) + (Iso.hom_inv_id (groupHomology.inhomogeneousChainsIso A)) + +lemma tensorBarMap_f_mk (S : Subgroup G) (A : Rep.{u} k S) + (n : ℕ) (x : Fin n → S) (a : A) : + (tensorBarMap S A).f n + (Rep.coinvariantsTensorMk A (Rep.free k S (Fin n → S)) a + (single x (MonoidAlgebra.single 1 1))) = + Rep.coinvariantsTensorMk A (Rep.res S.subtype (Rep.free k G (Fin n → G))) a + (single (S.subtype ∘ x) (MonoidAlgebra.single 1 1)) := by + change (((Rep.coinvariantsTensor k S).obj A).map (barLift S.subtype n)) _ = _ + rw [coinvariantsTensor_map_mk, barLift_single, map_one] + +noncomputable def resTensorIso (S : Subgroup G) (A : Rep.{u} k S) : + ((((Rep.resFunctor.{u,u,u,u} S.subtype).mapHomologicalComplex (ComplexShape.down ℕ)).obj + (Rep.barComplex k G)).coinvariantsTensorObj A) ≅ + (Rep.barComplex k G).coinvariantsTensorObj (Rep.ind.{u,u,u,u} S.subtype A) := + groupHomology.coinvariantsTensorResProjectiveResolutionIso S A (Rep.barResolution k G) + +lemma resTensorIso_hom_f (S : Subgroup G) (A : Rep.{u} k S) (n : ℕ) : + (resTensorIso S A).hom.f n = + Rep.coinvariantsTensorIndInv S.subtype A (Rep.free k G (Fin n → G)) := rfl + +lemma resIso_hom_f_mk (S : Subgroup G) (A : Rep.{u} k S) + (n : ℕ) (b : Rep.free k G (Fin n → G)) (a : A) : + (resTensorIso S A).hom.f n + (Rep.coinvariantsTensorMk A (Rep.res S.subtype (Rep.free k G (Fin n → G))) a b) = + Rep.coinvariantsTensorMk (Rep.ind.{u,u,u,u} S.subtype A) (Rep.free k G (Fin n → G)) + (Representation.IndV.mk S.subtype A.ρ 1 a) b := by + rw [resTensorIso_hom_f] + exact Rep.coinvariantsTensorIndInv_mk_tmul_indMk S.subtype a b + +lemma chainsMap_factorization (S : Subgroup G) (A : Rep.{u} k S) [DecidableEq G] : + groupHomology.chainsMap S.subtype (indUnit S.subtype A) = + (groupHomology.inhomogeneousChainsIso A).hom ≫ tensorBarMap S A ≫ + (resTensorIso S A).hom ≫ + (groupHomology.inhomogeneousChainsIso (Rep.ind.{u,u,u,u} S.subtype A)).inv := by + ext n : 1 + apply groupHomology.inhomogeneousChains.ext + intro x + apply ModuleCat.hom_ext + apply LinearMap.ext + intro a + simp only [HomologicalComplex.comp_f, ModuleCat.hom_comp, LinearMap.comp_apply, + ModuleCat.hom_ofHom, Finsupp.lsingle_apply] + change (groupHomology.chainsMap S.subtype (indUnit S.subtype A)).f n (single x a) = _ + rw [groupHomology.chainsMap_f_single] + change _ = (groupHomology.inhomogeneousChainsIso (Rep.ind.{u,u,u,u} S.subtype A)).inv.f n + ((resTensorIso S A).hom.f n + ((tensorBarMap S A).f n ((groupHomology.inhomogeneousChainsIso A).hom.f n (single x a)))) + rw [chainsIso_hom_single, tensorBarMap_f_mk, resIso_hom_f_mk, chainsIso_inv_mk_single, + indUnit_apply] + +noncomputable def chainsEquivalence (S : Subgroup G) (A : Rep.{u} k S) [DecidableEq G] : + HomotopyEquiv (groupHomology.inhomogeneousChains A) + (groupHomology.inhomogeneousChains (Rep.ind.{u,u,u,u} S.subtype A)) := + (HomotopyEquiv.ofIso (groupHomology.inhomogeneousChainsIso A)).trans + ((((Rep.coinvariantsTensor k S).obj A).mapHomotopyEquiv (barComparison S)).trans + ((HomotopyEquiv.ofIso (resTensorIso S A)).trans + (HomotopyEquiv.ofIso (groupHomology.inhomogeneousChainsIso + (Rep.ind.{u,u,u,u} S.subtype A)).symm))) + +lemma chainsEquivalence_hom (S : Subgroup G) (A : Rep.{u} k S) [DecidableEq G] : + (chainsEquivalence S A).hom = + groupHomology.chainsMap S.subtype (indUnit S.subtype A) := + (chainsMap_factorization S A).symm + +lemma isIso_map_indUnit (S : Subgroup G) (A : Rep.{u} k S) (n : ℕ) : + IsIso (groupHomology.map S.subtype (indUnit S.subtype A) n) := by + classical + change IsIso (HomologicalComplex.homologyMap + (groupHomology.chainsMap S.subtype (indUnit S.subtype A)) n) + rw [← chainsEquivalence_hom] + exact (chainsEquivalence S A).toHomologyIso n |>.isIso_hom + +end CanonicalShapiro + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/CellMonoidal.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/CellMonoidal.lean new file mode 100644 index 0000000000000000000000000000000000000000..df9ef929e33fd790772e228237a4c70563a4a9d3 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/CellMonoidal.lean @@ -0,0 +1,150 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.FiniteSetMonoidal +import OAI.GroupTheory.SimpleAmenable.Configurations.CellFunctor + +namespace OAI + +section +open CategoryTheory Classical MonoidalCategory +namespace SimpleAmenable.PolygonObject.Labelled.Cell + +variable {a n : ℕ} (P : polygonAlgebra a) (l : LabelledStage.ReducedLabel n) +lemma track_ext {U V : Labelled a n} (f g : U ⟶ V) + (h : ∀x, (f.arrow.toEquiv x).val.1=(g.arrow.toEquiv x).val.1) : f=g := by + apply Hom.ext; apply Arrow.ext; apply Equiv.ext; intro x + apply Subtype.ext; exact Prod.ext (h x) ((f.positional x).trans (g.positional x).symm) + +@[simp] lemma whiskerRight_arrow {U V : Labelled a n} (f : U ⟶ V) (W : Labelled a n) : + (f ▷ W).arrow=sumArrow f.arrow (𝟙 W.polygon) := rfl +@[simp] lemma whiskerLeft_arrow (W : Labelled a n) {U V : Labelled a n} (f : U ⟶ V) : + (W ◁ f).arrow=sumArrow (𝟙 W.polygon) f.arrow := rfl + +lemma tensor_natural {U V W X : FiniteSetGroupoid} (f : U ⟶ W) (g : V ⟶ X) : + sumHom (arrow P l f) (arrow P l g) ≫ tensorArrow P l W X = + tensorArrow P l U V ≫ arrow P l (FiniteSetGroupoid.sumHom f g) := by + apply track_ext; intro x + obtain ⟨y,rfl⟩ := (sumPointEquiv (object P l U).polygon (object P l V).polygon).surjective x + cases y with + | inl y => + change ((sumArrow (arrow P l f).arrow (arrow P l g).arrow).toEquiv (sumPointEquiv _ _ (.inl y))).val.1 = + FiniteSetGroupoid.sumHom f g (FiniteSetGroupoid.sumEquiv U V (.inl y.val.1)) + erw [sumArrow_inl,sumPointEquiv_inl,FiniteSetGroupoid.sumHom_inl] + rfl + | inr y => + change ((sumArrow (arrow P l f).arrow (arrow P l g).arrow).toEquiv (sumPointEquiv _ _ (.inr y))).val.1 = + FiniteSetGroupoid.sumHom f g (FiniteSetGroupoid.sumEquiv U V (.inr y.val.1)) + erw [sumArrow_inr,sumPointEquiv_inr,FiniteSetGroupoid.sumHom_inr] + rfl + +lemma tensor_assoc (U V W : FiniteSetGroupoid) : + tensorArrow P l U V ▷ object P l W ≫ tensorArrow P l (U⊗V) W ≫ + (functor P l).map (α_ U V W).hom = + (α_ (object P l U) (object P l V) (object P l W)).hom ≫ + object P l U ◁ tensorArrow P l V W ≫ tensorArrow P l U (V⊗W) := by + apply track_ext; intro x + obtain ⟨y,rfl⟩ := (sumPointEquiv (sum (object P l U) (object P l V)).polygon (object P l W).polygon).surjective x + cases y with + | inl y => + obtain ⟨z,rfl⟩ := (sumPointEquiv (object P l U).polygon (object P l V).polygon).surjective y + cases z with + | inl z => + change FiniteSetGroupoid.assoc U V W _ = + ((sumArrow (𝟙 (object P l U).polygon) (tensorArrow P l V W).arrow).toEquiv ((sumAssoc (object P l U).polygon (object P l V).polygon (object P l W).polygon).toEquiv _)).val.1 + rw [whiskerRight_arrow,sumAssoc_apply,sumAssocEquiv_left] + erw [tensorArrow_apply,sumArrow_inl,sumPointEquiv_inl,tensorArrow_apply, + sumPointEquiv_inl,sumArrow_inl,sumPointEquiv_inl,arrow_id_apply] + change FiniteSetGroupoid.assoc U V W + (FiniteSetGroupoid.sumEquiv (U⊗V) W (.inl (FiniteSetGroupoid.sumEquiv U V (.inl z.val.1)))) = _ + erw [FiniteSetGroupoid.assoc_left] + rfl + | inr z => + change FiniteSetGroupoid.assoc U V W _ = + ((sumArrow (𝟙 (object P l U).polygon) (tensorArrow P l V W).arrow).toEquiv ((sumAssoc (object P l U).polygon (object P l V).polygon (object P l W).polygon).toEquiv _)).val.1 + rw [whiskerRight_arrow,sumAssoc_apply,sumAssocEquiv_mid] + erw [tensorArrow_apply,sumArrow_inl,sumPointEquiv_inl,tensorArrow_apply, + sumPointEquiv_inr,sumArrow_inr,sumPointEquiv_inr,tensorArrow_apply,sumPointEquiv_inl] + change FiniteSetGroupoid.assoc U V W + (FiniteSetGroupoid.sumEquiv (U⊗V) W (.inl (FiniteSetGroupoid.sumEquiv U V (.inr z.val.1)))) = _ + erw [FiniteSetGroupoid.assoc_mid] + rfl + | inr y => + change FiniteSetGroupoid.assoc U V W _ = + ((sumArrow (𝟙 (object P l U).polygon) (tensorArrow P l V W).arrow).toEquiv ((sumAssoc (object P l U).polygon (object P l V).polygon (object P l W).polygon).toEquiv _)).val.1 + rw [whiskerRight_arrow,sumAssoc_apply,sumAssocEquiv_right] + erw [tensorArrow_apply,sumArrow_inr,sumPointEquiv_inr,arrow_id_apply, + sumArrow_inr,sumPointEquiv_inr,tensorArrow_apply,sumPointEquiv_inr] + change FiniteSetGroupoid.assoc U V W + (FiniteSetGroupoid.sumEquiv (U⊗V) W (.inr y.val.1)) = _ + erw [FiniteSetGroupoid.assoc_right] + rfl + +lemma unit_left (U : FiniteSetGroupoid) : + (λ_ (object P l U)).hom = unitArrow P l ▷ object P l U ≫ + tensorArrow P l (𝟙_ _) U ≫ (functor P l).map (λ_ U).hom := by + apply track_ext; intro x + obtain ⟨y,rfl⟩ := (sumPointEquiv PolygonObject.empty (object P l U).polygon).surjective x + cases y with + | inl y => exact isEmptyElim y + | inr y => + change ((leftUnit _).toEquiv (sumPointEquiv _ _ (.inr y))).val.1 = FiniteSetGroupoid.left U _ + simp only [leftUnit_apply,leftUnitEquiv_apply] + change y.val.1 = FiniteSetGroupoid.left U + ((sumArrow (unitArrow P l).arrow (𝟙 (object P l U).polygon)).toEquiv + (sumPointEquiv PolygonObject.empty (object P l U).polygon (.inr y))).val.1 + erw [sumArrow_inr,arrow_id_apply,sumPointEquiv_inr] + change y.val.1 = FiniteSetGroupoid.left U (FiniteSetGroupoid.sumEquiv _ _ (.inr y.val.1)) + rw [FiniteSetGroupoid.left_apply] +lemma unit_right (U : FiniteSetGroupoid) : + (ρ_ (object P l U)).hom = object P l U ◁ unitArrow P l ≫ + tensorArrow P l U (𝟙_ _) ≫ (functor P l).map (ρ_ U).hom := by + apply track_ext; intro x + obtain ⟨y,rfl⟩ := (sumPointEquiv (object P l U).polygon PolygonObject.empty).surjective x + cases y with + | inl y => + change ((rightUnit _).toEquiv (sumPointEquiv _ _ (.inl y))).val.1 = FiniteSetGroupoid.right U _ + simp only [rightUnit_apply,rightUnitEquiv_apply] + change y.val.1 = FiniteSetGroupoid.right U + ((sumArrow (𝟙 (object P l U).polygon) (unitArrow P l).arrow).toEquiv + (sumPointEquiv (object P l U).polygon PolygonObject.empty (.inl y))).val.1 + erw [sumArrow_inl,arrow_id_apply,sumPointEquiv_inl] + change y.val.1 = FiniteSetGroupoid.right U (FiniteSetGroupoid.sumEquiv _ _ (.inl y.val.1)) + rw [FiniteSetGroupoid.right_apply] + | inr y => exact isEmptyElim y + +noncomputable instance cellMonoidal : (functor P l).Monoidal := + Functor.CoreMonoidal.toMonoidal { + εIso := asIso (X := 𝟙_ (Labelled a n)) + (Y := object P l (𝟙_ FiniteSetGroupoid)) (unitArrow P l) + μIso U V := asIso (X := object P l U ⊗ object P l V) + (Y := object P l (U ⊗ V)) (tensorArrow P l U V) + μIso_hom_natural_left := by + intro U V f W + have h := tensor_natural P l f (𝟙 W) + rw [show arrow P l (𝟙 W)=𝟙 _ from (functor P l).map_id W] at h + exact h + μIso_hom_natural_right := by + intro U V W f + have h := tensor_natural P l (𝟙 W) f + rw [show arrow P l (𝟙 W)=𝟙 _ from (functor P l).map_id W] at h + exact h + associativity := tensor_assoc P l + left_unitality := unit_left P l + right_unitality := unit_right P l } +noncomputable instance cellBraided : (functor P l).Braided where + braided U V := by + apply track_ext; intro x + change FiniteSetGroupoid.swap U V x.val.1 = + ((sumSwap (object P l U).polygon (object P l V).polygon).toEquiv x).val.1 + obtain ⟨y,rfl⟩ := (sumPointEquiv (object P l U).polygon (object P l V).polygon).surjective x + cases y with + | inl y => + rw [sumSwap_apply,sumSwapEquiv_inl,sumPointEquiv_inl,sumPointEquiv_inr] + exact FiniteSetGroupoid.swap_left U V y.val.1 + | inr y => + rw [sumSwap_apply,sumSwapEquiv_inr,sumPointEquiv_inr,sumPointEquiv_inl] + exact FiniteSetGroupoid.swap_right U V y.val.1 +end SimpleAmenable.PolygonObject.Labelled.Cell + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/CoefficientFiltered.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/CoefficientFiltered.lean new file mode 100644 index 0000000000000000000000000000000000000000..21ade3c60b1927d7e0d48966d3060dffe9eb29a6 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/CoefficientFiltered.lean @@ -0,0 +1,137 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.CoefficientContraction +import OAI.GroupTheory.SimpleAmenable.Homology.ExactShapeHomology + +namespace OAI + +namespace CoefficientNerve + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits Simplicial SimplicialObject Opposite AlgebraicTopology + +variable {R:Type} [CommRing R] {C:Type} [Category.{0} C] +variable (F:C ⥤ ModuleCat.{0} R) +lemma single_eq {n:ℕ} {s t:Simplex C n} (h:s=t) + (e:Coeff F n s=Coeff F n t) : single F s=eqToHom e ≫ single F t := by + subst t + simp +def overLift {n:ℕ} (s:Simplex C n) : Simplex (Over s.left.unop) n where + obj i := op (Over.mk ((s.map (homOfLE (Fin.zero_le i))).unop)) + map {i j} f := (Over.homMk (s.map f).unop (by + change (s.map f).unop ≫ (s.map (homOfLE (Fin.zero_le i))).unop = + (s.map (homOfLE (Fin.zero_le j))).unop + rw [←unop_comp,←s.map_comp] + congr 2)).op + map_id i := by apply Quiver.Hom.unop_inj; apply Over.OverMorphism.ext; simp; rfl + map_comp f g := by apply Quiver.Hom.unop_inj; apply Over.OverMorphism.ext; simp +lemma overLift_forget {n:ℕ} (s:Simplex C n) : overLift s ⋙ (Over.forget s.left.unop).op=s := by + refine CategoryTheory.Functor.ext (fun _ => rfl) ?_ + intro source target arrow + simp [overLift] + change s.map arrow = 𝟙 _ ≫ s.map arrow + exact (Category.id_comp _).symm +lemma overLift_map {n:ℕ} {x:C} (s:Simplex (Over x) n) : + overLift (s ⋙ (Over.forget x).op) ⋙ (Over.map s.left.unop.hom).op=s := by + apply CategoryTheory.Functor.ext + · intro i j f + apply Quiver.Hom.unop_inj + apply Over.OverMorphism.ext + simp + change (s.map f).unop.left = 𝟙 _ ≫ (s.map f).unop.left ≫ 𝟙 _ + simp only [Category.id_comp, Category.comp_id] + · intro i + apply unop_injective + refine Comma.ext (x:=(overLift (s ⋙ (Over.forget x).op) ⋙ (Over.map s.left.unop.hom).op).obj i|>.unop) + (y:=(s.obj i).unop) rfl (Subsingleton.elim _ _) ?_ + apply heq_of_eq + exact (s.map (homOfLE (Fin.zero_le i))).unop.w +noncomputable def overDiagram : C ⥤ SimplicialObject (ModuleCat.{0} R) where + obj x := simplicial (Over.forget x ⋙ F) + map {x y} f := post (Over.map f) (Over.forget y ⋙ F) + map_id x := by + apply NatTrans.ext; funext n + apply hom_ext; intro s + change single (Over.forget x ⋙ F) s ≫ desc _ _ = single (Over.forget x ⋙ F) s ≫ 𝟙 _ + erw [single_desc,Category.comp_id] + have he : s ⋙ (Over.map (𝟙 x)).op=s := by rw [Over.mapId_eq]; rfl + simpa only [eqToHom_refl,Category.id_comp] using! single_eq (Over.forget x ⋙ F) he rfl + map_comp {x y z} f g := by + apply NatTrans.ext; funext n + apply hom_ext; intro s + change single (Over.forget x ⋙ F) s ≫ desc _ _ = + single (Over.forget x ⋙ F) s ≫ desc _ _ ≫ desc _ _ + erw [single_desc,single_desc_assoc,single_desc] + have he : s ⋙ (Over.map (f ≫ g)).op=(s ⋙ (Over.map f).op) ⋙ (Over.map g).op := by + rw [Over.mapComp_eq]; rfl + simpa only [eqToHom_refl,Category.id_comp] using! single_eq (Over.forget z ⋙ F) he rfl +noncomputable def overCocone : Cocone (overDiagram F) where + pt := simplicial F + ι := { app x := post (Over.forget x) F + naturality x y f := by + apply NatTrans.ext; funext n + apply hom_ext; intro s + change single (Over.forget x ⋙ F) s ≫ desc _ _ ≫ desc _ _ = + single (Over.forget x ⋙ F) s ≫ desc _ _ + erw [single_desc_assoc,single_desc,single_desc] + rfl } +noncomputable def overPointwiseIsColimit (n:ℕ) : + IsColimit (((evaluation _ (ModuleCat R)).obj (op ⦋n⦌)).mapCocone (overCocone F)) where + desc d := desc F (fun s=>single (Over.forget s.left.unop ⋙ F) (overLift s) ≫ d.ι.app s.left.unop) + fac d x := by + apply hom_ext; intro s + change single (Over.forget x ⋙ F) s ≫ desc _ _ ≫ desc _ _ = single (Over.forget x ⋙ F) s ≫ d.ι.app x + erw [single_desc_assoc,single_desc] + have h:=congrArg (fun k=>single (Over.forget s.left.unop.left ⋙ F) (overLift (s ⋙ (Over.forget x).op)) ≫ k) (d.w s.left.unop.hom) + change _ = single _ _ ≫ d.ι.app s.left.unop.left at h + change single (Over.forget s.left.unop.left ⋙ F) (overLift (s ⋙ (Over.forget x).op)) ≫ + d.ι.app s.left.unop.left=single (Over.forget x ⋙ F) s ≫ d.ι.app x + rw [←h] + change single (Over.forget s.left.unop.left ⋙ F) (overLift (s ⋙ (Over.forget x).op)) ≫ + desc _ _ ≫ d.ι.app x=single (Over.forget x ⋙ F) s ≫ d.ι.app x + erw [single_desc_assoc] + apply congrArg (fun z=>z ≫ d.ι.app x) + simpa only [eqToHom_refl,Category.id_comp] using! single_eq (Over.forget x ⋙ F) (overLift_map s) rfl + uniq d m hm := by + apply hom_ext; intro s + erw [single_desc] + have h:=congrArg (fun k=>single (Over.forget s.left.unop ⋙ F) (overLift s) ≫ k) (hm s.left.unop) + change single _ _ ≫ desc _ _ ≫ m=_ at h + erw [single_desc_assoc] at h + have he:=weighted_eq F (overLift_forget s) (𝟙 _) (𝟙 _) (by simp; rfl) + simp only [CategoryTheory.Functor.map_id,Category.id_comp] at he + change single F _ ≫ m = _ at h + rw [he] at h + erw [CategoryTheory.Functor.map_id, Category.id_comp] at h + exact h +noncomputable def overIsColimit : IsColimit (overCocone F) := + evaluationJointlyReflectsColimits _ (fun n=>overPointwiseIsColimit F n.unop.len) +end + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits Simplicial SimplicialObject Opposite AlgebraicTopology HomologicalComplex + +variable {J C:Type} [Category.{0} J] [Category.{0} C] +noncomputable instance alternating_preserves : + PreservesColimitsOfShape J (alternatingFaceMapComplex (ModuleCat.{0} ℤ)) := by + apply HomologicalComplex.preservesColimitsOfShape_of_eval + intro n + change PreservesColimitsOfShape J ((evaluation SimplexCategoryᵒᵖ (ModuleCat.{0} ℤ)).obj (op ⦋n⦌)) + infer_instance +variable (F:C ⥤ ModuleCat.{0} ℤ) +lemma positive_acyclic [IsFiltered C] (n:ℕ) (hn:n≠0) : IsZero ((complex F).homology n) := by + let H := alternatingFaceMapComplex (ModuleCat.{0} ℤ) ⋙ homologyFunctor _ (ComplexShape.down ℕ) n + let h := isColimitOfPreserves H (overIsColimit F) + apply (IsZero.iff_id_eq_zero _).mpr + apply h.hom_ext + intro x + have hz : IsZero ((complex (Over.forget x ⋙ F)).homology n) := by + apply IsZero.of_iso _ ((terminalHomotopyEquiv (Over.forget x ⋙ F) + (d:=Over.mk (𝟙 x)) Over.mkIdTerminal).toHomologyIso n) + apply ShortComplex.isZero_homology_of_isZero_X₂ + exact HomologicalComplex.isZero_single_obj_X (ComplexShape.down ℕ) 0 (F.obj x) n hn + exact hz.eq_of_src _ _ +end + +end CoefficientNerve + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/CoefficientNaturality.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/CoefficientNaturality.lean new file mode 100644 index 0000000000000000000000000000000000000000..f9f275d1c29c27ecf905447d7183d01534821101 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/CoefficientNaturality.lean @@ -0,0 +1,158 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.ExactShapeHomology +import OAI.GroupTheory.SimpleAmenable.Simplicial.CoefficientNerve + +namespace OAI + +namespace CoefficientNerve + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits Simplicial Opposite + +private lemma comp_pair {V : Type*} [Category V] {A B C D E F : V} + {i : A ⟶ B} {f : B ⟶ C} {g : C ⟶ D} {a : A ⟶ E} + {j : E ⟶ C} {b : E ⟶ F} {k : F ⟶ D} + (h₁ : i ≫ f = a ≫ j) (h₂ : j ≫ g = b ≫ k) : + i ≫ f ≫ g = (a ≫ b) ≫ k := by + rw [← Category.assoc, h₁, Category.assoc, h₂, ← Category.assoc] + +private lemma square_of_components {V : Type*} [Category V] {A B C D E F : V} + {i : A ⟶ B} {f : B ⟶ C} {g : C ⟶ D} {a : A ⟶ E} + {j : E ⟶ C} {k : E ⟶ D} {h : B ⟶ F} {l : A ⟶ F} {q : F ⟶ D} + (hf : i ≫ f = a ≫ j) (hg : j ≫ g = k) + (hh : i ≫ h = l) (hq : a ≫ k = l ≫ q) : + i ≫ f ≫ g = i ≫ h ≫ q := by + rw [← Category.assoc, hf, Category.assoc, hg, ← Category.assoc, hh, hq] + +private lemma iso_transport_cancel {V : Type*} [Category V] {A B C D : V} + (a : A ≅ B) (b : C ≅ D) (f : A ⟶ C) (g : B ⟶ D) + (h : f = a.hom ≫ g ≫ b.inv) : f ≫ b.hom = a.hom ≫ g := by + rw [h] + simp only [Category.assoc, Iso.inv_hom_id, Category.comp_id] + +section + +variable {R:Type} [CommRing R] {C:Type} [Category.{0} C] +variable {F G H:C ⥤ ModuleCat.{0} R} +noncomputable def mapNat (η:F⟶G) : simplicial F ⟶ simplicial G where + app n := desc F (fun s=>η.app s.right.unop ≫ single G s) + naturality n m f := by + apply hom_ext; intro s + dsimp only [simplicial] + rw [single_map_assoc,single_desc,single_desc_assoc,Category.assoc,single_map, + ←Category.assoc,η.naturality,Category.assoc] +@[reassoc (attr:=simp)] lemma single_mapNat (η:F⟶G) {n:ℕ} (s:Simplex C n) : + single F s ≫ (mapNat η).app (op ⦋n⦌)=η.app s.right.unop ≫ single G s := single_desc _ _ _ +lemma mapNat_id (F:C ⥤ ModuleCat.{0} R) : mapNat (𝟙 F)=𝟙 (simplicial F) := by + apply NatTrans.ext; funext n + apply hom_ext; intro s + simp only [mapNat,single_desc,NatTrans.id_app] + exact (Category.comp_id (single F s)).symm +lemma mapNat_comp (η:F⟶G) (θ:G⟶H) : mapNat (η≫θ)=mapNat η ≫ mapNat θ := by + apply NatTrans.ext; funext n + apply hom_ext; intro s + simp only [mapNat,single_desc,NatTrans.comp_app] + change (η.app s.right.unop ≫ θ.app s.right.unop) ≫ single H s = + single F s ≫ (mapNat η).app n ≫ (mapNat θ).app n + exact (comp_pair (single_desc F _ s) (single_desc G _ s)).symm +variable {D:Type} [Category.{0} D] (u:C ⥤ D) (G H:D ⥤ ModuleCat.{0} R) (η:G⟶H) +lemma post_natural : mapNat (Functor.whiskerLeft u η) ≫ post u H=post u G ≫ mapNat η := by + apply NatTrans.ext; funext n + apply hom_ext; intro s + change single (u ⋙ G) s ≫ (mapNat (Functor.whiskerLeft u η)).app n ≫ (post u H).app n = + single (u ⋙ G) s ≫ (post u G).app n ≫ (mapNat η).app n + exact square_of_components (single_desc (u ⋙ G) _ s) + (single_desc (u ⋙ H) _ s) (single_desc (u ⋙ G) _ s) + (single_desc G (fun z => η.app z.right.unop ≫ single H z) (s ⋙ u.op)).symm +end + +variable {C:Type} [Category.{0} C] +noncomputable def functor : (C ⥤ ModuleCat.{0} ℤ) ⥤ SimplicialObject (ModuleCat.{0} ℤ) where + obj := simplicial + map := mapNat + map_id := mapNat_id + map_comp := mapNat_comp +noncomputable instance : (functor (C:=C)).Additive where + map_add := by + intro F G η θ + apply NatTrans.ext; funext n + apply hom_ext; intro s + simp only [functor,mapNat,single_desc] + erw [NatTrans.app_add, Preadditive.comp_add, single_desc, single_desc, Preadditive.add_comp] +noncomputable def vertices (n:ℕ) : Discrete (Simplex C n) ⥤ C := + Discrete.functor (fun s=>s.right.unop) +noncomputable def degree (n:ℕ) : (C ⥤ ModuleCat.{0} ℤ) ⥤ ModuleCat.{0} ℤ := + functor ⋙ (evaluation _ _).obj (op ⦋n⦌) +noncomputable def vertexCocone (F:C ⥤ ModuleCat.{0} ℤ) (n:ℕ) : Cocone (vertices n ⋙ F) where + pt := Obj F n + ι := Discrete.natTrans (fun s=>single F s.as) +noncomputable def vertexIsColimit (F:C ⥤ ModuleCat.{0} ℤ) (n:ℕ) : IsColimit (vertexCocone F n) where + desc d := desc F (fun s=>d.ι.app ⟨s⟩) + fac _ _ := single_desc _ _ _ + uniq d _ h := hom_ext F (fun s=> (h ⟨s⟩).trans (single_desc F (fun s=>d.ι.app ⟨s⟩) s).symm) +noncomputable def degreeIso (n:ℕ) : degree (C:=C) n ≅ + (Functor.whiskeringLeft (Discrete (Simplex C n)) C (ModuleCat.{0} ℤ)).obj (vertices n) ⋙ colim := + NatIso.ofComponents (fun F=>(vertexIsColimit F n).coconePointUniqueUpToIso (colimit.isColimit _)) (by + intro F G η + apply hom_ext; intro s + change single F s ≫ (mapNat η).app (op ⦋n⦌) ≫ _ = _ + have hg := (vertexIsColimit G n).comp_coconePointUniqueUpToIso_hom (colimit.isColimit _) ⟨s⟩ + have hf := (vertexIsColimit F n).comp_coconePointUniqueUpToIso_hom (colimit.isColimit _) ⟨s⟩ + change single G s ≫ _ = colimit.ι (vertices n ⋙ G) ⟨s⟩ at hg + change single F s ≫ _ = colimit.ι (vertices n ⋙ F) ⟨s⟩ at hf + exact square_of_components (single_mapNat η s) hg hf + (colimit.ι_map (Functor.whiskerLeft (vertices n) η) ⟨s⟩).symm) +noncomputable instance degree_preservesLimits (n:ℕ) : PreservesFiniteLimits (degree (C:=C) n) := + preservesFiniteLimits_of_natIso (degreeIso n).symm +noncomputable instance degree_preservesColimits (n:ℕ) : PreservesColimits (degree (C:=C) n) := + preservesColimits_of_natIso (degreeIso n).symm +end + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits Simplicial Opposite HomologicalComplex AlgebraicTopology +open ExactShapeHomology + +variable {C:Type} [Category.{0} C] +noncomputable def levelMap {m n:ℕ} (f:⦋m⦌⟶⦋n⦌) : degree (C:=C) n ⟶ degree m where + app F := (simplicial F).map f.op + naturality _ _ η := ((mapNat η).naturality f.op).symm +lemma levelMap_id (n:ℕ) : levelMap (C:=C) (𝟙 ⦋n⦌)=𝟙 _ := by + apply NatTrans.ext; funext F + exact (simplicial F).map_id _ +lemma levelMap_comp {l m n:ℕ} (f:⦋l⦌⟶⦋m⦌) (g:⦋m⦌⟶⦋n⦌) : + levelMap (C:=C) (f≫g)=levelMap g ≫ levelMap f := by + apply NatTrans.ext; funext F + exact (simplicial F).map_comp g.op f.op +noncomputable def chainSimplicial (L:ChainComplex (C ⥤ A) ℕ) : + SimplicialObject (ChainComplex A ℕ) where + obj p := ((degree p.unop.len).mapHomologicalComplex c).obj L + map f := (NatTrans.mapHomologicalComplex (levelMap f.unop) c).app L + map_id p := by + apply HomologicalComplex.Hom.ext; funext q + exact congrArg (fun η=>(η.app (L.X q))) (levelMap_id p.unop.len) + map_comp f g := by + apply HomologicalComplex.Hom.ext; funext q + exact congrArg (fun η=>(η.app (L.X q))) (levelMap_comp g.unop f.unop) +noncomputable def chainSimplicialHomology (L:ChainComplex (C ⥤ A) ℕ) (q:ℕ) : + chainSimplicial L ⋙ homologyFunctor A c q ≅ simplicial (L.homology q) := + NatIso.ofComponents (fun p=>(L.sc q).mapHomologyIso (degree p.unop.len)) (by + intro p r f + have h:=ShortComplex.homologyMap_mapNatTrans (L.sc q) (levelMap (C:=C) f.unop) + change homologyMap ((chainSimplicial L).map f) q = + ((L.sc q).mapHomologyIso (degree p.unop.len)).hom ≫ + (simplicial (L.homology q)).map f ≫ + ((L.sc q).mapHomologyIso (degree r.unop.len)).inv at h + change homologyMap ((chainSimplicial L).map f) q ≫ _ = _ + exact iso_transport_cancel _ _ _ _ h) +noncomputable def double (L:ChainComplex (C ⥤ A) ℕ) : + HomologicalComplex₂ A c c := (alternatingFaceMapComplex _).obj (chainSimplicial L) +noncomputable def rowIso (L:ChainComplex (C ⥤ A) ℕ) (q:ℕ) : + TotalFiniteness.row (double L) q ≅ complex (L.homology q) := by + exact eqToIso (congrArg (fun T => T.obj (chainSimplicial L)) + (map_alternatingFaceMapComplex (homologyFunctor A c q))) ≪≫ + (alternatingFaceMapComplex A).mapIso (chainSimplicialHomology L q) +end + +end CoefficientNerve + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/CoefficientNerve.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/CoefficientNerve.lean new file mode 100644 index 0000000000000000000000000000000000000000..e73c078ee1590c8d55a7df9e8eb6c4cec3b1d081 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/CoefficientNerve.lean @@ -0,0 +1,125 @@ +import Mathlib + +namespace OAI + +section +open CategoryTheory Limits Simplicial Opposite Classical +open scoped DirectSum +namespace CoefficientNerve + +variable {R:Type} [CommRing R] +variable {C D E:Type} [Category.{0} C] [Category.{0} D] [Category.{0} E] +variable (F:C ⥤ ModuleCat.{0} R) +abbrev Simplex (C:Type) [Category.{0} C] (n:ℕ) := ComposableArrows Cᵒᵖ n +abbrev Coeff (n:ℕ) (s:Simplex C n) := F.obj s.right.unop +noncomputable abbrev Obj (n:ℕ) := ModuleCat.of R (⨁ (s:Simplex C n), Coeff F n s) +noncomputable def single {n:ℕ} (s:Simplex C n) : Coeff F n s ⟶ Obj F n := + ModuleCat.ofHom (DirectSum.lof R (Simplex C n) (fun t => (Coeff F n t : Type)) s) +noncomputable def desc {n:ℕ} {M:ModuleCat.{0} R} (f:∀s:Simplex C n, Coeff F n s ⟶ M) : Obj F n ⟶ M := + ModuleCat.ofHom (DirectSum.toModule R (Simplex C n) (M:=fun s => (Coeff F n s : Type)) M (fun s=>(f s).hom)) +@[reassoc (attr:=simp)] lemma single_desc {n:ℕ} {M:ModuleCat.{0} R} + (f:∀s:Simplex C n, Coeff F n s ⟶ M) (s:Simplex C n) : + single F s ≫ desc F f=f s := by + ext x + exact DirectSum.toModule_lof R (φ:=fun s => (f s).hom) s x +lemma hom_ext {n:ℕ} {M:ModuleCat.{0} R} {f g:Obj F n ⟶ M} + (h:∀s, single F s ≫ f=single F s ≫ g) : f=g := by + apply ModuleCat.hom_ext + apply DirectSum.linearMap_ext (R:=R) (M:=fun s:Simplex C n => (Coeff F n s : Type)) + intro s + exact congrArg ModuleCat.Hom.hom (h s) +def trunc {m n:ℕ} (f:⦋m⦌ ⟶ ⦋n⦌) (s:Simplex C n) : Simplex C m := + (SimplexCategory.toCat.map f).toFunctor ⋙ s +def tail {m n:ℕ} (f:⦋m⦌ ⟶ ⦋n⦌) (s:Simplex C n) : + s.right.unop ⟶ (trunc f s).right.unop := + (s.map (homOfLE (Fin.le_last (f.toOrderHom (Fin.last m))))).unop +noncomputable def map {m n:ℕ} (f:⦋m⦌ ⟶ ⦋n⦌) : Obj F n ⟶ Obj F m := + desc F (fun s=>F.map (tail f s) ≫ single F (trunc f s)) +@[reassoc (attr:=simp)] lemma single_map {m n:ℕ} (f:⦋m⦌ ⟶ ⦋n⦌) (s:Simplex C n) : + single F s ≫ map F f=F.map (tail f s) ≫ single F (trunc f s) := single_desc _ _ _ +@[simp] lemma trunc_id {n:ℕ} (s:Simplex C n) : trunc (𝟙 ⦋n⦌) s=s := rfl +@[simp] lemma tail_id {n:ℕ} (s:Simplex C n) : tail (𝟙 ⦋n⦌) s=𝟙 _ := by + change (s.map (𝟙 _)).unop=𝟙 _ + rw [s.map_id]; rfl +lemma trunc_comp {l m n:ℕ} (f:⦋l⦌ ⟶ ⦋m⦌) (g:⦋m⦌ ⟶ ⦋n⦌) (s:Simplex C n) : + trunc (f ≫ g) s=trunc f (trunc g s) := rfl +lemma tail_comp {l m n:ℕ} (f:⦋l⦌ ⟶ ⦋m⦌) (g:⦋m⦌ ⟶ ⦋n⦌) (s:Simplex C n) : + tail (f ≫ g) s=tail g s ≫ tail f (trunc g s) := by + change (s.map (homOfLE (Fin.le_last (g.toOrderHom (f.toOrderHom (Fin.last l)))))).unop = + (s.map (homOfLE (Fin.le_last (g.toOrderHom (Fin.last m))))).unop ≫ + (s.map (homOfLE (g.toOrderHom.monotone (Fin.le_last (f.toOrderHom (Fin.last l)))))).unop + rw [←unop_comp,←s.map_comp] + congr 2 +lemma map_id (n:ℕ) : map F (𝟙 ⦋n⦌)=𝟙 _ := by + apply hom_ext; intro s + simp +lemma map_comp {l m n:ℕ} (f:⦋l⦌ ⟶ ⦋m⦌) (g:⦋m⦌ ⟶ ⦋n⦌) : + map F (f ≫ g)=map F g ≫ map F f := by + apply hom_ext; intro s + simp only [single_map,tail_comp,F.map_comp,Category.assoc,single_map_assoc,trunc_comp] +noncomputable def simplicial : SimplicialObject (ModuleCat.{0} R) where + obj n := Obj F n.unop.len + map f := map F f.unop + map_id n := map_id F n.unop.len + map_comp f g := map_comp F g.unop f.unop +noncomputable def complex : ChainComplex (ModuleCat.{0} R) ℕ := + (AlgebraicTopology.alternatingFaceMapComplex (ModuleCat.{0} R)).obj (simplicial F) +noncomputable def post (u:C ⥤ D) (G:D ⥤ ModuleCat.{0} R) : + simplicial (u ⋙ G) ⟶ simplicial G where + app n := desc (u ⋙ G) (fun s=>single G (s ⋙ u.op)) + naturality n m f := by + apply hom_ext; intro s + simp only [simplicial,single_desc,single_map_assoc,single_map,single_desc_assoc] + rfl +@[reassoc (attr:=simp)] lemma single_post (u:C ⥤ D) (G:D ⥤ ModuleCat.{0} R) (n:ℕ) + (s:Simplex C n) : single (u ⋙ G) s ≫ (post u G).app (op ⦋n⦌)=single G (s ⋙ u.op) := + single_desc _ _ _ +lemma post_id : post (𝟭 C) F=𝟙 (simplicial F) := by + apply NatTrans.ext; funext n + apply hom_ext; intro s + change single (𝟭 C ⋙ F) s ≫ desc (𝟭 C ⋙ F) (fun simplex=>single F (simplex ⋙ (𝟭 C).op)) = + single (𝟭 C ⋙ F) s ≫ 𝟙 (Obj F n.unop.len) + rw [single_desc] + change single F s = single F s ≫ 𝟙 (Obj F n.unop.len) + exact (Category.comp_id _).symm +lemma post_comp (u:C ⥤ D) (v:D ⥤ E) (G:E ⥤ ModuleCat.{0} R) : + post (u ⋙ v) G=post u (v ⋙ G) ≫ post v G := by + apply NatTrans.ext; funext n + apply hom_ext; intro s + change single (u ⋙ (v ⋙ G)) s ≫ desc (u ⋙ (v ⋙ G)) (fun t=>single G (t ⋙ (u ⋙ v).op)) = + single (u ⋙ (v ⋙ G)) s ≫ desc (u ⋙ (v ⋙ G)) (fun t=>single (v ⋙ G) (t ⋙ u.op)) ≫ + desc (v ⋙ G) (fun t=>single G (t ⋙ v.op)) + rw [single_desc,single_desc_assoc,single_desc] + rfl +end CoefficientNerve + +end + +section +open CategoryTheory Limits Simplicial Opposite +namespace NervePrefix + +variable {C:Type} [Category.{0} C] {d:C} (hd:IsInitial d) +def extra {n:ℕ} (s:ComposableArrows C n) : ComposableArrows C (n+1) := + s.precomp (hd.to s.left) +lemma zero {n:ℕ} (s:ComposableArrows C n) : (nerve C).δ 0 (extra hd s)=s := rfl +lemma obj_zero {n:ℕ} (s:ComposableArrows C n) : (extra hd s).obj 0=d := rfl +lemma succ_obj {n:ℕ} (s:ComposableArrows C n) (i:Fin (n+1)) : + (extra hd s).obj i.succ=s.obj i := rfl +lemma precomp_delta {n:ℕ} (s:ComposableArrows C (n+1)) (i:Fin (n+2)) : + (nerve C).δ i.succ (extra hd s)=extra hd ((nerve C).δ i s) := by + have h₀ : ((nerve C).δ i.succ (extra hd s)).obj 0=d := by + change (extra hd s).obj (i.succ.succAbove 0)=d + rw [Fin.succAbove_of_castSucc_lt _ _ (by simp)] + rfl + have h : ((nerve C).δ i.succ (extra hd s)).δ₀=((nerve C).δ i s) := by + have h:=congrArg (fun f => f (extra hd s)) ((nerve C).δ_comp_δ (Fin.zero_le i)) + exact h + exact ComposableArrows.ext_succ h₀ h + ((IsInitial.ofIso hd (eqToIso h₀.symm)).hom_ext _ _) + +end NervePrefix + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/ConjugationNatural.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/ConjugationNatural.lean new file mode 100644 index 0000000000000000000000000000000000000000..9388f499998359cf95c1b320b5a405e74fe54fe8 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/ConjugationNatural.lean @@ -0,0 +1,162 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.CanonicalShapiro + +namespace OAI + +section + +section + +open CategoryTheory CategoryTheory.Limits Finsupp Representation Rep +universe u +namespace HomologyConjugation +variable {k G : Type u} [CommRing k] [Group G] + +noncomputable def rightBarLift (c : G) (n : ℕ) : + Rep.free k G (Fin n → G) ⟶ Rep.free k G (Fin n → G) := + Rep.freeLift k G _ (fun x => Finsupp.single ((MulAut.conj c) ∘ x) + (MonoidAlgebra.single c⁻¹ 1)) + +@[simp] lemma rightBarLift_single (c : G) (n : ℕ) (x : Fin n → G) (g : G) (r : k) : + (rightBarLift (k:=k) c n).hom (single x (MonoidAlgebra.single g r)) = + single ((MulAut.conj c) ∘ x) (MonoidAlgebra.single (g*c⁻¹) r) := by + simp [rightBarLift, Representation.freeLift_single_single] + +lemma bar_d_weighted (n : ℕ) (x : Fin (n+1) → G) (g : G) (r : k) : + (Rep.barComplex.d k G n).hom (single x (MonoidAlgebra.single g r)) = + single (fun i => x i.succ) (MonoidAlgebra.single (g*x 0) r) + + ∑j : Fin (n+1), single (Fin.contractNth j (·*·) x) + (MonoidAlgebra.single g (r*((-1:k)^(j.val+1)))) := by + simp [Rep.barComplex.d, ← Representation.IntertwiningMap.toLinearMap_apply, + smul_add, Finset.smul_sum, Finsupp.smul_single, smul_eq_mul] + +lemma rightBarLift_d (c : G) (n : ℕ) : + Rep.barComplex.d k G n ≫ rightBarLift c n = + rightBarLift c (n+1) ≫ Rep.barComplex.d k G n := by + apply Rep.free_ext + intro x + change (rightBarLift (k:=k) c n).hom + ((Rep.barComplex.d k G n).hom (single x (MonoidAlgebra.single 1 1))) = + (Rep.barComplex.d k G n).hom + ((rightBarLift (k:=k) c (n+1)).hom (single x (MonoidAlgebra.single 1 1))) + rw [Rep.barComplex.d_single, rightBarLift_single, bar_d_weighted] + simp only [map_add, map_sum] + apply congrArg₂ (·+·) + · rw [rightBarLift_single] + congr 1 + simp [MulAut.conj_apply, mul_assoc] + · apply Finset.sum_congr rfl + intro j hj + rw [rightBarLift_single] + congr 1 + · exact Fin.comp_contractNth (·*·) (·*·) (map_mul (MulAut.conj c)) j x + · simp + +noncomputable def rightBarMap (c : G) : Rep.barComplex k G ⟶ Rep.barComplex k G where + f n := rightBarLift c n + comm' i j h := by subst h; simpa [ChainComplex.of.d] using (rightBarLift_d (k:=k) c j).symm + +lemma rightBarMap_π (c : G) : + rightBarMap (k:=k) c ≫ (Rep.barResolution k G).π = (Rep.barResolution k G).π := by + apply (ChainComplex.toSingle₀Equiv _ _).injective + apply Subtype.ext + apply Rep.free_ext + intro x + change ((Rep.barResolution k G).π.f 0).hom + ((rightBarLift c 0).hom (single x (MonoidAlgebra.single 1 1))) = + ((Rep.barResolution k G).π.f 0).hom (single x (MonoidAlgebra.single 1 1)) + rw [rightBarLift_single, CanonicalShapiro.bar_π_zero_single, CanonicalShapiro.bar_π_zero_single] + +noncomputable def rightBarHomotopy (c : G) : + Homotopy (rightBarMap (k:=k) c) (𝟙 (Rep.barComplex k G)) := + ProjectiveResolution.liftHomotopy (𝟙 (Rep.trivial k G k)) + (P:=Rep.barResolution k G) (Q:=Rep.barResolution k G) _ _ + (by + rw [CategoryTheory.Functor.map_id, Category.comp_id] + exact rightBarMap_π (k:=k) c) (by dsimp only [Rep.barResolution]; simp) + +noncomputable def conjugationCoeff (c : G) (A : Rep.{u} k G) : + A ⟶ Rep.res (MulAut.conj c).toMonoidHom A := + Rep.ofHom ⟨A.ρ c, by + intro g + ext a + simp [MulAut.conj_apply, ← Module.End.mul_apply, ← map_mul, mul_assoc]⟩ + +@[simp] lemma conjugationCoeff_apply (c : G) (A : Rep.{u} k G) (a : A) : + (conjugationCoeff c A).hom a = A.ρ c a := rfl + +lemma chainsIso_inv_weighted (A : Rep.{u} k G) [DecidableEq G] + (n : ℕ) (x : Fin n → G) (a : A) (g : G) (r : k) : + (groupHomology.inhomogeneousChainsIso A).inv.f n + (Rep.coinvariantsTensorMk A (Rep.free k G (Fin n → G)) a + (single x (MonoidAlgebra.single g r))) = single x (r • A.ρ g⁻¹ a) := by + change Rep.coinvariantsTensorFreeToFinsupp A _ _ = _ + exact Rep.coinvariantsTensorFreeToFinsupp_mk_tmul_single A a x g r + +lemma conjugation_factorization (c : G) (A : Rep.{u} k G) [DecidableEq G] : + groupHomology.chainsMap (MulAut.conj c).toMonoidHom (conjugationCoeff c A) = + (groupHomology.inhomogeneousChainsIso A).hom ≫ + (((Rep.coinvariantsTensor k G).obj A).mapHomologicalComplex _).map (rightBarMap c) ≫ + (groupHomology.inhomogeneousChainsIso A).inv := by + apply HomologicalComplex.hom_ext + intro n + apply ModuleCat.hom_ext + apply Finsupp.lhom_ext + intro x a + change (groupHomology.chainsMap (MulAut.conj c).toMonoidHom (conjugationCoeff c A)).f n (single x a) = _ + rw [groupHomology.chainsMap_f_single] + change single ((MulAut.conj c) ∘ x) (A.ρ c a) = + (groupHomology.inhomogeneousChainsIso A).inv.f n + ((((Rep.coinvariantsTensor k G).obj A).map (rightBarLift c n)) + ((groupHomology.inhomogeneousChainsIso A).hom.f n (single x a))) + rw [CanonicalShapiro.chainsIso_hom_single, CanonicalShapiro.coinvariantsTensor_map_mk, + rightBarLift_single, chainsIso_inv_weighted] + simp + +lemma map_conjugation (c : G) (A : Rep.{u} k G) (n : ℕ) : + groupHomology.map (MulAut.conj c).toMonoidHom (conjugationCoeff c A) n = + 𝟙 (groupHomology A n) := by + classical + let F := (Rep.coinvariantsTensor k G).obj A + have hh := ((F.mapHomotopy (rightBarHomotopy (k:=k) c)).compLeft + (groupHomology.inhomogeneousChainsIso A).hom).compRight + (groupHomology.inhomogeneousChainsIso A).inv + have hm : (F.mapHomologicalComplex (ComplexShape.down ℕ)).map (𝟙 (Rep.barComplex k G)) = 𝟙 _ := + (F.mapHomologicalComplex _).map_id _ + rw [hm] at hh + have he : Homotopy (groupHomology.chainsMap (MulAut.conj c).toMonoidHom + (conjugationCoeff c A)) (𝟙 _) := by + rw [conjugation_factorization] + simpa only [Category.id_comp, Iso.hom_inv_id, Category.assoc] using hh + exact he.homologyMap_eq n |>.trans (HomologicalComplex.homologyMap_id _ _) + +variable {H : Type u} [Group H] + +lemma map_after_conjugation (f : H →* G) {B : Rep.{u} k H} {A : Rep.{u} k G} + (φ : B ⟶ Rep.res f A) (c : G) (n : ℕ) : + groupHomology.map ((MulAut.conj c).toMonoidHom.comp f) + (φ ≫ (Rep.resFunctor.{u,u,u,u} f).map (conjugationCoeff c A)) n = + groupHomology.map f φ n := by + rw [groupHomology.map_comp, map_conjugation, Category.comp_id] + +lemma map_eq_of_centralizer (f : H →* G) {B : Rep.{u} k H} {A : Rep.{u} k G} + (φ ψ : B ⟶ Rep.res f A) (c : G) (hc : ∀h,c*f h=f h*c) + (hψ : ∀b,ψ.hom b=A.ρ c (φ.hom b)) (n : ℕ) : + groupHomology.map f ψ n = groupHomology.map f φ n := by + have he : (MulAut.conj c).toMonoidHom.comp f=f := by + ext h + change c * f h * c⁻¹=f h + rw [hc, mul_assoc, mul_inv_cancel, mul_one] + have ht := groupHomology.map_congr (A:=B) (B:=A) (n:=n) + (f:=(MulAut.conj c).toMonoidHom.comp f) (g:=f) + (φ:=φ ≫ (Rep.resFunctor.{u,u,u,u} f).map (conjugationCoeff c A)) (ψ:=ψ) he + (by apply LinearMap.ext; intro b; exact (hψ b).symm) + exact ht.symm.trans (map_after_conjugation f φ c n) + +end HomologyConjugation + +end + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/ConstantCoefficient.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/ConstantCoefficient.lean new file mode 100644 index 0000000000000000000000000000000000000000..075b523b2fcb0670c507d1cbc02cf0677a4c8609 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/ConstantCoefficient.lean @@ -0,0 +1,65 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.CoefficientUCT +import OAI.GroupTheory.SimpleAmenable.Simplicial.CoefficientNerve + +namespace OAI + +open CategoryTheory Limits Simplicial Opposite HomologicalComplex AlgebraicTopology MonoidalCategory +namespace CoefficientNerve +open FreeChains + +variable {C:Type} [Category.{0} C] +noncomputable def constant (M:A) : C ⥤ A := (Functor.const C).obj M +noncomputable def constIso (M:A) (n:ℕ) : + Obj (constant (C:=C) M) n ≅ ((ModuleCat.free ℤ).obj (Simplex C n)) ⊗ M := by + classical + exact ((finsuppLEquivDirectSum ℤ M (Simplex C n)).symm ≪≫ₗ + (TensorProduct.finsuppScalarLeft ℤ M (Simplex C n)).symm).toModuleIso +lemma constIso_single (M:A) {n:ℕ} (s:Simplex C n) (m:M) : + (constIso M n).hom (single (constant M) s m) = (ModuleCat.freeMk (R:=ℤ) s) ⊗ₜ[ℤ] m := by + classical + change (TensorProduct.finsuppScalarLeft ℤ M (Simplex C n)).symm + ((finsuppLEquivDirectSum ℤ M (Simplex C n)).symm (DirectSum.lof ℤ _ _ s m)) = _ + simp only [finsuppLEquivDirectSum_symm_lof,TensorProduct.finsuppScalarLeft_symm_apply_single] + rfl +noncomputable def constantSimplicialIso (M:A) : + simplicial (constant (C:=C) M) ≅ nerve Cᵒᵖ ⋙ ModuleCat.free ℤ ⋙ tensorRight M := + NatIso.ofComponents (fun p=>constIso M p.unop.len) (by + intro p q f + apply hom_ext; intro s + change single (constant M) s ≫ map (constant M) f.unop ≫ _ = _ + erw [single_map_assoc] + change (𝟙 M) ≫ single (constant M) (trunc f.unop s) ≫ _ = _ + rw [Category.id_comp] + apply ModuleCat.hom_ext; apply LinearMap.ext; intro m + change (constIso M _).hom (single (constant M) (trunc f.unop s) m) = + ((tensorRight M).map ((ModuleCat.free ℤ).map ((nerve Cᵒᵖ).map f))) + ((constIso M _).hom (single (constant M) s m)) + rw [constIso_single,constIso_single] + change _ = ((ModuleCat.free ℤ).map ((nerve Cᵒᵖ).map f) (ModuleCat.freeMk s)) ⊗ₜ[ℤ] m + erw [ModuleCat.free_map_apply] + rfl) +noncomputable def constantComplexIso (M:A) : + complex (constant (C:=C) M) ≅ (TensorCoefficient.functor (FreeChains.complex (nerve Cᵒᵖ))).obj M := + (alternatingFaceMapComplex A).mapIso (constantSimplicialIso M) ≪≫ + (eqToIso (congrArg (fun T => T.obj (nerve Cᵒᵖ ⋙ ModuleCat.free ℤ)) + (map_alternatingFaceMapComplex (tensorRight M)))).symm +lemma constant_finite (M:A) [Module.Finite ℤ M] (n:ℕ) + (h:∀i,i≤n → Module.Finite ℤ ((nerve Cᵒᵖ).homology Z i : A)) : + Module.Finite ℤ ((complex (constant (C:=C) M)).homology n) := by + let K:=FreeChains.complex (nerve Cᵒᵖ) + have hf (i:ℕ) (hi:i≤n) : Module.Finite ℤ (K.homology i) := by + exact (Module.Finite.equiv_iff ((homologyFunctor A c i).mapIso (FreeChains.complexIso _)).toLinearEquiv).mp (h i hi) + have : ∀i,Module.Flat ℤ (K.X i) := by + intro index + change Module.Flat ℤ (Simplex C index →₀ ℤ) + infer_instance + have hh : Module.Finite ℤ ((TensorCoefficient.homologyFunctor K n).obj M) := by + cases n with + | zero => have:=hf 0 le_rfl; exact TensorCoefficient.finite_coefficient_zero K M + | succ n => have:=hf n (by omega); have:=hf (n+1) le_rfl + exact TensorCoefficient.finite_coefficient_succ K M n + exact (Module.Finite.equiv_iff ((homologyFunctor A c n).mapIso (constantComplexIso (C:=C) M)).symm.toLinearEquiv).mp hh +end CoefficientNerve + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/DiagonalComparison.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/DiagonalComparison.lean new file mode 100644 index 0000000000000000000000000000000000000000..65077b019b05a2609d9c6f0000c4c1ab383364eb --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/DiagonalComparison.lean @@ -0,0 +1,158 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.EZNatural +import OAI.GroupTheory.SimpleAmenable.Homology.TotalComparison + +namespace OAI + +section +open CategoryTheory Limits SimplicialObject Simplicial Opposite AlgebraicTopology +open HomologicalComplex HomologicalComplex₂ +namespace EilenbergZilber + +open DiagonalResolution ModelAssembly +variable {X Y : Dᵒᵖ ⥤ Type} (φ : X ⟶ Y) +noncomputable def bisimplicialMap : bisimplicial X ⟶ bisimplicial Y := + Functor.curry.map (Functor.whiskerLeft + (CategoryTheory.prodOpEquiv SimplexCategory (D:=SimplexCategory)).inverse φ) +lemma level_homology_isIso + (hφ : ∀ p q,IsIso (SSet.homologyMap ((bisimplicialMap φ).app p) Z q)) (n : ℕ) : + IsIso (homologyMap (diagonalMap φ) n) := by + have : IsIso (homologyMap (total.map (twoMap φ) c) n) := by + apply TotalComparison.total_homology_isIso + intro p q + exact hφ (op ⦋p⦌) q + have he : homologyMap (diagonalMap φ) n = + (homologyIsoN X n).hom ≫ homologyMap (total.map (twoMap φ) c) n ≫ (homologyIsoN Y n).inv := by + rw [←Category.assoc,←homology_natural,Category.assoc,Iso.hom_inv_id,Category.comp_id] + rw [he] + infer_instance +end EilenbergZilber + +end + +section + +open CategoryTheory MonoidalCategory Simplicial Opposite +namespace NerveHomotopy + +universe u v +variable {C D : Type u} [Category.{v} C] [Category.{v} D] +variable {F G : C ⥤ D} + +def cylinder (α : F ⟶ G) : C × Fin 2 ⥤ D := + CategoryTheory.Functor.uncurry.obj (ComposableArrows.mk₁ α).flip + +noncomputable def homotopyMap (α : F ⟶ G) : nerve C ⊗ Δ[1] ⟶ nerve D where + app n := ↾fun x => x.1.prod' ((SSet.stdSimplex.objEquiv x.2).toOrderHom.toFunctor) ⋙ cylinder α + naturality _ _ f := by ext x; rfl +@[simp] lemma homotopyMap_zero (α : F ⟶ G) : SSet.ι₀ ≫ homotopyMap α=nerveMap F := by + ext n x + apply CategoryTheory.Functor.ext + · intro i j f + erw [eqToHom_refl, Category.id_comp, Category.comp_id] + change F.map (x.map f) ≫ 𝟙 _=F.map (x.map f) + simp + · intro i + rfl +@[simp] lemma homotopyMap_one (α : F ⟶ G) : SSet.ι₁ ≫ homotopyMap α=nerveMap G := by + ext n x + apply CategoryTheory.Functor.ext + · intro i j f + erw [eqToHom_refl, Category.id_comp, Category.comp_id] + change G.map (x.map f) ≫ 𝟙 _=G.map (x.map f) + simp + · intro i + rfl + +noncomputable def ofNatTrans (α : F ⟶ G) : SSet.Homotopy (nerveMap F) (nerveMap G) where + h := homotopyMap α + h₀ := homotopyMap_zero α + h₁ := homotopyMap_one α + rel := by ext n x; exact x.1.property.elim + +universe w +variable {A : Type w} [Category A] [Preadditive A] + [Limits.HasCoproducts.{max u v} A] [CategoryWithHomology A] + +noncomputable def homologyIso (e : C ≌ D) (R : A) (n : ℕ) : + (nerve C).homology R n ≅ (nerve D).homology R n where + hom := SSet.homologyMap (nerveMap e.functor) R n + inv := SSet.homologyMap (nerveMap e.inverse) R n + hom_inv_id := by + rw [←SSet.homologyMap_comp] + have h := (ofNatTrans e.unitIso.hom).congr_homologyMap R n + change SSet.homologyMap (nerveMap (e.functor ⋙ e.inverse)) R n = _ + rw [←h] + exact SSet.homologyMap_id _ _ _ + inv_hom_id := by + rw [←SSet.homologyMap_comp] + have h := (ofNatTrans e.counitIso.hom).congr_homologyMap R n + change SSet.homologyMap (nerveMap (e.inverse ⋙ e.functor)) R n = _ + rw [h] + exact SSet.homologyMap_id _ _ _ + +noncomputable instance homologyMap_isIso (F : C ⥤ D) [F.IsEquivalence] + (R : A) (n : ℕ) : IsIso (SSet.homologyMap (nerveMap F) R n) := + (homologyIso F.asEquivalence R n).isIso_hom + +end NerveHomotopy + +end + +open CategoryTheory SimplicialObject Simplicial Opposite AlgebraicTopology +namespace SimplicialDiagonal +open DiagonalResolution + +abbrev I := SimplexCategoryᵒᵖ +def uncurry (X : I ⥤ SSet) : DiagonalResolution.Dᵒᵖ ⥤ Type := + (prodOpEquiv SimplexCategory (D:=SimplexCategory)).functor ⋙ Functor.uncurry.obj X +def diagonal : (I ⥤ SSet) ⥤ SSet where + obj X := EilenbergZilber.diag ⋙ uncurry X + map f := Functor.whiskerLeft EilenbergZilber.diag + (Functor.whiskerLeft (prodOpEquiv SimplexCategory (D:=SimplexCategory)).functor (Functor.uncurry.map f)) + map_id _ := by ext; rfl + map_comp _ _ := by ext; rfl +def rowIso (X : I ⥤ SSet) (p : I) : + (EilenbergZilber.bisimplicial (uncurry X)).obj p ≅ X.obj p := + NatIso.ofComponents (fun _ => Iso.refl _) (by + intro q q' f + simp [EilenbergZilber.bisimplicial,uncurry,Functor.uncurry]) +private theorem homologyMap_comp_iso {W X Y Z : SSet} (e : W ≅ X) (f : X ⟶ Y) + (e' : Y ≅ Z) (q : ℕ) (hf : IsIso (SSet.homologyMap f DiagonalResolution.Z q)) : + IsIso (SSet.homologyMap (e.hom ≫ f ≫ e'.hom) DiagonalResolution.Z q) := by + let := hf + rw [SSet.homologyMap_comp, SSet.homologyMap_comp] + infer_instance + +private theorem row_homologyMap_isIso {X Y : I ⥤ SSet} (f : X ⟶ Y) + (hf : ∀ p q, IsIso (SSet.homologyMap (f.app p) DiagonalResolution.Z q)) + (p : SimplexCategoryᵒᵖ) (q : ℕ) : + IsIso (SSet.homologyMap ((EilenbergZilber.bisimplicialMap + (Functor.whiskerLeft (prodOpEquiv SimplexCategory (D:=SimplexCategory)).functor + (Functor.uncurry.map f))).app p) DiagonalResolution.Z q) := by + have he : (EilenbergZilber.bisimplicialMap + (Functor.whiskerLeft (prodOpEquiv SimplexCategory (D:=SimplexCategory)).functor + (Functor.uncurry.map f))).app p = + (rowIso X p).hom ≫ f.app p ≫ (rowIso Y p).inv := by + ext k x + rfl + rw [he] + exact homologyMap_comp_iso (rowIso X p) (f.app p) (rowIso Y p).symm q (hf p q) + +lemma homologyMap_isIso {X Y : I ⥤ SSet} (f : X ⟶ Y) + (hf : ∀ p q, IsIso (SSet.homologyMap (f.app p) DiagonalResolution.Z q)) (n : ℕ) : + IsIso (SSet.homologyMap (diagonal.map f) DiagonalResolution.Z n) := by + exact EilenbergZilber.level_homology_isIso _ (row_homologyMap_isIso f hf) n + +def nerveDiagonal : (I ⥤ Cat.{0,0}) ⥤ SSet := + (Functor.whiskeringRight I Cat SSet).obj nerveFunctor ⋙ diagonal +lemma nerveDiagonal_isIso {X Y : I ⥤ Cat.{0,0}} (f : X ⟶ Y) + (hf : ∀ p, (f.app p).toFunctor.IsEquivalence) (n : ℕ) : + IsIso (SSet.homologyMap (nerveDiagonal.map f) DiagonalResolution.Z n) := by + apply homologyMap_isIso + intro p q + have := hf p + exact NerveHomotopy.homologyMap_isIso (f.app p).toFunctor DiagonalResolution.Z q +end SimplicialDiagonal + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/DiagonalResolution.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/DiagonalResolution.lean new file mode 100644 index 0000000000000000000000000000000000000000..fc1111670cf2eb095fb88f03451a95d70ea48ee6 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/DiagonalResolution.lean @@ -0,0 +1,198 @@ +import Mathlib + +namespace OAI + +open CategoryTheory Limits SimplicialObject Simplicial Opposite AlgebraicTopology +namespace DiagonalResolution + +abbrev D := SimplexCategory × SimplexCategory +abbrev A := ModuleCat.{0} ℤ +noncomputable abbrev Z : A := ModuleCat.of ℤ ℤ +noncomputable abbrev free (d : D) : D ⥤ A := (evaluationLeftAdjoint A d).obj Z + +noncomputable def pre {a b : D} (k : a ⟶ b) : free b ⟶ free a where + app d := Sigma.desc (fun f => Sigma.ι (fun _ : a ⟶ d => Z) (k ≫ f)) + naturality d e f := by + apply Sigma.hom_ext + intro g + simp [free,evaluationLeftAdjoint,Category.assoc] + +@[reassoc (attr := simp)] lemma ι_pre {a b : D} (k : a ⟶ b) (d : D) (f : b ⟶ d) : + Sigma.ι (fun _ : b ⟶ d => Z) f ≫ (pre k).app d = + Sigma.ι (fun _ : a ⟶ d => Z) (k ≫ f) := by + exact Sigma.ι_comp_desc _ _ + +@[simp] lemma pre_id (a : D) : pre (𝟙 a) = 𝟙 (free a) := by + apply NatTrans.ext + funext d + apply Sigma.hom_ext + intro f + simp only [ι_pre, NatTrans.id_app, Category.id_comp] + exact (Category.comp_id _).symm +@[simp] lemma pre_comp {a b c : D} (f : a ⟶ b) (g : b ⟶ c) : + pre (f ≫ g) = pre g ≫ pre f := by + apply NatTrans.ext + funext d + apply Sigma.hom_ext + intro h + simp only [NatTrans.comp_app] + erw [← Category.assoc, ι_pre, ι_pre, ι_pre] + rw [Category.assoc] + +noncomputable def preDiag {a b : SimplexCategory} (f : a ⟶ b) : free (b,b) ⟶ free (a,a) := + pre (a := (a,a)) (b := (b,b)) (f,f) + +noncomputable def chains : SimplicialObject (D ⥤ A) where + obj n := free (n.unop,n.unop) + map f := pre (f.unop,f.unop) + map_id n := pre_id _ + map_comp {X Y W} f g := by + simpa only [unop_comp, prod_comp, Prod.mkHom] using (pre_comp (a := (W.unop,W.unop)) + (b := (Y.unop,Y.unop)) (c := (X.unop,X.unop)) (g.unop,g.unop) (f.unop,f.unop)) +noncomputable def augmentation : chains ⟶ (SimplicialObject.const _).obj ((Functor.const D).obj Z) where + app n := + { app d := Sigma.desc (fun _ : (n.unop,n.unop) ⟶ d => 𝟙 Z) + naturality d e f := by + apply Sigma.hom_ext + intro g + simp [chains,free,evaluationLeftAdjoint] } + naturality n m f := by + apply NatTrans.ext + funext d + apply Sigma.hom_ext + intro g + simp only [NatTrans.comp_app, chains, pre, Functor.const_obj_map] + erw [Sigma.ι_comp_desc_assoc, Sigma.ι_comp_desc, Sigma.ι_comp_desc_assoc, + NatTrans.id_app, Category.id_comp] + rfl + +noncomputable def augmented : SimplicialObject.Augmented (D ⥤ A) where + left := chains + right := (Functor.const D).obj Z + hom := augmentation + +noncomputable def complex : ChainComplex (D ⥤ A) ℕ := + AlternatingFaceMapComplex.obj chains + +instance projective (n : ℕ) : Projective (complex.X n) := by + change Projective (free (⦋n⦌,⦋n⦌)) + exact (evaluationAdjunctionRight A (⦋n⦌,⦋n⦌)).map_projective Z inferInstance + +open SSet.Augmented.StandardSimplex + +def zeroSimplex (a : SimplexCategory) : ⦋0⦌ ⟶ a := SimplexCategory.Hom.mk (OrderHom.const _ 0) + +@[simp] lemma shift_δ₀ {n : ℕ} {a : SimplexCategory} (f : ⦋n⦌ ⟶ a) : + SimplexCategory.δ 0 ≫ shift f = f := by + exact congrArg SSet.stdSimplex.objEquiv.{0} + (ConcreteCategory.congr_hom ((SSet.Augmented.StandardSimplex.extraDegeneracy a).s_comp_δ₀ n) + (SSet.stdSimplex.objEquiv.symm f)) + +@[simp] lemma shift_δ_succ {n : ℕ} {a : SimplexCategory} (f : ⦋n+1⦌ ⟶ a) (i : Fin (n+2)) : + SimplexCategory.δ i.succ ≫ shift f = shift (SimplexCategory.δ i ≫ f) := by + exact congrArg SSet.stdSimplex.objEquiv.{0} + (ConcreteCategory.congr_hom ((SSet.Augmented.StandardSimplex.extraDegeneracy a).s_comp_δ n i) + (SSet.stdSimplex.objEquiv.symm f)) + +@[simp] lemma shift_σ_succ {n : ℕ} {a : SimplexCategory} (f : ⦋n⦌ ⟶ a) (i : Fin (n+1)) : + SimplexCategory.σ i.succ ≫ shift f = shift (SimplexCategory.σ i ≫ f) := by + exact congrArg SSet.stdSimplex.objEquiv.{0} + (ConcreteCategory.congr_hom ((SSet.Augmented.StandardSimplex.extraDegeneracy a).s_comp_σ n i) + (SSet.stdSimplex.objEquiv.symm f)) + +@[simp] lemma shift_δ₁ {a : SimplexCategory} (f : ⦋0⦌ ⟶ a) : + SimplexCategory.δ 1 ≫ shift f = zeroSimplex a := by + exact congrArg SSet.stdSimplex.objEquiv.{0} + (ConcreteCategory.congr_hom ((SSet.Augmented.StandardSimplex.extraDegeneracy a).s₀_comp_δ₁) + (SSet.stdSimplex.objEquiv.symm f)) + +noncomputable abbrev augmentedAt (d : D) : SimplicialObject.Augmented A := + ((SimplicialObject.Augmented.whiskering _ _).obj ((evaluation D A).obj d)).obj augmented +noncomputable def extraAt (d : D) : (augmentedAt d).ExtraDegeneracy where + s' := Sigma.ι (fun _ : (⦋0⦌,⦋0⦌) ⟶ d => Z) (zeroSimplex d.1,zeroSimplex d.2) + s n := Sigma.desc (fun f : (⦋n⦌,⦋n⦌) ⟶ d => + Sigma.ι (fun _ : (⦋n+1⦌,⦋n+1⦌) ⟶ d => Z) (shift f.1,shift f.2)) + s'_comp_ε := by + change Sigma.ι (fun _ : (⦋0⦌,⦋0⦌) ⟶ d => Z) (zeroSimplex d.1,zeroSimplex d.2) ≫ + Sigma.desc (fun _ : (⦋0⦌,⦋0⦌) ⟶ d => 𝟙 Z) = 𝟙 Z + simp + s₀_comp_δ₁ := by + change Sigma.desc _ ≫ (preDiag (SimplexCategory.δ 1)).app d = + Sigma.desc _ ≫ Sigma.ι _ _ + apply Sigma.hom_ext + intro f + dsimp only [preDiag] + erw [Sigma.ι_comp_desc_assoc, ι_pre, Sigma.ι_comp_desc_assoc] + simp only [prod_comp, Prod.mkHom, shift_δ₁] + exact (Category.id_comp _).symm + s_comp_δ₀ n := by + change Sigma.desc _ ≫ (preDiag (SimplexCategory.δ 0)).app d = 𝟙 _ + apply Sigma.hom_ext + intro f + dsimp only [preDiag] + erw [Sigma.ι_comp_desc_assoc, ι_pre] + simp only [prod_comp, Prod.mkHom, shift_δ₀, Prod.eta] + exact (Category.comp_id _).symm + s_comp_δ n i := by + change Sigma.desc _ ≫ (preDiag (SimplexCategory.δ i.succ)).app d = + (preDiag (SimplexCategory.δ i)).app d ≫ Sigma.desc _ + apply Sigma.hom_ext + intro f + dsimp only [preDiag] + erw [Sigma.ι_comp_desc_assoc, ι_pre, ι_pre_assoc, Sigma.ι_comp_desc] + simp only [prod_comp, Prod.mkHom, shift_δ_succ] + rfl + s_comp_σ n i := by + change Sigma.desc _ ≫ (preDiag (SimplexCategory.σ i.succ)).app d = + (preDiag (SimplexCategory.σ i)).app d ≫ Sigma.desc _ + apply Sigma.hom_ext + intro f + dsimp only [preDiag] + erw [Sigma.ι_comp_desc_assoc, ι_pre, ι_pre_assoc, Sigma.ι_comp_desc] + simp only [prod_comp, Prod.mkHom, shift_σ_succ] + rfl + +noncomputable def pi : complex ⟶ (ChainComplex.single₀ (D ⥤ A)).obj ((Functor.const D).obj Z) := + AlternatingFaceMapComplex.ε.app augmented + +noncomputable def atIso (d : D) : + (((evaluation D A).obj d).mapHomologicalComplex (ComplexShape.down ℕ)).obj complex ≅ + AlternatingFaceMapComplex.obj (augmentedAt d).left := + eqToIso (congrArg (fun F => F.obj chains) + (map_alternatingFaceMapComplex ((evaluation D A).obj d))) + +noncomputable def singleAtIso (d : D) : + (((evaluation D A).obj d).mapHomologicalComplex (ComplexShape.down ℕ)).obj + ((ChainComplex.single₀ (D ⥤ A)).obj ((Functor.const D).obj Z)) ≅ + (ChainComplex.single₀ A).obj Z := + (HomologicalComplex.singleMapHomologicalComplex ((evaluation D A).obj d) + (ComplexShape.down ℕ) 0).app ((Functor.const D).obj Z) +instance pi_quasiIso : QuasiIso pi := by + rw [HomologicalComplex.quasiIso_iff_evaluation] + intro d + let f := (((evaluation D A).obj d).mapHomologicalComplex (ComplexShape.down ℕ)).map pi + have h : f ≫ (singleAtIso d).hom = (atIso d).hom ≫ (extraAt d).homotopyEquiv.hom := by + apply HomologicalComplex.to_single_hom_ext + dsimp [f,pi,atIso,singleAtIso] + simp [HomologicalComplex.singleMapHomologicalComplex, + SimplicialObject.Augmented.ExtraDegeneracy.homotopyEquiv, + Functor.mapHomologicalComplex, augmentedAt, augmented, augmentation] + dsimp only [NatIso.ofComponents, SimplicialObject.Augmented.whiskering, + SimplicialObject.Augmented.whiskeringObj, CategoryTheory.eqToIso] + erw [HomologicalComplex.eqToHom_f] + rfl + change QuasiIso f + rw [← quasiIso_iff_comp_right f (singleAtIso d).hom, h] + have : QuasiIso (extraAt d).homotopyEquiv.hom := + (extraAt d).homotopyEquiv.quasiIso_hom + have hcomp := quasiIso_comp (atIso d).hom (extraAt d).homotopyEquiv.hom + exact hcomp + +noncomputable def resolution : ProjectiveResolution ((Functor.const D).obj Z) where + complex := complex + π := pi + quasiIso := pi_quasiIso + +end DiagonalResolution + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/DiagramResolutionNatural.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/DiagramResolutionNatural.lean new file mode 100644 index 0000000000000000000000000000000000000000..8f70f7322c60336f5401749564eae899df8dbe2d --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/DiagramResolutionNatural.lean @@ -0,0 +1,163 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.RestrictedFunctorial + +namespace OAI + +open _root_.CategoryTheory _root_.OAI.CategoryTheory MonoidalCategory SimplicialObject Simplicial Opposite +namespace RestrictedNerve +open IntervalBar IntervalBar.Diagram + +variable {C:Type} [Groupoid.{0} C] (W:MorphismProperty C) + [Fact W.StableUnderInverse] [MonoidalCategory C] [SymmetricCategory C] + [W.IsStableUnderBraiding] +variable {I J:Type} [Preorder I] [Preorder J] +noncomputable def diagramHorizontalReindex (u:I→oJ) : + diagramHorizontal (I:=J) W ⟶ diagramHorizontal (I:=I) W where + app n := (Diagram.reindex (C:=Strings W n.unop.len) u).toCatHom + naturality p q f := by + apply Cat.ext + exact (Diagram.reindex_map (reindex W f.unop.toOrderHom.toFunctor) u).symm +lemma diagramTranspose_posReindex (u:I→oJ) : + diagramHorizontalReindex W u ≫ diagramTranspose (I:=I) W = + diagramTranspose (I:=J) W ≫ horizontalMap (diagramProperty W J) (diagramProperty W I) + (posReindex W u) (posReindex_property W u) := by + apply NatTrans.ext; funext n; apply Cat.ext + exact transpose_posReindex W u n.unop.len +private lemma compose_three_squares {D : Type*} [Category D] + {X₀ X₁ X₂ X₃ X₄ Y₁ Y₂ Y₃ : D} + (a : X₀ ⟶ X₁) (b : X₁ ⟶ X₂) (c : X₀ ⟶ Y₁) (d : Y₁ ⟶ X₂) + (e : X₂ ⟶ X₃) (f : Y₁ ⟶ Y₂) (g : Y₂ ⟶ X₃) (h : X₃ ⟶ X₄) + (i : Y₂ ⟶ Y₃) (j : Y₃ ⟶ X₄) + (h₁ : a ≫ b = c ≫ d) (h₂ : d ≫ e = f ≫ g) (h₃ : g ≫ h = i ≫ j) : + a ≫ (b ≫ e ≫ h) = (c ≫ f ≫ i) ≫ j := by + rw [← Category.assoc a b, h₁] + simp only [Category.assoc] + rw [← Category.assoc d e, h₂] + simp only [Category.assoc] + rw [h₃] + +lemma diagramResolutionHomologyIso_natural {p q:ℕ} + (u:Fin (p+1)→oFin (q+1)) (j:ℕ) : + SSet.homologyMap (SimplicialDiagonal.nerveDiagonal.map (diagramHorizontalReindex W u)) + DiagonalResolution.Z j ≫ (diagramResolutionHomologyIso W p j).hom = + (diagramResolutionHomologyIso W q j).hom ≫ + SSet.homologyMap (nerveMap (Diagram.reindex (C:=C) u)) DiagonalResolution.Z j := by + let H := SSet.homologyFunctor DiagonalResolution.Z j + let N := SimplicialDiagonal.nerveDiagonal + have ht := congrArg (fun f=>H.map (N.map f)) (diagramTranspose_posReindex W u) + simp only [Functor.map_comp] at ht + have hr := homologyIso_natural (diagramProperty W (Fin (q+1))) (diagramProperty W (Fin (p+1))) + (posReindex W u) (posReindex_property W u) j + change H.map (N.map (horizontalMap (diagramProperty W (Fin (q+1))) (diagramProperty W (Fin (p+1))) + (posReindex W u) (posReindex_property W u))) ≫ (homologyIso (diagramProperty W (Fin (p+1))) j).hom = + (homologyIso (diagramProperty W (Fin (q+1))) j).hom ≫ H.map (nerveMap (posReindex W u)) at hr + have he : nerveMap (posReindex W u) ≫ nerveMap (posDiagramInclusion W (Fin (p+1))) = + nerveMap (posDiagramInclusion W (Fin (q+1))) ≫ nerveMap (Diagram.reindex (C:=C) u) := by + change nerveMap (posReindex W u ⋙ posDiagramInclusion W (Fin (p+1))) = + nerveMap (posDiagramInclusion W (Fin (q+1)) ⋙ Diagram.reindex u) + rw [posReindex_inclusion] + have hi := congrArg H.map he + simp only [Functor.map_comp] at hi + change H.map (N.map (diagramHorizontalReindex W u)) ≫ + (H.map (N.map (diagramTranspose (I:=Fin (p+1)) W)) ≫ + (homologyIso (diagramProperty W (Fin (p+1))) j).hom ≫ + H.map (nerveMap (posDiagramInclusion W (Fin (p+1))))) = + (H.map (N.map (diagramTranspose (I:=Fin (q+1)) W)) ≫ + (homologyIso (diagramProperty W (Fin (q+1))) j).hom ≫ + H.map (nerveMap (posDiagramInclusion W (Fin (q+1))))) ≫ + H.map (nerveMap (Diagram.reindex (C:=C) u)) + exact compose_three_squares _ _ _ _ _ _ _ _ _ _ ht hr hi + +noncomputable instance posReindexMonoidal (u:I→oJ) : (posReindex W u).Monoidal := + Functor.CoreMonoidal.toMonoidal { + εIso := Iso.refl _ + μIso _ _ := Iso.refl _ + μIso_hom_natural_left := by + intros + simp only [Iso.refl_hom] + repeat' first | erw [id_whiskerRight] | erw [whiskerLeft_id] | erw [Category.comp_id] | erw [Category.id_comp] + apply InducedCategory.hom_ext; apply Hom.ext; intro i j h + simp [posReindex,posWhiskerRight_app] + rfl + μIso_hom_natural_right := by + intros + simp only [Iso.refl_hom] + repeat' first | erw [id_whiskerRight] | erw [whiskerLeft_id] | erw [Category.comp_id] | erw [Category.id_comp] + apply InducedCategory.hom_ext; apply Hom.ext; intro i j h + simp [posReindex,posWhiskerLeft_app] + rfl + associativity := by + intros + simp only [Iso.refl_hom] + repeat' first | erw [id_whiskerRight] | erw [whiskerLeft_id] | erw [Category.comp_id] | erw [Category.id_comp] + apply InducedCategory.hom_ext; apply Hom.ext; intro i j h + rfl + left_unitality := by + intros + simp only [Iso.refl_hom] + repeat' first | erw [id_whiskerRight] | erw [whiskerLeft_id] | erw [Category.comp_id] | erw [Category.id_comp] + apply InducedCategory.hom_ext; apply Hom.ext; intro i j h + rfl + right_unitality := by + intros + simp only [Iso.refl_hom] + repeat' first | erw [id_whiskerRight] | erw [whiskerLeft_id] | erw [Category.comp_id] | erw [Category.id_comp] + apply InducedCategory.hom_ext; apply Hom.ext; intro i j h + rfl } +noncomputable instance posReindexBraided (u:I→oJ) : (posReindex W u).Braided where + braided A B := by + apply InducedCategory.hom_ext; apply Hom.ext; intro i j h + change 𝟙 _ ≫ (β_ _ _).hom = (β_ _ _).hom ≫ 𝟙 _ + simp +noncomputable def widePosReindex (u:I→oJ) : + WideSubcategory (diagramProperty W J) ⥤ WideSubcategory (diagramProperty W I) where + obj A := ⟨(posReindex W u).obj A.obj⟩ + map f := ⟨(posReindex W u).map f.hom,posReindex_property W u f.hom f.property⟩ + map_id A := by apply WideSubcategory.hom_ext; exact (posReindex W u).map_id _ + map_comp f g := by apply WideSubcategory.hom_ext; exact (posReindex W u).map_comp _ _ +noncomputable instance widePosReindexMonoidal (u:I→oJ) : (widePosReindex W u).Monoidal := + Functor.CoreMonoidal.toMonoidal { + εIso := Iso.refl _ + μIso _ _ := Iso.refl _ + μIso_hom_natural_left := by + intros + simp only [Iso.refl_hom] + repeat' first | erw [id_whiskerRight] | erw [whiskerLeft_id] | erw [Category.comp_id] | erw [Category.id_comp] + apply WideSubcategory.hom_ext; apply InducedCategory.hom_ext + apply Hom.ext; intro i j h + simp [widePosReindex,posReindex,posWhiskerRight_app] + rfl + μIso_hom_natural_right := by + intros + simp only [Iso.refl_hom] + repeat' first | erw [id_whiskerRight] | erw [whiskerLeft_id] | erw [Category.comp_id] | erw [Category.id_comp] + apply WideSubcategory.hom_ext; apply InducedCategory.hom_ext + apply Hom.ext; intro i j h + simp [widePosReindex,posReindex,posWhiskerLeft_app] + rfl + associativity := by + intros + simp only [Iso.refl_hom] + repeat' first | erw [id_whiskerRight] | erw [whiskerLeft_id] | erw [Category.comp_id] | erw [Category.id_comp] + apply WideSubcategory.hom_ext; apply InducedCategory.hom_ext + apply Hom.ext; intro i j h; rfl + left_unitality := by + intros + simp only [Iso.refl_hom] + repeat' first | erw [id_whiskerRight] | erw [whiskerLeft_id] | erw [Category.comp_id] | erw [Category.id_comp] + apply WideSubcategory.hom_ext; apply InducedCategory.hom_ext + apply Hom.ext; intro i j h; rfl + right_unitality := by + intros + simp only [Iso.refl_hom] + repeat' first | erw [id_whiskerRight] | erw [whiskerLeft_id] | erw [Category.comp_id] | erw [Category.id_comp] + apply WideSubcategory.hom_ext; apply InducedCategory.hom_ext + apply Hom.ext; intro i j h; rfl } +noncomputable instance widePosReindexBraided (u:I→oJ) : (widePosReindex W u).Braided where + braided A B := by + apply WideSubcategory.hom_ext; apply InducedCategory.hom_ext; apply Hom.ext; intro i j h + change 𝟙 _ ≫ (β_ _ _).hom = (β_ _ _).hom ≫ 𝟙 _ + simp +end RestrictedNerve + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/EZNatural.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/EZNatural.lean new file mode 100644 index 0000000000000000000000000000000000000000..4a07da1d0c0b6a68c0154a7aa95e297260cc5bbc --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/EZNatural.lean @@ -0,0 +1,112 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.EilenbergZilber +import OAI.GroupTheory.SimpleAmenable.Homology.AssemblyMap + +namespace OAI + +open CategoryTheory Limits SimplicialObject Simplicial Opposite AlgebraicTopology +open HomologicalComplex HomologicalComplex₂ +namespace EilenbergZilber + +open DiagonalResolution ModelAssembly +variable {X Y : Dᵒᵖ ⥤ Type} (φ : X ⟶ Y) +noncomputable def diagonalMap : SSet.chainComplex (diag ⋙ X) Z ⟶ SSet.chainComplex (diag ⋙ Y) Z := + (alternatingFaceMapComplex A).map + (Functor.whiskerRight (Functor.whiskerLeft diag φ) (sigmaConst.obj Z)) +noncomputable def twoMap : twoComplex X ⟶ twoComplex Y := + (alternatingFaceMapComplex (ChainComplex A ℕ)).map + (Functor.whiskerRight + (Functor.curry.map (Functor.whiskerLeft + (CategoryTheory.prodOpEquiv SimplexCategory (D:=SimplexCategory)).inverse + (Functor.whiskerRight φ (sigmaConst.obj Z)))) (alternatingFaceMapComplex A)) +noncomputable def twoIsoN (X : Dᵒᵖ ⥤ Type) : + TotalFunctor.map₂ (assembly X) BiResolution.complex ≅ twoComplex X := by + let F := assembly X + let FC := F.mapHomologicalComplex c + refine (CategoryTheory.eqToIso (congrArg (fun G => G.obj + (BiResolution.chains ⋙ alternatingFaceMapComplex (D ⥤ A))) + (map_alternatingFaceMapComplex FC))) ≪≫ ?_ + refine (alternatingFaceMapComplex (ChainComplex A ℕ)).mapIso + (Functor.isoWhiskerLeft BiResolution.chains + (CategoryTheory.eqToIso (map_alternatingFaceMapComplex F))) ≪≫ ?_ + exact (alternatingFaceMapComplex (ChainComplex A ℕ)).mapIso + (Functor.isoWhiskerRight (bisimplicialIso X) (alternatingFaceMapComplex A)) +noncomputable def equivN (X : Dᵒᵖ ⥤ Type) : + HomotopyEquiv (SSet.chainComplex (diag ⋙ X) Z) ((twoComplex X).total c) := + (HomotopyEquiv.ofIso (diagonalIso X).symm).trans + ((assembledEquiv X).trans (HomotopyEquiv.ofIso + (TotalFunctor.iso (assembly X) BiResolution.complex ≪≫ total.mapIso (twoIsoN X) c))) +lemma diagonalIso_f (n : ℕ) : (diagonalIso X).hom.f n = forward X (SimplexCategory.mk n,SimplexCategory.mk n) := by + simp only [diagonalIso, Iso.trans_hom, HomologicalComplex.comp_f] + dsimp only [CategoryTheory.eqToIso] + erw [HomologicalComplex.eqToHom_f] + erw [eqToHom_refl, Category.id_comp] + rfl +lemma twoIso_f (p q : ℕ) : ((twoIsoN X).hom.f p).f q = forward X (SimplexCategory.mk p,SimplexCategory.mk q) := by + simp only [twoIsoN, Iso.trans_hom, HomologicalComplex.comp_f] + dsimp only [CategoryTheory.eqToIso] + erw [HomologicalComplex.eqToHom_f, HomologicalComplex.eqToHom_f] + erw [eqToHom_refl, Category.id_comp] + erw [Iso.trans_hom, HomologicalComplex.comp_f, + Functor.mapIso_hom, alternatingFaceMapComplex_map_f, Functor.isoWhiskerLeft_hom, + Functor.whiskerLeft_app] + dsimp only [CategoryTheory.eqToIso] + erw [eqToHom_app, HomologicalComplex.eqToHom_f, eqToHom_refl, Category.id_comp] + rfl +@[reassoc] lemma diagonal_natural : + ((assemblyMap φ).mapHomologicalComplex c).app DiagonalResolution.complex ≫ + (diagonalIso Y).hom = (diagonalIso X).hom ≫ diagonalMap φ := by + apply HomologicalComplex.Hom.ext + funext n + change (assemblyMap φ).app (free (SimplexCategory.mk n,SimplexCategory.mk n)) ≫ + (diagonalIso Y).hom.f n = (diagonalIso X).hom.f n ≫ _ + rw [diagonalIso_f,diagonalIso_f] + exact map_forward φ _ +@[reassoc] lemma two_natural : + TotalFunctor.nat₂ (assemblyMap φ) BiResolution.complex ≫ (twoIsoN Y).hom = + (twoIsoN X).hom ≫ twoMap φ := by + apply HomologicalComplex.Hom.ext + funext p + apply HomologicalComplex.Hom.ext + funext q + change (assemblyMap φ).app (free (SimplexCategory.mk p,SimplexCategory.mk q)) ≫ + ((twoIsoN Y).hom.f p).f q = ((twoIsoN X).hom.f p).f q ≫ _ + rw [twoIso_f,twoIso_f] + exact map_forward φ _ +@[reassoc] lemma equiv_natural : + diagonalMap φ ≫ (equivN Y).hom = (equivN X).hom ≫ total.map (twoMap φ) c := by + change diagonalMap φ ≫ (diagonalIso Y).inv ≫ (assembledEquiv Y).hom ≫ + (TotalFunctor.iso (assembly Y) BiResolution.complex).hom ≫ (total.mapIso (twoIsoN Y) c).hom = + ((diagonalIso X).inv ≫ (assembledEquiv X).hom ≫ + (TotalFunctor.iso (assembly X) BiResolution.complex).hom ≫ (total.mapIso (twoIsoN X) c).hom) ≫ _ + apply (cancel_epi (diagonalIso X).hom).mp + simp only [←Category.assoc] + rw [←diagonal_natural] + simp only [Category.assoc,Iso.hom_inv_id_assoc] + have hn := ((assemblyMap φ).mapHomologicalComplex c).naturality modelEquiv.hom + have hn' : ((assemblyMap φ).mapHomologicalComplex c).app DiagonalResolution.complex ≫ + (assembledEquiv Y).hom = (assembledEquiv X).hom ≫ + ((assemblyMap φ).mapHomologicalComplex c).app BiResolution.total := hn.symm + rw [←Category.assoc,hn'] + simp only [Category.assoc] + have ht := TotalFunctor.iso_natural (assemblyMap φ) BiResolution.complex + change ((assemblyMap φ).mapHomologicalComplex c).app BiResolution.total ≫ + (TotalFunctor.iso (assembly Y) BiResolution.complex).hom = _ at ht + erw [reassoc_of% ht] + have htwo : total.map (TotalFunctor.nat₂ (assemblyMap φ) BiResolution.complex) c ≫ + total.map (twoIsoN Y).hom c = total.map (twoIsoN X).hom c ≫ total.map (twoMap φ) c := by + rw [←total.map_comp,←total.map_comp,two_natural] + exact congrArg (fun k => (assembledEquiv X).hom ≫ + (TotalFunctor.iso (assembly X) BiResolution.complex).hom ≫ k) htwo +noncomputable def homologyIsoN (X : Dᵒᵖ ⥤ Type) (n : ℕ) : + SSet.homology (diag ⋙ X) Z n ≅ (((twoComplex X).total c).homology n) := + (equivN X).toHomologyIso n +@[reassoc] lemma homology_natural (n : ℕ) : + homologyMap (diagonalMap φ) n ≫ (homologyIsoN Y n).hom = + (homologyIsoN X n).hom ≫ homologyMap (total.map (twoMap φ) c) n := by + change homologyMap (diagonalMap φ) n ≫ homologyMap (equivN Y).hom n = + homologyMap (equivN X).hom n ≫ homologyMap (total.map (twoMap φ) c) n + rw [←homologyMap_comp,←homologyMap_comp,equiv_natural] +end EilenbergZilber + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/EilenbergZilber.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/EilenbergZilber.lean new file mode 100644 index 0000000000000000000000000000000000000000..ac26cbab26b47e5520b87932363aa6ab8ab6d3e3 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/EilenbergZilber.lean @@ -0,0 +1,90 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.BiProjective + +namespace OAI + +section + +section + +open CategoryTheory Limits SimplicialObject Simplicial Opposite AlgebraicTopology +open HomologicalComplex HomologicalComplex₂ +namespace EilenbergZilber + +open DiagonalResolution ModelAssembly +abbrev c := ComplexShape.down ℕ + +def diag : SimplexCategoryᵒᵖ ⥤ Dᵒᵖ := (Functor.diag SimplexCategory).op + +def bisimplicial {C : Type*} [Category C] (F : Dᵒᵖ ⥤ C) : + SimplicialObject (SimplicialObject C) := + Functor.curry.obj ((CategoryTheory.prodOpEquiv SimplexCategory (D := SimplexCategory)).inverse ⋙ F) + +variable (X : Dᵒᵖ ⥤ Type) +noncomputable def diagonalIso : + (((assembly X).mapHomologicalComplex c).obj DiagonalResolution.complex) ≅ + SSet.chainComplex (diag ⋙ X) Z := by + refine (CategoryTheory.eqToIso (congrArg (fun F => F.obj DiagonalResolution.chains) + (map_alternatingFaceMapComplex (assembly X)))) ≪≫ ?_ + change AlternatingFaceMapComplex.obj (diag ⋙ models ⋙ assembly X) ≅ + AlternatingFaceMapComplex.obj (diag ⋙ X ⋙ sigmaConst.obj Z) + exact (alternatingFaceMapComplex A).mapIso + (Functor.isoWhiskerLeft diag (freeNatIso X)) + +noncomputable def rowIso (p : SimplexCategoryᵒᵖ) : + ((BiResolution.chains.obj p) ⋙ assembly X) ≅ + (bisimplicial (X ⋙ sigmaConst.obj Z)).obj p := by + refine NatIso.ofComponents (fun q => freeIso X (p.unop,q.unop)) ?_ + intro q q' f + change (assembly X).map (pre (a:=(p.unop,q'.unop)) (b:=(p.unop,q.unop)) + (𝟙 p.unop,f.unop)) ≫ forward X (p.unop,q'.unop) = + forward X (p.unop,q.unop) ≫ + (sigmaConst.obj Z).map (X.map (show (p.unop,q'.unop) ⟶ (p.unop,q.unop) from + (𝟙 p.unop,f.unop)).op) + exact pre_forward X (a:=(p.unop,q'.unop)) (b:=(p.unop,q.unop)) (𝟙 p.unop,f.unop) + +noncomputable def bisimplicialIso : + BiResolution.chains ⋙ (Functor.whiskeringRight _ _ _).obj (assembly X) ≅ + bisimplicial (X ⋙ sigmaConst.obj Z) := by + refine NatIso.ofComponents (rowIso X) ?_ + intro p p' f + apply NatTrans.ext + funext q + change (assembly X).map (pre (a:=(p'.unop,q.unop)) (b:=(p.unop,q.unop)) + (f.unop,𝟙 q.unop)) ≫ forward X (p'.unop,q.unop) = + forward X (p.unop,q.unop) ≫ + (sigmaConst.obj Z).map (X.map (show (p'.unop,q.unop) ⟶ (p.unop,q.unop) from + (f.unop,𝟙 q.unop)).op) + exact pre_forward X (a:=(p'.unop,q.unop)) (b:=(p.unop,q.unop)) (f.unop,𝟙 q.unop) + +noncomputable def twoComplex : HomologicalComplex₂ A c c := + AlternatingFaceMapComplex.obj (bisimplicial (X ⋙ sigmaConst.obj Z) ⋙ alternatingFaceMapComplex A) + +noncomputable def twoIso : TotalFunctor.map₂ (assembly X) BiResolution.complex ≅ twoComplex X := by + let F := assembly X + let FC := F.mapHomologicalComplex c + refine (CategoryTheory.eqToIso (congrArg (fun G => G.obj + (BiResolution.chains ⋙ alternatingFaceMapComplex (D ⥤ A))) + (map_alternatingFaceMapComplex FC))) ≪≫ ?_ + change AlternatingFaceMapComplex.obj + (BiResolution.chains ⋙ alternatingFaceMapComplex (D ⥤ A) ⋙ FC) ≅ _ + rw [map_alternatingFaceMapComplex F] + exact (alternatingFaceMapComplex (ChainComplex A ℕ)).mapIso + (Functor.isoWhiskerRight (bisimplicialIso X) (alternatingFaceMapComplex A)) + +noncomputable def equiv : HomotopyEquiv (SSet.chainComplex (diag ⋙ X) Z) ((twoComplex X).total c) := + (HomotopyEquiv.ofIso (diagonalIso X).symm).trans + ((assembledEquiv X).trans (HomotopyEquiv.ofIso + (TotalFunctor.iso (assembly X) BiResolution.complex ≪≫ total.mapIso (twoIso X) c))) + +noncomputable def homologyIso (n : ℕ) : + SSet.homology (diag ⋙ X) Z n ≅ (((twoComplex X).total c).homology n) := + (equiv X).toHomologyIso n + +end EilenbergZilber + +end + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/FiberSum.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/FiberSum.lean new file mode 100644 index 0000000000000000000000000000000000000000..351f2524626fa3117c5a2c633f39ca99d57fbf76 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/FiberSum.lean @@ -0,0 +1,56 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.FiniteSetMonoidal + +namespace OAI + +open CategoryTheory Limits MonoidalCategory +namespace BarFiberProduct + +section +variable {C D : Type} [Category C] [Category D] [MonoidalCategory C] [MonoidalCategory D] + [BraidedCategory C] [BraidedCategory D] +noncomputable instance prodBraided : BraidedCategory (C×D) where + braiding X Y := (β_ X.1 Y.1).prod (β_ X.2 Y.2) + braiding_naturality_left := by intro X Y f Z; ext <;> simp + braiding_naturality_right := by intro X Y Z f; ext <;> simp + hexagon_forward := by intro X Y Z; ext <;> simp + hexagon_reverse := by intro X Y Z; ext <;> simp +end +variable {C D : Type} [Category C] [Category D] [MonoidalCategory C] [MonoidalCategory D] + [SymmetricCategory C] [SymmetricCategory D] +noncomputable instance prodSymmetric : + SymmetricCategory (C×D) where + symmetry X Y := by + apply Prod.hom_ext + · change (β_ X.1 Y.1).hom ≫ (β_ Y.1 X.1).hom=𝟙 _ + simp + · change (β_ X.2 Y.2).hom ≫ (β_ Y.2 X.2).hom=𝟙 _ + simp +end BarFiberProduct +open BarFiberProduct +namespace SimpleAmenable.PolygonObject.FiniteSetGroupoid + +lemma tensorμ_eq (A B C D : FiniteSetGroupoid) : + tensorμ A B C D = assoc A B (sum C D) ≫ + sumHom (𝟙 A) (CategoryTheory.inv (assoc B C D)) ≫ + sumHom (𝟙 A) (sumHom (swap B C) (𝟙 D)) ≫ + sumHom (𝟙 A) (assoc C B D) ≫ CategoryTheory.inv (assoc A C (sum B D)) := rfl +lemma tensorμ_swap (U V : FiniteSetGroupoid × FiniteSetGroupoid) : + tensorμ U.1 U.2 V.1 V.2 ≫ sumHom (swap U.1 V.1) (swap U.2 V.2) = + swap (sum U.1 U.2) (sum V.1 V.2) ≫ tensorμ V.1 V.2 U.1 U.2 := by + rw [tensorμ_eq,tensorμ_eq] + dsimp only [CategoryStruct.comp, instGroupoid, toEquiv] + apply Equiv.ext; intro x + obtain ⟨y,rfl⟩ := (sumEquiv (sum U.1 U.2) (sum V.1 V.2)).surjective x + cases y with + | inl y => + obtain ⟨z,rfl⟩ := (sumEquiv U.1 U.2).surjective y + cases z <;> simp [toEquiv, sumHom, assoc, swap, inv_eq, Equiv.trans_apply, MonoidalCategory.tensorObj] + | inr y => + obtain ⟨z,rfl⟩ := (sumEquiv V.1 V.2).surjective y + cases z <;> simp [toEquiv, sumHom, assoc, swap, inv_eq, Equiv.trans_apply, MonoidalCategory.tensorObj] +noncomputable instance tensorBraided : (tensor FiniteSetGroupoid).Braided where + braided U V := tensorμ_swap U V +end SimpleAmenable.PolygonObject.FiniteSetGroupoid + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/FinitePowerConnected.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/FinitePowerConnected.lean new file mode 100644 index 0000000000000000000000000000000000000000..62cb69b2f1956e552a0066cdb56d782c9b0aad06 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/FinitePowerConnected.lean @@ -0,0 +1,76 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.ConstantSplit +import OAI.GroupTheory.SimpleAmenable.Simplicial.FinitePowerLow + +namespace OAI + +section + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits MonoidalCategory Simplicial Opposite +namespace BarFinitePower +open FreeChains + +attribute [local instance 1200] Pi.module Prod.instModule + +def LowConnected (X:SSet) : Prop := ∀ j:ℕ, 0 < j → j < 3 → IsZero (X.homology Z j) +namespace LowConnected +variable {X Y:SSet} +lemma of_iso (e:X≅Y) (h:LowConnected Y) : LowConnected X := + fun j hj h3 => IsZero.of_iso (h j hj h3) ((SSet.homologyFunctor Z j).mapIso e) +lemma one : LowConnected ConnectedProduct.one := fun j hj _ => + ConnectedProduct.one_homology_zero j (by omega) +lemma projection_isIso [X.IsConnected] [Y.IsConnected] (hX:LowConnected X) (hY:LowConnected Y) + (j:ℕ) (hj:0 exact of_iso (finZeroIso X) one + | succ s ih => exact of_iso (finSuccIso X s) (tensor hX ih) +lemma power [X.IsConnected] (hX:LowConnected X) (κ:Type) [Finite κ] : LowConnected ((BarFinitePower.power κ).obj X) := by + let := Fintype.ofFinite κ + exact of_iso (reindexIso X (Fintype.equivFin κ)) (fin hX _) +end LowConnected +variable (X:SSet) [X.IsConnected] (hX:LowConnected X) +include hX in +lemma coordinates_fin_isIso_connected (s j:ℕ) (hj:0 + have hz : IsZero (((power (Fin 0)).obj X).homology Z j) := + IsZero.of_iso (ConnectedProduct.one_homology_zero j (by omega)) + ((SSet.homologyFunctor Z j).mapIso (finZeroIso X)) + exact hz.isIso (ModuleCat.isZero_iff_subsingleton.mpr inferInstance) _ + | succ s ih => + have := ih + have := LowConnected.projection_isIso hX (hX.fin s) j hj hj5 + have : IsIso (biprod.map (𝟙 (X.homology Z j)) (coordinates (Fin s) X j)) := by + change IsIso (biprod.mapIso (Iso.refl _) (asIso (coordinates (Fin s) X j))).hom + infer_instance + have : IsIso (coordinates (Fin (s+1)) X j ≫ (coordinateSplit (X.homology Z j) s).hom) := by + rw [coordinates_fin_succ]; infer_instance + exact (isIso_comp_right_iff _ (coordinateSplit (X.homology Z j) s).hom).mp inferInstance +include hX in +lemma coordinates_isIso_connected (κ:Type) [Finite κ] (j:ℕ) (hj:0 + have : Module.Finite ℤ (ConnectedProduct.one.homology Z n : A) := by + by_cases hn:n=0 + · subst n; exact homology_zero_finite _ + · have := ModuleCat.isZero_iff_subsingleton.mp (ConnectedProduct.one_homology_zero n hn) + infer_instance + exact finite_of_iso (finZeroIso X) n + | succ s ih => + have := finite_tensor X ((power (Fin s)).obj X) n hX (by + intro i hi + exact ih i (by intro j hj; exact hX j (hj.trans hi))) + exact finite_of_iso (finSuccIso X s) n +lemma finite_power (X:SSet) (κ:Type) [Finite κ] (n:ℕ) + (hX:∀i,i≤n → Module.Finite ℤ (X.homology Z i : A)) : + Module.Finite ℤ (((power κ).obj X).homology Z n : A) := by + let := Fintype.ofFinite κ + have := finite_fin X (Fintype.card κ) n hX + exact finite_of_iso (reindexIso X (Fintype.equivFin κ)) n +end BarFinitePower + +end + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory MonoidalCategory Simplicial Opposite +namespace BarFinitePower +open IntervalBar IntervalBar.Diagram StageProductColimit SimplicialDiagonal + +variable {C:Type} [Groupoid.{0} C] [MonoidalCategory C] [SymmetricCategory C] (κ:Type) +noncomputable def singleProject (n:ℕ) : + Diagram (κ→C) (Fin (n+1)) ⥤ (κ→Diagram C (Fin (n+1))) := + Functor.pi' (fun k => map (I:=Fin (n+1)) (project κ k)) +lemma singleProject_eval (n:ℕ) : + singleProject (C:=C) κ n ⋙ powerMap κ (eval n) = eval n ⋙ swap (Fin n) κ := rfl +noncomputable instance (n:ℕ) : (singleProject (C:=C) κ n).IsEquivalence := by + have : (singleProject (C:=C) κ n ⋙ powerMap κ (eval n)).IsEquivalence := by + rw [singleProject_eval] + infer_instance + exact Functor.isEquivalence_of_comp_right _ (powerMap κ (eval n)) +noncomputable def doubleProject (m n:ℕ) : + Diagram (Diagram (κ→C) (Fin (n+1))) (Fin (m+1)) ⥤ + (κ→Diagram (Diagram C (Fin (n+1))) (Fin (m+1))) := + Functor.pi' (fun k => map (I:=Fin (m+1)) (map (I:=Fin (n+1)) (project κ k))) +lemma doubleProject_eval (m n:ℕ) : + doubleProject (C:=C) κ m n ⋙ powerMap κ (eval₂ m n) = eval₂ m n ⋙ swap (Fin m × Fin n) κ := rfl +noncomputable instance (m n:ℕ) : (doubleProject (C:=C) κ m n).IsEquivalence := by + have : (doubleProject (C:=C) κ m n ⋙ powerMap κ (eval₂ m n)).IsEquivalence := by + rw [doubleProject_eval] + infer_instance + exact Functor.isEquivalence_of_comp_right _ (powerMap κ (eval₂ m n)) +noncomputable def singlePowerComparison : bar (C:=κ→C) ⟶ (power κ).obj (bar (C:=C)) := + lift κ (fun k => barMap (project κ k)) +noncomputable def doublePowerComparison : bar₂ (C:=κ→C) ⟶ (power κ).obj (bar₂ (C:=C)) := + lift κ (fun k => bar₂Map (project κ k)) +lemma singleDegree_homology_isIso (p q:ℕ) : + IsIso (SSet.homologyMap (lift κ (fun k=>nerveMap (map (I:=Fin (p+1)) (project (C:=C) κ k)))) DiagonalResolution.Z q) := by + have : (Functor.pi' (fun k=>map (I:=Fin (p+1)) (project (C:=C) κ k))).IsEquivalence := + inferInstanceAs (singleProject (C:=C) κ p).IsEquivalence + exact lift_nerve_homology_isIso κ (fun k=>map (I:=Fin (p+1)) (project (C:=C) κ k)) q +lemma singleRow_homology_isIso (p:SimplexCategoryᵒᵖ) (q:ℕ) : + IsIso (SSet.homologyMap (lift κ (fun k => + (Functor.whiskerRight (simplicialMap (project (C:=C) κ k)) nerveFunctor).app p)) DiagonalResolution.Z q) := by + exact singleDegree_homology_isIso κ p.unop.len q +lemma single_power_diagonal_eq : singlePowerComparison (C:=C) κ = + lift κ (fun k => diagonal.map (Functor.whiskerRight (simplicialMap (project (C:=C) κ k)) nerveFunctor)) := rfl +lemma singlePowerComparison_homology_isIso (n:ℕ) : + IsIso (SSet.homologyMap (singlePowerComparison (C:=C) κ) DiagonalResolution.Z n) := by + rw [single_power_diagonal_eq] + apply homologyLiftDiagonal_isIso + intro p q + exact singleRow_homology_isIso (C:=C) κ p q +lemma doubleDegree_homology_isIso (l p r:ℕ) : + IsIso (SSet.homologyMap (lift κ (fun k=>nerveMap (map (I:=Fin (l+1)) + (map (I:=Fin (p+1)) (project (C:=C) κ k))))) DiagonalResolution.Z r) := by + have : (Functor.pi' (fun k=>map (I:=Fin (l+1)) + (map (I:=Fin (p+1)) (project (C:=C) κ k)))).IsEquivalence := + inferInstanceAs (doubleProject (C:=C) κ l p).IsEquivalence + exact lift_nerve_homology_isIso κ (fun k=>map (I:=Fin (l+1)) + (map (I:=Fin (p+1)) (project (C:=C) κ k))) r +lemma doubleFirst_homology_isIso (p q:ℕ) : + IsIso (SSet.homologyMap (lift κ (fun k=>barMap (map (I:=Fin (p+1)) (project (C:=C) κ k)))) DiagonalResolution.Z q) := by + apply homologyLiftDiagonal_isIso κ (fun k => Functor.whiskerRight + (simplicialMap (map (I:=Fin (p+1)) (project (C:=C) κ k))) nerveFunctor) + intro l r + exact doubleDegree_homology_isIso κ l.unop.len p r +lemma doublePowerComparison_homology_isIso (n:ℕ) : + IsIso (SSet.homologyMap (doublePowerComparison (C:=C) κ) DiagonalResolution.Z n) := by + apply homologyLiftDiagonal_isIso κ (fun k => rows₂Map (project (C:=C) κ k)) + intro p q + exact doubleFirst_homology_isIso κ p.unop.len q +end BarFinitePower + +end + +open _root_.CategoryTheory _root_.OAI.CategoryTheory MonoidalCategory Simplicial Opposite +namespace IntervalBar.Diagram + +variable {C:Type} [Groupoid.{0} C] [MonoidalCategory C] [SymmetricCategory C] +def outerOrder (i:Fin 2) : Fin 2 →o Fin 3 := + if i=0 then (SimplexCategory.δ (0:Fin 3)).toOrderHom else (SimplexCategory.δ (2:Fin 3)).toOrderHom +noncomputable def outerFunctor : Diagram C (Fin 3) ⥤ (Fin 2 → Diagram C (Fin 2)) := + Functor.pi' (fun i => reindex (outerOrder i)) +noncomputable instance : (outerFunctor (C:=C)).Braided := + inferInstanceAs ((Functor.pi' (fun i : Fin 2 => reindex (C:=C) (outerOrder i))).Braided) +noncomputable instance : (outerFunctor (C:=C)).Faithful where + map_injective {X Y} f g h := by + apply (eval (C:=C) 2).map_injective + funext i + fin_cases i + · exact congrArg (fun h => ((eval (C:=C) 1).map (h (1:Fin 2))) 0) h + · exact congrArg (fun h => ((eval (C:=C) 1).map (h (0:Fin 2))) 0) h +noncomputable instance : (outerFunctor (C:=C)).Full where + map_surjective {X Y} f := by + let g : (eval 2).obj X ⟶ (eval 2).obj Y := fun i => + if h:i=0 then by subst i; exact ((eval 1).map (f 1)) 0 + else by + have hi:i=1 := by omega + subst i + exact ((eval 1).map (f 0)) 0 + refine ⟨(eval 2).preimage g,?_⟩ + funext i + apply (eval (C:=C) 1).map_injective + funext j + have hj:j=0 := Subsingleton.elim _ _ + subst j + fin_cases i + · change ((eval 2).map ((eval 2).preimage g)) 1 = ((eval 1).map (f 0)) 0 + rw [Functor.map_preimage] + simp only [g,dite_eq_right (show (1:Fin 2)≠0 by decide)] + rfl + · have h := congrArg (fun h=>h (0:Fin 2)) ((eval 2).map_preimage g) + exact h +noncomputable instance : (outerFunctor (C:=C)).EssSurj where + mem_essImage Y := by + let U : Fin 2 → C := fun i => if i=0 then ((eval 1).obj (Y 1)) 0 else ((eval 1).obj (Y 0)) 0 + let X := (eval (C:=C) 2).objPreimage U + let e := (eval (C:=C) 2).objObjPreimageIso U + refine ⟨X,⟨?_⟩⟩ + refine { hom := fun i=> ?_,inv := fun i=>?_,hom_inv_id := ?_,inv_hom_id := ?_ } + · apply (eval 1).preimage + intro j + have hj:j=0 := Subsingleton.elim _ _ + subst j + cases i using Fin.cases with + | zero => exact e.hom 1 + | succ i => + have hi:i=0 := Subsingleton.elim _ _ + subst i + exact e.hom 0 + · apply (eval 1).preimage + intro j + have hj:j=0 := Subsingleton.elim _ _ + subst j + cases i using Fin.cases with + | zero => exact e.inv 1 + | succ i => + have hi:i=0 := Subsingleton.elim _ _ + subst i + exact e.inv 0 + · funext i + apply (eval (C:=C) 1).map_injective + change (eval 1).map (_ ≫ _) = (eval 1).map (𝟙 _) + simp only [Functor.map_comp,Functor.map_preimage] + funext j + have hj:j=0 := Subsingleton.elim _ _ + subst j + fin_cases i + · change e.hom 1 ≫ e.inv 1 = 𝟙 _ + exact congrArg (fun f=>f (1:Fin 2)) e.hom_inv_id + · change e.hom 0 ≫ e.inv 0 = 𝟙 _ + exact congrArg (fun f=>f (0:Fin 2)) e.hom_inv_id + · funext i + apply (eval (C:=C) 1).map_injective + change (eval 1).map (_ ≫ _) = (eval 1).map (𝟙 _) + simp only [Functor.map_comp,Functor.map_preimage] + funext j + have hj:j=0 := Subsingleton.elim _ _ + subst j + fin_cases i + · change e.inv 1 ≫ e.hom 1 = 𝟙 _ + exact congrArg (fun f=>f (1:Fin 2)) e.inv_hom_id + · change e.inv 0 ≫ e.hom 0 = 𝟙 _ + exact congrArg (fun f=>f (0:Fin 2)) e.inv_hom_id +noncomputable instance : (outerFunctor (C:=C)).IsEquivalence where +end IntervalBar.Diagram + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/FinitePowerLow.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/FinitePowerLow.lean new file mode 100644 index 0000000000000000000000000000000000000000..977ca4a9a284e7d183f8ea78f7948ac81487cf41 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/FinitePowerLow.lean @@ -0,0 +1,169 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.StageCoordinateMaps + +namespace OAI + +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits MonoidalCategory Simplicial Opposite +namespace BarFinitePower +section +open FreeChains + +def LowFinite (X:SSet) : Prop := + (∀j:ℕ,j≤5 → Module.Finite ℤ (X.homology Z j : A)) ∧ + (∀j:ℕ,0 exact of_iso (finZeroIso X) one + | succ s ih => exact of_iso (finSuccIso X s) (tensor hX ih) +lemma power [X.IsConnected] (hX:LowFinite X) (κ:Type) [Finite κ] : LowFinite ((BarFinitePower.power κ).obj X) := by + let := Fintype.ofFinite κ + exact of_iso (reindexIso X (Fintype.equivFin κ)) (fin hX _) +end LowFinite +end + +section +open FreeChains + +attribute [local instance 1200] Pi.module Prod.instModule +variable (κ:Type) (X:SSet) (j:ℕ) +noncomputable def coordinates : ((power κ).obj X).homology Z j ⟶ ModuleCat.of ℤ (κ → (X.homology Z j : A)) := + ModuleCat.ofHom (LinearMap.pi (fun k => (SSet.homologyMap (evaluate κ X k) Z j).hom)) +@[reassoc (attr := simp)] lemma coordinates_evaluate (k:κ) : + coordinates κ X j ≫ ModuleCat.ofHom (LinearMap.proj k) = SSet.homologyMap (evaluate κ X k) Z j := rfl +lemma modulePi_hom_ext {κ:Type} {M B:A} {f g:B ⟶ ModuleCat.of ℤ (κ → M)} + (h:∀i,f ≫ ModuleCat.ofHom (LinearMap.proj i)=g ≫ ModuleCat.ofHom (LinearMap.proj i)) : f=g := by + apply ModuleCat.hom_ext; apply LinearMap.ext; intro x; funext i + exact congrArg (fun f => f x) (h i) +variable (M:A) +noncomputable def vectorSplit (s:ℕ) : (Fin (s+1) → M) ≃ₗ[ℤ] M × (Fin s → M) where + toFun x := (x 0,fun i => x i.succ) + invFun x := Fin.cases x.1 x.2 + left_inv x := by funext i; cases i using Fin.cases <;> rfl + right_inv x := rfl + map_add' _ _ := rfl + map_smul' _ _ := rfl +noncomputable def coordinateSplit (s:ℕ) : ModuleCat.of ℤ (Fin (s+1) → M) ≅ M ⊞ ModuleCat.of ℤ (Fin s → M) := + (vectorSplit M s).toModuleIso ≪≫ (ModuleCat.biprodIsoProd M (ModuleCat.of ℤ (Fin s → M))).symm +@[reassoc (attr := simp)] lemma coordinateSplit_fst (s:ℕ) : + (coordinateSplit M s).hom ≫ biprod.fst = ModuleCat.ofHom (LinearMap.proj (0:Fin (s+1))) := by + simp only [coordinateSplit,Iso.trans_hom,Iso.symm_hom,Category.assoc,ModuleCat.biprodIsoProd_inv_comp_fst] + rfl +@[reassoc (attr := simp)] lemma coordinateSplit_snd_proj (s:ℕ) (i:Fin s) : + (coordinateSplit M s).hom ≫ biprod.snd ≫ ModuleCat.ofHom (LinearMap.proj i) = + ModuleCat.ofHom (LinearMap.proj i.succ) := by + simp only [coordinateSplit,Iso.trans_hom,Iso.symm_hom,Category.assoc] + have h := congrArg (fun f => f ≫ (ModuleCat.ofHom (LinearMap.proj i) : ModuleCat.of ℤ (Fin s→M) ⟶ M)) + (ModuleCat.biprodIsoProd_inv_comp_snd M (ModuleCat.of ℤ (Fin s→M))) + simp only [Category.assoc] at h + rw [h] + rfl +lemma coordinates_fin_succ (s:ℕ) : + coordinates (Fin (s+1)) X j ≫ (coordinateSplit (X.homology Z j) s).hom = + SSet.homologyMap (finSuccIso X s).hom Z j ≫ + ConnectedProduct.projection X ((power (Fin s)).obj X) j ≫ + biprod.map (𝟙 _) (coordinates (Fin s) X j) := by + apply biprod.hom_ext + · simp only [Category.assoc,coordinateSplit_fst,coordinates_evaluate,biprod.map_fst, + Category.comp_id,ConnectedProduct.projection,biprod.lift_fst,←SSet.homologyMap_comp] + rfl + · apply modulePi_hom_ext + intro i + simp only [Category.assoc,coordinateSplit_snd_proj,coordinates_evaluate, + biprod.map_snd_assoc,ConnectedProduct.projection,biprod.lift_snd_assoc,←SSet.homologyMap_comp] + rfl +end +open FreeChains + +attribute [local instance 1200] Pi.module Prod.instModule +variable (X:SSet) [X.IsConnected] (hX:LowFinite X) +include hX in +lemma coordinates_fin_isIso (s j:ℕ) (hj:0 + have hz : IsZero (((power (Fin 0)).obj X).homology Z j) := + IsZero.of_iso (ConnectedProduct.one_homology_zero j (by omega)) + ((SSet.homologyFunctor Z j).mapIso (finZeroIso X)) + exact hz.isIso (ModuleCat.isZero_iff_subsingleton.mpr inferInstance) _ + | succ s ih => + have := ih + have := LowFinite.projection_isIso hX (hX.fin s) j hj hj5 + have : IsIso (biprod.map (𝟙 (X.homology Z j)) (coordinates (Fin s) X j)) := by + change IsIso (biprod.mapIso (Iso.refl _) (asIso (coordinates (Fin s) X j))).hom + infer_instance + have : IsIso (coordinates (Fin (s+1)) X j ≫ (coordinateSplit (X.homology Z j) s).hom) := by + rw [coordinates_fin_succ] + infer_instance + exact (isIso_comp_right_iff _ (coordinateSplit (X.homology Z j) s).hom).mp inferInstance +noncomputable def coefficientReindex {κ ι:Type} (e:κ≃ι) (M:A) : + ModuleCat.of ℤ (κ→M) ≅ ModuleCat.of ℤ (ι→M) := + (show (κ→M) ≃ₗ[ℤ] (ι→M) from { + toFun f i := f (e.symm i) + invFun f k := f (e k) + left_inv f := by funext k; exact congrArg f (e.symm_apply_apply k) + right_inv f := by funext i; exact congrArg f (e.apply_symm_apply i) + map_add' _ _ := rfl + map_smul' _ _ := rfl }).toModuleIso +omit [X.IsConnected] in +lemma coordinates_reindex {κ ι:Type} (e:κ≃ι) (j:ℕ) : + coordinates κ X j ≫ (coefficientReindex e (X.homology Z j)).hom = + SSet.homologyMap (reindexIso X e).hom Z j ≫ coordinates ι X j := by + apply modulePi_hom_ext; intro i + have he : (coefficientReindex e (X.homology Z j)).hom ≫ ModuleCat.ofHom (LinearMap.proj i)= + ModuleCat.ofHom (LinearMap.proj (e.symm i)) := rfl + rw [Category.assoc,he,coordinates_evaluate,Category.assoc,coordinates_evaluate,←SSet.homologyMap_comp] + rfl +include hX in + +lemma coordinates_isIso (κ:Type) [Finite κ] (j:ℕ) (hj:0 Fin U.size → Fin V.size) := + ⟨fun f => toEquiv f⟩ +lemma hom_ext {U V : FiniteSetGroupoid} (f g : U ⟶ V) (h : ∀x,f x=g x) : f=g := Equiv.ext h +abbrev sum (U V : FiniteSetGroupoid) : FiniteSetGroupoid := ⟨U.size+V.size⟩ +abbrev empty : FiniteSetGroupoid := ⟨0⟩ +def sumEquiv (U V : FiniteSetGroupoid) : Fin U.size ⊕ Fin V.size ≃ Fin (sum U V).size := + finSumFinEquiv + +def sumHom {U V W Z : FiniteSetGroupoid} (f : U ⟶ W) (g : V ⟶ Z) : sum U V ⟶ sum W Z := + (sumEquiv U V).symm.trans ((Equiv.sumCongr f g).trans (sumEquiv W Z)) +def assoc (U V W : FiniteSetGroupoid) : sum (sum U V) W ⟶ sum U (sum V W) := + (sumEquiv (sum U V) W).symm.trans + ((Equiv.sumCongr (sumEquiv U V).symm (Equiv.refl _)).trans + ((Equiv.sumAssoc _ _ _).trans + ((Equiv.sumCongr (Equiv.refl _) (sumEquiv V W)).trans (sumEquiv U (sum V W))))) +def swap (U V : FiniteSetGroupoid) : sum U V ⟶ sum V U := + (sumEquiv U V).symm.trans ((Equiv.sumComm _ _).trans (sumEquiv V U)) +def left (U : FiniteSetGroupoid) : sum empty U ⟶ U := + (sumEquiv empty U).symm.trans (Equiv.emptySum _ _) +def right (U : FiniteSetGroupoid) : sum U empty ⟶ U := + (sumEquiv U empty).symm.trans (Equiv.sumEmpty _ _) +@[simp] lemma comp_eq {U V W : FiniteSetGroupoid} (f : U ⟶ V) (g : V ⟶ W) : + (f≫g : U ⟶ W) = (toEquiv f).trans (toEquiv g) := rfl +@[simp] lemma id_eq (U : FiniteSetGroupoid) : (𝟙 U : U ⟶ U) = Equiv.refl _ := rfl +@[simp] lemma comp_apply {U V W : FiniteSetGroupoid} (f : U ⟶ V) (g : V ⟶ W) (x : Fin U.size) : + (f≫g) x=g (f x) := rfl +@[simp] lemma id_apply (U : FiniteSetGroupoid) (x : Fin U.size) : (𝟙 U : U ⟶ U) x=x := rfl +@[simp] lemma sumHom_inl {U V W Z : FiniteSetGroupoid} (f : U ⟶ W) (g : V ⟶ Z) (x : Fin U.size) : + sumHom f g (sumEquiv U V (.inl x))=sumEquiv W Z (.inl (f x)) := by simp [sumHom] +@[simp] lemma sumHom_inr {U V W Z : FiniteSetGroupoid} (f : U ⟶ W) (g : V ⟶ Z) (x : Fin V.size) : + sumHom f g (sumEquiv U V (.inr x))=sumEquiv W Z (.inr (g x)) := by simp [sumHom] +@[simp] lemma assoc_left (U V W : FiniteSetGroupoid) (x : Fin U.size) : + assoc U V W (sumEquiv (sum U V) W (.inl (sumEquiv U V (.inl x))))= + sumEquiv U (sum V W) (.inl x) := by simp [assoc] +@[simp] lemma assoc_mid (U V W : FiniteSetGroupoid) (x : Fin V.size) : + assoc U V W (sumEquiv (sum U V) W (.inl (sumEquiv U V (.inr x))))= + sumEquiv U (sum V W) (.inr (sumEquiv V W (.inl x))) := by simp [assoc] +@[simp] lemma assoc_right (U V W : FiniteSetGroupoid) (x : Fin W.size) : + assoc U V W (sumEquiv (sum U V) W (.inr x))= + sumEquiv U (sum V W) (.inr (sumEquiv V W (.inr x))) := by simp [assoc] +@[simp] lemma swap_left (U V : FiniteSetGroupoid) (x : Fin U.size) : + swap U V (sumEquiv U V (.inl x))=sumEquiv V U (.inr x) := by simp [swap] +@[simp] lemma swap_right (U V : FiniteSetGroupoid) (x : Fin V.size) : + swap U V (sumEquiv U V (.inr x))=sumEquiv V U (.inl x) := by simp [swap] +@[simp] lemma left_apply (U : FiniteSetGroupoid) (x : Fin U.size) : + left U (sumEquiv empty U (.inr x))=x := by simp [left] +@[simp] lemma right_apply (U : FiniteSetGroupoid) (x : Fin U.size) : + right U (sumEquiv U empty (.inl x))=x := by simp [right] +lemma sumHom_id (U V : FiniteSetGroupoid) : sumHom (𝟙 U) (𝟙 V)=𝟙 (sum U V) := by + apply hom_ext; intro x + obtain ⟨x,rfl⟩ := (sumEquiv U V).surjective x + cases x <;> simp [toEquiv,sumHom] +lemma sumHom_comp {U V W X Y Z : FiniteSetGroupoid} (f : U ⟶ V) (f' : V ⟶ W) + (g : X ⟶ Y) (g' : Y ⟶ Z) : sumHom (f≫f') (g≫g')=sumHom f g ≫ sumHom f' g' := by + apply hom_ext; intro x + obtain ⟨x,rfl⟩ := (sumEquiv U X).surjective x + cases x <;> simp [toEquiv,sumHom] + +noncomputable abbrev monoidalStruct : MonoidalCategoryStruct FiniteSetGroupoid where + tensorObj := sum + tensorHom := sumHom + whiskerLeft U _ _ f := sumHom (𝟙 U) f + whiskerRight f U := sumHom f (𝟙 U) + tensorUnit := empty + associator U V W := asIso (assoc U V W) + leftUnitor U := asIso (left U) + rightUnitor U := asIso (right U) + +attribute [instance] monoidalStruct + +noncomputable instance monoidal : MonoidalCategory FiniteSetGroupoid := + MonoidalCategory.ofTensorHom + (id_tensorHom_id := sumHom_id) + (id_tensorHom := by intros; rfl) + (tensorHom_id := by intros; rfl) + (tensorHom_comp_tensorHom := fun f g f' g' => (sumHom_comp f f' g g').symm) + (associator_naturality := by + intro U V W U' V' W' f g h + change sumHom (sumHom f g) h ≫ assoc U' V' W' = assoc U V W ≫ sumHom f (sumHom g h) + apply hom_ext;intro x + obtain ⟨y,rfl⟩ := (sumEquiv (sum U V) W).surjective x + cases y with + | inl y => + obtain ⟨z,rfl⟩ := (sumEquiv U V).surjective y + cases z <;> simp [toEquiv,sumHom,assoc] + | inr y => simp [toEquiv,sumHom,assoc]) + (leftUnitor_naturality := by + intro U V f + change sumHom (𝟙 empty) f ≫ left V = left U ≫ f + apply hom_ext;intro x + obtain ⟨y,rfl⟩ := (sumEquiv empty U).surjective x + cases y with + | inl y => exact isEmptyElim y + | inr y => simp [toEquiv,sumHom,left]) + (rightUnitor_naturality := by + intro U V f + change sumHom f (𝟙 empty) ≫ right V = right U ≫ f + apply hom_ext;intro x + obtain ⟨y,rfl⟩ := (sumEquiv U empty).surjective x + cases y with + | inl y => simp [toEquiv,sumHom,right] + | inr y => exact isEmptyElim y) + (pentagon := by + intro U V W Z + change sumHom (assoc U V W) (𝟙 Z) ≫ assoc U (sum V W) Z ≫ sumHom (𝟙 U) (assoc V W Z) = + assoc (sum U V) W Z ≫ assoc U V (sum W Z) + apply hom_ext;intro x + obtain ⟨y,rfl⟩ := (sumEquiv (sum (sum U V) W) Z).surjective x + cases y with + | inl y => + obtain ⟨z,rfl⟩ := (sumEquiv (sum U V) W).surjective y + cases z with + | inl z => + obtain ⟨t,rfl⟩ := (sumEquiv U V).surjective z + cases t <;> simp [toEquiv,sumHom,assoc] + | inr z => simp [toEquiv,sumHom,assoc] + | inr y => simp [toEquiv,sumHom,assoc]) + (triangle := by + intro U V + change assoc U empty V ≫ sumHom (𝟙 U) (left V) = sumHom (right U) (𝟙 V) + apply hom_ext;intro x + obtain ⟨y,rfl⟩ := (sumEquiv (sum U empty) V).surjective x + cases y with + | inl y => + obtain ⟨z,rfl⟩ := (sumEquiv U empty).surjective y + cases z with + | inl z => simp [toEquiv,sumHom,assoc,left,right] + | inr z => exact isEmptyElim z + | inr y => simp [toEquiv,sumHom,assoc,left,right]) + +@[simp] theorem assoc_symm_left (U V W : FiniteSetGroupoid) (x : Fin U.size) : + (toEquiv (assoc U V W)).symm (sumEquiv U (sum V W) (.inl x))= + sumEquiv (sum U V) W (.inl (sumEquiv U V (.inl x))) := + (Equiv.symm_apply_eq _).mpr (assoc_left U V W x).symm +@[simp] theorem assoc_symm_mid (U V W : FiniteSetGroupoid) (x : Fin V.size) : + (toEquiv (assoc U V W)).symm (sumEquiv U (sum V W) (.inr (sumEquiv V W (.inl x))))= + sumEquiv (sum U V) W (.inl (sumEquiv U V (.inr x))) := + (Equiv.symm_apply_eq _).mpr (assoc_mid U V W x).symm +@[simp] theorem assoc_symm_right (U V W : FiniteSetGroupoid) (x : Fin W.size) : + (toEquiv (assoc U V W)).symm (sumEquiv U (sum V W) (.inr (sumEquiv V W (.inr x))))= + sumEquiv (sum U V) W (.inr x) := + (Equiv.symm_apply_eq _).mpr (assoc_right U V W x).symm + +@[simp] theorem associator_inv_apply (U V W : FiniteSetGroupoid) (x : Fin (sum U (sum V W)).size) : + (monoidalStruct.associator U V W).inv x=(toEquiv (assoc U V W)).symm x := by + change (CategoryTheory.inv (assoc U V W)) x=_ + rw [← Groupoid.inv_eq_inv] + rfl + +@[simp] theorem inv_arrow_apply {U V : FiniteSetGroupoid} (f : U ⟶ V) (x : Fin V.size) : + (CategoryTheory.inv f) x = (toEquiv f).symm x := by + rw [← Groupoid.inv_eq_inv] + rfl + +@[simp] lemma inv_eq {U V : FiniteSetGroupoid} (f : U ⟶ V) : + (CategoryTheory.inv f : V ⟶ U) = (toEquiv f).symm := by + rw [← Groupoid.inv_eq_inv] + rfl + +noncomputable instance braided : BraidedCategory FiniteSetGroupoid where + braiding U V := asIso (swap U V) + braiding_naturality_right := by + intro U V W f + change sumHom (𝟙 U) f ≫ swap U W = swap U V ≫ sumHom f (𝟙 U) + apply hom_ext;intro x + obtain ⟨y,rfl⟩ := (sumEquiv U V).surjective x + cases y <;> simp [toEquiv,sumHom,swap] + braiding_naturality_left := by + intro U V f W + change sumHom f (𝟙 W) ≫ swap V W = swap U W ≫ sumHom (𝟙 W) f + apply hom_ext;intro x + obtain ⟨y,rfl⟩ := (sumEquiv U W).surjective x + cases y <;> simp [toEquiv,sumHom,swap] + hexagon_forward := by + intro U V W + change assoc U V W ≫ swap U (sum V W) ≫ assoc V W U = + sumHom (swap U V) (𝟙 W) ≫ assoc V U W ≫ sumHom (𝟙 V) (swap U W) + apply hom_ext;intro x + obtain ⟨y,rfl⟩ := (sumEquiv (sum U V) W).surjective x + cases y with + | inl y => + obtain ⟨z,rfl⟩ := (sumEquiv U V).surjective y + cases z <;> simp [toEquiv,sumHom,assoc,swap] + | inr y => simp [toEquiv,sumHom,assoc,swap] + hexagon_reverse := by + intro U V W + change (CategoryTheory.inv (assoc U V W)) ≫ swap (sum U V) W ≫ (CategoryTheory.inv (assoc W U V)) = + sumHom (𝟙 U) (swap V W) ≫ (CategoryTheory.inv (assoc U W V)) ≫ sumHom (swap U W) (𝟙 V) + apply hom_ext;intro x + obtain ⟨y,rfl⟩ := (sumEquiv U (sum V W)).surjective x + cases y with + | inl y => simp [toEquiv,sumHom,assoc,swap] + | inr y => + obtain ⟨z,rfl⟩ := (sumEquiv V W).surjective y + cases z <;> simp [toEquiv,sumHom,assoc,swap] + +noncomputable instance symmetric : SymmetricCategory FiniteSetGroupoid where + symmetry U V := by + change swap U V ≫ swap V U = 𝟙 (sum U V) + apply hom_ext;intro x + obtain ⟨y,rfl⟩ := (sumEquiv U V).surjective x + cases y <;> simp [toEquiv,swap] + +end SimpleAmenable.PolygonObject.FiniteSetGroupoid + +end + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/FirstBarComponentsFinite.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/FirstBarComponentsFinite.lean new file mode 100644 index 0000000000000000000000000000000000000000..5af43eb7362e50897b53f5f20325cc6d7b24f7df --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/FirstBarComponentsFinite.lean @@ -0,0 +1,57 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.AbelianHomologyFinite + +namespace OAI + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits MonoidalCategory HomologicalComplex SimplicialObject Simplicial Opposite AlgebraicTopology +namespace IntervalBar.Diagram +open FreeChains SimplicialDiagonal + +variable {C:Type} [Groupoid.{0} C] [MonoidalCategory C] [SymmetricCategory C] +noncomputable abbrev homologyRow (q:ℕ) : ChainComplex A ℕ := + AlternatingFaceMapComplex.obj (simplicial (C:=C) ⋙ nerveFunctor ⋙ SSet.homologyFunctor Z q) +omit [SymmetricCategory C] in +lemma first_row_finite (q:ℕ) + [Module.Finite ℤ ((bar (C:=C)).homology Z (1+q) : A)] + (hf:∀p r,p+r=q+2 → 3≤p → Module.Finite ℤ ((homologyRow (C:=C) r).homology p)) : + Module.Finite ℤ ((homologyRow (C:=C) q).homology 1) := by + let X := simplicial (C:=C) ⋙ nerveFunctor + let K := EilenbergZilber.twoComplex (uncurry X) + have : Module.Finite ℤ ((K.total c).homology (1+q)) := by + let e : ((bar (C:=C)).homology Z (1+q) : A) ≅ (K.total c).homology (1+q) := + EilenbergZilber.homologyIsoN (uncurry X) (1+q) + exact Module.Finite.equiv e.toLinearEquiv + have : Module.Finite ℤ ((TotalFiniteness.row K q).homology 1) := by + apply TotalFiniteness.finite_first K q + intro p r hpr hp + have : Module.Finite ℤ ((AlternatingFaceMapComplex.obj (X ⋙ SSet.homologyFunctor DiagonalResolution.Z r)).homology p) := hf p r hpr hp + exact Module.Finite.equiv (homologyRowHomologyIso X p r).symm.toLinearEquiv + exact Module.Finite.equiv (homologyRowHomologyIso X 1 q).toLinearEquiv +lemma component_homology_finite (n:ℕ) + [Module.Finite ℤ ((bar (C:=C)).homology Z 1 : A)] : + Module.Finite ℤ ((nerve (SingleObj (Skeleton C))).homology Z n : A) := by + have : Module.Finite ℤ ((homologyRow (C:=C) 0).homology 1) := + first_row_finite 0 (by intro p r hpr hp; omega) + have : Module.Finite ℤ ((nerve (SingleObj (Skeleton C))).homology Z 1 : A) := by + let e : (homologyRow (C:=C) 0).homology 1 ≅ (nerve (SingleObj (Skeleton C))).homology Z 1 := + (homologyFunctor A c 1).mapIso (componentRowChainIso (C:=C) ≪≫ (complexIso _).symm) + exact Module.Finite.equiv e.toLinearEquiv + exact TranslationNerve.homology_finite_of_one _ n +lemma first_row_one_finite + [Module.Finite ℤ ((bar (C:=C)).homology Z 1 : A)] + [Module.Finite ℤ ((bar (C:=C)).homology Z 2 : A)] : + Module.Finite ℤ ((homologyRow (C:=C) 1).homology 1) := by + apply first_row_finite 1 + intro p r hpr hp + have hr:r=0:=by omega + subst r + have:=component_homology_finite (C:=C) p + let e : ((nerve (SingleObj (Skeleton C))).homology Z p : A) ≅ (homologyRow (C:=C) 0).homology p := + (homologyFunctor A c p).mapIso ((complexIso _) ≪≫ (componentRowChainIso (C:=C)).symm) + exact Module.Finite.equiv e.toLinearEquiv +end IntervalBar.Diagram + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/FirstBarDegreeTwoFinite.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/FirstBarDegreeTwoFinite.lean new file mode 100644 index 0000000000000000000000000000000000000000..c6da5ae6e9d4f06bf9b446d79c2327539610e6b4 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/FirstBarDegreeTwoFinite.lean @@ -0,0 +1,191 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.FirstBarStableH1 +import OAI.GroupTheory.SimpleAmenable.Homology.MarkedLowHomology + +namespace OAI + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits MonoidalCategory HomologicalComplex +namespace IntervalBar.Diagram +open FreeChains ComponentTranslation MarkedH1 + +variable {C:Type} [Groupoid.{0} C] [MonoidalCategory C] [SymmetricCategory C] +lemma row_one_three_finite + [Module.Finite ℤ ((bar (C:=C)).homology Z 1:A)] + [Module.Finite ℤ ((bar (C:=C)).homology Z 2:A)] : + Module.Finite ℤ ((homologyRow (C:=C) 1).homology 3) := by + have :=stableH1_finite (C:=C) + have : Module.Finite ℤ (colimit (homologyDiagram (C:=C) 1):A) := inferInstanceAs + (Module.Finite ℤ (ComponentStable.object (C:=C) 1:A)) + have :=RegularCoefficient.total_finite (homologyDiagram (C:=C) 1) 2 (by + intro i hi + have :=component_homology_finite (C:=C) i + exact Module.Finite.equiv (CommMonoidOpposite.homologyIso (Skeleton C) i).symm.toLinearEquiv) + exact Module.Finite.equiv (lowHomologyIso (C:=C)).toLinearEquiv +lemma first_row_two_finite + [Module.Finite ℤ ((bar (C:=C)).homology Z 1:A)] + [Module.Finite ℤ ((bar (C:=C)).homology Z 2:A)] + [Module.Finite ℤ ((bar (C:=C)).homology Z 3:A)] : + Module.Finite ℤ ((homologyRow (C:=C) 2).homology 1) := by + apply first_row_finite 2 + intro p r hpr hp + have hr:r≤1:=by omega + interval_cases r + · have :=component_homology_finite (C:=C) p + let e : ((nerve (SingleObj (Skeleton C))).homology Z p:A) ≅ (homologyRow (C:=C) 0).homology p := + (homologyFunctor A c p).mapIso ((complexIso _) ≪≫ (componentRowChainIso (C:=C)).symm) + exact Module.Finite.equiv e.toLinearEquiv + · have h:p=3:=by omega + subst p + exact row_one_three_finite (C:=C) +end IntervalBar.Diagram + +end + +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits MonoidalCategory Simplicial Opposite +namespace StableBarOne +open FreeChains ComponentTranslation IntervalBar.Diagram MarkedH1 + +variable {C:Type} [Groupoid.{0} C] [MonoidalCategory C] +noncomputable def insert {n:ℕ} (p:Fin n→Skeleton C) (i:Fin n) (q:ℕ) : + (nerve (Fiber (p i))).homology Z q ⟶ (homologyRow (C:=C) q).X n := + SSet.homologyMap (nerveMap (wordDiagram p i)) Z q +@[reassoc] lemma binary_insert_face (p:Fin 2→Skeleton C) (i:Fin 2) (k:Fin 3) (q:ℕ) : + insert p i q ≫ SSet.homologyMap (nerveMap (reindex (SimplexCategory.δ k).toOrderHom)) Z q ≫ + SSet.homologyMap (nerveMap oneEval) Z q = + SSet.homologyMap (nerveMap (wordInclude p i ⋙ binaryFace k)) Z q := by + change SSet.homologyMap (nerveMap (wordDiagram p i)) Z q ≫ + SSet.homologyMap (nerveMap (reindex (SimplexCategory.δ k).toOrderHom)) Z q ≫ + SSet.homologyMap (nerveMap oneEval) Z q = + SSet.homologyMap (nerveMap (wordDiagram p i) ≫ + nerveMap (reindex (SimplexCategory.δ k).toOrderHom) ≫ nerveMap oneEval) Z q + simp only [SSet.homologyMap_comp] +@[reassoc] lemma binary_insert_zero (p:Fin 2→Skeleton C) (q:ℕ) : + insert p 1 q ≫ SSet.homologyMap (nerveMap (reindex (SimplexCategory.δ (0:Fin 3)).toOrderHom)) Z q ≫ + SSet.homologyMap (nerveMap oneEval) Z q=ComponentStable.inclusion (p 1) q := by + rw [binary_insert_face] + have h:=(NerveHomotopy.ofNatTrans (Functor.isoWhiskerLeft (wordInclude p 1) (binaryFaceZero (C:=C))).hom).congr_homologyMap Z q + rw [h] + rw [wordInclude_proj,ite_eq_left rfl] + rfl +@[reassoc] lemma binary_insert_last (p:Fin 2→Skeleton C) (q:ℕ) : + insert p 0 q ≫ SSet.homologyMap (nerveMap (reindex (SimplexCategory.δ (2:Fin 3)).toOrderHom)) Z q ≫ + SSet.homologyMap (nerveMap oneEval) Z q=ComponentStable.inclusion (p 0) q := by + rw [binary_insert_face] + have h:=(NerveHomotopy.ofNatTrans (Functor.isoWhiskerLeft (wordInclude p 0) (binaryFaceLast (C:=C))).hom).congr_homologyMap Z q + rw [h] + rw [wordInclude_proj,ite_eq_left rfl] + rfl +@[reassoc] lemma binary_insert_zero_other (p:Fin 2→Skeleton C) (q:ℕ) (hq:q≠0) : + insert p 0 q ≫ SSet.homologyMap (nerveMap (reindex (SimplexCategory.δ (0:Fin 3)).toOrderHom)) Z q ≫ + SSet.homologyMap (nerveMap oneEval) Z q=0 := by + rw [binary_insert_face] + have h:=(NerveHomotopy.ofNatTrans (Functor.isoWhiskerLeft (wordInclude p 0) (binaryFaceZero (C:=C))).hom).congr_homologyMap Z q + rw [h,wordInclude_proj,ite_eq_right (by decide)] + have hc : nerveMap ((Functor.const (Fiber (p 0))).obj (repr (p 1))) = + SSet.const (nerveEquiv.symm (repr (p 1))) := by ext n x; rfl + rw [hc] + exact ConnectedProduct.const_homology_zero _ q hq +@[reassoc] lemma binary_insert_last_other (p:Fin 2→Skeleton C) (q:ℕ) (hq:q≠0) : + insert p 1 q ≫ SSet.homologyMap (nerveMap (reindex (SimplexCategory.δ (2:Fin 3)).toOrderHom)) Z q ≫ + SSet.homologyMap (nerveMap oneEval) Z q=0 := by + rw [binary_insert_face] + have h:=(NerveHomotopy.ofNatTrans (Functor.isoWhiskerLeft (wordInclude p 1) (binaryFaceLast (C:=C))).hom).congr_homologyMap Z q + rw [h,wordInclude_proj,ite_eq_right (by decide)] + have hc : nerveMap ((Functor.const (Fiber (p 1))).obj (repr (p 0))) = + SSet.const (nerveEquiv.symm (repr (p 0))) := by ext n x; rfl + rw [hc] + exact ConnectedProduct.const_homology_zero _ q hq +@[reassoc] lemma binary_insert_middle (p:Fin 2→Skeleton C) (q:ℕ) : + insert p 1 q ≫ SSet.homologyMap (nerveMap (reindex (SimplexCategory.δ (1:Fin 3)).toOrderHom)) Z q ≫ + SSet.homologyMap (nerveMap oneEval) Z q = + SSet.homologyMap (nerveMap (translate (p 0) (p 1) (p 0*p 1) rfl)) Z q ≫ + ComponentStable.inclusion (p 0*p 1) q := by + rw [binary_insert_face] + have h:=(NerveHomotopy.ofNatTrans (Functor.isoWhiskerLeft (wordInclude p 1) (binaryFaceMiddle (C:=C))).hom).congr_homologyMap Z q + rw [h] + have ht:=(NerveHomotopy.ofNatTrans (binaryRightTranslate p).hom).congr_homologyMap Z q + rw [ht] + change SSet.homologyMap (nerveMap (translate (p 0) (p 1) (p 0*p 1) rfl) ≫ + nerveMap (property (p 0*p 1)).ι) Z q = _ + rw [SSet.homologyMap_comp] + rfl +lemma row_d10 (q:ℕ) (hq:q≠0) : (homologyRow (C:=C) q).d 1 0=0 := by + apply IsZero.eq_zero_of_tgt + exact nerve.positive_zero (fun U V:IntervalBar.Diagram C (Fin 1)=>⟨zeroHom C U V⟩) q hq +noncomputable def π (q:ℕ) (hq:q≠0) : (homologyRow (C:=C) q).X 1 ⟶ (homologyRow (C:=C) q).homology 1 := + ChainComplex.positiveπ _ 0 (row_d10 q hq) +@[reassoc (attr:=simp)] lemma d_π (q:ℕ) (hq:q≠0) : (homologyRow (C:=C) q).d 2 1 ≫ π q hq=0 := + ChainComplex.d_positiveπ _ 0 (row_d10 q hq) +noncomputable def oneIso (q:ℕ) : (homologyRow (C:=C) q).X 1 ≅ (nerve C).homology Z q := by + exact @asIso (ModuleCat ℤ) _ _ _ _ + (NerveHomotopy.homologyMap_isIso (oneEval (C:=C)) Z q) +noncomputable def linearπ (q:ℕ) (hq:q≠0) : (nerve C).homology Z q ⟶ (homologyRow (C:=C) q).homology 1 := + (oneIso q).inv ≫ π q hq +instance linearπ_epi (q:ℕ) (hq:q≠0) : Epi (linearπ (C:=C) q hq) := by + dsimp only [linearπ,π] + infer_instance +@[reassoc (attr:=simp)] lemma oneIso_linearπ (q:ℕ) (hq:q≠0) : + SSet.homologyMap (nerveMap (oneEval (C:=C))) Z q ≫ linearπ q hq=π q hq := by + change (oneIso (C:=C) q).hom ≫ (oneIso (C:=C) q).inv ≫ π q hq= _ + simp +private lemma boundary_linearπ (v : Fin 2 → Skeleton C) (q : ℕ) (hq : q ≠ 0) : + insert v 1 q ≫ SSet.homologyMap (nerveMap (reindex (SimplexCategory.δ (0:Fin 3)).toOrderHom)) Z q ≫ + SSet.homologyMap (nerveMap oneEval) Z q ≫ linearπ q hq - + insert v 1 q ≫ SSet.homologyMap (nerveMap (reindex (SimplexCategory.δ (1:Fin 3)).toOrderHom)) Z q ≫ + SSet.homologyMap (nerveMap oneEval) Z q ≫ linearπ q hq + + insert v 1 q ≫ SSet.homologyMap (nerveMap (reindex (SimplexCategory.δ (2:Fin 3)).toOrderHom)) Z q ≫ + SSet.homologyMap (nerveMap oneEval) Z q ≫ linearπ q hq=0 := by + have hd:=congrArg (fun f=>insert v 1 q ≫ f) (d_π (C:=C) q hq) + rw [SimplicialFirstFinite.d21] at hd + simp only [Preadditive.add_comp,Preadditive.sub_comp,Preadditive.comp_add, + Preadditive.comp_sub,comp_zero] at hd + rw [←oneIso_linearπ q hq] at hd + exact hd + +private lemma eq_of_boundary {V : Type*} [AddGroup V] {x y z a b : V} + (h : x - y + z = 0) (hx : x = a) (hy : y = b) (hz : z = 0) : b = a := by + rw [hx,hy,hz,add_zero] at h + exact (sub_eq_zero.mp h).symm + +private lemma binary_linearπ (v : Fin 2 → Skeleton C) (q : ℕ) (hq : q ≠ 0) : + SSet.homologyMap (nerveMap (translate (v 0) (v 1) (v 0 * v 1) rfl)) Z q ≫ + ComponentStable.inclusion (v 0 * v 1) q ≫ linearπ q hq = + ComponentStable.inclusion (v 1) q ≫ linearπ q hq := by + have hd := boundary_linearπ v q hq + have zeroFace := binary_insert_zero_assoc v q (linearπ (C:=C) q hq) + have middleFace := binary_insert_middle_assoc v q (linearπ (C:=C) q hq) + have lastFace := binary_insert_last_other_assoc v q hq (linearπ (C:=C) q hq) + exact eq_of_boundary hd zeroFace middleFace (lastFace.trans zero_comp) + +lemma translate_linearπ (r p s:Skeleton C) (h:r*p=s) (q:ℕ) (hq:q≠0) : + SSet.homologyMap (nerveMap (translate r p s h)) Z q ≫ ComponentStable.inclusion s q ≫ linearπ q hq = + ComponentStable.inclusion p q ≫ linearπ q hq := by + subst s + exact binary_linearπ ![r,p] q hq +noncomputable def cocone (q:ℕ) (hq:q≠0) : Cocone (homologyDiagram (C:=C) q) where + pt := (homologyRow (C:=C) q).homology 1 + ι := {app p:=ComponentStable.inclusion p.back q ≫ linearπ q hq + naturality {p s} f:=by + change SSet.homologyMap (nerveMap (translate f.hom p.back s.back f.map_val)) Z q ≫ + ComponentStable.inclusion s.back q ≫ linearπ q hq = _ + erw [translate_linearπ,Category.comp_id] + rfl} +noncomputable def fromStable (q:ℕ) (hq:q≠0) : ComponentStable.object (C:=C) q ⟶ + (homologyRow (C:=C) q).homology 1 := colimit.desc (homologyDiagram q) (cocone q hq) +@[reassoc (attr:=simp)] lemma toStable_fromStable (q:ℕ) (hq:q≠0) : + ComponentStable.toStable (C:=C) q ≫ fromStable q hq=linearπ q hq := by + apply (ComponentCoproduct.homologyIsColimit C q).hom_ext + intro p + change ComponentStable.inclusion p.as q ≫ (ComponentStable.toStable q ≫ fromStable q hq)=_ + rw [←Category.assoc,ComponentStable.inclusion_toStable] + exact colimit.ι_desc (cocone (C:=C) q hq) ((ActionCategory.objEquiv _ _) p.as) +instance fromStable_epi (q:ℕ) (hq:q≠0) : Epi (fromStable (C:=C) q hq) := by + have : Epi (ComponentStable.toStable (C:=C) q ≫ fromStable q hq):=by rw [toStable_fromStable]; infer_instance + exact epi_of_epi (ComponentStable.toStable q) _ +lemma row_one_finite (q:ℕ) (hq:q≠0) [Module.Finite ℤ (ComponentStable.object (C:=C) q : A)] : + Module.Finite ℤ ((homologyRow (C:=C) q).homology 1) := + Module.Finite.of_surjective (fromStable q hq).hom ((ModuleCat.epi_iff_surjective _).mp inferInstance) +end StableBarOne + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/FirstBarForwardLow.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/FirstBarForwardLow.lean new file mode 100644 index 0000000000000000000000000000000000000000..9068f0e1476c1d9d23e688412e9eb6ab70e91269 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/FirstBarForwardLow.lean @@ -0,0 +1,132 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.FirstBarDegreeTwoFinite + +namespace OAI + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits MonoidalCategory Simplicial Opposite HomologicalComplex +namespace MarkedH1 +open FreeChains ComponentTranslation IntervalBar.Diagram + +variable {C:Type} [Groupoid.{0} C] [MonoidalCategory C] [SymmetricCategory C] +noncomputable def lowOneHomologyIso : + ((RegularCoefficient.double (homologyDiagram (C:=C) 1)).total c).homology 1 ≅ + (homologyRow (C:=C) 1).homology 2 := by + let K := (RegularCoefficient.double (homologyDiagram (C:=C) 1)).total c + let L := homologyRow (C:=C) 1 + let e : K.sc' 2 1 0 ≅ L.sc' 3 2 1 := + ShortComplex.isoMk (gradedIso 2) (gradedIso 1) (gradedIso 0) + (differential2 (C:=C)).symm (differential1 (C:=C)).symm + exact (ShortComplex.homologyFunctor A).mapIso + (K.isoSc' 2 1 0 (c.prev_eq' rfl) (c.next_eq' rfl) ≪≫ e ≪≫ + (L.isoSc' 3 2 1 (c.prev_eq' rfl) (c.next_eq' rfl)).symm) +lemma row_one_two_finite + [Module.Finite ℤ (ComponentStable.object (C:=C) 1:A)] + (hf:∀i,i≤1 → Module.Finite ℤ ((nerve (SingleObj (Skeleton C))).homology Z i:A)) : + Module.Finite ℤ ((homologyRow (C:=C) 1).homology 2) := by + have : Module.Finite ℤ (colimit (homologyDiagram (C:=C) 1):A) := inferInstanceAs + (Module.Finite ℤ (ComponentStable.object (C:=C) 1:A)) + have := RegularCoefficient.total_finite (homologyDiagram (C:=C) 1) 1 (by + intro i hi + have := hf i hi + exact Module.Finite.equiv (CommMonoidOpposite.homologyIso (Skeleton C) i).symm.toLinearEquiv) + exact Module.Finite.equiv (lowOneHomologyIso (C:=C)).toLinearEquiv +end MarkedH1 +namespace IntervalBar.Diagram +open FreeChains ComponentTranslation SimplicialDiagonal + +variable {C:Type} [Groupoid.{0} C] [MonoidalCategory C] [SymmetricCategory C] +lemma bar_low_finite + [Module.Finite ℤ (ComponentStable.object (C:=C) 1:A)] + [Module.Finite ℤ (ComponentStable.object (C:=C) 2:A)] + (hf:∀i,Module.Finite ℤ ((nerve (SingleObj (Skeleton C))).homology Z i:A)) + (n:ℕ) (hn:n≤3) : Module.Finite ℤ ((bar (C:=C)).homology Z n:A) := by + let X:=simplicial (C:=C) ⋙ nerveFunctor + apply EilenbergZilber.finite_diagonal (uncurry X) n + intro p q hpq + have hr : Module.Finite ℤ ((homologyRow (C:=C) q).homology p) := by + by_cases hq:q=0 + · subst q + have := hf p + let e : ((nerve (SingleObj (Skeleton C))).homology Z p:A) ≅ (homologyRow (C:=C) 0).homology p := + (homologyFunctor A c p).mapIso ((complexIso _) ≪≫ (componentRowChainIso (C:=C)).symm) + exact Module.Finite.equiv e.toLinearEquiv + · by_cases hp:p=0 + · subst p + have : Subsingleton ((homologyRow (C:=C) q).X 0) := ModuleCat.isZero_iff_subsingleton.mp + (nerve.positive_zero (fun U V:IntervalBar.Diagram C (Fin 1)=>⟨zeroHom C U V⟩) q hq) + have : Module.Finite ℤ ((homologyRow (C:=C) q).X 0) := inferInstance + exact BarHomology.finite_homology _ _ + · have hq2:q≤2:=by omega + interval_cases q + · contradiction + · rcases (show p=1 ∨ p=2 by omega) with rfl|rfl + · exact StableBarOne.row_one_finite 1 (by decide) + · exact MarkedH1.row_one_two_finite (fun i _=>hf i) + · have hp1:p=1:=by omega + subst p + exact StableBarOne.row_one_finite 2 (by decide) + have : Module.Finite ℤ ((AlgebraicTopology.AlternatingFaceMapComplex.obj (X ⋙ SSet.homologyFunctor DiagonalResolution.Z q)).homology p) := hr + exact Module.Finite.equiv (homologyRowHomologyIso X p q).symm.toLinearEquiv +end IntervalBar.Diagram + +end + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits MonoidalCategory Simplicial Opposite +namespace SimplicialDiagonal +open FreeChains + +variable (X:I ⥤ SSet) +lemma finite_forward (r:ℕ) + (hc:∀p,(X.obj p).IsConnected) + (hz:∀q,0bar_connected _) zero_bar_acyclic + intro p q hq + apply singleRow_finite + exact fun i hi=>hf i (by omega) +lemma bar₃_finite_forward (r:ℕ) + (hf:∀n,n≤r → Module.Finite ℤ ((bar₂ (C:=C)).homology Z n : A)) : + ∀q,q≤r+1 → Module.Finite ℤ ((bar₃ (C:=C)).homology Z q : A) := by + apply finite_forward (rows₃ (C:=C)) r (fun _=>bar₂_connected) + (fun q hq=>by + change IsZero (SSet.homology (C:=A) (bar₂ (C:=Diagram C (Fin 1))) Z q) + exact bar₂_acyclic (fun _ _=>inferInstance) q hq) + intro p q hq + apply doubleRow_finite + exact fun i hi=>hf i (by omega) +lemma triple_finite_of_bar + (hf:∀n,n≤3 → Module.Finite ℤ ((bar (C:=C)).homology Z n : A)) : + ∀q,q≤5 → Module.Finite ℤ ((bar₃ (C:=C)).homology Z q : A) := + bar₃_finite_forward 4 (bar₂_finite_forward 3 hf) +end IntervalBar.Diagram + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/FirstBarStableH1.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/FirstBarStableH1.lean new file mode 100644 index 0000000000000000000000000000000000000000..efd129c3b86ae3141499035e142b5c9490402e4c --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/FirstBarStableH1.lean @@ -0,0 +1,76 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.FirstBarComponentsFinite +import OAI.GroupTheory.SimpleAmenable.Homology.ChainPositiveCokernel + +namespace OAI + +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits MonoidalCategory Simplicial Opposite AlgebraicTopology +namespace MarkedH1 +open FreeChains ComponentTranslation IntervalBar.Diagram + +variable {C:Type} [Groupoid.{0} C] [MonoidalCategory C] [SymmetricCategory C] +noncomputable def linearStable : (homologyRow (C:=C) 1).X 1 ⟶ ComponentStable.object (C:=C) 1 := + SSet.homologyMap (nerveMap oneEval) Z 1 ≫ ComponentStable.toStable 1 +instance linearStable_epi : Epi (linearStable (C:=C)) := by + dsimp only [linearStable] + exact epi_comp' (@IsIso.epi_of_iso _ _ _ _ _ + (NerveHomotopy.homologyMap_isIso (oneEval (C:=C)) Z 1)) + (ComponentStable.epi_toStable 1) +omit [SymmetricCategory C] in +lemma rowOne_d10 : (homologyRow (C:=C) 1).d 1 0=0 := by + have hz:IsZero ((homologyRow (C:=C) 1).X 0) := by + apply (IsZero.iff_id_eq_zero _).mpr + apply hom_ext + intro p i + exact Fin.elim0 i + exact hz.eq_zero_of_tgt _ +lemma linearStable_d : (homologyRow (C:=C) 1).d 2 1 ≫ linearStable=0 := by + apply hom_ext + intro p i + change Fin 2 → Skeleton C at p + change Fin 2 at i + rw [SimplicialFirstFinite.d21] + dsimp only [linearStable] + simp only [Preadditive.add_comp,Preadditive.sub_comp] + change primitive p i ≫ SSet.homologyMap (nerveMap (reindex (SimplexCategory.δ (0:Fin 3)).toOrderHom)) Z 1 ≫ + SSet.homologyMap (nerveMap oneEval) Z 1 ≫ ComponentStable.toStable 1 - + primitive p i ≫ SSet.homologyMap (nerveMap (reindex (SimplexCategory.δ (1:Fin 3)).toOrderHom)) Z 1 ≫ + SSet.homologyMap (nerveMap oneEval) Z 1 ≫ ComponentStable.toStable 1 + + primitive p i ≫ SSet.homologyMap (nerveMap (reindex (SimplexCategory.δ (2:Fin 3)).toOrderHom)) Z 1 ≫ + SSet.homologyMap (nerveMap oneEval) Z 1 ≫ ComponentStable.toStable 1 = 0 + rw [binary_primitive_middle_stable] + fin_cases i + all_goals dsimp only at * + · change primitive p 0 ≫ SSet.homologyMap (nerveMap (reindex (SimplexCategory.δ (0:Fin 3)).toOrderHom)) Z 1 ≫ + SSet.homologyMap (nerveMap oneEval) Z 1 ≫ ComponentStable.toStable 1 - + ComponentStable.inclusion (p 0) 1 ≫ ComponentStable.toStable 1 + + primitive p 0 ≫ SSet.homologyMap (nerveMap (reindex (SimplexCategory.δ (2:Fin 3)).toOrderHom)) Z 1 ≫ + SSet.homologyMap (nerveMap oneEval) Z 1 ≫ ComponentStable.toStable 1 = 0 + rw [binary_primitive_zero_other_assoc,zero_comp, + binary_primitive_last_assoc] + abel + · change primitive p 1 ≫ SSet.homologyMap (nerveMap (reindex (SimplexCategory.δ (0:Fin 3)).toOrderHom)) Z 1 ≫ + SSet.homologyMap (nerveMap oneEval) Z 1 ≫ ComponentStable.toStable 1 - + ComponentStable.inclusion (p 1) 1 ≫ ComponentStable.toStable 1 + + primitive p 1 ≫ SSet.homologyMap (nerveMap (reindex (SimplexCategory.δ (2:Fin 3)).toOrderHom)) Z 1 ≫ + SSet.homologyMap (nerveMap oneEval) Z 1 ≫ ComponentStable.toStable 1 = 0 + rw [binary_primitive_zero_assoc, + binary_primitive_last_other_assoc,zero_comp] + abel +noncomputable def stableOneπ : (homologyRow (C:=C) 1).homology 1 ⟶ ComponentStable.object (C:=C) 1 := + ChainComplex.positiveDesc _ 0 rowOne_d10 linearStable linearStable_d +instance stableOneπ_epi : Epi (stableOneπ (C:=C)) := by + have hh:ChainComplex.positiveπ _ 0 rowOne_d10 ≫ stableOneπ (C:=C)=linearStable := + ChainComplex.positiveπ_desc _ 0 rowOne_d10 linearStable linearStable_d + have :Epi (ChainComplex.positiveπ _ 0 rowOne_d10 ≫ stableOneπ (C:=C)):=by rw [hh]; infer_instance + exact epi_of_epi (ChainComplex.positiveπ _ 0 rowOne_d10) _ +lemma stableH1_finite + [Module.Finite ℤ ((bar (C:=C)).homology Z 1 : A)] + [Module.Finite ℤ ((bar (C:=C)).homology Z 2 : A)] : + Module.Finite ℤ (ComponentStable.object (C:=C) 1 : A) := by + have :=first_row_one_finite (C:=C) + exact Module.Finite.of_surjective (stableOneπ (C:=C)).hom + ((ModuleCat.epi_iff_surjective _).mp inferInstance) +end MarkedH1 + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/FormalLawReindex.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/FormalLawReindex.lean new file mode 100644 index 0000000000000000000000000000000000000000..78a2e6d274c6ea6a755e95b4b9c27a9efdb638b3 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/FormalLawReindex.lean @@ -0,0 +1,86 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.SmallFamilyWords +import OAI.GroupTheory.SimpleAmenable.CentralCovers.SmallFamilyGlobal + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section FormalLawReindex +variable {α ι κ H : Type*} [Fintype α] [DecidableEq α] [Group H] + +noncomputable def smallFamilyReindex (v : κ → ι) : SmallFamilyWord α κ →* SmallFamilyWord α ι := + FreeGroup.map (fun l => ⟨l.1,l.2.1.map v,l.2.2⟩) + +theorem smallFamilyEval_reindex + (F : (I : FiveAlphabet α) → Option ι → alternatingGroup I.val →* H) (v : κ → ι) : + smallFamilyEval (fun I i => F I (i.map v))=(smallFamilyEval F).comp (smallFamilyReindex v) := by + apply FreeGroup.ext_hom + rintro ⟨I,i,s⟩ + simp only [MonoidHom.comp_apply,smallFamilyReindex,FreeGroup.map.of,smallFamilyEval_of] + +theorem smallFormalModel_reindex (v : κ → ι) : + (smallFamilyModel (α := α) (fun i : ι => {σ : ι → Bool | σ i=true})).comp (smallFamilyReindex v)= + (assignmentPullback (fun σ : ι → Bool => σ ∘ v)).comp + (smallFamilyModel (fun i : κ => {σ : κ → Bool | σ i=true})) := by + apply FreeGroup.ext_hom + rintro ⟨I,i,s⟩ + ext σ + simp only [MonoidHom.comp_apply,smallFamilyReindex,FreeGroup.map.of,smallFamilyModel,smallFamilyEval_of] + cases i <;> simp [maskFamily,sectorMask,assignmentPullback,Function.comp_def] + +theorem smallFormalLaw_reindex + (F : (I : FiveAlphabet α) → Option ι → alternatingGroup I.val →* H) + (h : HasCentralLaw (smallFamilyModel (fun i : ι => {σ : ι → Bool | σ i=true})) + (smallFamilyEval F).rangeRestrict) (v : κ → ι) : + HasCentralLaw (smallFamilyModel (fun i : κ => {σ : κ → Bool | σ i=true})) + (smallFamilyEval (fun I i => F I (i.map v))).rangeRestrict := by + rw [hasCentralLaw_iff] + intro w hw + have hm : smallFamilyModel (α := α) (fun i : ι => {σ : ι → Bool | σ i=true}) + (smallFamilyReindex v w)=1 := by + have he := DFunLike.congr_fun (smallFormalModel_reindex (α := α) v) w + simp only [MonoidHom.comp_apply,hw,map_one] at he + exact he + have hz := (hasCentralLaw_iff _ _).mp h _ hm + apply Subgroup.mem_center_iff.mpr + rintro ⟨x,⟨z,rfl⟩⟩ + apply Subtype.ext + have he := congrArg Subtype.val (Subgroup.mem_center_iff.mp hz + ((smallFamilyEval F).rangeRestrict (smallFamilyReindex v z))) + change smallFamilyEval F (smallFamilyReindex v z)*smallFamilyEval F (smallFamilyReindex v w)= + smallFamilyEval F (smallFamilyReindex v w)*smallFamilyEval F (smallFamilyReindex v z) at he + change smallFamilyEval (fun I i => F I (i.map v)) z*smallFamilyEval (fun I i => F I (i.map v)) w= + smallFamilyEval (fun I i => F I (i.map v)) w*smallFamilyEval (fun I i => F I (i.map v)) z + simpa only [smallFamilyEval_reindex,MonoidHom.comp_apply] using he + +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) [Finite ι] + +omit [Finite ι] in +theorem smallPrimitive_formal_reindex [Finite κ] (hlarge : 15 < m+1) + (P : ι → Fin 5 × (CutRing × CutRing)) + (h : HasCentralLaw (smallFamilyModel (fun i : ι => {σ : ι → Bool | σ i=true})) + (smallFamilyEval (B.smallPrimitiveInputs hlarge P)).rangeRestrict) (v : κ → ι) : + HasCentralLaw (smallFamilyModel (fun i : κ => {σ : κ → Bool | σ i=true})) + (smallFamilyEval (B.smallPrimitiveInputs hlarge (P ∘ v))).rangeRestrict := by + have he : B.smallPrimitiveInputs hlarge (P ∘ v)= + fun I i => B.smallPrimitiveInputs hlarge P I (i.map v) := by + funext I i + cases i <;> rfl + rw [he] + exact smallFormalLaw_reindex _ h v + +end InitialCoverSystem +end FormalLawReindex + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/GroupNerveCoordinates.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/GroupNerveCoordinates.lean new file mode 100644 index 0000000000000000000000000000000000000000..6f4c69c79cd2fafd0c107d37089e5925ddb147c9 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/GroupNerveCoordinates.lean @@ -0,0 +1,186 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.ProductNatural + +namespace OAI + +section +open CategoryTheory Simplicial SimplicialObject Opposite +namespace GroupNerveCoordinates + +variable {G : Type} [Group G] {n : ℕ} +def labels (F:ComposableArrows (SingleObj G) n) : Fin n → G := + fun i => (F.map (homOfLE (show i.castSucc ≤ i.succ by exact Fin.castSucc_le_succ i)))⁻¹ +noncomputable def ofLabels (g:Fin n → G) : ComposableArrows (SingleObj G) n where + obj _ := SingleObj.star G + map {i j} _ := (Fin.partialProd g j)⁻¹ * Fin.partialProd g i + map_id i := inv_mul_cancel _ + map_comp := by intros; change _ = (_ * _) * (_ * _); group +@[simp] lemma labels_ofLabels (g:Fin n → G) : labels (ofLabels g)=g := by + funext i + change ((Fin.partialProd g i.succ)⁻¹ * Fin.partialProd g i.castSucc)⁻¹=g i + rw [mul_inv_rev,inv_inv,Fin.partialProd_right_inv] +lemma eqToHom_one {x y:SingleObj G} (h:x=y) : eqToHom h=(1:G) := by subst y; rfl +@[simp] lemma ofLabels_labels (F:ComposableArrows (SingleObj G) n) : ofLabels (labels F)=F := by + apply ComposableArrows.ext (fun _=>Subsingleton.elim _ _) + intro i hi + simp only [eqToHom_one,SingleObj.comp_as_mul,one_mul,mul_one] + change (Fin.partialProd (labels F) (Fin.succ ⟨i,hi⟩))⁻¹ * + Fin.partialProd (labels F) (Fin.castSucc ⟨i,hi⟩)=_ + rw [Fin.partialProd_succ,mul_inv_rev,mul_assoc,inv_mul_cancel,mul_one] + simp only [labels,inv_inv] +noncomputable def equiv (G:Type) [Group G] (n:ℕ) : + ComposableArrows (SingleObj G) n ≃ (Fin n → G) where + toFun := labels + invFun := ofLabels + left_inv := ofLabels_labels + right_inv := labels_ofLabels +lemma labels_zero_face (F:ComposableArrows (SingleObj G) (n+1)) : + labels ((nerve _).δ (0:Fin (n+2)) F) = Fin.tail (labels F) := by + funext i + rfl +lemma labels_succ_face (F:ComposableArrows (SingleObj G) (n+1)) (i:Fin (n+1)) : + labels ((nerve _).δ i.succ F) = Fin.contractNth i (· * ·) (labels F) := by + obtain ⟨g,rfl⟩ := (equiv G (n+1)).symm.surjective F + change labels ((nerve _).δ i.succ (ofLabels g)) = _ + change labels ((nerve (SingleObj G)).δ i.succ (ofLabels g)) = + Fin.contractNth i (· * ·) (labels (ofLabels g)) + rw [labels_ofLabels] + funext k + change ((Fin.partialProd g (i.succ.succAbove k.succ))⁻¹ * + Fin.partialProd g (i.succ.succAbove k.castSucc))⁻¹ = _ + rw [mul_inv_rev,inv_inv,Fin.succ_succAbove_succ] + exact Fin.inv_partialProd_mul_eq_contractNth g i k +lemma labels_map {H:Type} [Group H] (f:G →* H) + (F:ComposableArrows (SingleObj G) n) : + labels ((nerveMap (SingleObj.mapHom G H f)).app (op ⦋n⦌) F) = fun i=>f (labels F i) := by + funext i + exact (map_inv f _).symm +end GroupNerveCoordinates + +end + +section +open CategoryTheory Simplicial SimplicialObject Opposite AlgebraicTopology +open scoped BigOperators +namespace GroupNerveCoordinates +open FreeChains + +attribute [local instance 1200] Rep.hV2 +variable (G : Type) [Group G] +noncomputable def chainCoordinates (n:ℕ) : + (complex (nerve (SingleObj G))).X n ≅ + (groupHomology.inhomogeneousChains (Rep.trivial ℤ G ℤ)).X n := + (Finsupp.domLCongr (M:=ℤ) (R:=ℤ) (equiv G n)).toModuleIso +lemma coordinates_single (n:ℕ) (F:ComposableArrows (SingleObj G) n) (z:ℤ) : + (chainCoordinates G n).hom (Finsupp.single F z) = Finsupp.single (labels F) z := + Finsupp.domLCongr_single _ _ _ +lemma coordinates_d (n:ℕ) : + (complex (nerve (SingleObj G))).d (n+1) n ≫ (chainCoordinates G n).hom = + (chainCoordinates G (n+1)).hom ≫ + (groupHomology.inhomogeneousChains (Rep.trivial ℤ G ℤ)).d (n+1) n := by + classical + rw [groupHomology.inhomogeneousChains.d_def] + apply ModuleCat.hom_ext + apply Finsupp.lhom_ext' + intro F + apply LinearMap.ext + intro z + change (chainCoordinates G n).hom.hom (((complex (nerve (SingleObj G))).d (n+1) n).hom + (Finsupp.single F z)) = _ + rw [show (complex (nerve (SingleObj G))).d (n+1) n = + ∑ i:Fin (n+2), (-1:ℤ)^(i:ℕ) • (ModuleCat.free ℤ).map ((nerve (SingleObj G)).δ i) from + AlternatingFaceMapComplex.obj_d_eq _ n] + erw [ModuleCat.hom_sum] + change (Finsupp.domLCongr (M:=ℤ) (R:=ℤ) (equiv G n)) + ((∑ index:Fin (n+2), (-1:ℤ)^(index:ℕ) • + Finsupp.lmapDomain (α:=ComposableArrows (SingleObj G) (n+1)) + (α':=ComposableArrows (SingleObj G) n) ℤ ℤ ((nerve (SingleObj G)).δ index)) + (Finsupp.single F z)) = _ + simp only [LinearMap.sum_apply,LinearMap.smul_apply,map_sum,map_zsmul] + have hmap (i:Fin (n+2)) : (chainCoordinates G n).hom + ((ModuleCat.free ℤ).map ((nerve (SingleObj G)).δ i) (Finsupp.single F z)) = + Finsupp.single (labels ((nerve (SingleObj G)).δ i F)) z := by + change (Finsupp.domLCongr (equiv G n)) + (Finsupp.lmapDomain ℤ ℤ ((nerve (SingleObj G)).δ i) (Finsupp.single F z)) = _ + rw [Finsupp.lmapDomain_apply,Finsupp.mapDomain_single] + exact Finsupp.domLCongr_single _ _ _ + change (∑ i:Fin (n+2), (-1:ℤ)^(i:ℕ) • (chainCoordinates G n).hom + ((ModuleCat.free ℤ).map ((nerve (SingleObj G)).δ i) (Finsupp.single F z))) = _ + simp only [hmap] + rw [Fin.sum_univ_succ] + simp only [Fin.val_zero,pow_zero,one_zsmul,Fin.val_succ] + change _ = groupHomology.inhomogeneousChains.d (Rep.trivial ℤ G ℤ) n + ((chainCoordinates G (n+1)).hom (Finsupp.single F z)) + erw [coordinates_single,groupHomology.inhomogeneousChains.d_single] + apply congrArg₂ (· + ·) + · exact congrArg (fun faceLabels => Finsupp.single faceLabels z) (labels_zero_face F) + · apply Finset.sum_congr rfl + intro index _ + exact congrArg (fun faceLabels => (-1:ℤ)^((index:ℕ)+1) • Finsupp.single faceLabels z) + (labels_succ_face F index) +noncomputable def chainIso : complex (nerve (SingleObj G)) ≅ + groupHomology.inhomogeneousChains (Rep.trivial ℤ G ℤ) := by + refine HomologicalComplex.Hom.isoOfComponents (chainCoordinates G) ?_ + rintro n m rfl + exact (coordinates_d G m).symm +noncomputable def homologyIso (n:ℕ) : + (nerve (SingleObj G)).homology Z n ≅ groupHomology (Rep.trivial ℤ G ℤ) n := + (HomologicalComplex.homologyFunctor A c n).mapIso (complexIso _ ≪≫ chainIso G) +end GroupNerveCoordinates + +end + +section +open CategoryTheory Simplicial SimplicialObject Opposite AlgebraicTopology +open ProductChains +namespace FreeChains + +lemma complexIso_natural {X Y:SSet} (f:X⟶Y) : + SSet.chainComplexMap f Z ≫ (complexIso Y).hom = (complexIso X).hom ≫ chainMap f := by + apply HomologicalComplex.Hom.ext; funext n + exact naturalIso.hom.naturality (f.app (op ⦋n⦌)) +end FreeChains +namespace GroupNerveCoordinates +open FreeChains SimpleAmenable + +attribute [local instance 1200] Rep.hV2 +variable {G H:Type} [Group G] [Group H] (f:G→*H) +lemma coordinates_natural (n:ℕ) : + (chainMap (nerveMap f.toFunctor)).f n ≫ (chainCoordinates H n).hom = + (chainCoordinates G n).hom ≫ + (groupHomology.chainsMap f (TransitiveInduction.trivialMap f)).f n := by + apply ModuleCat.hom_ext + apply Finsupp.lhom_ext' + intro s + apply LinearMap.ext + intro z + change (chainCoordinates H n).hom + (Finsupp.lmapDomain ℤ ℤ ((nerveMap f.toFunctor).app (op ⦋n⦌)) (Finsupp.single s z)) = _ + rw [Finsupp.lmapDomain_apply,Finsupp.mapDomain_single] + change (chainCoordinates H n).hom + (Finsupp.single ((nerveMap f.toFunctor).app (op ⦋n⦌) s) z) = _ + erw [coordinates_single] + change _=(groupHomology.chainsMap f (TransitiveInduction.trivialMap f)).f n + ((chainCoordinates G n).hom (Finsupp.single s z)) + erw [coordinates_single,groupHomology.chainsMap_f_single,labels_map] + rfl +lemma chainIso_natural : + chainMap (nerveMap f.toFunctor) ≫ (chainIso H).hom = + (chainIso G).hom ≫ groupHomology.chainsMap f (TransitiveInduction.trivialMap f) := by + apply HomologicalComplex.Hom.ext; funext n + exact coordinates_natural f n +lemma homologyIso_natural (n:ℕ) : + SSet.homologyMap (nerveMap f.toFunctor) Z n ≫ (homologyIso H n).hom = + (homologyIso G n).hom ≫ TrivialHomology.map f n := by + change HomologicalComplex.homologyMap _ n ≫ HomologicalComplex.homologyMap _ n = + HomologicalComplex.homologyMap _ n ≫ HomologicalComplex.homologyMap _ n + rw [←HomologicalComplex.homologyMap_comp,←HomologicalComplex.homologyMap_comp] + congr 1 + change SSet.chainComplexMap (nerveMap f.toFunctor) Z ≫ (complexIso _).hom ≫ (chainIso H).hom = + ((complexIso _).hom ≫ (chainIso G).hom) ≫ _ + rw [←Category.assoc,complexIso_natural,Category.assoc,chainIso_natural,←Category.assoc] +end GroupNerveCoordinates + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/Id.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/Id.lean new file mode 100644 index 0000000000000000000000000000000000000000..63c74858a93b4bf6fe8cbe84f5705eac23e29145 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/Id.lean @@ -0,0 +1,17 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.IntervalEdge + +namespace OAI + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits MonoidalCategory Simplicial Opposite +namespace NerveHomology +open FreeChains +@[simp] lemma id {D:Type} [Category.{0} D] (q:ℕ) : map (𝟭 D) q=𝟙 _ := by + change SSet.homologyMap (𝟙 _) Z q=𝟙 _ + exact SSet.homologyMap_id _ _ _ +end NerveHomology + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/InducedMonoidal.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/InducedMonoidal.lean new file mode 100644 index 0000000000000000000000000000000000000000..02b59a30022b475bd868efb6a88232f275d06e89 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/InducedMonoidal.lean @@ -0,0 +1,214 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.RestrictedMonoidal + +namespace OAI + +section +open CategoryTheory MonoidalCategory Functor.LaxMonoidal Functor.OplaxMonoidal +namespace InducedMonoidal + +variable {C D : Type} [cC : Category.{0} C] [cD : Category.{0} D] [mC : MonoidalCategory C] [mD : MonoidalCategory D] +variable (F : C ⥤ D) +section +variable [F.Monoidal] +abbrev Cat := InducedCategory D F.obj +abbrev inclusion : Cat F ⥤ D := inducedFunctor F.obj +noncomputable instance monoidalStruct : MonoidalCategoryStruct (Cat F) where + tensorObj X Y := @MonoidalCategoryStruct.tensorObj C cC mC.toMonoidalCategoryStruct X Y + tensorUnit := 𝟙_ C + tensorHom {X Y X' Y'} f g := InducedCategory.homMk (δ F X X' ≫ (f.hom ⊗ₘ g.hom) ≫ μ F Y Y') + whiskerLeft X _ _ f := InducedCategory.homMk (δ F X _ ≫ (F.obj X ◁ f.hom) ≫ μ F X _) + whiskerRight f Y := InducedCategory.homMk (δ F _ Y ≫ (f.hom ▷ F.obj Y) ≫ μ F _ Y) + associator X Y Z := InducedCategory.isoMk (F.mapIso (@MonoidalCategoryStruct.associator C cC mC.toMonoidalCategoryStruct X Y Z)) + leftUnitor X := InducedCategory.isoMk (F.mapIso (@MonoidalCategoryStruct.leftUnitor C cC mC.toMonoidalCategoryStruct X)) + rightUnitor X := InducedCategory.isoMk (F.mapIso (@MonoidalCategoryStruct.rightUnitor C cC mC.toMonoidalCategoryStruct X)) +noncomputable def data : Monoidal.InducingFunctorData (inclusion F) where + μIso X Y := Functor.Monoidal.μIso F X Y + εIso := Functor.Monoidal.εIso F + whiskerLeft_eq := by intros; rfl + whiskerRight_eq _ _ := rfl + tensorHom_eq _ _ := rfl + associator_eq X Y Z := by + change F.map (@MonoidalCategoryStruct.associator C cC mC.toMonoidalCategoryStruct X Y Z).hom = _ + simpa only [inclusion,inducedFunctor, MonoidalCategoryStruct.tensorObj, MonoidalCategoryStruct.tensorUnit, monoidalStruct, Iso.trans_hom,Iso.symm_hom,tensorIso_hom,Iso.refl_hom,tensorHom_id,id_tensorHom, + Functor.Monoidal.μIso_hom,Functor.Monoidal.μIso_inv,Category.assoc] using + Functor.Monoidal.map_associator F X Y Z + leftUnitor_eq X := by + change F.map (@MonoidalCategoryStruct.leftUnitor C cC mC.toMonoidalCategoryStruct X).hom = _ + simpa only [inclusion,inducedFunctor, MonoidalCategoryStruct.tensorObj, MonoidalCategoryStruct.tensorUnit, monoidalStruct, Iso.trans_hom,Iso.symm_hom,tensorIso_hom,Iso.refl_hom,tensorHom_id,id_tensorHom, + Functor.Monoidal.μIso_hom,Functor.Monoidal.μIso_inv,Functor.Monoidal.εIso_inv,Category.assoc] using + Functor.Monoidal.map_leftUnitor F X + rightUnitor_eq X := by + change F.map (@MonoidalCategoryStruct.rightUnitor C cC mC.toMonoidalCategoryStruct X).hom = _ + simpa only [inclusion,inducedFunctor, MonoidalCategoryStruct.tensorObj, MonoidalCategoryStruct.tensorUnit, monoidalStruct, Iso.trans_hom,Iso.symm_hom,tensorIso_hom,Iso.refl_hom,tensorHom_id,id_tensorHom, + Functor.Monoidal.μIso_hom,Functor.Monoidal.μIso_inv,Functor.Monoidal.εIso_inv,Category.assoc] using + Functor.Monoidal.map_rightUnitor F X +noncomputable instance monoidal : MonoidalCategory (Cat F) := Monoidal.induced (inclusion F) (data F) +noncomputable instance inclusionMonoidal : (inclusion F).Monoidal := Monoidal.fromInducedMonoidal (inclusion F) (data F) +noncomputable def source : C ⥤ Cat F where + obj X := X + map f := InducedCategory.homMk (F.map f) + map_id X := InducedCategory.hom_ext (F.map_id X) + map_comp f g := InducedCategory.hom_ext (F.map_comp f g) +noncomputable instance sourceMonoidal : (source F).Monoidal := Functor.CoreMonoidal.toMonoidal { + εIso := Iso.refl _ + μIso _ _ := Iso.refl _ + μIso_hom_natural_left := by + intros; apply InducedCategory.hom_ext + change (δ F _ _ ≫ _ ▷ _ ≫ μ F _ _) ≫ 𝟙 _ = 𝟙 _ ≫ F.map (_ ▷ _) + simp only [Category.id_comp,Category.comp_id] + exact (Functor.Monoidal.map_whiskerRight F _ _).symm + μIso_hom_natural_right := by + intros; apply InducedCategory.hom_ext + change (δ F _ _ ≫ _ ◁ _ ≫ μ F _ _) ≫ 𝟙 _ = 𝟙 _ ≫ F.map (_ ◁ _) + simp only [Category.id_comp,Category.comp_id] + exact (Functor.Monoidal.map_whiskerLeft F _ _).symm + associativity := by + intros; apply InducedCategory.hom_ext + simp only [id_whiskerRight,whiskerLeft_id,source, InducedCategory.homMk_hom, Iso.refl_hom, + Category.id_comp,Category.comp_id] + rfl + left_unitality := by + intros; apply InducedCategory.hom_ext + simp only [id_whiskerRight,source, InducedCategory.homMk_hom, Iso.refl_hom, + Category.id_comp] + rfl + right_unitality := by + intros; apply InducedCategory.hom_ext + simp only [whiskerLeft_id,source, InducedCategory.homMk_hom, Iso.refl_hom, + Category.id_comp] + rfl } +end +section +variable [BraidedCategory C] [BraidedCategory D] [F.Braided] +noncomputable instance braided : BraidedCategory (Cat F) := + BraidedCategory.ofFaithful (inclusion F) + (fun X Y => InducedCategory.isoMk (F.mapIso (@BraidedCategory.braiding C cC mC _ X Y))) (by + intro X Y + change μ F X Y ≫ F.map (@BraidedCategory.braiding C cC mC _ X Y).hom = (β_ _ _).hom ≫ μ F Y X + exact Functor.LaxBraided.braided X Y) +noncomputable instance inclusionBraided : (inclusion F).Braided where + braided X Y := by + change μ F X Y ≫ F.map (@BraidedCategory.braiding C cC mC _ X Y).hom = (β_ _ _).hom ≫ μ F Y X + exact Functor.LaxBraided.braided X Y +noncomputable instance sourceBraided : (source F).Braided where + braided X Y := by + apply InducedCategory.hom_ext + change 𝟙 _ ≫ F.map (@BraidedCategory.braiding C cC mC _ X Y).hom = F.map (@BraidedCategory.braiding C cC mC _ X Y).hom ≫ 𝟙 _ + simp +end +variable [BraidedCategory C] [SymmetricCategory D] [F.Braided] +noncomputable instance symmetric : SymmetricCategory (Cat F) := + SymmetricCategory.ofFaithful (inclusion F) +end InducedMonoidal + +end + +open CategoryTheory MonoidalCategory +namespace RestrictedNerve +open IntervalBar IntervalBar.Diagram + +variable {C : Type} [Groupoid.{0} C] (W : MorphismProperty C) + [Fact W.StableUnderInverse] [MonoidalCategory C] [SymmetricCategory C] + [W.IsStableUnderBraiding] +variable (I : Type) [Preorder I] +noncomputable instance posDiagramIsIso {X Y : PosDiagrams W I} (f : X ⟶ Y) : IsIso f := by + refine ⟨⟨InducedCategory.homMk (inv f.hom),?_,?_⟩⟩ + · apply InducedCategory.hom_ext; exact IsIso.hom_inv_id f.hom + · apply InducedCategory.hom_ext; exact IsIso.inv_hom_id f.hom +noncomputable instance posDiagramGroupoid : Groupoid (PosDiagrams W I) := + Groupoid.ofIsIso (fun _ => inferInstance) +noncomputable instance posDiagramMonoidal : MonoidalCategory (PosDiagrams W I) := + InducedMonoidal.monoidal (diagramInclusion W I) +noncomputable instance posDiagramBraided : BraidedCategory (PosDiagrams W I) := + InducedMonoidal.braided (diagramInclusion W I) +noncomputable instance posDiagramSymmetric : SymmetricCategory (PosDiagrams W I) := + InducedMonoidal.symmetric (diagramInclusion W I) +instance diagramPropertyInverse : Fact (diagramProperty W I).StableUnderInverse where + out _ _ e h i j hij := by + let he : _ ≅ _ := { + hom := e.hom.hom.app i j hij + inv := e.inv.hom.app i j hij + hom_inv_id := congrArg (fun f => f.hom.app i j hij) e.hom_inv_id + inv_hom_id := congrArg (fun f => f.hom.app i j hij) e.inv_hom_id } + exact (Fact.out : W.StableUnderInverse) he (h i j hij) +open Functor.LaxMonoidal Functor.OplaxMonoidal +@[simp] lemma diagram_μ_app (A B : Diagram (WideSubcategory W) I) (i j : I) (h:i≤j) : + (μ (diagramInclusion W I) A B).app i j h = 𝟙 _ := rfl +@[simp] lemma diagram_δ_app (A B : Diagram (WideSubcategory W) I) (i j : I) (h:i≤j) : + (δ (diagramInclusion W I) A B).app i j h = 𝟙 _ := by + change (CategoryTheory.inv (mapμHom (inclusion W) A B)).app i j h = 𝟙 _ + rw [inv_app] + change CategoryTheory.inv (𝟙 _) = 𝟙 _ + simp +@[simp] lemma posTensor_app {A B A' B' : PosDiagrams W I} (f : A ⟶ B) (g : A' ⟶ B') + (i j:I) (h:i≤j) : (f ⊗ₘ g).hom.app i j h = f.hom.app i j h ⊗ₘ g.hom.app i j h := by + change (δ (diagramInclusion W I) A A' ≫ (f.hom ⊗ₘ g.hom) ≫ μ (diagramInclusion W I) B B').app i j h = _ + simp only [comp_app,diagram_δ_app,diagram_μ_app,tensor_app] + erw [Category.id_comp, Category.comp_id] +@[simp] lemma posWhiskerLeft_app (A : PosDiagrams W I) {B D : PosDiagrams W I} (f : B ⟶ D) + (i j:I) (h:i≤j) : (A ◁ f).hom.app i j h = ((diagramInclusion W I).obj A).obj i j h ◁ f.hom.app i j h := by + change (δ (diagramInclusion W I) A B ≫ _ ◁ f.hom ≫ μ (diagramInclusion W I) A D).app i j h = _ + simp only [comp_app,diagram_δ_app,diagram_μ_app,whiskerLeft_app] + erw [Category.id_comp, Category.comp_id] +@[simp] lemma posWhiskerRight_app {A B : PosDiagrams W I} (f : A ⟶ B) (D : PosDiagrams W I) + (i j:I) (h:i≤j) : (f ▷ D).hom.app i j h = f.hom.app i j h ▷ ((diagramInclusion W I).obj D).obj i j h := by + change (δ (diagramInclusion W I) A D ≫ f.hom ▷ _ ≫ μ (diagramInclusion W I) B D).app i j h = _ + simp only [comp_app,diagram_δ_app,diagram_μ_app,whiskerRight_app] + erw [Category.id_comp, Category.comp_id] +@[simp] lemma posAssoc_app (A B D : PosDiagrams W I) (i j:I) (h:i≤j) : + (α_ A B D).hom.hom.app i j h = + (α_ ((diagramInclusion W I).obj A |>.obj i j h) + ((diagramInclusion W I).obj B |>.obj i j h) ((diagramInclusion W I).obj D |>.obj i j h)).hom := rfl +@[simp] lemma posLeft_app (A : PosDiagrams W I) (i j:I) (h:i≤j) : + (λ_ A).hom.hom.app i j h = (λ_ ((diagramInclusion W I).obj A |>.obj i j h)).hom := rfl +@[simp] lemma posRight_app (A : PosDiagrams W I) (i j:I) (h:i≤j) : + (ρ_ A).hom.hom.app i j h = (ρ_ ((diagramInclusion W I).obj A |>.obj i j h)).hom := rfl +@[simp] lemma posBraiding_app (A B : PosDiagrams W I) (i j:I) (h:i≤j) : + (β_ A B).hom.hom.app i j h = + (β_ ((diagramInclusion W I).obj A |>.obj i j h) ((diagramInclusion W I).obj B |>.obj i j h)).hom := rfl +instance diagramPropertyMonoidal : (diagramProperty W I).IsMonoidalStable where + whiskerLeft A _ _ f hf i j h := by + change W ((δ (diagramInclusion W I) A _ ≫ _ ◁ f.hom ≫ μ (diagramInclusion W I) A _).app i j h) + simp only [comp_app,whiskerLeft_app,diagram_δ_app,diagram_μ_app] + erw [Category.id_comp, Category.comp_id] + exact W.whiskerLeft_mem _ _ (hf i j h) + whiskerRight f hf B i j h := by + change W ((δ (diagramInclusion W I) _ B ≫ f.hom ▷ _ ≫ μ (diagramInclusion W I) _ B).app i j h) + simp only [comp_app,whiskerRight_app,diagram_δ_app,diagram_μ_app] + erw [Category.id_comp, Category.comp_id] + exact W.whiskerRight_mem _ (hf i j h) _ + associator_hom_mem first second third lower upper bound := W.associator_hom_mem + (((diagramInclusion W I).obj first).obj lower upper bound) + (((diagramInclusion W I).obj second).obj lower upper bound) + (((diagramInclusion W I).obj third).obj lower upper bound) + associator_inv_mem first second third := + (Fact.out : (diagramProperty W I).StableUnderInverse) (α_ first second third) + (fun lower upper bound => W.associator_hom_mem + (((diagramInclusion W I).obj first).obj lower upper bound) + (((diagramInclusion W I).obj second).obj lower upper bound) + (((diagramInclusion W I).obj third).obj lower upper bound)) + leftUnitor_hom_mem diagram lower upper bound := W.leftUnitor_hom_mem + (((diagramInclusion W I).obj diagram).obj lower upper bound) + leftUnitor_inv_mem diagram := + (Fact.out : (diagramProperty W I).StableUnderInverse) (λ_ diagram) + (fun lower upper bound => W.leftUnitor_hom_mem + (((diagramInclusion W I).obj diagram).obj lower upper bound)) + rightUnitor_hom_mem diagram lower upper bound := W.rightUnitor_hom_mem + (((diagramInclusion W I).obj diagram).obj lower upper bound) + rightUnitor_inv_mem diagram := + (Fact.out : (diagramProperty W I).StableUnderInverse) (ρ_ diagram) + (fun lower upper bound => W.rightUnitor_hom_mem + (((diagramInclusion W I).obj diagram).obj lower upper bound)) +instance diagramPropertyBraided : (diagramProperty W I).IsStableUnderBraiding where + braiding_hom_mem first second lower upper bound := W.braiding_hom_mem + (((diagramInclusion W I).obj first).obj lower upper bound) + (((diagramInclusion W I).obj second).obj lower upper bound) + braiding_inv_mem first second := + (Fact.out : (diagramProperty W I).StableUnderInverse) (β_ first second) + (fun lower upper bound => W.braiding_hom_mem + (((diagramInclusion W I).obj first).obj lower upper bound) + (((diagramInclusion W I).obj second).obj lower upper bound)) +end RestrictedNerve + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/IntervalBar.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/IntervalBar.lean new file mode 100644 index 0000000000000000000000000000000000000000..f26ee6d610cc66be1694c905e6dde5e9f26bc5c0 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/IntervalBar.lean @@ -0,0 +1,157 @@ +import Mathlib + +namespace OAI + +section + +section + +open CategoryTheory MonoidalCategory +universe u v w +namespace IntervalBar +variable (C : Type u) [Groupoid.{v} C] [MonoidalCategory C] +variable (I : Type w) [Preorder I] + +structure Diagram where + obj : ∀ i j : I, i ≤ j → C + unit : ∀ i, obj i i le_rfl ≅ 𝟙_ C + cut : ∀ i j k (hij : i≤j) (hjk : j≤k), obj i j hij ⊗ obj j k hjk ≅ obj i k (hij.trans hjk) + left_unit : ∀ i j (h : i≤j), (cut i i j le_rfl h).hom = + (unit i).hom ▷ obj i j h ≫ (λ_ (obj i j h)).hom + right_unit : ∀ i j (h : i≤j), (cut i j j h le_rfl).hom = + obj i j h ◁ (unit j).hom ≫ (ρ_ (obj i j h)).hom + associativity : ∀ i j k l (hij : i≤j) (hjk : j≤k) (hkl : k≤l), + (cut i j k hij hjk).hom ▷ obj k l hkl ≫ (cut i k l (hij.trans hjk) hkl).hom = + (α_ (obj i j hij) (obj j k hjk) (obj k l hkl)).hom ≫ + obj i j hij ◁ (cut j k l hjk hkl).hom ≫ (cut i j l hij (hjk.trans hkl)).hom + +namespace Diagram +variable {C I} +structure Hom (D E : Diagram C I) where + app : ∀ i j (h : i≤j), D.obj i j h ⟶ E.obj i j h + unit : ∀i, app i i le_rfl ≫ (E.unit i).hom = (D.unit i).hom + cut : ∀i j k (hij : i≤j) (hjk : j≤k), + (app i j hij ⊗ₘ app j k hjk) ≫ (E.cut i j k hij hjk).hom = + (D.cut i j k hij hjk).hom ≫ app i k (hij.trans hjk) + +@[ext] lemma Hom.ext {D E : Diagram C I} {f g : Hom D E} + (h : ∀i j hij,f.app i j hij=g.app i j hij) : f=g := by + cases f; cases g + simp_all only [mk.injEq] + funext i j hij + exact h i j hij + +def Hom.id (D : Diagram C I) : Hom D D where + app i j h := 𝟙 _ + unit i := by simp + cut i j k hij hjk := by simp + +def Hom.comp {D E F : Diagram C I} (f : Hom D E) (g : Hom E F) : Hom D F where + app i j h := f.app i j h ≫ g.app i j h + unit i := by rw [Category.assoc,g.unit,f.unit] + cut i j k hij hjk := by + rw [←tensorHom_comp_tensorHom,Category.assoc,g.cut,←Category.assoc,f.cut,Category.assoc] + +noncomputable def Hom.inv {D E : Diagram C I} (f : Hom D E) : Hom E D where + app i j h := CategoryTheory.inv (f.app i j h) + unit i := by rw [←f.unit,←Category.assoc,IsIso.inv_hom_id,Category.id_comp] + cut i j k hij hjk := by + apply (cancel_epi (f.app i j hij ⊗ₘ f.app j k hjk)).mp + simp only [←Category.assoc,tensorHom_comp_tensorHom,IsIso.hom_inv_id,id_tensorHom_id, + Category.id_comp] + rw [f.cut,Category.assoc,IsIso.hom_inv_id,Category.comp_id] + +noncomputable instance : Groupoid (Diagram C I) where + Hom := Hom + id := Hom.id + comp := Hom.comp + id_comp f := by ext; simp [Hom.comp,Hom.id] + comp_id f := by ext; simp [Hom.comp,Hom.id] + assoc f g h := by ext; simp [Hom.comp,Category.assoc] + inv := Hom.inv + inv_comp f := by ext; simp [Hom.comp,Hom.inv,Hom.id] + comp_inv f := by ext; simp [Hom.comp,Hom.inv,Hom.id] + +@[simp] lemma id_app (D : Diagram C I) (i j : I) (h : i≤j) : + (𝟙 D : D ⟶ D).app i j h=𝟙 _ := rfl +@[simp] lemma comp_app {D E F : Diagram C I} (f : D ⟶ E) (g : E ⟶ F) + (i j : I) (h : i≤j) : (f≫g).app i j h=f.app i j h≫g.app i j h := rfl + +variable {J : Type w} [Preorder J] +def reindexObj (f : I →o J) (D : Diagram C J) : Diagram C I where + obj i j h := D.obj (f i) (f j) (f.monotone h) + unit i := D.unit (f i) + cut i j k hij hjk := D.cut (f i) (f j) (f k) (f.monotone hij) (f.monotone hjk) + left_unit i j h := D.left_unit (f i) (f j) (f.monotone h) + right_unit i j h := D.right_unit (f i) (f j) (f.monotone h) + associativity i j k l hij hjk hkl := + D.associativity (f i) (f j) (f k) (f l) (f.monotone hij) (f.monotone hjk) (f.monotone hkl) + +noncomputable def reindex (f : I →o J) : Diagram C J ⥤ Diagram C I where + obj := reindexObj f + map g := { + app i j h := g.app (f i) (f j) (f.monotone h) + unit i := g.unit (f i) + cut i j k hij hjk := g.cut (f i) (f j) (f k) (f.monotone hij) (f.monotone hjk) } + +@[simp] lemma reindex_id : reindex (C:=C) (OrderHom.id : I →o I)=𝟭 _ := by + apply CategoryTheory.Functor.ext + case h_obj => intro D; cases D; rfl + case h_map => intro D E f; change _ = (𝟙 _ ≫ f ≫ 𝟙 _); simp only [Category.id_comp,Category.comp_id]; rfl + +variable {K : Type w} [Preorder K] +@[simp] lemma reindex_comp (f : I →o J) (g : J →o K) : + reindex (C:=C) (g.comp f)=reindex g ⋙ reindex f := by + apply CategoryTheory.Functor.ext + case h_obj => intro D; rfl + case h_map => intro D E h; change _ = (𝟙 _ ≫ (reindex g ⋙ reindex f).map h ≫ 𝟙 _); simp only [Category.id_comp,Category.comp_id]; rfl + +noncomputable def eval (n : ℕ) : Diagram C (Fin (n+1)) ⥤ (Fin n → C) where + obj D i := D.obj i.castSucc i.succ (Fin.castSucc_le_succ i) + map f i := f.app i.castSucc i.succ (Fin.castSucc_le_succ i) + +lemma hom_ext_elementary {n : ℕ} {D E : Diagram C (Fin (n+1))} (f g : D ⟶ E) + (h : ∀ i : Fin n, f.app i.castSucc i.succ (Fin.castSucc_le_succ i) = + g.app i.castSucc i.succ (Fin.castSucc_le_succ i)) : f=g := by + have diag (i : Fin (n+1)) : f.app i i le_rfl=g.app i i le_rfl := by + apply (cancel_mono (E.unit i).hom).mp + rw [f.unit,g.unit] + apply Hom.ext + suffices ∀ j : Fin (n+1), ∀ i (hij : i≤j), f.app i j hij=g.app i j hij by + intro i j hij; exact this j i hij + apply Fin.induction + · intro i hi + have : i=0 := Fin.eq_of_val_eq (by simpa using hi) + subst i + exact diag 0 + · intro j ih i hij + by_cases he : i=j.succ + · subst i; exact diag j.succ + · have hi : i≤j.castSucc := by + simp only [Fin.le_def,Fin.ext_iff,Fin.val_succ,Fin.val_castSucc] at * + omega + apply (cancel_epi (D.cut i j.castSucc j.succ hi (Fin.castSucc_le_succ j)).hom).mp + rw [←f.cut,←g.cut,ih i hi,h j] + +noncomputable instance (n : ℕ) : (eval (C:=C) n).Faithful where + map_injective {_ _} f g h := hom_ext_elementary f g (fun i => congrFun h i) + +open scoped Simplicial +noncomputable def simplicial : SimplicialObject Cat.{v,max u v} where + obj n := Cat.of (Diagram C (Fin (n.unop.len+1))) + map f := (reindex f.unop.toOrderHom).toCatHom + map_id n := by + apply Cat.ext + exact reindex_id + map_comp f g := by + apply Cat.ext + exact reindex_comp g.unop.toOrderHom f.unop.toOrderHom + +end Diagram +end IntervalBar + +end + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/IntervalBinary.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/IntervalBinary.lean new file mode 100644 index 0000000000000000000000000000000000000000..5904061ee4ccd0179defa5006b4012f80fe0239f --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/IntervalBinary.lean @@ -0,0 +1,68 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.IntervalFunctor + +namespace OAI + +section +open CategoryTheory Limits MonoidalCategory Simplicial Opposite +namespace IntervalBar.Diagram + +variable {C:Type} [Groupoid.{0} C] [MonoidalCategory C] +noncomputable def oneEval : Diagram C (Fin 2) ⥤ C := eval 1 ⋙ Pi.eval (fun _:Fin 1=>C) 0 +noncomputable def oneConst : C ⥤ (Fin 1→C) := Functor.pi' (fun _=>𝟭 C) +noncomputable def piOneEquiv : (Fin 1→C) ≌ C where + functor := Pi.eval (fun _:Fin 1=>C) 0 + inverse := oneConst + unitIso := NatIso.ofComponents (fun values => + Pi.isoMk (fun index => eqToIso (congrArg values (Subsingleton.elim index 0)))) (by + intro source target morphism + funext index + have index_eq : index = 0 := Subsingleton.elim _ _ + subst index + change morphism 0 ≫ eqToHom (rfl : target 0 = target 0) = + eqToHom (rfl : source 0 = source 0) ≫ morphism 0 + simp) + counitIso := Iso.refl _ + functor_unitIso_comp values := by + change eqToHom (rfl : values 0 = values 0) ≫ 𝟙 (values 0) = 𝟙 (values 0) + simp +noncomputable instance oneEval_equivalence : (oneEval (C:=C)).IsEquivalence := by + have : (Pi.eval (fun _:Fin 1=>C) 0).IsEquivalence := (piOneEquiv (C:=C)).isEquivalence_functor + dsimp only [oneEval] + infer_instance +noncomputable def tensorPair : (Fin 2→C) ⥤ C where + obj X := X 0 ⊗ X 1 + map f := f 0 ⊗ₘ f 1 + map_id X := by simp + map_comp f g := by simp [tensorHom_comp_tensorHom] +noncomputable def binaryCut : eval (C:=C) 2 ⋙ tensorPair ⟶ + reindex (SimplexCategory.δ (1:Fin 3)).toOrderHom ⋙ oneEval where + app D := (D.cut 0 1 2 (by decide) (by decide)).hom + naturality D E f := f.cut 0 1 2 (by decide) (by decide) +lemma binary_zero : reindex (C:=C) (SimplexCategory.δ (0:Fin 3)).toOrderHom ⋙ oneEval = + eval 2 ⋙ Pi.eval (fun _:Fin 2=>C) 1 := rfl +lemma binary_last : reindex (C:=C) (SimplexCategory.δ (2:Fin 3)).toOrderHom ⋙ oneEval = + eval 2 ⋙ Pi.eval (fun _:Fin 2=>C) 0 := rfl +noncomputable def binaryFace (i:Fin 3) : (Fin 2→C) ⥤ C := + (eval 2).asEquivalence.inverse ⋙ reindex (SimplexCategory.δ i).toOrderHom ⋙ oneEval +noncomputable def binaryFaceZero : binaryFace (C:=C) 0 ≅ Pi.eval (fun _:Fin 2=>C) 1 := + Functor.isoWhiskerLeft (eval 2).asEquivalence.inverse (eqToIso binary_zero) ≪≫ + (Functor.associator _ _ _).symm ≪≫ + Functor.isoWhiskerRight (eval 2).asEquivalence.counitIso _ ≪≫ Functor.leftUnitor _ +noncomputable def binaryFaceLast : binaryFace (C:=C) 2 ≅ Pi.eval (fun _:Fin 2=>C) 0 := + Functor.isoWhiskerLeft (eval 2).asEquivalence.inverse (eqToIso binary_last) ≪≫ + (Functor.associator _ _ _).symm ≪≫ + Functor.isoWhiskerRight (eval 2).asEquivalence.counitIso _ ≪≫ Functor.leftUnitor _ +noncomputable def binaryCutIso : eval (C:=C) 2 ⋙ tensorPair ≅ + reindex (SimplexCategory.δ (1:Fin 3)).toOrderHom ⋙ oneEval := + NatIso.ofComponents (fun D => D.cut 0 1 2 (by decide) (by decide)) (by + intro D E f; exact f.cut 0 1 2 (by decide) (by decide)) +noncomputable def binaryFaceMiddle : binaryFace (C:=C) 1 ≅ tensorPair := + (Functor.isoWhiskerLeft (eval 2).asEquivalence.inverse binaryCutIso).symm ≪≫ + (Functor.associator _ _ _).symm ≪≫ + Functor.isoWhiskerRight (eval 2).asEquivalence.counitIso _ ≪≫ Functor.leftUnitor _ +end IntervalBar.Diagram + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/IntervalEdge.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/IntervalEdge.lean new file mode 100644 index 0000000000000000000000000000000000000000..537da333984c0920d4075153c6f39a5a83eed946 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/IntervalEdge.lean @@ -0,0 +1,153 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.DoubleCoordinates + +namespace OAI + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits MonoidalCategory Simplicial Opposite +namespace IntervalBar.Diagram + +variable {C:Type} [Groupoid.{0} C] [MonoidalCategory C] +noncomputable def interval {n:ℕ} (i j:Fin (n+1)) (h:i≤j) : Diagram C (Fin (n+1)) ⥤ C where + obj D := D.obj i j h + map f := f.app i j h +noncomputable def pairAt {n:ℕ} (i j:Fin n) : (Fin n→C) ⥤ C where + obj X := X i ⊗ X j + map f := f i ⊗ₘ f j + map_id X := by simp + map_comp f g := by simp [tensorHom_comp_tensorHom] +lemma interval_congr {n:ℕ} {i j i' j':Fin (n+1)} {h:i≤j} {h':i'≤j'} (hi:i=i') (hj:j=j') : + interval (C:=C) i j h=interval i' j' h' := by subst i'; subst j'; rfl +noncomputable def faceEdge {n:ℕ} (k:Fin (n+2)) (j:Fin n) : (Fin (n+1)→C) ⥤ C := + if j.val+1D.cut j.castSucc.castSucc j.succ.castSucc j.succ.succ + (Fin.castSucc_le_castSucc_iff.mpr (Fin.castSucc_le_succ _)) (Fin.castSucc_le_succ _)) + (by intro D E f; exact f.cut _ _ _ _ _) + exact e ≪≫ (eqToIso he).symm +noncomputable def faceEdgeIso {n:ℕ} (k:Fin (n+2)) (j:Fin n) : + eval (C:=C) (n+1) ⋙ faceEdge k j ≅ + reindex (SimplexCategory.δ k).toOrderHom ⋙ eval n ⋙ Pi.eval _ j := by + dsimp only [faceEdge] + split_ifs with h h' + · exact (eqToIso (faceEdge_left k j h)).symm + · exact faceEdge_middle k j h' + · exact (eqToIso (faceEdge_right k j (by omega))).symm +end IntervalBar.Diagram + +end + +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits MonoidalCategory Simplicial Opposite +namespace NerveHomology +open FreeChains + +variable {C D E:Type} [Category.{0} C] [Category.{0} D] [Category.{0} E] +noncomputable abbrev map (F:C⥤D) (q:ℕ) := SSet.homologyMap (nerveMap F) Z q +lemma comp (F:C⥤D) (G:D⥤E) (q:ℕ) : map (F⋙G) q=map F q ≫ map G q := by + change SSet.homologyMap (nerveMap F ≫ nerveMap G) Z q=_ + rw [SSet.homologyMap_comp] +lemma iso {F G:C⥤D} (e:F≅G) (q:ℕ) : map F q=map G q := + (NerveHomotopy.ofNatTrans e.hom).congr_homologyMap Z q +lemma const (U:D) (q:ℕ) (hq:q≠0) : map ((Functor.const C).obj U) q=0 := by + have h : nerveMap ((Functor.const C).obj U)=SSet.const (nerveEquiv.symm U) := by ext n x; rfl + rw [map,h] + exact ConnectedProduct.const_homology_zero (X:=nerve C) (Y:=nerve D) (nerveEquiv.symm U) q hq +end NerveHomology +namespace MarkedH1 +open FreeChains ComponentTranslation IntervalBar.Diagram NerveHomology + +variable {C:Type} [Groupoid.{0} C] [MonoidalCategory C] [SymmetricCategory C] +omit [SymmetricCategory C] in +@[reassoc] lemma primitive_eval {n:ℕ} (p:Fin n→Skeleton C) (i:Fin n) : + primitive p i ≫ NerveHomology.map (eval n) 1=NerveHomology.map (wordInclude p i) 1 := by + rw [primitive_eq,←NerveHomology.comp] + exact NerveHomology.iso (Functor.isoWhiskerLeft (wordInclude p i) (eval n).asEquivalence.counitIso) 1 +omit [SymmetricCategory C] in +lemma recognition {D:Type} [Category.{0} D] {n:ℕ} (p:Fin n→Skeleton C) (i:Fin n) + (F:D⥤IntervalBar.Diagram C (Fin (n+1))) (T:D⥤Fiber (p i)) + (e:F⋙eval n≅T⋙wordInclude p i) : + NerveHomology.map F 1=NerveHomology.map T 1 ≫ primitive p i := by + have := NerveHomotopy.homologyMap_isIso (eval (C:=C) n) Z 1 + apply (cancel_mono (NerveHomology.map (eval n) 1)).mp + rw [Category.assoc,primitive_eval,←NerveHomology.comp,←NerveHomology.comp] + exact NerveHomology.iso e 1 +omit [SymmetricCategory C] in +lemma recognition_const {D:Type} [Category.{0} D] {n:ℕ} (F:D⥤IntervalBar.Diagram C (Fin (n+1))) + (U:Fin n→C) (e:F⋙eval n≅(Functor.const D).obj U) : NerveHomology.map F 1=0 := by + have := NerveHomotopy.homologyMap_isIso (eval (C:=C) n) Z 1 + apply (cancel_mono (NerveHomology.map (eval n) 1)).mp + rw [zero_comp,←NerveHomology.comp,NerveHomology.iso e 1] + exact NerveHomology.const U 1 (by decide) +noncomputable def wordDiagram_eval {n:ℕ} (p:Fin n→Skeleton C) (i:Fin n) : + wordDiagram p i ⋙ eval n ≅ wordInclude p i := + Functor.isoWhiskerLeft (wordInclude p i) (eval n).asEquivalence.counitIso +noncomputable def primitiveFace_eval {n:ℕ} (p:Fin (n+1)→Skeleton C) (i:Fin (n+1)) + (k:Fin (n+2)) (j:Fin n) : + (wordDiagram p i ⋙ reindex (SimplexCategory.δ k).toOrderHom) ⋙ eval n ⋙ Pi.eval _ j ≅ + wordInclude p i ⋙ faceEdge k j := + Functor.isoWhiskerLeft (wordDiagram p i) (faceEdgeIso k j).symm ≪≫ + Functor.isoWhiskerRight (wordDiagram_eval p i) (faceEdge k j) +noncomputable def includeProjIso {n:ℕ} (p:Fin n→Skeleton C) (i j:Fin n) : + wordInclude p i ⋙ Pi.eval _ j ≅ + (if i=j then (property (p i)).ι else (Functor.const _).obj (repr (p j))) := + eqToIso (wordInclude_proj p i j) +noncomputable def wordPair_left {n:ℕ} (p:Fin n→Skeleton C) (i j:Fin n) (h:i≠j) : + wordInclude p i ⋙ pairAt i j ≅ (property (p i)).ι ⋙ tensorRight (repr (p j)) := by + classical + change ((wordInclude p i ⋙ Pi.eval _ i).prod' (wordInclude p i ⋙ Pi.eval _ j)) ⋙ tensor C ≅ _ + rw [wordInclude_proj,wordInclude_proj,ite_eq_left rfl,ite_eq_right h] + exact NatIso.ofComponents (fun _=>Iso.refl _) (by intro X Y f; simp) +noncomputable def wordPair_right {n:ℕ} (p:Fin n→Skeleton C) (i j:Fin n) (h:i≠j) : + wordInclude p j ⋙ pairAt i j ≅ (property (p j)).ι ⋙ tensorLeft (repr (p i)) := by + classical + change ((wordInclude p j ⋙ Pi.eval _ i).prod' (wordInclude p j ⋙ Pi.eval _ j)) ⋙ tensor C ≅ _ + rw [wordInclude_proj,wordInclude_proj,ite_eq_right h.symm,ite_eq_left rfl] + exact NatIso.ofComponents (fun _=>Iso.refl _) (by intro X Y f; simp) +noncomputable def wordPair_other {n:ℕ} (p:Fin n→Skeleton C) (i j k:Fin n) (hi:k≠i) (hj:k≠j) : + wordInclude p k ⋙ pairAt i j ≅ (Functor.const _).obj (repr (p i) ⊗ repr (p j)) := by + classical + change ((wordInclude p k ⋙ Pi.eval _ i).prod' (wordInclude p k ⋙ Pi.eval _ j)) ⋙ tensor C ≅ _ + rw [wordInclude_proj,wordInclude_proj,ite_eq_right hi,ite_eq_right hj] + exact NatIso.ofComponents (fun _=>Iso.refl _) (by intro X Y f; simp) +omit [SymmetricCategory C] in +lemma face_recognition {n:ℕ} (p:Fin (n+1)→Skeleton C) (i:Fin (n+1)) (k:Fin (n+2)) + (p':Fin n→Skeleton C) (i':Fin n) (T:Fiber (p i)⥤Fiber (p' i')) + (e:∀j:Fin n,wordInclude p i ⋙ faceEdge k j ≅ (T⋙wordInclude p' i') ⋙ Pi.eval _ j) : + primitive p i ≫ NerveHomology.map (reindex (SimplexCategory.δ k).toOrderHom) 1 = + NerveHomology.map T 1 ≫ primitive p' i' := by + rw [primitive_eq,←NerveHomology.comp] + apply recognition p' i' _ T + exact NatIso.pi' (fun j=>primitiveFace_eval p i k j ≪≫ e j) +omit [SymmetricCategory C] in +lemma face_recognition_const {n:ℕ} (p:Fin (n+1)→Skeleton C) (i:Fin (n+1)) (k:Fin (n+2)) + (U:Fin n→C) + (e:∀j:Fin n,wordInclude p i ⋙ faceEdge k j ≅ (Functor.const (Fiber (p i))).obj (U j)) : + primitive p i ≫ NerveHomology.map (reindex (SimplexCategory.δ k).toOrderHom) 1 =0 := by + rw [primitive_eq,←NerveHomology.comp] + apply recognition_const _ U + exact NatIso.pi' (fun j=>primitiveFace_eval p i k j ≪≫ e j) +end MarkedH1 + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/IntervalEquivalence.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/IntervalEquivalence.lean new file mode 100644 index 0000000000000000000000000000000000000000..d32463f7a97e62146ad3955e284fc43db4b14380 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/IntervalEquivalence.lean @@ -0,0 +1,193 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.DiagonalComparison +import OAI.GroupTheory.SimpleAmenable.Simplicial.IntervalEssSurj +import OAI.GroupTheory.SimpleAmenable.Simplicial.IntervalExtension +import OAI.GroupTheory.SimpleAmenable.Simplicial.IntervalPullback + +namespace OAI + +namespace IntervalBar.Diagram + +section +open CategoryTheory MonoidalCategory +universe u v u' v' + +variable {C : Type u} [Groupoid.{v} C] [MonoidalCategory C] [SymmetricCategory C] +variable {D : Type u'} [Groupoid.{v'} D] [MonoidalCategory D] [SymmetricCategory D] +instance mapFaithful (F : C ⥤ D) [F.Monoidal] [F.Faithful] (n : ℕ) : + (map (I:=Fin (n+1)) F).Faithful where + map_injective h := by + apply Hom.ext + intro i j hij + apply F.map_injective + exact congrArg (fun f => f.app i j hij) h +noncomputable instance mapFull (F : C ⥤ D) [F.Monoidal] [F.Full] (n : ℕ) : + (map (I:=Fin (n+1)) F).Full where + map_surjective {X Y} φ := by + let f : (eval n).obj X ⟶ (eval n).obj Y := fun i => F.preimage ((eval n).map φ i) + refine ⟨extend f, ?_⟩ + apply (eval (C:=D) n).map_injective + funext i + change F.map ((extend f).app i.castSucc i.succ (Fin.castSucc_le_succ i)) = _ + rw [extend_elementary] + exact F.map_preimage _ +noncomputable instance mapIsEquivalence (F : C ⥤ D) [F.Monoidal] [F.IsEquivalence] (n : ℕ) : + (map (I:=Fin (n+1)) F).IsEquivalence where +noncomputable instance map₃IsEquivalence (F : C ⥤ D) [F.Braided] [F.IsEquivalence] (l m n : ℕ) : + (map (I:=Fin (l+1)) (map (I:=Fin (m+1)) (map (I:=Fin (n+1)) F))).IsEquivalence := + inferInstance +end + +section +open CategoryTheory MonoidalCategory SimplicialObject Simplicial Opposite + +variable {C D : Type} [Groupoid.{0} C] [MonoidalCategory C] [SymmetricCategory C] + [Groupoid.{0} D] [MonoidalCategory D] [SymmetricCategory D] +noncomputable def simplicialMap (F : C ⥤ D) [F.Monoidal] : + simplicial (C:=C) ⟶ simplicial (C:=D) where + app p := (map (I:=Fin (p.unop.len+1)) F).toCatHom + naturality _ _ f := by + apply Cat.ext + exact reindex_map F f.unop.toOrderHom +noncomputable def bar : SSet := SimplicialDiagonal.nerveDiagonal.obj (simplicial (C:=C)) +noncomputable def barMap (F : C ⥤ D) [F.Monoidal] : bar (C:=C) ⟶ bar (C:=D) := + SimplicialDiagonal.nerveDiagonal.map (simplicialMap F) +omit [SymmetricCategory C] [SymmetricCategory D] in +lemma barMap_homology_isIso (F : C ⥤ D) [F.Monoidal] [F.IsEquivalence] (n : ℕ) : + IsIso (SSet.homologyMap (barMap F) DiagonalResolution.Z n) := by + apply SimplicialDiagonal.nerveDiagonal_isIso + intro p + exact mapIsEquivalence F p.unop.len +end + +end IntervalBar.Diagram + +section +open CategoryTheory SimplicialObject Simplicial Opposite MonoidalCategory +namespace SimplicialDiagonal + +noncomputable def fromZero (X : I ⥤ SSet) : X.obj (op ⦋0⦌) ⟶ diagonal.obj X where + app n := (X.map (SimplexCategory.const n.unop ⦋0⦌ 0).op).app n + naturality n m f := by + change (X.obj (op ⦋0⦌)).map f ≫ (X.map _).app m = + (X.map _).app n ≫ ((X.map f).app n ≫ (X.obj m).map f) + rw [←Category.assoc,←NatTrans.comp_app,←X.map_comp] + have hc : (SimplexCategory.const n.unop ⦋0⦌ 0).op ≫ f = + (SimplexCategory.const m.unop ⦋0⦌ 0).op := Subsingleton.elim _ _ + rw [hc] + exact (X.map (SimplexCategory.const m.unop ⦋0⦌ 0).op).naturality f +lemma fromZero_zero (X : I ⥤ SSet) (x : (X.obj (op ⦋0⦌)).obj (op ⦋0⦌)) : + (fromZero X).app (op ⦋0⦌) x=x := by + change (X.map _).app _ x=x + rw [Subsingleton.elim (SimplexCategory.const ⦋0⦌ ⦋0⦌ 0).op (𝟙 _)] + simp +instance diagonal_connected (X : I ⥤ SSet) [(X.obj (op ⦋0⦌)).IsConnected] : + (diagonal.obj X).IsConnected where + allEq u v := by + obtain ⟨x,rfl⟩ := SSet.π₀.mk_surjective u + obtain ⟨y,rfl⟩ := SSet.π₀.mk_surjective v + have h := congrArg (SSet.mapπ₀ (fromZero X)) + (Subsingleton.elim (SSet.π₀.mk (X:=X.obj (op ⦋0⦌)) x) (SSet.π₀.mk y)) + erw [SSet.mapπ₀_mk, SSet.mapπ₀_mk, fromZero_zero, fromZero_zero] at h + exact h + nonempty := inferInstanceAs (Nonempty ((X.obj (op ⦋0⦌)).obj (op ⦋0⦌))) +end SimplicialDiagonal +namespace CategoryTheory.nerve +open scoped _root_.CategoryTheory _root_.CategoryTheory.nerve +lemma connected_of_hom {C : Type} [_root_.CategoryTheory.Category C] [Nonempty C] + (h : ∀ x y : C,Nonempty (x ⟶ y)) : (_root_.CategoryTheory.nerve C).IsConnected where + allEq u v := by + obtain ⟨x,rfl⟩ := SSet.π₀.mk_surjective u + obtain ⟨y,rfl⟩ := SSet.π₀.mk_surjective v + exact SSet.π₀.sound (_root_.CategoryTheory.nerve.homEquiv.symm (Classical.choice (h (_root_.CategoryTheory.nerveEquiv x) (_root_.CategoryTheory.nerveEquiv y)))) + nonempty := ⟨nerveEquiv.symm (Classical.arbitrary C)⟩ +end CategoryTheory.nerve +namespace IntervalBar.Diagram +variable (C : Type) [Groupoid.{0} C] [MonoidalCategory C] [SymmetricCategory C] +noncomputable instance zero_nonempty : Nonempty (Diagram C (Fin 1)) := ⟨constantUnit⟩ +noncomputable def zeroHom (X Y : Diagram C (Fin 1)) : X ⟶ Y := + (eval 0).preimage (fun i => Fin.elim0 i) +instance zero_nerve_connected : (nerve (Diagram C (Fin 1))).IsConnected := + _root_.OAI.CategoryTheory.nerve.connected_of_hom (fun X Y => ⟨zeroHom C X Y⟩) +instance bar_connected : (bar (C:=C)).IsConnected := by + let X := (((Functor.whiskeringRight SimplicialDiagonal.I Cat SSet).obj nerveFunctor).obj (simplicial (C:=C))) + have : (X.obj (op ⦋0⦌)).IsConnected := zero_nerve_connected C + exact SimplicialDiagonal.diagonal_connected X +end IntervalBar.Diagram + +end + +open _root_.CategoryTheory MonoidalCategory SimplicialObject Simplicial Opposite +namespace IntervalBar.Diagram + +variable {C : Type} [Groupoid.{0} C] [MonoidalCategory C] [SymmetricCategory C] +variable {D : Type} [Groupoid.{0} D] [MonoidalCategory D] [SymmetricCategory D] +variable {I J K : Type} [Preorder I] [Preorder J] [Preorder K] +lemma simplicialMap_reindex_id : + simplicialMap (reindex (C:=C) (OrderHom.id (α:=I)))=𝟙 _ := by + apply NatTrans.ext + funext p + apply Cat.ext + exact map_reindex_id +lemma simplicialMap_reindex_comp (f : I →o J) (g : J →o K) : + simplicialMap (reindex (C:=C) (g.comp f)) = + simplicialMap (reindex g) ≫ simplicialMap (reindex f) := by + apply NatTrans.ext + funext p + apply Cat.ext + exact map_reindex_comp f g +@[simp] lemma barMap_reindex_id : + barMap (reindex (C:=C) (OrderHom.id (α:=I)))=𝟙 _ := by + simp [barMap,simplicialMap_reindex_id,bar] +lemma barMap_reindex_comp (f : I →o J) (g : J →o K) : + barMap (reindex (C:=C) (g.comp f)) = + barMap (reindex g) ≫ barMap (reindex f) := by + simp [barMap,simplicialMap_reindex_comp] + rfl +noncomputable def rows₂ : SimplexCategoryᵒᵖ ⥤ SSet where + obj p := bar (C:=Diagram C (Fin (p.unop.len+1))) + map f := barMap (reindex f.unop.toOrderHom) + map_id _ := barMap_reindex_id + map_comp f g := barMap_reindex_comp g.unop.toOrderHom f.unop.toOrderHom +noncomputable def bar₂ : SSet := SimplicialDiagonal.diagonal.obj (rows₂ (C:=C)) +instance bar₂_connected : (bar₂ (C:=C)).IsConnected := by + have : ((rows₂ (C:=C)).obj (op ⦋0⦌)).IsConnected := bar_connected _ + exact SimplicialDiagonal.diagonal_connected (rows₂ (C:=C)) +lemma map_map_reindex (F : C ⥤ D) [F.Braided] (f : I →o J) : + map (I:=K) (map (I:=J) F) ⋙ map (reindex f) = + map (reindex f) ⋙ map (map (I:=I) F) := by + refine CategoryTheory.Functor.ext (fun A => ?_) ?_ + · refine ext_heq ?_ ?_ ?_ + · rfl + · apply heq_of_eq + funext k + apply Iso.ext + apply Hom.ext + intro i j h + change (((map F).map (A.unit k).hom ≫ Functor.OplaxMonoidal.η (map F)).app + (f i) (f j) (f.monotone h)) ≫ 𝟙 _ = + ((map F).map ((reindex f).map (A.unit k).hom ≫ Functor.OplaxMonoidal.η (reindex f)) ≫ + Functor.OplaxMonoidal.η (map F)).app i j h + erw [comp_app, map_η_app (I:=J) F, comp_app, map_η_app (I:=I) F] + change (F.map ((A.unit k).hom.app (f i) (f j) _) ≫ Functor.OplaxMonoidal.η F) ≫ 𝟙 _ = + F.map ((A.unit k).hom.app (f i) (f j) _ ≫ 𝟙 _) ≫ Functor.OplaxMonoidal.η F + erw [Category.comp_id, Category.comp_id] + · apply heq_of_eq + funext i j k hij hjk + apply Iso.ext + apply Hom.ext + intro l m h + change 𝟙 _ ≫ (Functor.LaxMonoidal.μ F _ _ ≫ F.map ((A.cut i j k hij hjk).hom.app (f l) (f m) _)) = + Functor.LaxMonoidal.μ F _ _ ≫ F.map (𝟙 _ ≫ (A.cut i j k hij hjk).hom.app (f l) (f m) _) + erw [Category.id_comp, Category.id_comp] + · intro A B g + apply Hom.ext; intro i j h + erw [comp_app, comp_app, eqToHom_app, eqToHom_app] + apply Hom.ext; intro l m hlm + erw [comp_app, comp_app, eqToHom_app, eqToHom_app] + simp only [map,reindex] + erw [Category.id_comp, Category.comp_id] + rfl +end IntervalBar.Diagram + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/IntervalEssSurj.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/IntervalEssSurj.lean new file mode 100644 index 0000000000000000000000000000000000000000..0f07a38e39c10fa8fde09cab155df5dc5fcaa466 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/IntervalEssSurj.lean @@ -0,0 +1,126 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.PolygonPositionalMonoidal +import OAI.GroupTheory.SimpleAmenable.Simplicial.IntervalExtension +import OAI.GroupTheory.SimpleAmenable.Simplicial.IntervalFunctor + +namespace OAI + +section + +section + +open CategoryTheory MonoidalCategory +universe u v u' v' +namespace IntervalBar.Diagram + +variable {C : Type u} [Groupoid.{v} C] [MonoidalCategory C] [SymmetricCategory C] +variable {D : Type u'} [Groupoid.{v'} D] [MonoidalCategory D] [SymmetricCategory D] + +noncomputable instance mapEssSurj (F : C ⥤ D) [F.Monoidal] [F.EssSurj] (n : ℕ) : + (map (I:=Fin (n+1)) F).EssSurj where + mem_essImage X := by + let Y : Fin n → C := fun i => F.objPreimage ((eval n).obj X i) + let A := (eval (C:=C) n).objPreimage Y + let e := (eval (C:=C) n).objObjPreimageIso Y + let f : (eval n).obj ((map F).obj A) ⟶ (eval n).obj X := fun i => + F.map (e.hom i) ≫ (F.objObjPreimageIso ((eval n).obj X i)).hom + exact ⟨A,⟨asIso (extend f)⟩⟩ + +noncomputable instance map₃EssSurj (F : C ⥤ D) [F.Braided] [F.EssSurj] (l m n : ℕ) : + (map (I:=Fin (l+1)) (map (I:=Fin (m+1)) (map (I:=Fin (n+1)) F))).EssSurj := + inferInstance + +end IntervalBar.Diagram + +end + +section + +open CategoryTheory MonoidalCategory +namespace SimpleAmenable.PolygonObject + +noncomputable instance positional_isIso {a : ℕ} {U V : PositionalCategory a} (f : U ⟶ V) : IsIso f := by + refine ⟨⟨⟨CategoryTheory.inv f.hom,positional_inv f.property⟩,?_,?_⟩⟩ + · apply WideSubcategory.hom_ext + exact IsIso.hom_inv_id f.hom + · apply WideSubcategory.hom_ext + exact IsIso.inv_hom_id f.hom + +noncomputable instance positional_groupoid (a : ℕ) : Groupoid (PositionalCategory a) := + Groupoid.ofIsIso (fun _ => inferInstance) + +noncomputable abbrev positionalInclusion (a : ℕ) := wideSubcategoryInclusion (positionalProperty a) + +noncomputable instance positionalInclusionMonoidal (a : ℕ) : (positionalInclusion a).Monoidal := + Functor.CoreMonoidal.toMonoidal { + εIso := Iso.refl _ + μIso _ _ := Iso.refl _ + μIso_hom_natural_left := by intros; simp + μIso_hom_natural_right := by intros; simp + associativity := by intros; simp + left_unitality := by intros; simp + right_unitality := by intros; simp } + +noncomputable instance positionalInclusionBraided (a : ℕ) : (positionalInclusion a).Braided where + braided _ _ := by simp; rfl + +instance positionalInclusionEssSurj (a : ℕ) : (positionalInclusion a).EssSurj where + mem_essImage U := ⟨⟨U⟩,⟨Iso.refl U⟩⟩ + +open IntervalBar IntervalBar.Diagram + +abbrev TripleBars (C : Type) [Groupoid.{0} C] [MonoidalCategory C] [SymmetricCategory C] + (l m n : ℕ) := Diagram (Diagram (Diagram C (Fin (n+1))) (Fin (m+1))) (Fin (l+1)) + +noncomputable def positionalOneBarMap (a n : ℕ) : + Diagram (PositionalCategory a) (Fin (n+1)) ⥤ Diagram (PolygonObject a) (Fin (n+1)) := + Diagram.map (positionalInclusion a) + +noncomputable instance positionalOneBarBraided (a n : ℕ) : (positionalOneBarMap a n).Braided := + Diagram.mapBraided (positionalInclusion a) + +noncomputable instance positionalOneBarEssSurj (a n : ℕ) : (positionalOneBarMap a n).EssSurj := + Diagram.mapEssSurj (positionalInclusion a) n + +noncomputable def positionalTwoBarMap (a m n : ℕ) : + Diagram (Diagram (PositionalCategory a) (Fin (n+1))) (Fin (m+1)) ⥤ + Diagram (Diagram (PolygonObject a) (Fin (n+1))) (Fin (m+1)) := + Diagram.map (positionalOneBarMap a n) + +noncomputable instance positionalTwoBarBraided (a m n : ℕ) : (positionalTwoBarMap a m n).Braided := + Diagram.mapBraided (positionalOneBarMap a n) + +noncomputable instance positionalTwoBarEssSurj (a m n : ℕ) : (positionalTwoBarMap a m n).EssSurj := + Diagram.mapEssSurj (positionalOneBarMap a n) m + +noncomputable def positionalBarMap (a l m n : ℕ) : + TripleBars (PositionalCategory a) l m n ⥤ TripleBars (PolygonObject a) l m n := + Diagram.map (positionalTwoBarMap a m n) + +noncomputable instance positionalBarMapEssSurj (a l m n : ℕ) : + (positionalBarMap a l m n).EssSurj := Diagram.mapEssSurj (positionalTwoBarMap a m n) l + +abbrev PositionalBars (a l m n : ℕ) := + InducedCategory (TripleBars (PolygonObject a) l m n) (positionalBarMap a l m n).obj + +noncomputable def positionalBarInclusion (a l m n : ℕ) : + PositionalBars a l m n ⥤ TripleBars (PolygonObject a) l m n := + inducedFunctor (positionalBarMap a l m n).obj + +noncomputable instance positionalBarInclusionEssSurj (a l m n : ℕ) : + (positionalBarInclusion a l m n).EssSurj where + mem_essImage X := ⟨(positionalBarMap a l m n).objPreimage X, + ⟨(positionalBarMap a l m n).objObjPreimageIso X⟩⟩ + +noncomputable instance positionalBarInclusionEquivalence (a l m n : ℕ) : + (positionalBarInclusion a l m n).IsEquivalence where + full := inferInstanceAs (inducedFunctor _).Full + faithful := inferInstanceAs (inducedFunctor _).Faithful + +end SimpleAmenable.PolygonObject + +end + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/IntervalExtension.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/IntervalExtension.lean new file mode 100644 index 0000000000000000000000000000000000000000..b3365370973689cf9468039e5c60635211bfe082 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/IntervalExtension.lean @@ -0,0 +1,177 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.IntervalBar + +namespace OAI + +section + +section + +open CategoryTheory MonoidalCategory +universe u v w +namespace IntervalBar.Diagram + +variable {C : Type u} [Groupoid.{v} C] [MonoidalCategory C] +variable {I : Type w} [Preorder I] + +lemma cut_propagate (D E : Diagram C I) (i j k l : I) + (hij : i≤j) (hjk : j≤k) (hkl : k≤l) + (x : D.obj i j hij ⟶ E.obj i j hij) + (y : D.obj j k hjk ⟶ E.obj j k hjk) + (z : D.obj k l hkl ⟶ E.obj k l hkl) + (xy : D.obj i k (hij.trans hjk) ⟶ E.obj i k (hij.trans hjk)) + (yz : D.obj j l (hjk.trans hkl) ⟶ E.obj j l (hjk.trans hkl)) + (xyz : D.obj i l (hij.trans (hjk.trans hkl)) ⟶ E.obj i l (hij.trans (hjk.trans hkl))) + (hxy : (x⊗ₘy) ≫ (E.cut i j k hij hjk).hom = (D.cut i j k hij hjk).hom ≫ xy) + (hyz : (y⊗ₘz) ≫ (E.cut j k l hjk hkl).hom = (D.cut j k l hjk hkl).hom ≫ yz) + (hxyz : (xy⊗ₘz) ≫ (E.cut i k l (hij.trans hjk) hkl).hom = + (D.cut i k l (hij.trans hjk) hkl).hom ≫ xyz) : + (x⊗ₘyz) ≫ (E.cut i j l hij (hjk.trans hkl)).hom = + (D.cut i j l hij (hjk.trans hkl)).hom ≫ xyz := by + apply (cancel_epi ((α_ (D.obj i j hij) (D.obj j k hjk) (D.obj k l hkl)).hom ≫ + (𝟙 _ ⊗ₘ (D.cut j k l hjk hkl).hom))).mp + calc + _ = (α_ _ _ _).hom ≫ (x⊗ₘ((D.cut j k l hjk hkl).hom≫yz)) ≫ + (E.cut i j l hij (hjk.trans hkl)).hom := by + simp only [Category.assoc,tensorHom_comp_tensorHom_assoc,Category.id_comp] + _ = (α_ _ _ _).hom ≫ (x⊗ₘ((y⊗ₘz)≫(E.cut j k l hjk hkl).hom)) ≫ + (E.cut i j l hij (hjk.trans hkl)).hom := by rw [hyz] + _ = (α_ _ _ _).hom ≫ (x⊗ₘ(y⊗ₘz)) ≫ (𝟙 _ ⊗ₘ (E.cut j k l hjk hkl).hom) ≫ + (E.cut i j l hij (hjk.trans hkl)).hom := by + simp only [tensorHom_comp_tensorHom_assoc,Category.comp_id] + _ = ((x⊗ₘy)⊗ₘz) ≫ (α_ _ _ _).hom ≫ (𝟙 _ ⊗ₘ (E.cut j k l hjk hkl).hom) ≫ + (E.cut i j l hij (hjk.trans hkl)).hom := by rw [associator_naturality_assoc] + _ = ((x⊗ₘy)⊗ₘz) ≫ ((E.cut i j k hij hjk).hom ⊗ₘ 𝟙 _) ≫ + (E.cut i k l (hij.trans hjk) hkl).hom := by + rw [id_tensorHom,←E.associativity,tensorHom_id] + _ = (((x⊗ₘy)≫(E.cut i j k hij hjk).hom)⊗ₘz) ≫ + (E.cut i k l (hij.trans hjk) hkl).hom := by + simp only [tensorHom_comp_tensorHom_assoc,Category.comp_id] + _ = (((D.cut i j k hij hjk).hom≫xy)⊗ₘz) ≫ + (E.cut i k l (hij.trans hjk) hkl).hom := by rw [hxy] + _ = ((D.cut i j k hij hjk).hom⊗ₘ𝟙 _) ≫ (xy⊗ₘz) ≫ + (E.cut i k l (hij.trans hjk) hkl).hom := by + simp only [tensorHom_comp_tensorHom_assoc,Category.id_comp] + _ = ((D.cut i j k hij hjk).hom⊗ₘ𝟙 _) ≫ (D.cut i k l (hij.trans hjk) hkl).hom ≫ xyz := by rw [hxyz] + _ = _ := by rw [tensorHom_id,←Category.assoc,D.associativity]; simp only [Category.assoc,id_tensorHom] + +variable {n : ℕ} {D E : Diagram C (Fin (n+1))} + +noncomputable def extendApp + (f : ∀j : Fin n, D.obj j.castSucc j.succ (Fin.castSucc_le_succ j) ⟶ + E.obj j.castSucc j.succ (Fin.castSucc_le_succ j)) : + ∀i j (hij : i≤j), D.obj i j hij ⟶ E.obj i j hij := fun i j hij => + (Fin.induction + (motive := fun j => ∀i (h : i≤j), D.obj i j h ⟶ E.obj i j h) + (fun i hi => by + have he : i=0 := Fin.eq_of_val_eq (by simpa using hi) + subst i + exact (D.unit 0).hom ≫ (E.unit 0).inv) + (fun k prev i hi => by + by_cases he : i=k.succ + · subst i + exact (D.unit k.succ).hom ≫ (E.unit k.succ).inv + · have hik : i≤k.castSucc := by + simp only [Fin.le_def,Fin.ext_iff,Fin.val_succ,Fin.val_castSucc] at * + omega + exact (D.cut i k.castSucc k.succ hik (Fin.castSucc_le_succ k)).inv ≫ + (prev i hik ⊗ₘ f k) ≫ (E.cut i k.castSucc k.succ hik (Fin.castSucc_le_succ k)).hom) + j) i hij + +@[simp] lemma extendApp_self (f : ∀j : Fin n, D.obj j.castSucc j.succ (Fin.castSucc_le_succ j) ⟶ + E.obj j.castSucc j.succ (Fin.castSucc_le_succ j)) (i : Fin (n+1)) : + extendApp f i i le_rfl = (D.unit i).hom ≫ (E.unit i).inv := by + induction i using Fin.induction with + | zero => rfl + | succ j ih => simp [extendApp,Fin.induction_succ] + +lemma extendApp_succ (f : ∀j : Fin n, D.obj j.castSucc j.succ (Fin.castSucc_le_succ j) ⟶ + E.obj j.castSucc j.succ (Fin.castSucc_le_succ j)) + (i : Fin (n+1)) (k : Fin n) (hik : i≤k.castSucc) : + extendApp f i k.succ (hik.trans (Fin.castSucc_le_succ k)) = + (D.cut i k.castSucc k.succ hik (Fin.castSucc_le_succ k)).inv ≫ + (extendApp f i k.castSucc hik ⊗ₘ f k) ≫ + (E.cut i k.castSucc k.succ hik (Fin.castSucc_le_succ k)).hom := by + have he : i≠k.succ := by + intro he + have hh := congrArg Fin.val he + simp only [Fin.val_succ] at hh + have hi : i.val≤k.val := hik + omega + simp only [extendApp,Fin.induction_succ,dite_eq_right he] + +lemma extendApp_succ_square + (f : ∀j : Fin n, D.obj j.castSucc j.succ (Fin.castSucc_le_succ j) ⟶ + E.obj j.castSucc j.succ (Fin.castSucc_le_succ j)) + (i : Fin (n+1)) (k : Fin n) (hik : i≤k.castSucc) : + (extendApp f i k.castSucc hik ⊗ₘ f k) ≫ + (E.cut i k.castSucc k.succ hik (Fin.castSucc_le_succ k)).hom = + (D.cut i k.castSucc k.succ hik (Fin.castSucc_le_succ k)).hom ≫ + extendApp f i k.succ (hik.trans (Fin.castSucc_le_succ k)) := by + rw [extendApp_succ f i k hik] + simp + +lemma unit_left_square (D E : Diagram C I) (i j : I) (hij : i≤j) + (f : D.obj i j hij ⟶ E.obj i j hij) : + (((D.unit i).hom ≫ (E.unit i).inv)⊗ₘf) ≫ (E.cut i i j le_rfl hij).hom = + (D.cut i i j le_rfl hij).hom ≫ f := by + rw [D.left_unit,E.left_unit,tensorHom_comp_whiskerRight_assoc] + simp only [Category.assoc,Iso.inv_hom_id,Category.comp_id] + rw [MonoidalCategory.tensorHom_def,Category.assoc,leftUnitor_naturality] + +lemma unit_right_square (D E : Diagram C I) (i j : I) (hij : i≤j) + (f : D.obj i j hij ⟶ E.obj i j hij) : + (f⊗ₘ((D.unit j).hom ≫ (E.unit j).inv)) ≫ (E.cut i j j hij le_rfl).hom = + (D.cut i j j hij le_rfl).hom ≫ f := by + rw [D.right_unit,E.right_unit,tensorHom_comp_whiskerLeft_assoc] + simp only [Category.assoc,Iso.inv_hom_id,Category.comp_id] + rw [MonoidalCategory.tensorHom_def',Category.assoc,rightUnitor_naturality] + +lemma extendApp_cut + (f : ∀j : Fin n, D.obj j.castSucc j.succ (Fin.castSucc_le_succ j) ⟶ + E.obj j.castSucc j.succ (Fin.castSucc_le_succ j)) : + ∀k (j i : Fin (n+1)) (hij : i≤j) (hjk : j≤k), + (extendApp f i j hij ⊗ₘ extendApp f j k hjk) ≫ (E.cut i j k hij hjk).hom = + (D.cut i j k hij hjk).hom ≫ extendApp f i k (hij.trans hjk) := by + apply Fin.induction + · intro j i hij hjk + have hj : j=0 := Fin.eq_of_val_eq (by simpa using hjk) + subst j + rw [extendApp_self] + exact unit_right_square D E i 0 hij (extendApp f i 0 hij) + · intro k ih j i hij hjk + by_cases he : j=k.succ + · subst j + rw [extendApp_self] + exact unit_right_square D E i k.succ hij (extendApp f i k.succ hij) + · have hj : j≤k.castSucc := by + simp only [Fin.le_def,Fin.ext_iff,Fin.val_succ,Fin.val_castSucc] at * + omega + exact cut_propagate D E i j k.castSucc k.succ hij hj (Fin.castSucc_le_succ k) + (extendApp f i j hij) (extendApp f j k.castSucc hj) (f k) + (extendApp f i k.castSucc (hij.trans hj)) (extendApp f j k.succ hjk) + (extendApp f i k.succ (hij.trans hjk)) (ih j i hij hj) + (extendApp_succ_square f j k hj) (extendApp_succ_square f i k (hij.trans hj)) + +noncomputable def extend (f : (eval n).obj D ⟶ (eval n).obj E) : D ⟶ E where + app := extendApp f + unit i := by rw [extendApp_self f i]; simp + cut i j k hij hjk := extendApp_cut f k j i hij hjk + +lemma extend_elementary (f : (eval n).obj D ⟶ (eval n).obj E) (i : Fin n) : + (extend f).app i.castSucc i.succ (Fin.castSucc_le_succ i) = f i := by + change extendApp f i.castSucc i.succ _ = f i + apply (cancel_epi (D.cut i.castSucc i.castSucc i.succ le_rfl (Fin.castSucc_le_succ i)).hom).mp + rw [←extendApp_succ_square f i.castSucc i le_rfl,extendApp_self f i.castSucc] + exact unit_left_square D E i.castSucc i.succ (Fin.castSucc_le_succ i) (f i) + +noncomputable instance : (eval (C:=C) n).Full where + map_surjective f := ⟨extend f,by funext i; exact extend_elementary f i⟩ + +end IntervalBar.Diagram + +end + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/IntervalFunctor.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/IntervalFunctor.lean new file mode 100644 index 0000000000000000000000000000000000000000..8dd0ba38fd07788cb86d7f137677aca0d54ba40b --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/IntervalFunctor.lean @@ -0,0 +1,213 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.IntervalTensor + +namespace OAI + +section + +open CategoryTheory MonoidalCategory BraidedCategory +open Functor.LaxMonoidal Functor.OplaxMonoidal +universe u v u' v' w +namespace IntervalBar.Diagram + +variable {C : Type u} [Groupoid.{v} C] [MonoidalCategory C] [SymmetricCategory C] +variable {D : Type u'} [Groupoid.{v'} D] [MonoidalCategory D] [SymmetricCategory D] +variable {I : Type w} [Preorder I] +noncomputable instance reindexMonoidal {J : Type w} [Preorder J] (f : I →o J) : + (reindex (C:=C) f).Monoidal := Functor.CoreMonoidal.toMonoidal { + εIso := Iso.refl _ + μIso A B := Iso.refl _ + μIso_hom_natural_left := by + intro X Y g X' + apply Hom.ext + intro i j h + have hf : f i ≤ f j := f.monotone h + change (g.app (f i) (f j) hf ⊗ₘ 𝟙 (X'.obj (f i) (f j) hf)) ≫ 𝟙 _ = + 𝟙 _ ≫ (g.app (f i) (f j) hf ⊗ₘ 𝟙 (X'.obj (f i) (f j) hf)) + simp + μIso_hom_natural_right := by + intro X Y X' g + apply Hom.ext + intro i j h + have hf : f i ≤ f j := f.monotone h + change (𝟙 (X'.obj (f i) (f j) hf) ⊗ₘ g.app (f i) (f j) hf) ≫ 𝟙 _ = + 𝟙 _ ≫ (𝟙 (X'.obj (f i) (f j) hf) ⊗ₘ g.app (f i) (f j) hf) + simp + associativity := by + intro X Y Z + apply Hom.ext + intro i j h + have hf : f i ≤ f j := f.monotone h + let x := X.obj (f i) (f j) hf + let y := Y.obj (f i) (f j) hf + let z := Z.obj (f i) (f j) hf + change (𝟙 (x ⊗ y) ⊗ₘ 𝟙 z) ≫ 𝟙 _ ≫ (α_ x y z).hom = + (α_ x y z).hom ≫ (𝟙 x ⊗ₘ 𝟙 (y ⊗ z)) ≫ 𝟙 _ + simp + left_unitality := by + intro X + apply Hom.ext + intro i j h + have hf : f i ≤ f j := f.monotone h + let x := X.obj (f i) (f j) hf + change (λ_ x).hom = (𝟙 (𝟙_ C) ⊗ₘ 𝟙 x) ≫ 𝟙 _ ≫ (λ_ x).hom + simp + right_unitality := by + intro X + apply Hom.ext + intro i j h + have hf : f i ≤ f j := f.monotone h + let x := X.obj (f i) (f j) hf + change (ρ_ x).hom = (𝟙 x ⊗ₘ 𝟙 (𝟙_ C)) ≫ 𝟙 _ ≫ (ρ_ x).hom + simp } + + +noncomputable def mapεHom (F : C ⥤ D) [F.Monoidal] : + (𝟙_ (Diagram D I)) ⟶ (map F).obj (𝟙_ (Diagram C I)) where + app _ _ _ := ε F + unit i := by + change ε F ≫ (F.map (𝟙 _) ≫ η F) = 𝟙 _ + simp + cut i j k hij hjk := by + change (ε F ⊗ₘ ε F) ≫ (μ F _ _ ≫ F.map (λ_ _).hom) = (λ_ _).hom ≫ ε F + rw [←Category.assoc,ε_tensorHom_comp_μ] + simp + +noncomputable def mapμHom (F : C ⥤ D) [F.Braided] + (A B : Diagram C I) : (map F).obj A ⊗ (map F).obj B ⟶ (map F).obj (A⊗B) where + app i j h := μ F (A.obj i j h) (B.obj i j h) + unit i := by + change μ F _ _ ≫ (F.map (((A.unit i).hom ⊗ₘ (B.unit i).hom) ≫ (λ_ _).hom) ≫ η F) = + ((F.map (A.unit i).hom ≫ η F) ⊗ₘ (F.map (B.unit i).hom ≫ η F)) ≫ (λ_ _).hom + rw [F.map_comp] + simp only [Category.assoc] + rw [←μ_natural_assoc,Functor.Monoidal.map_leftUnitor] + simp only [Category.assoc,Functor.Monoidal.μ_δ_assoc] + rw [←leftUnitor_naturality,←tensorHom_comp_tensorHom] + simp [MonoidalCategory.tensorHom_def] + cut i j k hij hjk := by + change (μ F _ _ ⊗ₘ μ F _ _) ≫ (μ F _ _ ≫ F.map + (tensorμ _ _ _ _ ≫ ((A.cut i j k hij hjk).hom ⊗ₘ (B.cut i j k hij hjk).hom))) = + (tensorμ _ _ _ _ ≫ ((μ F _ _ ≫ F.map (A.cut i j k hij hjk).hom) ⊗ₘ + (μ F _ _ ≫ F.map (B.cut i j k hij hjk).hom))) ≫ μ F _ _ + simp only [F.map_comp,←tensorHom_comp_tensorHom,Category.assoc] + rw [←tensorμ_comp_μ_tensorHom_μ_comp_μ_assoc,←μ_natural] + +noncomputable instance mapMonoidal (F : C ⥤ D) [F.Braided] : + (map (I:=I) F).Monoidal := Functor.CoreMonoidal.toMonoidal { + εIso := asIso (mapεHom F) + μIso A B := asIso (mapμHom F A B) + μIso_hom_natural_left := by + intros; apply Hom.ext; intro i j h + simp [map,mapObj,mapμHom] + μIso_hom_natural_right := by + intros; apply Hom.ext; intro i j h + simp [map,mapObj,mapμHom] + associativity := by + intros; apply Hom.ext; intro i j h + simp [map,mapObj,mapμHom] + left_unitality := by + intros; apply Hom.ext; intro i j h + simp [map,mapObj,mapμHom,mapεHom] + right_unitality := by + intros; apply Hom.ext; intro i j h + simp [map,mapObj,mapμHom,mapεHom] } + +noncomputable instance reindexBraided {J : Type w} [Preorder J] (f : I →o J) : + (reindex (C:=C) f).Braided where + braided A B := by + apply Hom.ext; intro i j h + change 𝟙 _ ≫ (β_ _ _).hom = (β_ _ _).hom ≫ 𝟙 _ + simp + +noncomputable instance mapBraided (F : C ⥤ D) [F.Braided] : (map (I:=I) F).Braided where + braided A B := by + apply Hom.ext; intro i j h + change μ F _ _ ≫ F.map (β_ _ _).hom = (β_ _ _).hom ≫ μ F _ _ + exact Functor.LaxBraided.braided (F:=F) _ _ + +noncomputable instance evalBraided (n : ℕ) : (eval (C:=C) n).Braided where + braided A B := by + funext i + change 𝟙 _ ≫ (β_ _ _).hom = (β_ _ _).hom ≫ 𝟙 _ + simp + +end IntervalBar.Diagram + +end + +open CategoryTheory MonoidalCategory BraidedCategory +open Functor.LaxMonoidal Functor.OplaxMonoidal +universe u v u' v' u'' v'' w +namespace IntervalBar.Diagram + +variable {C : Type u} [Groupoid.{v} C] [MonoidalCategory C] +variable {D : Type u'} [Groupoid.{v'} D] [MonoidalCategory D] +variable {E : Type u''} [Groupoid.{v''} E] [MonoidalCategory E] +variable {I : Type w} [Preorder I] + +lemma ext_heq {A B : Diagram C I} (hobj : A.obj=B.obj) + (hunit : HEq A.unit B.unit) (hcut : HEq A.cut B.cut) : A=B := by + cases A; cases B; cases hobj; cases hunit; cases hcut; rfl + +@[simp] lemma eqToHom_app {A B : Diagram C I} (h : A=B) (i j : I) (hij : i≤j) : + (eqToHom h).app i j hij=eqToHom (congrArg (fun X : Diagram C I => X.obj i j hij) h) := by + cases h; rfl + +@[simp] lemma mapObj_id (A : Diagram C I) : mapObj (𝟭 C) A=A := by + refine ext_heq ?_ ?_ ?_ + · rfl + · apply heq_of_eq + funext i + apply Iso.ext + simp [mapObj] + · apply heq_of_eq + funext i j k hij hjk + apply Iso.ext + simp [mapObj] +@[simp] lemma map_id : map (I:=I) (𝟭 C)=𝟭 _ := by + refine CategoryTheory.Functor.ext (fun A => mapObj_id A) ?_ + intro A B f + apply Hom.ext; intro i j h + erw [comp_app, comp_app, eqToHom_app, eqToHom_app] + simp [map] + change f.app i j h = 𝟙 _ ≫ f.app i j h ≫ 𝟙 _ + simp + +@[simp] lemma mapObj_comp (F : C ⥤ D) (G : D ⥤ E) [F.Monoidal] [G.Monoidal] + (A : Diagram C I) : mapObj (F⋙G) A=mapObj G (mapObj F A) := by + refine ext_heq ?_ ?_ ?_ + · rfl + · apply heq_of_eq + funext i + apply Iso.ext + simp [mapObj] + · apply heq_of_eq + funext i j k hij hjk + apply Iso.ext + simp [mapObj,Category.assoc] +@[simp] lemma map_comp (F : C ⥤ D) (G : D ⥤ E) [F.Monoidal] [G.Monoidal] : + map (I:=I) (F⋙G)=map F ⋙ map G := by + refine CategoryTheory.Functor.ext (fun A => mapObj_comp F G A) ?_ + intro A B f + apply Hom.ext; intro i j h + erw [comp_app, comp_app, eqToHom_app, eqToHom_app] + simp [map] + change G.map (F.map (f.app i j h)) = + 𝟙 _ ≫ G.map (F.map (f.app i j h)) ≫ 𝟙 _ + simp + +variable {J : Type w} [Preorder J] +@[simp] lemma reindex_map (F : C ⥤ D) [F.Monoidal] (f : I →o J) : + reindex (C:=C) f ⋙ map F = map F ⋙ reindex f := by + refine CategoryTheory.Functor.ext (fun _ => rfl) ?_ + intro A B g + apply Hom.ext + intro i j h + change F.map (g.app (f i) (f j) (f.monotone h)) = + 𝟙 _ ≫ F.map (g.app (f i) (f j) (f.monotone h)) ≫ 𝟙 _ + simp + +end IntervalBar.Diagram + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/IntervalMap.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/IntervalMap.lean new file mode 100644 index 0000000000000000000000000000000000000000..88ffba1d427043efea18c416c5ceaaf5dcf6ed14 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/IntervalMap.lean @@ -0,0 +1,203 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.IntervalBar + +namespace OAI + +section + +section + +open CategoryTheory MonoidalCategory Functor.LaxMonoidal Functor.OplaxMonoidal +universe u v u' v' w +namespace IntervalBar.Diagram + +variable {C : Type u} [Groupoid.{v} C] [MonoidalCategory C] +variable {D : Type u'} [Groupoid.{v'} D] [MonoidalCategory D] +variable {I : Type w} [Preorder I] + +noncomputable def mapObj (F : C ⥤ D) [F.Monoidal] (A : Diagram C I) : Diagram D I where + obj i j h := F.obj (A.obj i j h) + unit i := F.mapIso (A.unit i) ≪≫ (Functor.Monoidal.εIso F).symm + cut i j k hij hjk := Functor.Monoidal.μIso F _ _ ≪≫ F.mapIso (A.cut i j k hij hjk) + left_unit i j h := by + simp only [Iso.trans_hom,Functor.mapIso_hom,Functor.Monoidal.μIso_hom, + Iso.symm_hom,Functor.Monoidal.εIso_inv] + rw [A.left_unit,Functor.map_comp,Functor.Monoidal.map_whiskerRight, + Functor.Monoidal.map_leftUnitor] + simp only [Category.assoc,Functor.Monoidal.μ_δ_assoc,comp_whiskerRight] + right_unit i j h := by + simp only [Iso.trans_hom,Functor.mapIso_hom,Functor.Monoidal.μIso_hom, + Iso.symm_hom,Functor.Monoidal.εIso_inv] + rw [A.right_unit,Functor.map_comp,Functor.Monoidal.map_whiskerLeft, + Functor.Monoidal.map_rightUnitor] + simp only [Category.assoc,Functor.Monoidal.μ_δ_assoc,whiskerLeft_comp] + associativity i j k l hij hjk hkl := by + simp only [Iso.trans_hom,Functor.mapIso_hom,Functor.Monoidal.μIso_hom] + simp only [comp_whiskerRight,whiskerLeft_comp,Category.assoc] + rw [μ_natural_left_assoc,←F.map_comp, A.associativity] + simp only [Functor.map_comp] + rw [Functor.LaxMonoidal.associativity_assoc, μ_natural_right_assoc] + +noncomputable def map (F : C ⥤ D) [F.Monoidal] : Diagram C I ⥤ Diagram D I where + obj := mapObj F + map f := { + app i j h := F.map (f.app i j h) + unit i := by + simp only [mapObj,Iso.trans_hom,Functor.mapIso_hom,Iso.symm_hom,Functor.Monoidal.εIso_inv] + rw [←Category.assoc,←F.map_comp,f.unit] + cut i j k hij hjk := by + simp only [mapObj,Iso.trans_hom,Functor.mapIso_hom,Functor.Monoidal.μIso_hom] + rw [μ_natural_assoc,←F.map_comp,f.cut,F.map_comp,Category.assoc] } + map_id A := by apply Hom.ext; intro i j h; exact F.map_id _ + map_comp f g := by apply Hom.ext; intro i j h; exact F.map_comp _ _ + +noncomputable def pair (A : Diagram C I) (B : Diagram D I) : Diagram (C×D) I where + obj i j h := (A.obj i j h,B.obj i j h) + unit i := (A.unit i).prod (B.unit i) + cut i j k hij hjk := (A.cut i j k hij hjk).prod (B.cut i j k hij hjk) + left_unit i j h := by ext; exacts [A.left_unit i j h,B.left_unit i j h] + right_unit i j h := by ext; exacts [A.right_unit i j h,B.right_unit i j h] + associativity i j k l hij hjk hkl := by + ext; exacts [A.associativity i j k l hij hjk hkl,B.associativity i j k l hij hjk hkl] + +noncomputable def pairHom {A A' : Diagram C I} {B B' : Diagram D I} + (f : A ⟶ A') (g : B ⟶ B') : pair A B ⟶ pair A' B' where + app i j h := (f.app i j h,g.app i j h) + unit i := by ext; exacts [f.unit i,g.unit i] + cut i j k hij hjk := by ext; exacts [f.cut i j k hij hjk,g.cut i j k hij hjk] + +noncomputable def constantUnit : Diagram C I where + obj _ _ _ := 𝟙_ C + unit _ := Iso.refl _ + cut _ _ _ _ _ := λ_ _ + left_unit _ _ _ := by simp + right_unit _ _ _ := by simp; exact unitors_equal + associativity _ _ _ _ _ _ _ := by monoidal + +end IntervalBar.Diagram + +end + +section +open CategoryTheory MonoidalCategory BraidedCategory +universe u v +namespace IntervalBar +variable {C : Type u} [Category.{v} C] [MonoidalCategory C] [SymmetricCategory C] + +lemma tensorμ_braiding (W X Y Z : C) : + ((β_ W X).hom ⊗ₘ (β_ Y Z).hom) ≫ tensorμ X W Z Y = + tensorμ W X Y Z ≫ (β_ (W⊗Y) (X⊗Z)).hom := by + simp [tensorμ, SymmetricCategory.braiding_swap_eq_inv_braiding Y X, + MonoidalCategory.tensorHom_def] +end IntervalBar + +end + +section + +open CategoryTheory MonoidalCategory +universe u v w +namespace IntervalBar +namespace Normal + +variable {A : Type u} +open FreeMonoidalCategory + +def fold : List A → FreeMonoidalCategory A + | [] => .unit + | a::l => .tensor (.of a) (fold l) + +def appendIso : ∀ l r : List A, fold l ⊗ fold r ≅ fold (l++r) + | [],_ => λ_ _ + | a::l,r => (α_ _ _ _ ) ≪≫ (whiskerLeftIso (.of a) (appendIso l r)) + +lemma segment_append (l : List A) (i j k : ℕ) (hij : i≤j) (hjk : j≤k) : + (l.drop i).take (j-i) ++ (l.drop j).take (k-j) = (l.drop i).take (k-i) := by + have hji : j=i+(j-i) := by omega + have hki : k-i=(j-i)+(k-j) := by omega + rw [hki,List.take_add,List.drop_drop,←hji] + +def segment (l : List A) (i j : ℕ) : List A := (l.drop i).take (j-i) +@[simp] lemma segment_self (l : List A) (i : ℕ) : segment l i i=[] := by + simp [segment] + +def diagram {n : ℕ} (l : List A) : Diagram (FreeMonoidalCategory A) (Fin (n+1)) where + obj i j _ := fold (segment l i.val j.val) + unit i := eqToIso (by simp [fold]) + cut i j k hij hjk := appendIso _ _ ≪≫ eqToIso (congrArg fold (segment_append l i j k hij hjk)) + left_unit _ _ _ := Subsingleton.elim _ _ + right_unit _ _ _ := Subsingleton.elim _ _ + associativity _ _ _ _ _ _ _ := Subsingleton.elim _ _ + +variable {C : Type v} [Groupoid.{w} C] [MonoidalCategory C] + +@[simp] lemma project_whiskerLeft (f : A → C) (X : FreeMonoidalCategory A) + {Y Z : FreeMonoidalCategory A} (h : Y ⟶ Z) : + (project f).map (X ◁ h) = (project f).obj X ◁ (project f).map h := by + induction h using Quotient.inductionOn with | h h => rfl +@[simp] lemma project_whiskerRight (f : A → C) {Y Z : FreeMonoidalCategory A} + (h : Y ⟶ Z) (X : FreeMonoidalCategory A) : + (project f).map (h ▷ X) = (project f).map h ▷ (project f).obj X := by + induction h using Quotient.inductionOn with | h h => rfl + +@[simp] lemma project_leftUnitor (f : A → C) (X : FreeMonoidalCategory A) : + (project f).map (λ_ X).hom = (λ_ ((project f).obj X)).hom := rfl +@[simp] lemma project_rightUnitor (f : A → C) (X : FreeMonoidalCategory A) : + (project f).map (ρ_ X).hom = (ρ_ ((project f).obj X)).hom := rfl +@[simp] lemma project_associator (f : A → C) (X Y Z : FreeMonoidalCategory A) : + (project f).map (α_ X Y Z).hom = + (α_ ((project f).obj X) ((project f).obj Y) ((project f).obj Z)).hom := rfl + +variable {I : Type u} [Preorder I] +def projectDiagram (f : A → C) (D : Diagram (FreeMonoidalCategory A) I) : Diagram C I where + obj i j h := (project f).obj (D.obj i j h) + unit i := (project f).mapIso (D.unit i) + cut i j k hij hjk := (project f).mapIso (D.cut i j k hij hjk) + left_unit i j h := by + have he := congrArg ((project f).map) (D.left_unit i j h) + simp only [Functor.map_comp,project_whiskerRight,project_leftUnitor] at he + exact he + right_unit i j h := by + have he := congrArg ((project f).map) (D.right_unit i j h) + simp only [Functor.map_comp,project_whiskerLeft,project_rightUnitor] at he + exact he + associativity i j k l hij hjk hkl := by + have he := congrArg ((project f).map) (D.associativity i j k l hij hjk hkl) + simp only [Functor.map_comp,project_whiskerLeft,project_whiskerRight,project_associator] at he + exact he + +lemma segment_finRange {n : ℕ} (i : Fin n) : + segment (List.finRange n) i.val (i.val+1) = [i] := by + simp only [segment,Nat.add_sub_cancel_left] + rw [List.take_one_drop_eq_of_lt_length (by simp)] + congr 1 + apply Fin.ext + simp + +noncomputable def elementaryDiagram {n : ℕ} (f : Fin n → C) : Diagram C (Fin (n+1)) := + projectDiagram f (diagram (List.finRange n)) + +noncomputable def elementaryIso {n : ℕ} (f : Fin n → C) : + (Diagram.eval n).obj (elementaryDiagram f) ≅ f where + hom i := (eqToIso (by + change (project f).obj (fold (segment (List.finRange n) i.val (i.val+1))) = _ + rw [segment_finRange] + rfl) ≪≫ ρ_ (f i)).hom + inv i := (eqToIso (by + change (project f).obj (fold (segment (List.finRange n) i.val (i.val+1))) = _ + rw [segment_finRange] + rfl) ≪≫ ρ_ (f i)).inv + hom_inv_id := by funext i; exact Iso.hom_inv_id _ + inv_hom_id := by funext i; exact Iso.inv_hom_id _ + +noncomputable instance {n : ℕ} : (Diagram.eval (C:=C) n).EssSurj where + mem_essImage f := ⟨elementaryDiagram f,⟨elementaryIso f⟩⟩ + +end Normal +end IntervalBar + +end + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/IntervalPullback.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/IntervalPullback.lean new file mode 100644 index 0000000000000000000000000000000000000000..b83f70c7d11b3fa60ed16df226087aef5505012c --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/IntervalPullback.lean @@ -0,0 +1,322 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.IntervalFunctor + +namespace OAI + +namespace IntervalBar.Diagram + +section + +open CategoryTheory MonoidalCategory BraidedCategory +open Functor.LaxMonoidal Functor.OplaxMonoidal +universe u v w + +section + +variable {C : Type u} [Groupoid.{v} C] [MonoidalCategory C] [SymmetricCategory C] +variable {I J K L : Type w} [Preorder I] [Preorder J] [Preorder K] [Preorder L] +@[simp] lemma map_reindex_id : + map (I:=I) (reindex (C:=C) (OrderHom.id (α:=J)))=𝟭 _ := by + refine CategoryTheory.Functor.ext (fun A => ?_) ?_ + · refine ext_heq ?_ ?_ ?_ + · rfl + · apply heq_of_eq; funext i + apply Iso.ext; apply Hom.ext; intro j k h + change (A.unit i).hom.app j k h ≫ 𝟙 _ = _ + exact Category.comp_id _ + · apply heq_of_eq; funext i j k hij hjk + apply Iso.ext; apply Hom.ext; intro l m h + change 𝟙 _ ≫ (A.cut i j k hij hjk).hom.app l m h = _ + exact Category.id_comp _ + · intro A B f + apply Hom.ext; intro i j h + erw [comp_app, comp_app, eqToHom_app, eqToHom_app] + apply Hom.ext; intro l m hlm + erw [comp_app, comp_app, eqToHom_app, eqToHom_app] + simp [map,reindex] + change (f.app i j h).app l m hlm = 𝟙 _ ≫ (f.app i j h).app l m hlm ≫ 𝟙 _ + simp +@[simp] lemma map_reindex_comp (f : J →o K) (g : K →o L) : + map (I:=I) (reindex (C:=C) (g.comp f)) = map (reindex g) ⋙ map (reindex f) := by + refine CategoryTheory.Functor.ext (fun A => ?_) ?_ + · refine ext_heq ?_ ?_ ?_ + · rfl + · apply heq_of_eq; funext i + apply Iso.ext; apply Hom.ext; intro j k h + change (A.unit i).hom.app (g (f j)) (g (f k)) _ ≫ 𝟙 _ = + ((A.unit i).hom.app (g (f j)) (g (f k)) _ ≫ 𝟙 _) ≫ 𝟙 _ + simp + · apply heq_of_eq; funext i j k hij hjk + apply Iso.ext; apply Hom.ext; intro l m h + change 𝟙 _ ≫ (A.cut i j k hij hjk).hom.app (g (f l)) (g (f m)) _ = + 𝟙 _ ≫ (𝟙 _ ≫ (A.cut i j k hij hjk).hom.app (g (f l)) (g (f m)) _) + simp + · intro A B h + apply Hom.ext; intro i j hij + erw [comp_app, comp_app, eqToHom_app, eqToHom_app] + apply Hom.ext; intro l m hlm + erw [comp_app, comp_app, eqToHom_app, eqToHom_app] + simp [map,reindex] + change (h.app i j hij).app (g (f l)) (g (f m)) _ = + 𝟙 _ ≫ (h.app i j hij).app (g (f l)) (g (f m)) _ ≫ 𝟙 _ + simp + +noncomputable def reindex₂ (f : I →o J) (g : K →o L) : + Diagram (Diagram C L) J ⥤ Diagram (Diagram C K) I := + reindex f ⋙ map (reindex g) + +@[simp] lemma reindex₂_id : + reindex₂ (C:=C) (OrderHom.id (α:=I)) (OrderHom.id (α:=J)) = 𝟭 _ := by + simp [reindex₂]; rfl + +end + +open CategoryTheory + +variable {C : Type u} [Groupoid.{v} C] [MonoidalCategory C] [SymmetricCategory C] +variable {I₁ I₂ I₃ J₁ J₂ J₃ : Type w} + [Preorder I₁] [Preorder I₂] [Preorder I₃] [Preorder J₁] [Preorder J₂] [Preorder J₃] + +lemma reindex₂_comp (f₁ : I₁ →o I₂) (f₂ : I₂ →o I₃) + (g₁ : J₁ →o J₂) (g₂ : J₂ →o J₃) : + reindex₂ (C:=C) (f₂.comp f₁) (g₂.comp g₁) = + reindex₂ f₂ g₂ ⋙ reindex₂ f₁ g₁ := by + simp only [reindex₂,reindex_comp,map_reindex_comp,Functor.assoc] + rw [←Functor.assoc (map (reindex g₂)),←reindex_map,Functor.assoc] + +open scoped Simplicial +noncomputable def bisimplicial : (SimplexCategoryᵒᵖ × SimplexCategoryᵒᵖ) ⥤ Cat.{v,max u v} where + obj n := Cat.of (Diagram (Diagram C (Fin (n.2.unop.len+1))) (Fin (n.1.unop.len+1))) + map f := (reindex₂ f.1.unop.toOrderHom f.2.unop.toOrderHom).toCatHom + map_id n := by apply Cat.ext; exact reindex₂_id + map_comp f g := by + apply Cat.ext + exact reindex₂_comp g.1.unop.toOrderHom f.1.unop.toOrderHom + g.2.unop.toOrderHom f.2.unop.toOrderHom +end + +section + +open CategoryTheory MonoidalCategory +universe u v w u₁ u₂ +variable {C : Type u} [Groupoid.{v} C] [MonoidalCategory C] +variable {I : Type w} [Preorder I] + +omit [MonoidalCategory C] in +lemma iso_hext {X X' Y Y' : C} (hX : X=X') (hY : Y=Y') + (f : X ≅ Y) (g : X' ≅ Y') (h : HEq f.hom g.hom) : HEq f g := by + cases hX; cases hY + exact heq_of_eq (Iso.ext (eq_of_heq h)) + +lemma hom_hext {A A' B B' : Diagram C I} (hA : A=A') (hB : B=B') + (f : A ⟶ B) (g : A' ⟶ B') (h : ∀ i j hij, HEq (f.app i j hij) (g.app i j hij)) : + HEq f g := by + cases hA; cases hB + exact heq_of_eq (Hom.ext (fun i j hij => eq_of_heq (h i j hij))) + +lemma hfunext {α : Sort u₁} {β β' : α → Sort u₂} {f : ∀ a, β a} {g : ∀ a, β' a} + (h : ∀ a, HEq (f a) (g a)) : HEq f g := + Function.hfunext rfl (by intro a b hab; cases hab; exact h a) +end + +open CategoryTheory MonoidalCategory BraidedCategory +open Functor.LaxMonoidal Functor.OplaxMonoidal +universe u v w + +variable {C : Type u} [Groupoid.{v} C] [MonoidalCategory C] [SymmetricCategory C] +variable {I J K : Type w} [Preorder I] [Preorder J] [Preorder K] + +noncomputable instance reindex₂Braided {L : Type w} [Preorder L] + (f : I →o J) (g : K →o L) : (reindex₂ (C:=C) f g).Braided := by + unfold reindex₂ + infer_instance + +@[simp] lemma map_ε_app {D : Type*} [Groupoid D] [MonoidalCategory D] [SymmetricCategory D] + (F : C ⥤ D) [F.Braided] (i j : I) (h : i≤j) : + (ε (map (I:=I) F)).app i j h = ε F := rfl + +@[simp] lemma map_η_app {D : Type*} [Groupoid D] [MonoidalCategory D] [SymmetricCategory D] + (F : C ⥤ D) [F.Braided] (i j : I) (h : i≤j) : + (η (map (I:=I) F)).app i j h = η F := by + apply (cancel_mono (ε F)).mp + have hh := congrArg (fun f : (map (I:=I) F).obj (𝟙_ (Diagram C I)) ⟶ + (map (I:=I) F).obj (𝟙_ (Diagram C I)) => f.app i j h) + (Functor.Monoidal.η_ε (map (I:=I) F)) + simp only [comp_app,map_ε_app,id_app] at hh + simpa only [Functor.Monoidal.η_ε, map, mapObj, tensorUnit_obj] using hh + +@[simp] lemma map_μ_app {D : Type*} [Groupoid D] [MonoidalCategory D] [SymmetricCategory D] + (F : C ⥤ D) [F.Braided] (A B : Diagram C I) (i j : I) (h : i≤j) : + (μ (map (I:=I) F) A B).app i j h = μ F (A.obj i j h) (B.obj i j h) := rfl + +@[simp] lemma reindex_η_app (f : I →o J) (i j : I) (h : i≤j) : + (η (reindex (C:=C) f)).app i j h = 𝟙 _ := rfl + +@[simp] lemma reindex_μ_app (f : I →o J) (A B : Diagram C J) (i j : I) (h : i≤j) : + (μ (reindex (C:=C) f) A B).app i j h = 𝟙 _ := rfl + +omit [SymmetricCategory C] in +@[simp] lemma reindex_map_app (f : I →o J) {A B : Diagram C J} (g : A ⟶ B) + (i j : I) (h : i≤j) : ((reindex f).map g).app i j h = g.app (f i) (f j) (f.monotone h) := rfl + +omit [SymmetricCategory C] in +@[simp] lemma map_map_app {D : Type*} [Groupoid D] [MonoidalCategory D] + (F : C ⥤ D) [F.Monoidal] {A B : Diagram C I} (g : A ⟶ B) + (i j : I) (h : i≤j) : ((map F).map g).app i j h = F.map (g.app i j h) := rfl + +omit [SymmetricCategory C] in +@[simp] lemma map_obj {D : Type*} [Groupoid D] [MonoidalCategory D] + (F : C ⥤ D) [F.Monoidal] (A : Diagram C I) : (map F).obj A = mapObj F A := rfl + +private lemma reindex₂_η_app {L : Type w} [Preorder L] + (f : I →o J) (g : K →o L) (i j : I) (h : i ≤ j) + (k l : K) (hkl : k ≤ l) : + ((η (reindex₂ (C:=C) f g)).app i j h).app k l hkl = 𝟙 _ := by + change (((map (reindex g)).map (η (reindex f)) ≫ η (map (reindex g))).app i j h).app k l hkl = _ + erw [comp_app, map_map_app (C:=Diagram C L) (I:=I) (reindex g), + map_η_app (C:=Diagram C L) (I:=I) (reindex g) i j h, + reindex_map_app (C:=C) g, reindex_η_app (C:=Diagram C L) f i j h, + reindex_η_app (C:=C) g k l hkl] + change 𝟙 (𝟙_ C) ≫ 𝟙 (𝟙_ C) = 𝟙 (𝟙_ C) + exact Category.id_comp _ + +private lemma map_reindex₂_unit_app {J' K' : Type w} [Preorder J'] [Preorder K'] + (f : J →o J') (g : K →o K') (A : Diagram (Diagram (Diagram C K') J') I) + (i : I) (j k : J) (h : j ≤ k) (l m : K) (hlm : l ≤ m) : + ((((map (reindex₂ f g)).obj A).unit i).hom.app j k h).app l m hlm = + ((A.unit i).hom.app (f j) (f k) (f.monotone h)).app (g l) (g m) (g.monotone hlm) := by + change (((reindex₂ f g).map (A.unit i).hom ≫ η (reindex₂ f g)).app j k h).app l m hlm = _ + erw [comp_app, reindex₂_η_app] + change ((A.unit i).hom.app (f j) (f k) (f.monotone h)).app (g l) (g m) (g.monotone hlm) ≫ 𝟙 _ = _ + exact Category.comp_id _ + +@[simp] lemma map_reindex₂_id : + map (I:=I) (reindex₂ (C:=C) (OrderHom.id (α:=J)) (OrderHom.id (α:=K)))=𝟭 _ := by + refine CategoryTheory.Functor.ext (fun A => ?_) ?_ + · refine ext_heq ?_ ?_ ?_ + · funext i j h + exact congrArg (fun F => F.obj (A.obj i j h)) reindex₂_id + · apply hfunext; intro i + apply iso_hext (congrArg (fun F => F.obj (A.obj i i le_rfl)) reindex₂_id) rfl + apply hom_hext (congrArg (fun F => F.obj (A.obj i i le_rfl)) reindex₂_id) rfl + intro j k h + apply hom_hext rfl rfl + intro l m hlm + apply heq_of_eq + exact map_reindex₂_unit_app (OrderHom.id (α:=J)) (OrderHom.id (α:=K)) A i j k h l m hlm + · apply hfunext; intro i + apply hfunext; intro j + apply hfunext; intro k + apply hfunext; intro hij + apply hfunext; intro hjk + refine iso_hext ?_ ?_ _ _ ?_ + · exact congrArg₂ (fun X Y => X ⊗ Y) + (congrArg (fun F => F.obj (A.obj i j hij)) reindex₂_id) + (congrArg (fun F => F.obj (A.obj j k hjk)) reindex₂_id) + · exact congrArg (fun F => F.obj (A.obj i k (hij.trans hjk))) reindex₂_id + refine hom_hext ?_ ?_ _ _ ?_ + · exact congrArg₂ (fun X Y => X ⊗ Y) + (congrArg (fun F => F.obj (A.obj i j hij)) reindex₂_id) + (congrArg (fun F => F.obj (A.obj j k hjk)) reindex₂_id) + · exact congrArg (fun F => F.obj (A.obj i k (hij.trans hjk))) reindex₂_id + intro l m hlm + apply hom_hext rfl rfl + intro n p hnp + apply heq_of_eq + change (𝟙 _ ≫ 𝟙 _) ≫ ((A.cut i j k hij hjk).hom.app l m hlm).app n p hnp = + ((A.cut i j k hij hjk).hom.app l m hlm).app n p hnp + simp only [Category.id_comp] + · intro A B f + apply Hom.ext; intro i j h + erw [comp_app, comp_app, eqToHom_app, eqToHom_app] + apply Hom.ext; intro l m hlm + erw [comp_app, comp_app, eqToHom_app, eqToHom_app] + apply Hom.ext; intro n p hnp + erw [comp_app, comp_app, eqToHom_app, eqToHom_app] + simp only [map, reindex₂, reindex] + erw [Category.id_comp, Category.comp_id] + rfl + +variable {J₁ J₂ J₃ K₁ K₂ K₃ : Type w} + [Preorder J₁] [Preorder J₂] [Preorder J₃] [Preorder K₁] [Preorder K₂] [Preorder K₃] +lemma map_reindex₂_comp (f₁ : J₁ →o J₂) (f₂ : J₂ →o J₃) + (g₁ : K₁ →o K₂) (g₂ : K₂ →o K₃) : + map (I:=I) (reindex₂ (C:=C) (f₂.comp f₁) (g₂.comp g₁)) = + map (reindex₂ f₂ g₂) ⋙ map (reindex₂ f₁ g₁) := by + have hF := reindex₂_comp (C:=C) f₁ f₂ g₁ g₂ + have hO (X : Diagram (Diagram C K₃) J₃) := congrArg (fun F => F.obj X) hF + refine CategoryTheory.Functor.ext (fun A => ?_) ?_ + · refine ext_heq ?_ ?_ ?_ + · funext i j h; exact hO (A.obj i j h) + · apply hfunext; intro i + refine iso_hext (hO (A.obj i i le_rfl)) rfl _ _ ?_ + refine hom_hext (hO (A.obj i i le_rfl)) rfl _ _ ?_ + intro j k h + apply hom_hext rfl rfl + intro l m hlm + apply heq_of_eq + change ((((map (reindex₂ (f₂.comp f₁) (g₂.comp g₁))).obj A).unit i).hom.app j k h).app l m hlm = + ((((map (reindex₂ f₁ g₁)).obj ((map (reindex₂ f₂ g₂)).obj A)).unit i).hom.app j k h).app l m hlm + erw [map_reindex₂_unit_app, map_reindex₂_unit_app, map_reindex₂_unit_app] + rfl + · apply hfunext; intro i + apply hfunext; intro j + apply hfunext; intro k + apply hfunext; intro hij + apply hfunext; intro hjk + have hx := congrArg₂ (fun X Y => X⊗Y) (hO (A.obj i j hij)) (hO (A.obj j k hjk)) + have hy := hO (A.obj i k (hij.trans hjk)) + refine iso_hext hx hy _ _ ?_ + refine hom_hext hx hy _ _ ?_ + intro l m hlm + apply hom_hext rfl rfl + intro n p hnp + apply heq_of_eq + change (𝟙 _ ≫ 𝟙 _) ≫ + ((A.cut i j k hij hjk).hom.app (f₂ (f₁ l)) (f₂ (f₁ m)) _).app (g₂ (g₁ n)) (g₂ (g₁ p)) _ = + (𝟙 _ ≫ 𝟙 _) ≫ ((𝟙 _ ≫ 𝟙 _) ≫ + ((A.cut i j k hij hjk).hom.app (f₂ (f₁ l)) (f₂ (f₁ m)) _).app (g₂ (g₁ n)) (g₂ (g₁ p)) _) + simp + · intro A B f + apply Hom.ext; intro i j h + erw [comp_app, comp_app, eqToHom_app, eqToHom_app] + apply Hom.ext; intro l m hlm + erw [comp_app, comp_app, eqToHom_app, eqToHom_app] + apply Hom.ext; intro n p hnp + erw [comp_app, comp_app, eqToHom_app, eqToHom_app] + simp only [map, reindex₂, reindex] + erw [Category.id_comp, Category.comp_id] + rfl + +noncomputable def reindex₃ (f : I →o J) (g : J₁ →o J₂) (h : K₁ →o K₂) : + Diagram (Diagram (Diagram C K₂) J₂) J ⥤ Diagram (Diagram (Diagram C K₁) J₁) I := + reindex f ⋙ map (reindex₂ g h) + +@[simp] lemma reindex₃_id : reindex₃ (C:=C) (OrderHom.id (α:=I)) + (OrderHom.id (α:=J)) (OrderHom.id (α:=K))=𝟭 _ := by + simp [reindex₃]; rfl + +variable {I₁ I₂ I₃ : Type w} [Preorder I₁] [Preorder I₂] [Preorder I₃] +lemma reindex₃_comp (e₁ : I₁ →o I₂) (e₂ : I₂ →o I₃) + (f₁ : J₁ →o J₂) (f₂ : J₂ →o J₃) (g₁ : K₁ →o K₂) (g₂ : K₂ →o K₃) : + reindex₃ (C:=C) (e₂.comp e₁) (f₂.comp f₁) (g₂.comp g₁) = + reindex₃ e₂ f₂ g₂ ⋙ reindex₃ e₁ f₁ g₁ := by + simp only [reindex₃,reindex_comp,map_reindex₂_comp,Functor.assoc] + rw [←Functor.assoc (map (reindex₂ f₂ g₂)),←reindex_map,Functor.assoc] + +open scoped Simplicial +noncomputable def trisimplicial : + (SimplexCategoryᵒᵖ × SimplexCategoryᵒᵖ × SimplexCategoryᵒᵖ) ⥤ Cat.{v,max u v} where + obj n := Cat.of (Diagram (Diagram (Diagram C (Fin (n.2.2.unop.len+1))) + (Fin (n.2.1.unop.len+1))) (Fin (n.1.unop.len+1))) + map f := (reindex₃ f.1.unop.toOrderHom f.2.1.unop.toOrderHom f.2.2.unop.toOrderHom).toCatHom + map_id n := by apply Cat.ext; exact reindex₃_id + map_comp f g := by + apply Cat.ext + exact reindex₃_comp g.1.unop.toOrderHom f.1.unop.toOrderHom + g.2.1.unop.toOrderHom f.2.1.unop.toOrderHom + g.2.2.unop.toOrderHom f.2.2.unop.toOrderHom + +end IntervalBar.Diagram + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/IntervalTensor.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/IntervalTensor.lean new file mode 100644 index 0000000000000000000000000000000000000000..068333bde1016a3dfb17fe29b47adce484ec6309 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/IntervalTensor.lean @@ -0,0 +1,216 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.IntervalMap +import OAI.GroupTheory.SimpleAmenable.Simplicial.IntervalExtension + +namespace OAI + +section + +section + +open CategoryTheory MonoidalCategory BraidedCategory +open Functor.LaxMonoidal Functor.OplaxMonoidal +universe u v w +namespace IntervalBar.Diagram + +variable {C : Type u} [Groupoid.{v} C] [MonoidalCategory C] [SymmetricCategory C] +variable {I : Type w} [Preorder I] + +noncomputable def tensorObj (A B : Diagram C I) : Diagram C I := + mapObj (tensor C) (pair A B) + +noncomputable def tensorHom {A A' B B' : Diagram C I} (f : A ⟶ A') (g : B ⟶ B') : + tensorObj A B ⟶ tensorObj A' B' := (map (tensor C)).map (pairHom f g) + +@[simp] lemma tensorObj_obj (A B : Diagram C I) (i j : I) (h : i≤j) : + (tensorObj A B).obj i j h = A.obj i j h ⊗ B.obj i j h := rfl +@[simp] lemma tensorObj_unit (A B : Diagram C I) (i : I) : + ((tensorObj A B).unit i).hom = ((A.unit i).hom ⊗ₘ (B.unit i).hom) ≫ (λ_ (𝟙_ C)).hom := rfl +@[simp] lemma tensorObj_cut (A B : Diagram C I) (i j k : I) (hij : i≤j) (hjk : j≤k) : + ((tensorObj A B).cut i j k hij hjk).hom = + tensorμ (A.obj i j hij) (B.obj i j hij) (A.obj j k hjk) (B.obj j k hjk) ≫ + ((A.cut i j k hij hjk).hom ⊗ₘ (B.cut i j k hij hjk).hom) := rfl +@[simp] lemma tensorHom_app {A A' B B' : Diagram C I} (f : A ⟶ A') (g : B ⟶ B') + (i j : I) (h : i≤j) : (tensorHom f g).app i j h = f.app i j h ⊗ₘ g.app i j h := rfl + +omit [SymmetricCategory C] in +lemma associator_unit_square {X Y Z : C} (f : X ⟶ 𝟙_ C) (g : Y ⟶ 𝟙_ C) (h : Z ⟶ 𝟙_ C) : + (α_ X Y Z).hom ≫ (f ⊗ₘ ((g ⊗ₘ h) ≫ (λ_ (𝟙_ C)).hom)) ≫ (λ_ (𝟙_ C)).hom = + (((f ⊗ₘ g) ≫ (λ_ (𝟙_ C)).hom) ⊗ₘ h) ≫ (λ_ (𝟙_ C)).hom := by + rw [←tensorHom_comp_whiskerLeft,←tensorHom_comp_whiskerRight] + simp only [Category.assoc] + rw [←associator_naturality_assoc] + congr 1 + monoidal + +lemma associator_cut_square {X₁ X₂ X₃ Y₁ Y₂ Y₃ Z₁ Z₂ Z₃ : C} + (f : X₁ ⊗ Y₁ ⟶ Z₁) (g : X₂ ⊗ Y₂ ⟶ Z₂) (h : X₃ ⊗ Y₃ ⟶ Z₃) : + ((α_ X₁ X₂ X₃).hom ⊗ₘ (α_ Y₁ Y₂ Y₃).hom) ≫ + tensorμ X₁ (X₂ ⊗ X₃) Y₁ (Y₂ ⊗ Y₃) ≫ + (f ⊗ₘ (tensorμ X₂ X₃ Y₂ Y₃ ≫ (g ⊗ₘ h))) = + (tensorμ (X₁ ⊗ X₂) X₃ (Y₁ ⊗ Y₂) Y₃ ≫ + ((tensorμ X₁ X₂ Y₁ Y₂ ≫ (f ⊗ₘ g)) ⊗ₘ h)) ≫ (α_ Z₁ Z₂ Z₃).hom := by + rw [←whiskerLeft_comp_tensorHom,←whiskerRight_comp_tensorHom] + simp only [Category.assoc] + rw [←associator_monoidal_assoc,associator_naturality] + +lemma leftUnitor_cut_square {X Y Z : C} (f : X ⊗ Y ⟶ Z) : + ((λ_ X).hom ⊗ₘ (λ_ Y).hom) ≫ f = + (tensorμ (𝟙_ C) X (𝟙_ C) Y ≫ ((λ_ (𝟙_ C)).hom ⊗ₘ f)) ≫ (λ_ Z).hom := by + rw [leftUnitor_monoidal_assoc] + simp only [MonoidalCategory.tensorHom_def,Category.assoc,leftUnitor_naturality] + +lemma rightUnitor_cut_square {X Y Z : C} (f : X ⊗ Y ⟶ Z) : + ((ρ_ X).hom ⊗ₘ (ρ_ Y).hom) ≫ f = + (tensorμ X (𝟙_ C) Y (𝟙_ C) ≫ (f ⊗ₘ (λ_ (𝟙_ C)).hom)) ≫ (ρ_ Z).hom := by + rw [rightUnitor_monoidal_assoc] + simp only [MonoidalCategory.tensorHom_def',Category.assoc,rightUnitor_naturality] + +noncomputable def associatorHom (A B D : Diagram C I) : + tensorObj (tensorObj A B) D ⟶ tensorObj A (tensorObj B D) where + app i j h := (α_ (A.obj i j h) (B.obj i j h) (D.obj i j h)).hom + unit i := associator_unit_square (A.unit i).hom (B.unit i).hom (D.unit i).hom + cut i j k hij hjk := associator_cut_square (A.cut i j k hij hjk).hom + (B.cut i j k hij hjk).hom (D.cut i j k hij hjk).hom + +noncomputable def leftUnitorHom (A : Diagram C I) : tensorObj constantUnit A ⟶ A where + app i j h := (λ_ (A.obj i j h)).hom + unit i := by + change (λ_ _).hom ≫ (A.unit i).hom = (𝟙 _ ⊗ₘ (A.unit i).hom) ≫ (λ_ _).hom + rw [id_tensorHom,leftUnitor_naturality] + cut i j k hij hjk := leftUnitor_cut_square (A.cut i j k hij hjk).hom + +noncomputable def rightUnitorHom (A : Diagram C I) : tensorObj A constantUnit ⟶ A where + app i j h := (ρ_ (A.obj i j h)).hom + unit i := by + change (ρ_ _).hom ≫ (A.unit i).hom = ((A.unit i).hom ⊗ₘ 𝟙 _) ≫ (λ_ _).hom + rw [tensorHom_id,unitors_equal,rightUnitor_naturality] + cut i j k hij hjk := rightUnitor_cut_square (A.cut i j k hij hjk).hom + +noncomputable instance monoidalStruct : MonoidalCategoryStruct (Diagram C I) where + tensorObj := tensorObj + tensorHom := tensorHom + whiskerLeft A _ _ f := tensorHom (𝟙 A) f + whiskerRight f A := tensorHom f (𝟙 A) + tensorUnit := constantUnit + associator A B D := asIso (associatorHom A B D) + leftUnitor A := asIso (leftUnitorHom A) + rightUnitor A := asIso (rightUnitorHom A) + +@[simp] lemma whiskerLeft_app (A : Diagram C I) {B D : Diagram C I} (f : B ⟶ D) + (i j : I) (h : i≤j) : (A ◁ f).app i j h = A.obj i j h ◁ f.app i j h := by + change (𝟙 (A.obj i j h) ⊗ₘ f.app i j h) = _ + exact MonoidalCategory.id_tensorHom (A.obj i j h) (f.app i j h) +@[simp] lemma whiskerRight_app {A B : Diagram C I} (f : A ⟶ B) (D : Diagram C I) + (i j : I) (h : i≤j) : (f ▷ D).app i j h = f.app i j h ▷ D.obj i j h := by + change (f.app i j h ⊗ₘ 𝟙 (D.obj i j h)) = _ + exact MonoidalCategory.tensorHom_id (f.app i j h) (D.obj i j h) +@[simp] lemma associator_app (A B D : Diagram C I) (i j : I) (h : i≤j) : + (α_ A B D).hom.app i j h = (α_ (A.obj i j h) (B.obj i j h) (D.obj i j h)).hom := rfl +@[simp] lemma leftUnitor_app (A : Diagram C I) (i j : I) (h : i≤j) : + (λ_ A).hom.app i j h = (λ_ (A.obj i j h)).hom := rfl +@[simp] lemma rightUnitor_app (A : Diagram C I) (i j : I) (h : i≤j) : + (ρ_ A).hom.app i j h = (ρ_ (A.obj i j h)).hom := rfl +@[simp] lemma tensor_app {A A' B B' : Diagram C I} (f : A ⟶ A') (g : B ⟶ B') + (i j : I) (h : i≤j) : (f ⊗ₘ g).app i j h = f.app i j h ⊗ₘ g.app i j h := rfl +@[simp] lemma tensor_obj (A B : Diagram C I) (i j : I) (h : i≤j) : + (A⊗B).obj i j h = A.obj i j h ⊗ B.obj i j h := rfl +@[simp] lemma tensorUnit_obj (i j : I) (h : i≤j) : + (𝟙_ (Diagram C I)).obj i j h = 𝟙_ C := rfl + +noncomputable instance monoidal : MonoidalCategory (Diagram C I) where + tensorHom_def f g := by apply Hom.ext; intro i j h; simp [MonoidalCategory.tensorHom_def] + id_tensorHom_id A B := by apply Hom.ext; intro i j h; simp + tensorHom_comp_tensorHom f g h k := by apply Hom.ext; intro i j hij; simp + whiskerLeft_id A B := by apply Hom.ext; intro i j h; simp + id_whiskerRight A B := by apply Hom.ext; intro i j h; simp + associator_naturality f g h := by apply Hom.ext; intro i j hij; simp + leftUnitor_naturality f := by apply Hom.ext; intro i j h; simp + rightUnitor_naturality f := by apply Hom.ext; intro i j h; simp + pentagon A B D E := by apply Hom.ext; intro i j h; simp + triangle A B := by apply Hom.ext; intro i j h; simp + +noncomputable instance evalMonoidal (n : ℕ) : (eval (C:=C) n).Monoidal := + Functor.CoreMonoidal.toMonoidal { + εIso := Iso.refl _ + μIso := fun A B => Iso.refl _ + μIso_hom_natural_left := by intros; ext i; simp [eval] + μIso_hom_natural_right := by intros; ext i; simp [eval] + associativity := by intros; ext i; simp [eval] + left_unitality := by intros; ext i; simp [eval] + right_unitality := by intros; ext i; simp [eval] } + +lemma braiding_unit_square {X Y : C} (f : X ⟶ 𝟙_ C) (g : Y ⟶ 𝟙_ C) : + (β_ X Y).hom ≫ (g ⊗ₘ f) ≫ (λ_ (𝟙_ C)).hom = + (f ⊗ₘ g) ≫ (λ_ (𝟙_ C)).hom := by + rw [←braiding_naturality_assoc] + simp only [braiding_tensorUnit_right,Category.assoc,Iso.inv_hom_id,Category.comp_id] + rw [←unitors_equal] + +lemma braiding_cut_square {X₁ X₂ Y₁ Y₂ Z₁ Z₂ : C} + (f : X₁ ⊗ Y₁ ⟶ Z₁) (g : X₂ ⊗ Y₂ ⟶ Z₂) : + ((β_ X₁ X₂).hom ⊗ₘ (β_ Y₁ Y₂).hom) ≫ + (tensorμ X₂ X₁ Y₂ Y₁ ≫ (g ⊗ₘ f)) = + (tensorμ X₁ X₂ Y₁ Y₂ ≫ (f ⊗ₘ g)) ≫ (β_ Z₁ Z₂).hom := by + rw [←Category.assoc,IntervalBar.tensorμ_braiding,Category.assoc, + ←braiding_naturality,Category.assoc] + +noncomputable def braidingHom (A B : Diagram C I) : A⊗B ⟶ B⊗A where + app i j h := (β_ (A.obj i j h) (B.obj i j h)).hom + unit i := braiding_unit_square (A.unit i).hom (B.unit i).hom + cut i j k hij hjk := braiding_cut_square (A.cut i j k hij hjk).hom (B.cut i j k hij hjk).hom + +omit [SymmetricCategory C] in +@[simp] lemma inv_app {A B : Diagram C I} (f : A ⟶ B) (i j : I) (h : i≤j) : + (CategoryTheory.inv f).app i j h = CategoryTheory.inv (f.app i j h) := by + rw [←Groupoid.inv_eq_inv] + rfl + +@[simp] lemma associator_inv_app (A B D : Diagram C I) (i j : I) (h : i≤j) : + (α_ A B D).inv.app i j h = (α_ (A.obj i j h) (B.obj i j h) (D.obj i j h)).inv := by + change (CategoryTheory.inv (associatorHom A B D)).app i j h = _ + rw [inv_app] + apply IsIso.inv_eq_of_hom_inv_id + exact Iso.hom_inv_id _ + +noncomputable instance braided : BraidedCategory (Diagram C I) where + braiding A B := asIso (braidingHom A B) + braiding_naturality_right A B D f := by + apply Hom.ext; intro i j h + change (𝟙 _ ⊗ₘ f.app i j h) ≫ (β_ _ _).hom = (β_ _ _).hom ≫ (f.app i j h ⊗ₘ 𝟙 _) + simp + braiding_naturality_left f D := by + apply Hom.ext; intro i j h + change (f.app i j h ⊗ₘ 𝟙 _) ≫ (β_ _ _).hom = (β_ _ _).hom ≫ (𝟙 _ ⊗ₘ f.app i j h) + simp + hexagon_forward A B D := by + apply Hom.ext; intro i j h + change (α_ _ _ _).hom ≫ (β_ _ _).hom ≫ (α_ _ _ _).hom = + ((β_ _ _).hom ⊗ₘ 𝟙 _) ≫ (α_ _ _ _).hom ≫ (𝟙 _ ⊗ₘ (β_ _ _).hom) + simp only [tensorHom_id,id_tensorHom] + exact hexagon_forward _ _ _ + hexagon_reverse A B D := by + apply Hom.ext; intro i j h + simp only [comp_app,associator_inv_app,whiskerLeft_app,whiskerRight_app] + change (α_ _ _ _).inv ≫ (β_ _ _).hom ≫ (α_ _ _ _).inv = + (_ ◁ (β_ _ _).hom) ≫ (α_ _ _ _).inv ≫ ((β_ _ _).hom ▷ _) + exact hexagon_reverse _ _ _ + +@[simp] lemma braiding_app (A B : Diagram C I) (i j : I) (h : i≤j) : + (β_ A B).hom.app i j h = (β_ (A.obj i j h) (B.obj i j h)).hom := rfl + +noncomputable instance symmetric : SymmetricCategory (Diagram C I) where + symmetry A B := by apply Hom.ext; intro i j h; simp + +noncomputable instance evalEquivalence (n : ℕ) : (eval (C:=C) n).IsEquivalence where + +noncomputable def evaluationEquivalence (n : ℕ) : Diagram C (Fin (n+1)) ≌ (Fin n → C) := + (eval n).asEquivalence + +end IntervalBar.Diagram + +end + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/IteratedBarMaps.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/IteratedBarMaps.lean new file mode 100644 index 0000000000000000000000000000000000000000..d58700dd8ef350eb68c6a461b32c6ec5c5b02e84 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/IteratedBarMaps.lean @@ -0,0 +1,78 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.IntervalEquivalence + +namespace OAI + +open _root_.CategoryTheory _root_.OAI.CategoryTheory MonoidalCategory SimplicialObject Simplicial Opposite +namespace IntervalBar.Diagram + +variable {C D : Type} [Groupoid.{0} C] [MonoidalCategory C] [SymmetricCategory C] + [Groupoid.{0} D] [MonoidalCategory D] [SymmetricCategory D] +variable {I J K L : Type} [Preorder I] [Preorder J] [Preorder K] [Preorder L] +lemma simplicialMap_map_reindex (F : C ⥤ D) [F.Braided] (f : I →o J) : + simplicialMap (map (I:=J) F) ≫ simplicialMap (reindex f) = + simplicialMap (reindex f) ≫ simplicialMap (map (I:=I) F) := by + apply NatTrans.ext; funext p; apply Cat.ext + exact map_map_reindex F f +lemma barMap_map_reindex (F : C ⥤ D) [F.Braided] (f : I →o J) : + barMap (map (I:=J) F) ≫ barMap (reindex f) = + barMap (reindex f) ≫ barMap (map (I:=I) F) := by + have h := congrArg (SimplicialDiagonal.nerveDiagonal.map) (simplicialMap_map_reindex F f) + erw [Functor.map_comp, Functor.map_comp] at h + exact h +noncomputable def rows₂Map (F : C ⥤ D) [F.Braided] : rows₂ (C:=C) ⟶ rows₂ (C:=D) where + app p := barMap (map (I:=Fin (p.unop.len+1)) F) + naturality _ _ f := (barMap_map_reindex F f.unop.toOrderHom).symm +noncomputable def bar₂Map (F : C ⥤ D) [F.Braided] : bar₂ (C:=C) ⟶ bar₂ (C:=D) := + SimplicialDiagonal.diagonal.map (rows₂Map F) +lemma bar₂Map_homology_isIso (F : C ⥤ D) [F.Braided] [F.IsEquivalence] (n : ℕ) : + IsIso (SSet.homologyMap (bar₂Map F) DiagonalResolution.Z n) := by + apply SimplicialDiagonal.homologyMap_isIso + intro p q + exact barMap_homology_isIso (map (I:=Fin (p.unop.len+1)) F) q +@[simp] lemma map_map_reindex_id : + map (I:=K) (map (I:=J) (reindex (C:=C) (OrderHom.id (α:=I))))=𝟭 _ := by + have he (X : Diagram (Diagram C I) J) : mapObj (reindex (OrderHom.id (α:=I))) X=X := + congrArg (fun F => F.obj X) map_reindex_id + refine CategoryTheory.Functor.ext (fun A => ?_) ?_ + · refine ext_heq ?_ ?_ ?_ + · funext i j h + exact congrArg (fun F => F.obj (A.obj i j h)) map_reindex_id + · apply hfunext; intro i + apply iso_hext (he _) rfl + apply hom_hext (he _) rfl + intro j k h + apply hom_hext (by simp [mapObj]) (by rfl) + intro l m hlm + apply heq_of_eq + change (((map (reindex (C:=C) (OrderHom.id (α:=I)))).map (A.unit i).hom ≫ + Functor.OplaxMonoidal.η (map (reindex (C:=C) (OrderHom.id (α:=I))))).app j k h).app l m hlm = _ + erw [comp_app, map_η_app (I:=J) (reindex (C:=C) (OrderHom.id (α:=I)))] + change ((A.unit i).hom.app j k h).app l m hlm ≫ 𝟙 _ = _ + exact Category.comp_id _ + · apply hfunext; intro i + apply hfunext; intro j + apply hfunext; intro k + apply hfunext; intro hij + apply hfunext; intro hjk + apply iso_hext (congrArg₂ (fun X Y => X ⊗ Y) (he _) (he _)) (he _) + apply hom_hext (congrArg₂ (fun X Y => X ⊗ Y) (he _) (he _)) (he _) + intro l m hlm + apply hom_hext (by simp [mapObj]) (by simp [mapObj]) + intro n p hnp + apply heq_of_eq + change 𝟙 _ ≫ ((A.cut i j k hij hjk).hom.app l m hlm).app n p hnp = _ + exact Category.id_comp _ + · intro A B f + apply Hom.ext; intro i j h + erw [comp_app, comp_app, eqToHom_app, eqToHom_app] + apply Hom.ext; intro k l hkl + erw [comp_app, comp_app, eqToHom_app, eqToHom_app] + apply Hom.ext; intro m n hmn + erw [comp_app, comp_app, eqToHom_app, eqToHom_app] + simp only [map,reindex] + erw [Category.id_comp, Category.comp_id] + rfl +end IntervalBar.Diagram + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/LabelledMonoidal.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/LabelledMonoidal.lean new file mode 100644 index 0000000000000000000000000000000000000000..819fa5e01dd388ad41d1265259bf56bdc64b60f5 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/LabelledMonoidal.lean @@ -0,0 +1,165 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Configurations.BooleanStages + +namespace OAI + +section + +section + +open CategoryTheory Classical MonoidalCategory +namespace SimpleAmenable.PolygonObject + +namespace Labelled +variable {a n : ℕ} + +noncomputable abbrev sum (U V : Labelled a n) : Labelled a n where + polygon := PolygonObject.sum U.polygon V.polygon + label := Fin.addCases U.label V.label + reduced j i := by + refine Fin.addCases ?_ ?_ j + · intro k; simpa only [Fin.addCases_left] using U.reduced k i + · intro k; simpa only [Fin.addCases_right] using V.reduced k i + +noncomputable abbrev empty : Labelled a n where + polygon := PolygonObject.empty + label := Fin.elim0 + reduced := fun j => Fin.elim0 j + +@[simp] lemma sum_label_left (U V : Labelled a n) (x : U.polygon.Point) : + (sum U V).label (sumPointEquiv U.polygon V.polygon (.inl x)).val.1=U.label x.val.1 := by + simp [sumPointEquiv_inl] +@[simp] lemma sum_label_right (U V : Labelled a n) (x : V.polygon.Point) : + (sum U V).label (sumPointEquiv U.polygon V.polygon (.inr x)).val.1=V.label x.val.1 := by + simp [sumPointEquiv_inr] + +noncomputable def sumHom {U V W Z : Labelled a n} (f : U ⟶ W) (g : V ⟶ Z) : + sum U V ⟶ sum W Z where + arrow := sumArrow f.arrow g.arrow + positional := sumArrow_positional f.positional g.positional + labelled x := by + obtain ⟨y,rfl⟩ := (sumPointEquiv U.polygon V.polygon).surjective x + cases y with + | inl y => simpa only [sumArrow_inl,sumPointEquiv_inl,Fin.addCases_left] using f.labelled y + | inr y => simpa only [sumArrow_inr,sumPointEquiv_inr,Fin.addCases_right] using g.labelled y + +noncomputable def assocHom (U V W : Labelled a n) : sum (sum U V) W ⟶ sum U (sum V W) where + arrow := sumAssoc U.polygon V.polygon W.polygon + positional := sumAssoc_positional _ _ _ + labelled x := by + obtain ⟨y,rfl⟩ := (sumPointEquiv (sum U V).polygon W.polygon).surjective x + cases y with + | inl y => + obtain ⟨z,rfl⟩ := (sumPointEquiv U.polygon V.polygon).surjective y + cases z <;> simp only [sumAssoc_apply,sumAssocEquiv_left,sumAssocEquiv_mid, + sumPointEquiv_inl,sumPointEquiv_inr] <;> + simp only [PolygonObject.sum,Fin.addCases_left,Fin.addCases_right] + | inr y => + simp only [sumAssoc_apply,sumAssocEquiv_right,sumPointEquiv_inr] + simp only [PolygonObject.sum,Fin.addCases_right] + +noncomputable def leftHom (U : Labelled a n) : sum empty U ⟶ U where + arrow := leftUnit U.polygon + positional := leftUnit_positional _ + labelled x := by + obtain ⟨y,rfl⟩ := (sumPointEquiv PolygonObject.empty U.polygon).surjective x + cases y with + | inl y => exact isEmptyElim y + | inr y => + simp only [leftUnit_apply,leftUnitEquiv_apply,sumPointEquiv_inr] + simp only [PolygonObject.empty,Fin.addCases_right] + +noncomputable def rightHom (U : Labelled a n) : sum U empty ⟶ U where + arrow := rightUnit U.polygon + positional := rightUnit_positional _ + labelled x := by + obtain ⟨y,rfl⟩ := (sumPointEquiv U.polygon PolygonObject.empty).surjective x + cases y with + | inl y => + simp only [rightUnit_apply,rightUnitEquiv_apply,sumPointEquiv_inl] + simp only [PolygonObject.empty,Fin.addCases_left] + | inr y => exact isEmptyElim y + +noncomputable def swapHom (U V : Labelled a n) : sum U V ⟶ sum V U where + arrow := sumSwap U.polygon V.polygon + positional := sumSwap_positional _ _ + labelled x := by + obtain ⟨y,rfl⟩ := (sumPointEquiv U.polygon V.polygon).surjective x + cases y <;> simp only [sumSwap_apply,sumSwapEquiv_inl,sumSwapEquiv_inr, + sumPointEquiv_inl,sumPointEquiv_inr,Fin.addCases_left,Fin.addCases_right] + +instance : (forget (a:=a) (n:=n)).Faithful where + map_injective h := Hom.ext _ _ h + +noncomputable instance : MonoidalCategoryStruct (Labelled a n) where + tensorObj := sum + tensorHom := sumHom + whiskerLeft U _ _ f := sumHom (𝟙 U) f + whiskerRight f U := sumHom f (𝟙 U) + tensorUnit := empty + associator U V W := asIso (assocHom U V W) + leftUnitor U := asIso (leftHom U) + rightUnitor U := asIso (rightHom U) + +noncomputable def inducing : Monoidal.InducingFunctorData (forget (a:=a) (n:=n)) where + μIso _ _ := Iso.refl _ + εIso := Iso.refl _ + whiskerLeft_eq := by intros; simp only [Iso.refl_hom,Iso.refl_inv]; rfl + whiskerRight_eq := by intros; simp only [Iso.refl_hom,Iso.refl_inv]; rfl + tensorHom_eq := by intros; simp only [Iso.refl_hom,Iso.refl_inv]; rfl + associator_eq := by + intro U V W + change sumAssoc U.polygon V.polygon W.polygon = + (𝟙 _ ≫ sumArrow (𝟙 _) (𝟙 _)) ≫ sumAssoc U.polygon V.polygon W.polygon ≫ + (sumArrow (𝟙 _) (𝟙 _) ≫ 𝟙 _) + simp only [sumArrow_id,Category.id_comp,Category.comp_id] + leftUnitor_eq := by + intro U + change leftUnit U.polygon = (𝟙 _ ≫ sumArrow (𝟙 _) (𝟙 _)) ≫ leftUnit U.polygon + rw [sumArrow_id,Category.id_comp,Category.id_comp] + rightUnitor_eq := by + intro U + change rightUnit U.polygon = (𝟙 _ ≫ sumArrow (𝟙 _) (𝟙 _)) ≫ rightUnit U.polygon + rw [sumArrow_id,Category.id_comp,Category.id_comp] + +noncomputable instance : MonoidalCategory (Labelled a n) := Monoidal.induced forget inducing +noncomputable instance : (forget (a:=a) (n:=n)).Monoidal := + Functor.CoreMonoidal.toMonoidal (Monoidal.fromInducedCoreMonoidal forget inducing) + +noncomputable instance : BraidedCategory (Labelled a n) where + braiding U V := asIso (swapHom U V) + braiding_naturality_left := by + intro U V f W + apply forget.map_injective + exact BraidedCategory.braiding_naturality_left f.arrow W.polygon + braiding_naturality_right := by + intro U V W f + apply forget.map_injective + exact BraidedCategory.braiding_naturality_right U.polygon f.arrow + hexagon_forward := by + intro U V W + apply forget.map_injective + exact BraidedCategory.hexagon_forward U.polygon V.polygon W.polygon + hexagon_reverse := by + intro U V W + apply forget.map_injective + change (inv (assocHom U V W)).arrow ≫ (swapHom (sum U V) W).arrow ≫ + (inv (assocHom W U V)).arrow = + sumArrow (𝟙 U.polygon) (swapHom V W).arrow ≫ (inv (assocHom U W V)).arrow ≫ + sumArrow (swapHom U W).arrow (𝟙 V.polygon) + simp only [inv_arrow] + exact BraidedCategory.hexagon_reverse U.polygon V.polygon W.polygon + +noncomputable instance : SymmetricCategory (Labelled a n) where + symmetry U V := by + apply forget.map_injective + exact SymmetricCategory.symmetry U.polygon V.polygon + +end Labelled +end SimpleAmenable.PolygonObject + +end + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/LowerBarComposition.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/LowerBarComposition.lean new file mode 100644 index 0000000000000000000000000000000000000000..bbb549a33a0636e7f4eaf09848a8bd61366e0c02 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/LowerBarComposition.lean @@ -0,0 +1,169 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.StageCoordinateMaps +import OAI.GroupTheory.SimpleAmenable.Homology.ReducedTensorFinite + +namespace OAI + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory MonoidalCategory Simplicial Opposite +namespace IntervalBar.Diagram + +variable {C D E:Type} [Groupoid.{0} C] [MonoidalCategory C] [SymmetricCategory C] + [Groupoid.{0} D] [MonoidalCategory D] [SymmetricCategory D] + [Groupoid.{0} E] [MonoidalCategory E] [SymmetricCategory E] +variable (F:C⥤D) (G:D⥤E) [F.Braided] [G.Braided] +lemma barMap_comp : barMap (F⋙G)=barMap F≫barMap G := by + ext n x + change x ⋙ map (I:=Fin (n.unop.len+1)) (F⋙G)=(x⋙map F)⋙map G + rw [map_comp] + rfl +lemma bar₂Map_comp : bar₂Map (F⋙G)=bar₂Map F≫bar₂Map G := by + ext n x + exact congrArg (fun T => x ⋙ T) + (map₂_comp (I:=Fin (n.unop.len+1)) (J:=Fin (n.unop.len+1)) F G) +end IntervalBar.Diagram +namespace BarFinitePower +noncomputable def powerTwoIso (X:SSet) : (power (Fin 2)).obj X ≅ X⊗X where + hom := { app _ := ↾fun x => (x 0,x 1) + naturality _ _ _ := rfl } + inv := { app _ := ↾fun x=>![x.1,x.2] + naturality _ _ _ := by apply ConcreteCategory.hom_ext; intro x; funext i; fin_cases i <;> rfl } + hom_inv_id := by apply NatTrans.ext;funext p;apply ConcreteCategory.hom_ext;intro x;funext i;fin_cases i <;> rfl + inv_hom_id := by ext p x <;> rfl +noncomputable def powerOneIso (X:SSet) : (power (Fin 1)).obj X ≅ X where + hom := evaluate _ _ 0 + inv := { app _ := ↾fun x _=>x + naturality _ _ _ := rfl } + hom_inv_id := by apply NatTrans.ext;funext p;apply ConcreteCategory.hom_ext;intro x;funext i;exact congrArg x (Subsingleton.elim _ _) + inv_hom_id := by ext p x; rfl +end BarFinitePower + +end + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits HomologicalComplex SimplicialObject Simplicial Opposite AlgebraicTopology +namespace SimplicialFirstFinite + +attribute [local instance 1200] Submodule.module +universe u +variable {R:Type u} [CommRing R] +variable (T:SimplicialObject (ModuleCat.{u} R)) +abbrev K := AlternatingFaceMapComplex.obj T +noncomputable def outer : T.obj (op ⦋2⦌) →ₗ[R] (T.obj (op ⦋1⦌) × T.obj (op ⦋1⦌)) := + (T.δ (0:Fin 3)).hom.prod (T.δ (2:Fin 3)).hom +noncomputable def sec : (T.obj (op ⦋1⦌) × T.obj (op ⦋1⦌)) →ₗ[R] T.obj (op ⦋2⦌) := + (T.σ (0:Fin 2)).hom.comp (LinearMap.fst R _ _) + + (T.σ (1:Fin 2)).hom.comp (LinearMap.snd R _ _) +variable (h0:IsZero (T.obj (op ⦋0⦌))) +include h0 +lemma sigma_zero_two : T.σ (0:Fin 2) ≫ T.δ (2:Fin 3)=0 := by + change T.σ (Fin.castSucc (0:Fin 1)) ≫ T.δ (Fin.succ (1:Fin 2))=0 + rw [T.δ_comp_σ_of_gt (by decide)] + rw [h0.eq_zero_of_tgt (T.δ (1:Fin 2)),zero_comp] +lemma sigma_one_zero : T.σ (1:Fin 2) ≫ T.δ (0:Fin 3)=0 := by + change T.σ (Fin.succ (0:Fin 1)) ≫ T.δ (Fin.castSucc (0:Fin 2))=0 + rw [T.δ_comp_σ_of_le (by decide)] + rw [h0.eq_zero_of_tgt (T.δ (0:Fin 2)),zero_comp] +lemma outer_sec : (outer T).comp (sec T)=LinearMap.id := by + apply LinearMap.ext + intro x + apply Prod.ext + · change (T.δ (0:Fin 3)) ((T.σ (0:Fin 2)) x.1+(T.σ (1:Fin 2)) x.2)=x.1 + rw [map_add] + change (T.σ (0:Fin 2)≫T.δ (0:Fin 3)) x.1+(T.σ (1:Fin 2)≫T.δ (0:Fin 3)) x.2=x.1 + rw [T.δ_comp_σ_self' (i:=(0:Fin 2)) (j:=(0:Fin 3)) rfl,sigma_one_zero T h0] + simp + · change (T.δ (2:Fin 3)) ((T.σ (0:Fin 2)) x.1+(T.σ (1:Fin 2)) x.2)=x.2 + rw [map_add] + change (T.σ (0:Fin 2)≫T.δ (2:Fin 3)) x.1+(T.σ (1:Fin 2)≫T.δ (2:Fin 3)) x.2=x.2 + rw [sigma_zero_two T h0,T.δ_comp_σ_succ' (i:=(1:Fin 2)) (j:=(2:Fin 3)) rfl] + simp +omit h0 in +lemma d21 : (K T).d 2 1=T.δ (0:Fin 3)-T.δ (1:Fin 3)+T.δ (2:Fin 3) := by + simp [K,AlternatingFaceMapComplex.obj_d_eq,Fin.sum_univ_succ,sub_eq_add_neg,add_assoc] +lemma d10 : (K T).d 1 0=0 := h0.eq_zero_of_tgt _ +lemma sigma_d21 (i:Fin 2) : T.σ i ≫ (K T).d 2 1=0 := by + rw [d21,Preadditive.comp_add,Preadditive.comp_sub] + fin_cases i + · change T.σ (0:Fin 2)≫T.δ (0:Fin 3)-T.σ (0:Fin 2)≫T.δ (1:Fin 3)+T.σ (0:Fin 2)≫T.δ (2:Fin 3)=0 + rw [T.δ_comp_σ_self' (i:=(0:Fin 2)) (j:=(0:Fin 3)) rfl,T.δ_comp_σ_succ' (i:=(0:Fin 2)) (j:=(1:Fin 3)) rfl,sigma_zero_two T h0,sub_self,add_zero] + · change T.σ (1:Fin 2)≫T.δ (0:Fin 3)-T.σ (1:Fin 2)≫T.δ (1:Fin 3)+T.σ (1:Fin 2)≫T.δ (2:Fin 3)=0 + rw [sigma_one_zero T h0,T.δ_comp_σ_self' (i:=(1:Fin 2)) (j:=(1:Fin 3)) rfl,T.δ_comp_σ_succ' (i:=(1:Fin 2)) (j:=(2:Fin 3)) rfl] + abel +lemma boundary_sec : (ConcreteHomology.boundary (K T) 1).comp (sec T)=0 := by + apply LinearMap.ext + intro z + apply Subtype.ext + change (K T).d 2 1 ((T.σ (0:Fin 2)) z.1+(T.σ (1:Fin 2)) z.2)=0 + rw [map_add] + change (T.σ (0:Fin 2)≫(K T).d 2 1) z.1+(T.σ (1:Fin 2)≫(K T).d 2 1) z.2=0 + rw [sigma_d21 T h0,sigma_d21 T h0] + simp +lemma boundary_finite [Module.Finite R (LinearMap.ker (outer T))] : + Module.Finite R (LinearMap.range (ConcreteHomology.boundary (K T) 1)) := by + let f := (ConcreteHomology.boundary (K T) 1).rangeRestrict.comp (LinearMap.ker (outer T)).subtype + apply Module.Finite.of_surjective f + rintro ⟨y,x,rfl⟩ + change ↑(T.obj (op ⦋2⦌)) at x + refine ⟨⟨x-sec T (outer T x),?_⟩,?_⟩ + · change outer T (x-sec T (outer T x))=0 + rw [map_sub,show outer T (sec T (outer T x))=outer T x from + congrArg (fun t => t (outer T x)) (outer_sec T h0),sub_self] + · apply Subtype.ext + change ConcreteHomology.boundary (K T) 1 (x-sec T (outer T x))=ConcreteHomology.boundary (K T) 1 x + erw [map_sub,show ConcreteHomology.boundary (K T) 1 (sec T (outer T x))=0 from + congrArg (fun t => t (outer T x)) (boundary_sec T h0),sub_zero] +lemma finite_one [Module.Finite R (LinearMap.ker (outer T))] + [Module.Finite R ((K T).homology 1)] : Module.Finite R (T.obj (op ⦋1⦌)) := by + have : Module.Finite R (ConcreteHomology.H (K T) 1) := + Module.Finite.equiv (ConcreteHomology.iso (K T) 1).toLinearEquiv + have : Module.Finite R (LinearMap.range (ConcreteHomology.boundary (K T) 1)) := boundary_finite T h0 + have : Module.Finite R (ConcreteHomology.Cycles (K T) 1) := by + apply Module.Finite.of_submodule_quotient (LinearMap.range (ConcreteHomology.boundary (K T) 1)) + exact Module.Finite.of_surjective (ConcreteHomology.Cycles (K T) 1).subtype (by + intro x + exact ⟨⟨x,by change (K T).d 1 0 x=0; rw [d10 T h0]; rfl⟩,rfl⟩) +end SimplicialFirstFinite + +end + +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits MonoidalCategory HomologicalComplex SimplicialObject Simplicial Opposite AlgebraicTopology +namespace SimplicialDiagonal +open FreeChains + +attribute [local instance 1200] Submodule.module Prod.instModule +variable (X:I ⥤ SSet) +noncomputable def segalTwo : X.obj (op ⦋2⦌) ⟶ X.obj (op ⦋1⦌) ⊗ X.obj (op ⦋1⦌) := + CartesianMonoidalCategory.lift (X.map (SimplexCategory.δ (0:Fin 3)).op) (X.map (SimplexCategory.δ (2:Fin 3)).op) +noncomputable def segalKernelMap (q:ℕ) : + LinearMap.ker (SimplicialFirstFinite.outer (X⋙SSet.homologyFunctor Z q)) →ₗ[ℤ] + LinearMap.ker (ConnectedProduct.projection (X.obj (op ⦋1⦌)) (X.obj (op ⦋1⦌)) q).hom := + ((SSet.homologyMap (segalTwo X) Z q).hom.comp + (LinearMap.ker (SimplicialFirstFinite.outer (X⋙SSet.homologyFunctor Z q))).subtype).codRestrict _ (by + intro x + change ConnectedProduct.projection _ _ q (SSet.homologyMap (segalTwo X) Z q x.val)=0 + apply (ModuleCat.biprodIsoProd _ _).toLinearEquiv.injective + simp only [map_zero] + apply Prod.ext + · change (SSet.homologyMap (segalTwo X) Z q ≫ ConnectedProduct.projection _ _ q ≫ biprod.fst) x.val=0 + simp only [ConnectedProduct.projection,biprod.lift_fst,←SSet.homologyMap_comp, + segalTwo,CartesianMonoidalCategory.lift_fst] + exact congrArg Prod.fst x.property + · change (SSet.homologyMap (segalTwo X) Z q ≫ ConnectedProduct.projection _ _ q ≫ biprod.snd) x.val=0 + simp only [ConnectedProduct.projection,biprod.lift_snd,←SSet.homologyMap_comp, + segalTwo,CartesianMonoidalCategory.lift_snd] + exact congrArg Prod.snd x.property) +lemma segalKernelMap_injective (q:ℕ) [IsIso (SSet.homologyMap (segalTwo X) Z q)] : + Function.Injective (segalKernelMap X q) := by + intro x y h + apply Subtype.ext + exact (asIso (SSet.homologyMap (segalTwo X) Z q)).toLinearEquiv.injective (congrArg Subtype.val h) +lemma outer_kernel_finite (q:ℕ) [(X.obj (op ⦋1⦌)).IsConnected] + [IsIso (SSet.homologyMap (segalTwo X) Z q)] + (hf:∀i,i + if j.val+1 < k.val then x j.castSucc else + if j.val+1 = k.val then x j.castSucc * x j.succ else x j.succ +lemma labels_face (s:Simplex P (n+1)) (k:Fin (n+2)) : + labels ((nerve _).δ k s)=faceLabels k (labels s) := by + funext j + dsimp only [faceLabels] + change (s.map (homOfLE (show k.succAbove j.castSucc ≤ k.succAbove j.succ from + (Fin.succAboveOrderEmb k).monotone (Fin.castSucc_le_succ j)))).unop = _ + split_ifs with h h' + · apply map_congr s + · exact Fin.succAbove_of_castSucc_lt _ _ (by change j.val < k.val; omega) + · exact Fin.succAbove_of_castSucc_lt _ _ (by change j.val+1 < k.val; exact h) + · have hh : k.succAbove j.castSucc=j.castSucc.castSucc := + Fin.succAbove_of_castSucc_lt _ _ (by change j.val < k.val; omega) + have hh' : k.succAbove j.succ=j.succ.succ := + Fin.succAbove_of_le_castSucc _ _ (by change k.val ≤ j.val+1; omega) + rw [map_congr s hh hh' _ (homOfLE (show j.castSucc.castSucc ≤ j.succ.succ from by + change j.val ≤ j.val+2; omega))] + have hc:=congrArg Quiver.Hom.unop (s.map_comp + (homOfLE (Fin.castSucc_le_succ j.castSucc)) + (homOfLE (Fin.castSucc_le_succ j.succ))) + exact hc + · apply map_congr s + · exact Fin.succAbove_of_le_castSucc _ _ (by change k.val ≤ j.val; omega) + · exact Fin.succAbove_of_le_castSucc _ _ (by change k.val ≤ j.val+1; omega) +lemma tail_face_val (s:Simplex P (n+1)) (k:Fin (n+2)) (hk:k≠Fin.last (n+1)) : + (s.map (homOfLE (Fin.le_last (k.succAbove (Fin.last n))))).unop=(1:P) := by + have h:k.succAbove (Fin.last n)=Fin.last (n+1) := by + apply Fin.ext + rw [Fin.succAbove_of_le_castSucc _ _ (by change k.val ≤ n; have:=k.isLt; have hn:=Fin.val_ne_of_ne hk; dsimp at hn; omega)] + rfl + have he:=map_congr s h rfl (homOfLE (Fin.le_last (k.succAbove (Fin.last n)))) (𝟙 _) + rw [he,s.map_id] + rfl +lemma tail_face_last_val (s:Simplex P (n+1)) : + (s.map (homOfLE (Fin.le_last ((Fin.last (n+1)).succAbove (Fin.last n))))).unop=labels s (Fin.last n) := by + apply map_congr s + · simp + · rfl +end MonoidNerveCoordinates + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/MonoidNerveCoordinates.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/MonoidNerveCoordinates.lean new file mode 100644 index 0000000000000000000000000000000000000000..081f06cda8c6f9dc7c478dd04623044f8b1645d0 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/MonoidNerveCoordinates.lean @@ -0,0 +1,47 @@ +import Mathlib + +namespace OAI + +section +open CategoryTheory Simplicial SimplicialObject Opposite +namespace MonoidNerveCoordinates + +variable {P:Type} [CommMonoid P] {n:ℕ} +abbrev Simplex (P:Type) [CommMonoid P] (n:ℕ) := ComposableArrows (SingleObj P)ᵒᵖ n +def labels (s:Simplex P n) : Fin n→P := fun i=>(s.map (homOfLE (Fin.castSucc_le_succ i))).unop +noncomputable def ofLabels (x:Fin n→P) : Simplex P n := + ComposableArrows.mkOfObjOfMapSucc (fun _=>op (SingleObj.star P)) (fun i=>Quiver.Hom.op (x i:SingleObj.star P⟶SingleObj.star P)) +lemma eqToHom_val {x y:(SingleObj P)ᵒᵖ} (h:x=y) : (eqToHom h).unop=(1:P) := by subst y; rfl +@[simp] lemma labels_ofLabels (x:Fin n→P) : labels (ofLabels x)=x := by + funext i + exact congrArg Quiver.Hom.unop (ComposableArrows.mkOfObjOfMapSucc_map_succ _ _ i.val i.isLt) +@[simp] lemma ofLabels_labels (s:Simplex P n) : ofLabels (labels s)=s := by + apply ComposableArrows.ext (fun _=>Subsingleton.elim _ _) + intro i hi + apply Quiver.Hom.unop_inj + simp only [unop_comp,eqToHom_val,SingleObj.comp_as_mul,one_mul,mul_one] + exact congrArg Quiver.Hom.unop (ComposableArrows.mkOfObjOfMapSucc_map_succ _ _ i hi) +noncomputable def equiv (P:Type) [CommMonoid P] (n:ℕ) : Simplex P n ≃ (Fin n→P) where + toFun := labels + invFun := ofLabels + left_inv := ofLabels_labels + right_inv := labels_ofLabels +lemma labels_zero_face (s:Simplex P (n+1)) : + labels ((nerve _).δ (0:Fin (n+2)) s)=Fin.tail (labels s) := by funext i; rfl +lemma map_congr (s:Simplex P n) {i j i' j':Fin (n+1)} (hi:i=i') (hj:j=j') + (f:i⟶j) (g:i'⟶j') : (s.map f).unop=(s.map g).unop := by + subst i'; subst j' + congr 2 + exact Subsingleton.elim _ _ +lemma labels_last_face (s:Simplex P (n+1)) : + labels ((nerve _).δ (Fin.last (n+1)) s)=Fin.init (labels s) := by + funext i + change (s.map (homOfLE (show (Fin.last (n+1)).succAbove i.castSucc ≤ + (Fin.last (n+1)).succAbove i.succ from by simpa using Fin.castSucc_le_succ i.castSucc))).unop = + (s.map (homOfLE (Fin.castSucc_le_succ i.castSucc))).unop + apply map_congr s <;> simp +end MonoidNerveCoordinates + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/MonoidalCongruence.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/MonoidalCongruence.lean new file mode 100644 index 0000000000000000000000000000000000000000..a296e0aa250ef61aec5d699c58fb3f0e93836b53 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/MonoidalCongruence.lean @@ -0,0 +1,217 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.TripleComposition +import OAI.GroupTheory.SimpleAmenable.Simplicial.RestrictedTripleDegree + +namespace OAI + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory MonoidalCategory +namespace IntervalBar.Diagram + +variable {C D:Type} [Groupoid.{0} C] [Groupoid.{0} D] + [MonoidalCategory C] [MonoidalCategory D] +lemma monoidal_congr {F G:C⥤D} [hF:F.Monoidal] [hG:G.Monoidal] (e:F=G) + (h:NatTrans.IsMonoidal (eqToHom e)) : HEq hF hG := by + cases e + apply heq_of_eq + have hε : hF.ε=hG.ε := by + have hh := h.unit + simpa only [eqToHom_refl,NatTrans.id_app,Category.comp_id] using hh + have hμ : hF.μ=hG.μ := by + funext X Y + have hh := h.tensor X Y + simpa only [eqToHom_refl,NatTrans.id_app,Category.comp_id,id_tensorHom_id,Category.id_comp] using hh + apply Functor.Monoidal.ext hε hμ + · have he : @Functor.Monoidal.εIso _ _ _ _ _ _ F hF = @Functor.Monoidal.εIso _ _ _ _ _ _ F hG := Iso.ext hε + exact congrArg Iso.inv he + · funext X Y + have he : @Functor.Monoidal.μIso _ _ _ _ _ _ F hF X Y = @Functor.Monoidal.μIso _ _ _ _ _ _ F hG X Y := + Iso.ext (congrFun (congrFun hμ X) Y) + exact congrArg Iso.inv he +lemma map_congr {I:Type} [Preorder I] {F G:C⥤D} [hF:F.Monoidal] [hG:G.Monoidal] + (e:F=G) (h:NatTrans.IsMonoidal (eqToHom e)) : map (I:=I) F=map G := by + have hm := monoidal_congr e h + cases e + have hh : hF=hG := eq_of_heq hm + cases hh + rfl +end IntervalBar.Diagram + +end + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory MonoidalCategory SimplicialObject Simplicial Opposite +namespace RestrictedNerve +open IntervalBar IntervalBar.Diagram + +variable {C:Type} [Groupoid.{0} C] (W:MorphismProperty C) + [Fact W.StableUnderInverse] [MonoidalCategory C] [SymmetricCategory C] + [W.IsStableUnderBraiding] +variable {I:Type} [Preorder I] +@[simp] lemma transpose_ε (n:ℕ) : + Functor.LaxMonoidal.ε (transposeDiagram (I:=I) W n)=transposeε W n := rfl +@[simp] lemma transpose_μ (n:ℕ) (A B:Diagram (Strings W n) I) : + Functor.LaxMonoidal.μ (transposeDiagram W n) A B=transposeμ W n A B := rfl +omit [Fact W.StableUnderInverse] in +@[simp] lemma reindex_ε {n m:ℕ} (u:Fin (n+1)⥤Fin (m+1)) : + Functor.LaxMonoidal.ε (reindex W u)=𝟙 _ := rfl +@[simp] lemma map_reindex_ε {n m:ℕ} (u:Fin (n+1)⥤Fin (m+1)) : + Functor.LaxMonoidal.ε (Diagram.map (I:=I) (reindex W u))=Diagram.mapεHom (reindex W u) := rfl +@[simp] lemma map_reindex_μ {n m:ℕ} (u:Fin (n+1)⥤Fin (m+1)) (A B:Diagram (Strings W m) I) : + Functor.LaxMonoidal.μ (Diagram.map (reindex W u)) A B=Diagram.mapμHom (reindex W u) A B := rfl +lemma transpose_reindex {p q:SimplexCategoryᵒᵖ} (f:p⟶q) : + Diagram.map (I:=I) (reindex W f.unop.toOrderHom.toFunctor) ⋙ transposeDiagram W q.unop.len = + transposeDiagram W p.unop.len ⋙ reindex (diagramProperty W I) f.unop.toOrderHom.toFunctor := + congrArg Cat.Hom.toFunctor ((diagramTranspose (I:=I) W).naturality f) +private noncomputable abbrev transposeReindexLeft {p q:SimplexCategoryᵒᵖ} (f:p⟶q) := (Diagram.map (I:=I) (reindex W f.unop.toOrderHom.toFunctor) ⋙ transposeDiagram W q.unop.len) +private noncomputable abbrev transposeReindexRight {p q:SimplexCategoryᵒᵖ} (f:p⟶q) := (transposeDiagram (I:=I) W p.unop.len ⋙ reindex (diagramProperty W I) f.unop.toOrderHom.toFunctor) +private noncomputable abbrev transposeReindexHom {p q:SimplexCategoryᵒᵖ} (f:p⟶q) : + transposeReindexLeft (I:=I) W f ⟶ transposeReindexRight (I:=I) W f := (eqToHom (transpose_reindex (I:=I) W f)) +private lemma transpose_comp_app {n : ℕ} + {A B D : Strings (diagramProperty W I) n} (f : A ⟶ B) (g : B ⟶ D) + (t : Fin (n+1)) (i j : I) (h : i ≤ j) : + ((f ≫ g).hom.app t).hom.app i j h = + (f.hom.app t).hom.app i j h ≫ (g.hom.app t).hom.app i j h := rfl +private lemma transpose_tensor_app {n : ℕ} + {A B D E : Strings (diagramProperty W I) n} (f : A ⟶ B) (g : D ⟶ E) + (t : Fin (n+1)) (i j : I) (h : i ≤ j) : + ((f ⊗ₘ g).hom.app t).hom.app i j h = + (f.hom.app t).hom.app i j h ⊗ₘ (g.hom.app t).hom.app i j h := by + change ((f.hom.app t ⊗ₘ g.hom.app t).hom.app i j h) = _ + exact posTensor_app W I (f.hom.app t) (g.hom.app t) i j h +private lemma transpose_reindex_unit {p q:SimplexCategoryᵒᵖ} (f:p⟶q) : + Functor.LaxMonoidal.ε (transposeReindexLeft (I:=I) W f) ≫ + (transposeReindexHom (I:=I) W f).app (𝟙_ _) = + Functor.LaxMonoidal.ε (transposeReindexRight (I:=I) W f) := by + apply WideSubcategory.hom_ext; apply NatTrans.ext; funext t + apply InducedCategory.hom_ext; apply Hom.ext; intro i j h + simp only [transposeReindexHom, CategoryTheory.eqToHom_app] + simp only [Functor.LaxMonoidal.comp_ε,transpose_ε,reindex_ε,map_reindex_ε] + simp [transposeDiagram,transposeDiagramHom,transposeε, + Diagram.mapεHom,reindex] + erw [comp_app, comp_app, eqToHom_transposed_app] + change (𝟙 (𝟙_ C)) ≫ 𝟙 _ ≫ 𝟙 _ = 𝟙 _ + simp only [Category.id_comp] +private lemma transposeReindexHom_app {p q:SimplexCategoryᵒᵖ} (f:p⟶q) + (A:Diagram (Strings W p.unop.len) I) + (t:Fin (q.unop.len+1)) (i j:I) (h:i≤j) : + (((transposeReindexHom (I:=I) W f).app A).hom.app t).hom.app i j h = + 𝟙 ((A.obj i j h).obj.obj (f.unop.toOrderHom.toFunctor.obj t)) := by + simp only [transposeReindexHom, CategoryTheory.eqToHom_app] + erw [eqToHom_transposed_app] + rfl +private lemma transposeReindexLeft_μ_app {p q:SimplexCategoryᵒᵖ} (f:p⟶q) + (A B:Diagram (Strings W p.unop.len) I) + (t:Fin (q.unop.len+1)) (i j:I) (h:i≤j) : + ((Functor.LaxMonoidal.μ (transposeReindexLeft (I:=I) W f) A B).hom.app t).hom.app i j h = + 𝟙 ((A.obj i j h).obj.obj (f.unop.toOrderHom.toFunctor.obj t) ⊗ + (B.obj i j h).obj.obj (f.unop.toOrderHom.toFunctor.obj t)) := by + change (𝟙 _) ≫ 𝟙 _ = 𝟙 _ + exact Category.id_comp _ +private lemma transpose_reindex_tensor {p q:SimplexCategoryᵒᵖ} (f:p⟶q) + (A B:Diagram (Strings W p.unop.len) I) : + Functor.LaxMonoidal.μ (transposeReindexLeft (I:=I) W f) A B ≫ + (transposeReindexHom (I:=I) W f).app (A ⊗ B) = + ((transposeReindexHom (I:=I) W f).app A ⊗ₘ + (transposeReindexHom (I:=I) W f).app B) ≫ + Functor.LaxMonoidal.μ (transposeReindexRight (I:=I) W f) A B := by + apply WideSubcategory.hom_ext; apply NatTrans.ext; funext t + apply InducedCategory.hom_ext; apply Hom.ext; intro i j h + erw [transpose_comp_app W (Functor.LaxMonoidal.μ (transposeReindexLeft (I:=I) W f) A B) + ((transposeReindexHom (I:=I) W f).app (A ⊗ B))] + erw [transpose_comp_app W + ((transposeReindexHom (I:=I) W f).app A ⊗ₘ (transposeReindexHom (I:=I) W f).app B) + (Functor.LaxMonoidal.μ (transposeReindexRight (I:=I) W f) A B)] + erw [transpose_tensor_app] + erw [transposeReindexLeft_μ_app, transposeReindexHom_app] + erw [transposeReindexHom_app W f A, transposeReindexHom_app W f B] + change (𝟙 ((A.obj i j h).obj.obj (f.unop.toOrderHom.toFunctor.obj t) ⊗ + (B.obj i j h).obj.obj (f.unop.toOrderHom.toFunctor.obj t))) ≫ 𝟙 _ = + (𝟙 _ ⊗ₘ 𝟙 _) ≫ 𝟙 _ + simp only [id_tensorHom_id, Category.comp_id] +noncomputable instance transpose_reindex_monoidal {p q:SimplexCategoryᵒᵖ} (f:p⟶q) : + NatTrans.IsMonoidal (eqToHom (transpose_reindex (I:=I) W f)) where + unit := transpose_reindex_unit W f + tensor A B := transpose_reindex_tensor W f A B +end RestrictedNerve + +end + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory MonoidalCategory +namespace IntervalBar.Diagram + +variable {C D:Type} [Groupoid.{0} C] [Groupoid.{0} D] + [MonoidalCategory C] [MonoidalCategory D] + [SymmetricCategory C] [SymmetricCategory D] +lemma braided_congr {F G:C⥤D} [hF:F.Braided] [hG:G.Braided] (e:F=G) + (h:NatTrans.IsMonoidal (eqToHom e)) : HEq hF hG := by + have hm := monoidal_congr e h + cases e + apply heq_of_eq + apply Functor.Braided.ext + · exact congrArg (fun h:F.Monoidal=>h.ε) (eq_of_heq hm) + · exact congrArg (fun h:F.Monoidal=>h.μ) (eq_of_heq hm) + · exact congrArg (fun h:F.Monoidal=>h.η) (eq_of_heq hm) + · exact congrArg (fun h:F.Monoidal=>h.δ) (eq_of_heq hm) +lemma map₂_congr {I J:Type} [Preorder I] [Preorder J] + {F G:C⥤D} [hF:F.Braided] [hG:G.Braided] (e:F=G) + (h:NatTrans.IsMonoidal (eqToHom e)) : + map (I:=J) (map (I:=I) F)=map (map G) := by + have hm := braided_congr e h + cases e + have hh : hF=hG := eq_of_heq hm + cases hh + rfl +end IntervalBar.Diagram + +end + +open _root_.CategoryTheory _root_.OAI.CategoryTheory MonoidalCategory SimplicialObject Simplicial Opposite +namespace RestrictedNerve +open IntervalBar IntervalBar.Diagram + +variable {C:Type} [Groupoid.{0} C] (W:MorphismProperty C) + [Fact W.StableUnderInverse] [MonoidalCategory C] [SymmetricCategory C] + [W.IsStableUnderBraiding] +lemma tripleTranspose_reindex (p q r:ℕ) {u v:SimplexCategoryᵒᵖ} (f:u⟶v) : + Diagram.map (I:=Fin (r+1)) (Diagram.map (I:=Fin (q+1)) (Diagram.map (I:=Fin (p+1)) + (reindex W f.unop.toOrderHom.toFunctor))) ⋙ tripleTranspose W p q r v.unop.len = + tripleTranspose W p q r u.unop.len ⋙ reindex (property₃ W p q r) f.unop.toOrderHom.toFunctor := by + have h₁ := map₂_congr (I:=Fin (q+1)) (J:=Fin (r+1)) + (transpose_reindex (I:=Fin (p+1)) W f) (transpose_reindex_monoidal W f) + rw [map₂_comp,map₂_comp] at h₁ + have h₂ := map_congr (I:=Fin (r+1)) + (transpose_reindex (I:=Fin (q+1)) (diagramProperty W (Fin (p+1))) f) + (transpose_reindex_monoidal (diagramProperty W (Fin (p+1))) f) + rw [Diagram.map_comp,Diagram.map_comp] at h₂ + have h₃ := transpose_reindex (I:=Fin (r+1)) (property₂ W p q) f + unfold tripleTranspose + rw [←Functor.assoc,←Functor.assoc,h₁] + simp only [Functor.assoc] + rw [←Functor.assoc + (Diagram.map (I:=Fin (r+1)) (Diagram.map (I:=Fin (q+1)) + (reindex (diagramProperty W (Fin (p+1))) f.unop.toOrderHom.toFunctor))) + (Diagram.map (I:=Fin (r+1)) (transposeDiagram (I:=Fin (q+1)) + (diagramProperty W (Fin (p+1))) v.unop.len)) + (transposeDiagram (I:=Fin (r+1)) (property₂ W p q) v.unop.len),h₂] + simp only [Functor.assoc] + rw [h₃] +noncomputable def tripleDiagramTranspose (p q r:ℕ) : + tripleDiagramHorizontal W p q r ⟶ horizontal (property₃ W p q r) where + app n := (tripleTranspose W p q r n.unop.len).toCatHom + naturality u v f := by apply Cat.ext; exact tripleTranspose_reindex W p q r f + +noncomputable def tripleDiagramResolutionHomologyIso (p q r j:ℕ) : + (SimplicialDiagonal.nerveDiagonal.obj (tripleDiagramHorizontal W p q r)).homology + DiagonalResolution.Z j ≅ + (nerve (Diagram (Diagram (Diagram C (Fin (p+1))) (Fin (q+1))) (Fin (r+1)))).homology + DiagonalResolution.Z j := by + haveI := SimplicialDiagonal.nerveDiagonal_isIso (tripleDiagramTranspose W p q r) + (fun n=>inferInstanceAs (tripleTranspose W p q r n.unop.len).IsEquivalence) j + exact asIso (SSet.homologyMap + (SimplicialDiagonal.nerveDiagonal.map (tripleDiagramTranspose W p q r)) + DiagonalResolution.Z j) ≪≫ tripleRestrictedHomologyIso W p q r j +end RestrictedNerve + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/NerveProduct.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/NerveProduct.lean new file mode 100644 index 0000000000000000000000000000000000000000..312f85e1f75e10e5330b97282bac69b2a68e5040 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/NerveProduct.lean @@ -0,0 +1,193 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.ComponentStable + +namespace OAI + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits MonoidalCategory Simplicial Opposite +namespace NerveProduct +open FreeChains + +variable (C D:Type) [Category.{0} C] [Category.{0} D] +noncomputable def iso : nerve (C×D) ≅ nerve C⊗nerve D where + hom := {app _:=↾fun F=>(F⋙CategoryTheory.Prod.fst C D,F⋙CategoryTheory.Prod.snd C D) + naturality _ _ _:=rfl} + inv := {app _:=↾fun F=>F.1.prod' F.2 + naturality _ _ _:=rfl} + hom_inv_id := by ext p F; rfl + inv_hom_id := by ext p F <;> rfl +variable {C D} {C' D':Type} [Category.{0} C'] [Category.{0} D'] +@[reassoc] lemma natural (f:C⥤C') (g:D⥤D') : + nerveMap (f.prod g) ≫ (iso C' D').hom=(iso C D).hom ≫ (nerveMap f⊗ₘnerveMap g) := rfl +@[simp] lemma fst : (iso C D).hom ≫ CartesianMonoidalCategory.fst _ _=nerveMap (CategoryTheory.Prod.fst C D) := rfl +@[simp] lemma snd : (iso C D).hom ≫ CartesianMonoidalCategory.snd _ _=nerveMap (CategoryTheory.Prod.snd C D) := rfl +end NerveProduct +namespace ComponentStable +open FreeChains ComponentTranslation + +variable {C:Type} [Groupoid.{0} C] [MonoidalCategory C] [SymmetricCategory C] +noncomputable def reprObjectIso (U:C) : repr (toSkeleton U) ≅ U := Skeleton.isoOfEq (repr_component _) +omit [SymmetricCategory C] in +lemma tensorLeft_stable (U:C) (q:ℕ) : + SSet.homologyMap (nerveMap (tensorLeft U)) Z q ≫ toStable q=toStable (C:=C) q := by + apply (ComponentCoproduct.homologyIsColimit C q).hom_ext + intro p + change inclusion p.as q ≫ (SSet.homologyMap (nerveMap (tensorLeft U)) Z q ≫ toStable q)=inclusion p.as q ≫ toStable q + let e : (property p.as).ι ⋙ tensorLeft U ≅ + translate (toSkeleton U) p.as (toSkeleton U*p.as) rfl ⋙ (property (toSkeleton U*p.as)).ι := + (Functor.isoWhiskerLeft (property p.as).ι ((tensoringLeft C).mapIso (reprObjectIso U))).symm + have h:=(NerveHomotopy.ofNatTrans e.hom).congr_homologyMap Z q + change SSet.homologyMap (nerveMap (property p.as).ι ≫ nerveMap (tensorLeft U)) Z q = + SSet.homologyMap (nerveMap (translate (toSkeleton U) p.as (toSkeleton U*p.as) rfl) ≫ nerveMap (property (toSkeleton U*p.as)).ι) Z q at h + rw [SSet.homologyMap_comp,SSet.homologyMap_comp] at h + change inclusion p.as q ≫ (SSet.homologyMap (nerveMap (tensorLeft U)) Z q ≫ toStable q)=_ + rw [←Category.assoc] + change (SSet.homologyMap (nerveMap (property p.as).ι) Z q ≫ SSet.homologyMap (nerveMap (tensorLeft U)) Z q) ≫ toStable q = _ + rw [h,Category.assoc] + exact translate_toStable _ _ _ rfl q +lemma tensorRight_stable (U:C) (q:ℕ) : + SSet.homologyMap (nerveMap (tensorRight U)) Z q ≫ toStable q=toStable (C:=C) q := by + have h:=(NerveHomotopy.ofNatTrans (BraidedCategory.tensorLeftIsoTensorRight U).hom).congr_homologyMap Z q + rw [←h,tensorLeft_stable] +noncomputable def tensorFunctor : C×C ⥤ C where + obj X:=X.1⊗X.2 + map f:=f.1⊗ₘf.2 + map_id _:=by simp + map_comp _ _:=by simp [tensorHom_comp_tensorHom] +noncomputable def multiplication : nerve C⊗nerve C ⟶ nerve C := + (NerveProduct.iso C C).inv ≫ nerveMap tensorFunctor +noncomputable def binaryD (q:ℕ) : (nerve C⊗nerve C).homology Z q ⟶ object (C:=C) q := + (SSet.homologyMap (CartesianMonoidalCategory.fst _ _) Z q + + SSet.homologyMap (CartesianMonoidalCategory.snd _ _) Z q - + SSet.homologyMap multiplication Z q) ≫ toStable q +noncomputable def leftTensorIso (U:C) : + ((tensorLeft U).prod (𝟭 C)) ⋙ tensorFunctor ≅ tensorFunctor ⋙ tensorLeft U := + NatIso.ofComponents (fun X=>α_ U X.1 X.2) (by + intro X Y f + change ((U ◁ f.1)⊗ₘf.2) ≫ (α_ U Y.1 Y.2).hom = (α_ U X.1 X.2).hom ≫ (U ◁ (f.1⊗ₘf.2)) + simp [←id_tensorHom]) +noncomputable def rightTensorIso (U:C) : + ((𝟭 C).prod (tensorRight U)) ⋙ tensorFunctor ≅ tensorFunctor ⋙ tensorRight U := + NatIso.ofComponents (fun X=>(α_ X.1 X.2 U).symm) (by + intro X Y f + change (f.1⊗ₘ(f.2 ▷ U)) ≫ (α_ Y.1 Y.2 U).inv = (α_ X.1 X.2 U).inv ≫ ((f.1⊗ₘf.2) ▷ U) + simp [←tensorHom_id]) +omit [SymmetricCategory C] in +@[reassoc] lemma multiplication_left (U:C) (q:ℕ) : + SSet.homologyMap (nerveMap (tensorLeft U)⊗ₘ𝟙 (nerve C)) Z q ≫ + SSet.homologyMap multiplication Z q ≫ toStable q = + SSet.homologyMap (multiplication (C:=C)) Z q ≫ toStable q := by + apply (cancel_epi (SSet.homologyMap (NerveProduct.iso C C).hom Z q)).mp + rw [←SSet.homologyMap_comp_assoc] + have he : (NerveProduct.iso C C).hom ≫ (nerveMap (tensorLeft U)⊗ₘ𝟙 (nerve C)) = + nerveMap ((tensorLeft U).prod (𝟭 C)) ≫ (NerveProduct.iso C C).hom := rfl + have hm : (NerveProduct.iso C C).hom ≫ multiplication=nerveMap tensorFunctor := by simp [multiplication] + rw [he,SSet.homologyMap_comp_assoc] + rw [←SSet.homologyMap_comp_assoc (f:=(NerveProduct.iso C C).hom) (g:=multiplication),hm] + rw [←SSet.homologyMap_comp_assoc] + have h:=(NerveHomotopy.ofNatTrans (leftTensorIso U).hom).congr_homologyMap Z q + change SSet.homologyMap (nerveMap (((tensorLeft U).prod (𝟭 C)) ⋙ tensorFunctor)) Z q ≫ toStable q = _ + rw [h,map_comp,Category.assoc,tensorLeft_stable] +@[reassoc] lemma multiplication_right (U:C) (q:ℕ) : + SSet.homologyMap (𝟙 (nerve C)⊗ₘnerveMap (tensorRight U)) Z q ≫ + SSet.homologyMap multiplication Z q ≫ toStable q = + SSet.homologyMap (multiplication (C:=C)) Z q ≫ toStable q := by + apply (cancel_epi (SSet.homologyMap (NerveProduct.iso C C).hom Z q)).mp + rw [←SSet.homologyMap_comp_assoc] + have he : (NerveProduct.iso C C).hom ≫ (𝟙 (nerve C)⊗ₘnerveMap (tensorRight U)) = + nerveMap ((𝟭 C).prod (tensorRight U)) ≫ (NerveProduct.iso C C).hom := rfl + have hm : (NerveProduct.iso C C).hom ≫ multiplication=nerveMap tensorFunctor := by simp [multiplication] + rw [he,SSet.homologyMap_comp_assoc] + rw [←SSet.homologyMap_comp_assoc (f:=(NerveProduct.iso C C).hom) (g:=multiplication),hm] + rw [←SSet.homologyMap_comp_assoc] + have h:=(NerveHomotopy.ofNatTrans (rightTensorIso U).hom).congr_homologyMap Z q + change SSet.homologyMap (nerveMap (((𝟭 C).prod (tensorRight U)) ⋙ tensorFunctor)) Z q ≫ toStable q = _ + rw [h,map_comp,Category.assoc,tensorRight_stable] +end ComponentStable + +end + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits MonoidalCategory Simplicial Opposite +namespace NerveProduct +open FreeChains + +variable {C D E F:Type} [Category.{0} C] [Category.{0} D] [Category.{0} E] [Category.{0} F] +lemma homology_congr {f f':C⥤E} {g g':D⥤F} (α:f≅f') (β:g≅g') (q:ℕ) : + SSet.homologyMap (nerveMap f⊗ₘnerveMap g) Z q=SSet.homologyMap (nerveMap f'⊗ₘnerveMap g') Z q := by + apply (cancel_epi (SSet.homologyMap (iso C D).hom Z q)).mp + rw [←SSet.homologyMap_comp,←natural,←SSet.homologyMap_comp,←natural, + SSet.homologyMap_comp,SSet.homologyMap_comp] + rw [(NerveHomotopy.ofNatTrans (NatIso.prod α β).hom).congr_homologyMap Z q] +end NerveProduct +namespace ComponentStable +open FreeChains ComponentTranslation ConnectedProduct + +variable {C:Type} [Groupoid.{0} C] [MonoidalCategory C] [SymmetricCategory C] +omit [SymmetricCategory C] in +@[reassoc] lemma binaryD_left (U:C) (q:ℕ) : + SSet.homologyMap (nerveMap (tensorLeft U)⊗ₘ𝟙 (nerve C)) Z q ≫ binaryD q=binaryD (C:=C) q := by + let f:=nerveMap (tensorLeft U)⊗ₘ𝟙 (nerve C) + have hf : f≫CartesianMonoidalCategory.fst _ _=CartesianMonoidalCategory.fst _ _≫nerveMap (tensorLeft U) := rfl + have hg : f≫CartesianMonoidalCategory.snd _ _=CartesianMonoidalCategory.snd _ _ := rfl + simp only [binaryD,Preadditive.comp_add,Preadditive.comp_sub,Preadditive.add_comp,Preadditive.sub_comp] + rw [multiplication_left,←SSet.homologyMap_comp_assoc,hf,SSet.homologyMap_comp_assoc,tensorLeft_stable, + ←SSet.homologyMap_comp_assoc,hg] +@[reassoc] lemma binaryD_right (U:C) (q:ℕ) : + SSet.homologyMap (𝟙 (nerve C)⊗ₘnerveMap (tensorRight U)) Z q ≫ binaryD q=binaryD (C:=C) q := by + let f:=𝟙 (nerve C)⊗ₘnerveMap (tensorRight U) + have hf : f≫CartesianMonoidalCategory.fst _ _=CartesianMonoidalCategory.fst _ _ := rfl + have hg : f≫CartesianMonoidalCategory.snd _ _=CartesianMonoidalCategory.snd _ _≫nerveMap (tensorRight U) := rfl + simp only [binaryD,Preadditive.comp_add,Preadditive.comp_sub,Preadditive.add_comp,Preadditive.sub_comp] + rw [multiplication_right,←SSet.homologyMap_comp_assoc,hf,←SSet.homologyMap_comp_assoc,hg, + SSet.homologyMap_comp_assoc,tensorRight_stable] +@[reassoc] lemma binaryD_second_left (U:C) (q:ℕ) : + SSet.homologyMap (𝟙 (nerve C)⊗ₘnerveMap (tensorLeft U)) Z q ≫ binaryD q=binaryD (C:=C) q := by + have h:=NerveProduct.homology_congr (Iso.refl (𝟭 C)) (BraidedCategory.tensorLeftIsoTensorRight U) q + change SSet.homologyMap (𝟙 (nerve C)⊗ₘnerveMap (tensorLeft U)) Z q = + SSet.homologyMap (𝟙 (nerve C)⊗ₘnerveMap (tensorRight U)) Z q at h + rw [h,binaryD_right] +omit [SymmetricCategory C] in +lemma pairLeft_multiplication (U:C) : + pairLeft (nerve C) (nerve C) (nerveEquiv.symm U) ≫ multiplication=nerveMap (tensorRight U) := by + apply NatTrans.ext; funext p; apply ConcreteCategory.hom_ext; intro F + apply CategoryTheory.Functor.ext + · intro x y f + change (F.map f ⊗ₘ 𝟙 U) = 𝟙 _ ≫ (F.map f ▷ U) ≫ 𝟙 _ + simp + · intro x; rfl +omit [SymmetricCategory C] in +lemma pairRight_multiplication (U:C) : + pairRight (nerve C) (nerve C) (nerveEquiv.symm U) ≫ multiplication=nerveMap (tensorLeft U) := by + apply NatTrans.ext; funext p; apply ConcreteCategory.hom_ext; intro F + apply CategoryTheory.Functor.ext + · intro x y f + change (𝟙 U ⊗ₘ F.map f) = 𝟙 _ ≫ (U ◁ F.map f) ≫ 𝟙 _ + simp + · intro x; rfl +@[reassoc] lemma pairLeft_binaryD (v:(nerve C).obj (op ⦋0⦌)) (q:ℕ) (hq:q≠0) : + SSet.homologyMap (pairLeft (nerve C) (nerve C) v) Z q ≫ binaryD q=0 := by + obtain ⟨U,rfl⟩:=nerveEquiv.symm.surjective v + have constant_zero : SSet.homologyMap (SSet.const (nerveEquiv.symm U) : nerve C ⟶ nerve C) Z q = 0 := + const_homology_zero _ q hq + simp only [binaryD,Preadditive.comp_add,Preadditive.comp_sub,Preadditive.add_comp,Preadditive.sub_comp] + rw [←SSet.homologyMap_comp_assoc,←SSet.homologyMap_comp_assoc,←SSet.homologyMap_comp_assoc, + pairLeft_multiplication] + simp only [pairLeft,CartesianMonoidalCategory.lift_fst,CartesianMonoidalCategory.lift_snd, + SSet.homologyMap_id,constant_zero,Category.id_comp,zero_comp,add_zero,tensorRight_stable,sub_self] +omit [SymmetricCategory C] in +@[reassoc] lemma pairRight_binaryD (v:(nerve C).obj (op ⦋0⦌)) (q:ℕ) (hq:q≠0) : + SSet.homologyMap (pairRight (nerve C) (nerve C) v) Z q ≫ binaryD q=0 := by + obtain ⟨U,rfl⟩:=nerveEquiv.symm.surjective v + have constant_zero : SSet.homologyMap (SSet.const (nerveEquiv.symm U) : nerve C ⟶ nerve C) Z q = 0 := + const_homology_zero _ q hq + simp only [binaryD,Preadditive.comp_add,Preadditive.comp_sub,Preadditive.add_comp,Preadditive.sub_comp] + rw [←SSet.homologyMap_comp_assoc,←SSet.homologyMap_comp_assoc,←SSet.homologyMap_comp_assoc, + pairRight_multiplication] + simp only [pairRight,CartesianMonoidalCategory.lift_fst,CartesianMonoidalCategory.lift_snd, + SSet.homologyMap_id,constant_zero,Category.id_comp,zero_comp,zero_add,tensorLeft_stable,sub_self] +end ComponentStable + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/NestedPosReindex.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/NestedPosReindex.lean new file mode 100644 index 0000000000000000000000000000000000000000..b1c19699dd2d89c9e71ad1448bad63c2e15ded62 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/NestedPosReindex.lean @@ -0,0 +1,278 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.MonoidalCongruence +import OAI.GroupTheory.SimpleAmenable.Simplicial.DiagramResolutionNatural + +namespace OAI + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory MonoidalCategory SimplicialObject Simplicial Opposite +namespace RestrictedNerve + +open IntervalBar IntervalBar.Diagram + +variable {C:Type} [Groupoid.{0} C] (W:MorphismProperty C) + [Fact W.StableUnderInverse] [MonoidalCategory C] [SymmetricCategory C] + [W.IsStableUnderBraiding] +variable {I J K:Type} [Preorder I] [Preorder J] [Preorder K] +omit [Fact W.StableUnderInverse] in +@[simp] lemma inclusion_η : Functor.OplaxMonoidal.η (inclusion W) = 𝟙 _ := rfl +omit [Fact W.StableUnderInverse] in +@[simp] lemma inclusion_μ (A B:WideSubcategory W) : + Functor.LaxMonoidal.μ (inclusion W) A B = 𝟙 _ := rfl +@[simp] lemma widePosReindex_η (u:I→oJ) : + Functor.OplaxMonoidal.η (widePosReindex W u) = 𝟙 _ := rfl +@[simp] lemma widePosReindex_μ (u:I→oJ) (A B:WideSubcategory (diagramProperty W J)) : + Functor.LaxMonoidal.μ (widePosReindex W u) A B = 𝟙 _ := rfl +@[simp] lemma posReindex_η (u:I→oJ) : + Functor.OplaxMonoidal.η (posReindex W u) = 𝟙 _ := rfl +@[simp] lemma posReindex_μ (u:I→oJ) (A B:PosDiagrams W J) : + Functor.LaxMonoidal.μ (posReindex W u) A B = 𝟙 _ := rfl +@[simp] lemma eqToHom_pos_app {A B:PosDiagrams W I} (e:A=B) (i j:I) (h:i≤j) : + (eqToHom e).hom.app i j h = + eqToHom (congrArg (fun A:PosDiagrams W I=>((diagramInclusion W I).obj A).obj i j h) e) := by + cases e; rfl +noncomputable def nestedPosReindex (u:I→oJ) : + PosDiagrams (diagramProperty W J) K ⥤ PosDiagrams (diagramProperty W I) K where + obj A := (Diagram.map (I:=K) (widePosReindex W u)).obj A + map {A B} f := InducedCategory.homMk { + app i j h := (posReindex W u).map (f.hom.app i j h) + unit i := by + apply InducedCategory.hom_ext; apply Hom.ext; intro x y h + have he := congrArg (fun z => z.hom.app (u x) (u y) (u.monotone h)) (f.hom.unit i) + change (f.hom.app i i (le_refl i)).hom.app (u x) (u y) (u.monotone h) ≫ + ((B.unit i).hom.hom.hom.app (u x) (u y) (u.monotone h) ≫ 𝟙 _) = + (A.unit i).hom.hom.hom.app (u x) (u y) (u.monotone h) ≫ 𝟙 _ at he + change (f.hom.app i i (le_refl i)).hom.app (u x) (u y) (u.monotone h) ≫ + (((B.unit i).hom.hom.hom.app (u x) (u y) (u.monotone h) ≫ 𝟙 _) ≫ 𝟙 _) = + ((A.unit i).hom.hom.hom.app (u x) (u y) (u.monotone h) ≫ 𝟙 _) ≫ 𝟙 _ + simpa only [Category.comp_id] using he + cut i j k hij hjk := by + apply InducedCategory.hom_ext; apply Hom.ext; intro x y h + have he := congrArg (fun z => z.hom.app (u x) (u y) (u.monotone h)) (f.hom.cut i j k hij hjk) + change ((f.hom.app i j hij ⊗ₘ f.hom.app j k hjk).hom.app (u x) (u y) (u.monotone h)) ≫ + (𝟙 _ ≫ (B.cut i j k hij hjk).hom.hom.hom.app (u x) (u y) (u.monotone h)) = + (𝟙 _ ≫ (A.cut i j k hij hjk).hom.hom.hom.app (u x) (u y) (u.monotone h)) ≫ + (f.hom.app i k (le_trans hij hjk)).hom.app (u x) (u y) (u.monotone h) at he + erw [posTensor_app] at he + change (((posReindex W u).map (f.hom.app i j hij) ⊗ₘ + (posReindex W u).map (f.hom.app j k hjk)).hom.app x y h) ≫ + (𝟙 _ ≫ 𝟙 _ ≫ (B.cut i j k hij hjk).hom.hom.hom.app (u x) (u y) (u.monotone h)) = + (𝟙 _ ≫ 𝟙 _ ≫ (A.cut i j k hij hjk).hom.hom.hom.app (u x) (u y) (u.monotone h)) ≫ + (f.hom.app i k (le_trans hij hjk)).hom.app (u x) (u y) (u.monotone h) + erw [posTensor_app] + simpa only [posReindex, Category.id_comp] using! he } + map_id A := by + apply InducedCategory.hom_ext; apply Hom.ext; intro i j h + exact (posReindex W u).map_id _ + map_comp f g := by + apply InducedCategory.hom_ext; apply Hom.ext; intro i j h + exact (posReindex W u).map_comp _ _ +lemma nestedPosReindex_property (u:I→oJ) {A B:PosDiagrams (diagramProperty W J) K} (f:A⟶B) + (hf:diagramProperty (diagramProperty W J) K f) : + diagramProperty (diagramProperty W I) K ((nestedPosReindex W u).map f) := + fun i j h => posReindex_property W u (f.hom.app i j h) (hf i j h) +private lemma nestedPosReindex_inclusion_obj (u:I→oJ) (A:PosDiagrams (diagramProperty W J) K) : + (nestedPosReindex (K:=K) W u ⋙ posDiagramInclusion (diagramProperty W I) K).obj A = + (posDiagramInclusion (diagramProperty W J) K ⋙ Diagram.map (posReindex W u)).obj A := by + refine ext_heq rfl ?_ ?_ + · apply heq_of_eq; funext i; apply Iso.ext + apply InducedCategory.hom_ext; apply Hom.ext; intro x y h + simp [nestedPosReindex,diagramInclusion,mapObj] + simp [posReindex,widePosReindex] + rfl + · apply heq_of_eq; funext i j k hij hjk; apply Iso.ext + apply InducedCategory.hom_ext; apply Hom.ext; intro x y h + simp [nestedPosReindex,diagramInclusion,mapObj] + simp [posReindex,widePosReindex] + rfl + +lemma nestedPosReindex_inclusion (u:I→oJ) : + nestedPosReindex (K:=K) W u ⋙ posDiagramInclusion (diagramProperty W I) K = + posDiagramInclusion (diagramProperty W J) K ⋙ Diagram.map (posReindex W u) := by + refine CategoryTheory.Functor.ext (nestedPosReindex_inclusion_obj W u) ?_ + intro A B f + apply Hom.ext; intro i j h + apply InducedCategory.hom_ext; apply Hom.ext; intro x y hxy + simp [nestedPosReindex,posReindex,Diagram.map] + erw [Diagram.eqToHom_app, Diagram.eqToHom_app] + erw [comp_app, comp_app, eqToHom_pos_app, eqToHom_pos_app] + change (f.hom.app i j h).hom.app (u x) (u y) (u.monotone hxy) = + 𝟙 _ ≫ (f.hom.app i j h).hom.app (u x) (u y) (u.monotone hxy) ≫ 𝟙 _ + simp only [Category.id_comp, Category.comp_id] + +@[simp] lemma transpose_η_app (n:ℕ) (t:Fin (n+1)) (i j:I) (h:i≤j) : + ((Functor.OplaxMonoidal.η (transposeDiagram (I:=I) W n)).hom.app t).hom.app i j h = 𝟙 _ := by + have he := congrArg (fun z=> (z.hom.app t).hom.app i j h) + (Functor.Monoidal.ε_η (transposeDiagram (I:=I) W n)) + change 𝟙 (𝟙_ C) ≫ ((Functor.OplaxMonoidal.η (transposeDiagram (I:=I) W n)).hom.app t).hom.app i j h = 𝟙 (𝟙_ C) at he + change ((Functor.OplaxMonoidal.η (transposeDiagram (I:=I) W n)).hom.app t).hom.app i j h = 𝟙 (𝟙_ C) + exact (Category.id_comp _).symm.trans he +@[simp] lemma transpose_obj (n:ℕ) (A:Diagram (Strings W n) I) : + (transposeDiagram W n).obj A=transposeDiagramObj W A := rfl +@[simp] lemma transpose_map (n:ℕ) {A B:Diagram (Strings W n) I} (f:A⟶B) : + (transposeDiagram W n).map f=transposeDiagramHom W f := rfl +@[simp] lemma diagramReindex_η (u:I→oJ) : + Functor.OplaxMonoidal.η (Diagram.reindex (C:=C) u)=𝟙 _ := rfl +@[simp] lemma diagramReindex_μ (u:I→oJ) (A B:Diagram C J) : + Functor.LaxMonoidal.μ (Diagram.reindex u) A B=𝟙 _ := rfl +private noncomputable abbrev innerReindexLeft (u:I→oJ) (n:ℕ) := + Diagram.map (I:=K) (Diagram.reindex (C:=Strings W n) u) ⋙ + Diagram.map (I:=K) (transposeDiagram (I:=I) W n) ⋙ + transposeDiagram (I:=K) (diagramProperty W I) n +private noncomputable abbrev innerReindexRight (u:I→oJ) (n:ℕ) := + Diagram.map (I:=K) (transposeDiagram (I:=J) W n) ⋙ + transposeDiagram (I:=K) (diagramProperty W J) n ⋙ + stringsMap (diagramProperty (diagramProperty W J) K) (diagramProperty (diagramProperty W I) K) + (nestedPosReindex W u) (nestedPosReindex_property W u) n + +private lemma doubleTranspose_innerReindex_vertex (u:I→oJ) (n:ℕ) + (A:Diagram (Diagram (Strings W n) J) K) (t:Fin (n+1)) : + (((innerReindexLeft (K:=K) W u n).obj A).obj.obj t) = + (((innerReindexRight (K:=K) W u n).obj A).obj.obj t) := by + refine ext_heq rfl ?_ ?_ + · apply heq_of_eq; funext i; apply Iso.ext; apply WideSubcategory.hom_ext + apply InducedCategory.hom_ext; apply Hom.ext; intro x y h + simp [stringsMap,nestedPosReindex,transposeDiagramObj,stringVertex,mapObj] + simp [widePosReindex,posReindex,Diagram.reindex] + erw [comp_app, transpose_η_app] + change (((A.unit i).hom.app (u x) (u y) (u.monotone h)).hom.app t ≫ 𝟙 _) ≫ 𝟙 _ = + (((A.unit i).hom.app (u x) (u y) (u.monotone h)).hom.app t ≫ + ((Functor.OplaxMonoidal.η (transposeDiagram (I:=J) W n)).hom.app t).hom.app + (u x) (u y) (u.monotone h)) ≫ 𝟙 _ + rw [transpose_η_app] + rfl + · apply heq_of_eq; funext i j k hij hjk; apply Iso.ext; apply WideSubcategory.hom_ext + apply InducedCategory.hom_ext; apply Hom.ext; intro x y h + simp [stringsMap,nestedPosReindex,transposeDiagramObj,stringVertex,mapObj] + simp [widePosReindex,posReindex,Diagram.reindex] + change 𝟙 _ ≫ 𝟙 _ ≫ ((A.cut i j k hij hjk).hom.app (u x) (u y) (u.monotone h)).hom.app t = + 𝟙 _ ≫ 𝟙 _ ≫ ((A.cut i j k hij hjk).hom.app (u x) (u y) (u.monotone h)).hom.app t + simp + +private lemma nested_comp_app {A B D:PosDiagrams (diagramProperty W I) K} + (f:A⟶B) (g:B⟶D) (i j:K) (h:i≤j) (x y:I) (hxy:x≤y) : + ((f ≫ g).hom.app i j h).hom.app x y hxy = + (f.hom.app i j h).hom.app x y hxy ≫ (g.hom.app i j h).hom.app x y hxy := rfl + +private lemma nested_eqToHom_app {A B:PosDiagrams (diagramProperty W I) K} + (e:A=B) (i j:K) (h:i≤j) (x y:I) (hxy:x≤y) : + ((eqToHom e).hom.app i j h).hom.app x y hxy = + eqToHom (congrArg (fun A:PosDiagrams (diagramProperty W I) K => + ((diagramInclusion W I).obj (A.obj i j h).obj).obj x y hxy) e) := by + cases e + rfl + +private lemma twiceTransposed_comp_app {n:ℕ} + {A B D:Strings (diagramProperty (diagramProperty W I) K) n} + (f:A⟶B) (g:B⟶D) (t:Fin (n+1)) (i j:K) (h:i≤j) (x y:I) (hxy:x≤y) : + (((f ≫ g).hom.app t).hom.app i j h).hom.app x y hxy = + ((f.hom.app t).hom.app i j h).hom.app x y hxy ≫ + ((g.hom.app t).hom.app i j h).hom.app x y hxy := rfl + +private lemma twiceTransposed_eqToHom_app {n:ℕ} + {A B:Strings (diagramProperty (diagramProperty W I) K) n} + (e:A=B) (t:Fin (n+1)) (i j:K) (h:i≤j) (x y:I) (hxy:x≤y) : + (((eqToHom e).hom.app t).hom.app i j h).hom.app x y hxy = + eqToHom (congrArg (fun A:Strings (diagramProperty (diagramProperty W I) K) n => + (((A.obj.obj t).obj i j h).obj.obj x y hxy).obj) e) := by + cases e + rfl + +private lemma doubleTranspose_innerReindex_obj (u:I→oJ) (n:ℕ) + (A:Diagram (Diagram (Strings W n) J) K) : + (innerReindexLeft (K:=K) W u n).obj A = (innerReindexRight (K:=K) W u n).obj A := by + apply WideSubcategory.ext + refine CategoryTheory.Functor.ext (doubleTranspose_innerReindex_vertex W u n A) ?_ + intro t s f + apply InducedCategory.hom_ext; apply Hom.ext; intro i j h + apply InducedCategory.hom_ext; apply Hom.ext; intro x y hxy + erw [nested_comp_app, nested_comp_app, nested_eqToHom_app, nested_eqToHom_app] + change ((A.obj i j h).obj (u x) (u y) (u.monotone hxy)).obj.map f = + 𝟙 _ ≫ ((A.obj i j h).obj (u x) (u y) (u.monotone hxy)).obj.map f ≫ 𝟙 _ + simp only [Category.id_comp, Category.comp_id] + +private lemma twiceTransposed_transport_ext {n:ℕ} + {A A' B B':Strings (diagramProperty (diagramProperty W I) K) n} + (eA:A=A') (eB:B'=B) (f:A⟶B) (g:A'⟶B') + (hf:∀ (t:Fin (n+1)) (i j:K) (h:i≤j) (x y:I) (hxy:x≤y), + ((f.hom.app t).hom.app i j h).hom.app x y hxy = + eqToHom (congrArg (fun A:Strings (diagramProperty (diagramProperty W I) K) n => + (((A.obj.obj t).obj i j h).obj.obj x y hxy).obj) eA) ≫ + ((g.hom.app t).hom.app i j h).hom.app x y hxy ≫ + eqToHom (congrArg (fun A:Strings (diagramProperty (diagramProperty W I) K) n => + (((A.obj.obj t).obj i j h).obj.obj x y hxy).obj) eB)) : + f = eqToHom eA ≫ g ≫ eqToHom eB := by + apply WideSubcategory.hom_ext; apply NatTrans.ext; funext t + apply InducedCategory.hom_ext; apply Hom.ext; intro i j h + apply InducedCategory.hom_ext; apply Hom.ext; intro x y hxy + erw [twiceTransposed_comp_app, twiceTransposed_comp_app, + twiceTransposed_eqToHom_app, twiceTransposed_eqToHom_app] + exact hf t i j h x y hxy + +private lemma doubleTranspose_innerReindex_eq (u:I→oJ) (n:ℕ) : + innerReindexLeft (K:=K) W u n = innerReindexRight (K:=K) W u n := by + refine CategoryTheory.Functor.ext (doubleTranspose_innerReindex_obj W u n) ?_ + intro A B f + apply twiceTransposed_transport_ext + intro t i j h x y hxy + change ((f.app i j h).app (u x) (u y) (u.monotone hxy)).hom.app t = + 𝟙 _ ≫ ((f.app i j h).app (u x) (u y) (u.monotone hxy)).hom.app t ≫ 𝟙 _ + simp only [Category.id_comp, Category.comp_id] + +lemma doubleTranspose_innerReindex (u:I→oJ) (n:ℕ) : + Diagram.map (I:=K) (Diagram.reindex (C:=Strings W n) u) ⋙ + Diagram.map (I:=K) (transposeDiagram (I:=I) W n) ⋙ + transposeDiagram (I:=K) (diagramProperty W I) n = + Diagram.map (I:=K) (transposeDiagram (I:=J) W n) ⋙ + transposeDiagram (I:=K) (diagramProperty W J) n ⋙ + stringsMap (diagramProperty (diagramProperty W J) K) (diagramProperty (diagramProperty W I) K) + (nestedPosReindex W u) (nestedPosReindex_property W u) n := by + exact doubleTranspose_innerReindex_eq W u n + +end RestrictedNerve + +end + +open _root_.CategoryTheory _root_.OAI.CategoryTheory MonoidalCategory +namespace IntervalBar.Diagram + +variable {C D:Type} [Groupoid.{0} C] [Groupoid.{0} D] + [MonoidalCategory C] [MonoidalCategory D] + [SymmetricCategory C] [SymmetricCategory D] +variable {I J K:Type} [Preorder I] [Preorder J] [Preorder K] +@[simp] lemma map_ε (F:C⥤D) [F.Braided] : + Functor.LaxMonoidal.ε (map (I:=I) F)=mapεHom F := rfl +@[simp] lemma map_μ (F:C⥤D) [F.Braided] (A B:Diagram C I) : + Functor.LaxMonoidal.μ (map F) A B=mapμHom F A B := rfl +@[simp] lemma reindex_ε (u:I→oJ) : + Functor.LaxMonoidal.ε (reindex (C:=C) u)=𝟙 _ := rfl +@[simp] lemma reindex_μ (u:I→oJ) (A B:Diagram C J) : + Functor.LaxMonoidal.μ (reindex u) A B=𝟙 _ := rfl +noncomputable instance reindex_map_monoidal (F:C⥤D) [F.Braided] (u:I→oJ) : + NatTrans.IsMonoidal (eqToHom (reindex_map F u)) where + unit := by + apply Hom.ext; intro i j h + simp only [CategoryTheory.eqToHom_app] + simp only [Functor.LaxMonoidal.comp_ε,map_ε,reindex_ε] + simp [mapεHom,map,reindex] + erw [Diagram.eqToHom_app] + change Functor.LaxMonoidal.ε F ≫ F.map (𝟙 (𝟙_ C)) ≫ 𝟙 _ = 𝟙 _ ≫ Functor.LaxMonoidal.ε F + simp only [CategoryTheory.Functor.map_id, Category.id_comp, Category.comp_id] + tensor A B := by + apply Hom.ext; intro i j h + simp only [CategoryTheory.eqToHom_app] + simp only [Functor.LaxMonoidal.comp_μ,map_μ,reindex_μ] + simp [mapμHom,map,reindex] + erw [Diagram.eqToHom_app, Diagram.eqToHom_app, Diagram.eqToHom_app] + change Functor.LaxMonoidal.μ F (A.obj (u i) (u j) (u.monotone h)) (B.obj (u i) (u j) (u.monotone h)) ≫ + F.map (𝟙 _) ≫ 𝟙 _ = (𝟙 _ ⊗ₘ 𝟙 _) ≫ 𝟙 _ ≫ + Functor.LaxMonoidal.μ F (A.obj (u i) (u j) (u.monotone h)) (B.obj (u i) (u j) (u.monotone h)) + simp only [CategoryTheory.Functor.map_id, id_tensorHom_id, Category.id_comp, Category.comp_id] +lemma map_reindex_map (F:C⥤D) [F.Braided] (u:I→oJ) : + map (I:=K) (reindex (C:=C) u) ⋙ map (I:=K) (map F) = + map (I:=K) (map F) ⋙ map (I:=K) (reindex u) := by + have he := map_congr (I:=K) (reindex_map F u) (reindex_map_monoidal F u) + simpa only [map_comp] using he +end IntervalBar.Diagram + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/PiFiber.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/PiFiber.lean new file mode 100644 index 0000000000000000000000000000000000000000..1d46e4c4669af53a799a7dff9fd0a2fc68f9bcd5 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/PiFiber.lean @@ -0,0 +1,87 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.ExactShapeHomology + +namespace OAI + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits MonoidalCategory Simplicial Opposite +namespace PiSSet + +variable {ι:Type} (C:ι→Type) [∀i,Category.{0} (C i)] +noncomputable def nervePiIso : nerve (∀i,C i) ≅ obj (fun i=>nerve (C i)) where + hom := lift _ (fun i=>nerveMap (Pi.eval C i)) + inv := {app _ := ↾fun X=>Functor.pi' X + naturality _ _ _ := by ext X; rfl} + hom_inv_id := by ext p X; rfl + inv_hom_id := by ext p X; rfl +end PiSSet +namespace ComponentTranslation +open FreeChains + +variable {C:Type} [Groupoid.{0} C] +noncomputable def base (p:Skeleton C) : Fiber p := ⟨(fromSkeleton C).obj p,toSkeleton_fromSkeleton_obj p⟩ +noncomputable def fiberIso (p:Skeleton C) (U V:Fiber p) : U≅V := + (property p).ι.preimageIso (Skeleton.isoOfEq (U.property.trans V.property.symm)) +noncomputable instance fiber_nonempty (p:Skeleton C) : Nonempty (Fiber p) := ⟨base p⟩ +instance fiber_nerve_connected (p:Skeleton C) : (nerve (Fiber p)).IsConnected where + nonempty := ⟨nerveEquiv.symm (base p)⟩ + allEq x y := by + obtain ⟨x,rfl⟩:=SSet.π₀.mk_surjective x + obtain ⟨y,rfl⟩:=SSet.π₀.mk_surjective y + have h:=SSet.π₀.sound (nerve.edgeMk (fiberIso p (nerveEquiv x) (nerveEquiv y)).hom) + exact (congrArg SSet.π₀.mk (nerveEquiv.symm_apply_apply x)).symm.trans + (h.trans (congrArg SSet.π₀.mk (nerveEquiv.symm_apply_apply y))) +end ComponentTranslation +namespace PiFiber +open ComponentTranslation FreeChains + +variable (C:Type) [Groupoid.{0} C] (ι:Type) +noncomputable def prod : SSet := PiSSet.obj (fun _:ι=>nerve C) +noncomputable def piece (p:ι→Skeleton C) : SSet := PiSSet.obj (fun i=>nerve (Fiber (p i))) +noncomputable def diagram : Discrete (ι→Skeleton C) ⥤ SSet := Discrete.functor (piece C ι) +noncomputable def inclusion (p:ι→Skeleton C) : piece C ι p ⟶ prod C ι := + PiSSet.lift _ (fun i=>PiSSet.proj _ i ≫ nerveMap (property (p i)).ι) +noncomputable def cocone : Cocone (diagram C ι) := Cofan.mk (prod C ι) (inclusion C ι) +noncomputable def pointwiseIsColimit (n:ℕ) : + IsColimit (((evaluation _ (Type)).obj (op ⦋n⦌)).mapCocone (cocone C ι)) := by + let cf : Cofan (fun p:ι→Skeleton C=>∀i,ComposableArrows (Fiber (p i)) n) := + Cofan.mk (∀_:ι,ComposableArrows C n) (fun p=>↾fun s i=>s i ⋙ (property (p i)).ι) + let s := (((evaluation _ (Type)).obj (op ⦋n⦌)).mapCocone (cocone C ι)) + let e : diagram C ι ⋙ (evaluation _ (Type)).obj (op ⦋n⦌) ≅ + Discrete.functor (fun p:ι→Skeleton C=>∀i,ComposableArrows (Fiber (p i)) n) := + Discrete.natIso (fun _=>Iso.refl _) + let pointIso : s.pt ≅ cf.pt := Iso.refl _ + apply ColimitTransfer.ofIsos s cf e.hom pointIso.hom + (fun _=>by simp [s,e,cf,cocone,pointIso]; rfl) + apply Classical.choice + rw [←cf.isColimit_cofanTypes_iff] + apply CofanTypes.isColimit_mk + · intro s + exact ⟨fun i=>toSkeleton (s i).left,fun i=>ComponentCoproduct.lift C (s i),rfl⟩ + · intro p s t h + funext i + exact ComponentCoproduct.inclusion_injective C (p i) (congrFun h i) + · intro p q s t h + funext i + have he:=CategoryTheory.Functor.congr_obj (congrFun h i) (0:Fin (n+1)) + exact (s i).left.property.symm.trans ((congrArg toSkeleton he).trans (t i).left.property) +noncomputable def isColimit : IsColimit (cocone C ι) := + evaluationJointlyReflectsColimits _ (fun n=>pointwiseIsColimit C ι n.unop.len) +noncomputable def homologyIsColimit (q:ℕ) : + IsColimit ((SSet.homologyFunctor Z q).mapCocone (cocone C ι)) := + isColimitOfPreserves _ (isColimit C ι) +noncomputable def homologyIso (q:ℕ) : (prod C ι).homology Z q ≅ + ∐ (fun p:ι→Skeleton C=>(piece C ι p).homology Z q) := + (homologyIsColimit C ι q).coconePointUniqueUpToIso (colimit.isColimit _) ≪≫ + HasColimit.isoOfNatIso (Discrete.natIsoFunctor) +noncomputable def h1PieceIso (n:ℕ) (p:Fin n→Skeleton C) : + (piece C (Fin n) p).homology Z 1 ≅ PiSSet.homologyPi (fun i=>nerve (Fiber (p i))) := by + haveI := PiSSet.homologyProj_isIso n (fun i=>nerve (Fiber (p i))) (fun _=>inferInstance) + exact asIso (X := (PiSSet.obj (fun i=>nerve (Fiber (p i)))).homology Z 1) + (Y := PiSSet.homologyPi (fun i=>nerve (Fiber (p i)))) + (PiSSet.homologyProj n (fun i=>nerve (Fiber (p i)))) +end PiFiber + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/PointFiberMonoidal.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/PointFiberMonoidal.lean new file mode 100644 index 0000000000000000000000000000000000000000..7235224ec509261a5a78658b9aa1f955d361cb3e --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/PointFiberMonoidal.lean @@ -0,0 +1,105 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Configurations.PointFiberEvaluation + +namespace OAI + +section +open CategoryTheory Classical Set MonoidalCategory +namespace SimpleAmenable.PolygonObject.Labelled.PointFiber + +variable {a n : ℕ} +noncomputable def muEval (U V : Labelled a n) (b : GenericSquare a × (Fin n → CutRing × CutRing)) : + FiniteSetGroupoid.sum (E.obj U b) (E.obj V b) ⟶ E.obj (sum U V) b := mu U V b +@[simp] lemma muEval_inl (U V : Labelled a n) (b : GenericSquare a × (Fin n → CutRing × CutRing)) (x : Fiber U b) : + muEval U V b (FiniteSetGroupoid.sumEquiv _ _ (.inl (enumerate U b x)))= + enumerate (sum U V) b (fiberSum U V b (.inl x)) := mu_inl U V b x +@[simp] lemma muEval_inr (U V : Labelled a n) (b : GenericSquare a × (Fin n → CutRing × CutRing)) (x : Fiber V b) : + muEval U V b (FiniteSetGroupoid.sumEquiv _ _ (.inr (enumerate V b x)))= + enumerate (sum U V) b (fiberSum U V b (.inr x)) := mu_inr U V b x +noncomputable def epsEval (b : GenericSquare a × (Fin n → CutRing × CutRing)) : + FiniteSetGroupoid.empty ⟶ E.obj (empty (a:=a) (n:=n)) b := eps b +lemma mu_assoc (U V W : Labelled a n) : + mu U V ▷ E.obj W ≫ mu (U⊗V) W ≫ E.map (α_ U V W).hom = + (α_ (E.obj U) (E.obj V) (E.obj W)).hom ≫ E.obj U ◁ mu V W ≫ mu U (V⊗W) := by + funext b + apply Equiv.ext + intro x + change E.map (assocHom U V W) b (muEval (sum U V) W b + (FiniteSetGroupoid.sumHom (muEval U V b) (𝟙 (E.obj W b)) x)) = + muEval U (sum V W) b (FiniteSetGroupoid.sumHom (𝟙 (E.obj U b)) (muEval V W b) + (FiniteSetGroupoid.assoc (E.obj U b) (E.obj V b) (E.obj W b) x)) + obtain ⟨x,rfl⟩ := (FiniteSetGroupoid.sumEquiv (FiniteSetGroupoid.sum (E.obj U b) (E.obj V b)) (E.obj W b)).surjective x + cases x with + | inl x => + obtain ⟨x,rfl⟩ := (FiniteSetGroupoid.sumEquiv (E.obj U b) (E.obj V b)).surjective x + cases x with + | inl x => + obtain ⟨x,rfl⟩ := (enumerate U b).surjective x + rw [FiniteSetGroupoid.sumHom_inl (muEval U V b) (𝟙 (E.obj W b)),muEval_inl,muEval_inl,E_map_enum,fiber_assoc_left, + FiniteSetGroupoid.assoc_left,FiniteSetGroupoid.sumHom_inl,FiniteSetGroupoid.id_apply,muEval_inl] + | inr x => + obtain ⟨x,rfl⟩ := (enumerate V b).surjective x + rw [FiniteSetGroupoid.sumHom_inl (muEval U V b) (𝟙 (E.obj W b)),muEval_inr,muEval_inl,E_map_enum,fiber_assoc_mid, + FiniteSetGroupoid.assoc_mid,FiniteSetGroupoid.sumHom_inr,muEval_inl,muEval_inr] + | inr x => + obtain ⟨x,rfl⟩ := (enumerate W b).surjective x + rw [FiniteSetGroupoid.sumHom_inr (muEval U V b) (𝟙 (E.obj W b)),FiniteSetGroupoid.id_apply,muEval_inr,E_map_enum,fiber_assoc_right, + FiniteSetGroupoid.assoc_right,FiniteSetGroupoid.sumHom_inr,muEval_inr,muEval_inr] +lemma eps_left (U : Labelled a n) : + (λ_ (E.obj U)).hom = eps ▷ E.obj U ≫ mu (𝟙_ _) U ≫ E.map (λ_ U).hom := by + funext b + apply Equiv.ext + intro x + change FiniteSetGroupoid.left (E.obj U b) x = E.map (leftHom U) b + (muEval empty U b (FiniteSetGroupoid.sumHom (epsEval b) (𝟙 (E.obj U b)) x)) + obtain ⟨x,rfl⟩ := (FiniteSetGroupoid.sumEquiv FiniteSetGroupoid.empty (E.obj U b)).surjective x + cases x with + | inl x => exact Fin.elim0 x + | inr x => + obtain ⟨x,rfl⟩ := (enumerate U b).surjective x + rw [FiniteSetGroupoid.left_apply,FiniteSetGroupoid.sumHom_inr (epsEval b) (𝟙 (E.obj U b)), + FiniteSetGroupoid.id_apply,muEval_inr,E_map_enum,fiber_left] +lemma eps_right (U : Labelled a n) : + (ρ_ (E.obj U)).hom = E.obj U ◁ eps ≫ mu U (𝟙_ _) ≫ E.map (ρ_ U).hom := by + funext b + apply Equiv.ext + intro x + change FiniteSetGroupoid.right (E.obj U b) x = E.map (rightHom U) b + (muEval U empty b (FiniteSetGroupoid.sumHom (𝟙 (E.obj U b)) (epsEval b) x)) + obtain ⟨x,rfl⟩ := (FiniteSetGroupoid.sumEquiv (E.obj U b) FiniteSetGroupoid.empty).surjective x + cases x with + | inl x => + obtain ⟨x,rfl⟩ := (enumerate U b).surjective x + rw [FiniteSetGroupoid.right_apply,FiniteSetGroupoid.sumHom_inl (𝟙 (E.obj U b)) (epsEval b), + FiniteSetGroupoid.id_apply,muEval_inl,E_map_enum,fiber_right] + | inr x => exact Fin.elim0 x +noncomputable instance evaluationMonoidal : (evaluation (a:=a) (n:=n)).Monoidal := + Functor.CoreMonoidal.toMonoidal { + εIso := asIso eps + μIso U V := asIso (mu U V) + μIso_hom_natural_left := by intro U V f W; simpa using mu_natural f (𝟙 W) + μIso_hom_natural_right := by intro U V W f; simpa using mu_natural (𝟙 W) f + associativity := mu_assoc + left_unitality := eps_left + right_unitality := eps_right } +noncomputable instance evaluationBraided : (evaluation (a:=a) (n:=n)).Braided where + braided U V := by + change mu U V ≫ E.map (swapHom U V) = (β_ (E.obj U) (E.obj V)).hom ≫ mu V U + funext b + apply Equiv.ext + intro x + change E.map (swapHom U V) b (muEval U V b x) = + muEval V U b (FiniteSetGroupoid.swap (E.obj U b) (E.obj V b) x) + obtain ⟨x,rfl⟩ := (FiniteSetGroupoid.sumEquiv (E.obj U b) (E.obj V b)).surjective x + cases x with + | inl x => + obtain ⟨x,rfl⟩ := (enumerate U b).surjective x + rw [muEval_inl,E_map_enum,fiber_swap_left,FiniteSetGroupoid.swap_left,muEval_inr] + | inr x => + obtain ⟨x,rfl⟩ := (enumerate V b).surjective x + rw [muEval_inr,E_map_enum,fiber_swap_right,FiniteSetGroupoid.swap_right,muEval_inl] +end SimpleAmenable.PolygonObject.Labelled.PointFiber + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/PolygonBarFaces.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/PolygonBarFaces.lean new file mode 100644 index 0000000000000000000000000000000000000000..304598b4e794b886f4b030985892a494c89d48f9 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/PolygonBarFaces.lean @@ -0,0 +1,86 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Configurations.PolygonStringNormalization + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section PolygonBarFaces + +open Classical CategoryTheory +namespace PolygonObject +variable {a n : ℕ} + +@[simp] theorem deleteVertex_obj (j : Fin (n+2)) (i : Fin (n+1)) : + (deleteVertex j).obj i=j.succAbove i := rfl + +theorem increments_first_face (F : RawString a (n+1)) (x : (F.obj 0).Point) (i : Fin n) : + increments (deleteVertex 0⋙F) ((baseArrow F ((deleteVertex 0).obj 0)).toEquiv x) i= + increments F x i.succ := by + apply increments_reindex_unchanged + · simp only [deleteVertex_obj,Fin.zero_succAbove,Fin.castSucc_succ] + · simp + +theorem increments_last_face (F : RawString a (n+1)) (x : (F.obj 0).Point) (i : Fin n) : + increments (deleteVertex (Fin.last (n+1))⋙F) + ((baseArrow F ((deleteVertex (Fin.last (n+1))).obj 0)).toEquiv x) i= + increments F x i.castSucc := by + apply increments_reindex_unchanged + · simp + · simp only [deleteVertex_obj,Fin.succAbove_last_apply,Fin.castSucc_succ] + +theorem increments_interior_face (F : RawString a (n+1)) (x : (F.obj 0).Point) (i : Fin n) : + increments (deleteVertex i.succ.castSucc⋙F) + ((baseArrow F ((deleteVertex i.succ.castSucc).obj 0)).toEquiv x) i= + increments F x i.castSucc+increments F x i.succ := by + apply increments_reindex_compose + · change i.succ.castSucc.succAbove i.castSucc=i.castSucc.castSucc + apply Fin.succAbove_of_castSucc_lt + change i.val < i.val + 1 + omega + · exact Fin.succ_castSucc i + · simp + +theorem first_face_initial_position (F : RawString a (n+1)) (x : (F.obj 0).Point) : + ((baseArrow F ((deleteVertex (0 : Fin (n+2))).obj 0)).toEquiv x).val.2= + translate a (increments F x 0) x.val.2 := by + rw [pointShift_spec] + congr 1 + change trajectoryShift F x ((deleteVertex 0).obj 0)=increments F x 0 + unfold increments + simp only [deleteVertex_obj,Fin.zero_succAbove,Fin.castSucc_zero,trajectoryShift_zero,sub_zero] + +theorem nonfirst_face_initial_position (F : RawString a (n+1)) (x : (F.obj 0).Point) + (j : Fin (n+2)) (hj : j≠0) : + ((baseArrow F ((deleteVertex j).obj 0)).toEquiv x).val.2=x.val.2 := by + have he : (deleteVertex j).obj 0=0 := Fin.succAbove_ne_zero_zero hj + rw [pointShift_spec] + change translate a (trajectoryShift F x ((deleteVertex j).obj 0)) x.val.2=x.val.2 + rw [he,trajectoryShift_zero,translate_zero] + +def duplicateVertex (j : Fin (n+1)) : Fin (n+2) ⥤ Fin (n+1) := + j.predAboveOrderHom.toFunctor + +noncomputable def stringDegeneracy (j : Fin (n+1)) : + StringGroupoid a n ⥤ StringGroupoid a (n+1) := stringReindex (duplicateVertex j) + +@[simp] theorem duplicateVertex_obj (j : Fin (n+1)) (i : Fin (n+2)) : + (duplicateVertex j).obj i=j.predAbove i := rfl + +theorem increments_degeneracy (F : RawString a n) (x : (F.obj 0).Point) (j : Fin (n+1)) : + increments (duplicateVertex j⋙F) ((baseArrow F ((duplicateVertex j).obj 0)).toEquiv x) j=0 := by + apply increments_reindex_duplicate + simp + +end PolygonObject +end PolygonBarFaces + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/PolygonMonoidalData.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/PolygonMonoidalData.lean new file mode 100644 index 0000000000000000000000000000000000000000..6e363446bb22a4c4c348aa9841a83b501b6b68a7 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/PolygonMonoidalData.lean @@ -0,0 +1,292 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.PolygonGeometry.PolygonObjectSum + +namespace OAI + +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +section PolygonMonoidalData + +open Classical Set CategoryTheory +namespace PolygonObject +variable {a : ℕ} + +noncomputable def relabelArrow {U V : PolygonObject a} (e : U.Point ≃ V.Point) + (r : Fin U.tracks → Fin V.tracks) + (he : ∀x,(e x).val=(r x.val.1,x.val.2)) : U ⟶ V where + toEquiv := e + hasTable := by + let c : Fin U.tracks → Chart (a:=a) U.tracks V.tracks := fun i => ⟨i,r i,0,U.cell i⟩ + refine ⟨Finset.univ.image c,?_,?_⟩ + · intro d hd + obtain ⟨i,_,rfl⟩ := Finset.mem_image.mp hd + intro x hx + exact ⟨hx,by simpa [c,translate_zero] using he ⟨(i,x),hx⟩⟩ + · intro x + exact ⟨c x.val.1,Finset.mem_image_of_mem c (Finset.mem_univ _),rfl,x.property⟩ + +noncomputable def sumSwapEquiv (U V : PolygonObject a) : (sum U V).Point ≃ (sum V U).Point := + (sumPointEquiv U V).symm.trans ((Equiv.sumComm _ _).trans (sumPointEquiv V U)) + +@[simp] theorem sumSwapEquiv_inl (U V : PolygonObject a) (x : U.Point) : + sumSwapEquiv U V (sumPointEquiv U V (.inl x))=sumPointEquiv V U (.inr x) := by + simp [sumSwapEquiv] +@[simp] theorem sumSwapEquiv_inr (U V : PolygonObject a) (x : V.Point) : + sumSwapEquiv U V (sumPointEquiv U V (.inr x))=sumPointEquiv V U (.inl x) := by + simp [sumSwapEquiv] +noncomputable def sumSwap (U V : PolygonObject a) : sum U V ⟶ sum V U := + relabelArrow (sumSwapEquiv U V) + (Fin.addCases (fun i => i.natAdd V.tracks) (fun i => i.castAdd U.tracks)) (by + intro x + obtain ⟨y,rfl⟩ := (sumPointEquiv U V).surjective x + cases y with + | inl y => + simp only [sumSwapEquiv_inl,sumPointEquiv_inl,sumPointEquiv_inr] + erw [Fin.addCases_left] + rfl + | inr y => + simp only [sumSwapEquiv_inr,sumPointEquiv_inl,sumPointEquiv_inr] + erw [Fin.addCases_right] + rfl) + +noncomputable def sumAssocEquiv (U V W : PolygonObject a) : (sum (sum U V) W).Point ≃ (sum U (sum V W)).Point := + (sumPointEquiv (sum U V) W).symm.trans + ((Equiv.sumCongr (sumPointEquiv U V).symm (Equiv.refl _)).trans + ((Equiv.sumAssoc U.Point V.Point W.Point).trans + ((Equiv.sumCongr (Equiv.refl _) (sumPointEquiv V W)).trans (sumPointEquiv U (sum V W))))) + +@[simp] theorem sumAssocEquiv_left (U V W : PolygonObject a) (x : U.Point) : + sumAssocEquiv U V W (sumPointEquiv (sum U V) W (.inl (sumPointEquiv U V (.inl x))))= + sumPointEquiv U (sum V W) (.inl x) := by simp [sumAssocEquiv] +@[simp] theorem sumAssocEquiv_mid (U V W : PolygonObject a) (x : V.Point) : + sumAssocEquiv U V W (sumPointEquiv (sum U V) W (.inl (sumPointEquiv U V (.inr x))))= + sumPointEquiv U (sum V W) (.inr (sumPointEquiv V W (.inl x))) := by simp [sumAssocEquiv] +@[simp] theorem sumAssocEquiv_right (U V W : PolygonObject a) (x : W.Point) : + sumAssocEquiv U V W (sumPointEquiv (sum U V) W (.inr x))= + sumPointEquiv U (sum V W) (.inr (sumPointEquiv V W (.inr x))) := by simp [sumAssocEquiv] +noncomputable def sumAssoc (U V W : PolygonObject a) : sum (sum U V) W ⟶ sum U (sum V W) := + relabelArrow (sumAssocEquiv U V W) + (Fin.addCases + (Fin.addCases (fun i => i.castAdd (V.tracks+W.tracks)) (fun i => (i.castAdd W.tracks).natAdd U.tracks)) + (fun i => (i.natAdd V.tracks).natAdd U.tracks)) (by + intro x + obtain ⟨y,rfl⟩ := (sumPointEquiv (sum U V) W).surjective x + cases y with + | inl y => + obtain ⟨z,rfl⟩ := (sumPointEquiv U V).surjective y + cases z with + | inl z => + simp only [sumAssocEquiv_left,sumPointEquiv_inl] + erw [Fin.addCases_left,Fin.addCases_left] + rfl + | inr z => + simp only [sumAssocEquiv_mid,sumPointEquiv_inl,sumPointEquiv_inr] + erw [Fin.addCases_left,Fin.addCases_right] + rfl + | inr y => + simp only [sumAssocEquiv_right,sumPointEquiv_inr] + erw [Fin.addCases_right] + rfl) + +noncomputable def empty : PolygonObject a := ⟨0,Fin.elim0⟩ +instance : IsEmpty (empty (a:=a)).Point := ⟨fun x => Fin.elim0 x.val.1⟩ + +noncomputable def leftUnitEquiv (U : PolygonObject a) : (sum empty U).Point ≃ U.Point := + (sumPointEquiv empty U).symm.trans (Equiv.emptySum _ _) +noncomputable def rightUnitEquiv (U : PolygonObject a) : (sum U empty).Point ≃ U.Point := + (sumPointEquiv U empty).symm.trans (Equiv.sumEmpty _ _) + +@[simp] theorem leftUnitEquiv_apply (U : PolygonObject a) (x : U.Point) : + leftUnitEquiv U (sumPointEquiv empty U (.inr x))=x := by simp [leftUnitEquiv] +@[simp] theorem rightUnitEquiv_apply (U : PolygonObject a) (x : U.Point) : + rightUnitEquiv U (sumPointEquiv U empty (.inl x))=x := by simp [rightUnitEquiv] +noncomputable def leftUnit (U : PolygonObject a) : sum empty U ⟶ U := + relabelArrow (leftUnitEquiv U) (Fin.addCases Fin.elim0 id) (by + intro x + obtain ⟨y,rfl⟩ := (sumPointEquiv empty U).surjective x + cases y with + | inl y => exact isEmptyElim y + | inr y => + simp only [leftUnitEquiv_apply,sumPointEquiv_inr] + erw [Fin.addCases_right] + rfl) +noncomputable def rightUnit (U : PolygonObject a) : sum U empty ⟶ U := + relabelArrow (rightUnitEquiv U) (Fin.addCases id Fin.elim0) (by + intro x + obtain ⟨y,rfl⟩ := (sumPointEquiv U empty).surjective x + cases y with + | inl y => + simp only [rightUnitEquiv_apply,sumPointEquiv_inl] + erw [Fin.addCases_left] + rfl + | inr y => exact isEmptyElim y) + +@[simp] theorem sumSwap_apply (U V : PolygonObject a) (x : (sum U V).Point) : + (sumSwap U V).toEquiv x=sumSwapEquiv U V x := rfl +@[simp] theorem sumAssoc_apply (U V W : PolygonObject a) (x : (sum (sum U V) W).Point) : + (sumAssoc U V W).toEquiv x=sumAssocEquiv U V W x := rfl +@[simp] theorem leftUnit_apply (U : PolygonObject a) (x : (sum empty U).Point) : + (leftUnit U).toEquiv x=leftUnitEquiv U x := rfl +@[simp] theorem rightUnit_apply (U : PolygonObject a) (x : (sum U empty).Point) : + (rightUnit U).toEquiv x=rightUnitEquiv U x := rfl + +end PolygonObject +end PolygonMonoidalData + +open Classical CategoryTheory +namespace PolygonObject +variable {a : ℕ} + +noncomputable abbrev monoidalStruct : MonoidalCategoryStruct (PolygonObject a) where + tensorObj := sum + tensorHom := sumArrow + whiskerLeft U _ _ f := sumArrow (𝟙 U) f + whiskerRight f U := sumArrow f (𝟙 U) + tensorUnit := empty + associator U V W := asIso (sumAssoc U V W) + leftUnitor U := asIso (leftUnit U) + rightUnitor U := asIso (rightUnit U) + +attribute [instance] monoidalStruct + +noncomputable instance monoidal : MonoidalCategory (PolygonObject a) := + MonoidalCategory.ofTensorHom + (id_tensorHom_id := sumArrow_id) + (id_tensorHom := by intros; rfl) + (tensorHom_id := by intros; rfl) + (tensorHom_comp_tensorHom := fun f g f' g' => (sumArrow_comp f f' g g').symm) + (associator_naturality := by + intro U V W U' V' W' f g h + change sumArrow (sumArrow f g) h ≫ sumAssoc U' V' W' = sumAssoc U V W ≫ sumArrow f (sumArrow g h) + apply Arrow.ext;apply Equiv.ext;intro x + obtain ⟨y,rfl⟩ := (sumPointEquiv (sum U V) W).surjective x + cases y with + | inl y => + obtain ⟨z,rfl⟩ := (sumPointEquiv U V).surjective y + cases z <;> simp + | inr y => simp) + (leftUnitor_naturality := by + intro U V f + change sumArrow (𝟙 empty) f ≫ leftUnit V = leftUnit U ≫ f + apply Arrow.ext;apply Equiv.ext;intro x + obtain ⟨y,rfl⟩ := (sumPointEquiv empty U).surjective x + cases y with + | inl y => exact isEmptyElim y + | inr y => simp) + (rightUnitor_naturality := by + intro U V f + change sumArrow f (𝟙 empty) ≫ rightUnit V = rightUnit U ≫ f + apply Arrow.ext;apply Equiv.ext;intro x + obtain ⟨y,rfl⟩ := (sumPointEquiv U empty).surjective x + cases y with + | inl y => simp + | inr y => exact isEmptyElim y) + (pentagon := by + intro U V W Z + change sumArrow (sumAssoc U V W) (𝟙 Z) ≫ sumAssoc U (sum V W) Z ≫ sumArrow (𝟙 U) (sumAssoc V W Z) = + sumAssoc (sum U V) W Z ≫ sumAssoc U V (sum W Z) + apply Arrow.ext;apply Equiv.ext;intro x + obtain ⟨y,rfl⟩ := (sumPointEquiv (sum (sum U V) W) Z).surjective x + cases y with + | inl y => + obtain ⟨z,rfl⟩ := (sumPointEquiv (sum U V) W).surjective y + cases z with + | inl z => + obtain ⟨t,rfl⟩ := (sumPointEquiv U V).surjective z + cases t <;> simp + | inr z => simp + | inr y => simp) + (triangle := by + intro U V + change sumAssoc U empty V ≫ sumArrow (𝟙 U) (leftUnit V) = sumArrow (rightUnit U) (𝟙 V) + apply Arrow.ext;apply Equiv.ext;intro x + obtain ⟨y,rfl⟩ := (sumPointEquiv (sum U empty) V).surjective x + cases y with + | inl y => + obtain ⟨z,rfl⟩ := (sumPointEquiv U empty).surjective y + cases z with + | inl z => simp + | inr z => exact isEmptyElim z + | inr y => simp) + +@[simp] theorem sumAssocEquiv_symm_left (U V W : PolygonObject a) (x : U.Point) : + (sumAssocEquiv U V W).symm (sumPointEquiv U (sum V W) (.inl x))= + sumPointEquiv (sum U V) W (.inl (sumPointEquiv U V (.inl x))) := + (Equiv.symm_apply_eq _).mpr (sumAssocEquiv_left U V W x).symm +@[simp] theorem sumAssocEquiv_symm_mid (U V W : PolygonObject a) (x : V.Point) : + (sumAssocEquiv U V W).symm (sumPointEquiv U (sum V W) (.inr (sumPointEquiv V W (.inl x))))= + sumPointEquiv (sum U V) W (.inl (sumPointEquiv U V (.inr x))) := + (Equiv.symm_apply_eq _).mpr (sumAssocEquiv_mid U V W x).symm +@[simp] theorem sumAssocEquiv_symm_right (U V W : PolygonObject a) (x : W.Point) : + (sumAssocEquiv U V W).symm (sumPointEquiv U (sum V W) (.inr (sumPointEquiv V W (.inr x))))= + sumPointEquiv (sum U V) W (.inr x) := + (Equiv.symm_apply_eq _).mpr (sumAssocEquiv_right U V W x).symm + +@[simp] theorem associator_inv_apply (U V W : PolygonObject a) (x : (sum U (sum V W)).Point) : + (monoidalStruct.associator U V W).inv.toEquiv x=(sumAssocEquiv U V W).symm x := by + change (CategoryTheory.inv (sumAssoc U V W)).toEquiv x=_ + rw [← Groupoid.inv_eq_inv] + rfl + +@[simp] theorem sumAssoc_toEquiv (U V W : PolygonObject a) : + (sumAssoc U V W).toEquiv = sumAssocEquiv U V W := rfl + +@[simp] theorem inv_arrow_apply {U V : PolygonObject a} (f : U ⟶ V) (x : V.Point) : + (CategoryTheory.inv f).toEquiv x = f.toEquiv.symm x := by + rw [← Groupoid.inv_eq_inv] + rfl + +noncomputable instance braided : BraidedCategory (PolygonObject a) where + braiding U V := asIso (sumSwap U V) + braiding_naturality_right := by + intro U V W f + change sumArrow (𝟙 U) f ≫ sumSwap U W = sumSwap U V ≫ sumArrow f (𝟙 U) + apply Arrow.ext;apply Equiv.ext;intro x + obtain ⟨y,rfl⟩ := (sumPointEquiv U V).surjective x + cases y <;> simp + braiding_naturality_left := by + intro U V f W + change sumArrow f (𝟙 W) ≫ sumSwap V W = sumSwap U W ≫ sumArrow (𝟙 W) f + apply Arrow.ext;apply Equiv.ext;intro x + obtain ⟨y,rfl⟩ := (sumPointEquiv U W).surjective x + cases y <;> simp + hexagon_forward := by + intro U V W + change sumAssoc U V W ≫ sumSwap U (sum V W) ≫ sumAssoc V W U = + sumArrow (sumSwap U V) (𝟙 W) ≫ sumAssoc V U W ≫ sumArrow (𝟙 V) (sumSwap U W) + apply Arrow.ext;apply Equiv.ext;intro x + obtain ⟨y,rfl⟩ := (sumPointEquiv (sum U V) W).surjective x + cases y with + | inl y => + obtain ⟨z,rfl⟩ := (sumPointEquiv U V).surjective y + cases z <;> simp + | inr y => simp + hexagon_reverse := by + intro U V W + change (CategoryTheory.inv (sumAssoc U V W)) ≫ sumSwap (sum U V) W ≫ (CategoryTheory.inv (sumAssoc W U V)) = + sumArrow (𝟙 U) (sumSwap V W) ≫ (CategoryTheory.inv (sumAssoc U W V)) ≫ sumArrow (sumSwap U W) (𝟙 V) + apply Arrow.ext;apply Equiv.ext;intro x + obtain ⟨y,rfl⟩ := (sumPointEquiv U (sum V W)).surjective x + cases y with + | inl y => simp only [arrow_comp_apply, inv_arrow_apply, sumAssoc_toEquiv, + sumAssocEquiv_symm_left,sumAssocEquiv_symm_mid, + sumSwap_apply,sumSwapEquiv_inl,sumArrow_inl,arrow_id_apply] + | inr y => + obtain ⟨z,rfl⟩ := (sumPointEquiv V W).surjective y + cases z <;> simp only [arrow_comp_apply, inv_arrow_apply, sumAssoc_toEquiv, + sumAssocEquiv_symm_left,sumAssocEquiv_symm_mid,sumAssocEquiv_symm_right, + sumSwap_apply,sumSwapEquiv_inl,sumSwapEquiv_inr,sumArrow_inl,sumArrow_inr,arrow_id_apply] + +noncomputable instance symmetric : SymmetricCategory (PolygonObject a) where + symmetry U V := by + change sumSwap U V ≫ sumSwap V U = 𝟙 (sum U V) + apply Arrow.ext;apply Equiv.ext;intro x + obtain ⟨y,rfl⟩ := (sumPointEquiv U V).surjective x + cases y <;> simp + +end PolygonObject + +end SimpleAmenable + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/PolygonPositionalMonoidal.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/PolygonPositionalMonoidal.lean new file mode 100644 index 0000000000000000000000000000000000000000..dd38f2a803d63a9121b13e60f2b20a03f3454a09 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/PolygonPositionalMonoidal.lean @@ -0,0 +1,96 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.PolygonMonoidalData + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section PolygonPositionalMonoidal + +open Classical CategoryTheory +open scoped MonoidalCategory +namespace PolygonObject +variable {a : ℕ} + +theorem positional_comp {U V W : PolygonObject a} {f : U ⟶ V} {g : V ⟶ W} + (hf : Positional f) (hg : Positional g) : Positional (f≫g) := + (positionalSubgroupoid a).mul hf hg + +theorem positional_inv {U V : PolygonObject a} {f : U ⟶ V} + (hf : Positional f) : Positional (CategoryTheory.inv f) := by + rw [←Groupoid.inv_eq_inv] + exact (positionalSubgroupoid a).inv hf + +theorem sumArrow_positional {U V W Z : PolygonObject a} {f : U ⟶ W} {g : V ⟶ Z} + (hf : Positional f) (hg : Positional g) : Positional (sumArrow f g) := by + intro x + obtain ⟨y,rfl⟩ := (sumPointEquiv U V).surjective x + cases y with + | inl y => simpa only [sumArrow_inl,sumPointEquiv_inl] using hf y + | inr y => simpa only [sumArrow_inr,sumPointEquiv_inr] using hg y + +theorem sumSwap_positional (U V : PolygonObject a) : Positional (sumSwap U V) := by + intro x + obtain ⟨y,rfl⟩ := (sumPointEquiv U V).surjective x + cases y <;> simp only [sumSwap_apply,sumSwapEquiv_inl,sumSwapEquiv_inr, + sumPointEquiv_inl,sumPointEquiv_inr] + +theorem sumAssoc_positional (U V W : PolygonObject a) : Positional (sumAssoc U V W) := by + intro x + obtain ⟨y,rfl⟩ := (sumPointEquiv (sum U V) W).surjective x + cases y with + | inl y => + obtain ⟨z,rfl⟩ := (sumPointEquiv U V).surjective y + cases z <;> simp only [sumAssoc_apply,sumAssocEquiv_left,sumAssocEquiv_mid, + sumPointEquiv_inl,sumPointEquiv_inr] + | inr y => simp only [sumAssoc_apply,sumAssocEquiv_right,sumPointEquiv_inr] + +theorem leftUnit_positional (U : PolygonObject a) : Positional (leftUnit U) := by + intro x + obtain ⟨y,rfl⟩ := (sumPointEquiv empty U).surjective x + cases y with + | inl y => exact isEmptyElim y + | inr y => simp only [leftUnit_apply,leftUnitEquiv_apply,sumPointEquiv_inr] + +theorem rightUnit_positional (U : PolygonObject a) : Positional (rightUnit U) := by + intro x + obtain ⟨y,rfl⟩ := (sumPointEquiv U empty).surjective x + cases y with + | inl y => simp only [rightUnit_apply,rightUnitEquiv_apply,sumPointEquiv_inl] + | inr y => exact isEmptyElim y + +def positionalProperty (a : ℕ) : MorphismProperty (PolygonObject a) := + fun _ _ f => Positional f + +instance positionalProperty_multiplicative : (positionalProperty a).IsMultiplicative where + id_mem := identity_positional + comp_mem _ _ := positional_comp + +instance positionalProperty_monoidal : (positionalProperty a).IsMonoidalStable where + whiskerLeft U _ _ _ hf := sumArrow_positional (identity_positional U) hf + whiskerRight _ hf V := sumArrow_positional hf (identity_positional V) + associator_hom_mem := sumAssoc_positional + associator_inv_mem U V W := positional_inv (sumAssoc_positional U V W) + leftUnitor_hom_mem := leftUnit_positional + leftUnitor_inv_mem U := positional_inv (leftUnit_positional U) + rightUnitor_hom_mem := rightUnit_positional + rightUnitor_inv_mem U := positional_inv (rightUnit_positional U) + +instance positionalProperty_braided : (positionalProperty a).IsStableUnderBraiding where + braiding_hom_mem := sumSwap_positional + braiding_inv_mem U V := positional_inv (sumSwap_positional U V) + +abbrev PositionalCategory (a : ℕ) := WideSubcategory (positionalProperty a) + +end PolygonObject +end PolygonPositionalMonoidal + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/PolygonStringSimplicial.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/PolygonStringSimplicial.lean new file mode 100644 index 0000000000000000000000000000000000000000..e9066e0065b719cfcccf712846cc96fdb4d527e7 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/PolygonStringSimplicial.lean @@ -0,0 +1,45 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Configurations.PolygonStringNormalization + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section PolygonStringSimplicial + +open Classical CategoryTheory +open scoped Simplicial +namespace PolygonObject +variable {a : ℕ} + +noncomputable def stringSimplicial (a : ℕ) : SimplicialObject Cat.{0,0} where + obj n := Cat.of (StringGroupoid a n.unop.len) + map f := (stringReindex f.unop.toOrderHom.toFunctor).toCatHom + map_id n := by + apply Cat.ext + exact stringReindex_id n.unop.len + map_comp f g := by + apply Cat.ext + exact stringReindex_comp g.unop.toOrderHom.toFunctor f.unop.toOrderHom.toFunctor + +@[simp] theorem stringSimplicial_face (n : ℕ) (j : Fin (n+2)) : + ((stringSimplicial a).δ j).toFunctor=stringFace j := rfl + +noncomputable def stringDoubleNerve (a : ℕ) : SimplicialObject SSet := + stringSimplicial a ⋙ nerveFunctor + +@[simp] theorem stringDoubleNerve_obj (n : ℕ) : + (stringDoubleNerve a).obj (Opposite.op ⦋n⦌)=nerve (StringGroupoid a n) := rfl + +end PolygonObject +end PolygonStringSimplicial + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/PositionalInclusionMonoidal.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/PositionalInclusionMonoidal.lean new file mode 100644 index 0000000000000000000000000000000000000000..247c98a1ac8d0006424ba4eba42e3bc70742ab2c --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/PositionalInclusionMonoidal.lean @@ -0,0 +1,208 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.NestedPosReindex + +namespace OAI + +namespace RestrictedNerve + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory MonoidalCategory +open IntervalBar IntervalBar.Diagram + +private lemma compose_three_squares {D : Type*} [Category D] + {X₀ X₁ X₂ X₃ X₄ Y₁ Y₂ Y₃ : D} + (a : X₀ ⟶ X₁) (b : X₁ ⟶ X₂) (c : X₀ ⟶ Y₁) (d : Y₁ ⟶ X₂) + (e : X₂ ⟶ X₃) (f : Y₁ ⟶ Y₂) (g : Y₂ ⟶ X₃) (h : X₃ ⟶ X₄) + (i : Y₂ ⟶ Y₃) (j : Y₃ ⟶ X₄) + (h₁ : a ≫ b = c ≫ d) (h₂ : d ≫ e = f ≫ g) (h₃ : g ≫ h = i ≫ j) : + a ≫ (b ≫ e ≫ h) = (c ≫ f ≫ i) ≫ j := by + rw [← Category.assoc a b, h₁] + simp only [Category.assoc] + rw [← Category.assoc d e, h₂] + simp only [Category.assoc] + rw [h₃] + + +variable {C:Type} [Groupoid.{0} C] (W:MorphismProperty C) + [Fact W.StableUnderInverse] [MonoidalCategory C] [SymmetricCategory C] + [W.IsStableUnderBraiding] +variable {I J K:Type} [Preorder I] [Preorder J] [Preorder K] +@[simp] lemma posInclusion_ε : Functor.LaxMonoidal.ε (posDiagramInclusion W I)=mapεHom (inclusion W) := rfl +@[simp] lemma posInclusion_μ (A B:PosDiagrams W I) : + Functor.LaxMonoidal.μ (posDiagramInclusion W I) A B=mapμHom (inclusion W) A B := rfl +@[simp] lemma posReindex_ε (u:I→oJ) : Functor.LaxMonoidal.ε (posReindex W u)=𝟙 _ := rfl +noncomputable instance posReindex_inclusion_monoidal (u:I→oJ) : + NatTrans.IsMonoidal (eqToHom (posReindex_inclusion W u)) where + unit := by + apply Hom.ext; intro i j h + simp only [CategoryTheory.eqToHom_app] + simp only [Functor.LaxMonoidal.comp_ε,posInclusion_ε,posReindex_ε,IntervalBar.Diagram.reindex_ε] + simp [posReindex,diagramInclusion,Diagram.reindex,mapεHom] + erw [Diagram.eqToHom_app] + change (𝟙 (𝟙_ C) ≫ 𝟙 _) ≫ 𝟙 _ = 𝟙 _ ≫ 𝟙 _ + simp only [Category.comp_id] + tensor A B := by + apply Hom.ext; intro i j h + simp only [CategoryTheory.eqToHom_app] + simp only [Functor.LaxMonoidal.comp_μ,posInclusion_μ,posReindex_μ,IntervalBar.Diagram.reindex_μ] + simp [posReindex,diagramInclusion,Diagram.reindex,mapμHom] + erw [Diagram.eqToHom_app, Diagram.eqToHom_app, Diagram.eqToHom_app] + change (𝟙 ((A.obj (u i) (u j) (u.monotone h)).obj ⊗ + (B.obj (u i) (u j) (u.monotone h)).obj) ≫ 𝟙 _) ≫ 𝟙 _ = (𝟙 _ ⊗ₘ 𝟙 _) ≫ 𝟙 _ ≫ 𝟙 _ + simp only [id_tensorHom_id, Category.comp_id] +lemma map_posReindex_inclusion (u:I→oJ) : + Diagram.map (I:=K) (posReindex W u) ⋙ Diagram.map (posDiagramInclusion W I) = + Diagram.map (posDiagramInclusion W J) ⋙ Diagram.map (Diagram.reindex u) := by + have he := map_congr (I:=K) (posReindex_inclusion W u) (posReindex_inclusion_monoidal W u) + simpa only [Diagram.map_comp] using he +end + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory MonoidalCategory SimplicialObject Simplicial Opposite +open IntervalBar IntervalBar.Diagram + +variable {C:Type} [Groupoid.{0} C] (W:MorphismProperty C) + [Fact W.StableUnderInverse] [MonoidalCategory C] [SymmetricCategory C] + [W.IsStableUnderBraiding] + +noncomputable def tripleOuterReindex (p q:ℕ) {r s:ℕ} (u:Fin (r+1)→oFin (s+1)) : + tripleDiagramHorizontal W p q s ⟶ tripleDiagramHorizontal W p q r where + app n := (Diagram.reindex (C:=Diagram (Diagram (Strings W n.unop.len) + (Fin (p+1))) (Fin (q+1))) u).toCatHom + naturality _ _ f := by + apply Cat.ext + exact (Diagram.reindex_map (Diagram.map (I:=Fin (q+1)) + (Diagram.map (I:=Fin (p+1)) (reindex W f.unop.toOrderHom.toFunctor))) u).symm +lemma tripleTranspose_outerReindex (p q n:ℕ) {r s:ℕ} (u:Fin (r+1)→oFin (s+1)) : + Diagram.reindex (C:=Diagram (Diagram (Strings W n) (Fin (p+1))) (Fin (q+1))) u ⋙ + tripleTranspose W p q r n = + tripleTranspose W p q s n ⋙ stringsMap (property₃ W p q s) (property₃ W p q r) + (posReindex (property₂ W p q) u) (posReindex_property (property₂ W p q) u) n := by + unfold tripleTranspose + rw [←Functor.assoc,Diagram.reindex_map] + simp only [Functor.assoc] + rw [←Functor.assoc (Diagram.reindex u),Diagram.reindex_map] + simp only [Functor.assoc] + rw [transpose_posReindex (property₂ W p q) u n] +lemma tripleDiagramTranspose_outerReindex (p q:ℕ) {r s:ℕ} (u:Fin (r+1)→oFin (s+1)) : + tripleOuterReindex W p q u ≫ tripleDiagramTranspose W p q r = + tripleDiagramTranspose W p q s ≫ horizontalMap (property₃ W p q s) (property₃ W p q r) + (posReindex (property₂ W p q) u) (posReindex_property (property₂ W p q) u) := by + apply NatTrans.ext; funext n; apply Cat.ext + exact tripleTranspose_outerReindex W p q n.unop.len u +lemma triplePosInclusion_outerReindex (p q:ℕ) {r s:ℕ} (u:Fin (r+1)→oFin (s+1)) : + posReindex (property₂ W p q) u ⋙ triplePosInclusion W p q r = + triplePosInclusion W p q s ⋙ Diagram.reindex u := by + unfold triplePosInclusion + rw [←Functor.assoc,←Functor.assoc,posReindex_inclusion] + simp only [Functor.assoc] + rw [←Functor.assoc (Diagram.reindex u),Diagram.reindex_map] + simp only [Functor.assoc] + rw [Diagram.reindex_map] +lemma tripleDiagramResolutionHomologyIso_outer_natural (p q:ℕ) {r s:ℕ} + (u:Fin (r+1)→oFin (s+1)) (j:ℕ) : + SSet.homologyMap (SimplicialDiagonal.nerveDiagonal.map (tripleOuterReindex W p q u)) + DiagonalResolution.Z j ≫ (tripleDiagramResolutionHomologyIso W p q r j).hom = + (tripleDiagramResolutionHomologyIso W p q s j).hom ≫ + SSet.homologyMap (nerveMap (Diagram.reindex u)) DiagonalResolution.Z j := by + let H := SSet.homologyFunctor DiagonalResolution.Z j + let N := SimplicialDiagonal.nerveDiagonal + have ht := congrArg (fun f=>H.map (N.map f)) (tripleDiagramTranspose_outerReindex W p q u) + simp only [Functor.map_comp] at ht + have hr := homologyIso_natural (property₃ W p q s) (property₃ W p q r) + (posReindex (property₂ W p q) u) (posReindex_property (property₂ W p q) u) j + change H.map (N.map (horizontalMap (property₃ W p q s) (property₃ W p q r) + (posReindex (property₂ W p q) u) (posReindex_property (property₂ W p q) u))) ≫ + (homologyIso (property₃ W p q r) j).hom = + (homologyIso (property₃ W p q s) j).hom ≫ + H.map (nerveMap (posReindex (property₂ W p q) u)) at hr + have he : nerveMap (posReindex (property₂ W p q) u) ≫ nerveMap (triplePosInclusion W p q r) = + nerveMap (triplePosInclusion W p q s) ≫ nerveMap (Diagram.reindex u) := by + change nerveMap (posReindex (property₂ W p q) u ⋙ triplePosInclusion W p q r) = + nerveMap (triplePosInclusion W p q s ⋙ Diagram.reindex u) + rw [triplePosInclusion_outerReindex] + have hi := congrArg H.map he + simp only [Functor.map_comp] at hi + change H.map (N.map (tripleOuterReindex W p q u)) ≫ + (H.map (N.map (tripleDiagramTranspose W p q r)) ≫ + (homologyIso (property₃ W p q r) j).hom ≫ + H.map (nerveMap (triplePosInclusion W p q r))) = + (H.map (N.map (tripleDiagramTranspose W p q s)) ≫ + (homologyIso (property₃ W p q s) j).hom ≫ + H.map (nerveMap (triplePosInclusion W p q s))) ≫ + H.map (nerveMap (Diagram.reindex u)) + exact compose_three_squares _ _ _ _ _ _ _ _ _ _ ht hr hi +noncomputable def tripleMiddleReindex (p r:ℕ) {q s:ℕ} (u:Fin (q+1)→oFin (s+1)) : + tripleDiagramHorizontal W p s r ⟶ tripleDiagramHorizontal W p q r where + app n := (Diagram.map (I:=Fin (r+1)) (Diagram.reindex (C:=Diagram (Strings W n.unop.len) + (Fin (p+1))) u)).toCatHom + naturality _ _ f := by + apply Cat.ext + exact (Diagram.map_reindex_map (I:=Fin (q+1)) (J:=Fin (s+1)) (K:=Fin (r+1)) + (Diagram.map (I:=Fin (p+1)) (reindex W f.unop.toOrderHom.toFunctor)) u).symm +lemma tripleTranspose_middleReindex (p r n:ℕ) {q s:ℕ} (u:Fin (q+1)→oFin (s+1)) : + Diagram.map (I:=Fin (r+1)) (Diagram.reindex (C:=Diagram (Strings W n) (Fin (p+1))) u) ⋙ + tripleTranspose W p q r n = + tripleTranspose W p s r n ⋙ stringsMap (property₃ W p s r) (property₃ W p q r) + (nestedPosReindex (diagramProperty W (Fin (p+1))) u) + (nestedPosReindex_property (diagramProperty W (Fin (p+1))) u) n := by + have he := Diagram.map_reindex_map (K:=Fin (r+1)) (transposeDiagram (I:=Fin (p+1)) W n) u + unfold tripleTranspose + rw [←Functor.assoc,←Functor.assoc,he] + simp only [Functor.assoc] + rw [doubleTranspose_innerReindex (K:=Fin (r+1)) (diagramProperty W (Fin (p+1))) u n] +lemma tripleDiagramTranspose_middleReindex (p r:ℕ) {q s:ℕ} (u:Fin (q+1)→oFin (s+1)) : + tripleMiddleReindex W p r u ≫ tripleDiagramTranspose W p q r = + tripleDiagramTranspose W p s r ≫ horizontalMap (property₃ W p s r) (property₃ W p q r) + (nestedPosReindex (diagramProperty W (Fin (p+1))) u) + (nestedPosReindex_property (diagramProperty W (Fin (p+1))) u) := by + apply NatTrans.ext; funext n; apply Cat.ext + exact tripleTranspose_middleReindex W p r n.unop.len u +lemma triplePosInclusion_middleReindex (p r:ℕ) {q s:ℕ} (u:Fin (q+1)→oFin (s+1)) : + nestedPosReindex (diagramProperty W (Fin (p+1))) u ⋙ triplePosInclusion W p q r = + triplePosInclusion W p s r ⋙ Diagram.map (Diagram.reindex u) := by + unfold triplePosInclusion + rw [←Functor.assoc,←Functor.assoc,nestedPosReindex_inclusion] + simp only [Functor.assoc] + rw [←Functor.assoc (Diagram.map (posReindex (diagramProperty W (Fin (p+1))) u)), + map_posReindex_inclusion] + simp only [Functor.assoc] + rw [Diagram.map_reindex_map] +lemma tripleDiagramResolutionHomologyIso_middle_natural (p r:ℕ) {q s:ℕ} + (u:Fin (q+1)→oFin (s+1)) (j:ℕ) : + SSet.homologyMap (SimplicialDiagonal.nerveDiagonal.map (tripleMiddleReindex W p r u)) + DiagonalResolution.Z j ≫ (tripleDiagramResolutionHomologyIso W p q r j).hom = + (tripleDiagramResolutionHomologyIso W p s r j).hom ≫ + SSet.homologyMap (nerveMap (Diagram.map (Diagram.reindex u))) DiagonalResolution.Z j := by + let H := SSet.homologyFunctor DiagonalResolution.Z j + let N := SimplicialDiagonal.nerveDiagonal + have ht := congrArg (fun f=>H.map (N.map f)) (tripleDiagramTranspose_middleReindex W p r u) + simp only [Functor.map_comp] at ht + have hr := homologyIso_natural (property₃ W p s r) (property₃ W p q r) + (nestedPosReindex (diagramProperty W (Fin (p+1))) u) (nestedPosReindex_property (diagramProperty W (Fin (p+1))) u) j + change H.map (N.map (horizontalMap (property₃ W p s r) (property₃ W p q r) + (nestedPosReindex (diagramProperty W (Fin (p+1))) u) (nestedPosReindex_property (diagramProperty W (Fin (p+1))) u))) ≫ + (homologyIso (property₃ W p q r) j).hom = + (homologyIso (property₃ W p s r) j).hom ≫ + H.map (nerveMap (nestedPosReindex (diagramProperty W (Fin (p+1))) u)) at hr + have he : nerveMap (nestedPosReindex (diagramProperty W (Fin (p+1))) u) ≫ nerveMap (triplePosInclusion W p q r) = + nerveMap (triplePosInclusion W p s r) ≫ nerveMap (Diagram.map (Diagram.reindex u)) := by + change nerveMap (nestedPosReindex (diagramProperty W (Fin (p+1))) u ⋙ triplePosInclusion W p q r) = + nerveMap (triplePosInclusion W p s r ⋙ Diagram.map (Diagram.reindex u)) + rw [triplePosInclusion_middleReindex] + have hi := congrArg H.map he + simp only [Functor.map_comp] at hi + change H.map (N.map (tripleMiddleReindex W p r u)) ≫ + (H.map (N.map (tripleDiagramTranspose W p q r)) ≫ + (homologyIso (property₃ W p q r) j).hom ≫ + H.map (nerveMap (triplePosInclusion W p q r))) = + (H.map (N.map (tripleDiagramTranspose W p s r)) ≫ + (homologyIso (property₃ W p s r) j).hom ≫ + H.map (nerveMap (triplePosInclusion W p s r))) ≫ + H.map (nerveMap (Diagram.map (Diagram.reindex u))) + exact compose_three_squares _ _ _ _ _ _ _ _ _ _ ht hr hi +end + +end RestrictedNerve + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/PowerDiagonal.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/PowerDiagonal.lean new file mode 100644 index 0000000000000000000000000000000000000000..78056517c58c45ba3a970cebb2231347a1e5dadb --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/PowerDiagonal.lean @@ -0,0 +1,91 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Configurations.StageEvaluationEquiv +import OAI.GroupTheory.SimpleAmenable.Simplicial.StageMonoidal +import OAI.GroupTheory.SimpleAmenable.Simplicial.TripleComposition + +namespace OAI + +section + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Simplicial Opposite +namespace BarFinitePower +open SimplicialDiagonal + +variable (κ : Type) {X Y : SimplexCategoryᵒᵖ ⥤ SSet} +noncomputable def liftRows (f : κ → (X ⟶ Y)) : X ⟶ Y ⋙ power κ where + app p := lift κ (fun k => (f k).app p) + naturality p q g := by + apply NatTrans.ext; funext r + apply ConcreteCategory.hom_ext; intro x; funext k + exact congrArg (fun f => (f.app r) x) ((f k).naturality g) +lemma liftDiagonal (f : κ → (X ⟶ Y)) : + lift κ (fun k => diagonal.map (f k)) = diagonal.map (liftRows κ f) := rfl +lemma homologyLiftDiagonal_isIso (f : κ → (X ⟶ Y)) + (h : ∀p n, IsIso (SSet.homologyMap (lift κ (fun k => (f k).app p)) DiagonalResolution.Z n)) (n:ℕ) : + IsIso (SSet.homologyMap (lift κ (fun k => diagonal.map (f k))) DiagonalResolution.Z n) := by + rw [liftDiagonal] + apply homologyMap_isIso + exact h +end BarFinitePower + +end + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory MonoidalCategory Simplicial Opposite +namespace BarFinitePower +open IntervalBar IntervalBar.Diagram SimplicialDiagonal + +variable {C : Type} [Groupoid.{0} C] [MonoidalCategory C] [SymmetricCategory C] (κ : Type) +noncomputable def triplePowerComparison : bar₃ (C:=κ → C) ⟶ (power κ).obj (bar₃ (C:=C)) := + lift κ (fun k => bar₃Map (project κ k)) +lemma tripleDegree_homology_isIso (l m p k:ℕ) : + IsIso (SSet.homologyMap (lift κ (fun j => nerveMap + (map (I:=Fin (l+1)) (map (I:=Fin (m+1)) (map (I:=Fin (p+1)) (project (C:=C) κ j)))))) + DiagonalResolution.Z k) := by + have : (Functor.pi' (fun j => map (I:=Fin (l+1)) (map (I:=Fin (m+1)) (map (I:=Fin (p+1)) (project (C:=C) κ j))))).IsEquivalence := + inferInstanceAs (tripleProject (C:=C) κ l m p).IsEquivalence + exact lift_nerve_homology_isIso κ (fun j => map (I:=Fin (l+1)) + (map (I:=Fin (m+1)) (map (I:=Fin (p+1)) (project (C:=C) κ j)))) k +lemma tripleBarOne_homology_isIso (m p k:ℕ) : + IsIso (SSet.homologyMap (lift κ (fun j => barMap + (map (I:=Fin (m+1)) (map (I:=Fin (p+1)) (project (C:=C) κ j))))) DiagonalResolution.Z k) := by + apply homologyLiftDiagonal_isIso κ (fun j => + Functor.whiskerRight (simplicialMap (map (I:=Fin (m+1)) + (map (I:=Fin (p+1)) (project (C:=C) κ j)))) nerveFunctor) + intro l q + exact tripleDegree_homology_isIso κ l.unop.len m p q +lemma tripleBarTwo_homology_isIso (p k:ℕ) : + IsIso (SSet.homologyMap (lift κ (fun j => bar₂Map + (map (I:=Fin (p+1)) (project (C:=C) κ j)))) DiagonalResolution.Z k) := by + apply homologyLiftDiagonal_isIso κ (fun j => rows₂Map (map (I:=Fin (p+1)) (project (C:=C) κ j))) + intro m q + exact tripleBarOne_homology_isIso κ m.unop.len p q + +lemma triplePowerComparison_homology_isIso (n:ℕ) : + IsIso (SSet.homologyMap (triplePowerComparison (C:=C) κ) DiagonalResolution.Z n) := by + apply homologyLiftDiagonal_isIso κ (fun k => rows₃Map (project (C:=C) κ k)) + intro p q + exact tripleBarTwo_homology_isIso κ p.unop.len q +end BarFinitePower +namespace SimpleAmenable.PolygonObject.LabelledStage.Stage +open IntervalBar.Diagram BarFinitePower + +variable {a n : ℕ} (S : Stage a n) +noncomputable def finiteProductComparison : bar₃ (C:=S.Obj) ⟶ + (power (Fin S.partition.size × Fin S.support.card)).obj (bar₃ (C:=FiniteSetGroupoid)) := + bar₃Map UniformObject.evaluation ≫ triplePowerComparison _ +lemma finiteProductComparison_homology_isIso (k:ℕ) : + IsIso (SSet.homologyMap S.finiteProductComparison DiagonalResolution.Z k) := by + have := evaluationIsEquivalence S.partition S.L S.L_reduced S.L_injective + rw [finiteProductComparison,SSet.homologyMap_comp] + have := bar₃Map_homology_isIso (UniformObject.evaluation (P:=S.partition) (L:=S.L)) k + have := triplePowerComparison_homology_isIso (C:=FiniteSetGroupoid) (Fin S.partition.size × Fin S.support.card) k + infer_instance +end SimpleAmenable.PolygonObject.LabelledStage.Stage + +end + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/RegularBlockFaces.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/RegularBlockFaces.lean new file mode 100644 index 0000000000000000000000000000000000000000..d2d31f7e62084839df68240af0e9e31a7a7f857d --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/RegularBlockFaces.lean @@ -0,0 +1,66 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.RegularLiftFaces + +namespace OAI + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits Simplicial SimplicialObject Opposite HomologicalComplex AlgebraicTopology +namespace MonoidNerveCoordinates +open CoefficientNerve + +variable {P:Type} [CommMonoid P] +lemma trunc_ofLabels {n:ℕ} (k:Fin (n+2)) (x:Fin (n+1)→P) : + trunc (SimplexCategory.δ k) (ofLabels x)=ofLabels (faceLabels k x) := by + rw [←ofLabels_labels (trunc (SimplexCategory.δ k) (ofLabels x))] + congr 1 + exact (labels_face (ofLabels x) k).trans (congrArg (faceLabels k) (labels_ofLabels x)) +end MonoidNerveCoordinates +namespace RegularLabels +open CoefficientNerve RegularCoordinates MonoidNerveCoordinates FreeChains + +variable {P:Type} [CommMonoid P] (F:ActionCategory P P ⥤ A) +@[reassoc] lemma inj_horizontalFace {h v:ℕ} (k:Fin (h+2)) (y:Fin v→P) (p:P) (x:Fin (h+1)→P) : + inj F (y,p,x) ≫ ((chainSimplicial (RegularCoefficient.coeffComplex F)).δ k).f v = + F.map (arrow (faceWeight k x) p) ≫ inj F (y,faceWeight k x*p,faceLabels k x) := by + change singleLabel F p y ≫ single ((RegularCoefficient.coeffComplex F).X v) (ofLabels x) ≫ + map ((RegularCoefficient.coeffComplex F).X v) (SimplexCategory.δ k) = _ + erw [single_map,tail_face,trunc_ofLabels] + change singleLabel F p y ≫ (RegularCoefficient.action F (faceWeight k x)).app (op ⦋v⦌) ≫ + single ((RegularCoefficient.coeffComplex F).X v) (ofLabels (faceLabels k x)) = _ + erw [←Category.assoc,singleLabel_action,Category.assoc] +@[reassoc] lemma inj_dV {h v:ℕ} (y:Fin (v+1)→P) (p:P) (x:Fin h→P) : + inj F (y,p,x) ≫ ((RegularCoefficient.double F).X h).d (v+1) v = + ∑k:Fin (v+2),(-1:ℤ)^k.val • (F.map (arrow (faceWeight k y) p) ≫ + inj F (faceLabels k y,faceWeight k y*p,x)) := by + change singleLabel F p y ≫ single ((RegularCoefficient.coeffComplex F).X (v+1)) (ofLabels x) ≫ + (mapNat ((RegularCoefficient.coeffComplex F).d (v+1) v)).app (op ⦋h⦌) = _ + erw [single_mapNat] + change singleLabel F p y ≫ (complex F).d (v+1) v ≫ + single ((RegularCoefficient.coeffComplex F).X v) (ofLabels x) = _ + have hd : (complex F).d (v+1) v = ∑k:Fin (v+2),(-1:ℤ)^k.val • (simplicial F).δ k := + AlternatingFaceMapComplex.obj_d_eq (simplicial F) v + rw [hd] + erw [Preadditive.sum_comp,Preadditive.comp_sum] + apply Finset.sum_congr rfl + intro index _ + erw [Preadditive.zsmul_comp,Preadditive.comp_zsmul,←Category.assoc,singleLabel_face,Category.assoc] + rfl +@[reassoc] lemma inj_dH {h v:ℕ} (y:Fin v→P) (p:P) (x:Fin (h+1)→P) : + inj F (y,p,x) ≫ ((RegularCoefficient.double F).d (h+1) h).f v = + ∑k:Fin (h+2),(-1:ℤ)^k.val • (F.map (arrow (faceWeight k x) p) ≫ + inj F (y,faceWeight k x*p,faceLabels k x)) := by + change inj F (y,p,x) ≫ ((AlternatingFaceMapComplex.obj + (chainSimplicial (RegularCoefficient.coeffComplex F))).d (h+1) h).f v = _ + rw [AlternatingFaceMapComplex.obj_d_eq] + change inj F (y,p,x) ≫ (HomologicalComplex.Hom.fAddMonoidHom v) + (∑i:Fin (h+2),(-1:ℤ)^i.val • (chainSimplicial (RegularCoefficient.coeffComplex F)).δ i) = _ + erw [map_sum,Preadditive.comp_sum] + apply Finset.sum_congr rfl + intro index _ + erw [map_zsmul,Preadditive.comp_zsmul,inj_horizontalFace] + rfl +end RegularLabels + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/ReindexHomology.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/ReindexHomology.lean new file mode 100644 index 0000000000000000000000000000000000000000..c6ddfc5f86d89e8d992acb2a10e1610baa602032 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/ReindexHomology.lean @@ -0,0 +1,82 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.RelabelCoefficients +import OAI.GroupTheory.SimpleAmenable.Homology.TranslationCoefficients +import OAI.GroupTheory.SimpleAmenable.Simplicial.TrajectoryReindexLabels + +namespace OAI + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits MonoidalCategory +namespace SimpleAmenable.PolygonObject +noncomputable instance stringReindex_braided {a n m : ℕ} (u : Fin (n+1) ⥤ Fin (m+1)) : + (stringReindex (a:=a) u).Braided where + braided _ _ := by + apply WideSubcategory.hom_ext + ext i + change 𝟙 _ ≫ (β_ _ _).hom = (β_ _ _).hom ≫ 𝟙 _ + simp +end SimpleAmenable.PolygonObject +namespace SimpleAmenable.PolygonObject.LabelledStage +open IntervalBar.Diagram BarFinitePower FreeChains Labelled + +variable {a n m : ℕ} {K : Type} [AddCommGroup K] +noncomputable def reindexCoefficients (u : Fin (m+1) ⥤ Fin (n+1)) : + Coefficients a n K →ₗ[ℤ] Coefficients a m K := + (relabelCoefficients (reindexLabel u) (reindexLabel_reduced u)).comp + (translateCoefficients (initialDisplacement u)) +lemma reindexCoefficients_single (u : Fin (m+1) ⥤ Fin (n+1)) + (l : ReducedLabel n) (s : BooleanStep a K) : + reindexCoefficients (K:=K) u (Finsupp.single l s) = + Finsupp.single (labelMap (reindexLabel u) (reindexLabel_reduced u) l) + (stepTranslate (K:=K) (initialDisplacement u l.val) s) := by + simp only [reindexCoefficients,LinearMap.comp_apply,translateCoefficients_single, + relabelCoefficients_single] +namespace Stage +lemma homologyCoefficientIso_reindex (u : Fin (m+1) ⥤ Fin (n+1)) + (j : ℕ) (hj : 0.symm,Category.assoc, + toStrings_stringCoefficientIso,←Category.assoc,toStrings_stringCoefficientIso] + exact Stage.homologyCoefficientIso_reindex u j hj hj5 +end SimpleAmenable.PolygonObject.LabelledStage + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/ResolutionAugmentation.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/ResolutionAugmentation.lean new file mode 100644 index 0000000000000000000000000000000000000000..5c24de01112e27b6172e59b7893f53f5a7ac6c18 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/ResolutionAugmentation.lean @@ -0,0 +1,151 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.PositionalInclusionMonoidal + +namespace OAI + +namespace RestrictedNerve + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory SimplicialObject Simplicial Opposite + +variable {C:Type} [Groupoid.{0} C] (W:MorphismProperty C) [W.IsMultiplicative] + +def verticalDiagonalFunctor {n:ℕ} (F:Fin (n+1)⥤Vertical W n) : Fin (n+1)⥤C where + obj i := (F.obj i).obj.obj i + map {i j} f := (F.map f).hom.app i ≫ (F.obj j).obj.map f + map_id _ := by simp + map_comp {i j k} f g := by + have hn := (F.map g).hom.naturality f + simp only [Functor.map_comp, ObjectProperty.FullSubcategory.comp_hom, NatTrans.comp_app] + simp only [Category.assoc] + rw [←Category.assoc ((F.map g).hom.app i),←hn] + simp only [Category.assoc] +def verticalAugmentation : SimplicialDiagonal.nerveDiagonal.obj (vertical W) ⟶ nerve C where + app _ := ↾(verticalDiagonalFunctor W) + naturality _ _ _ := by + ext F + refine CategoryTheory.Functor.ext (fun _=>rfl) ?_ + intro i j g + erw [Category.id_comp, Category.comp_id] + rfl +lemma constantMap_verticalAugmentation : + SimplicialDiagonal.nerveDiagonal.map (constantMap W) ≫ verticalAugmentation W = + (constantDiagonalIso (C:=C)).hom := by + ext n F + refine CategoryTheory.Functor.ext (fun _=>rfl) ?_ + intro i j f + erw [Category.id_comp, Category.comp_id] + change F.map f ≫ 𝟙 _ = F.map f + simp + +noncomputable def resolutionAugmentation : + SimplicialDiagonal.nerveDiagonal.obj (horizontal W) ⟶ nerve C := + (diagonalIso W).hom ≫ verticalAugmentation W +lemma resolutionAugmentation_homology (j:ℕ) : + SSet.homologyMap (resolutionAugmentation W) DiagonalResolution.Z j = (homologyIso W j).hom := by + let H := SSet.homologyFunctor DiagonalResolution.Z j + let N := SimplicialDiagonal.nerveDiagonal + have constantMap_isIso : IsIso (H.map (N.map (constantMap W))) := + SimplicialDiagonal.nerveDiagonal_isIso (constantMap W) + (fun p=>inferInstanceAs (constant W p.unop.len).IsEquivalence) j + have hc := congrArg H.map (constantMap_verticalAugmentation W) + simp only [Functor.map_comp] at hc + have hv : H.map (verticalAugmentation W) = inv (H.map (N.map (constantMap W))) ≫ + H.map (constantDiagonalIso (C:=C)).hom := by + rw [←hc,←Category.assoc,IsIso.inv_hom_id,Category.id_comp] + change H.map ((diagonalIso W).hom ≫ verticalAugmentation W) = + H.map (diagonalIso W).hom ≫ inv (H.map (N.map (constantMap W))) ≫ H.map (constantDiagonalIso (C:=C)).hom + rw [Functor.map_comp,hv] +noncomputable instance resolutionAugmentation_isIso (j:ℕ) : + IsIso (SSet.homologyMap (resolutionAugmentation W) DiagonalResolution.Z j) := by + rw [resolutionAugmentation_homology] + infer_instance +variable {D:Type} [Groupoid.{0} D] (V:MorphismProperty D) [V.IsMultiplicative] + (F:C⥤D) (hF:∀{X Y:C} (f:X⟶Y),W f→V (F.map f)) +omit [W.IsMultiplicative] [V.IsMultiplicative] in +lemma verticalAugmentation_natural : + SimplicialDiagonal.nerveDiagonal.map (verticalMapNat W V F hF) ≫ verticalAugmentation V = + verticalAugmentation W ≫ nerveMap F := by + ext n A + refine CategoryTheory.Functor.ext (fun _=>rfl) ?_ + intro i j f + erw [Category.id_comp, Category.comp_id] + change F.map ((A.map f).hom.app i) ≫ F.map ((A.obj j).obj.map f) = F.map (_ ≫ _) + rw [F.map_comp] +lemma resolutionAugmentation_natural : + SimplicialDiagonal.nerveDiagonal.map (horizontalMap W V F hF) ≫ resolutionAugmentation V = + resolutionAugmentation W ≫ nerveMap F := by + unfold resolutionAugmentation + rw [←Category.assoc,diagonalIso_natural] + simp only [Category.assoc] + rw [verticalAugmentation_natural] +end + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory MonoidalCategory SimplicialObject Simplicial Opposite +open IntervalBar IntervalBar.Diagram + +variable {C:Type} [Groupoid.{0} C] (W:MorphismProperty C) + [Fact W.StableUnderInverse] [MonoidalCategory C] [SymmetricCategory C] + [W.IsStableUnderBraiding] + +noncomputable def tripleResolutionAugmentation (p q r:ℕ) : + SimplicialDiagonal.nerveDiagonal.obj (tripleDiagramHorizontal W p q r) ⟶ + nerve (Diagram (Diagram (Diagram C (Fin (p+1))) (Fin (q+1))) (Fin (r+1))) := + SimplicialDiagonal.nerveDiagonal.map (tripleDiagramTranspose W p q r) ≫ + resolutionAugmentation (property₃ W p q r) ≫ nerveMap (triplePosInclusion W p q r) +lemma tripleResolutionAugmentation_homology (p q r j:ℕ) : + SSet.homologyMap (tripleResolutionAugmentation W p q r) DiagonalResolution.Z j = + (tripleDiagramResolutionHomologyIso W p q r j).hom := by + change (SSet.homologyFunctor DiagonalResolution.Z j).map + (SimplicialDiagonal.nerveDiagonal.map (tripleDiagramTranspose W p q r) ≫ + resolutionAugmentation (property₃ W p q r) ≫ nerveMap (triplePosInclusion W p q r)) = _ + simp only [Functor.map_comp] + rw [show (SSet.homologyFunctor DiagonalResolution.Z j).map (resolutionAugmentation (property₃ W p q r)) = + (homologyIso (property₃ W p q r) j).hom from resolutionAugmentation_homology _ j] + rfl +noncomputable instance tripleResolutionAugmentation_isIso (p q r j:ℕ) : + IsIso (SSet.homologyMap (tripleResolutionAugmentation W p q r) DiagonalResolution.Z j) := by + rw [tripleResolutionAugmentation_homology] + infer_instance +lemma tripleResolutionAugmentation_outer_natural (p q:ℕ) {r s:ℕ} + (u:Fin (r+1)→oFin (s+1)) : + SimplicialDiagonal.nerveDiagonal.map (tripleOuterReindex W p q u) ≫ + tripleResolutionAugmentation W p q r = + tripleResolutionAugmentation W p q s ≫ nerveMap (Diagram.reindex u) := by + have ht := congrArg SimplicialDiagonal.nerveDiagonal.map (tripleDiagramTranspose_outerReindex W p q u) + simp only [Functor.map_comp] at ht + unfold tripleResolutionAugmentation + rw [←Category.assoc _ (SimplicialDiagonal.nerveDiagonal.map (tripleDiagramTranspose W p q r)),ht] + simp only [Category.assoc] + rw [←Category.assoc _ (resolutionAugmentation (property₃ W p q r)),resolutionAugmentation_natural] + simp only [Category.assoc] + have he : nerveMap (posReindex (property₂ W p q) u) ≫ nerveMap (triplePosInclusion W p q r) = + nerveMap (triplePosInclusion W p q s) ≫ nerveMap (Diagram.reindex u) := by + change nerveMap (posReindex (property₂ W p q) u ⋙ triplePosInclusion W p q r) = + nerveMap (triplePosInclusion W p q s ⋙ Diagram.reindex u) + rw [triplePosInclusion_outerReindex] + rw [he] +lemma tripleResolutionAugmentation_middle_natural (p r:ℕ) {q s:ℕ} + (u:Fin (q+1)→oFin (s+1)) : + SimplicialDiagonal.nerveDiagonal.map (tripleMiddleReindex W p r u) ≫ + tripleResolutionAugmentation W p q r = + tripleResolutionAugmentation W p s r ≫ nerveMap (Diagram.map (Diagram.reindex u)) := by + have ht := congrArg SimplicialDiagonal.nerveDiagonal.map (tripleDiagramTranspose_middleReindex W p r u) + simp only [Functor.map_comp] at ht + unfold tripleResolutionAugmentation + rw [←Category.assoc _ (SimplicialDiagonal.nerveDiagonal.map (tripleDiagramTranspose W p q r)),ht] + simp only [Category.assoc] + rw [←Category.assoc _ (resolutionAugmentation (property₃ W p q r)),resolutionAugmentation_natural] + simp only [Category.assoc] + have he : nerveMap (nestedPosReindex (diagramProperty W (Fin (p+1))) u) ≫ nerveMap (triplePosInclusion W p q r) = + nerveMap (triplePosInclusion W p s r) ≫ nerveMap (Diagram.map (Diagram.reindex u)) := by + change nerveMap (nestedPosReindex (diagramProperty W (Fin (p+1))) u ⋙ triplePosInclusion W p q r) = + nerveMap (triplePosInclusion W p s r ⋙ Diagram.map (Diagram.reindex u)) + rw [triplePosInclusion_middleReindex] + rw [he] +end + +end RestrictedNerve + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/RestrictedFunctorial.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/RestrictedFunctorial.lean new file mode 100644 index 0000000000000000000000000000000000000000..aa11bbc6cf3bb36cf16cbfa117b46f39f6a33bf3 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/RestrictedFunctorial.lean @@ -0,0 +1,178 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.RestrictedMonoidalTranspose + +namespace OAI + +namespace RestrictedNerve + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory SimplicialObject Simplicial Opposite + +section + +variable {C D:Type} [Groupoid.{0} C] [Groupoid.{0} D] + (W:MorphismProperty C) (V:MorphismProperty D) [W.IsMultiplicative] [V.IsMultiplicative] + (F:C⥤D) (hF:∀{X Y:C} (f:X⟶Y),W f→V (F.map f)) +def stringsMap (n:ℕ) : Strings W n ⥤ Strings V n where + obj A := ⟨A.obj⋙F⟩ + map f := ⟨Functor.whiskerRight f.hom F,fun i=>hF _ (f.property i)⟩ + map_id _ := by apply WideSubcategory.hom_ext; ext i; exact F.map_id _ + map_comp _ _ := by apply WideSubcategory.hom_ext; ext i; exact F.map_comp _ _ +def verticalMap (n:ℕ) : Vertical W n ⥤ Vertical V n where + obj A := ⟨A.obj⋙F,fun i j f=>hF _ (A.property i j f)⟩ + map f := ObjectProperty.homMk (Functor.whiskerRight f.hom F) + map_id _ := by apply ObjectProperty.hom_ext; ext i; exact F.map_id _ + map_comp _ _ := by apply ObjectProperty.hom_ext; ext i; exact F.map_comp _ _ +def horizontalMap : horizontal W ⟶ horizontal V where + app p := (stringsMap W V F hF p.unop.len).toCatHom + naturality _ _ f := by + apply Cat.ext + refine CategoryTheory.Functor.ext (fun _ => rfl) ?_ + intro source target arrow + erw [Category.id_comp, Category.comp_id] + apply WideSubcategory.hom_ext; ext index; rfl +def verticalMapNat : vertical W ⟶ vertical V where + app p := (verticalMap W V F hF p.unop.len).toCatHom + naturality _ _ f := by + apply Cat.ext + refine CategoryTheory.Functor.ext (fun _ => rfl) ?_ + intro source target arrow + erw [Category.id_comp, Category.comp_id] + apply ObjectProperty.hom_ext; ext index; rfl +lemma diagonalIso_natural : + SimplicialDiagonal.nerveDiagonal.map (horizontalMap W V F hF) ≫ (diagonalIso V).hom = + (diagonalIso W).hom ≫ SimplicialDiagonal.nerveDiagonal.map (verticalMapNat W V F hF) := by + ext p x + refine CategoryTheory.Functor.ext (fun _ => rfl) ?_ + intro source target arrow + erw [Category.id_comp, Category.comp_id] + apply ObjectProperty.hom_ext; ext index; rfl +omit [W.IsMultiplicative] in +@[simp] lemma eqToHom_vertical_app {n:ℕ} {A B:Vertical W n} (e:A=B) (i:Fin (n+1)) : + (eqToHom e).hom.app i=eqToHom (congrArg (fun A:Vertical W n=>A.obj.obj i) e) := by + cases e; rfl +lemma constantMap_natural : + (Functor.const SimplexCategoryᵒᵖ).map F.toCatHom ≫ constantMap V = + constantMap W ≫ verticalMapNat W V F hF := by + apply NatTrans.ext; funext p; apply Cat.ext + refine CategoryTheory.Functor.ext (fun A=>?_) ?_ + · apply ObjectProperty.FullSubcategory.ext + refine CategoryTheory.Functor.ext (fun i=>?_) ?_ + · rfl + · intro i j f + change (𝟙 (F.obj A)) = 𝟙 _ ≫ F.map (𝟙 A) ≫ 𝟙 _ + rw [F.map_id, Category.id_comp, Category.comp_id] + · intro A B f + apply ObjectProperty.hom_ext + apply NatTrans.ext; funext i + change F.map f = + (eqToHom _ : (constant V p.unop.len).obj (F.obj A) ⟶ + (verticalMap W V F hF p.unop.len).obj ((constant W p.unop.len).obj A)).hom.app i ≫ + F.map f ≫ + (eqToHom _ : (verticalMap W V F hF p.unop.len).obj ((constant W p.unop.len).obj B) ⟶ + (constant V p.unop.len).obj (F.obj B)).hom.app i + erw [eqToHom_vertical_app, eqToHom_vertical_app, Category.id_comp] + change F.map f = F.map f ≫ 𝟙 (F.obj B) + exact (Category.comp_id _).symm +lemma constantDiagonalIso_natural : + SimplicialDiagonal.nerveDiagonal.map ((Functor.const SimplexCategoryᵒᵖ).map F.toCatHom) ≫ + (constantDiagonalIso (C:=D)).hom = + (constantDiagonalIso (C:=C)).hom ≫ nerveMap F := by + ext p x; rfl +end + +variable {C D:Type} [Groupoid.{0} C] [Groupoid.{0} D] + (W:MorphismProperty C) (V:MorphismProperty D) [W.IsMultiplicative] [V.IsMultiplicative] + (F:C⥤D) (hF:∀{X Y:C} (f:X⟶Y),W f→V (F.map f)) + +lemma homologyIso_natural (j:ℕ) : + SSet.homologyMap (SimplicialDiagonal.nerveDiagonal.map (horizontalMap W V F hF)) + DiagonalResolution.Z j ≫ (homologyIso V j).hom = + (homologyIso W j).hom ≫ SSet.homologyMap (nerveMap F) DiagonalResolution.Z j := by + let H := SSet.homologyFunctor DiagonalResolution.Z j + let N := SimplicialDiagonal.nerveDiagonal + have : IsIso (H.map (N.map (constantMap W))) := + SimplicialDiagonal.nerveDiagonal_isIso (constantMap W) + (fun p=>inferInstanceAs (constant W p.unop.len).IsEquivalence) j + have : IsIso (H.map (N.map (constantMap V))) := + SimplicialDiagonal.nerveDiagonal_isIso (constantMap V) + (fun p=>inferInstanceAs (constant V p.unop.len).IsEquivalence) j + have h₁ := congrArg H.map (diagonalIso_natural W V F hF) + simp only [Functor.map_comp] at h₁ + have h₂ := congrArg (fun f=>H.map (N.map f)) (constantMap_natural W V F hF) + simp only [Functor.map_comp] at h₂ + have h₃ := congrArg H.map (constantDiagonalIso_natural F) + simp only [Functor.map_comp] at h₃ + have hc : H.map (N.map (verticalMapNat W V F hF)) ≫ + inv (H.map (N.map (constantMap V))) = + inv (H.map (N.map (constantMap W))) ≫ + H.map (N.map ((Functor.const SimplexCategoryᵒᵖ).map F.toCatHom)) := by + apply (IsIso.eq_inv_comp _).mpr + rw [←Category.assoc,←h₂,Category.assoc,IsIso.hom_inv_id,Category.comp_id] + change H.map (N.map (horizontalMap W V F hF)) ≫ + (H.map (diagonalIso V).hom ≫ inv (H.map (N.map (constantMap V))) ≫ + H.map (constantDiagonalIso (C:=D)).hom) = + (H.map (diagonalIso W).hom ≫ inv (H.map (N.map (constantMap W))) ≫ + H.map (constantDiagonalIso (C:=C)).hom) ≫ H.map (nerveMap F) + rw [←Category.assoc _ (H.map (diagonalIso V).hom),h₁] + simp only [Category.assoc] + rw [←Category.assoc (H.map (N.map (verticalMapNat W V F hF))),hc] + simp only [Category.assoc] + rw [h₃] +end + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory MonoidalCategory SimplicialObject Simplicial Opposite +open IntervalBar IntervalBar.Diagram + +variable {C:Type} [Groupoid.{0} C] (W:MorphismProperty C) + [Fact W.StableUnderInverse] [MonoidalCategory C] [SymmetricCategory C] + [W.IsStableUnderBraiding] +variable {I J K:Type} [Preorder I] [Preorder J] [Preorder K] + +noncomputable def posReindex (u:I→oJ) : PosDiagrams W J ⥤ PosDiagrams W I where + obj A := (Diagram.reindex (C:=WideSubcategory W) u).obj A + map f := InducedCategory.homMk { + app i j h := f.hom.app (u i) (u j) (u.monotone h) + unit i := f.hom.unit (u i) + cut i j k hij hjk := f.hom.cut (u i) (u j) (u k) (u.monotone hij) (u.monotone hjk) } +lemma posReindex_property (u:I→oJ) {A B:PosDiagrams W J} (f:A⟶B) + (hf:diagramProperty W J f) : diagramProperty W I ((posReindex W u).map f) := + fun i j h=>hf (u i) (u j) (u.monotone h) +lemma posReindex_inclusion (u:I→oJ) : + posReindex W u ⋙ posDiagramInclusion W I = + posDiagramInclusion W J ⋙ Diagram.reindex u := by + refine CategoryTheory.Functor.ext (fun A=>rfl) ?_ + intro A B f + erw [Category.id_comp, Category.comp_id] + rfl +lemma posReindex_id : posReindex W (OrderHom.id (α:=I))=𝟭 _ := by + refine CategoryTheory.Functor.ext (fun A=>?_) ?_ + · cases A; rfl + · intro A B f + erw [Category.id_comp, Category.comp_id] + apply InducedCategory.hom_ext; apply Hom.ext; intro i j h; rfl +lemma posReindex_comp (u:I→oJ) (v:J→oK) : + posReindex W (v.comp u)=posReindex W v ⋙ posReindex W u := by + refine CategoryTheory.Functor.ext (fun A=>rfl) ?_ + intro A B f + erw [Category.id_comp, Category.comp_id] + rfl +lemma transpose_posReindex (u:I→oJ) (n:ℕ) : + Diagram.reindex (C:=Strings W n) u ⋙ transposeDiagram (I:=I) W n = + transposeDiagram (I:=J) W n ⋙ stringsMap (diagramProperty W J) (diagramProperty W I) + (posReindex W u) (posReindex_property W u) n := by + refine CategoryTheory.Functor.ext (fun A=>?_) ?_ + · apply WideSubcategory.ext + refine CategoryTheory.Functor.ext (fun i=>rfl) ?_ + intro i j f + erw [Category.id_comp, Category.comp_id] + rfl + · intro A B f + erw [Category.id_comp, Category.comp_id] + rfl +end + +end RestrictedNerve + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/RestrictedMonoidal.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/RestrictedMonoidal.lean new file mode 100644 index 0000000000000000000000000000000000000000..f9d72240e380c256a8ff98e1d3ad39477b658e7f --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/RestrictedMonoidal.lean @@ -0,0 +1,355 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.RestrictedNerve +import OAI.GroupTheory.SimpleAmenable.Simplicial.IntervalFunctor + +namespace OAI + +open CategoryTheory MonoidalCategory +namespace RestrictedNerve + +section + +section + +variable {C : Type} [Groupoid.{0} C] (W : MorphismProperty C) [W.IsMultiplicative] + [Fact W.StableUnderInverse] +noncomputable instance restricted_isIso {U V : WideSubcategory W} (f : U ⟶ V) : IsIso f := by + refine ⟨⟨⟨inv f.hom,?_⟩,?_,?_⟩⟩ + · exact (Fact.out : W.StableUnderInverse) (asIso f.hom) f.property + · apply WideSubcategory.hom_ext; exact IsIso.hom_inv_id f.hom + · apply WideSubcategory.hom_ext; exact IsIso.inv_hom_id f.hom +noncomputable instance restricted_groupoid : Groupoid (WideSubcategory W) := + Groupoid.ofIsIso (fun _ => inferInstance) +instance strings_inverse (n : ℕ) : Fact (W.functorCategory (Fin (n+1))).StableUnderInverse where + out _ _ e h i := by + have hi := (Fact.out : W.StableUnderInverse) (e.app i) (h i) + exact hi +noncomputable instance strings_isIso {n : ℕ} {U V : Strings W n} (f : U ⟶ V) : IsIso f := by + let : IsIso f.hom := NatIso.isIso_of_isIso_app f.hom + refine ⟨⟨⟨inv f.hom,?_⟩,?_,?_⟩⟩ + · intro i + rw [NatIso.isIso_inv_app] + exact (Fact.out : W.StableUnderInverse) (asIso (f.hom.app i)) (f.property i) + · apply WideSubcategory.hom_ext; exact IsIso.hom_inv_id f.hom + · apply WideSubcategory.hom_ext; exact IsIso.inv_hom_id f.hom +noncomputable instance strings_groupoid (n : ℕ) : Groupoid (Strings W n) := + Groupoid.ofIsIso (fun _ => inferInstance) +omit [Fact W.StableUnderInverse] in +@[simp] lemma wide_hom_inv {source target : WideSubcategory W} (iso : source ≅ target) : + iso.hom.hom ≫ iso.inv.hom = 𝟙 _ := congrArg (fun arrow => arrow.hom) iso.hom_inv_id +omit [Fact W.StableUnderInverse] in +@[simp] lemma wide_inv_hom {source target : WideSubcategory W} (iso : source ≅ target) : + iso.inv.hom ≫ iso.hom.hom = 𝟙 _ := congrArg (fun arrow => arrow.hom) iso.inv_hom_id +end + +variable {C : Type} [Groupoid.{0} C] (W : MorphismProperty C) + [Fact W.StableUnderInverse] [MonoidalCategory C] [SymmetricCategory C] + [W.IsStableUnderBraiding] +instance strings_monoidal (n : ℕ) : (W.functorCategory (Fin (n+1))).IsMonoidalStable where + whiskerLeft object _ _ arrow member index := + W.whiskerLeft_mem (object.obj index) (arrow.app index) (member index) + whiskerRight arrow member object index := + W.whiskerRight_mem (arrow.app index) (member index) (object.obj index) + associator_hom_mem first second third index := + W.associator_hom_mem (first.obj index) (second.obj index) (third.obj index) + associator_inv_mem first second third index := + W.associator_inv_mem (first.obj index) (second.obj index) (third.obj index) + leftUnitor_hom_mem object index := W.leftUnitor_hom_mem (object.obj index) + leftUnitor_inv_mem object index := W.leftUnitor_inv_mem (object.obj index) + rightUnitor_hom_mem object index := W.rightUnitor_hom_mem (object.obj index) + rightUnitor_inv_mem object index := W.rightUnitor_inv_mem (object.obj index) +instance strings_braided (n : ℕ) : (W.functorCategory (Fin (n+1))).IsStableUnderBraiding where + braiding_hom_mem first second index := W.braiding_hom_mem (first.obj index) (second.obj index) + braiding_inv_mem first second index := W.braiding_inv_mem (first.obj index) (second.obj index) +noncomputable abbrev inclusion := wideSubcategoryInclusion W +noncomputable instance inclusionMonoidal : (inclusion W).Monoidal := + Functor.CoreMonoidal.toMonoidal { + εIso := Iso.refl _ + μIso _ _ := Iso.refl _ + μIso_hom_natural_left := by intros; simp + μIso_hom_natural_right := by intros; simp + associativity := by intros; simp + left_unitality := by intros; simp + right_unitality := by intros; simp } +noncomputable instance inclusionBraided : (inclusion W).Braided where + braided _ _ := by + change 𝟙 _ ≫ (β_ _ _).hom = (β_ _ _).hom ≫ 𝟙 _ + simp +noncomputable instance reindexMonoidal {n m : ℕ} (u : Fin (n+1) ⥤ Fin (m+1)) : + (reindex W u).Monoidal := Functor.CoreMonoidal.toMonoidal { + εIso := Iso.refl _ + μIso _ _ := Iso.refl _ + μIso_hom_natural_left := by + intro X Y f X' + apply WideSubcategory.hom_ext + ext i + change (f.hom.app (u.obj i) ▷ X'.obj.obj (u.obj i)) ≫ 𝟙 _ = + 𝟙 _ ≫ (f.hom.app (u.obj i) ▷ X'.obj.obj (u.obj i)) + simp + μIso_hom_natural_right := by + intro X Y X' f + apply WideSubcategory.hom_ext + ext i + change (X'.obj.obj (u.obj i) ◁ f.hom.app (u.obj i)) ≫ 𝟙 _ = + 𝟙 _ ≫ (X'.obj.obj (u.obj i) ◁ f.hom.app (u.obj i)) + simp + associativity := by + intro X Y Z + apply WideSubcategory.hom_ext + ext i + let x := X.obj.obj (u.obj i) + let y := Y.obj.obj (u.obj i) + let z := Z.obj.obj (u.obj i) + change (𝟙 (x ⊗ y) ▷ z) ≫ 𝟙 _ ≫ (α_ x y z).hom = + (α_ x y z).hom ≫ (x ◁ 𝟙 (y ⊗ z)) ≫ 𝟙 _ + simp + left_unitality := by + intro X + apply WideSubcategory.hom_ext + ext i + let x := X.obj.obj (u.obj i) + change (λ_ x).hom = (𝟙 (𝟙_ C) ▷ x) ≫ 𝟙 _ ≫ (λ_ x).hom + simp + right_unitality := by + intro X + apply WideSubcategory.hom_ext + ext i + let x := X.obj.obj (u.obj i) + change (ρ_ x).hom = (x ◁ 𝟙 (𝟙_ C)) ≫ 𝟙 _ ≫ (ρ_ x).hom + simp } + +noncomputable instance reindexBraided {n m : ℕ} (u : Fin (n+1) ⥤ Fin (m+1)) : + (reindex W u).Braided where + braided _ _ := by + apply WideSubcategory.hom_ext; ext i + change 𝟙 _ ≫ (β_ _ _).hom = (β_ _ _).hom ≫ 𝟙 _ + simp +end + +open IntervalBar IntervalBar.Diagram + +variable {C : Type} [Groupoid.{0} C] (W : MorphismProperty C) + [Fact W.StableUnderInverse] [MonoidalCategory C] [SymmetricCategory C] + [W.IsStableUnderBraiding] +variable (I : Type) [Preorder I] +noncomputable abbrev diagramInclusion := Diagram.map (I:=I) (inclusion W) +abbrev PosDiagrams := InducedCategory (Diagram C I) (diagramInclusion W I).obj +def diagramProperty : MorphismProperty (PosDiagrams W I) := + fun _ _ f => ∀ i j h, W (f.hom.app i j h) +instance diagramProperty_multiplicative : (diagramProperty W I).IsMultiplicative where + id_mem object first last ordered := W.id_mem ((diagramInclusion W I).obj object |>.obj first last ordered) + comp_mem first second hfirst hsecond start finish ordered := + W.comp_mem (first.hom.app start finish ordered) (second.hom.app start finish ordered) + (hfirst start finish ordered) (hsecond start finish ordered) + +variable {I} +noncomputable def stringVertex {n : ℕ} (A : Diagram (Strings W n) I) (t : Fin (n+1)) : + PosDiagrams W I where + obj i j h := ⟨(A.obj i j h).obj.obj t⟩ + unit i := { + hom := ⟨(A.unit i).hom.hom.app t,(A.unit i).hom.property t⟩ + inv := ⟨(A.unit i).inv.hom.app t,(A.unit i).inv.property t⟩ + hom_inv_id := by + apply WideSubcategory.hom_ext + exact congrArg (fun f => f.hom.app t) (A.unit i).hom_inv_id + inv_hom_id := by + apply WideSubcategory.hom_ext + exact congrArg (fun f => f.hom.app t) (A.unit i).inv_hom_id } + cut i j k hij hjk := { + hom := ⟨(A.cut i j k hij hjk).hom.hom.app t,(A.cut i j k hij hjk).hom.property t⟩ + inv := ⟨(A.cut i j k hij hjk).inv.hom.app t,(A.cut i j k hij hjk).inv.property t⟩ + hom_inv_id := by + apply WideSubcategory.hom_ext + exact congrArg (fun f => f.hom.app t) (A.cut i j k hij hjk).hom_inv_id + inv_hom_id := by + apply WideSubcategory.hom_ext + exact congrArg (fun f => f.hom.app t) (A.cut i j k hij hjk).inv_hom_id } + left_unit i j h := by + apply WideSubcategory.hom_ext + exact congrArg (fun f => f.hom.app t) (A.left_unit i j h) + right_unit i j h := by + apply WideSubcategory.hom_ext + exact congrArg (fun f => f.hom.app t) (A.right_unit i j h) + associativity i j k l hij hjk hkl := by + apply WideSubcategory.hom_ext + exact congrArg (fun f => f.hom.app t) (A.associativity i j k l hij hjk hkl) +noncomputable def stringVertexMap {n : ℕ} (A : Diagram (Strings W n) I) + {t s : Fin (n+1)} (f : t ⟶ s) : + stringVertex W A t ⟶ stringVertex W A s := + InducedCategory.homMk { + app i j h := (A.obj i j h).obj.map f + unit i := by + change (A.obj i i le_rfl).obj.map f ≫ ((A.unit i).hom.hom.app s ≫ 𝟙 _) = + (A.unit i).hom.hom.app t ≫ 𝟙 _ + simp + cut i j k hij hjk := by + change ((A.obj i j hij).obj.map f ⊗ₘ (A.obj j k hjk).obj.map f) ≫ + (𝟙 _ ≫ (A.cut i j k hij hjk).hom.hom.app s) = + (𝟙 _ ≫ (A.cut i j k hij hjk).hom.hom.app t) ≫ (A.obj i k _).obj.map f + erw [Category.id_comp, Category.id_comp] + exact (A.cut i j k hij hjk).hom.hom.naturality f } +noncomputable def transposeDiagramObj {n : ℕ} (A : Diagram (Strings W n) I) : + Strings (diagramProperty W I) n := ⟨{ + obj := stringVertex W A + map := stringVertexMap W A + map_id t := by + apply InducedCategory.hom_ext; apply Hom.ext; intro i j h + exact (A.obj i j h).obj.map_id t + map_comp f g := by + apply InducedCategory.hom_ext; apply Hom.ext; intro i j h + exact (A.obj i j h).obj.map_comp f g }⟩ +noncomputable def transposeDiagramHom {n : ℕ} {A B : Diagram (Strings W n) I} (f : A ⟶ B) : + transposeDiagramObj W A ⟶ transposeDiagramObj W B := ⟨{ + app t := InducedCategory.homMk { + app i j h := (f.app i j h).hom.app t + unit i := by + change (f.app i i le_rfl).hom.app t ≫ ((B.unit i).hom.hom.app t ≫ 𝟙 _) = + (A.unit i).hom.hom.app t ≫ 𝟙 _ + simpa using congrArg (fun f => f.hom.app t) (f.unit i) + cut i j k hij hjk := by + change ((f.app i j hij).hom.app t ⊗ₘ (f.app j k hjk).hom.app t) ≫ + (𝟙 _ ≫ (B.cut i j k hij hjk).hom.hom.app t) = + (𝟙 _ ≫ (A.cut i j k hij hjk).hom.hom.app t) ≫ (f.app i k _).hom.app t + erw [Category.id_comp, Category.id_comp] + exact congrArg (fun f => f.hom.app t) (f.cut i j k hij hjk) } + naturality s t g := by + apply InducedCategory.hom_ext; apply Hom.ext; intro i j h + exact (f.app i j h).hom.naturality g }, + fun t i j h => (f.app i j h).property t⟩ +noncomputable def transposeDiagram (n : ℕ) : Diagram (Strings W n) I ⥤ Strings (diagramProperty W I) n where + obj := transposeDiagramObj W + map := transposeDiagramHom W + map_id A := by + apply WideSubcategory.hom_ext; apply NatTrans.ext; funext t + apply InducedCategory.hom_ext; apply Hom.ext; intros; rfl + map_comp f g := by + apply WideSubcategory.hom_ext; apply NatTrans.ext; funext t + apply InducedCategory.hom_ext; apply Hom.ext; intros; rfl +noncomputable def untransposeDiagramObj {n : ℕ} (F : Strings (diagramProperty W I) n) : + Diagram (Strings W n) I where + obj i j h := ⟨{ + obj t := ((F.obj.obj t).obj i j h).obj + map f := (F.obj.map f).hom.app i j h + map_id t := congrArg (fun f => f.hom.app i j h) (F.obj.map_id t) + map_comp f g := congrArg (fun f => f.hom.app i j h) (F.obj.map_comp f g) }⟩ + unit i := { + hom := ⟨{ + app t := ((F.obj.obj t).unit i).hom.hom + naturality t s f := by + have he := (F.obj.map f).hom.unit i + change (F.obj.map f).hom.app i i le_rfl ≫ (((F.obj.obj s).unit i).hom.hom ≫ 𝟙 _) = + ((F.obj.obj t).unit i).hom.hom ≫ 𝟙 _ at he + erw [Category.comp_id, Category.comp_id] at he + change (F.obj.map f).hom.app i i le_rfl ≫ ((F.obj.obj s).unit i).hom.hom = + ((F.obj.obj t).unit i).hom.hom ≫ 𝟙 _ + erw [Category.comp_id] + exact he }, fun t => ((F.obj.obj t).unit i).hom.property⟩ + inv := ⟨{ + app t := ((F.obj.obj t).unit i).inv.hom + naturality t s f := by + have he := (F.obj.map f).hom.unit i + change (F.obj.map f).hom.app i i le_rfl ≫ (((F.obj.obj s).unit i).hom.hom ≫ 𝟙 _) = + ((F.obj.obj t).unit i).hom.hom ≫ 𝟙 _ at he + erw [Category.comp_id, Category.comp_id] at he + change 𝟙 _ ≫ ((F.obj.obj s).unit i).inv.hom = + ((F.obj.obj t).unit i).inv.hom ≫ (F.obj.map f).hom.app i i le_rfl + apply (cancel_mono ((F.obj.obj s).unit i).hom.hom).mp + erw [Category.id_comp, wide_inv_hom, Category.assoc, he, wide_inv_hom] }, + fun t => ((F.obj.obj t).unit i).inv.property⟩ + hom_inv_id := by + apply WideSubcategory.hom_ext; ext t + exact congrArg (fun g => g.hom) ((F.obj.obj t).unit i).hom_inv_id + inv_hom_id := by + apply WideSubcategory.hom_ext; ext t + exact congrArg (fun g => g.hom) ((F.obj.obj t).unit i).inv_hom_id } + cut i j k hij hjk := { + hom := ⟨{ + app t := ((F.obj.obj t).cut i j k hij hjk).hom.hom + naturality t s f := by + have he := (F.obj.map f).hom.cut i j k hij hjk + change ((F.obj.map f).hom.app i j hij ⊗ₘ (F.obj.map f).hom.app j k hjk) ≫ + (𝟙 _ ≫ ((F.obj.obj s).cut i j k hij hjk).hom.hom) = + (𝟙 _ ≫ ((F.obj.obj t).cut i j k hij hjk).hom.hom) ≫ (F.obj.map f).hom.app i k _ at he + erw [Category.id_comp, Category.id_comp] at he + exact he },fun t => ((F.obj.obj t).cut i j k hij hjk).hom.property⟩ + inv := ⟨{ + app t := ((F.obj.obj t).cut i j k hij hjk).inv.hom + naturality t s f := by + have he := (F.obj.map f).hom.cut i j k hij hjk + change ((F.obj.map f).hom.app i j hij ⊗ₘ (F.obj.map f).hom.app j k hjk) ≫ + (𝟙 _ ≫ ((F.obj.obj s).cut i j k hij hjk).hom.hom) = + (𝟙 _ ≫ ((F.obj.obj t).cut i j k hij hjk).hom.hom) ≫ (F.obj.map f).hom.app i k _ at he + erw [Category.id_comp, Category.id_comp] at he + change (F.obj.map f).hom.app i k _ ≫ ((F.obj.obj s).cut i j k hij hjk).inv.hom = + ((F.obj.obj t).cut i j k hij hjk).inv.hom ≫ + ((F.obj.map f).hom.app i j hij ⊗ₘ (F.obj.map f).hom.app j k hjk) + apply (cancel_epi ((F.obj.obj t).cut i j k hij hjk).hom.hom).mp + repeat' erw [← Category.assoc] + erw [wide_hom_inv, Category.id_comp] + erw [←he,Category.assoc,wide_hom_inv] + exact Category.comp_id _ }, + fun t => ((F.obj.obj t).cut i j k hij hjk).inv.property⟩ + hom_inv_id := by + apply WideSubcategory.hom_ext; ext t + exact congrArg (fun g => g.hom) ((F.obj.obj t).cut i j k hij hjk).hom_inv_id + inv_hom_id := by + apply WideSubcategory.hom_ext; ext t + exact congrArg (fun g => g.hom) ((F.obj.obj t).cut i j k hij hjk).inv_hom_id } + left_unit i j h := by + apply WideSubcategory.hom_ext; ext t + exact congrArg (fun g => g.hom) ((F.obj.obj t).left_unit i j h) + right_unit i j h := by + apply WideSubcategory.hom_ext; ext t + exact congrArg (fun g => g.hom) ((F.obj.obj t).right_unit i j h) + associativity i j k l hij hjk hkl := by + apply WideSubcategory.hom_ext; ext t + exact congrArg (fun g => g.hom) ((F.obj.obj t).associativity i j k l hij hjk hkl) +noncomputable def untransposeDiagramHom {n : ℕ} {A B : Strings (diagramProperty W I) n} (f : A ⟶ B) : + untransposeDiagramObj W A ⟶ untransposeDiagramObj W B where + app i j h := ⟨{ + app t := (f.hom.app t).hom.app i j h + naturality t s g := congrArg (fun f => f.hom.app i j h) (f.hom.naturality g) }, + fun t => f.property t i j h⟩ + unit i := by + apply WideSubcategory.hom_ext; ext t + have he := (f.hom.app t).hom.unit i + change (f.hom.app t).hom.app i i le_rfl ≫ (((B.obj.obj t).unit i).hom.hom ≫ 𝟙 _) = + ((A.obj.obj t).unit i).hom.hom ≫ 𝟙 _ at he + change (f.hom.app t).hom.app i i le_rfl ≫ ((B.obj.obj t).unit i).hom.hom = + ((A.obj.obj t).unit i).hom.hom + erw [Category.comp_id, Category.comp_id] at he + exact he + cut i j k hij hjk := by + apply WideSubcategory.hom_ext; ext t + have he := (f.hom.app t).hom.cut i j k hij hjk + change ((f.hom.app t).hom.app i j hij ⊗ₘ (f.hom.app t).hom.app j k hjk) ≫ + (𝟙 _ ≫ ((B.obj.obj t).cut i j k hij hjk).hom.hom) = + (𝟙 _ ≫ ((A.obj.obj t).cut i j k hij hjk).hom.hom) ≫ (f.hom.app t).hom.app i k _ at he + change ((f.hom.app t).hom.app i j hij ⊗ₘ (f.hom.app t).hom.app j k hjk) ≫ + ((B.obj.obj t).cut i j k hij hjk).hom.hom = + ((A.obj.obj t).cut i j k hij hjk).hom.hom ≫ (f.hom.app t).hom.app i k _ + erw [Category.id_comp, Category.id_comp] at he + exact he +noncomputable def untransposeDiagram (n : ℕ) : Strings (diagramProperty W I) n ⥤ Diagram (Strings W n) I where + obj := untransposeDiagramObj W + map := untransposeDiagramHom W + map_id A := by + apply Hom.ext; intro i j h + apply WideSubcategory.hom_ext; ext t; rfl + map_comp f g := by + apply Hom.ext; intro i j h + apply WideSubcategory.hom_ext; ext t; rfl +noncomputable def diagramEquivalence (n : ℕ) : Diagram (Strings W n) I ≌ Strings (diagramProperty W I) n where + functor := transposeDiagram W n + inverse := untransposeDiagram W n + unitIso := Iso.refl _ + counitIso := Iso.refl _ + functor_unitIso_comp A := by + change (transposeDiagram W n).map (𝟙 A) ≫ 𝟙 _ = 𝟙 _ + erw [Category.comp_id] + exact (transposeDiagram W n).map_id A +noncomputable instance (n : ℕ) : (transposeDiagram (I:=I) W n).IsEquivalence := + (diagramEquivalence W n).isEquivalence_functor +end RestrictedNerve + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/RestrictedMonoidalTranspose.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/RestrictedMonoidalTranspose.lean new file mode 100644 index 0000000000000000000000000000000000000000..3df876e4dfee437bee8cfa9e87d4bc2d53f47efc --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/RestrictedMonoidalTranspose.lean @@ -0,0 +1,314 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.TripleBarMaps +import OAI.GroupTheory.SimpleAmenable.Simplicial.InducedMonoidal + +namespace OAI + +namespace RestrictedNerve + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory MonoidalCategory Functor.LaxMonoidal Functor.OplaxMonoidal +open IntervalBar IntervalBar.Diagram + +variable {C : Type} [Groupoid.{0} C] (W : MorphismProperty C) + [Fact W.StableUnderInverse] [MonoidalCategory C] [SymmetricCategory C] + [W.IsStableUnderBraiding] +variable {I : Type} [Preorder I] (n : ℕ) +noncomputable def transposeε : (𝟙_ (Strings (diagramProperty W I) n)) ⟶ + (transposeDiagram W n).obj (𝟙_ (Diagram (Strings W n) I)) := ⟨{ + app t := InducedCategory.homMk { + app i j h := 𝟙 _ + unit i := by + simp [transposeDiagram,transposeDiagramObj,stringVertex,diagramInclusion,mapObj] + erw [Category.id_comp] + rfl + cut i j k hij hjk := by + simp [transposeDiagram,transposeDiagramObj,stringVertex,diagramInclusion,mapObj] + erw [id_tensorHom_id, Category.id_comp, Category.comp_id] + rfl } + naturality t s f := by + apply InducedCategory.hom_ext; apply Hom.ext; intro i j h + simp [transposeDiagram,transposeDiagramObj,stringVertexMap,diagramInclusion] + change (𝟙 (𝟙_ C)) = 𝟙 _ ≫ 𝟙 _ + exact (Category.id_comp _).symm }, + by intro t i j h; exact W.id_mem _⟩ +noncomputable def transposeμ (A B : Diagram (Strings W n) I) : + (transposeDiagram W n).obj A ⊗ (transposeDiagram W n).obj B ⟶ + (transposeDiagram W n).obj (A ⊗ B) := ⟨{ + app t := InducedCategory.homMk { + app i j h := 𝟙 _ + unit i := by + simp [transposeDiagram,transposeDiagramObj,stringVertex,diagramInclusion,mapObj] + erw [Category.id_comp] + rfl + cut i j k hij hjk := by + simp [transposeDiagram,transposeDiagramObj,stringVertex,diagramInclusion,mapObj] + erw [id_tensorHom_id, Category.id_comp, Category.comp_id] + rfl } + naturality t s f := by + apply InducedCategory.hom_ext; apply Hom.ext; intro i j h + change (stringVertexMap W A f ⊗ₘ stringVertexMap W B f).hom.app i j h ≫ 𝟙 _ = + 𝟙 _ ≫ ((A.obj i j h).obj.map f ⊗ₘ (B.obj i j h).obj.map f) + erw [posTensor_app] + change ((A.obj i j h).obj.map f ⊗ₘ (B.obj i j h).obj.map f) ≫ 𝟙 _ = + 𝟙 _ ≫ ((A.obj i j h).obj.map f ⊗ₘ (B.obj i j h).obj.map f) + simp only [Category.comp_id, Category.id_comp] }, + by intro t i j h; exact W.id_mem _⟩ +private lemma transposeμ_natural_left {A B : Diagram (Strings W n) I} + (f : A ⟶ B) (D : Diagram (Strings W n) I) : + ((transposeDiagram W n).map f ▷ (transposeDiagram W n).obj D) ≫ transposeμ W n B D = + transposeμ W n A D ≫ (transposeDiagram W n).map (f ▷ D) := by + apply WideSubcategory.hom_ext; apply NatTrans.ext; funext t + apply InducedCategory.hom_ext; apply Hom.ext; intro i j h + change ((transposeDiagramHom W f).hom.app t ▷ (transposeDiagramObj W D).obj.obj t).hom.app i j h ≫ 𝟙 _ = + 𝟙 _ ≫ ((transposeDiagramHom W (f ▷ D)).hom.app t).hom.app i j h + erw [posWhiskerRight_app] + change ((f.app i j h).hom.app t ▷ (D.obj i j h).obj.obj t) ≫ 𝟙 _ = + 𝟙 _ ≫ ((f ▷ D).app i j h).hom.app t + erw [Diagram.whiskerRight_app] + change ((f.app i j h).hom.app t ▷ (D.obj i j h).obj.obj t) ≫ 𝟙 _ = + 𝟙 _ ≫ ((f.app i j h).hom.app t ▷ (D.obj i j h).obj.obj t) + simp only [Category.comp_id, Category.id_comp] + +private lemma transposeμ_natural_right {A B : Diagram (Strings W n) I} + (D : Diagram (Strings W n) I) (f : A ⟶ B) : + ((transposeDiagram W n).obj D ◁ (transposeDiagram W n).map f) ≫ transposeμ W n D B = + transposeμ W n D A ≫ (transposeDiagram W n).map (D ◁ f) := by + apply WideSubcategory.hom_ext; apply NatTrans.ext; funext t + apply InducedCategory.hom_ext; apply Hom.ext; intro i j h + change ((transposeDiagramObj W D).obj.obj t ◁ (transposeDiagramHom W f).hom.app t).hom.app i j h ≫ 𝟙 _ = + 𝟙 _ ≫ ((transposeDiagramHom W (D ◁ f)).hom.app t).hom.app i j h + erw [posWhiskerLeft_app] + change ((D.obj i j h).obj.obj t ◁ (f.app i j h).hom.app t) ≫ 𝟙 _ = + 𝟙 _ ≫ ((D ◁ f).app i j h).hom.app t + erw [Diagram.whiskerLeft_app] + change ((D.obj i j h).obj.obj t ◁ (f.app i j h).hom.app t) ≫ 𝟙 _ = + 𝟙 _ ≫ ((D.obj i j h).obj.obj t ◁ (f.app i j h).hom.app t) + simp only [Category.comp_id, Category.id_comp] + +noncomputable instance transposeMonoidal : (transposeDiagram (I:=I) W n).Monoidal := + Functor.CoreMonoidal.toMonoidal { + εIso := asIso (transposeε W n) + μIso A B := asIso (transposeμ W n A B) + μIso_hom_natural_left := by + intro A B f D + exact transposeμ_natural_left W n f D + μIso_hom_natural_right := by + intro A B D f + exact transposeμ_natural_right W n D f + associativity := by + intro A B D + apply WideSubcategory.hom_ext; apply NatTrans.ext; funext t + apply InducedCategory.hom_ext; apply Hom.ext; intro i j h + change (((transposeμ W n A B).hom.app t ▷ (transposeDiagramObj W D).obj.obj t).hom.app i j h) ≫ + ((transposeμ W n (A ⊗ B) D).hom.app t).hom.app i j h ≫ + ((transposeDiagramHom W (α_ A B D).hom).hom.app t).hom.app i j h = + (α_ (stringVertex W A t) (stringVertex W B t) (stringVertex W D t)).hom.hom.app i j h ≫ + ((stringVertex W A t ◁ (transposeμ W n B D).hom.app t).hom.app i j h) ≫ + ((transposeμ W n A (B ⊗ D)).hom.app t).hom.app i j h + erw [posWhiskerRight_app, posWhiskerLeft_app, posAssoc_app] + change (𝟙 _ ▷ (D.obj i j h).obj.obj t) ≫ 𝟙 _ ≫ + (α_ ((A.obj i j h).obj.obj t) ((B.obj i j h).obj.obj t) ((D.obj i j h).obj.obj t)).hom = + (α_ ((A.obj i j h).obj.obj t) ((B.obj i j h).obj.obj t) ((D.obj i j h).obj.obj t)).hom ≫ + ((A.obj i j h).obj.obj t ◁ 𝟙 _) ≫ 𝟙 _ + simp only [id_whiskerRight, whiskerLeft_id, Category.id_comp, Category.comp_id] + left_unitality := by + intro A + apply WideSubcategory.hom_ext; apply NatTrans.ext; funext t + apply InducedCategory.hom_ext; apply Hom.ext; intro i j h + change (λ_ ((A.obj i j h).obj.obj t)).hom = + (((transposeε W n).hom.app t ▷ stringVertex W A t).hom.app i j h) ≫ + 𝟙 _ ≫ (λ_ ((A.obj i j h).obj.obj t)).hom + erw [posWhiskerRight_app] + change (λ_ ((A.obj i j h).obj.obj t)).hom = + (𝟙 _ ▷ (A.obj i j h).obj.obj t) ≫ 𝟙 _ ≫ (λ_ ((A.obj i j h).obj.obj t)).hom + simp only [id_whiskerRight, Category.id_comp] + right_unitality := by + intro A + apply WideSubcategory.hom_ext; apply NatTrans.ext; funext t + apply InducedCategory.hom_ext; apply Hom.ext; intro i j h + change (ρ_ ((A.obj i j h).obj.obj t)).hom = + ((stringVertex W A t ◁ (transposeε W n).hom.app t).hom.app i j h) ≫ + 𝟙 _ ≫ (ρ_ ((A.obj i j h).obj.obj t)).hom + erw [posWhiskerLeft_app] + change (ρ_ ((A.obj i j h).obj.obj t)).hom = + ((A.obj i j h).obj.obj t ◁ 𝟙 _) ≫ 𝟙 _ ≫ (ρ_ ((A.obj i j h).obj.obj t)).hom + simp only [whiskerLeft_id, Category.id_comp] } +noncomputable instance transposeBraided : (transposeDiagram (I:=I) W n).Braided where + braided A B := by + change transposeμ W n A B ≫ (transposeDiagram W n).map (β_ A B).hom = + (β_ ((transposeDiagram W n).obj A) ((transposeDiagram W n).obj B)).hom ≫ transposeμ W n B A + apply WideSubcategory.hom_ext; apply NatTrans.ext; funext t + apply InducedCategory.hom_ext; apply Hom.ext; intro i j h + simp [transposeμ,transposeDiagram,transposeDiagramHom] + erw [InducedCategory.comp_hom, comp_app, comp_app, posBraiding_app] + erw [Category.id_comp, Category.comp_id] + rfl +end + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory MonoidalCategory Functor.LaxMonoidal +open IntervalBar IntervalBar.Diagram + +variable {C : Type} [Groupoid.{0} C] (W : MorphismProperty C) + [Fact W.StableUnderInverse] [MonoidalCategory C] [SymmetricCategory C] + [W.IsStableUnderBraiding] +instance inclusionEssSurj : (inclusion W).EssSurj where + mem_essImage X := ⟨⟨X⟩,⟨Iso.refl X⟩⟩ +noncomputable abbrev posDiagramInclusion (I : Type) [Preorder I] := + InducedMonoidal.inclusion (diagramInclusion W I) +noncomputable instance posDiagramInclusionMonoidal (I : Type) [Preorder I] : + (posDiagramInclusion W I).Monoidal := InducedMonoidal.inclusionMonoidal (diagramInclusion W I) +noncomputable instance posDiagramInclusionBraided (I : Type) [Preorder I] : + (posDiagramInclusion W I).Braided := InducedMonoidal.inclusionBraided (diagramInclusion W I) +noncomputable instance posDiagramInclusionEssSurj (n : ℕ) : + (posDiagramInclusion W (Fin (n+1))).EssSurj where + mem_essImage X := ⟨(diagramInclusion W (Fin (n+1))).objPreimage X, + ⟨(diagramInclusion W (Fin (n+1))).objObjPreimageIso X⟩⟩ +noncomputable instance posDiagramInclusionEquivalence (n : ℕ) : + (posDiagramInclusion W (Fin (n+1))).IsEquivalence where + full := inferInstanceAs (inducedFunctor _).Full + faithful := inferInstanceAs (inducedFunctor _).Faithful +noncomputable def posDiagramTripleHomologyIso (n j : ℕ) : + (bar₃ (C:=PosDiagrams W (Fin (n+1)))).homology DiagonalResolution.Z j ≅ + (bar₃ (C:=Diagram C (Fin (n+1)))).homology DiagonalResolution.Z j := by + have homologyIso := bar₃Map_homology_isIso (posDiagramInclusion W (Fin (n+1))) j + exact asIso (SSet.homologyMap (bar₃Map (posDiagramInclusion W (Fin (n+1)))) DiagonalResolution.Z j) +end + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory MonoidalCategory SimplicialObject Simplicial Opposite +open IntervalBar IntervalBar.Diagram + +variable {C : Type} [Groupoid.{0} C] (W : MorphismProperty C) + [Fact W.StableUnderInverse] [MonoidalCategory C] [SymmetricCategory C] + [W.IsStableUnderBraiding] +variable {I : Type} [Preorder I] +omit [Fact W.StableUnderInverse] in +@[simp] lemma reindex_η {n m : ℕ} (u : Fin (n+1) ⥤ Fin (m+1)) : + Functor.OplaxMonoidal.η (reindex W u)=𝟙 _ := rfl +omit [Fact W.StableUnderInverse] in +@[simp] lemma reindex_μ {n m : ℕ} (u : Fin (n+1) ⥤ Fin (m+1)) (A B : Strings W m) : + Functor.LaxMonoidal.μ (reindex W u) A B=𝟙 _ := rfl +lemma map_strings_reindex_id (n : ℕ) : + Diagram.map (I:=I) (reindex W (𝟭 (Fin (n+1))))=𝟭 _ := by + refine CategoryTheory.Functor.ext (fun A => ?_) ?_ + · refine ext_heq rfl ?_ ?_ + · apply heq_of_eq; funext i + apply Iso.ext; apply WideSubcategory.hom_ext; apply NatTrans.ext; funext t + simp [mapObj] + erw [Category.comp_id] + rfl + · apply heq_of_eq; funext i j k hij hjk + apply Iso.ext; apply WideSubcategory.hom_ext; apply NatTrans.ext; funext t + simp [mapObj] + erw [Category.id_comp] + rfl + · intro A B f + apply Hom.ext; intro i j h + erw [comp_app, comp_app, Diagram.eqToHom_app, Diagram.eqToHom_app] + simp only [Diagram.map] + erw [Category.id_comp, Category.comp_id] + apply WideSubcategory.hom_ext; rfl +lemma map_strings_reindex_comp {n m k : ℕ} (u : Fin (n+1) ⥤ Fin (m+1)) + (v : Fin (m+1) ⥤ Fin (k+1)) : + Diagram.map (I:=I) (reindex W (u ⋙ v)) = + Diagram.map (reindex W v) ⋙ Diagram.map (reindex W u) := by + refine CategoryTheory.Functor.ext (fun A => ?_) ?_ + · refine ext_heq rfl ?_ ?_ + · apply heq_of_eq; funext i + apply Iso.ext; apply WideSubcategory.hom_ext; apply NatTrans.ext; funext t + simp [mapObj] + change (A.unit i).hom.hom.app (v.obj (u.obj t)) ≫ 𝟙 _ = + (A.unit i).hom.hom.app (v.obj (u.obj t)) ≫ (𝟙 _ ≫ 𝟙 _) + simp only [Category.comp_id] + · apply heq_of_eq; funext i j k hij hjk + apply Iso.ext; apply WideSubcategory.hom_ext; apply NatTrans.ext; funext t + simp [mapObj] + change 𝟙 _ ≫ (A.cut i j k hij hjk).hom.hom.app (v.obj (u.obj t)) = + 𝟙 _ ≫ 𝟙 _ ≫ (A.cut i j k hij hjk).hom.hom.app (v.obj (u.obj t)) + simp only [Category.id_comp] + · intro A B f + apply Hom.ext; intro i j h + erw [comp_app, comp_app, Diagram.eqToHom_app, Diagram.eqToHom_app] + simp only [Diagram.map] + erw [Category.id_comp, Category.comp_id] + apply WideSubcategory.hom_ext; rfl +noncomputable def diagramHorizontal : SimplicialObject Cat.{0,0} where + obj p := Cat.of (Diagram (Strings W p.unop.len) I) + map f := (Diagram.map (reindex W f.unop.toOrderHom.toFunctor)).toCatHom + map_id p := by apply Cat.ext; exact map_strings_reindex_id W _ + map_comp f g := by apply Cat.ext; exact map_strings_reindex_comp (I:=I) W g.unop.toOrderHom.toFunctor f.unop.toOrderHom.toFunctor +@[simp] lemma eqToHom_transposed_app {n : ℕ} {A B : Strings (diagramProperty W I) n} + (e : A=B) (t : Fin (n+1)) (i j : I) (h : i≤j) : + ((eqToHom e).hom.app t).hom.app i j h = + eqToHom (congrArg (fun A : Strings (diagramProperty W I) n => ((diagramInclusion W I).obj (A.obj.obj t)).obj i j h) e) := by + cases e; rfl +private lemma transposed_comp_app {n : ℕ} + {A B D : Strings (diagramProperty W I) n} (f : A ⟶ B) (g : B ⟶ D) + (t : Fin (n+1)) (i j : I) (h : i ≤ j) : + ((f ≫ g).hom.app t).hom.app i j h = + (f.hom.app t).hom.app i j h ≫ (g.hom.app t).hom.app i j h := rfl + +private lemma eqToHom_vertex_app {A B : PosDiagrams W I} (e : A = B) + (i j : I) (h : i ≤ j) : + (eqToHom e).hom.app i j h = + eqToHom (congrArg (fun A : PosDiagrams W I => + ((diagramInclusion W I).obj A).obj i j h) e) := by + cases e + rfl + +private lemma stringVertex_reindex {n m : ℕ} (u : Fin (n+1) ⥤ Fin (m+1)) + (A : Diagram (Strings W m) I) (t : Fin (n+1)) : + stringVertex W ((Diagram.map (reindex W u)).obj A) t = stringVertex W A (u.obj t) := by + refine ext_heq rfl ?_ ?_ + · apply heq_of_eq; funext i + apply Iso.ext; apply WideSubcategory.hom_ext + change (A.unit i).hom.hom.app (u.obj t) ≫ 𝟙 _ = _ + exact Category.comp_id _ + · apply heq_of_eq; funext i j k hij hjk + apply Iso.ext; apply WideSubcategory.hom_ext + change 𝟙 _ ≫ (A.cut i j k hij hjk).hom.hom.app (u.obj t) = _ + exact Category.id_comp _ + +private lemma transpose_reindex {n m : ℕ} (u : Fin (n+1) ⥤ Fin (m+1)) : + Diagram.map (I:=I) (reindex W u) ⋙ transposeDiagram W n = + transposeDiagram W m ⋙ reindex (diagramProperty W I) u := by + refine CategoryTheory.Functor.ext (fun A => ?_) ?_ + · apply WideSubcategory.ext + refine CategoryTheory.Functor.ext (fun t => stringVertex_reindex W u A t) ?_ + intro t s g + apply InducedCategory.hom_ext; apply Hom.ext; intro i j h + erw [comp_app, comp_app, eqToHom_vertex_app, eqToHom_vertex_app] + change (A.obj i j h).obj.map (u.map g) = + 𝟙 _ ≫ (A.obj i j h).obj.map (u.map g) ≫ 𝟙 _ + simp only [Category.id_comp, Category.comp_id] + · intro A B g + apply WideSubcategory.hom_ext; apply NatTrans.ext; funext t + apply InducedCategory.hom_ext; apply Hom.ext; intro i j h + erw [transposed_comp_app, transposed_comp_app, + eqToHom_transposed_app, eqToHom_transposed_app] + change (g.app i j h).hom.app (u.obj t) = + 𝟙 _ ≫ (g.app i j h).hom.app (u.obj t) ≫ 𝟙 _ + simp only [Category.id_comp, Category.comp_id] + +noncomputable def diagramTranspose : diagramHorizontal (I:=I) W ⟶ horizontal (diagramProperty W I) where + app p := (transposeDiagram W p.unop.len).toCatHom + naturality p q f := by + apply Cat.ext + exact transpose_reindex W f.unop.toOrderHom.toFunctor + +noncomputable def diagramResolutionHomologyIso (p j : ℕ) : + (SimplicialDiagonal.nerveDiagonal.obj (diagramHorizontal (I:=Fin (p+1)) W)).homology DiagonalResolution.Z j ≅ + (nerve (Diagram C (Fin (p+1)))).homology DiagonalResolution.Z j := by + have transposeHomologyIso := SimplicialDiagonal.nerveDiagonal_isIso (diagramTranspose (I:=Fin (p+1)) W) + (fun q => inferInstanceAs (transposeDiagram (I:=Fin (p+1)) W q.unop.len).IsEquivalence) j + have inclusionHomologyIso := NerveHomotopy.homologyMap_isIso (posDiagramInclusion W (Fin (p+1))) DiagonalResolution.Z j + exact asIso (SSet.homologyMap (SimplicialDiagonal.nerveDiagonal.map (diagramTranspose (I:=Fin (p+1)) W)) DiagonalResolution.Z j) ≪≫ + homologyIso (diagramProperty W (Fin (p+1))) j ≪≫ + asIso (SSet.homologyMap (nerveMap (posDiagramInclusion W (Fin (p+1)))) DiagonalResolution.Z j) +end + +end RestrictedNerve + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/RestrictedNerve.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/RestrictedNerve.lean new file mode 100644 index 0000000000000000000000000000000000000000..ea8865ed80832a1dfaa0add8120dac61019fc8a0 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/RestrictedNerve.lean @@ -0,0 +1,192 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.DiagonalComparison + +namespace OAI + +open CategoryTheory SimplicialObject Simplicial Opposite +namespace RestrictedNerve + +variable {C : Type} [Groupoid.{0} C] (W : MorphismProperty C) [W.IsMultiplicative] +instance (n : ℕ) : (W.functorCategory (Fin (n+1))).IsMultiplicative where + id_mem object index := W.id_mem (object.obj index) + comp_mem first second hfirst hsecond index := + W.comp_mem (first.app index) (second.app index) (hfirst index) (hsecond index) +abbrev Strings (n : ℕ) := WideSubcategory (W.functorCategory (Fin (n+1))) +def allowed (n : ℕ) : ObjectProperty (Fin (n+1) ⥤ C) := + fun F => ∀ i j (f : i ⟶ j), W (F.map f) +abbrev Vertical (n : ℕ) := (allowed W n).FullSubcategory + +def reindex {n m : ℕ} (u : Fin (n+1) ⥤ Fin (m+1)) : Strings W m ⥤ Strings W n where + obj F := ⟨u ⋙ F.obj⟩ + map f := ⟨Functor.whiskerLeft u f.hom,fun i => f.property (u.obj i)⟩ + map_id _ := by apply WideSubcategory.hom_ext; rfl + map_comp _ _ := by apply WideSubcategory.hom_ext; rfl +lemma reindex_id (n : ℕ) : reindex W (𝟭 (Fin (n+1)))=𝟭 _ := by + refine CategoryTheory.Functor.ext (fun object => by cases object; rfl) ?_ + intro source target arrow + erw [eqToHom_refl, Category.id_comp, Category.comp_id] + rfl +lemma reindex_comp {n m k : ℕ} (u : Fin (n+1) ⥤ Fin (m+1)) (v : Fin (m+1) ⥤ Fin (k+1)) : + reindex W (u⋙v)=reindex W v ⋙ reindex W u := by + refine CategoryTheory.Functor.ext (fun _ => rfl) ?_ + intro source target arrow + erw [eqToHom_refl, Category.id_comp, Category.comp_id] + rfl + +def vreindex {n m : ℕ} (u : Fin (n+1) ⥤ Fin (m+1)) : Vertical W m ⥤ Vertical W n where + obj F := ⟨u ⋙ F.obj,fun i j f => F.property (u.obj i) (u.obj j) (u.map f)⟩ + map f := ObjectProperty.homMk (Functor.whiskerLeft u f.hom) + map_id _ := by apply ObjectProperty.hom_ext; rfl + map_comp _ _ := by apply ObjectProperty.hom_ext; rfl +omit [W.IsMultiplicative] in +lemma vreindex_id (n : ℕ) : vreindex W (𝟭 (Fin (n+1)))=𝟭 _ := by + refine CategoryTheory.Functor.ext (fun object => by cases object; rfl) ?_ + intro source target arrow + erw [eqToHom_refl, Category.id_comp, Category.comp_id] + rfl +omit [W.IsMultiplicative] in +lemma vreindex_comp {n m k : ℕ} (u : Fin (n+1) ⥤ Fin (m+1)) (v : Fin (m+1) ⥤ Fin (k+1)) : + vreindex W (u⋙v)=vreindex W v ⋙ vreindex W u := by + refine CategoryTheory.Functor.ext (fun _ => rfl) ?_ + intro source target arrow + erw [eqToHom_refl, Category.id_comp, Category.comp_id] + rfl + +def constant (n : ℕ) : C ⥤ Vertical W n where + obj U := ⟨(Functor.const (Fin (n+1))).obj U,fun _ _ _ => W.id_mem U⟩ + map f := ObjectProperty.homMk ((Functor.const (Fin (n+1))).map f) +def evaluation (n : ℕ) : Vertical W n ⥤ C where + obj F := F.obj.obj 0 + map f := f.hom.app 0 +noncomputable def constantComparison (n : ℕ) : evaluation W n ⋙ constant W n ≅ 𝟭 _ := + NatIso.ofComponents (fun F => { + hom := ObjectProperty.homMk { + app i := F.obj.map (homOfLE (Fin.zero_le i)) + naturality i j f := by + change 𝟙 _ ≫ F.obj.map _ = F.obj.map _ ≫ F.obj.map _ + rw [Category.id_comp,←F.obj.map_comp] + congr 1 } + inv := ObjectProperty.homMk { + app i := by + change F.obj.obj i ⟶ F.obj.obj 0 + exact inv (F.obj.map (homOfLE (Fin.zero_le i))) + naturality i j f := by + change F.obj.map f ≫ inv (F.obj.map _) = inv (F.obj.map _) ≫ 𝟙 _ + rw [Category.comp_id] + apply (cancel_mono (F.obj.map (homOfLE (Fin.zero_le j)))).mp + simp only [Category.assoc,IsIso.inv_hom_id,Category.comp_id] + have he : F.obj.map (homOfLE (Fin.zero_le j)) = + F.obj.map (homOfLE (Fin.zero_le i)) ≫ F.obj.map f := by + rw [←F.obj.map_comp]; congr 1 + rw [he,←Category.assoc,IsIso.inv_hom_id,Category.id_comp] } + hom_inv_id := by apply ObjectProperty.hom_ext; ext i; exact IsIso.hom_inv_id _ + inv_hom_id := by + apply ObjectProperty.hom_ext + ext i + exact IsIso.inv_hom_id (F.obj.map (homOfLE (Fin.zero_le i))) }) + (by + intro F G f + apply ObjectProperty.hom_ext; ext i + exact (f.hom.naturality _).symm) +noncomputable def equivalence (n : ℕ) : C ≌ Vertical W n where + functor := constant W n + inverse := evaluation W n + unitIso := Iso.refl _ + counitIso := constantComparison W n + functor_unitIso_comp U := by + apply ObjectProperty.hom_ext; ext i + change 𝟙 U ≫ 𝟙 U = 𝟙 U + exact Category.id_comp _ +noncomputable instance (n : ℕ) : (constant W n).IsEquivalence := + (equivalence W n).isEquivalence_functor + +def horizontal : SimplicialObject Cat.{0,0} where + obj p := Cat.of (Strings W p.unop.len) + map f := (reindex W f.unop.toOrderHom.toFunctor).toCatHom + map_id p := by apply Cat.ext; exact reindex_id W p.unop.len + map_comp f g := by apply Cat.ext; exact reindex_comp W g.unop.toOrderHom.toFunctor f.unop.toOrderHom.toFunctor +def vertical : SimplicialObject Cat.{0,0} where + obj p := Cat.of (Vertical W p.unop.len) + map f := (vreindex W f.unop.toOrderHom.toFunctor).toCatHom + map_id p := by apply Cat.ext; exact vreindex_id W p.unop.len + map_comp f g := by apply Cat.ext; exact vreindex_comp W g.unop.toOrderHom.toFunctor f.unop.toOrderHom.toFunctor +def constantMap : (Functor.const SimplexCategoryᵒᵖ).obj (Cat.of C) ⟶ vertical W where + app p := (constant W p.unop.len).toCatHom + naturality _ _ f := by + apply Cat.ext + refine CategoryTheory.Functor.ext (fun _ => rfl) ?_ + intro source target arrow + erw [eqToHom_refl, Category.id_comp, Category.comp_id] + exact (Category.id_comp _).symm + +def transpose {p q : ℕ} (F : Fin (q+1) ⥤ Strings W p) : Fin (p+1) ⥤ Vertical W q where + obj i := ⟨{ + obj j := (F.obj j).obj.obj i + map f := (F.map f).hom.app i + map_id j := by have h := F.map_id j; exact congrArg (fun x => x.hom.app i) h + map_comp f g := by have h := F.map_comp f g; exact congrArg (fun x => x.hom.app i) h }, + fun j k f => (F.map f).property i⟩ + map f := ObjectProperty.homMk { + app j := (F.obj j).obj.map f + naturality j k g := ((F.map g).hom.naturality f).symm } + map_id i := by apply ObjectProperty.hom_ext; ext j; exact (F.obj j).obj.map_id i + map_comp f g := by apply ObjectProperty.hom_ext; ext j; exact (F.obj j).obj.map_comp f g + +def untranspose {p q : ℕ} (F : Fin (p+1) ⥤ Vertical W q) : Fin (q+1) ⥤ Strings W p where + obj i := ⟨{ + obj j := (F.obj j).obj.obj i + map f := (F.map f).hom.app i + map_id j := by have h := F.map_id j; exact congrArg (fun x => x.hom.app i) h + map_comp f g := by have h := F.map_comp f g; exact congrArg (fun x => x.hom.app i) h }⟩ + map f := ⟨{ + app j := (F.obj j).obj.map f + naturality j k g := ((F.map g).hom.naturality f).symm }, + fun i => (F.obj i).property _ _ f⟩ + map_id i := by apply WideSubcategory.hom_ext; ext j; exact (F.obj j).obj.map_id i + map_comp f g := by apply WideSubcategory.hom_ext; ext j; exact (F.obj j).obj.map_comp f g +lemma untranspose_transpose {p q : ℕ} (F : Fin (q+1) ⥤ Strings W p) : + untranspose W (transpose W F)=F := by + refine CategoryTheory.Functor.ext (fun _ => rfl) ?_ + intro source target arrow + erw [eqToHom_refl, Category.id_comp, Category.comp_id] + apply WideSubcategory.hom_ext + ext index + rfl +lemma transpose_untranspose {p q : ℕ} (F : Fin (p+1) ⥤ Vertical W q) : + transpose W (untranspose W F)=F := by + refine CategoryTheory.Functor.ext (fun _ => rfl) ?_ + intro source target arrow + erw [eqToHom_refl, Category.id_comp, Category.comp_id] + apply ObjectProperty.hom_ext + ext index + rfl +noncomputable def diagonalIso : SimplicialDiagonal.nerveDiagonal.obj (horizontal W) ≅ + SimplicialDiagonal.nerveDiagonal.obj (vertical W) := + NatIso.ofComponents (fun p => Equiv.toIso { + toFun := transpose W + invFun := untranspose W + left_inv := untranspose_transpose W + right_inv := transpose_untranspose W }) (by + intro p q f + ext t + refine CategoryTheory.Functor.ext (fun _ => rfl) ?_ + intro source target arrow + erw [eqToHom_refl, Category.id_comp, Category.comp_id] + apply ObjectProperty.hom_ext + ext index + rfl) +noncomputable def constantDiagonalIso : + SimplicialDiagonal.nerveDiagonal.obj ((Functor.const SimplexCategoryᵒᵖ).obj (Cat.of C)) ≅ nerve C := + NatIso.ofComponents (fun _ => Iso.refl _) (by intros; rfl) +noncomputable def homologyIso (n : ℕ) : + (SimplicialDiagonal.nerveDiagonal.obj (horizontal W)).homology DiagonalResolution.Z n ≅ + (nerve C).homology DiagonalResolution.Z n := by + haveI := SimplicialDiagonal.nerveDiagonal_isIso (constantMap W) + (fun p => inferInstanceAs (constant W p.unop.len).IsEquivalence) n + exact (SSet.homologyFunctor DiagonalResolution.Z n).mapIso (diagonalIso W) ≪≫ + (asIso (SSet.homologyMap (SimplicialDiagonal.nerveDiagonal.map (constantMap W)) + DiagonalResolution.Z n)).symm ≪≫ + (SSet.homologyFunctor DiagonalResolution.Z n).mapIso (constantDiagonalIso (C:=C)) +end RestrictedNerve + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/RestrictedTripleDegree.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/RestrictedTripleDegree.lean new file mode 100644 index 0000000000000000000000000000000000000000..c38452073c29d0f13d053d29baa145c8cd339672 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/RestrictedTripleDegree.lean @@ -0,0 +1,63 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.RestrictedTripleMaps + +namespace OAI + +section + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory MonoidalCategory SimplicialObject Simplicial Opposite +namespace RestrictedNerve +open IntervalBar IntervalBar.Diagram + +variable {C : Type} [Groupoid.{0} C] (W : MorphismProperty C) + [Fact W.StableUnderInverse] [MonoidalCategory C] [SymmetricCategory C] + [W.IsStableUnderBraiding] +noncomputable abbrev property₂ (p q:ℕ) := diagramProperty (diagramProperty W (Fin (p+1))) (Fin (q+1)) +noncomputable abbrev property₃ (p q r:ℕ) := diagramProperty (property₂ W p q) (Fin (r+1)) +noncomputable abbrev pos₂ (p q:ℕ) := PosDiagrams (diagramProperty W (Fin (p+1))) (Fin (q+1)) +noncomputable abbrev pos₃ (p q r:ℕ) := PosDiagrams (property₂ W p q) (Fin (r+1)) +noncomputable def tripleTranspose (p q r n:ℕ) : + Diagram (Diagram (Diagram (Strings W n) (Fin (p+1))) (Fin (q+1))) (Fin (r+1)) ⥤ + Strings (property₃ W p q r) n := + Diagram.map (I:=Fin (r+1)) (Diagram.map (I:=Fin (q+1)) (transposeDiagram (I:=Fin (p+1)) W n)) ⋙ + Diagram.map (I:=Fin (r+1)) (transposeDiagram (I:=Fin (q+1)) (diagramProperty W (Fin (p+1))) n) ⋙ + transposeDiagram (I:=Fin (r+1)) (property₂ W p q) n +noncomputable instance tripleTransposeEquivalence (p q r n:ℕ) : + (tripleTranspose W p q r n).IsEquivalence := by unfold tripleTranspose; infer_instance + +noncomputable def triplePosInclusion (p q r:ℕ) : pos₃ W p q r ⥤ + Diagram (Diagram (Diagram C (Fin (p+1))) (Fin (q+1))) (Fin (r+1)) := + posDiagramInclusion (property₂ W p q) (Fin (r+1)) ⋙ + Diagram.map (I:=Fin (r+1)) (posDiagramInclusion (diagramProperty W (Fin (p+1))) (Fin (q+1))) ⋙ + Diagram.map (I:=Fin (r+1)) (Diagram.map (I:=Fin (q+1)) (posDiagramInclusion W (Fin (p+1)))) +noncomputable instance triplePosInclusionEquivalence (p q r:ℕ) : + (triplePosInclusion W p q r).IsEquivalence := by unfold triplePosInclusion; infer_instance +noncomputable def tripleDiagramHorizontal (p q r:ℕ) : SimplicialObject Cat.{0,0} where + obj n := Cat.of (Diagram (Diagram (Diagram (Strings W n.unop.len) (Fin (p+1))) (Fin (q+1))) (Fin (r+1))) + map f := (Diagram.map (I:=Fin (r+1)) (Diagram.map (I:=Fin (q+1)) (Diagram.map (I:=Fin (p+1)) + (reindex W f.unop.toOrderHom.toFunctor)))).toCatHom + map_id n := by apply Cat.ext; exact map₃_strings_reindex_id W n.unop.len p q r + map_comp f g := by apply Cat.ext; exact map₃_strings_reindex_comp W p q r g.unop.toOrderHom.toFunctor f.unop.toOrderHom.toFunctor + +noncomputable def triplePosHomologyIso (p q r j:ℕ) : + (nerve (pos₃ W p q r)).homology DiagonalResolution.Z j ≅ + (nerve (Diagram (Diagram (Diagram C (Fin (p+1))) (Fin (q+1))) (Fin (r+1)))).homology DiagonalResolution.Z j := + NerveHomotopy.homologyIso (triplePosInclusion W p q r).asEquivalence DiagonalResolution.Z j + +noncomputable def tripleTransposeHomologyIso (p q r n j:ℕ) : + (nerve (Diagram (Diagram (Diagram (Strings W n) (Fin (p+1))) (Fin (q+1))) (Fin (r+1)))).homology DiagonalResolution.Z j ≅ + (nerve (Strings (property₃ W p q r) n)).homology DiagonalResolution.Z j := + NerveHomotopy.homologyIso (tripleTranspose W p q r n).asEquivalence DiagonalResolution.Z j + +noncomputable def tripleRestrictedHomologyIso (p q r j:ℕ) : + (SimplicialDiagonal.nerveDiagonal.obj (horizontal (property₃ W p q r))).homology DiagonalResolution.Z j ≅ + (nerve (Diagram (Diagram (Diagram C (Fin (p+1))) (Fin (q+1))) (Fin (r+1)))).homology DiagonalResolution.Z j := + homologyIso (property₃ W p q r) j ≪≫ triplePosHomologyIso W p q r j +end RestrictedNerve + +end + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/RestrictedTripleMaps.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/RestrictedTripleMaps.lean new file mode 100644 index 0000000000000000000000000000000000000000..82a866aad948cbd2715ff6ce051ba2abcf9191dc --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/RestrictedTripleMaps.lean @@ -0,0 +1,287 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.StageTripleHomology +import OAI.GroupTheory.SimpleAmenable.Simplicial.RestrictedMonoidalTranspose + +namespace OAI + +open _root_.CategoryTheory _root_.OAI.CategoryTheory MonoidalCategory SimplicialObject Simplicial Opposite +namespace RestrictedNerve +open IntervalBar IntervalBar.Diagram + +variable {C : Type} [Groupoid.{0} C] (W : MorphismProperty C) + [Fact W.StableUnderInverse] [MonoidalCategory C] [SymmetricCategory C] + [W.IsStableUnderBraiding] +lemma diagram_map_obj {D E : Type} [Groupoid D] [Groupoid E] + [MonoidalCategory D] [MonoidalCategory E] {I : Type} [Preorder I] + (F : D ⥤ E) [F.Monoidal] (A : Diagram D I) : + (Diagram.map F).obj A = mapObj F A := rfl +variable {I J K : Type} [Preorder I] [Preorder J] [Preorder K] +private lemma map₂_reindex_unit_app {n m : ℕ} (u : Fin (n+1) ⥤ Fin (m+1)) + (A : Diagram (Diagram (Strings W m) I) J) (i : J) + (j k : I) (h : j ≤ k) (t : Fin (n+1)) : + ((((Diagram.map (Diagram.map (reindex W u))).obj A).unit i).hom.app j k h).hom.app t = + ((A.unit i).hom.app j k h).hom.app (u.obj t) := by + change (((Diagram.map (reindex W u)).map (A.unit i).hom ≫ + Functor.OplaxMonoidal.η (Diagram.map (reindex W u))).app j k h).hom.app t = _ + erw [comp_app, map_η_app (I:=I) (reindex W u)] + change ((A.unit i).hom.app j k h).hom.app (u.obj t) ≫ 𝟙 _ = _ + exact Category.comp_id _ + +private lemma map₂_reindex_cut_app {n m : ℕ} (u : Fin (n+1) ⥤ Fin (m+1)) + (A : Diagram (Diagram (Strings W m) I) J) (i j k : J) + (hij : i ≤ j) (hjk : j ≤ k) (l r : I) (h : l ≤ r) (t : Fin (n+1)) : + ((((Diagram.map (Diagram.map (reindex W u))).obj A).cut i j k hij hjk).hom.app l r h).hom.app t = + ((A.cut i j k hij hjk).hom.app l r h).hom.app (u.obj t) := by + change 𝟙 _ ≫ ((A.cut i j k hij hjk).hom.app l r h).hom.app (u.obj t) = _ + exact Category.id_comp _ + +private lemma map₃_reindex_unit_app {q₁ q₂ q₃ n m : ℕ} (u : Fin (n+1) ⥤ Fin (m+1)) + (A : Diagram (Diagram (Diagram (Strings W m) (Fin (q₁+1))) (Fin (q₂+1))) (Fin (q₃+1))) (i : (Fin (q₃+1))) + (j k : (Fin (q₂+1))) (h : j ≤ k) (l r : (Fin (q₁+1))) (hlr : l ≤ r) (t : Fin (n+1)) : + (((((Diagram.map (I:=(Fin (q₃+1))) (Diagram.map (I:=(Fin (q₂+1))) (Diagram.map (I:=(Fin (q₁+1))) (reindex W u)))).obj A).unit i).hom.app j k h).app l r hlr).hom.app t = + (((A.unit i).hom.app j k h).app l r hlr).hom.app (u.obj t) := by + change ((((Diagram.map (I:=(Fin (q₂+1))) (Diagram.map (I:=(Fin (q₁+1))) (reindex W u))).map (A.unit i).hom ≫ + Functor.OplaxMonoidal.η (Diagram.map (I:=(Fin (q₂+1))) (Diagram.map (I:=(Fin (q₁+1))) (reindex W u)))).app j k h).app l r hlr).hom.app t = _ + erw [comp_app, map_η_app (I:=(Fin (q₂+1))) (Diagram.map (I:=(Fin (q₁+1))) (reindex W u))] + erw [map_η_app (I:=(Fin (q₁+1))) (reindex W u)] + change (((A.unit i).hom.app j k h).app l r hlr).hom.app (u.obj t) ≫ 𝟙 _ = _ + exact Category.comp_id _ + +private lemma map₃_reindex_cut_app {q₁ q₂ q₃ n m : ℕ} (u : Fin (n+1) ⥤ Fin (m+1)) + (A : Diagram (Diagram (Diagram (Strings W m) (Fin (q₁+1))) (Fin (q₂+1))) (Fin (q₃+1))) (i j k : (Fin (q₃+1))) + (hij : i ≤ j) (hjk : j ≤ k) (l r : (Fin (q₂+1))) (h : l ≤ r) + (v w : (Fin (q₁+1))) (hvw : v ≤ w) (t : Fin (n+1)) : + (((((Diagram.map (I:=(Fin (q₃+1))) (Diagram.map (I:=(Fin (q₂+1))) (Diagram.map (I:=(Fin (q₁+1))) (reindex W u)))).obj A).cut i j k hij hjk).hom.app l r h).app v w hvw).hom.app t = + (((A.cut i j k hij hjk).hom.app l r h).app v w hvw).hom.app (u.obj t) := by + change 𝟙 _ ≫ (((A.cut i j k hij hjk).hom.app l r h).app v w hvw).hom.app (u.obj t) = _ + exact Category.id_comp _ + +lemma map₂_strings_reindex_id (n:ℕ) : + Diagram.map (I:=J) (Diagram.map (I:=I) (reindex W (𝟭 (Fin (n+1)))))=𝟭 _ := by + have he (A : Diagram (Strings W n) I) : + Diagram.mapObj (reindex W (𝟭 (Fin (n+1)))) A=A := + congrArg (fun F=>F.obj A) (map_strings_reindex_id W n) + have he₂ (A : Diagram (Diagram (Strings W n) I) J) : + (Diagram.map (Diagram.map (reindex W (𝟭 (Fin (n+1)))))).obj A=A := by + refine ext_heq ?_ ?_ ?_ + · funext i j h; exact he _ + · apply hfunext; intro i + apply iso_hext (he _) rfl + apply hom_hext (he _) rfl + intro j k h + apply heq_of_eq + apply WideSubcategory.hom_ext; apply NatTrans.ext; funext t + erw [map₂_reindex_unit_app] + rfl + · apply hfunext; intro i + apply hfunext; intro j + apply hfunext; intro k + apply hfunext; intro hij + apply hfunext; intro hjk + apply iso_hext (congrArg₂ (fun X Y=>X⊗Y) (he _) (he _)) (he _) + apply hom_hext (congrArg₂ (fun X Y=>X⊗Y) (he _) (he _)) (he _) + intro l m h + apply heq_of_eq + apply WideSubcategory.hom_ext; apply NatTrans.ext; funext t + erw [map₂_reindex_cut_app] + rfl + refine CategoryTheory.Functor.hext he₂ ?_ + intro A B f + apply hom_hext (he₂ A) (he₂ B) + intro i j h + apply hom_hext (he _) (he _) + intro l m hlm + apply heq_of_eq + apply WideSubcategory.hom_ext; rfl +lemma map₂_strings_reindex_comp {n m k:ℕ} (u:Fin (n+1) ⥤ Fin (m+1)) (v:Fin (m+1) ⥤ Fin (k+1)) : + Diagram.map (I:=J) (Diagram.map (I:=I) (reindex W (u⋙v))) = + Diagram.map (Diagram.map (reindex W v)) ⋙ Diagram.map (Diagram.map (reindex W u)) := by + have he (A : Diagram (Strings W k) I) : + Diagram.mapObj (reindex W (u⋙v)) A = + Diagram.mapObj (reindex W u) (Diagram.mapObj (reindex W v) A) := + congrArg (fun F=>F.obj A) (map_strings_reindex_comp W u v) + have he₂ (A : Diagram (Diagram (Strings W k) I) J) : + (Diagram.map (Diagram.map (reindex W (u⋙v)))).obj A= + (Diagram.map (Diagram.map (reindex W u))).obj ((Diagram.map (Diagram.map (reindex W v))).obj A) := by + refine ext_heq ?_ ?_ ?_ + · funext i j h; exact he _ + · apply hfunext; intro i + apply iso_hext (he _) rfl + apply hom_hext (he _) rfl + intro j k h + apply heq_of_eq + apply WideSubcategory.hom_ext; apply NatTrans.ext; funext t + erw [map₂_reindex_unit_app, map₂_reindex_unit_app, map₂_reindex_unit_app] + rfl + · apply hfunext; intro i + apply hfunext; intro j + apply hfunext; intro k + apply hfunext; intro hij + apply hfunext; intro hjk + apply iso_hext (congrArg₂ (fun X Y=>X⊗Y) (he _) (he _)) (he _) + apply hom_hext (congrArg₂ (fun X Y=>X⊗Y) (he _) (he _)) (he _) + intro l m h + apply heq_of_eq + apply WideSubcategory.hom_ext; apply NatTrans.ext; funext t + erw [map₂_reindex_cut_app, map₂_reindex_cut_app, map₂_reindex_cut_app] + rfl + refine CategoryTheory.Functor.hext he₂ ?_ + intro A B f + apply hom_hext (he₂ A) (he₂ B) + intro i j h + apply hom_hext (he _) (he _) + intro l m hlm + apply heq_of_eq + apply WideSubcategory.hom_ext; rfl +lemma map₃_strings_reindex_id (n q₁ q₂ q₃:ℕ) : + Diagram.map (I:=(Fin (q₃+1))) (Diagram.map (I:=(Fin (q₂+1))) (Diagram.map (I:=(Fin (q₁+1))) (reindex W (𝟭 (Fin (n+1))))))=𝟭 _ := by + have he (A : Diagram (Strings W n) (Fin (q₁+1))) : + Diagram.mapObj (reindex W (𝟭 (Fin (n+1)))) A=A := + congrArg (fun F=>F.obj A) (map_strings_reindex_id W n) + have he₂ (A : Diagram (Diagram (Strings W n) (Fin (q₁+1))) (Fin (q₂+1))) : + (Diagram.map (Diagram.map (reindex W (𝟭 (Fin (n+1)))))).obj A=A := + congrArg (fun F=>F.obj A) (map₂_strings_reindex_id W n) + have he₃ (A : Diagram (Diagram (Diagram (Strings W n) (Fin (q₁+1))) (Fin (q₂+1))) (Fin (q₃+1))) : + (Diagram.map (Diagram.map (Diagram.map (reindex W (𝟭 (Fin (n+1))))))).obj A=A := by + refine ext_heq ?_ ?_ ?_ + · funext i j h; exact he₂ _ + · apply hfunext; intro i + apply iso_hext (he₂ _) rfl + apply hom_hext (he₂ _) rfl + intro j k h + apply hom_hext (he _) rfl + intro l m hlm + apply heq_of_eq + apply WideSubcategory.hom_ext; apply NatTrans.ext; funext t + erw [map₃_reindex_unit_app W] + rfl + · apply hfunext; intro i + apply hfunext; intro j + apply hfunext; intro k + apply hfunext; intro hij + apply hfunext; intro hjk + apply iso_hext (congrArg₂ (fun X Y=>X⊗Y) (he₂ _) (he₂ _)) (he₂ _) + apply hom_hext (congrArg₂ (fun X Y=>X⊗Y) (he₂ _) (he₂ _)) (he₂ _) + intro l m h + apply hom_hext (congrArg₂ (fun X Y=>X⊗Y) (he _) (he _)) (he _) + intro v w hvw + apply heq_of_eq + apply WideSubcategory.hom_ext; apply NatTrans.ext; funext t + erw [map₃_reindex_cut_app W] + rfl + refine CategoryTheory.Functor.hext he₃ ?_ + intro A B f + apply hom_hext (he₃ A) (he₃ B) + intro i j h + apply hom_hext (he₂ _) (he₂ _) + intro l m hlm + apply hom_hext (he _) (he _) + intro v w hvw + apply heq_of_eq + apply WideSubcategory.hom_ext; rfl +private lemma map₃_reindex_comp_cut_app (q₁ q₂ q₃ : ℕ) {n m k : ℕ} + (u : Fin (n+1) ⥤ Fin (m+1)) (v : Fin (m+1) ⥤ Fin (k+1)) + (A : Diagram (Diagram (Diagram (Strings W k) (Fin (q₁+1))) (Fin (q₂+1))) (Fin (q₃+1))) + (i j z : Fin (q₃+1)) (hij : i ≤ j) (hjz : j ≤ z) + (l r : Fin (q₂+1)) (h : l ≤ r) + (first last : Fin (q₁+1)) (ordered : first ≤ last) (t : Fin (n+1)) : + (((((Diagram.map (I:=Fin (q₃+1)) (Diagram.map (I:=Fin (q₂+1)) + (Diagram.map (I:=Fin (q₁+1)) (reindex W (u ⋙ v))))).obj A).cut i j z hij hjz).hom.app l r h).app first last ordered).hom.app t = + (((((Diagram.map (I:=Fin (q₃+1)) (Diagram.map (I:=Fin (q₂+1)) + (Diagram.map (I:=Fin (q₁+1)) (reindex W u)))).obj + ((Diagram.map (I:=Fin (q₃+1)) (Diagram.map (I:=Fin (q₂+1)) + (Diagram.map (I:=Fin (q₁+1)) (reindex W v)))).obj A)).cut i j z hij hjz).hom.app l r h).app first last ordered).hom.app t := by + exact (map₃_reindex_cut_app (q₁:=q₁) (q₂:=q₂) (q₃:=q₃) W (u ⋙ v) A + i j z hij hjz l r h first last ordered t).trans + ((map₃_reindex_cut_app (q₁:=q₁) (q₂:=q₂) (q₃:=q₃) W u + ((Diagram.map (I:=Fin (q₃+1)) (Diagram.map (I:=Fin (q₂+1)) + (Diagram.map (I:=Fin (q₁+1)) (reindex W v)))).obj A) + i j z hij hjz l r h first last ordered t).trans + (map₃_reindex_cut_app (q₁:=q₁) (q₂:=q₂) (q₃:=q₃) W v A + i j z hij hjz l r h first last ordered (u.obj t))).symm + +private lemma map₃_strings_reindex_comp_obj (q₁ q₂ q₃ : ℕ) {n m k : ℕ} + (u : Fin (n+1) ⥤ Fin (m+1)) (v : Fin (m+1) ⥤ Fin (k+1)) + (A : Diagram (Diagram (Diagram (Strings W k) (Fin (q₁+1))) (Fin (q₂+1))) (Fin (q₃+1))) : + (Diagram.map (Diagram.map (Diagram.map (reindex W (u⋙v))))).obj A= + (Diagram.map (Diagram.map (Diagram.map (reindex W u)))).obj + ((Diagram.map (Diagram.map (Diagram.map (reindex W v)))).obj A) := by + have he (A : Diagram (Strings W k) (Fin (q₁+1))) : + Diagram.mapObj (reindex W (u⋙v)) A = + Diagram.mapObj (reindex W u) (Diagram.mapObj (reindex W v) A) := + congrArg (fun F=>F.obj A) (map_strings_reindex_comp W u v) + have he₂ (A : Diagram (Diagram (Strings W k) (Fin (q₁+1))) (Fin (q₂+1))) : + (Diagram.map (Diagram.map (reindex W (u⋙v)))).obj A= + (Diagram.map (Diagram.map (reindex W u))).obj ((Diagram.map (Diagram.map (reindex W v))).obj A) := + congrArg (fun F=>F.obj A) (map₂_strings_reindex_comp W u v) + refine ext_heq ?_ ?_ ?_ + · funext i j h; exact he₂ _ + · apply hfunext; intro i + apply iso_hext (he₂ _) rfl + apply hom_hext (he₂ _) rfl + intro j k h + apply hom_hext (he _) rfl + intro l m hlm + apply heq_of_eq + apply WideSubcategory.hom_ext; apply NatTrans.ext; funext t + erw [map₃_reindex_unit_app W, map₃_reindex_unit_app W, map₃_reindex_unit_app W] + rfl + · apply hfunext; intro i + apply hfunext; intro j + apply hfunext; intro k + apply hfunext; intro hij + apply hfunext; intro hjk + apply iso_hext (congrArg₂ (fun X Y=>X⊗Y) (he₂ _) (he₂ _)) (he₂ _) + apply hom_hext (congrArg₂ (fun X Y=>X⊗Y) (he₂ _) (he₂ _)) (he₂ _) + intro l m h + apply hom_hext (congrArg₂ (fun X Y=>X⊗Y) (he _) (he _)) (he _) + intro first last ordered + apply heq_of_eq + apply WideSubcategory.hom_ext; apply NatTrans.ext; funext t + exact map₃_reindex_comp_cut_app W q₁ q₂ q₃ u v A i j k hij hjk l m h first last ordered t + +lemma map₃_strings_reindex_comp (q₁ q₂ q₃:ℕ) {n m k:ℕ} (u:Fin (n+1) ⥤ Fin (m+1)) (v:Fin (m+1) ⥤ Fin (k+1)) : + Diagram.map (I:=(Fin (q₃+1))) (Diagram.map (I:=(Fin (q₂+1))) (Diagram.map (I:=(Fin (q₁+1))) (reindex W (u⋙v)))) = + Diagram.map (Diagram.map (Diagram.map (reindex W v))) ⋙ Diagram.map (Diagram.map (Diagram.map (reindex W u))) := by + have he (A : Diagram (Strings W k) (Fin (q₁+1))) : + Diagram.mapObj (reindex W (u⋙v)) A = + Diagram.mapObj (reindex W u) (Diagram.mapObj (reindex W v) A) := + congrArg (fun F=>F.obj A) (map_strings_reindex_comp W u v) + have he₂ (A : Diagram (Diagram (Strings W k) (Fin (q₁+1))) (Fin (q₂+1))) : + (Diagram.map (Diagram.map (reindex W (u⋙v)))).obj A= + (Diagram.map (Diagram.map (reindex W u))).obj ((Diagram.map (Diagram.map (reindex W v))).obj A) := + congrArg (fun F=>F.obj A) (map₂_strings_reindex_comp W u v) + have he₃ (A : Diagram (Diagram (Diagram (Strings W k) (Fin (q₁+1))) (Fin (q₂+1))) (Fin (q₃+1))) : + (Diagram.map (Diagram.map (Diagram.map (reindex W (u⋙v))))).obj A= + (Diagram.map (Diagram.map (Diagram.map (reindex W u)))).obj + ((Diagram.map (Diagram.map (Diagram.map (reindex W v)))).obj A) := + map₃_strings_reindex_comp_obj W q₁ q₂ q₃ u v A + refine CategoryTheory.Functor.hext he₃ ?_ + intro A B f + apply hom_hext (he₃ A) (he₃ B) + intro i j h + apply hom_hext (he₂ _) (he₂ _) + intro l m hlm + apply hom_hext (he _) (he _) + intro v w hvw + apply heq_of_eq + apply WideSubcategory.hom_ext; rfl +lemma bar₃Map_strings_reindex_id (n:ℕ) : + bar₃Map (reindex W (𝟭 (Fin (n+1))))=𝟙 _ := by + ext q x + exact congrArg (fun T => x ⋙ T) + (map₃_strings_reindex_id W n q.unop.len q.unop.len q.unop.len) +lemma bar₃Map_strings_reindex_comp {n m k:ℕ} (u:Fin (n+1) ⥤ Fin (m+1)) (v:Fin (m+1) ⥤ Fin (k+1)) : + bar₃Map (reindex W (u⋙v))=bar₃Map (reindex W v) ≫ bar₃Map (reindex W u) := by + ext q x + exact congrArg (fun T => x ⋙ T) + (map₃_strings_reindex_comp W q.unop.len q.unop.len q.unop.len u v) + +noncomputable def tripleHorizontal : SimplexCategoryᵒᵖ ⥤ SSet where + obj p := bar₃ (C:=Strings W p.unop.len) + map f := bar₃Map (reindex W f.unop.toOrderHom.toFunctor) + map_id p := bar₃Map_strings_reindex_id W p.unop.len + map_comp f g := bar₃Map_strings_reindex_comp W g.unop.toOrderHom.toFunctor f.unop.toOrderHom.toFunctor +end RestrictedNerve + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/SimplicialAugment.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/SimplicialAugment.lean new file mode 100644 index 0000000000000000000000000000000000000000..442b28239eceab1b2d02bec7e83ae5a8ed60b0e7 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/SimplicialAugment.lean @@ -0,0 +1,93 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.ProductChains + +namespace OAI + +section + +section +open CategoryTheory Limits MonoidalCategory HomologicalComplex SimplicialObject Simplicial Opposite AlgebraicTopology +namespace SimplicialAugment +open FreeChains AugmentedSplit + +variable (X : SSet) +noncomputable def aug0 : (ModuleCat.free ℤ).obj (X.obj (op ⦋0⦌)) ⟶ Z := ModuleCat.freeDesc (M:=Z) (↾fun _ => (1:ℤ)) +@[simp] lemma aug0_mk (x : X.obj (op ⦋0⦌)) : aug0 X (ModuleCat.freeMk x)=1 := + ModuleCat.freeDesc_apply (M:=Z) (↾fun _ => (1:ℤ)) x +lemma d_aug0 : (complex X).d 1 0 ≫ aug0 X=0 := by + change (∑ i : Fin 2, (-1:ℤ)^i.val • (ModuleCat.free ℤ).map (X.δ i)) ≫ aug0 X=0 + simp only [Fin.sum_univ_two,Fin.val_zero,Fin.val_one, + pow_zero,pow_one,one_smul,neg_smul,Preadditive.add_comp,Preadditive.neg_comp] + apply ModuleCat.free_hom_ext + intro x + change aug0 X ((ModuleCat.free ℤ).map (X.δ 0) (ModuleCat.freeMk x)) - + aug0 X ((ModuleCat.free ℤ).map (X.δ 1) (ModuleCat.freeMk x)) = 0 + simp only [ModuleCat.free_map_apply] + rw [aug0_mk,aug0_mk,sub_self] +noncomputable def aug : complex X ⟶ U := + (ChainComplex.toSingle₀Equiv _ Z).symm ⟨aug0 X,d_aug0 X⟩ +@[simp] lemma aug_f_zero : (aug X).f 0=aug0 X := ChainComplex.toSingle₀Equiv_symm_apply_f_zero _ _ +noncomputable def sec (x : X.obj (op ⦋0⦌)) : U ⟶ complex X := + (ChainComplex.fromSingle₀Equiv _ Z).symm (ModuleCat.ofHom (Finsupp.lsingle x)) +lemma section_aug (x : X.obj (op ⦋0⦌)) : sec X x ≫ aug X=𝟙 U := by + apply HomologicalComplex.from_single_hom_ext + rw [HomologicalComplex.comp_f,HomologicalComplex.id_f,aug_f_zero] + change ModuleCat.ofHom (Finsupp.lsingle x) ≫ aug0 X=𝟙 Z + apply ModuleCat.hom_ext + apply LinearMap.ext_ring + change (ModuleCat.freeDesc (M:=Z) (↾fun _ : X.obj (op ⦋0⦌) => (1:ℤ))) (ModuleCat.freeMk x)=1 + exact ModuleCat.freeDesc_apply (M:=Z) (↾fun _ => (1:ℤ)) x +instance flat (n : ℕ) : Module.Flat ℤ ((complex X).X n) := by + change Module.Flat ℤ (X.obj (op ⦋n⦌) →₀ ℤ) + infer_instance + +lemma lift_homology (x : X.obj (op ⦋0⦌)) : + (X.chainComplex Z).liftCycles (X.ιChainComplex x) 0 (by simp) (by simp) ≫ + (X.chainComplex Z).homologyπ 0 ≫ + homologyMap ((complexIso X).hom ≫ aug X) 0 ≫ + (singleObjHomologySelfIso c 0 Z).hom=𝟙 Z := by + rw [homologyπ_naturality_assoc,liftCycles_comp_cyclesMap_assoc] + change liftCycles ((single A c 0).obj Z) _ 0 _ _ ≫ + ((single A c 0).obj Z).homologyπ 0 ≫ (singleObjHomologySelfIso c 0 Z).hom = _ + rw [homologyπ_singleObjHomologySelfIso_hom] + rw [singleObjCyclesSelfIso_hom,←Category.assoc,liftCycles_i] + simp only [HomologicalComplex.comp_f,aug_f_zero] + change Sigma.ι (fun _ : X.obj (op ⦋0⦌) => Z) x ≫ forward _ ≫ aug0 X=𝟙 Z + rw [ι_forward_assoc] + apply ModuleCat.hom_ext + apply LinearMap.ext_ring + change (ModuleCat.freeDesc (M:=Z) (↾fun _ : X.obj (op ⦋0⦌) => (1:ℤ))) (ModuleCat.freeMk x)=1 + exact ModuleCat.freeDesc_apply (M:=Z) (↾fun _ => (1:ℤ)) x + +lemma homology_aug : + homologyMap ((complexIso X).hom ≫ aug X) 0 ≫ + (singleObjHomologySelfIso c 0 Z).hom = X.homology₀ε Z := by + apply (cancel_epi ((X.chainComplex Z).homologyπ 0)).mp + apply (cancel_epi (X.chainComplex Z).cycles₀Iso.inv).mp + apply Sigma.hom_ext + intro x + have he : X.ιChainComplex x ≫ (X.chainComplex Z).cycles₀Iso.inv = + (X.chainComplex Z).liftCycles (X.ιChainComplex x) 0 (by simp) (by simp) := by + apply (cancel_mono ((X.chainComplex Z).iCycles 0)).mp + simp + change X.ιChainComplex x ≫ _ = X.ιChainComplex x ≫ _ + simp only [←Category.assoc] + rw [he] + simp only [Category.assoc] + rw [lift_homology,X.liftCycles_ιChainComplex_homologyπ_homology₀ε] + +instance homology_aug_isIso [X.IsConnected] : IsIso (homologyMap (aug X) 0) := by + have h := homology_aug X + rw [homologyMap_comp,Category.assoc] at h + have : IsIso (homologyMap (complexIso X).hom 0 ≫ + homologyMap (aug X) 0 ≫ (singleObjHomologySelfIso c 0 Z).hom) := by rw [h]; infer_instance + have : IsIso (homologyMap (aug X) 0 ≫ (singleObjHomologySelfIso c 0 Z).hom) := + (isIso_comp_left_iff (homologyMap (complexIso X).hom 0) _).mp inferInstance + exact (isIso_comp_right_iff _ (singleObjHomologySelfIso c 0 Z).hom).mp inferInstance +end SimplicialAugment + +end + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/SimplicialConnectedProduct.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/SimplicialConnectedProduct.lean new file mode 100644 index 0000000000000000000000000000000000000000..758980eddcd91c491b4672215ee159e0491a8e06 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/SimplicialConnectedProduct.lean @@ -0,0 +1,46 @@ +import Mathlib + +namespace OAI + +section + +section +open CategoryTheory MonoidalCategory SimplicialObject Simplicial Opposite AlgebraicTopology +namespace ConnectedProduct + +variable (X Y : SSet) +def pairLeft (y : Y.obj (op ⦋0⦌)) : X ⟶ X ⊗ Y := + CartesianMonoidalCategory.lift (𝟙 X) (SSet.const y) +def pairRight (x : X.obj (op ⦋0⦌)) : Y ⟶ X ⊗ Y := + CartesianMonoidalCategory.lift (SSet.const x) (𝟙 Y) +lemma const_zero {X Y : SSet} (x : X.obj (op ⦋0⦌)) (y : Y.obj (op ⦋0⦌)) : + (SSet.const (X:=X) y).app (op ⦋0⦌) x=y := by + change Y.map _ y=y + rw [Subsingleton.elim (SimplexCategory.const ⦋0⦌ ⦋0⦌ 0) (𝟙 _)] + simp +lemma pairLeft_zero (y : Y.obj (op ⦋0⦌)) (x : X.obj (op ⦋0⦌)) : + (pairLeft X Y y).app (op ⦋0⦌) x=(x,y) := by + change (x,(SSet.const y).app (op ⦋0⦌) x)=(x,y) + rw [const_zero] +lemma pairRight_zero (x : X.obj (op ⦋0⦌)) (y : Y.obj (op ⦋0⦌)) : + (pairRight X Y x).app (op ⦋0⦌) y=(x,y) := by + change ((SSet.const x).app (op ⦋0⦌) y,y)=(x,y) + rw [const_zero] +instance connected_tensor [X.IsConnected] [Y.IsConnected] : (X⊗Y).IsConnected where + allEq u v := by + obtain ⟨⟨x,y⟩,rfl⟩ := SSet.π₀.mk_surjective u + obtain ⟨⟨x',y'⟩,rfl⟩ := SSet.π₀.mk_surjective v + have h₁ := congrArg (SSet.mapπ₀ (pairLeft X Y y)) + (Subsingleton.elim (SSet.π₀.mk x) (SSet.π₀.mk x')) + have h₂ := congrArg (SSet.mapπ₀ (pairRight X Y x')) + (Subsingleton.elim (SSet.π₀.mk y) (SSet.π₀.mk y')) + simp only [SSet.mapπ₀_mk,pairLeft_zero,pairRight_zero] at h₁ h₂ + exact h₁.trans h₂ + nonempty := ⟨(Classical.arbitrary _,Classical.arbitrary _)⟩ +end ConnectedProduct + +end + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/SimplicialH0.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/SimplicialH0.lean new file mode 100644 index 0000000000000000000000000000000000000000..4e7466496d2ddc91df9efee567d7917a43d30403 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/SimplicialH0.lean @@ -0,0 +1,158 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.ProductChains + +namespace OAI + +section + +section +open CategoryTheory Limits MonoidalCategory HomologicalComplex SimplicialObject Simplicial Opposite AlgebraicTopology +namespace SimplicialH0 +open FreeChains + +variable {X Y : SSet} +@[reassoc] lemma natural (f : X ⟶ Y) : SSet.homologyMap f Z 0 ≫ Y.homology₀ε Z=X.homology₀ε Z := by + apply (cancel_epi ((X.chainComplex Z).homologyπ 0)).mp + apply (cancel_epi (X.chainComplex Z).cycles₀Iso.inv).mp + apply Sigma.hom_ext + intro x + have he : X.ιChainComplex x ≫ (X.chainComplex Z).cycles₀Iso.inv = + (X.chainComplex Z).liftCycles (X.ιChainComplex x) 0 (by simp) (by simp) := by + apply (cancel_mono ((X.chainComplex Z).iCycles 0)).mp + simp + change X.ιChainComplex x ≫ (X.chainComplex Z).cycles₀Iso.inv ≫ _ = + X.ιChainComplex x ≫ (X.chainComplex Z).cycles₀Iso.inv ≫ _ + simp only [←Category.assoc] + rw [he] + simp only [Category.assoc] + change _ ≫ _ ≫ homologyMap (SSet.chainComplexMap f Z) 0 ≫ _ = _ + rw [homologyπ_naturality_assoc,liftCycles_comp_cyclesMap_assoc,SSet.ι_chainComplexMap_f] + simp +noncomputable def augmentation : SSet.homologyFunctor Z 0 ⟶ (Functor.const SSet).obj Z where + app X := X.homology₀ε Z + naturality source target morphism := by + change SSet.homologyMap morphism Z 0 ≫ target.homology₀ε Z = + source.homology₀ε Z ≫ 𝟙 Z + simpa only [Category.comp_id] using natural morphism +noncomputable def connectedIso (T : SimplicialObject SSet.{0}) (hT : ∀ n,(T.obj n).IsConnected) : + T ⋙ SSet.homologyFunctor Z 0 ≅ (Functor.const SimplexCategoryᵒᵖ).obj Z := + by + let f : T ⋙ SSet.homologyFunctor Z 0 ⟶ (Functor.const SimplexCategoryᵒᵖ).obj Z := + { app n := (T.obj n).homology₀ε Z + naturality n m g := by + change SSet.homologyMap (T.map g) Z 0 ≫ (T.obj m).homology₀ε Z = + (T.obj n).homology₀ε Z ≫ 𝟙 Z + simpa only [Category.comp_id] using natural (T.map g) } + have : ∀ n, IsIso (f.app n) := fun n => by + have : (T.obj n).IsConnected := hT n + change IsIso ((T.obj n).homology₀ε Z) + infer_instance + have : IsIso f := NatIso.isIso_of_isIso_app f + exact asIso f +end SimplicialH0 +example (X : SSet) [X.IsConnected] : IsIso (X.homology₀ε FreeChains.Z) := by infer_instance + +end + +section +open CategoryTheory Limits MonoidalCategory HomologicalComplex HomologicalComplex₂ SimplicialObject Simplicial Opposite AlgebraicTopology +namespace BarHomology +open FreeChains + +abbrev D := SimplexCategory × SimplexCategory +variable (X : Dᵒᵖ ⥤ Type) +noncomputable def rowIso (q : ℕ) : TotalFiniteness.row (EilenbergZilber.twoComplex X) q ≅ + AlternatingFaceMapComplex.obj (EilenbergZilber.bisimplicial X ⋙ SSet.homologyFunctor Z q) := by + refine HomologicalComplex.Hom.isoOfComponents (fun n => Iso.refl _) ?_ + intro n m hnm + obtain rfl : n=m+1 := hnm.symm + simp only [Iso.refl_hom] + change _ = (homologyFunctor A c q).map + ((AlternatingFaceMapComplex.obj (EilenbergZilber.bisimplicial (X ⋙ sigmaConst.obj Z) ⋙ alternatingFaceMapComplex A)).d (m+1) m) + simp only [AlternatingFaceMapComplex.obj_d_eq,Functor.map_sum,Functor.map_zsmul] + rfl +noncomputable def zeroRowIso (hX : ∀ n, SSet.IsConnected ((EilenbergZilber.bisimplicial X).obj n)) : + TotalFiniteness.row (EilenbergZilber.twoComplex X) 0 ≅ + AlternatingFaceMapComplex.obj ((Functor.const SimplexCategoryᵒᵖ).obj Z) := + rowIso X 0 ≪≫ (alternatingFaceMapComplex A).mapIso + (SimplicialH0.connectedIso (EilenbergZilber.bisimplicial X) hX) +lemma zeroRow_vanish (hX : ∀ n, SSet.IsConnected ((EilenbergZilber.bisimplicial X).obj n)) + (p : ℕ) (hp : p≠0) : IsZero ((TotalFiniteness.row (EilenbergZilber.twoComplex X) 0).homology p) := by + let e := (SimplicialObject.Augmented.ExtraDegeneracy.const Z).homotopyEquiv + exact IsZero.of_iso (AugmentedSplit.uni_isZero p hp) + (((homologyFunctor A c p).mapIso (zeroRowIso X hX)) ≪≫ e.toHomologyIso p) +end BarHomology + +end + +section +open CategoryTheory Limits HomologicalComplex HomologicalComplex₂ SimplicialObject Simplicial Opposite AlgebraicTopology +namespace BarHomology +open FreeChains + +lemma finite_homology (K : ChainComplex A ℕ) (n : ℕ) [Module.Finite ℤ (K.X n)] : + Module.Finite ℤ (K.homology n) := by + have : Module.Finite ℤ (K.cycles n) := + Module.Finite.of_injective (K.iCycles n).hom ((ModuleCat.mono_iff_injective _).mp inferInstance) + exact Module.Finite.of_surjective (K.homologyπ n).hom ((ModuleCat.epi_iff_surjective _).mp inferInstance) +lemma zero_homology (K : ChainComplex A ℕ) (n : ℕ) (hz : IsZero (K.X n)) : + IsZero (K.homology n) := ShortComplex.isZero_homology_of_isZero_X₂ (K.sc n) hz +variable (X : Dᵒᵖ ⥤ Type) +lemma E2_finite (p q : ℕ) [Module.Finite ℤ + (SSet.homology (C:=A) ((EilenbergZilber.bisimplicial X).obj (op ⦋p⦌)) Z q)] : + Module.Finite ℤ ((TotalFiniteness.row (EilenbergZilber.twoComplex X) q).homology p) := by + have : Module.Finite ℤ ((TotalFiniteness.row (EilenbergZilber.twoComplex X) q).X p) := by + change Module.Finite ℤ (SSet.homology (C:=A) ((EilenbergZilber.bisimplicial X).obj (op ⦋p⦌)) Z q) + infer_instance + exact finite_homology _ p +lemma E2_zero (p q : ℕ) (hz : IsZero + (SSet.homology (C:=A) ((EilenbergZilber.bisimplicial X).obj (op ⦋p⦌)) Z q)) : + IsZero ((TotalFiniteness.row (EilenbergZilber.twoComplex X) q).homology p) := + zero_homology _ p hz + +lemma connectivity (d : ℕ) + (hc : ∀ n,SSet.IsConnected ((EilenbergZilber.bisimplicial X).obj n)) + (hz : ∀ q, 0 < q → IsZero (SSet.homology (C:=A) + ((EilenbergZilber.bisimplicial X).obj (op ⦋0⦌)) Z q)) + (hr : ∀ p q, 0 < q → q < d → IsZero (SSet.homology (C:=A) + ((EilenbergZilber.bisimplicial X).obj (op ⦋p⦌)) Z q)) + (n : ℕ) (hn : 0 < n) (hd : n < d+1) : + Subsingleton (SSet.homology (C:=A) (EilenbergZilber.diag ⋙ X) Z n) := by + apply EilenbergZilber.subsingleton_diagonal X n + intro p q hpq + by_cases hq : q=0 + · subst q + exact (ModuleCat.isZero_iff_subsingleton).mp (zeroRow_vanish X hc p (by omega)) + · have h : IsZero ((TotalFiniteness.row (EilenbergZilber.twoComplex X) q).homology p) := by + by_cases hp : p=0 + · subst p; exact E2_zero X 0 q (hz q (by omega)) + · exact E2_zero X p q (hr p q (by omega) (by omega)) + exact (ModuleCat.isZero_iff_subsingleton).mp h + +lemma finite (r : ℕ) + (hc : ∀ n,SSet.IsConnected ((EilenbergZilber.bisimplicial X).obj n)) + (hz : ∀ q, 0 < q → IsZero (SSet.homology (C:=A) + ((EilenbergZilber.bisimplicial X).obj (op ⦋0⦌)) Z q)) + (hr : ∀ p q, 0 < q → q ≤ r → Module.Finite ℤ (SSet.homology (C:=A) + ((EilenbergZilber.bisimplicial X).obj (op ⦋p⦌)) Z q)) + (n : ℕ) (hn : 0 < n) (hd : n ≤ r+1) : + Module.Finite ℤ (SSet.homology (C:=A) (EilenbergZilber.diag ⋙ X) Z n) := by + apply EilenbergZilber.finite_diagonal X n + intro p q hpq + by_cases hq : q=0 + · subst q + have := (ModuleCat.isZero_iff_subsingleton).mp (zeroRow_vanish X hc p (by omega)) + infer_instance + · by_cases hp : p=0 + · subst p + have := (ModuleCat.isZero_iff_subsingleton).mp (E2_zero X 0 q (hz q (by omega))) + infer_instance + · have := hr p q (by omega) (by omega) + exact E2_finite X p q +end BarHomology + +end + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/SmallEvenRouting.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/SmallEvenRouting.lean new file mode 100644 index 0000000000000000000000000000000000000000..3f7c67fecd28afed3766676a0b8bcc05b9d57e87 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/SmallEvenRouting.lean @@ -0,0 +1,166 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.CentralCovers.TemplateRelators +import OAI.GroupTheory.SimpleAmenable.Configurations.DistinctSlotStars +import OAI.GroupTheory.SimpleAmenable.CentralCovers.DistinctSlotFixer +import OAI.GroupTheory.SimpleAmenable.RandomFields.RecoveredConstantCovariance + +namespace OAI + +section +section +open scoped symmDiff +namespace SimpleAmenable +open scoped commutatorElement +open scoped commutatorElement +section SmallEvenRouting + +theorem exists_small_even_reindex {m : ℕ} (hm : 12 ≤ m+1) + (ι κ : Fin 5 ↪ Fin (m+1)) : + ∃ J : Finset (Fin (m+1)), J.card = 12 ∧ + ∃ c : alternatingGroup (Fin (m+1)), c.val.support ⊆ J ∧ + ∀ j, c.val (ι j)=κ j := by + classical + have hc (e : Fin 5 ↪ Fin (m+1)) : (orderedTrackAlphabet e).card=5 := by + simp [orderedTrackAlphabet] + obtain ⟨J,hIJ,_,hJ⟩ := Finset.exists_subsuperset_card_eq + (Finset.subset_univ (orderedTrackAlphabet ι ∪ orderedTrackAlphabet κ)) + (show (orderedTrackAlphabet ι ∪ orderedTrackAlphabet κ).card ≤ 12 from + (Finset.card_union_le _ _).trans (by rw [hc,hc]; decide)) + (show 12 ≤ (Finset.univ : Finset (Fin (m+1))).card by simpa using hm) + let i : Fin 5 ↪ J := ⟨fun j => ⟨ι j,hIJ (Finset.mem_union_left _ (orderedTrackAlphabet_mem ι j))⟩, + fun x y he => ι.injective (congrArg Subtype.val he)⟩ + let k : Fin 5 ↪ J := ⟨fun j => ⟨κ j,hIJ (Finset.mem_union_right _ (orderedTrackAlphabet_mem κ j))⟩, + fun x y he => κ.injective (congrArg Subtype.val he)⟩ + have hcard : Nat.card J = 12 := by rw [Nat.card_eq_fintype_card,Fintype.card_coe,hJ] + have := alternatingGroup.isMultiplyPretransitive J + have : MulAction.IsMultiplyPretransitive (alternatingGroup J) J 5 := + MulAction.isMultiplyPretransitive_of_le (n := Nat.card J - 2) + (by rw [hcard]; decide) (Nat.sub_le _ _) + obtain ⟨c,hc⟩ := MulAction.exists_smul_eq (alternatingGroup J) i k + refine ⟨J,hJ,subtypeAlternatingHom J c, + (subtypeAlternatingHom_mem_range J _).mp ⟨c,rfl⟩,?_⟩ + intro j + have he : c.val (i j)=k j := congrArg (fun e : Fin 5 ↪ J => e j) hc + change Equiv.Perm.ofSubtype c.val (ι j)=κ j + exact (Equiv.Perm.ofSubtype_apply_coe c.val (i j)).trans (congrArg Subtype.val he) + +namespace InitialCoverSystem +variable {a m M : ℕ} {r : CutRing} {hm : 2 ≤ m} + (B : InitialCoverSystem a r m hm M) + +theorem constant_mem_sourceAligned (c : alternatingGroup (Fin (m+1))) + (J : Finset (Fin (m+1))) (hc : c.val.support ⊆ J) : + B.c c ∈ sourceAlignedGroup a r m hm M B.t J := by + obtain ⟨s,rfl⟩ := (subtypeAlternatingHom_mem_range J c).mpr hc + have hh := B.initialAlphabet_aligned J 0 s + rwa [B.initialAlphabet_zero] at hh + +variable [Group.IsPerfect (alternatingGroup (Fin (m+1)))] + (hlarge : 15 < m+1) (h : B.AllPrimitiveLaws) (hr : 0 hb (Finset.mem_union_left _ hh) + have hbκ : b ∉ orderedTrackAlphabet κ := fun hh => hb (Finset.mem_union_right _ hh) + apply B.distinctSlotStar_aligned_transport_with_reindex hlarge h hr R hR ι κ c hc C hcC + b hbι hbκ u v huv F G V J _ z hz hzJ htransport + rw [Finset.card_sdiff_of_subset (Finset.subset_univ _),Finset.card_univ,Fintype.card_fin] + have h₁ := Finset.card_union_le J C + have h₂ := Finset.card_insert_le b (J∪C) + have h₃ := Finset.card_union_le (insert b (J∪C)) (orderedTrackAlphabet ι) + rw [hC] at h₁ + rw [hcard] at h₃ + omega + +end InitialCoverSystem +end SmallEvenRouting + +end SimpleAmenable +end +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/StageCoordinateMaps.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/StageCoordinateMaps.lean new file mode 100644 index 0000000000000000000000000000000000000000..d4e6dfbb2d2058e360457e4176faaff8634b29d6 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/StageCoordinateMaps.lean @@ -0,0 +1,137 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.PowerDiagonal +import OAI.GroupTheory.SimpleAmenable.Homology.StageRefinementHomology +import OAI.GroupTheory.SimpleAmenable.Configurations.EmptyStage + +namespace OAI + +section + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory MonoidalCategory +namespace BarFinitePower +variable (κ:Type) (X:SSet) +def evaluate (k:κ) : (power κ).obj X ⟶ X where + app _ := ↾fun x => x k + naturality _ _ _ := rfl +lemma lift_evaluate {Y:SSet} (f:κ → (Y ⟶ X)) (k:κ) : lift κ f ≫ evaluate κ X k=f k := rfl +end BarFinitePower +namespace SimpleAmenable.PolygonObject.LabelledStage.Stage +open IntervalBar.Diagram BarFinitePower UniformObject + +variable {a n:ℕ} {S T:Stage a n} (h:S≤T) + (c:Fin T.partition.size × Fin T.support.card) +noncomputable def newLabelIso (hc:∀j,S.L j ≠ T.L c.2) : + FiniteSetGroupoid.terminal ⋙ FiniteSetGroupoid.emptyFunctor ≅ + inclusion h ⋙ evaluation (P:=T.partition) (L:=T.L) ⋙ project _ c := + NatIso.ofComponents (fun U => asIso (C := FiniteSetGroupoid) + (X := FiniteSetGroupoid.empty) (Y := E.obj ((inclusion h).obj U) c) + (show FiniteSetGroupoid.empty ⟶ E.obj ((inclusion h).obj U) c from + finCongr (new_label_size h c hc U).symm)) (by + intros; apply Equiv.ext; intro x; exact Fin.elim0 x) +noncomputable instance newLabelIsoMonoidal (hc:∀j,S.L j ≠ T.L c.2) : + NatTrans.IsMonoidal (newLabelIso h c hc).hom where + unit := by apply Equiv.ext; intro x; exact Fin.elim0 x + tensor _ _ := by apply Equiv.ext; intro x; exact Fin.elim0 x +lemma newLabel_homology_zero (hc:∀j,S.L j ≠ T.L c.2) (j:ℕ) (hj:0 ⟨eqToHom (Subsingleton.elim x y)⟩) j hj + rw [hz.eq_of_src (SSet.homologyMap (bar₃Map FiniteSetGroupoid.emptyFunctor) DiagonalResolution.Z j) 0,Limits.comp_zero] +variable (S) +lemma finiteProductComparison_coordinate + (b:Fin S.partition.size × Fin S.support.card) : + S.finiteProductComparison ≫ evaluate _ _ b = + bar₃Map (evaluation (P:=S.partition) (L:=S.L) ⋙ project _ b) := by + rw [finiteProductComparison,Category.assoc] + change bar₃Map UniformObject.evaluation ≫ bar₃Map (project _ b) = _ + rw [←bar₃Map_comp] +variable {S} +lemma refinement_coordinate + (b:Fin S.partition.size × Fin S.support.card) + (hp:S.partition.color (T.partition.point c.1)=b.1) + (hl:S.L b.2=T.L c.2) (j:ℕ) : + SSet.homologyMap (S.finiteProductComparison ≫ evaluate _ _ b) DiagonalResolution.Z j = + SSet.homologyMap (bar₃Map (inclusion h) ≫ T.finiteProductComparison ≫ evaluate _ _ c) + DiagonalResolution.Z j := by + rw [finiteProductComparison_coordinate,finiteProductComparison_coordinate,←bar₃Map_comp] + exact refinement_coordinate_homology h b c hp hl j +lemma refinement_new_label_zero (hc:∀j,S.L j ≠ T.L c.2) (j:ℕ) (hj:0 x (e.symm i) + naturality _ _ _ := rfl } + inv := { app _ := ↾fun x k => x (e k) + naturality _ _ _ := rfl } + hom_inv_id := by apply NatTrans.ext; funext p; apply ConcreteCategory.hom_ext; intro x; funext k; exact congrArg x (e.symm_apply_apply k) + inv_hom_id := by apply NatTrans.ext; funext p; apply ConcreteCategory.hom_ext; intro x; funext i; exact congrArg x (e.apply_symm_apply i) +noncomputable def finSuccIso (s:ℕ) : (power (Fin (s+1))).obj X ≅ X ⊗ (power (Fin s)).obj X where + hom := { app _ := ↾fun x => (x 0,fun i => x i.succ) + naturality _ _ _ := rfl } + inv := { app _ := ↾fun x => Fin.cases x.1 x.2 + naturality _ _ _ := by + apply ConcreteCategory.hom_ext; intro x; funext i + cases i using Fin.cases <;> rfl } + hom_inv_id := by + apply NatTrans.ext; funext p; apply ConcreteCategory.hom_ext; intro x; funext i + cases i using Fin.cases <;> rfl + inv_hom_id := by ext p x <;> rfl +noncomputable def finZeroIso : (power (Fin 0)).obj X ≅ ConnectedProduct.one where + hom := { app _ := ↾fun _ => PUnit.unit + naturality _ _ _ := rfl } + inv := + { app _ := ↾fun _ => Fin.elim0 + naturality _ _ _ := by apply ConcreteCategory.hom_ext; intro x; funext i; exact i.elim0 } + hom_inv_id := by apply NatTrans.ext; funext p; apply ConcreteCategory.hom_ext; intro x; funext i; exact i.elim0 + inv_hom_id := by ext p x; rfl +lemma connected_of_iso {Y:SSet} (e:X≅Y) [Y.IsConnected] : X.IsConnected where + allEq x y := by + have he := congrArg (SSet.mapπ₀ e.inv) (Subsingleton.elim (SSet.mapπ₀ e.hom x) (SSet.mapπ₀ e.hom y)) + simpa only [←SSet.mapπ₀_comp_apply,Iso.hom_inv_id,SSet.mapπ₀_id_apply] using he + nonempty := ⟨e.inv.app _ (Classical.arbitrary _)⟩ +instance connected_one : ConnectedProduct.one.IsConnected where + allEq x y := by + obtain ⟨x,rfl⟩ := SSet.π₀.mk_surjective x + obtain ⟨y,rfl⟩ := SSet.π₀.mk_surjective y + exact congrArg SSet.π₀.mk (show x=y from PUnit.ext x y) + nonempty := ⟨PUnit.unit⟩ +lemma fin_connected [X.IsConnected] (s:ℕ) : ((power (Fin s)).obj X).IsConnected := by + induction s with + | zero => exact connected_of_iso _ (finZeroIso X) + | succ s ih => + have connectedPower := ih + exact connected_of_iso _ (finSuccIso X s) +noncomputable instance connected (κ:Type) [Finite κ] [X.IsConnected] : ((power κ).obj X).IsConnected := by + let finiteCoordinates := Fintype.ofFinite κ + have connectedPower := fin_connected X (Fintype.card κ) + exact connected_of_iso _ (reindexIso X (Fintype.equivFin κ)) +lemma homology_zero_finite [X.IsConnected] : Module.Finite ℤ (X.homology DiagonalResolution.Z 0 : FreeChains.A) := + Module.Finite.equiv (asIso (X.homology₀ε DiagonalResolution.Z)).symm.toLinearEquiv +lemma homology_isZero_complex (q:ℕ) (h:IsZero (X.homology DiagonalResolution.Z q)) : + IsZero ((FreeChains.complex X).homology q) := + IsZero.of_iso h ((HomologicalComplex.homologyFunctor FreeChains.A FreeChains.c q).mapIso (FreeChains.complexIso X)).symm +lemma homology_finite_complex (q:ℕ) [Module.Finite ℤ (X.homology DiagonalResolution.Z q : FreeChains.A)] : + Module.Finite ℤ ((FreeChains.complex X).homology q) := by + have finiteHomology : Module.Finite ℤ ((X.chainComplex FreeChains.Z).homology q : FreeChains.A) := ‹Module.Finite ℤ (X.homology DiagonalResolution.Z q : FreeChains.A)› + exact (Module.Finite.equiv_iff ((HomologicalComplex.homologyFunctor FreeChains.A FreeChains.c q).mapIso (FreeChains.complexIso X)).toLinearEquiv).mp ‹Module.Finite ℤ ((X.chainComplex FreeChains.Z).homology q : FreeChains.A)› +end BarFinitePower + +end + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/StageMonoidal.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/StageMonoidal.lean new file mode 100644 index 0000000000000000000000000000000000000000..5a68ef5ceea50eec49f64e19b863a0fef1827347 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/StageMonoidal.lean @@ -0,0 +1,109 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Configurations.StageFiberSum + +namespace OAI + +section + +section +open CategoryTheory Classical MonoidalCategory +namespace SimpleAmenable.PolygonObject.LabelledStage.UniformObject + +variable {a n s : ℕ} {P : BooleanPartition a} {L : Fin s → Fin n → CutRing × CutRing} +noncomputable def muEval (U V : UniformObject P L) (b : Fin P.size × Fin s) : + FiniteSetGroupoid.sum (E.obj U b) (E.obj V b) ⟶ E.obj (sum U V) b := mu U V b +@[simp] lemma muEval_inl (U V : UniformObject P L) (b : Fin P.size × Fin s) (x : Fiber U b) : + muEval U V b (FiniteSetGroupoid.sumEquiv _ _ (.inl (enumerate U b x)))= + enumerate (sum U V) b (fiberSum U V b (.inl x)) := mu_inl U V b x +@[simp] lemma muEval_inr (U V : UniformObject P L) (b : Fin P.size × Fin s) (x : Fiber V b) : + muEval U V b (FiniteSetGroupoid.sumEquiv _ _ (.inr (enumerate V b x)))= + enumerate (sum U V) b (fiberSum U V b (.inr x)) := mu_inr U V b x +noncomputable def epsEval (b : Fin P.size × Fin s) : + FiniteSetGroupoid.empty ⟶ E.obj (empty (P:=P) (L:=L)) b := eps b +lemma mu_assoc (U V W : UniformObject P L) : + mu U V ▷ E.obj W ≫ mu (U⊗V) W ≫ E.map (α_ U V W).hom = + (α_ (E.obj U) (E.obj V) (E.obj W)).hom ≫ E.obj U ◁ mu V W ≫ mu U (V⊗W) := by + funext b + apply Equiv.ext + intro x + change E.map (assocHom U V W) b (muEval (sum U V) W b + (FiniteSetGroupoid.sumHom (muEval U V b) (𝟙 (E.obj W b)) x)) = + muEval U (sum V W) b (FiniteSetGroupoid.sumHom (𝟙 (E.obj U b)) (muEval V W b) + (FiniteSetGroupoid.assoc (E.obj U b) (E.obj V b) (E.obj W b) x)) + obtain ⟨x,rfl⟩ := (FiniteSetGroupoid.sumEquiv (FiniteSetGroupoid.sum (E.obj U b) (E.obj V b)) (E.obj W b)).surjective x + cases x with + | inl x => + obtain ⟨x,rfl⟩ := (FiniteSetGroupoid.sumEquiv (E.obj U b) (E.obj V b)).surjective x + cases x with + | inl x => + obtain ⟨x,rfl⟩ := (enumerate U b).surjective x + rw [FiniteSetGroupoid.sumHom_inl (muEval U V b) (𝟙 (E.obj W b)),muEval_inl,muEval_inl,E_map_enum,fiber_assoc_left, + FiniteSetGroupoid.assoc_left,FiniteSetGroupoid.sumHom_inl,FiniteSetGroupoid.id_apply,muEval_inl] + | inr x => + obtain ⟨x,rfl⟩ := (enumerate V b).surjective x + rw [FiniteSetGroupoid.sumHom_inl (muEval U V b) (𝟙 (E.obj W b)),muEval_inr,muEval_inl,E_map_enum,fiber_assoc_mid, + FiniteSetGroupoid.assoc_mid,FiniteSetGroupoid.sumHom_inr,muEval_inl,muEval_inr] + | inr x => + obtain ⟨x,rfl⟩ := (enumerate W b).surjective x + rw [FiniteSetGroupoid.sumHom_inr (muEval U V b) (𝟙 (E.obj W b)),FiniteSetGroupoid.id_apply,muEval_inr,E_map_enum,fiber_assoc_right, + FiniteSetGroupoid.assoc_right,FiniteSetGroupoid.sumHom_inr,muEval_inr,muEval_inr] +lemma eps_left (U : UniformObject P L) : + (λ_ (E.obj U)).hom = eps ▷ E.obj U ≫ mu (𝟙_ _) U ≫ E.map (λ_ U).hom := by + funext b + apply Equiv.ext + intro x + change FiniteSetGroupoid.left (E.obj U b) x = E.map (leftHom U) b + (muEval empty U b (FiniteSetGroupoid.sumHom (epsEval b) (𝟙 (E.obj U b)) x)) + obtain ⟨x,rfl⟩ := (FiniteSetGroupoid.sumEquiv FiniteSetGroupoid.empty (E.obj U b)).surjective x + cases x with + | inl x => exact Fin.elim0 x + | inr x => + obtain ⟨x,rfl⟩ := (enumerate U b).surjective x + rw [FiniteSetGroupoid.left_apply,FiniteSetGroupoid.sumHom_inr (epsEval b) (𝟙 (E.obj U b)), + FiniteSetGroupoid.id_apply,muEval_inr,E_map_enum,fiber_left] +lemma eps_right (U : UniformObject P L) : + (ρ_ (E.obj U)).hom = E.obj U ◁ eps ≫ mu U (𝟙_ _) ≫ E.map (ρ_ U).hom := by + funext b + apply Equiv.ext + intro x + change FiniteSetGroupoid.right (E.obj U b) x = E.map (rightHom U) b + (muEval U empty b (FiniteSetGroupoid.sumHom (𝟙 (E.obj U b)) (epsEval b) x)) + obtain ⟨x,rfl⟩ := (FiniteSetGroupoid.sumEquiv (E.obj U b) FiniteSetGroupoid.empty).surjective x + cases x with + | inl x => + obtain ⟨x,rfl⟩ := (enumerate U b).surjective x + rw [FiniteSetGroupoid.right_apply,FiniteSetGroupoid.sumHom_inl (𝟙 (E.obj U b)) (epsEval b), + FiniteSetGroupoid.id_apply,muEval_inl,E_map_enum,fiber_right] + | inr x => exact Fin.elim0 x +noncomputable instance evaluationMonoidal : (evaluation (P:=P) (L:=L)).Monoidal := + Functor.CoreMonoidal.toMonoidal { + εIso := asIso eps + μIso U V := asIso (mu U V) + μIso_hom_natural_left := by intro U V f W; simpa using mu_natural f (𝟙 W) + μIso_hom_natural_right := by intro U V W f; simpa using mu_natural (𝟙 W) f + associativity := mu_assoc + left_unitality := eps_left + right_unitality := eps_right } +noncomputable instance evaluationBraided : (evaluation (P:=P) (L:=L)).Braided where + braided U V := by + change mu U V ≫ E.map (swapHom U V) = (β_ (E.obj U) (E.obj V)).hom ≫ mu V U + funext b + apply Equiv.ext + intro x + change E.map (swapHom U V) b (muEval U V b x) = + muEval V U b (FiniteSetGroupoid.swap (E.obj U b) (E.obj V b) x) + obtain ⟨x,rfl⟩ := (FiniteSetGroupoid.sumEquiv (E.obj U b) (E.obj V b)).surjective x + cases x with + | inl x => + obtain ⟨x,rfl⟩ := (enumerate U b).surjective x + rw [muEval_inl,E_map_enum,fiber_swap_left,FiniteSetGroupoid.swap_left,muEval_inr] + | inr x => + obtain ⟨x,rfl⟩ := (enumerate V b).surjective x + rw [muEval_inr,E_map_enum,fiber_swap_right,FiniteSetGroupoid.swap_right,muEval_inl] +end SimpleAmenable.PolygonObject.LabelledStage.UniformObject + +end + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/StageNerveColimit.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/StageNerveColimit.lean new file mode 100644 index 0000000000000000000000000000000000000000..ec7effb429589f1cab33629ba002e8c5ddeea695 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/StageNerveColimit.lean @@ -0,0 +1,188 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Configurations.StageDiagramCoverage +import OAI.GroupTheory.SimpleAmenable.Simplicial.IntervalEquivalence + +namespace OAI + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory CategoryTheory.Limits Opposite +namespace StageNerveColimit + +universe u v w +lemma comp_injective {C : Type u} {D : Type v} {K : Type w} + [Category C] [Category D] [Category K] (F : C ⥤ D) [F.Faithful] + (hF : Function.Injective F.obj) : Function.Injective (fun G : K ⥤ C => G ⋙ F) := by + intro G H h + refine CategoryTheory.Functor.ext (fun X => hF (Functor.congr_obj h X)) ?_ + intro X Y f + apply F.map_injective + simpa only [Functor.comp_map,Functor.comp_obj,Functor.map_comp,eqToHom_map] using Functor.congr_hom h f +end StageNerveColimit +namespace SimpleAmenable.PolygonObject.LabelledStage.Stage +variable {a n : ℕ} +noncomputable def nerveCocone : Cocone (diagram (a:=a) (n:=n) ⋙ nerveFunctor) := + nerveFunctor.mapCocone cocone +noncomputable def nerveIsColimit : IsColimit (nerveCocone (a:=a) (n:=n)) := by + apply evaluationJointlyReflectsColimits + intro p + apply Types.FilteredColimit.isColimitOf' + · intro x + obtain ⟨S,G,h⟩ := exists_lift x + exact ⟨S,G,h.symm⟩ + · intro S x y h + have he : x=y := StageNerveColimit.comp_injective S.forget (forget_injective S) h + exact ⟨S,𝟙 S,congrArg _ he⟩ +end SimpleAmenable.PolygonObject.LabelledStage.Stage + +end + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory MonoidalCategory +namespace SimpleAmenable.PolygonObject.LabelledStage.Stage + +variable {a n : ℕ} {S T : Stage a n} (h : S≤T) +noncomputable instance inclusionMonoidal : (inclusion h).Monoidal := + Functor.CoreMonoidal.toMonoidal { + εIso := Iso.refl _ + μIso U V := Iso.refl _ + μIso_hom_natural_left := by intros; apply UniformObject.Hom.ext; simp; rfl + μIso_hom_natural_right := by intros; apply UniformObject.Hom.ext; simp; rfl + associativity := by + intro first second third + apply UniformObject.Hom.ext + change (Labelled.sumHom (𝟙 _) (𝟙 _) ≫ 𝟙 _ ≫ + Labelled.assocHom first.obj second.obj third.obj) = + (Labelled.assocHom first.obj second.obj third.obj ≫ Labelled.sumHom (𝟙 _) (𝟙 _) ≫ 𝟙 _) + simp only [Labelled.sumHom_id,Category.id_comp,Category.comp_id] + left_unitality := by + intro object + apply UniformObject.Hom.ext + change Labelled.leftHom object.obj = + Labelled.sumHom (𝟙 _) (𝟙 _) ≫ 𝟙 _ ≫ Labelled.leftHom object.obj + simp only [Labelled.sumHom_id,Category.id_comp] + right_unitality := by + intro object + apply UniformObject.Hom.ext + change Labelled.rightHom object.obj = + Labelled.sumHom (𝟙 _) (𝟙 _) ≫ 𝟙 _ ≫ Labelled.rightHom object.obj + simp only [Labelled.sumHom_id,Category.id_comp] } +noncomputable instance inclusionBraided : (inclusion h).Braided where + braided U V := by + change (𝟙 _ ≫ (inclusion h).map (β_ U V).hom) = (β_ ((inclusion h).obj U) ((inclusion h).obj V)).hom ≫ 𝟙 _ + simp only [Category.id_comp,Category.comp_id] + apply UniformObject.Hom.ext + rfl +@[simp] lemma inclusion_η : Functor.OplaxMonoidal.η (inclusion h)=𝟙 _ := rfl +@[simp] lemma inclusion_ε : Functor.LaxMonoidal.ε (inclusion h)=𝟙 _ := rfl +@[simp] lemma inclusion_μ (U V : S.Obj) : Functor.LaxMonoidal.μ (inclusion h) U V=𝟙 _ := rfl +end SimpleAmenable.PolygonObject.LabelledStage.Stage + +namespace IntervalBar.Diagram + +universe u v w u' v' +variable {C : Type u} [Groupoid.{v} C] [MonoidalCategory C] + {D : Type u'} [Groupoid.{v'} D] [MonoidalCategory D] + {I : Type w} [Preorder I] +lemma map_obj_injective (F : C ⥤ D) [F.Monoidal] [F.Faithful] + (hF : Function.Injective F.obj) : Function.Injective (map (I:=I) F).obj := by + intro A B h + have ho : A.obj=B.obj := by + funext i j hij + apply hF + exact congrArg (fun X => X.obj i j hij) h + have hu : HEq ((map F).obj A).unit ((map F).obj B).unit := by rw [h] + have hc : HEq ((map F).obj A).cut ((map F).obj B).cut := by rw [h] + cases A with + | mk ao au ac al ar aa => + cases B with + | mk bo bu bc bl br ba => + dsimp at ho + cases ho + refine ext_heq (A:=⟨ao,au,ac,al,ar,aa⟩) (B:=⟨ao,bu,bc,bl,br,ba⟩) rfl ?_ ?_ + · apply heq_of_eq + funext i + apply Iso.ext + apply F.map_injective + have he := congrArg (fun u => (u i).hom) (eq_of_heq hu) + dsimp [map,mapObj] at he + exact (cancel_mono (Functor.OplaxMonoidal.η F)).mp he + · apply heq_of_eq + funext i j k hij hjk + apply Iso.ext + apply F.map_injective + have he := congrArg (fun c => (c i j k hij hjk).hom) (eq_of_heq hc) + dsimp [map,mapObj] at he + exact (cancel_epi (Functor.LaxMonoidal.μ F _ _)).mp he +end IntervalBar.Diagram + +end + +open _root_.CategoryTheory _root_.OAI.CategoryTheory CategoryTheory.Limits MonoidalCategory Opposite +namespace SimpleAmenable.PolygonObject.LabelledStage.Stage +open IntervalBar IntervalBar.Diagram + +variable {a n : ℕ} {I : Type} [Preorder I] +lemma map_inclusion_id (S : Stage a n) : Diagram.map (I:=I) (inclusion (le_refl S))=𝟭 _ := by + refine CategoryTheory.Functor.ext (fun A => ?_) ?_ + · refine ext_heq rfl ?_ ?_ + · apply heq_of_eq; funext i; apply Iso.ext; apply UniformObject.Hom.ext + simp [Diagram.map,mapObj]; rfl + · apply heq_of_eq; funext i j k hij hjk; apply Iso.ext; apply UniformObject.Hom.ext + simp [Diagram.map,mapObj]; rfl + · intro source target arrow; apply Hom.ext; intro first last ordered + simp only [comp_app,Diagram.eqToHom_app] + change arrow.app first last ordered = 𝟙 _ ≫ arrow.app first last ordered ≫ 𝟙 _ + simp +lemma map_inclusion_comp {S T U : Stage a n} (h : S≤T) (k : T≤U) : + Diagram.map (I:=I) (inclusion (h.trans k)) = Diagram.map (inclusion h) ⋙ Diagram.map (inclusion k) := by + refine CategoryTheory.Functor.ext (fun A => ?_) ?_ + · refine ext_heq rfl ?_ ?_ + · apply heq_of_eq; funext i; apply Iso.ext; apply UniformObject.Hom.ext + simp [Diagram.map,mapObj]; rfl + · apply heq_of_eq; funext i j k hij hjk; apply Iso.ext; apply UniformObject.Hom.ext + simp [Diagram.map,mapObj]; rfl + · intro source target arrow; apply Hom.ext; intro first last ordered + simp only [comp_app,Diagram.eqToHom_app] + change (inclusion (h.trans k)).map (arrow.app first last ordered) = + 𝟙 _ ≫ (inclusion (h.trans k)).map (arrow.app first last ordered) ≫ 𝟙 _ + simp +lemma map_inclusion_forget {S T : Stage a n} (h : S≤T) : + Diagram.map (I:=I) (inclusion h) ⋙ Diagram.map T.forget=Diagram.map S.forget := by + refine CategoryTheory.Functor.ext (fun A => ?_) ?_ + · refine ext_heq rfl ?_ ?_ + · apply heq_of_eq; funext i; apply Iso.ext + simp [Diagram.map,mapObj]; rfl + · apply heq_of_eq; funext i j k hij hjk; apply Iso.ext + simp [Diagram.map,mapObj]; rfl + · intro source target arrow; apply Hom.ext; intro first last ordered + simp only [comp_app,Diagram.eqToHom_app] + change S.forget.map (arrow.app first last ordered) = + 𝟙 _ ≫ S.forget.map (arrow.app first last ordered) ≫ 𝟙 _ + simp +noncomputable def barStage : Stage a n ⥤ Cat.{0,0} where + obj S := Cat.of (Diagram S.Obj I) + map h := (Diagram.map (inclusion (leOfHom h))).toCatHom + map_id S := by apply Cat.ext; exact map_inclusion_id S + map_comp h k := by apply Cat.ext; exact map_inclusion_comp (leOfHom h) (leOfHom k) +noncomputable def barCocone : Cocone (barStage (a:=a) (n:=n) (I:=I)) where + pt := Cat.of (Diagram (Labelled a n) I) + ι := { + app S := (Diagram.map S.forget).toCatHom + naturality S T h := by apply Cat.ext; exact map_inclusion_forget (leOfHom h) } +noncomputable def barNerveCocone : Cocone (barStage (a:=a) (n:=n) (I:=I) ⋙ nerveFunctor) := + nerveFunctor.mapCocone barCocone +noncomputable def barNerveIsColimit (p : ℕ) : + IsColimit (barNerveCocone (a:=a) (n:=n) (I:=Fin (p+1))) := by + apply evaluationJointlyReflectsColimits + intro q + apply Types.FilteredColimit.isColimitOf' + · intro x + obtain ⟨S,G,h⟩ := exists_lift_diagram_family x + exact ⟨S,G,h.symm⟩ + · intro S x y h + have he : x=y := StageNerveColimit.comp_injective (Diagram.map S.forget) + (map_obj_injective S.forget (forget_injective S)) h + exact ⟨S,𝟙 S,congrArg _ he⟩ +end SimpleAmenable.PolygonObject.LabelledStage.Stage + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/StageRefinementMonoidal.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/StageRefinementMonoidal.lean new file mode 100644 index 0000000000000000000000000000000000000000..adf97227ee4b758b826963bf5ffd0ea33e27a00c --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/StageRefinementMonoidal.lean @@ -0,0 +1,154 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Configurations.StageRefinement +import OAI.GroupTheory.SimpleAmenable.Simplicial.StageMonoidal + +namespace OAI + +section + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Classical MonoidalCategory +namespace SimpleAmenable.PolygonObject.LabelledStage.Stage +open UniformObject BarFinitePower + +variable {a n : ℕ} {S T : Stage a n} (h : S≤T) +variable (b : Fin S.partition.size × Fin S.support.card) + (c : Fin T.partition.size × Fin T.support.card) + (hp : S.partition.color (T.partition.point c.1)=b.1) + (hl : S.L b.2=T.L c.2) + +lemma refineFiber_sum_inl (U V : S.Obj) (x : Fiber U b) : + refineFiber h b c hp hl (UniformObject.sum U V) (fiberSum U V b (.inl x)) = + fiberSum ((inclusion h).obj U) ((inclusion h).obj V) c + (.inl (refineFiber h b c hp hl U x)) := rfl +lemma refineFiber_sum_inr (U V : S.Obj) (x : Fiber V b) : + refineFiber h b c hp hl (UniformObject.sum U V) (fiberSum U V b (.inr x)) = + fiberSum ((inclusion h).obj U) ((inclusion h).obj V) c + (.inr (refineFiber h b c hp hl V x)) := rfl +lemma refineEvaluationIso_enum (U : S.Obj) (x : Fiber U b) : + (refineEvaluationIso h b c hp hl).hom.app U (enumerate U b x) = + enumerate ((inclusion h).obj U) c (refineFiber h b c hp hl U x) := by + change enumerate ((inclusion h).obj U) c (refineFiber h b c hp hl U + ((enumerate U b).symm (enumerate U b x)))=_ + rw [Equiv.symm_apply_apply] + +instance refineEvaluationIso_monoidal : NatTrans.IsMonoidal (refineEvaluationIso h b c hp hl).hom where + unit := by + apply Equiv.ext + intro x + exact Fin.elim0 x + tensor U V := by + simp only [Functor.LaxMonoidal.comp_μ, inclusion_μ] + change ((𝟙 _ ≫ mu U V b) ≫ _) = (_ ≫ (𝟙 _ ≫ mu ((inclusion h).obj U) ((inclusion h).obj V) c) ≫ + (E.map (𝟙 ((inclusion h).obj U ⊗ (inclusion h).obj V))) c) + rw [CategoryTheory.Functor.map_id] + simp only [Category.id_comp] + apply Equiv.ext + intro x + change (refineEvaluationIso h b c hp hl).hom.app (UniformObject.sum U V) (mu U V b x) = + mu ((inclusion h).obj U) ((inclusion h).obj V) c + (FiniteSetGroupoid.sumHom ((refineEvaluationIso h b c hp hl).hom.app U) + ((refineEvaluationIso h b c hp hl).hom.app V) x) + obtain ⟨x,rfl⟩ := (FiniteSetGroupoid.sumEquiv (E.obj U b) (E.obj V b)).surjective x + cases x with + | inl x => + obtain ⟨x,rfl⟩ := (enumerate U b).surjective x + erw [mu_inl,refineEvaluationIso_enum,refineFiber_sum_inl,FiniteSetGroupoid.sumHom_inl, + refineEvaluationIso_enum,mu_inl] + rfl + | inr x => + obtain ⟨x,rfl⟩ := (enumerate V b).surjective x + erw [mu_inr,refineEvaluationIso_enum,refineFiber_sum_inr,FiniteSetGroupoid.sumHom_inr, + refineEvaluationIso_enum,mu_inr] + rfl +end SimpleAmenable.PolygonObject.LabelledStage.Stage + +end + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory MonoidalCategory Simplicial Opposite +open Functor.LaxMonoidal Functor.OplaxMonoidal +namespace IntervalBar.Diagram + +universe u v u' v' w +variable {C : Type u} [Groupoid.{v} C] [MonoidalCategory C] [SymmetricCategory C] + {D : Type u'} [Groupoid.{v'} D] [MonoidalCategory D] [SymmetricCategory D] + {F G : C ⥤ D} [F.Braided] [G.Braided] + {I : Type w} [Preorder I] +lemma monoidalNatTrans_eta (α : F ⟶ G) [NatTrans.IsMonoidal α] : + α.app (𝟙_ C) ≫ η G=η F := by + apply (cancel_epi (ε F)).mp + rw [←Category.assoc,NatTrans.IsMonoidal.unit,Functor.Monoidal.ε_η,Functor.Monoidal.ε_η] + +noncomputable def mapNatTrans (α : F ⟶ G) [NatTrans.IsMonoidal α] : + map (I:=I) F ⟶ map G where + app A := { + app i j h := α.app (A.obj i j h) + unit i := by + change α.app _ ≫ (G.map (A.unit i).hom ≫ η G) = F.map (A.unit i).hom ≫ η F + rw [←Category.assoc,←α.naturality,Category.assoc,monoidalNatTrans_eta] + cut i j k hij hjk := by + change (α.app _ ⊗ₘ α.app _) ≫ (μ G _ _ ≫ G.map (A.cut i j k hij hjk).hom)= + (μ F _ _ ≫ F.map (A.cut i j k hij hjk).hom) ≫ α.app _ + rw [←Category.assoc,←NatTrans.IsMonoidal.tensor,Category.assoc,←α.naturality,Category.assoc] } + naturality _ _ f := by + apply Hom.ext + intro i j h + exact α.naturality (f.app i j h) + +instance mapNatTrans_monoidal (α : F ⟶ G) [NatTrans.IsMonoidal α] : + NatTrans.IsMonoidal (mapNatTrans (I:=I) α) where + unit := by + apply Hom.ext + intro i j h + exact NatTrans.IsMonoidal.unit (τ:=α) + tensor A B := by + apply Hom.ext + intro i j h + exact NatTrans.IsMonoidal.tensor (τ:=α) _ _ +end IntervalBar.Diagram + +end + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory +namespace NerveHomotopy +universe u v +variable {C D C' D' : Type u} [Category.{v} C] [Category.{v} D] + [Category.{v} C'] [Category.{v} D'] +lemma functor_map_heq {H K : C ⥤ D} (h:H=K) {X Y:C} (f:X⟶Y) : HEq (H.map f) (K.map f) := by cases h; rfl +lemma comp_heq {X Y Z X' Y' Z' : D} (hX:X=X') (hY:Y=Y') (hZ:Z=Z') + {f:X⟶Y} {g:Y⟶Z} {f':X'⟶Y'} {g':Y'⟶Z'} (hf:HEq f f') (hg:HEq g g') : + HEq (f≫g) (f'≫g') := by subst X';subst Y';subst Z'; cases hf;cases hg;rfl +variable {F G : C ⥤ D} {F' G' : C' ⥤ D'} +variable (R:C⥤C') (S:D⥤D') (α:F⟶G) (α':F'⟶G') + (eF:F⋙S=R⋙F') (eG:G⋙S=R⋙G') + (eα:∀ X,HEq (S.map (α.app X)) (α'.app (R.obj X))) +include eF eG eα +lemma cylinder_natural : cylinder α ⋙ S = R.prod (𝟭 (Fin 2)) ⋙ cylinder α' := by + apply CategoryTheory.Functor.hext + · rintro ⟨X,i⟩ + fin_cases i + · exact congrArg (fun H=>H.obj X) eF + · exact congrArg (fun H=>H.obj X) eG + · rintro ⟨X,i⟩ ⟨Y,j⟩ f + have hij : i≤j := leOfHom f.2 + fin_cases i <;> fin_cases j + · change HEq (S.map (F.map f.1 ≫ 𝟙 _)) (F'.map (R.map f.1) ≫ 𝟙 _) + simp only [Category.comp_id] + exact functor_map_heq eF f.1 + · change HEq (S.map (F.map f.1 ≫ α.app Y)) (F'.map (R.map f.1) ≫ α'.app (R.obj Y)) + rw [S.map_comp] + exact comp_heq (congrArg (fun H=>H.obj X) eF) (congrArg (fun H=>H.obj Y) eF) + (congrArg (fun H=>H.obj Y) eG) (functor_map_heq eF f.1) (eα Y) + · simp at hij + · change HEq (S.map (G.map f.1 ≫ 𝟙 _)) (G'.map (R.map f.1) ≫ 𝟙 _) + simp only [Category.comp_id] + exact functor_map_heq eG f.1 +end NerveHomotopy + +end + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/StageSimplicialColimit.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/StageSimplicialColimit.lean new file mode 100644 index 0000000000000000000000000000000000000000..c688b8cc1ec6b7db34fc207afaf4ad057a3f7b99 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/StageSimplicialColimit.lean @@ -0,0 +1,183 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.TripleBarMaps +import OAI.GroupTheory.SimpleAmenable.Simplicial.StageTripleHomology + +namespace OAI + +section + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits MonoidalCategory Simplicial Opposite +namespace SimpleAmenable.PolygonObject.LabelledStage.Stage +open IntervalBar IntervalBar.Diagram ColimitTransfer + +variable {a n : ℕ} (p q : ℕ) +noncomputable def degreeRowsStage : Stage a n ⥤ (SimplexCategoryᵒᵖ ⥤ Cat.{0,0}) where + obj S := simplicial (C:=Diagram (Diagram S.Obj (Fin (p+1))) (Fin (q+1))) + map h := simplicialMap (Diagram.map (I:=Fin (q+1)) (Diagram.map (I:=Fin (p+1)) (inclusion (leOfHom h)))) + map_id S := by + apply NatTrans.ext; funext r; apply Cat.ext + exact map₃_inclusion_id r.unop.len q p S + map_comp h k := by + apply NatTrans.ext; funext r; apply Cat.ext + exact map₃_inclusion_comp r.unop.len q p (leOfHom h) (leOfHom k) +noncomputable def degreeRowsCocone : Cocone (degreeRowsStage (a:=a) (n:=n) p q) where + pt := simplicial (C:=Diagram (Diagram (Labelled a n) (Fin (p+1))) (Fin (q+1))) + ι := { + app S := simplicialMap (Diagram.map (I:=Fin (q+1)) (Diagram.map (I:=Fin (p+1)) S.forget)) + naturality S T h := by + apply NatTrans.ext; funext r; apply Cat.ext + exact map₃_inclusion_forget r.unop.len q p (leOfHom h) } +noncomputable def degreeHomologyIsColimit (r : SimplexCategoryᵒᵖ) (k:ℕ) : + IsColimit (((evaluation SimplexCategoryᵒᵖ Cat).obj r ⋙ H k).mapCocone + (degreeRowsCocone (a:=a) (n:=n) p q)) := by + let u : degreeRowsStage (a:=a) (n:=n) p q ⋙ (evaluation SimplexCategoryᵒᵖ Cat).obj r ⋙ H k ≅ + tripleHomologyStage r.unop.len q p k := + NatIso.ofComponents (fun _ => Iso.refl _) (by + intro S T h + simp only [Iso.refl_hom] + exact (tripleHomologyStage_map r.unop.len q p k h).symm) + let pointIso : (((evaluation SimplexCategoryᵒᵖ Cat).obj r ⋙ H k).mapCocone + (degreeRowsCocone (a:=a) (n:=n) p q)).pt ≅ + (tripleHomologyCocone r.unop.len q p k).pt := Iso.refl _ + apply ofIsos _ (tripleHomologyCocone r.unop.len q p k) u.hom pointIso.hom _ + (tripleHomologyIsColimit r.unop.len q p k) + intro S + change (H k).map (Diagram.map (I:=Fin (r.unop.len+1)) + (Diagram.map (I:=Fin (q+1)) (Diagram.map (I:=Fin (p+1)) S.forget))).toCatHom ≫ 𝟙 _ = + (𝟙 _) ≫ (tripleHomologyCocone r.unop.len q p k).ι.app S + rw [Category.comp_id,Category.id_comp] + exact (tripleHomologyCocone_ι r.unop.len q p k S).symm +end SimpleAmenable.PolygonObject.LabelledStage.Stage + +end + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits Simplicial Opposite +namespace SimplicialDiagonal + +variable {J : Type} [Category.{0} J] [IsFiltered J] +noncomputable instance diagonal_preserves : PreservesColimitsOfShape J diagonal := by + apply preservesColimitsOfShape_of_evaluation + intro p + change PreservesColimitsOfShape J (((evaluation I SSet).obj p) ⋙ (evaluation I (Type)).obj p) + infer_instance +omit [IsFiltered J] in +lemma isIso_of_colimit_fac {A : Type*} [Category A] {F : J ⥤ A} + {s t : Cocone F} (hs : IsColimit s) (ht : IsColimit t) (u : s.pt ⟶ t.pt) + (hu : ∀ j,s.ι.app j ≫ u=t.ι.app j) : IsIso u := by + have he : u=(hs.coconePointUniqueUpToIso ht).hom := by + apply hs.hom_ext + intro j + rw [hu] + exact (hs.fac t j).symm + rw [he] + infer_instance +noncomputable def diagonalHomologyIsColimit {F : J ⥤ (I ⥤ SSet)} (t : Cocone F) + (ht : ∀ p q, IsColimit (((evaluation I SSet).obj p ⋙ + SSet.homologyFunctor DiagonalResolution.Z q).mapCocone t)) (n:ℕ) : + IsColimit ((diagonal ⋙ SSet.homologyFunctor DiagonalResolution.Z n).mapCocone t) := by + let s := colimit.cocone F + let u : s.pt ⟶ t.pt := colimit.desc F t + have hrow (p:I) (q:ℕ) : IsIso (SSet.homologyMap (u.app p) DiagonalResolution.Z q) := by + apply isIso_of_colimit_fac + (isColimitOfPreserves ((evaluation I SSet).obj p ⋙ SSet.homologyFunctor DiagonalResolution.Z q) + (colimit.isColimit F)) (ht p q) + intro j + change SSet.homologyMap ((s.ι.app j).app p) _ _ ≫ SSet.homologyMap (u.app p) _ _ = _ + rw [←SSet.homologyMap_comp] + have hu : s.ι.app j ≫ u=t.ι.app j := colimit.ι_desc t j + have hv := congrArg (fun f : F.obj j ⟶ t.pt => f.app p) hu + exact congrArg (fun f => SSet.homologyMap f DiagonalResolution.Z q) hv + haveI := homologyMap_isIso u hrow n + let G := diagonal ⋙ SSet.homologyFunctor DiagonalResolution.Z n + change IsColimit (G.mapCocone t) + haveI : IsIso (G.map u) := homologyMap_isIso u hrow n + refine IsColimit.ofIsoColimit (isColimitOfPreserves G (colimit.isColimit F)) + (Cocone.ext (c := G.mapCocone s) (c' := G.mapCocone t) (asIso (G.map u)) ?_) + intro j + change G.map (s.ι.app j) ≫ G.map u = G.map (t.ι.app j) + rw [←Functor.map_comp] + exact congrArg G.map (colimit.ι_desc t j) +end SimplicialDiagonal + +end + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits MonoidalCategory Simplicial Opposite +namespace SimpleAmenable.PolygonObject.LabelledStage.Stage +open IntervalBar IntervalBar.Diagram ColimitTransfer SimplicialDiagonal + +variable {a n : ℕ} +noncomputable def degreeBarHomologyIsColimit (p q k:ℕ) : + IsColimit ((nerveDiagonal ⋙ SSet.homologyFunctor DiagonalResolution.Z k).mapCocone + (degreeRowsCocone (a:=a) (n:=n) p q)) := by + exact diagonalHomologyIsColimit + (((Functor.whiskeringRight I Cat SSet).obj nerveFunctor).mapCocone (degreeRowsCocone p q)) + (fun r j => degreeHomologyIsColimit p q r j) k +noncomputable def middleRowsStage (p:ℕ) : Stage a n ⥤ (I ⥤ SSet) where + obj S := rows₂ (C:=Diagram S.Obj (Fin (p+1))) + map h := rows₂Map (Diagram.map (I:=Fin (p+1)) (inclusion (leOfHom h))) + map_id S := by + apply NatTrans.ext; funext q + change nerveDiagonal.map ((degreeRowsStage p q.unop.len).map (𝟙 S)) = 𝟙 _ + rw [CategoryTheory.Functor.map_id,CategoryTheory.Functor.map_id] + map_comp h k := by + apply NatTrans.ext; funext q + change nerveDiagonal.map ((degreeRowsStage p q.unop.len).map (h ≫ k)) = + nerveDiagonal.map ((degreeRowsStage p q.unop.len).map h) ≫ + nerveDiagonal.map ((degreeRowsStage p q.unop.len).map k) + rw [Functor.map_comp,Functor.map_comp] +noncomputable def middleRowsCocone (p:ℕ) : Cocone (middleRowsStage (a:=a) (n:=n) p) where + pt := rows₂ (C:=Diagram (Labelled a n) (Fin (p+1))) + ι := { + app S := rows₂Map (Diagram.map (I:=Fin (p+1)) S.forget) + naturality S T h := by + apply NatTrans.ext; funext q + change nerveDiagonal.map ((degreeRowsStage p q.unop.len).map h) ≫ + nerveDiagonal.map ((degreeRowsCocone p q.unop.len).ι.app T) = + nerveDiagonal.map ((degreeRowsCocone p q.unop.len).ι.app S) + rw [←Functor.map_comp,Cocone.w] } +noncomputable def middleBarHomologyIsColimit (p k:ℕ) : + IsColimit ((diagonal ⋙ SSet.homologyFunctor DiagonalResolution.Z k).mapCocone + (middleRowsCocone (a:=a) (n:=n) p)) := by + apply diagonalHomologyIsColimit + intro q j + exact degreeBarHomologyIsColimit p q.unop.len j +noncomputable def topRowsStage : Stage a n ⥤ (I ⥤ SSet) where + obj S := rows₃ (C:=S.Obj) + map h := rows₃Map (inclusion (leOfHom h)) + map_id S := by + apply NatTrans.ext; funext p + change diagonal.map ((middleRowsStage p.unop.len).map (𝟙 S)) = 𝟙 _ + rw [CategoryTheory.Functor.map_id,CategoryTheory.Functor.map_id] + map_comp h k := by + apply NatTrans.ext; funext p + change diagonal.map ((middleRowsStage p.unop.len).map (h ≫ k)) = + diagonal.map ((middleRowsStage p.unop.len).map h) ≫ + diagonal.map ((middleRowsStage p.unop.len).map k) + rw [Functor.map_comp,Functor.map_comp] +noncomputable def topRowsCocone : Cocone (topRowsStage (a:=a) (n:=n)) where + pt := rows₃ (C:=Labelled a n) + ι := { + app S := rows₃Map S.forget + naturality S T h := by + apply NatTrans.ext; funext p + change diagonal.map ((middleRowsStage p.unop.len).map h) ≫ + diagonal.map ((middleRowsCocone p.unop.len).ι.app T) = + diagonal.map ((middleRowsCocone p.unop.len).ι.app S) + rw [←Functor.map_comp,Cocone.w] } + +noncomputable def tripleBarHomologyIsColimit (k:ℕ) : + IsColimit ((diagonal ⋙ SSet.homologyFunctor DiagonalResolution.Z k).mapCocone + (topRowsCocone (a:=a) (n:=n))) := by + apply diagonalHomologyIsColimit + intro p j + exact middleBarHomologyIsColimit p.unop.len j +end SimpleAmenable.PolygonObject.LabelledStage.Stage + +end + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/StageTripleHomology.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/StageTripleHomology.lean new file mode 100644 index 0000000000000000000000000000000000000000..e2dc9abf3647a33a19ab92ea736cb21d31ced302 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/StageTripleHomology.lean @@ -0,0 +1,297 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.DiagonalComparison +import OAI.GroupTheory.SimpleAmenable.Configurations.StageIteratedMaps2 +import OAI.GroupTheory.SimpleAmenable.Homology.PowerEquivalence + +namespace OAI + +section + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits MonoidalCategory +namespace ColimitTransfer + +universe u v +variable {J : Type} {A : Type u} [Category.{0} J] [Category.{v} A] +noncomputable def transportDiagram (F : J ⥤ A) (X : J → A) (e : ∀j,X j≅F.obj j) : J ⥤ A where + obj := X + map {i j} f := (e i).hom ≫ F.map f ≫ (e j).inv + map_id i := by simp + map_comp f g := by simp [Category.assoc] +noncomputable def transportIso (F : J ⥤ A) (X : J → A) (e : ∀j,X j≅F.obj j) : + transportDiagram F X e ≅ F := NatIso.ofComponents e (by intro i j f; simp [transportDiagram]) +noncomputable def transportCocone {F : J ⥤ A} (s : Cocone F) (X : J → A) + (e : ∀j,X j≅F.obj j) (Y : A) (d : Y≅s.pt) : Cocone (transportDiagram F X e) where + pt := Y + ι := { app j := (e j).hom ≫ s.ι.app j ≫ d.inv + naturality i j f := by simp [transportDiagram,Category.assoc] } +noncomputable def transportIsColimit {F : J ⥤ A} (s : Cocone F) (X : J → A) + (e : ∀j,X j≅F.obj j) (Y : A) (d : Y≅s.pt) (hs : IsColimit s) : + IsColimit (transportCocone s X e Y d) := by + let pointIso : (transportCocone s X e Y d).pt ≅ s.pt := d + refine ofIsos (transportCocone s X e Y d) s (transportIso F X e).hom pointIso.hom ?_ hs + intro j + change ((e j).hom ≫ s.ι.app j ≫ d.inv) ≫ d.hom = + (e j).hom ≫ s.ι.app j + simp [Category.assoc] +end ColimitTransfer +namespace IntervalBar.Diagram +variable {C D : Type} [Groupoid.{0} C] [Groupoid.{0} D] + [MonoidalCategory C] [MonoidalCategory D] [SymmetricCategory C] [SymmetricCategory D] +noncomputable instance map₂Monoidal (F : C ⥤ D) [F.Braided] (m n : ℕ) : + (map (I:=Fin (m+1)) (map (I:=Fin (n+1)) F)).Monoidal := by + letI : (map (I:=Fin (n+1)) F).Braided := mapBraided F + exact mapMonoidal _ +end IntervalBar.Diagram +namespace SimpleAmenable.PolygonObject.LabelledStage.Stage +open StageProductColimit IntervalBar IntervalBar.Diagram ColimitTransfer + +variable {a n : ℕ} (l m p q : ℕ) +noncomputable abbrev tripleDegree (C : Type) [Groupoid.{0} C] [MonoidalCategory C] [SymmetricCategory C] := + Diagram (Diagram (Diagram C (Fin (p+1))) (Fin (m+1))) (Fin (l+1)) +noncomputable def tripleEvalIso (C : Type) [Groupoid.{0} C] [MonoidalCategory C] [SymmetricCategory C] : + (H q).obj (Cat.of (tripleDegree l m p C)) ≅ (H q).obj (Cat.of (Fin l × (Fin m × Fin p) → C)) := + NerveHomotopy.homologyIso (eval₃ l m p).asEquivalence (ModuleCat.of ℤ ℤ) q +noncomputable def tripleHomologyStage : Stage a n ⥤ ModuleCat ℤ := + transportDiagram (productStage (a:=a) (n:=n) (Fin l × (Fin m × Fin p)) ⋙ H q) + (fun S => (H q).obj (Cat.of (tripleDegree l m p S.Obj))) + (fun S => tripleEvalIso l m p q S.Obj) +noncomputable def tripleHomologyCocone : Cocone (tripleHomologyStage (a:=a) (n:=n) l m p q) := + transportCocone ((H q).mapCocone (productCocone (a:=a) (n:=n) (Fin l × (Fin m × Fin p)))) + (fun S => (H q).obj (Cat.of (tripleDegree l m p S.Obj))) + (fun S => tripleEvalIso l m p q S.Obj) + ((H q).obj (Cat.of (tripleDegree l m p (Labelled a n)))) + (tripleEvalIso l m p q (Labelled a n)) + +noncomputable def tripleHomologyIsColimit : + IsColimit (tripleHomologyCocone (a:=a) (n:=n) l m p q) := + transportIsColimit _ _ _ _ _ (productHomologyIsColimit _ q) +variable {C D : Type} [Groupoid.{0} C] [Groupoid.{0} D] + [MonoidalCategory C] [MonoidalCategory D] [SymmetricCategory C] [SymmetricCategory D] +lemma tripleEvalIso_hom (C : Type) [Groupoid.{0} C] [MonoidalCategory C] [SymmetricCategory C] : + (tripleEvalIso l m p q C).hom = (H q).map (eval₃ (C:=C) l m p).toCatHom := rfl +lemma tripleEval_naturality (F : C ⥤ D) [F.Braided] : + (H q).map (Diagram.map (I:=Fin (l+1)) (Diagram.map (I:=Fin (m+1)) + (Diagram.map (I:=Fin (p+1)) F))).toCatHom ≫ (tripleEvalIso l m p q D).hom = + (tripleEvalIso l m p q C).hom ≫ (H q).map (powerMap (Fin l × (Fin m × Fin p)) F).toCatHom := by + rw [tripleEvalIso_hom,tripleEvalIso_hom] + rw [←Functor.map_comp,←Functor.map_comp] + apply congrArg (H q).map + apply Cat.ext + exact eval₃_natural F l m p + +lemma tripleHomologyStage_map {S T : Stage a n} (h:S⟶T) : + (tripleHomologyStage l m p q).map h = + (H q).map (Diagram.map (I:=Fin (l+1)) (Diagram.map (I:=Fin (m+1)) + (Diagram.map (I:=Fin (p+1)) (inclusion (leOfHom h))))).toCatHom := by + change (tripleEvalIso l m p q S.Obj).hom ≫ + (H q).map (powerMap (Fin l × (Fin m × Fin p)) (inclusion (leOfHom h))).toCatHom ≫ + (tripleEvalIso l m p q T.Obj).inv = _ + rw [←Category.assoc] + exact (Iso.comp_inv_eq _).mpr (tripleEval_naturality l m p q (inclusion (leOfHom h))).symm +lemma tripleHomologyCocone_ι (S : Stage a n) : + (tripleHomologyCocone l m p q).ι.app S = + (H q).map (Diagram.map (I:=Fin (l+1)) (Diagram.map (I:=Fin (m+1)) + (Diagram.map (I:=Fin (p+1)) S.forget))).toCatHom := by + change (tripleEvalIso l m p q S.Obj).hom ≫ + (H q).map (powerMap (Fin l × (Fin m × Fin p)) S.forget).toCatHom ≫ + (tripleEvalIso l m p q (Labelled a n)).inv = _ + rw [←Category.assoc] + exact (Iso.comp_inv_eq _).mpr (tripleEval_naturality l m p q S.forget).symm +end SimpleAmenable.PolygonObject.LabelledStage.Stage + +end + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory MonoidalCategory +namespace IntervalBar.Diagram + +variable {C D : Type} [Groupoid.{0} C] [Groupoid.{0} D] + [MonoidalCategory C] [MonoidalCategory D] [SymmetricCategory C] [SymmetricCategory D] +@[simp] lemma map₂_η_app (F : C ⥤ D) [F.Braided] (m p:ℕ) + (i j:Fin (m+1)) (hij:i≤j) (v w:Fin (p+1)) (hvw:v≤w) : + ((Functor.OplaxMonoidal.η (map (I:=Fin (m+1)) (map (I:=Fin (p+1)) F))).app i j hij).app v w hvw = + Functor.OplaxMonoidal.η F := by + exact (congrArg (fun f => f.app v w hvw) (map_η_app (map (I:=Fin (p+1)) F) i j hij)).trans + (map_η_app F v w hvw) +@[simp] lemma map₂_μ_app (F : C ⥤ D) [F.Braided] (m p:ℕ) + (A B : Diagram (Diagram C (Fin (p+1))) (Fin (m+1))) + (i j:Fin (m+1)) (hij:i≤j) (v w:Fin (p+1)) (hvw:v≤w) : + ((Functor.LaxMonoidal.μ (map (I:=Fin (m+1)) (map (I:=Fin (p+1)) F)) A B).app i j hij).app v w hvw = + Functor.LaxMonoidal.μ F ((A.obj i j hij).obj v w hvw) ((B.obj i j hij).obj v w hvw) := rfl +end IntervalBar.Diagram +namespace SimpleAmenable.PolygonObject.LabelledStage.Stage +open IntervalBar IntervalBar.Diagram + +variable {a n : ℕ} (l m p : ℕ) +lemma map₃_inclusion_comp_obj {S T U : Stage a n} (h:S≤T) (k:T≤U) + (A : tripleDegree l m p S.Obj) : + mapObj (Diagram.map (I:=Fin (m+1)) (Diagram.map (I:=Fin (p+1)) (inclusion (h.trans k)))) A = + mapObj (Diagram.map (Diagram.map (inclusion k))) (mapObj (Diagram.map (Diagram.map (inclusion h))) A) := by + have he (X : Diagram (Diagram S.Obj (Fin (p+1))) (Fin (m+1))) : + mapObj (Diagram.map (inclusion (h.trans k))) X= + mapObj (Diagram.map (inclusion k)) (mapObj (Diagram.map (inclusion h)) X) := + map₂_inclusion_comp_obj h k X + have he₁ (X : Diagram S.Obj (Fin (p+1))) : mapObj (inclusion (h.trans k)) X= + mapObj (inclusion k) (mapObj (inclusion h) X) := + congrArg (fun F=>F.obj X) (map_inclusion_comp h k) + refine ext_heq ?_ ?_ ?_ + · funext i j hij; exact he _ + · apply hfunext; intro i + apply iso_hext (he _) rfl + apply hom_hext (he _) rfl + intro j z hjz + apply hom_hext (he₁ _) rfl + intro v w hvw + apply heq_of_eq + change (inclusion (h.trans k)).map (((A.unit i).hom.app j z hjz).app v w hvw) ≫ + ((Functor.OplaxMonoidal.η (Diagram.map (I:=Fin (m+1)) + (Diagram.map (I:=Fin (p+1)) (inclusion (h.trans k))))).app j z hjz).app v w hvw = + (inclusion k).map ((inclusion h).map (((A.unit i).hom.app j z hjz).app v w hvw) ≫ + ((Functor.OplaxMonoidal.η (Diagram.map (I:=Fin (m+1)) + (Diagram.map (I:=Fin (p+1)) (inclusion h)))).app j z hjz).app v w hvw) ≫ + ((Functor.OplaxMonoidal.η (Diagram.map (I:=Fin (m+1)) + (Diagram.map (I:=Fin (p+1)) (inclusion k)))).app j z hjz).app v w hvw + simp only [map₂_η_app,inclusion_η] + rfl + · apply hfunext; intro i + apply hfunext; intro j + apply hfunext; intro z + apply hfunext; intro hij + apply hfunext; intro hjz + apply iso_hext (congrArg₂ (fun X Y=>X⊗Y) (he _) (he _)) (he _) + apply hom_hext (congrArg₂ (fun X Y=>X⊗Y) (he _) (he _)) (he _) + intro v w hvw + apply hom_hext (congrArg₂ (fun X Y=>X⊗Y) (he₁ _) (he₁ _)) (he₁ _) + intro x y hxy + simp only [mapObj,Functor.mapIso_hom,Iso.trans_hom,Functor.Monoidal.μIso_hom, + map₂_μ_app,comp_app,map_map_app,inclusion_μ,Functor.map_comp] + rfl +lemma map₃_inclusion_comp {S T U : Stage a n} (h:S≤T) (k:T≤U) : + Diagram.map (I:=Fin (l+1)) (Diagram.map (I:=Fin (m+1)) (Diagram.map (I:=Fin (p+1)) (inclusion (h.trans k)))) = + Diagram.map (Diagram.map (Diagram.map (inclusion h))) ⋙ Diagram.map (Diagram.map (Diagram.map (inclusion k))) := by + refine CategoryTheory.Functor.hext (map₃_inclusion_comp_obj l m p h k) ?_ + intro A B f + apply hom_hext (map₃_inclusion_comp_obj l m p h k A) (map₃_inclusion_comp_obj l m p h k B) + intro i j hij + apply hom_hext (map₂_inclusion_comp_obj h k _) (map₂_inclusion_comp_obj h k _) + intro v w hvw + apply hom_hext + (congrArg (fun F => F.obj ((A.obj i j hij).obj v w hvw)) (map_inclusion_comp h k)) + (congrArg (fun F => F.obj ((B.obj i j hij).obj v w hvw)) (map_inclusion_comp h k)) + intro x y hxy + rfl +lemma map₃_inclusion_forget_obj {S T : Stage a n} (h:S≤T) + (A : tripleDegree l m p S.Obj) : + mapObj (Diagram.map (Diagram.map T.forget)) + (mapObj (Diagram.map (I:=Fin (m+1)) (Diagram.map (I:=Fin (p+1)) (inclusion h))) A) = + mapObj (Diagram.map (Diagram.map S.forget)) A := by + have he (X : Diagram (Diagram S.Obj (Fin (p+1))) (Fin (m+1))) : + mapObj (Diagram.map T.forget) (mapObj (Diagram.map (inclusion h)) X)= + mapObj (Diagram.map S.forget) X := map₂_inclusion_forget_obj h X + have he₁ (X : Diagram S.Obj (Fin (p+1))) : mapObj T.forget (mapObj (inclusion h) X)= + mapObj S.forget X := congrArg (fun F=>F.obj X) (map_inclusion_forget h) + refine ext_heq ?_ ?_ ?_ + · funext i j hij; exact he _ + · apply hfunext; intro i + apply iso_hext (he _) rfl + apply hom_hext (he _) rfl + intro j z hjz + apply hom_hext (he₁ _) rfl + intro v w hvw + apply heq_of_eq + change T.forget.map ((inclusion h).map (((A.unit i).hom.app j z hjz).app v w hvw) ≫ + ((Functor.OplaxMonoidal.η (Diagram.map (I:=Fin (m+1)) + (Diagram.map (I:=Fin (p+1)) (inclusion h)))).app j z hjz).app v w hvw) ≫ + ((Functor.OplaxMonoidal.η (Diagram.map (I:=Fin (m+1)) + (Diagram.map (I:=Fin (p+1)) T.forget))).app j z hjz).app v w hvw = + S.forget.map (((A.unit i).hom.app j z hjz).app v w hvw) ≫ + ((Functor.OplaxMonoidal.η (Diagram.map (I:=Fin (m+1)) + (Diagram.map (I:=Fin (p+1)) S.forget))).app j z hjz).app v w hvw + simp only [map₂_η_app,inclusion_η,forget_η] + rfl + · apply hfunext; intro i + apply hfunext; intro j + apply hfunext; intro z + apply hfunext; intro hij + apply hfunext; intro hjz + apply iso_hext (congrArg₂ (fun X Y=>X⊗Y) (he _) (he _)) (he _) + apply hom_hext (congrArg₂ (fun X Y=>X⊗Y) (he _) (he _)) (he _) + intro v w hvw + apply hom_hext (congrArg₂ (fun X Y=>X⊗Y) (he₁ _) (he₁ _)) (he₁ _) + intro x y hxy + simp only [mapObj,Functor.mapIso_hom,Iso.trans_hom,Functor.Monoidal.μIso_hom, + map₂_μ_app,comp_app,map_map_app,forget_μ,Functor.map_comp] + rfl +lemma map₃_inclusion_forget {S T : Stage a n} (h:S≤T) : + Diagram.map (I:=Fin (l+1)) (Diagram.map (I:=Fin (m+1)) (Diagram.map (I:=Fin (p+1)) (inclusion h))) ⋙ + Diagram.map (Diagram.map (Diagram.map T.forget)) = Diagram.map (Diagram.map (Diagram.map S.forget)) := by + refine CategoryTheory.Functor.hext (map₃_inclusion_forget_obj l m p h) ?_ + intro A B f + apply hom_hext (map₃_inclusion_forget_obj l m p h A) (map₃_inclusion_forget_obj l m p h B) + intro i j hij + apply hom_hext (map₂_inclusion_forget_obj h _) (map₂_inclusion_forget_obj h _) + intro v w hvw + apply hom_hext + (congrArg (fun F => F.obj ((A.obj i j hij).obj v w hvw)) (map_inclusion_forget h)) + (congrArg (fun F => F.obj ((B.obj i j hij).obj v w hvw)) (map_inclusion_forget h)) + intro x y hxy + rfl +lemma map₃_inclusion_id_obj (S : Stage a n) (A : tripleDegree l m p S.Obj) : + mapObj (Diagram.map (I:=Fin (m+1)) (Diagram.map (I:=Fin (p+1)) (inclusion (le_refl S)))) A=A := by + have he (X : Diagram (Diagram S.Obj (Fin (p+1))) (Fin (m+1))) : + mapObj (Diagram.map (inclusion (le_refl S))) X=X := + congrArg (fun F=>F.obj X) (map₂_inclusion_id S) + have he₁ (X : Diagram S.Obj (Fin (p+1))) : mapObj (inclusion (le_refl S)) X=X := + congrArg (fun F=>F.obj X) (map_inclusion_id S) + refine ext_heq ?_ ?_ ?_ + · funext i j hij; exact he _ + · apply hfunext; intro i + apply iso_hext (he _) rfl + apply hom_hext (he _) rfl + intro j z hjz + apply hom_hext (he₁ _) rfl + intro v w hvw + apply heq_of_eq + change (inclusion (le_refl S)).map (((A.unit i).hom.app j z hjz).app v w hvw) ≫ + ((Functor.OplaxMonoidal.η (Diagram.map (I:=Fin (m+1)) + (Diagram.map (I:=Fin (p+1)) (inclusion (le_refl S))))).app j z hjz).app v w hvw = + ((A.unit i).hom.app j z hjz).app v w hvw + rw [map₂_η_app,inclusion_η] + apply UniformObject.Hom.ext + exact Category.comp_id _ + · apply hfunext; intro i + apply hfunext; intro j + apply hfunext; intro z + apply hfunext; intro hij + apply hfunext; intro hjz + apply iso_hext (congrArg₂ (fun X Y=>X⊗Y) (he _) (he _)) (he _) + apply hom_hext (congrArg₂ (fun X Y=>X⊗Y) (he _) (he _)) (he _) + intro v w hvw + apply hom_hext (congrArg₂ (fun X Y=>X⊗Y) (he₁ _) (he₁ _)) (he₁ _) + intro x y hxy + simp only [mapObj,Functor.mapIso_hom,Iso.trans_hom,Functor.Monoidal.μIso_hom, + comp_app,map_map_app] + rfl +lemma map₃_inclusion_id (S : Stage a n) : + Diagram.map (I:=Fin (l+1)) (Diagram.map (I:=Fin (m+1)) (Diagram.map (I:=Fin (p+1)) (inclusion (le_refl S))))=𝟭 _ := by + refine CategoryTheory.Functor.hext (map₃_inclusion_id_obj l m p S) ?_ + intro A B f + apply hom_hext (map₃_inclusion_id_obj l m p S A) (map₃_inclusion_id_obj l m p S B) + intro i j hij + apply hom_hext + (congrArg (fun F => F.obj (A.obj i j hij)) (map₂_inclusion_id S)) + (congrArg (fun F => F.obj (B.obj i j hij)) (map₂_inclusion_id S)) + intro v w hvw + apply hom_hext + (congrArg (fun F => F.obj ((A.obj i j hij).obj v w hvw)) (map_inclusion_id S)) + (congrArg (fun F => F.obj ((B.obj i j hij).obj v w hvw)) (map_inclusion_id S)) + intro x y hxy + rfl +end SimpleAmenable.PolygonObject.LabelledStage.Stage + +end + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/StringBarNaturality.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/StringBarNaturality.lean new file mode 100644 index 0000000000000000000000000000000000000000..ff08279628f3039ddd9167e7ac5b05fddd3e54cc --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/StringBarNaturality.lean @@ -0,0 +1,150 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.Supplemental + +namespace OAI + +open _root_.CategoryTheory _root_.OAI.CategoryTheory MonoidalCategory SimplicialObject Simplicial Opposite +namespace SimplicialDiagonal +lemma diagonal_obj_map_apply (X : I ⥤ SSet) {n m : I} (f : n ⟶ m) + (x : (diagonal.obj X).obj n) : + (diagonal.obj X).map f x = (X.obj m).map f ((X.map f).app n x) := rfl +lemma diagonal_map_app_apply {X Y : I ⥤ SSet} (f : X ⟶ Y) (n : I) + (x : (diagonal.obj X).obj n) : + (diagonal.map f).app n x = (f.app n).app n x := rfl +lemma nerveDiagonal_obj_map_apply (X : I ⥤ Cat.{0,0}) {n m : I} (f : n ⟶ m) + (x : (nerveDiagonal.obj X).obj n) : + (nerveDiagonal.obj X).map f x = + f.unop.toOrderHom.toFunctor ⋙ x ⋙ (X.map f).toFunctor := rfl +lemma nerveDiagonal_map_app_apply {X Y : I ⥤ Cat.{0,0}} (f : X ⟶ Y) (n : I) + (x : (nerveDiagonal.obj X).obj n) : + (nerveDiagonal.map f).app n x = x ⋙ (f.app n).toFunctor := rfl +end SimplicialDiagonal +namespace IntervalBar.Diagram +variable {C D : Type} [Groupoid.{0} C] [MonoidalCategory C] [SymmetricCategory C] + [Groupoid.{0} D] [MonoidalCategory D] [SymmetricCategory D] +lemma bar₃Map_app_apply (F : C ⥤ D) [F.Braided] (n : SimplexCategoryᵒᵖ) + (x : (bar₃ (C:=C)).obj n) : + (bar₃Map F).app n x = x ⋙ map₃ F (Fin (n.unop.len+1)) := rfl +end IntervalBar.Diagram +namespace RestrictedNerve + +open IntervalBar IntervalBar.Diagram +variable {C:Type} [Groupoid.{0} C] (W:MorphismProperty C) + [Fact W.StableUnderInverse] [MonoidalCategory C] [SymmetricCategory C] + [W.IsStableUnderBraiding] +lemma stringBarRows_map_app_apply {n m : SimplexCategoryᵒᵖ} (f : n ⟶ m) + (k : SimplexCategoryᵒᵖ) (x : ((stringBarRows W).obj n).obj k) : + ((stringBarRows W).map f).app k x = + x ⋙ Diagram.map₃ (reindex W (n:=m.unop.len) (m:=n.unop.len) f.unop.toOrderHom.toFunctor) (Fin (k.unop.len+1)) := + bar₃Map_app_apply _ _ _ +lemma stringBarTotal_map_apply {n m : SimplexCategoryᵒᵖ} (f : n ⟶ m) + (x : (SimplicialDiagonal.diagonal.obj (stringBarRows W)).obj n) : + (SimplicialDiagonal.diagonal.obj (stringBarRows W)).map f x = + f.unop.toOrderHom.toFunctor ⋙ x ⋙ + Diagram.map₃ (reindex W (n:=m.unop.len) (m:=n.unop.len) f.unop.toOrderHom.toFunctor) (Fin (n.unop.len+1)) ⋙ + diagonalReindex f.unop.toOrderHom := by + rfl + +lemma outerResolutionRows_map_app_apply {n m : SimplexCategoryᵒᵖ} (f : n ⟶ m) + (k : SimplexCategoryᵒᵖ) (x : ((outerResolutionRows W).obj n).obj k) : + ((outerResolutionRows W).map f).app k x = + x ⋙ Diagram.reindex f.unop.toOrderHom := rfl + +lemma middleResolutionRows_map_app_apply (r : ℕ) {n m : SimplexCategoryᵒᵖ} (f : n ⟶ m) + (k : SimplexCategoryᵒᵖ) (x : ((middleResolutionRows W r).obj n).obj k) : + ((middleResolutionRows W r).map f).app k x = + x ⋙ Diagram.map (Diagram.reindex f.unop.toOrderHom) := rfl + +lemma innerResolutionRows_map_app_apply (q r : ℕ) {n m : SimplexCategoryᵒᵖ} (f : n ⟶ m) + (k : SimplexCategoryᵒᵖ) (x : ((innerResolutionRows W q r).obj n).obj k) : + ((innerResolutionRows W q r).map f).app k x = + x ⋙ Diagram.map (Diagram.map (Diagram.reindex f.unop.toOrderHom)) := rfl +lemma tripleDiagramHorizontal_map_apply (p q r : ℕ) {n m : SimplexCategoryᵒᵖ} (f : n ⟶ m) + (x : (SimplicialDiagonal.nerveDiagonal.obj (tripleDiagramHorizontal W p q r)).obj n) : + (SimplicialDiagonal.nerveDiagonal.obj (tripleDiagramHorizontal W p q r)).map f x = + f.unop.toOrderHom.toFunctor ⋙ x ⋙ + Diagram.map + (C:=Diagram (Diagram (Strings W n.unop.len) (Fin (p+1))) (Fin (q+1))) + (D:=Diagram (Diagram (Strings W m.unop.len) (Fin (p+1))) (Fin (q+1))) + (I:=Fin (r+1)) + (Diagram.map (C:=Diagram (Strings W n.unop.len) (Fin (p+1))) + (D:=Diagram (Strings W m.unop.len) (Fin (p+1))) (I:=Fin (q+1)) + (Diagram.map (C:=Strings W n.unop.len) (D:=Strings W m.unop.len) (I:=Fin (p+1)) (reindex W (n:=m.unop.len) (m:=n.unop.len) f.unop.toOrderHom.toFunctor))) := rfl +lemma innerResolutionTotal_map_apply (q r : ℕ) {n m : SimplexCategoryᵒᵖ} (f : n ⟶ m) + (x : (SimplicialDiagonal.diagonal.obj (innerResolutionRows W q r)).obj n) : + (SimplicialDiagonal.diagonal.obj (innerResolutionRows W q r)).map f x = + f.unop.toOrderHom.toFunctor ⋙ x ⋙ + Diagram.map + (C:=Diagram (Diagram (Strings W n.unop.len) (Fin (n.unop.len+1))) (Fin (q+1))) + (D:=Diagram (Diagram (Strings W n.unop.len) (Fin (m.unop.len+1))) (Fin (q+1))) + (I:=Fin (r+1)) (Diagram.map (C:=Diagram (Strings W n.unop.len) (Fin (n.unop.len+1))) + (D:=Diagram (Strings W n.unop.len) (Fin (m.unop.len+1))) (I:=Fin (q+1)) + (Diagram.reindex (C:=Strings W n.unop.len) f.unop.toOrderHom)) ⋙ + Diagram.map (I:=Fin (r+1)) (Diagram.map (I:=Fin (q+1)) + (Diagram.map (C:=Strings W n.unop.len) (D:=Strings W m.unop.len) (I:=Fin (m.unop.len+1)) (reindex W (n:=m.unop.len) (m:=n.unop.len) f.unop.toOrderHom.toFunctor))) := by + rfl +lemma middleResolutionTotal_map_apply (r : ℕ) {n m : SimplexCategoryᵒᵖ} (f : n ⟶ m) + (x : (SimplicialDiagonal.diagonal.obj (middleResolutionRows W r)).obj n) : + (SimplicialDiagonal.diagonal.obj (middleResolutionRows W r)).map f x = + f.unop.toOrderHom.toFunctor ⋙ x ⋙ + Diagram.map (C:=Diagram (Diagram (Strings W n.unop.len) (Fin (n.unop.len+1))) (Fin (n.unop.len+1))) + (D:=Diagram (Diagram (Strings W n.unop.len) (Fin (n.unop.len+1))) (Fin (m.unop.len+1))) + (I:=Fin (r+1)) (Diagram.reindex + (C:=Diagram (Strings W n.unop.len) (Fin (n.unop.len+1))) f.unop.toOrderHom) ⋙ + Diagram.map (I:=Fin (r+1)) (Diagram.map (I:=Fin (m.unop.len+1)) + (Diagram.reindex (C:=Strings W n.unop.len) f.unop.toOrderHom)) ⋙ + Diagram.map (I:=Fin (r+1)) (Diagram.map (I:=Fin (m.unop.len+1)) + (Diagram.map (C:=Strings W n.unop.len) (D:=Strings W m.unop.len) (I:=Fin (m.unop.len+1)) (reindex W (n:=m.unop.len) (m:=n.unop.len) f.unop.toOrderHom.toFunctor))) := by + rfl +lemma outerResolutionTotal_map_apply {n m : SimplexCategoryᵒᵖ} (f : n ⟶ m) + (x : (SimplicialDiagonal.diagonal.obj (outerResolutionRows W)).obj n) : + (SimplicialDiagonal.diagonal.obj (outerResolutionRows W)).map f x = + f.unop.toOrderHom.toFunctor ⋙ x ⋙ + Diagram.reindex (C:=Diagram (Diagram (Strings W n.unop.len) + (Fin (n.unop.len+1))) (Fin (n.unop.len+1))) f.unop.toOrderHom ⋙ + Diagram.map (I:=Fin (m.unop.len+1)) (Diagram.reindex + (C:=Diagram (Strings W n.unop.len) (Fin (n.unop.len+1))) f.unop.toOrderHom) ⋙ + Diagram.map (I:=Fin (m.unop.len+1)) (Diagram.map (I:=Fin (m.unop.len+1)) + (Diagram.reindex (C:=Strings W n.unop.len) f.unop.toOrderHom)) ⋙ + Diagram.map₃ (reindex W (n:=m.unop.len) (m:=n.unop.len) f.unop.toOrderHom.toFunctor) (Fin (m.unop.len+1)) := by + rfl + +noncomputable def stringBarTotalIso : + SimplicialDiagonal.diagonal.obj (stringBarRows W) ≅ + SimplicialDiagonal.diagonal.obj (outerResolutionRows W) := + NatIso.ofComponents (stringBarTotalComponent W) (by + intro n m f + apply ConcreteCategory.hom_ext + intro x + change (SimplicialDiagonal.diagonal.obj (stringBarRows W)).map f x = + (SimplicialDiagonal.diagonal.obj (outerResolutionRows W)).map f x + erw [stringBarTotal_map_apply, outerResolutionTotal_map_apply] + have h := map₃_diagonalReindex (reindex W (n:=m.unop.len) (m:=n.unop.len) f.unop.toOrderHom.toFunctor) + f.unop.toOrderHom + conv_rhs at h => rw [← reverseDiagonalReindex] + exact congrArg (fun F => f.unop.toOrderHom.toFunctor ⋙ x ⋙ F) h) +noncomputable def stringBarAugmentation : + SimplicialDiagonal.diagonal.obj (stringBarRows W) ⟶ bar₃ (C:=C) := + (stringBarTotalIso W).hom ≫ totalStringToBar W +noncomputable instance stringBarAugmentation_isIso (j:ℕ) : + IsIso (SSet.homologyMap (stringBarAugmentation W) DiagonalResolution.Z j) := by + unfold stringBarAugmentation + rw [SSet.homologyMap_comp] + have totalAugmentationIso := totalStringToBar_isIso W j + infer_instance +end RestrictedNerve + +namespace SimpleAmenable.PolygonObject +open _root_.CategoryTheory _root_.OAI.CategoryTheory + +noncomputable def stringBarAugmentation (a:ℕ) : + SimplicialDiagonal.diagonal.obj + (RestrictedNerve.stringBarRows (positionalProperty a)) ⟶ + IntervalBar.Diagram.bar₃ (C:=PolygonObject a) := + RestrictedNerve.stringBarAugmentation (positionalProperty a) +noncomputable instance stringBarAugmentation_isIso (a j:ℕ) : + IsIso (SSet.homologyMap (stringBarAugmentation a) DiagonalResolution.Z j) := + RestrictedNerve.stringBarAugmentation_isIso (positionalProperty a) j +end SimpleAmenable.PolygonObject + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/StringEvaluation.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/StringEvaluation.lean new file mode 100644 index 0000000000000000000000000000000000000000..60a7a5c6e3afd7c9bec665b4b8250244397ef39b --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/StringEvaluation.lean @@ -0,0 +1,189 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.ResolutionAugmentation + +namespace OAI + +namespace RestrictedNerve + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory MonoidalCategory + +section +open IntervalBar IntervalBar.Diagram + +section +variable {C:Type} [Groupoid.{0} C] (W:MorphismProperty C) [W.IsMultiplicative] +noncomputable def stringEvaluation {n:ℕ} (t:Fin (n+1)) : Strings W n ⥤ C where + obj A := A.obj.obj t + map f := f.hom.app t + map_id _ := rfl + map_comp _ _ := rfl +@[simp] lemma stringEvaluation_obj {n:ℕ} (t:Fin (n+1)) (A:Strings W n) : + (stringEvaluation W t).obj A=A.obj.obj t := rfl +@[simp] lemma stringEvaluation_map {n:ℕ} (t:Fin (n+1)) {A B:Strings W n} (f:A⟶B) : + (stringEvaluation W t).map f=f.hom.app t := rfl +end + +variable {C:Type} [Groupoid.{0} C] (W:MorphismProperty C) + [Fact W.StableUnderInverse] [MonoidalCategory C] [SymmetricCategory C] + [W.IsStableUnderBraiding] +noncomputable instance stringEvaluationMonoidal {n:ℕ} (t:Fin (n+1)) : + (stringEvaluation W t).Monoidal := Functor.CoreMonoidal.toMonoidal { + εIso := Iso.refl _ + μIso _ _ := Iso.refl _ + μIso_hom_natural_left := by intros; simp + μIso_hom_natural_right := by intros; simp + associativity := by intros; simp + left_unitality := by intros; simp + right_unitality := by intros; simp } +noncomputable instance stringEvaluationBraided {n:ℕ} (t:Fin (n+1)) : + (stringEvaluation W t).Braided where + braided _ _ := by + change 𝟙 _ ≫ (β_ _ _).hom = (β_ _ _).hom ≫ 𝟙 _ + simp +omit [Fact W.StableUnderInverse] in +@[simp] lemma stringEvaluation_η {n:ℕ} (t:Fin (n+1)) : + Functor.OplaxMonoidal.η (stringEvaluation W t)=𝟙 _ := rfl +omit [Fact W.StableUnderInverse] in +@[simp] lemma stringEvaluation_ε {n:ℕ} (t:Fin (n+1)) : + Functor.LaxMonoidal.ε (stringEvaluation W t)=𝟙 _ := rfl +omit [Fact W.StableUnderInverse] in +@[simp] lemma stringEvaluation_μ {n:ℕ} (t:Fin (n+1)) (A B:Strings W n) : + Functor.LaxMonoidal.μ (stringEvaluation W t) A B=𝟙 _ := rfl +variable {I:Type} [Preorder I] +lemma transpose_evaluation {n:ℕ} (t:Fin (n+1)) : + transposeDiagram (I:=I) W n ⋙ stringEvaluation (diagramProperty W I) t ⋙ + posDiagramInclusion W I = Diagram.map (stringEvaluation W t) := by + refine CategoryTheory.Functor.ext (fun _=>?_) ?_ + · refine ext_heq rfl ?_ ?_ + · apply heq_of_eq; funext i; apply Iso.ext + simp [transposeDiagram,transposeDiagramObj,stringVertex,mapObj,diagramInclusion] + rfl + · apply heq_of_eq; funext i j k hij hjk; apply Iso.ext + simp [transposeDiagram,transposeDiagramObj,stringVertex,mapObj,diagramInclusion] + rfl + · intro A B f + apply Hom.ext; intro i j h + simp [transposeDiagram,transposeDiagramHom,Diagram.map] + erw [Diagram.eqToHom_app, Diagram.eqToHom_app] + change (f.app i j h).hom.app t = 𝟙 _ ≫ (f.app i j h).hom.app t ≫ 𝟙 _ + simp only [Category.id_comp, Category.comp_id] +end + +section +open IntervalBar IntervalBar.Diagram + +variable {C:Type} [Groupoid.{0} C] (W:MorphismProperty C) + [Fact W.StableUnderInverse] [MonoidalCategory C] [SymmetricCategory C] + [W.IsStableUnderBraiding] +omit [Fact W.StableUnderInverse] in +@[simp] lemma restrictionInclusion_ε : Functor.LaxMonoidal.ε (inclusion W)=𝟙 _ := rfl +variable {I:Type} [Preorder I] +noncomputable instance transpose_evaluation_monoidal {n:ℕ} (t:Fin (n+1)) : + NatTrans.IsMonoidal (eqToHom (transpose_evaluation (I:=I) W t)) where + unit := by + apply Hom.ext; intro i j h + simp only [Functor.LaxMonoidal.comp_ε,posInclusion_ε,stringEvaluation_ε, + IntervalBar.Diagram.map_ε,transpose_ε] + simp [transposeε, mapεHom,diagramInclusion] + erw [Diagram.eqToHom_app] + change (𝟙 (𝟙_ C) ≫ 𝟙 _) ≫ 𝟙 _ = 𝟙 _ + simp only [Category.comp_id] + tensor A B := by + apply Hom.ext; intro i j h + simp only [Functor.LaxMonoidal.comp_μ,posInclusion_μ,stringEvaluation_μ, + IntervalBar.Diagram.map_μ,transpose_μ] + simp [transposeμ,mapμHom,diagramInclusion] + erw [Diagram.eqToHom_app, Diagram.eqToHom_app, Diagram.eqToHom_app] + change (𝟙 ((A.obj i j h).obj.obj t ⊗ (B.obj i j h).obj.obj t) ≫ 𝟙 _) ≫ 𝟙 _ = + (𝟙 _ ⊗ₘ 𝟙 _) ≫ 𝟙 _ + simp only [id_tensorHom_id, Category.comp_id] +end + +open IntervalBar IntervalBar.Diagram + +variable {C:Type} [Groupoid.{0} C] (W:MorphismProperty C) + [Fact W.StableUnderInverse] [MonoidalCategory C] [SymmetricCategory C] + [W.IsStableUnderBraiding] +lemma tripleTranspose_evaluation (p q r:ℕ) {n:ℕ} (t:Fin (n+1)) : + tripleTranspose W p q r n ⋙ stringEvaluation (property₃ W p q r) t ⋙ + triplePosInclusion W p q r = + Diagram.map (I:=Fin (r+1)) (Diagram.map (I:=Fin (q+1)) + (Diagram.map (I:=Fin (p+1)) (stringEvaluation W t))) := by + have h₁ := Diagram.map₂_congr (I:=Fin (q+1)) (J:=Fin (r+1)) + (transpose_evaluation (I:=Fin (p+1)) W t) (transpose_evaluation_monoidal W t) + simp only [map₂_comp] at h₁ + have h₂ := Diagram.map_congr (I:=Fin (r+1)) + (transpose_evaluation (I:=Fin (q+1)) (diagramProperty W (Fin (p+1))) t) + (transpose_evaluation_monoidal (diagramProperty W (Fin (p+1))) t) + simp only [Diagram.map_comp] at h₂ + have h₃ := transpose_evaluation (I:=Fin (r+1)) (property₂ W p q) t + change Diagram.map (I:=Fin (r+1)) (Diagram.map (I:=Fin (q+1)) (transposeDiagram (I:=Fin (p+1)) W n)) ⋙ + Diagram.map (I:=Fin (r+1)) (transposeDiagram (I:=Fin (q+1)) (diagramProperty W (Fin (p+1))) n) ⋙ + (transposeDiagram (I:=Fin (r+1)) (property₂ W p q) n ⋙ stringEvaluation (property₃ W p q r) t ⋙ + posDiagramInclusion (property₂ W p q) (Fin (r+1))) ⋙ + Diagram.map (I:=Fin (r+1)) (posDiagramInclusion (diagramProperty W (Fin (p+1))) (Fin (q+1))) ⋙ + Diagram.map (I:=Fin (r+1)) (Diagram.map (I:=Fin (q+1)) (posDiagramInclusion W (Fin (p+1)))) = _ + rw [h₃] + change Diagram.map (I:=Fin (r+1)) (Diagram.map (I:=Fin (q+1)) (transposeDiagram (I:=Fin (p+1)) W n)) ⋙ + (Diagram.map (I:=Fin (r+1)) (transposeDiagram (I:=Fin (q+1)) (diagramProperty W (Fin (p+1))) n) ⋙ + Diagram.map (I:=Fin (r+1)) (stringEvaluation (property₂ W p q) t) ⋙ + Diagram.map (I:=Fin (r+1)) (posDiagramInclusion (diagramProperty W (Fin (p+1))) (Fin (q+1)))) ⋙ + Diagram.map (I:=Fin (r+1)) (Diagram.map (I:=Fin (q+1)) (posDiagramInclusion W (Fin (p+1)))) = _ + rw [h₂] + exact h₁ +end + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory MonoidalCategory SimplicialObject Simplicial Opposite +open IntervalBar IntervalBar.Diagram + +variable {C:Type} [Groupoid.{0} C] (W:MorphismProperty C) + [Fact W.StableUnderInverse] [MonoidalCategory C] [SymmetricCategory C] + [W.IsStableUnderBraiding] + +noncomputable def tripleInnerReindex (q r:ℕ) {p s:ℕ} (u:Fin (p+1)→oFin (s+1)) : + tripleDiagramHorizontal W s q r ⟶ tripleDiagramHorizontal W p q r where + app n := (Diagram.map (I:=Fin (r+1)) (Diagram.map (I:=Fin (q+1)) + (Diagram.reindex (C:=Strings W n.unop.len) u))).toCatHom + naturality _ _ f := by + apply Cat.ext + have he := Diagram.map₂_congr (I:=Fin (q+1)) (J:=Fin (r+1)) + (Diagram.reindex_map (reindex W f.unop.toOrderHom.toFunctor) u) + (Diagram.reindex_map_monoidal (reindex W f.unop.toOrderHom.toFunctor) u) + simp only [map₂_comp] at he + exact he.symm +lemma tripleResolutionAugmentation_inner_natural (q r:ℕ) {p s:ℕ} + (u:Fin (p+1)→oFin (s+1)) : + SimplicialDiagonal.nerveDiagonal.map (tripleInnerReindex W q r u) ≫ + tripleResolutionAugmentation W p q r = + tripleResolutionAugmentation W s q r ≫ + nerveMap (Diagram.map (Diagram.map (Diagram.reindex u))) := by + ext n A + refine CategoryTheory.Functor.ext (fun i=> ?_) ?_ + · change ((Diagram.map (I:=Fin (r+1)) (Diagram.map (I:=Fin (q+1)) + (Diagram.reindex (C:=Strings W n.unop.len) u)) ⋙ + tripleTranspose W p q r n.unop.len ⋙ stringEvaluation (property₃ W p q r) i ⋙ + triplePosInclusion W p q r).obj (A.obj i)) = + ((tripleTranspose W s q r n.unop.len ⋙ stringEvaluation (property₃ W s q r) i ⋙ + triplePosInclusion W s q r ⋙ Diagram.map (I:=Fin (r+1)) + (Diagram.map (I:=Fin (q+1)) (Diagram.reindex (C:=C) u))).obj (A.obj i)) + rw [tripleTranspose_evaluation W p q r i] + change _ = (((tripleTranspose W s q r n.unop.len ⋙ stringEvaluation (property₃ W s q r) i ⋙ + triplePosInclusion W s q r) ⋙ Diagram.map (I:=Fin (r+1)) + (Diagram.map (I:=Fin (q+1)) (Diagram.reindex (C:=C) u))).obj (A.obj i)) + rw [tripleTranspose_evaluation W s q r i] + exact congrArg (fun F=>F.obj (A.obj i)) + (Diagram.map_map_map_reindex (K:=Fin (q+1)) (L:=Fin (r+1)) (stringEvaluation W i) u).symm + · intro i j f + apply Hom.ext; intro a b h + apply Hom.ext; intro c d k + apply Hom.ext; intro e g l + simp only [Diagram.comp_app,Diagram.eqToHom_app] + erw [Category.id_comp, Category.comp_id] + rfl +end + +end RestrictedNerve + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/Supplemental.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/Supplemental.lean new file mode 100644 index 0000000000000000000000000000000000000000..e74eff21782ab4e2b55f8b0bf52310df84e09182 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/Supplemental.lean @@ -0,0 +1,414 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.TripleReindex +import OAI.GroupTheory.SimpleAmenable.Simplicial.StringEvaluation + +namespace OAI + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory MonoidalCategory SimplicialObject Simplicial Opposite +namespace RestrictedNerve + +section +open IntervalBar IntervalBar.Diagram + +variable {C:Type} [Groupoid.{0} C] (W:MorphismProperty C) + [Fact W.StableUnderInverse] [MonoidalCategory C] [SymmetricCategory C] + [W.IsStableUnderBraiding] +lemma tripleInnerReindex_id (p q r:ℕ) : + tripleInnerReindex W q r (OrderHom.id (α:=Fin (p+1))) = 𝟙 _ := by + apply NatTrans.ext; funext n; apply Cat.ext + exact Diagram.map_map_reindex_id +lemma tripleInnerReindex_comp (q r:ℕ) {p s t:ℕ} + (u:Fin (p+1)→oFin (s+1)) (v:Fin (s+1)→oFin (t+1)) : + tripleInnerReindex W q r (v.comp u) = + tripleInnerReindex W q r v ≫ tripleInnerReindex W q r u := by + apply NatTrans.ext; funext n; apply Cat.ext + exact Diagram.map_map_reindex_comp u v + +noncomputable def innerResolutionRows (q r:ℕ) : SimplicialObject SSet where + obj p := SimplicialDiagonal.nerveDiagonal.obj (tripleDiagramHorizontal W p.unop.len q r) + map f := SimplicialDiagonal.nerveDiagonal.map (tripleInnerReindex W q r f.unop.toOrderHom) + map_id p := by + change SimplicialDiagonal.nerveDiagonal.map + (tripleInnerReindex W q r (OrderHom.id (α:=Fin (p.unop.len+1)))) = _ + rw [tripleInnerReindex_id,CategoryTheory.Functor.map_id] + map_comp f g := by rw [show (f ≫ g).unop.toOrderHom = f.unop.toOrderHom.comp g.unop.toOrderHom from rfl, + tripleInnerReindex_comp,Functor.map_comp] +noncomputable def innerNerveRows (q r:ℕ) : SimplicialObject SSet where + obj p := nerve (Diagram (Diagram (Diagram C (Fin (p.unop.len+1))) (Fin (q+1))) (Fin (r+1))) + map f := nerveMap (Diagram.map (Diagram.map (Diagram.reindex f.unop.toOrderHom))) + map_id p := by + change nerveMap (Diagram.map (I:=Fin (r+1)) (Diagram.map (I:=Fin (q+1)) + (Diagram.reindex (C:=C) (OrderHom.id (α:=Fin (p.unop.len+1))))))=𝟙 _ + rw [Diagram.map_map_reindex_id] + rfl + map_comp f g := by + change nerveMap (Diagram.map (I:=Fin (r+1)) (Diagram.map (I:=Fin (q+1)) + (Diagram.reindex (C:=C) (f.unop.toOrderHom.comp g.unop.toOrderHom)))) = _ + rw [Diagram.map_map_reindex_comp] + rfl + +noncomputable def innerResolutionAugmentation (q r:ℕ) : + innerResolutionRows W q r ⟶ innerNerveRows (C:=C) q r where + app p := tripleResolutionAugmentation W p.unop.len q r + naturality _ _ f := tripleResolutionAugmentation_inner_natural W q r f.unop.toOrderHom +noncomputable instance innerResolutionTotal_isIso (q r j:ℕ) : + IsIso (SSet.homologyMap + (SimplicialDiagonal.diagonal.map (innerResolutionAugmentation W q r)) + DiagonalResolution.Z j) := by + apply SimplicialDiagonal.homologyMap_isIso + intro p n + exact tripleResolutionAugmentation_isIso W p.unop.len q r n + +lemma tripleInnerMiddle_commute (r:ℕ) {p s q t:ℕ} + (u:Fin (p+1)→oFin (s+1)) (v:Fin (q+1)→oFin (t+1)) : + tripleInnerReindex W t r u ≫ tripleMiddleReindex W p r v = + tripleMiddleReindex W s r v ≫ tripleInnerReindex W q r u := by + apply NatTrans.ext; funext n; apply Cat.ext + exact Diagram.map_map_reindex (Diagram.reindex u) v +noncomputable def innerRowsMiddle (r:ℕ) {q s:ℕ} (u:Fin (q+1)→oFin (s+1)) : + innerResolutionRows W s r ⟶ innerResolutionRows W q r where + app p := SimplicialDiagonal.nerveDiagonal.map (tripleMiddleReindex W p.unop.len r u) + naturality n m f := by + change SimplicialDiagonal.nerveDiagonal.map (tripleInnerReindex W s r f.unop.toOrderHom) ≫ + SimplicialDiagonal.nerveDiagonal.map (tripleMiddleReindex W m.unop.len r u) = _ + rw [←Functor.map_comp,tripleInnerMiddle_commute,Functor.map_comp] + rfl +noncomputable def innerNerveRowsMiddle (r:ℕ) {q s:ℕ} (u:Fin (q+1)→oFin (s+1)) : + innerNerveRows (C:=C) s r ⟶ innerNerveRows (C:=C) q r where + app p := nerveMap (Diagram.map (I:=Fin (r+1)) (Diagram.reindex (C:=Diagram C (Fin (p.unop.len+1))) u)) + naturality n m f := by + change nerveMap (Diagram.map (Diagram.map (Diagram.reindex f.unop.toOrderHom)) ⋙ + Diagram.map (Diagram.reindex u)) = nerveMap (Diagram.map (Diagram.reindex u) ⋙ + Diagram.map (Diagram.map (Diagram.reindex f.unop.toOrderHom))) + rw [Diagram.map_map_reindex] +lemma innerResolutionAugmentation_middle_natural (r:ℕ) {q s:ℕ} + (u:Fin (q+1)→oFin (s+1)) : + innerRowsMiddle W r u ≫ innerResolutionAugmentation W q r = + innerResolutionAugmentation W s r ≫ innerNerveRowsMiddle (C:=C) r u := by + apply NatTrans.ext; funext p + exact tripleResolutionAugmentation_middle_natural W p.unop.len r u +lemma innerRowsMiddle_id (q r:ℕ) : innerRowsMiddle W r (OrderHom.id (α:=Fin (q+1))) = 𝟙 _ := by + apply NatTrans.ext; funext p + have he : tripleMiddleReindex W p.unop.len r (OrderHom.id (α:=Fin (q+1))) = 𝟙 _ := by + apply NatTrans.ext; funext n; apply Cat.ext + exact Diagram.map_reindex_id + change SimplicialDiagonal.nerveDiagonal.map _ = _ + rw [he,CategoryTheory.Functor.map_id] + rfl +lemma innerRowsMiddle_comp (r:ℕ) {p q s:ℕ} + (u:Fin (p+1)→oFin (q+1)) (v:Fin (q+1)→oFin (s+1)) : + innerRowsMiddle W r (v.comp u) = innerRowsMiddle W r v ≫ innerRowsMiddle W r u := by + apply NatTrans.ext; funext n + have he : tripleMiddleReindex W n.unop.len r (v.comp u) = + tripleMiddleReindex W n.unop.len r v ≫ tripleMiddleReindex W n.unop.len r u := by + apply NatTrans.ext; funext k; apply Cat.ext + exact Diagram.map_reindex_comp u v + change SimplicialDiagonal.nerveDiagonal.map _ = _ + rw [he,Functor.map_comp] + rfl +noncomputable def middleResolutionRows (r:ℕ) : SimplicialObject SSet where + obj q := SimplicialDiagonal.diagonal.obj (innerResolutionRows W q.unop.len r) + map f := SimplicialDiagonal.diagonal.map (innerRowsMiddle W r f.unop.toOrderHom) + map_id q := by + change SimplicialDiagonal.diagonal.map (innerRowsMiddle W r (OrderHom.id (α:=Fin (q.unop.len+1)))) = _ + rw [innerRowsMiddle_id,CategoryTheory.Functor.map_id] + map_comp f g := by + change SimplicialDiagonal.diagonal.map (innerRowsMiddle W r (f.unop.toOrderHom.comp g.unop.toOrderHom)) = _ + rw [innerRowsMiddle_comp,Functor.map_comp] + +lemma innerNerveRowsMiddle_id (q r:ℕ) : + innerNerveRowsMiddle (C:=C) r (OrderHom.id (α:=Fin (q+1))) = 𝟙 _ := by + apply NatTrans.ext; funext p + change nerveMap (Diagram.map (I:=Fin (r+1)) (Diagram.reindex (C:=Diagram C (Fin (p.unop.len+1))) + (OrderHom.id (α:=Fin (q+1))))) = _ + rw [Diagram.map_reindex_id] + rfl +lemma innerNerveRowsMiddle_comp (r:ℕ) {p q s:ℕ} + (u:Fin (p+1)→oFin (q+1)) (v:Fin (q+1)→oFin (s+1)) : + innerNerveRowsMiddle (C:=C) r (v.comp u) = + innerNerveRowsMiddle (C:=C) r v ≫ innerNerveRowsMiddle (C:=C) r u := by + apply NatTrans.ext; funext n + change nerveMap (Diagram.map (I:=Fin (r+1)) (Diagram.reindex (C:=Diagram C (Fin (n.unop.len+1))) + (v.comp u))) = _ + rw [Diagram.map_reindex_comp] + rfl +noncomputable def middleNerveRows (r:ℕ) : SimplicialObject SSet where + obj q := SimplicialDiagonal.diagonal.obj (innerNerveRows (C:=C) q.unop.len r) + map f := SimplicialDiagonal.diagonal.map (innerNerveRowsMiddle (C:=C) r f.unop.toOrderHom) + map_id q := by + change SimplicialDiagonal.diagonal.map (innerNerveRowsMiddle (C:=C) r (OrderHom.id (α:=Fin (q.unop.len+1)))) = _ + rw [innerNerveRowsMiddle_id,CategoryTheory.Functor.map_id] + map_comp f g := by + change SimplicialDiagonal.diagonal.map (innerNerveRowsMiddle (C:=C) r (f.unop.toOrderHom.comp g.unop.toOrderHom)) = _ + rw [innerNerveRowsMiddle_comp,Functor.map_comp] +noncomputable def middleResolutionAugmentation (r:ℕ) : + middleResolutionRows W r ⟶ middleNerveRows (C:=C) r where + app q := SimplicialDiagonal.diagonal.map (innerResolutionAugmentation W q.unop.len r) + naturality n m f := by + change SimplicialDiagonal.diagonal.map (innerRowsMiddle W r f.unop.toOrderHom) ≫ + SimplicialDiagonal.diagonal.map (innerResolutionAugmentation W m.unop.len r) = _ + rw [←Functor.map_comp,innerResolutionAugmentation_middle_natural,Functor.map_comp] + rfl +noncomputable instance middleResolutionTotal_isIso (r j:ℕ) : + IsIso (SSet.homologyMap + (SimplicialDiagonal.diagonal.map (middleResolutionAugmentation W r)) + DiagonalResolution.Z j) := by + apply SimplicialDiagonal.homologyMap_isIso + intro p n + exact innerResolutionTotal_isIso W p.unop.len r n + +lemma tripleInnerOuter_commute (q:ℕ) {p s r t:ℕ} + (u:Fin (p+1)→oFin (s+1)) (v:Fin (r+1)→oFin (t+1)) : + tripleInnerReindex W q t u ≫ tripleOuterReindex W p q v = + tripleOuterReindex W s q v ≫ tripleInnerReindex W q r u := by + apply NatTrans.ext; funext n; apply Cat.ext + exact (Diagram.reindex_map (Diagram.map (Diagram.reindex u)) v).symm +lemma tripleMiddleOuter_commute (p:ℕ) {q s r t:ℕ} + (u:Fin (q+1)→oFin (s+1)) (v:Fin (r+1)→oFin (t+1)) : + tripleMiddleReindex W p t u ≫ tripleOuterReindex W p q v = + tripleOuterReindex W p s v ≫ tripleMiddleReindex W p r u := by + apply NatTrans.ext; funext n; apply Cat.ext + exact (Diagram.reindex_map (Diagram.reindex u) v).symm +noncomputable def innerRowsOuter (q:ℕ) {r s:ℕ} (u:Fin (r+1)→oFin (s+1)) : + innerResolutionRows W q s ⟶ innerResolutionRows W q r where + app p := SimplicialDiagonal.nerveDiagonal.map (tripleOuterReindex W p.unop.len q u) + naturality n m f := by + change SimplicialDiagonal.nerveDiagonal.map (tripleInnerReindex W q s f.unop.toOrderHom) ≫ + SimplicialDiagonal.nerveDiagonal.map (tripleOuterReindex W m.unop.len q u) = _ + rw [←Functor.map_comp,tripleInnerOuter_commute,Functor.map_comp] + rfl +noncomputable def innerNerveRowsOuter (q:ℕ) {r s:ℕ} (u:Fin (r+1)→oFin (s+1)) : + innerNerveRows (C:=C) q s ⟶ innerNerveRows (C:=C) q r where + app p := nerveMap (Diagram.reindex (C:=Diagram (Diagram C (Fin (p.unop.len+1))) (Fin (q+1))) u) + naturality n m f := by + change nerveMap (Diagram.map (Diagram.map (Diagram.reindex f.unop.toOrderHom)) ⋙ + Diagram.reindex u) = nerveMap (Diagram.reindex u ⋙ + Diagram.map (Diagram.map (Diagram.reindex f.unop.toOrderHom))) + rw [Diagram.reindex_map] +lemma innerResolutionAugmentation_outer_natural (q:ℕ) {r s:ℕ} + (u:Fin (r+1)→oFin (s+1)) : + innerRowsOuter W q u ≫ innerResolutionAugmentation W q r = + innerResolutionAugmentation W q s ≫ innerNerveRowsOuter (C:=C) q u := by + apply NatTrans.ext; funext p + exact tripleResolutionAugmentation_outer_natural W p.unop.len q u +lemma innerRowsMiddleOuter_commute {q s r t:ℕ} + (u:Fin (q+1)→oFin (s+1)) (v:Fin (r+1)→oFin (t+1)) : + innerRowsMiddle W t u ≫ innerRowsOuter W q v = + innerRowsOuter W s v ≫ innerRowsMiddle W r u := by + apply NatTrans.ext; funext p + change SimplicialDiagonal.nerveDiagonal.map (tripleMiddleReindex W p.unop.len t u) ≫ + SimplicialDiagonal.nerveDiagonal.map (tripleOuterReindex W p.unop.len q v) = _ + rw [←Functor.map_comp,tripleMiddleOuter_commute,Functor.map_comp] + rfl +lemma innerNerveRowsMiddleOuter_commute {q s r t:ℕ} + (u:Fin (q+1)→oFin (s+1)) (v:Fin (r+1)→oFin (t+1)) : + innerNerveRowsMiddle (C:=C) t u ≫ innerNerveRowsOuter (C:=C) q v = + innerNerveRowsOuter (C:=C) s v ≫ innerNerveRowsMiddle (C:=C) r u := by + apply NatTrans.ext; funext p + change nerveMap (Diagram.map (Diagram.reindex u) ⋙ Diagram.reindex v) = + nerveMap (Diagram.reindex v ⋙ Diagram.map (Diagram.reindex u)) + rw [Diagram.reindex_map] +noncomputable def middleRowsOuter {r s:ℕ} (u:Fin (r+1)→oFin (s+1)) : + middleResolutionRows W s ⟶ middleResolutionRows W r where + app q := SimplicialDiagonal.diagonal.map (innerRowsOuter W q.unop.len u) + naturality n m f := by + change SimplicialDiagonal.diagonal.map (innerRowsMiddle W s f.unop.toOrderHom) ≫ + SimplicialDiagonal.diagonal.map (innerRowsOuter W m.unop.len u) = _ + rw [←Functor.map_comp,innerRowsMiddleOuter_commute,Functor.map_comp] + rfl +noncomputable def middleNerveRowsOuter {r s:ℕ} (u:Fin (r+1)→oFin (s+1)) : + middleNerveRows (C:=C) s ⟶ middleNerveRows (C:=C) r where + app q := SimplicialDiagonal.diagonal.map (innerNerveRowsOuter (C:=C) q.unop.len u) + naturality n m f := by + change SimplicialDiagonal.diagonal.map (innerNerveRowsMiddle (C:=C) s f.unop.toOrderHom) ≫ + SimplicialDiagonal.diagonal.map (innerNerveRowsOuter (C:=C) m.unop.len u) = _ + rw [←Functor.map_comp,innerNerveRowsMiddleOuter_commute,Functor.map_comp] + rfl +lemma middleResolutionAugmentation_outer_natural {r s:ℕ} + (u:Fin (r+1)→oFin (s+1)) : + middleRowsOuter W u ≫ middleResolutionAugmentation W r = + middleResolutionAugmentation W s ≫ middleNerveRowsOuter (C:=C) u := by + apply NatTrans.ext; funext q + change SimplicialDiagonal.diagonal.map (innerRowsOuter W q.unop.len u) ≫ + SimplicialDiagonal.diagonal.map (innerResolutionAugmentation W q.unop.len r) = _ + rw [←Functor.map_comp,innerResolutionAugmentation_outer_natural,Functor.map_comp] + rfl + +lemma innerRowsOuter_id (q r:ℕ) : innerRowsOuter W q (OrderHom.id (α:=Fin (r+1))) = 𝟙 _ := by + apply NatTrans.ext; funext p + have he : tripleOuterReindex W p.unop.len q (OrderHom.id (α:=Fin (r+1))) = 𝟙 _ := by + apply NatTrans.ext; funext n; apply Cat.ext + exact Diagram.reindex_id + change SimplicialDiagonal.nerveDiagonal.map _ = _ + rw [he,CategoryTheory.Functor.map_id] + rfl +lemma innerRowsOuter_comp (q:ℕ) {p r s:ℕ} + (u:Fin (p+1)→oFin (r+1)) (v:Fin (r+1)→oFin (s+1)) : + innerRowsOuter W q (v.comp u) = innerRowsOuter W q v ≫ innerRowsOuter W q u := by + apply NatTrans.ext; funext n + have he : tripleOuterReindex W n.unop.len q (v.comp u) = + tripleOuterReindex W n.unop.len q v ≫ tripleOuterReindex W n.unop.len q u := by + apply NatTrans.ext; funext k; apply Cat.ext + exact Diagram.reindex_comp u v + change SimplicialDiagonal.nerveDiagonal.map _ = _ + rw [he,Functor.map_comp] + rfl +lemma middleRowsOuter_id (r:ℕ) : middleRowsOuter W (OrderHom.id (α:=Fin (r+1))) = 𝟙 _ := by + apply NatTrans.ext; funext q + change SimplicialDiagonal.diagonal.map (innerRowsOuter W q.unop.len (OrderHom.id (α:=Fin (r+1)))) = _ + rw [innerRowsOuter_id,CategoryTheory.Functor.map_id] + rfl +lemma middleRowsOuter_comp {p r s:ℕ} + (u:Fin (p+1)→oFin (r+1)) (v:Fin (r+1)→oFin (s+1)) : + middleRowsOuter W (v.comp u) = middleRowsOuter W v ≫ middleRowsOuter W u := by + apply NatTrans.ext; funext q + change SimplicialDiagonal.diagonal.map (innerRowsOuter W q.unop.len (v.comp u)) = _ + rw [innerRowsOuter_comp,Functor.map_comp] + rfl +lemma innerNerveRowsOuter_id (q r:ℕ) : + innerNerveRowsOuter (C:=C) q (OrderHom.id (α:=Fin (r+1))) = 𝟙 _ := by + apply NatTrans.ext; funext p + change nerveMap (Diagram.reindex (C:=Diagram (Diagram C (Fin (p.unop.len+1))) (Fin (q+1))) + (OrderHom.id (α:=Fin (r+1)))) = _ + rw [Diagram.reindex_id] + rfl +lemma innerNerveRowsOuter_comp (q:ℕ) {p r s:ℕ} + (u:Fin (p+1)→oFin (r+1)) (v:Fin (r+1)→oFin (s+1)) : + innerNerveRowsOuter (C:=C) q (v.comp u) = + innerNerveRowsOuter (C:=C) q v ≫ innerNerveRowsOuter (C:=C) q u := by + apply NatTrans.ext; funext n + change nerveMap (Diagram.reindex (C:=Diagram (Diagram C (Fin (n.unop.len+1))) (Fin (q+1))) + (v.comp u)) = _ + rw [Diagram.reindex_comp] + rfl +lemma middleNerveRowsOuter_id (r:ℕ) : + middleNerveRowsOuter (C:=C) (OrderHom.id (α:=Fin (r+1))) = 𝟙 _ := by + apply NatTrans.ext; funext q + change SimplicialDiagonal.diagonal.map (innerNerveRowsOuter (C:=C) q.unop.len (OrderHom.id (α:=Fin (r+1)))) = _ + rw [innerNerveRowsOuter_id,CategoryTheory.Functor.map_id] + rfl +lemma middleNerveRowsOuter_comp {p r s:ℕ} + (u:Fin (p+1)→oFin (r+1)) (v:Fin (r+1)→oFin (s+1)) : + middleNerveRowsOuter (C:=C) (v.comp u) = + middleNerveRowsOuter (C:=C) v ≫ middleNerveRowsOuter (C:=C) u := by + apply NatTrans.ext; funext q + change SimplicialDiagonal.diagonal.map (innerNerveRowsOuter (C:=C) q.unop.len (v.comp u)) = _ + rw [innerNerveRowsOuter_comp,Functor.map_comp] + rfl +noncomputable def outerResolutionRows : SimplicialObject SSet where + obj r := SimplicialDiagonal.diagonal.obj (middleResolutionRows W r.unop.len) + map f := SimplicialDiagonal.diagonal.map (middleRowsOuter W f.unop.toOrderHom) + map_id r := by + change SimplicialDiagonal.diagonal.map (middleRowsOuter W (OrderHom.id (α:=Fin (r.unop.len+1)))) = _ + rw [middleRowsOuter_id,CategoryTheory.Functor.map_id] + map_comp f g := by + change SimplicialDiagonal.diagonal.map (middleRowsOuter W (f.unop.toOrderHom.comp g.unop.toOrderHom)) = _ + rw [middleRowsOuter_comp,Functor.map_comp] +noncomputable def outerNerveRows : SimplicialObject SSet where + obj r := SimplicialDiagonal.diagonal.obj (middleNerveRows (C:=C) r.unop.len) + map f := SimplicialDiagonal.diagonal.map (middleNerveRowsOuter (C:=C) f.unop.toOrderHom) + map_id r := by + change SimplicialDiagonal.diagonal.map (middleNerveRowsOuter (C:=C) (OrderHom.id (α:=Fin (r.unop.len+1)))) = _ + rw [middleNerveRowsOuter_id,CategoryTheory.Functor.map_id] + map_comp f g := by + change SimplicialDiagonal.diagonal.map (middleNerveRowsOuter (C:=C) (f.unop.toOrderHom.comp g.unop.toOrderHom)) = _ + rw [middleNerveRowsOuter_comp,Functor.map_comp] +noncomputable def outerResolutionAugmentation : + outerResolutionRows W ⟶ outerNerveRows (C:=C) where + app r := SimplicialDiagonal.diagonal.map (middleResolutionAugmentation W r.unop.len) + naturality n m f := by + change SimplicialDiagonal.diagonal.map (middleRowsOuter W f.unop.toOrderHom) ≫ + SimplicialDiagonal.diagonal.map (middleResolutionAugmentation W m.unop.len) = _ + rw [←Functor.map_comp,middleResolutionAugmentation_outer_natural,Functor.map_comp] + rfl + +noncomputable instance tripleResolutionTotal_isIso (j:ℕ) : + IsIso (SSet.homologyMap + (SimplicialDiagonal.diagonal.map (outerResolutionAugmentation W)) + DiagonalResolution.Z j) := by + apply SimplicialDiagonal.homologyMap_isIso + intro p n + exact middleResolutionTotal_isIso W p.unop.len n +end + +open IntervalBar IntervalBar.Diagram + +variable {C:Type} [Groupoid.{0} C] [MonoidalCategory C] [SymmetricCategory C] +lemma reverseDiagonalReindex {I J:Type} [Preorder I] [Preorder J] (u:I→oJ) : + Diagram.reindex (C:=Diagram (Diagram C J) J) u ⋙ + Diagram.map (I:=I) (Diagram.reindex (C:=Diagram C J) u) ⋙ + Diagram.map (I:=I) (Diagram.map (I:=I) (Diagram.reindex (C:=C) u)) = + diagonalReindex (C:=C) u := by + unfold diagonalReindex + rw [←Functor.assoc,Diagram.reindex_map,Functor.assoc] + rw [Diagram.reindex_map] + rw [←Functor.assoc,←Diagram.map_map_reindex,Functor.assoc] +noncomputable def totalNerveBarIso : + SimplicialDiagonal.diagonal.obj (outerNerveRows (C:=C)) ≅ bar₃ (C:=C) := + NatIso.ofComponents (fun _=>Iso.refl _) (by + intro n m f + ext x + exact congrArg (fun F => f.unop.toOrderHom.toFunctor ⋙ x ⋙ F) + (reverseDiagonalReindex (C:=C) f.unop.toOrderHom)) +variable (W:MorphismProperty C) + [Fact W.StableUnderInverse] [W.IsStableUnderBraiding] +noncomputable def totalStringToBar : + SimplicialDiagonal.diagonal.obj (outerResolutionRows W) ⟶ bar₃ (C:=C) := + SimplicialDiagonal.diagonal.map (outerResolutionAugmentation W) ≫ totalNerveBarIso.hom +noncomputable instance totalStringToBar_isIso (j:ℕ) : + IsIso (SSet.homologyMap (totalStringToBar W) DiagonalResolution.Z j) := by + unfold totalStringToBar + rw [SSet.homologyMap_comp] + have := tripleResolutionTotal_isIso W j + infer_instance +end RestrictedNerve + +end + +namespace SimpleAmenable.PolygonObject +open _root_.CategoryTheory _root_.OAI.CategoryTheory + +instance positionalPropertyInverse (a:ℕ) : Fact (positionalProperty a).StableUnderInverse where + out := by + intro U V e h + change Positional e.hom at h + change Positional e.inv + have hi := positional_inv h + simpa using hi + +noncomputable def tripleStringToBar (a:ℕ) : + SimplicialDiagonal.diagonal.obj (RestrictedNerve.outerResolutionRows (positionalProperty a)) ⟶ + IntervalBar.Diagram.bar₃ (C:=PolygonObject a) := + RestrictedNerve.totalStringToBar (positionalProperty a) +noncomputable instance tripleStringToBar_isIso (a j:ℕ) : + IsIso (SSet.homologyMap (tripleStringToBar a) DiagonalResolution.Z j) := + RestrictedNerve.totalStringToBar_isIso (positionalProperty a) j +end SimpleAmenable.PolygonObject + +open _root_.CategoryTheory _root_.OAI.CategoryTheory MonoidalCategory SimplicialObject Simplicial Opposite +namespace RestrictedNerve +open IntervalBar IntervalBar.Diagram + +variable {C:Type} [Groupoid.{0} C] (W:MorphismProperty C) + [Fact W.StableUnderInverse] [MonoidalCategory C] [SymmetricCategory C] + [W.IsStableUnderBraiding] +noncomputable def stringBarRows : SimplicialObject SSet where + obj n := bar₃ (C:=Strings W n.unop.len) + map f := bar₃Map (reindex W f.unop.toOrderHom.toFunctor) + map_id n := by + ext k x + exact congrArg (fun F => x ⋙ F) + (map₃_strings_reindex_id W n.unop.len k.unop.len k.unop.len k.unop.len) + map_comp f g := by + ext k x + exact congrArg (fun F => x ⋙ F) + (map₃_strings_reindex_comp W k.unop.len k.unop.len k.unop.len + g.unop.toOrderHom.toFunctor f.unop.toOrderHom.toFunctor) + +noncomputable def stringBarTotalComponent (n:SimplexCategoryᵒᵖ) : + (SimplicialDiagonal.diagonal.obj (stringBarRows W)).obj n ≅ + (SimplicialDiagonal.diagonal.obj (outerResolutionRows W)).obj n := Iso.refl _ +end RestrictedNerve + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/TrajectoryFinite.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/TrajectoryFinite.lean new file mode 100644 index 0000000000000000000000000000000000000000..688174b5008842f803906fc030a4983b88a10d9a --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/TrajectoryFinite.lean @@ -0,0 +1,160 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.E2Descend +import OAI.GroupTheory.SimpleAmenable.Simplicial.LowerBarComposition +import OAI.GroupTheory.SimpleAmenable.Simplicial.StringBarNaturality +import OAI.GroupTheory.SimpleAmenable.Homology.TrajectoryDifferential + +namespace OAI + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Opposite AlgebraicTopology HomologicalComplex +namespace SimplicialDiagonal + +noncomputable def rowsIso (X : I ⥤ SSet) : EilenbergZilber.bisimplicial (uncurry X) ≅ X := + NatIso.ofComponents (rowIso X) (by + intro n m f + ext k x + simp [rowIso,EilenbergZilber.bisimplicial,uncurry,Functor.uncurry]) +noncomputable def homologyRowIso (X : I ⥤ SSet) (q : ℕ) : + TotalFiniteness.row (EilenbergZilber.twoComplex (uncurry X)) q ≅ + AlternatingFaceMapComplex.obj (X ⋙ SSet.homologyFunctor DiagonalResolution.Z q) := + BarHomology.rowIso (uncurry X) q ≪≫ (alternatingFaceMapComplex FreeChains.A).mapIso + (Functor.isoWhiskerRight (rowsIso X) (SSet.homologyFunctor DiagonalResolution.Z q)) +noncomputable def homologyRowHomologyIso (X : I ⥤ SSet) (p q : ℕ) : + (TotalFiniteness.row (EilenbergZilber.twoComplex (uncurry X)) q).homology p ≅ + (AlternatingFaceMapComplex.obj (X ⋙ SSet.homologyFunctor DiagonalResolution.Z q)).homology p := + (homologyFunctor FreeChains.A FreeChains.c p).mapIso (homologyRowIso X q) +lemma rows_connected (X : I ⥤ SSet) (hX : ∀ n,SSet.IsConnected (X.obj n)) (p : I) : + SSet.IsConnected ((EilenbergZilber.bisimplicial (uncurry X)).obj p) := by + have := hX p + exact BarFinitePower.connected_of_iso _ (rowIso X p) +end SimplicialDiagonal +namespace BarHomology +open FreeChains + +lemma zeroRow_finite (X : DiagonalResolution.Dᵒᵖ ⥤ Type) + (hc : ∀ p, SSet.IsConnected ((EilenbergZilber.bisimplicial X).obj p)) (p : ℕ) : + Module.Finite ℤ ((TotalFiniteness.row (EilenbergZilber.twoComplex X) 0).homology p) := by + let K := AlternatingFaceMapComplex.obj ((Functor.const SimplexCategoryᵒᵖ).obj Z) + have : Module.Finite ℤ (K.X p) := by + change Module.Finite ℤ (ModuleCat.of ℤ ℤ) + infer_instance + have : Module.Finite ℤ (K.homology p) := finite_homology K p + let e : K.homology p ≅ (TotalFiniteness.row (EilenbergZilber.twoComplex X) 0).homology p := + (homologyFunctor A c p).mapIso (zeroRowIso X hc).symm + exact Module.Finite.equiv e.toLinearEquiv +end BarHomology +namespace RestrictedNerve +open IntervalBar.Diagram +variable {C:Type} [Groupoid.{0} C] (W:MorphismProperty C) + [Fact W.StableUnderInverse] [MonoidalCategory C] [SymmetricCategory C] + [W.IsStableUnderBraiding] +lemma stringBarRows_connected (p : SimplexCategoryᵒᵖ) : SSet.IsConnected ((stringBarRows W).obj p) := + bar₃_connected +lemma finite_bar₃_of_string (n : ℕ) + [Module.Finite ℤ (SSet.homology (C:=FreeChains.A) (SimplicialDiagonal.diagonal.obj (stringBarRows W)) DiagonalResolution.Z n)] : + Module.Finite ℤ ((bar₃ (C:=C)).homology DiagonalResolution.Z n : FreeChains.A) := + Module.Finite.equiv (asIso (SSet.homologyMap (stringBarAugmentation W) DiagonalResolution.Z n)).toLinearEquiv +end RestrictedNerve +namespace SimpleAmenable.PolygonObject.LabelledStage +open Labelled IntervalBar.Diagram FreeChains + +attribute [local instance 1200] Rep.hV2 Representation.instModuleAsModule TensorProduct.instModule +noncomputable def trajectoryE2Iso (a p q : ℕ) (hq : 0 + intro hq + by_cases hq0:q=0 + · subst q + have := hc (op ⦋1⦌) + exact BarFinitePower.homology_zero_finite _ + · have := hs q (by omega) + have := hf (1+q) (by omega) + apply finite_reverse_step X q hc (hz q (by omega)) + intro p i hi + exact hrows i (by intro j hj; exact ih j (by omega) (by omega)) p +end SimplicialDiagonal + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/TrajectoryReindexLabels.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/TrajectoryReindexLabels.lean new file mode 100644 index 0000000000000000000000000000000000000000..d6228636f42e5b2077de64061f90aa5ca57e0269 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/TrajectoryReindexLabels.lean @@ -0,0 +1,197 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.TripleBarMaps +import OAI.GroupTheory.SimpleAmenable.Homology.LabelRelabel +import OAI.GroupTheory.SimpleAmenable.Configurations.LabelTranslation +import OAI.GroupTheory.SimpleAmenable.Configurations.LabelledStringEquiv + +namespace OAI + +open _root_.CategoryTheory _root_.OAI.CategoryTheory MonoidalCategory +namespace SimpleAmenable.PolygonObject.Labelled +section + +variable {a n m:ℕ} +def reindexLabel (u : Fin (m+1) ⥤ Fin (n+1)) + (g:Fin n → CutRing × CutRing) (i:Fin m) : CutRing × CutRing := + Fin.partialSum g (u.obj i.succ)-Fin.partialSum g (u.obj i.castSucc) +def initialDisplacement (u : Fin (m+1) ⥤ Fin (n+1)) + (g:Fin n → CutRing × CutRing) : CutRing × CutRing := + Fin.partialSum g (u.obj 0) +lemma representative_partialSum (g:Fin n → CutRing × CutRing) (hg:Reduced g) (i:Fin (n+1)) : + orbitRepresentative (Fin.partialSum g i)=Fin.partialSum g i := by + induction i using Fin.induction with + | zero => simp only [Fin.partialSum_zero]; rfl + | succ i ih => rw [Fin.partialSum_succ,representative_add,ih,hg i] +lemma reindexLabel_reduced (u : Fin (m+1) ⥤ Fin (n+1)) + (g:Fin n → CutRing × CutRing) (hg:Reduced g) : Reduced (reindexLabel u g) := by + intro i + rw [reindexLabel,representative_sub,representative_partialSum g hg,representative_partialSum g hg] +lemma partialSum_reindexLabel (u : Fin (m+1) ⥤ Fin (n+1)) + (g:Fin n → CutRing × CutRing) (i:Fin (m+1)) : + Fin.partialSum (reindexLabel u g) i = + Fin.partialSum g (u.obj i)-initialDisplacement u g := by + induction i using Fin.induction with + | zero => simp only [Fin.partialSum_zero,initialDisplacement,sub_self] + | succ i ih => rw [Fin.partialSum_succ,ih,reindexLabel]; abel +noncomputable abbrev vertexArrow (U:Labelled a n) (i:Fin (n+1)) : + U.polygon ⟶ (string U).obj.obj i := + shiftArrow U.polygon (fun k => Fin.partialSum (U.label k) i) +lemma initial_baseArrow (U:Labelled a n) (i:Fin (n+1)) : + initial U ≫ baseArrow (string U).obj i=vertexArrow U i := by + change initial U ≫ (inv (initial U) ≫ vertexArrow U i) = _ + simp +lemma vertexArrow_zero (U:Labelled a n) : vertexArrow U 0=initial U := rfl +lemma vertexArrow_ladder {U V:Labelled a n} (f:U⟶V) (i:Fin (n+1)) : + vertexArrow U i ≫ (ladder f).hom.app i = f.arrow ≫ vertexArrow V i := by + rw [←initial_baseArrow,Category.assoc] + have h := (ladder f).hom.naturality (homOfLE (Fin.zero_le i)) + change baseArrow _ i ≫ (ladder f).hom.app i = (ladder f).hom.app 0 ≫ baseArrow _ i at h + rw [h,ladder_zero] + simp only [initialArrow,Category.assoc,IsIso.hom_inv_id_assoc,←initial_baseArrow] +lemma ladder_app {U V:Labelled a n} (f:U⟶V) (i:Fin (n+1)) : + (ladder f).hom.app i = inv (vertexArrow U i) ≫ f.arrow ≫ vertexArrow V i := by + apply (cancel_epi (vertexArrow U i)).mp + rw [vertexArrow_ladder] + simp +lemma trajectoryShift_vertex (U:Labelled a n) (x:U.polygon.Point) (i:Fin (n+1)) : + trajectoryShift (string U).obj ((initial U).toEquiv x) i = Fin.partialSum (U.label x.val.1) i := by + change trajectoryShift (translationString U.polygon (fun j k => Fin.partialSum (U.label k) j)) + ((shiftArrow U.polygon (fun k => Fin.partialSum (U.label k) 0)).toEquiv x) i = _ + rw [trajectoryShift_translationString] + simp only [Fin.partialSum_zero,sub_zero] + exact representative_partialSum _ (U.reduced _) i +lemma increments_vertex_reindex (U:Labelled a n) (u : Fin (m+1) ⥤ Fin (n+1)) + (x:U.polygon.Point) : + increments (u ⋙ (string U).obj) ((vertexArrow U (u.obj 0)).toEquiv x) = + reindexLabel u (U.label x.val.1) := by + funext i + rw [←initial_baseArrow,arrow_comp_apply,increments_reindex, + trajectoryShift_vertex,trajectoryShift_vertex] + rfl +end + +section +variable {a n m:ℕ} (u:Fin (m+1) ⥤ Fin (n+1)) +noncomputable def reindexFunctor : Labelled a n ⥤ Labelled a m := + translateFunctor (initialDisplacement u) ⋙ relabel (reindexLabel u) (reindexLabel_reduced u) +lemma reindexFunctor_arrow {U V:Labelled a n} (f: U⟶V) : + ((reindexFunctor u).map f).arrow = + inv (vertexArrow U (u.obj 0)) ≫ f.arrow ≫ vertexArrow V (u.obj 0) := rfl +noncomputable abbrev reindexInitial (U:Labelled a n) : + (string ((reindexFunctor u).obj U)).obj.obj 0 ⟶ (string U).obj.obj (u.obj 0) := + inv (X := ((reindexFunctor u).obj U).polygon) + (Y := (string ((reindexFunctor u).obj U)).obj.obj 0) (initial ((reindexFunctor u).obj U)) +lemma reindexInitial_positional (U:Labelled a n) : Positional (reindexInitial u U) := + positional_inv (incrementInitial_positional _ _) +lemma reindexInitial_labels (U:Labelled a n) + (x:((string ((reindexFunctor u).obj U)).obj.obj 0).Point) : + increments (u ⋙ (string U).obj) ((reindexInitial u U).toEquiv x) = + increments (string ((reindexFunctor u).obj U)).obj x := by + obtain ⟨y,rfl⟩ := (initial ((reindexFunctor u).obj U)).toEquiv.surjective x + rw [incrementString_spec_reduced _ _ ((reindexFunctor u).obj U).reduced] + have h : (reindexInitial u U).toEquiv ((initial ((reindexFunctor u).obj U)).toEquiv y)=y := by + erw [inv_arrow_apply] + exact Equiv.symm_apply_apply _ _ + rw [h] + obtain ⟨z,rfl⟩ := (vertexArrow U (u.obj 0)).toEquiv.surjective y + exact increments_vertex_reindex U u z +noncomputable def reindexLadder (U:Labelled a n) : + string ((reindexFunctor u).obj U) ⟶ (stringReindex u).obj (string U) := + ⟨extendLadder (reindexInitial u U),extendLadder_positional_of_increments _ + (reindexInitial_positional u U) (reindexInitial_labels u U)⟩ +@[simp] lemma reindexLadder_zero (U:Labelled a n) : + (reindexLadder u U).hom.app 0=reindexInitial u U := extendLadder_zero _ +private lemma comp_inv_last {D : Type*} [Category D] {A B X Y : D} + (a : A ⟶ B) (f : B ⟶ X) (g : X ⟶ Y) [IsIso g] : + (a ≫ f ≫ g) ≫ inv g = a ≫ f := by + simp only [Category.assoc, IsIso.hom_inv_id, Category.comp_id] + +private lemma cancel_two_inverses {D : Type*} [Category D] {A B X Y : D} + (a : A ⟶ B) (f : A ⟶ X) (g : X ⟶ Y) [IsIso a] [IsIso g] : + a ≫ (inv a ≫ f ≫ g) ≫ inv g = f := by + simp only [Category.assoc, IsIso.hom_inv_id_assoc, IsIso.hom_inv_id, Category.comp_id] + +noncomputable def reindexStringIso : reindexFunctor (a:=a) u ⋙ toStrings ≅ + toStrings ⋙ stringReindex u := + NatIso.ofComponents (fun U => @asIso (StringGroupoid a m) _ _ _ (reindexLadder u U) + (IsIso.of_groupoid (C := StringGroupoid a m) _)) (by + intro U V f + apply WideSubcategory.hom_ext + apply ladder_ext + change (ladder ((reindexFunctor u).map f)).hom.app 0 ≫ (reindexLadder u V).hom.app 0 = + (reindexLadder u U).hom.app 0 ≫ (ladder f).hom.app (u.obj 0) + rw [reindexLadder_zero,reindexLadder_zero,ladder_zero,ladder_app] + simp only [initialArrow,reindexInitial,reindexFunctor_arrow] + exact @comp_inv_last _ _ _ _ _ _ _ _ _ + (IsIso.of_groupoid (C := PolygonObject a) _)) +end + +variable {a n m:ℕ} +lemma tensorLadder_vertex (U V:Labelled a n) (i:Fin (n+1)) : + sumArrow (vertexArrow U i) (vertexArrow V i) ≫ (tensorLadder U V).hom.app i = + vertexArrow (U⊗V) i := by + have h := (tensorLadder U V).hom.naturality (homOfLE (Fin.zero_le i)) + change sumArrow (baseArrow (string U).obj i) (baseArrow (string V).obj i) ≫ + (tensorLadder U V).hom.app i = (tensorLadder U V).hom.app 0 ≫ baseArrow (string (U⊗V)).obj i at h + rw [tensorLadder_zero] at h + erw [←initial_baseArrow,←initial_baseArrow,sumArrow_comp,Category.assoc,h] + change sumArrow (initial U) (initial V) ≫ + (inv (sumArrow (initial U) (initial V)) ≫ initial (U⊗V)) ≫ baseArrow _ i = _ + simp only [Category.assoc,IsIso.hom_inv_id_assoc] + exact initial_baseArrow _ _ +lemma tensorLadder_app (U V:Labelled a n) (i:Fin (n+1)) : + (tensorLadder U V).hom.app i = + inv (sumArrow (vertexArrow U i) (vertexArrow V i)) ≫ vertexArrow (U⊗V) i := by + apply (cancel_epi (sumArrow (vertexArrow U i) (vertexArrow V i))).mp + rw [tensorLadder_vertex,IsIso.hom_inv_id_assoc] +variable (u:Fin (m+1) ⥤ Fin (n+1)) +noncomputable instance reindexMonoidal : (reindexFunctor (a:=a) u).Monoidal := by + unfold reindexFunctor; infer_instance +noncomputable instance reindexBraided : (reindexFunctor (a:=a) u).Braided := by + unfold reindexFunctor; infer_instance +lemma reindex_μ_arrow (U V:Labelled a n) : + (Functor.LaxMonoidal.μ (reindexFunctor u) U V).arrow = + inv (sumArrow (vertexArrow U (u.obj 0)) (vertexArrow V (u.obj 0))) ≫ vertexArrow (U⊗V) (u.obj 0) := by + change (Functor.LaxMonoidal.μ + (translateFunctor (initialDisplacement u) ⋙ relabel (reindexLabel u) (reindexLabel_reduced u)) U V).arrow = _ + rw [Functor.LaxMonoidal.comp_μ] + change (𝟙 _) ≫ (translationTensor (initialDisplacement u) U V).arrow = _ + rw [Category.id_comp] + rfl +noncomputable instance reindexStringMonoidal : NatTrans.IsMonoidal (reindexStringIso (a:=a) u).hom where + unit := by + apply WideSubcategory.hom_ext + apply ladder_ext + apply Arrow.ext + apply Equiv.ext + intro x + change Point PolygonObject.empty at x + exact isEmptyElim x + tensor U V := by + apply WideSubcategory.hom_ext + apply ladder_ext + change ((Functor.LaxMonoidal.μ (reindexFunctor u ⋙ toStrings) U V).hom.app 0) ≫ + (reindexLadder u (U⊗V)).hom.app 0 = + sumArrow ((reindexLadder u U).hom.app 0) ((reindexLadder u V).hom.app 0) ≫ + ((Functor.LaxMonoidal.μ (toStrings ⋙ stringReindex u) U V).hom.app 0) + rw [Functor.LaxMonoidal.comp_μ,Functor.LaxMonoidal.comp_μ] + change (tensorLadder ((reindexFunctor u).obj U) ((reindexFunctor u).obj V)).hom.app 0 ≫ + (ladder (Functor.LaxMonoidal.μ (reindexFunctor u) U V)).hom.app 0 ≫ + (reindexLadder u (U⊗V)).hom.app 0 = + sumArrow ((reindexLadder u U).hom.app 0) ((reindexLadder u V).hom.app 0) ≫ + (𝟙 _ ≫ (tensorLadder U V).hom.app (u.obj 0)) + erw [tensorLadder_zero,ladder_zero,reindexLadder_zero,reindexLadder_zero,reindexLadder_zero, + Category.id_comp,tensorLadder_app] + simp only [tensorInitial,initialArrow,reindexInitial,Category.assoc,reindex_μ_arrow] + congr 1 + · apply (cancel_epi (sumArrow (initial ((reindexFunctor u).obj U)) (initial ((reindexFunctor u).obj V)))).mp + erw [IsIso.hom_inv_id] + change 𝟙 _ = (_ ⊗ₘ _) ≫ (_ ⊗ₘ _) + rw [tensorHom_comp_tensorHom] + simp + · exact @cancel_two_inverses _ _ _ _ _ _ _ _ _ + (IsIso.of_groupoid (C := PolygonObject a) _) + (IsIso.of_groupoid (C := PolygonObject a) _) +end SimpleAmenable.PolygonObject.Labelled + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/TranslationCoinvariants.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/TranslationCoinvariants.lean new file mode 100644 index 0000000000000000000000000000000000000000..473200aa1a4c1451245017f22a974f1e4f340bd9 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/TranslationCoinvariants.lean @@ -0,0 +1,135 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.TranslationNerve + +namespace OAI + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits MonoidalCategory Simplicial SimplicialObject Opposite AlgebraicTopology +namespace TranslationNerve +open TranslationFiltered FreeChains Representation + +attribute [local instance 1200] Rep.hV2 +variable (P:Type) [CommMonoid P] +noncomputable def orbitRaw (n:ℕ) : ((complex P).X n).V →ₗ[ℤ] (B P n →₀ ℤ) := + Finsupp.lmapDomain ℤ ℤ (fun s:ComposableArrows (C P) n=>s ⋙ ActionCategory.π P (Q P)) ∘ₗ + (MonoidAlgebra.coeffLinearEquiv ℤ).toLinearMap +lemma orbitRaw_single (n:ℕ) (s:ComposableArrows (C P) n) (z:ℤ) : + orbitRaw P n (MonoidAlgebra.single s z)=Finsupp.single (s ⋙ ActionCategory.π P (Q P)) z := by + change Finsupp.lmapDomain ℤ ℤ _ (Finsupp.single s z)=_ + simp only [Finsupp.lmapDomain_apply,Finsupp.mapDomain_single] +lemma orbitRaw_invariant (n:ℕ) (q:Q P) : orbitRaw P n ∘ₗ ((complex P).X n).ρ q=orbitRaw P n := by + apply MonoidAlgebra.lhom_ext' + intro s + apply LinearMap.ext_ring + change orbitRaw P n (Representation.linearize ℤ (Q P) ((simplicial P).obj (op ⦋n⦌)) q + (MonoidAlgebra.single s 1)) = orbitRaw P n (MonoidAlgebra.single s 1) + erw [Representation.linearize_single,orbitRaw_single,orbitRaw_single] + exact congrArg (fun t => Finsupp.single t (1:ℤ)) (smul_project P n q s) +noncomputable def orbitForward (n:ℕ) : (Rep.coinvariantsFunctor ℤ (Q P)).obj ((complex P).X n) ⟶ + (ModuleCat.free ℤ).obj (B P n) := + ModuleCat.ofHom (Coinvariants.lift _ (orbitRaw P n) (orbitRaw_invariant P n)) +noncomputable def orbitBackward (n:ℕ) : (ModuleCat.free ℤ).obj (B P n) ⟶ + (Rep.coinvariantsFunctor ℤ (Q P)).obj ((complex P).X n) := + ModuleCat.freeDesc (↾fun s=>Coinvariants.mk _ (MonoidAlgebra.single (lift P n 1 s) 1)) +lemma orbitForward_mk (n:ℕ) (s:ComposableArrows (C P) n) (z:ℤ) : + orbitForward P n (Coinvariants.mk _ (MonoidAlgebra.single s z)) = + Finsupp.single (s ⋙ ActionCategory.π P (Q P)) z := orbitRaw_single P n s z +lemma orbitBackward_mk (n:ℕ) (s:B P n) : orbitBackward P n (ModuleCat.freeMk s)= + Coinvariants.mk ((complex P).X n).ρ (MonoidAlgebra.single (lift P n 1 s) 1) := + ModuleCat.freeDesc_apply _ s +lemma mk_lift_one (n:ℕ) (s:ComposableArrows (C P) n) : + Coinvariants.mk ((complex P).X n).ρ (MonoidAlgebra.single (lift P n 1 (s ⋙ ActionCategory.π P (Q P))) 1) = + Coinvariants.mk ((complex P).X n).ρ (MonoidAlgebra.single s 1) := by + have h := Coinvariants.mk_self_apply ((complex P).X n).ρ s.left.back + (MonoidAlgebra.single (lift P n 1 (s ⋙ ActionCategory.π P (Q P))) 1) + change Coinvariants.mk _ (Representation.linearize ℤ (Q P) ((simplicial P).obj (op ⦋n⦌)) s.left.back _)=_ at h + erw [Representation.linearize_single] at h + change Coinvariants.mk ((complex P).X n).ρ + (MonoidAlgebra.single (s.left.back • lift P n 1 (s ⋙ ActionCategory.π P (Q P))) 1)=_ at h + erw [smul_lift,mul_one,lift_recover] at h + exact h.symm +noncomputable def orbitIso (n:ℕ) : (Rep.coinvariantsFunctor ℤ (Q P)).obj ((complex P).X n) ≅ + (ModuleCat.free ℤ).obj (B P n) where + hom := orbitForward P n + inv := orbitBackward P n + hom_inv_id := by + apply Rep.coinvariantsFunctor_hom_ext + apply ModuleCat.hom_ext + apply MonoidAlgebra.lhom_ext' + intro s + apply LinearMap.ext_ring + change orbitBackward P n (orbitForward P n (Coinvariants.mk _ (MonoidAlgebra.single s 1))) = + Coinvariants.mk ((complex P).X n).ρ (MonoidAlgebra.single s 1) + erw [orbitForward_mk] + change orbitBackward P n (ModuleCat.freeMk _) = _ + rw [orbitBackward_mk] + exact mk_lift_one P n s + inv_hom_id := by + apply ModuleCat.free_hom_ext + intro s + change orbitForward P n (orbitBackward P n (ModuleCat.freeMk s))=ModuleCat.freeMk s + erw [orbitBackward_mk,orbitForward_mk,lift_project] + rfl +lemma orbit_natural {n m:SimplexCategoryᵒᵖ} (f:n⟶m) : + (orbitIso P n.unop.len).hom ≫ (ModuleCat.free ℤ).map ((nerve (SingleObj P)).map f)= + (Rep.coinvariantsFunctor ℤ (Q P)).map ((linear P).map f) ≫ (orbitIso P m.unop.len).hom := by + apply Rep.coinvariantsFunctor_hom_ext + apply ModuleCat.hom_ext + apply MonoidAlgebra.lhom_ext' + intro s + apply LinearMap.ext_ring + change (ModuleCat.free ℤ).map ((nerve (SingleObj P)).map f) + (orbitForward P n.unop.len (Coinvariants.mk _ (MonoidAlgebra.single s 1))) = + orbitForward P m.unop.len (Coinvariants.mk _ (Representation.linearizeMap ((simplicial P).map f) + (MonoidAlgebra.single s 1))) + erw [orbitForward_mk,Representation.linearizeMap_single,orbitForward_mk] + change (ModuleCat.free ℤ).map _ (ModuleCat.freeMk _) = ModuleCat.freeMk _ + erw [ModuleCat.free_map_apply] + rfl +end TranslationNerve + +end + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits MonoidalCategory Simplicial SimplicialObject Opposite AlgebraicTopology +namespace TranslationNerve +open TranslationFiltered FreeChains + +attribute [local instance 1200] Rep.hV2 +variable (P:Type) [CommMonoid P] +lemma orbit_d (m:ℕ) : (orbitIso P (m+1)).hom ≫ (FreeChains.complex (nerve (SingleObj P))).d (m+1) m = + (Rep.coinvariantsFunctor ℤ (Q P)).map ((complex P).d (m+1) m) ≫ (orbitIso P m).hom := by + rw [show (FreeChains.complex (nerve (SingleObj P))).d (m+1) m = + ∑ i:Fin (m+2),(-1:ℤ)^i.val • (ModuleCat.free ℤ).map ((nerve (SingleObj P)).δ i) from + AlternatingFaceMapComplex.obj_d_eq _ m] + rw [show (complex P).d (m+1) m=∑ i:Fin (m+2),(-1:ℤ)^i.val • (linear P).δ i from + AlternatingFaceMapComplex.obj_d_eq _ m] + erw [Functor.map_sum,Preadditive.comp_sum,Preadditive.sum_comp] + apply Finset.sum_congr rfl + intro i hi + erw [Functor.map_zsmul,Preadditive.comp_zsmul,Preadditive.zsmul_comp] + exact congrArg (fun f => ((-1:ℤ)^i.val) • f) (orbit_natural P (SimplexCategory.δ i).op) +noncomputable def orbitChainIso : ((Rep.coinvariantsFunctor ℤ (Q P)).mapHomologicalComplex c).obj (complex P) ≅ + FreeChains.complex (nerve (SingleObj P)) := by + refine HomologicalComplex.Hom.isoOfComponents (orbitIso P) ?_ + rintro n m rfl + exact orbit_d P m +noncomputable def unitCoinvariantsIso : (Rep.coinvariantsTensor ℤ (Q P)).obj (Rep.trivial ℤ (Q P) ℤ) ≅ + Rep.coinvariantsFunctor ℤ (Q P) := + Functor.isoWhiskerRight (leftUnitorNatIso (Rep ℤ (Q P))) (Rep.coinvariantsFunctor ℤ (Q P)) ≪≫ + Functor.leftUnitor _ + +noncomputable def completionHomologyIso (n:ℕ) : + (nerve (SingleObj P)).homology Z n ≅ groupHomology (Rep.trivial ℤ (Q P) ℤ) n := by + classical + let e : (resolution P).complex.coinvariantsTensorObj (Rep.trivial ℤ (Q P) ℤ) ≅ + FreeChains.complex (nerve (SingleObj P)) := + (NatIso.mapHomologicalComplex (unitCoinvariantsIso P) c).app (complex P) ≪≫ orbitChainIso P + exact (HomologicalComplex.homologyFunctor A c n).mapIso (complexIso _) ≪≫ + ((HomologicalComplex.homologyFunctor A c n).mapIso e).symm ≪≫ + (groupHomologyIso (Rep.trivial ℤ (Q P) ℤ) n (resolution P)).symm +end TranslationNerve + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/TranslationFiberMonoidal.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/TranslationFiberMonoidal.lean new file mode 100644 index 0000000000000000000000000000000000000000..cc90b8f6661027392755c110a02bc7c4ee02ba2f --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/TranslationFiberMonoidal.lean @@ -0,0 +1,69 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Configurations.TranslationFiber +import OAI.GroupTheory.SimpleAmenable.Simplicial.PointFiberMonoidal + +namespace OAI + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory MonoidalCategory Classical +namespace SimpleAmenable.PolygonObject.Labelled.PointFiber + +variable {a n : ℕ} (d : (Fin n → CutRing × CutRing) → CutRing × CutRing) +variable (c : GenericSquare a × (Fin n → CutRing × CutRing)) +lemma translationFiber_sum_left (U V : Labelled a n) (x : Fiber U (backPoint d c)) : + fiberMap (translationTensor d U V) c + (fiberSum (translateObj d U) (translateObj d V) c (.inl (translateFiber d c U x))) = + translateFiber d c (U⊗V) (fiberSum U V (backPoint d c) (.inl x)) := by + apply Subtype.ext + change (inv (sumArrow (translateArrow d U) (translateArrow d V)) ≫ translateArrow d (U⊗V)).toEquiv + (sumPointEquiv _ _ (.inl ((translateArrow d U).toEquiv x.val))) = _ + rw [←sumArrow_inl,arrow_comp_apply,inv_arrow_apply,Equiv.symm_apply_apply] + rfl +lemma translationFiber_sum_right (U V : Labelled a n) (x : Fiber V (backPoint d c)) : + fiberMap (translationTensor d U V) c + (fiberSum (translateObj d U) (translateObj d V) c (.inr (translateFiber d c V x))) = + translateFiber d c (U⊗V) (fiberSum U V (backPoint d c) (.inr x)) := by + apply Subtype.ext + change (inv (sumArrow (translateArrow d U) (translateArrow d V)) ≫ translateArrow d (U⊗V)).toEquiv + (sumPointEquiv _ _ (.inr ((translateArrow d V).toEquiv x.val))) = _ + rw [←sumArrow_inr,arrow_comp_apply,inv_arrow_apply,Equiv.symm_apply_apply] + rfl +lemma translationEvaluation_tensor_left (U V : Labelled a n) (x : Fin (E.obj U (backPoint d c)).size) : + (translationEvaluationIso d c).hom.app (U⊗V) + (mu U V (backPoint d c) (FiniteSetGroupoid.sumEquiv _ _ (.inl x))) = + E.map (translationTensor d U V) c (mu (translateObj d U) (translateObj d V) c + (FiniteSetGroupoid.sumHom ((translationEvaluationIso d c).hom.app U) + ((translationEvaluationIso d c).hom.app V) (FiniteSetGroupoid.sumEquiv _ _ (.inl x)))) := by + obtain ⟨x,rfl⟩ := (enumerate U (backPoint d c)).surjective x + erw [mu_inl,translationEvaluationIso_enum,FiniteSetGroupoid.sumHom_inl, + translationEvaluationIso_enum,mu_inl,E_map_enum,translationFiber_sum_left] + rfl +lemma translationEvaluation_tensor_right (U V : Labelled a n) (x : Fin (E.obj V (backPoint d c)).size) : + (translationEvaluationIso d c).hom.app (U⊗V) + (mu U V (backPoint d c) (FiniteSetGroupoid.sumEquiv _ _ (.inr x))) = + E.map (translationTensor d U V) c (mu (translateObj d U) (translateObj d V) c + (FiniteSetGroupoid.sumHom ((translationEvaluationIso d c).hom.app U) + ((translationEvaluationIso d c).hom.app V) (FiniteSetGroupoid.sumEquiv _ _ (.inr x)))) := by + obtain ⟨x,rfl⟩ := (enumerate V (backPoint d c)).surjective x + erw [mu_inr,translationEvaluationIso_enum,FiniteSetGroupoid.sumHom_inr, + translationEvaluationIso_enum,mu_inr,E_map_enum,translationFiber_sum_right] + rfl +noncomputable instance translationEvaluationIsoMonoidal : + NatTrans.IsMonoidal (translationEvaluationIso d c).hom where + unit := by apply Equiv.ext; intro x; exact Fin.elim0 x + tensor U V := by + apply Equiv.ext; intro x + change (translationEvaluationIso d c).hom.app (U⊗V) (mu U V (backPoint d c) x) = + E.map (translationTensor d U V) c (mu (translateObj d U) (translateObj d V) c + (FiniteSetGroupoid.sumHom ((translationEvaluationIso d c).hom.app U) + ((translationEvaluationIso d c).hom.app V) x)) + obtain ⟨x,rfl⟩ := (FiniteSetGroupoid.sumEquiv (E.obj U (backPoint d c)) + (E.obj V (backPoint d c))).surjective x + cases x with + | inl x => exact translationEvaluation_tensor_left d c U V x + | inr x => exact translationEvaluation_tensor_right d c U V x +end SimpleAmenable.PolygonObject.Labelled.PointFiber + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/TranslationNerve.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/TranslationNerve.lean new file mode 100644 index 0000000000000000000000000000000000000000..8b6018bc21e996d6ca68331e4eaf8c976d996e1f --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/TranslationNerve.lean @@ -0,0 +1,211 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Homology.GroupoidComponentHomology +import OAI.GroupTheory.SimpleAmenable.Simplicial.BarComponents + +namespace OAI + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Simplicial Opposite +namespace TranslationNerve +open TranslationFiltered + +variable (P:Type) [CommMonoid P] +abbrev C := ActionCategory P (Q P) +abbrev B (n:ℕ) := ComposableArrows (SingleObj P) n +lemma eqToHom_val {x y:C P} (h:x=y) : (eqToHom h).hom=(1:P) := by subst y; rfl +lemma single_eqToHom {x y:SingleObj P} (h:x=y) : eqToHom h=(1:P) := by subst y; rfl +noncomputable def lift (n:ℕ) (q:Q P) (s:B P n) : ComposableArrows (C P) n where + obj i := (Algebra.GrothendieckGroup.of (M:=P) (s.map (homOfLE (Fin.zero_le i))) * q : Q P) + map {i j} f := ⟨s.map f, by + change Algebra.GrothendieckGroup.of (M:=P) (s.map f) * (Algebra.GrothendieckGroup.of (M:=P) + (s.map (homOfLE (Fin.zero_le i))) * q) = Algebra.GrothendieckGroup.of (M:=P) (s.map (homOfLE (Fin.zero_le j))) * q + rw [←mul_assoc,←map_mul (Algebra.GrothendieckGroup.of (M:=P))] + have h:=s.map_comp (homOfLE (Fin.zero_le i)) f + change s.map (homOfLE (Fin.zero_le i) ≫ f)=s.map f*s.map (homOfLE (Fin.zero_le i)) at h + rw [←h] + rfl⟩ + map_id i := by apply Functor.Elements.Hom.ext; exact s.map_id i + map_comp f g := by apply Functor.Elements.Hom.ext; exact s.map_comp f g +lemma lift_left (n:ℕ) (q:Q P) (s:B P n) : (lift P n q s).left.back=q := by + change Algebra.GrothendieckGroup.of (s.map (homOfLE (Fin.zero_le (0:Fin (n+1))))) * q=q + rw [show homOfLE (Fin.zero_le (0:Fin (n+1))) = 𝟙 _ from rfl,s.map_id] + change Algebra.GrothendieckGroup.of (M:=P) (1:P)*q=q + rw [map_one,one_mul] +lemma lift_project (n:ℕ) (q:Q P) (s:B P n) : lift P n q s ⋙ ActionCategory.π P (Q P)=s := by + apply CategoryTheory.Functor.ext + · intro i j f; simp only [single_eqToHom,SingleObj.comp_as_mul,one_mul,mul_one]; rfl + · intro i; exact Subsingleton.elim _ _ +lemma lift_recover (n:ℕ) (s:ComposableArrows (C P) n) : + lift P n s.left.back (s ⋙ ActionCategory.π P (Q P))=s := by + apply CategoryTheory.Functor.ext + · intro i j f; apply Functor.Elements.Hom.ext + erw [Functor.Elements.comp_hom,Functor.Elements.comp_hom] + simp only [SingleObj.comp_as_mul,eqToHom_val,one_mul,mul_one] + rfl + · intro i + apply (ActionCategory.objEquiv P (Q P)).symm.injective + exact (s.map (homOfLE (Fin.zero_le i))).map_val +noncomputable def coordinates (n:ℕ) : ComposableArrows (C P) n ≃ Q P × B P n where + toFun s := (s.left.back,s ⋙ ActionCategory.π P (Q P)) + invFun x := lift P n x.1 x.2 + left_inv := lift_recover P n + right_inv x := Prod.ext (lift_left P n x.1 x.2) (lift_project P n x.1 x.2) +noncomputable def translate (q:Q P) : C P ⥤ C P where + obj x := (q*x.back:Q P) + map f := ⟨f.hom,by + change Algebra.GrothendieckGroup.of f.hom * (q * _) = _ + rw [mul_left_comm] + exact congrArg (q*·) f.map_val⟩ + map_id _ := rfl + map_comp _ _ := rfl +lemma translate_one : translate P 1=𝟭 _ := by + apply CategoryTheory.Functor.ext + · intro x y f; apply Functor.Elements.Hom.ext + erw [Functor.Elements.comp_hom,Functor.Elements.comp_hom] + simp only [SingleObj.comp_as_mul,eqToHom_val,one_mul,mul_one] + rfl + · intro x; apply (ActionCategory.objEquiv P (Q P)).symm.injective; exact one_mul _ +lemma translate_mul (q r:Q P) : translate P (q*r)=translate P r ⋙ translate P q := by + apply CategoryTheory.Functor.ext + · intro x y f; apply Functor.Elements.Hom.ext + erw [Functor.Elements.comp_hom,Functor.Elements.comp_hom] + simp only [SingleObj.comp_as_mul,eqToHom_val,one_mul,mul_one] + rfl + · intro x; apply (ActionCategory.objEquiv P (Q P)).symm.injective; exact mul_assoc _ _ _ +noncomputable instance action (n:ℕ) : MulAction (Q P) (ComposableArrows (C P) n) where + smul q s := s ⋙ translate P q + one_smul s := by change s ⋙ translate P 1=s; rw [translate_one]; rfl + mul_smul q r s := by change s ⋙ translate P (q*r)=(s ⋙ translate P r) ⋙ translate P q; rw [translate_mul]; rfl +lemma smul_left (n:ℕ) (q:Q P) (s:ComposableArrows (C P) n) : + (q • s).left.back=q*s.left.back := rfl +lemma smul_project (n:ℕ) (q:Q P) (s:ComposableArrows (C P) n) : + (q • s) ⋙ ActionCategory.π P (Q P)=s ⋙ ActionCategory.π P (Q P) := by + apply CategoryTheory.Functor.ext + · intro i j f; simp only [single_eqToHom,SingleObj.comp_as_mul,one_mul,mul_one]; rfl + · intro i; exact Subsingleton.elim _ _ +lemma smul_lift (n:ℕ) (q r:Q P) (s:B P n) : + q • lift P n r s=lift P n (q*r) s := by + apply (coordinates P n).injective + apply Prod.ext + · change (q • lift P n r s).left.back=(lift P n (q*r) s).left.back + rw [smul_left,lift_left,lift_left] + · change (q • lift P n r s) ⋙ ActionCategory.π P (Q P)=lift P n (q*r) s ⋙ ActionCategory.π P (Q P) + rw [smul_project,lift_project,lift_project] +noncomputable def simplicial : SimplicialObject (Action (Type) (Q P)) where + obj n := Action.ofMulAction (Q P) (ComposableArrows (C P) n.unop.len) + map f := { hom := (nerve (C P)).map f + comm _ := by ext s; rfl } + map_id _ := by ext s; rfl + map_comp _ _ := by ext s; rfl +end TranslationNerve + +end + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory Limits MonoidalCategory Simplicial SimplicialObject Opposite AlgebraicTopology +namespace TranslationNerve +open TranslationFiltered FreeChains + +attribute [local instance 1200] Rep.hV2 +variable (P:Type) [CommMonoid P] +noncomputable def actionCoordinates (n:ℕ) : + (simplicial P).obj (op ⦋n⦌) ≅ Action.leftRegular (Q P) ⊗ Action.trivial (Q P) (B P n) := + Action.mkIso (coordinates P n).toIso (by + intro q + ext s + exact Prod.ext (smul_left P n q s) (smul_project P n q s)) +noncomputable def linear : SimplicialObject (Rep ℤ (Q P)) := simplicial P ⋙ Rep.linearization ℤ (Q P) +noncomputable def complex : ChainComplex (Rep ℤ (Q P)) ℕ := AlternatingFaceMapComplex.obj (linear P) +noncomputable def freeIso (n:ℕ) : (complex P).X n ≅ Rep.free ℤ (Q P) (B P n) := + (Rep.linearization ℤ (Q P)).mapIso (actionCoordinates P n) ≪≫ + (Functor.Monoidal.μIso (Rep.linearization ℤ (Q P)) _ _).symm ≪≫ + tensorIso (Rep.linearizationOfMulActionIso ℤ (Q P) (Q P)) + (Rep.linearizationTrivialIso ℤ (Q P) (B P n)) ≪≫ + Rep.leftRegularTensorTrivialIsoFree ℤ (Q P) (B P n) +noncomputable instance projective (n:ℕ) : Projective ((complex P).X n) := + Projective.of_iso (freeIso P n).symm inferInstance +abbrev forgetRep := forget₂ (Rep ℤ (Q P)) (ModuleCat ℤ) +noncomputable def coeffIso (n:ℕ) : (forgetRep P).obj ((complex P).X n) ≅ + (FreeChains.complex (nerve (C P))).X n := (MonoidAlgebra.coeffLinearEquiv ℤ).toModuleIso +lemma coeff_natural {n m:SimplexCategoryᵒᵖ} (f:n⟶m) : + (coeffIso P n.unop.len).hom ≫ (ModuleCat.free ℤ).map ((nerve (C P)).map f) = + (forgetRep P).map ((linear P).map f) ≫ (coeffIso P m.unop.len).hom := by + ext x + rfl +lemma coeff_d (m:ℕ) : (coeffIso P (m+1)).hom ≫ (FreeChains.complex (nerve (C P))).d (m+1) m = + (forgetRep P).map ((complex P).d (m+1) m) ≫ (coeffIso P m).hom := by + rw [show (FreeChains.complex (nerve (C P))).d (m+1) m = + ∑ i:Fin (m+2),(-1:ℤ)^i.val • (ModuleCat.free ℤ).map ((nerve (C P)).δ i) from + AlternatingFaceMapComplex.obj_d_eq _ m] + rw [show (complex P).d (m+1) m=∑ i:Fin (m+2),(-1:ℤ)^i.val • (linear P).δ i from + AlternatingFaceMapComplex.obj_d_eq _ m] + dsimp only [coeffIso,FreeChains.complex,complex,linear] + erw [Functor.map_sum] + simp only [Preadditive.comp_sum,Preadditive.sum_comp,Preadditive.comp_zsmul] + apply Finset.sum_congr rfl + intro i _ + exact congrArg (fun f => ((-1:ℤ)^i.val) • f) + (coeff_natural P (SimplexCategory.δ i).op) +noncomputable def forgetIso : ((forgetRep P).mapHomologicalComplex c).obj (complex P) ≅ + FreeChains.complex (nerve (C P)) := by + refine HomologicalComplex.Hom.isoOfComponents (coeffIso P) ?_ + rintro n m rfl + exact coeff_d P m +noncomputable def aug0 : (complex P).X 0 ⟶ Rep.trivial ℤ (Q P) ℤ := + Rep.ofHom ⟨((coeffIso P 0).hom ≫ SimplicialAugment.aug0 (nerve (C P))).hom, by + intro q + ext s + change (SimplicialAugment.aug0 (nerve (C P))) + ((coeffIso P 0).hom (Representation.linearize ℤ (Q P) ((simplicial P).obj (op ⦋0⦌)) q + (MonoidAlgebra.single s 1))) = + (SimplicialAugment.aug0 (nerve (C P))) ((coeffIso P 0).hom (MonoidAlgebra.single s 1)) + rw [Representation.linearize_single] + change (SimplicialAugment.aug0 (nerve (C P))) (ModuleCat.freeMk (s ⋙ translate P q)) = + (SimplicialAugment.aug0 (nerve (C P))) (ModuleCat.freeMk s) + exact (SimplicialAugment.aug0_mk (nerve (C P)) _).trans + (SimplicialAugment.aug0_mk (nerve (C P)) _).symm⟩ +lemma d_aug0 : (complex P).d 1 0 ≫ aug0 P=0 := by + apply (forgetRep P).map_injective + rw [Functor.map_comp,Functor.map_zero] + change (forgetRep P).map ((complex P).d 1 0) ≫ (coeffIso P 0).hom ≫ + SimplicialAugment.aug0 (nerve (C P))=0 + have h := (forgetIso P).hom.comm 1 0 + change (coeffIso P 1).hom ≫ (FreeChains.complex (nerve (C P))).d 1 0 = + (forgetRep P).map ((complex P).d 1 0) ≫ (coeffIso P 0).hom at h + erw [←Category.assoc,←h,Category.assoc,SimplicialAugment.d_aug0,HasZeroMorphisms.comp_zero] +noncomputable def aug : complex P ⟶ (ChainComplex.single₀ _).obj (Rep.trivial ℤ (Q P) ℤ) := + (ChainComplex.toSingle₀Equiv _ _).symm ⟨aug0 P,d_aug0 P⟩ +lemma forget_aug : ((forgetRep P).mapHomologicalComplex c).map (aug P) ≫ + (HomologicalComplex.singleMapHomologicalComplex (forgetRep P) c 0).hom.app _ = + (forgetIso P).hom ≫ SimplicialAugment.aug (nerve (C P)) := by + apply HomologicalComplex.to_single_hom_ext + simp only [HomologicalComplex.comp_f,Functor.mapHomologicalComplex_map_f] + rfl +noncomputable instance nerve_aug_quasiIso : QuasiIso (SimplicialAugment.aug (nerve (C P))) where + quasiIsoAt n := by + cases n with + | zero => rw [quasiIsoAt_iff_isIso_homologyMap]; infer_instance + | succ n => + rw [quasiIsoAt_iff_isIso_homologyMap] + have hX : IsZero ((FreeChains.complex (nerve (C P))).homology (n+1)) := + (FilteredNerve.positive_acyclic (C P) (n+1) (by omega)).of_iso + ((HomologicalComplex.homologyFunctor A c (n+1)).mapIso (complexIso (nerve (C P)))).symm + have hY : IsZero (((ChainComplex.single₀ A).obj Z).homology (n+1)) := by + apply ShortComplex.isZero_homology_of_isZero_X₂ + exact HomologicalComplex.isZero_single_obj_X c 0 Z (n+1) (by omega) + exact hX.isIso hY _ +noncomputable instance aug_quasiIso : QuasiIso (aug P) := by + rw [←HomologicalComplex.quasiIso_map_iff_of_preservesHomology _ (forgetRep P)] + have h : QuasiIso ((forgetIso P).hom ≫ SimplicialAugment.aug (nerve (C P))) := inferInstance + rw [←forget_aug] at h + exact quasiIso_of_comp_right + (((forgetRep P).mapHomologicalComplex c).map (aug P)) + ((HomologicalComplex.singleMapHomologicalComplex (forgetRep P) c 0).hom.app _) +noncomputable def resolution : ProjectiveResolution (Rep.trivial ℤ (Q P) ℤ) where + complex := complex P + π := aug P +end TranslationNerve + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/TripleAllNatural.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/TripleAllNatural.lean new file mode 100644 index 0000000000000000000000000000000000000000..57bf5ad2c1a5de15bf691983615082a15873e224 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/TripleAllNatural.lean @@ -0,0 +1,54 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.StringEvaluation + +namespace OAI + +section + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory MonoidalCategory SimplicialObject Simplicial Opposite +namespace RestrictedNerve +open IntervalBar IntervalBar.Diagram + +variable {C:Type} [Groupoid.{0} C] (W:MorphismProperty C) + [Fact W.StableUnderInverse] [MonoidalCategory C] [SymmetricCategory C] + [W.IsStableUnderBraiding] +lemma tripleDiagramResolutionHomologyIso_inner_natural (q r:ℕ) {p s:ℕ} + (u:Fin (p+1)→oFin (s+1)) (j:ℕ) : + SSet.homologyMap (SimplicialDiagonal.nerveDiagonal.map (tripleInnerReindex W q r u)) + DiagonalResolution.Z j ≫ (tripleDiagramResolutionHomologyIso W p q r j).hom = + (tripleDiagramResolutionHomologyIso W s q r j).hom ≫ + SSet.homologyMap (nerveMap (Diagram.map (Diagram.map (Diagram.reindex u)))) + DiagonalResolution.Z j := by + rw [←tripleResolutionAugmentation_homology W p q r j, + ←tripleResolutionAugmentation_homology W s q r j] + have h := congrArg (fun f => SSet.homologyMap f DiagonalResolution.Z j) + (tripleResolutionAugmentation_inner_natural W q r u) + simpa only [SSet.homologyMap_comp] using h + +noncomputable def tripleSimultaneousReindex {p s:ℕ} (u:Fin (p+1)→oFin (s+1)) : + tripleDiagramHorizontal W s s s ⟶ tripleDiagramHorizontal W p p p := + tripleInnerReindex W s s u ≫ tripleMiddleReindex W p s u ≫ tripleOuterReindex W p p u +lemma tripleResolutionAugmentation_diagonal_natural {p s:ℕ} + (u:Fin (p+1)→oFin (s+1)) : + SimplicialDiagonal.nerveDiagonal.map (tripleSimultaneousReindex W u) ≫ + tripleResolutionAugmentation W p p p = + tripleResolutionAugmentation W s s s ≫ + nerveMap (Diagram.map (Diagram.map (Diagram.reindex u))) ≫ + nerveMap (Diagram.map (Diagram.reindex u)) ≫ nerveMap (Diagram.reindex u) := by + unfold tripleSimultaneousReindex + simp only [Functor.map_comp,Category.assoc] + rw [tripleResolutionAugmentation_outer_natural] + rw [←Category.assoc (SimplicialDiagonal.nerveDiagonal.map (tripleMiddleReindex W p s u)), + tripleResolutionAugmentation_middle_natural] + simp only [Category.assoc] + rw [←Category.assoc (SimplicialDiagonal.nerveDiagonal.map (tripleInnerReindex W s s u)), + tripleResolutionAugmentation_inner_natural] + simp only [Category.assoc] +end RestrictedNerve + +end + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/TripleBarMaps.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/TripleBarMaps.lean new file mode 100644 index 0000000000000000000000000000000000000000..e5f59ac3ee5ca53091ed4720a1673a79a3716cd7 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/TripleBarMaps.lean @@ -0,0 +1,217 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.BarContractible +import OAI.GroupTheory.SimpleAmenable.Simplicial.LabelledMonoidal + +namespace OAI + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory MonoidalCategory SimplicialObject Simplicial Opposite +namespace IntervalBar.Diagram + +variable {C D : Type} [Groupoid.{0} C] [MonoidalCategory C] [SymmetricCategory C] + [Groupoid.{0} D] [MonoidalCategory D] [SymmetricCategory D] +variable {I J K L : Type} [Preorder I] [Preorder J] [Preorder K] [Preorder L] +private lemma map_reindex_unit_app (f : I →o J) + (A : Diagram (Diagram (Diagram C J) K) L) (i : L) + (j k : K) (h : j ≤ k) (l m : I) (hlm : l ≤ m) : + ((((map (map (reindex f))).obj A).unit i).hom.app j k h).app l m hlm = + ((A.unit i).hom.app j k h).app (f l) (f m) (f.monotone hlm) := by + change (((map (reindex f)).map (A.unit i).hom ≫ + Functor.OplaxMonoidal.η (map (reindex f))).app j k h).app l m hlm = _ + erw [comp_app, map_η_app (I:=K) (reindex (C:=C) f)] + change ((A.unit i).hom.app j k h).app (f l) (f m) (f.monotone hlm) ≫ 𝟙 _ = _ + exact Category.comp_id _ + +private lemma map_triple_unit_app (F : C ⥤ D) [F.Braided] + (A : Diagram (Diagram (Diagram C J) K) L) (i : L) + (j k : K) (h : j ≤ k) (l m : J) (hlm : l ≤ m) : + ((((map (map (map F))).obj A).unit i).hom.app j k h).app l m hlm = + F.map (((A.unit i).hom.app j k h).app l m hlm) ≫ Functor.OplaxMonoidal.η F := by + change (((map (map F)).map (A.unit i).hom ≫ + Functor.OplaxMonoidal.η (map (map F))).app j k h).app l m hlm = _ + erw [comp_app, map_η_app (I:=K) (map (I:=J) F), map_η_app (I:=J) F] + rfl + +lemma map_map_map_reindex (F : C ⥤ D) [F.Braided] (f : I →o J) : + map (I:=L) (map (I:=K) (map (I:=J) F)) ⋙ map (map (reindex f)) = + map (map (reindex f)) ⋙ map (map (map (I:=I) F)) := by + have he (X : Diagram (Diagram C J) K) : + mapObj (map F) (mapObj (reindex f) X) = mapObj (reindex f) (mapObj (map F) X) := + congrArg (fun T => T.obj X) (map_map_reindex F f).symm + refine CategoryTheory.Functor.ext (fun A => ?_) ?_ + · refine ext_heq ?_ ?_ ?_ + · funext i j h; exact (he _).symm + · apply hfunext; intro i + apply iso_hext (he _).symm rfl + apply hom_hext (he _).symm rfl + intro j k h + apply hom_hext rfl rfl + intro l m hlm + apply heq_of_eq + erw [map_reindex_unit_app, map_triple_unit_app, + map_triple_unit_app, map_reindex_unit_app] + rfl + · apply hfunext; intro i + apply hfunext; intro j + apply hfunext; intro k + apply hfunext; intro hij + apply hfunext; intro hjk + apply iso_hext (congrArg₂ (fun X Y => X ⊗ Y) (he _).symm (he _).symm) (he _).symm + apply hom_hext (congrArg₂ (fun X Y => X ⊗ Y) (he _).symm (he _).symm) (he _).symm + intro l m hlm + apply hom_hext rfl rfl + intro n p hnp + apply heq_of_eq + change 𝟙 _ ≫ (Functor.LaxMonoidal.μ F _ _ ≫ + F.map (((A.cut i j k hij hjk).hom.app l m hlm).app (f n) (f p) _)) = + Functor.LaxMonoidal.μ F _ _ ≫ + F.map (𝟙 _ ≫ ((A.cut i j k hij hjk).hom.app l m hlm).app (f n) (f p) _) + erw [Category.id_comp, Category.id_comp] + · intro A B g + apply Hom.ext; intro i j h + erw [comp_app, comp_app, eqToHom_app, eqToHom_app] + apply Hom.ext; intro k l hkl + erw [comp_app, comp_app, eqToHom_app, eqToHom_app] + apply Hom.ext; intro m n hmn + erw [comp_app, comp_app, eqToHom_app, eqToHom_app] + simp only [map,reindex] + erw [Category.id_comp, Category.comp_id] + rfl +lemma barMap_map_map_reindex (F : C ⥤ D) [F.Braided] (f : I →o J) : + barMap (map (I:=K) (map (I:=J) F)) ≫ barMap (map (reindex f)) = + barMap (map (reindex f)) ≫ barMap (map (map (I:=I) F)) := by + have he : simplicialMap (map (I:=K) (map (I:=J) F)) ≫ simplicialMap (map (reindex f)) = + simplicialMap (map (reindex f)) ≫ simplicialMap (map (map (I:=I) F)) := by + apply NatTrans.ext; funext p; apply Cat.ext + exact map_map_map_reindex F f + have h := congrArg SimplicialDiagonal.nerveDiagonal.map he + erw [Functor.map_comp, Functor.map_comp] at h + exact h +lemma bar₂Map_map_reindex (F : C ⥤ D) [F.Braided] (f : I →o J) : + bar₂Map (map (I:=J) F) ≫ bar₂Map (reindex f) = + bar₂Map (reindex f) ≫ bar₂Map (map (I:=I) F) := by + have he : rows₂Map (map (I:=J) F) ≫ rows₂Map (reindex f) = + rows₂Map (reindex f) ≫ rows₂Map (map (I:=I) F) := by + apply NatTrans.ext; funext p + exact barMap_map_map_reindex F f + have h := congrArg SimplicialDiagonal.diagonal.map he + erw [Functor.map_comp, Functor.map_comp] at h + exact h +noncomputable def rows₃Map (F : C ⥤ D) [F.Braided] : rows₃ (C:=C) ⟶ rows₃ (C:=D) where + app p := bar₂Map (map (I:=Fin (p.unop.len+1)) F) + naturality _ _ f := (bar₂Map_map_reindex F f.unop.toOrderHom).symm +noncomputable def bar₃Map (F : C ⥤ D) [F.Braided] : bar₃ (C:=C) ⟶ bar₃ (C:=D) := + SimplicialDiagonal.diagonal.map (rows₃Map F) +lemma bar₃Map_homology_isIso (F : C ⥤ D) [F.Braided] [F.IsEquivalence] (n : ℕ) : + IsIso (SSet.homologyMap (bar₃Map F) DiagonalResolution.Z n) := by + apply SimplicialDiagonal.homologyMap_isIso + intro p q + exact bar₂Map_homology_isIso (map (I:=Fin (p.unop.len+1)) F) q +end IntervalBar.Diagram + +end + +open _root_.CategoryTheory _root_.OAI.CategoryTheory MonoidalCategory +namespace SimpleAmenable.PolygonObject + +variable {a n : ℕ} +noncomputable def stringEval : StringGroupoid a n ⥤ PolygonObject a where + obj F := F.obj.obj 0 + map f := f.hom.app 0 + map_id _ := rfl + map_comp _ _ := rfl +instance : (stringEval (a:=a) (n:=n)).Faithful where + map_injective h := by apply WideSubcategory.hom_ext; exact ladder_ext h +noncomputable instance : (stringEval (a:=a) (n:=n)).Monoidal := + Functor.CoreMonoidal.toMonoidal { + εIso := Iso.refl _ + μIso _ _ := Iso.refl _ + μIso_hom_natural_left := by intros; simp; rfl + μIso_hom_natural_right := by intros; simp; rfl + associativity := by + intro first second third + change (𝟙 _ ▷ _ ≫ 𝟙 _ ≫ (α_ _ _ _).hom) = + ((α_ _ _ _).hom ≫ _ ◁ 𝟙 _ ≫ 𝟙 _) + simp + left_unitality := by + intro object + change (λ_ _).hom = 𝟙 _ ▷ _ ≫ 𝟙 _ ≫ (λ_ _).hom + simp + right_unitality := by + intro object + change (ρ_ _).hom = _ ◁ 𝟙 _ ≫ 𝟙 _ ≫ (ρ_ _).hom + simp } +noncomputable instance : (stringEval (a:=a) (n:=n)).Braided where + braided _ _ := by + change sumSwap _ _ ≫ 𝟙 _ = 𝟙 _ ≫ sumSwap _ _ + simp +lemma pointShift_sum_left {U V W T : PolygonObject a} (f : U ⟶ W) (g : V ⟶ T) (x : U.Point) : + pointShift (sumArrow f g) (sumPointEquiv U V (.inl x))=pointShift f x := by + simpa only [pointShift_reduced] using pointShift_unique (sumArrow f g) _ (pointShift f x) + (by simpa only [sumArrow_inl,sumPointEquiv_inl] using pointShift_spec f x) +lemma pointShift_sum_right {U V W T : PolygonObject a} (f : U ⟶ W) (g : V ⟶ T) (x : V.Point) : + pointShift (sumArrow f g) (sumPointEquiv U V (.inr x))=pointShift g x := by + simpa only [pointShift_reduced] using pointShift_unique (sumArrow f g) _ (pointShift g x) + (by simpa only [sumArrow_inr,sumPointEquiv_inr] using pointShift_spec g x) +lemma increments_sum_left (F G : RawString a n) (x : (F.obj 0).Point) : + increments (F⊗G) (sumPointEquiv (F.obj 0) (G.obj 0) (.inl x))=increments F x := by + funext i + simp only [increments,trajectoryShift] + change pointShift (sumArrow _ _) _ - pointShift (sumArrow _ _) _ = _ + rw [pointShift_sum_left,pointShift_sum_left] + rfl +lemma increments_sum_right (F G : RawString a n) (x : (G.obj 0).Point) : + increments (F⊗G) (sumPointEquiv (F.obj 0) (G.obj 0) (.inr x))=increments G x := by + funext i + simp only [increments,trajectoryShift] + change pointShift (sumArrow _ _) _ - pointShift (sumArrow _ _) _ = _ + rw [pointShift_sum_right,pointShift_sum_right] + rfl +namespace Labelled +noncomputable def tensorInitial (U V : Labelled a n) : + ((string U ⊗ string V).obj.obj 0) ⟶ (string (U⊗V)).obj.obj 0 := + inv (C := PolygonObject a) (sumArrow (initial U) (initial V)) + (I := IsIso.of_groupoid (C := PolygonObject a) _) ≫ initial (U⊗V) +lemma tensorInitial_positional (U V : Labelled a n) : Positional (tensorInitial U V) := + positional_comp (positional_inv (sumArrow_positional (incrementInitial_positional _ _) + (incrementInitial_positional _ _))) (incrementInitial_positional _ _) +lemma tensorInitial_labels (U V : Labelled a n) (x : ((string U ⊗ string V).obj.obj 0).Point) : + increments (string (U⊗V)).obj ((tensorInitial U V).toEquiv x) = + increments (string U ⊗ string V).obj x := by + obtain ⟨y,rfl⟩ := (sumArrow (initial U) (initial V)).toEquiv.surjective x + change increments (string (sum U V)).obj ((initial (sum U V)).toEquiv + ((inv (C := PolygonObject a) (sumArrow (initial U) (initial V)) + (I := IsIso.of_groupoid (C := PolygonObject a) _)).toEquiv + ((sumArrow (initial U) (initial V)).toEquiv y))) = + increments ((string U).obj ⊗ (string V).obj) ((sumArrow (initial U) (initial V)).toEquiv y) + rw [inv_arrow_apply,Equiv.symm_apply_apply,incrementString_spec_reduced _ _ (sum U V).reduced] + obtain ⟨z,rfl⟩ := (sumPointEquiv U.polygon V.polygon).surjective y + cases z with + | inl z => + rw [sumArrow_inl] + rw [increments_sum_left,incrementString_spec_reduced _ _ U.reduced] + exact sum_label_left U V z + | inr z => + rw [sumArrow_inr] + rw [increments_sum_right,incrementString_spec_reduced _ _ V.reduced] + exact sum_label_right U V z +noncomputable def tensorLadder (U V : Labelled a n) : string U⊗string V ⟶ string (U⊗V) := + ⟨extendLadder (tensorInitial U V),extendLadder_positional_of_increments _ + (tensorInitial_positional U V) (tensorInitial_labels U V)⟩ +@[simp] lemma tensorLadder_zero (U V : Labelled a n) : (tensorLadder U V).hom.app 0=tensorInitial U V := + extendLadder_zero _ +noncomputable def unitLadder : 𝟙_ (StringGroupoid a n) ⟶ string (𝟙_ (Labelled a n)) := + ⟨extendLadder (initial (𝟙_ _)),extendLadder_positional_of_increments _ + (incrementInitial_positional _ _) (by intro x; change PolygonObject.empty.Point at x; exact isEmptyElim x)⟩ +@[simp] lemma unitLadder_zero : (unitLadder (a:=a) (n:=n)).hom.app 0=initial (𝟙_ _) := extendLadder_zero _ +noncomputable def initialIso : forget (a:=a) (n:=n) ≅ toStrings ⋙ stringEval := + NatIso.ofComponents (fun U => + @asIso (PolygonObject a) _ _ _ (initial U) (IsIso.of_groupoid (C := PolygonObject a) _)) (by + intro U V f + change f.arrow ≫ initial V = initial U ≫ (ladder f).hom.app 0 + rw [ladder_zero] + simp [initialArrow]) +end Labelled +end SimpleAmenable.PolygonObject + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/TripleComposition.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/TripleComposition.lean new file mode 100644 index 0000000000000000000000000000000000000000..c703ac41af15d247b57ef82a7b8a9340d6e65cae --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/TripleComposition.lean @@ -0,0 +1,218 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.TripleBarMaps +import OAI.GroupTheory.SimpleAmenable.Simplicial.StageTripleHomology + +namespace OAI + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory MonoidalCategory +namespace IntervalBar.Diagram + +variable {C D E : Type} [Groupoid.{0} C] [Groupoid.{0} D] [Groupoid.{0} E] + [MonoidalCategory C] [MonoidalCategory D] [MonoidalCategory E] + [SymmetricCategory C] [SymmetricCategory D] [SymmetricCategory E] +variable {I J K : Type} [Preorder I] [Preorder J] [Preorder K] + (F:C ⥤ D) (G:D ⥤ E) [F.Braided] [G.Braided] +private lemma map_unit_component (A : Diagram (Diagram C I) J) (i : J) + (j k : I) (h : j ≤ k) : + ((mapObj (map F) A).unit i).hom.app j k h = + F.map ((A.unit i).hom.app j k h) ≫ Functor.OplaxMonoidal.η F := by + change ((map F).map (A.unit i).hom ≫ Functor.OplaxMonoidal.η (map F)).app j k h = _ + erw [comp_app, map_η_app (I:=I) F] + rfl + +private lemma map_cut_component (A : Diagram (Diagram C I) J) (i j k : J) + (hij : i ≤ j) (hjk : j ≤ k) (l m : I) (h : l ≤ m) : + ((mapObj (map F) A).cut i j k hij hjk).hom.app l m h = + Functor.LaxMonoidal.μ F ((A.obj i j hij).obj l m h) ((A.obj j k hjk).obj l m h) ≫ + F.map ((A.cut i j k hij hjk).hom.app l m h) := rfl + +lemma map₂_comp_obj (A : Diagram (Diagram C I) J) : + mapObj (map (I:=I) (F⋙G)) A=mapObj (map G) (mapObj (map F) A) := by + have he (X : Diagram C I) := mapObj_comp F G X + refine ext_heq ?_ ?_ ?_ + · funext i j h; exact he _ + · apply hfunext; intro i + apply iso_hext (he _) rfl + apply hom_hext (he _) rfl + intro j k h + apply heq_of_eq + erw [map_unit_component, map_unit_component, map_unit_component] + simp only [Functor.comp_map, Functor.OplaxMonoidal.comp_η] + erw [Functor.map_comp, Category.assoc] + rfl + · apply hfunext; intro i + apply hfunext; intro j + apply hfunext; intro k + apply hfunext; intro hij + apply hfunext; intro hjk + apply iso_hext (congrArg₂ (fun X Y=>X⊗Y) (he _) (he _)) (he _) + apply hom_hext (congrArg₂ (fun X Y=>X⊗Y) (he _) (he _)) (he _) + intro l m h + apply heq_of_eq + erw [map_cut_component, map_cut_component, map_cut_component] + simp only [Functor.LaxMonoidal.comp_μ] + erw [Functor.map_comp, Category.assoc] + rfl +lemma map₂_comp : map (I:=J) (map (I:=I) (F⋙G))=map (map F) ⋙ map (map G) := by + refine CategoryTheory.Functor.hext (map₂_comp_obj F G) ?_ + intro A B f + apply hom_hext (map₂_comp_obj F G A) (map₂_comp_obj F G B) + intro i j hij + apply hom_hext (mapObj_comp F G _) (mapObj_comp F G _) + intro l m hlm + rfl +lemma map₃_comp_obj (l m p : ℕ) + (A : Diagram (Diagram (Diagram C (Fin (p+1))) (Fin (m+1))) (Fin (l+1))) : + mapObj (map (I:=Fin (m+1)) (map (I:=Fin (p+1)) (F⋙G))) A = + mapObj (map (map G)) (mapObj (map (map F)) A) := by + have he (X : Diagram (Diagram C (Fin (p+1))) (Fin (m+1))) : + mapObj (map (F⋙G)) X= + mapObj (map G) (mapObj (map F) X) := + map₂_comp_obj F G X + have he₁ (X : Diagram C (Fin (p+1))) : mapObj (F⋙G) X= + mapObj G (mapObj F X) := + mapObj_comp F G X + refine ext_heq ?_ ?_ ?_ + · funext i j hij; exact he _ + · apply hfunext; intro i + apply iso_hext (he _) rfl + apply hom_hext (he _) rfl + intro j z hjz + apply hom_hext (he₁ _) rfl + intro v w hvw + apply heq_of_eq + erw [map_unit_component, map_unit_component, map_unit_component] + erw [comp_app, comp_app, map_η_app, map_η_app] + erw [map_map_app (I:=Fin (p+1)) G, comp_app, + map_η_app (I:=Fin (p+1)) F] + change G.map (F.map (((A.unit i).hom.app j z hjz).app v w hvw)) ≫ + Functor.OplaxMonoidal.η (F ⋙ G) = + G.map (F.map (((A.unit i).hom.app j z hjz).app v w hvw) ≫ + Functor.OplaxMonoidal.η F) ≫ Functor.OplaxMonoidal.η G + erw [Functor.OplaxMonoidal.comp_η, Functor.map_comp, Category.assoc] + rfl + · apply hfunext; intro i + apply hfunext; intro j + apply hfunext; intro z + apply hfunext; intro hij + apply hfunext; intro hjz + apply iso_hext (congrArg₂ (fun X Y=>X⊗Y) (he _) (he _)) (he _) + apply hom_hext (congrArg₂ (fun X Y=>X⊗Y) (he _) (he _)) (he _) + intro v w hvw + apply hom_hext (congrArg₂ (fun X Y=>X⊗Y) (he₁ _) (he₁ _)) (he₁ _) + intro x y hxy + apply heq_of_eq + erw [map_cut_component, map_cut_component, map_cut_component] + change Functor.LaxMonoidal.μ (F ⋙ G) + (((A.obj i j hij).obj v w hvw).obj x y hxy) + (((A.obj j z hjz).obj v w hvw).obj x y hxy) ≫ + G.map (F.map (((A.cut i j z hij hjz).hom.app v w hvw).app x y hxy)) = + Functor.LaxMonoidal.μ G + (F.obj (((A.obj i j hij).obj v w hvw).obj x y hxy)) + (F.obj (((A.obj j z hjz).obj v w hvw).obj x y hxy)) ≫ + G.map (Functor.LaxMonoidal.μ F + (((A.obj i j hij).obj v w hvw).obj x y hxy) + (((A.obj j z hjz).obj v w hvw).obj x y hxy) ≫ + F.map (((A.cut i j z hij hjz).hom.app v w hvw).app x y hxy)) + rw [Functor.LaxMonoidal.comp_μ, Functor.map_comp, Category.assoc] +lemma map₃_comp (l m p : ℕ) : + map (I:=Fin (l+1)) (map (I:=Fin (m+1)) (map (I:=Fin (p+1)) (F⋙G))) = + map (map (map F)) ⋙ map (map (map G)) := by + refine CategoryTheory.Functor.hext (map₃_comp_obj F G l m p) ?_ + intro A B f + apply hom_hext (map₃_comp_obj F G l m p A) (map₃_comp_obj F G l m p B) + intro i j hij + apply hom_hext (map₂_comp_obj F G _) (map₂_comp_obj F G _) + intro v w hvw + apply hom_hext + (congrArg (fun F => F.obj ((A.obj i j hij).obj v w hvw)) (map_comp F G)) + (congrArg (fun F => F.obj ((B.obj i j hij).obj v w hvw)) (map_comp F G)) + intro x y hxy + rfl +lemma bar₃Map_comp : bar₃Map (F⋙G)=bar₃Map F ≫ bar₃Map G := by + ext n x + exact congrArg (fun T => x ⋙ T) (map₃_comp F G n.unop.len n.unop.len n.unop.len) + +end IntervalBar.Diagram + +end + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory MonoidalCategory Simplicial Opposite +namespace BarFinitePower + +section Swap +variable {C : Type} [Category.{0} C] (κ ι : Type) +def swap : (κ → ι → C) ⥤ (ι → κ → C) where + obj X i k := X k i + map f i k := f k i +noncomputable def swapEquiv : (κ → ι → C) ≌ (ι → κ → C) where + functor := swap κ ι + inverse := swap ι κ + unitIso := NatIso.ofComponents (fun _ => Iso.refl _) (by intros; simp only [Iso.refl_hom]; erw [Category.comp_id, Category.id_comp]; rfl) + counitIso := NatIso.ofComponents (fun _ => Iso.refl _) (by intros; simp only [Iso.refl_hom]; erw [Category.comp_id, Category.id_comp]; rfl) + functor_unitIso_comp := by + intro X + funext i k + exact Category.id_comp (𝟙 (X k i)) +instance : (swap (C:=C) κ ι).IsEquivalence := (swapEquiv κ ι).isEquivalence_functor +end Swap +variable {C : Type} (κ : Type) [Groupoid.{0} C] [MonoidalCategory C] [SymmetricCategory C] +open IntervalBar IntervalBar.Diagram StageProductColimit +noncomputable def project (k:κ) : (κ → C) ⥤ C := Pi.eval (fun _ : κ => C) k +noncomputable instance (k:κ) : (project (C:=C) κ k).Braided := inferInstanceAs ((Pi.eval (fun _ : κ => C) k).Braided) +noncomputable def tripleProject (l m n:ℕ) : + Diagram (Diagram (Diagram (κ → C) (Fin (n+1))) (Fin (m+1))) (Fin (l+1)) ⥤ + (κ → Diagram (Diagram (Diagram C (Fin (n+1))) (Fin (m+1))) (Fin (l+1))) := + Functor.pi' (fun k => map (I:=Fin (l+1)) (map (I:=Fin (m+1)) (map (I:=Fin (n+1)) (project κ k)))) +lemma tripleProject_eval (l m n:ℕ) : + tripleProject (C:=C) κ l m n ⋙ powerMap κ (eval₃ l m n) = + eval₃ l m n ⋙ swap (Fin l × (Fin m × Fin n)) κ := rfl +noncomputable instance (l m n:ℕ) : (tripleProject (C:=C) κ l m n).IsEquivalence := by + have : (tripleProject (C:=C) κ l m n ⋙ powerMap κ (eval₃ l m n)).IsEquivalence := by + rw [tripleProject_eval] + infer_instance + exact Functor.isEquivalence_of_comp_right _ (powerMap κ (eval₃ l m n)) +end BarFinitePower + +end + +open _root_.CategoryTheory _root_.OAI.CategoryTheory Simplicial Opposite +namespace BarFinitePower + +variable (κ : Type) +def power : SSet ⥤ SSet where + obj X := { + obj p := κ → X.obj p + map f := ↾fun x k => X.map f (x k) + map_id p := by ext x k; exact congrArg (fun f => f (x k)) (X.map_id p) + map_comp f g := by ext x k; exact congrArg (fun f => f (x k)) (X.map_comp f g) } + map f := { + app p := ↾fun x k => f.app p (x k) + naturality _ _ g := by ext x k; exact congrArg (fun f => f (x k)) (f.naturality g) } + map_id _ := rfl + map_comp _ _ := rfl +noncomputable def lift {X Y : SSet} (f : κ → (X ⟶ Y)) : X ⟶ (power κ).obj Y where + app p := ↾fun x k => (f k).app p x + naturality _ _ g := by + apply ConcreteCategory.hom_ext; intro x; funext k + exact congrArg (fun f => f x) ((f k).naturality g) +variable {C : Type} [Category.{0} C] +noncomputable def nervePiIso : nerve (κ → C) ≅ (power κ).obj (nerve C) where + hom := lift κ (fun k => nerveMap (Pi.eval (fun _ : κ => C) k)) + inv := { + app _ := ↾fun X => Functor.pi' X + naturality _ _ _ := by ext X; rfl } + hom_inv_id := by ext p X; rfl + inv_hom_id := by ext p X; rfl +lemma lift_nerve {D : Type} [Category.{0} D] (F : κ → (D ⥤ C)) : + lift κ (fun k => nerveMap (F k)) = nerveMap (Functor.pi' F) ≫ (nervePiIso κ).hom := rfl +lemma lift_nerve_homology_isIso {D : Type} [Category.{0} D] (F : κ → (D ⥤ C)) + [(Functor.pi' F).IsEquivalence] (n:ℕ) : + IsIso (SSet.homologyMap (lift κ (fun k => nerveMap (F k))) DiagonalResolution.Z n) := by + rw [lift_nerve,SSet.homologyMap_comp] + infer_instance +end BarFinitePower + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/TripleReindex.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/TripleReindex.lean new file mode 100644 index 0000000000000000000000000000000000000000..353a077e69f2143d5a1bfb1b7b1e387a96cfae3a --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/TripleReindex.lean @@ -0,0 +1,115 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Simplicial.StageRefinementMonoidal + +namespace OAI + +section + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory MonoidalCategory Simplicial Opposite +namespace IntervalBar.Diagram + +variable {C D : Type} [Groupoid.{0} C] [MonoidalCategory C] [SymmetricCategory C] + [Groupoid.{0} D] [MonoidalCategory D] [SymmetricCategory D] +variable {I J : Type} [Preorder I] [Preorder J] +noncomputable def diagonalReindex (f : I →o J) : + Diagram (Diagram (Diagram C J) J) J ⥤ Diagram (Diagram (Diagram C I) I) I := + map (map (reindex f)) ⋙ map (reindex f) ⋙ reindex f +noncomputable abbrev map₃ (F : C ⥤ D) [F.Braided] (I : Type) [Preorder I] := + map (I:=I) (map (I:=I) (map (I:=I) F)) +lemma map₃_diagonalReindex (F:C⥤D) [F.Braided] (f:I→o J) : + map₃ F J ⋙ diagonalReindex f = diagonalReindex f ⋙ map₃ F I := by + dsimp only [diagonalReindex,map₃] + simp only [CategoryTheory.Functor.assoc] + conv_lhs => + rw [←CategoryTheory.Functor.assoc,map_map_map_reindex,CategoryTheory.Functor.assoc] + enter [2] + rw [←CategoryTheory.Functor.assoc,map_map_reindex,CategoryTheory.Functor.assoc] + enter [2] + rw [←reindex_map] + +lemma bar₃_map (n m : SimplexCategoryᵒᵖ) (f : n⟶m) (x : (bar₃ (C:=C)).obj n) : + (bar₃ (C:=C)).map f x = f.unop.toOrderHom.toFunctor ⋙ x ⋙ diagonalReindex f.unop.toOrderHom := by + rfl + +variable {F G:C⥤D} [F.Braided] [G.Braided] +noncomputable def natTrans₃ (α:F⟶G) [NatTrans.IsMonoidal α] (I:Type) [Preorder I] : map₃ F I ⟶ map₃ G I := + mapNatTrans (mapNatTrans (mapNatTrans α)) +lemma natTrans₃_reindex (α:F⟶G) [NatTrans.IsMonoidal α] (f:I→o J) + (A : Diagram (Diagram (Diagram C J) J) J) : + HEq ((diagonalReindex f).map ((natTrans₃ α J).app A)) ((natTrans₃ α I).app ((diagonalReindex f).obj A)) := by + have eF := congrArg (fun H=>H.obj A) (map₃_diagonalReindex F f) + have eG := congrArg (fun H=>H.obj A) (map₃_diagonalReindex G f) + apply hom_hext eF eG + intro i j hij + have eF' := congrArg (fun X=>X.obj i j hij) eF + have eG' := congrArg (fun X=>X.obj i j hij) eG + apply hom_hext eF' eG' + intro k l hkl + have eF'' := congrArg (fun X=>X.obj k l hkl) eF' + have eG'' := congrArg (fun X=>X.obj k l hkl) eG' + apply hom_hext eF'' eG'' + intro p q hpq + rfl +end IntervalBar.Diagram + +end + +section +open _root_.CategoryTheory _root_.OAI.CategoryTheory MonoidalCategory Simplicial Opposite +namespace IntervalBar.Diagram + +variable {C D : Type} [Groupoid.{0} C] [MonoidalCategory C] [SymmetricCategory C] + [Groupoid.{0} D] [MonoidalCategory D] [SymmetricCategory D] + {F G : C ⥤ D} [F.Braided] [G.Braided] +noncomputable def tripleNatTrans (α : F ⟶ G) [NatTrans.IsMonoidal α] (n : ℕ) : + map (I:=Fin (n+1)) (map (I:=Fin (n+1)) (map (I:=Fin (n+1)) F)) ⟶ + map (I:=Fin (n+1)) (map (I:=Fin (n+1)) (map (I:=Fin (n+1)) G)) := + mapNatTrans (mapNatTrans (mapNatTrans α)) + +noncomputable def homotopyMap₃ (α : F ⟶ G) [NatTrans.IsMonoidal α] : + bar₃ (C:=C) ⊗ Δ[1] ⟶ bar₃ (C:=D) where + app n := (NerveHomotopy.homotopyMap (tripleNatTrans α n.unop.len)).app n + naturality n m f := by + apply ConcreteCategory.hom_ext + intro x + change ((NerveHomotopy.homotopyMap (tripleNatTrans α m.unop.len)).app m + (((bar₃ (C:=C)).map f x.1), Δ[1].map f x.2)) = + (bar₃ (C:=D)).map f ((NerveHomotopy.homotopyMap (tripleNatTrans α n.unop.len)).app n x) + erw [bar₃_map, bar₃_map] + dsimp only [NerveHomotopy.homotopyMap] + have hc := NerveHomotopy.cylinder_natural + (diagonalReindex (C:=C) f.unop.toOrderHom) + (diagonalReindex (C:=D) f.unop.toOrderHom) + (natTrans₃ α (Fin (n.unop.len+1))) (natTrans₃ α (Fin (m.unop.len+1))) + (map₃_diagonalReindex F _) (map₃_diagonalReindex G _) + (natTrans₃_reindex α _) + change ((f.unop.toOrderHom.toFunctor ⋙ x.1 ⋙ diagonalReindex f.unop.toOrderHom).prod' + ((SSet.stdSimplex.objEquiv (Δ[1].map f x.2)).toOrderHom.toFunctor)) ⋙ + NerveHomotopy.cylinder (natTrans₃ α (Fin (m.unop.len+1))) = + f.unop.toOrderHom.toFunctor ⋙ x.1.prod' ((SSet.stdSimplex.objEquiv x.2).toOrderHom.toFunctor) ⋙ + (NerveHomotopy.cylinder (natTrans₃ α (Fin (n.unop.len+1))) ⋙ diagonalReindex f.unop.toOrderHom) + erw [hc] + rfl + +noncomputable def bar₃Homotopy (α : F ⟶ G) [NatTrans.IsMonoidal α] : + SSet.Homotopy (bar₃Map F) (bar₃Map G) where + h := homotopyMap₃ α + h₀ := by + ext n x + exact congrArg (fun t => t.app n x) (NerveHomotopy.homotopyMap_zero (tripleNatTrans α n.unop.len)) + h₁ := by + ext n x + exact congrArg (fun t => t.app n x) (NerveHomotopy.homotopyMap_one (tripleNatTrans α n.unop.len)) + rel := by ext n x; exact x.1.property.elim +lemma bar₃Map_eq_of_monoidalNatTrans (α : F ⟶ G) [NatTrans.IsMonoidal α] (n : ℕ) : + SSet.homologyMap (bar₃Map F) DiagonalResolution.Z n = + SSet.homologyMap (bar₃Map G) DiagonalResolution.Z n := + (bar₃Homotopy α).congr_homologyMap _ _ +end IntervalBar.Diagram + +end + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/UniformMonoidal.lean b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/UniformMonoidal.lean new file mode 100644 index 0000000000000000000000000000000000000000..473bb71940e057dd23991d7ab002510751151ad0 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleAmenable/Simplicial/UniformMonoidal.lean @@ -0,0 +1,192 @@ +import Mathlib +import OAI.GroupTheory.SimpleAmenable.Configurations.TrajectoryStages +import OAI.GroupTheory.SimpleAmenable.Simplicial.LabelledMonoidal + +namespace OAI + +section + +section + +open CategoryTheory Classical MonoidalCategory +namespace SimpleAmenable.PolygonObject + +namespace Labelled +variable {a n : ℕ} (P : BooleanPartition a) + +lemma objectUniform_sum {U V : Labelled a n} (hU : ObjectUniform P U) (hV : ObjectUniform P V) : + ObjectUniform P (sum U V) := by + intro j + refine Fin.addCases ?_ ?_ j + · intro i x y h; simpa only [PolygonObject.sum,Fin.addCases_left] using hU i x y h + · intro i x y h; simpa only [PolygonObject.sum,Fin.addCases_right] using hV i x y h + +lemma arrowUniform_sum {U V W Z : Labelled a n} {f : U ⟶ W} {g : V ⟶ Z} + (hf : ArrowUniform P f) (hg : ArrowUniform P g) : ArrowUniform P (sumHom f g) := by + intro x y h hP + obtain ⟨x,rfl⟩ := (sumPointEquiv U.polygon V.polygon).surjective x + obtain ⟨y,rfl⟩ := (sumPointEquiv U.polygon V.polygon).surjective y + cases x with + | inl x => + cases y with + | inl y => + simp only [sumPointEquiv_inl] at h + have h := Fin.castAdd_inj.mp h + simp only [sumHom,sumArrow_inl,sumPointEquiv_inl] + simpa only [PolygonObject.sum] using + congrArg (Fin.castAdd Z.polygon.tracks) (hf x y h hP) + | inr y => + have he := congrArg Fin.val h + simp only [sumPointEquiv_inl,sumPointEquiv_inr,Fin.val_castAdd,Fin.val_natAdd] at he + have hx := x.val.1.isLt + omega + | inr x => + cases y with + | inl y => + have he := congrArg Fin.val h + simp only [sumPointEquiv_inl,sumPointEquiv_inr,Fin.val_castAdd,Fin.val_natAdd] at he + have hy := y.val.1.isLt + omega + | inr y => + simp only [sumPointEquiv_inr] at h + have h := (Fin.natAdd_inj _).mp h + simp only [sumHom,sumArrow_inr,sumPointEquiv_inr] + simpa only [PolygonObject.sum] using + congrArg (Fin.natAdd W.polygon.tracks) (hg x y h hP) + +lemma relabel_uniform {U V : PolygonObject a} (e : U.Point ≃ V.Point) + (r : Fin U.tracks → Fin V.tracks) + (he : ∀ x, (e x).val=(r x.val.1,x.val.2)) : + ∀ x y, x.val.1=y.val.1 → P.color x.val.2=P.color y.val.2 → + ((relabelArrow e r he).toEquiv x).val.1=((relabelArrow e r he).toEquiv y).val.1 := by + intro x y h _ + change (e x).val.1=(e y).val.1 + rw [he x,he y,h] + +lemma assocHom_uniform (U V W : Labelled a n) : ArrowUniform P (assocHom U V W) := by + exact relabel_uniform P (sumAssocEquiv U.polygon V.polygon W.polygon) + (Fin.addCases + (Fin.addCases (fun i => i.castAdd (V.polygon.tracks+W.polygon.tracks)) (fun i => (i.castAdd W.polygon.tracks).natAdd U.polygon.tracks)) + (fun i => (i.natAdd V.polygon.tracks).natAdd U.polygon.tracks)) (by + intro x + obtain ⟨y,rfl⟩ := (sumPointEquiv (PolygonObject.sum U.polygon V.polygon) W.polygon).surjective x + cases y with + | inl y => + obtain ⟨z,rfl⟩ := (sumPointEquiv U.polygon V.polygon).surjective y + cases z <;> simp only [sumAssocEquiv_left,sumAssocEquiv_mid,sumPointEquiv_inl,sumPointEquiv_inr] <;> + simp only [PolygonObject.sum,Fin.addCases_left,Fin.addCases_right] + | inr y => + simp only [sumAssocEquiv_right,sumPointEquiv_inr] + simp only [PolygonObject.sum,Fin.addCases_right]) +lemma swapHom_uniform (U V : Labelled a n) : ArrowUniform P (swapHom U V) := by + exact relabel_uniform P (sumSwapEquiv U.polygon V.polygon) + (Fin.addCases (fun i => i.natAdd V.polygon.tracks) (fun i => i.castAdd U.polygon.tracks)) (by + intro x + obtain ⟨y,rfl⟩ := (sumPointEquiv U.polygon V.polygon).surjective x + cases y <;> simp only [sumSwapEquiv_inl,sumSwapEquiv_inr,sumPointEquiv_inl,sumPointEquiv_inr] <;> + simp only [PolygonObject.sum,Fin.addCases_left,Fin.addCases_right]) +lemma leftHom_uniform (U : Labelled a n) : ArrowUniform P (leftHom U) := by + exact relabel_uniform P (leftUnitEquiv U.polygon) (Fin.addCases Fin.elim0 id) (by + intro x + obtain ⟨y,rfl⟩ := (sumPointEquiv PolygonObject.empty U.polygon).surjective x + cases y with + | inl y => exact isEmptyElim y + | inr y => + simp only [leftUnitEquiv_apply,sumPointEquiv_inr] + simp only [PolygonObject.empty,Fin.addCases_right,id_eq]) +lemma rightHom_uniform (U : Labelled a n) : ArrowUniform P (rightHom U) := by + exact relabel_uniform P (rightUnitEquiv U.polygon) (Fin.addCases id Fin.elim0) (by + intro x + obtain ⟨y,rfl⟩ := (sumPointEquiv U.polygon PolygonObject.empty).surjective x + cases y with + | inl y => + simp only [rightUnitEquiv_apply,sumPointEquiv_inl] + simp only [PolygonObject.empty,Fin.addCases_left,id_eq] + | inr y => exact isEmptyElim y) + +lemma sumHom_id (U V : Labelled a n) : sumHom (𝟙 U) (𝟙 V)=𝟙 (sum U V) := + Hom.ext _ _ (sumArrow_id _ _) +end Labelled + +namespace LabelledStage.UniformObject +variable {a n s : ℕ} {P : BooleanPartition a} {L : Fin s → Fin n → CutRing × CutRing} + +noncomputable abbrev sum (U V : UniformObject P L) : UniformObject P L where + obj := Labelled.sum U.obj V.obj + uniform := Labelled.objectUniform_sum P U.uniform V.uniform + supported j := by + refine Fin.addCases ?_ ?_ j + · intro i; simpa only [Fin.addCases_left] using U.supported i + · intro i; simpa only [Fin.addCases_right] using V.supported i + +noncomputable abbrev empty : UniformObject P L where + obj := Labelled.empty + uniform j := Fin.elim0 j + supported j := Fin.elim0 j + +noncomputable def sumHom {U V W Z : UniformObject P L} (f : U ⟶ W) (g : V ⟶ Z) : + sum U V ⟶ sum W Z := + ⟨Labelled.sumHom f.arrow g.arrow,Labelled.arrowUniform_sum P f.uniform g.uniform⟩ +noncomputable def assocHom (U V W : UniformObject P L) : sum (sum U V) W ⟶ sum U (sum V W) := + ⟨Labelled.assocHom U.obj V.obj W.obj,Labelled.assocHom_uniform P _ _ _⟩ +noncomputable def leftHom (U : UniformObject P L) : sum empty U ⟶ U := + ⟨Labelled.leftHom U.obj,Labelled.leftHom_uniform P _⟩ +noncomputable def rightHom (U : UniformObject P L) : sum U empty ⟶ U := + ⟨Labelled.rightHom U.obj,Labelled.rightHom_uniform P _⟩ +noncomputable def swapHom (U V : UniformObject P L) : sum U V ⟶ sum V U := + ⟨Labelled.swapHom U.obj V.obj,Labelled.swapHom_uniform P _ _⟩ + +noncomputable instance : MonoidalCategoryStruct (UniformObject P L) where + tensorObj := sum + tensorHom := sumHom + whiskerLeft U _ _ f := sumHom (𝟙 U) f + whiskerRight f U := sumHom f (𝟙 U) + tensorUnit := empty + associator U V W := asIso (assocHom U V W) + leftUnitor U := asIso (leftHom U) + rightUnitor U := asIso (rightHom U) + +noncomputable def inducing : Monoidal.InducingFunctorData (forget (P:=P) (L:=L)) where + μIso _ _ := Iso.refl _ + εIso := Iso.refl _ + whiskerLeft_eq := by intros; simp only [Iso.refl_hom,Iso.refl_inv]; rfl + whiskerRight_eq := by intros; simp only [Iso.refl_hom,Iso.refl_inv]; rfl + tensorHom_eq := by intros; simp only [Iso.refl_hom,Iso.refl_inv]; rfl + associator_eq := by + intro U V W + change Labelled.assocHom U.obj V.obj W.obj = + (𝟙 _ ≫ Labelled.sumHom (𝟙 _) (𝟙 _)) ≫ Labelled.assocHom U.obj V.obj W.obj ≫ + (Labelled.sumHom (𝟙 _) (𝟙 _) ≫ 𝟙 _) + simp only [Labelled.sumHom_id,Category.id_comp,Category.comp_id] + leftUnitor_eq := by + intro U + change Labelled.leftHom U.obj = (𝟙 _ ≫ Labelled.sumHom (𝟙 _) (𝟙 _)) ≫ Labelled.leftHom U.obj + rw [Labelled.sumHom_id,Category.id_comp,Category.id_comp] + rightUnitor_eq := by + intro U + change Labelled.rightHom U.obj = (𝟙 _ ≫ Labelled.sumHom (𝟙 _) (𝟙 _)) ≫ Labelled.rightHom U.obj + rw [Labelled.sumHom_id,Category.id_comp,Category.id_comp] + +noncomputable instance : MonoidalCategory (UniformObject P L) := Monoidal.induced forget inducing +noncomputable instance : (forget (P:=P) (L:=L)).Monoidal := + Functor.CoreMonoidal.toMonoidal (Monoidal.fromInducedCoreMonoidal forget inducing) + +noncomputable instance : BraidedCategory (UniformObject P L) := + BraidedCategory.ofFaithful forget (fun U V => asIso (swapHom U V)) (by + intro U V + change (𝟙 _) ≫ Labelled.swapHom U.obj V.obj = Labelled.swapHom U.obj V.obj ≫ (𝟙 _) + simp) +noncomputable instance : (forget (P:=P) (L:=L)).Braided where + braided U V := by + change (𝟙 _) ≫ Labelled.swapHom U.obj V.obj = Labelled.swapHom U.obj V.obj ≫ (𝟙 _) + simp +noncomputable instance : SymmetricCategory (UniformObject P L) := SymmetricCategory.ofFaithful forget + +end LabelledStage.UniformObject +end SimpleAmenable.PolygonObject + +end + +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleOvergroups/ActionCorner.lean b/lean/OAI/GroupTheory/SimpleOvergroups/ActionCorner.lean new file mode 100644 index 0000000000000000000000000000000000000000..c13e96848d15ceb40aa6f47c480f935170d4691b --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleOvergroups/ActionCorner.lean @@ -0,0 +1,47 @@ +import Mathlib +import OAI.GroupTheory.SimpleOvergroups.ActionMonoid + +namespace OAI + + +noncomputable section +namespace SimpleFInftyOvergroups.RingAssembly +open SourceActionMonoid +open scoped Classical +variable {V Y R : Type*} [Group V] [MulAction V Y] [Ring R] + +local instance actionCornerMonoidWithZero : MonoidWithZero (M V Y) where + __ := (inferInstance : Monoid (M V Y)) + zero := omega + zero_mul := omega_mul + mul_zero := mul_omega + +variable (δ : M V Y →*₀ R) + +def actionUnits : V →* Rˣ := (δ.toMonoidHom.comp groupMap).toHomUnits + +theorem actionUnits_val (w : V) : (actionUnits δ w).val=δ (groupMap w) := rfl + +theorem actionUnits_injective (hδ : Function.Injective δ) : Function.Injective (actionUnits δ) := by + intro w v hwv + apply groupMap_injective (Z:=Y) + exact hδ (congrArg Units.val hwv) + +theorem corner_TS (y z : Y) : δ (delete y) * δ (prepend z)=if y=z then 1 else 0 := by + rw [←map_mul] + by_cases hyz : y=z + · subst z + rw [ite_eq_left rfl,delete_prefix,map_one] + · rw [ite_eq_right hyz,delete_prefix_ne y z hyz] + exact map_zero δ + +theorem corner_ρS (w : V) (y : Y) : (actionUnits δ w).val * δ (prepend y)=δ (prepend (w • y)) := by + rw [actionUnits_val,←map_mul,group_prefix] + +theorem corner_Tρ (w : V) (y : Y) : δ (delete y) * (actionUnits δ w).val=δ (delete (w⁻¹ • y)) := by + rw [actionUnits_val,←map_mul,delete_group] + +end SimpleFInftyOvergroups.RingAssembly +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleOvergroups/ActionMonoid.lean b/lean/OAI/GroupTheory/SimpleOvergroups/ActionMonoid.lean new file mode 100644 index 0000000000000000000000000000000000000000..60a0d88e6c0ca53082360944fd28673a709a5424 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleOvergroups/ActionMonoid.lean @@ -0,0 +1,493 @@ +import Mathlib + +namespace OAI + +namespace SourceActionMonoid +universe u v +variable (V : Type u) (Z : Type v) [Group V] [MulAction V Z] + +inductive Generator + | grp : V → Generator + | pre : Z → Generator + | delete : Z → Generator + | zero : Generator + +abbrev Word := FreeMonoid (Generator V Z) + +inductive Relation : Word V Z → Word V Z → Prop + | group_mul (g h : V) : Relation + (.of (.grp g) * .of (.grp h)) (.of (.grp (g * h))) + | group_one : Relation (.of (.grp 1)) 1 + | delete_prefix (z : Z) : Relation (.of (.delete z) * .of (.pre z)) 1 + | delete_prefix_ne (y z : Z) (h : y ≠ z) : Relation + (.of (.delete y) * .of (.pre z)) (.of .zero) + | group_prefix (g : V) (z : Z) : Relation + (.of (.grp g) * .of (.pre z)) (.of (.pre (g • z))) + | delete_group (z : Z) (g : V) : Relation + (.of (.delete z) * .of (.grp g)) (.of (.delete (g⁻¹ • z))) + | zero_left (a : Generator V Z) : Relation (.of .zero * .of a) (.of .zero) + | zero_right (a : Generator V Z) : Relation (.of a * .of .zero) (.of .zero) + +abbrev M := PresentedMonoid (Relation V Z) + +variable {V Z} + +def of (a : Generator V Z) : M V Z := PresentedMonoid.of (Relation V Z) a + +def omega : M V Z := of .zero + +def prepend (z : Z) : M V Z := of (.pre z) +def delete (z : Z) : M V Z := of (.delete z) + +def groupMap : V →* M V Z where + toFun g := of (.grp g) + map_one' := PresentedMonoid.mk_eq_mk_of_rel (Relation.group_one (V := V) (Z := Z)) + map_mul' g h := (PresentedMonoid.mk_eq_mk_of_rel (Relation.group_mul (V := V) (Z := Z) g h)).symm + +@[simp] lemma of_grp (g : V) : of (.grp g) = groupMap (Z := Z) g := rfl + +@[simp] lemma delete_prefix (z : Z) : delete (V := V) z * prepend z = 1 := + PresentedMonoid.mk_eq_mk_of_rel (Relation.delete_prefix (V := V) (Z := Z) z) + +lemma delete_prefix_ne (y z : Z) (h : y ≠ z) : + delete (V := V) y * prepend z = omega := + PresentedMonoid.mk_eq_mk_of_rel (Relation.delete_prefix_ne (V := V) (Z := Z) y z h) + +lemma group_prefix (g : V) (z : Z) : groupMap g * prepend z = prepend (V := V) (g • z) := + PresentedMonoid.mk_eq_mk_of_rel (Relation.group_prefix (V := V) (Z := Z) g z) + +lemma delete_group (z : Z) (g : V) : delete (V := V) z * groupMap g = delete (g⁻¹ • z) := + PresentedMonoid.mk_eq_mk_of_rel (Relation.delete_group (V := V) (Z := Z) z g) + +@[simp] lemma omega_of (a : Generator V Z) : omega * of a = omega := + PresentedMonoid.mk_eq_mk_of_rel (Relation.zero_left (V := V) (Z := Z) a) + +@[simp] lemma of_omega (a : Generator V Z) : of a * omega = omega := + PresentedMonoid.mk_eq_mk_of_rel (Relation.zero_right (V := V) (Z := Z) a) + +@[simp] lemma omega_mul (a : M V Z) : omega * a = omega := by + induction a using PresentedMonoid.inductionOn with | h w => + induction w using FreeMonoid.inductionOn' with + | one => simp + | of_mul a w ih => + rw [map_mul, ← mul_assoc] + exact (congrArg (· * PresentedMonoid.mk (Relation V Z) w) (omega_of a)).trans ih + +@[simp] lemma mul_omega (a : M V Z) : a * omega = omega := by + induction a using PresentedMonoid.inductionOn with | h w => + induction w using FreeMonoid.inductionOn' with + | one => simp + | of_mul a w ih => + rw [map_mul, mul_assoc, ih] + exact of_omega a + +def prefixes (l : List Z) : M V Z := (l.map prepend).prod + +def deletions (l : List Z) : M V Z := (l.reverse.map delete).prod + +@[simp] lemma prefixes_nil : prefixes (V := V) ([] : List Z) = 1 := rfl +@[simp] lemma deletions_nil : deletions (V := V) ([] : List Z) = 1 := rfl +@[simp] lemma prefixes_cons (z : Z) (l : List Z) : + prefixes (V := V) (z :: l) = prepend z * prefixes l := rfl + +lemma deletions_append (l k : List Z) : + deletions (V := V) (l ++ k) = deletions k * deletions l := by + simp [deletions] + +@[simp] lemma deletions_cons (z : Z) (l : List Z) : + deletions (V := V) (z :: l) = deletions l * delete z := by + simp [deletions] + +def normal (l : List Z) (g : V) (r : List Z) : M V Z := + prefixes l * groupMap g * deletions r + +lemma prepend_normal (z : Z) (l : List Z) (g : V) (r : List Z) : + prepend z * normal l g r = normal (z :: l) g r := by + simp only [normal, prefixes_cons, mul_assoc] + +lemma group_normal_nil (h g : V) (r : List Z) : + groupMap h * normal [] g r = normal [] (h * g) r := by + simp [normal, map_mul, mul_assoc] + +lemma group_normal_cons (h : V) (z : Z) (l : List Z) (g : V) (r : List Z) : + groupMap h * normal (z :: l) g r = normal ((h • z) :: l) g r := by + simp only [normal, prefixes_cons, ← mul_assoc, group_prefix] + +lemma delete_normal_nil (z : Z) (g : V) (r : List Z) : + delete z * normal [] g r = normal [] 1 (r ++ [g⁻¹ • z]) := by + simp [normal, ← mul_assoc, delete_group, deletions] + +lemma delete_normal_cons (z : Z) (l : List Z) (g : V) (r : List Z) : + delete z * normal (z :: l) g r = normal l g r := by + simp only [normal, prefixes_cons, ← mul_assoc, delete_prefix, one_mul] + +lemma delete_normal_cons_ne (y z : Z) (h : y ≠ z) (l : List Z) (g : V) (r : List Z) : + delete y * normal (z :: l) g r = omega := by + simp only [normal, prefixes_cons, ← mul_assoc, delete_prefix_ne y z h, omega_mul] + +theorem normal_exists (a : M V Z) : + a = omega ∨ ∃ (l : List Z) (g : V) (r : List Z), a = normal l g r := by + classical + induction a using PresentedMonoid.inductionOn with | h w => + induction w using FreeMonoid.inductionOn' with + | one => + right + exact ⟨[], 1, [], by simp [normal]⟩ + | of_mul c w ih => + rw [map_mul] + rcases ih with h | ⟨l, g, r, h⟩ + · left + rw [h] + exact of_omega c + · rw [h] + change of c * normal l g r = omega ∨ _ + cases c with + | zero => exact Or.inl (omega_mul _) + | pre z => exact Or.inr ⟨z :: l, g, r, prepend_normal z l g r⟩ + | grp q => + cases l with + | nil => exact Or.inr ⟨[], q * g, r, group_normal_nil q g r⟩ + | cons z l => exact Or.inr ⟨q • z :: l, g, r, group_normal_cons q z l g r⟩ + | delete y => + cases l with + | nil => exact Or.inr ⟨[], 1, r ++ [g⁻¹ • y], delete_normal_nil y g r⟩ + | cons z l => + by_cases hyz : y = z + · subst y + exact Or.inr ⟨l, g, r, delete_normal_cons z l g r⟩ + · exact Or.inl (delete_normal_cons_ne y z hyz l g r) + +abbrev State := List Z × V + +def headAction (g : V) : State (V := V) (Z := Z) → State (V := V) (Z := Z) + | ([], v) => ([], g * v) + | (z :: zs, v) => (g • z :: zs, v) + +noncomputable section +local instance : DecidableEq Z := Classical.decEq _ + +def generatorAction : Generator V Z → Function.End (Option (State (V := V) (Z := Z))) + | .grp g => Option.map (headAction g) + | .pre z => Option.map (fun s => (z :: s.1, s.2)) + | .delete z => fun s => match s with + | none => none + | some ([], _) => none + | some (y :: ys, v) => if z = y then some (ys, v) else none + | .zero => fun _ => none + +@[simp] lemma end_mul_apply {A : Type*} (f g : Function.End A) (a : A) : + (f * g) a = f (g a) := rfl +@[simp] lemma end_one_apply {A : Type*} (a : A) : (1 : Function.End A) a = a := rfl + +lemma generatorAction_relations (a b : Word V Z) (h : Relation V Z a b) : + FreeMonoid.lift generatorAction a = FreeMonoid.lift generatorAction b := by + cases h with + | group_mul g h => + simp only [map_mul, FreeMonoid.lift_eval_of] + funext s + simp only [end_mul_apply] + cases s with + | none => rfl + | some p => + rcases p with ⟨l, v⟩ + cases l <;> simp [generatorAction, headAction, mul_assoc, mul_smul] + | group_one => + simp only [FreeMonoid.lift_eval_of, map_one] + funext s + simp only [end_one_apply] + cases s with + | none => rfl + | some p => + rcases p with ⟨l, v⟩ + cases l <;> simp [generatorAction, headAction] + | delete_prefix z => + simp only [map_mul, FreeMonoid.lift_eval_of, map_one] + funext s + simp only [end_mul_apply, end_one_apply] + cases s <;> simp [generatorAction] + | delete_prefix_ne y z h => + simp only [map_mul, FreeMonoid.lift_eval_of] + funext s + simp only [end_mul_apply] + cases s <;> simp [generatorAction, h] + | group_prefix g z => + simp only [map_mul, FreeMonoid.lift_eval_of] + funext s + simp only [end_mul_apply] + cases s <;> simp [generatorAction, headAction] + | delete_group z g => + simp only [map_mul, FreeMonoid.lift_eval_of] + funext s + simp only [end_mul_apply] + cases s with + | none => rfl + | some p => + rcases p with ⟨l, v⟩ + cases l with + | nil => rfl + | cons y ys => + have hi : z = g • y ↔ g⁻¹ • z = y := by + constructor + · intro h + rw [h, inv_smul_smul] + · intro h + rw [← h, smul_inv_smul] + simp only [generatorAction, Option.map_some, headAction] + simp only [hi] + | zero_left a => + simp only [map_mul, FreeMonoid.lift_eval_of] + rfl + | zero_right a => + simp only [map_mul, FreeMonoid.lift_eval_of] + funext s + simp only [end_mul_apply] + cases a <;> rfl + +def representation : M V Z →* Function.End (Option (State (V := V) (Z := Z))) := + PresentedMonoid.lift generatorAction generatorAction_relations + +@[simp] lemma representation_of (a : Generator V Z) : + representation (of a) = generatorAction a := rfl + +@[simp] lemma representation_omega (s : Option (State (V := V) (Z := Z))) : + representation omega s = none := rfl + +@[simp] lemma representation_group (g : V) (s : Option (State (V := V) (Z := Z))) : + representation (groupMap (Z := Z) g) s = s.map (headAction g) := rfl + +@[simp] lemma representation_prepend (z : Z) (s : Option (State (V := V) (Z := Z))) : + representation (prepend (V := V) z) s = s.map (fun p => (z :: p.1, p.2)) := rfl + +def strip : List Z → List Z → Option (List Z) + | [], w => some w + | _ :: _, [] => none + | z :: zs, y :: ys => if z = y then strip zs ys else none + +@[simp] lemma strip_append (r l : List Z) : strip r (r ++ l) = some l := by + induction r with + | nil => rfl + | cons z r ih => simpa [strip] using ih + +lemma strip_eq_some_iff (r k t : List Z) : strip r k = some t ↔ k = r ++ t := by + induction r generalizing k with + | nil => simp [strip] + | cons z r ih => + cases k with + | nil => simp [strip] + | cons y k => + by_cases h : z = y + · subst y + simp [strip, ih] + · simp [strip, h, Ne.symm h] + +@[simp] lemma representation_prefixes (l : List Z) + (s : Option (State (V := V) (Z := Z))) : + representation (prefixes (V := V) l) s = s.map (fun p => (l ++ p.1, p.2)) := by + induction l with + | nil => simp + | cons z l ih => + simp only [prefixes_cons, map_mul, end_mul_apply, ih, representation_prepend, + Option.map_map] + rfl + +@[simp] lemma representation_delete_none (z : Z) : + representation (delete (V := V) z) none = none := rfl + +@[simp] lemma representation_delete_nil (z : Z) (v : V) : + representation (delete (V := V) z) (some ([], v)) = none := rfl + +@[simp] lemma representation_delete_cons (z y : Z) (k : List Z) (v : V) : + representation (delete (V := V) z) (some (y :: k, v)) = + if z = y then some (k, v) else none := rfl + +@[simp] lemma representation_deletions_none (r : List Z) : + representation (deletions (V := V) r) none = none := by + induction r with + | nil => rfl + | cons z r ih => + simpa only [deletions_cons, map_mul, end_mul_apply, representation_delete_none] using ih + +lemma representation_deletions (r : List Z) (k : List Z) (v : V) : + representation (deletions (V := V) r) (some (k, v)) = + (strip r k).map (fun t => (t, v)) := by + induction r generalizing k with + | nil => rfl + | cons z r ih => + rw [deletions_cons, map_mul, end_mul_apply] + cases k with + | nil => simp [strip] + | cons y k => + by_cases h : z = y + · subst y + simpa [strip] using ih k + · simp [strip, h] + +@[simp] lemma strip_self (r : List Z) : strip r r = some [] := by + simpa only [List.append_nil] using strip_append r [] + +lemma representation_normal (l : List Z) (g : V) (r k : List Z) (v : V) : + representation (normal l g r) (some (k, v)) = + (strip r k).map (fun t => + let p := headAction g (t, v) + (l ++ p.1, p.2)) := by + simp only [normal, map_mul, end_mul_apply, representation_deletions, + representation_group, representation_prefixes, Option.map_map] + rfl + +@[simp] lemma representation_normal_at (l : List Z) (g : V) (r : List Z) : + representation (normal l g r) (some (r, 1)) = some (l, g) := by + simp only [representation_normal, strip_self, Option.map_some, headAction, + List.append_nil, mul_one] + +lemma normal_ne_zero (l : List Z) (g : V) (r : List Z) : normal l g r ≠ omega := by + intro h + have e := congrArg (fun a : M V Z => representation a (some (r, 1))) h + simp only [representation_normal_at, representation_omega, reduceCtorEq] at e + +lemma normal_domain_prefix (l : List Z) (g : V) (r k : List Z) (v : V) + (h : representation (normal l g r) (some (k, v)) ≠ none) : r <+: k := by + cases hs : strip r k with + | none => simp only [representation_normal, hs, Option.map_none, ne_eq, not_true_eq_false] at h + | some t => exact ⟨t, ((strip_eq_some_iff _ _ _).mp hs).symm⟩ + +theorem normal_eq_parameters {l l' : List Z} {g g' : V} {r r' : List Z} + (h : normal l g r = normal l' g' r') : l = l' ∧ g = g' ∧ r = r' := by + have hr : r <+: r' := normal_domain_prefix l g r r' 1 (by + rw [h, representation_normal_at] + exact Option.some_ne_none _) + have hr' : r' <+: r := normal_domain_prefix l' g' r' r 1 (by + rw [← h, representation_normal_at] + exact Option.some_ne_none _) + have heq : r = r' := hr.eq_of_length (Nat.le_antisymm hr.length_le hr'.length_le) + subst r' + have e := congrArg (fun a : M V Z => representation a (some (r, 1))) h + simp only [representation_normal_at, Option.some.injEq, Prod.mk.injEq] at e + exact ⟨e.1, e.2, rfl⟩ + +@[simp] theorem normal_eq_iff {l l' : List Z} {g g' : V} {r r' : List Z} : + normal l g r = normal l' g' r' ↔ l = l' ∧ g = g' ∧ r = r' := by + constructor + · exact normal_eq_parameters + · rintro ⟨rfl, rfl, rfl⟩ + rfl + +theorem unique_normal_form (a : M V Z) (ha : a ≠ omega) : + ∃! p : List Z × V × List Z, a = normal p.1 p.2.1 p.2.2 := by + obtain h | ⟨l, g, r, h⟩ := normal_exists a + · exact (ha h).elim + · refine ⟨(l, g, r), h, ?_⟩ + rintro ⟨l', g', r'⟩ h' + obtain ⟨rfl, rfl, rfl⟩ := normal_eq_parameters (h'.symm.trans h) + rfl + +theorem groupMap_injective : Function.Injective (groupMap (V := V) (Z := Z)) := by + intro g h heq + have he : normal ([] : List Z) g [] = normal [] h [] := by + simpa only [normal, prefixes_nil, deletions_nil, one_mul, mul_one] using heq + exact (normal_eq_parameters he).2.1 + +def groupUnits : V →* (M V Z)ˣ := (groupMap (V := V) (Z := Z)).toHomUnits + +@[simp] lemma groupUnits_val (g : V) : + (groupUnits (Z := Z) g).val = groupMap (Z := Z) g := rfl + +theorem groupUnits_injective : Function.Injective (groupUnits (V := V) (Z := Z)) := by + intro g h heq + exact groupMap_injective (congrArg Units.val heq) + +end + +namespace Algorithm +variable [DecidableEq Z] + +abbrev Form := Option (List Z × V × List Z) + +def eval : Form (V := V) (Z := Z) → M V Z + | none => omega + | some (l, g, r) => normal l g r + +def step : Generator V Z → Form (V := V) (Z := Z) → Form (V := V) (Z := Z) + | _, none => none + | .zero, _ => none + | .pre z, some (l, g, r) => some (z :: l, g, r) + | .grp h, some ([], g, r) => some ([], h * g, r) + | .grp h, some (z :: l, g, r) => some (h • z :: l, g, r) + | .delete y, some ([], g, r) => some ([], 1, r ++ [g⁻¹ • y]) + | .delete y, some (z :: l, g, r) => if y = z then some (l, g, r) else none + +lemma eval_step (c : Generator V Z) (f : Form (V := V) (Z := Z)) : + eval (step c f) = of c * eval f := by + cases f with + | none => exact (of_omega c).symm + | some p => + rcases p with ⟨l, g, r⟩ + cases c with + | zero => exact (omega_mul _).symm + | pre z => exact (prepend_normal z l g r).symm + | grp h => + cases l with + | nil => exact (group_normal_nil h g r).symm + | cons z l => exact (group_normal_cons h z l g r).symm + | delete y => + cases l with + | nil => exact (delete_normal_nil y g r).symm + | cons z l => + by_cases h : y = z + · subst y + change eval (if z = z then some (l, g, r) else none) = + delete z * normal (z :: l) g r + rw [ite_eq_left rfl] + exact (delete_normal_cons z l g r).symm + · change eval (if y = z then some (l, g, r) else none) = + delete y * normal (z :: l) g r + rw [ite_eq_right h] + exact (delete_normal_cons_ne y z h l g r).symm + +def normalize : List (Generator V Z) → Form (V := V) (Z := Z) + | [] => some ([], 1, []) + | c :: w => step c (normalize w) + +theorem normalize_correct (w : List (Generator V Z)) : + eval (normalize w) = PresentedMonoid.mk (Relation V Z) (FreeMonoid.ofList w) := by + induction w with + | nil => simp [normalize, eval, normal] + | cons c w ih => + simp only [normalize, eval_step, ih, FreeMonoid.ofList_cons, map_mul] + rfl + +omit [DecidableEq Z] in +lemma eval_injective : Function.Injective (eval (V := V) (Z := Z)) := by + intro a b hab + cases a with + | none => + cases b with + | none => rfl + | some p => exact (normal_ne_zero p.1 p.2.1 p.2.2 hab.symm).elim + | some p => + rcases p with ⟨l, g, r⟩ + cases b with + | none => exact (normal_ne_zero l g r hab).elim + | some p => + rcases p with ⟨l', g', r'⟩ + obtain ⟨rfl, rfl, rfl⟩ := normal_eq_parameters hab + rfl + +theorem word_eq_iff (a b : List (Generator V Z)) : + PresentedMonoid.mk (Relation V Z) (FreeMonoid.ofList a) = + PresentedMonoid.mk (Relation V Z) (FreeMonoid.ofList b) ↔ normalize a = normalize b := by + rw [← normalize_correct, ← normalize_correct] + exact eval_injective.eq_iff + +def equalWords [DecidableEq V] (a b : List (Generator V Z)) : Bool := + decide (normalize a = normalize b) + +theorem equalWords_correct [DecidableEq V] (a b : List (Generator V Z)) : + equalWords a b = true ↔ + PresentedMonoid.mk (Relation V Z) (FreeMonoid.ofList a) = + PresentedMonoid.mk (Relation V Z) (FreeMonoid.ofList b) := by + simp only [equalWords, decide_eq_true_eq, ← word_eq_iff] + +end Algorithm +end SourceActionMonoid + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleOvergroups/ArrayNames.lean b/lean/OAI/GroupTheory/SimpleOvergroups/ArrayNames.lean new file mode 100644 index 0000000000000000000000000000000000000000..848070ce0a6a3b5d9bbc8f6b366981312898d23b --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleOvergroups/ArrayNames.lean @@ -0,0 +1,160 @@ +import Mathlib +import OAI.Computability.FiniteCompiler.Quotients +import OAI.GroupTheory.FiniteType.SequentialLimit + +namespace OAI + + + +namespace SimpleFInftyOvergroups.EffectiveNames.Array +noncomputable section +open scoped Classical +variable {A X D K : Type*} [AddCommMonoid D] +variable (coeff : A → D) (index : X → K) + +abbrev Name (A X : Type*) := List (A × X) + +def value (p : Name A X) : K →₀ D := + (p.map fun a => Finsupp.single (index a.2) (coeff a.1)).sum + +@[simp] theorem value_nil : value coeff index [] = 0 := rfl +@[simp] theorem value_cons (a : A × X) (p : Name A X) : + value coeff index (a::p) = Finsupp.single (index a.2) (coeff a.1) + value coeff index p := rfl +@[simp] theorem value_append (p q : Name A X) : + value coeff index (p++q) = value coeff index p + value coeff index q := by + simp [value] + +theorem value_eq_zero_of_not_named (p : Name A X) (k : K) + (h : ∀ a ∈ p, index a.2 ≠ k) : value coeff index p k = 0 := by + induction p with + | nil => rfl + | cons a p ih => + rw [value_cons, Finsupp.add_apply, Finsupp.single_eq_of_ne (Ne.symm (h a List.mem_cons_self))] + simpa using ih (fun b hb => h b (List.mem_cons_of_mem _ hb)) + +theorem value_eq_iff (p q : Name A X) : + value coeff index p = value coeff index q ↔ + ∀ a ∈ p++q, value coeff index p (index a.2) = value coeff index q (index a.2) := by + constructor + · intro h a _; rw [h] + · intro h + ext k + by_cases hn : ∃ a ∈ p++q, index a.2 = k + · obtain ⟨a,ha,rfl⟩ := hn + exact h a ha + · have hh : ∀ a ∈ p++q, index a.2 ≠ k := by simpa using hn + rw [value_eq_zero_of_not_named coeff index p k (fun a ha => hh a (List.mem_append_left _ ha)), + value_eq_zero_of_not_named coeff index q k (fun a ha => hh a (List.mem_append_right _ ha))] + +theorem value_surjective (hc : Function.Surjective coeff) (hx : Function.Surjective index) : + Function.Surjective (value coeff index) := by + intro p + induction p using Finsupp.induction with + | zero => exact ⟨[], rfl⟩ + | single_add x d p hn hd ih => + obtain ⟨a,rfl⟩ := hc d + obtain ⟨b,rfl⟩ := hx x + obtain ⟨q,rfl⟩ := ih + exact ⟨(a,b)::q, rfl⟩ + +theorem value_map_index {Y J : Type*} (f : X → Y) (j : Y → J) (g : K → J) + (h : ∀ x, j (f x) = g (index x)) (p : Name A X) : + value coeff j (p.map (fun a => (a.1, f a.2))) = Finsupp.mapDomain g (value coeff index p) := by + induction p with + | nil => simp + | cons a p ih => simp [ih, h, Finsupp.mapDomain_add] + +variable (zeroName : A) (addName : A → A → A) + +def entry (p : Name A X) (x : X) : A := + (p.map fun a => if index a.2 = index x then a.1 else zeroName).foldl addName zeroName + +theorem coefficient_fold + (hadd : ∀ a b, coeff (addName a b) = coeff a + coeff b) (l : List A) (a : A) : + coeff (l.foldl addName a) = coeff a + (l.map coeff).sum := by + induction l generalizing a with + | nil => simp + | cons b l ih => simp only [List.foldl_cons,ih,hadd,List.map_cons,List.sum_cons,add_assoc] + +theorem entry_correct (hzero : coeff zeroName = 0) + (hadd : ∀ a b, coeff (addName a b) = coeff a + coeff b) (p : Name A X) (x : X) : + coeff (entry index zeroName addName p x) = value coeff index p (index x) := by + rw [entry, coefficient_fold coeff addName hadd, hzero, zero_add] + induction p with + | nil => rfl + | cons a p ih => + simp only [List.map_cons,List.sum_cons,value_cons,Finsupp.add_apply,ih] + congr 1 + by_cases h : index a.2 = index x + · simp [h] + · simp [h,hzero] + +variable [Primcodable A] [Primcodable X] +variable (ha : Primrec₂ addName) +variable (hx : ComputablePred (fun p : X × X => index p.1 = index p.2)) +variable (hc : ComputablePred (fun p : A × A => coeff p.1 = coeff p.2)) + +include ha hx in +theorem computable_entry : Computable₂ (entry index zeroName addName) := by + have hs : Computable₂ (fun (x : X) (a : A × X) => + if index a.2 = index x then a.1 else zeroName) := by + refine (Computable.cond (hx.decide.comp + ((Computable.snd.comp Computable.snd).pair Computable.fst)) + (Computable.fst.comp Computable.snd) (Computable.const zeroName)).of_eq ?_ + intro p + simp only [Bool.cond_decide] + have hl : Computable (fun p : Name A X × X => + p.1.map (fun a => if index a.2 = index p.2 then a.1 else zeroName)) := + (FiniteAlgebraicEnvelopes.Effect.computable_map_parameter hs).comp Computable.snd Computable.fst + have hf : Primrec (fun l : List A => l.foldl addName zeroName) := + Primrec.list_foldl Primrec.id (Primrec.const zeroName) + (ha.comp (Primrec.fst.comp Primrec.snd) (Primrec.snd.comp Primrec.snd)).to₂ + exact hf.to_comp.comp hl + +include ha hx hc in +omit [AddCommMonoid D] in +theorem computable_entries_eq : Computable₂ + (fun (p : Name A X × Name A X) (a : A × X) => + decide (coeff (entry index zeroName addName p.1 a.2) = + coeff (entry index zeroName addName p.2 a.2))) := by + have he : Computable₂ (entry index zeroName addName) := + computable_entry index zeroName addName ha hx + have hl : Computable (fun p : (Name A X × Name A X) × (A × X) => + entry index zeroName addName p.1.1 p.2.2) := + he.comp (Computable.fst.comp Computable.fst) (Computable.snd.comp Computable.snd) + have hr : Computable (fun p : (Name A X × Name A X) × (A × X) => + entry index zeroName addName p.1.2 p.2.2) := + he.comp (Computable.snd.comp Computable.fst) (Computable.snd.comp Computable.snd) + apply (hc.decide.comp (hl.pair hr)).of_eq + intro p + congr 1 + +include ha hx hc in +omit [AddCommMonoid D] in +theorem computable_entry_tests : Computable + (fun p : Name A X × Name A X => (p.1++p.2).map fun a => + decide (coeff (entry index zeroName addName p.1 a.2) = + coeff (entry index zeroName addName p.2 a.2))) := + (FiniteAlgebraicEnvelopes.Effect.computable_map_parameter + (computable_entries_eq coeff index zeroName addName ha hx hc)).comp + Computable.id (Primrec.list_append.to_comp.comp Computable.fst Computable.snd) + +include ha hx hc in +theorem computable_value_eq (hzero : coeff zeroName = 0) + (hadd : ∀ a b, coeff (addName a b) = coeff a + coeff b) : + ComputablePred (fun p : Name A X × Name A X => value coeff index p.1 = value coeff index p.2) := by + have hf : PrimrecPred (fun l : List Bool => ∀ b ∈ l, b = true) := + (show PrimrecPred (fun b : Bool => b = true) from + Primrec.eq.comp Primrec.id (Primrec.const true)).forall_mem_list + have ht := (hf.decide.to_comp.comp + (computable_entry_tests coeff index zeroName addName ha hx hc)).computablePred + apply ht.of_eq + intro p + rw [value_eq_iff] + simp only [List.mem_map, forall_exists_index, and_imp, + forall_apply_eq_imp_iff₂, decide_eq_true_eq, entry_correct coeff index zeroName addName hzero hadd] + +end +end SimpleFInftyOvergroups.EffectiveNames.Array + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleOvergroups/ArrayOperations.lean b/lean/OAI/GroupTheory/SimpleOvergroups/ArrayOperations.lean new file mode 100644 index 0000000000000000000000000000000000000000..bd5c0494feeeb66ac049dc3234b93058f058519c --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleOvergroups/ArrayOperations.lean @@ -0,0 +1,94 @@ +import Mathlib +import OAI.GroupTheory.SimpleOvergroups.ArrayNames +import OAI.GroupTheory.SimpleOvergroups.EnlargementCore + +namespace OAI + +namespace SimpleFInftyOvergroups.EffectiveNames.Array +noncomputable section +open scoped Classical +variable {A G X D V Y : Type*} + +def product (cmul : A → A → A) (op : G → X → X) (p : Name A G) (q : Name A X) : Name A X := + p.flatMap fun a => q.map fun b => (cmul a.1 b.1,op a.2 b.2) + +@[simp] theorem product_nil (cmul : A → A → A) (op : G → X → X) (q : Name A X) : + product cmul op [] q = [] := rfl +@[simp] theorem product_cons (cmul : A → A → A) (op : G → X → X) + (a : A × G) (p : Name A G) (q : Name A X) : + product cmul op (a::p) q = (q.map fun b => (cmul a.1 b.1,op a.2 b.2)) ++ product cmul op p q := rfl + + theorem product_bound (cmul : A → A → A) (op : G → X → X) + (gc : G → ℕ) (xc : X → ℕ) (hop : ∀ g x, xc (op g x) = gc g + xc x) + {p : Name A G} {q : Name A X} {b c : ℕ} + (hp : ∀ a ∈ p, gc a.2 ≤ b) (hq : ∀ a ∈ q, xc a.2 ≤ c) : + ∀ a ∈ product cmul op p q, xc a.2 ≤ b+c := by + intro a ha + obtain ⟨u,hu,hv⟩ := List.mem_flatMap.mp ha + obtain ⟨w,hw,rfl⟩ := List.mem_map.mp hv + simpa only [hop] using Nat.add_le_add (hp u hu) (hq w hw) + +variable [Ring D] [Group V] +variable (coeff : A → D) (group : G → V) + +def algebraValue (p : Name A G) : MonoidAlgebra D V := MonoidAlgebra.ofCoeff (value coeff group p) + +@[simp] theorem algebraValue_nil : algebraValue coeff group [] = 0 := rfl +@[simp] theorem algebraValue_cons (a : A × G) (p : Name A G) : + algebraValue coeff group (a::p) = MonoidAlgebra.single (group a.2) (coeff a.1) + algebraValue coeff group p := rfl +@[simp] theorem algebraValue_append (p q : Name A G) : + algebraValue coeff group (p++q) = algebraValue coeff group p + algebraValue coeff group q := by + simp only [algebraValue,value_append,MonoidAlgebra.ofCoeff_add] + + theorem algebraValue_product (cmul : A → A → A) (mul : G → G → G) + (hc : ∀ a b, coeff (cmul a b) = coeff a * coeff b) + (hg : ∀ g h, group (mul g h) = group g * group h) (p q : Name A G) : + algebraValue coeff group (product cmul mul p q) = algebraValue coeff group p * algebraValue coeff group q := by + induction p with + | nil => simp + | cons a p ih => + rw [product_cons,algebraValue_append,ih,algebraValue_cons,add_mul] + congr 1 + clear ih + induction q with + | nil => simp + | cons b q ih => + simp only [List.map_cons,algebraValue_cons,ih,hc,hg,mul_add,MonoidAlgebra.single_mul_single] + +variable [MulAction V Y] (point : X → Y) + + theorem value_action (cmul : A → A → A) (act : G → X → X) + (hc : ∀ a b, coeff (cmul a b) = coeff a * coeff b) + (ha : ∀ g x, point (act g x) = group g • point x) (p : Name A G) (q : Name A X) : + value coeff point (product cmul act p q) = + SourceEnlargement.ringAction (algebraValue coeff group p) (value coeff point q) := by + induction p with + | nil => simp + | cons a p ih => + rw [product_cons,value_append,ih,algebraValue_cons,map_add] + change _ = SourceEnlargement.ringAction (MonoidAlgebra.single (group a.2) (coeff a.1)) + (value coeff point q) + SourceEnlargement.ringAction (algebraValue coeff group p) (value coeff point q) + congr 1 + clear ih + induction q with + | nil => simp + | cons b q ih => + simp only [List.map_cons,value_cons,ih,hc,ha,map_add,SourceEnlargement.ringAction_single] + +variable [Primcodable A] [Primcodable G] [Primcodable X] + theorem primrec_product {cmul : A → A → A} {op : G → X → X} + (hc : Primrec₂ cmul) (ho : Primrec₂ op) : Primrec₂ (product cmul op) := by + unfold product + apply Primrec.list_flatMap Primrec.fst + change Primrec (fun p : (Name A G × Name A X) × (A × G) => + p.1.2.map fun b => (cmul p.2.1 b.1,op p.2.2 b.2)) + apply Primrec.list_map (Primrec.snd.comp Primrec.fst) + exact ((hc.comp (Primrec.fst.comp (Primrec.snd.comp Primrec.fst)) + (Primrec.fst.comp Primrec.snd)).pair + (ho.comp (Primrec.snd.comp (Primrec.snd.comp Primrec.fst)) + (Primrec.snd.comp Primrec.snd))).to₂ + +end +end SimpleFInftyOvergroups.EffectiveNames.Array + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleOvergroups/BoundedContexts.lean b/lean/OAI/GroupTheory/SimpleOvergroups/BoundedContexts.lean new file mode 100644 index 0000000000000000000000000000000000000000..1c8a4150dadb4a8479ee87f9f8802f0686467eb5 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleOvergroups/BoundedContexts.lean @@ -0,0 +1,219 @@ +import Mathlib +import OAI.GroupTheory.FiniteType.ProductGroupHomology +import OAI.GroupTheory.SimpleOvergroups.BoundedForms + +namespace OAI + + +namespace SimpleFInftyOvergroups.BoundedEncoding.ActionCalculus +variable {V X K L : Type*} [Group V] [MulAction V X] {m : ℕ} + (C : ActionCalculus V X K L m) [DecidableEq L] + +def display : C.Form → List C.Letter + | none => [.zero] + | some (l,g,r) => l.map .pre ++ .grp g :: r.reverse.map .del + +omit [DecidableEq L] in +@[simp] theorem wordCost_pres [DecidableEq L] (l : List C.XLabel) : + C.wordCost (l.map .pre) = (l.map WithBound.cost).sum := by + simp [wordCost,Function.comp_def,Letter.cost] + +omit [DecidableEq L] in +@[simp] theorem wordCost_dels [DecidableEq L] (l : List C.XLabel) : + C.wordCost (l.map .del) = (l.map WithBound.cost).sum := by + simp [wordCost,Function.comp_def,Letter.cost] + +omit [DecidableEq L] in +@[simp] theorem wordCost_reverse [DecidableEq L] (w : List C.Letter) : + C.wordCost w.reverse = C.wordCost w := by simp [wordCost] + +@[simp] theorem display_cost (f : C.Form) : C.wordCost (C.display f) = f.cost C := by + cases f with + | none => rfl + | some p => rcases p with ⟨l,g,r⟩; simp [display,Form.cost,Letter.cost,Nat.add_assoc] + +omit [DecidableEq L] in +theorem display_congr [DecidableEq L] {f f' : C.Form} (hf : f.key C = f'.key C) : + (C.display f).map (Letter.key C) = (C.display f').map (Letter.key C) := by + cases f with + | none => + cases f' with + | none => rfl + | some p => simp [Form.key] at hf + | some p => + cases f' with + | none => simp [Form.key] at hf + | some p' => + rcases p with ⟨l,g,r⟩ + rcases p' with ⟨l',g',r'⟩ + simp only [Form.key,Option.map_some,Option.some.injEq,Prod.mk.injEq] at hf + have hp : (l.map (.pre : C.XLabel → C.Letter)).map (Letter.key C) = + (l'.map .pre).map (Letter.key C) := by + simpa only [List.map_map,Function.comp_def,Letter.key] using + congrArg (List.map (fun x : L => Sum.inr (Sum.inl x) : L → Sum K (Sum L (Option L)))) hf.1 + have hd : (r.reverse.map (.del : C.XLabel → C.Letter)).map (Letter.key C) = + (r'.reverse.map .del).map (Letter.key C) := by + have he := congrArg (fun xs : List L => xs.reverse.map + (fun x => Sum.inr (Sum.inr (some x)) : L → Sum K (Sum L (Option L)))) hf.2.2 + simpa only [List.map_reverse,List.map_map,Function.comp_def,Letter.key] using he + simp only [display,List.map_append,List.map_cons,Letter.key,hp,hf.2.1,hd] + +@[simp] theorem step_zero (f : C.Form) : C.step .zero f = none := by cases f <;> rfl + +theorem step_identity (f : C.Form) : + (C.step (.grp C.identity) f).key C = f.key C := by + cases f with + | none => rfl + | some p => + rcases p with ⟨l,g,r⟩ + cases l <;> simp [step,Form.key,identity,multiply,act,WithBound.key] + +theorem step_multiply (g h : C.GLabel) (f : C.Form) : + (C.step (.grp g) (C.step (.grp h) f)).key C = + (C.step (.grp (C.multiply g h)) f).key C := by + cases f with + | none => rfl + | some p => + rcases p with ⟨l,q,r⟩ + cases l <;> simp [step,Form.key,multiply,act,WithBound.key,mul_assoc,mul_smul] + +theorem step_group_pre (g : C.GLabel) (x : C.XLabel) (f : C.Form) : + C.step (.grp g) (C.step (.pre x) f) = C.step (.pre (C.act g x)) f := by + cases f with + | none => rfl + | some p => rcases p with ⟨l,q,r⟩; rfl + +theorem step_delete_pre (y x : C.XLabel) (f : C.Form) : + C.step (.del y) (C.step (.pre x) f) = if y.key = x.key then f else none := by + cases f with + | none => simp + | some p => rcases p with ⟨l,q,r⟩; rfl + +theorem step_delete_group (y : C.XLabel) (g : C.GLabel) (f : C.Form) + {d : ℕ} (hb : y.cost + g.cost + f.cost C ≤ d) (hm : 3*d ≤ m) : + (C.step (.del y) (C.step (.grp g) f)).key C = + (C.step (.del (C.act (C.inverse g) y)) f).key C := by + cases f with + | none => rfl + | some p => + rcases p with ⟨l,q,r⟩ + cases l with + | nil => simp [step,Form.key,multiply,inverse,act,WithBound.key,mul_smul] + | cons x l => + have he : y.key = (C.act g x).key ↔ (C.act (C.inverse g) y).key = x.key := + C.inverse_action_iff_of_total g.mem y.mem x.mem + (by simp only [Form.cost,List.map_cons,List.sum_cons] at hb; omega) hm + simp only [step,he] + +theorem display_step (a : C.Letter) (f t : C.Form) {d : ℕ} + (hb : a.cost C + f.cost C + t.cost C ≤ d) (hm : 3*d ≤ m) : + (C.run (C.display (C.step a f)) t).key C = + (C.step a (C.run (C.display f) t)).key C := by + cases f with + | none => simp [display] + | some p => + rcases p with ⟨l,g,r⟩ + cases a with + | zero => simp [display] + | pre x => simp only [step,display,List.map_cons,List.cons_append,run_cons] + | grp h => + cases l with + | nil => + simp only [step,display,List.map_nil,List.nil_append,run_cons] + exact (C.step_multiply h g _).symm + | cons x l => + simp only [step,display,List.map_cons,List.cons_append,run_cons] + exact congrArg (Form.key C) (C.step_group_pre h x _).symm + | del y => + cases l with + | nil => + simp only [step,display,List.map_nil,List.nil_append,List.reverse_append, + List.reverse_singleton,List.map_cons,List.map_nil, + List.singleton_append,run_cons] + apply (C.step_identity (C.step (.del (C.act (C.inverse g) y)) + (C.run (r.reverse.map .del) t))).trans + symm + apply C.step_delete_group y g _ (hm := hm) + have hc := C.run_cost (r.reverse.map Letter.del) t + have hr : C.wordCost (r.reverse.map Letter.del) = (r.map WithBound.cost).sum := by + rw [wordCost_dels,List.map_reverse,List.sum_reverse] + rw [hr] at hc + change y.cost + (0+g.cost+(r.map WithBound.cost).sum) + t.cost C ≤ d at hb + omega + | cons x l => + simp only [step] + by_cases h : y.key = x.key + · rw [ite_eq_left h] + simp only [display,List.map_cons,List.cons_append,run_cons] + exact congrArg (Form.key C) ((C.step_delete_pre y x _).trans (ite_eq_left h)).symm + · rw [ite_eq_right h] + simp only [display,List.map_cons,List.cons_append,run_cons,run_nil,step_zero] + exact congrArg (Form.key C) ((C.step_delete_pre y x _).trans (ite_eq_right h)).symm + +theorem run_display_normalize (w : List C.Letter) (t : C.Form) {d : ℕ} + (hb : C.wordCost w + t.cost C ≤ d) (hm : 3*d ≤ m) : + (C.run w t).key C = (C.run (C.display (C.normalize w)) t).key C := by + induction w with + | nil => + simpa only [normalize,run_nil,display,List.map_nil,List.reverse_nil,List.nil_append, + run_cons] using (C.step_identity t).symm + | cons a w ih => + have hc := C.normalize_cost w + have ht : C.wordCost w + t.cost C ≤ d := by simp only [wordCost_cons] at hb; omega + have he := C.step_congr (a := a) rfl (ih ht) + (hb := by have := C.run_cost w t; simp only [wordCost_cons] at hb; omega) + (hb' := by + have hh := C.run_cost (C.display (C.normalize w)) t + rw [display_cost] at hh + simp only [wordCost_cons] at hb + omega) + rw [run_cons] + exact he.trans (C.display_step a (C.normalize w) t + (by simp only [wordCost_cons] at hb; omega) hm).symm + +theorem normalize_right_context {u v b : List C.Letter} {d : ℕ} + (he : (C.normalize u).key C = (C.normalize v).key C) + (hu : C.wordCost (u++b) ≤ d) (hv : C.wordCost (v++b) ≤ d) (hm : 3*d ≤ m) : + (C.normalize (u++b)).key C = (C.normalize (v++b)).key C := by + have hb := C.normalize_cost b + have huc := C.normalize_cost u + have hvc := C.normalize_cost v + simp only [wordCost_append] at hu hv + change (C.run (u++b) _).key C = (C.run (v++b) _).key C + rw [run_append,run_append] + change (C.run u (C.normalize b)).key C = (C.run v (C.normalize b)).key C + rw [C.run_display_normalize u (C.normalize b) (by omega) hm, + C.run_display_normalize v (C.normalize b) (by omega) hm] + apply C.run_congr (C.display_congr he) rfl + · rw [display_cost]; omega + · rw [display_cost]; omega + +theorem normalize_context {u v a b : List C.Letter} {d : ℕ} + (he : (C.normalize u).key C = (C.normalize v).key C) + (hu : C.wordCost (a++u++b) ≤ d) (hv : C.wordCost (a++v++b) ≤ d) (hm : 3*d ≤ m) : + (C.normalize (a++u++b)).key C = (C.normalize (a++v++b)).key C := by + simp only [wordCost_append] at hu hv + rw [List.append_assoc,List.append_assoc] + apply C.normalize_left_context (C.normalize_right_context he + (by simp only [wordCost_append]; omega) (by simp only [wordCost_append]; omega) hm) + · simp only [wordCost_append]; omega + · simp only [wordCost_append]; omega + +theorem normalize_zero_context {u a b : List C.Letter} {d : ℕ} + (he : (C.normalize u).key C = none) + (hu : C.wordCost (a++u++b) ≤ d) (hm : 3*d ≤ m) : + (C.normalize (a++u++b)).key C = none := by + have hz : (C.normalize [.zero]).key C = none := rfl + have hh := C.normalize_context (he.trans hz.symm) hu + (show C.wordCost (a++[.zero]++b) ≤ d from by + simp only [wordCost_append,wordCost_cons,wordCost_nil,Letter.cost] at hu ⊢ + omega) hm + simpa only [normalize,run_append,run_cons,step_zero,run_none,Form.key, + Option.map_none] using hh + +theorem normalize_nil_ne_zero : (C.normalize []).key C ≠ none := by + simp only [normalize,run_nil,Form.key,Option.map_some,ne_eq,reduceCtorEq,not_false_eq_true] + +end SimpleFInftyOvergroups.BoundedEncoding.ActionCalculus + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleOvergroups/BoundedFamilyTests.lean b/lean/OAI/GroupTheory/SimpleOvergroups/BoundedFamilyTests.lean new file mode 100644 index 0000000000000000000000000000000000000000..96aa4f64f3866d0d18f9af24cfc38517b6c16ec4 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleOvergroups/BoundedFamilyTests.lean @@ -0,0 +1,118 @@ +import Mathlib +import OAI.GroupTheory.SimpleOvergroups.FirstFamilies +import OAI.GroupTheory.SimpleOvergroups.NamedActions +import OAI.GroupTheory.SimpleOvergroups.ThreeCodes + +namespace OAI + + +namespace SimpleFInftyOvergroups.ContextualEncoding +open FiniteAlgebraicEnvelopes Bootstrap BoundedEncoding +noncomputable section +open scoped Classical + +structure TestCertificate {A S Q : Type*} + (C : DelimiterCode A S) (f : List A → Part (Option Q)) (n : ℕ) : Prop where + total : ∀ w, (C.encode w).length ≤ n → (f w).Dom + nonzero : Search.value f [] ≠ none + contextual : CodeTable.Contextual C (Search.value f) n + ideal : CodeTable.ZeroIdeal C (Search.value f) n + +namespace TestCertificate +variable {A S Q : Type*} [DecidableEq A] [DecidableEq Q] + (C : DelimiterCode A S) (f : List A → Part (Option Q)) {n : ℕ} + +omit [DecidableEq A] [DecidableEq Q] in +theorem of_value (q : List A → Option Q) + (hf : ∀ w, (C.encode w).length ≤ n → q w ∈ f w) + (h0 : q [] ≠ none) (hc : CodeTable.Contextual C q n) (hz : CodeTable.ZeroIdeal C q n) : + TestCertificate C f n := by + have he (w : List A) (hw : (C.encode w).length ≤ n) : Search.value f w = q w := + Part.mem_unique (Search.value_mem (hf w hw).1) (hf w hw) + refine ⟨fun w hw => (hf w hw).1, ?_, ?_, ?_⟩ + · rw [he [] (Nat.zero_le _)] + exact h0 + · intro a b u v hu hv h + have hlu : (C.encode u).length ≤ n := by + simp only [DelimiterCode.encode_append,List.length_append] at hu + omega + have hlv : (C.encode v).length ≤ n := by + simp only [DelimiterCode.encode_append,List.length_append] at hv + omega + rw [he u hlu,he v hlv] at h + rw [he _ hu,he _ hv] + exact hc a b u v hu hv h + · intro a b u hu h + have hlu : (C.encode u).length ≤ n := by + simp only [DelimiterCode.encode_append,List.length_append] at hu + omega + rw [he u hlu] at h + rw [he _ hu] + exact hz a b u hu h +end TestCertificate + +namespace GroupFamily +variable {G : Type*} [Group G] {k : ℕ} (s : Fin k → G) +theorem certificate (C : DelimiterCode (Fin k × Bool) ThreeCodes.Alphabet) (n : ℕ) : + TestCertificate C (test s) n := by + apply TestCertificate.of_value C (test s) (fun w => some (WordProblem.testedClass s w)) + · intro w hw; exact Part.mem_some _ + · exact Option.some_ne_none _ + · intro a b u v hu hv h + exact congrArg some (context s (Option.some.inj h) a b) + · intro a b u hu h + cases h +end GroupFamily + +namespace ProductFamily +variable {A : Type*} [DecidableEq A] {m n : ℕ} (C : WordCalculus (FreeMonoid A) m) + (code : DelimiterCode (Letter A) ThreeCodes.Alphabet) + (cost : A → ℕ) (hc : ∀ w, grade C w = wordCost cost w) + (hp : ∀ a, 10 * ProductFamily.cost cost a + 2 ≤ (code.block a).length) + (hm : n / 10 ≤ m) {f : List A → Part (List A)} + (hf : ∀ u, C.grade (FreeMonoid.ofList u) ≤ n / 10 → + (C.normal (FreeMonoid.ofList u)).toList ∈ f u) + +include hc hp hm hf +theorem certificate : TestCertificate code (test C.omega.toList f) n := by + have hb (w : List (Letter A)) (hw : (code.encode w).length ≤ n) : grade C w ≤ n / 10 := by + rw [hc] + exact code.cost_le_quota _ hp hw + apply TestCertificate.of_value code (test C.omega.toList f) (value C) + · intro w hw + exact test_full C w (hb w hw) hf + · exact value_nil C + · intro a b u v hu hv h + exact value_context C h a b ((hb _ hu).trans hm) ((hb _ hv).trans hm) + · intro a b u hu h + exact value_zero_context C h a b ((hb _ hu).trans hm) +end ProductFamily + +namespace ActionFamily +open NamedAction +variable {G X V Y K L : Type*} [Group V] [MulAction V Y] + [DecidableEq G] [DecidableEq X] [DecidableEq K] [DecidableEq L] + {N : Operations G X} {m n : ℕ} {C : ActionCalculus V Y K L m} + (I : Interpretation N C) (code : DelimiterCode (Letter G X) ThreeCodes.Alphabet) + (hp : ∀ a, 10 * N.letterCost a + 2 ≤ (code.block a).length) (hm : 3 * (n / 10) ≤ m) + (f : List (Letter G X) → Part (Result K L)) + (hf : ∀ w, N.wordCost w ≤ n / 10 → N.totalTest I.gkey I.xkey w ∈ f w) + +include I hp hm hf +omit [DecidableEq G] [DecidableEq X] [DecidableEq K] in +theorem certificate : TestCertificate code f n := by + have hb (w : List (Letter G X)) (hw : (code.encode w).length ≤ n) : N.wordCost w ≤ n / 10 := + code.cost_le_quota _ hp hw + apply TestCertificate.of_value code f (N.totalTest I.gkey I.xkey) + · intro w hw + exact hf w (hb w hw) + · exact I.totalTest_nil + · intro a b u v hu hv h + exact I.totalTest_context h (hb _ hu) (hb _ hv) hm + · intro a b u hu h + exact I.totalTest_zero_context h (hb _ hu) hm +end ActionFamily +end +end SimpleFInftyOvergroups.ContextualEncoding + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleOvergroups/BoundedForms.lean b/lean/OAI/GroupTheory/SimpleOvergroups/BoundedForms.lean new file mode 100644 index 0000000000000000000000000000000000000000..d2764189e548e8b144dd257fa64ee2aa9ca352e2 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleOvergroups/BoundedForms.lean @@ -0,0 +1,225 @@ +import Mathlib +import OAI.GroupTheory.SimpleOvergroups.TruncatedAction + +namespace OAI + + +namespace SimpleFInftyOvergroups.BoundedEncoding + +structure WithBound {A K : Type*} (B : KeyBall A K) where + val : A + cost : ℕ + mem : val ∈ B.ball cost + +namespace WithBound +variable {A K : Type*} {B : KeyBall A K} +def key (a : WithBound B) : K := B.key a.val +end WithBound + +namespace ActionCalculus +variable {V X K L : Type*} [Group V] [MulAction V X] {m : ℕ} + (C : ActionCalculus V X K L m) + +abbrev GLabel := WithBound C.group +abbrev XLabel := WithBound C.point + +def identity : C.GLabel := ⟨1,0,C.one_mem 0⟩ +def multiply (g h : C.GLabel) : C.GLabel := + ⟨g.val*h.val, g.cost+h.cost, C.mul_mem g.mem h.mem⟩ +def inverse (g : C.GLabel) : C.GLabel := ⟨g.val⁻¹,g.cost,C.inv_mem g.mem⟩ +def act (g : C.GLabel) (x : C.XLabel) : C.XLabel := + ⟨g.val • x.val,g.cost+x.cost,C.smul_mem g.mem x.mem⟩ + +inductive Letter where + | grp : C.GLabel → Letter + | pre : C.XLabel → Letter + | del : C.XLabel → Letter + | zero : Letter + +namespace Letter +def cost : C.Letter → ℕ + | .grp g => g.cost + | .pre x | .del x => x.cost + | .zero => 0 + +def key : C.Letter → Sum K (Sum L (Option L)) + | .grp g => .inl g.key + | .pre x => .inr (.inl x.key) + | .del x => .inr (.inr (some x.key)) + | .zero => .inr (.inr none) +end Letter + +abbrev Form := Option (List C.XLabel × C.GLabel × List C.XLabel) + +namespace Form +def cost : C.Form → ℕ + | none => 0 + | some (l,g,r) => (l.map WithBound.cost).sum + g.cost + (r.map WithBound.cost).sum + +def key : C.Form → Option (List L × K × List L) := + Option.map (fun p => (p.1.map WithBound.key, p.2.1.key, p.2.2.map WithBound.key)) +end Form + +def wordCost (w : List C.Letter) : ℕ := (w.map (Letter.cost C)).sum + +@[simp] theorem wordCost_nil : C.wordCost [] = 0 := rfl +@[simp] theorem wordCost_cons (a : C.Letter) (w : List C.Letter) : + C.wordCost (a::w) = a.cost C + C.wordCost w := rfl +@[simp] theorem wordCost_append (a b : List C.Letter) : + C.wordCost (a++b) = C.wordCost a + C.wordCost b := by simp [wordCost] + +variable [DecidableEq L] + +def step : C.Letter → C.Form → C.Form + | _, none => none + | .zero, _ => none + | .pre x, some (l,g,r) => some (x::l,g,r) + | .grp h, some ([],g,r) => some ([],C.multiply h g,r) + | .grp h, some (x::l,g,r) => some (C.act h x::l,g,r) + | .del y, some ([],g,r) => some ([],C.identity,r++[C.act (C.inverse g) y]) + | .del y, some (x::l,g,r) => if y.key = x.key then some (l,g,r) else none + +def run (w : List C.Letter) (f : C.Form) : C.Form := + w.foldr (C.step) f + +def normalize (w : List C.Letter) : C.Form := C.run w (some ([],C.identity,[])) + +@[simp] theorem run_nil (f : C.Form) : C.run [] f = f := rfl +@[simp] theorem run_cons (a : C.Letter) (w : List C.Letter) (f : C.Form) : + C.run (a::w) f = C.step a (C.run w f) := rfl +@[simp] theorem run_append (a b : List C.Letter) (f : C.Form) : + C.run (a++b) f = C.run a (C.run b f) := by simp [run] + +@[simp] theorem step_none (a : C.Letter) : C.step a none = none := by cases a <;> rfl +@[simp] theorem run_none (w : List C.Letter) : C.run w none = none := by + induction w with + | nil => rfl + | cons a w ih => simp [ih] + +theorem step_cost (a : C.Letter) (f : C.Form) : + (C.step a f).cost C ≤ a.cost C + f.cost C := by + cases f with + | none => simp [Form.cost] + | some p => + rcases p with ⟨l,g,r⟩ + cases a with + | zero => simp [step,Form.cost] + | pre x => simp [step,Form.cost,Letter.cost]; omega + | grp h => + cases l <;> simp [step,Form.cost,Letter.cost,multiply,act] <;> omega + | del y => + cases l with + | nil => simp [step,Form.cost,Letter.cost,act,inverse,identity]; omega + | cons x l => + by_cases h : y.key = x.key <;> simp [step,h,Form.cost,Letter.cost]; omega + +theorem run_cost (w : List C.Letter) (f : C.Form) : + (C.run w f).cost C ≤ C.wordCost w + f.cost C := by + induction w with + | nil => simp + | cons a w ih => + rw [run_cons] + exact (C.step_cost a (C.run w f)).trans (by simp only [wordCost_cons]; omega) + +theorem normalize_cost (w : List C.Letter) : + (C.normalize w).cost C ≤ C.wordCost w := by + simpa [normalize, Form.cost, identity] using C.run_cost w (some ([],C.identity,[])) + +theorem step_congr {a a' : C.Letter} {f f' : C.Form} + (ha : a.key C = a'.key C) (hf : f.key C = f'.key C) + (hb : a.cost C + f.cost C ≤ m) (hb' : a'.cost C + f'.cost C ≤ m) : + (C.step a f).key C = (C.step a' f').key C := by + cases f with + | none => + cases f' with + | none => simp + | some p => simp [Form.key] at hf + | some p => + cases f' with + | none => simp [Form.key] at hf + | some p' => + rcases p with ⟨l,g,r⟩ + rcases p' with ⟨l',g',r'⟩ + simp only [Form.key, Option.map_some, Option.some.injEq, Prod.mk.injEq] at hf + obtain ⟨hl,hg,hr⟩ := hf + cases a <;> cases a' <;> simp only [Letter.key, Sum.inl.injEq, Sum.inr.injEq, + Option.some.injEq, reduceCtorEq] at ha + case pre.pre x x' => simp [step,Form.key,ha,hl,hg,hr] + case zero.zero => rfl + case grp.grp h h' => + cases l with + | nil => + have he : l' = [] := by simpa using hl.symm + subst l' + have he := C.mul_congr h.mem g.mem h'.mem g'.mem + (by simp only [Letter.cost,Form.cost,List.map_nil,List.sum_nil,zero_add] at hb; omega) + (by simp only [Letter.cost,Form.cost,List.map_nil,List.sum_nil,zero_add] at hb'; omega) ha hg + simp [step,Form.key,multiply,WithBound.key, he,hr] + | cons x l => + cases l' with + | nil => simp at hl + | cons x' l' => + simp only [List.map_cons, List.cons.injEq] at hl + have he := C.smul_congr h.mem x.mem h'.mem x'.mem + (by simp only [Letter.cost,Form.cost,List.map_cons,List.sum_cons] at hb; omega) + (by simp only [Letter.cost,Form.cost,List.map_cons,List.sum_cons] at hb'; omega) + ha hl.1 + change (C.act h x).key = (C.act h' x').key at he + simp only [step,Form.key,Option.map_some,List.map_cons,he,hl.2,hg,hr] + case del.del y y' => + cases l with + | nil => + have he : l' = [] := by simpa using hl.symm + subst l' + have he := C.smul_congr (C.inv_mem g.mem) y.mem (C.inv_mem g'.mem) y'.mem + (by simp only [Letter.cost,Form.cost,List.map_nil,List.sum_nil,zero_add] at hb; omega) + (by simp only [Letter.cost,Form.cost,List.map_nil,List.sum_nil,zero_add] at hb'; omega) + (C.inv_congr hg) ha + simp [step,Form.key,act,inverse,WithBound.key,he,hr] + | cons x l => + cases l' with + | nil => simp at hl + | cons x' l' => + simp only [List.map_cons,List.cons.injEq] at hl + simp only [step,ha,hl.1] + split <;> simp [Form.key,hl.2,hg,hr] + +theorem run_congr {w w' : List C.Letter} {f f' : C.Form} + (hw : w.map (Letter.key C) = w'.map (Letter.key C)) + (hf : f.key C = f'.key C) + (hb : C.wordCost w + f.cost C ≤ m) (hb' : C.wordCost w' + f'.cost C ≤ m) : + (C.run w f).key C = (C.run w' f').key C := by + induction w generalizing w' with + | nil => + have he : w' = [] := by simpa using hw.symm + subst w' + exact hf + | cons a w ih => + cases w' with + | nil => simp at hw + | cons a' w' => + simp only [List.map_cons,List.cons.injEq] at hw + have ht : C.wordCost w + f.cost C ≤ m := by simp only [wordCost_cons] at hb; omega + have ht' : C.wordCost w' + f'.cost C ≤ m := by simp only [wordCost_cons] at hb'; omega + rw [run_cons,run_cons] + exact C.step_congr hw.1 (ih hw.2 ht ht') + (by have := C.run_cost w f; simp only [wordCost_cons] at hb; omega) + (by have := C.run_cost w' f'; simp only [wordCost_cons] at hb'; omega) + +theorem normalize_left_context {u v a : List C.Letter} + (he : (C.normalize u).key C = (C.normalize v).key C) + (hu : C.wordCost (a++u) ≤ m) (hv : C.wordCost (a++v) ≤ m) : + (C.normalize (a++u)).key C = (C.normalize (a++v)).key C := by + simp only [normalize,run_append] + apply C.run_congr rfl he + · have := C.normalize_cost u + simp only [wordCost_append] at hu + omega + · have := C.normalize_cost v + simp only [wordCost_append] at hv + omega + +end ActionCalculus +end SimpleFInftyOvergroups.BoundedEncoding + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleOvergroups/CanonicalNames.lean b/lean/OAI/GroupTheory/SimpleOvergroups/CanonicalNames.lean new file mode 100644 index 0000000000000000000000000000000000000000..e43bc94e05c0d07e90ead7e18fa3406658a9f8cb --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleOvergroups/CanonicalNames.lean @@ -0,0 +1,83 @@ +import Mathlib + +namespace OAI + +namespace SimpleFInftyOvergroups.EffectiveNames +noncomputable section +open scoped Classical +variable {A Q : Type*} [Primcodable A] (q : A → Q) + +def acceptsName (a : A) (n : ℕ) : Bool := + (Encodable.decode (α := A) n).elim false (fun b => decide (q b = q a)) + +theorem acceptsName_iff (a : A) (n : ℕ) : + acceptsName q a n = true ↔ ∃ b, Encodable.decode (α := A) n = some b ∧ q b = q a := by + unfold acceptsName + cases h : Encodable.decode (α := A) n <;> simp + +theorem match_exists (a : A) : ∃ n, acceptsName q a n = true := + ⟨Encodable.encode a, (acceptsName_iff q a _).mpr ⟨a, Encodable.encodek a, rfl⟩⟩ + +def key (a : A) : ℕ := Nat.find (match_exists q a) + +theorem key_spec (a : A) : + ∃ b, Encodable.decode (α := A) (key q a) = some b ∧ q b = q a := + (acceptsName_iff q a _).mp (Nat.find_spec (match_exists q a)) + +theorem key_congr {a b : A} (h : q a = q b) : key q a = key q b := by + apply Nat.le_antisymm + · apply Nat.find_min' + obtain ⟨c,hc,he⟩ := key_spec q b + exact (acceptsName_iff q a _).mpr ⟨c,hc,he.trans h.symm⟩ + · apply Nat.find_min' + obtain ⟨c,hc,he⟩ := key_spec q a + exact (acceptsName_iff q b _).mpr ⟨c,hc,he.trans h⟩ + +theorem key_eq_iff (a b : A) : key q a = key q b ↔ q a = q b := by + constructor + · intro h + obtain ⟨x,hx,he⟩ := key_spec q a + obtain ⟨y,hy,hf⟩ := key_spec q b + rw [h] at hx + have hxy : x=y := Option.some.inj (hx.symm.trans hy) + exact he.symm.trans (hxy ▸ hf) + · exact key_congr q + +def semanticKey (hq : Function.Surjective q) (x : Q) : ℕ := + key q (Classical.choose (hq x)) + +@[simp] theorem semanticKey_value (hq : Function.Surjective q) (a : A) : + semanticKey q hq (q a) = key q a := + key_congr q (Classical.choose_spec (hq (q a))) + +theorem semanticKey_injective (hq : Function.Surjective q) : + Function.Injective (semanticKey q hq) := by + intro x y h + obtain ⟨a,rfl⟩ := hq x + obtain ⟨b,rfl⟩ := hq y + simpa only [semanticKey_value, key_eq_iff] using h + +variable (heq : ComputablePred (fun p : A × A => q p.1 = q p.2)) + +include heq in +theorem computable_acceptsName : Computable₂ (acceptsName q) := by + change Computable (fun p : A × ℕ => + (Encodable.decode (α := A) p.2).elim false (fun b => decide (q b = q p.1))) + apply (Computable.option_casesOn (Computable.decode.comp Computable.snd) + (Computable.const false) (heq.decide.comp + (Computable.snd.pair (Computable.fst.comp Computable.fst))).to₂).of_eq + intro p + cases Encodable.decode (α := A) p.2 <;> rfl + +include heq in +theorem computable_key : Computable (key q) := by + have hb : Computable₂ (fun (a b : Bool) => decide (a=b)) := Primrec.eq.decide.to_comp + have hc : Computable (fun p : A × ℕ => decide (acceptsName q p.1 p.2 = true)) := + hb.comp (computable_acceptsName q heq) (Computable.const true) + exact Computable.find (P := fun a n => acceptsName q a n = true) + hc.computablePred (match_exists q) + +end +end SimpleFInftyOvergroups.EffectiveNames + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleOvergroups/CodeEmbedding.lean b/lean/OAI/GroupTheory/SimpleOvergroups/CodeEmbedding.lean new file mode 100644 index 0000000000000000000000000000000000000000..73535cf390b3661fe4d31e530182516ec114a819 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleOvergroups/CodeEmbedding.lean @@ -0,0 +1,195 @@ +import Mathlib +import OAI.GroupTheory.FiniteType.HomotopyFunctor +import OAI.GroupTheory.SimpleOvergroups.FamilyTables + +namespace OAI + + +namespace SimpleFInftyOvergroups.ContextualEncoding +open FiniteAlgebraicEnvelopes.Bootstrap Relation + +namespace CodeTable +variable {A S Q : Type*} {r : S → S → Prop} [Std.Trichotomous r] +variable (C : DelimiterCode A S) (E : FiniteSearch C) (wf : WellFounded r) + (q : List A → Option Q) (z : S) + + theorem table_short {n : ℕ} {p : List S × List S} (hp : p ∈ table C E wf q z n) : + 1 < p.1.length := by + obtain ⟨w,_,hn,_,he,_⟩ := (mem_table C E wf q z).mp hp + rw [he] + have := C.length_le_encode w + have := List.length_pos_iff.mpr hn + omega + + theorem canonical_no_infix (hc : ∀ n, Contextual C q n) (hi : ∀ n, ZeroIdeal C q n) + {w : List A} (hw : q w ≠ none) {n : ℕ} {u v : List S} + (hp : (u,v) ∈ table C E wf q z n) : + ¬ u <:+: C.encode (EncodedCanonical.least C wf q w) := by + obtain ⟨c,_,hcn,hn,rfl,rfl⟩ := (mem_table C E wf q z).mp hp + rintro ⟨x,y,he⟩ + obtain ⟨a,b,hab,hx,hy⟩ := C.occurrence_decode hcn he.symm + have hq : q (a++c++b) = q w := hab ▸ EncodedCanonical.least_class C wf q w + by_cases hz : q c = none + · exact hw (hq.symm.trans (hi _ a b c le_rfl hz)) + · have hlt : List.Shortlex r (C.encode (EncodedCanonical.least C wf q c)) (C.encode c) := by + rcases EncodedCanonical.least_lt_or_eq C wf q c with h | h + · exact h + · exact False.elim (hn (by simp [output,hz,h])) + have hb : (C.encode (a++EncodedCanonical.least C wf q c++b)).length ≤ + (C.encode (a++c++b)).length := by + have hh := EncodedCanonical.least_length C wf q c + simp only [DelimiterCode.encode_append,List.length_append] + omega + have hclass : q (a++EncodedCanonical.least C wf q c++b) = q w := + (hc _ a b _ c hb le_rfl (EncodedCanonical.least_class C wf q c)).trans hq + apply EncodedCanonical.least_global_min C wf q hclass + rw [hab] + simpa only [DelimiterCode.encode_append] using shortlex_context hlt (C.encode a) (C.encode b) + + theorem canonical_irreducible {rs : List (List S × List S)} {n : ℕ} + (hiso : ∀ p ∈ rs, p ∈ table C E wf q z n ∨ ∃ s ∈ p.1, s ∉ C.alphabet) + (hc : ∀ k, Contextual C q k) (hi : ∀ k, ZeroIdeal C q k) + {w : List A} (hw : q w ≠ none) : + Irreducible (Step rs) (C.encode (EncodedCanonical.least C wf q w)) := by + apply irreducible_of_no_infix + intro p hp hif + rcases hiso p hp with hp | ⟨s,hs,hn⟩ + · exact canonical_no_infix C E wf q z hc hi hw hp hif + · exact hn (C.mem_alphabet_of_mem_encode (hif.subset hs)) + + theorem output_eq_iff (hz : z ∉ C.alphabet) (u v : List A) : + output C wf q z u = output C wf q z v ↔ q u = q v := by + constructor + · intro he + by_cases hu : q u = none <;> by_cases hv : q v = none + · exact hu.trans hv.symm + · have hh : z ∈ C.encode (EncodedCanonical.least C wf q v) := by + rw [output,ite_eq_left hu,output,ite_eq_right hv] at he + rw [←he]; simp + exact False.elim (hz (C.mem_alphabet_of_mem_encode hh)) + · have hh : z ∈ C.encode (EncodedCanonical.least C wf q u) := by + rw [output,ite_eq_right hu,output,ite_eq_left hv] at he + rw [he]; simp + exact False.elim (hz (C.mem_alphabet_of_mem_encode hh)) + · rw [output,ite_eq_right hu,output,ite_eq_right hv] at he + have h := C.encode_injective he + exact (EncodedCanonical.least_class C wf q u).symm.trans + ((congrArg q h).trans (EncodedCanonical.least_class C wf q v)) + · exact output_congr C wf q z +end CodeTable + +namespace Families +variable {I S : Type*} {A Q : I → Type*} [Fintype I] [Fintype S] +variable {r : S → S → Prop} [Std.Trichotomous r] +variable (C : ∀ i, DelimiterCode (A i) S) (E : ∀ i, FiniteSearch (C i)) + (wf : WellFounded r) (q : ∀ i, List (A i) → Option (Q i)) (z : S) + + theorem table_short {n : ℕ} {p : List S × List S} (hp : p ∈ table C E wf q z n) : + 1 < p.1.length := by + classical + rcases (mem_table C E wf q z).mp hp with hp | ⟨i,hp⟩ + · obtain ⟨a,ha,_⟩ := (Base.mem_absorption z).mp hp + rcases ha with he | he <;> simp [he] + · exact CodeTable.table_short (C i) (E i) wf (q i) z hp + + theorem isolate (i : I) (hz : z ∉ (C i).alphabet) + (hd : ∀ j, i ≠ j → Disjoint (C i).alphabet (C j).alphabet) + {n : ℕ} {p : List S × List S} (hp : p ∈ table C E wf q z n) : + p ∈ CodeTable.table (C i) (E i) wf (q i) z n ∨ ∃ s ∈ p.1, s ∉ (C i).alphabet := by + classical + rcases (mem_table C E wf q z).mp hp with hp | ⟨j,hp⟩ + · obtain ⟨a,ha,_⟩ := (Base.mem_absorption z).mp hp + exact Or.inr ⟨z,by rcases ha with he | he <;> simp [he],hz⟩ + · by_cases he : i = j + · subst j; exact Or.inl hp + · obtain ⟨w,_,hn,_,hl,_⟩ := (CodeTable.mem_table (C j) (E j) wf (q j) z).mp hp + have hw : (C j).encode w ≠ [] := mt ((C j).encode_eq_nil _).mp hn + obtain ⟨s,hs⟩ := List.exists_mem_of_ne_nil _ hw + exact Or.inr ⟨s,hl ▸ hs,fun h => Set.disjoint_left.mp (hd j he) h + ((C j).mem_alphabet_of_mem_encode hs)⟩ +end Families + +namespace CodeQuotient +open FiniteAlgebraicEnvelopes.Bootstrap.Quotient +variable {S : Type*} [DecidableEq S] +variable (T : ℕ → Part (List (List S × List S))) +variable {t : S → S → Prop} (wt : WellFounded t) + (good : ∀ n, GoodTable (r:=t) T n) + (stable : ∀ k n, k ≤ n → ∀ rk ∈ T k, ∀ rn ∈ T n, Selectors.BoundedEq rk rn k) +variable {A Q : Type*} {r : S → S → Prop} [Std.Trichotomous r] +variable (C : DelimiterCode A S) (E : FiniteSearch C) (wf : WellFounded r) + (q : List A → Option Q) (z : S) +variable (hshort : ∀ n rs, rs ∈ T n → ∀ p ∈ rs, 1 < p.1.length) +variable (hiso : ∀ n rs, rs ∈ T n → ∀ p ∈ rs, + p ∈ CodeTable.table C E wf q z n ∨ ∃ s ∈ p.1, s ∉ C.alphabet) +variable (hstatic : ∀ n rs, rs ∈ T n → ∀ p ∈ CodeTable.table C E wf q z n, p ∈ rs) +variable (hc : ∀ n, CodeTable.Contextual C q n) (hi : ∀ n, CodeTable.ZeroIdeal C q n) + (hzero : q [] ≠ none) +include wt good stable hshort hiso hstatic hc hi hzero + + theorem normal_encode (w : List A) : normal T (C.encode w) = CodeTable.output C wf q z w := by + have hfixed : normal T (CodeTable.output C wf q z w) = CodeTable.output C wf q z w := by + by_cases hq : q w = none + · rw [CodeTable.output,ite_eq_left hq] + obtain ⟨rs,hrs,_⟩ := good 1 + exact normal_eq_self T wt good stable hrs + (irreducible_of_short (fun p hp => hshort 1 rs hrs p hp)) + · rw [CodeTable.output,ite_eq_right hq] + obtain ⟨rs,hrs,_⟩ := good (C.encode (EncodedCanonical.least C wf q w)).length + exact normal_eq_self T wt good stable hrs + (CodeTable.canonical_irreducible C E wf q z (hiso _ rs hrs) hc hi hq) + have hpres : present T (C.encode w) = present T (CodeTable.output C wf q z w) := by + obtain ⟨rs,hrs,hd,_⟩ := good (C.encode w).length + exact present_steps T hrs hd le_rfl + (steps_mono (hstatic _ rs hrs) (CodeTable.whole_steps C E wf q z hzero le_rfl)) + exact ((present_eq_iff T wt good stable _ _).mp hpres).trans hfixed + + theorem present_encode_iff (hz : z ∉ C.alphabet) (u v : List A) : + present T (C.encode u) = present T (C.encode v) ↔ q u = q v := by + rw [present_eq_iff T wt good stable, + normal_encode T wt good stable C E wf q z hshort hiso hstatic hc hi hzero, + normal_encode T wt good stable C E wf q z hshort hiso hstatic hc hi hzero] + exact CodeTable.output_eq_iff C wf q z hz u v +end CodeQuotient + +namespace CodeQuotient +open FiniteAlgebraicEnvelopes.Bootstrap.Quotient +variable {A S M : Type*} [DecidableEq S] [Monoid M] +variable {T : ℕ → Part (List (List S × List S))} +variable (C : DelimiterCode A S) + +def codeHom : FreeMonoid A →* Mon T where + toFun w := present T (C.encode w.toList) + map_one' := by simp + map_mul' u v := by simp only [FreeMonoid.toList_mul,DelimiterCode.encode_append,present_append] + +variable (e : FreeMonoid A →* M) (he : Function.Surjective e) + (hc : ∀ u v : List A,present T (C.encode u)=present T (C.encode v) ↔ + e (FreeMonoid.ofList u)=e (FreeMonoid.ofList v)) + +noncomputable def descendCode : M →* Mon T where + toFun x := codeHom C (he x).choose + map_one' := by + have hx : e (he 1).choose=e 1 := (he 1).choose_spec.trans e.map_one.symm + exact (hc _ []).mpr hx + map_mul' x y := by + change present T (C.encode ((he (x*y)).choose.toList)) = + present T (C.encode ((he x).choose.toList))*present T (C.encode ((he y).choose.toList)) + rw [←present_append,←DelimiterCode.encode_append] + apply (hc _ _).mpr + change e (he (x*y)).choose=e ((he x).choose * (he y).choose) + rw [e.map_mul,(he (x*y)).choose_spec,(he x).choose_spec,(he y).choose_spec] + +omit [DecidableEq S] in +theorem descendCode_apply (w : List A) : + descendCode C e he hc (e (FreeMonoid.ofList w))=present T (C.encode w) := + (hc _ w).mpr (he (e (FreeMonoid.ofList w))).choose_spec + +omit [DecidableEq S] in +theorem descendCode_injective : Function.Injective (descendCode C e he hc) := by + intro x y h + exact (he x).choose_spec.symm.trans (((hc _ _).mp h).trans (he y).choose_spec) +end CodeQuotient +end SimpleFInftyOvergroups.ContextualEncoding + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleOvergroups/CommonCompiler.lean b/lean/OAI/GroupTheory/SimpleOvergroups/CommonCompiler.lean new file mode 100644 index 0000000000000000000000000000000000000000..3e22567b385193e2830885fa9fce861703a54aac --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleOvergroups/CommonCompiler.lean @@ -0,0 +1,213 @@ +import Mathlib +import OAI.Computability.FiniteCompiler.Paths +import OAI.Computability.FiniteCompiler.Selectors +import OAI.Computability.FiniteCompiler.UniformControl +import OAI.Computability.FiniteCompiler.UniformMachines +import OAI.Computability.FiniteCompiler.UniformPaths +import OAI.GroupTheory.BooneHigman.Basic +import OAI.GroupTheory.BooneHigman.Contracted +import OAI.GroupTheory.SimpleOvergroups.TruncatedAlgebra + +namespace OAI + + +namespace SimpleFInftyOvergroups.BoundedEncoding.WordCalculus +noncomputable section +variable {M N : Type*} [Monoid M] [Monoid N] {m : ℕ} + +def retract (C : WordCalculus M m) (r : N →* M) (i : M →* N) + (hi : ∀ x, r (i x) = x) (grade : N → ℕ) + (hg1 : grade 1 = 0) (hgm : ∀ x y, grade (x*y) = grade x + grade y) + (hgi : ∀ x, grade (i x) = C.grade x) + (hgr : ∀ x, C.grade (r x) ≤ grade x) : WordCalculus N m where + grade := grade + grade_one := hg1 + grade_mul := hgm + omega := i C.omega + grade_omega := (hgi _).trans C.grade_omega + omega_ne_one h := C.omega_ne_one (by simpa only [hi, map_one] using congrArg r h) + normal x := i (C.normal (r x)) + normal_one := by simp only [map_one, C.normal_one] + normal_omega := by simp only [hi, C.normal_omega] + nonincreasing x hx := by + rw [hgi] + exact (C.nonincreasing _ ((hgr _).trans hx)).trans (hgr _) + idempotent x hx := by rw [hi, C.idempotent _ ((hgr _).trans hx)] + context h a b hu hv := by + have he := congrArg r h + simp only [hi] at he + apply congrArg i + simp only [map_mul] + apply C.context he (r a) (r b) + · simpa only [map_mul] using (hgr _).trans hu + · simpa only [map_mul] using (hgr _).trans hv + absorbs a b := by simp only [map_mul, hi, C.absorbs] + +end +end SimpleFInftyOvergroups.BoundedEncoding.WordCalculus + +namespace SimpleFInftyOvergroups.CommonCompiler +noncomputable section +open FiniteAlgebraicEnvelopes +open Compiler MachineRealization +open scoped Classical Compiler.HeadCodec + +variable {T Γ Q : Type*} +abbrev Letter (T Γ Q : Type*) := Compiler.Word.Letter T (Bool × Γ) (ParameterCode.Control Q) +abbrev FiniteLetter (T Γ Q : Type*) (n : ℕ) := + Compiler.Word.Letter T (Bool × Γ) (ParameterMachine.State Q n) + +abbrev includeLetter (n : ℕ) : FiniteLetter T Γ Q n → Letter T Γ Q := + Word.letterMap (ParameterCode.encode n) + +theorem includeLetter_injective (n : ℕ) : + Function.Injective (includeLetter (T:=T) (Γ:=Γ) (Q:=Q) n) := + Word.letterMap_injective _ (ParameterCode.encode_injective n) + +def retractLetter (n : ℕ) (a : Letter T Γ Q) : FiniteLetter T Γ Q n := + if h : ∃ b, includeLetter n b = a then h.choose else .zero + +@[simp] theorem retract_include (n : ℕ) (a : FiniteLetter T Γ Q n) : + retractLetter n (includeLetter n a) = a := by + have h : ∃ b, includeLetter n b = includeLetter n a := ⟨a,rfl⟩ + rw [retractLetter, dite_eq_left h] + exact includeLetter_injective n h.choose_spec + +theorem grade_include_letter (n : ℕ) (a : FiniteLetter T Γ Q n) : + Path.letterGrade Word.gradeCell (includeLetter n a) = + Path.letterGrade Word.gradeCell a := by + cases a <;> rfl + +theorem grade_include (n : ℕ) (w : List (FiniteLetter T Γ Q n)) : + Word.grade (w.map (includeLetter n)) = Word.grade w := by + simp only [Word.grade, Path.grade, List.map_map] + congr 2 + funext a + exact grade_include_letter n a + +theorem grade_retract_letter (n : ℕ) (a : Letter T Γ Q) : + Path.letterGrade Word.gradeCell (retractLetter n a) ≤ + Path.letterGrade Word.gradeCell a := by + rw [retractLetter] + split + · rename_i h + exact le_of_eq ((grade_include_letter n h.choose).symm.trans + (congrArg (Path.letterGrade Word.gradeCell) h.choose_spec)) + · exact Nat.zero_le _ + +theorem grade_retract (n : ℕ) (w : List (Letter T Γ Q)) : + Word.grade (w.map (retractLetter n)) ≤ Word.grade w := by + induction w with + | nil => exact le_refl 0 + | cons a w ih => exact Nat.add_le_add (grade_retract_letter n a) ih + +abbrev includeWord (n : ℕ) : FreeMonoid (FiniteLetter T Γ Q n) →* FreeMonoid (Letter T Γ Q) := + FreeMonoid.map (includeLetter n) +abbrev retractWord (n : ℕ) : FreeMonoid (Letter T Γ Q) →* FreeMonoid (FiniteLetter T Γ Q n) := + FreeMonoid.map (retractLetter n) + +@[simp] theorem retract_include_word (n : ℕ) (w : FreeMonoid (FiniteLetter T Γ Q n)) : + retractWord n (includeWord n w) = w := by + apply FreeMonoid.toList.injective + simp only [includeWord,retractWord,FreeMonoid.toList_map,List.map_map, + Function.comp_def,retract_include] + exact List.map_id _ + +variable [Fintype T] [Fintype Γ] [Fintype Q] + [DecidableEq T] [DecidableEq Γ] [DecidableEq Q] [Primcodable Q] + +def clamp (n : ℕ) (a : Letter T Γ Q) : Letter T Γ Q := + if a ∈ ParameterCode.letters n then a else .zero + +omit [Primcodable Q] in +@[simp] theorem include_retract [Primcodable Q] (n : ℕ) (a : Letter T Γ Q) : + includeLetter n (retractLetter n a) = clamp n a := by + by_cases h : ∃ b, includeLetter n b = a + · rw [retractLetter,dite_eq_left h,clamp,ite_eq_left ((ParameterCode.mem_letters_iff n a).mpr h)] + exact h.choose_spec + · rw [retractLetter,dite_eq_right h,clamp,ite_eq_right (fun ha => h ((ParameterCode.mem_letters_iff n a).mp ha))] + rfl + +theorem clamp_words (n : ℕ) (w : List (Letter T Γ Q)) : + (w.map (retractLetter n)).map (includeLetter n) = w.map (clamp n) := by + simp only [List.map_map,Function.comp_def,include_retract] + +variable [Primcodable Γ] [Primcodable T] + +omit [Primcodable Γ] [Primcodable T] in +theorem primrec_clamp [Primcodable Γ] [Primcodable T] : + Primrec₂ (clamp (T:=T) (Γ:=Γ) (Q:=Q)) := by + exact (Primrec.ite + (Bootstrap.Selectors.primrec_mem.comp Primrec.snd + (ParameterCode.primrec_letters.comp Primrec.fst)) + Primrec.snd (Primrec.const (Path.Letter.zero : Letter T Γ Q))).of_eq (by + intro x + simp only [clamp] + split <;> simp_all) + +omit [Fintype Q] [DecidableEq T] [DecidableEq Γ] [DecidableEq Q] + [Primcodable Γ] [Primcodable T] in +theorem primrec_letterGrade [Fintype Q] [DecidableEq T] [DecidableEq Γ] [DecidableEq Q] + [Primcodable Γ] [Primcodable T] : + Primrec (Path.letterGrade Word.gradeCell : Letter T Γ Q → ℕ) := by + exact ((Effect.primrec_sumElim + (Primrec.dom_finite (fun i : Fin 3 => if i = 0 then 0 else 1)) + (Effect.primrec_sumElim (Primrec.dom_finite Word.gradeCell) + (Effect.primrec_sumElim (Primrec.dom_finite Word.gradeCell) (Primrec.const 1)))).comp + HeadCodec.primrec_pathCode).of_eq (fun a => by cases a <;> rfl) + +theorem primrec_grade : Primrec (Word.grade (S:=T) (Γ:=Bool × Γ) (Q:=ParameterCode.Control Q)) := by + exact (Primrec.list_foldr Primrec.id (Primrec.const 0) + (Primrec.nat_add.comp (primrec_letterGrade.comp (Primrec.fst.comp Primrec.snd)) + (Primrec.snd.comp Primrec.snd)).to₂).of_eq (by + intro w + induction w with + | nil => rfl + | cons a w ih => simpa only [id_eq, List.foldr_cons, Word.grade, Path.grade_cons] using + (congrArg (Path.letterGrade Word.gradeCell a + ·) ih)) + +variable {S : Type*} (A : Simulator.Alphabet S Γ) (M : Simulator.Machine Q Γ) + (p : S) (B : Simulator.Alphabet T (Bool × Γ)) + +def service (f : ℕ × List T → Part (List T)) (x : ℕ × List (Letter T Γ Q)) : + Part (List (Letter T Γ Q)) := + ParameterCode.codedNormal A M p B f (x.1, x.2.map (clamp x.1)) + +theorem partrec_service {f : ℕ × List T → Part (List T)} (hf : Partrec f) : + Partrec (service A M p B f) := by + exact (ParameterCode.partrec_codedNormal A M p B hf).comp + (Primrec.fst.pair (Primrec.list_map Primrec.snd + (primrec_clamp.comp (Primrec.fst.comp Primrec.fst) Primrec.snd).to₂)).to_comp + +def calculus (n : ℕ) + (decode : ∀ g a, B.output g = some a → g = B.input a) + {f : ℕ × List T → Part (List T)} {m : ℕ} + (budget : PartialBudget (fun w => f (n,w)) m) + (realizes : Word.Realizes B (ParameterMachine.machine A M p n) (fun w => f (n,w))) : + BoundedEncoding.WordCalculus (FreeMonoid (Letter T Γ Q)) m := by + letI := ParameterCode.finiteOrder (T:=T) (Γ:=Γ) (Q:=Q) n + let C := BoundedEncoding.CompilerCalculus.calculus B (ParameterMachine.machine A M p n) + decode budget realizes + exact C.retract (retractWord n) (includeWord n) (retract_include_word n) + (fun w => Word.grade w.toList) rfl (fun _ _ => Word.grade_append _ _) + (fun w => grade_include n w.toList) (fun w => grade_retract n w.toList) + +omit [Primcodable Γ] [Primcodable T] in +theorem service_full [Primcodable Γ] [Primcodable T] (n : ℕ) + (decode : ∀ g a, B.output g = some a → g = B.input a) + {f : ℕ × List T → Part (List T)} {m : ℕ} + (budget : PartialBudget (fun w => f (n,w)) m) + (realizes : Word.Realizes B (ParameterMachine.machine A M p n) (fun w => f (n,w))) + (w : List (Letter T Γ Q)) (hw : Word.grade w ≤ m) : + ((calculus A M p B n decode budget realizes).normal (FreeMonoid.ofList w)).toList ∈ + service A M p B f (n,w) := by + let := ParameterCode.finiteOrder (T:=T) (Γ:=Γ) (Q:=Q) n + rw [service,← clamp_words,ParameterCode.codedNormal_map, + Word.partialNormal_eq_some B (ParameterMachine.machine A M p n) budget _ + ((grade_retract n w).trans hw)] + exact (Part.mem_map_iff _).mpr ⟨_, Part.mem_some _, rfl⟩ + +end +end SimpleFInftyOvergroups.CommonCompiler + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleOvergroups/CompilerSemantics.lean b/lean/OAI/GroupTheory/SimpleOvergroups/CompilerSemantics.lean new file mode 100644 index 0000000000000000000000000000000000000000..e3cee893b9369c16abec28a4d160b3802772188f --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleOvergroups/CompilerSemantics.lean @@ -0,0 +1,103 @@ +import Mathlib +import OAI.Computability.FiniteCompiler.Quotients +import OAI.GroupTheory.SimpleOvergroups.CommonCompiler +import OAI.GroupTheory.SimpleOvergroups.ContractedNormalForms + +namespace OAI + + +namespace SimpleFInftyOvergroups.CommonCompiler +noncomputable section +open FiniteAlgebraicEnvelopes Compiler MachineRealization +open SemanticEncoding +open scoped Classical Compiler.HeadCodec + +variable {S T Γ Q : Type*} [Fintype T] [Fintype Γ] [Fintype Q] + [DecidableEq T] [DecidableEq Γ] [DecidableEq Q] [Primcodable Q] +variable (A : Simulator.Alphabet S Γ) (M : Simulator.Machine Q Γ) + (p : S) (B : Simulator.Alphabet T (Bool × Γ)) (index : ℕ) + +local instance compilerSemanticsSectorOrder : + LinearOrder (Control.Sector T (Bool × Γ) (ParameterMachine.State Q index)) := + ParameterCode.finiteOrder index + +abbrev Mon := Word.Presentation B (ParameterMachine.machine A M p index) + +local instance compilerSemanticsMonoidWithZero : MonoidWithZero (Mon A M p B index) := + Word.monoidWithZero B (ParameterMachine.machine A M p index) + +variable (decode : ∀ g a, B.output g = some a → g = B.input a) + {f : ℕ × List T → Part (List T)} + (budget : ∀ m, PartialBudget (fun w => f (index,w)) m) + (realizes : Word.Realizes B (ParameterMachine.machine A M p index) (fun w => f (index,w))) + +def evaluation : FreeMonoid (Letter T Γ Q) →* Mon A M p B index := + (PresentedMonoid.mk (Word.Rel B (ParameterMachine.machine A M p index))).comp + (retractWord index) + +omit [Fintype T] [Fintype Γ] [Fintype Q] [DecidableEq Q] [Primcodable Q] in + theorem evaluation_surjective : Function.Surjective (evaluation A M p B index) := by + intro h + obtain ⟨w,hw⟩ := PresentedMonoid.surjective_mk h + refine ⟨includeWord index w, ?_⟩ + simpa only [evaluation, MonoidHom.comp_apply, retract_include_word] using hw + +omit [Fintype T] [Fintype Γ] [Fintype Q] [DecidableEq T] [DecidableEq Γ] + [DecidableEq Q] [Primcodable Q] in + theorem includeWord_injective : Function.Injective (includeWord (T:=T) (Γ:=Γ) (Q:=Q) index) := + Function.LeftInverse.injective (retract_include_word index) + +def normal (w : FreeMonoid (Letter T Γ Q)) : FreeMonoid (Letter T Γ Q) := + (calculus A M p B index decode (budget 0) realizes).normal w + + theorem normal_at (m : ℕ) : + (calculus A M p B index decode (budget m) realizes).normal = normal A M p B index decode budget realizes := rfl + + theorem evaluation_iff (u v : FreeMonoid (Letter T Γ Q)) : + evaluation A M p B index u = evaluation A M p B index v ↔ + normal A M p B index decode budget realizes u = normal A M p B index decode budget realizes v := by + change _ ↔ includeWord index _ = includeWord index _ + rw [(includeWord_injective (T:=T) (Γ:=Γ) (Q:=Q) index).eq_iff] + change Word.present B (ParameterMachine.machine A M p index) (retractWord index u).toList = + Word.present B (ParameterMachine.machine A M p index) (retractWord index v).toList ↔ _ + exact Word.present_eq_iff_normal B (ParameterMachine.machine A M p index) decode + (fun m => (budget m).totalize) (fun m => realizes.computesAt _ _ (budget m)) _ _ + + theorem normal_idempotent (w : FreeMonoid (Letter T Γ Q)) : + normal A M p B index decode budget realizes (normal A M p B index decode budget realizes w) = + normal A M p B index decode budget realizes w := by + exact (calculus A M p B index decode (budget (Word.grade w.toList)) realizes).idempotent w le_rfl + +def normalPresentation : NormalPresentation (FreeMonoid (Letter T Γ Q)) (Mon A M p B index) where + q := evaluation A M p B index + surjective := evaluation_surjective A M p B index + normal := normal A M p B index decode budget realizes + omega := FreeMonoid.ofList [.zero] + zero := by + change Word.present B (ParameterMachine.machine A M p index) + [retractLetter index .zero] = Word.present B (ParameterMachine.machine A M p index) [.zero] + rw [show retractLetter index (.zero : Letter T Γ Q) = .zero from retract_include index .zero] + complete := evaluation_iff A M p B index decode budget realizes + idempotent := normal_idempotent A M p B index decode budget realizes + fixesZero := (calculus A M p B index decode (budget 0) realizes).normal_omega + + include decode budget realizes in + theorem zero_ne_one : (0 : Mon A M p B index) ≠ 1 := by + intro h + let P := normalPresentation A M p B index decode budget realizes + have he := (P.complete P.omega 1).mp (by rw [P.zero,map_one]; exact h) + have hone : P.normal 1 = 1 := + (calculus A M p B index decode (budget 0) realizes).normal_one + rw [P.fixesZero,hone] at he + have he' := congrArg FreeMonoid.toList he + change [.zero] = ([] : List (Letter T Γ Q)) at he' + contradiction + + include decode budget realizes in + theorem nontrivial : Nontrivial (Mon A M p B index) := + nontrivial_of_ne _ _ (zero_ne_one A M p B index decode budget realizes) + +end +end SimpleFInftyOvergroups.CommonCompiler + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleOvergroups/ContextualCompiler.lean b/lean/OAI/GroupTheory/SimpleOvergroups/ContextualCompiler.lean new file mode 100644 index 0000000000000000000000000000000000000000..58a06541d85b5bfb53e7a58c763f73fdad1aea56 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleOvergroups/ContextualCompiler.lean @@ -0,0 +1,230 @@ +import Mathlib +import OAI.Computability.FiniteCompiler.TapeFolding +import OAI.GroupTheory.SimpleOvergroups.BoundedFamilyTests +import OAI.GroupTheory.SimpleOvergroups.CommonCompiler +import OAI.GroupTheory.SimpleOvergroups.DoubleEffective +import OAI.GroupTheory.SimpleOvergroups.FamilyProgram +import OAI.GroupTheory.SimpleOvergroups.EffectiveFamilies + +namespace OAI + + +namespace SimpleFInftyOvergroups.ContextualEncoding.Source +noncomputable section +open FiniteAlgebraicEnvelopes Bootstrap Compiler Compiler.Simulator MachineRealization +open BoundedEncoding NamedAction +open scoped Classical Compiler.HeadCodec + +abbrev Sigma := ThreeCodes.Alphabet + +def rel (a b : Sigma) : Prop := Encodable.encode a < Encodable.encode b +local instance : DecidableRel rel := fun _ _ => inferInstanceAs (Decidable (_ < _)) +local instance : Std.Trichotomous rel := ⟨fun a b hab hba => by + apply Encodable.encode_injective + change ¬Encodable.encode a < Encodable.encode b at hab + change ¬Encodable.encode b < Encodable.encode a at hba + omega⟩ +theorem wf_rel : WellFounded rel := InvImage.wf Encodable.encode Nat.lt_wfRel.wf + +theorem primrec_shortlex : PrimrecRel (List.Shortlex rel) := by + let ord : LinearOrder Sigma := LinearOrder.lift' Encodable.encode Encodable.encode_injective + exact @Search.primrec_shortlex _ _ _ ord ⟨inferInstance, Primrec.dom_finite _⟩ + +def raw (n : ℕ) (w : List Sigma) : Part (List Sigma) := + WordProgramming.eval ((Encodable.decode n : Option Nat.Partrec.Code).getD .zero) w + +theorem raw_encode (c : Nat.Partrec.Code) : raw (Encodable.encode c) = WordProgramming.eval c := by + funext w + simp [raw] + +theorem partrec_raw : Partrec₂ raw := + WordProgramming.partrec_eval.comp + (Primrec.option_getD.comp (Primrec.decode.comp Primrec.fst) (Primrec.const .zero)).to_comp Computable.snd + +abbrev terminalAlphabet {Γ : Type*} (A : Alphabet (Sigma ⊕ Unit) Γ) := + UniversalMachine.restrict (ParameterMachine.alphabet A) +abbrev terminalMachine {Γ Q : Type*} [DecidableEq Γ] (A : Alphabet (Sigma ⊕ Unit) Γ) (M : Machine Q Γ) (n : ℕ) := + ParameterMachine.machine A M (.inr ()) n + +structure Family where + Γ : Type + Q : Type + [finiteΓ : Fintype Γ] + [finiteQ : Fintype Q] + [decΓ : DecidableEq Γ] + [decQ : DecidableEq Q] + [codeΓ : Primcodable Γ] + [codeQ : Primcodable Q] + A : Alphabet (Sigma ⊕ Unit) Γ + M : Machine Q Γ + decode : ∀ g a, (terminalAlphabet A).output g = some a → g = (terminalAlphabet A).input a + realizes : ∀ n, Word.Realizes (terminalAlphabet A) (terminalMachine A M n) (raw n) + +attribute [instance] Family.finiteΓ Family.finiteQ Family.decΓ Family.decQ Family.codeΓ Family.codeQ + +theorem exists_family : Nonempty Family := by + obtain ⟨Γ,Q,hΓ,hQ,dΓ,A,M,hd,hr⟩ := UniversalMachine.exists_parameter_machine partrec_raw + let : Fintype Γ := hΓ + let : Fintype Q := hQ + let : DecidableEq Γ := dΓ + let : Primcodable Γ := Effect.finitePrimcodable Γ + let : Primcodable Q := Effect.finitePrimcodable Q + exact ⟨⟨Γ,Q,A,M,UniversalMachine.restrict_decode (ParameterMachine.alphabet A) + (ParameterMachine.output_decode A hd),hr⟩⟩ + +def family : Family := exists_family.some + +variable {G : Type*} [Group G] {k : ℕ} (s : Fin k → G) +variable {Γ Q P₁ P₂ : Type} [Fintype Γ] [Fintype Q] [DecidableEq Γ] [DecidableEq Q] + [Primcodable Γ] [Primcodable Q] [Primcodable P₁] [Primcodable P₂] [Finite P₁] [Finite P₂] +variable (A : Alphabet (Sigma ⊕ Unit) Γ) (M : Machine Q Γ) + +local instance : Primcodable (ZMod 2) := Effect.finitePrimcodable _ +local instance : Primcodable (ZMod 3) := Effect.finitePrimcodable _ + +abbrev Syntax := CommonCompiler.Letter Sigma Γ Q +abbrev Acting := EffectiveNames.Double.G₂ P₁ P₂ (ZMod 2) (Syntax (Γ:=Γ) (Q:=Q)) 7 +abbrev Points := EffectiveNames.Double.X₂ P₁ P₂ (ZMod 2) (Syntax (Γ:=Γ) (Q:=Q)) 7 +local instance : Primcodable (Syntax (Γ:=Γ) (Q:=Q)) := inferInstance +local instance : Primcodable (Acting (Γ:=Γ) (Q:=Q) (P₁:=P₁) (P₂:=P₂)) := inferInstance +local instance : Primcodable (Points (Γ:=Γ) (Q:=Q) (P₁:=P₁) (P₂:=P₂)) := inferInstance + +abbrev ops := EffectiveNames.Double.operations (P₁:=P₁) (P₂:=P₂) (k₀:=ZMod 2) (n:=7) + (Word.grade (S:=Sigma) (Γ:=Bool × Γ) (Q:=ParameterCode.Control Q)) + +abbrev Symbols (k : ℕ) : Fin 3 → Type _ + | 0 => Fin k × Bool + | 1 => ProductFamily.Letter (Syntax (Γ:=Γ) (Q:=Q)) + | 2 => NamedAction.Letter (Acting (Γ:=Γ) (Q:=Q) (P₁:=P₁) (P₂:=P₂)) + (Points (Γ:=Γ) (Q:=Q) (P₁:=P₁) (P₂:=P₂)) + +abbrev Keys (k : ℕ) : Fin 3 → Type _ + | 0 => List (Fin k × Bool) + | 1 => ProductFamily.Key (Syntax (Γ:=Γ) (Q:=Q)) + | 2 => List ℕ × (ℕ × ℕ) × List ℕ + +local instance (i : Fin 3) : Primcodable (Symbols (Γ:=Γ) (Q:=Q) (P₁:=P₁) (P₂:=P₂) k i) := + match i with + | 0 => inferInstance + | 1 => inferInstance + | 2 => inferInstance +local instance (i : Fin 3) : Primcodable (Keys (Γ:=Γ) (Q:=Q) k i) := + match i with + | 0 => inferInstance + | 1 => inferInstance + | 2 => inferInstance + +def cost : (i : Fin 3) → Symbols (Γ:=Γ) (Q:=Q) (P₁:=P₁) (P₂:=P₂) k i → ℕ + | 0 => fun _ => 0 + | 1 => ProductFamily.cost (Path.letterGrade Word.gradeCell) + | 2 => (ops (Γ:=Γ) (Q:=Q) (P₁:=P₁) (P₂:=P₂)).letterCost + +def code (i : Fin 3) := ThreeCodes.code i (cost (Γ:=Γ) (Q:=Q) (P₁:=P₁) (P₂:=P₂) (k:=k) i) +def search (i : Fin 3) := ThreeCodes.search i (cost (Γ:=Γ) (Q:=Q) (P₁:=P₁) (P₂:=P₂) (k:=k) i) + +omit [Finite P₁] [Finite P₂] in +theorem primrec_cost (i : Fin 3) : Primrec (cost (Γ:=Γ) (Q:=Q) (P₁:=P₁) (P₂:=P₂) (k:=k) i) := by + fin_cases i + · exact Primrec.const 0 + · exact ProductFamily.primrec_cost (A:=Syntax (Γ:=Γ) (Q:=Q)) + (CommonCompiler.primrec_letterGrade (T:=Sigma) (Γ:=Γ) (Q:=Q)) + · exact EffectiveNames.Double.primrec_cost (P₁:=P₁) (P₂:=P₂) (k₀:=ZMod 2) (n:=7) + (Word.grade (S:=Sigma) (Γ:=Bool × Γ) (Q:=ParameterCode.Control Q)) + (CommonCompiler.primrec_grade (T:=Sigma) (Γ:=Γ) (Q:=Q)) + +variable (e₁ : P₁ → EffectiveNames.Enlargement.Coeff.Name (ZMod 2)) + (e₂ : P₂ → EffectiveNames.Enlargement.Coeff.Name (ZMod 3)) + +def normal (n : ℕ) (w : List (Syntax (Γ:=Γ) (Q:=Q))) : Part (List (Syntax (Γ:=Γ) (Q:=Q))) := + CommonCompiler.service A M (.inr ()) (terminalAlphabet A) (fun x => raw x.1 x.2) (n,w) + +theorem partrec_normal : Partrec₂ (normal A M) := + CommonCompiler.partrec_service A M (.inr ()) (terminalAlphabet A) partrec_raw + +def test : (i : Fin 3) → ℕ → List (Symbols (Γ:=Γ) (Q:=Q) (P₁:=P₁) (P₂:=P₂) k i) → + Part (Option (Keys (Γ:=Γ) (Q:=Q) k i)) + | 0 => fun _ => GroupFamily.test s + | 1 => fun n => ProductFamily.test [.zero] (normal A M n) + | 2 => fun n => EffectiveNames.Double.test e₁ e₂ Word.grade [.zero] (normal A M n) + +def tables (n : ℕ) : ℕ → Part (List (List Sigma × List Sigma)) := + FamilyProgram.compute (r:=rel) (code (Γ:=Γ) (Q:=Q) (P₁:=P₁) (P₂:=P₂) (k:=k)) search + none (fun i => test s A M e₁ e₂ i n) + +theorem partrec_test (h : ComputablePred (fun w => FiniteAlgebraicEnvelopes.evalWord s w = 1)) + (i : Fin 3) : Partrec₂ (test s A M e₁ e₂ i) := by + fin_cases i + · exact (GroupFamily.partrec_test s h).comp Computable.snd + · exact ProductFamily.partrec_test (A:=Syntax (Γ:=Γ) (Q:=Q)) [.zero] (partrec_normal A M) + · exact EffectiveNames.Double.partrec_test (P₁:=P₁) (P₂:=P₂) (k₀:=ZMod 2) (n:=7) + e₁ e₂ (Word.grade (S:=Sigma) (Γ:=Bool × Γ) (Q:=ParameterCode.Control Q)) [.zero] + (partrec_normal A M) + +theorem partrec_tables (h : ComputablePred (fun w => FiniteAlgebraicEnvelopes.evalWord s w = 1)) : + Partrec₂ (tables s A M e₁ e₂) := + FamilyProgram.partrec_compute _ _ _ + (fun i => ThreeCodes.primrec_words i _ (primrec_cost i)) + (fun i => ThreeCodes.primrec_encode i _ (primrec_cost i)) primrec_shortlex + (partrec_test s A M e₁ e₂ h) + +theorem exists_fixed_point (h : ComputablePred (fun w => FiniteAlgebraicEnvelopes.evalWord s w = 1)) : + ∃ n, raw n = tableNormal (tables s A M e₁ e₂ n) := by + have hh := partrec_tableNormal_parameter (partrec_tables s A M e₁ e₂ h) + have hc : Partrec₂ (fun c : Nat.Partrec.Code => tableNormal (tables s A M e₁ e₂ (Encodable.encode c))) := + hh.comp (Computable.encode.comp Computable.fst) Computable.snd + obtain ⟨c,hc⟩ := WordProgramming.fixed_point hc + exact ⟨Encodable.encode c, (raw_encode c).trans hc⟩ + +variable (decode : ∀ g a, (terminalAlphabet A).output g = some a → g = (terminalAlphabet A).input a) + (realizes : ∀ index, Word.Realizes (terminalAlphabet A) (terminalMachine A M index) (raw index)) + (he₁ : ∀ p, EffectiveNames.Enlargement.Coeff.value (e₁ p) * + EffectiveNames.Enlargement.Coeff.value (e₁ p) = EffectiveNames.Enlargement.Coeff.value (e₁ p)) + (he₂ : ∀ p, EffectiveNames.Enlargement.Coeff.value (e₂ p) * + EffectiveNames.Enlargement.Coeff.value (e₂ p) = EffectiveNames.Enlargement.Coeff.value (e₂ p)) + +include decode realizes he₁ he₂ + +omit [Finite P₁] [Finite P₂] in +theorem certificate (index n : ℕ) (budget : PartialBudget (raw index) (3 * (n / 10))) + (i : Fin 3) : TestCertificate (code (Γ:=Γ) (Q:=Q) (P₁:=P₁) (P₂:=P₂) (k:=k) i) + (test s A M e₁ e₂ i index) n := by + let C := CommonCompiler.calculus A M (.inr ()) (terminalAlphabet A) index decode + (f:=fun x => raw x.1 x.2) budget (realizes index) + have hf (u : List (Syntax (Γ:=Γ) (Q:=Q))) + (hu : C.grade (FreeMonoid.ofList u) ≤ n / 10) : + (C.normal (FreeMonoid.ofList u)).toList ∈ normal A M index u := by + apply CommonCompiler.service_full A M (.inr ()) (terminalAlphabet A) index + decode budget (realizes index) u + exact hu.trans (by omega) + fin_cases i + · exact GroupFamily.certificate s _ n + · exact ProductFamily.certificate C _ (Path.letterGrade Word.gradeCell) + (ProductFamily.grade_cost C _ (fun _ => rfl)) + (ThreeCodes.cost_padding _ _) (by omega) hf + · exact ActionFamily.certificate + (EffectiveNames.Double.interpretation (k₀:=ZMod 2) (n:=7) e₁ e₂ C he₁ he₂) + _ (ThreeCodes.cost_padding _ _) le_rfl _ + (fun w hw => EffectiveNames.Double.test_full e₁ e₂ _ C he₁ he₂ w hw hf) + +omit [Finite P₁] [Finite P₂] in +theorem all_budgets (index : ℕ) + (fixed : raw index = tableNormal (tables s A M e₁ e₂ index)) : + ∀ n, GoodTable (r:=rel) (tables s A M e₁ e₂ index) n ∧ PartialBudget (raw index) n := by + apply FamilyProgram.bootstrap _ _ _ _ wf_rel (raw index) fixed + (fun i => ThreeCodes.zero_avoids i _) (fun i j h => ThreeCodes.disjoint h _ _) + intro n hn budget + have hc := certificate s A M e₁ e₂ decode realizes he₁ he₂ index n budget + exact ⟨fun i => (hc i).total, fun i => (hc i).nonzero, + fun i => (hc i).contextual, fun i => (hc i).ideal⟩ + +theorem exists_total_fixed_point + (h : ComputablePred (fun w => FiniteAlgebraicEnvelopes.evalWord s w = 1)) : + ∃ index, raw index = tableNormal (tables s A M e₁ e₂ index) ∧ + ∀ n, GoodTable (r:=rel) (tables s A M e₁ e₂ index) n ∧ PartialBudget (raw index) n := by + obtain ⟨index, hi⟩ := exists_fixed_point s A M e₁ e₂ h + exact ⟨index,hi,all_budgets s A M e₁ e₂ decode realizes he₁ he₂ index hi⟩ + +end +end SimpleFInftyOvergroups.ContextualEncoding.Source + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleOvergroups/ContextualTables.lean b/lean/OAI/GroupTheory/SimpleOvergroups/ContextualTables.lean new file mode 100644 index 0000000000000000000000000000000000000000..05d1c26c67118e91bb3f20512684be9dc7d277e9 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleOvergroups/ContextualTables.lean @@ -0,0 +1,228 @@ +import Mathlib +import OAI.Computability.FiniteCompiler.Rewriting +import OAI.Computability.FiniteCompiler.Selectors +import OAI.GroupTheory.SimpleOvergroups.EffectiveCode + +namespace OAI + + +namespace SimpleFInftyOvergroups.ContextualEncoding +open FiniteAlgebraicEnvelopes.Bootstrap Relation + +structure FiniteSearch {A S : Type*} (C : DelimiterCode A S) where + words : ℕ → List (List A) + mem_words : ∀ n w, w ∈ words n ↔ (C.encode w).length ≤ n + +namespace PaddedCode +variable {A : Type*} [Encodable A] (cost : A → ℕ) +def search : FiniteSearch (code cost) := ⟨words cost, mem_words cost⟩ +end PaddedCode + +namespace EncodedCanonical +variable {A S Q : Type*} {r : S → S → Prop} +variable (C : DelimiterCode A S) (wf : WellFounded r) [Std.Trichotomous r] + (q : List A → Q) + +def candidates (w : List A) : Set (List A) := + {v | (C.encode v).length ≤ (C.encode w).length ∧ q v = q w} + +noncomputable def least (w : List A) : List A := + (InvImage.wf C.encode (List.Shortlex.wf wf)).min (candidates C q w) ⟨w, le_rfl, rfl⟩ + +omit [Std.Trichotomous r] in +theorem least_mem [Std.Trichotomous r] (w : List A) : least C wf q w ∈ candidates C q w := + (InvImage.wf C.encode (List.Shortlex.wf wf)).min_mem _ _ + +theorem least_length (w : List A) : (C.encode (least C wf q w)).length ≤ (C.encode w).length := + (least_mem C wf q w).1 + +theorem least_class (w : List A) : q (least C wf q w) = q w := (least_mem C wf q w).2 + +omit [Std.Trichotomous r] in +theorem least_min [Std.Trichotomous r] {w v : List A} (hv : (C.encode v).length ≤ (C.encode w).length) + (hq : q v = q w) : ¬ List.Shortlex r (C.encode v) (C.encode (least C wf q w)) := + (InvImage.wf C.encode (List.Shortlex.wf wf)).not_lt_min (candidates C q w) ⟨hv, hq⟩ + +theorem least_lt_or_eq (w : List A) : + List.Shortlex r (C.encode (least C wf q w)) (C.encode w) ∨ least C wf q w = w := by + by_cases h : List.Shortlex r (C.encode (least C wf q w)) (C.encode w) + · exact Or.inl h + · exact Or.inr (C.encode_injective + (Std.Trichotomous.trichotomous _ _ h (least_min C wf q le_rfl rfl))) + +theorem least_global_min {w v : List A} (hq : q v = q w) : + ¬ List.Shortlex r (C.encode v) (C.encode (least C wf q w)) := by + intro hd + have hlen : (C.encode v).length ≤ (C.encode w).length := by + have hm := least_length C wf q w + have he := List.shortlex_def.mp hd + omega + exact least_min C wf q hlen hq hd + +theorem least_congr {u v : List A} (hq : q u = q v) : least C wf q u = least C wf q v := by + apply C.encode_injective + exact Std.Trichotomous.trichotomous _ _ + (least_global_min C wf q ((least_class C wf q u).trans hq)) + (least_global_min C wf q ((least_class C wf q v).trans hq.symm)) + +theorem least_idem (w : List A) : least C wf q (least C wf q w) = least C wf q w := + least_congr C wf q (least_class C wf q w) + +theorem least_nil : least C wf q [] = [] := by + have h := least_length C wf q [] + have h' : C.encode (least C wf q []) = [] := List.length_eq_zero_iff.mp (by simpa using h) + exact (C.encode_eq_nil _).mp h' + +theorem eq_least_iff {w v : List A} : v = least C wf q w ↔ + (C.encode v).length ≤ (C.encode w).length ∧ q v = q w ∧ + ∀ t, (C.encode t).length ≤ (C.encode w).length → q t = q w → + ¬ List.Shortlex r (C.encode t) (C.encode v) := by + constructor + · rintro rfl + exact ⟨least_length C wf q w, least_class C wf q w, fun _ ht hq => least_min C wf q ht hq⟩ + · rintro ⟨hv, hq, hm⟩ + apply C.encode_injective + exact Std.Trichotomous.trichotomous _ _ (least_min C wf q hv hq) + (hm _ (least_length C wf q w) (least_class C wf q w)) +end EncodedCanonical + +namespace CodeTable +variable {A S Q : Type*} {r : S → S → Prop} [Std.Trichotomous r] +variable (C : DelimiterCode A S) (E : FiniteSearch C) (wf : WellFounded r) + (q : List A → Option Q) (z : S) + +noncomputable def output (v : List A) : List S := + if q v = none then [z] else C.encode (EncodedCanonical.least C wf q v) + +noncomputable def table (n : ℕ) : List (List S × List S) := by + classical + exact ((E.words n).filter fun v => v ≠ [] ∧ output C wf q z v ≠ C.encode v).map + (fun v => (C.encode v, output C wf q z v)) + +omit [Std.Trichotomous r] in +theorem mem_table [Std.Trichotomous r] {n : ℕ} {a b : List S} : (a,b) ∈ table C E wf q z n ↔ + ∃ v, (C.encode v).length ≤ n ∧ v ≠ [] ∧ output C wf q z v ≠ C.encode v ∧ + a = C.encode v ∧ b = output C wf q z v := by + classical + simp only [table, List.mem_map, List.mem_filter, E.mem_words, + decide_eq_true_eq, Prod.mk.injEq] + aesop + +theorem output_congr {u v : List A} (hq : q u = q v) : output C wf q z u = output C wf q z v := by + simp only [output, hq, EncodedCanonical.least_congr C wf q hq] + +theorem output_nil (hzero : q [] ≠ none) : output C wf q z [] = [] := by + simp [output, hzero, EncodedCanonical.least_nil] + +theorem whole_steps (hzero : q [] ≠ none) {n : ℕ} {v : List A} (hv : (C.encode v).length ≤ n) : + Steps (table C E wf q z n) (C.encode v) (output C wf q z v) := by + by_cases hn : v = [] + · subst v + rw [C.encode_nil, output_nil C wf q z hzero] + by_cases he : output C wf q z v = C.encode v + · rw [he] + · exact .single (by simpa using Step.apply ((mem_table C E wf q z).mpr + ⟨v,hv,hn,he,rfl,rfl⟩) [] []) + +def Contextual (n : ℕ) : Prop := + ∀ a b u v : List A, (C.encode (a++u++b)).length ≤ n → + (C.encode (a++v++b)).length ≤ n → q u = q v → q (a++u++b) = q (a++v++b) + +def ZeroIdeal (n : ℕ) : Prop := + ∀ a b u : List A, (C.encode (a++u++b)).length ≤ n → q u = none → q (a++u++b) = none + +theorem branch_normalizes {n : ℕ} {rs : List (List S × List S)} + (hzero : q [] ≠ none) (hz : Absorbs rs z) + (ht : ∀ p ∈ table C E wf q z n, p ∈ rs) + (hc : Contextual C q n) (hi : ZeroIdeal C q n) + {v : List A} {a b : List A} (hlen : (C.encode (a++v++b)).length ≤ n) : + Steps rs (C.encode a++output C wf q z v++C.encode b) (output C wf q z (a++v++b)) := by + by_cases hq : q v = none + · have hzq := hi a b v hlen hq + simp only [output, ite_eq_left hq, ite_eq_left hzq] + exact absorbs_context hz _ _ + · let v' := EncodedCanonical.least C wf q v + have hlen' : (C.encode (a++v'++b)).length ≤ n := by + have hh := EncodedCanonical.least_length C wf q v + simp only [DelimiterCode.encode_append, List.length_append] at hlen ⊢ + dsimp only [v'] + omega + have hqq : q (a++v'++b) = q (a++v++b) := + hc a b v' v hlen' hlen (EncodedCanonical.least_class C wf q v) + have hh := steps_mono ht (whole_steps C E wf q z hzero hlen') + rw [output_congr C wf q z hqq] at hh + simpa only [output, ite_eq_right hq, DelimiterCode.encode_append, v'] using hh + +theorem occurrence_normalizes {n : ℕ} {rs : List (List S × List S)} + (hzero : q [] ≠ none) (hz : Absorbs rs z) + (ht : ∀ p ∈ table C E wf q z n, p ∈ rs) + (hc : Contextual C q n) (hi : ZeroIdeal C q n) + {w v : List A} {x y : List S} (hw : (C.encode w).length ≤ n) (hv : v ≠ []) + (he : C.encode w = x++C.encode v++y) : + Steps rs (x++output C wf q z v++y) (output C wf q z w) := by + obtain ⟨a,b,rfl,rfl,rfl⟩ := C.occurrence_decode hv he + exact branch_normalizes C E wf q z hzero hz ht hc hi hw + +theorem critical_containment {n k l : ℕ} {rs : List (List S × List S)} + (hzero : q [] ≠ none) (hz : Absorbs rs z) + (ht : ∀ p ∈ table C E wf q z n, p ∈ rs) + (hc : Contextual C q n) (hi : ZeroIdeal C q n) + {u u' v v' x y : List S} + (hu : (u,u') ∈ table C E wf q z k) (hv : (v,v') ∈ table C E wf q z l) + (he : u = x++v++y) (hlen : u.length ≤ n) : + Join (Steps rs) u' (x++v'++y) := by + obtain ⟨a,_,_,_,rfl,rfl⟩ := (mem_table C E wf q z).mp hu + obtain ⟨b,_,hbn,_,rfl,rfl⟩ := (mem_table C E wf q z).mp hv + exact ⟨output C wf q z a, .refl, + occurrence_normalizes C E wf q z hzero hz ht hc hi hlen hbn he⟩ + +theorem critical_overlap {n k l : ℕ} {rs : List (List S × List S)} + (hzero : q [] ≠ none) (hz : Absorbs rs z) + (ht : ∀ p ∈ table C E wf q z n, p ∈ rs) + (hc : Contextual C q n) (hi : ZeroIdeal C q n) + {u u' v v' x middle y : List S} + (hu : (u,u') ∈ table C E wf q z k) (hv : (v,v') ∈ table C E wf q z l) + (hm : middle ≠ []) (he : u = x++middle) (hf : v = middle++y) + (hlen : (x++middle++y).length ≤ n) : + Join (Steps rs) (u'++y) (x++v') := by + obtain ⟨a,_,_,_,rfl,rfl⟩ := (mem_table C E wf q z).mp hu + obtain ⟨b,_,_,_,rfl,rfl⟩ := (mem_table C E wf q z).mp hv + obtain ⟨c,d,e,rfl,rfl,rfl,rfl,rfl⟩ := C.overlap_decode hm he hf + have hlen' : (C.encode (c++d++e)).length ≤ n := by + simpa only [DelimiterCode.encode_append] using hlen + refine ⟨output C wf q z (c++d++e), ?_, ?_⟩ + · simpa only [List.nil_append, DelimiterCode.encode_nil] using + branch_normalizes C E wf q z hzero hz ht hc hi (a := []) (v := c++d) (b := e) + (by simpa only [List.nil_append] using hlen') + · simpa only [List.append_nil, DelimiterCode.encode_nil, List.append_assoc] using + branch_normalizes C E wf q z hzero hz ht hc hi (a := c) (v := d++e) (b := []) + (by simpa only [List.append_nil, List.append_assoc] using hlen') + +theorem decreasing (n : ℕ) : ∀ p ∈ table C E wf q z n, List.Shortlex r p.2 p.1 := by + intro ⟨u,v⟩ hp + obtain ⟨w,_,hwn,hne,rfl,rfl⟩ := (mem_table C E wf q z).mp hp + by_cases hz : q w = none + · simp only [output, ite_eq_left hz] + apply List.Shortlex.of_length_lt + have hw := C.length_le_encode w + have hp : 0 < w.length := List.length_pos_iff.mpr hwn + simp only [List.length_singleton] + omega + · simp only [output, ite_eq_right hz] at hne ⊢ + rcases EncodedCanonical.least_lt_or_eq C wf q w with h | h + · exact h + · exact (hne (by rw [h])).elim + +theorem stable {k n : ℕ} (hkn : k ≤ n) : + Selectors.BoundedEq (table C E wf q z k) (table C E wf q z n) k := by + intro ⟨u,v⟩ hlen + rw [mem_table, mem_table] + constructor + · rintro ⟨w,hw,hn,he,rfl,rfl⟩ + exact ⟨w,hw.trans hkn,hn,he,rfl,rfl⟩ + · rintro ⟨w,hw,hn,he,rfl,rfl⟩ + exact ⟨w,hlen,hn,he,rfl,rfl⟩ +end CodeTable +end SimpleFInftyOvergroups.ContextualEncoding + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleOvergroups/ContractedNormalForms.lean b/lean/OAI/GroupTheory/SimpleOvergroups/ContractedNormalForms.lean new file mode 100644 index 0000000000000000000000000000000000000000..2acbe55fc6346634cce53bb7d9017bde786e3757 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleOvergroups/ContractedNormalForms.lean @@ -0,0 +1,112 @@ +import Mathlib +import OAI.GroupTheory.BooneHigman.Basic +import OAI.GroupTheory.BooneHigman.Contracted +import OAI.GroupTheory.SimpleOvergroups.TruncatedAlgebra + +namespace OAI + + +namespace SimpleFInftyOvergroups.SemanticEncoding +noncomputable section +open FiniteAlgebraicEnvelopes +open scoped Classical + +structure NormalPresentation (M K : Type*) [Monoid M] [MonoidWithZero K] where + q : M →* K + surjective : Function.Surjective q + normal : M → M + omega : M + zero : q omega = 0 + complete : ∀ u v, q u = q v ↔ normal u = normal v + idempotent : ∀ u, normal (normal u) = normal u + fixesZero : normal omega = omega + +namespace NormalPresentation +variable {M K : Type*} [Monoid M] [MonoidWithZero K] (P : NormalPresentation M K) +variable (k : Type*) [CommRing k] + + theorem q_normal (w : M) : P.q (P.normal w) = P.q w := + (P.complete _ _).mpr (P.idempotent w) + + theorem normal_eq_zero_iff (w : M) : P.normal w = P.omega ↔ P.q w = 0 := by + rw [← P.fixesZero, ← P.complete, P.zero] + +def representative (h : K) : M := P.normal (P.surjective h).choose + + theorem representative_q (w : M) : P.representative (P.q w) = P.normal w := by + apply (P.complete _ _).mp + exact (P.surjective _).choose_spec + + theorem q_representative (h : K) : P.q (P.representative h) = h := + (P.q_normal _).trans (P.surjective h).choose_spec + + theorem representative_injective : Function.Injective P.representative := by + intro a b h + simpa only [P.q_representative] using congrArg P.q h + +def algebraMap : MonoidAlgebra k M →ₐ[k] Contracted.Algebra k K := + (Contracted.quotient k K).comp (MonoidAlgebra.mapDomainAlgHom k k P.q) + +@[simp] theorem algebraMap_single (w : M) (c : k) : + P.algebraMap k (MonoidAlgebra.single w c) = Contracted.basis k K (P.q w) c := by + simp [algebraMap, Contracted.basis] + +def sectionMap : Contracted.Algebra k K →ₗ[k] MonoidAlgebra k M := + (Contracted.monoidBasis (k:=k) (H:=K)).constr k + (fun h => MonoidAlgebra.single (P.representative h.val) 1) + + theorem sectionMap_basis (h : K) (c : k) : + P.sectionMap k (Contracted.basis k K h c) = + if h = 0 then 0 else MonoidAlgebra.single (P.representative h) c := by + by_cases hh : h = 0 + · simp [hh] + · have he : Contracted.basis k K h c = c • Contracted.basis k K h 1 := by + simp only [Contracted.basis, ← map_smul, MonoidAlgebra.smul_single, smul_eq_mul, mul_one] + rw [he, map_smul, ite_eq_right hh] + have hb := (Contracted.monoidBasis (k:=k) (H:=K)).constr_basis + k (fun h => MonoidAlgebra.single (P.representative h.val) (1:k)) ⟨h,hh⟩ + rw [Contracted.monoidBasis_apply] at hb + change P.sectionMap k (Contracted.basis k K h 1) = _ at hb + rw [hb] + simp + + theorem algebraMap_section (x : Contracted.Algebra k K) : + P.algebraMap k (P.sectionMap k x) = x := by + have he : (P.algebraMap k).toLinearMap.comp (P.sectionMap k) = LinearMap.id := by + apply (Contracted.monoidBasis (k:=k) (H:=K)).ext + intro h + simp only [LinearMap.comp_apply, AlgHom.toLinearMap_apply, + Contracted.monoidBasis_apply, P.sectionMap_basis, ite_eq_right h.property, + P.algebraMap_single, P.q_representative, LinearMap.id_apply] + exact LinearMap.congr_fun he x + + theorem sectionMap_injective : Function.Injective (P.sectionMap k) := + Function.LeftInverse.injective (P.algebraMap_section k) + + theorem algebraMap_surjective : Function.Surjective (P.algebraMap k) := + Function.RightInverse.surjective (P.algebraMap_section k) + + theorem section_algebraMap_single (w : M) (c : k) : + P.sectionMap k (P.algebraMap k (MonoidAlgebra.single w c)) = + if P.normal w = P.omega then 0 else MonoidAlgebra.single (P.normal w) c := by + rw [P.algebraMap_single, P.sectionMap_basis, P.representative_q, P.normal_eq_zero_iff] + + theorem section_algebraMap {m : ℕ} (C : BoundedEncoding.WordCalculus M m) + (hn : C.normal = P.normal) (hz : C.omega = P.omega) (a : MonoidAlgebra k M) : + P.sectionMap k (P.algebraMap k a) = C.collect k a := by + induction a using MonoidAlgebra.induction_linear with + | zero => simp + | add a b ha hb => simp only [map_add,ha,hb] + | single w c => simp only [P.section_algebraMap_single, C.collect_single, hn, hz] + + theorem algebraMap_eq_iff_collect {m : ℕ} (C : BoundedEncoding.WordCalculus M m) + (hn : C.normal = P.normal) (hz : C.omega = P.omega) (a b : MonoidAlgebra k M) : + P.algebraMap k a = P.algebraMap k b ↔ C.collect k a = C.collect k b := by + rw [← P.section_algebraMap k C hn hz a, ← P.section_algebraMap k C hn hz b] + exact P.sectionMap_injective k |>.eq_iff.symm + +end NormalPresentation +end +end SimpleFInftyOvergroups.SemanticEncoding + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleOvergroups/DoubleEffective.lean b/lean/OAI/GroupTheory/SimpleOvergroups/DoubleEffective.lean new file mode 100644 index 0000000000000000000000000000000000000000..1e51e5db7e489367366c2043d49c6fe5bd82164a --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleOvergroups/DoubleEffective.lean @@ -0,0 +1,159 @@ +import Mathlib +import OAI.GroupTheory.SimpleOvergroups.EnlargementEffective +import OAI.GroupTheory.SimpleOvergroups.MatrixEffective +import OAI.GroupTheory.SimpleOvergroups.EffectiveActions + +namespace OAI + + +namespace SimpleFInftyOvergroups.EffectiveNames.Double +open BoundedEncoding NamedAction +noncomputable section +open scoped Classical + +variable {A k₀ k₁ k₂ P₁ P₂ : Type*} + [CommRing k₀] [CommRing k₁] [CommRing k₂] + [Primcodable A] [Primcodable k₀] [Primcodable k₁] [Primcodable k₂] + [Finite k₀] [Finite k₁] [Finite k₂] + [Primcodable P₁] [Primcodable P₂] [Finite P₁] [Finite P₂] + {n : ℕ} + +abbrev G₀ (k A : Type*) (n : ℕ) := MatrixWords.Word k A n +abbrev X₀ (k A : Type*) (n : ℕ) := MatrixWords.Point k A n +abbrev G₁ (P k A : Type*) (n : ℕ) := Enlargement.Word P (G₀ k A n) +abbrev X₁ (P k A : Type*) (n : ℕ) := Enlargement.Point P (G₀ k A n) (X₀ k A n) +abbrev G₂ (P₁ P₂ k A : Type*) (n : ℕ) := Enlargement.Word P₂ (G₁ P₁ k A n) +abbrev X₂ (P₁ P₂ k A : Type*) (n : ℕ) := Enlargement.Point P₂ (G₁ P₁ k A n) (X₁ P₁ k A n) + +abbrev base (grade : List A → ℕ) := MatrixWords.nameOperations (k:=k₀) (n:=n) grade +abbrev first (grade : List A → ℕ) := Enlargement.operations (P:=P₁) (base (k₀:=k₀) (n:=n) grade) +abbrev operations (grade : List A → ℕ) := + Enlargement.operations (P:=P₂) (first (P₁:=P₁) (k₀:=k₀) (n:=n) grade) + +variable (e₁ : P₁ → Enlargement.Coeff.Name k₁) (e₂ : P₂ → Enlargement.Coeff.Name k₂) +variable (grade : List A → ℕ) (omega : List A) (f : List A → Part (List A)) + +def partialGroupKey : G₂ P₁ P₂ k₀ A n → Part (ℕ × ℕ) := + Enlargement.partialGroupKey (first grade) e₂ + (Enlargement.partialGroupKey (base grade) e₁ + (MatrixWords.partialGroupKey (k:=k₀) (n:=n) omega f)) + +def partialPointKey : X₂ P₁ P₂ k₀ A n → Part ℕ := + Enlargement.partialPointKey (first grade) e₂ + (Enlargement.partialPointKey (base grade) e₁ + (MatrixWords.partialPointKey (k:=k₀) (n:=n) omega f)) + +def test (w : List (Letter (G₂ P₁ P₂ k₀ A n) (X₂ P₁ P₂ k₀ A n))) : + Part (Result (ℕ × ℕ) ℕ) := + (operations grade).test (partialGroupKey e₁ e₂ grade omega f) + (partialPointKey e₁ e₂ grade omega f) w + +variable {m : ℕ} (C : WordCalculus (FreeMonoid A) m) +attribute [local instance] WordCalculus.rawMatrixAction + +abbrev calculus := Enlargement.calculus (k:=k₂) + (Enlargement.calculus (k:=k₁) (MatrixWords.calculus (k:=k₀) (n:=n) C)) + +variable (he₁ : ∀ p, Enlargement.Coeff.value (e₁ p) * Enlargement.Coeff.value (e₁ p) = + Enlargement.Coeff.value (e₁ p)) + (he₂ : ∀ p, Enlargement.Coeff.value (e₂ p) * Enlargement.Coeff.value (e₂ p) = + Enlargement.Coeff.value (e₂ p)) + +abbrev interpret₁ := Enlargement.interpretation (base (MatrixWords.grade C)) e₁ + (MatrixWords.interpretation (k:=k₀) (n:=n) C) he₁ + +abbrev interpretation := Enlargement.interpretation (first (MatrixWords.grade C)) e₂ + (interpret₁ (k₀:=k₀) (n:=n) e₁ C he₁) he₂ + +omit [Finite k₁] [Finite k₂] [Primcodable P₁] [Primcodable P₂] [Finite P₁] [Finite P₂] in + theorem partialGroupKey_full {d : ℕ} (w : G₂ P₁ P₂ k₀ A n) + (hw : (operations (MatrixWords.grade C)).gcost w ≤ d) + (hf : ∀ u, MatrixWords.grade C u ≤ d → + (C.normal (FreeMonoid.ofList u)).toList ∈ f u) : + (interpretation e₁ e₂ C he₁ he₂).gkey w ∈ + partialGroupKey e₁ e₂ (MatrixWords.grade C) C.omega.toList f w := by + apply Enlargement.partialGroupKey_full _ _ _ _ _ _ hw + intro g hg + apply Enlargement.partialGroupKey_full _ _ _ _ _ _ hg + intro h hh + exact MatrixWords.partialGroupKey_full C f h hh hf + +omit [Finite k₁] [Finite k₂] [Primcodable P₁] [Primcodable P₂] [Finite P₁] [Finite P₂] in + theorem partialPointKey_full {d : ℕ} (x : X₂ P₁ P₂ k₀ A n) + (hx : (operations (MatrixWords.grade C)).xcost x ≤ d) + (hf : ∀ u, MatrixWords.grade C u ≤ d → + (C.normal (FreeMonoid.ofList u)).toList ∈ f u) : + (interpretation e₁ e₂ C he₁ he₂).xkey x ∈ + partialPointKey e₁ e₂ (MatrixWords.grade C) C.omega.toList f x := by + apply Enlargement.partialPointKey_full _ _ _ _ _ _ hx + intro y hy + apply Enlargement.partialPointKey_full _ _ _ _ _ _ hy + intro z hz + exact MatrixWords.partialPointKey_full C f z hz hf + +omit [Finite k₁] [Finite k₂] [Primcodable P₁] [Primcodable P₂] [Finite P₁] [Finite P₂] in + theorem test_full {d : ℕ} (w : List (Letter (G₂ P₁ P₂ k₀ A n) (X₂ P₁ P₂ k₀ A n))) + (hw : (operations (MatrixWords.grade C)).wordCost w ≤ d) + (hf : ∀ u, MatrixWords.grade C u ≤ d → + (C.normal (FreeMonoid.ofList u)).toList ∈ f u) : + (operations (MatrixWords.grade C)).totalTest + (interpretation e₁ e₂ C he₁ he₂).gkey (interpretation e₁ e₂ C he₁ he₂).xkey w ∈ + test e₁ e₂ (MatrixWords.grade C) C.omega.toList f w := by + exact Operations.test_full _ _ _ _ _ + (fun g hg => partialGroupKey_full e₁ e₂ f C he₁ he₂ g hg hf) + (fun x hx => partialPointKey_full e₁ e₂ f C he₁ he₂ x hx hf) w hw + + +local instance : Primcodable (G₂ P₁ P₂ k₀ A n) := inferInstance +local instance : Primcodable (X₂ P₁ P₂ k₀ A n) := inferInstance + + theorem primrec_inv_base : Primrec ((base (k₀:=k₀) (n:=n) grade).inv) := MatrixWords.primrec_inverse +omit [Finite k₀] in + theorem primrec_act_base : Primrec₂ ((base (k₀:=k₀) (n:=n) grade).act) := + (Primrec.list_append.comp Primrec.fst (Primrec.fst.comp Primrec.snd)).pair + (Primrec.snd.comp Primrec.snd) +omit [Finite P₁] in + theorem primrec_inv_first : Primrec ((first (P₁:=P₁) (k₀:=k₀) (n:=n) grade).inv) := + Enlargement.primrec_inverse _ (primrec_inv_base grade) +omit [Finite P₁] [Finite P₂] in + theorem primrec_plan : Primrec₂ ((operations (P₁:=P₁) (P₂:=P₂) (k₀:=k₀) (n:=n) grade).plan) := + Enlargement.primrec_plan _ (primrec_inv_first grade) + +variable {Param : Type*} [Primcodable Param] {F : Param → List A → Part (List A)} + + theorem partrec_partialGroupKey (hF : Partrec₂ F) : + Partrec₂ (fun p : Param => partialGroupKey (k₀:=k₀) (n:=n) e₁ e₂ grade omega (F p)) := + Enlargement.partrec_partialGroupKey _ e₂ Primrec.list_append (primrec_inv_first grade) + (Enlargement.partrec_partialGroupKey _ e₁ Primrec.list_append (primrec_inv_base grade) + (MatrixWords.partrec_partialGroupKey omega hF)) + + theorem partrec_partialPointKey (hF : Partrec₂ F) : + Partrec₂ (fun p : Param => partialPointKey (k₀:=k₀) (n:=n) e₁ e₂ grade omega (F p)) := + Enlargement.partrec_partialPointKey _ e₂ Primrec.list_append (Enlargement.primrec_act _) + (Enlargement.partrec_partialPointKey _ e₁ Primrec.list_append (primrec_act_base grade) + (MatrixWords.partrec_partialPointKey omega hF)) + + theorem partrec_test (hF : Partrec₂ F) : + Partrec₂ (fun p : Param => test (k₀:=k₀) (n:=n) e₁ e₂ grade omega (F p)) := + Operations.partrec_test _ (primrec_plan grade).to_comp + (partrec_partialGroupKey e₁ e₂ grade omega hF) (partrec_partialPointKey e₁ e₂ grade omega hF) + +omit [Finite P₁] [Finite P₂] in + theorem primrec_gcost (hg : Primrec grade) : + Primrec ((operations (P₁:=P₁) (P₂:=P₂) (k₀:=k₀) (n:=n) grade).gcost) := + Enlargement.primrec_gcost _ (Enlargement.primrec_gcost _ (MatrixWords.primrec_gcost hg)) + +omit [Finite P₁] [Finite P₂] in + theorem primrec_xcost (hg : Primrec grade) : + Primrec ((operations (P₁:=P₁) (P₂:=P₂) (k₀:=k₀) (n:=n) grade).xcost) := + Enlargement.primrec_xcost _ (Enlargement.primrec_gcost _ (MatrixWords.primrec_gcost hg)) + (Enlargement.primrec_xcost _ (MatrixWords.primrec_gcost hg) (MatrixWords.primrec_xcost hg)) + +omit [Finite P₁] [Finite P₂] in + theorem primrec_cost (hg : Primrec grade) : + Primrec ((operations (P₁:=P₁) (P₂:=P₂) (k₀:=k₀) (n:=n) grade).letterCost) := + (operations grade).primrec_letterCost (primrec_gcost grade hg) (primrec_xcost grade hg) +end +end SimpleFInftyOvergroups.EffectiveNames.Double + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleOvergroups/EffectiveActions.lean b/lean/OAI/GroupTheory/SimpleOvergroups/EffectiveActions.lean new file mode 100644 index 0000000000000000000000000000000000000000..7bcc4656183cd678f742be41b86651f466e588b7 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleOvergroups/EffectiveActions.lean @@ -0,0 +1,206 @@ +import Mathlib +import OAI.Computability.FiniteCompiler.Effectivity +import OAI.Computability.FiniteCompiler.Quotients +import OAI.Computability.FiniteCompiler.Rewriting +import OAI.Computability.FiniteCompiler.Selectors +import OAI.GroupTheory.BooneHigman.Basic +import OAI.GroupTheory.SimpleOvergroups.EffectiveFold +import OAI.GroupTheory.SimpleOvergroups.NamedActions + +namespace OAI + + + +namespace SimpleFInftyOvergroups.BoundedEncoding.NamedAction +open FiniteAlgebraicEnvelopes FiniteAlgebraicEnvelopes.Bootstrap +namespace Operations +variable {G X K L : Type*} (N : Operations G X) [DecidableEq L] + +def compare (fx : X → Part L) (x y : X) : Part Bool := + (fx x).bind fun a => (fx y).map fun b => decide (a=b) + +def step (fx : X → Part L) (a : Letter G X) (f : Form G X) : Part (Form G X) := + (N.plan a f).elim Part.some (fun p => + (compare fx p.1 p.2.1).map (fun b => bif b then p.2.2 else none)) + +def run (N : Operations G X) (fx : X → Part L) : List (Letter G X) → Form G X → Part (Form G X) + | [], f => Part.some f + | a::w, f => (run N fx w f).bind (N.step fx a) + +def key (fg : G → Part K) (fx : X → Part L) : Form G X → Part (Result K L) + | none => Part.some none + | some (l,g,r) => (fg g).bind fun k => + (Effect.traverse fx l).bind fun ls => + (Effect.traverse fx r).map fun rs => some (ls,k,rs) + +def test (fg : G → Part K) (fx : X → Part L) (w : List (Letter G X)) : + Part (Result K L) := + (N.run fx w (some ([],N.one,[]))).bind (key fg fx) + +theorem compare_full (fx : X → Part L) (kx : X → L) {x y : X} + (hx : kx x ∈ fx x) (hy : kx y ∈ fx y) : + decide (kx x = kx y) ∈ compare fx x y := + Part.mem_bind_iff.mpr ⟨_,hx,Part.mem_map _ hy⟩ + +theorem step_full (fx : X → Part L) (kx : X → L) {d : ℕ} + (hx : ∀ x, N.xcost x ≤ d → kx x ∈ fx x) + (a : Letter G X) (f : Form G X) (hb : N.letterCost a + N.formCost f ≤ d) : + N.totalStep kx a f ∈ N.step fx a f := by + cases f with + | none => exact Part.mem_some _ + | some p => + rcases p with ⟨l,g,r⟩ + rcases a with h | (x | y) + · cases l <;> exact Part.mem_some _ + · exact Part.mem_some _ + · cases y with + | none => exact Part.mem_some _ + | some y => + cases l with + | nil => exact Part.mem_some _ + | cons x l => + have hy : N.xcost y ≤ d := by simp only [letterCost,formCost] at hb; omega + have hh : N.xcost x ≤ d := by + simp only [letterCost,formCost,List.map_cons,List.sum_cons] at hb; omega + have ht := compare_full fx kx (hx _ hy) (hx _ hh) + simpa only [step,plan,totalStep,Sum.elim_inr,Bool.cond_decide] using + Part.mem_map (fun b => bif b then some (l,g,r) else none) ht + +theorem run_full (fx : X → Part L) (kx : X → L) {d : ℕ} + (hx : ∀ x, N.xcost x ≤ d → kx x ∈ fx x) + (w : List (Letter G X)) (f : Form G X) (hb : N.wordCost w + N.formCost f ≤ d) : + N.totalRun kx w f ∈ N.run fx w f := by + induction w with + | nil => exact Part.mem_some _ + | cons a w ih => + refine Part.mem_bind_iff.mpr ⟨N.totalRun kx w f,ih ?_,N.step_full fx kx hx a _ ?_⟩ + · rw [wordCost_cons] at hb; omega + · have hc := N.totalRun_cost kx w f + rw [wordCost_cons] at hb + omega + +omit [DecidableEq L] in +theorem key_full (fg : G → Part K) (fx : X → Part L) (kg : G → K) (kx : X → L) + {d : ℕ} (hg : ∀ g, N.gcost g ≤ d → kg g ∈ fg g) + (hx : ∀ x, N.xcost x ≤ d → kx x ∈ fx x) + (f : Form G X) (hb : N.formCost f ≤ d) : formKey kg kx f ∈ key fg fx f := by + cases f with + | none => exact Part.mem_some _ + | some p => + rcases p with ⟨l,g,r⟩ + change (l.map N.xcost).sum + N.gcost g + (r.map N.xcost).sum ≤ d at hb + have hl : l.map kx ∈ Effect.traverse fx l := by + apply Search.traverse_map + intro x hm + apply hx + have hh : N.xcost x ≤ (l.map N.xcost).sum := List.single_le_sum (by simp) _ + (List.mem_map.mpr ⟨x,hm,rfl⟩) + omega + have hr : r.map kx ∈ Effect.traverse fx r := by + apply Search.traverse_map + intro x hm + apply hx + have hh : N.xcost x ≤ (r.map N.xcost).sum := List.single_le_sum (by simp) _ + (List.mem_map.mpr ⟨x,hm,rfl⟩) + omega + exact Part.mem_bind_iff.mpr ⟨_,hg g (by omega),Part.mem_bind_iff.mpr ⟨_,hl,Part.mem_map _ hr⟩⟩ + +theorem test_full (fg : G → Part K) (fx : X → Part L) (kg : G → K) (kx : X → L) + {d : ℕ} (hg : ∀ g, N.gcost g ≤ d → kg g ∈ fg g) + (hx : ∀ x, N.xcost x ≤ d → kx x ∈ fx x) + (w : List (Letter G X)) (hb : N.wordCost w ≤ d) : + N.totalTest kg kx w ∈ N.test fg fx w := by + apply Part.mem_bind_iff.mpr + refine ⟨N.totalNormalize kx w,?_,N.key_full fg fx kg kx hg hx _ ((N.totalNormalize_cost kx w).trans hb)⟩ + apply N.run_full fx kx hx + simpa only [formCost,List.map_nil,List.sum_nil,N.cost_one,zero_add,add_zero] using hb + +variable {P : Type*} [Primcodable P] [Primcodable G] [Primcodable X] + [Primcodable K] [Primcodable L] +variable {fg : P → G → Part K} {fx : P → X → Part L} + +theorem partrec_compare (hx : Partrec₂ fx) : + Partrec (fun p : P × X × X => compare (fx p.1) p.2.1 p.2.2) := by + have ha : Partrec (fun p : P × X × X => fx p.1 p.2.1) := + hx.comp Computable.fst (Computable.fst.comp Computable.snd) + apply ha.bind + have hb : Partrec (fun p : (P × X × X) × L => fx p.1.1 p.1.2.2) := + hx.comp (Computable.fst.comp Computable.fst) + (Computable.snd.comp (Computable.snd.comp Computable.fst)) + exact (hb.map (Primrec.eq.decide.to_comp.comp + (Computable.snd.comp Computable.fst) Computable.snd).to₂).to₂ + +theorem partrec_step (hn : Computable₂ N.plan) (hx : Partrec₂ fx) : + Partrec (fun p : P × Letter G X × Form G X => N.step (fx p.1) p.2.1 p.2.2) := by + let S := P × Letter G X × Form G X + have hp : Computable (fun p : S => N.plan p.2.1 p.2.2) := + hn.comp (Computable.fst.comp Computable.snd) (Computable.snd.comp Computable.snd) + have hb : Partrec₂ (fun (s : S) (p : X × X × Form G X) => + (compare (fx s.1) p.1 p.2.1).map (fun b => bif b then p.2.2 else none)) := by + have hc : Partrec (fun p : S × (X × X × Form G X) => + compare (fx p.1.1) p.2.1 p.2.2.1) := + (partrec_compare hx).comp ((Computable.fst.comp Computable.fst).pair + ((Computable.fst.comp Computable.snd).pair + (Computable.fst.comp (Computable.snd.comp Computable.snd)))) + exact (hc.map (Computable.cond Computable.snd + (Computable.snd.comp (Computable.snd.comp (Computable.snd.comp Computable.fst))) + (Computable.const none)).to₂).to₂ + exact (Partrec.sumCasesOn_right hp Computable.snd.to₂ hb).of_eq + (by intro p; unfold step; cases N.plan p.2.1 p.2.2 <;> rfl) + +omit [Primcodable P] [Primcodable G] [Primcodable X] [Primcodable L] in +theorem run_eq_fold (p : P) (w : List (Letter G X)) (f : Form G X) : + N.run (fx p) w f = EffectiveNames.PartialFold.right + (fun s : P × Letter G X × Form G X => N.step (fx s.1) s.2.1 s.2.2) p w f := by + induction w with + | nil => rfl + | cons a w ih => simp only [run,EffectiveNames.PartialFold.right,ih] + +theorem partrec_run (hn : Computable₂ N.plan) (hx : Partrec₂ fx) : + Partrec (fun p : P × List (Letter G X) × Form G X => N.run (fx p.1) p.2.1 p.2.2) := + (EffectiveNames.PartialFold.partrec_right _ (N.partrec_step hn hx)).of_eq + (fun ⟨p,w,f⟩ => (N.run_eq_fold p w f).symm) + +omit [DecidableEq L] in +theorem partrec_key (hg : Partrec₂ fg) (hx : Partrec₂ fx) : + Partrec₂ (fun p : P => key (fg p) (fx p)) := by + let S := P × Form G X + have hs : Partrec₂ (fun (s : S) (t : List X × G × List X) => + (fg s.1 t.2.1).bind fun k => + (Effect.traverse (fx s.1) t.1).bind fun ls => + (Effect.traverse (fx s.1) t.2.2).map fun rs => some (ls,k,rs)) := by + have hf : Partrec (fun p : S × (List X × G × List X) => fg p.1.1 p.2.2.1) := + hg.comp (Computable.fst.comp Computable.fst) + (Computable.fst.comp (Computable.snd.comp Computable.snd)) + apply hf.bind + have hl : Partrec (fun p : (S × (List X × G × List X)) × K => + Effect.traverse (fx p.1.1.1) p.1.2.1) := + (Effect.partrec_traverse_parameter hx).comp + (Computable.fst.comp (Computable.fst.comp Computable.fst)) + (Computable.fst.comp (Computable.snd.comp Computable.fst)) + apply hl.bind + have hr : Partrec (fun p : ((S × (List X × G × List X)) × K) × List L => + Effect.traverse (fx p.1.1.1.1) p.1.1.2.2.2) := + (Effect.partrec_traverse_parameter hx).comp + (Computable.fst.comp (Computable.fst.comp (Computable.fst.comp Computable.fst))) + (Computable.snd.comp (Computable.snd.comp (Computable.snd.comp + (Computable.fst.comp Computable.fst)))) + exact (hr.map (Computable.option_some.comp + ((Computable.snd.comp Computable.fst).pair + ((Computable.snd.comp (Computable.fst.comp Computable.fst)).pair Computable.snd))).to₂).to₂ + exact (Partrec.optionCasesOn_right Computable.snd (Computable.const none) hs).of_eq + (by intro ⟨p,f⟩; cases f <;> rfl) + +theorem partrec_test (hn : Computable₂ N.plan) (hg : Partrec₂ fg) (hx : Partrec₂ fx) : + Partrec₂ (fun p : P => N.test (fg p) (fx p)) := by + have hr : Partrec (fun p : P × List (Letter G X) => + N.run (fx p.1) p.2 (some ([],N.one,[]))) := + (N.partrec_run hn hx).comp (Computable.fst.pair + (Computable.snd.pair (Computable.const (some ([],N.one,[]))))) + exact hr.bind ((partrec_key hg hx).comp + (Computable.fst.comp Computable.fst) Computable.snd).to₂ + +end Operations +end SimpleFInftyOvergroups.BoundedEncoding.NamedAction + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleOvergroups/EffectiveArrays.lean b/lean/OAI/GroupTheory/SimpleOvergroups/EffectiveArrays.lean new file mode 100644 index 0000000000000000000000000000000000000000..b79fc193be30ae46d83cd4b37fdadcd4596819ad --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleOvergroups/EffectiveArrays.lean @@ -0,0 +1,60 @@ +import Mathlib +import OAI.Computability.FiniteCompiler.Effectivity +import OAI.Computability.FiniteCompiler.Selectors +import OAI.GroupTheory.BooneHigman.Basic +import OAI.GroupTheory.SimpleOvergroups.ArrayNames +import OAI.GroupTheory.SimpleOvergroups.CanonicalNames + +namespace OAI + + +namespace SimpleFInftyOvergroups.EffectiveNames.Array +open FiniteAlgebraicEnvelopes +noncomputable section +open scoped Classical +variable {A X J D : Type*} [AddCommMonoid D] [Primcodable A] [Primcodable X] [Primcodable J] + (coeff : A → D) + +def collect (f : X → Part J) (p : Name A X) : Part (Name A J) := + Effect.traverse (fun a => (f a.2).map (fun k => (a.1,k))) p + +def collectedKey (f : X → Part J) (p : Name A X) : Part ℕ := + (collect f p).map (key (value coeff id)) + +omit [Primcodable A] [Primcodable X] [Primcodable J] in +theorem collect_full (f : X → Part J) (g : X → J) (p : Name A X) + (h : ∀ a ∈ p, g a.2 ∈ f a.2) : + p.map (fun a => (a.1,g a.2)) ∈ collect f p := by + apply FiniteAlgebraicEnvelopes.Bootstrap.Search.traverse_map + intro a ha + exact Part.mem_map _ (h a ha) + +omit [Primcodable X] in +theorem collectedKey_full (hc : Function.Surjective coeff) (f : X → Part J) + {K : Type*} (index : X → K) (g : K → J) (p : Name A X) + (h : ∀ a ∈ p, g (index a.2) ∈ f a.2) : + semanticKey (value coeff id) (value_surjective coeff id hc Function.surjective_id) + (Finsupp.mapDomain g (value coeff index p)) ∈ collectedKey coeff f p := by + rw [← value_map_index coeff index (g ∘ index) id g (fun _ => rfl) p, + semanticKey_value] + exact Part.mem_map _ (collect_full f (g ∘ index) p h) + +variable {P : Type*} [Primcodable P] {f : P → X → Part J} + +theorem partrec_collect (hf : Partrec₂ f) : + Partrec₂ (fun p : P => (collect (f p) : Name A X → Part (Name A J))) := by + have hc : Partrec₂ (fun (p : P) (a : A × X) => + (f p a.2).map (fun k => (a.1,k))) := by + exact ((hf.comp Computable.fst (Computable.snd.comp Computable.snd)).map + ((Computable.fst.comp (Computable.snd.comp Computable.fst)).pair Computable.snd).to₂).to₂ + exact Effect.partrec_traverse_parameter hc + +theorem partrec_collectedKey (heq : ComputablePred + (fun p : Name A J × Name A J => value coeff id p.1 = value coeff id p.2)) + (hf : Partrec₂ f) : Partrec₂ (fun p : P => collectedKey coeff (f p)) := by + exact (partrec_collect hf).map (((computable_key (value coeff id) heq).comp Computable.snd).to₂) + +end +end SimpleFInftyOvergroups.EffectiveNames.Array + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleOvergroups/EffectiveCode.lean b/lean/OAI/GroupTheory/SimpleOvergroups/EffectiveCode.lean new file mode 100644 index 0000000000000000000000000000000000000000..55c1b3a747d0c448b7ffa5e58d4a1c59e30e7207 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleOvergroups/EffectiveCode.lean @@ -0,0 +1,161 @@ +import Mathlib +import OAI.GroupTheory.SimpleOvergroups.VariableCode + +namespace OAI + + +namespace SimpleFInftyOvergroups.ContextualEncoding + +namespace PaddedCode +section Syntax +variable {A : Type*} [Encodable A] + +def body (cost : A → ℕ) (a : A) : List (Fin 4) := + List.replicate (Encodable.encode a) 0 ++ 1 :: List.replicate (10 * cost a) 0 + +def code (cost : A → ℕ) : DelimiterCode A (Fin 4) where + start := 2 + stop := 3 + distinct := by decide + body := body cost + start_avoids := by intro a; simp [body] + stop_avoids := by intro a; simp [body] + injective := by + intro a b he + have hi (a : A) : (body cost a).idxOf 1 = Encodable.encode a := by + rw [body, List.idxOf_append_of_notMem (by simp)] + simp + apply Encodable.encode_injective + simpa only [hi] using congrArg (List.idxOf 1) he + +@[simp] theorem block_length (cost : A → ℕ) (a : A) : + ((code cost).block a).length = Encodable.encode a + 10 * cost a + 3 := by + simp [DelimiterCode.block_length, code, body] + omega + +theorem descriptor_le_length (cost : A → ℕ) (a : A) : + Encodable.encode a ≤ ((code cost).block a).length := by + rw [block_length]; omega + +theorem cost_padding (cost : A → ℕ) (a : A) : + 10 * cost a + 2 ≤ ((code cost).block a).length := by + rw [block_length]; omega + +def symbols (n : ℕ) : List A := (List.range (n + 1)).filterMap (Encodable.decode (α := A)) + +theorem mem_symbols_of_encode_le {a : A} {n : ℕ} (ha : Encodable.encode a ≤ n) : + a ∈ symbols n := by + apply List.mem_filterMap.mpr + exact ⟨Encodable.encode a, List.mem_range.mpr (by omega), Encodable.encodek a⟩ + +def wordsOver (xs : List A) : ℕ → List (List A) + | 0 => [[]] + | n + 1 => [] :: xs.flatMap (fun a => (wordsOver xs n).map (a :: ·)) + +omit [Encodable A] in +@[simp] theorem mem_wordsOver [Encodable A] (xs : List A) (n : ℕ) (w : List A) : + w ∈ wordsOver xs n ↔ w.length ≤ n ∧ ∀ a ∈ w, a ∈ xs := by + induction n generalizing w with + | zero => + cases w <;> simp [wordsOver] + | succ n ih => + cases w with + | nil => simp [wordsOver] + | cons a w => + rw [wordsOver, List.mem_cons] + constructor + · rintro (he | h) + · cases he + · obtain ⟨b, hb, h⟩ := List.mem_flatMap.mp h + obtain ⟨v, hv, he⟩ := List.mem_map.mp h + obtain ⟨rfl, rfl⟩ := List.cons.inj he + obtain ⟨hlen, hs⟩ := (ih v).mp hv + exact ⟨by simpa using Nat.succ_le_succ hlen, + by simpa [List.mem_cons] using And.intro hb hs⟩ + · rintro ⟨hlen, hs⟩ + right + refine List.mem_flatMap.mpr ⟨a, hs a List.mem_cons_self, + List.mem_map.mpr ⟨w, ?_, rfl⟩⟩ + exact (ih w).mpr ⟨by simpa using hlen, + fun b hb => hs b (List.mem_cons_of_mem _ hb)⟩ + +omit [Encodable A] in +theorem block_length_le_encode [Encodable A] (C : DelimiterCode A (Fin 4)) {a : A} {w : List A} + (ha : a ∈ w) : (C.block a).length ≤ (C.encode w).length := by + induction w with + | nil => simp at ha + | cons b w ih => + simp only [DelimiterCode.encode_cons, List.length_append] + rcases List.mem_cons.mp ha with rfl | ha + · omega + · have := ih ha; omega + +def words (cost : A → ℕ) (n : ℕ) : List (List A) := + (wordsOver (symbols n) n).filter fun w => ((code cost).encode w).length ≤ n + +@[simp] theorem mem_words (cost : A → ℕ) (n : ℕ) (w : List A) : + w ∈ words cost n ↔ ((code cost).encode w).length ≤ n := by + simp only [words, List.mem_filter, decide_eq_true_eq] + refine ⟨And.right, fun hw => ⟨?_, hw⟩⟩ + apply (mem_wordsOver _ _ _).mpr + refine ⟨?_, ?_⟩ + · have := (code cost).length_le_encode w + omega + · intro a ha + exact mem_symbols_of_encode_le + ((descriptor_le_length cost a).trans ((block_length_le_encode _ ha).trans hw)) + +theorem word_cost_bound (cost : A → ℕ) {n : ℕ} {w : List A} + (hw : w ∈ words cost n) : DelimiterCode.cost cost w ≤ n / 10 := + (code cost).cost_le_quota cost (cost_padding cost) ((mem_words _ _ _).mp hw) + +end Syntax + +variable {A : Type*} [Primcodable A] + +private theorem primrec_replicate (b : Fin 4) : Primrec (fun n => List.replicate n b) := + (Primrec.nat_rec₁ [] (Primrec.list_cons.comp (Primrec.const b) Primrec.snd).to₂).of_eq + (by intro n; induction n <;> simp_all [List.replicate_succ]) + +theorem primrec_block (cost : A → ℕ) (hc : Primrec cost) : + Primrec (code cost).block := by + exact Primrec.list_cons.comp (Primrec.const 2) + (Primrec.list_append.comp + (Primrec.list_append.comp + ((primrec_replicate 0).comp Primrec.encode) + (Primrec.list_cons.comp (Primrec.const 1) + ((primrec_replicate 0).comp + (Primrec.nat_mul.comp (Primrec.const 10) hc)))) + (Primrec.const [3])) + +theorem primrec_encode (cost : A → ℕ) (hc : Primrec cost) : + Primrec (code cost).encode := + Primrec.list_flatMap Primrec.id ((primrec_block cost hc).comp Primrec.snd).to₂ + +theorem primrec_symbols : Primrec (@symbols A _) := + Primrec.listFilterMap (Primrec.list_range.comp Primrec.succ) + (Primrec.decode.comp Primrec.snd).to₂ + +theorem primrec_wordsOver : Primrec₂ (@wordsOver A) := by + exact (Primrec.nat_rec (Primrec.const [[]]) + (Primrec.list_cons.comp (Primrec.const []) + (Primrec.list_flatMap Primrec.fst + (Primrec.list_map (Primrec.snd.comp (Primrec.snd.comp Primrec.fst)) + (Primrec.list_cons.comp (Primrec.snd.comp Primrec.fst) Primrec.snd).to₂).to₂)).to₂).of_eq + fun ls n => by induction n <;> simp_all [wordsOver] + +theorem primrec_words (cost : A → ℕ) (hc : Primrec cost) : Primrec (words cost) := by + have hfilter : Primrec (fun n => (wordsOver (symbols n) n).filterMap + (fun w => if ((code cost).encode w).length ≤ n then some w else none)) := + Primrec.listFilterMap (primrec_wordsOver.comp primrec_symbols Primrec.id) + (Primrec.ite (Primrec.nat_le.comp + (Primrec.list_length.comp ((primrec_encode cost hc).comp Primrec.snd)) + Primrec.fst) (Primrec.option_some.comp Primrec.snd) (Primrec.const none)).to₂ + apply hfilter.of_eq + intro n + simp only [words, ← List.filterMap_eq_filter, Option.guard, decide_eq_true_eq] + +end PaddedCode +end SimpleFInftyOvergroups.ContextualEncoding + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleOvergroups/EffectiveFamilies.lean b/lean/OAI/GroupTheory/SimpleOvergroups/EffectiveFamilies.lean new file mode 100644 index 0000000000000000000000000000000000000000..33e20027d9f708e389f1980a59efe26890a06fb0 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleOvergroups/EffectiveFamilies.lean @@ -0,0 +1,78 @@ +import Mathlib +import OAI.GroupTheory.SimpleOvergroups.FamilyProgram + +namespace OAI + + +namespace SimpleFInftyOvergroups.ContextualEncoding +open FiniteAlgebraicEnvelopes Bootstrap +noncomputable section +open scoped Classical + +namespace FiniteParameter +variable {I X Y : Type*} [Primcodable I] [Primcodable X] [Primcodable Y] + [DecidableEq I] (f : I → X → Part Y) + +def select (l : List I) (p : I × X) : Part Y := + l.foldr (fun i rest => if p.1 = i then f i p.2 else rest) Part.none + +theorem select_partrec (hf : ∀ i, Partrec (f i)) (l : List I) : Partrec (select f l) := by + induction l with + | nil => exact Partrec.none + | cons i l ih => + exact (Partrec.cond (Primrec.eq.comp Primrec.fst (Primrec.const i)).decide.to_comp + ((hf i).comp Computable.snd) ih).of_eq (by + intro p + simp only [select,List.foldr_cons] + split <;> simp_all) + +omit [Primcodable I] [Primcodable X] [Primcodable Y] in +theorem select_mem [Primcodable I] [Primcodable X] [Primcodable Y] + (l : List I) (p : I × X) (hp : p.1 ∈ l) : select f l p = f p.1 p.2 := by + induction l with + | nil => simp at hp + | cons i l ih => + simp only [select,List.foldr_cons] + split + next h => simp only [h] + next h => exact ih ((List.mem_cons.mp hp).resolve_left h) + +theorem partrec₂ [Fintype I] (hf : ∀ i, Partrec (f i)) : Partrec₂ f := + (select_partrec f hf (Static.letters I)).of_eq (fun p => select_mem f _ p (by simp [Static.letters])) +end FiniteParameter + +namespace FamilyProgram +variable {I P S : Type*} {A Q : I → Type*} + [Fintype I] [Fintype S] [Primcodable I] [Primcodable P] [Primcodable S] + [∀ i, Primcodable (A i)] [∀ i, Primcodable (Q i)] + [DecidableEq I] [DecidableEq S] [∀ i, DecidableEq (A i)] [∀ i, DecidableEq (Q i)] +variable {r : S → S → Prop} [DecidableRel (List.Shortlex r)] +variable (C : ∀ i, DelimiterCode (A i) S) (E : ∀ i, FiniteSearch (C i)) (z : S) + +omit [∀ index, DecidableEq (A index)] in + theorem partrec_compute [∀ index, DecidableEq (A index)] + (hw : ∀ i, Primrec (E i).words) (hc : ∀ i, Primrec (C i).encode) + (hl : PrimrecRel (List.Shortlex r)) + {f : ∀ i, P → List (A i) → Part (Option (Q i))} + (hf : ∀ i, Partrec₂ (f i)) : + Partrec₂ (fun p => compute (r:=r) C E z (fun i => f i p)) := by + have hi : Partrec₂ (fun i (x : P × ℕ) => CodedSearch.compute (r:=r) (C i) (E i) z (f i x.1) x.2) := + FiniteParameter.partrec₂ _ (fun i => CodedProgram.partrec_search (C i) (E i) z (hw i) (hc i) hl (hf i)) + have ht : Partrec₂ (fun x : P × ℕ => fun i => CodedSearch.compute (r:=r) (C i) (E i) z (f i x.1) x.2) := + hi.comp Computable.snd Computable.fst + have hs : Partrec (fun x : P × ℕ => + (Effect.traverse (fun i => CodedSearch.compute (r:=r) (C i) (E i) z (f i x.1) x.2) + (Static.letters I)).map (fun rs => Base.absorption z ++ rs.flatten)) := + ((Effect.partrec_traverse_parameter ht).comp Computable.id (Computable.const _)).map + ((Primrec.list_append.comp (Primrec.const (Base.absorption z)) + (Primrec.list_flatten.comp Primrec.snd)).to_comp).to₂ + exact (Partrec.cond ((Primrec.eq.comp Primrec.snd (Primrec.const 0)).decide.to_comp) + (Computable.const (Base.absorption z)).partrec hs).of_eq (by + intro x + simp only [compute] + split <;> simp_all) +end FamilyProgram +end +end SimpleFInftyOvergroups.ContextualEncoding + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleOvergroups/EffectiveFold.lean b/lean/OAI/GroupTheory/SimpleOvergroups/EffectiveFold.lean new file mode 100644 index 0000000000000000000000000000000000000000..6a7e183b9a78a5c785cf14045e7f97b48d09e5be --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleOvergroups/EffectiveFold.lean @@ -0,0 +1,102 @@ +import Mathlib + +namespace OAI + + + +namespace SimpleFInftyOvergroups.EffectiveNames +namespace PartialFold +variable {P A B : Type*} (f : P × A × B → Part B) + +def left (p : P) : List A → B → Part B + | [], b => Part.some b + | a::w, b => (f (p,a,b)).bind (left p w) + +def right (p : P) : List A → B → Part B + | [], b => Part.some b + | a::w, b => (right p w b).bind (fun c => f (p,a,c)) + +theorem left_append (p : P) (u v : List A) (b : B) : + left f p (u++v) b = (left f p u b).bind (left f p v) := by + induction u generalizing b with + | nil => simp [left] + | cons a u ih => + simp only [List.cons_append,left,Part.bind_assoc] + congr 1 + funext c + exact ih c + +theorem right_eq_left_reverse (p : P) (w : List A) (b : B) : + right f p w b = left f p w.reverse b := by + induction w with + | nil => rfl + | cons a w ih => + simp only [right,List.reverse_cons,left_append,← ih,left] + simp only [Part.bind_some_right] + +def loop : P × List A × B → Part (B ⊕ (P × List A × B)) + | (_,[],b) => Part.some (.inl b) + | (p,a::w,b) => (f (p,a,b)).map (fun c => .inr (p,w,c)) + +theorem fix_loop (p : P) (w : List A) (b : B) : + PFun.fix (loop f) (p,w,b) = left f p w b := by + induction w generalizing b with + | nil => + apply Part.ext + intro out + erw [PFun.mem_fix_iff] + simp only [loop,Part.mem_some_iff,Sum.inl.injEq,Sum.inr_ne_inl,exists_false, + false_and,or_false,left] + | cons a w ih => + apply Part.ext + intro out + erw [PFun.mem_fix_iff] + simp only [loop,Part.mem_map_iff,Sum.inr_ne_inl,exists_false,and_false,false_or] + constructor + · rintro ⟨⟨p',w',c⟩,⟨c',hc,he⟩,ho⟩ + have he' : (p,w,c') = (p',w',c) := Sum.inr.inj he + obtain ⟨rfl,rfl,rfl⟩ := Prod.mk.inj he' |>.imp_right Prod.mk.inj + rw [ih] at ho + exact Part.mem_bind_iff.mpr ⟨c',hc,ho⟩ + · intro ho + obtain ⟨c,hc,ho⟩ := Part.mem_bind_iff.mp ho + exact ⟨(p,w,c),⟨c,hc,rfl⟩,by rw [ih]; exact ho⟩ + +variable [Primcodable P] [Primcodable A] [Primcodable B] +variable (hf : Partrec f) + +include hf in +theorem partrec_loop : Partrec (loop f) := by + let S := P × List A × B + have hh : Computable (fun s : S => s.2.1.head?) := + Primrec.list_head?.to_comp.comp (Computable.fst.comp Computable.snd) + have he : Partrec₂ (fun (s : S) (a : A) => + (f (s.1,a,s.2.2)).map (fun c => (Sum.inr (s.1,s.2.1.tail,c) : B ⊕ S))) := by + have hc : Computable (fun x : S × A => (x.1.1,x.2,x.1.2.2)) := + (Computable.fst.comp Computable.fst).pair + (Computable.snd.pair (Computable.snd.comp (Computable.snd.comp Computable.fst))) + apply (hf.comp hc).map + exact (Computable.sumInr.comp + ((Computable.fst.comp (Computable.fst.comp Computable.fst)).pair + ((Primrec.list_tail.to_comp.comp + (Computable.fst.comp (Computable.snd.comp (Computable.fst.comp Computable.fst)))).pair + Computable.snd))).to₂ + exact (Partrec.optionCasesOn_right hh + (Computable.sumInl.comp (Computable.snd.comp Computable.snd)) he).of_eq + (by intro ⟨p,w,b⟩; cases w <;> rfl) + +include hf in +theorem partrec_left : Partrec (fun x : P × List A × B => left f x.1 x.2.1 x.2.2) := + (Partrec.fix (partrec_loop f hf)).of_eq (fun ⟨p,w,b⟩ => fix_loop f p w b) + +include hf in +theorem partrec_right : Partrec (fun x : P × List A × B => right f x.1 x.2.1 x.2.2) := by + have hc : Computable (fun x : P × List A × B => (x.1,x.2.1.reverse,x.2.2)) := + Computable.fst.pair ((Computable.list_reverse.comp (Computable.fst.comp Computable.snd)).pair + (Computable.snd.comp Computable.snd)) + exact ((partrec_left f hf).comp hc).of_eq (fun ⟨p,w,b⟩ => (right_eq_left_reverse f p w b).symm) + +end PartialFold +end SimpleFInftyOvergroups.EffectiveNames + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleOvergroups/EffectiveTables.lean b/lean/OAI/GroupTheory/SimpleOvergroups/EffectiveTables.lean new file mode 100644 index 0000000000000000000000000000000000000000..fa166f9e0b87603aeeeb7eee07b79fb880b54ecc --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleOvergroups/EffectiveTables.lean @@ -0,0 +1,206 @@ +import Mathlib +import OAI.Computability.FiniteCompiler.Effectivity +import OAI.Computability.FiniteCompiler.Quotients +import OAI.Computability.FiniteCompiler.SelfReference +import OAI.GroupTheory.BooneHigman.Basic +import OAI.GroupTheory.SimpleOvergroups.ContextualTables + +namespace OAI + + +namespace SimpleFInftyOvergroups.ContextualEncoding +open FiniteAlgebraicEnvelopes FiniteAlgebraicEnvelopes.Bootstrap + +namespace CodedSearch +variable {A S Q : Type*} [DecidableEq S] [DecidableEq Q] +variable {r : S → S → Prop} [DecidableRel (List.Shortlex r)] +variable (C : DelimiterCode A S) + +def lt (u v : List A) : Bool := decide (List.Shortlex r (C.encode u) (C.encode v)) + +def compute (E : FiniteSearch C) (z : S) (f : List A → Part (Option Q)) (n : ℕ) : + Part (List (List S × List S)) := + (Effect.traverse (fun w => (f w).map (w,·)) (E.words n)).map + (Uniform.table C.encode (lt (r := r) C) z) + +variable (wf : WellFounded r) [Std.Trichotomous r] (q : List A → Option Q) + +omit [DecidableEq S] [Std.Trichotomous r] in +theorem pick_class {ps : List (List A × Option Q)} {w v : List A} + (hps : ∀ p ∈ ps, p.2 = q p.1) (hv : q v = q w) : + q (Uniform.pick (lt (r := r) C) ps v (q w)) = q w := by + induction ps generalizing v with + | nil => exact hv + | cons p ps ih => + simp only [Uniform.pick, List.foldl_cons] + apply ih (fun p hp => hps p (List.mem_cons_of_mem _ hp)) + simp only [Uniform.pickStep] + split + next h => exact (hps p List.mem_cons_self).symm.trans h.1 + next h => exact hv + +omit [DecidableEq S] in +theorem pick_least_fixed {ps : List (List A × Option Q)} {w : List A} + (hps : ∀ p ∈ ps, p.2 = q p.1) : + Uniform.pick (lt (r := r) C) ps (EncodedCanonical.least C wf q w) (q w) = + EncodedCanonical.least C wf q w := by + induction ps with + | nil => rfl + | cons p ps ih => + have hh : ¬ (p.2 = q w ∧ lt (r := r) C p.1 (EncodedCanonical.least C wf q w) = true) := by + rintro ⟨hq, hr⟩ + exact EncodedCanonical.least_global_min C wf q + ((hps p List.mem_cons_self).symm.trans hq) (of_decide_eq_true hr) + simp only [Uniform.pick, List.foldl_cons, Uniform.pickStep, ite_eq_right hh] + exact ih (fun p hp => hps p (List.mem_cons_of_mem _ hp)) + +omit [DecidableEq S] in +theorem pick_eq_least {ps : List (List A × Option Q)} {w : List A} + (hps : ∀ p ∈ ps, p.2 = q p.1) + (hm : (EncodedCanonical.least C wf q w, q w) ∈ ps) : + Uniform.pick (lt (r := r) C) ps w (q w) = EncodedCanonical.least C wf q w := by + obtain ⟨before, after, rfl⟩ := List.mem_iff_append.mp hm + have hb : ∀ p ∈ before, p.2 = q p.1 := fun p hp => hps p (List.mem_append_left _ hp) + have ha : ∀ p ∈ after, p.2 = q p.1 := fun p hp => + hps p (List.mem_append_right _ (List.mem_cons_of_mem _ hp)) + have hclass := pick_class (r := r) C q hb (w := w) rfl + have hsel : Uniform.pickStep (lt (r := r) C) (q w) + (Uniform.pick (lt (r := r) C) before w (q w)) + (EncodedCanonical.least C wf q w, q w) = EncodedCanonical.least C wf q w := by + unfold Uniform.pickStep + simp only [true_and, lt, decide_eq_true_eq] + split + · rfl + next h => + apply C.encode_injective + exact Std.Trichotomous.trichotomous _ _ + (EncodedCanonical.least_global_min C wf q hclass) h + simp only [Uniform.pick, List.foldl_append, List.foldl_cons] + change after.foldl (Uniform.pickStep (lt (r := r) C) (q w)) + (Uniform.pickStep (lt (r := r) C) (q w) + (Uniform.pick (lt (r := r) C) before w (q w)) + (EncodedCanonical.least C wf q w, q w)) = _ + rw [hsel] + exact pick_least_fixed C wf q ha + +variable (E : FiniteSearch C) (z : S) + +omit [DecidableEq S] in +theorem output_full {n : ℕ} {w : List A} (hw : (C.encode w).length ≤ n) : + Uniform.output C.encode (lt (r := r) C) z + ((E.words n).map fun v => (v,q v)) (w,q w) = CodeTable.output C wf q z w := by + have hps : ∀ p ∈ (E.words n).map (fun v => (v,q v)), p.2 = q p.1 := by + intro p hp + obtain ⟨v, _, rfl⟩ := List.mem_map.mp hp + rfl + have hm : (EncodedCanonical.least C wf q w, q w) ∈ (E.words n).map (fun v => (v,q v)) := + List.mem_map.mpr ⟨EncodedCanonical.least C wf q w, (E.mem_words _ _).mpr + ((EncodedCanonical.least_length C wf q w).trans hw), by simp [EncodedCanonical.least_class]⟩ + simp only [Uniform.output, CodeTable.output, pick_eq_least C wf q hps hm] + +theorem table_full (n : ℕ) : + Uniform.table C.encode (lt (r := r) C) z ((E.words n).map fun v => (v,q v)) = + CodeTable.table C E wf q z n := by + classical + unfold Uniform.table CodeTable.table + rw [List.flatMap_map] + have hh : ∀ w ∈ E.words n, + (if w ≠ [] ∧ Uniform.output C.encode (lt (r := r) C) z + ((E.words n).map fun v => (v,q v)) (w,q w) ≠ C.encode w + then [(C.encode w, Uniform.output C.encode (lt (r := r) C) z + ((E.words n).map fun v => (v,q v)) (w,q w))] else []) = + (if w ≠ [] ∧ CodeTable.output C wf q z w ≠ C.encode w + then [(C.encode w, CodeTable.output C wf q z w)] else []) := by + intro w hw + rw [output_full C wf q E z ((E.mem_words _ _).mp hw)] + rw [List.flatMap_congr hh] + have he (l : List (List A)) : + l.flatMap (fun w => if w ≠ [] ∧ CodeTable.output C wf q z w ≠ C.encode w + then [(C.encode w, CodeTable.output C wf q z w)] else []) = + (l.filter fun w => w ≠ [] ∧ CodeTable.output C wf q z w ≠ C.encode w).map + (fun w => (C.encode w, CodeTable.output C wf q z w)) := by + induction l with + | nil => rfl + | cons w l ih => + by_cases h : w ≠ [] ∧ CodeTable.output C wf q z w ≠ C.encode w + · simp only [List.flatMap_cons, List.filter_cons, decide_eq_true_eq, ite_eq_left h, + List.map_cons, List.singleton_append, ih] + · simp only [List.flatMap_cons, List.filter_cons, decide_eq_true_eq, ite_eq_right h, + List.nil_append, ih] + refine (he _).trans ?_ + congr 1 + apply List.filter_congr + intro w hw + apply Bool.eq_iff_iff.mpr + simp only [decide_eq_true_eq] + +theorem compute_full {f : List A → Part (Option Q)} {n : ℕ} + (h : ∀ w, (C.encode w).length ≤ n → q w ∈ f w) : + CodeTable.table C E wf q z n ∈ compute (r := r) C E z f n := by + apply (Part.mem_map_iff _).mpr + refine ⟨(E.words n).map (fun w => (w,q w)), ?_, table_full C wf q E z n⟩ + apply Search.traverse_map + intro w hw + exact (Part.mem_map_iff _).mpr ⟨_, h w ((E.mem_words _ _).mp hw), rfl⟩ + +omit [Std.Trichotomous r] in +theorem compute_domain {f : List A → Part (Option Q)} {n : ℕ} + (hc : (compute (r := r) C E z f n).Dom) : + ∀ w, (C.encode w).length ≤ n → (f w).Dom := by + obtain ⟨rs, hrs⟩ := Part.dom_iff_mem.mp hc + obtain ⟨ps, hps, _⟩ := (Part.mem_map_iff _).mp hrs + have ht := Effect.traverse_domain hps.1 + intro w hw + obtain ⟨p, hp⟩ := Part.dom_iff_mem.mp (ht w ((E.mem_words _ _).mpr hw)) + obtain ⟨v, hv, _⟩ := (Part.mem_map_iff _).mp hp + exact hv.1 + +theorem compute_eq {f : List A → Part (Option Q)} {n : ℕ} + {rs : List (List S × List S)} (hc : rs ∈ compute (r := r) C E z f n) : + rs = CodeTable.table C E wf (Search.value f) z n := + Part.mem_unique hc (compute_full C wf (Search.value f) E z + (fun w hw => Search.value_mem (compute_domain C E z hc.1 w hw))) + +end CodedSearch + +namespace CodedProgram +variable {P A S Q : Type*} + [Primcodable P] [Primcodable A] [Primcodable S] [Primcodable Q] + [DecidableEq S] [DecidableEq Q] + +def compute (words : P → ℕ → List (List A)) (code : P → List A → List S) + (lt : P → List A → List A → Bool) (z : S) + (f : P → List A → Part (Option Q)) (p : P) (n : ℕ) : + Part (List (List S × List S)) := + (Effect.traverse (fun w => (f p w).map (w,·)) (words p n)).map + (Uniform.table (code p) (lt p) z) + + theorem partrec_compute (words : P → ℕ → List (List A)) + (code : P → List A → List S) (lt : P → List A → List A → Bool) (z : S) + (hw : Primrec₂ words) (hc : Primrec₂ code) + (hl : Primrec (fun x : P × List A × List A => lt x.1 x.2.1 x.2.2)) + {f : P → List A → Part (Option Q)} (hf : Partrec₂ f) : + Partrec₂ (compute words code lt z f) := by + have hp : Partrec₂ (fun p w => (f p w).map (w,·)) := + (hf.map ((Computable.snd.comp Computable.fst).pair Computable.snd).to₂).to₂ + exact (((Effect.partrec_traverse_parameter hp).comp Computable.fst hw.to_comp).map + ((Uniform.primrec_table code lt z hc hl).to_comp.comp + ((Computable.fst.comp Computable.fst).pair Computable.snd)).to₂).to₂ + + theorem partrec_search {r : S → S → Prop} [DecidableRel (List.Shortlex r)] + (C : DelimiterCode A S) (E : FiniteSearch C) (z : S) + (hw : Primrec E.words) (hc : Primrec C.encode) + (hl : PrimrecRel (List.Shortlex r)) + {f : P → List A → Part (Option Q)} (hf : Partrec₂ f) : + Partrec₂ (fun p => CodedSearch.compute (r := r) C E z (f p)) := by + apply partrec_compute (fun _ => E.words) (fun _ => C.encode) + (fun _ => CodedSearch.lt (r := r) C) z (hw.comp Primrec.snd).to₂ + (hc.comp Primrec.snd).to₂ _ hf + exact hl.decide.comp + (hc.comp (Primrec.fst.comp Primrec.snd)) + (hc.comp (Primrec.snd.comp Primrec.snd)) + +end CodedProgram +end SimpleFInftyOvergroups.ContextualEncoding + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleOvergroups/EnlargementCore.lean b/lean/OAI/GroupTheory/SimpleOvergroups/EnlargementCore.lean new file mode 100644 index 0000000000000000000000000000000000000000..c30124cd5190f981db88206ac0e6a367f28501c3 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleOvergroups/EnlargementCore.lean @@ -0,0 +1,186 @@ +import Mathlib + +namespace OAI + +noncomputable section +namespace SourceEnlargement + +variable {D V Z : Type*} [Ring D] [Group V] [MulAction V Z] + +def value (E : D) (g : V) : MonoidAlgebra D V := + MonoidAlgebra.single 1 (1 - E) + MonoidAlgebra.single g E + +@[simp] lemma value_one (E : D) : value E (1 : V) = 1 := by + simp only [value, ← MonoidAlgebra.single_add, sub_add_cancel] + rfl + +lemma value_mul (E : D) (hE : E * E = E) (g h : V) : + value E g * value E h = value E (g * h) := by + have ha : (1 - E) * E = 0 := by rw [sub_mul, one_mul, hE, sub_self] + have hb : E * (1 - E) = 0 := by rw [mul_sub, mul_one, hE, sub_self] + have hc : (1 - E) * (1 - E) = 1 - E := by + rw [mul_sub, mul_one, ha, sub_zero] + simp only [value, add_mul, mul_add, MonoidAlgebra.single_mul_single, + one_mul, mul_one, ha, hb, hc, hE, MonoidAlgebra.single_zero, add_zero, zero_add] + +def unitMap (E : D) (hE : E * E = E) : V →* (MonoidAlgebra D V)ˣ where + toFun g := + { val := value E g + inv := value E g⁻¹ + val_inv := by rw [value_mul E hE, mul_inv_cancel, value_one] + inv_val := by rw [value_mul E hE, inv_mul_cancel, value_one] } + map_one' := Units.ext (value_one E) + map_mul' g h := Units.ext (value_mul E hE g h).symm + +@[simp] lemma unitMap_val (E : D) (hE : E * E = E) (g : V) : + (unitMap E hE g).val = value E g := rfl + +@[simp] lemma value_identity (g : V) : + value (1 : D) g = MonoidAlgebra.single g 1 := by simp [value] + +lemma unitMap_identity_injective [Nontrivial D] : + Function.Injective (unitMap (V := V) (1 : D) (one_mul 1)) := by + intro g h hgh + have he := congrArg Units.val hgh + simp only [unitMap_val, value_identity] at he + exact MonoidAlgebra.single_left_injective one_ne_zero he + +lemma complement_product (E P : D) (hEP : E * P = 0) : + (1 - E) * (1 - P) = 1 - (E + P) := by + calc + (1 - E) * (1 - P) = 1 - (E + P) + E * P := by noncomm_ring + _ = 1 - (E + P) := by rw [hEP, add_zero] + +lemma value_mul_orthogonal (E P : D) (hEP : E * P = 0) (g h : V) : + value E g * value P h = + MonoidAlgebra.single 1 (1 - (E + P)) + + MonoidAlgebra.single h P + MonoidAlgebra.single g E := by + have ha : (1 - E) * P = P := by rw [sub_mul, one_mul, hEP, sub_zero] + have hb : E * (1 - P) = E := by rw [mul_sub, mul_one, hEP, sub_zero] + simp only [value, add_mul, mul_add, MonoidAlgebra.single_mul_single, + one_mul, mul_one, complement_product E P hEP, ha, hb, hEP, + MonoidAlgebra.single_zero, add_zero] + abel + +lemma unitMap_commute (E P : D) (hE : E * E = E) (hP : P * P = P) + (hEP : E * P = 0) (hPE : P * E = 0) (g h : V) : + Commute (unitMap E hE g) (unitMap P hP h) := by + apply Units.ext + change value E g * value P h = value P h * value E g + rw [value_mul_orthogonal E P hEP, value_mul_orthogonal P E hPE, add_comm P E] + abel + +lemma unitMap_add (E P : D) (hE : E * E = E) (hP : P * P = P) + (hSum : (E + P) * (E + P) = E + P) (hEP : E * P = 0) (g : V) : + unitMap (E + P) hSum g = unitMap E hE g * unitMap P hP g := by + apply Units.ext + change value (E + P) g = value E g * value P g + rw [value_mul_orthogonal E P hEP, value, MonoidAlgebra.single_add] + abel + +def indexAction : V →* AddMonoid.End (Z →₀ D) where + toFun g := Finsupp.mapDomain.addMonoidHom (fun z => g • z) + map_one' := by + apply AddMonoidHom.ext + intro a + change Finsupp.mapDomain (fun z : Z => (1 : V) • z) a = a + simp only [one_smul] + exact Finsupp.mapDomain_id + map_mul' g h := by + apply AddMonoidHom.ext + intro a + change Finsupp.mapDomain (fun z : Z => (g * h) • z) a = + Finsupp.mapDomain (fun z => g • z) (Finsupp.mapDomain (fun z => h • z) a) + rw [← Finsupp.mapDomain_comp] + simp only [mul_smul, Function.comp_def] + +@[simp] lemma indexAction_single (g : V) (z : Z) (d : D) : + indexAction g (Finsupp.single z d) = Finsupp.single (g • z) d := + Finsupp.mapDomain_single + +lemma scalar_index_commute (d : D) (g : V) : + Commute (Module.toAddMonoidEnd D (Z →₀ D) d) (indexAction g) := by + apply Finsupp.addHom_ext + intro z a + change d • indexAction g (Finsupp.single z a) = indexAction g (d • Finsupp.single z a) + simp only [indexAction_single, Finsupp.smul_single] + +def ringAction : MonoidAlgebra D V →+* AddMonoid.End (Z →₀ D) := + MonoidAlgebra.liftNCRingHom (Module.toAddMonoidEnd D (Z →₀ D)) + indexAction scalar_index_commute + +@[simp] lemma ringAction_single (g : V) (d : D) (z : Z) (a : D) : + ringAction (MonoidAlgebra.single g d) (Finsupp.single z a) = + Finsupp.single (g • z) (d * a) := by + rw [ringAction, MonoidAlgebra.liftNCRingHom_single] + change d • indexAction g (Finsupp.single z a) = _ + simp only [indexAction_single, Finsupp.smul_single, smul_eq_mul] + +instance unitsAction : MulAction (MonoidAlgebra D V)ˣ (Z →₀ D) where + smul w a := ringAction w.val a + one_smul a := by change ringAction 1 a = a; rw [map_one]; rfl + mul_smul w v a := by + change ringAction (w.val * v.val) a = ringAction w.val (ringAction v.val a) + rw [map_mul]; rfl + +lemma unitMap_basis (E : D) (hE : E * E = E) (g : V) (z : Z) : + unitMap E hE g • Finsupp.single z (1 : D) = + Finsupp.single z (1 - E) + Finsupp.single (g • z) E := by + change ringAction (value E g) (Finsupp.single z (1 : D)) = _ + rw [value, map_add] + change ringAction (MonoidAlgebra.single 1 (1 - E)) (Finsupp.single z (1 : D)) + + ringAction (MonoidAlgebra.single g E) (Finsupp.single z (1 : D)) = _ + simp only [ringAction_single, one_smul, mul_one] + +lemma unitMap_fixes (E : D) (hE : E * E = E) (g : V) (z : Z) + (hz : g • z = z) : + unitMap E hE g • Finsupp.single z (1 : D) = Finsupp.single z 1 := by + rw [unitMap_basis, hz, ← Finsupp.single_add, sub_add_cancel] + +def group (P : Set D) (hP : ∀ E ∈ P, E * E = E) : Subgroup (MonoidAlgebra D V)ˣ := + Subgroup.closure {w | ∃ E : P, ∃ g : V, w = unitMap E.val (hP E.val E.property) g} + +variable (P : Set D) (hP : ∀ E ∈ P, E * E = E) + +def map (E : P) : V →* group (V := V) P hP := + (unitMap E.val (hP E.val E.property)).codRestrict _ fun g => + Subgroup.subset_closure ⟨E, g, rfl⟩ + +@[simp] lemma map_val (E : P) (g : V) : + (map P hP E g).val = unitMap E.val (hP E.val E.property) g := rfl + +lemma map_identity_injective [Nontrivial D] (h1 : 1 ∈ P) : + Function.Injective (map (V := V) P hP ⟨1, h1⟩) := by + intro g h he + apply unitMap_identity_injective (D := D) + exact congrArg Subtype.val he + +lemma map_identity_basis (h1 : 1 ∈ P) (g : V) (z : Z) : + map P hP ⟨1, h1⟩ g • Finsupp.single z (1 : D) = Finsupp.single (g • z) 1 := by + change unitMap (1 : D) (hP 1 h1) g • Finsupp.single z (1 : D) = _ + simp [unitMap_basis] + +lemma basis_injective [Nontrivial D] : + Function.Injective (fun z : Z => Finsupp.single z (1 : D)) := + Finsupp.single_left_injective one_ne_zero + +lemma map_fixes (E : P) (g : V) (z : Z) (hz : g • z = z) : + map P hP E g • Finsupp.single z (1 : D) = Finsupp.single z 1 := + unitMap_fixes E.val (hP E.val E.property) g z hz + +lemma map_commute (E E' : P) (hEP : E.val * E'.val = 0) + (hPE : E'.val * E.val = 0) (g h : V) : + Commute (map P hP E g) (map P hP E' h) := by + apply Subtype.ext + exact (unitMap_commute E.val E'.val (hP _ E.property) (hP _ E'.property) hEP hPE g h).eq + +lemma map_add (E E' : P) (hSum : E.val + E'.val ∈ P) + (hEP : E.val * E'.val = 0) (g : V) : + map P hP ⟨E.val + E'.val, hSum⟩ g = map P hP E g * map P hP E' g := by + apply Subtype.ext + exact unitMap_add E.val E'.val (hP _ E.property) (hP _ E'.property) (hP _ hSum) hEP g + +end SourceEnlargement +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleOvergroups/EnlargementEffective.lean b/lean/OAI/GroupTheory/SimpleOvergroups/EnlargementEffective.lean new file mode 100644 index 0000000000000000000000000000000000000000..9d15d1ae8ea0250ced3c922ef79bd1a7ba4d20cf --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleOvergroups/EnlargementEffective.lean @@ -0,0 +1,188 @@ +import Mathlib +import OAI.GroupTheory.SimpleOvergroups.EffectiveArrays +import OAI.GroupTheory.SimpleOvergroups.EnlargementNames +import OAI.GroupTheory.SimpleOvergroups.MatrixEffective +import OAI.GroupTheory.SimpleOvergroups.PlanEffective + +namespace OAI + + +namespace SimpleFInftyOvergroups.EffectiveNames.Enlargement +open BoundedEncoding NamedAction +open BinaryPrefixOperators.Arithmetic +noncomputable section +open scoped Classical +variable {G X P k : Type*} [CommRing k] (N : Operations G X) + (e : P → Coeff.Name k) +variable [Primcodable k] + +def arrayKey {J : Type*} [Primcodable J] : (J →₀ D k) → ℕ := + semanticKey (Array.value Coeff.value id) + (Array.value_surjective Coeff.value id Lists.value_surjective Function.surjective_id) + + theorem arrayKey_injective {J : Type*} [Primcodable J] : + Function.Injective (arrayKey (k:=k) (J:=J)) := semanticKey_injective _ _ + +def pairedKey {J : Type*} [Primcodable J] (p : (J →₀ D k) × (J →₀ D k)) : ℕ × ℕ := + (arrayKey p.1,arrayKey p.2) + + theorem pairedKey_injective {J : Type*} [Primcodable J] : + Function.Injective (pairedKey (k:=k) (J:=J)) := by + intro p q h + exact Prod.ext (arrayKey_injective (congrArg Prod.fst h)) (arrayKey_injective (congrArg Prod.snd h)) + +variable {V Y K L : Type*} [Group V] [MulAction V Y] [Nonempty Y] {m : ℕ} + (C : ActionCalculus V Y K L m) [Primcodable K] [Primcodable L] + +def calculus : ActionCalculus (MonoidAlgebra (D k) V)ˣ (Y →₀ D k) (ℕ × ℕ) ℕ m := + (C.enlargement (D k)).rekey pairedKey arrayKey pairedKey_injective arrayKey_injective + +variable {C} (I : Interpretation N C) + (he : ∀ p, Coeff.value (e p) * Coeff.value (e p) = Coeff.value (e p)) + +def groupLabel (w : Word P G) : (calculus (k:=k) C).GLabel := + ⟨groupValue N e I he w,gcost N w,group_mem N e I he w⟩ +def pointLabel (x : Point P G X) : (calculus (k:=k) C).XLabel := + ⟨pointValue N e I he x,xcost N x,point_mem N e I he x⟩ + +def interpretation : Interpretation (operations (P:=P) N) (calculus (k:=k) C) where + group := groupLabel N e I he + point := pointLabel N e I he + group_cost w := rfl + point_cost x := rfl + one := WithBound.ext' (groupValue_nil N e I he) rfl + mul a b := WithBound.ext' (groupValue_append N e I he a b) (gcost_append N a b) + inv w := WithBound.ext' (groupValue_inverse N e I he w) (gcost_inverse N w) + act g x := WithBound.ext' (pointValue_act N e I he g x) + (by change gcost N (g++x.1) + N.xcost x.2 = gcost N g + xcost N x + simp [xcost,Nat.add_assoc]) + +variable [Primcodable G] [Primcodable X] + +def partialGroupKey (f : G → Part K) (w : Word P G) : Part (ℕ × ℕ) := + (Array.collectedKey Coeff.value f (array N e w)).bind fun a => + (Array.collectedKey Coeff.value f (array N e (inverse N w))).map fun b => (a,b) + +def partialPointKey (f : X → Part L) (x : Point P G X) : Part ℕ := + Array.collectedKey Coeff.value f (pointArray N e x) + +omit [Primcodable G] [Primcodable X] in + theorem partialGroupKey_full (f : G → Part K) (w : Word P G) {d : ℕ} + (hw : gcost N w ≤ d) (hf : ∀ g, N.gcost g ≤ d → I.gkey g ∈ f g) : + (interpretation N e I he).gkey w ∈ partialGroupKey N e f w := by + have h (u : Word P G) (hu : gcost N u ≤ d) := + Array.collectedKey_full Coeff.value Lists.value_surjective f + (fun g => (I.group g).val) C.group.key (array N e u) + (fun a ha => hf a.2 ((array_bound N e u a ha).trans hu)) + have h' (u : Word P G) (hu : gcost N u ≤ d) : + arrayKey (C.group.algebraCollect (D k) (groupValue N e I he u).val) ∈ + Array.collectedKey Coeff.value f (array N e u) := by + have hh := h u hu + have hv := congrArg MonoidAlgebra.coeff (value_array N e I he u) + change Array.value Coeff.value (fun g => (I.group g).val) (array N e u) = _ at hv + rw [hv] at hh + exact hh + change (arrayKey (C.group.algebraCollect (D k) (groupValue N e I he w).val), + arrayKey (C.group.algebraCollect (D k) (groupValue N e I he w).inv)) ∈ _ + exact Part.mem_bind_iff.mpr ⟨_,h' w hw,Part.mem_map _ (by + have hh := h' (inverse N w) (by simpa using hw) + simpa only [groupValue_inverse, ← Units.inv_eq_val_inv] using hh)⟩ + +omit [Primcodable G] [Primcodable X] in + theorem partialPointKey_full (f : X → Part L) (x : Point P G X) {d : ℕ} + (hx : xcost N x ≤ d) (hf : ∀ y, N.xcost y ≤ d → I.xkey y ∈ f y) : + (interpretation N e I he).xkey x ∈ partialPointKey N e f x := by + have h := Array.collectedKey_full Coeff.value Lists.value_surjective f + (fun y => (I.point y).val) C.point.key (pointArray N e x) + (fun a ha => hf a.2 ((pointArray_bound N e x a ha).trans hx)) + rw [value_pointArray N e I he] at h + exact h + +variable [Primcodable P] [Finite P] [Finite k] + + theorem computable_array_eq {J : Type*} [Primcodable J] : ComputablePred + (fun p : Array.Name (Coeff.Name k) J × Array.Name (Coeff.Name k) J => + Array.value Coeff.value id p.1 = Array.value Coeff.value id p.2) := by + apply Array.computable_value_eq Coeff.value id [] (·++·) Primrec.list_append + (show ComputablePred (fun p : J × J => p.1 = p.2) from Primrec.eq.computablePred) + Lists.computable_value_eq + · exact Lists.value_nil + · exact Lists.value_append + +omit [Primcodable X] [Finite P] in + theorem primrec_inverse (hi : Primrec N.inv) : Primrec (inverse (P:=P) N) := + Primrec.list_map Primrec.list_reverse + ((Primrec.fst.comp Primrec.snd).pair (hi.comp (Primrec.snd.comp Primrec.snd))).to₂ + +omit [Finite P] in + theorem primrec_act : Primrec₂ ((operations (P:=P) N).act) := + (Primrec.list_append.comp Primrec.fst (Primrec.fst.comp Primrec.snd)).pair + (Primrec.snd.comp Primrec.snd) + +omit [Finite P] in + theorem primrec_plan (hi : Primrec N.inv) : Primrec₂ ((operations (P:=P) N).plan) := + (operations N).primrec_plan Primrec.list_append (primrec_inverse N hi) (primrec_act N) + +omit [Primcodable X] in + theorem primrec_rootArray : Primrec (rootArray N e) := by + have hc : Primrec (Coeff.complement (k:=k)) := + Primrec.list_append.comp (Primrec.const Coeff.one) Lists.primrec_negate + have he : Primrec e := Primrec.dom_finite e + exact Primrec.list_cons.comp + ((hc.comp (he.comp Primrec.fst)).pair (Primrec.const N.one)) + (Primrec.list_cons.comp ((he.comp Primrec.fst).pair Primrec.snd) (Primrec.const [])) + +omit [Primcodable X] in + theorem primrec_array (hm : Primrec₂ N.mul) : Primrec (array N e) := + Primrec.list_foldr Primrec.id (Primrec.const [(Coeff.one,N.one)]) + ((Array.primrec_product Lists.primrec_product hm).comp + ((primrec_rootArray N e).comp (Primrec.fst.comp Primrec.snd)) + (Primrec.snd.comp Primrec.snd)).to₂ + + theorem primrec_pointArray (hm : Primrec₂ N.mul) (hx : Primrec₂ N.act) : + Primrec (pointArray N e) := + (Array.primrec_product Lists.primrec_product hx).comp + ((primrec_array N e hm).comp Primrec.fst) + (Primrec.list_cons.comp ((Primrec.const Coeff.one).pair Primrec.snd) (Primrec.const [])) + +omit [Primcodable X] [Finite P] in + theorem primrec_gcost (hc : Primrec N.gcost) : Primrec (gcost (P:=P) N) := by + have hs : Primrec (fun l : List ℕ => l.sum) := + (Primrec.list_foldr Primrec.id (Primrec.const 0) + (Primrec.nat_add.comp (Primrec.fst.comp Primrec.snd) (Primrec.snd.comp Primrec.snd)).to₂).of_eq + (fun _ => rfl) + exact hs.comp (Primrec.list_map Primrec.id (hc.comp (Primrec.snd.comp Primrec.snd)).to₂) + +omit [Finite P] in + theorem primrec_xcost (hg : Primrec N.gcost) (hx : Primrec N.xcost) : + Primrec (xcost (P:=P) N) := + Primrec.nat_add.comp ((primrec_gcost N hg).comp Primrec.fst) (hx.comp Primrec.snd) + +variable {Param : Type*} [Primcodable Param] +variable {fg : Param → G → Part K} {fx : Param → X → Part L} + +omit [Primcodable X] in + theorem partrec_partialGroupKey (hm : Primrec₂ N.mul) (hi : Primrec N.inv) + (hf : Partrec₂ fg) : Partrec₂ (fun p : Param => partialGroupKey N e (fg p)) := by + have hp : Partrec (fun p : Param × Word P G => + Array.collectedKey Coeff.value (fg p.1) (array N e p.2)) := + (Array.partrec_collectedKey Coeff.value computable_array_eq hf).comp Computable.fst + ((primrec_array N e hm).to_comp.comp Computable.snd) + apply hp.bind + have hq : Partrec (fun p : (Param × Word P G) × ℕ => + Array.collectedKey Coeff.value (fg p.1.1) (array N e (inverse N p.1.2))) := + (Array.partrec_collectedKey Coeff.value computable_array_eq hf).comp (Computable.fst.comp Computable.fst) + ((primrec_array N e hm).to_comp.comp ((primrec_inverse N hi).to_comp.comp + (Computable.snd.comp Computable.fst))) + exact (hq.map ((Computable.snd.comp Computable.fst).pair Computable.snd).to₂).to₂ + + theorem partrec_partialPointKey (hm : Primrec₂ N.mul) (hx : Primrec₂ N.act) + (hf : Partrec₂ fx) : Partrec₂ (fun p : Param => partialPointKey N e (fx p)) := + (Array.partrec_collectedKey Coeff.value computable_array_eq hf).comp Computable.fst + ((primrec_pointArray N e hm hx).to_comp.comp Computable.snd) + + +end +end SimpleFInftyOvergroups.EffectiveNames.Enlargement + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleOvergroups/EnlargementNames.lean b/lean/OAI/GroupTheory/SimpleOvergroups/EnlargementNames.lean new file mode 100644 index 0000000000000000000000000000000000000000..b0e5a83b3a229570b4c5de55f595da8128569945 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleOvergroups/EnlargementNames.lean @@ -0,0 +1,180 @@ +import Mathlib +import OAI.GroupTheory.SimpleOvergroups.ArrayOperations +import OAI.GroupTheory.SimpleOvergroups.NamedActions +import OAI.GroupTheory.SimpleOvergroups.PrefixNames +import OAI.GroupTheory.SimpleOvergroups.TruncatedArrays + +namespace OAI + + +namespace SimpleFInftyOvergroups.EffectiveNames.Enlargement +open BoundedEncoding NamedAction +noncomputable section +namespace Coeff +open BinaryPrefixOperators.Arithmetic +abbrev Name (k : Type*) := Lists.Poly k +variable {k : Type*} [CommRing k] +abbrev value := Lists.value (K:=k) +abbrev one := Lists.oneName (K:=k) +abbrev mul := Lists.product (K:=k) +def complement (a : Name k) : Name k := one ++ Lists.negate a +@[simp] theorem value_one : value (one (k:=k)) = 1 := Lists.value_oneName +@[simp] theorem value_mul (a b : Name k) : value (mul a b) = value a * value b := Lists.value_product a b +@[simp] theorem value_complement (a : Name k) : value (complement a) = 1-value a := by + simp [complement,sub_eq_add_neg] +end Coeff +open scoped Classical +variable {G X P k : Type*} [CommRing k] (N : Operations G X) + +abbrev Word (P G : Type*) := List (P × G) +abbrev Point (P G X : Type*) := Word P G × X + +def rootInv (a : P × G) : P × G := (a.1,N.inv a.2) +def inverse (w : Word P G) : Word P G := w.reverse.map (rootInv N) +def gcost (w : Word P G) : ℕ := (w.map fun a => N.gcost a.2).sum +def xcost (x : Point P G X) : ℕ := gcost N x.1 + N.xcost x.2 +@[simp] theorem inverse_nil : inverse N ([] : Word P G) = [] := rfl +@[simp] theorem inverse_cons (a : P × G) (w : Word P G) : + inverse N (a::w) = inverse N w ++ [rootInv N a] := by simp [inverse] +@[simp] theorem gcost_nil : gcost N ([] : Word P G) = 0 := rfl +@[simp] theorem gcost_cons (a : P × G) (w : Word P G) : + gcost N (a::w) = N.gcost a.2 + gcost N w := rfl +@[simp] theorem gcost_append (u v : Word P G) : gcost N (u++v) = gcost N u + gcost N v := by simp [gcost] +@[simp] theorem gcost_inverse (w : Word P G) : gcost N (inverse N w) = gcost N w := by + simp [gcost,inverse,List.map_map,Function.comp_def,rootInv,N.cost_inv] + +def operations : Operations (Word P G) (Point P G X) where + one := [] + mul := (·++·) + inv := inverse N + act w x := (w++x.1,x.2) + gcost := gcost N + xcost := xcost N + cost_one := rfl + cost_mul := gcost_append N + cost_inv := gcost_inverse N + cost_act := by intros; simp [xcost,Nat.add_assoc] + +variable (e : P → Coeff.Name k) + +def rootArray (a : P × G) : Array.Name (Coeff.Name k) G := + [(Coeff.complement (e a.1),N.one),(e a.1,a.2)] + +def array (w : Word P G) : Array.Name (Coeff.Name k) G := + w.foldr (fun a p => Array.product Coeff.mul N.mul (rootArray N e a) p) [(Coeff.one,N.one)] + +def pointArray (x : Point P G X) : Array.Name (Coeff.Name k) X := + Array.product Coeff.mul N.act (array N e x.1) [(Coeff.one,x.2)] + + theorem rootArray_bound (a : P × G) : ∀ b ∈ rootArray N e a, N.gcost b.2 ≤ N.gcost a.2 := by + intro b hb + simp only [rootArray,List.mem_cons,List.not_mem_nil,or_false] at hb + rcases hb with rfl | rfl + · simp [N.cost_one] + · exact le_rfl + + theorem array_bound (w : Word P G) : ∀ b ∈ array N e w, N.gcost b.2 ≤ gcost N w := by + induction w with + | nil => intro b hb; simp only [array,List.foldr_nil,List.mem_singleton] at hb + simp [hb,N.cost_one] + | cons a w ih => + exact Array.product_bound Coeff.mul N.mul N.gcost N.gcost N.cost_mul + (rootArray_bound N e a) ih + + theorem pointArray_bound (x : Point P G X) : ∀ b ∈ pointArray N e x, N.xcost b.2 ≤ xcost N x := by + apply Array.product_bound Coeff.mul N.act N.gcost N.xcost N.cost_act (array_bound N e x.1) + intro b hb + simp only [List.mem_singleton] at hb + simp [hb] + +variable {V Y K L : Type*} [Group V] [MulAction V Y] [Nonempty Y] {m : ℕ} + {C : ActionCalculus V Y K L m} (I : Interpretation N C) + (he : ∀ p, Coeff.value (e p) * Coeff.value (e p) = Coeff.value (e p)) + +abbrev D (k : Type*) [CommRing k] := BinaryPrefixOperators.algebra k + +def rootValue (a : P × G) : (MonoidAlgebra (D k) V)ˣ := + SourceEnlargement.unitMap (Coeff.value (e a.1)) (he a.1) (I.group a.2).val + +def groupValue (w : Word P G) : (MonoidAlgebra (D k) V)ˣ := (w.map (rootValue N e I he)).prod + +omit [Nonempty Y] in +@[simp] theorem groupValue_nil : groupValue N e I he [] = 1 := rfl +omit [Nonempty Y] in +@[simp] theorem groupValue_cons (a : P × G) (w : Word P G) : + groupValue N e I he (a::w) = rootValue N e I he a * groupValue N e I he w := rfl +omit [Nonempty Y] in +@[simp] theorem groupValue_append (a b : Word P G) : + groupValue N e I he (a++b) = groupValue N e I he a * groupValue N e I he b := by simp [groupValue] + +omit [Nonempty Y] in +@[simp] theorem rootValue_inv (a : P × G) : + rootValue N e I he (rootInv N a) = (rootValue N e I he a)⁻¹ := by + simp only [rootValue,rootInv,I.inv] + exact map_inv _ _ + +omit [Nonempty Y] in +@[simp] theorem groupValue_inverse (w : Word P G) : + groupValue N e I he (inverse N w) = (groupValue N e I he w)⁻¹ := by + induction w with + | nil => simp + | cons a w ih => simp [ih,mul_inv_rev] + +def pointValue (x : Point P G X) : Y →₀ D k := + groupValue N e I he x.1 • Finsupp.single (I.point x.2).val 1 + +omit [Nonempty Y] in +@[simp] theorem pointValue_act (w : Word P G) (x : Point P G X) : + pointValue N e I he (w++x.1,x.2) = + @SMul.smul _ _ SourceEnlargement.unitsAction.toSMul (groupValue N e I he w) (pointValue N e I he x) := by + simp only [pointValue,groupValue_append,mul_smul] + rfl + +omit [Nonempty Y] in +@[simp] theorem value_rootArray (a : P × G) : + Array.algebraValue Coeff.value (fun g => (I.group g).val) (rootArray N e a) = + (rootValue N e I he a).val := by + simp only [rootArray,Array.algebraValue_cons,Array.algebraValue_nil,add_zero,Coeff.value_complement,I.one] + rfl + +omit [Nonempty Y] in +@[simp] theorem value_array (w : Word P G) : + Array.algebraValue Coeff.value (fun g => (I.group g).val) (array N e w) = + (groupValue N e I he w).val := by + induction w with + | nil => simp only [array,List.foldr_nil,Array.algebraValue_cons,Array.algebraValue_nil,add_zero, + I.one,Coeff.value_one]; rfl + | cons a w ih => + change Array.algebraValue _ _ (Array.product Coeff.mul N.mul (rootArray N e a) (array N e w)) = _ + rw [Array.algebraValue_product _ _ _ _ Coeff.value_mul (fun g h => congrArg WithBound.val (I.mul g h)), + value_rootArray N e I he,ih] + rfl + +omit [Nonempty Y] in +@[simp] theorem value_pointArray (x : Point P G X) : + Array.value Coeff.value (fun x => (I.point x).val) (pointArray N e x) = pointValue N e I he x := by + unfold pointArray + rw [Array.value_action _ _ _ _ _ Coeff.value_mul (fun g x => congrArg WithBound.val (I.act g x)), + value_array N e I he] + simp only [Array.value_cons,Array.value_nil,add_zero,Coeff.value_one] + rfl + + theorem group_mem (w : Word P G) : + groupValue N e I he w ∈ (C.enlargement (D k)).group.ball (gcost N w) := by + induction w with + | nil => exact (C.enlargement (D k)).one_mem _ + | cons a w ih => + apply (C.enlargement (D k)).mul_mem _ ih + have hh := C.unitMap_mem (D k) (Coeff.value (e a.1)) (he a.1) (I.group a.2).mem + simpa only [I.group_cost,rootValue] using hh + + theorem point_mem (x : Point P G X) : + pointValue N e I he x ∈ (C.enlargement (D k)).point.ball (xcost N x) := by + apply (C.enlargement (D k)).smul_mem (group_mem N e I he x.1) + have hh := C.basis_mem (D k) (I.point x.2).mem + simpa only [I.point_cost] using hh + +end +end SimpleFInftyOvergroups.EffectiveNames.Enlargement + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleOvergroups/FamilyProgram.lean b/lean/OAI/GroupTheory/SimpleOvergroups/FamilyProgram.lean new file mode 100644 index 0000000000000000000000000000000000000000..39c4b1039dc24f607b26e50dcdb76abe7be4a5f7 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleOvergroups/FamilyProgram.lean @@ -0,0 +1,144 @@ +import Mathlib +import OAI.Computability.FiniteCompiler.Normalization +import OAI.GroupTheory.BooneHigman.TreeCoherence +import OAI.GroupTheory.SimpleOvergroups.EffectiveTables +import OAI.GroupTheory.SimpleOvergroups.FamilyTables + +namespace OAI + + +namespace SimpleFInftyOvergroups.ContextualEncoding +open FiniteAlgebraicEnvelopes FiniteAlgebraicEnvelopes.Bootstrap + +namespace CodeTable +variable {A S Q : Type*} {r : S → S → Prop} [Std.Trichotomous r] + +theorem table_zero (C : DelimiterCode A S) (E : FiniteSearch C) + (wf : WellFounded r) (q : List A → Option Q) (z : S) : + table C E wf q z 0 = [] := by + apply List.eq_nil_iff_forall_not_mem.mpr + rintro ⟨u,v⟩ hp + obtain ⟨w,hw,hn,_,_,_⟩ := (mem_table C E wf q z).mp hp + exact hn ((C.encode_eq_nil _).mp (List.length_eq_zero_iff.mp (Nat.eq_zero_of_le_zero hw))) +end CodeTable + +namespace Families +variable {I S : Type*} {A Q : I → Type*} [Fintype I] [Fintype S] +variable {r : S → S → Prop} [Std.Trichotomous r] +variable (C : ∀ i, DelimiterCode (A i) S) (E : ∀ i, FiniteSearch (C i)) + (wf : WellFounded r) (q : ∀ i, List (A i) → Option (Q i)) (z : S) + +theorem table_zero : table C E wf q z 0 = Base.absorption z := by + simp [table, CodeTable.table_zero] +end Families + +namespace FamilyProgram +variable {I S : Type*} {A Q : I → Type*} [Fintype I] [Fintype S] + [DecidableEq S] [∀ i, DecidableEq (A i)] [∀ i, DecidableEq (Q i)] +variable {r : S → S → Prop} [DecidableRel (List.Shortlex r)] +variable (C : ∀ i, DelimiterCode (A i) S) (E : ∀ i, FiniteSearch (C i)) + (z : S) (f : ∀ i, List (A i) → Part (Option (Q i))) + +noncomputable def compute (n : ℕ) : Part (List (List S × List S)) := + if n = 0 then Part.some (Base.absorption z) else + (Effect.traverse (fun i => CodedSearch.compute (r := r) (C i) (E i) z (f i) n) + (Static.letters I)).map (fun rs => Base.absorption z ++ rs.flatten) + +omit [∀ index, DecidableEq (A index)] in +@[simp] theorem compute_zero [∀ index, DecidableEq (A index)] : + compute (r := r) C E z f 0 = Part.some (Base.absorption z) := by + simp [compute] + +variable (wf : WellFounded r) [Std.Trichotomous r] + +theorem compute_full {n : ℕ} (q : ∀ i, List (A i) → Option (Q i)) + (h : ∀ i w, (C i |>.encode w).length ≤ n → q i w ∈ f i w) : + Families.table C E wf q z n ∈ compute (r := r) C E z f n := by + by_cases hn : n = 0 + · subst n + simp [compute_zero, Families.table_zero] + · rw [compute, ite_eq_right hn] + apply (Part.mem_map_iff _).mpr + refine ⟨(Static.letters I).map (fun i => CodeTable.table (C i) (E i) wf (q i) z n), ?_, ?_⟩ + · apply Search.traverse_map + intro i hi + exact CodedSearch.compute_full (C i) wf (q i) (E i) z (h i) + · simp only [Families.table, List.flatMap_def] + +omit [∀ index, DecidableEq (A index)] [Std.Trichotomous r] in +theorem compute_domain [∀ index, DecidableEq (A index)] [Std.Trichotomous r] + {n : ℕ} (hn : n ≠ 0) + (h : (compute (r := r) C E z f n).Dom) : + ∀ i w, (C i |>.encode w).length ≤ n → (f i w).Dom := by + rw [compute, ite_eq_right hn] at h + obtain ⟨out, ho⟩ := Part.dom_iff_mem.mp h + obtain ⟨rs, hrs, _⟩ := (Part.mem_map_iff _).mp ho + intro i + exact CodedSearch.compute_domain (C i) (E i) z + (Effect.traverse_domain hrs.1 i (by simp [Static.letters])) + +theorem compute_eq {n : ℕ} {rs : List (List S × List S)} + (h : rs ∈ compute (r := r) C E z f n) : + rs = Families.table C E wf (fun i => Search.value (f i)) z n := by + by_cases hn : n = 0 + · subst n + simpa [compute_zero, Families.table_zero] using h + · exact Part.mem_unique h (compute_full C E z f wf _ + (fun i w hw => Search.value_mem (compute_domain C E z f hn h.1 i w hw))) + +include wf + +theorem stable {k n : ℕ} (hkn : k ≤ n) + {rk rn : List (List S × List S)} + (hk : rk ∈ compute (r := r) C E z f k) (hn : rn ∈ compute (r := r) C E z f n) : + Selectors.BoundedEq rk rn k := by + rw [compute_eq C E z f wf hk, compute_eq C E z f wf hn] + exact Families.stable C E wf _ z hkn + +theorem good_zero : GoodTable (r := r) (compute (r := r) C E z f) 0 := by + refine ⟨Base.absorption z, by simp, ?_, ?_⟩ + · have hh := Families.decreasing C E wf (fun i => Search.value (f i)) z 0 + simpa only [Families.table_zero] using hh + · constructor + · intro u u' v v' hu hv x y he hlen + obtain ⟨a, ha, _⟩ := (Base.mem_absorption z).mp hu + rcases ha with rfl | rfl <;> simp at hlen + · intro u u' v v' hu hv p m t hm he hf hlen + have hml : m.length = 0 := by simp only [List.length_append] at hlen; omega + exact (hm (List.length_eq_zero_iff.mp hml)).elim + +theorem good_at (hz : ∀ i, z ∉ (C i).alphabet) + (hd : ∀ i j, i ≠ j → Disjoint (C i).alphabet (C j).alphabet) {n : ℕ} + (ht : ∀ i w, (C i |>.encode w).length ≤ n → (f i w).Dom) + (hzero : ∀ i, Search.value (f i) [] ≠ none) + (hc : ∀ i, CodeTable.Contextual (C i) (Search.value (f i)) n) + (hi : ∀ i, CodeTable.ZeroIdeal (C i) (Search.value (f i)) n) : + GoodTable (r := r) (compute (r := r) C E z f) n := + ⟨_, compute_full C E z f wf _ (fun i w hw => Search.value_mem (ht i w hw)), + Families.decreasing C E wf _ z n, Families.critical C E wf _ z hz hd hzero hc hi⟩ + +theorem bootstrap (normal : List S → Part (List S)) + (fixed : normal = tableNormal (compute (r := r) C E z f)) + (hz : ∀ i, z ∉ (C i).alphabet) + (hd : ∀ i j, i ≠ j → Disjoint (C i).alphabet (C j).alphabet) + (bounded : ∀ n, 0 < n → Compiler.PartialBudget normal (3 * (n / 10)) → + (∀ i w, (C i |>.encode w).length ≤ n → (f i w).Dom) ∧ + (∀ i, Search.value (f i) [] ≠ none) ∧ + (∀ i, CodeTable.Contextual (C i) (Search.value (f i)) n) ∧ + (∀ i, CodeTable.ZeroIdeal (C i) (Search.value (f i)) n)) : + ∀ n, GoodTable (r := r) (compute (r := r) C E z f) n ∧ + Compiler.PartialBudget normal n := by + apply bootstrap_length_induction wf _ normal fixed + · intro k n hkn rk hk rn hn + exact stable C E z f wf hkn hk hn + · intro n ih + by_cases hn : n = 0 + · subst n + exact good_zero C E z f wf + · obtain ⟨ht, hzero, hc, hi⟩ := bounded n (Nat.pos_of_ne_zero hn) + (ih _ (strict_dependency (Nat.pos_of_ne_zero hn))) + exact good_at C E z f wf hz hd ht hzero hc hi +end FamilyProgram +end SimpleFInftyOvergroups.ContextualEncoding + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleOvergroups/FamilyTables.lean b/lean/OAI/GroupTheory/SimpleOvergroups/FamilyTables.lean new file mode 100644 index 0000000000000000000000000000000000000000..93a4fe2d48185e75e4faf2c030cb60927f3fe0b6 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleOvergroups/FamilyTables.lean @@ -0,0 +1,163 @@ +import Mathlib +import OAI.Computability.FiniteCompiler.Quotients +import OAI.GroupTheory.SimpleOvergroups.ContextualTables + +namespace OAI + + +namespace SimpleFInftyOvergroups.ContextualEncoding +open FiniteAlgebraicEnvelopes.Bootstrap Relation + +namespace DelimiterCode +variable {A B S : Type*} + +def alphabet (C : DelimiterCode A S) : Set S := + {s | s = C.start ∨ s = C.stop ∨ ∃ a, s ∈ C.body a} + +theorem mem_alphabet_of_mem_encode (C : DelimiterCode A S) {s : S} {w : List A} + (hs : s ∈ C.encode w) : s ∈ C.alphabet := by + obtain ⟨a, _, ha⟩ := List.mem_flatMap.mp hs + simp only [block, List.mem_cons, List.mem_append, List.not_mem_nil, or_false] at ha + rcases ha with h | h | h + · exact Or.inl h + · exact Or.inr (Or.inr ⟨a, h⟩) + · exact Or.inr (Or.inl h) + +theorem avoids_of_not_mem_alphabet (C : DelimiterCode A S) {s : S} + (hs : s ∉ C.alphabet) (w : List A) : s ∉ C.encode w := + fun h => hs (C.mem_alphabet_of_mem_encode h) + +theorem disjoint_infix (C : DelimiterCode A S) (D : DelimiterCode B S) + (hd : Disjoint C.alphabet D.alphabet) {u : List A} {v : List B} + (hv : v ≠ []) (he : D.encode v <:+: C.encode u) : False := by + have hn : D.encode v ≠ [] := fun h => hv ((D.encode_eq_nil _).mp h) + obtain ⟨s, hs⟩ := List.exists_mem_of_ne_nil _ hn + exact (Set.disjoint_left.mp hd) (C.mem_alphabet_of_mem_encode (he.subset hs)) + (D.mem_alphabet_of_mem_encode hs) + +theorem disjoint_overlap (C : DelimiterCode A S) (D : DelimiterCode B S) + (hd : Disjoint C.alphabet D.alphabet) {u : List A} {v : List B} {p m q : List S} + (hm : m ≠ []) (he : C.encode u = p++m) (hf : D.encode v = m++q) : False := by + obtain ⟨s, hs⟩ := List.exists_mem_of_ne_nil _ hm + exact (Set.disjoint_left.mp hd) + (C.mem_alphabet_of_mem_encode (by rw [he]; exact List.mem_append_right _ hs)) + (D.mem_alphabet_of_mem_encode (by rw [hf]; exact List.mem_append_left _ hs)) +end DelimiterCode + +namespace Families +variable {I S : Type*} {A Q : I → Type*} [Fintype I] [Fintype S] +variable {r : S → S → Prop} [Std.Trichotomous r] +variable (C : ∀ i, DelimiterCode (A i) S) (E : ∀ i, FiniteSearch (C i)) + (wf : WellFounded r) (q : ∀ i, List (A i) → Option (Q i)) (z : S) + +noncomputable def table (n : ℕ) : List (List S × List S) := + Base.absorption z ++ (Static.letters I).flatMap (fun i => CodeTable.table (C i) (E i) wf (q i) z n) + +omit [Std.Trichotomous r] in +theorem mem_table [Std.Trichotomous r] {n : ℕ} {p : List S × List S} : p ∈ table C E wf q z n ↔ + p ∈ Base.absorption z ∨ ∃ i, p ∈ CodeTable.table (C i) (E i) wf (q i) z n := by + classical + simp [table, Static.letters] + +theorem absorbs (n : ℕ) : Absorbs (table C E wf q z n) z := by + classical + intro a + constructor <;> apply (mem_table C E wf q z).mpr <;> apply Or.inl <;> + apply (Base.mem_absorption z).mpr + · exact ⟨a, Or.inl rfl, rfl⟩ + · exact ⟨a, Or.inr rfl, rfl⟩ + +theorem preserves_zero (hz : ∀ i, z ∉ (C i).alphabet) (n : ℕ) : + ∀ p ∈ table C E wf q z n, z ∈ p.1 → z ∈ p.2 := by + classical + intro ⟨u,v⟩ hp hu + rcases (mem_table C E wf q z).mp hp with hp | ⟨i,hp⟩ + · obtain ⟨a,_,rfl⟩ := (Base.mem_absorption z).mp hp + simp + · obtain ⟨w,_,_,_,rfl,_⟩ := (CodeTable.mem_table (C i) (E i) wf (q i) z).mp hp + exact ((hz i) ((C i).mem_alphabet_of_mem_encode hu)).elim + +theorem critical (hz : ∀ i, z ∉ (C i).alphabet) + (hd : ∀ i j, i ≠ j → Disjoint (C i).alphabet (C j).alphabet) {n : ℕ} + (hzero : ∀ i, q i [] ≠ none) + (hc : ∀ i, CodeTable.Contextual (C i) (q i) n) + (hi : ∀ i, CodeTable.ZeroIdeal (C i) (q i) n) : Critical (table C E wf q z n) n := by + classical + let rs := table C E wf q z n + have hza : Absorbs rs z := absorbs C E wf q z n + have hp := preserves_zero C E wf q z hz n + have ht (i) : ∀ p ∈ CodeTable.table (C i) (E i) wf (q i) z n, p ∈ rs := + fun _ h => (mem_table C E wf q z).mpr (.inr ⟨i,h⟩) + have hzeroPeak {w u v : List S} (hw : z ∈ w) (hu : Step rs w u) (hv : Step rs w v) : + Join (Steps rs) u v := + ⟨[z], absorbs_mem hza (step_preserves_letter hp hw hu), + absorbs_mem hza (step_preserves_letter hp hw hv)⟩ + have hnabs {u v : List S} (h : z ∉ u) : (u,v) ∉ Base.absorption z := by + intro hh + obtain ⟨a,ha,_⟩ := (Base.mem_absorption z).mp hh + rcases ha with rfl | rfl <;> simp at h + constructor + · intro u u' v v' hu hv x y he hlen + by_cases huz : z ∈ u + · apply hzeroPeak huz + · simpa using Step.apply hu [] [] + · simpa only [he] using Step.apply hv x y + have hvz : z ∉ v := fun hh => huz (by simp [he,hh]) + have hut := (mem_table C E wf q z).mp hu + have hvt := (mem_table C E wf q z).mp hv + simp only [hnabs huz, hnabs hvz, false_or] at hut hvt + obtain ⟨i,hui⟩ := hut + obtain ⟨j,hvj⟩ := hvt + by_cases hij : i = j + · subst j + exact CodeTable.critical_containment (C i) (E i) wf (q i) z + (hzero i) hza (ht i) (hc i) (hi i) hui hvj he hlen + · obtain ⟨a,_,_,_,rfl,_⟩ := (CodeTable.mem_table (C i) (E i) wf (q i) z).mp hui + obtain ⟨b,_,hb,_,rfl,_⟩ := (CodeTable.mem_table (C j) (E j) wf (q j) z).mp hvj + exact ((C i).disjoint_infix (C j) (hd i j hij) hb ⟨x,y,he.symm⟩).elim + · intro u u' v v' hu hv p m t hm he hh hlen + by_cases hwz : z ∈ p++m++t + · apply hzeroPeak hwz + · simpa only [he, List.nil_append, List.append_assoc] using Step.apply hu [] t + · simpa only [hh, List.append_nil, List.append_assoc] using Step.apply hv p [] + have huz : z ∉ u := fun h => hwz (by simp [←he,h]) + have hvz : z ∉ v := fun h => hwz (by simpa only [List.append_assoc,←hh,List.mem_append] using Or.inr h) + have hut := (mem_table C E wf q z).mp hu + have hvt := (mem_table C E wf q z).mp hv + simp only [hnabs huz, hnabs hvz, false_or] at hut hvt + obtain ⟨i,hui⟩ := hut + obtain ⟨j,hvj⟩ := hvt + by_cases hij : i = j + · subst j + exact CodeTable.critical_overlap (C i) (E i) wf (q i) z + (hzero i) hza (ht i) (hc i) (hi i) hui hvj hm he hh hlen + · obtain ⟨a,_,_,_,rfl,_⟩ := (CodeTable.mem_table (C i) (E i) wf (q i) z).mp hui + obtain ⟨b,_,_,_,rfl,_⟩ := (CodeTable.mem_table (C j) (E j) wf (q j) z).mp hvj + exact ((C i).disjoint_overlap (C j) (hd i j hij) hm he hh).elim + +theorem decreasing (n : ℕ) : ∀ p ∈ table C E wf q z n, List.Shortlex r p.2 p.1 := by + classical + intro ⟨u,v⟩ hp + rcases (mem_table C E wf q z).mp hp with hp | ⟨i,hp⟩ + · obtain ⟨a,ha,rfl⟩ := (Base.mem_absorption z).mp hp + rcases ha with rfl | rfl <;> exact List.Shortlex.of_length_lt (by simp) + · exact CodeTable.decreasing (C i) (E i) wf (q i) z n (u,v) hp + +theorem stable {k n : ℕ} (hkn : k ≤ n) : + Selectors.BoundedEq (table C E wf q z k) (table C E wf q z n) k := by + intro p hp + simp only [mem_table] + exact or_congr Iff.rfl (exists_congr (fun i => CodeTable.stable (C i) (E i) wf (q i) z hkn p hp)) + +theorem good_at (hz : ∀ i, z ∉ (C i).alphabet) + (hd : ∀ i j, i ≠ j → Disjoint (C i).alphabet (C j).alphabet) {n : ℕ} + (hzero : ∀ i, q i [] ≠ none) + (hc : ∀ i, CodeTable.Contextual (C i) (q i) n) + (hi : ∀ i, CodeTable.ZeroIdeal (C i) (q i) n) : + GoodTable (r := r) (fun n => Part.some (table C E wf q z n)) n := + ⟨_, Part.mem_some_iff.mpr rfl, decreasing C E wf q z n, + critical C E wf q z hz hd hzero hc hi⟩ +end Families +end SimpleFInftyOvergroups.ContextualEncoding + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleOvergroups/FiniteNames.lean b/lean/OAI/GroupTheory/SimpleOvergroups/FiniteNames.lean new file mode 100644 index 0000000000000000000000000000000000000000..00d8d2e227546103d77f189c8f92996881d6d8b9 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleOvergroups/FiniteNames.lean @@ -0,0 +1,47 @@ +import Mathlib + +namespace OAI + +namespace SimpleFInftyOvergroups.EffectiveNames.Finite +variable {A B P : Type*} {n : ℕ} + +def traverse (f : A → Part B) (x : Fin n → A) : Part (Fin n → B) := + (List.Vector.mOfFn (fun i => f (x i))).map List.Vector.get + +theorem vector_full (f : Fin n → Part B) (g : Fin n → B) (h : ∀ i, g i ∈ f i) : + List.Vector.ofFn g ∈ List.Vector.mOfFn f := by + induction n with + | zero => exact Part.mem_some _ + | succ n ih => + simp only [List.Vector.mOfFn] + refine Part.mem_bind_iff.mpr ⟨g 0, h 0, ?_⟩ + exact Part.mem_bind_iff.mpr ⟨_,ih (fun i => f i.succ) (fun i => g i.succ) + (fun i => h i.succ), Part.mem_some _⟩ + +theorem traverse_full (f : A → Part B) (g : A → B) (x : Fin n → A) + (h : ∀ i, g (x i) ∈ f (x i)) : (fun i => g (x i)) ∈ traverse f x := by + change _ ∈ (List.Vector.mOfFn (fun i => f (x i))).map List.Vector.get + convert Part.mem_map List.Vector.get (vector_full (fun i => f (x i)) (fun i => g (x i)) h) using 1 + funext i + exact (List.Vector.get_ofFn (fun i => g (x i)) i).symm + +variable [Primcodable A] [Primcodable B] [Primcodable P] + + theorem partrec_traverse {f : P → A → Part B} (hf : Partrec₂ f) : + Partrec₂ (fun p : P => traverse (n:=n) (f p)) := by + have hh : ∀ i : Fin n, Partrec (fun p : P × (Fin n → A) => f p.1 (p.2 i)) := + fun i => hf.comp Computable.fst (Primrec.fin_app.to_comp.comp Computable.snd (Computable.const i)) + exact (Partrec.vector_mOfFn hh).map (Primrec.vector_get'.to_comp.comp Computable.snd).to₂ + + theorem computable_function {f : P → Fin n → B} (hf : ∀ i, Computable (fun p => f p i)) : + Computable f := by + exact (Primrec.vector_get'.to_comp.comp (Computable.vector_ofFn hf)).of_eq + (fun p => by funext i; simp) + + theorem primrec_function {f : P → Fin n → B} (hf : ∀ i, Primrec (fun p => f p i)) : + Primrec f := by + exact (Primrec.vector_get'.comp (Primrec.vector_ofFn hf)).of_eq + (fun p => by funext i; simp) +end SimpleFInftyOvergroups.EffectiveNames.Finite + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleOvergroups/FirstFamilies.lean b/lean/OAI/GroupTheory/SimpleOvergroups/FirstFamilies.lean new file mode 100644 index 0000000000000000000000000000000000000000..ea72f00fec27e03236fd08826fea2489e461cd99 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleOvergroups/FirstFamilies.lean @@ -0,0 +1,171 @@ +import Mathlib +import OAI.Computability.FiniteCompiler.Quotients +import OAI.Computability.FiniteCompiler.SelfReference +import OAI.Computability.FiniteCompiler.UniformPaths +import OAI.GroupTheory.BooneHigman.Basic +import OAI.GroupTheory.BooneHigman.PartialAffine +import OAI.GroupTheory.BooneHigman.WordProblem +import OAI.GroupTheory.SimpleOvergroups.TruncatedAlgebra + +namespace OAI + + +namespace SimpleFInftyOvergroups.ContextualEncoding +open FiniteAlgebraicEnvelopes Bootstrap BoundedEncoding +noncomputable section +open scoped Classical + +namespace GroupFamily +variable {G : Type*} [Group G] {k : ℕ} (s : Fin k → G) + +def test (w : List (Fin k × Bool)) : Part (Option (List (Fin k × Bool))) := + Part.some (some (WordProblem.testedClass s w)) + +theorem partrec_test (h : ComputablePred (fun w => FiniteAlgebraicEnvelopes.evalWord s w = 1)) : + Partrec (test s) := + (Primrec.option_some.to_comp.comp (WordProblem.computable_testedClass s h)).partrec + +theorem context {u v : List (Fin k × Bool)} (h : WordProblem.testedClass s u = WordProblem.testedClass s v) + (a b : List (Fin k × Bool)) : + WordProblem.testedClass s (a++u++b) = WordProblem.testedClass s (a++v++b) := by + apply (WordProblem.testedClass_eq_iff s _ _).mpr + simp only [WordProblem.evalWord_append] + rw [(WordProblem.testedClass_eq_iff s _ _).mp h] +end GroupFamily + +namespace ProductFamily +variable {A : Type*} +abbrev Letter (A : Type*) := A ⊕ PartialAffine.Letter +abbrev Key (A : Type*) := List A × List PartialAffine.Letter + +def cost (c : A → ℕ) : Letter A → ℕ := Sum.elim c (fun _ => 0) +def wordCost (c : A → ℕ) (w : List (Letter A)) : ℕ := (w.map (cost c)).sum + +@[simp] theorem wordCost_append (c : A → ℕ) (u v : List (Letter A)) : + wordCost c (u++v) = wordCost c u + wordCost c v := by simp [wordCost] + +theorem wordCost_projection (c : A → ℕ) (w : List (Letter A)) : + wordCost c w = ((Projection.left w).map c).sum := by + induction w with + | nil => rfl + | cons a w ih => + cases a <;> simp only [wordCost, List.map_cons, cost, Sum.elim_inl, Sum.elim_inr, + List.sum_cons, Projection.left, List.filterMap_cons, List.map_cons, List.sum_cons, zero_add] + · exact congrArg (c _ + ·) ih + · exact ih + +variable [DecidableEq A] +def combine (zero : List A) (q : Key A) : Option (Key A) := + if q.1 = zero then none else some q + +def test (zero : List A) (f : List A → Part (List A)) (w : List (Letter A)) : + Part (Option (Key A)) := + (f (Projection.left w)).map (fun u => combine zero (u,PartialAffine.testedClass (Projection.right w))) + +variable {m : ℕ} (C : WordCalculus (FreeMonoid A) m) + +def normal (w : List (Letter A)) : List A := + (C.normal (FreeMonoid.ofList (Projection.left w))).toList + +def value (w : List (Letter A)) : Option (Key A) := + combine C.omega.toList (normal C w,PartialAffine.testedClass (Projection.right w)) + +def grade (w : List (Letter A)) : ℕ := C.grade (FreeMonoid.ofList (Projection.left w)) + +omit [DecidableEq A] in +@[simp] theorem grade_nil : grade C [] = 0 := C.grade_one +omit [DecidableEq A] in +@[simp] theorem grade_append (u v : List (Letter A)) : grade C (u++v) = grade C u + grade C v := by + simp only [grade, Projection.left_append, FreeMonoid.ofList_append, C.grade_mul] + +omit [DecidableEq A] in +theorem grade_cost (g : A → ℕ) (hg : ∀ u, C.grade (FreeMonoid.ofList u) = (u.map g).sum) + (w : List (Letter A)) : grade C w = wordCost g w := by + rw [grade, hg, wordCost_projection] + +omit [DecidableEq A] in +theorem normal_context {u v : List (Letter A)} (h : normal C u = normal C v) + (a b : List (Letter A)) (hu : grade C (a++u++b) ≤ m) (hv : grade C (a++v++b) ≤ m) : + normal C (a++u++b) = normal C (a++v++b) := by + apply congrArg FreeMonoid.toList + simp only [grade, Projection.left_append, FreeMonoid.ofList_append] at hu hv ⊢ + exact C.context (FreeMonoid.toList.injective h) _ _ hu hv + +omit [DecidableEq A] in +theorem normal_zero_context {u : List (Letter A)} (h : normal C u = C.omega.toList) + (a b : List (Letter A)) (hu : grade C (a++u++b) ≤ m) : + normal C (a++u++b) = C.omega.toList := by + apply congrArg FreeMonoid.toList + have he : C.normal (FreeMonoid.ofList (Projection.left u)) = C.normal C.omega := by + rw [C.normal_omega] + exact FreeMonoid.toList.injective h + have hb : C.grade (FreeMonoid.ofList (Projection.left a) * C.omega * FreeMonoid.ofList (Projection.left b)) ≤ m := by + simp only [grade, Projection.left_append, FreeMonoid.ofList_append, C.grade_mul] at hu + simp only [C.grade_mul, C.grade_omega] + omega + simp only [grade, Projection.left_append, FreeMonoid.ofList_append] at hu ⊢ + exact (C.context he _ _ hu hb).trans (C.absorbs _ _) + +theorem value_context {u v : List (Letter A)} (h : value C u = value C v) + (a b : List (Letter A)) (hu : grade C (a++u++b) ≤ m) (hv : grade C (a++v++b) ≤ m) : + value C (a++u++b) = value C (a++v++b) := by + by_cases hz : normal C u = C.omega.toList + · have hvz : normal C v = C.omega.toList := by + by_contra hvz + simp [value, combine, hz, hvz] at h + simp only [value, combine, normal_zero_context C hz a b hu, + normal_zero_context C hvz a b hv, ite_true] + · have hvz : normal C v ≠ C.omega.toList := by + intro hvz + simp [value, combine, hz, hvz] at h + have he : normal C u = normal C v ∧ + PartialAffine.testedClass (Projection.right u) = PartialAffine.testedClass (Projection.right v) := by + simpa only [value,combine,ite_eq_right hz,ite_eq_right hvz,Option.some.injEq,Prod.mk.injEq] using h + have hcontext : PartialAffine.testedClass (Projection.right (a++u++b)) = + PartialAffine.testedClass (Projection.right (a++v++b)) := by + apply (PartialAffine.testedClass_eq_iff _ _).mpr + have hmaps := (PartialAffine.testedClass_eq_iff _ _).mp he.2 + simp only [PartialAffine.value] at hmaps + simp only [Projection.right_append, PartialAffine.value, List.map_append, List.prod_append] + rw [hmaps] + simp only [value, normal_context C he.1 a b hu hv, hcontext] + +theorem value_zero_context {u : List (Letter A)} (h : value C u = none) + (a b : List (Letter A)) (hu : grade C (a++u++b) ≤ m) : value C (a++u++b) = none := by + have hz : normal C u = C.omega.toList := by simpa [value,combine] using h + simp only [value,combine,normal_zero_context C hz a b hu,ite_true] + +@[simp] theorem value_nil : value C [] ≠ none := by + have hn : normal C [] ≠ C.omega.toList := by + intro h + have he := FreeMonoid.toList.injective h + exact C.omega_ne_one (by simpa only [Projection.left, List.filterMap_nil, FreeMonoid.ofList_nil, C.normal_one] using he.symm) + simp only [value,combine,ite_eq_right hn,ne_eq,Option.some_ne_none,not_false_eq_true] + +theorem test_full {f : List A → Part (List A)} {d : ℕ} (w : List (Letter A)) + (hw : grade C w ≤ d) + (hf : ∀ u, C.grade (FreeMonoid.ofList u) ≤ d → (C.normal (FreeMonoid.ofList u)).toList ∈ f u) : + value C w ∈ test C.omega.toList f w := + (Part.mem_map_iff _).mpr ⟨_,hf _ hw,rfl⟩ + +variable [Primcodable A] +theorem primrec_combine (zero : List A) : Primrec (combine zero) := + Primrec.ite (Primrec.eq.comp Primrec.fst (Primrec.const _)) (Primrec.const none) + (Primrec.option_some.comp Primrec.id) + +omit [DecidableEq A] in +theorem primrec_cost {c : A → ℕ} (hc : Primrec c) : Primrec (cost c) := + Effect.primrec_sumElim hc (Primrec.const 0) + +theorem partrec_test {P : Type*} [Primcodable P] {f : P → List A → Part (List A)} + (zero : List A) (hf : Partrec₂ f) : Partrec₂ (fun p => test zero (f p)) := by + have hp : Partrec₂ (fun p (w : List (Letter A)) => f p (Projection.left w)) := + hf.comp Computable.fst (Projection.primrec_left.to_comp.comp Computable.snd) + exact (hp.map ((primrec_combine zero).to_comp.comp + (Computable.snd.pair (PartialAffine.computable_testedClass.comp + (Projection.primrec_right.to_comp.comp (Computable.snd.comp Computable.fst))))).to₂).to₂ +end ProductFamily +end +end SimpleFInftyOvergroups.ContextualEncoding + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleOvergroups/Main.lean b/lean/OAI/GroupTheory/SimpleOvergroups/Main.lean new file mode 100644 index 0000000000000000000000000000000000000000..60a9ce8c4e8132193f9d319ec5a65c09c92d744e --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleOvergroups/Main.lean @@ -0,0 +1,59 @@ +import OAI.GroupTheory.SimpleOvergroups.CanonicalNames +import OAI.GroupTheory.SimpleOvergroups.ArrayNames +import OAI.GroupTheory.SimpleOvergroups.EnlargementCore +import OAI.GroupTheory.SimpleOvergroups.ArrayOperations +import OAI.GroupTheory.SimpleOvergroups.EffectiveArrays +import OAI.GroupTheory.SimpleOvergroups.PrefixArithmetic +import OAI.GroupTheory.SimpleOvergroups.PrefixLists +import OAI.GroupTheory.SimpleOvergroups.PrefixEffective +import OAI.GroupTheory.SimpleOvergroups.PrefixProduct +import OAI.GroupTheory.SimpleOvergroups.PrefixNames +import OAI.GroupTheory.SimpleOvergroups.TruncatedAlgebra +import OAI.GroupTheory.SimpleOvergroups.PolynomialNames +import OAI.GroupTheory.SimpleOvergroups.PolynomialBounds +import OAI.GroupTheory.SimpleOvergroups.FiniteNames +import OAI.GroupTheory.SimpleOvergroups.TruncatedMatrix +import OAI.GroupTheory.SimpleOvergroups.TruncatedAction +import OAI.GroupTheory.SimpleOvergroups.MatrixNames +import OAI.GroupTheory.SimpleOvergroups.TruncatedArrays +import OAI.GroupTheory.SimpleOvergroups.BoundedForms +import OAI.GroupTheory.SimpleOvergroups.BoundedContexts +import OAI.GroupTheory.SimpleOvergroups.NamedActions +import OAI.GroupTheory.SimpleOvergroups.Rekey +import OAI.GroupTheory.SimpleOvergroups.MatrixWords +import OAI.GroupTheory.SimpleOvergroups.MatrixEffective +import OAI.GroupTheory.SimpleOvergroups.EnlargementNames +import OAI.GroupTheory.SimpleOvergroups.EffectiveFold +import OAI.GroupTheory.SimpleOvergroups.EffectiveActions +import OAI.GroupTheory.SimpleOvergroups.PlanEffective +import OAI.GroupTheory.SimpleOvergroups.EnlargementEffective +import OAI.GroupTheory.SimpleOvergroups.DoubleEffective +import OAI.GroupTheory.SimpleOvergroups.CommonCompiler +import OAI.GroupTheory.SimpleOvergroups.VariableCode +import OAI.GroupTheory.SimpleOvergroups.EffectiveCode +import OAI.GroupTheory.SimpleOvergroups.ContextualTables +import OAI.GroupTheory.SimpleOvergroups.FamilyTables +import OAI.GroupTheory.SimpleOvergroups.EffectiveTables +import OAI.GroupTheory.SimpleOvergroups.FamilyProgram +import OAI.GroupTheory.SimpleOvergroups.FirstFamilies +import OAI.GroupTheory.SimpleOvergroups.EffectiveFamilies +import OAI.GroupTheory.SimpleOvergroups.ThreeCodes +import OAI.GroupTheory.SimpleOvergroups.BoundedFamilyTests +import OAI.GroupTheory.SimpleOvergroups.ContextualCompiler +import OAI.GroupTheory.SimpleOvergroups.ContractedNormalForms +import OAI.GroupTheory.SimpleOvergroups.CompilerSemantics +import OAI.GroupTheory.SimpleOvergroups.TwoEnlargements +import OAI.GroupTheory.SimpleOvergroups.SourceRingReduction +import OAI.GroupTheory.SimpleOvergroups.SemanticActions +import OAI.GroupTheory.SimpleOvergroups.SemanticEnlargements +import OAI.GroupTheory.SimpleOvergroups.ActionMonoid +import OAI.GroupTheory.SimpleOvergroups.SemanticActionMonoid +import OAI.GroupTheory.SimpleOvergroups.SemanticDouble +import OAI.GroupTheory.SimpleOvergroups.SemanticTests +import OAI.GroupTheory.SimpleOvergroups.SemanticProduct +import OAI.GroupTheory.SimpleOvergroups.CodeEmbedding +import OAI.GroupTheory.SimpleOvergroups.SourceModel +import OAI.GroupTheory.SimpleOvergroups.RingAssemblyTools +import OAI.GroupTheory.SimpleOvergroups.RingModel +import OAI.GroupTheory.SimpleOvergroups.ActionCorner +import OAI.GroupTheory.SimpleOvergroups.SourceProducer diff --git a/lean/OAI/GroupTheory/SimpleOvergroups/MatrixEffective.lean b/lean/OAI/GroupTheory/SimpleOvergroups/MatrixEffective.lean new file mode 100644 index 0000000000000000000000000000000000000000..92423664b41caffad5161966a906f4bdaf2e4d98 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleOvergroups/MatrixEffective.lean @@ -0,0 +1,146 @@ +import Mathlib +import OAI.GroupTheory.SimpleOvergroups.MatrixWords +import OAI.GroupTheory.SimpleOvergroups.Rekey + +namespace OAI + + +namespace SimpleFInftyOvergroups.BoundedEncoding.WithBound + theorem ext' {A K : Type*} {B : KeyBall A K} {a b : WithBound B} + (hv : a.val = b.val) (hc : a.cost = b.cost) : a = b := by + cases a; cases b; cases hv; cases hc; rfl +end SimpleFInftyOvergroups.BoundedEncoding.WithBound + +namespace SimpleFInftyOvergroups.EffectiveNames.MatrixWords +open BoundedEncoding MatrixNames +noncomputable section +open scoped Classical +variable {A k : Type*} [CommRing k] {n m : ℕ} +variable [Primcodable A] [Primcodable k] [Finite k] +attribute [local instance] WordCalculus.rawMatrixAction + +def pairedKey (x : Matrix (Fin n) (Fin n) (Raw k A) × Matrix (Fin n) (Fin n) (Raw k A)) := + (matrixKey x.1,matrixKey x.2) + +omit [Finite k] in + theorem pairedKey_injective [Finite k] : Function.Injective (pairedKey (k:=k) (A:=A) (n:=n)) := by + intro x y h + exact Prod.ext (matrixKey_injective (congrArg Prod.fst h)) + (matrixKey_injective (congrArg Prod.snd h)) + +def calculus (C : WordCalculus (FreeMonoid A) m) := + (C.matrixActionCalculus k (Fin n)).rekey pairedKey columnKey pairedKey_injective columnKey_injective + +def groupLabel (C : WordCalculus (FreeMonoid A) m) (w : Word k A n) : (calculus (n:=n) (k:=k) C).GLabel := + ⟨groupValue w,gcost (grade C) w,groupValue_mem C w⟩ + +def pointLabel (C : WordCalculus (FreeMonoid A) m) (x : Point k A n) : (calculus (n:=n) (k:=k) C).XLabel := + ⟨pointValue x,xcost (grade C) x,pointValue_mem C x⟩ + +def interpretation (C : WordCalculus (FreeMonoid A) m) : + NamedAction.Interpretation (nameOperations (n:=n) (k:=k) (grade C)) (calculus (k:=k) (n:=n) C) where + group := groupLabel C + point := pointLabel C + group_cost w := rfl + point_cost x := rfl + one := WithBound.ext' groupValue_nil rfl + mul a b := WithBound.ext' (groupValue_append a b) (gcost_append _ a b) + inv w := WithBound.ext' (groupValue_inverse w) (gcost_inverse _ w) + act g x := WithBound.ext' (pointValue_act g x) + (by change gcost _ (g++x.1) + columnCost _ x.2 = gcost _ g + xcost _ x + simp [gcost_append,xcost,Nat.add_assoc]) + +def partialGroupKey (omega : List A) (f : List A → Part (List A)) (w : Word k A n) : + Part ((Fin n → Fin n → ℕ) × (Fin n → Fin n → ℕ)) := + (partialMatrixKey omega f (matrix w)).bind fun a => + (partialMatrixKey omega f (matrix (inverse w))).map (fun b => (a,b)) + +def partialPointKey (omega : List A) (f : List A → Part (List A)) (x : Point k A n) : + Part (Fin n → ℕ) := partialColumnKey omega f (column x) + + theorem partialGroupKey_full (C : WordCalculus (FreeMonoid A) m) + (f : List A → Part (List A)) (w : Word k A n) {d : ℕ} + (hw : gcost (grade C) w ≤ d) + (h : ∀ u, grade C u ≤ d → (C.normal (FreeMonoid.ofList u)).toList ∈ f u) : + (interpretation (k:=k) (n:=n) C).gkey w ∈ partialGroupKey C.omega.toList f w := by + have hp := partialMatrixKey_full C f (matrix w) + ((cost_matrix (grade C) (grade_nil C) (grade_append C) w).trans hw) h + have hi := partialMatrixKey_full C f (matrix (inverse w)) + ((cost_matrix (grade C) (grade_nil C) (grade_append C) (inverse w)).trans (by simpa using hw)) h + change (matrixKey (C.matrixCollect k (groupValue w).val), + matrixKey (C.matrixCollect k (groupValue w).inv)) ∈ _ + simp only [value_matrix,groupValue_inverse] at hp hi + exact Part.mem_bind_iff.mpr ⟨_,hp,Part.mem_map _ hi⟩ + + theorem partialPointKey_full (C : WordCalculus (FreeMonoid A) m) + (f : List A → Part (List A)) (x : Point k A n) {d : ℕ} + (hx : xcost (grade C) x ≤ d) + (h : ∀ u, grade C u ≤ d → (C.normal (FreeMonoid.ofList u)).toList ∈ f u) : + (interpretation (k:=k) (n:=n) C).xkey x ∈ partialPointKey C.omega.toList f x := by + have hh := partialColumnKey_full C f (column x) + ((cost_column (grade C) (grade_nil C) (grade_append C) x).trans hx) h + change columnKey (C.columnCollect k (pointValue x)) ∈ partialColumnKey C.omega.toList f (column x) + simpa only [value_column] using hh + + theorem primrec_rootInv : Primrec (rootInv (k:=k) (A:=A) (n:=n)) := + Primrec.fst.pair ((Primrec.fst.comp Primrec.snd).pair + (Polynomial.primrec_negate.comp (Primrec.snd.comp Primrec.snd))) + + theorem primrec_inverse : Primrec (inverse (k:=k) (A:=A) (n:=n)) := + Primrec.list_map Primrec.list_reverse (primrec_rootInv.comp Primrec.snd).to₂ + +omit [Finite k] in + theorem primrec_rootMatrix [Finite k] : Primrec (rootMatrix (k:=k) (A:=A) (n:=n)) := by + apply Finite.primrec_function + intro i + apply Finite.primrec_function + intro j + have ht : PrimrecPred (fun r : Root k A n => r.1 ≠ r.2.1 ∧ r.1=i ∧ r.2.1=j) := + ((Primrec.dom_finite fun p : Fin n × Fin n => decide (p.1 ≠ p.2 ∧ p.1=i ∧ p.2=j)).comp + (Primrec.fst.pair (Primrec.fst.comp Primrec.snd))).primrecPred + exact Primrec.list_append.comp (Primrec.const (oneName i j)) + (Primrec.ite ht (Primrec.snd.comp Primrec.snd) (Primrec.const [])) + + theorem primrec_matrix : Primrec (matrix (k:=k) (A:=A) (n:=n)) := + Primrec.list_foldr Primrec.id (Primrec.const oneName) + (MatrixNames.primrec_product.comp (primrec_rootMatrix.comp (Primrec.fst.comp Primrec.snd)) + (Primrec.snd.comp Primrec.snd)).to₂ + + theorem primrec_column : Primrec (column (k:=k) (A:=A) (n:=n)) := + primrec_mulVec.comp (primrec_matrix.comp Primrec.fst) Primrec.snd + +omit [CommRing k] [Finite k] in + theorem primrec_gcost [CommRing k] [Finite k] {grade : List A → ℕ} (hg : Primrec grade) : + Primrec (gcost (k:=k) (n:=n) grade) := by + have hs : Primrec (fun l : List ℕ => l.sum) := + (Primrec.list_foldr Primrec.id (Primrec.const 0) + (Primrec.nat_add.comp (Primrec.fst.comp Primrec.snd) (Primrec.snd.comp Primrec.snd)).to₂).of_eq + (fun _ => rfl) + exact hs.comp (Primrec.list_map Primrec.id + ((Polynomial.primrec_cost hg).comp (Primrec.snd.comp (Primrec.snd.comp Primrec.snd))).to₂) + + theorem primrec_xcost {grade : List A → ℕ} (hg : Primrec grade) : + Primrec (xcost (k:=k) (n:=n) grade) := + Primrec.nat_add.comp ((primrec_gcost hg).comp Primrec.fst) + ((primrec_columnCost hg).comp Primrec.snd) + +variable {P : Type*} [Primcodable P] {f : P → List A → Part (List A)} + theorem partrec_partialGroupKey (omega : List A) (hf : Partrec₂ f) : + Partrec₂ (fun p : P => partialGroupKey (k:=k) (n:=n) omega (f p)) := by + have hp : Partrec (fun p : P × Word k A n => partialMatrixKey omega (f p.1) (matrix p.2)) := + (partrec_partialMatrixKey omega hf).comp Computable.fst (primrec_matrix.to_comp.comp Computable.snd) + apply hp.bind + have hi : Partrec (fun p : (P × Word k A n) × (Fin n → Fin n → ℕ) => + partialMatrixKey omega (f p.1.1) (matrix (inverse p.1.2))) := + (partrec_partialMatrixKey omega hf).comp (Computable.fst.comp Computable.fst) + (primrec_matrix.to_comp.comp (primrec_inverse.to_comp.comp (Computable.snd.comp Computable.fst))) + exact (hi.map ((Computable.snd.comp Computable.fst).pair Computable.snd).to₂).to₂ + + theorem partrec_partialPointKey (omega : List A) (hf : Partrec₂ f) : + Partrec₂ (fun p : P => partialPointKey (k:=k) (n:=n) omega (f p)) := + (partrec_partialColumnKey omega hf).comp Computable.fst (primrec_column.to_comp.comp Computable.snd) + +end +end SimpleFInftyOvergroups.EffectiveNames.MatrixWords + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleOvergroups/MatrixNames.lean b/lean/OAI/GroupTheory/SimpleOvergroups/MatrixNames.lean new file mode 100644 index 0000000000000000000000000000000000000000..fd0e5c408f1c3e506e02ee7fa05c2aaa88809189 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleOvergroups/MatrixNames.lean @@ -0,0 +1,206 @@ +import Mathlib +import OAI.GroupTheory.SimpleOvergroups.FiniteNames +import OAI.GroupTheory.SimpleOvergroups.PolynomialBounds +import OAI.GroupTheory.SimpleOvergroups.PolynomialNames +import OAI.GroupTheory.SimpleOvergroups.TruncatedMatrix + +namespace OAI + + +namespace SimpleFInftyOvergroups.EffectiveNames.MatrixNames +open BoundedEncoding +noncomputable section +open scoped Classical +variable {A k : Type*} [CommRing k] {n : ℕ} +abbrev Column (k A : Type*) (n : ℕ) := Fin n → Polynomial.Name k A +abbrev Name (k A : Type*) (n : ℕ) := Fin n → Column k A n +abbrev Raw (k A : Type*) [CommRing k] := MonoidAlgebra k (FreeMonoid A) + +def columnValue (x : Column k A n) : Fin n → Raw k A := fun i => Polynomial.value (x i) +def value (a : Name k A n) : Matrix (Fin n) (Fin n) (Raw k A) := fun i => columnValue (a i) + +def maximum (f : Fin n → ℕ) : ℕ := (List.ofFn f).foldr max 0 + +theorem maximum_le_iff (f : Fin n → ℕ) (b : ℕ) : maximum f ≤ b ↔ ∀ i, f i ≤ b := by + suffices h : ∀ l : List ℕ, l.foldr max 0 ≤ b ↔ ∀ x ∈ l, x ≤ b by + simp only [maximum,h,List.mem_ofFn,forall_exists_index,forall_apply_eq_imp_iff] + intro l + induction l with + | nil => simp + | cons a l ih => simp only [List.foldr_cons,max_le_iff,ih,List.mem_cons,forall_eq_or_imp] + + theorem le_maximum (f : Fin n → ℕ) (i : Fin n) : f i ≤ maximum f := + (maximum_le_iff f _).mp le_rfl i + +def columnCost (grade : List A → ℕ) (x : Column k A n) := maximum (fun i => Polynomial.cost grade (x i)) +def cost (grade : List A → ℕ) (a : Name k A n) := maximum (fun i => columnCost grade (a i)) + +omit [CommRing k] in + theorem entry_cost_le (grade : List A → ℕ) (a : Name k A n) (i j : Fin n) : + Polynomial.cost grade (a i j) ≤ cost grade a := + (le_maximum (fun j => Polynomial.cost grade (a i j)) j).trans + (le_maximum (fun i => columnCost grade (a i)) i) + +omit [CommRing k] in + theorem column_entry_cost_le (grade : List A → ℕ) (x : Column k A n) (i : Fin n) : + Polynomial.cost grade (x i) ≤ columnCost grade x := le_maximum (fun i => Polynomial.cost grade (x i)) i + +def oneName : Name k A n := fun i j => if i=j then Polynomial.oneName else [] + +def product (a b : Name k A n) : Name k A n := + fun i j => (List.ofFn (fun l => Polynomial.product (a i l) (b l j))).flatten + +def mulVec (a : Name k A n) (x : Column k A n) : Column k A n := + fun i => (List.ofFn (fun j => Polynomial.product (a i j) (x j))).flatten + +@[simp] theorem value_oneName : value (oneName : Name k A n) = 1 := by + funext i j + by_cases h : i=j <;> simp [value,columnValue,oneName,Matrix.one_apply,h] + +@[simp] theorem value_product (a b : Name k A n) : value (product a b) = value a * value b := by + ext i j + simp only [value,columnValue,product,Polynomial.value_flatten,List.map_ofFn, + Polynomial.value_product,Function.comp_def,List.sum_ofFn,Matrix.mul_apply] + +@[simp] theorem value_mulVec (a : Name k A n) (x : Column k A n) : + columnValue (mulVec a x) = (value a).mulVec (columnValue x) := by + ext i + simp only [value,columnValue,mulVec,Polynomial.value_flatten,List.map_ofFn, + Polynomial.value_product,Function.comp_def,List.sum_ofFn,Matrix.mulVec,dotProduct] + + theorem cost_oneName (grade : List A → ℕ) (h0 : grade [] = 0) : + cost grade (oneName : Name k A n) = 0 := by + apply Nat.eq_zero_of_le_zero + rw [cost,maximum_le_iff] + intro i + rw [columnCost,maximum_le_iff] + intro j + by_cases h : i=j <;> simp [oneName,h,Polynomial.cost_oneName grade h0] + + theorem cost_product_le (grade : List A → ℕ) + (ha : ∀ u v, grade (u++v) = grade u + grade v) (a b : Name k A n) : + cost grade (product a b) ≤ cost grade a + cost grade b := by + rw [cost,maximum_le_iff] + intro i + rw [columnCost,maximum_le_iff] + intro j + apply Polynomial.cost_flatten_le + intro p hp + obtain ⟨l,rfl⟩ := List.mem_ofFn.mp hp + exact (Polynomial.cost_product_le grade ha _ _).trans + (Nat.add_le_add (entry_cost_le _ a i l) (entry_cost_le _ b l j)) + + theorem cost_mulVec_le (grade : List A → ℕ) + (ha : ∀ u v, grade (u++v) = grade u + grade v) (a : Name k A n) (x : Column k A n) : + columnCost grade (mulVec a x) ≤ cost grade a + columnCost grade x := by + rw [columnCost,maximum_le_iff] + intro i + apply Polynomial.cost_flatten_le + intro p hp + obtain ⟨j,rfl⟩ := List.mem_ofFn.mp hp + exact (Polynomial.cost_product_le grade ha _ _).trans + (Nat.add_le_add (entry_cost_le _ a i j) (column_entry_cost_le _ x j)) + +variable {m : ℕ} (C : WordCalculus (FreeMonoid A) m) + theorem mem_ball (a : Name k A n) : + C.MatrixBall k (cost (fun w => C.grade (FreeMonoid.ofList w)) a) (value a) := + fun i j => C.ball_mono k (entry_cost_le _ a i j) (Polynomial.mem_ball C (a i j)) + + theorem column_mem_ball (x : Column k A n) : + C.ColumnBall k (columnCost (fun w => C.grade (FreeMonoid.ofList w)) x) (columnValue x) := + fun i => C.ball_mono k (column_entry_cost_le _ x i) (Polynomial.mem_ball C (x i)) + +variable [Primcodable A] [Primcodable k] [Finite k] + + theorem primrec_maximum : Primrec (maximum (n:=n)) := by + unfold maximum + exact Primrec.list_foldr (Primrec.list_ofFn (fun i => Primrec.fin_app.comp Primrec.id (Primrec.const i))) + (Primrec.const 0) (Primrec.nat_max.comp (Primrec.fst.comp Primrec.snd) + (Primrec.snd.comp Primrec.snd)).to₂ + +omit [CommRing k] [Finite k] in + theorem primrec_columnCost {grade : List A → ℕ} (hg : Primrec grade) : + Primrec (columnCost (k:=k) (n:=n) grade) := + primrec_maximum.comp (Finite.primrec_function fun i => + (Polynomial.primrec_cost hg).comp (Primrec.fin_app.comp Primrec.id (Primrec.const i))) + +omit [CommRing k] [Finite k] in + theorem primrec_cost {grade : List A → ℕ} (hg : Primrec grade) : + Primrec (cost (k:=k) (n:=n) grade) := + primrec_maximum.comp (Finite.primrec_function fun i => + (primrec_columnCost hg).comp (Primrec.fin_app.comp Primrec.id (Primrec.const i))) + + theorem primrec_product : Primrec₂ (product (k:=k) (A:=A) (n:=n)) := by + apply Finite.primrec_function + intro i + apply Finite.primrec_function + intro j + exact Primrec.list_flatten.comp (Primrec.list_ofFn fun l => Polynomial.primrec_product.comp + (Primrec.fin_app.comp (Primrec.fin_app.comp Primrec.fst (Primrec.const i)) (Primrec.const l)) + (Primrec.fin_app.comp (Primrec.fin_app.comp Primrec.snd (Primrec.const l)) (Primrec.const j))) + + theorem primrec_mulVec : Primrec₂ (mulVec (k:=k) (A:=A) (n:=n)) := by + apply Finite.primrec_function + intro i + exact Primrec.list_flatten.comp (Primrec.list_ofFn fun j => Polynomial.primrec_product.comp + (Primrec.fin_app.comp (Primrec.fin_app.comp Primrec.fst (Primrec.const i)) (Primrec.const j)) + (Primrec.fin_app.comp Primrec.snd (Primrec.const j))) + +def columnKey (x : Fin n → Raw k A) : Fin n → ℕ := fun i => Polynomial.valueKey (x i) +def matrixKey (a : Matrix (Fin n) (Fin n) (Raw k A)) : Fin n → Fin n → ℕ := + fun i => columnKey (a i) + +omit [Finite k] in + theorem columnKey_injective : Function.Injective (columnKey (k:=k) (A:=A) (n:=n)) := by + intro x y h + funext i + exact Polynomial.valueKey_injective (congrFun h i) + +omit [Finite k] in + theorem matrixKey_injective : Function.Injective (matrixKey (k:=k) (A:=A) (n:=n)) := by + intro x y h + funext i + exact columnKey_injective (congrFun h i) + +def partialColumnKey (omega : List A) (f : List A → Part (List A)) (x : Column k A n) : + Part (Fin n → ℕ) := Finite.traverse (Polynomial.partialKey omega f) x + +def partialMatrixKey (omega : List A) (f : List A → Part (List A)) (a : Name k A n) : + Part (Fin n → Fin n → ℕ) := Finite.traverse (partialColumnKey omega f) a + +omit [Finite k] in + theorem partialColumnKey_full (f : List A → Part (List A)) (x : Column k A n) {d : ℕ} + (hx : columnCost (fun w => C.grade (FreeMonoid.ofList w)) x ≤ d) + (h : ∀ w, C.grade (FreeMonoid.ofList w) ≤ d → (C.normal (FreeMonoid.ofList w)).toList ∈ f w) : + columnKey (C.columnCollect k (columnValue x)) ∈ partialColumnKey C.omega.toList f x := by + apply Finite.traverse_full (Polynomial.partialKey C.omega.toList f) + (fun p => Polynomial.valueKey (C.collect k (Polynomial.value p))) x + intro i + apply Polynomial.partialKey_full C + intro a ha + exact h a.2 ((Polynomial.term_cost_le _ ha).trans ((column_entry_cost_le _ x i).trans hx)) + +omit [Finite k] in + theorem partialMatrixKey_full (f : List A → Part (List A)) (a : Name k A n) {d : ℕ} + (hx : cost (fun w => C.grade (FreeMonoid.ofList w)) a ≤ d) + (h : ∀ w, C.grade (FreeMonoid.ofList w) ≤ d → (C.normal (FreeMonoid.ofList w)).toList ∈ f w) : + matrixKey (C.matrixCollect k (value a)) ∈ partialMatrixKey C.omega.toList f a := by + apply Finite.traverse_full (partialColumnKey C.omega.toList f) + (fun x => columnKey (C.columnCollect k (columnValue x))) a + intro i + exact partialColumnKey_full C f (a i) ((le_maximum (fun i => columnCost (fun w => C.grade (FreeMonoid.ofList w)) (a i)) i).trans hx) h + +variable {P : Type*} [Primcodable P] {f : P → List A → Part (List A)} + + theorem partrec_partialColumnKey (omega : List A) (hf : Partrec₂ f) : + Partrec₂ (fun p : P => partialColumnKey (k:=k) (n:=n) omega (f p)) := + Finite.partrec_traverse (Polynomial.partrec_partialKey omega hf) + + theorem partrec_partialMatrixKey (omega : List A) (hf : Partrec₂ f) : + Partrec₂ (fun p : P => partialMatrixKey (k:=k) (n:=n) omega (f p)) := + Finite.partrec_traverse (partrec_partialColumnKey omega hf) + +end +end SimpleFInftyOvergroups.EffectiveNames.MatrixNames + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleOvergroups/MatrixWords.lean b/lean/OAI/GroupTheory/SimpleOvergroups/MatrixWords.lean new file mode 100644 index 0000000000000000000000000000000000000000..a96d668e4b887b89ea908c5a0cf7413a801d96a8 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleOvergroups/MatrixWords.lean @@ -0,0 +1,181 @@ +import Mathlib +import OAI.GroupTheory.SimpleOvergroups.MatrixNames +import OAI.GroupTheory.SimpleOvergroups.NamedActions +import OAI.GroupTheory.SimpleOvergroups.PolynomialBounds + +namespace OAI + + +namespace SimpleFInftyOvergroups.EffectiveNames.MatrixWords +open BoundedEncoding MatrixNames +noncomputable section +open scoped Classical +variable {A k : Type*} [CommRing k] {n : ℕ} + +abbrev Root (k A : Type*) (n : ℕ) := Fin n × Fin n × Polynomial.Name k A +abbrev Word (k A : Type*) (n : ℕ) := List (Root k A n) +abbrev Point (k A : Type*) (n : ℕ) := Word k A n × Column k A n +abbrev V (k A : Type*) [CommRing k] (n : ℕ) := (Matrix (Fin n) (Fin n) (Raw k A))ˣ + +def rootInv (r : Root k A n) : Root k A n := (r.1,r.2.1,Polynomial.negate r.2.2) +def inverse (w : Word k A n) : Word k A n := w.reverse.map rootInv + +def rootValue (r : Root k A n) : V k A n := + if h : r.1 ≠ r.2.1 then FiniteAlgebraicEnvelopes.Steinberg.elementary r.1 r.2.1 h (Polynomial.value r.2.2) + else 1 + +def groupValue (w : Word k A n) : V k A n := (w.map rootValue).prod + +@[simp] theorem groupValue_nil : groupValue ([] : Word k A n) = 1 := rfl +@[simp] theorem groupValue_cons (r : Root k A n) (w : Word k A n) : + groupValue (r::w) = rootValue r * groupValue w := rfl +@[simp] theorem groupValue_append (a b : Word k A n) : + groupValue (a++b) = groupValue a * groupValue b := by simp [groupValue] + +@[simp] theorem rootValue_inv (r : Root k A n) : rootValue (rootInv r) = (rootValue r)⁻¹ := by + by_cases h : r.1 ≠ r.2.1 + · simp only [rootValue,rootInv,dite_eq_left h,Polynomial.value_negate] + apply Units.ext + simp only [FiniteAlgebraicEnvelopes.Steinberg.elementary_val, + FiniteAlgebraicEnvelopes.Steinberg.elementary_inv_val, + Matrix.single_neg,sub_eq_add_neg] + · simp [rootValue,rootInv,h] + +@[simp] theorem inverse_nil : inverse ([] : Word k A n) = [] := rfl +@[simp] theorem inverse_cons (r : Root k A n) (w : Word k A n) : + inverse (r::w) = inverse w ++ [rootInv r] := by simp [inverse] + +@[simp] theorem groupValue_inverse (w : Word k A n) : groupValue (inverse w) = (groupValue w)⁻¹ := by + induction w with + | nil => simp + | cons r w ih => simp [ih,mul_inv_rev] + +def gcost (grade : List A → ℕ) (w : Word k A n) : ℕ := + (w.map (fun r => Polynomial.cost grade r.2.2)).sum + +def xcost (grade : List A → ℕ) (x : Point k A n) : ℕ := + gcost grade x.1 + columnCost grade x.2 + +omit [CommRing k] in +@[simp] theorem gcost_nil [CommRing k] (grade : List A → ℕ) : gcost grade ([] : Word k A n) = 0 := rfl +omit [CommRing k] in +@[simp] theorem gcost_cons [CommRing k] (grade : List A → ℕ) (r : Root k A n) (w : Word k A n) : + gcost grade (r::w) = Polynomial.cost grade r.2.2 + gcost grade w := rfl +omit [CommRing k] in +@[simp] theorem gcost_append [CommRing k] (grade : List A → ℕ) (a b : Word k A n) : + gcost grade (a++b) = gcost grade a + gcost grade b := by simp [gcost] +@[simp] theorem gcost_inverse (grade : List A → ℕ) (w : Word k A n) : + gcost grade (inverse w) = gcost grade w := by + simp [gcost,inverse,List.map_map,Function.comp_def,rootInv] + +def nameOperations (grade : List A → ℕ) : NamedAction.Operations (Word k A n) (Point k A n) where + one := [] + mul := (·++·) + inv := inverse + act := fun g x => (g++x.1,x.2) + gcost := gcost grade + xcost := xcost grade + cost_one := rfl + cost_mul := gcost_append grade + cost_inv := gcost_inverse grade + cost_act := by intros; simp [xcost,gcost_append,Nat.add_assoc] + +attribute [local instance] WordCalculus.rawMatrixAction + +def pointValue (x : Point k A n) : Fin n → Raw k A := groupValue x.1 • columnValue x.2 + +@[simp] theorem pointValue_act (g : Word k A n) (x : Point k A n) : + pointValue (g++x.1,x.2) = groupValue g • pointValue x := by + simp only [pointValue,groupValue_append,mul_smul] + +def rootMatrix (r : Root k A n) : Name k A n := fun i j => + oneName i j ++ if r.1 ≠ r.2.1 ∧ r.1=i ∧ r.2.1=j then r.2.2 else [] + +def matrix (w : Word k A n) : Name k A n := w.foldr (fun r a => product (rootMatrix r) a) oneName + +def column (x : Point k A n) : Column k A n := mulVec (matrix x.1) x.2 + +@[simp] theorem value_rootMatrix (r : Root k A n) : value (rootMatrix r) = (rootValue r).val := by + funext i j + change Polynomial.value (oneName i j ++ _) = _ + rw [Polynomial.value_append] + have hh : Polynomial.value (oneName (k:=k) (A:=A) i j) = (1 : Matrix (Fin n) (Fin n) (Raw k A)) i j := + congrFun (congrFun value_oneName i) j + rw [hh] + by_cases h : r.1 ≠ r.2.1 + · simp only [rootValue,dite_eq_left h,FiniteAlgebraicEnvelopes.Steinberg.elementary_val, + Matrix.add_apply,Matrix.single_apply] + by_cases he : r.1=i ∧ r.2.1=j + · rw [ite_eq_left ⟨h,he⟩,ite_eq_left he] + · rw [ite_eq_right (fun hh => he hh.2),ite_eq_right he] + rfl + · simp [rootValue,h] + +@[simp] theorem value_matrix (w : Word k A n) : value (matrix w) = (groupValue w).val := by + induction w with + | nil => exact value_oneName + | cons r w ih => + change value (product (rootMatrix r) (matrix w)) = _ + simp only [value_product,value_rootMatrix,ih,groupValue_cons,Units.val_mul] + +@[simp] theorem value_column (x : Point k A n) : columnValue (column x) = pointValue x := by + simp only [column,value_mulVec,value_matrix] + rfl + + theorem cost_rootMatrix (grade : List A → ℕ) (h0 : grade [] = 0) (r : Root k A n) : + cost grade (rootMatrix r) ≤ Polynomial.cost grade r.2.2 := by + rw [cost,maximum_le_iff] + intro i + rw [columnCost,maximum_le_iff] + intro j + change Polynomial.cost grade (oneName i j ++ _) ≤ _ + rw [Polynomial.cost_append,max_le_iff] + constructor + · have hh := entry_cost_le grade (oneName : Name k A n) i j + rw [cost_oneName grade h0] at hh + omega + · split_ifs <;> simp + + theorem cost_matrix (grade : List A → ℕ) (h0 : grade [] = 0) + (ha : ∀ u v, grade (u++v) = grade u + grade v) (w : Word k A n) : + cost grade (matrix w) ≤ gcost grade w := by + induction w with + | nil => simpa [matrix] using (cost_oneName (k:=k) (n:=n) grade h0).le + | cons r w ih => + change cost grade (product (rootMatrix r) (matrix w)) ≤ + Polynomial.cost grade r.2.2 + gcost grade w + exact (cost_product_le grade ha _ _).trans (Nat.add_le_add (cost_rootMatrix grade h0 r) ih) + + theorem cost_column (grade : List A → ℕ) (h0 : grade [] = 0) + (ha : ∀ u v, grade (u++v) = grade u + grade v) (x : Point k A n) : + columnCost grade (column x) ≤ xcost grade x := + (cost_mulVec_le grade ha _ _).trans + (Nat.add_le_add_right (cost_matrix grade h0 ha x.1) _) + +variable {m : ℕ} (C : WordCalculus (FreeMonoid A) m) + +def grade (w : List A) : ℕ := C.grade (FreeMonoid.ofList w) + +@[simp] theorem grade_nil : grade C [] = 0 := C.grade_one +@[simp] theorem grade_append (u v : List A) : grade C (u++v) = grade C u + grade C v := C.grade_mul _ _ + + theorem groupValue_mem (w : Word k A n) : C.UnitBall k (gcost (grade C) w) (groupValue w) := by + constructor + · rw [← value_matrix] + exact fun i j => C.ball_mono k (cost_matrix (grade C) (grade_nil C) (grade_append C) w) + (MatrixNames.mem_ball C (matrix w) i j) + · change C.MatrixBall k (gcost (grade C) w) (groupValue w)⁻¹.val + rw [← groupValue_inverse,← value_matrix] + have hh := cost_matrix (grade C) (grade_nil C) (grade_append C) (inverse w) + rw [gcost_inverse] at hh + exact fun i j => C.ball_mono k hh (MatrixNames.mem_ball C (matrix (inverse w)) i j) + + theorem pointValue_mem (x : Point k A n) : C.ColumnBall k (xcost (grade C) x) (pointValue x) := by + rw [← value_column] + exact fun i => C.ball_mono k (cost_column (grade C) (grade_nil C) (grade_append C) x) + (column_mem_ball C (column x) i) + +end +end SimpleFInftyOvergroups.EffectiveNames.MatrixWords + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleOvergroups/NamedActions.lean b/lean/OAI/GroupTheory/SimpleOvergroups/NamedActions.lean new file mode 100644 index 0000000000000000000000000000000000000000..316f58f9b066e3cd46291be81e7e408b77b7637a --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleOvergroups/NamedActions.lean @@ -0,0 +1,220 @@ +import Mathlib +import OAI.GroupTheory.SimpleOvergroups.BoundedContexts + +namespace OAI + + +namespace SimpleFInftyOvergroups.BoundedEncoding.NamedAction + +structure Operations (G X : Type*) where + one : G + mul : G → G → G + inv : G → G + act : G → X → X + gcost : G → ℕ + xcost : X → ℕ + cost_one : gcost one = 0 + cost_mul : ∀ g h, gcost (mul g h) = gcost g + gcost h + cost_inv : ∀ g, gcost (inv g) = gcost g + cost_act : ∀ g x, xcost (act g x) = gcost g + xcost x + +abbrev Letter (G X : Type*) := G ⊕ (X ⊕ Option X) +abbrev Form (G X : Type*) := Option (List X × G × List X) +abbrev Result (K L : Type*) := Option (List L × K × List L) + +namespace Operations +variable {G X K L : Type*} (N : Operations G X) + +def letterCost : Letter G X → ℕ + | .inl g => N.gcost g + | .inr (.inl x) | .inr (.inr (some x)) => N.xcost x + | .inr (.inr none) => 0 + +def wordCost (w : List (Letter G X)) : ℕ := (w.map N.letterCost).sum + +def formCost : Form G X → ℕ + | none => 0 + | some (l,g,r) => (l.map N.xcost).sum + N.gcost g + (r.map N.xcost).sum + +def formKey (kg : G → K) (kx : X → L) : Form G X → Result K L := + Option.map (fun p => (p.1.map kx,kg p.2.1,p.2.2.map kx)) + +def plan : Letter G X → Form G X → Form G X ⊕ (X × X × Form G X) + | _, none => .inl none + | .inr (.inr none), _ => .inl none + | .inr (.inl x), some (l,g,r) => .inl (some (x::l,g,r)) + | .inl h, some ([],g,r) => .inl (some ([],N.mul h g,r)) + | .inl h, some (x::l,g,r) => .inl (some (N.act h x::l,g,r)) + | .inr (.inr (some y)), some ([],g,r) => + .inl (some ([],N.one,r++[N.act (N.inv g) y])) + | .inr (.inr (some y)), some (x::l,g,r) => .inr (y,x,some (l,g,r)) + +variable [DecidableEq L] + +def totalStep (kx : X → L) (a : Letter G X) (f : Form G X) : Form G X := + (N.plan a f).elim id (fun p => if kx p.1 = kx p.2.1 then p.2.2 else none) + +def totalRun (kx : X → L) (w : List (Letter G X)) (f : Form G X) : Form G X := + w.foldr (N.totalStep kx) f + +def totalNormalize (kx : X → L) (w : List (Letter G X)) : Form G X := + N.totalRun kx w (some ([],N.one,[])) + +def totalTest (kg : G → K) (kx : X → L) (w : List (Letter G X)) : Result K L := + formKey kg kx (N.totalNormalize kx w) + +@[simp] theorem totalRun_nil (kx : X → L) (f : Form G X) : N.totalRun kx [] f = f := rfl +@[simp] theorem totalRun_cons (kx : X → L) (a : Letter G X) (w : List (Letter G X)) + (f : Form G X) : N.totalRun kx (a::w) f = N.totalStep kx a (N.totalRun kx w f) := rfl +@[simp] theorem wordCost_nil : N.wordCost [] = 0 := rfl +@[simp] theorem wordCost_cons (a : Letter G X) (w : List (Letter G X)) : + N.wordCost (a::w) = N.letterCost a + N.wordCost w := rfl +@[simp] theorem wordCost_append (u v : List (Letter G X)) : + N.wordCost (u++v) = N.wordCost u + N.wordCost v := by simp [wordCost] +@[simp] theorem totalStep_none (kx : X → L) (a : Letter G X) : + N.totalStep kx a none = none := rfl + +theorem totalStep_cost (kx : X → L) (a : Letter G X) (f : Form G X) : + N.formCost (N.totalStep kx a f) ≤ N.letterCost a + N.formCost f := by + cases f with + | none => simp [formCost] + | some p => + rcases p with ⟨l,g,r⟩ + rcases a with h | (x | y) + · cases l <;> simp [totalStep,plan,formCost,letterCost,N.cost_mul,N.cost_act] <;> omega + · simp [totalStep,plan,formCost,letterCost]; omega + · cases y with + | none => simp [totalStep,plan,formCost,letterCost] + | some y => + cases l with + | nil => simp [totalStep,plan,formCost,letterCost,N.cost_one,N.cost_act,N.cost_inv]; omega + | cons x l => + by_cases h : kx y = kx x <;> simp [totalStep,plan,h,formCost,letterCost]; omega + +theorem totalRun_cost (kx : X → L) (w : List (Letter G X)) (f : Form G X) : + N.formCost (N.totalRun kx w f) ≤ N.wordCost w + N.formCost f := by + induction w with + | nil => simp + | cons a w ih => + exact (N.totalStep_cost kx a (N.totalRun kx w f)).trans (by rw [wordCost_cons]; omega) + +theorem totalNormalize_cost (kx : X → L) (w : List (Letter G X)) : + N.formCost (N.totalNormalize kx w) ≤ N.wordCost w := by + simpa [totalNormalize,formCost,N.cost_one] using N.totalRun_cost kx w (some ([],N.one,[])) + +end Operations + +structure Interpretation {G X V Y K L : Type*} [Group V] [MulAction V Y] + {m : ℕ} (N : Operations G X) (C : ActionCalculus V Y K L m) where + group : G → C.GLabel + point : X → C.XLabel + group_cost : ∀ g, (group g).cost = N.gcost g + point_cost : ∀ x, (point x).cost = N.xcost x + one : group N.one = C.identity + mul : ∀ g h, group (N.mul g h) = C.multiply (group g) (group h) + inv : ∀ g, group (N.inv g) = C.inverse (group g) + act : ∀ g x, point (N.act g x) = C.act (group g) (point x) + +namespace Interpretation +variable {G X V Y K L : Type*} [Group V] [MulAction V Y] {m : ℕ} + {N : Operations G X} {C : ActionCalculus V Y K L m} (I : Interpretation N C) + +def gkey (g : G) : K := (I.group g).key +def xkey (x : X) : L := (I.point x).key + +def letter : Letter G X → C.Letter + | .inl g => .grp (I.group g) + | .inr (.inl x) => .pre (I.point x) + | .inr (.inr (some x)) => .del (I.point x) + | .inr (.inr none) => .zero + +def form : Form G X → C.Form := + Option.map (fun p => (p.1.map I.point,I.group p.2.1,p.2.2.map I.point)) + +@[simp] theorem letter_cost (a : Letter G X) : (I.letter a).cost C = N.letterCost a := by + rcases a with g | (x | y) + · exact I.group_cost g + · exact I.point_cost x + · cases y with + | none => rfl + | some x => exact I.point_cost x + +@[simp] theorem form_cost (f : Form G X) : (I.form f).cost C = N.formCost f := by + cases f with + | none => rfl + | some p => simp [form,ActionCalculus.Form.cost,Operations.formCost,List.map_map, + Function.comp_def,I.point_cost,I.group_cost] + +@[simp] theorem word_cost (w : List (Letter G X)) : C.wordCost (w.map I.letter) = N.wordCost w := by + simp [ActionCalculus.wordCost,Operations.wordCost,List.map_map,Function.comp_def] + +@[simp] theorem form_key (f : Form G X) : + (I.form f).key C = Operations.formKey I.gkey I.xkey f := by + cases f <;> simp [form,Operations.formKey,ActionCalculus.Form.key,List.map_map, + Function.comp_def,gkey,xkey] + +variable [DecidableEq L] + +theorem totalStep (a : Letter G X) (f : Form G X) : + I.form (N.totalStep I.xkey a f) = C.step (I.letter a) (I.form f) := by + cases f with + | none => simp [form] + | some p => + rcases p with ⟨l,g,r⟩ + rcases a with h | (x | y) + · cases l <;> simp [Operations.totalStep,Operations.plan,letter,form,ActionCalculus.step,I.mul,I.act] + · simp [Operations.totalStep,Operations.plan,letter,form,ActionCalculus.step] + · cases y with + | none => rfl + | some y => + cases l with + | nil => simp [Operations.totalStep,Operations.plan,letter,form,ActionCalculus.step,I.one,I.inv,I.act] + | cons x l => + by_cases h : I.xkey y = I.xkey x + · change (I.point y).key = (I.point x).key at h + simp [Operations.totalStep,Operations.plan,letter,form,ActionCalculus.step,xkey,h] + · change (I.point y).key ≠ (I.point x).key at h + simp [Operations.totalStep,Operations.plan,letter,form,ActionCalculus.step,xkey,h] + +theorem totalRun (w : List (Letter G X)) (f : Form G X) : + I.form (N.totalRun I.xkey w f) = C.run (w.map I.letter) (I.form f) := by + induction w with + | nil => rfl + | cons a w ih => rw [Operations.totalRun_cons,I.totalStep,ih,List.map_cons,ActionCalculus.run_cons] + +theorem totalNormalize (w : List (Letter G X)) : + I.form (N.totalNormalize I.xkey w) = C.normalize (w.map I.letter) := by + unfold Operations.totalNormalize + rw [I.totalRun] + simp only [form,Option.map_some,List.map_nil,I.one] + rfl + +theorem totalTest (w : List (Letter G X)) : + N.totalTest I.gkey I.xkey w = (C.normalize (w.map I.letter)).key C := by + rw [← I.totalNormalize,I.form_key] + rfl + +theorem totalTest_context {u v a b : List (Letter G X)} {d : ℕ} + (h : N.totalTest I.gkey I.xkey u = N.totalTest I.gkey I.xkey v) + (hu : N.wordCost (a++u++b) ≤ d) (hv : N.wordCost (a++v++b) ≤ d) (hm : 3*d ≤ m) : + N.totalTest I.gkey I.xkey (a++u++b) = N.totalTest I.gkey I.xkey (a++v++b) := by + simp only [I.totalTest,List.map_append] at h ⊢ + apply C.normalize_context h (hm := hm) + · simpa only [← List.map_append,I.word_cost] using hu + · simpa only [← List.map_append,I.word_cost] using hv + +theorem totalTest_zero_context {u a b : List (Letter G X)} {d : ℕ} + (h : N.totalTest I.gkey I.xkey u = none) + (hu : N.wordCost (a++u++b) ≤ d) (hm : 3*d ≤ m) : + N.totalTest I.gkey I.xkey (a++u++b) = none := by + simp only [I.totalTest,List.map_append] at h ⊢ + exact C.normalize_zero_context h (by simpa only [← List.map_append,I.word_cost] using hu) hm + +@[simp] theorem totalTest_nil : N.totalTest I.gkey I.xkey [] ≠ none := by + simp only [I.totalTest,List.map_nil] + exact C.normalize_nil_ne_zero + +end Interpretation +end SimpleFInftyOvergroups.BoundedEncoding.NamedAction + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleOvergroups/PlanEffective.lean b/lean/OAI/GroupTheory/SimpleOvergroups/PlanEffective.lean new file mode 100644 index 0000000000000000000000000000000000000000..2e8a7182a3fa5c38233f08f61eaba884d976abba --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleOvergroups/PlanEffective.lean @@ -0,0 +1,128 @@ +import Mathlib +import OAI.GroupTheory.SimpleOvergroups.NamedActions + +namespace OAI + + +namespace SimpleFInftyOvergroups.BoundedEncoding.NamedAction.Operations +variable {G X : Type*} [Primcodable G] [Primcodable X] (N : Operations G X) +attribute [local fun_prop] Primrec +attribute [local fun_prop] Primrec.id Primrec.const Primrec.fst Primrec.snd Primrec.pair Primrec.comp +attribute [local fun_prop] Primrec.option_some Primrec.sumInl Primrec.sumInr +private theorem primrec_cons {A : Type*} [Primcodable A] : + Primrec (fun p : A × List A => p.1 :: p.2) := Primrec.list_cons +private theorem primrec_append {A : Type*} [Primcodable A] : + Primrec (fun p : List A × List A => p.1 ++ p.2) := Primrec.list_append +attribute [local fun_prop] primrec_cons primrec_append + +private theorem primrec_match_list {A B R : Type*} [Primcodable A] [Primcodable B] [Primcodable R] + {f : A → List B} {g : A → R} {h : A → B × List B → R} + (hf : Primrec f) (hg : Primrec g) (hh : Primrec₂ h) : + Primrec (fun a => match f a with | [] => g a | b::l => h a (b,l)) := + (Primrec.list_casesOn hf hg hh).of_eq (fun a => by cases f a <;> rfl) +private theorem primrec_match_option {A B R : Type*} [Primcodable A] [Primcodable B] [Primcodable R] + {f : A → Option B} {g : A → R} {h : A → B → R} + (hf : Primrec f) (hg : Primrec g) (hh : Primrec₂ h) : + Primrec (fun a => match f a with | none => g a | some b => h a b) := + (Primrec.option_casesOn hf hg hh).of_eq (fun a => by cases f a <;> rfl) +private theorem primrec_match_sum {A B C R : Type*} + [Primcodable A] [Primcodable B] [Primcodable C] [Primcodable R] + {f : A → B ⊕ C} {g : A → B → R} {h : A → C → R} + (hf : Primrec f) (hg : Primrec₂ g) (hh : Primrec₂ h) : + Primrec (fun a => match f a with | .inl b => g a b | .inr c => h a c) := + (Primrec.sumCasesOn hf hg hh).of_eq (fun a => by cases f a <;> rfl) + + theorem primrec_letterCost (hg : Primrec N.gcost) (hx : Primrec N.xcost) : + Primrec N.letterCost := by + have ho : Primrec (fun p : Letter G X × Option X => + match p.2 with | none => 0 | some x => N.xcost x) := + primrec_match_option Primrec.snd (Primrec.const 0) (hx.comp Primrec.snd).to₂ + have hs : Primrec (fun p : Letter G X × (X ⊕ Option X) => + match p.2 with + | .inl x => N.xcost x + | .inr o => match o with | none => 0 | some x => N.xcost x) := + (primrec_match_sum Primrec.snd (hx.comp Primrec.snd).to₂ + (ho.comp ((Primrec.fst.comp Primrec.fst).pair Primrec.snd)).to₂).of_eq + (fun p => by cases p.2 <;> rfl) + exact (primrec_match_sum Primrec.id (hg.comp Primrec.snd).to₂ hs.to₂).of_eq + (fun a => by rcases a with g | (x | y); rfl; rfl; cases y <;> rfl) + + theorem primrec_plan (hm : Primrec₂ N.mul) (hi : Primrec N.inv) (ha : Primrec₂ N.act) : + Primrec₂ N.plan := by + have hm' : Primrec (fun p : G × G => N.mul p.1 p.2) := hm + have ha' : Primrec (fun p : G × X => N.act p.1 p.2) := ha + let T := Letter G X × Form G X + let B := List X × G × List X + let R := Form G X ⊕ (X × X × Form G X) + have hgrp : Primrec (fun p : (T × B) × G => + match p.1.2.1 with + | [] => (Sum.inl (some ([],N.mul p.2 p.1.2.2.1,p.1.2.2.2)) : Form G X ⊕ (X × X × Form G X)) + | x::l => .inl (some (N.act p.2 x::l,p.1.2.2.1,p.1.2.2.2))) := by + have h0 : Primrec (fun p : (T × B) × G => (Sum.inl + (some ([],N.mul p.2 p.1.2.2.1,p.1.2.2.2)) : R)) := by + dsimp only [B,T,R] + fun_prop (disch := assumption) + have hc : Primrec₂ (fun (p : (T × B) × G) (q : X × List X) => + (Sum.inl (some (N.act p.2 q.1::q.2,p.1.2.2.1,p.1.2.2.2)) : R)) := by + change Primrec _ + dsimp only [B,T,R] + fun_prop (disch := assumption) + exact (primrec_match_list (f := fun p : (T × B) × G => p.1.2.1) + (by dsimp only [B,T,R]; fun_prop) h0 hc).of_eq (fun p => by cases p.1.2.1 <;> rfl) + have hdel : Primrec (fun p : (T × B) × X => + match p.1.2.1 with + | [] => (Sum.inl (some ([],N.one,p.1.2.2.2++[N.act (N.inv p.1.2.2.1) p.2])) : + Form G X ⊕ (X × X × Form G X)) + | x::l => .inr (p.2,x,some (l,p.1.2.2.1,p.1.2.2.2))) := by + have h0 : Primrec (fun p : (T × B) × X => (Sum.inl + (some ([],N.one,p.1.2.2.2++[N.act (N.inv p.1.2.2.1) p.2])) : R)) := by + dsimp only [B,T,R] + fun_prop (disch := assumption) + have hc : Primrec₂ (fun (p : (T × B) × X) (q : X × List X) => + (Sum.inr (p.2,q.1,some (q.2,p.1.2.2.1,p.1.2.2.2)) : R)) := by + change Primrec _ + dsimp only [B,T,R] + fun_prop + exact (primrec_match_list (f := fun p : (T × B) × X => p.1.2.1) + (by dsimp only [B,T,R]; fun_prop) h0 hc).of_eq (fun p => by cases p.1.2.1 <;> rfl) + have hopt : Primrec (fun p : (T × B) × Option X => + match p.2 with + | none => (Sum.inl none : Form G X ⊕ (X × X × Form G X)) + | some x => match p.1.2.1 with + | [] => .inl (some ([],N.one,p.1.2.2.2++[N.act (N.inv p.1.2.2.1) x])) + | z::l => .inr (x,z,some (l,p.1.2.2.1,p.1.2.2.2))) := by + apply primrec_match_option Primrec.snd (Primrec.const (Sum.inl none)) + exact (hdel.comp (Primrec.fst.comp Primrec.fst |>.pair Primrec.snd)).to₂ + have hnon : Primrec (fun p : (T × B) × (X ⊕ Option X) => + match p.2 with + | .inl x => (Sum.inl (some (x::p.1.2.1,p.1.2.2.1,p.1.2.2.2)) : + Form G X ⊕ (X × X × Form G X)) + | .inr y => match y with + | none => .inl none + | some x => match p.1.2.1 with + | [] => .inl (some ([],N.one,p.1.2.2.2++[N.act (N.inv p.1.2.2.1) x])) + | z::l => .inr (x,z,some (l,p.1.2.2.1,p.1.2.2.2))) := by + have hl : Primrec₂ (fun (p : (T × B) × (X ⊕ Option X)) (x : X) => + (Sum.inl (some (x::p.1.2.1,p.1.2.2.1,p.1.2.2.2)) : R)) := by + change Primrec _ + dsimp only [B,T,R] + fun_prop + exact (primrec_match_sum Primrec.snd hl + (hopt.comp (Primrec.fst.comp Primrec.fst |>.pair Primrec.snd)).to₂).of_eq + (fun p => by cases p.2 <;> rfl) + have hs : Primrec (fun p : T × B => N.plan p.1.1 (some p.2)) := by + apply (Primrec.sumCasesOn (Primrec.fst.comp Primrec.fst) + (hgrp.to₂) (hnon.to₂)).of_eq + intro p + rcases p with ⟨⟨a,f⟩,l,g,r⟩ + rcases a with h | (x|y) + · cases l <;> rfl + · rfl + · cases y with + | none => rfl + | some y => cases l <;> rfl + exact (Primrec.option_casesOn Primrec.snd (Primrec.const (.inl none)) hs.to₂).of_eq + (fun p => by rcases p with ⟨a,f⟩; cases f <;> rfl) +end SimpleFInftyOvergroups.BoundedEncoding.NamedAction.Operations + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleOvergroups/PolynomialBounds.lean b/lean/OAI/GroupTheory/SimpleOvergroups/PolynomialBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..e8de05a9797bc6787a55ce8d6122a7a19c48c9d5 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleOvergroups/PolynomialBounds.lean @@ -0,0 +1,79 @@ +import Mathlib +import OAI.GroupTheory.SimpleOvergroups.PolynomialNames + +namespace OAI + + +namespace SimpleFInftyOvergroups.EffectiveNames.Polynomial +open BoundedEncoding +noncomputable section +open scoped Classical +variable {A k : Type*} [CommSemiring k] + +omit [CommSemiring k] in +@[simp] theorem cost_nil (grade : List A → ℕ) : cost grade ([] : Name k A) = 0 := rfl + +omit [CommSemiring k] in + theorem cost_append (grade : List A → ℕ) (p q : Name k A) : + cost grade (p++q) = max (cost grade p) (cost grade q) := by + apply Nat.le_antisymm + · rw [cost_le_iff] + intro a ha + rcases List.mem_append.mp ha with ha | ha + · exact (term_cost_le grade ha).trans (Nat.le_max_left _ _) + · exact (term_cost_le grade ha).trans (Nat.le_max_right _ _) + · rw [max_le_iff, cost_le_iff, cost_le_iff] + exact ⟨fun a ha => term_cost_le grade (List.mem_append_left _ ha), + fun a ha => term_cost_le grade (List.mem_append_right _ ha)⟩ + + theorem value_flatten (ps : List (Name k A)) : value ps.flatten = (ps.map value).sum := by + induction ps with + | nil => rfl + | cons p ps ih => simp [ih] + +omit [CommSemiring k] in + theorem cost_flatten_le (grade : List A → ℕ) {ps : List (Name k A)} {b : ℕ} + (h : ∀ p ∈ ps, cost grade p ≤ b) : cost grade ps.flatten ≤ b := by + rw [cost_le_iff] + intro a ha + obtain ⟨p,hp,ha⟩ := List.mem_flatten.mp ha + exact (term_cost_le grade ha).trans (h p hp) + + theorem cost_product_le (grade : List A → ℕ) + (ha : ∀ u v, grade (u++v) = grade u + grade v) (p q : Name k A) : + cost grade (product p q) ≤ cost grade p + cost grade q := by + rw [cost_le_iff] + intro x hx + obtain ⟨a,ha',hx⟩ := List.mem_flatMap.mp hx + obtain ⟨b,hb,rfl⟩ := List.mem_map.mp hx + rw [ha] + exact Nat.add_le_add (term_cost_le grade ha') (term_cost_le grade hb) + + theorem cost_oneName (grade : List A → ℕ) (h0 : grade [] = 0) : + cost grade (oneName : Name k A) = 0 := by simp [oneName,cost,h0] + +variable {R : Type*} [CommRing R] +def negate (p : Name R A) : Name R A := p.map (fun a => (-a.1,a.2)) + +@[simp] theorem value_negate (p : Name R A) : value (negate p) = -value p := by + induction p with + | nil => simp [negate] + | cons a p ih => + change MonoidAlgebra.single (FreeMonoid.ofList a.2) (-a.1) + value (negate p) = + -(MonoidAlgebra.single (FreeMonoid.ofList a.2) a.1 + value p) + rw [MonoidAlgebra.single_neg,ih] + abel + +@[simp] theorem cost_negate (grade : List A → ℕ) (p : Name R A) : + cost grade (negate p) = cost grade p := by + simp only [negate,cost,List.map_map,Function.comp_def] + + theorem primrec_negate [Primcodable A] [Primcodable R] [Finite R] : + Primrec (negate (R:=R) (A:=A)) := by + exact Primrec.list_map Primrec.id + (((Primrec.dom_finite (Neg.neg : R → R)).comp (Primrec.fst.comp Primrec.snd)).pair + (Primrec.snd.comp Primrec.snd)).to₂ +end +end SimpleFInftyOvergroups.EffectiveNames.Polynomial + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleOvergroups/PolynomialNames.lean b/lean/OAI/GroupTheory/SimpleOvergroups/PolynomialNames.lean new file mode 100644 index 0000000000000000000000000000000000000000..d77b150b9bf53cc38246b4e0e31f9900223ecf7c --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleOvergroups/PolynomialNames.lean @@ -0,0 +1,215 @@ +import Mathlib +import OAI.Computability.FiniteCompiler.Effectivity +import OAI.Computability.FiniteCompiler.Selectors +import OAI.GroupTheory.BooneHigman.TreeCoherence +import OAI.GroupTheory.SimpleOvergroups.ArrayNames +import OAI.GroupTheory.SimpleOvergroups.CanonicalNames +import OAI.GroupTheory.SimpleOvergroups.TruncatedAlgebra + +namespace OAI + + + +namespace SimpleFInftyOvergroups.EffectiveNames.Polynomial +open BoundedEncoding +noncomputable section +open scoped Classical + +variable {A k : Type*} [CommSemiring k] + +abbrev Name (k A : Type*) := List (k × List A) + +def value (p : Name k A) : MonoidAlgebra k (FreeMonoid A) := + (p.map fun a => MonoidAlgebra.single (FreeMonoid.ofList a.2) a.1).sum + +@[simp] theorem value_nil : value ([] : Name k A) = 0 := rfl +@[simp] theorem value_cons (a : k × List A) (p : Name k A) : + value (a::p) = MonoidAlgebra.single (FreeMonoid.ofList a.2) a.1 + value p := rfl +@[simp] theorem value_append (p q : Name k A) : value (p++q) = value p + value q := by + simp [value] + +def oneName : Name k A := [(1,[])] +@[simp] theorem value_oneName : value (oneName : Name k A) = 1 := by + simp [oneName,MonoidAlgebra.one_def] + +def product (p q : Name k A) : Name k A := + p.flatMap fun a => q.map fun b => (a.1*b.1,a.2++b.2) + +theorem value_mul_term (a : k × List A) (q : Name k A) : + value (q.map fun b => (a.1*b.1,a.2++b.2)) = + MonoidAlgebra.single (FreeMonoid.ofList a.2) a.1 * value q := by + induction q with + | nil => simp + | cons b q ih => + simp only [List.map_cons,value_cons,ih,mul_add,MonoidAlgebra.single_mul_single] + rfl + +@[simp] theorem value_product (p q : Name k A) : value (product p q) = value p * value q := by + induction p with + | nil => simp [product] + | cons a p ih => + simp only [product,List.flatMap_cons] at ih ⊢ + rw [value_append,value_mul_term,ih,value_cons,add_mul] + +theorem value_surjective : Function.Surjective (value (k:=k) (A:=A)) := by + intro p + induction p using MonoidAlgebra.induction_on with + | of w => exact ⟨[(1,w.toList)],by simp⟩ + | add p q hp hq => + obtain ⟨p,rfl⟩ := hp + obtain ⟨q,rfl⟩ := hq + exact ⟨p++q,value_append _ _⟩ + | smul a p hp => + obtain ⟨p,rfl⟩ := hp + refine ⟨p.map (fun b => (a*b.1,b.2)),?_⟩ + induction p with + | nil => simp + | cons b p ih => simp [ih,smul_add,MonoidAlgebra.smul_single] + +def cost (grade : List A → ℕ) (p : Name k A) : ℕ := + (p.map (fun a => grade a.2)).foldr max 0 + +omit [CommSemiring k] in +theorem cost_le_iff (grade : List A → ℕ) (p : Name k A) (b : ℕ) : + cost grade p ≤ b ↔ ∀ a ∈ p, grade a.2 ≤ b := by + induction p with + | nil => simp [cost] + | cons a p ih => + simp only [cost,List.map_cons,List.foldr_cons,max_le_iff] at ih ⊢ + simp only [List.mem_cons,forall_eq_or_imp] + exact and_congr_right (fun _ => ih) + +omit [CommSemiring k] in + theorem term_cost_le (grade : List A → ℕ) {a : k × List A} {p : Name k A} (ha : a ∈ p) : + grade a.2 ≤ cost grade p := (cost_le_iff grade p _).mp le_rfl a ha + +variable {m : ℕ} (C : WordCalculus (FreeMonoid A) m) + +theorem mem_ball (p : Name k A) : + value p ∈ C.ball k (cost (fun w => C.grade (FreeMonoid.ofList w)) p) := by + induction p with + | nil => exact (C.ball k _).zero_mem + | cons a p ih => + rw [value_cons] + apply (C.ball k _).add_mem + · exact C.single_mem_ball k (term_cost_le _ List.mem_cons_self) a.1 + · exact C.ball_mono k (by simp [cost]) ih + +def collectName (omega : List A) (normal : List A → List A) (p : Name k A) : Name k A := + p.flatMap fun a => if normal a.2 = omega then [] else [(a.1,normal a.2)] + +theorem value_collectName (p : Name k A) : + value (collectName C.omega.toList (fun w => (C.normal (FreeMonoid.ofList w)).toList) p) = + C.collect k (value p) := by + induction p with + | nil => simp [collectName] + | cons a p ih => + change value ((if (C.normal (FreeMonoid.ofList a.2)).toList = C.omega.toList then [] + else [(a.1,(C.normal (FreeMonoid.ofList a.2)).toList)]) ++ + collectName C.omega.toList (fun w => (C.normal (FreeMonoid.ofList w)).toList) p) = _ + rw [value_append,ih,value_cons,map_add,C.collect_single] + by_cases h : C.normal (FreeMonoid.ofList a.2) = C.omega + · simp [h] + · have h' : (C.normal (FreeMonoid.ofList a.2)).toList ≠ C.omega.toList := by + intro he; exact h (by simpa using congrArg FreeMonoid.ofList he) + simp [h,h'] + +variable [Primcodable A] [Primcodable k] [Finite k] + + theorem primrec_product : Primrec₂ (product (k:=k) (A:=A)) := by + unfold product + apply Primrec.list_flatMap Primrec.fst + apply Primrec.list_map (Primrec.snd.comp Primrec.fst) + exact (((Primrec.dom_finite (fun p : k × k => p.1*p.2)).comp + ((Primrec.fst.comp (Primrec.snd.comp Primrec.fst)).pair (Primrec.fst.comp Primrec.snd))).pair + (Primrec.list_append.comp (Primrec.snd.comp (Primrec.snd.comp Primrec.fst)) + (Primrec.snd.comp Primrec.snd))).to₂ + +omit [CommSemiring k] [Finite k] in + theorem primrec_cost {grade : List A → ℕ} (hg : Primrec grade) : Primrec (cost (k:=k) grade) := by + unfold cost + exact Primrec.list_foldr + (Primrec.list_map Primrec.id (hg.comp (Primrec.snd.comp Primrec.snd)).to₂) + (Primrec.const 0) + (Primrec.nat_max.comp (Primrec.fst.comp Primrec.snd) (Primrec.snd.comp Primrec.snd)).to₂ + +def partialCollect (omega : List A) (f : List A → Part (List A)) (p : Name k A) : Part (Name k A) := + (FiniteAlgebraicEnvelopes.Effect.traverse (fun a : k × List A => + (f a.2).map fun w => if w = omega then [] else [(a.1,w)]) p).map List.flatten + +omit [CommSemiring k] [Primcodable A] [Primcodable k] [Finite k] in +theorem partialCollect_full (omega : List A) (f : List A → Part (List A)) + (normal : List A → List A) (p : Name k A) (h : ∀ a ∈ p, normal a.2 ∈ f a.2) : + collectName omega normal p ∈ partialCollect omega f p := by + have ht := FiniteAlgebraicEnvelopes.Bootstrap.Search.traverse_map + (f := fun a : k × List A => (f a.2).map fun w => if w = omega then [] else [(a.1,w)]) + (g := fun a => if normal a.2 = omega then [] else [(a.1,normal a.2)]) + p (by intro a ha; exact Part.mem_map _ (h a ha)) + simpa only [partialCollect,collectName,List.flatMap] using Part.mem_map List.flatten ht + +omit [Primcodable A] [Primcodable k] [Finite k] in +theorem value_eq_iff_arrays (p q : Name k A) : + value p = value q ↔ Array.value (id : k → k) (id : List A → List A) p = + Array.value id id q := by + have h (p : Name k A) : (value p).coeff = + Finsupp.mapDomain FreeMonoid.ofList (Array.value (id : k → k) id p) := by + induction p with + | nil => simp + | cons a p ih => simp [ih, Finsupp.mapDomain_add] + rw [← MonoidAlgebra.coeff_inj, h p, h q] + exact (Finsupp.mapDomain_injective (f := FreeMonoid.ofList) + (by intro x y h; exact congrArg FreeMonoid.toList h)).eq_iff + + theorem computable_value_eq : ComputablePred + (fun p : Name k A × Name k A => value p.1 = value p.2) := by + have he := Array.computable_value_eq (id : k → k) (id : List A → List A) 0 (·+·) + (Primrec.dom_finite (fun p : k × k => p.1+p.2)) + Primrec.eq.computablePred Primrec.eq.computablePred rfl (by intros; rfl) + exact he.of_eq (fun p => (value_eq_iff_arrays p.1 p.2).symm) + +def valueKey : MonoidAlgebra k (FreeMonoid A) → ℕ := semanticKey value value_surjective + +omit [Finite k] in + theorem valueKey_injective : Function.Injective (valueKey (k:=k) (A:=A)) := + semanticKey_injective value value_surjective + +omit [Finite k] in +@[simp] theorem valueKey_value (p : Name k A) : valueKey (value p) = key value p := + semanticKey_value value value_surjective p + +def partialKey (omega : List A) (f : List A → Part (List A)) (p : Name k A) : Part ℕ := + (partialCollect omega f p).map (key value) + +omit [Finite k] in +theorem partialKey_full (f : List A → Part (List A)) (p : Name k A) + (h : ∀ a ∈ p, (C.normal (FreeMonoid.ofList a.2)).toList ∈ f a.2) : + valueKey (C.collect k (value p)) ∈ partialKey C.omega.toList f p := by + rw [← value_collectName C p,valueKey_value] + exact Part.mem_map _ (partialCollect_full _ f _ p h) + +variable {P : Type*} [Primcodable P] {f : P → List A → Part (List A)} +omit [CommSemiring k] [Finite k] in + theorem partrec_partialCollect (omega : List A) (hf : Partrec₂ f) : + Partrec₂ (fun p : P => partialCollect (k:=k) omega (f p)) := by + have hc : Partrec₂ (fun (p : P) (a : k × List A) => + (f p a.2).map fun w => if w = omega then [] else [(a.1,w)]) := by + have hmap : Computable₂ (fun (p : P × (k × List A)) (w : List A) => + if w = omega then [] else [(p.2.1,w)]) := by + refine (Computable.cond (Primrec.eq.decide.to_comp.comp + Computable.snd (Computable.const omega)) (Computable.const []) + (Primrec.list_cons.to_comp.comp + ((Computable.fst.comp (Computable.snd.comp Computable.fst)).pair Computable.snd) + (Computable.const []))).of_eq ?_ + intro p + simp only [Bool.cond_decide] + exact ((hf.comp Computable.fst (Computable.snd.comp Computable.snd)).map hmap).to₂ + exact (FiniteAlgebraicEnvelopes.Effect.partrec_traverse_parameter hc).map + (Primrec.list_flatten.to_comp.comp Computable.snd).to₂ + theorem partrec_partialKey (omega : List A) (hf : Partrec₂ f) : + Partrec₂ (fun p : P => partialKey (k:=k) omega (f p)) := + (partrec_partialCollect omega hf).map + ((computable_key value computable_value_eq).comp Computable.snd).to₂ +end +end SimpleFInftyOvergroups.EffectiveNames.Polynomial + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleOvergroups/PrefixArithmetic.lean b/lean/OAI/GroupTheory/SimpleOvergroups/PrefixArithmetic.lean new file mode 100644 index 0000000000000000000000000000000000000000..b0b51f0a1a15238365fc73a550fd79b236b488a3 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleOvergroups/PrefixArithmetic.lean @@ -0,0 +1,232 @@ +import Mathlib +import OAI.GroupTheory.BooneHigman.ActionEnvelope +import OAI.GroupTheory.FiniteType.BinaryPrefixOperators +import OAI.GroupTheory.FiniteType.TwistedBrin + +namespace OAI + + +namespace BinaryPrefixOperators.Arithmetic + +abbrev Word := List (Fin 2) +abbrev Pair := Word × Word + +variable (K : Type*) [CommRing K] +noncomputable section + +def insertion : Word → algebra K + | [] => 1 + | i :: w => l K i * insertion w + +def deletion : Word → algebra K + | [] => 1 + | i :: w => deletion w * r K i + +@[simp] theorem prefix_nil : insertion K [] = 1 := rfl +@[simp] theorem prefix_cons (i : Fin 2) (w : Word) : + insertion K (i::w) = l K i * insertion K w := rfl +@[simp] theorem deletion_nil : deletion K [] = 1 := rfl +@[simp] theorem deletion_cons (i : Fin 2) (w : Word) : + deletion K (i::w) = deletion K w * r K i := rfl + +@[simp] theorem prefix_append (v w : Word) : insertion K (v++w) = insertion K v * insertion K w := by + induction v <;> simp [*, mul_assoc] +@[simp] theorem deletion_append (v w : Word) : + deletion K (v++w) = deletion K w * deletion K v := by + induction v <;> simp [*, mul_assoc] + +@[simp] theorem prefix_single (w : Word) (x : Stream' (Fin 2)) (a : K) : + (insertion K w : Module.End K (Space K)) (Finsupp.single x a) = + Finsupp.single (w ++ₛ x) a := by + induction w with + | nil => rfl + | cons i w ih => + change left K i ((insertion K w : Module.End K (Space K)) (Finsupp.single x a)) = _ + rw [ih, left_single] + rfl + +@[simp] theorem deletion_single (w : Word) (x : Stream' (Fin 2)) (a : K) : + (deletion K w : Module.End K (Space K)) (Finsupp.single x a) = + if x.take w.length = w then Finsupp.single (x.drop w.length) a else 0 := by + induction w generalizing x with + | nil => simp [deletion] + | cons i w ih => + change (deletion K w : Module.End K (Space K)) (right K i (Finsupp.single x a)) = _ + rw [right_single] + by_cases hx : x.head = i + · rw [ite_eq_left hx, ih] + simp only [List.length_cons, Stream'.take_succ, List.cons.injEq, hx, true_and, + Stream'.drop_succ] + · rw [ite_eq_right hx, map_zero] + simp [Stream'.take_succ, hx] + +def replacement (p : Pair) : algebra K := insertion K p.1 * deletion K p.2 + +@[simp] theorem replacement_single (p : Pair) (x : Stream' (Fin 2)) (a : K) : + (replacement K p : Module.End K (Space K)) (Finsupp.single x a) = + if x.take p.2.length = p.2 then Finsupp.single (p.1 ++ₛ x.drop p.2.length) a else 0 := by + change (insertion K p.1 : Module.End K (Space K)) + ((deletion K p.2 : Module.End K (Space K)) (Finsupp.single x a)) = _ + rw [deletion_single] + split <;> simp [*] + +theorem replacement_domain (v w t : Word) (x : Stream' (Fin 2)) (a : K) + (hw : w.length = t.length) : + (replacement K (v,w) : Module.End K (Space K)) (Finsupp.single (t ++ₛ x) a) = + if w = t then Finsupp.single (v ++ₛ x) a else 0 := by + rw [replacement_single] + simp only [hw, Stream'.take_append_of_le_length _ _ _ (Nat.le_refl _), List.take_length, + Stream'.drop_append_stream] + by_cases h : w=t <;> simp [h, Ne.symm] + +theorem split_replacement (v w : Word) : + replacement K (v,w) = replacement K (v++[0],w++[0]) + + replacement K (v++[1],w++[1]) := by + simp only [replacement, prefix_append, deletion_append, prefix_cons, prefix_nil, + deletion_cons, deletion_nil, mul_one, one_mul] + calc insertion K v * deletion K w = + insertion K v * (l K 0 * r K 0 + l K 1 * r K 1) * deletion K w := by + rw [l_r_partition, mul_one] + _ = _ := by noncomm_ring + +def marker (L : ℕ) : Stream' (Fin 2) := fun n => if n=L then 1 else 0 + +theorem marker_after {L n : ℕ} (h : L < n) : marker L n = 0 := by + simp [marker, Nat.ne_of_gt h] + +theorem marker_separates (L : ℕ) {v w : Word} (hv : v.length ≤ L) (hw : w.length ≤ L) + (h : v ++ₛ marker L = w ++ₛ marker L) : v=w := by + have hlen : v.length = w.length := by + have no_lt : ∀ (a b : Word), a.length ≤ L → b.length ≤ L → + a ++ₛ marker L = b ++ₛ marker L → ¬ a.length < b.length := by + intro a b ha hb he hab + have ht := congrArg (fun s : Stream' (Fin 2) => s.get (b.length + L)) he + have hi : b.length + L = a.length + (b.length + L - a.length) := by omega + rw [Stream'.get_append_right, hi, Stream'.get_append_right] at ht + have hh : L < b.length + L - a.length := by omega + change marker L (b.length + L - a.length) = marker L L at ht + simp [marker, Nat.ne_of_gt hh] at ht + exact Nat.le_antisymm (Nat.le_of_not_gt (no_lt w v hw hv h.symm)) + (Nat.le_of_not_gt (no_lt v w hv hw h)) + exact Stream'.append_left_injective _ _ _ _ h hlen + +def evaluate : (Pair →₀ K) →ₗ[K] algebra K := + Finsupp.linearCombination K (replacement K) + +@[simp] theorem evaluate_single (p : Pair) (a : K) : + evaluate K (Finsupp.single p a) = a • replacement K p := by + simp [evaluate] + +theorem coefficient_test (p : Pair →₀ K) (m L : ℕ) + (hm : ∀ q ∈ p.support, q.2.length = m) + (hL : ∀ q ∈ p.support, q.1.length ≤ L) + (v w : Word) (hv : v.length ≤ L) (hw : w.length = m) : + ((evaluate K p : Module.End K (Space K)) + (Finsupp.single (w ++ₛ marker L) 1)) (v ++ₛ marker L) = p (v,w) := by + classical + have hs : evaluate K p = p.sum (fun q a => a • replacement K q) := rfl + rw [hs] + change ((algebra K).val (∑ q ∈ p.support, p q • replacement K q)) + (Finsupp.single (w ++ₛ marker L) 1) (v ++ₛ marker L) = _ + simp only [map_sum, map_smul] + simp only [LinearMap.sum_apply, Finsupp.finsetSum_apply, LinearMap.smul_apply, + Finsupp.smul_apply, smul_eq_mul] + apply (Finset.sum_congr rfl (fun q hq => ?_)).trans + (show (∑ q ∈ p.support, (Finsupp.single q (p q)) (v,w)) = p (v,w) from by + rw [← Finsupp.finsetSum_apply] + exact congrArg (fun a : Pair →₀ K => a (v,w)) (Finsupp.sum_single p)) + change p q * (((replacement K q : Module.End K (Space K))) + (Finsupp.single (w ++ₛ marker L) 1)) (v ++ₛ marker L) = _ + rw [replacement_domain K _ _ _ _ _ ((hm _ hq).trans hw.symm)] + have hsep : q.1 ++ₛ marker L = v ++ₛ marker L ↔ q.1 = v := + ⟨marker_separates L (hL q hq) hv, by rintro rfl; rfl⟩ + by_cases hqw : q.2 = w + · simp only [ite_eq_left hqw, Finsupp.single_apply, hsep] + by_cases hqv : q.1 = v + · simp [hqv, hqw, Prod.ext_iff] + · simp [hqv, Prod.ext_iff] + · simp [hqw, Prod.ext_iff] + +theorem evaluate_eq_zero_of_depth (p : Pair →₀ K) (m : ℕ) + (hm : ∀ q ∈ p.support, q.2.length = m) : evaluate K p = 0 ↔ p=0 := by + classical + constructor + · intro hz + let L := p.support.sup (fun q => q.1.length) + have hL : ∀ q ∈ p.support, q.1.length ≤ L := fun q hq => Finset.le_sup (f := fun q : Pair => q.1.length) hq + apply Finsupp.ext + intro q + by_cases hq : q ∈ p.support + · have ht := coefficient_test K p m L hm hL q.1 q.2 (hL q hq) (hm q hq) + rw [hz] at ht + simpa only [Subalgebra.coe_zero, LinearMap.zero_apply, Finsupp.zero_apply] using ht.symm + · exact Finsupp.notMem_support_iff.mp hq + · rintro rfl + exact map_zero _ + +def subdivide : ℕ → Pair → (Pair →₀ K) + | 0, p => Finsupp.single p 1 + | n+1, (v,w) => subdivide n (v++[0],w++[0]) + subdivide n (v++[1],w++[1]) + +@[simp] theorem evaluate_subdivide (n : ℕ) (p : Pair) : + evaluate K (subdivide K n p) = replacement K p := by + induction n generalizing p with + | zero => simp [subdivide] + | succ n ih => + rcases p with ⟨v,w⟩ + rw [subdivide, map_add, ih, ih, ← split_replacement] + +theorem subdivide_depth (n : ℕ) (p q : Pair) (h : q ∈ (subdivide K n p).support) : + q.2.length = p.2.length + n := by + induction n generalizing p with + | zero => + have hq := ((Finsupp.mem_support_single _ _ _).mp h).1 + simp [hq] + | succ n ih => + rcases p with ⟨v,w⟩ + rw [subdivide] at h + rcases Finset.mem_union.mp (Finsupp.support_add h) with h | h + · have hh := ih _ h + simpa [List.length_append, Nat.add_assoc, Nat.add_comm, Nat.add_left_comm] using hh + · have hh := ih _ h + simpa [List.length_append, Nat.add_assoc, Nat.add_comm, Nat.add_left_comm] using hh + +def uniform (m : ℕ) : (Pair →₀ K) →ₗ[K] (Pair →₀ K) := + Finsupp.linearCombination K (fun p => subdivide K (m-p.2.length) p) + +@[simp] theorem uniform_single (m : ℕ) (p : Pair) (a : K) : + uniform K m (Finsupp.single p a) = a • subdivide K (m-p.2.length) p := by + simp [uniform] + +@[simp] theorem evaluate_uniform (m : ℕ) (p : Pair →₀ K) : + evaluate K (uniform K m p) = evaluate K p := by + have he : (evaluate K).comp (uniform K m) = evaluate K := by + apply Finsupp.lhom_ext + intro q a + simp [LinearMap.comp_apply] + exact LinearMap.congr_fun he p + +theorem uniform_depth (m : ℕ) (p : Pair →₀ K) + (hm : ∀ q ∈ p.support, q.2.length ≤ m) : + ∀ q ∈ (uniform K m p).support, q.2.length = m := by + let V : Submodule K (Pair →₀ K) := Finsupp.supported K K {q | q.2.length = m} + change uniform K m p ∈ V + change (∑ q ∈ p.support, p q • subdivide K (m - q.2.length) q) ∈ V + apply Submodule.sum_mem + intro q hq + apply Submodule.smul_mem + intro t ht + exact (subdivide_depth K _ q t ht).trans (Nat.add_sub_of_le (hm q hq)) + +def domainDepth (p : Pair →₀ K) : ℕ := p.support.sup (fun q => q.2.length) + +theorem finite_zero_test (p : Pair →₀ K) : + evaluate K p = 0 ↔ uniform K (domainDepth K p) p = 0 := by + rw [← evaluate_eq_zero_of_depth K _ (domainDepth K p) + (uniform_depth K _ p (fun q hq => Finset.le_sup (f := fun q : Pair => q.2.length) hq)), + evaluate_uniform] + +end +end BinaryPrefixOperators.Arithmetic + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleOvergroups/PrefixEffective.lean b/lean/OAI/GroupTheory/SimpleOvergroups/PrefixEffective.lean new file mode 100644 index 0000000000000000000000000000000000000000..91dec4ab7f5298c84b528252f8f452b31308eef2 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleOvergroups/PrefixEffective.lean @@ -0,0 +1,94 @@ +import Mathlib +import OAI.GroupTheory.SimpleOvergroups.PrefixLists + +namespace OAI + + +namespace BinaryPrefixOperators.Arithmetic.Lists +variable {K : Type*} [CommRing K] [Primcodable K] [Finite K] [DecidableEq K] + +private theorem prim_add {K : Type*} [CommRing K] [Primcodable K] [Finite K] + [DecidableEq K] : Primrec₂ ((· + ·) : K → K → K) := + (Primrec.dom_finite (fun p : K × K => p.1+p.2)).to₂ + + theorem primrec_coefficient : Primrec₂ (coefficient (K:=K)) := by + change Primrec (fun p : Poly K × Pair => + p.1.foldr (fun x a => (if x.2 = p.2 then x.1 else 0) + a) 0) + apply Primrec.list_foldr (h := fun (p : Poly K × Pair) (a : (K × Pair) × K) => + (if a.1.2 = p.2 then a.1.1 else 0) + a.2) Primrec.fst (Primrec.const 0) + exact (prim_add.comp + (Primrec.ite (Primrec.eq.comp + (Primrec.snd.comp (Primrec.fst.comp Primrec.snd)) (Primrec.snd.comp Primrec.fst)) + (Primrec.fst.comp (Primrec.fst.comp Primrec.snd)) (Primrec.const 0)) + (Primrec.snd.comp Primrec.snd)).to₂ + + theorem primrec_isZero : Primrec (isZero (K:=K)) := by + have hr : PrimrecRel (fun (a : K × Pair) (p : Poly K) => coefficient p a.2 = 0) := + Primrec.eq.comp (primrec_coefficient.comp Primrec.snd (Primrec.snd.comp Primrec.fst)) + (Primrec.const 0) + have hp : PrimrecPred (fun p : Poly K => ∀ a ∈ p, coefficient p a.2 = 0) := + hr.forall_mem_list.comp Primrec.id Primrec.id + exact hp.decide.of_eq fun p => by + apply Bool.eq_iff_iff.mpr + simp [isZero] + + theorem primrec_suffixes : Primrec suffixes := by + have h0 : Primrec (fun _ : Unit => ([[]] : List Word)) := Primrec.const _ + have hs : Primrec₂ (fun (_ : Unit) (p : ℕ × List Word) => + p.2.map (0::·) ++ p.2.map (1::·)) := by + exact (Primrec.list_append.comp + (Primrec.list_map (Primrec.snd.comp Primrec.snd) + (Primrec.list_cons.comp (Primrec.const 0) Primrec.snd).to₂) + (Primrec.list_map (Primrec.snd.comp Primrec.snd) + (Primrec.list_cons.comp (Primrec.const 1) Primrec.snd).to₂)).to₂ + refine ((Primrec.nat_rec h0 hs).comp (Primrec.const ()) Primrec.id).of_eq ?_ + intro n + dsimp only [id, Prod.snd] + induction n with + | zero => rfl + | succ n ih => simp [suffixes, ih] + + theorem primrec_expandTerm {K : Type*} [CommRing K] [Primcodable K] [Finite K] + [DecidableEq K] : Primrec₂ (expandTerm (K:=K)) := by + unfold expandTerm + apply Primrec.list_map (primrec_suffixes.comp Primrec.fst) + exact ((Primrec.fst.comp (Primrec.snd.comp Primrec.fst)).pair + ((Primrec.list_append.comp + (Primrec.fst.comp (Primrec.snd.comp (Primrec.snd.comp Primrec.fst))) Primrec.snd).pair + (Primrec.list_append.comp + (Primrec.snd.comp (Primrec.snd.comp (Primrec.snd.comp Primrec.fst))) Primrec.snd))).to₂ + + theorem primrec_depth {K : Type*} [CommRing K] [Primcodable K] [Finite K] + [DecidableEq K] : Primrec (depth (K:=K)) := by + have h : Primrec (fun p : Poly K => + p.foldr (fun a b => max a.2.2.length b) 0) := + Primrec.list_foldr Primrec.id (Primrec.const 0) + (Primrec.nat_max.comp + (Primrec.list_length.comp (Primrec.snd.comp (Primrec.snd.comp + (Primrec.fst.comp Primrec.snd)))) (Primrec.snd.comp Primrec.snd)).to₂ + refine h.of_eq ?_ + intro p + induction p with + | nil => rfl + | cons a p ih => simp [depth, ih] + + theorem primrec_spread : Primrec₂ (spread (K:=K)) := by + unfold spread + apply Primrec.list_flatMap Primrec.snd + exact (primrec_expandTerm.comp + (Primrec.nat_sub.comp (Primrec.fst.comp Primrec.fst) + (Primrec.list_length.comp (Primrec.snd.comp (Primrec.snd.comp Primrec.snd)))) + Primrec.snd).to₂ + + theorem primrec_zeroTest : Primrec (zeroTest (K:=K)) := + primrec_isZero.comp (primrec_spread.comp primrec_depth Primrec.id) + +theorem computable_zero : ComputablePred + (fun p : Poly K => evaluate K (toArray p) = 0) := + (show ComputablePred (fun p : Poly K => zeroTest p = true) from + ⟨inferInstance, (Primrec.eq.comp primrec_zeroTest (Primrec.const true)).decide.to_comp⟩).of_eq + (fun p => zeroTest_iff p) + +end BinaryPrefixOperators.Arithmetic.Lists + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleOvergroups/PrefixLists.lean b/lean/OAI/GroupTheory/SimpleOvergroups/PrefixLists.lean new file mode 100644 index 0000000000000000000000000000000000000000..9145cec50020d730b69d02307c58d40f2a29e46c --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleOvergroups/PrefixLists.lean @@ -0,0 +1,130 @@ +import Mathlib +import OAI.GroupTheory.FiniteType.ProductGroupHomology +import OAI.GroupTheory.SimpleOvergroups.PrefixArithmetic + +namespace OAI + + +namespace BinaryPrefixOperators.Arithmetic +namespace Lists + +abbrev Poly (K : Type*) := List (K × Pair) + +variable {K : Type*} [CommRing K] + +noncomputable def toArray : Poly K → (Pair →₀ K) + | [] => 0 + | (a,p) :: ps => Finsupp.single p a + toArray ps + +@[simp] theorem toArray_nil : toArray ([] : Poly K) = 0 := rfl +@[simp] theorem toArray_cons (a : K) (p : Pair) (ps : Poly K) : + toArray ((a,p)::ps) = Finsupp.single p a + toArray ps := rfl +@[simp] theorem toArray_append (p q : Poly K) : toArray (p++q) = toArray p + toArray q := by + induction p with + | nil => simp + | cons x p ih => rcases x with ⟨a,x⟩; simp [ih, add_assoc] + +def coefficient (p : Poly K) (q : Pair) : K := + p.foldr (fun x a => (if x.2 = q then x.1 else 0) + a) 0 + +@[simp] theorem coefficient_nil (q : Pair) : coefficient ([] : Poly K) q = 0 := rfl +@[simp] theorem coefficient_cons (a : K) (p q : Pair) (ps : Poly K) : + coefficient ((a,p)::ps) q = (if p=q then a else 0) + coefficient ps q := rfl + +theorem coefficient_eq (p : Poly K) (q : Pair) : coefficient p q = toArray p q := by + induction p with + | nil => rfl + | cons x p ih => rcases x with ⟨a,x⟩; simp [ih, Finsupp.single_apply] + +theorem coefficient_eq_zero_of_not_mem (p : Poly K) (q : Pair) + (h : ∀ a, (a,q) ∉ p) : coefficient p q = 0 := by + induction p with + | nil => rfl + | cons x p ih => + rcases x with ⟨a,x⟩ + have hne : x ≠ q := by intro he; exact h a (by simp [he]) + rw [coefficient_cons, ite_eq_right hne, zero_add] + exact ih (by intro b hb; exact h b (by simp [hb])) + +def isZero [DecidableEq K] (p : Poly K) : Bool := + p.all (fun q => decide (coefficient p q.2 = 0)) + +theorem isZero_iff [DecidableEq K] (p : Poly K) : isZero p = true ↔ toArray p = 0 := by + rw [isZero, List.all_eq_true] + simp only [decide_eq_true_eq] + constructor + · intro h + ext q + rw [← coefficient_eq] + by_cases hq : ∃ a, (a,q) ∈ p + · obtain ⟨a,ha⟩ := hq; exact h (a,q) ha + · exact coefficient_eq_zero_of_not_mem p q (by simpa using hq) + · intro h q hq + rw [coefficient_eq, h] + rfl + +def suffixes : ℕ → List Word + | 0 => [[]] + | n+1 => (suffixes n).map (0 :: ·) ++ (suffixes n).map (1 :: ·) + +def expandTerm (n : ℕ) (a : K × Pair) : Poly K := + (suffixes n).map (fun t => (a.1, (a.2.1 ++ t, a.2.2 ++ t))) + +@[simp] theorem expandTerm_zero {K : Type*} [CommRing K] (a : K × Pair) : + expandTerm 0 a = [a] := by + simp [expandTerm, suffixes] + +theorem expandTerm_succ {K : Type*} [CommRing K] (n : ℕ) (a : K) (v w : Word) : + expandTerm (n+1) (a,(v,w)) = + expandTerm n (a,(v++[0],w++[0])) ++ expandTerm n (a,(v++[1],w++[1])) := by + simp only [expandTerm, suffixes, List.map_append, List.map_map] + simp [Function.comp_def, List.append_assoc] + +theorem toArray_expandTerm (n : ℕ) (a : K) (p : Pair) : + toArray (expandTerm n (a,p)) = a • subdivide K n p := by + induction n generalizing p with + | zero => simp [subdivide] + | succ n ih => + rcases p with ⟨v,w⟩ + rw [expandTerm_succ, toArray_append, ih, ih, subdivide, smul_add] + +def depth : Poly K → ℕ + | [] => 0 + | (_,p)::ps => max p.2.length (depth ps) + +def spread (m : ℕ) (p : Poly K) : Poly K := + p.flatMap (fun a => expandTerm (m-a.2.2.length) a) + +theorem toArray_spread (m : ℕ) (p : Poly K) : + toArray (spread m p) = uniform K m (toArray p) := by + induction p with + | nil => simp [spread] + | cons a p ih => + rcases a with ⟨a,v,w⟩ + simp only [spread, List.flatMap_cons, toArray_append, toArray_cons, map_add, + uniform_single, ← ih, toArray_expandTerm] + +theorem depth_bound (p : Poly K) : ∀ q ∈ (toArray p).support, q.2.length ≤ depth p := by + induction p with + | nil => simp + | cons a p ih => + rcases a with ⟨a,v,w⟩ + intro q hq + rcases Finset.mem_union.mp (Finsupp.support_add hq) with h | h + · have he := ((Finsupp.mem_support_single _ _ _).mp h).1 + simp only [he, depth] + exact Nat.le_max_left _ _ + · exact (ih q h).trans (Nat.le_max_right _ _) + +def zeroTest [DecidableEq K] (p : Poly K) : Bool := isZero (spread (depth p) p) + +theorem zeroTest_iff [DecidableEq K] (p : Poly K) : + zeroTest p = true ↔ evaluate K (toArray p) = 0 := by + rw [zeroTest, isZero_iff, toArray_spread, + ← evaluate_eq_zero_of_depth K _ (depth p) (uniform_depth K _ _ (depth_bound p)), + evaluate_uniform] + +end Lists +end BinaryPrefixOperators.Arithmetic + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleOvergroups/PrefixNames.lean b/lean/OAI/GroupTheory/SimpleOvergroups/PrefixNames.lean new file mode 100644 index 0000000000000000000000000000000000000000..8e106372ce3dd3bb067fdcba22a9e89b800bf6ed --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleOvergroups/PrefixNames.lean @@ -0,0 +1,111 @@ +import Mathlib +import OAI.GroupTheory.SimpleOvergroups.CanonicalNames +import OAI.GroupTheory.SimpleOvergroups.PrefixEffective +import OAI.GroupTheory.SimpleOvergroups.PrefixProduct + +namespace OAI + + +namespace BinaryPrefixOperators.Arithmetic + + theorem primrec_cancel : Primrec₂ cancel := by + unfold cancel + exact Primrec.ite + (Primrec.eq.comp (Primrec.list_take.comp (Primrec.list_length.comp Primrec.fst) Primrec.snd) + Primrec.fst) + (Primrec.option_some.comp ((Primrec.list_drop.comp + (Primrec.list_length.comp Primrec.fst) Primrec.snd).pair (Primrec.const []))) + (Primrec.ite + (Primrec.eq.comp (Primrec.list_take.comp (Primrec.list_length.comp Primrec.snd) Primrec.fst) + Primrec.snd) + (Primrec.option_some.comp ((Primrec.const []).pair + (Primrec.list_drop.comp (Primrec.list_length.comp Primrec.snd) Primrec.fst))) + (Primrec.const none)) + + theorem primrec_multiplyPair : Primrec₂ multiplyPair := by + unfold multiplyPair + exact Primrec.option_map + (primrec_cancel.comp (Primrec.snd.comp Primrec.fst) (Primrec.fst.comp Primrec.snd)) + ((Primrec.list_append.comp + (Primrec.fst.comp (Primrec.fst.comp Primrec.fst)) (Primrec.fst.comp Primrec.snd)).pair + (Primrec.list_append.comp (Primrec.snd.comp (Primrec.snd.comp Primrec.fst)) + (Primrec.snd.comp Primrec.snd))).to₂ + +namespace Lists +variable {K : Type*} [CommRing K] + +def negate (p : Poly K) : Poly K := p.map (fun a => (-a.1,a.2)) + +@[simp] theorem value_negate (p : Poly K) : value (negate p) = -value p := by + induction p with + | nil => simp [negate] + | cons a p ih => + rcases a with ⟨a,v⟩ + simp only [negate] at ih ⊢ + simp [ih, neg_smul, neg_add_rev, add_comm] + +def oneName : Poly K := [(1,([],[]))] + +@[simp] theorem value_oneName : value (oneName (K:=K)) = 1 := by + simp [oneName, replacement] + +variable [Primcodable K] [Finite K] + + theorem primrec_negate : Primrec (negate (K:=K)) := + Primrec.list_map Primrec.id (((Primrec.dom_finite (fun a : K => -a)).comp + (Primrec.fst.comp Primrec.snd)).pair (Primrec.snd.comp Primrec.snd)).to₂ + + theorem primrec_mulTerm : Primrec₂ (mulTerm (K:=K)) := by + have h : Primrec₂ (fun a b : K × Pair => + (multiplyPair a.2 b.2).map (fun p => (a.1*b.1,p))) := by + exact Primrec.option_map + (primrec_multiplyPair.comp (Primrec.snd.comp Primrec.fst) (Primrec.snd.comp Primrec.snd)) + ((((Primrec.dom_finite (fun a : K × K => a.1*a.2)).comp + ((Primrec.fst.comp (Primrec.fst.comp Primrec.fst)).pair + (Primrec.fst.comp (Primrec.snd.comp Primrec.fst)))).pair Primrec.snd)).to₂ + have ht : Primrec (fun x : Option (K × Pair) => x.toList) := by + refine (Primrec.option_casesOn Primrec.id (Primrec.const []) + (Primrec.list_cons.comp Primrec.snd (Primrec.const [])).to₂).of_eq ?_ + intro x; cases x <;> rfl + exact ht.comp h + + theorem primrec_product : Primrec₂ (product (K:=K)) := by + unfold product + apply Primrec.list_flatMap Primrec.fst + change Primrec (fun p : (Poly K × Poly K) × (K × Pair) => p.1.2.flatMap (mulTerm p.2)) + apply Primrec.list_flatMap (Primrec.snd.comp Primrec.fst) + exact (primrec_mulTerm.comp (Primrec.snd.comp Primrec.fst) Primrec.snd).to₂ + +variable [DecidableEq K] + +noncomputable section +open scoped Classical + +theorem computable_value_eq : ComputablePred + (fun p : Poly K × Poly K => value p.1 = value p.2) := by + have hc : ComputablePred (fun p : Poly K × Poly K => + zeroTest (p.1 ++ negate p.2) = true) := + (Primrec.eq.comp (primrec_zeroTest.comp + (Primrec.list_append.comp Primrec.fst (primrec_negate.comp Primrec.snd))) + (Primrec.const true)).computablePred + apply hc.of_eq + intro p + rw [zeroTest_iff] + change value (p.1 ++ negate p.2) = 0 ↔ _ + rw [value_append, value_negate, ← sub_eq_add_neg, sub_eq_zero] + +def coefficientKey : Poly K → ℕ := SimpleFInftyOvergroups.EffectiveNames.key value + +omit [Finite K] [DecidableEq K] in + theorem coefficientKey_eq_iff (p q : Poly K) : + coefficientKey p = coefficientKey q ↔ value p = value q := + SimpleFInftyOvergroups.EffectiveNames.key_eq_iff value p q + + theorem computable_coefficientKey : Computable (coefficientKey (K:=K)) := + SimpleFInftyOvergroups.EffectiveNames.computable_key value computable_value_eq + +end +end Lists +end BinaryPrefixOperators.Arithmetic + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleOvergroups/PrefixProduct.lean b/lean/OAI/GroupTheory/SimpleOvergroups/PrefixProduct.lean new file mode 100644 index 0000000000000000000000000000000000000000..0fa2a72c235fb1f1ae552d030f57d8798cb5d1e7 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleOvergroups/PrefixProduct.lean @@ -0,0 +1,129 @@ +import Mathlib +import OAI.GroupTheory.SimpleOvergroups.PrefixLists + +namespace OAI + + +namespace BinaryPrefixOperators.Arithmetic +variable (K : Type*) [CommRing K] + +def cancel (w u : Word) : Option Pair := + if u.take w.length = w then some (u.drop w.length, []) else + if w.take u.length = u then some ([], w.drop u.length) else none + +noncomputable section + +theorem deletion_insertion (w u : Word) : + deletion K w * insertion K u = + if u.take w.length = w then insertion K (u.drop w.length) else + if w.take u.length = u then deletion K (w.drop u.length) else 0 := by + induction w generalizing u with + | nil => simp + | cons i w ih => + cases u with + | nil => simp + | cons j u => + have hh : (deletion K w * r K i) * (l K j * insertion K u) = + deletion K w * (r K i * l K j) * insertion K u := by simp [mul_assoc] + rw [deletion_cons, prefix_cons, hh, r_l] + by_cases hij : i=j + · subst j + simp only [List.length_cons, List.take_succ_cons, + List.drop_succ_cons, List.cons.injEq, true_and] + exact ih u + · simp [hij, Ne.symm hij] + +theorem deletion_insertion_cancel (w u : Word) : + deletion K w * insertion K u = (cancel w u).elim 0 (replacement K) := by + rw [deletion_insertion] + unfold cancel + split + · simp [replacement] + · split <;> simp [replacement] + +end + +def multiplyPair (p q : Pair) : Option Pair := + (cancel p.2 q.1).map (fun r => (p.1++r.1,q.2++r.2)) + +noncomputable section + theorem replacement_mul (p q : Pair) : + replacement K p * replacement K q = (multiplyPair p q).elim 0 (replacement K) := by + have hh : replacement K p * replacement K q = + insertion K p.1 * (deletion K p.2 * insertion K q.1) * deletion K q.2 := by + simp [replacement, mul_assoc] + rw [hh, deletion_insertion_cancel] + cases h : cancel p.2 q.1 with + | none => simp [multiplyPair, h] + | some r => simp [multiplyPair, h, replacement, mul_assoc] +end + +namespace Lists +variable {K} + +def mulTerm (a b : K × Pair) : Poly K := + ((multiplyPair a.2 b.2).map (fun p => (a.1*b.1,p))).toList + +def product (p q : Poly K) : Poly K := + p.flatMap (fun a => q.flatMap (mulTerm a)) + +noncomputable def value (p : Poly K) : algebra K := evaluate K (toArray p) + +@[simp] theorem value_nil : value ([] : Poly K) = 0 := rfl +@[simp] theorem value_cons (a : K) (p : Pair) (ps : Poly K) : + value ((a,p)::ps) = a • replacement K p + value ps := by + simp [value] +@[simp] theorem value_append (p q : Poly K) : value (p++q) = value p + value q := by + simp [value] + +@[simp] theorem value_singleton (a : K) (p : Pair) : + value [(a,p)] = a • replacement K p := by simp + + theorem value_mulTerm (a b : K × Pair) : + value (mulTerm a b) = (a.1 • replacement K a.2) * (b.1 • replacement K b.2) := by + rw [smul_mul_smul_comm, replacement_mul] + cases h : multiplyPair a.2 b.2 <;> simp [mulTerm, h] + + theorem value_product (p q : Poly K) : value (product p q) = value p * value q := by + induction p with + | nil => simp [product] + | cons a p ih => + rcases a with ⟨a,v⟩ + simp only [product, List.flatMap_cons, value_append, value_cons, add_mul] at * + rw [ih] + congr 1 + clear ih + induction q with + | nil => simp + | cons b q ih => + rcases b with ⟨b,w⟩ + simp only [List.flatMap_cons, value_append, value_cons, value_mulTerm, mul_add, ih] + +theorem value_surjective : Function.Surjective (value (K:=K)) := by + intro x + have hx := x.property + change x.val ∈ Algebra.adjoin K (Set.range (left K) ∪ Set.range (right K)) at hx + have hh : ∃ p : Poly K, (value p : Module.End K (Space K)) = x.val := by + apply Algebra.adjoin_induction (p := fun x _ => ∃ p : Poly K, + (value p : Module.End K (Space K)) = x) ?_ ?_ ?_ ?_ hx + · intro x hx + rcases hx with ⟨i,rfl⟩ | ⟨i,rfl⟩ + · exact ⟨[(1,([i],[]))], by simp [replacement, l]⟩ + · exact ⟨[(1,([],[i]))], by simp [replacement, r]⟩ + · intro a + exact ⟨[(a,([],[]))], by simp [replacement, Algebra.algebraMap_eq_smul_one]⟩ + · intro x y hx hy hp hq + obtain ⟨p,rfl⟩ := hp + obtain ⟨q,rfl⟩ := hq + exact ⟨p++q, by simp⟩ + · intro x y hx hy hp hq + obtain ⟨p,rfl⟩ := hp + obtain ⟨q,rfl⟩ := hq + exact ⟨product p q, by simp [value_product]⟩ + obtain ⟨p,hp⟩ := hh + exact ⟨p, Subtype.ext hp⟩ + +end Lists +end BinaryPrefixOperators.Arithmetic + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleOvergroups/Rekey.lean b/lean/OAI/GroupTheory/SimpleOvergroups/Rekey.lean new file mode 100644 index 0000000000000000000000000000000000000000..427ede02e77852c1421cbe1c06aa04a07c8e17fa --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleOvergroups/Rekey.lean @@ -0,0 +1,38 @@ +import Mathlib +import OAI.GroupTheory.SimpleOvergroups.TruncatedAction + +namespace OAI + + +namespace SimpleFInftyOvergroups.BoundedEncoding +namespace KeyBall +variable {X K K' : Type*} (C : KeyBall X K) + +def mapKey (f : K → K') : KeyBall X K' where + ball := C.ball + mono := C.mono + key := f ∘ C.key + +end KeyBall +namespace ActionCalculus +variable {V X K L K' L' : Type*} [Group V] [MulAction V X] {m : ℕ} + (C : ActionCalculus V X K L m) + +def rekey (g : K → K') (x : L → L') (hg : Function.Injective g) + (hx : Function.Injective x) : ActionCalculus V X K' L' m where + group := C.group.mapKey g + point := C.point.mapKey x + one_mem := C.one_mem + inv_mem := C.inv_mem + mul_mem := C.mul_mem + smul_mem := C.smul_mem + inv_congr := fun h => congrArg g (C.inv_congr (hg h)) + mul_congr := fun hu hv hu' hv' hb hb' he hf => + congrArg g (C.mul_congr hu hv hu' hv' hb hb' (hg he) (hg hf)) + smul_congr := fun hu hv hu' hv' hb hb' he hf => + congrArg x (C.smul_congr hu hv hu' hv' hb hb' (hg he) (hx hf)) + +end ActionCalculus +end SimpleFInftyOvergroups.BoundedEncoding + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleOvergroups/RingAssemblyTools.lean b/lean/OAI/GroupTheory/SimpleOvergroups/RingAssemblyTools.lean new file mode 100644 index 0000000000000000000000000000000000000000..09282c8bffc1a9decab2981d6d861b6110853a3a --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleOvergroups/RingAssemblyTools.lean @@ -0,0 +1,159 @@ +import Mathlib +import OAI.GroupTheory.BooneHigman.Basic +import OAI.GroupTheory.BooneHigman.Contracted +import OAI.GroupTheory.BooneHigman.Corners +import OAI.GroupTheory.BooneHigman.MonoidAlgebras +import OAI.GroupTheory.BooneHigman.PartialAffine +import OAI.GroupTheory.FiniteType.Steinberg + +namespace OAI + +noncomputable section +namespace SimpleFInftyOvergroups.RingAssembly +open scoped Classical TensorProduct +open FiniteAlgebraicEnvelopes + +section Quotient +variable {R : Type*} [Ring R] (r : R → R → Prop) + +def differences : Set R := (fun p : R × R => p.1-p.2) '' {p | r p.1 p.2} + + theorem differences_finite (h : {p : R × R | r p.1 p.2}.Finite) : + (differences r).Finite := h.image _ + + theorem ker_ringQuot : TwoSidedIdeal.ker (RingQuot.mkRingHom r) = + TwoSidedIdeal.span (differences r) := by + let I := TwoSidedIdeal.span (differences r) + have respects : ∀ ⦃a b : R⦄, r a b → I.ringCon.mk' a=I.ringCon.mk' b := by + intro a b hab + apply I.ringCon.eq.mpr + apply (I.rel_iff a b).mpr + exact TwoSidedIdeal.subset_span ⟨(a,b),hab,rfl⟩ + let t : RingQuot r →+* I.ringCon.Quotient := RingQuot.lift ⟨I.ringCon.mk',respects⟩ + apply le_antisymm + · intro x hx + have hx' := congrArg t ((TwoSidedIdeal.mem_ker _).mp hx) + have hq : I.ringCon.mk' x=0 := by + simpa only [t,RingQuot.lift_mkRingHom_apply,map_zero] using hx' + have hi := (TwoSidedIdeal.mem_ker I.ringCon.mk').mpr hq + simpa only [TwoSidedIdeal.ker_ringCon_mk'] using hi + · apply TwoSidedIdeal.span_le.mpr + rintro x ⟨⟨a,b⟩,hab,rfl⟩ + apply (TwoSidedIdeal.mem_ker _).mpr + rw [map_sub,RingQuot.mkRingHom_rel hab,sub_self] +end Quotient + +section Corner +variable {R S : Type*} [Ring R] [Ring S] + +theorem supportIdempotent (f : R →ₙ+* S) : IsIdempotentElem (f 1) := by + change f 1*f 1=f 1 + rw [←map_mul,one_mul] + +def toCorner (f : R →ₙ+* S) : R →+* (supportIdempotent f).Corner where + toFun x := ⟨f x,(Subsemigroup.mem_corner_iff (supportIdempotent f)).mpr + ⟨by rw [←map_mul,one_mul],by rw [←map_mul,mul_one]⟩⟩ + map_one' := rfl + map_zero' := Subtype.ext (map_zero f) + map_add' x y := Subtype.ext (map_add f x y) + map_mul' x y := Subtype.ext (map_mul f x y) + + theorem toCorner_injective (f : R →ₙ+* S) (hf : Function.Injective f) : + Function.Injective (toCorner f) := by + intro x y hxy + exact hf (congrArg Subtype.val hxy) +end Corner + +section Contracted +variable {k M : Type*} [CommRing k] [Nontrivial k] [MonoidWithZero M] + + theorem monoidBasis_injective : Function.Injective (ContractedPresentation.monoidBasis k (M:=M)) := by + intro x y hxy + change Contracted.basis k M x 1=Contracted.basis k M y 1 at hxy + by_contra hne + by_cases hx : x=0 + · have hy : y≠0 := by intro hy; exact hne (hx.trans hy.symm) + have hh := congrArg (Contracted.coefficient (k:=k) y hy) hxy + simp [Contracted.coefficient_basis,Ne.symm hne] at hh + · have hh := congrArg (Contracted.coefficient (k:=k) x hx) hxy + simp [Contracted.coefficient_basis,hne] at hh + +def monoidBasis₀ : M →*₀ Contracted.Algebra k M := + { ContractedPresentation.monoidBasis k with map_zero' := Contracted.basis_zero k M 1 } +end Contracted + +variable {k B : Type*} [CommRing k] [Ring B] [Algebra k B] +open PartialAffine.Corner + +def binaryS : Fin 2 → MonoidAlgebra k PartialAffine.monoid := ![s0 k,s1 k] +def binaryD : Fin 2 → MonoidAlgebra k PartialAffine.monoid := ![t0 k,t1 k] + +lemma q_binaryS (i : Fin 2) : q k*binaryS i=binaryS i := by + fin_cases i + · exact q_s0 k + · exact q_s1 k +lemma binaryS_q (i : Fin 2) : binaryS i*q k=binaryS i := by + fin_cases i + · exact s0_q k + · exact s1_q k +lemma q_binaryD (i : Fin 2) : q k*binaryD i=binaryD i := by + fin_cases i + · exact q_t0 k + · exact q_t1 k +lemma binaryD_q (i : Fin 2) : binaryD i*q k=binaryD i := by + fin_cases i + · exact t0_q k + · exact t1_q k +lemma binaryDS (i j : Fin 2) : binaryD i*binaryS j=if i=j then q k else 0 := by + fin_cases i <;> fin_cases j <;> + simp [binaryS,binaryD,t0_s0,t0_s1,t1_s0,t1_s1] +lemma binary_partition : binaryS (k:=k) 0*binaryD 0+binaryS 1*binaryD 1=q k := + s0_t0_add_s1_t1 k + +variable (ξ : B ⊗[k] MonoidAlgebra k PartialAffine.monoid →ₙₐ[k] B) + +def binaryPhi : B →ₙₐ[k] B := ξ.comp (cornerTensor k B) + +lemma binaryPhi_apply (a : B) : binaryPhi ξ a=ξ (a⊗ₜ[k] q k) := rfl + +lemma binary_constant_commute (c : MonoidAlgebra k PartialAffine.monoid) + (hqc : q k*c=c) (hcq : c*q k=c) (a : B) : + Commute (ξ (1⊗ₜ[k] c)) (binaryPhi ξ a) := by + change ξ (1⊗ₜ[k] c)*binaryPhi ξ a=binaryPhi ξ a*ξ (1⊗ₜ[k] c) + rw [binaryPhi_apply,←map_mul,←map_mul] + simp only [Algebra.TensorProduct.tmul_mul_tmul,one_mul,mul_one,hqc,hcq] + +def binaryData : CompressedSplittings.BinaryData (binaryPhi ξ : B →ₙ+* B) where + s i := ξ (1⊗ₜ[k] binaryS i) + d i := ξ (1⊗ₜ[k] binaryD i) + s_left i := by + change ξ (1⊗ₜ[k] q k)*ξ (1⊗ₜ[k] binaryS i)=_ + rw [←map_mul,Algebra.TensorProduct.tmul_mul_tmul,one_mul,q_binaryS] + s_right i := by + change ξ (1⊗ₜ[k] binaryS i)*ξ (1⊗ₜ[k] q k)=_ + rw [←map_mul,Algebra.TensorProduct.tmul_mul_tmul,one_mul,binaryS_q] + d_left i := by + change ξ (1⊗ₜ[k] q k)*ξ (1⊗ₜ[k] binaryD i)=_ + rw [←map_mul,Algebra.TensorProduct.tmul_mul_tmul,one_mul,q_binaryD] + d_right i := by + change ξ (1⊗ₜ[k] binaryD i)*ξ (1⊗ₜ[k] q k)=_ + rw [←map_mul,Algebra.TensorProduct.tmul_mul_tmul,one_mul,binaryD_q] + s_commute i := binary_constant_commute ξ (binaryS i) (q_binaryS i) (binaryS_q i) + d_commute i := binary_constant_commute ξ (binaryD i) (q_binaryD i) (binaryD_q i) + ds i j := by + rw [←map_mul,Algebra.TensorProduct.tmul_mul_tmul,one_mul,binaryDS] + split_ifs + · rfl + · rw [TensorProduct.tmul_zero,map_zero] + partition := by + rw [←map_mul,←map_mul,←map_add] + simp only [Algebra.TensorProduct.tmul_mul_tmul,one_mul,←TensorProduct.tmul_add,binary_partition] + rfl + + theorem binaryPhi_injective (hξ : Function.Injective ξ) : Function.Injective (binaryPhi ξ) := + hξ.comp (cornerTensor_injective k B) + +end SimpleFInftyOvergroups.RingAssembly +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleOvergroups/RingModel.lean b/lean/OAI/GroupTheory/SimpleOvergroups/RingModel.lean new file mode 100644 index 0000000000000000000000000000000000000000..7853504ee20a8b6d51e4d5405b777b7ff1b1e74b --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleOvergroups/RingModel.lean @@ -0,0 +1,94 @@ +import Mathlib +import OAI.GroupTheory.SimpleOvergroups.RingAssemblyTools +import OAI.GroupTheory.SimpleOvergroups.SourceModel + +namespace OAI + + +noncomputable section +namespace SimpleFInftyOvergroups.SourceModel +open scoped Classical TensorProduct FiniteAlgebraicEnvelopes.Compiler.HeadCodec +open FiniteAlgebraicEnvelopes Bootstrap Compiler Compiler.Simulator MachineRealization +open ContextualEncoding SemanticEncoding EffectiveNames RingAssembly + +variable {G : Type} [Group G] {k : ℕ} (s : Fin k → G) +variable (h : ComputablePred (fun w => FiniteAlgebraicEnvelopes.evalWord s w = 1)) +local instance : LinearOrder (Control.Sector Sigma (Bool × family.Γ) (ParameterMachine.State family.Q (index s h))) := + ParameterCode.finiteOrder (index s h) + + theorem realizes_processor : Word.Realizes KAlphabet (KMachine s h) (tableNormal (processor s h)) := + index_fixed s h ▸ family.realizes (index s h) + +def rawCopy : L s h →ₙ* K s h := + Quotient.rawMap (processor s h) wf (index_good s h) (index_stable s h) + KAlphabet (KMachine s h) family.decode (realizes_processor s h) + theorem rawCopy_injective : Function.Injective (rawCopy s h) := + Quotient.rawMap_injective (processor s h) wf (index_good s h) (index_stable s h) + KAlphabet (KMachine s h) family.decode (realizes_processor s h) + theorem rawCopy_ne_one (x : L s h) : rawCopy s h x ≠ 1 := + Quotient.rawMap_ne_one (processor s h) wf (index_good s h) (index_stable s h) + KAlphabet (KMachine s h) family.decode (realizes_processor s h) x + theorem rawCopy_ne_zero (x : L s h) : rawCopy s h x ≠ 0 := + Quotient.rawMap_ne_zero (processor s h) wf (index_good s h) (index_stable s h) + KAlphabet (KMachine s h) family.decode (realizes_processor s h) x + +def i : Astar s h →ₙₐ[ZMod 2] B s h := Contracted.embedding (rawCopy s h) + theorem i_injective : Function.Injective (i s h) := + Contracted.embedding_injective (rawCopy s h) (rawCopy_injective s h) (rawCopy_ne_zero s h) + theorem one_not_mem_i : (1 : B s h) ∉ Set.range (i s h) := + Contracted.one_not_mem_range (rawCopy s h) (rawCopy_ne_one s h) + +def κ : B s h ⊗[ZMod 2] MonoidAlgebra (ZMod 2) PartialAffine.monoid →ₐ[ZMod 2] Astar s h := + (Contracted.map (codeProduct₀ s h)).comp (ZeroProduct.tensorMap (ZMod 2) (K s h) PartialAffine.monoid) + theorem κ_injective : Function.Injective (κ s h) := + (Contracted.map_injective (codeProduct₀ s h) (codeProduct_injective s h)).comp + (ZeroProduct.tensorMap_bijective (ZMod 2) (K s h) PartialAffine.monoid).1 + +def ξ : B s h ⊗[ZMod 2] MonoidAlgebra (ZMod 2) PartialAffine.monoid →ₙₐ[ZMod 2] B s h := + (i s h).comp (κ s h).toNonUnitalAlgHom + theorem ξ_injective : Function.Injective (ξ s h) := (i_injective s h).comp (κ_injective s h) + +def φ : B s h →ₙ+* B s h := binaryPhi (ξ s h) + theorem φ_injective : Function.Injective (φ s h) := binaryPhi_injective (ξ s h) (ξ_injective s h) +def binary : CompressedSplittings.BinaryData (φ s h) := binaryData (ξ s h) + +def e : B s h := i s h 1 + theorem e_idempotent : IsIdempotentElem (e s h) := supportIdempotent (i s h : Astar s h →ₙ+* B s h) + theorem e_nonzero : e s h ≠ 0 := by + intro he + exact one_ne_zero (i_injective s h (he.trans (map_zero (i s h)).symm)) + theorem e_ne_one : e s h ≠ 1 := fun he => one_not_mem_i s h ⟨1,he⟩ + +def cornerMap : Astar s h →+* (e_idempotent s h).Corner := toCorner (i s h : Astar s h →ₙ+* B s h) + theorem cornerMap_injective : Function.Injective (cornerMap s h) := toCorner_injective _ (i_injective s h) + +abbrev Generators := CommonCompiler.FiniteLetter Sigma family.Γ family.Q (index s h) +def Relations : FreeAlgebra (ZMod 2) (Generators s h) → FreeAlgebra (ZMod 2) (Generators s h) → Prop := + ContractedPresentation.Rel (ZMod 2) (Generators s h) (Word.Rel KAlphabet (KMachine s h)) [.zero] + +def presentation : RingQuot (Relations s h) ≃ₐ[ZMod 2] B s h := + ContractedPresentation.equivalence (ZMod 2) (Generators s h) (Word.Rel KAlphabet (KMachine s h)) + (MulEquiv.refl (K s h)) [.zero] rfl + theorem relations_finite : {p : FreeAlgebra (ZMod 2) (Generators s h) × FreeAlgebra (ZMod 2) (Generators s h) | + Relations s h p.1 p.2}.Finite := + ContractedPresentation.finite_relations (ZMod 2) (Generators s h) (Word.Rel KAlphabet (KMachine s h)) + [.zero] (Word.rules_finite KAlphabet (KMachine s h)) + +def presentationMap : FreeAlgebra (ZMod 2) (Generators s h) →ₐ[ZMod 2] B s h := + (presentation s h).toAlgHom.comp (RingQuot.mkAlgHom (ZMod 2) (Relations s h)) + theorem presentationMap_surjective : Function.Surjective (presentationMap s h) := + (presentation s h).surjective.comp (RingQuot.mkAlgHom_surjective (ZMod 2) (Relations s h)) + theorem presentationMap_kernel : TwoSidedIdeal.ker (presentationMap s h).toRingHom = + TwoSidedIdeal.span (differences (Relations s h)) := by + rw [←ker_ringQuot] + ext a + simp only [TwoSidedIdeal.mem_ker] + change presentation s h (RingQuot.mkAlgHom (ZMod 2) (Relations s h) a)=0 ↔ + RingQuot.mkRingHom (Relations s h) a=0 + rw [←RingQuot.mkAlgHom_coe (ZMod 2) (Relations s h)] + exact (presentation s h).map_eq_zero_iff + +end SimpleFInftyOvergroups.SourceModel +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleOvergroups/SemanticActionMonoid.lean b/lean/OAI/GroupTheory/SimpleOvergroups/SemanticActionMonoid.lean new file mode 100644 index 0000000000000000000000000000000000000000..83991d2d53bbdbeaa93e64b6effb852f9de9f263 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleOvergroups/SemanticActionMonoid.lean @@ -0,0 +1,134 @@ +import Mathlib +import OAI.GroupTheory.SimpleOvergroups.ActionMonoid +import OAI.GroupTheory.SimpleOvergroups.NamedActions + +namespace OAI + + +noncomputable section +open scoped Classical +namespace SimpleFInftyOvergroups.SemanticEncoding +open BoundedEncoding NamedAction +namespace SemanticActionMonoid + +variable {G X V Y K L : Type*} [Group V] [MulAction V Y] {m : ℕ} + {N : Operations G X} {C : ActionCalculus V Y K L m} (I : Interpretation N C) + +abbrev groupValue (g : G) : V := (I.group g).val +abbrev pointValue (x : X) : Y := (I.point x).val + +def letter : Letter G X → SourceActionMonoid.Generator V Y + | .inl g => .grp (groupValue I g) + | .inr (.inl x) => .pre (pointValue I x) + | .inr (.inr (some x)) => .delete (pointValue I x) + | .inr (.inr none) => .zero + +def wordMap : FreeMonoid (Letter G X) →* SourceActionMonoid.M V Y := + (PresentedMonoid.mk (SourceActionMonoid.Relation V Y)).comp + (FreeMonoid.lift (fun a => FreeMonoid.of (letter I a))) + +def formValue : Form G X → SourceActionMonoid.Algorithm.Form (V:=V) (Z:=Y) := + Operations.formKey (groupValue I) (pointValue I) + + theorem formKey_injective {G X : Type*} {kg : G → K} {kx : X → L} + (hg : Function.Injective kg) (hx : Function.Injective kx) : + Function.Injective (Operations.formKey kg kx) := by + apply Option.map_injective + intro a b h + apply Prod.ext + · exact (List.map_injective_iff.mpr hx) (congrArg Prod.fst h) + · apply Prod.ext + · exact hg (congrArg (fun p => p.2.1) h) + · exact (List.map_injective_iff.mpr hx) (congrArg (fun p => p.2.2) h) + + theorem formKey_comp (f : Form G X) : + Operations.formKey C.group.key C.point.key (formValue I f) = + Operations.formKey I.gkey I.xkey f := by + cases f with + | none => rfl + | some p => simp only [Operations.formKey,formValue,Option.map_some,List.map_map]; rfl + +variable [DecidableEq L] + + theorem formValue_step (hx : Function.Injective C.point.key) + (a : Letter G X) (f : Form G X) : + formValue I (N.totalStep I.xkey a f) = + SourceActionMonoid.Algorithm.step (letter I a) (formValue I f) := by + have hone : groupValue I N.one = 1 := congrArg WithBound.val I.one + have hmul g h : groupValue I (N.mul g h) = groupValue I g * groupValue I h := + congrArg WithBound.val (I.mul g h) + have hinv g : groupValue I (N.inv g) = (groupValue I g)⁻¹ := + congrArg WithBound.val (I.inv g) + have hact g x : pointValue I (N.act g x) = groupValue I g • pointValue I x := + congrArg WithBound.val (I.act g x) + have hkey x y : I.xkey x = I.xkey y ↔ pointValue I x = pointValue I y := hx.eq_iff + cases f with + | none => cases a <;> rfl + | some p => + rcases p with ⟨l,g,r⟩ + rcases a with h | (x | y) + · cases l <;> simp [Operations.totalStep,Operations.plan,formValue,Operations.formKey, + letter,SourceActionMonoid.Algorithm.step,hmul,hact] + · rfl + · cases y with + | none => rfl + | some y => + cases l with + | nil => simp [Operations.totalStep,Operations.plan,formValue,Operations.formKey, + letter,SourceActionMonoid.Algorithm.step,hone,hact,hinv] + | cons x l => + by_cases h : I.xkey y = I.xkey x + · simp [Operations.totalStep,Operations.plan,formValue,Operations.formKey, + letter,SourceActionMonoid.Algorithm.step,h,(hkey y x).mp h] + · simp [Operations.totalStep,Operations.plan,formValue,Operations.formKey, + letter,SourceActionMonoid.Algorithm.step,h,mt (hkey y x).mpr h] + + theorem formValue_normalize (hx : Function.Injective C.point.key) (w : List (Letter G X)) : + formValue I (N.totalNormalize I.xkey w) = SourceActionMonoid.Algorithm.normalize (w.map (letter I)) := by + induction w with + | nil => + change some ([],groupValue I N.one,[]) = some ([],1,[]) + rw [show groupValue I N.one = 1 from congrArg WithBound.val I.one] + | cons a w ih => + change formValue I (N.totalStep I.xkey a (N.totalNormalize I.xkey w)) = _ + rw [formValue_step I hx,ih] + rfl + +omit [DecidableEq L] in + theorem wordMap_ofList (w : List (Letter G X)) : + wordMap I (FreeMonoid.ofList w) = + PresentedMonoid.mk (SourceActionMonoid.Relation V Y) (FreeMonoid.ofList (w.map (letter I))) := by + induction w with + | nil => rfl + | cons a w ih => simp only [FreeMonoid.ofList_cons,map_mul,List.map_cons,ih]; rfl + + theorem totalTest_eq_iff (hg : Function.Injective C.group.key) (hx : Function.Injective C.point.key) + (u v : List (Letter G X)) : + N.totalTest I.gkey I.xkey u = N.totalTest I.gkey I.xkey v ↔ + wordMap I (FreeMonoid.ofList u) = wordMap I (FreeMonoid.ofList v) := by + change Operations.formKey I.gkey I.xkey _ = Operations.formKey I.gkey I.xkey _ ↔ _ + rw [← formKey_comp I,← formKey_comp I,(formKey_injective hg hx).eq_iff, + formValue_normalize I hx,formValue_normalize I hx,wordMap_ofList,wordMap_ofList] + exact (SourceActionMonoid.Algorithm.word_eq_iff _ _).symm + +omit [DecidableEq L] in + theorem wordMap_surjective (hg : Function.Surjective (groupValue I)) + (hx : Function.Surjective (pointValue I)) : Function.Surjective (wordMap I) := by + have hl : Function.Surjective (letter I) := by + intro a + cases a with + | grp g => obtain ⟨a,rfl⟩ := hg g; exact ⟨.inl a,rfl⟩ + | pre y => obtain ⟨a,rfl⟩ := hx y; exact ⟨.inr (.inl a),rfl⟩ + | delete y => obtain ⟨a,rfl⟩ := hx y; exact ⟨.inr (.inr (some a)),rfl⟩ + | zero => exact ⟨.inr (.inr none),rfl⟩ + intro z + obtain ⟨v,rfl⟩ := PresentedMonoid.surjective_mk z + obtain ⟨w,hw⟩ := (List.map_surjective_iff.mpr hl) v.toList + refine ⟨FreeMonoid.ofList w,?_⟩ + rw [wordMap_ofList,hw,FreeMonoid.ofList_toList] + +end SemanticActionMonoid +end SimpleFInftyOvergroups.SemanticEncoding +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleOvergroups/SemanticActions.lean b/lean/OAI/GroupTheory/SimpleOvergroups/SemanticActions.lean new file mode 100644 index 0000000000000000000000000000000000000000..9982f045f228d291e2b6d602879efda8d48661e5 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleOvergroups/SemanticActions.lean @@ -0,0 +1,241 @@ +import Mathlib +import OAI.GroupTheory.FiniteType.ClassifyingSpacesFiniteExtensionGeometricFromProducts +import OAI.GroupTheory.FiniteType.StageConstruction +import OAI.GroupTheory.SimpleOvergroups.MatrixEffective + +namespace OAI + + +noncomputable section +open scoped Classical +namespace SimpleFInftyOvergroups.SemanticEncoding +open BoundedEncoding EffectiveNames + +def globalCalculus {V Y K L : Type*} [Group V] [MulAction V Y] + (kg : V → K) (kx : Y → L) (hg : Function.Injective kg) (hx : Function.Injective kx) + (m : ℕ) : ActionCalculus V Y K L m where + group := ⟨fun _ => Set.univ, fun _ _ _ => Set.Subset.refl _, kg⟩ + point := ⟨fun _ => Set.univ, fun _ _ _ => Set.Subset.refl _, kx⟩ + one_mem _ := Set.mem_univ _ + inv_mem _ := Set.mem_univ _ + mul_mem _ _ := Set.mem_univ _ + smul_mem _ _ := Set.mem_univ _ + inv_congr h := congrArg (fun v => kg v⁻¹) (hg h) + mul_congr _ _ _ _ _ _ h h' := by rw [hg h,hg h'] + smul_congr _ _ _ _ _ _ h h' := by rw [hg h,hx h'] + +namespace SemanticMatrix +open StageConstruction MatrixNames +abbrev Raw (k A : Type*) [CommRing k] := MonoidAlgebra k (FreeMonoid A) + +def seven : Fin 7 ≃ Seven := Fintype.equivOfCardEq (by simp [Seven]) + +variable {k A R : Type*} [CommRing k] [Ring R] [Algebra k R] + (π : Raw k A →ₐ[k] R) + +def matrixMap : Matrix (Fin 7) (Fin 7) (Raw k A) →+* Matrix Seven Seven R := + (Matrix.reindexRingEquiv R seven).toRingHom.comp π.toRingHom.mapMatrix + +@[simp] theorem matrixMap_apply (a : Matrix (Fin 7) (Fin 7) (Raw k A)) (i j : Seven) : + matrixMap π a i j = π (a (seven.symm i) (seven.symm j)) := rfl + +def columnMap (x : Fin 7 → Raw k A) : Seven → R := fun i => π (x (seven.symm i)) + + theorem matrixMap_mulVec (a : Matrix (Fin 7) (Fin 7) (Raw k A)) (x : Fin 7 → Raw k A) : + (matrixMap π a).mulVec (columnMap π x) = columnMap π (a.mulVec x) := by + funext i + simp only [Matrix.mulVec,dotProduct,columnMap,matrixMap_apply,map_sum,map_mul] + exact Equiv.sum_comp seven.symm (fun j => π (a (seven.symm i) j) * π (x j)) + +def rootValue (r : MatrixWords.Root k A 7) : Q R := + if h : r.1 ≠ r.2.1 then + ⟨NoncommElementary.root (seven r.1) (seven r.2.1) (seven.injective.ne h) (π (Polynomial.value r.2.2)), + NoncommElementary.root_mem _ _ _ _⟩ + else 1 + +def groupValue (w : MatrixWords.Word k A 7) : Q R := (w.map (rootValue π)).prod + +def pointValue (x : MatrixWords.Point k A 7) : X R := groupValue π x.1 • columnMap π (columnValue x.2) + +@[simp] theorem rootValue_inverse (r : MatrixWords.Root k A 7) : + rootValue π (MatrixWords.rootInv r) = (rootValue π r)⁻¹ := by + by_cases h : r.1 ≠ r.2.1 + · apply Subtype.ext + simp [rootValue,MatrixWords.rootInv,h,NoncommElementary.root_inv] + · simp [rootValue,MatrixWords.rootInv,h] + +@[simp] theorem groupValue_nil : groupValue π [] = 1 := rfl +@[simp] theorem groupValue_append (a b : MatrixWords.Word k A 7) : + groupValue π (a++b) = groupValue π a * groupValue π b := by simp [groupValue] +@[simp] theorem groupValue_cons (r : MatrixWords.Root k A 7) (w : MatrixWords.Word k A 7) : + groupValue π (r::w) = rootValue π r * groupValue π w := rfl +@[simp] theorem groupValue_inverse (w : MatrixWords.Word k A 7) : + groupValue π (MatrixWords.inverse w) = (groupValue π w)⁻¹ := by + induction w with + | nil => simp + | cons r w ih => simp [ih,mul_inv_rev] + +@[simp] theorem pointValue_act (w : MatrixWords.Word k A 7) (x : MatrixWords.Point k A 7) : + pointValue π (w++x.1,x.2) = groupValue π w • pointValue π x := by + simp only [pointValue,groupValue_append] + exact mul_smul (groupValue π w) (groupValue π x.1) + (show X R from columnMap π (columnValue x.2)) + + theorem rootValue_matrix (r : MatrixWords.Root k A 7) : + (rootValue π r).val.val = matrixMap π (MatrixWords.rootValue r).val := by + by_cases h : r.1 ≠ r.2.1 + · ext i j + simp only [rootValue,dite_eq_left h,NoncommElementary.root_val,MatrixWords.rootValue, + FiniteAlgebraicEnvelopes.Steinberg.elementary_val,matrixMap_apply,map_add, + Matrix.add_apply,Matrix.one_apply,Matrix.single_apply] + have hi : r.1 = seven.symm i ↔ seven r.1 = i := seven.eq_symm_apply + have hj : r.2.1 = seven.symm j ↔ seven r.2.1 = j := seven.eq_symm_apply + simp only [apply_ite,map_one,map_zero,seven.symm.injective.eq_iff,hi,hj] + split <;> simp_all only + · simp [rootValue,MatrixWords.rootValue,h] + + theorem groupValue_matrix (w : MatrixWords.Word k A 7) : + (groupValue π w).val.val = matrixMap π (MatrixWords.groupValue w).val := by + induction w with + | nil => simp + | cons r w ih => simp only [groupValue_cons,MatrixWords.groupValue_cons,Subgroup.coe_mul, + Units.val_mul,map_mul,rootValue_matrix,ih] + +attribute [local instance] WordCalculus.rawMatrixAction + theorem pointValue_column (x : MatrixWords.Point k A 7) : + pointValue π x = columnMap π (MatrixWords.pointValue x) := by + change (groupValue π x.1).val.val.mulVec _ = _ + rw [groupValue_matrix,matrixMap_mulVec] + rfl + + theorem groupValue_surjective (hπ : Function.Surjective π) : Function.Surjective (groupValue π) := by + intro g + have h : ∃ w, (groupValue π w).val = g.val := by + apply Subgroup.closure_induction (p:=fun g _ => ∃ w, (groupValue π w).val = g) (hx:=g.property) + · rintro g ⟨i,j,h,a,rfl⟩ + obtain ⟨a,ha⟩ := hπ a + obtain ⟨p,rfl⟩ := Polynomial.value_surjective a + refine ⟨[(seven.symm i,seven.symm j,p)],?_⟩ + simp only [groupValue_cons,groupValue_nil,mul_one,rootValue] + rw [dite_eq_left (seven.symm.injective.ne h)] + simp [ha] + · exact ⟨[],rfl⟩ + · rintro a b ha hb ⟨u,rfl⟩ ⟨v,rfl⟩ + exact ⟨u++v,congrArg Subtype.val (groupValue_append π u v)⟩ + · rintro a ha ⟨u,rfl⟩ + exact ⟨MatrixWords.inverse u,congrArg Subtype.val (groupValue_inverse π u)⟩ + obtain ⟨w,hw⟩ := h + exact ⟨w,Subtype.ext hw⟩ + + theorem pointValue_surjective (hπ : Function.Surjective π) : Function.Surjective (pointValue π) := by + intro x + have h : ∀ i : Fin 7, ∃ p : Polynomial.Name k A, π (Polynomial.value p) = x (seven i) := + fun i => by + obtain ⟨a,ha⟩ := hπ (x (seven i)) + obtain ⟨p,rfl⟩ := Polynomial.value_surjective a + exact ⟨p,ha⟩ + choose p hp using h + refine ⟨([],p),?_⟩ + simp only [pointValue,groupValue_nil] + refine (one_smul (Q R) (show X R from columnMap π (columnValue p))).trans ?_ + funext i + exact (hp (seven.symm i)).trans (congrArg x (seven.apply_symm_apply i)) + +variable [Primcodable A] [Primcodable k] [Finite k] +variable (σ : R → Raw k A) (hσ : Function.Injective σ) + +def groupKey (g : Q R) : (Fin 7 → Fin 7 → ℕ) × (Fin 7 → Fin 7 → ℕ) := + MatrixWords.pairedKey (fun i j => σ (g.val.val (seven i) (seven j)), + fun i j => σ (g.val.inv (seven i) (seven j))) + +def pointKey (x : X R) : Fin 7 → ℕ := columnKey (fun i => σ (x (seven i))) + +omit [Algebra k R] in + include hσ in + theorem groupKey_injective [Algebra k R] : Function.Injective (groupKey σ) := by + intro g h he + apply Subtype.ext + apply Units.ext + funext i j + have hh := congrFun (congrFun (congrArg Prod.fst (MatrixWords.pairedKey_injective he)) (seven.symm i)) (seven.symm j) + exact hσ (by simpa only [seven.apply_symm_apply] using hh) + +omit [Ring R] [Algebra k R] [Finite k] in + include hσ in + theorem pointKey_injective [Ring R] [Algebra k R] [Finite k] : + Function.Injective (pointKey σ) := by + intro x y he + funext i + have hh := congrFun (columnKey_injective he) (seven.symm i) + exact hσ (by simpa only [seven.apply_symm_apply] using hh) + +def calculus (m : ℕ) := globalCalculus (groupKey σ) (pointKey σ) + (groupKey_injective σ hσ) (pointKey_injective σ hσ) m + +def interpretation (grade : List A → ℕ) (m : ℕ) : + NamedAction.Interpretation (MatrixWords.nameOperations (k:=k) (n:=7) grade) (calculus σ hσ m) where + group w := ⟨groupValue π w,MatrixWords.gcost grade w,Set.mem_univ _⟩ + point x := ⟨pointValue π x,MatrixWords.xcost grade x,Set.mem_univ _⟩ + group_cost _ := rfl + point_cost _ := rfl + one := WithBound.ext' (groupValue_nil π) rfl + mul a b := WithBound.ext' (groupValue_append π a b) (MatrixWords.gcost_append grade a b) + inv w := WithBound.ext' (groupValue_inverse π w) (MatrixWords.gcost_inverse grade w) + act g x := WithBound.ext' (pointValue_act π g x) + (by change MatrixWords.gcost _ (g++x.1) + columnCost _ x.2 = + MatrixWords.gcost grade g + MatrixWords.xcost grade x + simp [MatrixWords.gcost_append,MatrixWords.xcost,Nat.add_assoc]) + + theorem gkey_eq {m : ℕ} (C : WordCalculus (FreeMonoid A) m) + (hs : ∀ a, σ (π a) = C.collect k a) (w : MatrixWords.Word k A 7) : + (interpretation π σ hσ (MatrixWords.grade C) m).gkey w = + (MatrixWords.interpretation C).gkey w := by + change MatrixWords.pairedKey _ = MatrixWords.pairedKey _ + congr 1 + apply Prod.ext + · funext i j + change σ ((groupValue π w).val.val (seven i) (seven j)) = + C.collect k ((MatrixWords.groupValue w).val i j) + rw [groupValue_matrix, matrixMap_apply] + simpa only [seven.symm_apply_apply] using hs ((MatrixWords.groupValue w).val i j) + · funext i j + change σ (((groupValue π w)⁻¹).val.val (seven i) (seven j)) = + C.collect k ((MatrixWords.groupValue w).inv i j) + rw [← groupValue_inverse,groupValue_matrix,matrixMap_apply] + simpa only [seven.symm_apply_apply,MatrixWords.groupValue_inverse, ← Units.inv_eq_val_inv] using + hs ((MatrixWords.groupValue w).inv i j) + + theorem xkey_eq {m : ℕ} (C : WordCalculus (FreeMonoid A) m) + (hs : ∀ a, σ (π a) = C.collect k a) (x : MatrixWords.Point k A 7) : + (interpretation π σ hσ (MatrixWords.grade C) m).xkey x = + (MatrixWords.interpretation C).xkey x := by + change columnKey _ = columnKey _ + congr 1 + funext i + change σ (pointValue π x (seven i)) = C.collect k (MatrixWords.pointValue x i) + rw [pointValue_column] + simpa only [columnMap,seven.symm_apply_apply] using hs (MatrixWords.pointValue x i) + + theorem partialGroupKey_full {m : ℕ} (C : WordCalculus (FreeMonoid A) m) + (hs : ∀ a, σ (π a) = C.collect k a) (f : List A → Part (List A)) + (w : MatrixWords.Word k A 7) {d : ℕ} (hw : MatrixWords.gcost (MatrixWords.grade C) w ≤ d) + (hf : ∀ u, MatrixWords.grade C u ≤ d → (C.normal (FreeMonoid.ofList u)).toList ∈ f u) : + (interpretation π σ hσ (MatrixWords.grade C) m).gkey w ∈ + MatrixWords.partialGroupKey C.omega.toList f w := by + rw [gkey_eq π σ hσ C hs] + exact MatrixWords.partialGroupKey_full C f w hw hf + + theorem partialPointKey_full {m : ℕ} (C : WordCalculus (FreeMonoid A) m) + (hs : ∀ a, σ (π a) = C.collect k a) (f : List A → Part (List A)) + (x : MatrixWords.Point k A 7) {d : ℕ} (hx : MatrixWords.xcost (MatrixWords.grade C) x ≤ d) + (hf : ∀ u, MatrixWords.grade C u ≤ d → (C.normal (FreeMonoid.ofList u)).toList ∈ f u) : + (interpretation π σ hσ (MatrixWords.grade C) m).xkey x ∈ + MatrixWords.partialPointKey C.omega.toList f x := by + rw [xkey_eq π σ hσ C hs] + exact MatrixWords.partialPointKey_full C f x hx hf + +end SemanticMatrix +end SimpleFInftyOvergroups.SemanticEncoding +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleOvergroups/SemanticDouble.lean b/lean/OAI/GroupTheory/SimpleOvergroups/SemanticDouble.lean new file mode 100644 index 0000000000000000000000000000000000000000..d46f86846143f53d6b3486d092cc2078f42888b3 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleOvergroups/SemanticDouble.lean @@ -0,0 +1,140 @@ +import Mathlib +import OAI.GroupTheory.SimpleOvergroups.BoundedForms +import OAI.GroupTheory.SimpleOvergroups.SemanticEnlargements + +namespace OAI + + +noncomputable section +open scoped Classical +namespace SimpleFInftyOvergroups.SemanticEncoding +open BoundedEncoding EffectiveNames NamedAction SourceEnlargement +namespace SemanticDouble + +local instance : Primcodable (ZMod 2) := FiniteAlgebraicEnvelopes.Effect.finitePrimcodable _ +local instance : Primcodable (ZMod 3) := FiniteAlgebraicEnvelopes.Effect.finitePrimcodable _ + +theorem orbit_step {V Y : Type} [Group V] [MulAction V Y] + (w : Double.W V) (v : Double.W₁ V) (y : Y) : + (w * groupEmbedding (ZMod 3) v) • Double.ambientPoint y = + w • pointEmbedding (ZMod 3) (v • pointEmbedding (ZMod 2) y) := by + rw [mul_smul] + exact congrArg (fun x => w • x) (groupEmbedding_pointEmbedding (ZMod 3) v _) + +theorem orbit_surjective {V Y U B P : Type} [Group V] [MulAction V Y] + (f : U → Double.W V) (t : B → Y) (p : P → Double.Y (Q:=V) (X:=Y)) + (b : U → B → P) (hp : ∀ u x, (p (b u x)).val = f u • Double.ambientPoint (t x)) + (hf : Function.Surjective f) (ht : Function.Surjective t) : Function.Surjective p := by + intro y + obtain ⟨w,x,h⟩ := y.property + obtain ⟨u,hu⟩ := hf w + obtain ⟨a,ha⟩ := ht x + refine ⟨b u a,Subtype.ext ?_⟩ + exact (hp u a).trans ((congrArg₂ (fun (w : Double.W V) (x : Double.AmbientY Y) => w • x) + hu (congrArg Double.ambientPoint ha)).trans h) + +variable {G X V Y K L : Type} [Group V] [MulAction V Y] [Nonempty Y] + [Primcodable K] [Primcodable L] {m : ℕ} + (N : Operations G X) (C : ActionCalculus V Y K L m) (I : Interpretation N C) + +abbrev P₁ := IdempotentNames.Index (ZMod 2) +abbrev P₂ := IdempotentNames.Index (ZMod 3) +abbrev N₁ := Enlargement.operations (P:=P₁) N +abbrev N₂ := Enlargement.operations (P:=P₂) (N₁ N) +abbrev C₁ := SemanticEnlargement.calculus (k:=ZMod 2) C +abbrev I₁ := SemanticEnlargement.interpretation (k:=ZMod 2) N C I +abbrev C₂ := SemanticEnlargement.calculus (k:=ZMod 3) (C₁ C) +abbrev I₂ := SemanticEnlargement.interpretation (k:=ZMod 3) (N₁ N) (C₁ C) (I₁ N C I) + +abbrev GroupName := Enlargement.Word P₂ (Enlargement.Word P₁ G) +abbrev PointName := Enlargement.Point P₂ (Enlargement.Word P₁ G) (Enlargement.Point P₁ G X) + + theorem point_in_orbit (x : PointName (G:=G) (X:=X)) : + (I₂ N C I |>.point x).val ∈ Double.orbitSet (Q:=V) (X:=Y) := by + refine ⟨(I₂ N C I |>.group x.1).val * + groupEmbedding (ZMod 3) (I₁ N C I |>.group x.2.1).val, (I.point x.2.2).val, ?_⟩ + exact orbit_step _ _ _ + +def calculus : ActionCalculus (Double.W V) (Double.Y (Q:=V) (X:=Y)) (ℕ × ℕ) ℕ m where + group := (C₂ C).group + point := + { ball := fun b y => (C₂ C).point.ball b y.val + mono := fun _ _ h _ hy => (C₂ C).point.mono h hy + key := fun y => (C₂ C).point.key y.val } + one_mem := (C₂ C).one_mem + inv_mem := (C₂ C).inv_mem + mul_mem := (C₂ C).mul_mem + smul_mem := (C₂ C).smul_mem + inv_congr := (C₂ C).inv_congr + mul_congr := (C₂ C).mul_congr + smul_congr := (C₂ C).smul_congr + +def interpretation : Interpretation (N₂ N) (calculus C) where + group := (I₂ N C I).group + point x := ⟨⟨(I₂ N C I |>.point x).val,point_in_orbit N C I x⟩, + (I₂ N C I |>.point x).cost, (I₂ N C I |>.point x).mem⟩ + group_cost := (I₂ N C I).group_cost + point_cost := (I₂ N C I).point_cost + one := (I₂ N C I).one + mul := (I₂ N C I).mul + inv := (I₂ N C I).inv + act g x := WithBound.ext' + (Subtype.ext (congrArg WithBound.val ((I₂ N C I).act g x))) + (congrArg (fun t : WithBound (C₂ C).point => t.cost) ((I₂ N C I).act g x)) + + theorem groupKey_injective (hg : Function.Injective C.group.key) : + Function.Injective (calculus C).group.key := + SemanticEnlargement.groupKey_injective (C₁ C) + (SemanticEnlargement.groupKey_injective C hg) + + theorem pointKey_injective (hx : Function.Injective C.point.key) : + Function.Injective (calculus C).point.key := by + intro a b h + apply Subtype.ext + exact SemanticEnlargement.pointKey_injective (C₁ C) + (SemanticEnlargement.pointKey_injective C hx) h + + theorem groupValue_surjective (hg : Function.Surjective (fun g => (I.group g).val)) : + Function.Surjective (fun g => (interpretation N C I |>.group g).val) := + SemanticEnlargement.groupValue_surjective (N₁ N) (C₁ C) (I₁ N C I) + (SemanticEnlargement.groupValue_surjective N C I hg) + + theorem pointValue_base (u : GroupName (G:=G)) (b : X) : + (I₂ N C I |>.point (u,([],b))).val = + (I₂ N C I |>.group u).val • Double.ambientPoint (I.point b).val := by + exact congrArg (fun y => (I₂ N C I |>.group u).val • pointEmbedding (ZMod 3) y) + (SemanticEnlargement.pointValue_basis (k:=ZMod 2) N C I b) + + theorem pointValue_surjective (hg : Function.Surjective (fun g => (I.group g).val)) + (hx : Function.Surjective (fun x => (I.point x).val)) : + Function.Surjective (fun x => (interpretation N C I |>.point x).val) := + orbit_surjective (fun g => (I₂ N C I |>.group g).val) (fun x => (I.point x).val) + (fun x => (interpretation N C I |>.point x).val) (fun u b => (u,([],b))) + (pointValue_base N C I) (groupValue_surjective N C I hg) hx + +variable [Primcodable G] [Primcodable X] +omit [Primcodable G] [Primcodable X] in + theorem partialGroupKey_full (f : G → Part K) (w : GroupName (G:=G)) {d : ℕ} + (hw : (N₂ N).gcost w ≤ d) (hf : ∀ g, N.gcost g ≤ d → I.gkey g ∈ f g) : + (interpretation N C I).gkey w ∈ + Enlargement.partialGroupKey (N₁ N) (IdempotentNames.name (k:=ZMod 3)) + (Enlargement.partialGroupKey N (IdempotentNames.name (k:=ZMod 2)) f) w := by + apply SemanticEnlargement.partialGroupKey_full (N₁ N) (C₁ C) (I₁ N C I) _ w hw + intro v hv + exact SemanticEnlargement.partialGroupKey_full N C I f v hv hf + +omit [Primcodable G] [Primcodable X] in + theorem partialPointKey_full (f : X → Part L) (x : PointName (G:=G) (X:=X)) {d : ℕ} + (hx : (N₂ N).xcost x ≤ d) (hf : ∀ y, N.xcost y ≤ d → I.xkey y ∈ f y) : + (interpretation N C I).xkey x ∈ + Enlargement.partialPointKey (N₁ N) (IdempotentNames.name (k:=ZMod 3)) + (Enlargement.partialPointKey N (IdempotentNames.name (k:=ZMod 2)) f) x := by + apply SemanticEnlargement.partialPointKey_full (N₁ N) (C₁ C) (I₁ N C I) _ x hx + intro y hy + exact SemanticEnlargement.partialPointKey_full N C I f y hy hf + +end SemanticDouble +end SimpleFInftyOvergroups.SemanticEncoding +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleOvergroups/SemanticEnlargements.lean b/lean/OAI/GroupTheory/SimpleOvergroups/SemanticEnlargements.lean new file mode 100644 index 0000000000000000000000000000000000000000..e36a91e3f84344a2b130192a18c71fc1b7e46a3d --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleOvergroups/SemanticEnlargements.lean @@ -0,0 +1,167 @@ +import Mathlib +import OAI.GroupTheory.SimpleOvergroups.EnlargementEffective +import OAI.GroupTheory.SimpleOvergroups.TwoEnlargements + +namespace OAI + + +noncomputable section +open scoped Classical +namespace SimpleFInftyOvergroups.SemanticEncoding +open BoundedEncoding EffectiveNames NamedAction SourceEnlargement + +namespace IdempotentNames +abbrev Index (k : Type) [CommRing k] := BinaryPrefixOperators.idempotents k +instance {k : Type} [CommRing k] [Finite k] : Fintype (Index k) := + (BinaryPrefixOperators.idempotents_finite k).fintype +instance {k : Type} [CommRing k] [Finite k] : Primcodable (Index k) := + FiniteAlgebraicEnvelopes.Effect.finitePrimcodable _ + +variable {k : Type} [CommRing k] +def name (p : Index k) : Enlargement.Coeff.Name k := + (BinaryPrefixOperators.Arithmetic.Lists.value_surjective p.val).choose +@[simp] theorem value_name (p : Index k) : Enlargement.Coeff.value (name p) = p.val := + (BinaryPrefixOperators.Arithmetic.Lists.value_surjective p.val).choose_spec + theorem idempotent (p : Index k) : + Enlargement.Coeff.value (name p) * Enlargement.Coeff.value (name p) = + Enlargement.Coeff.value (name p) := by + simpa only [value_name] using BinaryPrefixOperators.idempotents_are_idempotent k p.property +end IdempotentNames + +namespace SemanticEnlargement +variable {G X V Y K L k : Type} [Group V] [MulAction V Y] [Nonempty Y] + [CommRing k] [Primcodable k] [Primcodable K] [Primcodable L] + {m : ℕ} (N : Operations G X) (C : ActionCalculus V Y K L m) + (I : Interpretation N C) + +local instance restrictedSMul : SMul (enlargedGroup k V) (enlargedSet k Y) := + (SourceEnlargement.enlargedAction k V Y).toSMul + +abbrev Word := Enlargement.Word (IdempotentNames.Index k) G +abbrev Point := Enlargement.Point (IdempotentNames.Index k) G X + +abbrev ambient := Enlargement.interpretation N (IdempotentNames.name (k:=k)) I IdempotentNames.idempotent + +def calculus : ActionCalculus (enlargedGroup k V) (enlargedSet k Y) (ℕ × ℕ) ℕ m where + group := + { ball := fun b w => (Enlargement.calculus (k:=k) C).group.ball b w.val + mono := fun _ _ h _ hw => (Enlargement.calculus (k:=k) C).group.mono h hw + key := fun w => (Enlargement.calculus (k:=k) C).group.key w.val } + point := (Enlargement.calculus (k:=k) C).point + one_mem := (Enlargement.calculus (k:=k) C).one_mem + inv_mem := (Enlargement.calculus (k:=k) C).inv_mem + mul_mem := (Enlargement.calculus (k:=k) C).mul_mem + smul_mem := (Enlargement.calculus (k:=k) C).smul_mem + inv_congr := (Enlargement.calculus (k:=k) C).inv_congr + mul_congr := (Enlargement.calculus (k:=k) C).mul_congr + smul_congr := (Enlargement.calculus (k:=k) C).smul_congr + +omit [Nonempty Y] [Primcodable k] [Primcodable K] [Primcodable L] in + theorem group_mem (w : Word (k:=k) (G:=G)) : + Enlargement.groupValue N (IdempotentNames.name (k:=k)) I IdempotentNames.idempotent w ∈ enlargedGroup k V := by + induction w with + | nil => exact (enlargedGroup k V).one_mem + | cons a w ih => + apply (enlargedGroup k V).mul_mem _ ih + change SourceEnlargement.unitMap _ _ _ ∈ _ + simp only [IdempotentNames.value_name] + exact Subgroup.subset_closure ⟨a.1, (I.group a.2).val, rfl⟩ + +def groupValue (w : Word (k:=k) (G:=G)) : enlargedGroup k V := + ⟨Enlargement.groupValue N IdempotentNames.name I IdempotentNames.idempotent w,group_mem N C I w⟩ +def pointValue (x : Point (k:=k) (G:=G) (X:=X)) : enlargedSet k Y := + Enlargement.pointValue N IdempotentNames.name I IdempotentNames.idempotent x + +omit [Nonempty Y] [Primcodable k] [Primcodable K] [Primcodable L] in +@[simp] theorem groupValue_nil : groupValue N C I ([] : Word (k:=k) (G:=G)) = 1 := rfl +omit [Nonempty Y] [Primcodable k] [Primcodable K] [Primcodable L] in +@[simp] theorem groupValue_append (u v : Word (k:=k) (G:=G)) : + groupValue N C I (u++v) = groupValue N C I u * groupValue N C I v := by + apply Subtype.ext + exact Enlargement.groupValue_append _ _ _ _ _ _ +omit [Nonempty Y] [Primcodable k] [Primcodable K] [Primcodable L] in +@[simp] theorem groupValue_inverse (u : Word (k:=k) (G:=G)) : + groupValue N C I (Enlargement.inverse N u) = (groupValue N C I u)⁻¹ := by + apply Subtype.ext + exact Enlargement.groupValue_inverse _ _ _ _ _ +omit [Nonempty Y] [Primcodable k] [Primcodable K] [Primcodable L] in +@[simp] theorem groupValue_singleton (p : IdempotentNames.Index k) (g : G) : + groupValue N C I [(p,g)] = SourceEnlargement.j k p (I.group g).val := by + apply Subtype.ext + simp [groupValue, + Enlargement.groupValue, Enlargement.rootValue, SourceEnlargement.j, SourceEnlargement.map] + rfl + +omit [Nonempty Y] [Primcodable k] [Primcodable K] [Primcodable L] in +@[simp] theorem pointValue_act (g : Word (k:=k) (G:=G)) (x : Point (k:=k) (G:=G) (X:=X)) : + pointValue N C I (g++x.1,x.2) = groupValue N C I g • pointValue N C I x := + Enlargement.pointValue_act _ _ _ _ _ _ +omit [Nonempty Y] [Primcodable k] [Primcodable K] [Primcodable L] in +@[simp] theorem pointValue_basis (x : X) : + pointValue N C I (([] : Word (k:=k) (G:=G)),x) = pointEmbedding k (I.point x).val := by + simp only [pointValue, Enlargement.pointValue, Enlargement.groupValue_nil, one_smul, + pointEmbedding] + +def interpretation : Interpretation (Enlargement.operations (P:=IdempotentNames.Index k) N) + (calculus (k:=k) C) where + group w := ⟨groupValue N C I w,Enlargement.gcost N w,Enlargement.group_mem N IdempotentNames.name I IdempotentNames.idempotent w⟩ + point x := ⟨pointValue N C I x, Enlargement.xcost N x, + Enlargement.point_mem N IdempotentNames.name I IdempotentNames.idempotent x⟩ + group_cost _ := rfl + point_cost _ := rfl + one := WithBound.ext' (groupValue_nil N C I) rfl + mul u v := WithBound.ext' (groupValue_append N C I u v) (Enlargement.gcost_append N u v) + inv u := WithBound.ext' (groupValue_inverse N C I u) (Enlargement.gcost_inverse N u) + act g x := WithBound.ext' (pointValue_act N C I g x) + (by change Enlargement.xcost N (g++x.1,x.2) = Enlargement.gcost N g + Enlargement.xcost N x + simp [Enlargement.xcost,Nat.add_assoc]) + + theorem groupKey_injective (hg : Function.Injective C.group.key) : + Function.Injective (calculus (k:=k) C).group.key := by + intro u v h + apply Subtype.ext + apply Units.ext + apply MonoidAlgebra.coeff_injective + apply Finsupp.mapDomain_injective hg + exact congrArg Prod.fst (Enlargement.pairedKey_injective h) + + theorem pointKey_injective (hx : Function.Injective C.point.key) : + Function.Injective (calculus (k:=k) C).point.key := by + intro u v h + exact Finsupp.mapDomain_injective hx (Enlargement.arrayKey_injective h) + +omit [Nonempty Y] [Primcodable k] [Primcodable K] [Primcodable L] in + theorem groupValue_surjective (hg : Function.Surjective (fun g => (I.group g).val)) : + Function.Surjective (groupValue (k:=k) N C I) := by + intro w + have h : ∃ u, (groupValue N C I u).val = w.val := by + apply Subgroup.closure_induction (p:=fun w _ => ∃ u, (groupValue N C I u).val = w) (hx:=w.property) + · rintro _ ⟨p,g,rfl⟩ + obtain ⟨a,rfl⟩ := hg g + exact ⟨[(p,a)],congrArg Subtype.val (groupValue_singleton N C I p a)⟩ + · exact ⟨[],rfl⟩ + · rintro _ _ _ _ ⟨u,rfl⟩ ⟨v,rfl⟩ + exact ⟨u++v,congrArg Subtype.val (groupValue_append N C I u v)⟩ + · rintro _ _ ⟨u,rfl⟩ + exact ⟨Enlargement.inverse N u,congrArg Subtype.val (groupValue_inverse N C I u)⟩ + obtain ⟨u,hu⟩ := h + exact ⟨u,Subtype.ext hu⟩ + +variable [Primcodable G] [Primcodable X] +omit [Primcodable G] [Primcodable X] in + theorem partialGroupKey_full (f : G → Part K) (w : Word (k:=k) (G:=G)) {d : ℕ} + (hw : Enlargement.gcost N w ≤ d) (hf : ∀ g, N.gcost g ≤ d → I.gkey g ∈ f g) : + (interpretation N C I).gkey w ∈ Enlargement.partialGroupKey N IdempotentNames.name f w := + Enlargement.partialGroupKey_full _ _ _ _ _ _ hw hf + +omit [Primcodable G] [Primcodable X] in + theorem partialPointKey_full (f : X → Part L) (x : Point (k:=k) (G:=G) (X:=X)) {d : ℕ} + (hx : Enlargement.xcost N x ≤ d) (hf : ∀ y, N.xcost y ≤ d → I.xkey y ∈ f y) : + (interpretation N C I).xkey x ∈ Enlargement.partialPointKey N IdempotentNames.name f x := + Enlargement.partialPointKey_full _ _ _ _ _ _ hx hf + +end SemanticEnlargement +end SimpleFInftyOvergroups.SemanticEncoding +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleOvergroups/SemanticProduct.lean b/lean/OAI/GroupTheory/SimpleOvergroups/SemanticProduct.lean new file mode 100644 index 0000000000000000000000000000000000000000..44174d1ef642bb8ec6a8c254a551f2e2067f2bb1 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleOvergroups/SemanticProduct.lean @@ -0,0 +1,102 @@ +import Mathlib +import OAI.GroupTheory.BooneHigman.MonoidAlgebras +import OAI.GroupTheory.SimpleOvergroups.ContractedNormalForms +import OAI.GroupTheory.SimpleOvergroups.FirstFamilies +import OAI.GroupTheory.SimpleOvergroups.VariableCode + +namespace OAI + + +namespace SimpleFInftyOvergroups.SemanticEncoding +noncomputable section +open scoped Classical +open FiniteAlgebraicEnvelopes Bootstrap +open ContextualEncoding +namespace SemanticProduct +variable {A K : Type*} [DecidableEq A] [MonoidWithZero K] + (P : NormalPresentation (FreeMonoid A) K) + +abbrev Mon := FiniteAlgebraicEnvelopes.ZeroProduct.Mon K PartialAffine.monoid + +def pairEval : FreeMonoid (ProductFamily.Letter A) →* K × PartialAffine.monoid where + toFun w := (P.q (FreeMonoid.ofList (Projection.left w.toList)),PartialAffine.wordValue (Projection.right w.toList)) + map_one' := by simp only [FreeMonoid.toList_one, Projection.left, List.filterMap_nil, + FreeMonoid.ofList_nil, map_one]; rfl + map_mul' u v := by + apply Prod.ext + · simp only [FreeMonoid.toList_mul,Projection.left_append,FreeMonoid.ofList_append,map_mul] + rfl + · apply Subtype.ext + simp [PartialAffine.wordValue,PartialAffine.value] + +def evaluation : FreeMonoid (ProductFamily.Letter A) →* Mon (K:=K) := + (FiniteAlgebraicEnvelopes.ZeroProduct.pair K PartialAffine.monoid).comp (pairEval P) + +omit [DecidableEq A] in + theorem pairEval_surjective : Function.Surjective (pairEval P) := by + rintro ⟨x,y⟩ + obtain ⟨u,rfl⟩ := P.surjective x + obtain ⟨v,rfl⟩ := PartialAffine.wordValue_surjective y + refine ⟨FreeMonoid.ofList (u.toList.map Sum.inl++v.map Sum.inr),?_⟩ + simp [pairEval,Projection.left,Projection.right,List.filterMap_map] + +omit [DecidableEq A] in + theorem evaluation_surjective : Function.Surjective (evaluation P) := + (FiniteAlgebraicEnvelopes.ZeroProduct.pair_surjective _ _).comp (pairEval_surjective P) + +def normal (w : List (ProductFamily.Letter A)) : List A := + (P.normal (FreeMonoid.ofList (Projection.left w))).toList + +def value (w : List (ProductFamily.Letter A)) : Option (ProductFamily.Key A) := + ProductFamily.combine P.omega.toList (normal P w,PartialAffine.testedClass (Projection.right w)) + +omit [DecidableEq A] in + theorem normal_eq_iff (u v : List (ProductFamily.Letter A)) : normal P u = normal P v ↔ + P.q (FreeMonoid.ofList (Projection.left u)) = P.q (FreeMonoid.ofList (Projection.left v)) := by + rw [P.complete] + exact FreeMonoid.toList.injective.eq_iff + +omit [DecidableEq A] in + theorem normal_eq_zero (w : List (ProductFamily.Letter A)) : normal P w = P.omega.toList ↔ + P.q (FreeMonoid.ofList (Projection.left w)) = 0 := by + change (P.normal (FreeMonoid.ofList (Projection.left w))).toList = P.omega.toList ↔ _ + rw [FreeMonoid.toList.injective.eq_iff,P.normal_eq_zero_iff] + + theorem value_eq_iff (u v : List (ProductFamily.Letter A)) : + value P u = value P v ↔ evaluation P (FreeMonoid.ofList u) = evaluation P (FreeMonoid.ofList v) := by + change value P u = value P v ↔ + FiniteAlgebraicEnvelopes.ZeroProduct.pair _ _ _ = FiniteAlgebraicEnvelopes.ZeroProduct.pair _ _ _ + rw [FiniteAlgebraicEnvelopes.ZeroProduct.pair_eq_iff] + change value P u = value P v ↔ + (P.q (FreeMonoid.ofList (Projection.left u)),PartialAffine.wordValue (Projection.right u)) = + (P.q (FreeMonoid.ofList (Projection.left v)),PartialAffine.wordValue (Projection.right v)) ∨ + P.q (FreeMonoid.ofList (Projection.left u)) = 0 ∧ P.q (FreeMonoid.ofList (Projection.left v)) = 0 + rw [Prod.ext_iff,←normal_eq_iff P,←normal_eq_zero P,←normal_eq_zero P] + have hp : PartialAffine.wordValue (Projection.right u) = PartialAffine.wordValue (Projection.right v) ↔ + PartialAffine.testedClass (Projection.right u) = PartialAffine.testedClass (Projection.right v) := by + rw [PartialAffine.testedClass_eq_iff] + exact Subtype.ext_iff + rw [hp] + by_cases hu : normal P u = P.omega.toList <;> + by_cases hv : normal P v = P.omega.toList <;> + simp [value,ProductFamily.combine,hu,hv] + aesop + + theorem value_eq_none (w : List (ProductFamily.Letter A)) : + value P w = none ↔ evaluation P (FreeMonoid.ofList w) = 0 := by + change value P w = none ↔ FiniteAlgebraicEnvelopes.ZeroProduct.pair _ _ _ = 0 + rw [FiniteAlgebraicEnvelopes.ZeroProduct.pair_eq_zero] + change value P w = none ↔ P.q (FreeMonoid.ofList (Projection.left w))=0 + rw [←normal_eq_zero P] + simp [value,ProductFamily.combine] + + theorem full (f : List A → Part (List A)) + (hf : ∀ w, (P.normal (FreeMonoid.ofList w)).toList ∈ f w) + (w : List (ProductFamily.Letter A)) : value P w ∈ ProductFamily.test P.omega.toList f w := + (Part.mem_map_iff _).mpr ⟨_,hf _,rfl⟩ + +end SemanticProduct +end +end SimpleFInftyOvergroups.SemanticEncoding + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleOvergroups/SemanticTests.lean b/lean/OAI/GroupTheory/SimpleOvergroups/SemanticTests.lean new file mode 100644 index 0000000000000000000000000000000000000000..e8753426747a1b717022bdc6568a948565d56673 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleOvergroups/SemanticTests.lean @@ -0,0 +1,90 @@ +import Mathlib +import OAI.GroupTheory.SimpleOvergroups.DoubleEffective +import OAI.GroupTheory.SimpleOvergroups.SemanticActionMonoid +import OAI.GroupTheory.SimpleOvergroups.SemanticActions +import OAI.GroupTheory.SimpleOvergroups.SemanticDouble + +namespace OAI + + +noncomputable section +open scoped Classical + +namespace SourceActionMonoid +variable {V Y : Type*} [Group V] [MulAction V Y] +instance monoidWithZero : MonoidWithZero (M V Y) where + __ := (inferInstance : Monoid (M V Y)) + zero := omega + zero_mul := omega_mul + mul_zero := mul_omega +end SourceActionMonoid + +namespace SimpleFInftyOvergroups.SemanticEncoding +open BoundedEncoding EffectiveNames NamedAction StageConstruction +namespace SemanticTests +local instance : Primcodable (ZMod 2) := FiniteAlgebraicEnvelopes.Effect.finitePrimcodable _ +local instance : Primcodable (ZMod 3) := FiniteAlgebraicEnvelopes.Effect.finitePrimcodable _ + +variable {A R : Type} [Primcodable A] [Ring R] [Algebra (ZMod 2) R] + (π : SemanticMatrix.Raw (ZMod 2) A →ₐ[ZMod 2] R) + (σ : R → SemanticMatrix.Raw (ZMod 2) A) (hσ : Function.Injective σ) + {m : ℕ} (C : WordCalculus (FreeMonoid A) m) + +abbrev N := MatrixWords.nameOperations (k:=ZMod 2) (n:=7) (MatrixWords.grade C) +abbrev baseC := SemanticMatrix.calculus σ hσ m +abbrev baseI := SemanticMatrix.interpretation π σ hσ (MatrixWords.grade C) m +abbrev doubledC := SemanticDouble.calculus (baseC σ hσ (m:=m)) +abbrev I := SemanticDouble.interpretation (N C) (baseC σ hσ (m:=m)) (baseI π σ hσ C) +abbrev N₂ := SemanticDouble.N₂ (N C) +abbrev Symbols := Letter (SemanticDouble.GroupName (G:=MatrixWords.Word (ZMod 2) A 7)) + (SemanticDouble.PointName (G:=MatrixWords.Word (ZMod 2) A 7) (X:=MatrixWords.Point (ZMod 2) A 7)) + +abbrev evaluation : FreeMonoid (Symbols (A:=A)) →* SourceActionMonoid.M + (SourceEnlargement.Double.W (Q R)) (SourceEnlargement.Double.Y (Q:=Q R) (X:=X R)) := + SemanticActionMonoid.wordMap (I π σ hσ C) + + theorem evaluation_surjective (hπ : Function.Surjective π) : + Function.Surjective (evaluation π σ hσ C) := + SemanticActionMonoid.wordMap_surjective (I π σ hσ C) + (SemanticDouble.groupValue_surjective (N C) (baseC σ hσ (m:=m)) (baseI π σ hσ C) + (SemanticMatrix.groupValue_surjective π hπ)) + (SemanticDouble.pointValue_surjective (N C) (baseC σ hσ (m:=m)) (baseI π σ hσ C) + (SemanticMatrix.groupValue_surjective π hπ) (SemanticMatrix.pointValue_surjective π hπ)) + + theorem full (hs : ∀ a, σ (π a) = C.collect (ZMod 2) a) + (f : List A → Part (List A)) + (hf : ∀ u, (C.normal (FreeMonoid.ofList u)).toList ∈ f u) + (w : List (Symbols (A:=A))) : + (N₂ C).totalTest (I π σ hσ C).gkey (I π σ hσ C).xkey w ∈ + EffectiveNames.Double.test (IdempotentNames.name (k:=ZMod 2)) + (IdempotentNames.name (k:=ZMod 3)) (MatrixWords.grade C) C.omega.toList f w := by + apply Operations.test_full _ _ _ _ _ (d:=(N₂ C).wordCost w) ?_ ?_ w le_rfl + · intro g hg + apply SemanticDouble.partialGroupKey_full (N C) (baseC σ hσ (m:=m)) (baseI π σ hσ C) _ g hg + intro v hv + exact SemanticMatrix.partialGroupKey_full π σ hσ C hs f v hv (fun u _ => hf u) + · intro x hx + apply SemanticDouble.partialPointKey_full (N C) (baseC σ hσ (m:=m)) (baseI π σ hσ C) _ x hx + intro y hy + exact SemanticMatrix.partialPointKey_full π σ hσ C hs f y hy (fun u _ => hf u) + + theorem keys_eq_iff (u v : List (Symbols (A:=A))) : + (N₂ C).totalTest (I π σ hσ C).gkey (I π σ hσ C).xkey u = + (N₂ C).totalTest (I π σ hσ C).gkey (I π σ hσ C).xkey v ↔ + evaluation π σ hσ C (FreeMonoid.ofList u) = evaluation π σ hσ C (FreeMonoid.ofList v) := + SemanticActionMonoid.totalTest_eq_iff (I π σ hσ C) + (SemanticDouble.groupKey_injective (baseC σ hσ (m:=m)) + (SemanticMatrix.groupKey_injective σ hσ)) + (SemanticDouble.pointKey_injective (baseC σ hσ (m:=m)) + (SemanticMatrix.pointKey_injective σ hσ)) u v + + theorem keys_eq_none (w : List (Symbols (A:=A))) : + (N₂ C).totalTest (I π σ hσ C).gkey (I π σ hσ C).xkey w = none ↔ + evaluation π σ hσ C (FreeMonoid.ofList w) = 0 := by + exact keys_eq_iff π σ hσ C w [.inr (.inr none)] + +end SemanticTests +end SimpleFInftyOvergroups.SemanticEncoding +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleOvergroups/SourceModel.lean b/lean/OAI/GroupTheory/SimpleOvergroups/SourceModel.lean new file mode 100644 index 0000000000000000000000000000000000000000..6ffacad66787c452e6544cdf9eb1911287f10b81 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleOvergroups/SourceModel.lean @@ -0,0 +1,267 @@ +import Mathlib +import OAI.GroupTheory.SimpleOvergroups.CodeEmbedding +import OAI.GroupTheory.SimpleOvergroups.CompilerSemantics +import OAI.GroupTheory.SimpleOvergroups.ContextualCompiler +import OAI.GroupTheory.SimpleOvergroups.SemanticProduct +import OAI.GroupTheory.SimpleOvergroups.SemanticTests + +namespace OAI + + +namespace SimpleFInftyOvergroups.SourceModel +noncomputable section +open scoped Classical FiniteAlgebraicEnvelopes.Compiler.HeadCodec +open FiniteAlgebraicEnvelopes Bootstrap Compiler Compiler.Simulator MachineRealization +open ContextualEncoding SemanticEncoding EffectiveNames + +abbrev family := ContextualEncoding.Source.family +abbrev Sigma := ContextualEncoding.Source.Sigma +abbrev P₂ := IdempotentNames.Index (ZMod 2) +abbrev P₃ := IdempotentNames.Index (ZMod 3) +abbrev Syntax := ContextualEncoding.Source.Syntax (Γ:=family.Γ) (Q:=family.Q) +local instance : Primcodable (ZMod 2) := Effect.finitePrimcodable _ +local instance : Primcodable (ZMod 3) := Effect.finitePrimcodable _ +local instance : DecidableRel ContextualEncoding.Source.rel := fun _ _ => inferInstanceAs (Decidable (_ < _)) +local instance : Std.Trichotomous ContextualEncoding.Source.rel := ⟨fun a b hab hba => by + apply Encodable.encode_injective + change ¬ Encodable.encode a < Encodable.encode b at hab + change ¬ Encodable.encode b < Encodable.encode a at hba + omega⟩ + +abbrev Symbols (k : ℕ) := ContextualEncoding.Source.Symbols (Γ:=family.Γ) (Q:=family.Q) (P₁:=P₂) (P₂:=P₃) k +abbrev Keys (k : ℕ) := ContextualEncoding.Source.Keys (Γ:=family.Γ) (Q:=family.Q) k +local instance (k : ℕ) (i : Fin 3) : Primcodable (Symbols k i) := + ContextualEncoding.Source.instPrimcodableSymbols i +local instance (k : ℕ) (i : Fin 3) : Primcodable (Keys k i) := + ContextualEncoding.Source.instPrimcodableKeys i +abbrev code (k : ℕ) := ContextualEncoding.Source.code (Γ:=family.Γ) (Q:=family.Q) (P₁:=P₂) (P₂:=P₃) (k:=k) +abbrev search (k : ℕ) := ContextualEncoding.Source.search (Γ:=family.Γ) (Q:=family.Q) (P₁:=P₂) (P₂:=P₃) (k:=k) +abbrev wf := ContextualEncoding.Source.wf_rel + +variable {G : Type} [Group G] {k : ℕ} (s : Fin k → G) +variable (h : ComputablePred (fun w => FiniteAlgebraicEnvelopes.evalWord s w = 1)) + +include h in +theorem bootstrap : ∃ index, + ContextualEncoding.Source.raw index = tableNormal + (ContextualEncoding.Source.tables s family.A family.M + (IdempotentNames.name (k:=ZMod 2)) (IdempotentNames.name (k:=ZMod 3)) index) ∧ + ∀ n, GoodTable (r:=ContextualEncoding.Source.rel) + (ContextualEncoding.Source.tables s family.A family.M + (IdempotentNames.name (k:=ZMod 2)) (IdempotentNames.name (k:=ZMod 3)) index) n ∧ + PartialBudget (ContextualEncoding.Source.raw index) n := + ContextualEncoding.Source.exists_total_fixed_point s family.A family.M + IdempotentNames.name IdempotentNames.name family.decode family.realizes + IdempotentNames.idempotent IdempotentNames.idempotent h + +def index : ℕ := (bootstrap s h).choose +abbrev tests := fun i => ContextualEncoding.Source.test s family.A family.M + (IdempotentNames.name (k:=ZMod 2)) (IdempotentNames.name (k:=ZMod 3)) i (index s h) +abbrev processor := ContextualEncoding.Source.tables s family.A family.M + (IdempotentNames.name (k:=ZMod 2)) (IdempotentNames.name (k:=ZMod 3)) (index s h) +abbrev value := fun i => Search.value (tests s h i) + +theorem index_fixed : ContextualEncoding.Source.raw (index s h) = tableNormal (processor s h) := + (bootstrap s h).choose_spec.1 + theorem index_good (n : ℕ) : GoodTable (r:=ContextualEncoding.Source.rel) (processor s h) n := + ((bootstrap s h).choose_spec.2 n).1 + theorem index_budget (n : ℕ) : PartialBudget (ContextualEncoding.Source.raw (index s h)) n := + ((bootstrap s h).choose_spec.2 n).2 + theorem table_eq {n : ℕ} {rs : List (List Sigma × List Sigma)} (hr : rs ∈ processor s h n) : + rs = Families.table (code k) (search k) wf (value s h) none n := + FamilyProgram.compute_eq (code k) (search k) none (tests s h) wf hr + theorem index_stable : ∀ j n, j ≤ n → ∀ rj ∈ processor s h j, ∀ rn ∈ processor s h n, + Selectors.BoundedEq rj rn j := by + intro j n hjn rj hrj rn hrn + exact FamilyProgram.stable (code k) (search k) none (tests s h) wf hjn hrj hrn + theorem tables_short (n : ℕ) (rs) (hr : rs ∈ processor s h n) : ∀ p ∈ rs, 1 < p.1.length := by + rw [table_eq s h hr] + exact fun _ hp => Families.table_short (code k) (search k) wf (value s h) none hp + theorem tables_absorb (n : ℕ) (rs) (hr : rs ∈ processor s h n) : Absorbs rs none := by + rw [table_eq s h hr] + exact Families.absorbs (code k) (search k) wf (value s h) none n + theorem certificate (n : ℕ) (i : Fin 3) : TestCertificate (code k i) (tests s h i) n := + ContextualEncoding.Source.certificate s family.A family.M + IdempotentNames.name IdempotentNames.name family.decode family.realizes + IdempotentNames.idempotent IdempotentNames.idempotent (index s h) n + (index_budget s h _) i + theorem tables_isolate (i : Fin 3) (n : ℕ) (rs) (hr : rs ∈ processor s h n) : + ∀ p ∈ rs, p ∈ CodeTable.table (code k i) (search k i) wf (value s h i) none n ∨ + ∃ a ∈ p.1, a ∉ (code k i).alphabet := by + rw [table_eq s h hr] + exact fun _ hp => Families.isolate (code k) (search k) wf (value s h) none i + (ThreeCodes.zero_avoids i _) (fun j hij => ThreeCodes.disjoint hij _ _) hp + theorem tables_static (i : Fin 3) (n : ℕ) (rs) (hr : rs ∈ processor s h n) : + ∀ p ∈ CodeTable.table (code k i) (search k i) wf (value s h i) none n, p ∈ rs := by + rw [table_eq s h hr] + exact fun _ hp => (Families.mem_table (code k) (search k) wf (value s h) none).mpr (.inr ⟨i,hp⟩) + +abbrev L := Quotient.Mon (processor s h) +instance lMonoidWithZero : MonoidWithZero (L s h) := + Quotient.monoidWithZero (processor s h) none (index_good s h 2).choose_spec.1 + (tables_absorb s h 2 _ (index_good s h 2).choose_spec.1) + theorem one_ne_zero_L : (1 : L s h) ≠ 0 := + Quotient.present_nil_ne_zero (processor s h) wf (index_good s h) (index_stable s h) none + (tables_short s h) +instance lNontrivial : Nontrivial (L s h) := nontrivial_of_ne _ _ (one_ne_zero_L s h) + + theorem normal_code (i : Fin 3) (w : List (Symbols k i)) : + Quotient.normal (processor s h) ((code k i).encode w) = + CodeTable.output (code k i) wf (value s h i) none w := + CodeQuotient.normal_encode (processor s h) wf (index_good s h) (index_stable s h) + (code k i) (search k i) wf (value s h i) none (tables_short s h) + (tables_isolate s h i) (tables_static s h i) + (fun n => (certificate s h n i).contextual) (fun n => (certificate s h n i).ideal) + (certificate s h 0 i).nonzero w + + theorem code_eq_iff (i : Fin 3) (u v : List (Symbols k i)) : + Quotient.present (processor s h) ((code k i).encode u) = + Quotient.present (processor s h) ((code k i).encode v) ↔ value s h i u = value s h i v := + CodeQuotient.present_encode_iff (processor s h) wf (index_good s h) (index_stable s h) + (code k i) (search k i) wf (value s h i) none (tables_short s h) + (tables_isolate s h i) (tables_static s h i) + (fun n => (certificate s h n i).contextual) (fun n => (certificate s h n i).ideal) + (certificate s h 0 i).nonzero (ThreeCodes.zero_avoids i _) u v + + theorem code_zero (i : Fin 3) (w : List (Symbols k i)) (hw : value s h i w = none) : + Quotient.present (processor s h) ((code k i).encode w) = (0 : L s h) := by + apply (Quotient.present_eq_iff (processor s h) wf (index_good s h) (index_stable s h) _ _).mpr + rw [normal_code s h i w,CodeTable.output,ite_eq_left hw] + obtain ⟨rs,hrs,_⟩ := index_good s h 1 + symm + exact Quotient.normal_eq_self (processor s h) wf (index_good s h) (index_stable s h) hrs + (Quotient.irreducible_of_short (fun p hp => tables_short s h 1 rs hrs p hp)) + +abbrev KAlphabet := ContextualEncoding.Source.terminalAlphabet family.A +abbrev KMachine := ContextualEncoding.Source.terminalMachine family.A family.M (index s h) +abbrev K := Word.Presentation KAlphabet (KMachine s h) +local instance : LinearOrder (Control.Sector Sigma (Bool × family.Γ) (ParameterMachine.State family.Q (index s h))) := + ParameterCode.finiteOrder (index s h) +instance kMonoidWithZero : MonoidWithZero (K s h) := Word.monoidWithZero KAlphabet (KMachine s h) +abbrev normalPresentation := CommonCompiler.normalPresentation family.A family.M (.inr ()) KAlphabet + (index s h) family.decode (f:=fun x => ContextualEncoding.Source.raw x.1 x.2) (index_budget s h) (family.realizes (index s h)) +abbrev calculus := CommonCompiler.calculus family.A family.M (.inr ()) KAlphabet + (index s h) family.decode (f:=fun x => ContextualEncoding.Source.raw x.1 x.2) (index_budget s h 0) (family.realizes (index s h)) +instance kNontrivial : Nontrivial (K s h) := + CommonCompiler.nontrivial family.A family.M (.inr ()) KAlphabet + (index s h) family.decode (f:=fun x => ContextualEncoding.Source.raw x.1 x.2) (index_budget s h) (family.realizes (index s h)) + +abbrev B := Contracted.Algebra (ZMod 2) (K s h) +abbrev Astar := Contracted.Algebra (ZMod 2) (L s h) +instance bRing : Ring (B s h) := inferInstance +instance bNontrivial : Nontrivial (B s h) := inferInstance +instance bAlgebra : Algebra (ZMod 2) (B s h) := inferInstance +instance aRing : Ring (Astar s h) := inferInstance +instance aNontrivial : Nontrivial (Astar s h) := inferInstance +instance aAlgebra : Algebra (ZMod 2) (Astar s h) := inferInstance + +def π : SemanticMatrix.Raw (ZMod 2) Syntax →ₐ[ZMod 2] B s h := + (normalPresentation s h).algebraMap (ZMod 2) +def σ : B s h → SemanticMatrix.Raw (ZMod 2) Syntax := + (normalPresentation s h).sectionMap (ZMod 2) + theorem σ_injective : Function.Injective (σ s h) := (normalPresentation s h).sectionMap_injective _ + theorem π_surjective : Function.Surjective (π s h) := (normalPresentation s h).algebraMap_surjective _ + theorem section_collect (a : SemanticMatrix.Raw (ZMod 2) Syntax) : + σ s h (π s h a) = (calculus s h).collect (ZMod 2) a := + (normalPresentation s h).section_algebraMap _ (calculus s h) rfl rfl a + theorem normal_full (w : List Syntax) : + ((normalPresentation s h).normal (FreeMonoid.ofList w)).toList ∈ + ContextualEncoding.Source.normal family.A family.M (index s h) w := + CommonCompiler.service_full family.A family.M (.inr ()) KAlphabet (index s h) family.decode + (f:=fun x => ContextualEncoding.Source.raw x.1 x.2) (index_budget s h (Word.grade w)) (family.realizes (index s h)) w le_rfl + + theorem value_eq_of_mem {i : Fin 3} {w : List (Symbols k i)} {q : Option (Keys k i)} + (hq : q ∈ tests s h i w) : value s h i w = q := + Part.mem_unique (Search.value_mem (Part.dom_iff_mem.mpr ⟨q,hq⟩)) hq + + theorem group_value (w : List (Symbols k 0)) : + value s h 0 w = some (WordProblem.testedClass s w) := + value_eq_of_mem s h (Part.mem_some _) + + theorem group_code_eq_iff (u v : List (Symbols k 0)) : + Quotient.present (processor s h) ((code k 0).encode u) = + Quotient.present (processor s h) ((code k 0).encode v) ↔ + FiniteAlgebraicEnvelopes.evalWord s u = FiniteAlgebraicEnvelopes.evalWord s v := by + rw [code_eq_iff s h,group_value,group_value,Option.some.injEq,WordProblem.testedClass_eq_iff] + + def codeG (hs : Subgroup.closure (Set.range s) = ⊤) : G →* L s h := + CodeQuotient.descendCode (code k 0) (Bootstrap.Source.groupEval s) + (Bootstrap.Source.groupEval_surjective s hs) (group_code_eq_iff s h) + theorem codeG_injective (hs : Subgroup.closure (Set.range s) = ⊤) : + Function.Injective (codeG s h hs) := + CodeQuotient.descendCode_injective (code k 0) (Bootstrap.Source.groupEval s) + (Bootstrap.Source.groupEval_surjective s hs) (group_code_eq_iff s h) + + abbrev ProdMon := SemanticProduct.Mon (K:=K s h) + abbrev productEval := SemanticProduct.evaluation (normalPresentation s h) + theorem product_value (w : List (Symbols k 1)) : + value s h 1 w = SemanticProduct.value (normalPresentation s h) w := + value_eq_of_mem s h (SemanticProduct.full (normalPresentation s h) + (ContextualEncoding.Source.normal family.A family.M (index s h)) (normal_full s h) w) + theorem product_code_eq_iff (u v : List (Symbols k 1)) : + Quotient.present (processor s h) ((code k 1).encode u) = + Quotient.present (processor s h) ((code k 1).encode v) ↔ + productEval s h (FreeMonoid.ofList u) = productEval s h (FreeMonoid.ofList v) := by + rw [code_eq_iff s h,product_value,product_value,SemanticProduct.value_eq_iff] + def codeProduct : ProdMon s h →* L s h := + CodeQuotient.descendCode (code k 1) (productEval s h) + (SemanticProduct.evaluation_surjective (normalPresentation s h)) (product_code_eq_iff s h) + theorem codeProduct_injective : Function.Injective (codeProduct s h) := + CodeQuotient.descendCode_injective (code k 1) (productEval s h) + (SemanticProduct.evaluation_surjective (normalPresentation s h)) (product_code_eq_iff s h) + theorem codeProduct_zero : codeProduct s h 0 = 0 := by + obtain ⟨w,hw⟩ := SemanticProduct.evaluation_surjective (normalPresentation s h) 0 + rw [←hw] + change codeProduct s h ((productEval s h) (FreeMonoid.ofList w.toList))=0 + rw [codeProduct,CodeQuotient.descendCode_apply] + apply code_zero + rw [product_value] + exact (SemanticProduct.value_eq_none (normalPresentation s h) w.toList).mpr hw + def codeProduct₀ : ProdMon s h →*₀ L s h := + { codeProduct s h with map_zero' := codeProduct_zero s h } + + abbrev Acting := SourceEnlargement.Double.W (StageConstruction.Q (B s h)) + abbrev Points := SourceEnlargement.Double.Y + (Q:=StageConstruction.Q (B s h)) (X:=StageConstruction.X (B s h)) + abbrev ActionMon := SourceActionMonoid.M (Acting s h) (Points s h) + def actionEval : FreeMonoid (Symbols k 2) →* ActionMon s h := + SemanticTests.evaluation (π s h) (σ s h) (σ_injective s h) (calculus s h) + theorem action_value (w : List (Symbols k 2)) : + value s h 2 w = (SemanticTests.N₂ (calculus s h)).totalTest + (SemanticTests.I (π s h) (σ s h) (σ_injective s h) (calculus s h)).gkey + (SemanticTests.I (π s h) (σ s h) (σ_injective s h) (calculus s h)).xkey w := + value_eq_of_mem s h (SemanticTests.full (π s h) (σ s h) (σ_injective s h) (calculus s h) + (section_collect s h) (ContextualEncoding.Source.normal family.A family.M (index s h)) + (normal_full s h) w) + theorem action_code_eq_iff (u v : List (Symbols k 2)) : + Quotient.present (processor s h) ((code k 2).encode u) = + Quotient.present (processor s h) ((code k 2).encode v) ↔ + actionEval s h (FreeMonoid.ofList u) = actionEval s h (FreeMonoid.ofList v) := by + apply (code_eq_iff s h 2 u v).trans + have hk := SemanticTests.keys_eq_iff (π s h) (σ s h) (σ_injective s h) (calculus s h) u v + exact ((congrArg₂ Eq (action_value s h u) (action_value s h v)).to_iff).trans hk + theorem actionEval_surjective : Function.Surjective (actionEval s h) := + SemanticTests.evaluation_surjective (π s h) (σ s h) (σ_injective s h) (calculus s h) + (π_surjective s h) + def codeAction : ActionMon s h →* L s h := + CodeQuotient.descendCode (code k 2) (actionEval s h) + (actionEval_surjective s h) (action_code_eq_iff s h) + theorem codeAction_injective : Function.Injective (codeAction s h) := + CodeQuotient.descendCode_injective (code k 2) (actionEval s h) + (actionEval_surjective s h) (action_code_eq_iff s h) + theorem codeAction_zero : codeAction s h 0 = 0 := by + have hw : actionEval s h (FreeMonoid.ofList [.inr (.inr none)])=0 := rfl + calc + codeAction s h 0 = codeAction s h (actionEval s h + (FreeMonoid.ofList [.inr (.inr none)])) := congrArg (codeAction s h) hw.symm + _ = Quotient.present (processor s h) ((code k 2).encode [.inr (.inr none)]) := + CodeQuotient.descendCode_apply (code k 2) (actionEval s h) + (actionEval_surjective s h) (action_code_eq_iff s h) _ + _ = 0 := code_zero s h 2 _ (by rw [action_value]; rfl) + def codeAction₀ : ActionMon s h →*₀ L s h := + { codeAction s h with map_zero' := codeAction_zero s h } + +end +end SimpleFInftyOvergroups.SourceModel + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleOvergroups/SourceProducer.lean b/lean/OAI/GroupTheory/SimpleOvergroups/SourceProducer.lean new file mode 100644 index 0000000000000000000000000000000000000000..c5a42ec6d8fd1b8edfee5971bea555187f36885c --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleOvergroups/SourceProducer.lean @@ -0,0 +1,81 @@ +import Mathlib +import OAI.GroupTheory.SimpleOvergroups.ActionCorner +import OAI.GroupTheory.SimpleOvergroups.RingModel +import OAI.GroupTheory.SimpleOvergroups.SourceRingReduction + +namespace OAI + + +noncomputable section +namespace SimpleFInftyOvergroups.SourceModel +open scoped Classical +open FiniteAlgebraicEnvelopes RingAssembly + +variable {G : Type} [Group G] {k : ℕ} (s : Fin k → G) +variable (h : ComputablePred (fun w => FiniteAlgebraicEnvelopes.evalWord s w = 1)) + +def actionCornerMap : ActionMon s h →*₀ (e_idempotent s h).Corner := + (cornerMap s h).toMonoidWithZeroHom.comp + ((monoidBasis₀ (k:=ZMod 2) (M:=L s h)).comp (codeAction₀ s h)) + +theorem actionCornerMap_injective : Function.Injective (actionCornerMap s h) := + (cornerMap_injective s h).comp + ((monoidBasis_injective (k:=ZMod 2) (M:=L s h)).comp (codeAction_injective s h)) + +def groupCornerMap (hs : Subgroup.closure (Set.range s)=⊤) : G →* (e_idempotent s h).Corner := + (cornerMap s h).toMonoidHom.comp ((ContractedPresentation.monoidBasis (ZMod 2)).comp (codeG s h hs)) + +theorem groupCornerMap_injective (hs : Subgroup.closure (Set.range s)=⊤) : + Function.Injective (groupCornerMap s h hs) := + (cornerMap_injective s h).comp + ((monoidBasis_injective (k:=ZMod 2) (M:=L s h)).comp (codeG_injective s h hs)) + +def data (hs : Subgroup.closure (Set.range s)=⊤) : SourceRingData G where + R := B s h + ringR := bRing s h + nontrivialR := bNontrivial s h + algebraR := bAlgebra s h + φ := φ s h + φ_injective := φ_injective s h + binary := binary s h + e := e s h + e_idempotent := e_idempotent s h + e_nonzero := e_nonzero s h + S y := actionCornerMap s h (SourceActionMonoid.prepend y) + T y := actionCornerMap s h (SourceActionMonoid.delete y) + TS y z := by + by_cases hyz : y=z + · simpa only [ite_eq_left hyz] using corner_TS (actionCornerMap s h) y z + · simpa only [ite_eq_right hyz] using corner_TS (actionCornerMap s h) y z + ρ := actionUnits (actionCornerMap s h) + ρ_injective := actionUnits_injective (actionCornerMap s h) (actionCornerMap_injective s h) + ρS := corner_ρS (actionCornerMap s h) + Tρ := corner_Tρ (actionCornerMap s h) + A := Generators s h + finiteA := inferInstance + π := presentationMap s h + π_surjective := presentationMap_surjective s h + rel := differences (Relations s h) + rel_finite := differences_finite _ (relations_finite s h) + ker_π := presentationMap_kernel s h + g := (groupCornerMap s h hs).toHomUnits + g_injective := fun _ _ hxy => groupCornerMap_injective s h hs (congrArg Units.val hxy) + +end SourceModel + +theorem sourceRingProducer : SourceRingProducerObligation := by + intro G _ hG + obtain ⟨k,s,hs,hw⟩ := hG + exact ⟨SourceModel.data s hw hs⟩ + +universe u + +theorem main (G : Type u) [Group G] [Group.FG G] (hG : HasDecidableWordProblem G) : + ∃ (H : Type u) (_ : Group H), Nontrivial H ∧ IsSimpleGroup H ∧ + HasTypeFInfty H ∧ ∃ f : G →* H, Function.Injective f := + main_of_sourceRingProducer sourceRingProducer G hG + +end SimpleFInftyOvergroups +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleOvergroups/SourceRingReduction.lean b/lean/OAI/GroupTheory/SimpleOvergroups/SourceRingReduction.lean new file mode 100644 index 0000000000000000000000000000000000000000..d52f2348fc8202a7f3947a97cd0dd33d503ec68e --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleOvergroups/SourceRingReduction.lean @@ -0,0 +1,88 @@ +import Mathlib +import OAI.GroupTheory.BooneHigman.AlgebraPresentations +import OAI.GroupTheory.FiniteType.CWWhitehead +import OAI.GroupTheory.FiniteType.StageConstruction +import OAI.GroupTheory.FiniteType.StageGeometry +import OAI.GroupTheory.FiniteType.StageGeometryProperties +import OAI.GroupTheory.FiniteType.Steinberg +import OAI.GroupTheory.SimpleOvergroups.TwoEnlargements + +namespace OAI + +noncomputable section +namespace SimpleFInftyOvergroups +open StageConstruction SourceEnlargement +open scoped Classical + +structure SourceRingData (G : Type) [Group G] where + R : Type + [ringR : Ring R] + [nontrivialR : Nontrivial R] + [algebraR : Algebra (ZMod 2) R] + φ : R →ₙ+* R + φ_injective : Function.Injective φ + binary : CompressedSplittings.BinaryData φ + e : R + e_idempotent : IsIdempotentElem e + e_nonzero : e ≠ 0 + S : Double.Y (Q := Q R) (X := X R) → e_idempotent.Corner + T : Double.Y (Q := Q R) (X := X R) → e_idempotent.Corner + TS : ∀ y z, T y * S z = if y = z then 1 else 0 + ρ : Double.W (Q R) →* e_idempotent.Cornerˣ + ρ_injective : Function.Injective ρ + ρS : ∀ w y, (ρ w).val * S y = S (w • y) + Tρ : ∀ w y, T y * (ρ w).val = T (w⁻¹ • y) + A : Type + [finiteA : Finite A] + π : FreeAlgebra (ZMod 2) A →ₐ[ZMod 2] R + π_surjective : Function.Surjective π + rel : Set (FreeAlgebra (ZMod 2) A) + rel_finite : rel.Finite + ker_π : TwoSidedIdeal.ker π.toRingHom = TwoSidedIdeal.span rel + g : G →* e_idempotent.Cornerˣ + g_injective : Function.Injective g + +namespace SourceRingData +variable {G : Type} [Group G] + +theorem realize (d : SourceRingData G) : + ∃ (H : Type) (_ : Group H), Nontrivial H ∧ IsSimpleGroup H ∧ + HasTypeFInfty H ∧ ∃ f : G →* H, Function.Injective f := by + let _ := d.ringR + let _ := d.nontrivialR + let _ := d.algebraR + let _ := d.finiteA + exact StageGeometry.simple_geometric_overgroup_of_corner_ring_data + d.φ d.binary d.e d.e_idempotent d.e_nonzero d.S d.T + (by + intro y z + by_cases h : y = z + · simpa only [ite_eq_left h] using d.TS y z + · simpa only [ite_eq_right h] using d.TS y z) d.ρ + (Double.iota (Q := Q d.R)) (Double.point (Q := Q d.R) (X := X d.R)) + d.ρS d.Tρ Double.iota_point d.φ_injective d.ρ_injective + Double.iota_injective Double.point_injective Double.diagrams₂ Double.diagrams₃ + d.A d.π.toRingHom d.π_surjective d.rel d.rel_finite d.ker_π d.g d.g_injective + +end SourceRingData + +def SourceRingProducerObligation : Prop := + ∀ (G : Type) [Group G], HasDecidableWordProblem G → Nonempty (SourceRingData G) + +universe u + +theorem main_of_sourceRingProducer (produce : SourceRingProducerObligation) + (G : Type u) [Group G] [Group.FG G] (hG : HasDecidableWordProblem G) : + ∃ (H : Type u) (_ : Group H), Nontrivial H ∧ IsSimpleGroup H ∧ + HasTypeFInfty H ∧ ∃ f : G →* H, Function.Injective f := by + obtain ⟨G₀, i₀, ⟨e⟩, h₀⟩ := small_model G hG + let _ := i₀ + obtain ⟨d⟩ := produce G₀ h₀ + obtain ⟨H, iH, hnt, hsi, hf, f, hinj⟩ := d.realize + let _ := iH + exact ⟨ULift.{u} H, inferInstance, lift_explicit_overgroup e f hinj hnt hsi hf⟩ + +end SimpleFInftyOvergroups +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleOvergroups/ThreeCodes.lean b/lean/OAI/GroupTheory/SimpleOvergroups/ThreeCodes.lean new file mode 100644 index 0000000000000000000000000000000000000000..276bb3eec24c644141521f0fcc248c9ed7a1e759 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleOvergroups/ThreeCodes.lean @@ -0,0 +1,96 @@ +import Mathlib +import OAI.GroupTheory.BooneHigman.Basic +import OAI.GroupTheory.SimpleOvergroups.FamilyTables + +namespace OAI + + +namespace SimpleFInftyOvergroups.ContextualEncoding +noncomputable section +open FiniteAlgebraicEnvelopes Bootstrap + +namespace DelimiterCode +variable {A S T : Type*} + +def map (C : DelimiterCode A S) (f : S → T) (hf : Function.Injective f) : DelimiterCode A T where + start := f C.start + stop := f C.stop + distinct := fun h => C.distinct (hf h) + body a := (C.body a).map f + start_avoids a := by + simpa only [List.mem_map, hf.eq_iff, exists_eq_right] using C.start_avoids a + stop_avoids a := by + simpa only [List.mem_map, hf.eq_iff, exists_eq_right] using C.stop_avoids a + injective := fun _ _ h => C.injective (List.map_injective_iff.mpr hf h) + +@[simp] theorem map_block (C : DelimiterCode A S) (f : S → T) (hf : Function.Injective f) (a : A) : + (C.map f hf).block a = (C.block a).map f := by simp [map,block] + +@[simp] theorem map_encode (C : DelimiterCode A S) (f : S → T) (hf : Function.Injective f) (w : List A) : + (C.map f hf).encode w = (C.encode w).map f := by + induction w with + | nil => rfl + | cons a w ih => simp only [encode_cons,map_block,ih,List.map_append] + +theorem map_alphabet (C : DelimiterCode A S) (f : S → T) (hf : Function.Injective f) : + (C.map f hf).alphabet ⊆ Set.range f := by + intro t ht + rcases ht with h | h | ⟨a,ha⟩ + · exact ⟨C.start,h.symm⟩ + · exact ⟨C.stop,h.symm⟩ + · obtain ⟨s,_,hs⟩ := List.mem_map.mp ha + exact ⟨s,hs⟩ + +def searchMap (C : DelimiterCode A S) (E : FiniteSearch C) + (f : S → T) (hf : Function.Injective f) : FiniteSearch (C.map f hf) where + words := E.words + mem_words := by intro n w; simpa only [map_encode,List.length_map] using E.mem_words n w + +end DelimiterCode + +namespace ThreeCodes +abbrev Alphabet := Option (Fin 3 × Fin 4) +def inclusion (i : Fin 3) (a : Fin 4) : Alphabet := some (i,a) +theorem inclusion_injective (i : Fin 3) : Function.Injective (inclusion i) := by + intro a b h + exact (Prod.mk.inj (Option.some.inj h)).2 + +def code {A : Type*} [Encodable A] (i : Fin 3) (cost : A → ℕ) : DelimiterCode A Alphabet := + (PaddedCode.code cost).map (inclusion i) (inclusion_injective i) + +def search {A : Type*} [Encodable A] (i : Fin 3) (cost : A → ℕ) : FiniteSearch (code i cost) where + words := PaddedCode.words cost + mem_words n w := by simpa only [code,DelimiterCode.map_encode,List.length_map] using PaddedCode.mem_words cost n w + +theorem cost_padding {A : Type*} [Encodable A] (i : Fin 3) (cost : A → ℕ) (a : A) : + 10 * cost a + 2 ≤ ((code i cost).block a).length := by + simpa only [code,DelimiterCode.map_block,List.length_map] using PaddedCode.cost_padding cost a + +theorem zero_avoids {A : Type*} [Encodable A] (i : Fin 3) (cost : A → ℕ) : + none ∉ (code i cost).alphabet := by + intro h + obtain ⟨a,ha⟩ := (PaddedCode.code cost).map_alphabet (inclusion i) (inclusion_injective i) h + cases ha + +theorem disjoint {A B : Type*} [Encodable A] [Encodable B] {i j : Fin 3} + (hi : i ≠ j) (c : A → ℕ) (d : B → ℕ) : + Disjoint (code i c).alphabet (code j d).alphabet := by + apply Set.disjoint_left.mpr + intro t ht hu + obtain ⟨a,ha⟩ := (PaddedCode.code c).map_alphabet (inclusion i) (inclusion_injective i) ht + obtain ⟨b,hb⟩ := (PaddedCode.code d).map_alphabet (inclusion j) (inclusion_injective j) hu + exact hi (Prod.mk.inj (Option.some.inj (ha.trans hb.symm))).1 + +theorem primrec_encode {A : Type*} [Primcodable A] (i : Fin 3) (cost : A → ℕ) (hc : Primrec cost) : + Primrec (code i cost).encode := by + exact (Primrec.list_map (PaddedCode.primrec_encode cost hc) + ((Primrec.dom_finite (inclusion i)).comp Primrec.snd).to₂).of_eq (fun w => (DelimiterCode.map_encode ..).symm) + +theorem primrec_words {A : Type*} [Primcodable A] (i : Fin 3) (cost : A → ℕ) (hc : Primrec cost) : + Primrec (search i cost).words := PaddedCode.primrec_words cost hc + +end ThreeCodes +end +end SimpleFInftyOvergroups.ContextualEncoding + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleOvergroups/TruncatedAction.lean b/lean/OAI/GroupTheory/SimpleOvergroups/TruncatedAction.lean new file mode 100644 index 0000000000000000000000000000000000000000..d62e7b05877c44ad262f80c2f937f689b849a3cd --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleOvergroups/TruncatedAction.lean @@ -0,0 +1,187 @@ +import Mathlib +import OAI.GroupTheory.SimpleOvergroups.TruncatedMatrix + +namespace OAI + + +namespace SimpleFInftyOvergroups.BoundedEncoding +noncomputable section +open scoped Classical + +structure KeyBall (X K : Type*) where + ball : ℕ → Set X + mono : Monotone ball + key : X → K + +namespace KeyBall +variable {X K : Type*} (C : KeyBall X K) (m : ℕ) + +def Represented (k : K) : Prop := ∃ b, b ≤ m ∧ ∃ x ∈ C.ball b, C.key x = k + +def leastCost (k : K) : ℕ := + if h : C.Represented m k then Nat.find h else 0 + +theorem leastCost_spec {k : K} (h : C.Represented m k) : + C.leastCost m k ≤ m ∧ ∃ x ∈ C.ball (C.leastCost m k), C.key x = k := by + rw [leastCost, dite_eq_left h] + exact Nat.find_spec h + +theorem represented_key {x : X} {b : ℕ} (hx : x ∈ C.ball b) (hb : b ≤ m) : + C.Represented m (C.key x) := ⟨b, hb, x, hx, rfl⟩ + +theorem leastCost_le {x : X} {b : ℕ} (hx : x ∈ C.ball b) (hb : b ≤ m) : + C.leastCost m (C.key x) ≤ b := by + rw [leastCost, dite_eq_left (C.represented_key m hx hb)] + exact Nat.find_min' _ ⟨hb, x, hx, rfl⟩ + +variable [Nonempty X] + +def representative (k : K) : X := + if h : ∃ x ∈ C.ball (C.leastCost m k), C.key x = k then Classical.choose h + else Classical.choice ‹Nonempty X› + +theorem representative_spec {k : K} (h : C.Represented m k) : + C.representative m k ∈ C.ball (C.leastCost m k) ∧ + C.key (C.representative m k) = k := by + have he := (C.leastCost_spec m h).2 + rw [representative, dite_eq_left he] + exact Classical.choose_spec he + +def canonical (x : X) : X := C.representative m (C.key x) + +theorem canonical_congr {x y : X} (h : C.key x = C.key y) : + C.canonical m x = C.canonical m y := congrArg (C.representative m) h + +theorem canonical_mem {x : X} {b : ℕ} (hx : x ∈ C.ball b) (hb : b ≤ m) : + C.canonical m x ∈ C.ball b := + C.mono (C.leastCost_le m hx hb) + (C.representative_spec m (C.represented_key m hx hb)).1 + +theorem key_canonical {x : X} {b : ℕ} (hx : x ∈ C.ball b) (hb : b ≤ m) : + C.key (C.canonical m x) = C.key x := + (C.representative_spec m (C.represented_key m hx hb)).2 + +end KeyBall + +structure ActionCalculus (V X K L : Type*) [Group V] [MulAction V X] (m : ℕ) where + group : KeyBall V K + point : KeyBall X L + one_mem : ∀ b, (1 : V) ∈ group.ball b + inv_mem : ∀ {b v}, v ∈ group.ball b → v⁻¹ ∈ group.ball b + mul_mem : ∀ {b c u v}, u ∈ group.ball b → v ∈ group.ball c → u*v ∈ group.ball (b+c) + smul_mem : ∀ {b c v x}, v ∈ group.ball b → x ∈ point.ball c → v • x ∈ point.ball (b+c) + inv_congr : ∀ {u v}, group.key u = group.key v → group.key u⁻¹ = group.key v⁻¹ + mul_congr : ∀ {b c b' c' u v u' v'}, + u ∈ group.ball b → v ∈ group.ball c → + u' ∈ group.ball b' → v' ∈ group.ball c' → + b+c ≤ m → b'+c' ≤ m → group.key u = group.key u' → group.key v = group.key v' → + group.key (u*v) = group.key (u'*v') + smul_congr : ∀ {b c b' c' v x v' x'}, + v ∈ group.ball b → x ∈ point.ball c → + v' ∈ group.ball b' → x' ∈ point.ball c' → + b+c ≤ m → b'+c' ≤ m → group.key v = group.key v' → point.key x = point.key x' → + point.key (v • x) = point.key (v' • x') + +namespace ActionCalculus +variable {V X K L : Type*} [Group V] [MulAction V X] {m : ℕ} + (C : ActionCalculus V X K L m) + +theorem inverse_action_iff {v : V} {y z : X} {b c e : ℕ} + (hv : v ∈ C.group.ball b) (hy : y ∈ C.point.ball c) (hz : z ∈ C.point.ball e) + (hyb : b+c ≤ m) (hzb : b+e ≤ m) (hybb : 2*b+c ≤ m) (hzbb : 2*b+e ≤ m) : + C.point.key y = C.point.key (v • z) ↔ C.point.key (v⁻¹ • y) = C.point.key z := by + constructor + · intro he + simpa only [inv_smul_smul] using C.smul_congr (C.inv_mem hv) hy + (C.inv_mem hv) (C.smul_mem hv hz) hyb (by omega) rfl he + · intro he + simpa only [smul_inv_smul] using C.smul_congr hv + (C.smul_mem (C.inv_mem hv) hy) hv hz (by omega) hzb rfl he + +theorem inverse_action_iff_of_total {v : V} {y z : X} {b c e d : ℕ} + (hv : v ∈ C.group.ball b) (hy : y ∈ C.point.ball c) (hz : z ∈ C.point.ball e) + (h : b+c+e ≤ d) (hm : 3*d ≤ m) : + C.point.key y = C.point.key (v • z) ↔ C.point.key (v⁻¹ • y) = C.point.key z := + C.inverse_action_iff hv hy hz (by omega) (by omega) (by omega) (by omega) + +theorem group_context {u v a z : V} {b c e f : ℕ} + (hu : u ∈ C.group.ball b) (hv : v ∈ C.group.ball c) + (ha : a ∈ C.group.ball e) (hz : z ∈ C.group.ball f) + (hb : e+b+f ≤ m) (hc : e+c+f ≤ m) (he : C.group.key u = C.group.key v) : + C.group.key (a*u*z) = C.group.key (a*v*z) := + C.mul_congr (C.mul_mem ha hu) hz (C.mul_mem ha hv) hz hb hc + (C.mul_congr ha hu ha hv (by omega) (by omega) rfl he) rfl + +end ActionCalculus + +namespace WordCalculus +variable {M : Type*} [Monoid M] {m : ℕ} (C : WordCalculus M m) +variable (k : Type*) [CommRing k] {ι : Type*} [Fintype ι] [DecidableEq ι] + +@[instance_reducible] def rawMatrixAction : MulAction (Matrix ι ι (MonoidAlgebra k M))ˣ (ι → MonoidAlgebra k M) where + smul u x := u.val.mulVec x + one_smul x := Matrix.one_mulVec x + mul_smul u v x := (Matrix.mulVec_mulVec x u.val v.val).symm + +attribute [local instance] rawMatrixAction + +theorem matrixCollect_product {A B : Matrix ι ι (MonoidAlgebra k M)} {b c : ℕ} + (hA : C.MatrixBall k b A) (hB : C.MatrixBall k c B) (hbc : b+c ≤ m) : + C.matrixCollect k (C.matrixCollect k A * C.matrixCollect k B) = C.matrixCollect k (A*B) := by + rw [C.matrixCollect_mul_left k hA (C.matrixCollect_mem k hB (by omega)) hbc, + C.matrixCollect_mul_right k hA hB hbc] + +theorem columnCollect_product {A : Matrix ι ι (MonoidAlgebra k M)} {x : ι → MonoidAlgebra k M} + {b c : ℕ} (hA : C.MatrixBall k b A) (hx : C.ColumnBall k c x) (hbc : b+c ≤ m) : + C.columnCollect k ((C.matrixCollect k A).mulVec (C.columnCollect k x)) = + C.columnCollect k (A.mulVec x) := by + rw [C.columnCollect_mulVec_left k hA (C.columnCollect_mem k hx (by omega)) hbc, + C.columnCollect_mulVec_right k hA hx hbc] + +def matrixActionCalculus (ι : Type*) [Fintype ι] [DecidableEq ι] : + ActionCalculus (Matrix ι ι (MonoidAlgebra k M))ˣ (ι → MonoidAlgebra k M) + (Matrix ι ι (MonoidAlgebra k M) × Matrix ι ι (MonoidAlgebra k M)) + (ι → MonoidAlgebra k M) m where + group := + { ball := C.UnitBall k + mono := by + intro b c hbc u hu + exact ⟨fun i j => C.ball_mono k hbc (hu.1 i j), + fun i j => C.ball_mono k hbc (hu.2 i j)⟩ + key := C.matrixPair k } + point := + { ball := C.ColumnBall k + mono := by + intro b c hbc x hx i + exact C.ball_mono k hbc (hx i) + key := C.columnCollect k } + one_mem := C.unitBall_one k + inv_mem := C.unitBall_inv k + mul_mem := C.unitBall_mul k + smul_mem := fun hu hx => C.columnBall_mulVec k hu.1 hx + inv_congr := C.matrixPair_inv k + mul_congr := by + intro b c b' c' u v u' v' hu hv hu' hv' hb hb' heu hev + apply Prod.ext + · change C.matrixCollect k (u.val*v.val) = C.matrixCollect k (u'.val*v'.val) + rw [← C.matrixCollect_product k hu.1 hv.1 hb, + ← C.matrixCollect_product k hu'.1 hv'.1 hb'] + rw [show C.matrixCollect k u.val = C.matrixCollect k u'.val from congrArg Prod.fst heu, + show C.matrixCollect k v.val = C.matrixCollect k v'.val from congrArg Prod.fst hev] + · change C.matrixCollect k (v.inv*u.inv) = C.matrixCollect k (v'.inv*u'.inv) + rw [← C.matrixCollect_product k hv.2 hu.2 (by omega), + ← C.matrixCollect_product k hv'.2 hu'.2 (by omega)] + rw [show C.matrixCollect k u.inv = C.matrixCollect k u'.inv from congrArg Prod.snd heu, + show C.matrixCollect k v.inv = C.matrixCollect k v'.inv from congrArg Prod.snd hev] + smul_congr := by + intro b c b' c' u x u' x' hu hx hu' hx' hb hb' heu hex + change C.columnCollect k (u.val.mulVec x) = C.columnCollect k (u'.val.mulVec x') + rw [← C.columnCollect_product k hu.1 hx hb, ← C.columnCollect_product k hu'.1 hx' hb'] + rw [show C.matrixCollect k u.val = C.matrixCollect k u'.val from congrArg Prod.fst heu, + show C.columnCollect k x = C.columnCollect k x' from hex] + +end WordCalculus +end +end SimpleFInftyOvergroups.BoundedEncoding + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleOvergroups/TruncatedAlgebra.lean b/lean/OAI/GroupTheory/SimpleOvergroups/TruncatedAlgebra.lean new file mode 100644 index 0000000000000000000000000000000000000000..257d3dc978a15ff1f082f5cf853d9fa7de999df9 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleOvergroups/TruncatedAlgebra.lean @@ -0,0 +1,285 @@ +import Mathlib +import OAI.Computability.FiniteCompiler.Control +import OAI.Computability.FiniteCompiler.Normalization +import OAI.Computability.FiniteCompiler.Simulator +import OAI.Computability.FiniteCompiler.Transition +import OAI.GroupTheory.FiniteType.TwistedBrin + +namespace OAI + + +namespace SimpleFInftyOvergroups.BoundedEncoding +noncomputable section +open scoped Classical + +structure WordCalculus (M : Type*) [Monoid M] (m : ℕ) where + grade : M → ℕ + grade_one : grade 1 = 0 + grade_mul : ∀ a b, grade (a * b) = grade a + grade b + omega : M + grade_omega : grade omega = 0 + omega_ne_one : omega ≠ 1 + normal : M → M + normal_one : normal 1 = 1 + normal_omega : normal omega = omega + nonincreasing : ∀ w, grade w ≤ m → grade (normal w) ≤ grade w + idempotent : ∀ w, grade w ≤ m → normal (normal w) = normal w + context : ∀ {u v}, normal u = normal v → ∀ a b, + grade (a * u * b) ≤ m → grade (a * v * b) ≤ m → + normal (a * u * b) = normal (a * v * b) + absorbs : ∀ a b, normal (a * omega * b) = omega + +namespace WordCalculus +variable {M : Type*} [Monoid M] {m : ℕ} (C : WordCalculus M m) +variable (k : Type*) [CommSemiring k] + +def ball (b : ℕ) : Submodule k (MonoidAlgebra k M) := + MonoidAlgebra.supported k k {w | C.grade w ≤ b} + +theorem mem_ball_iff {b : ℕ} {p : MonoidAlgebra k M} : + p ∈ C.ball k b ↔ ∀ w ∈ p.coeff.support, C.grade w ≤ b := Iff.rfl + +theorem ball_mono {b c : ℕ} (hbc : b ≤ c) : C.ball k b ≤ C.ball k c := by + intro p hp w hw + exact (hp hw).trans hbc + +theorem single_mem_ball {w : M} {b : ℕ} (hw : C.grade w ≤ b) (a : k) : + MonoidAlgebra.single w a ∈ C.ball k b := by + change ∀ ⦃v⦄, v ∈ (MonoidAlgebra.single w a).coeff.support → C.grade v ≤ b + intro v hv + have hvw : v = w := ((Finsupp.mem_support_single v w a).mp hv).1 + simpa only [hvw] using hw + +theorem ball_induction {b : ℕ} {P : MonoidAlgebra k M → Prop} + (hp : ∀ w, C.grade w ≤ b → P (MonoidAlgebra.single w 1)) + (hz : P 0) (ha : ∀ p q, P p → P q → P (p+q)) + (hs : ∀ (a : k) p, P p → P (a • p)) {p : MonoidAlgebra k M} + (h : p ∈ C.ball k b) : P p := by + rw [ball, MonoidAlgebra.supported_eq_span_single] at h + induction h using Submodule.span_induction with + | mem p h => obtain ⟨w, hw, rfl⟩ := h; exact hp w hw + | zero => exact hz + | add p q _ _ hp hq => exact ha p q hp hq + | smul a p _ hp => exact hs a p hp + +@[simp] theorem one_mem_ball (b : ℕ) : (1 : MonoidAlgebra k M) ∈ C.ball k b := by + rw [MonoidAlgebra.one_def] + exact C.single_mem_ball k (by rw [C.grade_one]; exact Nat.zero_le _) 1 + +theorem mul_mem_ball {p q : MonoidAlgebra k M} {b c : ℕ} + (hp : p ∈ C.ball k b) (hq : q ∈ C.ball k c) : p*q ∈ C.ball k (b+c) := by + apply C.ball_induction k (P := fun p => p*q ∈ C.ball k (b+c)) ?_ ?_ ?_ ?_ hp + · intro u hu + apply C.ball_induction k (P := fun q => MonoidAlgebra.single u 1*q ∈ C.ball k (b+c)) + ?_ ?_ ?_ ?_ hq + · intro v hv + rw [MonoidAlgebra.single_mul_single] + exact C.single_mem_ball k (by rw [C.grade_mul]; omega) _ + · simp + · intro x y hx hy + rw [mul_add] + exact (C.ball k (b+c)).add_mem hx hy + · intro a x hx + rw [mul_smul_comm] + exact (C.ball k (b+c)).smul_mem a hx + · simp + · intro x y hx hy + rw [add_mul] + exact (C.ball k (b+c)).add_mem hx hy + · intro a x hx + rw [smul_mul_assoc] + exact (C.ball k (b+c)).smul_mem a hx + +def collect : MonoidAlgebra k M →ₗ[k] MonoidAlgebra k M := + (Finsupp.linearCombination k (fun w => + if C.normal w = C.omega then 0 else MonoidAlgebra.single (C.normal w) (1 : k))).comp + (MonoidAlgebra.coeffLinearEquiv k).toLinearMap + +@[simp] theorem collect_single (w : M) (a : k) : + C.collect k (MonoidAlgebra.single w a) = + if C.normal w = C.omega then 0 else MonoidAlgebra.single (C.normal w) a := by + classical + simp only [collect, LinearMap.comp_apply] + split <;> rename_i h <;> simp [h, MonoidAlgebra.smul_single] + +@[simp] theorem collect_one : C.collect k 1 = 1 := by + rw [MonoidAlgebra.one_def, C.collect_single, C.normal_one, + ite_eq_right (Ne.symm C.omega_ne_one)] + +@[simp] theorem collect_omega (a : k) : + C.collect k (MonoidAlgebra.single C.omega a) = 0 := by + simp [C.normal_omega] + +theorem collect_mem_ball {p : MonoidAlgebra k M} {b : ℕ} + (hp : p ∈ C.ball k b) (hb : b ≤ m) : C.collect k p ∈ C.ball k b := by + classical + apply C.ball_induction k (P := fun p => C.collect k p ∈ C.ball k b) ?_ ?_ ?_ ?_ hp + · intro w hw + rw [C.collect_single] + split + · exact (C.ball k b).zero_mem + · exact C.single_mem_ball k ((C.nonincreasing w (hw.trans hb)).trans hw) 1 + · simp + · intro x y hx hy + rw [map_add] + exact (C.ball k b).add_mem hx hy + · intro a x hx + rw [map_smul] + exact (C.ball k b).smul_mem a hx + +theorem collect_idempotent {p : MonoidAlgebra k M} {b : ℕ} + (hp : p ∈ C.ball k b) (hb : b ≤ m) : C.collect k (C.collect k p) = C.collect k p := by + classical + apply C.ball_induction k (P := fun p => C.collect k (C.collect k p) = C.collect k p) + ?_ ?_ ?_ ?_ hp + · intro w hw + rw [C.collect_single] + split + · exact map_zero _ + next h => simp [C.idempotent w (hw.trans hb), h] + · simp + · intro x y hx hy + simp only [map_add, hx, hy] + · intro a x hx + simp only [map_smul, hx] + +theorem collect_mul_right {p q : MonoidAlgebra k M} {b c : ℕ} + (hp : p ∈ C.ball k b) (hq : q ∈ C.ball k c) (hbc : b+c ≤ m) : + C.collect k (p * C.collect k q) = C.collect k (p*q) := by + classical + apply C.ball_induction k + (P := fun p => C.collect k (p*C.collect k q) = C.collect k (p*q)) ?_ ?_ ?_ ?_ hp + · intro u hu + apply C.ball_induction k + (P := fun q => C.collect k (MonoidAlgebra.single u 1*C.collect k q) = + C.collect k (MonoidAlgebra.single u 1*q)) ?_ ?_ ?_ ?_ hq + · intro v hv + have hvn := C.nonincreasing v (by omega) + have he := C.context (C.idempotent v (by omega)) u 1 + (by simp only [mul_one, C.grade_mul]; omega) + (by simp only [mul_one, C.grade_mul]; omega) + simp only [mul_one] at he + rw [C.collect_single] + by_cases hz : C.normal v = C.omega + · rw [ite_eq_left hz, mul_zero, map_zero, MonoidAlgebra.single_mul_single, C.collect_single] + have ha : C.normal (u*v) = C.omega := by + rw [hz] at he + exact he.symm.trans (by simpa using C.absorbs u 1) + simp [ha] + · rw [ite_eq_right hz, MonoidAlgebra.single_mul_single, + MonoidAlgebra.single_mul_single, C.collect_single, C.collect_single, he] + · simp + · intro x y hx hy + simp only [map_add, mul_add, hx, hy] + · intro a x hx + simp only [map_smul, mul_smul_comm, hx] + · simp + · intro x y hx hy + simp only [add_mul, map_add, hx, hy] + · intro a x hx + simp only [smul_mul_assoc, map_smul, hx] + +theorem collect_mul_left {p q : MonoidAlgebra k M} {b c : ℕ} + (hp : p ∈ C.ball k b) (hq : q ∈ C.ball k c) (hbc : b+c ≤ m) : + C.collect k (C.collect k p * q) = C.collect k (p*q) := by + classical + apply C.ball_induction k + (P := fun p => C.collect k (C.collect k p*q) = C.collect k (p*q)) ?_ ?_ ?_ ?_ hp + · intro u hu + apply C.ball_induction k + (P := fun q => C.collect k (C.collect k (MonoidAlgebra.single u 1)*q) = + C.collect k (MonoidAlgebra.single u 1*q)) ?_ ?_ ?_ ?_ hq + · intro v hv + have hun := C.nonincreasing u (by omega) + have he := C.context (C.idempotent u (by omega)) 1 v + (by simp only [one_mul, C.grade_mul]; omega) + (by simp only [one_mul, C.grade_mul]; omega) + simp only [one_mul] at he + rw [C.collect_single] + by_cases hz : C.normal u = C.omega + · rw [ite_eq_left hz, zero_mul, map_zero, MonoidAlgebra.single_mul_single, C.collect_single] + have ha : C.normal (u*v) = C.omega := by + rw [hz] at he + exact he.symm.trans (by simpa using C.absorbs 1 v) + simp [ha] + · rw [ite_eq_right hz, MonoidAlgebra.single_mul_single, + MonoidAlgebra.single_mul_single, C.collect_single, C.collect_single, he] + · simp + · intro x y hx hy + simp only [mul_add, map_add, hx, hy] + · intro a x hx + simp only [mul_smul_comm, map_smul, hx] + · simp + · intro x y hx hy + simp only [map_add, add_mul, hx, hy] + · intro a x hx + simp only [map_smul, smul_mul_assoc, hx] + +theorem collect_context {p q x y : MonoidAlgebra k M} {a b c d : ℕ} + (hp : p ∈ C.ball k b) (hq : q ∈ C.ball k c) + (hx : x ∈ C.ball k a) (hy : y ∈ C.ball k d) + (hpb : a+b+d ≤ m) (hqb : a+c+d ≤ m) + (he : C.collect k p = C.collect k q) : + C.collect k (x*p*y) = C.collect k (x*q*y) := by + have hxp : C.collect k (x*p) = C.collect k (x*q) := by + rw [← C.collect_mul_right k hx hp (by omega), + ← C.collect_mul_right k hx hq (by omega), he] + rw [← C.collect_mul_left k (C.mul_mem_ball k hx hp) hy hpb, + ← C.collect_mul_left k (C.mul_mem_ball k hx hq) hy hqb, hxp] + +theorem collect_context_zero {p x y : MonoidAlgebra k M} {a b d : ℕ} + (hp : p ∈ C.ball k b) (hx : x ∈ C.ball k a) (hy : y ∈ C.ball k d) + (hbd : a+b+d ≤ m) (he : C.collect k p = 0) : C.collect k (x*p*y) = 0 := by + have hh := C.collect_context k hp (C.ball k 0).zero_mem hx hy hbd (by omega) + (he.trans (map_zero _).symm) + simpa using hh + +end WordCalculus + +namespace CompilerCalculus +open FiniteAlgebraicEnvelopes.Compiler +variable {S Γ Q : Type*} +variable (A : Simulator.Alphabet S Γ) (M : Simulator.Machine Q Γ) + [DecidableEq S] [DecidableEq Γ] [DecidableEq Q] + [Fintype S] [Fintype Γ] [Fintype Q] [LinearOrder (Control.Sector S Γ Q)] + +def calculus + (decode : ∀ g a, A.output g = some a → g = A.input a) + {f : List S → Part (List S)} {m : ℕ} (budget : PartialBudget f m) + (realizes : Word.Realizes A M f) : + WordCalculus (FreeMonoid (Word.Letter S Γ Q)) m where + grade w := Word.grade w.toList + grade_one := rfl + grade_mul a b := Word.grade_append a.toList b.toList + omega := FreeMonoid.ofList [.zero] + grade_omega := rfl + omega_ne_one := by simp + normal w := FreeMonoid.ofList (Word.normal A M (fun w => partValue (f w)) w.toList) + normal_one := by simp + normal_omega := by simp + nonincreasing w hw := Word.normal_grade A M budget.totalize _ hw + idempotent w hw := congrArg FreeMonoid.ofList + (Word.normal_idempotent A M decode budget.totalize (realizes.computesAt A M budget) _ hw) + context h a b hu hv := congrArg FreeMonoid.ofList + (Word.normal_context A M decode budget.totalize (realizes.computesAt A M budget) + (congrArg FreeMonoid.toList h) a.toList b.toList hu hv) + absorbs a b := by + apply congrArg FreeMonoid.ofList + simpa using Word.normal_contains_omega A M (fun w => partValue (f w)) a.toList b.toList + +theorem support_calls_terminate + (decode : ∀ g a, A.output g = some a → g = A.input a) + {f : List S → Part (List S)} {m b : ℕ} (budget : PartialBudget f m) + (realizes : Word.Realizes A M f) + {p : MonoidAlgebra (ZMod 2) (FreeMonoid (Word.Letter S Γ Q))} + (hp : p ∈ (calculus A M decode budget realizes).ball (ZMod 2) b) (hb : b ≤ m) : + ∀ w ∈ p.coeff.support, (Word.partialNormal A M f w.toList).Dom := by + intro w hw + have hwb : Word.grade w.toList ≤ b := hp hw + exact Word.partialNormal_terminates A M budget _ (hwb.trans hb) + +end CompilerCalculus +end +end SimpleFInftyOvergroups.BoundedEncoding + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleOvergroups/TruncatedArrays.lean b/lean/OAI/GroupTheory/SimpleOvergroups/TruncatedArrays.lean new file mode 100644 index 0000000000000000000000000000000000000000..88217a890392f3f7fade3d116c1c72f85a3d46f3 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleOvergroups/TruncatedArrays.lean @@ -0,0 +1,325 @@ +import Mathlib +import OAI.GroupTheory.FiniteType.SequentialLimit +import OAI.GroupTheory.SimpleOvergroups.EnlargementCore +import OAI.GroupTheory.SimpleOvergroups.TruncatedAction + +namespace OAI + + +namespace SimpleFInftyOvergroups.BoundedEncoding +noncomputable section +open scoped Classical + +namespace KeyBall +variable {X K : Type*} (C : KeyBall X K) (D : Type*) [AddCommMonoid D] + +def arrayBall (b : ℕ) (p : X →₀ D) : Prop := ∀ x ∈ p.support, x ∈ C.ball b + +def arrayCollect : (X →₀ D) →+ (K →₀ D) := Finsupp.mapDomain.addMonoidHom C.key + +@[simp] theorem arrayCollect_single (x : X) (d : D) : + C.arrayCollect D (Finsupp.single x d) = Finsupp.single (C.key x) d := + Finsupp.mapDomain_single + +@[simp] theorem arrayBall_zero (b : ℕ) : C.arrayBall D b 0 := by simp [arrayBall] + +theorem arrayBall_single {b : ℕ} {x : X} (hx : x ∈ C.ball b) (d : D) : + C.arrayBall D b (Finsupp.single x d) := by + intro y hy + simpa only [((Finsupp.mem_support_single y x d).mp hy).1] using hx + +theorem arrayBall_add {b : ℕ} {p q : X →₀ D} + (hp : C.arrayBall D b p) (hq : C.arrayBall D b q) : C.arrayBall D b (p+q) := by + intro x hx + rcases Finset.mem_union.mp (Finsupp.support_add hx) with hx | hx + · exact hp x hx + · exact hq x hx + +theorem arrayBall_mono {b c : ℕ} (hbc : b ≤ c) {p : X →₀ D} + (hp : C.arrayBall D b p) : C.arrayBall D c p := fun x hx => C.mono hbc (hp x hx) + +theorem array_induction {b : ℕ} {P : (X →₀ D) → Prop} + (hz : P 0) (hs : ∀ x ∈ C.ball b, ∀ d : D, P (Finsupp.single x d)) + (ha : ∀ p q, P p → P q → P (p+q)) {p : X →₀ D} (hp : C.arrayBall D b p) : P p := by + revert hp + induction p using Finsupp.induction with + | zero => exact fun _ => hz + | single_add x d p hx hd ih => + intro hp + have hb : x ∈ C.ball b := hp x (by rw [Finsupp.support_single_add hx hd]; simp) + have hq : C.arrayBall D b p := by + intro y hy + exact hp y (by rw [Finsupp.support_single_add hx hd]; simp [hy]) + exact ha _ _ (hs x hb d) (ih hq) + +def arrays : KeyBall (X →₀ D) (K →₀ D) where + ball := C.arrayBall D + mono := fun _ _ hbc _ hp => C.arrayBall_mono D hbc hp + key := C.arrayCollect D + +variable (m : ℕ) [Nonempty X] + +def arrayCanonical : (X →₀ D) →+ (X →₀ D) := + Finsupp.mapDomain.addMonoidHom (C.canonical m) + +@[simp] theorem arrayCanonical_single (x : X) (d : D) : + C.arrayCanonical D m (Finsupp.single x d) = Finsupp.single (C.canonical m x) d := + Finsupp.mapDomain_single + +theorem arrayCanonical_mem {b : ℕ} {p : X →₀ D} + (hp : C.arrayBall D b p) (hb : b ≤ m) : C.arrayBall D b (C.arrayCanonical D m p) := by + intro y hy + obtain ⟨x, hx, rfl⟩ := Finset.mem_image.mp (Finsupp.mapDomain_support hy) + exact C.canonical_mem m (hp x hx) hb + +theorem arrayCanonical_congr {p q : X →₀ D} + (he : C.arrayCollect D p = C.arrayCollect D q) : + C.arrayCanonical D m p = C.arrayCanonical D m q := by + change Finsupp.mapDomain (C.representative m ∘ C.key) p = + Finsupp.mapDomain (C.representative m ∘ C.key) q + rw [Finsupp.mapDomain_comp, Finsupp.mapDomain_comp] + exact congrArg (Finsupp.mapDomain (C.representative m)) he + +theorem arrayCollect_canonical {b : ℕ} {p : X →₀ D} + (hp : C.arrayBall D b p) (hb : b ≤ m) : + C.arrayCollect D (C.arrayCanonical D m p) = C.arrayCollect D p := by + change Finsupp.mapDomain C.key (Finsupp.mapDomain (C.canonical m) p) = + Finsupp.mapDomain C.key p + rw [← Finsupp.mapDomain_comp] + exact Finsupp.mapDomain_congr (fun x hx => C.key_canonical m (hp x hx) hb) + +end KeyBall + +namespace KeyBall +variable {V K : Type*} [Monoid V] (C : KeyBall V K) (D : Type*) [Semiring D] + +def algebraBall (b : ℕ) (p : MonoidAlgebra D V) : Prop := C.arrayBall D b p.coeff + +def algebraCollect : MonoidAlgebra D V →+ (K →₀ D) := + (C.arrayCollect D).comp MonoidAlgebra.coeffAddEquiv.toAddMonoidHom + +@[simp] theorem algebraCollect_single {V K : Type*} [Monoid V] + (C : KeyBall V K) (D : Type*) [Semiring D] (v : V) (d : D) : + C.algebraCollect D (MonoidAlgebra.single v d) = Finsupp.single (C.key v) d := by + change C.arrayCollect D (Finsupp.single v d) = _ + exact C.arrayCollect_single D v d + +@[simp] theorem algebraBall_zero (b : ℕ) : C.algebraBall D b 0 := C.arrayBall_zero D b + +theorem algebraBall_single {V K : Type*} [Monoid V] + (C : KeyBall V K) (D : Type*) [Semiring D] {b : ℕ} {v : V} + (hv : v ∈ C.ball b) (d : D) : + C.algebraBall D b (MonoidAlgebra.single v d) := C.arrayBall_single D hv d + +theorem algebraBall_add {b : ℕ} {p q : MonoidAlgebra D V} + (hp : C.algebraBall D b p) (hq : C.algebraBall D b q) : C.algebraBall D b (p+q) := + C.arrayBall_add D hp hq + +theorem algebra_induction {b : ℕ} {P : MonoidAlgebra D V → Prop} + (hz : P 0) (hs : ∀ v ∈ C.ball b, ∀ d : D, P (MonoidAlgebra.single v d)) + (ha : ∀ p q, P p → P q → P (p+q)) {p : MonoidAlgebra D V} (hp : C.algebraBall D b p) : + P p := by + have hh := C.array_induction D (P := fun a => P (MonoidAlgebra.ofCoeff a)) + hz (by intro v hv d; exact hs v hv d) + (by intro p q hp hq; exact ha _ _ hp hq) hp + simpa only [MonoidAlgebra.ofCoeff_coeff] using hh + +variable (m : ℕ) + +def algebraCanonical : MonoidAlgebra D V →+ MonoidAlgebra D V := + MonoidAlgebra.coeffAddEquiv.symm.toAddMonoidHom.comp + ((C.arrayCanonical D m).comp MonoidAlgebra.coeffAddEquiv.toAddMonoidHom) + +@[simp] theorem algebraCanonical_single (v : V) (d : D) : + C.algebraCanonical D m (MonoidAlgebra.single v d) = + MonoidAlgebra.single (C.canonical m v) d := by + change MonoidAlgebra.ofCoeff (C.arrayCanonical D m (Finsupp.single v d)) = _ + rw [C.arrayCanonical_single D m, MonoidAlgebra.ofCoeff_single] + +theorem algebraCanonical_congr {p q : MonoidAlgebra D V} + (he : C.algebraCollect D p = C.algebraCollect D q) : + C.algebraCanonical D m p = C.algebraCanonical D m q := + congrArg MonoidAlgebra.ofCoeff (C.arrayCanonical_congr D m he) + +end KeyBall + +namespace ActionCalculus +variable {V X K L : Type*} [Group V] [MulAction V X] {m : ℕ} + (C : ActionCalculus V X K L m) (D : Type*) [Ring D] + +theorem algebra_mul_mem {p q : MonoidAlgebra D V} {b c : ℕ} + (hp : C.group.algebraBall D b p) (hq : C.group.algebraBall D c q) : + C.group.algebraBall D (b+c) (p*q) := by + apply C.group.algebra_induction D (P := fun p => C.group.algebraBall D (b+c) (p*q)) + ?_ ?_ ?_ hp + · simp + · intro u hu a + apply C.group.algebra_induction D + (P := fun q => C.group.algebraBall D (b+c) (MonoidAlgebra.single u a*q)) ?_ ?_ ?_ hq + · simp + · intro v hv d + rw [MonoidAlgebra.single_mul_single] + exact C.group.algebraBall_single D (C.mul_mem hu hv) _ + · intro x y hx hy + rw [mul_add] + exact C.group.algebraBall_add D hx hy + · intro x y hx hy + rw [add_mul] + exact C.group.algebraBall_add D hx hy + +theorem algebraCollect_product {p q : MonoidAlgebra D V} {b c : ℕ} + (hp : C.group.algebraBall D b p) (hq : C.group.algebraBall D c q) (hbc : b+c ≤ m) : + C.group.algebraCollect D (C.group.algebraCanonical D m p * C.group.algebraCanonical D m q) = + C.group.algebraCollect D (p*q) := by + apply C.group.algebra_induction D + (P := fun p => C.group.algebraCollect D + (C.group.algebraCanonical D m p * C.group.algebraCanonical D m q) = + C.group.algebraCollect D (p*q)) ?_ ?_ ?_ hp + · simp + · intro u hu a + apply C.group.algebra_induction D + (P := fun q => C.group.algebraCollect D + (C.group.algebraCanonical D m (MonoidAlgebra.single u a) * C.group.algebraCanonical D m q) = + C.group.algebraCollect D (MonoidAlgebra.single u a*q)) ?_ ?_ ?_ hq + · simp + · intro v hv d + simp only [KeyBall.algebraCanonical_single, MonoidAlgebra.single_mul_single, + KeyBall.algebraCollect_single] + have hk := C.mul_congr (C.group.canonical_mem m hu (by omega)) + (C.group.canonical_mem m hv (by omega)) hu hv hbc hbc + (C.group.key_canonical m hu (by omega)) (C.group.key_canonical m hv (by omega)) + rw [hk] + · intro x y hx hy + simp only [map_add, mul_add, hx, hy] + · intro x y hx hy + simp only [map_add, add_mul, hx, hy] + +theorem algebraCollect_mul_congr {p q p' q' : MonoidAlgebra D V} {b c b' c' : ℕ} + (hp : C.group.algebraBall D b p) (hq : C.group.algebraBall D c q) + (hp' : C.group.algebraBall D b' p') (hq' : C.group.algebraBall D c' q') + (hbc : b+c ≤ m) (hbc' : b'+c' ≤ m) + (hep : C.group.algebraCollect D p = C.group.algebraCollect D p') + (heq : C.group.algebraCollect D q = C.group.algebraCollect D q') : + C.group.algebraCollect D (p*q) = C.group.algebraCollect D (p'*q') := by + rw [← C.algebraCollect_product D hp hq hbc, ← C.algebraCollect_product D hp' hq' hbc', + C.group.algebraCanonical_congr D m hep, C.group.algebraCanonical_congr D m heq] + +theorem array_action_mem {p : MonoidAlgebra D V} {x : X →₀ D} {b c : ℕ} + (hp : C.group.algebraBall D b p) (hx : C.point.arrayBall D c x) : + C.point.arrayBall D (b+c) (SourceEnlargement.ringAction p x) := by + apply C.group.algebra_induction D + (P := fun p => C.point.arrayBall D (b+c) (SourceEnlargement.ringAction p x)) ?_ ?_ ?_ hp + · simp + · intro v hv a + apply C.point.array_induction D + (P := fun x => C.point.arrayBall D (b+c) + (SourceEnlargement.ringAction (MonoidAlgebra.single v a) x)) ?_ ?_ ?_ hx + · simp + · intro z hz d + rw [SourceEnlargement.ringAction_single] + exact C.point.arrayBall_single D (C.smul_mem hv hz) _ + · intro x y hx hy + rw [map_add] + exact C.point.arrayBall_add D hx hy + · intro p q hp hq + rw [map_add] + exact C.point.arrayBall_add D hp hq + +variable [Nonempty X] + +theorem arrayCollect_action {p : MonoidAlgebra D V} {x : X →₀ D} {b c : ℕ} + (hp : C.group.algebraBall D b p) (hx : C.point.arrayBall D c x) (hbc : b+c ≤ m) : + C.point.arrayCollect D (SourceEnlargement.ringAction (C.group.algebraCanonical D m p) + (C.point.arrayCanonical D m x)) = + C.point.arrayCollect D (SourceEnlargement.ringAction p x) := by + apply C.group.algebra_induction D + (P := fun p => C.point.arrayCollect D (SourceEnlargement.ringAction (C.group.algebraCanonical D m p) + (C.point.arrayCanonical D m x)) = C.point.arrayCollect D (SourceEnlargement.ringAction p x)) + ?_ ?_ ?_ hp + · simp + · intro v hv a + apply C.point.array_induction D + (P := fun x => C.point.arrayCollect D + (SourceEnlargement.ringAction (C.group.algebraCanonical D m (MonoidAlgebra.single v a)) + (C.point.arrayCanonical D m x)) = + C.point.arrayCollect D (SourceEnlargement.ringAction (MonoidAlgebra.single v a) x)) + ?_ ?_ ?_ hx + · simp + · intro z hz d + simp only [KeyBall.algebraCanonical_single, KeyBall.arrayCanonical_single, + SourceEnlargement.ringAction_single, KeyBall.arrayCollect_single] + have hk := C.smul_congr (C.group.canonical_mem m hv (by omega)) + (C.point.canonical_mem m hz (by omega)) hv hz hbc hbc + (C.group.key_canonical m hv (by omega)) (C.point.key_canonical m hz (by omega)) + rw [hk] + · intro x y hx hy + simp only [map_add, hx, hy] + · intro p q hp hq + simp only [map_add] + change C.point.arrayCollect D + (SourceEnlargement.ringAction (C.group.algebraCanonical D m p) (C.point.arrayCanonical D m x) + + SourceEnlargement.ringAction (C.group.algebraCanonical D m q) (C.point.arrayCanonical D m x)) = + C.point.arrayCollect D (SourceEnlargement.ringAction p x + SourceEnlargement.ringAction q x) + simp only [map_add, hp, hq] + +theorem arrayCollect_action_congr {p p' : MonoidAlgebra D V} {x x' : X →₀ D} {b c b' c' : ℕ} + (hp : C.group.algebraBall D b p) (hx : C.point.arrayBall D c x) + (hp' : C.group.algebraBall D b' p') (hx' : C.point.arrayBall D c' x') + (hbc : b+c ≤ m) (hbc' : b'+c' ≤ m) + (hep : C.group.algebraCollect D p = C.group.algebraCollect D p') + (hex : C.point.arrayCollect D x = C.point.arrayCollect D x') : + C.point.arrayCollect D (SourceEnlargement.ringAction p x) = + C.point.arrayCollect D (SourceEnlargement.ringAction p' x') := by + rw [← C.arrayCollect_action D hp hx hbc, ← C.arrayCollect_action D hp' hx' hbc', + C.group.algebraCanonical_congr D m hep, C.point.arrayCanonical_congr D m hex] + +def enlargement : + ActionCalculus (MonoidAlgebra D V)ˣ (X →₀ D) ((K →₀ D) × (K →₀ D)) (L →₀ D) m where + group := + { ball := fun b v => C.group.algebraBall D b v.val ∧ C.group.algebraBall D b v.inv + mono := by + intro b c hbc v hv + exact ⟨C.group.arrayBall_mono D hbc hv.1, C.group.arrayBall_mono D hbc hv.2⟩ + key := fun v => (C.group.algebraCollect D v.val, C.group.algebraCollect D v.inv) } + point := C.point.arrays D + one_mem b := by + have h : C.group.algebraBall D b 1 := by + rw [MonoidAlgebra.one_def] + exact C.group.algebraBall_single D (C.one_mem b) 1 + exact ⟨h,h⟩ + inv_mem := fun h => ⟨h.2,h.1⟩ + mul_mem := by + intro b c u v hu hv + refine ⟨C.algebra_mul_mem D hu.1 hv.1, ?_⟩ + change C.group.algebraBall D (b+c) (v.inv*u.inv) + simpa only [Nat.add_comm] using C.algebra_mul_mem D hv.2 hu.2 + smul_mem := fun hu hx => C.array_action_mem D hu.1 hx + inv_congr := fun he => Prod.ext (congrArg Prod.snd he) (congrArg Prod.fst he) + mul_congr := by + intro b c b' c' u v u' v' hu hv hu' hv' hb hb' heu hev + apply Prod.ext + · exact C.algebraCollect_mul_congr D hu.1 hv.1 hu'.1 hv'.1 hb hb' + (congrArg Prod.fst heu) (congrArg Prod.fst hev) + · exact C.algebraCollect_mul_congr D hv.2 hu.2 hv'.2 hu'.2 (by omega) (by omega) + (congrArg Prod.snd hev) (congrArg Prod.snd heu) + smul_congr := by + intro b c b' c' u x u' x' hu hx hu' hx' hb hb' heu hex + exact C.arrayCollect_action_congr D hu.1 hx hu'.1 hx' hb hb' (congrArg Prod.fst heu) hex + +theorem unitMap_mem (E : D) (hE : E*E = E) {v : V} {b : ℕ} (hv : v ∈ C.group.ball b) : + SourceEnlargement.unitMap E hE v ∈ (C.enlargement D).group.ball b := by + constructor + · exact C.group.algebraBall_add D (C.group.algebraBall_single D (C.one_mem b) _) + (C.group.algebraBall_single D hv _) + · exact C.group.algebraBall_add D (C.group.algebraBall_single D (C.one_mem b) _) + (C.group.algebraBall_single D (C.inv_mem hv) _) + +theorem basis_mem {x : X} {b : ℕ} (hx : x ∈ C.point.ball b) : + Finsupp.single x (1 : D) ∈ (C.enlargement D).point.ball b := + C.point.arrayBall_single D hx 1 + +end ActionCalculus +end +end SimpleFInftyOvergroups.BoundedEncoding + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleOvergroups/TruncatedMatrix.lean b/lean/OAI/GroupTheory/SimpleOvergroups/TruncatedMatrix.lean new file mode 100644 index 0000000000000000000000000000000000000000..9eec9f26fe7d4b16e0018402b263e4b64151b023 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleOvergroups/TruncatedMatrix.lean @@ -0,0 +1,247 @@ +import Mathlib +import OAI.GroupTheory.BooneHigman.PartialAffine +import OAI.GroupTheory.BooneHigman.Steinberg +import OAI.GroupTheory.FiniteType.HomotopyFunctor +import OAI.GroupTheory.SimpleOvergroups.TruncatedAlgebra + +namespace OAI + + +namespace SimpleFInftyOvergroups.BoundedEncoding.WordCalculus +noncomputable section +open scoped Classical + +variable {M : Type*} [Monoid M] {m : ℕ} (C : WordCalculus M m) +variable (k : Type*) [CommRing k] +variable {ι : Type*} [Fintype ι] [DecidableEq ι] + +abbrev MatrixBall (b : ℕ) (A : Matrix ι ι (MonoidAlgebra k M)) := + ∀ i j, A i j ∈ C.ball k b +abbrev ColumnBall (b : ℕ) (x : ι → MonoidAlgebra k M) := ∀ i, x i ∈ C.ball k b + +def matrixCollect (A : Matrix ι ι (MonoidAlgebra k M)) : Matrix ι ι (MonoidAlgebra k M) := + A.map (C.collect k) +def columnCollect (x : ι → MonoidAlgebra k M) : ι → MonoidAlgebra k M := + fun i => C.collect k (x i) + +@[simp] theorem matrixCollect_apply {ι : Type*} [Fintype ι] [DecidableEq ι] + (A : Matrix ι ι (MonoidAlgebra k M)) (i j : ι) : + C.matrixCollect k A i j = C.collect k (A i j) := rfl +@[simp] theorem columnCollect_apply {ι : Type*} [Fintype ι] [DecidableEq ι] + (x : ι → MonoidAlgebra k M) (i : ι) : + C.columnCollect k x i = C.collect k (x i) := rfl + +@[simp] theorem matrixCollect_one {ι : Type*} [Fintype ι] [DecidableEq ι] : + C.matrixCollect k (1 : Matrix ι ι (MonoidAlgebra k M)) = 1 := + Matrix.map_one _ (map_zero _) (C.collect_one k) +@[simp] theorem matrixCollect_zero {ι : Type*} [Fintype ι] [DecidableEq ι] : + C.matrixCollect k (0 : Matrix ι ι (MonoidAlgebra k M)) = 0 := + Matrix.map_zero _ (map_zero _) +@[simp] theorem columnCollect_zero {ι : Type*} [Fintype ι] [DecidableEq ι] : + C.columnCollect k (0 : ι → MonoidAlgebra k M) = 0 := by + funext i; exact (C.collect k).map_zero + +@[simp] theorem matrixBall_one {ι : Type*} [Fintype ι] [DecidableEq ι] (b : ℕ) : + C.MatrixBall k b (1 : Matrix ι ι (MonoidAlgebra k M)) := by + intro i j + by_cases h : i = j <;> simp [Matrix.one_apply, h, C.one_mem_ball] +@[simp] theorem matrixBall_zero {ι : Type*} [Fintype ι] [DecidableEq ι] (b : ℕ) : + C.MatrixBall k b (0 : Matrix ι ι (MonoidAlgebra k M)) := by + intro i j; exact (C.ball k b).zero_mem +@[simp] theorem columnBall_zero {ι : Type*} [Fintype ι] [DecidableEq ι] (b : ℕ) : + C.ColumnBall k b (0 : ι → MonoidAlgebra k M) := by + intro i; exact (C.ball k b).zero_mem + +theorem matrixBall_add {ι : Type*} [Fintype ι] [DecidableEq ι] + {A B : Matrix ι ι (MonoidAlgebra k M)} {b : ℕ} + (hA : C.MatrixBall k b A) (hB : C.MatrixBall k b B) : C.MatrixBall k b (A+B) := by + intro i j; exact (C.ball k b).add_mem (hA i j) (hB i j) +theorem matrixBall_sub {ι : Type*} [Fintype ι] [DecidableEq ι] + {A B : Matrix ι ι (MonoidAlgebra k M)} {b : ℕ} + (hA : C.MatrixBall k b A) (hB : C.MatrixBall k b B) : C.MatrixBall k b (A-B) := by + intro i j; exact (C.ball k b).sub_mem (hA i j) (hB i j) + +theorem matrixBall_single {ι : Type*} [Fintype ι] [DecidableEq ι] + {p : MonoidAlgebra k M} {b : ℕ} + (hp : p ∈ C.ball k b) (i j : ι) : C.MatrixBall k b (Matrix.single i j p) := by + intro u v + by_cases hi : i = u <;> by_cases hj : j = v <;> simp [hi, hj, hp] + +theorem matrixBall_mul {ι : Type*} [Fintype ι] [DecidableEq ι] + {A B : Matrix ι ι (MonoidAlgebra k M)} {b c : ℕ} + (hA : C.MatrixBall k b A) (hB : C.MatrixBall k c B) : C.MatrixBall k (b+c) (A*B) := by + intro i j + rw [Matrix.mul_apply] + exact (C.ball k (b+c)).sum_mem (fun l _ => C.mul_mem_ball k (hA i l) (hB l j)) + +theorem columnBall_mulVec {ι : Type*} [Fintype ι] [DecidableEq ι] + {A : Matrix ι ι (MonoidAlgebra k M)} {x : ι → MonoidAlgebra k M} + {b c : ℕ} (hA : C.MatrixBall k b A) (hx : C.ColumnBall k c x) : + C.ColumnBall k (b+c) (A.mulVec x) := by + intro i + exact (C.ball k (b+c)).sum_mem (fun l _ => C.mul_mem_ball k (hA i l) (hx l)) + +theorem matrixCollect_mem {ι : Type*} [Fintype ι] [DecidableEq ι] + {A : Matrix ι ι (MonoidAlgebra k M)} {b : ℕ} + (hA : C.MatrixBall k b A) (hb : b ≤ m) : C.MatrixBall k b (C.matrixCollect k A) := by + intro i j; exact C.collect_mem_ball k (hA i j) hb + +theorem columnCollect_mem {ι : Type*} [Fintype ι] [DecidableEq ι] + {x : ι → MonoidAlgebra k M} {b : ℕ} + (hx : C.ColumnBall k b x) (hb : b ≤ m) : C.ColumnBall k b (C.columnCollect k x) := by + intro i; exact C.collect_mem_ball k (hx i) hb + +theorem matrixCollect_idempotent {ι : Type*} [Fintype ι] [DecidableEq ι] + {A : Matrix ι ι (MonoidAlgebra k M)} {b : ℕ} + (hA : C.MatrixBall k b A) (hb : b ≤ m) : + C.matrixCollect k (C.matrixCollect k A) = C.matrixCollect k A := by + funext i j; exact C.collect_idempotent k (hA i j) hb + +theorem columnCollect_idempotent {ι : Type*} [Fintype ι] [DecidableEq ι] + {x : ι → MonoidAlgebra k M} {b : ℕ} + (hx : C.ColumnBall k b x) (hb : b ≤ m) : + C.columnCollect k (C.columnCollect k x) = C.columnCollect k x := by + funext i; exact C.collect_idempotent k (hx i) hb + +theorem matrixCollect_mul_left {ι : Type*} [Fintype ι] [DecidableEq ι] + {A B : Matrix ι ι (MonoidAlgebra k M)} {b c : ℕ} + (hA : C.MatrixBall k b A) (hB : C.MatrixBall k c B) (hbc : b+c ≤ m) : + C.matrixCollect k (C.matrixCollect k A * B) = C.matrixCollect k (A*B) := by + funext i j + simp only [matrixCollect_apply, Matrix.mul_apply, map_sum] + apply Finset.sum_congr rfl + intro l _ + exact C.collect_mul_left k (hA i l) (hB l j) hbc + +theorem matrixCollect_mul_right {ι : Type*} [Fintype ι] [DecidableEq ι] + {A B : Matrix ι ι (MonoidAlgebra k M)} {b c : ℕ} + (hA : C.MatrixBall k b A) (hB : C.MatrixBall k c B) (hbc : b+c ≤ m) : + C.matrixCollect k (A * C.matrixCollect k B) = C.matrixCollect k (A*B) := by + funext i j + simp only [matrixCollect_apply, Matrix.mul_apply, map_sum] + apply Finset.sum_congr rfl + intro l _ + exact C.collect_mul_right k (hA i l) (hB l j) hbc + +theorem matrixCollect_context {P Q X Y : Matrix ι ι (MonoidAlgebra k M)} {a b c d : ℕ} + (hp : C.MatrixBall k b P) (hq : C.MatrixBall k c Q) + (hx : C.MatrixBall k a X) (hy : C.MatrixBall k d Y) + (hpb : a+b+d ≤ m) (hqb : a+c+d ≤ m) + (he : C.matrixCollect k P = C.matrixCollect k Q) : + C.matrixCollect k (X*P*Y) = C.matrixCollect k (X*Q*Y) := by + have hxp : C.matrixCollect k (X*P) = C.matrixCollect k (X*Q) := by + rw [← C.matrixCollect_mul_right k hx hp (by omega), + ← C.matrixCollect_mul_right k hx hq (by omega), he] + rw [← C.matrixCollect_mul_left k (C.matrixBall_mul k hx hp) hy hpb, + ← C.matrixCollect_mul_left k (C.matrixBall_mul k hx hq) hy hqb, hxp] + +theorem columnCollect_mulVec_left {ι : Type*} [Fintype ι] [DecidableEq ι] + {A : Matrix ι ι (MonoidAlgebra k M)} + {x : ι → MonoidAlgebra k M} {b c : ℕ} + (hA : C.MatrixBall k b A) (hx : C.ColumnBall k c x) (hbc : b+c ≤ m) : + C.columnCollect k ((C.matrixCollect k A).mulVec x) = C.columnCollect k (A.mulVec x) := by + funext i + simp only [columnCollect_apply, Matrix.mulVec, dotProduct, matrixCollect_apply, map_sum] + apply Finset.sum_congr rfl + intro l _ + exact C.collect_mul_left k (hA i l) (hx l) hbc + +theorem columnCollect_mulVec_right {ι : Type*} [Fintype ι] [DecidableEq ι] + {A : Matrix ι ι (MonoidAlgebra k M)} + {x : ι → MonoidAlgebra k M} {b c : ℕ} + (hA : C.MatrixBall k b A) (hx : C.ColumnBall k c x) (hbc : b+c ≤ m) : + C.columnCollect k (A.mulVec (C.columnCollect k x)) = C.columnCollect k (A.mulVec x) := by + funext i + simp only [columnCollect_apply, Matrix.mulVec, dotProduct, map_sum] + apply Finset.sum_congr rfl + intro l _ + exact C.collect_mul_right k (hA i l) (hx l) hbc + +theorem columnCollect_context {A : Matrix ι ι (MonoidAlgebra k M)} + {x y : ι → MonoidAlgebra k M} {a b c : ℕ} + (hA : C.MatrixBall k a A) (hx : C.ColumnBall k b x) (hy : C.ColumnBall k c y) + (hb : a+b ≤ m) (hc : a+c ≤ m) (he : C.columnCollect k x = C.columnCollect k y) : + C.columnCollect k (A.mulVec x) = C.columnCollect k (A.mulVec y) := by + rw [← C.columnCollect_mulVec_right k hA hx hb, + ← C.columnCollect_mulVec_right k hA hy hc, he] + +def matrixPair (u : (Matrix ι ι (MonoidAlgebra k M))ˣ) := + (C.matrixCollect k u.val, C.matrixCollect k u.inv) + +def UnitBall (b : ℕ) (u : (Matrix ι ι (MonoidAlgebra k M))ˣ) : Prop := + C.MatrixBall k b u.val ∧ C.MatrixBall k b u.inv + +@[simp] theorem unitBall_one (b : ℕ) : + C.UnitBall k b (1 : (Matrix ι ι (MonoidAlgebra k M))ˣ) := + ⟨C.matrixBall_one k b, C.matrixBall_one k b⟩ + +theorem unitBall_inv {u : (Matrix ι ι (MonoidAlgebra k M))ˣ} {b : ℕ} + (hu : C.UnitBall k b u) : C.UnitBall k b u⁻¹ := ⟨hu.2, hu.1⟩ + +theorem unitBall_mul {u v : (Matrix ι ι (MonoidAlgebra k M))ˣ} {b c : ℕ} + (hu : C.UnitBall k b u) (hv : C.UnitBall k c v) : C.UnitBall k (b+c) (u*v) := by + refine ⟨C.matrixBall_mul k hu.1 hv.1, ?_⟩ + change C.MatrixBall k (b+c) (v.inv * u.inv) + simpa only [Nat.add_comm] using C.matrixBall_mul k hv.2 hu.2 + +theorem unitBall_elementary {p : MonoidAlgebra k M} {b : ℕ} + (hp : p ∈ C.ball k b) (i j : ι) (hij : i ≠ j) : + C.UnitBall k b (FiniteAlgebraicEnvelopes.Steinberg.elementary i j hij p) := + ⟨C.matrixBall_add k (C.matrixBall_one k b) (C.matrixBall_single k hp i j), + C.matrixBall_sub k (C.matrixBall_one k b) (C.matrixBall_single k hp i j)⟩ + +theorem matrixPair_context {p q x y : (Matrix ι ι (MonoidAlgebra k M))ˣ} {a b c d : ℕ} + (hp : C.UnitBall k b p) (hq : C.UnitBall k c q) + (hx : C.UnitBall k a x) (hy : C.UnitBall k d y) + (hb : a+b+d ≤ m) (hc : a+c+d ≤ m) + (he : C.matrixPair k p = C.matrixPair k q) : + C.matrixPair k (x*p*y) = C.matrixPair k (x*q*y) := by + apply Prod.ext + · exact C.matrixCollect_context k hp.1 hq.1 hx.1 hy.1 hb hc (congrArg Prod.fst he) + · change C.matrixCollect k (y.inv * (p.inv * x.inv)) = + C.matrixCollect k (y.inv * (q.inv * x.inv)) + rw [← mul_assoc, ← mul_assoc] + exact C.matrixCollect_context k hp.2 hq.2 hy.2 hx.2 (by omega) (by omega) + (congrArg Prod.snd he) + +theorem matrixPair_inv {u v : (Matrix ι ι (MonoidAlgebra k M))ˣ} + (he : C.matrixPair k u = C.matrixPair k v) : C.matrixPair k u⁻¹ = C.matrixPair k v⁻¹ := + Prod.ext (congrArg Prod.snd he) (congrArg Prod.fst he) + +theorem matrixPair_action {u v : (Matrix ι ι (MonoidAlgebra k M))ˣ} + {x : ι → MonoidAlgebra k M} {b c d : ℕ} + (hu : C.UnitBall k b u) (hv : C.UnitBall k c v) (hx : C.ColumnBall k d x) + (hb : b+d ≤ m) (hc : c+d ≤ m) (he : C.matrixPair k u = C.matrixPair k v) : + C.columnCollect k (u.val.mulVec x) = C.columnCollect k (v.val.mulVec x) := by + have hh : C.matrixCollect k u.val = C.matrixCollect k v.val := congrArg Prod.fst he + rw [← C.columnCollect_mulVec_left k hu.1 hx hb, + ← C.columnCollect_mulVec_left k hv.1 hx hc, hh] + +theorem inverse_action_iff {u : (Matrix ι ι (MonoidAlgebra k M))ˣ} + {y z : ι → MonoidAlgebra k M} {b c e : ℕ} + (hu : C.UnitBall k b u) (hy : C.ColumnBall k c y) (hz : C.ColumnBall k e z) + (hyb : b+c ≤ m) (hzb : b+e ≤ m) (hybb : 2*b+c ≤ m) (hzbb : 2*b+e ≤ m) : + C.columnCollect k y = C.columnCollect k (u.val.mulVec z) ↔ + C.columnCollect k (u.inv.mulVec y) = C.columnCollect k z := by + constructor + · intro heq + have hh := C.columnCollect_context k hu.2 hy (C.columnBall_mulVec k hu.1 hz) + hyb (by omega) heq + simpa only [Matrix.mulVec_mulVec, u.inv_val, Matrix.one_mulVec] using hh + · intro heq + have hh := C.columnCollect_context k hu.1 (C.columnBall_mulVec k hu.2 hy) hz + (by omega) hzb heq + simpa only [Matrix.mulVec_mulVec, u.val_inv, Matrix.one_mulVec] using hh + +theorem inverse_action_iff_of_total {u : (Matrix ι ι (MonoidAlgebra k M))ˣ} + {y z : ι → MonoidAlgebra k M} {b c e d : ℕ} + (hu : C.UnitBall k b u) (hy : C.ColumnBall k c y) (hz : C.ColumnBall k e z) + (htotal : b+c+e ≤ d) (hm : 3*d ≤ m) : + C.columnCollect k y = C.columnCollect k (u.val.mulVec z) ↔ + C.columnCollect k (u.inv.mulVec y) = C.columnCollect k z := + C.inverse_action_iff k hu hy hz (by omega) (by omega) (by omega) (by omega) + +end +end SimpleFInftyOvergroups.BoundedEncoding.WordCalculus + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleOvergroups/TwoEnlargements.lean b/lean/OAI/GroupTheory/SimpleOvergroups/TwoEnlargements.lean new file mode 100644 index 0000000000000000000000000000000000000000..c3c1570ab3c492e7ddf946265f71727e3e75a99e --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleOvergroups/TwoEnlargements.lean @@ -0,0 +1,205 @@ +import Mathlib +import OAI.GroupTheory.FiniteType.AscendingHNNInnerTwist +import OAI.GroupTheory.FiniteType.BinaryPrefixOperators +import OAI.GroupTheory.FiniteType.TwistedBrinGermBrick +import OAI.GroupTheory.SimpleOvergroups.EnlargementCore + +namespace OAI + +noncomputable section +namespace SourceEnlargement + +section OneLayer +variable (K : Type) [CommRing K] +variable (V Z : Type) [Group V] [MulAction V Z] + +abbrev enlargedGroup := group (V := V) (BinaryPrefixOperators.idempotents K) + (fun _ h => BinaryPrefixOperators.idempotents_are_idempotent K h) + +abbrev enlargedSet := Z →₀ BinaryPrefixOperators.algebra K + +instance enlargedAction : MulAction (enlargedGroup K V) (enlargedSet K Z) := + @MulAction.compHom _ _ _ _ + (unitsAction (D := BinaryPrefixOperators.algebra K) (V := V) (Z := Z)) + _ (enlargedGroup K V).subtype + +variable {V Z} + +def j (E : BinaryPrefixOperators.idempotents K) : V →* enlargedGroup K V := + map (BinaryPrefixOperators.idempotents K) + (fun _ h => BinaryPrefixOperators.idempotents_are_idempotent K h) E + +def groupEmbedding : V →* enlargedGroup K V := + j K ⟨1, BinaryPrefixOperators.identity_mem K⟩ + +def pointEmbedding (z : Z) : enlargedSet K Z := Finsupp.single z 1 + +lemma groupEmbedding_injective [Nontrivial K] : + Function.Injective (groupEmbedding (V := V) K) := + map_identity_injective (BinaryPrefixOperators.idempotents K) + (fun _ h => BinaryPrefixOperators.idempotents_are_idempotent K h) + (BinaryPrefixOperators.identity_mem K) + +lemma pointEmbedding_injective [Nontrivial K] : + Function.Injective (pointEmbedding (Z := Z) K) := basis_injective + +lemma groupEmbedding_pointEmbedding (g : V) (z : Z) : + groupEmbedding K g • pointEmbedding K z = pointEmbedding K (g • z) := + map_identity_basis (BinaryPrefixOperators.idempotents K) + (fun _ h => BinaryPrefixOperators.idempotents_are_idempotent K h) + (BinaryPrefixOperators.identity_mem K) g z + +def pairDiagrams : StageGeometry.PairDiagrams K + (groupEmbedding (V := V) K) (pointEmbedding (Z := Z) K) where + map := j K + identity := rfl + commute E P _hSum hEP hPE g h := + map_commute _ _ E P hEP hPE g h + addition E P hSum hEP _hPE g := map_add _ _ E P hSum hEP g + fixed E g z hz := map_fixes _ _ E g z hz + +end OneLayer + +def diagramsForward {Q W W' X Y Y' : Type} [Group Q] [Group W] [Group W'] + [MulAction Q X] [MulAction W Y] [MulAction W' Y'] + {K : Type} [CommRing K] {i : Q →* W} {t : X → Y} + (D : StageGeometry.PairDiagrams K i t) + (f : W →* W') (a : Y → Y') (h : ∀ w y, f w • a y = a (w • y)) : + StageGeometry.PairDiagrams K (f.comp i) (a ∘ t) where + map E := f.comp (D.map E) + identity := congrArg (f.comp) D.identity + commute E P hsum hEP hPE q u := (D.commute E P hsum hEP hPE q u).map f + addition E P hsum hEP hPE q := by + change f (D.map ⟨E.val + P.val, hsum⟩ q) = f (D.map E q) * f (D.map P q) + rw [D.addition E P hsum hEP hPE, map_mul] + fixed E q x hx := by + change f (D.map E q) • a (t x) = a (t x) + rw [h, D.fixed E q x hx] + +def diagramsBackward {Q' Q W X' X Y : Type} [Group Q'] [Group Q] [Group W] + [MulAction Q' X'] [MulAction Q X] [MulAction W Y] + {K : Type} [CommRing K] {i : Q →* W} {t : X → Y} + (D : StageGeometry.PairDiagrams K i t) + (f : Q' →* Q) (a : X' → X) (h : ∀ q x, f q • a x = a (q • x)) : + StageGeometry.PairDiagrams K (i.comp f) (t ∘ a) where + map E := (D.map E).comp f + identity := congrArg (fun j => j.comp f) D.identity + commute E P hsum hEP hPE q u := D.commute E P hsum hEP hPE (f q) (f u) + addition E P hsum hEP hPE q := D.addition E P hsum hEP hPE (f q) + fixed E q x hx := D.fixed E (f q) (a x) (by rw [h, hx]) + +namespace Saturation +variable {W X Y : Type} [Group W] [MulAction W Y] (t : X → Y) + +def carrier : Set Y := {y | ∃ (w : W) (x : X), w • t x = y} + +instance action : MulAction W (carrier (W := W) t) where + smul w y := ⟨w • y.val, by + obtain ⟨v, x, hx⟩ := y.property + exact ⟨w * v, x, by rw [mul_smul, hx]⟩⟩ + one_smul y := Subtype.ext (one_smul _ _) + mul_smul w v y := Subtype.ext (mul_smul _ _ _) + +def point (x : X) : carrier (W := W) t := ⟨t x, 1, x, one_smul W (t x)⟩ + +lemma point_injective (ht : Function.Injective t) : + Function.Injective (point (W := W) t) := fun _ _ e => ht (congrArg Subtype.val e) + +lemma equivariant {Q : Type} [Group Q] [MulAction Q X] (i : Q →* W) + (h : ∀ q x, i q • t x = t (q • x)) (q : Q) (x : X) : + i q • point (W := W) t x = point t (q • x) := Subtype.ext (h q x) + +def diagrams {Q : Type} [Group Q] [MulAction Q X] + {K : Type} [CommRing K] {i : Q →* W} (D : StageGeometry.PairDiagrams K i t) : + StageGeometry.PairDiagrams K i (point (W := W) t) where + map := D.map + identity := D.identity + commute := D.commute + addition := D.addition + fixed E q x hx := Subtype.ext (D.fixed E q x hx) +end Saturation + +namespace Double +variable (Q X : Type) [Group Q] [MulAction Q X] + +abbrev W₁ := enlargedGroup (ZMod 2) Q +abbrev Y₁ := enlargedSet (ZMod 2) X +abbrev W := enlargedGroup (ZMod 3) (W₁ Q) +abbrev AmbientY := enlargedSet (ZMod 3) (Y₁ X) + +instance action₁ : MulAction (W₁ Q) (Y₁ X) := + enlargedAction (ZMod 2) Q X + +instance action₂ : MulAction (W Q) (AmbientY X) := + enlargedAction (ZMod 3) (W₁ Q) (Y₁ X) + +instance smul₁ : SMul (W₁ Q) (Y₁ X) := (action₁ Q X).toSMul +instance smul₂ : SMul (W Q) (AmbientY X) := (action₂ Q X).toSMul + +variable {Q X} + +def iota : Q →* W Q := + (groupEmbedding (ZMod 3)).comp (groupEmbedding (ZMod 2)) + +def ambientPoint (x : X) : AmbientY X := + pointEmbedding (ZMod 3) (pointEmbedding (ZMod 2) x) + +lemma iota_injective : Function.Injective (iota (Q := Q)) := + (groupEmbedding_injective (ZMod 3)).comp (groupEmbedding_injective (ZMod 2)) + +lemma ambientPoint_injective : Function.Injective (ambientPoint (X := X)) := + (pointEmbedding_injective (ZMod 3)).comp (pointEmbedding_injective (ZMod 2)) + +lemma iota_ambientPoint (q : Q) (x : X) : + (iota q • ambientPoint x : AmbientY X) = ambientPoint (q • x) := by + change (groupEmbedding (ZMod 3) (groupEmbedding (ZMod 2) q) • + pointEmbedding (ZMod 3) (pointEmbedding (ZMod 2) x) : AmbientY X) = _ + rw [groupEmbedding_pointEmbedding, groupEmbedding_pointEmbedding] + rfl + +def ambientDiagrams₂ : StageGeometry.PairDiagrams (ZMod 2) + (iota (Q := Q)) (ambientPoint (X := X)) := + diagramsForward (pairDiagrams (V := Q) (Z := X) (ZMod 2)) + (groupEmbedding (ZMod 3)) (pointEmbedding (ZMod 3)) + (groupEmbedding_pointEmbedding (ZMod 3)) + +def ambientDiagrams₃ : StageGeometry.PairDiagrams (ZMod 3) + (iota (Q := Q)) (ambientPoint (X := X)) := + diagramsBackward (pairDiagrams (V := W₁ Q) (Z := Y₁ X) (ZMod 3)) + (groupEmbedding (ZMod 2)) (pointEmbedding (ZMod 2)) + (groupEmbedding_pointEmbedding (ZMod 2)) + +def orbitSet : Set (AmbientY X) := + Saturation.carrier (W := W Q) (ambientPoint (X := X)) + +abbrev Y := orbitSet (Q := Q) (X := X) + +instance orbitAction : MulAction (W Q) (Y (Q := Q) (X := X)) := + Saturation.action (W := W Q) (ambientPoint (X := X)) + +instance orbitSMul : SMul (W Q) (Y (Q := Q) (X := X)) := + (orbitAction (Q := Q) (X := X)).toSMul + +def point (x : X) : Y (Q := Q) (X := X) := + Saturation.point (W := W Q) (ambientPoint (X := X)) x + +lemma point_injective : Function.Injective (point (Q := Q) (X := X)) := + Saturation.point_injective _ ambientPoint_injective + +lemma iota_point (q : Q) (x : X) : + iota q • point (Q := Q) x = point (Q := Q) (q • x) := + Saturation.equivariant _ _ iota_ambientPoint q x + +def diagrams₂ : StageGeometry.PairDiagrams (ZMod 2) + (iota (Q := Q)) (point (Q := Q) (X := X)) := + Saturation.diagrams _ ambientDiagrams₂ + +def diagrams₃ : StageGeometry.PairDiagrams (ZMod 3) + (iota (Q := Q)) (point (Q := Q) (X := X)) := + Saturation.diagrams _ ambientDiagrams₃ + +end Double +end SourceEnlargement +end + +end OAI diff --git a/lean/OAI/GroupTheory/SimpleOvergroups/VariableCode.lean b/lean/OAI/GroupTheory/SimpleOvergroups/VariableCode.lean new file mode 100644 index 0000000000000000000000000000000000000000..46f0ce56e76a1f20cbfe6efea52fa4cf5effaa31 --- /dev/null +++ b/lean/OAI/GroupTheory/SimpleOvergroups/VariableCode.lean @@ -0,0 +1,199 @@ +import Mathlib +import OAI.GroupTheory.FiniteType.ProductGroupHomology + +namespace OAI + + +namespace SimpleFInftyOvergroups.ContextualEncoding + +structure DelimiterCode (A S : Type*) where + start : S + stop : S + distinct : start ≠ stop + body : A → List S + start_avoids : ∀ a, start ∉ body a + stop_avoids : ∀ a, stop ∉ body a + injective : Function.Injective body + +namespace DelimiterCode +variable {A S : Type*} (C : DelimiterCode A S) + +def block (a : A) : List S := C.start :: (C.body a ++ [C.stop]) +def encode (w : List A) : List S := w.flatMap C.block + +@[simp] theorem block_length (a : A) : (C.block a).length = (C.body a).length + 2 := by + simp [block] +@[simp] theorem encode_nil : C.encode [] = [] := rfl +@[simp] theorem encode_cons (a : A) (w : List A) : + C.encode (a :: w) = C.block a ++ C.encode w := rfl +@[simp] theorem encode_append (u v : List A) : + C.encode (u ++ v) = C.encode u ++ C.encode v := by simp [encode] + +theorem length_le_encode (w : List A) : 2 * w.length ≤ (C.encode w).length := by + induction w with + | nil => simp + | cons a w ih => simp only [encode_cons, List.length_append, block_length, List.length_cons]; omega + +@[simp] theorem encode_eq_nil (w : List A) : C.encode w = [] ↔ w = [] := by + constructor + · intro h + have := C.length_le_encode w + simp only [h, List.length_nil] at this + simpa using (show w.length = 0 by omega) + · rintro rfl; rfl + +theorem split_at_stop {t : S} {a b u v : List S} (ha : t ∉ a) (hb : t ∉ b) + (he : a ++ t :: u = b ++ t :: v) : a = b ∧ u = v := by + induction a generalizing b with + | nil => + cases b with + | nil => exact ⟨rfl, (List.cons.inj he).2⟩ + | cons x b => + have hx := (List.cons.inj he).1 + exact (hb (by simp [hx])).elim + | cons x a ih => + cases b with + | nil => + have hx := (List.cons.inj he).1 + exact (ha (by simp [hx])).elim + | cons y b => + obtain ⟨rfl, htail⟩ := List.cons.inj he + obtain ⟨rfl, rfl⟩ := ih + (fun h => ha (List.mem_cons_of_mem _ h)) + (fun h => hb (List.mem_cons_of_mem _ h)) htail + exact ⟨rfl, rfl⟩ + +theorem block_cancel {a b : A} {u v : List S} + (he : C.block a ++ u = C.block b ++ v) : a = b ∧ u = v := by + simp only [block, List.cons_append, List.append_assoc] at he + obtain ⟨hab, huv⟩ := split_at_stop (C.stop_avoids a) (C.stop_avoids b) + (List.cons.inj he).2 + exact ⟨C.injective hab, huv⟩ + +theorem prefix_decode {u v : List A} {y : List S} + (h : C.encode v = C.encode u ++ y) : ∃ w, v = u ++ w ∧ y = C.encode w := by + induction u generalizing v with + | nil => exact ⟨v, rfl, h.symm⟩ + | cons a u ih => + cases v with + | nil => simp [block] at h + | cons b v => + simp only [encode_cons, List.append_assoc] at h + obtain ⟨rfl, ht⟩ := C.block_cancel h + obtain ⟨w, rfl, rfl⟩ := ih ht + exact ⟨w, rfl, rfl⟩ + +theorem encode_injective : Function.Injective C.encode := by + intro u v h + obtain ⟨w, hu, hw⟩ := C.prefix_decode (y := []) (by simpa using h) + have hw : w = [] := (C.encode_eq_nil w).mp hw.symm + simpa only [hw, List.append_nil] using hu + +private theorem split_past_avoiding {b : S} {t z x y : List S} (ht : b ∉ t) + (h : t ++ z = x ++ b :: y) : ∃ x', x = t ++ x' ∧ z = x' ++ b :: y := by + induction t generalizing x with + | nil => exact ⟨x, rfl, h⟩ + | cons a t ih => + cases x with + | nil => + have ha : a = b := (List.cons.inj h).1 + exact (ht (by simp [ha])).elim + | cons c x => + obtain ⟨rfl, htail⟩ := List.cons.inj h + obtain ⟨x', rfl, hz⟩ := ih (fun hh => ht (List.mem_cons_of_mem _ hh)) htail + exact ⟨x', rfl, hz⟩ + +private theorem tail_avoids (a : A) : C.start ∉ C.body a ++ [C.stop] := by + simp [C.start_avoids, C.distinct] + +theorem marker_alignment {v : List A} {x y : List S} + (h : C.encode v = x ++ C.start :: y) : + ∃ u a w, v = u ++ a :: w ∧ x = C.encode u ∧ + y = C.body a ++ C.stop :: C.encode w := by + induction v generalizing x with + | nil => simp at h + | cons a v ih => + cases x with + | nil => + have hy : (C.body a ++ [C.stop]) ++ C.encode v = y := (List.cons.inj h).2 + exact ⟨[], a, v, rfl, rfl, by simpa only [List.append_assoc, List.singleton_append] using hy.symm⟩ + | cons b x => + obtain ⟨rfl, hv⟩ := List.cons.inj h + obtain ⟨x', rfl, hv'⟩ := + split_past_avoiding (C.tail_avoids a) hv + obtain ⟨u, b, w, rfl, hx, hy⟩ := ih hv' + exact ⟨a :: u, b, w, rfl, by simp [block, hx], hy⟩ + +theorem occurrence_decode {v u : List A} (hu : u ≠ []) {x y : List S} + (h : C.encode v = x ++ C.encode u ++ y) : + ∃ p q, v = p ++ u ++ q ∧ x = C.encode p ∧ y = C.encode q := by + cases u with + | nil => contradiction + | cons a u => + have hm : C.encode v = x ++ C.start :: (C.body a ++ C.stop :: (C.encode u ++ y)) := by + simpa [block, List.append_assoc] using h + obtain ⟨p, b, w, hv, rfl, _⟩ := C.marker_alignment hm + have hh : C.encode (b :: w) = C.encode (a :: u) ++ y := by + apply List.append_cancel_left (as := C.encode p) + simpa only [hv, encode_append, List.append_assoc] using h + obtain ⟨q, hq, hqy⟩ := C.prefix_decode hh + exact ⟨p, q, by rw [hv, hq, List.append_assoc], rfl, hqy⟩ + +theorem overlap_decode {u v : List A} {p middle q : List S} + (hm : middle ≠ []) (h₁ : C.encode u = p ++ middle) + (h₂ : C.encode v = middle ++ q) : + ∃ a b c, u = a ++ b ∧ v = b ++ c ∧ p = C.encode a ∧ + middle = C.encode b ∧ q = C.encode c := by + cases v with + | nil => simp at h₂; exact (hm h₂.1).elim + | cons v vs => + cases middle with + | nil => contradiction + | cons m middle => + have hm' : m = C.start := (List.cons.inj h₂).1.symm + subst m + obtain ⟨a, b, bs, hu, hp, ht⟩ := C.marker_alignment h₁ + have hs : C.start :: middle = C.encode (b :: bs) := by simp [block, ht] + obtain ⟨c, hv, hq⟩ := C.prefix_decode (show + C.encode (v :: vs) = C.encode (b :: bs) ++ q by simpa [hs] using h₂) + exact ⟨a, b :: bs, c, hu, hv, hp, hs, hq⟩ + +theorem encode_avoids {s : S} (hs : s ≠ C.start) (ht : s ≠ C.stop) + (hb : ∀ a, s ∉ C.body a) (u : List A) : s ∉ C.encode u := by + simp only [encode, List.mem_flatMap, block, List.mem_cons, List.mem_append, + List.not_mem_nil, or_false] + rintro ⟨a, _, h | h | h⟩ + · exact hs h + · exact hb a h + · exact ht h + +def cost (c : A → ℕ) (w : List A) : ℕ := (w.map c).sum +@[simp] theorem cost_nil (c : A → ℕ) : cost c [] = 0 := rfl +@[simp] theorem cost_cons (c : A → ℕ) (a : A) (w : List A) : + cost c (a :: w) = c a + cost c w := rfl +@[simp] theorem cost_append (c : A → ℕ) (u v : List A) : + cost c (u ++ v) = cost c u + cost c v := by simp [cost] + +theorem cost_bound (c : A → ℕ) + (hc : ∀ a, 10 * c a + 2 ≤ (C.block a).length) (w : List A) : + 10 * cost c w + 2 * w.length ≤ (C.encode w).length := by + induction w with + | nil => simp + | cons a w ih => + have := hc a + simp only [cost_cons, encode_cons, List.length_append, List.length_cons] at * + omega + +theorem cost_le_quota (c : A → ℕ) + (hc : ∀ a, 10 * c a + 2 ≤ (C.block a).length) + {w : List A} {n : ℕ} (hw : (C.encode w).length ≤ n) : cost c w ≤ n / 10 := by + have := C.cost_bound c hc w + omega + +end DelimiterCode + +theorem strict_dependency {n : ℕ} (hn : 0 < n) : 3 * (n / 10) < n := by omega + +end SimpleFInftyOvergroups.ContextualEncoding + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/AffineGridArithmetic.lean b/lean/OAI/GroupTheory/Thompson/AffineGridArithmetic.lean new file mode 100644 index 0000000000000000000000000000000000000000..8b0c0b1f40ad65e9190977e19f7a26bc5d3b9a0f --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/AffineGridArithmetic.lean @@ -0,0 +1,146 @@ +import OAI.GroupTheory.Thompson.DyadicArithmetic +import OAI.GroupTheory.Thompson.BasicInterval +import Mathlib.Algebra.Order.Archimedean.Real.Basic + +namespace OAI + +/-! +# Alignment of dyadic affine images with basic intervals + +A slope which is an integer power of two sends every sufficiently fine grid +cell to a single grid cell, provided its dyadic translation has been absorbed +into the target denominator. The target depth can be made arbitrarily large. +-/ + +namespace ThompsonNonamenability + +/-- An integer grid cell lying in the unit interval is a basic interval. -/ +theorem basicInterval_of_integer_grid (d : ℕ) (j : ℤ) + (h0 : 0 ≤ (j : ℝ) / (2 : ℝ) ^ d) + (h1 : ((j : ℝ) + 1) / (2 : ℝ) ^ d ≤ 1) : + ∃ I : BasicInterval, I.depth = d ∧ + I.left = (j : ℝ) / (2 : ℝ) ^ d ∧ + I.right = ((j : ℝ) + 1) / (2 : ℝ) ^ d := by + have hp : (0 : ℝ) < (2 : ℝ) ^ d := pow_pos (by norm_num) _ + have hjr : (0 : ℝ) ≤ (j : ℝ) := by + have hh := (le_div_iff₀ hp).1 h0 + simpa only [zero_mul] using hh + have hj : (0 : ℤ) ≤ j := by exact_mod_cast hjr + have hc : (j.toNat : ℝ) = (j : ℝ) := by + exact_mod_cast Int.toNat_of_nonneg hj + have hbound : j.toNat < 2 ^ d := by + have hh : (j.toNat : ℝ) + 1 ≤ (2 : ℝ) ^ d := by + rw [hc] + exact (div_le_one hp).1 h1 + have hn : j.toNat + 1 ≤ 2 ^ d := by exact_mod_cast hh + omega + refine ⟨⟨d, ⟨j.toNat, hbound⟩⟩, rfl, ?_, ?_⟩ + · change (j.toNat : ℝ) / (2 : ℝ) ^ d = _ + rw [hc] + · change ((j.toNat : ℝ) + 1) / (2 : ℝ) ^ d = _ + rw [hc] + +/-- The target denominator simultaneously absorbs the translation and slope. +The freely specified lower bound on target depth gives arbitrarily small cells. -/ +theorem dyadic_affine_aligned_denominators (q : ℤ) (b : ℝ) + (hb : IsDyadic b) (L : ℕ) : + ∃ N : ℕ, ∀ n ≥ N, ∃ d : ℕ, L ≤ d ∧ + (∃ j : ℤ, b = (j : ℝ) / (2 : ℝ) ^ d) ∧ + (2 : ℝ) ^ q / (2 : ℝ) ^ n = 1 / (2 : ℝ) ^ d := by + obtain ⟨j, m, hj⟩ := hb + cases q with + | ofNat p => + refine ⟨m + L + p, ?_⟩ + intro n hn + obtain ⟨t, rfl⟩ := Nat.exists_eq_add_of_le hn + refine ⟨m + L + t, by omega, ?_, ?_⟩ + · exact dyadic_denominator_mono ⟨j, hj⟩ (by omega) + · rw [Int.ofNat_eq_natCast, zpow_natCast] + have he : m + L + p + t = p + (m + L + t) := by omega + rw [he, pow_add] + field_simp + | negSucc p => + refine ⟨m + L, ?_⟩ + intro n hn + obtain ⟨t, rfl⟩ := Nat.exists_eq_add_of_le hn + refine ⟨m + L + t + (p + 1), by omega, ?_, ?_⟩ + · exact dyadic_denominator_mono ⟨j, hj⟩ (by omega) + · rw [zpow_negSucc, pow_add] + field_simp ; ring + +/-- A single cell is aligned when the slope and translation share the target +grid denominator. No assumption about the source cell's location is needed. -/ +theorem dyadic_affine_cell_of_denominator (q : ℤ) (b : ℝ) (n d : ℕ) + (hb : ∃ j : ℤ, b = (j : ℝ) / (2 : ℝ) ^ d) + (hs : (2 : ℝ) ^ q / (2 : ℝ) ^ n = 1 / (2 : ℝ) ^ d) + (k : Fin (2 ^ n)) + (h0 : 0 ≤ (2 : ℝ) ^ q * ((k.val : ℝ) / (2 : ℝ) ^ n) + b) + (h1 : (2 : ℝ) ^ q * (((k.val : ℝ) + 1) / (2 : ℝ) ^ n) + b ≤ 1) : + ∃ I : BasicInterval, I.depth = d ∧ + I.left = (2 : ℝ) ^ q * ((k.val : ℝ) / (2 : ℝ) ^ n) + b ∧ + I.right = (2 : ℝ) ^ q * (((k.val : ℝ) + 1) / (2 : ℝ) ^ n) + b := by + obtain ⟨j, hj⟩ := hb + have hl : (2 : ℝ) ^ q * ((k.val : ℝ) / (2 : ℝ) ^ n) + b = + (((k.val : ℤ) + j : ℤ) : ℝ) / (2 : ℝ) ^ d := by + calc + _ = ((2 : ℝ) ^ q / (2 : ℝ) ^ n) * (k.val : ℝ) + b := by ring + _ = (1 / (2 : ℝ) ^ d) * (k.val : ℝ) + (j : ℝ) / (2 : ℝ) ^ d := by + rw [hs, hj] + _ = _ := by push_cast; ring + have hr : (2 : ℝ) ^ q * (((k.val : ℝ) + 1) / (2 : ℝ) ^ n) + b = + ((((k.val : ℤ) + j : ℤ) : ℝ) + 1) / (2 : ℝ) ^ d := by + calc + _ = ((2 : ℝ) ^ q / (2 : ℝ) ^ n) * ((k.val : ℝ) + 1) + b := by ring + _ = (1 / (2 : ℝ) ^ d) * ((k.val : ℝ) + 1) + (j : ℝ) / (2 : ℝ) ^ d := by + rw [hs, hj] + _ = _ := by push_cast; ring + obtain ⟨I, hd, hleft, hright⟩ := basicInterval_of_integer_grid d ((k.val : ℤ) + j) + (hl ▸ h0) (hr ▸ h1) + exact ⟨I, hd, hleft.trans hl.symm, hright.trans hr.symm⟩ + +/-- Every sufficiently fine cell has a basic interval as its dyadic affine +image whenever that image lies in `[0,1]`. -/ +theorem dyadic_affine_grid_alignment (q : ℤ) (b : ℝ) (hb : IsDyadic b) : + ∃ N : ℕ, ∀ n ≥ N, ∀ k : Fin (2 ^ n), + 0 ≤ (2 : ℝ) ^ q * ((k.val : ℝ) / (2 : ℝ) ^ n) + b → + (2 : ℝ) ^ q * (((k.val : ℝ) + 1) / (2 : ℝ) ^ n) + b ≤ 1 → + ∃ I : BasicInterval, + I.left = (2 : ℝ) ^ q * ((k.val : ℝ) / (2 : ℝ) ^ n) + b ∧ + I.right = (2 : ℝ) ^ q * (((k.val : ℝ) + 1) / (2 : ℝ) ^ n) + b := by + obtain ⟨N, hN⟩ := dyadic_affine_aligned_denominators q b hb 0 + refine ⟨N, ?_⟩ + intro n hn k h0 h1 + obtain ⟨d, _, hb', hs⟩ := hN n hn + obtain ⟨I, _, hl, hr⟩ := dyadic_affine_cell_of_denominator q b n d hb' hs k h0 h1 + exact ⟨I, hl, hr⟩ + +/-- The affine image cells can simultaneously be required to have any prescribed +positive upper bound on their length. -/ +theorem dyadic_affine_grid_alignment_small (q : ℤ) (b : ℝ) (hb : IsDyadic b) + (ε : ℝ) (hε : 0 < ε) : + ∃ N : ℕ, ∀ n ≥ N, ∀ k : Fin (2 ^ n), + 0 ≤ (2 : ℝ) ^ q * ((k.val : ℝ) / (2 : ℝ) ^ n) + b → + (2 : ℝ) ^ q * (((k.val : ℝ) + 1) / (2 : ℝ) ^ n) + b ≤ 1 → + ∃ I : BasicInterval, + I.left = (2 : ℝ) ^ q * ((k.val : ℝ) / (2 : ℝ) ^ n) + b ∧ + I.right = (2 : ℝ) ^ q * (((k.val : ℝ) + 1) / (2 : ℝ) ^ n) + b ∧ + I.length < ε := by + obtain ⟨L, hL⟩ := exists_pow_lt_of_lt_one hε (by norm_num : (2 : ℝ)⁻¹ < 1) + have hL' : 1 / (2 : ℝ) ^ L < ε := by + simpa only [inv_pow, one_div] using hL + obtain ⟨N, hN⟩ := dyadic_affine_aligned_denominators q b hb L + refine ⟨N, ?_⟩ + intro n hn k h0 h1 + obtain ⟨d, hd, hb', hs⟩ := hN n hn + obtain ⟨I, hdepth, hl, hr⟩ := dyadic_affine_cell_of_denominator q b n d hb' hs k h0 h1 + refine ⟨I, hl, hr, ?_⟩ + have hpow : (2 : ℝ) ^ L ≤ (2 : ℝ) ^ d := + pow_le_pow_right₀ (by norm_num) hd + have hle := one_div_le_one_div_of_le (pow_pos (by norm_num : (0 : ℝ) < 2) L) hpow + change ((2 : ℝ) ^ I.depth)⁻¹ < ε + rw [hdepth, ← one_div] + exact hle.trans_lt hL' + +end ThompsonNonamenability + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/AffinePiece.lean b/lean/OAI/GroupTheory/Thompson/AffinePiece.lean new file mode 100644 index 0000000000000000000000000000000000000000..bf1a95cb337039e55ac227a66a33d4d70b2bc395 --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/AffinePiece.lean @@ -0,0 +1,64 @@ +import OAI.GroupTheory.Thompson.IntervalCharts + +namespace OAI + +/-! +# Affine maps between basic dyadic intervals + +Each pair of basic intervals determines an increasing affine map of the real +line. It carries endpoints and charts to their counterparts, and its slope is +an integral power of two. +-/ + +noncomputable section + +namespace ThompsonNonamenability + +namespace OrderedPLInterpolation + +def affine (I J : BasicInterval) (x : ℝ) : ℝ := + J.left + (J.length / I.length) * (x - I.left) + +@[simp] theorem affine_left (I J : BasicInterval) : + affine I J I.left = J.left := by + simp [affine] + +@[simp] theorem affine_right (I J : BasicInterval) : + affine I J I.right = J.right := by + unfold affine + rw [← I.length_eq_right_sub_left] + rw [div_mul_cancel₀ _ (ne_of_gt I.length_pos)] + rw [J.length_eq_right_sub_left] + ring + +theorem affine_strictMono (I J : BasicInterval) : StrictMono (affine I J) := by + intro x y hxy + exact add_lt_add_right + (mul_lt_mul_of_pos_left (sub_lt_sub_right hxy I.left) + (div_pos J.length_pos I.length_pos)) J.left + +@[simp] theorem affine_inverse (I J : BasicInterval) (x : ℝ) : + affine J I (affine I J x) = x := by + unfold affine + field_simp [ne_of_gt I.length_pos, ne_of_gt J.length_pos] + ring + +@[simp] theorem affine_chart (I J : BasicInterval) (x : ℝ) : + affine I J (I.chart x) = J.chart x := by + rw [I.chart_eq_left_add_length_mul, J.chart_eq_left_add_length_mul] + unfold affine + field_simp [ne_of_gt I.length_pos] + ring + +theorem affine_slope_zpow (I J : BasicInterval) : + J.length / I.length = (2 : ℝ) ^ ((I.depth : ℤ) - (J.depth : ℤ)) := by + rw [zpow_sub₀ (by norm_num : (2 : ℝ) ≠ 0)] + simp only [zpow_natCast, BasicInterval.length, inv_div_inv] + +end OrderedPLInterpolation + +end ThompsonNonamenability + +end + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/AffineTransport.lean b/lean/OAI/GroupTheory/Thompson/AffineTransport.lean new file mode 100644 index 0000000000000000000000000000000000000000..5769d4cd4a47219bb35318f370c5060a3e18a77a --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/AffineTransport.lean @@ -0,0 +1,88 @@ +import OAI.GroupTheory.Thompson.DyadicGapPartition +import OAI.GroupTheory.Thompson.OrderedPLInterpolation +import Mathlib.Data.List.Forall2 + +namespace OAI + +/-! +# Simultaneous affine transport of two separated basic intervals + +Each of the three complementary gaps is partitioned and equalized separately. +Consequently the selected source and target cells occupy matching positions +in the two full ordered partitions. The interpolation theorem constructs an +actual increasing dyadic PL homeomorphism on those partitions. +-/ + +noncomputable section + +universe uα uβ + +namespace ThompsonNonamenability + +private theorem forall₂_after_prefix {α : Type uα} {β : Type uβ} {R : α → β → Prop} + {A C : List α} {B D : List β} (hlen : A.length = B.length) + (h : List.Forall₂ R (A ++ C) (B ++ D)) : List.Forall₂ R C D := by + have hdrop := List.forall₂_drop A.length h + rw [List.drop_left, hlen, List.drop_left] at hdrop + exact hdrop + +/-- The selected positions are preserved because the three gap lengths are +equalized independently. All partition data will be constructed below. -/ +private theorem exists_pair_transport_of_partitions + (I J I' J' : BasicInterval) + (P₀ : DyadicGapPartition 0 I.left) (Q₀ : DyadicGapPartition 0 I'.left) + (P₁ : DyadicGapPartition I.right J.left) + (Q₁ : DyadicGapPartition I'.right J'.left) + (P₂ : DyadicGapPartition J.right 1) (Q₂ : DyadicGapPartition J'.right 1) + (hlen₀ : P₀.cells.length = Q₀.cells.length) + (hlen₁ : P₁.cells.length = Q₁.cells.length) + (hlen₂ : P₂.cells.length = Q₂.cells.length) : + ∃ h : F, CarriesAffinely h I I' ∧ CarriesAffinely h J J' := by + let L := P₀.cells ++ I :: (P₁.cells ++ J :: P₂.cells) + let R := Q₀.cells ++ I' :: (Q₁.cells ++ J' :: Q₂.cells) + have hL : GapChain 0 1 L := by + exact P₀.chain.append ⟨rfl, P₁.chain.append ⟨rfl, P₂.chain⟩⟩ + have hR : GapChain 0 1 R := by + exact Q₀.chain.append ⟨rfl, Q₁.chain.append ⟨rfl, Q₂.chain⟩⟩ + have hlen : L.length = R.length := by + simp only [L, R, List.length_append, List.length_cons, hlen₀, hlen₁, hlen₂] + obtain ⟨h, hpair⟩ := exists_chain_transport hL hR hlen + have hpair₀ : List.Forall₂ (CarriesAffinely h) + (I :: (P₁.cells ++ J :: P₂.cells)) + (I' :: (Q₁.cells ++ J' :: Q₂.cells)) := + forall₂_after_prefix hlen₀ hpair + have hfirst := List.forall₂_cons.mp hpair₀ + have hpair₁ : List.Forall₂ (CarriesAffinely h) + (J :: P₂.cells) (J' :: Q₂.cells) := + forall₂_after_prefix hlen₁ hfirst.2 + exact ⟨h, hfirst.1, (List.forall₂_cons.mp hpair₁).1⟩ + +/-- Two strictly separated internal basic intervals can simultaneously be +carried onto any other such pair by an actual element of standard Thompson F. -/ +theorem exists_affine_pair_transport {I J I' J' : BasicInterval} + (hI : I.Internal) (hJ : J.Internal) + (hI' : I'.Internal) (hJ' : J'.Internal) + (hIJ : I.Before J) (hIJ' : I'.Before J') : + ∃ h : F, CarriesAffinely h I I' ∧ CarriesAffinely h J J' := by + obtain ⟨P₀, Q₀, hlen₀⟩ := exists_equal_length_partitions + isDyadic_zero I.left_isDyadic isDyadic_zero I'.left_isDyadic + le_rfl (I.left_lt_right.le.trans I.right_le_one) + le_rfl (I'.left_lt_right.le.trans I'.right_le_one) hI.1 hI'.1 + obtain ⟨P₁, Q₁, hlen₁⟩ := exists_equal_length_partitions + I.right_isDyadic J.left_isDyadic I'.right_isDyadic J'.left_isDyadic + (I.left_nonneg.trans I.left_lt_right.le) + (J.left_lt_right.le.trans J.right_le_one) + (I'.left_nonneg.trans I'.left_lt_right.le) + (J'.left_lt_right.le.trans J'.right_le_one) hIJ hIJ' + obtain ⟨P₂, Q₂, hlen₂⟩ := exists_equal_length_partitions + J.right_isDyadic isDyadic_one J'.right_isDyadic isDyadic_one + (J.left_nonneg.trans J.left_lt_right.le) le_rfl + (J'.left_nonneg.trans J'.left_lt_right.le) le_rfl hJ.2 hJ'.2 + exact exists_pair_transport_of_partitions I J I' J' + P₀ Q₀ P₁ Q₁ P₂ Q₂ hlen₀ hlen₁ hlen₂ + +end ThompsonNonamenability + +end + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/AnalyticConstruction.lean b/lean/OAI/GroupTheory/Thompson/AnalyticConstruction.lean new file mode 100644 index 0000000000000000000000000000000000000000..51ce7a5dd2c6f31d25da5cb0289c59816ba32b69 --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/AnalyticConstruction.lean @@ -0,0 +1,133 @@ +import OAI.GroupTheory.Thompson.AnalyticCurveRotation +import OAI.GroupTheory.Thompson.AnalyticCurveSeparation +import OAI.GroupTheory.Thompson.AnalyticCorrection +import OAI.GroupTheory.Thompson.AnalyticNormalization + +namespace OAI + +/-! +# The actual positive-displacement map on the L² unit ball + +Every elementary field of the generic tube and correction constructions is +instantiated here by the explicit scalar profiles and the concrete L² curve. +The final map has no geometric or analytic certificate as a hypothesis. +-/ + +noncomputable section + +namespace ThompsonNonamenability.Analytic + +open scoped InnerProductSpace + +private def separationAtScale : ℝ := + Classical.choose (gamma_uniform_separation (1 / 32) (by norm_num)) + +private theorem separationAtScale_pos : 0 < separationAtScale := + (Classical.choose_spec (gamma_uniform_separation (1 / 32) (by norm_num))).1 + +private theorem separationAtScale_le (s t : ℝ) (h : (1 / 32 : ℝ) ≤ |t - s|) : + separationAtScale ≤ ‖gamma t - gamma s‖ := + (Classical.choose_spec (gamma_uniform_separation (1 / 32) (by norm_num))).2 s t h + +/-- The proved elementary geometry of the actual radial oscillating curve. -/ +def regularCurve : RegularCurveData Hilbert where + curve := gamma + velocity := gammaDeriv + tangent := u + hasDerivAt := hasDerivAt_gamma + norm_tangent := u_norm + velocity_eq := gammaDeriv_eq_norm_smul_u + speed_lower := gammaDeriv_speed_lower + velocity_lipschitz := gammaDeriv_sub_norm_le + tangent_lipschitz := u_sub_norm_le + separation := separationAtScale + separation_pos := separationAtScale_pos + separated := separationAtScale_le + +/-- The radius comes from proved uniform separation and the explicit speed bounds. -/ +def tubeRadius : ℝ := regularCurve.rho + +theorem tubeRadius_pos : 0 < tubeRadius := regularCurve.rho_pos + +theorem tubeRadius_lt : tubeRadius < 1 / 32 := by + have := regularCurve.rho_le + dsimp [tubeRadius] + linarith + +/-- The literal radial, angular, and rotation inputs to the correction formula. -/ +def correctionData : CorrectionData regularCurve where + a := a + v := v + q := q + R := R + curve_eq := fun _ => rfl + a_zero := by rw [a_of_le_two (by norm_num : (0 : ℝ) ≤ 2)]; norm_num + a_upper := a_le_five_sixteenths + a_late_lower := fun _ ht => a_lower_of_one_le ht.le + q_eq := fun t => by simpa only [b, neg_div] using q_eq_b_sub_a t + q_bound := q_abs_le + q_lipschitz := by + intro s t + simpa [dist_eq_norm, Real.norm_eq_abs] using q_lipschitz.dist_le_mul t s + norm_v := v_norm + v_lipschitz := v_sub_norm_le + curve_lipschitz := gamma_sub_norm_le + norm_R := R_norm + R_perp := R_perp + R_lipschitz := R_sub_norm_le + R_early := fun _ ht e => R_early_apply ht e + tangent_early := fun _ ht => u_of_le_one ht + +/-- The explicit correction, restricted to the shared actual closed unit ball. -/ +def G (x : Ball) : Hilbert := correctionData.G (x : Hilbert) + +theorem G_norm_lower (x : Ball) : tubeRadius / 4 ≤ ‖G x‖ := + correctionData.G_lower (x : Hilbert) + +theorem G_outer (x : Ball) (hx : (1 / 2 : ℝ) ≤ ‖(x : Hilbert)‖) : + G x = (x : Hilbert) := correctionData.G_outer (x : Hilbert) hx + +theorem G_sub_norm_le (x y : Ball) : + ‖G x - G y‖ ≤ correctionData.lipschitzConstant * ‖(x : Hilbert) - y‖ := + correctionData.G_lipschitz (x : Hilbert) (y : Hilbert) + +private theorem normalizationRadius_pos : 0 < tubeRadius / 4 := + div_pos tubeRadius_pos (by norm_num) + +/-- Negative radial normalization of the concrete nonvanishing correction. -/ +def displacementMap : Ball → Ball := + normalizedMap G normalizationRadius_pos G_norm_lower + +theorem displacementMap_norm (x : Ball) : ‖(displacementMap x : Hilbert)‖ = 1 := + norm_normalizedMap G normalizationRadius_pos G_norm_lower x + +theorem displacementMap_displacement (x : Ball) : + (1 / 2 : ℝ) ≤ ‖(displacementMap x : Hilbert) - x‖ := + normalizedMap_displacement G normalizationRadius_pos G_norm_lower G_outer x + +def displacementLipschitzConstant : ℝ := + 2 * correctionData.lipschitzConstant / (tubeRadius / 4) + +theorem displacementLipschitzConstant_pos : 0 < displacementLipschitzConstant := + div_pos (mul_pos (by norm_num) correctionData.lipschitzConstant_pos) + normalizationRadius_pos + +theorem displacementMap_lipschitz (x y : Ball) : + ‖(displacementMap x : Hilbert) - displacementMap y‖ ≤ + displacementLipschitzConstant * ‖(x : Hilbert) - y‖ := + normalizedMap_lipschitz G normalizationRadius_pos G_norm_lower G_sub_norm_le x y + +/-- The unconditional analytic input used by the finite correlation proof. -/ +theorem exists_displacementMap : + ∃ (f : UnitBall Hilbert → UnitBall Hilbert) (L : ℝ), + 0 < L ∧ + (∀ x y, ‖(f x : Hilbert) - f y‖ ≤ L * ‖(x : Hilbert) - y‖) ∧ + (∀ x, (1 / 2 : ℝ) ≤ ‖(f x : Hilbert) - x‖) := + ⟨displacementMap, displacementLipschitzConstant, displacementLipschitzConstant_pos, + displacementMap_lipschitz, displacementMap_displacement⟩ + +end ThompsonNonamenability.Analytic + +end + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/AnalyticCorrection.lean b/lean/OAI/GroupTheory/Thompson/AnalyticCorrection.lean new file mode 100644 index 0000000000000000000000000000000000000000..eea5e870946572381d2f8866b3e1015454cc338a --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/AnalyticCorrection.lean @@ -0,0 +1,176 @@ +import OAI.GroupTheory.Thompson.CorrectionLocal +import OAI.GroupTheory.Thompson.CorrectionNonzero + +namespace OAI + +/-! +# Global gluing of the explicit Hilbert correction + +The cutoff tails tend to zero at the actual tube boundary. These estimates +give the mixed inside/outside case; a uniform bound on the additive change +handles distant pairs. Together with the local tube estimate, this covers +every pair of points, including the boundary itself. +-/ + +noncomputable section + +universe uE + +namespace ThompsonNonamenability.Analytic + +variable {E : Type uE} [NormedAddCommGroup E] [InnerProductSpace ℝ E] +variable {C : RegularCurveData E} + +namespace CorrectionData + +variable (D : CorrectionData C) + +theorem rotated_residual_sub_bound (x : C.tube) : + ‖D.R (C.parameter x) (C.residual x) - C.residual x‖ ≤ 2 * ‖C.residual x‖ := by + calc + _ ≤ ‖D.R (C.parameter x) (C.residual x)‖ + ‖C.residual x‖ := norm_sub_le _ _ + _ = _ := by rw [D.norm_R]; ring + +theorem change_bound (x : C.tube) : + ‖D.change x‖ ≤ beta C.rho ‖C.residual x‖ * (7 / 16) + + chi C.rho ‖C.residual x‖ * (2 * ‖C.residual x‖) := by + calc + _ ≤ ‖(beta C.rho ‖C.residual x‖ * D.q (C.parameter x)) • D.v (C.parameter x)‖ + + ‖chi C.rho ‖C.residual x‖ • + (D.R (C.parameter x) (C.residual x) - C.residual x)‖ := norm_add_le _ _ + _ = beta C.rho ‖C.residual x‖ * |D.q (C.parameter x)| + + chi C.rho ‖C.residual x‖ * + ‖D.R (C.parameter x) (C.residual x) - C.residual x‖ := by + rw [norm_smul, norm_smul, Real.norm_eq_abs, Real.norm_eq_abs, + abs_mul, abs_of_nonneg (beta_nonneg _ _), + abs_of_nonneg (chi_nonneg _ _), D.norm_v, mul_one] + _ ≤ _ := add_le_add + (mul_le_mul_of_nonneg_left (D.q_bound _) (beta_nonneg _ _)) + (mul_le_mul_of_nonneg_left (D.rotated_residual_sub_bound x) (chi_nonneg _ _)) + +theorem change_uniform_bound (x : C.tube) : + ‖D.change x‖ ≤ 7 / 16 + 2 * C.rho := by + have hb := beta_le_one C.rho ‖C.residual x‖ + have hc := chi_le_one C.rho ‖C.residual x‖ + have hr := (C.residual_norm_lt x).le + have hchi := mul_le_mul_of_nonneg_right hc + (show 0 ≤ 2 * ‖C.residual x‖ by positivity) + have hbeta := mul_le_mul_of_nonneg_right hb (show (0 : ℝ) ≤ 7 / 16 by norm_num) + have h := D.change_bound x + linarith + +theorem change_tail_bound (x : C.tube) : + ‖D.change x‖ ≤ (7 / (8 * C.rho) + 4) * (C.rho - ‖C.residual x‖) := by + have hr := (C.residual_norm_lt x).le + have ht : 0 ≤ 2 * (C.rho - ‖C.residual x‖) / C.rho := + div_nonneg (mul_nonneg (by norm_num) (sub_nonneg.mpr hr)) C.rho_pos.le + have hb := beta_le_tail C.rho_pos ‖C.residual x‖ (norm_nonneg _) hr + have hc := chi_le_tail C.rho_pos ‖C.residual x‖ (norm_nonneg _) hr + calc + ‖D.change x‖ ≤ beta C.rho ‖C.residual x‖ * (7 / 16) + + chi C.rho ‖C.residual x‖ * (2 * ‖C.residual x‖) := D.change_bound x + _ ≤ (2 * (C.rho - ‖C.residual x‖) / C.rho) * (7 / 16) + + (2 * (C.rho - ‖C.residual x‖) / C.rho) * (2 * C.rho) := by + apply add_le_add + · exact mul_le_mul_of_nonneg_right hb (by norm_num) + · exact (mul_le_mul_of_nonneg_right hc (by positivity)).trans + (mul_le_mul_of_nonneg_left (by linarith : 2 * ‖C.residual x‖ ≤ 2 * C.rho) ht) + _ = _ := by field_simp [C.rho_pos.ne']; ring + +/-- Distance to an outside point controls the remaining radius of the tube. -/ +theorem radius_gap_le (x : C.tube) {y : E} (hy : y ∉ C.tube) : + C.rho - ‖C.residual x‖ ≤ ‖(x : E) - y‖ := by + have hy' : C.rho ≤ Metric.infDist y (Set.range C.curve) := by + exact not_lt.mp hy + have hdist : Metric.infDist y (Set.range C.curve) ≤ + Metric.infDist (x : E) (Set.range C.curve) + ‖(x : E) - y‖ := by + simpa only [dist_eq_norm, norm_sub_rev] using + (Metric.infDist_le_infDist_add_dist (x := y) (y := (x : E)) + (s := Set.range C.curve)) + rw [← C.residual_norm] at hdist + linarith + +theorem inside_outside_bound (x : C.tube) {y : E} (hy : y ∉ C.tube) : + ‖D.inside x - y‖ ≤ (5 + 7 / (8 * C.rho)) * ‖(x : E) - y‖ := by + have hρ := C.rho_pos + have hc : 0 ≤ 7 / (8 * C.rho) + 4 := by positivity + have heq : D.inside x - y = ((x : E) - y) + D.change x := by + unfold inside + abel + calc + ‖D.inside x - y‖ ≤ ‖(x : E) - y‖ + ‖D.change x‖ := by + rw [heq] + exact norm_add_le _ _ + _ ≤ ‖(x : E) - y‖ + + (7 / (8 * C.rho) + 4) * (C.rho - ‖C.residual x‖) := + add_le_add le_rfl (D.change_tail_bound x) + _ ≤ ‖(x : E) - y‖ + (7 / (8 * C.rho) + 4) * ‖(x : E) - y‖ := + add_le_add le_rfl (mul_le_mul_of_nonneg_left (radius_gap_le (C := C) x hy) hc) + _ = _ := by ring + +theorem G_sub_self_bound (x : E) : ‖D.G x - x‖ ≤ 7 / 16 + 2 * C.rho := by + by_cases hx : x ∈ C.tube + · rw [D.G_of_mem ⟨x, hx⟩] + simpa only [inside, add_sub_cancel_left] using D.change_uniform_bound ⟨x, hx⟩ + · rw [D.G_of_not_mem hx, sub_self, norm_zero] + have := C.rho_pos + positivity + +/-- The distant-pair estimate uses only the bounded additive change. -/ +theorem G_distant_bound (x y : E) (hxy : C.rho ≤ ‖x - y‖) : + ‖D.G x - D.G y‖ ≤ (5 + 7 / (8 * C.rho)) * ‖x - y‖ := by + have hρ := C.rho_pos + have hc : 0 ≤ 7 / (8 * C.rho) + 4 := by positivity + have hm := mul_le_mul_of_nonneg_left hxy hc + have he : (7 / (8 * C.rho) + 4) * C.rho = 7 / 8 + 4 * C.rho := by + field_simp [C.rho_pos.ne'] + rw [he] at hm + have hdecomp : D.G x - D.G y = (x - y) + ((D.G x - x) - (D.G y - y)) := by abel + calc + ‖D.G x - D.G y‖ ≤ ‖x - y‖ + (‖D.G x - x‖ + ‖D.G y - y‖) := by + rw [hdecomp] + exact (norm_add_le _ _).trans (add_le_add le_rfl (norm_sub_le _ _)) + _ ≤ ‖x - y‖ + ((7 / 16 + 2 * C.rho) + (7 / 16 + 2 * C.rho)) := + add_le_add le_rfl (add_le_add (D.G_sub_self_bound x) (D.G_sub_self_bound y)) + _ ≤ (5 + 7 / (8 * C.rho)) * ‖x - y‖ := by nlinarith + +/-- A finite positive constant valid for all pairs in the ambient Hilbert space. -/ +def lipschitzConstant (_ : CorrectionData C) : ℝ := + max 1 (max (30 + 7 / (4 * C.rho) + 3808 * C.rho) (5 + 7 / (8 * C.rho))) + +theorem lipschitzConstant_pos : 0 < D.lipschitzConstant := + lt_of_lt_of_le (by norm_num) (le_max_left _ _) + +theorem G_lipschitz (x y : E) : + ‖D.G x - D.G y‖ ≤ D.lipschitzConstant * ‖x - y‖ := by + have hlocal : 30 + 7 / (4 * C.rho) + 3808 * C.rho ≤ D.lipschitzConstant := + (le_max_left _ _).trans (le_max_right _ _) + have hfar : 5 + 7 / (8 * C.rho) ≤ D.lipschitzConstant := + (le_max_right _ _).trans (le_max_right _ _) + have hone : 1 ≤ D.lipschitzConstant := le_max_left _ _ + by_cases hxy : ‖x - y‖ < C.rho + · by_cases hx : x ∈ C.tube + · by_cases hy : y ∈ C.tube + · rw [D.G_of_mem ⟨x, hx⟩, D.G_of_mem ⟨y, hy⟩] + exact (D.inside_local_bound ⟨x, hx⟩ ⟨y, hy⟩ hxy).trans + (mul_le_mul_of_nonneg_right hlocal (norm_nonneg _)) + · rw [D.G_of_mem ⟨x, hx⟩, D.G_of_not_mem hy] + exact (D.inside_outside_bound ⟨x, hx⟩ hy).trans + (mul_le_mul_of_nonneg_right hfar (norm_nonneg _)) + · by_cases hy : y ∈ C.tube + · rw [D.G_of_not_mem hx, D.G_of_mem ⟨y, hy⟩, norm_sub_rev] + have h := D.inside_outside_bound ⟨y, hy⟩ hx + rw [norm_sub_rev y x] at h + exact h.trans (mul_le_mul_of_nonneg_right hfar (norm_nonneg _)) + · rw [D.G_of_not_mem hx, D.G_of_not_mem hy] + simpa only [one_mul] using mul_le_mul_of_nonneg_right hone (norm_nonneg (x - y)) + · exact (D.G_distant_bound x y (not_lt.mp hxy)).trans + (mul_le_mul_of_nonneg_right hfar (norm_nonneg _)) + +end CorrectionData + +end ThompsonNonamenability.Analytic + +end + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/AnalyticCurve.lean b/lean/OAI/GroupTheory/Thompson/AnalyticCurve.lean new file mode 100644 index 0000000000000000000000000000000000000000..6ae3c4bcee60653f62aa068dff40b1846f0c91b7 --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/AnalyticCurve.lean @@ -0,0 +1,148 @@ +import OAI.GroupTheory.Thompson.AnalyticOscillator +import OAI.GroupTheory.Thompson.AnalyticScalarDerivatives +import Mathlib.Analysis.Calculus.Deriv.Mul +import Mathlib.Analysis.Normed.Module.RCLike.Basic +import Mathlib.Tactic.FieldSimp +import Mathlib.Tactic.Linarith +import Mathlib.Tactic.Ring + +namespace OAI + +/-! +# The actual radial oscillating curve + +All vectors live in the concrete Euclidean-fiber L² space. The derivative +and squared-speed identities are derived from the scalar profiles and the +frequency curve, including the profile junctions. +-/ + +noncomputable section + +namespace ThompsonNonamenability.Analytic + +open Set +open scoped InnerProductSpace + +def v (t : ℝ) : Hilbert := wave (theta t) + +def gamma (t : ℝ) : Hilbert := a t • v t + +def gammaDeriv (t : ℝ) : Hilbert := + aDeriv t • v t + (a t * thetaDeriv t) • waveDeriv (theta t) + +def u (t : ℝ) : Hilbert := ‖gammaDeriv t‖⁻¹ • gammaDeriv t + +theorem v_norm (t : ℝ) : ‖v t‖ = 1 := wave_norm _ + +theorem continuous_v : Continuous v := continuous_wave.comp continuous_theta + +theorem continuous_gamma : Continuous gamma := continuous_a.smul continuous_v + +theorem hasDerivAt_v (t : ℝ) : + HasDerivAt v (thetaDeriv t • waveDeriv (theta t)) t := by + exact (hasDerivAt_wave (theta t)).scomp t (hasDerivAt_theta t) + +theorem hasDerivAt_gamma (t : ℝ) : HasDerivAt gamma (gammaDeriv t) t := by + have h := (hasDerivAt_a t).fun_smul (hasDerivAt_v t) + exact h.congr_deriv (by simp only [gammaDeriv, mul_smul, add_comm]) + +theorem gamma_norm (t : ℝ) : ‖gamma t‖ = |a t| := by + simp only [gamma, norm_smul, Real.norm_eq_abs, v_norm, mul_one] + +@[simp] theorem gamma_zero : gamma 0 = 0 := by + simp [gamma, a_of_le_two (by norm_num : (0 : ℝ) ≤ 2)] + +theorem gamma_of_le_one {t : ℝ} (ht : t ≤ 1) : gamma t = (t / 8) • wave 0 := by + rw [gamma, a_of_le_two (by linarith), v, theta_of_le_one ht] + +theorem gammaDeriv_of_le_one {t : ℝ} (ht : t ≤ 1) : + gammaDeriv t = (1 / 8 : ℝ) • wave 0 := by + simp [gammaDeriv, v, aDeriv_of_le_two (by linarith : t ≤ 2), + theta_of_le_one ht, thetaDeriv_of_le_one ht] + +theorem gammaDeriv_norm_sq (t : ℝ) : + ‖gammaDeriv t‖ ^ 2 = (aDeriv t) ^ 2 + (a t) ^ 2 * (thetaDeriv t) ^ 2 / 3 := by + rw [gammaDeriv, norm_add_sq_real] + simp only [norm_smul, Real.norm_eq_abs, mul_one, mul_pow, sq_abs, + waveDeriv_norm_sq, real_inner_smul_left, real_inner_smul_right, + v, wave_norm, wave_inner_waveDeriv, mul_zero, add_zero] + ring + +theorem gammaDeriv_speed_lower (t : ℝ) : (1 / 8 : ℝ) ≤ ‖gammaDeriv t‖ := by + have heq := gammaDeriv_norm_sq t + have hn := norm_nonneg (gammaDeriv t) + by_cases ht : t ≤ 2 + · rw [aDeriv_of_le_two ht] at heq + nlinarith [mul_nonneg (sq_nonneg (a t)) (sq_nonneg (thetaDeriv t))] + · have ha := a_lower_of_two_le (le_of_not_ge ht) + rw [thetaDeriv_of_two_le (le_of_not_ge ht)] at heq + nlinarith [sq_nonneg (aDeriv t), sq_nonneg (a t - 1 / 4)] + +theorem gammaDeriv_norm_pos (t : ℝ) : 0 < ‖gammaDeriv t‖ := by + have := gammaDeriv_speed_lower t + linarith + +theorem gammaDeriv_ne_zero (t : ℝ) : gammaDeriv t ≠ 0 := + norm_pos_iff.mp (gammaDeriv_norm_pos t) + +theorem u_norm (t : ℝ) : ‖u t‖ = 1 := + norm_smul_inv_norm (gammaDeriv_ne_zero t) + +theorem gammaDeriv_eq_norm_smul_u (t : ℝ) : + gammaDeriv t = ‖gammaDeriv t‖ • u t := by + simp only [u, smul_smul, mul_inv_cancel₀ (ne_of_gt (gammaDeriv_norm_pos t)), one_smul] + +theorem u_of_le_one {t : ℝ} (ht : t ≤ 1) : u t = v t := by + rw [u, gammaDeriv_of_le_one ht] + simp [v, theta_of_le_one ht, norm_smul, wave_norm, smul_smul] + +theorem gammaDeriv_inner_v (t : ℝ) : inner (𝕜 := ℝ) (gammaDeriv t) (v t) = aDeriv t := by + have hz : inner (𝕜 := ℝ) (waveDeriv (theta t)) (v t) = 0 := by + rw [real_inner_comm] + exact wave_inner_waveDeriv _ + simp [gammaDeriv, inner_add_left, real_inner_smul_left, hz, v_norm] + +theorem u_inner_v (t : ℝ) : inner (𝕜 := ℝ) (u t) (v t) = aDeriv t / ‖gammaDeriv t‖ := by + simp only [u, real_inner_smul_left, gammaDeriv_inner_v, div_eq_mul_inv] + ring + +theorem u_inner_v_nonneg (t : ℝ) : 0 ≤ inner (𝕜 := ℝ) (u t) (v t) := by + rw [u_inner_v] + exact div_nonneg (aDeriv_nonneg t) (norm_nonneg _) + +theorem v_inner (s t : ℝ) : inner (𝕜 := ℝ) (v s) (v t) = sinc (theta t - theta s) := + wave_inner _ _ + +theorem gamma_inner (s t : ℝ) : + inner (𝕜 := ℝ) (gamma s) (gamma t) = a s * a t * sinc (theta t - theta s) := by + simp only [gamma, real_inner_smul_left, real_inner_smul_right, v_inner] + ring + +theorem gamma_sub_norm_sq (s t : ℝ) : + ‖gamma t - gamma s‖ ^ 2 = (a s) ^ 2 + (a t) ^ 2 - + 2 * (a s * a t * sinc (theta t - theta s)) := by + rw [norm_sub_rev, norm_sub_sq_real, gamma_norm, gamma_norm, sq_abs, sq_abs, + gamma_inner] + ring + +theorem gammaDeriv_speed_eq_of_le_one {t : ℝ} (ht : t ≤ 1) : + ‖gammaDeriv t‖ = 1 / 8 := by + rw [gammaDeriv_of_le_one ht, norm_smul, Real.norm_eq_abs, wave_norm] + norm_num + +theorem gammaDeriv_speed_inf : sInf (range fun t => ‖gammaDeriv t‖) = 1 / 8 := by + have hne : (range fun t => ‖gammaDeriv t‖).Nonempty := ⟨_, mem_range_self 0⟩ + have hb : BddBelow (range fun t => ‖gammaDeriv t‖) := + ⟨1 / 8, by rintro _ ⟨t, rfl⟩; exact gammaDeriv_speed_lower t⟩ + apply le_antisymm + · have := csInf_le hb (mem_range_self (f := fun t => ‖gammaDeriv t‖) 0) + simpa only [gammaDeriv_speed_eq_of_le_one (by norm_num : (0 : ℝ) ≤ 1)] using this + · apply le_csInf hne + rintro _ ⟨t, rfl⟩ + exact gammaDeriv_speed_lower t + +end ThompsonNonamenability.Analytic + +end + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/AnalyticCurveBounds.lean b/lean/OAI/GroupTheory/Thompson/AnalyticCurveBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..e27682f90f0c557fae26c3b597af6695d7359cde --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/AnalyticCurveBounds.lean @@ -0,0 +1,224 @@ +import OAI.GroupTheory.Thompson.AnalyticCurve +import OAI.GroupTheory.Thompson.AnalyticNormalization +import Mathlib.Analysis.Calculus.MeanValue + +namespace OAI + +/-! +# Quantitative estimates for the actual Hilbert curve + +The derivative estimate uses first-derivative product differences on the +oscillating part and the exact straight-tail formula. No second derivative +at a profile junction is assumed. +-/ + +noncomputable section + +namespace ThompsonNonamenability.Analytic + +open Set +open scoped NNReal + +theorem a_sub_abs_le (s t : ℝ) : |a s - a t| ≤ (1 / 8) * |s - t| := by + simpa only [Real.dist_eq, NNReal.coe_div, NNReal.coe_one, NNReal.coe_ofNat] using + a_lipschitz.dist_le_mul s t + +theorem aDeriv_sub_abs_le (s t : ℝ) : + |aDeriv s - aDeriv t| ≤ (1 / 8) * |s - t| := by + simpa only [Real.dist_eq, NNReal.coe_div, NNReal.coe_one, NNReal.coe_ofNat] using + aDeriv_lipschitz.dist_le_mul s t + +theorem theta_sub_abs_le (s t : ℝ) : |theta s - theta t| ≤ |s - t| := by + simpa only [Real.dist_eq, NNReal.coe_one, one_mul] using theta_lipschitz.dist_le_mul s t + +theorem thetaDeriv_sub_abs_le (s t : ℝ) : + |thetaDeriv s - thetaDeriv t| ≤ |s - t| := by + simpa only [Real.dist_eq, NNReal.coe_one, one_mul] using + thetaDeriv_lipschitz.dist_le_mul s t + +theorem waveDeriv_norm_le_one (z : ℝ) : ‖waveDeriv z‖ ≤ 1 := by + have := waveDeriv_norm_sq z + nlinarith [norm_nonneg (waveDeriv z)] + +theorem v_sub_norm_le_forward (s t : ℝ) : ‖v s - v t‖ ≤ |s - t| := + (wave_sub_norm_le (theta s) (theta t)).trans (theta_sub_abs_le s t) + +theorem v_lipschitz : LipschitzWith 1 v := by + apply LipschitzWith.of_dist_le_mul + intro s t + simpa only [dist_eq_norm, Real.norm_eq_abs, NNReal.coe_one, one_mul] using + v_sub_norm_le_forward s t + +/-- A product difference estimate with the coefficient difference at the first vector. -/ +theorem smul_sub_smul_norm_le (r q : ℝ) (x y : Hilbert) : + ‖r • x - q • y‖ ≤ |r - q| * ‖x‖ + |q| * ‖x - y‖ := by + have he : r • x - q • y = (r - q) • x + q • (x - y) := by + simp only [sub_smul, smul_sub] + abel + rw [he] + simpa only [norm_smul, Real.norm_eq_abs] using + norm_add_le ((r - q) • x) (q • (x - y)) + +/-- The second coefficient in the derivative is nonnegative and uniformly bounded. -/ +theorem angularCoeff_bounds {t : ℝ} (ht : 1 ≤ t) : + 0 ≤ a t * thetaDeriv t ∧ a t * thetaDeriv t ≤ 5 / 16 := by + have ha : 0 ≤ a t := by have := a_lower_of_one_le ht; linarith + constructor + · exact mul_nonneg ha (thetaDeriv_nonneg t) + · exact (mul_le_of_le_one_right ha (thetaDeriv_le t)).trans (a_le_five_sixteenths t) + +theorem angularCoeff_sub_abs_le {s t : ℝ} (_hs : 1 ≤ s) (ht : 1 ≤ t) : + |a s * thetaDeriv s - a t * thetaDeriv t| ≤ (7 / 16) * |s - t| := by + have ha : 0 ≤ a t := by have := a_lower_of_one_le ht; linarith + have he : a s * thetaDeriv s - a t * thetaDeriv t = + (a s - a t) * thetaDeriv s + a t * (thetaDeriv s - thetaDeriv t) := by ring + calc + _ ≤ |a s - a t| * |thetaDeriv s| + |a t| * |thetaDeriv s - thetaDeriv t| := by + rw [he] + simpa only [abs_mul] using + abs_add_le ((a s - a t) * thetaDeriv s) (a t * (thetaDeriv s - thetaDeriv t)) + _ = |a s - a t| * thetaDeriv s + a t * |thetaDeriv s - thetaDeriv t| := by + rw [abs_of_nonneg (thetaDeriv_nonneg s), abs_of_nonneg ha] + _ ≤ ((1 / 8) * |s - t|) * 1 + (5 / 16) * |s - t| := by + apply add_le_add + · exact mul_le_mul (a_sub_abs_le s t) (thetaDeriv_le s) + (thetaDeriv_nonneg s) (mul_nonneg (by norm_num) (abs_nonneg _)) + · exact mul_le_mul (a_le_five_sixteenths t) (thetaDeriv_sub_abs_le s t) + (abs_nonneg _) (by norm_num) + _ = _ := by ring + +/-- A global upper speed bound, including the unbounded negative straight tail. -/ +theorem gammaDeriv_speed_upper (t : ℝ) : ‖gammaDeriv t‖ ≤ 7 / 16 := by + by_cases ht : t ≤ 1 + · rw [gammaDeriv_speed_eq_of_le_one ht] + norm_num + · have hb := angularCoeff_bounds (le_of_not_ge ht) + calc + ‖gammaDeriv t‖ ≤ ‖aDeriv t • v t‖ + + ‖(a t * thetaDeriv t) • waveDeriv (theta t)‖ := norm_add_le _ _ + _ = aDeriv t + (a t * thetaDeriv t) * ‖waveDeriv (theta t)‖ := by + rw [norm_smul, norm_smul, Real.norm_eq_abs, Real.norm_eq_abs, + abs_of_nonneg (aDeriv_nonneg t), abs_of_nonneg hb.1, v_norm, mul_one] + _ ≤ 1 / 8 + 5 / 16 := by + apply add_le_add (aDeriv_le t) + exact (mul_le_of_le_one_right hb.1 (waveDeriv_norm_le_one _)).trans hb.2 + _ = 7 / 16 := by norm_num + +/-- The ordinary mean value estimate applied to the proved derivative. -/ +theorem gamma_sub_norm_le_forward (s t : ℝ) : ‖gamma s - gamma t‖ ≤ (7 / 16) * |s - t| := by + have h : ‖gamma s - gamma t‖ ≤ (7 / 16) * ‖s - t‖ := + Convex.norm_image_sub_le_of_norm_hasDerivWithin_le + (s := (Set.univ : Set ℝ)) (fun x _ => (hasDerivAt_gamma x).hasDerivWithinAt) + (fun x _ => gammaDeriv_speed_upper x) convex_univ (mem_univ t) (mem_univ s) + simpa only [Real.norm_eq_abs] using h + +theorem gamma_lipschitz : LipschitzWith (7 / 16 : ℝ≥0) gamma := by + apply LipschitzWith.of_dist_le_mul + intro s t + simpa only [dist_eq_norm, Real.norm_eq_abs, NNReal.coe_div, NNReal.coe_ofNat] using + gamma_sub_norm_le_forward s t + +/-- On the oscillating tail, product differences give the derivative estimate. -/ +private theorem gammaDeriv_sub_norm_le_tail {s t : ℝ} (hs : 1 ≤ s) (ht : 1 ≤ t) : + ‖gammaDeriv s - gammaDeriv t‖ ≤ |s - t| := by + have hrad := smul_sub_smul_norm_le (aDeriv s) (aDeriv t) (v s) (v t) + rw [v_norm, mul_one, abs_of_nonneg (aDeriv_nonneg t)] at hrad + have hradMul := mul_le_mul (aDeriv_le t) (v_sub_norm_le_forward s t) + (norm_nonneg _) (by norm_num : (0 : ℝ) ≤ 1 / 8) + have hradBound : ‖aDeriv s • v s - aDeriv t • v t‖ ≤ (1 / 4) * |s - t| := by + linarith [aDeriv_sub_abs_le s t] + have hb := angularCoeff_bounds ht + have hwd := (waveDeriv_sub_norm_le (theta s) (theta t)).trans (theta_sub_abs_le s t) + have hm₁ : |a s * thetaDeriv s - a t * thetaDeriv t| * ‖waveDeriv (theta s)‖ ≤ + (7 / 16) * |s - t| := + (mul_le_of_le_one_right (abs_nonneg _) (waveDeriv_norm_le_one _)).trans + (angularCoeff_sub_abs_le hs ht) + have hm₂ := mul_le_mul hb.2 hwd (norm_nonneg _) + (by norm_num : (0 : ℝ) ≤ 5 / 16) + have hang := smul_sub_smul_norm_le (a s * thetaDeriv s) (a t * thetaDeriv t) + (waveDeriv (theta s)) (waveDeriv (theta t)) + rw [abs_of_nonneg hb.1] at hang + have hangBound : ‖(a s * thetaDeriv s) • waveDeriv (theta s) - + (a t * thetaDeriv t) • waveDeriv (theta t)‖ ≤ (3 / 4) * |s - t| := by + linarith + have he : gammaDeriv s - gammaDeriv t = + (aDeriv s • v s - aDeriv t • v t) + + ((a s * thetaDeriv s) • waveDeriv (theta s) - + (a t * thetaDeriv t) • waveDeriv (theta t)) := by + dsimp [gammaDeriv] + abel + rw [he] + exact (norm_add_le _ _).trans (by linarith) + +/-- The constant derivative on the straight tail joins the oscillating estimate at one. -/ +theorem gammaDeriv_sub_norm_le_forward (s t : ℝ) : + ‖gammaDeriv s - gammaDeriv t‖ ≤ |s - t| := by + have hord : ∀ s t : ℝ, s ≤ t → ‖gammaDeriv s - gammaDeriv t‖ ≤ |s - t| := by + intro s t hst + by_cases ht : t ≤ 1 + · rw [gammaDeriv_of_le_one (hst.trans ht), gammaDeriv_of_le_one ht, + sub_self, norm_zero] + exact abs_nonneg _ + · have ht1 : 1 ≤ t := (lt_of_not_ge ht).le + by_cases hs : 1 ≤ s + · exact gammaDeriv_sub_norm_le_tail hs ht1 + · have hs1 : s ≤ 1 := (lt_of_not_ge hs).le + calc + ‖gammaDeriv s - gammaDeriv t‖ = ‖gammaDeriv 1 - gammaDeriv t‖ := by + rw [gammaDeriv_of_le_one hs1, gammaDeriv_of_le_one (le_refl 1)] + _ ≤ |1 - t| := gammaDeriv_sub_norm_le_tail (le_refl 1) ht1 + _ ≤ |s - t| := by + rw [abs_of_nonpos (sub_nonpos.mpr ht1), + abs_of_nonpos (sub_nonpos.mpr hst)] + linarith + rcases le_total s t with hst | hts + · exact hord s t hst + · calc + ‖gammaDeriv s - gammaDeriv t‖ = ‖gammaDeriv t - gammaDeriv s‖ := norm_sub_rev _ _ + _ ≤ |t - s| := hord t s hts + _ = |s - t| := abs_sub_comm _ _ + +theorem gammaDeriv_lipschitz : LipschitzWith 1 gammaDeriv := by + apply LipschitzWith.of_dist_le_mul + intro s t + simpa only [dist_eq_norm, Real.norm_eq_abs, NNReal.coe_one, one_mul] using + gammaDeriv_sub_norm_le_forward s t + +/-- Normalize the actual nonzero tangent using its proved speed lower bound. -/ +theorem u_sub_norm_le_forward (s t : ℝ) : ‖u s - u t‖ ≤ 16 * |s - t| := by + have hn := normalizeNeg_lipschitz (by norm_num : (0 : ℝ) < 1 / 8) + (gammaDeriv_speed_lower s) (gammaDeriv_speed_lower t) + have he : normalizeNeg (gammaDeriv s) - normalizeNeg (gammaDeriv t) = + -(u s - u t) := by simp only [normalizeNeg, u, neg_sub, neg_sub_neg] + rw [he, norm_neg, show (2 / (1 / 8 : ℝ)) = 16 by norm_num] at hn + exact hn.trans (mul_le_mul_of_nonneg_left (gammaDeriv_sub_norm_le_forward s t) + (by norm_num)) + +theorem u_lipschitz : LipschitzWith 16 u := by + apply LipschitzWith.of_dist_le_mul + intro s t + simpa only [dist_eq_norm, Real.norm_eq_abs, NNReal.coe_ofNat] using + u_sub_norm_le_forward s t + +/-- Pairwise estimates with the base parameter first. -/ +theorem v_sub_norm_le (s t : ℝ) : ‖v t - v s‖ ≤ |t - s| := + v_sub_norm_le_forward t s + +theorem gamma_sub_norm_le (s t : ℝ) : ‖gamma t - gamma s‖ ≤ (7 / 16) * |t - s| := + gamma_sub_norm_le_forward t s + +theorem gammaDeriv_sub_norm_le (s t : ℝ) : ‖gammaDeriv t - gammaDeriv s‖ ≤ |t - s| := + gammaDeriv_sub_norm_le_forward t s + +theorem u_sub_norm_le (s t : ℝ) : ‖u t - u s‖ ≤ 16 * |t - s| := + u_sub_norm_le_forward t s + +theorem lipschitzWith_v : LipschitzWith 1 v := v_lipschitz + +theorem lipschitzWith_u : LipschitzWith 16 u := u_lipschitz + +end ThompsonNonamenability.Analytic + +end + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/AnalyticCurveRotation.lean b/lean/OAI/GroupTheory/Thompson/AnalyticCurveRotation.lean new file mode 100644 index 0000000000000000000000000000000000000000..9728c1967fdfccfc9899ad54de6213bace21bda7 --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/AnalyticCurveRotation.lean @@ -0,0 +1,57 @@ +import OAI.GroupTheory.Thompson.AnalyticCurveBounds +import OAI.GroupTheory.Thompson.AnalyticRotation + +namespace OAI + +/-! +# The explicit orthogonal operators along the actual curve +-/ + +noncomputable section + +namespace ThompsonNonamenability.Analytic + +open scoped InnerProductSpace + +def R (t : ℝ) : Hilbert →L[ℝ] Hilbert := rotation (u t) (v t) + +theorem R_apply_u (t : ℝ) : R t (u t) = v t := + rotation_apply_self _ _ (u_norm t) (v_norm t) (u_inner_v_nonneg t) + +theorem R_inner (t : ℝ) (x y : Hilbert) : + inner (𝕜 := ℝ) (R t x) (R t y) = inner (𝕜 := ℝ) x y := + rotation_inner _ _ (u_norm t) (v_norm t) (u_inner_v_nonneg t) x y + +theorem R_norm (t : ℝ) (x : Hilbert) : ‖R t x‖ = ‖x‖ := + rotation_norm _ _ (u_norm t) (v_norm t) (u_inner_v_nonneg t) x + +theorem R_perp (t : ℝ) (e : Hilbert) (he : inner (𝕜 := ℝ) e (u t) = 0) : + inner (𝕜 := ℝ) (R t e) (v t) = 0 := by + rw [← R_apply_u t, R_inner, he] + +theorem R_early {t : ℝ} (ht : t ≤ 1) : R t = ContinuousLinearMap.id ℝ Hilbert := by + rw [R, u_of_le_one ht, rotation_self] + +theorem R_early_apply {t : ℝ} (ht : t ≤ 1) (e : Hilbert) : R t e = e := by + rw [R_early ht] + rfl + +theorem lipschitzWith_R : LipschitzWith 238 R := + rotation_lipschitzWith_238 u v u_norm v_norm u_inner_v_nonneg + lipschitzWith_u lipschitzWith_v + +theorem R_sub_norm_le (s t : ℝ) (e : Hilbert) : + ‖R t e - R s e‖ ≤ 238 * |t - s| * ‖e‖ := by + have hop : ‖R t - R s‖ ≤ 238 * |t - s| := by + simpa [dist_eq_norm, Real.norm_eq_abs] using + lipschitzWith_R.dist_le_mul t s + calc + ‖R t e - R s e‖ = ‖(R t - R s) e‖ := rfl + _ ≤ ‖R t - R s‖ * ‖e‖ := (R t - R s).le_opNorm e + _ ≤ (238 * |t - s|) * ‖e‖ := mul_le_mul_of_nonneg_right hop (norm_nonneg e) + +end ThompsonNonamenability.Analytic + +end + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/AnalyticCurveSeparation.lean b/lean/OAI/GroupTheory/Thompson/AnalyticCurveSeparation.lean new file mode 100644 index 0000000000000000000000000000000000000000..54f5a6ed7f0d6c3e047088e5214ce6002fc96f06 --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/AnalyticCurveSeparation.lean @@ -0,0 +1,114 @@ +import OAI.GroupTheory.Thompson.AnalyticCurve +import OAI.GroupTheory.Thompson.AnalyticSeparation + +namespace OAI + +/-! +# Uniform separation of the actual Hilbert-space curve + +Every premise of the finite-region separation theorem is proved here from the +literal scalar profiles and the oscillator inner-product identity. In +particular no separation or injectivity property of the curve is assumed. +-/ + +noncomputable section + +namespace ThompsonNonamenability.Analytic + +open Set + +theorem gamma_sub_norm_of_le_one (s t : ℝ) (hst : s ≤ t) (ht : t ≤ 1) : + ‖gamma t - gamma s‖ = (t - s) / 8 := by + rw [gamma_of_le_one ht, gamma_of_le_one (hst.trans ht), ← sub_smul, + norm_smul, Real.norm_eq_abs, wave_norm, mul_one] + have hdiv : t / 8 - s / 8 = (t - s) / 8 := by ring + rw [hdiv, abs_of_nonneg (div_nonneg (sub_nonneg.mpr hst) (by norm_num))] + +theorem theta_lt_of_lt_of_one_lt {s t : ℝ} (hst : s < t) (ht : 1 < t) : + theta s < theta t := by + by_cases hs : s ≤ 1 + · have hstrict := theta_strictMonoOn + (show (1 : ℝ) ∈ Ici (1 : ℝ) from le_refl (1 : ℝ)) + (show t ∈ Ici (1 : ℝ) from ht.le) ht + simpa only [theta_of_le_one hs, theta_of_le_one (le_refl (1 : ℝ))] using hstrict + · exact theta_strictMonoOn (le_of_not_ge hs) ht.le hst + +theorem gamma_sub_norm_pos {s t : ℝ} (hst : s < t) : 0 < ‖gamma t - gamma s‖ := by + by_cases ht : t ≤ 1 + · rw [gamma_sub_norm_of_le_one s t hst.le ht] + exact div_pos (sub_pos.mpr hst) (by norm_num) + have ht' : 1 < t := lt_of_not_ge ht + have ha : 0 < a t := by linarith [a_lower_of_one_le ht'.le] + have hgap : 0 < theta t - theta s := sub_pos.mpr (theta_lt_of_lt_of_one_lt hst ht') + have hk : |sinc (theta t - theta s)| < 1 := abs_sinc_lt_one (ne_of_gt hgap) + have hk2 : sinc (theta t - theta s) ^ 2 < 1 := by + have h := (sq_lt_sq₀ (abs_nonneg (sinc (theta t - theta s))) + (by norm_num : (0 : ℝ) ≤ 1)).2 hk + simpa only [sq_abs, one_pow] using h + have hpositive : 0 < (a t) ^ 2 * (1 - sinc (theta t - theta s) ^ 2) := + mul_pos (sq_pos_of_pos ha) (sub_pos.mpr hk2) + have hnonneg := sq_nonneg (a s - a t * sinc (theta t - theta s)) + have hformula := gamma_sub_norm_sq s t + have hsq : 0 < ‖gamma t - gamma s‖ ^ 2 := by nlinarith + exact lt_of_le_of_ne (norm_nonneg _) (Ne.symm (sq_pos_iff.mp hsq)) + +theorem gamma_injective : Function.Injective gamma := by + intro s t heq + by_contra hne + rcases lt_or_gt_of_ne hne with hst | hts + · have hpositive := gamma_sub_norm_pos hst + exact (ne_of_gt hpositive) (by simp only [heq, sub_self, norm_zero]) + · have hpositive := gamma_sub_norm_pos hts + exact (ne_of_gt hpositive) (by simp only [heq, sub_self, norm_zero]) + +theorem gamma_sub_norm_ge_of_far_negative (s t : ℝ) (hs : s ≤ -4) (ht : 1 < t) : + 3 / 16 ≤ ‖gamma t - gamma s‖ := by + have hsbound : (1 / 2 : ℝ) ≤ ‖gamma s‖ := by + rw [gamma_norm, a_of_le_two (by linarith), abs_of_nonpos (by linarith)] + linarith + have htbound : ‖gamma t‖ ≤ 5 / 16 := by + have hapos : 0 ≤ a t := by linarith [a_lower_of_one_le ht.le] + rw [gamma_norm, abs_of_nonneg hapos] + exact a_le_five_sixteenths t + have hreverse : ‖gamma s‖ - ‖gamma t‖ ≤ ‖gamma t - gamma s‖ := by + simpa only [norm_sub_rev] using norm_sub_norm_le (gamma s) (gamma t) + linarith + +theorem gamma_sub_norm_sq_tail (s t : ℝ) (hs : 3 ≤ s) (hst : s ≤ t) : + ‖gamma t - gamma s‖ ^ 2 = 2 * (5 / 16 : ℝ) ^ 2 * (1 - sinc (t - s)) := by + rw [gamma_sub_norm_sq, a_of_three_le hs, a_of_three_le (hs.trans hst), + theta_of_two_le (by linarith : 2 ≤ t), theta_of_two_le (by linarith : 2 ≤ s)] + have hgap : (t - 3 / 2) - (s - 3 / 2) = t - s := by ring + rw [hgap] + ring + +theorem gamma_sub_norm_sq_ge_of_cross_tail (s t : ℝ) (hs : s ≤ 3) (ht : 5 ≤ t) : + 3 * (5 / 16 : ℝ) ^ 2 / 4 ≤ ‖gamma t - gamma s‖ ^ 2 := by + have htheta_s : theta s ≤ 3 / 2 := by + calc + theta s ≤ theta 3 := theta_monotone hs + _ = 3 / 2 := by rw [theta_of_two_le (by norm_num : (2 : ℝ) ≤ 3)]; norm_num + have htheta_t : 7 / 2 ≤ theta t := by + rw [theta_of_two_le (by linarith)] + linarith + have hgap : 2 ≤ theta t - theta s := by linarith + have habs := abs_sinc_le_half_of_two_le hgap + have hklow := (abs_le.mp habs).1 + have hkhi := (abs_le.mp habs).2 + have hproduct : 0 ≤ (sinc (theta t - theta s) + 1 / 2) * + (1 / 2 - sinc (theta t - theta s)) := mul_nonneg (by linarith) (by linarith) + have hk2 : sinc (theta t - theta s) ^ 2 ≤ 1 / 4 := by nlinarith + rw [gamma_sub_norm_sq, a_of_three_le (by linarith : 3 ≤ t)] + nlinarith [sq_nonneg (a s - (5 / 16 : ℝ) * sinc (theta t - theta s))] + +theorem gamma_uniform_separation (d : ℝ) (hd : 0 < d) : + ∃ η : ℝ, 0 < η ∧ ∀ s t : ℝ, d ≤ |t - s| → η ≤ ‖gamma t - gamma s‖ := + uniform_separation_of_five_regions gamma continuous_gamma gamma_injective + gamma_sub_norm_of_le_one gamma_sub_norm_ge_of_far_negative gamma_sub_norm_sq_tail + gamma_sub_norm_sq_ge_of_cross_tail d hd + +end ThompsonNonamenability.Analytic + +end + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/AnalyticCutoffs.lean b/lean/OAI/GroupTheory/Thompson/AnalyticCutoffs.lean new file mode 100644 index 0000000000000000000000000000000000000000..788a2a7686ab993f83c95a087575d282db78739b --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/AnalyticCutoffs.lean @@ -0,0 +1,120 @@ +import Mathlib.Basic.Real.Basic +import Mathlib.Algebra.Order.Group.MinMax +import Mathlib.Tactic.FieldSimp +import Mathlib.Tactic.Linarith +import Mathlib.Tactic.NormNum +import Mathlib.Tactic.Ring + +namespace OAI + +/-! +# Scalar cutoffs for the Hilbert displacement construction + +The inner cutoff `beta` is one through radius `ρ / 4` and vanishes from +`ρ / 2`. The outer cutoff `chi` is one through radius `ρ / 2` and vanishes +from `ρ`. Both formulas take values in `[0, 1]` even outside this domain. +-/ + +noncomputable section + +namespace ThompsonNonamenability.Analytic + +/-- The cutoff supported inside the half-radius ball. -/ +def beta (ρ r : ℝ) : ℝ := min 1 (max 0 (2 - 4 * r / ρ)) + +/-- The cutoff supported inside the full-radius ball. -/ +def chi (ρ r : ℝ) : ℝ := min 1 (max 0 (2 - 2 * r / ρ)) + +theorem beta_nonneg (ρ r : ℝ) : 0 ≤ beta ρ r := + le_min zero_le_one (le_max_left _ _) + +theorem beta_le_one (ρ r : ℝ) : beta ρ r ≤ 1 := + min_le_left _ _ + +theorem chi_nonneg (ρ r : ℝ) : 0 ≤ chi ρ r := + le_min zero_le_one (le_max_left _ _) + +theorem chi_le_one (ρ r : ℝ) : chi ρ r ≤ 1 := + min_le_left _ _ + +theorem beta_eq_one {ρ : ℝ} (hρ : 0 < ρ) (r : ℝ) (hr : r ≤ ρ / 4) : + beta ρ r = 1 := by + have hdiv : 4 * r / ρ ≤ 1 := (div_le_iff₀ hρ).2 (by nlinarith) + have harg : 1 ≤ 2 - 4 * r / ρ := by linarith + exact min_eq_left (harg.trans (le_max_right _ _)) + +theorem beta_eq_zero {ρ : ℝ} (hρ : 0 < ρ) (r : ℝ) (hr : ρ / 2 ≤ r) : + beta ρ r = 0 := by + have hdiv : 2 ≤ 4 * r / ρ := (le_div_iff₀ hρ).2 (by nlinarith) + have harg : 2 - 4 * r / ρ ≤ 0 := by linarith + simp only [beta, max_eq_left harg, min_eq_right zero_le_one] + +theorem chi_eq_one {ρ : ℝ} (hρ : 0 < ρ) (r : ℝ) (hr : r ≤ ρ / 2) : + chi ρ r = 1 := by + have hdiv : 2 * r / ρ ≤ 1 := (div_le_iff₀ hρ).2 (by nlinarith) + have harg : 1 ≤ 2 - 2 * r / ρ := by linarith + exact min_eq_left (harg.trans (le_max_right _ _)) + +theorem chi_eq_zero {ρ : ℝ} (hρ : 0 < ρ) (r : ℝ) (hr : ρ ≤ r) : + chi ρ r = 0 := by + have hdiv : 2 ≤ 2 * r / ρ := (le_div_iff₀ hρ).2 (by nlinarith) + have harg : 2 - 2 * r / ρ ≤ 0 := by linarith + simp only [chi, max_eq_left harg, min_eq_right zero_le_one] + +private theorem clamp_abs_sub_le (x y : ℝ) : + |min 1 (max 0 x) - min 1 (max 0 y)| ≤ |x - y| := by + have hmin : |min 1 (max 0 x) - min 1 (max 0 y)| ≤ + |max 0 x - max 0 y| := by + simpa only [sub_self, abs_zero, max_eq_right (abs_nonneg (max (0 : ℝ) x - max 0 y))] using + abs_min_sub_min_le_max (1 : ℝ) (max 0 x) 1 (max 0 y) + have hmax : |max 0 x - max 0 y| ≤ |x - y| := by + rw [max_comm 0 x, max_comm 0 y] + exact abs_max_sub_max_le_abs x y 0 + exact hmin.trans hmax + +theorem beta_abs_sub_le {ρ : ℝ} (hρ : 0 < ρ) (r s : ℝ) : + |beta ρ r - beta ρ s| ≤ (4 / ρ) * |r - s| := by + have h := clamp_abs_sub_le (2 - 4 * r / ρ) (2 - 4 * s / ρ) + have heq : (2 - 4 * r / ρ) - (2 - 4 * s / ρ) = + -(4 / ρ * (r - s)) := by ring + have hc : 0 ≤ (4 : ℝ) / ρ := div_nonneg (by norm_num) hρ.le + rw [heq, abs_neg, abs_mul, abs_of_nonneg hc] at h + exact h + +theorem chi_abs_sub_le {ρ : ℝ} (hρ : 0 < ρ) (r s : ℝ) : + |chi ρ r - chi ρ s| ≤ (2 / ρ) * |r - s| := by + have h := clamp_abs_sub_le (2 - 2 * r / ρ) (2 - 2 * s / ρ) + have heq : (2 - 2 * r / ρ) - (2 - 2 * s / ρ) = + -(2 / ρ * (r - s)) := by ring + have hc : 0 ≤ (2 : ℝ) / ρ := div_nonneg (by norm_num) hρ.le + rw [heq, abs_neg, abs_mul, abs_of_nonneg hc] at h + exact h + +theorem beta_le_chi {ρ : ℝ} (hρ : 0 < ρ) (r : ℝ) (hr : 0 ≤ r) : + beta ρ r ≤ chi ρ r := by + have hrdiv : 0 ≤ r / ρ := div_nonneg hr hρ.le + have harg : 2 - 4 * r / ρ ≤ 2 - 2 * r / ρ := by + simp only [mul_div_assoc] + linarith + exact min_le_min_left 1 (max_le_max_left 0 harg) + +theorem chi_le_tail {ρ : ℝ} (hρ : 0 < ρ) (r : ℝ) (_hr : 0 ≤ r) (hrρ : r ≤ ρ) : + chi ρ r ≤ 2 * (ρ - r) / ρ := by + have hdiv : 2 * r / ρ ≤ 2 := (div_le_iff₀ hρ).2 (by nlinarith) + have harg : 0 ≤ 2 - 2 * r / ρ := by linarith + calc + chi ρ r ≤ 2 - 2 * r / ρ := by + simp only [chi, max_eq_right harg] + exact min_le_right _ _ + _ = 2 * (ρ - r) / ρ := by + field_simp [ne_of_gt hρ] + +theorem beta_le_tail {ρ : ℝ} (hρ : 0 < ρ) (r : ℝ) (hr : 0 ≤ r) (hrρ : r ≤ ρ) : + beta ρ r ≤ 2 * (ρ - r) / ρ := + (beta_le_chi hρ r hr).trans (chi_le_tail hρ r hr hrρ) + +end ThompsonNonamenability.Analytic + +end + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/AnalyticLpCalculus.lean b/lean/OAI/GroupTheory/Thompson/AnalyticLpCalculus.lean new file mode 100644 index 0000000000000000000000000000000000000000..8b20b12f1f656ffe17da498acfab2e7c97fdc127 --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/AnalyticLpCalculus.lean @@ -0,0 +1,66 @@ +import OAI.GroupTheory.Thompson.AnalyticModel +import Mathlib.Analysis.Calculus.Deriv.Basic + +namespace OAI + +/-! +# Uniform estimates in the concrete Hilbert space + +The restricted Lebesgue measure has mass one. Consequently, an almost-everywhere +uniform bound on a representative gives the same bound on its `L²` norm. +The derivative criterion below turns a quadratic norm remainder into a genuine +derivative in any real normed space, including this Hilbert space. +-/ + +noncomputable section + +universe uE + +namespace ThompsonNonamenability.Analytic + +open MeasureTheory Set Filter +open scoped Topology Asymptotics ENNReal + +@[simp] theorem intervalMeasure_univ : intervalMeasure univ = 1 := by + simp [intervalMeasure, Real.volume_Icc] + +/-- A uniform bound on an almost-everywhere representative bounds the Hilbert norm. -/ +theorem norm_le_of_ae_bound (f : Hilbert) {C : ℝ} (hC : 0 ≤ C) + (hbound : ∀ᵐ x ∂intervalMeasure, ‖f x‖ ≤ C) : ‖f‖ ≤ C := by + rw [Lp.norm_def] + have h : eLpNorm f 2 intervalMeasure ≤ ENNReal.ofReal C := by + simpa only [intervalMeasure_univ, ENNReal.one_rpow, one_mul] using + (eLpNorm_le_of_ae_bound (p := (2 : ℝ≥0∞)) (Lp.aestronglyMeasurable f) hbound) + exact (ENNReal.toReal_mono ENNReal.ofReal_ne_top h).trans_eq + (ENNReal.toReal_ofReal hC) + +/-- The same estimate for an explicitly supplied square-integrable function. -/ +theorem norm_toLp_le {f : ℝ → Plane} (hf : MemLp f 2 intervalMeasure) + {C : ℝ} (hC : 0 ≤ C) (hbound : ∀ᵐ x ∂intervalMeasure, ‖f x‖ ≤ C) : + ‖hf.toLp f‖ ≤ C := by + apply norm_le_of_ae_bound (hf.toLp f) hC + filter_upwards [hf.coeFn_toLp, hbound] with x hx hxbound + simpa only [hx] using hxbound + +/-- A quadratic norm remainder implies differentiability, without any pointwise +choice of representatives in the codomain. -/ +theorem hasDerivAt_of_quadratic_remainder + {E : Type uE} [NormedAddCommGroup E] [NormedSpace ℝ E] + {f : ℝ → E} {f' : E} {x C : ℝ} + (hrem : ∀ᶠ h in 𝓝 (0 : ℝ), + ‖f (x + h) - f x - h • f'‖ ≤ C * |h| ^ 2) : + HasDerivAt f f' x := by + apply hasDerivAt_iff_isLittleO_nhds_zero.mpr + have hO : + (fun h : ℝ => f (x + h) - f x - h • f') =O[𝓝 0] + (fun h : ℝ => h ^ 2) := by + apply Asymptotics.IsBigO.of_bound C + simpa only [norm_pow, Real.norm_eq_abs] using hrem + exact hO.trans_isLittleO + (Asymptotics.isLittleO_pow_id (n := 2) (by decide)) + +end ThompsonNonamenability.Analytic + +end + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/AnalyticModel.lean b/lean/OAI/GroupTheory/Thompson/AnalyticModel.lean new file mode 100644 index 0000000000000000000000000000000000000000..bd7190cb7b3c6cb400917c0a4b999cd6009e814d --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/AnalyticModel.lean @@ -0,0 +1,26 @@ +import OAI.GroupTheory.Thompson.UnitBall +import Mathlib.Analysis.InnerProductSpace.PiL2 +import Mathlib.MeasureTheory.Function.L2Space +import Mathlib.MeasureTheory.Measure.Lebesgue.Basic + +namespace OAI + +noncomputable section + +namespace ThompsonNonamenability.Analytic + +open MeasureTheory Set + +abbrev Plane := EuclideanSpace ℝ (Fin 2) + +abbrev intervalMeasure : Measure ℝ := volume.restrict (Icc (0 : ℝ) 1) + +abbrev Hilbert := Lp Plane 2 intervalMeasure + +abbrev Ball := UnitBall Hilbert + +end ThompsonNonamenability.Analytic + +end + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/AnalyticNormalization.lean b/lean/OAI/GroupTheory/Thompson/AnalyticNormalization.lean new file mode 100644 index 0000000000000000000000000000000000000000..93ae61f1958fd2449618f10bca097fdb5a1d4657 --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/AnalyticNormalization.lean @@ -0,0 +1,120 @@ +import OAI.GroupTheory.Thompson.UnitBall +import Mathlib.Tactic.Abel +import Mathlib.Tactic.FieldSimp +import Mathlib.Tactic.Linarith +import Mathlib.Tactic.Ring + +namespace OAI + +noncomputable section + +universe uE + +namespace ThompsonNonamenability.Analytic + +variable {E : Type uE} [NormedAddCommGroup E] [NormedSpace ℝ E] + +/-- Negative radial normalization, with the field's usual value at zero. -/ +def normalizeNeg (z : E) : E := -(‖z‖⁻¹ • z) + +theorem norm_normalizeNeg {z : E} (hz : z ≠ 0) : ‖normalizeNeg z‖ = 1 := by + have hn : ‖z‖ ≠ 0 := norm_ne_zero_iff.mpr hz + rw [normalizeNeg, norm_neg, norm_smul, Real.norm_eq_abs, + abs_of_nonneg (inv_nonneg.mpr (norm_nonneg z)), inv_mul_cancel₀ hn] + +/-- A scalar identity used to avoid any estimate depending on the larger norm. -/ +private theorem abs_inv_sub_mul {a b : ℝ} (ha : 0 < a) (hb : 0 < b) : + |a⁻¹ - b⁻¹| * b = |b - a| / a := by + have hdiff : a⁻¹ - b⁻¹ = (b - a) / (a * b) := by + field_simp [ha.ne', hb.ne'] + rw [hdiff, abs_div, abs_mul, abs_of_pos ha, abs_of_pos hb] + field_simp [ha.ne', hb.ne'] + +/-- Radial normalization is `2 / ε`-Lipschitz where the norm is at least `ε`. -/ +theorem normalizeNeg_lipschitz {ε : ℝ} (hε : 0 < ε) {x y : E} + (hx : ε ≤ ‖x‖) (hy : ε ≤ ‖y‖) : + ‖normalizeNeg x - normalizeNeg y‖ ≤ (2 / ε) * ‖x - y‖ := by + have hxp : 0 < ‖x‖ := hε.trans_le hx + have hyp : 0 < ‖y‖ := hε.trans_le hy + have hdecomp : ‖x‖⁻¹ • x - ‖y‖⁻¹ • y = + ‖x‖⁻¹ • (x - y) + (‖x‖⁻¹ - ‖y‖⁻¹) • y := by + simp only [smul_sub, sub_smul] + abel + have hneg : normalizeNeg x - normalizeNeg y = + -(‖x‖⁻¹ • x - ‖y‖⁻¹ • y) := by + simp only [normalizeNeg, neg_sub] + abel + calc + ‖normalizeNeg x - normalizeNeg y‖ = + ‖‖x‖⁻¹ • x - ‖y‖⁻¹ • y‖ := by rw [hneg, norm_neg] + _ ≤ ‖‖x‖⁻¹ • (x - y)‖ + ‖(‖x‖⁻¹ - ‖y‖⁻¹) • y‖ := by + rw [hdecomp] + exact norm_add_le _ _ + _ = ‖x‖⁻¹ * ‖x - y‖ + |‖y‖ - ‖x‖| / ‖x‖ := by + rw [norm_smul, norm_smul, Real.norm_eq_abs, Real.norm_eq_abs, + abs_of_pos (inv_pos.mpr hxp), abs_inv_sub_mul hxp hyp] + _ ≤ ‖x‖⁻¹ * ‖x - y‖ + ‖x - y‖ / ‖x‖ := by + apply add_le_add le_rfl + exact div_le_div_of_nonneg_right + (by simpa only [norm_sub_rev] using abs_norm_sub_norm_le y x) (norm_nonneg x) + _ = (2 / ‖x‖) * ‖x - y‖ := by ring + _ ≤ (2 / ε) * ‖x - y‖ := + mul_le_mul_of_nonneg_right + (div_le_div_of_nonneg_left (by norm_num) hε hx) (norm_nonneg _) + +/-- Normalize the given nonvanishing map and retain the closed-ball carrier. -/ +def normalizedMap (G : UnitBall E → E) {ε : ℝ} (hε : 0 < ε) + (hLower : ∀ x, ε ≤ ‖G x‖) : UnitBall E → UnitBall E := + fun x => ⟨normalizeNeg (G x), le_of_eq (norm_normalizeNeg + (norm_pos_iff.mp (hε.trans_le (hLower x))))⟩ + +@[simp] theorem coe_normalizedMap (G : UnitBall E → E) {ε : ℝ} (hε : 0 < ε) + (hLower : ∀ x, ε ≤ ‖G x‖) (x : UnitBall E) : + (normalizedMap G hε hLower x : E) = normalizeNeg (G x) := rfl + +theorem norm_normalizedMap (G : UnitBall E → E) {ε : ℝ} (hε : 0 < ε) + (hLower : ∀ x, ε ≤ ‖G x‖) (x : UnitBall E) : + ‖(normalizedMap G hε hLower x : E)‖ = 1 := + norm_normalizeNeg (norm_pos_iff.mp (hε.trans_le (hLower x))) + +/-- The outer identity and unit normalization give a displacement of at least `1/2`. -/ +theorem normalizedMap_displacement (G : UnitBall E → E) {ε : ℝ} (hε : 0 < ε) + (hLower : ∀ x, ε ≤ ‖G x‖) + (hOuter : ∀ x : UnitBall E, (1 / 2 : ℝ) ≤ ‖(x : E)‖ → G x = (x : E)) + (x : UnitBall E) : + (1 / 2 : ℝ) ≤ ‖(normalizedMap G hε hLower x : E) - (x : E)‖ := by + by_cases hx : (1 / 2 : ℝ) ≤ ‖(x : E)‖ + · have hxp : 0 < ‖(x : E)‖ := by linarith + have hi : 0 ≤ ‖(x : E)‖⁻¹ + 1 := by + have := inv_nonneg.mpr (norm_nonneg (x : E)) + linarith + have heq : normalizeNeg (x : E) - (x : E) = + -((‖(x : E)‖⁻¹ + 1) • (x : E)) := by + simp only [normalizeNeg, add_smul, one_smul, neg_add_rev] + abel + rw [coe_normalizedMap, hOuter x hx, heq, norm_neg, norm_smul, + Real.norm_eq_abs, abs_of_nonneg hi, add_mul, one_mul, + inv_mul_cancel₀ hxp.ne'] + linarith + · have hrev := norm_sub_norm_le (normalizedMap G hε hLower x : E) (x : E) + rw [norm_normalizedMap] at hrev + linarith + +/-- The concrete normalized map inherits the advertised Lipschitz estimate. -/ +theorem normalizedMap_lipschitz (G : UnitBall E → E) {ε C : ℝ} (hε : 0 < ε) + (hLower : ∀ x, ε ≤ ‖G x‖) + (hLip : ∀ x y : UnitBall E, ‖G x - G y‖ ≤ C * ‖(x : E) - (y : E)‖) + (x y : UnitBall E) : + ‖(normalizedMap G hε hLower x : E) - (normalizedMap G hε hLower y : E)‖ ≤ + (2 * C / ε) * ‖(x : E) - (y : E)‖ := by + calc + _ ≤ (2 / ε) * ‖G x - G y‖ := normalizeNeg_lipschitz hε (hLower x) (hLower y) + _ ≤ (2 / ε) * (C * ‖(x : E) - (y : E)‖) := + mul_le_mul_of_nonneg_left (hLip x y) (div_nonneg (by norm_num) hε.le) + _ = _ := by ring + +end ThompsonNonamenability.Analytic + +end + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/AnalyticOscillator.lean b/lean/OAI/GroupTheory/Thompson/AnalyticOscillator.lean new file mode 100644 index 0000000000000000000000000000000000000000..db68c20084a3176f99890b010ac74b27807852b8 --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/AnalyticOscillator.lean @@ -0,0 +1,203 @@ +import OAI.GroupTheory.Thompson.AnalyticPlaneOscillator +import OAI.GroupTheory.Thompson.AnalyticLpCalculus +import OAI.GroupTheory.Thompson.AnalyticSinc +import Mathlib.Analysis.SpecialFunctions.Integrals.Basic + +namespace OAI + +/-! +# The concrete square-integrable oscillator + +The representatives are `(cos (z*w), sin (z*w))` and its parameter +derivative `w * (-sin (z*w), cos (z*w))`. Every passage from a +representative to an `Lp` element uses an almost-everywhere equality. +-/ + +noncomputable section + +namespace ThompsonNonamenability.Analytic + +open MeasureTheory Set Filter +open scoped Topology + +def waveRep (z w : ℝ) : Plane := planeWave (z * w) + +def waveDerivRep (z w : ℝ) : Plane := w • planeDeriv (z * w) + +theorem continuous_waveRep (z : ℝ) : Continuous (waveRep z) := + continuous_planeWave.comp (continuous_const.mul continuous_id) + +theorem continuous_waveDerivRep (z : ℝ) : Continuous (waveDerivRep z) := + continuous_id.smul + (continuous_planeDeriv.comp (continuous_const.mul continuous_id)) + +theorem waveRep_norm (z w : ℝ) : ‖waveRep z w‖ = 1 := + planeWave_norm _ + +theorem waveDerivRep_norm (z w : ℝ) : ‖waveDerivRep z w‖ = |w| := by + simp [waveDerivRep, norm_smul, planeDeriv_norm, Real.norm_eq_abs] + +theorem waveRep_memLp (z : ℝ) : MemLp (waveRep z) 2 intervalMeasure := by + apply MemLp.of_bound (continuous_waveRep z).aestronglyMeasurable 1 + exact ae_of_all _ fun w => le_of_eq (waveRep_norm z w) + +theorem waveDerivRep_memLp (z : ℝ) : MemLp (waveDerivRep z) 2 intervalMeasure := by + apply MemLp.of_bound (continuous_waveDerivRep z).aestronglyMeasurable 1 + filter_upwards [ae_restrict_mem measurableSet_Icc] with w hw + rw [waveDerivRep_norm, abs_of_nonneg hw.1] + exact hw.2 + +/-- The oscillator as an actual equivalence class in `L²([0,1]; ℝ²)`. -/ +def wave (z : ℝ) : Hilbert := (waveRep_memLp z).toLp (waveRep z) + +/-- The proposed derivative, independently defined from its concrete representative. -/ +def waveDeriv (z : ℝ) : Hilbert := + (waveDerivRep_memLp z).toLp (waveDerivRep z) + +theorem wave_coeFn (z : ℝ) : ⇑(wave z) =ᵐ[intervalMeasure] waveRep z := + (waveRep_memLp z).coeFn_toLp + +theorem waveDeriv_coeFn (z : ℝ) : ⇑(waveDeriv z) =ᵐ[intervalMeasure] waveDerivRep z := + (waveDerivRep_memLp z).coeFn_toLp + +theorem integral_intervalMeasure (f : ℝ → ℝ) : + (∫ w, f w ∂intervalMeasure) = ∫ w in (0 : ℝ)..1, f w := by + change (∫ w in Icc (0 : ℝ) 1, f w) = _ + rw [integral_Icc_eq_integral_Ioc, intervalIntegral.integral_of_le (by norm_num)] + +theorem integral_cos_intervalMeasure (q : ℝ) : + (∫ w, Real.cos (q * w) ∂intervalMeasure) = sinc q := by + rw [integral_intervalMeasure] + by_cases hq : q = 0 + · simp [hq, sinc_zero] + · rw [sinc_of_ne_zero hq, intervalIntegral.integral_comp_mul_left _ hq, + _root_.integral_cos] + simp [div_eq_mul_inv, mul_comm] + +theorem wave_inner (s t : ℝ) : inner (𝕜 := ℝ) (wave s) (wave t) = sinc (t - s) := by + rw [L2.inner_def] + calc + (∫ w, inner (𝕜 := ℝ) (wave s w) (wave t w) ∂intervalMeasure) = + ∫ w, Real.cos ((t - s) * w) ∂intervalMeasure := by + apply integral_congr_ae + filter_upwards [wave_coeFn s, wave_coeFn t] with w hs ht + rw [hs, ht] + change inner (𝕜 := ℝ) (planeWave (s * w)) (planeWave (t * w)) = + Real.cos ((t - s) * w) + rw [planeWave_inner] + congr 1 + ring + _ = sinc (t - s) := integral_cos_intervalMeasure _ + +theorem wave_norm (z : ℝ) : ‖wave z‖ = 1 := by + have h := wave_inner z z + rw [real_inner_self_eq_norm_sq] at h + simp only [sub_self, sinc_zero] at h + nlinarith [norm_nonneg (wave z)] + +theorem waveDeriv_norm_sq (z : ℝ) : ‖waveDeriv z‖ ^ 2 = 1 / 3 := by + rw [← real_inner_self_eq_norm_sq, L2.inner_def] + calc + (∫ w, inner (𝕜 := ℝ) (waveDeriv z w) (waveDeriv z w) ∂intervalMeasure) = + ∫ w, w ^ 2 ∂intervalMeasure := by + apply integral_congr_ae + filter_upwards [waveDeriv_coeFn z] with w hw + rw [hw, real_inner_self_eq_norm_sq, waveDerivRep_norm, sq_abs] + _ = 1 / 3 := by rw [integral_intervalMeasure, _root_.integral_pow]; norm_num + +theorem wave_inner_waveDeriv (z : ℝ) : inner (𝕜 := ℝ) (wave z) (waveDeriv z) = 0 := by + rw [L2.inner_def] + calc + (∫ w, inner (𝕜 := ℝ) (wave z w) (waveDeriv z w) ∂intervalMeasure) = + ∫ _w : ℝ, (0 : ℝ) ∂intervalMeasure := by + apply integral_congr_ae + filter_upwards [wave_coeFn z, waveDeriv_coeFn z] with w hw hd + rw [hw, hd] + change inner (𝕜 := ℝ) (planeWave (z * w)) (w • planeDeriv (z * w)) = 0 + rw [real_inner_smul_right, planeWave_inner_planeDeriv, mul_zero] + _ = 0 := integral_zero _ _ + +theorem waveRep_sub_norm_le (s t w : ℝ) (hw : w ∈ Icc (0 : ℝ) 1) : + ‖waveRep s w - waveRep t w‖ ≤ |s - t| := by + calc + ‖waveRep s w - waveRep t w‖ ≤ |s * w - t * w| := + planeWave_sub_norm_le _ _ + _ = |s - t| * w := by rw [← sub_mul, abs_mul, abs_of_nonneg hw.1] + _ ≤ |s - t| := mul_le_of_le_one_right (abs_nonneg _) hw.2 + +theorem waveDerivRep_sub_norm_le (s t w : ℝ) (hw : w ∈ Icc (0 : ℝ) 1) : + ‖waveDerivRep s w - waveDerivRep t w‖ ≤ |s - t| := by + have hw2 : w * w ≤ 1 := (mul_le_of_le_one_right hw.1 hw.2).trans hw.2 + calc + ‖waveDerivRep s w - waveDerivRep t w‖ = + w * ‖planeDeriv (s * w) - planeDeriv (t * w)‖ := by + rw [waveDerivRep, waveDerivRep, ← smul_sub, norm_smul, + Real.norm_eq_abs, abs_of_nonneg hw.1] + _ ≤ w * |s * w - t * w| := + mul_le_mul_of_nonneg_left (planeDeriv_sub_norm_le _ _) hw.1 + _ = |s - t| * (w * w) := by + rw [← sub_mul, abs_mul, abs_of_nonneg hw.1] + ring + _ ≤ |s - t| := mul_le_of_le_one_right (abs_nonneg _) hw2 + +theorem wave_sub_norm_le (s t : ℝ) : ‖wave s - wave t‖ ≤ |s - t| := by + apply norm_le_of_ae_bound _ (abs_nonneg _) + filter_upwards [Lp.coeFn_sub (wave s) (wave t), wave_coeFn s, wave_coeFn t, + ae_restrict_mem measurableSet_Icc] with w hsub hs ht hw + simpa only [hsub, Pi.sub_apply, hs, ht] using waveRep_sub_norm_le s t w hw + +theorem waveDeriv_sub_norm_le (s t : ℝ) : + ‖waveDeriv s - waveDeriv t‖ ≤ |s - t| := by + apply norm_le_of_ae_bound _ (abs_nonneg _) + filter_upwards [Lp.coeFn_sub (waveDeriv s) (waveDeriv t), waveDeriv_coeFn s, + waveDeriv_coeFn t, ae_restrict_mem measurableSet_Icc] with w hsub hs ht hw + simpa only [hsub, Pi.sub_apply, hs, ht] using waveDerivRep_sub_norm_le s t w hw + +theorem waveRep_remainder (z h w : ℝ) (hw : w ∈ Icc (0 : ℝ) 1) : + ‖waveRep (z + h) w - waveRep z w - h • waveDerivRep z w‖ ≤ |h| ^ 2 := by + have hscalar : (z + h) * w - z * w = h * w := by ring + have hrem := planeWave_remainder (z * w) ((z + h) * w) + rw [hscalar] at hrem + have hw2 : w ^ 2 ≤ 1 := by nlinarith [mul_nonneg hw.1 (sub_nonneg.mpr hw.2)] + calc + ‖waveRep (z + h) w - waveRep z w - h • waveDerivRep z w‖ = + ‖planeWave ((z + h) * w) - planeWave (z * w) - + (h * w) • planeDeriv (z * w)‖ := by + simp only [waveRep, waveDerivRep, mul_smul] + _ ≤ |h * w| ^ 2 := hrem + _ = |h| ^ 2 * w ^ 2 := by simp only [abs_mul, mul_pow, sq_abs] + _ ≤ |h| ^ 2 := mul_le_of_le_one_right (sq_nonneg _) hw2 + +theorem wave_remainder (z h : ℝ) : + ‖wave (z + h) - wave z - h • waveDeriv z‖ ≤ |h| ^ 2 := by + apply norm_le_of_ae_bound _ (sq_nonneg _) + filter_upwards + [Lp.coeFn_sub (wave (z + h) - wave z) (h • waveDeriv z), + Lp.coeFn_sub (wave (z + h)) (wave z), Lp.coeFn_smul h (waveDeriv z), + wave_coeFn (z + h), wave_coeFn z, waveDeriv_coeFn z, + ae_restrict_mem measurableSet_Icc] with w ho hi hm hh hz hd hw + simpa only [ho, hi, hm, Pi.sub_apply, Pi.smul_apply, hh, hz, hd] using + waveRep_remainder z h w hw + +theorem hasDerivAt_wave (z : ℝ) : HasDerivAt wave (waveDeriv z) z := by + apply hasDerivAt_of_quadratic_remainder (C := 1) + exact Eventually.of_forall fun h => by simpa using wave_remainder z h + +theorem continuous_wave : Continuous wave := + Differentiable.continuous (𝕜 := ℝ) (fun z => (hasDerivAt_wave z).differentiableAt) + +theorem lipschitzWith_wave : LipschitzWith 1 wave := by + refine LipschitzWith.of_dist_le_mul fun s t => ?_ + simpa [dist_eq_norm, Real.norm_eq_abs] using wave_sub_norm_le s t + +theorem lipschitzWith_waveDeriv : LipschitzWith 1 waveDeriv := by + refine LipschitzWith.of_dist_le_mul fun s t => ?_ + simpa [dist_eq_norm, Real.norm_eq_abs] using waveDeriv_sub_norm_le s t + +theorem continuous_waveDeriv : Continuous waveDeriv := lipschitzWith_waveDeriv.continuous + +end ThompsonNonamenability.Analytic + +end + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/AnalyticPlaneOscillator.lean b/lean/OAI/GroupTheory/Thompson/AnalyticPlaneOscillator.lean new file mode 100644 index 0000000000000000000000000000000000000000..58481a24f9e54d452e249cc192b69c63d69c7551 --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/AnalyticPlaneOscillator.lean @@ -0,0 +1,116 @@ +import OAI.GroupTheory.Thompson.AnalyticModel +import Mathlib.Analysis.SpecialFunctions.Trigonometric.Deriv +import Mathlib.Analysis.Calculus.Deriv.Prod +import Mathlib.Analysis.Calculus.MeanValue +import Mathlib.Tactic.FinCases + +namespace OAI + +/-! +# The Euclidean planar oscillator + +The ordinary sine/cosine circle and its tangent have unit Euclidean norm. +The derivative of the tangent is the negative circle vector. The mean value +inequality therefore gives Lipschitz constant one for both functions, and a +quadratic first-order remainder estimate with constant one. +-/ + +noncomputable section + +namespace ThompsonNonamenability.Analytic + +open Set +open scoped InnerProductSpace + +def planeWave (z : ℝ) : Plane := !₂[Real.cos z, Real.sin z] + +def planeDeriv (z : ℝ) : Plane := !₂[-Real.sin z, Real.cos z] + +@[simp] theorem planeWave_norm (z : ℝ) : ‖planeWave z‖ = 1 := by + simp [planeWave, EuclideanSpace.norm_eq, Fin.sum_univ_two, + Real.norm_eq_abs, sq_abs, Real.cos_sq_add_sin_sq] + +@[simp] theorem planeDeriv_norm (z : ℝ) : ‖planeDeriv z‖ = 1 := by + simp [planeDeriv, EuclideanSpace.norm_eq, Fin.sum_univ_two, + Real.norm_eq_abs, sq_abs, Real.sin_sq_add_cos_sq] + +theorem planeWave_inner_planeDeriv (z : ℝ) : + ⟪planeWave z, planeDeriv z⟫_ℝ = 0 := by + simp [planeWave, planeDeriv, PiLp.inner_apply, Fin.sum_univ_two, + RCLike.inner_apply, mul_comm] + +theorem planeWave_inner (s t : ℝ) : + ⟪planeWave s, planeWave t⟫_ℝ = Real.cos (t - s) := by + simp [planeWave, PiLp.inner_apply, Fin.sum_univ_two, RCLike.inner_apply, + Real.cos_sub] + +private theorem hasDerivAt_planePair {f g : ℝ → ℝ} {f' g' z : ℝ} + (hf : HasDerivAt f f' z) (hg : HasDerivAt g g' z) : + HasDerivAt (fun x => (!₂[f x, g x] : Plane)) (!₂[f', g'] : Plane) z := by + have h : HasDerivAt (fun x => (![f x, g x] : Fin 2 → ℝ)) ![f', g'] z := by + apply hasDerivAt_pi.mpr + intro i + fin_cases i + · simpa using hf + · simpa using hg + exact (EuclideanSpace.equiv (Fin 2) ℝ).symm.toContinuousLinearMap.hasFDerivAt.comp_hasDerivAt z h + +theorem hasDerivAt_planeWave (z : ℝ) : + HasDerivAt planeWave (planeDeriv z) z := + hasDerivAt_planePair (Real.hasDerivAt_cos z) (Real.hasDerivAt_sin z) + +theorem hasDerivAt_planeDeriv (z : ℝ) : + HasDerivAt planeDeriv (-planeWave z) z := by + have h := hasDerivAt_planePair (Real.hasDerivAt_sin z).neg (Real.hasDerivAt_cos z) + have he : (!₂[-Real.cos z, -Real.sin z] : Plane) = -planeWave z := by + ext i + fin_cases i <;> simp [planeWave] + rw [he] at h + exact h + +theorem continuous_planeWave : Continuous planeWave := + Differentiable.continuous (fun z => (hasDerivAt_planeWave z).differentiableAt) + +theorem continuous_planeDeriv : Continuous planeDeriv := + Differentiable.continuous (fun z => (hasDerivAt_planeDeriv z).differentiableAt) + +theorem planeWave_sub_norm_le (s t : ℝ) : + ‖planeWave s - planeWave t‖ ≤ |s - t| := by + have h := Convex.norm_image_sub_le_of_norm_hasDerivWithin_le + (f := planeWave) (f' := planeDeriv) (C := 1) + (fun x (_ : x ∈ (Set.univ : Set ℝ)) => + (hasDerivAt_planeWave x).hasDerivWithinAt) + (fun x _ => le_of_eq (planeDeriv_norm x)) convex_univ (mem_univ t) (mem_univ s) + simpa only [one_mul, Real.norm_eq_abs] using h + +theorem planeDeriv_sub_norm_le (s t : ℝ) : + ‖planeDeriv s - planeDeriv t‖ ≤ |s - t| := by + have h := Convex.norm_image_sub_le_of_norm_hasDerivWithin_le + (f := planeDeriv) (f' := fun x => -planeWave x) (C := 1) + (fun x (_ : x ∈ (Set.univ : Set ℝ)) => + (hasDerivAt_planeDeriv x).hasDerivWithinAt) + (fun x _ => by simp) convex_univ (mem_univ t) (mem_univ s) + simpa only [one_mul, Real.norm_eq_abs] using h + +theorem planeWave_remainder (s t : ℝ) : + ‖planeWave t - planeWave s - (t - s) • planeDeriv s‖ ≤ |t - s| ^ 2 := by + have hd (x : ℝ) : + HasDerivAt (fun y => planeWave y - planeWave s - (y - s) • planeDeriv s) + (planeDeriv x - planeDeriv s) x := by + simpa only [one_smul, id_eq] using + ((hasDerivAt_planeWave x).sub_const (planeWave s)).fun_sub + (((hasDerivAt_id x).sub_const s).smul_const (planeDeriv s)) + have hbound (x : ℝ) (hx : x ∈ segment ℝ s t) : + ‖planeDeriv x - planeDeriv s‖ ≤ |t - s| := by + apply (planeDeriv_sub_norm_le x s).trans + simpa only [Real.norm_eq_abs] using norm_sub_le_of_mem_segment hx + have h := Convex.norm_image_sub_le_of_norm_hasDerivWithin_le + (fun x (_ : x ∈ segment ℝ s t) => (hd x).hasDerivWithinAt) + hbound (convex_segment s t) (left_mem_segment ℝ s t) (right_mem_segment ℝ s t) + simpa only [sub_self, zero_smul, sub_zero, Real.norm_eq_abs, pow_two] using h + +end ThompsonNonamenability.Analytic + +end + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/AnalyticRotation.lean b/lean/OAI/GroupTheory/Thompson/AnalyticRotation.lean new file mode 100644 index 0000000000000000000000000000000000000000..a1687cd287ea69d33ea5229785d70d9f692f49c6 --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/AnalyticRotation.lean @@ -0,0 +1,335 @@ +import Mathlib.Analysis.InnerProductSpace.LinearMap +import Mathlib.Analysis.Normed.Operator.Bilinear +import Mathlib.Tactic.Abel +import Mathlib.Tactic.FieldSimp +import Mathlib.Tactic.Linarith +import Mathlib.Tactic.Module +import Mathlib.Tactic.NormNum +import Mathlib.Tactic.Positivity + +namespace OAI + +/-! +# The rank-two rotations in the displacement construction + +These are actual bounded operators on a real inner-product space. The formula +has no choice of orthogonal complement and remains valid when the two unit +vectors coincide. The estimates use the operator norm. +-/ + +noncomputable section + +universe uE uX + +namespace ThompsonNonamenability.Analytic + +open scoped InnerProductSpace NNReal + +variable {E : Type uE} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + +/-- The skew rank-two operator associated with an ordered pair. -/ +def skew (u v : E) : E →L[ℝ] E := + (innerSL ℝ u).smulRight v - (innerSL ℝ v).smulRight u + +@[simp] theorem skew_apply (u v x : E) : + skew u v x = ⟪u, x⟫_ℝ • v - ⟪v, x⟫_ℝ • u := rfl + +/-- The rotation taking `u` to `v`, on the non-antipodal unit-pair domain. -/ +def rotation (u v : E) : E →L[ℝ] E := + ContinuousLinearMap.id ℝ E + skew u v + + (1 + ⟪u, v⟫_ℝ)⁻¹ • (skew u v).comp (skew u v) + +theorem rotation_apply (u v x : E) : + rotation u v x = x + skew u v x + + (1 + ⟪u, v⟫_ℝ)⁻¹ • skew u v (skew u v x) := rfl + +@[simp] theorem skew_self (u : E) : skew u u = 0 := by + simp [skew] + +@[simp] theorem rotation_self (u : E) : + rotation u u = ContinuousLinearMap.id ℝ E := by + simp [rotation] + +theorem skew_inner (u v x y : E) : + ⟪skew u v x, y⟫_ℝ = -⟪x, skew u v y⟫_ℝ := by + simp only [skew_apply, inner_sub_left, inner_sub_right, + real_inner_smul_left, real_inner_smul_right] + rw [real_inner_comm v x, real_inner_comm u x] + ring + +theorem rotation_apply_explicit (u v x : E) + (hu : ‖u‖ = 1) (hv : ‖v‖ = 1) : + rotation u v x = x + + (⟪u, x⟫_ℝ + (1 + ⟪u, v⟫_ℝ)⁻¹ * + (⟪u, v⟫_ℝ * ⟪u, x⟫_ℝ - ⟪v, x⟫_ℝ)) • v + + (-⟪v, x⟫_ℝ + (1 + ⟪u, v⟫_ℝ)⁻¹ * + (⟪u, v⟫_ℝ * ⟪v, x⟫_ℝ - ⟪u, x⟫_ℝ)) • u := by + have huu : ⟪u, u⟫_ℝ = 1 := by + rw [real_inner_self_eq_norm_sq, hu]; norm_num + have hvv : ⟪v, v⟫_ℝ = 1 := by + rw [real_inner_self_eq_norm_sq, hv]; norm_num + simp only [rotation_apply, skew_apply, inner_sub_right, + real_inner_smul_right, huu, hvv, real_inner_comm u v] + module + +theorem rotation_apply_self (u v : E) + (hu : ‖u‖ = 1) (hv : ‖v‖ = 1) (hκ : 0 ≤ ⟪u, v⟫_ℝ) : + rotation u v u = v := by + have huu : ⟪u, u⟫_ℝ = 1 := by + rw [real_inner_self_eq_norm_sq, hu]; norm_num + have hd : 1 + ⟪u, v⟫_ℝ ≠ 0 := by linarith + rw [rotation_apply_explicit u v u hu hv, huu, real_inner_comm u v] + match_scalars <;> field_simp [hd] <;> ring + +theorem rotation_inner (u v : E) + (hu : ‖u‖ = 1) (hv : ‖v‖ = 1) (hκ : 0 ≤ ⟪u, v⟫_ℝ) + (x y : E) : + ⟪rotation u v x, rotation u v y⟫_ℝ = ⟪x, y⟫_ℝ := by + have huu : ⟪u, u⟫_ℝ = 1 := by + rw [real_inner_self_eq_norm_sq, hu]; norm_num + have hvv : ⟪v, v⟫_ℝ = 1 := by + rw [real_inner_self_eq_norm_sq, hv]; norm_num + have hd : 1 + ⟪u, v⟫_ℝ ≠ 0 := by linarith + rw [rotation_apply_explicit u v x hu hv, + rotation_apply_explicit u v y hu hv] + simp only [inner_add_left, inner_add_right, real_inner_smul_left, + real_inner_smul_right, huu, hvv, real_inner_comm u v, + real_inner_comm u x, real_inner_comm v x] + field_simp [hd] + ring + +theorem rotation_norm (u v : E) + (hu : ‖u‖ = 1) (hv : ‖v‖ = 1) (hκ : 0 ≤ ⟪u, v⟫_ℝ) + (x : E) : ‖rotation u v x‖ = ‖x‖ := by + rw [norm_eq_sqrt_real_inner, rotation_inner u v hu hv hκ, + ← norm_eq_sqrt_real_inner] + +theorem norm_rotation_le_one (u v : E) + (hu : ‖u‖ = 1) (hv : ‖v‖ = 1) (hκ : 0 ≤ ⟪u, v⟫_ℝ) : + ‖rotation u v‖ ≤ 1 := by + apply ContinuousLinearMap.opNorm_le_bound _ zero_le_one + intro x + rw [rotation_norm u v hu hv hκ, one_mul] + +theorem norm_rotation (u v : E) + (hu : ‖u‖ = 1) (hv : ‖v‖ = 1) (hκ : 0 ≤ ⟪u, v⟫_ℝ) : + ‖rotation u v‖ = 1 := by + apply le_antisymm (norm_rotation_le_one u v hu hv hκ) + have h := (rotation u v).le_opNorm u + rw [rotation_norm u v hu hv hκ, hu, mul_one] at h + exact h + +theorem rotation_inner_swap (u v x y : E) : + ⟪rotation u v x, y⟫_ℝ = ⟪x, rotation v u y⟫_ℝ := by + have hs (z : E) : skew v u z = -skew u v z := by + simp only [skew_apply] + module + simp only [rotation_apply, inner_add_left, inner_add_right, + real_inner_smul_left, real_inner_smul_right, skew_inner, + hs, map_neg, inner_neg_right, neg_neg, real_inner_comm u v] + +theorem rotation_reverse_apply (u v : E) + (hu : ‖u‖ = 1) (hv : ‖v‖ = 1) (hκ : 0 ≤ ⟪u, v⟫_ℝ) + (x : E) : rotation v u (rotation u v x) = x := by + apply ext_inner_right ℝ + intro y + rw [rotation_inner_swap, rotation_inner u v hu hv hκ] + +theorem rotation_surjective (u v : E) + (hu : ‖u‖ = 1) (hv : ‖v‖ = 1) (hκ : 0 ≤ ⟪u, v⟫_ℝ) : + Function.Surjective (rotation u v) := by + intro x + refine ⟨rotation v u x, ?_⟩ + exact rotation_reverse_apply v u hv hu + (by simpa only [real_inner_comm u v] using hκ) x + +def rankOne (u v : E) : E →L[ℝ] E := (innerSL ℝ u).smulRight v + +/-- The operator polynomial used in the rank-two rotation formula. -/ +def rotationPolynomial (A : E →L[ℝ] E) (c : ℝ) : E →L[ℝ] E := + ContinuousLinearMap.id ℝ E + A + c • A.comp A + +@[simp] lemma norm_rankOne (u v : E) : ‖rankOne u v‖ = ‖u‖ * ‖v‖ := by + simp only [rankOne, ContinuousLinearMap.norm_smulRight_apply, innerSL_apply_norm] + +lemma rankOne_sub (u v u' v' : E) : + rankOne u v - rankOne u' v' = + rankOne (u - u') v + rankOne u' (v - v') := by + ext x + simp only [rankOne, sub_apply, add_apply, + ContinuousLinearMap.smulRight_apply, innerSL_apply_apply, inner_sub_left, + sub_smul, smul_sub] + abel + +lemma norm_rankOne_sub_le (u v u' v' : E) : + ‖rankOne u v - rankOne u' v'‖ ≤ + ‖u - u'‖ * ‖v‖ + ‖u'‖ * ‖v - v'‖ := by + rw [rankOne_sub] + simpa only [norm_rankOne] using + norm_add_le (rankOne (u - u') v) (rankOne u' (v - v')) + +lemma norm_skew_le_two (u v : E) (hu : ‖u‖ = 1) (hv : ‖v‖ = 1) : + ‖skew u v‖ ≤ 2 := by + calc + ‖skew u v‖ ≤ ‖rankOne u v‖ + ‖rankOne v u‖ := norm_sub_le _ _ + _ = 2 := by simp only [norm_rankOne, hu, hv]; norm_num + +lemma norm_skew_sub_le (u v u' v' : E) + (hu : ‖u‖ = 1) (hv : ‖v‖ = 1) (hu' : ‖u'‖ = 1) (hv' : ‖v'‖ = 1) : + ‖skew u v - skew u' v'‖ ≤ 2 * (‖u - u'‖ + ‖v - v'‖) := by + have heq : skew u v - skew u' v' = + (rankOne u v - rankOne u' v') - (rankOne v u - rankOne v' u') := by + unfold skew rankOne + abel + have h₁ := norm_rankOne_sub_le u v u' v' + have h₂ := norm_rankOne_sub_le v u v' u' + rw [hv, hu', mul_one, one_mul] at h₁ + rw [hu, hv', mul_one, one_mul] at h₂ + rw [heq] + calc + _ ≤ ‖rankOne u v - rankOne u' v'‖ + ‖rankOne v u - rankOne v' u'‖ := + norm_sub_le _ _ + _ ≤ (‖u - u'‖ + ‖v - v'‖) + (‖v - v'‖ + ‖u - u'‖) := + add_le_add h₁ h₂ + _ = 2 * (‖u - u'‖ + ‖v - v'‖) := by ring + +lemma inner_sub_inner_le (u v u' v' : E) (hv : ‖v‖ = 1) (hu' : ‖u'‖ = 1) : + |⟪u, v⟫_ℝ - ⟪u', v'⟫_ℝ| ≤ ‖u - u'‖ + ‖v - v'‖ := by + have heq : ⟪u, v⟫_ℝ - ⟪u', v'⟫_ℝ = + ⟪u - u', v⟫_ℝ + ⟪u', v - v'⟫_ℝ := by + rw [inner_sub_left, inner_sub_right] + ring + calc + |⟪u, v⟫_ℝ - ⟪u', v'⟫_ℝ| = + ‖⟪u - u', v⟫_ℝ + ⟪u', v - v'⟫_ℝ‖ := by + rw [heq, Real.norm_eq_abs] + _ ≤ ‖⟪u - u', v⟫_ℝ‖ + ‖⟪u', v - v'⟫_ℝ‖ := norm_add_le _ _ + _ ≤ ‖u - u'‖ * ‖v‖ + ‖u'‖ * ‖v - v'‖ := + add_le_add (norm_inner_le_norm _ _) (norm_inner_le_norm _ _) + _ = ‖u - u'‖ + ‖v - v'‖ := by rw [hv, hu', mul_one, one_mul] + +lemma inverse_one_add_bounds (κ : ℝ) (hκ : 0 ≤ κ) : + 0 ≤ (1 + κ)⁻¹ ∧ (1 + κ)⁻¹ ≤ 1 := by + constructor + · exact inv_nonneg.mpr (by linarith) + · exact inv_le_one_of_one_le₀ (by linarith) + +lemma inverse_one_add_difference (κ κ' d : ℝ) + (hκ : 0 ≤ κ) (hκ' : 0 ≤ κ') (h : |κ - κ'| ≤ d) : + |(1 + κ)⁻¹ - (1 + κ')⁻¹| ≤ d := by + have hp : 0 < 1 + κ := by linarith + have hp' : 0 < 1 + κ' := by linarith + have hsub : (1 + κ') - (1 + κ) = κ' - κ := by ring + calc + |(1 + κ)⁻¹ - (1 + κ')⁻¹| + = |κ - κ'| / ((1 + κ) * (1 + κ')) := by + rw [inv_sub_inv (ne_of_gt hp) (ne_of_gt hp'), abs_div, + abs_of_pos (mul_pos hp hp'), hsub, abs_sub_comm κ' κ] + _ ≤ |κ - κ'| := + div_le_self (abs_nonneg _) (by nlinarith [mul_nonneg hκ hκ']) + _ ≤ d := h + +-- This lemma is independent of the rank-two construction. +lemma norm_rotationPolynomial_sub_le (A B : E →L[ℝ] E) (c c' d : ℝ) + (hd : 0 ≤ d) (hA : ‖A‖ ≤ 2) (hB : ‖B‖ ≤ 2) + (hAB : ‖A - B‖ ≤ 2 * d) (hcc' : |c - c'| ≤ d) + (hc' : |c'| ≤ 1) : + ‖rotationPolynomial A c - rotationPolynomial B c'‖ ≤ 14 * d := by + have hAA : ‖A.comp A‖ ≤ 4 := by + calc + ‖A.comp A‖ ≤ ‖A‖ * ‖A‖ := A.opNorm_comp_le A + _ ≤ 2 * 2 := mul_le_mul hA hA (norm_nonneg _) (by norm_num) + _ = 4 := by norm_num + have h2d : 0 ≤ 2 * d := mul_nonneg (by norm_num) hd + have hsquare : A.comp A - B.comp B = (A - B).comp A + B.comp (A - B) := by + rw [ContinuousLinearMap.sub_comp, ContinuousLinearMap.comp_sub] + abel + have hsq : ‖A.comp A - B.comp B‖ ≤ 8 * d := by + rw [hsquare] + calc + _ ≤ ‖(A - B).comp A‖ + ‖B.comp (A - B)‖ := norm_add_le _ _ + _ ≤ ‖A - B‖ * ‖A‖ + ‖B‖ * ‖A - B‖ := + add_le_add ((A - B).opNorm_comp_le A) (B.opNorm_comp_le (A - B)) + _ ≤ (2 * d) * 2 + 2 * (2 * d) := + add_le_add (mul_le_mul hAB hA (norm_nonneg _) h2d) + (mul_le_mul hB hAB (norm_nonneg _) (by norm_num)) + _ = 8 * d := by ring + have hcoeff : ‖(c - c') • A.comp A‖ ≤ 4 * d := by + calc + ‖(c - c') • A.comp A‖ ≤ |c - c'| * ‖A.comp A‖ := by + simpa only [Real.norm_eq_abs] using + ContinuousLinearMap.opNorm_smul_le (c - c') (A.comp A) + _ ≤ d * 4 := mul_le_mul hcc' hAA (norm_nonneg _) hd + _ = 4 * d := by ring + have hquadratic : ‖c' • (A.comp A - B.comp B)‖ ≤ 8 * d := by + calc + ‖c' • (A.comp A - B.comp B)‖ ≤ |c'| * ‖A.comp A - B.comp B‖ := by + simpa only [Real.norm_eq_abs] using + ContinuousLinearMap.opNorm_smul_le c' (A.comp A - B.comp B) + _ ≤ 1 * (8 * d) := mul_le_mul hc' hsq (norm_nonneg _) (by norm_num) + _ = 8 * d := one_mul _ + have hsplit : rotationPolynomial A c - rotationPolynomial B c' = + (A - B) + ((c - c') • A.comp A + c' • (A.comp A - B.comp B)) := by + unfold rotationPolynomial + rw [sub_smul, smul_sub] + abel + rw [hsplit] + calc + _ ≤ ‖A - B‖ + ‖(c - c') • A.comp A + c' • (A.comp A - B.comp B)‖ := + norm_add_le _ _ + _ ≤ ‖A - B‖ + (‖(c - c') • A.comp A‖ + ‖c' • (A.comp A - B.comp B)‖) := + add_le_add le_rfl (norm_add_le _ _) + _ ≤ 2 * d + (4 * d + 8 * d) := add_le_add hAB (add_le_add hcoeff hquadratic) + _ = 14 * d := by ring + +lemma norm_rotation_sub_le (u v u' v' : E) + (hu : ‖u‖ = 1) (hv : ‖v‖ = 1) (hu' : ‖u'‖ = 1) (hv' : ‖v'‖ = 1) + (hκ : 0 ≤ ⟪u, v⟫_ℝ) (hκ' : 0 ≤ ⟪u', v'⟫_ℝ) : + ‖rotation u v - rotation u' v'‖ ≤ 14 * (‖u - u'‖ + ‖v - v'‖) := by + have hc' := inverse_one_add_bounds (⟪u', v'⟫_ℝ) hκ' + apply norm_rotationPolynomial_sub_le + · exact add_nonneg (norm_nonneg _) (norm_nonneg _) + · exact norm_skew_le_two u v hu hv + · exact norm_skew_le_two u' v' hu' hv' + · exact norm_skew_sub_le u v u' v' hu hv hu' hv' + · exact inverse_one_add_difference _ _ _ hκ hκ' (inner_sub_inner_le u v u' v' hv hu') + · rw [abs_of_nonneg hc'.1] + exact hc'.2 + +/-- Lipschitz dependence of the actual operators on two unit-vector families. -/ +theorem rotation_lipschitzWith {X : Type uX} [PseudoMetricSpace X] + (u v : X → E) {Ku Kv : ℝ≥0} + (hu : ∀ x, ‖u x‖ = 1) (hv : ∀ x, ‖v x‖ = 1) + (hκ : ∀ x, 0 ≤ ⟪u x, v x⟫_ℝ) + (hLu : LipschitzWith Ku u) (hLv : LipschitzWith Kv v) : + LipschitzWith (14 * (Ku + Kv)) (fun x => rotation (u x) (v x)) := by + apply LipschitzWith.of_dist_le_mul + intro x y + rw [dist_eq_norm] + have hu' : ‖u x - u y‖ ≤ (Ku : ℝ) * dist x y := by + simpa only [dist_eq_norm] using hLu.dist_le_mul x y + have hv' : ‖v x - v y‖ ≤ (Kv : ℝ) * dist x y := by + simpa only [dist_eq_norm] using hLv.dist_le_mul x y + calc + ‖rotation (u x) (v x) - rotation (u y) (v y)‖ + ≤ 14 * (‖u x - u y‖ + ‖v x - v y‖) := + norm_rotation_sub_le _ _ _ _ (hu x) (hv x) (hu y) (hv y) (hκ x) (hκ y) + _ ≤ 14 * ((Ku : ℝ) * dist x y + (Kv : ℝ) * dist x y) := + mul_le_mul_of_nonneg_left (add_le_add hu' hv') (by norm_num) + _ = (14 * (Ku + Kv) : ℝ≥0) * dist x y := by + push_cast + ring + +theorem rotation_lipschitzWith_238 {X : Type uX} [PseudoMetricSpace X] + (u v : X → E) + (hu : ∀ x, ‖u x‖ = 1) (hv : ∀ x, ‖v x‖ = 1) + (hκ : ∀ x, 0 ≤ ⟪u x, v x⟫_ℝ) + (hLu : LipschitzWith 16 u) (hLv : LipschitzWith 1 v) : + LipschitzWith 238 (fun x => rotation (u x) (v x)) := by + convert rotation_lipschitzWith u v hu hv hκ hLu hLv using 1 ; norm_num + +end ThompsonNonamenability.Analytic + +end + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/AnalyticScalarDerivatives.lean b/lean/OAI/GroupTheory/Thompson/AnalyticScalarDerivatives.lean new file mode 100644 index 0000000000000000000000000000000000000000..5f6352f24dc3aa35c12fb22608b9dc7628a4303b --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/AnalyticScalarDerivatives.lean @@ -0,0 +1,167 @@ +import OAI.GroupTheory.Thompson.AnalyticScalarProfiles +import Mathlib.Analysis.Calculus.Deriv.Add +import Mathlib.Analysis.Calculus.Deriv.Mul +import Mathlib.Analysis.Calculus.Deriv.Pow + +namespace OAI + +/-! +# Derivatives of the scalar displacement profiles + +The one-sided derivatives are glued on the two closed/open half-lines. +In particular, the formulas below hold at all four transition points; +no transition point is removed from the domain. +-/ + +noncomputable section + +open Set Filter +open scoped Topology + +namespace ThompsonNonamenability.Analytic + +private theorem hasDerivAt_if_le_junction + {f g : ℝ → ℝ} {c d : ℝ} + (hf : HasDerivAt f d c) (hg : HasDerivAt g d c) + (hfg : f c = g c) : + HasDerivAt (fun t => if t ≤ c then f t else g t) d c := by + have hleft : HasDerivWithinAt + (fun t => if t ≤ c then f t else g t) d (Iic c) c := by + apply hf.hasDerivWithinAt.congr + · intro t ht + exact ite_eq_left ht + · simp + have hright : HasDerivWithinAt + (fun t => if t ≤ c then f t else g t) d (Ioi c) c := by + apply hg.hasDerivWithinAt.congr + · intro t ht + exact ite_eq_right (not_le.mpr ht) + · simpa using hfg + simpa only [Iic_union_Ioi, hasDerivWithinAt_univ] using hleft.union hright + +private theorem hasDerivAt_if_le_all + {f g df dg : ℝ → ℝ} (c : ℝ) + (hf : ∀ t, HasDerivAt f (df t) t) + (hg : ∀ t, HasDerivAt g (dg t) t) + (hfg : f c = g c) (hdfg : df c = dg c) (t : ℝ) : + HasDerivAt (fun u => if u ≤ c then f u else g u) + (if t ≤ c then df t else dg t) t := by + rcases lt_trichotomy t c with ht | heq | ht + · rw [ite_eq_left ht.le] + apply (hf t).congr_of_eventuallyEq + filter_upwards [Iio_mem_nhds ht] with u hu + exact ite_eq_left hu.le + · subst t + rw [ite_eq_left le_rfl] + exact hasDerivAt_if_le_junction (hf c) ((hg c).congr_deriv hdfg.symm) hfg + · rw [ite_eq_right (not_le.mpr ht)] + apply (hg t).congr_of_eventuallyEq + filter_upwards [Ioi_mem_nhds ht] with u hu + exact ite_eq_right (not_le.mpr hu) + +private theorem if_lt_eq_if_le + {f g : ℝ → ℝ} {c : ℝ} (hfg : f c = g c) (t : ℝ) : + (if t < c then f t else g t) = (if t ≤ c then f t else g t) := by + rcases lt_trichotomy t c with ht | rfl | ht + · simp [ht, ht.le] + · simp [hfg] + · simp [not_lt.mpr ht.le, not_le.mpr ht] + +private theorem hasDerivAt_a_middle (t : ℝ) : + HasDerivAt (fun u : ℝ => 5 / 16 - (3 - u) ^ 2 / 16) ((3 - t) / 8) t := by + have h := ((((hasDerivAt_id' t).const_sub 3).fun_pow 2).div_const 16).const_sub + (5 / 16 : ℝ) + exact h.congr_deriv (by norm_num ; ring) + +private theorem hasDerivAt_theta_middle (t : ℝ) : + HasDerivAt (fun u : ℝ => (u - 1) ^ 2 / 2) (t - 1) t := by + have h := (((hasDerivAt_id' t).sub_const 1).fun_pow 2).div_const 2 + exact h.congr_deriv (by norm_num) + +/-- The radial scalar profile is differentiable at every real point, +including its two junctions. -/ +theorem hasDerivAt_a (t : ℝ) : HasDerivAt a (aDeriv t) t := by + have hm : ∀ u : ℝ, HasDerivAt + (fun v : ℝ => if v ≤ 3 then 5 / 16 - (3 - v) ^ 2 / 16 else 5 / 16) + (if u ≤ 3 then (3 - u) / 8 else 0) u := + hasDerivAt_if_le_all 3 hasDerivAt_a_middle + (fun u => hasDerivAt_const u (5 / 16 : ℝ)) (by norm_num) (by norm_num) + have h : HasDerivAt + (fun u : ℝ => if u ≤ 2 then u / 8 else + if u ≤ 3 then 5 / 16 - (3 - u) ^ 2 / 16 else 5 / 16) + (if t ≤ 2 then 1 / 8 else if t ≤ 3 then (3 - t) / 8 else 0) t := + hasDerivAt_if_le_all 2 (fun u => (hasDerivAt_id u).div_const 8) + hm (by norm_num) (by norm_num) t + have hf : a = (fun u : ℝ => if u ≤ 2 then u / 8 else + if u ≤ 3 then 5 / 16 - (3 - u) ^ 2 / 16 else 5 / 16) := by + funext u + by_cases hu : u ≤ 2 + · simp [a, hu] + · simp only [a, ite_eq_right hu] + exact if_lt_eq_if_le (f := fun v : ℝ => 5 / 16 - (3 - v) ^ 2 / 16) + (g := fun _ : ℝ => 5 / 16) (c := 3) (by norm_num) u + have hd : aDeriv t = + (if t ≤ 2 then 1 / 8 else if t ≤ 3 then (3 - t) / 8 else 0) := by + by_cases ht : t ≤ 2 + · simp [aDeriv, ht] + · simp only [aDeriv, ite_eq_right ht] + exact if_lt_eq_if_le (f := fun v : ℝ => (3 - v) / 8) + (g := fun _ : ℝ => 0) (c := 3) (by norm_num) t + rw [hf, hd] + exact h + +/-- The angular scalar profile is differentiable at every real point, +including its two junctions. -/ +theorem hasDerivAt_theta (t : ℝ) : HasDerivAt theta (thetaDeriv t) t := by + have hm : ∀ u : ℝ, HasDerivAt + (fun v : ℝ => if v ≤ 2 then (v - 1) ^ 2 / 2 else v - 3 / 2) + (if u ≤ 2 then u - 1 else 1) u := + hasDerivAt_if_le_all 2 hasDerivAt_theta_middle + (fun u => (hasDerivAt_id u).sub_const (3 / 2 : ℝ)) + (by norm_num) (by norm_num) + have h : HasDerivAt + (fun u : ℝ => if u ≤ 1 then 0 else + if u ≤ 2 then (u - 1) ^ 2 / 2 else u - 3 / 2) + (if t ≤ 1 then 0 else if t ≤ 2 then t - 1 else 1) t := + hasDerivAt_if_le_all 1 (fun u => hasDerivAt_const u (0 : ℝ)) + hm (by norm_num) (by norm_num) t + have hf : theta = (fun u : ℝ => if u ≤ 1 then 0 else + if u ≤ 2 then (u - 1) ^ 2 / 2 else u - 3 / 2) := by + funext u + by_cases hu : u ≤ 1 + · simp [theta, hu] + · simp only [theta, ite_eq_right hu] + exact if_lt_eq_if_le (f := fun v : ℝ => (v - 1) ^ 2 / 2) + (g := fun v : ℝ => v - 3 / 2) (c := 2) (by norm_num) u + have hd : thetaDeriv t = + (if t ≤ 1 then 0 else if t ≤ 2 then t - 1 else 1) := by + by_cases ht : t ≤ 1 + · simp [thetaDeriv, ht] + · simp only [thetaDeriv, ite_eq_right ht] + exact if_lt_eq_if_le (f := fun v : ℝ => v - 1) + (g := fun _ : ℝ => 1) (c := 2) (by norm_num) t + rw [hf, hd] + exact h + +theorem deriv_a (t : ℝ) : deriv a t = aDeriv t := (hasDerivAt_a t).deriv + +theorem deriv_theta (t : ℝ) : deriv theta t = thetaDeriv t := (hasDerivAt_theta t).deriv + +theorem differentiable_a : Differentiable ℝ a := fun t => (hasDerivAt_a t).differentiableAt + +theorem differentiable_theta : Differentiable ℝ theta := + fun t => (hasDerivAt_theta t).differentiableAt + +theorem continuous_a : Continuous a := differentiable_a.continuous + +theorem continuous_theta : Continuous theta := differentiable_theta.continuous + +theorem continuous_aDeriv : Continuous aDeriv := aDeriv_lipschitz.continuous + +theorem continuous_thetaDeriv : Continuous thetaDeriv := thetaDeriv_lipschitz.continuous + +end ThompsonNonamenability.Analytic + +end + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/AnalyticScalarProfiles.lean b/lean/OAI/GroupTheory/Thompson/AnalyticScalarProfiles.lean new file mode 100644 index 0000000000000000000000000000000000000000..23c8b28f711784d0ce56ad55e60164e3359a98d6 --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/AnalyticScalarProfiles.lean @@ -0,0 +1,312 @@ +import Mathlib.Topology.MetricSpace.Lipschitz +import Mathlib.Tactic.Linarith +import Mathlib.Tactic.NormNum +import Mathlib.Tactic.Ring +import Mathlib.Tactic.SplitIfs + +namespace OAI + +noncomputable section + +namespace ThompsonNonamenability.Analytic + +open scoped NNReal + +def a (t : ℝ) : ℝ := + if t ≤ 2 then t / 8 else if t < 3 then 5 / 16 - (3 - t) ^ 2 / 16 else 5 / 16 + +/-- The derivative profile of `a`, with its common values at the junctions. -/ +def aDeriv (t : ℝ) : ℝ := + if t ≤ 2 then 1 / 8 else if t < 3 then (3 - t) / 8 else 0 + +def theta (t : ℝ) : ℝ := + if t ≤ 1 then 0 else if t < 2 then (t - 1) ^ 2 / 2 else t - 3 / 2 + +/-- The derivative profile of `theta`. -/ +def thetaDeriv (t : ℝ) : ℝ := + if t ≤ 1 then 0 else if t < 2 then t - 1 else 1 + +/-- The radial coefficient of the modified curve. -/ +def b (t : ℝ) : ℝ := min (a t) (-(1 / 8)) + +/-- The bounded radial correction used in the tube. -/ +def q (t : ℝ) : ℝ := -max (a t + 1 / 8) 0 + +theorem a_of_le_two {t : ℝ} (h : t ≤ 2) : a t = t / 8 := by simp [a, h] + +theorem a_of_two_lt_of_lt_three {t : ℝ} (h : 2 < t) (h' : t < 3) : + a t = 5 / 16 - (3 - t) ^ 2 / 16 := by simp [a, not_le.mpr h, h'] + +theorem a_of_three_le {t : ℝ} (h : 3 ≤ t) : a t = 5 / 16 := by + simp [a, show ¬t ≤ 2 by linarith, not_lt.mpr h] + +theorem aDeriv_of_le_two {t : ℝ} (h : t ≤ 2) : aDeriv t = 1 / 8 := by + simp [aDeriv, h] + +theorem aDeriv_of_three_le {t : ℝ} (h : 3 ≤ t) : aDeriv t = 0 := by + simp [aDeriv, show ¬t ≤ 2 by linarith, not_lt.mpr h] + +theorem theta_of_le_one {t : ℝ} (h : t ≤ 1) : theta t = 0 := by simp [theta, h] + +theorem theta_of_one_lt_of_lt_two {t : ℝ} (h : 1 < t) (h' : t < 2) : + theta t = (t - 1) ^ 2 / 2 := by simp [theta, not_le.mpr h, h'] + +theorem theta_of_two_le {t : ℝ} (h : 2 ≤ t) : theta t = t - 3 / 2 := by + simp [theta, show ¬t ≤ 1 by linarith, not_lt.mpr h] + +theorem thetaDeriv_of_le_one {t : ℝ} (h : t ≤ 1) : thetaDeriv t = 0 := by + simp [thetaDeriv, h] + +theorem thetaDeriv_of_two_le {t : ℝ} (h : 2 ≤ t) : thetaDeriv t = 1 := by + simp [thetaDeriv, show ¬t ≤ 1 by linarith, not_lt.mpr h] + +theorem a_le_five_sixteenths (t : ℝ) : a t ≤ 5 / 16 := by + unfold a + split_ifs <;> nlinarith [sq_nonneg (3 - t)] + +theorem a_lower_of_one_le {t : ℝ} (h : 1 ≤ t) : 1 / 8 ≤ a t := by + unfold a + split_ifs with h₂ h₃ + · linarith + · have hp : 0 ≤ (t - 2) * (4 - t) := mul_nonneg (by linarith) (by linarith) + nlinarith + · norm_num + +theorem a_lower_of_two_le {t : ℝ} (h : 2 ≤ t) : 1 / 4 ≤ a t := by + unfold a + split_ifs with h₂ h₃ + · linarith + · have hp : 0 ≤ (t - 2) * (4 - t) := mul_nonneg (by linarith) (by linarith) + nlinarith + · norm_num + +theorem a_bounds_of_one_le {t : ℝ} (h : 1 ≤ t) : 1 / 8 ≤ a t ∧ a t ≤ 5 / 16 := + ⟨a_lower_of_one_le h, a_le_five_sixteenths t⟩ + +theorem aDeriv_nonneg (t : ℝ) : 0 ≤ aDeriv t := by + unfold aDeriv + split_ifs <;> linarith + +theorem aDeriv_le (t : ℝ) : aDeriv t ≤ 1 / 8 := by + unfold aDeriv + split_ifs <;> linarith + +theorem thetaDeriv_nonneg (t : ℝ) : 0 ≤ thetaDeriv t := by + unfold thetaDeriv + split_ifs <;> linarith + +theorem thetaDeriv_le (t : ℝ) : thetaDeriv t ≤ 1 := by + unfold thetaDeriv + split_ifs <;> linarith + +theorem theta_nonneg (t : ℝ) : 0 ≤ theta t := by + unfold theta + split_ifs <;> nlinarith [sq_nonneg (t - 1)] + +/-- The ordered difference estimate also records monotonicity. -/ +theorem a_sub_bounds {x y : ℝ} (hxy : x ≤ y) : + 0 ≤ a y - a x ∧ a y - a x ≤ (y - x) / 8 := by + by_cases hx₂ : x ≤ 2 + · by_cases hy₂ : y ≤ 2 + · rw [a_of_le_two hx₂, a_of_le_two hy₂] + constructor <;> linarith + · by_cases hy₃ : y < 3 + · rw [a_of_le_two hx₂, a_of_two_lt_of_lt_three (lt_of_not_ge hy₂) hy₃] + have hp : 0 ≤ (y - 2) * (4 - y) := mul_nonneg (by linarith) (by linarith) + constructor <;> nlinarith [sq_nonneg (y - 2)] + · rw [a_of_le_two hx₂, a_of_three_le (le_of_not_gt hy₃)] + constructor <;> linarith + · by_cases hx₃ : x < 3 + · by_cases hy₃ : y < 3 + · rw [a_of_two_lt_of_lt_three (lt_of_not_ge hx₂) hx₃, + a_of_two_lt_of_lt_three (by linarith) hy₃] + have hp : 0 ≤ (y - x) * (6 - x - y) := + mul_nonneg (sub_nonneg.mpr hxy) (by linarith) + have hq : 0 ≤ (y - x) * (x + y - 4) := + mul_nonneg (sub_nonneg.mpr hxy) (by linarith) + constructor <;> nlinarith + · rw [a_of_two_lt_of_lt_three (lt_of_not_ge hx₂) hx₃, + a_of_three_le (le_of_not_gt hy₃)] + have hp : 0 ≤ (3 - x) * (x - 1) := mul_nonneg (by linarith) (by linarith) + constructor <;> nlinarith [sq_nonneg (3 - x)] + · rw [a_of_three_le (le_of_not_gt hx₃), a_of_three_le (by linarith)] + constructor <;> linarith + +theorem a_monotone : Monotone a := by + intro x y hxy + have := (a_sub_bounds hxy).1 + linarith + +theorem a_strictMonoOn : StrictMonoOn a (Set.Iic 2) := by + intro x hx y hy hxy + rw [a_of_le_two hx, a_of_le_two hy] + linarith + +/-- Ordered differences of the angular profile. -/ +theorem theta_sub_bounds {x y : ℝ} (hxy : x ≤ y) : + 0 ≤ theta y - theta x ∧ theta y - theta x ≤ y - x := by + by_cases hx₁ : x ≤ 1 + · by_cases hy₁ : y ≤ 1 + · rw [theta_of_le_one hx₁, theta_of_le_one hy₁] + constructor <;> linarith + · by_cases hy₂ : y < 2 + · rw [theta_of_le_one hx₁, theta_of_one_lt_of_lt_two (lt_of_not_ge hy₁) hy₂] + have hp : 0 ≤ (y - 1) * (3 - y) := mul_nonneg (by linarith) (by linarith) + constructor <;> nlinarith [sq_nonneg (y - 1)] + · rw [theta_of_le_one hx₁, theta_of_two_le (le_of_not_gt hy₂)] + constructor <;> linarith + · by_cases hx₂ : x < 2 + · by_cases hy₂ : y < 2 + · rw [theta_of_one_lt_of_lt_two (lt_of_not_ge hx₁) hx₂, + theta_of_one_lt_of_lt_two (by linarith) hy₂] + have hp : 0 ≤ (y - x) * (x + y - 2) := + mul_nonneg (sub_nonneg.mpr hxy) (by linarith) + have hq : 0 ≤ (y - x) * (4 - x - y) := + mul_nonneg (sub_nonneg.mpr hxy) (by linarith) + constructor <;> nlinarith + · rw [theta_of_one_lt_of_lt_two (lt_of_not_ge hx₁) hx₂, + theta_of_two_le (le_of_not_gt hy₂)] + have hp : 0 ≤ (2 - x) * x := mul_nonneg (by linarith) (by linarith) + constructor <;> nlinarith [sq_nonneg (x - 2)] + · rw [theta_of_two_le (le_of_not_gt hx₂), theta_of_two_le (by linarith)] + constructor <;> linarith + +theorem theta_monotone : Monotone theta := by + intro x y hxy + have := (theta_sub_bounds hxy).1 + linarith + +theorem theta_strictMonoOn : StrictMonoOn theta (Set.Ici 1) := by + intro x hx y hy hxy + by_cases hx₁ : x ≤ 1 + · have hx : x = 1 := le_antisymm hx₁ hx + subst x + rw [theta_of_le_one (le_refl 1)] + by_cases hy₂ : y < 2 + · rw [theta_of_one_lt_of_lt_two hxy hy₂] + nlinarith [sq_pos_of_pos (show 0 < y - 1 by linarith)] + · rw [theta_of_two_le (le_of_not_gt hy₂)] + linarith + · by_cases hx₂ : x < 2 + · by_cases hy₂ : y < 2 + · rw [theta_of_one_lt_of_lt_two (lt_of_not_ge hx₁) hx₂, + theta_of_one_lt_of_lt_two (by linarith) hy₂] + have hp : 0 < (y - x) * (x + y - 2) := mul_pos (by linarith) (by linarith) + nlinarith + · rw [theta_of_one_lt_of_lt_two (lt_of_not_ge hx₁) hx₂, + theta_of_two_le (le_of_not_gt hy₂)] + have hp : 0 < (2 - x) * x := mul_pos (by linarith) (by linarith) + nlinarith + · rw [theta_of_two_le (le_of_not_gt hx₂), theta_of_two_le (by linarith)] + linarith + +private theorem lipschitz_of_ordered_sub {f : ℝ → ℝ} {K : ℝ≥0} + (hf : Monotone f) (h : ∀ x y, x ≤ y → f y - f x ≤ (K : ℝ) * (y - x)) : + LipschitzWith K f := by + apply LipschitzWith.of_dist_le_mul + intro x y + rcases le_total x y with hxy | hyx + · simpa only [Real.dist_eq, abs_of_nonpos (sub_nonpos.mpr (hf hxy)), + abs_of_nonpos (sub_nonpos.mpr hxy), neg_sub] using h x y hxy + · simpa only [Real.dist_eq, abs_of_nonneg (sub_nonneg.mpr (hf hyx)), + abs_of_nonneg (sub_nonneg.mpr hyx)] using h y x hyx + +theorem a_lipschitz : LipschitzWith (1 / 8 : ℝ≥0) a := by + apply lipschitz_of_ordered_sub a_monotone + intro x y hxy + norm_num only [NNReal.coe_div, NNReal.coe_one, NNReal.coe_ofNat] + linarith [(a_sub_bounds hxy).2] + +theorem theta_lipschitz : LipschitzWith 1 theta := by + apply lipschitz_of_ordered_sub theta_monotone + intro x y hxy + simpa using (theta_sub_bounds hxy).2 + +theorem aDeriv_eq_clip (t : ℝ) : aDeriv t = min (max (3 - t) 0) 1 / 8 := by + unfold aDeriv + split_ifs with h₂ h₃ + · rw [max_eq_left (by linarith), min_eq_right (by linarith)] + · rw [max_eq_left (by linarith), min_eq_left (by linarith)] + · rw [max_eq_right (by linarith)] + norm_num + +theorem thetaDeriv_eq_clip (t : ℝ) : thetaDeriv t = min (max (t - 1) 0) 1 := by + unfold thetaDeriv + split_ifs with h₁ h₂ + · rw [max_eq_right (by linarith)] + norm_num + · rw [max_eq_left (by linarith), min_eq_left (by linarith)] + · rw [max_eq_left (by linarith), min_eq_right (by linarith)] + +theorem aDeriv_lipschitz : LipschitzWith (1 / 8 : ℝ≥0) aDeriv := by + have hbase : LipschitzWith 1 (fun t : ℝ => 3 - t) := by + apply LipschitzWith.of_dist_le_mul + intro x y + simp only [Real.dist_eq, NNReal.coe_one, one_mul] + have he : (3 - x) - (3 - y) = -(x - y) := by ring + rw [he, abs_neg] + have hclip := (hbase.max_const 0).min_const 1 + apply LipschitzWith.of_dist_le_mul + intro x y + simp only [Real.dist_eq] + rw [aDeriv_eq_clip, aDeriv_eq_clip, ← sub_div, abs_div] + have hc := hclip.dist_le_mul x y + simp only [Real.dist_eq, NNReal.coe_one, one_mul] at hc + norm_num only [NNReal.coe_div, NNReal.coe_one, NNReal.coe_ofNat, + abs_of_nonneg (by norm_num : (0 : ℝ) ≤ 8)] + linarith + +theorem thetaDeriv_lipschitz : LipschitzWith 1 thetaDeriv := by + have hbase : LipschitzWith 1 (fun t : ℝ => t - 1) := by + apply LipschitzWith.of_dist_le_mul + intro x y + simp [Real.dist_eq, sub_sub_sub_cancel_right] + have he : thetaDeriv = fun t => min (max (t - 1) 0) 1 := funext thetaDeriv_eq_clip + rw [he] + exact (hbase.max_const 0).min_const 1 + +theorem q_eq_b_sub_a (t : ℝ) : q t = b t - a t := by + unfold q b + by_cases h : a t ≤ -(1 / 8) + · rw [min_eq_left h, max_eq_right (by linarith)] + ring + · rw [min_eq_right (le_of_not_ge h), max_eq_left (by linarith)] + ring + +theorem q_nonpos (t : ℝ) : q t ≤ 0 := neg_nonpos.mpr (le_max_right _ _) + +theorem q_abs_le (t : ℝ) : |q t| ≤ 7 / 16 := by + rw [q, abs_neg, abs_of_nonneg (le_max_right _ _)] + apply max_le + · have := a_le_five_sixteenths t + linarith + · norm_num + +theorem q_eq_zero_of_a_le {t : ℝ} (h : a t ≤ -(1 / 8)) : q t = 0 := by + rw [q, max_eq_right (by linarith), neg_zero] + +theorem q_eq_zero_of_le_neg_one {t : ℝ} (h : t ≤ -1) : q t = 0 := by + apply q_eq_zero_of_a_le + rw [a_of_le_two (by linarith)] + linarith + +theorem q_lipschitz : LipschitzWith (1 / 8 : ℝ≥0) q := by + have hadd : LipschitzWith (1 / 8 : ℝ≥0) (fun t : ℝ => a t + 1 / 8) := by + apply LipschitzWith.of_dist_le_mul + intro x y + simpa only [Real.dist_eq, add_sub_add_right_eq_sub] using a_lipschitz.dist_le_mul x y + have hmax := hadd.max_const 0 + apply LipschitzWith.of_dist_le_mul + intro x y + simpa only [q, Real.dist_eq, neg_sub_neg, abs_sub_comm] using hmax.dist_le_mul x y + +theorem b_le (t : ℝ) : b t ≤ -(1 / 8) := min_le_right _ _ + +theorem b_lipschitz : LipschitzWith (1 / 8 : ℝ≥0) b := + a_lipschitz.min_const (-(1 / 8)) + +end ThompsonNonamenability.Analytic + +end + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/AnalyticSeparation.lean b/lean/OAI/GroupTheory/Thompson/AnalyticSeparation.lean new file mode 100644 index 0000000000000000000000000000000000000000..331fa939fa3dec66cc6e8f3ea9edfd60696d54bf --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/AnalyticSeparation.lean @@ -0,0 +1,124 @@ +import OAI.GroupTheory.Thompson.AnalyticSinc +import Mathlib.Analysis.Normed.Group.Basic + +namespace OAI + +/-! +# Finite-region uniform separation + +The generic results below separate the compactness and scalar estimates from +the concrete curve calculations. The actual analytic curve must supply every +listed identity and inequality before this result is used in the tube theorem. +-/ + +noncomputable section + +universe uH + +namespace ThompsonNonamenability.Analytic + +open Set + +theorem exists_uniform_sep_on_square + {H : Type uH} [NormedAddCommGroup H] + (γ : ℝ → H) (hcont : Continuous γ) (hinj : Function.Injective γ) + (d : ℝ) (hd : 0 < d) : + ∃ μ : ℝ, 0 < μ ∧ + ∀ s ∈ Icc (-4 : ℝ) 5, + ∀ t ∈ Icc (-4 : ℝ) 5, + d ≤ t - s → μ ≤ ‖γ t - γ s‖ := by + let C : Set (ℝ × ℝ) := + (Icc (-4 : ℝ) 5 ×ˢ Icc (-4 : ℝ) 5) ∩ {p | d ≤ p.2 - p.1} + have hclosed : IsClosed {p : ℝ × ℝ | d ≤ p.2 - p.1} := + isClosed_le continuous_const (continuous_snd.sub continuous_fst) + have hcompact : IsCompact C := + ((isCompact_Icc : IsCompact (Icc (-4 : ℝ) 5)).prod isCompact_Icc).inter_right + hclosed + have hcontinuous : Continuous (fun p : ℝ × ℝ => ‖γ p.2 - γ p.1‖) := + ((hcont.comp continuous_snd).sub (hcont.comp continuous_fst)).norm + have hpositive : ∀ p ∈ C, 0 < ‖γ p.2 - γ p.1‖ := by + intro p hp + apply norm_pos_iff.mpr + apply sub_ne_zero.mpr + intro heq + have hparam : p.2 = p.1 := hinj heq + have hgap : d ≤ p.2 - p.1 := hp.2 + rw [hparam, sub_self] at hgap + exact (not_le_of_gt hd) hgap + obtain ⟨μ, hμ, hbound⟩ := hcompact.exists_forall_le' + hcontinuous.continuousOn hpositive + refine ⟨μ, hμ, ?_⟩ + intro s hs t ht hgap + exact hbound (s, t) ⟨⟨hs, ht⟩, hgap⟩ + +theorem uniform_separation_of_five_regions + {H : Type uH} [NormedAddCommGroup H] + (γ : ℝ → H) (hcont : Continuous γ) (hinj : Function.Injective γ) + (hline : ∀ s t : ℝ, s ≤ t → t ≤ 1 → ‖γ t - γ s‖ = (t - s) / 8) + (hnegative : ∀ s t : ℝ, s ≤ -4 → 1 < t → 3 / 16 ≤ ‖γ t - γ s‖) + (htail : ∀ s t : ℝ, 3 ≤ s → s ≤ t → + ‖γ t - γ s‖ ^ 2 = 2 * (5 / 16 : ℝ) ^ 2 * (1 - sinc (t - s))) + (hmixed : ∀ s t : ℝ, s ≤ 3 → 5 ≤ t → + 3 * (5 / 16 : ℝ) ^ 2 / 4 ≤ ‖γ t - γ s‖ ^ 2) + (d : ℝ) (hd : 0 < d) : + ∃ η : ℝ, 0 < η ∧ ∀ s t : ℝ, d ≤ |t - s| → η ≤ ‖γ t - γ s‖ := by + obtain ⟨ε, hε, hεhalf, hsinc⟩ := exists_uniform_sinc_gap d hd + obtain ⟨μ, hμ, hcompact⟩ := exists_uniform_sep_on_square γ hcont hinj d hd + let η : ℝ := min (d / 8) (min (3 / 16) (min ((5 / 16) * ε) (min (5 / 32) μ))) + have hηpos : 0 < η := by + dsimp [η] + exact lt_min (div_pos hd (by norm_num)) + (lt_min (by norm_num) (lt_min (mul_pos (by norm_num) hε) + (lt_min (by norm_num) hμ))) + have hηline : η ≤ d / 8 := min_le_left _ _ + have hηneg : η ≤ 3 / 16 := (min_le_right _ _).trans (min_le_left _ _) + have hηtail : η ≤ (5 / 16) * ε := + (min_le_right _ _).trans ((min_le_right _ _).trans (min_le_left _ _)) + have hηmixed : η ≤ 5 / 32 := + (min_le_right _ _).trans ((min_le_right _ _).trans + ((min_le_right _ _).trans (min_le_left _ _))) + have hηcompact : η ≤ μ := + (min_le_right _ _).trans ((min_le_right _ _).trans + ((min_le_right _ _).trans (min_le_right _ _))) + have hordered : ∀ s t : ℝ, d ≤ t - s → η ≤ ‖γ t - γ s‖ := by + intro s t hgap + have hst : s ≤ t := by linarith + by_cases ht1 : t ≤ 1 + · rw [hline s t hst ht1] + exact hηline.trans (by linarith) + have ht1' : 1 < t := lt_of_not_ge ht1 + by_cases hsneg : s ≤ -4 + · exact hηneg.trans (hnegative s t hsneg ht1') + by_cases hs3 : 3 ≤ s + · have hsq : ((5 / 16 : ℝ) * ε) ^ 2 ≤ ‖γ t - γ s‖ ^ 2 := by + rw [htail s t hs3 hst] + have hepssq : ε ^ 2 ≤ 2 * ε := by + nlinarith [mul_le_mul_of_nonneg_right hεhalf hε.le] + have hgap' := hsinc (t - s) hgap + nlinarith + have hlow : (5 / 16 : ℝ) * ε ≤ ‖γ t - γ s‖ := + (sq_le_sq₀ (mul_nonneg (by norm_num) hε.le) (norm_nonneg _)).mp hsq + exact hηtail.trans hlow + by_cases ht5 : 5 ≤ t + · have hsq : (5 / 32 : ℝ) ^ 2 ≤ ‖γ t - γ s‖ ^ 2 := by + have hm := hmixed s t (le_of_not_ge hs3) ht5 + nlinarith + have hlow : (5 / 32 : ℝ) ≤ ‖γ t - γ s‖ := + (sq_le_sq₀ (by norm_num) (norm_nonneg _)).mp hsq + exact hηmixed.trans hlow + · exact hηcompact.trans (hcompact s ⟨by linarith, by linarith⟩ + t ⟨by linarith, by linarith⟩ hgap) + refine ⟨η, hηpos, ?_⟩ + intro s t hgap + by_cases hst : s ≤ t + · exact hordered s t (by simpa [abs_of_nonneg (sub_nonneg.mpr hst)] using hgap) + · have hts : t ≤ s := (lt_of_not_ge hst).le + have hgap' : d ≤ s - t := by + simpa [abs_of_nonpos (sub_nonpos.mpr hts), neg_sub] using hgap + simpa only [norm_sub_rev] using hordered t s hgap' + +end ThompsonNonamenability.Analytic + +end + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/AnalyticSinc.lean b/lean/OAI/GroupTheory/Thompson/AnalyticSinc.lean new file mode 100644 index 0000000000000000000000000000000000000000..42e8dc4554be0349b4da46418d64a5d2351a69b5 --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/AnalyticSinc.lean @@ -0,0 +1,96 @@ +import Mathlib.Analysis.Calculus.Deriv.Slope +import Mathlib.Analysis.SpecialFunctions.Trigonometric.Bounds +import Mathlib.Topology.Order.Compact +import Mathlib.Tactic.Linarith +import Mathlib.Tactic.NormNum + +namespace OAI + +/-! +# The correlation function for the Hilbert-space oscillator + +The value at zero is filled in by the derivative of sine. Uniform separation +on a positive half-line is proved using one compact interval and the elementary +bound on sine, without a limit argument at infinity. +-/ + +noncomputable section + +namespace ThompsonNonamenability.Analytic + +open Set + +def sinc (q : ℝ) : ℝ := if q = 0 then 1 else Real.sin q / q + +@[simp] theorem sinc_zero : sinc 0 = 1 := by simp [sinc] + +theorem sinc_of_ne_zero {q : ℝ} (hq : q ≠ 0) : sinc q = Real.sin q / q := by + simp [sinc, hq] + +@[simp] theorem sinc_neg (q : ℝ) : sinc (-q) = sinc q := by + by_cases hq : q = 0 + · simp [hq] + · simp [sinc, hq, Real.sin_neg] + +private theorem sinc_eq_update : + sinc = Function.update (fun q : ℝ => Real.sin q / q) 0 1 := by + funext q + by_cases hq : q = 0 <;> simp [sinc, hq] + +theorem continuous_sinc : Continuous sinc := by + rw [continuous_iff_continuousAt] + intro q + rw [sinc_eq_update] + by_cases hq : q = 0 + · subst q + simpa only [Real.sin_zero, Real.cos_zero, sub_zero] using + (Real.hasDerivAt_sin 0).continuousAt_div + · exact (continuousAt_update_of_ne hq).2 + (Real.continuous_sin.continuousAt.div continuousAt_id hq) + +theorem abs_sinc_lt_one {q : ℝ} (hq : q ≠ 0) : |sinc q| < 1 := by + rw [sinc_of_ne_zero hq, abs_div] + exact (div_lt_one (abs_pos.mpr hq)).2 (Real.abs_sin_lt_abs hq) + +theorem abs_sinc_le_one (q : ℝ) : |sinc q| ≤ 1 := by + by_cases hq : q = 0 + · simp [hq] + · exact (abs_sinc_lt_one hq).le + +theorem sinc_le_one (q : ℝ) : sinc q ≤ 1 := + (le_abs_self _).trans (abs_sinc_le_one q) + +theorem abs_sinc_le_half_of_two_le {q : ℝ} (hq : 2 ≤ q) : |sinc q| ≤ 1 / 2 := by + have hqpos : 0 < q := by linarith + rw [sinc_of_ne_zero (ne_of_gt hqpos), abs_div, abs_of_pos hqpos] + apply (div_le_iff₀ hqpos).2 + nlinarith [Real.abs_sin_le_one q] + +theorem exists_uniform_sinc_gap (d : ℝ) (hd : 0 < d) : + ∃ ε : ℝ, 0 < ε ∧ ε ≤ 1 / 2 ∧ + ∀ q : ℝ, d ≤ q → ε ≤ 1 - sinc q := by + have hdmin : 0 < min d 1 := lt_min hd (by norm_num) + have hpositive : ∀ q ∈ Icc (min d 1) 2, 0 < 1 - sinc q := by + intro q hq + have hqpos : 0 < q := hdmin.trans_le hq.1 + have hs : sinc q < 1 := + (le_abs_self _).trans_lt (abs_sinc_lt_one (ne_of_gt hqpos)) + linarith + obtain ⟨m, hm, hbound⟩ := + (isCompact_Icc : IsCompact (Icc (min d 1) (2 : ℝ))).exists_forall_le' + (continuous_const.sub continuous_sinc).continuousOn hpositive + refine ⟨min m (1 / 2), lt_min hm (by norm_num), min_le_right _ _, ?_⟩ + intro q hq + by_cases hq2 : q ≤ 2 + · exact (min_le_left _ _).trans + (hbound q ⟨(min_le_left d 1).trans hq, hq2⟩) + · have hs : sinc q ≤ 1 / 2 := + (le_abs_self _).trans (abs_sinc_le_half_of_two_le (le_of_not_ge hq2)) + have hhalf : (1 / 2 : ℝ) ≤ 1 - sinc q := by linarith + exact (min_le_right _ _).trans hhalf + +end ThompsonNonamenability.Analytic + +end + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/AnalyticTube.lean b/lean/OAI/GroupTheory/Thompson/AnalyticTube.lean new file mode 100644 index 0000000000000000000000000000000000000000..506720a86cf4f2d9ca9150f50147bcd3b5627e2b --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/AnalyticTube.lean @@ -0,0 +1,94 @@ +import OAI.GroupTheory.Thompson.TubeNearest +import OAI.GroupTheory.Thompson.TubeComparison + +namespace OAI + +/-! +# The actual nearest-point parameter on a quantitative curve tube + +Compact minimization, stationarity, and the tangent comparison establish +existence and uniqueness before the nearest parameter is selected. +-/ + +noncomputable section + +universe uE + +namespace ThompsonNonamenability.Analytic.RegularCurveData + +open Set +open scoped InnerProductSpace + +variable {E : Type uE} [NormedAddCommGroup E] [InnerProductSpace ℝ E] +variable (C : RegularCurveData E) + +/-- Nearest parameters are unique throughout the metric tube. -/ +theorem nearest_unique {x : E} (hx : x ∈ C.tube) {s t : ℝ} + (hs : C.IsNearest x s) (ht : C.IsNearest x t) : s = t := by + have hsclose : ‖x - C.curve s‖ < C.rho := + (C.nearest_norm_eq_infDist hs).trans_lt hx + have htclose : ‖x - C.curve t‖ < C.rho := + (C.nearest_norm_eq_infDist ht).trans_lt hx + have hxx : ‖x - x‖ < C.rho := by simpa using C.rho_pos + have hbound := C.parameter_comparison x x s t hsclose htclose hxx + (C.nearest_perp_tangent hs) (C.nearest_perp_tangent ht) + have hzero : |t - s| = 0 := + le_antisymm (by simpa using hbound) (abs_nonneg _) + exact (sub_eq_zero.mp (abs_eq_zero.mp hzero)).symm + +/-- The unique global nearest parameter, selected after proving attainment. -/ +def parameter (x : C.tube) : ℝ := + Classical.choose (C.nearest_exists x x.property) + +theorem parameter_isNearest (x : C.tube) : C.IsNearest x (C.parameter x) := + (Classical.choose_spec (C.nearest_exists x x.property)).1 + +theorem parameter_eq_of_isNearest (x : C.tube) {t : ℝ} + (ht : C.IsNearest x t) : C.parameter x = t := + C.nearest_unique x.property (C.parameter_isNearest x) ht + +/-- The actual normal residual in the ambient inner-product space. -/ +def residual (x : C.tube) : E := (x : E) - C.curve (C.parameter x) + +theorem curve_add_residual (x : C.tube) : + C.curve (C.parameter x) + C.residual x = (x : E) := by + simp [residual] + +theorem residual_norm (x : C.tube) : + ‖C.residual x‖ = Metric.infDist (x : E) (range C.curve) := + C.nearest_norm_eq_infDist (C.parameter_isNearest x) + +theorem residual_norm_lt (x : C.tube) : ‖C.residual x‖ < C.rho := by + rw [C.residual_norm] + exact x.property + +theorem residual_perp_u (x : C.tube) : + ⟪C.residual x, C.tangent (C.parameter x)⟫_ℝ = 0 := + C.nearest_perp_tangent (C.parameter_isNearest x) + +theorem parameter_local_bound16 (x y : C.tube) + (hxy : ‖(x : E) - (y : E)‖ < C.rho) : + |C.parameter x - C.parameter y| ≤ 16 * ‖(x : E) - (y : E)‖ := by + rw [abs_sub_comm (C.parameter x) (C.parameter y)] + exact C.parameter_comparison x y (C.parameter x) (C.parameter y) + (C.residual_norm_lt x) (C.residual_norm_lt y) hxy + (C.residual_perp_u x) (C.residual_perp_u y) + +theorem curve_mem_tube (t : ℝ) : C.curve t ∈ C.tube := by + change Metric.infDist (C.curve t) (range C.curve) < C.rho + rw [Metric.infDist_zero_of_mem (mem_range_self t)] + exact C.rho_pos + +/-- On the curve, the selected nearest parameter is the original parameter. -/ +theorem parameter_curve (t : ℝ) : + C.parameter ⟨C.curve t, C.curve_mem_tube t⟩ = t := by + apply C.parameter_eq_of_isNearest + intro s + simp only [sub_self, norm_zero] + exact norm_nonneg _ + +end ThompsonNonamenability.Analytic.RegularCurveData + +end + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/BasicInterval.lean b/lean/OAI/GroupTheory/Thompson/BasicInterval.lean new file mode 100644 index 0000000000000000000000000000000000000000..c4af863280dc93d287e0572eec6313957bc83ebf --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/BasicInterval.lean @@ -0,0 +1,275 @@ +import Mathlib.Basic.Real.Basic +import Mathlib.Tactic.FieldSimp +import Mathlib.Tactic.Linarith +import Mathlib.Tactic.NormNum +import Mathlib.Tactic.Positivity +import Mathlib.Tactic.Ring + +namespace OAI + +/-! +# Basic dyadic intervals + +A cell records its actual depth and its index on that dyadic grid. Its +endpoints determine the record uniquely. Composition is the affine image of +one cell inside another; no formal interval identifications are assumed. +-/ + +noncomputable section + +namespace ThompsonNonamenability + +structure BasicInterval where + depth : ℕ + index : Fin (2 ^ depth) + deriving DecidableEq + +namespace BasicInterval + +@[ext] theorem ext_depth_index {I J : BasicInterval} + (hd : I.depth = J.depth) (hi : I.index.val = J.index.val) : I = J := by + cases I with + | mk d i => + cases J with + | mk e j => + dsimp at hd hi + subst e + have hij : i = j := Fin.ext hi + subst j + rfl + +def left (I : BasicInterval) : ℝ := (I.index.val : ℝ) / (2 : ℝ) ^ I.depth + +def right (I : BasicInterval) : ℝ := ((I.index.val : ℝ) + 1) / (2 : ℝ) ^ I.depth + +def length (I : BasicInterval) : ℝ := ((2 : ℝ) ^ I.depth)⁻¹ + +def carrier (I : BasicInterval) : Set ℝ := Set.Icc I.left I.right + +def interior (I : BasicInterval) : Set ℝ := Set.Ioo I.left I.right + +def Internal (I : BasicInterval) : Prop := 0 < I.left ∧ I.right < 1 + +def Before (I J : BasicInterval) : Prop := I.right < J.left + +def Contained (K I : BasicInterval) : Prop := I.left ≤ K.left ∧ K.right ≤ I.right + +def chart (I : BasicInterval) (x : ℝ) : ℝ := + ((I.index.val : ℝ) + x) / (2 : ℝ) ^ I.depth + +theorem denominator_pos (I : BasicInterval) : 0 < (2 : ℝ) ^ I.depth := + pow_pos (by norm_num) _ + +theorem denominator_ne_zero (I : BasicInterval) : (2 : ℝ) ^ I.depth ≠ 0 := + ne_of_gt I.denominator_pos + +theorem length_pos (I : BasicInterval) : 0 < I.length := + inv_pos.mpr I.denominator_pos + +theorem length_eq_right_sub_left (I : BasicInterval) : + I.length = I.right - I.left := by + unfold length right left + ring + +theorem left_nonneg (I : BasicInterval) : 0 ≤ I.left := + div_nonneg (Nat.cast_nonneg _) (le_of_lt I.denominator_pos) + +theorem right_le_one (I : BasicInterval) : I.right ≤ 1 := by + apply (div_le_one I.denominator_pos).2 + exact_mod_cast Nat.succ_le_of_lt I.index.isLt + +theorem left_lt_right (I : BasicInterval) : I.left < I.right := by + apply (div_lt_div_iff_of_pos_right I.denominator_pos).2 + linarith + +theorem carrier_subset_unit (I : BasicInterval) : I.carrier ⊆ Set.Icc (0 : ℝ) 1 := by + intro x hx + exact ⟨I.left_nonneg.trans hx.1, hx.2.trans I.right_le_one⟩ + +theorem interior_subset_carrier (I : BasicInterval) : I.interior ⊆ I.carrier := by + intro x hx + exact ⟨hx.1.le, hx.2.le⟩ + +theorem interior_nonempty (I : BasicInterval) : I.interior.Nonempty := by + exact ⟨(I.left + I.right) / 2, by + constructor <;> linarith [I.left_lt_right]⟩ + +theorem contained_refl (I : BasicInterval) : I.Contained I := ⟨le_rfl, le_rfl⟩ + +theorem Contained.trans {I J K : BasicInterval} + (hIJ : I.Contained J) (hJK : J.Contained K) : I.Contained K := + ⟨hJK.1.trans hIJ.1, hIJ.2.trans hJK.2⟩ + +theorem Contained.carrier_subset {I J : BasicInterval} + (h : I.Contained J) : I.carrier ⊆ J.carrier := by + intro x hx + exact ⟨h.1.trans hx.1, hx.2.trans h.2⟩ + +theorem Contained.interior_subset {I J : BasicInterval} + (h : I.Contained J) : I.interior ⊆ J.interior := by + intro x hx + exact ⟨h.1.trans_lt hx.1, hx.2.trans_le h.2⟩ + +theorem length_le_of_contained {I J : BasicInterval} (h : I.Contained J) : + I.length ≤ J.length := by + rw [length_eq_right_sub_left, length_eq_right_sub_left] + exact sub_le_sub h.2 h.1 + +@[simp] theorem chart_zero (I : BasicInterval) : I.chart 0 = I.left := by + simp [chart, left] + +@[simp] theorem chart_one (I : BasicInterval) : I.chart 1 = I.right := rfl + +theorem chart_eq_left_add_length_mul (I : BasicInterval) (x : ℝ) : + I.chart x = I.left + I.length * x := by + unfold chart left length + ring + +theorem chart_strictMono (I : BasicInterval) : StrictMono I.chart := by + intro x y hxy + apply (div_lt_div_iff_of_pos_right I.denominator_pos).2 + exact add_lt_add_right hxy _ + +theorem chart_injective (I : BasicInterval) : Function.Injective I.chart := + I.chart_strictMono.injective + +theorem chart_mem_self_carrier_iff (I : BasicInterval) (x : ℝ) : + I.chart x ∈ I.carrier ↔ x ∈ Set.Icc (0 : ℝ) 1 := by + change I.left ≤ I.chart x ∧ I.chart x ≤ I.right ↔ 0 ≤ x ∧ x ≤ 1 + rw [← I.chart_zero, ← I.chart_one] + simp only [I.chart_strictMono.le_iff_le] + +theorem chart_mem_self_interior_iff (I : BasicInterval) (x : ℝ) : + I.chart x ∈ I.interior ↔ x ∈ Set.Ioo (0 : ℝ) 1 := by + change I.left < I.chart x ∧ I.chart x < I.right ↔ 0 < x ∧ x < 1 + rw [← I.chart_zero, ← I.chart_one] + simp only [I.chart_strictMono.lt_iff_lt] + +theorem ext_endpoints {I J : BasicInterval} + (hl : I.left = J.left) (hr : I.right = J.right) : I = J := by + have hlen : I.length = J.length := by + rw [length_eq_right_sub_left, length_eq_right_sub_left, hl, hr] + have hp : (2 : ℝ) ^ I.depth = (2 : ℝ) ^ J.depth := inv_injective hlen + have hd : I.depth = J.depth := + (pow_right_inj₀ (by norm_num : (0 : ℝ) < 2) (by norm_num : (2 : ℝ) ≠ 1)).1 hp + apply ext_depth_index hd + have hdiv : (I.index.val : ℝ) / (2 : ℝ) ^ J.depth = + (J.index.val : ℝ) / (2 : ℝ) ^ J.depth := by + simpa only [left, hd] using hl + have hi : (I.index.val : ℝ) = (J.index.val : ℝ) := + (div_left_inj' J.denominator_ne_zero).1 hdiv + exact_mod_cast hi + +def root : BasicInterval := ⟨0, ⟨0, by norm_num⟩⟩ + +@[simp] theorem root_depth : root.depth = 0 := rfl + +@[simp] theorem root_index : root.index.val = 0 := rfl + +@[simp] theorem root_left : root.left = 0 := by norm_num [root, left] + +@[simp] theorem root_right : root.right = 1 := by norm_num [root, right] + +@[simp] theorem root_length : root.length = 1 := by norm_num [root, length] + +@[simp] theorem root_chart (x : ℝ) : root.chart x = x := by simp [root, chart] + +def comp (I J : BasicInterval) : BasicInterval where + depth := I.depth + J.depth + index := ⟨I.index.val * 2 ^ J.depth + J.index.val, by + have hI : I.index.val + 1 ≤ 2 ^ I.depth := Nat.succ_le_of_lt I.index.isLt + calc + I.index.val * 2 ^ J.depth + J.index.val < + I.index.val * 2 ^ J.depth + 2 ^ J.depth := Nat.add_lt_add_left J.index.isLt _ + _ = (I.index.val + 1) * 2 ^ J.depth := by ring + _ ≤ 2 ^ I.depth * 2 ^ J.depth := Nat.mul_le_mul_right _ hI + _ = 2 ^ (I.depth + J.depth) := (pow_add _ _ _).symm⟩ + +@[simp] theorem comp_depth (I J : BasicInterval) : (I.comp J).depth = I.depth + J.depth := rfl + +@[simp] theorem comp_index (I J : BasicInterval) : + (I.comp J).index.val = I.index.val * 2 ^ J.depth + J.index.val := rfl + +theorem chart_comp (I J : BasicInterval) (x : ℝ) : + (I.comp J).chart x = I.chart (J.chart x) := by + simp only [chart, comp_depth, comp_index, Nat.cast_add, Nat.cast_mul, + Nat.cast_pow, Nat.cast_ofNat, pow_add] + field_simp + ring + +theorem left_comp (I J : BasicInterval) : (I.comp J).left = I.chart J.left := by + rw [← chart_zero, chart_comp, chart_zero] + +theorem right_comp (I J : BasicInterval) : (I.comp J).right = I.chart J.right := by + rw [← chart_one, chart_comp, chart_one] + +theorem comp_assoc (I J K : BasicInterval) : (I.comp J).comp K = I.comp (J.comp K) := by + apply ext_depth_index + · simp only [comp_depth, Nat.add_assoc] + · simp only [comp_index, comp_depth, pow_add] + ring + +@[simp] theorem comp_root (I : BasicInterval) : I.comp root = I := by + apply ext_depth_index <;> simp + +@[simp] theorem root_comp (I : BasicInterval) : root.comp I = I := by + apply ext_depth_index <;> simp + +theorem comp_left_injective (I : BasicInterval) : Function.Injective I.comp := by + intro J K h + have hd : J.depth = K.depth := Nat.add_left_cancel (congrArg depth h) + apply ext_depth_index hd + have hi := congrArg (fun C : BasicInterval => C.index.val) h + simp only [comp_index, hd] at hi + exact Nat.add_left_cancel hi + +theorem comp_injective (I : BasicInterval) : Function.Injective I.comp := + comp_left_injective I + +theorem comp_contained (I J : BasicInterval) : (I.comp J).Contained I := by + constructor + · rw [left_comp, ← I.chart_zero] + exact I.chart_strictMono.monotone J.left_nonneg + · rw [right_comp, ← I.chart_one] + exact I.chart_strictMono.monotone J.right_le_one + +theorem chart_mem_carrier_iff (I J : BasicInterval) (x : ℝ) : + I.chart x ∈ (I.comp J).carrier ↔ x ∈ J.carrier := by + simp only [carrier, Set.mem_Icc, left_comp, right_comp, I.chart_strictMono.le_iff_le] + +theorem chart_mem_interior_iff (I J : BasicInterval) (x : ℝ) : + I.chart x ∈ (I.comp J).interior ↔ x ∈ J.interior := by + simp only [interior, Set.mem_Ioo, left_comp, right_comp, I.chart_strictMono.lt_iff_lt] + +theorem comp_contained_iff (I J K : BasicInterval) : + (I.comp J).Contained (I.comp K) ↔ J.Contained K := by + simp only [Contained, left_comp, right_comp, I.chart_strictMono.le_iff_le] + +theorem comp_internal_of_internal_right (I J : BasicInterval) (hJ : J.Internal) : + (I.comp J).Internal := by + constructor + · rw [left_comp] + have h := I.chart_strictMono hJ.1 + rw [chart_zero] at h + exact I.left_nonneg.trans_lt h + · rw [right_comp] + have h := I.chart_strictMono hJ.2 + rw [chart_one] at h + exact h.trans_le I.right_le_one + +theorem comp_internal (I J : BasicInterval) (_hI : I.Internal) (hJ : J.Internal) : + (I.comp J).Internal := comp_internal_of_internal_right I J hJ + +theorem comp_before_comp (I : BasicInterval) {J K : BasicInterval} (h : J.Before K) : + (I.comp J).Before (I.comp K) := by + change (I.comp J).right < (I.comp K).left + rw [right_comp, left_comp] + exact I.chart_strictMono h + +end BasicInterval + +end ThompsonNonamenability + +end + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/BasicIntervalNesting.lean b/lean/OAI/GroupTheory/Thompson/BasicIntervalNesting.lean new file mode 100644 index 0000000000000000000000000000000000000000..46a5910b230e48b5f7d5fff0266fce15893e1044 --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/BasicIntervalNesting.lean @@ -0,0 +1,150 @@ +import OAI.GroupTheory.Thompson.BasicInterval + +namespace OAI + +/-! +# Nesting and normalization of basic dyadic intervals + +The endpoint comparisons are made on a common dyadic grid. In particular, +intersecting open interiors force one basic interval to contain the other. +-/ + +noncomputable section + +namespace ThompsonNonamenability.BasicInterval + +open Set + +/-- Express a left endpoint on any finer dyadic grid. -/ +theorem left_eq_on_finer_grid (I : BasicInterval) {s : ℕ} (h : I.depth ≤ s) : + I.left = ((I.index.val * 2 ^ (s - I.depth) : ℕ) : ℝ) / (2 : ℝ) ^ s := by + have hp : (2 : ℝ) ^ s = (2 : ℝ) ^ I.depth * (2 : ℝ) ^ (s - I.depth) := by + rw [← pow_add, Nat.add_sub_cancel' h] + have hI : (2 : ℝ) ^ I.depth ≠ 0 := by positivity + have hD : (2 : ℝ) ^ (s - I.depth) ≠ 0 := by positivity + simp only [left, Nat.cast_mul, Nat.cast_pow, Nat.cast_ofNat, hp] + field_simp [hI, hD] + +/-- Express a right endpoint on any finer dyadic grid. -/ +theorem right_eq_on_finer_grid (I : BasicInterval) {s : ℕ} (h : I.depth ≤ s) : + I.right = (((I.index.val + 1) * 2 ^ (s - I.depth) : ℕ) : ℝ) / + (2 : ℝ) ^ s := by + have hp : (2 : ℝ) ^ s = (2 : ℝ) ^ I.depth * (2 : ℝ) ^ (s - I.depth) := by + rw [← pow_add, Nat.add_sub_cancel' h] + have hI : (2 : ℝ) ^ I.depth ≠ 0 := by positivity + have hD : (2 : ℝ) ^ (s - I.depth) ≠ 0 := by positivity + simp only [right, Nat.cast_mul, Nat.cast_add, Nat.cast_one, Nat.cast_pow, + Nat.cast_ofNat, hp] + field_simp [hI, hD] + +/-- A contained basic interval has at least the depth of its container. -/ +theorem depth_le_of_contained {I K : BasicInterval} (h : K.Contained I) : + I.depth ≤ K.depth := by + have hl := length_le_of_contained h + change ((2 : ℝ) ^ K.depth)⁻¹ ≤ ((2 : ℝ) ^ I.depth)⁻¹ at hl + have hp : (2 : ℝ) ^ I.depth ≤ (2 : ℝ) ^ K.depth := + (inv_le_inv₀ (by positivity) (by positivity)).mp hl + exact (pow_le_pow_iff_right₀ (by norm_num : (1 : ℝ) < 2)).mp hp + +/-- Containment gives the integer endpoint bounds on the finer grid. -/ +theorem index_bounds_of_contained {I K : BasicInterval} (h : K.Contained I) : + I.index.val * 2 ^ (K.depth - I.depth) ≤ K.index.val ∧ + K.index.val + 1 ≤ (I.index.val + 1) * 2 ^ (K.depth - I.depth) := by + have hd := depth_le_of_contained h + have hp : 0 < (2 : ℝ) ^ K.depth := by positivity + have hl := h.1 + have hr := h.2 + rw [left_eq_on_finer_grid I hd, left] at hl + rw [right_eq_on_finer_grid I hd, right] at hr + constructor + · exact_mod_cast (div_le_div_iff_of_pos_right hp).mp hl + · exact_mod_cast (div_le_div_iff_of_pos_right hp).mp hr + +/-- A subinterval is precisely the image of a basic interval under the +container's affine chart. -/ +theorem contained_iff_exists_comp {I K : BasicInterval} : + K.Contained I ↔ ∃ J : BasicInterval, I.comp J = K := by + constructor + · intro h + have hd := depth_le_of_contained h + obtain ⟨hl, hr⟩ := index_bounds_of_contained h + have hn : K.index.val - I.index.val * 2 ^ (K.depth - I.depth) < + 2 ^ (K.depth - I.depth) := by + rw [Nat.add_mul, Nat.one_mul] at hr + omega + let J : BasicInterval := + ⟨K.depth - I.depth, ⟨K.index.val - I.index.val * 2 ^ (K.depth - I.depth), hn⟩⟩ + refine ⟨J, ext_depth_index ?_ ?_⟩ + · change I.depth + (K.depth - I.depth) = K.depth + omega + · change I.index.val * 2 ^ (K.depth - I.depth) + + (K.index.val - I.index.val * 2 ^ (K.depth - I.depth)) = K.index.val + omega + · rintro ⟨J, rfl⟩ + exact comp_contained I J + +/-- The affine preimage of a contained basic interval is unique. -/ +theorem contained_iff_exists_unique_comp {I K : BasicInterval} : + K.Contained I ↔ ∃! J : BasicInterval, I.comp J = K := by + constructor + · intro h + obtain ⟨J, hJ⟩ := contained_iff_exists_comp.mp h + refine ⟨J, hJ, ?_⟩ + intro J' hJ' + exact comp_injective I (hJ'.trans hJ.symm) + · rintro ⟨J, hJ, _⟩ + exact contained_iff_exists_comp.mpr ⟨J, hJ⟩ + +alias containment_iff_exists_unique_comp := contained_iff_exists_unique_comp + +/-- The basic interval obtained by applying the inverse chart of `I` to `K`. -/ +def normalize (I K : BasicInterval) (h : K.Contained I) : BasicInterval := + Classical.choose (contained_iff_exists_comp.mp h) + +theorem comp_normalize (I K : BasicInterval) (h : K.Contained I) : + I.comp (normalize I K h) = K := + Classical.choose_spec (contained_iff_exists_comp.mp h) + +@[simp] theorem normalize_comp (I J : BasicInterval) (h : (I.comp J).Contained I) : + normalize I (I.comp J) h = J := by + apply comp_injective I + exact comp_normalize I (I.comp J) h + +/-- At ordered depths, overlap of open interiors implies containment. -/ +theorem contained_of_overlap_of_depth_le {I K : BasicInterval} + (hd : I.depth ≤ K.depth) (h : (I.interior ∩ K.interior).Nonempty) : + K.Contained I := by + obtain ⟨x, hxI, hxK⟩ := h + have hl : I.left < K.right := lt_trans hxI.1 hxK.2 + have hr : K.left < I.right := lt_trans hxK.1 hxI.2 + have hp : 0 < (2 : ℝ) ^ K.depth := by positivity + rw [left_eq_on_finer_grid I hd, right] at hl + rw [right_eq_on_finer_grid I hd, left] at hr + have hln : I.index.val * 2 ^ (K.depth - I.depth) < K.index.val + 1 := by + exact_mod_cast (div_lt_div_iff_of_pos_right hp).mp hl + have hrn : K.index.val < (I.index.val + 1) * 2 ^ (K.depth - I.depth) := by + exact_mod_cast (div_lt_div_iff_of_pos_right hp).mp hr + have hl' : I.index.val * 2 ^ (K.depth - I.depth) ≤ K.index.val := by omega + have hr' : K.index.val + 1 ≤ (I.index.val + 1) * 2 ^ (K.depth - I.depth) := by omega + constructor + · rw [left_eq_on_finer_grid I hd, left] + apply (div_le_div_iff_of_pos_right hp).mpr + exact_mod_cast hl' + · rw [right_eq_on_finer_grid I hd, right] + apply (div_le_div_iff_of_pos_right hp).mpr + exact_mod_cast hr' + +/-- Basic dyadic intervals with intersecting open interiors are nested. -/ +theorem overlap_interior_nested {I J : BasicInterval} + (h : (I.interior ∩ J.interior).Nonempty) : I.Contained J ∨ J.Contained I := by + rcases le_total I.depth J.depth with hd | hd + · exact Or.inr (contained_of_overlap_of_depth_le hd h) + · apply Or.inl + apply contained_of_overlap_of_depth_le hd + simpa only [inter_comm] using h + +end ThompsonNonamenability.BasicInterval + +end + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/BasicPartition.lean b/lean/OAI/GroupTheory/Thompson/BasicPartition.lean new file mode 100644 index 0000000000000000000000000000000000000000..86f4c5148c95113c3246882ce823c2915b54113b --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/BasicPartition.lean @@ -0,0 +1,221 @@ +import OAI.GroupTheory.Thompson.BasicIntervalNesting +import Mathlib.Data.Finset.Preimage +import Mathlib.Topology.Order.DenselyOrdered +import Mathlib.Topology.Instances.Real.Lemmas + +namespace OAI + +/-! +# Finite partitions into basic dyadic intervals + +Closed cells cover the unit interval; their open interiors are disjoint. +Restriction is the actual inverse image of the cell set under affine insertion. +-/ + +noncomputable section + +namespace ThompsonNonamenability + +open Set + +structure BasicPartition where + cells : Finset BasicInterval + cover : ∀ x ∈ Set.Icc (0 : ℝ) 1, ∃ I ∈ cells, x ∈ I.carrier + disjoint : (cells : Set BasicInterval).Pairwise + (fun I J => Disjoint I.interior J.interior) + +namespace BasicPartition + +@[ext] +theorem ext {T U : BasicPartition} (h : T.cells = U.cells) : T = U := by + cases T + cases U + cases h + rfl + +def cellCount (T : BasicPartition) : ℕ := T.cells.card + +/-- The interval is exactly covered by partition cells contained in it. -/ +def Respects (T : BasicPartition) (I : BasicInterval) : Prop := + ∀ x ∈ I.carrier, ∃ K ∈ T.cells, K.Contained I ∧ x ∈ K.carrier + +theorem cellCount_pos (T : BasicPartition) : 0 < T.cellCount := by + obtain ⟨I, hI, _⟩ := T.cover 0 ⟨le_rfl, zero_le_one⟩ + exact Finset.card_pos.mpr ⟨I, hI⟩ + +theorem respects_of_mem (T : BasicPartition) {I : BasicInterval} + (hI : I ∈ T.cells) : T.Respects I := by + intro x hx + exact ⟨I, hI, I.contained_refl, hx⟩ + +private theorem interiors_overlap_of_mem_interior_mem_carrier + {I J : BasicInterval} {x : ℝ} (hxI : x ∈ I.interior) + (hxJ : x ∈ J.carrier) : (I.interior ∩ J.interior).Nonempty := by + have h : max I.left J.left < min I.right J.right := by + apply lt_min + · exact max_lt I.left_lt_right (lt_of_le_of_lt hxJ.1 hxI.2) + · exact max_lt (lt_of_lt_of_le hxI.1 hxJ.2) J.left_lt_right + obtain ⟨y, hy₁, hy₂⟩ := exists_between h + exact ⟨y, ⟨lt_of_le_of_lt (le_max_left _ _) hy₁, + lt_of_lt_of_le hy₂ (min_le_left _ _)⟩, + ⟨lt_of_le_of_lt (le_max_right _ _) hy₁, + lt_of_lt_of_le hy₂ (min_le_right _ _)⟩⟩ + +/-- At an interior point, even membership in another closed cell forces equality. -/ +theorem eq_of_mem_interior_mem_carrier (T : BasicPartition) + {I J : BasicInterval} (hI : I ∈ T.cells) (hJ : J ∈ T.cells) + {x : ℝ} (hxI : x ∈ I.interior) (hxJ : x ∈ J.carrier) : I = J := by + by_contra hne + obtain ⟨y, hyI, hyJ⟩ := interiors_overlap_of_mem_interior_mem_carrier hxI hxJ + exact Set.disjoint_left.mp (T.disjoint hI hJ hne) hyI hyJ + +/-- Equivalent geometric crossing condition, including the endpoint argument. -/ +theorem respects_iff (T : BasicPartition) (I : BasicInterval) : + T.Respects I ↔ ∀ K ∈ T.cells, + (K.interior ∩ I.interior).Nonempty → K.Contained I := by + constructor + · intro h K hK ⟨x, hxK, hxI⟩ + obtain ⟨L, hL, hLI, hxL⟩ := h x ⟨hxI.1.le, hxI.2.le⟩ + exact (T.eq_of_mem_interior_mem_carrier hK hL hxK hxL).symm ▸ hLI + · intro h + classical + let contained := T.cells.filter (fun K => K.Contained I) + let covered : Set ℝ := ⋃ K ∈ contained, K.carrier + have hclosed : IsClosed covered := by + apply isClosed_biUnion_finset + intro K hK + exact isClosed_Icc + have hinterior : I.interior ⊆ covered := by + intro x hxI + have hxunit : x ∈ Set.Icc (0 : ℝ) 1 := + I.carrier_subset_unit ⟨hxI.1.le, hxI.2.le⟩ + obtain ⟨K, hK, hxK⟩ := T.cover x hxunit + have hmeet : (K.interior ∩ I.interior).Nonempty := by + obtain ⟨y, hyI, hyK⟩ := + interiors_overlap_of_mem_interior_mem_carrier hxI hxK + exact ⟨y, hyK, hyI⟩ + have hKI := h K hK hmeet + exact Set.mem_iUnion₂.mpr ⟨K, Finset.mem_filter.mpr ⟨hK, hKI⟩, hxK⟩ + have hcarrier : I.carrier ⊆ covered := by + have hc := closure_minimal hinterior hclosed + simpa only [BasicInterval.interior, BasicInterval.carrier, + closure_Ioo I.left_lt_right.ne] using hc + intro x hx + obtain ⟨K, hK, hxK⟩ := Set.mem_iUnion₂.mp (hcarrier hx) + exact ⟨K, (Finset.mem_filter.mp hK).1, (Finset.mem_filter.mp hK).2, hxK⟩ + +/-- A sufficiently fine actual partition respects the specified basic interval. -/ +theorem respects_of_mesh_lt (T : BasicPartition) (I : BasicInterval) + (hmesh : ∀ K ∈ T.cells, K.length < I.length) : T.Respects I := by + apply (T.respects_iff I).mpr + intro K hK hmeet + rcases BasicInterval.overlap_interior_nested hmeet with hKI | hIK + · exact hKI + · have hlen : I.length ≤ K.length := by + rw [I.length_eq_right_sub_left, K.length_eq_right_sub_left] + exact sub_le_sub hIK.2 hIK.1 + exact False.elim (not_lt_of_ge hlen (hmesh K hK)) + +/-- Affinely normalized cells. Membership is exactly membership after insertion. -/ +def restrictCells (T : BasicPartition) (I : BasicInterval) : Finset BasicInterval := + T.cells.preimage I.comp I.comp_left_injective.injOn + +@[simp] +theorem mem_restrictCells (T : BasicPartition) (I J : BasicInterval) : + J ∈ T.restrictCells I ↔ I.comp J ∈ T.cells := + Finset.mem_preimage + +/-- The genuine partition obtained by restriction and affine normalization. -/ +def restrict (T : BasicPartition) (I : BasicInterval) (h : T.Respects I) : + BasicPartition where + cells := T.restrictCells I + cover := by + intro x hx + have hchart : I.chart x ∈ I.carrier := + (I.chart_mem_self_carrier_iff x).mpr hx + obtain ⟨K, hK, hKI, hxK⟩ := h (I.chart x) hchart + obtain ⟨J, hJ⟩ := BasicInterval.contained_iff_exists_comp.mp hKI + refine ⟨J, (T.mem_restrictCells I J).mpr (hJ.symm ▸ hK), ?_⟩ + apply (I.chart_mem_carrier_iff J x).mp + simpa only [hJ] using hxK + disjoint := by + intro J hJ K hK hne + apply Set.disjoint_left.mpr + intro x hxJ hxK + have hJK : I.comp J ≠ I.comp K := fun heq => hne (I.comp_left_injective heq) + exact Set.disjoint_left.mp + (T.disjoint ((T.mem_restrictCells I J).mp hJ) + ((T.mem_restrictCells I K).mp hK) hJK) + ((I.chart_mem_interior_iff J x).mpr hxJ) + ((I.chart_mem_interior_iff K x).mpr hxK) + +@[simp] +theorem mem_restrict_cells (T : BasicPartition) (I : BasicInterval) + (h : T.Respects I) (J : BasicInterval) : + J ∈ (T.restrict I h).cells ↔ I.comp J ∈ T.cells := + T.mem_restrictCells I J + +theorem restrict_proof_irrel (T : BasicPartition) (I : BasicInterval) + (h h' : T.Respects I) : T.restrict I h = T.restrict I h' := rfl + +open Classical in +theorem restrict_cellCount_eq_filter_card (T : BasicPartition) (I : BasicInterval) + (h : T.Respects I) : + (T.restrict I h).cellCount = (T.cells.filter (fun K => K.Contained I)).card := by + classical + change (T.cells.preimage I.comp I.comp_left_injective.injOn).card = _ + rw [Finset.card_preimage] + congr 1 + ext K + simp only [Finset.mem_filter, Set.mem_range, + ← BasicInterval.contained_iff_exists_comp] + +theorem restrict_cellCount_lt (T : BasicPartition) (I : BasicInterval) + (h : T.Respects I) (hI : I.Internal) : + (T.restrict I h).cellCount < T.cellCount := by + classical + rw [T.restrict_cellCount_eq_filter_card I h] + obtain ⟨K, hK, hxK⟩ := T.cover 0 ⟨le_rfl, zero_le_one⟩ + have hnot : ¬K.Contained I := by + intro hKI + have hle : I.left ≤ 0 := le_trans hKI.1 hxK.1 + exact (not_le_of_gt hI.1) hle + apply Finset.card_lt_card + apply Finset.ssubset_iff_subset_ne.mpr + refine ⟨Finset.filter_subset _ _, ?_⟩ + intro heq + have hf : K ∈ T.cells.filter (fun K => K.Contained I) := heq.symm ▸ hK + exact hnot (Finset.mem_filter.mp hf).2 + +theorem restrict_respects (T : BasicPartition) (I J : BasicInterval) + (hI : T.Respects I) (hIJ : T.Respects (I.comp J)) : + (T.restrict I hI).Respects J := by + intro x hx + have hchart : I.chart x ∈ (I.comp J).carrier := + (I.chart_mem_carrier_iff J x).mpr hx + obtain ⟨K, hK, hKIJ, hxK⟩ := hIJ (I.chart x) hchart + have hKI : K.Contained I := + ⟨le_trans (I.comp_contained J).1 hKIJ.1, + le_trans hKIJ.2 (I.comp_contained J).2⟩ + obtain ⟨L, hL⟩ := BasicInterval.contained_iff_exists_comp.mp hKI + refine ⟨L, (T.mem_restrict_cells I hI L).mpr (hL.symm ▸ hK), ?_, ?_⟩ + · apply (I.comp_contained_iff L J).mp + simpa only [hL] using hKIJ + · apply (I.chart_mem_carrier_iff L x).mp + simpa only [hL] using hxK + +theorem restrict_restrict (T : BasicPartition) (I J : BasicInterval) + (hI : T.Respects I) (hIJ : T.Respects (I.comp J)) : + (T.restrict I hI).restrict J (T.restrict_respects I J hI hIJ) = + T.restrict (I.comp J) hIJ := by + apply BasicPartition.ext + ext K + simp only [mem_restrict_cells, BasicInterval.comp_assoc] + +end BasicPartition + +end ThompsonNonamenability + +end + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/BoundaryAlgebra.lean b/lean/OAI/GroupTheory/Thompson/BoundaryAlgebra.lean new file mode 100644 index 0000000000000000000000000000000000000000..b6bca14e6aa6059ddfe42b7906d4f1d49f588d3b --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/BoundaryAlgebra.lean @@ -0,0 +1,75 @@ +import Mathlib.Basic.Real.Basic +import Mathlib.Algebra.Order.Archimedean.Real.Basic +import Mathlib.Algebra.Order.Archimedean.Basic +import Mathlib.Tactic.Linarith +import Mathlib.Tactic.NormNum + +namespace OAI + +/-! +# The exact positive constant in the finite boundary obstruction + +The energy inequality is rearranged only after proving the denominators +positive. No sign condition is imposed on a correlation or on its error bound. +The choice of the integer parameter is independent of the finite group set. +-/ + +namespace ThompsonNonamenability + +noncomputable def boundaryConstant (L δ : ℝ) (D : ℕ) : ℝ := + (δ ^ 2 / L ^ 2 - 4 / (D : ℝ)) / (4 * (1 - 1 / (D : ℝ))) + +theorem boundary_denominator_pos {D : ℕ} (hD : 2 ≤ D) : + 0 < 4 * (1 - 1 / (D : ℝ)) := by + have htwo : (2 : ℝ) ≤ (D : ℝ) := by exact_mod_cast hD + have hpos : (0 : ℝ) < (D : ℝ) := by linarith + have hinv : 1 / (D : ℝ) < 1 := (div_lt_one hpos).2 (by linarith) + linarith + +theorem boundary_numerator_pos {L δ : ℝ} {D : ℕ} + (hL : 0 < L) (hδ : 0 < δ) (hD : 2 ≤ D) + (hlarge : 4 * L ^ 2 / δ ^ 2 < (D : ℝ)) : + 0 < δ ^ 2 / L ^ 2 - 4 / (D : ℝ) := by + have hLp : 0 < L ^ 2 := sq_pos_of_pos hL + have hδp : 0 < δ ^ 2 := sq_pos_of_pos hδ + have hDp : (0 : ℝ) < (D : ℝ) := by + exact_mod_cast (lt_of_lt_of_le (by decide : 0 < 2) hD) + have hcross : 4 * L ^ 2 < (D : ℝ) * δ ^ 2 := + (div_lt_iff₀ hδp).1 hlarge + have hratio : 4 / (D : ℝ) < δ ^ 2 / L ^ 2 := + (div_lt_div_iff₀ hDp hLp).2 (by nlinarith [hcross]) + exact sub_pos.mpr hratio + +theorem boundaryConstant_pos {L δ : ℝ} {D : ℕ} + (hL : 0 < L) (hδ : 0 < δ) (hD : 2 ≤ D) + (hlarge : 4 * L ^ 2 / δ ^ 2 < (D : ℝ)) : + 0 < boundaryConstant L δ D := by + unfold boundaryConstant + exact div_pos (boundary_numerator_pos hL hδ hD hlarge) + (boundary_denominator_pos hD) + +/-- Algebraic consequence of the genuine finite energy estimate. -/ +theorem boundaryConstant_le_of_energy {L δ η : ℝ} {D : ℕ} + (hL : 0 < L) (hD : 2 ≤ D) + (henergy : δ ^ 2 ≤ L ^ 2 * + (4 / (D : ℝ) + 4 * (1 - 1 / (D : ℝ)) * η)) : + boundaryConstant L δ D ≤ η := by + have hLp : 0 < L ^ 2 := sq_pos_of_pos hL + have hdivide : δ ^ 2 / L ^ 2 ≤ + 4 / (D : ℝ) + 4 * (1 - 1 / (D : ℝ)) * η := by + apply (div_le_iff₀ hLp).2 + nlinarith [henergy] + unfold boundaryConstant + apply (div_le_iff₀ (boundary_denominator_pos hD)).2 + nlinarith [hdivide] + +/-- Choose the finite branching parameter before choosing any finite group set. -/ +theorem exists_branching_parameter (L δ : ℝ) : + ∃ D : ℕ, 2 ≤ D ∧ 4 * L ^ 2 / δ ^ 2 < (D : ℝ) := by + obtain ⟨n, hn⟩ := exists_nat_gt (4 * L ^ 2 / δ ^ 2) + refine ⟨max 2 n, le_max_left _ _, lt_of_lt_of_le hn ?_⟩ + exact_mod_cast (le_max_right 2 n) + +end ThompsonNonamenability + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/CorrectionData.lean b/lean/OAI/GroupTheory/Thompson/CorrectionData.lean new file mode 100644 index 0000000000000000000000000000000000000000..8ddb6f4b145d346eceb8b8f1435daa23bb41c5e3 --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/CorrectionData.lean @@ -0,0 +1,103 @@ +import OAI.GroupTheory.Thompson.AnalyticTube +import OAI.GroupTheory.Thompson.AnalyticCutoffs +import Mathlib.Tactic.Abel +import Mathlib.Tactic.FieldSimp +import Mathlib.Tactic.Ring + +namespace OAI + +/-! +# Elementary inputs and explicit formula for the tube correction + +Every field below is a scalar, curve, or rotation identity/estimate. In +particular, no property of the corrected map is included in the inputs. +-/ + +noncomputable section + +universe uE + +namespace ThompsonNonamenability.Analytic + +open scoped InnerProductSpace + +variable {E : Type uE} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + +structure CorrectionData (C : RegularCurveData E) where + a : ℝ → ℝ + v : ℝ → E + q : ℝ → ℝ + R : ℝ → E →L[ℝ] E + curve_eq : ∀ t, C.curve t = a t • v t + a_zero : a 0 = 0 + a_upper : ∀ t, a t ≤ 5 / 16 + a_late_lower : ∀ t, 1 < t → 1 / 8 ≤ a t + q_eq : ∀ t, q t = min (a t) (-1 / 8) - a t + q_bound : ∀ t, |q t| ≤ 7 / 16 + q_lipschitz : ∀ s t, |q t - q s| ≤ (1 / 8) * |t - s| + norm_v : ∀ t, ‖v t‖ = 1 + v_lipschitz : ∀ s t, ‖v t - v s‖ ≤ |t - s| + curve_lipschitz : ∀ s t, ‖C.curve t - C.curve s‖ ≤ (7 / 16) * |t - s| + norm_R : ∀ t e, ‖R t e‖ = ‖e‖ + R_perp : ∀ t e, ⟪e, C.tangent t⟫_ℝ = 0 → ⟪R t e, v t⟫_ℝ = 0 + R_lipschitz : ∀ s t e, ‖R t e - R s e‖ ≤ 238 * |t - s| * ‖e‖ + R_early : ∀ t, t ≤ 1 → ∀ e, R t e = e + tangent_early : ∀ t, t ≤ 1 → C.tangent t = v t + +namespace CorrectionData + +variable {C : RegularCurveData E} (D : CorrectionData C) + +/-- The additive change on the actual, uniquely parameterized open tube. -/ +def change (x : C.tube) : E := + (beta C.rho ‖C.residual x‖ * D.q (C.parameter x)) • D.v (C.parameter x) + + chi C.rho ‖C.residual x‖ • (D.R (C.parameter x) (C.residual x) - C.residual x) + +/-- The actual correction inside the tube. -/ +def inside (x : C.tube) : E := (x : E) + D.change x + +/-- Gluing to the identity outside the open tube, including its boundary. -/ +def G (x : E) : E := by + classical + exact if hx : x ∈ C.tube then D.inside ⟨x, hx⟩ else x + +theorem G_of_mem (x : C.tube) : D.G (x : E) = D.inside x := by + simp only [G, dite_eq_left x.property] + +theorem G_of_not_mem {x : E} (hx : x ∉ C.tube) : D.G x = x := by + simp only [G, dite_eq_right hx] + +theorem inside_radial (x : C.tube) : + D.inside x = + (D.a (C.parameter x) + beta C.rho ‖C.residual x‖ * D.q (C.parameter x)) • + D.v (C.parameter x) + + ((1 - chi C.rho ‖C.residual x‖) • C.residual x + + chi C.rho ‖C.residual x‖ • D.R (C.parameter x) (C.residual x)) := by + have hx := C.curve_add_residual x + rw [D.curve_eq] at hx + unfold inside change + rw [← hx] + simp only [add_smul, sub_smul, one_smul, smul_sub] + abel + +include D in +theorem curve_zero : C.curve 0 = 0 := by + rw [D.curve_eq, D.a_zero, zero_smul] + +theorem norm_curve (t : ℝ) : ‖C.curve t‖ = |D.a t| := by + rw [D.curve_eq, norm_smul, Real.norm_eq_abs, D.norm_v, mul_one] + +theorem q_eq_zero {t : ℝ} (h : D.a t ≤ -1 / 8) : D.q t = 0 := by + rw [D.q_eq, min_eq_left h, sub_self] + +theorem radial_eq_min (t : ℝ) : D.a t + D.q t = min (D.a t) (-1 / 8) := by + rw [D.q_eq] + ring + +end CorrectionData + +end ThompsonNonamenability.Analytic + +end + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/CorrectionLocal.lean b/lean/OAI/GroupTheory/Thompson/CorrectionLocal.lean new file mode 100644 index 0000000000000000000000000000000000000000..27aaf783038ce5b586ab14300837fc4d28493450 --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/CorrectionLocal.lean @@ -0,0 +1,207 @@ +import OAI.GroupTheory.Thompson.CorrectionData + +namespace OAI + +/-! +# The local Lipschitz estimate for the explicit tube correction + +The radius is the distance to the curve, so its Lipschitz constant is one. +The residual itself has local Lipschitz constant eight. Keeping these two +estimates separate gives the stated constant for the two cutoff terms. +-/ + +noncomputable section + +universe uE + +namespace ThompsonNonamenability.Analytic + +variable {E : Type uE} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + +private theorem norm_smul_sub_smul_bound (a b : ℝ) (u v : E) : + ‖a • u - b • v‖ ≤ |a| * ‖u - v‖ + |a - b| * ‖v‖ := by + have hid : a • u - b • v = a • (u - v) + (a - b) • v := by + simp only [smul_sub, sub_smul] + abel + rw [hid] + exact (norm_add_le _ _).trans_eq (by simp only [norm_smul, Real.norm_eq_abs]) + +namespace RegularCurveData + +variable (C : RegularCurveData E) + +/-- The residual length is the actual distance to the curve. -/ +theorem residual_radius_lipschitz (x y : C.tube) : + |‖C.residual x‖ - ‖C.residual y‖| ≤ ‖(x : E) - (y : E)‖ := by + have hxy := Metric.infDist_le_infDist_add_dist + (x := (x : E)) (y := (y : E)) (s := Set.range C.curve) + have hyx := Metric.infDist_le_infDist_add_dist + (x := (y : E)) (y := (x : E)) (s := Set.range C.curve) + rw [dist_eq_norm] at hxy hyx + rw [norm_sub_rev (y : E) (x : E)] at hyx + rw [C.residual_norm, C.residual_norm, abs_le] + constructor <;> linarith + +end RegularCurveData + +namespace CorrectionData + +variable {C : RegularCurveData E} (D : CorrectionData C) + +include D in +/-- Subtracting the nearest curve points costs at most another seven times +the distance, on the local parameter-comparison scale. -/ +theorem residual_local_bound (x y : C.tube) + (hxy : ‖(x : E) - (y : E)‖ < C.rho) : + ‖C.residual x - C.residual y‖ ≤ 8 * ‖(x : E) - (y : E)‖ := by + have ht := C.parameter_local_bound16 x y hxy + have hc := D.curve_lipschitz (C.parameter y) (C.parameter x) + have hc' : ‖C.curve (C.parameter x) - C.curve (C.parameter y)‖ ≤ + 7 * ‖(x : E) - (y : E)‖ := by + linarith + have hid : C.residual x - C.residual y = + ((x : E) - (y : E)) - + (C.curve (C.parameter x) - C.curve (C.parameter y)) := by + simp only [RegularCurveData.residual] + abel + rw [hid] + have hn := norm_sub_le ((x : E) - (y : E)) + (C.curve (C.parameter x) - C.curve (C.parameter y)) + linarith + +/-- Local Lipschitz control of the actual corrected point. -/ +theorem inside_local_bound (x y : C.tube) + (hxy : ‖(x : E) - (y : E)‖ < C.rho) : + ‖D.inside x - D.inside y‖ ≤ + (30 + 7 / (4 * C.rho) + 3808 * C.rho) * ‖(x : E) - (y : E)‖ := by + let d : ℝ := ‖(x : E) - (y : E)‖ + let s : ℝ := C.parameter x + let t : ℝ := C.parameter y + let e : E := C.residual x + let f : E := C.residual y + have hd : 0 ≤ d := norm_nonneg _ + have hrho : 0 < C.rho := C.rho_pos + have he : ‖e‖ ≤ C.rho := (C.residual_norm_lt x).le + have hf : ‖f‖ ≤ C.rho := (C.residual_norm_lt y).le + have hst : |s - t| ≤ 16 * d := C.parameter_local_bound16 x y hxy + have hef : ‖e - f‖ ≤ 8 * d := D.residual_local_bound x y hxy + have hr : |‖e‖ - ‖f‖| ≤ d := C.residual_radius_lipschitz x y + have hq : |D.q s - D.q t| ≤ 2 * d := by + have h := D.q_lipschitz t s + linarith + have hv : ‖D.v s - D.v t‖ ≤ 16 * d := + (D.v_lipschitz t s).trans hst + have hqv : ‖D.q s • D.v s - D.q t • D.v t‖ ≤ 9 * d := by + calc + ‖D.q s • D.v s - D.q t • D.v t‖ + ≤ |D.q s| * ‖D.v s - D.v t‖ + + |D.q s - D.q t| * ‖D.v t‖ := norm_smul_sub_smul_bound _ _ _ _ + _ ≤ (7 / 16) * (16 * d) + (2 * d) * 1 := + add_le_add + (mul_le_mul (D.q_bound s) hv (norm_nonneg _) (by norm_num)) + (mul_le_mul hq (le_of_eq (D.norm_v t)) (norm_nonneg _) (by positivity)) + _ = 9 * d := by ring + have hqvt : ‖D.q t • D.v t‖ ≤ 7 / 16 := by + simpa only [norm_smul, Real.norm_eq_abs, D.norm_v, mul_one] using D.q_bound t + have hbeta : |beta C.rho ‖e‖ - beta C.rho ‖f‖| ≤ (4 / C.rho) * d := + (beta_abs_sub_le hrho _ _).trans + (mul_le_mul_of_nonneg_left hr (by positivity)) + have hchi : |chi C.rho ‖e‖ - chi C.rho ‖f‖| ≤ (2 / C.rho) * d := + (chi_abs_sub_le hrho _ _).trans + (mul_le_mul_of_nonneg_left hr (by positivity)) + have hbeta_abs : |beta C.rho ‖e‖| ≤ 1 := by + rw [abs_of_nonneg (beta_nonneg _ _)] + exact beta_le_one _ _ + have hchi_abs : |chi C.rho ‖e‖| ≤ 1 := by + rw [abs_of_nonneg (chi_nonneg _ _)] + exact chi_le_one _ _ + have hradial : + ‖(beta C.rho ‖e‖ * D.q s) • D.v s - + (beta C.rho ‖f‖ * D.q t) • D.v t‖ ≤ + (9 + 7 / (4 * C.rho)) * d := by + rw [mul_smul, mul_smul] + calc + ‖beta C.rho ‖e‖ • (D.q s • D.v s) - + beta C.rho ‖f‖ • (D.q t • D.v t)‖ + ≤ |beta C.rho ‖e‖| * ‖D.q s • D.v s - D.q t • D.v t‖ + + |beta C.rho ‖e‖ - beta C.rho ‖f‖| * ‖D.q t • D.v t‖ := + norm_smul_sub_smul_bound _ _ _ _ + _ ≤ 1 * (9 * d) + ((4 / C.rho) * d) * (7 / 16) := + add_le_add + (mul_le_mul hbeta_abs hqv (norm_nonneg _) zero_le_one) + (mul_le_mul hbeta hqvt (norm_nonneg _) (by positivity)) + _ = (9 + 7 / (4 * C.rho)) * d := by + field_simp [ne_of_gt hrho] ; ring + have hrotation : ‖D.R s f - D.R t f‖ ≤ 3808 * C.rho * d := by + calc + ‖D.R s f - D.R t f‖ ≤ 238 * |s - t| * ‖f‖ := D.R_lipschitz t s f + _ ≤ (238 * (16 * d)) * C.rho := + mul_le_mul (mul_le_mul_of_nonneg_left hst (by norm_num)) hf + (norm_nonneg _) (by positivity) + _ = 3808 * C.rho * d := by ring + have hdefect_norm : ‖D.R t f - f‖ ≤ 2 * C.rho := by + have h := norm_sub_le (D.R t f) f + rw [D.norm_R] at h + linarith + have hdefect : ‖(D.R s e - e) - (D.R t f - f)‖ ≤ + (16 + 3808 * C.rho) * d := by + have hid : (D.R s e - e) - (D.R t f - f) = + (D.R s (e - f) + (D.R s f - D.R t f)) - (e - f) := by + rw [map_sub] + abel + calc + ‖(D.R s e - e) - (D.R t f - f)‖ + = ‖(D.R s (e - f) + (D.R s f - D.R t f)) - (e - f)‖ := by rw [hid] + _ ≤ ‖D.R s (e - f) + (D.R s f - D.R t f)‖ + ‖e - f‖ := norm_sub_le _ _ + _ ≤ (‖D.R s (e - f)‖ + ‖D.R s f - D.R t f‖) + ‖e - f‖ := + add_le_add (norm_add_le _ _) le_rfl + _ = (‖e - f‖ + ‖D.R s f - D.R t f‖) + ‖e - f‖ := by rw [D.norm_R] + _ ≤ (8 * d + 3808 * C.rho * d) + 8 * d := + add_le_add (add_le_add hef hrotation) hef + _ = (16 + 3808 * C.rho) * d := by ring + have hangular : + ‖chi C.rho ‖e‖ • (D.R s e - e) - chi C.rho ‖f‖ • (D.R t f - f)‖ ≤ + (20 + 3808 * C.rho) * d := by + calc + ‖chi C.rho ‖e‖ • (D.R s e - e) - chi C.rho ‖f‖ • (D.R t f - f)‖ + ≤ |chi C.rho ‖e‖| * ‖(D.R s e - e) - (D.R t f - f)‖ + + |chi C.rho ‖e‖ - chi C.rho ‖f‖| * ‖D.R t f - f‖ := + norm_smul_sub_smul_bound _ _ _ _ + _ ≤ 1 * ((16 + 3808 * C.rho) * d) + ((2 / C.rho) * d) * (2 * C.rho) := + add_le_add + (mul_le_mul hchi_abs hdefect (norm_nonneg _) zero_le_one) + (mul_le_mul hchi hdefect_norm (norm_nonneg _) (by positivity)) + _ = (20 + 3808 * C.rho) * d := by + field_simp [ne_of_gt hrho] ; ring + have hchange : ‖D.change x - D.change y‖ ≤ + (29 + 7 / (4 * C.rho) + 3808 * C.rho) * d := by + have hid : D.change x - D.change y = + ((beta C.rho ‖e‖ * D.q s) • D.v s - + (beta C.rho ‖f‖ * D.q t) • D.v t) + + (chi C.rho ‖e‖ • (D.R s e - e) - + chi C.rho ‖f‖ • (D.R t f - f)) := by + dsimp [change, s, t, e, f] + abel + rw [hid] + exact (norm_add_le _ _).trans ((add_le_add hradial hangular).trans_eq (by ring)) + have hid : D.inside x - D.inside y = + ((x : E) - (y : E)) + (D.change x - D.change y) := by + simp only [inside] + abel + rw [hid] + calc + ‖((x : E) - (y : E)) + (D.change x - D.change y)‖ + ≤ d + ‖D.change x - D.change y‖ := norm_add_le _ _ + _ ≤ d + (29 + 7 / (4 * C.rho) + 3808 * C.rho) * d := add_le_add le_rfl hchange + _ = (30 + 7 / (4 * C.rho) + 3808 * C.rho) * ‖(x : E) - (y : E)‖ := by + change d + (29 + 7 / (4 * C.rho) + 3808 * C.rho) * d = + (30 + 7 / (4 * C.rho) + 3808 * C.rho) * d + ring + +end CorrectionData + +end ThompsonNonamenability.Analytic + +end + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/CorrectionNonzero.lean b/lean/OAI/GroupTheory/Thompson/CorrectionNonzero.lean new file mode 100644 index 0000000000000000000000000000000000000000..678fc52322abdf9b6b705d9553fec1234318d719 --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/CorrectionNonzero.lean @@ -0,0 +1,199 @@ +import OAI.GroupTheory.Thompson.CorrectionData + +namespace OAI + +/-! +# The correction stays away from zero and fixes the outer annulus + +The lower bound follows from the two orthogonal inner regions and the two +parameter cases in the outer tube region. All estimates concern the explicit +formula defined in `CorrectionData`. +-/ + +noncomputable section + +universe uE + +namespace ThompsonNonamenability.Analytic + +open Set +open scoped InnerProductSpace + +variable {E : Type uE} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + +namespace CorrectionData + +variable {C : RegularCurveData E} (D : CorrectionData C) + +private theorem norm_left_le_of_perp {u w : E} (h : ⟪u, w⟫_ℝ = 0) : + ‖u‖ ≤ ‖u + w‖ := by + have heq := norm_add_sq_eq_norm_sq_add_norm_sq_real h + nlinarith [norm_nonneg u, norm_nonneg (u + w), sq_nonneg ‖w‖] + +private theorem norm_right_le_of_perp {u w : E} (h : ⟪u, w⟫_ℝ = 0) : + ‖w‖ ≤ ‖u + w‖ := by + have heq := norm_add_sq_eq_norm_sq_add_norm_sq_real h + nlinarith [norm_nonneg w, norm_nonneg (u + w), sq_nonneg ‖u‖] + +private theorem radial_perp (a : ℝ) {v w : E} (h : ⟪w, v⟫_ℝ = 0) : + ⟪a • v, w⟫_ℝ = 0 := by + have hvw : ⟪v, w⟫_ℝ = 0 := by rw [real_inner_comm]; exact h + simp only [real_inner_smul_left, hvw, mul_zero] + +/-- The orthogonal formula throughout the inner half of the tube. -/ +theorem inside_inner_formula (x : C.tube) (hr : ‖C.residual x‖ ≤ C.rho / 2) : + D.inside x = + (D.a (C.parameter x) + beta C.rho ‖C.residual x‖ * D.q (C.parameter x)) • + D.v (C.parameter x) + D.R (C.parameter x) (C.residual x) := by + rw [D.inside_radial, chi_eq_one C.rho_pos _ hr] + simp only [sub_self, zero_smul, one_smul, zero_add] + +private theorem inside_inner_radial_lower (x : C.tube) + (hr : ‖C.residual x‖ ≤ C.rho / 2) : + |D.a (C.parameter x) + beta C.rho ‖C.residual x‖ * D.q (C.parameter x)| ≤ + ‖D.inside x‖ := by + rw [D.inside_inner_formula x hr] + have h := norm_left_le_of_perp + (radial_perp + (D.a (C.parameter x) + beta C.rho ‖C.residual x‖ * D.q (C.parameter x)) + (D.R_perp _ _ (C.residual_perp_u x))) + simpa only [norm_smul, Real.norm_eq_abs, D.norm_v, mul_one] using h + +private theorem inside_inner_residual_lower (x : C.tube) + (hr : ‖C.residual x‖ ≤ C.rho / 2) : + ‖C.residual x‖ ≤ ‖D.inside x‖ := by + rw [D.inside_inner_formula x hr] + have h := norm_right_le_of_perp + (radial_perp + (D.a (C.parameter x) + beta C.rho ‖C.residual x‖ * D.q (C.parameter x)) + (D.R_perp _ _ (C.residual_perp_u x))) + simpa only [D.norm_R] using h + +/-- Convex interpolation between the identity and the rotation is a contraction +on each individual residual. -/ +theorem residual_blend_norm_le (x : C.tube) : + ‖(1 - chi C.rho ‖C.residual x‖) • C.residual x + + chi C.rho ‖C.residual x‖ • D.R (C.parameter x) (C.residual x)‖ ≤ + ‖C.residual x‖ := by + have hχ := chi_nonneg C.rho ‖C.residual x‖ + have hχ' := chi_le_one C.rho ‖C.residual x‖ + calc + _ ≤ ‖(1 - chi C.rho ‖C.residual x‖) • C.residual x‖ + + ‖chi C.rho ‖C.residual x‖ • D.R (C.parameter x) (C.residual x)‖ := + norm_add_le _ _ + _ = (1 - chi C.rho ‖C.residual x‖) * ‖C.residual x‖ + + chi C.rho ‖C.residual x‖ * ‖C.residual x‖ := by + rw [norm_smul, norm_smul, Real.norm_eq_abs, Real.norm_eq_abs, + abs_of_nonneg (sub_nonneg.mpr hχ'), abs_of_nonneg hχ, D.norm_R] + _ = ‖C.residual x‖ := by ring + +/-- On the early part of the curve the rotation term vanishes identically. -/ +theorem inside_early_formula (x : C.tube) (ht : C.parameter x ≤ 1) : + D.inside x = + (D.a (C.parameter x) + beta C.rho ‖C.residual x‖ * D.q (C.parameter x)) • + D.v (C.parameter x) + C.residual x := by + rw [D.inside_radial, D.R_early _ ht] + congr 1 + rw [← add_smul] + have heq : 1 - chi C.rho ‖C.residual x‖ + chi C.rho ‖C.residual x‖ = 1 := + sub_add_cancel _ _ + rw [heq, one_smul] + +private theorem inside_early_residual_lower (x : C.tube) + (ht : C.parameter x ≤ 1) : ‖C.residual x‖ ≤ ‖D.inside x‖ := by + rw [D.inside_early_formula x ht] + have hperp : ⟪C.residual x, D.v (C.parameter x)⟫_ℝ = 0 := by + have h := C.residual_perp_u x + rwa [D.tangent_early _ ht] at h + exact norm_right_le_of_perp (radial_perp _ hperp) + +/-- The four tube regions give the same positive lower bound. -/ +theorem inside_lower (x : C.tube) : C.rho / 4 ≤ ‖D.inside x‖ := by + have hρ := C.rho_le + have hρpos := C.rho_pos + by_cases hquarter : ‖C.residual x‖ ≤ C.rho / 4 + · have hhalf : ‖C.residual x‖ ≤ C.rho / 2 := by linarith + have h := D.inside_inner_radial_lower x hhalf + rw [beta_eq_one C.rho_pos _ hquarter, one_mul, D.radial_eq_min] at h + have hm : min (D.a (C.parameter x)) (-1 / 8) ≤ -1 / 8 := min_le_right _ _ + rw [abs_of_nonpos (by linarith : min (D.a (C.parameter x)) (-1 / 8) ≤ 0)] at h + linarith + · have hquarter' : C.rho / 4 ≤ ‖C.residual x‖ := le_of_not_ge hquarter + by_cases hhalf : ‖C.residual x‖ ≤ C.rho / 2 + · exact hquarter'.trans (D.inside_inner_residual_lower x hhalf) + · have hhalf' : C.rho / 2 ≤ ‖C.residual x‖ := le_of_not_ge hhalf + by_cases ht : C.parameter x ≤ 1 + · exact hquarter'.trans (D.inside_early_residual_lower x ht) + · have ha : 1 / 8 ≤ D.a (C.parameter x) := + D.a_late_lower _ (lt_of_not_ge ht) + have hrad := D.inside_radial x + rw [beta_eq_zero C.rho_pos _ hhalf', zero_mul, add_zero] at hrad + let w : E := (1 - chi C.rho ‖C.residual x‖) • C.residual x + + chi C.rho ‖C.residual x‖ • D.R (C.parameter x) (C.residual x) + have hw : ‖w‖ ≤ ‖C.residual x‖ := D.residual_blend_norm_le x + have htriangle : ‖D.a (C.parameter x) • D.v (C.parameter x)‖ ≤ + ‖D.inside x‖ + ‖w‖ := by + rw [hrad] + simpa only [add_sub_cancel_right] using + norm_sub_le (D.a (C.parameter x) • D.v (C.parameter x) + w) w + rw [norm_smul, Real.norm_eq_abs, D.norm_v, mul_one, + abs_of_nonneg (by linarith : 0 ≤ D.a (C.parameter x))] at htriangle + have hr := C.residual_norm_lt x + linarith + +/-- The explicit correction has a uniform positive norm everywhere. -/ +theorem G_lower (x : E) : C.rho / 4 ≤ ‖D.G x‖ := by + by_cases hx : x ∈ C.tube + · rw [D.G_of_mem ⟨x, hx⟩] + exact D.inside_lower ⟨x, hx⟩ + · rw [D.G_of_not_mem hx] + have hdist : C.rho ≤ Metric.infDist x (range C.curve) := by + exact le_of_not_gt hx + have hzero : (0 : E) ∈ range C.curve := ⟨0, D.curve_zero⟩ + have hnorm : Metric.infDist x (range C.curve) ≤ ‖x‖ := by + simpa only [dist_zero_right] using Metric.infDist_le_dist_of_mem hzero + have hρ := C.rho_pos + linarith + +/-- Any tube point of norm at least one half has parameter on the unchanged +negative ray, so both additive corrections vanish. -/ +theorem inside_outer (x : C.tube) (hx : 1 / 2 ≤ ‖(x : E)‖) : + D.inside x = (x : E) := by + have htriangle : ‖(x : E)‖ ≤ |D.a (C.parameter x)| + ‖C.residual x‖ := by + calc + ‖(x : E)‖ = ‖C.curve (C.parameter x) + C.residual x‖ := + congrArg norm (C.curve_add_residual x).symm + _ ≤ ‖C.curve (C.parameter x)‖ + ‖C.residual x‖ := norm_add_le _ _ + _ = |D.a (C.parameter x)| + ‖C.residual x‖ := by rw [D.norm_curve] + have hr := C.residual_norm_lt x + have hρ := C.rho_le + have haupper := D.a_upper (C.parameter x) + have haneg : D.a (C.parameter x) < -1 / 8 := by + by_contra hn + have ha_lower : -1 / 8 ≤ D.a (C.parameter x) := le_of_not_gt hn + have habs : |D.a (C.parameter x)| ≤ 5 / 16 := + abs_le.mpr ⟨by linarith, haupper⟩ + linarith + have ht : C.parameter x ≤ 1 := by + by_contra hn + have := D.a_late_lower (C.parameter x) (lt_of_not_ge hn) + linarith + have hq : D.q (C.parameter x) = 0 := D.q_eq_zero haneg.le + unfold inside change + rw [hq, mul_zero, zero_smul, D.R_early _ ht, sub_self, smul_zero, + add_zero, add_zero] + +/-- The correction is exactly the identity on the whole outer annulus. -/ +theorem G_outer (x : E) (hx : 1 / 2 ≤ ‖x‖) : D.G x = x := by + by_cases htube : x ∈ C.tube + · rw [D.G_of_mem ⟨x, htube⟩] + exact D.inside_outer ⟨x, htube⟩ hx + · exact D.G_of_not_mem htube + +end CorrectionData + +end ThompsonNonamenability.Analytic + +end + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/CorrelationVariance.lean b/lean/OAI/GroupTheory/Thompson/CorrelationVariance.lean new file mode 100644 index 0000000000000000000000000000000000000000..2fad03d078e91ecdfe9d43d1fde6fa5b02b300c4 --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/CorrelationVariance.lean @@ -0,0 +1,225 @@ +import OAI.GroupTheory.Thompson.FiniteAverage +import OAI.GroupTheory.Thompson.HilbertAverage +import Mathlib.Algebra.BigOperators.Group.Finset.Piecewise +import Mathlib.Tactic.FieldSimp +import Mathlib.Tactic.Linarith +import Mathlib.Tactic.Ring + +namespace OAI + +/-! +# Exact finite correlation and variance estimates + +The diagonal and off-diagonal coefficients are exact finite counts. The mixed +sum has one exceptional parent column, hence D nested terms and D(D-1) +separated terms. Every count identity permits arbitrary signed coefficients. +The final cancellation imposes no positivity assumption on the common +correlation alpha. +-/ + +noncomputable section + +universe uG uE + +namespace ThompsonNonamenability + +open scoped BigOperators InnerProductSpace + +variable {D : ℕ} + +/-- One distinguished position and all the other positions, with signed values. -/ +theorem sum_one_exception (i : Fin D) (b c : ℝ) : + (∑ j : Fin D, if j = i then b else c) = b + ((D : ℝ) - 1) * c := by + classical + have hterm (j : Fin D) : + (if j = i then b else c) = c + (if j = i then b - c else 0) := by + by_cases h : j = i <;> simp [h] + simp_rw [hterm] + simp only [Finset.sum_add_distrib, Fintype.sum_ite_eq', Finset.sum_const, + Finset.card_univ, Fintype.card_fin, nsmul_eq_mul] + ring + +/-- D diagonal terms and D(D-1) off-diagonal terms, with no sign premise. -/ +theorem sum_matrix_le (K : Fin D → Fin D → ℝ) (b c : ℝ) + (hdiag : ∀ j, K j j ≤ b) + (hoff : ∀ j k, j ≠ k → K j k ≤ c) : + (∑ j, ∑ k, K j k) ≤ + (D : ℝ) * ((D : ℝ) - 1) * c + (D : ℝ) * b := by + classical + calc + (∑ j, ∑ k, K j k) ≤ ∑ j : Fin D, ∑ k : Fin D, if k = j then b else c := by + apply Finset.sum_le_sum + intro j _ + apply Finset.sum_le_sum + intro k _ + by_cases h : k = j + · subst k + simpa using hdiag j + · simpa only [ite_eq_right h] using hoff j k (Ne.symm h) + _ = (D : ℝ) * ((D : ℝ) - 1) * c + (D : ℝ) * b := by + simp_rw [sum_one_exception] + simp only [Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul] + ring + +/-- The exceptional column contributes D terms, irrespective of the row index. -/ +theorem sum_fixed_column_ge (i : Fin D) (K : Fin D → Fin D → ℝ) (b c : ℝ) + (hnested : ∀ j, b ≤ K j i) + (hsep : ∀ j k, k ≠ i → c ≤ K j k) : + (D : ℝ) * ((D : ℝ) - 1) * c + (D : ℝ) * b ≤ ∑ j, ∑ k, K j k := by + classical + calc + (D : ℝ) * ((D : ℝ) - 1) * c + (D : ℝ) * b = + ∑ _j : Fin D, ∑ k : Fin D, if k = i then b else c := by + simp_rw [sum_one_exception] + simp only [Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul] + ring + _ ≤ ∑ j, ∑ k, K j k := by + apply Finset.sum_le_sum + intro j _ + apply Finset.sum_le_sum + intro k _ + by_cases h : k = i + · subst k + simpa using hnested j + · simpa only [ite_eq_right h] using hsep j k h + +private theorem normalize_pair_total (hD : 0 < D) (b c : ℝ) : + ((D : ℝ)⁻¹)^2 * ((D : ℝ) * ((D : ℝ) - 1) * c + (D : ℝ) * b) = + (1 - (D : ℝ)⁻¹) * c + (D : ℝ)⁻¹ * b := by + have hd : (D : ℝ) ≠ 0 := ne_of_gt (Nat.cast_pos.mpr hD) + field_simp [hd] + +variable {G : Type uG} {E : Type uE} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + +/-- The literal finite average of the real inner product. -/ +def corr (A : Finset G) (x y : G → E) : ℝ := + realAvg A (fun g => ⟪x g, y g⟫_ℝ) + +theorem corr_comm (A : Finset G) (x y : G → E) : corr A x y = corr A y x := by + unfold corr + apply realAvg_congr + intro g _ + exact real_inner_comm (y g) (x g) + +theorem unit_inner_abs_le (x y : E) (hx : ‖x‖ ≤ 1) (hy : ‖y‖ ≤ 1) : + |⟪x, y⟫_ℝ| ≤ 1 := by + calc + |⟪x, y⟫_ℝ| ≤ ‖x‖ * ‖y‖ := abs_real_inner_le_norm x y + _ ≤ 1 * 1 := mul_le_mul hx hy (norm_nonneg y) zero_le_one + _ = 1 := by ring + +theorem corr_abs_le_one (A : Finset G) (hA : A.Nonempty) (x y : G → E) + (hx : ∀ g ∈ A, ‖x g‖ ≤ 1) (hy : ∀ g ∈ A, ‖y g‖ ≤ 1) : + |corr A x y| ≤ 1 := by + unfold corr + apply abs_le.mpr + constructor + · apply const_le_realAvg A hA + intro g hg + exact (abs_le.mp (unit_inner_abs_le (x g) (y g) (hx g hg) (hy g hg))).1 + · apply realAvg_le_const A hA + intro g hg + exact (abs_le.mp (unit_inner_abs_le (x g) (y g) (hx g hg) (hy g hg))).2 + +theorem realAvg_norm_finMean_sq (A : Finset G) (x : G → Fin D → E) : + realAvg A (fun g => ‖finMean (x g)‖^2) = + ((D : ℝ)⁻¹)^2 * ∑ j, ∑ k, corr A (fun g => x g j) (fun g => x g k) := by + simp only [norm_finMean_sq, realAvg_const_mul, realAvg_sum_univ, corr] + +theorem corr_finMean (A : Finset G) (x y : G → Fin D → E) : + corr A (fun g => finMean (x g)) (fun g => finMean (y g)) = + ((D : ℝ)⁻¹)^2 * ∑ j, ∑ k, corr A (fun g => x g j) (fun g => y g k) := by + simp only [corr, inner_finMean, pow_two, realAvg_const_mul, realAvg_sum_univ] + +theorem realAvg_norm_sub_sq (A : Finset G) (x y : G → E) : + realAvg A (fun g => ‖x g - y g‖^2) = + realAvg A (fun g => ‖x g‖^2) - 2 * corr A x y + + realAvg A (fun g => ‖y g‖^2) := by + simp only [norm_sub_sq_real, realAvg_add, realAvg_sub, realAvg_const_mul, corr] + +/-- Parent or sibling averages: the same exact diagonal count applies to both. -/ +theorem realAvg_norm_finMean_sq_le (A : Finset G) (hA : A.Nonempty) + (hD : 0 < D) (x : G → Fin D → E) (c : ℝ) + (hx : ∀ g ∈ A, ∀ j, ‖x g j‖ ≤ 1) + (hsep : ∀ j k, j ≠ k → corr A (fun g => x g j) (fun g => x g k) ≤ c) : + realAvg A (fun g => ‖finMean (x g)‖^2) ≤ + (1 - (D : ℝ)⁻¹) * c + (D : ℝ)⁻¹ := by + rw [realAvg_norm_finMean_sq] + have hdiag (j : Fin D) : corr A (fun g => x g j) (fun g => x g j) ≤ 1 := + (abs_le.mp (corr_abs_le_one A hA _ _ + (fun g hg => hx g hg j) (fun g hg => hx g hg j))).2 + calc + ((D : ℝ)⁻¹)^2 * ∑ j, ∑ k, corr A (fun g => x g j) (fun g => x g k) ≤ + ((D : ℝ)⁻¹)^2 * ((D : ℝ) * ((D : ℝ) - 1) * c + (D : ℝ) * 1) := + mul_le_mul_of_nonneg_left (sum_matrix_le _ 1 c hdiag hsep) (sq_nonneg _) + _ = (1 - (D : ℝ)⁻¹) * c + (D : ℝ)⁻¹ := by + simpa only [mul_one] using normalize_pair_total hD 1 c + +/-- Only the designated parent column is uncontrolled in a mixed sum. -/ +theorem corr_finMean_ge (A : Finset G) (hA : A.Nonempty) (hD : 0 < D) + (i : Fin D) (z x : G → Fin D → E) (c : ℝ) + (hz : ∀ g ∈ A, ∀ j, ‖z g j‖ ≤ 1) + (hx : ∀ g ∈ A, ∀ k, ‖x g k‖ ≤ 1) + (hsep : ∀ j k, k ≠ i → c ≤ corr A (fun g => z g j) (fun g => x g k)) : + (1 - (D : ℝ)⁻¹) * c - (D : ℝ)⁻¹ ≤ + corr A (fun g => finMean (z g)) (fun g => finMean (x g)) := by + have hnested (j : Fin D) : -1 ≤ corr A (fun g => z g j) (fun g => x g i) := + (abs_le.mp (corr_abs_le_one A hA _ _ + (fun g hg => hz g hg j) (fun g hg => hx g hg i))).1 + calc + (1 - (D : ℝ)⁻¹) * c - (D : ℝ)⁻¹ = + ((D : ℝ)⁻¹)^2 * ((D : ℝ) * ((D : ℝ) - 1) * c + (D : ℝ) * (-1)) := by + rw [normalize_pair_total hD] + ring + _ ≤ ((D : ℝ)⁻¹)^2 * ∑ j, ∑ k, corr A (fun g => z g j) (fun g => x g k) := + mul_le_mul_of_nonneg_left (sum_fixed_column_ge i _ (-1) c hnested hsep) + (sq_nonneg _) + _ = corr A (fun g => finMean (z g)) (fun g => finMean (x g)) := + (corr_finMean A z x).symm + +/-- The finite Hilbert variance bound with exact cancellation of signed alpha. -/ +theorem finite_variance_bound (A : Finset G) (hA : A.Nonempty) (hD : 0 < D) + (x : G → Fin D → E) (y : G → Fin D → Fin D → E) (α η : ℝ) + (hx : ∀ g ∈ A, ∀ k, ‖x g k‖ ≤ 1) + (hy : ∀ g ∈ A, ∀ i j, ‖y g i j‖ ≤ 1) + (hparent : ∀ j k, j ≠ k → + |corr A (fun g => x g j) (fun g => x g k) - α| ≤ η) + (hchild : ∀ i j k, j ≠ k → + |corr A (fun g => y g i j) (fun g => y g i k) - α| ≤ η) + (hmixed : ∀ i j k, k ≠ i → + |corr A (fun g => y g i j) (fun g => x g k) - α| ≤ η) : + ∀ i, realAvg A (fun g => ‖finMean (y g i) - finMean (x g)‖^2) ≤ + 4 / (D : ℝ) + 4 * (1 - 1 / (D : ℝ)) * η := by + intro i + have hp := realAvg_norm_finMean_sq_le A hA hD x (α + η) hx (by + intro j k hjk + have h := (abs_le.mp (hparent j k hjk)).2 + linarith) + have hq := realAvg_norm_finMean_sq_le A hA hD (fun g => y g i) (α + η) + (fun g hg => hy g hg i) (by + intro j k hjk + have h := (abs_le.mp (hchild i j k hjk)).2 + linarith) + have hm := corr_finMean_ge A hA hD i (fun g => y g i) x (α - η) + (fun g hg => hy g hg i) hx (by + intro j k hki + have h := (abs_le.mp (hmixed i j k hki)).1 + linarith) + rw [realAvg_norm_sub_sq] + calc + realAvg A (fun g => ‖finMean (y g i)‖^2) - + 2 * corr A (fun g => finMean (y g i)) (fun g => finMean (x g)) + + realAvg A (fun g => ‖finMean (x g)‖^2) ≤ + ((1 - (D : ℝ)⁻¹) * (α + η) + (D : ℝ)⁻¹) - + 2 * ((1 - (D : ℝ)⁻¹) * (α - η) - (D : ℝ)⁻¹) + + ((1 - (D : ℝ)⁻¹) * (α + η) + (D : ℝ)⁻¹) := by + linarith only [hp, hq, hm] + _ = 4 / (D : ℝ) + 4 * (1 - 1 / (D : ℝ)) * η := by + simp only [div_eq_mul_inv, one_mul] + ring + +end ThompsonNonamenability + +end + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/DisplacementEstimate.lean b/lean/OAI/GroupTheory/Thompson/DisplacementEstimate.lean new file mode 100644 index 0000000000000000000000000000000000000000..68ec1a5a12376eba57fa80755c6c359fbf8374bb --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/DisplacementEstimate.lean @@ -0,0 +1,69 @@ +import OAI.GroupTheory.Thompson.HilbertAverage +import Mathlib.Tactic.Ring + +namespace OAI + +/-! +# Displacement forces a lower bound for the finite mean energy + +The recursive identities concern the individual vectors, not the image of +their mean under the Lipschitz map. Squared-norm convexity is applied to the +mean of the differences of the images. +-/ + +open scoped BigOperators + +universe uE + +namespace ThompsonNonamenability + +variable {E : Type uE} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + +/-- The pointwise inequality obtained from the actual recursive colors. -/ +theorem displacement_le_mean_energy {D : ℕ} (hD : 0 < D) + (f : UnitBall E → UnitBall E) (L δ : ℝ) + (_hL : 0 < L) (hδ : 0 < δ) + (hLip : ∀ u v, ‖(f u : E) - f v‖ ≤ L * ‖(u : E) - v‖) + (hDisp : ∀ u, δ ≤ ‖(f u : E) - u‖) + (x z : Fin D → UnitBall E) (hrec : ∀ i, x i = f (z i)) : + δ ^ 2 ≤ L ^ 2 * (D : ℝ)⁻¹ * + ∑ i, ‖(z i : E) - (ballMean hD x : E)‖ ^ 2 := by + have hxmean : finMean (fun i => (f (z i) : E)) = (ballMean hD x : E) := by + rw [coe_ballMean] + apply congrArg finMean + funext i + exact congrArg Subtype.val (hrec i).symm + have hmean : finMean (fun i => (f (z i) : E) - (f (ballMean hD x) : E)) = + (ballMean hD x : E) - (f (ballMean hD x) : E) := by + rw [finMean_sub, finMean_const hD, hxmean] + have hdis : δ ≤ ‖(ballMean hD x : E) - (f (ballMean hD x) : E)‖ := by + calc + δ ≤ ‖(f (ballMean hD x) : E) - (ballMean hD x : E)‖ := hDisp _ + _ = ‖(ballMean hD x : E) - (f (ballMean hD x) : E)‖ := norm_sub_rev _ _ + have hlip_sq (i : Fin D) : + ‖(f (z i) : E) - (f (ballMean hD x) : E)‖ ^ 2 ≤ + L ^ 2 * ‖(z i : E) - (ballMean hD x : E)‖ ^ 2 := by + calc + _ ≤ (L * ‖(z i : E) - (ballMean hD x : E)‖) ^ 2 := + pow_le_pow_left₀ (norm_nonneg _) (hLip (z i) (ballMean hD x)) 2 + _ = _ := mul_pow _ _ _ + have hjensen := norm_finMean_sq_le hD + (fun i => (f (z i) : E) - (f (ballMean hD x) : E)) + rw [hmean] at hjensen + calc + δ ^ 2 ≤ ‖(ballMean hD x : E) - (f (ballMean hD x) : E)‖ ^ 2 := + pow_le_pow_left₀ hδ.le hdis 2 + _ ≤ (D : ℝ)⁻¹ * ∑ i, + ‖(f (z i) : E) - (f (ballMean hD x) : E)‖ ^ 2 := hjensen + _ ≤ (D : ℝ)⁻¹ * ∑ i, + L ^ 2 * ‖(z i : E) - (ballMean hD x : E)‖ ^ 2 := + mul_le_mul_of_nonneg_left (Finset.sum_le_sum (fun i _ => hlip_sq i)) + (inv_nonneg.mpr (Nat.cast_nonneg D)) + _ = L ^ 2 * (D : ℝ)⁻¹ * + ∑ i, ‖(z i : E) - (ballMean hD x : E)‖ ^ 2 := by + rw [← Finset.mul_sum] + ring + +end ThompsonNonamenability + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/DyadicArithmetic.lean b/lean/OAI/GroupTheory/Thompson/DyadicArithmetic.lean new file mode 100644 index 0000000000000000000000000000000000000000..d1229c47fa63e1d9315b992d626abbe788745b4a --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/DyadicArithmetic.lean @@ -0,0 +1,158 @@ +import OAI.GroupTheory.Thompson.Model +import Mathlib.Basic.Real.Basic +import Mathlib.Data.Finset.Basic +import Mathlib.Tactic.FieldSimp +import Mathlib.Tactic.NormNum +import Mathlib.Tactic.Ring + +namespace OAI + +/-! +# Real dyadic arithmetic + +Dyadic numbers are represented by an integer numerator and a nonnegative +power of two denominator. In particular, the grid denominator below is an +actual common denominator, not an assumption about the input finite set. +-/ + +universe uα + +namespace ThompsonNonamenability + +theorem isDyadic_div_pow (k : ℤ) (n : ℕ) : + IsDyadic ((k : ℝ) / (2 : ℝ) ^ n) := + ⟨k, n, rfl⟩ + +theorem isDyadic_intCast (k : ℤ) : IsDyadic (k : ℝ) := by + exact ⟨k, 0, by simp⟩ + +theorem isDyadic_natCast (k : ℕ) : IsDyadic (k : ℝ) := by + simpa only [Int.cast_natCast] using isDyadic_intCast (k : ℤ) + +@[simp] theorem isDyadic_zero : IsDyadic (0 : ℝ) := by + simpa using isDyadic_intCast 0 + +@[simp] theorem isDyadic_one : IsDyadic (1 : ℝ) := by + simpa using isDyadic_intCast 1 + +theorem IsDyadic.neg {x : ℝ} (hx : IsDyadic x) : IsDyadic (-x) := by + rcases hx with ⟨k, n, rfl⟩ + exact ⟨-k, n, by simp only [Int.cast_neg, neg_div]⟩ + +theorem IsDyadic.mul {x y : ℝ} (hx : IsDyadic x) (hy : IsDyadic y) : + IsDyadic (x * y) := by + rcases hx with ⟨k, n, rfl⟩ + rcases hy with ⟨l, m, rfl⟩ + refine ⟨k * l, n + m, ?_⟩ + simp only [Int.cast_mul, pow_add, div_mul_div_comm] + +theorem IsDyadic.add {x y : ℝ} (hx : IsDyadic x) (hy : IsDyadic y) : + IsDyadic (x + y) := by + rcases hx with ⟨k, n, rfl⟩ + rcases hy with ⟨l, m, rfl⟩ + refine ⟨k * 2 ^ m + l * 2 ^ n, n + m, ?_⟩ + push_cast + rw [pow_add] + field_simp + +theorem IsDyadic.sub {x y : ℝ} (hx : IsDyadic x) (hy : IsDyadic y) : + IsDyadic (x - y) := by + simpa only [sub_eq_add_neg] using hx.add hy.neg + +theorem isDyadic_zpow (q : ℤ) : IsDyadic ((2 : ℝ) ^ q) := by + cases q with + | ofNat n => + simpa only [Int.ofNat_eq_natCast, zpow_natCast, Int.cast_pow, Int.cast_ofNat] using + isDyadic_intCast ((2 : ℤ) ^ n) + | negSucc n => + exact ⟨1, n + 1, by simp [zpow_negSucc, one_div]⟩ + +theorem IsDyadic.mul_zpow {x : ℝ} (hx : IsDyadic x) (q : ℤ) : + IsDyadic (x * (2 : ℝ) ^ q) := + hx.mul (isDyadic_zpow q) + +theorem IsDyadic.zpow_mul {x : ℝ} (hx : IsDyadic x) (q : ℤ) : + IsDyadic ((2 : ℝ) ^ q * x) := + (isDyadic_zpow q).mul hx + +theorem IsDyadic.div_zpow {x : ℝ} (hx : IsDyadic x) (q : ℤ) : + IsDyadic (x / (2 : ℝ) ^ q) := by + simpa only [div_eq_mul_inv, zpow_neg] using hx.mul_zpow (-q) + +/-- Increasing a dyadic denominator does not change the represented number. -/ +theorem dyadic_raise_denominator {x : ℝ} {n : ℕ} + (hx : ∃ k : ℤ, x = (k : ℝ) / (2 : ℝ) ^ n) (m : ℕ) : + ∃ k : ℤ, x = (k : ℝ) / (2 : ℝ) ^ (n + m) := by + rcases hx with ⟨k, rfl⟩ + refine ⟨k * 2 ^ m, ?_⟩ + push_cast + rw [pow_add] + field_simp + +theorem dyadic_denominator_mono {x : ℝ} {n N : ℕ} + (hx : ∃ k : ℤ, x = (k : ℝ) / (2 : ℝ) ^ n) (hn : n ≤ N) : + ∃ k : ℤ, x = (k : ℝ) / (2 : ℝ) ^ N := by + obtain ⟨m, rfl⟩ := Nat.exists_eq_add_of_le hn + exact dyadic_raise_denominator hx m + +/-- Every finite family of dyadic reals has a single power of two denominator. -/ +theorem dyadic_common_denominator_finset {α : Type uα} (s : Finset α) (f : α → ℝ) + (hs : ∀ a ∈ s, IsDyadic (f a)) : + ∃ n : ℕ, ∀ a ∈ s, ∃ k : ℤ, f a = (k : ℝ) / (2 : ℝ) ^ n := by + classical + induction s using Finset.induction_on with + | empty => + exact ⟨0, by simp⟩ + | @insert a s ha ih => + obtain ⟨k, n, hn⟩ := hs a (Finset.mem_insert_self a s) + obtain ⟨m, hm⟩ := ih (fun b hb => hs b (Finset.mem_insert_of_mem hb)) + refine ⟨n + m, ?_⟩ + intro b hb + rcases Finset.mem_insert.mp hb with rfl | hb + · exact dyadic_raise_denominator ⟨k, hn⟩ m + · simpa only [Nat.add_comm m n] using dyadic_raise_denominator (hm b hb) n + +theorem dyadic_common_denominator (s : Finset ℝ) + (hs : ∀ x ∈ s, IsDyadic x) : + ∃ n : ℕ, ∀ x ∈ s, ∃ k : ℤ, x = (k : ℝ) / (2 : ℝ) ^ n := + dyadic_common_denominator_finset s id hs + +/-- A dyadic representation in the unit interval has a natural grid index. -/ +theorem dyadic_nat_numerator {x : ℝ} {k : ℤ} {n : ℕ} + (hx : x = (k : ℝ) / (2 : ℝ) ^ n) (h0 : 0 ≤ x) (h1 : x ≤ 1) : + ∃ j : ℕ, j ≤ 2 ^ n ∧ x = (j : ℝ) / (2 : ℝ) ^ n := by + have hden : (0 : ℝ) < (2 : ℝ) ^ n := pow_pos (by norm_num) n + have hk0r : (0 : ℝ) ≤ (k : ℝ) := by + have hh := (le_div_iff₀ hden).1 (hx ▸ h0) + simpa only [zero_mul] using hh + have hk0 : (0 : ℤ) ≤ k := by exact_mod_cast hk0r + have hkr : (k : ℝ) ≤ (2 : ℝ) ^ n := (div_le_one hden).1 (hx ▸ h1) + have hcast : (k.toNat : ℝ) = (k : ℝ) := by + exact_mod_cast Int.toNat_of_nonneg hk0 + refine ⟨k.toNat, ?_, ?_⟩ + · have hj : (k.toNat : ℝ) ≤ (2 : ℝ) ^ n := by + simpa only [hcast] using hkr + exact_mod_cast hj + · simpa only [hcast] using hx + +theorem IsDyadic.exists_nat_grid {x : ℝ} (hx : IsDyadic x) + (h0 : 0 ≤ x) (h1 : x ≤ 1) : + ∃ (n j : ℕ), j ≤ 2 ^ n ∧ x = (j : ℝ) / (2 : ℝ) ^ n := by + obtain ⟨k, n, hk⟩ := hx + obtain ⟨j, hj, hrepr⟩ := dyadic_nat_numerator hk h0 h1 + exact ⟨n, j, hj, hrepr⟩ + +/-- One grid simultaneously contains any given finite dyadic family in `[0,1]`. -/ +theorem dyadic_common_nat_grid {α : Type uα} (s : Finset α) (f : α → ℝ) + (hd : ∀ a ∈ s, IsDyadic (f a)) + (h0 : ∀ a ∈ s, 0 ≤ f a) (h1 : ∀ a ∈ s, f a ≤ 1) : + ∃ n : ℕ, ∀ a ∈ s, ∃ j : ℕ, j ≤ 2 ^ n ∧ f a = (j : ℝ) / (2 : ℝ) ^ n := by + obtain ⟨n, hn⟩ := dyadic_common_denominator_finset s f hd + refine ⟨n, ?_⟩ + intro a ha + obtain ⟨k, hk⟩ := hn a ha + exact dyadic_nat_numerator hk (h0 a ha) (h1 a ha) + +end ThompsonNonamenability + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/DyadicGapChain.lean b/lean/OAI/GroupTheory/Thompson/DyadicGapChain.lean new file mode 100644 index 0000000000000000000000000000000000000000..ed11b5ad2475f38ccf02381638de28e542145dbc --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/DyadicGapChain.lean @@ -0,0 +1,156 @@ +import OAI.GroupTheory.Thompson.BasicInterval + +namespace OAI + +/-! +# Consecutive dyadic cells + +A chain is an ordered list of actual basic intervals whose consecutive +endpoints agree. Its endpoints and coverage are proved from this data. +-/ + +namespace ThompsonNonamenability + +noncomputable section + +/-- A finite list of consecutive cells starts at `a` and ends at `b`. +The empty list represents a gap of length zero. -/ +def GapChain : ℝ → ℝ → List BasicInterval → Prop + | a, b, [] => a = b + | a, b, I :: L => I.left = a ∧ GapChain I.right b L + +namespace GapChain + +@[simp] theorem nil_iff {a b : ℝ} : GapChain a b [] ↔ a = b := Iff.rfl + +@[simp] theorem cons_iff {a b : ℝ} {I : BasicInterval} {L : List BasicInterval} : + GapChain a b (I :: L) ↔ I.left = a ∧ GapChain I.right b L := Iff.rfl + +theorem singleton (I : BasicInterval) : GapChain I.left I.right [I] := + ⟨rfl, rfl⟩ + +@[simp] theorem singleton_iff {a b : ℝ} {I : BasicInterval} : + GapChain a b [I] ↔ I.left = a ∧ I.right = b := Iff.rfl + +theorem append {a b c : ℝ} {L M : List BasicInterval} + (hL : GapChain a b L) (hM : GapChain b c M) : GapChain a c (L ++ M) := by + induction L generalizing a with + | nil => + change a = b at hL + subst a + exact hM + | cons I L ih => + exact ⟨hL.1, ih hL.2⟩ + +theorem le_endpoints {a b : ℝ} {L : List BasicInterval} + (h : GapChain a b L) : a ≤ b := by + induction L generalizing a with + | nil => exact le_of_eq h + | cons I L ih => + calc + a = I.left := h.1.symm + _ ≤ I.right := I.left_lt_right.le + _ ≤ b := ih h.2 + +theorem lt_endpoints_of_ne_nil {a b : ℝ} {L : List BasicInterval} + (h : GapChain a b L) (hL : L ≠ []) : a < b := by + cases L with + | nil => exact False.elim (hL rfl) + | cons I L => + calc + a = I.left := h.1.symm + _ < I.right := I.left_lt_right + _ ≤ b := h.2.le_endpoints + +theorem ne_nil_of_lt_endpoints {a b : ℝ} {L : List BasicInterval} + (h : GapChain a b L) (hab : a < b) : L ≠ [] := by + intro hL + subst L + exact (ne_of_lt hab) h + +theorem left_le_of_mem {a b : ℝ} {L : List BasicInterval} + (h : GapChain a b L) {I : BasicInterval} (hI : I ∈ L) : a ≤ I.left := by + induction L generalizing a with + | nil => exact False.elim (List.not_mem_nil hI) + | cons J L ih => + rcases List.mem_cons.mp hI with rfl | hI + · exact le_of_eq h.1.symm + · calc + a = J.left := h.1.symm + _ ≤ J.right := J.left_lt_right.le + _ ≤ I.left := ih h.2 hI + +theorem right_le_of_mem {a b : ℝ} {L : List BasicInterval} + (h : GapChain a b L) {I : BasicInterval} (hI : I ∈ L) : I.right ≤ b := by + induction L generalizing a with + | nil => exact False.elim (List.not_mem_nil hI) + | cons J L ih => + rcases List.mem_cons.mp hI with rfl | hI + · exact h.2.le_endpoints + · exact ih h.2 hI + +theorem carrier_subset {a b : ℝ} {L : List BasicInterval} + (h : GapChain a b L) {I : BasicInterval} (hI : I ∈ L) : + I.carrier ⊆ Set.Icc a b := by + intro x hx + exact ⟨(h.left_le_of_mem hI).trans hx.1, hx.2.trans (h.right_le_of_mem hI)⟩ + +/-- Cells later in the chain start no earlier than the current cell ends. -/ +theorem pairwise {a b : ℝ} {L : List BasicInterval} (h : GapChain a b L) : + L.Pairwise (fun I J => I.right ≤ J.left) := by + induction L generalizing a with + | nil => exact List.Pairwise.nil + | cons I L ih => + apply List.pairwise_cons.mpr + exact ⟨fun J hJ => h.2.left_le_of_mem hJ, ih h.2⟩ + +/-- A nonempty chain covers exactly its closed endpoint interval. -/ +theorem mem_carrier_iff {a b : ℝ} {L : List BasicInterval} + (h : GapChain a b L) (hL : L ≠ []) (x : ℝ) : + (∃ I ∈ L, x ∈ I.carrier) ↔ a ≤ x ∧ x ≤ b := by + constructor + · rintro ⟨I, hI, hx⟩ + exact h.carrier_subset hI hx + · intro hx + induction L generalizing a with + | nil => exact False.elim (hL rfl) + | cons I L ih => + by_cases hxr : x ≤ I.right + · refine ⟨I, List.mem_cons_self, ?_⟩ + exact ⟨by simpa only [h.1] using hx.1, hxr⟩ + · have htail : L ≠ [] := by + intro he + subst L + have hr : I.right = b := h.2 + exact hxr (by simpa only [hr] using hx.2) + obtain ⟨J, hJ, hxJ⟩ := ih h.2 htail ⟨(lt_of_not_ge hxr).le, hx.2⟩ + exact ⟨J, List.mem_cons_of_mem I hJ, hxJ⟩ + +end GapChain + +/-- A nonempty ordered partition of an actual interval by basic dyadic cells. -/ +structure DyadicGapPartition (a b : ℝ) where + cells : List BasicInterval + chain : GapChain a b cells + nonempty : cells ≠ [] + +namespace DyadicGapPartition + +theorem left_lt_right {a b : ℝ} (P : DyadicGapPartition a b) : a < b := + P.chain.lt_endpoints_of_ne_nil P.nonempty + +theorem mem_covered_iff {a b : ℝ} (P : DyadicGapPartition a b) (x : ℝ) : + (∃ I ∈ P.cells, x ∈ I.carrier) ↔ a ≤ x ∧ x ≤ b := + P.chain.mem_carrier_iff P.nonempty x + +theorem cell_bounds {a b : ℝ} (P : DyadicGapPartition a b) + {I : BasicInterval} (hI : I ∈ P.cells) : a ≤ I.left ∧ I.right ≤ b := + ⟨P.chain.left_le_of_mem hI, P.chain.right_le_of_mem hI⟩ + +end DyadicGapPartition + +end + +end ThompsonNonamenability + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/DyadicGapPartition.lean b/lean/OAI/GroupTheory/Thompson/DyadicGapPartition.lean new file mode 100644 index 0000000000000000000000000000000000000000..de7344d22dda154448e4c7281d4d99db513f7da9 --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/DyadicGapPartition.lean @@ -0,0 +1,233 @@ +import OAI.GroupTheory.Thompson.DyadicArithmetic +import OAI.GroupTheory.Thompson.DyadicGapChain +import Lean.Elab.Tactic.Omega + +namespace OAI + +/-! +# Partitions of positive dyadic gaps + +The initial partition consists of consecutive cells of a common dyadic grid. +Splitting one cell gives exactly one additional cell. Thus each pair of gaps +can be partitioned into the same number of cells independently. +-/ + +namespace ThompsonNonamenability + +noncomputable section + +/-- Consecutive cells with indices `A, ..., A+c-1` on grid level `n`. -/ +def uniformGapCells (n A c : ℕ) (h : A + c ≤ 2 ^ n) : List BasicInterval := + match c with + | 0 => [] + | c + 1 => + (⟨n, ⟨A, by omega⟩⟩ : BasicInterval) :: + uniformGapCells n (A + 1) c (by omega) +termination_by c + +@[simp] theorem uniformGapCells_length (n A c : ℕ) (h : A + c ≤ 2 ^ n) : + (uniformGapCells n A c h).length = c := by + induction c generalizing A with + | zero => simp [uniformGapCells] + | succ c ih => simp [uniformGapCells, ih] + +theorem uniformGapCells_chain (n A c : ℕ) (h : A + c ≤ 2 ^ n) : + GapChain ((A : ℝ) / (2 : ℝ) ^ n) + (((A + c : ℕ) : ℝ) / (2 : ℝ) ^ n) (uniformGapCells n A c h) := by + induction c generalizing A with + | zero => simp [uniformGapCells] + | succ c ih => + simp only [uniformGapCells] + refine ⟨rfl, ?_⟩ + simpa [BasicInterval.right, Nat.cast_add, Nat.add_assoc, Nat.add_comm, + Nat.add_left_comm] using ih (A + 1) (by omega) + +/-- An actual basic-cell partition of any positive dyadic subinterval. -/ +theorem exists_dyadicGapPartition {a b : ℝ} + (ha : IsDyadic a) (hb : IsDyadic b) + (h0 : 0 ≤ a) (hab : a < b) (h1 : b ≤ 1) : + Nonempty (DyadicGapPartition a b) := by + obtain ⟨ka, na, hka⟩ := ha + obtain ⟨kb, nb, hkb⟩ := hb + obtain ⟨ka', hka'⟩ := dyadic_raise_denominator ⟨ka, hka⟩ nb + obtain ⟨kb', hkb'⟩ := dyadic_raise_denominator ⟨kb, hkb⟩ na + have hkb'' : b = (kb' : ℝ) / (2 : ℝ) ^ (na + nb) := by + simpa only [Nat.add_comm nb na] using hkb' + obtain ⟨A, hAmax, hA⟩ := dyadic_nat_numerator hka' h0 (hab.le.trans h1) + obtain ⟨B, hBmax, hB⟩ := dyadic_nat_numerator hkb'' (h0.trans hab.le) h1 + have hABr : (A : ℝ) < (B : ℝ) := by + apply (div_lt_div_iff_of_pos_right (pow_pos (by norm_num : (0 : ℝ) < 2) + (na + nb))).1 + rw [← hA, ← hB] + exact hab + have hAB : A < B := by exact_mod_cast hABr + have hsum : A + (B - A) = B := by omega + let cells := uniformGapCells (na + nb) A (B - A) (by omega) + have hc : GapChain a b cells := by + simpa only [cells, hsum, ← hA, ← hB] using + uniformGapCells_chain (na + nb) A (B - A) (by omega) + refine ⟨⟨cells, hc, ?_⟩⟩ + intro he + have hlen := congrArg List.length he + simp only [cells, uniformGapCells_length, List.length_nil] at hlen + omega + +namespace BasicInterval + +/-- The left half of an actual basic interval. -/ +def splitLeft (I : BasicInterval) : BasicInterval := + I.comp ⟨1, ⟨0, by decide⟩⟩ + +/-- The right half of an actual basic interval. -/ +def splitRight (I : BasicInterval) : BasicInterval := + I.comp ⟨1, ⟨1, by decide⟩⟩ + +@[simp] theorem splitLeft_left (I : BasicInterval) : I.splitLeft.left = I.left := by + rw [splitLeft, left_comp] + have h : (⟨1, ⟨0, by decide⟩⟩ : BasicInterval).left = 0 := by + norm_num [left] + rw [h, chart_zero] + +@[simp] theorem splitRight_right (I : BasicInterval) : I.splitRight.right = I.right := by + rw [splitRight, right_comp] + have h : (⟨1, ⟨1, by decide⟩⟩ : BasicInterval).right = 1 := by + norm_num [right] + rw [h, chart_one] + +theorem split_adjacent (I : BasicInterval) : I.splitLeft.right = I.splitRight.left := by + rw [splitLeft, splitRight, right_comp, left_comp] + congr 1 + norm_num [right, left] + +theorem splitLeft_contained (I : BasicInterval) : I.splitLeft.Contained I := + I.comp_contained _ + +theorem splitRight_contained (I : BasicInterval) : I.splitRight.Contained I := + I.comp_contained _ + +end BasicInterval + +/-- Every cell in the refined list lies in an original cell. -/ +def GapRefines (newCells oldCells : List BasicInterval) : Prop := + ∀ J ∈ newCells, ∃ I ∈ oldCells, J.Contained I + +namespace GapRefines + +theorem refl (L : List BasicInterval) : GapRefines L L := by + intro I hI + exact ⟨I, hI, I.contained_refl⟩ + +theorem trans {L M N : List BasicInterval} (hLM : GapRefines L M) + (hMN : GapRefines M N) : GapRefines L N := by + intro I hI + obtain ⟨J, hJ, hIJ⟩ := hLM I hI + obtain ⟨K, hK, hJK⟩ := hMN J hJ + exact ⟨K, hK, hIJ.trans hJK⟩ + +end GapRefines + +namespace GapChain + +theorem split_head {a b : ℝ} {I : BasicInterval} {L : List BasicInterval} + (h : GapChain a b (I :: L)) : + GapChain a b (I.splitLeft :: I.splitRight :: L) := by + rcases h with ⟨hleft, htail⟩ + refine ⟨I.splitLeft_left.trans hleft, I.split_adjacent.symm, ?_⟩ + simpa only [BasicInterval.splitRight_right] using htail + +theorem split_head_refines (I : BasicInterval) (L : List BasicInterval) : + GapRefines (I.splitLeft :: I.splitRight :: L) (I :: L) := by + intro J hJ + simp only [List.mem_cons] at hJ + rcases hJ with rfl | rfl | hJ + · exact ⟨I, List.mem_cons_self, I.splitLeft_contained⟩ + · exact ⟨I, List.mem_cons_self, I.splitRight_contained⟩ + · exact ⟨J, List.mem_cons_of_mem I hJ, J.contained_refl⟩ + +/-- Bisection increases a nonempty chain's cardinality by exactly one. -/ +theorem exists_succ_length {a b : ℝ} {L : List BasicInterval} + (h : GapChain a b L) (hne : L ≠ []) : + ∃ M : List BasicInterval, GapChain a b M ∧ + M.length = L.length + 1 ∧ GapRefines M L := by + cases L with + | nil => exact False.elim (hne rfl) + | cons I L => + exact ⟨I.splitLeft :: I.splitRight :: L, h.split_head, + by simp [Nat.add_comm, Nat.add_left_comm], split_head_refines I L⟩ + +/-- Any prescribed nonnegative number of extra cells can be obtained by bisection. -/ +theorem exists_length_add {a b : ℝ} {L : List BasicInterval} + (h : GapChain a b L) (hne : L ≠ []) (k : ℕ) : + ∃ M : List BasicInterval, GapChain a b M ∧ + M.length = L.length + k ∧ GapRefines M L := by + induction k with + | zero => exact ⟨L, h, by simp, GapRefines.refl L⟩ + | succ k ih => + obtain ⟨M, hM, hlen, href⟩ := ih + have hMne : M ≠ [] := by + intro hempty + have hL : L.length = 0 := by simp only [hempty, List.length_nil] at hlen; omega + exact hne (List.length_eq_zero_iff.mp hL) + obtain ⟨N, hN, hNlen, hNref⟩ := hM.exists_succ_length hMne + refine ⟨N, hN, ?_, hNref.trans href⟩ + omega + +theorem exists_length_ge {a b : ℝ} {L : List BasicInterval} + (h : GapChain a b L) (hne : L ≠ []) {n : ℕ} (hn : L.length ≤ n) : + ∃ M : List BasicInterval, GapChain a b M ∧ M.length = n ∧ GapRefines M L := by + obtain ⟨M, hM, hlen, href⟩ := h.exists_length_add hne (n - L.length) + exact ⟨M, hM, by omega, href⟩ + +end GapChain + +namespace DyadicGapPartition + +theorem exists_refinement_card {a b : ℝ} (P : DyadicGapPartition a b) + {n : ℕ} (hn : P.cells.length ≤ n) : + ∃ Q : DyadicGapPartition a b, Q.cells.length = n ∧ GapRefines Q.cells P.cells := by + obtain ⟨M, hM, hlen, href⟩ := P.chain.exists_length_ge P.nonempty hn + have hMne : M ≠ [] := by + intro hempty + have hnzero : n = 0 := by simpa only [hempty, List.length_nil] using hlen.symm + have hpzero : P.cells.length = 0 := by omega + exact P.nonempty (List.length_eq_zero_iff.mp hpzero) + exact ⟨⟨M, hM, hMne⟩, hlen, href⟩ + +/-- Equalization is performed for this pair of gaps, with both refinements retained. -/ +theorem equalize {a b c d : ℝ} (P : DyadicGapPartition a b) (Q : DyadicGapPartition c d) : + ∃ (P' : DyadicGapPartition a b) (Q' : DyadicGapPartition c d), + P'.cells.length = Q'.cells.length ∧ + GapRefines P'.cells P.cells ∧ GapRefines Q'.cells Q.cells := by + obtain ⟨P', hP', hrefP⟩ := P.exists_refinement_card (Nat.le_max_left P.cells.length Q.cells.length) + obtain ⟨Q', hQ', hrefQ⟩ := Q.exists_refinement_card (Nat.le_max_right P.cells.length Q.cells.length) + exact ⟨P', Q', hP'.trans hQ'.symm, hrefP, hrefQ⟩ + +end DyadicGapPartition + +/-- Any two positive dyadic gaps admit ordered basic-cell chains of equal length. -/ +theorem equalize_dyadic_gaps {a b c d : ℝ} + (ha : IsDyadic a) (hb : IsDyadic b) (h0 : 0 ≤ a) (hab : a < b) (h1 : b ≤ 1) + (hc : IsDyadic c) (hd : IsDyadic d) (h0' : 0 ≤ c) (hcd : c < d) (h1' : d ≤ 1) : + ∃ A B : List BasicInterval, GapChain a b A ∧ GapChain c d B ∧ + A ≠ [] ∧ B ≠ [] ∧ A.length = B.length := by + obtain ⟨P⟩ := exists_dyadicGapPartition ha hb h0 hab h1 + obtain ⟨Q⟩ := exists_dyadicGapPartition hc hd h0' hcd h1' + obtain ⟨P', Q', hlen, _, _⟩ := P.equalize Q + exact ⟨P'.cells, Q'.cells, P'.chain, Q'.chain, P'.nonempty, Q'.nonempty, hlen⟩ + +theorem exists_equal_length_partitions {a b c d : ℝ} + (ha : IsDyadic a) (hb : IsDyadic b) (hc : IsDyadic c) (hd : IsDyadic d) + (ha0 : 0 ≤ a) (hb1 : b ≤ 1) (hc0 : 0 ≤ c) (hd1 : d ≤ 1) + (hab : a < b) (hcd : c < d) : + ∃ P : DyadicGapPartition a b, ∃ Q : DyadicGapPartition c d, + P.cells.length = Q.cells.length := by + obtain ⟨P⟩ := exists_dyadicGapPartition ha hb ha0 hab hb1 + obtain ⟨Q⟩ := exists_dyadicGapPartition hc hd hc0 hcd hd1 + obtain ⟨P', Q', hlen, _, _⟩ := P.equalize Q + exact ⟨P', Q', hlen⟩ + +end + +end ThompsonNonamenability + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/DyadicImages.lean b/lean/OAI/GroupTheory/Thompson/DyadicImages.lean new file mode 100644 index 0000000000000000000000000000000000000000..542be9f065bb428bad5df68f4c9a285e97659b21 --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/DyadicImages.lean @@ -0,0 +1,237 @@ +import OAI.GroupTheory.Thompson.UniformPL +import OAI.GroupTheory.Thompson.AffineGridArithmetic +import Mathlib.Data.Finset.Lattice.Fold +import Mathlib.Tactic.Choose + +namespace OAI + +noncomputable section + +namespace ThompsonNonamenability + +open BasicPartition + +/-- Every actual image of a depth-`n` uniform cell is a basic interval. -/ +def ImageBasic (g : F) (n : ℕ) : Prop := + ∀ k : Fin (2 ^ n), ∃ I : BasicInterval, + I.left = (g (uniformDyadicPoint n k.castSucc) : ℝ) ∧ + I.right = (g (uniformDyadicPoint n k.succ) : ℝ) + +/-- The unique basic interval with the actual image endpoints. -/ +def imageCell (g : F) (n : ℕ) (hg : ImageBasic g n) (k : Fin (2 ^ n)) : + BasicInterval := Classical.choose (hg k) + +@[simp] theorem imageCell_left (g : F) (n : ℕ) (hg : ImageBasic g n) + (k : Fin (2 ^ n)) : + (imageCell g n hg k).left = (g (uniformDyadicPoint n k.castSucc) : ℝ) := + (Classical.choose_spec (hg k)).1 + +@[simp] theorem imageCell_right (g : F) (n : ℕ) (hg : ImageBasic g n) + (k : Fin (2 ^ n)) : + (imageCell g n hg k).right = (g (uniformDyadicPoint n k.succ) : ℝ) := + (Classical.choose_spec (hg k)).2 + +theorem imageCell_proof_irrel (g : F) (n : ℕ) (hg hg' : ImageBasic g n) + (k : Fin (2 ^ n)) : imageCell g n hg k = imageCell g n hg' k := by + apply BasicInterval.ext_endpoints <;> simp + +theorem imageCell_mem_carrier_iff (g : F) (n : ℕ) (hg : ImageBasic g n) + (k : Fin (2 ^ n)) (x : UnitInterval) : + (g x : ℝ) ∈ (imageCell g n hg k).carrier ↔ + (x : ℝ) ∈ (uniformCell n k).carrier := by + simp only [BasicInterval.carrier, Set.mem_Icc, imageCell_left, imageCell_right] + change g (uniformDyadicPoint n k.castSucc) ≤ g x ∧ + g x ≤ g (uniformDyadicPoint n k.succ) ↔ _ + rw [g.strictMono.le_iff_le, g.strictMono.le_iff_le] + change (uniformDyadicPoint n k.castSucc : ℝ) ≤ (x : ℝ) ∧ + (x : ℝ) ≤ (uniformDyadicPoint n k.succ : ℝ) ↔ _ + rw [uniformDyadicPoint_castSucc_coe, uniformDyadicPoint_succ_coe] + +theorem imageCell_mem_interior_iff (g : F) (n : ℕ) (hg : ImageBasic g n) + (k : Fin (2 ^ n)) (x : UnitInterval) : + (g x : ℝ) ∈ (imageCell g n hg k).interior ↔ + (x : ℝ) ∈ (uniformCell n k).interior := by + simp only [BasicInterval.interior, Set.mem_Ioo, imageCell_left, imageCell_right] + change g (uniformDyadicPoint n k.castSucc) < g x ∧ + g x < g (uniformDyadicPoint n k.succ) ↔ _ + rw [g.strictMono.lt_iff_lt, g.strictMono.lt_iff_lt] + change (uniformDyadicPoint n k.castSucc : ℝ) < (x : ℝ) ∧ + (x : ℝ) < (uniformDyadicPoint n k.succ : ℝ) ↔ _ + rw [uniformDyadicPoint_castSucc_coe, uniformDyadicPoint_succ_coe] + +theorem imageCell_injective (g : F) (n : ℕ) (hg : ImageBasic g n) : + Function.Injective (imageCell g n hg) := by + intro k l heq + have hl : (g (uniformDyadicPoint n k.castSucc) : ℝ) = + (g (uniformDyadicPoint n l.castSucc) : ℝ) := by + simpa only [imageCell_left] using congrArg BasicInterval.left heq + have hp := g.strictMono.injective (Subtype.ext hl) + have hp' := congrArg (fun x : UnitInterval => (x : ℝ)) hp + have hd : (2 : ℝ) ^ n ≠ 0 := pow_ne_zero _ (by norm_num) + change (k.val : ℝ) / (2 : ℝ) ^ n = (l.val : ℝ) / (2 : ℝ) ^ n at hp' + have hk : (k.val : ℝ) = (l.val : ℝ) := (div_left_inj' hd).mp hp' + apply Fin.ext + exact_mod_cast hk + +/-- The actual images, with coverage and disjoint open interiors proved. -/ +def imagePartition (g : F) (n : ℕ) (hg : ImageBasic g n) : BasicPartition where + cells := Finset.univ.image (imageCell g n hg) + cover := by + intro x hx + let y : UnitInterval := g.toHomeomorph.symm ⟨x, hx⟩ + have hgy : g y = (⟨x, hx⟩ : UnitInterval) := + g.toHomeomorph.apply_symm_apply ⟨x, hx⟩ + obtain ⟨I, hI, hyI⟩ := uniformCells_cover n (y : ℝ) y.property + obtain ⟨k, rfl⟩ := mem_uniformCells.mp hI + refine ⟨imageCell g n hg k, Finset.mem_image.mpr ⟨k, Finset.mem_univ _, rfl⟩, ?_⟩ + have hm := (imageCell_mem_carrier_iff g n hg k y).mpr hyI + simpa only [hgy] using hm + disjoint := by + intro I hI J hJ hne + obtain ⟨k, _, rfl⟩ := Finset.mem_image.mp hI + obtain ⟨l, _, rfl⟩ := Finset.mem_image.mp hJ + apply Set.disjoint_left.mpr + intro x hxk hxl + have hx : x ∈ Set.Icc (0 : ℝ) 1 := + (imageCell g n hg k).carrier_subset_unit + ((imageCell g n hg k).interior_subset_carrier hxk) + let y : UnitInterval := g.toHomeomorph.symm ⟨x, hx⟩ + have hgy : g y = (⟨x, hx⟩ : UnitInterval) := + g.toHomeomorph.apply_symm_apply ⟨x, hx⟩ + have hyk : (y : ℝ) ∈ (uniformCell n k).interior := + (imageCell_mem_interior_iff g n hg k y).mp (by simpa only [hgy] using hxk) + have hyl : (y : ℝ) ∈ (uniformCell n l).interior := + (imageCell_mem_interior_iff g n hg l y).mp (by simpa only [hgy] using hxl) + have hkl : k ≠ l := fun h => hne (congrArg (imageCell g n hg) h) + exact Set.disjoint_left.mp (uniformCell_disjoint hkl) hyk hyl + +@[simp] theorem imagePartition_cells (g : F) (n : ℕ) (hg : ImageBasic g n) : + (imagePartition g n hg).cells = Finset.univ.image (imageCell g n hg) := rfl + +@[simp] theorem mem_imagePartition_cells (g : F) (n : ℕ) (hg : ImageBasic g n) + (I : BasicInterval) : + I ∈ (imagePartition g n hg).cells ↔ ∃ k, imageCell g n hg k = I := by + simp only [imagePartition_cells, Finset.mem_image, Finset.mem_univ, true_and] + +theorem imagePartition_proof_irrel (g : F) (n : ℕ) (hg hg' : ImageBasic g n) : + imagePartition g n hg = imagePartition g n hg' := by + rfl + +@[simp] theorem imagePartition_cellCount (g : F) (n : ℕ) (hg : ImageBasic g n) : + (imagePartition g n hg).cellCount = 2 ^ n := by + simp only [BasicPartition.cellCount, imagePartition_cells, + Finset.card_image_of_injective _ (imageCell_injective g n hg), Finset.card_univ, + Fintype.card_fin] + +/-- Simultaneously gives actual image cells and the desired mesh bound. -/ +theorem eventually_image_cells_small (g : F) (ε : ℝ) (hε : 0 < ε) : + ∃ N : ℕ, ∀ n ≥ N, ∀ k : Fin (2 ^ n), ∃ I : BasicInterval, + I.left = (g (uniformDyadicPoint n k.castSucc) : ℝ) ∧ + I.right = (g (uniformDyadicPoint n k.succ) : ℝ) ∧ I.length < ε := by + let w := g.witness + let b : Fin w.pieceCount → ℝ := fun i => + (g (w.knots i.castSucc) : ℝ) - + (2 : ℝ) ^ w.exponent i * (w.knots i.castSucc : ℝ) + have hb : ∀ i, IsDyadic (b i) := by + intro i + exact (w.image_knots_dyadic g.strictMono i.castSucc).sub + ((isDyadic_zpow (w.exponent i)).mul (w.dyadic i.castSucc)) + have halign := fun i => dyadic_affine_grid_alignment_small + (w.exponent i) (b i) (hb i) ε hε + choose Ns hNs using halign + obtain ⟨Nr, hNr⟩ := w.eventually_uniform_refines + refine ⟨max Nr (Finset.univ.sup Ns), ?_⟩ + intro n hn k + obtain ⟨i, hil, hir⟩ := hNr n ((le_max_left _ _).trans hn) k + have horder : uniformDyadicPoint n k.castSucc ≤ uniformDyadicPoint n k.succ := by + change (uniformDyadicPoint n k.castSucc : ℝ) ≤ (uniformDyadicPoint n k.succ : ℝ) + rw [uniformDyadicPoint_castSucc_coe, uniformDyadicPoint_succ_coe] + exact (uniformCell n k).left_lt_right.le + have hl := w.affine i (uniformDyadicPoint n k.castSucc) hil (horder.trans hir) + have hr := w.affine i (uniformDyadicPoint n k.succ) (hil.trans horder) hir + have hleft : (g (uniformDyadicPoint n k.castSucc) : ℝ) = + (2 : ℝ) ^ w.exponent i * ((k.val : ℝ) / (2 : ℝ) ^ n) + b i := by + change (g (uniformDyadicPoint n k.castSucc) : ℝ) = _ at hl + rw [uniformDyadicPoint_castSucc_coe] at hl + change (g (uniformDyadicPoint n k.castSucc) : ℝ) = + (g (w.knots i.castSucc) : ℝ) + + (2 : ℝ) ^ w.exponent i * ((k.val : ℝ) / (2 : ℝ) ^ n - _) at hl + dsimp only [b] + nlinarith [hl] + have hright : (g (uniformDyadicPoint n k.succ) : ℝ) = + (2 : ℝ) ^ w.exponent i * (((k.val : ℝ) + 1) / (2 : ℝ) ^ n) + b i := by + change (g (uniformDyadicPoint n k.succ) : ℝ) = _ at hr + rw [uniformDyadicPoint_succ_coe] at hr + change (g (uniformDyadicPoint n k.succ) : ℝ) = + (g (w.knots i.castSucc) : ℝ) + + (2 : ℝ) ^ w.exponent i * (((k.val : ℝ) + 1) / (2 : ℝ) ^ n - _) at hr + dsimp only [b] + nlinarith [hr] + have hNi : Ns i ≤ n := + (Finset.le_sup (Finset.mem_univ i)).trans ((le_max_right _ _).trans hn) + obtain ⟨I, hIl, hIr, hIs⟩ := hNs i n hNi k + (hleft ▸ (g (uniformDyadicPoint n k.castSucc)).property.1) + (hright ▸ (g (uniformDyadicPoint n k.succ)).property.2) + exact ⟨I, hIl.trans hleft.symm, hIr.trans hright.symm, hIs⟩ + +theorem eventually_image_basic (g : F) : ∃ N, ∀ n ≥ N, ImageBasic g n := by + obtain ⟨N, hN⟩ := eventually_image_cells_small g 1 zero_lt_one + refine ⟨N, ?_⟩ + intro n hn k + obtain ⟨I, hl, hr, _⟩ := hN n hn k + exact ⟨I, hl, hr⟩ + +theorem eventually_image_mesh_lt (g : F) (ε : ℝ) (hε : 0 < ε) : + ∃ N, ∀ n ≥ N, ∃ hg : ImageBasic g n, + ∀ I ∈ (imagePartition g n hg).cells, I.length < ε := by + obtain ⟨N, hN⟩ := eventually_image_cells_small g ε hε + refine ⟨N, ?_⟩ + intro n hn + have hg : ImageBasic g n := by + intro k + obtain ⟨I, hl, hr, _⟩ := hN n hn k + exact ⟨I, hl, hr⟩ + refine ⟨hg, ?_⟩ + intro I hI + obtain ⟨k, rfl⟩ := (mem_imagePartition_cells g n hg I).mp hI + obtain ⟨J, hl, hr, hJ⟩ := hN n hn k + have heq : imageCell g n hg k = J := + BasicInterval.ext_endpoints ((imageCell_left g n hg k).trans hl.symm) + ((imageCell_right g n hg k).trans hr.symm) + simpa only [heq] using hJ + +/-- A single actual grid level works for both finite families. -/ +theorem eventually_image_respects (K : Finset F) (J : Finset BasicInterval) : + ∃ N, ∀ n ≥ N, ∀ g ∈ K, ∃ hg : ImageBasic g n, + ∀ I ∈ J, (imagePartition g n hg).Respects I := by + classical + have hsingle : ∀ g : F, ∃ N, ∀ n ≥ N, ∃ hg : ImageBasic g n, + ∀ I ∈ J, (imagePartition g n hg).Respects I := by + intro g + induction J using Finset.induction_on with + | empty => + obtain ⟨N, hN⟩ := eventually_image_basic g + exact ⟨N, fun n hn => ⟨hN n hn, by simp⟩⟩ + | @insert I J hIJ ih => + obtain ⟨N₁, hN₁⟩ := ih + obtain ⟨N₂, hN₂⟩ := eventually_image_mesh_lt g I.length I.length_pos + refine ⟨max N₁ N₂, ?_⟩ + intro n hn + obtain ⟨hg, hrest⟩ := hN₁ n ((le_max_left _ _).trans hn) + obtain ⟨hg', hmesh⟩ := hN₂ n ((le_max_right _ _).trans hn) + refine ⟨hg, ?_⟩ + intro L hL + rcases Finset.mem_insert.mp hL with hLI | hL + · subst L + exact (imagePartition g n hg).respects_of_mesh_lt I hmesh + · exact hrest L hL + choose Ns hNs using hsingle + refine ⟨K.sup Ns, ?_⟩ + intro n hn g hg + exact hNs g n ((Finset.le_sup hg).trans hn) + +end ThompsonNonamenability + +end + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/FiniteAverage.lean b/lean/OAI/GroupTheory/Thompson/FiniteAverage.lean new file mode 100644 index 0000000000000000000000000000000000000000..9632671f7750c22b77b36dffd74c37321b6b9c3e --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/FiniteAverage.lean @@ -0,0 +1,216 @@ +import Mathlib.Basic.Real.Basic +import Mathlib.Data.Finset.SymmDiff +import Mathlib.Data.Finset.Max +import Mathlib.Algebra.BigOperators.Group.Finset.Basic +import Mathlib.Algebra.BigOperators.Ring.Finset +import Mathlib.Algebra.Order.BigOperators.Group.Finset + +namespace OAI + +/-! +# Real finite averages and left-translation cancellation + +These are literal finite sums. The translation estimate cancels the common +intersection of the two finite sets, and the function bound is global. No +invariant mean, support assumption, or limiting average is used. +-/ + +noncomputable section + +universe uα uι uG + +namespace ThompsonNonamenability + +open scoped BigOperators symmDiff + +variable {α : Type uα} {ι : Type uι} + +def realAvg (A : Finset α) (f : α → ℝ) : ℝ := + (A.card : ℝ)⁻¹ * ∑ x ∈ A, f x + +theorem realAvg_eq_sum_div (A : Finset α) (f : α → ℝ) : + realAvg A f = (∑ x ∈ A, f x) / (A.card : ℝ) := by + simp only [realAvg, div_eq_mul_inv, mul_comm] + +theorem realAvg_congr (A : Finset α) {f g : α → ℝ} + (hfg : ∀ x ∈ A, f x = g x) : realAvg A f = realAvg A g := by + unfold realAvg + rw [Finset.sum_congr rfl hfg] + +@[simp] theorem realAvg_zero (A : Finset α) : realAvg A (fun _ => 0) = 0 := by + simp [realAvg] + +theorem realAvg_add (A : Finset α) (f g : α → ℝ) : + realAvg A (fun x => f x + g x) = realAvg A f + realAvg A g := by + simp only [realAvg, Finset.sum_add_distrib, mul_add] + +theorem realAvg_sub (A : Finset α) (f g : α → ℝ) : + realAvg A (fun x => f x - g x) = realAvg A f - realAvg A g := by + simp only [realAvg, Finset.sum_sub_distrib, mul_sub] + +theorem realAvg_neg (A : Finset α) (f : α → ℝ) : + realAvg A (fun x => -f x) = -realAvg A f := by + simp only [realAvg, Finset.sum_neg_distrib, mul_neg] + +theorem realAvg_const_mul (A : Finset α) (c : ℝ) (f : α → ℝ) : + realAvg A (fun x => c * f x) = c * realAvg A f := by + simp only [realAvg, ← Finset.mul_sum, mul_left_comm] + +theorem realAvg_mul_const (A : Finset α) (f : α → ℝ) (c : ℝ) : + realAvg A (fun x => f x * c) = realAvg A f * c := by + simp only [realAvg, ← Finset.sum_mul, mul_assoc] + +theorem realAvg_sum (A : Finset α) (B : Finset ι) (f : ι → α → ℝ) : + realAvg A (fun x => ∑ i ∈ B, f i x) = ∑ i ∈ B, realAvg A (f i) := by + unfold realAvg + rw [Finset.sum_comm, Finset.mul_sum] + +theorem realAvg_sum_univ [Fintype ι] (A : Finset α) (f : ι → α → ℝ) : + realAvg A (fun x => ∑ i, f i x) = ∑ i, realAvg A (f i) := + realAvg_sum A Finset.univ f + +theorem realAvg_mono (A : Finset α) {f g : α → ℝ} + (hfg : ∀ x ∈ A, f x ≤ g x) : realAvg A f ≤ realAvg A g := + mul_le_mul_of_nonneg_left (Finset.sum_le_sum hfg) + (inv_nonneg.mpr (Nat.cast_nonneg A.card)) + +theorem realAvg_nonneg (A : Finset α) {f : α → ℝ} + (hf : ∀ x ∈ A, 0 ≤ f x) : 0 ≤ realAvg A f := by + simpa only [realAvg_zero] using realAvg_mono A hf + +theorem realAvg_const (A : Finset α) (hA : A.Nonempty) (c : ℝ) : + realAvg A (fun _ => c) = c := by + have hc : (A.card : ℝ) ≠ 0 := ne_of_gt (Nat.cast_pos.mpr (Finset.card_pos.mpr hA)) + simp [realAvg, nsmul_eq_mul, hc] + +theorem realAvg_le_const (A : Finset α) (hA : A.Nonempty) {f : α → ℝ} {c : ℝ} + (hf : ∀ x ∈ A, f x ≤ c) : realAvg A f ≤ c := by + simpa only [realAvg_const A hA c] using realAvg_mono A hf + +theorem const_le_realAvg (A : Finset α) (hA : A.Nonempty) {f : α → ℝ} {c : ℝ} + (hf : ∀ x ∈ A, c ≤ f x) : c ≤ realAvg A f := by + simpa only [realAvg_const A hA c] using realAvg_mono A hf + +theorem abs_realAvg_le (A : Finset α) (f : α → ℝ) : + |realAvg A f| ≤ realAvg A (fun x => |f x|) := by + unfold realAvg + rw [abs_mul, abs_of_nonneg (inv_nonneg.mpr (Nat.cast_nonneg A.card))] + exact mul_le_mul_of_nonneg_left (Finset.abs_sum_le_sum_abs f A) + (inv_nonneg.mpr (Nat.cast_nonneg A.card)) + +theorem realAvg_abs_le_one (A : Finset α) (hA : A.Nonempty) (f : α → ℝ) + (hf : ∀ x, |f x| ≤ 1) : |realAvg A f| ≤ 1 := + (abs_realAvg_le A f).trans (realAvg_le_const A hA (fun x _ => hf x)) + +section Cancellation + +variable [DecidableEq α] + +/-- The exact common-intersection cancellation, before any estimate. -/ +theorem sum_sub_eq_sdiff_sub (U V : Finset α) (f : α → ℝ) : + (∑ x ∈ U, f x) - ∑ x ∈ V, f x = + (∑ x ∈ U \ V, f x) - ∑ x ∈ V \ U, f x := + (Finset.sum_sdiff_sub_sum_sdiff (s₁ := V) (s₂ := U) (f := f)).symm + +theorem card_symmDiff_eq_sdiff_add (U V : Finset α) : + (U ∆ V).card = (U \ V).card + (V \ U).card := by + change ((U \ V) ∪ (V \ U)).card = _ + exact Finset.card_union_of_disjoint disjoint_sdiff_sdiff + +omit [DecidableEq α] in +theorem abs_sum_le_card [DecidableEq α] (A : Finset α) (f : α → ℝ) (hf : ∀ x, |f x| ≤ 1) : + |∑ x ∈ A, f x| ≤ (A.card : ℝ) := by + calc + |∑ x ∈ A, f x| ≤ ∑ x ∈ A, |f x| := Finset.abs_sum_le_sum_abs f A + _ ≤ ∑ _x ∈ A, (1 : ℝ) := Finset.sum_le_sum (fun x _ => hf x) + _ = (A.card : ℝ) := by simp + +/-- The full symmetric difference counts both residual pieces exactly once. -/ +theorem abs_sum_sub_le_card_symmDiff (U V : Finset α) (f : α → ℝ) + (hf : ∀ x, |f x| ≤ 1) : + |(∑ x ∈ U, f x) - ∑ x ∈ V, f x| ≤ ((U ∆ V).card : ℝ) := by + rw [sum_sub_eq_sdiff_sub] + calc + |(∑ x ∈ U \ V, f x) - ∑ x ∈ V \ U, f x| ≤ + |∑ x ∈ U \ V, f x| + |∑ x ∈ V \ U, f x| := by + simpa only [sub_eq_add_neg, abs_neg] using + abs_add_le (∑ x ∈ U \ V, f x) (-(∑ x ∈ V \ U, f x)) + _ ≤ ((U \ V).card : ℝ) + ((V \ U).card : ℝ) := + add_le_add (abs_sum_le_card (U \ V) f hf) (abs_sum_le_card (V \ U) f hf) + _ = ((U ∆ V).card : ℝ) := by rw [card_symmDiff_eq_sdiff_add, Nat.cast_add] + +end Cancellation + +section Translation + +variable {G : Type uG} [Group G] [DecidableEq G] + +def leftTranslate (h : G) (A : Finset G) : Finset G := A.image (fun g => h * g) + +def boundaryRatio (A : Finset G) (h : G) : ℝ := + ((leftTranslate h A ∆ A).card : ℝ) / (A.card : ℝ) + +theorem sum_leftTranslate (h : G) (A : Finset G) (f : G → ℝ) : + (∑ g ∈ A, f (h * g)) = ∑ x ∈ leftTranslate h A, f x := by + unfold leftTranslate + exact (Finset.sum_image (fun _ _ _ _ hxy => mul_left_cancel hxy)).symm + +@[simp] theorem card_leftTranslate (h : G) (A : Finset G) : + (leftTranslate h A).card = A.card := + Finset.card_image_of_injective A (fun _ _ hxy => mul_left_cancel hxy) + +theorem boundaryRatio_nonneg (A : Finset G) (h : G) : 0 ≤ boundaryRatio A h := + div_nonneg (Nat.cast_nonneg _) (Nat.cast_nonneg _) + +theorem abs_sum_translate_sub_le (A : Finset G) (h : G) (f : G → ℝ) + (hf : ∀ g, |f g| ≤ 1) : + |(∑ g ∈ A, f (h * g)) - ∑ g ∈ A, f g| ≤ + ((leftTranslate h A ∆ A).card : ℝ) := by + rw [sum_leftTranslate] + exact abs_sum_sub_le_card_symmDiff (leftTranslate h A) A f hf + +/-- The finite-translation inequality for every globally unit-bounded function. -/ +theorem abs_realAvg_translate_sub_le (A : Finset G) (hA : A.Nonempty) + (h : G) (f : G → ℝ) (hf : ∀ g, |f g| ≤ 1) : + |realAvg A (fun g => f (h * g)) - realAvg A f| ≤ boundaryRatio A h := by + have hc : 0 < (A.card : ℝ) := Nat.cast_pos.mpr (Finset.card_pos.mpr hA) + rw [realAvg_eq_sum_div, realAvg_eq_sum_div, ← sub_div, abs_div, abs_of_pos hc] + exact div_le_div_of_nonneg_right (abs_sum_translate_sub_le A h f hf) hc.le + +/-- The real maximum requires an actual member of the fixed transport set. -/ +def boundaryMax (S : Finset G) (hS : S.Nonempty) (A : Finset G) : ℝ := by + classical + exact (S.image (boundaryRatio A)).max' (hS.image _) + +theorem boundaryMax_attained (S : Finset G) (hS : S.Nonempty) (A : Finset G) : + ∃ h ∈ S, boundaryRatio A h = boundaryMax S hS A := by + classical + have hm : boundaryMax S hS A ∈ S.image (boundaryRatio A) := + Finset.max'_mem _ _ + exact Finset.mem_image.mp hm + +theorem boundaryRatio_le_max (S : Finset G) (hS : S.Nonempty) (A : Finset G) + {h : G} (hh : h ∈ S) : boundaryRatio A h ≤ boundaryMax S hS A := by + classical + exact (S.image (boundaryRatio A)).le_max' (boundaryRatio A h) + (Finset.mem_image_of_mem _ hh) + +theorem boundaryMax_nonneg (S : Finset G) (hS : S.Nonempty) (A : Finset G) : + 0 ≤ boundaryMax S hS A := by + obtain ⟨h, _, hh⟩ := boundaryMax_attained S hS A + rw [← hh] + exact boundaryRatio_nonneg A h + +theorem exists_boundary_ge_of_le_max (S : Finset G) (hS : S.Nonempty) + (A : Finset G) {b : ℝ} (hb : b ≤ boundaryMax S hS A) : + ∃ h ∈ S, b ≤ boundaryRatio A h := by + obtain ⟨h, hh, hmax⟩ := boundaryMax_attained S hS A + exact ⟨h, hh, hmax.symm ▸ hb⟩ + +end Translation + +end ThompsonNonamenability + +end + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/FiniteBoundary.lean b/lean/OAI/GroupTheory/Thompson/FiniteBoundary.lean new file mode 100644 index 0000000000000000000000000000000000000000..8b1706934e140ef67657f46f01c59e80db56d18d --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/FiniteBoundary.lean @@ -0,0 +1,63 @@ +import OAI.GroupTheory.Thompson.TransportFamily +import OAI.GroupTheory.Thompson.FiniteCorrelationBoundary + +namespace OAI + +noncomputable section + +universe uE + +namespace ThompsonNonamenability + +local instance : DecidableEq F := Classical.decEq F + +variable {E : Type uE} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + +theorem exists_fixed_boundary (f : UnitBall E → UnitBall E) (L δ : ℝ) + (hL : 0 < L) (hδ : 0 < δ) + (hLip : ∀ x y, ‖(f x : E) - f y‖ ≤ L * ‖(x : E) - y‖) + (hDisp : ∀ x, δ ≤ ‖(f x : E) - x‖) + (D : ℕ) (hD : 2 ≤ D) (hlarge : 4 * L ^ 2 / δ ^ 2 < (D : ℝ)) : + ∃ S : Finset F, S.Nonempty ∧ 0 < boundaryConstant L δ D ∧ + ∀ A : Finset F, A.Nonempty → + ∃ h ∈ S, boundaryConstant L δ D ≤ boundaryRatio A h := by + refine ⟨fixedTransportSet hD, fixedTransportSet_nonempty hD, + boundaryConstant_pos hL hδ hD hlarge, ?_⟩ + intro A hA + obtain ⟨n, hg, hhg⟩ := exists_transport_admissible hD A + have hDpos : 0 < D := lt_of_lt_of_le (by decide : 0 < 2) hD + let x : F → Fin D → UnitBall E := fun g i => globalColor hDpos f n (.inl i) g + let y : F → Fin D → Fin D → UnitBall E := + fun g i j => globalColor hDpos f n (.inr (i, j)) g + let α : ℝ := realAvg A (globalCorrelation hDpos f n + (.inl (firstIndex hD)) (.inl (secondIndex hD))) + let η : ℝ := boundaryMax (fixedTransportSet hD) (fixedTransportSet_nonempty hD) A + have hrec : ∀ g ∈ A, ∀ i, x g i = f (ballMean hDpos (y g i)) := by + intro g hmem i + exact globalColor_parent hDpos f n g (hg g hmem) i + have hparent : ∀ j k, j ≠ k → + |corr A (fun g => (x g j : E)) (fun g => (x g k : E)) - α| ≤ η := by + intro j k hjk + exact separated_correlation_bound hD f n A hA hg hhg (.inl j) (.inl k) + (selectedInterval_separated hjk) + have hchild : ∀ i j k, j ≠ k → + |corr A (fun g => (y g i j : E)) (fun g => (y g i k : E)) - α| ≤ η := by + intro i j k hjk + exact separated_correlation_bound hD f n A hA hg hhg (.inr (i, j)) (.inr (i, k)) + (selected_siblings_separated i hjk) + have hmixed : ∀ i j k, k ≠ i → + |corr A (fun g => (y g i j : E)) (fun g => (x g k : E)) - α| ≤ η := by + intro i j k hki + exact separated_correlation_bound hD f n A hA hg hhg (.inr (i, j)) (.inl k) + (selected_child_parent_separated i j k hki) + have hb : boundaryConstant L δ D ≤ η := + boundaryConstant_le_of_correlations A hA hD f L δ α η hL hδ hLip hDisp + x y hrec hparent hchild hmixed + exact exists_boundary_ge_of_le_max (fixedTransportSet hD) + (fixedTransportSet_nonempty hD) A hb + +end ThompsonNonamenability + +end + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/FiniteCoarea.lean b/lean/OAI/GroupTheory/Thompson/FiniteCoarea.lean new file mode 100644 index 0000000000000000000000000000000000000000..fcb0d83db6258c4e0d79a47bdfa9dd39f0895443 --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/FiniteCoarea.lean @@ -0,0 +1,270 @@ +import OAI.GroupTheory.Thompson.FiniteAverage +import OAI.GroupTheory.Thompson.FiniteLevels +import Mathlib.Tactic.Ring + +namespace OAI + +noncomputable section + +universe uG + +namespace ThompsonNonamenability + +open scoped BigOperators symmDiff + +variable {G : Type uG} [DecidableEq G] + +private theorem sum_indicator_eq_card (A C : Finset G) (hAC : A ⊆ C) : + (∑ x ∈ C, if x ∈ A then (1 : ℝ) else 0) = (A.card : ℝ) := by + classical + have hfilter : C.filter (fun x => x ∈ A) = A := by + ext x + simp only [Finset.mem_filter] + exact ⟨And.right, fun hx => ⟨hAC hx, hx⟩⟩ + rw [← Finset.sum_filter, hfilter] + simp + +private theorem sum_abs_indicators_eq_card_symmDiff + (A B C : Finset G) (hAC : A ⊆ C) (hBC : B ⊆ C) : + (∑ x ∈ C, + |(if x ∈ A then (1 : ℝ) else 0) - + (if x ∈ B then (1 : ℝ) else 0)|) = ((A ∆ B).card : ℝ) := by + classical + have hsub : A ∆ B ⊆ C := by + intro x hx + rcases Finset.mem_symmDiff.mp hx with hx | hx + · exact hAC hx.1 + · exact hBC hx.1 + calc + _ = ∑ x ∈ C, if x ∈ A ∆ B then (1 : ℝ) else 0 := by + apply Finset.sum_congr rfl + intro x hx + by_cases hA : x ∈ A <;> by_cases hB : x ∈ B <;> + simp [hA, hB, Finset.mem_symmDiff] + _ = _ := sum_indicator_eq_card (A ∆ B) C hsub + +private theorem finite_value_mem {K : Finset G} {p : G → ℝ} + (hpK : ∀ x, x ∉ K → p x = 0) (x : G) : + p x ∈ insert 0 (K.image p) := by + classical + by_cases hx : x ∈ K + · exact Finset.mem_insert_of_mem (Finset.mem_image_of_mem p hx) + · rw [hpK x hx] + exact Finset.mem_insert_self _ _ + +namespace FiniteLevelChain + +variable {K : Finset G} {p : G → ℝ} + +/-- The strict superlevel set at the lower endpoint of a positive layer. -/ +def levelSet (c : FiniteLevelChain K p) (i : Fin c.n) : Finset G := by + classical + exact K.filter (fun x => c.value i.castSucc < p x) + +omit [DecidableEq G] in +theorem levelSet_subset [DecidableEq G] (c : FiniteLevelChain K p) (i : Fin c.n) : + c.levelSet i ⊆ K := Finset.filter_subset _ _ + +/-- The finite carrier restriction does not change positive-threshold membership. -/ +theorem mem_levelSet (c : FiniteLevelChain K p) + (hpK : ∀ x, x ∉ K → p x = 0) (i : Fin c.n) (x : G) : + x ∈ c.levelSet i ↔ c.value i.castSucc < p x := by + classical + have hv : 0 ≤ c.value i.castSucc := by + simpa only [c.value_zero] using + c.strictMono_value.monotone (Fin.zero_le i.castSucc) + constructor + · intro hx + exact (Finset.mem_filter.mp hx).2 + · intro hx + apply Finset.mem_filter.mpr + refine ⟨?_, hx⟩ + by_contra hxK + rw [hpK x hxK] at hx + exact (not_lt_of_ge hv) hx + +omit [DecidableEq G] in +theorem levelSet_nonempty [DecidableEq G] (c : FiniteLevelChain K p) (i : Fin c.n) : + (c.levelSet i).Nonempty := by + classical + have hlt : c.value i.castSucc < c.value i.succ := + c.strictMono_value (by + change i.val < i.val + 1 + exact Nat.lt_succ_self i.val) + have hv : 0 ≤ c.value i.castSucc := by + simpa only [c.value_zero] using + c.strictMono_value.monotone (Fin.zero_le i.castSucc) + have hpos : 0 < c.value i.succ := lt_of_le_of_lt hv hlt + have hmem : c.value i.succ ∈ insert 0 (K.image p) := by + rw [← c.image_value_eq] + exact Finset.mem_image_of_mem _ (Finset.mem_univ _) + have himage : c.value i.succ ∈ K.image p := + (Finset.mem_insert.mp hmem).resolve_left (ne_of_gt hpos) + obtain ⟨x, hxK, hpx⟩ := Finset.mem_image.mp himage + refine ⟨x, Finset.mem_filter.mpr ⟨hxK, ?_⟩⟩ + rw [hpx] + exact hlt + +/-- Exact finite layer-cake identity for the mass. -/ +theorem coarea_mass (c : FiniteLevelChain K p) + (hpK : ∀ x, x ∉ K → p x = 0) : + (∑ x ∈ K, p x) = + ∑ i : Fin c.n, c.gap i * ((c.levelSet i).card : ℝ) := by + classical + calc + _ = ∑ x ∈ K, ∑ i : Fin c.n, c.gap i * + (if c.value i.castSucc < p x then (1 : ℝ) else 0) := by + apply Finset.sum_congr rfl + intro x hx + exact c.reconstruct (p x) (finite_value_mem hpK x) + _ = ∑ i : Fin c.n, ∑ x ∈ K, c.gap i * + (if c.value i.castSucc < p x then (1 : ℝ) else 0) := + Finset.sum_comm + _ = _ := by + apply Finset.sum_congr rfl + intro i hi + rw [← Finset.mul_sum] + congr 1 + calc + _ = ∑ x ∈ K, if x ∈ c.levelSet i then (1 : ℝ) else 0 := by + apply Finset.sum_congr rfl + intro x hx + simp only [c.mem_levelSet hpK i x] + _ = _ := sum_indicator_eq_card _ K (c.levelSet_subset i) + +end FiniteLevelChain + +section Translation + +variable [Group G] + +theorem mem_leftTranslate_iff (h : G) (A : Finset G) (x : G) : + x ∈ leftTranslate h A ↔ h⁻¹ * x ∈ A := by + constructor + · intro hx + obtain ⟨y, hy, rfl⟩ := Finset.mem_image.mp hx + simpa using hy + · intro hx + exact Finset.mem_image.mpr ⟨h⁻¹ * x, hx, by simp⟩ + +namespace FiniteLevelChain + +variable {K : Finset G} {p : G → ℝ} + +/-- Exact coarea identity for one left translation, over its finite support carrier. -/ +theorem coarea_translation (c : FiniteLevelChain K p) + (hpK : ∀ x, x ∉ K → p x = 0) (h : G) : + (∑ x ∈ K ∪ leftTranslate h K, |p (h⁻¹ * x) - p x|) = + ∑ i : Fin c.n, c.gap i * + ((leftTranslate h (c.levelSet i) ∆ c.levelSet i).card : ℝ) := by + classical + calc + _ = ∑ x ∈ K ∪ leftTranslate h K, ∑ i : Fin c.n, c.gap i * + |(if c.value i.castSucc < p (h⁻¹ * x) then (1 : ℝ) else 0) - + (if c.value i.castSucc < p x then (1 : ℝ) else 0)| := by + apply Finset.sum_congr rfl + intro x hx + exact c.abs_sub_eq_sum (p (h⁻¹ * x)) (p x) + (finite_value_mem hpK _) (finite_value_mem hpK _) + _ = ∑ i : Fin c.n, ∑ x ∈ K ∪ leftTranslate h K, c.gap i * + |(if c.value i.castSucc < p (h⁻¹ * x) then (1 : ℝ) else 0) - + (if c.value i.castSucc < p x then (1 : ℝ) else 0)| := + Finset.sum_comm + _ = _ := by + apply Finset.sum_congr rfl + intro i hi + rw [← Finset.mul_sum] + congr 1 + have hleft : leftTranslate h (c.levelSet i) ⊆ K ∪ leftTranslate h K := by + intro x hx + obtain ⟨y, hy, rfl⟩ := Finset.mem_image.mp hx + exact Finset.mem_union_right _ + (Finset.mem_image_of_mem (fun y => h * y) (c.levelSet_subset i hy)) + have hright : c.levelSet i ⊆ K ∪ leftTranslate h K := by + intro x hx + exact Finset.mem_union_left _ (c.levelSet_subset i hx) + calc + _ = ∑ x ∈ K ∪ leftTranslate h K, + |(if x ∈ leftTranslate h (c.levelSet i) then (1 : ℝ) else 0) - + (if x ∈ c.levelSet i then (1 : ℝ) else 0)| := by + apply Finset.sum_congr rfl + intro x hx + simp only [mem_leftTranslate_iff, c.mem_levelSet hpK] + _ = _ := sum_abs_indicators_eq_card_symmDiff _ _ _ hleft hright + +/-- Summing the exact translation identities introduces no cardinality factor. -/ +theorem coarea_sum (c : FiniteLevelChain K p) + (hpK : ∀ x, x ∉ K → p x = 0) (S : Finset G) : + (∑ h ∈ S, ∑ x ∈ K ∪ leftTranslate h K, |p (h⁻¹ * x) - p x|) = + ∑ i : Fin c.n, c.gap i * + (∑ h ∈ S, ((leftTranslate h (c.levelSet i) ∆ c.levelSet i).card : ℝ)) := by + calc + _ = ∑ h ∈ S, ∑ i : Fin c.n, c.gap i * + ((leftTranslate h (c.levelSet i) ∆ c.levelSet i).card : ℝ) := + Finset.sum_congr rfl (fun h _ => c.coarea_translation hpK h) + _ = _ := by + rw [Finset.sum_comm] + simp only [Finset.mul_sum] + +end FiniteLevelChain + +/-- A nonempty level inside the supplied finite support has small total boundary. -/ +theorem finite_folner_of_small_defect_subset + {K S : Finset G} {p : G → ℝ} {ε : ℝ} + (hp0 : ∀ g, 0 ≤ p g) + (hpK : ∀ g, g ∉ K → p g = 0) + (mass : ∑ g ∈ K, p g = 1) + (hdef : (∑ h ∈ S, ∑ x ∈ K ∪ leftTranslate h K, + |p (h⁻¹ * x) - p x|) < ε) : + ∃ A : Finset G, A ⊆ K ∧ A.Nonempty ∧ + (∑ h ∈ S, ((leftTranslate h A ∆ A).card : ℝ)) < ε * (A.card : ℝ) := by + classical + obtain ⟨c⟩ := FiniteLevelChain.exists_chain K p (fun g _ => hp0 g) + have hmass : (∑ i : Fin c.n, c.gap i * ((c.levelSet i).card : ℝ)) = 1 := + (c.coarea_mass hpK).symm.trans mass + have hex : ∃ i : Fin c.n, + (∑ h ∈ S, ((leftTranslate h (c.levelSet i) ∆ c.levelSet i).card : ℝ)) < + ε * ((c.levelSet i).card : ℝ) := by + by_contra hnone + have hfail : ∀ i : Fin c.n, ε * ((c.levelSet i).card : ℝ) ≤ + ∑ h ∈ S, ((leftTranslate h (c.levelSet i) ∆ c.levelSet i).card : ℝ) := + fun i => le_of_not_gt (fun hi => hnone ⟨i, hi⟩) + have hle : ε ≤ ∑ h ∈ S, ∑ x ∈ K ∪ leftTranslate h K, + |p (h⁻¹ * x) - p x| := by + calc + ε = ε * ∑ i : Fin c.n, c.gap i * ((c.levelSet i).card : ℝ) := by + rw [hmass, mul_one] + _ = ∑ i : Fin c.n, c.gap i * (ε * ((c.levelSet i).card : ℝ)) := by + rw [Finset.mul_sum] + apply Finset.sum_congr rfl + intro i hi + ring + _ ≤ ∑ i : Fin c.n, c.gap i * + (∑ h ∈ S, ((leftTranslate h (c.levelSet i) ∆ c.levelSet i).card : ℝ)) := + Finset.sum_le_sum (fun i _ => + mul_le_mul_of_nonneg_left (hfail i) (c.gap_pos i).le) + _ = _ := (c.coarea_sum hpK S).symm + exact (not_lt_of_ge hle) hdef + obtain ⟨i, hi⟩ := hex + exact ⟨c.levelSet i, c.levelSet_subset i, c.levelSet_nonempty i, hi⟩ + +/-- Finite probability with small total translation defect yields a finite Følner set. -/ +theorem finite_folner_of_small_defect + {K S : Finset G} {p : G → ℝ} {ε : ℝ} + (hp0 : ∀ g, 0 ≤ p g) + (hpK : ∀ g, g ∉ K → p g = 0) + (mass : ∑ g ∈ K, p g = 1) + (hdef : (∑ h ∈ S, ∑ x ∈ K ∪ leftTranslate h K, + |p (h⁻¹ * x) - p x|) < ε) : + ∃ A : Finset G, A.Nonempty ∧ + (∑ h ∈ S, ((leftTranslate h A ∆ A).card : ℝ)) < ε * (A.card : ℝ) := by + obtain ⟨A, _, hA, hsmall⟩ := finite_folner_of_small_defect_subset hp0 hpK mass hdef + exact ⟨A, hA, hsmall⟩ + +end Translation + +end ThompsonNonamenability + +end + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/FiniteCorrelationBoundary.lean b/lean/OAI/GroupTheory/Thompson/FiniteCorrelationBoundary.lean new file mode 100644 index 0000000000000000000000000000000000000000..0f28d5e2f547075fc154a1b83d258cf4fb6f3c94 --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/FiniteCorrelationBoundary.lean @@ -0,0 +1,87 @@ +import OAI.GroupTheory.Thompson.DisplacementEstimate +import OAI.GroupTheory.Thompson.CorrelationVariance +import OAI.GroupTheory.Thompson.BoundaryAlgebra +import Mathlib.Tactic.FieldSimp +import Mathlib.Tactic.Ring + +namespace OAI + +/-! +# From the actual recursive vectors and correlations to a boundary bound + +This finite analytic bridge averages the pointwise displacement estimate and +uses the exact correlation variance theorem. Its intermediate hypotheses are +later supplied by the actual dyadic coloring and affine transports. +-/ + +noncomputable section + +open scoped BigOperators InnerProductSpace + +universe uG uE + +namespace ThompsonNonamenability + +variable {G : Type uG} {E : Type uE} [NormedAddCommGroup E] [InnerProductSpace ℝ E] +variable {D : ℕ} + +theorem finite_energy_of_variance (A : Finset G) (hA : A.Nonempty) (hD : 0 < D) + (f : UnitBall E → UnitBall E) (L δ V : ℝ) (hL : 0 < L) (hδ : 0 < δ) + (hLip : ∀ u v, ‖(f u : E) - f v‖ ≤ L * ‖(u : E) - v‖) + (hDisp : ∀ u, δ ≤ ‖(f u : E) - u‖) + (x z : G → Fin D → UnitBall E) + (hrec : ∀ g ∈ A, ∀ i, x g i = f (z g i)) + (hvar : ∀ i, realAvg A + (fun g => ‖(z g i : E) - (ballMean hD (x g) : E)‖ ^ 2) ≤ V) : + δ ^ 2 ≤ L ^ 2 * V := by + have havg := const_le_realAvg A hA (fun g hg => + displacement_le_mean_energy hD f L δ hL hδ hLip hDisp (x g) (z g) (hrec g hg)) + rw [realAvg_const_mul, realAvg_sum_univ] at havg + have hsum : (∑ i, realAvg A + (fun g => ‖(z g i : E) - (ballMean hD (x g) : E)‖ ^ 2)) ≤ (D : ℝ) * V := by + calc + _ ≤ ∑ _i : Fin D, V := Finset.sum_le_sum (fun i _ => hvar i) + _ = (D : ℝ) * V := by simp [nsmul_eq_mul] + have hfactor : 0 ≤ L ^ 2 * (D : ℝ)⁻¹ := + mul_nonneg (sq_nonneg L) (inv_nonneg.mpr (Nat.cast_nonneg D)) + have hDn : (D : ℝ) ≠ 0 := Nat.cast_ne_zero.mpr (Nat.ne_of_gt hD) + calc + δ ^ 2 ≤ (L ^ 2 * (D : ℝ)⁻¹) * ∑ i, realAvg A + (fun g => ‖(z g i : E) - (ballMean hD (x g) : E)‖ ^ 2) := havg + _ ≤ (L ^ 2 * (D : ℝ)⁻¹) * ((D : ℝ) * V) := + mul_le_mul_of_nonneg_left hsum hfactor + _ = L ^ 2 * V := by + field_simp [hDn] + +theorem boundaryConstant_le_of_correlations (A : Finset G) (hA : A.Nonempty) + (hD : 2 ≤ D) (f : UnitBall E → UnitBall E) (L δ α η : ℝ) + (hL : 0 < L) (hδ : 0 < δ) + (hLip : ∀ u v, ‖(f u : E) - f v‖ ≤ L * ‖(u : E) - v‖) + (hDisp : ∀ u, δ ≤ ‖(f u : E) - u‖) + (x : G → Fin D → UnitBall E) (y : G → Fin D → Fin D → UnitBall E) + (hrec : ∀ g ∈ A, ∀ i, + x g i = f (ballMean (lt_of_lt_of_le (by decide : 0 < 2) hD) (y g i))) + (hparent : ∀ j k, j ≠ k → + |corr A (fun g => (x g j : E)) (fun g => (x g k : E)) - α| ≤ η) + (hchild : ∀ i j k, j ≠ k → + |corr A (fun g => (y g i j : E)) (fun g => (y g i k : E)) - α| ≤ η) + (hmixed : ∀ i j k, k ≠ i → + |corr A (fun g => (y g i j : E)) (fun g => (x g k : E)) - α| ≤ η) : + boundaryConstant L δ D ≤ η := by + have hDpos : 0 < D := lt_of_lt_of_le (by decide : 0 < 2) hD + have hvar := finite_variance_bound A hA hDpos + (fun g i => (x g i : E)) (fun g i j => (y g i j : E)) α η + (fun g _ i => (x g i).property) (fun g _ i j => (y g i j).property) + hparent hchild hmixed + have henergy := finite_energy_of_variance A hA hDpos f L δ + (4 / (D : ℝ) + 4 * (1 - 1 / (D : ℝ)) * η) hL hδ hLip hDisp x + (fun g i => ballMean hDpos (y g i)) hrec (by + intro i + simpa only [coe_ballMean] using hvar i) + exact boundaryConstant_le_of_energy hL hD henergy + +end ThompsonNonamenability + +end + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/FiniteLevels.lean b/lean/OAI/GroupTheory/Thompson/FiniteLevels.lean new file mode 100644 index 0000000000000000000000000000000000000000..c53691f8a9eab3af0d368f88c3a1ee85123ad99a --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/FiniteLevels.lean @@ -0,0 +1,175 @@ +import Mathlib.Basic.Real.Basic +import Mathlib.Data.Finset.Sort +import Mathlib.Algebra.BigOperators.Fin +import Mathlib.Tactic.Ring +import Lean.Elab.Tactic.Omega + +namespace OAI + +/-! +# Finite scalar levels + +The distinct values of a nonnegative function on a finite set, together with +zero, give a finite subdivision. Its positive gaps reconstruct every value +and every absolute difference by strict superlevel indicators. These are +finite sums, including when the only level is zero. +-/ + +open scoped BigOperators + +universe uG + +namespace ThompsonNonamenability + +variable {G : Type uG} + +/-- The actual ordered levels of `p` on `K`, with zero included. -/ +structure FiniteLevelChain (K : Finset G) (p : G → ℝ) where + n : ℕ + value : Fin (n + 1) → ℝ + value_zero : value 0 = 0 + strictMono_value : StrictMono value + image_value_eq : Finset.univ.image value = insert 0 (K.image p) + +namespace FiniteLevelChain + +/-- Construct the level chain by sorting the actual finite image. -/ +noncomputable def ofNonneg (K : Finset G) (p : G → ℝ) + (hp : ∀ x ∈ K, 0 ≤ p x) : FiniteLevelChain K p := by + classical + let L : Finset ℝ := insert 0 (K.image p) + have hpos : 0 < L.card := Finset.card_pos.mpr ⟨0, by simp [L]⟩ + let n := L.card - 1 + have hcard : L.card = n + 1 := by dsimp [n]; omega + let e : Fin (n + 1) ↪o ℝ := L.orderEmbOfFin hcard + have heimage : Finset.univ.image e = L := + Finset.image_orderEmbOfFin_univ L hcard + have hnonneg : ∀ a ∈ L, 0 ≤ a := by + intro a ha + rcases Finset.mem_insert.mp ha with rfl | ha + · exact le_rfl + · rcases Finset.mem_image.mp ha with ⟨x, hx, rfl⟩ + exact hp x hx + have hezero : e 0 = 0 := by + have hz : (0 : ℝ) ∈ Finset.univ.image e := by + rw [heimage] + simp [L] + obtain ⟨j, _, hj⟩ := Finset.mem_image.mp hz + apply le_antisymm + · calc + e 0 ≤ e j := e.monotone (Fin.zero_le j) + _ = 0 := hj + · exact hnonneg (e 0) (Finset.orderEmbOfFin_mem L hcard 0) + exact ⟨n, e, hezero, e.strictMono, heimage⟩ + +theorem exists_chain (K : Finset G) (p : G → ℝ) + (hp : ∀ x ∈ K, 0 ≤ p x) : Nonempty (FiniteLevelChain K p) := + ⟨ofNonneg K p hp⟩ + +variable {K : Finset G} {p : G → ℝ} (c : FiniteLevelChain K p) + +/-- Width of the interval immediately above the indexed level. -/ +def gap (i : Fin c.n) : ℝ := c.value i.succ - c.value i.castSucc + +theorem gap_pos (i : Fin c.n) : 0 < c.gap i := by + apply sub_pos.mpr + exact c.strictMono_value (show i.castSucc < i.succ from Nat.lt_succ_self i.val) + +theorem value_nonneg (j : Fin (c.n + 1)) : 0 ≤ c.value j := by + rw [← c.value_zero] + exact c.strictMono_value.monotone (Fin.zero_le j) + +theorem value_mem (j : Fin (c.n + 1)) : c.value j ∈ insert 0 (K.image p) := by + rw [← c.image_value_eq] + exact Finset.mem_image.mpr ⟨j, Finset.mem_univ _, rfl⟩ + +/-- Telescoping below any selected value of a strictly increasing finite list. -/ +private theorem telescope : ∀ (n : ℕ) (f : Fin (n + 1) → ℝ), + StrictMono f → ∀ k : Fin (n + 1), + f k - f 0 = ∑ i : Fin n, + (f i.succ - f i.castSucc) * (if f i.castSucc < f k then 1 else 0) := by + intro n + induction n with + | zero => + intro f hf k + have hk : k = 0 := by + apply Fin.ext + have hklt := k.isLt + omega + subst k + simp + | succ n ih => + intro f hf k + refine Fin.cases ?_ (fun k => ?_) k + · have hnot : ∀ i : Fin (n + 1), ¬ f i.castSucc < f 0 := by + intro i + exact not_lt_of_ge (hf.monotone (Fin.zero_le i.castSucc)) + simp [hnot] + · have hs := ih (fun j : Fin (n + 1) => f j.succ) + (by intro a b hab; exact hf (Nat.succ_lt_succ hab)) k + have hfirst : f 0 < f k.succ := hf (Fin.succ_pos k) + rw [Fin.sum_univ_succ] + change f k.succ - f 0 = + (f (0 : Fin (n + 1)).succ - f 0) * (if f 0 < f k.succ then 1 else 0) + + ∑ i : Fin n, (f i.succ.succ - f i.castSucc.succ) * + (if f i.castSucc.succ < f k.succ then 1 else 0) + rw [ite_eq_left hfirst, mul_one, ← hs] + ring + +/-- The finite layer decomposition of each value in the actual level set. -/ +theorem reconstruct (a : ℝ) (ha : a ∈ insert 0 (K.image p)) : + a = ∑ i : Fin c.n, c.gap i * + (if c.value i.castSucc < a then (1 : ℝ) else 0) := by + classical + have ha' : a ∈ Finset.univ.image c.value := by + rw [c.image_value_eq] + exact ha + rcases Finset.mem_image.mp ha' with ⟨k, _, rfl⟩ + simpa only [gap, c.value_zero, sub_zero] using + telescope c.n c.value c.strictMono_value k + +private theorem abs_sub_eq_sum_of_le (a b : ℝ) + (ha : a ∈ insert 0 (K.image p)) (hb : b ∈ insert 0 (K.image p)) + (hab : a ≤ b) : + |a - b| = ∑ i : Fin c.n, c.gap i * + |(if c.value i.castSucc < a then (1 : ℝ) else 0) - + (if c.value i.castSucc < b then (1 : ℝ) else 0)| := by + classical + have hi : ∀ i : Fin c.n, + (if c.value i.castSucc < a then (1 : ℝ) else 0) ≤ + (if c.value i.castSucc < b then (1 : ℝ) else 0) := by + intro i + by_cases hai : c.value i.castSucc < a + · have hbi : c.value i.castSucc < b := lt_of_lt_of_le hai hab + simp [hai, hbi] + · simp only [ite_eq_right hai] + by_cases hbi : c.value i.castSucc < b <;> simp [hbi] + calc + |a - b| = b - a := by rw [abs_of_nonpos (sub_nonpos.mpr hab)]; ring + _ = (∑ i : Fin c.n, c.gap i * (if c.value i.castSucc < b then (1 : ℝ) else 0)) - + (∑ i : Fin c.n, c.gap i * (if c.value i.castSucc < a then (1 : ℝ) else 0)) := + congrArg₂ (fun x y : ℝ => x - y) (c.reconstruct b hb) (c.reconstruct a ha) + _ = ∑ i : Fin c.n, c.gap i * + |(if c.value i.castSucc < a then (1 : ℝ) else 0) - + (if c.value i.castSucc < b then (1 : ℝ) else 0)| := by + rw [← Finset.sum_sub_distrib] + apply Finset.sum_congr rfl + intro i _ + rw [abs_of_nonpos (sub_nonpos.mpr (hi i))] + ring + +/-- The finite coarea identity for a scalar absolute difference. -/ +theorem abs_sub_eq_sum (a b : ℝ) + (ha : a ∈ insert 0 (K.image p)) (hb : b ∈ insert 0 (K.image p)) : + |a - b| = ∑ i : Fin c.n, c.gap i * + |(if c.value i.castSucc < a then (1 : ℝ) else 0) - + (if c.value i.castSucc < b then (1 : ℝ) else 0)| := by + rcases le_total a b with hab | hba + · exact c.abs_sub_eq_sum_of_le a b ha hb hab + · simpa only [abs_sub_comm] using c.abs_sub_eq_sum_of_le b a hb ha hba + +end FiniteLevelChain + +end ThompsonNonamenability + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/GlobalColors.lean b/lean/OAI/GroupTheory/Thompson/GlobalColors.lean new file mode 100644 index 0000000000000000000000000000000000000000..218caaccbae69402d912f6bf202fb72dd4dc63fb --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/GlobalColors.lean @@ -0,0 +1,155 @@ +import OAI.GroupTheory.Thompson.PartitionColorFamily +import OAI.GroupTheory.Thompson.RestrictionCovariance +import OAI.GroupTheory.Thompson.CorrelationVariance + +namespace OAI + +/-! +# Globally defined colors of the actual Thompson-group images + +A non-basic image, or a basic image failing the simultaneous family respect +condition, receives zero. Thus every correlation is bounded on the entire +actual group, including outside a finite set used for averaging. +-/ + +noncomputable section + +open scoped InnerProductSpace + +universe uE + +namespace ThompsonNonamenability + +local instance : DecidableEq F := Classical.decEq F + +variable {E : Type uE} [NormedAddCommGroup E] [InnerProductSpace ℝ E] +variable {D : ℕ} + +/-- The genuine partial image of the uniform partition, made total with `none`. -/ +def imagePartitionOption (g : F) (n : ℕ) : Option BasicPartition := by + classical + exact if hg : ImageBasic g n then some (imagePartition g n hg) else none + +/-- One condition for the whole actual parent/child family at a group element. -/ +def GlobalAdmissible (D n : ℕ) (g : F) : Prop := + ∃ hg : ImageBasic g n, PartitionAdmissible D (imagePartition g n hg) + +def globalColor (hD : 0 < D) (f : UnitBall E → UnitBall E) + (n : ℕ) (q : IntervalIndex D) (g : F) : UnitBall E := + optionFamilyColor hD f (imagePartitionOption g n) q + +theorem globalColor_of_imageBasic (hD : 0 < D) (f : UnitBall E → UnitBall E) + (n : ℕ) (g : F) (hg : ImageBasic g n) (q : IntervalIndex D) : + globalColor hD f n q g = partitionFamilyColor hD f (imagePartition g n hg) q := by + simp only [globalColor, imagePartitionOption, dite_eq_left hg, optionFamilyColor_some] + +theorem globalColor_of_image_admissible (hD : 0 < D) + (f : UnitBall E → UnitBall E) (n : ℕ) (g : F) (hg : ImageBasic g n) + (hp : PartitionAdmissible D (imagePartition g n hg)) (q : IntervalIndex D) : + globalColor hD f n q g = + partitionColor (selectedInterval D) (selectedInterval_internal D) hD f + ((imagePartition g n hg).restrict (familyInterval D q) (hp q)) := by + rw [globalColor_of_imageBasic hD f n g hg q] + exact partitionFamilyColor_of_admissible hD f _ hp q + +theorem globalColor_of_not_admissible (hD : 0 < D) + (f : UnitBall E → UnitBall E) (n : ℕ) (g : F) + (h : ¬GlobalAdmissible D n g) (q : IntervalIndex D) : + globalColor hD f n q g = unitBallZero E := by + classical + by_cases hg : ImageBasic g n + · rw [globalColor_of_imageBasic hD f n g hg q] + exact partitionFamilyColor_of_not_admissible hD f _ + (fun hp => h ⟨hg, hp⟩) q + · simp only [globalColor, imagePartitionOption, dite_eq_right hg, optionFamilyColor_none] + +theorem globalColor_norm_le (hD : 0 < D) (f : UnitBall E → UnitBall E) + (n : ℕ) (q : IntervalIndex D) (g : F) : + ‖(globalColor hD f n q g : E)‖ ≤ 1 := + (globalColor hD f n q g).property + +/-- The actual finite group set has one common admissibility level. -/ +theorem eventually_global_admissible (D : ℕ) (K : Finset F) : + ∃ N, ∀ n ≥ N, ∀ g ∈ K, GlobalAdmissible D n g := by + obtain ⟨N, hN⟩ := eventually_image_respects K (intervalFamily D) + refine ⟨N, ?_⟩ + intro n hn g hg + obtain ⟨hb, hr⟩ := hN n hn g hg + exact ⟨hb, fun q => hr (familyInterval D q) (familyInterval_mem D q)⟩ + +theorem exists_common_admissible (D : ℕ) (K : Finset F) : + ∃ n, ∀ g ∈ K, GlobalAdmissible D n g := by + obtain ⟨N, hN⟩ := eventually_global_admissible D K + exact ⟨N, hN N le_rfl⟩ + +/-- The exact recursive identity at every admissible actual group point. -/ +theorem globalColor_parent (hD : 0 < D) (f : UnitBall E → UnitBall E) + (n : ℕ) (g : F) (hg : GlobalAdmissible D n g) (i : Fin D) : + globalColor hD f n (.inl i) g = + f (ballMean hD (fun j => globalColor hD f n (.inr (i, j)) g)) := by + obtain ⟨hb, hp⟩ := hg + simp only [globalColor_of_imageBasic hD f n g hb] + exact partitionFamilyColor_parent hD f _ hp i + +/-- Source and target admissibility suffice; the transport need not preserve +any other selected interval. -/ +theorem globalColor_covariance (hD : 0 < D) (f : UnitBall E → UnitBall E) + (n : ℕ) (h g : F) (q r : IntervalIndex D) + (hc : CarriesAffinely h (familyInterval D q) (familyInterval D r)) + (hg : GlobalAdmissible D n g) (hhg : GlobalAdmissible D n (h * g)) : + globalColor hD f n q g = globalColor hD f n r (h * g) := by + obtain ⟨hb, hp⟩ := hg + obtain ⟨hhb, hhp⟩ := hhg + rw [globalColor_of_image_admissible hD f n g hb hp q, + globalColor_of_image_admissible hD f n (h * g) hhb hhp r] + apply congrArg (partitionColor (selectedInterval D) (selectedInterval_internal D) hD f) + exact (image_restrict_covariance h g n (familyInterval D q) (familyInterval D r) + hc hb hhb (hp q) (hhp r)).symm + +/-- A real correlation on all of the actual group. -/ +def globalCorrelation (hD : 0 < D) (f : UnitBall E → UnitBall E) + (n : ℕ) (q r : IntervalIndex D) (g : F) : ℝ := + ⟪(globalColor hD f n q g : E), globalColor hD f n r g⟫_ℝ + +theorem globalCorrelation_abs_le_one (hD : 0 < D) + (f : UnitBall E → UnitBall E) (n : ℕ) (q r : IntervalIndex D) (g : F) : + |globalCorrelation hD f n q r g| ≤ 1 := + unit_inner_abs_le _ _ (globalColor_norm_le hD f n q g) + (globalColor_norm_le hD f n r g) + +theorem globalCorrelation_covariance (hD : 0 < D) (f : UnitBall E → UnitBall E) + (n : ℕ) (h g : F) (q r q' r' : IntervalIndex D) + (hq : CarriesAffinely h (familyInterval D q) (familyInterval D q')) + (hr : CarriesAffinely h (familyInterval D r) (familyInterval D r')) + (hg : GlobalAdmissible D n g) (hhg : GlobalAdmissible D n (h * g)) : + globalCorrelation hD f n q r g = globalCorrelation hD f n q' r' (h * g) := by + unfold globalCorrelation + rw [globalColor_covariance hD f n h g q q' hq hg hhg, + globalColor_covariance hD f n h g r r' hr hg hhg] + +/-- Exact affine covariance and global boundedness imply the finite comparison. -/ +theorem globalCorrelation_translate_bound (hD : 0 < D) + (f : UnitBall E → UnitBall E) (n : ℕ) (A : Finset F) (hA : A.Nonempty) + (h : F) (q r q' r' : IntervalIndex D) + (hq : CarriesAffinely h (familyInterval D q) (familyInterval D q')) + (hr : CarriesAffinely h (familyInterval D r) (familyInterval D r')) + (hg : ∀ g ∈ A, GlobalAdmissible D n g) + (hhg : ∀ g ∈ A, GlobalAdmissible D n (h * g)) : + |realAvg A (globalCorrelation hD f n q r) - + realAvg A (globalCorrelation hD f n q' r')| ≤ boundaryRatio A h := by + classical + have heq : realAvg A (globalCorrelation hD f n q r) = + realAvg A (fun g => globalCorrelation hD f n q' r' (h * g)) := by + apply realAvg_congr + intro g hmem + exact globalCorrelation_covariance hD f n h g q r q' r' hq hr + (hg g hmem) (hhg g hmem) + rw [heq] + exact abs_realAvg_translate_sub_le A hA h (globalCorrelation hD f n q' r') + (globalCorrelation_abs_le_one hD f n q' r') + +end ThompsonNonamenability + +end + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/HilbertAverage.lean b/lean/OAI/GroupTheory/Thompson/HilbertAverage.lean new file mode 100644 index 0000000000000000000000000000000000000000..0810ff741e3e3adc2285df16e310363ee58547bc --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/HilbertAverage.lean @@ -0,0 +1,110 @@ +import OAI.GroupTheory.Thompson.UnitBall +import Mathlib.Algebra.Order.BigOperators.Ring.Finset +import Mathlib.Analysis.Normed.Module.RCLike.Real + +namespace OAI + +/-! +# Finite averages in the unit ball + +The norm bounds hold in any real seminormed space. Inner-product expansions are +kept in a separate section and require a real inner-product space. +-/ + +noncomputable section + +open scoped BigOperators InnerProductSpace + +universe uE + +namespace ThompsonNonamenability + +section Normed + +variable {E : Type uE} [SeminormedAddCommGroup E] [NormedSpace ℝ E] +variable {D : ℕ} + +/-- The equally weighted mean of a finite family. -/ +def finMean (x : Fin D → E) : E := + (D : ℝ)⁻¹ • ∑ i, x i + +theorem finMean_sub (x y : Fin D → E) : + finMean (fun i => x i - y i) = finMean x - finMean y := by + simp only [finMean, Finset.sum_sub_distrib, smul_sub] + +@[simp] theorem finMean_const (hD : 0 < D) (z : E) : + finMean (fun _ : Fin D => z) = z := by + have hD' : (D : ℝ) ≠ 0 := Nat.cast_ne_zero.mpr (Nat.ne_of_gt hD) + rw [finMean, Finset.sum_const, Finset.card_univ, Fintype.card_fin, + ← Nat.cast_smul_eq_nsmul ℝ D z, smul_smul, inv_mul_cancel₀ hD', one_smul] + +/-- The squared norm of a mean is bounded by the mean of the squared norms. -/ +theorem norm_finMean_sq_le (hD : 0 < D) (x : Fin D → E) : + ‖finMean x‖ ^ 2 ≤ (D : ℝ)⁻¹ * ∑ i, ‖x i‖ ^ 2 := by + have hD' : (D : ℝ) ≠ 0 := Nat.cast_ne_zero.mpr (Nat.ne_of_gt hD) + have hc : 0 ≤ (D : ℝ)⁻¹ := inv_nonneg.mpr (Nat.cast_nonneg D) + have hcs : (∑ i, ‖x i‖) ^ 2 ≤ (D : ℝ) * ∑ i, ‖x i‖ ^ 2 := by + simpa using Finset.sum_mul_sq_le_sq_mul_sq Finset.univ + (fun _ : Fin D => (1 : ℝ)) (fun i => ‖x i‖) + have hs : ‖∑ i, x i‖ ^ 2 ≤ (D : ℝ) * ∑ i, ‖x i‖ ^ 2 := + (pow_le_pow_left₀ (norm_nonneg _) (norm_sum_le Finset.univ x) 2).trans hcs + calc + ‖finMean x‖ ^ 2 = ((D : ℝ)⁻¹) ^ 2 * ‖∑ i, x i‖ ^ 2 := by + rw [finMean, norm_smul_of_nonneg hc, mul_pow] + _ ≤ ((D : ℝ)⁻¹) ^ 2 * ((D : ℝ) * ∑ i, ‖x i‖ ^ 2) := + mul_le_mul_of_nonneg_left hs (sq_nonneg _) + _ = (D : ℝ)⁻¹ * ((D : ℝ)⁻¹ * (D : ℝ)) * ∑ i, ‖x i‖ ^ 2 := by + ring + _ = (D : ℝ)⁻¹ * ∑ i, ‖x i‖ ^ 2 := by + rw [inv_mul_cancel₀ hD', mul_one] + +/-- Averaging a finite family in the closed unit ball preserves its norm bound. -/ +theorem finMean_mem_unitBall (hD : 0 < D) (x : Fin D → UnitBall E) : + ‖finMean (fun i => (x i : E))‖ ≤ 1 := by + have hD' : (D : ℝ) ≠ 0 := Nat.cast_ne_zero.mpr (Nat.ne_of_gt hD) + have hc : 0 ≤ (D : ℝ)⁻¹ := inv_nonneg.mpr (Nat.cast_nonneg D) + have hs : ‖∑ i, (x i : E)‖ ≤ (D : ℝ) := by + calc + ‖∑ i, (x i : E)‖ ≤ ∑ i, ‖(x i : E)‖ := norm_sum_le Finset.univ _ + _ ≤ ∑ _i : Fin D, (1 : ℝ) := + Finset.sum_le_sum (fun i _ => (x i).property) + _ = (D : ℝ) := by simp + calc + ‖finMean (fun i => (x i : E))‖ = (D : ℝ)⁻¹ * ‖∑ i, (x i : E)‖ := by + rw [finMean, norm_smul_of_nonneg hc] + _ ≤ (D : ℝ)⁻¹ * (D : ℝ) := mul_le_mul_of_nonneg_left hs hc + _ = 1 := inv_mul_cancel₀ hD' + +/-- The equally weighted mean, bundled with its unit-ball bound. -/ +def ballMean (hD : 0 < D) (x : Fin D → UnitBall E) : UnitBall E := + ⟨finMean (fun i => (x i : E)), finMean_mem_unitBall hD x⟩ + +@[simp] theorem coe_ballMean (hD : 0 < D) (x : Fin D → UnitBall E) : + (ballMean hD x : E) = finMean (fun i => (x i : E)) := rfl + +end Normed + +section InnerProduct + +variable {E : Type uE} [SeminormedAddCommGroup E] [InnerProductSpace ℝ E] +variable {D K : ℕ} + +/-- The inner product of two finite averages is the average of all pairings. -/ +theorem inner_finMean (x : Fin D → E) (y : Fin K → E) : + ⟪finMean x, finMean y⟫_ℝ = + ((D : ℝ)⁻¹ * (K : ℝ)⁻¹) * ∑ i, ∑ j, ⟪x i, y j⟫_ℝ := by + simp_rw [finMean, real_inner_smul_left, real_inner_smul_right, + sum_inner, inner_sum, mul_assoc] + +/-- Expand the squared norm of an average into all pairwise inner products. -/ +theorem norm_finMean_sq (x : Fin D → E) : + ‖finMean x‖ ^ 2 = ((D : ℝ)⁻¹) ^ 2 * ∑ i, ∑ j, ⟪x i, x j⟫_ℝ := by + rw [← real_inner_self_eq_norm_sq, inner_finMean, pow_two] + +end InnerProduct + +end ThompsonNonamenability + +end + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/IntervalCharts.lean b/lean/OAI/GroupTheory/Thompson/IntervalCharts.lean new file mode 100644 index 0000000000000000000000000000000000000000..e764de3391a8d2b447ea2419942771f17ce6ad1f --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/IntervalCharts.lean @@ -0,0 +1,106 @@ +import OAI.GroupTheory.Thompson.BasicInterval +import OAI.GroupTheory.Thompson.StandardPL + +namespace OAI + +/-! +# Actual affine charts of basic intervals + +The chart is bundled as a point of the real unit interval. Affine transport +means equality of these actual maps at every point, including both endpoints. +-/ + +noncomputable section + +namespace ThompsonNonamenability + +namespace BasicInterval + +def chartPoint (I : BasicInterval) (x : UnitInterval) : UnitInterval := + ⟨I.chart (x : ℝ), I.carrier_subset_unit + ((I.chart_mem_self_carrier_iff (x : ℝ)).mpr x.property)⟩ + +@[simp] theorem coe_chartPoint (I : BasicInterval) (x : UnitInterval) : + (I.chartPoint x : ℝ) = I.chart (x : ℝ) := rfl + +theorem chartPoint_injective (I : BasicInterval) : + Function.Injective I.chartPoint := by + intro x y h + apply Subtype.ext + exact I.chart_injective (congrArg (fun z : UnitInterval => (z : ℝ)) h) + +@[simp] theorem chartPoint_comp (I J : BasicInterval) (x : UnitInterval) : + (I.comp J).chartPoint x = I.chartPoint (J.chartPoint x) := by + apply Subtype.ext + exact I.chart_comp J (x : ℝ) + +theorem chartPoint_mem_carrier (I : BasicInterval) (x : UnitInterval) : + (I.chartPoint x : ℝ) ∈ I.carrier := + (I.chart_mem_self_carrier_iff (x : ℝ)).mpr x.property + +theorem exists_chartPoint (I : BasicInterval) (x : UnitInterval) + (hx : (x : ℝ) ∈ I.carrier) : ∃ y : UnitInterval, I.chartPoint y = x := by + let t : ℝ := ((x : ℝ) - I.left) / I.length + have ht : t ∈ Set.Icc (0 : ℝ) 1 := by + constructor + · exact div_nonneg (sub_nonneg.mpr hx.1) I.length_pos.le + · apply (div_le_one I.length_pos).mpr + rw [I.length_eq_right_sub_left] + exact sub_le_sub_right hx.2 _ + refine ⟨⟨t, ht⟩, ?_⟩ + apply Subtype.ext + change I.chart t = (x : ℝ) + rw [I.chart_eq_left_add_length_mul] + dsimp [t] + field_simp [ne_of_gt I.length_pos] + ring + +theorem left_isDyadic (I : BasicInterval) : IsDyadic I.left := by + exact ⟨(I.index.val : ℤ), I.depth, by simp only [left, Int.cast_natCast]⟩ + +theorem right_isDyadic (I : BasicInterval) : IsDyadic I.right := by + exact ⟨(I.index.val : ℤ) + 1, I.depth, by + simp only [right, Int.cast_add, Int.cast_natCast, Int.cast_one]⟩ + +end BasicInterval + +def CarriesAffinely (h : F) (I J : BasicInterval) : Prop := + ∀ x : UnitInterval, (h (I.chartPoint x) : ℝ) = J.chart (x : ℝ) + +namespace CarriesAffinely + +theorem chartPoint {h : F} {I J : BasicInterval} (hc : CarriesAffinely h I J) + (x : UnitInterval) : h (I.chartPoint x) = J.chartPoint x := + Subtype.ext (hc x) + +theorem comp {h : F} {I J : BasicInterval} (hc : CarriesAffinely h I J) + (K : BasicInterval) : CarriesAffinely h (I.comp K) (J.comp K) := by + intro x + simpa only [BasicInterval.chartPoint_comp, BasicInterval.chart_comp, + BasicInterval.coe_chartPoint] using hc (K.chartPoint x) + +theorem maps_carrier {h : F} {I J : BasicInterval} (hc : CarriesAffinely h I J) + {x : UnitInterval} (hx : (x : ℝ) ∈ I.carrier) : (h x : ℝ) ∈ J.carrier := by + obtain ⟨y, rfl⟩ := I.exists_chartPoint x hx + rw [hc y] + exact (J.chart_mem_self_carrier_iff (y : ℝ)).mpr y.property + +theorem preimage_carrier {h : F} {I J : BasicInterval} + (hc : CarriesAffinely h I J) {x : UnitInterval} : + (h x : ℝ) ∈ J.carrier ↔ (x : ℝ) ∈ I.carrier := by + constructor + · intro hx + obtain ⟨y, hy⟩ := J.exists_chartPoint (h x) hx + have hxy : I.chartPoint y = x := + h.toHomeomorph.injective ((hc.chartPoint y).trans hy) + rw [← hxy] + exact I.chartPoint_mem_carrier y + · exact hc.maps_carrier + +end CarriesAffinely + +end ThompsonNonamenability + +end + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/IntervalFamily.lean b/lean/OAI/GroupTheory/Thompson/IntervalFamily.lean new file mode 100644 index 0000000000000000000000000000000000000000..03dfd9b95e15ead56053d17187e337c29a316d5b --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/IntervalFamily.lean @@ -0,0 +1,120 @@ +import OAI.GroupTheory.Thompson.BasicInterval +import Mathlib.Data.Fintype.Sum +import Mathlib.Data.Fintype.Prod +import Lean.Elab.Tactic.Omega + +namespace OAI + +/-! +# A concrete finite family of separated internal dyadic intervals + +At depth 2D use the cells with indices 2i+1. The bound 2D < 2^(2D) +leaves room at the right endpoint. Each adjacent selected pair has a positive +gap. The finite occurrence type remembers parents and their children without +requiring an injectivity premise for the family. +-/ + +noncomputable section + +namespace ThompsonNonamenability + +/-- The actual ith selected dyadic cell at common depth 2D. -/ +def selectedInterval (D : ℕ) (i : Fin D) : BasicInterval where + depth := 2 * D + index := ⟨2 * i.val + 1, by + have hi := i.isLt + have hsmall : 2 * i.val + 1 < 2 * D := by omega + exact hsmall.trans (2 * D).lt_two_pow_self⟩ + +theorem selectedInterval_internal (D : ℕ) (i : Fin D) : + (selectedInterval D i).Internal := by + have hp : (0 : ℝ) < (2 : ℝ) ^ (2 * D) := pow_pos (by norm_num) _ + constructor + · change (0 : ℝ) < ((2 * i.val + 1 : ℕ) : ℝ) / (2 : ℝ) ^ (2 * D) + exact div_pos (Nat.cast_pos.mpr (by omega)) hp + · change (((2 * i.val + 1 : ℕ) : ℝ) + 1) / (2 : ℝ) ^ (2 * D) < 1 + apply (div_lt_one hp).2 + have hi := i.isLt + have hsmall : 2 * i.val + 1 + 1 ≤ 2 * D := by omega + have hlarge : 2 * i.val + 1 + 1 < 2 ^ (2 * D) := + hsmall.trans_lt (2 * D).lt_two_pow_self + exact_mod_cast hlarge + +theorem selectedInterval_before {D : ℕ} {i j : Fin D} (hij : i < j) : + (selectedInterval D i).Before (selectedInterval D j) := by + change (((2 * i.val + 1 : ℕ) : ℝ) + 1) / (2 : ℝ) ^ (2 * D) < + ((2 * j.val + 1 : ℕ) : ℝ) / (2 : ℝ) ^ (2 * D) + apply (div_lt_div_iff_of_pos_right (pow_pos (by norm_num : (0 : ℝ) < 2) _)).2 + have hv : i.val < j.val := hij + have hn : 2 * i.val + 1 + 1 < 2 * j.val + 1 := by omega + exact_mod_cast hn + +/-- Strict separation permits either orientation and always has a positive gap. -/ +def StrictlySeparated (I J : BasicInterval) : Prop := I.Before J ∨ J.Before I + +theorem StrictlySeparated.symm {I J : BasicInterval} + (h : StrictlySeparated I J) : StrictlySeparated J I := Or.symm h + +theorem selectedInterval_separated {D : ℕ} {i j : Fin D} (hij : i ≠ j) : + StrictlySeparated (selectedInterval D i) (selectedInterval D j) := by + rcases lt_or_gt_of_ne hij with h | h + · exact Or.inl (selectedInterval_before h) + · exact Or.inr (selectedInterval_before h) + +theorem selected_siblings_separated {D : ℕ} (i : Fin D) {j k : Fin D} + (hjk : j ≠ k) : + StrictlySeparated ((selectedInterval D i).comp (selectedInterval D j)) + ((selectedInterval D i).comp (selectedInterval D k)) := by + rcases selectedInterval_separated hjk with h | h + · exact Or.inl ((selectedInterval D i).comp_before_comp h) + · exact Or.inr ((selectedInterval D i).comp_before_comp h) + +/-- A descendant is separated from every parent except its own parent. -/ +theorem selected_child_parent_separated {D : ℕ} (i j k : Fin D) (hki : k ≠ i) : + StrictlySeparated ((selectedInterval D i).comp (selectedInterval D j)) + (selectedInterval D k) := by + have hc := (selectedInterval D i).comp_contained (selectedInterval D j) + rcases selectedInterval_separated (Ne.symm hki) with h | h + · exact Or.inl (lt_of_le_of_lt hc.2 h) + · exact Or.inr (lt_of_lt_of_le h hc.1) + +abbrev IntervalIndex (D : ℕ) := Fin D ⊕ (Fin D × Fin D) + +/-- Actual parent and second-generation intervals indexed by their occurrences. -/ +def familyInterval (D : ℕ) : IntervalIndex D → BasicInterval + | .inl i => selectedInterval D i + | .inr (i, j) => (selectedInterval D i).comp (selectedInterval D j) + +theorem familyInterval_internal (D : ℕ) (q : IntervalIndex D) : + (familyInterval D q).Internal := by + rcases q with i | ⟨i, j⟩ + · exact selectedInterval_internal D i + · exact (selectedInterval D i).comp_internal_of_internal_right + (selectedInterval D j) (selectedInterval_internal D j) + +/-- The actual finite interval set used by the single admissibility condition. -/ +def intervalFamily (D : ℕ) : Finset BasicInterval := + Finset.univ.image (familyInterval D) + +theorem familyInterval_mem (D : ℕ) (q : IntervalIndex D) : + familyInterval D q ∈ intervalFamily D := + Finset.mem_image.mpr ⟨q, Finset.mem_univ q, rfl⟩ + +def firstIndex {D : ℕ} (hD : 2 ≤ D) : Fin D := + ⟨0, lt_of_lt_of_le (by decide : 0 < 2) hD⟩ + +def secondIndex {D : ℕ} (hD : 2 ≤ D) : Fin D := + ⟨1, lt_of_lt_of_le (by decide : 1 < 2) hD⟩ + +theorem reference_before {D : ℕ} (hD : 2 ≤ D) : + (selectedInterval D (firstIndex hD)).Before + (selectedInterval D (secondIndex hD)) := + selectedInterval_before (show firstIndex hD < secondIndex hD from by + change (0 : ℕ) < 1 + decide) + +end ThompsonNonamenability + +end + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/IntervalHomeomorph.lean b/lean/OAI/GroupTheory/Thompson/IntervalHomeomorph.lean new file mode 100644 index 0000000000000000000000000000000000000000..0f18e4fb65faf53df62cd2ee0c53e817be7323d7 --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/IntervalHomeomorph.lean @@ -0,0 +1,109 @@ +import OAI.GroupTheory.Thompson.Model +import Mathlib.Topology.Homeomorph.Lemmas +import Mathlib.Topology.Instances.Real.Lemmas +import Mathlib.Algebra.Group.Subgroup.Basic + +namespace OAI + +/-! +# Actual homeomorphisms of the real unit interval + +The wrapper supplies the composition group explicitly. In particular, its +multiplication is function composition in the order `(h * g) x = h (g x)`. +Its carrier is equivalent to the actual interval homeomorphisms, without +quotients or an abstract group action. +-/ + +namespace ThompsonNonamenability + +@[simp] theorem coe_unitIntervalZero : (unitIntervalZero : ℝ) = 0 := rfl +@[simp] theorem coe_unitIntervalOne : (unitIntervalOne : ℝ) = 1 := rfl + +namespace IntervalHomeomorph + +@[ext] theorem ext {f g : IntervalHomeomorph} (h : ∀ x, f x = g x) : f = g := by + cases f with + | mk f => + cases g with + | mk g => + congr 1 + exact Homeomorph.ext h + +def homeomorphEquiv : IntervalHomeomorph ≃ (UnitInterval ≃ₜ UnitInterval) where + toFun := toHomeomorph + invFun := IntervalHomeomorph.mk + left_inv f := by cases f; rfl + right_inv _ := rfl + +@[simp] theorem homeomorphEquiv_apply (f : IntervalHomeomorph) : + homeomorphEquiv f = f.toHomeomorph := rfl + +instance : Group IntervalHomeomorph where + one := ⟨Homeomorph.refl UnitInterval⟩ + mul f g := ⟨g.toHomeomorph.trans f.toHomeomorph⟩ + inv f := ⟨f.toHomeomorph.symm⟩ + mul_assoc _ _ _ := ext fun _ => rfl + one_mul _ := ext fun _ => rfl + mul_one _ := ext fun _ => rfl + inv_mul_cancel f := ext f.toHomeomorph.symm_apply_apply + +@[simp] theorem one_apply (x : UnitInterval) : (1 : IntervalHomeomorph) x = x := rfl + +@[simp] theorem mul_apply (h g : IntervalHomeomorph) (x : UnitInterval) : + (h * g) x = h (g x) := rfl + +@[simp] theorem inv_apply_apply (f : IntervalHomeomorph) (x : UnitInterval) : + f⁻¹ (f x) = x := f.toHomeomorph.symm_apply_apply x + +@[simp] theorem apply_inv_apply (f : IntervalHomeomorph) (x : UnitInterval) : + f (f⁻¹ x) = x := f.toHomeomorph.apply_symm_apply x + +theorem injective (f : IntervalHomeomorph) : Function.Injective f := + f.toHomeomorph.injective + +theorem surjective (f : IntervalHomeomorph) : Function.Surjective f := + f.toHomeomorph.surjective + +theorem continuous (f : IntervalHomeomorph) : Continuous f := + f.toHomeomorph.continuous + +theorem strictMono_inv {f : IntervalHomeomorph} (hf : StrictMono f) : + StrictMono (f⁻¹ : IntervalHomeomorph) := by + intro x y hxy + by_contra h + have hyx : f⁻¹ y ≤ f⁻¹ x := le_of_not_gt h + have h' := hf.monotone hyx + simp only [apply_inv_apply] at h' + exact (not_le_of_gt hxy) h' + +theorem map_zero {f : IntervalHomeomorph} (hf : StrictMono f) : + f unitIntervalZero = unitIntervalZero := by + apply Subtype.ext + apply le_antisymm + have hx : unitIntervalZero ≤ f⁻¹ unitIntervalZero := + (f⁻¹ unitIntervalZero).property.1 + have h := hf.monotone hx + simpa only [apply_inv_apply, Subtype.coe_le_coe] using h + exact (f unitIntervalZero).property.1 + +theorem map_one {f : IntervalHomeomorph} (hf : StrictMono f) : + f unitIntervalOne = unitIntervalOne := by + apply Subtype.ext + apply le_antisymm + exact (f unitIntervalOne).property.2 + have hx : f⁻¹ unitIntervalOne ≤ unitIntervalOne := + (f⁻¹ unitIntervalOne).property.2 + have h := hf.monotone hx + simpa only [apply_inv_apply, Subtype.coe_le_coe] using h + +def increasingSubgroup : Subgroup IntervalHomeomorph where + carrier := {f | StrictMono f} + one_mem' := fun _ _ h => h + mul_mem' hf hg := hf.comp hg + inv_mem' hf := strictMono_inv hf + +end IntervalHomeomorph + +end ThompsonNonamenability + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/InvariantMean.lean b/lean/OAI/GroupTheory/Thompson/InvariantMean.lean new file mode 100644 index 0000000000000000000000000000000000000000..0262901975de822d6c464afba2416964d27ad38d --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/InvariantMean.lean @@ -0,0 +1,126 @@ +import OAI.GroupTheory.Thompson.Model +import Mathlib.Analysis.Normed.Lp.lpSpace +import Mathlib.Analysis.Normed.Operator.Basic + +namespace OAI + +/-! +# Positive normalized left-invariant means + +The domain is the actual space of all bounded real functions on the group. +Continuity is a consequence of positivity and normalization, not an assumption. +-/ + +noncomputable section + +open scoped ENNReal + +universe uG + +namespace ThompsonNonamenability + +@[simp] +theorem BoundedReal.smul_one_apply {G : Type uG} (r : ℝ) (g : G) : + (r • (1 : BoundedReal G)) g = r := by + simp [lp.coeFn_smul, lp.infty_coeFn_one] + +variable {G : Type uG} [Group G] + +@[simp] +theorem leftPull_apply (h : G) (f : BoundedReal G) (g : G) : + leftPull h f g = f (h * g) := rfl + +@[simp] +theorem leftPull_one (f : BoundedReal G) : leftPull (1 : G) f = f := by + apply lp.ext + funext g + simp + +/-- Pullback reverses the order of the two left multiplications. -/ +theorem leftPull_mul (h k : G) (f : BoundedReal G) : + leftPull (h * k) f = leftPull k (leftPull h f) := by + apply lp.ext + funext g + simp [mul_assoc] + +namespace InvariantMean + +instance : CoeFun (InvariantMean G) (fun _ => BoundedReal G → ℝ) := + ⟨fun M => M.toLinearMap⟩ + +@[simp] +theorem map_zero (M : InvariantMean G) : M 0 = 0 := M.toLinearMap.map_zero + +@[simp] +theorem map_add (M : InvariantMean G) (f g : BoundedReal G) : + M (f + g) = M f + M g := M.toLinearMap.map_add f g + +@[simp] +theorem map_sub (M : InvariantMean G) (f g : BoundedReal G) : + M (f - g) = M f - M g := M.toLinearMap.map_sub f g + +@[simp] +theorem map_smul (M : InvariantMean G) (r : ℝ) (f : BoundedReal G) : + M (r • f) = r * M f := by + simpa only [smul_eq_mul] using M.toLinearMap.map_smul r f + +/-- Evaluation of a constant function. -/ +@[simp] +theorem map_const (M : InvariantMean G) (r : ℝ) : + M (r • (1 : BoundedReal G)) = r := by + rw [map_smul, M.normalized, mul_one] + +/-- Positivity gives monotonicity for the pointwise order. -/ +theorem mono (M : InvariantMean G) {f g : BoundedReal G} + (hfg : ∀ x, f x ≤ g x) : M f ≤ M g := by + have h := M.positive (g - f) (fun x => sub_nonneg.mpr (hfg x)) + rw [map_sub] at h + exact sub_nonneg.mp h + +/-- A mean has norm at most one, as a consequence of its defining axioms. -/ +theorem abs_apply_le_norm (M : InvariantMean G) (f : BoundedReal G) : + |M f| ≤ ‖f‖ := by + have hbound (g : G) : -‖f‖ ≤ f g ∧ f g ≤ ‖f‖ := by + apply abs_le.mp + simpa only [Real.norm_eq_abs] using + lp.norm_apply_le_norm ENNReal.top_ne_zero f g + have hlo := M.mono (f := (-‖f‖) • (1 : BoundedReal G)) (g := f) + (fun g => by simpa only [BoundedReal.smul_one_apply] using (hbound g).1) + have hhi := M.mono (f := f) (g := ‖f‖ • (1 : BoundedReal G)) + (fun g => by simpa only [BoundedReal.smul_one_apply] using (hbound g).2) + rw [map_const] at hlo hhi + exact abs_le.mpr ⟨hlo, hhi⟩ + +/-- The continuous functional furnished automatically by a positive normalized mean. -/ +def toContinuousLinearMap (M : InvariantMean G) : BoundedReal G →L[ℝ] ℝ := + M.toLinearMap.mkContinuous 1 (fun f => by + simpa only [one_mul, Real.norm_eq_abs] using M.abs_apply_le_norm f) + +@[simp] +theorem toContinuousLinearMap_apply (M : InvariantMean G) (f : BoundedReal G) : + M.toContinuousLinearMap f = M f := rfl + +theorem continuous (M : InvariantMean G) : Continuous M := + M.toContinuousLinearMap.continuous + +theorem norm_toContinuousLinearMap_le_one (M : InvariantMean G) : + ‖M.toContinuousLinearMap‖ ≤ 1 := by + apply ContinuousLinearMap.opNorm_le_bound _ zero_le_one + intro f + simpa only [toContinuousLinearMap_apply, one_mul, Real.norm_eq_abs] using + M.abs_apply_le_norm f + +/-- Normalization makes the automatic functional's operator norm exactly one. -/ +theorem norm_toContinuousLinearMap (M : InvariantMean G) : + ‖M.toContinuousLinearMap‖ = 1 := by + apply le_antisymm M.norm_toContinuousLinearMap_le_one + have h := M.toContinuousLinearMap.le_opNorm (1 : BoundedReal G) + simpa only [toContinuousLinearMap_apply, M.normalized, norm_one, mul_one] using h + +end InvariantMean + +end ThompsonNonamenability + +end + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/Main.lean b/lean/OAI/GroupTheory/Thompson/Main.lean new file mode 100644 index 0000000000000000000000000000000000000000..e75c76192edeffdadb156a278ae0df5c0a85adee --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/Main.lean @@ -0,0 +1,82 @@ +import OAI.GroupTheory.Thompson.StandardCharacterization +import OAI.GroupTheory.Thompson.FiniteBoundary +import OAI.GroupTheory.Thompson.AnalyticConstruction +import OAI.GroupTheory.Thompson.MeanToFolner + +namespace OAI + +noncomputable section + +open scoped symmDiff + +namespace ThompsonNonamenability + +local instance : DecidableEq F := Classical.decEq F + +theorem thompson_F_boundary_with_exact_constant : + ∃ (D : ℕ) (S : Finset F), + 2 ≤ D ∧ + 4 * Analytic.displacementLipschitzConstant ^ 2 / (1 / 2 : ℝ) ^ 2 < + (D : ℝ) ∧ + S.Nonempty ∧ + 0 < boundaryConstant Analytic.displacementLipschitzConstant (1 / 2) D ∧ + ∀ A : Finset F, A.Nonempty → + ∃ h ∈ S, + boundaryConstant Analytic.displacementLipschitzConstant (1 / 2) D ≤ + boundaryRatio A h := by + obtain ⟨D, hD, hlarge⟩ := + exists_branching_parameter Analytic.displacementLipschitzConstant (1 / 2) + obtain ⟨S, hS, hb, hboundary⟩ := + exists_fixed_boundary Analytic.displacementMap + Analytic.displacementLipschitzConstant (1 / 2) + Analytic.displacementLipschitzConstant_pos (by norm_num) + Analytic.displacementMap_lipschitz Analytic.displacementMap_displacement + D hD hlarge + exact ⟨D, S, hD, hlarge, hS, hb, hboundary⟩ + +/-- The displayed formula has no additional normalization or hidden factor. -/ +theorem thompson_F_boundary_constant_formula (D : ℕ) : + boundaryConstant Analytic.displacementLipschitzConstant (1 / 2) D = + ((1 / 2 : ℝ) ^ 2 / Analytic.displacementLipschitzConstant ^ 2 - + 4 / (D : ℝ)) / (4 * (1 - 1 / (D : ℝ))) := rfl + +/-- A fixed finite subset of the genuine PL group uniformly expands every +nonempty finite subset, in the unnormalized symmetric-difference form. -/ +theorem thompson_F_uniform_boundary : + ∃ (S : Finset F) (b : ℝ), S.Nonempty ∧ 0 < b ∧ + ∀ A : Finset F, A.Nonempty → + ∃ h ∈ S, b * (A.card : ℝ) ≤ ((leftTranslate h A ∆ A).card : ℝ) := by + obtain ⟨D, S, _hD, _hlarge, hS, hb, hboundary⟩ := + thompson_F_boundary_with_exact_constant + refine ⟨S, boundaryConstant Analytic.displacementLipschitzConstant (1 / 2) D, + hS, hb, ?_⟩ + intro A hA + obtain ⟨h, hh, hratio⟩ := hboundary A hA + have hcard : (0 : ℝ) < (A.card : ℝ) := + Nat.cast_pos.mpr (Finset.card_pos.mpr hA) + refine ⟨h, hh, ?_⟩ + change boundaryConstant Analytic.displacementLipschitzConstant (1 / 2) D ≤ + ((leftTranslate h A ∆ A).card : ℝ) / (A.card : ℝ) at hratio + exact (le_div_iff₀ hcard).mp hratio + +/-- Standard Thompson F admits no positive normalized left-invariant mean on +all bounded real functions. The carrier is identified with the ordinary +finite-breakpoint dyadic PL homeomorphisms by `F.standardPLEquiv`. -/ +theorem thompson_F_not_amenable : ¬ Nonempty (InvariantMean F) := by + obtain ⟨S, b, _hS, hb, hboundary⟩ := thompson_F_uniform_boundary + exact not_amenable_of_uniform_boundary S hb hboundary + +theorem thompson_F_nonamenable_composition : + ∃ group : Group F, letI := group; + (∀ (h g : F) (x : UnitInterval), + (h * g).val.toHomeomorph x = h.val.toHomeomorph (g.val.toHomeomorph x)) ∧ + ¬ Nonempty (InvariantMean F) := by + refine ⟨inferInstance, ?_, thompson_F_not_amenable⟩ + intro h g x + exact F.mul_apply h g x + +end ThompsonNonamenability + +end + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/MeanApproximation.lean b/lean/OAI/GroupTheory/Thompson/MeanApproximation.lean new file mode 100644 index 0000000000000000000000000000000000000000..f6575d1212653507c6c0b970f4f7b44605d1edfd --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/MeanApproximation.lean @@ -0,0 +1,101 @@ +import OAI.GroupTheory.Thompson.InvariantMean +import OAI.GroupTheory.Thompson.ProbabilityDefects +import Mathlib.Analysis.LocallyConvex.Separation +import Mathlib.Analysis.LocallyConvex.WithSeminorms +import Mathlib.Analysis.Convex.Topology + +namespace OAI + +/-! +# Finite probabilities approximately invariant under a finite set + +The usual positive normalized invariant mean forces zero to lie in the +closure of the actual finite-probability defect set. The separation argument +uses bounded coordinate functions of a continuous linear functional on ℓ¹; +no identification of the full dual of ℓ¹ is assumed. +-/ + +noncomputable section + +open scoped ENNReal BigOperators + +universe uG + +namespace ThompsonNonamenability + +variable {G : Type uG} [Group G] [DecidableEq G] + +local instance : Fact (1 ≤ (1 : ℝ≥0∞)) := ⟨le_rfl⟩ + +/-- A separator gives one bounded real function for each translation. -/ +def separatorCoordinate {S : Finset G} (ell : DefectSpace S →L[ℝ] ℝ) + (h : {h : G // h ∈ S}) : BoundedReal G := + ⟨fun g => ell (lp.single 1 (h, g) 1), memℓp_infty ⟨‖ell‖, by + rintro y ⟨g, rfl⟩ + have hb := ell.le_opNorm (lp.single 1 (h, g) 1) + simpa only [lp.norm_single (by norm_num : 0 < (1 : ℝ≥0∞)), + norm_one, mul_one] using hb⟩⟩ + +omit [Group G] in +@[simp] +theorem separatorCoordinate_apply [Group G] {S : Finset G} + (ell : DefectSpace S →L[ℝ] ℝ) (h : {h : G // h ∈ S}) (g : G) : + separatorCoordinate ell h g = ell (lp.single 1 (h, g) 1) := rfl + +/-- The finite sum whose mean vanishes by left invariance. -/ +def separatorDefect {S : Finset G} (ell : DefectSpace S →L[ℝ] ℝ) : BoundedReal G := + ∑ h : {h : G // h ∈ S}, + (leftPull h.val (separatorCoordinate ell h) - separatorCoordinate ell h) + +theorem separatorDefect_apply {S : Finset G} (ell : DefectSpace S →L[ℝ] ℝ) + (g : G) : separatorDefect ell g = ell (diracDefect S g) := by + classical + cases Subsingleton.elim (inferInstance : DecidableEq G) (Classical.decEq G) + simp only [separatorDefect, lp.coeFn_sum, Finset.sum_apply, + lp.coeFn_sub, Pi.sub_apply, leftPull_apply, separatorCoordinate_apply, + diracDefect, map_sum, map_sub] + +theorem InvariantMean.separatorDefect_eq_zero (M : InvariantMean G) + {S : Finset G} (ell : DefectSpace S →L[ℝ] ℝ) : M (separatorDefect ell) = 0 := by + classical + change M.toLinearMap (∑ h : {h : G // h ∈ S}, + (leftPull h.val (separatorCoordinate ell h) - separatorCoordinate ell h)) = 0 + simp only [map_sum, map_sub, M.left_invariant, sub_self, Finset.sum_const_zero] + +/-- Separation contradicts the existence of a positive normalized invariant mean. -/ +theorem InvariantMean.zero_mem_closure_defectSet (M : InvariantMean G) + (S : Finset G) : (0 : DefectSpace S) ∈ closure (defectSet S) := by + classical + by_contra hout + obtain ⟨ell, c, hc, hsep⟩ := geometric_hahn_banach_point_closed + (convex_defectSet S).closure isClosed_closure hout + have hcpos : 0 < c := by simpa only [ell.map_zero] using hc + have hpoint (g : G) : c ≤ separatorDefect ell g := by + rw [separatorDefect_apply] + apply le_of_lt + apply hsep + apply subset_closure + exact diracDefect_mem_defectSet S g + have hmean : c ≤ M (separatorDefect ell) := by + simpa only [InvariantMean.map_const] using + M.mono (f := c • (1 : BoundedReal G)) (g := separatorDefect ell) + (fun g => by simpa only [BoundedReal.smul_one_apply] using hpoint g) + rw [M.separatorDefect_eq_zero] at hmean + exact (not_le_of_gt hcpos) hmean + +/-- Actual nonnegative finite probabilities with arbitrarily small total defect. -/ +theorem InvariantMean.exists_probability_small_defect (M : InvariantMean G) + (S : Finset G) {ε : ℝ} (hε : 0 < ε) : + ∃ p : G →₀ ℝ, IsProbabilityWeights p ∧ ‖defectMap S p‖ < ε := by + classical + obtain ⟨v, hv, hvsmall⟩ := Metric.mem_closure_iff.mp + (M.zero_mem_closure_defectSet S) ε hε + obtain ⟨p, hp, rfl⟩ := hv + refine ⟨p, hp, ?_⟩ + simpa only [dist_zero_left] using hvsmall + +end ThompsonNonamenability + +end + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/MeanToFolner.lean b/lean/OAI/GroupTheory/Thompson/MeanToFolner.lean new file mode 100644 index 0000000000000000000000000000000000000000..6ab989154a1c809883f9709afdc9b7d5a9ef3fee --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/MeanToFolner.lean @@ -0,0 +1,60 @@ +import OAI.GroupTheory.Thompson.MeanApproximation +import OAI.GroupTheory.Thompson.FiniteCoarea + +namespace OAI + +noncomputable section + +open scoped BigOperators symmDiff + +universe uG + +namespace ThompsonNonamenability + +variable {G : Type uG} [Group G] [DecidableEq G] + +/-- A standard invariant mean yields a finite set with small total boundary. -/ +theorem InvariantMean.exists_folner_total (M : InvariantMean G) + (S : Finset G) {ε : ℝ} (hε : 0 < ε) : + ∃ A : Finset G, A.Nonempty ∧ + (∑ h ∈ S, ((leftTranslate h A ∆ A).card : ℝ)) < ε * A.card := by + classical + cases Subsingleton.elim (inferInstance : DecidableEq G) (Classical.decEq G) + obtain ⟨p, hp, hsmall⟩ := M.exists_probability_small_defect S hε + have hmass : ∑ g ∈ p.support, p g = 1 := by + simpa only [mass_apply] using hp.2 + have hdef : (∑ h ∈ S, ∑ x ∈ p.support ∪ leftTranslate h p.support, + |p (h⁻¹ * x) - p x|) < ε := by + simpa only [norm_defectMap, leftTranslate] using hsmall + exact finite_folner_of_small_defect (p := fun g => p g) (K := p.support) + (S := S) hp.1 (fun g hg => Finsupp.notMem_support_iff.mp hg) hmass hdef + +/-- Finite Følner sets, with no countability or finite-generation assumption. -/ +theorem InvariantMean.exists_folner (M : InvariantMean G) + (S : Finset G) {ε : ℝ} (hε : 0 < ε) : + ∃ A : Finset G, A.Nonempty ∧ + ∀ h ∈ S, ((leftTranslate h A ∆ A).card : ℝ) < ε * A.card := by + obtain ⟨A, hA, htotal⟩ := M.exists_folner_total S hε + refine ⟨A, hA, ?_⟩ + intro h hh + have hone : ((leftTranslate h A ∆ A).card : ℝ) ≤ + ∑ g ∈ S, ((leftTranslate g A ∆ A).card : ℝ) := + Finset.single_le_sum (f := fun g => ((leftTranslate g A ∆ A).card : ℝ)) + (fun g _ => Nat.cast_nonneg _) hh + exact hone.trans_lt htotal + +/-- Uniform expansion of nonempty finite sets rules out a standard invariant mean. -/ +theorem not_amenable_of_uniform_boundary (S : Finset G) {b : ℝ} (hb : 0 < b) + (hexpand : ∀ A : Finset G, A.Nonempty → + ∃ h ∈ S, b * A.card ≤ ((leftTranslate h A ∆ A).card : ℝ)) : + ¬ Nonempty (InvariantMean G) := by + rintro ⟨M⟩ + obtain ⟨A, hA, hsmall⟩ := M.exists_folner S hb + obtain ⟨h, hh, hlarge⟩ := hexpand A hA + exact not_le_of_gt (hsmall h hh) hlarge + +end ThompsonNonamenability + +end + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/Model.lean b/lean/OAI/GroupTheory/Thompson/Model.lean new file mode 100644 index 0000000000000000000000000000000000000000..9c5859c8fad7e8462e842e93967577c74c591831 --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/Model.lean @@ -0,0 +1,82 @@ +import Mathlib.Topology.Homeomorph.Lemmas +import Mathlib.Topology.Instances.Real.Lemmas +import Mathlib.Analysis.Normed.Lp.lpSpace +import Mathlib.Analysis.Normed.Operator.Basic + +namespace OAI + +noncomputable section + +open scoped ENNReal + +universe uG + +namespace ThompsonNonamenability + +abbrev UnitInterval := Set.Icc (0 : ℝ) 1 + +def unitIntervalZero : UnitInterval := ⟨0, le_rfl, zero_le_one⟩ +def unitIntervalOne : UnitInterval := ⟨1, zero_le_one, le_rfl⟩ + +structure IntervalHomeomorph where + toHomeomorph : UnitInterval ≃ₜ UnitInterval + +namespace IntervalHomeomorph + +instance : CoeFun IntervalHomeomorph (fun _ => UnitInterval → UnitInterval) := + ⟨fun f => f.toHomeomorph⟩ + +end IntervalHomeomorph + +def IsDyadic (x : ℝ) : Prop := + ∃ (k : ℤ) (n : ℕ), x = (k : ℝ) / (2 : ℝ) ^ n + +structure DyadicPLWitness (f : IntervalHomeomorph) where + pieceCount : ℕ + positive : 0 < pieceCount + knots : Fin (pieceCount + 1) → UnitInterval + strictMono_knots : StrictMono knots + first : knots 0 = unitIntervalZero + last : knots (Fin.last pieceCount) = unitIntervalOne + dyadic : ∀ i, IsDyadic (knots i : ℝ) + cover : ∀ x : UnitInterval, ∃ i : Fin pieceCount, + knots i.castSucc ≤ x ∧ x ≤ knots i.succ + exponent : Fin pieceCount → ℤ + affine : ∀ (i : Fin pieceCount) (x : UnitInterval), + knots i.castSucc ≤ x → x ≤ knots i.succ → + (f x : ℝ) = (f (knots i.castSucc) : ℝ) + + (2 : ℝ) ^ exponent i * ((x : ℝ) - (knots i.castSucc : ℝ)) + +def HasDyadicPLPieces (f : IntervalHomeomorph) : Prop := Nonempty (DyadicPLWitness f) + +def F := {f : IntervalHomeomorph // StrictMono f ∧ HasDyadicPLPieces f} + +abbrev BoundedReal (G : Type uG) := lp (fun _ : G => ℝ) ∞ + +variable {G : Type uG} [Group G] + +def leftPull (h : G) : BoundedReal G →ₗ[ℝ] BoundedReal G where + toFun f := ⟨fun g => f (h * g), memℓp_infty ⟨‖f‖, by + rintro y ⟨g, rfl⟩ + exact lp.norm_apply_le_norm ENNReal.top_ne_zero f (h * g)⟩⟩ + map_add' f g := by + apply lp.ext + funext x + rfl + map_smul' r f := by + apply lp.ext + funext x + rfl + +structure InvariantMean (G : Type uG) [Group G] where + toLinearMap : BoundedReal G →ₗ[ℝ] ℝ + positive : ∀ f : BoundedReal G, (∀ g, 0 ≤ f g) → 0 ≤ toLinearMap f + normalized : toLinearMap 1 = 1 + left_invariant : ∀ (h : G) (f : BoundedReal G), + toLinearMap (leftPull h f) = toLinearMap f + +end ThompsonNonamenability + +end + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/OrderedChainKnots.lean b/lean/OAI/GroupTheory/Thompson/OrderedChainKnots.lean new file mode 100644 index 0000000000000000000000000000000000000000..300fd72f6ff7d4fdf1e8edcf9c0a169c87174835 --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/OrderedChainKnots.lean @@ -0,0 +1,150 @@ +import OAI.GroupTheory.Thompson.DyadicGapChain +import OAI.GroupTheory.Thompson.DyadicArithmetic +import OAI.GroupTheory.Thompson.SortedSubdivision +import Mathlib.Order.Fin.Basic + +namespace OAI + +/-! +# Indexed knots of an ordered dyadic chain + +An actual consecutive list of dyadic cells covering `[0,1]` gives a strictly +increasing subdivision indexed by that same list. The two endpoints of its +`i`th piece are exactly the endpoints of the `i`th listed cell. +-/ + +noncomputable section + +namespace ThompsonNonamenability + +namespace GapChain + +/-- The initial endpoint followed by the right endpoints of the cells. -/ +def realKnots : (a : ℝ) → (L : List BasicInterval) → Fin (L.length + 1) → ℝ + | a, [], _ => a + | a, I :: L, i => Fin.cases a (realKnots I.right L) i + +@[simp] theorem realKnots_zero (a : ℝ) (L : List BasicInterval) : + realKnots a L 0 = a := by + cases L <;> rfl + +/-- The right knot of each indexed piece is its actual right endpoint. -/ +theorem realKnots_succ (a : ℝ) (L : List BasicInterval) (i : Fin L.length) : + realKnots a L i.succ = (L.get i).right := by + induction L generalizing a with + | nil => exact Fin.elim0 i + | cons I L ih => + refine Fin.cases ?_ (fun j => ?_) i + · change realKnots I.right L 0 = I.right + exact realKnots_zero I.right L + · change realKnots I.right L j.succ = (L.get j).right + exact ih I.right j + +/-- The chain equalities identify each left knot with its listed cell. -/ +theorem realKnots_castSucc {a b : ℝ} {L : List BasicInterval} + (h : GapChain a b L) (i : Fin L.length) : + realKnots a L i.castSucc = (L.get i).left := by + induction L generalizing a with + | nil => exact Fin.elim0 i + | cons I L ih => + refine Fin.cases ?_ (fun j => ?_) i + · change a = I.left + exact h.1.symm + · change realKnots I.right L j.castSucc = (L.get j).left + exact ih h.2 j + +theorem realKnots_last {a b : ℝ} {L : List BasicInterval} + (h : GapChain a b L) : realKnots a L (Fin.last L.length) = b := by + induction L generalizing a with + | nil => exact h + | cons I L ih => + change realKnots I.right L (Fin.last L.length) = b + exact ih h.2 + +theorem strictMono_realKnots {a b : ℝ} {L : List BasicInterval} + (h : GapChain a b L) : StrictMono (realKnots a L) := by + apply Fin.strictMono_iff_lt_succ.mpr + intro i + rw [realKnots_castSucc h i, realKnots_succ] + exact (L.get i).left_lt_right + +theorem length_pos {L : List BasicInterval} (h : GapChain 0 1 L) : + 0 < L.length := by + cases L with + | nil => exact False.elim (zero_ne_one h) + | cons I L => exact Nat.zero_lt_succ _ + +theorem realKnots_mem_unit {L : List BasicInterval} (h : GapChain 0 1 L) + (i : Fin (L.length + 1)) : realKnots 0 L i ∈ Set.Icc (0 : ℝ) 1 := by + constructor + · have hi := h.strictMono_realKnots.monotone (Fin.zero_le i) + simpa only [realKnots_zero] using hi + · have hi := h.strictMono_realKnots.monotone (Fin.le_last i) + simpa only [realKnots_last h] using hi + +theorem isDyadic_realKnots (L : List BasicInterval) (i : Fin (L.length + 1)) : + IsDyadic (realKnots 0 L i) := by + refine Fin.cases ?_ (fun j => ?_) i + · simpa only [realKnots_zero] using isDyadic_zero + · rw [realKnots_succ] + refine ⟨((L.get j).index.val : ℤ) + 1, (L.get j).depth, ?_⟩ + simp only [BasicInterval.right, Int.cast_add, Int.cast_natCast, Int.cast_one] + +end GapChain + +/-- A subdivision whose indexing agrees with an actual ordered cell list. -/ +structure ChainSubdivision (L : List BasicInterval) where + positive : 0 < L.length + knots : Fin (L.length + 1) → UnitInterval + strictMono_knots : StrictMono knots + first : knots 0 = unitIntervalZero + last : knots (Fin.last L.length) = unitIntervalOne + dyadic : ∀ i, IsDyadic (knots i : ℝ) + cover : ∀ x : UnitInterval, ∃ i : Fin L.length, + knots i.castSucc ≤ x ∧ x ≤ knots i.succ + left_eq : ∀ i : Fin L.length, (knots i.castSucc : ℝ) = (L.get i).left + right_eq : ∀ i : Fin L.length, (knots i.succ : ℝ) = (L.get i).right + +namespace GapChain + +/-- Construct all subdivision data from the chain equalities. -/ +def toSubdivision {L : List BasicInterval} (h : GapChain 0 1 L) : + ChainSubdivision L := by + let knots : Fin (L.length + 1) → UnitInterval := + fun i => ⟨realKnots 0 L i, h.realKnots_mem_unit i⟩ + have hfirst : knots 0 = unitIntervalZero := by + apply Subtype.ext + exact realKnots_zero 0 L + have hlast : knots (Fin.last L.length) = unitIntervalOne := by + apply Subtype.ext + exact realKnots_last h + exact + { positive := h.length_pos + knots := knots + strictMono_knots := fun _ _ hij => h.strictMono_realKnots hij + first := hfirst + last := hlast + dyadic := isDyadic_realKnots L + cover := SortedSubdivision.cover_of_endpoints h.length_pos knots hfirst hlast + left_eq := realKnots_castSucc h + right_eq := realKnots_succ 0 L } + +end GapChain + +namespace ChainSubdivision + +/-- Membership in an indexed cell is exactly membership between its knots. -/ +theorem mem_carrier_iff {L : List BasicInterval} (s : ChainSubdivision L) + (i : Fin L.length) (x : UnitInterval) : + (x : ℝ) ∈ (L.get i).carrier ↔ s.knots i.castSucc ≤ x ∧ x ≤ s.knots i.succ := by + change (L.get i).left ≤ (x : ℝ) ∧ (x : ℝ) ≤ (L.get i).right ↔ _ + rw [← s.left_eq i, ← s.right_eq i] + rfl + +end ChainSubdivision + +end ThompsonNonamenability + +end + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/OrderedPLInterpolation.lean b/lean/OAI/GroupTheory/Thompson/OrderedPLInterpolation.lean new file mode 100644 index 0000000000000000000000000000000000000000..5f0096da4e9ad42b9c7bb4b71ef458e3b5692957 --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/OrderedPLInterpolation.lean @@ -0,0 +1,262 @@ +import OAI.GroupTheory.Thompson.AffinePiece +import OAI.GroupTheory.Thompson.DyadicGapChain +import OAI.GroupTheory.Thompson.OrderedChainKnots +import Mathlib.Data.List.Forall2 +import Mathlib.Topology.Order.MonotoneContinuity + +namespace OAI + +/-! +# Actual interpolation of ordered dyadic partitions + +Matched cells determine affine maps. They are glued at their common endpoints, +and the reverse matching is their inverse. Restricting the resulting real +order isomorphism gives the literal interval homeomorphism. +-/ + +noncomputable section + +namespace ThompsonNonamenability + +namespace OrderedPLInterpolation + +def chainMap (b d : ℝ) : List BasicInterval → List BasicInterval → ℝ → ℝ + | [], _, x => x + (d - b) + | _ :: _, [], x => x + (d - b) + | I :: L, J :: R, x => + if x ≤ I.right then affine I J x else chainMap b d L R x + +theorem chainMap_start {a b c d : ℝ} {L R : List BasicInterval} + (hL : GapChain a b L) (hR : GapChain c d R) (hlen : L.length = R.length) : + chainMap b d L R a = c := by + cases L with + | nil => + have hnil : R = [] := List.length_eq_zero_iff.mp hlen.symm + subst R + change a = b at hL + change c = d at hR + simp only [chainMap, hL, hR] + ring + | cons I L => + cases R with + | nil => simp at hlen + | cons J R => + change I.left = a ∧ GapChain I.right b L at hL + change J.left = c ∧ GapChain J.right d R at hR + rw [← hL.1] + simp only [chainMap, ite_eq_left I.left_lt_right.le, affine_left, hR.1] + +theorem chainMap_eq_tail {b d x : ℝ} {I J : BasicInterval} + {L R : List BasicInterval} (hL : GapChain I.right b L) + (hR : GapChain J.right d R) (hlen : L.length = R.length) + (hx : I.right ≤ x) : + chainMap b d (I :: L) (J :: R) x = chainMap b d L R x := by + by_cases h : x ≤ I.right + · have heq : x = I.right := le_antisymm h hx + subst x + rw [chainMap, ite_eq_left le_rfl, affine_right, chainMap_start hL hR hlen] + · rw [chainMap, ite_eq_right h] + +theorem chainMap_end {a b c d : ℝ} {L R : List BasicInterval} + (hL : GapChain a b L) (hR : GapChain c d R) (hlen : L.length = R.length) : + chainMap b d L R b = d := by + induction L generalizing a c R with + | nil => + simp only [chainMap] + ring + | cons I L ih => + cases R with + | nil => simp at hlen + | cons J R => + have ht : L.length = R.length := Nat.succ.inj hlen + rw [chainMap_eq_tail hL.2 hR.2 ht hL.2.le_endpoints] + exact ih hL.2 hR.2 ht + +theorem chainMap_strictMono {a b c d : ℝ} {L R : List BasicInterval} + (hL : GapChain a b L) (hR : GapChain c d R) (hlen : L.length = R.length) : + StrictMono (chainMap b d L R) := by + induction L generalizing a c R with + | nil => + intro x y hxy + exact add_lt_add_left hxy _ + | cons I L ih => + cases R with + | nil => simp at hlen + | cons J R => + have ht : L.length = R.length := Nat.succ.inj hlen + have hm := ih hL.2 hR.2 ht + have hb := chainMap_start hL.2 hR.2 ht + intro x y hxy + change (if x ≤ I.right then affine I J x else chainMap b d L R x) < + (if y ≤ I.right then affine I J y else chainMap b d L R y) + by_cases hx : x ≤ I.right + · rw [ite_eq_left hx] + by_cases hy : y ≤ I.right + · rw [ite_eq_left hy] + exact affine_strictMono I J hxy + · rw [ite_eq_right hy] + calc + affine I J x ≤ affine I J I.right := + (affine_strictMono I J).monotone hx + _ = J.right := affine_right I J + _ = chainMap b d L R I.right := hb.symm + _ < chainMap b d L R y := hm (lt_of_not_ge hy) + · have hy : ¬ y ≤ I.right := fun hy => hx (hxy.le.trans hy) + rw [ite_eq_right hx, ite_eq_right hy] + exact hm hxy + +theorem chainMap_inverse {a b c d : ℝ} {L R : List BasicInterval} + (hL : GapChain a b L) (hR : GapChain c d R) (hlen : L.length = R.length) + (x : ℝ) : chainMap d b R L (chainMap b d L R x) = x := by + induction L generalizing a c R with + | nil => + have hnil : R = [] := List.length_eq_zero_iff.mp hlen.symm + subst R + simp only [chainMap] + ring + | cons I L ih => + cases R with + | nil => simp at hlen + | cons J R => + have ht : L.length = R.length := Nat.succ.inj hlen + by_cases hx : x ≤ I.right + · have hy : affine I J x ≤ J.right := by + rw [← affine_right I J] + exact (affine_strictMono I J).monotone hx + simp only [chainMap, ite_eq_left hx, ite_eq_left hy] + exact affine_inverse I J x + · have hy : ¬ chainMap b d L R x ≤ J.right := by + have hm := chainMap_strictMono hL.2 hR.2 ht (lt_of_not_ge hx) + rw [chainMap_start hL.2 hR.2 ht] at hm + exact not_le_of_gt hm + simp only [chainMap, ite_eq_right hx, ite_eq_right hy] + exact ih hL.2 hR.2 ht + +theorem chainMap_on_cells_aux {a b c d : ℝ} {L R : List BasicInterval} + (hL : GapChain a b L) (hR : GapChain c d R) (hlen : L.length = R.length) : + List.Forall₂ (fun I J => I ∈ L ∧ ∀ x ∈ I.carrier, + chainMap b d L R x = affine I J x) L R := by + induction L generalizing a c R with + | nil => + have hnil : R = [] := List.length_eq_zero_iff.mp hlen.symm + subst R + exact List.Forall₂.nil + | cons I L ih => + cases R with + | nil => simp at hlen + | cons J R => + have ht : L.length = R.length := Nat.succ.inj hlen + apply List.Forall₂.cons + · refine ⟨List.mem_cons_self, ?_⟩ + intro x hx + exact ite_eq_left hx.2 + · apply (ih hL.2 hR.2 ht).imp + intro K Q hK + refine ⟨List.mem_cons_of_mem I hK.1, ?_⟩ + intro x hx + rw [chainMap_eq_tail hL.2 hR.2 ht + ((hL.2.left_le_of_mem hK.1).trans hx.1)] + exact hK.2 x hx + +theorem chainMap_on_cells {a b c d : ℝ} {L R : List BasicInterval} + (hL : GapChain a b L) (hR : GapChain c d R) (hlen : L.length = R.length) : + List.Forall₂ (fun I J => ∀ x ∈ I.carrier, + chainMap b d L R x = affine I J x) L R := + (chainMap_on_cells_aux hL hR hlen).imp (fun _ _ h => h.2) + +def chainOrderIso {L R : List BasicInterval} + (hL : GapChain 0 1 L) (hR : GapChain 0 1 R) (hlen : L.length = R.length) : + ℝ ≃o ℝ where + toFun := chainMap 1 1 L R + invFun := chainMap 1 1 R L + left_inv := chainMap_inverse hL hR hlen + right_inv := chainMap_inverse hR hL hlen.symm + map_rel_iff' := (chainMap_strictMono hL hR hlen).le_iff_le + +def intervalOrderIso {L R : List BasicInterval} + (hL : GapChain 0 1 L) (hR : GapChain 0 1 R) (hlen : L.length = R.length) : + UnitInterval ≃o UnitInterval where + toFun x := ⟨chainMap 1 1 L R x, by + have hm := (chainMap_strictMono hL hR hlen).monotone + constructor + · simpa only [chainMap_start hL hR hlen] using hm x.property.1 + · simpa only [chainMap_end hL hR hlen] using hm x.property.2⟩ + invFun x := ⟨chainMap 1 1 R L x, by + have hm := (chainMap_strictMono hR hL hlen.symm).monotone + constructor + · simpa only [chainMap_start hR hL hlen.symm] using hm x.property.1 + · simpa only [chainMap_end hR hL hlen.symm] using hm x.property.2⟩ + left_inv x := Subtype.ext (chainMap_inverse hL hR hlen x) + right_inv x := Subtype.ext (chainMap_inverse hR hL hlen.symm x) + map_rel_iff' := (chainMap_strictMono hL hR hlen).le_iff_le + +def intervalHomeomorph {L R : List BasicInterval} + (hL : GapChain 0 1 L) (hR : GapChain 0 1 R) (hlen : L.length = R.length) : + IntervalHomeomorph := ⟨(intervalOrderIso hL hR hlen).toHomeomorph⟩ + +theorem intervalHomeomorph_strictMono {L R : List BasicInterval} + (hL : GapChain 0 1 L) (hR : GapChain 0 1 R) (hlen : L.length = R.length) : + StrictMono (intervalHomeomorph hL hR hlen) := + (intervalOrderIso hL hR hlen).strictMono + +def interpolationWitness {L R : List BasicInterval} + (hL : GapChain 0 1 L) (hR : GapChain 0 1 R) (hlen : L.length = R.length) : + DyadicPLWitness (intervalHomeomorph hL hR hlen) where + pieceCount := L.length + positive := hL.toSubdivision.positive + knots := hL.toSubdivision.knots + strictMono_knots := hL.toSubdivision.strictMono_knots + first := hL.toSubdivision.first + last := hL.toSubdivision.last + dyadic := hL.toSubdivision.dyadic + cover := hL.toSubdivision.cover + exponent i := ((L.get i).depth : ℤ) - ((R.get (Fin.cast hlen i)).depth : ℤ) + affine := by + intro i x hxleft hxright + let s := hL.toSubdivision + have hp : ∀ y ∈ (L.get i).carrier, chainMap 1 1 L R y = + affine (L.get i) (R.get (Fin.cast hlen i)) y := + (chainMap_on_cells hL hR hlen).get i.isLt (by simpa only [← hlen] using i.isLt) + have hx : (x : ℝ) ∈ (L.get i).carrier := by + constructor + · rw [← s.left_eq i] + exact hxleft + · rw [← s.right_eq i] + exact hxright + have hk : (s.knots i.castSucc : ℝ) ∈ (L.get i).carrier := by + rw [s.left_eq i] + exact ⟨le_rfl, (L.get i).left_lt_right.le⟩ + change chainMap 1 1 L R (x : ℝ) = + chainMap 1 1 L R (s.knots i.castSucc : ℝ) + + (2 : ℝ) ^ (((L.get i).depth : ℤ) - ((R.get (Fin.cast hlen i)).depth : ℤ)) * + ((x : ℝ) - (s.knots i.castSucc : ℝ)) + rw [hp _ hx, hp _ hk, s.left_eq i, affine_left] + simp only [affine, affine_slope_zpow] + +def transport {L R : List BasicInterval} + (hL : GapChain 0 1 L) (hR : GapChain 0 1 R) (hlen : L.length = R.length) : F := + ⟨intervalHomeomorph hL hR hlen, intervalHomeomorph_strictMono hL hR hlen, + ⟨interpolationWitness hL hR hlen⟩⟩ + +theorem transport_on_cells {L R : List BasicInterval} + (hL : GapChain 0 1 L) (hR : GapChain 0 1 R) (hlen : L.length = R.length) : + List.Forall₂ (CarriesAffinely (transport hL hR hlen)) L R := by + apply (chainMap_on_cells hL hR hlen).imp + intro I J h x + change chainMap 1 1 L R (I.chart (x : ℝ)) = J.chart (x : ℝ) + simpa only [BasicInterval.coe_chartPoint, affine_chart] using + h _ (I.chartPoint_mem_carrier x) + +end OrderedPLInterpolation + +theorem exists_chain_transport {L R : List BasicInterval} + (hL : GapChain 0 1 L) (hR : GapChain 0 1 R) (hlen : L.length = R.length) : + ∃ h : F, List.Forall₂ (CarriesAffinely h) L R := + ⟨OrderedPLInterpolation.transport hL hR hlen, + OrderedPLInterpolation.transport_on_cells hL hR hlen⟩ + +end ThompsonNonamenability + +end + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/PLRefinement.lean b/lean/OAI/GroupTheory/Thompson/PLRefinement.lean new file mode 100644 index 0000000000000000000000000000000000000000..98085653d7ffe271652e8748f3547318a187a109 --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/PLRefinement.lean @@ -0,0 +1,114 @@ +import OAI.GroupTheory.Thompson.StandardPL +import OAI.GroupTheory.Thompson.SortedSubdivision + +namespace OAI + +/-! +# Composition by a finite common subdivision + +For `h ∘ g`, take every knot of `g` and the inverse image under `g` of every +knot of `h`. Consecutive points of their sorted union lie in one piece of +`g` and map into one piece of `h`. The two genuine affine equalities then +compose, adding their integer slope exponents. +-/ + +namespace ThompsonNonamenability +namespace DyadicPLWitness + +/-- Composition of actual finite dyadic PL witnesses, using the sorted union +of the inner breakpoints and pulled-back outer breakpoints. -/ +noncomputable def mul {h g : IntervalHomeomorph} + (wh : DyadicPLWitness h) (wg : DyadicPLWitness g) + (_hhmono : StrictMono h) (hgmono : StrictMono g) : DyadicPLWitness (h * g) := by + classical + let s : Finset UnitInterval := Finset.univ.image wg.knots ∪ + Finset.univ.image (fun j => g⁻¹ (wh.knots j)) + have hgmem (j : Fin (wg.pieceCount + 1)) : wg.knots j ∈ s := by + exact Finset.mem_union_left _ (Finset.mem_image.mpr ⟨j, Finset.mem_univ j, rfl⟩) + have hhmem (j : Fin (wh.pieceCount + 1)) : g⁻¹ (wh.knots j) ∈ s := by + exact Finset.mem_union_right _ (Finset.mem_image.mpr ⟨j, Finset.mem_univ j, rfl⟩) + have hs0 : unitIntervalZero ∈ s := by simpa only [wg.first] using hgmem 0 + have hs1 : unitIntervalOne ∈ s := by + simpa only [wg.last] using hgmem (Fin.last wg.pieceCount) + let r := SortedSubdivision.ofFinset s hs0 hs1 + have hgPieces (i : Fin r.pieceCount) : ∃ j : Fin wg.pieceCount, + wg.knots j.castSucc ≤ r.knots i.castSucc ∧ + r.knots i.succ ≤ wg.knots j.succ := + r.adjacent_contained wg.knots wg.strictMono_knots wg.cover hgmem i + have hhcover (x : UnitInterval) : ∃ j : Fin wh.pieceCount, + g⁻¹ (wh.knots j.castSucc) ≤ x ∧ x ≤ g⁻¹ (wh.knots j.succ) := by + obtain ⟨j, hj0, hj1⟩ := wh.cover (g x) + refine ⟨j, ?_, ?_⟩ + · simpa only [IntervalHomeomorph.inv_apply_apply] using + (IntervalHomeomorph.strictMono_inv hgmono).monotone hj0 + · simpa only [IntervalHomeomorph.inv_apply_apply] using + (IntervalHomeomorph.strictMono_inv hgmono).monotone hj1 + have hhPieces (i : Fin r.pieceCount) : ∃ j : Fin wh.pieceCount, + g⁻¹ (wh.knots j.castSucc) ≤ r.knots i.castSucc ∧ + r.knots i.succ ≤ g⁻¹ (wh.knots j.succ) := + r.adjacent_contained (fun j => g⁻¹ (wh.knots j)) + ((IntervalHomeomorph.strictMono_inv hgmono).comp wh.strictMono_knots) + hhcover hhmem i + let gi (i : Fin r.pieceCount) := Classical.choose (hgPieces i) + let hi (i : Fin r.pieceCount) := Classical.choose (hhPieces i) + have hgi (i : Fin r.pieceCount) : + wg.knots (gi i).castSucc ≤ r.knots i.castSucc ∧ + r.knots i.succ ≤ wg.knots (gi i).succ := Classical.choose_spec (hgPieces i) + have hhi (i : Fin r.pieceCount) : + g⁻¹ (wh.knots (hi i).castSucc) ≤ r.knots i.castSucc ∧ + r.knots i.succ ≤ g⁻¹ (wh.knots (hi i).succ) := + Classical.choose_spec (hhPieces i) + refine { + pieceCount := r.pieceCount + positive := r.positive + knots := r.knots + strictMono_knots := r.strictMono_knots + first := r.first + last := r.last + dyadic := ?_ + cover := r.cover + exponent := fun i => wh.exponent (hi i) + wg.exponent (gi i) + affine := ?_ } + · intro i + have hmem := r.knots_mem i + rcases Finset.mem_union.mp hmem with hmem | hmem + · obtain ⟨j, _, hj⟩ := Finset.mem_image.mp hmem + rw [← hj] + exact wg.dyadic j + · obtain ⟨j, _, hj⟩ := Finset.mem_image.mp hmem + rw [← hj] + exact (wg.inverse hgmono).map_dyadic + (IntervalHomeomorph.strictMono_inv hgmono) (wh.dyadic j) + · intro i x hx0 hx1 + have hab : r.knots i.castSucc ≤ r.knots i.succ := + (r.strictMono_knots (Fin.castSucc_lt_succ_iff.mpr le_rfl)).le + have hga0 : wh.knots (hi i).castSucc ≤ g (r.knots i.castSucc) := by + simpa only [IntervalHomeomorph.apply_inv_apply] using + hgmono.monotone (hhi i).1 + have hgb1 : g (r.knots i.succ) ≤ wh.knots (hi i).succ := by + simpa only [IntervalHomeomorph.apply_inv_apply] using + hgmono.monotone (hhi i).2 + have hgx := wg.affine (gi i) x ((hgi i).1.trans hx0) (hx1.trans (hgi i).2) + have hga := wg.affine (gi i) (r.knots i.castSucc) + (hgi i).1 (hab.trans (hgi i).2) + have hhgx := wh.affine (hi i) (g x) + (hga0.trans (hgmono.monotone hx0)) ((hgmono.monotone hx1).trans hgb1) + have hhga := wh.affine (hi i) (g (r.knots i.castSucc)) + hga0 ((hgmono.monotone hab).trans hgb1) + simp only [IntervalHomeomorph.mul_apply] + rw [zpow_add₀ (by norm_num : (2 : ℝ) ≠ 0)] + rw [hhgx, hhga, hgx, hga] + ring + +end DyadicPLWitness + +theorem HasDyadicPLPieces.mul {h g : IntervalHomeomorph} + (hh : HasDyadicPLPieces h) (hg : HasDyadicPLPieces g) + (hhmono : StrictMono h) (hgmono : StrictMono g) : HasDyadicPLPieces (h * g) := by + obtain ⟨wh⟩ := hh + obtain ⟨wg⟩ := hg + exact ⟨wh.mul wg hhmono hgmono⟩ + +end ThompsonNonamenability + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/PartitionColorFamily.lean b/lean/OAI/GroupTheory/Thompson/PartitionColorFamily.lean new file mode 100644 index 0000000000000000000000000000000000000000..54aa9a7cab9048402371a6eda3bbfbb09513a993 --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/PartitionColorFamily.lean @@ -0,0 +1,89 @@ +import OAI.GroupTheory.Thompson.RecursiveColoring +import OAI.GroupTheory.Thompson.IntervalFamily + +namespace OAI + +/-! +# The actual finite family of colors, including zero outside admissibility + +A basic partition is admissible when it respects every chosen parent and +child. Its family color is always defined and lies in the unit ball. The +option extension also assigns zero to a non-basic image; the group-level +construction will supply the actual partial image partition. +-/ + +noncomputable section + +universe uE + +namespace ThompsonNonamenability + +variable {E : Type uE} [NormedAddCommGroup E] [InnerProductSpace ℝ E] +variable {D : ℕ} + +/-- One simultaneous condition for all actual parent and child intervals. -/ +def PartitionAdmissible (D : ℕ) (T : BasicPartition) : Prop := + ∀ q : IntervalIndex D, T.Respects (familyInterval D q) + +/-- The family color is zero whenever the actual partition is inadmissible. -/ +def partitionFamilyColor (hD : 0 < D) (f : UnitBall E → UnitBall E) + (T : BasicPartition) (q : IntervalIndex D) : UnitBall E := by + classical + exact if h : PartitionAdmissible D T then + partitionColor (selectedInterval D) (selectedInterval_internal D) hD f + (T.restrict (familyInterval D q) (h q)) + else unitBallZero E + +theorem partitionFamilyColor_of_admissible (hD : 0 < D) + (f : UnitBall E → UnitBall E) (T : BasicPartition) + (h : PartitionAdmissible D T) (q : IntervalIndex D) : + partitionFamilyColor hD f T q = + partitionColor (selectedInterval D) (selectedInterval_internal D) hD f + (T.restrict (familyInterval D q) (h q)) := by + simp only [partitionFamilyColor, dite_eq_left h] + +theorem partitionFamilyColor_of_not_admissible (hD : 0 < D) + (f : UnitBall E → UnitBall E) (T : BasicPartition) + (h : ¬PartitionAdmissible D T) (q : IntervalIndex D) : + partitionFamilyColor hD f T q = unitBallZero E := by + simp only [partitionFamilyColor, dite_eq_right h] + +theorem partitionFamilyColor_norm_le (hD : 0 < D) + (f : UnitBall E → UnitBall E) (T : BasicPartition) (q : IntervalIndex D) : + ‖(partitionFamilyColor hD f T q : E)‖ ≤ 1 := + (partitionFamilyColor hD f T q).property + +/-- A parent's color is the map applied to its actual child-color mean. -/ +theorem partitionFamilyColor_parent (hD : 0 < D) + (f : UnitBall E → UnitBall E) (T : BasicPartition) + (h : PartitionAdmissible D T) (i : Fin D) : + partitionFamilyColor hD f T (.inl i) = + f (ballMean hD (fun j => partitionFamilyColor hD f T (.inr (i, j)))) := by + simp only [partitionFamilyColor_of_admissible hD f T h, familyInterval] + exact partitionColor_restrict (selectedInterval D) (selectedInterval_internal D) + hD f T i (h (.inl i)) (fun j => h (.inr (i, j))) + +/-- Total zero extension at a non-basic image as well as an inadmissible one. -/ +def optionFamilyColor (hD : 0 < D) (f : UnitBall E → UnitBall E) : + Option BasicPartition → IntervalIndex D → UnitBall E + | none, _ => unitBallZero E + | some T, q => partitionFamilyColor hD f T q + +@[simp] theorem optionFamilyColor_none (hD : 0 < D) + (f : UnitBall E → UnitBall E) (q : IntervalIndex D) : + optionFamilyColor hD f none q = unitBallZero E := rfl + +@[simp] theorem optionFamilyColor_some (hD : 0 < D) + (f : UnitBall E → UnitBall E) (T : BasicPartition) (q : IntervalIndex D) : + optionFamilyColor hD f (some T) q = partitionFamilyColor hD f T q := rfl + +theorem optionFamilyColor_norm_le (hD : 0 < D) + (f : UnitBall E → UnitBall E) (T : Option BasicPartition) (q : IntervalIndex D) : + ‖(optionFamilyColor hD f T q : E)‖ ≤ 1 := + (optionFamilyColor hD f T q).property + +end ThompsonNonamenability + +end + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/ProbabilityDefects.lean b/lean/OAI/GroupTheory/Thompson/ProbabilityDefects.lean new file mode 100644 index 0000000000000000000000000000000000000000..99633ab5dceebea911554c89f757fefba8d17dc6 --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/ProbabilityDefects.lean @@ -0,0 +1,176 @@ +import Mathlib.Analysis.Convex.Basic +import Mathlib.Analysis.Normed.Lp.lpSpace +import Mathlib.LinearAlgebra.Finsupp.LinearCombination +import Mathlib.Topology.Algebra.InfiniteSum.Constructions +import Mathlib.Tactic.Ring + +namespace OAI + +/-! +# Finite probabilities and their simultaneous translation defects + +One ℓ¹ space on `S × G` carries the sum of all translation defects. In +particular its norm is the exact finite sum, without a factor depending on +`S.card`. This is the finite-probability input to the separation argument. +-/ + +noncomputable section + +open scoped BigOperators Classical + +universe uG uι + +namespace ThompsonNonamenability + +variable {G : Type uG} + +/-- The total mass of a finitely supported real function. -/ +def mass : (G →₀ ℝ) →ₗ[ℝ] ℝ := + Finsupp.linearCombination ℝ (fun _ : G => (1 : ℝ)) + +@[simp] +theorem mass_apply (p : G →₀ ℝ) : mass p = ∑ g ∈ p.support, p g := by + simp [mass, Finsupp.linearCombination_apply, Finsupp.sum] + +@[simp] +theorem mass_single (g : G) (a : ℝ) : mass (Finsupp.single g a) = a := by + simp [mass] + +/-- Nonnegative finite weights with total mass one. -/ +def IsProbabilityWeights (p : G →₀ ℝ) : Prop := + (∀ g, 0 ≤ p g) ∧ mass p = 1 + +theorem isProbabilityWeights_single (g : G) : + IsProbabilityWeights (Finsupp.single g (1 : ℝ)) := by + refine ⟨?_, mass_single g 1⟩ + intro x + simp only [Finsupp.single_apply] + split_ifs + · exact zero_le_one + · exact le_rfl + +theorem convex_probabilityWeights : + Convex ℝ {p : G →₀ ℝ | IsProbabilityWeights p} := by + intro p hp q hq a b ha hb hab + refine ⟨?_, ?_⟩ + · intro g + change 0 ≤ a * p g + b * q g + exact add_nonneg (mul_nonneg ha (hp.1 g)) (mul_nonneg hb (hq.1 g)) + · rw [map_add, map_smul, map_smul, hp.2, hq.2] + simpa using hab + +/-- The simultaneous defects use the ℓ¹ norm on the product index set. -/ +abbrev DefectSpace (S : Finset G) := lp (fun _ : ({h // h ∈ S} × G) => ℝ) 1 + +variable [Group G] + +/-- Translation defect of the point probability at `g`. -/ +def diracDefect (S : Finset G) (g : G) : DefectSpace S := + ∑ h : S, (lp.single 1 (h, h.val * g) (1 : ℝ) - lp.single 1 (h, g) (1 : ℝ)) + +/-- The linear extension of the point-probability defects. -/ +def defectMap (S : Finset G) : (G →₀ ℝ) →ₗ[ℝ] DefectSpace S := + Finsupp.linearCombination ℝ (diracDefect S) + +@[simp] +theorem defectMap_single (S : Finset G) (g : G) (a : ℝ) : + defectMap S (Finsupp.single g a) = a • diracDefect S g := by + simp [defectMap] + +private theorem single_apply_real {ι : Type uι} [DecidableEq ι] (i j : ι) (a : ℝ) : + (lp.single 1 i a : lp (fun _ : ι => ℝ) 1) j = if i = j then a else 0 := by + by_cases hij : i = j + · subst j + simp + · rw [lp.single_apply_ne (E := fun _ : ι => ℝ) 1 i a (Ne.symm hij), ite_eq_right hij] + +/-- Coordinate computation for a single point probability. -/ +theorem diracDefect_apply (S : Finset G) (g : G) (h : S) (x : G) : + diracDefect S g (h, x) = + (Finsupp.single g (1 : ℝ)) (h.val⁻¹ * x) - (Finsupp.single g (1 : ℝ)) x := by + have hmul : h.val * g = x ↔ g = h.val⁻¹ * x := by + constructor + · intro heq + simpa [mul_assoc] using congrArg (fun y => h.val⁻¹ * y) heq + · intro heq + simpa [mul_assoc] using congrArg (fun y => h.val * y) heq + unfold diracDefect + rw [lp.coeFn_sum, Finset.sum_apply, Finset.sum_eq_single h] + · simp only [lp.coeFn_sub, Pi.sub_apply] + rw [single_apply_real, single_apply_real] + simp only [Prod.mk.injEq, true_and, hmul, + Finsupp.single_apply] + · intro k _ hkh + simp [Prod.mk.injEq, hkh] + · simp + +/-- The product coordinate is exactly the left translation difference. -/ +theorem defectMap_apply (S : Finset G) (p : G →₀ ℝ) (h : S) (x : G) : + defectMap S p (h, x) = p (h.val⁻¹ * x) - p x := by + induction p using Finsupp.induction_linear with + | zero => simp + | add p q hp hq => + simp only [map_add, lp.coeFn_add, Pi.add_apply, Finsupp.add_apply, hp, hq] + ring + | single g a => + rw [defectMap_single, lp.coeFn_smul, Pi.smul_apply, diracDefect_apply] + simp only [smul_eq_mul, Finsupp.single_apply, mul_sub, mul_ite, mul_one, mul_zero] + +/-- Each translation difference vanishes outside its exact finite support bound. -/ +theorem translation_difference_eq_zero_of_not_mem (p : G →₀ ℝ) (h x : G) + (hx : x ∉ p.support ∪ p.support.image (fun g => h * g)) : + p (h⁻¹ * x) - p x = 0 := by + have hx₀ : x ∉ p.support := fun hmem => hx (Finset.mem_union_left _ hmem) + have hx₁ : h⁻¹ * x ∉ p.support := by + intro hmem + apply hx + apply Finset.mem_union_right + exact Finset.mem_image.mpr ⟨h⁻¹ * x, hmem, by simp⟩ + simp [Finsupp.notMem_support_iff.mp hx₀, Finsupp.notMem_support_iff.mp hx₁] + +/-- Exact ℓ¹ norm of the simultaneous defect, with no `S.card` loss. -/ +theorem norm_defectMap (S : Finset G) (p : G →₀ ℝ) : + ‖defectMap S p‖ = + ∑ h ∈ S, ∑ x ∈ p.support ∪ p.support.image (fun g => h * g), + |p (h⁻¹ * x) - p x| := by + have hsum : HasSum (fun z : S × G => ‖defectMap S p z‖) ‖defectMap S p‖ := by + simpa only [ENNReal.toReal_one, Real.rpow_one] using + (lp.hasSum_norm (p := 1) (by simp) (defectMap S p)) + calc + ‖defectMap S p‖ = ∑' z : S × G, ‖defectMap S p z‖ := hsum.tsum_eq.symm + _ = ∑ h : S, ∑' x : G, ‖defectMap S p (h, x)‖ := by + rw [hsum.summable.tsum_prod, tsum_fintype] + _ = ∑ h : S, ∑ x ∈ p.support ∪ p.support.image (fun g => h.val * g), + |p (h.val⁻¹ * x) - p x| := by + apply Finset.sum_congr rfl + intro h _ + simp only [defectMap_apply, Real.norm_eq_abs] + apply tsum_eq_sum + intro x hx + rw [translation_difference_eq_zero_of_not_mem p h.val x hx, abs_zero] + _ = ∑ h ∈ S, ∑ x ∈ p.support ∪ p.support.image (fun g => h * g), + |p (h⁻¹ * x) - p x| := + Finset.sum_coe_sort S (fun h : G => + ∑ x ∈ p.support ∪ p.support.image (fun g => h * g), + |p (h⁻¹ * x) - p x|) + +/-- The actual image of finite nonnegative probabilities under the defect map. -/ +def defectSet (S : Finset G) : Set (DefectSpace S) := + defectMap S '' {p : G →₀ ℝ | IsProbabilityWeights p} + +theorem convex_defectSet (S : Finset G) : Convex ℝ (defectSet S) := + convex_probabilityWeights.linear_image (defectMap S) + +theorem diracDefect_mem_defectSet (S : Finset G) (g : G) : + diracDefect S g ∈ defectSet S := by + refine ⟨Finsupp.single g 1, isProbabilityWeights_single g, ?_⟩ + simp + +theorem defectSet_nonempty (S : Finset G) : (defectSet S).Nonempty := + ⟨diracDefect S 1, diracDefect_mem_defectSet S 1⟩ + +end ThompsonNonamenability + +end + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/RecursiveColoring.lean b/lean/OAI/GroupTheory/Thompson/RecursiveColoring.lean new file mode 100644 index 0000000000000000000000000000000000000000..cdabb7ffdb6644ef285bb6ea7402c560e562ed36 --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/RecursiveColoring.lean @@ -0,0 +1,88 @@ +import OAI.GroupTheory.Thompson.BasicPartition +import OAI.GroupTheory.Thompson.HilbertAverage + +namespace OAI + +/-! +# Recursive unit-ball colors of actual basic dyadic partitions + +The recursion uses the number of actual cells. Restriction to any selected +internal interval strictly decreases that number. The mean is bundled with +its genuine unit-ball proof before it is supplied to the map. +-/ + +noncomputable section + +universe uE + +namespace ThompsonNonamenability + +variable {E : Type uE} [NormedAddCommGroup E] [InnerProductSpace ℝ E] +variable {D : ℕ} + +def partitionColor (I : Fin D → BasicInterval) (hI : ∀ i, (I i).Internal) + (hD : 0 < D) (f : UnitBall E → UnitBall E) (T : BasicPartition) : + UnitBall E := by + classical + exact if h : ∀ i, T.Respects (I i) then + f (ballMean hD (fun i => + partitionColor I hI hD f (T.restrict (I i) (h i)))) + else unitBallZero E +termination_by T.cellCount +decreasing_by + exact T.restrict_cellCount_lt _ _ (hI _) + +/-- The recursive branch, with its actual restricted partitions. -/ +theorem partitionColor_of_respects (I : Fin D → BasicInterval) + (hI : ∀ i, (I i).Internal) (hD : 0 < D) + (f : UnitBall E → UnitBall E) (T : BasicPartition) + (h : ∀ i, T.Respects (I i)) : + partitionColor I hI hD f T = f (ballMean hD (fun i => + partitionColor I hI hD f (T.restrict (I i) (h i)))) := by + rw [partitionColor] + simp only [dite_eq_left h] + +/-- Partitions failing the simultaneous respect condition receive zero. -/ +theorem partitionColor_of_not_respects (I : Fin D → BasicInterval) + (hI : ∀ i, (I i).Internal) (hD : 0 < D) + (f : UnitBall E → UnitBall E) (T : BasicPartition) + (h : ¬∀ i, T.Respects (I i)) : + partitionColor I hI hD f T = unitBallZero E := by + rw [partitionColor] + simp only [dite_eq_right h] + +theorem partitionColor_norm_le (I : Fin D → BasicInterval) + (hI : ∀ i, (I i).Internal) (hD : 0 < D) + (f : UnitBall E → UnitBall E) (T : BasicPartition) : + ‖(partitionColor I hI hD f T : E)‖ ≤ 1 := + (partitionColor I hI hD f T).property + +/-- Applying the recursion to a parent restriction gives the actual child mean. +The normalized two-step restriction is replaced by the proved composite one. -/ +theorem partitionColor_restrict (I : Fin D → BasicInterval) + (hI : ∀ i, (I i).Internal) (hD : 0 < D) + (f : UnitBall E → UnitBall E) (T : BasicPartition) (i : Fin D) + (hparent : T.Respects (I i)) + (hchild : ∀ j, T.Respects ((I i).comp (I j))) : + partitionColor I hI hD f (T.restrict (I i) hparent) = + f (ballMean hD (fun j => partitionColor I hI hD f + (T.restrict ((I i).comp (I j)) (hchild j)))) := by + let hr : ∀ j, (T.restrict (I i) hparent).Respects (I j) := + fun j => T.restrict_respects (I i) (I j) hparent (hchild j) + calc + partitionColor I hI hD f (T.restrict (I i) hparent) = + f (ballMean hD (fun j => partitionColor I hI hD f + ((T.restrict (I i) hparent).restrict (I j) (hr j)))) := + partitionColor_of_respects I hI hD f _ hr + _ = _ := by + apply congrArg f + apply congrArg (ballMean hD) + funext j + apply congrArg (partitionColor I hI hD f) + exact T.restrict_restrict (I i) (I j) hparent (hchild j) + +end ThompsonNonamenability + +end + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/RestrictionCovariance.lean b/lean/OAI/GroupTheory/Thompson/RestrictionCovariance.lean new file mode 100644 index 0000000000000000000000000000000000000000..a2982f18663ee30c90f290551a9e4abb3841d038 --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/RestrictionCovariance.lean @@ -0,0 +1,96 @@ +import OAI.GroupTheory.Thompson.DyadicImages +import OAI.GroupTheory.Thompson.IntervalCharts +import OAI.GroupTheory.Thompson.StandardF + +namespace OAI + +/-! +# Exact covariance under actual affine transport + +Every source image cell and its target image cell retain the same original +uniform-grid index. The affine chart equality therefore identifies the +normalized restrictions pointwise, including their closed endpoints. +-/ + +namespace ThompsonNonamenability + +namespace CarriesAffinely + +theorem chart_value_eq_iff {h : F} {I J : BasicInterval} + (hc : CarriesAffinely h I J) (x y : UnitInterval) : + (h x : ℝ) = J.chart (y : ℝ) ↔ (x : ℝ) = I.chart (y : ℝ) := by + constructor + · intro hx + have heq : h x = h (I.chartPoint y) := + Subtype.ext (hx.trans (hc y).symm) + exact congrArg (fun z : UnitInterval => (z : ℝ)) (h.strictMono.injective heq) + · intro hx + have heq : x = I.chartPoint y := Subtype.ext hx + rw [heq] + exact hc y + +theorem left_value_eq_iff {h : F} {I J : BasicInterval} + (hc : CarriesAffinely h I J) (x : UnitInterval) : + (h x : ℝ) = J.left ↔ (x : ℝ) = I.left := by + simpa only [coe_unitIntervalZero, BasicInterval.chart_zero] using + hc.chart_value_eq_iff x unitIntervalZero + +theorem right_value_eq_iff {h : F} {I J : BasicInterval} + (hc : CarriesAffinely h I J) (x : UnitInterval) : + (h x : ℝ) = J.right ↔ (x : ℝ) = I.right := by + simpa only [coe_unitIntervalOne, BasicInterval.chart_one] using + hc.chart_value_eq_iff x unitIntervalOne + +end CarriesAffinely + +/-- Corresponding actual image cells have exactly the affinely transported +endpoints. No admissibility of any other interval is assumed here. -/ +theorem imageCell_transport_iff (h g : F) (n : ℕ) + (I I' : BasicInterval) (hc : CarriesAffinely h I I') + (hg : ImageBasic g n) (hhg : ImageBasic (h * g) n) (k : Fin (2 ^ n)) : + imageCell (h * g) n hhg k = I' ↔ imageCell g n hg k = I := by + constructor + · intro heq + apply BasicInterval.ext_endpoints + · have hl := congrArg BasicInterval.left heq + simp only [imageCell_left, F.mul_apply] at hl + rw [imageCell_left] + exact (hc.left_value_eq_iff _).mp hl + · have hr := congrArg BasicInterval.right heq + simp only [imageCell_right, F.mul_apply] at hr + rw [imageCell_right] + exact (hc.right_value_eq_iff _).mp hr + · intro heq + apply BasicInterval.ext_endpoints + · have hl := congrArg BasicInterval.left heq + simp only [imageCell_left] at hl + rw [imageCell_left, F.mul_apply] + exact (hc.left_value_eq_iff _).mpr hl + · have hr := congrArg BasicInterval.right heq + simp only [imageCell_right] at hr + rw [imageCell_right, F.mul_apply] + exact (hc.right_value_eq_iff _).mpr hr + +/-- Exact normalized restriction covariance for multiplication `h * g = h ∘ g`. -/ +theorem image_restrict_covariance + (h g : F) (n : ℕ) (I I' : BasicInterval) + (hc : CarriesAffinely h I I') + (hg : ImageBasic g n) (hhg : ImageBasic (h * g) n) + (hr : (imagePartition g n hg).Respects I) + (hr' : (imagePartition (h * g) n hhg).Respects I') : + (imagePartition (h * g) n hhg).restrict I' hr' = + (imagePartition g n hg).restrict I hr := by + apply BasicPartition.ext + ext K + simp only [BasicPartition.mem_restrict_cells, mem_imagePartition_cells] + constructor + · rintro ⟨k, hk⟩ + exact ⟨k, (imageCell_transport_iff h g n (I.comp K) (I'.comp K) + (hc.comp K) hg hhg k).mp hk⟩ + · rintro ⟨k, hk⟩ + exact ⟨k, (imageCell_transport_iff h g n (I.comp K) (I'.comp K) + (hc.comp K) hg hhg k).mpr hk⟩ + +end ThompsonNonamenability + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/SortedSubdivision.lean b/lean/OAI/GroupTheory/Thompson/SortedSubdivision.lean new file mode 100644 index 0000000000000000000000000000000000000000..c6c2664e29e3cbc317d5f2dc41173027f3909bde --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/SortedSubdivision.lean @@ -0,0 +1,158 @@ +import OAI.GroupTheory.Thompson.IntervalHomeomorph +import Mathlib.Data.Finset.Sort +import Lean.Elab.Tactic.Omega + +namespace OAI + +/-! +# Sorting finite subdivisions of the unit interval + +Sorting a finite set containing the endpoints produces a genuine subdivision. +If that set also contains the knots of an earlier subdivision, every new +closed piece is contained in an old closed piece. +-/ + +namespace ThompsonNonamenability + +structure SortedSubdivision (S : Finset UnitInterval) where + pieceCount : ℕ + positive : 0 < pieceCount + knots : Fin (pieceCount + 1) → UnitInterval + strictMono_knots : StrictMono knots + first : knots 0 = unitIntervalZero + last : knots (Fin.last pieceCount) = unitIntervalOne + cover : ∀ x : UnitInterval, ∃ i : Fin pieceCount, + knots i.castSucc ≤ x ∧ x ≤ knots i.succ + knots_mem : ∀ i, knots i ∈ S + contains : ∀ x ∈ S, ∃ i, knots i = x + +namespace SortedSubdivision + +/-- The adjacent closed intervals cover the unit interval. Monotonicity is not +needed for this auxiliary fact: take the last left endpoint below the point. -/ +theorem cover_of_endpoints {n : ℕ} (hn : 0 < n) + (knots : Fin (n + 1) → UnitInterval) + (hfirst : knots 0 = unitIntervalZero) + (hlast : knots (Fin.last n) = unitIntervalOne) (x : UnitInterval) : + ∃ i : Fin n, knots i.castSucc ≤ x ∧ x ≤ knots i.succ := by + classical + let A : Finset (Fin n) := Finset.univ.filter (fun i => knots i.castSucc ≤ x) + let i₀ : Fin n := ⟨0, hn⟩ + have hi₀ : i₀.castSucc = 0 := by apply Fin.ext; rfl + have hA : A.Nonempty := by + refine ⟨i₀, Finset.mem_filter.mpr ⟨Finset.mem_univ _, ?_⟩⟩ + rw [hi₀, hfirst] + exact x.property.1 + let i : Fin n := A.max' hA + have hiA : i ∈ A := A.max'_mem hA + refine ⟨i, (Finset.mem_filter.mp hiA).2, ?_⟩ + by_contra h + have hlt : knots i.succ < x := lt_of_not_ge h + have hisucc : i.val + 1 < n := by + by_contra hbound + have heq : i.succ = Fin.last n := by + apply Fin.ext + simp only [Fin.val_succ, Fin.val_last] + have := i.isLt + omega + rw [heq, hlast] at hlt + exact (not_lt_of_ge x.property.2) hlt + let j : Fin n := ⟨i.val + 1, hisucc⟩ + have hjcast : j.castSucc = i.succ := by apply Fin.ext; rfl + have hjA : j ∈ A := by + apply Finset.mem_filter.mpr + refine ⟨Finset.mem_univ _, ?_⟩ + rw [hjcast] + exact hlt.le + have hji : j ≤ i := A.le_max' j hjA + change i.val + 1 ≤ i.val at hji + omega + +/-- Increasing enumeration of the actual finite knot set. -/ +noncomputable def ofFinset (S : Finset UnitInterval) + (h0 : unitIntervalZero ∈ S) (h1 : unitIntervalOne ∈ S) : + SortedSubdivision S := by + classical + have hne : unitIntervalZero ≠ unitIntervalOne := by + intro h + have hv := congrArg (fun x : UnitInterval => (x : ℝ)) h + exact zero_ne_one hv + have hcard : 1 < S.card := + Finset.one_lt_card.mpr ⟨unitIntervalZero, h0, unitIntervalOne, h1, hne⟩ + let n := S.card - 1 + have hn : 0 < n := by dsimp [n]; omega + have hc : S.card = n + 1 := by dsimp [n]; omega + let e : Fin (n + 1) ↪o UnitInterval := S.orderEmbOfFin hc + have hcontains : ∀ x ∈ S, ∃ i, e i = x := by + intro x hx + refine ⟨(S.orderIsoOfFin hc).symm ⟨x, hx⟩, ?_⟩ + exact congrArg Subtype.val ((S.orderIsoOfFin hc).apply_symm_apply ⟨x, hx⟩) + have hfirst : e 0 = unitIntervalZero := by + obtain ⟨j, hj⟩ := hcontains unitIntervalZero h0 + apply le_antisymm + · calc + e 0 ≤ e j := e.monotone (Fin.zero_le j) + _ = unitIntervalZero := hj + · exact (e 0).property.1 + have hlast : e (Fin.last n) = unitIntervalOne := by + obtain ⟨j, hj⟩ := hcontains unitIntervalOne h1 + apply le_antisymm + · exact (e (Fin.last n)).property.2 + · calc + unitIntervalOne = e j := hj.symm + _ ≤ e (Fin.last n) := e.monotone (Fin.le_last j) + exact + { pieceCount := n + positive := hn + knots := e + strictMono_knots := e.strictMono + first := hfirst + last := hlast + cover := cover_of_endpoints hn e hfirst hlast + knots_mem := S.orderEmbOfFin_mem hc + contains := hcontains } + +/-- No point of the sorted knot set lies strictly between successive knots. -/ +theorem no_mem_between {S : Finset UnitInterval} (r : SortedSubdivision S) + (i : Fin r.pieceCount) {x : UnitInterval} (hx : x ∈ S) : + ¬ (r.knots i.castSucc < x ∧ x < r.knots i.succ) := by + obtain ⟨j, rfl⟩ := r.contains x hx + intro h + have hleft := r.strictMono_knots.lt_iff_lt.mp h.1 + have hright := r.strictMono_knots.lt_iff_lt.mp h.2 + change i.val < j.val at hleft + change j.val < i.val + 1 at hright + exact (not_lt_of_ge (Nat.succ_le_of_lt hleft)) hright + +/-- A refinement containing every original knot has each closed piece inside +one original closed piece. The interior point selects a piece even when a +refined endpoint is itself an original knot. -/ +theorem adjacent_contained {S : Finset UnitInterval} (r : SortedSubdivision S) + {n : ℕ} (old : Fin (n + 1) → UnitInterval) (_hold : StrictMono old) + (hcover : ∀ x : UnitInterval, ∃ j : Fin n, + old j.castSucc ≤ x ∧ x ≤ old j.succ) + (hmem : ∀ j, old j ∈ S) (i : Fin r.pieceCount) : + ∃ j : Fin n, old j.castSucc ≤ r.knots i.castSucc ∧ + r.knots i.succ ≤ old j.succ := by + have hlt : (r.knots i.castSucc : ℝ) < (r.knots i.succ : ℝ) := + r.strictMono_knots (Fin.castSucc_lt_succ_iff.mpr le_rfl) + obtain ⟨y, hleft, hright⟩ := exists_between hlt + let x : UnitInterval := ⟨y, + (r.knots i.castSucc).property.1.trans hleft.le, + hright.le.trans (r.knots i.succ).property.2⟩ + have hlx : r.knots i.castSucc < x := hleft + have hxr : x < r.knots i.succ := hright + obtain ⟨j, hjleft, hjright⟩ := hcover x + refine ⟨j, ?_, ?_⟩ + · by_contra h + exact r.no_mem_between i (hmem j.castSucc) + ⟨lt_of_not_ge h, hjleft.trans_lt hxr⟩ + · by_contra h + exact r.no_mem_between i (hmem j.succ) + ⟨hlx.trans_le hjright, lt_of_not_ge h⟩ + +end SortedSubdivision + +end ThompsonNonamenability + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/StandardCharacterization.lean b/lean/OAI/GroupTheory/Thompson/StandardCharacterization.lean new file mode 100644 index 0000000000000000000000000000000000000000..c6aa7eea3fc75ee4fd186277771c4e349f658f2d --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/StandardCharacterization.lean @@ -0,0 +1,75 @@ +import OAI.GroupTheory.Thompson.StandardF + +namespace OAI + +/-! +# Identification with the standard finite-breakpoint PL definition + +The standard condition below states only a finite strictly ordered list of +dyadic knots, the two endpoints, and the powers-of-two affine formulas. +Coverage is derived from the endpoints; it is not an additional premise. +-/ + +namespace ThompsonNonamenability + +/-- The usual increasing PL interval homeomorphisms with finitely many dyadic +breakpoints and slopes in the integer powers of two. -/ +def StandardPLCondition (f : UnitInterval ≃ₜ UnitInterval) : Prop := + StrictMono f ∧ ∃ n : ℕ, 0 < n ∧ + ∃ knots : Fin (n + 1) → UnitInterval, + StrictMono knots ∧ + knots 0 = unitIntervalZero ∧ + knots (Fin.last n) = unitIntervalOne ∧ + (∀ i, IsDyadic (knots i : ℝ)) ∧ + ∃ exponent : Fin n → ℤ, + ∀ (i : Fin n) (x : UnitInterval), + knots i.castSucc ≤ x → x ≤ knots i.succ → + (f x : ℝ) = (f (knots i.castSucc) : ℝ) + + (2 : ℝ) ^ exponent i * ((x : ℝ) - (knots i.castSucc : ℝ)) + +theorem intervalHomeomorph_standardPL_iff (f : IntervalHomeomorph) : + (StrictMono f ∧ HasDyadicPLPieces f) ↔ StandardPLCondition f.toHomeomorph := by + constructor + · rintro ⟨hf, ⟨w⟩⟩ + exact ⟨hf, w.pieceCount, w.positive, w.knots, w.strictMono_knots, + w.first, w.last, w.dyadic, w.exponent, w.affine⟩ + · rintro ⟨hf, n, hn, knots, hmono, hfirst, hlast, hdyadic, exponent, haffine⟩ + refine ⟨hf, ⟨?_⟩⟩ + exact { + pieceCount := n + positive := hn + knots := knots + strictMono_knots := hmono + first := hfirst + last := hlast + dyadic := hdyadic + cover := SortedSubdivision.cover_of_endpoints hn knots hfirst hlast + exponent := exponent + affine := haffine } + +namespace F + +theorem standardPLCondition (g : F) : StandardPLCondition g.toHomeomorph := + (intervalHomeomorph_standardPL_iff g.toIntervalHomeomorph).mp g.property + +/-- A faithful identification with the standard PL group carrier, with no +uniform-grid or transport assumption in the right-hand side. -/ +def standardPLEquiv : F ≃ {f : UnitInterval ≃ₜ UnitInterval // StandardPLCondition f} where + toFun g := ⟨g.toHomeomorph, g.standardPLCondition⟩ + invFun f := ⟨⟨f.val⟩, (intervalHomeomorph_standardPL_iff ⟨f.val⟩).mpr f.property⟩ + left_inv g := by + apply F.ext + intro x + rfl + right_inv f := by + apply Subtype.ext + rfl + +@[simp] theorem standardPLEquiv_apply (g : F) : + (standardPLEquiv g).val = g.toHomeomorph := rfl + +end F + +end ThompsonNonamenability + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/StandardF.lean b/lean/OAI/GroupTheory/Thompson/StandardF.lean new file mode 100644 index 0000000000000000000000000000000000000000..632e0095882b0f0b56a94c155d055162506ec134 --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/StandardF.lean @@ -0,0 +1,71 @@ +import OAI.GroupTheory.Thompson.PLRefinement + +namespace OAI + +namespace ThompsonNonamenability + +def standardSubgroup : Subgroup IntervalHomeomorph where + carrier := {f | StrictMono f ∧ HasDyadicPLPieces f} + one_mem' := ⟨fun _ _ h => h, hasDyadicPLPieces_one⟩ + mul_mem' hh hg := + ⟨hh.1.comp hg.1, hh.2.mul hg.2 hh.1 hg.1⟩ + inv_mem' hg := + ⟨IntervalHomeomorph.strictMono_inv hg.1, hg.2.inv hg.1⟩ + +namespace F + +instance : Group F := inferInstanceAs (Group standardSubgroup) + +@[simp] theorem one_apply (x : UnitInterval) : (1 : F) x = x := rfl + +@[simp] theorem mul_apply (h g : F) (x : UnitInterval) : (h * g) x = h (g x) := rfl + +@[simp] theorem inv_apply_apply (g : F) (x : UnitInterval) : g⁻¹ (g x) = x := + IntervalHomeomorph.inv_apply_apply g.toIntervalHomeomorph x + +@[simp] theorem apply_inv_apply (g : F) (x : UnitInterval) : g (g⁻¹ x) = x := + IntervalHomeomorph.apply_inv_apply g.toIntervalHomeomorph x + +def toIntervalHomeomorphHom : F →* IntervalHomeomorph where + toFun := toIntervalHomeomorph + map_one' := rfl + map_mul' _ _ := rfl + +theorem toIntervalHomeomorph_injective : + Function.Injective toIntervalHomeomorph := fun _ _ h => Subtype.ext h + +theorem toHomeomorph_injective : Function.Injective toHomeomorph := by + intro g h heq + apply ext + intro x + exact congrArg (fun f : UnitInterval ≃ₜ UnitInterval => f x) heq + +/-- The representation forgets no mathematical data: it is equivalent to the +usual subtype of actual increasing finite dyadic PL interval homeomorphisms. -/ +def standardHomeomorphEquiv : + F ≃ {f : UnitInterval ≃ₜ UnitInterval // + StrictMono f ∧ HasDyadicPLPieces ⟨f⟩} where + toFun g := ⟨g.toHomeomorph, g.strictMono, g.hasDyadicPLPieces⟩ + invFun g := ⟨⟨g.val⟩, g.property⟩ + left_inv g := by + apply F.ext + intro x + rfl + right_inv g := by + apply Subtype.ext + rfl + +theorem mem_iff_standardPL (f : IntervalHomeomorph) : + (∃ g : F, g.toIntervalHomeomorph = f) ↔ + StrictMono f ∧ HasDyadicPLPieces f := by + constructor + · rintro ⟨g, rfl⟩ + exact g.property + · intro hf + exact ⟨⟨f, hf⟩, rfl⟩ + +end F + +end ThompsonNonamenability + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/StandardPL.lean b/lean/OAI/GroupTheory/Thompson/StandardPL.lean new file mode 100644 index 0000000000000000000000000000000000000000..2e71eea1a920c0fbb4c277b471ba626bc6cdb48b --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/StandardPL.lean @@ -0,0 +1,154 @@ +import OAI.GroupTheory.Thompson.IntervalHomeomorph +import OAI.GroupTheory.Thompson.DyadicArithmetic +import Mathlib.Tactic.FinCases +import Mathlib.Tactic.FieldSimp +import Mathlib.Tactic.Linarith + +namespace OAI + +/-! +# The ordinary finite-piece dyadic PL condition + +A witness is a finite subdivision of the actual real interval, together with +an affine equality on each closed piece. Knots may be redundant. The witness +is existential in `HasDyadicPLPieces`, so its choice is not part of a group +element's identity. +-/ + +namespace ThompsonNonamenability + +namespace DyadicPLWitness + +theorem knot_le_next {f : IntervalHomeomorph} (w : DyadicPLWitness f) + (i : Fin w.pieceCount) : w.knots i.castSucc ≤ w.knots i.succ := + (w.strictMono_knots (Fin.castSucc_lt_succ_iff.mpr le_rfl)).le + +theorem image_knots_dyadic {f : IntervalHomeomorph} (w : DyadicPLWitness f) + (hf : StrictMono f) (i : Fin (w.pieceCount + 1)) : + IsDyadic (f (w.knots i) : ℝ) := by + refine Fin.induction ?_ ?_ i + · simpa only [w.first, IntervalHomeomorph.map_zero hf, coe_unitIntervalZero] + using isDyadic_zero + · intro j hj + rw [w.affine j (w.knots j.succ) (w.knot_le_next j) le_rfl] + exact hj.add ((isDyadic_zpow (w.exponent j)).mul + ((w.dyadic j.succ).sub (w.dyadic j.castSucc))) + +theorem map_dyadic {f : IntervalHomeomorph} (w : DyadicPLWitness f) + (hf : StrictMono f) {x : UnitInterval} (hx : IsDyadic (x : ℝ)) : + IsDyadic (f x : ℝ) := by + obtain ⟨i, hleft, hright⟩ := w.cover x + rw [w.affine i x hleft hright] + exact (w.image_knots_dyadic hf i.castSucc).add + ((isDyadic_zpow (w.exponent i)).mul (hx.sub (w.dyadic i.castSucc))) + +def identity : DyadicPLWitness (1 : IntervalHomeomorph) where + pieceCount := 1 + positive := Nat.zero_lt_succ 0 + knots := Fin.cases unitIntervalZero (fun _ => unitIntervalOne) + strictMono_knots := by + intro i j hij + fin_cases i <;> fin_cases j <;> simp_all [unitIntervalZero, unitIntervalOne] + change (0 : ℝ) < 1 + exact zero_lt_one + first := rfl + last := rfl + dyadic := by + intro i + fin_cases i + · exact isDyadic_zero + · exact isDyadic_one + cover := by + intro x + exact ⟨0, x.property⟩ + exponent := fun _ => 0 + affine := by + intro i x hleft hright + simp only [IntervalHomeomorph.one_apply, zpow_zero, one_mul] + ring + +def inverse {f : IntervalHomeomorph} (w : DyadicPLWitness f) (hf : StrictMono f) : + DyadicPLWitness f⁻¹ where + pieceCount := w.pieceCount + positive := w.positive + knots := fun i => f (w.knots i) + strictMono_knots := hf.comp w.strictMono_knots + first := by rw [w.first, IntervalHomeomorph.map_zero hf] + last := by rw [w.last, IntervalHomeomorph.map_one hf] + dyadic := w.image_knots_dyadic hf + cover := by + intro x + obtain ⟨i, hleft, hright⟩ := w.cover (f⁻¹ x) + refine ⟨i, ?_, ?_⟩ + · simpa only [IntervalHomeomorph.apply_inv_apply] using hf.monotone hleft + · simpa only [IntervalHomeomorph.apply_inv_apply] using hf.monotone hright + exponent := fun i => -w.exponent i + affine := by + intro i x hleft hright + have hleft' : w.knots i.castSucc ≤ f⁻¹ x := by + apply hf.le_iff_le.mp + simpa only [IntervalHomeomorph.apply_inv_apply] using hleft + have hright' : f⁻¹ x ≤ w.knots i.succ := by + apply hf.le_iff_le.mp + simpa only [IntervalHomeomorph.apply_inv_apply] using hright + have h := w.affine i (f⁻¹ x) hleft' hright' + simp only [IntervalHomeomorph.apply_inv_apply] at h + simp only [IntervalHomeomorph.inv_apply_apply, zpow_neg] + have hpow : (2 : ℝ) ^ w.exponent i ≠ 0 := zpow_ne_zero _ (by norm_num) + rw [h] + field_simp [hpow] + ring + +end DyadicPLWitness + +theorem hasDyadicPLPieces_one : HasDyadicPLPieces (1 : IntervalHomeomorph) := + ⟨DyadicPLWitness.identity⟩ + +theorem HasDyadicPLPieces.inv {f : IntervalHomeomorph} + (h : HasDyadicPLPieces f) (hf : StrictMono f) : HasDyadicPLPieces f⁻¹ := by + obtain ⟨w⟩ := h + exact ⟨w.inverse hf⟩ + +theorem HasDyadicPLPieces.map_dyadic {f : IntervalHomeomorph} + (h : HasDyadicPLPieces f) (hf : StrictMono f) + {x : UnitInterval} (hx : IsDyadic (x : ℝ)) : IsDyadic (f x : ℝ) := by + obtain ⟨w⟩ := h + exact w.map_dyadic hf hx + +namespace F + +def toIntervalHomeomorph (g : F) : IntervalHomeomorph := g.val + +instance : CoeFun F (fun _ => UnitInterval → UnitInterval) := + ⟨fun g => g.toIntervalHomeomorph⟩ + +def toHomeomorph (g : F) : UnitInterval ≃ₜ UnitInterval := + g.toIntervalHomeomorph.toHomeomorph + +theorem strictMono (g : F) : StrictMono g := g.property.1 + +theorem hasDyadicPLPieces (g : F) : HasDyadicPLPieces g.toIntervalHomeomorph := + g.property.2 + +noncomputable def witness (g : F) : DyadicPLWitness g.toIntervalHomeomorph := + Classical.choice g.hasDyadicPLPieces + +theorem map_dyadic (g : F) {x : UnitInterval} (hx : IsDyadic (x : ℝ)) : + IsDyadic (g x : ℝ) := + g.hasDyadicPLPieces.map_dyadic g.strictMono hx + +@[simp] theorem map_zero (g : F) : g unitIntervalZero = unitIntervalZero := + IntervalHomeomorph.map_zero g.strictMono + +@[simp] theorem map_one (g : F) : g unitIntervalOne = unitIntervalOne := + IntervalHomeomorph.map_one g.strictMono + +@[ext] theorem ext {g h : F} (heq : ∀ x, g x = h x) : g = h := by + apply Subtype.ext + exact IntervalHomeomorph.ext heq + +end F + +end ThompsonNonamenability + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/TransportFamily.lean b/lean/OAI/GroupTheory/Thompson/TransportFamily.lean new file mode 100644 index 0000000000000000000000000000000000000000..519237be2260f0853e68b5e8ce2b5b273d253037 --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/TransportFamily.lean @@ -0,0 +1,148 @@ +import OAI.GroupTheory.Thompson.GlobalColors +import OAI.GroupTheory.Thompson.AffineTransport +import Mathlib.Data.Finset.Union + +namespace OAI + +/-! +# A fixed finite family of actual affine transports + +The set of transports depends only on the branching parameter. Each ordered +separated pair in the actual parent/child family is carried onto the reference +pair. After this set is fixed, one partition level is selected for the given +finite group set and all of its translates by these transports. +-/ + +noncomputable section + +open scoped InnerProductSpace + +universe uE + +namespace ThompsonNonamenability + +local instance : DecidableEq F := Classical.decEq F + +variable {D : ℕ} + +/-- The ordered separated pairs of actual interval occurrences. -/ +def orderedIntervalPairs (D : ℕ) : Finset (IntervalIndex D × IntervalIndex D) := by + classical + exact Finset.univ.filter (fun p => + (familyInterval D p.1).Before (familyInterval D p.2)) + +theorem mem_orderedIntervalPairs (D : ℕ) (q r : IntervalIndex D) : + (q, r) ∈ orderedIntervalPairs D ↔ + (familyInterval D q).Before (familyInterval D r) := by + classical + simp only [orderedIntervalPairs, Finset.mem_filter, Finset.mem_univ, true_and] + +/-- An actual Thompson-group witness, chosen only for a genuinely separated pair. -/ +def pairTransport (hD : 2 ≤ D) (p : {p // p ∈ orderedIntervalPairs D}) : F := + Classical.choose (exists_affine_pair_transport + (familyInterval_internal D p.val.1) (familyInterval_internal D p.val.2) + (selectedInterval_internal D (firstIndex hD)) + (selectedInterval_internal D (secondIndex hD)) + ((mem_orderedIntervalPairs D p.val.1 p.val.2).mp p.property) + (reference_before hD)) + +theorem pairTransport_spec (hD : 2 ≤ D) (p : {p // p ∈ orderedIntervalPairs D}) : + CarriesAffinely (pairTransport hD p) (familyInterval D p.val.1) + (familyInterval D (.inl (firstIndex hD))) ∧ + CarriesAffinely (pairTransport hD p) (familyInterval D p.val.2) + (familyInterval D (.inl (secondIndex hD))) := + Classical.choose_spec (exists_affine_pair_transport + (familyInterval_internal D p.val.1) (familyInterval_internal D p.val.2) + (selectedInterval_internal D (firstIndex hD)) + (selectedInterval_internal D (secondIndex hD)) + ((mem_orderedIntervalPairs D p.val.1 p.val.2).mp p.property) + (reference_before hD)) + +/-- This actual finite subset of F is fixed before any averaging set. -/ +def fixedTransportSet (hD : 2 ≤ D) : Finset F := + (orderedIntervalPairs D).attach.image (pairTransport hD) + +theorem transport_of_before (hD : 2 ≤ D) (q r : IntervalIndex D) + (hqr : (familyInterval D q).Before (familyInterval D r)) : + ∃ h ∈ fixedTransportSet hD, + CarriesAffinely h (familyInterval D q) + (familyInterval D (.inl (firstIndex hD))) ∧ + CarriesAffinely h (familyInterval D r) + (familyInterval D (.inl (secondIndex hD))) := by + let p : {p // p ∈ orderedIntervalPairs D} := + ⟨(q, r), (mem_orderedIntervalPairs D q r).mpr hqr⟩ + refine ⟨pairTransport hD p, ?_, pairTransport_spec hD p⟩ + exact Finset.mem_image.mpr ⟨p, Finset.mem_attach _ _, rfl⟩ + +theorem fixedTransportSet_nonempty (hD : 2 ≤ D) : + (fixedTransportSet hD).Nonempty := by + obtain ⟨h, hh, _⟩ := transport_of_before hD + (.inl (firstIndex hD)) (.inl (secondIndex hD)) (reference_before hD) + exact ⟨h, hh⟩ + +/-- The one finite set used to select a common partition level. -/ +def transportClosure (S A : Finset F) : Finset F := + A ∪ S.biUnion (fun h => leftTranslate h A) + +theorem mem_transportClosure_self (S A : Finset F) {g : F} (hg : g ∈ A) : + g ∈ transportClosure S A := Finset.mem_union_left _ hg + +theorem mem_transportClosure_mul (S A : Finset F) {h g : F} + (hh : h ∈ S) (hg : g ∈ A) : h * g ∈ transportClosure S A := by + apply Finset.mem_union_right + exact Finset.mem_biUnion.mpr ⟨h, hh, Finset.mem_image.mpr ⟨g, hg, rfl⟩⟩ + +/-- A single level works simultaneously on A and on every hA for h in fixed S. -/ +theorem exists_transport_admissible (hD : 2 ≤ D) (A : Finset F) : + ∃ n, (∀ g ∈ A, GlobalAdmissible D n g) ∧ + ∀ h ∈ fixedTransportSet hD, ∀ g ∈ A, GlobalAdmissible D n (h * g) := by + obtain ⟨n, hn⟩ := exists_common_admissible D + (transportClosure (fixedTransportSet hD) A) + exact ⟨n, (fun g hg => hn g (mem_transportClosure_self _ _ hg)), + fun h hh g hg => hn (h * g) (mem_transportClosure_mul _ _ hh hg)⟩ + +variable {E : Type uE} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + +/-- Symmetry is used only to orient a separated pair; it introduces no sign +assumption on its real inner product. -/ +theorem globalCorrelation_comm (hD : 0 < D) (f : UnitBall E → UnitBall E) + (n : ℕ) (q r : IntervalIndex D) (g : F) : + globalCorrelation hD f n q r g = globalCorrelation hD f n r q g := by + exact real_inner_comm (globalColor hD f n r g : E) (globalColor hD f n q g : E) + +/-- All separated correlations are compared with one reference correlation +using only the maximum boundary over the previously fixed finite set. -/ +theorem separated_correlation_bound (hD : 2 ≤ D) (f : UnitBall E → UnitBall E) + (n : ℕ) (A : Finset F) (hA : A.Nonempty) + (hg : ∀ g ∈ A, GlobalAdmissible D n g) + (hhg : ∀ h ∈ fixedTransportSet hD, ∀ g ∈ A, GlobalAdmissible D n (h * g)) + (q r : IntervalIndex D) + (hqr : StrictlySeparated (familyInterval D q) (familyInterval D r)) : + |realAvg A (globalCorrelation (lt_of_lt_of_le (by decide : 0 < 2) hD) f n q r) - + realAvg A (globalCorrelation (lt_of_lt_of_le (by decide : 0 < 2) hD) f n + (.inl (firstIndex hD)) (.inl (secondIndex hD)))| ≤ + boundaryMax (fixedTransportSet hD) (fixedTransportSet_nonempty hD) A := by + have hDpos : 0 < D := lt_of_lt_of_le (by decide : 0 < 2) hD + have ordered_bound (u v : IntervalIndex D) + (huv : (familyInterval D u).Before (familyInterval D v)) : + |realAvg A (globalCorrelation hDpos f n u v) - + realAvg A (globalCorrelation hDpos f n + (.inl (firstIndex hD)) (.inl (secondIndex hD)))| ≤ + boundaryMax (fixedTransportSet hD) (fixedTransportSet_nonempty hD) A := by + obtain ⟨h, hh, hu, hv⟩ := transport_of_before hD u v huv + exact (globalCorrelation_translate_bound hDpos f n A hA h u v + (.inl (firstIndex hD)) (.inl (secondIndex hD)) hu hv hg (hhg h hh)).trans + (boundaryRatio_le_max _ _ A hh) + rcases hqr with hqr | hrq + · exact ordered_bound q r hqr + · have hsym : realAvg A (globalCorrelation hDpos f n q r) = + realAvg A (globalCorrelation hDpos f n r q) := by + exact realAvg_congr A (fun g _ => globalCorrelation_comm hDpos f n q r g) + rw [hsym] + exact ordered_bound r q hrq + +end ThompsonNonamenability + +end + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/TubeComparison.lean b/lean/OAI/GroupTheory/Thompson/TubeComparison.lean new file mode 100644 index 0000000000000000000000000000000000000000..c3ae768d63042afcbfc4f4ed6e027038d9e05dff --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/TubeComparison.lean @@ -0,0 +1,98 @@ +import OAI.GroupTheory.Thompson.TubeRegularCurve +import OAI.GroupTheory.Thompson.TubeTangent + +namespace OAI + +/-! +# Comparing parameters of nearby normal points + +Separation first puts the parameters in the range of the tangent projection +estimate. Orthogonality then bounds the remaining projection error by the +variation of the tangent. No nearest-point selection is used here. +-/ + +noncomputable section + +universe uE + +namespace ThompsonNonamenability.Analytic + +open scoped InnerProductSpace + +variable {E : Type uE} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + +namespace RegularCurveData + +variable (C : RegularCurveData E) + +/-- Normal parameters of two nearby points in the tube satisfy a uniform +comparison estimate. -/ +theorem parameter_comparison (x y : E) (s t : ℝ) + (hx : ‖x - C.curve s‖ < C.rho) (hy : ‖y - C.curve t‖ < C.rho) + (hxy : ‖x - y‖ < C.rho) + (hperp_x : inner (𝕜 := ℝ) (x - C.curve s) (C.tangent s) = 0) + (hperp_y : inner (𝕜 := ℝ) (y - C.curve t) (C.tangent t) = 0) : + |t - s| ≤ 16 * ‖x - y‖ := by + have hcurve : ‖C.curve t - C.curve s‖ < 3 * C.rho := by + have h₁ := norm_sub_le_norm_sub_add_norm_sub (C.curve t) y x + have h₂ := norm_sub_le_norm_sub_add_norm_sub (C.curve t) x (C.curve s) + rw [norm_sub_rev (C.curve t) y, norm_sub_rev y x] at h₁ + linarith + have hst : |t - s| ≤ 1 / 32 := by + apply le_of_not_gt + intro hlarge + have hsep := C.separated s t (le_of_lt hlarge) + have hrho := C.rho_pos + have hfour := C.four_rho_lt_separation + linarith + have htan : ‖C.tangent s - C.tangent t‖ ≤ 16 * |t - s| := by + simpa only [norm_sub_rev (C.tangent t) (C.tangent s)] using + C.tangent_lipschitz s t + have herror : + |inner (𝕜 := ℝ) (y - C.curve t) (C.tangent s - C.tangent t)| ≤ + C.rho * 16 * |t - s| := by + calc + |inner (𝕜 := ℝ) (y - C.curve t) (C.tangent s - C.tangent t)| + ≤ ‖y - C.curve t‖ * ‖C.tangent s - C.tangent t‖ := + abs_real_inner_le_norm _ _ + _ ≤ ‖y - C.curve t‖ * (16 * |t - s|) := + mul_le_mul_of_nonneg_left htan (norm_nonneg _) + _ ≤ C.rho * (16 * |t - s|) := + mul_le_mul_of_nonneg_right (le_of_lt hy) (by positivity) + _ = C.rho * 16 * |t - s| := (mul_assoc _ _ _).symm + have hpoint : |inner (𝕜 := ℝ) (y - x) (C.tangent s)| ≤ ‖x - y‖ := by + calc + |inner (𝕜 := ℝ) (y - x) (C.tangent s)| ≤ ‖y - x‖ * ‖C.tangent s‖ := + abs_real_inner_le_norm _ _ + _ = ‖x - y‖ := by rw [C.norm_tangent, mul_one, norm_sub_rev] + have hidentity : + inner (𝕜 := ℝ) (C.curve t - C.curve s) (C.tangent s) = + inner (𝕜 := ℝ) (y - x) (C.tangent s) - + inner (𝕜 := ℝ) (y - C.curve t) (C.tangent s - C.tangent t) := by + simp only [inner_sub_left, inner_sub_right] at hperp_x hperp_y ⊢ + linarith + have hupper : + |inner (𝕜 := ℝ) (C.curve t - C.curve s) (C.tangent s)| ≤ + ‖x - y‖ + C.rho * 16 * |t - s| := by + rw [hidentity] + calc + |inner (𝕜 := ℝ) (y - x) (C.tangent s) - + inner (𝕜 := ℝ) (y - C.curve t) (C.tangent s - C.tangent t)| + ≤ |inner (𝕜 := ℝ) (y - x) (C.tangent s)| + + |inner (𝕜 := ℝ) (y - C.curve t) (C.tangent s - C.tangent t)| := by + simpa only [sub_zero, zero_sub, abs_neg] using + abs_sub_le (inner (𝕜 := ℝ) (y - x) (C.tangent s)) 0 + (inner (𝕜 := ℝ) (y - C.curve t) (C.tangent s - C.tangent t)) + _ ≤ ‖x - y‖ + C.rho * 16 * |t - s| := add_le_add hpoint herror + have hlower := C.tangent_projection_lower s t hst + have hsmall : C.rho * 16 * |t - s| ≤ (1 / 32) * |t - s| := + mul_le_mul_of_nonneg_right (le_of_lt C.tangent_error_small) (abs_nonneg _) + linarith + +end RegularCurveData + +end ThompsonNonamenability.Analytic + +end + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/TubeNearest.lean b/lean/OAI/GroupTheory/Thompson/TubeNearest.lean new file mode 100644 index 0000000000000000000000000000000000000000..c7dabd82d4a0a7c0ab0deaed13f8a203a0ba4cee --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/TubeNearest.lean @@ -0,0 +1,111 @@ +import OAI.GroupTheory.Thompson.TubeRegularCurve +import Mathlib.Analysis.Calculus.LocalExtr.Basic +import Mathlib.Topology.Order.Compact + +namespace OAI + +/-! +# Global nearest points obtained by compact parameter minimization + +No properness of the ambient inner-product space is required. Separation of +the curve confines minimization to a compact interval in its real parameter. +-/ + +noncomputable section + +universe uE + +namespace ThompsonNonamenability.Analytic.RegularCurveData + +open Set Filter +open scoped InnerProductSpace Topology + +variable {E : Type uE} [NormedAddCommGroup E] [InnerProductSpace ℝ E] +variable (C : RegularCurveData E) + +/-- The predicate of being a global nearest parameter for the actual curve. -/ +def IsNearest (x : E) (s : ℝ) : Prop := + ∀ t : ℝ, ‖x - C.curve s‖ ≤ ‖x - C.curve t‖ + +/-- The separation estimate makes the residual strictly larger away from a +compact interval around any initial tube witness. -/ +theorem residual_gt_of_far {x : E} {s t : ℝ} + (hs : ‖x - C.curve s‖ < C.rho) (hst : (1 / 32 : ℝ) ≤ |t - s|) : + 3 * C.rho < ‖x - C.curve t‖ := by + have hsep := C.separated s t hst + have htri : ‖C.curve t - C.curve s‖ ≤ + ‖x - C.curve t‖ + ‖x - C.curve s‖ := by + calc + ‖C.curve t - C.curve s‖ ≤ + ‖C.curve t - x‖ + ‖x - C.curve s‖ := by + simpa only [dist_eq_norm] using dist_triangle (C.curve t) x (C.curve s) + _ = ‖x - C.curve t‖ + ‖x - C.curve s‖ := by + rw [norm_sub_rev (C.curve t) x] + have := C.four_rho_lt_separation + linarith + +/-- A tube point has a global nearest parameter, attained by minimizing on a +compact interval of real parameters. -/ +theorem nearest_exists (x : E) (hx : x ∈ C.tube) : + ∃ s : ℝ, C.IsNearest x s ∧ ‖x - C.curve s‖ < C.rho := by + obtain ⟨z, ⟨t₀, rfl⟩, ht₀⟩ := + (Metric.infDist_lt_iff C.range_nonempty).mp hx + have ht₀' : ‖x - C.curve t₀‖ < C.rho := by + simpa only [dist_eq_norm] using ht₀ + have ht₀mem : t₀ ∈ Icc (t₀ - 1 / 32) (t₀ + 1 / 32) := by + constructor <;> linarith + have hcont : Continuous (fun t : ℝ => ‖x - C.curve t‖) := + (continuous_const.sub C.continuous_curve).norm + obtain ⟨s, hs, hmin⟩ := isCompact_Icc.exists_isMinOn ⟨t₀, ht₀mem⟩ + hcont.continuousOn + have hsclose : ‖x - C.curve s‖ < C.rho := + lt_of_le_of_lt (hmin ht₀mem) ht₀' + refine ⟨s, ?_, hsclose⟩ + intro t + by_cases ht : t ∈ Icc (t₀ - 1 / 32) (t₀ + 1 / 32) + · exact hmin ht + · have hfar : (1 / 32 : ℝ) ≤ |t - t₀| := by + by_contra h + have hnear := abs_lt.mp (lt_of_not_ge h) + exact ht ⟨by linarith [hnear.1], by linarith [hnear.2]⟩ + have hlarge := C.residual_gt_of_far ht₀' hfar + have := C.rho_pos + linarith + +/-- Every global minimizer has exactly the distance-to-range residual. -/ +theorem nearest_norm_eq_infDist {x : E} {s : ℝ} (hs : C.IsNearest x s) : + ‖x - C.curve s‖ = Metric.infDist x (range C.curve) := by + apply le_antisymm + · apply (Metric.le_infDist C.range_nonempty).mpr + rintro y ⟨t, rfl⟩ + simpa only [dist_eq_norm] using hs t + · simpa only [dist_eq_norm] using + Metric.infDist_le_dist_of_mem (x := x) (mem_range_self s) + +/-- Differentiating the squared residual at its global minimum proves +orthogonality to the tangent. -/ +theorem nearest_perp_tangent {x : E} {s : ℝ} (hs : C.IsNearest x s) : + ⟪x - C.curve s, C.tangent s⟫_ℝ = 0 := by + have hsquare : IsMinOn (fun t : ℝ => ‖x - C.curve t‖ ^ 2) univ s := by + apply isMinOn_univ_iff.mpr + intro t + exact pow_le_pow_left₀ (norm_nonneg _) (hs t) 2 + have hlocal : IsLocalMin (fun t : ℝ => ‖x - C.curve t‖ ^ 2) s := + hsquare.isLocalMin (by simp) + have hderiv : HasDerivAt (fun t : ℝ => ‖x - C.curve t‖ ^ 2) + (2 * ⟪x - C.curve s, -C.velocity s⟫_ℝ) s := + ((C.hasDerivAt s).const_sub x).norm_sq + have hzero := hlocal.hasDerivAt_eq_zero hderiv + have hspeed : ‖C.velocity s‖ ≠ 0 := by + have := C.speed_lower s + linarith + rw [inner_neg_right, C.velocity_eq s, real_inner_smul_right] at hzero + have hproduct : ‖C.velocity s‖ * ⟪x - C.curve s, C.tangent s⟫_ℝ = 0 := by + linarith + exact (mul_eq_zero.mp hproduct).resolve_left hspeed + +end ThompsonNonamenability.Analytic.RegularCurveData + +end + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/TubeRegularCurve.lean b/lean/OAI/GroupTheory/Thompson/TubeRegularCurve.lean new file mode 100644 index 0000000000000000000000000000000000000000..d0176d877099979288c02ca856b6b7f55f257600 --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/TubeRegularCurve.lean @@ -0,0 +1,75 @@ +import Mathlib.Analysis.InnerProductSpace.Calculus +import Mathlib.Topology.MetricSpace.HausdorffDistance +import Mathlib.Tactic.Linarith +import Mathlib.Tactic.NormNum +import Mathlib.Tactic.Positivity + +namespace OAI + +noncomputable section + +universe uE + +namespace ThompsonNonamenability.Analytic + +open Set +open scoped InnerProductSpace + +variable (E : Type uE) [NormedAddCommGroup E] [InnerProductSpace ℝ E] + +/-- Differential and separation data at the fixed parameter scale `1 / 32`. -/ +structure RegularCurveData where + curve : ℝ → E + velocity : ℝ → E + tangent : ℝ → E + hasDerivAt : ∀ t, HasDerivAt curve (velocity t) t + norm_tangent : ∀ t, ‖tangent t‖ = 1 + velocity_eq : ∀ t, velocity t = ‖velocity t‖ • tangent t + speed_lower : ∀ t, (1 / 8 : ℝ) ≤ ‖velocity t‖ + velocity_lipschitz : ∀ s t, ‖velocity t - velocity s‖ ≤ |t - s| + tangent_lipschitz : ∀ s t, ‖tangent t - tangent s‖ ≤ 16 * |t - s| + separation : ℝ + separation_pos : 0 < separation + separated : ∀ s t, (1 / 32 : ℝ) ≤ |t - s| → + separation ≤ ‖curve t - curve s‖ + +variable {E} + +namespace RegularCurveData + +variable (C : RegularCurveData E) + +theorem continuous_curve : Continuous C.curve := + continuous_iff_continuousAt.mpr fun t => (C.hasDerivAt t).continuousAt + +/-- A radius with slack in both the separation and curvature estimates. -/ +def rho : ℝ := min (1 / 1024) (C.separation / 8) + +theorem rho_pos : 0 < C.rho := by + exact lt_min (by norm_num) (div_pos C.separation_pos (by norm_num)) + +theorem rho_le : C.rho ≤ 1 / 1024 := min_le_left _ _ + +theorem rho_le_separation : C.rho ≤ C.separation / 8 := min_le_right _ _ + +theorem four_rho_lt_separation : 4 * C.rho < C.separation := by + have := C.rho_le_separation + have := C.separation_pos + linarith + +theorem tangent_error_small : C.rho * 16 < 1 / 32 := by + have := C.rho_le + linarith + +/-- The actual open metric tube around the range of the curve. -/ +def tube : Set E := {x | Metric.infDist x (range C.curve) < C.rho} + +theorem range_nonempty : (range C.curve).Nonempty := ⟨C.curve 0, mem_range_self 0⟩ + +end RegularCurveData + +end ThompsonNonamenability.Analytic + +end + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/TubeTangent.lean b/lean/OAI/GroupTheory/Thompson/TubeTangent.lean new file mode 100644 index 0000000000000000000000000000000000000000..f778a37731a8199e90009e1e3f720c031202dce2 --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/TubeTangent.lean @@ -0,0 +1,102 @@ +import OAI.GroupTheory.Thompson.TubeRegularCurve +import Mathlib.Analysis.Calculus.Deriv.MeanValue + +namespace OAI + +/-! +# A quantitative lower bound for tangent projections + +On a parameter interval of length at most `1 / 32`, the velocity has inner +product at least `3 / 32` with the tangent at either prescribed endpoint. +The scalar mean value theorem then bounds the projected chord from below. +-/ + +noncomputable section + +universe uE + +namespace ThompsonNonamenability.Analytic + +open Set +open scoped InnerProductSpace + +variable {E : Type uE} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + +namespace RegularCurveData + +variable (C : RegularCurveData E) + +theorem velocity_inner_tangent (s : ℝ) : + inner (𝕜 := ℝ) (C.velocity s) (C.tangent s) = ‖C.velocity s‖ := by + calc + inner (𝕜 := ℝ) (C.velocity s) (C.tangent s) = + inner (𝕜 := ℝ) (‖C.velocity s‖ • C.tangent s) (C.tangent s) := + congrArg (fun v => inner (𝕜 := ℝ) v (C.tangent s)) (C.velocity_eq s) + _ = ‖C.velocity s‖ := by + rw [real_inner_smul_left, real_inner_self_eq_norm_sq, C.norm_tangent] + simp + +/-- The derivative of projection onto the fixed tangent at `s` stays positive +throughout the prescribed parameter scale. -/ +theorem velocity_tangent_lower (s t : ℝ) (hst : |t - s| ≤ 1 / 32) : + (3 / 32 : ℝ) ≤ inner (𝕜 := ℝ) (C.velocity t) (C.tangent s) := by + have hinner := abs_real_inner_le_norm (C.velocity t - C.velocity s) (C.tangent s) + rw [C.norm_tangent, mul_one, inner_sub_left, C.velocity_inner_tangent] at hinner + have herror : |inner (𝕜 := ℝ) (C.velocity t) (C.tangent s) - ‖C.velocity s‖| ≤ + |t - s| := hinner.trans (C.velocity_lipschitz s t) + have hlo := (abs_le.mp herror).1 + have hspeed := C.speed_lower s + linarith + +/-- The chord's projection onto the tangent at its first parameter controls +parameter distance. The tangent remains fixed at `s` for either order of `s` +and `t`. -/ +theorem tangent_projection_lower (s t : ℝ) (hst : |t - s| ≤ 1 / 32) : + (3 / 32 : ℝ) * |t - s| ≤ + |inner (𝕜 := ℝ) (C.curve t - C.curve s) (C.tangent s)| := by + let f : ℝ → ℝ := fun u => inner (𝕜 := ℝ) (C.curve u) (C.tangent s) + let f' : ℝ → ℝ := fun u => inner (𝕜 := ℝ) (C.velocity u) (C.tangent s) + have hf : ∀ u, HasDerivAt f (f' u) u := by + intro u + simpa only [f, f', inner_zero_right, zero_add] using + (C.hasDerivAt u).inner ℝ (hasDerivAt_const u (C.tangent s)) + have hfc : Continuous f := + continuous_iff_continuousAt.mpr fun u => (hf u).continuousAt + rw [inner_sub_left] + change (3 / 32 : ℝ) * |t - s| ≤ |f t - f s| + rcases lt_trichotomy s t with hlt | heq | hlt + · obtain ⟨u, hu, hdu⟩ := + exists_hasDerivAt_eq_slope f f' hlt hfc.continuousOn (fun u _ => hf u) + have hus : |u - s| ≤ 1 / 32 := by + apply abs_le.mpr + constructor <;> linarith [(abs_le.mp hst).1, (abs_le.mp hst).2, hu.1, hu.2] + have hlo : (3 / 32 : ℝ) ≤ f' u := C.velocity_tangent_lower s u hus + rw [hdu] at hlo + have hgrow : (3 / 32 : ℝ) * (t - s) ≤ f t - f s := + (le_div_iff₀ (sub_pos.mpr hlt)).mp hlo + rw [abs_of_nonneg (sub_nonneg.mpr hlt.le)] + exact hgrow.trans (le_abs_self _) + · subst t + simp + · obtain ⟨u, hu, hdu⟩ := + exists_hasDerivAt_eq_slope f f' hlt hfc.continuousOn (fun u _ => hf u) + have hus : |u - s| ≤ 1 / 32 := by + apply abs_le.mpr + constructor <;> linarith [(abs_le.mp hst).1, (abs_le.mp hst).2, hu.1, hu.2] + have hlo : (3 / 32 : ℝ) ≤ f' u := C.velocity_tangent_lower s u hus + rw [hdu] at hlo + have hgrow : (3 / 32 : ℝ) * (s - t) ≤ f s - f t := + (le_div_iff₀ (sub_pos.mpr hlt)).mp hlo + rw [abs_sub_comm t s, abs_of_nonneg (sub_nonneg.mpr hlt.le)] + refine hgrow.trans ?_ + calc + f s - f t = -(f t - f s) := (neg_sub _ _).symm + _ ≤ |f t - f s| := neg_le_abs _ + +end RegularCurveData + +end ThompsonNonamenability.Analytic + +end + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/UniformPL.lean b/lean/OAI/GroupTheory/Thompson/UniformPL.lean new file mode 100644 index 0000000000000000000000000000000000000000..fb2a78723186dfb0937a9f4c169fdc3890d8c340 --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/UniformPL.lean @@ -0,0 +1,212 @@ +import OAI.GroupTheory.Thompson.StandardPL +import OAI.GroupTheory.Thompson.UniformPartition +import Mathlib.Tactic.Linarith +import Mathlib.Tactic.NormNum +import Mathlib.Tactic.Ring + +namespace OAI + +/-! +# Resolving a finite dyadic PL subdivision on a uniform grid + +All original knots lie on a sufficiently fine dyadic grid. Such a knot +cannot lie strictly between consecutive grid points. The source piece +containing a cell's midpoint therefore contains the whole closed cell. +-/ + +noncomputable section + +namespace ThompsonNonamenability + +open BasicPartition + +/-- A point on the closed depth-`n` dyadic grid, including both endpoints. -/ +def uniformDyadicPoint (n : ℕ) (j : Fin (2 ^ n + 1)) : UnitInterval := + ⟨(j.val : ℝ) / (2 : ℝ) ^ n, by + constructor + · exact div_nonneg (Nat.cast_nonneg _) (le_of_lt (pow_pos (by norm_num) n)) + · apply (div_le_one (pow_pos (by norm_num : (0 : ℝ) < 2) n)).mpr + exact_mod_cast Nat.le_of_lt_succ j.isLt⟩ + +@[simp] theorem coe_uniformDyadicPoint (n : ℕ) (j : Fin (2 ^ n + 1)) : + (uniformDyadicPoint n j : ℝ) = (j.val : ℝ) / (2 : ℝ) ^ n := rfl + +@[simp] theorem uniformDyadicPoint_castSucc_coe (n : ℕ) (k : Fin (2 ^ n)) : + (uniformDyadicPoint n k.castSucc : ℝ) = (uniformCell n k).left := rfl + +@[simp] theorem uniformDyadicPoint_succ_coe (n : ℕ) (k : Fin (2 ^ n)) : + (uniformDyadicPoint n k.succ : ℝ) = (uniformCell n k).right := by + change (((k.val + 1 : ℕ) : ℝ) / (2 : ℝ) ^ n) = + ((k.val : ℝ) + 1) / (2 : ℝ) ^ n + simp only [Nat.cast_add, Nat.cast_one] + +theorem uniformDyadicPoint_strictMono (n : ℕ) : StrictMono (uniformDyadicPoint n) := by + intro i j hij + change (i.val : ℝ) / (2 : ℝ) ^ n < (j.val : ℝ) / (2 : ℝ) ^ n + apply (div_lt_div_iff_of_pos_right (pow_pos (by norm_num : (0 : ℝ) < 2) n)).mpr + have hij' : i.val < j.val := hij + exact_mod_cast hij' + +@[simp] theorem uniformDyadicPoint_zero (n : ℕ) : + uniformDyadicPoint n 0 = unitIntervalZero := by + apply Subtype.ext + simp + +@[simp] theorem uniformDyadicPoint_last (n : ℕ) : + uniformDyadicPoint n (Fin.last (2 ^ n)) = unitIntervalOne := by + apply Subtype.ext + simp [Fin.val_last] + +theorem uniformDyadicPoint_dyadic (n : ℕ) (j : Fin (2 ^ n + 1)) : + IsDyadic (uniformDyadicPoint n j : ℝ) := by + exact ⟨(j.val : ℤ), n, by simp⟩ + +/-- There is no grid point strictly between consecutive grid points. -/ +theorem grid_point_not_inside_uniform_cell (n : ℕ) (k : Fin (2 ^ n)) (j : ℤ) : + ¬ ((uniformCell n k).left < (j : ℝ) / (2 : ℝ) ^ n ∧ + (j : ℝ) / (2 : ℝ) ^ n < (uniformCell n k).right) := by + intro h + have hd : (0 : ℝ) < (2 : ℝ) ^ n := pow_pos (by norm_num) n + change (k.val : ℝ) / (2 : ℝ) ^ n < (j : ℝ) / (2 : ℝ) ^ n ∧ + (j : ℝ) / (2 : ℝ) ^ n < ((k.val : ℝ) + 1) / (2 : ℝ) ^ n at h + have hleft : (k.val : ℤ) < j := by + exact_mod_cast (div_lt_div_iff_of_pos_right hd).mp h.1 + have hright : j < (k.val : ℤ) + 1 := by + exact_mod_cast (div_lt_div_iff_of_pos_right hd).mp h.2 + exact (not_lt_of_ge (Int.add_one_le_iff.mpr hleft)) hright + +namespace DyadicPLWitness + +/-- A single grid depth resolves every knot of the original subdivision. +At all larger depths each closed grid cell lies in one original piece. -/ +theorem eventually_uniform_refines {f : IntervalHomeomorph} (w : DyadicPLWitness f) : + ∃ N : ℕ, ∀ n : ℕ, N ≤ n → ∀ k : Fin (2 ^ n), + ∃ i : Fin w.pieceCount, + w.knots i.castSucc ≤ uniformDyadicPoint n k.castSucc ∧ + uniformDyadicPoint n k.succ ≤ w.knots i.succ := by + classical + obtain ⟨N, hN⟩ := dyadic_common_denominator_finset + (Finset.univ : Finset (Fin (w.pieceCount + 1))) + (fun j => (w.knots j : ℝ)) (fun j _ => w.dyadic j) + refine ⟨N, ?_⟩ + intro n hn k + let I := uniformCell n k + have hlen : I.left < I.right := I.left_lt_right + let m : UnitInterval := ⟨(I.left + I.right) / 2, by + constructor <;> linarith [I.left_nonneg, I.right_le_one]⟩ + have hml : I.left < (m : ℝ) := by dsimp [m]; linarith + have hmr : (m : ℝ) < I.right := by dsimp [m]; linarith + obtain ⟨i, hil, hir⟩ := w.cover m + have hilR : (w.knots i.castSucc : ℝ) ≤ (m : ℝ) := hil + have hirR : (m : ℝ) ≤ (w.knots i.succ : ℝ) := hir + have hno (j : Fin (w.pieceCount + 1)) : + ¬ (I.left < (w.knots j : ℝ) ∧ (w.knots j : ℝ) < I.right) := by + obtain ⟨a, ha⟩ := dyadic_denominator_mono (hN j (Finset.mem_univ j)) hn + rw [ha] + exact grid_point_not_inside_uniform_cell n k a + refine ⟨i, ?_, ?_⟩ + · change (w.knots i.castSucc : ℝ) ≤ (uniformDyadicPoint n k.castSucc : ℝ) + rw [uniformDyadicPoint_castSucc_coe] + change (w.knots i.castSucc : ℝ) ≤ I.left + apply le_of_not_gt + intro h + exact hno i.castSucc ⟨h, lt_of_le_of_lt hilR hmr⟩ + · change (uniformDyadicPoint n k.succ : ℝ) ≤ (w.knots i.succ : ℝ) + rw [uniformDyadicPoint_succ_coe] + change I.right ≤ (w.knots i.succ : ℝ) + apply le_of_not_gt + intro h + exact hno i.succ ⟨lt_of_lt_of_le hml hirR, h⟩ + +end DyadicPLWitness + +/-- A genuine affine formula on every closed cell of one uniform subdivision. -/ +structure UniformDyadicPLWitness (f : IntervalHomeomorph) (n : ℕ) where + exponent : Fin (2 ^ n) → ℤ + affine : ∀ (k : Fin (2 ^ n)) (x : UnitInterval), + (uniformCell n k).left ≤ (x : ℝ) → (x : ℝ) ≤ (uniformCell n k).right → + (f x : ℝ) = (f (uniformDyadicPoint n k.castSucc) : ℝ) + + (2 : ℝ) ^ exponent k * ((x : ℝ) - (uniformCell n k).left) + +namespace DyadicPLWitness + +/-- Restricting an original affine piece to a contained grid cell preserves +its exact exponent; the translation is rebased at the new left endpoint. -/ +def uniformOfRefines {f : IntervalHomeomorph} (w : DyadicPLWitness f) (n : ℕ) + (hr : ∀ k : Fin (2 ^ n), ∃ i : Fin w.pieceCount, + w.knots i.castSucc ≤ uniformDyadicPoint n k.castSucc ∧ + uniformDyadicPoint n k.succ ≤ w.knots i.succ) : UniformDyadicPLWitness f n where + exponent k := w.exponent (Classical.choose (hr k)) + affine := by + intro k x hleft hright + let i := Classical.choose (hr k) + have hi := Classical.choose_spec (hr k) + have hxl : w.knots i.castSucc ≤ x := by + apply hi.1.trans + change (uniformDyadicPoint n k.castSucc : ℝ) ≤ (x : ℝ) + simpa only [uniformDyadicPoint_castSucc_coe] using hleft + have hxr : x ≤ w.knots i.succ := by + apply le_trans _ hi.2 + change (x : ℝ) ≤ (uniformDyadicPoint n k.succ : ℝ) + simpa only [uniformDyadicPoint_succ_coe] using hright + have hcell : uniformDyadicPoint n k.castSucc ≤ uniformDyadicPoint n k.succ := by + apply (uniformDyadicPoint_strictMono n).monotone + exact (Fin.castSucc_lt_succ_iff.mpr le_rfl).le + have hx := w.affine i x hxl hxr + have hb := w.affine i (uniformDyadicPoint n k.castSucc) hi.1 (hcell.trans hi.2) + rw [hx, hb, uniformDyadicPoint_castSucc_coe] + ring + +theorem eventually_uniform_affine {f : IntervalHomeomorph} (w : DyadicPLWitness f) : + ∃ N : ℕ, ∀ n : ℕ, N ≤ n → Nonempty (UniformDyadicPLWitness f n) := by + obtain ⟨N, hN⟩ := w.eventually_uniform_refines + exact ⟨N, fun n hn => ⟨w.uniformOfRefines n (hN n hn)⟩⟩ + +end DyadicPLWitness + +namespace UniformDyadicPLWitness + +/-- Uniform affine data is an ordinary finite dyadic PL subdivision. -/ +def toDyadicPLWitness {f : IntervalHomeomorph} {n : ℕ} + (w : UniformDyadicPLWitness f n) : DyadicPLWitness f where + pieceCount := 2 ^ n + positive := pow_pos (by decide) n + knots := uniformDyadicPoint n + strictMono_knots := uniformDyadicPoint_strictMono n + first := uniformDyadicPoint_zero n + last := uniformDyadicPoint_last n + dyadic := uniformDyadicPoint_dyadic n + cover := by + intro x + obtain ⟨I, hI, hx⟩ := uniformCells_cover n (x : ℝ) x.property + obtain ⟨k, rfl⟩ := mem_uniformCells.mp hI + refine ⟨k, ?_, ?_⟩ + · change (uniformDyadicPoint n k.castSucc : ℝ) ≤ (x : ℝ) + simpa only [uniformDyadicPoint_castSucc_coe] using hx.1 + · change (x : ℝ) ≤ (uniformDyadicPoint n k.succ : ℝ) + simpa only [uniformDyadicPoint_succ_coe] using hx.2 + exponent := w.exponent + affine := by + intro k x hleft hright + change (uniformDyadicPoint n k.castSucc : ℝ) ≤ (x : ℝ) at hleft + change (x : ℝ) ≤ (uniformDyadicPoint n k.succ : ℝ) at hright + rw [uniformDyadicPoint_castSucc_coe] at hleft + rw [uniformDyadicPoint_succ_coe] at hright + simpa only [uniformDyadicPoint_castSucc_coe] using w.affine k x hleft hright + +end UniformDyadicPLWitness + +theorem hasDyadicPLPieces_iff_uniform {f : IntervalHomeomorph} : + HasDyadicPLPieces f ↔ ∃ n : ℕ, Nonempty (UniformDyadicPLWitness f n) := by + constructor + · rintro ⟨w⟩ + obtain ⟨N, hN⟩ := w.eventually_uniform_affine + exact ⟨N, hN N le_rfl⟩ + · rintro ⟨n, ⟨w⟩⟩ + exact ⟨w.toDyadicPLWitness⟩ + +end ThompsonNonamenability + +end + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/UniformPartition.lean b/lean/OAI/GroupTheory/Thompson/UniformPartition.lean new file mode 100644 index 0000000000000000000000000000000000000000..dc4d73cd68454b2f35e2b2ffb1cdc5bc975e9a3e --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/UniformPartition.lean @@ -0,0 +1,157 @@ +import OAI.GroupTheory.Thompson.BasicPartition +import Mathlib.Data.Fintype.Card +import Mathlib.Algebra.Order.Archimedean.Real.Basic +import Mathlib.Tactic.Linarith +import Mathlib.Tactic.NormNum + +namespace OAI + +/-! +# Uniform dyadic partitions + +The depth-`n` partition consists of all `2^n` basic intervals at that depth. +Coverage includes both endpoints of the unit interval. Distinct cells have +disjoint open interiors; their closed carriers may share an endpoint. +-/ + +noncomputable section + +namespace ThompsonNonamenability.BasicPartition + +open Set + +/-- The cell with index `k` in the depth-`n` uniform dyadic partition. -/ +def uniformCell (n : ℕ) (k : Fin (2 ^ n)) : BasicInterval := + ⟨n, k⟩ + +@[simp] theorem uniformCell_depth (n : ℕ) (k : Fin (2 ^ n)) : + (uniformCell n k).depth = n := rfl + +@[simp] theorem uniformCell_index (n : ℕ) (k : Fin (2 ^ n)) : + (uniformCell n k).index = k := rfl + +theorem uniformCell_injective (n : ℕ) : Function.Injective (uniformCell n) := by + intro i j h + apply Fin.ext + exact congrArg (fun I : BasicInterval => I.index.val) h + +/-- All cells at depth `n`, with no repeated intervals. -/ +def uniformCells (n : ℕ) : Finset BasicInterval := + Finset.univ.map ⟨uniformCell n, uniformCell_injective n⟩ + +theorem mem_uniformCells {n : ℕ} {I : BasicInterval} : + I ∈ uniformCells n ↔ ∃ k : Fin (2 ^ n), uniformCell n k = I := by + simp [uniformCells] + +@[simp] theorem uniformCell_mem_uniformCells (n : ℕ) (k : Fin (2 ^ n)) : + uniformCell n k ∈ uniformCells n := + mem_uniformCells.mpr ⟨k, rfl⟩ + +@[simp] theorem card_uniformCells (n : ℕ) : (uniformCells n).card = 2 ^ n := by + simp [uniformCells] + +/-- At a fixed depth, the interiors of distinct cells are disjoint. -/ +theorem uniformCell_disjoint {n : ℕ} {i j : Fin (2 ^ n)} (hij : i ≠ j) : + Disjoint (uniformCell n i).interior (uniformCell n j).interior := by + apply Set.disjoint_left.mpr + intro x hx hy + change (i.val : ℝ) / (2 : ℝ) ^ n < x ∧ + x < ((i.val : ℝ) + 1) / (2 : ℝ) ^ n at hx + change (j.val : ℝ) / (2 : ℝ) ^ n < x ∧ + x < ((j.val : ℝ) + 1) / (2 : ℝ) ^ n at hy + have hd : 0 < (2 : ℝ) ^ n := pow_pos (by norm_num) n + have hval : i.val ≠ j.val := fun h => hij (Fin.ext h) + rcases lt_or_gt_of_ne hval with hlt | hlt + · have hstep : (i.val : ℝ) + 1 ≤ (j.val : ℝ) := by + exact_mod_cast Nat.succ_le_of_lt hlt + have hsep : ((i.val : ℝ) + 1) / (2 : ℝ) ^ n ≤ + (j.val : ℝ) / (2 : ℝ) ^ n := + (div_le_div_iff_of_pos_right hd).mpr hstep + exact (not_lt_of_ge hsep) (lt_trans hy.1 hx.2) + · have hstep : (j.val : ℝ) + 1 ≤ (i.val : ℝ) := by + exact_mod_cast Nat.succ_le_of_lt hlt + have hsep : ((j.val : ℝ) + 1) / (2 : ℝ) ^ n ≤ + (i.val : ℝ) / (2 : ℝ) ^ n := + (div_le_div_iff_of_pos_right hd).mpr hstep + exact (not_lt_of_ge hsep) (lt_trans hx.1 hy.2) + +/-- Every point of `[0,1]` lies in one of the closed depth-`n` cells. -/ +theorem uniformCells_cover (n : ℕ) (x : ℝ) (hx : x ∈ Icc (0 : ℝ) 1) : + ∃ I ∈ uniformCells n, x ∈ I.carrier := by + have hnat : 0 < (2 : ℕ) ^ n := pow_pos (by decide) n + have hd : 0 < (2 : ℝ) ^ n := pow_pos (by norm_num) n + by_cases hx1 : x = 1 + · subst x + have hk : 2 ^ n - 1 < 2 ^ n := Nat.sub_lt hnat (by decide) + let k : Fin (2 ^ n) := ⟨2 ^ n - 1, hk⟩ + refine ⟨uniformCell n k, uniformCell_mem_uniformCells n k, ?_⟩ + change ((2 ^ n - 1 : ℕ) : ℝ) / (2 : ℝ) ^ n ≤ 1 ∧ + 1 ≤ (((2 ^ n - 1 : ℕ) : ℝ) + 1) / (2 : ℝ) ^ n + have hsucc : (2 ^ n - 1 : ℕ) + 1 = 2 ^ n := + Nat.sub_add_cancel hnat + have hcast : (((2 ^ n - 1 : ℕ) : ℝ) + 1) = (2 : ℝ) ^ n := by + exact_mod_cast hsucc + constructor + · apply (div_le_iff₀ hd).mpr + linarith + · rw [hcast, div_self (ne_of_gt hd)] + · have hlt : x < 1 := lt_of_le_of_ne hx.2 hx1 + have hxD : 0 ≤ x * (2 : ℝ) ^ n := mul_nonneg hx.1 hd.le + have hbound : x * (2 : ℝ) ^ n < ((2 ^ n : ℕ) : ℝ) := by + simpa using (mul_lt_mul_of_pos_right hlt hd) + have hk : ⌊x * (2 : ℝ) ^ n⌋₊ < 2 ^ n := + (Nat.floor_lt hxD).mpr hbound + let k : Fin (2 ^ n) := ⟨⌊x * (2 : ℝ) ^ n⌋₊, hk⟩ + refine ⟨uniformCell n k, uniformCell_mem_uniformCells n k, ?_⟩ + change (⌊x * (2 : ℝ) ^ n⌋₊ : ℝ) / (2 : ℝ) ^ n ≤ x ∧ + x ≤ ((⌊x * (2 : ℝ) ^ n⌋₊ : ℝ) + 1) / (2 : ℝ) ^ n + constructor + · exact (div_le_iff₀ hd).mpr (Nat.floor_le hxD) + · exact (le_div_iff₀ hd).mpr (Nat.lt_floor_add_one _).le + +/-- The genuine partition into all depth-`n` dyadic cells. -/ +def uniform (n : ℕ) : BasicPartition where + cells := uniformCells n + cover := uniformCells_cover n + disjoint := by + intro I hI J hJ hIJ + obtain ⟨i, rfl⟩ := mem_uniformCells.mp hI + obtain ⟨j, rfl⟩ := mem_uniformCells.mp hJ + apply uniformCell_disjoint + intro hij + exact hIJ (congrArg (uniformCell n) hij) + +@[simp] theorem uniform_cells (n : ℕ) : (uniform n).cells = uniformCells n := rfl + +@[simp] theorem uniform_cellCount (n : ℕ) : (uniform n).cellCount = 2 ^ n := by + exact card_uniformCells n + +@[simp] theorem uniformCell_length (n : ℕ) (k : Fin (2 ^ n)) : + (uniformCell n k).length = ((2 : ℝ) ^ n)⁻¹ := rfl + +theorem uniform_depth {n : ℕ} {I : BasicInterval} (hI : I ∈ (uniform n).cells) : + I.depth = n := by + obtain ⟨k, rfl⟩ := mem_uniformCells.mp hI + rfl + +/-- All cells in the uniform partition have the same positive length. -/ +theorem uniform_length {n : ℕ} {I : BasicInterval} (hI : I ∈ (uniform n).cells) : + I.length = ((2 : ℝ) ^ n)⁻¹ := by + obtain ⟨k, rfl⟩ := mem_uniformCells.mp hI + rfl + +/-- A uniform grid respects every basic interval resolved at its depth. -/ +theorem uniform_respects_of_depth_le (n : ℕ) (I : BasicInterval) + (hI : I.depth ≤ n) : (uniform n).Respects I := by + apply ((uniform n).respects_iff I).mpr + intro K hK hmeet + apply BasicInterval.contained_of_overlap_of_depth_le + · rw [uniform_depth hK] + exact hI + · simpa only [Set.inter_comm] using hmeet + +end ThompsonNonamenability.BasicPartition + +end + +end OAI diff --git a/lean/OAI/GroupTheory/Thompson/UnitBall.lean b/lean/OAI/GroupTheory/Thompson/UnitBall.lean new file mode 100644 index 0000000000000000000000000000000000000000..3a65a267f654215a23ddec535b2d22bfda0c5e8a --- /dev/null +++ b/lean/OAI/GroupTheory/Thompson/UnitBall.lean @@ -0,0 +1,22 @@ +import Mathlib.Analysis.InnerProductSpace.Basic + +namespace OAI + +universe uE + +namespace ThompsonNonamenability + +abbrev UnitBall (E : Type uE) [SeminormedAddCommGroup E] := {x : E // ‖x‖ ≤ 1} + +def unitBallZero (E : Type uE) [SeminormedAddCommGroup E] : UnitBall E := + ⟨0, by simp⟩ + +@[simp] theorem coe_unitBallZero (E : Type uE) [SeminormedAddCommGroup E] : + (unitBallZero E : E) = 0 := rfl + +theorem unitBall_norm_le {E : Type uE} [SeminormedAddCommGroup E] (x : UnitBall E) : + ‖(x : E)‖ ≤ 1 := x.property + +end ThompsonNonamenability + +end OAI diff --git a/lean/OAI/GroupTheory/UniversalGroup/AscendingTorus.lean b/lean/OAI/GroupTheory/UniversalGroup/AscendingTorus.lean new file mode 100644 index 0000000000000000000000000000000000000000..ffbb96813cb604c10d9e1c05829baa84cbb7f3ee --- /dev/null +++ b/lean/OAI/GroupTheory/UniversalGroup/AscendingTorus.lean @@ -0,0 +1,448 @@ +import OAI.GroupTheory.UniversalGroup.GraphActions + +namespace OAI + +open Set Metric Topology BigOperators +open Set Metric Topology +open Set Topology +open Set Metric Topology +open scoped NNReal +open Set Metric Topology +open scoped NNReal ENNReal +open Set Metric Topology +open scoped TensorProduct + +namespace UniversalFInfinity.AscendingTorus + +section + +open Monoid Coprod Multiplicative +universe u v w +variable {U : Type u} [Group U] + +abbrev Free (U : Type u) [Group U] := U ∗ Multiplicative ℤ + +def letter : Free U := inr (ofAdd 1) + +def relation (f : Monoid.End U) (x : U) : Free U := + (inl x * letter) * (letter * inl (f x))⁻¹ + +def relations (f : Monoid.End U) : Subgroup (Free U) := + Subgroup.normalClosure (Set.range (relation f)) + +instance (f : Monoid.End U) : (relations f).Normal := inferInstanceAs + (Subgroup.normalClosure (Set.range (relation f))).Normal + +def Torus (f : Monoid.End U) := Free U ⧸ relations f + +instance (f : Monoid.End U) : Group (Torus f) := by + delta Torus + infer_instance + +instance groupOfHom (f : U →* U) : Group (Torus f) := instGroupTorus f + +def of (f : Monoid.End U) : U →* Torus f := + (QuotientGroup.mk' (relations f)).comp inl + +def stable (f : Monoid.End U) : Torus f := + QuotientGroup.mk' (relations f) letter + +lemma of_mul_stable (f : Monoid.End U) (x : U) : + of f x * stable f = stable f * of f (f x) := by + apply mul_inv_eq_one.mp + change QuotientGroup.mk' (relations f) (relation f x) = 1 + exact (QuotientGroup.eq_one_iff _).mpr (Subgroup.subset_normalClosure ⟨x,rfl⟩) + +lemma stable_conjugate (f : Monoid.End U) (x : U) : + stable f * of f (f x) * (stable f)⁻¹ = of f x := by + rw [← of_mul_stable, mul_inv_cancel_right] + +lemma inverse_conjugate (f : Monoid.End U) (x : U) : + (stable f)⁻¹ * of f x * stable f = of f (f x) := by + rw [mul_assoc, of_mul_stable, inv_mul_cancel_left] + +variable {V : Type v} [Group V] + +def lift (f : Monoid.End U) (φ : U →* V) (t : V) + (h : ∀ x, φ x * t = t * φ (f x)) : Torus f →* V := + QuotientGroup.lift (relations f) (Coprod.lift φ (zpowersHom V t)) (by + apply Subgroup.normalClosure_le_normal + rintro _ ⟨x,rfl⟩ + change Coprod.lift φ (zpowersHom V t) (relation f x) = 1 + simp only [relation, letter, map_mul, map_inv, Coprod.lift_apply_inl, Coprod.lift_apply_inr, + zpowersHom_apply, toAdd_ofAdd, zpow_one] + rw [h x, mul_inv_cancel]) + +@[simp] lemma lift_of (f : Monoid.End U) (φ : U →* V) (t : V) + (h : ∀ x, φ x * t = t * φ (f x)) (x : U) : + lift f φ t h (of f x) = φ x := by + change Coprod.lift φ (zpowersHom V t) (inl x) = _ + simp + +@[simp] lemma lift_stable (f : Monoid.End U) (φ : U →* V) (t : V) + (h : ∀ x, φ x * t = t * φ (f x)) : + lift f φ t h (stable f) = t := by + change Coprod.lift φ (zpowersHom V t) (inr (ofAdd 1)) = _ + simp + +@[ext] lemma hom_ext {f : Monoid.End U} {φ ψ : Torus f →* V} + (ho : φ.comp (of f) = ψ.comp (of f)) (ht : φ (stable f) = ψ (stable f)) : + φ = ψ := by + apply (MonoidHom.cancel_right (QuotientGroup.mk'_surjective (relations f))).mp + apply Coprod.hom_ext ho + exact MonoidHom.ext_mint ht + +theorem of_injective (f : Monoid.End U) (hf : Function.Injective f) : + Function.Injective (of f) := by + let e : (⊤ : Subgroup U) ≃* f.range := + (Subgroup.topEquiv).trans (MonoidHom.ofInjective hf) + let H := HNNExtension U ⊤ f.range e + let j : U →* H := HNNExtension.of + let s : H := HNNExtension.t + have hs (x : U) : j x * s⁻¹ = s⁻¹ * j (f x) := by + exact HNNExtension.of_mul_inv_t (⟨x,Subgroup.mem_top x⟩ : (⊤ : Subgroup U)) + let Φ : Torus f →* H := lift f j s⁻¹ hs + intro x y hxy + apply HNNExtension.of_injective (A := ⊤) (B := f.range) (φ := e) + exact (lift_of f j s⁻¹ hs x).symm.trans + ((congrArg Φ hxy).trans (lift_of f j s⁻¹ hs y)) + +section Factorization +variable {P : Type v} [Group P] (a : U →* P) (b : P →* U) + +def forward : Torus (b.comp a) →* Torus (a.comp b) := + lift (b.comp a) ((of (a.comp b)).comp a) (stable (a.comp b)) + (fun x => of_mul_stable (a.comp b) (a x)) + +def backward : Torus (a.comp b) →* Torus (b.comp a) := + lift (a.comp b) + ((MulAut.conj (stable (b.comp a))).toMonoidHom.comp ((of (b.comp a)).comp b)) + (stable (b.comp a)) (by + intro p + change (stable (b.comp a) * of (b.comp a) (b p) * (stable (b.comp a))⁻¹) * + stable (b.comp a) = stable (b.comp a) * + (stable (b.comp a) * of (b.comp a) ((b.comp a) (b p)) * (stable (b.comp a))⁻¹) + exact (inv_mul_cancel_right _ _).trans + (congrArg (stable (b.comp a) * ·) (stable_conjugate (b.comp a) (b p)).symm)) + +@[simp] lemma forward_of (x : U) : + forward a b (of (b.comp a) x) = of (a.comp b) (a x) := + lift_of _ _ _ _ x + +@[simp] lemma forward_stable : + forward a b (stable (b.comp a)) = stable (a.comp b) := lift_stable _ _ _ _ + +@[simp] lemma backward_of (p : P) : + backward a b (of (a.comp b) p) = + stable (b.comp a) * of (b.comp a) (b p) * (stable (b.comp a))⁻¹ := + lift_of _ _ _ _ p + +@[simp] lemma backward_stable : + backward a b (stable (a.comp b)) = stable (b.comp a) := lift_stable _ _ _ _ + +lemma backward_forward : (backward a b).comp (forward a b) = MonoidHom.id _ := by + apply hom_ext + · ext x + simp only [MonoidHom.comp_apply, forward_of, backward_of, MonoidHom.id_apply] + exact stable_conjugate (b.comp a) x + · simp + +lemma forward_backward : (forward a b).comp (backward a b) = MonoidHom.id _ := by + apply hom_ext + · ext p + simp only [MonoidHom.comp_apply, backward_of, map_mul, map_inv, forward_stable, + forward_of, MonoidHom.id_apply] + exact stable_conjugate (a.comp b) p + · simp + +def cyclicFactorization : Torus (b.comp a) ≃* Torus (a.comp b) := + { forward a b with + invFun := backward a b + left_inv := fun x => DFunLike.congr_fun (backward_forward a b) x + right_inv := fun x => DFunLike.congr_fun (forward_backward a b) x } + +end Factorization + +lemma relations_finitelyNormallyGenerated [Group.FG U] (f : Monoid.End U) : + (relations f).IsFinitelyNormallyGenerated := by + classical + obtain ⟨S,hS⟩ := (Group.FG.out : (⊤ : Subgroup U).FG) + let N : Subgroup (Free U) := Subgroup.normalClosure (relation f '' (S : Set U)) + let Q := Free U ⧸ N + let q : Free U →* Q := QuotientGroup.mk' N + let t : Q := q letter + let i : U →* Q := q.comp inl + let j : U →* Q := (MulAut.conj t).toMonoidHom.comp (i.comp f) + let E : Subgroup U := + { carrier := {x | i x = j x} + one_mem' := by simp only [Set.mem_ofPred_eq,map_one] + mul_mem' := by + intro x y hx hy + change i (x*y) = j (x*y) + rw [map_mul,map_mul,hx,hy] + inv_mem' := by + intro x hx + change i x⁻¹ = j x⁻¹ + rw [map_inv,map_inv,hx] } + have hSsub : (S : Set U) ⊆ E := by + intro x hx + have hw : q (relation f x) = 1 := + (QuotientGroup.eq_one_iff _).mpr (Subgroup.subset_normalClosure ⟨x,hx,rfl⟩) + have he : i x * t = t * i (f x) := by + apply mul_inv_eq_one.mp + exact hw + change i x = t * i (f x) * t⁻¹ + rw [← he,mul_inv_cancel_right] + have htop : (⊤ : Subgroup U) ≤ E := by + rw [← hS] + exact (Subgroup.closure_le _).mpr hSsub + have he (x : U) : i x = t * i (f x) * t⁻¹ := htop (Subgroup.mem_top x) + refine ⟨relation f '' (S : Set U), S.finite_toSet.image _, ?_⟩ + apply le_antisymm + · apply Subgroup.normalClosure_mono + rintro _ ⟨x,_,rfl⟩ + exact ⟨x,rfl⟩ + · apply Subgroup.normalClosure_le_normal + rintro _ ⟨x,rfl⟩ + apply (QuotientGroup.eq_one_iff _).mp + change (i x * t) * (t * i (f x))⁻¹ = 1 + rw [mul_inv_eq_one] + rw [he x,inv_mul_cancel_right] + +instance finitelyPresented [Group.IsFinitelyPresented U] (f : Monoid.End U) : + Group.IsFinitelyPresented (Torus f) := by + obtain ⟨n,φ,hφ,_⟩ := (inferInstance : Group.IsFinitelyPresented U).out + let : Group.FG U := Group.fg_of_surjective hφ + exact Group.IsFinitelyPresented.quotient (relations f) (relations_finitelyNormallyGenerated f) + +theorem finitelyPresented_of_factorization {P : Type v} [Group P] + [Group.IsFinitelyPresented P] (a : U →* P) (b : P →* U) : + Group.IsFinitelyPresented (Torus (b.comp a)) := by + let : Group.IsFinitelyPresented (Torus (a.comp b)) := finitelyPresented (a.comp b) + exact Group.IsFinitelyPresented.equiv (cyclicFactorization a b).symm + +end + +section +open Monoid Coprod Multiplicative +universe u +variable {U : Type u} [Group U] + +lemma of_mul_stable_pow (f : Monoid.End U) (u : U) (n : ℕ) : + of f u * stable f ^ n = stable f ^ n * of f ((f ^ n) u) := by + induction n with + | zero => simp + | succ n ih => + rw [pow_succ, ← mul_assoc, ih, mul_assoc, of_mul_stable, ← mul_assoc, ← pow_succ] + rw [pow_succ' f n] + rfl + +lemma inv_stable_pow_mul_of (f : Monoid.End U) (u : U) (n : ℕ) : + (stable f ^ n)⁻¹ * of f u = of f ((f ^ n) u) * (stable f ^ n)⁻¹ := by + apply mul_right_cancel (b := stable f ^ n) + simp only [mul_assoc, inv_mul_cancel, mul_one] + rw [of_mul_stable_pow, inv_mul_cancel_left] + +def normalForms (f : Monoid.End U) : Subgroup (Torus f) where + carrier := {x | ∃ (p q : ℕ) (u : U), x = stable f ^ p * of f u * (stable f ^ q)⁻¹} + one_mem' := ⟨0,0,1,by simp⟩ + inv_mem' := by + rintro x ⟨p,q,u,rfl⟩ + exact ⟨q,p,u⁻¹,by simp only [mul_inv_rev, inv_inv, map_inv, mul_assoc]⟩ + mul_mem' := by + rintro x y ⟨p,q,u,rfl⟩ ⟨r,s,v,rfl⟩ + refine ⟨p+r,q+s,(f^r) u * (f^q) v,?_⟩ + have ht : (stable f ^ q)⁻¹ * stable f ^ r = + stable f ^ r * (stable f ^ q)⁻¹ := (Commute.pow_pow (Commute.refl (stable f)) q r).inv_left.eq + calc + _ = stable f ^ p * (of f u * stable f ^ r) * + ((stable f ^ q)⁻¹ * of f v) * (stable f ^ s)⁻¹ := by + simp only [mul_assoc] + rw [← mul_assoc ((stable f ^ q)⁻¹),ht] + simp only [mul_assoc] + _ = _ := by + rw [of_mul_stable_pow,inv_stable_pow_mul_of,map_mul,pow_add,pow_add,mul_inv_rev] + have ht' : (stable f ^ s)⁻¹ * (stable f ^ q)⁻¹ = + (stable f ^ q)⁻¹ * (stable f ^ s)⁻¹ := + (Commute.pow_pow (Commute.refl (stable f)) s q).inv_left.inv_right.eq + rw [ht'] + simp only [mul_assoc] + +lemma of_mem_normalForms (f : Monoid.End U) (u : U) : of f u ∈ normalForms f := + ⟨0,0,u,by simp⟩ + +lemma stable_mem_normalForms (f : Monoid.End U) : stable f ∈ normalForms f := + ⟨1,0,1,by simp⟩ + +theorem normal_form (f : Monoid.End U) (x : Torus f) : + ∃ (p q : ℕ) (u : U), x = stable f ^ p * of f u * (stable f ^ q)⁻¹ := by + change x ∈ normalForms f + obtain ⟨w,rfl⟩ := QuotientGroup.mk'_surjective (relations f) x + induction w using Coprod.induction_on with + | inl u => exact of_mem_normalForms f u + | inr z => + have hz : inr z = (letter (U := U)) ^ toAdd z := by + rw [letter,← map_zpow] + congr 1 + change z = ofAdd ((toAdd z) • (1 : ℤ)) + simp + rw [hz,map_zpow] + exact (normalForms f).zpow_mem (stable_mem_normalForms f) _ + | mul x y hx hy => + rw [map_mul] + exact (normalForms f).mul_mem hx hy + +def height (f : Monoid.End U) : Torus f →* Multiplicative ℤ := + lift f 1 (ofAdd 1) (by intro u; simp) + +@[simp] lemma height_of (f : Monoid.End U) (u : U) : height f (of f u) = 1 := + lift_of f 1 (ofAdd 1) _ u + +@[simp] lemma height_stable (f : Monoid.End U) : height f (stable f) = ofAdd 1 := + lift_stable f 1 (ofAdd 1) _ + +end + +section +open Monoid Multiplicative +universe u +variable {U : Type u} [Group U] + +abbrev Coset (f : Monoid.End U) := Torus f ⧸ (of f).range + +def coset (f : Monoid.End U) (x : Torus f) : Coset f := QuotientGroup.mk x + +lemma coset_mul_of (f : Monoid.End U) (x : Torus f) (u : U) : + coset f (x * of f u) = coset f x := + QuotientGroup.mk_mul_of_mem x ⟨u,rfl⟩ + +def next (f : Monoid.End U) : Coset f → Coset f := + Quotient.map' (fun x => x * stable f) (by + intro x y h + rw [QuotientGroup.leftRel_apply] at h ⊢ + obtain ⟨u,hu⟩ := h + refine ⟨f u,?_⟩ + rw [mul_inv_rev,mul_assoc,← mul_assoc x⁻¹,← hu] + exact (inverse_conjugate f u).symm) + +@[simp] lemma next_coset (f : Monoid.End U) (x : Torus f) : + next f (coset f x) = coset f (x * stable f) := rfl + +lemma next_iterate_coset (f : Monoid.End U) (k : ℕ) (x : Torus f) : + (next f)^[k] (coset f x) = coset f (x * stable f ^ k) := by + induction k with + | zero => simp + | succ k ih => + rw [Function.iterate_succ_apply',ih,next_coset,pow_succ,mul_assoc] + +lemma reaches_base_ray (f : Monoid.End U) (c : Coset f) : + ∃ (p q : ℕ), (next f)^[q] c = (next f)^[p] (coset f 1) := by + obtain ⟨x,rfl⟩ := QuotientGroup.mk_surjective c + obtain ⟨p,q,u,hx⟩ := normal_form f x + refine ⟨p,q,?_⟩ + change (next f)^[q] (coset f x) = _ + rw [next_iterate_coset,next_iterate_coset,hx,mul_assoc, + inv_mul_cancel,mul_one,one_mul,coset_mul_of] + +lemma common_descendant (f : Monoid.End U) (c d : Coset f) : + ∃ (p q : ℕ), (next f)^[p] c = (next f)^[q] d := by + obtain ⟨p,q,hc⟩ := reaches_base_ray f c + obtain ⟨r,s,hd⟩ := reaches_base_ray f d + refine ⟨r+q,p+s,?_⟩ + rw [Function.iterate_add_apply,Function.iterate_add_apply,hc,hd, + ← Function.iterate_add_apply,← Function.iterate_add_apply,Nat.add_comm r p] + +def cosetHeight (f : Monoid.End U) : Coset f → ℤ := + Quotient.lift (fun x => toAdd (height f x)) (by + intro x y h + have h' : x⁻¹ * y ∈ (of f).range := QuotientGroup.leftRel_apply.mp h + obtain ⟨u,hu⟩ := h' + have hy : y = x * of f u := by rw [hu,mul_inv_cancel_left] + rw [hy,map_mul,height_of,mul_one]) + +@[simp] lemma cosetHeight_coset (f : Monoid.End U) (x : Torus f) : + cosetHeight f (coset f x) = toAdd (height f x) := rfl + +lemma height_next (f : Monoid.End U) (c : Coset f) : + cosetHeight f (next f c) = cosetHeight f c + 1 := by + induction c using QuotientGroup.induction_on with + | H x => + change cosetHeight f (next f (coset f x)) = cosetHeight f (coset f x) + 1 + rw [next_coset,cosetHeight_coset,cosetHeight_coset,map_mul,height_stable] + rfl + +noncomputable def origin (f : Monoid.End U) (c : Coset f) : Torus f := c.out + +@[simp] lemma coset_origin (f : Monoid.End U) (c : Coset f) : + coset f (origin f c) = c := Quotient.out_eq' c + +lemma origin_next_mem (f : Monoid.End U) (c : Coset f) : + (origin f (next f c))⁻¹ * (origin f c * stable f) ∈ (of f).range := by + apply QuotientGroup.eq.mp + change coset f (origin f (next f c)) = coset f (origin f c * stable f) + rw [coset_origin,← next_coset,coset_origin] + +noncomputable def cosetOffset (f : Monoid.End U) (c : Coset f) : U := + Classical.choose (origin_next_mem f c) + +lemma origin_next (f : Monoid.End U) (c : Coset f) : + origin f (next f c) * of f (cosetOffset f c) = origin f c * stable f := by + change origin f (next f c) * of f (Classical.choose (origin_next_mem f c)) = _ + rw [Classical.choose_spec (origin_next_mem f c),mul_inv_cancel_left] + +end + +open Monoid Multiplicative +noncomputable section +universe u +variable {U : Type u} [Group U] (f : Monoid.End U) + +lemma smul_coset (g x : Torus f) : g • coset f x = coset f (g*x) := rfl +lemma next_smul (g : Torus f) (c : Coset f) : next f (g • c) = g • next f c := by + induction c using QuotientGroup.induction_on with + | H x => change coset f ((g*x)*stable f) = coset f (g*(x*stable f)); rw [mul_assoc] + +lemma origin_action_mem (g : Torus f) (c : Coset f) : + (origin f (g • c))⁻¹ * (g * origin f c) ∈ (of f).range := by + apply QuotientGroup.eq.mp + change coset f (origin f (g • c)) = coset f (g * origin f c) + rw [coset_origin,← smul_coset,coset_origin] + +def actionOffset (g : Torus f) (c : Coset f) : U := + Classical.choose (origin_action_mem f g c) +lemma origin_action (g : Torus f) (c : Coset f) : + origin f (g • c) * of f (actionOffset f g c) = g * origin f c := by + rw [actionOffset,Classical.choose_spec (origin_action_mem f g c),mul_inv_cancel_left] + +variable (hf : Function.Injective f) +include hf +lemma actionOffset_one (c : Coset f) : actionOffset f 1 c = 1 := by + apply of_injective f hf + have h := origin_action f 1 c + rw [one_smul,one_mul] at h + exact (mul_left_cancel (h.trans (mul_one _).symm)).trans (map_one _).symm +lemma actionOffset_mul (g h : Torus f) (c : Coset f) : + actionOffset f (g*h) c = actionOffset f g (h • c) * actionOffset f h c := by + apply of_injective f hf + apply mul_left_cancel (a := origin f ((g*h) • c)) + rw [map_mul,origin_action,mul_smul,←mul_assoc,origin_action] + rw [mul_assoc,mul_assoc,origin_action] +lemma actionOffset_next (g : Torus f) (c : Coset f) : + actionOffset f g (next f c) * cosetOffset f c = + cosetOffset f (g • c) * f (actionOffset f g c) := by + apply of_injective f hf + apply mul_left_cancel (a := origin f (next f (g • c))) + calc + origin f (next f (g • c)) * of f (actionOffset f g (next f c) * cosetOffset f c) = + (origin f (g • next f c) * of f (actionOffset f g (next f c))) * of f (cosetOffset f c) := by rw [map_mul,←mul_assoc,next_smul] + _ = g * (origin f (next f c) * of f (cosetOffset f c)) := by rw [origin_action,mul_assoc] + _ = g * (origin f c * stable f) := by rw [origin_next] + _ = (origin f (g • c) * of f (actionOffset f g c)) * stable f := by rw [origin_action,mul_assoc] + _ = (origin f (g • c) * stable f) * of f (f (actionOffset f g c)) := by rw [mul_assoc,of_mul_stable,←mul_assoc] + _ = (origin f (next f (g • c)) * of f (cosetOffset f (g • c))) * of f (f (actionOffset f g c)) := by rw [origin_next] + _ = origin f (next f (g • c)) * of f (cosetOffset f (g • c) * f (actionOffset f g c)) := by rw [map_mul,mul_assoc] + +end +end UniversalFInfinity.AscendingTorus + +end OAI diff --git a/lean/OAI/GroupTheory/UniversalGroup/Attachments.lean b/lean/OAI/GroupTheory/UniversalGroup/Attachments.lean new file mode 100644 index 0000000000000000000000000000000000000000..0f63c12307565d404953064d08a7f41e8411417c --- /dev/null +++ b/lean/OAI/GroupTheory/UniversalGroup/Attachments.lean @@ -0,0 +1,528 @@ +import OAI.GroupTheory.UniversalGroup.HomotopyProducts + +namespace OAI + +open Set Metric Topology BigOperators +open Set Metric Topology + +namespace UniversalFInfinity.Attachment +noncomputable section +universe u v w +abbrev Disk (n : ℕ) := closedBall (0 : Fin n → ℝ) 1 +abbrev Sphere (n : ℕ) := sphere (0 : Fin n → ℝ) 1 +abbrev OpenDisk (n : ℕ) := ball (0 : Fin n → ℝ) 1 + +def boundary (n : ℕ) : Sphere n → Disk n := + fun x => ⟨x.1, sphere_subset_closedBall x.2⟩ +def interior (n : ℕ) : OpenDisk n → Disk n := + fun x => ⟨x.1, ball_subset_closedBall x.2⟩ +lemma continuous_boundary (n : ℕ) : Continuous (boundary n) := + continuous_subtype_val.subtype_mk _ +lemma continuous_interior (n : ℕ) : Continuous (interior n) := + continuous_subtype_val.subtype_mk _ +lemma boundary_closedEmbedding (n : ℕ) : IsClosedEmbedding (boundary n) := + (continuous_boundary n).isClosedEmbedding (fun _ _ h => Subtype.ext (congrArg (fun z : Disk n => z.1) h)) + +variable {X : Type u} [TopologicalSpace X] {ι : Type v} {n : ℕ} +variable (a : ι → C(Sphere n,X)) + +def Space (_a : ι → C(Sphere n,X)) := X ⊕ (Σ _ : ι, OpenDisk n) + +noncomputable def quotient : (X ⊕ (Σ _ : ι, Disk n)) → Space a := by + classical + intro z + cases z with + | inl x => exact Sum.inl x + | inr p => + exact if h : p.2.1 ∈ ball (0 : Fin n → ℝ) 1 then Sum.inr ⟨p.1,⟨p.2.1,h⟩⟩ + else Sum.inl (a p.1 ⟨p.2.1,by + have hd := p.2.2 + simp only [mem_closedBall,mem_ball,mem_sphere] at * + exact le_antisymm hd (le_of_not_gt h)⟩) + +instance : TopologicalSpace (Space a) := TopologicalSpace.coinduced (quotient a) inferInstance + +@[simp] lemma quotient_inl (x : X) : quotient a (Sum.inl x) = Sum.inl x := rfl + +@[simp] lemma quotient_interior (i : ι) (x : OpenDisk n) : + quotient a (Sum.inr ⟨i,interior n x⟩) = Sum.inr ⟨i,x⟩ := by + classical + exact dite_eq_left x.2 + +@[simp] lemma quotient_boundary (i : ι) (x : Sphere n) : + quotient a (Sum.inr ⟨i,boundary n x⟩) = Sum.inl (a i x) := by + classical + have hx : x.1 ∉ ball (0 : Fin n → ℝ) 1 := by + simpa only [mem_ball,mem_sphere,x.2,lt_self_iff_false,not_false_eq_true] using + (sphere_disjoint_ball.notMem_of_mem_left x.2) + exact dite_eq_right hx + +lemma quotient_surjective : Function.Surjective (quotient a) := by + intro z + cases z with + | inl x => exact ⟨Sum.inl x,rfl⟩ + | inr p => exact ⟨Sum.inr ⟨p.1,interior n p.2⟩,quotient_interior a p.1 p.2⟩ + +lemma continuous_quotient : Continuous (quotient a) := continuous_coinduced_rng + +def base : X → Space a := Sum.inl +noncomputable def cell (i : ι) : C(Disk n,Space a) := + ⟨fun x => quotient a (Sum.inr ⟨i,x⟩), + (continuous_quotient a).comp (continuous_inr.comp continuous_sigmaMk)⟩ +lemma continuous_base : Continuous (base a) := + (continuous_quotient a).comp continuous_inl + +@[simp] lemma cell_boundary (i : ι) (x : Sphere n) : + cell a i (boundary n x) = base a (a i x) := quotient_boundary a i x +@[simp] lemma cell_interior (i : ι) (x : OpenDisk n) : + cell a i (interior n x) = Sum.inr ⟨i,x⟩ := quotient_interior a i x + +lemma continuous_iff {Y : Type w} [TopologicalSpace Y] (f : Space a → Y) : + Continuous f ↔ Continuous (f ∘ base a) ∧ ∀ i, Continuous (f ∘ cell a i) := by + change Continuous[TopologicalSpace.coinduced (quotient a) inferInstance,_] f ↔ _ + rw [continuous_coinduced_dom,continuous_sum_dom,continuous_sigma_iff] + rfl + +lemma isClosed_iff (S : Set (Space a)) : + IsClosed S ↔ IsClosed (base a ⁻¹' S) ∧ ∀ i, IsClosed (cell a i ⁻¹' S) := by + change @IsClosed _ (TopologicalSpace.coinduced (quotient a) inferInstance) S ↔ _ + rw [isClosed_coinduced,isClosed_sum_iff,isClosed_sigma_iff] + rfl + +lemma cell_preimage_base_image (i : ι) (S : Set X) : + cell a i ⁻¹' (base a '' S) = boundary n '' ((a i) ⁻¹' S) := by + classical + ext d + by_cases h : d.1 ∈ ball (0 : Fin n → ℝ) 1 + · have hd : d = interior n ⟨d.1,h⟩ := rfl + rw [hd] + simp only [Set.mem_preimage,cell_interior,base,Set.mem_image] + constructor + · rintro ⟨x,_,hx⟩; cases hx + · rintro ⟨x,_,hx⟩ + have heq := congrArg (fun d : Disk n => d.1) hx + have hh : x.1 ∈ ball (0 : Fin n → ℝ) 1 := heq ▸ h + exact False.elim ((sphere_disjoint_ball.notMem_of_mem_left x.2) hh) + · let x : Sphere n := ⟨d.1,by + have hd := d.2 + simp only [mem_closedBall,mem_ball,mem_sphere] at * + exact le_antisymm hd (le_of_not_gt h)⟩ + have hd : d = boundary n x := rfl + rw [hd] + simp only [Set.mem_preimage,cell_boundary,Set.mem_image] + constructor + · rintro ⟨y,hy,hyx⟩ + have heq : y = a i x := Sum.inl_injective hyx + exact ⟨x,heq ▸ hy,rfl⟩ + · rintro ⟨y,hy,hyx⟩ + have heq : y = x := Subtype.ext (congrArg (fun d : Disk n => d.1) hyx) + subst y + exact ⟨a i x,hy,rfl⟩ + +lemma base_isClosedMap : IsClosedMap (base a) := by + intro S hS + rw [isClosed_iff] + constructor + · have heq : base a ⁻¹' (base a '' S) = S := + Set.preimage_image_eq S Sum.inl_injective + exact heq.symm ▸ hS + · intro i + rw [cell_preimage_base_image] + exact (boundary_closedEmbedding n).isClosedMap _ (hS.preimage (a i).continuous) + +lemma base_closedEmbedding : IsClosedEmbedding (base a) := + IsClosedEmbedding.of_continuous_injective_isClosedMap + (continuous_base a) Sum.inl_injective (base_isClosedMap a) + +noncomputable def lift {Y : Type w} [TopologicalSpace Y] (f : C(X,Y)) + (g : ι → C(Disk n,Y)) (h : ∀ i x, g i (boundary n x) = f (a i x)) : C(Space a,Y) := by + classical + let F : Space a → Y := Sum.elim f (fun p => g p.1 (interior n p.2)) + have hcell (i : ι) : F ∘ cell a i = g i := by + funext d + by_cases hd : d.1 ∈ ball (0 : Fin n → ℝ) 1 + · have heq : d = interior n ⟨d.1,hd⟩ := rfl + rw [heq,Function.comp_apply,cell_interior] + rfl + · let x : Sphere n := ⟨d.1,by + have hm := d.2 + simp only [mem_closedBall,mem_ball,mem_sphere] at * + exact le_antisymm hm (le_of_not_gt hd)⟩ + have heq : d = boundary n x := rfl + rw [heq,Function.comp_apply,cell_boundary] + exact (h i x).symm + exact ⟨F,(continuous_iff a F).mpr ⟨f.continuous,fun i => by rw [hcell]; exact (g i).continuous⟩⟩ + +@[simp] lemma lift_base {Y : Type w} [TopologicalSpace Y] (f : C(X,Y)) + (g : ι → C(Disk n,Y)) (h : ∀ i x, g i (boundary n x) = f (a i x)) (x : X) : + lift a f g h (base a x) = f x := rfl + +@[simp] lemma lift_cell {Y : Type w} [TopologicalSpace Y] (f : C(X,Y)) + (g : ι → C(Disk n,Y)) (h : ∀ i x, g i (boundary n x) = f (a i x)) + (i : ι) (d : Disk n) : lift a f g h (cell a i d) = g i d := by + classical + by_cases hd : d.1 ∈ ball (0 : Fin n → ℝ) 1 + · have heq : d = interior n ⟨d.1,hd⟩ := rfl + rw [heq,cell_interior] + rfl + · let x : Sphere n := ⟨d.1,by + have hm := d.2 + simp only [mem_closedBall,mem_ball,mem_sphere] at * + exact le_antisymm hm (le_of_not_gt hd)⟩ + have heq : d = boundary n x := rfl + rw [heq,cell_boundary,lift_base,h] + +lemma lift_unique {Y : Type w} [TopologicalSpace Y] (f g : C(Space a,Y)) + (hb : ∀ x, f (base a x) = g (base a x)) + (hc : ∀ i d, f (cell a i d) = g (cell a i d)) : f = g := by + ext z + obtain ⟨q,rfl⟩ := quotient_surjective a z + cases q with + | inl x => exact hb x + | inr p => exact hc p.1 p.2 + +lemma interior_openEmbedding (n : ℕ) : IsOpenEmbedding (interior n) := + .inclusion ball_subset_closedBall (isOpen_ball.preimage continuous_subtype_val) + +def openCell (i : ι) : OpenDisk n → Space a := fun x => Sum.inr ⟨i,x⟩ + +lemma openCell_eq (i : ι) : openCell a i = cell a i ∘ interior n := by + funext x + exact (cell_interior a i x).symm + +lemma quotient_preimage_openCell_image (i : ι) (S : Set (OpenDisk n)) : + quotient a ⁻¹' (openCell a i '' S) = + Sum.inr '' (Sigma.mk i '' (interior n '' S)) := by + classical + ext q + cases q with + | inl x => + simp only [Set.mem_preimage,quotient_inl,Set.mem_image] + constructor + · rintro ⟨y,_,hy⟩; cases hy + · rintro ⟨y,_,hy⟩; cases hy + | inr p => + by_cases hp : p.2.1 ∈ ball (0 : Fin n → ℝ) 1 + · have heq : p.2 = interior n ⟨p.2.1,hp⟩ := rfl + change (∃ x ∈ S, openCell a i x = quotient a (Sum.inr ⟨p.1,p.2⟩)) ↔ _ + rw [heq,quotient_interior] + constructor + · rintro ⟨x,hx,he⟩ + have hh : (⟨i,x⟩ : Σ _ : ι, OpenDisk n) = ⟨p.1,⟨p.2.1,hp⟩⟩ := Sum.inr_injective he + have hh' : (⟨i,interior n x⟩ : Σ _ : ι, Disk n) = ⟨p.1,p.2⟩ := + congrArg (fun p : Σ _ : ι, OpenDisk n => (⟨p.1,interior n p.2⟩ : Σ _ : ι, Disk n)) hh + exact ⟨⟨i,interior n x⟩,⟨interior n x,⟨x,hx,rfl⟩,rfl⟩,congrArg Sum.inr hh'⟩ + · rintro ⟨y,⟨d,⟨x,hx,hxd⟩,hdy⟩,hy⟩ + subst d; subst y + have hh := Sum.inr_injective hy + have hi : i = p.1 := congrArg Sigma.fst hh + subst i + have hh' : interior n x = interior n ⟨p.2.1,hp⟩ := eq_of_heq (Sigma.mk.inj_iff.mp hh).2 + have he : x = ⟨p.2.1,hp⟩ := (interior_openEmbedding n).injective hh' + exact ⟨x,hx,by subst x; rfl⟩ + · let x : Sphere n := ⟨p.2.1,by + have hm := p.2.2 + simp only [mem_closedBall,mem_ball,mem_sphere] at * + exact le_antisymm hm (le_of_not_gt hp)⟩ + have heq : p.2 = boundary n x := rfl + change (∃ y ∈ S, openCell a i y = quotient a (Sum.inr ⟨p.1,p.2⟩)) ↔ _ + rw [heq,quotient_boundary] + constructor + · rintro ⟨y,_,hy⟩; cases hy + · rintro ⟨y,⟨d,⟨z,_,hzd⟩,hdy⟩,hy⟩ + subst d; subst y + have hh := Sum.inr_injective hy + have hi : i = p.1 := congrArg Sigma.fst hh + subst i + have hh' : interior n z = boundary n x := eq_of_heq (Sigma.mk.inj_iff.mp hh).2 + have hh'' := congrArg (fun d : Disk n => d.1) hh' + exact False.elim (hp (hh'' ▸ z.2)) + +lemma openCell_openEmbedding (i : ι) : IsOpenEmbedding (openCell a i) := by + apply IsOpenEmbedding.of_continuous_injective_isOpenMap + · rw [openCell_eq] + exact (cell a i).continuous.comp (continuous_interior n) + · intro x y h + exact eq_of_heq (Sigma.mk.inj_iff.mp (Sum.inr_injective h)).2 + · intro S hS + change @IsOpen _ (TopologicalSpace.coinduced (quotient a) inferInstance) _ + rw [isOpen_coinduced,quotient_preimage_openCell_image] + exact isOpenMap_inr _ (isOpenMap_sigmaMk _ ((interior_openEmbedding n).isOpenMap S hS)) + +lemma exists_real_extension (f : C(X,ℝ)) : + ∃ F : C(Space a,ℝ), ∀ x, F (base a x) = f x := by + classical + have hi (i : ι) : ∃ g : C(Disk n,ℝ), ∀ x, g (boundary n x) = f (a i x) := by + obtain ⟨g,hg⟩ := (f.comp (a i)).exists_extension' (boundary_closedEmbedding n) + exact ⟨g,fun x => congrFun hg x⟩ + choose g hg using hi + exact ⟨lift a f g hg,fun x => lift_base a f g hg x⟩ + +def RealSeparated (Y : Type*) [TopologicalSpace Y] : Prop := + ∀ x y : Y, x ≠ y → ∃ f : C(Y,ℝ), f x ≠ f y + +lemma RealSeparated.t2Space {Y : Type*} [TopologicalSpace Y] (h : RealSeparated Y) : + T2Space Y := by + constructor + intro x y hxy + obtain ⟨f,hf⟩ := h x y hxy + exact separated_by_continuous f.continuous hf + +lemma realSeparated_of_tychonoff {Y : Type*} [TopologicalSpace Y] + [T1Space Y] [CompletelyRegularSpace Y] : RealSeparated Y := by + intro x y hxy + obtain ⟨f,hf,hfx,hfy⟩ := CompletelyRegularSpace.completely_regular x {y} isClosed_singleton + (by simpa only [Set.mem_singleton_iff] using hxy) + refine ⟨⟨fun q => (f q : ℝ),continuous_subtype_val.comp hf⟩,?_⟩ + change (f x : ℝ) ≠ (f y : ℝ) + rw [hfx,hfy (Set.mem_singleton y)] + norm_num + +lemma exists_interior_separator [T1Space X] (i : ι) (x : OpenDisk n) (z : Space a) + (hxz : openCell a i x ≠ z) : + ∃ F : C(Space a,ℝ), F (openCell a i x) = 1 ∧ F z = 0 := by + classical + let K : Set (Disk n) := Set.range (boundary n) ∪ cell a i ⁻¹' {z} + have hKc : IsClosed K := by + + have hz : IsClosed (cell a i ⁻¹' {z}) := by + cases z with + | inl y => + have heq : ({base a y} : Set (Space a)) = base a '' {y} := + Set.image_singleton.symm + change IsClosed (cell a i ⁻¹' {base a y}) + rw [heq,cell_preimage_base_image] + + exact (boundary_closedEmbedding n).isClosedMap _ + (isClosed_singleton.preimage (a i).continuous) + | inr p => + have heq : ({openCell a p.1 p.2} : Set (Space a)) = openCell a p.1 '' {p.2} := + Set.image_singleton.symm + have hpre := quotient_preimage_openCell_image a p.1 ({p.2} : Set (OpenDisk n)) + have hclosed : IsClosed (quotient a ⁻¹' {Sum.inr p}) := by + change IsClosed (quotient a ⁻¹' {openCell a p.1 p.2}) + rw [heq,hpre] + exact isClosedMap_inr _ (isClosedMap_sigmaMk _ + ((isCompact_singleton.image (continuous_interior n)).isClosed)) + exact hclosed.preimage (continuous_inr.comp continuous_sigmaMk) + exact (boundary_closedEmbedding n).isClosed_range.union hz + have hxK : interior n x ∉ K := by + rintro (hx | hx) + · obtain ⟨s,hs⟩ := hx + have heq := congrArg (fun d : Disk n => d.1) hs + exact sphere_disjoint_ball.notMem_of_mem_left s.2 (heq ▸ x.2) + · change cell a i (interior n x) = z at hx + exact hxz ((cell_interior a i x).symm.trans hx) + obtain ⟨f,hf0,hf1,_⟩ := exists_continuous_zero_one_of_isClosed hKc + (isClosed_singleton (x := interior n x)) (Set.disjoint_singleton_right.mpr hxK) + let g : ι → C(Disk n,ℝ) := fun j => if j = i then f else ContinuousMap.const _ 0 + have hgb (j : ι) (s : Sphere n) : g j (boundary n s) = (0 : ℝ) := by + dsimp [g] + split_ifs with hji + · exact hf0 (Set.mem_union_left _ (Set.mem_range_self s)) + · rfl + let F : C(Space a,ℝ) := lift a (ContinuousMap.const _ 0) g hgb + have hFcell (j : ι) (d : Disk n) : F (cell a j d) = g j d := lift_cell a _ _ _ j d + refine ⟨F,?_,?_⟩ + · change F (Sum.inr ⟨i,x⟩) = 1 + rw [← cell_interior a i x,hFcell] + simpa only [g,ite_eq_left rfl,Pi.one_apply] using hf1 (Set.mem_singleton _) + · cases z with + | inl y => exact lift_base a _ _ _ y + | inr p => + rw [← cell_interior a p.1 p.2,hFcell] + by_cases hpi : p.1 = i + · have hm : interior n p.2 ∈ K := by + right + change cell a i (interior n p.2) = Sum.inr p + rw [cell_interior] + cases p with + | mk j y => cases hpi; rfl + simpa only [g,ite_eq_left hpi,Pi.zero_apply] using hf0 hm + · simp only [g,ite_eq_right hpi,ContinuousMap.const_apply] + +lemma realSeparated (hX : RealSeparated X) : RealSeparated (Space a) := by + classical + let : T2Space X := hX.t2Space + intro x y hxy + cases x with + | inl x => + cases y with + | inl y => + have hne : x ≠ y := fun heq => hxy (congrArg Sum.inl heq) + obtain ⟨f,hf⟩ := hX x y hne + obtain ⟨F,hF⟩ := exists_real_extension a f + refine ⟨F,?_⟩ + change F (base a x) ≠ F (base a y) + rwa [hF,hF] + | inr p => + obtain ⟨F,hF1,hF0⟩ := exists_interior_separator a p.1 p.2 (Sum.inl x) + (by exact fun h => hxy h.symm) + refine ⟨F,?_⟩ + change F (Sum.inl x) ≠ F (openCell a p.1 p.2) + rw [hF0,hF1] + norm_num + | inr p => + obtain ⟨F,hF1,hF0⟩ := exists_interior_separator a p.1 p.2 y hxy + refine ⟨F,?_⟩ + change F (openCell a p.1 p.2) ≠ F y + rw [hF1,hF0] + norm_num + +lemma t2Space (hX : RealSeparated X) : T2Space (Space a) := (realSeparated a hX).t2Space + +section Characteristic +variable [Nonempty X] + +def characteristic (i : ι) (x : Fin n → ℝ) : Space a := by + classical + exact if hx : x ∈ closedBall 0 1 then cell a i ⟨x,hx⟩ else base a (Classical.choice ‹Nonempty X›) + +lemma characteristic_disk (i : ι) (d : Disk n) : + characteristic a i d.1 = cell a i d := by + simp only [characteristic,dite_eq_left d.2] + +lemma characteristic_open (i : ι) (x : OpenDisk n) : + characteristic a i x.1 = openCell a i x := by + exact (characteristic_disk a i (interior n x)).trans (cell_interior a i x) + +lemma characteristic_bijOn (i : ι) : + Set.BijOn (characteristic a i) (ball 0 1) (Set.range (openCell a i)) := by + constructor + · intro x hx + exact ⟨⟨x,hx⟩,(characteristic_open a i ⟨x,hx⟩).symm⟩ + constructor + · intro x hx y hy hxy + have hxy' : openCell a i ⟨x,hx⟩ = openCell a i ⟨y,hy⟩ := by + rwa [characteristic_open a i ⟨x,hx⟩,characteristic_open a i ⟨y,hy⟩] at hxy + exact congrArg Subtype.val ((openCell_openEmbedding a i).injective hxy') + · rintro z ⟨x,rfl⟩ + exact ⟨x.1,x.2,characteristic_open a i x⟩ + +def characteristicPE (i : ι) : PartialEquiv (Fin n → ℝ) (Space a) := + (characteristic_bijOn a i).toPartialEquiv _ _ _ + +lemma characteristicPE_continuousOn (i : ι) : + ContinuousOn (characteristicPE a i) (closedBall 0 1) := by + rw [continuousOn_iff_continuous_domRestrict] + have heq : (closedBall (0:Fin n→ℝ) 1).domRestrict (characteristicPE a i) = cell a i := by + funext x + exact characteristic_disk a i x + rw [heq] + exact (cell a i).continuous + +lemma characteristicPE_continuousOn_symm (i : ι) : + ContinuousOn (characteristicPE a i).symm (characteristicPE a i).target := by + let e := characteristicPE a i + have he : IsEmbedding (e.source.domRestrict e) := by + have heq : e.source.domRestrict e = openCell a i := by + funext x + exact characteristic_open a i x + rw [heq] + exact (openCell_openEmbedding a i).isEmbedding + let H : e.source ≃ₜ e.target := e.toEquiv.toHomeomorphOfIsInducing + (he.isInducing.codRestrict (fun x => e.map_source x.2)) + rw [continuousOn_iff_continuous_domRestrict] + exact continuous_subtype_val.comp H.symm.continuous + +lemma characteristicPE_image_ball (i : ι) : + characteristicPE a i '' ball 0 1 = Set.range (openCell a i) := + (characteristic_bijOn a i).image_eq + +lemma characteristicPE_image_closedBall (i : ι) : + characteristicPE a i '' closedBall 0 1 = Set.range (cell a i) := by + ext z + constructor + · rintro ⟨x,hx,rfl⟩ + exact ⟨⟨x,hx⟩,(characteristic_disk a i ⟨x,hx⟩).symm⟩ + · rintro ⟨x,rfl⟩ + exact ⟨x.1,x.2,characteristic_disk a i x⟩ + +abbrev CellIndex (m n : ℕ) (ι : Type v) := ULift.{u} (PLift (m = n) × ι) + +def cellMap (m : ℕ) (i : CellIndex.{u,v} m n ι) : + PartialEquiv (Fin m → ℝ) (Space a) := by + obtain ⟨⟨⟨hm⟩,i⟩⟩ := i + subst m + exact characteristicPE a i + +@[instance_reducible] +def relCWComplex : RelCWComplex (Set.univ : Set (Space a)) (Set.range (base a)) where + cell m := CellIndex.{u,v} m n ι + map := cellMap a + source_eq := by + rintro m ⟨⟨⟨hm⟩,i⟩⟩ + subst m + rfl + continuousOn := by + rintro m ⟨⟨⟨hm⟩,i⟩⟩ + subst m + exact characteristicPE_continuousOn a i + continuousOn_symm := by + rintro m ⟨⟨⟨hm⟩,i⟩⟩ + subst m + exact characteristicPE_continuousOn_symm a i + pairwiseDisjoint' := by + rintro ⟨m,⟨⟨⟨hm⟩,i⟩⟩⟩ _ ⟨k,⟨⟨⟨hk⟩,j⟩⟩⟩ _ hne + subst m; subst k + change Disjoint (characteristicPE a i '' ball 0 1) (characteristicPE a j '' ball 0 1) + rw [characteristicPE_image_ball,characteristicPE_image_ball] + apply Set.disjoint_left.mpr + rintro z ⟨x,rfl⟩ ⟨y,h⟩ + have hij : j = i := congrArg Sigma.fst (Sum.inr_injective h) + subst j + exact hne rfl + disjointBase' := by + rintro m ⟨⟨⟨hm⟩,i⟩⟩ + subst m + change Disjoint (characteristicPE a i '' ball 0 1) _ + rw [characteristicPE_image_ball] + apply Set.disjoint_left.mpr + rintro z ⟨x,rfl⟩ ⟨y,h⟩ + cases h + mapsTo := by + rintro m ⟨⟨⟨hm⟩,i⟩⟩ + subst m + refine ⟨fun _ => ∅,?_⟩ + intro x hx + left + refine ⟨a i ⟨x,hx⟩,?_⟩ + change base a (a i ⟨x,hx⟩) = characteristic a i x + exact (cell_boundary a i ⟨x,hx⟩).symm.trans + (characteristic_disk a i (boundary n ⟨x,hx⟩)).symm + closed' := by + intro A _ hA + apply (isClosed_iff a A).mpr + constructor + · have h := hA.2.preimage (continuous_base a) + convert h using 1 + ext x + simp only [Set.mem_preimage,Set.mem_inter_iff,Set.mem_range_self,and_true] + · intro i + have h := (hA.1 n ⟨⟨⟨rfl⟩,i⟩⟩).preimage (cell a i).continuous + change IsClosed ((cell a i) ⁻¹' (A ∩ characteristicPE a i '' closedBall 0 1)) at h + rw [characteristicPE_image_closedBall] at h + convert h using 1 + ext x + simp only [Set.mem_preimage,Set.mem_inter_iff,Set.mem_range_self,and_true] + isClosedBase := (base_closedEmbedding a).isClosed_range + union' := by + apply Set.eq_univ_of_forall + intro z + cases z with + | inl x => exact Or.inl ⟨x,rfl⟩ + | inr p => + right + refine Set.mem_iUnion.mpr ⟨n,Set.mem_iUnion.mpr ⟨⟨⟨⟨rfl⟩,p.1⟩⟩,?_⟩⟩ + change Sum.inr p ∈ characteristicPE a p.1 '' closedBall 0 1 + rw [characteristicPE_image_closedBall] + exact ⟨interior n p.2,cell_interior a p.1 p.2⟩ + +end Characteristic + +end +end UniversalFInfinity.Attachment + +open Set Metric Topology + +end OAI diff --git a/lean/OAI/GroupTheory/UniversalGroup/Benign.lean b/lean/OAI/GroupTheory/UniversalGroup/Benign.lean new file mode 100644 index 0000000000000000000000000000000000000000..9e3874c8ae192ad5136613d3a5b196b9db66fba1 --- /dev/null +++ b/lean/OAI/GroupTheory/UniversalGroup/Benign.lean @@ -0,0 +1,353 @@ +import OAI.GroupTheory.UniversalGroup.RopeTrick + +namespace OAI + +section UniversalFinitelyPresentedProof +universe u v w x + +namespace Higman.HNN +open HNNExtension +variable {G : Type*} [Group G] {A B : Subgroup G} (φ : A ≃* B) + +theorem conj_mem_range_iff (g : G) : + (t * of g * t⁻¹ : HNNExtension G A B φ) ∈ of.range ↔ g ∈ A := by + constructor + · intro h + by_contra hg + let w : NormalWord.ReducedWord G A B := + { head := 1 + toList := [(1,g),(-1,1)] + chain := by simp [hg] } + have hp : w.prod φ = t * of g * t⁻¹ := by + simp [NormalWord.ReducedWord.prod,w] + have hn := HNNExtension.ReducedWord.toList_eq_nil_of_mem_of_range φ w (hp ▸ h) + simp [w] at hn + · intro hg + rw [← equiv_eq_conj (φ := φ) ⟨g,hg⟩] + exact ⟨_,rfl⟩ + +theorem commute_t_iff (g : G) : + Commute (t : HNNExtension G A A (MulEquiv.refl A)) (of g) ↔ g ∈ A := by + constructor + · intro h + apply (conj_mem_range_iff (MulEquiv.refl A) g).mp + rw [h.eq,mul_inv_cancel_right] + exact ⟨g,rfl⟩ + · intro hg + exact t_mul_of (φ := MulEquiv.refl A) ⟨g,hg⟩ + +end Higman.HNN + +namespace Higman +variable {G : Type u} [Group G] {A : Subgroup G} + +theorem benign_iff_centralExtension_embeds : IsBenign A ↔ + ∃ (K : Type u) (_ : Group K) (_ : Group.IsFinitelyPresented K) + (j : CentralExtension G A →* K), Function.Injective j := by + constructor + · rintro ⟨K,_,_,i,hi,B,hB,hBi⟩ + exact ⟨CentralExtension K B,inferInstance,CentralExtension.finitelyPresented hB, + CentralExtension.map i (le_of_eq hBi.symm), + CentralExtension.map_injective i hi hBi⟩ + · rintro ⟨K,_,_,j,hj⟩ + obtain ⟨n,p,hp,_⟩ := Group.IsFinitelyPresented.out (G := K) + have : Group.FG K := Group.fg_of_surjective hp + let i : G →* K := j.comp HNNExtension.of + let t : K := j HNNExtension.t + let k : G →* K × K := i.prod ((MulAut.conj t).toMonoidHom.comp i) + let d : K →* K × K := (MonoidHom.id K).prod (MonoidHom.id K) + have hd : d.range.FG := by + rw [MonoidHom.range_eq_map] + obtain ⟨S,hS⟩ := (Group.FG.out : (⊤ : Subgroup K).FG) + refine (Subgroup.fg_iff _).mpr ⟨d '' (S : Set K),?_,S.finite_toSet.image d⟩ + rw [← MonoidHom.map_closure,hS] + refine ⟨K × K,inferInstance,finitelyPresented_prod,k,?_,d.range,hd,?_⟩ + · intro x y he + exact HNNExtension.of_injective (φ := MulEquiv.refl A) + (hj (congrArg Prod.fst he)) + · ext g + change (∃ z, d z = k g) ↔ g ∈ A + constructor + · rintro ⟨z,hz⟩ + have h₀ : z = i g := congrArg Prod.fst hz + have h₁ : z = t * i g * t⁻¹ := congrArg Prod.snd hz + have he : (HNNExtension.t : CentralExtension G A) * HNNExtension.of g * + HNNExtension.t⁻¹ = HNNExtension.of g := by + apply hj + simpa only [i,t,MonoidHom.comp_apply,map_mul,map_inv] using h₁.symm.trans h₀ + apply (HNN.commute_t_iff g).mp + change HNNExtension.t * HNNExtension.of g = HNNExtension.of g * HNNExtension.t + calc + HNNExtension.t * HNNExtension.of g = + ((HNNExtension.t * HNNExtension.of g) * HNNExtension.t⁻¹) * + (HNNExtension.t : CentralExtension G A) := (inv_mul_cancel_right _ _).symm + _ = HNNExtension.of g * HNNExtension.t := congrArg (fun x : CentralExtension G A ↦ + x * HNNExtension.t) he + · intro hg + refine ⟨i g,?_⟩ + apply Prod.ext + · rfl + · change i g = t * i g * t⁻¹ + have he := HNNExtension.equiv_eq_conj (φ := MulEquiv.refl A) ⟨g,hg⟩ + simpa only [i,t,MonoidHom.comp_apply,map_mul,map_inv,MulEquiv.refl_apply] using + congrArg j he + +theorem embeds_of_benign_kernel_fp {D : Type v} [Group D] + [Group.IsFinitelyPresented G] (q : G →* D) (hq : Function.Surjective q) + (hben : IsBenign q.ker) : + ∃ (K : Type u) (_ : Group K) (_ : Group.IsFinitelyPresented K) + (i : D →* K), Function.Injective i := by + obtain ⟨n,p,hp,_⟩ := Group.IsFinitelyPresented.out (G := G) + let p' : FreeGroup (ULift.{u} (Fin n)) →* G := p.comp (FreeGroup.map ULift.down) + have hp' : Function.Surjective p' := hp.comp + (FreeGroup.map_surjective (fun a ↦ ⟨ULift.up a,rfl⟩)) + apply embeds_of_benign_kernel (q.comp p') (hq.comp hp') + exact hben.comap p' + +end Higman + +namespace Higman.CentralExtension +open Monoid Coprod Multiplicative +variable {G : Type u} [Group G] (A : Subgroup G) + +abbrev rawProjection : G ∗ Multiplicative ℤ →* CentralExtension G A := + (HNNExtension.con G A A (MulEquiv.refl A)).mk' + +theorem rawProjection_ker : (rawProjection A).ker = + Subgroup.normalClosure (relation '' (A : Set G)) := by + let C := HNNExtension.con G A A (MulEquiv.refl A) + let N := Subgroup.normalClosure (relation '' (A : Set G)) + let q := QuotientGroup.mk' N + have hC : C ≤ Con.ker q := by + apply Con.conGen_le.mpr + rintro _ _ ⟨a,rfl,rfl⟩ + apply mul_inv_eq_one.mp + have hh : q (relation (a : G)) = 1 := (QuotientGroup.eq_one_iff (relation (a : G))).mpr + (Subgroup.subset_normalClosure (show relation (a : G) ∈ relation '' (A : Set G) from + ⟨a,a.2,rfl⟩)) + simpa only [relation,map_mul,map_inv,MulEquiv.refl_apply] using hh + apply le_antisymm + · intro x hx + apply (QuotientGroup.eq_one_iff _).mp + apply (hC ?_).trans (map_one q) + apply (Con.eq C).mp + exact hx.trans (map_one C.mk').symm + · apply Subgroup.normalClosure_le_normal + rintro _ ⟨g,hg,rfl⟩ + change rawProjection A (relation g) = 1 + change (HNNExtension.t * HNNExtension.of g) * + (HNNExtension.of g * (HNNExtension.t : CentralExtension G A))⁻¹ = 1 + rw [HNNExtension.t_mul_of (φ := MulEquiv.refl A) ⟨g,hg⟩] + exact mul_inv_cancel _ + +variable {H : Type u} [Group H] + +theorem rawMap_surjective (f : G →* H) (hf : Function.Surjective f) : + Function.Surjective (Coprod.map f (MonoidHom.id (Multiplicative ℤ))) := by + apply MonoidHom.range_eq_top.mp + rw [Coprod.range_eq] + have h₀ : ((Coprod.map f (MonoidHom.id (Multiplicative ℤ))).comp inl).range = + (inl : H →* H ∗ Multiplicative ℤ).range := by + change ((inl : H →* H ∗ Multiplicative ℤ).comp f).range = _ + rw [MonoidHom.range_comp,MonoidHom.range_eq_top.mpr hf,← MonoidHom.range_eq_map] + rw [h₀] + exact Coprod.range_inl_sup_range_inr + +theorem rawProjection_ker_map (f : G →* H) (hf : Function.Surjective f) : + (rawProjection A).ker.map (Coprod.map f (MonoidHom.id (Multiplicative ℤ))) = + (rawProjection (A.map f)).ker := by + rw [rawProjection_ker,rawProjection_ker, + Subgroup.map_normalClosure _ _ (rawMap_surjective f hf)] + congr 1 + ext x + constructor + · rintro ⟨_,⟨g,hg,rfl⟩,rfl⟩ + refine ⟨f g,⟨g,hg,rfl⟩,?_⟩ + simp [relation] + · rintro ⟨_,⟨g,hg,rfl⟩,rfl⟩ + refine ⟨relation g,⟨g,hg,rfl⟩,?_⟩ + simp [relation] + +end Higman.CentralExtension + +namespace Higman.IsBenign +open Monoid Coprod Multiplicative +variable {G H : Type u} [Group G] [Group H] + [Group.IsFinitelyPresented G] [Group.IsFinitelyPresented H] + {A : Subgroup G} + +theorem map_surjective (hA : IsBenign A) (f : G →* H) (hf : Function.Surjective f) : + IsBenign (A.map f) := by + obtain ⟨K,_,_,j,hj⟩ := benign_iff_centralExtension_embeds.mp hA + let π := CentralExtension.rawProjection A + let F := Coprod.map f (MonoidHom.id (Multiplicative ℤ)) + let k : G ∗ Multiplicative ℤ →* K × (H ∗ Multiplicative ℤ) := (j.comp π).prod F + let i : H ∗ Multiplicative ℤ →* K × (H ∗ Multiplicative ℤ) := + (1 : H ∗ Multiplicative ℤ →* K).prod (MonoidHom.id _) + have hi : Function.Injective i := by + intro x y he + exact congrArg Prod.snd he + have hk : k.range.FG := by + obtain ⟨n,p,hp,_⟩ := Group.IsFinitelyPresented.out (G := G ∗ Multiplicative ℤ) + have : Group.FG (G ∗ Multiplicative ℤ) := Group.fg_of_surjective hp + obtain ⟨S,hS⟩ := (Group.FG.out : (⊤ : Subgroup (G ∗ Multiplicative ℤ)).FG) + refine (Subgroup.fg_iff _).mpr ⟨k '' (S : Set (G ∗ Multiplicative ℤ)),?_, + S.finite_toSet.image k⟩ + rw [← MonoidHom.map_closure,hS,← MonoidHom.range_eq_map] + have hker : k.range.comap i = (CentralExtension.rawProjection (A.map f)).ker := by + rw [← CentralExtension.rawProjection_ker_map A f hf] + ext x + change (∃ y, k y = i x) ↔ ∃ y, π y = 1 ∧ F y = x + constructor + · rintro ⟨y,hy⟩ + refine ⟨y,?_,congrArg Prod.snd hy⟩ + apply hj + exact (congrArg Prod.fst hy).trans (map_one j).symm + · rintro ⟨y,hy,hxy⟩ + refine ⟨y,Prod.ext ?_ hxy⟩ + change j (π y) = 1 + rw [hy,map_one] + have hben : IsBenign (CentralExtension.rawProjection (A.map f)).ker := + ⟨K × (H ∗ Multiplicative ℤ),inferInstance,finitelyPresented_prod,i,hi,k.range,hk,hker⟩ + apply benign_iff_centralExtension_embeds.mpr + exact embeds_of_benign_kernel_fp (CentralExtension.rawProjection (A.map f)) + Con.mk'_surjective hben + +end Higman.IsBenign + +namespace Higman.HNNTransport +open HNNExtension +variable {G : Type u} [Group G] {K : Type v} [Group K] + {A B : Subgroup G} {C D : Subgroup K} (φ : A ≃* B) (ψ : C ≃* D) + (i : G →* K) (hA : C.comap i = A) (hB : D.comap i = B) + (hφ : ∀ a : A, i (φ a) = ψ ⟨i a,show i a ∈ C from hA.symm ▸ a.2⟩) + +def map : HNNExtension G A B φ →* HNNExtension K C D ψ := + HNNExtension.lift (HNNExtension.of.comp i) HNNExtension.t (by + intro a + simpa only [MonoidHom.comp_apply,hφ a] using + HNNExtension.t_mul_of (φ := ψ) ⟨i a,show i a ∈ C from hA.symm ▸ a.2⟩) + +@[simp] theorem map_of (g : G) : map φ ψ i hA hφ (HNNExtension.of g) = + HNNExtension.of (i g) := by simp [map] + +@[simp] theorem map_t : map φ ψ i hA hφ HNNExtension.t = HNNExtension.t := by simp [map] + +def mapWord (r : NormalWord.ReducedWord G A B) : NormalWord.ReducedWord K C D where + head := i r.head + toList := r.toList.map (fun p ↦ (p.1,i p.2)) + chain := by + apply (List.isChain_map _).mpr + apply r.chain.imp + intro a b hab hmem + apply hab + rcases Int.units_eq_one_or a.1 with ha | ha + · have hm : i a.2 ∈ C := by simpa [ha,HNNExtension.toSubgroup] using hmem + have hm' : a.2 ∈ A := hA ▸ hm + simpa [ha,HNNExtension.toSubgroup] using hm' + · have hm : i a.2 ∈ D := by simpa [ha,HNNExtension.toSubgroup] using hmem + have hm' : a.2 ∈ B := hB ▸ hm + simpa [ha,HNNExtension.toSubgroup] using hm' + +@[simp] theorem mapWord_prod (r : NormalWord.ReducedWord G A B) : + (mapWord i hA hB r).prod ψ = map φ ψ i hA hφ (r.prod φ) := by + simp [NormalWord.ReducedWord.prod,mapWord,map_list_prod,List.map_map,Function.comp_def] + +include hB + +theorem mem_base_of_map_mem_base (x : HNNExtension G A B φ) + (hx : map φ ψ i hA hφ x ∈ (HNNExtension.of : K →* HNNExtension K C D ψ).range) : + x ∈ (HNNExtension.of : G →* HNNExtension G A B φ).range := by + obtain ⟨d⟩ := NormalWord.TransversalPair.nonempty G A B + let r := NormalWord.equiv φ d x + have hr : r.prod φ = x := (NormalWord.equiv φ d).symm_apply_apply x + have hm : (mapWord i hA hB r.toReducedWord).prod ψ ∈ HNNExtension.of.range := by + rw [mapWord_prod φ ψ i hA hB hφ] + rw [hr] + exact hx + have hn := HNNExtension.ReducedWord.toList_eq_nil_of_mem_of_range ψ + (mapWord i hA hB r.toReducedWord) hm + have hnil : r.toList = [] := by simpa [mapWord] using hn + refine ⟨r.head,?_⟩ + rw [← hr] + simp [NormalWord.ReducedWord.prod,hnil] + +theorem map_injective (hi : Function.Injective i) : Function.Injective (map φ ψ i hA hφ) := by + apply (MonoidHom.ker_eq_bot_iff _).mp + apply le_antisymm _ bot_le + intro x hx + have hm : map φ ψ i hA hφ x ∈ HNNExtension.of.range := by + change map φ ψ i hA hφ x = 1 at hx + rw [hx] + exact Subgroup.one_mem _ + obtain ⟨g,rfl⟩ := mem_base_of_map_mem_base φ ψ i hA hB hφ x hm + change map φ ψ i hA hφ (HNNExtension.of g) = 1 at hx + rw [map_of] at hx + have hg : i g = 1 := HNNExtension.of_injective (φ := ψ) (hx.trans (map_one _).symm) + have hg' : g = 1 := hi (hg.trans (map_one i).symm) + rw [Subgroup.mem_bot,hg',map_one] + +theorem range_comap_of : (map φ ψ i hA hφ).range.comap HNNExtension.of = i.range := by + ext k + constructor + · rintro ⟨x,hx⟩ + have hm : map φ ψ i hA hφ x ∈ HNNExtension.of.range := ⟨k,hx.symm⟩ + obtain ⟨g,rfl⟩ := mem_base_of_map_mem_base φ ψ i hA hB hφ x hm + refine ⟨g,?_⟩ + apply HNNExtension.of_injective (φ := ψ) + simpa using hx + · rintro ⟨g,rfl⟩ + exact ⟨HNNExtension.of g,map_of φ ψ i hA hφ g⟩ + +end Higman.HNNTransport + +namespace Higman.HNNSubgroup +open HNNExtension +variable {G : Type u} [Group G] {A B : Subgroup G} (φ : A ≃* B) + (S : Subgroup G) (hS : ∀ a : A, (φ a : G) ∈ S ↔ (a : G) ∈ S) + +def restricted : A.comap S.subtype ≃* B.comap S.subtype where + toFun a := ⟨⟨φ ⟨a,a.2⟩,(hS ⟨a,a.2⟩).mpr a.1.2⟩,(φ ⟨a,a.2⟩).2⟩ + invFun b := ⟨⟨φ.symm ⟨b,b.2⟩,(hS (φ.symm ⟨b,b.2⟩)).mp (by simp)⟩, + (φ.symm ⟨b,b.2⟩).2⟩ + left_inv a := by apply Subtype.ext; apply Subtype.ext; exact congrArg (fun z : A ↦ (z : G)) (φ.symm_apply_apply ⟨a,a.2⟩) + right_inv b := by apply Subtype.ext; apply Subtype.ext; exact congrArg (fun z : B ↦ (z : G)) (φ.apply_symm_apply ⟨b,b.2⟩) + map_mul' a b := by apply Subtype.ext; apply Subtype.ext; exact congrArg (fun z : B ↦ (z : G)) (φ.map_mul ⟨a,a.2⟩ ⟨b,b.2⟩) + +def inclusion : HNNExtension S (A.comap S.subtype) (B.comap S.subtype) + (restricted φ S hS) →* HNNExtension G A B φ := + HNNTransport.map (restricted φ S hS) φ S.subtype rfl (fun _ ↦ rfl) + +@[simp] theorem inclusion_of (s : S) : + inclusion φ S hS (HNNExtension.of s) = HNNExtension.of (s : G) := by + exact HNNTransport.map_of _ _ _ _ _ s + +@[simp] theorem inclusion_t : inclusion φ S hS HNNExtension.t = HNNExtension.t := by + exact HNNTransport.map_t _ _ _ _ _ + +theorem range_comap_of : (inclusion φ S hS).range.comap HNNExtension.of = S := by + exact (HNNTransport.range_comap_of (restricted φ S hS) φ S.subtype rfl rfl + (fun _ ↦ rfl)).trans (Subgroup.range_subtype S) + +include hS + +theorem closure_comap_of : + (Subgroup.closure (HNNExtension.of '' (S : Set G) ∪ + {(HNNExtension.t : HNNExtension G A B φ)})).comap HNNExtension.of = S := by + apply le_antisymm + · have hle : Subgroup.closure (HNNExtension.of '' (S : Set G) ∪ + {(HNNExtension.t : HNNExtension G A B φ)}) ≤ (inclusion φ S hS).range := by + apply (Subgroup.closure_le _).mpr + rintro _ (⟨s,hs,rfl⟩ | ht) + · exact ⟨HNNExtension.of ⟨s,hs⟩,inclusion_of φ S hS ⟨s,hs⟩⟩ + · obtain rfl := Set.mem_singleton_iff.mp ht + exact ⟨HNNExtension.t,inclusion_t φ S hS⟩ + exact (Subgroup.comap_mono hle).trans_eq (range_comap_of φ S hS) + · intro s hs + exact Subgroup.subset_closure (Or.inl ⟨s,hs,rfl⟩) + +end Higman.HNNSubgroup + +end UniversalFinitelyPresentedProof + +end OAI diff --git a/lean/OAI/GroupTheory/UniversalGroup/BrownConstruction.lean b/lean/OAI/GroupTheory/UniversalGroup/BrownConstruction.lean new file mode 100644 index 0000000000000000000000000000000000000000..f3b32ef0ce7f8ce2f10cd0bfbbcec4361c1299ad --- /dev/null +++ b/lean/OAI/GroupTheory/UniversalGroup/BrownConstruction.lean @@ -0,0 +1,356 @@ +import OAI.GroupTheory.UniversalGroup.TowerCoverings + +namespace OAI + +noncomputable section + +open Set Metric Topology BigOperators +open Set Metric Topology +open Set Topology +open Set Metric Topology +open scoped NNReal +open Set Metric Topology +open scoped NNReal ENNReal +open Set Metric Topology +open scoped TensorProduct + +namespace UniversalFInfinity.Brown + +section +open Set Metric Topology Cellular Attachment +universe u +variable (G : Type u) [Group G] + +structure Stage (n : ℕ) where + E : Type u + B : Type u + [topE : TopologicalSpace E] + [topB : TopologicalSpace B] + [nonemptyE : Nonempty E] + [nonemptyB : Nonempty B] + sepE : RealSeparated E + sepB : RealSeparated B + [cwE : CWComplex (univ : Set E)] + [cwB : CWComplex (univ : Set B)] + [action : MulAction G E] + [continuousAction : ContinuousConstSMul G E] + orbits : ℕ → Type u + orbitFinite : ∀ m,Finite (orbits m) + equiv : ∀ m,(G × orbits m) ≃ cwE.cell m + equiv_map : ∀ m (g h : G) (i : orbits m) (x : Fin m → ℝ), + cwE.map m (equiv m (g*h,i)) x = g • cwE.map m (equiv m (h,i)) x + dimE : ∀ m (_ : cwE.cell m), m ≤ n + dimB : ∀ m (_ : cwB.cell m), m ≤ n + finiteB : ∀ m,Finite (cwB.cell m) + fill : LowFillable E n + p : C(E,B) + covering : IsQuotientCoveringMap p G + +attribute [instance] Stage.topE Stage.topB Stage.nonemptyE Stage.nonemptyB + Stage.cwE Stage.cwB Stage.action Stage.continuousAction Stage.orbitFinite Stage.finiteB + +instance {n : ℕ} (S : Stage G n) : T2Space S.E := S.sepE.t2Space +instance {n : ℕ} (S : Stage G n) : T2Space S.B := S.sepB.t2Space + +variable {G} + +def ZeroOrbits : ℕ → Type u + | 0 => PUnit + | _+1 => PEmpty +instance (m : ℕ) : Finite (ZeroOrbits.{u} m) := by cases m <;> dsimp [ZeroOrbits] <;> infer_instance + +section Zero +variable [TopologicalSpace G] [DiscreteTopology G] +def zeroEquiv (m : ℕ) : (G × ZeroOrbits.{u} m) ≃ RelCWComplex.cell (univ : Set G) m := by + cases m with + | zero => + exact { toFun := fun p => ⟨p.1,trivial⟩ + invFun := fun p => (p.1,PUnit.unit) + left_inv := fun _ => rfl + right_inv := fun _ => rfl } + | succ m => + change (G × PEmpty.{u+1}) ≃ PEmpty + exact Equiv.equivOfIsEmpty _ _ +lemma zeroEquiv_map (m : ℕ) (g h : G) (i : ZeroOrbits.{u} m) (x : Fin m → ℝ) : + RelCWComplex.map m (zeroEquiv m (g*h,i)) x = g • RelCWComplex.map m (zeroEquiv m (h,i)) x := by + cases m with + | zero => rfl + | succ m => exact i.elim +lemma discrete_dim {X : Type u} [TopologicalSpace X] [DiscreteTopology X] + (m : ℕ) (i : RelCWComplex.cell (univ : Set X) m) : m ≤ 0 := by + cases m with + | zero => exact le_rfl + | succ m => exact i.elim + +def pointCover : C(G,PUnit.{u+1}) := .const _ PUnit.unit +lemma pointCover_quotient : IsQuotientCoveringMap (pointCover (G := G)) G where + __ := show IsQuotientMap (pointCover (G := G)) from + (show IsOpenMap (pointCover (G := G)) from fun _ _ => isOpen_discrete _).isQuotientMap + (by fun_prop) (fun _ => ⟨1,rfl⟩) + __ := (inferInstance : ContinuousConstSMul G G) + apply_eq_iff_mem_orbit := by + intro x y + constructor + · intro _; exact ⟨x*y⁻¹,by simp [smul_eq_mul]⟩ + · intro _; rfl + disjoint x := by + refine ⟨{x},(isOpen_discrete _).mem_nhds (Set.mem_singleton x),?_⟩ + rintro g ⟨z,⟨y,hy,rfl⟩,h⟩ + simp only [Set.mem_singleton_iff] at hy h + rw [hy] at h + exact mul_right_cancel (show g*x=1*x by simpa only [smul_eq_mul,one_mul] using h) + +def zeroStage : Stage G 0 where + E := G + B := PUnit.{u+1} + topE := inferInstance + topB := inferInstance + nonemptyE := inferInstance + nonemptyB := inferInstance + sepE := realSeparated_of_tychonoff + sepB := realSeparated_of_tychonoff + cwE := inferInstance + cwB := inferInstance + action := inferInstance + continuousAction := inferInstance + orbits := ZeroOrbits + orbitFinite := inferInstance + equiv := zeroEquiv + equiv_map := zeroEquiv_map + dimE := discrete_dim + dimB := discrete_dim + finiteB m := by + cases m with + | zero => + change Finite (univ : Set PUnit.{u+1}) + infer_instance + | succ m => + change Finite PEmpty + infer_instance + fill m hm a := by + have hm : m = 0 := Nat.eq_zero_of_le_zero hm + subst m + obtain ⟨e,he⟩ := SphereTopology.fill_zero a + exact ⟨e,he⟩ + p := pointCover + covering := pointCover_quotient +end Zero + +variable (hunif : ∀ S : Milnor.Shapes G, ∃ (T : Milnor.Shapes G) (hST : S ⊆ T), + (Milnor.stageIncl G S T hST).Nullhomotopic) +variable {n : ℕ} (S : Stage G n) + +def nextIndex : Type u := (exists_finite_brown_attachment S.equiv S.equiv_map hunif n S.fill S.dimE S.sepE).choose +instance : Finite (nextIndex hunif S) := + (exists_finite_brown_attachment S.equiv S.equiv_map hunif n S.fill S.dimE S.sepE).choose_spec.choose + +def attaching : nextIndex hunif S → C(Cellular.Sphere (n+1),S.E) := + (exists_finite_brown_attachment S.equiv S.equiv_map hunif n S.fill S.dimE S.sepE).choose_spec.choose_spec.choose +lemma attaching_fill : LowFillable (Space (equivariantFamily (G := G) (attaching hunif S))) (n+1) := + (exists_finite_brown_attachment S.equiv S.equiv_map hunif n S.fill S.dimE S.sepE).choose_spec.choose_spec.choose_spec + +def downstairs (i : nextIndex hunif S) : C(Cellular.Sphere (n+1),S.B) := S.p.comp (attaching hunif S i) + +instance nextE_nonempty : Nonempty (Space (equivariantFamily (G := G) (attaching hunif S))) := + ⟨base _ (Classical.choice S.nonemptyE)⟩ +instance nextB_nonempty : Nonempty (Space (downstairs hunif S)) := ⟨base _ (Classical.choice S.nonemptyB)⟩ +instance nextE_t2 : T2Space (Space (equivariantFamily (G := G) (attaching hunif S))) := + (realSeparated _ S.sepE).t2Space +instance nextB_t2 : T2Space (Space (downstairs hunif S)) := (realSeparated _ S.sepB).t2Space + +def nextStage : Stage G (n+1) where + E := Space (equivariantFamily (G := G) (attaching hunif S)) + B := Space (downstairs hunif S) + topE := inferInstance + topB := inferInstance + nonemptyE := inferInstance + nonemptyB := inferInstance + sepE := realSeparated _ S.sepE + sepB := realSeparated _ S.sepB + cwE := equivariantLayerCW S.equiv S.equiv_map (attaching hunif S) (fun m i => Nat.lt_succ_of_le (S.dimE m i)) + cwB := layerCW (downstairs hunif S) (fun m i => Nat.lt_succ_of_le (S.dimB m i)) + action := inferInstance + continuousAction := inferInstance + orbits := LayerOrbits (ι := S.orbits) (I := nextIndex hunif S) (n := n+1) + orbitFinite m := by dsimp [LayerOrbits]; infer_instance + equiv _ := Equiv.refl _ + equiv_map := equivariantLayerCW_smul S.equiv S.equiv_map (attaching hunif S) _ + dimE m i := Nat.le_of_lt_succ (equivariantLayerCW_dims S.equiv S.equiv_map (attaching hunif S) _ m i) + dimB m i := Nat.le_of_lt_succ (layerCW_dimensions (downstairs hunif S) _ m i) + finiteB := layerCW_finite_cells (downstairs hunif S) S.finiteB _ + fill := attaching_fill hunif S + p := coverMap (attaching hunif S) S.p S.covering (downstairs hunif S) (fun _ _ => rfl) + covering := coverMap_isQuotientCovering _ _ _ _ _ +end + +section +open Set Metric Topology Cellular Attachment +universe u +variable {G : Type u} [Group G] +variable (hunif : ∀ S : Milnor.Shapes G, ∃ (T : Milnor.Shapes G) (hST : S ⊆ T), + (Milnor.stageIncl G S T hST).Nullhomotopic) +variable {n : ℕ} (S : Stage G n) + +def nextInE : C(S.E,(nextStage hunif S).E) := ⟨base _,continuous_base _⟩ +def nextInB : C(S.B,(nextStage hunif S).B) := ⟨base _,continuous_base _⟩ +lemma nextInE_closed : IsClosedEmbedding (nextInE hunif S) := base_closedEmbedding _ +lemma nextInB_closed : IsClosedEmbedding (nextInB hunif S) := base_closedEmbedding _ +lemma nextInE_smul (g : G) (x : S.E) : nextInE hunif S (g • x) = g • nextInE hunif S x := rfl +lemma next_square (x : S.E) : + (nextStage hunif S).p (nextInE hunif S x) = nextInB hunif S (S.p x) := rfl + +def nextCellE (m : ℕ) : S.cwE.cell m → (nextStage hunif S).cwE.cell m := + layerOld S.equiv S.equiv_map (attaching hunif S) _ m +lemma nextCellE_injective (m : ℕ) : Function.Injective (nextCellE hunif S m) := + layerOld_injective _ _ _ _ m +lemma nextCellE_exhaustive (m : ℕ) (hm : m ≠ n+1) (i : (nextStage hunif S).cwE.cell m) : + ∃ j,nextCellE hunif S m j = i := layerOld_exhaustive _ _ _ _ m hm i +lemma nextCellE_map (m : ℕ) (i : S.cwE.cell m) (x : Fin m → ℝ) : + nextInE hunif S (S.cwE.map m i x) = (nextStage hunif S).cwE.map m (nextCellE hunif S m i) x := + (layerOld_map _ _ _ _ m i x).symm + +def nextCellB (m : ℕ) : S.cwB.cell m → (nextStage hunif S).cwB.cell m := Sum.inl +lemma nextCellB_injective (m : ℕ) : Function.Injective (nextCellB hunif S m) := Sum.inl_injective +lemma nextCellB_exhaustive (m : ℕ) (hm : m ≠ n+1) (i : (nextStage hunif S).cwB.cell m) : + ∃ j,nextCellB hunif S m j = i := by + cases i with + | inl i => exact ⟨i,rfl⟩ + | inr i => exact (hm i.down.1.down).elim +lemma nextCellB_map (m : ℕ) (i : S.cwB.cell m) (x : Fin m → ℝ) : + nextInB hunif S (S.cwB.map m i x) = (nextStage hunif S).cwB.map m (nextCellB hunif S m i) x := rfl + +lemma nextE_extendsReal (f : C(S.E,ℝ)) : ∃ F : C((nextStage hunif S).E,ℝ), + ∀ x,F (nextInE hunif S x) = f x := exists_real_extension _ f +lemma nextB_extendsReal (f : C(S.B,ℝ)) : ∃ F : C((nextStage hunif S).B,ℝ), + ∀ x,F (nextInB hunif S x) = f x := exists_real_extension _ f +lemma nextE_extendsSlice (U : Set S.E) (hU : IsOpen U) + (hd : ∀ g : G, ((g • ·) '' U ∩ U).Nonempty → g = 1) : + ∃ V : Set (nextStage hunif S).E, IsOpen V ∧ (nextInE hunif S) ⁻¹' V = U ∧ + ∀ g : G,((g • ·) '' V ∩ V).Nonempty → g = 1 := + ⟨thickening _ U,thickening_isOpen _ hU,rfl, + thickening_disjoint _ (equivariantFamily_smul (attaching hunif S)) hd⟩ +end + +open Set Metric Topology Cellular Attachment +universe u +variable {G : Type u} [Group G] [TopologicalSpace G] [DiscreteTopology G] +variable (hunif : ∀ S : Milnor.Shapes G, ∃ (T : Milnor.Shapes G) (hST : S ⊆ T), + (Milnor.stageIncl G S T hST).Nullhomotopic) + +def stages : (n : ℕ) → Stage G n + | 0 => zeroStage + | n+1 => nextStage hunif (stages n) +abbrev E (n : ℕ) := (stages hunif n).E +abbrev B (n : ℕ) := (stages hunif n).B + +def eStep (n : ℕ) : C(E hunif n,E hunif (n+1)) := nextInE hunif (stages hunif n) +def bStep (n : ℕ) : C(B hunif n,B hunif (n+1)) := nextInB hunif (stages hunif n) +abbrev eMap := Sequential.map (E hunif) (eStep hunif) +abbrev bMap := Sequential.map (B hunif) (bStep hunif) +lemma eMap_closed : ∀ i j h,IsClosedEmbedding (eMap hunif i j h) := + Sequential.map_closedEmbedding _ _ (fun n => nextInE_closed hunif (stages hunif n)) +lemma bMap_closed : ∀ i j h,IsClosedEmbedding (bMap hunif i j h) := + Sequential.map_closedEmbedding _ _ (fun n => nextInB_closed hunif (stages hunif n)) + +instance : TopologicalTower.EquivariantSystem (G := G) (E hunif) (eMap hunif) where + map_smul i j h g x := by + induction j,h using Nat.le_induction with + | base => simp only [eMap,Sequential.map_self,ContinuousMap.id_apply] + | succ j h ih => + simp only [eMap,Sequential.map_succ _ _ i j h,ContinuousMap.comp_apply] + change eStep hunif j (eMap hunif i j h (g • x)) = g • eStep hunif j (eMap hunif i j h x) + rw [ih] + exact nextInE_smul hunif (stages hunif j) g _ + +def eCells : Sequential.CellSteps (E hunif) (eStep hunif) where + cell n := nextCellE hunif (stages hunif n) + injective n := nextCellE_injective hunif (stages hunif n) + dim n := (stages hunif n).dimE + exhaustive n := nextCellE_exhaustive hunif (stages hunif n) + compatibility n := nextCellE_map hunif (stages hunif n) +def bCells : Sequential.CellSteps (B hunif) (bStep hunif) where + cell n := nextCellB hunif (stages hunif n) + injective n := nextCellB_injective hunif (stages hunif n) + dim n := (stages hunif n).dimB + exhaustive n := nextCellB_exhaustive hunif (stages hunif n) + compatibility n := nextCellB_map hunif (stages hunif n) + +abbrev Total := TopologicalTower.Space (E hunif) (eMap hunif) +abbrev Base := TopologicalTower.Space (B hunif) (bMap hunif) +instance : Nonempty (Total hunif) := ⟨TopologicalTower.of (E hunif) (eMap hunif) 0 (1:G)⟩ +instance : Nonempty (Base hunif) := ⟨TopologicalTower.of (B hunif) (bMap hunif) 0 PUnit.unit⟩ + +lemma e_extendsReal : TopologicalTower.ExtendsReals (E hunif) (eMap hunif) := by + intro n f + obtain ⟨extension, hextension⟩ := nextE_extendsReal hunif (stages hunif n) f + refine ⟨extension, ?_⟩ + intro point + rw [eMap, Sequential.map_step] + exact hextension point +lemma b_extendsReal : TopologicalTower.ExtendsReals (B hunif) (bMap hunif) := by + intro n f + obtain ⟨extension, hextension⟩ := nextB_extendsReal hunif (stages hunif n) f + refine ⟨extension, ?_⟩ + intro point + rw [bMap, Sequential.map_step] + exact hextension point +instance totalT2 : T2Space (Total hunif) := + TopologicalTower.t2Space _ _ (eMap_closed hunif) (e_extendsReal hunif) (fun n => (stages hunif n).sepE) +instance baseT2 : T2Space (Base hunif) := + TopologicalTower.t2Space _ _ (bMap_closed hunif) (b_extendsReal hunif) (fun n => (stages hunif n).sepB) +instance totalCW : CWComplex (univ : Set (Total hunif)) := + CellularTower.cwComplex _ _ (eMap_closed hunif) (Sequential.cellSystem _ _ (eCells hunif)) +instance baseCW : CWComplex (univ : Set (Base hunif)) := + CellularTower.cwComplex _ _ (bMap_closed hunif) (Sequential.cellSystem _ _ (bCells hunif)) +lemma base_finite (n : ℕ) : Finite ((baseCW hunif).cell n) := + (stages hunif n).finiteB n + +lemma eventually_fills : TopologicalTower.EventuallyFills (E hunif) (eMap hunif) := by + intro n k a + let j := max n k + obtain ⟨F,hF⟩ := (stages hunif j).fill n (le_max_left n k) + ((eMap hunif k j (le_max_right n k)).comp a) + exact ⟨j,le_max_right n k,F,hF⟩ +instance totalContractible : ContractibleSpace (Total hunif) := + TopologicalTower.contractible _ _ (eMap_closed hunif) (eventually_fills hunif) + +lemma e_extendsSlices : TopologicalTower.ExtendsSlices (G := G) (E hunif) (eMap hunif) := by + intro n U + obtain ⟨V,hV,hpre,hdis⟩ := nextE_extendsSlice hunif (stages hunif n) U.carrier U.isOpen U.disjoint + refine ⟨⟨V,hV,hdis⟩,?_⟩ + rw [eMap, Sequential.map_step] + exact hpre + +def pStage (n : ℕ) : C(E hunif n,B hunif n) := (stages hunif n).p +lemma p_compat (i j : ℕ) (h : i ≤ j) (x : E hunif i) : + pStage hunif j (eMap hunif i j h x) = bMap hunif i j h (pStage hunif i x) := by + induction j,h using Nat.le_induction with + | base => simp only [eMap,bMap,Sequential.map_self,ContinuousMap.id_apply] + | succ j h ih => + simp only [eMap,bMap,Sequential.map_succ _ _ i j h,ContinuousMap.comp_apply] + change pStage hunif (j+1) (eStep hunif j (eMap hunif i j h x)) = bStep hunif j (bMap hunif i j h (pStage hunif i x)) + exact (next_square hunif (stages hunif j) _).trans (congrArg (bStep hunif j) ih) + +def pLimit : C(Total hunif,Base hunif) := + TopologicalTower.limitMap _ _ _ _ (pStage hunif) (p_compat hunif) +lemma pLimit_covering : IsQuotientCoveringMap (pLimit hunif) G := + TopologicalTower.limitMap_isQuotientCovering _ _ _ _ (pStage hunif) (p_compat hunif) + (eMap_closed hunif) (bMap_closed hunif) (fun n => (stages hunif n).covering) (e_extendsSlices hunif) + +instance baseConnected : ConnectedSpace (Base hunif) := + (pLimit_covering hunif).surjective.connectedSpace (pLimit hunif).continuous + +include hunif in + +theorem geometric_of_uniform : HasTypeFInfinity G := by + refine ⟨Base hunif,inferInstance,inferInstance,inferInstance,baseCW hunif,base_finite hunif,?_,?_⟩ + · let e : Total hunif := Classical.choice inferInstance + refine ⟨pLimit hunif e,⟨?_⟩⟩ + exact ((pLimit_covering hunif).fundamentalGroupEquiv ⟨e,rfl⟩).trans (MulEquiv.inv' G).symm + · exact ⟨Total hunif,inferInstance,inferInstance,pLimit hunif, + (pLimit_covering hunif).surjective,(pLimit_covering hunif).isCoveringMap⟩ +end UniversalFInfinity.Brown + +end + +end OAI diff --git a/lean/OAI/GroupTheory/UniversalGroup/Cayley.lean b/lean/OAI/GroupTheory/UniversalGroup/Cayley.lean new file mode 100644 index 0000000000000000000000000000000000000000..d7ac7ebe84bfedaf778beb57ecbc0768dbe87377 --- /dev/null +++ b/lean/OAI/GroupTheory/UniversalGroup/Cayley.lean @@ -0,0 +1,427 @@ +import OAI.GroupTheory.UniversalGroup.CellularAttachment + +namespace OAI + +noncomputable section + +open Set Metric Topology BigOperators +open Set Metric Topology + +namespace UniversalFInfinity.Cayley +open Set Metric Topology Attachment +universe u + +lemma sphere_one_cases (x : Sphere 1) : x.1 0 = -1 ∨ x.1 0 = 1 := by + have hn : ‖x.1‖ = 1 := by simpa only [mem_sphere,dist_zero_right] using x.2 + have hc : x.1 = fun _ => x.1 0 := funext (fun i => congrArg x.1 (Subsingleton.elim i 0)) + rw [hc,pi_norm_const,Real.norm_eq_abs] at hn + exact ((abs_eq (by norm_num : (0:ℝ) ≤ 1)).mp hn).symm + +instance : Finite (Sphere 1) := by + have he : {r : ℝ | r = -1 ∨ r = 1} = {-1,1} := by ext r; simp + have hS : Set.Finite {r : ℝ | r = -1 ∨ r = 1} := he.symm ▸ ((Set.finite_singleton (1 : ℝ)).insert (-1)) + let : Finite {r : ℝ // r = -1 ∨ r = 1} := hS.to_subtype + apply Finite.of_injective (fun x : Sphere 1 => (⟨x.1 0,sphere_one_cases x⟩ : + {r : ℝ // r = -1 ∨ r = 1})) + intro x y h + apply Subtype.ext + funext i + have hi : i = 0 := Subsingleton.elim _ _ + simpa only [hi] using congrArg Subtype.val h + +instance : DiscreteTopology (Sphere 1) := inferInstance + +def minus : Sphere 1 := ⟨fun _ => -1,by norm_num [mem_sphere,dist_pi_def]⟩ +def plus : Sphere 1 := ⟨fun _ => 1,by norm_num [mem_sphere,dist_pi_def]⟩ + +variable {G : Type u} [Group G] [TopologicalSpace G] [DiscreteTopology G] +variable {S : Type u} (s : S → G) + +def attaching (i : S) : C(Sphere 1,G) := + ⟨fun x => if x.1 0 = -1 then 1 else s i,continuous_of_discreteTopology⟩ + +abbrev Graph := Space (equivariantFamily (G := G) (attaching s)) + +instance : Nonempty (Graph s) := ⟨base _ 1⟩ + +def vertex (g : G) : Graph s := base _ g + +omit [Group G] in +lemma discrete_dimension (m : ℕ) (i : RelCWComplex.cell (Set.univ : Set G) m) : m < 1 := by + cases m with + | zero => omega + | succ m => exact i.elim + +instance graphCW : CWComplex (Set.univ : Set (Graph s)) := + layerCW _ discrete_dimension + +instance : T2Space (Graph s) := + t2Space _ ((realSeparated_of_tychonoff (Y := G))) + +lemma graph_dimension (m : ℕ) (i : RelCWComplex.cell (Set.univ : Set (Graph s)) m) : m < 2 := + layerCW_dimensions _ discrete_dimension m i + +lemma vertex_injective : Function.Injective (vertex s) := Sum.inl_injective + +lemma cell_minus (g : G) (i : S) : + cell (equivariantFamily (G := G) (attaching s)) (g,i) (boundary 1 minus) = vertex s g := by + refine (cell_boundary (equivariantFamily (G := G) (attaching s)) (g,i) minus).trans ?_ + change base _ (g * attaching s i minus) = vertex s g + simp only [attaching,ContinuousMap.coe_mk,minus,ite_true,mul_one] + rfl + +lemma cell_plus (g : G) (i : S) : + cell (equivariantFamily (G := G) (attaching s)) (g,i) (boundary 1 plus) = vertex s (g*s i) := by + refine (cell_boundary (equivariantFamily (G := G) (attaching s)) (g,i) plus).trans ?_ + change base _ (g * attaching s i plus) = vertex s (g * s i) + norm_num only [attaching,ContinuousMap.coe_mk,plus,ite_false] + rfl + +instance disk_pathConnected (n : ℕ) : PathConnectedSpace (Disk n) := + isPathConnected_iff_pathConnectedSpace.mp ((convex_closedBall (0 : Fin n → ℝ) 1).isPathConnected ⟨0,mem_closedBall_self (by norm_num)⟩) + +lemma cell_joined (g : G) (i : S) : Joined (vertex s g) (vertex s (g*s i)) := by + have h : Joined (boundary 1 minus) (boundary 1 plus) := PathConnectedSpace.joined _ _ + have hh := h.map (cell (equivariantFamily (G := G) (attaching s)) (g,i)).continuous + simpa only [cell_minus,cell_plus] using hh + +lemma vertex_smul (g h : G) : g • vertex s h = vertex s (g*h) := rfl + +lemma vertices_joined (hs : Subgroup.closure (Set.range s) = ⊤) (g : G) : + Joined (vertex s 1) (vertex s g) := by + let K : Subgroup G := + { carrier := {g | Joined (vertex s 1) (vertex s g)} + one_mem' := Joined.refl _ + mul_mem' := by + intro g h hg hh + have hh' := hh.map (continuous_const_smul g : Continuous (fun x : Graph s => g • x)) + rw [vertex_smul,vertex_smul,mul_one] at hh' + exact hg.trans hh' + inv_mem' := by + intro g hg + have hh := hg.symm.map (continuous_const_smul g⁻¹ : Continuous (fun x : Graph s => g⁻¹ • x)) + change Joined (vertex s 1) (vertex s g⁻¹) + simpa only [vertex_smul,mul_one,inv_mul_cancel] using hh } + have hK : Subgroup.closure (Set.range s) ≤ K := (Subgroup.closure_le K).2 (by + rintro _ ⟨i,rfl⟩ + change Joined (vertex s 1) (vertex s (s i)) + simpa only [one_mul] using cell_joined s 1 i) + rw [hs] at hK + exact hK (Subgroup.mem_top g) + +lemma graph_pathConnected (hs : Subgroup.closure (Set.range s) = ⊤) : PathConnectedSpace (Graph s) := by + have hj : ∀ x : Graph s, Joined (vertex s 1) x := by + intro x + cases x with + | inl g => exact vertices_joined s hs g + | inr p => + have h : Joined (boundary 1 minus) (interior 1 p.2) := PathConnectedSpace.joined _ _ + have hh := h.map (cell (equivariantFamily (G := G) (attaching s)) p.1).continuous + rw [cell_interior] at hh + have hp : cell (equivariantFamily (G := G) (attaching s)) p.1 (boundary 1 minus) = vertex s p.1.1 := + cell_minus s p.1.1 p.1.2 + rw [hp] at hh + exact (vertices_joined s hs p.1.1).trans hh + exact ⟨inferInstance,fun x y => (hj x).symm.trans (hj y)⟩ + +end UniversalFInfinity.Cayley + +namespace UniversalFInfinity.PathSquares +open Set +open scoped unitInterval +variable {X : Type*} [TopologicalSpace X] {x a b : X} + +lemma turn (p : Path x a) (q : Path x b) (e : Path a b) + (h : (p.trans e).Homotopic q) : e.Homotopic (p.symm.trans q) := by + apply (Path.Homotopic.refl_trans e).symm.trans + apply ((Path.Homotopic.symm_trans p).symm.hcomp (Path.Homotopic.refl e)).trans + exact (Path.Homotopic.trans_assoc p.symm p e).trans ((Path.Homotopic.refl p.symm).hcomp h) + +def spanContract (p : Path x a) (q : Path x b) : + (p.symm.trans q).toContinuousMap.Homotopy (.const _ x) where + toFun z := if (z.2 : ℝ) ≤ 1/2 then p.extend ((1-z.1)*(1-2*z.2)) + else q.extend ((1-z.1)*(2*z.2-1)) + continuous_toFun := continuous_if_le (by fun_prop) continuous_const + (by fun_prop) (by fun_prop) (by intro z hz; simp [hz]) + map_zero_left z := by simp [Path.trans,Path.extend_symm_apply] + map_one_left z := by simp + +lemma spanContract_source (p : Path x a) (q : Path x b) (t : I) : + spanContract p q (t,0) = p.symm t := by + change (if (0 : ℝ) ≤ 1/2 then p.extend ((1-(t:ℝ))*(1-2*0)) else q.extend ((1-(t:ℝ))*(2*0-1))) = _ + norm_num only [show (0:ℝ)≤1/2 by norm_num,ite_true,mul_zero,sub_zero,mul_one] + rw [← Path.extend_symm_apply,Path.extend_extends' ] +lemma spanContract_target (p : Path x a) (q : Path x b) (t : I) : + spanContract p q (t,1) = q.symm t := by + change (if (1 : ℝ) ≤ 1/2 then p.extend ((1-(t:ℝ))*(1-2*1)) else q.extend ((1-(t:ℝ))*(2*1-1))) = _ + norm_num only [mul_one,show (2:ℝ)-1=1 by norm_num,show ¬(1:ℝ)≤1/2 by norm_num,ite_false] + rw [← Path.extend_symm_apply,Path.extend_extends' ] + +def pauseReverse (p : Path x a) : C(I,X) := ((Path.refl a).trans p.symm).toContinuousMap + +theorem edgeSquare (p : Path x a) (q : Path x b) (e : Path a b) + (h : (p.trans e).Homotopic q) : + ∃ H : e.toContinuousMap.Homotopy (.const _ x), + (∀ t, H (t,0) = pauseReverse p t) ∧ (∀ t, H (t,1) = pauseReverse q t) := by + obtain ⟨A⟩ := turn p q e h + refine ⟨A.toHomotopy.trans (spanContract p q),?_,?_⟩ + · intro t + rw [ContinuousMap.Homotopy.trans_apply] + split_ifs with ht + · change (t:ℝ) ≤ 1/2 at ht + change A (_,0) = ((Path.refl a).trans p.symm) t + rw [Path.trans_apply,dite_eq_left ht] + exact A.source _ + · change ¬(t:ℝ) ≤ 1/2 at ht + change spanContract p q (_,0) = ((Path.refl a).trans p.symm) t + rw [Path.trans_apply,dite_eq_right ht,spanContract_source] + · intro t + rw [ContinuousMap.Homotopy.trans_apply] + split_ifs with ht + · change (t:ℝ) ≤ 1/2 at ht + change A (_,1) = ((Path.refl b).trans q.symm) t + rw [Path.trans_apply,dite_eq_left ht] + exact A.target _ + · change ¬(t:ℝ) ≤ 1/2 at ht + change spanContract p q (_,1) = ((Path.refl b).trans q.symm) t + rw [Path.trans_apply,dite_eq_right ht,spanContract_target] +end UniversalFInfinity.PathSquares +namespace UniversalFInfinity.Cayley +open Set Metric Topology Attachment +open scoped unitInterval +universe u v + +def edgeParam (t : I) : Disk 1 := ⟨fun _ => 2*(t:ℝ)-1,by + rw [mem_closedBall,dist_zero_right,pi_norm_le_iff_of_nonneg zero_le_one] + intro i + rw [Real.norm_eq_abs,abs_le] + constructor <;> linarith [t.2.1,t.2.2]⟩ +lemma continuous_edgeParam : Continuous edgeParam := by unfold edgeParam; fun_prop + +def edgeTime (d : Disk 1) : I := ⟨(d.1 0+1)/2,by + have hh : |d.1 0| ≤ 1 := by + have := d.2 + rw [mem_closedBall,dist_zero_right,pi_norm_le_iff_of_nonneg zero_le_one] at this + exact this 0 + rw [abs_le] at hh + constructor <;> linarith⟩ +lemma continuous_edgeTime : Continuous edgeTime := by + apply Continuous.subtype_mk + exact (((continuous_apply 0).comp continuous_subtype_val).add continuous_const).div_const 2 +lemma edgeParam_time (d : Disk 1) : edgeParam (edgeTime d) = d := by + apply Subtype.ext + funext i + have hi : i = 0 := Subsingleton.elim _ _ + subst i + dsimp [edgeParam,edgeTime] + ring +lemma edgeTime_param (t : I) : edgeTime (edgeParam t) = t := by + apply Subtype.ext + dsimp [edgeTime,edgeParam] + ring +lemma edgeParam_zero : edgeParam 0 = boundary 1 minus := by + apply Subtype.ext + funext i + norm_num [edgeParam,minus,boundary] +lemma edgeParam_one : edgeParam 1 = boundary 1 plus := by + apply Subtype.ext + funext i + norm_num [edgeParam,plus,boundary] +lemma edgeTime_minus : edgeTime (boundary 1 minus) = 0 := by + rw [←edgeParam_zero,edgeTime_param] +lemma edgeTime_plus : edgeTime (boundary 1 plus) = 1 := by + rw [←edgeParam_one,edgeTime_param] +lemma sphere_one_eq (t : Sphere 1) : t = minus ∨ t = plus := by + obtain h|h := sphere_one_cases t + · left; apply Subtype.ext; funext i; have hi : i=0 := Subsingleton.elim _ _; subst i; exact h + · right; apply Subtype.ext; funext i; have hi : i=0 := Subsingleton.elim _ _; subst i; exact h + +variable {G : Type u} [Group G] [TopologicalSpace G] [DiscreteTopology G] +variable {S : Type u} (s : S → G) + +def edge (g : G) (i : S) : Path (vertex s g) (vertex s (g*s i)) where + toFun t := cell (equivariantFamily (G := G) (attaching s)) (g,i) (edgeParam t) + continuous_toFun := (cell _ _).continuous.comp continuous_edgeParam + source' := by rw [edgeParam_zero,cell_minus] + target' := by rw [edgeParam_one,cell_plus] + +variable {Y : Type v} [TopologicalSpace Y] (f : C(Graph s,Y)) (y : Y) +variable (p : ∀ g, Path y (f (vertex s g))) +variable (hp : ∀ g i, ((p g).trans ((edge s g i).map f.continuous)).Homotopic (p (g*s i))) + +def edgeSquare (g : G) (i : S) : ((edge s g i).map f.continuous).toContinuousMap.Homotopy (.const _ y) := + (PathSquares.edgeSquare (p g) (p (g*s i)) ((edge s g i).map f.continuous) (hp g i)).choose +lemma edgeSquare_source (g : G) (i : S) (t : I) : + edgeSquare s f y p hp g i (t,0) = PathSquares.pauseReverse (p g) t := + (PathSquares.edgeSquare (p g) (p (g*s i)) ((edge s g i).map f.continuous) (hp g i)).choose_spec.1 t +lemma edgeSquare_target (g : G) (i : S) (t : I) : + edgeSquare s f y p hp g i (t,1) = PathSquares.pauseReverse (p (g*s i)) t := + (PathSquares.edgeSquare (p g) (p (g*s i)) ((edge s g i).map f.continuous) (hp g i)).choose_spec.2 t + +def edgePaths (i : FreeIndex G S) : C(Disk 1,C(I,Y)) := + ContinuousMap.curry ⟨fun z => edgeSquare s f y p hp i.1 i.2 (z.2,edgeTime z.1), + (edgeSquare s f y p hp i.1 i.2).continuous.comp + (continuous_snd.prodMk (continuous_edgeTime.comp continuous_fst))⟩ +def vertexPaths : C(G,C(I,Y)) := ⟨fun g => PathSquares.pauseReverse (p g),continuous_of_discreteTopology⟩ +lemma edgePaths_boundary (i : FreeIndex G S) (t : Sphere 1) : + edgePaths s f y p hp i (boundary 1 t) = + vertexPaths s f y p (equivariantFamily (G := G) (attaching s) i t) := by + obtain rfl|rfl := sphere_one_eq t + · apply ContinuousMap.ext; intro z + change edgeSquare s f y p hp i.1 i.2 (z,edgeTime (boundary 1 minus)) = _ + rw [edgeTime_minus,edgeSquare_source] + simp only [vertexPaths,equivariantFamily,attaching,ContinuousMap.coe_mk,minus,ite_true,smul_eq_mul,mul_one] + · apply ContinuousMap.ext; intro z + change edgeSquare s f y p hp i.1 i.2 (z,edgeTime (boundary 1 plus)) = _ + rw [edgeTime_plus,edgeSquare_target] + norm_num [vertexPaths,equivariantFamily,attaching,plus] + +def graphPaths : C(Graph s,C(I,Y)) := + lift _ (vertexPaths s f y p) (edgePaths s f y p hp) (edgePaths_boundary s f y p hp) + +lemma graphPaths_zero (z : Graph s) : graphPaths s f y p hp z 0 = f z := by + cases z with + | inl g => + change PathSquares.pauseReverse (p g) 0 = _ + exact Path.source _ + | inr z => + change edgeSquare s f y p hp z.1.1 z.1.2 (0,edgeTime (interior 1 z.2)) = _ + rw [ContinuousMap.Homotopy.apply_zero] + change f (cell _ z.1 (edgeParam (edgeTime (interior 1 z.2)))) = f _ + rw [edgeParam_time,cell_interior] +lemma graphPaths_one (z : Graph s) : graphPaths s f y p hp z 1 = y := by + cases z with + | inl g => + change PathSquares.pauseReverse (p g) 1 = y + exact Path.target _ + | inr z => + change edgeSquare s f y p hp z.1.1 z.1.2 (1,edgeTime (interior 1 z.2)) = y + exact ContinuousMap.Homotopy.apply_one _ _ + +def graphNullhomotopy : f.Homotopy (.const _ y) where + toFun z := graphPaths s f y p hp z.2 z.1 + continuous_toFun := (graphPaths s f y p hp).uncurry.continuous.comp continuous_swap + map_zero_left := graphPaths_zero s f y p hp + map_one_left := graphPaths_one s f y p hp +end UniversalFInfinity.Cayley +open Set Metric Topology + +namespace UniversalFInfinity.Cellular +open Set Metric Topology +variable {Y : Type*} [TopologicalSpace Y] + +theorem cylinderFill {n : ℕ} (a : C(Sphere n,C(unitInterval,Y))) (b : C(Disk n,Y × Y)) + (h : ∀ x, pathEndpoint (a x) = b (boundary n x)) + (F : C(Disk (n+1),Y)) (hF : ∀ x, F (boundary (n+1) x) = cylinderBoundaryMap a b h x) : + ∃ e : C(Disk n,C(unitInterval,Y)), + (∀ x, e (boundary n x) = a x) ∧ (∀ x, pathEndpoint (e x) = b x) := by + let e : C(Disk n,C(unitInterval,Y)) := + (F.comp ⟨fun q : Disk n × unitInterval => diskCons q.1 q.2,continuous_diskCons⟩).curry + refine ⟨e,?_,?_⟩ + · intro x + apply ContinuousMap.ext + intro t + let s : Sphere (n+1) := ⟨_,cons_mem_sphere_of_boundary x t⟩ + have hs : s ∈ cylinderFace n none := by + change (diskTail (diskCons (boundary n x) t)).1 ∈ sphere 0 1 + rw [diskTail_cons] + exact x.2 + change F (diskCons (boundary n x) t) = a x t + rw [show diskCons (boundary n x) t = boundary (n+1) s from rfl,hF, + cylinderBoundaryMap_face a b h none ⟨s,hs⟩] + change a (faceSphere ⟨s,hs⟩) (diskTime (diskCons (boundary n x) t)) = a x t + rw [diskTime_cons] + congr 1 + · intro x + apply Prod.ext + · let s : Sphere (n+1) := ⟨_,cons_zero_mem_sphere x⟩ + have hs : s ∈ cylinderFace n (some false) := by + change (diskCons x 0).1 0 = -1 + norm_num [diskCons] + change F (diskCons x 0) = (b x).1 + rw [show diskCons x 0 = boundary (n+1) s from rfl,hF, + cylinderBoundaryMap_face a b h (some false) ⟨s,hs⟩] + change (b (diskTail (diskCons x 0))).1 = (b x).1 + rw [diskTail_cons] + · let s : Sphere (n+1) := ⟨_,cons_one_mem_sphere x⟩ + have hs : s ∈ cylinderFace n (some true) := by + change (diskCons x 1).1 0 = 1 + norm_num [diskCons] + change F (diskCons x 1) = (b x).2 + rw [show diskCons x 1 = boundary (n+1) s from rfl,hF, + cylinderBoundaryMap_face a b h (some true) ⟨s,hs⟩] + change (b (diskTail (diskCons x 1))).2 = (b x).2 + rw [diskTail_cons] + +end UniversalFInfinity.Cellular +namespace UniversalFInfinity.LoopSphere +open Set Metric Topology Cellular +open scoped unitInterval +universe u v +variable {X : Type u} [TopologicalSpace X] {x : X} + +def sides : C(Sphere 1,C(I,X)) := .const _ (.const _ x) +def ends (p : Path x x) : C(Disk 1,X × X) := + ⟨fun d => (p (Cayley.edgeTime d),x), + (p.continuous.comp Cayley.continuous_edgeTime).prodMk continuous_const⟩ +lemma ends_sides (p : Path x x) (z : Sphere 1) : + pathEndpoint (sides (x := x) z) = ends p (boundary 1 z) := by + obtain rfl|rfl := Cayley.sphere_one_eq z + · change (x,x) = (p (Cayley.edgeTime (Attachment.boundary 1 Cayley.minus)),x) + rw [Cayley.edgeTime_minus,p.source] + · change (x,x) = (p (Cayley.edgeTime (Attachment.boundary 1 Cayley.plus)),x) + rw [Cayley.edgeTime_plus,p.target] + +def map (p : Path x x) : C(Sphere 2,X) := cylinderBoundaryMap sides (ends p) (ends_sides p) + +theorem homotopic_of_fill (p : Path x x) (F : C(Disk 2,X)) + (hF : ∀ z, F (boundary 2 z) = map p z) : p.Homotopic (Path.refl x) := by + obtain ⟨e,he,hep⟩ := cylinderFill sides (ends p) (ends_sides p) F hF + refine ⟨{ + toFun := fun z => e (Cayley.edgeParam z.2) z.1 + continuous_toFun := e.uncurry.continuous.comp + ((Cayley.continuous_edgeParam.comp continuous_snd).prodMk continuous_fst) + map_zero_left := ?_ + map_one_left := ?_ + prop' := ?_ }⟩ + · intro t + have h := congrArg Prod.fst (hep (Cayley.edgeParam t)) + change e (Cayley.edgeParam t) 0 = p t + change e (Cayley.edgeParam t) 0 = p (Cayley.edgeTime (Cayley.edgeParam t)) at h + simpa only [Cayley.edgeTime_param] using h + · intro t + exact congrArg Prod.snd (hep (Cayley.edgeParam t)) + · intro t q hq + obtain rfl|hq := hq + · change e (Cayley.edgeParam 0) t = p 0 + rw [Cayley.edgeParam_zero,p.source] + exact ContinuousMap.congr_fun (he Cayley.minus) t + · obtain rfl := Set.mem_singleton_iff.mp hq + change e (Cayley.edgeParam 1) t = p 1 + rw [Cayley.edgeParam_one,p.target] + exact ContinuousMap.congr_fun (he Cayley.plus) t + +variable {Y : Type v} [TopologicalSpace Y] +lemma natural (p : Path x x) (f : C(X,Y)) : map (p.map f.continuous) = f.comp (map p) := by + apply ContinuousMap.ext; intro z + have hz : z ∈ ⋃ i, cylinderFace 1 i := by rw [cylinderFace_cover]; trivial + obtain ⟨i,hi⟩ := Set.mem_iUnion.mp hz + change cylinderBoundaryMap sides (ends (p.map f.continuous)) (ends_sides _) z = + f (cylinderBoundaryMap sides (ends p) (ends_sides p) z) + rw [cylinderBoundaryMap_face _ _ _ i ⟨z,hi⟩,cylinderBoundaryMap_face _ _ _ i ⟨z,hi⟩] + cases i with + | none => rfl + | some b => cases b <;> rfl + +lemma homotopic_map_of_fill (p : Path x x) (f : C(X,Y)) (F : C(Disk 2,Y)) + (hF : ∀ z, F (boundary 2 z) = f (map p z)) : + (p.map f.continuous).Homotopic (Path.refl (f x)) := by + apply homotopic_of_fill _ F + intro z + rw [natural] + exact hF z +end UniversalFInfinity.LoopSphere + +end + +end OAI diff --git a/lean/OAI/GroupTheory/UniversalGroup/CellRetractions.lean b/lean/OAI/GroupTheory/UniversalGroup/CellRetractions.lean new file mode 100644 index 0000000000000000000000000000000000000000..1b33d2eaadaf02ad6e2ae3228bb82366f361bc9f --- /dev/null +++ b/lean/OAI/GroupTheory/UniversalGroup/CellRetractions.lean @@ -0,0 +1,495 @@ +import OAI.GroupTheory.UniversalGroup.CoveringAttachments + +namespace OAI + +noncomputable section + +open Set Metric Topology BigOperators +open Set Metric Topology +open Set Topology + +open Set Metric Topology +open scoped NNReal +namespace UniversalFInfinity.GeneralPosition + +section +variable {K : Type*} [MetricSpace K] [CompactSpace K] + +lemma lipschitz_mul {f g : C(K,ℝ)} {L M : ℝ≥0} + (hf : LipschitzWith L f) (hg : LipschitzWith M g) : + LipschitzWith (‖f‖₊ * M + ‖g‖₊ * L) (f * g) := by + apply LipschitzWith.of_dist_le_mul + intro x y + simp only [ContinuousMap.mul_apply,NNReal.coe_add,NNReal.coe_mul,coe_nnnorm] + calc + dist (f x * g x) (f y * g y) + = ‖f x * (g x-g y) + g y * (f x-f y)‖ := by + rw [dist_eq_norm]; congr 1; ring + _ ≤ ‖f x * (g x-g y)‖ + ‖g y * (f x-f y)‖ := norm_add_le _ _ + _ = ‖f x‖ * dist (g x) (g y) + ‖g y‖ * dist (f x) (f y) := by + rw [norm_mul,norm_mul,dist_eq_norm,dist_eq_norm] + _ ≤ ‖f‖ * ((M:ℝ) * dist x y) + ‖g‖ * ((L:ℝ) * dist x y) := by + gcongr + · exact f.norm_coe_le_norm x + · exact hg.dist_le_mul x y + · exact g.norm_coe_le_norm y + · exact hf.dist_le_mul x y + _ = (‖f‖ * M + ‖g‖ * L) * dist x y := by ring + +def lipschitzAlgebra : Subalgebra ℝ C(K,ℝ) where + carrier := {f | ∃ L, LipschitzWith L f} + zero_mem' := ⟨0,LipschitzWith.const 0⟩ + one_mem' := ⟨0,LipschitzWith.const 1⟩ + add_mem' := by rintro f g ⟨L,hL⟩ ⟨M,hM⟩; exact ⟨L+M,hL.add hM⟩ + mul_mem' := by rintro f g ⟨L,hL⟩ ⟨M,hM⟩; exact ⟨_,lipschitz_mul hL hM⟩ + algebraMap_mem' r := ⟨0,LipschitzWith.const r⟩ + +lemma lipschitzAlgebra_separates : (lipschitzAlgebra (K := K)).SeparatesPoints := by + intro x y hxy + refine ⟨fun z => dist z y,⟨⟨fun z => dist z y,continuous_id.dist continuous_const⟩, + ⟨1,LipschitzWith.dist_left y⟩,rfl⟩,?_⟩ + simpa using hxy + +lemma exists_lipschitz_approximation (f : C(K,ℝ)) {ε : ℝ} (hε : 0 < ε) : + ∃ g : C(K,ℝ), (∃ L, LipschitzWith L g) ∧ ∀ x, ‖g x-f x‖ < ε := by + obtain ⟨g,hg⟩ := ContinuousMap.exists_mem_subalgebra_near_continuous_of_separatesPoints + lipschitzAlgebra lipschitzAlgebra_separates f f.continuous ε hε + exact ⟨g,g.2,hg⟩ + +end + +section +open Set Metric Topology +open scoped NNReal ENNReal +variable {K : Type*} [MetricSpace K] [CompactSpace K] + +lemma exists_lipschitz_vector_approximation {n : ℕ} (f : C(K,Fin n → ℝ)) + {ε : ℝ} (hε : 0 < ε) : + ∃ g : C(K,Fin n → ℝ), (∃ L, LipschitzWith L g) ∧ ∀ x, ‖g x-f x‖ < ε := by + classical + have hex : ∀ i : Fin n, ∃ g : C(K,ℝ), (∃ L, LipschitzWith L g) ∧ + ∀ x, ‖g x-f x i‖ < ε := fun i => + exists_lipschitz_approximation ⟨fun x => f x i,(continuous_apply i).comp f.continuous⟩ hε + choose g hg he using hex + choose L hL using hg + let H : C(K,Fin n → ℝ) := ⟨fun x i => g i x,continuous_pi (fun i => (g i).continuous)⟩ + refine ⟨H,⟨Finset.univ.sup L,?_⟩,?_⟩ + · apply LipschitzWith.of_dist_le_mul + intro x y + rw [dist_pi_le_iff (mul_nonneg (NNReal.coe_nonneg _) dist_nonneg)] + intro i + exact (hL i).dist_le_mul x y |>.trans (mul_le_mul_of_nonneg_right + (by exact_mod_cast Finset.le_sup (f := L) (Finset.mem_univ i)) dist_nonneg) + · intro x + exact (pi_norm_lt_iff hε).mpr (fun i => he i x) + +omit [CompactSpace K] in + +lemma exists_missing_point {n : ℕ} {g : K → Fin n → ℝ} {L : ℝ≥0} + (hg : LipschitzWith L g) (hdim : dimH (Set.univ : Set K) < n) + (c : Fin n → ℝ) {r : ℝ} (hr : 0 < r) : + ∃ a ∈ Metric.ball c r, a ∉ Set.range g := by + by_contra! h + have hle : dimH (Metric.ball c r) ≤ dimH (Set.range g) := dimH_mono h + rw [Real.dimH_ball_pi_fin _ hr] at hle + exact (not_le_of_gt hdim) (hle.trans hg.dimH_range_le) + +lemma exists_nonzero_approximation {n : ℕ} (f : C(K,Fin n → ℝ)) + (hdim : dimH (Set.univ : Set K) < n) {ε : ℝ} (hε : 0 < ε) : + ∃ g : C(K,Fin n → ℝ), (∀ x, g x ≠ 0) ∧ ∀ x, ‖g x-f x‖ < ε := by + obtain ⟨h,⟨L,hL⟩,hh⟩ := exists_lipschitz_vector_approximation f (half_pos hε) + obtain ⟨a,ha,ha'⟩ := exists_missing_point hL hdim 0 (half_pos hε) + refine ⟨h - ContinuousMap.const K a,?_,?_⟩ + · intro x hx + apply ha' + exact ⟨x,sub_eq_zero.mp hx⟩ + · intro x + have ha : ‖a‖ < ε/2 := by simpa only [Metric.mem_ball,dist_zero_right] using ha + change ‖(h x-a)-f x‖ < ε + have hhx := hh x + calc + ‖(h x-a)-f x‖ = ‖(h x-f x)-a‖ := by congr 1; abel + _ ≤ ‖h x-f x‖+‖a‖ := norm_sub_le _ _ + _ < ε := by linarith + +end + +open Set Metric Topology +open scoped NNReal ENNReal +variable {K : Type*} [MetricSpace K] [CompactSpace K] + +def cutoff (δ r : ℝ) : ℝ := min 1 (max 0 (2-r/δ)) +lemma cutoff_nonneg (δ r : ℝ) : 0 ≤ cutoff δ r := le_min (by norm_num) (le_max_left _ _) +lemma cutoff_le_one (δ r : ℝ) : cutoff δ r ≤ 1 := min_le_left _ _ +lemma cutoff_small {δ r : ℝ} (hδ : 0 < δ) (hr : r ≤ δ) : cutoff δ r = 1 := by + apply min_eq_left + apply le_max_of_le_right + have : r/δ ≤ 1 := (div_le_one hδ).mpr hr + linarith +lemma cutoff_large {δ r : ℝ} (hδ : 0 < δ) (hr : 2*δ ≤ r) : cutoff δ r = 0 := by + have : 2 ≤ r/δ := (le_div_iff₀ hδ).mpr hr + simp only [cutoff,max_eq_left (by linarith : 2-r/δ ≤ 0),min_eq_right (by norm_num : (0:ℝ)≤1)] +lemma continuous_cutoff (δ : ℝ) : Continuous (cutoff δ) := + continuous_const.min (continuous_const.max (continuous_const.sub (continuous_id.div_const δ))) + +lemma exists_relative_nonzero_approximation {n : ℕ} (f : C(K,Fin n → ℝ)) + (hdim : dimH (Set.univ : Set K) < n) {δ : ℝ} (hδ : 0 < δ) : + ∃ g : C(K,Fin n → ℝ), (∀ x, g x ≠ 0) ∧ + (∀ x, 2*δ ≤ ‖f x‖ → g x = f x) ∧ ∀ x, ‖g x-f x‖ < δ/2 := by + obtain ⟨h,hne,hh⟩ := exists_nonzero_approximation f hdim (half_pos hδ) + let g : C(K,Fin n → ℝ) := ⟨fun x => f x + cutoff δ ‖f x‖ • (h x-f x), + f.continuous.add (((continuous_cutoff δ).comp f.continuous.norm).smul + (h.continuous.sub f.continuous))⟩ + have hdist (x : K) : ‖g x-f x‖ < δ/2 := by + change ‖(f x+cutoff δ ‖f x‖ • (h x-f x))-f x‖ < δ/2 + rw [add_sub_cancel_left,norm_smul,Real.norm_of_nonneg (cutoff_nonneg _ _)] + exact (mul_le_of_le_one_left (norm_nonneg _) (cutoff_le_one _ _)).trans_lt (hh x) + refine ⟨g,?_,?_,hdist⟩ + · intro x hx + by_cases hnorm : ‖f x‖ ≤ δ + · have hg : g x = h x := by + change f x+cutoff δ ‖f x‖ • (h x-f x)=h x + rw [cutoff_small hδ hnorm,one_smul,add_sub_cancel] + exact hne x (hg.symm.trans hx) + · have hd := hdist x + rw [hx,zero_sub,norm_neg] at hd + linarith + · intro x hx + change f x+cutoff δ ‖f x‖ • (h x-f x)=f x + rw [cutoff_large hδ hx,zero_smul,add_zero] + +omit [MetricSpace K] [CompactSpace K] in + +lemma relative_interpolation_bound {n : ℕ} {f g : K → Fin n → ℝ} {δ : ℝ} (hδ : 0 < δ) + (hfix : ∀ x, 2*δ ≤ ‖f x‖ → g x = f x) + (hdist : ∀ x, ‖g x-f x‖ < δ/2) + (x : K) (hx : ‖f x‖ ≤ 4*δ) (t : unitInterval) : + ‖f x+(t:ℝ) • (g x-f x)‖ ≤ 4*δ := by + by_cases hc : 2*δ ≤ ‖f x‖ + · rw [hfix x hc,sub_self,smul_zero,add_zero] + exact hx + · have ht : ‖(t:ℝ) • (g x-f x)‖ ≤ ‖g x-f x‖ := by + rw [norm_smul,Real.norm_of_nonneg t.2.1] + exact mul_le_of_le_one_left (norm_nonneg _) t.2.2 + have hsum := norm_add_le (f x) ((t:ℝ) • (g x-f x)) + have hd := hdist x + linarith + +end UniversalFInfinity.GeneralPosition + +namespace UniversalFInfinity.Cellular + +section +open Set Metric Topology +open scoped ENNReal NNReal +variable {Y : Type*} [TopologicalSpace Y] [T2Space Y] {n : ℕ} + +abbrev ChartDisk (n : ℕ) := Metric.ball (0 : Fin n → ℝ) 1 +abbrev ChartCore (n : ℕ) := Metric.closedBall (0 : Fin n → ℝ) (1/2) + +def chartCoreInclusion (n : ℕ) : C(ChartCore n,ChartDisk n) := + ⟨fun x => ⟨x.1, (mem_closedBall.mp x.2).trans_lt (by norm_num)⟩, + continuous_subtype_val.subtype_mk _⟩ + +def chartCore (e : C(ChartDisk n,Y)) : C(ChartCore n,Y) := e.comp (chartCoreInclusion n) + +lemma chartCore_closedEmbedding (e : C(ChartDisk n,Y)) (he : IsOpenEmbedding e) : + IsClosedEmbedding (chartCore e) := by + apply (chartCore e).continuous.isClosedEmbedding + intro x y h + apply Subtype.ext + exact congrArg (fun z : ChartDisk n => z.1) (he.injective h) + +variable {K : Type*} [MetricSpace K] + +def chartDomain (e : C(ChartDisk n,Y)) (f : C(K,Y)) : Set K := f ⁻¹' Set.range (chartCore e) + +lemma chartDomain_closed (e : C(ChartDisk n,Y)) (he : IsOpenEmbedding e) (f : C(K,Y)) : + IsClosed (chartDomain e f) := (chartCore_closedEmbedding e he).isClosed_range.preimage f.continuous + +def coreCoordinate (e : C(ChartDisk n,Y)) (he : IsOpenEmbedding e) (f : C(K,Y)) : + C(chartDomain e f,ChartCore n) := + ⟨fun x => (chartCore_closedEmbedding e he).toIsEmbedding.toHomeomorph.symm ⟨f x,x.2⟩, + (chartCore_closedEmbedding e he).toIsEmbedding.toHomeomorph.symm.continuous.comp + ((f.continuous.comp continuous_subtype_val).subtype_mk _)⟩ + +lemma coreCoordinate_fac (e : C(ChartDisk n,Y)) (he : IsOpenEmbedding e) (f : C(K,Y)) + (x : chartDomain e f) : chartCore e (coreCoordinate e he f x) = f x := + congrArg Subtype.val ((chartCore_closedEmbedding e he).toIsEmbedding.toHomeomorph.apply_symm_apply _) + +lemma coreCoordinate_frontier (e : C(ChartDisk n,Y)) (he : IsOpenEmbedding e) (f : C(K,Y)) + (x : chartDomain e f) (hx : (x:K) ∈ frontier (chartDomain e f)) : + ‖(coreCoordinate e he f x : Fin n → ℝ)‖ = 1/2 := by + apply le_antisymm + · simpa only [mem_closedBall,dist_zero_right] using (coreCoordinate e he f x).2 + · by_contra! h + let U : Set (ChartDisk n) := {z | ‖(z : Fin n → ℝ)‖ < 1/2} + have hU : IsOpen U := isOpen_lt (continuous_subtype_val.norm) continuous_const + have hsub : f ⁻¹' (e '' U) ⊆ chartDomain e f := by + intro y hy + obtain ⟨z,hz,hzy⟩ := hy + exact ⟨⟨z.1,by simpa only [mem_closedBall,dist_zero_right] using le_of_lt hz⟩,hzy⟩ + have hxU : (x:K) ∈ f ⁻¹' (e '' U) := by + refine ⟨chartCoreInclusion n (coreCoordinate e he f x),h,?_⟩ + exact coreCoordinate_fac e he f x + exact hx.2 (mem_interior.mpr ⟨f ⁻¹' (e '' U),hsub, + (he.isOpenMap U hU).preimage f.continuous,hxU⟩) + +omit [T2Space Y] in +lemma chartDomain_dimH_le (e : C(ChartDisk n,Y)) (f : C(K,Y)) : + dimH (Set.univ : Set (chartDomain e f)) ≤ dimH (Set.univ : Set K) := by + rw [← isometry_subtype_coe.dimH_image] + exact dimH_mono (Set.subset_univ _) + +end + +section +open Set Metric Topology +open scoped ENNReal NNReal +variable {Y : Type*} [TopologicalSpace Y] {n : ℕ} +variable {K : Type*} [MetricSpace K] + +def chartCenter (e : C(ChartDisk n,Y)) : Y := e ⟨0,by simp⟩ + +lemma exists_chart_avoidance [T2Space Y] [CompactSpace K] (e : C(ChartDisk n,Y)) (he : IsOpenEmbedding e) (f : C(K,Y)) + (hdim : dimH (Set.univ : Set K) < n) : + ∃ (g : C(K,Y)) (H : f.Homotopy g), + (∀ x, g x ≠ chartCenter e) ∧ + (∀ (t : unitInterval) (x : K), f x ∉ Set.range e → H (t,x) = f x) ∧ + (∀ (t : unitInterval) (x : K), H (t,x) = f x ∨ H (t,x) ∈ Set.range e) := by + let A := chartDomain e f + have hA : IsClosed A := chartDomain_closed e he f + let : CompactSpace A := isCompact_iff_compactSpace.mp hA.isCompact + let u : C(A,Fin n → ℝ) := ⟨fun x => (coreCoordinate e he f x).1, + continuous_subtype_val.comp (coreCoordinate e he f).continuous⟩ + obtain ⟨v,hv0,hvfix,hvdist⟩ := GeneralPosition.exists_relative_nonzero_approximation u + ((chartDomain_dimH_le e f).trans_lt hdim) (δ := 1/8) (by norm_num) + have hi (t : unitInterval) (x : A) : ‖u x+(t:ℝ) • (v x-u x)‖ ≤ 1/2 := by + have hu : ‖u x‖ ≤ 4*(1/8:ℝ) := by + simpa only [u,ContinuousMap.coe_mk,show (4:ℝ)*(1/8)=1/2 by norm_num,mem_closedBall,dist_zero_right] + using (coreCoordinate e he f x).2 + simpa only [show (4:ℝ)*(1/8)=1/2 by norm_num] using + GeneralPosition.relative_interpolation_bound (by norm_num : (0:ℝ)<1/8) + hvfix hvdist x hu t + have hvc (x : A) : v x ∈ ChartCore n := by + have h := hi 1 x + simpa only [Set.Icc.coe_one,one_smul,add_sub_cancel,mem_closedBall,dist_zero_right] using h + let vcore : C(A,ChartCore n) := ⟨fun x => ⟨v x,hvc x⟩, + v.continuous.subtype_mk hvc⟩ + let gA : C(A,Y) := (chartCore e).comp vcore + let HA : (f.restrict A).Homotopy gA := + { toFun := fun tx => chartCore e ⟨u tx.2+(tx.1:ℝ) • (v tx.2-u tx.2),by + simpa only [mem_closedBall,dist_zero_right] using hi tx.1 tx.2⟩ + continuous_toFun := (chartCore e).continuous.comp + (((u.continuous.comp continuous_snd).add + ((continuous_subtype_val.comp continuous_fst).smul + ((v.continuous.comp continuous_snd).sub (u.continuous.comp continuous_snd)))).subtype_mk + (fun tx => by + simpa only [ChartCore,mem_closedBall,dist_zero_right,Pi.add_apply, + Pi.smul_apply',Pi.sub_apply,Function.comp_apply] using hi tx.1 tx.2)) + map_zero_left := fun x => by + simp only [Set.Icc.coe_zero,zero_smul,add_zero] + exact coreCoordinate_fac e he f x + map_one_left := fun x => by + simp only [Set.Icc.coe_one,one_smul,add_sub_cancel] + rfl } + have hboundary (t : unitInterval) (x : A) (hx : (x:K) ∈ frontier A) : + HA (t,x) = f x := by + have hfix : v x = u x := hvfix x (by + change 2*(1/8:ℝ) ≤ ‖(coreCoordinate e he f x).1‖ + rw [coreCoordinate_frontier e he f x hx] + norm_num) + change chartCore e ⟨u x+(t:ℝ) • (v x-u x),_⟩ = f x + simp only [hfix,sub_self,smul_zero,add_zero] + exact coreCoordinate_fac e he f x + let hg : ∀ x : A, (x:K) ∈ frontier A → gA x = f x := + fun x hx => by simpa using hboundary 1 x hx + let g := patch hA f gA hg + let H : f.Homotopy g := patchHomotopy hA f gA HA hboundary + have hOn (t : unitInterval) (x : A) : H (t,(x:K)) = HA (t,x) := by + change patchFun (Prod.snd ⁻¹' A) _ _ (t,(x:K)) = _ + rw [patchFun,dite_eq_left (show (t,(x:K)) ∈ Prod.snd ⁻¹' A from x.2)] + rfl + have hOff (t : unitInterval) (x : K) (hx : x ∉ A) : H (t,x) = f x := by + change patchFun (Prod.snd ⁻¹' A) _ _ (t,x) = _ + rw [patchFun,dite_eq_right (show (t,x) ∉ Prod.snd ⁻¹' A from hx)] + rfl + refine ⟨g,H,?_,?_,?_⟩ + · intro x hzero + by_cases hx : x ∈ A + · have hv : chartCore e (vcore ⟨x,hx⟩) = chartCenter e := by + exact (patch_on hA f gA hg ⟨x,hx⟩).symm.trans hzero + have hu := congrArg (fun z : ChartDisk n => z.1) (he.injective hv) + exact hv0 ⟨x,hx⟩ hu + · have hfx : f x = chartCenter e := (patch_off hA f gA hg hx).symm.trans hzero + apply hx + exact ⟨⟨0,by simp⟩,hfx.symm⟩ + · intro t x hx + apply hOff + rintro ⟨z,hz⟩ + exact hx ⟨chartCoreInclusion n z,hz⟩ + · intro t x + by_cases hx : x ∈ A + · right + rw [hOn t ⟨x,hx⟩] + exact ⟨_,rfl⟩ + · exact Or.inl (hOff t x hx) + +end + +open Set Metric Topology +open scoped ENNReal NNReal +section +variable {Y : Type*} [TopologicalSpace Y] {K : Type*} [TopologicalSpace K] + +lemma homotopy_trans_pointwise {f g h : C(K,Y)} (H : f.Homotopy g) (J : g.Homotopy h) + (P : K → Y → Prop) (hH : ∀ t x, P x (H (t,x))) (hJ : ∀ t x, P x (J (t,x))) : + ∀ t x, P x (H.trans J (t,x)) := by + intro t x + rw [ContinuousMap.Homotopy.trans_apply] + split_ifs + · exact hH _ x + · exact hJ _ x + +end +variable {Y : Type*} [TopologicalSpace Y] [T2Space Y] {n : ℕ} +variable {K : Type*} [MetricSpace K] [CompactSpace K] {ι : Type*} +variable (e : ι → C(ChartDisk n,Y)) (he : ∀ i, IsOpenEmbedding (e i)) +variable (hd : Pairwise (fun i j => Disjoint (Set.range (e i)) (Set.range (e j)))) + +omit [T2Space Y] in +lemma chartCenter_mem_range (i : ι) : chartCenter (e i) ∈ Set.range (e i) := ⟨_,rfl⟩ + +include he hd in +lemma exists_finite_chart_avoidance (f : C(K,Y)) (hdim : dimH (Set.univ : Set K) < n) + (S : Finset ι) : + ∃ (g : C(K,Y)) (H : f.Homotopy g), + (∀ i ∈ S, ∀ x, g x ≠ chartCenter (e i)) ∧ + (∀ t x, H (t,x) = f x ∨ ∃ i ∈ S, H (t,x) ∈ Set.range (e i)) ∧ + (∀ t x, (∀ i ∈ S, f x ∉ Set.range (e i)) → H (t,x) = f x) := by + classical + induction S using Finset.induction_on with + | empty => + exact ⟨f,.refl f,by simp,(fun _ _ => Or.inl rfl),fun _ _ _ => rfl⟩ + | @insert a S ha ih => + obtain ⟨g,H,hg,hH,hstat⟩ := ih + obtain ⟨g',J,hg',hJstat,hJ⟩ := exists_chart_avoidance (e a) (he a) g hdim + refine ⟨g',H.trans J,?_,?_,?_⟩ + · intro i hi x + rcases Finset.mem_insert.mp hi with rfl | hi + · exact hg' x + · intro hzero + rcases hJ 1 x with hj | hj + · have hh : g' x = g x := by simpa using hj + exact hg i hi x (hh.symm.trans hzero) + · have hj : g' x ∈ Set.range (e a) := by simpa using hj + rw [hzero] at hj + exact (hd (by intro heq; subst i; exact ha hi)).notMem_of_mem_left hj + (chartCenter_mem_range e i) + · apply homotopy_trans_pointwise H J + (fun x y => y = f x ∨ ∃ i ∈ insert a S, y ∈ Set.range (e i)) + · intro t x + rcases hH t x with h | ⟨i,hi,h⟩ + · exact Or.inl h + · exact Or.inr ⟨i,Finset.mem_insert_of_mem hi,h⟩ + · intro t x + rcases hJ t x with h | h + · rw [h] + have hh : g x = f x ∨ ∃ i ∈ S, g x ∈ Set.range (e i) := by simpa using hH 1 x + rcases hh with h | ⟨i,hi,h⟩ + · exact Or.inl h + · exact Or.inr ⟨i,Finset.mem_insert_of_mem hi,h⟩ + · exact Or.inr ⟨a,Finset.mem_insert_self _ _,h⟩ + · intro t x hx + have hfixed : ∀ t, H (t,x) = f x := fun t => + hstat t x (fun i hi => hx i (Finset.mem_insert_of_mem hi)) + have hgx : g x = f x := by simpa using hfixed 1 + have hjfixed : ∀ t, J (t,x) = f x := fun t => + (hJstat t x (by rw [hgx]; exact hx a (Finset.mem_insert_self _ _))).trans hgx + rw [ContinuousMap.Homotopy.trans_apply] + split_ifs + · exact hfixed _ + · exact hjfixed _ + +include he hd in +lemma exists_all_chart_avoidance (f : C(K,Y)) (hdim : dimH (Set.univ : Set K) < n) + (S : Finset ι) (hs : ∀ i, i ∉ S → ∀ x, f x ∉ Set.range (e i)) : + ∃ (g : C(K,Y)) (H : f.Homotopy g), + (∀ i x, g x ≠ chartCenter (e i)) ∧ + (∀ t x, (∀ i, f x ∉ Set.range (e i)) → H (t,x) = f x) := by + classical + obtain ⟨g,H,hg,hH,hstat⟩ := exists_finite_chart_avoidance e he hd f hdim S + refine ⟨g,H,?_,?_⟩ + · intro i x + by_cases hi : i ∈ S + · exact hg i hi x + · intro hzero + have hh : g x = f x ∨ ∃ j ∈ S, g x ∈ Set.range (e j) := by simpa using hH 1 x + rcases hh with h | ⟨j,hj,h⟩ + · apply hs i hi x + rw [← h,hzero] + exact chartCenter_mem_range e i + · rw [hzero] at h + exact (hd (by intro heq; subst j; exact hi hj)).notMem_of_mem_left h + (chartCenter_mem_range e i) + · intro t x hx + exact hstat t x (fun i _ => hx i) + +end UniversalFInfinity.Cellular + +namespace UniversalFInfinity.Attachment +open Set Metric Topology +variable {X : Type*} [TopologicalSpace X] {ι : Type*} {n : ℕ} +variable (a : ι → C(Sphere n,X)) [T2Space (Space a)] +variable {K : Type*} [MetricSpace K] [CompactSpace K] + +def chart (i : ι) : C(Cellular.ChartDisk n,Space a) := + ⟨openCell a i,(openCell_openEmbedding a i).continuous⟩ + +lemma exists_deformation_into_base (f : C(K,Space a)) + (hdim : dimH (Set.univ : Set K) < n) : + ∃ (g : C(K,X)) (H : f.Homotopy ((⟨base a,continuous_base a⟩ : C(X,Space a)).comp g)), + ∀ t x, f x ∈ Set.range (base a) → H (t,x) = f x := by + classical + let I := {i : ι | (Set.range f ∩ Set.range (openCell a i)).Nonempty} + have hI : I.Finite := compact_finitely_many_openCells a (isCompact_range f.continuous) + have hs : ∀ i, i ∉ hI.toFinset → ∀ x, f x ∉ Set.range (chart a i) := by + intro i hi x hx + apply hi + rw [Set.Finite.mem_toFinset] + exact ⟨f x,Set.mem_range_self x,hx⟩ + obtain ⟨g,H,hg,hstat⟩ := Cellular.exists_all_chart_avoidance (chart a) + (fun i => openCell_openEmbedding a i) (fun i j hij => openCell_disjoint a i j hij) + f hdim hI.toFinset hs + have hgp (x : K) : g x ∈ punctured a := by + rintro ⟨i,hi⟩ + exact hg i x hi.symm + let gp : C(K,punctured a) := ⟨fun x => ⟨g x,hgp x⟩,g.continuous.subtype_mk hgp⟩ + let J := (radialHomotopy a).compContinuousMap gp + have hJ0 : (puncturedInclusion a).comp gp = g := rfl + let J' : g.Homotopy ((radialEnd a).comp gp) := hJ0 ▸ J + refine ⟨(radialRetraction a).comp gp,H.trans J',?_⟩ + intro t x hx + obtain ⟨y,hy⟩ := hx + have hfixed (s : unitInterval) : H (s,x) = f x := by + apply hstat s x + intro i + rintro ⟨d,hd⟩ + rw [← hy] at hd + cases hd + have hgx : g x = base a y := by simpa only [ContinuousMap.Homotopy.apply_one,← hy] using hfixed 1 + have hgp' : gp x = puncturedBase a y := Subtype.ext hgx + have hjfixed (s : unitInterval) : J' (s,x) = f x := by + change radialHomotopy a (s,gp x) = f x + rw [hgp',radialHomotopy_base,hy] + change (H.trans J') (t,x) = f x + rw [ContinuousMap.Homotopy.trans_apply] + split_ifs + · exact hfixed _ + · exact hjfixed _ + +end UniversalFInfinity.Attachment + +end + +end OAI diff --git a/lean/OAI/GroupTheory/UniversalGroup/CellularApproximation.lean b/lean/OAI/GroupTheory/UniversalGroup/CellularApproximation.lean new file mode 100644 index 0000000000000000000000000000000000000000..61ef8a65d7335d5df45335a9e7e454bc3129f882 --- /dev/null +++ b/lean/OAI/GroupTheory/UniversalGroup/CellularApproximation.lean @@ -0,0 +1,655 @@ +import OAI.GroupTheory.UniversalGroup.GeneralPosition + +namespace OAI + +noncomputable section + +open Set Metric Topology BigOperators +open Set Metric Topology +open Set Topology +open Set Metric Topology +open scoped NNReal +open Set Metric Topology +open scoped NNReal ENNReal +open Set Metric Topology + +namespace UniversalFInfinity.Cellular + +section +open Set Metric Topology +universe u +variable {X : Type u} [TopologicalSpace X] [T2Space X] +variable {C : Set X} [CWComplex C] + +def skeletonBoundary (n : ℕ) (i : RelCWComplex.cell C n) : + C(Attachment.Sphere n,Skeleton C n) := + ⟨fun x => ⟨characteristic n i (boundary n x),sphere_mem_skeleton n i x⟩, + ((characteristic n i).continuous.comp (continuous_boundary n)).subtype_mk _⟩ + +def skeletonBase (n : ℕ) : C(Skeleton C n,Skeleton C (n+1)) := + ⟨fun x => ⟨x.1,skeleton_mono (Nat.le_succ n) x.2⟩,continuous_subtype_val.subtype_mk _⟩ + +def skeletonCell (n : ℕ) (i : RelCWComplex.cell C n) : + C(Attachment.Disk n,Skeleton C (n+1)) := + ⟨fun x => ⟨characteristic n i x,characteristic_mem_skeleton (Nat.lt_succ_self n) i x⟩, + (characteristic n i).continuous.subtype_mk _⟩ + +def skeletonAssembly (n : ℕ) : C(Attachment.Space (skeletonBoundary (C := C) n),Skeleton C (n+1)) := + Attachment.lift _ (skeletonBase n) (skeletonCell n) (fun _ _ => rfl) + +lemma skeletonAssembly_base (n : ℕ) (x : Skeleton C n) : + skeletonAssembly n (Attachment.base _ x) = skeletonBase n x := + Attachment.lift_base _ _ _ _ x + +lemma skeletonAssembly_cell (n : ℕ) (i : RelCWComplex.cell C n) (x : Disk n) : + skeletonAssembly n (Attachment.cell _ i x) = skeletonCell n i x := + Attachment.lift_cell _ _ _ _ i x + +lemma skeletonAssembly_interior (n : ℕ) (i : RelCWComplex.cell C n) (x : Attachment.OpenDisk n) : + skeletonAssembly n (Sum.inr ⟨i,x⟩) = skeletonCell n i (Attachment.interior n x) := by + rw [← Attachment.cell_interior (skeletonBoundary n) i x,skeletonAssembly_cell] + +lemma skeletonAssembly_injective (n : ℕ) : Function.Injective (skeletonAssembly (C := C) n) := by + intro a b hab + rcases a with a|⟨i,a⟩ <;> rcases b with b|⟨j,b⟩ + · change skeletonAssembly n (Attachment.base _ a) = skeletonAssembly n (Attachment.base _ b) at hab + rw [skeletonAssembly_base,skeletonAssembly_base] at hab + exact congrArg Sum.inl (Subtype.ext (congrArg (fun z : Skeleton C (n+1) => z.1) hab)) + · have hh := congrArg Subtype.val hab + rw [← show Attachment.base (skeletonBoundary n) a = Sum.inl a from rfl, + skeletonAssembly_base,skeletonAssembly_interior] at hh + have hm : a.1 ∈ CWComplex.openCell n j := ⟨b.1,b.2,hh.symm⟩ + exact False.elim (openCell_not_skeleton n j hm a.2) + · have hh := congrArg Subtype.val hab + rw [skeletonAssembly_interior, + ← show Attachment.base (skeletonBoundary n) b = Sum.inl b from rfl, + skeletonAssembly_base] at hh + have hm : b.1 ∈ CWComplex.openCell n i := ⟨a.1,a.2,hh⟩ + exact False.elim (openCell_not_skeleton n i hm b.2) + · have hh := congrArg Subtype.val hab + rw [skeletonAssembly_interior,skeletonAssembly_interior] at hh + have hij : i = j := by + by_contra hne + have hd := CWComplex.disjoint_openCell_of_ne (C := C) (i := i) (j := j) + (fun h => hne (sigma_mk_injective h)) + exact Set.disjoint_left.mp hd ⟨a.1,a.2,rfl⟩ ⟨b.1,b.2,hh.symm⟩ + subst j + have he : a = b := Subtype.ext ((RelCWComplex.map n i).injOn + (by simpa only [RelCWComplex.source_eq] using a.2) + (by simpa only [RelCWComplex.source_eq] using b.2) hh) + subst b; rfl + +lemma skeletonAssembly_surjective (n : ℕ) : Function.Surjective (skeletonAssembly (C := C) n) := by + intro x + have hx := x.2 + have heq : Skeleton C (n+1) = Skeleton C n ∪ + ⋃ i : RelCWComplex.cell C n,CWComplex.closedCell n i := by + simpa only [Skeleton,Nat.cast_add,Nat.cast_one] using + (CWComplex.skeletonLT_union_iUnion_closedCell_eq_skeletonLT_succ (C := C) n).symm + have hx' := (congrArg (fun S : Set X => x.1 ∈ S) heq).mp hx + rcases hx' with hx|hx + · exact ⟨Attachment.base _ ⟨x.1,hx⟩,skeletonAssembly_base n _⟩ + · obtain ⟨i,y,hy,he⟩ := Set.mem_iUnion.mp hx + refine ⟨Attachment.cell _ i ⟨y,hy⟩,?_⟩ + rw [skeletonAssembly_cell] + exact Subtype.ext he + +lemma skeletonAssembly_closed (n : ℕ) : IsClosedMap (skeletonAssembly (C := C) n) := by + intro S hS + let e : Attachment.Space (skeletonBoundary (C := C) n) → X := + fun x => (skeletonAssembly n x).1 + have hei : Function.Injective e := Subtype.val_injective.comp (skeletonAssembly_injective n) + have hclosed : IsClosed (e '' S) := by + apply (CWComplex.closed (Skeleton C (n+1)) _ ?_).mpr + · intro m j + have hm : m < n+1 := by + have hh : (m : ℕ∞) < ((n+1 : ℕ) : ℕ∞) := by + simpa only [RelCWComplex.skeletonLT_I,Set.mem_ofPred_eq] using j.2 + exact_mod_cast hh + have hu : ∃ u : C(Disk m,Attachment.Space (skeletonBoundary (C := C) n)), + ∀ x, e (u x) = characteristic m j.1 x := by + rcases Nat.lt_succ_iff_lt_or_eq.mp hm with hm|hm + · refine ⟨⟨fun x => Attachment.base _ + ⟨characteristic m j.1 x,characteristic_mem_skeleton hm j.1 x⟩, + (Attachment.continuous_base _).comp ((characteristic m j.1).continuous.subtype_mk _)⟩,?_⟩ + intro x; exact congrArg Subtype.val (skeletonAssembly_base n _) + · subst m + exact ⟨Attachment.cell _ j.1,fun x => congrArg Subtype.val (skeletonAssembly_cell n j.1 x)⟩ + obtain ⟨u,hu⟩ := hu + have heq : (e '' S) ∩ CWComplex.closedCell m j = + characteristic m j.1 '' (u ⁻¹' S) := by + ext x + constructor + · rintro ⟨⟨y,hy,rfl⟩,z,hz,he⟩ + refine ⟨⟨z,hz⟩,?_,he⟩ + change u ⟨z,hz⟩ ∈ S + have hh : u ⟨z,hz⟩ = y := hei ((hu _).trans he) + rwa [hh] + · rintro ⟨z,hz,rfl⟩ + exact ⟨⟨u z,hz,hu z⟩,z.1,z.2,rfl⟩ + rw [heq] + exact ((hS.preimage u.continuous).isCompact.image (characteristic m j.1).continuous).isClosed + · rintro x ⟨y,hy,rfl⟩ + exact (skeletonAssembly n y).2 + have h : IsClosed ((Subtype.val : Skeleton C (n+1) → X) ⁻¹' (e '' S)) := + hclosed.preimage continuous_subtype_val + convert h using 1 + ext x + constructor + · rintro ⟨y,hy,rfl⟩; exact ⟨y,hy,rfl⟩ + · rintro ⟨y,hy,he⟩; exact ⟨y,hy,Subtype.ext he⟩ + +def skeletonHomeomorph (n : ℕ) : + Attachment.Space (skeletonBoundary (C := C) n) ≃ₜ Skeleton C (n+1) := + (isHomeomorph_iff_continuous_isClosedMap_bijective.mpr + ⟨(skeletonAssembly n).continuous,skeletonAssembly_closed n, + skeletonAssembly_injective n,skeletonAssembly_surjective n⟩).homeomorph _ +end + +section +open Set Metric Topology +universe u +variable {G : Type u} [Group G] {X : Type u} [TopologicalSpace X] [T2Space X] + [MulAction G X] [ContinuousConstSMul G X] [CWComplex (univ : Set X)] +variable {ι : ℕ → Type u} +variable (σ : ∀ n, (G × ι n) ≃ RelCWComplex.cell (univ : Set X) n) +variable (hσ : ∀ n (g h : G) (i : ι n) (x : Fin n → ℝ), + RelCWComplex.map n (σ n (g*h,i)) x = g • RelCWComplex.map n (σ n (h,i)) x) + +omit [ContinuousConstSMul G X] in +include hσ in +lemma skeleton_smul_mem (n : ℕ) (g : G) {x : X} (hx : x ∈ Skeleton (univ : Set X) n) : + g • x ∈ Skeleton (univ : Set X) n := by + obtain ⟨m,hm,j,y,hy,rfl⟩ := (CWComplex.mem_skeletonLT_iff (C := (univ : Set X))).mp hx + let i := (σ m).symm j + have hj : σ m i = j := (σ m).apply_symm_apply j + apply (CWComplex.mem_skeletonLT_iff (C := (univ : Set X))).mpr + refine ⟨m,hm,σ m (g*i.1,i.2),y,hy,?_⟩ + rw [hσ] + exact congrArg (fun j => g • RelCWComplex.map m j y) hj + +def skeletonTranslate (n : ℕ) (g : G) : C(Skeleton (univ : Set X) n,Skeleton (univ : Set X) n) := + ⟨fun x => ⟨g • x.1,skeleton_smul_mem σ hσ n g x.2⟩, + ((continuous_const_smul g).comp continuous_subtype_val).subtype_mk _⟩ + +lemma skeletonTranslate_base (n : ℕ) (g : G) (x : Skeleton (univ : Set X) n) : + skeletonTranslate σ hσ (n+1) g (skeletonBase n x) = + skeletonBase n (skeletonTranslate σ hσ n g x) := rfl + +lemma skeletonTranslate_cell (n : ℕ) (g h : G) (i : ι n) (x : Disk n) : + skeletonTranslate σ hσ (n+1) g (skeletonCell n (σ n (h,i)) x) = + skeletonCell n (σ n (g*h,i)) x := by + apply Subtype.ext + exact (hσ n g h i x.1).symm + +variable {E : Type u} [TopologicalSpace E] [MulAction G E] [ContinuousConstSMul G E] + +lemma exists_equivariant_skeleton_extension (n : ℕ) + (b : C(Skeleton (univ : Set X) n,E)) + (hb : ∀ (g : G) x, b (skeletonTranslate σ hσ n g x) = g • b x) + (hfill : ∀ a : C(Sphere n,E), ∃ d : C(Disk n,E), ∀ x, d (boundary n x) = a x) : + ∃ e : C(Skeleton (univ : Set X) (n+1),E), + (∀ x, e (skeletonBase n x) = b x) ∧ + ∀ (g : G) x, e (skeletonTranslate σ hσ (n+1) g x) = g • e x := by + let a (i : ι n) := b.comp (skeletonBoundary n (σ n (1,i))) + choose d hd using fun i => hfill (a i) + let D (j : RelCWComplex.cell (univ : Set X) n) : C(Disk n,E) := + ⟨fun x => ((σ n).symm j).1 • d ((σ n).symm j).2 x, + (continuous_const_smul _).comp (d _).continuous⟩ + have hD (j : RelCWComplex.cell (univ : Set X) n) (x : Sphere n) : + D j (boundary n x) = b (skeletonBoundary n j x) := by + obtain ⟨⟨g,i⟩,rfl⟩ := (σ n).surjective j + change ((σ n).symm (σ n (g,i))).1 • d ((σ n).symm (σ n (g,i))).2 (boundary n x) = _ + rw [Equiv.symm_apply_apply,hd] + change g • b (skeletonBoundary n (σ n (1,i)) x) = _ + rw [←hb] + congr 1 + apply Subtype.ext + exact (hσ n g 1 i x.1).symm.trans (by rw [mul_one]; rfl) + let f := Attachment.lift (skeletonBoundary (C := (univ : Set X)) n) b D hD + let e : C(Skeleton (univ : Set X) (n+1),E) := f.comp ⟨(skeletonHomeomorph n).symm,(skeletonHomeomorph n).symm.continuous⟩ + have he_base (x : Skeleton (univ : Set X) n) : e (skeletonBase n x) = b x := by + change f ((skeletonHomeomorph n).symm (skeletonBase n x)) = _ + rw [←skeletonAssembly_base] + change f ((skeletonHomeomorph n).symm ((skeletonHomeomorph n) (Attachment.base _ x))) = _ + rw [Homeomorph.symm_apply_apply] + rfl + have he_cell (j : RelCWComplex.cell (univ : Set X) n) (x : Disk n) : + e (skeletonCell n j x) = D j x := by + change f ((skeletonHomeomorph n).symm (skeletonCell n j x)) = _ + rw [←skeletonAssembly_cell] + change f ((skeletonHomeomorph n).symm ((skeletonHomeomorph n) (Attachment.cell _ j x))) = _ + rw [Homeomorph.symm_apply_apply] + exact Attachment.lift_cell _ _ _ _ _ _ + refine ⟨e,he_base,?_⟩ + intro g x + obtain ⟨y,rfl⟩ := skeletonAssembly_surjective n x + cases y with + | inl x => + change e (skeletonTranslate σ hσ (n+1) g (skeletonBase n x)) = g • e (skeletonBase n x) + rw [skeletonTranslate_base,he_base,he_base,hb] + | inr p => + obtain ⟨⟨h,i⟩,hj⟩ := (σ n).surjective p.1 + have heq : skeletonAssembly n (Sum.inr p) = skeletonCell n p.1 (Attachment.interior n p.2) := by + exact skeletonAssembly_interior n p.1 p.2 + rw [heq,←hj,skeletonTranslate_cell,he_cell,he_cell] + change ((σ n).symm (σ n (g*h,i))).1 • d ((σ n).symm (σ n (g*h,i))).2 _ = + g • (((σ n).symm (σ n (h,i))).1 • d ((σ n).symm (σ n (h,i))).2 _) + simp only [Equiv.symm_apply_apply,mul_smul] +end + +section +open Set Metric Topology +universe u +variable {G : Type u} [Group G] {X : Type u} [TopologicalSpace X] [T2Space X] + [MulAction G X] [ContinuousConstSMul G X] [CWComplex (univ : Set X)] +variable {ι : ℕ → Type u} +variable (σ : ∀ n, (G × ι n) ≃ RelCWComplex.cell (univ : Set X) n) +variable (hσ : ∀ n (g h : G) (i : ι n) (x : Fin n → ℝ), + RelCWComplex.map n (σ n (g*h,i)) x = g • RelCWComplex.map n (σ n (h,i)) x) +variable {E B : Type u} [TopologicalSpace E] [TopologicalSpace B] + [MulAction G E] [ContinuousConstSMul G E] [MulAction G B] + +lemma exists_equivariant_skeleton_lift (n : ℕ) (p : C(E,B)) + (hp : ∀ (g : G) e, p (g • e) = g • p e) (hRLP : DiskRLP p) + (F : C(Skeleton (univ : Set X) (n+1),B)) + (hF : ∀ (g : G) x, F (skeletonTranslate σ hσ (n+1) g x) = g • F x) + (b : C(Skeleton (univ : Set X) n,E)) + (hb : ∀ (g : G) x, b (skeletonTranslate σ hσ n g x) = g • b x) + (hbF : ∀ x, p (b x) = F (skeletonBase n x)) : + ∃ e : C(Skeleton (univ : Set X) (n+1),E), + (∀ x, e (skeletonBase n x) = b x) ∧ (∀ x, p (e x) = F x) ∧ + ∀ (g : G) x, e (skeletonTranslate σ hσ (n+1) g x) = g • e x := by + let a (i : ι n) := b.comp (skeletonBoundary n (σ n (1,i))) + let c (i : ι n) := F.comp (skeletonCell n (σ n (1,i))) + have hsq (i : ι n) (x : Sphere n) : p (a i x) = c i (boundary n x) := by + change p (b (skeletonBoundary n (σ n (1,i)) x)) = F (skeletonCell n (σ n (1,i)) (boundary n x)) + rw [hbF] + rfl + choose d hd hf using fun i => hRLP n (a i) (c i) (hsq i) + let D (j : RelCWComplex.cell (univ : Set X) n) : C(Disk n,E) := + ⟨fun x => ((σ n).symm j).1 • d ((σ n).symm j).2 x, + (continuous_const_smul _).comp (d _).continuous⟩ + have hD (j : RelCWComplex.cell (univ : Set X) n) (x : Sphere n) : + D j (boundary n x) = b (skeletonBoundary n j x) := by + obtain ⟨⟨g,i⟩,rfl⟩ := (σ n).surjective j + change ((σ n).symm (σ n (g,i))).1 • d ((σ n).symm (σ n (g,i))).2 (boundary n x) = _ + rw [Equiv.symm_apply_apply,hd] + change g • b (skeletonBoundary n (σ n (1,i)) x) = _ + rw [←hb] + congr 1 + apply Subtype.ext + exact (hσ n g 1 i x.1).symm.trans (by rw [mul_one]; rfl) + let f := Attachment.lift (skeletonBoundary (C := (univ : Set X)) n) b D hD + let e : C(Skeleton (univ : Set X) (n+1),E) := f.comp ⟨(skeletonHomeomorph n).symm,(skeletonHomeomorph n).symm.continuous⟩ + have he_base (x : Skeleton (univ : Set X) n) : e (skeletonBase n x) = b x := by + change f ((skeletonHomeomorph n).symm (skeletonBase n x)) = _ + rw [←skeletonAssembly_base] + change f ((skeletonHomeomorph n).symm ((skeletonHomeomorph n) (Attachment.base _ x))) = _ + rw [Homeomorph.symm_apply_apply] + rfl + have he_cell (j : RelCWComplex.cell (univ : Set X) n) (x : Disk n) : + e (skeletonCell n j x) = D j x := by + change f ((skeletonHomeomorph n).symm (skeletonCell n j x)) = _ + rw [←skeletonAssembly_cell] + change f ((skeletonHomeomorph n).symm ((skeletonHomeomorph n) (Attachment.cell _ j x))) = _ + rw [Homeomorph.symm_apply_apply] + exact Attachment.lift_cell _ _ _ _ _ _ + have he (g : G) (x : Skeleton (univ : Set X) (n+1)) : + e (skeletonTranslate σ hσ (n+1) g x) = g • e x := by + obtain ⟨y,rfl⟩ := skeletonAssembly_surjective n x + cases y with + | inl x => + change e (skeletonTranslate σ hσ (n+1) g (skeletonBase n x)) = g • e (skeletonBase n x) + rw [skeletonTranslate_base,he_base,he_base,hb] + | inr q => + obtain ⟨⟨h,i⟩,hj⟩ := (σ n).surjective q.1 + have heq : skeletonAssembly n (Sum.inr q) = skeletonCell n q.1 (Attachment.interior n q.2) := + skeletonAssembly_interior n q.1 q.2 + rw [heq,←hj,skeletonTranslate_cell,he_cell,he_cell] + change ((σ n).symm (σ n (g*h,i))).1 • d ((σ n).symm (σ n (g*h,i))).2 _ = + g • (((σ n).symm (σ n (h,i))).1 • d ((σ n).symm (σ n (h,i))).2 _) + simp only [Equiv.symm_apply_apply,mul_smul] + refine ⟨e,he_base,?_,he⟩ + intro x + obtain ⟨y,rfl⟩ := skeletonAssembly_surjective n x + cases y with + | inl x => + change p (e (skeletonBase n x)) = F (skeletonBase n x) + rw [he_base,hbF] + | inr q => + rw [skeletonAssembly_interior,he_cell] + obtain ⟨⟨g,i⟩,hj⟩ := (σ n).surjective q.1 + rw [←hj] + change p (((σ n).symm (σ n (g,i))).1 • d ((σ n).symm (σ n (g,i))).2 _) = _ + rw [Equiv.symm_apply_apply,hp,hf] + change g • F (skeletonCell n (σ n (1,i)) _) = _ + rw [←hF,skeletonTranslate_cell,mul_one] +end + +section +open Set Metric Topology +universe u +variable {G : Type u} [Group G] {X : Type u} [TopologicalSpace X] [T2Space X] + [MulAction G X] [ContinuousConstSMul G X] [CWComplex (univ : Set X)] +variable {ι : ℕ → Type u} +variable (σ : ∀ n, (G × ι n) ≃ RelCWComplex.cell (univ : Set X) n) +variable (hσ : ∀ n (g h : G) (i : ι n) (x : Fin n → ℝ), + RelCWComplex.map n (σ n (g*h,i)) x = g • RelCWComplex.map n (σ n (h,i)) x) +omit [MulAction G X] [ContinuousConstSMul G X] in +lemma isEmpty_skeleton_zero : IsEmpty (Skeleton (univ : Set X) 0) := by + refine ⟨fun x => ?_⟩ + have hx := x.2 + change x.1 ∈ (CWComplex.skeletonLT (univ : Set X) 0 : Set X) at hx + rw [CWComplex.skeletonLT_zero_eq_empty] at hx + exact hx + +variable {E B : Type u} [TopologicalSpace E] [TopologicalSpace B] + [MulAction G E] [ContinuousConstSMul G E] [MulAction G B] + +lemma exists_equivariant_lift_on_skeleton (d : ℕ) (p : C(E,B)) + (hp : ∀ (g : G) e, p (g • e) = g • p e) (hRLP : DiskRLP p) + (F : C(Skeleton (univ : Set X) d,B)) + (hF : ∀ (g : G) x, F (skeletonTranslate σ hσ d g x) = g • F x) : + ∃ e : C(Skeleton (univ : Set X) d,E), (∀ x, p (e x) = F x) ∧ + ∀ (g : G) x, e (skeletonTranslate σ hσ d g x) = g • e x := by + induction d with + | zero => + let := isEmpty_skeleton_zero (X := X) + exact ⟨⟨isEmptyElim,continuous_of_discreteTopology⟩,fun x => isEmptyElim x,fun _ x => isEmptyElim x⟩ + | succ d ih => + obtain ⟨b,hbF,hb⟩ := ih (F.comp (skeletonBase d)) (fun g x => by + change F (skeletonBase d (skeletonTranslate σ hσ d g x)) = g • F (skeletonBase d x) + rw [←skeletonTranslate_base,hF]) + obtain ⟨e,_,heF,he⟩ := exists_equivariant_skeleton_lift σ hσ d p hp hRLP F hF b hb hbF + exact ⟨e,heF,he⟩ + +lemma exists_equivariant_map_on_skeleton (d : ℕ) + (hfill : ∀ n < d, ∀ a : C(Sphere n,E), ∃ e : C(Disk n,E), ∀ x, e (boundary n x) = a x) : + ∃ e : C(Skeleton (univ : Set X) d,E), + ∀ (g : G) x, e (skeletonTranslate σ hσ d g x) = g • e x := by + induction d with + | zero => + let := isEmpty_skeleton_zero (X := X) + exact ⟨⟨isEmptyElim,continuous_of_discreteTopology⟩,fun _ x => isEmptyElim x⟩ + | succ d ih => + obtain ⟨b,hb⟩ := ih (fun n hn => hfill n (Nat.lt_succ_of_lt hn)) + obtain ⟨e,_,he⟩ := exists_equivariant_skeleton_extension σ hσ d b hb (hfill d (Nat.lt_succ_self d)) + exact ⟨e,he⟩ + +variable {Y : Type u} [TopologicalSpace Y] [MulAction G Y] [ContinuousConstSMul G Y] +lemma exists_equivariant_homotopy_on_skeleton (d : ℕ) (hY : SphereFillable Y) + (a b : C(Skeleton (univ : Set X) d,Y)) + (ha : ∀ (g : G) x, a (skeletonTranslate σ hσ d g x) = g • a x) + (hb : ∀ (g : G) x, b (skeletonTranslate σ hσ d g x) = g • b x) : + ∃ H : a.Homotopy b, ∀ (g : G) t x, + H (t,skeletonTranslate σ hσ d g x) = g • H (t,x) := by + let F : C(Skeleton (univ : Set X) d,Y × Y) := a.prodMk b + have hF (g : G) x : F (skeletonTranslate σ hσ d g x) = g • F x := by + exact Prod.ext (ha g x) (hb g x) + obtain ⟨e,heF,he⟩ := exists_equivariant_lift_on_skeleton σ hσ d pathEndpoint + (fun _ _ => rfl) (pathEndpoint_RLP hY) F hF + let H : a.Homotopy b := + { toFun := fun z => e z.2 z.1 + continuous_toFun := e.continuous.comp continuous_snd |>.eval continuous_fst + map_zero_left := fun x => congrArg Prod.fst (heF x) + map_one_left := fun x => congrArg Prod.snd (heF x) } + refine ⟨H,?_⟩ + intro g t x + exact ContinuousMap.congr_fun (he g x) t + +omit [MulAction G X] [ContinuousConstSMul G X] in +def skeletonChart (n m : ℕ) (hm : m < n) (i : RelCWComplex.cell (univ : Set X) m) : + C(Disk m,Skeleton (univ : Set X) n) := + ⟨fun z => ⟨characteristic m i z,characteristic_mem_skeleton hm i z⟩, + (characteristic m i).continuous.subtype_mk _⟩ + +lemma skeleton_compact_representatives (n : ℕ) [∀ m,Finite (ι m)] : + ∃ K : Set (Skeleton (univ : Set X) n), IsCompact K ∧ + ∀ x, ∃ g : G, ∃ y ∈ K, x = skeletonTranslate σ hσ n g y := by + let K := ⋃ m : Fin n, ⋃ i : ι m, Set.range (skeletonChart n m m.2 (σ m (1,i))) + have hK : IsCompact K := isCompact_iUnion fun m => isCompact_iUnion fun i => + isCompact_range (skeletonChart n m m.2 (σ m (1,i))).continuous + refine ⟨K,hK,?_⟩ + intro x + obtain ⟨m,hm,j,z,hz,hj⟩ := (CWComplex.mem_skeletonLT_iff (C := (univ : Set X))).mp x.2 + obtain ⟨⟨g,i⟩,rfl⟩ := (σ m).surjective j + have hmn : m < n := by exact_mod_cast hm + let y := skeletonChart n m hmn (σ m (1,i)) ⟨z,ball_subset_closedBall hz⟩ + refine ⟨g,y,Set.mem_iUnion.mpr ⟨⟨m,hmn⟩,Set.mem_iUnion.mpr ⟨i,Set.mem_range_self _⟩⟩,?_⟩ + apply Subtype.ext + change x.1 = g • RelCWComplex.map m (σ m (1,i)) z + rw [←hσ,mul_one] + exact hj.symm +end + +open Set Metric Topology +universe u v +variable {X : Type u} [TopologicalSpace X] [T2Space X] +variable {C : Set X} [CWComplex C] +variable {K : Type v} [MetricSpace K] [CompactSpace K] + +def skeletonInclusion (n : ℕ) : C(Skeleton C n,X) := ⟨Subtype.val,continuous_subtype_val⟩ + +lemma deform_skeleton_succ (n : ℕ) (f : C(K,Skeleton C (n+1))) + (hdim : dimH (Set.univ : Set K) < n) : + ∃ (g : C(K,Skeleton C n)) + (H : f.Homotopy ((skeletonBase n).comp g)), + ∀ t x, (f x).1 ∈ Skeleton C n → H (t,x) = f x := by + let e := skeletonHomeomorph (C := C) n + let : T2Space (Attachment.Space (skeletonBoundary (C := C) n)) := e.symm.t2Space + let f' : C(K,Attachment.Space (skeletonBoundary (C := C) n)) := (⟨e.symm,e.symm.continuous⟩ : C(_, _)).comp f + obtain ⟨g,H,hH⟩ := Attachment.exists_deformation_into_base (skeletonBoundary (C := C) n) f' hdim + have h0 : (⟨e,e.continuous⟩ : C(_, _)).comp f' = f := by apply ContinuousMap.ext; intro x; exact e.apply_symm_apply (f x) + have h1 : (⟨e,e.continuous⟩ : C(_, _)).comp + ((⟨Attachment.base _,Attachment.continuous_base _⟩ : C(_, _)).comp g) = + (skeletonBase n).comp g := by apply ContinuousMap.ext; intro x; exact skeletonAssembly_base n (g x) + let J := (ContinuousMap.Homotopy.refl (⟨e,e.continuous⟩ : C(_, _))).comp H + refine ⟨g,J.cast h0 h1,?_⟩ + intro t x hx + change e (H (t,x)) = f x + have hr : f' x ∈ Set.range (Attachment.base (skeletonBoundary (C := C) n)) := by + refine ⟨⟨(f x).1,hx⟩,?_⟩ + apply e.injective + change skeletonAssembly n (Attachment.base _ _) = e (e.symm (f x)) + rw [skeletonAssembly_base,e.apply_symm_apply] + rfl + rw [hH t x hr] + exact e.apply_symm_apply (f x) + +lemma deform_bounded_skeleton (d m : ℕ) (f : C(K,Skeleton C m)) + (hdim : dimH (Set.univ : Set K) < d) : + ∃ (g : C(K,Skeleton C d)) + (H : ((skeletonInclusion m).comp f).Homotopy ((skeletonInclusion d).comp g)), + ∀ t x, (f x).1 ∈ Skeleton C d → H (t,x) = (f x).1 := by + induction m with + | zero => + let g : C(K,Skeleton C d) := ⟨fun x => ⟨(f x).1,skeleton_mono (Nat.zero_le d) (f x).2⟩, + f.continuous.subtype_val.subtype_mk _⟩ + exact ⟨g,.refl _,fun _ _ _ => rfl⟩ + | succ m ih => + by_cases hmd : m+1 ≤ d + · let g : C(K,Skeleton C d) := ⟨fun x => ⟨(f x).1,skeleton_mono hmd (f x).2⟩, + f.continuous.subtype_val.subtype_mk _⟩ + exact ⟨g,.refl _,fun _ _ _ => rfl⟩ + · have hdm : d ≤ m := by omega + obtain ⟨g,H,hH⟩ := deform_skeleton_succ m f (hdim.trans_le (by exact_mod_cast hdm)) + obtain ⟨g',J,hJ⟩ := ih g + let H' : ((skeletonInclusion (C := C) (m+1)).comp f).Homotopy + ((skeletonInclusion m).comp g) := + (ContinuousMap.Homotopy.refl (skeletonInclusion (C := C) (m+1))).comp H + refine ⟨g',H'.trans J,?_⟩ + intro t x hx + have hh (s : unitInterval) : H' (s,x) = (f x).1 := by + exact congrArg Subtype.val (hH s x (skeleton_mono hdm hx)) + have hg : (g x).1 = (f x).1 := by + have he := hh 1 + rw [ContinuousMap.Homotopy.apply_one] at he + exact he + have hj (s : unitInterval) : J (s,x) = (f x).1 := by + rw [hJ s x (hg.symm ▸ hx),hg] + rw [ContinuousMap.Homotopy.trans_apply] + split_ifs + · exact hh _ + · exact hj _ + +theorem exists_cellular_approximation (d : ℕ) (f : C(K,X)) (hf : ∀ x,f x ∈ C) + (hdim : dimH (Set.univ : Set K) < d) : + ∃ (g : C(K,Skeleton C d)) (H : f.Homotopy ((skeletonInclusion d).comp g)), + ∀ t x, f x ∈ Skeleton C d → H (t,x) = f x := by + obtain ⟨m,hm⟩ := compactMap_bounded_skeleton f hf + let f' : C(K,Skeleton C m) := ⟨fun x => ⟨f x,hm x⟩,f.continuous.subtype_mk _⟩ + exact deform_bounded_skeleton d m f' hdim +end UniversalFInfinity.Cellular +namespace UniversalFInfinity.SphereTopology +open Set Metric Topology +universe u +variable {Y : Type u} [TopologicalSpace Y] +lemma fill_zero [Nonempty Y] (a : C(Cellular.Sphere 0,Y)) : + ∃ e : C(Cellular.Disk 0,Y), ∀ x, e (Cellular.boundary 0 x) = a x := by + refine ⟨.const _ (Classical.choice ‹Nonempty Y›),?_⟩ + intro x + have hx := x.2 + have hz : x.1 = 0 := Subsingleton.elim _ _ + simp only [hz,mem_sphere,dist_self] at hx + exact False.elim (zero_ne_one hx) +lemma fill_one [PathConnectedSpace Y] (a : C(Cellular.Sphere 1,Y)) : + ∃ e : C(Cellular.Disk 1,Y), ∀ x, e (Cellular.boundary 1 x) = a x := by + let p := (PathConnectedSpace.joined (a Cayley.minus) (a Cayley.plus)).somePath + let e : C(Cellular.Disk 1,Y) := p.toContinuousMap.comp ⟨Cayley.edgeTime,Cayley.continuous_edgeTime⟩ + refine ⟨e,?_⟩ + intro x + obtain rfl|rfl := Cayley.sphere_one_eq x + · change p (Cayley.edgeTime (Attachment.boundary 1 Cayley.minus)) = _ + rw [Cayley.edgeTime_minus,p.source] + · change p (Cayley.edgeTime (Attachment.boundary 1 Cayley.plus)) = _ + rw [Cayley.edgeTime_plus,p.target] +end UniversalFInfinity.SphereTopology + +namespace UniversalFInfinity.Milnor + +section +open Set Metric Topology Cellular +universe u +variable {G : Type u} [Group G] +variable {X : Type u} [TopologicalSpace X] [T2Space X] + [MulAction G X] [ContinuousConstSMul G X] [CWComplex (univ : Set X)] +variable {ι : ℕ → Type u} [∀ m,Finite (ι m)] +variable (σ : ∀ n, (G × ι n) ≃ RelCWComplex.cell (univ : Set X) n) +variable (hσ : ∀ n (g h : G) (i : ι n) (x : Fin n → ℝ), + RelCWComplex.map n (σ n (g*h,i)) x = g • RelCWComplex.map n (σ n (h,i)) x) + +lemma controlled_skeleton_homotopy (d : ℕ) (a b : C(Skeleton (univ : Set X) d,Space G)) + (H : a.Homotopy b) + (hH : ∀ (g : G) t x, H (t,skeletonTranslate σ hσ d g x) = g • H (t,x)) : + ∃ S : Shapes G, Set.range H ⊆ Set.range (stageFull G S) := by + obtain ⟨K,hK,hcov⟩ := skeleton_compact_representatives σ hσ d + obtain ⟨S,hS⟩ := compact_orbit_controlled G ((isCompact_univ.prod hK).image H.continuous) + refine ⟨S,?_⟩ + rintro _ ⟨⟨t,x⟩,rfl⟩ + obtain ⟨g,y,hy,rfl⟩ := hcov x + rw [hH] + exact hS g ⟨H (t,y),⟨(t,y),⟨Set.mem_univ _,hy⟩,rfl⟩,rfl⟩ + +end +open Set Metric Topology Cellular +universe u +variable {G : Type u} [Group G] [TopologicalSpace G] [DiscreteTopology G] +variable {A : Type u} [Finite A] (s : A → G) +variable (rels : Set (FreeGroup A)) (hrel : ∀ r ∈ rels, FreeGroup.lift s r = 1) + +include hrel in + +lemma uniform_low_connectivity (hrels : rels.Finite) + (hs : Function.Surjective (FreeGroup.lift s)) + (hker : (FreeGroup.lift s).ker = Subgroup.normalClosure rels) (S : Shapes G) : + ∃ (T : Shapes G) (hST : S ⊆ T), ∀ n : ℕ, n = 1 ∨ n = 2 → + ∀ a : C(Sphere n,Stage G S), ∃ d : C(Disk n,Stage G T), + ∀ x, d (boundary n x) = stageIncl G S T hST (a x) := by + classical + let Z := Cayley.PresentationCover s rels hrel + let : PathConnectedSpace Z := Cayley.presentationCover_pathConnected s rels hrel hs + let : CWComplex (univ : Set (Stage G S)) := stageEquivariantCW G S + let σ : ∀ n, (G × CellOrbits G S n) ≃ RelCWComplex.cell (univ : Set (Stage G S)) n := + fun _ => Equiv.refl _ + have hσ : ∀ n (g h : G) (i : CellOrbits G S n) (x : Fin n → ℝ), + RelCWComplex.map n (σ n (g*h,i)) x = g • RelCWComplex.map n (σ n (h,i)) x := by + intro n g h i x + exact mul_smul g h _ + have hfill : ∀ n < 2, ∀ a : C(Sphere n,Z), ∃ e : C(Disk n,Z), + ∀ x, e (boundary n x) = a x := by + intro n hn + have hn' : n=0 ∨ n=1 := by omega + rcases hn' with rfl|rfl + · exact SphereTopology.fill_zero + · exact SphereTopology.fill_one + obtain ⟨r,hr⟩ := exists_equivariant_map_on_skeleton σ hσ 2 hfill + obtain ⟨q,hq⟩ := presentation_equivariant_map s rels hrel + obtain ⟨P,hP⟩ := equivariant_controlled G (presentation_compactFundamentalSet s rels hrel hrels) q hq + let a := (stageFull G S).comp (skeletonInclusion (C := (univ : Set (Stage G S))) 2) + let b := q.comp r + have ha (g : G) x : a (skeletonTranslate σ hσ 2 g x) = g • a x := + stageFull_smul G S g x.1 + have hb (g : G) x : b (skeletonTranslate σ hσ 2 g x) = g • b x := by + change q (r (skeletonTranslate σ hσ 2 g x)) = g • q (r x) + rw [hr,hq] + obtain ⟨H,hH⟩ := exists_equivariant_homotopy_on_skeleton σ hσ 2 (sphereFillable (1:G)) a b ha hb + obtain ⟨Q,hQ⟩ := controlled_skeleton_homotopy σ hσ 2 a b H hH + let T := S ∪ P ∪ Q + have hST : S ⊆ T := Finset.subset_union_left.trans Finset.subset_union_left + have hPT : P ⊆ T := Finset.subset_union_right.trans Finset.subset_union_left + have hQT : Q ⊆ T := Finset.subset_union_right + have hpT : Set.range q ⊆ Set.range (stageFull G T) := by + rintro _ ⟨z,rfl⟩ + obtain ⟨y,hy⟩ := hP (Set.mem_range_self z) + exact ⟨stageIncl G P T hPT y,hy⟩ + have hhT : Set.range H ⊆ Set.range (stageFull G T) := by + rintro _ ⟨z,rfl⟩ + obtain ⟨y,hy⟩ := hQ (Set.mem_range_self z) + exact ⟨stageIncl G Q T hQT y,hy⟩ + let qT := factorStage G q T hpT + let HTmap := factorStage G H.toContinuousMap T hhT + let inc := stageIncl G S T hST + let HT : (inc.comp (skeletonInclusion (C := (univ : Set (Stage G S))) 2)).Homotopy (qT.comp r) := + { toContinuousMap := HTmap + map_zero_left := fun x => by + apply (stageFull_embedding G T).injective + change stageFull G T (HTmap (0,x)) = stageFull G T (inc x.1) + rw [factorStage_spec] + exact H.apply_zero x + map_one_left := fun x => by + apply (stageFull_embedding G T).injective + change stageFull G T (HTmap (1,x)) = stageFull G T (qT (r x)) + rw [factorStage_spec,factorStage_spec] + exact H.apply_one x } + refine ⟨T,hST,?_⟩ + intro n hn k + have hdim : dimH (univ : Set (Sphere n)) < 2 := by + rcases hn with rfl|rfl + · exact (GeneralPosition.dimH_cube_boundary_subtype_le 0).trans_lt (by norm_num) + · exact (GeneralPosition.dimH_cube_boundary_subtype_le 1).trans_lt (by norm_num) + let : Nonempty (Sphere n) := by + rcases hn with rfl|rfl + · exact SphereTopology.sphere_nonempty 0 + · exact SphereTopology.sphere_nonempty 1 + obtain ⟨v,J,_⟩ := exists_cellular_approximation 2 k (fun _ => Set.mem_univ _) hdim + have hz : SphereTopology.Extends (r.comp v) := by + rcases hn with rfl|rfl + · obtain ⟨e,he⟩ := SphereTopology.fill_one (r.comp v) + exact ⟨e,ContinuousMap.ext he⟩ + · exact Cayley.presentationCover_sphereFill s rels hrel hs hker (r.comp v) + obtain ⟨e,he⟩ := hz + have hzT : SphereTopology.Extends ((qT.comp r).comp v) := by + refine ⟨qT.comp e,?_⟩ + apply ContinuousMap.ext; intro x + exact congrArg qT (ContinuousMap.congr_fun he x) + let J' := (ContinuousMap.Homotopy.refl inc).comp J + obtain ⟨d,hd⟩ := SphereTopology.extends_of_homotopy (J'.trans (HT.compContinuousMap v)) hzT + exact ⟨d,fun x => ContinuousMap.congr_fun hd x⟩ +end UniversalFInfinity.Milnor + +open scoped TensorProduct + +end + +end OAI diff --git a/lean/OAI/GroupTheory/UniversalGroup/CellularAttachment.lean b/lean/OAI/GroupTheory/UniversalGroup/CellularAttachment.lean new file mode 100644 index 0000000000000000000000000000000000000000..81c55560b93123689198ec84389ef169d66149a2 --- /dev/null +++ b/lean/OAI/GroupTheory/UniversalGroup/CellularAttachment.lean @@ -0,0 +1,626 @@ +import OAI.GroupTheory.UniversalGroup.Attachments + +namespace OAI + +noncomputable section + +open Set Metric Topology BigOperators +open Set Metric Topology + +namespace UniversalFInfinity.Cellular +universe u +variable {X Y : Type u} [TopologicalSpace X] [TopologicalSpace Y] [Nonempty X] +variable {C : Set X} [CWComplex C] {f : X → Y} (hf : IsClosedEmbedding f) + +def transportedMap (n : ℕ) (i : RelCWComplex.cell C n) : PartialEquiv (Fin n → ℝ) Y := + (RelCWComplex.map n i).trans (hf.isEmbedding.toPartialHomeomorph f).toPartialEquiv + +@[simp] lemma transportedMap_apply (n : ℕ) (i : RelCWComplex.cell C n) (x : Fin n → ℝ) : + transportedMap hf n i x = f (RelCWComplex.map n i x) := rfl + +lemma transportedMap_source (n : ℕ) (i : RelCWComplex.cell C n) : + (transportedMap hf n i).source = ball 0 1 := by + simp only [transportedMap,PartialEquiv.trans_source, + IsEmbedding.toPartialHomeomorph_source,Set.preimage_univ,Set.inter_univ, + RelCWComplex.source_eq] + +lemma transportedMap_image (n : ℕ) (i : RelCWComplex.cell C n) (S : Set (Fin n → ℝ)) : + transportedMap hf n i '' S = f '' (RelCWComplex.map n i '' S) := + Set.image_comp f (RelCWComplex.map n i) S + +lemma transportedMap_continuousOn (n : ℕ) (i : RelCWComplex.cell C n) : + ContinuousOn (transportedMap hf n i) (closedBall 0 1) := + hf.continuous.comp_continuousOn (RelCWComplex.continuousOn n i) + +lemma transportedMap_continuousOn_symm (n : ℕ) (i : RelCWComplex.cell C n) : + ContinuousOn (transportedMap hf n i).symm (transportedMap hf n i).target := by + let e := hf.isEmbedding.toPartialHomeomorph f + change ContinuousOn (fun y => (RelCWComplex.map n i).symm (e.symm y)) + (e.target ∩ e.symm ⁻¹' (RelCWComplex.map n i).target) + exact (RelCWComplex.continuousOn_symm n i).comp + (e.continuousOn_symm.mono Set.inter_subset_left) (fun _ h => h.2) + +variable [T2Space X] + +@[instance_reducible] +def transportCW : CWComplex (f '' C) where + cell := RelCWComplex.cell C + map := transportedMap hf + source_eq := transportedMap_source hf + continuousOn := transportedMap_continuousOn hf + continuousOn_symm := transportedMap_continuousOn_symm hf + pairwiseDisjoint' := by + intro p _ q _ hpq + change Disjoint (transportedMap hf p.1 p.2 '' ball 0 1) + (transportedMap hf q.1 q.2 '' ball 0 1) + rw [transportedMap_image,transportedMap_image] + exact (CWComplex.disjoint_openCell_of_ne hpq).image hf.injective.injOn (Set.subset_univ _) (Set.subset_univ _) + mapsTo' := by + intro n i + obtain ⟨I,hI⟩ := CWComplex.cellFrontier_subset_finite_closedCell n i + refine ⟨I,?_⟩ + intro x hx + have h := hI (show RelCWComplex.map n i x ∈ CWComplex.cellFrontier n i from ⟨x,hx,rfl⟩) + simp only [Set.mem_iUnion] at h + obtain ⟨m,hm,j,hj,hx⟩ := h + refine Set.mem_iUnion.mpr ⟨m,Set.mem_iUnion.mpr ⟨hm,Set.mem_iUnion.mpr + ⟨j,Set.mem_iUnion.mpr ⟨hj,?_⟩⟩⟩⟩ + rw [transportedMap_image] + exact ⟨_,hx,rfl⟩ + closed' := by + intro A hA hclosed + have hpre : IsClosed (f ⁻¹' A) := by + apply (CWComplex.closed C (f ⁻¹' A) ?_).mpr + · intro n i + have h := (hclosed n i).preimage hf.continuous + rw [transportedMap_image,Set.preimage_inter, + Set.preimage_image_eq _ hf.injective] at h + exact h + · intro x hx + obtain ⟨y,hy,hyx⟩ := hA hx + exact hf.injective hyx ▸ hy + have h := hf.isClosedMap _ hpre + rwa [Set.image_preimage_eq_of_subset (hA.trans (Set.image_subset_range f C))] at h + union' := by + simp only [transportedMap_image,← Set.image_iUnion] + change f '' (⋃ n, ⋃ i, CWComplex.closedCell n i) = f '' C + rw [CWComplex.union] + +end UniversalFInfinity.Cellular + +open Set Metric Topology +namespace UniversalFInfinity.Attachment + +section +open Set Metric Topology +universe z +variable {X : Type z} [TopologicalSpace X] [T2Space X] [Nonempty X] +variable [CWComplex (Set.univ : Set X)] {ι : Type z} {n : ℕ} +variable (a : ι → C(Sphere n,X)) + +abbrev OldCell (m : ℕ) := RelCWComplex.cell (Set.univ : Set X) m + +omit [Nonempty X] in +lemma attaching_finite_frontier + (hdim : ∀ m (_ : OldCell (X := X) m), m < n) (i : ι) : + ∃ I : ∀ m, Finset (OldCell (X := X) m), + ∀ x, a i x ∈ ⋃ m < n, ⋃ j ∈ I m, CWComplex.closedCell m j := by + classical + let S := {p : Σ m, OldCell (X := X) m | + (Set.range (a i) ∩ CWComplex.openCell p.1 p.2).Nonempty} + have hS : S.Finite := Cellular.compact_finitely_many_cells (C := (Set.univ : Set X)) + (isCompact_range (a i).continuous) + have hSm (m : ℕ) : ((Sigma.mk m) ⁻¹' S).Finite := + hS.preimage (Set.injOn_of_injective (fun _ _ h => eq_of_heq (Sigma.mk.inj_iff.mp h).2)) + refine ⟨fun m => (hSm m).toFinset,?_⟩ + intro x + have hx : a i x ∈ (Set.univ : Set X) := Set.mem_univ _ + rw [← CWComplex.iUnion_openCell_eq_complex (C := (Set.univ : Set X))] at hx + simp only [Set.mem_iUnion] at hx + obtain ⟨m,j,hx⟩ := hx + exact Set.mem_iUnion.mpr ⟨m,Set.mem_iUnion.mpr ⟨hdim m j,Set.mem_iUnion.mpr + ⟨j,Set.mem_iUnion.mpr ⟨(hSm m).mem_toFinset.mpr ⟨a i x,⟨x,rfl⟩,hx⟩, + CWComplex.openCell_subset_closedCell m j hx⟩⟩⟩⟩ + +abbrev LayerCell (m : ℕ) := OldCell (X := X) m ⊕ CellIndex.{z,z} m n ι + +def layerMap (m : ℕ) : LayerCell (X := X) (ι := ι) (n := n) m → + PartialEquiv (Fin m → ℝ) (Space a) + | Sum.inl i => Cellular.transportedMap (C := Set.univ) (base_closedEmbedding a) m i + | Sum.inr i => cellMap a m i + +omit [T2Space X] in +lemma layerMap_old_apply (m : ℕ) (i : OldCell (X := X) m) (x : Fin m → ℝ) : + layerMap a m (Sum.inl i) x = base a (RelCWComplex.map m i x) := rfl + +omit [T2Space X] in +lemma layerMap_old_image (m : ℕ) (i : OldCell (X := X) m) (S : Set (Fin m → ℝ)) : + layerMap a m (Sum.inl i) '' S = base a '' (RelCWComplex.map m i '' S) := + Cellular.transportedMap_image (base_closedEmbedding a) m i S + +omit [T2Space X] in +lemma layerMap_new (i : ι) : + layerMap a n (Sum.inr ⟨⟨⟨rfl⟩,i⟩⟩) = characteristicPE a i := rfl + +@[instance_reducible] +def layerCW (hdim : ∀ m (_ : OldCell (X := X) m), m < n) : + CWComplex (Set.univ : Set (Space a)) where + cell := LayerCell (X := X) (ι := ι) (n := n) + map := layerMap a + source_eq := by + intro m i + cases i with + | inl i => exact Cellular.transportedMap_source (base_closedEmbedding a) m i + | inr i => exact (relCWComplex a).source_eq m i + continuousOn := by + intro m i + cases i with + | inl i => exact Cellular.transportedMap_continuousOn (base_closedEmbedding a) m i + | inr i => exact (relCWComplex a).continuousOn m i + continuousOn_symm := by + intro m i + cases i with + | inl i => exact Cellular.transportedMap_continuousOn_symm (base_closedEmbedding a) m i + | inr i => exact (relCWComplex a).continuousOn_symm m i + pairwiseDisjoint' := by + rintro ⟨m,i⟩ _ ⟨k,j⟩ _ hne + change Disjoint (layerMap a m i '' ball 0 1) (layerMap a k j '' ball 0 1) + cases i with + | inl i => + cases j with + | inl j => + rw [layerMap_old_image,layerMap_old_image] + apply (CWComplex.disjoint_openCell_of_ne ?_).image (base_closedEmbedding a).injective.injOn (Set.subset_univ _) (Set.subset_univ _) + intro h + cases h + exact hne rfl + | inr j => + obtain ⟨⟨⟨hk⟩,j⟩⟩ := j + subst k + rw [layerMap_old_image,layerMap_new,characteristicPE_image_ball] + apply Set.disjoint_left.mpr + rintro z ⟨x,_,rfl⟩ ⟨y,h⟩ + cases h + | inr i => + obtain ⟨⟨⟨hm⟩,i⟩⟩ := i + subst m + cases j with + | inl j => + rw [layerMap_new,characteristicPE_image_ball,layerMap_old_image] + apply Set.disjoint_left.mpr + rintro z ⟨x,rfl⟩ ⟨y,_,h⟩ + cases h + | inr j => + obtain ⟨⟨⟨hk⟩,j⟩⟩ := j + subst k + rw [layerMap_new,layerMap_new,characteristicPE_image_ball,characteristicPE_image_ball] + apply Set.disjoint_left.mpr + rintro z ⟨x,rfl⟩ ⟨y,h⟩ + have hij : j = i := congrArg Sigma.fst (Sum.inr_injective h) + subst j + exact hne rfl + mapsTo' := by + classical + intro m c + cases c with + | inl i => + obtain ⟨I,hI⟩ := CWComplex.cellFrontier_subset_finite_closedCell m i + refine ⟨fun k => (I k).image Sum.inl,?_⟩ + intro x hx + have hh := hI (show RelCWComplex.map m i x ∈ CWComplex.cellFrontier m i from ⟨x,hx,rfl⟩) + simp only [Set.mem_iUnion] at hh + obtain ⟨k,hkm,j,hj,hx⟩ := hh + refine Set.mem_iUnion.mpr ⟨k,Set.mem_iUnion.mpr ⟨hkm,Set.mem_iUnion.mpr + ⟨Sum.inl j,Set.mem_iUnion.mpr ⟨Finset.mem_image.mpr ⟨j,hj,rfl⟩,?_⟩⟩⟩⟩ + rw [layerMap_old_image] + exact ⟨_,hx,rfl⟩ + | inr i => + obtain ⟨⟨⟨hm⟩,i⟩⟩ := i + subst m + obtain ⟨I,hI⟩ := attaching_finite_frontier a hdim i + refine ⟨fun k => (I k).image Sum.inl,?_⟩ + intro x hx + have hh := hI ⟨x,hx⟩ + simp only [Set.mem_iUnion] at hh + obtain ⟨k,hkn,j,hj,hx'⟩ := hh + refine Set.mem_iUnion.mpr ⟨k,Set.mem_iUnion.mpr ⟨hkn,Set.mem_iUnion.mpr + ⟨Sum.inl j,Set.mem_iUnion.mpr ⟨Finset.mem_image.mpr ⟨j,hj,rfl⟩,?_⟩⟩⟩⟩ + rw [layerMap_old_image] + refine ⟨a i ⟨x,hx⟩,hx',?_⟩ + change base a (a i ⟨x,hx⟩) = characteristic a i x + exact (cell_boundary a i ⟨x,hx⟩).symm.trans + (characteristic_disk a i (boundary n ⟨x,hx⟩)).symm + closed' := by + intro A _ hA + apply (isClosed_iff a A).mpr + constructor + · apply (CWComplex.closed Set.univ (base a ⁻¹' A) (Set.subset_univ _)).mpr + intro m i + have h := (hA m (Sum.inl i)).preimage (continuous_base a) + rw [layerMap_old_image,Set.preimage_inter, + Set.preimage_image_eq _ (base_closedEmbedding a).injective] at h + exact h + · intro i + have h := (hA n (Sum.inr ⟨⟨⟨rfl⟩,i⟩⟩)).preimage (cell a i).continuous + rw [layerMap_new,characteristicPE_image_closedBall,Set.preimage_inter] at h + simpa only [Set.preimage_range,Set.inter_univ] using h + union' := by + apply Set.eq_univ_of_forall + intro z + cases z with + | inl x => + have hx : x ∈ (Set.univ : Set X) := Set.mem_univ _ + rw [← CWComplex.union (C := (Set.univ : Set X))] at hx + simp only [Set.mem_iUnion] at hx + obtain ⟨m,i,hx⟩ := hx + refine Set.mem_iUnion.mpr ⟨m,Set.mem_iUnion.mpr ⟨Sum.inl i,?_⟩⟩ + rw [layerMap_old_image] + exact ⟨x,hx,rfl⟩ + | inr p => + refine Set.mem_iUnion.mpr ⟨n,Set.mem_iUnion.mpr ⟨Sum.inr ⟨⟨⟨rfl⟩,p.1⟩⟩,?_⟩⟩ + rw [layerMap_new,characteristicPE_image_closedBall] + exact ⟨interior n p.2,cell_interior a p.1 p.2⟩ + +lemma layerCW_dimensions (hdim : ∀ m (_ : OldCell (X := X) m), m < n) + (m : ℕ) (i : (layerCW a hdim).cell m) : m < n+1 := by + cases i with + | inl i => exact (hdim m i).trans (Nat.lt_succ_self n) + | inr i => + obtain ⟨⟨⟨hm⟩,i⟩⟩ := i + subst m + exact Nat.lt_succ_self n + +lemma layerCW_finite_cells [Finite ι] + (hfin : ∀ m, Finite (OldCell (X := X) m)) + (hdim : ∀ m (_ : OldCell (X := X) m), m < n) (m : ℕ) : + Finite ((layerCW a hdim).cell m) := by + let := hfin m + change Finite (LayerCell (X := X) (ι := ι) (n := n) m) + infer_instance + +end + +section +open Set Metric Topology +universe u v w z +variable {X : Type u} [TopologicalSpace X] {ι : Type v} {n : ℕ} +variable (a : ι → C(Sphere n,X)) +variable {G : Type w} [Group G] [MulAction G X] [MulAction G ι] + +instance spaceMulAction : MulAction G (Space a) where + smul g := Sum.elim (fun x => Sum.inl (g • x)) (fun p => Sum.inr ⟨g • p.1,p.2⟩) + one_smul := by + intro x + cases x with + | inl x => change Sum.inl ((1 : G) • x) = Sum.inl x; rw [one_smul] + | inr p => change Sum.inr ⟨(1 : G) • p.1,p.2⟩ = Sum.inr p; rw [one_smul] + mul_smul := by + intro g h x + cases x with + | inl x => change Sum.inl ((g * h) • x) = Sum.inl (g • h • x); rw [mul_smul] + | inr p => change (Sum.inr ⟨(g * h) • p.1,p.2⟩ : Space a) = Sum.inr ⟨g • h • p.1,p.2⟩; rw [mul_smul] + +@[simp] lemma smul_base (g : G) (x : X) : g • base a x = base a (g • x) := rfl +@[simp] lemma smul_openCell (g : G) (i : ι) (x : OpenDisk n) : + g • openCell a i x = openCell a (g • i) x := rfl + +variable (ha : ∀ (g : G) i x, a (g • i) x = g • a i x) +include ha +lemma smul_cell (g : G) (i : ι) (d : Disk n) : + g • cell a i d = cell a (g • i) d := by + classical + by_cases hd : d.1 ∈ ball (0 : Fin n → ℝ) 1 + · have heq : d = interior n ⟨d.1,hd⟩ := rfl + rw [heq,cell_interior,cell_interior] + rfl + · let x : Sphere n := ⟨d.1,by + have hm := d.2 + simp only [mem_closedBall,mem_ball,mem_sphere] at * + exact le_antisymm hm (le_of_not_gt hd)⟩ + have heq : d = boundary n x := rfl + rw [heq,cell_boundary,cell_boundary,smul_base,ha] + +lemma continuousConstSMul [ContinuousConstSMul G X] : ContinuousConstSMul G (Space a) where + continuous_const_smul g := (continuous_iff a _).mpr ⟨ + (continuous_base a).comp (continuous_const_smul g),fun i => by + have heq : (g • ·) ∘ cell a i = cell a (g • i) := funext (smul_cell a ha g i) + rw [heq] + exact (cell a (g • i)).continuous⟩ + +omit ha in +lemma isOpen_iff (S : Set (Space a)) : + IsOpen S ↔ IsOpen (base a ⁻¹' S) ∧ ∀ i, IsOpen (cell a i ⁻¹' S) := by + change @IsOpen _ (TopologicalSpace.coinduced (quotient a) inferInstance) S ↔ _ + rw [isOpen_coinduced,isOpen_sum_iff,isOpen_sigma_iff] + rfl + +end + +section +open Set Metric Topology +universe u v w +abbrev Collar (n : ℕ) := {d : Disk n | (1 / 2 : ℝ) < ‖d.1‖} + +def collarInclusion (n : ℕ) : Collar n → Disk n := Subtype.val + +def radial (n : ℕ) : Collar n → Sphere n := fun d => + ⟨‖d.1.1‖⁻¹ • d.1.1,by + have hn : ‖d.1.1‖ ≠ 0 := ne_of_gt (lt_trans (by norm_num) d.2) + rw [mem_sphere,dist_zero_right,norm_smul,Real.norm_eq_abs,abs_inv,abs_norm, + inv_mul_cancel₀ hn]⟩ + +lemma continuous_radial (n : ℕ) : Continuous (radial n) := by + apply Continuous.subtype_mk + have hn : ∀ d : Collar n, ‖d.1.1‖ ≠ 0 := fun d => ne_of_gt (lt_trans (by norm_num) d.2) + exact ((continuous_subtype_val.comp continuous_subtype_val).norm.inv₀ hn).smul + (continuous_subtype_val.comp continuous_subtype_val) + +lemma collar_openEmbedding (n : ℕ) : IsOpenEmbedding (collarInclusion n) := + (isOpen_lt continuous_const continuous_subtype_val.norm).isOpenEmbedding_subtypeVal + +lemma radial_boundary (n : ℕ) (x : Sphere n) (h : (1/2:ℝ) < ‖(boundary n x).1‖) : + radial n ⟨boundary n x,h⟩ = x := by + apply Subtype.ext + have hx : ‖x.1‖ = 1 := by simpa only [mem_sphere,dist_zero_right] using x.2 + simp only [radial,boundary,hx,inv_one,one_smul] + +variable {X : Type u} [TopologicalSpace X] {ι : Type v} {n : ℕ} +variable (a : ι → C(Sphere n,X)) + +def thickening (U : Set X) : Set (Space a) := fun z => + match z with + | Sum.inl x => x ∈ U + | Sum.inr p => ∃ h : (1/2:ℝ) < ‖p.2.1‖, + a p.1 (radial n ⟨interior n p.2,h⟩) ∈ U + +@[simp] lemma base_mem_thickening (U : Set X) (x : X) : + base a x ∈ thickening a U ↔ x ∈ U := Iff.rfl + +lemma cell_preimage_thickening (U : Set X) (i : ι) : + cell a i ⁻¹' thickening a U = + collarInclusion n '' ((a i ∘ radial n) ⁻¹' U) := by + classical + ext d + by_cases hd : d.1 ∈ ball (0 : Fin n → ℝ) 1 + · have heq : d = interior n ⟨d.1,hd⟩ := rfl + rw [heq] + simp only [Set.mem_preimage,cell_interior,Set.mem_image] + constructor + · rintro ⟨h,hh⟩ + exact ⟨⟨d,h⟩,hh,rfl⟩ + · rintro ⟨y,hy,he⟩ + have heq' : y.1 = d := he + subst d + exact ⟨y.2,hy⟩ + · let x : Sphere n := ⟨d.1,by + have hm := d.2 + simp only [mem_closedBall,mem_ball,mem_sphere] at * + exact le_antisymm hm (le_of_not_gt hd)⟩ + have heq : d = boundary n x := rfl + have hx : ‖x.1‖ = 1 := by simpa only [mem_sphere,dist_zero_right] using x.2 + have hhalf : (1/2:ℝ) < ‖(boundary n x).1‖ := by change (1/2:ℝ) < ‖x.1‖; rw [hx]; norm_num + rw [heq] + simp only [Set.mem_preimage,cell_boundary,base_mem_thickening,Set.mem_image] + constructor + · intro h + exact ⟨⟨boundary n x,hhalf⟩,by simpa only [Function.comp_apply,radial_boundary] using h,rfl⟩ + · rintro ⟨y,hy,he⟩ + have heq' : y = ⟨boundary n x,hhalf⟩ := Subtype.ext he + simpa only [heq',Function.comp_apply,radial_boundary] using hy + +lemma thickening_isOpen {U : Set X} (hU : IsOpen U) : IsOpen (thickening a U) := by + rw [isOpen_iff] + refine ⟨hU,fun i => ?_⟩ + rw [cell_preimage_thickening] + exact (collar_openEmbedding n).isOpenMap _ + (hU.preimage ((a i).continuous.comp (continuous_radial n))) + +variable {G : Type w} [Group G] [MulAction G X] [MulAction G ι] +variable (ha : ∀ (g : G) i x, a (g • i) x = g • a i x) +include ha +lemma thickening_disjoint {U : Set X} + (hU : ∀ g : G, ((g • ·) '' U ∩ U).Nonempty → g = 1) : + ∀ g : G, ((g • ·) '' thickening a U ∩ thickening a U).Nonempty → g = 1 := by + intro g h + obtain ⟨_,⟨z,hz,rfl⟩,hgz⟩ := h + cases z with + | inl x => exact hU g ⟨g • x,⟨x,hz,rfl⟩,hgz⟩ + | inr p => + obtain ⟨hhalf,hz⟩ := hz + obtain ⟨_,hgz⟩ := hgz + change a (g • p.1) (radial n ⟨interior n p.2,hhalf⟩) ∈ U at hgz + rw [ha] at hgz + exact hU g ⟨g • a p.1 (radial n ⟨interior n p.2,hhalf⟩),⟨_,hz,rfl⟩,hgz⟩ + +lemma exists_disjoint_nhds [IsCancelSMul G ι] + (hX : ∀ x : X, ∃ U ∈ 𝓝 x, ∀ g : G, ((g • ·) '' U ∩ U).Nonempty → g = 1) : + ∀ z : Space a, ∃ U ∈ 𝓝 z, ∀ g : G, ((g • ·) '' U ∩ U).Nonempty → g = 1 := by + intro z + cases z with + | inl x => + obtain ⟨U,hUx,hU⟩ := hX x + obtain ⟨V,hVU,hV,hxV⟩ := mem_nhds_iff.mp hUx + refine ⟨thickening a V,(thickening_isOpen a hV).mem_nhds hxV, + thickening_disjoint a ha (fun g hg => hU g ?_)⟩ + exact hg.mono (Set.inter_subset_inter (Set.image_mono hVU) hVU) + | inr p => + refine ⟨Set.range (openCell a p.1),(openCell_openEmbedding a p.1).isOpen_range.mem_nhds + (Set.mem_range_self p.2),?_⟩ + intro g hg + obtain ⟨_,⟨_,⟨x,rfl⟩,rfl⟩,⟨y,hy⟩⟩ := hg + have hi : p.1 = g • p.1 := congrArg Sigma.fst (Sum.inr_injective hy) + apply IsCancelSMul.right_cancel g 1 p.1 + simpa only [one_smul] using hi.symm + +end + +section +open Set Metric Topology +universe u v w z +variable {X : Type u} {Y : Type v} [TopologicalSpace X] [TopologicalSpace Y] +variable {ι : Type w} {κ : Type z} {n : ℕ} +variable (a : ι → C(Sphere n,X)) (b : κ → C(Sphere n,Y)) + +def map (p : C(X,Y)) (σ : ι → κ) (h : ∀ i x, p (a i x) = b (σ i) x) : + C(Space a,Space b) := + lift a ⟨base b ∘ p,(continuous_base b).comp p.continuous⟩ + (fun i => cell b (σ i)) (fun i x => by simp only [cell_boundary,ContinuousMap.coe_mk,Function.comp_apply,h]) + +@[simp] lemma map_base (p : C(X,Y)) (σ : ι → κ) + (h : ∀ i x, p (a i x) = b (σ i) x) (x : X) : + map a b p σ h (base a x) = base b (p x) := rfl + +@[simp] lemma map_cell (p : C(X,Y)) (σ : ι → κ) + (h : ∀ i x, p (a i x) = b (σ i) x) (i : ι) (d : Disk n) : + map a b p σ h (cell a i d) = cell b (σ i) d := lift_cell a _ _ _ i d + +@[simp] lemma map_openCell (p : C(X,Y)) (σ : ι → κ) + (h : ∀ i x, p (a i x) = b (σ i) x) (i : ι) (d : OpenDisk n) : + map a b p σ h (openCell a i d) = openCell b (σ i) d := by + change map a b p σ h (Sum.inr ⟨i,d⟩) = Sum.inr ⟨σ i,d⟩ + rw [← cell_interior a i d,map_cell,cell_interior] + +lemma map_surjective (p : C(X,Y)) (σ : ι → κ) + (h : ∀ i x, p (a i x) = b (σ i) x) + (hp : Function.Surjective p) (hσ : Function.Surjective σ) : + Function.Surjective (map a b p σ h) := by + intro z + cases z with + | inl y => + obtain ⟨x,rfl⟩ := hp y + exact ⟨base a x,rfl⟩ + | inr q => + obtain ⟨i,hi⟩ := hσ q.1 + exact ⟨openCell a i q.2,by rw [map_openCell,hi]; rfl⟩ + +lemma map_isQuotientMap (p : C(X,Y)) (σ : ι → κ) + (h : ∀ i x, p (a i x) = b (σ i) x) + (hp : IsQuotientMap p) (hσ : Function.Surjective σ) : + IsQuotientMap (map a b p σ h) := by + refine ⟨?_,map_surjective a b p σ h hp.surjective hσ⟩ + rw [isCoinducing_iff] + intro U + constructor + · intro hU + rw [isOpen_iff] at hU ⊢ + constructor + · apply hp.isOpen_preimage.mp + exact hU.1 + · intro j + obtain ⟨i,rfl⟩ := hσ j + convert hU.2 i using 1 + ext d + simp only [Set.mem_preimage,map_cell] + · exact fun hU => hU.preimage (map a b p σ h).continuous + +end + +open Set Metric Topology +universe u v w z + +def FreeIndex (G : Type u) (ι : Type v) := G × ι + +instance {G : Type u} [Group G] {ι : Type v} : MulAction G (FreeIndex G ι) where + smul g p := (g * p.1,p.2) + one_smul p := by change ((1:G)*p.1,p.2)=p; simp only [one_mul]; rfl + mul_smul g h p := by change ((g*h)*p.1,p.2)=(g*(h*p.1),p.2); rw [mul_assoc] + +instance {G : Type u} [Group G] {ι : Type v} : IsCancelSMul G (FreeIndex G ι) where + right_cancel' _ _ _ he := mul_right_cancel (congrArg (fun p : FreeIndex G ι => p.1) he) + +variable {G : Type u} [Group G] +variable {E : Type v} [TopologicalSpace E] [MulAction G E] [ContinuousConstSMul G E] +variable {X : Type w} [TopologicalSpace X] {ι : Type z} {n : ℕ} +variable (a : ι → C(Sphere n,E)) + +def equivariantFamily : FreeIndex G ι → C(Sphere n,E) := + fun i => ⟨fun x => i.1 • a i.2 x,(continuous_const_smul i.1).comp (a i.2).continuous⟩ + +lemma equivariantFamily_smul (g : G) (i : FreeIndex G ι) (x : Sphere n) : + equivariantFamily (G := G) a (g • i) x = g • equivariantFamily a i x := mul_smul g i.1 _ + +instance equivariantAttachmentContinuousAction : + ContinuousConstSMul G (Space (equivariantFamily (G := G) a)) := + continuousConstSMul _ (equivariantFamily_smul a) + +variable (p : C(E,X)) (hp : IsQuotientCoveringMap p G) +variable (b : ι → C(Sphere n,X)) (h : ∀ i x, p (a i x) = b i x) + +include hp h in +lemma equivariantFamily_over (i : FreeIndex G ι) (x : Sphere n) : + p (equivariantFamily (G := G) a i x) = b i.2 x := + (hp.map_smul i.1).trans (h i.2 x) + +def coverMap : C(Space (equivariantFamily (G := G) a),Space b) := + map _ b p Prod.snd (equivariantFamily_over a p hp b h) + +lemma coverMap_isQuotient : IsQuotientMap (coverMap a p hp b h) := + map_isQuotientMap _ b p Prod.snd _ hp.toIsQuotientMap (fun i => ⟨(1,i),rfl⟩) + +lemma coverMap_fibers {e₁ e₂ : Space (equivariantFamily (G := G) a)} : + coverMap a p hp b h e₁ = coverMap a p hp b h e₂ ↔ e₁ ∈ MulAction.orbit G e₂ := by + classical + cases e₁ with + | inl x => + cases e₂ with + | inl y => + change Sum.inl (p x) = Sum.inl (p y) ↔ _ + rw [Sum.inl.injEq,hp.apply_eq_iff_mem_orbit] + constructor + · rintro ⟨g,hg⟩; exact ⟨g,congrArg Sum.inl hg⟩ + · rintro ⟨g,hg⟩; exact ⟨g,Sum.inl_injective hg⟩ + | inr q => + constructor + · intro hh + change base b (p x) = + map _ b p (fun index : FreeIndex G ι => index.2) _ (openCell _ q.1 q.2) at hh + rw [map_openCell] at hh + cases hh + · rintro ⟨g,hg⟩; cases hg + | inr q => + cases e₂ with + | inl y => + constructor + · intro hh + change map _ b p (fun index : FreeIndex G ι => index.2) _ + (openCell _ q.1 q.2) = base b (p y) at hh + rw [map_openCell] at hh + cases hh + · rintro ⟨g,hg⟩; cases hg + | inr r => + change map _ b p (fun index : FreeIndex G ι => index.2) _ (openCell _ q.1 q.2) = + map _ b p (fun index : FreeIndex G ι => index.2) _ (openCell _ r.1 r.2) ↔ _ + rw [map_openCell,map_openCell] + constructor + · intro hh + have hi : q.1.2 = r.1.2 := congrArg Sigma.fst (Sum.inr_injective hh) + have hd : q.2 = r.2 := congrArg (fun p : Σ _ : ι, OpenDisk n => p.2) (Sum.inr_injective hh) + refine ⟨q.1.1 * r.1.1⁻¹,?_⟩ + change Sum.inr ⟨((q.1.1 * r.1.1⁻¹) * r.1.1,r.1.2),r.2⟩ = Sum.inr q + simp only [inv_mul_cancel_right,← hi,← hd] + rfl + · rintro ⟨g,hg⟩ + change (Sum.inr ⟨g • r.1,r.2⟩ : Space (equivariantFamily (G := G) a)) = Sum.inr q at hg + have hi : (g • r.1) = q.1 := congrArg Sigma.fst (Sum.inr_injective hg) + have htuple : (⟨g • r.1,r.2⟩ : Σ _ : FreeIndex G ι, OpenDisk n) = q := Sum.inr_injective hg + have hd' := congrArg (fun p : Σ _ : FreeIndex G ι, OpenDisk n => p.2) htuple + have hd : r.2 = q.2 := hd' + have his' := congrArg (fun p : FreeIndex G ι => p.2) hi + have his : r.1.2 = q.1.2 := his' + change (Sum.inr ⟨q.1.2,q.2⟩ : Space b) = Sum.inr ⟨r.1.2,r.2⟩ + rw [his,hd] + +lemma coverMap_isQuotientCovering : IsQuotientCoveringMap (coverMap a p hp b h) G where + __ := coverMap_isQuotient a p hp b h + __ := equivariantAttachmentContinuousAction a + apply_eq_iff_mem_orbit := coverMap_fibers a p hp b h + disjoint := exists_disjoint_nhds _ (equivariantFamily_smul a) hp.disjoint + +lemma coverMap_isCovering : IsCoveringMap (coverMap a p hp b h) := + (coverMap_isQuotientCovering a p hp b h).isCoveringMap + +end UniversalFInfinity.Attachment + +end + +end OAI diff --git a/lean/OAI/GroupTheory/UniversalGroup/CellularChains.lean b/lean/OAI/GroupTheory/UniversalGroup/CellularChains.lean new file mode 100644 index 0000000000000000000000000000000000000000..850913932f314b88bbd3e415dc62125f4aa2571c --- /dev/null +++ b/lean/OAI/GroupTheory/UniversalGroup/CellularChains.lean @@ -0,0 +1,509 @@ +import OAI.GroupTheory.UniversalGroup.TorusSpheres + +namespace OAI + +noncomputable section + +open Set Metric Topology BigOperators +open Set Metric Topology +open Set Topology +open Set Metric Topology +open scoped NNReal +open Set Metric Topology +open scoped NNReal ENNReal +open Set Metric Topology +open scoped TensorProduct + +namespace UniversalFInfinity.Cellular + +section +open Set Metric Topology +universe u +variable {G : Type u} [Group G] {X : Type u} [TopologicalSpace X] [T2Space X] + [MulAction G X] [ContinuousConstSMul G X] [CWComplex (univ : Set X)] +variable {ι : ℕ → Type u} +variable (σ : ∀ n, (G × ι n) ≃ RelCWComplex.cell (univ : Set X) n) +variable (hσ : ∀ n (g h : G) (i : ι n) (x : Fin n → ℝ), + RelCWComplex.map n (σ n (g*h,i)) x = g • RelCWComplex.map n (σ n (h,i)) x) + +variable {E : Type u} [TopologicalSpace E] [MulAction G E] [ContinuousConstSMul G E] + +lemma exists_equivariant_skeleton_extension_cells (n : ℕ) + (b : C(Skeleton (univ : Set X) n,E)) + (hb : ∀ (g : G) x, b (skeletonTranslate σ hσ n g x) = g • b x) + (hfill : ∀ i : ι n, ∃ d : C(Disk n,E), ∀ x, d (boundary n x) = b (skeletonBoundary n (σ n (1,i)) x)) : + ∃ e : C(Skeleton (univ : Set X) (n+1),E), + (∀ x, e (skeletonBase n x) = b x) ∧ + ∀ (g : G) x, e (skeletonTranslate σ hσ (n+1) g x) = g • e x := by + choose d hd using hfill + let D (j : RelCWComplex.cell (univ : Set X) n) : C(Disk n,E) := + ⟨fun x => ((σ n).symm j).1 • d ((σ n).symm j).2 x, + (continuous_const_smul _).comp (d _).continuous⟩ + have hD (j : RelCWComplex.cell (univ : Set X) n) (x : Sphere n) : + D j (boundary n x) = b (skeletonBoundary n j x) := by + obtain ⟨⟨g,i⟩,rfl⟩ := (σ n).surjective j + change ((σ n).symm (σ n (g,i))).1 • d ((σ n).symm (σ n (g,i))).2 (boundary n x) = _ + rw [Equiv.symm_apply_apply,hd] + change g • b (skeletonBoundary n (σ n (1,i)) x) = _ + rw [←hb] + congr 1 + apply Subtype.ext + exact (hσ n g 1 i x.1).symm.trans (by rw [mul_one]; rfl) + let f := Attachment.lift (skeletonBoundary (C := (univ : Set X)) n) b D hD + let e : C(Skeleton (univ : Set X) (n+1),E) := f.comp ⟨(skeletonHomeomorph n).symm,(skeletonHomeomorph n).symm.continuous⟩ + have he_base (x : Skeleton (univ : Set X) n) : e (skeletonBase n x) = b x := by + change f ((skeletonHomeomorph n).symm (skeletonBase n x)) = _ + rw [←skeletonAssembly_base] + change f ((skeletonHomeomorph n).symm ((skeletonHomeomorph n) (Attachment.base _ x))) = _ + rw [Homeomorph.symm_apply_apply] + rfl + have he_cell (j : RelCWComplex.cell (univ : Set X) n) (x : Disk n) : + e (skeletonCell n j x) = D j x := by + change f ((skeletonHomeomorph n).symm (skeletonCell n j x)) = _ + rw [←skeletonAssembly_cell] + change f ((skeletonHomeomorph n).symm ((skeletonHomeomorph n) (Attachment.cell _ j x))) = _ + rw [Homeomorph.symm_apply_apply] + exact Attachment.lift_cell _ _ _ _ _ _ + refine ⟨e,he_base,?_⟩ + intro g x + obtain ⟨y,rfl⟩ := skeletonAssembly_surjective n x + cases y with + | inl x => + change e (skeletonTranslate σ hσ (n+1) g (skeletonBase n x)) = g • e (skeletonBase n x) + rw [skeletonTranslate_base,he_base,he_base,hb] + | inr p => + obtain ⟨⟨h,i⟩,hj⟩ := (σ n).surjective p.1 + have heq : skeletonAssembly n (Sum.inr p) = skeletonCell n p.1 (Attachment.interior n p.2) := by + exact skeletonAssembly_interior n p.1 p.2 + rw [heq,←hj,skeletonTranslate_cell,he_cell,he_cell] + change ((σ n).symm (σ n (g*h,i))).1 • d ((σ n).symm (σ n (g*h,i))).2 _ = + g • (((σ n).symm (σ n (h,i))).1 • d ((σ n).symm (σ n (h,i))).2 _) + simp only [Equiv.symm_apply_apply,mul_smul] +end + +section +open Set Metric Topology +universe u +variable {G : Type u} [Group G] {X : Type u} [TopologicalSpace X] [T2Space X] + [MulAction G X] [ContinuousConstSMul G X] [CWComplex (univ : Set X)] +variable {ι : ℕ → Type u} +variable (σ : ∀ n, (G × ι n) ≃ RelCWComplex.cell (univ : Set X) n) +variable (hσ : ∀ n (g h : G) (i : ι n) (x : Fin n → ℝ), + RelCWComplex.map n (σ n (g*h,i)) x = g • RelCWComplex.map n (σ n (h,i)) x) +variable {E : Type u} [TopologicalSpace E] [MulAction G E] [ContinuousConstSMul G E] +variable (n : ℕ) (b : C(Skeleton (univ : Set X) n,E)) +variable (hb : ∀ (g : G) x, b (skeletonTranslate σ hσ n g x) = g • b x) + +def skeletonObstructions (i : ι n) : C(Sphere n,E) := + b.comp (skeletonBoundary n (σ n (1,i))) + +abbrev SkeletonAttachment := + Attachment.Space (Attachment.equivariantFamily (G := G) (skeletonObstructions σ n b)) + +def attachmentBase : C(E,SkeletonAttachment σ n b) := + ⟨Attachment.base _,Attachment.continuous_base _⟩ + +include hb in + +theorem extend_by_cell_orbits : + ∃ e : C(Skeleton (univ : Set X) (n+1),SkeletonAttachment σ n b), + (∀ x, e (skeletonBase n x) = attachmentBase σ n b (b x)) ∧ + ∀ (g : G) x, e (skeletonTranslate σ hσ (n+1) g x) = g • e x := by + apply exists_equivariant_skeleton_extension_cells σ hσ n ((attachmentBase σ n b).comp b) + · intro g x + change Attachment.base _ (b (skeletonTranslate σ hσ n g x)) = _ + rw [hb] + rfl + · intro i + refine ⟨Attachment.cell _ (1,i),?_⟩ + intro x + have hc := Attachment.cell_boundary (Attachment.equivariantFamily (G := G) (skeletonObstructions σ n b)) (show Attachment.FreeIndex G (ι n) from (1,i)) x + change _ = _ at hc + exact hc.trans (by + change Attachment.base _ ((1:G) • b (skeletonBoundary n (σ n (1,i)) x)) = _ + rw [one_smul] + rfl) +end + +section +open Set Metric Topology +universe u +variable {G : Type u} [Group G] {X : Type u} [TopologicalSpace X] [T2Space X] + [MulAction G X] [ContinuousConstSMul G X] [CWComplex (univ : Set X)] +variable {ι : ℕ → Type u} +variable (σ : ∀ n, (G × ι n) ≃ RelCWComplex.cell (univ : Set X) n) +variable (hσ : ∀ n (g h : G) (i : ι n) (x : Fin n → ℝ), + RelCWComplex.map n (σ n (g*h,i)) x = g • RelCWComplex.map n (σ n (h,i)) x) +variable {E B : Type u} [TopologicalSpace E] [TopologicalSpace B] + [MulAction G E] [ContinuousConstSMul G E] [MulAction G B] + +lemma exists_equivariant_skeleton_lift_cells (n : ℕ) (p : C(E,B)) + (hp : ∀ (g : G) e, p (g • e) = g • p e) + (F : C(Skeleton (univ : Set X) (n+1),B)) + (hF : ∀ (g : G) x, F (skeletonTranslate σ hσ (n+1) g x) = g • F x) + (b : C(Skeleton (univ : Set X) n,E)) + (hb : ∀ (g : G) x, b (skeletonTranslate σ hσ n g x) = g • b x) + (hfill : ∀ i : ι n, ∃ d : C(Disk n,E), + (∀ x,d (boundary n x) = b (skeletonBoundary n (σ n (1,i)) x)) ∧ + ∀ x,p (d x) = F (skeletonCell n (σ n (1,i)) x)) + (hbF : ∀ x, p (b x) = F (skeletonBase n x)) : + ∃ e : C(Skeleton (univ : Set X) (n+1),E), + (∀ x, e (skeletonBase n x) = b x) ∧ (∀ x, p (e x) = F x) ∧ + ∀ (g : G) x, e (skeletonTranslate σ hσ (n+1) g x) = g • e x := by + choose d hd hf using hfill + let D (j : RelCWComplex.cell (univ : Set X) n) : C(Disk n,E) := + ⟨fun x => ((σ n).symm j).1 • d ((σ n).symm j).2 x, + (continuous_const_smul _).comp (d _).continuous⟩ + have hD (j : RelCWComplex.cell (univ : Set X) n) (x : Sphere n) : + D j (boundary n x) = b (skeletonBoundary n j x) := by + obtain ⟨⟨g,i⟩,rfl⟩ := (σ n).surjective j + change ((σ n).symm (σ n (g,i))).1 • d ((σ n).symm (σ n (g,i))).2 (boundary n x) = _ + rw [Equiv.symm_apply_apply,hd] + change g • b (skeletonBoundary n (σ n (1,i)) x) = _ + rw [←hb] + congr 1 + apply Subtype.ext + exact (hσ n g 1 i x.1).symm.trans (by rw [mul_one]; rfl) + let f := Attachment.lift (skeletonBoundary (C := (univ : Set X)) n) b D hD + let e : C(Skeleton (univ : Set X) (n+1),E) := f.comp ⟨(skeletonHomeomorph n).symm,(skeletonHomeomorph n).symm.continuous⟩ + have he_base (x : Skeleton (univ : Set X) n) : e (skeletonBase n x) = b x := by + change f ((skeletonHomeomorph n).symm (skeletonBase n x)) = _ + rw [←skeletonAssembly_base] + change f ((skeletonHomeomorph n).symm ((skeletonHomeomorph n) (Attachment.base _ x))) = _ + rw [Homeomorph.symm_apply_apply] + rfl + have he_cell (j : RelCWComplex.cell (univ : Set X) n) (x : Disk n) : + e (skeletonCell n j x) = D j x := by + change f ((skeletonHomeomorph n).symm (skeletonCell n j x)) = _ + rw [←skeletonAssembly_cell] + change f ((skeletonHomeomorph n).symm ((skeletonHomeomorph n) (Attachment.cell _ j x))) = _ + rw [Homeomorph.symm_apply_apply] + exact Attachment.lift_cell _ _ _ _ _ _ + have he (g : G) (x : Skeleton (univ : Set X) (n+1)) : + e (skeletonTranslate σ hσ (n+1) g x) = g • e x := by + obtain ⟨y,rfl⟩ := skeletonAssembly_surjective n x + cases y with + | inl x => + change e (skeletonTranslate σ hσ (n+1) g (skeletonBase n x)) = g • e (skeletonBase n x) + rw [skeletonTranslate_base,he_base,he_base,hb] + | inr q => + obtain ⟨⟨h,i⟩,hj⟩ := (σ n).surjective q.1 + have heq : skeletonAssembly n (Sum.inr q) = skeletonCell n q.1 (Attachment.interior n q.2) := + skeletonAssembly_interior n q.1 q.2 + rw [heq,←hj,skeletonTranslate_cell,he_cell,he_cell] + change ((σ n).symm (σ n (g*h,i))).1 • d ((σ n).symm (σ n (g*h,i))).2 _ = + g • (((σ n).symm (σ n (h,i))).1 • d ((σ n).symm (σ n (h,i))).2 _) + simp only [Equiv.symm_apply_apply,mul_smul] + refine ⟨e,he_base,?_,he⟩ + intro x + obtain ⟨y,rfl⟩ := skeletonAssembly_surjective n x + cases y with + | inl x => + change p (e (skeletonBase n x)) = F (skeletonBase n x) + rw [he_base,hbF] + | inr q => + rw [skeletonAssembly_interior,he_cell] + obtain ⟨⟨g,i⟩,hj⟩ := (σ n).surjective q.1 + rw [←hj] + change p (((σ n).symm (σ n (g,i))).1 • d ((σ n).symm (σ n (g,i))).2 _) = _ + rw [Equiv.symm_apply_apply,hp,hf] + change g • F (skeletonCell n (σ n (1,i)) _) = _ + rw [←hF,skeletonTranslate_cell,mul_one] +end + +open Set Metric Topology +universe u v w +variable {Y : Type v} {Z : Type w} [TopologicalSpace Y] [TopologicalSpace Z] + +lemma cylinder_filling_from_disk {n : ℕ} (q : C(Y,Z)) + (a : C(Sphere n,C(unitInterval,Y))) (b : C(Disk n,Y × Y)) + (h : ∀ x, pathEndpoint (a x) = b (boundary n x)) + (F : C(Disk (n+1),Z)) (hF : ∀ x,F (boundary (n+1) x) = q (cylinderBoundaryMap a b h x)) : + ∃ e : C(Disk n,C(unitInterval,Z)), + (∀ x t, e (boundary n x) t = q (a x t)) ∧ + ∀ x, pathEndpoint (e x) = (q (b x).1,q (b x).2) := by + let e : C(Disk n,C(unitInterval,Z)) := + (F.comp ⟨fun p : Disk n × unitInterval => diskCons p.1 p.2,continuous_diskCons⟩).curry + refine ⟨e,?_,?_⟩ + · intro x t + let s : Sphere (n+1) := ⟨_,cons_mem_sphere_of_boundary x t⟩ + have hs : s ∈ cylinderFace n none := by + change (diskTail (diskCons (boundary n x) t)).1 ∈ sphere 0 1 + rw [diskTail_cons] + exact x.2 + change F (diskCons (boundary n x) t) = q (a x t) + rw [show diskCons (boundary n x) t = boundary (n+1) s from rfl,hF, + cylinderBoundaryMap_face a b h none ⟨s,hs⟩] + change q (a (faceSphere ⟨s,hs⟩) (diskTime (diskCons (boundary n x) t))) = q (a x t) + rw [diskTime_cons] + congr 2 + · intro x + apply Prod.ext + · let s : Sphere (n+1) := ⟨_,cons_zero_mem_sphere x⟩ + have hs : s ∈ cylinderFace n (some false) := by + change (diskCons x 0).1 0 = -1 + norm_num [diskCons] + change F (diskCons x 0) = q (b x).1 + rw [show diskCons x 0 = boundary (n+1) s from rfl,hF, + cylinderBoundaryMap_face a b h (some false) ⟨s,hs⟩] + change q (b (diskTail (diskCons x 0))).1 = q (b x).1 + rw [diskTail_cons] + · let s : Sphere (n+1) := ⟨_,cons_one_mem_sphere x⟩ + have hs : s ∈ cylinderFace n (some true) := by + change (diskCons x 1).1 0 = 1 + norm_num [diskCons] + change F (diskCons x 1) = q (b x).2 + rw [show diskCons x 1 = boundary (n+1) s from rfl,hF, + cylinderBoundaryMap_face a b h (some true) ⟨s,hs⟩] + change q (b (diskTail (diskCons x 1))).2 = q (b x).2 + rw [diskTail_cons] + +end UniversalFInfinity.Cellular + +namespace UniversalFInfinity.Attachment +open Cellular +universe u v +variable {G : Type u} [Group G] {E : Type v} [TopologicalSpace E] +variable [MulAction G E] [ContinuousConstSMul G E] {ι : Type v} {n : ℕ} +variable (a : ι → C(Sphere n,E)) +lemma representative_filling (i : ι) : + ∃ F : C(Disk n,Space (equivariantFamily (G := G) a)), + ∀ x,F (boundary n x) = base _ (a i x) := by + refine ⟨cell _ (show FreeIndex G ι from (1,i)),?_⟩ + intro x + exact (cell_boundary _ _ x).trans (congrArg (base _) (one_smul G (a i x))) +end UniversalFInfinity.Attachment + +namespace UniversalFInfinity.Cellular + +section +open Set Metric Topology +open scoped unitInterval +universe u +variable {G : Type u} [Group G] {X : Type u} [TopologicalSpace X] [T2Space X] + [MulAction G X] [ContinuousConstSMul G X] [CWComplex (univ : Set X)] +variable {ι : ℕ → Type u} +variable (κ : ∀ n, (G × ι n) ≃ RelCWComplex.cell (univ : Set X) n) +variable (hκ : ∀ n (g h : G) (i : ι n) (x : Fin n → ℝ), + RelCWComplex.map n (κ n (g*h,i)) x = g • RelCWComplex.map n (κ n (h,i)) x) +variable {E : Type u} [TopologicalSpace E] [MulAction G E] [ContinuousConstSMul G E] +variable (n : ℕ) (a b : C(Skeleton (univ : Set X) (n+1),E)) +variable (H : C(Skeleton (univ : Set X) n,C(I,E))) +variable (hH : ∀ x,pathEndpoint (H x) = (a (skeletonBase n x),b (skeletonBase n x))) + +def homotopyObstructions (i : ι n) : C(Sphere (n+1),E) := + cylinderBoundaryMap (H.comp (skeletonBoundary n (κ n (1,i)))) + ((a.prodMk b).comp (skeletonCell n (κ n (1,i)))) (by + intro x; exact hH (skeletonBoundary n (κ n (1,i)) x)) + +abbrev HomotopyAttachment := + Attachment.Space (Attachment.equivariantFamily (G := G) (homotopyObstructions κ n a b H hH)) + +def homotopyAttachmentBase : C(E,HomotopyAttachment κ n a b H hH) := + ⟨Attachment.base _,Attachment.continuous_base _⟩ + +theorem homotopy_extend_by_cell_orbits + (ha : ∀ (g : G) x,a (skeletonTranslate κ hκ (n+1) g x) = g • a x) + (hb : ∀ (g : G) x,b (skeletonTranslate κ hκ (n+1) g x) = g • b x) + (hHe : ∀ (g : G) x,H (skeletonTranslate κ hκ n g x) = g • H x) : + ∃ J : C(Skeleton (univ : Set X) (n+1),C(I,HomotopyAttachment κ n a b H hH)), + (∀ x,J (skeletonBase n x) = (postPath (homotopyAttachmentBase κ n a b H hH)) (H x)) ∧ + (∀ x,pathEndpoint (J x) = + (homotopyAttachmentBase κ n a b H hH (a x),homotopyAttachmentBase κ n a b H hH (b x))) ∧ + ∀ (g : G) x,J (skeletonTranslate κ hκ (n+1) g x) = g • J x := by + let q := homotopyAttachmentBase κ n a b H hH + let F := (q.comp a).prodMk (q.comp b) + let L := (postPath q).comp H + apply exists_equivariant_skeleton_lift_cells κ hκ n pathEndpoint (fun _ _ => rfl) + F (fun g x => ?_) L (fun g x => ?_) (fun i => ?_) (fun x => ?_) + · apply Prod.ext + · change Attachment.base _ (a (skeletonTranslate κ hκ (n+1) g x)) = _ + rw [ha]; rfl + · change Attachment.base _ (b (skeletonTranslate κ hκ (n+1) g x)) = _ + rw [hb]; rfl + · apply ContinuousMap.ext; intro t + change Attachment.base _ (H (skeletonTranslate κ hκ n g x) t) = _ + rw [hHe]; rfl + · obtain ⟨D,hD⟩ := Attachment.representative_filling (G := G) (homotopyObstructions κ n a b H hH) i + obtain ⟨e,he,hp⟩ := cylinder_filling_from_disk q + (H.comp (skeletonBoundary n (κ n (1,i)))) + ((a.prodMk b).comp (skeletonCell n (κ n (1,i)))) + (fun x => hH (skeletonBoundary n (κ n (1,i)) x)) D hD + refine ⟨e,fun x => ContinuousMap.ext (he x),hp⟩ + · exact Prod.ext (congrArg q (congrArg Prod.fst (hH x))) + (congrArg q (congrArg Prod.snd (hH x))) +end + +section +open Set Metric Topology +universe u +variable {G : Type u} [Group G] {X : Type u} [TopologicalSpace X] [T2Space X] + [MulAction G X] [ContinuousConstSMul G X] [CWComplex (univ : Set X)] +variable {ι : ℕ → Type u} +variable (σ : ∀ n, (G × ι n) ≃ RelCWComplex.cell (univ : Set X) n) +variable (hσ : ∀ n (g h : G) (i : ι n) (x : Fin n → ℝ), + RelCWComplex.map n (σ n (g*h,i)) x = g • RelCWComplex.map n (σ n (h,i)) x) +variable {E B : Type u} [TopologicalSpace E] [TopologicalSpace B] + [MulAction G E] [ContinuousConstSMul G E] [MulAction G B] + +lemma exists_equivariant_skeleton_lift_cells_pred (n : ℕ) (p : C(E,B)) + (hp : ∀ (g : G) e, p (g • e) = g • p e) + (P : E → Prop) (hP : ∀ (g : G) x,P x → P (g • x)) + (F : C(Skeleton (univ : Set X) (n+1),B)) + (hF : ∀ (g : G) x, F (skeletonTranslate σ hσ (n+1) g x) = g • F x) + (b : C(Skeleton (univ : Set X) n,E)) + (hb : ∀ (g : G) x, b (skeletonTranslate σ hσ n g x) = g • b x) + (hbP : ∀ x,P (b x)) + (hfill : ∀ i : ι n, ∃ d : C(Disk n,E), + (∀ x,d (boundary n x) = b (skeletonBoundary n (σ n (1,i)) x)) ∧ + (∀ x,p (d x) = F (skeletonCell n (σ n (1,i)) x)) ∧ ∀ x,P (d x)) + (hbF : ∀ x, p (b x) = F (skeletonBase n x)) : + ∃ e : C(Skeleton (univ : Set X) (n+1),E), + (∀ x, e (skeletonBase n x) = b x) ∧ (∀ x, p (e x) = F x) ∧ + (∀ (g : G) x, e (skeletonTranslate σ hσ (n+1) g x) = g • e x) ∧ ∀ x,P (e x) := by + choose d hd hf hdP using hfill + let D (j : RelCWComplex.cell (univ : Set X) n) : C(Disk n,E) := + ⟨fun x => ((σ n).symm j).1 • d ((σ n).symm j).2 x, + (continuous_const_smul _).comp (d _).continuous⟩ + have hD (j : RelCWComplex.cell (univ : Set X) n) (x : Sphere n) : + D j (boundary n x) = b (skeletonBoundary n j x) := by + obtain ⟨⟨g,i⟩,rfl⟩ := (σ n).surjective j + change ((σ n).symm (σ n (g,i))).1 • d ((σ n).symm (σ n (g,i))).2 (boundary n x) = _ + rw [Equiv.symm_apply_apply,hd] + change g • b (skeletonBoundary n (σ n (1,i)) x) = _ + rw [←hb] + congr 1 + apply Subtype.ext + exact (hσ n g 1 i x.1).symm.trans (by rw [mul_one]; rfl) + let f := Attachment.lift (skeletonBoundary (C := (univ : Set X)) n) b D hD + let e : C(Skeleton (univ : Set X) (n+1),E) := f.comp ⟨(skeletonHomeomorph n).symm,(skeletonHomeomorph n).symm.continuous⟩ + have he_base (x : Skeleton (univ : Set X) n) : e (skeletonBase n x) = b x := by + change f ((skeletonHomeomorph n).symm (skeletonBase n x)) = _ + rw [←skeletonAssembly_base] + change f ((skeletonHomeomorph n).symm ((skeletonHomeomorph n) (Attachment.base _ x))) = _ + rw [Homeomorph.symm_apply_apply] + rfl + have he_cell (j : RelCWComplex.cell (univ : Set X) n) (x : Disk n) : + e (skeletonCell n j x) = D j x := by + change f ((skeletonHomeomorph n).symm (skeletonCell n j x)) = _ + rw [←skeletonAssembly_cell] + change f ((skeletonHomeomorph n).symm ((skeletonHomeomorph n) (Attachment.cell _ j x))) = _ + rw [Homeomorph.symm_apply_apply] + exact Attachment.lift_cell _ _ _ _ _ _ + have he (g : G) (x : Skeleton (univ : Set X) (n+1)) : + e (skeletonTranslate σ hσ (n+1) g x) = g • e x := by + obtain ⟨y,rfl⟩ := skeletonAssembly_surjective n x + cases y with + | inl x => + change e (skeletonTranslate σ hσ (n+1) g (skeletonBase n x)) = g • e (skeletonBase n x) + rw [skeletonTranslate_base,he_base,he_base,hb] + | inr q => + obtain ⟨⟨h,i⟩,hj⟩ := (σ n).surjective q.1 + have heq : skeletonAssembly n (Sum.inr q) = skeletonCell n q.1 (Attachment.interior n q.2) := + skeletonAssembly_interior n q.1 q.2 + rw [heq,←hj,skeletonTranslate_cell,he_cell,he_cell] + change ((σ n).symm (σ n (g*h,i))).1 • d ((σ n).symm (σ n (g*h,i))).2 _ = + g • (((σ n).symm (σ n (h,i))).1 • d ((σ n).symm (σ n (h,i))).2 _) + simp only [Equiv.symm_apply_apply,mul_smul] + refine ⟨e,he_base,?_,he,?_⟩ + · intro x + obtain ⟨y,rfl⟩ := skeletonAssembly_surjective n x + cases y with + | inl x => + change p (e (skeletonBase n x)) = F (skeletonBase n x) + rw [he_base,hbF] + | inr q => + rw [skeletonAssembly_interior,he_cell] + obtain ⟨⟨g,i⟩,hj⟩ := (σ n).surjective q.1 + rw [←hj] + change p (((σ n).symm (σ n (g,i))).1 • d ((σ n).symm (σ n (g,i))).2 _) = _ + rw [Equiv.symm_apply_apply,hp,hf] + change g • F (skeletonCell n (σ n (1,i)) _) = _ + rw [←hF,skeletonTranslate_cell,mul_one] + · intro x + obtain ⟨y,rfl⟩ := skeletonAssembly_surjective n x + cases y with + | inl x => + change P (e (skeletonBase n x)) + rw [he_base] + exact hbP x + | inr q => + rw [skeletonAssembly_interior,he_cell] + exact hP _ _ (hdP _ _) + +end + +open Set Metric Topology +universe u +variable {Y : Type u} [TopologicalSpace Y] +def pathZero : C(C(unitInterval,Y),Y) := ⟨fun p => p 0,continuous_eval_const 0⟩ +def pathOne : C(C(unitInterval,Y),Y) := ⟨fun p => p 1,continuous_eval_const 1⟩ + +def pathEvaluation : (pathZero (Y := Y)).Homotopy pathOne where + toFun z := z.2 z.1 + continuous_toFun := continuous_eval.comp (continuous_snd.prodMk continuous_fst) + map_zero_left _ := rfl + map_one_left _ := rfl + +def pausePaths : C(C(unitInterval,Y),C(unitInterval,Y)) := + ContinuousMap.curry (((pathEvaluation (Y := Y)).trans (ContinuousMap.Homotopy.refl pathOne)).toContinuousMap.comp + ⟨Prod.swap,continuous_swap⟩) + +lemma pausePaths_zero (p : C(unitInterval,Y)) : pausePaths p 0 = p 0 := + ((pathEvaluation (Y := Y)).trans (ContinuousMap.Homotopy.refl pathOne)).apply_zero p +lemma pausePaths_one (p : C(unitInterval,Y)) : pausePaths p 1 = p 1 := + ((pathEvaluation (Y := Y)).trans (ContinuousMap.Homotopy.refl pathOne)).apply_one p + +lemma pausePaths_smul {G : Type*} [Group G] [MulAction G Y] [ContinuousConstSMul G Y] + (g : G) (p : C(unitInterval,Y)) : pausePaths (g • p) = g • pausePaths p := by + apply ContinuousMap.ext; intro t + change ((pathEvaluation (Y := Y)).trans (ContinuousMap.Homotopy.refl pathOne)) (t,g • p) = + g • (((pathEvaluation (Y := Y)).trans (ContinuousMap.Homotopy.refl pathOne)) (t,p)) + simp only [ContinuousMap.Homotopy.trans_apply] + split_ifs <;> rfl + +variable [T2Space Y] [CWComplex (univ : Set Y)] +omit [TopologicalSpace Y] [T2Space Y] [CWComplex (univ : Set Y)] in +lemma dimH_disk_le (m : ℕ) : dimH (Set.univ : Set (Disk m)) ≤ m := by + rw [← isometry_subtype_coe.dimH_image] + have hm := dimH_mono (Set.subset_univ (closedBall (0 : Fin m → ℝ) 1)) + simpa only [Set.image_univ,Subtype.range_coe_subtype,Set.ofPred_mem_eq,Real.dimH_univ_pi_fin] using hm + +lemma disk_homotopy_into_skeleton {n d : ℕ} (hnd : n < d) + (f : C(Disk n,Y)) (H : C(Sphere n,C(unitInterval,Y))) + (h0 : ∀ x,H x 0 = f (boundary n x)) + (h1 : ∀ x,H x 1 ∈ Skeleton (univ : Set Y) d) : + ∃ e : C(Disk n,C(unitInterval,Y)), + (∀ x,e (boundary n x) = pausePaths (H x)) ∧ + (∀ x,e x 0 = f x) ∧ ∀ x,e x 1 ∈ Skeleton (univ : Set Y) d := by + let B : C(unitInterval × Sphere n,Y) := + H.uncurry.comp ⟨Prod.swap,continuous_swap⟩ + let E := Cylinder.extension f B h0 + let f₁ : C(Disk n,Y) := E.comp ⟨fun x => (1,x),continuous_const.prodMk continuous_id⟩ + have hs (x : Sphere n) : f₁ (boundary n x) = H x 1 := + Cylinder.extension_boundary f B h0 1 x + obtain ⟨g,J,hJ⟩ := exists_cellular_approximation d f₁ (fun _ => Set.mem_univ _) + ((dimH_disk_le n).trans_lt (by exact_mod_cast hnd)) + let K : f.Homotopy f₁ := + { toContinuousMap := E + map_zero_left := Cylinder.extension_zero f B h0 + map_one_left := fun _ => rfl } + let L := K.trans J + let e := ContinuousMap.curry (L.toContinuousMap.comp ⟨Prod.swap,continuous_swap⟩) + refine ⟨e,?_,fun x => L.apply_zero x,fun x => ?_⟩ + · intro x + apply ContinuousMap.ext; intro t + change (K.trans J) (t,boundary n x) = + ((pathEvaluation (Y := Y)).trans (ContinuousMap.Homotopy.refl pathOne)) (t,H x) + simp only [ContinuousMap.Homotopy.trans_apply] + split_ifs + · exact Cylinder.extension_boundary f B h0 _ x + · exact (hJ _ _ (hs x ▸ h1 x)).trans (hs x) + · change L (1,x) ∈ _ + rw [ContinuousMap.Homotopy.apply_one] + exact (g x).2 +end UniversalFInfinity.Cellular + +end + +end OAI diff --git a/lean/OAI/GroupTheory/UniversalGroup/CellularFillings.lean b/lean/OAI/GroupTheory/UniversalGroup/CellularFillings.lean new file mode 100644 index 0000000000000000000000000000000000000000..61ca16b496f83d4848da5ce16aff112f130d0e42 --- /dev/null +++ b/lean/OAI/GroupTheory/UniversalGroup/CellularFillings.lean @@ -0,0 +1,577 @@ +import OAI.GroupTheory.UniversalGroup.CellularChains + +namespace OAI + +noncomputable section + +open Set Metric Topology BigOperators +open Set Metric Topology +open Set Topology +open Set Metric Topology +open scoped NNReal +open Set Metric Topology +open scoped NNReal ENNReal +open Set Metric Topology +open scoped TensorProduct + +namespace UniversalFInfinity.Cellular + +section +open Set Metric Topology +universe u +variable {G : Type u} [Group G] {X Y : Type u} + [TopologicalSpace X] [T2Space X] [CWComplex (univ : Set X)] + [MulAction G X] [ContinuousConstSMul G X] + [TopologicalSpace Y] [T2Space Y] [CWComplex (univ : Set Y)] + [MulAction G Y] [ContinuousConstSMul G Y] +variable {ι κ : ℕ → Type u} +variable (a : ∀ n, (G × ι n) ≃ RelCWComplex.cell (univ : Set X) n) + (ha : ∀ n (g h : G) (i : ι n) (x : Fin n → ℝ), + RelCWComplex.map n (a n (g*h,i)) x = g • RelCWComplex.map n (a n (h,i)) x) +variable (b : ∀ n, (G × κ n) ≃ RelCWComplex.cell (univ : Set Y) n) + (hb : ∀ n (g h : G) (i : κ n) (x : Fin n → ℝ), + RelCWComplex.map n (b n (g*h,i)) x = g • RelCWComplex.map n (b n (h,i)) x) + +include hb in + +theorem exists_equivariant_cellular_homotopy (d n : ℕ) (hnd : n ≤ d) + (f : C(Skeleton (univ : Set X) n,Y)) + (hf : ∀ (g : G) x, f (skeletonTranslate a ha n g x) = g • f x) : + ∃ e : C(Skeleton (univ : Set X) n,C(unitInterval,Y)), + (∀ (g : G) x, e (skeletonTranslate a ha n g x) = g • e x) ∧ + (∀ x,e x 0 = f x) ∧ ∀ x,e x 1 ∈ Skeleton (univ : Set Y) d := by + induction n with + | zero => + have : IsEmpty (Skeleton (univ : Set X) 0) := by + refine ⟨fun x => ?_⟩ + have hx := x.2 + change x.1 ∈ (CWComplex.skeletonLT (univ : Set X) 0 : Set X) at hx + rw [CWComplex.skeletonLT_zero_eq_empty] at hx + exact hx + exact ⟨⟨isEmptyElim,continuous_of_discreteTopology⟩,fun _ x => isEmptyElim x, + fun x => isEmptyElim x,fun x => isEmptyElim x⟩ + | succ n ih => + obtain ⟨H,hH,hH0,hH1⟩ := ih (Nat.le_of_succ_le hnd) (f.comp (skeletonBase n)) (fun g x => by + change f (skeletonBase n (skeletonTranslate a ha n g x)) = g • f (skeletonBase n x) + rw [←skeletonTranslate_base,hf]) + let H' := pausePaths.comp H + have hH' (g : G) x : H' (skeletonTranslate a ha n g x) = g • H' x := by + change pausePaths (H (skeletonTranslate a ha n g x)) = g • pausePaths (H x) + rw [hH,pausePaths_smul] + have hH'0 (x) : pathZero (H' x) = f (skeletonBase n x) := by + exact (pausePaths_zero (H x)).trans (hH0 x) + have hH'1 (x) : pathOne (H' x) ∈ Skeleton (univ : Set Y) d := by + change pausePaths (H x) 1 ∈ _ + rw [pausePaths_one] + exact hH1 x + have hfill (i : ι n) : ∃ D : C(Disk n,C(unitInterval,Y)), + (∀ x,D (boundary n x) = H' (skeletonBoundary n (a n (1,i)) x)) ∧ + (∀ x,pathZero (D x) = f (skeletonCell n (a n (1,i)) x)) ∧ + ∀ x,pathOne (D x) ∈ Skeleton (univ : Set Y) d := by + apply disk_homotopy_into_skeleton (Nat.lt_of_succ_le hnd) + (f.comp (skeletonCell n (a n (1,i)))) (H.comp (skeletonBoundary n (a n (1,i)))) + · intro x + exact hH0 (skeletonBoundary n (a n (1,i)) x) + · intro x + exact hH1 _ + obtain ⟨e,_,he0,he,he1⟩ := exists_equivariant_skeleton_lift_cells_pred a ha n + pathZero (fun _ _ => rfl) (fun p => pathOne p ∈ Skeleton (univ : Set Y) d) + (fun g p hp => skeleton_smul_mem b hb d g hp) f hf H' hH' hH'1 hfill hH'0 + exact ⟨e,he,he0,he1⟩ +end + +section +open Set Metric Topology +universe u + +def LowFillable (X : Type*) [TopologicalSpace X] (d : ℕ) : Prop := + ∀ n ≤ d, ∀ a : C(Sphere n,X), ∃ e : C(Disk n,X), ∀ x,e (boundary n x) = a x + +lemma pathEndpoint_lift_at {Y : Type*} [TopologicalSpace Y] (n : ℕ) + (hfill : ∀ a : C(Sphere (n+1),Y), ∃ e : C(Disk (n+1),Y), ∀ x,e (boundary (n+1) x) = a x) + (a : C(Sphere n,C(unitInterval,Y))) (b : C(Disk n,Y × Y)) + (h : ∀ x,pathEndpoint (a x) = b (boundary n x)) : + ∃ e : C(Disk n,C(unitInterval,Y)), + (∀ x,e (boundary n x) = a x) ∧ ∀ x,pathEndpoint (e x) = b x := by + obtain ⟨F,hF⟩ := hfill (cylinderBoundaryMap a b h) + obtain ⟨e,he,hp⟩ := cylinder_filling_from_disk (.id Y) a b h F hF + exact ⟨e,fun x => ContinuousMap.ext (he x),hp⟩ + +variable {G : Type u} [Group G] {X Y : Type u} + [TopologicalSpace X] [T2Space X] [CWComplex (univ : Set X)] + [MulAction G X] [ContinuousConstSMul G X] + [TopologicalSpace Y] [MulAction G Y] [ContinuousConstSMul G Y] +variable {ι : ℕ → Type u} +variable (κ : ∀ n, (G × ι n) ≃ RelCWComplex.cell (univ : Set X) n) + (hκ : ∀ n (g h : G) (i : ι n) (x : Fin n → ℝ), + RelCWComplex.map n (κ n (g*h,i)) x = g • RelCWComplex.map n (κ n (h,i)) x) + +lemma equivariant_low_homotopy (d : ℕ) (hfill : LowFillable Y d) + (a b : C(Skeleton (univ : Set X) d,Y)) + (ha : ∀ (g : G) x,a (skeletonTranslate κ hκ d g x) = g • a x) + (hb : ∀ (g : G) x,b (skeletonTranslate κ hκ d g x) = g • b x) : + ∃ H : C(Skeleton (univ : Set X) d,C(unitInterval,Y)), + (∀ x,pathEndpoint (H x) = (a x,b x)) ∧ + ∀ (g : G) x,H (skeletonTranslate κ hκ d g x) = g • H x := by + induction d with + | zero => + let := isEmpty_skeleton_zero (X := X) + exact ⟨⟨isEmptyElim,continuous_of_discreteTopology⟩,fun x => isEmptyElim x,fun _ x => isEmptyElim x⟩ + | succ d ih => + obtain ⟨H,hH,hHe⟩ := ih (fun n hn => hfill n (hn.trans (Nat.le_succ d))) + (a.comp (skeletonBase d)) (b.comp (skeletonBase d)) + (fun g x => by change a (skeletonBase d (skeletonTranslate κ hκ d g x)) = g • a (skeletonBase d x); rw [←skeletonTranslate_base,ha]) + (fun g x => by change b (skeletonBase d (skeletonTranslate κ hκ d g x)) = g • b (skeletonBase d x); rw [←skeletonTranslate_base,hb]) + obtain ⟨e,_,he,hee⟩ := exists_equivariant_skeleton_lift_cells κ hκ d pathEndpoint + (fun _ _ => rfl) (a.prodMk b) (fun g x => Prod.ext (ha g x) (hb g x)) H hHe + (fun i => pathEndpoint_lift_at d (hfill (d+1) le_rfl) + (H.comp (skeletonBoundary d (κ d (1,i)))) + ((a.prodMk b).comp (skeletonCell d (κ d (1,i)))) + (fun x => hH (skeletonBoundary d (κ d (1,i)) x))) hH + exact ⟨e,he,hee⟩ +end + +section +open Set Metric Topology +universe u +variable {G : Type u} [Group G] {X Y : Type u} + [TopologicalSpace X] [T2Space X] [CWComplex (univ : Set X)] + [MulAction G X] [ContinuousConstSMul G X] + [TopologicalSpace Y] [T2Space Y] [CWComplex (univ : Set Y)] + [MulAction G Y] [ContinuousConstSMul G Y] +variable {ι κ : ℕ → Type u} +variable (α : ∀ n, (G × ι n) ≃ RelCWComplex.cell (univ : Set X) n) + (hα : ∀ n (g h : G) (i : ι n) (x : Fin n → ℝ), + RelCWComplex.map n (α n (g*h,i)) x = g • RelCWComplex.map n (α n (h,i)) x) +variable (β : ∀ n, (G × κ n) ≃ RelCWComplex.cell (univ : Set Y) n) + (hβ : ∀ n (g h : G) (i : κ n) (x : Fin n → ℝ), + RelCWComplex.map n (β n (g*h,i)) x = g • RelCWComplex.map n (β n (h,i)) x) +variable (n : ℕ) (q : C(Skeleton (univ : Set X) (n+1),Skeleton (univ : Set Y) (n+1))) + (r : C(Skeleton (univ : Set Y) (n+1),X)) +variable (H : C(Skeleton (univ : Set X) n,C(unitInterval,X))) + (hH : ∀ x,pathEndpoint (H x) = ((skeletonBase n x).1,r (q (skeletonBase n x)))) + +def brownObstructions : κ (n+1) ⊕ ι n → C(Sphere (n+1),X) := + Sum.elim (skeletonObstructions β (n+1) r) + (homotopyObstructions α n (skeletonInclusion (n+1)) (r.comp q) H hH) + +abbrev BrownAttachment := Attachment.Space (Attachment.equivariantFamily (G := G) + (brownObstructions α β n q r H hH)) + +def brownBase : C(X,BrownAttachment α β n q r H hH) := + ⟨Attachment.base _,Attachment.continuous_base _⟩ + +include hβ in +lemma brown_map_extension + (hr : ∀ (g : G) x,r (skeletonTranslate β hβ (n+1) g x) = g • r x) : + ∃ e : C(Skeleton (univ : Set Y) (n+2),BrownAttachment α β n q r H hH), + (∀ x,e (skeletonBase (n+1) x) = brownBase α β n q r H hH (r x)) ∧ + ∀ (g : G) x,e (skeletonTranslate β hβ (n+2) g x) = g • e x := by + apply exists_equivariant_skeleton_extension_cells β hβ (n+1) + ((brownBase α β n q r H hH).comp r) + · intro g x + change Attachment.base _ (r (skeletonTranslate β hβ (n+1) g x)) = _ + rw [hr]; rfl + · intro i + obtain ⟨D,hD⟩ := Attachment.representative_filling (G := G) + (brownObstructions α β n q r H hH) (Sum.inl i) + exact ⟨D,hD⟩ + +include hα hβ in +lemma brown_homotopy_extension + (hq : ∀ (g : G) x,q (skeletonTranslate α hα (n+1) g x) = skeletonTranslate β hβ (n+1) g (q x)) + (hr : ∀ (g : G) x,r (skeletonTranslate β hβ (n+1) g x) = g • r x) + (hHe : ∀ (g : G) x,H (skeletonTranslate α hα n g x) = g • H x) : + ∃ J : C(Skeleton (univ : Set X) (n+1),C(unitInterval,BrownAttachment α β n q r H hH)), + (∀ x,pathEndpoint (J x) = + (brownBase α β n q r H hH x.1,brownBase α β n q r H hH (r (q x)))) ∧ + ∀ (g : G) x,J (skeletonTranslate α hα (n+1) g x) = g • J x := by + let b := brownBase α β n q r H hH + let F := (b.comp (skeletonInclusion (n+1))).prodMk (b.comp (r.comp q)) + let L := (postPath b).comp H + have hb (g : G) (x : X) : b (g • x) = g • b x := rfl + have hF (g : G) x : F (skeletonTranslate α hα (n+1) g x) = g • F x := by + apply Prod.ext + · exact hb g x.1 + · change b (r (q (skeletonTranslate α hα (n+1) g x))) = g • b (r (q x)) + rw [hq,hr,hb] + have hL (g : G) x : L (skeletonTranslate α hα n g x) = g • L x := by + apply ContinuousMap.ext; intro t + change b (H (skeletonTranslate α hα n g x) t) = g • b (H x t) + rw [hHe]; rfl + have hc (i : ι n) : ∃ e : C(Disk n,C(unitInterval,BrownAttachment α β n q r H hH)), + (∀ x,e (boundary n x) = L (skeletonBoundary n (α n (1,i)) x)) ∧ + ∀ x,pathEndpoint (e x) = F (skeletonCell n (α n (1,i)) x) := by + obtain ⟨D,hD⟩ := Attachment.representative_filling (G := G) + (brownObstructions α β n q r H hH) (Sum.inr i) + obtain ⟨e,he,hp⟩ := cylinder_filling_from_disk b + (H.comp (skeletonBoundary n (α n (1,i)))) + (((skeletonInclusion (n+1)).prodMk (r.comp q)).comp (skeletonCell n (α n (1,i)))) + (fun x => hH (skeletonBoundary n (α n (1,i)) x)) D hD + exact ⟨e,fun x => ContinuousMap.ext (he x),hp⟩ + have hL0 (x) : pathEndpoint (L x) = F (skeletonBase n x) := + Prod.ext (congrArg b (congrArg Prod.fst (hH x))) + (congrArg b (congrArg Prod.snd (hH x))) + obtain ⟨J,_,hJ,hJe⟩ := exists_equivariant_skeleton_lift_cells α hα n pathEndpoint + (fun _ _ => rfl) F hF L hL hc hL0 + exact ⟨J,hJ,hJe⟩ +end + +open Set Metric Topology +universe u v w +variable {X : Type u} {Y : Type v} {W : Type w} + [TopologicalSpace X] [TopologicalSpace Y] [T2Space Y] [CWComplex (univ : Set Y)] + [TopologicalSpace W] + +lemma fill_through_next_skeleton (d : ℕ) (q : C(X,Skeleton (univ : Set Y) d)) + (e : C(Skeleton (univ : Set Y) (d+1),W)) + (hq : ((skeletonInclusion d).comp q).Nullhomotopic) + {m : ℕ} (hm : m ≤ d) [Nonempty (Sphere m)] (a : C(Sphere m,X)) : + SphereTopology.Extends ((e.comp ((skeletonBase d).comp q)).comp a) := by + obtain ⟨z,⟨H⟩⟩ := hq + obtain ⟨F,hF⟩ := SphereTopology.extends_of_nullhomotopic (H.compContinuousMap a).symm + obtain ⟨b,J,hstat⟩ := exists_cellular_approximation (d+1) F (fun _ => mem_univ _) + ((Attachment.dimH_disk_subtype_le m).trans_lt (by exact_mod_cast Nat.lt_succ_of_le hm)) + refine ⟨e.comp b,?_⟩ + ext x + apply congrArg e + apply Subtype.ext + have hFx : F (boundary m x) = (q (a x)).1 := ContinuousMap.congr_fun hF x + have hx : F (boundary m x) ∈ Skeleton (univ : Set Y) (d+1) := by + rw [hFx] + exact (skeletonBase d (q (a x))).2 + have h := hstat 1 (boundary m x) hx + exact (J.apply_one (boundary m x)).symm.trans h |>.trans hFx + +lemma filling_after_skeletal_domination (d : ℕ) + (q : C(X,Skeleton (univ : Set Y) d)) (e : C(Skeleton (univ : Set Y) (d+1),W)) + (hq : ((skeletonInclusion d).comp q).Nullhomotopic) + (b : C(X,W)) (H : b.Homotopy (e.comp ((skeletonBase d).comp q))) + {m : ℕ} (hm : m ≤ d) [Nonempty (Sphere m)] (a : C(Sphere m,X)) : + SphereTopology.Extends (b.comp a) := + SphereTopology.extends_of_homotopy (H.compContinuousMap a) + (fill_through_next_skeleton d q e hq hm a) +end UniversalFInfinity.Cellular + +namespace UniversalFInfinity.Attachment +open Set Metric Topology Cellular +variable {G : Type*} [Group G] {X : Type*} [TopologicalSpace X] + [MulAction G X] [ContinuousConstSMul G X] [Nonempty X] +variable {ι : Type*} {d : ℕ} (a : ι → C(Sphere d,X)) +variable [T2Space (Space (equivariantFamily (G := G) a))] + +lemma lowFillable_of_kills_old + (hkill : ∀ m ≤ d, ∀ s : C(Sphere m,X), + SphereTopology.Extends ((⟨base (equivariantFamily (G := G) a),continuous_base _⟩ : + C(X,Space (equivariantFamily (G := G) a))).comp s)) : + LowFillable (Space (equivariantFamily (G := G) a)) d := by + intro m hm s + cases m with + | zero => + let : Nonempty (Space (equivariantFamily (G := G) a)) := ⟨base _ (Classical.choice ‹Nonempty X›)⟩ + exact SphereTopology.fill_zero s + | succ m => + let := SphereTopology.sphere_nonempty m + have hdim : dimH (Set.univ : Set (Sphere (m+1))) < d := + (GeneralPosition.dimH_cube_boundary_subtype_le m).trans_lt (by exact_mod_cast Nat.lt_of_succ_le hm) + obtain ⟨s',H,_⟩ := exists_deformation_into_base (equivariantFamily (G := G) a) s hdim + obtain ⟨F,hF⟩ := SphereTopology.extends_of_homotopy H (hkill (m+1) hm s') + exact ⟨F,fun x => ContinuousMap.congr_fun hF x⟩ +end UniversalFInfinity.Attachment + +namespace UniversalFInfinity.Cellular + +section +open Set Metric Topology +universe u +variable {G : Type u} [Group G] {X Y : Type u} + [TopologicalSpace X] [T2Space X] [CWComplex (univ : Set X)] + [MulAction G X] [ContinuousConstSMul G X] + [TopologicalSpace Y] [T2Space Y] [CWComplex (univ : Set Y)] + [MulAction G Y] [ContinuousConstSMul G Y] +variable {ι κ : ℕ → Type u} +variable (α : ∀ n, (G × ι n) ≃ RelCWComplex.cell (univ : Set X) n) + (hα : ∀ n (g h : G) (i : ι n) (x : Fin n → ℝ), + RelCWComplex.map n (α n (g*h,i)) x = g • RelCWComplex.map n (α n (h,i)) x) +variable (β : ∀ n, (G × κ n) ≃ RelCWComplex.cell (univ : Set Y) n) + (hβ : ∀ n (g h : G) (i : κ n) (x : Fin n → ℝ), + RelCWComplex.map n (β n (g*h,i)) x = g • RelCWComplex.map n (β n (h,i)) x) +variable (n : ℕ) (q : C(Skeleton (univ : Set X) (n+1),Skeleton (univ : Set Y) (n+1))) + (r : C(Skeleton (univ : Set Y) (n+1),X)) +variable (H : C(Skeleton (univ : Set X) n,C(unitInterval,X))) + (hH : ∀ x,pathEndpoint (H x) = ((skeletonBase n x).1,r (q (skeletonBase n x)))) + +include hα hβ in +lemma brown_lowFillable [Nonempty X] [T2Space (BrownAttachment α β n q r H hH)] + (hdim : Skeleton (univ : Set X) (n+1) = univ) + (hqnull : ((skeletonInclusion (n+1)).comp q).Nullhomotopic) + (hq : ∀ (g : G) x,q (skeletonTranslate α hα (n+1) g x) = skeletonTranslate β hβ (n+1) g (q x)) + (hr : ∀ (g : G) x,r (skeletonTranslate β hβ (n+1) g x) = g • r x) + (hHe : ∀ (g : G) x,H (skeletonTranslate α hα n g x) = g • H x) : + LowFillable (BrownAttachment α β n q r H hH) (n+1) := by + obtain ⟨e,he,_⟩ := brown_map_extension α β hβ n q r H hH hr + obtain ⟨J,hJ,_⟩ := brown_homotopy_extension α hα β hβ n q r H hH hq hr hHe + let back : C(X,Skeleton (univ : Set X) (n+1)) := + ⟨fun x => ⟨x,by rw [hdim]; trivial⟩,continuous_id.subtype_mk (fun x => by rw [hdim]; trivial)⟩ + let q' := q.comp back + let b := brownBase α β n q r H hH + have hnull : ((skeletonInclusion (n+1)).comp q').Nullhomotopic := by + obtain ⟨z,⟨K⟩⟩ := hqnull + exact ⟨z,⟨K.compContinuousMap back⟩⟩ + let K : b.Homotopy (e.comp ((skeletonBase (n+1)).comp q')) := + { toFun := fun z => J (back z.2) z.1 + continuous_toFun := (J.continuous.comp (back.continuous.comp continuous_snd)).eval continuous_fst + map_zero_left := fun x => congrArg Prod.fst (hJ (back x)) + map_one_left := fun x => (congrArg Prod.snd (hJ (back x))).trans (he (q (back x))).symm } + apply Attachment.lowFillable_of_kills_old (G := G) (brownObstructions α β n q r H hH) + intro m hm a + cases m with + | zero => + let : Nonempty (BrownAttachment α β n q r H hH) := ⟨b (Classical.choice ‹Nonempty X›)⟩ + obtain ⟨F,hF⟩ := SphereTopology.fill_zero (b.comp a) + exact ⟨F,ContinuousMap.ext hF⟩ + | succ m => + let := SphereTopology.sphere_nonempty m + exact filling_after_skeletal_domination (n+1) q' e hnull b K hm a +end + +section +open Set Metric Topology +universe u +variable {G : Type u} [Group G] +local instance (priority := 2000) (α : Type*) : DecidableEq (ℕ × α) := Classical.decEq _ +variable {X : Type u} [TopologicalSpace X] [T2Space X] [CWComplex (univ : Set X)] + [MulAction G X] [ContinuousConstSMul G X] +variable {ι : ℕ → Type u} [∀ m,Finite (ι m)] +variable (α : ∀ n, (G × ι n) ≃ RelCWComplex.cell (univ : Set X) n) + (hα : ∀ n (g h : G) (i : ι n) (x : Fin n → ℝ), + RelCWComplex.map n (α n (g*h,i)) x = g • RelCWComplex.map n (α n (h,i)) x) + +lemma controlled_map_on_skeleton (d : ℕ) (e : C(Skeleton (univ : Set X) d,Milnor.Space G)) + (he : ∀ (g : G) x,e (skeletonTranslate α hα d g x) = g • e x) : + ∃ S : Milnor.Shapes G, Set.range e ⊆ Set.range (Milnor.stageFull G S) := by + obtain ⟨K,hK,hcov⟩ := skeleton_compact_representatives α hα d + obtain ⟨S,hS⟩ := Milnor.compact_orbit_controlled G (hK.image e.continuous) + refine ⟨S,?_⟩ + rintro _ ⟨x,rfl⟩ + obtain ⟨g,y,hy,rfl⟩ := hcov x + rw [he] + exact hS g ⟨e y,⟨y,hy,rfl⟩,rfl⟩ + +lemma exists_brown_data + (hunif : ∀ S : Milnor.Shapes G, ∃ (T : Milnor.Shapes G) (hST : S ⊆ T), + (Milnor.stageIncl G S T hST).Nullhomotopic) + (n : ℕ) (hfill : LowFillable X n) : + ∃ T : Milnor.Shapes G, + letI cw := Milnor.stageEquivariantCW G T + let β : ∀ m, (G × Milnor.CellOrbits G T m) ≃ cw.cell m := fun _ => Equiv.refl _ + let hβ : ∀ m (g h : G) (i : Milnor.CellOrbits G T m) (x : Fin m → ℝ), + cw.map m (β m (g*h,i)) x = g • cw.map m (β m (h,i)) x := fun _ g h _ _ => mul_smul g h _ + ∃ (q : C(Skeleton (univ : Set X) (n+1),Skeleton (univ : Set (Milnor.Stage G T)) (n+1))) + (r : C(Skeleton (univ : Set (Milnor.Stage G T)) (n+1),X)) + (H : C(Skeleton (univ : Set X) n,C(unitInterval,X))), + ((skeletonInclusion (n+1)).comp q).Nullhomotopic ∧ + (∀ (g : G) x,q (skeletonTranslate α hα (n+1) g x) = skeletonTranslate β hβ (n+1) g (q x)) ∧ + (∀ (g : G) x,r (skeletonTranslate β hβ (n+1) g x) = g • r x) ∧ + (∀ x,pathEndpoint (H x) = ((skeletonBase n x).1,r (q (skeletonBase n x)))) ∧ + ∀ (g : G) x,H (skeletonTranslate α hα n g x) = g • H x := by + obtain ⟨e,he⟩ := exists_equivariant_map_on_skeleton α hα (n+1) + (fun m _ => Milnor.sphereFillable (1:G) m) + obtain ⟨S,hS⟩ := controlled_map_on_skeleton α hα (n+1) e he + let eS := Milnor.factorStage G e S hS + have heS (g : G) x : eS (skeletonTranslate α hα (n+1) g x) = g • eS x := by + apply (Milnor.stageFull_embedding G S).injective + rw [Milnor.factorStage_spec,Milnor.stageFull_smul,Milnor.factorStage_spec,he] + obtain ⟨T,hST,z,⟨K⟩⟩ := hunif S + let : CWComplex (univ : Set (Milnor.Stage G T)) := Milnor.stageEquivariantCW G T + let β : ∀ m, (G × Milnor.CellOrbits G T m) ≃ RelCWComplex.cell (univ : Set (Milnor.Stage G T)) m := + fun _ => Equiv.refl _ + have hβ : ∀ m (g h : G) (i : Milnor.CellOrbits G T m) (x : Fin m → ℝ), + RelCWComplex.map m (β m (g*h,i)) x = g • RelCWComplex.map m (β m (h,i)) x := + fun _ g h _ _ => mul_smul g h _ + let f := (Milnor.stageIncl G S T hST).comp eS + have hf (g : G) x : f (skeletonTranslate α hα (n+1) g x) = g • f x := by + change Milnor.stageIncl G S T hST (eS _) = _ + rw [heS,Milnor.stageIncl_smul] + rfl + obtain ⟨J,hJe,hJ0,hJ1⟩ := exists_equivariant_cellular_homotopy α hα β hβ (n+1) (n+1) le_rfl f hf + let q : C(Skeleton (univ : Set X) (n+1),Skeleton (univ : Set (Milnor.Stage G T)) (n+1)) := + ⟨fun x => ⟨J x 1,hJ1 x⟩,(J.continuous.eval_const _).subtype_mk _⟩ + have hq (g : G) x : q (skeletonTranslate α hα (n+1) g x) = skeletonTranslate β hβ (n+1) g (q x) := by + apply Subtype.ext + exact ContinuousMap.congr_fun (hJe g x) 1 + let J' : f.Homotopy ((skeletonInclusion (n+1)).comp q) := + { toFun := fun z => J z.2 z.1 + continuous_toFun := (J.continuous.comp continuous_snd).eval continuous_fst + map_zero_left := hJ0 + map_one_left := fun _ => rfl } + have hqnull : ((skeletonInclusion (n+1)).comp q).Nullhomotopic := + ⟨z,⟨J'.symm.trans (K.compContinuousMap eS)⟩⟩ + obtain ⟨r,hr⟩ := exists_equivariant_map_on_skeleton β hβ (n+1) + (fun m hm => hfill m (Nat.le_of_lt_succ hm)) + let a := skeletonInclusion (C := (univ : Set X)) n + let b := r.comp (q.comp (skeletonBase n)) + have ha (g : G) x : a (skeletonTranslate α hα n g x) = g • a x := rfl + have hb (g : G) x : b (skeletonTranslate α hα n g x) = g • b x := by + change r (q (skeletonBase n (skeletonTranslate α hα n g x))) = _ + rw [←skeletonTranslate_base,hq,hr] + rfl + obtain ⟨H,hH,hHe⟩ := equivariant_low_homotopy α hα n hfill a b ha hb + exact ⟨T,q,r,H,hqnull,hq,hr,hH,hHe⟩ +end + +open Set Metric Topology +universe u +variable {G : Type u} [Group G] +local instance (priority := 2000) (α : Type*) : DecidableEq (ℕ × α) := Classical.decEq _ +variable {X : Type u} [TopologicalSpace X] [T2Space X] [CWComplex (univ : Set X)] + [MulAction G X] [ContinuousConstSMul G X] [Nonempty X] +variable {ι : ℕ → Type u} [∀ m,Finite (ι m)] +variable (α : ∀ n, (G × ι n) ≃ RelCWComplex.cell (univ : Set X) n) + (hα : ∀ n (g h : G) (i : ι n) (x : Fin n → ℝ), + RelCWComplex.map n (α n (g*h,i)) x = g • RelCWComplex.map n (α n (h,i)) x) + +omit [MulAction G X] [ContinuousConstSMul G X] [Nonempty X] in +lemma skeleton_eq_univ_of_dimension (n : ℕ) + (hdim : ∀ m (_ : RelCWComplex.cell (univ : Set X) m),m ≤ n) : + Skeleton (univ : Set X) (n+1) = univ := by + apply Set.eq_univ_of_forall + intro x + have hx : x ∈ (univ : Set X) := trivial + rw [←CWComplex.union (C := (univ : Set X))] at hx + simp only [Set.mem_iUnion] at hx + obtain ⟨m,i,y,hy,rfl⟩ := hx + exact characteristic_mem_skeleton (Nat.lt_succ_of_le (hdim m i)) i ⟨y,hy⟩ + +include hα in +lemma exists_finite_brown_attachment + (hunif : ∀ S : Milnor.Shapes G, ∃ (T : Milnor.Shapes G) (hST : S ⊆ T), + (Milnor.stageIncl G S T hST).Nullhomotopic) + (n : ℕ) (hfill : LowFillable X n) + (hdim : ∀ m (_ : RelCWComplex.cell (univ : Set X) m),m ≤ n) + (hsep : Attachment.RealSeparated X) : + ∃ (I : Type u) (_ : Finite I) (a : I → C(Sphere (n+1),X)), + LowFillable (Attachment.Space (Attachment.equivariantFamily (G := G) a)) (n+1) := by + obtain ⟨T,q,r,H,hqnull,hq,hr,hH,hHe⟩ := exists_brown_data α hα hunif n hfill + let cw := Milnor.stageEquivariantCW G T + let β : ∀ m,(G × Milnor.CellOrbits G T m) ≃ cw.cell m := fun _ => Equiv.refl _ + have hβ : ∀ m (g h : G) (i : Milnor.CellOrbits G T m) (x : Fin m → ℝ), + cw.map m (β m (g*h,i)) x = g • cw.map m (β m (h,i)) x := fun _ g h _ _ => mul_smul g h _ + let a := brownObstructions α β n q r H hH + let := Attachment.t2Space (Attachment.equivariantFamily (G := G) a) hsep + exact ⟨_,inferInstance,a,brown_lowFillable α hα β hβ n q r H hH + (skeleton_eq_univ_of_dimension n hdim) hqnull hq hr hHe⟩ +end UniversalFInfinity.Cellular + +namespace UniversalFInfinity.Attachment +open Set Metric Topology Cellular +universe u +variable {G : Type u} [Group G] {X : Type u} [TopologicalSpace X] [T2Space X] [Nonempty X] + [CWComplex (univ : Set X)] [MulAction G X] [ContinuousConstSMul G X] +variable {ι : ℕ → Type u} (α : ∀ m,(G × ι m) ≃ OldCell (X := X) m) + (hα : ∀ m (g h : G) (i : ι m) (x : Fin m → ℝ), + RelCWComplex.map m (α m (g*h,i)) x = g • RelCWComplex.map m (α m (h,i)) x) +variable {I : Type u} {n : ℕ} (a : I → C(Sphere n,X)) + +abbrev LayerOrbits (m : ℕ) := ι m ⊕ CellIndex.{u,u} m n I + +def layerEquiv (m : ℕ) : (G × LayerOrbits (ι := ι) (I := I) (n := n) m) ≃ + LayerCell (X := X) (ι := FreeIndex G I) (n := n) m where + toFun p := match p.2 with + | Sum.inl i => Sum.inl (α m (p.1,i)) + | Sum.inr i => Sum.inr ⟨⟨i.down.1,(p.1,i.down.2)⟩⟩ + invFun p := match p with + | Sum.inl i => (((α m).symm i).1,Sum.inl (((α m).symm i).2)) + | Sum.inr i => (i.down.2.1,Sum.inr ⟨⟨i.down.1,i.down.2.2⟩⟩) + left_inv := by rintro ⟨g,i⟩; cases i <;> simp + right_inv := by + intro cell + cases cell with + | inl cell => simp + | inr cell => + obtain ⟨⟨dimension,group,index⟩⟩ := cell + rfl + +omit [T2Space X] in +include hα in +lemma layerEquiv_map_disk (m : ℕ) (g h : G) (i : LayerOrbits (ι := ι) (I := I) (n := n) m) + (x : Fin m → ℝ) (hx : x ∈ closedBall 0 1) : + layerMap (equivariantFamily (G := G) a) m (layerEquiv α m (g*h,i)) x = + g • layerMap (equivariantFamily (G := G) a) m (layerEquiv α m (h,i)) x := by + cases i with + | inl i => + change base _ (RelCWComplex.map m (α m (g*h,i)) x) = g • base _ (RelCWComplex.map m (α m (h,i)) x) + rw [hα]; rfl + | inr i => + obtain ⟨⟨⟨hm⟩,i⟩⟩ := i + subst m + change characteristic (equivariantFamily (G := G) a) (g*h,i) x = + g • characteristic (equivariantFamily (G := G) a) (h,i) x + exact (characteristic_disk _ (g*h,i) ⟨x,hx⟩).trans + ((smul_cell _ (equivariantFamily_smul a) g (h,i) ⟨x,hx⟩).symm.trans + (congrArg (g • ·) (characteristic_disk _ (h,i) ⟨x,hx⟩).symm)) + +variable (hdim : ∀ m (_ : OldCell (X := X) m),m < n) + +omit [T2Space X] in +include hα in +lemma layerEquiv_image (m : ℕ) (g : G) (i : LayerOrbits (ι := ι) (I := I) (n := n) m) + (A : Set (Fin m → ℝ)) (hA : A ⊆ closedBall 0 1) : + (fun z => g • z) '' (layerMap (equivariantFamily (G := G) a) m (layerEquiv α m (1,i)) '' A) = + layerMap (equivariantFamily (G := G) a) m (layerEquiv α m (g,i)) '' A := by + rw [←Set.image_comp] + apply Set.image_congr + intro x hx + have h := layerEquiv_map_disk α hα a m g 1 i x (hA hx) + simpa only [mul_one,Function.comp_apply] using h.symm + +variable [T2Space (Space (equivariantFamily (G := G) a))] + +@[instance_reducible] +def equivariantLayerCW : CWComplex (univ : Set (Space (equivariantFamily (G := G) a))) := by + let := layerCW (equivariantFamily (G := G) a) hdim + exact actionCW (layerEquiv α) + (fun m g i => layerEquiv_image α hα a m g i _ ball_subset_closedBall) + (fun m g i => layerEquiv_image α hα a m g i _ subset_rfl) + +lemma equivariantLayerCW_dims (m : ℕ) (i : (equivariantLayerCW α hα a hdim).cell m) : m < n+1 := + layerCW_dimensions (equivariantFamily (G := G) a) hdim m (layerEquiv α m i) + +lemma equivariantLayerCW_smul (m : ℕ) (g h : G) + (i : LayerOrbits (ι := ι) (I := I) (n := n) m) (x : Fin m → ℝ) : + (equivariantLayerCW α hα a hdim).map m (g*h,i) x = + g • (equivariantLayerCW α hα a hdim).map m (h,i) x := by + change (g*h) • layerMap (equivariantFamily (G := G) a) m (layerEquiv α m (1,i)) x = + g • (h • layerMap (equivariantFamily (G := G) a) m (layerEquiv α m (1,i)) x) + exact mul_smul _ _ _ + +def layerOld (m : ℕ) (i : OldCell (X := X) m) : + (equivariantLayerCW α hα a hdim).cell m := + (((α m).symm i).1,Sum.inl ((α m).symm i).2) + +lemma layerOld_injective (m : ℕ) : Function.Injective (layerOld α hα a hdim m) := by + intro i j h + apply (α m).symm.injective + have h1 := congrArg Prod.fst h + have h2 := Sum.inl_injective (congrArg Prod.snd h) + exact Prod.ext h1 h2 + +lemma layerOld_map (m : ℕ) (i : OldCell (X := X) m) (x : Fin m → ℝ) : + (equivariantLayerCW α hα a hdim).map m (layerOld α hα a hdim m i) x = + base (equivariantFamily (G := G) a) (RelCWComplex.map m i x) := by + change ((α m).symm i).1 • base (equivariantFamily (G := G) a) (RelCWComplex.map m (α m (1,((α m).symm i).2)) x) = _ + change base (equivariantFamily (G := G) a) (((α m).symm i).1 • RelCWComplex.map m (α m (1,((α m).symm i).2)) x) = _ + rw [←hα,mul_one,Equiv.apply_symm_apply] + +lemma layerOld_exhaustive (m : ℕ) (hm : m ≠ n) + (i : (equivariantLayerCW α hα a hdim).cell m) : + ∃ j,layerOld α hα a hdim m j = i := by + obtain ⟨g,i⟩ := i + cases i with + | inl i => exact ⟨α m (g,i),by simp only [layerOld,Equiv.symm_apply_apply]⟩ + | inr i => exact (hm i.down.1.down).elim +end UniversalFInfinity.Attachment + +end + +end OAI diff --git a/lean/OAI/GroupTheory/UniversalGroup/CellularLifting.lean b/lean/OAI/GroupTheory/UniversalGroup/CellularLifting.lean new file mode 100644 index 0000000000000000000000000000000000000000..d799e5e069e0e30e26030f8851f8915b0d831cee --- /dev/null +++ b/lean/OAI/GroupTheory/UniversalGroup/CellularLifting.lean @@ -0,0 +1,568 @@ +import OAI.GroupTheory.UniversalGroup.CompactCells + +namespace OAI + +open Set Metric Topology BigOperators +open Set Metric Topology + + +namespace UniversalFInfinity.Cellular +universe u v w + +abbrev Disk (n : ℕ) := closedBall (0 : Fin n → ℝ) 1 +abbrev Sphere (n : ℕ) := sphere (0 : Fin n → ℝ) 1 + +def boundary (n : ℕ) : Sphere n → Disk n := + fun x => ⟨x.1, sphere_subset_closedBall x.2⟩ + +lemma continuous_boundary (n : ℕ) : Continuous (boundary n) := + continuous_subtype_val.subtype_mk _ + +variable {X : Type u} [TopologicalSpace X] [T2Space X] +variable {C : Set X} [CWComplex C] + +def characteristic (n : ℕ) (i : RelCWComplex.cell C n) : C(Disk n, X) := + ⟨fun x => RelCWComplex.map n i x.1, (RelCWComplex.continuousOn n i).domRestrict⟩ + +omit [T2Space X] in +lemma range_characteristic (n : ℕ) (i : RelCWComplex.cell C n) : + Set.range (characteristic n i) = CWComplex.closedCell n i := by + ext x + constructor + · rintro ⟨y,rfl⟩; exact ⟨y.1,y.2,rfl⟩ + · rintro ⟨y,hy,rfl⟩; exact ⟨⟨y,hy⟩,rfl⟩ + +lemma continuousOn_iff_characteristic {Y : Type v} [TopologicalSpace Y] (f : X → Y) : + ContinuousOn f C ↔ ∀ n (i : RelCWComplex.cell C n), + Continuous (f ∘ characteristic n i) := by + constructor + · intro hf n i + exact hf.comp_continuous (characteristic n i).continuous + (fun x => CWComplex.closedCell_subset_complex n i ⟨x.1,x.2,rfl⟩) + · intro hf + rw [continuousOn_iff_continuous_domRestrict, continuous_iff_isClosed] + intro S hS + have hclosed : IsClosed (C ∩ f ⁻¹' S) := by + apply (CWComplex.closed C _ inter_subset_left).2 + intro n i + have hpre : IsClosed ((f ∘ characteristic n i) ⁻¹' S) := + hS.preimage (hf n i) + have hcompact := hpre.isCompact.image (characteristic n i).continuous + convert hcompact.isClosed using 1 + ext x + constructor + · rintro ⟨⟨hxC,hxS⟩, y,hy,rfl⟩ + exact ⟨⟨y,hy⟩,hxS,rfl⟩ + · rintro ⟨y,hy,rfl⟩ + exact ⟨⟨CWComplex.closedCell_subset_complex n i ⟨y.1,y.2,rfl⟩,hy⟩, + y.1,y.2,rfl⟩ + convert hclosed.preimage continuous_subtype_val using 1 + ext x + simp only [Set.mem_preimage, Set.mem_inter_iff, and_iff_right x.2, Set.domRestrict_apply] + +abbrev Skeleton (C : Set X) [CWComplex C] (n : ℕ) : Set X := + CWComplex.skeletonLT C n + +lemma skeleton_mono {m n : ℕ} (h : m ≤ n) : + Skeleton C m ⊆ Skeleton C n := + CWComplex.skeletonLT_mono (by exact_mod_cast h) + +lemma sphere_mem_skeleton (n : ℕ) (i : RelCWComplex.cell C n) (x : Sphere n) : + characteristic n i (boundary n x) ∈ Skeleton C n := + CWComplex.cellFrontier_subset_skeletonLT n i ⟨x.1,x.2,rfl⟩ + +lemma characteristic_mem_skeleton {m n : ℕ} (h : m < n) + (i : RelCWComplex.cell C m) (x : Disk m) : + characteristic m i x ∈ Skeleton C n := by + apply skeleton_mono (Nat.succ_le_of_lt h) + exact CWComplex.closedCell_subset_skeletonLT m i ⟨x.1,x.2,rfl⟩ + +lemma openCell_not_skeleton (n : ℕ) (i : RelCWComplex.cell C n) {x : X} + (hx : x ∈ CWComplex.openCell n i) : x ∉ Skeleton C n := + (CWComplex.disjoint_skeletonLT_openCell (C := C) (j := i) le_rfl).notMem_of_mem_right hx + +structure PartialLift {E : Type v} {B : Type w} [TopologicalSpace E] [TopologicalSpace B] + (p : C(E,B)) (f : C(X,B)) (n : ℕ) where + val : X → E + continuousOn : ContinuousOn val (Skeleton C n) + fac : ∀ x ∈ Skeleton C n, p (val x) = f x + +def DiskRLP {E : Type v} {B : Type w} [TopologicalSpace E] [TopologicalSpace B] + (p : C(E,B)) : Prop := + ∀ n (a : C(Sphere n,E)) (b : C(Disk n,B)), + (∀ x, p (a x) = b (boundary n x)) → + ∃ e : C(Disk n,E), (∀ x, e (boundary n x) = a x) ∧ ∀ x, p (e x) = b x + +section Attach +variable {E : Type v} [TopologicalSpace E] {n : ℕ} + +noncomputable def attachValue (a : X → E) (e : ∀ _ : RelCWComplex.cell C n, C(Disk n,E)) + (x : X) : E := by + classical + exact if x ∈ Skeleton C n then a x + else if h : ∃ i : RelCWComplex.cell C n, x ∈ CWComplex.openCell n i then + let i := h.choose + let y := h.choose_spec.choose + e i ⟨y,ball_subset_closedBall h.choose_spec.choose_spec.1⟩ + else a x + +lemma attachValue_old (a : X → E) (e : ∀ _ : RelCWComplex.cell C n, C(Disk n,E)) + {x : X} (hx : x ∈ Skeleton C n) : attachValue a e x = a x := by + classical + simp only [attachValue, ite_eq_left hx] + +lemma attachValue_interior (a : X → E) (e : ∀ _ : RelCWComplex.cell C n, C(Disk n,E)) + (i : RelCWComplex.cell C n) (y : Disk n) (hy : y.1 ∈ ball 0 1) : + attachValue a e (characteristic n i y) = e i y := by + classical + have hx : characteristic n i y ∈ CWComplex.openCell n i := ⟨y.1,hy,rfl⟩ + have h : ∃ j : RelCWComplex.cell C n, + characteristic n i y ∈ CWComplex.openCell n j := ⟨i,hx⟩ + rw [attachValue,ite_eq_right (openCell_not_skeleton n i hx),dite_eq_left h] + have hi : h.choose = i := by + by_contra hne + have hd := CWComplex.disjoint_openCell_of_ne (C := C) (i := h.choose) (j := i) + (fun hEq => hne (sigma_mk_injective hEq)) + exact Set.disjoint_left.mp hd h.choose_spec hx + have hz := h.choose_spec.choose_spec.1 + have hmap : RelCWComplex.map n i h.choose_spec.choose = characteristic n i y := by + calc + RelCWComplex.map n i h.choose_spec.choose = + RelCWComplex.map n h.choose h.choose_spec.choose := + congrArg (fun k => RelCWComplex.map n k h.choose_spec.choose) hi.symm + _ = _ := h.choose_spec.choose_spec.2 + have hcoord : h.choose_spec.choose = y.1 := + (RelCWComplex.map n i).injOn + (by simpa only [RelCWComplex.source_eq] using hz) + (by simpa only [RelCWComplex.source_eq] using hy) hmap + exact (congrArg (fun k => e k ⟨h.choose_spec.choose,ball_subset_closedBall hz⟩) hi).trans + (congrArg (e i) (Subtype.ext hcoord)) + +lemma attachValue_characteristic (a : X → E) + (e : ∀ _ : RelCWComplex.cell C n, C(Disk n,E)) + (he : ∀ i (x : Sphere n), e i (boundary n x) = + a (characteristic n i (boundary n x))) + (i : RelCWComplex.cell C n) (y : Disk n) : + attachValue a e (characteristic n i y) = e i y := by + by_cases hy : y.1 ∈ ball 0 1 + · exact attachValue_interior a e i y hy + · have hs : y.1 ∈ sphere 0 1 := le_antisymm y.2 (le_of_not_gt hy) + have hx : characteristic n i y ∈ Skeleton C n := sphere_mem_skeleton n i ⟨y,hs⟩ + rw [attachValue_old a e hx] + exact (he i ⟨y,hs⟩).symm + +lemma attachValue_continuous (a : X → E) (ha : ContinuousOn a (Skeleton C n)) + (e : ∀ _ : RelCWComplex.cell C n, C(Disk n,E)) + (he : ∀ i (x : Sphere n), e i (boundary n x) = + a (characteristic n i (boundary n x))) : + ContinuousOn (attachValue a e) (Skeleton C (n+1)) := by + apply (continuousOn_iff_characteristic (C := Skeleton C (n+1)) _).2 + intro m j + change Continuous (fun x : Disk m => attachValue a e (characteristic m j.1 x)) + have hm : m < n+1 := by + have h : (m : ℕ∞) < ((n+1 : ℕ) : ℕ∞) := by + simpa only [RelCWComplex.skeletonLT_I,Set.mem_ofPred_eq] using j.2 + exact_mod_cast h + rcases Nat.lt_succ_iff_lt_or_eq.mp hm with hm | hm + · have hEq : (fun x : Disk m => attachValue a e (characteristic m j.1 x)) = + (fun x : Disk m => a (characteristic m j.1 x)) := by + funext x + exact attachValue_old a e (characteristic_mem_skeleton hm j.1 x) + rw [hEq] + exact ha.comp_continuous (characteristic m j.1).continuous + (characteristic_mem_skeleton hm j.1) + · subst m + have hEq : (fun x : Disk n => attachValue a e (characteristic n j.1 x)) = e j.1 := by + funext x + exact attachValue_characteristic a e he j.1 x + rw [hEq] + exact (e j.1).continuous + +end Attach + +namespace PartialLift +variable {E : Type v} {B : Type w} [TopologicalSpace E] [TopologicalSpace B] +variable {p : C(E,B)} {f : C(X,B)} {n : ℕ} + +def onSphere (a : PartialLift (C := C) p f n) (i : RelCWComplex.cell C n) : + C(Sphere n,E) := + ⟨fun x => a.val (characteristic n i (boundary n x)), + a.continuousOn.comp_continuous + ((characteristic n i).continuous.comp (continuous_boundary n)) + (sphere_mem_skeleton n i)⟩ + +lemma exists_cell_extension (a : PartialLift (C := C) p f n) (hp : DiskRLP p) + (i : RelCWComplex.cell C n) : + ∃ e : C(Disk n,E), + (∀ x, e (boundary n x) = a.val (characteristic n i (boundary n x))) ∧ + ∀ x, p (e x) = f (characteristic n i x) := by + apply hp n (a.onSphere i) (f.comp (characteristic n i)) + intro x + exact a.fac _ (sphere_mem_skeleton n i x) + +noncomputable def next (a : PartialLift (C := C) p f n) (hp : DiskRLP p) : + PartialLift (C := C) p f (n+1) := by + choose e hb hf using fun i => a.exists_cell_extension hp i + refine ⟨attachValue a.val e,attachValue_continuous a.val a.continuousOn e hb,?_⟩ + intro x hx + have hdecomp : Skeleton C (n+1) = Skeleton C n ∪ + ⋃ i : RelCWComplex.cell C n, CWComplex.closedCell n i := by + simpa only [Skeleton,Nat.cast_add,Nat.cast_one] using + (CWComplex.skeletonLT_union_iUnion_closedCell_eq_skeletonLT_succ (C := C) n).symm + rw [hdecomp] at hx + rcases hx with hx | hx + · rw [attachValue_old a.val e hx] + exact a.fac x hx + · obtain ⟨i,y,hy,rfl⟩ := Set.mem_iUnion.mp hx + rw [show RelCWComplex.map n i y = characteristic n i ⟨y,hy⟩ from rfl, + attachValue_characteristic a.val e hb] + exact hf i ⟨y,hy⟩ + +lemma next_eq (a : PartialLift (C := C) p f n) (hp : DiskRLP p) + {x : X} (hx : x ∈ Skeleton C n) : (a.next hp).val x = a.val x := by + dsimp only [next] + exact attachValue_old a.val _ hx + +noncomputable def zero [Nonempty E] : PartialLift (C := C) p f 0 where + val := fun _ => Classical.choice ‹Nonempty E› + continuousOn := continuous_const.continuousOn + fac := by + intro x hx + simp only [Skeleton,Nat.cast_zero,CWComplex.skeletonLT_zero_eq_empty,Set.mem_empty_iff_false] at hx + +end PartialLift + +section Lift +variable {E : Type v} {B : Type w} [TopologicalSpace E] [TopologicalSpace B] [Nonempty E] +variable {p : C(E,B)} (hp : DiskRLP p) (f : C(X,B)) + +noncomputable def stages : ∀ n, PartialLift (C := C) p f n + | 0 => PartialLift.zero + | n+1 => (stages n).next hp + +lemma stages_agree {m n : ℕ} (h : m ≤ n) {x : X} (hx : x ∈ Skeleton C m) : + (stages (C := C) hp f n).val x = (stages (C := C) hp f m).val x := by + induction n,h using Nat.le_induction with + | base => rfl + | succ n hn ih => + exact ((stages (C := C) hp f n).next_eq hp (skeleton_mono hn hx)).trans ih + +lemma exists_skeleton {x : X} (hx : x ∈ C) : ∃ n : ℕ, x ∈ Skeleton C n := by + rw [← CWComplex.iUnion_skeletonLT_eq_complex (C := C)] at hx + exact Set.mem_iUnion.mp hx + +noncomputable def liftValue (x : X) : E := by + classical + exact if hx : x ∈ C then (stages (C := C) hp f (exists_skeleton (C := C) hx).choose).val x + else Classical.choice ‹Nonempty E› + +lemma liftValue_eq {n : ℕ} {x : X} (hx : x ∈ Skeleton C n) : + liftValue (C := C) hp f x = (stages (C := C) hp f n).val x := by + classical + have hxC : x ∈ C := (CWComplex.skeletonLT C n).subset_complex hx + rw [liftValue,dite_eq_left hxC] + let m := (exists_skeleton (C := C) hxC).choose + have hm : x ∈ Skeleton C m := (exists_skeleton (C := C) hxC).choose_spec + exact (stages_agree hp f (Nat.le_max_left m n) hm).symm.trans + (stages_agree hp f (Nat.le_max_right m n) hx) + +lemma continuousOn_liftValue : ContinuousOn (liftValue (C := C) hp f) C := by + apply (continuousOn_iff_characteristic _).2 + intro n i + have hEq : liftValue (C := C) hp f ∘ characteristic n i = + (stages (C := C) hp f (n+1)).val ∘ characteristic n i := by + funext x + exact liftValue_eq hp f (characteristic_mem_skeleton (Nat.lt_succ_self n) i x) + rw [hEq] + exact (stages (C := C) hp f (n+1)).continuousOn.comp_continuous (characteristic n i).continuous + (characteristic_mem_skeleton (Nat.lt_succ_self n) i) + +lemma liftValue_fac {x : X} (hx : x ∈ C) : p (liftValue (C := C) hp f x) = f x := by + obtain ⟨n,hn⟩ := exists_skeleton (C := C) hx + rw [liftValue_eq hp f hn] + exact (stages (C := C) hp f n).fac x hn + +include hp in + +theorem exists_lift [CWComplex (Set.univ : Set X)] : + ∃ g : C(X,E), ∀ x, p (g x) = f x := by + refine ⟨⟨liftValue (C := Set.univ) hp f, + continuousOn_univ.mp (continuousOn_liftValue (C := Set.univ) hp f)⟩,?_⟩ + intro x + exact liftValue_fac hp f (Set.mem_univ x) + +end Lift + +noncomputable section + +def SphereFillable (Y : Type u) [TopologicalSpace Y] : Prop := + ∀ n (a : C(Sphere n,Y)), ∃ e : C(Disk n,Y), ∀ x, e (boundary n x) = a x + +lemma disk_coord {n : ℕ} (x : Disk n) (i : Fin n) : |x.1 i| ≤ 1 := by + exact (pi_norm_le_iff_of_nonneg (by norm_num : (0:ℝ) ≤ 1)).mp + (mem_closedBall_zero_iff.mp x.2) i + +lemma disk_mem {n : ℕ} {x : Fin n → ℝ} (h : ∀ i, |x i| ≤ 1) : + x ∈ closedBall 0 1 := by + exact mem_closedBall_zero_iff.mpr + ((pi_norm_le_iff_of_nonneg (by norm_num : (0:ℝ) ≤ 1)).mpr h) + +def diskCons {n : ℕ} (x : Disk n) (t : unitInterval) : Disk (n+1) := + ⟨Fin.cons (2*t.1-1) x.1, disk_mem (by + intro i + refine Fin.cases ?_ (fun j => ?_) i + · simp only [Fin.cons_zero,abs_le] + constructor <;> linarith [t.2.1,t.2.2] + · exact disk_coord x j)⟩ + +lemma continuous_diskCons {n : ℕ} : + Continuous (fun q : Disk n × unitInterval => diskCons q.1 q.2) := by + apply Continuous.subtype_mk + apply continuous_pi + intro i + refine Fin.cases ?_ (fun j => ?_) i + · change Continuous (fun q : Disk n × unitInterval => 2*q.2.1-1) + fun_prop + · change Continuous (fun q : Disk n × unitInterval => q.1.1 j) + exact (continuous_apply j).comp (continuous_subtype_val.comp continuous_fst) + +def diskTail {n : ℕ} (x : Disk (n+1)) : Disk n := + ⟨Fin.tail x.1,disk_mem (fun i => disk_coord x i.succ)⟩ + +lemma continuous_diskTail {n : ℕ} : Continuous (@diskTail n) := by + apply Continuous.subtype_mk + exact continuous_pi (fun i => (continuous_apply i.succ).comp continuous_subtype_val) + +def diskTime {n : ℕ} (x : Disk (n+1)) : unitInterval := + ⟨(x.1 0+1)/2,by have h := (abs_le.mp (disk_coord x 0)); constructor <;> linarith⟩ + +lemma continuous_diskTime {n : ℕ} : Continuous (@diskTime n) := by + exact (((continuous_apply 0).comp continuous_subtype_val).add continuous_const).div_const 2 |>.subtype_mk _ + +@[simp] lemma diskTail_cons {n : ℕ} (x : Disk n) (t : unitInterval) : + diskTail (diskCons x t) = x := by + apply Subtype.ext + simp only [diskTail,diskCons,Fin.tail_cons] + +@[simp] lemma diskTime_cons {n : ℕ} (x : Disk n) (t : unitInterval) : + diskTime (diskCons x t) = t := by + apply Subtype.ext + simp only [diskTime,diskCons,Fin.cons_zero] + ring + +lemma sphere_iff_coord {n : ℕ} (x : Disk n) : + x.1 ∈ sphere 0 1 ↔ ∃ i, |x.1 i| = 1 := by + rw [sphere_pi (0 : Fin n → ℝ) (Or.inl (by norm_num))] + simp only [Set.mem_inter_iff,Set.mem_iUnion,Set.mem_preimage,Function.eval, + Pi.zero_apply,mem_sphere_zero_iff_norm,Real.norm_eq_abs,and_iff_left x.2] + +lemma cons_mem_sphere_of_boundary {n : ℕ} (x : Sphere n) (t : unitInterval) : + (diskCons (boundary n x) t).1 ∈ sphere 0 1 := by + obtain ⟨i,hi⟩ := (sphere_iff_coord (boundary n x)).mp x.2 + exact (sphere_iff_coord _).mpr ⟨i.succ,hi⟩ + +lemma cons_zero_mem_sphere {n : ℕ} (x : Disk n) : + (diskCons x 0).1 ∈ sphere 0 1 := by + apply (sphere_iff_coord _).mpr + exact ⟨0,by norm_num [diskCons]⟩ + +lemma cons_one_mem_sphere {n : ℕ} (x : Disk n) : + (diskCons x 1).1 ∈ sphere 0 1 := by + apply (sphere_iff_coord _).mpr + exact ⟨0,by norm_num [diskCons]⟩ + +lemma sphere_split {n : ℕ} (x : Sphere (n+1)) : + x.1 0 = -1 ∨ x.1 0 = 1 ∨ (diskTail (boundary (n+1) x)).1 ∈ sphere 0 1 := by + obtain ⟨i,hi⟩ := (sphere_iff_coord (boundary (n+1) x)).mp x.2 + refine Fin.cases ?_ (fun i hi => ?_) i hi + · intro h + rcases abs_eq (by norm_num : (0:ℝ) ≤ 1) |>.mp h with h | h + · exact Or.inr (Or.inl h) + · exact Or.inl h + · exact Or.inr (Or.inr ((sphere_iff_coord _).mpr ⟨i,hi⟩)) + +lemma continuous_liftCover {A : Type u} {Y : Type v} {ι : Type w} + [TopologicalSpace A] [TopologicalSpace Y] [Finite ι] + (S : ι → Set A) (f : ∀ i, C(S i,Y)) + (hcompat : ∀ i j x (hi : x ∈ S i) (hj : x ∈ S j), f i ⟨x,hi⟩ = f j ⟨x,hj⟩) + (hcover : ⋃ i, S i = Set.univ) (hclosed : ∀ i, IsClosed (S i)) : + Continuous (Set.liftCover S (fun i => f i) hcompat hcover) := by + rw [continuous_iff_isClosed] + intro D hD + rw [Set.preimage_liftCover] + exact isClosed_iUnion_of_finite fun i => (hclosed i).isClosedMap_subtype_val _ (hD.preimage (f i).continuous) + +def cylinderFace (n : ℕ) : Option Bool → Set (Sphere (n+1)) + | none => {x | (diskTail (boundary (n+1) x)).1 ∈ sphere 0 1} + | some false => {x | x.1 0 = -1} + | some true => {x | x.1 0 = 1} + +lemma cylinderFace_closed (n : ℕ) (i : Option Bool) : IsClosed (cylinderFace n i) := by + cases i with + | none => + exact isClosed_sphere.preimage + (continuous_subtype_val.comp (continuous_diskTail.comp (continuous_boundary (n+1)))) + | some b => + cases b <;> + exact isClosed_eq ((continuous_apply 0).comp continuous_subtype_val) continuous_const + +lemma cylinderFace_cover (n : ℕ) : ⋃ i, cylinderFace n i = Set.univ := by + apply Set.eq_univ_of_forall + intro x + rcases sphere_split x with h | h | h + · exact Set.mem_iUnion.mpr ⟨some false,h⟩ + · exact Set.mem_iUnion.mpr ⟨some true,h⟩ + · exact Set.mem_iUnion.mpr ⟨none,h⟩ + +variable {Y : Type u} [TopologicalSpace Y] + +def pathEndpoint : C(C(unitInterval,Y), Y × Y) := + ⟨fun q => (q 0,q 1), (continuous_eval_const 0).prodMk (continuous_eval_const 1)⟩ + +section CylinderMap +variable {n : ℕ} (a : C(Sphere n,C(unitInterval,Y))) (b : C(Disk n,Y × Y)) + +def faceTail (i : Option Bool) : C(cylinderFace n i,Disk n) := + ⟨fun x => diskTail (boundary (n+1) x.1), + continuous_diskTail.comp ((continuous_boundary (n+1)).comp continuous_subtype_val)⟩ + +def faceSphere : C(cylinderFace n none,Sphere n) := + ⟨fun x => ⟨(faceTail none x).1,x.2⟩, (continuous_subtype_val.comp (faceTail none).continuous).subtype_mk _⟩ + +def faceTime (i : Option Bool) : C(cylinderFace n i,unitInterval) := + ⟨fun x => diskTime (boundary (n+1) x.1), + continuous_diskTime.comp ((continuous_boundary (n+1)).comp continuous_subtype_val)⟩ + +def faceMap : ∀ i : Option Bool, C(cylinderFace n i,Y) + | none => ⟨fun x => a (faceSphere x) (faceTime none x), + continuous_eval.comp ((a.continuous.comp faceSphere.continuous).prodMk (faceTime none).continuous)⟩ + | some false => ⟨fun x => (b (faceTail (some false) x)).1, + continuous_fst.comp (b.continuous.comp (faceTail (some false)).continuous)⟩ + | some true => ⟨fun x => (b (faceTail (some true) x)).2, + continuous_snd.comp (b.continuous.comp (faceTail (some true)).continuous)⟩ + +lemma faceTime_eq_zero (x : Sphere (n+1)) (h : x.1 0 = -1) : + diskTime (boundary (n+1) x) = 0 := by + apply Subtype.ext + change (x.1 0+1)/2 = 0 + rw [h] + norm_num + +lemma faceTime_eq_one (x : Sphere (n+1)) (h : x.1 0 = 1) : + diskTime (boundary (n+1) x) = 1 := by + apply Subtype.ext + change (x.1 0+1)/2 = 1 + rw [h] + norm_num + +variable (h : ∀ x, pathEndpoint (a x) = b (boundary n x)) + +include h in +lemma faceMap_compat (i j : Option Bool) (x : Sphere (n+1)) + (hi : x ∈ cylinderFace n i) (hj : x ∈ cylinderFace n j) : + faceMap a b i ⟨x,hi⟩ = faceMap a b j ⟨x,hj⟩ := by + have left (hs : x ∈ cylinderFace n none) (h0 : x.1 0 = -1) : + faceMap a b none ⟨x,hs⟩ = (b (diskTail (boundary (n+1) x))).1 := by + change a (faceSphere ⟨x,hs⟩) (diskTime (boundary (n+1) x)) = _ + rw [faceTime_eq_zero x h0] + exact congrArg Prod.fst (h (faceSphere ⟨x,hs⟩)) + have right (hs : x ∈ cylinderFace n none) (h1 : x.1 0 = 1) : + faceMap a b none ⟨x,hs⟩ = (b (diskTail (boundary (n+1) x))).2 := by + change a (faceSphere ⟨x,hs⟩) (diskTime (boundary (n+1) x)) = _ + rw [faceTime_eq_one x h1] + exact congrArg Prod.snd (h (faceSphere ⟨x,hs⟩)) + cases i with + | none => + cases j with + | none => rfl + | some c => cases c; exact left hi hj; exact right hi hj + | some c => + cases c + · cases j with + | none => exact (left hj hi).symm + | some d => + cases d + · rfl + · have := hi.symm.trans hj; norm_num at this + · cases j with + | none => exact (right hj hi).symm + | some d => + cases d + · have := hi.symm.trans hj; norm_num at this + · rfl + +def cylinderBoundaryMap : C(Sphere (n+1),Y) := + ⟨Set.liftCover (cylinderFace n) (fun i => faceMap a b i) + (faceMap_compat a b h) (cylinderFace_cover n), + continuous_liftCover _ _ _ _ (cylinderFace_closed n)⟩ + +lemma cylinderBoundaryMap_face (i : Option Bool) (x : cylinderFace n i) : + cylinderBoundaryMap a b h x.1 = faceMap a b i x := + by + apply Set.liftCover_coe (S := cylinderFace n) (f := fun i => faceMap a b i) + (hf := faceMap_compat a b h) (hS := cylinderFace_cover n) + +end CylinderMap + +theorem pathEndpoint_RLP (hY : SphereFillable Y) : DiskRLP (@pathEndpoint Y _) := by + intro n a b h + obtain ⟨F,hF⟩ := hY (n+1) (cylinderBoundaryMap a b h) + let e : C(Disk n,C(unitInterval,Y)) := + (F.comp ⟨fun q : Disk n × unitInterval => diskCons q.1 q.2,continuous_diskCons⟩).curry + refine ⟨e,?_,?_⟩ + · intro x + apply ContinuousMap.ext + intro t + let s : Sphere (n+1) := ⟨_,cons_mem_sphere_of_boundary x t⟩ + have hs : s ∈ cylinderFace n none := by + change (diskTail (diskCons (boundary n x) t)).1 ∈ sphere 0 1 + rw [diskTail_cons] + exact x.2 + change F (diskCons (boundary n x) t) = a x t + rw [show diskCons (boundary n x) t = boundary (n+1) s from rfl,hF, + cylinderBoundaryMap_face a b h none ⟨s,hs⟩] + change a (faceSphere ⟨s,hs⟩) (diskTime (diskCons (boundary n x) t)) = a x t + rw [diskTime_cons] + congr 1 + · intro x + apply Prod.ext + · let s : Sphere (n+1) := ⟨_,cons_zero_mem_sphere x⟩ + have hs : s ∈ cylinderFace n (some false) := by + change (diskCons x 0).1 0 = -1 + norm_num [diskCons] + change F (diskCons x 0) = (b x).1 + rw [show diskCons x 0 = boundary (n+1) s from rfl,hF, + cylinderBoundaryMap_face a b h (some false) ⟨s,hs⟩] + change (b (diskTail (diskCons x 0))).1 = (b x).1 + rw [diskTail_cons] + · let s : Sphere (n+1) := ⟨_,cons_one_mem_sphere x⟩ + have hs : s ∈ cylinderFace n (some true) := by + change (diskCons x 1).1 0 = 1 + norm_num [diskCons] + change F (diskCons x 1) = (b x).2 + rw [show diskCons x 1 = boundary (n+1) s from rfl,hF, + cylinderBoundaryMap_face a b h (some true) ⟨s,hs⟩] + change (b (diskTail (diskCons x 1))).2 = (b x).2 + rw [diskTail_cons] + +theorem contractible_of_sphereFillable {Z : Type u} [TopologicalSpace Z] [T2Space Z] + [Nonempty Z] [CWComplex (Set.univ : Set Z)] (hZ : SphereFillable Z) : + ContractibleSpace Z := by + classical + let z₀ : Z := Classical.choice ‹Nonempty Z› + let : Nonempty C(unitInterval,Z) := ⟨ContinuousMap.const _ z₀⟩ + let f : C(Z,Z × Z) := ⟨fun z => (z,z₀),continuous_id.prodMk continuous_const⟩ + obtain ⟨g,hg⟩ := exists_lift (pathEndpoint_RLP hZ) f + apply (contractible_iff_id_nullhomotopic Z).mpr + refine ⟨z₀,⟨?_⟩⟩ + refine ContinuousMap.Homotopy.mk ⟨fun q => g q.2 q.1, + continuous_eval.comp ((g.continuous.comp continuous_snd).prodMk continuous_fst)⟩ ?_ ?_ + · intro z + exact congrArg Prod.fst (hg z) + · intro z + exact congrArg Prod.snd (hg z) + +end +end UniversalFInfinity.Cellular + +end OAI diff --git a/lean/OAI/GroupTheory/UniversalGroup/CentralHNN.lean b/lean/OAI/GroupTheory/UniversalGroup/CentralHNN.lean new file mode 100644 index 0000000000000000000000000000000000000000..0bd98365931ad9b49cbd3883a395852aa657dc8a --- /dev/null +++ b/lean/OAI/GroupTheory/UniversalGroup/CentralHNN.lean @@ -0,0 +1,234 @@ +import OAI.GroupTheory.UniversalGroup.Model + +namespace OAI + +section UniversalFinitelyPresentedProof +universe u v w x + +namespace Higman +open HNNExtension + +abbrev CentralExtension (G : Type u) [Group G] (A : Subgroup G) := + HNNExtension G A A (MulEquiv.refl A) + +namespace CentralExtension +variable {G : Type u} [Group G] {K : Type v} [Group K] +variable {A : Subgroup G} {B : Subgroup K} + +def map (i : G →* K) (hi : A ≤ B.comap i) : + CentralExtension G A →* CentralExtension K B := + HNNExtension.lift (HNNExtension.of.comp i) HNNExtension.t (by + intro a + exact HNNExtension.t_mul_of (φ := MulEquiv.refl B) ⟨i a, hi a.2⟩) + +@[simp] theorem map_of (i : G →* K) (hi : A ≤ B.comap i) (g : G) : + map i hi (HNNExtension.of g) = HNNExtension.of (i g) := by + exact HNNExtension.lift_of _ _ _ g + +@[simp] theorem map_t (i : G →* K) (hi : A ≤ B.comap i) : + map i hi HNNExtension.t = HNNExtension.t := by + exact HNNExtension.lift_t _ _ _ + +def mapWord (i : G →* K) (hi : B.comap i = A) + (r : NormalWord.ReducedWord G A A) : NormalWord.ReducedWord K B B where + head := i r.head + toList := r.toList.map (fun p ↦ (p.1, i p.2)) + chain := by + apply (List.isChain_map _).mpr + apply r.chain.imp + intro a b hab hmem + apply hab + have hm : i a.2 ∈ B := by + simpa [HNNExtension.toSubgroup] using hmem + have : a.2 ∈ B.comap i := hm + simpa [hi, HNNExtension.toSubgroup] using this + +@[simp] theorem mapWord_prod (i : G →* K) (hi : B.comap i = A) + (r : NormalWord.ReducedWord G A A) : + (mapWord i hi r).prod (MulEquiv.refl B) = + map i (le_of_eq hi.symm) (r.prod (MulEquiv.refl A)) := by + simp [NormalWord.ReducedWord.prod, mapWord, map_list_prod, List.map_map, Function.comp_def] + +theorem map_injective (i : G →* K) (hinj : Function.Injective i) + (hi : B.comap i = A) : Function.Injective (map i (le_of_eq hi.symm)) := by + apply (MonoidHom.ker_eq_bot_iff _).mp + apply le_antisymm _ bot_le + intro g hg + obtain ⟨d⟩ := NormalWord.TransversalPair.nonempty G A A + let r := (NormalWord.equiv (MulEquiv.refl A) d g) + have hr : r.prod (MulEquiv.refl A) = g := + (NormalWord.equiv (MulEquiv.refl A) d).symm_apply_apply g + have hm : (mapWord i hi r.toReducedWord).prod (MulEquiv.refl B) = 1 := by + rw [mapWord_prod] + change map i (le_of_eq hi.symm) (r.prod (MulEquiv.refl A)) = 1 + rw [hr] + exact hg + have hn := HNNExtension.ReducedWord.toList_eq_nil_of_mem_of_range + (MulEquiv.refl B) (mapWord i hi r.toReducedWord) + (by rw [hm]; exact Subgroup.one_mem _) + have hnil : r.toList = [] := by simpa [mapWord] using hn + have hhead : i r.head = 1 := by + apply HNNExtension.of_injective (φ := MulEquiv.refl B) + simpa [mapWord, NormalWord.ReducedWord.prod, hnil] using hm + have hhead' : r.head = 1 := hinj (by simpa using hhead) + rw [Subgroup.mem_bot, ← hr] + simp [NormalWord.ReducedWord.prod, hnil, hhead'] + +open Monoid Coprod Multiplicative + +def relation (g : G) : G ∗ Multiplicative ℤ := + (inr (ofAdd 1) * inl g) * (inl g * inr (ofAdd 1))⁻¹ + +theorem con_finitelyNormallyGenerated (hA : A.FG) : + (HNNExtension.con G A A (MulEquiv.refl A)).subgroup.IsFinitelyNormallyGenerated := by + classical + obtain ⟨S, hS⟩ := hA + let C := HNNExtension.con G A A (MulEquiv.refl A) + let N : Subgroup (G ∗ Multiplicative ℤ) := + Subgroup.normalClosure (relation '' (S : Set G)) + let Q := (G ∗ Multiplicative ℤ) ⧸ N + let q : G ∗ Multiplicative ℤ →* Q := QuotientGroup.mk' N + let f : G →* Q := q.comp inl + let t : Q := q (inr (ofAdd 1)) + let e : G →* Q := (MulAut.conj t).toMonoidHom.comp f + have hgen : (S : Set G) ⊆ f.eqLocus e := by + intro g hg + have hh : q (relation g) = 1 := + (QuotientGroup.eq_one_iff _).mpr (Subgroup.subset_normalClosure ⟨g, hg, rfl⟩) + have he : t * f g = f g * t := by + apply mul_inv_eq_one.mp + exact hh + change f g = t * f g * t⁻¹ + rw [he, mul_inv_cancel_right] + have hAeq : A ≤ f.eqLocus e := by + rw [← hS] + exact (Subgroup.closure_le _).mpr hgen + have hC : C ≤ Con.ker q := by + apply Con.conGen_le.mpr + rintro _ _ ⟨a, rfl, rfl⟩ + change t * f a = f a * t + have ha : f a = t * f a * t⁻¹ := hAeq a.2 + nth_rw 2 [ha] + simp only [inv_mul_cancel_right] + refine ⟨relation '' (S : Set G), S.finite_toSet.image _, ?_⟩ + change N = C.subgroup + apply le_antisymm + · apply Subgroup.normalClosure_le_normal + rintro _ ⟨g, hg, rfl⟩ + have hgA : g ∈ A := by rw [← hS]; exact Subgroup.subset_closure hg + have hr : C (inr (ofAdd 1) * inl g) (inl g * inr (ofAdd 1)) := + ConGen.Rel.of _ _ ⟨⟨g, hgA⟩, rfl, rfl⟩ + change C (relation g) 1 + have hh := C.mul hr (C.refl (inl g * inr (ofAdd 1))⁻¹) + have hcancel : (inl g * inr (ofAdd 1) : G ∗ Multiplicative ℤ) * + (inl g * inr (ofAdd 1))⁻¹ = 1 := mul_inv_cancel _ + rw [hcancel] at hh + exact hh + · intro x hx + apply (QuotientGroup.eq_one_iff _).mp + exact (hC hx).trans (map_one q) + +theorem finitelyPresented [Group.IsFinitelyPresented G] (hA : A.FG) : + Group.IsFinitelyPresented (CentralExtension G A) := by + let C := HNNExtension.con G A A (MulEquiv.refl A) + have hC := con_finitelyNormallyGenerated hA + have hfp := Group.IsFinitelyPresented.quotient C.subgroup hC + change Group.IsFinitelyPresented C.Quotient + rw [← QuotientGroup.con_subgroup C] + exact hfp + +end CentralExtension +end Higman + +namespace Higman.Double +open HNNExtension Multiplicative +variable {G : Type u} [Group G] {D : Type v} [Group D] +variable (A : Subgroup G) + +abbrev Extension := HNNExtension G A A (MulEquiv.refl A) + +def first : G →* Extension A := HNNExtension.of + +def second : G →* Extension A := + (MulAut.conj HNNExtension.t).toMonoidHom.comp (first A) + +def subgroup : Subgroup (Extension A) := (first A).range ⊔ (second A).range + +def firstIn : G →* subgroup A := + (first A).codRestrict (subgroup A) (fun g ↦ (le_sup_left : (first A).range ≤ subgroup A) ⟨g,rfl⟩) + +def secondIn : G →* subgroup A := + (second A).codRestrict (subgroup A) (fun g ↦ (le_sup_right : (second A).range ≤ subgroup A) ⟨g,rfl⟩) + +variable {A} + +def lamp : D →* D ≀ᵣ Multiplicative ℤ where + toFun d := ⟨fun n ↦ if n = 1 then d else 1, 1⟩ + map_one' := by ext <;> simp + map_mul' a b := by + ext n + · by_cases hn : n = 1 <;> simp [hn] + · simp + +@[simp] theorem lamp_left (d : D) (n : Multiplicative ℤ) : + (lamp d).left n = if n = 1 then d else 1 := rfl + +@[simp] theorem lamp_right (d : D) : (lamp d).right = 1 := rfl + +def coordinate (n : Multiplicative ℤ) : + (RegularWreathProduct.rightHom : D ≀ᵣ Multiplicative ℤ →* Multiplicative ℤ).ker →* D where + toFun x := x.1.left n + map_one' := rfl + map_mul' x y := by + have hx : x.1.right = 1 := x.2 + simp [RegularWreathProduct.mul_left, hx] + +def wreathMap (q : G →* D) (hq : A ≤ q.ker) : + Extension A →* D ≀ᵣ Multiplicative ℤ := + HNNExtension.lift (lamp.comp q) (RegularWreathProduct.inl (ofAdd 1)) (by + intro a + have ha : q a = 1 := hq a.2 + simp [ha]) + +@[simp] theorem wreathMap_first (q : G →* D) (hq : A ≤ q.ker) (g : G) : + wreathMap q hq (first A g) = lamp (q g) := by + simp [wreathMap, first] + +@[simp] theorem wreathMap_second (q : G →* D) (hq : A ≤ q.ker) (g : G) : + wreathMap q hq (second A g) = + RegularWreathProduct.inl (ofAdd 1) * lamp (q g) * + (RegularWreathProduct.inl (ofAdd 1))⁻¹ := by + simp [second, MulAut.conj_apply, wreathMap, first] + +theorem subgroup_le_coordKer (q : G →* D) (hq : A ≤ q.ker) : + subgroup A ≤ (RegularWreathProduct.rightHom.comp (wreathMap q hq)).ker := by + apply sup_le + · rintro _ ⟨g,rfl⟩ + change (wreathMap q hq (first A g)).right = 1 + simp + · rintro _ ⟨g,rfl⟩ + change (wreathMap q hq (second A g)).right = 1 + simp + +def read (q : G →* D) (hq : A ≤ q.ker) : subgroup A →* D := + (coordinate (ofAdd 1)).comp + (((wreathMap q hq).comp (subgroup A).subtype).codRestrict _ + (fun x ↦ subgroup_le_coordKer q hq x.2)) + +@[simp] theorem read_first (q : G →* D) (hq : A ≤ q.ker) (g : G) : + read q hq (firstIn A g) = 1 := by + change (wreathMap q hq (first A g)).left (ofAdd 1) = 1 + rw [wreathMap_first, lamp_left] + simp + +@[simp] theorem read_second (q : G →* D) (hq : A ≤ q.ker) (g : G) : + read q hq (secondIn A g) = q g := by + change (wreathMap q hq (second A g)).left (ofAdd 1) = q g + rw [wreathMap_second] + simp + +end Higman.Double + +end UniversalFinitelyPresentedProof + +end OAI diff --git a/lean/OAI/GroupTheory/UniversalGroup/CompactCells.lean b/lean/OAI/GroupTheory/UniversalGroup/CompactCells.lean new file mode 100644 index 0000000000000000000000000000000000000000..1c29f1dcccea88c3749966ed085e68dc883164c3 --- /dev/null +++ b/lean/OAI/GroupTheory/UniversalGroup/CompactCells.lean @@ -0,0 +1,235 @@ +import OAI.GroupTheory.UniversalGroup.Milnor + +namespace OAI + +noncomputable section + +open Set Metric Topology BigOperators + +open Set Metric Topology +namespace UniversalFInfinity.Cellular +universe u +variable {X : Type u} [TopologicalSpace X] [T2Space X] +variable {C : Set X} [CWComplex C] + +omit [T2Space X] in + +lemma closedCell_subset_finite_openCells (n : ℕ) (i : RelCWComplex.cell C n) : + ∃ I : Finset (Σ m, RelCWComplex.cell C m), + CWComplex.closedCell n i ⊆ ⋃ p ∈ I, CWComplex.openCell p.1 p.2 := by + classical + obtain ⟨J,hJ⟩ := CWComplex.cellFrontier_subset_finite_openCell n i + refine ⟨insert ⟨n,i⟩ ((Finset.range n).sigma J),?_⟩ + intro x hx + rw [← CWComplex.cellFrontier_union_openCell_eq_closedCell] at hx + rcases hx with hx | hx + swap + · exact Set.mem_iUnion.mpr ⟨⟨n,i⟩,Set.mem_iUnion.mpr ⟨Finset.mem_insert_self _ _,hx⟩⟩ + · have hxx := hJ hx + simp only [Set.mem_iUnion] at hxx + obtain ⟨m,hm,j,hj,hx⟩ := hxx + exact Set.mem_iUnion.mpr ⟨⟨m,j⟩,Set.mem_iUnion.mpr + ⟨Finset.mem_insert_of_mem (by simp only [Finset.mem_sigma,Finset.mem_range]; exact ⟨hm,hj⟩),hx⟩⟩ + +lemma cellSelection_closed {I : Type u} (c : I → Σ n, RelCWComplex.cell C n) + (hc : Function.Injective c) (x : I → X) + (hx : ∀ i, x i ∈ CWComplex.openCell (c i).1 (c i).2) (S : Set X) + (hS : S ⊆ Set.range x) : IsClosed S := by + apply (CWComplex.closed C S ?_).mpr + · intro n j + obtain ⟨J,hJ⟩ := closedCell_subset_finite_openCells n j + have hfinite : (S ∩ CWComplex.closedCell n j).Finite := by + have hcpre : (c ⁻¹' (J : Set (Σ n, RelCWComplex.cell C n))).Finite := + J.finite_toSet.preimage hc.injOn + apply (hcpre.image x).subset + rintro y ⟨hyS,hycell⟩ + obtain ⟨i,rfl⟩ := hS hyS + have hxx := hJ hycell + simp only [Set.mem_iUnion] at hxx + obtain ⟨p,hpJ,hxp⟩ := hxx + have heq : c i = p := by + by_contra hne + exact (CWComplex.disjoint_openCell_of_ne hne).notMem_of_mem_left (hx i) hxp + exact ⟨i,by change c i ∈ J; rw [heq]; exact hpJ,rfl⟩ + exact hfinite.isClosed + · rintro y hy + obtain ⟨i,rfl⟩ := hS hy + exact CWComplex.openCell_subset_complex (c i).1 (c i).2 (hx i) + +theorem compact_finitely_many_cells {K : Set X} (hK : IsCompact K) : + {p : Σ n, RelCWComplex.cell C n | (K ∩ CWComplex.openCell p.1 p.2).Nonempty}.Finite := by + classical + let I := {p : Σ n, RelCWComplex.cell C n | (K ∩ CWComplex.openCell p.1 p.2).Nonempty} + let x : I → X := fun i => i.2.choose + have hx (i : I) : x i ∈ CWComplex.openCell i.1.1 i.1.2 := i.2.choose_spec.2 + have hxK (i : I) : x i ∈ K := i.2.choose_spec.1 + have hinj : Function.Injective x := by + intro i j hij + apply Subtype.ext + by_contra hne + exact (CWComplex.disjoint_openCell_of_ne hne).notMem_of_mem_left (hx i) (hij ▸ hx j) + have hall : ∀ S ⊆ Set.range x, IsClosed S := + cellSelection_closed (C := C) Subtype.val Subtype.val_injective x hx + have hcompact : IsCompact (Set.range x) := + hK.of_isClosed_subset (hall _ subset_rfl) (Set.range_subset_iff.mpr hxK) + have hdiscrete : IsDiscrete (Set.range x) := by + apply isDiscrete_iff_forall_mem_exists_isClosed.mpr + intro S hS + exact ⟨S,hall S hS,Set.inter_eq_left.mpr hS⟩ + have hrange := hcompact.finite hdiscrete + have : Finite I := (Set.finite_range_iff hinj).mp hrange + exact Set.toFinite I + +theorem compact_bounded_skeleton {K : Set X} (hK : IsCompact K) (hKC : K ⊆ C) : + ∃ n : ℕ, K ⊆ CWComplex.skeletonLT C n := by + classical + let S := {p : Σ n, RelCWComplex.cell C n | (K ∩ CWComplex.openCell p.1 p.2).Nonempty} + have hS : S.Finite := compact_finitely_many_cells hK + let I := hS.toFinset + refine ⟨I.sup (fun p => p.1+1),?_⟩ + intro x hx + have hxC := hKC hx + rw [← CWComplex.iUnion_openCell_eq_complex (C := C)] at hxC + simp only [Set.mem_iUnion] at hxC + obtain ⟨m,j,hj⟩ := hxC + have hmem : (⟨m,j⟩ : Σ n, RelCWComplex.cell C n) ∈ I := by + exact hS.mem_toFinset.mpr ⟨x,hx,hj⟩ + have hm : m+1 ≤ I.sup (fun p => p.1+1) := Finset.le_sup (f := fun p => p.1+1) hmem + apply CWComplex.skeletonLT_mono (C := C) + (m := (m : ℕ∞)+1) (n := ((I.sup (fun p => p.1+1) : ℕ) : ℕ∞)) (by exact_mod_cast hm) + exact CWComplex.closedCell_subset_skeletonLT m j (CWComplex.openCell_subset_closedCell m j hj) + +theorem compactMap_bounded_skeleton {A : Type*} [TopologicalSpace A] [CompactSpace A] + (f : C(A,X)) (hf : ∀ a, f a ∈ C) : + ∃ n : ℕ, ∀ a, f a ∈ CWComplex.skeletonLT C n := by + obtain ⟨n,hn⟩ := compact_bounded_skeleton (C := C) (isCompact_range f.continuous) + (Set.range_subset_iff.mpr hf) + exact ⟨n,fun a => hn (Set.mem_range_self a)⟩ + +end UniversalFInfinity.Cellular + +namespace UniversalFInfinity.Simplicial +open Set Metric Topology BigOperators +open scoped Classical +universe u +variable {V : Type u} (K : PreAbstractSimplicialComplex V) + +lemma compact_bounded_vertices {A : Set (Space K)} (hA : IsCompact A) : + ∃ S : Finset V, ∀ x ∈ A, x.1.support ⊆ S := by + let T := {p : Σ n, Topology.RelCWComplex.cell (Set.univ : Set (Space K)) n | + (A ∩ CWComplex.openCell p.1 p.2).Nonempty} + have hT : T.Finite := Cellular.compact_finitely_many_cells hA + let S := hT.toFinset.biUnion (fun p => p.2.1.1) + refine ⟨S,?_⟩ + intro x hx + let s : Face K := ⟨x.1.support,x.2.2.2⟩ + let c := cellOfFace K s + have hc : (⟨s.1.card-1,c⟩ : Σ n, Topology.RelCWComplex.cell (Set.univ : Set (Space K)) n) ∈ hT.toFinset := by + rw [hT.mem_toFinset] + refine ⟨x,hx,?_⟩ + change x ∈ characteristicPE K c '' ball 0 1 + rw [characteristicPE_open] + rfl + exact Finset.subset_biUnion_of_mem (fun p => p.2.1.1) hc + +end UniversalFInfinity.Simplicial + +open Set Metric Topology +namespace UniversalFInfinity.SphereTopology +abbrev Disk (n : ℕ) := closedBall (0 : Fin n → ℝ) 1 +abbrev Sphere (n : ℕ) := sphere (0 : Fin n → ℝ) 1 + +def boundary (n : ℕ) : C(Sphere n,Disk n) := + ⟨fun x => ⟨x.1,sphere_subset_closedBall x.2⟩,continuous_subtype_val.subtype_mk _⟩ + +lemma sphere_norm {n : ℕ} (x : Sphere n) : ‖x.1‖ = 1 := by + simpa only [mem_sphere,dist_zero_right] using x.2 +lemma disk_norm {n : ℕ} (x : Disk n) : ‖x.1‖ ≤ 1 := by + simpa only [mem_closedBall,dist_zero_right] using x.2 + +def cone (n : ℕ) : C(unitInterval × Sphere n,Disk n) := by + have hm (p : unitInterval × Sphere n) : (p.1:ℝ) • p.2.1 ∈ closedBall (0 : Fin n → ℝ) 1 := by + simp only [mem_closedBall,dist_zero_right,norm_smul,Real.norm_eq_abs,abs_of_nonneg p.1.2.1,sphere_norm,mul_one] + exact p.1.2.2 + exact ⟨fun p => ⟨(p.1:ℝ) • p.2.1,hm p⟩, + ((continuous_subtype_val.comp continuous_fst).smul + (continuous_subtype_val.comp continuous_snd)).subtype_mk hm⟩ + +lemma cone_norm {n : ℕ} (p : unitInterval × Sphere n) : ‖(cone n p).1‖ = (p.1:ℝ) := by + simp only [cone,ContinuousMap.coe_mk,norm_smul,Real.norm_eq_abs,abs_of_nonneg p.1.2.1,sphere_norm,mul_one] + +lemma cone_surjective (n : ℕ) [Nonempty (Sphere n)] : Function.Surjective (cone n) := by + intro x + by_cases hx : x.1 = 0 + · obtain ⟨s⟩ := ‹Nonempty (Sphere n)› + refine ⟨(0,s),Subtype.ext ?_⟩ + simp only [cone,ContinuousMap.coe_mk,Set.Icc.coe_zero,zero_smul,hx] + · let s : Sphere n := ⟨‖x.1‖⁻¹ • x.1,by + simp only [mem_sphere,dist_zero_right,norm_smul,Real.norm_eq_abs,abs_inv,abs_norm, + inv_mul_cancel₀ (norm_ne_zero_iff.mpr hx)]⟩ + refine ⟨(⟨‖x.1‖,norm_nonneg _,disk_norm x⟩,s),Subtype.ext ?_⟩ + change ‖x.1‖ • (‖x.1‖⁻¹ • x.1) = x.1 + rw [smul_smul,mul_inv_cancel₀ (norm_ne_zero_iff.mpr hx),one_smul] + +lemma cone_quotient (n : ℕ) [Nonempty (Sphere n)] : IsQuotientMap (cone n) := + IsQuotientMap.of_surjective_continuous (cone_surjective n) (cone n).continuous + +variable {Y : Type*} [TopologicalSpace Y] {n : ℕ} + +def Extends (f : C(Sphere n,Y)) : Prop := ∃ F : C(Disk n,Y), F.comp (boundary n) = f + +lemma extends_of_nullhomotopic [Nonempty (Sphere n)] {y : Y} {f : C(Sphere n,Y)} + (H : (ContinuousMap.const (Sphere n) y).Homotopy f) : Extends f := by + have hf : Function.FactorsThrough H.toContinuousMap (cone n) := by + intro p q hpq + have ht : p.1 = q.1 := Subtype.ext ((cone_norm p).symm.trans ((congrArg (fun z : Disk n => ‖z.1‖) hpq).trans (cone_norm q))) + by_cases hzero : (p.1:ℝ) = 0 + · have hp : p.1 = 0 := Subtype.ext hzero + have hq : q.1 = 0 := ht.symm.trans hp + change H (p.1,p.2) = H (q.1,q.2) + rw [hp,hq,H.apply_zero,H.apply_zero] + rfl + · have hs : p.2 = q.2 := by + apply Subtype.ext + have heq := congrArg (fun z : Disk n => z.1) hpq + change (p.1:ℝ) • p.2.1 = (q.1:ℝ) • q.2.1 at heq + rw [← ht] at heq + exact (smul_right_injective _ hzero) heq + exact congrArg H.toContinuousMap (Prod.ext ht hs) + let F : C(Disk n,Y) := (cone_quotient n).lift H.toContinuousMap hf + refine ⟨F,?_⟩ + ext s + have hh := ContinuousMap.congr_fun ((cone_quotient n).lift_comp H.toContinuousMap hf) (1,s) + have hcone : cone n (1,s) = boundary n s := by apply Subtype.ext; simp [cone,boundary] + simpa only [ContinuousMap.comp_apply,hcone,ContinuousMap.Homotopy.coe_toContinuousMap, + ContinuousMap.Homotopy.apply_one] using hh + +lemma nullhomotopic_of_extends {f : C(Sphere n,Y)} (hf : Extends f) : + ∃ y : Y, Nonempty ((ContinuousMap.const (Sphere n) y).Homotopy f) := by + obtain ⟨F,hF⟩ := hf + let z : Disk n := ⟨0,by simp⟩ + refine ⟨F z,⟨{ + toFun := fun p => F (cone n p) + continuous_toFun := F.continuous.comp (cone n).continuous + map_zero_left := ?_ + map_one_left := ?_ }⟩⟩ + · intro s + exact congrArg F (Subtype.ext (by simp [cone,z])) + · intro s + have hs : cone n (1,s) = boundary n s := by apply Subtype.ext; simp [cone,boundary] + rw [hs] + exact ContinuousMap.congr_fun hF s + +lemma extends_of_homotopy [Nonempty (Sphere n)] {f g : C(Sphere n,Y)} + (H : f.Homotopy g) (hg : Extends g) : Extends f := by + obtain ⟨y,⟨J⟩⟩ := nullhomotopic_of_extends hg + exact extends_of_nullhomotopic (J.trans H.symm) + +lemma sphere_nonempty (n : ℕ) : Nonempty (Sphere (n+1)) := + (NormedSpace.sphere_nonempty.mpr (by norm_num : (0:ℝ) ≤ 1)).coe_sort + +end UniversalFInfinity.SphereTopology + +end + +end OAI diff --git a/lean/OAI/GroupTheory/UniversalGroup/ControlledCells.lean b/lean/OAI/GroupTheory/UniversalGroup/ControlledCells.lean new file mode 100644 index 0000000000000000000000000000000000000000..02b6df3869cdc93cb8c22e72850fe1ff001a6d7c --- /dev/null +++ b/lean/OAI/GroupTheory/UniversalGroup/ControlledCells.lean @@ -0,0 +1,591 @@ +import OAI.GroupTheory.UniversalGroup.TreeGeometry + +namespace OAI + +noncomputable section + +open Set Metric Topology BigOperators +open Set Metric Topology +open Set Topology +open Set Metric Topology +open scoped NNReal +open Set Metric Topology +open scoped NNReal ENNReal +open Set Metric Topology +open scoped TensorProduct + +namespace UniversalFInfinity.Cellular + +section +open Set Metric Topology +open scoped unitInterval +universe u v +variable {Y : Type u} {Z : Type v} [TopologicalSpace Y] [TopologicalSpace Z] + +lemma square_filling_after {n : ℕ} (q : C(Y,Z)) (hq : KillsSpheres q (n+2)) + (a : C(Sphere n,C(I,C(I,Y)))) + (b c : C(Disk n,C(I,Y) × C(I,Y))) + (hs : ∀ x, pathEndpoint (a x) = b (boundary n x)) + (ht : ∀ x s, pathEndpoint (a x s) = + ((c (boundary n x)).1 s,(c (boundary n x)).2 s)) + (h0 : ∀ x, pathEndpoint ((b x).1) = ((c x).1 0,(c x).2 0)) + (h1 : ∀ x, pathEndpoint ((b x).2) = ((c x).1 1,(c x).2 1)) : + ∃ e : C(Disk n,C(I,C(I,Z))), + (∀ x s t, e (boundary n x) s t = q (a x s t)) ∧ + (∀ x t, e x 0 t = q ((b x).1 t)) ∧ + (∀ x t, e x 1 t = q ((b x).2 t)) ∧ + (∀ x s, e x s 0 = q ((c x).1 s)) ∧ + (∀ x s, e x s 1 = q ((c x).2 s)) := by + let A := cylinderBoundaryMap a b hs + let B : C(Disk (n+1),Y × Y) := + ⟨fun x => ((c (diskTail x)).1 (diskTime x),(c (diskTail x)).2 (diskTime x)),by + apply Continuous.prodMk + · exact continuous_eval.comp + ((continuous_fst.comp (c.continuous.comp continuous_diskTail)).prodMk continuous_diskTime) + · exact continuous_eval.comp + ((continuous_snd.comp (c.continuous.comp continuous_diskTail)).prodMk continuous_diskTime)⟩ + have hAB : ∀ x, pathEndpoint (A x) = B (boundary (n+1) x) := by + intro x + rcases sphere_split x with hx|hx|hx + · have hx' : x ∈ cylinderFace n (some false) := hx + rw [show A x = faceMap a b (some false) ⟨x,hx'⟩ from + cylinderBoundaryMap_face a b hs (some false) ⟨x,hx'⟩] + change pathEndpoint ((b (diskTail (boundary (n+1) x))).1) = + ((c (diskTail (boundary (n+1) x))).1 (diskTime (boundary (n+1) x)), + (c (diskTail (boundary (n+1) x))).2 (diskTime (boundary (n+1) x))) + rw [faceTime_eq_zero x hx]; exact h0 _ + · have hx' : x ∈ cylinderFace n (some true) := hx + rw [show A x = faceMap a b (some true) ⟨x,hx'⟩ from + cylinderBoundaryMap_face a b hs (some true) ⟨x,hx'⟩] + change pathEndpoint ((b (diskTail (boundary (n+1) x))).2) = + ((c (diskTail (boundary (n+1) x))).1 (diskTime (boundary (n+1) x)), + (c (diskTail (boundary (n+1) x))).2 (diskTime (boundary (n+1) x))) + rw [faceTime_eq_one x hx]; exact h1 _ + · have hx' : x ∈ cylinderFace n none := hx + rw [show A x = faceMap a b none ⟨x,hx'⟩ from + cylinderBoundaryMap_face a b hs none ⟨x,hx'⟩] + exact ht (faceSphere ⟨x,hx'⟩) (faceTime none ⟨x,hx'⟩) + obtain ⟨d,hd,hp⟩ := cylinder_filling_after q hq A B hAB + let e : C(Disk n,C(I,C(I,Z))) := + (d.comp ⟨fun p : Disk n × I => diskCons p.1 p.2,continuous_diskCons⟩).curry + refine ⟨e,?_,?_,?_,?_,?_⟩ + · intro x s t + let z : Sphere (n+1) := ⟨_,cons_mem_sphere_of_boundary x s⟩ + have hz : z ∈ cylinderFace n none := by + change (diskTail (diskCons (boundary n x) s)).1 ∈ sphere 0 1 + rw [diskTail_cons]; exact x.2 + change d (diskCons (boundary n x) s) t = q (a x s t) + rw [show diskCons (boundary n x) s = boundary (n+1) z from rfl,hd] + rw [show A z = faceMap a b none ⟨z,hz⟩ from + cylinderBoundaryMap_face a b hs none ⟨z,hz⟩] + change q (a (faceSphere ⟨z,hz⟩) (diskTime (diskCons (boundary n x) s)) t) = _ + rw [diskTime_cons]; congr 2 + · intro x t + let z : Sphere (n+1) := ⟨_,cons_zero_mem_sphere x⟩ + have hz : z ∈ cylinderFace n (some false) := by + change (diskCons x 0).1 0 = -1; norm_num [diskCons] + change d (diskCons x 0) t = q ((b x).1 t) + rw [show diskCons x 0 = boundary (n+1) z from rfl,hd] + rw [show A z = faceMap a b (some false) ⟨z,hz⟩ from + cylinderBoundaryMap_face a b hs (some false) ⟨z,hz⟩] + change q ((b (diskTail (diskCons x 0))).1 t) = _ + rw [diskTail_cons] + · intro x t + let z : Sphere (n+1) := ⟨_,cons_one_mem_sphere x⟩ + have hz : z ∈ cylinderFace n (some true) := by + change (diskCons x 1).1 0 = 1; norm_num [diskCons] + change d (diskCons x 1) t = q ((b x).2 t) + rw [show diskCons x 1 = boundary (n+1) z from rfl,hd] + rw [show A z = faceMap a b (some true) ⟨z,hz⟩ from + cylinderBoundaryMap_face a b hs (some true) ⟨z,hz⟩] + change q ((b (diskTail (diskCons x 1))).2 t) = _ + rw [diskTail_cons] + · intro x s + have h := congrArg Prod.fst (hp (diskCons x s)) + change d (diskCons x s) 0 = _ + simpa only [pathEndpoint,ContinuousMap.coe_mk,B,ContinuousMap.coe_mk, + diskTail_cons,diskTime_cons] using h + · intro x s + have h := congrArg Prod.snd (hp (diskCons x s)) + change d (diskCons x s) 1 = _ + simpa only [pathEndpoint,ContinuousMap.coe_mk,B,ContinuousMap.coe_mk, + diskTail_cons,diskTime_cons] using h +end + +section +open Set Metric Topology +open scoped unitInterval +universe u v w +variable {X : Type u} {Y : Type v} {Z : Type w} +variable [TopologicalSpace X] [TopologicalSpace Y] [TopologicalSpace Z] + +def postPath (q : C(Y,Z)) : C(C(I,Y),C(I,Z)) := + ⟨fun a => q.comp a,ContinuousMap.continuous_postcomp q⟩ + +structure SquareBoundary (X : Type u) (Y : Type v) [TopologicalSpace X] [TopologicalSpace Y] where + b : C(X,C(I,Y) × C(I,Y)) + c : C(X,C(I,Y) × C(I,Y)) + zero : ∀ x, pathEndpoint ((b x).1) = ((c x).1 0,(c x).2 0) + one : ∀ x, pathEndpoint ((b x).2) = ((c x).1 1,(c x).2 1) + +namespace SquareBoundary + +def post (D : SquareBoundary X Y) (q : C(Y,Z)) : SquareBoundary X Z where + b := ⟨fun x => (postPath q (D.b x).1,postPath q (D.b x).2), + ((postPath q).continuous.comp (continuous_fst.comp D.b.continuous)).prodMk + ((postPath q).continuous.comp (continuous_snd.comp D.b.continuous))⟩ + c := ⟨fun x => (postPath q (D.c x).1,postPath q (D.c x).2), + ((postPath q).continuous.comp (continuous_fst.comp D.c.continuous)).prodMk + ((postPath q).continuous.comp (continuous_snd.comp D.c.continuous))⟩ + zero x := Prod.ext (congrArg q (congrArg Prod.fst (D.zero x))) + (congrArg q (congrArg Prod.snd (D.zero x))) + one x := Prod.ext (congrArg q (congrArg Prod.fst (D.one x))) + (congrArg q (congrArg Prod.snd (D.one x))) +end SquareBoundary + +variable [T2Space X] {C : Set X} [CWComplex C] + +structure PartialSquare (D : SquareBoundary X Y) (n : ℕ) where + val : X → C(I,C(I,Y)) + continuousOn : ContinuousOn val (Skeleton C n) + left : ∀ x ∈ Skeleton C n, ∀ t, val x 0 t = (D.b x).1 t + right : ∀ x ∈ Skeleton C n, ∀ t, val x 1 t = (D.b x).2 t + bottom : ∀ x ∈ Skeleton C n, ∀ s, val x s 0 = (D.c x).1 s + top : ∀ x ∈ Skeleton C n, ∀ s, val x s 1 = (D.c x).2 s + +namespace PartialSquare +variable {D : SquareBoundary X Y} {n : ℕ} + +def onSphere (P : PartialSquare (C := C) D n) (i : RelCWComplex.cell C n) : + C(Sphere n,C(I,C(I,Y))) := + ⟨fun x => P.val (characteristic n i (boundary n x)), + P.continuousOn.comp_continuous ((characteristic n i).continuous.comp (continuous_boundary n)) + (sphere_mem_skeleton n i)⟩ + +lemma cell_extension_after (P : PartialSquare (C := C) D n) + (q : C(Y,Z)) (hq : KillsSpheres q (n+2)) (i : RelCWComplex.cell C n) : + ∃ e : C(Disk n,C(I,C(I,Z))), + (∀ x, e (boundary n x) = postPath (postPath q) (P.val (characteristic n i (boundary n x)))) ∧ + (∀ x t, e x 0 t = q ((D.b (characteristic n i x)).1 t)) ∧ + (∀ x t, e x 1 t = q ((D.b (characteristic n i x)).2 t)) ∧ + (∀ x s, e x s 0 = q ((D.c (characteristic n i x)).1 s)) ∧ + (∀ x s, e x s 1 = q ((D.c (characteristic n i x)).2 s)) := by + obtain ⟨e,he,h0,h1,h2,h3⟩ := square_filling_after q hq (P.onSphere i) + (D.b.comp (characteristic n i)) (D.c.comp (characteristic n i)) (by + intro x; apply Prod.ext <;> apply ContinuousMap.ext <;> intro t + · exact P.left _ (sphere_mem_skeleton n i x) t + · exact P.right _ (sphere_mem_skeleton n i x) t) (by + intro x s; exact Prod.ext (P.bottom _ (sphere_mem_skeleton n i x) s) + (P.top _ (sphere_mem_skeleton n i x) s)) + (fun x => D.zero (characteristic n i x)) (fun x => D.one (characteristic n i x)) + exact ⟨e,fun x => ContinuousMap.ext (fun s => ContinuousMap.ext (he x s)),h0,h1,h2,h3⟩ + +def next (P : PartialSquare (C := C) D n) + (q : C(Y,Z)) (hq : KillsSpheres q (n+2)) : PartialSquare (C := C) (D.post q) (n+1) := by + let e := fun i => (P.cell_extension_after q hq i).choose + have hb := fun i => (P.cell_extension_after q hq i).choose_spec.1 + have h0 := fun i => (P.cell_extension_after q hq i).choose_spec.2.1 + have h1 := fun i => (P.cell_extension_after q hq i).choose_spec.2.2.1 + have h2 := fun i => (P.cell_extension_after q hq i).choose_spec.2.2.2.1 + have h3 := fun i => (P.cell_extension_after q hq i).choose_spec.2.2.2.2 + let v : X → C(I,C(I,Z)) := fun x => postPath (postPath q) (P.val x) + have hv : ContinuousOn v (Skeleton C n) := + (postPath (postPath q)).continuous.comp_continuousOn P.continuousOn + refine ⟨attachValue v e,attachValue_continuous v hv e hb,?_,?_,?_,?_⟩ + all_goals + intro x hx t + have heq : Skeleton C (n+1) = Skeleton C n ∪ + ⋃ i : RelCWComplex.cell C n, CWComplex.closedCell n i := by + simpa only [Skeleton,Nat.cast_add,Nat.cast_one] using + (CWComplex.skeletonLT_union_iUnion_closedCell_eq_skeletonLT_succ (C := C) n).symm + rw [heq] at hx + rcases hx with hx|hx + · rw [attachValue_old v e hx] + first + | exact congrArg q (P.left x hx t) + | exact congrArg q (P.right x hx t) + | exact congrArg q (P.bottom x hx t) + | exact congrArg q (P.top x hx t) + · obtain ⟨i,y,hy,rfl⟩ := Set.mem_iUnion.mp hx + rw [show RelCWComplex.map n i y = characteristic n i ⟨y,hy⟩ from rfl, + attachValue_characteristic v e hb] + first + | exact h0 i ⟨y,hy⟩ t + | exact h1 i ⟨y,hy⟩ t + | exact h2 i ⟨y,hy⟩ t + | exact h3 i ⟨y,hy⟩ t + +def start (D : SquareBoundary X Y) : PartialSquare (C := C) D 0 where + val x := ContinuousMap.const _ (D.b x).1 + continuousOn := by + rw [Skeleton,Nat.cast_zero,CWComplex.skeletonLT_zero_eq_empty] + exact continuousOn_empty _ + left := by intro x hx; simp only [Skeleton,Nat.cast_zero,CWComplex.skeletonLT_zero_eq_empty,Set.mem_empty_iff_false] at hx + right := by intro x hx; simp only [Skeleton,Nat.cast_zero,CWComplex.skeletonLT_zero_eq_empty,Set.mem_empty_iff_false] at hx + bottom := by intro x hx; simp only [Skeleton,Nat.cast_zero,CWComplex.skeletonLT_zero_eq_empty,Set.mem_empty_iff_false] at hx + top := by intro x hx; simp only [Skeleton,Nat.cast_zero,CWComplex.skeletonLT_zero_eq_empty,Set.mem_empty_iff_false] at hx + +def toMap [CWComplex (Set.univ : Set X)] + (P : PartialSquare (C := (Set.univ : Set X)) D n) + (hd : Skeleton (Set.univ : Set X) n = Set.univ) : C(X,C(I,C(I,Y))) := + ⟨P.val,by + apply continuousOn_univ.mp + have h := P.continuousOn + rw [hd] at h + exact h⟩ +end PartialSquare + +end + +open Set Metric Topology +open scoped unitInterval +universe u v +variable {X : Type u} [TopologicalSpace X] [T2Space X] [CWComplex (Set.univ : Set X)] +variable (Y : ℕ → Type v) [∀ i,TopologicalSpace (Y i)] (q : ∀ i,C(Y i,Y (i+1))) + +def boundaryTower (D : SquareBoundary X (Y 0)) : ∀ i,SquareBoundary X (Y i) + | 0 => D + | i+1 => (boundaryTower D i).post (q i) + +variable (D : SquareBoundary X (Y 0)) (hq : ∀ i,KillsSpheres (q i) (i+2)) + +def squareTower : ∀ i,PartialSquare (C := (Set.univ : Set X)) (boundaryTower Y q D i) i + | 0 => PartialSquare.start D + | i+1 => (squareTower i).next (q i) (hq i) + +include hq in + +theorem exists_tower_square (d : ℕ) (hd : Skeleton (Set.univ : Set X) d = Set.univ) : + ∃ S : C(X,C(I,C(I,Y d))), + (∀ x t,S x 0 t = ((boundaryTower Y q D d).b x).1 t) ∧ + (∀ x t,S x 1 t = ((boundaryTower Y q D d).b x).2 t) ∧ + (∀ x s,S x s 0 = ((boundaryTower Y q D d).c x).1 s) ∧ + (∀ x s,S x s 1 = ((boundaryTower Y q D d).c x).2 s) := by + let P := squareTower Y q D hq d + refine ⟨P.toMap hd,?_,?_,?_,?_⟩ + · intro x t; exact P.left x (hd.symm ▸ Set.mem_univ x) t + · intro x t; exact P.right x (hd.symm ▸ Set.mem_univ x) t + · intro x s; exact P.bottom x (hd.symm ▸ Set.mem_univ x) s + · intro x s; exact P.top x (hd.symm ▸ Set.mem_univ x) s +end UniversalFInfinity.Cellular + +namespace UniversalFInfinity.SphereTopology +open Set Topology +open scoped unitInterval +universe u v w +variable {B : Type u} [TopologicalSpace B] {Y : Type v} [TopologicalSpace Y] + {Z : Type w} [TopologicalSpace Z] {n : ℕ} [Nonempty (Sphere n)] + +lemma parametric_extension (q : C(Y,Z)) (z : Z) (H : q.Homotopy (.const _ z)) + (a : C(B × Sphere n,Y)) : + ∃ F : C(B × Disk n,Z), ∀ b x,F (b,boundary n x) = q (a (b,x)) := by + let k : C(B × (I × Sphere n),B × Disk n) := + ⟨Prod.map id (cone n),continuous_fst.prodMk ((cone n).continuous.comp continuous_snd)⟩ + have hk : IsProperMap k := isProperMap_id.prodMap (cone n).continuous.isProperMap + have hsurj : Function.Surjective k := Function.Surjective.prodMap Function.surjective_id (cone_surjective n) + have hquot : IsQuotientMap k := hk.isClosedMap.isQuotientMap hk.continuous hsurj + let v : C(B × (I × Sphere n),Z) := + ⟨fun p => H.symm (p.2.1,a (p.1,p.2.2)),H.symm.continuous.comp + (continuous_snd.fst.prodMk (a.continuous.comp (continuous_fst.prodMk continuous_snd.snd)))⟩ + have hv : Function.FactorsThrough v k := by + intro p r hpr + have hb : p.1 = r.1 := congrArg (fun x : B × Disk n => x.1) hpr + have hc : cone n p.2 = cone n r.2 := congrArg (fun x : B × Disk n => x.2) hpr + have ht : p.2.1 = r.2.1 := Subtype.ext ((cone_norm p.2).symm.trans + ((congrArg (fun x : Disk n => ‖x.1‖) hc).trans (cone_norm r.2))) + by_cases hzero : (p.2.1:ℝ) = 0 + · have hp : p.2.1 = 0 := Subtype.ext hzero + have hr : r.2.1 = 0 := ht.symm.trans hp + change H.symm (p.2.1,a (p.1,p.2.2)) = H.symm (r.2.1,a (r.1,r.2.2)) + rw [hp,hr,H.symm.apply_zero,H.symm.apply_zero] + rfl + · have hs : p.2.2 = r.2.2 := by + apply Subtype.ext + have heq := congrArg (fun x : Disk n => x.1) hc + change (p.2.1:ℝ) • p.2.2.1 = (r.2.1:ℝ) • r.2.2.1 at heq + rw [←ht] at heq + exact (smul_right_injective _ hzero) heq + exact congrArg v (Prod.ext hb (Prod.ext ht hs)) + let F := hquot.lift v hv + refine ⟨F,?_⟩ + intro b x + have hh := ContinuousMap.congr_fun (hquot.lift_comp v hv) (b,(1,x)) + have hc : cone n (1,x) = boundary n x := by apply Subtype.ext; simp [cone,boundary] + change F (b,cone n (1,x)) = H.symm (1,a (b,x)) at hh + simpa only [hc,H.symm.apply_one,ContinuousMap.comp_apply] using hh +end UniversalFInfinity.SphereTopology + +namespace UniversalFInfinity.Cellular + +section +open Set Topology +open scoped unitInterval +universe u v +variable {B : Type u} [TopologicalSpace B] {Y : Type v} [TopologicalSpace Y] {n : ℕ} +variable (a : C(B,C(Sphere n,C(I,Y)))) (b : C(B,C(Disk n,Y × Y))) +variable (h : ∀ v x,pathEndpoint (a v x) = b v (boundary n x)) + +def familyCylinderFace (i : Option Bool) : Set (B × Sphere (n+1)) := + Prod.snd ⁻¹' cylinderFace n i + +def familyFaceMap (i : Option Bool) : C(familyCylinderFace (B := B) (n := n) i,Y) := by + let π : C(familyCylinderFace (B := B) (n := n) i,B) := ⟨fun p => p.1.1,continuous_fst.comp continuous_subtype_val⟩ + let ρ : C(familyCylinderFace (B := B) (n := n) i,cylinderFace n i) := + ⟨fun p => ⟨p.1.2,p.2⟩,(continuous_snd.comp continuous_subtype_val).subtype_mk _⟩ + cases i with + | none => exact ⟨fun p => a (π p) (faceSphere (ρ p)) (faceTime none (ρ p)), + continuous_eval.comp ((continuous_eval.comp ((a.continuous.comp π.continuous).prodMk + (faceSphere.continuous.comp ρ.continuous))).prodMk ((faceTime none).continuous.comp ρ.continuous))⟩ + | some c => + cases c + · exact ⟨fun p => (b (π p) (faceTail (some false) (ρ p))).1, + continuous_fst.comp (continuous_eval.comp ((b.continuous.comp π.continuous).prodMk + ((faceTail (some false)).continuous.comp ρ.continuous)))⟩ + · exact ⟨fun p => (b (π p) (faceTail (some true) (ρ p))).2, + continuous_snd.comp (continuous_eval.comp ((b.continuous.comp π.continuous).prodMk + ((faceTail (some true)).continuous.comp ρ.continuous)))⟩ +lemma familyFaceMap_eq (i : Option Bool) (p : familyCylinderFace (B := B) (n := n) i) : + familyFaceMap a b i p = faceMap (a p.1.1) (b p.1.1) i ⟨p.1.2,p.2⟩ := by + cases i with + | none => rfl + | some c => cases c <;> rfl + +include h in +lemma familyCylinder_continuous : Continuous (fun p : B × Sphere (n+1) => cylinderBoundaryMap (a p.1) (b p.1) (h p.1) p.2) := by + let S := familyCylinderFace (B := B) (n := n) + have hc : ∀ i j p (hi : p ∈ S i) (hj : p ∈ S j), familyFaceMap a b i ⟨p,hi⟩ = familyFaceMap a b j ⟨p,hj⟩ := by + intro i j p hi hj + rw [familyFaceMap_eq,familyFaceMap_eq] + exact faceMap_compat (a p.1) (b p.1) (h p.1) i j p.2 hi hj + have hcover : ⋃ i,S i = univ := by + apply Set.eq_univ_of_forall + intro p + have hp : p.2 ∈ ⋃ i,cylinderFace n i := by rw [cylinderFace_cover]; exact mem_univ _ + obtain ⟨i,hi⟩ := Set.mem_iUnion.mp hp + exact Set.mem_iUnion.mpr ⟨i,hi⟩ + have hclosed : ∀ i,IsClosed (S i) := fun i => (cylinderFace_closed n i).preimage continuous_snd + have he : Set.liftCover S (fun i => familyFaceMap a b i) hc hcover = + (fun p : B × Sphere (n+1) => cylinderBoundaryMap (a p.1) (b p.1) (h p.1) p.2) := by + funext p + have hp : p ∈ ⋃ i,S i := by rw [hcover]; exact mem_univ _ + obtain ⟨i,hi⟩ := Set.mem_iUnion.mp hp + rw [Set.liftCover_coe (S := S) (f := fun i => familyFaceMap a b i) (hf := hc) (hS := hcover) ⟨p,hi⟩, + familyFaceMap_eq] + exact (cylinderBoundaryMap_face (a p.1) (b p.1) (h p.1) i ⟨p.2,hi⟩).symm + rw [←he] + exact continuous_liftCover S _ hc hcover hclosed +end + +section +open Set Metric Topology +open scoped unitInterval +universe u v w +variable {B : Type u} [TopologicalSpace B] {Y : Type v} [TopologicalSpace Y] + {Z : Type w} [TopologicalSpace Z] +lemma family_cylinder_filling {n : ℕ} (q : C(Y,Z)) (z : Z) (H : q.Homotopy (.const _ z)) + (a : C(B,C(Sphere n,C(I,Y)))) (b : C(B,C(Disk n,Y × Y))) + (h : ∀ v x,pathEndpoint (a v x) = b v (boundary n x)) : + ∃ e : C(B,C(Disk n,C(I,Z))), + (∀ v x t,e v (boundary n x) t = q (a v x t)) ∧ + ∀ v x,pathEndpoint (e v x) = (q (b v x).1,q (b v x).2) := by + let : Nonempty (Sphere (n+1)) := SphereTopology.sphere_nonempty n + let a' : C(B × Sphere (n+1),Y) := ⟨_,familyCylinder_continuous a b h⟩ + obtain ⟨F,hF⟩ := SphereTopology.parametric_extension q z H a' + change ∀ v x,F (v,boundary (n+1) x) = q (a' (v,x)) at hF + let e : C(B,C(Disk n,C(I,Z))) := + (F.comp ⟨fun p : (B × Disk n) × I => (p.1.1,diskCons p.1.2 p.2), + continuous_fst.fst.prodMk (continuous_diskCons.comp (continuous_fst.snd.prodMk continuous_snd))⟩).curry.curry + refine ⟨e,?_,?_⟩ + · intro v x t + let s : Sphere (n+1) := ⟨_,cons_mem_sphere_of_boundary x t⟩ + have hs : s ∈ cylinderFace n none := by + change (diskTail (diskCons (boundary n x) t)).1 ∈ sphere 0 1 + rw [diskTail_cons]; exact x.2 + change F (v,diskCons (boundary n x) t) = q (a v x t) + rw [show diskCons (boundary n x) t = boundary (n+1) s from rfl,hF] + change q (cylinderBoundaryMap (a v) (b v) (h v) s) = _ + rw [cylinderBoundaryMap_face (a v) (b v) (h v) none ⟨s,hs⟩] + change q (a v (faceSphere ⟨s,hs⟩) (diskTime (diskCons (boundary n x) t))) = q (a v x t) + rw [diskTime_cons]; congr 2 + · intro v x + apply Prod.ext + · let s : Sphere (n+1) := ⟨_,cons_zero_mem_sphere x⟩ + have hs : s ∈ cylinderFace n (some false) := by + change (diskCons x 0).1 0 = -1; norm_num [diskCons] + change F (v,diskCons x 0) = q (b v x).1 + rw [show diskCons x 0 = boundary (n+1) s from rfl,hF] + change q (cylinderBoundaryMap (a v) (b v) (h v) s) = _ + rw [cylinderBoundaryMap_face (a v) (b v) (h v) (some false) ⟨s,hs⟩] + change q (b v (diskTail (diskCons x 0))).1 = q (b v x).1 + rw [diskTail_cons] + · let s : Sphere (n+1) := ⟨_,cons_one_mem_sphere x⟩ + have hs : s ∈ cylinderFace n (some true) := by + change (diskCons x 1).1 0 = 1; norm_num [diskCons] + change F (v,diskCons x 1) = q (b v x).2 + rw [show diskCons x 1 = boundary (n+1) s from rfl,hF] + change q (cylinderBoundaryMap (a v) (b v) (h v) s) = _ + rw [cylinderBoundaryMap_face (a v) (b v) (h v) (some true) ⟨s,hs⟩] + change q (b v (diskTail (diskCons x 1))).2 = q (b v x).2 + rw [diskTail_cons] +end + +section +open Set Metric Topology +open scoped unitInterval +universe u v w +variable {X : Type u} [TopologicalSpace X] {Y : Type v} [TopologicalSpace Y] + {Z : Type w} [TopologicalSpace Z] +lemma family_square_filling {n : ℕ} (q : C(Y,Z)) (z : Z) (H : q.Homotopy (.const _ z)) + (a : C(X,C(Sphere n,C(I,C(I,Y))))) + (b c : C(X,C(Disk n,C(I,Y) × C(I,Y)))) + (hs : ∀ v x,pathEndpoint (a v x) = b v (boundary n x)) + (ht : ∀ v x s,pathEndpoint (a v x s) = ((c v (boundary n x)).1 s,(c v (boundary n x)).2 s)) + (h0 : ∀ v x,pathEndpoint ((b v x).1) = ((c v x).1 0,(c v x).2 0)) + (h1 : ∀ v x,pathEndpoint ((b v x).2) = ((c v x).1 1,(c v x).2 1)) : + ∃ e : C(X,C(Disk n,C(I,C(I,Z)))), + (∀ v x s t,e v (boundary n x) s t = q (a v x s t)) ∧ + (∀ v x t,e v x 0 t = q ((b v x).1 t)) ∧ + (∀ v x t,e v x 1 t = q ((b v x).2 t)) ∧ + (∀ v x s,e v x s 0 = q ((c v x).1 s)) ∧ + (∀ v x s,e v x s 1 = q ((c v x).2 s)) := by + let A : C(X,C(Sphere (n+1),C(I,Y))) := ContinuousMap.curry ⟨_,familyCylinder_continuous a b hs⟩ + let B : C(X,C(Disk (n+1),Y × Y)) := ContinuousMap.curry + ⟨fun p => ((c p.1 (diskTail p.2)).1 (diskTime p.2),(c p.1 (diskTail p.2)).2 (diskTime p.2)),by + have hc : Continuous (fun p : X × Disk (n+1) => c p.1 (diskTail p.2)) := + continuous_eval.comp ((c.continuous.comp continuous_fst).prodMk (continuous_diskTail.comp continuous_snd)) + exact (continuous_eval.comp ((continuous_fst.comp hc).prodMk (continuous_diskTime.comp continuous_snd))).prodMk + (continuous_eval.comp ((continuous_snd.comp hc).prodMk (continuous_diskTime.comp continuous_snd)))⟩ + have hAB : ∀ v x,pathEndpoint (A v x) = B v (boundary (n+1) x) := by + intro v x + rcases sphere_split x with hx|hx|hx + · have hx' : x ∈ cylinderFace n (some false) := hx + rw [show A v x = faceMap (a v) (b v) (some false) ⟨x,hx'⟩ from + cylinderBoundaryMap_face (a v) (b v) (hs v) (some false) ⟨x,hx'⟩] + change pathEndpoint ((b v (diskTail (boundary (n+1) x))).1) = + ((c v (diskTail (boundary (n+1) x))).1 (diskTime (boundary (n+1) x)), + (c v (diskTail (boundary (n+1) x))).2 (diskTime (boundary (n+1) x))) + rw [faceTime_eq_zero x hx]; exact h0 v _ + · have hx' : x ∈ cylinderFace n (some true) := hx + rw [show A v x = faceMap (a v) (b v) (some true) ⟨x,hx'⟩ from + cylinderBoundaryMap_face (a v) (b v) (hs v) (some true) ⟨x,hx'⟩] + change pathEndpoint ((b v (diskTail (boundary (n+1) x))).2) = + ((c v (diskTail (boundary (n+1) x))).1 (diskTime (boundary (n+1) x)), + (c v (diskTail (boundary (n+1) x))).2 (diskTime (boundary (n+1) x))) + rw [faceTime_eq_one x hx]; exact h1 v _ + · have hx' : x ∈ cylinderFace n none := hx + rw [show A v x = faceMap (a v) (b v) none ⟨x,hx'⟩ from + cylinderBoundaryMap_face (a v) (b v) (hs v) none ⟨x,hx'⟩] + exact ht v (faceSphere ⟨x,hx'⟩) (faceTime none ⟨x,hx'⟩) + obtain ⟨d,hd,hp⟩ := family_cylinder_filling q z H A B hAB + let e : C(X,C(Disk n,C(I,C(I,Z)))) := + (ContinuousMap.mk (fun p : (X × Disk n) × I => d p.1.1 (diskCons p.1.2 p.2)) + (continuous_eval.comp ((d.continuous.comp continuous_fst.fst).prodMk + (continuous_diskCons.comp (continuous_fst.snd.prodMk continuous_snd))))).curry.curry + refine ⟨e,?_,?_,?_,?_,?_⟩ + · intro v x s t + let z' : Sphere (n+1) := ⟨_,cons_mem_sphere_of_boundary x s⟩ + have hz : z' ∈ cylinderFace n none := by + change (diskTail (diskCons (boundary n x) s)).1 ∈ sphere 0 1 + rw [diskTail_cons]; exact x.2 + change d v (diskCons (boundary n x) s) t = q (a v x s t) + rw [show diskCons (boundary n x) s = boundary (n+1) z' from rfl,hd] + rw [show A v z' = faceMap (a v) (b v) none ⟨z',hz⟩ from + cylinderBoundaryMap_face (a v) (b v) (hs v) none ⟨z',hz⟩] + change q (a v (faceSphere ⟨z',hz⟩) (diskTime (diskCons (boundary n x) s)) t) = _ + rw [diskTime_cons]; congr 2 + · intro v x t + let z' : Sphere (n+1) := ⟨_,cons_zero_mem_sphere x⟩ + have hz : z' ∈ cylinderFace n (some false) := by + change (diskCons x 0).1 0 = -1; norm_num [diskCons] + change d v (diskCons x 0) t = q ((b v x).1 t) + rw [show diskCons x 0 = boundary (n+1) z' from rfl,hd] + rw [show A v z' = faceMap (a v) (b v) (some false) ⟨z',hz⟩ from + cylinderBoundaryMap_face (a v) (b v) (hs v) (some false) ⟨z',hz⟩] + change q ((b v (diskTail (diskCons x 0))).1 t) = _ + rw [diskTail_cons] + · intro v x t + let z' : Sphere (n+1) := ⟨_,cons_one_mem_sphere x⟩ + have hz : z' ∈ cylinderFace n (some true) := by + change (diskCons x 1).1 0 = 1; norm_num [diskCons] + change d v (diskCons x 1) t = q ((b v x).2 t) + rw [show diskCons x 1 = boundary (n+1) z' from rfl,hd] + rw [show A v z' = faceMap (a v) (b v) (some true) ⟨z',hz⟩ from + cylinderBoundaryMap_face (a v) (b v) (hs v) (some true) ⟨z',hz⟩] + change q ((b v (diskTail (diskCons x 1))).2 t) = _ + rw [diskTail_cons] + · intro v x s + have h := congrArg Prod.fst (hp v (diskCons x s)) + change d v (diskCons x s) 0 = _ + simpa only [pathEndpoint,ContinuousMap.coe_mk,B,ContinuousMap.curry_apply, + diskTail_cons,diskTime_cons] using h + · intro v x s + have h := congrArg Prod.snd (hp v (diskCons x s)) + change d v (diskCons x s) 1 = _ + simpa only [pathEndpoint,ContinuousMap.coe_mk,B,ContinuousMap.curry_apply, + diskTail_cons,diskTime_cons] using h + +lemma SquareBoundary.fill_after_nullhomotopy (D : SquareBoundary X Y) + (q : C(Y,Z)) (z : Z) (H : q.Homotopy (.const _ z)) : + ∃ Q : C(X,C(I,C(I,Z))), + (∀ x t,Q x 0 t = q ((D.b x).1 t)) ∧ + (∀ x t,Q x 1 t = q ((D.b x).2 t)) ∧ + (∀ x s,Q x s 0 = q ((D.c x).1 s)) ∧ + (∀ x s,Q x s 1 = q ((D.c x).2 s)) := by + let : IsEmpty (Sphere 0) := ⟨fun x => by + have hx : x.1 = 0 := Subsingleton.elim _ _ + have h := x.2 + change ‖x.1‖ = 1 at h + rw [hx,norm_zero] at h + exact zero_ne_one h⟩ + let a : C(X,C(Sphere 0,C(I,C(I,Y)))) := .const _ ⟨isEmptyElim,continuous_of_discreteTopology⟩ + let b : C(X,C(Disk 0,C(I,Y) × C(I,Y))) := ContinuousMap.curry (D.b.comp .fst) + let c : C(X,C(Disk 0,C(I,Y) × C(I,Y))) := ContinuousMap.curry (D.c.comp .fst) + obtain ⟨e,_,h0,h1,h2,h3⟩ := family_square_filling q z H a b c (fun _ x => isEmptyElim x) + (fun _ x => isEmptyElim x) (fun x _ => D.zero x) (fun x _ => D.one x) + let x0 : Disk 0 := ⟨0,by simp⟩ + exact ⟨⟨fun x => e x x0,(continuous_eval_const x0).comp e.continuous⟩, + fun x t => h0 x x0 t,fun x t => h1 x x0 t,fun x s => h2 x x0 s,fun x s => h3 x x0 s⟩ +end + +open Set Topology +open scoped unitInterval +universe u v w +variable {X : Type u} [TopologicalSpace X] {Y : Type v} [TopologicalSpace Y] + {Z : Type w} [TopologicalSpace Z] +variable (a b : C(I × X,Y)) (A B : Y) +variable (h0 : ∀ x,a (0,x) = b (0,x)) (ha : ∀ x,a (1,x) = A) (hb : ∀ x,b (1,x) = B) + +def contractionPath (a : C(I × X,Y)) (A : Y) (ha : ∀ x,a (1,x) = A) (x : X) : Path (a (0,x)) A := + { toFun t := a (t,x) + continuous_toFun := a.continuous.comp (continuous_id.prodMk continuous_const) + source' := rfl + target' := ha x } + +def connectorTop (x : X) : Path A B := + (contractionPath a A ha x).symm.trans ((contractionPath b B hb x).cast (h0 x) rfl) + +def connectorSquare (x0 : X) : SquareBoundary X Y where + b := (ContinuousMap.curry ((a.comp ⟨fun x => (0,x),continuous_const.prodMk continuous_id⟩).comp .fst)).prodMk + (.const _ (connectorTop a b A B h0 ha hb x0).toContinuousMap) + c := (ContinuousMap.curry (a.comp ⟨Prod.swap,continuous_swap⟩)).prodMk + (ContinuousMap.curry (b.comp ⟨Prod.swap,continuous_swap⟩)) + zero x := Prod.ext rfl (h0 x) + one x := Prod.ext ((connectorTop a b A B h0 ha hb x0).source.trans (ha x).symm) + ((connectorTop a b A B h0 ha hb x0).target.trans (hb x).symm) + +include h0 ha hb in + +lemma connector_after_nullhomotopy (x0 : X) (q : C(Y,Z)) (z : Z) + (H : q.Homotopy (.const _ z)) : + ∃ (P : Path A B) (Q : C(X,C(I,C(I,Z)))), + (∀ x t,Q x 0 t = q (a (0,x))) ∧ + (∀ x t,Q x 1 t = q (P t)) ∧ + (∀ x s,Q x s 0 = q (a (s,x))) ∧ + (∀ x s,Q x s 1 = q (b (s,x))) := by + obtain ⟨Q,hQ0,hQ1,hQ2,hQ3⟩ := (connectorSquare a b A B h0 ha hb x0).fill_after_nullhomotopy q z H + exact ⟨connectorTop a b A B h0 ha hb x0,Q,hQ0,hQ1,hQ2,hQ3⟩ +end UniversalFInfinity.Cellular + +end + +end OAI diff --git a/lean/OAI/GroupTheory/UniversalGroup/ControlledHomotopies.lean b/lean/OAI/GroupTheory/UniversalGroup/ControlledHomotopies.lean new file mode 100644 index 0000000000000000000000000000000000000000..2abadd0a8316efc83f4683b339674166cb2193a8 --- /dev/null +++ b/lean/OAI/GroupTheory/UniversalGroup/ControlledHomotopies.lean @@ -0,0 +1,195 @@ +import OAI.GroupTheory.UniversalGroup.Idempotents + +namespace OAI + +noncomputable section + +open Set Metric Topology BigOperators +open Set Metric Topology +open Set Topology +open Set Metric Topology +open scoped NNReal +open Set Metric Topology +open scoped NNReal ENNReal +open Set Metric Topology +open scoped TensorProduct + +namespace UniversalFInfinity.Milnor +open Set Metric Topology BigOperators UniversalFInfinity.Simplicial ConcreteEnvelopes +open scoped Classical Topology.Homotopy +variable {G H : Type} [Group G] [Group H] +variable (N : Type*) [DecidableEq N] [Nontrivial N] +local instance (priority := 2000) (α : Type*) : DecidableEq (ℕ × α) := Classical.decEq (ℕ × α) + +lemma diagramValue_one (k : Index → G →* H) (hk : IsDiagram k) (S : Shapes G) : + mapValue N (k (.inl P₂.identity)) id S rfl Function.injective_id = 1 := by + let z : Index → Additive (ControlledValues H N (StagePi G N S)) := + fun E => Additive.ofMul (mapValue N (k E) id S rfl Function.injective_id) + have hc : z (.inl P₂.identity) = z (.inr P₃.identity) := by + simp only [z,hk.common] + have hs : ∀ t : triples, z t.val.2.2 = z t.val.1 + z t.val.2.1 := by + intro t + have he : k t.val.2.2 = commutingProduct (k t.val.1) (k t.val.2.1) (hk.commute t) := by + ext g + exact hk.sum t g + change mapValue N (k t.val.2.2) id S rfl Function.injective_id = _ + rw [he] + exact mapValue_product N (k t.val.1) (k t.val.2.1) (hk.commute t) S + exact congrArg Additive.toMul (coprime_annihilation z hc hs) + +theorem diagram_uniform_homotopy_killing (k : Index → G →* H) (hk : IsDiagram k) (S : Shapes G) : + ∃ T : Shapes H, ∃ h : imageShapes (k (.inl P₂.identity)) id (basedShapes G S) ⊆ T, + (stageHom H N _ T h).comp + (stageMapHom N (k (.inl P₂.identity)) id S _ + (image_stage_valid (k (.inl P₂.identity)) id S Function.injective_id) rfl) = 1 := by + exact (value_eq_one_iff H N (StagePi G N S) _ _).mp (diagramValue_one N k hk S) +end UniversalFInfinity.Milnor + +namespace UniversalFInfinity.Cellular +open Set Metric Topology +universe u v w +variable {Y : Type v} {Z : Type w} [TopologicalSpace Y] [TopologicalSpace Z] + +def KillsSpheres (q : C(Y,Z)) (n : ℕ) : Prop := + ∀ a : C(Sphere n,Y), ∃ F : C(Disk n,Z), ∀ x, F (boundary n x) = q (a x) + +lemma cylinder_filling_after {n : ℕ} (q : C(Y,Z)) (hq : KillsSpheres q (n+1)) + (a : C(Sphere n,C(unitInterval,Y))) (b : C(Disk n,Y × Y)) + (h : ∀ x, pathEndpoint (a x) = b (boundary n x)) : + ∃ e : C(Disk n,C(unitInterval,Z)), + (∀ x t, e (boundary n x) t = q (a x t)) ∧ + ∀ x, pathEndpoint (e x) = (q (b x).1,q (b x).2) := by + obtain ⟨F,hF⟩ := hq (cylinderBoundaryMap a b h) + let e : C(Disk n,C(unitInterval,Z)) := + (F.comp ⟨fun p : Disk n × unitInterval => diskCons p.1 p.2,continuous_diskCons⟩).curry + refine ⟨e,?_,?_⟩ + · intro x t + let s : Sphere (n+1) := ⟨_,cons_mem_sphere_of_boundary x t⟩ + have hs : s ∈ cylinderFace n none := by + change (diskTail (diskCons (boundary n x) t)).1 ∈ sphere 0 1 + rw [diskTail_cons] + exact x.2 + change F (diskCons (boundary n x) t) = q (a x t) + rw [show diskCons (boundary n x) t = boundary (n+1) s from rfl,hF, + cylinderBoundaryMap_face a b h none ⟨s,hs⟩] + change q (a (faceSphere ⟨s,hs⟩) (diskTime (diskCons (boundary n x) t))) = q (a x t) + rw [diskTime_cons] + congr 2 + · intro x + apply Prod.ext + · let s : Sphere (n+1) := ⟨_,cons_zero_mem_sphere x⟩ + have hs : s ∈ cylinderFace n (some false) := by + change (diskCons x 0).1 0 = -1 + norm_num [diskCons] + change F (diskCons x 0) = q (b x).1 + rw [show diskCons x 0 = boundary (n+1) s from rfl,hF, + cylinderBoundaryMap_face a b h (some false) ⟨s,hs⟩] + change q (b (diskTail (diskCons x 0))).1 = q (b x).1 + rw [diskTail_cons] + · let s : Sphere (n+1) := ⟨_,cons_one_mem_sphere x⟩ + have hs : s ∈ cylinderFace n (some true) := by + change (diskCons x 1).1 0 = 1 + norm_num [diskCons] + change F (diskCons x 1) = q (b x).2 + rw [show diskCons x 1 = boundary (n+1) s from rfl,hF, + cylinderBoundaryMap_face a b h (some true) ⟨s,hs⟩] + change q (b (diskTail (diskCons x 1))).2 = q (b x).2 + rw [diskTail_cons] + +variable {X : Type u} [TopologicalSpace X] [T2Space X] +variable {C : Set X} [CWComplex C] + +structure PartialHomotopy (f g : C(X,Y)) (n : ℕ) where + val : X → C(unitInterval,Y) + continuousOn : ContinuousOn val (Skeleton C n) + zero : ∀ x ∈ Skeleton C n, val x 0 = f x + one : ∀ x ∈ Skeleton C n, val x 1 = g x + +namespace PartialHomotopy +variable {f g : C(X,Y)} {n : ℕ} + +def onSphere (a : PartialHomotopy (C := C) f g n) (i : RelCWComplex.cell C n) : + C(Sphere n,C(unitInterval,Y)) := + ⟨fun x => a.val (characteristic n i (boundary n x)), + a.continuousOn.comp_continuous ((characteristic n i).continuous.comp (continuous_boundary n)) + (sphere_mem_skeleton n i)⟩ + +def endpoints (i : RelCWComplex.cell C n) : C(Disk n,Y × Y) := + ⟨fun x => (f (characteristic n i x),g (characteristic n i x)), + (f.continuous.comp (characteristic n i).continuous).prodMk + (g.continuous.comp (characteristic n i).continuous)⟩ + +lemma endpoints_compatible (a : PartialHomotopy (C := C) f g n) + (i : RelCWComplex.cell C n) (x : Sphere n) : + pathEndpoint (a.onSphere i x) = endpoints (f := f) (g := g) i (boundary n x) := + Prod.ext (a.zero _ (sphere_mem_skeleton n i x)) (a.one _ (sphere_mem_skeleton n i x)) + +lemma cell_extension_after (a : PartialHomotopy (C := C) f g n) + (q : C(Y,Z)) (hq : KillsSpheres q (n+1)) (i : RelCWComplex.cell C n) : + ∃ e : C(Disk n,C(unitInterval,Z)), + (∀ x, e (boundary n x) = q.comp (a.val (characteristic n i (boundary n x)))) ∧ + (∀ x, e x 0 = q (f (characteristic n i x))) ∧ + (∀ x, e x 1 = q (g (characteristic n i x))) := by + obtain ⟨e,he,hp⟩ := cylinder_filling_after q hq (a.onSphere i) (endpoints i) + (a.endpoints_compatible i) + exact ⟨e,fun x => ContinuousMap.ext (he x),fun x => congrArg Prod.fst (hp x), + fun x => congrArg Prod.snd (hp x)⟩ + +def next (a : PartialHomotopy (C := C) f g n) + (q : C(Y,Z)) (hq : KillsSpheres q (n+1)) : + PartialHomotopy (C := C) (q.comp f) (q.comp g) (n+1) := by + let e := fun i => (a.cell_extension_after q hq i).choose + have hb : ∀ i x, e i (boundary n x) = + q.comp (a.val (characteristic n i (boundary n x))) := + fun i => (a.cell_extension_after q hq i).choose_spec.1 + have hz := fun i => (a.cell_extension_after q hq i).choose_spec.2.1 + have ho := fun i => (a.cell_extension_after q hq i).choose_spec.2.2 + let v : X → C(unitInterval,Z) := fun x => q.comp (a.val x) + have hv : ContinuousOn v (Skeleton C n) := + (ContinuousMap.continuous_postcomp q).comp_continuousOn a.continuousOn + refine ⟨attachValue v e,attachValue_continuous v hv e hb,?_,?_⟩ + all_goals + intro x hx + have heq : Skeleton C (n+1) = Skeleton C n ∪ + ⋃ i : RelCWComplex.cell C n, CWComplex.closedCell n i := by + simpa only [Skeleton,Nat.cast_add,Nat.cast_one] using + (CWComplex.skeletonLT_union_iUnion_closedCell_eq_skeletonLT_succ (C := C) n).symm + rw [heq] at hx + rcases hx with hx | hx + · rw [attachValue_old v e hx] + first + | exact congrArg q (a.zero x hx) + | exact congrArg q (a.one x hx) + · obtain ⟨i,y,hy,rfl⟩ := Set.mem_iUnion.mp hx + rw [show RelCWComplex.map n i y = characteristic n i ⟨y,hy⟩ from rfl, + attachValue_characteristic v e hb] + first | exact hz i ⟨y,hy⟩ | exact ho i ⟨y,hy⟩ + +def start (f g : C(X,Y)) : PartialHomotopy (C := C) f g 0 where + val := fun x => ContinuousMap.const _ (f x) + continuousOn := by + rw [Skeleton,Nat.cast_zero,CWComplex.skeletonLT_zero_eq_empty] + exact continuousOn_empty _ + zero := by intro x _; rfl + one := by + intro x hx + simp only [Skeleton,Nat.cast_zero,CWComplex.skeletonLT_zero_eq_empty,Set.mem_empty_iff_false] at hx + +def toHomotopy [CWComplex (Set.univ : Set X)] (a : PartialHomotopy (C := (Set.univ : Set X)) f g n) + (hdim : Skeleton (Set.univ : Set X) n = Set.univ) : f.Homotopy g where + toFun p := a.val p.2 p.1 + continuous_toFun := by + have hv : Continuous a.val := by + have hh := a.continuousOn + rw [hdim] at hh + exact continuousOn_univ.mp hh + exact continuous_eval.comp ((hv.comp continuous_snd).prodMk continuous_fst) + map_zero_left x := a.zero x (hdim.symm ▸ Set.mem_univ x) + map_one_left x := a.one x (hdim.symm ▸ Set.mem_univ x) + +end PartialHomotopy +end UniversalFInfinity.Cellular + +end + +end OAI diff --git a/lean/OAI/GroupTheory/UniversalGroup/CoveringAttachments.lean b/lean/OAI/GroupTheory/UniversalGroup/CoveringAttachments.lean new file mode 100644 index 0000000000000000000000000000000000000000..7585f4bf51cf07251807b093b73187dd88d314e5 --- /dev/null +++ b/lean/OAI/GroupTheory/UniversalGroup/CoveringAttachments.lean @@ -0,0 +1,489 @@ +import OAI.GroupTheory.UniversalGroup.PathExtensions + +namespace OAI + +noncomputable section + +open Set Metric Topology BigOperators +open Set Metric Topology + +namespace UniversalFInfinity.Milnor +open Set Metric Topology Attachment +universe u +variable {G : Type u} [Group G] [TopologicalSpace G] [DiscreteTopology G] +variable {A : Type u} (s : A → G) + +omit [DiscreteTopology G] in +lemma group_compactFundamentalSet : CompactFundamentalSet G (X := G) := by + refine ⟨{1},isCompact_singleton,?_⟩ + intro g + exact ⟨g,1,Set.mem_singleton _,by simp only [smul_eq_mul,mul_one]⟩ + +lemma graph_compactFundamentalSet [Finite A] : CompactFundamentalSet G (X := Cayley.Graph s) := + Attachment.compactFundamentalSet (Cayley.attaching s) group_compactFundamentalSet + +variable (rels : Set (FreeGroup A)) (hrel : ∀ r ∈ rels, FreeGroup.lift s r = 1) +lemma presentation_compactFundamentalSet [Finite A] (hrels : rels.Finite) : + CompactFundamentalSet G (X := Cayley.PresentationCover s rels hrel) := by + let := hrels.to_subtype + exact Attachment.compactFundamentalSet (Cayley.relatorAttaching s rels hrel) + (graph_compactFundamentalSet s) + +lemma presentation_equivariant_map : + ∃ f : C(Cayley.PresentationCover s rels hrel,Space G), + ∀ (g : G) x, f (g • x) = g • f x := by + let f₀ : C(G,Space G) := ⟨fun g => g • vertex (0,1),continuous_of_discreteTopology⟩ + have hf₀ (g h : G) : f₀ (g • h) = g • f₀ h := mul_smul g h _ + obtain ⟨f₁,_,hf₁⟩ := Attachment.exists_equivariant_extension (Cayley.attaching s) f₀ hf₀ + (sphereFillable (1:G)) + obtain ⟨f₂,_,hf₂⟩ := Attachment.exists_equivariant_extension (Cayley.relatorAttaching s rels hrel) + f₁ hf₁ (sphereFillable (1:G)) + exact ⟨f₂,hf₂⟩ + +include hrel in + +lemma exists_stage_section [Finite A] (hrels : rels.Finite) + (hs : Function.Surjective (FreeGroup.lift s)) + (hker : (FreeGroup.lift s).ker = Subgroup.normalClosure rels) : + ∃ (S : Shapes G) (x : Stage G S) (τ : G →* PathExtension.Extension G x), ∀ g, (τ g).1 = g := by + obtain ⟨f,hf⟩ := presentation_equivariant_map s rels hrel + obtain ⟨S,hS⟩ := equivariant_controlled G (presentation_compactFundamentalSet s rels hrel hrels) f hf + let F := factorStage G f S hS + have hF : ∀ (g : G) x, F (g • x) = g • F x := factorStage_smul G f S hS hf + let x := Cayley.presentationBase s rels hrel (Cayley.vertex s 1) + let τ := (PathExtension.map F hF x).comp (Cayley.presentationSection s rels hrel hs hker) + refine ⟨S,F x,τ,?_⟩ + intro g + exact Cayley.presentationSection_fst s rels hrel hs hker g +end UniversalFInfinity.Milnor + +namespace UniversalFInfinity.Attachment +open Set Metric Topology +variable {X : Type*} [TopologicalSpace X] {ι : Type*} {n : ℕ} +variable (a : ι → C(Sphere n,X)) + +def cellCenter (i : ι) : Space a := openCell a i ⟨0,by simp⟩ +def punctured : Set (Space a) := (Set.range (cellCenter a))ᶜ + +def rawCoordinate : Space a → (Fin n → ℝ) + | Sum.inl _ => 0 | Sum.inr p => p.2.1 + +lemma base_mem_punctured (x : X) : base a x ∈ punctured a := by + rintro ⟨i,h⟩ + cases h + +lemma cell_mem_punctured (i : ι) (d : Disk n) : cell a i d ∈ punctured a ↔ d.1 ≠ 0 := by + classical + constructor + · intro hd hzero + apply hd + refine ⟨i,?_⟩ + have heq : d = interior n ⟨0,by simp⟩ := Subtype.ext hzero + rw [heq,cell_interior] + rfl + · intro hzero + rintro ⟨j,hj⟩ + by_cases h : d.1 ∈ ball (0 : Fin n → ℝ) 1 + · have heq : d = interior n ⟨d.1,h⟩ := rfl + rw [heq,cell_interior] at hj + exact hzero (congrArg (rawCoordinate a) hj).symm + · let s : Sphere n := ⟨d.1,by + have hd := d.2 + simp only [mem_sphere,mem_ball,mem_closedBall] at * + exact le_antisymm hd (le_of_not_gt h)⟩ + have heq : d = boundary n s := rfl + rw [heq,cell_boundary] at hj + cases hj + +lemma punctured_open : IsOpen (punctured a) := by + change IsOpen (Set.range (cellCenter a))ᶜ + rw [isOpen_compl_iff] + rw [isClosed_iff] + constructor + · have h : base a ⁻¹' Set.range (cellCenter a) = ∅ := by + ext x + simp only [mem_preimage,mem_empty_iff_false,iff_false] + exact base_mem_punctured a x + rw [h] + exact isClosed_empty + · intro i + have h : cell a i ⁻¹' Set.range (cellCenter a) = {d : Disk n | d.1 = 0} := by + ext d + exact not_iff_not.mp (cell_mem_punctured a i d) + rw [h] + exact isClosed_eq continuous_subtype_val continuous_const + +lemma continuous_punctured {Y : Type*} [TopologicalSpace Y] (F : punctured a → Y) + (hb : Continuous (fun x : X => F ⟨base a x,base_mem_punctured a x⟩)) + (hc : ∀ i, Continuous (fun d : {d : Disk n // d.1 ≠ 0} => + F ⟨cell a i d.1,(cell_mem_punctured a i d.1).mpr d.2⟩)) : Continuous F := by + let q := quotient a + have hq : IsQuotientMap q := ⟨⟨rfl⟩,quotient_surjective a⟩ + have hp := hq.restrictPreimage_isOpen (punctured_open a) + apply hp.continuous_iff.mpr + apply continuous_iff_continuousAt.mpr + rintro ⟨z,hz⟩ + cases z with + | inl x => + let e : X → q ⁻¹' punctured a := fun x => ⟨Sum.inl x,base_mem_punctured a x⟩ + have he : IsOpenEmbedding e := by + have hi : IsOpenEmbedding (Sum.inl : X → X ⊕ (Σ _ : ι, Disk n)) := .inl + exact ⟨hi.isEmbedding.codRestrict (q ⁻¹' punctured a) (fun x => base_mem_punctured a x),by + have hr : Set.range e = Subtype.val ⁻¹' Set.range Sum.inl := by + ext z + simp only [mem_range,mem_preimage,e] + constructor + · rintro ⟨x,rfl⟩; exact ⟨x,rfl⟩ + · rintro ⟨x,hx⟩; exact ⟨x,Subtype.ext hx⟩ + rw [hr] + exact hi.isOpen_range.preimage continuous_subtype_val⟩ + exact (he.continuousAt_iff (g := F ∘ (punctured a).restrictPreimage q)).mp (hb.continuousAt (x := x)) + | inr p => + rcases p with ⟨i,d⟩ + have hd : d.1 ≠ 0 := (cell_mem_punctured a i d).mp hz + let e : {d : Disk n // d.1 ≠ 0} → q ⁻¹' punctured a := + fun d => ⟨Sum.inr ⟨i,d.1⟩,(cell_mem_punctured a i d.1).mpr d.2⟩ + have he : IsOpenEmbedding e := by + have hi : IsOpenEmbedding (fun d : Disk n => (Sum.inr ⟨i,d⟩ : X ⊕ (Σ _ : ι, Disk n))) := + IsOpenEmbedding.inr.comp IsOpenEmbedding.sigmaMk + exact hi.restrict (fun d hd => (cell_mem_punctured a i d).mpr hd) + (isClosed_eq continuous_subtype_val continuous_const).isOpen_compl + have hc' : ContinuousAt ((F ∘ (punctured a).restrictPreimage q) ∘ e) ⟨d,hd⟩ := by + change ContinuousAt (fun d : {d : Disk n // d.1 ≠ 0} => + F ⟨cell a i d.1,(cell_mem_punctured a i d.1).mpr d.2⟩) ⟨d,hd⟩ + exact (hc i).continuousAt + have result := (he.continuousAt_iff (g := F ∘ (punctured a).restrictPreimage q)).mp hc' + exact result + +abbrev PuncturedDisk (n : ℕ) := {d : Disk n // d.1 ≠ 0} + +def puncturedBoundary (x : Sphere n) : PuncturedDisk n := + ⟨boundary n x,by + intro h + change x.1 = 0 at h + have hx := x.2 + simp only [mem_sphere,dist_zero_right] at hx + rw [h,norm_zero] at hx + norm_num at hx⟩ + +def puncturedCell (i : ι) (d : PuncturedDisk n) : punctured a := + ⟨cell a i d.1,(cell_mem_punctured a i d.1).mpr d.2⟩ + +def puncturedBase (x : X) : punctured a := ⟨base a x,base_mem_punctured a x⟩ + +lemma puncturedCell_boundary (i : ι) (x : Sphere n) : + puncturedCell a i (puncturedBoundary x) = puncturedBase a (a i x) := + Subtype.ext (cell_boundary a i x) + +noncomputable def puncturedLift {Y : Type*} [TopologicalSpace Y] (f : C(X,Y)) + (g : ι → C(PuncturedDisk n,Y)) + (h : ∀ i x, g i (puncturedBoundary x) = f (a i x)) : C(punctured a,Y) := by + classical + let F : punctured a → Y := fun z => match heq : z.1 with + | Sum.inl x => f x + | Sum.inr p => g p.1 ⟨interior n p.2,by + exact (cell_mem_punctured a p.1 (interior n p.2)).mp + (by simpa only [cell_interior,← heq] using z.2)⟩ + have hcell (i : ι) : F ∘ puncturedCell a i = g i := by + funext d + by_cases hd : d.1.1 ∈ ball (0 : Fin n → ℝ) 1 + · have heq : d.1 = interior n ⟨d.1.1,hd⟩ := rfl + change F ⟨cell a i d.1,_⟩ = g i d + have hc : cell a i d.1 = Sum.inr ⟨i,⟨d.1.1,hd⟩⟩ := (congrArg (cell a i) heq).trans (cell_interior a i ⟨d.1.1,hd⟩) + simp only [hc,F] + exact congrArg (g i) (Subtype.ext (Subtype.ext rfl)) + · let x : Sphere n := ⟨d.1.1,by + have hm := d.1.2 + simp only [mem_closedBall,mem_ball,mem_sphere] at * + exact le_antisymm hm (le_of_not_gt hd)⟩ + have heq : d.1 = boundary n x := rfl + change F ⟨cell a i d.1,_⟩ = g i d + have hc : cell a i d.1 = base a (a i x) := (congrArg (cell a i) heq).trans (cell_boundary a i x) + simp only [hc,base,F] + exact (h i x).symm.trans (congrArg (g i) (Subtype.ext (Subtype.ext rfl))) + exact ⟨F,continuous_punctured a F f.continuous (fun i => by + change Continuous (F ∘ puncturedCell a i) + rw [hcell] + exact (g i).continuous)⟩ + +@[simp] lemma puncturedLift_base {Y : Type*} [TopologicalSpace Y] (f : C(X,Y)) + (g : ι → C(PuncturedDisk n,Y)) + (h : ∀ i x, g i (puncturedBoundary x) = f (a i x)) (x : X) : + puncturedLift a f g h (puncturedBase a x) = f x := rfl + +@[simp] lemma puncturedLift_cell {Y : Type*} [TopologicalSpace Y] (f : C(X,Y)) + (g : ι → C(PuncturedDisk n,Y)) + (h : ∀ i x, g i (puncturedBoundary x) = f (a i x)) + (i : ι) (d : PuncturedDisk n) : + puncturedLift a f g h (puncturedCell a i d) = g i d := by + classical + by_cases hd : d.1.1 ∈ ball (0 : Fin n → ℝ) 1 + · have heq : d.1 = interior n ⟨d.1.1,hd⟩ := rfl + change puncturedLift a f g h ⟨cell a i d.1,_⟩ = _ + have hc : cell a i d.1 = Sum.inr ⟨i,⟨d.1.1,hd⟩⟩ := (congrArg (cell a i) heq).trans (cell_interior a i ⟨d.1.1,hd⟩) + simp only [hc,puncturedLift,ContinuousMap.coe_mk] + exact congrArg (g i) (Subtype.ext (Subtype.ext rfl)) + · let x : Sphere n := ⟨d.1.1,by + have hm := d.1.2 + simp only [mem_closedBall,mem_ball,mem_sphere] at * + exact le_antisymm hm (le_of_not_gt hd)⟩ + have hd : d = puncturedBoundary x := rfl + rw [hd,puncturedCell_boundary,puncturedLift_base,h] + +lemma punctured_surjective (z : punctured a) : + (∃ x, z = puncturedBase a x) ∨ ∃ i d, z = puncturedCell a i d := by + cases heq : z.1 with + | inl x => exact Or.inl ⟨x,Subtype.ext heq⟩ + | inr p => + have hd : p.2.1 ≠ 0 := (cell_mem_punctured a p.1 (interior n p.2)).mp + (by simpa only [cell_interior,← heq] using z.2) + exact Or.inr ⟨p.1,⟨interior n p.2,hd⟩,Subtype.ext (heq.trans (cell_interior a p.1 p.2).symm)⟩ + +def radialSphere : C(PuncturedDisk n,Sphere n) := by + have hm (d : PuncturedDisk n) : ‖d.1.1‖⁻¹ • d.1.1 ∈ sphere (0 : Fin n → ℝ) 1 := by + simp only [mem_sphere,dist_zero_right,norm_smul,Real.norm_eq_abs,abs_inv, + abs_norm,inv_mul_cancel₀ (norm_ne_zero_iff.mpr d.2)] + refine ⟨fun d => ⟨‖d.1.1‖⁻¹ • d.1.1,hm d⟩,?_⟩ + exact (((continuous_subtype_val.comp continuous_subtype_val).norm.inv₀ + (fun d : PuncturedDisk n => norm_ne_zero_iff.mpr d.2)).smul + (continuous_subtype_val.comp continuous_subtype_val)).subtype_mk hm + +@[simp] lemma radialSphere_boundary (x : Sphere n) : radialSphere (puncturedBoundary x) = x := by + apply Subtype.ext + have hx : ‖x.1‖ = 1 := by simpa only [mem_sphere,dist_zero_right] using x.2 + change ‖x.1‖⁻¹ • x.1 = x.1 + rw [hx,inv_one,one_smul] + +def radialDisk : C(unitInterval × PuncturedDisk n,Disk n) := by + let f (p : unitInterval × PuncturedDisk n) := + (1-(p.1:ℝ)) • p.2.1.1 + (p.1:ℝ) • (radialSphere p.2).1 + have hm (p : unitInterval × PuncturedDisk n) : f p ∈ closedBall (0 : Fin n → ℝ) 1 := + (convex_closedBall (0 : Fin n → ℝ) 1) p.2.1.2 + (sphere_subset_closedBall (radialSphere p.2).2) + (sub_nonneg.mpr p.1.2.2) p.1.2.1 (by ring) + have hc : Continuous f := + ((continuous_const.sub (continuous_subtype_val.comp continuous_fst)).smul + (continuous_subtype_val.comp (continuous_subtype_val.comp continuous_snd))).add + ((continuous_subtype_val.comp continuous_fst).smul + (continuous_subtype_val.comp (radialSphere.continuous.comp continuous_snd))) + exact ⟨fun p => ⟨f p,hm p⟩,hc.subtype_mk hm⟩ + +@[simp] lemma radialDisk_zero (d : PuncturedDisk n) : radialDisk (0,d) = d.1 := by + apply Subtype.ext + simp [radialDisk] +@[simp] lemma radialDisk_one (d : PuncturedDisk n) : radialDisk (1,d) = boundary n (radialSphere d) := by + apply Subtype.ext + simp [radialDisk,boundary] +@[simp] lemma radialDisk_boundary (t : unitInterval) (x : Sphere n) : + radialDisk (t,puncturedBoundary x) = boundary n x := by + apply Subtype.ext + simp only [radialDisk,ContinuousMap.coe_mk,radialSphere_boundary] + change (1-(t:ℝ)) • x.1 + (t:ℝ) • x.1 = x.1 + rw [← add_smul,sub_add_cancel,one_smul] + +def radialRetraction : C(punctured a,X) := + puncturedLift a (.id X) (fun i => (a i).comp radialSphere) + (fun i x => by simp only [ContinuousMap.comp_apply,radialSphere_boundary,ContinuousMap.id_apply]) + +@[simp] lemma radialRetraction_base (x : X) : radialRetraction a (puncturedBase a x) = x := rfl +@[simp] lemma radialRetraction_cell (i : ι) (d : PuncturedDisk n) : + radialRetraction a (puncturedCell a i d) = a i (radialSphere d) := by + exact puncturedLift_cell _ _ _ _ _ _ + +def radialPaths : C(punctured a,C(unitInterval,Space a)) := by + let f : C(X × unitInterval,Space a) := ⟨fun p => base a p.1,(continuous_base a).comp continuous_fst⟩ + let g (i : ι) : C(PuncturedDisk n × unitInterval,Space a) := + (cell a i).comp (radialDisk.comp ⟨Prod.swap,continuous_swap⟩) + have h (i : ι) (x : Sphere n) : (g i).curry (puncturedBoundary x) = f.curry (a i x) := by + ext t + change cell a i (radialDisk (t,puncturedBoundary x)) = base a (a i x) + rw [radialDisk_boundary,cell_boundary] + exact puncturedLift a f.curry (fun i => (g i).curry) h + +@[simp] lemma radialPaths_base (x : X) (t : unitInterval) : + radialPaths a (puncturedBase a x) t = base a x := rfl +@[simp] lemma radialPaths_cell (i : ι) (d : PuncturedDisk n) (t : unitInterval) : + radialPaths a (puncturedCell a i d) t = cell a i (radialDisk (t,d)) := by + unfold radialPaths + rw [puncturedLift_cell] + rfl + +def puncturedInclusion : C(punctured a,Space a) := ⟨Subtype.val,continuous_subtype_val⟩ +def radialEnd : C(punctured a,Space a) := (⟨base a,continuous_base a⟩ : C(X,Space a)).comp (radialRetraction a) + +def radialHomotopy : (puncturedInclusion a).Homotopy (radialEnd a) where + toFun p := radialPaths a p.2 p.1 + continuous_toFun := (radialPaths a).uncurry.continuous.comp continuous_swap + map_zero_left z := by + rcases punctured_surjective a z with ⟨x,rfl⟩ | ⟨i,d,rfl⟩ + · rfl + · rw [radialPaths_cell,radialDisk_zero] + rfl + map_one_left z := by + rcases punctured_surjective a z with ⟨x,rfl⟩ | ⟨i,d,rfl⟩ + · rfl + · rw [radialPaths_cell,radialDisk_one,cell_boundary] + change base a (a i (radialSphere d)) = base a (radialRetraction a (puncturedCell a i d)) + rw [radialRetraction_cell] + +@[simp] lemma radialHomotopy_base (x : X) (t : unitInterval) : + radialHomotopy a (t,puncturedBase a x) = base a x := rfl + +lemma cell_eq_openCell_iff (i j : ι) (d : Disk n) (x : OpenDisk n) : + cell a i d = openCell a j x ↔ i = j ∧ d.1 = x.1 := by + classical + constructor + · intro h + by_cases hd : d.1 ∈ ball (0 : Fin n → ℝ) 1 + · have hi : cell a i d = Sum.inr ⟨i,⟨d.1,hd⟩⟩ := + cell_interior a i ⟨d.1,hd⟩ + rw [hi] at h + have hh : (⟨i,⟨d.1,hd⟩⟩ : Σ _ : ι, OpenDisk n) = ⟨j,x⟩ := Sum.inr_injective h + exact ⟨congrArg Sigma.fst hh,congrArg (fun p : Σ _ : ι, OpenDisk n => p.2.1) hh⟩ + · let s : Sphere n := ⟨d.1,by + have hm := d.2 + simp only [mem_sphere,mem_ball,mem_closedBall] at * + exact le_antisymm hm (le_of_not_gt hd)⟩ + have hi : cell a i d = base a (a i s) := cell_boundary a i s + rw [hi] at h + cases h + · rintro ⟨rfl,h⟩ + have hd : d = interior n x := Subtype.ext h + rw [hd,cell_interior] + rfl + +lemma openCell_disjoint (i j : ι) (hij : i ≠ j) : + Disjoint (Set.range (openCell a i)) (Set.range (openCell a j)) := by + apply Set.disjoint_left.mpr + rintro z ⟨x,rfl⟩ ⟨y,h⟩ + exact hij (congrArg Sigma.fst (Sum.inr_injective h)).symm + +lemma openCell_selection_closed {I : Type*} (c : I → ι) (hc : Function.Injective c) + (x : I → OpenDisk n) (S : Set (Space a)) + (hS : S ⊆ Set.range (fun i => openCell a (c i) (x i))) : IsClosed S := by + rw [isClosed_iff] + constructor + · have h : base a ⁻¹' S = ∅ := by + apply Set.eq_empty_iff_forall_notMem.mpr + intro y hy + obtain ⟨i,hi⟩ := hS hy + cases hi + rw [h] + exact isClosed_empty + · intro j + suffices (cell a j ⁻¹' S).Subsingleton from this.finite.isClosed + intro d hd e he + obtain ⟨i,hi⟩ := hS hd + obtain ⟨k,hk⟩ := hS he + have hdi := (cell_eq_openCell_iff a j (c i) d (x i)).mp hi.symm + have hek := (cell_eq_openCell_iff a j (c k) e (x k)).mp hk.symm + have hik : i = k := hc (hdi.1.symm.trans hek.1) + subst k + exact Subtype.ext (hdi.2.trans hek.2.symm) + +lemma compact_finitely_many_openCells {K : Set (Space a)} (hK : IsCompact K) : + {i : ι | (K ∩ Set.range (openCell a i)).Nonempty}.Finite := by + classical + let I := {i : ι | (K ∩ Set.range (openCell a i)).Nonempty} + have hchoice (i : I) : ∃ x : OpenDisk n, openCell a i.1 x ∈ K := by + obtain ⟨z,hz,⟨x,hx⟩⟩ := i.2 + exact ⟨x,hx ▸ hz⟩ + choose x hx using hchoice + let y : I → Space a := fun i => openCell a i.1 (x i) + have hyinj : Function.Injective y := by + intro i j h + apply Subtype.ext + exact congrArg Sigma.fst (Sum.inr_injective h) + have hclosed : ∀ S ⊆ Set.range y, IsClosed S := + openCell_selection_closed a Subtype.val Subtype.val_injective x + have hcompact : IsCompact (Set.range y) := hK.of_isClosed_subset + (hclosed _ subset_rfl) (Set.range_subset_iff.mpr hx) + have hdisc : IsDiscrete (Set.range y) := by + apply isDiscrete_iff_forall_mem_exists_isClosed.mpr + intro S hS + exact ⟨S,hclosed S hS,Set.inter_eq_left.mpr hS⟩ + have hrange := hcompact.finite hdisc + have : Finite I := (Set.finite_range_iff hyinj).mp hrange + exact Set.toFinite I + +end UniversalFInfinity.Attachment + +open Set Topology +namespace UniversalFInfinity.Cellular +variable {X Y : Type*} [TopologicalSpace X] [TopologicalSpace Y] + +def patchFun (A : Set X) (f : C(X,Y)) (g : C(A,Y)) (x : X) : Y := by + classical + exact if hx : x ∈ A then g ⟨x,hx⟩ else f x + +lemma patchFun_on (A : Set X) (f : C(X,Y)) (g : C(A,Y)) (x : A) : + patchFun A f g x = g x := by simp only [patchFun,dite_eq_left x.2] + +lemma patchFun_off (A : Set X) (f : C(X,Y)) (g : C(A,Y)) {x : X} (hx : x ∉ A) : + patchFun A f g x = f x := by simp only [patchFun,dite_eq_right hx] + +lemma continuous_patchFun {A : Set X} (hA : IsClosed A) (f : C(X,Y)) (g : C(A,Y)) + (hboundary : ∀ (x : A), (x:X) ∈ frontier A → g x = f x) : + Continuous (patchFun A f g) := by + classical + have hOn : ContinuousOn (patchFun A f g) A := by + rw [continuousOn_iff_continuous_domRestrict] + have heq : A.domRestrict (patchFun A f g) = g := funext (patchFun_on A f g) + rw [heq] + exact g.continuous + have h := continuous_if (p := fun x => x ∈ A) (f := patchFun A f g) (g := f) + (fun x hx => by + have hxa : x ∈ A := hA.closure_eq ▸ hx.1 + exact (patchFun_on A f g ⟨x,hxa⟩).trans (hboundary ⟨x,hxa⟩ hx)) + (by simpa only [Set.ofPred_mem_eq,hA.closure_eq] using hOn) f.continuous.continuousOn + convert h using 1 + ext x + by_cases hx : x ∈ A + · simp only [ite_eq_left hx] + · simp only [ite_eq_right hx,patchFun_off A f g hx] + +def patch {A : Set X} (hA : IsClosed A) (f : C(X,Y)) (g : C(A,Y)) + (hboundary : ∀ (x : A), (x:X) ∈ frontier A → g x = f x) : C(X,Y) := + ⟨patchFun A f g,continuous_patchFun hA f g hboundary⟩ + +lemma patch_on {A : Set X} (hA : IsClosed A) (f : C(X,Y)) (g : C(A,Y)) + (hboundary : ∀ (x : A), (x:X) ∈ frontier A → g x = f x) (x : A) : + patch hA f g hboundary x = g x := patchFun_on A f g x + +lemma patch_off {A : Set X} (hA : IsClosed A) (f : C(X,Y)) (g : C(A,Y)) + (hboundary : ∀ (x : A), (x:X) ∈ frontier A → g x = f x) {x : X} (hx : x ∉ A) : + patch hA f g hboundary x = f x := patchFun_off A f g hx + +def patchHomotopy {A : Set X} (hA : IsClosed A) (f : C(X,Y)) (g : C(A,Y)) + (H : (f.restrict A).Homotopy g) + (hboundary : ∀ (t : unitInterval) (x : A), (x:X) ∈ frontier A → H (t,x) = f x) : + f.Homotopy (patch hA f g (fun x hx => by simpa using hboundary 1 x hx)) := by + let B : Set (unitInterval × X) := Prod.snd ⁻¹' A + let H' : C(B,Y) := ⟨fun z => H (z.1.1,⟨z.1.2,z.2⟩), + H.continuous.comp ((continuous_fst.comp continuous_subtype_val).prodMk + ((continuous_snd.comp continuous_subtype_val).subtype_mk _))⟩ + let hB : IsClosed B := hA.preimage continuous_snd + let F : C(unitInterval × X,Y) := f.comp ⟨Prod.snd,continuous_snd⟩ + have hb : ∀ z : B, (z : unitInterval × X) ∈ frontier B → H' z = F z := by + intro z hz + exact hboundary z.1.1 ⟨z.1.2,z.2⟩ (continuous_snd.frontier_preimage_subset A hz) + refine ⟨patch hB F H' hb,?_,?_⟩ + · intro x + change patch hB F H' hb (0,x) = f x + by_cases hx : x ∈ A + · rw [patch_on hB F H' hb ⟨(0,x),hx⟩] + exact H.apply_zero ⟨x,hx⟩ + · exact patch_off hB F H' hb (x := (_,x)) hx + · intro x + change patch hB F H' hb (1,x) = patch hA f g _ x + by_cases hx : x ∈ A + · rw [patch_on hB F H' hb ⟨(1,x),hx⟩,patch_on hA f g _ ⟨x,hx⟩] + exact H.apply_one ⟨x,hx⟩ + · rw [patch_off hB F H' hb (x := (_,x)) hx,patch_off hA f g _ hx] + rfl + +end UniversalFInfinity.Cellular + +end + +end OAI diff --git a/lean/OAI/GroupTheory/UniversalGroup/Cylinders.lean b/lean/OAI/GroupTheory/UniversalGroup/Cylinders.lean new file mode 100644 index 0000000000000000000000000000000000000000..6fd194c93d6536bd3c87a364e82975623c3fded4 --- /dev/null +++ b/lean/OAI/GroupTheory/UniversalGroup/Cylinders.lean @@ -0,0 +1,458 @@ +import OAI.GroupTheory.UniversalGroup.ControlledHomotopies + +namespace OAI + +noncomputable section + +open Set Metric Topology BigOperators +open Set Metric Topology +open Set Topology +open Set Metric Topology +open scoped NNReal +open Set Metric Topology +open scoped NNReal ENNReal +open Set Metric Topology +open scoped TensorProduct + +namespace UniversalFInfinity.Cylinder + +section +abbrev Disk (n : ℕ) := closedBall (0 : Fin n → ℝ) 1 +abbrev Sphere (n : ℕ) := sphere (0 : Fin n → ℝ) 1 +abbrev Rim (n : ℕ) := {p : unitInterval × Disk n // p.1 = 0 ∨ p.2.1 ∈ sphere 0 1} + +variable {n : ℕ} +def denominator (p : unitInterval × Disk n) : ℝ := max (2-(p.1:ℝ)) (2*‖p.2.1‖) +lemma denominator_bounds (p : unitInterval × Disk n) : 1 ≤ denominator p ∧ denominator p ≤ 2 := by + have hx : ‖p.2.1‖ ≤ 1 := by simpa only [mem_closedBall,dist_zero_right] using p.2.2 + have ht0 := p.1.2.1 + have ht1 := p.1.2.2 + constructor + · exact (by linarith : 1 ≤ 2-(p.1:ℝ)).trans (le_max_left _ _) + · exact max_le (by linarith) (by linarith) +lemma denominator_pos (p : unitInterval × Disk n) : 0 < denominator p := + lt_of_lt_of_le (by norm_num) (denominator_bounds p).1 + +def factor (p : unitInterval × Disk n) : ℝ := 2 / denominator p +lemma factor_mul_denominator (p : unitInterval × Disk n) : factor p * denominator p = 2 := + div_mul_cancel₀ _ (ne_of_gt (denominator_pos p)) +lemma factor_bounds (p : unitInterval × Disk n) : 1 ≤ factor p ∧ factor p ≤ 2 := by + have hd := denominator_bounds p + constructor + · exact (le_div_iff₀ (denominator_pos p)).mpr (by simpa using hd.2) + · exact (div_le_iff₀ (denominator_pos p)).mpr (by linarith) +lemma factor_nonneg (p : unitInterval × Disk n) : 0 ≤ factor p := (by norm_num : (0:ℝ)≤1).trans (factor_bounds p).1 + +lemma retract_time_mem (p : unitInterval × Disk n) : + 2 - factor p * (2-(p.1:ℝ)) ∈ (Set.Icc (0:ℝ) 1) := by + have hd : 2-(p.1:ℝ) ≤ denominator p := le_max_left _ _ + have hmul := mul_le_mul_of_nonneg_left hd (factor_nonneg p) + have heq := factor_mul_denominator p + have hf := (factor_bounds p).1 + have ht0 := p.1.2.1 + have ht1 := p.1.2.2 + have hge := mul_le_mul_of_nonneg_right hf (by linarith : 0 ≤ 2-(p.1:ℝ)) + constructor <;> nlinarith + +lemma retract_disk_mem (p : unitInterval × Disk n) : + factor p • p.2.1 ∈ closedBall (0 : Fin n → ℝ) 1 := by + simp only [mem_closedBall,dist_zero_right,norm_smul,Real.norm_eq_abs,abs_of_nonneg (factor_nonneg p)] + have hd : 2*‖p.2.1‖ ≤ denominator p := le_max_right _ _ + have hmul := mul_le_mul_of_nonneg_left hd (factor_nonneg p) + have heq := factor_mul_denominator p + nlinarith + +lemma retract_mem_rim (p : unitInterval × Disk n) : + (⟨2-factor p*(2-(p.1:ℝ)),retract_time_mem p⟩ : unitInterval) = 0 ∨ + factor p • p.2.1 ∈ sphere (0 : Fin n → ℝ) 1 := by + rcases le_total (2*‖p.2.1‖) (2-(p.1:ℝ)) with h | h + · left + apply Subtype.ext + have hd : denominator p = 2-(p.1:ℝ) := max_eq_left h + have heq := factor_mul_denominator p + rw [hd] at heq + simpa only [Set.Icc.coe_zero,sub_eq_zero] using heq.symm + · right + simp only [mem_sphere,dist_zero_right,norm_smul,Real.norm_eq_abs,abs_of_nonneg (factor_nonneg p)] + have hd : denominator p = 2*‖p.2.1‖ := max_eq_right h + have heq := factor_mul_denominator p + rw [hd] at heq + nlinarith + +lemma continuous_denominator : Continuous (@denominator n) := + (continuous_const.sub (continuous_subtype_val.comp continuous_fst)).max + (continuous_const.mul ((continuous_subtype_val.comp continuous_snd).norm)) +lemma continuous_factor : Continuous (@factor n) := + continuous_const.div continuous_denominator (fun p => ne_of_gt (denominator_pos p)) + +def retract (n : ℕ) : C(unitInterval × Disk n,Rim n) := by + have htime : Continuous (fun p : unitInterval × Disk n => + (⟨2-factor p*(2-(p.1:ℝ)),retract_time_mem p⟩ : unitInterval)) := + (continuous_const.sub (continuous_factor.mul + (continuous_const.sub (continuous_subtype_val.comp continuous_fst)))).subtype_mk _ + have hdisk : Continuous (fun p : unitInterval × Disk n => + (⟨factor p • p.2.1,retract_disk_mem p⟩ : Disk n)) := + (continuous_factor.smul (continuous_subtype_val.comp continuous_snd)).subtype_mk _ + exact ⟨fun p => ⟨(⟨_,retract_time_mem p⟩,⟨_,retract_disk_mem p⟩),retract_mem_rim p⟩, + (htime.prodMk hdisk).subtype_mk _⟩ + +lemma retract_of_rim (p : Rim n) : (retract n p.1).1 = p.1 := by + have hd : denominator p.1 = 2 := by + rcases p.2 with ht | hx + · have hx' : ‖p.1.2.1‖ ≤ 1 := by simpa only [mem_closedBall,dist_zero_right] using p.1.2.2 + simp only [denominator,ht,Set.Icc.coe_zero,sub_zero] + exact max_eq_left (by linarith) + · have hx' : ‖p.1.2.1‖ = 1 := by simpa only [mem_sphere,dist_zero_right] using hx + simp only [denominator,hx',mul_one] + exact max_eq_right (by linarith [p.1.1.2.1]) + have hf : factor p.1 = 1 := by simp [factor,hd] + apply Prod.ext + · apply Subtype.ext + change 2-factor p.1*(2-(p.1.1:ℝ)) = (p.1.1:ℝ) + rw [hf,one_mul] + ring + · apply Subtype.ext + change factor p.1 • p.1.2.1 = p.1.2.1 + rw [hf,one_smul] + +end + +open Set Metric Topology +variable {n : ℕ} {Y : Type*} [TopologicalSpace Y] + +lemma continuous_finite_closed_paste {A : Type*} [TopologicalSpace A] {ι : Type*} [Finite ι] + (S : ι → Set A) (f : ∀ i, C(S i,Y)) + (hcompat : ∀ i j x (hi : x ∈ S i) (hj : x ∈ S j), f i ⟨x,hi⟩ = f j ⟨x,hj⟩) + (hcover : ⋃ i, S i = Set.univ) (hclosed : ∀ i, IsClosed (S i)) : + Continuous (Set.liftCover S (fun i => f i) hcompat hcover) := by + rw [continuous_iff_isClosed] + intro D hD + rw [Set.preimage_liftCover] + exact isClosed_iUnion_of_finite fun i => (hclosed i).isClosedMap_subtype_val _ (hD.preimage (f i).continuous) + +def face (n : ℕ) : Bool → Set (Rim n) + | false => {p | p.1.1 = 0} + | true => {p | p.1.2.1 ∈ sphere 0 1} +lemma face_closed (n : ℕ) (i : Bool) : IsClosed (face n i) := by + cases i + · exact isClosed_eq (continuous_fst.comp continuous_subtype_val) continuous_const + · exact isClosed_sphere.preimage ((continuous_subtype_val.comp continuous_snd).comp continuous_subtype_val) +lemma face_cover (n : ℕ) : ⋃ i, face n i = Set.univ := by + apply Set.eq_univ_of_forall + intro p + rcases p.2 with h | h + · exact Set.mem_iUnion.mpr ⟨false,h⟩ + · exact Set.mem_iUnion.mpr ⟨true,h⟩ + +def faceValue (F : C(Disk n,Y)) (H : C(unitInterval × Sphere n,Y)) : ∀ i : Bool, C(face n i,Y) + | false => ⟨fun p => F p.1.1.2,F.continuous.comp ((continuous_snd.comp continuous_subtype_val).comp continuous_subtype_val)⟩ + | true => ⟨fun p => H (p.1.1.1,⟨p.1.1.2.1,p.2⟩),H.continuous.comp + (((continuous_fst.comp continuous_subtype_val).comp continuous_subtype_val).prodMk + (((continuous_subtype_val.comp continuous_snd).comp continuous_subtype_val).comp continuous_subtype_val |>.subtype_mk _))⟩ + +variable (F : C(Disk n,Y)) (H : C(unitInterval × Sphere n,Y)) +variable (h : ∀ x : Sphere n, H (0,x) = F ⟨x.1,sphere_subset_closedBall x.2⟩) +include h in +lemma faceValue_compatible (i j : Bool) (p : Rim n) (hi : p ∈ face n i) (hj : p ∈ face n j) : + faceValue F H i ⟨p,hi⟩ = faceValue F H j ⟨p,hj⟩ := by + have hcross (h0 : p.1.1 = 0) (hs : p.1.2.1 ∈ sphere 0 1) : + F p.1.2 = H (p.1.1,⟨p.1.2.1,hs⟩) := by + rw [h0,h] + cases i <;> cases j + · rfl + · exact hcross hi hj + · exact (hcross hj hi).symm + · rfl + +def rimMap : C(Rim n,Y) := + ⟨Set.liftCover (face n) (fun i => faceValue F H i) (faceValue_compatible F H h) (face_cover n), + continuous_finite_closed_paste _ _ _ _ (face_closed n)⟩ +lemma rimMap_face (i : Bool) (p : face n i) : rimMap F H h p.1 = faceValue F H i p := by + exact Set.liftCover_coe (S := face n) (f := fun i => faceValue F H i) + (hf := faceValue_compatible F H h) (hS := face_cover n) p + +def extension : C(unitInterval × Disk n,Y) := (rimMap F H h).comp (retract n) + +lemma extension_zero (x : Disk n) : extension F H h (0,x) = F x := by + let p : Rim n := ⟨(0,x),Or.inl rfl⟩ + have heq : retract n (0,x) = p := Subtype.ext (retract_of_rim p) + change rimMap F H h (retract n (0,x)) = F x + rw [heq] + exact rimMap_face F H h false ⟨p,rfl⟩ + +lemma extension_boundary (t : unitInterval) (x : Sphere n) : + extension F H h (t,⟨x.1,sphere_subset_closedBall x.2⟩) = H (t,x) := by + let p : Rim n := ⟨(t,⟨x.1,sphere_subset_closedBall x.2⟩),Or.inr x.2⟩ + have heq : retract n p.1 = p := Subtype.ext (retract_of_rim p) + change rimMap F H h (retract n p.1) = H (t,x) + rw [heq] + exact rimMap_face F H h true ⟨p,x.2⟩ + +include h in + +theorem homotopy_extension : ∃ E : C(unitInterval × Disk n,Y), + (∀ x, E (0,x) = F x) ∧ ∀ t (x : Sphere n), + E (t,⟨x.1,sphere_subset_closedBall x.2⟩) = H (t,x) := + ⟨extension F H h,extension_zero F H h,extension_boundary F H h⟩ + +end UniversalFInfinity.Cylinder + +namespace UniversalFInfinity.SphereCube +open Set Metric Topology Cellular +open scoped Topology.Homotopy +universe u v +variable {n : ℕ} {Y : Type u} [TopologicalSpace Y] + +def rimSphere (n : ℕ) : C(Cylinder.Rim n,Sphere (n+1)) := by + refine ⟨fun p => ⟨(diskCons p.1.2 p.1.1).1,?_⟩,?_⟩ + · rcases p.2 with h | h + · rw [h]; exact cons_zero_mem_sphere p.1.2 + · exact cons_mem_sphere_of_boundary ⟨p.1.2.1,h⟩ p.1.1 + · exact (continuous_subtype_val.comp + (continuous_diskCons.comp ((continuous_snd.comp continuous_subtype_val).prodMk + (continuous_fst.comp continuous_subtype_val)))).subtype_mk _ + +def rimSide (n : ℕ) : C(Sphere n × unitInterval,Cylinder.Rim n) := + ⟨fun p => ⟨(p.2,boundary n p.1),Or.inr p.1.2⟩, + (continuous_snd.prodMk ((continuous_boundary n).comp continuous_fst)).subtype_mk _⟩ + +def rimBottom (n : ℕ) : C(Disk n,Cylinder.Rim n) := + ⟨fun x => ⟨(0,x),Or.inl rfl⟩,(continuous_const.prodMk continuous_id).subtype_mk _⟩ + +def top (n : ℕ) : C(Disk n,Sphere (n+1)) := + ⟨fun d => ⟨(diskCons d 1).1,cons_one_mem_sphere d⟩, + (continuous_subtype_val.comp (continuous_diskCons.comp + (continuous_id.prodMk continuous_const))).subtype_mk _⟩ + +lemma rim_contractible (n : ℕ) : ContractibleSpace (Cylinder.Rim n) := by + let : ContractibleSpace (Disk n) := (convex_closedBall (0 : Fin n → ℝ) 1).contractibleSpace + ⟨0,by simp⟩ + let : ContractibleSpace unitInterval := (convex_Icc (0:ℝ) 1).contractibleSpace ⟨0,by simp⟩ + obtain ⟨p,⟨H⟩⟩ := id_nullhomotopic (unitInterval × Disk n) + let inc : C(Cylinder.Rim n,unitInterval × Disk n) := ⟨Subtype.val,continuous_subtype_val⟩ + let K := (ContinuousMap.Homotopy.refl (Cylinder.retract n)).comp (H.compContinuousMap inc) + apply (contractible_iff_id_nullhomotopic _).mpr + refine ⟨Cylinder.retract n p,⟨?_⟩⟩ + have he : (Cylinder.retract n).comp ((ContinuousMap.id _).comp inc) = ContinuousMap.id _ := by + apply ContinuousMap.ext + intro x + exact Subtype.ext (Cylinder.retract_of_rim x) + exact he ▸ K + +lemma rim_nullhomotopy [PathConnectedSpace Y] (f : C(Sphere (n+1),Y)) (y : Y) : + Nonempty ((f.comp (rimSphere n)).Homotopy (ContinuousMap.const _ y)) := by + let := rim_contractible n + obtain ⟨p,⟨H⟩⟩ := id_nullhomotopic (Cylinder.Rim n) + let F := f.comp (rimSphere n) + let K := (ContinuousMap.Homotopy.refl F).comp H + let q : Path (F p) y := Classical.choice (PathConnectedSpace.joined _ _) + let L : (ContinuousMap.const (Cylinder.Rim n) (F p)).Homotopy (ContinuousMap.const _ y) := + { toFun := fun z => q z.1 + continuous_toFun := q.continuous.comp continuous_fst + map_zero_left := fun _ => q.source + map_one_left := fun _ => q.target } + exact ⟨K.trans L⟩ + +variable (f : C(Sphere (n+1),Y)) (y : Y) +variable (K : (f.comp (rimSphere n)).Homotopy (ContinuousMap.const _ y)) + +def edgeTrace : C(unitInterval × Sphere n,Y) := + ⟨fun p => K (p.1,rimSide n (p.2,1)),K.continuous.comp + (continuous_fst.prodMk ((rimSide n).continuous.comp + (continuous_snd.prodMk continuous_const)))⟩ + +lemma edgeTrace_zero (s : Sphere n) : edgeTrace f y K (0,s) = (f.comp (top n)) (boundary n s) := by + change K (0,rimSide n (s,1)) = _ + rw [ContinuousMap.Homotopy.apply_zero] + rfl + +def topExtension : C(unitInterval × Disk n,Y) := + Cylinder.extension (f.comp (top n)) (edgeTrace f y K) (edgeTrace_zero f y K) + +lemma topExtension_zero (x : Disk n) : topExtension f y K (0,x) = f (top n x) := + Cylinder.extension_zero _ _ _ x +lemma topExtension_boundary (t : unitInterval) (s : Sphere n) : + topExtension f y K (t,boundary n s) = K (t,rimSide n (s,1)) := + Cylinder.extension_boundary _ _ _ t s + +def normalizedTop : C(Disk n,Y) := (topExtension f y K).comp + ⟨fun x => (1,x),continuous_const.prodMk continuous_id⟩ +lemma normalizedTop_boundary (s : Sphere n) : normalizedTop f y K (boundary n s) = y := by + change topExtension f y K (1,boundary n s) = y + rw [topExtension_boundary,ContinuousMap.Homotopy.apply_one,ContinuousMap.const_apply] + +def sidePaths : C(Sphere n,C(unitInterval,C(unitInterval,Y))) := + (⟨fun p : (Sphere n × unitInterval) × unitInterval => K (p.2,rimSide n p.1), + K.continuous.comp (continuous_snd.prodMk ((rimSide n).continuous.comp continuous_fst))⟩ : + C((Sphere n × unitInterval) × unitInterval,Y)).curry.curry + +def bottomPaths : C(Disk n,C(unitInterval,Y)) := + (⟨fun p : Disk n × unitInterval => K (p.2,rimBottom n p.1), + K.continuous.comp (continuous_snd.prodMk ((rimBottom n).continuous.comp continuous_fst))⟩ : + C(Disk n × unitInterval,Y)).curry + +def topPaths : C(Disk n,C(unitInterval,Y)) := + ((topExtension f y K).comp ContinuousMap.prodSwap).curry + +lemma spherePaths_compatible (s : Sphere n) : + pathEndpoint (sidePaths f y K s) = + (bottomPaths f y K (boundary n s),topPaths f y K (boundary n s)) := by + apply Prod.ext + · rfl + · apply ContinuousMap.ext + intro t + exact (topExtension_boundary f y K t s).symm + +private lemma spherePaths_compatible_map (s : Sphere n) : + pathEndpoint (sidePaths f y K s) = + ((bottomPaths f y K).prodMk (topPaths f y K)) (boundary n s) := + spherePaths_compatible f y K s + +def spherePaths : C(Sphere (n+1),C(unitInterval,Y)) := + cylinderBoundaryMap (sidePaths f y K) + ((bottomPaths f y K).prodMk (topPaths f y K)) (spherePaths_compatible_map f y K) + +lemma cons_tail_time (x : Disk (n+1)) : diskCons (diskTail x) (diskTime x) = x := by + apply Subtype.ext + funext i + refine Fin.cases ?_ (fun j => rfl) i + change 2*((x.1 0+1)/2)-1 = x.1 0 + ring + +lemma spherePaths_zero (s : Sphere (n+1)) : spherePaths f y K s 0 = f s := by + rcases sphere_split s with h | h | h + · rw [spherePaths,cylinderBoundaryMap_face _ _ _ (some false) ⟨s,h⟩] + change K (0,rimBottom n (diskTail (boundary (n+1) s))) = f s + rw [ContinuousMap.Homotopy.apply_zero] + change f (rimSphere n (rimBottom n (diskTail (boundary (n+1) s)))) = f s + congr 1 + apply Subtype.ext + have ht : diskTime (boundary (n+1) s) = 0 := faceTime_eq_zero s h + exact (congrArg (fun t => (diskCons (diskTail (boundary (n+1) s)) t).1) ht).symm.trans + (congrArg Subtype.val (cons_tail_time (boundary (n+1) s))) + · rw [spherePaths,cylinderBoundaryMap_face _ _ _ (some true) ⟨s,h⟩] + change topExtension f y K (0,diskTail (boundary (n+1) s)) = f s + rw [topExtension_zero] + congr 1 + apply Subtype.ext + have ht : diskTime (boundary (n+1) s) = 1 := faceTime_eq_one s h + exact (congrArg (fun t => (diskCons (diskTail (boundary (n+1) s)) t).1) ht).symm.trans + (congrArg Subtype.val (cons_tail_time (boundary (n+1) s))) + · rw [spherePaths,cylinderBoundaryMap_face _ _ _ none ⟨s,h⟩] + change K (0,rimSide n (faceSphere ⟨s,h⟩,faceTime none ⟨s,h⟩)) = f s + rw [ContinuousMap.Homotopy.apply_zero] + change f (rimSphere n (rimSide n (faceSphere ⟨s,h⟩,faceTime none ⟨s,h⟩))) = f s + apply congrArg f + apply Subtype.ext + change (diskCons (diskTail (boundary (n+1) s)) (diskTime (boundary (n+1) s))).1 = s.1 + exact congrArg Subtype.val (cons_tail_time (boundary (n+1) s)) + +def normalizedSphere : C(Sphere (n+1),Y) := + ⟨fun s => spherePaths f y K s 1,(continuous_eval_const 1).comp (spherePaths f y K).continuous⟩ + +def normalizeHomotopy : f.Homotopy (normalizedSphere f y K) where + toFun p := spherePaths f y K p.2 p.1 + continuous_toFun := continuous_eval.comp (((spherePaths f y K).continuous.comp continuous_snd).prodMk continuous_fst) + map_zero_left s := spherePaths_zero f y K s + map_one_left _ := rfl + +lemma normalizedSphere_rim (x : Cylinder.Rim n) : normalizedSphere f y K (rimSphere n x) = y := by + rcases x.2 with hx | hx + · have h : rimSphere n x ∈ cylinderFace n (some false) := by + change (diskCons x.1.2 x.1.1).1 0 = -1 + simp only [hx,diskCons,Fin.cons_zero,Set.Icc.coe_zero,mul_zero,zero_sub] + change spherePaths f y K (rimSphere n x) 1 = y + rw [spherePaths,cylinderBoundaryMap_face _ _ _ (some false) ⟨_,h⟩] + exact K.apply_one _ + · have h : rimSphere n x ∈ cylinderFace n none := by + change (diskTail (diskCons x.1.2 x.1.1)).1 ∈ sphere 0 1 + rw [diskTail_cons]; exact hx + change spherePaths f y K (rimSphere n x) 1 = y + rw [spherePaths,cylinderBoundaryMap_face _ _ _ none ⟨_,h⟩] + exact K.apply_one _ + +lemma normalizedSphere_top (x : Disk n) : normalizedSphere f y K (top n x) = normalizedTop f y K x := by + have h : top n x ∈ cylinderFace n (some true) := by + change (diskCons x 1).1 0 = 1 + norm_num [diskCons] + change spherePaths f y K (top n x) 1 = _ + rw [spherePaths,cylinderBoundaryMap_face _ _ _ (some true) ⟨_,h⟩] + change topExtension f y K (1,diskTail (diskCons x 1)) = _ + rw [diskTail_cons] + rfl +end UniversalFInfinity.SphereCube + +namespace UniversalFInfinity.DiskCube +abbrev Disk (n : ℕ) := closedBall (0 : Fin n → ℝ) 1 +abbrev Sphere (n : ℕ) := sphere (0 : Fin n → ℝ) 1 + +def toCube (n : ℕ) : C(Disk n,Fin n → unitInterval) := by + refine ⟨fun x i => ⟨(x.1 i+1)/2,?_⟩,?_⟩ + · have hx : ‖x.1 i‖ ≤ 1 := (norm_le_pi_norm x.1 i).trans (by simpa only [mem_closedBall,dist_zero_right] using x.2) + rw [Real.norm_eq_abs,abs_le] at hx + constructor <;> linarith [hx.1,hx.2] + · apply continuous_pi + intro i + exact (((continuous_apply i).comp continuous_subtype_val).add continuous_const |>.div_const 2).subtype_mk _ + +def fromCube (n : ℕ) : C((Fin n → unitInterval),Disk n) := by + refine ⟨fun x => ⟨fun i => 2*(x i:ℝ)-1,?_⟩,?_⟩ + · simp only [mem_closedBall,dist_zero_right] + rw [pi_norm_le_iff_of_nonneg zero_le_one] + intro i + rw [Real.norm_eq_abs,abs_le] + constructor <;> linarith [(x i).2.1,(x i).2.2] + · apply Continuous.subtype_mk + apply continuous_pi + intro i + exact (continuous_const.mul (continuous_subtype_val.comp (continuous_apply i))).sub continuous_const + +lemma from_to (n : ℕ) (x : Disk n) : fromCube n (toCube n x) = x := by + apply Subtype.ext + funext i + change 2*((x.1 i+1)/2)-1 = x.1 i + ring + +lemma to_from (n : ℕ) (x : Fin n → unitInterval) : toCube n (fromCube n x) = x := by + funext i + apply Subtype.ext + change ((2*(x i:ℝ)-1)+1)/2 = (x i:ℝ) + ring + +lemma from_boundary (n : ℕ) (x : Fin n → unitInterval) (hx : x ∈ Cube.boundary (Fin n)) : + (fromCube n x).1 ∈ sphere 0 1 := by + obtain ⟨i,hi | hi⟩ := hx + all_goals + simp only [mem_sphere,dist_zero_right] + apply le_antisymm + · simpa only [mem_closedBall,dist_zero_right] using (fromCube n x).2 + · have h := norm_le_pi_norm (fromCube n x).1 i + change ‖2*(x i:ℝ)-1‖ ≤ _ at h + norm_num [hi] at h ⊢ + exact h + +lemma to_boundary (n : ℕ) (x : Sphere n) : + toCube n ⟨x.1,sphere_subset_closedBall x.2⟩ ∈ Cube.boundary (Fin n) := by + have hx : ‖x.1‖ = 1 := by simpa only [mem_sphere,dist_zero_right] using x.2 + have hi : ∃ i, 1 ≤ ‖x.1 i‖ := by + by_contra! hh + have := (pi_norm_lt_iff (by norm_num : (0:ℝ)<1)).mpr hh + linarith + obtain ⟨i,hi⟩ := hi + have heq : |x.1 i| = 1 := le_antisymm ((norm_le_pi_norm x.1 i).trans_eq hx) hi + refine ⟨i,?_⟩ + rcases (abs_eq (by norm_num : (0:ℝ)≤1)).mp heq with h | h + · right + apply Subtype.ext + change (x.1 i+1)/2 = 1 + rw [h]; norm_num + · left + apply Subtype.ext + change (x.1 i+1)/2 = 0 + rw [h]; norm_num + +end UniversalFInfinity.DiskCube + +end + +end OAI diff --git a/lean/OAI/GroupTheory/UniversalGroup/FiniteEnvelopes.lean b/lean/OAI/GroupTheory/UniversalGroup/FiniteEnvelopes.lean new file mode 100644 index 0000000000000000000000000000000000000000..c365f7814c73441b4dd1c84fb8b028b9fb6f4443 --- /dev/null +++ b/lean/OAI/GroupTheory/UniversalGroup/FiniteEnvelopes.lean @@ -0,0 +1,397 @@ +import OAI.GroupTheory.UniversalGroup.SimplicialProducts + +namespace OAI + +open Set Metric Topology BigOperators +open Set Metric Topology +open Set Topology +open Set Metric Topology +open scoped NNReal +open Set Metric Topology +open scoped NNReal ENNReal +open Set Metric Topology +open scoped TensorProduct + +namespace UniversalFInfinity + +section + +variable {K D V : Type*} [Field K] [Ring D] [Algebra K D] [Group V] + +abbrev ModelAlgebra (K D V : Type*) [Field K] [Ring D] [Algebra K D] [Group V] := + D ⊗[K] MonoidAlgebra K V + +noncomputable def diagramElement (e : D) (v : V) : ModelAlgebra K D V := + (1 - e) ⊗ₜ[K] (1 : MonoidAlgebra K V) + e ⊗ₜ[K] MonoidAlgebra.of K V v + +lemma diagramElement_one (e : D) : diagramElement (K := K) e (1 : V) = 1 := by + simp only [diagramElement, map_one, TensorProduct.sub_tmul] + rw [sub_add_cancel, Algebra.TensorProduct.one_def] + +lemma diagramElement_mul (e : D) (he : e * e = e) (v w : V) : + diagramElement (K := K) e v * diagramElement (K := K) e w = + diagramElement (K := K) e (v * w) := by + have h₁ : (1 - e) * e = 0 := by rw [sub_mul, one_mul, he, sub_self] + have h₂ : e * (1 - e) = 0 := by rw [mul_sub, mul_one, he, sub_self] + have h₃ : (1 - e) * (1 - e) = 1 - e := by + rw [mul_sub, mul_one, h₁, sub_zero] + simp only [diagramElement, add_mul, mul_add, Algebra.TensorProduct.tmul_mul_tmul, + h₁, h₂, h₃, he, TensorProduct.zero_tmul, add_zero, zero_add, one_mul, map_mul] + +lemma diagramElement_eq (e : D) (v : V) : + diagramElement (K := K) e v = + 1 + e ⊗ₜ[K] (MonoidAlgebra.of K V v - 1) := by + simp only [diagramElement, TensorProduct.sub_tmul, TensorProduct.tmul_sub] + rw [← Algebra.TensorProduct.one_def] + abel + +lemma diagramElement_orthogonal_mul (e p : D) (hep : e * p = 0) (v w : V) : + diagramElement (K := K) e v * diagramElement (K := K) p w = + 1 + e ⊗ₜ[K] (MonoidAlgebra.of K V v - 1) + + p ⊗ₜ[K] (MonoidAlgebra.of K V w - 1) := by + rw [diagramElement_eq, diagramElement_eq] + simp only [add_mul, mul_add, one_mul, mul_one, Algebra.TensorProduct.tmul_mul_tmul, + hep, TensorProduct.zero_tmul, add_zero] + +lemma diagramElement_commute (e p : D) (hep : e * p = 0) (hpe : p * e = 0) + (v w : V) : + Commute (diagramElement (K := K) e v) (diagramElement (K := K) p w) := by + show _ * _ = _ * _ + rw [diagramElement_orthogonal_mul e p hep, diagramElement_orthogonal_mul p e hpe] + abel + +lemma diagramElement_add (e p : D) (hep : e * p = 0) (v : V) : + diagramElement (K := K) (e + p) v = + diagramElement (K := K) e v * diagramElement (K := K) p v := by + rw [diagramElement_orthogonal_mul e p hep, diagramElement_eq, + TensorProduct.add_tmul, add_assoc] + +noncomputable def diagramHom (e : D) (he : e * e = e) : V →* (ModelAlgebra K D V)ˣ where + toFun v := + { val := diagramElement e v + inv := diagramElement e v⁻¹ + val_inv := by rw [diagramElement_mul e he, mul_inv_cancel, diagramElement_one] + inv_val := by rw [diagramElement_mul e he, inv_mul_cancel, diagramElement_one] } + map_one' := Units.ext (diagramElement_one e) + map_mul' v w := Units.ext (diagramElement_mul e he v w).symm + +@[simp] +lemma diagramHom_val (e : D) (he : e * e = e) (v : V) : + (diagramHom (K := K) e he v : ModelAlgebra K D V) = diagramElement e v := rfl + +lemma diagramHom_commute (e p : D) (he : e * e = e) (hp : p * p = p) + (hep : e * p = 0) (hpe : p * e = 0) (v w : V) : + Commute (diagramHom (K := K) e he v) (diagramHom (K := K) p hp w) := by + apply Units.ext + exact diagramElement_commute e p hep hpe v w + +lemma diagramHom_add (e p : D) (he : e * e = e) (hp : p * p = p) + (hep : e * p = 0) (_hpe : p * e = 0) + (hs : (e + p) * (e + p) = e + p) (v : V) : + diagramHom (K := K) (e + p) hs v = + diagramHom (K := K) e he v * diagramHom (K := K) p hp v := by + apply Units.ext + exact diagramElement_add e p hep v + +@[simp] +lemma diagramHom_identity_val (v : V) : + (diagramHom (K := K) (1 : D) (one_mul _) v : ModelAlgebra K D V) = + Algebra.TensorProduct.includeRight (MonoidAlgebra.of K V v) := by + simp [diagramElement] + +lemma diagramHom_identity_injective [Nontrivial D] : + Function.Injective (diagramHom (K := K) (1 : D) (one_mul _) : + V →* (ModelAlgebra K D V)ˣ) := by + intro v w h + have h' := congrArg Units.val h + simp only [diagramHom_identity_val] at h' + have h'' := Algebra.TensorProduct.includeRight_injective (RingHom.injective (algebraMap K D)) h' + exact MonoidAlgebra.of_injective h'' + +end + +namespace FiniteEnvelope + +variable {I X : Type*} + +abbrev RelationIndex (r : Set (FreeGroup X)) (S : Set (I × I)) + (T : Set (I × I × I)) := + (I × r) ⊕ (S × X) ⊕ (T × X × X) ⊕ (T × X) + +def relationWord (r : Set (FreeGroup X)) (S : Set (I × I)) + (T : Set (I × I × I)) : RelationIndex r S T → FreeGroup (I × X) + | .inl (i, w) => FreeGroup.map (fun x => (i, x)) w.val + | .inr (.inl (s, x)) => FreeGroup.of (s.val.1, x) * (FreeGroup.of (s.val.2, x))⁻¹ + | .inr (.inr (.inl (t, x, y))) => + (FreeGroup.of (t.val.1, x) * FreeGroup.of (t.val.2.1, y)) * + (FreeGroup.of (t.val.2.1, y) * FreeGroup.of (t.val.1, x))⁻¹ + | .inr (.inr (.inr (t, x))) => + FreeGroup.of (t.val.2.2, x) * + (FreeGroup.of (t.val.1, x) * FreeGroup.of (t.val.2.1, x))⁻¹ + +abbrev relators (r : Set (FreeGroup X)) (S : Set (I × I)) + (T : Set (I × I × I)) := Set.range (relationWord r S T) + +abbrev Envelope (r : Set (FreeGroup X)) (S : Set (I × I)) + (T : Set (I × I × I)) := PresentedGroup (relators r S T) + +instance finiteRelators [Finite I] [Finite X] (r : Set (FreeGroup X)) + [Finite r] (S : Set (I × I)) (T : Set (I × I × I)) : + Finite (relators r S T) := Set.finite_range (relationWord r S T) + +instance finitelyPresented [Finite I] [Finite X] (r : Set (FreeGroup X)) + [Finite r] (S : Set (I × I)) (T : Set (I × I × I)) : + Group.IsFinitelyPresented (Envelope r S T) := inferInstanceAs + (Group.IsFinitelyPresented (PresentedGroup (relators r S T))) + +variable (r : Set (FreeGroup X)) (S : Set (I × I)) (T : Set (I × I × I)) + +def copy (i : I) : PresentedGroup r →* Envelope r S T := + PresentedGroup.map (FreeGroup.map fun x => (i, x)) + (fun w hw => ⟨.inl (i, ⟨w, hw⟩), rfl⟩) + +@[simp] +lemma copy_of (i : I) (x : X) : + copy r S T i (PresentedGroup.of x) = PresentedGroup.of (i, x) := rfl + +lemma copy_same (s : S) : copy r S T s.val.1 = copy r S T s.val.2 := by + apply PresentedGroup.ext + intro x + apply PresentedGroup.mk_eq_mk_of_mul_inv_mem + exact ⟨.inr (.inl (s, x)), rfl⟩ + +lemma copy_of_commute (t : T) (x y : X) : + Commute (copy r S T t.val.1 (.of x)) (copy r S T t.val.2.1 (.of y)) := by + change PresentedGroup.mk _ (_ * _) = PresentedGroup.mk _ (_ * _) + apply PresentedGroup.mk_eq_mk_of_mul_inv_mem + exact ⟨.inr (.inr (.inl (t, x, y))), rfl⟩ + +lemma copy_of_sum (t : T) (x : X) : + copy r S T t.val.2.2 (.of x) = + copy r S T t.val.1 (.of x) * copy r S T t.val.2.1 (.of x) := by + change PresentedGroup.mk _ _ = PresentedGroup.mk _ (_ * _) + apply PresentedGroup.mk_eq_mk_of_mul_inv_mem + exact ⟨.inr (.inr (.inr (t, x))), rfl⟩ + +variable {r S T} + +lemma commute_of_generators {G : Type*} [Group G] + (f g : PresentedGroup r →* G) + (h : ∀ x y : X, Commute (f (.of x)) (g (.of y))) + (u v : PresentedGroup r) : Commute (f u) (g v) := by + have h₁ (x : X) (v : PresentedGroup r) : Commute (f (.of x)) (g v) := by + have hv := PresentedGroup.generated_by r + ((Subgroup.centralizer {f (.of x)}).comap g) + (fun y => Subgroup.mem_centralizer_singleton_iff.mpr (h x y).eq.symm) v + exact (Subgroup.mem_centralizer_singleton_iff.mp hv).symm + have hu := PresentedGroup.generated_by r + ((Subgroup.centralizer {g v}).comap f) + (fun x => Subgroup.mem_centralizer_singleton_iff.mpr (h₁ x v).eq) u + exact Subgroup.mem_centralizer_singleton_iff.mp hu + +lemma copy_commute (t : T) (u v : PresentedGroup r) : + Commute (copy r S T t.val.1 u) (copy r S T t.val.2.1 v) := + commute_of_generators _ _ (copy_of_commute r S T t) u v + +def commutingProduct {G H : Type*} [Group G] [Group H] + (f g : G →* H) (h : ∀ u v, Commute (f u) (g v)) : G →* H where + toFun u := f u * g u + map_one' := by simp + map_mul' u v := by + simp only [map_mul] + exact (h v u).mul_mul_mul_comm _ _ + +lemma copy_sum (t : T) (u : PresentedGroup r) : + copy r S T t.val.2.2 u = copy r S T t.val.1 u * copy r S T t.val.2.1 u := by + have h : copy r S T t.val.2.2 = + commutingProduct (copy r S T t.val.1) (copy r S T t.val.2.1) (copy_commute t) := by + apply PresentedGroup.ext + exact copy_of_sum r S T t + exact DFunLike.congr_fun h u + +variable {G : Type*} [Group G] +variable (h : I → PresentedGroup r →* G) +variable (hsame : ∀ s : S, h s.val.1 = h s.val.2) +variable (hcomm : ∀ t : T, ∀ u v, Commute (h t.val.1 u) (h t.val.2.1 v)) +variable (hsum : ∀ t : T, ∀ u, h t.val.2.2 u = h t.val.1 u * h t.val.2.1 u) + +include hsame hcomm hsum + +lemma model_satisfies_relations : ∀ w ∈ relators r S T, + FreeGroup.lift (fun ix : I × X => h ix.1 (.of ix.2)) w = 1 := by + have hc (i : I) : + (FreeGroup.lift (fun ix : I × X => h ix.1 (.of ix.2))).comp + (FreeGroup.map fun x => (i, x)) = (h i).comp (PresentedGroup.mk r) := by + apply FreeGroup.ext_hom + intro x + simp only [MonoidHom.comp_apply, FreeGroup.map.of, FreeGroup.lift_apply_of] + rfl + rintro _ ⟨idx, rfl⟩ + rcases idx with ⟨i, w⟩ | ⟨s, x⟩ | ⟨t, x, y⟩ | ⟨t, x⟩ + · change ((FreeGroup.lift _).comp (FreeGroup.map fun x => (i, x))) w.val = 1 + rw [hc] + simp only [MonoidHom.comp_apply, PresentedGroup.one_of_mem w.property, map_one] + · simp only [relationWord, map_mul, map_inv, FreeGroup.lift_apply_of] + rw [hsame s, mul_inv_cancel] + · simp only [relationWord, map_mul, map_inv, FreeGroup.lift_apply_of] + exact mul_inv_eq_one.mpr (hcomm t (.of x) (.of y)).eq + · simp only [relationWord, map_mul, map_inv, FreeGroup.lift_apply_of] + exact mul_inv_eq_one.mpr (hsum t (.of x)) + +def modelMap : Envelope r S T →* G := + PresentedGroup.toGroup (model_satisfies_relations h hsame hcomm hsum) + +@[simp] +lemma modelMap_copy (i : I) : (modelMap h hsame hcomm hsum).comp (copy r S T i) = h i := by + apply PresentedGroup.ext + intro x + simp only [MonoidHom.comp_apply, copy_of, modelMap, PresentedGroup.toGroup.of] + +lemma copy_injective_of_model (i : I) (hi : Function.Injective (h i)) : + Function.Injective (copy r S T i) := by + have hc := modelMap_copy h hsame hcomm hsum i + intro u v huv + apply hi + have hv := congrArg (modelMap h hsame hcomm hsum) huv + simpa only [← MonoidHom.comp_apply, hc] using hv + +end FiniteEnvelope + +structure FiniteIdempotentSystem (D : Type) [Ring D] where + carrier : Set D + finite : carrier.Finite + one_mem : (1 : D) ∈ carrier + idempotent : ∀ e ∈ carrier, e * e = e + +namespace FiniteIdempotentSystem + +variable {D : Type} [Ring D] + +instance (P : FiniteIdempotentSystem D) : Finite P.carrier := P.finite + +def identity (P : FiniteIdempotentSystem D) : P.carrier := ⟨1, P.one_mem⟩ + +lemma isIdempotent (P : FiniteIdempotentSystem D) (e : P.carrier) : + (e : D) * e = e := P.idempotent e.val e.property + +end FiniteIdempotentSystem + +namespace TwoEnvelope + +variable {K₂ K₃ D₂ D₃ : Type} +variable [Field K₂] [Field K₃] [Ring D₂] [Ring D₃] +variable [Algebra K₂ D₂] [Algebra K₃ D₃] +variable (P₂ : FiniteIdempotentSystem D₂) (P₃ : FiniteIdempotentSystem D₃) + +abbrev Index := P₂.carrier ⊕ P₃.carrier + +def common : Set (Index P₂ P₃ × Index P₂ P₃) := + {(.inl P₂.identity, .inr P₃.identity)} + +def triples : Set (Index P₂ P₃ × Index P₂ P₃ × Index P₂ P₃) := + {t | match t with + | (.inl e, .inl p, .inl s) => + e.val * p.val = 0 ∧ p.val * e.val = 0 ∧ s.val = e.val + p.val + | (.inr e, .inr p, .inr s) => + e.val * p.val = 0 ∧ p.val * e.val = 0 ∧ s.val = e.val + p.val + | _ => False} + +variable (V : Type) [Group V] + +abbrev ModelGroup := (ModelAlgebra K₃ D₃ (ModelAlgebra K₂ D₂ V)ˣ)ˣ + +noncomputable def family : Index P₂ P₃ → V →* ModelGroup (K₂ := K₂) (K₃ := K₃) + (D₂ := D₂) (D₃ := D₃) V + | .inl e => + (diagramHom (K := K₃) (1 : D₃) (one_mul _)).comp + (diagramHom (K := K₂) e.val (P₂.isIdempotent e)) + | .inr e => + (diagramHom (K := K₃) e.val (P₃.isIdempotent e)).comp + (diagramHom (K := K₂) (1 : D₂) (one_mul _)) + +variable {P₂ P₃ V} + +lemma family_common (s : common P₂ P₃) : + family (K₂ := K₂) (K₃ := K₃) P₂ P₃ V s.val.1 = family P₂ P₃ V s.val.2 := by + rcases s with ⟨s, hs⟩ + have hs' : s = (.inl P₂.identity, .inr P₃.identity) := hs + subst s + rfl + +lemma family_commute (t : triples P₂ P₃) (u v : V) : + Commute (family (K₂ := K₂) (K₃ := K₃) P₂ P₃ V t.val.1 u) + (family P₂ P₃ V t.val.2.1 v) := by + rcases t with ⟨⟨e, p, s⟩, ht⟩ + rcases e with e | e <;> rcases p with p | p <;> rcases s with s | s <;> + simp only [triples, Set.mem_ofPred_eq] at ht + · rcases ht with ⟨hep, hpe, _⟩ + exact (diagramHom_commute (K := K₂) e.val p.val (P₂.isIdempotent e) + (P₂.isIdempotent p) hep hpe u v).map + (diagramHom (K := K₃) (1 : D₃) (one_mul _)) + · rcases ht with ⟨hep, hpe, _⟩ + exact diagramHom_commute (K := K₃) e.val p.val (P₃.isIdempotent e) + (P₃.isIdempotent p) hep hpe _ _ + +lemma family_sum (t : triples P₂ P₃) (u : V) : + family (K₂ := K₂) (K₃ := K₃) P₂ P₃ V t.val.2.2 u = + family P₂ P₃ V t.val.1 u * family P₂ P₃ V t.val.2.1 u := by + rcases t with ⟨⟨e, p, s⟩, ht⟩ + rcases e with e | e <;> rcases p with p | p <;> rcases s with s | s <;> + simp only [triples, Set.mem_ofPred_eq] at ht + · rcases ht with ⟨hep, _hpe, hs⟩ + change diagramHom (K := K₃) (1 : D₃) (one_mul _) (diagramHom s.val _ u) = _ + have heq : diagramHom (K := K₂) s.val (P₂.isIdempotent s) u = + diagramHom e.val (P₂.isIdempotent e) u * diagramHom p.val (P₂.isIdempotent p) u := by + apply Units.ext + change diagramElement (K := K₂) s.val u = _ + rw [hs] + exact diagramElement_add _ _ hep u + rw [heq, map_mul] + rfl + · rcases ht with ⟨hep, _hpe, hs⟩ + apply Units.ext + let w := diagramHom (K := K₂) (1 : D₂) (one_mul _) u + change diagramElement (K := K₃) s.val w = + diagramElement e.val w * diagramElement p.val w + rw [hs] + exact diagramElement_add _ _ hep _ + +lemma family_identity_injective [Nontrivial D₂] [Nontrivial D₃] : + Function.Injective (family (K₂ := K₂) (K₃ := K₃) P₂ P₃ V (.inl P₂.identity)) := + (diagramHom_identity_injective (K := K₃) (D := D₃)).comp + (diagramHom_identity_injective (K := K₂) (D := D₂)) + +variable (K₂ K₃ P₂ P₃ V) +include K₂ K₃ + +theorem finite_envelope [Nontrivial D₂] [Nontrivial D₃] [Group.IsFinitelyPresented V] : + ∃ (W : Type) (_ : Group W), Group.IsFinitelyPresented W ∧ + ∃ k : Index P₂ P₃ → V →* W, + k (.inl P₂.identity) = k (.inr P₃.identity) ∧ + Function.Injective (k (.inl P₂.identity)) ∧ + (∀ t : triples P₂ P₃, ∀ u v, + Commute (k t.val.1 u) (k t.val.2.1 v)) ∧ + (∀ t : triples P₂ P₃, ∀ u, + k t.val.2.2 u = k t.val.1 u * k t.val.2.1 u) := by + obtain ⟨n, r, hr, ⟨e⟩⟩ := Group.IsFinitelyPresented.exists_mulEquiv_presentedGroup (G := V) + let : Finite r := hr + let k (i : Index P₂ P₃) := + (FiniteEnvelope.copy r (common P₂ P₃) (triples P₂ P₃) i).comp e.toMonoidHom + refine ⟨FiniteEnvelope.Envelope r (common P₂ P₃) (triples P₂ P₃), + inferInstance, inferInstance, k, ?_, ?_, ?_, ?_⟩ + · have hc := FiniteEnvelope.copy_same r (common P₂ P₃) (triples P₂ P₃) + ⟨(.inl P₂.identity, .inr P₃.identity), rfl⟩ + exact congrArg (fun φ => φ.comp e.toMonoidHom) hc + · have hi := FiniteEnvelope.copy_injective_of_model + (family (K₂ := K₂) (K₃ := K₃) P₂ P₃ (PresentedGroup r)) + family_common family_commute family_sum (.inl P₂.identity) family_identity_injective + exact hi.comp e.injective + · intro t u v + exact FiniteEnvelope.copy_commute t (e u) (e v) + · intro t u + exact FiniteEnvelope.copy_sum t (e u) + +end TwoEnvelope +end UniversalFInfinity + +end OAI diff --git a/lean/OAI/GroupTheory/UniversalGroup/FiniteHNN.lean b/lean/OAI/GroupTheory/UniversalGroup/FiniteHNN.lean new file mode 100644 index 0000000000000000000000000000000000000000..f27a48336a55977d3daf443e2a2912dae38468ee --- /dev/null +++ b/lean/OAI/GroupTheory/UniversalGroup/FiniteHNN.lean @@ -0,0 +1,243 @@ +import OAI.GroupTheory.UniversalGroup.Benign + +namespace OAI + +universe u v w x + +namespace Higman.HNN +open Monoid Coprod Multiplicative +variable {G : Type u} [Group G] {A B : Subgroup G} (φ : A ≃* B) + +def relation (a : A) : G ∗ Multiplicative ℤ := + (inr (ofAdd 1) * inl (a : G)) * (inl (φ a : G) * inr (ofAdd 1))⁻¹ + +theorem con_finitelyNormallyGenerated (hA : A.FG) : + (HNNExtension.con G A B φ).subgroup.IsFinitelyNormallyGenerated := by + classical + have : Group.FG A := (Group.fg_iff_subgroup_fg A).mpr hA + obtain ⟨S,hS⟩ := (Group.FG.out : (⊤ : Subgroup A).FG) + let C := HNNExtension.con G A B φ + let N : Subgroup (G ∗ Multiplicative ℤ) := + Subgroup.normalClosure (relation φ '' (S : Set A)) + let Q := (G ∗ Multiplicative ℤ) ⧸ N + let q : G ∗ Multiplicative ℤ →* Q := QuotientGroup.mk' N + let f : G →* Q := q.comp inl + let t : Q := q (inr (ofAdd 1)) + let f₀ : A →* Q := (MulAut.conj t).toMonoidHom.comp (f.comp A.subtype) + let f₁ : A →* Q := f.comp (B.subtype.comp φ.toMonoidHom) + have hgen : (S : Set A) ⊆ f₀.eqLocus f₁ := by + intro a ha + have hr : q (relation φ a) = 1 := + (QuotientGroup.eq_one_iff _).mpr (Subgroup.subset_normalClosure ⟨a,ha,rfl⟩) + have he : t * f a = f (φ a) * t := mul_inv_eq_one.mp hr + change t * f a * t⁻¹ = f (φ a) + rw [he,mul_inv_cancel_right] + have heq : f₀ = f₁ := by + apply MonoidHom.ext + intro a + have hh : (⊤ : Subgroup A) ≤ f₀.eqLocus f₁ := by + rw [← hS] + exact (Subgroup.closure_le _).mpr hgen + exact hh (Subgroup.mem_top a) + have hC : C ≤ Con.ker q := by + apply Con.conGen_le.mpr + rintro _ _ ⟨a,rfl,rfl⟩ + change t * f a = f (φ a) * t + have he : t * f a * t⁻¹ = f (φ a) := DFunLike.congr_fun heq a + rw [← he, inv_mul_cancel_right] + refine ⟨relation φ '' (S : Set A), S.finite_toSet.image _, ?_⟩ + change N = C.subgroup + apply le_antisymm + · apply Subgroup.normalClosure_le_normal + rintro _ ⟨a,_,rfl⟩ + have hr : C (inr (ofAdd 1) * inl (a : G)) + (inl (φ a : G) * inr (ofAdd 1)) := ConGen.Rel.of _ _ ⟨a,rfl,rfl⟩ + change C (relation φ a) 1 + have hh := C.mul hr (C.refl (inl (φ a : G) * inr (ofAdd 1))⁻¹) + simpa only [relation, mul_inv_cancel] using hh + · intro x hx + apply (QuotientGroup.eq_one_iff _).mp + exact (hC hx).trans (map_one q) + +theorem finitelyPresented [Group.IsFinitelyPresented G] (hA : A.FG) : + Group.IsFinitelyPresented (HNNExtension G A B φ) := by + let C := HNNExtension.con G A B φ + have hfp := Group.IsFinitelyPresented.quotient C.subgroup + (con_finitelyNormallyGenerated φ hA) + change Group.IsFinitelyPresented C.Quotient + rw [← QuotientGroup.con_subgroup C] + exact hfp + +end Higman.HNN + +namespace Higman + +structure PartialIso (G : Type u) [Group G] where + source : Subgroup G + target : Subgroup G + equiv : source ≃* target + +namespace PartialIso +variable {G : Type u} [Group G] {K : Type u} [Group K] + +noncomputable def map (p : PartialIso G) (i : G →* K) (hi : Function.Injective i) : + PartialIso K where + source := p.source.map i + target := p.target.map i + equiv := ((p.source.equivMapOfInjective i hi).symm.trans p.equiv).trans + (p.target.equivMapOfInjective i hi) + +@[simp] theorem map_equiv (p : PartialIso G) (i : G →* K) (hi : Function.Injective i) + (a : p.source) : + ((p.map i hi).equiv (p.source.equivMapOfInjective i hi a) : K) = i (p.equiv a) := by + change i (p.equiv ((p.source.equivMapOfInjective i hi).symm + (p.source.equivMapOfInjective i hi a))) = i (p.equiv a) + rw [MulEquiv.symm_apply_apply] + +def Invariant (p : PartialIso G) (R : Subgroup G) : Prop := + ∀ a : p.source, (p.equiv a : G) ∈ R ↔ (a : G) ∈ R + +theorem invariant_map (p : PartialIso G) (i : G →* K) (hi : Function.Injective i) + (R : Subgroup G) (S : Subgroup K) (he : S.comap i = R) (h : p.Invariant R) : + (p.map i hi).Invariant S := by + intro a + obtain ⟨b,rfl⟩ := (p.source.equivMapOfInjective i hi).surjective a + rw [map_equiv] + change (p.equiv b : G) ∈ S.comap i ↔ (b : G) ∈ S.comap i + rw [he] + exact h b + +end PartialIso +namespace FiniteHNN +variable {G : Type u} [Group G] [Group.IsFinitelyPresented G] + +theorem realization (ps : List (PartialIso G)) + (hfg : ∀ p ∈ ps, p.source.FG) (R : Subgroup G) + (hinv : ∀ p ∈ ps, p.Invariant R) : + ∃ (K : Type u) (_ : Group K) (_ : Group.IsFinitelyPresented K) + (i : G →* K), Function.Injective i ∧ + ∃ T : Set K, T.Finite ∧ + (Subgroup.closure (i '' (R : Set G) ∪ T)).comap i = R ∧ + ∀ p ∈ ps, ∃ t ∈ T, ∀ a : p.source, + i (p.equiv a) = t * i a * t⁻¹ := by + induction ps with + | nil => + refine ⟨G,inferInstance,inferInstance,MonoidHom.id G,Function.injective_id, + ∅,Set.finite_empty,?_,?_⟩ + · simp + · simp + | cons p ps ih => + obtain ⟨K,_,_,i,hi,T,hT,hR,hrel⟩ := ih + (fun q hq ↦ hfg q (List.mem_cons_of_mem p hq)) + (fun q hq ↦ hinv q (List.mem_cons_of_mem p hq)) + let q := p.map i hi + let E := HNNExtension K q.source q.target q.equiv + let j : K →* E := HNNExtension.of + let i' := j.comp i + let C := Subgroup.closure (i '' (R : Set G) ∪ T) + let T' : Set E := j '' T ∪ {HNNExtension.t} + have hqfg : q.source.FG := by + obtain ⟨S,hS⟩ := hfg p (List.mem_cons_self) + refine (Subgroup.fg_iff _).mpr ⟨i '' (S : Set G),?_,S.finite_toSet.image i⟩ + rw [← MonoidHom.map_closure,hS] + rfl + have hCinv : q.Invariant C := + p.invariant_map i hi R C hR (hinv p (List.mem_cons_self)) + have hC : (Subgroup.closure (j '' (C : Set K) ∪ {HNNExtension.t})).comap j = C := + HNNSubgroup.closure_comap_of q.equiv C hCinv + have hclosure : Subgroup.closure (i' '' (R : Set G) ∪ T') = + Subgroup.closure (j '' (C : Set K) ∪ {HNNExtension.t}) := by + conv_rhs => rw [Subgroup.closure_union,← MonoidHom.map_closure j (C : Set K),Subgroup.closure_eq] + change Subgroup.closure (i' '' (R : Set G) ∪ T') = + C.map j ⊔ Subgroup.closure {HNNExtension.t} + rw [show C.map j = Subgroup.closure (j '' (i '' (R : Set G) ∪ T)) from + MonoidHom.map_closure j _] + rw [← Subgroup.closure_union] + congr 1 + simp only [T',Set.image_union,Set.image_image,Set.union_assoc,i',MonoidHom.coe_comp] + rfl + refine ⟨E,inferInstance,HNN.finitelyPresented q.equiv hqfg,i', + (HNNExtension.of_injective (φ := q.equiv)).comp hi,T', + (hT.image j).union (Set.finite_singleton _),?_,?_⟩ + · rw [hclosure] + change ((Subgroup.closure (j '' (C : Set K) ∪ {HNNExtension.t})).comap j).comap i = R + rw [hC] + exact hR + · intro a ha + rcases List.mem_cons.mp ha with rfl | ha + · refine ⟨HNNExtension.t,Or.inr rfl,?_⟩ + intro b + have he := HNNExtension.equiv_eq_conj (φ := q.equiv) + (a.source.equivMapOfInjective i hi b) + simpa only [q,PartialIso.map_equiv,i',j,MonoidHom.comp_apply, + Subgroup.coe_equivMapOfInjective_apply] using he + · obtain ⟨t,ht,he⟩ := hrel a ha + refine ⟨j t,Or.inl ⟨t,ht,rfl⟩,?_⟩ + intro b + simpa only [i',MonoidHom.comp_apply,map_mul,map_inv] using congrArg j (he b) + +end FiniteHNN + +namespace PartialIso +variable {G : Type u} [Group G] + +theorem invariant_sInf (p : PartialIso G) (C : Set (Subgroup G)) + (hC : ∀ S ∈ C, p.Invariant S) : p.Invariant (sInf C) := by + intro a + simp only [Subgroup.mem_sInf] + exact forall₂_congr fun S hS ↦ hC S hS a + +end PartialIso +namespace Orbit +variable {G : Type u} [Group G] + +def subgroup (ps : List (PartialIso G)) (S : Set G) : Subgroup G := + sInf {R | S ⊆ R ∧ ∀ p ∈ ps, p.Invariant R} + +theorem subset (ps : List (PartialIso G)) (S : Set G) : + S ⊆ subgroup ps S := by + intro x hx + exact Subgroup.mem_sInf.mpr (fun R hR ↦ hR.1 hx) + +theorem invariant (ps : List (PartialIso G)) (S : Set G) (p : PartialIso G) + (hp : p ∈ ps) : p.Invariant (subgroup ps S) := + p.invariant_sInf _ (fun _ hR ↦ hR.2 p hp) + +theorem minimal (ps : List (PartialIso G)) (S : Set G) (R : Subgroup G) + (hS : S ⊆ R) (hR : ∀ p ∈ ps, p.Invariant R) : subgroup ps S ≤ R := + sInf_le ⟨hS,hR⟩ + +theorem benign [Group.IsFinitelyPresented G] (ps : List (PartialIso G)) + (hfg : ∀ p ∈ ps, p.source.FG) (S : Set G) (hS : S.Finite) : + IsBenign (subgroup ps S) := by + let R := subgroup ps S + obtain ⟨K,_,_,i,hi,T,hT,hR,hrel⟩ := FiniteHNN.realization ps hfg R + (fun p hp ↦ invariant ps S p hp) + let B := Subgroup.closure (i '' S ∪ T) + have hB : B.FG := (Subgroup.fg_iff _).mpr ⟨i '' S ∪ T, rfl, (hS.image i).union hT⟩ + refine ⟨K,inferInstance,inferInstance,i,hi,B,hB,?_⟩ + apply le_antisymm + · calc + B.comap i ≤ (Subgroup.closure (i '' (R : Set G) ∪ T)).comap i := + Subgroup.comap_mono (Subgroup.closure_mono + (Set.union_subset_union_left _ (Set.image_mono (subset ps S)))) + _ = R := hR + · apply minimal ps S (B.comap i) + · intro x hx + exact Subgroup.subset_closure (Or.inl ⟨x,hx,rfl⟩) + · intro p hp a + obtain ⟨t,ht,he⟩ := hrel p hp + have htB : t ∈ B := Subgroup.subset_closure (Or.inr ht) + change i (p.equiv a) ∈ B ↔ i a ∈ B + rw [he a] + constructor + · intro ha + have hh := B.mul_mem (B.mul_mem (B.inv_mem htB) ha) htB + simpa only [inv_mul_cancel_left,mul_assoc,inv_mul_cancel,mul_one] using hh + · intro ha + exact B.mul_mem (B.mul_mem htB ha) (B.inv_mem htB) + +end Orbit +end Higman + +end OAI diff --git a/lean/OAI/GroupTheory/UniversalGroup/GeneralPosition.lean b/lean/OAI/GroupTheory/UniversalGroup/GeneralPosition.lean new file mode 100644 index 0000000000000000000000000000000000000000..ae9c1534299452025470d4f8f36fa435dc368aff --- /dev/null +++ b/lean/OAI/GroupTheory/UniversalGroup/GeneralPosition.lean @@ -0,0 +1,459 @@ +import OAI.GroupTheory.UniversalGroup.CellRetractions + +namespace OAI + +noncomputable section + +open Set Metric Topology BigOperators +open Set Metric Topology +open Set Topology +open Set Metric Topology +open scoped NNReal + +open Set Metric Topology +open scoped NNReal ENNReal +namespace UniversalFInfinity.GeneralPosition + +lemma lipschitz_insertNth {n : ℕ} (i : Fin (n+1)) (c : ℝ) : + LipschitzWith 1 (Fin.insertNth (α := fun _ : Fin (n+1) => ℝ) i c : (Fin n → ℝ) → (Fin (n+1) → ℝ)) := by + apply LipschitzWith.of_dist_le_mul + intro x y + simp only [NNReal.coe_one,one_mul] + rw [dist_pi_le_iff dist_nonneg] + intro j + refine Fin.succAboveCases i ?_ (fun k => ?_) j + · simp only [Fin.insertNth_apply_same,dist_self,dist_nonneg] + · simp only [Fin.insertNth_apply_succAbove] + exact dist_le_pi_dist x y k + +lemma sphere_subset_faces (n : ℕ) : + Metric.sphere (0 : Fin (n+1) → ℝ) 1 ⊆ + ⋃ i : Fin (n+1), ⋃ c ∈ ({1,-1}:Set ℝ), Set.range (Fin.insertNth (α := fun _ : Fin (n+1) => ℝ) i c : (Fin n → ℝ) → _) := by + intro x hx + have hxnorm : ‖x‖ = 1 := by simpa only [Metric.mem_sphere,dist_zero_right] using hx + have hi : ∃ i, 1 ≤ ‖x i‖ := by + by_contra! hh + have := (pi_norm_lt_iff (by norm_num : (0:ℝ)<1)).mpr hh + linarith + obtain ⟨i,hi⟩ := hi + have heq : |x i| = 1 := le_antisymm ((norm_le_pi_norm x i).trans_eq hxnorm) hi + have hc : x i ∈ ({1,-1}:Set ℝ) := by + rcases abs_eq (by norm_num : (0:ℝ)≤1) |>.mp heq with h | h <;> simp [h] + refine Set.mem_iUnion.mpr ⟨i,Set.mem_iUnion.mpr ⟨x i,Set.mem_iUnion.mpr ⟨hc,?_⟩⟩⟩ + exact ⟨fun j => x (i.succAbove j),Fin.insertNth_self_removeNth _ _⟩ + +lemma dimH_cube_boundary_le (n : ℕ) : + dimH (Metric.sphere (0 : Fin (n+1) → ℝ) 1) ≤ n := by + apply (dimH_mono (sphere_subset_faces n)).trans + rw [dimH_iUnion] + apply iSup_le + intro i + rw [dimH_bUnion (Set.toFinite ({1,-1}:Set ℝ)).countable] + apply iSup_le + intro c + apply iSup_le + intro _ + exact (lipschitz_insertNth i c).dimH_range_le.trans_eq (Real.dimH_univ_pi_fin n) + +lemma dimH_cube_boundary_subtype_le (n : ℕ) : + dimH (Set.univ : Set (Metric.sphere (0 : Fin (n+1) → ℝ) 1)) ≤ n := by + rw [← isometry_subtype_coe.dimH_image] + simpa only [Subtype.range_coe_subtype,Set.image_univ,Set.ofPred_mem_eq] using dimH_cube_boundary_le n + +end UniversalFInfinity.GeneralPosition + +namespace UniversalFInfinity.Attachment + +section +open Set Metric Topology +variable {X : Type*} [TopologicalSpace X] {ι : Type*} {n : ℕ} +variable (a : ι → C(Sphere n,X)) [T2Space (Space a)] + +lemma sphere_filling_preserved {m : ℕ} (hm : m < n) + (hX : ∀ f : C(Sphere (m+1),X), SphereTopology.Extends f) + (f : C(Sphere (m+1),Space a)) : SphereTopology.Extends f := by + let := SphereTopology.sphere_nonempty m + have hdim : dimH (Set.univ : Set (Sphere (m+1))) < n := + (GeneralPosition.dimH_cube_boundary_subtype_le m).trans_lt (by exact_mod_cast hm) + obtain ⟨g,H,_⟩ := exists_deformation_into_base a f hdim + apply SphereTopology.extends_of_homotopy H + obtain ⟨F,hF⟩ := hX g + refine ⟨(⟨base a,continuous_base a⟩ : C(X,Space a)).comp F,?_⟩ + ext x + exact congrArg (base a) (ContinuousMap.congr_fun hF x) + +lemma dimH_disk_subtype_le (m : ℕ) : dimH (Set.univ : Set (Disk m)) ≤ m := by + rw [← isometry_subtype_coe.dimH_image] + have hm := dimH_mono (Set.subset_univ (closedBall (0 : Fin m → ℝ) 1)) + simpa only [Set.image_univ,Subtype.range_coe_subtype,Set.ofPred_mem_eq,Real.dimH_univ_pi_fin] using hm + +lemma filling_reflected {m : ℕ} (hm : m < n) (b : C(Sphere m,X)) + (hb : SphereTopology.Extends ((⟨base a,continuous_base a⟩ : C(X,Space a)).comp b)) : + SphereTopology.Extends b := by + obtain ⟨F,hF⟩ := hb + have hdim : dimH (Set.univ : Set (Disk m)) < n := + (dimH_disk_subtype_le m).trans_lt (by exact_mod_cast hm) + obtain ⟨g,H,hstat⟩ := exists_deformation_into_base a F hdim + refine ⟨g,?_⟩ + ext x + apply (base_closedEmbedding a).injective + have hb' : F (SphereTopology.boundary m x) = base a (b x) := ContinuousMap.congr_fun hF x + have hh := hstat 1 (SphereTopology.boundary m x) ⟨b x,hb'.symm⟩ + simpa only [ContinuousMap.Homotopy.apply_one,ContinuousMap.comp_apply,ContinuousMap.coe_mk,hb'] using hh + +end +open Set Metric Topology +variable {X : Type*} [TopologicalSpace X] [PathConnectedSpace X] +variable {ι : Type*} {n : ℕ} (a : ι → C(Sphere n,X)) [Nonempty (Sphere n)] +lemma pathConnectedSpace : PathConnectedSpace (Space a) := by + let x₀ : X := Classical.choice inferInstance + let s₀ : Sphere n := Classical.choice inferInstance + have hj : ∀ z : Space a, Joined (base a x₀) z := by + intro z + cases z with + | inl x => exact (PathConnectedSpace.joined x₀ x).map (continuous_base a) + | inr p => + have h : Joined (boundary n s₀) (interior n p.2) := PathConnectedSpace.joined _ _ + have hh := h.map (cell a p.1).continuous + rw [cell_interior,cell_boundary] at hh + exact ((PathConnectedSpace.joined x₀ (a p.1 s₀)).map (continuous_base a)).trans hh + exact ⟨⟨base a x₀⟩,fun x y => (hj x).symm.trans (hj y)⟩ +end UniversalFInfinity.Attachment + +namespace UniversalFInfinity.Cayley +open Set Metric Topology Attachment +universe u +variable {G : Type u} [Group G] [TopologicalSpace G] [DiscreteTopology G] +variable {S : Type u} (s : S → G) (rels : Set (FreeGroup S)) +variable (hrel : ∀ r ∈ rels, FreeGroup.lift s r = 1) +variable (hs : Function.Surjective (FreeGroup.lift s)) +variable (hker : (FreeGroup.lift s).ker = Subgroup.normalClosure rels) + +instance presentationCoverT2 : T2Space (PresentationCover s rels hrel) := + t2Space _ (realSeparated _ (realSeparated_of_tychonoff (Y := G))) + +instance presentationCoverCW : CWComplex (Set.univ : Set (PresentationCover s rels hrel)) := + layerCW _ (graph_dimension s) + +include hs in +lemma presentationCover_pathConnected : PathConnectedSpace (PresentationCover s rels hrel) := by + have hgen : Subgroup.closure (Set.range s) = ⊤ := by + rw [←FreeGroup.range_lift_eq_closure,MonoidHom.range_eq_top] + exact hs + let := graph_pathConnected s hgen + let := SphereTopology.sphere_nonempty 1 + exact Attachment.pathConnectedSpace _ + +include hs hker in +lemma presentationCover_sphereFill (b : C(Sphere 2,PresentationCover s rels hrel)) : SphereTopology.Extends b := by + let := SphereTopology.sphere_nonempty 1 + have hdim : dimH (Set.univ : Set (Sphere 2)) < 2 := + (GeneralPosition.dimH_cube_boundary_subtype_le 1).trans_lt (by norm_num) + obtain ⟨g,H,_⟩ := exists_deformation_into_base _ b hdim + apply SphereTopology.extends_of_homotopy H + exact SphereTopology.extends_of_nullhomotopic + (((presentationGraphNullhomotopy s rels hrel hs hker).compContinuousMap g).symm) + +include hs hker in +lemma presentationCover_simplyConnected : SimplyConnectedSpace (PresentationCover s rels hrel) := by + apply simply_connected_iff_loops_nullhomotopic.mpr + refine ⟨presentationCover_pathConnected s rels hrel hs,?_⟩ + intro x p + obtain ⟨F,hF⟩ := presentationCover_sphereFill s rels hrel hs hker (LoopSphere.map p) + apply LoopSphere.homotopic_of_fill p F + intro z + exact ContinuousMap.congr_fun hF z +end UniversalFInfinity.Cayley + +namespace UniversalFInfinity +universe u v +variable {G : Type u} [Group G] {A : Type v} [MulAction G A] + +abbrev Orbits := Quotient (MulAction.orbitRel G A) + +lemma orbit_mk_smul (g : G) (a : A) : (Quotient.mk'' (g • a) : Orbits (G := G) (A := A)) = Quotient.mk'' a := by + apply Quotient.sound + exact ⟨g,rfl⟩ + +lemma orbit_out_translate (a : A) : ∃ g : G, a = g • (Quotient.mk'' a : Orbits (G := G)).out := by + have h := Quotient.exact (Quotient.out_eq' (q := (Quotient.mk'' a : Orbits (G := G)))) + obtain ⟨g,hg⟩ := h + refine ⟨g⁻¹,?_⟩ + rw [←hg,inv_smul_smul] + +variable (hfree : ∀ (g : G) (a : A), g • a = a → g = 1) + +include hfree in +lemma orbitCoordinates_bijective : Function.Bijective (fun p : G × Orbits (G := G) (A := A) => p.1 • p.2.out) := by + constructor + · rintro ⟨g,q⟩ ⟨h,r⟩ he + have hqr : q = r := by + have hh := congrArg (fun a : A => (Quotient.mk'' a : Orbits (G := G))) he + simpa only [orbit_mk_smul,Quotient.out_eq'] using hh + subst r + change g • q.out = h • q.out at he + have hh : (h⁻¹*g) • q.out = q.out := by rw [mul_smul,he,inv_smul_smul] + have hh := hfree (h⁻¹*g) q.out hh + have hgh : g = h := (inv_mul_eq_one.mp hh).symm + exact Prod.ext hgh rfl + · intro a + obtain ⟨g,hg⟩ := orbit_out_translate (G := G) a + exact ⟨(g,Quotient.mk'' a),hg.symm⟩ + +def orbitCoordinates : (G × Orbits (G := G) (A := A)) ≃ A := + Equiv.ofBijective _ (orbitCoordinates_bijective hfree) + +lemma orbitCoordinates_apply (g : G) (q : Orbits (G := G) (A := A)) : + orbitCoordinates hfree (g,q) = g • q.out := rfl + +end UniversalFInfinity + +open Set Metric Topology +namespace UniversalFInfinity.Cellular +universe u +variable {G : Type u} [Group G] {X : Type u} [TopologicalSpace X] + [MulAction G X] [ContinuousConstSMul G X] +variable [CWComplex (univ : Set X)] {ι : ℕ → Type u} +variable (σ : ∀ n, (G × ι n) ≃ RelCWComplex.cell (univ : Set X) n) + +def actionChart (n : ℕ) (i : G × ι n) : PartialEquiv (Fin n → ℝ) X := + (RelCWComplex.map n (σ n (1,i.2))).trans (Homeomorph.smul i.1).toEquiv.toPartialEquiv + +lemma actionChart_apply (n : ℕ) (i : G × ι n) (x : Fin n → ℝ) : + actionChart σ n i x = i.1 • RelCWComplex.map n (σ n (1,i.2)) x := rfl + +lemma actionChart_image (n : ℕ) (i : G × ι n) (A : Set (Fin n → ℝ)) : + actionChart σ n i '' A = (fun x : X => i.1 • x) '' (RelCWComplex.map n (σ n (1,i.2)) '' A) := + Set.image_comp (fun x : X => i.1 • x) (RelCWComplex.map n (σ n (1,i.2))) A + +lemma actionChart_source (n : ℕ) (i : G × ι n) : + (actionChart σ n i).source = ball 0 1 := by + simp [actionChart,PartialEquiv.trans_source,RelCWComplex.source_eq] + +lemma actionChart_continuousOn (n : ℕ) (i : G × ι n) : + ContinuousOn (actionChart σ n i) (closedBall 0 1) := + (continuous_const_smul i.1).comp_continuousOn (RelCWComplex.continuousOn _ _) + +lemma actionChart_continuousOn_symm (n : ℕ) (i : G × ι n) : + ContinuousOn (actionChart σ n i).symm (actionChart σ n i).target := by + change ContinuousOn (fun y => (RelCWComplex.map n (σ n (1,i.2))).symm (i.1⁻¹ • y)) + (univ ∩ (fun y : X => i.1⁻¹ • y) ⁻¹' (RelCWComplex.map n (σ n (1,i.2))).target) + exact (RelCWComplex.continuousOn_symm _ _).comp (continuous_const_smul _).continuousOn + (fun _ h => h.2) + +variable + (ho : ∀ n (g : G) (i : ι n), + (fun x : X => g • x) '' RelCWComplex.openCell n (σ n (1,i)) = RelCWComplex.openCell n (σ n (g,i))) + (hc : ∀ n (g : G) (i : ι n), + (fun x : X => g • x) '' RelCWComplex.closedCell n (σ n (1,i)) = RelCWComplex.closedCell n (σ n (g,i))) + +include ho in +lemma actionChart_open (n : ℕ) (i : G × ι n) : + actionChart σ n i '' ball 0 1 = RelCWComplex.openCell n (σ n i) := by + rw [actionChart_image] + exact ho n i.1 i.2 + +include hc in +lemma actionChart_closed (n : ℕ) (i : G × ι n) : + actionChart σ n i '' closedBall 0 1 = RelCWComplex.closedCell n (σ n i) := by + rw [actionChart_image] + exact hc n i.1 i.2 + +omit [ContinuousConstSMul G X] in +include hc in +lemma closedCell_smul (n : ℕ) (g h : G) (i : ι n) : + (fun x : X => g • x) '' RelCWComplex.closedCell n (σ n (h,i)) = + RelCWComplex.closedCell n (σ n (g*h,i)) := by + rw [←hc n h i,←Set.image_comp] + simpa only [Function.comp_def,mul_smul] using hc n (g*h) i + +variable [T2Space X] + +@[instance_reducible] +def actionCW : CWComplex (univ : Set X) where + cell n := G × ι n + map := actionChart σ + source_eq := actionChart_source σ + continuousOn := actionChart_continuousOn σ + continuousOn_symm := actionChart_continuousOn_symm σ + pairwiseDisjoint' := by + intro p _ q _ hpq + change Disjoint (actionChart σ p.1 p.2 '' ball 0 1) (actionChart σ q.1 q.2 '' ball 0 1) + rw [actionChart_open σ ho,actionChart_open σ ho] + apply CWComplex.disjoint_openCell_of_ne + intro he + apply hpq + cases p with | mk n i => + cases q with | mk m j => + have hnm : n = m := congrArg Sigma.fst he + subst m + have hij : σ n i = σ n j := (Sigma.mk.inj he).2 |> eq_of_heq + exact congrArg (Sigma.mk n) ((σ n).injective hij) + mapsTo' := by + classical + intro n i + obtain ⟨I,hI⟩ := CWComplex.cellFrontier_subset_finite_closedCell n (σ n (1,i.2)) + let f (m : ℕ) (j : RelCWComplex.cell (univ : Set X) m) : G × ι m := + (i.1 * ((σ m).symm j).1,((σ m).symm j).2) + refine ⟨fun m => (I m).image (f m),?_⟩ + intro x hx + have h := hI (show RelCWComplex.map n (σ n (1,i.2)) x ∈ RelCWComplex.cellFrontier n (σ n (1,i.2)) from ⟨x,hx,rfl⟩) + simp only [Set.mem_iUnion] at h + obtain ⟨m,hm,j,hj,hxj⟩ := h + refine Set.mem_iUnion.mpr ⟨m,Set.mem_iUnion.mpr ⟨hm,Set.mem_iUnion.mpr + ⟨f m j,Set.mem_iUnion.mpr ⟨Finset.mem_image.mpr ⟨j,hj,rfl⟩,?_⟩⟩⟩⟩ + rw [actionChart_closed σ hc] + change i.1 • RelCWComplex.map n (σ n (1,i.2)) x ∈ RelCWComplex.closedCell m + (σ m (i.1 * ((σ m).symm j).1,((σ m).symm j).2)) + rw [←closedCell_smul σ hc] + refine ⟨_,?_,rfl⟩ + simpa only [Prod.eta,Equiv.apply_symm_apply] using hxj + closed' := by + intro A hA hclosed + apply (CWComplex.closed (univ : Set X) A hA).mpr + intro n j + obtain ⟨i,rfl⟩ := (σ n).surjective j + simpa only [actionChart_closed σ hc] using hclosed n i + union' := by + simp only [actionChart_closed σ hc] + have he (n : ℕ) : (⋃ j : G × ι n, RelCWComplex.closedCell n (σ n j)) = + ⋃ j : RelCWComplex.cell (univ : Set X) n, RelCWComplex.closedCell n j := by + ext x + simp only [mem_iUnion] + constructor + · rintro ⟨j,hj⟩; exact ⟨σ n j,hj⟩ + · rintro ⟨j,hj⟩; exact ⟨(σ n).symm j,by simpa only [Equiv.apply_symm_apply] using hj⟩ + simp_rw [he] + exact CWComplex.union + +omit [T2Space X] in +lemma actionChart_smul (n : ℕ) (g : G) (i : G × ι n) (x : Fin n → ℝ) : + actionChart σ n (g*i.1,i.2) x = g • actionChart σ n i x := by + exact mul_smul _ _ _ +end UniversalFInfinity.Cellular + +namespace UniversalFInfinity.Milnor +open Set Metric Topology UniversalFInfinity.Simplicial +universe u +variable (G : Type u) [Group G] +local instance (priority := 2000) (α : Type*) : DecidableEq (ℕ × α) := Classical.decEq (ℕ × α) + +lemma vertexTranslate_injective (g : G) : Function.Injective (fun v : ℕ × G => (v.1,g*v.2)) := by + rintro ⟨i,a⟩ ⟨j,b⟩ h + change (i,g*a) = (j,g*b) at h + apply Prod.ext + · simpa only using congrArg (fun v : ℕ × G => v.1) h + · exact mul_left_cancel (congrArg Prod.snd h) + +lemma translate_card (g : G) (s : Finset (ℕ × G)) : (translate g s).card = s.card := + Finset.card_image_of_injective _ (vertexTranslate_injective G g) + +abbrev StageCell (S : Shapes G) (n : ℕ) := Simplicial.Cell (stage G S) n + +def cellTranslate (S : Shapes G) (n : ℕ) (g : G) (c : StageCell G S n) : StageCell G S n := + ⟨⟨translate g c.1.1,orbitSpan_invariant _ g c.1.2⟩,by rw [translate_card]; exact c.2⟩ + +instance cellAction (S : Shapes G) (n : ℕ) : MulAction G (StageCell G S n) where + smul := cellTranslate G S n + one_smul c := by apply Subtype.ext; apply Subtype.ext; exact translate_one _ + mul_smul g h c := by apply Subtype.ext; apply Subtype.ext; exact (translate_mul _ _ _).symm + +lemma cell_smul_val (S : Shapes G) (n : ℕ) (g : G) (c : StageCell G S n) : + (g • c).1.1 = translate g c.1.1 := rfl + +lemma cellAction_free (S : Shapes G) (n : ℕ) (g : G) (c : StageCell G S n) + (h : g • c = c) : g = 1 := by + have he : translate g c.1.1 = c.1.1 := congrArg (fun c : StageCell G S n => c.1.1) h + obtain ⟨v,hv⟩ := c.1.2.1.1 + have ht : (v.1,g*v.2) ∈ c.1.1 := he ▸ Finset.mem_image.mpr ⟨v,hv,rfl⟩ + have heq := c.1.2.1.2 ht hv rfl + have hg : g * v.2 = v.2 := congrArg Prod.snd heq + exact mul_right_cancel (hg.trans (one_mul _).symm) + +abbrev CellOrbits (S : Shapes G) (n : ℕ) := Orbits (G := G) (A := StageCell G S n) + +def cellCoordinates (S : Shapes G) (n : ℕ) : (G × CellOrbits G S n) ≃ StageCell G S n := + orbitCoordinates (cellAction_free G S n) + +lemma cellCoordinates_apply (S : Shapes G) (n : ℕ) (g : G) (c : CellOrbits G S n) : + cellCoordinates G S n (g,c) = g • c.out := rfl + +instance cellOrbits_finite (S : Shapes G) (n : ℕ) : Finite (CellOrbits G S n) := by + classical + obtain ⟨T,hT⟩ := orbitSpan_finite_representatives (basedShapes G S) + let R : Set (StageCell G S n) := {c | c.1.1 ∈ T} + have hinj : Function.Injective (fun c : StageCell G S n => c.1.1) := by + intro c d h; exact Subtype.ext (Subtype.ext h) + have hR : R.Finite := T.finite_toSet.preimage hinj.injOn + let := hR.fintype + apply Finite.of_surjective (fun c : R => (Quotient.mk'' c.1 : CellOrbits G S n)) + intro q + obtain ⟨s,hs,g,hg⟩ := hT q.out.1.1 q.out.1.2 + let c : StageCell G S n := g⁻¹ • q.out + have hc : c ∈ R := by + change translate g⁻¹ q.out.1.1 ∈ T + rw [hg,translate_mul,inv_mul_cancel,translate_one] + exact hs + refine ⟨⟨c,hc⟩,?_⟩ + exact (orbit_mk_smul g⁻¹ q.out).trans (Quotient.out_eq' _) + +lemma stage_smul_support (S : Shapes G) (g : G) (x : Stage G S) : + (g • x).1.support = translate g x.1.support := + Finsupp.mapDomain_support_of_injective (vertexTranslate_injective G g) _ + +lemma stage_openCell (S : Shapes G) (n : ℕ) (c : StageCell G S n) : + RelCWComplex.openCell (C := (univ : Set (Stage G S))) n c = {x : Stage G S | x.1.support = c.1.1} := + Simplicial.characteristicPE_open _ _ + +lemma stage_closedCell (S : Shapes G) (n : ℕ) (c : StageCell G S n) : + RelCWComplex.closedCell (C := (univ : Set (Stage G S))) n c = {x : Stage G S | x.1.support ⊆ c.1.1} := by + change Simplicial.characteristicPE _ c '' closedBall 0 1 = _ + rw [Simplicial.characteristicPE_closed,Simplicial.range_faceMap] + +lemma stage_openCell_smul (S : Shapes G) (n : ℕ) (g : G) (c : StageCell G S n) : + (fun x : Stage G S => g • x) '' RelCWComplex.openCell (C := (univ : Set (Stage G S))) n c = RelCWComplex.openCell (C := (univ : Set (Stage G S))) n (g • c) := by + rw [stage_openCell,stage_openCell] + ext x + constructor + · rintro ⟨y,hy,rfl⟩ + change (g • y).1.support = (g • c).1.1 + rw [stage_smul_support,cell_smul_val,hy] + · intro hx + refine ⟨g⁻¹ • x,?_,smul_inv_smul _ _⟩ + change (g⁻¹ • x).1.support = c.1.1 + change x.1.support = translate g c.1.1 at hx + rw [stage_smul_support,hx,translate_mul,inv_mul_cancel,translate_one] + +lemma stage_closedCell_smul (S : Shapes G) (n : ℕ) (g : G) (c : StageCell G S n) : + (fun x : Stage G S => g • x) '' RelCWComplex.closedCell (C := (univ : Set (Stage G S))) n c = RelCWComplex.closedCell (C := (univ : Set (Stage G S))) n (g • c) := by + rw [stage_closedCell,stage_closedCell] + ext x + constructor + · rintro ⟨y,hy,rfl⟩ + change (g • y).1.support ⊆ (g • c).1.1 + rw [stage_smul_support,cell_smul_val] + exact translate_mono _ hy + · intro hx + refine ⟨g⁻¹ • x,?_,smul_inv_smul _ _⟩ + change (g⁻¹ • x).1.support ⊆ c.1.1 + rw [stage_smul_support] + have h := translate_mono g⁻¹ hx + simpa only [cell_smul_val,translate_mul,inv_mul_cancel,translate_one] using h + +@[instance_reducible] +def stageEquivariantCW (S : Shapes G) : CWComplex (univ : Set (Stage G S)) := + Cellular.actionCW (cellCoordinates G S) + (fun n g i => by + change (fun x : Stage G S => g • x) '' RelCWComplex.openCell (C := (univ : Set (Stage G S))) n ((1:G) • i.out) = RelCWComplex.openCell (C := (univ : Set (Stage G S))) n (g • i.out) + rw [one_smul] + exact stage_openCell_smul G S n g i.out) + (fun n g i => by + change (fun x : Stage G S => g • x) '' RelCWComplex.closedCell (C := (univ : Set (Stage G S))) n ((1:G) • i.out) = RelCWComplex.closedCell (C := (univ : Set (Stage G S))) n (g • i.out) + rw [one_smul] + exact stage_closedCell_smul G S n g i.out) + +end UniversalFInfinity.Milnor + +end + +end OAI diff --git a/lean/OAI/GroupTheory/UniversalGroup/GraphActions.lean b/lean/OAI/GroupTheory/UniversalGroup/GraphActions.lean new file mode 100644 index 0000000000000000000000000000000000000000..1aa21872455f171841b6b1f6768117bd671277ee --- /dev/null +++ b/lean/OAI/GroupTheory/UniversalGroup/GraphActions.lean @@ -0,0 +1,341 @@ +import OAI.GroupTheory.UniversalGroup.GraphBundles + +namespace OAI + +noncomputable section + +open Set Metric Topology BigOperators +open Set Metric Topology +open Set Topology +open Set Metric Topology +open scoped NNReal +open Set Metric Topology +open scoped NNReal ENNReal +open Set Metric Topology +open scoped TensorProduct + +namespace UniversalFInfinity.GraphBundle + +section +open Set Topology +open scoped unitInterval +universe u v w +variable {C : Type u} {A : Type v} [TopologicalSpace A] {B : Type w} [TopologicalSpace B] +variable (τ : C → C) (L R : C → C(B,A)) + +lemma edgeImage_edge_slice [DecidableEq C] (c d : C) (S : Set (I × B)) : + (fun z : I × B => edge τ L R d z.1 z.2) ⁻¹' + ((fun z : I × B => edge τ L R c z.1 z.2) '' S) = + (if d = c then S else ∅) ∪ + ({0} ×ˢ ((L d) ⁻¹' ((vertex τ L R d) ⁻¹' + ((fun z : I × B => edge τ L R c z.1 z.2) '' S)))) ∪ + ({1} ×ˢ ((R d) ⁻¹' ((vertex τ L R (τ d)) ⁻¹' + ((fun z : I × B => edge τ L R c z.1 z.2) '' S)))) := by + classical + ext ⟨t,x⟩ + constructor + · intro hz + by_cases h0 : t = 0 + · subst t + change edge τ L R d 0 x ∈ ((fun z : I × B => edge τ L R c z.1 z.2) '' S) at hz + exact Or.inl (Or.inr ⟨rfl,by + change vertex τ L R d (L d x) ∈ ((fun z : I × B => edge τ L R c z.1 z.2) '' S) + rw [edge_zero] at hz; exact hz⟩) + · by_cases h1 : t = 1 + · subst t + change edge τ L R d 1 x ∈ ((fun z : I × B => edge τ L R c z.1 z.2) '' S) at hz + exact Or.inr ⟨rfl,by + change vertex τ L R (τ d) (R d x) ∈ ((fun z : I × B => edge τ L R c z.1 z.2) '' S) + rw [edge_one] at hz; exact hz⟩ + · let s : Inner := ⟨t.1,lt_of_le_of_ne t.2.1 (fun h => h0 (Subtype.ext h.symm)), + lt_of_le_of_ne t.2.2 (fun h => h1 (Subtype.ext h))⟩ + have he : edge τ L R d t x = interior τ L R d s x := edge_inner τ L R d s x + obtain ⟨z,hz,hze⟩ := hz + have hm : z ∈ (fun z : I × B => edge τ L R c z.1 z.2) ⁻¹' {interior τ L R d s x} := hze.trans he + rw [interior_preimage] at hm + split_ifs at hm with hcd + · change z = (t,x) at hm + exact Or.inl (Or.inl (by rw [ite_eq_left hcd.symm]; exact hm ▸ hz)) + · exact False.elim hm + · rintro ((hz|hz)|hz) + · split_ifs at hz with hdc + · subst d; exact ⟨(t,x),hz,rfl⟩ + · exact False.elim hz + · rcases hz with ⟨h0,hx⟩ + change t = 0 at h0 + subst t + change edge τ L R d 0 x ∈ ((fun z : I × B => edge τ L R c z.1 z.2) '' S) + rw [edge_zero] + exact hx + · rcases hz with ⟨h1,hx⟩ + change t = 1 at h1 + subst t + change edge τ L R d 1 x ∈ ((fun z : I × B => edge τ L R c z.1 z.2) '' S) + rw [edge_one] + exact hx + +lemma edge_injective (c : C) (hτ : τ c ≠ c) (hL : Function.Injective (L c)) + (hR : Function.Injective (R c)) : Function.Injective (fun z : I × B => edge τ L R c z.1 z.2) := by + classical + rintro ⟨t,x⟩ ⟨s,y⟩ he + by_cases h0 : t = 0 + · subst t + have he' : edge τ L R c s y = vertex τ L R c (L c x) := he.symm.trans (edge_zero τ L R c x) + rcases (edge_eq_vertex τ L R c c s y (L c x)).mp he' with ⟨rfl,_,hy⟩|⟨_,ht,_⟩ + · exact Prod.ext rfl (hL hy).symm + · exact False.elim (hτ ht) + · by_cases h1 : t = 1 + · subst t + have he' : edge τ L R c s y = vertex τ L R (τ c) (R c x) := he.symm.trans (edge_one τ L R c x) + rcases (edge_eq_vertex τ L R c (τ c) s y (R c x)).mp he' with ⟨_,ht,_⟩|⟨rfl,_,hy⟩ + · exact False.elim (hτ ht.symm) + · exact Prod.ext rfl (hR hy).symm + · let r : Inner := ⟨t.1,lt_of_le_of_ne t.2.1 (fun h => h0 (Subtype.ext h.symm)), + lt_of_le_of_ne t.2.2 (fun h => h1 (Subtype.ext h))⟩ + have ht : edge τ L R c t x = interior τ L R c r x := edge_inner τ L R c r x + have hm : (s,y) ∈ (fun z : I × B => edge τ L R c z.1 z.2) ⁻¹' {interior τ L R c r x} := he.symm.trans ht + rw [interior_preimage,ite_eq_left rfl] at hm + exact (show (s,y) = (t,x) from hm).symm + +variable [TopologicalSpace C] [DiscreteTopology C] +lemma edge_closedMap (c : C) (hL : IsClosedMap (L c)) (hR : IsClosedMap (R c)) : + IsClosedMap (fun z : I × B => edge τ L R c z.1 z.2) := by + classical + intro S hS + apply (isClosed_iff τ L R _).mpr + refine ⟨fun d => edgeImage_vertex_closed τ L R c d S hS hL hR,fun d => ?_⟩ + rw [edgeImage_edge_slice] + apply IsClosed.union + · apply IsClosed.union + · split_ifs; exact hS; exact isClosed_empty + · exact isClosed_singleton.prod ((edgeImage_vertex_closed τ L R c d S hS hL hR).preimage (L d).continuous) + · exact isClosed_singleton.prod ((edgeImage_vertex_closed τ L R c (τ d) S hS hL hR).preimage (R d).continuous) + +lemma edge_closedEmbedding (c : C) (hτ : τ c ≠ c) (hL : IsClosedEmbedding (L c)) + (hR : IsClosedEmbedding (R c)) : IsClosedEmbedding (fun z : I × B => edge τ L R c z.1 z.2) := + IsClosedEmbedding.of_continuous_injective_isClosedMap (edgeMap τ L R c).continuous + (edge_injective τ L R c hτ hL.injective hR.injective) + (edge_closedMap τ L R c hL.isClosedMap hR.isClosedMap) +end + +open Set Topology +open scoped unitInterval +universe u v w z +variable {C : Type u} [TopologicalSpace C] [DiscreteTopology C] +variable {A : Type v} [TopologicalSpace A] {B : Type w} [TopologicalSpace B] +variable (τ : C → C) (L R : C → C(B,A)) +variable {Y : Type z} [TopologicalSpace Y] + +omit [DiscreteTopology C] in +lemma hom_ext {f g : C(Space τ L R,Y)} + (hv : ∀ c x,f (vertex τ L R c x) = g (vertex τ L R c x)) + (he : ∀ c (z : I × B),f (edge τ L R c z.1 z.2) = g (edge τ L R c z.1 z.2)) : f = g := by + apply ContinuousMap.ext + intro z + change Core (C := C) (A := A) (B := B) at z + cases z with + | inl z => exact hv z.1 z.2 + | inr z => + have hh := he z.1 (⟨z.2.1.1,z.2.1.2.1.le,z.2.1.2.2.le⟩,z.2.2) + rw [edge_inner] at hh + exact hh + +variable (f g : C(Space τ L R,Y)) +variable (V : ∀ c,(f.comp (vertexMap τ L R c)).Homotopy (g.comp (vertexMap τ L R c))) +variable (E : ∀ c,(f.comp (edgeMap τ L R c)).Homotopy (g.comp (edgeMap τ L R c))) +variable (hE0 : ∀ c t x,E c (t,(0,x)) = V c (t,L c x)) +variable (hE1 : ∀ c t x,E c (t,(1,x)) = V (τ c) (t,R c x)) + +def homotopyPaths : C(Space τ L R,C(I,Y)) := + lift τ L R (fun c => ContinuousMap.curry ((V c).toContinuousMap.comp ⟨Prod.swap,continuous_swap⟩)) + (fun c => ContinuousMap.curry ((E c).toContinuousMap.comp ⟨Prod.swap,continuous_swap⟩)) (by + intro c x; apply ContinuousMap.ext; intro t; exact hE0 c t x) (by + intro c x; apply ContinuousMap.ext; intro t; exact hE1 c t x) + +def homotopy : f.Homotopy g where + toFun z := homotopyPaths τ L R f g V E hE0 hE1 z.2 z.1 + continuous_toFun := (homotopyPaths τ L R f g V E hE0 hE1).uncurry.continuous.comp continuous_swap + map_zero_left z := by + change Core (C := C) (A := A) (B := B) at z + cases z with + | inl z => exact (V z.1).apply_zero z.2 + | inr z => + have he := (E z.1).apply_zero (⟨z.2.1.1,z.2.1.2.1.le,z.2.1.2.2.le⟩,z.2.2) + change E z.1 (0,(⟨z.2.1.1,z.2.1.2.1.le,z.2.1.2.2.le⟩,z.2.2)) = f (edge τ L R z.1 ⟨z.2.1.1,z.2.1.2.1.le,z.2.1.2.2.le⟩ z.2.2) at he + rw [edge_inner] at he + exact he + map_one_left z := by + change Core (C := C) (A := A) (B := B) at z + cases z with + | inl z => exact (V z.1).apply_one z.2 + | inr z => + have he := (E z.1).apply_one (⟨z.2.1.1,z.2.1.2.1.le,z.2.1.2.2.le⟩,z.2.2) + change E z.1 (1,(⟨z.2.1.1,z.2.1.2.1.le,z.2.1.2.2.le⟩,z.2.2)) = g (edge τ L R z.1 ⟨z.2.1.1,z.2.1.2.1.le,z.2.1.2.2.le⟩ z.2.2) at he + rw [edge_inner] at he + exact he +end UniversalFInfinity.GraphBundle + +namespace UniversalFInfinity.PathFamilies +open scoped unitInterval +universe u v +variable {J : Type u} [TopologicalSpace J] {Y : Type v} [TopologicalSpace Y] +def intervalPath : Path (0:I) 1 where + toFun := id + continuous_toFun := continuous_id + source' := rfl + target' := rfl + +def unpause : C(I × I,I) := (Path.Homotopy.transRefl intervalPath).toContinuousMap + +lemma transRefl_natural {x y : Y} (p : Path x y) (z : I × I) : + Path.Homotopy.transRefl p z = p (unpause z) := rfl + +lemma continuous_transRefl {a b : J → Y} (p : ∀ j,Path (a j) (b j)) + (hp : Continuous (fun z : J × I => p z.1 z.2)) : + Continuous (fun z : J × (I × I) => Path.Homotopy.transRefl (p z.1) z.2) := by + change Continuous (fun z : J × (I × I) => p z.1 (unpause z.2)) + exact hp.comp (continuous_fst.prodMk (unpause.continuous.comp continuous_snd)) +end UniversalFInfinity.PathFamilies + +namespace UniversalFInfinity.GraphBundle + +section +open Set Topology +open scoped unitInterval +universe u v w +variable {C : Type u} [TopologicalSpace C] [DiscreteTopology C] +variable {A : Type v} [TopologicalSpace A] {B : Type w} [TopologicalSpace B] +variable (τ : C → C) (L R : C → C(B,A)) + +def edgePath (c : C) (x : B) : Path (vertex τ L R c (L c x)) (vertex τ L R (τ c) (R c x)) where + toFun t := edge τ L R c t x + continuous_toFun := (edgeMap τ L R c).continuous.comp (continuous_id.prodMk continuous_const) + source' := edge_zero τ L R c x + target' := edge_one τ L R c x + +omit [DiscreteTopology C] in +lemma edgePath_continuous (c : C) : Continuous (fun z : B × I => edgePath τ L R c z.1 z.2) := + (edgeMap τ L R c).continuous.comp continuous_swap + +def pausedEdge (c : C) (x : B) := (edgePath τ L R c x).trans (Path.refl _) +omit [DiscreteTopology C] in +lemma pausedEdge_continuous (c : C) : Continuous (fun z : B × I => pausedEdge τ L R c z.1 z.2) := + Path.trans_continuous_family (edgePath τ L R c) (edgePath_continuous τ L R c) + (fun x => Path.refl (vertex τ L R (τ c) (R c x))) + ((vertexMap τ L R (τ c)).continuous.comp ((R c).continuous.comp continuous_fst)) + +def pause : C(Space τ L R,Space τ L R) := + lift τ L R (vertexMap τ L R) + (fun c => ⟨fun z => pausedEdge τ L R c z.2 z.1,(pausedEdge_continuous τ L R c).comp continuous_swap⟩) + (fun c x => (pausedEdge τ L R c x).source) + (fun c x => (pausedEdge τ L R c x).target) +lemma pause_vertex (c : C) (x : A) : pause τ L R (vertex τ L R c x) = vertex τ L R c x := rfl +lemma pause_edge (c : C) (z : I × B) : pause τ L R (edge τ L R c z.1 z.2) = pausedEdge τ L R c z.2 z.1 := + lift_edge τ L R _ _ _ _ c z + +def pauseVertexHomotopy (c : C) : + ((pause τ L R).comp (vertexMap τ L R c)).Homotopy ((ContinuousMap.id _).comp (vertexMap τ L R c)) := + ContinuousMap.Homotopy.refl (vertexMap τ L R c) + +omit [DiscreteTopology C] in +lemma pauseEdgeHomotopy_continuous (c : C) : + Continuous (fun z : I × (I × B) => + Path.Homotopy.transRefl (edgePath τ L R c z.2.2) (z.1,z.2.1)) := by + change Continuous (fun z : I × (I × B) => + edge τ L R c (PathFamilies.unpause (z.1,z.2.1)) z.2.2) + exact (edgeMap τ L R c).continuous.comp + ((PathFamilies.unpause.continuous.comp (continuous_fst.prodMk continuous_snd.fst)).prodMk + continuous_snd.snd) + +def pauseEdgeHomotopy (c : C) : + ((pause τ L R).comp (edgeMap τ L R c)).Homotopy ((ContinuousMap.id _).comp (edgeMap τ L R c)) where + toFun z := Path.Homotopy.transRefl (edgePath τ L R c z.2.2) (z.1,z.2.1) + continuous_toFun := pauseEdgeHomotopy_continuous τ L R c + map_zero_left z := by + change Path.Homotopy.transRefl (edgePath τ L R c z.2) (0,z.1) = pause τ L R (edge τ L R c z.1 z.2) + rw [pause_edge] + exact (Path.Homotopy.transRefl (edgePath τ L R c z.2)).apply_zero z.1 + map_one_left z := (Path.Homotopy.transRefl (edgePath τ L R c z.2)).apply_one z.1 + +def pauseHomotopy : (pause τ L R).Homotopy (ContinuousMap.id _) := + homotopy τ L R (pause τ L R) (ContinuousMap.id _) (pauseVertexHomotopy τ L R) + (pauseEdgeHomotopy τ L R) (fun c t x => (Path.Homotopy.transRefl (edgePath τ L R c x)).source t) + (fun c t x => (Path.Homotopy.transRefl (edgePath τ L R c x)).target t) +end + +section +open Set Topology +open scoped unitInterval +universe u v w z +variable {C : Type u} [TopologicalSpace C] [DiscreteTopology C] +variable {D : Type v} [TopologicalSpace D] [DiscreteTopology D] +variable {A : Type w} [TopologicalSpace A] {B : Type z} [TopologicalSpace B] +variable (τ : C → C) (F : C → C(A,A)) (ν : D → D) (K : D → C(B,B)) +variable (sig : C → D) (hsig : ∀ c,sig (τ c) = ν (sig c)) (a : C → C(A,B)) +variable (ha : ∀ c x,a (τ c) (F c x) = K (sig c) (a c x)) + +def homogeneousMap : C(Space τ (fun _ => .id A) F,Space ν (fun _ => .id B) K) := + lift τ (fun _ => .id A) F + (fun c => (vertexMap ν (fun _ => .id B) K (sig c)).comp (a c)) + (fun c => (edgeMap ν (fun _ => .id B) K (sig c)).comp + ⟨fun z => (z.1,a c z.2), continuous_fst.prodMk ((a c).continuous.comp continuous_snd)⟩) + (fun c x => edge_zero ν _ K (sig c) (a c x)) + (fun c x => by change edge ν _ K (sig c) 1 (a c x) = vertex ν _ K (sig (τ c)) (a (τ c) (F c x)); rw [edge_one,hsig,ha]) +omit [DiscreteTopology D] in +lemma homogeneousMap_vertex (c : C) (x : A) : + homogeneousMap τ F ν K sig hsig a ha (vertex τ (fun _ => .id A) F c x) = + vertex ν (fun _ => .id B) K (sig c) (a c x) := rfl +omit [DiscreteTopology D] in +lemma homogeneousMap_edge (c : C) (t : I) (x : A) : + homogeneousMap τ F ν K sig hsig a ha (edge τ (fun _ => .id A) F c t x) = + edge ν (fun _ => .id B) K (sig c) t (a c x) := lift_edge τ _ F _ _ _ _ c (t,x) +end + +open Set Topology +open scoped unitInterval +universe u v w +variable {G : Type u} [Group G] +variable {C : Type v} [TopologicalSpace C] [DiscreteTopology C] [MulAction G C] +variable {A : Type w} [TopologicalSpace A] +variable (τ : C → C) (F : C → C(A,A)) (hτ : ∀ (g : G) c,τ (g • c) = g • τ c) +variable (a : G → C → C(A,A)) +variable (ha : ∀ (g : G) c x,a g (τ c) (F c x) = F (g • c) (a g c x)) +variable (a_one : ∀ c x,a 1 c x = x) +variable (a_mul : ∀ (g h : G) c x,a (g*h) c x = a g (h • c) (a h c x)) + +def actionMap (g : G) : C(Space τ (fun _ => .id A) F,Space τ (fun _ => .id A) F) := + homogeneousMap τ F τ F (g • ·) (fun c => (hτ g c).symm) (a g) (ha g) +lemma actionMap_vertex (g : G) (c : C) (x : A) : + actionMap τ F hτ a ha g (vertex τ (fun _ => .id A) F c x) = + vertex τ (fun _ => .id A) F (g • c) (a g c x) := rfl +lemma actionMap_edge (g : G) (c : C) (t : I) (x : A) : + actionMap τ F hτ a ha g (edge τ (fun _ => .id A) F c t x) = + edge τ (fun _ => .id A) F (g • c) t (a g c x) := + homogeneousMap_edge τ F τ F _ _ _ _ c t x + +@[instance_reducible] +def graphAction : MulAction G (Space τ (fun _ => .id A) F) where + smul g x := actionMap τ F hτ a ha g x + one_smul x := by + have he : actionMap τ F hτ a ha 1 = ContinuousMap.id _ := by + apply hom_ext τ (fun _ => .id A) F + · intro c y; rw [actionMap_vertex,one_smul,a_one]; rfl + · intro c z; rw [actionMap_edge,one_smul,a_one]; rfl + exact ContinuousMap.congr_fun he x + mul_smul g h x := by + have he : actionMap τ F hτ a ha (g*h) = (actionMap τ F hτ a ha g).comp (actionMap τ F hτ a ha h) := by + apply hom_ext τ (fun _ => .id A) F + · intro c y; simp only [ContinuousMap.comp_apply,actionMap_vertex,mul_smul,a_mul] + · intro c z; simp only [ContinuousMap.comp_apply,actionMap_edge,mul_smul,a_mul] + exact ContinuousMap.congr_fun he x + +lemma graphAction_continuous : @ContinuousConstSMul G (Space τ (fun _ => .id A) F) _ + (graphAction τ F hτ a ha a_one a_mul).toSMul := +by + let := graphAction τ F hτ a ha a_one a_mul + exact ⟨fun g => (actionMap τ F hτ a ha g).continuous⟩ +end UniversalFInfinity.GraphBundle + +end + +end OAI diff --git a/lean/OAI/GroupTheory/UniversalGroup/GraphBundles.lean b/lean/OAI/GroupTheory/UniversalGroup/GraphBundles.lean new file mode 100644 index 0000000000000000000000000000000000000000..254df3f57f0d29c028b9b3013f78101600cc6cf0 --- /dev/null +++ b/lean/OAI/GroupTheory/UniversalGroup/GraphBundles.lean @@ -0,0 +1,412 @@ +import OAI.GroupTheory.UniversalGroup.SphereHomotopies + +namespace OAI + +noncomputable section + +open Set Metric Topology BigOperators +open Set Metric Topology +open Set Topology +open Set Metric Topology +open scoped NNReal +open Set Metric Topology +open scoped NNReal ENNReal +open Set Metric Topology +open scoped TensorProduct + +namespace UniversalFInfinity.GraphBundle + +section +open Set Topology +open scoped unitInterval +universe u v w z +variable {C : Type u} +variable {A : Type v} [TopologicalSpace A] {B : Type w} [TopologicalSpace B] +variable (τ : C → C) (L R : C → C(B,A)) + +abbrev Inner := Set.Ioo (0:ℝ) 1 +abbrev Core := (C × A) ⊕ (C × (Inner × B)) +def Space (_ : C → C) (_ _ : C → C(B,A)) := Core (C := C) (A := A) (B := B) +def vertex (c : C) (x : A) : Space τ L R := Sum.inl (c,x) +def interior (c : C) (s : Inner) (x : B) : Space τ L R := Sum.inr (c,(s,x)) + +def edge (c : C) (t : I) (x : B) : Space τ L R := by + classical + exact if h0 : t = 0 then vertex τ L R c (L c x) else + if h1 : t = 1 then vertex τ L R (τ c) (R c x) else + interior τ L R c ⟨t.1,lt_of_le_of_ne t.2.1 (fun h => h0 (Subtype.ext h.symm)), + lt_of_le_of_ne t.2.2 (fun h => h1 (Subtype.ext h))⟩ x + +lemma edge_zero (c : C) (x : B) : edge τ L R c 0 x = vertex τ L R c (L c x) := by simp [edge] +lemma edge_one (c : C) (x : B) : edge τ L R c 1 x = vertex τ L R (τ c) (R c x) := by simp [edge] +lemma edge_inner (c : C) (s : Inner) (x : B) : + edge τ L R c ⟨s.1,s.2.1.le,s.2.2.le⟩ x = interior τ L R c s x := by + unfold edge + split_ifs with h0 h1 + · exact False.elim (s.2.1.ne' (congrArg Subtype.val h0)) + · exact False.elim (s.2.2.ne (congrArg Subtype.val h1)) + · rfl + +variable [TopologicalSpace C] [DiscreteTopology C] + +abbrev Raw := (C × A) ⊕ (C × (I × B)) +def quotient : Raw (C := C) (A := A) (B := B) → Space τ L R := + Sum.elim (fun z => vertex τ L R z.1 z.2) (fun z => edge τ L R z.1 z.2.1 z.2.2) +instance : TopologicalSpace (Space τ L R) := + TopologicalSpace.coinduced (quotient τ L R) inferInstance + +omit [DiscreteTopology C] in +lemma continuous_quotient : Continuous (quotient τ L R) := continuous_coinduced_rng +omit [DiscreteTopology C] in +lemma continuous_vertex : Continuous (fun z : C × A => vertex τ L R z.1 z.2) := + (continuous_quotient τ L R).comp continuous_inl +omit [DiscreteTopology C] in +lemma continuous_edge : Continuous (fun z : C × (I × B) => edge τ L R z.1 z.2.1 z.2.2) := + (continuous_quotient τ L R).comp continuous_inr + +def vertexMap (c : C) : C(A,Space τ L R) := + ⟨vertex τ L R c,(continuous_vertex τ L R).comp (continuous_const.prodMk continuous_id)⟩ +def edgeMap (c : C) : C(I × B,Space τ L R) := + ⟨fun z => edge τ L R c z.1 z.2,(continuous_edge τ L R).comp (continuous_const.prodMk continuous_id)⟩ + +lemma continuous_iff {Y : Type z} [TopologicalSpace Y] (f : Space τ L R → Y) : + Continuous f ↔ (∀ c,Continuous (fun x => f (vertex τ L R c x))) ∧ + ∀ c,Continuous (fun z : I × B => f (edge τ L R c z.1 z.2)) := by + change Continuous[TopologicalSpace.coinduced (quotient τ L R) inferInstance,_] f ↔ _ + rw [continuous_coinduced_dom,continuous_sum_dom] + exact and_congr continuous_prod_of_discrete_left continuous_prod_of_discrete_left + +lemma closed_of_slices {D : Type*} [TopologicalSpace D] {S : Set (C × D)} + (h : ∀ c,IsClosed ((fun x => (c,x)) ⁻¹' S)) : IsClosed S := by + rw [←isOpen_compl_iff] + apply isOpen_iff_forall_mem_open.mpr + intro z hz + refine ⟨{z.1} ×ˢ ((fun x => (z.1,x)) ⁻¹' S)ᶜ,?_, + (isOpen_discrete {z.1}).prod (h z.1).isOpen_compl,⟨rfl,hz⟩⟩ + intro p hp + have he : p.1 = z.1 := hp.1 + simpa only [Set.mem_compl_iff,Set.mem_preimage,←he] using hp.2 + +lemma isClosed_iff (S : Set (Space τ L R)) : + IsClosed S ↔ (∀ c,IsClosed ((vertex τ L R c) ⁻¹' S)) ∧ + ∀ c,IsClosed ((fun z : I × B => edge τ L R c z.1 z.2) ⁻¹' S) := by + change @IsClosed _ (TopologicalSpace.coinduced (quotient τ L R) inferInstance) S ↔ _ + rw [isClosed_coinduced,isClosed_sum_iff] + constructor + · rintro ⟨hv,he⟩ + exact ⟨fun c => hv.preimage (continuous_const.prodMk continuous_id), + fun c => he.preimage (continuous_const.prodMk continuous_id)⟩ + · rintro ⟨hv,he⟩ + exact ⟨closed_of_slices hv,closed_of_slices he⟩ + +variable {Y : Type z} [TopologicalSpace Y] +variable (v : C → C(A,Y)) (e : C → C(I × B,Y)) +variable (he0 : ∀ c x,e c (0,x) = v c (L c x)) +variable (he1 : ∀ c x,e c (1,x) = v (τ c) (R c x)) + +def liftFun : Space τ L R → Y := + Sum.elim (fun z => v z.1 z.2) (fun z => e z.1 (⟨z.2.1.1,z.2.1.2.1.le,z.2.1.2.2.le⟩,z.2.2)) +omit [TopologicalSpace C] [DiscreteTopology C] in +lemma liftFun_vertex (c : C) (x : A) : liftFun τ L R v e (vertex τ L R c x) = v c x := rfl +omit [TopologicalSpace C] [DiscreteTopology C] in +include he0 he1 in +lemma liftFun_edge (c : C) (t : I) (x : B) : liftFun τ L R v e (edge τ L R c t x) = e c (t,x) := by + classical + unfold edge + split_ifs with h0 h1 + · subst t; exact (he0 c x).symm + · subst t; exact (he1 c x).symm + · rfl + +def lift : C(Space τ L R,Y) := + ⟨liftFun τ L R v e,(continuous_iff τ L R _).mpr + ⟨fun c => (v c).continuous,fun c => by + have h : (fun z : I × B => liftFun τ L R v e (edge τ L R c z.1 z.2)) = e c := by + funext z; exact liftFun_edge τ L R v e he0 he1 c z.1 z.2 + rw [h]; exact (e c).continuous⟩⟩ +lemma lift_vertex (c : C) (x : A) : lift τ L R v e he0 he1 (vertex τ L R c x) = v c x := rfl +lemma lift_edge (c : C) (z : I × B) : lift τ L R v e he0 he1 (edge τ L R c z.1 z.2) = e c z := + liftFun_edge τ L R v e he0 he1 c z.1 z.2 +end + +section +open Set Topology +open scoped unitInterval +universe u v w z +variable {C : Type u} [TopologicalSpace C] [DiscreteTopology C] +variable {A : Type v} [TopologicalSpace A] {B : Type w} [TopologicalSpace B] +variable (τ : C → C) (L R : C → C(B,A)) + +omit [TopologicalSpace C] [DiscreteTopology C] in +lemma edge_preimage_vertices (S : Set (C × A)) (c : C) : + (fun z : I × B => edge τ L R c z.1 z.2) ⁻¹' + ((fun z : C × A => vertex τ L R z.1 z.2) '' S) = + ({0} ×ˢ ((fun x => (c,L c x)) ⁻¹' S)) ∪ + ({1} ×ˢ ((fun x => (τ c,R c x)) ⁻¹' S)) := by + classical + ext ⟨t,x⟩ + change edge τ L R c t x ∈ ((fun z : C × A => vertex τ L R z.1 z.2) '' S) ↔ + (t = 0 ∧ (c,L c x) ∈ S) ∨ (t = 1 ∧ (τ c,R c x) ∈ S) + by_cases h0 : t = 0 + · subst t + rw [edge_zero] + simp only [true_and,zero_ne_one,false_and,or_false] + constructor + · rintro ⟨a,ha,he⟩ + have heq : a = (c,L c x) := Sum.inl.inj he + exact heq ▸ ha + · intro h; exact ⟨(c,L c x),h,rfl⟩ + · by_cases h1 : t = 1 + · subst t + rw [edge_one] + simp only [one_ne_zero,false_and,true_and,false_or] + constructor + · rintro ⟨a,ha,he⟩ + have heq : a = (τ c,R c x) := Sum.inl.inj he + exact heq ▸ ha + · intro h; exact ⟨(τ c,R c x),h,rfl⟩ + · have ht : ∃ z : Inner,t = ⟨z.1,z.2.1.le,z.2.2.le⟩ := + ⟨⟨t.1,lt_of_le_of_ne t.2.1 (fun h => h0 (Subtype.ext h.symm)), + lt_of_le_of_ne t.2.2 (fun h => h1 (Subtype.ext h))⟩,rfl⟩ + obtain ⟨s,rfl⟩ := ht + rw [edge_inner] + simp only [h0,h1,false_and,or_self,iff_false] + rintro ⟨a,_,he⟩ + change (Sum.inl a : Core (C := C) (A := A) (B := B)) = Sum.inr (c,(s,x)) at he + cases he + +lemma base_closedEmbedding : IsClosedEmbedding (fun z : C × A => vertex τ L R z.1 z.2) := by + apply IsClosedEmbedding.of_continuous_injective_isClosedMap (continuous_vertex τ L R) + Sum.inl_injective + intro S hS + apply (isClosed_iff τ L R _).mpr + constructor + · intro c + have he : (vertex τ L R c) ⁻¹' ((fun z : C × A => vertex τ L R z.1 z.2) '' S) = + (fun x => (c,x)) ⁻¹' S := by + ext x + change (∃ a ∈ S, (Sum.inl a : Space τ L R) = Sum.inl (c,x)) ↔ (c,x) ∈ S + simp only [Sum.inl.injEq] + constructor + · rintro ⟨a,ha,he⟩; cases he; exact ha + · intro h; exact ⟨(c,x),h,rfl⟩ + rw [he] + exact hS.preimage (continuous_const.prodMk continuous_id) + · intro c + rw [edge_preimage_vertices] + exact (isClosed_singleton.prod (hS.preimage (continuous_const.prodMk (L c).continuous))).union + (isClosed_singleton.prod (hS.preimage (continuous_const.prodMk (R c).continuous))) + +omit [TopologicalSpace C] [DiscreteTopology C] in +lemma interior_preimage [DecidableEq C] (c d : C) (s : Inner) (x : B) : + (fun z : I × B => edge τ L R c z.1 z.2) ⁻¹' {interior τ L R d s x} = + (if c = d then {((⟨s.1,s.2.1.le,s.2.2.le⟩ : I),x)} else ∅ : Set (I × B)) := by + classical + ext ⟨t,y⟩ + change edge τ L R c t y = interior τ L R d s x ↔ _ + have hright : (t,y) ∈ (if c = d then {((⟨s.1,s.2.1.le,s.2.2.le⟩ : I),x)} else ∅ : Set (I × B)) ↔ + c = d ∧ t.1 = s.1 ∧ y = x := by + split_ifs with h + · simp only [Set.mem_singleton_iff,Prod.mk.injEq,h,true_and] + exact and_congr Subtype.ext_iff Iff.rfl + · simp only [Set.mem_empty_iff_false,h,false_and] + rw [hright] + by_cases h0 : t = 0 + · subst t + rw [edge_zero] + constructor + · intro h + change (Sum.inl (c,L c y) : Core (C := C) (A := A) (B := B)) = Sum.inr (d,(s,x)) at h + cases h + · rintro ⟨_,h,_⟩; exact False.elim (s.2.1.ne' h.symm) + · by_cases h1 : t = 1 + · subst t + rw [edge_one] + constructor + · intro h + change (Sum.inl (τ c,R c y) : Core (C := C) (A := A) (B := B)) = Sum.inr (d,(s,x)) at h + cases h + · rintro ⟨_,h,_⟩; exact False.elim (s.2.2.ne h.symm) + · have ht : ∃ z : Inner,t = ⟨z.1,z.2.1.le,z.2.2.le⟩ := + ⟨⟨t.1,lt_of_le_of_ne t.2.1 (fun h => h0 (Subtype.ext h.symm)), + lt_of_le_of_ne t.2.2 (fun h => h1 (Subtype.ext h))⟩,rfl⟩ + obtain ⟨s',rfl⟩ := ht + rw [edge_inner] + constructor + · intro h + have he : (c,(s',y)) = (d,(s,x)) := Sum.inr.inj h + exact ⟨congrArg Prod.fst he,congrArg (fun z => z.2.1.1) he, + congrArg (fun z => z.2.2) he⟩ + · rintro ⟨rfl,hs,rfl⟩ + have he : s' = s := Subtype.ext hs + rw [he] +end + +section +open Set Topology +open scoped unitInterval +universe u v w z +variable {C : Type u} [TopologicalSpace C] [DiscreteTopology C] +variable {A : Type v} [TopologicalSpace A] {B : Type w} [TopologicalSpace B] [T1Space B] +variable (τ : C → C) (L R : C → C(B,A)) + +lemma selection_closed {J : Type z} (c : J → C) (hc : Function.Injective c) + (s : J → Inner) (x : J → B) (S : Set (Space τ L R)) + (hS : S ⊆ Set.range (fun j => interior τ L R (c j) (s j) (x j))) : IsClosed S := by + classical + apply (isClosed_iff τ L R S).mpr + constructor + · intro d + have he : (vertex τ L R d) ⁻¹' S = ∅ := by + apply Set.eq_empty_iff_forall_notMem.mpr + intro a ha + obtain ⟨j,hj⟩ := hS ha + change (Sum.inr (c j,(s j,x j)) : Core (C := C) (A := A) (B := B)) = Sum.inl (d,a) at hj + cases hj + rw [he]; exact isClosed_empty + · intro d + have hfinite : ((fun z : I × B => edge τ L R d z.1 z.2) ⁻¹' S).Finite := by + by_cases hex : ∃ j,c j = d + · obtain ⟨j,hj⟩ := hex + apply (Set.finite_singleton (((⟨(s j).1,(s j).2.1.le,(s j).2.2.le⟩ : I),x j))).subset + intro z hz + obtain ⟨i,hi⟩ := hS hz + have hmem : z ∈ (fun z : I × B => edge τ L R d z.1 z.2) ⁻¹' + {interior τ L R (c i) (s i) (x i)} := hi.symm + rw [interior_preimage] at hmem + split_ifs at hmem with hdi + · have hij : i = j := hc (hdi.symm.trans hj.symm) + simpa only [hij] using hmem + · exact False.elim hmem + · have he : (fun z : I × B => edge τ L R d z.1 z.2) ⁻¹' S = ∅ := by + apply Set.eq_empty_iff_forall_notMem.mpr + intro z hz + obtain ⟨i,hi⟩ := hS hz + have hmem : z ∈ (fun z : I × B => edge τ L R d z.1 z.2) ⁻¹' + {interior τ L R (c i) (s i) (x i)} := hi.symm + rw [interior_preimage,ite_eq_right (fun h => hex ⟨i,h.symm⟩)] at hmem + exact hmem + rw [he]; exact Set.finite_empty + exact hfinite.isClosed + +theorem compact_finitely_many_edges {K : Set (Space τ L R)} (hK : IsCompact K) : + {c : C | ∃ (s : Inner) (x : B), interior τ L R c s x ∈ K}.Finite := by + classical + let J := {c : C | ∃ (s : Inner) (x : B), interior τ L R c s x ∈ K} + let s : J → Inner := fun j => j.2.choose + let x : J → B := fun j => j.2.choose_spec.choose + let y : J → Space τ L R := fun j => interior τ L R j.1 (s j) (x j) + have hyK (j : J) : y j ∈ K := j.2.choose_spec.choose_spec + have hinj : Function.Injective y := by + intro i j hij + apply Subtype.ext + have he : (i.1,(s i,x i)) = (j.1,(s j,x j)) := Sum.inr.inj hij + exact congrArg Prod.fst he + have hall : ∀ S ⊆ Set.range y, IsClosed S := + selection_closed τ L R Subtype.val Subtype.val_injective s x + have hcompact : IsCompact (Set.range y) := + hK.of_isClosed_subset (hall _ subset_rfl) (Set.range_subset_iff.mpr hyK) + have hdiscrete : IsDiscrete (Set.range y) := by + apply isDiscrete_iff_forall_mem_exists_isClosed.mpr + intro S hS + exact ⟨S,hall S hS,Set.inter_eq_left.mpr hS⟩ + have hrange := hcompact.finite hdiscrete + have : Finite J := (Set.finite_range_iff hinj).mp hrange + exact Set.toFinite J + +omit [T1Space B] in + +theorem compact_finitely_many_vertices {K : Set (Space τ L R)} (hK : IsCompact K) : + {c : C | ∃ x : A,vertex τ L R c x ∈ K}.Finite := by + have hc : IsCompact ((fun z : C × A => vertex τ L R z.1 z.2) ⁻¹' K) := + (base_closedEmbedding τ L R).isProperMap.isCompact_preimage hK + have hf := (hc.image continuous_fst).finite_of_discrete + convert hf using 1 + ext c + constructor + · rintro ⟨x,hx⟩; exact ⟨(c,x),hx,rfl⟩ + · rintro ⟨⟨d,x⟩,hx,h⟩ + change d = c at h + subst d; exact ⟨x,hx⟩ +end + +open Set Topology +open scoped unitInterval +universe u v w +variable {C : Type u} {A : Type v} [TopologicalSpace A] {B : Type w} [TopologicalSpace B] +variable (τ : C → C) (L R : C → C(B,A)) + +@[simp] lemma vertex_eq_vertex (c d : C) (x y : A) : + vertex τ L R c x = vertex τ L R d y ↔ c = d ∧ x = y := by + change (Sum.inl (c,x) : Core (C := C) (A := A) (B := B)) = Sum.inl (d,y) ↔ _ + simp only [Sum.inl.injEq,Prod.mk.injEq] +@[simp] lemma vertex_ne_interior (c d : C) (x : A) (s : Inner) (y : B) : + vertex τ L R c x ≠ interior τ L R d s y := by + intro h + change (Sum.inl (c,x) : Core (C := C) (A := A) (B := B)) = Sum.inr (d,(s,y)) at h + cases h +@[simp] lemma interior_ne_vertex (c d : C) (s : Inner) (x : B) (y : A) : + interior τ L R c s x ≠ vertex τ L R d y := + (vertex_ne_interior τ L R d c y s x).symm +@[simp] lemma interior_eq_interior (c d : C) (s t : Inner) (x y : B) : + interior τ L R c s x = interior τ L R d t y ↔ c = d ∧ s = t ∧ x = y := by + change (Sum.inr (c,(s,x)) : Core (C := C) (A := A) (B := B)) = Sum.inr (d,(t,y)) ↔ _ + simp only [Sum.inr.injEq,Prod.mk.injEq] + +lemma edge_eq_vertex (c d : C) (t : I) (x : B) (y : A) : + edge τ L R c t x = vertex τ L R d y ↔ + (t = 0 ∧ c = d ∧ L c x = y) ∨ (t = 1 ∧ τ c = d ∧ R c x = y) := by + by_cases h0 : t = 0 + · subst t + rw [edge_zero,vertex_eq_vertex] + simp only [true_and,zero_ne_one,false_and,or_false] + · by_cases h1 : t = 1 + · subst t + rw [edge_one,vertex_eq_vertex] + simp only [true_and,one_ne_zero,false_and,false_or] + · let s : Inner := ⟨t.1,lt_of_le_of_ne t.2.1 (fun h => h0 (Subtype.ext h.symm)), + lt_of_le_of_ne t.2.2 (fun h => h1 (Subtype.ext h))⟩ + have he : edge τ L R c t x = interior τ L R c s x := edge_inner τ L R c s x + rw [he] + simp only [interior_ne_vertex,h0,h1,false_and,or_self] + +lemma edgeImage_vertex_slice [DecidableEq C] (c d : C) (S : Set (I × B)) : + (vertex τ L R d) ⁻¹' ((fun z : I × B => edge τ L R c z.1 z.2) '' S) = + (if d = c then (L c) '' ((fun x : B => ((0:I),x)) ⁻¹' S) else ∅) ∪ + (if d = τ c then (R c) '' ((fun x : B => ((1:I),x)) ⁻¹' S) else ∅) := by + classical + ext y + change (∃ z ∈ S,edge τ L R c z.1 z.2 = vertex τ L R d y) ↔ _ + constructor + · rintro ⟨⟨t,x⟩,hx,he⟩ + rcases (edge_eq_vertex τ L R c d t x y).mp he with ⟨rfl,hcd,hx'⟩ | ⟨rfl,hcd,hx'⟩ + · exact Or.inl (by rw [ite_eq_left hcd.symm]; exact ⟨x,hx,hx'⟩) + · exact Or.inr (by rw [ite_eq_left hcd.symm]; exact ⟨x,hx,hx'⟩) + · intro h + rcases h with h|h + · split_ifs at h with hcd + · obtain ⟨x,hx,hx'⟩ := h + exact ⟨(0,x),hx,(edge_eq_vertex τ L R c d 0 x y).mpr (Or.inl ⟨rfl,hcd.symm,hx'⟩)⟩ + · exact False.elim h + · split_ifs at h with hcd + · obtain ⟨x,hx,hx'⟩ := h + exact ⟨(1,x),hx,(edge_eq_vertex τ L R c d 1 x y).mpr (Or.inr ⟨rfl,hcd.symm,hx'⟩)⟩ + · exact False.elim h + +lemma edgeImage_vertex_closed (c d : C) (S : Set (I × B)) (hS : IsClosed S) + (hL : IsClosedMap (L c)) (hR : IsClosedMap (R c)) : + IsClosed ((vertex τ L R d) ⁻¹' ((fun z : I × B => edge τ L R c z.1 z.2) '' S)) := by + classical + rw [edgeImage_vertex_slice] + apply IsClosed.union + · split_ifs + · exact hL _ (hS.preimage (continuous_const.prodMk continuous_id)) + · exact isClosed_empty + · split_ifs + · exact hR _ (hS.preimage (continuous_const.prodMk continuous_id)) + · exact isClosed_empty +end UniversalFInfinity.GraphBundle + +end + +end OAI diff --git a/lean/OAI/GroupTheory/UniversalGroup/HigmanEmbedding.lean b/lean/OAI/GroupTheory/UniversalGroup/HigmanEmbedding.lean new file mode 100644 index 0000000000000000000000000000000000000000..94d0669964431febe795319860e22252167cdeb6 --- /dev/null +++ b/lean/OAI/GroupTheory/UniversalGroup/HigmanEmbedding.lean @@ -0,0 +1,471 @@ +import OAI.GroupTheory.UniversalGroup.TuringMachines + +namespace OAI + +universe u v w x + +namespace Higman.WordBinary +open Turing.PartrecToTM2 +abbrev Letter := Bool × Bool × Bool + +def push (a : Letter) (n : ℕ) : ℕ := Nat.bit a.1 (Nat.bit a.2.1 (Nat.bit a.2.2 n)) +def code : List Letter → ℕ + | [] => 1 + | a::w => push a (code w) + +def symbol (b : Bool) : Γ' := if b then .bit1 else .bit0 + +def spelling : List Letter → List Γ' + | [] => [.bit1] + | a::w => symbol a.1 :: symbol a.2.1 :: symbol a.2.2 :: spelling w + +lemma push_ge (a : Letter) (n : ℕ) : 8*n ≤ push a n := by + rcases a with ⟨b,c,d⟩ + cases b <;> cases c <;> cases d <;> simp [push,Nat.bit] <;> omega + +lemma code_pos (w : List Letter) : 0 < code w := by + induction w with + | nil => decide + | cons a w ih => have := push_ge a (code w); change 0 < push a (code w); omega + +lemma push_inj {a b : Letter} {m n : ℕ} (h : push a m = push b n) : a = b ∧ m = n := by + have h₁ := congrArg Nat.bodd h + have ht := congrArg Nat.div2 h + simp only [push,Nat.bodd_bit,Nat.div2_bit] at h₁ ht + have h₂ := congrArg Nat.bodd ht + have hu := congrArg Nat.div2 ht + simp only [Nat.bodd_bit,Nat.div2_bit] at h₂ hu + have h₃ := congrArg Nat.bodd hu + have hm := congrArg Nat.div2 hu + simp only [Nat.bodd_bit,Nat.div2_bit] at h₃ hm + exact ⟨Prod.ext h₁ (Prod.ext h₂ h₃),hm⟩ + +lemma code_injective : Function.Injective code := by + intro v + induction v with + | nil => + intro w h + cases w with + | nil => rfl + | cons a w => + have hp := code_pos w + have hg := push_ge a (code w) + change 1 = push a (code w) at h + omega + | cons a v ih => + intro w h + cases w with + | nil => + have hp := code_pos v + have hg := push_ge a (code v) + change push a (code v) = 1 at h + omega + | cons b w => + obtain ⟨rfl,he⟩ := push_inj h + exact congrArg (List.cons a) (ih he) + +lemma trNat_bit (b : Bool) (n : ℕ) (hn : 0 < n) : + trNat (Nat.bit b n) = symbol b :: trNat n := by + have hcast : (n : Num) ≠ 0 := by + intro h + have := congrArg (fun m : Num ↦ (m : ℕ)) h + simp only [Num.to_of_nat,Num.cast_zero] at this + omega + unfold trNat + rw [← Num.ofNat'_eq,Num.ofNat'_bit,Num.ofNat'_eq] + cases h : (n : Num) with + | zero => exact False.elim (hcast h) + | pos p => cases b <;> rfl + +lemma trNat_code (w : List Letter) : trNat (code w) = spelling w := by + induction w with + | nil => rfl + | cons a w ih => + have hp := code_pos w + have hbit (b : Bool) (n : ℕ) (hn : 0 < n) : 0 < Nat.bit b n := by + cases b <;> simp [Nat.bit]; omega + simp only [code,push,trNat_bit _ _ (hbit _ _ (hbit _ _ hp)), + trNat_bit _ _ (hbit _ _ hp),trNat_bit _ _ hp,ih,spelling] + +lemma push_primrec : Primrec₂ push := by + let digit : Letter → ℕ := fun a ↦ push a 0 + have h : Primrec (fun p : Letter × ℕ ↦ 8*p.2+digit p.1) := + Primrec.nat_add.comp (Primrec.nat_mul.comp (Primrec.const 8) Primrec.snd) + ((Primrec.dom_finite digit).comp Primrec.fst) + apply h.of_eq + rintro ⟨⟨b,c,d⟩,n⟩ + cases b <;> cases c <;> cases d <;> simp [digit,push,Nat.bit] <;> omega + +lemma code_primrec : Primrec code := by + have h := Primrec.list_foldr (α := List Letter) Primrec.id (Primrec.const 1) + (push_primrec.comp (Primrec.fst.comp Primrec.snd) (Primrec.snd.comp Primrec.snd)).to₂ + apply h.of_eq + intro w + induction w with + | nil => rfl + | cons a w ih => simpa only [id_eq,List.foldr_cons,code] using congrArg (push a) ih + +end Higman.WordBinary + +namespace Higman.RangeRecognizer +open Turing ToPartrec PartrecToTM2 + +def search (r : ℕ → ℕ) (n : ℕ) : Part ℕ := + Nat.rfind (fun k ↦ Part.some (decide (r k = n))) + +lemma search_dom (r : ℕ → ℕ) (n : ℕ) : (search r n).Dom ↔ n ∈ Set.range r := by + exact (Nat.rfind_dom (p := fun k ↦ Part.some (decide (r k = n)))).trans + (by simp [Set.mem_range]) + +lemma search_partrec (r : ℕ → ℕ) (hr : Computable r) : Partrec (search r) := by + apply Partrec.rfind + exact ((Primrec.eq.decide.to_comp).comp (hr.comp Computable.snd) Computable.fst).partrec.to₂ + +theorem exists_code (r : ℕ → ℕ) (hr : Computable r) : + ∃ c : Code, ∀ n, (c.eval [n]).Dom ↔ n ∈ Set.range r := by + obtain ⟨c,hc⟩ := Code.exists_code (Nat.Partrec'.part_iff₁.mpr (search_partrec r hr)) + refine ⟨c,fun n ↦ ?_⟩ + have he := hc ⟨[n],rfl⟩ + change c.eval [n] = _ at he + rw [he] + exact search_dom r n + +lemma halt_iff_dom (c : Code) (v : List ℕ) : + (∃ S x, TM2.Reaches tr (init c v) ⟨none,x,S⟩) ↔ (c.eval v).Dom := by + constructor + · rintro ⟨S,x,h⟩ + have hm : (⟨none,x,S⟩ : Cfg') ∈ StateTransition.eval (TM2.step tr) (init c v) := + StateTransition.mem_eval.mpr ⟨h,rfl⟩ + rw [tr_eval] at hm + obtain ⟨w,hw,_⟩ := (Part.mem_map_iff _).mp hm + exact hw.1 + · intro h + let w := (c.eval v).get h + have hw : halt w ∈ StateTransition.eval (TM2.step tr) (init c v) := by + rw [tr_eval] + exact (Part.mem_map_iff _).mpr ⟨w,Part.get_mem h,rfl⟩ + exact ⟨(halt w).stk,(halt w).var,(StateTransition.mem_eval.mp hw).1⟩ + +end Higman.RangeRecognizer + +noncomputable section +namespace Higman.RecognizingStack +open Turing ToPartrec PartrecToTM2 WordBinary AffineStack StackProgram Function Relation +variable {G : Type} [Group G] + +instance : Fintype K' := ⟨{.main,.rev,.aux,.stack},by intro k; cases k <;> simp⟩ + +def support (c : Code) := codeSupp c Cont'.halt +abbrev MState (c : Code) := TM2StackCompiler.State tr (support c) +abbrev MEdge (c : Code) := TM2StackCompiler.Edge tr (support c) +local instance (c : Code) : Fintype (MEdge c) := by + exact TM2StackCompiler.instFintypeEdge (K := K') (Γ := Γ') (σ := Option Γ') + tr (support c) +def mprog (c : Code) : MEdge c → Instruction K' Γ' G (MState c) := + TM2StackCompiler.compile tr (support c) (tr_supports c Cont'.halt).2 + +inductive State (c : Code) + | ready | first (a : Letter) | second (a : Letter) | machine (q : MState c) | done + deriving Fintype +inductive Edge (c : Code) + | first (a : Letter) | second (a : Letter) | third (a : Letter) | enter + | machine (e : MEdge c) | exit (v : Option Γ') + deriving Fintype + +def initialState (c : Code) : MState c := by + classical + exact (⟨some (tr (trNormal c Cont'.halt)),by + apply Finset.some_mem_insertNone.mpr + apply Finset.mem_biUnion.mpr + exact ⟨trNormal c Cont'.halt,(tr_supports c Cont'.halt).1,TM2.stmts₁_self⟩⟩,none) + +def finalState (c : Code) (v : Option Γ') : MState c := + (⟨none,Finset.none_mem_insertNone⟩,v) + +def prog (c : Code) (weight : Letter → G) : Edge c → Instruction K' Γ' G (State c) + | .first a => ⟨.ready,.first a,.onStack .main (.push (symbol a.2.2)),1⟩ + | .second a => ⟨.first a,.second a,.onStack .main (.push (symbol a.2.1)),1⟩ + | .third a => ⟨.second a,.ready,.onStack .main (.push (symbol a.1)),weight a⟩ + | .enter => ⟨.ready,.machine (initialState c),.idle,1⟩ + | .machine e => ⟨.machine (mprog (G := G) c e).source,.machine (mprog (G := G) c e).target, + (mprog (G := G) c e).action,1⟩ + | .exit v => ⟨.machine (finalState c v),.done,.idle,1⟩ + +def store (s : List Γ') : K' → List Γ' := K'.elim s [] [] [] +def encoded (w : List Letter) := spelling w ++ [.cons] +def seed (c : Code) : (K' → List Γ') × State c := (store (encoded []),.ready) + +lemma store_push (s : List Γ') (a : Γ') : + update (store s) .main (a :: store s .main) = store (a::s) := by + funext k + cases k <;> simp [store] + +lemma initial_forget (c : Code) (w : List Letter) : + TM2StackCompiler.forget tr (support c) (store (encoded w),initialState c) = + MicroTM2.translate tr (init c [code w]) := by + simp [TM2StackCompiler.forget,initialState,MicroTM2.translate,init,store,encoded,trNat_code] + rfl + +def Correct (c : Code) (weight : Letter → G) (g : G) : ((K' → List Γ') × State c) → Prop + | (S,.ready) => ∃ w, S = store (encoded w) ∧ g = HistoryMachine.value weight w + | (S,.first a) => ∃ w, S = store (symbol a.2.2 :: encoded w) ∧ g = HistoryMachine.value weight w + | (S,.second a) => ∃ w, S = store (symbol a.2.1 :: symbol a.2.2 :: encoded w) ∧ + g = HistoryMachine.value weight w + | (S,.machine q) => ∃ w, g = HistoryMachine.value weight w ∧ + StateTransition.Reaches (MicroTM2.step tr) (MicroTM2.translate tr (init c [code w])) + (TM2StackCompiler.forget tr (support c) (S,q)) + | (_,.done) => ∃ w, g = HistoryMachine.value weight w ∧ (c.eval [code w]).Dom + +lemma correct_seed (c : Code) (weight : Letter → G) : Correct c weight 1 (seed c) := + ⟨[],rfl,rfl⟩ + +lemma correct_step (c : Code) (weight : Letter → G) (e : Edge c) + (S T : K' → List Γ') (g : G) (hr : (prog c weight e).action.Rel S T) + (hc : Correct c weight g (S,(prog c weight e).source)) : + Correct c weight (g * (prog c weight e).weight) (T,(prog c weight e).target) := by + cases e with + | first a => + obtain ⟨w,rfl,hg⟩ := hc + obtain ⟨t,ht,rfl⟩ := hr + cases ht + exact ⟨w,store_push _ _,by simpa [prog] using hg⟩ + | second a => + obtain ⟨w,rfl,hg⟩ := hc + obtain ⟨t,ht,rfl⟩ := hr + cases ht + exact ⟨w,store_push _ _,by simpa [prog] using hg⟩ + | third a => + obtain ⟨w,rfl,rfl⟩ := hc + obtain ⟨t,ht,rfl⟩ := hr + cases ht + refine ⟨a::w,?_,rfl⟩ + exact store_push _ _ + | enter => + obtain ⟨w,rfl,hg⟩ := hc + cases hr + refine ⟨w,by simpa [prog] using hg,?_⟩ + rw [initial_forget] + exact .refl + | machine e => + obtain ⟨w,hg,hh⟩ := hc + refine ⟨w,by simpa [prog] using hg,hh.tail ?_⟩ + exact TM2StackCompiler.compile_sound tr (support c) (tr_supports c Cont'.halt).2 e S T hr + | exit v => + obtain ⟨w,hg,hh⟩ := hc + cases hr + refine ⟨w,by simpa [prog] using hg,?_⟩ + apply (RangeRecognizer.halt_iff_dom c [code w]).mp + exact ⟨S,v,(MicroTM2.reaches_halt_iff tr _ S v).mpr hh⟩ + +lemma run_correct (c : Code) (weight : Letter → G) {s : List (Edge c)} + {d : (K' → List Γ') × State c} (h : Run (prog c weight) (seed c) s d) : + Correct c weight (HistoryMachine.value (fun e ↦ (prog c weight e).weight) s) d := by + induction h with + | start => exact correct_seed c weight + | step e S T hr h ih => exact correct_step c weight e S T _ hr ih + +lemma build_word (c : Code) (weight : Letter → G) (w : List Letter) : + ∃ s, Run (prog c weight) (seed c) s (store (encoded w),.ready) ∧ + HistoryMachine.value (fun e ↦ (prog c weight e).weight) s = HistoryMachine.value weight w := by + induction w with + | nil => exact ⟨[],Run.start,rfl⟩ + | cons a w ih => + obtain ⟨s,hs,hv⟩ := ih + refine ⟨.third a :: .second a :: .first a :: s,?_,?_⟩ + · apply Run.step (prog := prog c weight) (Edge.third a) (store (symbol a.2.1 :: symbol a.2.2 :: encoded w)) _ + · exact ⟨_,rfl,(store_push _ _).symm⟩ + apply Run.step (prog := prog c weight) (Edge.second a) (store (symbol a.2.2 :: encoded w)) _ + · exact ⟨_,rfl,(store_push _ _).symm⟩ + apply Run.step (prog := prog c weight) (Edge.first a) (store (encoded w)) _ + · exact ⟨_,rfl,(store_push _ _).symm⟩ + exact hs + · simpa only [HistoryMachine.value,prog,mul_one] using congrArg (fun g ↦ g * weight a) hv + +lemma enter_word (c : Code) (weight : Letter → G) (w : List Letter) : + ∃ s, Run (prog c weight) (seed c) s (store (encoded w),.machine (initialState c)) ∧ + HistoryMachine.value (fun e ↦ (prog c weight e).weight) s = HistoryMachine.value weight w := by + obtain ⟨s,hs,hv⟩ := build_word c weight w + exact ⟨.enter::s,Run.step (prog := prog c weight) Edge.enter _ _ rfl hs,by simpa only [HistoryMachine.value,prog,mul_one] using hv⟩ + +lemma run_machine (c : Code) (weight : Letter → G) (w : List Letter) {s : List (MEdge c)} + {d : (K' → List Γ') × MState c} + (h : Run (mprog (G := G) c) (store (encoded w),initialState c) s d) : + ∃ t, Run (prog c weight) (seed c) t (d.1,.machine d.2) ∧ + HistoryMachine.value (fun e ↦ (prog c weight e).weight) t = HistoryMachine.value weight w := by + induction h with + | start => exact enter_word c weight w + | step e S T hr h ih => + obtain ⟨t,ht,hv⟩ := ih + exact ⟨.machine e::t,Run.step (prog := prog c weight) (Edge.machine e) S T hr ht, + by simpa only [HistoryMachine.value,prog,mul_one] using hv⟩ + +lemma halt_word (c : Code) (weight : Letter → G) (w : List Letter) (h : (c.eval [code w]).Dom) : + HistoryMachine.value weight w ∈ outputs (prog c weight) (seed c) .done := by + obtain ⟨S,v,hm⟩ := (RangeRecognizer.halt_iff_dom c [code w]).mpr h + have hh := (MicroTM2.reaches_halt_iff tr _ S v).mp hm + rw [← initial_forget c w] at hh + obtain ⟨s,d,hr,hd⟩ := TM2StackCompiler.reaches_complete (G := G) tr (support c) + (tr_supports c Cont'.halt).2 hh + have hq : d.2 = finalState c v := by + apply Prod.ext + · apply Subtype.ext + exact congrArg (fun x ↦ x.2.1) hd + · exact congrArg (fun x ↦ x.2.2) hd + obtain ⟨t,ht,hv⟩ := run_machine c weight w hr + have ht' : Run (prog c weight) (seed c) t (d.1,.machine (finalState c v)) := by + simpa only [hq] using ht + refine ⟨.exit v::t,d.1,Run.step (prog := prog c weight) (Edge.exit v) _ _ rfl ht',?_⟩ + simpa only [HistoryMachine.value,prog,mul_one] using hv.symm + +theorem outputs_eq (c : Code) (weight : Letter → G) : + outputs (prog c weight) (seed c) .done = + {g | ∃ w, (c.eval [code w]).Dom ∧ g = HistoryMachine.value weight w} := by + ext g + constructor + · rintro ⟨s,S,hs,rfl⟩ + obtain ⟨w,hw,hd⟩ := run_correct c weight hs + exact ⟨w,hd,hw⟩ + · rintro ⟨w,hd,rfl⟩ + exact halt_word c weight w hd + +end Higman.RecognizingStack + +namespace Higman +open WordBinary +variable {G : Type} [Group G] [Group.IsFinitelyPresented G] + +theorem benign_enumerated_words (enumerate : ℕ → List Letter) + (he : Computable enumerate) (weight : Letter → G) : + IsBenign (Subgroup.closure (Set.range (fun n ↦ HistoryMachine.value weight (enumerate n)))) := by + obtain ⟨c,hc⟩ := RangeRecognizer.exists_code (fun n ↦ code (enumerate n)) + (code_primrec.to_comp.comp he) + have hh := StackProgram.benign_outputs (RecognizingStack.prog c weight) + (RecognizingStack.seed c) RecognizingStack.State.done + rw [RecognizingStack.outputs_eq] at hh + have hs : {g | ∃ w, (c.eval [code w]).Dom ∧ g = HistoryMachine.value weight w} = + Set.range (fun n ↦ HistoryMachine.value weight (enumerate n)) := by + ext g + constructor + · rintro ⟨w,hw,rfl⟩ + obtain ⟨n,hn⟩ := (hc (code w)).mp hw + exact ⟨n,congrArg (HistoryMachine.value weight) (code_injective hn)⟩ + · rintro ⟨n,rfl⟩ + exact ⟨enumerate n,(hc _).mpr ⟨n,rfl⟩,rfl⟩ + rwa [hs] at hh + +end Higman + +namespace Higman.HistoryMachine +variable {E G : Type*} [Group G] +lemma value_append (weight : E → G) (v w : List E) : + value weight (v ++ w) = value weight w * value weight v := by + induction v with + | nil => simp [value] + | cons a v ih => simp only [List.cons_append,value,ih,mul_assoc] +end Higman.HistoryMachine + +namespace Higman.NormalWords + +section +open WordBinary +abbrev Alphabet := Bool ⊕ Unit +abbrev Raw := List (Alphabet × Bool) + +def encodeLetter : Alphabet × Bool → Letter + | (.inl a,b) => (false,a,b) + | (.inr _,b) => (true,false,b) + +def generator (a : Letter) : Alphabet := if a.1 then .inr () else .inl a.2.1 +def weight (a : Letter) : FreeGroup Alphabet := + if a.2.2 then FreeGroup.of (generator a) else (FreeGroup.of (generator a))⁻¹ + +def encodeWord (w : Raw) : List Letter := w.reverse.map encodeLetter + +lemma encoded_value (w : Raw) : HistoryMachine.value weight (encodeWord w) = FreeGroup.mk w := by + induction w with + | nil => rfl + | cons a w ih => + simp only [encodeWord,List.reverse_cons,List.map_append,List.map_cons,List.map_nil, + HistoryMachine.value_append,HistoryMachine.value,one_mul] at * + rw [ih] + rcases a with ⟨a,b⟩ + cases a <;> cases b <;> rfl + +lemma encodeWord_primrec : Primrec encodeWord := + Primrec.list_map Primrec.list_reverse ((Primrec.dom_finite encodeLetter).comp Primrec.snd) + +def conjugator (n : ℕ) : Raw := (Encodable.decode (α := Raw) n).getD [] +def conjugated (r : ℕ → Raw) (n : ℕ) : Raw := + conjugator n.unpair.1 ++ r n.unpair.2 ++ FreeGroup.invRev (conjugator n.unpair.1) + +def enumerate (r : ℕ → Raw) (n : ℕ) : List Letter := encodeWord (conjugated r n) + +lemma conjugator_primrec : Primrec conjugator := + Primrec.option_getD.comp Primrec.decode (Primrec.const []) + +lemma invRev_primrec : Primrec (@FreeGroup.invRev Alphabet) := by + unfold FreeGroup.invRev + apply Primrec.list_reverse.comp + apply Primrec.list_map Primrec.id + exact (Primrec.fst.comp Primrec.snd).pair + ((Primrec.dom_bool Bool.not).comp (Primrec.snd.comp Primrec.snd)) + +lemma enumerate_computable (r : ℕ → Raw) (hr : Computable r) : Computable (enumerate r) := by + apply encodeWord_primrec.to_comp.comp + have hc : Computable (fun n : ℕ ↦ conjugator n.unpair.1) := + conjugator_primrec.to_comp.comp (Primrec.fst.comp Primrec.unpair).to_comp + exact Primrec.list_append.to_comp.comp + (Primrec.list_append.to_comp.comp hc (hr.comp (Primrec.snd.comp Primrec.unpair).to_comp)) + (invRev_primrec.to_comp.comp hc) + +lemma conjugator_encode (w : Raw) : conjugator (Encodable.encode w) = w := by + simp only [conjugator,Encodable.encodek,Option.getD_some] + +lemma mk_conjugated (r : ℕ → Raw) (n : ℕ) : + FreeGroup.mk (conjugated r n) = FreeGroup.mk (conjugator n.unpair.1) * + FreeGroup.mk (r n.unpair.2) * (FreeGroup.mk (conjugator n.unpair.1))⁻¹ := by + simp only [conjugated,← FreeGroup.mul_mk,← FreeGroup.inv_mk] + +theorem range_values (r : ℕ → Raw) : + Set.range (fun n ↦ HistoryMachine.value weight (enumerate r n)) = + Group.conjugatesOfSet (Set.range (fun n ↦ FreeGroup.mk (r n))) := by + ext g + constructor + · rintro ⟨n,rfl⟩ + change HistoryMachine.value weight (encodeWord (conjugated r n)) ∈ _ + rw [encoded_value,mk_conjugated] + exact Group.mem_conjugatesOfSet_iff.mpr + ⟨_,⟨n.unpair.2,rfl⟩,isConj_iff.mpr ⟨_,rfl⟩⟩ + · intro h + obtain ⟨x,⟨k,rfl⟩,hx⟩ := Group.mem_conjugatesOfSet_iff.mp h + obtain ⟨a,ha⟩ := isConj_iff.mp hx + obtain ⟨w,rfl⟩ := Quot.exists_rep a + refine ⟨Nat.pair (Encodable.encode w) k,?_⟩ + simp only [enumerate,encoded_value,mk_conjugated,Nat.unpair_pair,conjugator_encode] + exact ha + +end + +theorem benign_normalClosure (r : ℕ → Raw) (hr : Computable r) : + IsBenign (Subgroup.normalClosure (Set.range (fun n ↦ FreeGroup.mk (r n)))) := by + have h := benign_enumerated_words (enumerate r) (enumerate_computable r hr) weight + rw [range_values] at h + exact h + +theorem embeds_presentation (r : ℕ → Raw) (hr : Computable r) : + ∃ (K : Type) (_ : Group K) (_ : Group.IsFinitelyPresented K) + (i : PresentedGroup (Set.range (fun n ↦ FreeGroup.mk (r n))) →* K), + Function.Injective i := by + apply embeds_of_benign_kernel (PresentedGroup.mk _) (PresentedGroup.mk_surjective _) + have he : (PresentedGroup.mk (Set.range (fun n ↦ FreeGroup.mk (r n)))).ker = + Subgroup.normalClosure (Set.range (fun n ↦ FreeGroup.mk (r n))) := by + ext g + exact PresentedGroup.mk_eq_one_iff + rw [he] + exact benign_normalClosure r hr + +end Higman.NormalWords + +end + +end OAI diff --git a/lean/OAI/GroupTheory/UniversalGroup/HomotopyProducts.lean b/lean/OAI/GroupTheory/UniversalGroup/HomotopyProducts.lean new file mode 100644 index 0000000000000000000000000000000000000000..bc1ee394ee69fbd5f78b68e1d4735f2ea755daa0 --- /dev/null +++ b/lean/OAI/GroupTheory/UniversalGroup/HomotopyProducts.lean @@ -0,0 +1,380 @@ +import OAI.GroupTheory.UniversalGroup.MilnorControl + +namespace OAI + +noncomputable section + +open Set Metric Topology BigOperators +open Set Metric Topology + +namespace UniversalFInfinity.HomotopyFunctor + +section +open scoped Topology Topology.Homotopy +universe u v w +variable {N : Type u} {X : Type v} {Y : Type w} [TopologicalSpace X] [TopologicalSpace Y] +variable {x : X} {y : Y} + +def loopMap (f : C(X,Y)) (hf : f x = y) (p : GenLoop N X x) : GenLoop N Y y := + ⟨f.comp p.1,fun t ht => by change f (p t) = y; rw [GenLoop.boundary p t ht,hf]⟩ + +lemma loopMap_homotopic (f : C(X,Y)) (hf : f x = y) {p q : GenLoop N X x} + (h : GenLoop.Homotopic p q) : GenLoop.Homotopic (loopMap f hf p) (loopMap f hf q) := + h.comp_continuousMap f + +def map (f : C(X,Y)) (hf : f x = y) : HomotopyGroup N X x → HomotopyGroup N Y y := + Quotient.map (loopMap f hf) (fun _ _ h => loopMap_homotopic f hf h) + +@[simp] lemma map_mk (f : C(X,Y)) (hf : f x = y) (p : GenLoop N X x) : + map f hf (Quotient.mk' p) = Quotient.mk' (loopMap f hf p) := rfl + +lemma loopMap_const (f : C(X,Y)) (hf : f x = y) : + loopMap (N := N) f hf GenLoop.const = GenLoop.const := by + ext t + exact hf + +lemma loopMap_transAt [DecidableEq N] (i : N) (f : C(X,Y)) (hf : f x = y) + (p q : GenLoop N X x) : + loopMap f hf (GenLoop.transAt i p q) = GenLoop.transAt i (loopMap f hf p) (loopMap f hf q) := by + ext t + change f (if (t i : ℝ) ≤ 1/2 then p _ else q _) = + if (t i : ℝ) ≤ 1/2 then f (p _) else f (q _) + split <;> rfl + +def mapHom [DecidableEq N] [Nonempty N] (f : C(X,Y)) (hf : f x = y) : + HomotopyGroup N X x →* HomotopyGroup N Y y where + toFun := map f hf + map_one' := by + change Quotient.mk' (loopMap f hf GenLoop.const) = Quotient.mk' GenLoop.const + exact congrArg Quotient.mk' (loopMap_const f hf) + map_mul' a b := Quotient.inductionOn₂ a b fun p q => by + have h₁ := HomotopyGroup.mul_spec (i := Classical.arbitrary N) (p := p) (q := q) + have h₂ := HomotopyGroup.mul_spec (i := Classical.arbitrary N) + (p := loopMap f hf p) (q := loopMap f hf q) + exact (congrArg (map f hf) h₁).trans + ((congrArg Quotient.mk' (loopMap_transAt (Classical.arbitrary N) f hf q p)).trans h₂.symm) + +lemma map_id (a : HomotopyGroup N X x) : map (y := x) (ContinuousMap.id X) rfl a = a := by + induction a using Quotient.inductionOn with | h p => + exact congrArg Quotient.mk' (by ext t; rfl) + +lemma map_comp {Z : Type*} [TopologicalSpace Z] {z : Z} + (f : C(X,Y)) (hf : f x = y) (g : C(Y,Z)) (hg : g y = z) + (a : HomotopyGroup N X x) : + map g hg (map f hf a) = map (g.comp f) (by change g (f x) = z; rw [hf,hg]) a := by + induction a using Quotient.inductionOn with | h p => + rfl + +lemma map_const [DecidableEq N] [Nonempty N] (a : HomotopyGroup N X x) : + map (ContinuousMap.const X y) rfl a = 1 := by + induction a using Quotient.inductionOn with | h p => + rfl + +variable {Z : Type*} [TopologicalSpace Z] {z : Z} + +def loopPair (p : GenLoop N X x) (q : GenLoop N Y y) : GenLoop N (X × Y) (x,y) := + ⟨p.1.prodMk q.1,fun t ht => Prod.ext (GenLoop.boundary p t ht) (GenLoop.boundary q t ht)⟩ + +lemma pair_homotopic {p p' : GenLoop N X x} {q q' : GenLoop N Y y} + (h : GenLoop.Homotopic p p') (k : GenLoop.Homotopic q q') : + GenLoop.Homotopic (loopPair p q) (loopPair p' q') := by + rcases h with ⟨h⟩ + rcases k with ⟨k⟩ + refine ⟨{ toHomotopy := h.toHomotopy.prodMk k.toHomotopy,prop' := ?_ }⟩ + intro t a ha + exact Prod.ext (h.eq_fst t ha) (k.eq_fst t ha) + +lemma product_ext (a b : HomotopyGroup N (X × Y) (x,y)) + (h₁ : map ((ContinuousMap.fst : C(X × Y,X))) rfl a = map ((ContinuousMap.fst : C(X × Y,X))) rfl b) + (h₂ : map ((ContinuousMap.snd : C(X × Y,Y))) rfl a = map ((ContinuousMap.snd : C(X × Y,Y))) rfl b) : a = b := by + induction a using Quotient.inductionOn with | h p => + induction b using Quotient.inductionOn with | h q => + apply Quotient.sound + have hh := pair_homotopic (Quotient.exact h₁) (Quotient.exact h₂) + exact hh + +lemma diagonal_split [DecidableEq N] [Nonempty N] (a : HomotopyGroup N X x) : + map (y := (x,x)) ((ContinuousMap.id X).prodMk (ContinuousMap.id X)) rfl a = + (map (y := (x,x)) ((ContinuousMap.id X).prodMk (ContinuousMap.const X x)) rfl a) * + (map (y := (x,x)) ((ContinuousMap.const X x).prodMk (ContinuousMap.id X)) rfl a) := by + apply product_ext + · change mapHom ((ContinuousMap.fst : C(X × X,X))) rfl _ = mapHom ((ContinuousMap.fst : C(X × X,X))) rfl _ + rw [map_mul] + change map (y := x) ContinuousMap.fst rfl + (map (y := (x,x)) ((ContinuousMap.id X).prodMk (ContinuousMap.id X)) rfl a) = + map (y := x) ContinuousMap.fst rfl + (map (y := (x,x)) ((ContinuousMap.id X).prodMk (ContinuousMap.const X x)) rfl a) * + map (y := x) ContinuousMap.fst rfl + (map (y := (x,x)) ((ContinuousMap.const X x).prodMk (ContinuousMap.id X)) rfl a) + calc + _ = map (y := x) (ContinuousMap.id X) rfl a := map_comp _ _ _ _ a + _ = map (y := x) (ContinuousMap.id X) rfl a * + map (y := x) (ContinuousMap.const X x) rfl a := + (map_id a).trans (((congrArg₂ (fun left right : HomotopyGroup N X x => left * right) + (map_id a) (map_const (y := x) a)).trans + (mul_one a)).symm) + _ = _ := congrArg₂ (fun left right : HomotopyGroup N X x => left * right) + (map_comp (y := (x,x)) (z := x) + ((ContinuousMap.id X).prodMk (ContinuousMap.const X x)) rfl + ContinuousMap.fst rfl a).symm + (map_comp (y := (x,x)) (z := x) + ((ContinuousMap.const X x).prodMk (ContinuousMap.id X)) rfl + ContinuousMap.fst rfl a).symm + · change mapHom ((ContinuousMap.snd : C(X × X,X))) rfl _ = mapHom ((ContinuousMap.snd : C(X × X,X))) rfl _ + rw [map_mul] + change map (y := x) ContinuousMap.snd rfl + (map (y := (x,x)) ((ContinuousMap.id X).prodMk (ContinuousMap.id X)) rfl a) = + map (y := x) ContinuousMap.snd rfl + (map (y := (x,x)) ((ContinuousMap.id X).prodMk (ContinuousMap.const X x)) rfl a) * + map (y := x) ContinuousMap.snd rfl + (map (y := (x,x)) ((ContinuousMap.const X x).prodMk (ContinuousMap.id X)) rfl a) + calc + _ = map (y := x) (ContinuousMap.id X) rfl a := map_comp _ _ _ _ a + _ = map (y := x) (ContinuousMap.const X x) rfl a * + map (y := x) (ContinuousMap.id X) rfl a := + (map_id a).trans (((congrArg₂ (fun left right : HomotopyGroup N X x => left * right) + (map_const (y := x) a) (map_id a)).trans + (one_mul a)).symm) + _ = _ := congrArg₂ (fun left right : HomotopyGroup N X x => left * right) + (map_comp (y := (x,x)) (z := x) + ((ContinuousMap.id X).prodMk (ContinuousMap.const X x)) rfl + ContinuousMap.snd rfl a).symm + (map_comp (y := (x,x)) (z := x) + ((ContinuousMap.const X x).prodMk (ContinuousMap.id X)) rfl + ContinuousMap.snd rfl a).symm + +theorem product_additivity [DecidableEq N] [Nonempty N] (F : C(X × X,Y)) + (hF : F (x,x) = y) (a : HomotopyGroup N X x) : + map (F.comp ((ContinuousMap.id X).prodMk (ContinuousMap.id X))) hF a = + map (F.comp ((ContinuousMap.id X).prodMk (ContinuousMap.const X x))) hF a * + map (F.comp ((ContinuousMap.const X x).prodMk (ContinuousMap.id X))) hF a := by + have h := map_comp (y := (x,x)) ((ContinuousMap.id X).prodMk (ContinuousMap.id X)) rfl F hF a + rw [← h,diagonal_split] + change mapHom (N := N) F hF (_ * _) = _ + rw [map_mul] + exact congrArg₂ (· * ·) (map_comp _ _ _ _ a) (map_comp _ _ _ _ a) +end +open scoped Topology Topology.Homotopy +universe u v w +variable {N : Type u} {X : Type v} {Y : Type w} [TopologicalSpace X] [TopologicalSpace Y] +variable {x : X} {y : Y} +lemma map_eq_of_homotopy (f g : C(X,Y)) (hf : f x = y) (hg : g x = y) + (H : f.Homotopy g) (hH : ∀ t, H (t,x) = y) (a : HomotopyGroup N X x) : + map f hf a = map g hg a := by + induction a using Quotient.inductionOn with | h p => + apply Quotient.sound + refine ⟨{ toHomotopy := H.compContinuousMap p.1,prop' := ?_ }⟩ + intro t z hz + change H (t,p z) = f (p z) + rw [GenLoop.boundary p z hz,hH,hf] +end UniversalFInfinity.HomotopyFunctor +namespace UniversalFInfinity.Milnor + +section +open Set Metric Topology BigOperators UniversalFInfinity.Simplicial +open scoped Classical Topology.Homotopy +universe u v +variable (G : Type u) [Group G] +local instance (priority := 2000) (α : Type*) : DecidableEq (ℕ × α) := Classical.decEq (ℕ × α) + +abbrev Shapes := Finset (Finset (ℕ × G)) +def basedShapes (S : Shapes G) : Shapes G := insert {(0,1)} S +def stage (S : Shapes G) := orbitSpan (basedShapes G S) + +lemma stage_mono {S T : Shapes G} (h : S ⊆ T) : stage G S ≤ stage G T := + orbitSpan_mono (Finset.insert_subset_insert _ h) + +lemma stage_point_face (S : Shapes G) : {(0,1)} ∈ stage G S := by + apply orbitSpan_contains (basedShapes G S) + · exact ⟨Finset.singleton_nonempty _,by simpa only [Finset.coe_singleton] using Set.injOn_singleton Prod.fst (0,(1:G))⟩ + · exact ⟨{(0,1)},Finset.mem_insert_self _ _,Finset.Subset.refl _⟩ + +def stagePoint (S : Shapes G) : Simplicial.Space (stage G S) := + ⟨Finsupp.single (0,1) 1,by intro w; simp only [Finsupp.single_apply]; split_ifs <;> norm_num, + by simp,by simpa only [Finsupp.support_single _ one_ne_zero] using stage_point_face G S⟩ + +def stageIncl (S T : Shapes G) (h : S ⊆ T) : C(Simplicial.Space (stage G S),Simplicial.Space (stage G T)) := + ⟨inclusion _ _ (fun _ hs => stage_mono G h hs),continuous_inclusion _ _ _⟩ + +lemma stageIncl_point (S T : Shapes G) (h : S ⊆ T) : stageIncl G S T h (stagePoint G S) = stagePoint G T := rfl + +variable (N : Type v) [DecidableEq N] [Nonempty N] +def stageHom (S T : Shapes G) (h : S ⊆ T) : + HomotopyGroup N (Simplicial.Space (stage G S)) (stagePoint G S) →* + HomotopyGroup N (Simplicial.Space (stage G T)) (stagePoint G T) := + HomotopyFunctor.mapHom (stageIncl G S T h) rfl + +instance : DirectedSystem (fun S : Shapes G => HomotopyGroup N (Simplicial.Space (stage G S)) (stagePoint G S)) + (fun S T h => stageHom G N S T h) where + map_self _ a := by + exact HomotopyFunctor.map_id a + map_map _ _ _ h₁ h₂ a := by + exact HomotopyFunctor.map_comp _ _ _ _ a + +end + +section +open Set Metric Topology BigOperators UniversalFInfinity.Simplicial +open scoped Classical unitInterval +universe u +variable {G : Type u} [Group G] +local instance (priority := 2000) (α : Type*) : DecidableEq (ℕ × α) := Classical.decEq (ℕ × α) + +instance : MulAction G (Space G) where + smul g x := map (g * ·) id Function.injective_id x + one_smul x := by + change map (1 * ·) id Function.injective_id x = x + apply Subtype.ext + change x.1.mapDomain (fun v => (v.1,1*v.2)) = x.1 + rw [show (fun v : ℕ × G => (v.1,1*v.2)) = id from funext (fun v => Prod.ext rfl (one_mul v.2))] + exact Finsupp.mapDomain_id + mul_smul g h x := by + change map ((g*h) * ·) id Function.injective_id x = map (g * ·) id Function.injective_id (map (h * ·) id Function.injective_id x) + rw [map_comp] + have he : (fun a => (g*h)*a) = ((g * ·) ∘ (h * ·)) := funext (mul_assoc g h) + rw [he] + rfl + +instance : ContinuousConstSMul G (Space G) where + continuous_const_smul g := (map (g * ·) id Function.injective_id).continuous + +lemma smul_weight (g : G) (x : Space G) (v : ℕ × G) : (g • x).1 (v.1,g*v.2) = x.1 v := by + change (x.1.mapDomain (fun w => (w.1,g*w.2))) (v.1,g*v.2) = x.1 v + apply Finsupp.mapDomain_apply_of_injective (f := fun w : ℕ × G => (w.1,g*w.2)) + intro a b hab + have hfst := congrArg (fun p : ℕ × G => p.1) hab + have hsnd := congrArg (fun p : ℕ × G => p.2) hab + exact Prod.ext hfst (mul_left_cancel hsnd) + +lemma smul_weight_inv (g : G) (x : Space G) (v : ℕ × G) : (g • x).1 v = x.1 (v.1,g⁻¹*v.2) := by + simpa only [mul_inv_cancel_left] using smul_weight g x (v.1,g⁻¹*v.2) + +lemma exists_disjoint_nhds (x : Space G) : + ∃ U ∈ 𝓝 x, ∀ g : G, ((g • ·) '' U ∩ U).Nonempty → g = 1 := by + obtain ⟨v,hv⟩ := Simplicial.support_nonempty x.2.2.1 + let U : Set (Space G) := {y | 0 < y.1 v} + have hx : x ∈ U := lt_of_le_of_ne (x.2.1 v) (Ne.symm (Finsupp.mem_support_iff.mp hv)) + have hU : IsOpen U := isOpen_lt continuous_const (continuous_eval (complex G) v) + refine ⟨U,hU.mem_nhds hx,?_⟩ + intro g hg + obtain ⟨z,⟨y,hy,rfl⟩,hgy⟩ := hg + have h1 : v ∈ y.1.support := Finsupp.mem_support_iff.mpr (ne_of_gt hy) + have h2 : (v.1,g⁻¹*v.2) ∈ y.1.support := by + apply Finsupp.mem_support_iff.mpr + have hp : 0 < (g • y).1 v := hgy + rw [smul_weight_inv] at hp + exact ne_of_gt hp + have he := congrArg Prod.snd (y.2.2.2.2 h1 h2 rfl) + have hi : g⁻¹ = 1 := (mul_right_cancel (he.symm.trans (one_mul v.2).symm)) + exact inv_eq_one.mp hi + +lemma quotientCovering : IsQuotientCoveringMap + (Quotient.mk (MulAction.orbitRel G (Space G))) G where + __ := isQuotientMap_quotient_mk' + continuous_const_smul g := continuous_const_smul g + apply_eq_iff_mem_orbit := Quotient.eq'' + disjoint := exists_disjoint_nhds + +end +open Set Metric Topology BigOperators UniversalFInfinity.Simplicial +open scoped Classical +universe u v +variable (G : Type u) [Group G] +local instance (priority := 2000) (α : Type*) : DecidableEq (ℕ × α) := Classical.decEq (ℕ × α) + +abbrev Stage (S : Shapes G) := Simplicial.Space (stage G S) + +def stageFull (S : Shapes G) : C(Stage G S,Space G) := + ⟨inclusion _ _ (fun _ h => orbitSpan_le _ h),continuous_inclusion _ _ _⟩ +lemma stageFull_embedding (S : Shapes G) : IsClosedEmbedding (stageFull G S) := + inclusion_closedEmbedding _ _ (fun _ h => orbitSpan_le _ h) + +lemma stage_translate (S : Shapes G) (g : G) (s : Face (stage G S)) : + s.1.image (fun v => (v.1,g*v.2)) ∈ stage G S := orbitSpan_invariant _ g s.2 + +def stageSmul (S : Shapes G) (g : G) : C(Stage G S,Stage G S) := + Simplicial.mapC _ _ (fun v => (v.1,g*v.2)) (stage_translate G S g) + +instance stageAction (S : Shapes G) : MulAction G (Stage G S) where + smul g x := stageSmul G S g x + one_smul x := by + apply Subtype.ext + change x.1.mapDomain (fun v => (v.1,1*v.2)) = x.1 + rw [show (fun v : ℕ × G => (v.1,1*v.2)) = id from funext (fun v => Prod.ext rfl (one_mul v.2))] + exact Finsupp.mapDomain_id + mul_smul g h x := by + apply Subtype.ext + change x.1.mapDomain (fun v => (v.1,(g*h)*v.2)) = + (x.1.mapDomain (fun v => (v.1,h*v.2))).mapDomain (fun v => (v.1,g*v.2)) + rw [← Finsupp.mapDomain_comp] + congr 1 + funext v + exact Prod.ext rfl (mul_assoc _ _ _) + +instance stageContinuousAction (S : Shapes G) : ContinuousConstSMul G (Stage G S) where + continuous_const_smul g := (stageSmul G S g).continuous + +lemma stageFull_smul (S : Shapes G) (g : G) (x : Stage G S) : + stageFull G S (g • x) = g • stageFull G S x := rfl +lemma stageIncl_smul (S T : Shapes G) (h : S ⊆ T) (g : G) (x : Stage G S) : + stageIncl G S T h (g • x) = g • stageIncl G S T h x := rfl + +lemma compact_controlled {K : Set (Space G)} (hK : IsCompact K) : + ∃ S : Shapes G, K ⊆ Set.range (stageFull G S) := by + obtain ⟨V,hV⟩ := Simplicial.compact_bounded_vertices (complex G) hK + refine ⟨V.powerset,?_⟩ + intro x hx + have hm : x.1.support ∈ stage G V.powerset := by + apply orbitSpan_contains (basedShapes G V.powerset) x.2.2.2 + exact ⟨x.1.support,Finset.mem_insert_of_mem (Finset.mem_powerset.mpr (hV x hx)),Finset.Subset.refl _⟩ + exact ⟨⟨x.1,x.2.1,x.2.2.1,hm⟩,rfl⟩ + +lemma compact_orbit_controlled {K : Set (Space G)} (hK : IsCompact K) : + ∃ S : Shapes G, ∀ g : G, (g • ·) '' K ⊆ Set.range (stageFull G S) := by + obtain ⟨S,hS⟩ := compact_controlled G hK + refine ⟨S,?_⟩ + intro g y hy + obtain ⟨x,hx,rfl⟩ := hy + obtain ⟨z,rfl⟩ := hS hx + exact ⟨g • z,stageFull_smul G S g z⟩ + +variable {X : Type v} [TopologicalSpace X] [MulAction G X] + +def CompactFundamentalSet : Prop := + ∃ K : Set X, IsCompact K ∧ ∀ x : X, ∃ g : G, ∃ y ∈ K, x = g • y + +lemma equivariant_controlled (hX : CompactFundamentalSet G (X := X)) + (f : C(X,Space G)) (hf : ∀ (g : G) x, f (g • x) = g • f x) : + ∃ S : Shapes G, Set.range f ⊆ Set.range (stageFull G S) := by + obtain ⟨K,hK,hcov⟩ := hX + obtain ⟨S,hS⟩ := compact_orbit_controlled G (hK.image f.continuous) + refine ⟨S,?_⟩ + rintro _ ⟨x,rfl⟩ + obtain ⟨g,y,hy,rfl⟩ := hcov x + rw [hf] + exact hS g ⟨f y,⟨y,hy,rfl⟩,rfl⟩ + +def factorStage (f : C(X,Space G)) (S : Shapes G) + (hf : Set.range f ⊆ Set.range (stageFull G S)) : C(X,Stage G S) where + toFun x := (hf (Set.mem_range_self x)).choose + continuous_toFun := (stageFull_embedding G S).isEmbedding.continuous_iff.mpr (by + convert f.continuous using 1 + funext x + exact (hf (Set.mem_range_self x)).choose_spec) +omit [MulAction G X] in +lemma factorStage_spec (f : C(X,Space G)) (S : Shapes G) + (hf : Set.range f ⊆ Set.range (stageFull G S)) (x : X) : + stageFull G S (factorStage G f S hf x) = f x := (hf (Set.mem_range_self x)).choose_spec +lemma factorStage_smul (f : C(X,Space G)) (S : Shapes G) + (hf : Set.range f ⊆ Set.range (stageFull G S)) + (he : ∀ (g : G) x, f (g • x) = g • f x) (g : G) (x : X) : + factorStage G f S hf (g • x) = g • factorStage G f S hf x := by + apply (stageFull_embedding G S).injective + rw [factorStage_spec,stageFull_smul,factorStage_spec,he] +end UniversalFInfinity.Milnor + +open Set Metric Topology + +end + +end OAI diff --git a/lean/OAI/GroupTheory/UniversalGroup/Idempotents.lean b/lean/OAI/GroupTheory/UniversalGroup/Idempotents.lean new file mode 100644 index 0000000000000000000000000000000000000000..bbccc73aa62487e9983fba0c936667ce7c3a4c57 --- /dev/null +++ b/lean/OAI/GroupTheory/UniversalGroup/Idempotents.lean @@ -0,0 +1,277 @@ +import OAI.GroupTheory.UniversalGroup.MatrixDiagrams + +namespace OAI + +open Set Metric Topology BigOperators +open Set Metric Topology +open Set Topology +open Set Metric Topology +open scoped NNReal +open Set Metric Topology +open scoped NNReal ENNReal +open Set Metric Topology +open scoped TensorProduct + +namespace UniversalFInfinity +namespace IdempotentSystems + +open PrefixAlgebra MatrixCorners + +variable (K : Type) [CommRing K] + +noncomputable instance algebraRing : Ring (algebra K) := + @Subalgebra.toRing K (Operators K) _ _ _ (algebra K) + +noncomputable def corner (a : Fin 3) : Matrix (Fin 3) (Fin 3) K →ₙₐ[K] algebra K := + MatrixCorners.hom (fun i => leftWord K (words a i)) + (fun i => rightWord K (words a i)) (word_orthogonality K a) + +def carrier : Set (algebra K) := + {E | E = 1 ∨ ∃ a M, IsIdempotentElem M ∧ E = corner K a M} + +lemma carrier_finite [Finite K] : (carrier K).Finite := by + classical + apply ((Set.finite_singleton (1 : algebra K)).union + (Set.finite_range (fun x : Fin 3 × Matrix (Fin 3) (Fin 3) K => corner K x.1 x.2))).subset + rintro E (rfl | ⟨a, M, _, rfl⟩) + · exact Or.inl rfl + · exact Or.inr ⟨(a,M), rfl⟩ + +lemma one_mem : (1 : algebra K) ∈ carrier K := Or.inl rfl + +lemma corner_mem (a : Fin 3) (M : Matrix (Fin 3) (Fin 3) K) + (hM : IsIdempotentElem M) : corner K a M ∈ carrier K := + Or.inr ⟨a, M, hM, rfl⟩ + +lemma carrier_idempotent (E : algebra K) (hE : E ∈ carrier K) : IsIdempotentElem E := by + rcases hE with rfl | ⟨a, M, hM, rfl⟩ + · exact IsIdempotentElem.one + · change corner K a M * corner K a M = corner K a M + rw [← map_mul, hM.eq] + +lemma sum_idempotent {D : Type*} [Ring D] {E P : D} + (hE : IsIdempotentElem E) (hP : IsIdempotentElem P) + (hEP : E * P = 0) (hPE : P * E = 0) : IsIdempotentElem (E + P) := by + change (E + P) * (E + P) = E + P + rw [add_mul, mul_add, mul_add, hE.eq, hP.eq, hEP, hPE] + simp + +lemma diagonalUnit_eq_diagonal (i : Fin 3) : + (MatrixDiagram.diagonalUnit i : Matrix (Fin 3) (Fin 3) K) = + Matrix.diagonal (Pi.single i 1) := by + classical + ext j k + fin_cases i <;> fin_cases j <;> fin_cases k <;> + simp [MatrixDiagram.diagonalUnit, MatrixDiagram.basisVector, + Matrix.vecMulVec, Matrix.diagonal, Pi.single_apply] + +lemma corner_diagonal (a i : Fin 3) : + corner K a (MatrixDiagram.diagonalUnit i) = projection K (words a i) := by + rw [diagonalUnit_eq_diagonal] + exact MatrixCorners.map_diagonal (K := K) + (fun i => leftWord K (words a i)) (fun i => rightWord K (words a i)) + (word_orthogonality K a) i + +lemma projection_mem (a i : Fin 3) : projection K (words a i) ∈ carrier K := by + rw [← corner_diagonal] + exact corner_mem K a _ (MatrixDiagram.diagonalUnit_idempotent i) + +lemma projection_first_sum : + projection K (words 0 0) + projection K (words 0 1) + projection K (words 0 2) = 1 := by + change projection K [false,false] + projection K [false,true] + projection K [true] = 1 + have h := projection_split K [false] + have h' := projection_split K [] + simp only [List.cons_append, List.nil_append] at h h' + rw [← h, ← h'] + simp [projection] + +lemma projection_mul_zero (v w : List Bool) + (h : rightWord K v * leftWord K w = 0) : projection K v * projection K w = 0 := by + simp only [projection] + rw [mul_assoc, ← mul_assoc (rightWord K v), h, zero_mul, mul_zero] + +lemma projection_orthogonal (a : Fin 3) {i j : Fin 3} (hij : i ≠ j) : + projection K (words a i) * projection K (words a j) = 0 := + projection_mul_zero K _ _ (by rw [word_orthogonality, ite_eq_right hij]) + +variable {T : Type*} [AddCommGroup T] + +def AdditiveOnDiagram (z : algebra K → T) : Prop := + ∀ E P, E ∈ carrier K → P ∈ carrier K → E + P ∈ carrier K → + E * P = 0 → P * E = 0 → z (E + P) = z E + z P + +lemma restrict_additive (z : algebra K → T) (hz : AdditiveOnDiagram K z) (a : Fin 3) : + MatrixDiagram.OrthogonallyAdditive (fun M => z (corner K a M)) := by + intro E P hE hP hEP hPE + have hsum := corner_mem K a (E + P) (sum_idempotent hE hP hEP hPE) + rw [map_add] at hsum + change z (corner K a (E + P)) = z (corner K a E) + z (corner K a P) + rw [map_add] + apply hz _ _ (corner_mem K a E hE) (corner_mem K a P hP) hsum + · rw [← map_mul, hEP, map_zero] + · rw [← map_mul, hPE, map_zero] + +lemma projection_multiples (z : algebra K → T) (hz : AdditiveOnDiagram K z) + (p : ℕ) [CharP K p] (a i j : Fin 3) : + p • z (projection K (words a i)) = p • z (projection K (words a j)) := by + simpa only [corner_diagonal] using + MatrixDiagram.diagonal_equality (fun M => z (corner K a M)) + (restrict_additive K z hz a) p i j + +lemma first_projection_zero (z : algebra K → T) (hz : AdditiveOnDiagram K z) + (p : ℕ) [CharP K p] : p • z (projection K [false,false]) = 0 := by + let A := projection K [false,false] + let B := projection K [false,true] + let A₀ := projection K [false,false,false] + let A₁ := projection K [false,false,true] + have hA : A ∈ carrier K := projection_mem K 0 0 + have hA₀ : A₀ ∈ carrier K := projection_mem K 1 0 + have hA₁ : A₁ ∈ carrier K := projection_mem K 2 0 + have hAB : p • z A = p • z B := projection_multiples K z hz p 0 0 1 + have hA₀B : p • z A₀ = p • z B := projection_multiples K z hz p 1 0 1 + have hA₁B : p • z A₁ = p • z B := projection_multiples K z hz p 2 0 1 + have hsplit : A = A₀ + A₁ := projection_split K [false,false] + have horth₀₁ : A₀ * A₁ = 0 := by + apply projection_mul_zero + simp only [cancel_initial, Bool.false_eq_true, ite_false, ite_true] + have horth₁₀ : A₁ * A₀ = 0 := by + apply projection_mul_zero + simp only [cancel_initial, Bool.true_eq_false, ite_false, ite_true] + have hsum := hz A₀ A₁ hA₀ hA₁ (hsplit ▸ hA) horth₀₁ horth₁₀ + rw [← hsplit] at hsum + have hq : p • z A = p • z A + p • z A := calc + p • z A = p • z A₀ + p • z A₁ := by rw [hsum, nsmul_add] + _ = _ := by rw [hA₀B, hA₁B, ← hAB] + apply add_left_cancel (a := p • z A) + exact hq.symm.trans (add_zero _).symm + +lemma first_two_mem : projection K (words 0 0) + projection K (words 0 1) ∈ carrier K := by + have hd := corner_mem K 0 + ((MatrixDiagram.diagonalUnit 0 : Matrix (Fin 3) (Fin 3) K) + MatrixDiagram.diagonalUnit 1) + (sum_idempotent (MatrixDiagram.diagonalUnit_idempotent 0) + (MatrixDiagram.diagonalUnit_idempotent 1) + (MatrixDiagram.diagonalUnit_orthogonal (by decide : (0 : Fin 3) ≠ 1)) + (MatrixDiagram.diagonalUnit_orthogonal (by decide : (1 : Fin 3) ≠ 0))) + simpa only [map_add, corner_diagonal] using hd + +lemma identity_additive_decomposition (z : algebra K → T) (hz : AdditiveOnDiagram K z) : + z 1 = z (projection K (words 0 0)) + z (projection K (words 0 1)) + + z (projection K (words 0 2)) := by + let A := projection K (words 0 0) + let B := projection K (words 0 1) + let C := projection K (words 0 2) + have hA : A ∈ carrier K := projection_mem K 0 0 + have hB : B ∈ carrier K := projection_mem K 0 1 + have hC : C ∈ carrier K := projection_mem K 0 2 + have hABorth : A * B = 0 := projection_orthogonal K 0 (by decide : (0 : Fin 3) ≠ 1) + have hBAorth : B * A = 0 := projection_orthogonal K 0 (by decide : (1 : Fin 3) ≠ 0) + have hACorth : A * C = 0 := projection_orthogonal K 0 (by decide : (0 : Fin 3) ≠ 2) + have hBCorth : B * C = 0 := projection_orthogonal K 0 (by decide : (1 : Fin 3) ≠ 2) + have hCAorth : C * A = 0 := projection_orthogonal K 0 (by decide : (2 : Fin 3) ≠ 0) + have hCBorth : C * B = 0 := projection_orthogonal K 0 (by decide : (2 : Fin 3) ≠ 1) + have hABmem : A + B ∈ carrier K := first_two_mem K + have hone : A + B + C = 1 := projection_first_sum K + have hzAB := hz A B hA hB hABmem hABorth hBAorth + have hzI := hz (A + B) C hABmem hC (hone.symm ▸ one_mem K) + (by rw [add_mul, hACorth, hBCorth, add_zero]) + (by rw [mul_add, hCAorth, hCBorth, add_zero]) + rw [hone, hzAB] at hzI + exact hzI + +theorem annihilates_identity (z : algebra K → T) (hz : AdditiveOnDiagram K z) + (p : ℕ) [CharP K p] : p • z 1 = 0 := by + rw [identity_additive_decomposition K z hz, nsmul_add, nsmul_add, + ← projection_multiples K z hz p 0 0 1, ← projection_multiples K z hz p 0 0 2] + have h : p • z (projection K (words 0 0)) = 0 := first_projection_zero K z hz p + rw [h, add_zero, add_zero] + +theorem annihilates_identity_subtype (z : carrier K → T) + (hz : ∀ E P : carrier K, ∀ hsum : E.val + P.val ∈ carrier K, + E.val * P.val = 0 → P.val * E.val = 0 → + z ⟨E.val + P.val, hsum⟩ = z E + z P) + (p : ℕ) [CharP K p] : p • z ⟨1, one_mem K⟩ = 0 := by + classical + let z' : algebra K → T := fun E => if h : E ∈ carrier K then z ⟨E,h⟩ else 0 + have hz' : AdditiveOnDiagram K z' := by + intro E P hE hP hsum hEP hPE + simpa only [z', dite_eq_left hE, dite_eq_left hP, dite_eq_left hsum] using + hz ⟨E,hE⟩ ⟨P,hP⟩ hsum hEP hPE + simpa only [z', dite_eq_left (one_mem K)] using annihilates_identity K z' hz' p + +end IdempotentSystems + +namespace ConcreteEnvelopes + +open PrefixAlgebra IdempotentSystems + +noncomputable def system (K : Type) [Field K] [Finite K] : + FiniteIdempotentSystem (algebra K) where + carrier := IdempotentSystems.carrier K + finite := carrier_finite K + one_mem := one_mem K + idempotent := fun E h => carrier_idempotent K E h + +noncomputable abbrev P₂ := system (ZMod 2) +noncomputable abbrev P₃ := system (ZMod 3) +abbrev Index := TwoEnvelope.Index P₂ P₃ +abbrev triples := TwoEnvelope.triples P₂ P₃ + +structure IsDiagram {V W : Type} [Group V] [Group W] (k : Index → V →* W) : Prop where + common : k (.inl P₂.identity) = k (.inr P₃.identity) + commute : ∀ t : triples, ∀ u v, Commute (k t.val.1 u) (k t.val.2.1 v) + sum : ∀ t : triples, ∀ u, k t.val.2.2 u = k t.val.1 u * k t.val.2.1 u + +theorem finite_envelope (V : Type) [Group V] [Group.IsFinitelyPresented V] : + ∃ (W : Type) (_ : Group W), Group.IsFinitelyPresented W ∧ + ∃ k : Index → V →* W, IsDiagram k ∧ + Function.Injective (k (.inl P₂.identity)) := by + obtain ⟨W, hW, hfp, k, hc, hi, hcomm, hsum⟩ := + TwoEnvelope.finite_envelope (ZMod 2) (ZMod 3) P₂ P₃ V + exact ⟨W, hW, hfp, k, ⟨hc, hcomm, hsum⟩, hi⟩ + +def IsUniversal (U : Type) [Group U] : Prop := + ∀ (V : Type) [Group V] [Group.IsFinitelyPresented V], + ∃ φ : V →* U, Function.Injective φ + +theorem self_maps (U : Type) [Group U] [Group.IsFinitelyPresented U] + (hU : IsUniversal U) : + ∃ k : Index → U →* U, IsDiagram k ∧ + Function.Injective (k (.inl P₂.identity)) := by + obtain ⟨W, hW, hfp, k, hk, hi⟩ := finite_envelope U + let := hW + let := hfp + obtain ⟨κ, hκ⟩ := hU W + refine ⟨fun E => κ.comp (k E), ⟨?_, ?_, ?_⟩, hκ.comp hi⟩ + · rw [hk.common] + · intro E u v + exact (hk.commute E u v).map κ + · intro E u + simp only [MonoidHom.comp_apply, hk.sum E, map_mul] + +theorem coprime_annihilation {T : Type*} [AddCommGroup T] + (z : Index → T) + (hc : z (.inl P₂.identity) = z (.inr P₃.identity)) + (hs : ∀ t : triples, z t.val.2.2 = z t.val.1 + z t.val.2.1) : + z (.inl P₂.identity) = 0 := by + have h₂ : 2 • z (.inl P₂.identity) = 0 := by + apply annihilates_identity_subtype (ZMod 2) + (fun E => z (.inl E)) + intro E F hsum hEF hFE + exact hs ⟨(.inl E, .inl F, .inl ⟨E.val + F.val, hsum⟩), + ⟨hEF, hFE, rfl⟩⟩ + have h₃ : 3 • z (.inr P₃.identity) = 0 := by + apply annihilates_identity_subtype (ZMod 3) + (fun E => z (.inr E)) + intro E F hsum hEF hFE + exact hs ⟨(.inr E, .inr F, .inr ⟨E.val + F.val, hsum⟩), + ⟨hEF, hFE, rfl⟩⟩ + rw [← hc] at h₃ + have hx : (3 : ℕ) • z (.inl P₂.identity) = 2 • z (.inl P₂.identity) + + z (.inl P₂.identity) := by exact succ_nsmul _ 2 + rw [hx, h₂, zero_add] at h₃ + exact h₃ + +end ConcreteEnvelopes +end UniversalFInfinity + +end OAI diff --git a/lean/OAI/GroupTheory/UniversalGroup/Main.lean b/lean/OAI/GroupTheory/UniversalGroup/Main.lean new file mode 100644 index 0000000000000000000000000000000000000000..977795ae054cc3d46261c68a4d9cbf028ce8331a --- /dev/null +++ b/lean/OAI/GroupTheory/UniversalGroup/Main.lean @@ -0,0 +1,52 @@ +import OAI.GroupTheory.UniversalGroup.UniverseTransport + +namespace OAI + +open Set Metric Topology BigOperators +open Set Metric Topology +open Set Topology +open Set Metric Topology +open scoped NNReal +open Set Metric Topology +open scoped NNReal ENNReal +open Set Metric Topology +open scoped TensorProduct +open Set Metric Topology + +namespace UniversalFInfinity +noncomputable section +universe u + +theorem universal_group_of_type_FInfinity : + ∃ (H : Type u) (groupH : Group H), + @HasTypeFInfinity H groupH ∧ + ∀ (G : Type u) [Group G] [Group.IsFinitelyPresented G], + ∃ φ : G →* H, Function.Injective φ := by + obtain ⟨U,gU,fpU,i,hi⟩ := Higman.NormalWords.embeds_presentation + RecursiveUniversalThree.enumerator RecursiveUniversalThree.enumerator_primrec.to_comp + let : Group U := gU + let : Group.IsFinitelyPresented U := fpU + have hU : ConcreteEnvelopes.IsUniversal U := by + intro V _ _ + obtain ⟨j,hj⟩ := RecursiveUniversalThree.universal (G := V) + exact ⟨i.comp j,hi.comp hj⟩ + obtain ⟨k,hk,hk_inj⟩ := ConcreteEnvelopes.self_maps U hU + let : Fact (Function.Injective (k (.inl ConcreteEnvelopes.P₂.identity))) := ⟨hk_inj⟩ + let : TopologicalSpace U := ⊥ + let : DiscreteTopology U := ⟨rfl⟩ + let f := k (.inl ConcreteEnvelopes.P₂.identity) + let H₀ := AscendingTorus.Torus f + let : TopologicalSpace H₀ := ⊥ + let : DiscreteTopology H₀ := ⟨rfl⟩ + refine ⟨ULift.{u} H₀,inferInstance,?_,?_⟩ + · exact Brown.geometric_lifted_of_uniform + (TorusGeometry.diagram_milnor_uniform_nullhomotopy k hk) + · intro G _ _ + obtain ⟨j,hj⟩ := RecursiveUniversalThree.universal (G := G) + refine ⟨MulEquiv.ulift.symm.toMonoidHom.comp ((AscendingTorus.of f).comp (i.comp j)),?_⟩ + exact MulEquiv.ulift.symm.injective.comp ((AscendingTorus.of_injective f hk_inj).comp + (hi.comp hj)) +end +end UniversalFInfinity + +end OAI diff --git a/lean/OAI/GroupTheory/UniversalGroup/MarkerMachine.lean b/lean/OAI/GroupTheory/UniversalGroup/MarkerMachine.lean new file mode 100644 index 0000000000000000000000000000000000000000..2391b123cc9b601153641894dc5b359001c7a9ce --- /dev/null +++ b/lean/OAI/GroupTheory/UniversalGroup/MarkerMachine.lean @@ -0,0 +1,455 @@ +import OAI.GroupTheory.UniversalGroup.Markers + +namespace OAI + +universe u v w x + +namespace Higman.FreeBasis + +section +variable {X : Type*} + +noncomputable def erase (S : Set X) : FreeGroup X →* FreeGroup X := by + classical + exact FreeGroup.lift (fun x ↦ if x ∈ S then FreeGroup.of x else 1) + +open Classical in +@[simp] theorem erase_of (S : Set X) (x : X) : erase S (FreeGroup.of x) = + if x ∈ S then FreeGroup.of x else 1 := by + classical + simp [erase] + +abbrev span (S : Set X) : Subgroup (FreeGroup X) := Subgroup.closure (FreeGroup.of '' S) + +theorem erase_eq_self_iff (S : Set X) (g : FreeGroup X) : erase S g = g ↔ g ∈ span S := by + classical + constructor + · intro hg + have hle : (erase S).range ≤ span S := by + rw [erase,FreeGroup.range_lift_eq_closure] + apply (Subgroup.closure_le _).mpr + rintro _ ⟨x,rfl⟩ + by_cases hx : x ∈ S + · simp only [hx,ite_true] + exact Subgroup.subset_closure ⟨x,hx,rfl⟩ + · simp only [hx,ite_false] + exact Subgroup.one_mem _ + exact hle ⟨g,hg⟩ + · have hle : span S ≤ (erase S).eqLocus (MonoidHom.id _) := by + apply (Subgroup.closure_le _).mpr + rintro _ ⟨x,hx,rfl⟩ + change erase S (FreeGroup.of x) = FreeGroup.of x + simp [hx] + exact fun hg ↦ hle hg + +theorem erase_comp (S T : Set X) : (erase S).comp (erase T) = erase (S ∩ T) := by + classical + apply FreeGroup.ext_hom + intro x + by_cases hxS : x ∈ S <;> by_cases hxT : x ∈ T <;> simp [hxS,hxT] + +theorem span_inter (S T : Set X) : span S ⊓ span T = span (S ∩ T) := by + apply le_antisymm + · intro g hg + apply (erase_eq_self_iff _ _).mp + rw [← erase_comp] + change erase S (erase T g) = g + rw [(erase_eq_self_iff T g).mpr hg.2,(erase_eq_self_iff S g).mpr hg.1] + · exact le_inf (Subgroup.closure_mono (Set.image_mono Set.inter_subset_left)) + (Subgroup.closure_mono (Set.image_mono Set.inter_subset_right)) + +theorem of_mem_span_iff (S : Set X) (x : X) : FreeGroup.of x ∈ span S ↔ x ∈ S := by + classical + constructor + · intro h + by_contra hx + have he := (erase_eq_self_iff S (FreeGroup.of x)).mpr h + simp only [erase_of,hx,ite_false] at he + exact FreeGroup.of_ne_one x he.symm + · intro hx + exact Subgroup.subset_closure ⟨x,hx,rfl⟩ + +end + +variable {X : Type*} {G : Type*} [Group G] + +theorem map_span_inf (d : FreeGroup X →* G) (r : G →* FreeGroup X) + (hr : r.comp d = MonoidHom.id _) (U V : Set X) (A : Subgroup G) + (hsupport : A.map r ≤ span U) + (hletters : ∀ x ∈ U, d (FreeGroup.of x) ∈ A) : + (span V).map d ⊓ A = (span (V ∩ U)).map d := by + apply le_antisymm + · rintro g ⟨⟨w,hw,rfl⟩,hA⟩ + refine ⟨w,?_,rfl⟩ + rw [← span_inter] + refine ⟨hw,?_⟩ + have hh := hsupport (Subgroup.mem_map.mpr ⟨d w,hA,rfl⟩) + change w ∈ span U + simpa only [← MonoidHom.comp_apply,hr,MonoidHom.id_apply] using hh + · apply le_inf + · exact Subgroup.map_mono (Subgroup.closure_mono (Set.image_mono Set.inter_subset_left)) + · rw [span,MonoidHom.map_closure] + apply (Subgroup.closure_le _).mpr + rintro _ ⟨_,⟨x,hx,rfl⟩,rfl⟩ + exact hletters x hx.2 + +end Higman.FreeBasis + +namespace Higman.DecoratedMarker +open Monoid Coprod +variable {G : Type u} [Group G] {T : Type v} [Group T] {Q : Type w} + +theorem eq_inclusion_of_right_eq_one (x : Base G T Q) (hx : (test x).right = 1) : + x = inclusion (test x).left := by + apply (decomposition (G := G) (T := T) (Q := Q)).injective + change test x = test (inclusion (test x).left) + rw [← MonoidHom.comp_apply,test_comp] + apply SemidirectProduct.ext + · rfl + · exact hx + +end Higman.DecoratedMarker + +namespace Higman.MarkerEmbedding + +section +open Monoid Coprod DecoratedMarker +variable {G : Type u} [Group G] {D : Type v} [Group D] + {T : Type w} [Group T] {P Q : Type*} + +@[simp] theorem test_embedding (f : D →* T) (o : P → T) (q : P → Q) + (w : P → G) (x : Base G D P) : + test (embedding f o q w x) = + SemidirectProduct.map (kernelMap f o q w) f (kernelMap_shift f o q w) (test x) := by + change (test.comp inverse) _ = _ + rw [test_comp_inverse] + rfl + +@[simp] theorem embedding_inclusion (f : D →* T) (o : P → T) (q : P → Q) + (w : P → G) (x : Kernel G D P) : + embedding f o q w (inclusion x) = inclusion (kernelMap f o q w x) := by + simp only [embedding,MonoidHom.comp_apply] + rw [← MonoidHom.comp_apply (test : Base G D P →* _),test_comp] + simp + +theorem kernel_intersection (f : D →* T) (hf : Function.Injective f) + (o : P → T) (q : P → Q) (w : P → G) (R : Subgroup (Kernel G T Q)) : + R.map inclusion ⊓ (embedding f o q w).range = + (R ⊓ (kernelMap f o q w).range).map inclusion := by + apply le_antisymm + · rintro _ ⟨⟨a,ha,rfl⟩,⟨x,hx⟩⟩ + have hxright : (test x).right = 1 := by + apply hf + have he := congrArg (fun y : Base G T Q ↦ (test y).right) hx + simp only [test_embedding,SemidirectProduct.map_right] at he + rw [← MonoidHom.comp_apply,test_comp] at he + simpa only [SemidirectProduct.right_inl,map_one] using he + have hx' := eq_inclusion_of_right_eq_one x hxright + refine ⟨a,⟨ha,?_⟩,rfl⟩ + refine ⟨(test x).left,?_⟩ + apply inclusion_injective + rw [← embedding_inclusion,← hx'] + exact hx + · rintro _ ⟨a,⟨ha,⟨x,hx⟩⟩,rfl⟩ + refine ⟨⟨a,ha,rfl⟩,inclusion x,?_⟩ + rw [embedding_inclusion,hx] + +lemma projection_kernelMap (f : D →* T) (o : P → T) (q : P → Q) (w : P → G) : + (Coprod.snd : Kernel G T Q →* FreeGroup (T × Q)).comp (kernelMap f o q w) = + (FreeGroup.map (index f o q)).comp (Coprod.snd : Kernel G D P →* _) := by + apply Coprod.hom_ext + · apply MonoidHom.ext + intro g + simp + · apply FreeGroup.ext_hom + intro x + simp + +lemma range_projection_support (f : D →* T) (o : P → T) (q : P → Q) (w : P → G) : + (kernelMap f o q w).range.map Coprod.snd ≤ FreeBasis.span (Set.range (index f o q)) := by + rintro _ ⟨_,⟨x,rfl⟩,rfl⟩ + have he := DFunLike.congr_fun (projection_kernelMap f o q w) x + change Coprod.snd (kernelMap f o q w x) ∈ FreeBasis.span (Set.range (index f o q)) + rw [show Coprod.snd (kernelMap f o q w x) = FreeGroup.map (index f o q) (Coprod.snd x) from he] + have hm : FreeGroup.map (index f o q) (Coprod.snd x) ∈ (FreeGroup.map (index f o q)).range := + ⟨Coprod.snd x,rfl⟩ + simpa only [FreeGroup.range_map,FreeBasis.span] using hm + +lemma decorated_letter_mem_range (f : D →* T) (o : P → T) (q : P → Q) (w : P → G) + (v : T × Q → G) (x : T × Q) (hx : x ∈ Set.range (index f o q)) : + DecoratedFreeBasis.inclusion v (FreeGroup.of x) ∈ (kernelMap f o q w).range := by + obtain ⟨⟨d,p⟩,rfl⟩ := hx + refine ⟨inl (v (index f o q (d,p)) * (w p)⁻¹) * inr (FreeGroup.of (d,p)),?_⟩ + simp [mul_assoc] + +theorem decorated_kernel_intersection (f : D →* T) (o : P → T) (q : P → Q) + (w : P → G) (v : T × Q → G) (V : Set (T × Q)) : + (FreeBasis.span V).map (DecoratedFreeBasis.inclusion v) ⊓ (kernelMap f o q w).range = + (FreeBasis.span (V ∩ Set.range (index f o q))).map (DecoratedFreeBasis.inclusion v) := + FreeBasis.map_span_inf (DecoratedFreeBasis.inclusion v) Coprod.snd + (DecoratedFreeBasis.projection_comp v) (Set.range (index f o q)) V _ + (range_projection_support f o q w) (decorated_letter_mem_range f o q w v) + +def decoratedSubgroup (v : T × Q → G) (V : Set (T × Q)) : Subgroup (Base G T Q) := + (FreeBasis.span V).map (inclusion.comp (DecoratedFreeBasis.inclusion v)) + +theorem decorated_intersection (f : D →* T) (hf : Function.Injective f) + (o : P → T) (q : P → Q) (w : P → G) (v : T × Q → G) (V : Set (T × Q)) : + decoratedSubgroup v V ⊓ (embedding f o q w).range = + decoratedSubgroup v (V ∩ Set.range (index f o q)) := by + rw [decoratedSubgroup,← Subgroup.map_map,kernel_intersection f hf o q w, + decorated_kernel_intersection,Subgroup.map_map] + rfl + +theorem decoratedSubgroup_eq_closure (v : T × Q → G) (V : Set (T × Q)) : + decoratedSubgroup v V = + Subgroup.closure ((fun x : T × Q ↦ coefficient (v x) * marker x.1 x.2) '' V) := by + rw [decoratedSubgroup,FreeBasis.span,MonoidHom.map_closure,Set.image_image] + congr 1 + +end + +open DecoratedMarker +variable {G : Type u} [Group G] {T : Type v} [Group T] {Q : Type w} + {D : Type*} [Group D] {P : Type*} + +def pullDecoration (f : D →* T) (o : P → T) (q : P → Q) (w : P → G) + (v : T × Q → G) (x : D × P) : G := v (index f o q x) * (w x.2)⁻¹ + +@[simp] lemma embedding_decorated (f : D →* T) (o : P → T) (q : P → Q) (w : P → G) + (v : T × Q → G) (x : D × P) : + embedding f o q w (coefficient (pullDecoration f o q w v x) * marker x.1 x.2) = + coefficient (v (index f o q x)) * marker (index f o q x).1 (index f o q x).2 := by + rw [map_mul,embedding_coefficient,embedding_marker,← mul_assoc,← map_mul] + simp [pullDecoration,index] + +lemma map_decoratedSubgroup (f : D →* T) (o : P → T) (q : P → Q) (w : P → G) + (v : T × Q → G) (W : Set (D × P)) : + (decoratedSubgroup (pullDecoration f o q w v) W).map (embedding f o q w) = + decoratedSubgroup v (index f o q '' W) := by + rw [decoratedSubgroup_eq_closure,MonoidHom.map_closure,decoratedSubgroup_eq_closure] + simp only [Set.image_image,embedding_decorated] + +theorem comap_decoratedSubgroup [Nonempty P] (f : D →* T) (hf : Function.Injective f) + (o : P → T) (q : P → Q) (w : P → G) (hi : Function.Injective (index f o q)) + (v : T × Q → G) (V : Set (T × Q)) : + (decoratedSubgroup v V).comap (embedding f o q w) = + decoratedSubgroup (pullDecoration f o q w v) (index f o q ⁻¹' V) := by + apply Subgroup.map_injective (embedding_injective f hf o q w hi) + rw [Subgroup.map_comap_eq,inf_comm,decorated_intersection f hf, + map_decoratedSubgroup,Set.image_preimage_eq_inter_range] + +end Higman.MarkerEmbedding + +namespace Higman.PartialIso +variable {H : Type u} [Group H] {G : Type u} [Group G] + +noncomputable def ofEmbeddings (i j : H →* G) (hi : Function.Injective i) + (hj : Function.Injective j) : PartialIso G where + source := i.range + target := j.range + equiv := (MonoidHom.ofInjective hi).symm.trans (MonoidHom.ofInjective hj) + +@[simp] theorem ofEmbeddings_apply (i j : H →* G) (hi : Function.Injective i) + (hj : Function.Injective j) (x : H) : + ((ofEmbeddings i j hi hj).equiv (MonoidHom.ofInjective hi x) : G) = j x := by + change j ((MonoidHom.ofInjective hi).symm ((MonoidHom.ofInjective hi) x)) = j x + rw [MulEquiv.symm_apply_apply] + +lemma ofEmbeddings_invariant_iff (i j : H →* G) (hi : Function.Injective i) + (hj : Function.Injective j) (R : Subgroup G) : + (ofEmbeddings i j hi hj).Invariant R ↔ R.comap i = R.comap j := by + constructor + · intro h + ext x + simpa only [ofEmbeddings_apply,MonoidHom.ofInjective_apply,Subgroup.mem_comap] using + (h (MonoidHom.ofInjective hi x)).symm + · intro h a + obtain ⟨x,rfl⟩ := (MonoidHom.ofInjective hi).surjective a + rw [ofEmbeddings_apply] + change x ∈ R.comap j ↔ x ∈ R.comap i + rw [h] + +end Higman.PartialIso +namespace Higman.MarkerMachine +open DecoratedMarker MarkerEmbedding + +structure Edge (G T : Type u) [Group G] [Group T] (Q : Type u) where + Domain : Type u + [domainGroup : Group Domain] + inputLinear : Domain →* T + outputLinear : Domain →* T + input_injective : Function.Injective inputLinear + output_injective : Function.Injective outputLinear + inputOffset : T + outputOffset : T + inputState : Q + outputState : Q + weight : G + +attribute [instance] Edge.domainGroup +variable {G T Q : Type u} [Group G] [Group T] + +namespace Edge +variable (e : Edge G T Q) + +def input (d : e.Domain) : T × Q := (e.inputLinear d * e.inputOffset,e.inputState) +def output (d : e.Domain) : T × Q := (e.outputLinear d * e.outputOffset,e.outputState) + +def inputMap : Base G e.Domain Unit →* Base G T Q := + embedding e.inputLinear (fun _ ↦ e.inputOffset) (fun _ ↦ e.inputState) (fun _ ↦ 1) +def outputMap : Base G e.Domain Unit →* Base G T Q := + embedding e.outputLinear (fun _ ↦ e.outputOffset) (fun _ ↦ e.outputState) (fun _ ↦ e.weight) + +lemma input_index_injective : Function.Injective + (index e.inputLinear (fun _ : Unit ↦ e.inputOffset) (fun _ ↦ e.inputState)) := + index_injective e.inputLinear e.input_injective _ _ (Function.injective_of_subsingleton _) +lemma output_index_injective : Function.Injective + (index e.outputLinear (fun _ : Unit ↦ e.outputOffset) (fun _ ↦ e.outputState)) := + index_injective e.outputLinear e.output_injective _ _ (Function.injective_of_subsingleton _) + +lemma inputMap_injective : Function.Injective e.inputMap := + embedding_injective e.inputLinear e.input_injective _ _ _ e.input_index_injective +lemma outputMap_injective : Function.Injective e.outputMap := + embedding_injective e.outputLinear e.output_injective _ _ _ e.output_index_injective + +noncomputable def partialIso : PartialIso (Base G T Q) := + PartialIso.ofEmbeddings e.inputMap e.outputMap e.inputMap_injective e.outputMap_injective + +lemma inputMap_decorated (v : G) (d : e.Domain) : + e.inputMap (coefficient v * marker d ()) = + coefficient v * marker (e.input d).1 (e.input d).2 := by + simp [inputMap,input] + +lemma outputMap_decorated (v : G) (d : e.Domain) : + e.outputMap (coefficient v * marker d ()) = + coefficient (v * e.weight) * marker (e.output d).1 (e.output d).2 := by + simp [outputMap,output,map_mul,mul_assoc] + +end Edge +end Higman.MarkerMachine + +namespace Higman.MarkerEmbedding +open DecoratedMarker +variable {G : Type u} [Group G] {T : Type v} [Group T] {Q : Type w} + +lemma decoratedSubgroup_congr {v w : T × Q → G} {V : Set (T × Q)} + (h : ∀ x ∈ V, v x = w x) : decoratedSubgroup v V = decoratedSubgroup w V := by + rw [decoratedSubgroup_eq_closure,decoratedSubgroup_eq_closure] + congr 1 + apply Set.image_congr + intro x hx + rw [h x hx] + +end Higman.MarkerEmbedding +namespace Higman.MarkerMachine.Edge +open DecoratedMarker MarkerEmbedding +variable {G T Q : Type u} [Group G] [Group T] (e : Edge G T Q) + +theorem invariant (v : T × Q → G) (V : Set (T × Q)) + (hV : ∀ d, e.input d ∈ V ↔ e.output d ∈ V) + (hv : ∀ d, e.input d ∈ V → v (e.output d) = v (e.input d) * e.weight) : + e.partialIso.Invariant (decoratedSubgroup v V) := by + rw [partialIso,PartialIso.ofEmbeddings_invariant_iff] + unfold inputMap outputMap + rw [comap_decoratedSubgroup e.inputLinear e.input_injective _ _ _ e.input_index_injective, + comap_decoratedSubgroup e.outputLinear e.output_injective _ _ _ e.output_index_injective] + have he : index e.inputLinear (fun _ : Unit ↦ e.inputOffset) (fun _ ↦ e.inputState) ⁻¹' V = + index e.outputLinear (fun _ : Unit ↦ e.outputOffset) (fun _ ↦ e.outputState) ⁻¹' V := by + ext x + exact hV x.1 + rw [← he] + apply decoratedSubgroup_congr + rintro ⟨d,p⟩ hd + change v (e.input d) * (1 : G)⁻¹ = v (e.output d) * e.weight⁻¹ + change e.input d ∈ V at hd + rw [hv d hd] + simp + +lemma invariant_decorated_iff (R : Subgroup (Base G T Q)) (hR : e.partialIso.Invariant R) + (a : G) (d : e.Domain) : + coefficient (a * e.weight) * marker (e.output d).1 (e.output d).2 ∈ R ↔ + coefficient a * marker (e.input d).1 (e.input d).2 ∈ R := by + have hh := hR (MonoidHom.ofInjective e.inputMap_injective (coefficient a * marker d ())) + change ((PartialIso.ofEmbeddings e.inputMap e.outputMap _ _).equiv + (MonoidHom.ofInjective e.inputMap_injective (coefficient a * marker d ())) : + Base G T Q) ∈ R ↔ _ at hh + simpa only [PartialIso.ofEmbeddings_apply,MonoidHom.ofInjective_apply, + inputMap_decorated,outputMap_decorated] using hh + +lemma source_fg [Group.IsFinitelyPresented G] [Group.IsFinitelyPresented e.Domain] : + e.partialIso.source.FG := by + have : Group.IsFinitelyPresented (G × e.Domain) := finitelyPresented_prod + obtain ⟨n,p,hp,_⟩ := Group.IsFinitelyPresented.out (G := Base G e.Domain Unit) + have : Group.FG (Base G e.Domain Unit) := Group.fg_of_surjective hp + exact (Group.fg_iff_subgroup_fg e.inputMap.range).mp inferInstance + +end Higman.MarkerMachine.Edge + +namespace Higman.MarkerMachine +open DecoratedMarker MarkerEmbedding +variable {G T Q : Type u} [Group G] [Group T] + +inductive Reach (es : List (Edge G T Q)) (seed : T × Q) : T × Q → Prop + | start : Reach es seed seed + | forward (e : Edge G T Q) (he : e ∈ es) (d : e.Domain) : + Reach es seed (e.input d) → Reach es seed (e.output d) + | backward (e : Edge G T Q) (he : e ∈ es) (d : e.Domain) : + Reach es seed (e.output d) → Reach es seed (e.input d) + +lemma reach_iff (es : List (Edge G T Q)) (seed : T × Q) (e : Edge G T Q) (he : e ∈ es) + (d : e.Domain) : Reach es seed (e.input d) ↔ Reach es seed (e.output d) := + ⟨Reach.forward e he d,Reach.backward e he d⟩ + +def word (v : T × Q → G) (c : T × Q) : Base G T Q := + coefficient (v c) * marker c.1 c.2 + +theorem orbit_eq (es : List (Edge G T Q)) (seed : T × Q) (v : T × Q → G) + (hv : ∀ e ∈ es, ∀ d, Reach es seed (e.input d) → + v (e.output d) = v (e.input d) * e.weight) : + Orbit.subgroup (es.map Edge.partialIso) {word v seed} = + decoratedSubgroup v {c | Reach es seed c} := by + apply le_antisymm + · apply Orbit.minimal + · rintro x (rfl : x = word v seed) + rw [decoratedSubgroup_eq_closure] + exact Subgroup.subset_closure ⟨seed,Reach.start,rfl⟩ + · intro p hp + obtain ⟨e,he,rfl⟩ := List.mem_map.mp hp + exact e.invariant v _ (reach_iff es seed e he) (hv e he) + · rw [decoratedSubgroup_eq_closure] + apply (Subgroup.closure_le _).mpr + rintro _ ⟨c,hc,rfl⟩ + change word v c ∈ Orbit.subgroup (es.map Edge.partialIso) {word v seed} + induction hc with + | start => exact Orbit.subset _ _ (Set.mem_singleton _) + | forward e he d hr ih => + have hinv := Orbit.invariant (es.map Edge.partialIso) {word v seed} e.partialIso + (List.mem_map.mpr ⟨e,he,rfl⟩) + change coefficient (v (e.output d)) * marker (e.output d).1 (e.output d).2 ∈ _ + rw [hv e he d hr] + exact (e.invariant_decorated_iff _ hinv (v (e.input d)) d).mpr ih + | backward e he d hr ih => + have hinv := Orbit.invariant (es.map Edge.partialIso) {word v seed} e.partialIso + (List.mem_map.mpr ⟨e,he,rfl⟩) + apply (e.invariant_decorated_iff _ hinv (v (e.input d)) d).mp + rw [← hv e he d (Reach.backward e he d hr)] + exact ih + +theorem benign [Group.IsFinitelyPresented G] [Group.IsFinitelyPresented T] [Finite Q] + (es : List (Edge G T Q)) (hD : ∀ e ∈ es, Group.IsFinitelyPresented e.Domain) + (seed : T × Q) (v : T × Q → G) + (hv : ∀ e ∈ es, ∀ d, Reach es seed (e.input d) → + v (e.output d) = v (e.input d) * e.weight) : + IsBenign (decoratedSubgroup v {c | Reach es seed c}) := by + have : Group.IsFinitelyPresented (G × T) := finitelyPresented_prod + rw [← orbit_eq es seed v hv] + apply Orbit.benign _ _ _ (Set.finite_singleton _) + intro p hp + obtain ⟨e,he,rfl⟩ := List.mem_map.mp hp + have := hD e he + exact e.source_fg + +end Higman.MarkerMachine + +end OAI diff --git a/lean/OAI/GroupTheory/UniversalGroup/Markers.lean b/lean/OAI/GroupTheory/UniversalGroup/Markers.lean new file mode 100644 index 0000000000000000000000000000000000000000..e4f2646df98d4c41e450c6a5257eeb1be9d0a8b2 --- /dev/null +++ b/lean/OAI/GroupTheory/UniversalGroup/Markers.lean @@ -0,0 +1,320 @@ +import OAI.GroupTheory.UniversalGroup.FiniteHNN + +namespace OAI + +section UniversalFinitelyPresentedProof +universe u v w x + +namespace Higman.DecoratedMarker +open Monoid Coprod +variable {G : Type u} [Group G] {T : Type v} [Group T] {Q : Type w} + +abbrev Kernel (G : Type u) [Group G] (T : Type v) (Q : Type w) := + G ∗ FreeGroup (T × Q) +abbrev Base (G : Type u) [Group G] (T : Type v) [Group T] (Q : Type w) := + (G × T) ∗ FreeGroup Q + +def shift (t : T) : MulAut (Kernel G T Q) := + (MulEquiv.refl G).coprodCongr + (FreeGroup.freeGroupCongr ((Equiv.mulLeft t).prodCongr (Equiv.refl Q))) + +@[simp] theorem shift_inl (t : T) (g : G) : shift t (inl g : Kernel G T Q) = inl g := rfl +@[simp] theorem shift_inr_of (t s : T) (q : Q) : + shift t (inr (FreeGroup.of (s,q)) : Kernel G T Q) = inr (FreeGroup.of (t*s,q)) := rfl + +def shifts : T →* MulAut (Kernel G T Q) where + toFun := shift + map_one' := by + apply MulEquiv.toMonoidHom_injective + apply Coprod.hom_ext + · apply MonoidHom.ext + intro g + simp + · apply FreeGroup.ext_hom + rintro ⟨s,q⟩ + simp + map_mul' t s := by + apply MulEquiv.toMonoidHom_injective + apply Coprod.hom_ext + · apply MonoidHom.ext + intro g + simp + · apply FreeGroup.ext_hom + rintro ⟨r,q⟩ + simp [mul_assoc] + +abbrev ShiftGroup (G : Type u) [Group G] (T : Type v) [Group T] (Q : Type w) := + (Kernel G T Q) ⋊[shifts] T + +def coefficient : G →* Base G T Q := inl.comp (MonoidHom.inl G T) +def translation : T →* Base G T Q := inl.comp (MonoidHom.inr G T) +def marker (t : T) (q : Q) : Base G T Q := + translation t * inr (FreeGroup.of q) * (translation t)⁻¹ + +def inclusion : Kernel G T Q →* Base G T Q := + Coprod.lift coefficient (FreeGroup.lift (fun p ↦ marker p.1 p.2)) + +@[simp] theorem inclusion_inl (g : G) : inclusion (inl g : Kernel G T Q) = coefficient g := by + simp [inclusion] +@[simp] theorem inclusion_inr_of (t : T) (q : Q) : + inclusion (inr (FreeGroup.of (t,q)) : Kernel G T Q) = marker t q := by + simp [inclusion] + +lemma commute_coefficient_translation (g : G) (t : T) : + Commute (coefficient g : Base G T Q) (translation t) := + (MonoidHom.commute_inl_inr g t).map inl + +lemma test_commute (g : G) (t : T) : + Commute (SemidirectProduct.inl (inl g) : ShiftGroup G T Q) + (SemidirectProduct.inr t) := by + apply SemidirectProduct.ext + · change inl g * shifts (1 : T) 1 = 1 * shifts t (inl g) + simp only [map_one, mul_one, one_mul] + rfl + · change (1 : T) * t = t * 1 + simp + +def test : Base G T Q →* ShiftGroup G T Q := + Coprod.lift + ((SemidirectProduct.inl.comp inl).noncommCoprod SemidirectProduct.inr test_commute) + (FreeGroup.lift (fun q ↦ SemidirectProduct.inl (inr (FreeGroup.of (1,q))))) + +@[simp] theorem test_coefficient (g : G) : test (coefficient g : Base G T Q) = + SemidirectProduct.inl (inl g) := by simp [test,coefficient] +@[simp] theorem test_translation (t : T) : test (translation t : Base G T Q) = + SemidirectProduct.inr t := by simp [test,translation] +@[simp] theorem test_inr_of (q : Q) : test (inr (FreeGroup.of q) : Base G T Q) = + SemidirectProduct.inl (inr (FreeGroup.of (1,q))) := by simp [test] +@[simp] theorem test_marker (t : T) (q : Q) : test (marker t q : Base G T Q) = + SemidirectProduct.inl (inr (FreeGroup.of (t,q))) := by + simp only [marker,map_mul,map_inv,test_translation,test_inr_of] + rw [← map_inv,← SemidirectProduct.inl_aut] + change SemidirectProduct.inl (inr (FreeGroup.of (t * 1, q))) = _ + rw [mul_one] + +@[simp] theorem test_comp : (test (G := G) (T := T) (Q := Q)).comp inclusion = + SemidirectProduct.inl := by + apply Coprod.hom_ext + · apply MonoidHom.ext + intro g + simp + · apply FreeGroup.ext_hom + rintro ⟨t,q⟩ + simp + +theorem inclusion_injective : Function.Injective (inclusion (G := G) (T := T) (Q := Q)) := by + apply Function.Injective.of_comp (f := test) + rw [← MonoidHom.coe_comp,test_comp] + exact SemidirectProduct.inl_injective + +lemma inclusion_shift (t : T) : + (inclusion (G := G) (Q := Q)).comp (shifts t).toMonoidHom = + (MulAut.conj (translation t)).toMonoidHom.comp inclusion := by + apply Coprod.hom_ext + · apply MonoidHom.ext + intro g + simp only [MonoidHom.comp_apply,MulEquiv.coe_toMonoidHom,shifts,MonoidHom.coe_mk, + OneHom.coe_mk,shift_inl,inclusion_inl,MulAut.conj_apply] + rw [← (commute_coefficient_translation g t).eq,mul_inv_cancel_right] + · apply FreeGroup.ext_hom + rintro ⟨s,q⟩ + simp only [MonoidHom.comp_apply,MulEquiv.coe_toMonoidHom,shifts,MonoidHom.coe_mk, + OneHom.coe_mk,shift_inr_of,inclusion_inr_of,MulAut.conj_apply,marker,map_mul,map_inv] + group + +def inverse : ShiftGroup G T Q →* Base G T Q := + SemidirectProduct.lift inclusion translation inclusion_shift + +@[simp] theorem inverse_inl (x : Kernel G T Q) : + inverse (SemidirectProduct.inl x) = inclusion x := by simp [inverse] +@[simp] theorem inverse_inr (t : T) : + inverse (SemidirectProduct.inr t : ShiftGroup G T Q) = translation t := by simp [inverse] + +@[simp] theorem inverse_comp_test : (inverse (G := G) (T := T) (Q := Q)).comp test = + MonoidHom.id _ := by + apply Coprod.hom_ext + · apply MonoidHom.ext + rintro ⟨g,t⟩ + have he : (inl (g,t) : Base G T Q) = coefficient g * translation t := by + rw [coefficient,translation,MonoidHom.comp_apply,MonoidHom.comp_apply,← map_mul] + simp + change inverse (test (inl (g,t))) = inl (g,t) + rw [he] + simp + · apply FreeGroup.ext_hom + intro q + simp only [MonoidHom.comp_apply,MonoidHom.id_apply,test_inr_of,inverse_inl, + inclusion_inr_of,marker,map_one,one_mul,inv_one,mul_one] + +@[simp] theorem test_comp_inverse : (test (G := G) (T := T) (Q := Q)).comp inverse = + MonoidHom.id _ := by + apply SemidirectProduct.hom_ext + · apply MonoidHom.ext + intro x + simp only [MonoidHom.comp_apply,inverse_inl,MonoidHom.id_apply] + exact DFunLike.congr_fun test_comp x + · apply MonoidHom.ext + intro t + simp + +def decomposition : Base G T Q ≃* ShiftGroup G T Q := + MonoidHom.toMulEquiv test inverse inverse_comp_test test_comp_inverse + +end Higman.DecoratedMarker + +namespace Higman.DecoratedFreeBasis +open Monoid Coprod +variable {G : Type*} [Group G] {X : Type*} + +def inclusion (w : X → G) : FreeGroup X →* G ∗ FreeGroup X := + FreeGroup.lift (fun x ↦ inl (w x) * inr (FreeGroup.of x)) + +@[simp] theorem inclusion_of (w : X → G) (x : X) : + inclusion w (FreeGroup.of x) = inl (w x) * inr (FreeGroup.of x) := by + simp [inclusion] + +@[simp] theorem projection_comp (w : X → G) : + (Coprod.snd : G ∗ FreeGroup X →* FreeGroup X).comp (inclusion w) = MonoidHom.id _ := by + apply FreeGroup.ext_hom + intro x + simp + +theorem inclusion_injective (w : X → G) : Function.Injective (inclusion w) := by + apply Function.Injective.of_comp (f := (Coprod.snd : G ∗ FreeGroup X →* FreeGroup X)) + rw [← MonoidHom.coe_comp,projection_comp] + exact Function.injective_id + +def twist (w : X → G) : MulAut (G ∗ FreeGroup X) := + MonoidHom.toMulEquiv + (Coprod.lift inl (inclusion w)) + (Coprod.lift inl (inclusion (fun x ↦ (w x)⁻¹))) + (by + apply Coprod.hom_ext + · apply MonoidHom.ext + intro g + simp + · apply FreeGroup.ext_hom + intro x + simp) + (by + apply Coprod.hom_ext + · apply MonoidHom.ext + intro g + simp + · apply FreeGroup.ext_hom + intro x + simp) + +@[simp] theorem twist_inl (w : X → G) (g : G) : twist w (inl g) = inl g := by + simp [twist] +@[simp] theorem twist_inr_of (w : X → G) (x : X) : twist w (inr (FreeGroup.of x)) = + inl (w x) * inr (FreeGroup.of x) := by simp [twist] + +end Higman.DecoratedFreeBasis + +namespace Higman.MarkerEmbedding +open Monoid Coprod DecoratedMarker +variable {G : Type u} [Group G] {D : Type v} [Group D] + {T : Type w} [Group T] {P Q : Type*} + +def index (f : D →* T) (o : P → T) (q : P → Q) (x : D × P) : T × Q := + (f x.1 * o x.2,q x.2) + +def kernelMap (f : D →* T) (o : P → T) (q : P → Q) (w : P → G) : + Kernel G D P →* Kernel G T Q := + Coprod.lift inl (FreeGroup.lift (fun x : D × P ↦ + inl (w x.2) * inr (FreeGroup.of (index f o q x)))) + +@[simp] theorem kernelMap_inl (f : D →* T) (o : P → T) (q : P → Q) (w : P → G) (g : G) : + kernelMap f o q w (inl g) = inl g := by simp [kernelMap] +@[simp] theorem kernelMap_inr_of (f : D →* T) (o : P → T) (q : P → Q) (w : P → G) (x : D × P) : + kernelMap f o q w (inr (FreeGroup.of x)) = + inl (w x.2) * inr (FreeGroup.of (index f o q x)) := by simp [kernelMap] + +lemma kernelMap_shift (f : D →* T) (o : P → T) (q : P → Q) (w : P → G) (d : D) : + (kernelMap f o q w).comp (shifts d).toMonoidHom = + (shifts (f d)).toMonoidHom.comp (kernelMap f o q w) := by + apply Coprod.hom_ext + · apply MonoidHom.ext + intro g + simp [shifts] + · apply FreeGroup.ext_hom + rintro ⟨e,p⟩ + simp [shifts,index,mul_assoc] + +def embedding (f : D →* T) (o : P → T) (q : P → Q) (w : P → G) : + Base G D P →* Base G T Q := + inverse.comp ((SemidirectProduct.map (kernelMap f o q w) f + (kernelMap_shift f o q w)).comp test) + +@[simp] theorem embedding_coefficient (f : D →* T) (o : P → T) (q : P → Q) (w : P → G) + (g : G) : embedding f o q w (coefficient g) = coefficient g := by + simp [embedding] +@[simp] theorem embedding_translation (f : D →* T) (o : P → T) (q : P → Q) (w : P → G) + (d : D) : embedding f o q w (translation d) = translation (f d) := by + simp [embedding] +@[simp] theorem embedding_inr_of (f : D →* T) (o : P → T) (q : P → Q) (w : P → G) + (p : P) : embedding f o q w (inr (FreeGroup.of p)) = coefficient (w p) * marker (o p) (q p) := by + simp [embedding,index] +@[simp] theorem embedding_marker (f : D →* T) (o : P → T) (q : P → Q) (w : P → G) + (d : D) (p : P) : embedding f o q w (marker d p) = + coefficient (w p) * marker (f d * o p) (q p) := by + simp only [embedding,MonoidHom.comp_apply,test_marker,SemidirectProduct.map_inl, + kernelMap_inr_of,inverse_inl,map_mul,inclusion_inl,inclusion_inr_of,index] + +theorem kernelMap_injective [Nonempty P] (f : D →* T) (o : P → T) (q : P → Q) + (w : P → G) (hi : Function.Injective (index f o q)) : + Function.Injective (kernelMap f o q w) := by + classical + let r := Function.invFun (index f o q) + have hr : Function.LeftInverse r (index f o q) := Function.leftInverse_invFun hi + let k := Coprod.map (MonoidHom.id G) (FreeGroup.map (index f o q)) + have hk : Function.Injective k := by + let l := Coprod.map (MonoidHom.id G) (FreeGroup.map r) + have he : l.comp k = MonoidHom.id _ := by + apply Coprod.hom_ext + · apply MonoidHom.ext + intro g + simp [l,k] + · apply FreeGroup.ext_hom + intro x + simp [l,k,hr x] + apply Function.Injective.of_comp (f := l) + rw [← MonoidHom.coe_comp,he] + exact Function.injective_id + have he : kernelMap f o q w = k.comp (DecoratedFreeBasis.twist (w ∘ Prod.snd)).toMonoidHom := by + apply Coprod.hom_ext + · apply MonoidHom.ext + intro g + simp [k] + · apply FreeGroup.ext_hom + intro x + simp [k] + rw [he] + exact hk.comp (DecoratedFreeBasis.twist (w ∘ Prod.snd)).injective + +theorem embedding_injective [Nonempty P] (f : D →* T) (hf : Function.Injective f) + (o : P → T) (q : P → Q) (w : P → G) (hi : Function.Injective (index f o q)) : + Function.Injective (embedding f o q w) := by + have hk := kernelMap_injective f o q w hi + have hm : Function.Injective (SemidirectProduct.map (kernelMap f o q w) f + (kernelMap_shift f o q w)) := by + intro x y he + apply SemidirectProduct.ext + · exact hk (congrArg SemidirectProduct.left he) + · exact hf (congrArg SemidirectProduct.right he) + exact (decomposition (G := G) (T := T) (Q := Q)).symm.injective.comp + (hm.comp (decomposition (G := G) (T := D) (Q := P)).injective) + +theorem index_injective (f : D →* T) (hf : Function.Injective f) (o : P → T) + (q : P → Q) (hq : Function.Injective q) : Function.Injective (index f o q) := by + rintro ⟨d,p⟩ ⟨e,r⟩ he + obtain rfl : p = r := hq (congrArg Prod.snd he) + have hd : f d * o p = f e * o p := congrArg Prod.fst he + exact Prod.ext (hf (mul_right_cancel hd)) rfl + +end Higman.MarkerEmbedding + +end UniversalFinitelyPresentedProof + +end OAI diff --git a/lean/OAI/GroupTheory/UniversalGroup/MatrixDiagrams.lean b/lean/OAI/GroupTheory/UniversalGroup/MatrixDiagrams.lean new file mode 100644 index 0000000000000000000000000000000000000000..2167f4bb6763720a6301534504a1ff966e02f527 --- /dev/null +++ b/lean/OAI/GroupTheory/UniversalGroup/MatrixDiagrams.lean @@ -0,0 +1,426 @@ +import OAI.GroupTheory.UniversalGroup.FiniteEnvelopes + +namespace OAI + +open Set Metric Topology BigOperators +open Set Metric Topology +open Set Topology +open Set Metric Topology +open scoped NNReal +open Set Metric Topology +open scoped NNReal ENNReal +open Set Metric Topology +open scoped TensorProduct + +namespace UniversalFInfinity +namespace MatrixDiagram + +open Matrix + +variable {K T : Type*} [CommRing K] [AddCommGroup T] + +def OrthogonallyAdditive (z : Matrix (Fin 3) (Fin 3) K → T) : Prop := + ∀ E P, IsIdempotentElem E → IsIdempotentElem P → E * P = 0 → P * E = 0 → + z (E + P) = z E + z P + +lemma rank_one_idempotent (u l : Fin 3 → K) (h : l ⬝ᵥ u = 1) : + IsIdempotentElem (vecMulVec u l) := by + change vecMulVec u l * vecMulVec u l = vecMulVec u l + rw [vecMulVec_mul_vecMulVec, h, one_smul] + +lemma rank_one_mul_zero (u l v m : Fin 3 → K) (h : l ⬝ᵥ v = 0) : + vecMulVec u l * vecMulVec v m = 0 := by + rw [vecMulVec_mul_vecMulVec, h, zero_smul, vecMulVec_zero] + +lemma rank_one_difference (z : Matrix (Fin 3) (Fin 3) K → T) + (hz : OrthogonallyAdditive z) (u l v m : Fin 3 → K) + (hlu : l ⬝ᵥ u = 1) (hlv : l ⬝ᵥ v = 0) + (hmu : m ⬝ᵥ u = 0) (hmv : m ⬝ᵥ v = 1) : + z (vecMulVec (u + v) l) - z (vecMulVec u l) = + z (vecMulVec v m) - z (vecMulVec v (m - l)) := by + have hmlv : (m - l) ⬝ᵥ v = 1 := by simp [sub_dotProduct, hmv, hlv] + have hluv : l ⬝ᵥ (u + v) = 1 := by simp [dotProduct_add, hlu, hlv] + have hmluv : (m - l) ⬝ᵥ (u + v) = 0 := by + simp [sub_dotProduct, dotProduct_add, hmu, hmv, hlu, hlv] + have h₁ := hz (vecMulVec u l) (vecMulVec v m) + (rank_one_idempotent u l hlu) (rank_one_idempotent v m hmv) + (rank_one_mul_zero u l v m hlv) (rank_one_mul_zero v m u l hmu) + have h₂ := hz (vecMulVec (u + v) l) (vecMulVec v (m - l)) + (rank_one_idempotent (u + v) l hluv) (rank_one_idempotent v (m - l) hmlv) + (rank_one_mul_zero (u + v) l v (m - l) hlv) + (rank_one_mul_zero v (m - l) (u + v) l hmluv) + have heq : vecMulVec u l + vecMulVec v m = + vecMulVec (u + v) l + vecMulVec v (m - l) := by + ext i j + simp only [Matrix.add_apply, vecMulVec_apply, Pi.add_apply, Pi.sub_apply] + ring + rw [heq, h₂] at h₁ + apply sub_eq_sub_iff_add_eq_add.mpr + exact h₁.trans (add_comm _ _) + +def row (s : K) : Fin 3 → K := ![1, s, 0] +def along (s t : K) : Fin 3 → K := ![1 - s * t, t, 0] +def direction (s : K) : Fin 3 → K := ![-s, 1, 0] +def anchor : Fin 3 → K := ![1, 0, 1] +def witness (s t : K) : Fin 3 → K := ![-t, 1 - s * t, t] + +lemma frame_identities (s t : K) : + row s ⬝ᵥ along s t = 1 ∧ row s ⬝ᵥ direction s = 0 ∧ + witness s t ⬝ᵥ along s t = 0 ∧ witness s t ⬝ᵥ direction s = 1 ∧ + row s ⬝ᵥ (anchor : Fin 3 → K) = 1 ∧ + witness s t ⬝ᵥ (anchor : Fin 3 → K) = 0 := by + simp [row, along, witness, direction, anchor, dotProduct, Fin.sum_univ_three] + constructor <;> ring + +lemma along_step (s t : K) : along s t + direction s = along s (t + 1) := by + ext i + fin_cases i <;> simp [along, direction] + ring + +lemma increment_independent (z : Matrix (Fin 3) (Fin 3) K → T) + (hz : OrthogonallyAdditive z) (s t : K) : + z (vecMulVec (along s (t + 1)) (row s)) - z (vecMulVec (along s t) (row s)) = + z (vecMulVec (along s 1) (row s)) - z (vecMulVec (along s 0) (row s)) := by + have hd (r : K) : + z (vecMulVec (along s (r + 1)) (row s)) - z (vecMulVec (along s r) (row s)) = + z (vecMulVec ((anchor : Fin 3 → K) + direction s) (row s)) - + z (vecMulVec (anchor : Fin 3 → K) (row s)) := by + obtain ⟨h₁, h₂, h₃, h₄, h₅, h₆⟩ := frame_identities s r + rw [← along_step] + exact (rank_one_difference z hz _ _ _ _ h₁ h₂ h₃ h₄).trans + (rank_one_difference z hz _ _ _ _ h₅ h₂ h₆ h₄).symm + exact (hd t).trans (by simpa using (hd 0).symm) + +theorem prime_multiple_step (z : Matrix (Fin 3) (Fin 3) K → T) + (hz : OrthogonallyAdditive z) (p : ℕ) [CharP K p] (s : K) : + p • z (vecMulVec (along s 1) (row s)) = + p • z (vecMulVec (along s 0) (row s)) := by + let F (n : ℕ) := z (vecMulVec (along s (n : K)) (row s)) + let d := F 1 - F 0 + have hstep (n : ℕ) : F (n + 1) - F n = d := by + simpa only [F, d, Nat.cast_add, Nat.cast_one, Nat.cast_zero] using + increment_independent z hz s (n : K) + have hF (n : ℕ) : F n = F 0 + n • d := by + induction n with + | zero => simp + | succ n ih => + have h := hstep n + rw [ih, succ_nsmul] at * + exact (sub_eq_iff_eq_add.mp h).trans (by abel) + have hp : F p = F 0 := by simp only [F, CharP.cast_eq_zero, Nat.cast_zero] + have hpd : p • d = 0 := by + have h := (hF p).symm.trans hp + simpa only [add_eq_left] using h + have h := sub_eq_zero.mp (show p • F 1 - p • F 0 = 0 by + simpa only [d, nsmul_sub] using hpd) + simpa only [F, Nat.cast_one, Nat.cast_zero] using h + +lemma OrthogonallyAdditive.transpose {z : Matrix (Fin 3) (Fin 3) K → T} + (hz : OrthogonallyAdditive z) : OrthogonallyAdditive (fun E => z E.transpose) := by + intro E P hE hP hEP hPE + have hEt : IsIdempotentElem E.transpose := by + change E.transpose * E.transpose = E.transpose + rw [← transpose_mul, hE] + have hPt : IsIdempotentElem P.transpose := by + change P.transpose * P.transpose = P.transpose + rw [← transpose_mul, hP] + have hEPt : E.transpose * P.transpose = 0 := by rw [← transpose_mul, hPE, transpose_zero] + have hPEt : P.transpose * E.transpose = 0 := by rw [← transpose_mul, hEP, transpose_zero] + simpa only [transpose_add] using hz _ _ hEt hPt hEPt hPEt + +lemma OrthogonallyAdditive.comp {z : Matrix (Fin 3) (Fin 3) K → T} + (hz : OrthogonallyAdditive z) (f : Matrix (Fin 3) (Fin 3) K →+* Matrix (Fin 3) (Fin 3) K) : + OrthogonallyAdditive (fun E => z (f E)) := by + intro E P hE hP hEP hPE + have hEt : IsIdempotentElem (f E) := by + change f E * f E = f E + rw [← map_mul, hE] + have hPt : IsIdempotentElem (f P) := by + change f P * f P = f P + rw [← map_mul, hP] + have hEPt : f E * f P = 0 := by rw [← map_mul, hEP, map_zero] + have hPEt : f P * f E = 0 := by rw [← map_mul, hPE, map_zero] + simpa only [map_add] using hz _ _ hEt hPt hEPt hPEt + +def basisVector (i : Fin 3) : Fin 3 → K := Pi.single i 1 + +def diagonalUnit (i : Fin 3) : Matrix (Fin 3) (Fin 3) K := + vecMulVec (basisVector i) (basisVector i) + +theorem diagonal_zero_one (z : Matrix (Fin 3) (Fin 3) K → T) + (hz : OrthogonallyAdditive z) (p : ℕ) [CharP K p] : + p • z (diagonalUnit 0) = p • z (diagonalUnit 1) := by + have hleft := prime_multiple_step (fun E => z E.transpose) hz.transpose p 0 + have hmid := prime_multiple_step z hz p 1 + let q := (Matrix.reindexRingEquiv K (Equiv.swap (0 : Fin 3) 1)).toRingHom + have hright := prime_multiple_step (fun E => z (q E).transpose) + (hz.transpose.comp q) p 0 + have e0 : along (0 : K) 0 = basisVector 0 := by + ext i; fin_cases i <;> simp [along, basisVector] + have r0 : row (0 : K) = basisVector 0 := by + ext i; fin_cases i <;> simp [row, basisVector] + have e1 : along (1 : K) 1 = basisVector 1 := by + ext i; fin_cases i <;> simp [along, basisVector] + have m0 : along (1 : K) 0 = basisVector 0 := by + ext i; fin_cases i <;> simp [along, basisVector] + have r1 : along (0 : K) 1 = row (1 : K) := by + ext i; fin_cases i <;> simp [along, row] + have q0 : q (vecMulVec (along 0 0) (row 0)) = diagonalUnit 1 := by + ext i j; fin_cases i <;> fin_cases j <;> + simp [q, Matrix.reindex, Matrix.submatrix, along, row, + diagonalUnit, basisVector, Pi.single_apply, vecMulVec, Equiv.swap_apply_def] + have q1 : (q (vecMulVec (along 0 1) (row 0))).transpose = + vecMulVec (basisVector 1) (row 1) := by + ext i j; fin_cases i <;> fin_cases j <;> + simp [q, Matrix.reindex, Matrix.submatrix, along, row, + basisVector, Pi.single_apply, vecMulVec, Equiv.swap_apply_def] + rw [transpose_vecMulVec, transpose_vecMulVec, e0, r0, r1] at hleft + rw [e1, m0] at hmid + rw [q0, q1, diagonalUnit, transpose_vecMulVec] at hright + exact hleft.symm.trans (hmid.symm.trans hright) + +lemma reindex_diagonalUnit (e : Fin 3 ≃ Fin 3) (i : Fin 3) : + reindexRingEquiv K e (diagonalUnit i) = diagonalUnit (e i) := by + have hb (x : Fin 3) : basisVector i (e.symm x) = (basisVector (e i) x : K) := by + by_cases hx : x = e i + · subst x; simp [basisVector] + · have hx' : e.symm x ≠ i := fun h => hx (by simpa using congrArg e h) + simp [basisVector, hx, hx'] + ext x y + change basisVector i (e.symm x) * basisVector i (e.symm y) = + (basisVector (e i) x : K) * basisVector (e i) y + rw [hb, hb] + +theorem diagonal_equality (z : Matrix (Fin 3) (Fin 3) K → T) + (hz : OrthogonallyAdditive z) (p : ℕ) [CharP K p] (i j : Fin 3) : + p • z (diagonalUnit i) = p • z (diagonalUnit j) := by + have h01 := diagonal_zero_one z hz p + let e := Equiv.swap (1 : Fin 3) 2 + let q := (reindexRingEquiv K e).toRingHom + have h02 := diagonal_zero_one (fun E => z (q E)) (hz.comp q) p + have hq (i : Fin 3) : q (diagonalUnit i) = diagonalUnit (e i) := + reindex_diagonalUnit e i + simp only [hq] at h02 + have he0 : e 0 = 0 := by decide + have he1 : e 1 = 2 := by decide + rw [he0, he1] at h02 + have h0 (i : Fin 3) : p • z (diagonalUnit 0) = p • z (diagonalUnit i) := by + fin_cases i + · rfl + · exact h01 + · exact h02 + exact (h0 i).symm.trans (h0 j) + +lemma diagonalUnit_idempotent (i : Fin 3) : + IsIdempotentElem (diagonalUnit i : Matrix (Fin 3) (Fin 3) K) := by + apply rank_one_idempotent + simp [basisVector, dotProduct, Pi.single_apply] + +lemma diagonalUnit_orthogonal {i j : Fin 3} (hij : i ≠ j) : + (diagonalUnit i : Matrix (Fin 3) (Fin 3) K) * diagonalUnit j = 0 := by + apply rank_one_mul_zero + simp [basisVector, dotProduct, Pi.single_apply, Ne.symm hij] + +lemma diagonalUnit_sum : + (diagonalUnit 0 : Matrix (Fin 3) (Fin 3) K) + diagonalUnit 1 + diagonalUnit 2 = 1 := by + ext i j + fin_cases i <;> fin_cases j <;> simp [diagonalUnit, basisVector, vecMulVec] + +end MatrixDiagram + +namespace PrefixAlgebra + +variable (K : Type*) [CommRing K] + +abbrev Sequences := Stream' Bool +abbrev Space := Sequences →₀ K +abbrev Operators := Module.End K (Space K) + +noncomputable def prefixOp (i : Bool) : Operators K := + Finsupp.linearCombination K (fun s => Finsupp.single (Stream'.cons i s) 1) + +noncomputable def delete (i : Bool) : Operators K := + Finsupp.linearCombination K (fun s => if s.head = i then Finsupp.single s.tail 1 else 0) + +@[simp] lemma prefix_single (i : Bool) (s : Sequences) (a : K) : + prefixOp K i (Finsupp.single s a) = Finsupp.single (Stream'.cons i s) a := by + simp [prefixOp] + +@[simp] lemma delete_single (i : Bool) (s : Sequences) (a : K) : + delete K i (Finsupp.single s a) = if s.head = i then Finsupp.single s.tail a else 0 := by + by_cases h : s.head = i <;> simp [delete, h] + +lemma delete_prefix (i j : Bool) : + delete K i * prefixOp K j = if i = j then 1 else 0 := by + apply Finsupp.lhom_ext + intro s a + simp only [Module.End.mul_apply, prefix_single, delete_single, + Stream'.head_cons, Stream'.tail_cons] + by_cases h : i = j + · subst j; simp + · simp [h, Ne.symm h] + +lemma prefix_partition : prefixOp K false * delete K false + prefixOp K true * delete K true = 1 := by + apply Finsupp.lhom_ext + intro s a + simp only [LinearMap.add_apply, Module.End.mul_apply, delete_single] + cases h : s.head <;> simp + all_goals rw [← h, Stream'.cons_head_tail] + +noncomputable def algebra : Subalgebra K (Operators K) := + Algebra.adjoin K {prefixOp K false, prefixOp K true, delete K false, delete K true} + +noncomputable def left (i : Bool) : algebra K := + ⟨prefixOp K i, by apply Algebra.subset_adjoin; cases i <;> simp⟩ +noncomputable def right (i : Bool) : algebra K := + ⟨delete K i, by apply Algebra.subset_adjoin; cases i <;> simp⟩ + +lemma right_left (i j : Bool) : right K i * left K j = if i = j then 1 else 0 := by + apply Subtype.ext + simpa only [Subalgebra.coe_mul, left, right, Subalgebra.coe_one, Subalgebra.coe_zero, + apply_ite] using delete_prefix K i j + +lemma partition : left K false * right K false + left K true * right K true = 1 := by + apply Subtype.ext + exact prefix_partition K + +noncomputable def leftWord : List Bool → algebra K + | [] => 1 + | b :: w => left K b * leftWord w + +noncomputable def rightWord : List Bool → algebra K + | [] => 1 + | b :: w => rightWord w * right K b + +@[simp] lemma leftWord_nil : leftWord K [] = 1 := rfl +@[simp] lemma rightWord_nil : rightWord K [] = 1 := rfl + +lemma cancel_initial (b c : Bool) (v w : List Bool) : + rightWord K (b :: v) * leftWord K (c :: w) = + if b = c then rightWord K v * leftWord K w else 0 := by + simp only [rightWord, leftWord] + rw [mul_assoc, ← mul_assoc (right K b), right_left] + by_cases h : b = c <;> simp [h] + +@[simp] lemma word_cancel (w : List Bool) : rightWord K w * leftWord K w = 1 := by + induction w with + | nil => simp + | cons b w ih => rw [cancel_initial, ite_eq_left rfl, ih] + +def words : Fin 3 → Fin 3 → List Bool := + ![![[false,false], [false,true], [true]], + ![[false,false,false], [false,true], [true]], + ![[false,false,true], [false,true], [true]]] + +lemma word_orthogonality (a i j : Fin 3) : + rightWord K (words a i) * leftWord K (words a j) = if i = j then 1 else 0 := by + fin_cases a <;> fin_cases i <;> fin_cases j <;> + simp [words, cancel_initial] + +noncomputable def projection (w : List Bool) : algebra K := leftWord K w * rightWord K w + +lemma projection_idempotent (w : List Bool) : IsIdempotentElem (projection K w) := by + change (leftWord K w * rightWord K w) * (leftWord K w * rightWord K w) = _ + rw [mul_assoc, ← mul_assoc (rightWord K w), word_cancel, one_mul] + rfl + +lemma projection_split (w : List Bool) : + projection K w = projection K (w ++ [false]) + projection K (w ++ [true]) := by + have hl (w v : List Bool) : leftWord K (w ++ v) = leftWord K w * leftWord K v := by + induction w with + | nil => simp [leftWord] + | cons b w ih => simp only [List.cons_append, leftWord, ih, mul_assoc] + have hr (w v : List Bool) : rightWord K (w ++ v) = rightWord K v * rightWord K w := by + induction w with + | nil => simp [rightWord] + | cons b w ih => simp only [List.cons_append, rightWord, ih, mul_assoc] + simp only [projection, hl, hr, leftWord, rightWord, mul_one, one_mul] + calc + _ = leftWord K w * (left K false * right K false + left K true * right K true) * rightWord K w := by + rw [partition, mul_one] + _ = _ := by noncomm_ring + +end PrefixAlgebra + +namespace MatrixCorners + +variable {K D : Type*} [CommRing K] [Ring D] [Algebra K D] +variable {ι : Type*} [Fintype ι] [DecidableEq ι] +variable (L R : ι → D) (h : ∀ i j, R i * L j = if i = j then 1 else 0) + +abbrev unit (i j : ι) : D := L i * R j + +include h + +omit [Fintype ι] in +lemma unit_mul (i j k m : ι) : + unit L R i j * unit L R k m = if j = k then unit L R i m else 0 := by + dsimp only [unit] + rw [mul_assoc, ← mul_assoc (R j), h] + split_ifs <;> simp + +omit [Fintype ι] in +lemma weighted_unit_mul (a b : K) (i j k m : ι) : + (a • unit L R i j) * (b • unit L R k m) = + if j = k then (a * b) • unit L R i m else 0 := by + rw [smul_mul_smul, unit_mul L R h] + split_ifs <;> simp + +noncomputable def matrixMap (A : Matrix ι ι K) : D := + ∑ i, ∑ j, (A i j) • unit L R i j + +lemma matrixMap_mul (A B : Matrix ι ι K) : + matrixMap L R (A * B) = matrixMap L R A * matrixMap L R B := by + classical + have hr : matrixMap L R A * matrixMap L R B = + ∑ i, ∑ j, ∑ m, (A i j * B j m) • unit L R i m := by + simp only [matrixMap, Finset.sum_mul, Finset.mul_sum, weighted_unit_mul L R h] + simp only [Finset.sum_ite_eq', Finset.mem_univ, ite_true] + calc + _ = ∑ j, ∑ i, ∑ m, (A i j * B j m) • unit L R i m := by + apply Finset.sum_congr rfl + intro j _ + exact Finset.sum_comm + _ = _ := Finset.sum_comm + rw [hr] + simp only [matrixMap, Matrix.mul_apply, Finset.sum_smul] + apply Finset.sum_congr rfl + intro i _ + exact Finset.sum_comm + +noncomputable def hom : Matrix ι ι K →ₙₐ[K] D where + toFun := matrixMap L R + map_zero' := by simp [matrixMap] + map_add' A B := by simp [matrixMap, add_smul, Finset.sum_add_distrib] + map_mul' := matrixMap_mul L R h + map_smul' a A := by simp [matrixMap, Finset.smul_sum, smul_smul] + +lemma map_diagonal (i : ι) : + hom L R h (Matrix.diagonal (Pi.single i (1 : K))) = L i * R i := by + change matrixMap L R _ = _ + simp [matrixMap, Matrix.diagonal, Pi.single_apply, unit] + +lemma map_one : hom L R h (1 : Matrix ι ι K) = ∑ i, L i * R i := by + change matrixMap L R _ = _ + simp [matrixMap, Matrix.one_apply, unit] + +lemma extract (A : Matrix ι ι K) (i j : ι) : + R i * hom L R h A * L j = algebraMap K D (A i j) := by + change R i * matrixMap L R A * L j = _ + have hextract (a : K) (k l : ι) : + R i * (a • unit L R k l) * L j = + if i = k then if l = j then algebraMap K D a else 0 else 0 := by + rw [mul_smul_comm, smul_mul_assoc] + dsimp only [unit] + rw [← mul_assoc (R i), h] + by_cases hik : i = k + · rw [ite_eq_left hik, one_mul, h] + by_cases hlj : l = j <;> simp [hlj, hik, Algebra.smul_def] + · simp [hik] + simp only [matrixMap, Finset.mul_sum, Finset.sum_mul, hextract] + simp + +end MatrixCorners +end UniversalFInfinity + +end OAI diff --git a/lean/OAI/GroupTheory/UniversalGroup/Milnor.lean b/lean/OAI/GroupTheory/UniversalGroup/Milnor.lean new file mode 100644 index 0000000000000000000000000000000000000000..2ae24e225683f51d43c85b1a2da6cd729d523458 --- /dev/null +++ b/lean/OAI/GroupTheory/UniversalGroup/Milnor.lean @@ -0,0 +1,295 @@ +import OAI.GroupTheory.UniversalGroup.Simplicial + +namespace OAI + +noncomputable section + +open Set Metric Topology BigOperators + +namespace UniversalFInfinity.Milnor +open Set Metric Topology BigOperators UniversalFInfinity.Simplicial +open scoped Classical unitInterval +universe u v +local instance (priority := 2000) (α : Type*) : DecidableEq α := Classical.decEq α +variable (G : Type u) + +def complex : PreAbstractSimplicialComplex (ℕ × G) where + faces := {s | s.Nonempty ∧ Set.InjOn Prod.fst (s : Set (ℕ × G))} + isRelLowerSet_faces := by + intro s hs + exact ⟨hs.1,fun t hts ht => ⟨ht,hs.2.mono hts⟩⟩ + +abbrev Space := Simplicial.Space (complex G) + +lemma mem_complex (s : Finset (ℕ × G)) : s ∈ complex G ↔ + s.Nonempty ∧ Set.InjOn Prod.fst (s : Set (ℕ × G)) := Iff.rfl + +def bounded (N : ℕ) : PreAbstractSimplicialComplex (ℕ × G) where + faces := {s | s ∈ complex G ∧ ∀ v ∈ s, v.1 < N} + isRelLowerSet_faces := by + intro s hs + exact ⟨hs.1.1,fun t hts ht => ⟨(complex G).isRelLowerSet_faces.mem_of_le hs.1 hts ht, + fun v hv => hs.2 v (hts hv)⟩⟩ + +lemma bounded_le (N : ℕ) : bounded G N ≤ complex G := fun _ hs => hs.1 +lemma bounded_mono {N M : ℕ} (h : N ≤ M) : bounded G N ≤ bounded G M := + fun _ hs => ⟨hs.1,fun v hv => lt_of_lt_of_le (hs.2 v hv) h⟩ + +variable {G} {H : Type v} +lemma map_face (φ : G → H) (ρ : ℕ → ℕ) (hρ : Function.Injective ρ) + (s : Face (complex G)) : s.1.image (fun v => (ρ v.1,φ v.2)) ∈ complex H := by + refine ⟨s.2.1.image _,?_⟩ + rintro a ha b hb hab + obtain ⟨x,hx,rfl⟩ := Finset.mem_image.mp ha + obtain ⟨y,hy,rfl⟩ := Finset.mem_image.mp hb + exact congrArg (fun v : ℕ × G => (ρ v.1,φ v.2)) (s.2.2 hx hy (hρ hab)) + +def map (φ : G → H) (ρ : ℕ → ℕ) (hρ : Function.Injective ρ) : C(Space G,Space H) := + Simplicial.mapC (complex G) (complex H) (fun v => (ρ v.1,φ v.2)) (map_face φ ρ hρ) + +lemma map_comp {J : Type*} (φ : G → H) (ψ : H → J) + (ρ τ : ℕ → ℕ) (hρ : Function.Injective ρ) (hτ : Function.Injective τ) (x : Space G) : + map ψ τ hτ (map φ ρ hρ x) = map (ψ ∘ φ) (τ ∘ ρ) (hτ.comp hρ) x := +by + apply Subtype.ext + exact Finsupp.mapDomain_comp.symm + +lemma map_id (x : Space G) : map id id Function.injective_id x = x := by + apply Subtype.ext + exact Finsupp.mapDomain_id + +def vertex (v : ℕ × G) : Space G := + ⟨Finsupp.single v 1,by intro w; simp only [Finsupp.single_apply]; split_ifs <;> norm_num, + by simp,by + simp only [Finsupp.support_single _ one_ne_zero] + exact ⟨Finset.singleton_nonempty v,by simpa only [Finset.coe_singleton] using Set.injOn_singleton Prod.fst v⟩⟩ + +lemma bounded_union_apex (N : ℕ) (g : G) (s : Face (bounded G N)) : + s.1 ∪ {(N,g)} ∈ complex G := by + refine ⟨s.2.1.1.mono Finset.subset_union_left,?_⟩ + intro x hx y hy hxy + rcases Finset.mem_union.mp hx with hx | hx <;> rcases Finset.mem_union.mp hy with hy | hy + · exact s.2.1.2 hx hy hxy + · have hyy := Finset.mem_singleton.mp hy + subst y + exact False.elim ((Nat.ne_of_lt (s.2.2 x hx)) hxy) + · have hxx := Finset.mem_singleton.mp hx + subst x + exact False.elim ((Nat.ne_of_lt (s.2.2 y hy)) hxy.symm) + · exact (Finset.mem_singleton.mp hx).trans (Finset.mem_singleton.mp hy).symm + +lemma bounded_id_face (N : ℕ) (s : Face (bounded G N)) : s.1.image id ∈ complex G := by + simpa only [Finset.image_id] using s.2.1 +lemma bounded_const_face (N : ℕ) (g : G) (s : Face (bounded G N)) : + s.1.image (fun _ => (N,g)) ∈ complex G := by + rw [Finset.image_const s.2.1.1] + exact ⟨Finset.singleton_nonempty _,by simpa only [Finset.coe_singleton] using Set.injOn_singleton Prod.fst (N,g)⟩ +lemma bounded_contiguous (N : ℕ) (g : G) (s : Face (bounded G N)) : + s.1.image id ∪ s.1.image (fun _ => (N,g)) ∈ complex G := by + rw [Finset.image_id,Finset.image_const s.2.1.1] + exact bounded_union_apex N g s + +lemma bounded_map_id (N : ℕ) (x : Simplicial.Space (bounded G N)) : + Simplicial.map (bounded G N) (complex G) id (bounded_id_face N) x = + Simplicial.inclusion (bounded G N) (complex G) (fun _ h => bounded_le G N h) x := by + apply Subtype.ext + exact Finsupp.mapDomain_id + +lemma map_const_vertex (K : PreAbstractSimplicialComplex (ℕ × G)) (v : ℕ × G) + (hf : ∀ s : Face K, s.1.image (fun _ => v) ∈ complex G) (x : Simplicial.Space K) : + Simplicial.map K (complex G) (fun _ => v) hf x = vertex v := by + apply Subtype.ext + change x.1.mapDomain (fun _ => v) = Finsupp.single v 1 + rw [Finsupp.mapDomain,← Finsupp.single_sum] + exact congrArg (Finsupp.single v) x.2.2.1 + +end UniversalFInfinity.Milnor + +namespace UniversalFInfinity.Simplicial +open Set Metric Topology BigOperators +universe u +variable {V : Type u} (K : PreAbstractSimplicialComplex V) + +abbrev Cell (n : ℕ) := {s : Face K // s.1.card = n+1} + +def cellOfFace (s : Face K) : Cell K (s.1.card-1) := + ⟨s,by have := Finset.card_pos.mpr (face_nonempty K s); omega⟩ + +def cellEquiv {n : ℕ} (s : Cell K n) : s.1.1 ≃ Fin (n+1) := + Fintype.equivFinOfCardEq (by simpa only [Fintype.card_coe] using s.2) + +def faceDisk {n : ℕ} (s : Cell K n) : SimplexDisk.Simplex s.1.1 ≃ₜ closedBall (0 : Fin n → ℝ) 1 := + (SimplexDisk.reindex (cellEquiv K s)).trans (SimplexDisk.simplexDisk n) + +lemma faceDisk_open {n : ℕ} (s : Cell K n) (x : SimplexDisk.Simplex s.1.1) : + (faceDisk K s x).1 ∈ ball 0 1 ↔ (faceMap K s.1 x).1.support = s.1.1 := by + rw [support_eq_iff] + exact (SimplexDisk.simplexDisk_open n _).trans (SimplexDisk.reindex_positive _ _) + +def diskMap {n : ℕ} (s : Cell K n) : C(closedBall (0 : Fin n → ℝ) 1, Space K) := + ⟨(faceMap K s.1) ∘ (faceDisk K s).symm,(continuous_faceMap K s.1).comp (faceDisk K s).symm.continuous⟩ + +lemma diskMap_injective {n : ℕ} (s : Cell K n) : Function.Injective (diskMap K s) := + (faceMap_injective K s.1).comp (faceDisk K s).symm.injective + +lemma diskMap_range {n : ℕ} (s : Cell K n) : Set.range (diskMap K s) = Set.range (faceMap K s.1) := + (faceDisk K s).symm.surjective.range_comp (faceMap K s.1) + +def characteristic {n : ℕ} (s : Cell K n) (x : Fin n → ℝ) : Space K := by + classical + exact if hx : x ∈ closedBall 0 1 then diskMap K s ⟨x,hx⟩ else diskMap K s ⟨0,by simp⟩ + +lemma characteristic_disk {n : ℕ} (s : Cell K n) (x : closedBall (0 : Fin n → ℝ) 1) : + characteristic K s x.1 = diskMap K s x := by simp only [characteristic,dite_eq_left x.2] + +lemma characteristic_bijOn {n : ℕ} (s : Cell K n) : + Set.BijOn (characteristic K s) (ball 0 1) {x | x.1.support = s.1.1} := by + constructor + · intro x hx + let d : closedBall (0 : Fin n → ℝ) 1 := ⟨x,ball_subset_closedBall hx⟩ + rw [show characteristic K s x = diskMap K s d from characteristic_disk K s d] + exact (faceDisk_open K s ((faceDisk K s).symm d)).mp (by simpa using hx) + constructor + · intro x hx y hy hxy + have hxy' : diskMap K s ⟨x,ball_subset_closedBall hx⟩ = diskMap K s ⟨y,ball_subset_closedBall hy⟩ := by + simpa only [← characteristic_disk] using hxy + exact congrArg Subtype.val (diskMap_injective K s hxy') + · intro x hx + let z := coordinates K s.1.1 x (by rw [hx]) + let d := faceDisk K s z + have hd : d.1 ∈ ball 0 1 := (faceDisk_open K s z).mpr (by rwa [faceMap_coordinates]) + exact ⟨d.1,hd,(characteristic_disk K s d).trans (by + change faceMap K s.1 ((faceDisk K s).symm (faceDisk K s z)) = x + rw [Homeomorph.symm_apply_apply] + exact faceMap_coordinates K s.1 x _)⟩ + +def characteristicPE {n : ℕ} (s : Cell K n) : PartialEquiv (Fin n → ℝ) (Space K) := + (characteristic_bijOn K s).toPartialEquiv _ _ _ + +lemma characteristicPE_open {n : ℕ} (s : Cell K n) : + characteristicPE K s '' ball 0 1 = {x | x.1.support = s.1.1} := + (characteristic_bijOn K s).image_eq + +lemma characteristicPE_closed {n : ℕ} (s : Cell K n) : + characteristicPE K s '' closedBall 0 1 = Set.range (faceMap K s.1) := by + rw [← diskMap_range] + ext x + constructor + · rintro ⟨z,hz,rfl⟩ + exact ⟨⟨z,hz⟩,(characteristic_disk K s ⟨z,hz⟩).symm⟩ + · rintro ⟨z,rfl⟩ + exact ⟨z.1,z.2,characteristic_disk K s z⟩ + +lemma characteristicPE_continuous {n : ℕ} (s : Cell K n) : + ContinuousOn (characteristicPE K s) (closedBall 0 1) := by + rw [continuousOn_iff_continuous_domRestrict] + have he : (closedBall (0:Fin n→ℝ) 1).domRestrict (characteristicPE K s) = diskMap K s := by + funext x + exact characteristic_disk K s x + rw [he] + exact (diskMap K s).continuous + +lemma characteristicPE_continuous_symm {n : ℕ} (s : Cell K n) : + ContinuousOn (characteristicPE K s).symm (characteristicPE K s).target := by + let e := characteristicPE K s + have he : IsEmbedding (e.source.domRestrict e) := by + let inc : ball (0:Fin n→ℝ) 1 → closedBall (0:Fin n→ℝ) 1 := fun x => ⟨x.1,ball_subset_closedBall x.2⟩ + have hi : IsEmbedding inc := IsEmbedding.subtypeVal.codRestrict _ (fun x => ball_subset_closedBall x.2) + have heq : e.source.domRestrict e = (diskMap K s) ∘ inc := by + funext x + exact characteristic_disk K s (inc x) + rw [heq] + exact ((diskMap K s).continuous.isClosedEmbedding (diskMap_injective K s)).isEmbedding.comp hi + let H : e.source ≃ₜ e.target := e.toEquiv.toHomeomorphOfIsInducing + (he.isInducing.codRestrict (fun x => e.map_source x.2)) + rw [continuousOn_iff_continuous_domRestrict] + exact continuous_subtype_val.comp H.symm.continuous + +lemma support_lt_of_sphere {n : ℕ} (s : Cell K n) (x : Fin n → ℝ) (hx : x ∈ sphere 0 1) : + (characteristicPE K s x).1.support.card < s.1.1.card := by + have hd := characteristic_disk K s ⟨x,sphere_subset_closedBall hx⟩ + have hs : (characteristicPE K s x).1.support ⊆ s.1.1 := by + rw [show characteristicPE K s x = diskMap K s ⟨x,sphere_subset_closedBall hx⟩ from hd] + exact weight_support_subset _ _ + apply Finset.card_lt_card + refine Finset.ssubset_iff_subset_ne.mpr ⟨hs,?_⟩ + intro he + have ho : x ∈ ball (0:Fin n→ℝ) 1 := by + have hh := (faceDisk_open K s ((faceDisk K s).symm ⟨x,sphere_subset_closedBall hx⟩)).mpr (by + change (characteristic K s x).1.support = s.1.1 at he + rwa [hd] at he) + simpa only [Homeomorph.apply_symm_apply] using hh + exact sphere_disjoint_ball.notMem_of_mem_left hx ho + +lemma subcells_finite (s : Face K) (n : ℕ) : Set.Finite {c : Cell K n | c.1.1 ⊆ s.1} := by + classical + have hinj : Function.Injective (fun c : Cell K n => c.1.1) := Subtype.val_injective.comp Subtype.val_injective + have hfin := (s.1.powerset.finite_toSet).preimage hinj.injOn + convert hfin using 1 + ext c + simp only [mem_ofPred_eq,mem_preimage,Finset.mem_coe,Finset.mem_powerset] + +noncomputable def subcells (s : Face K) (n : ℕ) : Finset (Cell K n) := (subcells_finite K s n).toFinset + +lemma characteristic_boundary {n : ℕ} (s : Cell K n) : + MapsTo (characteristicPE K s) (sphere 0 1) + (⋃ (m < n) (j ∈ subcells K s.1 m), characteristicPE K j '' closedBall 0 1) := by + intro x hx + let y := characteristicPE K s x + let t : Face K := ⟨y.1.support,y.2.2.2⟩ + let m := y.1.support.card-1 + let c : Cell K m := cellOfFace K t + have hpos : 0 < y.1.support.card := Finset.card_pos.mpr (support_nonempty y.2.2.1) + have hlt : y.1.support.card < s.1.1.card := support_lt_of_sphere K s x hx + have hmn : m < n := by dsimp [m]; rw [s.2] at hlt; omega + have hcs : c ∈ subcells K s.1 m := by + rw [subcells,Set.Finite.mem_toFinset] + change y.1.support ⊆ s.1.1 + rw [show y = diskMap K s ⟨x,sphere_subset_closedBall hx⟩ from characteristic_disk K s ⟨x,sphere_subset_closedBall hx⟩] + exact weight_support_subset _ _ + refine mem_iUnion.mpr ⟨m,mem_iUnion.mpr ⟨hmn,mem_iUnion.mpr ⟨c,mem_iUnion.mpr ⟨hcs,?_⟩⟩⟩⟩ + rw [characteristicPE_closed,range_faceMap] + exact Finset.Subset.refl _ + +instance cwComplex : Topology.CWComplex (Set.univ : Set (Space K)) where + cell := Cell K + map _ := characteristicPE K + source_eq _ _ := rfl + continuousOn _ := characteristicPE_continuous K + continuousOn_symm _ := characteristicPE_continuous_symm K + pairwiseDisjoint' := by + intro a _ b _ hab + change Disjoint (characteristicPE K a.2 '' ball 0 1) (characteristicPE K b.2 '' ball 0 1) + rw [characteristicPE_open,characteristicPE_open] + apply Set.disjoint_left.mpr + intro x hx hy + have he : a.2.1.1 = b.2.1.1 := hx.symm.trans hy + have hn : a.1 = b.1 := by have hc := congrArg Finset.card he; rw [a.2.2,b.2.2] at hc; omega + apply hab + rcases a with ⟨n,a⟩ + rcases b with ⟨m,b⟩ + dsimp at hn + subst m + exact congrArg (Sigma.mk n) (Subtype.ext (Subtype.ext he)) + mapsTo' _ s := ⟨subcells K s.1,characteristic_boundary K s⟩ + closed' A _ hA := by + rw [isClosed_iff] + intro s + have hc := hA _ (cellOfFace K s) + rw [characteristicPE_closed] at hc + have hp := hc.preimage (continuous_faceMap K s) + have he : (faceMap K s) ⁻¹' (A ∩ Set.range (faceMap K (cellOfFace K s).1)) = (faceMap K s) ⁻¹' A := by + ext z; simp only [mem_preimage,mem_inter_iff]; exact and_iff_left (mem_range_self z) + rwa [he] at hp + union' := by + apply Set.Subset.antisymm (subset_univ _) + intro x _ + let s : Face K := ⟨x.1.support,x.2.2.2⟩ + refine mem_iUnion.mpr ⟨s.1.card-1,mem_iUnion.mpr ⟨cellOfFace K s,?_⟩⟩ + rw [characteristicPE_closed,range_faceMap] + exact Finset.Subset.refl _ +end UniversalFInfinity.Simplicial + +end + +end OAI diff --git a/lean/OAI/GroupTheory/UniversalGroup/MilnorControl.lean b/lean/OAI/GroupTheory/UniversalGroup/MilnorControl.lean new file mode 100644 index 0000000000000000000000000000000000000000..d5e264c1a88044cdb76ddf4d6831f8f5d70fac86 --- /dev/null +++ b/lean/OAI/GroupTheory/UniversalGroup/MilnorControl.lean @@ -0,0 +1,344 @@ +import OAI.GroupTheory.UniversalGroup.CellularLifting + +namespace OAI + +noncomputable section + +open Set Metric Topology BigOperators +open Set Metric Topology + +namespace UniversalFInfinity.Milnor + +section +open Set Metric Topology BigOperators UniversalFInfinity.Simplicial +open scoped Classical unitInterval +universe u v +variable {G : Type u} +local instance (priority := 2000) (α : Type*) : DecidableEq (ℕ × α) := Classical.decEq (ℕ × α) + +def boundedInclusion (N : ℕ) : C(Simplicial.Space (bounded G N),Space G) := + ⟨Simplicial.inclusion (bounded G N) (complex G) (fun _ h => bounded_le G N h), + Simplicial.continuous_inclusion _ _ _⟩ + +def boundedContraction (N : ℕ) (g : G) : + (boundedInclusion (G := G) N).Homotopy (ContinuousMap.const _ (vertex (N,g))) := by + let H := Simplicial.straightHomotopy (bounded G N) (complex G) id (fun _ => (N,g)) + (bounded_id_face N) (bounded_const_face N g) (bounded_contiguous N g) + exact H.cast (ContinuousMap.ext (fun x => bounded_map_id N x)) + (ContinuousMap.ext (fun x => map_const_vertex (bounded G N) (N,g) (bounded_const_face N g) x)) + +lemma compactMap_bounded {A : Type v} [TopologicalSpace A] [CompactSpace A] (f : C(A,Space G)) : + ∃ N : ℕ, ∃ F : C(A,Simplicial.Space (bounded G N)), (boundedInclusion N).comp F = f := by + obtain ⟨S,hS⟩ := Simplicial.compact_bounded_vertices (complex G) (isCompact_range f.continuous) + let N := S.sup Prod.fst + 1 + have hN (a : A) (v : ℕ × G) (hv : v ∈ (f a).1.support) : v.1 < N := by + exact Nat.lt_succ_of_le (Finset.le_sup (f := Prod.fst) (hS (f a) (mem_range_self a) hv)) + let F : A → Simplicial.Space (bounded G N) := fun a => + ⟨(f a).1,(f a).2.1,(f a).2.2.1,(f a).2.2.2,hN a⟩ + have hc : Continuous F := + (Simplicial.inclusion_closedEmbedding (bounded G N) (complex G) + (fun _ h => bounded_le G N h)).isEmbedding.continuous_iff.mpr f.continuous + exact ⟨N,⟨F,hc⟩,rfl⟩ + +lemma compactMap_nullhomotopic {A : Type v} [TopologicalSpace A] [CompactSpace A] + (g : G) (f : C(A,Space G)) : ∃ y, Nonempty (f.Homotopy (ContinuousMap.const _ y)) := by + obtain ⟨N,F,hF⟩ := compactMap_bounded f + exact ⟨vertex (N,g),⟨((boundedContraction N g).compContinuousMap F).cast hF rfl⟩⟩ + +lemma sphereFillable (g : G) : Cellular.SphereFillable (Space G) := by + intro n f + cases n with + | zero => + refine ⟨ContinuousMap.const _ (vertex (0,g)),?_⟩ + intro x + have hx : False := by + have he := x.2 + simp only [Metric.mem_sphere,Subsingleton.elim x.1 0,dist_self] at he + exact zero_ne_one he + exact hx.elim + | succ n => + let := SphereTopology.sphere_nonempty n + obtain ⟨y,⟨H⟩⟩ := compactMap_nullhomotopic g f + obtain ⟨F,hF⟩ := SphereTopology.extends_of_nullhomotopic H.symm + exact ⟨F,fun x => ContinuousMap.congr_fun hF x⟩ + +lemma contractible [Nonempty G] : ContractibleSpace (Space G) := by + let g : G := Classical.choice ‹Nonempty G› + let : Nonempty (Space G) := ⟨vertex (0,g)⟩ + exact Cellular.contractible_of_sphereFillable (sphereFillable g) + +end + +section +open Set Metric Topology BigOperators UniversalFInfinity.Simplicial +open scoped Classical +universe u v +variable {G : Type u} [Group G] +local instance (priority := 2000) (α : Type*) : DecidableEq (ℕ × α) := Classical.decEq (ℕ × α) + +def translate (g : G) (s : Finset (ℕ × G)) : Finset (ℕ × G) := s.image (fun v => (v.1,g*v.2)) + +lemma translate_one (s : Finset (ℕ × G)) : translate 1 s = s := by + simp only [translate,one_mul,Prod.mk.eta,Finset.image_id'] +lemma translate_mul (g h : G) (s : Finset (ℕ × G)) : translate g (translate h s) = translate (g*h) s := by + simp only [translate,Finset.image_image,Function.comp_def,mul_assoc] +lemma translate_mono (g : G) {s t : Finset (ℕ × G)} (h : s ⊆ t) : translate g s ⊆ translate g t := + Finset.image_subset_image h +lemma translate_valid (g : G) {s : Finset (ℕ × G)} (hs : s ∈ complex G) : translate g s ∈ complex G := + map_face (g * ·) id Function.injective_id ⟨s,hs⟩ + +def orbitSpan (S : Finset (Finset (ℕ × G))) : PreAbstractSimplicialComplex (ℕ × G) where + faces := {t | t ∈ complex G ∧ ∃ g : G, ∃ s ∈ S, t ⊆ translate g s} + isRelLowerSet_faces := by + intro t ht + refine ⟨ht.1.1,?_⟩ + intro u hut hu + obtain ⟨g,s,hs,hts⟩ := ht.2 + exact ⟨(complex G).isRelLowerSet_faces.mem_of_le ht.1 hut hu,g,s,hs,hut.trans hts⟩ + +lemma orbitSpan_le (S : Finset (Finset (ℕ × G))) : orbitSpan S ≤ complex G := fun _ h => h.1 +lemma orbitSpan_mono {S T : Finset (Finset (ℕ × G))} (h : S ⊆ T) : orbitSpan S ≤ orbitSpan T := by + intro t ht + obtain ⟨g,s,hs,hts⟩ := ht.2 + exact ⟨ht.1,g,s,h hs,hts⟩ +lemma orbitSpan_contains (S : Finset (Finset (ℕ × G))) {t : Finset (ℕ × G)} + (ht : t ∈ complex G) (h : ∃ s ∈ S, t ⊆ s) : t ∈ orbitSpan S := by + obtain ⟨s,hs,hts⟩ := h + exact ⟨ht,1,s,hs,by rwa [translate_one]⟩ +lemma orbitSpan_invariant (S : Finset (Finset (ℕ × G))) (g : G) + {t : Finset (ℕ × G)} (ht : t ∈ orbitSpan S) : translate g t ∈ orbitSpan S := by + obtain ⟨h,s,hs,hts⟩ := ht.2 + exact ⟨translate_valid g ht.1,g*h,s,hs,by rw [←translate_mul]; exact translate_mono g hts⟩ + +lemma orbitSpan_bounded (S : Finset (Finset (ℕ × G))) : + orbitSpan S ≤ bounded G ((S.biUnion id).sup Prod.fst + 1) := by + intro t ht + refine ⟨ht.1,?_⟩ + intro v hv + obtain ⟨g,s,hs,hts⟩ := ht.2 + obtain ⟨w,hw,rfl⟩ := Finset.mem_image.mp (hts hv) + have hh : w.1 ≤ (S.biUnion id).sup Prod.fst := Finset.le_sup (f := Prod.fst) (Finset.mem_biUnion.mpr ⟨s,hs,hw⟩) + exact Nat.lt_succ_of_le hh + +def Controlled (K : PreAbstractSimplicialComplex (ℕ × G)) : Prop := + ∃ S : Finset (Finset (ℕ × G)), K ≤ orbitSpan S + +lemma controlled_orbitSpan (S : Finset (Finset (ℕ × G))) : Controlled (orbitSpan S) := ⟨S,le_rfl⟩ +lemma controlled_bounded {K : PreAbstractSimplicialComplex (ℕ × G)} (hK : Controlled K) : + ∃ N, K ≤ bounded G N := by + obtain ⟨S,hS⟩ := hK + exact ⟨_,hS.trans (orbitSpan_bounded S)⟩ + +lemma orbitSpan_finite_representatives (S : Finset (Finset (ℕ × G))) : + ∃ T : Finset (Finset (ℕ × G)), ∀ t ∈ orbitSpan S, ∃ s ∈ T, ∃ g : G, t = translate g s := by + refine ⟨S.biUnion Finset.powerset,?_⟩ + intro t ht + obtain ⟨g,s,hs,hts⟩ := ht.2 + have hh : translate g⁻¹ t ⊆ s := by + have hh := translate_mono g⁻¹ hts + simpa only [translate_mul,inv_mul_cancel,translate_one] using hh + refine ⟨translate g⁻¹ t,Finset.mem_biUnion.mpr ⟨s,hs,Finset.mem_powerset.mpr hh⟩,g,?_⟩ + rw [translate_mul,mul_inv_cancel,translate_one] + +end +section +open Set Metric Topology BigOperators UniversalFInfinity.Simplicial +open scoped Classical +universe u v +variable {G : Type u} {H : Type v} [Group G] [Group H] +local instance (priority := 2000) (α : Type*) : DecidableEq (ℕ × α) := Classical.decEq (ℕ × α) + +def vertexMap (φ : G →* H) (α : ℕ → ℕ) : ℕ × G → ℕ × H := fun v => (α v.1,φ v.2) +def faceImage (φ : G →* H) (α : ℕ → ℕ) (s : Finset (ℕ × G)) : Finset (ℕ × H) := s.image (vertexMap φ α) +def imageShapes (φ : G →* H) (α : ℕ → ℕ) (S : Finset (Finset (ℕ × G))) : Finset (Finset (ℕ × H)) := S.image (faceImage φ α) + +lemma faceImage_translate (φ : G →* H) (α : ℕ → ℕ) (a : G) (s : Finset (ℕ × G)) : + faceImage φ α (translate a s) = translate (φ a) (faceImage φ α s) := by + simp only [faceImage,translate,Finset.image_image,vertexMap,Function.comp_def,map_mul] + +lemma faceImage_valid (φ : G →* H) (α : ℕ → ℕ) (hα : Function.Injective α) + {s : Finset (ℕ × G)} (hs : s ∈ complex G) : faceImage φ α s ∈ complex H := + map_face φ α hα ⟨s,hs⟩ + +lemma faceImage_controlled (φ : G →* H) (α : ℕ → ℕ) (hα : Function.Injective α) + (S : Finset (Finset (ℕ × G))) (s : Face (orbitSpan S)) : + faceImage φ α s.1 ∈ orbitSpan (imageShapes φ α S) := by + obtain ⟨a,t,ht,hst⟩ := s.2.2 + refine ⟨faceImage_valid φ α hα s.2.1,φ a,faceImage φ α t, + Finset.mem_image.mpr ⟨t,ht,rfl⟩,?_⟩ + rw [← faceImage_translate] + exact Finset.image_subset_image hst + +lemma unionFace_valid (φ : G →* H) (α β : ℕ → ℕ) + (hα : Function.Injective α) (hβ : Function.Injective β) + {s : Finset (ℕ × G)} (hs : s ∈ complex G) + (hc : ∀ v ∈ s, ∀ w ∈ s, α v.1 = β w.1 → v.1 = w.1) : + faceImage φ α s ∪ faceImage φ β s ∈ complex H := by + refine ⟨(faceImage_valid φ α hα hs).1.mono Finset.subset_union_left,?_⟩ + intro x hx y hy hxy + rcases Finset.mem_union.mp hx with hx | hx <;> rcases Finset.mem_union.mp hy with hy | hy + · exact (faceImage_valid φ α hα hs).2 hx hy hxy + · obtain ⟨v,hv,rfl⟩ := Finset.mem_image.mp hx + obtain ⟨w,hw,rfl⟩ := Finset.mem_image.mp hy + have hvw : v = w := hs.2 hv hw (hc v hv w hw hxy) + subst w + apply Prod.ext + · exact hxy + · rfl + · obtain ⟨v,hv,rfl⟩ := Finset.mem_image.mp hx + obtain ⟨w,hw,rfl⟩ := Finset.mem_image.mp hy + have hvw : w = v := hs.2 hw hv (hc w hw v hv hxy.symm) + subst w + apply Prod.ext + · exact hxy + · rfl + · exact (faceImage_valid φ β hβ hs).2 hx hy hxy + +def unionShapes (φ : G →* H) (α β : ℕ → ℕ) (S : Finset (Finset (ℕ × G))) : + Finset (Finset (ℕ × H)) := S.image (fun s => faceImage φ α s ∪ faceImage φ β s) + +lemma translate_union (a : H) (s t : Finset (ℕ × H)) : translate a (s ∪ t) = translate a s ∪ translate a t := + Finset.image_union _ _ + +lemma unionFace_controlled (φ : G →* H) (α β : ℕ → ℕ) + (hα : Function.Injective α) (hβ : Function.Injective β) + (S : Finset (Finset (ℕ × G))) (s : Face (orbitSpan S)) + (hc : ∀ v ∈ s.1, ∀ w ∈ s.1, α v.1 = β w.1 → v.1 = w.1) : + faceImage φ α s.1 ∪ faceImage φ β s.1 ∈ orbitSpan (unionShapes φ α β S) := by + obtain ⟨a,t,ht,hst⟩ := s.2.2 + refine ⟨unionFace_valid φ α β hα hβ s.2.1 hc,φ a,faceImage φ α t ∪ faceImage φ β t, + Finset.mem_image.mpr ⟨t,ht,rfl⟩,?_⟩ + rw [translate_union,←faceImage_translate,←faceImage_translate] + exact Finset.union_subset_union (Finset.image_subset_image hst) (Finset.image_subset_image hst) + +def fresh (N : ℕ) (i : ℕ) : ℕ := if i = 0 then 0 else N+i +lemma fresh_zero (N : ℕ) : fresh N 0 = 0 := by simp [fresh] +lemma fresh_injective (N : ℕ) : Function.Injective (fresh N) := by + intro i j h + unfold fresh at h + split_ifs at h with hi hj hj + · exact hi.trans hj.symm + · exfalso; omega + · exfalso; omega + · omega + +lemma fresh_cross (N : ℕ) (α : ℕ → ℕ) (hα : Function.Injective α) (hzero : α 0 = 0) + {i j : ℕ} (hi : α i < N) (h : α i = fresh N j) : i = j := by + by_cases hj : j = 0 + · subst j + apply hα + simpa only [fresh_zero,hzero] using h + · have hh : N ≤ fresh N j := by simp only [fresh,ite_eq_right hj]; exact Nat.le_add_right _ _ + omega +end +open Set Metric Topology BigOperators UniversalFInfinity.Simplicial +open scoped Classical unitInterval +universe u v +variable {G : Type u} {H : Type v} [Group G] [Group H] +local instance (priority := 2000) (α : Type*) : DecidableEq (ℕ × α) := Classical.decEq (ℕ × α) + +def shapeBound (S : Finset (Finset (ℕ × G))) (α : ℕ → ℕ) : ℕ := + (S.biUnion id).sup (fun v => α v.1) + 1 +lemma orbit_below_bound (S : Finset (Finset (ℕ × G))) (α : ℕ → ℕ) + (s : Face (orbitSpan S)) {v : ℕ × G} (hv : v ∈ s.1) : α v.1 < shapeBound S α := by + obtain ⟨a,t,ht,hst⟩ := s.2.2 + obtain ⟨w,hw,rfl⟩ := Finset.mem_image.mp (hst hv) + have hh : α w.1 ≤ (S.biUnion id).sup (fun v => α v.1) := + Finset.le_sup (f := fun v : ℕ × G => α v.1) (Finset.mem_biUnion.mpr ⟨t,ht,hw⟩) + exact Nat.lt_succ_of_le hh + +def relayerFresh (S : Finset (Finset (ℕ × G))) (α β : ℕ → ℕ) : ℕ → ℕ := + fresh (max (shapeBound S α) (shapeBound S β)) +def relayerTarget (φ : G →* H) (S : Finset (Finset (ℕ × G))) (α β : ℕ → ℕ) := + unionShapes φ α (relayerFresh S α β) S ∪ unionShapes φ β (relayerFresh S α β) S + +lemma relayerLeftValid (φ : G →* H) (S : Finset (Finset (ℕ × G))) + (α β : ℕ → ℕ) (hα : Function.Injective α) (hα0 : α 0 = 0) (s : Face (orbitSpan S)) : + faceImage φ α s.1 ∪ faceImage φ (relayerFresh S α β) s.1 ∈ orbitSpan (relayerTarget φ S α β) := by + apply orbitSpan_mono Finset.subset_union_left + apply unionFace_controlled φ α (relayerFresh S α β) hα (fresh_injective _) S s + intro v hv w _ h + exact fresh_cross _ α hα hα0 ((orbit_below_bound S α s hv).trans_le (le_max_left _ _)) h + +lemma relayerRightValid (φ : G →* H) (S : Finset (Finset (ℕ × G))) + (α β : ℕ → ℕ) (hβ : Function.Injective β) (hβ0 : β 0 = 0) (s : Face (orbitSpan S)) : + faceImage φ β s.1 ∪ faceImage φ (relayerFresh S α β) s.1 ∈ orbitSpan (relayerTarget φ S α β) := by + apply orbitSpan_mono Finset.subset_union_right + apply unionFace_controlled φ β (relayerFresh S α β) hβ (fresh_injective _) S s + intro v hv w _ h + exact fresh_cross _ β hβ hβ0 ((orbit_below_bound S β s hv).trans_le (le_max_right _ _)) h + +variable (φ : G →* H) (S : Finset (Finset (ℕ × G))) (α β : ℕ → ℕ) +variable (hα : Function.Injective α) (hβ : Function.Injective β) (hα0 : α 0 = 0) (hβ0 : β 0 = 0) +include hα hα0 in +lemma relayerLeftMapValid (s : Face (orbitSpan S)) : + s.1.image (vertexMap φ α) ∈ orbitSpan (relayerTarget φ S α β) := + (orbitSpan _).isRelLowerSet_faces.mem_of_le (relayerLeftValid φ S α β hα hα0 s) + Finset.subset_union_left (s.2.1.1.image _) +include hβ hβ0 in +lemma relayerRightMapValid (s : Face (orbitSpan S)) : + s.1.image (vertexMap φ β) ∈ orbitSpan (relayerTarget φ S α β) := + (orbitSpan _).isRelLowerSet_faces.mem_of_le (relayerRightValid φ S α β hβ hβ0 s) + Finset.subset_union_left (s.2.1.1.image _) +include hα hα0 in +lemma relayerFreshMapValid (s : Face (orbitSpan S)) : + s.1.image (vertexMap φ (relayerFresh S α β)) ∈ orbitSpan (relayerTarget φ S α β) := + (orbitSpan _).isRelLowerSet_faces.mem_of_le (relayerLeftValid φ S α β hα hα0 s) + Finset.subset_union_right (s.2.1.1.image _) + +def relayerLeftMap := mapC (orbitSpan S) (orbitSpan (relayerTarget φ S α β)) + (vertexMap φ α) (relayerLeftMapValid φ S α β hα hα0) +def relayerRightMap := mapC (orbitSpan S) (orbitSpan (relayerTarget φ S α β)) + (vertexMap φ β) (relayerRightMapValid φ S α β hβ hβ0) +def relayerFreshMap := mapC (orbitSpan S) (orbitSpan (relayerTarget φ S α β)) + (vertexMap φ (relayerFresh S α β)) (relayerFreshMapValid φ S α β hα hα0) + +def relayerLeftHomotopy : (relayerLeftMap φ S α β hα hα0).Homotopy (relayerFreshMap φ S α β hα hα0) := + straightHomotopy _ _ _ _ _ _ (relayerLeftValid φ S α β hα hα0) +def relayerRightHomotopy : (relayerRightMap φ S α β hβ hβ0).Homotopy (relayerFreshMap φ S α β hα hα0) := + straightHomotopy _ _ _ _ _ _ (relayerRightValid φ S α β hβ hβ0) + +def relayerHomotopy : (relayerLeftMap φ S α β hα hα0).Homotopy (relayerRightMap φ S α β hβ hβ0) := + (relayerLeftHomotopy φ S α β hα hα0).trans (relayerRightHomotopy φ S α β hα hβ hα0 hβ0).symm + +lemma relayerLeftPure (x : Simplicial.Space (orbitSpan S)) (g : G) (hx : x.1 = Finsupp.single (0,g) 1) : + relayerLeftMap φ S α β hα hα0 x = relayerFreshMap φ S α β hα hα0 x := by + apply Subtype.ext + change x.1.mapDomain (vertexMap φ α) = x.1.mapDomain (vertexMap φ (relayerFresh S α β)) + rw [hx,Finsupp.mapDomain_single,Finsupp.mapDomain_single] + congr 1 + exact Prod.ext (hα0.trans (fresh_zero (max (shapeBound S α) (shapeBound S β))).symm) rfl +lemma relayerRightPure (x : Simplicial.Space (orbitSpan S)) (g : G) (hx : x.1 = Finsupp.single (0,g) 1) : + relayerRightMap φ S α β hβ hβ0 x = relayerFreshMap φ S α β hα hα0 x := by + apply Subtype.ext + change x.1.mapDomain (vertexMap φ β) = x.1.mapDomain (vertexMap φ (relayerFresh S α β)) + rw [hx,Finsupp.mapDomain_single,Finsupp.mapDomain_single] + congr 1 + exact Prod.ext (hβ0.trans (fresh_zero (max (shapeBound S α) (shapeBound S β))).symm) rfl + +lemma relayerLeftHomotopy_fixed (x : Simplicial.Space (orbitSpan S)) (g : G) + (hx : x.1 = Finsupp.single (0,g) 1) (t : I) : + relayerLeftHomotopy φ S α β hα hα0 (t,x) = relayerLeftMap φ S α β hα hα0 x := + straightHomotopy_fixed _ _ _ _ _ _ (relayerLeftValid φ S α β hα hα0) x + (relayerLeftPure φ S α β hα hα0 x g hx) t +lemma relayerRightHomotopy_fixed (x : Simplicial.Space (orbitSpan S)) (g : G) + (hx : x.1 = Finsupp.single (0,g) 1) (t : I) : + relayerRightHomotopy φ S α β hα hβ hα0 hβ0 (t,x) = relayerRightMap φ S α β hβ hβ0 x := + straightHomotopy_fixed _ _ _ _ _ _ (relayerRightValid φ S α β hβ hβ0) x + (relayerRightPure φ S α β hα hβ hα0 hβ0 x g hx) t + +theorem relayerHomotopy_fixed (x : Simplicial.Space (orbitSpan S)) (g : G) + (hx : x.1 = Finsupp.single (0,g) 1) (t : I) : + relayerHomotopy φ S α β hα hβ hα0 hβ0 (t,x) = relayerLeftMap φ S α β hα hα0 x := by + rw [relayerHomotopy,ContinuousMap.Homotopy.trans_apply] + split + · exact relayerLeftHomotopy_fixed φ S α β hα hα0 x g hx _ + · rw [ContinuousMap.Homotopy.symm_apply] + exact (relayerRightHomotopy_fixed φ S α β hα hβ hα0 hβ0 x g hx _).trans + ((relayerRightPure φ S α β hα hβ hα0 hβ0 x g hx).trans + (relayerLeftPure φ S α β hα hα0 x g hx).symm) +end UniversalFInfinity.Milnor + +end + +end OAI diff --git a/lean/OAI/GroupTheory/UniversalGroup/MilnorProducts.lean b/lean/OAI/GroupTheory/UniversalGroup/MilnorProducts.lean new file mode 100644 index 0000000000000000000000000000000000000000..881ae441c3744629ad2e7b8a04301ac102926ee3 --- /dev/null +++ b/lean/OAI/GroupTheory/UniversalGroup/MilnorProducts.lean @@ -0,0 +1,466 @@ +import OAI.GroupTheory.UniversalGroup.CellularApproximation + +namespace OAI + +noncomputable section + +open Set Metric Topology BigOperators +open Set Metric Topology +open Set Topology +open Set Metric Topology +open scoped NNReal +open Set Metric Topology +open scoped NNReal ENNReal +open Set Metric Topology +open scoped TensorProduct + +namespace UniversalFInfinity.Simplicial +open Set Metric Topology BigOperators +open scoped Classical +universe u v +variable {V : Type u} (K : PreAbstractSimplicialComplex V) + +def restrict (S : Finset V) : PreAbstractSimplicialComplex V where + faces := {s | s ∈ K ∧ s ⊆ S} + isRelLowerSet_faces := by + intro s hs + exact ⟨(K.isRelLowerSet_faces hs.1).1,fun t hts ht => + ⟨K.isRelLowerSet_faces.mem_of_le hs.1 hts ht,hts.trans hs.2⟩⟩ + +lemma restrict_le (S : Finset V) : restrict K S ≤ K := fun _ h => h.1 +instance finiteFace_restrict (S : Finset V) : Finite (Face (restrict K S)) := by + let f : Face (restrict K S) → {s : Finset V // s ∈ S.powerset} := + fun s => ⟨s.1,Finset.mem_powerset.mpr s.2.2⟩ + apply Finite.of_injective f + intro a b h + have hh := congrArg (fun z : {s : Finset V // s ∈ S.powerset} => z.1) h + exact Subtype.ext hh + +def restrictInclusion (S : Finset V) : C(Space (restrict K S),Space K) := + ⟨inclusion (restrict K S) K (fun _ h => restrict_le K S h),continuous_inclusion _ _ _⟩ + +lemma compactMap_finiteRestriction {A : Type v} [TopologicalSpace A] [CompactSpace A] (f : C(A,Space K)) : + ∃ S : Finset V, ∃ F : C(A,Space (restrict K S)), (restrictInclusion K S).comp F = f := by + obtain ⟨S,hS⟩ := compact_bounded_vertices K (isCompact_range f.continuous) + let F : A → Space (restrict K S) := fun a => + ⟨(f a).1,(f a).2.1,(f a).2.2.1,(f a).2.2.2,hS (f a) (mem_range_self a)⟩ + have hc : Continuous F := (inclusion_closedEmbedding (restrict K S) K + (fun _ h => restrict_le K S h)).isEmbedding.continuous_iff.mpr f.continuous + exact ⟨S,⟨F,hc⟩,rfl⟩ + +end UniversalFInfinity.Simplicial + +namespace UniversalFInfinity.Milnor + +section +open Set Metric Topology BigOperators UniversalFInfinity.Simplicial +open scoped Classical Topology.Homotopy +universe u v w +variable (G : Type u) [Group G] (N : Type v) [DecidableEq N] [Nontrivial N] +variable (A : Type w) [Group A] +local instance (priority := 2000) (α : Type*) : DecidableEq (ℕ × α) := Classical.decEq (ℕ × α) + +abbrev StagePi (S : Shapes G) := HomotopyGroup N (Simplicial.Space (stage G S)) (stagePoint G S) +abbrev StageValues (S : Shapes G) := A →* StagePi G N S + +def valueHom (S T : Shapes G) (h : S ⊆ T) : StageValues G N A S →* StageValues G N A T where + toFun f := (stageHom G N S T h).comp f + map_one' := by ext; rfl + map_mul' f g := by ext a; exact (stageHom G N S T h).map_mul (f a) (g a) + +instance : DirectedSystem (StageValues G N A) (fun S T h => valueHom G N A S T h) where + map_self _ f := by ext a; exact DirectedSystem.map_self (f := fun _ _ h => stageHom G N _ _ h) (f a) + map_map _ _ _ h₁ h₂ f := by ext a; exact DirectedSystem.map_map (f := fun _ _ h => stageHom G N _ _ h) h₁ h₂ (f a) + +abbrev ControlledValues := DirectLimit (StageValues G N A) (valueHom G N A) + +def value (S : Shapes G) (f : StageValues G N A S) : ControlledValues G N A := Quotient.mk _ ⟨S,f⟩ + +lemma value_eq_of_le (S T : Shapes G) (h : S ⊆ T) (f : StageValues G N A S) : + value G N A S f = value G N A T ((stageHom G N S T h).comp f) := DirectLimit.eq_of_le ⟨S,f⟩ T h + +lemma value_eq_one_iff (S : Shapes G) (f : StageValues G N A S) : + value G N A S f = 1 ↔ ∃ T, ∃ h : S ⊆ T, (stageHom G N S T h).comp f = 1 := + DirectLimit.exists_eq_one (f := valueHom G N A) ⟨S,f⟩ + +lemma value_mul (S : Shapes G) (f g : StageValues G N A S) : + value G N A S (f*g) = value G N A S f * value G N A S g := + (DirectLimit.mul_def (f := valueHom G N A) S f g).symm +end + +section +open Set Metric Topology BigOperators UniversalFInfinity.Simplicial +open scoped Classical Topology.Homotopy unitInterval +universe u v w +variable {G : Type u} {H : Type v} [Group G] [Group H] +variable (N : Type w) [DecidableEq N] [Nontrivial N] +local instance (priority := 2000) (α : Type*) : DecidableEq (ℕ × α) := Classical.decEq (ℕ × α) + +variable (φ : G →* H) (α : ℕ → ℕ) (S : Shapes G) (T : Shapes H) +variable (hv : ∀ s : Face (stage G S), faceImage φ α s.1 ∈ stage H T) + +def stageMap : C(Simplicial.Space (stage G S), Simplicial.Space (stage H T)) := + mapC _ _ (vertexMap φ α) hv + +lemma stageMap_point (hα : α 0 = 0) : stageMap φ α S T hv (stagePoint G S) = stagePoint H T := by + apply Subtype.ext + change (Finsupp.single (0,(1:G)) (1:ℝ)).mapDomain (vertexMap φ α) = Finsupp.single (0,1) 1 + rw [Finsupp.mapDomain_single] + congr 1 + exact Prod.ext hα φ.map_one + +variable (hα : α 0 = 0) +def stageMapHom : StagePi G N S →* StagePi H N T := + HomotopyFunctor.mapHom (stageMap φ α S T hv) (stageMap_point φ α S T hv hα) +def stageMapValue : ControlledValues H N (StagePi G N S) := + value H N _ T (stageMapHom N φ α S T hv hα) + +lemma stageMapValue_congrTarget (U : Shapes H) + (hu : ∀ s : Face (stage G S), faceImage φ α s.1 ∈ stage H U) : + stageMapValue N φ α S T hv hα = stageMapValue N φ α S U hu hα := by + apply Quotient.sound + refine ⟨T ∪ U,Finset.subset_union_left,Finset.subset_union_right,?_⟩ + apply MonoidHom.ext + intro a + induction a using Quotient.inductionOn with | h p => + apply congrArg Quotient.mk' + apply Subtype.ext + ext z + rfl + +lemma stageMapValue_eq_of_homotopy (ψ : G →* H) (β : ℕ → ℕ) + (hw : ∀ s : Face (stage G S), faceImage ψ β s.1 ∈ stage H T) (hβ : β 0 = 0) + (F : (stageMap φ α S T hv).Homotopy (stageMap ψ β S T hw)) + (hF : ∀ t, F (t,stagePoint G S) = stagePoint H T) : + stageMapValue N φ α S T hv hα = stageMapValue N ψ β S T hw hβ := by + apply congrArg (value H N _ T) + ext a + exact HomotopyFunctor.map_eq_of_homotopy _ _ _ _ F hF a + +lemma image_stage_valid (hαi : Function.Injective α) (s : Face (stage G S)) : + faceImage φ α s.1 ∈ stage H (imageShapes φ α (basedShapes G S)) := + orbitSpan_mono (Finset.subset_insert _ _) (faceImage_controlled φ α hαi (basedShapes G S) s) + +def mapValue (hαi : Function.Injective α) : ControlledValues H N (StagePi G N S) := + stageMapValue N φ α S _ (image_stage_valid φ α S hαi) hα + +lemma mapValue_eq (hαi : Function.Injective α) : + mapValue N φ α S hα hαi = stageMapValue N φ α S T hv hα := + stageMapValue_congrTarget N φ α S _ _ hα T hv +end + +open Set Metric Topology BigOperators UniversalFInfinity.Simplicial +open scoped Classical Topology.Homotopy unitInterval +universe u v w +variable {G : Type u} {H : Type v} [Group G] [Group H] +variable (N : Type w) [DecidableEq N] [Nontrivial N] +local instance (priority := 2000) (α : Type*) : DecidableEq (ℕ × α) := Classical.decEq (ℕ × α) + +variable (φ : G →* H) (S : Shapes G) (α β : ℕ → ℕ) +variable (hα : Function.Injective α) (hβ : Function.Injective β) (hα0 : α 0 = 0) (hβ0 : β 0 = 0) +include hα hα0 in +lemma relayerStageLeftValid (s : Face (stage G S)) : + faceImage φ α s.1 ∈ stage H (relayerTarget φ (basedShapes G S) α β) := + orbitSpan_mono (Finset.subset_insert _ _) (relayerLeftMapValid φ (basedShapes G S) α β hα hα0 s) +include hβ hβ0 in +lemma relayerStageRightValid (s : Face (stage G S)) : + faceImage φ β s.1 ∈ stage H (relayerTarget φ (basedShapes G S) α β) := + orbitSpan_mono (Finset.subset_insert _ _) (relayerRightMapValid φ (basedShapes G S) α β hβ hβ0 s) + +def relayerToStage : C(Simplicial.Space (orbitSpan (relayerTarget φ (basedShapes G S) α β)), + Simplicial.Space (stage H (relayerTarget φ (basedShapes G S) α β))) := + ⟨inclusion _ _ (fun _ hs => orbitSpan_mono (Finset.subset_insert _ _) hs),continuous_inclusion _ _ _⟩ + +def relayerStageHomotopy : + (stageMap φ α S _ (relayerStageLeftValid φ S α β hα hα0)).Homotopy + (stageMap φ β S _ (relayerStageRightValid φ S α β hβ hβ0)) := + (ContinuousMap.Homotopy.refl (relayerToStage φ S α β)).comp + (relayerHomotopy φ (basedShapes G S) α β hα hβ hα0 hβ0) + +lemma relayerStageHomotopy_fixed (t : I) : + relayerStageHomotopy φ S α β hα hβ hα0 hβ0 (t,stagePoint G S) = + stagePoint H (relayerTarget φ (basedShapes G S) α β) := by + change relayerToStage φ S α β (relayerHomotopy φ (basedShapes G S) α β hα hβ hα0 hβ0 (t,stagePoint G S)) = _ + rw [relayerHomotopy_fixed φ (basedShapes G S) α β hα hβ hα0 hβ0 (stagePoint G S) 1 rfl] + exact stageMap_point φ α S _ (relayerStageLeftValid φ S α β hα hα0) hα0 + +lemma mapValue_relayer : mapValue N φ α S hα0 hα = mapValue N φ β S hβ0 hβ := by + rw [mapValue_eq N φ α S _ (relayerStageLeftValid φ S α β hα hα0) hα0 hα, + mapValue_eq N φ β S _ (relayerStageRightValid φ S α β hβ hβ0) hβ0 hβ] + exact stageMapValue_eq_of_homotopy N φ α S _ _ hα0 φ β _ hβ0 + (relayerStageHomotopy φ S α β hα hβ hα0 hβ0) (relayerStageHomotopy_fixed φ S α β hα hβ hα0 hβ0) +end UniversalFInfinity.Milnor + +namespace UniversalFInfinity.Simplicial + +section +open Set Metric Topology BigOperators +open scoped Classical Topology.Homotopy +universe u v +variable {V : Type u} (K : PreAbstractSimplicialComplex V) +variable {N : Type v} [Nonempty N] {x : Space K} + +lemma loop_finite_restriction (p : GenLoop N (Space K) x) : + ∃ S : Finset V, ∃ y : Space (restrict K S), + ∃ hy : restrictInclusion K S y = x, + ∃ q : GenLoop N (Space (restrict K S)) y, + HomotopyFunctor.loopMap (restrictInclusion K S) hy q = p := by + obtain ⟨S,F,hF⟩ := compactMap_finiteRestriction K p.1 + let z : N → unitInterval := fun _ => 0 + have hz : z ∈ Cube.boundary N := ⟨Classical.arbitrary N,Or.inl rfl⟩ + have hy : restrictInclusion K S (F z) = x := + (ContinuousMap.congr_fun hF z).trans (GenLoop.boundary p z hz) + let q : GenLoop N (Space (restrict K S)) (F z) := ⟨F,by + intro t ht + apply inclusion_injective (restrict K S) K (fun _ h => restrict_le K S h) + exact (ContinuousMap.congr_fun hF t).trans ((GenLoop.boundary p t ht).trans hy.symm)⟩ + refine ⟨S,F z,hy,q,?_⟩ + apply Subtype.ext + exact hF +end + +section +open Set Metric Topology BigOperators +open scoped Classical +universe u v w +variable {V : Type u} {W : Type v} {U : Type w} + +def tensor (x : V →₀ ℝ) (y : W →₀ ℝ) : V × W →₀ ℝ := + Finsupp.onFinset (x.support ×ˢ y.support) (fun p => x p.1 * y p.2) (by + intro p hp + exact Finset.mem_product.mpr ⟨Finsupp.mem_support_iff.mpr (left_ne_zero_of_mul hp), + Finsupp.mem_support_iff.mpr (right_ne_zero_of_mul hp)⟩) + +lemma tensor_apply (x : V →₀ ℝ) (y : W →₀ ℝ) (p : V × W) : tensor x y p = x p.1*y p.2 := rfl +lemma tensor_support (x : V →₀ ℝ) (y : W →₀ ℝ) : + (tensor x y).support = x.support ×ˢ y.support := by + ext p + simp only [Finsupp.mem_support_iff,tensor_apply,Finset.mem_product,mul_ne_zero_iff] +lemma tensor_sum (x : V →₀ ℝ) (y : W →₀ ℝ) : + (tensor x y).sum (fun _ r => r) = x.sum (fun _ r => r)*y.sum (fun _ r => r) := by + rw [Finsupp.sum,tensor_support,Finset.sum_product] + simp only [tensor_apply,Finsupp.sum,← Finset.mul_sum,← Finset.sum_mul] + +variable (K : PreAbstractSimplicialComplex V) (L : PreAbstractSimplicialComplex W) +variable (M : PreAbstractSimplicialComplex U) +variable (p : V × W → U) (hp : ∀ s : Face K, ∀ t : Face L, (s.1 ×ˢ t.1).image p ∈ M) + +def pairMap (x : Space K) (y : Space L) : Space M := by + let z := (tensor x.1 y.1).mapDomain p + have hz : z.sum (fun _ r => r) = 1 := by + rw [push_sum,tensor_sum,x.2.2.1,y.2.2.1,mul_one] + refine ⟨z,?_,hz,?_⟩ + · exact push_nonneg p _ (fun a => mul_nonneg (x.2.1 a.1) (y.2.1 a.2)) + · apply M.isRelLowerSet_faces.mem_of_le (hp ⟨x.1.support,x.2.2.2⟩ ⟨y.1.support,y.2.2.2⟩) + · exact Finsupp.mapDomain_support.trans (by rw [tensor_support]) + · exact support_nonempty hz + +lemma pairMap_support (x : Space K) (y : Space L) : + (pairMap K L M p hp x y).1.support ⊆ (x.1.support ×ˢ y.1.support).image p := by + exact Finsupp.mapDomain_support.trans (by rw [tensor_support]) + +lemma continuous_pairMap_faces (s : Face K) (t : Face L) : + Continuous (fun q : SimplexDisk.Simplex s.1 × SimplexDisk.Simplex t.1 => + pairMap K L M p hp (faceMap K s q.1) (faceMap L t q.2)) := by + apply continuous_of_support_subset M _ ⟨(s.1 ×ˢ t.1).image p,hp s t⟩ + · intro q + exact (pairMap_support K L M p hp _ _).trans + (Finset.image_subset_image (Finset.product_subset_product (weight_support_subset _ _) (weight_support_subset _ _))) + · intro b + have he : (fun q : SimplexDisk.Simplex s.1 × SimplexDisk.Simplex t.1 => + (pairMap K L M p hp (faceMap K s q.1) (faceMap L t q.2)).1 b) = + fun q => ∑ a : s.1, ∑ c : t.1, if p (a.1,c.1) = b then q.1.1 a * q.2.1 c else 0 := by + funext q + change ((tensor (weight s.1 q.1) (weight t.1 q.2)).mapDomain p) b = _ + rw [push_apply p _ (s.1 ×ˢ t.1) (by rw [tensor_support]; exact Finset.product_subset_product (weight_support_subset _ _) (weight_support_subset _ _)),Finset.sum_product] + rw [← Finset.sum_coe_sort] + apply Finset.sum_congr rfl + intro a _ + rw [← Finset.sum_coe_sort] + apply Finset.sum_congr rfl + intro c _ + simp only [tensor_apply,weight_apply] + rw [he] + apply continuous_finsetSum + intro a _ + apply continuous_finsetSum + intro c _ + split_ifs + · exact (((continuous_apply a).comp continuous_subtype_val).comp continuous_fst).mul + (((continuous_apply c).comp continuous_subtype_val).comp continuous_snd) + · exact continuous_const + +instance [Finite (Face K)] : CompactSpace (Space K) := by + have hc : IsCompact (⋃ s : Face K, Set.range (faceMap K s)) := + isCompact_iUnion (fun s => isCompact_range (continuous_faceMap K s)) + have he : (⋃ s : Face K, Set.range (faceMap K s)) = Set.univ := by + ext x + simp only [mem_iUnion,mem_univ,iff_true] + exact ⟨⟨x.1.support,x.2.2.2⟩,coordinates K _ x (Finset.Subset.refl _),faceMap_coordinates K _ _ _⟩ + exact ⟨he ▸ hc⟩ + +lemma continuous_prod_faces_iff [Finite (Face K)] {Y : Type*} [TopologicalSpace Y] + (f : Space K × Space L → Y) : Continuous f ↔ + ∀ s : Face K, ∀ t : Face L, Continuous (fun q : SimplexDisk.Simplex s.1 × SimplexDisk.Simplex t.1 => + f (faceMap K s q.1,faceMap L t q.2)) := by + constructor + · intro hf s t + exact hf.comp (((continuous_faceMap K s).comp continuous_fst).prodMk ((continuous_faceMap L t).comp continuous_snd)) + · intro hf + rw [continuous_prod_iff] + intro t + have hc : Continuous (fun q : SimplexDisk.Simplex t.1 × Space K => f (q.2,faceMap L t q.1)) := by + rw [continuous_prod_iff] + intro s + exact (hf s t).comp continuous_swap + exact hc.comp continuous_swap + +lemma continuous_pairMap [Finite (Face K)] : Continuous (fun q : Space K × Space L => pairMap K L M p hp q.1 q.2) := + (continuous_prod_faces_iff K L _).mpr (continuous_pairMap_faces K L M p hp) + +def pairMapC [Finite (Face K)] : C(Space K × Space L,Space M) := + ⟨fun q => pairMap K L M p hp q.1 q.2,continuous_pairMap K L M p hp⟩ +end + +section +open Set Metric Topology BigOperators +open scoped Classical unitInterval +universe u v +variable {V : Type u} {W : Type v} +variable (K : PreAbstractSimplicialComplex V) (L : PreAbstractSimplicialComplex W) +variable (f g : C(Space K,Space L)) (c : Face K → Face L) +variable (hf : ∀ s : Face K, ∀ x : Space K, x.1.support ⊆ s.1 → (f x).1.support ⊆ (c s).1) +variable (hg : ∀ s : Face K, ∀ x : Space K, x.1.support ⊆ s.1 → (g x).1.support ⊆ (c s).1) + +def carrierBlend (t : I) (x : Space K) : Space L := + blend L (c ⟨x.1.support,x.2.2.2⟩) (f x) (g x) + (hf _ x (Finset.Subset.refl _)) (hg _ x (Finset.Subset.refl _)) t + +lemma continuous_carrierBlend : Continuous (fun p : I × Space K => carrierBlend K L f g c hf hg p.1 p.2) := by + rw [continuous_prod_iff] + intro s + apply continuous_of_support_subset L _ (c s) + · intro p + exact (blend_support _ _ p.1).trans (Finset.union_subset + (hf s _ (weight_support_subset _ _)) (hg s _ (weight_support_subset _ _))) + · intro b + change Continuous (fun p : I × SimplexDisk.Simplex s.1 => + (1-(p.1:ℝ)) * (f (faceMap K s p.2)).1 b + (p.1:ℝ) * (g (faceMap K s p.2)).1 b) + exact ((continuous_const.sub (continuous_subtype_val.comp continuous_fst)).mul + ((continuous_eval L b).comp (f.continuous.comp ((continuous_faceMap K s).comp continuous_snd)))).add + ((continuous_subtype_val.comp continuous_fst).mul + ((continuous_eval L b).comp (g.continuous.comp ((continuous_faceMap K s).comp continuous_snd)))) + +def carrierHomotopy : f.Homotopy g where + toFun p := carrierBlend K L f g c hf hg p.1 p.2 + continuous_toFun := continuous_carrierBlend K L f g c hf hg + map_zero_left _ := blend_zero L _ _ _ _ _ + map_one_left _ := blend_one L _ _ _ _ _ + +lemma carrierHomotopy_fixed (x : Space K) (h : f x = g x) (t : I) : + carrierHomotopy K L f g c hf hg (t,x) = f x := by + apply Subtype.ext + change (1-(t:ℝ)) • (f x).1 + (t:ℝ) • (g x).1 = (f x).1 + rw [←h,←add_smul,sub_add_cancel,one_smul] +end + +section +open Set Metric Topology BigOperators +open scoped Classical unitInterval +universe u v +variable {V : Type u} {W : Type v} + +lemma tensor_single (v : V) (w : W) (a b : ℝ) : + tensor (Finsupp.single v a) (Finsupp.single w b) = Finsupp.single (v,w) (a*b) := by + ext p + simp only [tensor_apply,Finsupp.single_apply] + by_cases hv : v = p.1 <;> by_cases hw : w = p.2 + · have h : (v,w) = p := Prod.ext hv hw + simp only [ite_eq_left hv,ite_eq_left hw,ite_eq_left h] + · have h : (v,w) ≠ p := fun h => hw (congrArg Prod.snd h) + simp only [ite_eq_left hv,ite_eq_right hw,ite_eq_right h,mul_zero] + · have h : (v,w) ≠ p := fun h => hv (congrArg Prod.fst h) + simp only [ite_eq_right hv,ite_eq_left hw,ite_eq_right h,zero_mul] + · have h : (v,w) ≠ p := fun h => hv (congrArg Prod.fst h) + simp only [ite_eq_right hv,ite_eq_right hw,ite_eq_right h,zero_mul] + +variable (K : PreAbstractSimplicialComplex V) (L : PreAbstractSimplicialComplex W) +variable (p : V × V → W) (hp : ∀ s t : Face K, (s.1 ×ˢ t.1).image p ∈ L) + +include hp in +lemma diagonal_face (s : Face K) : s.1.image (fun v => p (v,v)) ∈ L := by + apply L.isRelLowerSet_faces.mem_of_le (hp s s) _ ((K.isRelLowerSet_faces s.2).1.image _) + intro z hz + obtain ⟨v,hv,rfl⟩ := Finset.mem_image.mp hz + exact Finset.mem_image.mpr ⟨(v,v),Finset.mem_product.mpr ⟨hv,hv⟩,rfl⟩ + +variable [Finite (Face K)] +def productDiagonal : C(Space K,Space L) := + (pairMapC K K L p hp).comp ((ContinuousMap.id _).prodMk (ContinuousMap.id _)) +def vertexDiagonal : C(Space K,Space L) := mapC K L (fun v => p (v,v)) (diagonal_face K L p hp) + +def diagonalCarrier (s : Face K) : Face L := ⟨(s.1 ×ˢ s.1).image p,hp s s⟩ +lemma productDiagonal_carried (s : Face K) (x : Space K) (hx : x.1.support ⊆ s.1) : + (productDiagonal K L p hp x).1.support ⊆ (diagonalCarrier K L p hp s).1 := + (pairMap_support K K L p hp x x).trans (Finset.image_subset_image (Finset.product_subset_product hx hx)) +omit [Finite (Face K)] in +lemma vertexDiagonal_carried (s : Face K) (x : Space K) (hx : x.1.support ⊆ s.1) : + (vertexDiagonal K L p hp x).1.support ⊆ (diagonalCarrier K L p hp s).1 := by + apply (map_support K L (fun v => p (v,v)) (diagonal_face K L p hp) x).trans + intro z hz + obtain ⟨v,hv,rfl⟩ := Finset.mem_image.mp hz + exact Finset.mem_image.mpr ⟨(v,v),Finset.mem_product.mpr ⟨hx hv,hx hv⟩,rfl⟩ + +def diagonalHomotopy : (productDiagonal K L p hp).Homotopy (vertexDiagonal K L p hp) := + carrierHomotopy K L _ _ (diagonalCarrier K L p hp) + (productDiagonal_carried K L p hp) (vertexDiagonal_carried K L p hp) + +omit [Finite (Face K)] in +lemma pairMap_pure {M : PreAbstractSimplicialComplex V} (q : V × V → W) + (hq : ∀ s : Face K, ∀ t : Face M, (s.1 ×ˢ t.1).image q ∈ L) + (x : Space K) (y : Space M) (v w : V) + (hx : x.1 = Finsupp.single v 1) (hy : y.1 = Finsupp.single w 1) : + (pairMap K M L q hq x y).1 = Finsupp.single (q (v,w)) 1 := by + change (tensor x.1 y.1).mapDomain q = _ + rw [hx,hy,tensor_single,Finsupp.mapDomain_single,one_mul] + +lemma diagonalHomotopy_fixed (x : Space K) (v : V) (hx : x.1 = Finsupp.single v 1) (t : I) : + diagonalHomotopy K L p hp (t,x) = vertexDiagonal K L p hp x := by + have h : productDiagonal K L p hp x = vertexDiagonal K L p hp x := by + apply Subtype.ext + rw [show (productDiagonal K L p hp x).1 = Finsupp.single (p (v,v)) 1 from + pairMap_pure K L p hp x x v v hx hx] + change Finsupp.single (p (v,v)) 1 = x.1.mapDomain (fun v => p (v,v)) + rw [hx,Finsupp.mapDomain_single] + exact (carrierHomotopy_fixed K L _ _ _ _ _ x h t).trans h +end + +open Set Metric Topology BigOperators +open scoped Classical +universe u v w +variable {V : Type u} {W : Type v} {U : Type w} +lemma tensor_single_right_push (x : V →₀ ℝ) (w : W) (p : V × W → U) : + (tensor x (Finsupp.single w 1)).mapDomain p = x.mapDomain (fun v => p (v,w)) := by + ext b + rw [push_apply p _ (x.support ×ˢ {w}) (by + rw [tensor_support] + exact Finset.product_subset_product (Finset.Subset.refl _) Finsupp.support_single_subset)] + rw [push_apply (fun v => p (v,w)) x x.support (Finset.Subset.refl _),Finset.sum_product] + apply Finset.sum_congr rfl + intro v _ + simp only [Finset.sum_singleton,tensor_apply,Finsupp.single_eq_same,mul_one] +lemma tensor_single_left_push (v : V) (y : W →₀ ℝ) (p : V × W → U) : + (tensor (Finsupp.single v 1) y).mapDomain p = y.mapDomain (fun w => p (v,w)) := by + ext b + rw [push_apply p _ ({v} ×ˢ y.support) (by + rw [tensor_support] + exact Finset.product_subset_product Finsupp.support_single_subset (Finset.Subset.refl _))] + rw [push_apply (fun w => p (v,w)) y y.support (Finset.Subset.refl _),Finset.sum_product,Finset.sum_singleton] + apply Finset.sum_congr rfl + intro w _ + simp only [tensor_apply,Finsupp.single_eq_same,one_mul] +end UniversalFInfinity.Simplicial + +end + +end OAI diff --git a/lean/OAI/GroupTheory/UniversalGroup/Model.lean b/lean/OAI/GroupTheory/UniversalGroup/Model.lean new file mode 100644 index 0000000000000000000000000000000000000000..e31ce59f05b2fc65b2995eb7f58290052cfc7c01 --- /dev/null +++ b/lean/OAI/GroupTheory/UniversalGroup/Model.lean @@ -0,0 +1,17 @@ +import Mathlib + +namespace OAI + +namespace UniversalFInfinity +universe u + +def HasTypeFInfinity (G : Type u) [Group G] : Prop := + ∃ (X : Type u) (_ : TopologicalSpace X) (_ : T2Space X) + (_ : ConnectedSpace X) (cw : Topology.CWComplex (Set.univ : Set X)), + (∀ n : ℕ, Finite (cw.cell n)) ∧ + (∃ x : X, Nonempty (FundamentalGroup X x ≃* G)) ∧ + ∃ (E : Type u) (_ : TopologicalSpace E) (_ : ContractibleSpace E) + (p : E → X), Function.Surjective p ∧ IsCoveringMap p +end UniversalFInfinity + +end OAI diff --git a/lean/OAI/GroupTheory/UniversalGroup/PathExtensions.lean b/lean/OAI/GroupTheory/UniversalGroup/PathExtensions.lean new file mode 100644 index 0000000000000000000000000000000000000000..8767e916a21c2dff4f91660a8487cd74c097e9ea --- /dev/null +++ b/lean/OAI/GroupTheory/UniversalGroup/PathExtensions.lean @@ -0,0 +1,445 @@ +import OAI.GroupTheory.UniversalGroup.Cayley + +namespace OAI + +noncomputable section + +open Set Metric Topology BigOperators +open Set Metric Topology + +namespace UniversalFInfinity.PathExtension + +section +open Path.Homotopic +universe u v +variable {X : Type u} [TopologicalSpace X] + +namespace Q +variable {x y z : X} +lemma trans_cast {x' y' z' : X} (p : Path.Homotopic.Quotient x y) + (q : Path.Homotopic.Quotient y z) (hx : x' = x) (hy : y' = y) (hz : z' = z) : + (p.cast hx hy).trans (q.cast hy hz) = (p.trans q).cast hx hz := by + subst x'; subst y'; subst z'; simp +lemma map_trans {Y : Type*} [TopologicalSpace Y] + (p : Path.Homotopic.Quotient x y) (q : Path.Homotopic.Quotient y z) (f : C(X,Y)) : + (p.trans q).map f = (p.map f).trans (q.map f) := by + induction p using Path.Homotopic.Quotient.ind with | mk p => + induction q using Path.Homotopic.Quotient.ind with | mk q => + exact congrArg Path.Homotopic.Quotient.mk (p.map_trans q f.continuous) +lemma map_refl {Y : Type*} [TopologicalSpace Y] (x : X) (f : C(X,Y)) : + (Path.Homotopic.Quotient.refl x).map f = Path.Homotopic.Quotient.refl (f x) := rfl +lemma map_symm {Y : Type*} [TopologicalSpace Y] (p : Path.Homotopic.Quotient x y) (f : C(X,Y)) : + p.symm.map f = (p.map f).symm := by + induction p using Path.Homotopic.Quotient.ind with | mk p => + exact congrArg Path.Homotopic.Quotient.mk (p.map_symm f.continuous) + +structure Equal {x' y' : X} (p : Path.Homotopic.Quotient x y) + (q : Path.Homotopic.Quotient x' y') : Prop where + source : x = x' + target : y = y' + path : HEq p q + +namespace Equal +lemma refl (p : Path.Homotopic.Quotient x y) : Equal p p := ⟨rfl,rfl,HEq.rfl⟩ +lemma ofEq {p q : Path.Homotopic.Quotient x y} (h : p = q) : Equal p q := ⟨rfl,rfl,heq_of_eq h⟩ +lemma symm {x' y' : X} {p : Path.Homotopic.Quotient x y} + {q : Path.Homotopic.Quotient x' y'} (h : Equal p q) : Equal q p := + ⟨h.source.symm,h.target.symm,h.path.symm⟩ +lemma trans {x' y' x'' y'' : X} {p : Path.Homotopic.Quotient x y} + {q : Path.Homotopic.Quotient x' y'} {r : Path.Homotopic.Quotient x'' y''} + (h : Equal p q) (k : Equal q r) : Equal p r := + ⟨h.source.trans k.source,h.target.trans k.target,h.path.trans k.path⟩ +lemma map {Y : Type*} [TopologicalSpace Y] {x' y' : X} + {p : Path.Homotopic.Quotient x y} {q : Path.Homotopic.Quotient x' y'} + (h : Equal p q) (f : C(X,Y)) : Equal (p.map f) (q.map f) := by + rcases h with ⟨hx,hy,hp⟩ + subst x'; subst y' + cases eq_of_heq hp + exact .refl _ +lemma comp {x' y' z' : X} {p : Path.Homotopic.Quotient x y} + {q : Path.Homotopic.Quotient y z} {p' : Path.Homotopic.Quotient x' y'} + {q' : Path.Homotopic.Quotient y' z'} (hp : Equal p p') (hq : Equal q q') : + Equal (p.trans q) (p'.trans q') := by + rcases hp with ⟨hx,hy,hp⟩ + rcases hq with ⟨_,hz,hq⟩ + subst x'; subst y'; subst z' + cases eq_of_heq hp; cases eq_of_heq hq + exact .refl _ +end Equal +lemma cast_equal {x' y' : X} (p : Path.Homotopic.Quotient x y) (hx : x' = x) (hy : y' = y) : + Equal (p.cast hx hy) p := ⟨hx,hy,Path.Homotopic.Quotient.cast_heq hx hy⟩ +lemma refl_equal {x y : X} (h : x = y) : + Equal (Path.Homotopic.Quotient.refl x) (Path.Homotopic.Quotient.refl y) := by + subst y + exact .refl _ + +end Q + +variable {G : Type v} [Group G] [MulAction G X] [ContinuousConstSMul G X] + +def smulMap (g : G) : C(X,X) := ⟨fun x => g • x,continuous_const_smul g⟩ + +lemma map_one_equal {x y : X} (p : Path.Homotopic.Quotient x y) : + Q.Equal (p.map (smulMap (1 : G))) p := by + refine ⟨one_smul G x,one_smul G y,?_⟩ + induction p using Path.Homotopic.Quotient.ind with | mk p => + exact Path.Homotopic.hpath_hext (fun t => one_smul G (p t)) + +lemma map_mul_equal {x y : X} (p : Path.Homotopic.Quotient x y) (g h : G) : + Q.Equal ((p.map (smulMap h)).map (smulMap g)) (p.map (smulMap (g*h))) := by + refine ⟨(mul_smul g h x).symm,(mul_smul g h y).symm,?_⟩ + induction p using Path.Homotopic.Quotient.ind with | mk p => + exact Path.Homotopic.hpath_hext (fun t => (mul_smul g h (p t)).symm) + +variable (G) (x₀ : X) +abbrev Extension := Σ g : G, Path.Homotopic.Quotient x₀ (g • x₀) +variable {G x₀} + +omit [ContinuousConstSMul G X] in +@[ext] lemma ext {a b : Extension G x₀} (hg : a.1 = b.1) (hp : HEq a.2 b.2) : a = b := + Sigma.ext hg hp + +instance : One (Extension G x₀) := + ⟨⟨1,(Path.Homotopic.Quotient.refl x₀).cast rfl (one_smul G x₀)⟩⟩ +instance : Mul (Extension G x₀) := + ⟨fun a b => ⟨a.1*b.1,(a.2.trans (b.2.map (smulMap a.1))).cast rfl (mul_smul ..)⟩⟩ +instance : Inv (Extension G x₀) := + ⟨fun a => ⟨a.1⁻¹,((a.2.map (smulMap a.1⁻¹)).symm).cast (inv_smul_smul a.1 x₀).symm rfl⟩⟩ + +lemma mul_path_equal (a b : Extension G x₀) : + Q.Equal (a*b).2 (a.2.trans (b.2.map (smulMap a.1))) := + Q.cast_equal _ _ _ + +omit [ContinuousConstSMul G X] in +lemma one_path_equal : Q.Equal (1 : Extension G x₀).2 (Path.Homotopic.Quotient.refl x₀) := by + change Q.Equal ((Path.Homotopic.Quotient.refl x₀).cast rfl (one_smul G x₀)) _ + exact Q.cast_equal _ _ _ + +lemma mul_assoc (a b c : Extension G x₀) : a*b*c = a*(b*c) := by + apply ext (_root_.mul_assoc _ _ _) + apply Q.Equal.path + apply Q.Equal.trans (mul_path_equal (a*b) c) + apply Q.Equal.trans (Q.Equal.comp (mul_path_equal a b) (map_mul_equal c.2 a.1 b.1).symm) + apply Q.Equal.trans (Q.Equal.ofEq (Path.Homotopic.Quotient.trans_assoc _ _ _)) + apply Q.Equal.trans ?_ (mul_path_equal a (b*c)).symm + apply Q.Equal.comp (Q.Equal.refl _) + apply Q.Equal.trans ?_ ((mul_path_equal b c).map (smulMap a.1)).symm + exact Q.Equal.ofEq (Q.map_trans _ _ _).symm + +lemma one_mul (a : Extension G x₀) : 1*a = a := by + apply ext (_root_.one_mul _) + apply Q.Equal.path + exact (mul_path_equal 1 a).trans + ((Q.Equal.comp one_path_equal (map_one_equal a.2)).trans + (Q.Equal.ofEq (Path.Homotopic.Quotient.refl_trans a.2))) + +lemma mul_one (a : Extension G x₀) : a*1 = a := by + apply ext (_root_.mul_one _) + apply Q.Equal.path + apply Q.Equal.trans (mul_path_equal a 1) + apply Q.Equal.trans (Q.Equal.comp (Q.Equal.refl _) (one_path_equal.map (smulMap a.1))) + rw [Q.map_refl] + exact Q.Equal.ofEq (Path.Homotopic.Quotient.trans_refl a.2) + +lemma inv_mul_cancel (a : Extension G x₀) : a⁻¹*a = 1 := by + apply ext (_root_.inv_mul_cancel _) + apply Q.Equal.path + apply Q.Equal.trans (mul_path_equal a⁻¹ a) + have hi : Q.Equal (a⁻¹).2 (a.2.map (smulMap a.1⁻¹)).symm := Q.cast_equal _ _ _ + exact (Q.Equal.comp hi (Q.Equal.refl _)).trans + ((Q.Equal.ofEq (Path.Homotopic.Quotient.symm_trans _)).trans + ((Q.refl_equal (inv_smul_smul a.1 x₀)).trans one_path_equal.symm)) + +instance : Group (Extension G x₀) where + mul_assoc := mul_assoc + one_mul := one_mul + mul_one := mul_one + inv_mul_cancel := inv_mul_cancel + +def projection : Extension G x₀ →* G where + toFun := Sigma.fst + map_one' := rfl + map_mul' _ _ := rfl + +end +open Path.Homotopic +universe u v w +variable {G : Type u} [Group G] +variable {X : Type v} [TopologicalSpace X] [MulAction G X] [ContinuousConstSMul G X] +variable {Y : Type w} [TopologicalSpace Y] [MulAction G Y] [ContinuousConstSMul G Y] +variable (f : C(X,Y)) (hf : ∀ (g : G) (x : X), f (g • x) = g • f x) + +include hf in +lemma natural_smul_equal {x y : X} (p : Path.Homotopic.Quotient x y) (g : G) : + Q.Equal ((p.map (smulMap g)).map f) ((p.map f).map (smulMap g)) := by + refine ⟨hf g x,hf g y,?_⟩ + induction p using Path.Homotopic.Quotient.ind with | mk p => + exact Path.Homotopic.hpath_hext (fun t => hf g (p t)) + +variable (x₀ : X) +def mapFun (a : Extension G x₀) : Extension G (f x₀) := + ⟨a.1,(a.2.map f).cast rfl (hf a.1 x₀).symm⟩ +omit [ContinuousConstSMul G X] [ContinuousConstSMul G Y] in +lemma mapFun_equal (a : Extension G x₀) : + Q.Equal (mapFun f hf x₀ a).2 (a.2.map f) := Q.cast_equal _ _ _ +omit [ContinuousConstSMul G X] [ContinuousConstSMul G Y] in +lemma mapFun_one : mapFun f hf x₀ 1 = 1 := by + apply ext rfl + apply Q.Equal.path + apply (mapFun_equal f hf x₀ 1).trans + apply (one_path_equal.map f).trans + rw [Q.map_refl] + exact one_path_equal.symm +lemma mapFun_mul (a b : Extension G x₀) : mapFun f hf x₀ (a*b) = mapFun f hf x₀ a * mapFun f hf x₀ b := by + apply ext (a := mapFun f hf x₀ (a*b)) (b := mapFun f hf x₀ a * mapFun f hf x₀ b) (by rfl) + apply Q.Equal.path + apply (mapFun_equal f hf x₀ (a*b)).trans + apply ((mul_path_equal a b).map f).trans + apply (Q.Equal.ofEq (Q.map_trans _ _ _)).trans + apply Q.Equal.trans ?_ (mul_path_equal (mapFun f hf x₀ a) (mapFun f hf x₀ b)).symm + exact Q.Equal.comp (mapFun_equal f hf x₀ a).symm + ((natural_smul_equal f hf b.2 a.1).trans + ((mapFun_equal f hf x₀ b).map (smulMap a.1)).symm) + +def map : Extension G x₀ →* Extension G (f x₀) where + toFun := mapFun f hf x₀ + map_one' := mapFun_one f hf x₀ + map_mul' := mapFun_mul f hf x₀ + +lemma projection_map : projection.comp (map f hf x₀) = projection := rfl +end UniversalFInfinity.PathExtension +namespace UniversalFInfinity.Cayley + +section +open Set Metric Topology Attachment PathExtension +open scoped unitInterval +universe u +variable {G : Type u} [Group G] [TopologicalSpace G] [DiscreteTopology G] +variable {S : Type u} (s : S → G) + +lemma smul_vertex (g h : G) : g • vertex s h = vertex s (g*h) := rfl + +def pathGenerator (i : S) : PathExtension.Extension G (vertex s 1) := + ⟨s i,Path.Homotopic.Quotient.mk ((edge s 1 i).cast rfl (by + rw [smul_vertex]; simp only [_root_.mul_one,_root_.one_mul]))⟩ +def wordLift : FreeGroup S →* PathExtension.Extension G (vertex s 1) := + FreeGroup.lift (pathGenerator s) +lemma projection_wordLift : PathExtension.projection.comp (wordLift s) = FreeGroup.lift s := by + ext i + simp only [MonoidHom.comp_apply,wordLift,FreeGroup.lift_apply_of] + rfl +lemma wordLift_fst (w : FreeGroup S) : (wordLift s w).1 = FreeGroup.lift s w := + DFunLike.congr_fun (projection_wordLift s) w + +variable (rels : Set (FreeGroup S)) (hrel : ∀ r ∈ rels, FreeGroup.lift s r = 1) +def relatorClass (r : rels) : Path.Homotopic.Quotient (vertex s 1) (vertex s 1) := + (wordLift s r.1).2.cast rfl (by rw [wordLift_fst,hrel r.1 r.2,one_smul]) +def relatorLoop (r : rels) : Path (vertex s 1) (vertex s 1) := + (Path.Homotopic.Quotient.mk_surjective (relatorClass s rels hrel r)).choose +lemma relatorLoop_eq (r : rels) : Path.Homotopic.Quotient.mk (relatorLoop s rels hrel r) = + relatorClass s rels hrel r := + (Path.Homotopic.Quotient.mk_surjective (relatorClass s rels hrel r)).choose_spec +lemma relatorLoop_equal (r : rels) : + PathExtension.Q.Equal (Path.Homotopic.Quotient.mk (relatorLoop s rels hrel r)) + (wordLift s r.1).2 := + (PathExtension.Q.Equal.ofEq (relatorLoop_eq s rels hrel r)).trans (PathExtension.Q.cast_equal _ _ _) + +def relatorAttaching (r : rels) : C(Sphere 2,Graph s) := LoopSphere.map (relatorLoop s rels hrel r) +abbrev PresentationCover := Space (equivariantFamily (G := G) (relatorAttaching s rels hrel)) +def presentationBase : C(Graph s,PresentationCover s rels hrel) := ⟨base _,continuous_base _⟩ +lemma presentationBase_smul (g : G) (x : Graph s) : + presentationBase s rels hrel (g • x) = g • presentationBase s rels hrel x := rfl + +def coverWordLift : FreeGroup S →* PathExtension.Extension G (presentationBase s rels hrel (vertex s 1)) := + (PathExtension.map (presentationBase s rels hrel) (presentationBase_smul s rels hrel) (vertex s 1)).comp + (wordLift s) + +lemma mapped_relator_homotopic (r : rels) : + ((relatorLoop s rels hrel r).map (presentationBase s rels hrel).continuous).Homotopic + (Path.refl (presentationBase s rels hrel (vertex s 1))) := by + apply LoopSphere.homotopic_map_of_fill _ _ (cell _ ((1:G),r)) + intro z + change cell (equivariantFamily (G := G) (relatorAttaching s rels hrel)) ((1:G),r) + (Attachment.boundary 2 z) = _ + refine (cell_boundary (equivariantFamily (G := G) (relatorAttaching s rels hrel)) + (1,r) z).trans ?_ + change base _ ((1 : G) • relatorAttaching s rels hrel r z) = _ + rw [one_smul] + rfl + +lemma coverWordLift_relator (r : rels) : coverWordLift s rels hrel r.1 = 1 := by + apply PathExtension.ext (a := coverWordLift s rels hrel r.1) (b := 1) + ((wordLift_fst s r.1).trans (hrel r.1 r.2)) + apply PathExtension.Q.Equal.path + apply (PathExtension.mapFun_equal (presentationBase s rels hrel) + (presentationBase_smul s rels hrel) (vertex s 1) (wordLift s r.1)).trans + apply ((relatorLoop_equal s rels hrel r).map (presentationBase s rels hrel)).symm.trans + apply (PathExtension.Q.Equal.ofEq (Quotient.sound (mapped_relator_homotopic s rels hrel r))).trans + exact PathExtension.one_path_equal.symm + +lemma coverWordLift_ker (hker : (FreeGroup.lift s).ker = Subgroup.normalClosure rels) : + (FreeGroup.lift s).ker ≤ (coverWordLift s rels hrel).ker := by + rw [hker] + apply Subgroup.normalClosure_le_normal + intro r hr + exact coverWordLift_relator s rels hrel ⟨r,hr⟩ + +def presentationSection (hs : Function.Surjective (FreeGroup.lift s)) + (hker : (FreeGroup.lift s).ker = Subgroup.normalClosure rels) : + G →* PathExtension.Extension G (presentationBase s rels hrel (vertex s 1)) := + (FreeGroup.lift s).liftOfSurjective hs ⟨coverWordLift s rels hrel,coverWordLift_ker s rels hrel hker⟩ +lemma presentationSection_lift (hs : Function.Surjective (FreeGroup.lift s)) + (hker : (FreeGroup.lift s).ker = Subgroup.normalClosure rels) (w : FreeGroup S) : + presentationSection s rels hrel hs hker (FreeGroup.lift s w) = coverWordLift s rels hrel w := + MonoidHom.liftOfRightInverse_comp_apply .. +lemma presentationSection_fst (hs : Function.Surjective (FreeGroup.lift s)) + (hker : (FreeGroup.lift s).ker = Subgroup.normalClosure rels) (g : G) : + (presentationSection s rels hrel hs hker g).1 = g := by + obtain ⟨w,rfl⟩ := hs g + rw [presentationSection_lift] + exact wordLift_fst s w +end +section +open Set Metric Topology Attachment PathExtension +open scoped unitInterval +universe u v +variable {G : Type u} [Group G] [TopologicalSpace G] [DiscreteTopology G] +variable {S : Type u} (s : S → G) +variable {Y : Type v} [TopologicalSpace Y] [MulAction G Y] [ContinuousConstSMul G Y] +variable (f : C(Graph s,Y)) (hf : ∀ (g : G) x, f (g • x) = g • f x) +include hf in +omit [ContinuousConstSMul G Y] in +lemma vertex_action (g : G) : f (vertex s g) = g • f (vertex s 1) := by + rw [← hf,smul_vertex,_root_.mul_one] + +lemma pathGenerator_equal (i : S) : Q.Equal (pathGenerator s i).2 (Path.Homotopic.Quotient.mk (edge s 1 i)) := by + refine ⟨rfl,?_,?_⟩ + · rw [smul_vertex]; simp only [_root_.one_mul,_root_.mul_one]; rfl + · exact Path.Homotopic.hpath_hext (fun _ => rfl) + +include hf in +lemma edge_smul_equal (g : G) (i : S) : + Q.Equal (((Path.Homotopic.Quotient.mk (edge s 1 i)).map f).map (smulMap g)) + (Path.Homotopic.Quotient.mk ((edge s g i).map f.continuous)) := by + refine ⟨(vertex_action s f hf g).symm,?_,?_⟩ + · change g • f (vertex s (1*s i)) = f (vertex s (g*s i)) + rw [←hf,smul_vertex,_root_.one_mul] + · apply Path.Homotopic.hpath_hext + intro t + change g • f (cell _ ((1:G),i) (edgeParam t)) = f (cell _ (g,i) (edgeParam t)) + refine (hf g _).symm.trans (congrArg f ?_) + refine (smul_cell _ (equivariantFamily_smul (attaching s)) g (1,i) _).trans ?_ + exact congrArg (fun first : G => cell _ (first,i) (edgeParam t)) (_root_.mul_one g) + +variable (τ : G →* PathExtension.Extension G (f (vertex s 1))) +variable (hτ : ∀ g, (τ g).1 = g) +def coherentClass (g : G) : Path.Homotopic.Quotient (f (vertex s 1)) (f (vertex s g)) := + (τ g).2.cast rfl (by rw [hτ]; exact vertex_action s f hf g) +def coherentPath (g : G) : Path (f (vertex s 1)) (f (vertex s g)) := + (Path.Homotopic.Quotient.mk_surjective (coherentClass s f hf τ hτ g)).choose +lemma coherentPath_equal (g : G) : Q.Equal (Path.Homotopic.Quotient.mk (coherentPath s f hf τ hτ g)) (τ g).2 := + (Q.Equal.ofEq (Path.Homotopic.Quotient.mk_surjective (coherentClass s f hf τ hτ g)).choose_spec).trans + (Q.cast_equal _ _ _) + +variable (hgen : ∀ i, Q.Equal (τ (s i)).2 (Path.Homotopic.Quotient.mk ((edge s 1 i).map f.continuous))) +include hgen in +lemma coherentPath_edge (g : G) (i : S) : + ((coherentPath s f hf τ hτ g).trans ((edge s g i).map f.continuous)).Homotopic + (coherentPath s f hf τ hτ (g*s i)) := by + apply Path.Homotopic.Quotient.exact + change (Path.Homotopic.Quotient.mk (coherentPath s f hf τ hτ g)).trans + (Path.Homotopic.Quotient.mk ((edge s g i).map f.continuous)) = _ + apply eq_of_heq + apply Q.Equal.path + have he : Q.Equal ((τ (s i)).2.map (smulMap (τ g).1)) + (Path.Homotopic.Quotient.mk ((edge s g i).map f.continuous)) := by + apply ((hgen i).map (smulMap (τ g).1)).trans + rw [hτ] + exact edge_smul_equal s f hf g i + apply (Q.Equal.comp (coherentPath_equal s f hf τ hτ g) he.symm).trans + apply (mul_path_equal (τ g) (τ (s i))).symm.trans + have hm : Q.Equal (τ g * τ (s i)).2 (τ (g*s i)).2 := by + rw [←τ.map_mul] + exact .refl _ + exact hm.trans (coherentPath_equal s f hf τ hτ (g*s i)).symm + +def nullhomotopyOfSection : f.Homotopy (.const _ (f (vertex s 1))) := + graphNullhomotopy s f (f (vertex s 1)) (coherentPath s f hf τ hτ) + (coherentPath_edge s f hf τ hτ hgen) +end +open PathExtension Attachment +universe u +variable {G : Type u} [Group G] [TopologicalSpace G] [DiscreteTopology G] +variable {S : Type u} (s : S → G) (rels : Set (FreeGroup S)) +variable (hrel : ∀ r ∈ rels, FreeGroup.lift s r = 1) +variable (hs : Function.Surjective (FreeGroup.lift s)) +variable (hker : (FreeGroup.lift s).ker = Subgroup.normalClosure rels) +lemma presentationSection_generator (i : S) : + Q.Equal (presentationSection s rels hrel hs hker (s i)).2 + (Path.Homotopic.Quotient.mk ((edge s 1 i).map (presentationBase s rels hrel).continuous)) := by + have hh : presentationSection s rels hrel hs hker (s i) = + PathExtension.map (presentationBase s rels hrel) (presentationBase_smul s rels hrel) (vertex s 1) + (pathGenerator s i) := by + simpa only [FreeGroup.lift_apply_of,coverWordLift,MonoidHom.comp_apply,wordLift] + using presentationSection_lift s rels hrel hs hker (FreeGroup.of i) + rw [hh] + exact (PathExtension.mapFun_equal (presentationBase s rels hrel) (presentationBase_smul s rels hrel) (vertex s 1) (pathGenerator s i)).trans + ((pathGenerator_equal s i).map (presentationBase s rels hrel)) + +def presentationGraphNullhomotopy : + (presentationBase s rels hrel).Homotopy + (.const _ (presentationBase s rels hrel (vertex s 1))) := + nullhomotopyOfSection s (presentationBase s rels hrel) (presentationBase_smul s rels hrel) + (presentationSection s rels hrel hs hker) (presentationSection_fst s rels hrel hs hker) + (presentationSection_generator s rels hrel hs hker) +end UniversalFInfinity.Cayley +namespace UniversalFInfinity.Attachment +open Set Metric Topology +universe u v w z +variable {G : Type u} [Group G] +variable {X : Type v} [TopologicalSpace X] [MulAction G X] [ContinuousConstSMul G X] +variable {Y : Type w} [TopologicalSpace Y] [MulAction G Y] [ContinuousConstSMul G Y] +variable {ι : Type z} {n : ℕ} (a : ι → C(Sphere n,X)) + +lemma exists_equivariant_extension (f : C(X,Y)) + (hf : ∀ (g : G) x, f (g • x) = g • f x) (hY : Cellular.SphereFillable Y) : + ∃ F : C(Space (equivariantFamily (G := G) a),Y), + (∀ x, F (base _ x) = f x) ∧ (∀ (g : G) x, F (g • x) = g • F x) := by + choose e he using fun i => hY n (f.comp (a i)) + let b : FreeIndex G ι → C(Disk n,Y) := fun i => + ⟨fun d => i.1 • e i.2 d,(continuous_const_smul i.1).comp (e i.2).continuous⟩ + have hb (i : FreeIndex G ι) (x : Sphere n) : + b i (boundary n x) = f (equivariantFamily a i x) := by + change i.1 • e i.2 (Cellular.boundary n x) = f (i.1 • a i.2 x) + rw [he,hf] + rfl + refine ⟨lift _ f b hb,fun _ => rfl,?_⟩ + intro g x + cases x with + | inl x => exact hf g x + | inr p => exact (mul_smul g p.1.1 (e p.1.2 (interior n p.2))) + +lemma compactFundamentalSet [Finite ι] (hX : Milnor.CompactFundamentalSet G (X := X)) : + Milnor.CompactFundamentalSet G (X := Space (equivariantFamily (G := G) a)) := by + let b := equivariantFamily (G := G) a + obtain ⟨K,hK,hcov⟩ := hX + let L : Set (Space b) := (base b '' K) ∪ ⋃ i : ι, Set.range (cell b ((1:G),i)) + refine ⟨L,(hK.image (continuous_base b)).union (isCompact_iUnion (fun i => + isCompact_range (cell b ((1:G),i)).continuous)),?_⟩ + intro x + cases x with + | inl x => + obtain ⟨g,y,hy,rfl⟩ := hcov x + exact ⟨g,base b y,Or.inl ⟨y,hy,rfl⟩,rfl⟩ + | inr p => + refine ⟨p.1.1,cell b ((1:G),p.1.2) (interior n p.2),?_,?_⟩ + · exact Or.inr (Set.mem_iUnion.mpr ⟨p.1.2,Set.mem_range_self _⟩) + · refine Eq.trans ?_ (congrArg (fun point : Space b => p.1.1 • point) + (cell_interior b (1,p.1.2) p.2)).symm + exact congrArg (fun first : G => openCell b (first,p.1.2) p.2) + (mul_one p.1.1).symm +end UniversalFInfinity.Attachment + +end + +end OAI diff --git a/lean/OAI/GroupTheory/UniversalGroup/RopeTrick.lean b/lean/OAI/GroupTheory/UniversalGroup/RopeTrick.lean new file mode 100644 index 0000000000000000000000000000000000000000..e439feb9eb22e319193b44803738d8c02a763725 --- /dev/null +++ b/lean/OAI/GroupTheory/UniversalGroup/RopeTrick.lean @@ -0,0 +1,361 @@ +import OAI.GroupTheory.UniversalGroup.CentralHNN + +namespace OAI + +universe u v w x + +namespace Higman +open Monoid Coprod + +lemma commute_of_free_generators {ι : Type u} {κ : Type v} + {G : Type w} {H : Type x} {K : Type*} [Group G] [Group H] [Group K] + (p : FreeGroup ι →* G) (hp : Function.Surjective p) + (q : FreeGroup κ →* H) (hq : Function.Surjective q) + (f : G →* K) (g : H →* K) + (hc : ∀ i j, Commute (f (p (FreeGroup.of i))) (g (q (FreeGroup.of j)))) : + ∀ a b, Commute (f a) (g b) := by + intro a b + obtain ⟨a,rfl⟩ := hp a + obtain ⟨b,rfl⟩ := hq b + have hgen (i : ι) (b : FreeGroup κ) : + Commute (f (p (FreeGroup.of i))) (g (q b)) := by + induction b using FreeGroup.induction_on with + | one => simp + | of j => exact hc i j + | inv_of b hb => simpa only [map_inv] using hb.inv_right + | mul b c hb hc => simpa only [map_mul] using hb.mul_right hc + induction a using FreeGroup.induction_on with + | one => simp + | of i => exact hgen i b + | inv_of a ha => simpa only [map_inv] using ha.inv_left + | mul a c ha hc => simpa only [map_mul] using ha.mul_left hc + +theorem finitelyPresented_prod {G : Type u} {H : Type v} [Group G] [Group H] + [Group.IsFinitelyPresented G] [Group.IsFinitelyPresented H] : + Group.IsFinitelyPresented (G × H) := by + classical + obtain ⟨n,p,hp,_⟩ := Group.IsFinitelyPresented.out (G := G) + obtain ⟨m,q,hq,_⟩ := Group.IsFinitelyPresented.out (G := H) + let relation : Fin n × Fin m → G ∗ H := fun ij ↦ + (inl (p (FreeGroup.of ij.1)) * inr (q (FreeGroup.of ij.2))) * + (inr (q (FreeGroup.of ij.2)) * inl (p (FreeGroup.of ij.1)))⁻¹ + let N := Subgroup.normalClosure (Set.range relation) + let Q := (G ∗ H) ⧸ N + let proj : G ∗ H →* Q := QuotientGroup.mk' N + let f : G →* Q := proj.comp inl + let g : H →* Q := proj.comp inr + have hcomm : ∀ a b, Commute (f a) (g b) := by + apply commute_of_free_generators p hp q hq + intro i j + have h : proj (relation (i,j)) = 1 := + (QuotientGroup.eq_one_iff _).mpr (Subgroup.subset_normalClosure ⟨(i,j),rfl⟩) + exact mul_inv_eq_one.mp (by simpa only [f,g,MonoidHom.comp_apply,relation,map_mul,map_inv] using h) + let π : G ∗ H →* G × H := Coprod.lift (MonoidHom.inl G H) (MonoidHom.inr G H) + let s : G × H →* Q := MonoidHom.noncommCoprod f g hcomm + have hs : s.comp π = proj := by + apply Coprod.hom_ext <;> ext z <;> simp [s,π,f,g] + have hker : π.ker = N := by + apply le_antisymm + · intro z hz + apply (QuotientGroup.eq_one_iff _).mp + change proj z = 1 + rw [← hs] + change s (π z) = 1 + rw [show π z = 1 from hz,map_one] + · apply Subgroup.normalClosure_le_normal + rintro z ⟨⟨i,j⟩,rfl⟩ + change π (relation (i,j)) = 1 + simp [π,relation] + apply Group.IsFinitelyPresented.of_surjective π + · rintro ⟨a,b⟩ + exact ⟨inl a * inr b,by simp [π]⟩ + · exact ⟨Set.range relation,Set.finite_range _,hker.symm⟩ + +end Higman + +namespace Higman.RopeTrick + +section +open Monoid Coprod Multiplicative + +section Container +variable {ι : Type u} {K : Type v} [Group K] + +abbrev Raw := (K × FreeGroup ι) ∗ Multiplicative ℤ + +def rawK : K →* Raw (ι := ι) (K := K) := Coprod.inl.comp (MonoidHom.inl K (FreeGroup ι)) +def rawF : FreeGroup ι →* Raw (ι := ι) (K := K) := Coprod.inl.comp (MonoidHom.inr K (FreeGroup ι)) +def rawT : Raw (ι := ι) (K := K) := Coprod.inr (ofAdd 1) + +def relation (α β : FreeGroup ι →* K) : ι ⊕ ι → Raw (ι := ι) (K := K) + | .inl j => (rawT * rawK (α (FreeGroup.of j))) * + (rawK (α (FreeGroup.of j)) * rawT)⁻¹ + | .inr j => (rawT * rawK (β (FreeGroup.of j))) * + (rawK (β (FreeGroup.of j)) * rawF (FreeGroup.of j) * rawT)⁻¹ + +abbrev relations (α β : FreeGroup ι →* K) := Subgroup.normalClosure (Set.range (relation α β)) +abbrev Container (α β : FreeGroup ι →* K) := Raw (ι := ι) (K := K) ⧸ relations α β + +def proj (α β : FreeGroup ι →* K) : Raw (ι := ι) (K := K) →* Container α β := + QuotientGroup.mk' (relations α β) +def kMap (α β : FreeGroup ι →* K) : K →* Container α β := (proj α β).comp rawK +def fMap (α β : FreeGroup ι →* K) : FreeGroup ι →* Container α β := (proj α β).comp rawF +def stable (α β : FreeGroup ι →* K) : Container α β := proj α β rawT + +theorem finitelyPresented [Finite ι] [Group.IsFinitelyPresented K] + (α β : FreeGroup ι →* K) : Group.IsFinitelyPresented (Container α β) := by + let := Higman.finitelyPresented_prod (G := K) (H := FreeGroup ι) + exact Group.IsFinitelyPresented.quotient _ ⟨Set.range (relation α β),Set.finite_range _,rfl⟩ + +lemma relation_zero (α β : FreeGroup ι →* K) (j : ι ⊕ ι) : + proj α β (relation α β j) = 1 := + (QuotientGroup.eq_one_iff _).mpr (Subgroup.subset_normalClosure ⟨j,rfl⟩) + +lemma generator_zero (α β : FreeGroup ι →* K) (j : ι) : + stable α β * kMap α β (α (FreeGroup.of j)) = + kMap α β (α (FreeGroup.of j)) * stable α β := by + apply mul_inv_eq_one.mp + simpa only [proj,relation,map_mul,map_inv,kMap,stable,MonoidHom.comp_apply] using + relation_zero α β (.inl j) + +lemma generator_one (α β : FreeGroup ι →* K) (j : ι) : + stable α β * kMap α β (β (FreeGroup.of j)) = + kMap α β (β (FreeGroup.of j)) * fMap α β (FreeGroup.of j) * stable α β := by + apply mul_inv_eq_one.mp + simpa only [proj,relation,map_mul,map_inv,kMap,fMap,stable,MonoidHom.comp_apply] using + relation_zero α β (.inr j) + +lemma conjugate_zero (α β : FreeGroup ι →* K) (w : FreeGroup ι) : + stable α β * kMap α β (α w) * (stable α β)⁻¹ = kMap α β (α w) := by + have hh : (MulAut.conj (stable α β)).toMonoidHom.comp ((kMap α β).comp α) = + (kMap α β).comp α := by + apply FreeGroup.ext_hom + intro j + change stable α β * kMap α β (α (FreeGroup.of j)) * (stable α β)⁻¹ = _ + rw [generator_zero,mul_inv_cancel_right] + rfl + exact DFunLike.congr_fun hh w + +lemma pair_eq (α β : FreeGroup ι →* K) (k : K) (w : FreeGroup ι) : + proj α β (Coprod.inl (k,w)) = kMap α β k * fMap α β w := by + change proj α β (Coprod.inl (k,w)) = + proj α β (Coprod.inl (k,1)) * proj α β (Coprod.inl (1,w)) + rw [← map_mul,← map_mul] + simp + +lemma conjugate_one (α β : FreeGroup ι →* K) (w : FreeGroup ι) : + stable α β * kMap α β (β w) * (stable α β)⁻¹ = + kMap α β (β w) * fMap α β w := by + let p : FreeGroup ι →* Container α β := + ((proj α β).comp Coprod.inl).comp (β.prod (MonoidHom.id _)) + have hh : (MulAut.conj (stable α β)).toMonoidHom.comp ((kMap α β).comp β) = p := by + apply FreeGroup.ext_hom + intro j + change stable α β * kMap α β (β (FreeGroup.of j)) * (stable α β)⁻¹ = + proj α β (Coprod.inl (β (FreeGroup.of j),FreeGroup.of j)) + rw [generator_one,mul_inv_cancel_right,pair_eq] + have h := DFunLike.congr_fun hh w + change stable α β * kMap α β (β w) * (stable α β)⁻¹ = + proj α β (Coprod.inl (β w,w)) at h + rwa [pair_eq] at h + +lemma kills_relation (α β : FreeGroup ι →* K) (w : FreeGroup ι) (hw : α w = β w) : + fMap α β w = 1 := by + have h0 := conjugate_zero α β w + rw [hw,conjugate_one] at h0 + exact mul_left_cancel (h0.trans (mul_one _).symm) + +end Container + +variable {A : Type u} {K : Type v} {G : Type w} [Group A] [Group K] [Group G] +variable (i : A →* K) (hi : Function.Injective i) (r : A →* G) + +def left : A →* K × G := i.prod 1 +def right : A →* K × G := i.prod r + +include hi in +lemma left_injective : Function.Injective (left i (G := G)) := by + intro a b h + exact hi (congrArg Prod.fst h) +include hi in +lemma right_injective : Function.Injective (right i r) := by + intro a b h + exact hi (congrArg Prod.fst h) + +noncomputable def associated : (left i (G := G)).range ≃* (right i r).range := + (MonoidHom.ofInjective (left_injective i hi)).symm.trans + (MonoidHom.ofInjective (right_injective i hi r)) + +abbrev Model := HNNExtension (K × G) (left i (G := G)).range (right i r).range (associated i hi r) + +lemma associated_left (a : A) : associated i hi r ⟨left i a,⟨a,rfl⟩⟩ = + ⟨right i r a,⟨a,rfl⟩⟩ := by + change (MonoidHom.ofInjective (right_injective i hi r)) + ((MonoidHom.ofInjective (left_injective i hi)).symm + ((MonoidHom.ofInjective (left_injective i hi)) a)) = _ + rw [MulEquiv.symm_apply_apply] + rfl + +lemma model_relation (a : A) : + (HNNExtension.t : Model i hi r) * HNNExtension.of (i a,1) = + HNNExtension.of (i a,r a) * HNNExtension.t := by + have h := HNNExtension.t_mul_of (φ := associated i hi r) ⟨left i a,⟨a,rfl⟩⟩ + rw [associated_left] at h + exact h + +end + +open Monoid Coprod Multiplicative +noncomputable section +variable {ι : Type u} {A : Type v} {K : Type w} {G : Type x} +variable [Group A] [Group K] [Group G] +variable (i : A →* K) (hi : Function.Injective i) (r : A →* G) +variable (q : FreeGroup ι →* G) + +def evaluate : Raw (ι := ι) (K := K) →* Model i hi r := + Coprod.lift (HNNExtension.of.comp ((MonoidHom.id K).prodMap q)) + (zpowersHom _ HNNExtension.t) + +@[simp] lemma evaluate_rawK (k : K) : + evaluate i hi r q (rawK k) = HNNExtension.of (k,1) := by + simp [evaluate,rawK] +@[simp] lemma evaluate_rawF (w : FreeGroup ι) : + evaluate i hi r q (rawF w) = HNNExtension.of (1,q w) := by + simp [evaluate,rawF] +@[simp] lemma evaluate_rawT : + evaluate i hi r q rawT = HNNExtension.t := by + simp [evaluate,rawT] + +variable (p₀ p₁ : FreeGroup ι →* A) +variable (h₀ : ∀ w, r (p₀ w) = 1) (h₁ : ∀ w, r (p₁ w) = q w) + +include h₀ h₁ in +lemma evaluate_relation (j : ι ⊕ ι) : + evaluate i hi r q (relation (i.comp p₀) (i.comp p₁) j) = 1 := by + cases j with + | inl j => + simp only [relation,map_mul,map_inv,evaluate_rawK,evaluate_rawT] + apply mul_inv_eq_one.mpr + simpa only [MonoidHom.comp_apply,h₀] using model_relation i hi r (p₀ (FreeGroup.of j)) + | inr j => + simp only [relation,map_mul,map_inv,evaluate_rawK,evaluate_rawF,evaluate_rawT] + apply mul_inv_eq_one.mpr + rw [← map_mul] + simpa only [MonoidHom.comp_apply,Prod.mk_mul_mk,mul_one,one_mul,h₁] using + model_relation i hi r (p₁ (FreeGroup.of j)) + +def detect : Container (i.comp p₀) (i.comp p₁) →* Model i hi r := + QuotientGroup.lift _ (evaluate i hi r q) (by + apply Subgroup.normalClosure_le_normal + rintro z ⟨j,rfl⟩ + exact evaluate_relation i hi r q p₀ p₁ h₀ h₁ j) + +@[simp] lemma detect_fMap (w : FreeGroup ι) : + detect i hi r q p₀ p₁ h₀ h₁ (fMap (i.comp p₀) (i.comp p₁) w) = + HNNExtension.of (1,q w) := by + change evaluate i hi r q (rawF w) = _ + exact evaluate_rawF i hi r q w + +include hi h₀ h₁ in + +theorem embeds_quotient [Finite ι] [Group.IsFinitelyPresented K] + (hq : Function.Surjective q) + (hident : ∀ w ∈ q.ker, i (p₀ w) = i (p₁ w)) : + ∃ (Q : Type (max u w)) (_ : Group Q) (_ : Group.IsFinitelyPresented Q), + ∃ j : G →* Q, Function.Injective j := by + let α := i.comp p₀ + let β := i.comp p₁ + have hk : q.ker ≤ (fMap α β).ker := by + intro w hw + exact kills_relation α β w (hident w hw) + let j : G →* Container α β := q.liftOfSurjective hq ⟨fMap α β,hk⟩ + have hj (w : FreeGroup ι) : j (q w) = fMap α β w := by + exact MonoidHom.liftOfRightInverse_comp_apply _ _ _ _ _ + let d := detect i hi r q p₀ p₁ h₀ h₁ + have hd (g : G) : d (j g) = HNNExtension.of (1,g) := by + obtain ⟨w,rfl⟩ := hq g + rw [hj] + exact detect_fMap i hi r q p₀ p₁ h₀ h₁ w + refine ⟨Container α β,inferInstance,finitelyPresented α β,j,?_⟩ + intro g h he + have hh := congrArg d he + rw [hd,hd] at hh + exact congrArg Prod.snd (HNNExtension.of_injective (φ := associated i hi r) hh) + +end +end Higman.RopeTrick + +namespace Higman +variable {G : Type u} [Group G] + +def IsBenign (A : Subgroup G) : Prop := + ∃ (K : Type u) (_ : Group K) (_ : Group.IsFinitelyPresented K) + (i : G →* K), Function.Injective i ∧ + ∃ B : Subgroup K, B.FG ∧ B.comap i = A + +namespace Double +lemma firstIn_eq_secondIn {A : Subgroup G} {g : G} (hg : g ∈ A) : + firstIn A g = secondIn A g := by + apply Subtype.ext + exact HNNExtension.equiv_eq_conj (φ := MulEquiv.refl A) ⟨g,hg⟩ +end Double + +theorem embeds_of_benign_kernel {ι : Type u} [Finite ι] + {D : Type v} [Group D] (q : FreeGroup ι →* D) (hq : Function.Surjective q) + (hben : IsBenign q.ker) : + ∃ (K : Type u) (_ : Group K) (_ : Group.IsFinitelyPresented K) + (i : D →* K), Function.Injective i := by + obtain ⟨K,_,_,i,hi,B,hB,hBi⟩ := hben + let E := CentralExtension K B + have : Group.IsFinitelyPresented E := CentralExtension.finitelyPresented hB + let j := CentralExtension.map i (le_of_eq hBi.symm) + have hj : Function.Injective j := CentralExtension.map_injective i hi hBi + let A := Double.subgroup q.ker + let jA : A →* E := j.comp A.subtype + have hjA : Function.Injective jA := hj.comp Subtype.val_injective + let r := Double.read q (le_refl q.ker) + exact RopeTrick.embeds_quotient jA hjA r q + (Double.firstIn q.ker) (Double.secondIn q.ker) + (Double.read_first q (le_refl q.ker)) + (Double.read_second q (le_refl q.ker)) hq + (fun w hw ↦ congrArg jA (Double.firstIn_eq_secondIn hw)) + +namespace IsBenign +variable {A B : Subgroup G} + +theorem of_fg [Group.IsFinitelyPresented G] (hA : A.FG) : IsBenign A := by + refine ⟨G,inferInstance,inferInstance,MonoidHom.id G,Function.injective_id,A,hA,?_⟩ + rfl + +theorem inf (hA : IsBenign A) (hB : IsBenign B) : IsBenign (A ⊓ B) := by + obtain ⟨K,_,_,i,hi,L,hL,hLi⟩ := hA + obtain ⟨K',_,_,j,_,L',hL',hLj⟩ := hB + refine ⟨K × K',inferInstance,finitelyPresented_prod,i.prod j,?_,L.prod L', + hL.prod hL',?_⟩ + · intro x y h + exact hi (congrArg Prod.fst h) + · ext x + change i x ∈ L ∧ j x ∈ L' ↔ x ∈ A ∧ x ∈ B + change x ∈ L.comap i ∧ x ∈ L'.comap j ↔ _ + rw [hLi,hLj] + +theorem comap {D : Type u} [Group D] [Group.IsFinitelyPresented D] + (hA : IsBenign A) (f : D →* G) : IsBenign (A.comap f) := by + obtain ⟨n,p,hp,_⟩ := Group.IsFinitelyPresented.out (G := D) + have : Group.FG D := Group.fg_of_surjective hp + obtain ⟨K,_,_,i,_,L,hL,hLi⟩ := hA + refine ⟨D × K,inferInstance,finitelyPresented_prod, + (MonoidHom.id D).prod (i.comp f),?_,(⊤ : Subgroup D).prod L, + Group.FG.out.prod hL,?_⟩ + · intro x y h + exact congrArg Prod.fst h + · ext x + change (x ∈ (⊤ : Subgroup D) ∧ i (f x) ∈ L) ↔ f x ∈ A + simpa only [Subgroup.mem_top,true_and,Subgroup.mem_comap] using + (show f x ∈ L.comap i ↔ f x ∈ A by rw [hLi]) + +end IsBenign + +end Higman + +end OAI diff --git a/lean/OAI/GroupTheory/UniversalGroup/SimplexDisk.lean b/lean/OAI/GroupTheory/UniversalGroup/SimplexDisk.lean new file mode 100644 index 0000000000000000000000000000000000000000..0d5ed9b52e34a88199fcf8576fbc510a6be3f193 --- /dev/null +++ b/lean/OAI/GroupTheory/UniversalGroup/SimplexDisk.lean @@ -0,0 +1,204 @@ +import OAI.GroupTheory.UniversalGroup.UniversalPresentation + +namespace OAI + +open Set Metric Topology BigOperators +namespace UniversalFInfinity.SimplexDisk +noncomputable section + +def Simplex (A : Type*) [Fintype A] : Set (A → ℝ) := + {x | (∀ a, 0 ≤ x a) ∧ ∑ a, x a = 1} + +instance (A : Type*) [Fintype A] : CompactSpace (Simplex A) := by + apply isCompact_iff_compactSpace.mp + have closed : IsClosed (Simplex A) := by + have description : Simplex A = + (⋂ index, {point | (0 : ℝ) ≤ point index}) ∩ {point | ∑ index, point index = 1} := by + ext point + simp [Simplex] + rw [description] + exact (isClosed_iInter fun index => isClosed_le continuous_const (continuous_apply index)).inter + (isClosed_eq (continuous_finsetSum _ fun index _ => continuous_apply index) continuous_const) + apply (isCompact_Icc (a := (0 : A → ℝ)) (b := 1)).of_isClosed_subset closed + intro point membership + refine ⟨membership.1, fun index => ?_⟩ + change point index ≤ (1 : ℝ) + rw [← membership.2] + exact Finset.single_le_sum (fun other _ => membership.1 other) (Finset.mem_univ index) + +def Truncated (n : ℕ) : Set (Fin n → ℝ) := + {x | (∀ i, 0 ≤ x i) ∧ ∑ i, x i ≤ 1} +def Positive (n : ℕ) : Set (Fin n → ℝ) := + {x | (∀ i, 0 < x i) ∧ ∑ i, x i < 1} +def sumCLM (n : ℕ) : (Fin n → ℝ) →L[ℝ] ℝ := + ∑ i, ContinuousLinearMap.proj i +@[simp] lemma sumCLM_apply (n : ℕ) (x : Fin n → ℝ) : sumCLM n x = ∑ i, x i := by + simp [sumCLM] + +lemma truncated_closed (n : ℕ) : IsClosed (Truncated n) := by + have h : Truncated n = (⋂ i, {x | (0:ℝ) ≤ x i}) ∩ {x | ∑ i, x i ≤ 1} := by + ext x; simp [Truncated] + rw [h] + exact (isClosed_iInter fun i => isClosed_le continuous_const (continuous_apply i)).inter + (isClosed_le (continuous_finsetSum _ fun i _ => continuous_apply i) continuous_const) + +lemma positive_open (n : ℕ) : IsOpen (Positive n) := by + have h : Positive n = (⋂ i, {x | (0:ℝ) < x i}) ∩ {x | ∑ i, x i < 1} := by + ext x; simp [Positive] + rw [h] + exact (isOpen_iInter_of_finite fun i => isOpen_lt continuous_const (continuous_apply i)).inter + (isOpen_lt (continuous_finsetSum _ fun i _ => continuous_apply i) continuous_const) + +lemma interior_truncated (n : ℕ) : interior (Truncated n) = Positive n := by + apply Subset.antisymm + · intro x hx + have hc : ∀ i, 0 < x i := by + intro i + have hh := interior_mono (show Truncated n ⊆ (Function.eval i) ⁻¹' Ici (0:ℝ) from fun _ h => h.1 i) hx + rw [← (isOpenMap_eval i).preimage_interior_eq_interior_preimage (continuous_apply i),interior_Ici] at hh + exact hh + refine ⟨hc,?_⟩ + cases n with + | zero => simp + | succ n => + have hs : Function.Surjective (sumCLM (n+1)) := by + intro r + refine ⟨Pi.single 0 r,?_⟩ + simp + have hh := interior_mono (show Truncated (n+1) ⊆ (sumCLM (n+1)) ⁻¹' Iic (1:ℝ) from fun _ h => by simpa using h.2) hx + rw [← ((sumCLM (n+1)).isOpenMap hs).preimage_interior_eq_interior_preimage (sumCLM (n+1)).continuous,interior_Iic] at hh + simpa only [mem_preimage,mem_Iio,sumCLM_apply] using hh + · apply (positive_open n).subset_interior_iff.mpr + exact fun _ h => ⟨fun i => (h.1 i).le,h.2.le⟩ + +lemma truncated_convex (n : ℕ) : Convex ℝ (Truncated n) := by + have h : Truncated n = (⋂ i, ((LinearMap.proj i : (Fin n → ℝ) →ₗ[ℝ] ℝ) ⁻¹' Ici 0)) ∩ + (sumCLM n) ⁻¹' Iic 1 := by ext x; simp [Truncated] + rw [h] + exact (convex_iInter fun i => (convex_Ici (0:ℝ)).linear_preimage (LinearMap.proj i)).inter + ((convex_Iic (1:ℝ)).linear_preimage (sumCLM n).toLinearMap) + +lemma truncated_bounded (n : ℕ) : Bornology.IsBounded (Truncated n) := by + apply (isBounded_Icc (a := (0 : Fin n → ℝ)) (b := 1)).subset + intro x hx + refine ⟨hx.1,fun i => ?_⟩ + exact (Finset.single_le_sum (fun j _ => hx.1 j) (Finset.mem_univ i)).trans hx.2 + +lemma positive_nonempty (n : ℕ) : (Positive n).Nonempty := by + refine ⟨fun _ => 1 / (n+1 : ℝ),fun _ => by positivity,?_⟩ + simp only [Finset.sum_const,Finset.card_univ,Fintype.card_fin,nsmul_eq_mul] + have hn : (0:ℝ) < n+1 := by positivity + rw [mul_one_div,div_lt_one hn] + linarith + +noncomputable def ambient (n : ℕ) : (Fin n → ℝ) ≃ₜ (Fin n → ℝ) := + Classical.choose (exists_homeomorph_image_interior_closure_frontier_eq_unitBall + (truncated_convex n) (by rw [interior_truncated]; exact positive_nonempty n) (truncated_bounded n)) + +lemma ambient_positive (n : ℕ) : ambient n '' Positive n = ball 0 1 := by + simpa only [ambient,interior_truncated] using + (Classical.choose_spec (exists_homeomorph_image_interior_closure_frontier_eq_unitBall + (truncated_convex n) (by rw [interior_truncated]; exact positive_nonempty n) (truncated_bounded n))).1 +lemma ambient_truncated (n : ℕ) : ambient n '' Truncated n = closedBall 0 1 := by + simpa only [ambient,(truncated_closed n).closure_eq] using + (Classical.choose_spec (exists_homeomorph_image_interior_closure_frontier_eq_unitBall + (truncated_convex n) (by rw [interior_truncated]; exact positive_nonempty n) (truncated_bounded n))).2.1 + +noncomputable def truncatedDisk (n : ℕ) : Truncated n ≃ₜ closedBall (0 : Fin n → ℝ) 1 := + ((ambient n).image (Truncated n)).trans (Homeomorph.setCongr (ambient_truncated n)) + +noncomputable def simplexTruncated (n : ℕ) : SimplexDisk.Simplex (Fin (n+1)) ≃ₜ Truncated n where + toFun x := ⟨fun i => x.1 i.succ,fun i => x.2.1 _,by + have h := x.2.2 + rw [Fin.sum_univ_succ] at h + linarith [x.2.1 0]⟩ + invFun x := ⟨Fin.cons (1 - ∑ i, x.1 i) x.1,by + constructor + · intro i + refine Fin.cases ?_ (fun j => ?_) i + · exact sub_nonneg.mpr x.2.2 + · exact x.2.1 j + · simp [Fin.sum_univ_succ]⟩ + left_inv x := by + apply Subtype.ext + funext i + refine Fin.cases ?_ (fun j => rfl) i + have h := x.2.2 + rw [Fin.sum_univ_succ] at h + change 1 - ∑ i : Fin n, x.1 i.succ = x.1 0 + linarith + right_inv x := by rfl + continuous_toFun := (continuous_pi fun i => (continuous_apply i.succ).comp continuous_subtype_val).subtype_mk _ + continuous_invFun := by + apply Continuous.subtype_mk + apply continuous_pi + intro i + refine Fin.cases ?_ (fun j => ?_) i + · exact continuous_const.sub (continuous_finsetSum _ fun j _ => (continuous_apply j).comp continuous_subtype_val) + · exact (continuous_apply j).comp continuous_subtype_val + +noncomputable def simplexDisk (n : ℕ) : SimplexDisk.Simplex (Fin (n+1)) ≃ₜ closedBall (0 : Fin n → ℝ) 1 := + (simplexTruncated n).trans (truncatedDisk n) + +lemma simplexTruncated_positive (n : ℕ) (x : SimplexDisk.Simplex (Fin (n+1))) : + (simplexTruncated n x).1 ∈ Positive n ↔ ∀ i, 0 < x.1 i := by + have h := x.2.2 + rw [Fin.sum_univ_succ] at h + constructor + · rintro ⟨hc,hs⟩ i + refine Fin.cases ?_ (fun j => hc j) i + change ∑ i : Fin n, x.1 i.succ < 1 at hs + linarith + · intro hc + refine ⟨fun j => hc _,?_⟩ + change ∑ i : Fin n, x.1 i.succ < 1 + linarith [hc 0] + +lemma simplexDisk_open (n : ℕ) (x : SimplexDisk.Simplex (Fin (n+1))) : + (simplexDisk n x).1 ∈ ball 0 1 ↔ ∀ i, 0 < x.1 i := by + rw [← simplexTruncated_positive] + change ambient n (simplexTruncated n x).1 ∈ ball 0 1 ↔ _ + rw [← ambient_positive] + exact (ambient n).injective.mem_set_image + +lemma simplexDisk_boundary (n : ℕ) (x : SimplexDisk.Simplex (Fin (n+1))) : + (simplexDisk n x).1 ∈ sphere 0 1 ↔ ∃ i, x.1 i = 0 := by + have h := (simplexDisk n x).2 + rw [mem_sphere,mem_closedBall] at * + have ho := simplexDisk_open n x + simp only [mem_ball] at ho + constructor + · intro he + have hn : ¬ ∀ i, 0 < x.1 i := by rw [←ho,he]; exact lt_irrefl _ + push Not at hn + obtain ⟨i,hi⟩ := hn + exact ⟨i,le_antisymm hi (x.2.1 i)⟩ + · rintro ⟨i,hi⟩ + apply le_antisymm h + by_contra hn + have hp := ho.mp (lt_of_not_ge hn) + linarith [hp i] + +noncomputable def reindex {A B : Type*} [Fintype A] [Fintype B] (e : A ≃ B) : + SimplexDisk.Simplex A ≃ₜ SimplexDisk.Simplex B where + toFun x := ⟨fun b => x.1 (e.symm b),fun b => x.2.1 _,(e.symm.sum_comp x.1).trans x.2.2⟩ + invFun x := ⟨fun a => x.1 (e a),fun a => x.2.1 _,(e.sum_comp x.1).trans x.2.2⟩ + left_inv x := by ext a; simp + right_inv x := by ext b; simp + continuous_toFun := (continuous_pi fun b => ((continuous_apply (e.symm b)).comp continuous_subtype_val : Continuous (fun x : SimplexDisk.Simplex A => x.1 (e.symm b)))).subtype_mk _ + continuous_invFun := (continuous_pi fun a => ((continuous_apply (e a)).comp continuous_subtype_val : Continuous (fun x : SimplexDisk.Simplex B => x.1 (e a)))).subtype_mk _ + +lemma reindex_positive {A B : Type*} [Fintype A] [Fintype B] (e : A ≃ B) (x : SimplexDisk.Simplex A) : + (∀ b, 0 < (reindex e x).1 b) ↔ ∀ a, 0 < x.1 a := by + constructor + · intro h a + change ∀ b, 0 < x.1 (e.symm b) at h + simpa only [e.symm_apply_apply] using h (e a) + · intro h b + change 0 < x.1 (e.symm b) + exact h _ + +end +end UniversalFInfinity.SimplexDisk + +end OAI diff --git a/lean/OAI/GroupTheory/UniversalGroup/Simplicial.lean b/lean/OAI/GroupTheory/UniversalGroup/Simplicial.lean new file mode 100644 index 0000000000000000000000000000000000000000..18babcc4dbfc979db73dc44e867f5354d509050b --- /dev/null +++ b/lean/OAI/GroupTheory/UniversalGroup/Simplicial.lean @@ -0,0 +1,413 @@ +import OAI.GroupTheory.UniversalGroup.SimplexDisk + +namespace OAI + +noncomputable section + +open Set Metric Topology BigOperators + +namespace UniversalFInfinity.Simplicial + +section +universe u v +variable {V : Type u} (K : PreAbstractSimplicialComplex V) + +def Space := {w : V →₀ ℝ | (∀ v, 0 ≤ w v) ∧ w.sum (fun _ r => r) = 1 ∧ w.support ∈ K} +abbrev Face := {s : Finset V // s ∈ K} + +lemma support_nonempty {w : V →₀ ℝ} (h : w.sum (fun _ r => r) = 1) : w.support.Nonempty := by + classical + by_contra hn + have hz : w = 0 := by + apply Finsupp.support_eq_empty.mp + exact Finset.not_nonempty_iff_eq_empty.mp hn + simp [hz] at h + +lemma face_nonempty (s : Face K) : s.1.Nonempty := (K.isRelLowerSet_faces s.2).1 + +noncomputable def weight (s : Finset V) (x : SimplexDisk.Simplex s) : V →₀ ℝ := + Finsupp.embDomain (Function.Embedding.subtype (· ∈ s)) (Finsupp.equivFunOnFinite.symm x.1) + +lemma weight_apply (s : Finset V) (x : SimplexDisk.Simplex s) (v : s) : + weight s x v = x.1 v := by + exact Finsupp.embDomain_apply_self _ _ _ + +lemma weight_apply_not (s : Finset V) (x : SimplexDisk.Simplex s) {v : V} (hv : v ∉ s) : + weight s x v = 0 := by + apply Finsupp.embDomain_of_notMem_range + rintro ⟨w,hw⟩ + exact hv (hw ▸ w.2) + +lemma weight_nonneg (s : Finset V) (x : SimplexDisk.Simplex s) (v : V) : 0 ≤ weight s x v := by + classical + by_cases hv : v ∈ s + · exact (weight_apply s x ⟨v,hv⟩) ▸ x.2.1 ⟨v,hv⟩ + · rw [weight_apply_not _ _ hv] + +lemma weight_sum (s : Finset V) (x : SimplexDisk.Simplex s) : (weight s x).sum (fun _ r => r) = 1 := by + rw [weight,Finsupp.sum_embDomain,Finsupp.sum_fintype _ _ (fun _ => rfl)] + exact x.2.2 + +lemma weight_support_subset (s : Finset V) (x : SimplexDisk.Simplex s) : (weight s x).support ⊆ s := by + classical + intro v hv + by_contra hn + exact Finsupp.mem_support_iff.mp hv (weight_apply_not _ _ hn) + +noncomputable def faceMap (s : Face K) (x : SimplexDisk.Simplex s.1) : Space K := + ⟨weight s.1 x,weight_nonneg _ _,weight_sum _ _, + K.isRelLowerSet_faces.mem_of_le s.2 (weight_support_subset _ _) (support_nonempty (weight_sum _ _))⟩ + +noncomputable def quotient (x : Σ s : Face K, SimplexDisk.Simplex s.1) : Space K := faceMap K x.1 x.2 + +instance : TopologicalSpace (Space K) := TopologicalSpace.coinduced (quotient K) inferInstance + +lemma continuous_iff {Y : Type v} [TopologicalSpace Y] (f : Space K → Y) : + Continuous f ↔ ∀ s : Face K, Continuous (f ∘ faceMap K s) := by + rw [continuous_coinduced_dom] + exact continuous_sigma_iff + +lemma continuous_faceMap (s : Face K) : Continuous (faceMap K s) := + (continuous_coinduced_rng : Continuous (quotient K)).comp (continuous_sigmaMk (i := s)) + +lemma continuous_eval (v : V) : Continuous (fun x : Space K => x.1 v) := by + classical + rw [continuous_iff] + intro s + by_cases hv : v ∈ s.1 + · have he : (fun x : Space K => x.1 v) ∘ faceMap K s = (fun x : SimplexDisk.Simplex s.1 => x.1 ⟨v,hv⟩) := by + funext x + exact weight_apply s.1 x ⟨v,hv⟩ + rw [he] + exact (continuous_apply (⟨v,hv⟩ : s.1)).comp continuous_subtype_val + · have he : (fun x : Space K => x.1 v) ∘ faceMap K s = (fun _ => (0:ℝ)) := by + funext x + exact weight_apply_not _ _ hv + rw [he] + exact continuous_const + +instance : T2Space (Space K) := + T2Space.of_injective_continuous (f := fun x : Space K => (x.1 : V → ℝ)) + (fun _ _ h => Subtype.ext (Finsupp.ext fun v => congrFun h v)) + (continuous_pi fun v => continuous_eval K v) + +lemma faceMap_injective (s : Face K) : Function.Injective (faceMap K s) := by + intro x y h + apply Subtype.ext + funext v + have hh := congrArg (fun p : Space K => p.1 v) h + exact (weight_apply _ _ _).symm.trans (hh.trans (weight_apply _ _ _)) + +lemma faceMap_closedEmbedding (s : Face K) : IsClosedEmbedding (faceMap K s) := + (continuous_faceMap K s).isClosedEmbedding (faceMap_injective K s) + +noncomputable def coordinates (s : Finset V) (x : Space K) (h : x.1.support ⊆ s) : SimplexDisk.Simplex s := by + refine ⟨fun v => x.1 v,fun v => x.2.1 _,?_⟩ + rw [Finset.sum_coe_sort] + exact (x.1.sum_of_support_subset h _ (fun _ _ => rfl)).symm.trans x.2.2.1 + +lemma faceMap_coordinates (s : Face K) (x : Space K) (h : x.1.support ⊆ s.1) : + faceMap K s (coordinates K s.1 x h) = x := by + classical + apply Subtype.ext + ext v + by_cases hv : v ∈ s.1 + · exact weight_apply _ _ ⟨v,hv⟩ + · change weight s.1 _ v = x.1 v + rw [weight_apply_not _ _ hv,Finsupp.notMem_support_iff.mp (fun hh => hv (h hh))] + +lemma range_faceMap (s : Face K) : Set.range (faceMap K s) = {x | x.1.support ⊆ s.1} := by + ext x + constructor + · rintro ⟨y,rfl⟩ + exact weight_support_subset _ _ + · intro h + exact ⟨coordinates K s.1 x h,faceMap_coordinates K s x h⟩ + +lemma quotient_surjective : Function.Surjective (quotient K) := by + intro x + exact ⟨⟨⟨x.1.support,x.2.2.2⟩,coordinates K x.1.support x (subset_refl _)⟩, + faceMap_coordinates K ⟨x.1.support,x.2.2.2⟩ x (subset_refl _)⟩ + +lemma isClosed_iff (A : Set (Space K)) : + IsClosed A ↔ ∀ s : Face K, IsClosed ((faceMap K s) ⁻¹' A) := by + rw [isClosed_coinduced] + exact isClosed_sigma_iff + +lemma support_eq_iff (s : Face K) (x : SimplexDisk.Simplex s.1) : + (faceMap K s x).1.support = s.1 ↔ ∀ v, 0 < x.1 v := by + classical + constructor + · intro he v + have hn : weight s.1 x v ≠ 0 := by + apply Finsupp.mem_support_iff.mp + change v.1 ∈ (faceMap K s x).1.support + rw [he] + exact v.2 + rw [weight_apply] at hn + exact lt_of_le_of_ne (x.2.1 v) (Ne.symm hn) + · intro hp + apply Finset.Subset.antisymm (weight_support_subset _ _) + intro v hv + apply Finsupp.mem_support_iff.mpr + rw [weight_apply _ _ ⟨v,hv⟩] + exact ne_of_gt (hp ⟨v,hv⟩) + +end + +section +open Set Metric Topology BigOperators +open scoped Classical +universe u v w +variable {V : Type u} {W : Type v} {T : Type w} +variable (K : PreAbstractSimplicialComplex V) (L : PreAbstractSimplicialComplex W) + +lemma continuous_of_support_subset [TopologicalSpace T] (f : T → Space K) (s : Face K) + (hs : ∀ x, (f x).1.support ⊆ s.1) (hc : ∀ v, Continuous fun x => (f x).1 v) : Continuous f := by + let c : T → SimplexDisk.Simplex s.1 := fun x => coordinates K s.1 (f x) (hs x) + have hcc : Continuous c := (continuous_pi fun v : s.1 => hc v.1).subtype_mk _ + have he : f = (faceMap K s) ∘ c := by + funext x + exact (faceMap_coordinates K s (f x) (hs x)).symm + rw [he] + exact (continuous_faceMap K s).comp hcc + +lemma push_apply (f : V → W) (w : V →₀ ℝ) (s : Finset V) (hs : w.support ⊆ s) (b : W) : + (w.mapDomain f) b = ∑ a ∈ s, if f a = b then w a else 0 := by + classical + rw [Finsupp.mapDomain,Finsupp.sum_apply] + rw [w.sum_of_support_subset hs] + · apply Finset.sum_congr rfl + intro a _ + simp only [Finsupp.single_apply] + · intro a _ + simp + +lemma push_nonneg (f : V → W) (w : V →₀ ℝ) (hw : ∀ v, 0 ≤ w v) (b : W) : + 0 ≤ (w.mapDomain f) b := by + classical + rw [push_apply f w w.support (Finset.Subset.refl _) b] + exact Finset.sum_nonneg fun a _ => by split; exact hw a; exact le_rfl + +lemma push_sum (f : V → W) (w : V →₀ ℝ) : + (w.mapDomain f).sum (fun _ r => r) = w.sum (fun _ r => r) := + Finsupp.sum_mapDomain_index (fun _ => rfl) (fun _ _ _ => rfl) + +def map (f : V → W) (hf : ∀ s : Face K, s.1.image f ∈ L) (x : Space K) : Space L := by + classical + refine ⟨x.1.mapDomain f,push_nonneg f x.1 x.2.1,?_,?_⟩ + · rw [push_sum]; exact x.2.2.1 + · exact L.isRelLowerSet_faces.mem_of_le (hf ⟨x.1.support,x.2.2.2⟩) Finsupp.mapDomain_support + (support_nonempty (by rw [push_sum]; exact x.2.2.1)) + +lemma map_support (f : V → W) (hf : ∀ s : Face K, s.1.image f ∈ L) (x : Space K) : + (map K L f hf x).1.support ⊆ x.1.support.image f := by + classical + exact Finsupp.mapDomain_support + +lemma continuous_map (f : V → W) (hf : ∀ s : Face K, s.1.image f ∈ L) : Continuous (map K L f hf) := by + classical + rw [continuous_iff] + intro s + apply continuous_of_support_subset L _ ⟨s.1.image f,hf s⟩ + · intro x + exact (map_support K L f hf _).trans (Finset.image_subset_image (weight_support_subset _ _)) + · intro b + have he : (fun x : SimplexDisk.Simplex s.1 => ((map K L f hf ∘ faceMap K s) x).1 b) = + fun x => ∑ a : s.1, if f a.1 = b then x.1 a else 0 := by + funext x + change (Finsupp.mapDomain f (weight s.1 x)) b = _ + rw [push_apply f _ s.1 (weight_support_subset _ _) b,← Finset.sum_coe_sort] + apply Finset.sum_congr rfl + intro a _ + rw [weight_apply] + rw [he] + apply continuous_finsetSum + intro a _ + split_ifs + · exact (continuous_apply a).comp continuous_subtype_val + · exact continuous_const + +def mapC (f : V → W) (hf : ∀ s : Face K, s.1.image f ∈ L) : C(Space K,Space L) := + ⟨map K L f hf,continuous_map K L f hf⟩ + +lemma map_id (hf : ∀ s : Face K, s.1.image id ∈ K) (x : Space K) : map K K id hf x = x := by + apply Subtype.ext + exact Finsupp.mapDomain_id + +lemma map_comp {U : Type*} (M : PreAbstractSimplicialComplex U) + (f : V → W) (hf : ∀ s : Face K, s.1.image f ∈ L) + (g : W → U) (hg : ∀ s : Face L, s.1.image g ∈ M) + (hgf : ∀ s : Face K, s.1.image (g ∘ f) ∈ M) (x : Space K) : + map L M g hg (map K L f hf x) = map K M (g ∘ f) hgf x := by + apply Subtype.ext + exact Finsupp.mapDomain_comp.symm + +lemma quotient_quotientMap : IsQuotientMap (quotient K) := + ⟨⟨rfl⟩,quotient_surjective K⟩ + +lemma continuous_prod_iff [TopologicalSpace T] [LocallyCompactSpace T] + {Y : Type*} [TopologicalSpace Y] (f : T × Space K → Y) : + Continuous f ↔ ∀ s : Face K, Continuous (fun p : T × SimplexDisk.Simplex s.1 => f (p.1,faceMap K s p.2)) := by + constructor + · intro hf s + exact hf.comp (continuous_fst.prodMk ((continuous_faceMap K s).comp continuous_snd)) + · intro hf + apply (quotient_quotientMap K).continuous_lift_prod_right + rw [continuous_def] + intro O hO + have hp : (fun p : T × (Σ s : Face K, SimplexDisk.Simplex s.1) => f (p.1,quotient K p.2)) ⁻¹' O = + ⋃ s : Face K, (fun p : T × SimplexDisk.Simplex s.1 => (p.1,⟨s,p.2⟩)) '' + ((fun p : T × SimplexDisk.Simplex s.1 => f (p.1,faceMap K s p.2)) ⁻¹' O) := by + ext p + simp only [mem_preimage,mem_iUnion,mem_image] + constructor + · intro h + exact ⟨p.2.1,⟨p.1,p.2.2⟩,h,rfl⟩ + · rintro ⟨s,p,h,rfl⟩ + exact h + rw [hp] + apply isOpen_iUnion + intro s + exact (IsOpenMap.id.prodMap isOpenMap_sigmaMk) _ ((hf s).isOpen_preimage O hO) + +end + +section +open Set Metric Topology BigOperators +open scoped Classical unitInterval +universe u v +variable {V : Type u} {W : Type v} +variable (K : PreAbstractSimplicialComplex V) (L : PreAbstractSimplicialComplex W) + +def mass : (V →₀ ℝ) →ₗ[ℝ] ℝ := Finsupp.lsum ℝ fun _ => LinearMap.id +lemma mass_apply (w : V →₀ ℝ) : mass w = w.sum (fun _ r => r) := rfl + +lemma blend_support (x y : V →₀ ℝ) (t : I) : + ((1-(t:ℝ)) • x + (t:ℝ) • y).support ⊆ x.support ∪ y.support := + Finsupp.support_add.trans (Finset.union_subset_union Finsupp.support_smul Finsupp.support_smul) + +def blend (s : Face K) (x y : Space K) (hx : x.1.support ⊆ s.1) (hy : y.1.support ⊆ s.1) (t : I) : Space K := by + let w := (1-(t:ℝ)) • x.1 + (t:ℝ) • y.1 + have hw : w.sum (fun _ r => r) = 1 := by + rw [← mass_apply] + simp only [w,map_add,map_smul,mass_apply,x.2.2.1,y.2.2.1,smul_eq_mul,mul_one] + ring + refine ⟨w,?_,hw,?_⟩ + · intro v + exact add_nonneg (mul_nonneg (sub_nonneg.mpr t.2.2) (x.2.1 v)) (mul_nonneg t.2.1 (y.2.1 v)) + · exact K.isRelLowerSet_faces.mem_of_le s.2 + ((blend_support x.1 y.1 t).trans (Finset.union_subset hx hy)) (support_nonempty hw) + +lemma blend_zero (s : Face K) (x y : Space K) (hx : x.1.support ⊆ s.1) (hy : y.1.support ⊆ s.1) : + blend K s x y hx hy 0 = x := by + apply Subtype.ext + simp [blend] +lemma blend_one (s : Face K) (x y : Space K) (hx : x.1.support ⊆ s.1) (hy : y.1.support ⊆ s.1) : + blend K s x y hx hy 1 = y := by + apply Subtype.ext + simp [blend] +lemma blend_self (s : Face K) (x : Space K) (hx : x.1.support ⊆ s.1) (t : I) : + blend K s x x hx hx t = x := by + apply Subtype.ext + change (1-(t:ℝ)) • x.1 + (t:ℝ) • x.1 = x.1 + rw [← add_smul,sub_add_cancel,one_smul] + +variable (f g : V → W) (hf : ∀ s : Face K, s.1.image f ∈ L) (hg : ∀ s : Face K, s.1.image g ∈ L) +variable (hfg : ∀ s : Face K, s.1.image f ∪ s.1.image g ∈ L) + +def straight (t : I) (x : Space K) : Space L := + blend L ⟨x.1.support.image f ∪ x.1.support.image g,hfg ⟨x.1.support,x.2.2.2⟩⟩ + (map K L f hf x) (map K L g hg x) + ((map_support K L f hf x).trans Finset.subset_union_left) + ((map_support K L g hg x).trans Finset.subset_union_right) t + +lemma continuous_straight : Continuous (fun p : I × Space K => straight K L f g hf hg hfg p.1 p.2) := by + rw [continuous_prod_iff] + intro s + apply continuous_of_support_subset L _ ⟨s.1.image f ∪ s.1.image g,hfg s⟩ + · intro p + exact (blend_support _ _ p.1).trans (Finset.union_subset_union + ((map_support K L f hf _).trans (Finset.image_subset_image (weight_support_subset _ _))) + ((map_support K L g hg _).trans (Finset.image_subset_image (weight_support_subset _ _)))) + · intro b + change Continuous (fun p : I × SimplexDisk.Simplex s.1 => + (1-(p.1:ℝ)) * (map K L f hf (faceMap K s p.2)).1 b + + (p.1:ℝ) * (map K L g hg (faceMap K s p.2)).1 b) + exact ((continuous_const.sub (continuous_subtype_val.comp continuous_fst)).mul + ((continuous_eval L b).comp ((continuous_map K L f hf).comp ((continuous_faceMap K s).comp continuous_snd)))).add + ((continuous_subtype_val.comp continuous_fst).mul + ((continuous_eval L b).comp ((continuous_map K L g hg).comp ((continuous_faceMap K s).comp continuous_snd)))) + +def straightHomotopy : (mapC K L f hf).Homotopy (mapC K L g hg) where + toFun p := straight K L f g hf hg hfg p.1 p.2 + continuous_toFun := continuous_straight K L f g hf hg hfg + map_zero_left _ := blend_zero L _ _ _ _ _ + map_one_left _ := blend_one L _ _ _ _ _ + +lemma straightHomotopy_fixed (x : Space K) (h : map K L f hf x = map K L g hg x) (t : I) : + straightHomotopy K L f g hf hg hfg (t,x) = map K L f hf x := by + apply Subtype.ext + change (1-(t:ℝ)) • (map K L f hf x).1 + (t:ℝ) • (map K L g hg x).1 = (map K L f hf x).1 + rw [←h,←add_smul,sub_add_cancel,one_smul] +end +open Set Metric Topology BigOperators +open scoped Classical +universe u +variable {V : Type u} (K L : PreAbstractSimplicialComplex V) (hKL : ∀ s ∈ K, s ∈ L) + +def inclusion (x : Space K) : Space L := ⟨x.1,x.2.1,x.2.2.1,hKL _ x.2.2.2⟩ + +lemma inclusion_injective : Function.Injective (inclusion K L hKL) := + fun _ _ h => Subtype.ext (congrArg (fun z : Space L => z.1) h) + +lemma inclusion_faceMap (s : Face K) (x : SimplexDisk.Simplex s.1) : + inclusion K L hKL (faceMap K s x) = faceMap L ⟨s.1,hKL _ s.2⟩ x := rfl + +lemma continuous_inclusion : Continuous (inclusion K L hKL) := by + rw [continuous_iff] + intro s + exact continuous_faceMap L ⟨s.1,hKL _ s.2⟩ + +lemma inclusion_isClosedMap : IsClosedMap (inclusion K L hKL) := by + intro A hA + rw [isClosed_iff] + intro s + let T : Set (Face K) := {t | t.1 ⊆ s.1} + have hT : T.Finite := by + have hf := s.1.powerset.finite_toSet.preimage (Subtype.val_injective : Function.Injective (Subtype.val : Face K → Finset V)).injOn + convert hf using 1 + ext t + simp only [T,mem_ofPred_eq,mem_preimage,Finset.mem_coe,Finset.mem_powerset] + have hc : IsClosed (⋃ t ∈ T, inclusion K L hKL '' (A ∩ Set.range (faceMap K t))) := by + apply hT.isClosed_biUnion + intro t _ + exact (((isCompact_range (continuous_faceMap K t)).inter_left hA).image + (continuous_inclusion K L hKL)).isClosed + have he : inclusion K L hKL '' A ∩ Set.range (faceMap L s) = + ⋃ t ∈ T, inclusion K L hKL '' (A ∩ Set.range (faceMap K t)) := by + ext x + simp only [mem_inter_iff,mem_image,mem_iUnion] + constructor + · rintro ⟨⟨y,hy,rfl⟩,hs⟩ + rw [range_faceMap] at hs + let t : Face K := ⟨y.1.support,y.2.2.2⟩ + refine ⟨t,hs,y,⟨hy,?_⟩,rfl⟩ + rw [range_faceMap] + exact Finset.Subset.refl _ + · rintro ⟨t,ht,y,⟨hy,hyt⟩,rfl⟩ + refine ⟨⟨y,hy,rfl⟩,?_⟩ + rw [range_faceMap] at hyt ⊢ + exact hyt.trans (show t.1 ⊆ s.1 from ht) + rw [←he] at hc + have hp := hc.preimage (continuous_faceMap L s) + simpa only [preimage_inter,preimage_range,inter_univ] using hp + +lemma inclusion_closedEmbedding : IsClosedEmbedding (inclusion K L hKL) := + .of_continuous_injective_isClosedMap (continuous_inclusion K L hKL) + (inclusion_injective K L hKL) (inclusion_isClosedMap K L hKL) +end UniversalFInfinity.Simplicial + +end + +end OAI diff --git a/lean/OAI/GroupTheory/UniversalGroup/SimplicialProducts.lean b/lean/OAI/GroupTheory/UniversalGroup/SimplicialProducts.lean new file mode 100644 index 0000000000000000000000000000000000000000..6fe486cfa90735ea5f18971c1e81b8b3b39509ad --- /dev/null +++ b/lean/OAI/GroupTheory/UniversalGroup/SimplicialProducts.lean @@ -0,0 +1,323 @@ +import OAI.GroupTheory.UniversalGroup.MilnorProducts + +namespace OAI + +noncomputable section + +open Set Metric Topology BigOperators +open Set Metric Topology +open Set Topology +open Set Metric Topology +open scoped NNReal +open Set Metric Topology +open scoped NNReal ENNReal +open Set Metric Topology +open scoped TensorProduct + +namespace UniversalFInfinity.Milnor +open Set Metric Topology BigOperators UniversalFInfinity.Simplicial +open scoped Classical +universe u v w +variable {G : Type u} {H : Type v} {J : Type w} +local instance (priority := 2000) (α : Type*) : DecidableEq (ℕ × α) := Classical.decEq (ℕ × α) + +def pairVertex (β : G → H → J) (v : (ℕ × G) × (ℕ × H)) : ℕ × J := + (Nat.pair v.1.1 v.2.1,β v.1.2 v.2.2) + +def pairFace (β : G → H → J) (s : Finset (ℕ × G)) (t : Finset (ℕ × H)) : Finset (ℕ × J) := + (s ×ˢ t).image (pairVertex β) + +lemma pairFace_valid (β : G → H → J) {s : Finset (ℕ × G)} {t : Finset (ℕ × H)} + (hs : s ∈ complex G) (ht : t ∈ complex H) : pairFace β s t ∈ complex J := by + refine ⟨(hs.1.product ht.1).image _,?_⟩ + intro a ha b hb hab + obtain ⟨⟨x,y⟩,hxy,rfl⟩ := Finset.mem_image.mp ha + obtain ⟨⟨x',y'⟩,hxy',rfl⟩ := Finset.mem_image.mp hb + have hh := Nat.pair_eq_pair.mp hab + have hx : x = x' := hs.2 (Finset.mem_product.mp hxy).1 (Finset.mem_product.mp hxy').1 hh.1 + have hy : y = y' := ht.2 (Finset.mem_product.mp hxy).2 (Finset.mem_product.mp hxy').2 hh.2 + subst x'; subst y'; rfl + +lemma pairFace_mono (β : G → H → J) {s s' : Finset (ℕ × G)} {t t' : Finset (ℕ × H)} + (hs : s ⊆ s') (ht : t ⊆ t') : pairFace β s t ⊆ pairFace β s' t' := + Finset.image_subset_image (Finset.product_subset_product hs ht) + +variable [Group G] [Group H] [Group J] +variable (φ : G →* J) (ψ : H →* J) (hc : ∀ g h, Commute (φ g) (ψ h)) + +include hc in +lemma pair_translate_vertex (a g : G) (b h : H) : + φ (a*g)*ψ (b*h) = (φ a*ψ b)*(φ g*ψ h) := by + rw [φ.map_mul,ψ.map_mul] + calc + (φ a*φ g)*(ψ b*ψ h) = φ a*(φ g*ψ b)*ψ h := by simp only [mul_assoc] + _ = φ a*(ψ b*φ g)*ψ h := by + have hh := hc g b + change φ g * ψ b = ψ b * φ g at hh + rw [hh] + _ = (φ a*ψ b)*(φ g*ψ h) := by simp only [mul_assoc] + +include hc in +lemma pairFace_translate (a : G) (b : H) (s : Finset (ℕ × G)) (t : Finset (ℕ × H)) : + pairFace (fun g h => φ g*ψ h) (translate a s) (translate b t) = + translate (φ a*ψ b) (pairFace (fun g h => φ g*ψ h) s t) := by + ext z + simp only [pairFace,translate,Finset.mem_image,Finset.mem_product] + constructor + · rintro ⟨⟨x,y⟩,⟨⟨v,hv,rfl⟩,⟨w,hw,rfl⟩⟩,rfl⟩ + refine ⟨pairVertex (fun g h => φ g*ψ h) (v,w),⟨⟨v,w⟩,⟨hv,hw⟩,rfl⟩,?_⟩ + apply Prod.ext + · rfl + · exact (pair_translate_vertex φ ψ hc a v.2 b w.2).symm + · rintro ⟨z,⟨⟨v,w⟩,⟨hv,hw⟩,rfl⟩,rfl⟩ + refine ⟨⟨(v.1,a*v.2),(w.1,b*w.2)⟩,⟨⟨v,hv,rfl⟩,⟨w,hw,rfl⟩⟩,?_⟩ + apply Prod.ext + · rfl + · exact pair_translate_vertex φ ψ hc a v.2 b w.2 + +def productShapes (S : Finset (Finset (ℕ × G))) (T : Finset (Finset (ℕ × H))) : + Finset (Finset (ℕ × J)) := (S ×ˢ T).image (fun p => pairFace (fun g h => φ g*ψ h) p.1 p.2) + +include hc in +lemma pairFace_controlled (S : Finset (Finset (ℕ × G))) (T : Finset (Finset (ℕ × H))) + (s : Face (orbitSpan S)) (t : Face (orbitSpan T)) : + pairFace (fun g h => φ g*ψ h) s.1 t.1 ∈ orbitSpan (productShapes φ ψ S T) := by + obtain ⟨a,s',hs',hss⟩ := s.2.2 + obtain ⟨b,t',ht',htt⟩ := t.2.2 + refine ⟨pairFace_valid _ s.2.1 t.2.1,φ a*ψ b,pairFace (fun g h => φ g*ψ h) s' t',?_,?_⟩ + · exact Finset.mem_image.mpr ⟨(s',t'),Finset.mem_product.mpr ⟨hs',ht'⟩,rfl⟩ + · rw [←pairFace_translate φ ψ hc] + exact pairFace_mono _ hss htt + +end UniversalFInfinity.Milnor + +namespace UniversalFInfinity.HomotopyFunctor +open scoped Topology.Homotopy +lemma map_congr_maps {N X Y : Type*} [TopologicalSpace X] [TopologicalSpace Y] {x : X} {y : Y} + (f g : C(X,Y)) (hf : f x = y) (hg : g x = y) (h : f = g) (a : HomotopyGroup N X x) : + map f hf a = map g hg a := by + subst g + rfl +end UniversalFInfinity.HomotopyFunctor + +namespace UniversalFInfinity.Simplicial + +section +open Set Metric Topology BigOperators +open scoped Classical Topology.Homotopy +universe u v w +variable {V : Type u} {W : Type v} +variable (K : PreAbstractSimplicialComplex V) (L : PreAbstractSimplicialComplex W) +variable (p : V × V → W) (hp : ∀ s t : Face K, (s.1 ×ˢ t.1).image p ∈ L) +variable (x : Space K) (v : V) (hx : x.1 = Finsupp.single v 1) + +include hx in +lemma anchorFace : ({v} : Finset V) ∈ K := by + have hh := x.2.2.2 + rwa [hx,Finsupp.support_single _ one_ne_zero] at hh + +include hx hp in +lemma leftAxisFace (s : Face K) : s.1.image (fun a => p (a,v)) ∈ L := by + have hh := hp s ⟨{v},anchorFace K x v hx⟩ + simpa only [Finset.product_singleton,Finset.map_eq_image,Finset.image_image, + Function.comp_def,Function.Embedding.sectL_apply] using hh +include hx hp in +lemma rightAxisFace (s : Face K) : s.1.image (fun a => p (v,a)) ∈ L := by + have hh := hp ⟨{v},anchorFace K x v hx⟩ s + simpa only [Finset.singleton_product,Finset.map_eq_image,Finset.image_image, + Function.comp_def,Function.Embedding.sectR_apply] using hh + +def leftAxis : C(Space K,Space L) := mapC K L (fun a => p (a,v)) (leftAxisFace K L p hp x v hx) +def rightAxis : C(Space K,Space L) := mapC K L (fun a => p (v,a)) (rightAxisFace K L p hp x v hx) + +lemma leftAxis_point : leftAxis K L p hp x v hx x = vertexDiagonal K L p hp x := by + apply Subtype.ext + change x.1.mapDomain _ = x.1.mapDomain _ + rw [hx,Finsupp.mapDomain_single,Finsupp.mapDomain_single] +lemma rightAxis_point : rightAxis K L p hp x v hx x = vertexDiagonal K L p hp x := by + apply Subtype.ext + change x.1.mapDomain _ = x.1.mapDomain _ + rw [hx,Finsupp.mapDomain_single,Finsupp.mapDomain_single] + +variable [Finite (Face K)] +lemma pairLeft_eq : (pairMapC K K L p hp).comp ((ContinuousMap.id _).prodMk (ContinuousMap.const _ x)) = + leftAxis K L p hp x v hx := by + apply ContinuousMap.ext + intro z + apply Subtype.ext + change (tensor z.1 x.1).mapDomain p = z.1.mapDomain _ + rw [hx,tensor_single_right_push] +lemma pairRight_eq : (pairMapC K K L p hp).comp ((ContinuousMap.const _ x).prodMk (ContinuousMap.id _)) = + rightAxis K L p hp x v hx := by + apply ContinuousMap.ext + intro z + apply Subtype.ext + change (tensor x.1 z.1).mapDomain p = z.1.mapDomain _ + rw [hx,tensor_single_left_push] + +include hx in +lemma productDiagonal_point : productDiagonal K L p hp x = vertexDiagonal K L p hp x := by + apply Subtype.ext + rw [show (productDiagonal K L p hp x).1 = Finsupp.single (p (v,v)) 1 from pairMap_pure K L p hp x x v v hx hx] + change Finsupp.single _ 1 = x.1.mapDomain _ + rw [hx,Finsupp.mapDomain_single] + +variable {N : Type w} [DecidableEq N] [Nonempty N] +lemma finite_pair_additivity (a : HomotopyGroup N (Space K) x) : + HomotopyFunctor.map (vertexDiagonal K L p hp) rfl a = + HomotopyFunctor.map (leftAxis K L p hp x v hx) (leftAxis_point K L p hp x v hx) a * + HomotopyFunctor.map (rightAxis K L p hp x v hx) (rightAxis_point K L p hp x v hx) a := by + have hh := HomotopyFunctor.product_additivity (pairMapC K K L p hp) + (productDiagonal_point K L p hp x v hx) a + have hD := HomotopyFunctor.map_eq_of_homotopy (productDiagonal K L p hp) (vertexDiagonal K L p hp) + (productDiagonal_point K L p hp x v hx) rfl (diagonalHomotopy K L p hp) + (diagonalHomotopy_fixed K L p hp x v hx) a + simp only [ContinuousMap.id_apply] at hh + have hL := HomotopyFunctor.map_congr_maps ((pairMapC K K L p hp).comp ((ContinuousMap.id _).prodMk (ContinuousMap.const _ x))) _ (productDiagonal_point K L p hp x v hx) (leftAxis_point K L p hp x v hx) + (pairLeft_eq K L p hp x v hx) a + have hR := HomotopyFunctor.map_congr_maps ((pairMapC K K L p hp).comp ((ContinuousMap.const _ x).prodMk (ContinuousMap.id _))) _ (productDiagonal_point K L p hp x v hx) (rightAxis_point K L p hp x v hx) + (pairRight_eq K L p hp x v hx) a + exact hD.symm.trans (hh.trans (congrArg₂ (· * ·) hL hR)) +end + +section +open Set Metric Topology BigOperators +open scoped Classical Topology.Homotopy +universe u v w +variable {V : Type u} {W : Type v} +variable (K : PreAbstractSimplicialComplex V) (L : PreAbstractSimplicialComplex W) +variable (p : V × V → W) (hp : ∀ s t : Face K, (s.1 ×ˢ t.1).image p ∈ L) +variable (x : Space K) (v : V) (hx : x.1 = Finsupp.single v 1) +variable {N : Type w} [DecidableEq N] [Nonempty N] +lemma finite_pair_additivity_to [Finite (Face K)] (z : Space L) + (hz : vertexDiagonal K L p hp x = z) (a : HomotopyGroup N (Space K) x) : + HomotopyFunctor.map (vertexDiagonal K L p hp) hz a = + HomotopyFunctor.map (leftAxis K L p hp x v hx) ((leftAxis_point K L p hp x v hx).trans hz) a * + HomotopyFunctor.map (rightAxis K L p hp x v hx) ((rightAxis_point K L p hp x v hx).trans hz) a := by + subst z + exact finite_pair_additivity K L p hp x v hx a + +lemma pair_additivity (a : HomotopyGroup N (Space K) x) : + HomotopyFunctor.map (vertexDiagonal K L p hp) rfl a = + HomotopyFunctor.map (leftAxis K L p hp x v hx) (leftAxis_point K L p hp x v hx) a * + HomotopyFunctor.map (rightAxis K L p hp x v hx) (rightAxis_point K L p hp x v hx) a := by + induction a using Quotient.inductionOn with | h q => + obtain ⟨R,y,hy,r,hr⟩ := loop_finite_restriction K q + have hyr : y.1 = Finsupp.single v 1 := (congrArg (fun z : Space K => z.1) hy).trans hx + let hpR : ∀ s t : Face (restrict K R), (s.1 ×ˢ t.1).image p ∈ L := + fun s t => hp ⟨s.1,s.2.1⟩ ⟨t.1,t.2.1⟩ + have hz : vertexDiagonal (restrict K R) L p hpR y = vertexDiagonal K L p hp x := by + apply Subtype.ext + exact congrArg (Finsupp.mapDomain (fun v => p (v,v))) (congrArg (fun z : Space K => z.1) hy) + have hh := finite_pair_additivity_to (restrict K R) L p hpR y v hyr _ hz (Quotient.mk' r) + subst q + exact hh +end + +open scoped Classical Topology.Homotopy +universe u v w +variable {V : Type u} {W : Type v} +lemma pair_additivity_to (K : PreAbstractSimplicialComplex V) (L : PreAbstractSimplicialComplex W) + (p : V × V → W) (hp : ∀ s t : Face K, (s.1 ×ˢ t.1).image p ∈ L) + (x : Space K) (v : V) (hx : x.1 = Finsupp.single v 1) {N : Type w} [DecidableEq N] [Nonempty N] + (z : Space L) (hz : vertexDiagonal K L p hp x = z) (a : HomotopyGroup N (Space K) x) : + HomotopyFunctor.map (vertexDiagonal K L p hp) hz a = + HomotopyFunctor.map (leftAxis K L p hp x v hx) ((leftAxis_point K L p hp x v hx).trans hz) a * + HomotopyFunctor.map (rightAxis K L p hp x v hx) ((rightAxis_point K L p hp x v hx).trans hz) a := by + subst z + exact pair_additivity K L p hp x v hx a +end UniversalFInfinity.Simplicial + +namespace UniversalFInfinity.Milnor +open Set Metric Topology BigOperators UniversalFInfinity.Simplicial +open scoped Classical Topology.Homotopy +universe u v w +variable {G : Type u} {H : Type v} [Group G] [Group H] +variable (N : Type w) [DecidableEq N] [Nontrivial N] +local instance (priority := 2000) (α : Type*) : DecidableEq (ℕ × α) := Classical.decEq (ℕ × α) + +variable (φ ψ : G →* H) (hc : ∀ g h, Commute (φ g) (ψ h)) (S : Shapes G) +def commutingProduct : G →* H where + toFun g := φ g*ψ g + map_one' := by rw [φ.map_one,ψ.map_one,one_mul] + map_mul' a b := pair_translate_vertex φ ψ hc a b a b + +def addTarget : Shapes H := productShapes φ ψ (basedShapes G S) (basedShapes G S) +def addVertex := pairVertex (fun g h => φ g*ψ h) +include hc in +lemma addValid (s t : Face (stage G S)) : (s.1 ×ˢ t.1).image (addVertex φ ψ) ∈ stage H (addTarget φ ψ S) := + orbitSpan_mono (Finset.subset_insert _ _) (pairFace_controlled φ ψ hc _ _ s t) + +def diagLayer (i : ℕ) := Nat.pair i i +def leftLayer (i : ℕ) := Nat.pair i 0 +def rightLayer (i : ℕ) := Nat.pair 0 i +lemma diagLayer_injective : Function.Injective diagLayer := fun _ _ h => (Nat.pair_eq_pair.mp h).1 +lemma leftLayer_injective : Function.Injective leftLayer := fun _ _ h => (Nat.pair_eq_pair.mp h).1 +lemma rightLayer_injective : Function.Injective rightLayer := fun _ _ h => (Nat.pair_eq_pair.mp h).2 + +lemma addDiagValid (s : Face (stage G S)) : + faceImage (commutingProduct φ ψ hc) diagLayer s.1 ∈ stage H (addTarget φ ψ S) := + diagonal_face _ _ (addVertex φ ψ) (addValid φ ψ hc S) s +include hc in +lemma addLeftValid (s : Face (stage G S)) : + faceImage φ leftLayer s.1 ∈ stage H (addTarget φ ψ S) := by + have hh := leftAxisFace _ _ (addVertex φ ψ) (addValid φ ψ hc S) (stagePoint G S) (0,1) rfl s + change (s.1.image (fun a => (Nat.pair a.1 0,φ a.2))) ∈ stage H (addTarget φ ψ S) + simpa only [addVertex,pairVertex,map_one,mul_one] using hh +include hc in +lemma addRightValid (s : Face (stage G S)) : + faceImage ψ rightLayer s.1 ∈ stage H (addTarget φ ψ S) := by + have hh := rightAxisFace _ _ (addVertex φ ψ) (addValid φ ψ hc S) (stagePoint G S) (0,1) rfl s + change (s.1.image (fun a => (Nat.pair 0 a.1,ψ a.2))) ∈ stage H (addTarget φ ψ S) + simpa only [addVertex,pairVertex,map_one,one_mul] using hh + +lemma addLeftMap : leftAxis _ _ (addVertex φ ψ) (addValid φ ψ hc S) (stagePoint G S) (0,1) rfl = + stageMap φ leftLayer S _ (addLeftValid φ ψ hc S) := by + apply ContinuousMap.ext + intro z + apply Subtype.ext + change z.1.mapDomain _ = z.1.mapDomain _ + congr 1 + funext v + exact Prod.ext rfl (by exact (congrArg (φ v.2 * ·) ψ.map_one).trans (mul_one _)) +lemma addRightMap : rightAxis _ _ (addVertex φ ψ) (addValid φ ψ hc S) (stagePoint G S) (0,1) rfl = + stageMap ψ rightLayer S _ (addRightValid φ ψ hc S) := by + apply ContinuousMap.ext + intro z + apply Subtype.ext + change z.1.mapDomain _ = z.1.mapDomain _ + congr 1 + funext v + exact Prod.ext rfl (by exact (congrArg (· * ψ v.2) φ.map_one).trans (one_mul _)) + +lemma addHom : stageMapHom N (commutingProduct φ ψ hc) diagLayer S _ (addDiagValid φ ψ hc S) rfl = + stageMapHom N φ leftLayer S _ (addLeftValid φ ψ hc S) rfl * + stageMapHom N ψ rightLayer S _ (addRightValid φ ψ hc S) rfl := by + ext a + have hh := pair_additivity_to (stage G S) (stage H (addTarget φ ψ S)) (addVertex φ ψ) (addValid φ ψ hc S) + (stagePoint G S) (0,1) rfl (stagePoint H (addTarget φ ψ S)) + (stageMap_point (commutingProduct φ ψ hc) diagLayer S _ (addDiagValid φ ψ hc S) rfl) a + have hL := HomotopyFunctor.map_congr_maps _ _ + ((leftAxis_point _ _ (addVertex φ ψ) (addValid φ ψ hc S) (stagePoint G S) (0,1) rfl).trans (stageMap_point (commutingProduct φ ψ hc) diagLayer S _ (addDiagValid φ ψ hc S) rfl)) + (stageMap_point φ leftLayer S _ (addLeftValid φ ψ hc S) rfl) (addLeftMap φ ψ hc S) a + have hR := HomotopyFunctor.map_congr_maps _ _ + ((rightAxis_point _ _ (addVertex φ ψ) (addValid φ ψ hc S) (stagePoint G S) (0,1) rfl).trans (stageMap_point (commutingProduct φ ψ hc) diagLayer S _ (addDiagValid φ ψ hc S) rfl)) + (stageMap_point ψ rightLayer S _ (addRightValid φ ψ hc S) rfl) (addRightMap φ ψ hc S) a + exact hh.trans (congrArg₂ (· * ·) hL hR) + +theorem mapValue_product : + mapValue N (commutingProduct φ ψ hc) id S rfl Function.injective_id = + mapValue N φ id S rfl Function.injective_id * mapValue N ψ id S rfl Function.injective_id := by + rw [mapValue_relayer N (commutingProduct φ ψ hc) S id diagLayer Function.injective_id diagLayer_injective rfl rfl, + mapValue_relayer N φ S id leftLayer Function.injective_id leftLayer_injective rfl rfl, + mapValue_relayer N ψ S id rightLayer Function.injective_id rightLayer_injective rfl rfl, + mapValue_eq N (commutingProduct φ ψ hc) diagLayer S _ (addDiagValid φ ψ hc S) rfl diagLayer_injective, + mapValue_eq N φ leftLayer S _ (addLeftValid φ ψ hc S) rfl leftLayer_injective, + mapValue_eq N ψ rightLayer S _ (addRightValid φ ψ hc S) rfl rightLayer_injective] + change value H N _ _ _ = value H N _ _ _ * value H N _ _ _ + rw [←value_mul,addHom N φ ψ hc S] +end UniversalFInfinity.Milnor + +end + +end OAI diff --git a/lean/OAI/GroupTheory/UniversalGroup/SphereHomotopies.lean b/lean/OAI/GroupTheory/UniversalGroup/SphereHomotopies.lean new file mode 100644 index 0000000000000000000000000000000000000000..adbc9e8a87787100bab6db2a0229e397af288b13 --- /dev/null +++ b/lean/OAI/GroupTheory/UniversalGroup/SphereHomotopies.lean @@ -0,0 +1,431 @@ +import OAI.GroupTheory.UniversalGroup.Cylinders + +namespace OAI + +noncomputable section + +open Set Metric Topology BigOperators +open Set Metric Topology +open Set Topology +open Set Metric Topology +open scoped NNReal +open Set Metric Topology +open scoped NNReal ENNReal +open Set Metric Topology +open scoped TensorProduct + +namespace UniversalFInfinity.SphereCube + +section +open Set Metric Topology Cellular +open scoped Topology.Homotopy +universe u v +variable {n : ℕ} {Y : Type u} [TopologicalSpace Y] + +lemma bottom_repr (s : Sphere (n+1)) (h : s.1 0 = -1) : + rimSphere n (rimBottom n (diskTail (boundary (n+1) s))) = s := by + apply Subtype.ext + change (diskCons (diskTail (boundary (n+1) s)) 0).1 = s.1 + exact (congrArg (fun t => (diskCons (diskTail (boundary (n+1) s)) t).1) + (faceTime_eq_zero s h)).symm.trans (congrArg Subtype.val (cons_tail_time (boundary (n+1) s))) +lemma top_repr (s : Sphere (n+1)) (h : s.1 0 = 1) : + top n (diskTail (boundary (n+1) s)) = s := by + apply Subtype.ext + change (diskCons (diskTail (boundary (n+1) s)) 1).1 = s.1 + exact (congrArg (fun t => (diskCons (diskTail (boundary (n+1) s)) t).1) + (faceTime_eq_one s h)).symm.trans (congrArg Subtype.val (cons_tail_time (boundary (n+1) s))) +lemma side_repr (s : Sphere (n+1)) (h : (diskTail (boundary (n+1) s)).1 ∈ sphere 0 1) : + rimSphere n (rimSide n (faceSphere ⟨s,h⟩,faceTime none ⟨s,h⟩)) = s := by + apply Subtype.ext + change (diskCons (diskTail (boundary (n+1) s)) (diskTime (boundary (n+1) s))).1 = s.1 + exact congrArg Subtype.val (cons_tail_time (boundary (n+1) s)) + +variable (F : C(Sphere (n+1),Y)) (g : C(Disk n,Y)) (y : Y) +variable (hr : ∀ x, F (rimSphere n x) = y) (ht : ∀ x, F (top n x) = g x) +variable (H : g.Homotopy (ContinuousMap.const _ y)) +variable (hb : ∀ t s, H (t,boundary n s) = y) + +def nullTopPaths : C(Disk n,C(unitInterval,Y)) := + (H.toContinuousMap.comp ContinuousMap.prodSwap).curry + +def nullSpherePaths : C(Sphere (n+1),C(unitInterval,Y)) := + cylinderBoundaryMap (ContinuousMap.const _ (ContinuousMap.const _ (ContinuousMap.const _ y))) + ((ContinuousMap.const _ (ContinuousMap.const _ y)).prodMk (nullTopPaths g y H)) (by + intro s + apply Prod.ext + · rfl + · apply ContinuousMap.ext + intro t + exact (hb t s).symm) + +include hr ht in +lemma nullSphere_zero (s : Sphere (n+1)) : nullSpherePaths g y H hb s 0 = F s := by + rcases sphere_split s with h | h | h + · rw [nullSpherePaths,cylinderBoundaryMap_face _ _ _ (some false) ⟨s,h⟩] + change y = F s + rw [← bottom_repr s h,hr] + · rw [nullSpherePaths,cylinderBoundaryMap_face _ _ _ (some true) ⟨s,h⟩] + change H (0,diskTail (boundary (n+1) s)) = F s + rw [ContinuousMap.Homotopy.apply_zero,← ht,top_repr s h] + · rw [nullSpherePaths,cylinderBoundaryMap_face _ _ _ none ⟨s,h⟩] + change y = F s + rw [← side_repr s h,hr] + +lemma nullSphere_one (s : Sphere (n+1)) : nullSpherePaths g y H hb s 1 = y := by + rcases sphere_split s with h | h | h + · rw [nullSpherePaths,cylinderBoundaryMap_face _ _ _ (some false) ⟨s,h⟩]; rfl + · rw [nullSpherePaths,cylinderBoundaryMap_face _ _ _ (some true) ⟨s,h⟩] + exact H.apply_one _ + · rw [nullSpherePaths,cylinderBoundaryMap_face _ _ _ none ⟨s,h⟩]; rfl + +def nullSphere : F.Homotopy (ContinuousMap.const _ y) where + toFun p := nullSpherePaths g y H hb p.2 p.1 + continuous_toFun := continuous_eval.comp (((nullSpherePaths g y H hb).continuous.comp continuous_snd).prodMk continuous_fst) + map_zero_left s := nullSphere_zero F g y hr ht H hb s + map_one_left s := nullSphere_one g y H hb s + +end + +section +open Set Metric Topology Cellular +open scoped Topology.Homotopy +universe u v +variable {n : ℕ} {Y : Type u} {Z : Type v} [TopologicalSpace Y] [TopologicalSpace Z] + +def basedDiskLoop (g : C(Disk n,Y)) (y : Y) (hg : ∀ s, g (boundary n s) = y) : GenLoop (Fin n) Y y := + ⟨g.comp (DiskCube.fromCube n),by + intro x hx + exact hg ⟨_,DiskCube.from_boundary n x hx⟩⟩ + +theorem killsSpheres_of_null_cubes [PathConnectedSpace Y] (y : Y) (q : C(Y,Z)) + (hq : ∀ p : GenLoop (Fin n) Y y, + Nonempty ((q.comp p.1).HomotopyRel (ContinuousMap.const _ (q y)) (Cube.boundary (Fin n)))) : + KillsSpheres q (n+1) := by + intro f + obtain ⟨K⟩ := rim_nullhomotopy f y + let g := normalizedTop f y K + let p := basedDiskLoop g y (normalizedTop_boundary f y K) + obtain ⟨L⟩ := hq p + let H : (q.comp g).Homotopy (ContinuousMap.const _ (q y)) := + { toFun := fun v => L (v.1,DiskCube.toCube n v.2) + continuous_toFun := L.continuous.comp + (continuous_fst.prodMk ((DiskCube.toCube n).continuous.comp continuous_snd)) + map_zero_left := by + intro x + change L (0,DiskCube.toCube n x) = _ + rw [L.apply_zero] + change q (g (DiskCube.fromCube n (DiskCube.toCube n x))) = q (g x) + rw [DiskCube.from_to] + map_one_left := by intro x; exact L.apply_one _ } + have hb : ∀ t s, H (t,boundary n s) = q y := by + intro t s + exact L.eq_snd t (DiskCube.to_boundary n s) + let J := nullSphere ((q.comp (normalizedSphere f y K))) (q.comp g) (q y) + (fun x => congrArg q (normalizedSphere_rim f y K x)) + (fun x => congrArg q (normalizedSphere_top f y K x)) H hb + let N := (ContinuousMap.Homotopy.refl q).comp (normalizeHomotopy f y K) + let : Nonempty (SphereTopology.Sphere (n+1)) := SphereTopology.sphere_nonempty n + obtain ⟨F,hF⟩ := SphereTopology.extends_of_nullhomotopic (N.trans J).symm + exact ⟨F,fun x => ContinuousMap.congr_fun hF x⟩ + +end + +open scoped Topology Topology.Homotopy +universe u v +variable {n : ℕ} {Y : Type u} {Z : Type v} [TopologicalSpace Y] [TopologicalSpace Z] +lemma killsSpheres_of_homotopy_zero [Nonempty (Fin n)] [PathConnectedSpace Y] + (y : Y) (q : C(Y,Z)) + (hq : ∀ a : HomotopyGroup (Fin n) Y y, HomotopyFunctor.map q rfl a = 1) : + Cellular.KillsSpheres q (n+1) := by + apply killsSpheres_of_null_cubes y q + intro p + have hh := hq (Quotient.mk' p) + change Quotient.mk' (HomotopyFunctor.loopMap q rfl p) = Quotient.mk' GenLoop.const at hh + exact Quotient.exact hh +end UniversalFInfinity.SphereCube + +namespace UniversalFInfinity.Cellular +open Set Metric Topology +universe u v +variable {X : Type u} [TopologicalSpace X] [T2Space X] [CWComplex (Set.univ : Set X)] +variable (Y : ℕ → Type v) [∀ i,TopologicalSpace (Y i)] (q : ∀ i,C(Y i,Y (i+1))) + +def towerComposite (f : C(X,Y 0)) : ∀ i,C(X,Y i) + | 0 => f + | i+1 => (q i).comp (towerComposite f i) + +variable (f g : C(X,Y 0)) (hq : ∀ i,KillsSpheres (q i) (i+1)) + +def towerPartialHomotopy : ∀ i,PartialHomotopy (C := (Set.univ : Set X)) + (towerComposite Y q f i) (towerComposite Y q g i) i + | 0 => PartialHomotopy.start f g + | i+1 => (towerPartialHomotopy i).next (q i) (hq i) + +def towerHomotopy (d : ℕ) (hd : Skeleton (Set.univ : Set X) d = Set.univ) : + (towerComposite Y q f d).Homotopy (towerComposite Y q g d) := + (towerPartialHomotopy Y q f g hq d).toHomotopy hd + +end UniversalFInfinity.Cellular + +namespace UniversalFInfinity.SphereCube +open Set Metric Topology Cellular +open scoped Topology.Homotopy +universe u v w +variable {n : ℕ} {X : Type u} {Y : Type v} {Z : Type w} + [TopologicalSpace X] [TopologicalSpace Y] [TopologicalSpace Z] + +lemma rim_nullhomotopy_of_joined (r : C(X,Y)) (y : Y) + (hy : ∀ x, Joined (r x) y) (f : C(Sphere (n+1),X)) : + Nonempty (((r.comp f).comp (rimSphere n)).Homotopy (ContinuousMap.const _ y)) := by + let := rim_contractible n + obtain ⟨p,⟨H⟩⟩ := id_nullhomotopic (Cylinder.Rim n) + let F := (r.comp f).comp (rimSphere n) + let K := (ContinuousMap.Homotopy.refl F).comp H + let q : Path (F p) y := (hy (f (rimSphere n p))).somePath + let L : (ContinuousMap.const (Cylinder.Rim n) (F p)).Homotopy (ContinuousMap.const _ y) := + { toFun := fun z => q z.1 + continuous_toFun := q.continuous.comp continuous_fst + map_zero_left := fun _ => q.source + map_one_left := fun _ => q.target } + exact ⟨K.trans L⟩ + +lemma fills_of_rim_nullhomotopy (y : Y) (q : C(Y,Z)) + (hq : ∀ p : GenLoop (Fin n) Y y, + Nonempty ((q.comp p.1).HomotopyRel (ContinuousMap.const _ (q y)) (Cube.boundary (Fin n)))) + (f : C(Sphere (n+1),Y)) + (K : (f.comp (rimSphere n)).Homotopy (ContinuousMap.const _ y)) : + ∃ F : C(Disk (n+1),Z), ∀ x, F (boundary (n+1) x) = q (f x) := by + let g := normalizedTop f y K + let p := basedDiskLoop g y (normalizedTop_boundary f y K) + obtain ⟨L⟩ := hq p + let H : (q.comp g).Homotopy (ContinuousMap.const _ (q y)) := + { toFun := fun v => L (v.1,DiskCube.toCube n v.2) + continuous_toFun := L.continuous.comp + (continuous_fst.prodMk ((DiskCube.toCube n).continuous.comp continuous_snd)) + map_zero_left := by + intro x + change L (0,DiskCube.toCube n x) = _ + rw [L.apply_zero] + change q (g (DiskCube.fromCube n (DiskCube.toCube n x))) = q (g x) + rw [DiskCube.from_to] + map_one_left := by intro x; exact L.apply_one _ } + have hb : ∀ t s, H (t,boundary n s) = q y := by + intro t s + exact L.eq_snd t (DiskCube.to_boundary n s) + let J := nullSphere (q.comp (normalizedSphere f y K)) (q.comp g) (q y) + (fun x => congrArg q (normalizedSphere_rim f y K x)) + (fun x => congrArg q (normalizedSphere_top f y K x)) H hb + let N := (ContinuousMap.Homotopy.refl q).comp (normalizeHomotopy f y K) + let : Nonempty (SphereTopology.Sphere (n+1)) := SphereTopology.sphere_nonempty n + obtain ⟨F,hF⟩ := SphereTopology.extends_of_nullhomotopic (N.trans J).symm + exact ⟨F,fun x => ContinuousMap.congr_fun hF x⟩ + +lemma killsSpheres_of_connected_image [Nonempty (Fin n)] (r : C(X,Y)) (y : Y) + (hy : ∀ x, Joined (r x) y) (q : C(Y,Z)) (z : Z) (hbase : q y = z) + (hq : ∀ a : HomotopyGroup (Fin n) Y y, HomotopyFunctor.map q hbase a = 1) : + KillsSpheres (q.comp r) (n+1) := by + subst z + intro f + obtain ⟨K⟩ := rim_nullhomotopy_of_joined r y hy f + apply fills_of_rim_nullhomotopy y q (fun p => ?_) (r.comp f) K + have hh := hq (Quotient.mk' p) + change Quotient.mk' (HomotopyFunctor.loopMap q rfl p) = Quotient.mk' GenLoop.const at hh + exact Quotient.exact hh +end UniversalFInfinity.SphereCube + +namespace UniversalFInfinity.Cellular +open Set Metric Topology +universe u v w +variable {X : Type u} {Y : Type v} {Z : Type w} + [TopologicalSpace X] [TopologicalSpace Y] [TopologicalSpace Z] +lemma KillsSpheres.post {q : C(X,Y)} {n : ℕ} (hq : KillsSpheres q n) (r : C(Y,Z)) : + KillsSpheres (r.comp q) n := by + intro a + obtain ⟨d,hd⟩ := hq a + exact ⟨r.comp d,fun x => congrArg r (hd x)⟩ +lemma joined_of_killsSpheres_one (q : C(X,Y)) (hq : KillsSpheres q 1) (x y : X) : + Joined (q x) (q y) := by + classical + let a : C(Sphere 1,X) := ⟨fun s => if s = Cayley.minus then x else y,continuous_of_discreteTopology⟩ + obtain ⟨d,hd⟩ := hq a + have hm : a Cayley.minus = x := ite_eq_left rfl + have hp : a Cayley.plus = y := by + apply ite_eq_right + intro h + have := congrArg (fun z : Sphere 1 => z.1 0) h + norm_num [Cayley.plus,Cayley.minus] at this + have hh := (PathConnectedSpace.joined (boundary 1 Cayley.minus) (boundary 1 Cayley.plus)).map d.continuous + rw [hd,hd,hm,hp] at hh + exact hh +end UniversalFInfinity.Cellular +namespace UniversalFInfinity.Milnor + +section +open Set Metric Topology Cellular UniversalFInfinity.Simplicial ConcreteEnvelopes +open scoped Topology.Homotopy +variable {G : Type} [Group G] [Group.IsFinitelyPresented G] + [TopologicalSpace G] [DiscreteTopology G] +local instance (priority := 2000) (α : Type*) : DecidableEq (ℕ × α) := Classical.decEq (ℕ × α) + +lemma uniform_low_fp (S : Shapes G) : + ∃ (T : Shapes G) (hST : S ⊆ T), ∀ n : ℕ, n = 1 ∨ n = 2 → + KillsSpheres (stageIncl G S T hST) n := by + obtain ⟨m,q,hq,R,hR,hker⟩ := Group.IsFinitelyPresented.out (G := G) + let s : Fin m → G := fun i => q (FreeGroup.of i) + have hs : FreeGroup.lift s = q := by + apply FreeGroup.ext_hom + intro i + exact FreeGroup.lift_apply_of + have hrel : ∀ r ∈ R, FreeGroup.lift s r = 1 := by + intro r hr + rw [hs] + exact show r ∈ q.ker from hker.symm ▸ Subgroup.subset_normalClosure hr + apply uniform_low_connectivity s R hrel hR + · rwa [hs] + · rw [hs]; exact hker.symm + +def Represents {S T : Shapes G} (f : G →* G) (q : C(Stage G S,Stage G T)) : Prop := + ∀ x, (q x).1 = x.1.mapDomain (vertexMap f id) + +lemma uniform_diagram_sphere_ghost (k : Index → G →* G) (hk : IsDiagram k) + (S : Shapes G) (n : ℕ) : + ∃ (T : Shapes G) (q : C(Stage G S,Stage G T)), + Represents (k (.inl P₂.identity)) q ∧ KillsSpheres q n := by + classical + let f := k (.inl P₂.identity) + obtain ⟨R,hSR,hR⟩ := uniform_low_fp S + let e := stageIncl G S R hSR + rcases Nat.eq_zero_or_pos n with rfl | hn + · let T := imageShapes f id (basedShapes G R) + let a := stageMap f id R T (image_stage_valid f id R Function.injective_id) + refine ⟨T,a.comp e,fun _ => rfl,?_⟩ + intro b + let : Nonempty (Stage G T) := ⟨stagePoint G T⟩ + obtain ⟨d,hd⟩ := SphereTopology.fill_zero (a.comp (e.comp b)) + exact ⟨d,hd⟩ + obtain hn | hn := (lt_or_ge n 3) + · let T := imageShapes f id (basedShapes G R) + let a := stageMap f id R T (image_stage_valid f id R Function.injective_id) + refine ⟨T,a.comp e,fun _ => rfl,?_⟩ + exact (hR n (by omega)).post a + · let m := n-1 + have hm : n = m+1 := by omega + have hm2 : 2 ≤ m := by omega + let : Nonempty (Fin m) := Fin.pos_iff_nonempty.mp (by omega) + let : Nontrivial (Fin m) := Fin.nontrivial_iff_two_le.mpr hm2 + obtain ⟨T,hT,hzero⟩ := diagram_uniform_homotopy_killing (Fin m) k hk R + let a := (stageIncl G _ T hT).comp + (stageMap f id R _ (image_stage_valid f id R Function.injective_id)) + have ha : a (stagePoint G R) = stagePoint G T := by + change stageIncl G _ T hT (stageMap f id R _ _ (stagePoint G R)) = _ + rw [stageMap_point f id R _ _ rfl] + rfl + have hz : ∀ z : HomotopyGroup (Fin m) (Stage G R) (stagePoint G R), + HomotopyFunctor.map a ha z = 1 := by + intro z + have hz := DFunLike.congr_fun hzero z + change HomotopyFunctor.map (stageIncl G _ T hT) rfl + (HomotopyFunctor.map (stageMap f id R _ _) (stageMap_point f id R _ _ rfl) z) = 1 at hz + rw [HomotopyFunctor.map_comp] at hz + exact hz + refine ⟨T,a.comp e,fun _ => rfl,?_⟩ + rw [hm] + apply SphereCube.killsSpheres_of_connected_image e (stagePoint G R) ?_ a (stagePoint G T) ha hz + intro x + exact joined_of_killsSpheres_one e (hR 1 (Or.inl rfl)) x (stagePoint G S) +end +open Set Metric Topology Cellular UniversalFInfinity.Simplicial ConcreteEnvelopes +variable {G : Type} [Group G] [Group.IsFinitelyPresented G] + [TopologicalSpace G] [DiscreteTopology G] +local instance (priority := 2000) (α : Type*) : DecidableEq (ℕ × α) := Classical.decEq (ℕ × α) + +omit [Group.IsFinitelyPresented G] [TopologicalSpace G] [DiscreteTopology G] in +lemma stage_bounded_dimension (S : Shapes G) : + ∃ d : ℕ, Skeleton (univ : Set (Stage G S)) d = univ := by + classical + let d := (basedShapes G S).sup Finset.card + refine ⟨d,Set.eq_univ_of_forall (fun x => ?_)⟩ + have hx : x ∈ (univ : Set (Stage G S)) := Set.mem_univ _ + rw [←CWComplex.iUnion_openCell_eq_complex (C := (univ : Set (Stage G S)))] at hx + simp only [Set.mem_iUnion] at hx + obtain ⟨n,i,hi⟩ := hx + obtain ⟨g,s,hs,his⟩ := i.1.2.2 + have hn : n < d := by + have hcard := Finset.card_le_card his + rw [translate_card] at hcard + rw [i.2] at hcard + have hd := Finset.le_sup (f := Finset.card) hs + omega + exact CWComplex.skeletonLT_mono (C := (univ : Set (Stage G S))) + (m := (n : ℕ∞)+1) (n := (d : ℕ∞)) (by exact_mod_cast Nat.succ_le_of_lt hn) + (CWComplex.closedCell_subset_skeletonLT n i (CWComplex.openCell_subset_closedCell n i hi)) + +omit [Group.IsFinitelyPresented G] [TopologicalSpace G] [DiscreteTopology G] in +lemma Represents.comp {S T R : Shapes G} {f g : G →* G} + {q : C(Stage G S,Stage G T)} {r : C(Stage G T,Stage G R)} + (hr : Represents g r) (hq : Represents f q) : Represents (g.comp f) (r.comp q) := by + intro x + rw [show (r.comp q) x = r (q x) from rfl,hr,hq,←Finsupp.mapDomain_comp] + rfl + +omit [Group.IsFinitelyPresented G] [TopologicalSpace G] [DiscreteTopology G] in +lemma Represents.id (S : Shapes G) : Represents (MonoidHom.id G) (ContinuousMap.id (Stage G S)) := by + intro x + change x.1 = x.1.mapDomain _root_.id + exact (Finsupp.mapDomain_id).symm + +def iterateHom {G : Type*} [Group G] (f : G →* G) : ℕ → G →* G + | 0 => MonoidHom.id G + | n+1 => f.comp (iterateHom f n) + +variable (k : Index → G →* G) (hk : IsDiagram k) +def ghostShapes (S : Shapes G) : ℕ → Shapes G + | 0 => S + | n+1 => (uniform_diagram_sphere_ghost k hk (ghostShapes S n) (n+1)).choose + +def ghostMap (S : Shapes G) (n : ℕ) : + C(Stage G (ghostShapes k hk S n),Stage G (ghostShapes k hk S (n+1))) := + (uniform_diagram_sphere_ghost k hk (ghostShapes k hk S n) (n+1)).choose_spec.choose +lemma ghostMap_represents (S : Shapes G) (n : ℕ) : + Represents (k (.inl P₂.identity)) (ghostMap k hk S n) := + (uniform_diagram_sphere_ghost k hk (ghostShapes k hk S n) (n+1)).choose_spec.choose_spec.1 +lemma ghostMap_kills (S : Shapes G) (n : ℕ) : KillsSpheres (ghostMap k hk S n) (n+1) := + (uniform_diagram_sphere_ghost k hk (ghostShapes k hk S n) (n+1)).choose_spec.choose_spec.2 + +lemma ghostComposite_represents (S : Shapes G) (n : ℕ) : + Represents (iterateHom (k (.inl P₂.identity)) n) + (towerComposite (fun i => Stage G (ghostShapes k hk S i)) (ghostMap k hk S) + (ContinuousMap.id (Stage G S)) n) := by + induction n with + | zero => exact Represents.id S + | succ n ih => + exact (ghostMap_represents k hk S n).comp ih + +include hk in + +theorem diagram_uniform_stage_nullhomotopy (S : Shapes G) : + ∃ (d : ℕ) (T : Shapes G) (q : C(Stage G S,Stage G T)) (z : Stage G T), + Represents (iterateHom (k (.inl P₂.identity)) d) q ∧ + Nonempty (q.Homotopy (ContinuousMap.const _ z)) := by + obtain ⟨d,hd⟩ := stage_bounded_dimension S + let Y : ℕ → Type := fun i => Stage G (ghostShapes k hk S i) + let q := ghostMap k hk S + let a := towerComposite Y q (ContinuousMap.id (Stage G S)) d + let b := towerComposite Y q (ContinuousMap.const (Stage G S) (stagePoint G S)) d + have hb : ∀ x,b x = a (stagePoint G S) := by + intro x + change towerComposite Y q (ContinuousMap.const (Stage G S) (stagePoint G S)) d x = + towerComposite Y q (ContinuousMap.id (Stage G S)) d (stagePoint G S) + clear hd a b + induction d with + | zero => rfl + | succ d ih => exact congrArg (q d) ih + refine ⟨d,ghostShapes k hk S d,a,a (stagePoint G S),ghostComposite_represents k hk S d,?_⟩ + have H := towerHomotopy Y q (ContinuousMap.id (Stage G S)) + (ContinuousMap.const (Stage G S) (stagePoint G S)) (ghostMap_kills k hk S) d hd + exact ⟨H.cast rfl (ContinuousMap.ext hb)⟩ +end UniversalFInfinity.Milnor + +end + +end OAI diff --git a/lean/OAI/GroupTheory/UniversalGroup/StackMachines.lean b/lean/OAI/GroupTheory/UniversalGroup/StackMachines.lean new file mode 100644 index 0000000000000000000000000000000000000000..ca6dfa3aaa6131e79d8e19917890a248c031e516 --- /dev/null +++ b/lean/OAI/GroupTheory/UniversalGroup/StackMachines.lean @@ -0,0 +1,478 @@ +import OAI.GroupTheory.UniversalGroup.MarkerMachine + +namespace OAI + +universe u v w x + +namespace Higman.IntegerStack +variable {E : Type*} + +def code (b : ℤ) (d : E → ℤ) : List E → ℤ + | [] => 1 + | e :: s => b * code b d s + d e + +@[simp] theorem code_nil (b : ℤ) (d : E → ℤ) : code b d [] = 1 := rfl +@[simp] theorem code_cons (b : ℤ) (d : E → ℤ) (e : E) (s : List E) : + code b d (e :: s) = b * code b d s + d e := rfl + +variable (b : ℤ) (d : E → ℤ) (hb : 2 ≤ b) + (hd : ∀ e, 2 ≤ d e ∧ d e < b) + +include hd + +lemma push_mod (e : E) (z : ℤ) : (b * z + d e) % b = d e := by + rw [Int.add_emod,Int.mul_emod_right,zero_add,Int.emod_emod, + Int.emod_eq_of_lt (by have := (hd e).1; omega) (hd e).2] + +include hb + +lemma push_ne_empty (e : E) (z : ℤ) : b * z + d e ≠ 1 := by + intro h + have he := congrArg (fun x : ℤ ↦ x % b) h + rw [push_mod b d hd,Int.emod_eq_of_lt (by omega) (by omega)] at he + have := (hd e).1 + omega + +lemma push_injective (hdinj : Function.Injective d) {e f : E} {z w : ℤ} + (h : b * z + d e = b * w + d f) : e = f ∧ z = w := by + have he := congrArg (fun x : ℤ ↦ x % b) h + rw [push_mod b d hd,push_mod b d hd] at he + have hef := hdinj he + subst f + refine ⟨rfl,?_⟩ + have hm : b * z = b * w := by omega + exact mul_left_cancel₀ (by omega : b ≠ 0) hm + +theorem decode_push (hdinj : Function.Injective d) (e : E) (z : ℤ) (s : List E) : + b * z + d e = code b d s ↔ ∃ t, s = e :: t ∧ z = code b d t := by + cases s with + | nil => simp [push_ne_empty b d hb hd e z] + | cons f t => + constructor + · intro h + obtain ⟨hef,hzt⟩ := push_injective b d hb hd hdinj h + subst f + exact ⟨t,rfl,hzt⟩ + · rintro ⟨u,hu,hz⟩ + cases hu + simp [hz] + +theorem code_injective (hdinj : Function.Injective d) : Function.Injective (code b d) := by + intro s + induction s with + | nil => + intro t h + cases t with + | nil => rfl + | cons e t => exact False.elim (push_ne_empty b d hb hd e (code b d t) h.symm) + | cons e s ih => + intro t h + obtain ⟨u,rfl,hu⟩ := (decode_push b d hb hd hdinj e (code b d s) t).mp h + exact congrArg (List.cons e) (ih hu) + +theorem code_pos (s : List E) : 0 < code b d s := by + induction s with + | nil => simp + | cons e s ih => + have hm : 0 < b * code b d s := mul_pos (by omega) ih + have hh := (hd e).1 + rw [code_cons] + omega + +end Higman.IntegerStack + +namespace Higman.HistoryMachine +variable {E : Type*} {C : Type*} {D : E → Type*} + +inductive Run (input output : (e : E) → D e → C) (initial : C) : List E → C → Prop + | start : Run input output initial [] initial + | step {s : List E} (e : E) (z : D e) : + Run input output initial s (input e z) → Run input output initial (e :: s) (output e z) + +variable (input output : (e : E) → D e → C) (initial : C) + +@[simp] theorem run_nil (c : C) : Run input output initial [] c ↔ c = initial := by + constructor + · intro h + cases h + rfl + · rintro rfl + exact Run.start + +@[simp] theorem run_cons (e : E) (s : List E) (c : C) : + Run input output initial (e :: s) c ↔ + ∃ z : D e, c = output e z ∧ Run input output initial s (input e z) := by + constructor + · intro h + cases h with + | step e z h => exact ⟨z,rfl,h⟩ + · rintro ⟨z,rfl,h⟩ + exact Run.step e z h + +def Reach (b : ℤ) (digit : E → ℤ) (c : C) (history : ℤ) : Prop := + ∃ s, Run input output initial s c ∧ history = IntegerStack.code b digit s + +variable (b : ℤ) (digit : E → ℤ) (hb : 2 ≤ b) + (hd : ∀ e, 2 ≤ digit e ∧ digit e < b) (hinj : Function.Injective digit) + +lemma reach_start : Reach input output initial b digit initial 1 := ⟨[],Run.start,rfl⟩ + +include hb hd hinj in + +theorem reach_step_iff (hout : ∀ e, Function.Injective (output e)) (e : E) (z : D e) + (h : ℤ) : + Reach input output initial b digit (output e z) (b * h + digit e) ↔ + Reach input output initial b digit (input e z) h := by + constructor + · rintro ⟨s,hs,he⟩ + obtain ⟨t,rfl,ht⟩ := (IntegerStack.decode_push b digit hb hd hinj e h s).mp he + obtain ⟨y,hy,hr⟩ := (run_cons input output initial e t (output e z)).mp hs + have hzy : z = y := hout e hy + subst y + exact ⟨t,hr,ht⟩ + · rintro ⟨s,hs,rfl⟩ + exact ⟨e :: s,Run.step e z hs,rfl⟩ + +variable {G : Type*} [Group G] + +def value (weight : E → G) : List E → G + | [] => 1 + | e :: s => value weight s * weight e + +noncomputable def decoration (weight : E → G) (h : ℤ) : G := by + classical + exact if hh : ∃ s, h = IntegerStack.code b digit s then value weight hh.choose else 1 + +include hb hd hinj in +@[simp] theorem decoration_code (weight : E → G) (s : List E) : + decoration b digit weight (IntegerStack.code b digit s) = value weight s := by + classical + unfold decoration + split_ifs with h + · have he : h.choose = s := + IntegerStack.code_injective b digit hb hd hinj h.choose_spec.symm + rw [he] + · exact False.elim (h ⟨s,rfl⟩) + +include hb hd hinj in +lemma decoration_step (weight : E → G) (e : E) (z : D e) (h : ℤ) + (hr : Reach input output initial b digit (input e z) h) : + decoration b digit weight (b * h + digit e) = decoration b digit weight h * weight e := by + obtain ⟨s,_,rfl⟩ := hr + rw [← IntegerStack.code_cons,decoration_code b digit hb hd hinj, + decoration_code b digit hb hd hinj] + rfl + +end Higman.HistoryMachine + +namespace Higman.RecordedMachine + +section +open MarkerMachine +abbrev Counter := Multiplicative ℤ + +def scale (b : ℤ) : Counter →* Counter where + toFun x := Multiplicative.ofAdd (b * x.toAdd) + map_one' := by simp + map_mul' x y := by simp [mul_add] + +lemma scale_injective (b : ℤ) (hb : b ≠ 0) : Function.Injective (scale b) := by + intro x y h + change x.toAdd = y.toAdd + exact mul_left_cancel₀ hb (congrArg Multiplicative.toAdd h) + +variable {G T Q : Type u} [Group G] + +def augment (c : T × Q) (h : ℤ) : (T × Counter) × Q := ((c.1,Multiplicative.ofAdd h),c.2) +def forget (c : (T × Counter) × Q) : T × Q := (c.1.1,c.2) +def history (c : (T × Counter) × Q) : ℤ := c.1.2.toAdd + +@[simp] lemma forget_augment (c : T × Q) (h : ℤ) : forget (augment c h) = c := rfl +@[simp] lemma history_augment (c : T × Q) (h : ℤ) : history (augment c h) = h := rfl +@[simp] lemma augment_forget (c : (T × Counter) × Q) : augment (forget c) (history c) = c := rfl + +variable [Group T] + +def edge (e : Edge G T Q) (b digit : ℤ) (hb : b ≠ 0) : Edge G (T × Counter) Q where + Domain := e.Domain × Counter + inputLinear := e.inputLinear.prodMap (MonoidHom.id Counter) + outputLinear := e.outputLinear.prodMap (scale b) + input_injective := by + intro x y h + exact Prod.ext (e.input_injective (congrArg Prod.fst h)) (congrArg (fun p : T × Counter ↦ p.2) h) + output_injective := by + intro x y h + exact Prod.ext (e.output_injective (congrArg Prod.fst h)) + (scale_injective b hb (congrArg Prod.snd h)) + inputOffset := (e.inputOffset,1) + outputOffset := (e.outputOffset,Multiplicative.ofAdd digit) + inputState := e.inputState + outputState := e.outputState + weight := e.weight + +@[simp] lemma edge_input (e : Edge G T Q) (b digit : ℤ) (hb : b ≠ 0) (d : e.Domain) (h : Counter) : + (edge e b digit hb).input (d,h) = augment (e.input d) h.toAdd := by + change ((e.inputLinear d, h) * (e.inputOffset, 1), e.inputState) = _ + simp only [Prod.mul_def, mul_one] + rfl +@[simp] lemma edge_output (e : Edge G T Q) (b digit : ℤ) (hb : b ≠ 0) (d : e.Domain) (h : Counter) : + (edge e b digit hb).output (d,h) = + augment (e.output d) (b * h.toAdd + digit) := rfl + +variable {E : Type u} [Fintype E] (edges : E → Edge G T Q) + (b : ℤ) (digit : E → ℤ) (hb : 2 ≤ b) + +noncomputable def edgeList : List (Edge G (T × Counter) Q) := + Finset.univ.toList.map (fun e ↦ edge (edges e) b (digit e) (by omega)) + +lemma mem_edgeList (e : E) : edge (edges e) b (digit e) (by omega) ∈ edgeList edges b digit hb := by + classical + exact List.mem_map.mpr ⟨e,Finset.mem_toList.mpr (Finset.mem_univ _),rfl⟩ + +lemma of_mem_edgeList (a : Edge G (T × Counter) Q) (ha : a ∈ edgeList edges b digit hb) : + ∃ e, a = edge (edges e) b (digit e) (by omega) := by + obtain ⟨e,_,rfl⟩ := List.mem_map.mp ha + exact ⟨e,rfl⟩ + +variable (seed : T × Q) + +def Forward (c : (T × Counter) × Q) : Prop := + HistoryMachine.Reach (fun e ↦ (edges e).input) (fun e ↦ (edges e).output) seed b digit + (forget c) (history c) + +omit [Fintype E] in +lemma forward_start : Forward edges b digit seed (augment seed 1) := + HistoryMachine.reach_start _ _ _ _ _ + +variable (hd : ∀ e, 2 ≤ digit e ∧ digit e < b) (hinj : Function.Injective digit) + +lemma output_injective (e : Edge G T Q) : Function.Injective e.output := by + intro x y h + exact e.output_injective (mul_right_cancel (congrArg Prod.fst h)) + +include hb hd hinj in +omit [Fintype E] in +lemma forward_edge (e : E) (d : (edges e).Domain) (h : ℤ) : + Forward edges b digit seed (augment ((edges e).output d) (b*h + digit e)) ↔ + Forward edges b digit seed (augment ((edges e).input d) h) := + HistoryMachine.reach_step_iff _ _ _ b digit hb hd hinj + (fun e ↦ output_injective (edges e)) e d h + +include hd hinj in +lemma reach_implies_forward (c : (T × Counter) × Q) + (hc : MarkerMachine.Reach (edgeList edges b digit hb) (augment seed 1) c) : + Forward edges b digit seed c := by + induction hc with + | start => exact forward_start edges b digit seed + | forward a ha d _ ih => + obtain ⟨e,rfl⟩ := of_mem_edgeList edges b digit hb a ha + obtain ⟨d,h⟩ := d + change Counter at h + simpa only [edge_output] using + (forward_edge edges b digit hb seed hd hinj e d h.toAdd).mpr + (by simpa only [edge_input] using ih) + | backward a ha d _ ih => + obtain ⟨e,rfl⟩ := of_mem_edgeList edges b digit hb a ha + obtain ⟨d,h⟩ := d + change Counter at h + simpa only [edge_input] using + (forward_edge edges b digit hb seed hd hinj e d h.toAdd).mp + (by simpa only [edge_output] using ih) + +lemma run_implies_reach {s : List E} {c : T × Q} + (hc : HistoryMachine.Run (fun e ↦ (edges e).input) (fun e ↦ (edges e).output) seed s c) : + MarkerMachine.Reach (edgeList edges b digit hb) (augment seed 1) + (augment c (IntegerStack.code b digit s)) := by + induction hc with + | start => exact MarkerMachine.Reach.start + | @step s e d hr ih => + have hh := MarkerMachine.Reach.forward (seed := augment seed 1) + (edge (edges e) b (digit e) (by omega)) (mem_edgeList edges b digit hb e) + (d,Multiplicative.ofAdd (IntegerStack.code b digit s)) + rw [edge_input,edge_output] at hh + exact hh ih + +lemma forward_implies_reach (c : (T × Counter) × Q) (hc : Forward edges b digit seed c) : + MarkerMachine.Reach (edgeList edges b digit hb) (augment seed 1) c := by + obtain ⟨s,hs,hh⟩ := hc + have hr := run_implies_reach edges b digit hb seed hs + rw [← hh,augment_forget] at hr + exact hr + +include hd hinj in + +theorem reach_iff_forward (c : (T × Counter) × Q) : + MarkerMachine.Reach (edgeList edges b digit hb) (augment seed 1) c ↔ + Forward edges b digit seed c := + ⟨reach_implies_forward edges b digit hb seed hd hinj c, + forward_implies_reach edges b digit hb seed c⟩ + +end + +open MarkerMachine DecoratedMarker MarkerEmbedding +variable {G T Q E : Type u} [Group G] [Group T] [Fintype E] + (edges : E → Edge G T Q) (b : ℤ) (digit : E → ℤ) (hb : 2 ≤ b) + (seed : T × Q) (hd : ∀ e, 2 ≤ digit e ∧ digit e < b) (hinj : Function.Injective digit) + +noncomputable def decoration (c : (T × Counter) × Q) : G := + HistoryMachine.decoration b digit (fun e ↦ (edges e).weight) (history c) + +include hd hinj in +lemma decoration_edge (a : Edge G (T × Counter) Q) (ha : a ∈ edgeList edges b digit hb) + (d : a.Domain) (hr : MarkerMachine.Reach (edgeList edges b digit hb) (augment seed 1) (a.input d)) : + decoration edges b digit (a.output d) = decoration edges b digit (a.input d) * a.weight := by + obtain ⟨e,rfl⟩ := of_mem_edgeList edges b digit hb a ha + obtain ⟨d,h⟩ := d + have hf := reach_implies_forward edges b digit hb seed hd hinj _ hr + rw [edge_input] at hf ⊢ + rw [edge_output] + exact HistoryMachine.decoration_step (fun e ↦ (edges e).input) (fun e ↦ (edges e).output) + seed b digit hb hd hinj + (fun e ↦ (edges e).weight) e d h.toAdd hf + +include hb hd hinj in + +theorem benign_forward [Group.IsFinitelyPresented G] [Group.IsFinitelyPresented T] [Finite Q] + (hD : ∀ e, Group.IsFinitelyPresented (edges e).Domain) : + IsBenign (decoratedSubgroup (decoration edges b digit) {c | Forward edges b digit seed c}) := by + have : Group.IsFinitelyPresented (T × Counter) := finitelyPresented_prod + have he : {c | MarkerMachine.Reach (edgeList edges b digit hb) (augment seed 1) c} = + {c | Forward edges b digit seed c} := by + ext c + exact reach_iff_forward edges b digit hb seed hd hinj c + rw [← he] + apply MarkerMachine.benign _ _ _ _ (decoration_edge edges b digit hb seed hd hinj) + intro a ha + obtain ⟨e,rfl⟩ := of_mem_edgeList edges b digit hb a ha + have := hD e + exact finitelyPresented_prod + +end Higman.RecordedMachine + +namespace Higman.MarkerEmbedding +open Monoid Coprod DecoratedMarker +variable {G T : Type u} {Q : Type*} [Group G] [Group T] + +def coefficientProjection : Base G T Q →* G := Coprod.lift (MonoidHom.fst G T) 1 + +@[simp] lemma projection_coefficient (g : G) : + coefficientProjection (coefficient g : Base G T Q) = g := by + simp [coefficientProjection,coefficient] +@[simp] lemma projection_translation (t : T) : + coefficientProjection (translation t : Base G T Q) = 1 := by + simp [coefficientProjection,translation] +@[simp] lemma projection_marker (t : T) (q : Q) : + coefficientProjection (marker t q : Base G T Q) = 1 := by + simp [coefficientProjection,marker,translation] + +lemma projection_surjective : Function.Surjective (coefficientProjection : Base G T Q →* G) := + fun g ↦ ⟨coefficient g,projection_coefficient g⟩ + +variable {Q : Type u} + +theorem benign_output [Group.IsFinitelyPresented G] [Group.IsFinitelyPresented T] + (v : T × Q → G) (V : Set (T × Q)) (hR : IsBenign (decoratedSubgroup v V)) (q : Q) : + IsBenign (Subgroup.closure (v '' {c | c ∈ V ∧ c.2 = q})) := by + have : Group.IsFinitelyPresented (G × T) := finitelyPresented_prod + let f : Base G T Unit →* Base G T Q := embedding (MonoidHom.id T) (fun _ ↦ 1) + (fun _ ↦ q) (fun _ ↦ 1) + have hi : Function.Injective (index (MonoidHom.id T) (fun _ : Unit ↦ 1) (fun _ ↦ q)) := + index_injective _ Function.injective_id _ _ (Function.injective_of_subsingleton _) + have hB := (hR.comap f).map_surjective + (coefficientProjection : Base G T Unit →* G) + (projection_surjective (G := G) (T := T) (Q := Unit)) + dsimp only [f] at hB + rw [comap_decoratedSubgroup _ Function.injective_id _ _ _ hi, + decoratedSubgroup_eq_closure,MonoidHom.map_closure] at hB + have he : (coefficientProjection : Base G T Unit →* G) '' + ((fun x : T × Unit ↦ coefficient + (pullDecoration (MonoidHom.id T) (fun _ ↦ 1) (fun _ ↦ q) (fun _ ↦ 1) v x) * + marker x.1 x.2) '' + (index (MonoidHom.id T) (fun _ : Unit ↦ 1) (fun _ ↦ q) ⁻¹' V)) = + v '' {c | c ∈ V ∧ c.2 = q} := by + rw [Set.image_image] + ext g + constructor + · rintro ⟨⟨t,p⟩,ht,rfl⟩ + refine ⟨(t,q),⟨?_,rfl⟩,?_⟩ + · simpa [index] using ht + · simp [pullDecoration,index] + · rintro ⟨⟨t,r⟩,⟨hc,hq⟩,rfl⟩ + change r = q at hq + subst r + refine ⟨(t,()),?_,?_⟩ + · simpa [index] using hc + · simp [pullDecoration,index] + rw [he] at hB + exact hB + +end Higman.MarkerEmbedding + +namespace Higman.RecordedMachine +open MarkerMachine +variable {G T Q E : Type u} [Group G] [Group T] + (edges : E → Edge G T Q) (seed : T × Q) (halt : Q) + +def acceptedOutputs : Set G := + {g | ∃ s c, HistoryMachine.Run (fun e ↦ (edges e).input) (fun e ↦ (edges e).output) + seed s c ∧ c.2 = halt ∧ g = HistoryMachine.value (fun e ↦ (edges e).weight) s} + +variable [Fintype E] [Finite Q] [Group.IsFinitelyPresented G] [Group.IsFinitelyPresented T] + +theorem benign_accepted (hD : ∀ e, Group.IsFinitelyPresented (edges e).Domain) : + IsBenign (Subgroup.closure (acceptedOutputs edges seed halt)) := by + classical + let b : ℤ := Fintype.card E + 2 + let digit : E → ℤ := fun e ↦ ((Fintype.equivFin E e).val : ℤ) + 2 + have hb : 2 ≤ b := by dsimp [b]; omega + have hd : ∀ e, 2 ≤ digit e ∧ digit e < b := by + intro e + have hh := (Fintype.equivFin E e).isLt + dsimp [digit,b] + constructor <;> omega + have hi : Function.Injective digit := by + intro e f h + apply (Fintype.equivFin E).injective + apply Fin.ext + dsimp [digit] at h + omega + have : Group.IsFinitelyPresented (T × Counter) := finitelyPresented_prod + have hp := MarkerEmbedding.benign_output (decoration edges b digit) + {c | Forward edges b digit seed c} + (benign_forward edges b digit hb seed hd hi hD) halt + have he : decoration edges b digit '' + {c | c ∈ {c | Forward edges b digit seed c} ∧ c.2 = halt} = + acceptedOutputs edges seed halt := by + ext g + constructor + · rintro ⟨c,⟨⟨s,hs,hh⟩,hc⟩,rfl⟩ + refine ⟨s,forget c,hs,hc,?_⟩ + dsimp [decoration] + rw [hh,HistoryMachine.decoration_code b digit hb hd hi] + · rintro ⟨s,c,hs,hc,rfl⟩ + refine ⟨augment c (IntegerStack.code b digit s),⟨?_,hc⟩,?_⟩ + · exact ⟨s,hs,rfl⟩ + · exact HistoryMachine.decoration_code b digit hb hd hi _ s + rwa [he] at hp + +end Higman.RecordedMachine + +namespace Higman + +theorem finitelyPresented_pi (I : Type u) [Finite I] (G : Type v) [Group G] + [Group.IsFinitelyPresented G] : Group.IsFinitelyPresented (I → G) := by + apply Finite.induction_empty_option _ _ _ I + · intro A B e ih + have := ih + exact Group.IsFinitelyPresented.equiv (MulEquiv.arrowCongr e (MulEquiv.refl G)) + · infer_instance + · intro A _ ih + have := ih + have : Group.IsFinitelyPresented (G × (A → G)) := finitelyPresented_prod + let e : (Option A → G) ≃* G × (A → G) := + { Equiv.piOptionEquivProd with map_mul' := fun _ _ ↦ rfl } + exact Group.IsFinitelyPresented.equiv e.symm + +end Higman + +end OAI diff --git a/lean/OAI/GroupTheory/UniversalGroup/StackPrograms.lean b/lean/OAI/GroupTheory/UniversalGroup/StackPrograms.lean new file mode 100644 index 0000000000000000000000000000000000000000..dad3a4b18b6a36a13363c55fff4f31a6f5d13a89 --- /dev/null +++ b/lean/OAI/GroupTheory/UniversalGroup/StackPrograms.lean @@ -0,0 +1,396 @@ +import OAI.GroupTheory.UniversalGroup.StackMachines + +namespace OAI + +universe u v w x + +namespace Higman.AffineStack + +section +open MarkerMachine +abbrev Counter := Multiplicative ℤ + +def scale (b : ℤ) : Counter →* Counter where + toFun h := Multiplicative.ofAdd (b * h.toAdd) + map_one' := by change Multiplicative.ofAdd (b*0) = Multiplicative.ofAdd 0; simp + map_mul' x y := by + change Multiplicative.ofAdd (b*(x.toAdd+y.toAdd)) = Multiplicative.ofAdd (b*x.toAdd+b*y.toAdd) + rw [mul_add] + +lemma scale_injective (b : ℤ) (hb : b ≠ 0) : Function.Injective (scale b) := by + intro x y h + apply Multiplicative.toAdd.injective + exact mul_left_cancel₀ hb (congrArg Multiplicative.toAdd h) + +inductive Op (Γ : Type) + | push (a : Γ) | pop (a : Γ) | peek (a : Γ) | empty | idle + +variable {Γ G Q : Type} [Group G] + +def Op.Rel : Op Γ → List Γ → List Γ → Prop + | .push a, s, t => t = a :: s + | .pop a, s, t => s = a :: t + | .peek a, s, t => s = t ∧ ∃ r, s = a :: r + | .empty, s, t => s = [] ∧ t = [] + | .idle, s, t => s = t + +def localEdge (b : ℤ) (digit : Γ → ℤ) (hb : b ≠ 0) (p q : Q) (w : G) : + Op Γ → Edge G Counter Q + | .push a => ⟨Counter, MonoidHom.id _, scale b, Function.injective_id, + scale_injective b hb, 1, Multiplicative.ofAdd (digit a),p,q,w⟩ + | .pop a => ⟨Counter, scale b, MonoidHom.id _, scale_injective b hb, + Function.injective_id, Multiplicative.ofAdd (digit a),1,p,q,w⟩ + | .peek a => ⟨Counter, scale b, scale b, scale_injective b hb, + scale_injective b hb, Multiplicative.ofAdd (digit a),Multiplicative.ofAdd (digit a),p,q,w⟩ + | .empty => ⟨PUnit,1,1,Function.injective_of_subsingleton _,Function.injective_of_subsingleton _, + Multiplicative.ofAdd 1,Multiplicative.ofAdd 1,p,q,w⟩ + | .idle => ⟨Counter, MonoidHom.id _,MonoidHom.id _,Function.injective_id, + Function.injective_id,1,1,p,q,w⟩ + +instance localEdge_finitelyPresented (b : ℤ) (digit : Γ → ℤ) (hb : b ≠ 0) (p q : Q) (w : G) + (o : Op Γ) : Group.IsFinitelyPresented (localEdge b digit hb p q w o).Domain := by + cases o with + | empty => exact inferInstanceAs (Group.IsFinitelyPresented PUnit) + | push a | pop a | peek a | idle => exact inferInstanceAs (Group.IsFinitelyPresented Counter) + +variable (b : ℤ) (digit : Γ → ℤ) (hb : 2 ≤ b) + (hd : ∀ a, 2 ≤ digit a ∧ digit a < b) (hi : Function.Injective digit) + +def encode (s : List Γ) : Counter := Multiplicative.ofAdd (IntegerStack.code b digit s) + +include hb hd hi in +lemma encode_injective : Function.Injective (encode b digit) := + fun _ _ h ↦ IntegerStack.code_injective b digit hb hd hi (congrArg Multiplicative.toAdd h) + +include hb hd hi in + +theorem local_sound (p q : Q) (w : G) (o : Op Γ) + (x : (localEdge b digit (by omega) p q w o).Domain) (s : List Γ) + (h : (localEdge b digit (by omega) p q w o).inputLinear x * + (localEdge b digit (by omega) p q w o).inputOffset = encode b digit s) : + ∃ t, (localEdge b digit (by omega) p q w o).outputLinear x * + (localEdge b digit (by omega) p q w o).outputOffset = encode b digit t ∧ o.Rel s t := by + cases o with + | push a => + change x * 1 = encode b digit s at h + simp only [mul_one] at h + subst x + exact ⟨a::s,rfl,rfl⟩ + | pop a => + change Counter at x + have hh : b*x.toAdd + digit a = IntegerStack.code b digit s := + congrArg Multiplicative.toAdd h + obtain ⟨t,rfl,ht⟩ := (IntegerStack.decode_push b digit hb hd hi a x.toAdd s).mp hh + refine ⟨t,?_,rfl⟩ + change x * 1 = encode b digit t + rw [mul_one] + exact Multiplicative.toAdd.injective ht + | peek a => + change Counter at x + have hh : b*x.toAdd + digit a = IntegerStack.code b digit s := + congrArg Multiplicative.toAdd h + obtain ⟨t,ht,_⟩ := (IntegerStack.decode_push b digit hb hd hi a x.toAdd s).mp hh + exact ⟨s,h,rfl,t,ht⟩ + | empty => + have hh : encode b digit [] = encode b digit s := by + change (1 : Counter) * encode b digit [] = encode b digit s at h + simpa only [one_mul] using h + have hs : s = [] := (encode_injective b digit hb hd hi hh).symm + exact ⟨[],rfl,hs,rfl⟩ + | idle => exact ⟨s,h,rfl⟩ + +include hb in + +theorem local_complete (p q : Q) (w : G) (o : Op Γ) (s t : List Γ) (h : o.Rel s t) : + ∃ x : (localEdge b digit (by omega) p q w o).Domain, + (localEdge b digit (by omega) p q w o).inputLinear x * + (localEdge b digit (by omega) p q w o).inputOffset = encode b digit s ∧ + (localEdge b digit (by omega) p q w o).outputLinear x * + (localEdge b digit (by omega) p q w o).outputOffset = encode b digit t := by + cases o with + | push a => exact ⟨encode b digit s, mul_one _, by cases h; rfl⟩ + | pop a => exact ⟨encode b digit t, by cases h; rfl, mul_one _⟩ + | peek a => + obtain ⟨rfl,r,rfl⟩ := h + exact ⟨encode b digit r,rfl,rfl⟩ + | empty => + obtain ⟨rfl,rfl⟩ := h + exact ⟨PUnit.unit,rfl,rfl⟩ + | idle => exact ⟨encode b digit s,mul_one _,by cases h; exact mul_one _⟩ + +end + +section +open MarkerMachine +variable {K Γ G Q : Type} [DecidableEq K] [Group G] + +abbrev Stores (K : Type) := K → Counter +abbrev Rest (k : K) := {j : K // j ≠ k} → Counter + +def insertLinear {A : Type} [Group A] (k : K) (f : A →* Counter) : + A × Rest k →* Stores K where + toFun x j := if h : j = k then f x.1 else x.2 ⟨j,h⟩ + map_one' := by ext j; dsimp; split_ifs <;> simp + map_mul' x y := by ext j; dsimp; split_ifs <;> simp + +@[simp] lemma insertLinear_apply {A : Type} [Group A] (k : K) (f : A →* Counter) + (x : A × Rest k) (j : K) : insertLinear k f x j = + if h : j = k then f x.1 else x.2 ⟨j,h⟩ := rfl + +lemma insertLinear_injective {A : Type} [Group A] (k : K) (f : A →* Counter) + (hf : Function.Injective f) : Function.Injective (insertLinear k f) := by + intro x y h + apply Prod.ext + · apply hf + simpa [insertLinear] using congrFun h k + · funext j + simpa [insertLinear,j.property] using congrFun h j.val + +def insertOffset (k : K) (a : Counter) : Stores K := fun j ↦ if j = k then a else 1 + +def liftEdge (k : K) (e : Edge G Counter Q) : Edge G (Stores K) Q where + Domain := e.Domain × Rest k + inputLinear := insertLinear k e.inputLinear + outputLinear := insertLinear k e.outputLinear + input_injective := insertLinear_injective k e.inputLinear e.input_injective + output_injective := insertLinear_injective k e.outputLinear e.output_injective + inputOffset := insertOffset k e.inputOffset + outputOffset := insertOffset k e.outputOffset + inputState := e.inputState + outputState := e.outputState + weight := e.weight + +lemma liftEdge_finitelyPresented [Finite K] (k : K) (e : Edge G Counter Q) + [Group.IsFinitelyPresented e.Domain] : Group.IsFinitelyPresented (liftEdge k e).Domain := by + have : Group.IsFinitelyPresented (Rest k) := finitelyPresented_pi _ _ + exact finitelyPresented_prod + +inductive Action (K Γ : Type) + | onStack (k : K) (o : Op Γ) | idle + +def Action.Rel : Action K Γ → (K → List Γ) → (K → List Γ) → Prop + | .onStack k o, S, T => ∃ t, o.Rel (S k) t ∧ T = Function.update S k t + | .idle, S, T => T = S + +variable (b : ℤ) (digit : Γ → ℤ) (hb : 2 ≤ b) + (hd : ∀ a, 2 ≤ digit a ∧ digit a < b) (hi : Function.Injective digit) + +def encodeStores (S : K → List Γ) : Stores K := fun k ↦ encode b digit (S k) + +def actionEdge (p q : Q) (w : G) : Action K Γ → Edge G (Stores K) Q + | .onStack k o => liftEdge k (localEdge b digit (by omega) p q w o) + | .idle => ⟨Stores K,MonoidHom.id _,MonoidHom.id _,Function.injective_id, + Function.injective_id,1,1,p,q,w⟩ + +lemma action_finitelyPresented [Finite K] (p q : Q) (w : G) (a : Action K Γ) : + Group.IsFinitelyPresented (actionEdge b digit hb p q w a).Domain := by + cases a with + | onStack k o => exact liftEdge_finitelyPresented _ _ + | idle => exact finitelyPresented_pi _ _ + +include hd hi in +theorem action_sound (p q : Q) (w : G) (a : Action K Γ) + (x : (actionEdge b digit hb p q w a).Domain) (S : K → List Γ) + (h : (actionEdge b digit hb p q w a).inputLinear x * + (actionEdge b digit hb p q w a).inputOffset = encodeStores b digit S) : + ∃ T, (actionEdge b digit hb p q w a).outputLinear x * + (actionEdge b digit hb p q w a).outputOffset = encodeStores b digit T ∧ a.Rel S T := by + cases a with + | onStack k o => + change (localEdge b digit (by omega) p q w o).Domain × Rest k at x + have input_eq (j : K) : + (if hj : j = k then (localEdge b digit (by omega) p q w o).inputLinear x.1 + else x.2 ⟨j,hj⟩) * + (if j = k then (localEdge b digit (by omega) p q w o).inputOffset else 1) = + encode b digit (S j) := congrFun h j + have hk : (localEdge b digit (by omega) p q w o).inputLinear x.1 * + (localEdge b digit (by omega) p q w o).inputOffset = encode b digit (S k) := by + simpa using input_eq k + obtain ⟨t,ht,hr⟩ := local_sound b digit hb hd hi p q w o x.1 (S k) hk + refine ⟨Function.update S k t,?_,t,hr,rfl⟩ + funext j + change (if hj : j = k then (localEdge b digit (by omega) p q w o).outputLinear x.1 + else x.2 ⟨j,hj⟩) * + (if j = k then (localEdge b digit (by omega) p q w o).outputOffset else 1) = + encode b digit (Function.update S k t j) + by_cases hj : j = k + · subst j + simpa using ht + · simpa [hj] using input_eq j + | idle => exact ⟨S,h,rfl⟩ + +theorem action_complete (p q : Q) (w : G) (a : Action K Γ) (S T : K → List Γ) (h : a.Rel S T) : + ∃ x : (actionEdge b digit hb p q w a).Domain, + (actionEdge b digit hb p q w a).inputLinear x * + (actionEdge b digit hb p q w a).inputOffset = encodeStores b digit S ∧ + (actionEdge b digit hb p q w a).outputLinear x * + (actionEdge b digit hb p q w a).outputOffset = encodeStores b digit T := by + cases a with + | onStack k o => + obtain ⟨t,hr,rfl⟩ := h + obtain ⟨x,hs,ht⟩ := local_complete b digit hb p q w o (S k) t hr + refine ⟨(x,fun j ↦ encode b digit (S j.val)),?_,?_⟩ + · funext j + change (if j = k then (localEdge b digit (by omega) p q w o).inputLinear x + else encode b digit (S j)) * + (if j = k then (localEdge b digit (by omega) p q w o).inputOffset else 1) = + encode b digit (S j) + by_cases hj : j = k + · subst j + simpa using hs + · simp [hj] + · funext j + change (if j = k then (localEdge b digit (by omega) p q w o).outputLinear x + else encode b digit (S j)) * + (if j = k then (localEdge b digit (by omega) p q w o).outputOffset else 1) = + encode b digit (Function.update S k t j) + by_cases hj : j = k + · subst j + simpa using ht + · simp [hj] + | idle => exact ⟨encodeStores b digit S,mul_one _,by cases h; exact mul_one _⟩ + +end + +open MarkerMachine +variable {K Γ G Q : Type} [DecidableEq K] [Group G] + (b : ℤ) (digit : Γ → ℤ) (hb : 2 ≤ b) + +@[simp] lemma actionEdge_inputState (p q : Q) (w : G) (a : Action K Γ) : + (actionEdge b digit hb p q w a).inputState = p := by + cases a with + | onStack k o => cases o <;> rfl + | idle => rfl + +@[simp] lemma actionEdge_outputState (p q : Q) (w : G) (a : Action K Γ) : + (actionEdge b digit hb p q w a).outputState = q := by + cases a with + | onStack k o => cases o <;> rfl + | idle => rfl + +@[simp] lemma actionEdge_weight (p q : Q) (w : G) (a : Action K Γ) : + (actionEdge b digit hb p q w a).weight = w := by + cases a with + | onStack k o => cases o <;> rfl + | idle => rfl + +variable (hd : ∀ a, 2 ≤ digit a ∧ digit a < b) (hi : Function.Injective digit) + +include hb hd hi in +omit [DecidableEq K] in +lemma encodeStores_injective : Function.Injective (encodeStores (K := K) b digit) := by + intro S T h + funext k + exact encode_injective b digit hb hd hi (congrFun h k) + +end Higman.AffineStack + +namespace Higman.StackProgram + +section +open AffineStack MarkerMachine +variable {K Γ G Q E : Type} [DecidableEq K] [Group G] + +structure Instruction (K Γ G Q : Type) where + source : Q + target : Q + action : Action K Γ + weight : G + +def Instruction.edge (b : ℤ) (digit : Γ → ℤ) (hb : 2 ≤ b) (i : Instruction K Γ G Q) : + Edge G (Stores K) Q := actionEdge b digit hb i.source i.target i.weight i.action + +inductive Run (prog : E → Instruction K Γ G Q) (seed : (K → List Γ) × Q) : + List E → ((K → List Γ) × Q) → Prop + | start : Run prog seed [] seed + | step {s : List E} (e : E) (S T : K → List Γ) (h : (prog e).action.Rel S T) : + Run prog seed s (S,(prog e).source) → Run prog seed (e::s) (T,(prog e).target) + +variable (prog : E → Instruction K Γ G Q) (seed : (K → List Γ) × Q) + (b : ℤ) (digit : Γ → ℤ) (hb : 2 ≤ b) + (hd : ∀ a, 2 ≤ digit a ∧ digit a < b) (hi : Function.Injective digit) + +include hd hi in + +theorem run_sound {s : List E} {c : Stores K × Q} + (h : HistoryMachine.Run (fun e ↦ ((prog e).edge b digit hb).input) + (fun e ↦ ((prog e).edge b digit hb).output) (encodeStores b digit seed.1,seed.2) s c) : + ∃ S, encodeStores b digit S = c.1 ∧ Run prog seed s (S,c.2) := by + induction h with + | start => exact ⟨seed.1,rfl,Run.start⟩ + | @step s e x h ih => + obtain ⟨S,hS,hR⟩ := ih + obtain ⟨T,hT,hr⟩ := action_sound b digit hb hd hi (prog e).source (prog e).target + (prog e).weight (prog e).action x S hS.symm + refine ⟨T,hT.symm,?_⟩ + simp only [Edge.input,Instruction.edge,actionEdge_inputState] at hR + simpa only [Edge.output,Instruction.edge,actionEdge_outputState] using Run.step e S T hr hR + +theorem run_complete {s : List E} {c : (K → List Γ) × Q} (h : Run prog seed s c) : + HistoryMachine.Run (fun e ↦ ((prog e).edge b digit hb).input) + (fun e ↦ ((prog e).edge b digit hb).output) (encodeStores b digit seed.1,seed.2) + s (encodeStores b digit c.1,c.2) := by + induction h with + | start => exact HistoryMachine.Run.start + | @step s e S T hr h ih => + obtain ⟨x,hS,hT⟩ := action_complete b digit hb (prog e).source (prog e).target + (prog e).weight (prog e).action S T hr + have hin : ((prog e).edge b digit hb).input x = (encodeStores b digit S,(prog e).source) := by + apply Prod.ext hS + exact actionEdge_inputState _ _ _ _ _ _ _ + have hout : ((prog e).edge b digit hb).output x = (encodeStores b digit T,(prog e).target) := by + apply Prod.ext hT + exact actionEdge_outputState _ _ _ _ _ _ _ + rw [← hout] + apply HistoryMachine.Run.step (input := fun e ↦ ((prog e).edge b digit hb).input) + (output := fun e ↦ ((prog e).edge b digit hb).output) e x + rwa [hin] + +def outputs (halt : Q) : Set G := + {g | ∃ s S, Run prog seed s (S,halt) ∧ g = HistoryMachine.value (fun e ↦ (prog e).weight) s} + +end + +open AffineStack MarkerMachine +variable {K Γ G Q E : Type} [DecidableEq K] [Group G] + [Finite K] [Fintype Γ] [Finite Q] [Fintype E] [Group.IsFinitelyPresented G] + (prog : E → Instruction K Γ G Q) (seed : (K → List Γ) × Q) (halt : Q) + +theorem benign_outputs : IsBenign (Subgroup.closure (outputs prog seed halt)) := by + classical + let b : ℤ := Fintype.card Γ + 2 + let digit : Γ → ℤ := fun a ↦ ((Fintype.equivFin Γ a).val : ℤ) + 2 + have hb : 2 ≤ b := by dsimp [b]; omega + have hd : ∀ a, 2 ≤ digit a ∧ digit a < b := by + intro a + have hh := (Fintype.equivFin Γ a).isLt + dsimp [digit,b] + constructor <;> omega + have hi : Function.Injective digit := by + intro a c h + apply (Fintype.equivFin Γ).injective + apply Fin.ext + dsimp [digit] at h + omega + have : Group.IsFinitelyPresented (Stores K) := finitelyPresented_pi _ _ + have hp := RecordedMachine.benign_accepted (fun e ↦ (prog e).edge b digit hb) + (encodeStores b digit seed.1,seed.2) halt + (fun e ↦ action_finitelyPresented b digit hb (prog e).source (prog e).target + (prog e).weight (prog e).action) + have he : RecordedMachine.acceptedOutputs (fun e ↦ (prog e).edge b digit hb) + (encodeStores b digit seed.1,seed.2) halt = outputs prog seed halt := by + ext g + constructor + · rintro ⟨s,c,hs,hc,hg⟩ + obtain ⟨S,_,hR⟩ := run_sound prog seed b digit hb hd hi hs + refine ⟨s,S,?_,?_⟩ + · rwa [hc] at hR + · simpa only [Instruction.edge,actionEdge_weight] using hg + · rintro ⟨s,S,hs,hg⟩ + refine ⟨s,(encodeStores b digit S,halt),run_complete prog seed b digit hb hs,rfl,?_⟩ + simpa only [Instruction.edge,actionEdge_weight] using hg + rwa [he] at hp + +end Higman.StackProgram + +end OAI diff --git a/lean/OAI/GroupTheory/UniversalGroup/TopologicalTowers.lean b/lean/OAI/GroupTheory/UniversalGroup/TopologicalTowers.lean new file mode 100644 index 0000000000000000000000000000000000000000..6a61a1d4f4fc7e2f516cb89b34f057d4c03ec4e1 --- /dev/null +++ b/lean/OAI/GroupTheory/UniversalGroup/TopologicalTowers.lean @@ -0,0 +1,457 @@ +import OAI.GroupTheory.UniversalGroup.CellularFillings + +namespace OAI + +noncomputable section + +open Set Metric Topology BigOperators +open Set Metric Topology +open Set Topology +open Set Metric Topology +open scoped NNReal +open Set Metric Topology +open scoped NNReal ENNReal +open Set Metric Topology +open scoped TensorProduct + +namespace UniversalFInfinity.TopologicalTower +universe u v +variable (X : ℕ → Type u) [∀ n, TopologicalSpace (X n)] +variable (f : ∀ i j, i ≤ j → C(X i,X j)) [DirectedSystem X (f · · ·)] + +abbrev Space := DirectLimit X f + +def of (n : ℕ) (x : X n) : Space X f := ⟦⟨n,x⟩⟧ + +instance : TopologicalSpace (Space X f) := + TopologicalSpace.coinduced (fun x : Σ n, X n => of X f x.1 x.2) inferInstance + +lemma of_compat (i j : ℕ) (h : i ≤ j) (x : X i) : + of X f j (f i j h x) = of X f i x := DirectLimit.mk_apply i j x h + +lemma continuous_iff {Y : Type v} [TopologicalSpace Y] (g : Space X f → Y) : + Continuous g ↔ ∀ n, Continuous (g ∘ of X f n) := by + rw [continuous_coinduced_dom,continuous_sigma_iff] + rfl + +lemma continuous_of (n : ℕ) : Continuous (of X f n) := by + have h : Continuous (fun x : Σ n, X n => of X f x.1 x.2) := continuous_coinduced_rng + exact h.comp continuous_sigmaMk + +lemma isClosed_iff (A : Set (Space X f)) : + IsClosed A ↔ ∀ n, IsClosed (of X f n ⁻¹' A) := by + rw [isClosed_coinduced] + exact isClosed_sigma_iff + +variable (hf : ∀ i j h, IsClosedEmbedding (f i j h)) + +include hf in +lemma of_injective (n : ℕ) : Function.Injective (of X f n) := + DirectLimit.mk_injective f (fun i j h => (hf i j h).injective) n + +include hf in +lemma preimage_of_image_le (i j : ℕ) (h : i ≤ j) (A : Set (X i)) : + of X f j ⁻¹' (of X f i '' A) = f i j h '' A := by + ext y + constructor + · rintro ⟨x,hx,hxy⟩ + refine ⟨x,hx,?_⟩ + apply of_injective X f hf j + exact (of_compat X f i j h x).trans hxy + · rintro ⟨x,hx,rfl⟩ + exact ⟨x,hx,(of_compat X f i j h x).symm⟩ + +include hf in +lemma preimage_of_image_ge (i j : ℕ) (h : j ≤ i) (A : Set (X i)) : + of X f j ⁻¹' (of X f i '' A) = f j i h ⁻¹' A := by + ext y + constructor + · rintro ⟨x,hx,hxy⟩ + have he : x = f j i h y := of_injective X f hf i + (hxy.trans (of_compat X f j i h y).symm) + change f j i h y ∈ A + rw [← he] + exact hx + · intro hA + exact ⟨f j i h y,hA,of_compat X f j i h y⟩ + +include hf in +lemma of_closedEmbedding (n : ℕ) : IsClosedEmbedding (of X f n) := by + apply IsClosedEmbedding.of_continuous_injective_isClosedMap + (continuous_of X f n) (of_injective X f hf n) + intro A hA + rw [isClosed_iff] + intro m + rcases le_total n m with h | h + · rw [preimage_of_image_le X f hf n m h] + exact (hf n m h).isClosedMap _ hA + · rw [preimage_of_image_ge X f hf n m h] + exact hA.preimage (hf m n h).continuous + +def lift {Y : Type v} [TopologicalSpace Y] (g : ∀ n, C(X n,Y)) + (hg : ∀ i j h x, g i x = g j (f i j h x)) : C(Space X f,Y) := + ⟨DirectLimit.lift f (fun n => g n) hg, + (continuous_iff X f _).mpr (fun n => (g n).continuous)⟩ + +@[simp] lemma lift_of {Y : Type v} [TopologicalSpace Y] (g : ∀ n, C(X n,Y)) + (hg : ∀ i j h x, g i x = g j (f i j h x)) (n : ℕ) (x : X n) : + lift X f g hg (of X f n x) = g n x := rfl + +def tailLift {Y : Type v} [TopologicalSpace Y] (n : ℕ) + (g : ∀ m, n ≤ m → C(X m,Y)) + (hg : ∀ i j (hi : n ≤ i) (hij : i ≤ j) x, + g i hi x = g j (hi.trans hij) (f i j hij x)) : C(Space X f,Y) := by + let G (m : ℕ) : C(X m,Y) := + ⟨fun x => g (max n m) (le_max_left _ _) (f m (max n m) (le_max_right _ _) x), + (g _ _).continuous.comp (hf _ _ _).continuous⟩ + apply lift X f G + intro i j hij x + let k := max n j + have hik : max n i ≤ k := max_le_max_left n hij + change g (max n i) _ (f i (max n i) _ x) = g k _ (f j k _ (f i j hij x)) + rw [hg _ _ _ hik,DirectedSystem.map_map',DirectedSystem.map_map'] + +lemma tailLift_of {Y : Type v} [TopologicalSpace Y] (n : ℕ) + (g : ∀ m, n ≤ m → C(X m,Y)) + (hg : ∀ i j (hi : n ≤ i) (hij : i ≤ j) x, + g i hi x = g j (hi.trans hij) (f i j hij x)) + (m : ℕ) (hm : n ≤ m) (x : X m) : + tailLift X f hf n g hg (of X f m x) = g m hm x := by + change g (max n m) _ (f m (max n m) _ x) = g m hm x + exact (hg m (max n m) hm (le_max_right _ _) x).symm + +def ExtendsReals : Prop := ∀ n (g : C(X n,ℝ)), + ∃ G : C(X (n+1),ℝ), ∀ x, G (f n (n+1) (Nat.le_succ n) x) = g x + +variable (hext : ExtendsReals X f) + +def realExtension (n : ℕ) (g : C(X n,ℝ)) : C(X (n+1),ℝ) := (hext n g).choose + +omit [DirectedSystem X (f · · ·)] in +lemma realExtension_spec (n : ℕ) (g : C(X n,ℝ)) (x : X n) : + realExtension X f hext n g (f n (n+1) (Nat.le_succ n) x) = g x := + (hext n g).choose_spec x + +def realFamily (n : ℕ) (g : C(X n,ℝ)) (m : ℕ) (hm : n ≤ m) : C(X m,ℝ) := + Nat.leRecOn hm (fun {k} => realExtension X f hext k) g + +omit [DirectedSystem X (f · · ·)] in +lemma realFamily_self (n : ℕ) (g : C(X n,ℝ)) : realFamily X f hext n g n le_rfl = g := + by simp only [realFamily,Nat.leRecOn_self] + +lemma realFamily_compat (n : ℕ) (g : C(X n,ℝ)) (i j : ℕ) (hi : n ≤ i) + (hij : i ≤ j) (x : X i) : + realFamily X f hext n g i hi x = + realFamily X f hext n g j (hi.trans hij) (f i j hij x) := by + induction j,hij using Nat.le_induction with + | base => rw [DirectedSystem.map_self'] + | succ j hij ih => + unfold realFamily + rw [Nat.leRecOn_succ (hi.trans hij)] + rw [← DirectedSystem.map_map' f hij (Nat.le_succ j),realExtension_spec] + exact ih + +include hf hext in +lemma exists_global_real_extension (n : ℕ) (g : C(X n,ℝ)) : + ∃ G : C(Space X f,ℝ), ∀ x, G (of X f n x) = g x := by + refine ⟨tailLift X f hf n (realFamily X f hext n g) + (realFamily_compat X f hext n g),?_⟩ + intro x + rw [tailLift_of X f hf n _ _ n le_rfl,realFamily_self] + +include hf hext in +lemma t2Space (hsep : ∀ n (x y : X n), x ≠ y → + ∃ g : C(X n,ℝ), g x ≠ g y) : T2Space (Space X f) := by + constructor + intro z w hzw + obtain ⟨n,x,y,rfl,rfl⟩ := DirectLimit.exists_eq_mk₂ f z w + have hxy : x ≠ y := fun h => hzw (congrArg (of X f n) h) + obtain ⟨g,hg⟩ := hsep n x y hxy + obtain ⟨G,hG⟩ := exists_global_real_extension X f hf hext n g + apply separated_by_continuous G.continuous + change G (of X f n x) ≠ G (of X f n y) + rw [hG,hG] + exact hg + +lemma range_mono {i j : ℕ} (h : i ≤ j) : Set.range (of X f i) ⊆ Set.range (of X f j) := by + rintro _ ⟨x,rfl⟩ + exact ⟨f i j h x,of_compat X f i j h x⟩ + +variable [∀ n, T1Space (X n)] + +include hf in +lemma selection_closed (x : ℕ → Space X f) (hx : ∀ n, x n ∉ Set.range (of X f n)) + (S : Set (Space X f)) (hS : S ⊆ Set.range x) : IsClosed S := by + rw [isClosed_iff] + intro m + have hfin : (S ∩ Set.range (of X f m)).Finite := by + apply ((Set.finite_Iio m).image x).subset + rintro z ⟨hzS,hzm⟩ + obtain ⟨n,rfl⟩ := hS hzS + refine ⟨n,?_,rfl⟩ + change n < m + by_contra hnm + exact hx n (range_mono X f (Nat.le_of_not_gt hnm) hzm) + have hh := hfin.preimage (of_injective X f hf m).injOn + rw [Set.preimage_inter,Set.preimage_range,Set.inter_univ] at hh + exact hh.isClosed + +include hf in + +theorem compact_bounded {K : Set (Space X f)} (hK : IsCompact K) : + ∃ n, K ⊆ Set.range (of X f n) := by + classical + by_contra hn + have hex : ∀ n, ∃ x ∈ K, x ∉ Set.range (of X f n) := by + intro n + exact Set.not_subset.mp (fun h => hn ⟨n,h⟩) + choose x hxK hx using hex + have hall : ∀ S ⊆ Set.range x, IsClosed S := selection_closed X f hf x hx + have hcompact : IsCompact (Set.range x) := + hK.of_isClosed_subset (hall _ subset_rfl) (Set.range_subset_iff.mpr hxK) + have hdiscrete : IsDiscrete (Set.range x) := by + apply isDiscrete_iff_forall_mem_exists_isClosed.mpr + intro S hS + exact ⟨S,hall S hS,Set.inter_eq_left.mpr hS⟩ + have hfinite := hcompact.finite hdiscrete + have hex : ∀ z ∈ Set.range x, ∃ n, z ∈ Set.range (of X f n) := by + intro z _ + obtain ⟨n,y,rfl⟩ := DirectLimit.exists_eq_mk f z + exact ⟨n,y,rfl⟩ + choose idx hidx using hex + let n := hfinite.toFinset.sup (fun z => if hz : z ∈ Set.range x then idx z hz else 0) + have hbound : Set.range x ⊆ Set.range (of X f n) := by + intro z hz + apply range_mono X f (j := n) _ (hidx z hz) + have hh := Finset.le_sup (f := fun z => if hz : z ∈ Set.range x then idx z hz else 0) + (hfinite.mem_toFinset.mpr hz) + simpa only [dite_eq_left hz] using hh + exact hx n (hbound (Set.mem_range_self n)) + +end UniversalFInfinity.TopologicalTower + +namespace UniversalFInfinity.CellularTower +open Set Metric Topology +universe u +variable (X : ℕ → Type u) [∀ n, TopologicalSpace (X n)] +variable [∀ n, Nonempty (X n)] +variable [∀ n, CWComplex (Set.univ : Set (X n))] +variable (f : ∀ i j, i ≤ j → C(X i,X j)) [DirectedSystem X (f · · ·)] +variable (hf : ∀ i j h, IsClosedEmbedding (f i j h)) + +structure CellSystem where + index : ℕ → Type u + cell : ∀ n m, m ≤ n → index m → RelCWComplex.cell (Set.univ : Set (X n)) m + injective : ∀ n m h, Function.Injective (cell n m h) + exhaustive : ∀ n m (j : RelCWComplex.cell (Set.univ : Set (X n)) m), + ∃ (h : m ≤ n) (i : index m), cell n m h i = j + compatibility : ∀ n k (h : n ≤ k) (m : ℕ) (hm : m ≤ n) (i : index m) (x : Fin m → ℝ), + f n k h (RelCWComplex.map m (cell n m hm i) x) = + RelCWComplex.map m (cell k m (hm.trans h) i) x + +variable (D : CellSystem X f) + +abbrev Limit := TopologicalTower.Space X f +abbrev stage (n : ℕ) := TopologicalTower.of X f n + +def map (m : ℕ) (i : D.index m) : PartialEquiv (Fin m → ℝ) (Limit X f) := + Cellular.transportedMap (TopologicalTower.of_closedEmbedding X f hf m) + m (D.cell m m le_rfl i) + +lemma map_eq_stage (n m : ℕ) (hm : m ≤ n) (i : D.index m) (x : Fin m → ℝ) : + map X f hf D m i x = stage X f n (RelCWComplex.map m (D.cell n m hm i) x) := by + change stage X f m (RelCWComplex.map m (D.cell m m le_rfl i) x) = _ + unfold stage + rw [← TopologicalTower.of_compat X f m n hm,D.compatibility] + +lemma map_image (n m : ℕ) (hm : m ≤ n) (i : D.index m) (S : Set (Fin m → ℝ)) : + map X f hf D m i '' S = stage X f n '' (RelCWComplex.map m (D.cell n m hm i) '' S) := by + rw [← Set.image_comp] + congr 1 + funext x + exact map_eq_stage X f hf D n m hm i x + +def globalIndex (n m : ℕ) (j : RelCWComplex.cell (Set.univ : Set (X n)) m) : D.index m := + (D.exhaustive n m j).choose_spec.choose + +omit [∀ n, Nonempty (X n)] [DirectedSystem X (f · · ·)] in +lemma globalIndex_spec (n m : ℕ) (j : RelCWComplex.cell (Set.univ : Set (X n)) m) : + D.cell n m (D.exhaustive n m j).choose (globalIndex X f D n m j) = j := + (D.exhaustive n m j).choose_spec.choose_spec + +lemma old_image (n m : ℕ) (j : RelCWComplex.cell (Set.univ : Set (X n)) m) + (S : Set (Fin m → ℝ)) : + stage X f n '' (RelCWComplex.map m j '' S) = + map X f hf D m (globalIndex X f D n m j) '' S := by + rw [map_image X f hf D n m (D.exhaustive n m j).choose,globalIndex_spec] + +variable [∀ n, T2Space (X n)] + +@[instance_reducible] +def cwComplex : CWComplex (Set.univ : Set (Limit X f)) where + cell := D.index + map := map X f hf D + source_eq := fun m i => Cellular.transportedMap_source _ _ _ + continuousOn := fun m i => Cellular.transportedMap_continuousOn _ _ _ + continuousOn_symm := fun m i => Cellular.transportedMap_continuousOn_symm _ _ _ + pairwiseDisjoint' := by + rintro ⟨m,i⟩ _ ⟨k,j⟩ _ hne + change Disjoint (map X f hf D m i '' ball 0 1) (map X f hf D k j '' ball 0 1) + rw [map_image X f hf D (max m k) m (le_max_left _ _), + map_image X f hf D (max m k) k (le_max_right _ _)] + apply (CWComplex.disjoint_openCell_of_ne ?_).image + (TopologicalTower.of_injective X f hf (max m k)).injOn (Set.subset_univ _) (Set.subset_univ _) + intro heq + have hmk := congrArg Sigma.fst heq + change m = k at hmk + subst k + have hij : D.cell (max m m) m (le_max_left _ _) i = + D.cell (max m m) m (le_max_right _ _) j := eq_of_heq (Sigma.mk.inj_iff.mp heq).2 + have : i = j := D.injective _ _ _ hij + exact hne (by subst j; rfl) + mapsTo' := by + classical + intro m i + obtain ⟨I,hI⟩ := CWComplex.cellFrontier_subset_finite_closedCell m (D.cell m m le_rfl i) + refine ⟨fun k => (I k).image (globalIndex X f D m k),?_⟩ + intro x hx + have h := hI (show RelCWComplex.map m (D.cell m m le_rfl i) x ∈ + CWComplex.cellFrontier m (D.cell m m le_rfl i) from ⟨x,hx,rfl⟩) + simp only [Set.mem_iUnion] at h + obtain ⟨k,hkm,j,hj,hx'⟩ := h + refine Set.mem_iUnion.mpr ⟨k,Set.mem_iUnion.mpr ⟨hkm,Set.mem_iUnion.mpr + ⟨globalIndex X f D m k j,Set.mem_iUnion.mpr + ⟨Finset.mem_image.mpr ⟨j,hj,rfl⟩,?_⟩⟩⟩⟩ + rw [← old_image X f hf D m k j] + exact ⟨_,hx',rfl⟩ + closed' := by + intro A _ hA + rw [TopologicalTower.isClosed_iff] + intro n + apply (CWComplex.closed Set.univ (stage X f n ⁻¹' A) (Set.subset_univ _)).mpr + intro m j + have h := (hA m (globalIndex X f D n m j)).preimage (TopologicalTower.continuous_of X f n) + rw [← old_image X f hf D n m j,Set.preimage_inter, + Set.preimage_image_eq _ (TopologicalTower.of_injective X f hf n)] at h + exact h + union' := by + apply Set.eq_univ_of_forall + intro z + obtain ⟨n,x,rfl⟩ := DirectLimit.exists_eq_mk f z + have hx : x ∈ (Set.univ : Set (X n)) := Set.mem_univ _ + rw [← CWComplex.union (C := (Set.univ : Set (X n)))] at hx + simp only [Set.mem_iUnion] at hx + obtain ⟨m,j,hx⟩ := hx + refine Set.mem_iUnion.mpr ⟨m,Set.mem_iUnion.mpr ⟨globalIndex X f D n m j,?_⟩⟩ + rw [← old_image X f hf D n m j] + exact ⟨x,hx,rfl⟩ + +lemma finite_cells (hfin : ∀ n, Finite (D.index n)) (n : ℕ) : + Finite ((cwComplex X f hf D).cell n) := hfin n + +end UniversalFInfinity.CellularTower + +namespace UniversalFInfinity.Sequential +open Set Topology +universe u +variable (X : ℕ → Type u) [∀ n,TopologicalSpace (X n)] +variable (step : ∀ n,C(X n,X (n+1))) + +def map (i j : ℕ) (h : i ≤ j) : C(X i,X j) := + Nat.leRecOn h (fun {k} F => (step k).comp F) (.id (X i)) + +@[simp] lemma map_self (i : ℕ) : map X step i i le_rfl = .id _ := by + simp only [map,Nat.leRecOn_self] +lemma map_succ (i j : ℕ) (h : i ≤ j) : + map X step i (j+1) (h.trans (Nat.le_succ j)) = (step j).comp (map X step i j h) := by + simp only [map,Nat.leRecOn_succ h] +@[simp] lemma map_step (i : ℕ) : map X step i (i+1) (Nat.le_succ i) = step i := by + rw [map_succ X step i i le_rfl,map_self,ContinuousMap.comp_id] + +instance : DirectedSystem X (map X step · · ·) where + map_self {i} x := by simp only [map_self,ContinuousMap.id_apply] + map_map {k j i} hij hjk x := by + induction k,hjk using Nat.le_induction with + | base => simp only [map_self,ContinuousMap.id_apply] + | succ k hk ih => + rw [map_succ X step j k hk,map_succ X step i k (hij.trans hk)] + change step k (map X step j k hk (map X step i j hij x)) = step k (map X step i k (hij.trans hk) x) + rw [ih] + +lemma map_closedEmbedding (hs : ∀ n,IsClosedEmbedding (step n)) (i j : ℕ) (h : i ≤ j) : + IsClosedEmbedding (map X step i j h) := by + induction j,h using Nat.le_induction with + | base => simpa only [map_self,ContinuousMap.coe_id] using IsClosedEmbedding.id + | succ j h ih => rw [map_succ X step i j h]; exact (hs j).comp ih + +variable [∀ n,CWComplex (univ : Set (X n))] + +structure CellSteps where + cell : ∀ n m,RelCWComplex.cell (univ : Set (X n)) m → RelCWComplex.cell (univ : Set (X (n+1))) m + injective : ∀ n m,Function.Injective (cell n m) + dim : ∀ n m (_ : RelCWComplex.cell (univ : Set (X n)) m),m ≤ n + exhaustive : ∀ n m,m ≠ n+1 → ∀ j, ∃ i,cell n m i = j + compatibility : ∀ n m i x,step n (RelCWComplex.map m i x) = RelCWComplex.map m (cell n m i) x + +variable (D : CellSteps X step) +def cellMap (i j : ℕ) (h : i ≤ j) (m : ℕ) : + RelCWComplex.cell (univ : Set (X i)) m → RelCWComplex.cell (univ : Set (X j)) m := + Nat.leRecOn h (fun {k} F => D.cell k m ∘ F) id + +lemma cellMap_self (i m : ℕ) : cellMap X step D i i le_rfl m = id := by + simp only [cellMap,Nat.leRecOn_self] +lemma cellMap_succ (i j : ℕ) (h : i ≤ j) (m : ℕ) : + cellMap X step D i (j+1) (h.trans (Nat.le_succ j)) m = D.cell j m ∘ cellMap X step D i j h m := by + simp only [cellMap,Nat.leRecOn_succ h] +lemma cellMap_injective (i j : ℕ) (h : i ≤ j) (m : ℕ) : + Function.Injective (cellMap X step D i j h m) := by + induction j,h using Nat.le_induction with + | base => rw [cellMap_self]; exact Function.injective_id + | succ j h ih => rw [cellMap_succ X step D i j h]; exact (D.injective j m).comp ih +lemma cellMap_comp (i j k : ℕ) (hij : i ≤ j) (hjk : j ≤ k) (m : ℕ) (c) : + cellMap X step D j k hjk m (cellMap X step D i j hij m c) = + cellMap X step D i k (hij.trans hjk) m c := by + induction k,hjk using Nat.le_induction with + | base => rw [cellMap_self]; rfl + | succ k hk ih => + rw [cellMap_succ X step D j k hk,cellMap_succ X step D i k (hij.trans hk)] + exact congrArg (D.cell k m) ih +lemma cellMap_compat (i j : ℕ) (h : i ≤ j) (m : ℕ) (c) (x : Fin m → ℝ) : + map X step i j h (RelCWComplex.map m c x) = RelCWComplex.map m (cellMap X step D i j h m c) x := by + induction j,h using Nat.le_induction with + | base => rw [map_self,cellMap_self]; rfl + | succ j h ih => + rw [map_succ X step i j h,cellMap_succ X step D i j h] + change step j (map X step i j h (RelCWComplex.map m c x)) = _ + rw [ih,D.compatibility] + +lemma cellMap_exhaustive (n m : ℕ) (c : RelCWComplex.cell (univ : Set (X n)) m) : + ∃ (h : m ≤ n) (i : RelCWComplex.cell (univ : Set (X m)) m),cellMap X step D m n h m i = c := by + induction n with + | zero => + have hm : m = 0 := Nat.eq_zero_of_le_zero (D.dim 0 m c) + subst m + exact ⟨le_rfl,c,by rw [cellMap_self]; rfl⟩ + | succ n ih => + by_cases hm : m = n+1 + · subst m + exact ⟨le_rfl,c,by rw [cellMap_self]; rfl⟩ + · obtain ⟨j,rfl⟩ := D.exhaustive n m hm c + obtain ⟨h,i,hi⟩ := ih j + refine ⟨h.trans (Nat.le_succ n),i,?_⟩ + rw [cellMap_succ X step D m n h] + exact congrArg (D.cell n m) hi + +variable [∀ n,Nonempty (X n)] +def cellSystem : CellularTower.CellSystem X (map X step) where + index m := RelCWComplex.cell (univ : Set (X m)) m + cell n m h := cellMap X step D m n h m + injective n m h := cellMap_injective X step D m n h m + exhaustive := cellMap_exhaustive X step D + compatibility n k h m hm i x := by + rw [cellMap_compat X step D n k h,cellMap_comp X step D m n k hm h] +end UniversalFInfinity.Sequential + +end + +end OAI diff --git a/lean/OAI/GroupTheory/UniversalGroup/TorusBundles.lean b/lean/OAI/GroupTheory/UniversalGroup/TorusBundles.lean new file mode 100644 index 0000000000000000000000000000000000000000..55ae08fd39127e0e78792b68852b8ae7df6e00bc --- /dev/null +++ b/lean/OAI/GroupTheory/UniversalGroup/TorusBundles.lean @@ -0,0 +1,426 @@ +import OAI.GroupTheory.UniversalGroup.AscendingTorus + +namespace OAI + +noncomputable section + +open Set Metric Topology BigOperators +open Set Metric Topology +open Set Topology +open Set Metric Topology +open scoped NNReal +open Set Metric Topology +open scoped NNReal ENNReal +open Set Metric Topology +open scoped TensorProduct + +namespace UniversalFInfinity.Milnor +open Set Topology +universe u v +variable {G : Type u} [Group G] {H : Type v} [Group H] +lemma map_smul (φ : G →* H) (g : G) (x : Space G) : + map φ id Function.injective_id (g • x) = φ g • map φ id Function.injective_id x := by + change map φ id Function.injective_id (map (g * ·) id Function.injective_id x) = + map (φ g * ·) id Function.injective_id (map φ id Function.injective_id x) + rw [map_comp,map_comp] + have he : (φ ∘ (g * ·)) = ((φ g * ·) ∘ φ) := funext (map_mul φ g) + rw [he] +omit [Group G] [Group H] in +lemma map_leftInverse (φ : G → H) (ψ : H → G) (h : Function.LeftInverse ψ φ) : + Function.LeftInverse (map ψ id Function.injective_id) (map φ id Function.injective_id) := by + intro x + rw [map_comp] + have he : ψ ∘ φ = id := funext h + rw [he] + exact map_id x +omit [Group H] in +lemma map_closedEmbedding (φ : G → H) (hφ : Function.Injective φ) : + IsClosedEmbedding (map φ id Function.injective_id) := by + obtain ⟨ψ,hψ⟩ := hφ.hasLeftInverse + exact (map_leftInverse φ ψ hψ).isClosedEmbedding + (map ψ id Function.injective_id).continuous (map φ id Function.injective_id).continuous + +def smulMap (g : G) : C(Space G,Space G) := ⟨(g • ·),continuous_const_smul g⟩ +lemma smulMap_closedEmbedding (g : G) : IsClosedEmbedding (smulMap g) := by + exact (Homeomorph.smul g).isClosedEmbedding +end UniversalFInfinity.Milnor + +namespace UniversalFInfinity.TorusGeometry +open Set Topology AscendingTorus +universe u +variable {U : Type u} [Group U] (f : Monoid.End U) + +instance cosetTopology : TopologicalSpace (Coset f) := ⊥ +instance : DiscreteTopology (Coset f) := ⟨rfl⟩ + +def transition (c : Coset f) : C(Milnor.Space U,Milnor.Space U) := + (Milnor.smulMap (cosetOffset f c)).comp (Milnor.map f id Function.injective_id) +lemma transition_apply (c : Coset f) (x : Milnor.Space U) : + transition f c x = cosetOffset f c • Milnor.map f id Function.injective_id x := rfl +lemma transition_embedding (hf : Function.Injective f) (c : Coset f) : + IsClosedEmbedding (transition f c) := + (Milnor.smulMap_closedEmbedding _).comp (Milnor.map_closedEmbedding f hf) + +abbrev Space := GraphBundle.Space (next f) (fun _ => ContinuousMap.id (Milnor.Space U)) (transition f) +def vertex (c : Coset f) (x : Milnor.Space U) : Space f := GraphBundle.vertex _ _ _ c x + +def coordinateAction (g : Torus f) (c : Coset f) : C(Milnor.Space U,Milnor.Space U) := + Milnor.smulMap (actionOffset f g c) +lemma coordinateAction_compatible (hf : Function.Injective f) (g : Torus f) (c : Coset f) (x : Milnor.Space U) : + coordinateAction f g (next f c) (transition f c x) = + transition f (g • c) (coordinateAction f g c x) := by + change actionOffset f g (next f c) • (cosetOffset f c • Milnor.map f id Function.injective_id x) = + cosetOffset f (g • c) • Milnor.map f id Function.injective_id (actionOffset f g c • x) + calc + _ = (actionOffset f g (next f c) * cosetOffset f c) • + Milnor.map f id Function.injective_id x := (mul_smul _ _ _).symm + _ = (cosetOffset f (g • c) * f (actionOffset f g c)) • + Milnor.map f id Function.injective_id x := + congrArg (fun element : U => element • Milnor.map f id Function.injective_id x) + (actionOffset_next f hf g c) + _ = cosetOffset f (g • c) • + (f (actionOffset f g c) • Milnor.map f id Function.injective_id x) := mul_smul _ _ _ + _ = _ := congrArg (cosetOffset f (g • c) • ·) + (Milnor.map_smul f (actionOffset f g c) x).symm +lemma coordinateAction_one (hf : Function.Injective f) (c : Coset f) (x : Milnor.Space U) : + coordinateAction f 1 c x = x := by + change actionOffset f 1 c • x = x + rw [actionOffset_one f hf,one_smul] +lemma coordinateAction_mul (hf : Function.Injective f) (g h : Torus f) (c : Coset f) (x : Milnor.Space U) : + coordinateAction f (g*h) c x = coordinateAction f g (h • c) (coordinateAction f h c x) := by + change actionOffset f (g*h) c • x = actionOffset f g (h • c) • (actionOffset f h c • x) + rw [actionOffset_mul f hf,mul_smul] + +@[instance_reducible] +def action (hf : Function.Injective f) : MulAction (Torus f) (Space f) := + GraphBundle.graphAction (next f) (transition f) (next_smul f) (coordinateAction f) + (coordinateAction_compatible f hf) (coordinateAction_one f hf) (coordinateAction_mul f hf) + +variable [Fact (Function.Injective f)] +local notation "hf" => (Fact.out : Function.Injective f) +local instance : MulAction (Torus f) (Space f) := action f hf +instance action_continuous : ContinuousConstSMul (Torus f) (Space f) := + GraphBundle.graphAction_continuous (next f) (transition f) (next_smul f) (coordinateAction f) + (coordinateAction_compatible f hf) (coordinateAction_one f hf) (coordinateAction_mul f hf) +lemma smul_vertex (g : Torus f) (c : Coset f) (x : Milnor.Space U) : + g • vertex f c x = vertex f (g • c) (actionOffset f g c • x) := rfl +lemma smul_edge (g : Torus f) (c : Coset f) (t : unitInterval) (x : Milnor.Space U) : + g • GraphBundle.edge (next f) (fun _ => ContinuousMap.id _) (transition f) c t x = + GraphBundle.edge (next f) (fun _ => ContinuousMap.id _) (transition f) (g • c) t (actionOffset f g c • x) := + GraphBundle.actionMap_edge (next f) (transition f) (next_smul f) (coordinateAction f) + (coordinateAction_compatible f hf) g c t x +end UniversalFInfinity.TorusGeometry + +namespace UniversalFInfinity.GraphBundle + +section +open Set Topology +open scoped unitInterval +universe u v w z r +variable {C : Type u} [TopologicalSpace C] [DiscreteTopology C] +variable {A : Type v} [TopologicalSpace A] {B : Type w} [TopologicalSpace B] +variable {A' : Type z} [TopologicalSpace A'] {B' : Type r} [TopologicalSpace B'] +variable (τ : C → C) (L R : C → C(B,A)) (L' R' : C → C(B',A')) +variable (i : C(A,A')) (j : C(B,B')) +variable (hL : ∀ c x,i (L c x) = L' c (j x)) (hR : ∀ c x,i (R c x) = R' c (j x)) + +def inclusionFun : Space τ L R → Space τ L' R' := + Sum.map (Prod.map id i) (Prod.map id (Prod.map id j)) +omit [TopologicalSpace C] [DiscreteTopology C] in +lemma inclusionFun_vertex (c : C) (x : A) : + inclusionFun τ L R L' R' i j (vertex τ L R c x) = vertex τ L' R' c (i x) := rfl +omit [TopologicalSpace C] [DiscreteTopology C] in +lemma inclusionFun_interior (c : C) (t : Inner) (x : B) : + inclusionFun τ L R L' R' i j (interior τ L R c t x) = interior τ L' R' c t (j x) := rfl +include hL hR in +omit [TopologicalSpace C] [DiscreteTopology C] in +lemma inclusionFun_edge (c : C) (t : I) (x : B) : + inclusionFun τ L R L' R' i j (edge τ L R c t x) = edge τ L' R' c t (j x) := by + classical + by_cases h0 : t = 0 + · subst t; rw [edge_zero,edge_zero,inclusionFun_vertex,hL] + by_cases h1 : t = 1 + · subst t; rw [edge_one,edge_one,inclusionFun_vertex,hR] + let s : Inner := ⟨t.1,lt_of_le_of_ne t.2.1 (fun h => h0 (Subtype.ext h.symm)), + lt_of_le_of_ne t.2.2 (fun h => h1 (Subtype.ext h))⟩ + change inclusionFun τ L R L' R' i j (edge τ L R c ⟨s.1,s.2.1.le,s.2.2.le⟩ x) = + edge τ L' R' c ⟨s.1,s.2.1.le,s.2.2.le⟩ (j x) + rw [edge_inner,edge_inner]; rfl + +def inclusion : C(Space τ L R,Space τ L' R') := + ⟨inclusionFun τ L R L' R' i j,(continuous_iff τ L R _).mpr ⟨fun c => + (vertexMap τ L' R' c).continuous.comp i.continuous,fun c => by + have he : (fun p : I × B => inclusionFun τ L R L' R' i j (edge τ L R c p.1 p.2)) = + (fun p : I × B => edge τ L' R' c p.1 (j p.2)) := funext (fun p => inclusionFun_edge τ L R L' R' i j hL hR c p.1 p.2) + rw [he] + exact (edgeMap τ L' R' c).continuous.comp (continuous_fst.prodMk (j.continuous.comp continuous_snd))⟩⟩ +lemma inclusion_vertex (c : C) (x : A) : + inclusion τ L R L' R' i j hL hR (vertex τ L R c x) = vertex τ L' R' c (i x) := rfl +lemma inclusion_interior (c : C) (t : Inner) (x : B) : + inclusion τ L R L' R' i j hL hR (interior τ L R c t x) = interior τ L' R' c t (j x) := rfl +lemma inclusion_edge (c : C) (t : I) (x : B) : + inclusion τ L R L' R' i j hL hR (edge τ L R c t x) = edge τ L' R' c t (j x) := + inclusionFun_edge τ L R L' R' i j hL hR c t x + +lemma inclusion_injective (hi : Function.Injective i) (hj : Function.Injective j) : + Function.Injective (inclusion τ L R L' R' i j hL hR) := + Sum.map_injective.mpr ⟨Function.injective_id.prodMap hi,Function.injective_id.prodMap (Function.injective_id.prodMap hj)⟩ + +lemma inclusion_vertex_preimage (S : Set (Space τ L R)) (c : C) : + (vertex τ L' R' c) ⁻¹' (inclusion τ L R L' R' i j hL hR '' S) = + i '' ((vertex τ L R c) ⁻¹' S) := by + ext x + constructor + · rintro ⟨a,ha,he⟩ + change Core (C := C) (A := A) (B := B) at a + cases a with + | inl a => + have hh : (a.1,i a.2) = (c,x) := Sum.inl.inj he + obtain rfl := congrArg Prod.fst hh + exact ⟨a.2,ha,congrArg Prod.snd hh⟩ + | inr a => cases he + · rintro ⟨y,hy,rfl⟩; exact ⟨vertex τ L R c y,hy,rfl⟩ + +lemma inclusion_edge_preimage (S : Set (Space τ L R)) (c : C) : + (fun p : I × B' => edge τ L' R' c p.1 p.2) ⁻¹' (inclusion τ L R L' R' i j hL hR '' S) = + ({0} ×ˢ ((L' c) ⁻¹' (i '' ((vertex τ L R c) ⁻¹' S)))) ∪ + ({1} ×ˢ ((R' c) ⁻¹' (i '' ((vertex τ L R (τ c)) ⁻¹' S)))) ∪ + (Prod.map id j '' ((fun p : I × B => edge τ L R c p.1 p.2) ⁻¹' S)) := by + classical + ext ⟨t,x⟩ + constructor + · intro h + by_cases h0 : t = 0 + · subst t; apply Or.inl; apply Or.inl; refine ⟨rfl,?_⟩ + rw [Set.mem_preimage,edge_zero] at h + exact (Set.ext_iff.mp (inclusion_vertex_preimage τ L R L' R' i j hL hR S c) _).mp h + by_cases h1 : t = 1 + · subst t; apply Or.inl; apply Or.inr; refine ⟨rfl,?_⟩ + rw [Set.mem_preimage,edge_one] at h + exact (Set.ext_iff.mp (inclusion_vertex_preimage τ L R L' R' i j hL hR S (τ c)) _).mp h + let s : Inner := ⟨t.1,lt_of_le_of_ne t.2.1 (fun h => h0 (Subtype.ext h.symm)), + lt_of_le_of_ne t.2.2 (fun h => h1 (Subtype.ext h))⟩ + change edge τ L' R' c ⟨s.1,s.2.1.le,s.2.2.le⟩ x ∈ inclusion τ L R L' R' i j hL hR '' S at h + rw [edge_inner] at h + obtain ⟨a,ha,he⟩ := h + change Core (C := C) (A := A) (B := B) at a + cases a with + | inl a => cases he + | inr a => + have hh : (a.1,(a.2.1,j a.2.2)) = (c,(s,x)) := Sum.inr.inj he + have hc : a.1 = c := congrArg Prod.fst hh + have ht : a.2.1 = s := congrArg (fun p : C × (Inner × B') => p.2.1) hh + have hx : j a.2.2 = x := congrArg (fun p : C × (Inner × B') => p.2.2) hh + apply Or.inr + refine ⟨(t,a.2.2),?_,Prod.ext rfl hx⟩ + change edge τ L R c ⟨s.1,s.2.1.le,s.2.2.le⟩ a.2.2 ∈ S + rw [edge_inner,←hc,←ht] + exact ha + · rintro (h|h) + · rcases h with h|h + · have ht : t = 0 := h.1; subst t + rw [Set.mem_preimage,edge_zero] + exact (Set.ext_iff.mp (inclusion_vertex_preimage τ L R L' R' i j hL hR S c) _).mpr h.2 + · have ht : t = 1 := h.1; subst t + rw [Set.mem_preimage,edge_one] + exact (Set.ext_iff.mp (inclusion_vertex_preimage τ L R L' R' i j hL hR S (τ c)) _).mpr h.2 + · obtain ⟨⟨r,y⟩,hy,he⟩ := h + have ht : r = t := congrArg Prod.fst he + have hx : j y = x := congrArg Prod.snd he + subst t; subst x + exact ⟨edge τ L R c r y,hy,inclusion_edge τ L R L' R' i j hL hR c r y⟩ + +lemma inclusion_closedEmbedding (hi : IsClosedEmbedding i) (hj : IsClosedEmbedding j) : + IsClosedEmbedding (inclusion τ L R L' R' i j hL hR) := by + apply IsClosedEmbedding.of_continuous_injective_isClosedMap (inclusion τ L R L' R' i j hL hR).continuous + (inclusion_injective τ L R L' R' i j hL hR hi.injective hj.injective) + intro S hS + obtain ⟨hv,he⟩ := (isClosed_iff τ L R S).mp hS + apply (isClosed_iff τ L' R' _).mpr + constructor + · intro c; rw [inclusion_vertex_preimage]; exact hi.isClosedMap _ (hv c) + · intro c; rw [inclusion_edge_preimage] + exact ((isClosed_singleton.prod ((hi.isClosedMap _ (hv c)).preimage (L' c).continuous)).union + (isClosed_singleton.prod ((hi.isClosedMap _ (hv (τ c))).preimage (R' c).continuous))).union + ((IsClosedEmbedding.prodMap IsClosedEmbedding.id hj).isClosedMap _ (he c)) +end + +open Set Topology +open scoped unitInterval +universe u v w +variable {C : Type u} [TopologicalSpace C] [DiscreteTopology C] +variable {A : Type v} [TopologicalSpace A] {B : Type w} [TopologicalSpace B] [T1Space B] +variable (τ : C → C) (L R : C → C(B,A)) + +theorem compact_coordinates (hτ : ∀ c,τ c ≠ c) + (hL : ∀ c,IsClosedEmbedding (L c)) (hR : ∀ c,IsClosedEmbedding (R c)) + {K : Set (Space τ L R)} (hK : IsCompact K) : + ∃ (KA : Set A) (KB : Set B), IsCompact KA ∧ IsCompact KB ∧ + (∀ c x,vertex τ L R c x ∈ K → x ∈ KA) ∧ + (∀ c s x,interior τ L R c s x ∈ K → x ∈ KB) := by + let KA := Prod.snd '' ((fun z : C × A => vertex τ L R z.1 z.2) ⁻¹' K) + let J := {c : C | ∃ s x,interior τ L R c s x ∈ K} + let KB := ⋃ c ∈ J, Prod.snd '' ((fun z : I × B => edge τ L R c z.1 z.2) ⁻¹' K) + have hJ : J.Finite := compact_finitely_many_edges τ L R hK + have hA : IsCompact KA := + ((base_closedEmbedding τ L R).isProperMap.isCompact_preimage hK).image continuous_snd + have hB : IsCompact KB := by + apply hJ.isCompact_biUnion + intro c _ + exact ((edge_closedEmbedding τ L R c (hτ c) (hL c) (hR c)).isProperMap.isCompact_preimage hK).image continuous_snd + refine ⟨KA,KB,hA,hB,?_,?_⟩ + · intro c x hx + exact ⟨(c,x),hx,rfl⟩ + · intro c s x hx + apply Set.mem_iUnion₂.mpr + refine ⟨c,⟨s,x,hx⟩,?_⟩ + refine ⟨(⟨s.1,s.2.1.le,s.2.2.le⟩,x),?_,rfl⟩ + change edge τ L R c ⟨s.1,s.2.1.le,s.2.2.le⟩ x ∈ K + rwa [edge_inner] +end UniversalFInfinity.GraphBundle + +namespace UniversalFInfinity.TorusGeometry + +section +open Set Topology Milnor UniversalFInfinity.Simplicial AscendingTorus +open scoped Classical unitInterval +universe u v +variable {U : Type u} [Group U] (f : Monoid.End U) +local instance (priority := 2000) (α : Type*) : DecidableEq (ℕ × α) := Classical.decEq (ℕ × α) + +def vertexShapes (S : Shapes U) : Shapes U := S ∪ imageShapes f id (basedShapes U S) +lemma vertexShapes_left (S : Shapes U) : S ⊆ vertexShapes f S := Finset.subset_union_left +lemma vertexShapes_map (S : Shapes U) (s : Face (stage U S)) : + faceImage f id s.1 ∈ stage U (vertexShapes f S) := by + apply orbitSpan_mono (show imageShapes f id (basedShapes U S) ⊆ basedShapes U (vertexShapes f S) from + fun x hx => Finset.mem_insert_of_mem (Finset.mem_union_right _ hx)) + exact faceImage_controlled f id Function.injective_id (basedShapes U S) s + +def stageForward (S : Shapes U) : C(Milnor.Stage U S,Milnor.Stage U (vertexShapes f S)) := + mapC _ _ (Milnor.vertexMap f id) (vertexShapes_map f S) +lemma stageForward_full (S : Shapes U) (x : Milnor.Stage U S) : + stageFull U (vertexShapes f S) (stageForward f S x) = + map f id Function.injective_id (stageFull U S x) := rfl + +def left (S : Shapes U) : C(Milnor.Stage U S,Milnor.Stage U (vertexShapes f S)) := + stageIncl U S (vertexShapes f S) (vertexShapes_left f S) +def right (S : Shapes U) (c : Coset f) : C(Milnor.Stage U S,Milnor.Stage U (vertexShapes f S)) := + (stageSmul U (vertexShapes f S) (cosetOffset f c)).comp (stageForward f S) +lemma left_full (S : Shapes U) (_c : Coset f) (x : Milnor.Stage U S) : + stageFull U (vertexShapes f S) (left f S x) = (ContinuousMap.id (Milnor.Space U)) (stageFull U S x) := rfl +lemma right_full (S : Shapes U) (c : Coset f) (x : Milnor.Stage U S) : + stageFull U (vertexShapes f S) (right f S c x) = transition f c (stageFull U S x) := rfl + +abbrev Stage (S : Shapes U) := GraphBundle.Space (next f) (fun _ => left f S) (right f S) +def stageFull (S : Shapes U) : C(Stage f S,Space f) := + GraphBundle.inclusion (next f) (fun _ => left f S) (right f S) + (fun _ => ContinuousMap.id _) (transition f) (Milnor.stageFull U (vertexShapes f S)) (Milnor.stageFull U S) + (left_full f S) (right_full f S) +lemma stageFull_closedEmbedding (S : Shapes U) : IsClosedEmbedding (stageFull f S) := + GraphBundle.inclusion_closedEmbedding _ _ _ _ _ _ _ _ _ + (Milnor.stageFull_embedding U _) (Milnor.stageFull_embedding U _) +lemma stageFull_vertex (S : Shapes U) (c : Coset f) (x : Milnor.Stage U (vertexShapes f S)) : + stageFull f S (GraphBundle.vertex _ _ _ c x) = vertex f c (Milnor.stageFull U _ x) := rfl +lemma stageFull_interior (S : Shapes U) (c : Coset f) (t : GraphBundle.Inner) (x : Milnor.Stage U S) : + stageFull f S (GraphBundle.interior _ _ _ c t x) = GraphBundle.interior _ _ _ c t (Milnor.stageFull U _ x) := rfl +lemma stageFull_edge (S : Shapes U) (c : Coset f) (t : I) (x : Milnor.Stage U S) : + stageFull f S (GraphBundle.edge _ _ _ c t x) = GraphBundle.edge _ _ _ c t (Milnor.stageFull U _ x) := + GraphBundle.inclusion_edge _ _ _ _ _ _ _ _ _ c t x + +lemma next_ne (c : Coset f) : next f c ≠ c := by + intro h + have he := height_next f c + rw [h] at he + omega + +theorem compact_controlled (hf : Function.Injective f) {K : Set (Space f)} (hK : IsCompact K) : + ∃ S : Shapes U, K ⊆ Set.range (stageFull f S) := by + obtain ⟨KA,KB,hA,hB,hVA,hEB⟩ := GraphBundle.compact_coordinates (next f) + (fun _ => ContinuousMap.id (Milnor.Space U)) (transition f) (next_ne f) + (fun _ => IsClosedEmbedding.id) (transition_embedding f hf) hK + obtain ⟨S,hS⟩ := Milnor.compact_controlled U hA + obtain ⟨T,hT⟩ := Milnor.compact_controlled U hB + let R := S ∪ T + refine ⟨R,?_⟩ + intro x hx + change GraphBundle.Core (C := Coset f) (A := Milnor.Space U) (B := Milnor.Space U) at x + cases x with + | inl x => + obtain ⟨y,hy⟩ := hS (hVA x.1 x.2 hx) + let z := stageIncl U S (vertexShapes f R) (Finset.subset_union_left.trans (vertexShapes_left f R)) y + exact ⟨GraphBundle.vertex _ _ _ x.1 z,congrArg (vertex f x.1) hy⟩ + | inr x => + obtain ⟨y,hy⟩ := hT (hEB x.1 x.2.1 x.2.2 hx) + let z := stageIncl U T R Finset.subset_union_right y + exact ⟨GraphBundle.interior _ _ _ x.1 x.2.1 z, + congrArg (GraphBundle.interior _ _ _ x.1 x.2.1) hy⟩ +end + +open Set Topology Milnor AscendingTorus +open scoped Classical unitInterval +universe u v +variable {U : Type u} [Group U] (f : Monoid.End U) +variable [Fact (Function.Injective f)] +local notation "hf" => (Fact.out : Function.Injective f) +local instance : MulAction (Torus f) (Space f) := action f hf + +lemma stage_range_smul (S : Shapes U) (g : Torus f) {x : Space f} + (hx : x ∈ Set.range (stageFull f S)) : g • x ∈ Set.range (stageFull f S) := by + obtain ⟨a,rfl⟩ := hx + change GraphBundle.Core (C := Coset f) (A := Milnor.Stage U (vertexShapes f S)) (B := Milnor.Stage U S) at a + cases a with + | inl a => + refine ⟨GraphBundle.vertex _ _ _ (g • a.1) (actionOffset f g a.1 • a.2),?_⟩ + change vertex f (g • a.1) (Milnor.stageFull U _ (actionOffset f g a.1 • a.2)) = + g • vertex f a.1 (Milnor.stageFull U _ a.2) + rw [smul_vertex,Milnor.stageFull_smul] + | inr a => + refine ⟨GraphBundle.interior _ _ _ (g • a.1) a.2.1 (actionOffset f g a.1 • a.2.2),?_⟩ + change stageFull f S (GraphBundle.interior (next f) (fun _ => left f S) (right f S) + (g • a.1) a.2.1 (actionOffset f g a.1 • a.2.2)) = + g • stageFull f S (GraphBundle.interior (next f) (fun _ => left f S) (right f S) a.1 a.2.1 a.2.2) + rw [stageFull_interior,stageFull_interior,Milnor.stageFull_smul] + let t : unitInterval := ⟨a.2.1.1,a.2.1.2.1.le,a.2.1.2.2.le⟩ + have h1 : GraphBundle.interior (next f) (fun _ => ContinuousMap.id (Milnor.Space U)) (transition f) + a.1 a.2.1 (Milnor.stageFull U _ a.2.2) = + GraphBundle.edge (next f) (fun _ => ContinuousMap.id (Milnor.Space U)) (transition f) + a.1 t (Milnor.stageFull U _ a.2.2) := (GraphBundle.edge_inner _ _ _ _ _ _).symm + rw [h1,smul_edge,GraphBundle.edge_inner] + +lemma compact_orbit_controlled {K : Set (Space f)} (hK : IsCompact K) : + ∃ S : Shapes U, ∀ g : Torus f, (g • ·) '' K ⊆ Set.range (stageFull f S) := by + obtain ⟨S,hS⟩ := compact_controlled f hf hK + refine ⟨S,?_⟩ + intro g x hx + obtain ⟨y,hy,rfl⟩ := hx + exact stage_range_smul f S g (hS hy) + +variable {X : Type v} [TopologicalSpace X] [MulAction (Torus f) X] +lemma equivariant_controlled (hX : Milnor.CompactFundamentalSet (Torus f) (X := X)) + (a : C(X,Space f)) (he : ∀ (g : Torus f) x,a (g • x) = g • a x) : + ∃ S : Shapes U, Set.range a ⊆ Set.range (stageFull f S) := by + obtain ⟨K,hK,hcov⟩ := hX + obtain ⟨S,hS⟩ := compact_orbit_controlled f (hK.image a.continuous) + refine ⟨S,?_⟩ + rintro _ ⟨x,rfl⟩ + obtain ⟨g,y,hy,rfl⟩ := hcov x + rw [he] + exact hS g ⟨a y,⟨y,hy,rfl⟩,rfl⟩ + +omit [MulAction (Torus f) X] [Fact (Function.Injective f)] in +def factorStage (a : C(X,Space f)) (S : Shapes U) + (ha : Set.range a ⊆ Set.range (stageFull f S)) : C(X,Stage f S) where + toFun x := (ha (Set.mem_range_self x)).choose + continuous_toFun := (stageFull_closedEmbedding f S).isEmbedding.continuous_iff.mpr (by + convert a.continuous using 1 + funext x + exact (ha (Set.mem_range_self x)).choose_spec) +omit [MulAction (Torus f) X] [Fact (Function.Injective f)] in +lemma factorStage_spec (a : C(X,Space f)) (S : Shapes U) + (ha : Set.range a ⊆ Set.range (stageFull f S)) (x : X) : + stageFull f S (factorStage f a S ha x) = a x := (ha (Set.mem_range_self x)).choose_spec +end UniversalFInfinity.TorusGeometry + +end + +end OAI diff --git a/lean/OAI/GroupTheory/UniversalGroup/TorusHomotopies.lean b/lean/OAI/GroupTheory/UniversalGroup/TorusHomotopies.lean new file mode 100644 index 0000000000000000000000000000000000000000..5e8f5413ea5b0a467539f171358c3798671d6c1c --- /dev/null +++ b/lean/OAI/GroupTheory/UniversalGroup/TorusHomotopies.lean @@ -0,0 +1,449 @@ +import OAI.GroupTheory.UniversalGroup.ControlledCells + +namespace OAI + +noncomputable section + +open Set Metric Topology BigOperators +open Set Metric Topology +open Set Topology +open Set Metric Topology +open scoped NNReal +open Set Metric Topology +open scoped NNReal ENNReal +open Set Metric Topology +open scoped TensorProduct + +namespace UniversalFInfinity.TorusGeometry + +section +open Set Topology Milnor AscendingTorus Cellular +open scoped Classical unitInterval +universe u +variable {U : Type u} [Group U] (f : Monoid.End U) + +abbrev idx (n : ℕ) (c : Coset f) := (next f)^[n] c +lemma idx_next (n : ℕ) (c : Coset f) : idx f n (next f c) = next f (idx f n c) := + (Function.iterate_succ_apply _ _ _).symm.trans (Function.iterate_succ_apply' _ _ _) + +lemma left_full_eq (S : Shapes U) (x : Milnor.Stage U S) : + Milnor.stageFull U (vertexShapes f S) (left f S x) = Milnor.stageFull U S x := rfl + +variable (S T : Shapes U) (n : ℕ) +variable (q : C(Milnor.Stage U (vertexShapes f S),Milnor.Stage U T)) (z : Milnor.Stage U T) +variable (H : q.Homotopy (.const _ z)) +variable (hq : ∀ x,Milnor.stageFull U T (q x) = + Milnor.map (iterateHom f n) id Function.injective_id (Milnor.stageFull U _ x)) + +def firstH (c : Coset f) : C(I × Milnor.Stage U (vertexShapes f S),Milnor.Stage U T) := + (stageSmul U T (forwardOffset f n c)).comp H.toContinuousMap +include hq in +lemma firstH_zero (c : Coset f) (x : Milnor.Stage U (vertexShapes f S)) : + Milnor.stageFull U T (firstH f S T n q z H c (0,x)) = + GraphBundle.forward (next f) (transition f) n c (Milnor.stageFull U _ x) := by + change Milnor.stageFull U T (forwardOffset f n c • H (0,x)) = _ + rw [H.apply_zero,Milnor.stageFull_smul,hq,forward_eq] +lemma firstH_one (c : Coset f) (x : Milnor.Stage U (vertexShapes f S)) : + firstH f S T n q z H c (1,x) = forwardOffset f n c • z := by + change forwardOffset f n c • H (1,x) = _ + rw [H.apply_one]; rfl + +def squareLeft (c : Coset f) : C(I × Milnor.Stage U S,Milnor.Stage U (vertexShapes f T)) := + (right f T (idx f n c)).comp ((firstH f S T n q z H c).comp + (.prodMap (.id I) (left f S))) +def squareRight (c : Coset f) : C(I × Milnor.Stage U S,Milnor.Stage U (vertexShapes f T)) := + (left f T).comp ((firstH f S T n q z H (next f c)).comp + (.prodMap (.id I) (right f S c))) +include hq in +lemma square_start (c : Coset f) (x : Milnor.Stage U S) : + squareLeft f S T n q z H c (0,x) = squareRight f S T n q z H c (0,x) := by + apply (Milnor.stageFull_embedding U _).injective + change Milnor.stageFull U _ (right f T (idx f n c) (firstH f S T n q z H c (0,left f S x))) = + Milnor.stageFull U _ (left f T (firstH f S T n q z H (next f c) (0,right f S c x))) + rw [right_full,left_full_eq,firstH_zero _ _ _ _ _ _ _ hq,firstH_zero _ _ _ _ _ _ _ hq,left_full_eq,right_full] + exact (GraphBundle.forward_natural _ _ n c _).symm +lemma squareLeft_one (c : Coset f) (x : Milnor.Stage U S) : + squareLeft f S T n q z H c (1,x) = right f T (idx f n c) (forwardOffset f n c • z) := by + exact congrArg (right f T (idx f n c)) (firstH_one f S T n q z H c (left f S x)) +lemma squareRight_one (c : Coset f) (x : Milnor.Stage U S) : + squareRight f S T n q z H c (1,x) = left f T (forwardOffset f n (next f c) • z) := by + exact congrArg (left f T) (firstH_one f S T n q z H (next f c) (right f S c x)) + +variable (Z : Shapes U) (e : ℕ) +variable (r : C(Milnor.Stage U (vertexShapes f T),Milnor.Stage U Z)) (w : Milnor.Stage U Z) +variable (J : r.Homotopy (.const _ w)) +variable (hr : ∀ x,Milnor.stageFull U Z (r x) = + Milnor.map (iterateHom f e) id Function.injective_id (Milnor.stageFull U _ x)) + +def secondH (c : Coset f) : C(I × Milnor.Stage U (vertexShapes f S),Milnor.Stage U Z) := + (stageSmul U Z (forwardOffset f e (idx f n c))).comp + (r.comp ((left f T).comp (firstH f S T n q z H c))) +include hr in +lemma secondH_full (c : Coset f) (t : I) (x : Milnor.Stage U (vertexShapes f S)) : + Milnor.stageFull U Z (secondH f S T n q z H Z e r c (t,x)) = + GraphBundle.forward (next f) (transition f) e (idx f n c) + (Milnor.stageFull U T (firstH f S T n q z H c (t,x))) := by + change Milnor.stageFull U Z (forwardOffset f e (idx f n c) • r (left f T (firstH f S T n q z H c (t,x)))) = _ + rw [Milnor.stageFull_smul,hr,left_full_eq,forward_eq] +lemma secondH_one (c : Coset f) (x : Milnor.Stage U (vertexShapes f S)) : + secondH f S T n q z H Z e r c (1,x) = + forwardOffset f e (idx f n c) • r (left f T (forwardOffset f n c • z)) := by + change forwardOffset f e (idx f n c) • r (left f T (firstH f S T n q z H c (1,x))) = _ + rw [firstH_one] +include hq hr in +lemma secondH_start_natural (c : Coset f) (x : Milnor.Stage U S) : + right f Z (idx f e (idx f n c)) (secondH f S T n q z H Z e r c (0,left f S x)) = + left f Z (secondH f S T n q z H Z e r (next f c) (0,right f S c x)) := by + apply (Milnor.stageFull_embedding U _).injective + rw [right_full,left_full_eq,secondH_full _ _ _ _ _ _ _ _ _ _ hr,secondH_full _ _ _ _ _ _ _ _ _ _ hr, + firstH_zero _ _ _ _ _ _ _ hq,firstH_zero _ _ _ _ _ _ _ hq,left_full_eq,right_full] + rw [idx_next,GraphBundle.forward_natural,GraphBundle.forward_natural] + +include hq J in +lemma twoGhost_square (c : Coset f) : + ∃ (P : Path (right f T (idx f n c) (forwardOffset f n c • z)) + (left f T (forwardOffset f n (next f c) • z))) + (Q : C(Milnor.Stage U S,C(I,C(I,Milnor.Stage U Z)))), + (∀ x t,Q x 0 t = r (squareLeft f S T n q z H c (0,x))) ∧ + (∀ x t,Q x 1 t = r (P t)) ∧ + (∀ x s,Q x s 0 = r (squareLeft f S T n q z H c (s,x))) ∧ + (∀ x s,Q x s 1 = r (squareRight f S T n q z H c (s,x))) := by + exact connector_after_nullhomotopy (squareLeft f S T n q z H c) (squareRight f S T n q z H c) + _ _ (square_start f S T n q z H hq c) (squareLeft_one f S T n q z H c) + (squareRight_one f S T n q z H c) (Milnor.stagePoint U S) r w J + +def finalIndex (n e : ℕ) (c : Coset f) := idx f e (idx f n c) +lemma finalIndex_next (n e : ℕ) (c : Coset f) : finalIndex f n e (next f c) = next f (finalIndex f n e c) := by + simp only [finalIndex,idx_next] + +def finalLower (c : Coset f) : C(Milnor.Stage U Z,Stage f Z) := + (GraphBundle.vertexMap (next f) (fun _ => left f Z) (right f Z) (finalIndex f n e c)).comp (left f Z) +def finalUpper (c : Coset f) : C(Milnor.Stage U Z,Stage f Z) := + (GraphBundle.vertexMap (next f) (fun _ => left f Z) (right f Z) (next f (finalIndex f n e c))).comp + (right f Z (finalIndex f n e c)) +def finalHigh (c : Coset f) : C(Milnor.Stage U Z,Stage f Z) := + (GraphBundle.vertexMap (next f) (fun _ => left f Z) (right f Z) (next f (finalIndex f n e c))).comp (left f Z) + +include hr in +lemma final_natural (c : Coset f) (x : Milnor.Stage U T) : + left f Z (forwardOffset f e (idx f n (next f c)) • r (right f T (idx f n c) x)) = + right f Z (finalIndex f n e c) (forwardOffset f e (idx f n c) • r (left f T x)) := by + apply (Milnor.stageFull_embedding U _).injective + rw [left_full_eq,right_full,Milnor.stageFull_smul,Milnor.stageFull_smul,hr,hr,right_full,left_full_eq] + rw [←forward_eq,←forward_eq,idx_next] + exact GraphBundle.forward_natural _ _ e (idx f n c) _ + +def finalPoint (c : Coset f) : Milnor.Stage U Z := + forwardOffset f e (idx f n c) • r (left f T (forwardOffset f n c • z)) + +def shifted_stage (hq : ∀ x,Milnor.stageFull U T (q x) = + Milnor.map (iterateHom f n) id Function.injective_id (Milnor.stageFull U _ x)) + (hr : ∀ x,Milnor.stageFull U Z (r x) = + Milnor.map (iterateHom f e) id Function.injective_id (Milnor.stageFull U _ x)) : C(Stage f S,Stage f Z) := + GraphBundle.lift (next f) (fun _ => left f S) (right f S) + (fun c => (finalLower f n Z e c).comp ((secondH f S T n q z H Z e r c).comp + ⟨fun x => (0,x),continuous_const.prodMk continuous_id⟩)) + (fun c => (GraphBundle.edgeMap (next f) (fun _ => left f Z) (right f Z) (finalIndex f n e c)).comp + ⟨fun p => (p.1,secondH f S T n q z H Z e r c (0,left f S p.2)), + continuous_fst.prodMk ((secondH f S T n q z H Z e r c).continuous.comp + (continuous_const.prodMk ((left f S).continuous.comp continuous_snd)))⟩) + (fun c x => GraphBundle.edge_zero _ _ _ _ _) + (fun c x => by + change GraphBundle.edge (next f) (fun _ => left f Z) (right f Z) (finalIndex f n e c) 1 + (secondH f S T n q z H Z e r c (0,left f S x)) = _ + rw [GraphBundle.edge_one] + change GraphBundle.vertex _ _ _ (next f (finalIndex f n e c)) + (right f Z (finalIndex f n e c) (secondH f S T n q z H Z e r c (0,left f S x))) = + GraphBundle.vertex _ _ _ (finalIndex f n e (next f c)) + (left f Z (secondH f S T n q z H Z e r (next f c) (0,right f S c x))) + rw [finalIndex_next] + exact congrArg (GraphBundle.vertex _ _ _ _) (secondH_start_natural f S T n q z H hq Z e r hr c x)) +lemma shifted_stage_vertex (c : Coset f) (x : Milnor.Stage U (vertexShapes f S)) : + shifted_stage f S T n q z H Z e r hq hr (GraphBundle.vertex _ _ _ c x) = + finalLower f n Z e c (secondH f S T n q z H Z e r c (0,x)) := rfl +lemma shifted_stage_edge (c : Coset f) (t : I) (x : Milnor.Stage U S) : + shifted_stage f S T n q z H Z e r hq hr (GraphBundle.edge _ _ _ c t x) = + GraphBundle.edge (next f) (fun _ => left f Z) (right f Z) (finalIndex f n e c) t + (secondH f S T n q z H Z e r c (0,left f S x)) := + GraphBundle.lift_edge _ _ _ _ _ _ _ c (t,x) + +include hq hr J in + +theorem shifted_stage_nullhomotopic : + (shifted_stage f S T n q z H Z e r hq hr).Nullhomotopic := by + choose P Q hQ0 hQ1 hQL hQR using twoGhost_square f S T n q z H hq Z r w J + let a := shifted_stage f S T n q z H Z e r hq hr + let y (c : Coset f) := finalLower f n Z e c (finalPoint f T n z Z e r c) + let V (c : Coset f) : (a.comp (GraphBundle.vertexMap (next f) (fun _ => left f S) (right f S) c)).Homotopy (.const _ (y c)) := + { toFun tx := finalLower f n Z e c (secondH f S T n q z H Z e r c tx) + continuous_toFun := (finalLower f n Z e c).continuous.comp (secondH f S T n q z H Z e r c).continuous + map_zero_left x := rfl + map_one_left x := congrArg (finalLower f n Z e c) (secondH_one f S T n q z H Z e r c x) } + let E (c : Coset f) (x : Milnor.Stage U Z) : Path (finalLower f n Z e c x) (finalUpper f n Z e c x) := + GraphBundle.edgePath (next f) (fun _ => left f Z) (right f Z) (finalIndex f n e c) x + let K (c : Coset f) : C(I × Milnor.Stage U S,Milnor.Stage U Z) := + (secondH f S T n q z H Z e r c).comp (.prodMap (.id I) (left f S)) + let D (c : Coset f) : C(Milnor.Stage U S,C(I,C(I,Stage f Z))) := + ContinuousMap.curry (ContinuousMap.curry ((finalHigh f n Z e c).comp + ((stageSmul U Z (forwardOffset f e (idx f n (next f c)))).comp ((Q c).uncurry.uncurry)))) + have he (c : Coset f) : Continuous (fun p : Milnor.Stage U Z × I => E c p.1 p.2) := + (GraphBundle.edgeMap (next f) (fun _ => left f Z) (right f Z) _).continuous.comp continuous_swap + have hdleft (c : Coset f) (x : Milnor.Stage U S) (s : I) : + D c x s 0 = finalUpper f n Z e c (K c (s,x)) := by + change finalHigh f n Z e c (forwardOffset f e (idx f n (next f c)) • Q c x s 0) = _ + rw [hQL] + exact congrArg (GraphBundle.vertex (next f) (fun _ => left f Z) (right f Z) (next f (finalIndex f n e c))) + (final_natural f T n Z e r hr c (firstH f S T n q z H c (s,left f S x))) + have hdright (c : Coset f) (x : Milnor.Stage U S) (s : I) : + D c x s 1 = V (next f c) (s,right f S c x) := by + change finalHigh f n Z e c (forwardOffset f e (idx f n (next f c)) • Q c x s 1) = _ + rw [hQR] + change GraphBundle.vertex _ _ _ (next f (finalIndex f n e c)) _ = + GraphBundle.vertex _ _ _ (finalIndex f n e (next f c)) _ + rw [finalIndex_next] + rfl + let p (c : Coset f) : Path (y c) (y (next f c)) := + (GraphBundle.gluedPath (next f) (fun _ => left f S) (right f S) a y V + (finalLower f n Z e) (finalUpper f n Z e) E K D hdleft hdright c (1,Milnor.stagePoint U S)).cast + (congrArg (finalLower f n Z e c) (secondH_one f S T n q z H Z e r c (left f S (Milnor.stagePoint U S))).symm) + ((V (next f c)).apply_one (right f S c (Milnor.stagePoint U S))).symm + apply GraphBundle.nullhomotopic_of_coherent_contraction (next f) (fun _ => left f S) (right f S) + a y V (finalLower f n Z e) (finalUpper f n Z e) E he K D (fun _ _ _ => rfl) hdleft hdright + (fun c x s => ?_) (fun c x s => ?_) p (fun c x s => ?_) + (cosetHeight f) (height_next f) (common_descendant f) (QuotientGroup.mk (1 : Torus f)) + · exact (shifted_stage_edge f S T n q z H hq Z e r hr c s x).symm + · change finalHigh f n Z e c (forwardOffset f e (idx f n (next f c)) • Q c x 0 s) = _ + rw [hQ0,square_start f S T n q z H hq c x] + change GraphBundle.vertex _ _ _ (next f (finalIndex f n e c)) _ = + GraphBundle.vertex _ _ _ (finalIndex f n e (next f c)) _ + rw [finalIndex_next] + rfl + · change ((E c (K c (1,x))).trans _ ) s = + ((E c (K c (1,Milnor.stagePoint U S))).trans _) s + rw [Path.trans_apply,Path.trans_apply] + split_ifs + · change GraphBundle.edge _ _ _ _ _ (secondH f S T n q z H Z e r c (1,left f S x)) = + GraphBundle.edge _ _ _ _ _ (secondH f S T n q z H Z e r c (1,left f S (Milnor.stagePoint U S))) + rw [secondH_one,secondH_one] + · change finalHigh f n Z e c (forwardOffset f e (idx f n (next f c)) • Q c x 1 _) = + finalHigh f n Z e c (forwardOffset f e (idx f n (next f c)) • Q c (Milnor.stagePoint U S) 1 _) + rw [hQ1,hQ1] +end + +open Set Topology Milnor AscendingTorus +open scoped Classical unitInterval +universe u +variable {U : Type u} [Group U] (f : Monoid.End U) +local instance (priority := 2000) (α : Type*) : DecidableEq (ℕ × α) := Classical.decEq (ℕ × α) +variable (S T : Shapes U) (n : ℕ) +variable (q : C(Milnor.Stage U (vertexShapes f S),Milnor.Stage U T)) (z : Milnor.Stage U T) +variable (H : q.Homotopy (.const _ z)) +variable (hq : ∀ x,Milnor.stageFull U T (q x) = + Milnor.map (iterateHom f n) id Function.injective_id (Milnor.stageFull U _ x)) +variable (Z : Shapes U) (e : ℕ) +variable (r : C(Milnor.Stage U (vertexShapes f T),Milnor.Stage U Z)) +variable (hr : ∀ x,Milnor.stageFull U Z (r x) = + Milnor.map (iterateHom f e) id Function.injective_id (Milnor.stageFull U _ x)) +lemma shifted_stage_full : + (stageFull f Z).comp (shifted_stage f S T n q z H Z e r hq hr) = + (GraphBundle.shiftIterate (next f) (transition f) e).comp + ((GraphBundle.shiftIterate (next f) (transition f) n).comp (stageFull f S)) := by + apply GraphBundle.hom_ext + · intro c x + change stageFull f Z (shifted_stage f S T n q z H Z e r hq hr (GraphBundle.vertex _ _ _ c x)) = _ + rw [shifted_stage_vertex] + change stageFull f Z (GraphBundle.vertex _ _ _ (finalIndex f n e c) + (left f Z (secondH f S T n q z H Z e r c (0,x)))) = _ + rw [stageFull_vertex,left_full_eq,secondH_full _ _ _ _ _ _ _ _ _ _ hr, + firstH_zero _ _ _ _ _ _ _ hq] + change GraphBundle.vertex _ _ _ (finalIndex f n e c) _ = + GraphBundle.shiftIterate (next f) (transition f) e + (GraphBundle.shiftIterate (next f) (transition f) n + (stageFull f S (GraphBundle.vertex _ _ _ c x))) + rw [stageFull_vertex,vertex,GraphBundle.shiftIterate_vertex,GraphBundle.shiftIterate_vertex] + rfl + · intro c tx + change stageFull f Z (shifted_stage f S T n q z H Z e r hq hr (GraphBundle.edge _ _ _ c tx.1 tx.2)) = _ + rw [shifted_stage_edge,stageFull_edge,secondH_full _ _ _ _ _ _ _ _ _ _ hr, + firstH_zero _ _ _ _ _ _ _ hq,left_full_eq] + change GraphBundle.edge _ _ _ (finalIndex f n e c) tx.1 _ = + GraphBundle.shiftIterate (next f) (transition f) e + (GraphBundle.shiftIterate (next f) (transition f) n + (stageFull f S (GraphBundle.edge _ _ _ c tx.1 tx.2))) + rw [stageFull_edge,GraphBundle.shiftIterate_edge,GraphBundle.shiftIterate_edge] + rfl +end UniversalFInfinity.TorusGeometry + +namespace UniversalFInfinity.PathFamilies +open Set Topology +open scoped unitInterval +variable {Y : Type*} [TopologicalSpace Y] {x y z : Y} +lemma diagonalSquare_mem (p : Path x y) (q : Path y z) (s t : I) {K : Set Y} + (hp : Set.range p ⊆ K) (hq : Set.range q ⊆ K) : diagonalSquare p q (s,t) ∈ K := by + apply (Set.union_subset hp hq) + rw [←Path.trans_range,←Path.extend_range] + exact Set.mem_range_self (((s:ℝ)+(t:ℝ))/2) +end UniversalFInfinity.PathFamilies + +namespace UniversalFInfinity.TorusGeometry + +section +open Set Topology Milnor AscendingTorus +open scoped Classical unitInterval +universe u v +variable {U : Type u} [Group U] (f : Monoid.End U) +local instance (priority := 2000) (α : Type*) : DecidableEq (ℕ × α) := Classical.decEq (ℕ × α) + +lemma vertexShapes_mono {S T : Shapes U} (h : S ⊆ T) : vertexShapes f S ⊆ vertexShapes f T := by + apply Finset.union_subset_union h + exact Finset.image_subset_image (Finset.insert_subset_insert _ h) +lemma stage_range_mono {S T : Shapes U} (h : S ⊆ T) : + Set.range (stageFull f S) ⊆ Set.range (stageFull f T) := by + rintro _ ⟨x,rfl⟩ + change GraphBundle.Core (C := Coset f) (A := Milnor.Stage U (vertexShapes f S)) (B := Milnor.Stage U S) at x + cases x with + | inl x => + exact ⟨GraphBundle.vertex _ _ _ x.1 (stageIncl U _ _ (vertexShapes_mono f h) x.2),rfl⟩ + | inr x => + exact ⟨GraphBundle.interior _ _ _ x.1 x.2.1 (stageIncl U _ _ h x.2.2),rfl⟩ + +def stageInclusion (S T : Shapes U) (h : S ⊆ T) : C(Stage f S,Stage f T) := + factorStage f (stageFull f S) T (stage_range_mono f h) +lemma stageInclusion_full (S T : Shapes U) (h : S ⊆ T) (x : Stage f S) : + stageFull f T (stageInclusion f S T h x) = stageFull f S x := factorStage_spec f _ _ _ x + +lemma edge_mem_stage (S : Shapes U) (c : Coset f) (t : I) (x : Milnor.Stage U S) : + GraphBundle.edge (next f) (fun _ => ContinuousMap.id _) (transition f) c t (Milnor.stageFull U S x) ∈ + Set.range (stageFull f S) := ⟨GraphBundle.edge _ _ _ c t x,stageFull_edge f S c t x⟩ + +lemma shiftHomotopy_controlled (S : Shapes U) (t : I) (x : Stage f S) : + GraphBundle.shiftHomotopy (next f) (transition f) (t,stageFull f S x) ∈ + Set.range (stageFull f (vertexShapes f S)) := by + change GraphBundle.Core (C := Coset f) (A := Milnor.Stage U (vertexShapes f S)) (B := Milnor.Stage U S) at x + cases x with + | inl x => exact edge_mem_stage f _ x.1 t x.2 + | inr x => + change PathFamilies.diagonalSquare (GraphBundle.edgePath (next f) (fun _ => ContinuousMap.id _) (transition f) x.1 (Milnor.stageFull U S x.2.2)) + (GraphBundle.edgePath (next f) (fun _ => ContinuousMap.id _) (transition f) (next f x.1) + (transition f x.1 (Milnor.stageFull U S x.2.2))) + (t,⟨x.2.1.1,x.2.1.2.1.le,x.2.1.2.2.le⟩) ∈ _ + apply PathFamilies.diagonalSquare_mem + · rintro y ⟨s,rfl⟩ + exact stage_range_mono f (vertexShapes_left f S) (edge_mem_stage f S x.1 s x.2.2) + · rintro y ⟨s,rfl⟩ + exact edge_mem_stage f _ (next f x.1) s (right f S x.1 x.2.2) + +lemma shiftIterateHomotopy_controlled (S : Shapes U) (n : ℕ) : + ∃ T : Shapes U, ∀ (t : I) (x : Stage f S), + GraphBundle.shiftIterateHomotopy (next f) (transition f) n (t,stageFull f S x) ∈ + Set.range (stageFull f T) := by + induction n with + | zero => exact ⟨S,fun _ x => ⟨x,rfl⟩⟩ + | succ n ih => + obtain ⟨T,hT⟩ := ih + refine ⟨vertexShapes f T,?_⟩ + intro t x + change ((GraphBundle.shiftIterateHomotopy (next f) (transition f) n).trans + ((GraphBundle.shiftHomotopy (next f) (transition f)).compContinuousMap + (GraphBundle.shiftIterate (next f) (transition f) n))) (t,stageFull f S x) ∈ _ + refine (congrArg (· ∈ Set.range (stageFull f (vertexShapes f T))) + (ContinuousMap.Homotopy.trans_apply + (GraphBundle.shiftIterateHomotopy (next f) (transition f) n) + ((GraphBundle.shiftHomotopy (next f) (transition f)).compContinuousMap + (GraphBundle.shiftIterate (next f) (transition f) n)) + (t,stageFull f S x))).mpr ?_ + split_ifs + · exact stage_range_mono f (vertexShapes_left f T) (hT _ x) + · have hx := hT 1 x + rw [ContinuousMap.Homotopy.apply_one] at hx + obtain ⟨y,hy⟩ := hx + change GraphBundle.shiftHomotopy (next f) (transition f) (_,GraphBundle.shiftIterate (next f) (transition f) n (stageFull f S x)) ∈ _ + rw [←hy] + exact shiftHomotopy_controlled f T _ y + +variable {X : Type v} [TopologicalSpace X] +def homotopyFactor (S : Shapes U) (a b : C(X,Stage f S)) + (H : ((stageFull f S).comp a).Homotopy ((stageFull f S).comp b)) + (h : ∀ t x,H (t,x) ∈ Set.range (stageFull f S)) : a.Homotopy b where + toContinuousMap := factorStage f H.toContinuousMap S (Set.range_subset_iff.mpr (fun x => h x.1 x.2)) + map_zero_left x := by + apply (stageFull_closedEmbedding f S).injective + exact (factorStage_spec f H.toContinuousMap S _ (0,x)).trans (H.apply_zero x) + map_one_left x := by + apply (stageFull_closedEmbedding f S).injective + exact (factorStage_spec f H.toContinuousMap S _ (1,x)).trans (H.apply_one x) +end + +open Set Topology Milnor AscendingTorus +open scoped Classical unitInterval +universe u +variable {U : Type u} [Group U] (f : Monoid.End U) +local instance (priority := 2000) (α : Type*) : DecidableEq (ℕ × α) := Classical.decEq (ℕ × α) + +lemma doubleShiftHomotopy_controlled (S : Shapes U) (n e : ℕ) : + ∃ R : Shapes U, ∀ (t : I) (x : Stage f S), + ((GraphBundle.shiftIterateHomotopy (next f) (transition f) n).trans + ((GraphBundle.shiftIterateHomotopy (next f) (transition f) e).compContinuousMap + (GraphBundle.shiftIterate (next f) (transition f) n))) (t,stageFull f S x) ∈ + Set.range (stageFull f R) := by + obtain ⟨A,hA⟩ := shiftIterateHomotopy_controlled f S n + obtain ⟨B,hB⟩ := shiftIterateHomotopy_controlled f A e + refine ⟨A ∪ B,?_⟩ + intro t x + refine (congrArg (· ∈ Set.range (stageFull f (A ∪ B))) + (ContinuousMap.Homotopy.trans_apply + (GraphBundle.shiftIterateHomotopy (next f) (transition f) n) + ((GraphBundle.shiftIterateHomotopy (next f) (transition f) e).compContinuousMap + (GraphBundle.shiftIterate (next f) (transition f) n)) + (t,stageFull f S x))).mpr ?_ + split_ifs + · exact stage_range_mono f Finset.subset_union_left (hA _ x) + · have hx := hA 1 x + rw [ContinuousMap.Homotopy.apply_one] at hx + obtain ⟨y,hy⟩ := hx + change GraphBundle.shiftIterateHomotopy (next f) (transition f) e + (_,GraphBundle.shiftIterate (next f) (transition f) n (stageFull f S x)) ∈ _ + rw [←hy] + exact stage_range_mono f Finset.subset_union_right (hB _ y) + +theorem uniform_stage_nullhomotopy + (hghost : ∀ S : Shapes U, ∃ (n : ℕ) (T : Shapes U) + (q : C(Milnor.Stage U S,Milnor.Stage U T)) (z : Milnor.Stage U T), + (∀ x,Milnor.stageFull U T (q x) = + Milnor.map (iterateHom f n) id Function.injective_id (Milnor.stageFull U S x)) ∧ + Nonempty (q.Homotopy (.const _ z))) (S : Shapes U) : + ∃ (R : Shapes U) (hSR : S ⊆ R), (stageInclusion f S R hSR).Nullhomotopic := by + obtain ⟨n,T,q,z,hq,⟨H⟩⟩ := hghost (vertexShapes f S) + obtain ⟨e,Z,r,w,hr,⟨J⟩⟩ := hghost (vertexShapes f T) + obtain ⟨B,hB⟩ := doubleShiftHomotopy_controlled f S n e + let R := S ∪ Z ∪ B + have hSR : S ⊆ R := Finset.Subset.trans Finset.subset_union_left Finset.subset_union_left + have hZR : Z ⊆ R := Finset.Subset.trans Finset.subset_union_right Finset.subset_union_left + have hBR : B ⊆ R := Finset.subset_union_right + let a := stageInclusion f S R hSR + let b := (stageInclusion f Z R hZR).comp (shifted_stage f S T n q z H Z e r hq hr) + let K := ((GraphBundle.shiftIterateHomotopy (next f) (transition f) n).trans + ((GraphBundle.shiftIterateHomotopy (next f) (transition f) e).compContinuousMap + (GraphBundle.shiftIterate (next f) (transition f) n))).compContinuousMap (stageFull f S) + have ha : (stageFull f S) = (stageFull f R).comp a := by + apply ContinuousMap.ext; intro x + exact (stageInclusion_full f S R hSR x).symm + have hb : (GraphBundle.shiftIterate (next f) (transition f) e).comp + ((GraphBundle.shiftIterate (next f) (transition f) n).comp (stageFull f S)) = + (stageFull f R).comp b := by + rw [←shifted_stage_full f S T n q z H hq Z e r hr] + apply ContinuousMap.ext; intro x + exact (stageInclusion_full f Z R hZR _).symm + let K' : ((stageFull f R).comp a).Homotopy ((stageFull f R).comp b) := K.cast ha hb + have hc (t : I) (x : Stage f S) : K' (t,x) ∈ Set.range (stageFull f R) := + stage_range_mono f hBR (hB t x) + let L := homotopyFactor f R a b K' hc + have hn := shifted_stage_nullhomotopic f S T n q z H hq Z e r w J hr + obtain ⟨v,⟨M⟩⟩ := hn + refine ⟨R,hSR,stageInclusion f Z R hZR v,⟨?_⟩⟩ + exact L.trans ((ContinuousMap.Homotopy.refl (stageInclusion f Z R hZR)).comp M) +end UniversalFInfinity.TorusGeometry + +end + +end OAI diff --git a/lean/OAI/GroupTheory/UniversalGroup/TorusSpheres.lean b/lean/OAI/GroupTheory/UniversalGroup/TorusSpheres.lean new file mode 100644 index 0000000000000000000000000000000000000000..414d6f9a861fc0ce96085e8215d8e4704ca33547 --- /dev/null +++ b/lean/OAI/GroupTheory/UniversalGroup/TorusSpheres.lean @@ -0,0 +1,497 @@ +import OAI.GroupTheory.UniversalGroup.TorusHomotopies + +namespace OAI + +noncomputable section + +open Set Metric Topology BigOperators +open Set Metric Topology +open Set Topology +open Set Metric Topology +open scoped NNReal +open Set Metric Topology +open scoped NNReal ENNReal +open Set Metric Topology +open scoped TensorProduct + +namespace UniversalFInfinity.Milnor +open Set Topology UniversalFInfinity.Simplicial +open scoped Classical unitInterval +universe u v w +variable {G : Type u} {H : Type v} +local instance (priority := 2000) (α : Type*) : DecidableEq (ℕ × α) := Classical.decEq (ℕ × α) +def evenLayer (n : ℕ) := 2*n +def oddLayer (n : ℕ) := 2*n+1 +lemma evenLayer_injective : Function.Injective evenLayer := by intro a b h; unfold evenLayer at h; omega +lemma oddLayer_injective : Function.Injective oddLayer := by intro a b h; unfold oddLayer at h; omega +lemma even_ne_odd (a b : ℕ) : evenLayer a ≠ oddLayer b := by unfold evenLayer oddLayer; omega + +lemma mixed_face (φ ψ : G → H) (s : Face (complex G)) : + s.1.image (fun v => (evenLayer v.1,φ v.2)) ∪ s.1.image (fun v => (oddLayer v.1,ψ v.2)) ∈ complex H := by + have h1 := map_face φ evenLayer evenLayer_injective s + have h2 := map_face ψ oddLayer oddLayer_injective s + refine ⟨h1.1.mono Finset.subset_union_left,?_⟩ + intro x hx y hy hxy + rcases Finset.mem_union.mp hx with hx | hx <;> rcases Finset.mem_union.mp hy with hy | hy + · exact h1.2 hx hy hxy + · obtain ⟨a,ha,rfl⟩ := Finset.mem_image.mp hx + obtain ⟨b,hb,rfl⟩ := Finset.mem_image.mp hy + exact False.elim (even_ne_odd a.1 b.1 hxy) + · obtain ⟨a,ha,rfl⟩ := Finset.mem_image.mp hx + obtain ⟨b,hb,rfl⟩ := Finset.mem_image.mp hy + exact False.elim (even_ne_odd b.1 a.1 hxy.symm) + · exact h2.2 hx hy hxy + +def mixedHomotopy (φ ψ : G → H) : + (map φ evenLayer evenLayer_injective).Homotopy (map ψ oddLayer oddLayer_injective) := + straightHomotopy (complex G) (complex H) _ _ + (map_face φ evenLayer evenLayer_injective) (map_face ψ oddLayer oddLayer_injective) (mixed_face φ ψ) + +def bridge (φ ψ : G → H) : + (map φ evenLayer evenLayer_injective).Homotopy (map ψ evenLayer evenLayer_injective) := + (mixedHomotopy φ φ).trans (mixedHomotopy ψ φ).symm + +lemma map_natural (φ φ' : G → H) (δ : G → G) (θ : H → H) + (h : ∀ x,φ' (δ x) = θ (φ x)) (α : ℕ → ℕ) (hα : Function.Injective α) (x : Space G) : + map φ' α hα (map δ id Function.injective_id x) = + map θ id Function.injective_id (map φ α hα x) := by + rw [map_comp,map_comp] + exact congrArg (fun φ => map φ α hα x) (funext h) + +lemma mixedHomotopy_natural (φ ψ φ' ψ' : G → H) (δ : G → G) (θ : H → H) + (hφ : ∀ x,φ' (δ x) = θ (φ x)) (hψ : ∀ x,ψ' (δ x) = θ (ψ x)) (t : I) (x : Space G) : + mixedHomotopy φ' ψ' (t,map δ id Function.injective_id x) = + map θ id Function.injective_id (mixedHomotopy φ ψ (t,x)) := by + apply Subtype.ext + change (1-(t:ℝ)) • (map φ' evenLayer evenLayer_injective (map δ id Function.injective_id x)).1 + + (t:ℝ) • (map ψ' oddLayer oddLayer_injective (map δ id Function.injective_id x)).1 = + ((1-(t:ℝ)) • (map φ evenLayer evenLayer_injective x).1 + + (t:ℝ) • (map ψ oddLayer oddLayer_injective x).1).mapDomain (fun v => (v.1,θ v.2)) + rw [map_natural _ _ _ _ hφ,map_natural _ _ _ _ hψ,Finsupp.mapDomain_add, + Finsupp.mapDomain_smul,Finsupp.mapDomain_smul] + rfl + +lemma bridge_natural (φ ψ φ' ψ' : G → H) (δ : G → G) (θ : H → H) + (hφ : ∀ x,φ' (δ x) = θ (φ x)) (hψ : ∀ x,ψ' (δ x) = θ (ψ x)) (t : I) (x : Space G) : + bridge φ' ψ' (t,map δ id Function.injective_id x) = + map θ id Function.injective_id (bridge φ ψ (t,x)) := by + simp only [bridge,ContinuousMap.Homotopy.trans_apply] + split_ifs + · exact mixedHomotopy_natural φ φ φ' φ' δ θ hφ hφ _ x + · exact mixedHomotopy_natural ψ φ ψ' φ' δ θ hψ hφ _ x +end UniversalFInfinity.Milnor + +namespace UniversalFInfinity.TorusGeometry +open Set Topology AscendingTorus +open scoped Classical unitInterval +universe u +variable {U : Type u} [Group U] (f : Monoid.End U) + +def lowerLabel (c : Coset f) (u : U) : Torus f := origin f c * of f u +def upperLabel (c : Coset f) (u : U) : Torus f := lowerLabel f (next f c) (cosetOffset f c * f u) + +def vertexToMilnor (c : Coset f) : C(Milnor.Space U,Milnor.Space (Torus f)) := + Milnor.map (lowerLabel f c) Milnor.evenLayer Milnor.evenLayer_injective + +def edgeToMilnor (c : Coset f) : C(I × Milnor.Space U,Milnor.Space (Torus f)) := + (Milnor.bridge (lowerLabel f c) (upperLabel f c)).toContinuousMap + +lemma edgeToMilnor_zero (c : Coset f) (x : Milnor.Space U) : + edgeToMilnor f c (0,x) = vertexToMilnor f c x := + (Milnor.bridge (lowerLabel f c) (upperLabel f c)).apply_zero x +lemma edgeToMilnor_one (c : Coset f) (x : Milnor.Space U) : + edgeToMilnor f c (1,x) = vertexToMilnor f (next f c) (transition f c x) := by + change Milnor.bridge _ _ (1,x) = _ + rw [ContinuousMap.Homotopy.apply_one] + change Milnor.map (upperLabel f c) Milnor.evenLayer Milnor.evenLayer_injective x = + Milnor.map (lowerLabel f (next f c)) Milnor.evenLayer Milnor.evenLayer_injective + (Milnor.map (cosetOffset f c * ·) id Function.injective_id (Milnor.map f id Function.injective_id x)) + rw [Milnor.map_comp,Milnor.map_comp] + rfl + +def toMilnor : C(Space f,Milnor.Space (Torus f)) := + GraphBundle.lift (next f) (fun _ => .id _) (transition f) (vertexToMilnor f) (edgeToMilnor f) + (edgeToMilnor_zero f) (edgeToMilnor_one f) +lemma toMilnor_vertex (c : Coset f) (x : Milnor.Space U) : + toMilnor f (vertex f c x) = vertexToMilnor f c x := rfl +lemma toMilnor_edge (c : Coset f) (t : I) (x : Milnor.Space U) : + toMilnor f (GraphBundle.edge _ _ _ c t x) = edgeToMilnor f c (t,x) := + GraphBundle.lift_edge _ _ _ _ _ _ _ c (t,x) + +lemma lowerLabel_action (g : Torus f) (c : Coset f) (u : U) : + lowerLabel f (g • c) (actionOffset f g c * u) = g * lowerLabel f c u := by + unfold lowerLabel + rw [map_mul,←mul_assoc,origin_action,mul_assoc] +lemma upperLabel_action (hf : Function.Injective f) (g : Torus f) (c : Coset f) (u : U) : + upperLabel f (g • c) (actionOffset f g c * u) = g * upperLabel f c u := by + unfold upperLabel + rw [map_mul,←mul_assoc,←actionOffset_next f hf,mul_assoc,next_smul] + exact lowerLabel_action f g (next f c) (cosetOffset f c * f u) + +variable [Fact (Function.Injective f)] +local notation "hf" => (Fact.out : Function.Injective f) +local instance : MulAction (Torus f) (Space f) := action f hf +lemma toMilnor_equivariant (g : Torus f) (x : Space f) : + toMilnor f (g • x) = g • toMilnor f x := by + change GraphBundle.Core (C := Coset f) (A := Milnor.Space U) (B := Milnor.Space U) at x + cases x with + | inl x => + change vertexToMilnor f (g • x.1) (actionOffset f g x.1 • x.2) = g • vertexToMilnor f x.1 x.2 + exact Milnor.map_natural (lowerLabel f x.1) (lowerLabel f (g • x.1)) + (actionOffset f g x.1 * ·) (g * ·) (lowerLabel_action f g x.1) _ _ x.2 + | inr x => + let t : I := ⟨x.2.1.1,x.2.1.2.1.le,x.2.1.2.2.le⟩ + have hx : (Sum.inr x : Space f) = GraphBundle.edge (next f) (fun _ => ContinuousMap.id _) + (transition f) x.1 t x.2.2 := (GraphBundle.edge_inner _ _ _ _ _ _).symm + rw [hx,smul_edge,toMilnor_edge,toMilnor_edge] + exact Milnor.bridge_natural (lowerLabel f x.1) (upperLabel f x.1) + (lowerLabel f (g • x.1)) (upperLabel f (g • x.1)) (actionOffset f g x.1 * ·) (g * ·) + (lowerLabel_action f g x.1) (upperLabel_action f hf g x.1) _ x.2.2 +end UniversalFInfinity.TorusGeometry + +namespace UniversalFInfinity.GraphBundle +open Set Topology Cellular +open scoped unitInterval +universe u v +variable {C : Type u} [TopologicalSpace C] [DiscreteTopology C] +variable {A : Type v} [TopologicalSpace A] +variable (τ : C → C) (F : C → C(A,A)) (z : A) +variable (H : (ContinuousMap.id A).Homotopy (.const _ z)) + +def contractionSquare (c : C) : SquareBoundary A A where + b := (ContinuousMap.curry ((F c).comp .fst)).prodMk + (.const _ ⟨fun t => H (t,F c z),H.continuous.comp (continuous_id.prodMk continuous_const)⟩) + c := (ContinuousMap.curry ⟨fun p : A × I => F c (H (p.2,p.1)), + (F c).continuous.comp (H.continuous.comp continuous_swap)⟩).prodMk + (ContinuousMap.curry ⟨fun p : A × I => H (p.2,F c p.1), + H.continuous.comp (continuous_snd.prodMk ((F c).continuous.comp continuous_fst))⟩) + zero x := by + apply Prod.ext <;> change F c x = _ + · exact congrArg (F c) (H.apply_zero x).symm + · exact (H.apply_zero (F c x)).symm + one x := by + apply Prod.ext + · change H (0,F c z) = F c (H (1,x)) + rw [H.apply_zero,H.apply_one]; rfl + · change H (1,F c z) = H (1,F c x) + rw [H.apply_one,H.apply_one]; rfl + +omit [TopologicalSpace C] [DiscreteTopology C] in +lemma contractionSquare_filling (c : C) : + ∃ Q : C(A,C(I,C(I,A))), + (∀ x t,Q x 0 t = F c x) ∧ + (∀ x t,Q x 1 t = H (t,F c z)) ∧ + (∀ x s,Q x s 0 = F c (H (s,x))) ∧ + (∀ x s,Q x s 1 = H (s,F c x)) := + (contractionSquare F z H c).fill_after_nullhomotopy (.id A) z H + +include z H in + +theorem homogeneous_contractible + (height : C → ℤ) (hτ : ∀ c,height (τ c) = height c+1) + (hc : ∀ c d,∃ m n : ℕ,τ^[m] c = τ^[n] d) (root : C) : + ContractibleSpace (Space τ (fun _ => ContinuousMap.id A) F) := by + choose Q hQ0 hQ1 hQL hQR using contractionSquare_filling F z H + let L : C → C(A,A) := fun _ => .id A + let W := Space τ L F + let y : C → W := fun c => vertex τ L F c z + let V (c : C) : ((ContinuousMap.id W).comp (vertexMap τ L F c)).Homotopy (.const _ (y c)) := + (ContinuousMap.Homotopy.refl (vertexMap τ L F c)).comp H + let b (c : C) : C(A,W) := (vertexMap τ L F (τ c)).comp (F c) + let E (c : C) (x : A) : Path (vertex τ L F c x) (b c x) := edgePath τ L F c x + let J (c : C) : C(A,C(I,C(I,W))) := ContinuousMap.curry (ContinuousMap.curry + ((vertexMap τ L F (τ c)).comp ((Q c).uncurry.uncurry))) + let P (c : C) : Path (b c z) (y (τ c)) := + { toFun t := vertex τ L F (τ c) (H (t,F c z)) + continuous_toFun := (vertexMap τ L F (τ c)).continuous.comp + (H.continuous.comp (continuous_id.prodMk continuous_const)) + source' := congrArg (vertex τ L F (τ c)) (H.apply_zero (F c z)) + target' := congrArg (vertex τ L F (τ c)) (H.apply_one (F c z)) } + let p (c : C) : Path (y c) (y (τ c)) := (E c z).trans (P c) + have he (c : C) : Continuous (fun a : A × I => E c a.1 a.2) := + (edgeMap τ L F c).continuous.comp continuous_swap + have hleft (c : C) (t : I) (x : A) : vertexMap τ L F c (H (t,x)) = V c (t,L c x) := rfl + have hleftQ (c : C) (x : A) (t : I) : J c x t 0 = b c (H (t,x)) := + congrArg (vertex τ L F (τ c)) (hQL c x t) + have hrightQ (c : C) (x : A) (t : I) : J c x t 1 = V (τ c) (t,F c x) := + congrArg (vertex τ L F (τ c)) (hQR c x t) + apply (contractible_iff_id_nullhomotopic _).mpr + apply nullhomotopic_of_coherent_contraction τ L F (.id W) y V (vertexMap τ L F) b E he + (fun _ => H.toContinuousMap) J hleft hleftQ hrightQ + (fun c x s => ?_) (fun c x s => ?_) p (fun c x s => ?_) height hτ hc root + · change edge τ L F c s (H (0,x)) = edge τ L F c s x + rw [H.apply_zero]; rfl + · exact congrArg (vertex τ L F (τ c)) (hQ0 c x s) + · change ((E c (H (1,x))).trans (connectorPath τ L F (.id W) y V b + (fun _ => H.toContinuousMap) J hleftQ hrightQ c (1,x))) s = ((E c z).trans (P c)) s + rw [Path.trans_apply,Path.trans_apply] + split_ifs + · change edge τ L F c _ (H (1,x)) = edge τ L F c _ z + rw [H.apply_one]; rfl + · exact congrArg (vertex τ L F (τ c)) (hQ1 c x _) +end UniversalFInfinity.GraphBundle + +namespace UniversalFInfinity.TorusGeometry +open Set Topology Milnor AscendingTorus +variable {U : Type*} [Group U] (f : Monoid.End U) + +lemma contractible : ContractibleSpace (Space f) := by + have h := (contractible_iff_id_nullhomotopic (Milnor.Space U)).mp (Milnor.contractible (G := U)) + obtain ⟨z,⟨H⟩⟩ := h + exact GraphBundle.homogeneous_contractible (next f) (transition f) z H + (cosetHeight f) (height_next f) (common_descendant f) (coset f 1) +end UniversalFInfinity.TorusGeometry +namespace UniversalFInfinity.Milnor +open Set Metric Topology Cellular +universe u +variable (G : Type u) [Group G] +local instance (priority := 2000) (α : Type*) : DecidableEq (ℕ × α) := Classical.decEq (ℕ × α) + +lemma stageCell_dimension_bound (S : Shapes G) (n : ℕ) (i : StageCell G S n) : + n < (basedShapes G S).sup Finset.card := by + obtain ⟨g,s,hs,his⟩ := i.1.2.2 + have hcard := Finset.card_le_card his + rw [translate_card,i.2] at hcard + have hd := Finset.le_sup (f := Finset.card) hs + omega + +lemma stageEquivariant_bounded (S : Shapes G) : + let : CWComplex (univ : Set (Stage G S)) := stageEquivariantCW G S + ∃ d : ℕ, Skeleton (univ : Set (Stage G S)) d = univ := by + let : CWComplex (univ : Set (Stage G S)) := stageEquivariantCW G S + refine ⟨(basedShapes G S).sup Finset.card,Set.eq_univ_of_forall (fun x => ?_)⟩ + have hx : x ∈ (univ : Set (Stage G S)) := mem_univ _ + rw [←CWComplex.iUnion_openCell_eq_complex (C := (univ : Set (Stage G S)))] at hx + simp only [mem_iUnion] at hx + obtain ⟨n,i,hi⟩ := hx + have hn := stageCell_dimension_bound G S n (cellCoordinates G S n i) + exact CWComplex.skeletonLT_mono (C := (univ : Set (Stage G S))) + (m := (n : ℕ∞)+1) (n := (((basedShapes G S).sup Finset.card : ℕ) : ℕ∞)) + (by exact_mod_cast Nat.succ_le_of_lt hn) + (CWComplex.closedCell_subset_skeletonLT n i (CWComplex.openCell_subset_closedCell n i hi)) + +lemma stage_compactFundamentalSet (S : Shapes G) : CompactFundamentalSet G (X := Stage G S) := by + let : CWComplex (univ : Set (Stage G S)) := stageEquivariantCW G S + let σ : ∀ n, (G × CellOrbits G S n) ≃ RelCWComplex.cell (univ : Set (Stage G S)) n := + fun _ => Equiv.refl _ + have hσ : ∀ n (g h : G) (i : CellOrbits G S n) (x : Fin n → ℝ), + RelCWComplex.map n (σ n (g*h,i)) x = g • RelCWComplex.map n (σ n (h,i)) x := by + intro n g h i x + exact mul_smul g h _ + obtain ⟨d,hd⟩ := stageEquivariant_bounded G S + obtain ⟨K,hK,hcov⟩ := skeleton_compact_representatives σ hσ d + refine ⟨Subtype.val '' K,hK.image continuous_subtype_val,?_⟩ + intro x + have hx : x ∈ Skeleton (univ : Set (Stage G S)) d := by rw [hd]; trivial + obtain ⟨g,y,hy,he⟩ := hcov ⟨x,hx⟩ + refine ⟨g,y.1,⟨y,hy,rfl⟩,?_⟩ + exact congrArg Subtype.val he +end UniversalFInfinity.Milnor +namespace UniversalFInfinity.TorusGeometry +open Set Topology AscendingTorus +open scoped unitInterval +universe u +variable {U : Type u} [Group U] (f : Monoid.End U) +variable [Fact (Function.Injective f)] +local notation "hf" => (Fact.out : Function.Injective f) +local instance : MulAction (Torus f) (Space f) := action f hf + +lemma exists_moveOffset (c d : Coset f) (u : U) : + ∃ g : Torus f, g • c = d ∧ actionOffset f g c = u := by + let g := origin f d * of f u * (origin f c)⁻¹ + have hg : g * origin f c = origin f d * of f u := by simp [g,mul_assoc] + have hgc : g • c = d := by + rw [←coset_origin f c,smul_coset,hg,←coset_origin f d] + apply QuotientGroup.eq.mpr + refine ⟨u⁻¹,?_⟩ + simp [map_inv,mul_assoc] + refine ⟨g,hgc,?_⟩ + apply of_injective f hf + apply mul_left_cancel (a := origin f d) + have h := origin_action f g c + rw [hgc,hg] at h + exact h + +lemma stage_compact_representatives (S : Milnor.Shapes U) : + ∃ K : Set (Space f), IsCompact K ∧ + ∀ x : Stage f S, ∃ g : Torus f, ∃ y ∈ K, stageFull f S x = g • y := by + obtain ⟨A,hA,hAcov⟩ := Milnor.stage_compactFundamentalSet U (vertexShapes f S) + obtain ⟨B,hB,hBcov⟩ := Milnor.stage_compactFundamentalSet U S + let c := coset f 1 + let v : C(Milnor.Stage U (vertexShapes f S),Space f) := + (GraphBundle.vertexMap _ _ _ c).comp (Milnor.stageFull U (vertexShapes f S)) + let e : C(I × Milnor.Stage U S,Space f) := + (GraphBundle.edgeMap _ _ _ c).comp + (ContinuousMap.prodMap (.id I) (Milnor.stageFull U S)) + let K := v '' A ∪ e '' (univ ×ˢ B) + have hK : IsCompact K := (hA.image v.continuous).union ((isCompact_univ.prod hB).image e.continuous) + refine ⟨K,hK,?_⟩ + intro x + change GraphBundle.Core (C := Coset f) (A := Milnor.Stage U (vertexShapes f S)) (B := Milnor.Stage U S) at x + cases x with + | inl x => + obtain ⟨u,y,hy,he⟩ := hAcov x.2 + obtain ⟨g,hg,ho⟩ := exists_moveOffset f c x.1 u + refine ⟨g,v y,Or.inl ⟨y,hy,rfl⟩,?_⟩ + change vertex f x.1 (Milnor.stageFull U _ x.2) = g • vertex f c (Milnor.stageFull U _ y) + rw [smul_vertex,hg,ho,he,Milnor.stageFull_smul] + | inr x => + obtain ⟨u,y,hy,he⟩ := hBcov x.2.2 + obtain ⟨g,hg,ho⟩ := exists_moveOffset f c x.1 u + let t : I := ⟨x.2.1.1,x.2.1.2.1.le,x.2.1.2.2.le⟩ + refine ⟨g,e (t,y),Or.inr ⟨(t,y),⟨mem_univ _,hy⟩,rfl⟩,?_⟩ + change stageFull f S (GraphBundle.interior _ _ _ x.1 x.2.1 x.2.2) = _ + rw [stageFull_interior] + change GraphBundle.interior _ _ _ x.1 x.2.1 (Milnor.stageFull U _ x.2.2) = + g • GraphBundle.edge (next f) (fun _ => ContinuousMap.id _) (transition f) c t (Milnor.stageFull U S y) + rw [smul_edge,hg,ho,GraphBundle.edge_inner,he,Milnor.stageFull_smul] + +lemma toMilnor_controlled (S : Milnor.Shapes U) : + ∃ T : Milnor.Shapes (Torus f), Set.range ((toMilnor f).comp (stageFull f S)) ⊆ + Set.range (Milnor.stageFull (Torus f) T) := by + obtain ⟨K,hK,hcov⟩ := stage_compact_representatives f S + obtain ⟨T,hT⟩ := Milnor.compact_orbit_controlled (Torus f) (hK.image (toMilnor f).continuous) + refine ⟨T,?_⟩ + rintro _ ⟨x,rfl⟩ + obtain ⟨g,y,hy,he⟩ := hcov x + change toMilnor f (stageFull f S x) ∈ _ + rw [he,toMilnor_equivariant] + exact hT g ⟨toMilnor f y,⟨y,hy,rfl⟩,rfl⟩ +end UniversalFInfinity.TorusGeometry +namespace UniversalFInfinity.SphereTopology +open Set Topology Cellular +lemma sphereFillable_of_contractible {Y : Type*} [TopologicalSpace Y] [ContractibleSpace Y] : + SphereFillable Y := by + obtain ⟨z,⟨H⟩⟩ := id_nullhomotopic Y + intro n a + cases n with + | zero => exact fill_zero a + | succ n => + let := sphere_nonempty n + obtain ⟨e,he⟩ := extends_of_nullhomotopic (H.compContinuousMap a).symm + exact ⟨e,fun x => ContinuousMap.congr_fun he x⟩ +end UniversalFInfinity.SphereTopology + +namespace UniversalFInfinity.TorusGeometry + +section +open Set Topology AscendingTorus Cellular +open scoped unitInterval +universe u +variable {U : Type u} [Group U] (f : Monoid.End U) +variable [hfi : Fact (Function.Injective f)] +local notation "hf" => (Fact.out : Function.Injective f) +local instance : MulAction (Torus f) (Space f) := action f hf +local instance (priority := 2000) (α : Type*) : DecidableEq (ℕ × α) := Classical.decEq (ℕ × α) + +omit hfi in + +theorem milnor_uniform_nullhomotopy [Fact (Function.Injective f)] + (hgraph : ∀ S : Milnor.Shapes U, ∃ (R : Milnor.Shapes U) (hSR : S ⊆ R), + (stageInclusion f S R hSR).Nullhomotopic) + (S : Milnor.Shapes (Torus f)) : + ∃ (R : Milnor.Shapes (Torus f)) (hSR : S ⊆ R), + (Milnor.stageIncl (Torus f) S R hSR).Nullhomotopic := by + let G := Torus f + let : CWComplex (univ : Set (Milnor.Stage G S)) := Milnor.stageEquivariantCW G S + let κ : ∀ n, (G × Milnor.CellOrbits G S n) ≃ RelCWComplex.cell (univ : Set (Milnor.Stage G S)) n := + fun _ => Equiv.refl _ + have hκ : ∀ n (g h : G) (i : Milnor.CellOrbits G S n) (x : Fin n → ℝ), + RelCWComplex.map n (κ n (g*h,i)) x = g • RelCWComplex.map n (κ n (h,i)) x := by + intro n g h i x + exact mul_smul g h _ + obtain ⟨d,hd⟩ := Milnor.stageEquivariant_bounded G S + let back : C(Milnor.Stage G S,Skeleton (univ : Set (Milnor.Stage G S)) d) := + ⟨fun x => ⟨x,by rw [hd]; trivial⟩,continuous_id.subtype_mk (fun x => by rw [hd]; trivial)⟩ + have hback (g : G) (x : Milnor.Stage G S) : + back (g • x) = skeletonTranslate κ hκ d g (back x) := rfl + let : ContractibleSpace (Space f) := contractible f + have hfill := SphereTopology.sphereFillable_of_contractible (Y := Space f) + obtain ⟨e,he⟩ := exists_equivariant_map_on_skeleton κ hκ d (fun n _ => hfill n) + let e' := e.comp back + have he' (g : G) x : e' (g • x) = g • e' x := by + change e (back (g • x)) = g • e (back x) + rw [hback,he] + obtain ⟨A,hA⟩ := equivariant_controlled f (Milnor.stage_compactFundamentalSet G S) e' he' + let q := factorStage f e' A hA + obtain ⟨B,hAB,z,⟨J⟩⟩ := hgraph A + obtain ⟨T,hT⟩ := toMilnor_controlled f B + let tmap := Milnor.factorStage G ((toMilnor f).comp (stageFull f B)) T hT + let a := (Milnor.stageFull G S).comp (skeletonInclusion (C := (univ : Set (Milnor.Stage G S))) d) + let b := (toMilnor f).comp e + have ha (g : G) x : a (skeletonTranslate κ hκ d g x) = g • a x := Milnor.stageFull_smul G S g x.1 + have hb (g : G) x : b (skeletonTranslate κ hκ d g x) = g • b x := by + change toMilnor f (e (skeletonTranslate κ hκ d g x)) = g • toMilnor f (e x) + rw [he,toMilnor_equivariant] + obtain ⟨H,hH⟩ := exists_equivariant_homotopy_on_skeleton κ hκ d (Milnor.sphereFillable (1:G)) a b ha hb + obtain ⟨Q,hQ⟩ := Milnor.controlled_skeleton_homotopy κ hκ d a b H hH + let R := S ∪ T ∪ Q + have hSR : S ⊆ R := Finset.subset_union_left.trans Finset.subset_union_left + have hTR : T ⊆ R := Finset.subset_union_right.trans Finset.subset_union_left + have hQR : Q ⊆ R := Finset.subset_union_right + let out := (Milnor.stageIncl G T R hTR).comp tmap + let inc := Milnor.stageIncl G S R hSR + let target := out.comp ((stageInclusion f A B hAB).comp q) + let H' := H.compContinuousMap back + have hHR : Set.range H'.toContinuousMap ⊆ Set.range (Milnor.stageFull G R) := by + rintro _ ⟨x,rfl⟩ + obtain ⟨y,hy⟩ := hQ (Set.mem_range_self (x.1,back x.2)) + exact ⟨Milnor.stageIncl G Q R hQR y,hy⟩ + let HTmap := Milnor.factorStage G H'.toContinuousMap R hHR + have hout (y : Stage f B) : Milnor.stageFull G R (out y) = toMilnor f (stageFull f B y) := by + change Milnor.stageFull G T (tmap y) = _ + exact Milnor.factorStage_spec G _ T hT y + let HT : inc.Homotopy target := + { toContinuousMap := HTmap + map_zero_left := fun x => by + apply (Milnor.stageFull_embedding G R).injective + change Milnor.stageFull G R (HTmap (0,x)) = Milnor.stageFull G R (inc x) + rw [Milnor.factorStage_spec] + change H' (0,x) = _ + rw [H'.apply_zero] + rfl + map_one_left := fun x => by + apply (Milnor.stageFull_embedding G R).injective + change Milnor.stageFull G R (HTmap (1,x)) = Milnor.stageFull G R (out (stageInclusion f A B hAB (q x))) + rw [Milnor.factorStage_spec] + change H' (1,x) = _ + rw [H'.apply_one,hout,stageInclusion_full,factorStage_spec] + rfl } + refine ⟨R,hSR,out z,⟨?_⟩⟩ + exact HT.trans ((ContinuousMap.Homotopy.refl out).comp (J.compContinuousMap q)) +end + +open Set Topology AscendingTorus ConcreteEnvelopes +variable {U : Type} [Group U] [Group.IsFinitelyPresented U] + [TopologicalSpace U] [DiscreteTopology U] +variable (k : Index → U →* U) (hk : IsDiagram k) +local instance (priority := 2000) (α : Type*) : DecidableEq (ℕ × α) := Classical.decEq (ℕ × α) + +include hk in +lemma diagram_graph_uniform_nullhomotopy (S : Milnor.Shapes U) : + let f : Monoid.End U := k (.inl P₂.identity) + ∃ (R : Milnor.Shapes U) (hSR : S ⊆ R), + (stageInclusion f S R hSR).Nullhomotopic := by + apply uniform_stage_nullhomotopy + intro A + obtain ⟨n,T,q,z,hq,H⟩ := Milnor.diagram_uniform_stage_nullhomotopy k hk A + refine ⟨n,T,q,z,?_,H⟩ + intro x + apply Subtype.ext + exact hq x + +include hk in + +theorem diagram_milnor_uniform_nullhomotopy + [Fact (Function.Injective (k (.inl P₂.identity)))] + (S : Milnor.Shapes (Torus (k (.inl P₂.identity)))) : + ∃ (R : Milnor.Shapes (Torus (k (.inl P₂.identity)))) (hSR : S ⊆ R), + (Milnor.stageIncl (Torus (k (.inl P₂.identity))) S R hSR).Nullhomotopic := + @milnor_uniform_nullhomotopy U _ (k (.inl P₂.identity)) + ⟨(Fact.out : Function.Injective (k (.inl P₂.identity)))⟩ + (diagram_graph_uniform_nullhomotopy k hk) S +end UniversalFInfinity.TorusGeometry + +end + +end OAI diff --git a/lean/OAI/GroupTheory/UniversalGroup/TowerCoverings.lean b/lean/OAI/GroupTheory/UniversalGroup/TowerCoverings.lean new file mode 100644 index 0000000000000000000000000000000000000000..33b9a3ca1c6a354be3f02e6b84200182fa11c43d --- /dev/null +++ b/lean/OAI/GroupTheory/UniversalGroup/TowerCoverings.lean @@ -0,0 +1,312 @@ +import OAI.GroupTheory.UniversalGroup.TopologicalTowers + +namespace OAI + +noncomputable section + +open Set Metric Topology BigOperators +open Set Metric Topology +open Set Topology +open Set Metric Topology +open scoped NNReal +open Set Metric Topology +open scoped NNReal ENNReal +open Set Metric Topology +open scoped TensorProduct + +namespace UniversalFInfinity.TopologicalTower + +section +open Set Topology +universe u v w +variable {G : Type w} [Group G] +variable (X : ℕ → Type u) [∀ n, TopologicalSpace (X n)] [∀ n, MulAction G (X n)] +variable (f : ∀ i j, i ≤ j → C(X i,X j)) [DirectedSystem X (f · · ·)] + +class EquivariantSystem : Prop where + map_smul : ∀ i j h (g : G) x, f i j h (g • x) = g • f i j h x + +variable [EquivariantSystem (G := G) X f] + +instance limitMulAction : MulAction G (Space X f) where + smul g := DirectLimit.lift f (fun n x => of X f n (g • x)) (fun i j h x => by + rw [← EquivariantSystem.map_smul i j h g x,of_compat]) + one_smul z := by + obtain ⟨n,x,rfl⟩ := DirectLimit.exists_eq_mk f z + change of X f n ((1:G) • x) = of X f n x + rw [one_smul] + mul_smul g h z := by + obtain ⟨n,x,rfl⟩ := DirectLimit.exists_eq_mk f z + change of X f n ((g*h) • x) = of X f n (g • h • x) + rw [mul_smul] + +@[simp] lemma smul_of (g : G) (n : ℕ) (x : X n) : + g • of X f n x = of X f n (g • x) := rfl + +instance [∀ n, ContinuousConstSMul G (X n)] : ContinuousConstSMul G (Space X f) where + continuous_const_smul g := (continuous_iff X f _).mpr (fun n => + (continuous_of X f n).comp (continuous_const_smul g)) + +end + +section +open Set Topology +universe u v +variable (X : ℕ → Type u) [∀ n, TopologicalSpace (X n)] +variable (f : ∀ i j, i ≤ j → C(X i,X j)) [DirectedSystem X (f · · ·)] +variable (hf : ∀ i j h, IsClosedEmbedding (f i j h)) +variable (k : ℕ) (U : ∀ n, k ≤ n → Set (X n)) +variable (hU : ∀ i j (hi : k ≤ i) (hij : i ≤ j), f i j hij ⁻¹' U j (hi.trans hij) = U i hi) + +def tailSet : Set (Space X f) := ⋃ n, ⋃ hn : k ≤ n, of X f n '' U n hn + +include hf hU in +lemma preimage_tailSet (n : ℕ) (hn : k ≤ n) : + of X f n ⁻¹' tailSet X f k U = U n hn := by + ext x + constructor + · intro hx + obtain ⟨j,hj,y,hy,hyx⟩ : ∃ j, ∃ (hj : k ≤ j), ∃ y ∈ U j hj, + of X f j y = of X f n x := by simpa only [tailSet,Set.mem_preimage,Set.mem_iUnion,Set.mem_image] using hx + let m := max j n + have he : f j m (le_max_left _ _) y = f n m (le_max_right _ _) x := + of_injective X f hf m ((of_compat X f j m (le_max_left _ _) y).trans + (hyx.trans (of_compat X f n m (le_max_right _ _) x).symm)) + have hym : f j m (le_max_left _ _) y ∈ U m (hj.trans (le_max_left _ _)) := by + change y ∈ f j m (le_max_left _ _) ⁻¹' U m _ + rw [hU] + exact hy + rw [he] at hym + change x ∈ f n m (le_max_right _ _) ⁻¹' U m _ at hym + rw [hU] at hym + exact hym + · intro hx + exact Set.mem_iUnion.mpr ⟨n,Set.mem_iUnion.mpr ⟨hn,⟨x,hx,rfl⟩⟩⟩ + +include hf hU in +lemma tailSet_isOpen (hopen : ∀ n hn, IsOpen (U n hn)) : IsOpen (tailSet X f k U) := by + change @IsOpen _ (TopologicalSpace.coinduced (fun x : Σ n, X n => of X f x.1 x.2) inferInstance) _ + rw [isOpen_coinduced,isOpen_sigma_iff] + intro n + change IsOpen (of X f n ⁻¹' tailSet X f k U) + rcases le_total k n with hn | hn + · rw [preimage_tailSet X f hf k U hU n hn] + exact hopen n hn + · have heq : of X f n = of X f k ∘ f n k hn := (funext (of_compat X f n k hn)).symm + rw [heq,Set.preimage_comp,preimage_tailSet X f hf k U hU k le_rfl] + exact (hopen k le_rfl).preimage (f n k hn).continuous + +end + +section +open Set Topology +universe u w +variable {G : Type w} [Group G] +variable (X : ℕ → Type u) [∀ n, TopologicalSpace (X n)] [∀ n, MulAction G (X n)] +variable (f : ∀ i j, i ≤ j → C(X i,X j)) [DirectedSystem X (f · · ·)] +variable [EquivariantSystem (G := G) X f] +variable (hf : ∀ i j h, IsClosedEmbedding (f i j h)) + +structure Slice (n : ℕ) where + carrier : Set (X n) + isOpen : IsOpen carrier + disjoint : ∀ g : G, ((g • ·) '' carrier ∩ carrier).Nonempty → g = 1 + +def ExtendsSlices : Prop := ∀ n (U : Slice (G := G) X n), + ∃ V : Slice (G := G) X (n+1), f n (n+1) (Nat.le_succ n) ⁻¹' V.carrier = U.carrier + +variable (hext : ExtendsSlices (G := G) X f) + +def extendSlice (n : ℕ) (U : Slice (G := G) X n) : Slice (G := G) X (n+1) := (hext n U).choose + +omit [DirectedSystem X (f · · ·)] [EquivariantSystem (G := G) X f] in +lemma extendSlice_spec (n : ℕ) (U : Slice (G := G) X n) : + f n (n+1) (Nat.le_succ n) ⁻¹' (extendSlice X f hext n U).carrier = U.carrier := + (hext n U).choose_spec + +def sliceFamily (k : ℕ) (U : Slice (G := G) X k) (n : ℕ) (hn : k ≤ n) : Slice (G := G) X n := + Nat.leRecOn hn (fun {m} => extendSlice X f hext m) U + +omit [DirectedSystem X (f · · ·)] [EquivariantSystem (G := G) X f] in +lemma sliceFamily_self (k : ℕ) (U : Slice (G := G) X k) : sliceFamily X f hext k U k le_rfl = U := by + simp only [sliceFamily,Nat.leRecOn_self] + +omit [EquivariantSystem (G := G) X f] in +lemma sliceFamily_compat (k : ℕ) (U : Slice (G := G) X k) (i j : ℕ) + (hi : k ≤ i) (hij : i ≤ j) : + f i j hij ⁻¹' (sliceFamily X f hext k U j (hi.trans hij)).carrier = + (sliceFamily X f hext k U i hi).carrier := by + induction j,hij using Nat.le_induction with + | base => ext x; simp only [Set.mem_preimage,DirectedSystem.map_self'] + | succ j hij ih => + unfold sliceFamily + rw [Nat.leRecOn_succ (hi.trans hij)] + have hcomp : f i (j+1) (hij.trans (Nat.le_succ j)) = + f j (j+1) (Nat.le_succ j) ∘ f i j hij := by + ext x + exact (DirectedSystem.map_map' f hij (Nat.le_succ j) x).symm + change (f i (j+1) _) ⁻¹' (extendSlice X f hext j _).carrier = _ + rw [hcomp,Set.preimage_comp,extendSlice_spec] + exact ih + +include hf in +lemma tailSet_disjoint (k : ℕ) (U : ∀ n, k ≤ n → Set (X n)) + (hU : ∀ i j (hi : k ≤ i) (hij : i ≤ j), f i j hij ⁻¹' U j (hi.trans hij) = U i hi) + (hd : ∀ n hn (g : G), ((g • ·) '' U n hn ∩ U n hn).Nonempty → g = 1) : + ∀ g : G, ((g • ·) '' tailSet X f k U ∩ tailSet X f k U).Nonempty → g = 1 := by + intro g hg + obtain ⟨_,⟨z,hz,rfl⟩,hgz⟩ := hg + obtain ⟨j,x,rfl⟩ := DirectLimit.exists_eq_mk f z + let m := max k j + have he : of X f j x = of X f m (f j m (le_max_right _ _) x) := + (of_compat X f j m (le_max_right _ _) x).symm + change of X f j x ∈ tailSet X f k U at hz + rw [he] at hz + change of X f m _ ∈ tailSet X f k U at hz + have hmz := (Set.ext_iff.mp (preimage_tailSet X f hf k U hU m (le_max_left _ _)) _).mp hz + change g • of X f j x ∈ tailSet X f k U at hgz + rw [he,smul_of] at hgz + have hmgz := (Set.ext_iff.mp (preimage_tailSet X f hf k U hU m (le_max_left _ _)) _).mp hgz + exact hd m (le_max_left _ _) g ⟨_,⟨_,hmz,rfl⟩,hmgz⟩ + +include hf hext in +lemma exists_disjoint_nhds + (hstage : ∀ n (x : X n), ∃ U ∈ 𝓝 x, + ∀ g : G, ((g • ·) '' U ∩ U).Nonempty → g = 1) : + ∀ z : Space X f, ∃ U ∈ 𝓝 z, ∀ g : G, ((g • ·) '' U ∩ U).Nonempty → g = 1 := by + intro z + obtain ⟨k,x,rfl⟩ := DirectLimit.exists_eq_mk f z + obtain ⟨U,hUx,hU⟩ := hstage k x + obtain ⟨V,hVU,hV,hxV⟩ := mem_nhds_iff.mp hUx + let S : Slice (G := G) X k := ⟨V,hV,fun g hg => hU g + (hg.mono (Set.inter_subset_inter (Set.image_mono hVU) hVU))⟩ + let W := fun n hn => (sliceFamily X f hext k S n hn).carrier + have hW := sliceFamily_compat X f hext k S + refine ⟨tailSet X f k W,?_,tailSet_disjoint X f hf k W hW + (fun n hn => (sliceFamily X f hext k S n hn).disjoint)⟩ + apply (tailSet_isOpen X f hf k W hW (fun n hn => (sliceFamily X f hext k S n hn).isOpen)).mem_nhds + change of X f k x ∈ tailSet X f k W + have hw : x ∈ W k le_rfl := by simpa only [W,sliceFamily_self] using hxV + exact Set.mem_iUnion.mpr ⟨k,Set.mem_iUnion.mpr ⟨le_rfl,⟨x,hw,rfl⟩⟩⟩ + +end + +section +open Set Topology +universe u v w +variable {G : Type w} [Group G] +variable (E : ℕ → Type u) [∀ n, TopologicalSpace (E n)] [∀ n, MulAction G (E n)] +variable (e : ∀ i j, i ≤ j → C(E i,E j)) [DirectedSystem E (e · · ·)] +variable [EquivariantSystem (G := G) E e] [∀ n, ContinuousConstSMul G (E n)] +variable (X : ℕ → Type v) [∀ n, TopologicalSpace (X n)] +variable (f : ∀ i j, i ≤ j → C(X i,X j)) [DirectedSystem X (f · · ·)] +variable (p : ∀ n, C(E n,X n)) +variable (hp : ∀ i j h x, p j (e i j h x) = f i j h (p i x)) + +def limitMap : C(Space E e,Space X f) := + ⟨DirectLimit.lift e (fun n x => of X f n (p n x)) (fun i j h x => by + rw [hp,of_compat]), (continuous_iff E e _).mpr (fun n => + (continuous_of X f n).comp (p n).continuous)⟩ + +@[simp] lemma limitMap_of (n : ℕ) (x : E n) : + limitMap E e X f p hp (of E e n x) = of X f n (p n x) := rfl + +omit [EquivariantSystem (G := G) E e] [∀ n, ContinuousConstSMul G (E n)] in +lemma limitMap_isQuotient (hq : ∀ n, IsQuotientMap (p n)) : + IsQuotientMap (limitMap E e X f p hp) := by + refine ⟨?_,?_⟩ + · rw [isCoinducing_iff] + intro U + constructor + · intro hU + change @IsOpen _ (TopologicalSpace.coinduced (fun z : Σ n, X n => of X f z.1 z.2) + inferInstance) U + rw [isOpen_coinduced,isOpen_sigma_iff] + intro n + apply (hq n).isOpen_preimage.mp + exact hU.preimage (continuous_of E e n) + · exact fun hU => hU.preimage (limitMap E e X f p hp).continuous + · intro z + obtain ⟨n,x,rfl⟩ := DirectLimit.exists_eq_mk f z + obtain ⟨y,rfl⟩ := (hq n).surjective x + exact ⟨of E e n y,rfl⟩ + +omit [∀ n, ContinuousConstSMul G (E n)] in +lemma limitMap_fibers (hf : ∀ i j h, IsClosedEmbedding (f i j h)) + (hq : ∀ n, IsQuotientCoveringMap (p n) G) (x y : Space E e) : + limitMap E e X f p hp x = limitMap E e X f p hp y ↔ x ∈ MulAction.orbit G y := by + obtain ⟨i,x,rfl⟩ := DirectLimit.exists_eq_mk e x + obtain ⟨j,y,rfl⟩ := DirectLimit.exists_eq_mk e y + let n := max i j + change limitMap E e X f p hp (of E e i x) = limitMap E e X f p hp (of E e j y) ↔ + of E e i x ∈ MulAction.orbit G (of E e j y) + rw [← of_compat E e i n (le_max_left _ _) x,← of_compat E e j n (le_max_right _ _) y] + simp only [limitMap_of] + constructor + · intro hh + have hh' := of_injective X f hf n hh + obtain ⟨g,hg⟩ := (hq n).apply_eq_iff_mem_orbit.mp hh' + exact ⟨g,congrArg (of E e n) hg⟩ + · rintro ⟨g,hg⟩ + have hh := congrArg (limitMap E e X f p hp) hg + simpa only [smul_of,limitMap_of,(hq n).map_smul] using hh.symm + +lemma limitMap_isQuotientCovering + (he : ∀ i j h, IsClosedEmbedding (e i j h)) + (hf : ∀ i j h, IsClosedEmbedding (f i j h)) + (hq : ∀ n, IsQuotientCoveringMap (p n) G) + (hext : ExtendsSlices (G := G) E e) : + IsQuotientCoveringMap (limitMap E e X f p hp) G where + __ := limitMap_isQuotient E e X f p hp (fun n => (hq n).toIsQuotientMap) + continuous_const_smul g := continuous_const_smul g + apply_eq_iff_mem_orbit := limitMap_fibers E e X f p hp hf hq _ _ + disjoint := exists_disjoint_nhds E e he hext (fun n => (hq n).disjoint) + +end + +open Set Metric Topology +universe u v +variable (X : ℕ → Type u) [∀ n, TopologicalSpace (X n)] [∀ n, T1Space (X n)] +variable (f : ∀ i j, i ≤ j → C(X i,X j)) [DirectedSystem X (f · · ·)] +variable (hf : ∀ i j h, IsClosedEmbedding (f i j h)) + +include hf in +lemma compactMap_factors {A : Type v} [TopologicalSpace A] [CompactSpace A] + (g : C(A,Space X f)) : + ∃ (n : ℕ) (a : C(A,X n)), ∀ x, of X f n (a x) = g x := by + obtain ⟨n,hn⟩ := compact_bounded X f hf (isCompact_range g.continuous) + have hex (x : A) : ∃ y, of X f n y = g x := hn (Set.mem_range_self x) + choose a ha using hex + have hcont : Continuous a := by + apply (of_closedEmbedding X f hf n).isEmbedding.continuous_iff.mpr + have heq : of X f n ∘ a = g := funext ha + rw [heq] + exact g.continuous + exact ⟨n,⟨a,hcont⟩,ha⟩ + +def EventuallyFills : Prop := ∀ n k (a : C(Cellular.Sphere n,X k)), + ∃ (j : ℕ) (hkj : k ≤ j) (b : C(Cellular.Disk n,X j)), + ∀ x, b (Cellular.boundary n x) = f k j hkj (a x) + +include hf in +lemma sphereFillable (hfill : EventuallyFills X f) : Cellular.SphereFillable (Space X f) := by + intro n a + obtain ⟨k,a',ha'⟩ := compactMap_factors X f hf a + obtain ⟨j,hkj,b,hb⟩ := hfill n k a' + refine ⟨⟨of X f j ∘ b,(continuous_of X f j).comp b.continuous⟩,?_⟩ + intro x + change of X f j (b (Cellular.boundary n x)) = a x + rw [hb,of_compat,ha'] + +include hf in + +lemma contractible [T2Space (Space X f)] [Nonempty (Space X f)] + [CWComplex (Set.univ : Set (Space X f))] (hfill : EventuallyFills X f) : + ContractibleSpace (Space X f) := + Cellular.contractible_of_sphereFillable (sphereFillable X f hf hfill) + +end UniversalFInfinity.TopologicalTower + +end + +end OAI diff --git a/lean/OAI/GroupTheory/UniversalGroup/TreeGeometry.lean b/lean/OAI/GroupTheory/UniversalGroup/TreeGeometry.lean new file mode 100644 index 0000000000000000000000000000000000000000..6556032e5ec04467087ee931dfe19b63128ddfba --- /dev/null +++ b/lean/OAI/GroupTheory/UniversalGroup/TreeGeometry.lean @@ -0,0 +1,640 @@ +import OAI.GroupTheory.UniversalGroup.TorusBundles + +namespace OAI + +noncomputable section + +open Set Metric Topology BigOperators +open Set Metric Topology +open Set Topology +open Set Metric Topology +open scoped NNReal +open Set Metric Topology +open scoped NNReal ENNReal +open Set Metric Topology +open scoped TensorProduct + +namespace UniversalFInfinity.PathFamilies +open scoped unitInterval +universe u v +variable {Y : Type u} [TopologicalSpace Y] {X : Type v} [TopologicalSpace X] +variable {x y z : Y} + +def diagonalSquare (p : Path x y) (q : Path y z) : C(I × I,Y) := + ⟨fun s => (p.trans q).extend (((s.1:ℝ)+(s.2:ℝ))/2), + (p.trans q).continuous_extend.comp (by fun_prop)⟩ + +lemma diagonalSquare_zero_left (p : Path x y) (q : Path y z) (s : I) : + diagonalSquare p q (0,s) = p s := by + change (p.trans q).extend (((0:ℝ)+(s:ℝ))/2) = p s + rw [Path.extend_trans_of_le_half p q (by have := s.2.2; linarith)] + rw [show 2*(((0:ℝ)+(s:ℝ))/2) = (s:ℝ) by ring] + exact p.extend_apply s.2 +lemma diagonalSquare_one_left (p : Path x y) (q : Path y z) (s : I) : + diagonalSquare p q (1,s) = q s := by + change (p.trans q).extend (((1:ℝ)+(s:ℝ))/2) = q s + rw [Path.extend_trans_of_half_le p q (by have := s.2.1; linarith)] + rw [show 2*(((1:ℝ)+(s:ℝ))/2)-1 = (s:ℝ) by ring] + exact q.extend_apply s.2 +lemma diagonalSquare_symm (p : Path x y) (q : Path y z) (t s : I) : + diagonalSquare p q (t,s) = diagonalSquare p q (s,t) := by + change (p.trans q).extend _ = (p.trans q).extend _ + rw [add_comm (t:ℝ) (s:ℝ)] +lemma diagonalSquare_zero_right (p : Path x y) (q : Path y z) (t : I) : + diagonalSquare p q (t,0) = p t := by + rw [diagonalSquare_symm,diagonalSquare_zero_left] +lemma diagonalSquare_one_right (p : Path x y) (q : Path y z) (t : I) : + diagonalSquare p q (t,1) = q t := by + rw [diagonalSquare_symm,diagonalSquare_one_left] + +lemma diagonalSquare_continuous {a b c : X → Y} + (p : ∀ x,Path (a x) (b x)) (q : ∀ x,Path (b x) (c x)) + (hp : Continuous (fun z : X × I => p z.1 z.2)) + (hq : Continuous (fun z : X × I => q z.1 z.2)) : + Continuous (fun z : X × (I × I) => diagonalSquare (p z.1) (q z.1) z.2) := by + exact (Path.continuous_uncurry_extend_of_continuous_family + (fun x => (p x).trans (q x)) (Path.trans_continuous_family p hp q hq)).comp + (continuous_fst.prodMk (by fun_prop)) +lemma diagonalSquare_continuous_params {a b c : X → Y} + (p : ∀ x,Path (a x) (b x)) (q : ∀ x,Path (b x) (c x)) + (hp : Continuous (fun z : X × I => p z.1 z.2)) + (hq : Continuous (fun z : X × I => q z.1 z.2)) : + Continuous (fun z : I × (I × X) => diagonalSquare (p z.2.2) (q z.2.2) (z.1,z.2.1)) := by + have hc : Continuous (fun z : I × (I × X) => (z.2.2,(z.1,z.2.1))) := + continuous_snd.snd.prodMk (continuous_fst.prodMk continuous_snd.fst) + exact (diagonalSquare_continuous p q hp hq).comp hc +end UniversalFInfinity.PathFamilies + +namespace UniversalFInfinity.GraphBundle + +section +open Set Topology +open scoped unitInterval +universe u v +variable {C : Type u} [TopologicalSpace C] [DiscreteTopology C] +variable {A : Type v} [TopologicalSpace A] +variable (τ : C → C) (F : C → C(A,A)) + +abbrev Homogeneous := Space τ (fun _ => ContinuousMap.id A) F + +def shift : C(Homogeneous τ F,Homogeneous τ F) := + lift τ (fun _ => .id A) F + (fun c => (vertexMap τ (fun _ => .id A) F (τ c)).comp (F c)) + (fun c => (edgeMap τ (fun _ => .id A) F (τ c)).comp + ⟨fun z => (z.1,F c z.2),continuous_fst.prodMk ((F c).continuous.comp continuous_snd)⟩) + (fun c x => edge_zero τ _ F (τ c) (F c x)) + (fun c x => edge_one τ _ F (τ c) (F c x)) +lemma shift_vertex (c : C) (x : A) : + shift τ F (vertex τ (fun _ => .id A) F c x) = vertex τ (fun _ => .id A) F (τ c) (F c x) := rfl +lemma shift_edge (c : C) (t : I) (x : A) : + shift τ F (edge τ (fun _ => .id A) F c t x) = edge τ (fun _ => .id A) F (τ c) t (F c x) := + lift_edge τ _ F _ _ _ _ c (t,x) + +def shiftVertexHomotopy (c : C) : + ((ContinuousMap.id _).comp (vertexMap τ (fun _ => .id A) F c)).Homotopy + ((shift τ F).comp (vertexMap τ (fun _ => .id A) F c)) where + toFun z := edge τ (fun _ => .id A) F c z.1 z.2 + continuous_toFun := (edgeMap τ (fun _ => .id A) F c).continuous + map_zero_left x := edge_zero τ _ F c x + map_one_left x := edge_one τ _ F c x + +omit [DiscreteTopology C] in +lemma shiftEdge_continuous (c : C) : + Continuous (fun z : I × (I × A) => + PathFamilies.diagonalSquare (edgePath τ (fun _ => .id A) F c z.2.2) + (edgePath τ (fun _ => .id A) F (τ c) (F c z.2.2)) (z.1,z.2.1)) := by + let p : ∀ x : A, Path (vertex τ (fun _ => .id A) F c x) + (vertex τ (fun _ => .id A) F (τ c) (F c x)) := edgePath τ (fun _ => .id A) F c + let q : ∀ x : A, Path (vertex τ (fun _ => .id A) F (τ c) (F c x)) + (vertex τ (fun _ => .id A) F (τ (τ c)) (F (τ c) (F c x))) := + fun x => edgePath τ (fun _ => .id A) F (τ c) (F c x) + have hp : Continuous (fun z : A × I => p z.1 z.2) := + (edgeMap τ (fun _ => .id A) F c).continuous.comp continuous_swap + have hq : Continuous (fun z : A × I => q z.1 z.2) := + (edgeMap τ (fun _ => .id A) F (τ c)).continuous.comp + (continuous_snd.prodMk ((F c).continuous.comp continuous_fst)) + exact PathFamilies.diagonalSquare_continuous_params p q hp hq + +def shiftEdgeHomotopy (c : C) : + ((ContinuousMap.id _).comp (edgeMap τ (fun _ => .id A) F c)).Homotopy + ((shift τ F).comp (edgeMap τ (fun _ => .id A) F c)) where + toFun z := PathFamilies.diagonalSquare (edgePath τ (fun _ => .id A) F c z.2.2) + (edgePath τ (fun _ => .id A) F (τ c) (F c z.2.2)) (z.1,z.2.1) + continuous_toFun := shiftEdge_continuous τ F c + map_zero_left z := PathFamilies.diagonalSquare_zero_left _ _ z.1 + map_one_left z := (PathFamilies.diagonalSquare_one_left _ _ z.1).trans (shift_edge τ F c z.1 z.2).symm + +def shiftHomotopy : (ContinuousMap.id (Homogeneous τ F)).Homotopy (shift τ F) := + homotopy τ (fun _ => .id A) F _ _ (shiftVertexHomotopy τ F) (shiftEdgeHomotopy τ F) + (fun _ t _ => PathFamilies.diagonalSquare_zero_right _ _ t) + (fun _ t _ => PathFamilies.diagonalSquare_one_right _ _ t) + +def shiftIterate : ℕ → C(Homogeneous τ F,Homogeneous τ F) + | 0 => .id _ + | n+1 => (shift τ F).comp (shiftIterate n) +def shiftIterateHomotopy : ∀ n,(ContinuousMap.id _).Homotopy (shiftIterate τ F n) + | 0 => .refl _ + | n+1 => (shiftIterateHomotopy n).trans ((shiftHomotopy τ F).compContinuousMap (shiftIterate τ F n)) +end + +open Set Topology +open scoped unitInterval +universe u v +variable {C : Type u} [TopologicalSpace C] [DiscreteTopology C] +variable {A : Type v} [TopologicalSpace A] +variable (τ : C → C) (F : C → C(A,A)) + +def forward : ℕ → C → C(A,A) + | 0,_ => .id _ + | n+1,c => (F (τ^[n] c)).comp (forward n c) +omit [TopologicalSpace C] [DiscreteTopology C] in +lemma forward_natural (n : ℕ) (c : C) (x : A) : + forward τ F n (τ c) (F c x) = F (τ^[n] c) (forward τ F n c x) := by + induction n with + | zero => rfl + | succ n ih => + change F (τ^[n] (τ c)) (forward τ F n (τ c) (F c x)) = + F (τ^[n+1] c) (F (τ^[n] c) (forward τ F n c x)) + rw [ih,Function.iterate_succ_apply] +lemma shiftIterate_vertex (n : ℕ) (c : C) (x : A) : + shiftIterate τ F n (vertex τ (fun _ => .id A) F c x) = + vertex τ (fun _ => .id A) F (τ^[n] c) (forward τ F n c x) := by + induction n with + | zero => rfl + | succ n ih => + change shift τ F (shiftIterate τ F n (vertex τ (fun _ => .id A) F c x)) = _ + rw [ih,shift_vertex,Function.iterate_succ_apply'] + rfl +lemma shiftIterate_edge (n : ℕ) (c : C) (t : I) (x : A) : + shiftIterate τ F n (edge τ (fun _ => .id A) F c t x) = + edge τ (fun _ => .id A) F (τ^[n] c) t (forward τ F n c x) := by + induction n with + | zero => rfl + | succ n ih => + change shift τ F (shiftIterate τ F n (edge τ (fun _ => .id A) F c t x)) = _ + rw [ih,shift_edge,Function.iterate_succ_apply'] + rfl +end UniversalFInfinity.GraphBundle + +namespace UniversalFInfinity.Milnor +variable {G : Type*} [Group G] + +lemma iterateHom_comm (f : G →* G) (n : ℕ) (g : G) : iterateHom f n (f g) = f (iterateHom f n g) := by + induction n with + | zero => rfl + | succ n ih => exact congrArg f ih +end UniversalFInfinity.Milnor + +namespace UniversalFInfinity.TorusGeometry +open Set Topology Milnor AscendingTorus +open scoped unitInterval +universe u +variable {U : Type u} [Group U] (f : Monoid.End U) + +def forwardOffset : ℕ → Coset f → U + | 0,_ => 1 + | n+1,c => cosetOffset f ((next f)^[n] c) * f (forwardOffset n c) +lemma forward_eq (n : ℕ) (c : Coset f) (x : Milnor.Space U) : + GraphBundle.forward (next f) (transition f) n c x = + forwardOffset f n c • Milnor.map (iterateHom f n) id Function.injective_id x := by + induction n with + | zero => + change x = 1 • Milnor.map (id : U → U) id Function.injective_id x + rw [one_smul,Milnor.map_id] + | succ n ih => + change transition f ((next f)^[n] c) (GraphBundle.forward (next f) (transition f) n c x) = _ + rw [ih,transition_apply] + refine (congrArg (cosetOffset f ((next f)^[n] c) • ·) + (Milnor.map_smul f (forwardOffset f n c) _)).trans ?_ + rw [←mul_smul] + change (cosetOffset f ((next f)^[n] c) * f (forwardOffset f n c)) • + Milnor.map f id Function.injective_id (Milnor.map (iterateHom f n) id Function.injective_id x) = _ + rw [Milnor.map_comp] + rfl + +lemma forward_naturality (n : ℕ) (c : Coset f) (x : Milnor.Space U) : + transition f ((next f)^[n] c) + (forwardOffset f n c • Milnor.map (iterateHom f n) id Function.injective_id x) = + forwardOffset f n (next f c) • Milnor.map (iterateHom f n) id Function.injective_id (transition f c x) := by + rw [←forward_eq,←forward_eq] + exact (GraphBundle.forward_natural (next f) (transition f) n c x).symm + +lemma stage_shift_vertex (S : Shapes U) (n : ℕ) (c : Coset f) (x : Milnor.Stage U (vertexShapes f S)) : + GraphBundle.shiftIterate (next f) (transition f) n + (stageFull f S (GraphBundle.vertex _ _ _ c x)) = + vertex f ((next f)^[n] c) + (forwardOffset f n c • Milnor.map (iterateHom f n) id Function.injective_id (Milnor.stageFull U _ x)) := by + rw [stageFull_vertex] + exact (GraphBundle.shiftIterate_vertex _ _ n c _).trans (congrArg (vertex f _) (forward_eq f n c _)) +lemma stage_shift_edge (S : Shapes U) (n : ℕ) (c : Coset f) (t : I) (x : Milnor.Stage U S) : + GraphBundle.shiftIterate (next f) (transition f) n + (stageFull f S (GraphBundle.edge _ _ _ c t x)) = + GraphBundle.edge _ _ _ ((next f)^[n] c) t + (forwardOffset f n c • Milnor.map (iterateHom f n) id Function.injective_id (Milnor.stageFull U _ x)) := by + rw [stageFull_edge,GraphBundle.shiftIterate_edge,forward_eq] +end UniversalFInfinity.TorusGeometry + +namespace UniversalFInfinity.DirectedGraph +open Set Metric Topology Attachment +open scoped unitInterval +universe u v +variable {C : Type u} [TopologicalSpace C] [DiscreteTopology C] (τ : C → C) + +def attaching (c : C) : C(Sphere 1,C) := + ⟨fun x => if x.1 0 = -1 then c else τ c,continuous_of_discreteTopology⟩ +abbrev Graph := Space (attaching τ) +def vertex (c : C) : Graph τ := base _ c + +lemma discrete_dimension (m : ℕ) (i : RelCWComplex.cell (Set.univ : Set C) m) : m < 1 := by + cases m with + | zero => omega + | succ m => exact i.elim +instance graphCW [Nonempty C] : CWComplex (Set.univ : Set (Graph τ)) := layerCW _ discrete_dimension +instance : T2Space (Graph τ) := t2Space _ (realSeparated_of_tychonoff (Y := C)) +lemma graph_dimension [Nonempty C] (m : ℕ) (i : RelCWComplex.cell (Set.univ : Set (Graph τ)) m) : m < 2 := + layerCW_dimensions _ discrete_dimension m i + +omit [DiscreteTopology C] in +lemma cell_minus (c : C) : cell (attaching τ) c (boundary 1 Cayley.minus) = vertex τ c := by + rw [cell_boundary]; simp only [attaching,Cayley.minus,ContinuousMap.coe_mk,ite_true]; rfl +omit [DiscreteTopology C] in +lemma cell_plus (c : C) : cell (attaching τ) c (boundary 1 Cayley.plus) = vertex τ (τ c) := by + rw [cell_boundary]; norm_num [attaching,Cayley.plus,vertex] + +def edge (c : C) : Path (vertex τ c) (vertex τ (τ c)) where + toFun t := cell (attaching τ) c (Cayley.edgeParam t) + continuous_toFun := (cell _ c).continuous.comp Cayley.continuous_edgeParam + source' := by rw [Cayley.edgeParam_zero,cell_minus] + target' := by rw [Cayley.edgeParam_one,cell_plus] + +variable {Y : Type v} [TopologicalSpace Y] (f : C(Graph τ,Y)) (y : Y) +variable (p : ∀ c,Path y (f (vertex τ c))) +variable (hp : ∀ c,((p c).trans ((edge τ c).map f.continuous)).Homotopic (p (τ c))) + +def edgeSquare (c : C) : ((edge τ c).map f.continuous).toContinuousMap.Homotopy (.const _ y) := + (PathSquares.edgeSquare (p c) (p (τ c)) ((edge τ c).map f.continuous) (hp c)).choose +omit [DiscreteTopology C] in +lemma edgeSquare_source (c : C) (t : I) : edgeSquare τ f y p hp c (t,0) = PathSquares.pauseReverse (p c) t := + (PathSquares.edgeSquare (p c) (p (τ c)) ((edge τ c).map f.continuous) (hp c)).choose_spec.1 t +omit [DiscreteTopology C] in +lemma edgeSquare_target (c : C) (t : I) : edgeSquare τ f y p hp c (t,1) = PathSquares.pauseReverse (p (τ c)) t := + (PathSquares.edgeSquare (p c) (p (τ c)) ((edge τ c).map f.continuous) (hp c)).choose_spec.2 t + +def edgePaths (c : C) : C(Disk 1,C(I,Y)) := + ContinuousMap.curry ⟨fun z => edgeSquare τ f y p hp c (z.2,Cayley.edgeTime z.1), + (edgeSquare τ f y p hp c).continuous.comp + (continuous_snd.prodMk (Cayley.continuous_edgeTime.comp continuous_fst))⟩ +def vertexPaths : C(C,C(I,Y)) := ⟨fun c => PathSquares.pauseReverse (p c),continuous_of_discreteTopology⟩ +lemma edgePaths_boundary (c : C) (t : Sphere 1) : + edgePaths τ f y p hp c (boundary 1 t) = vertexPaths τ f y p (attaching τ c t) := by + obtain rfl|rfl := Cayley.sphere_one_eq t + · apply ContinuousMap.ext; intro z + change edgeSquare τ f y p hp c (z,Cayley.edgeTime (boundary 1 Cayley.minus)) = _ + rw [Cayley.edgeTime_minus,edgeSquare_source] + simp only [vertexPaths,attaching,ContinuousMap.coe_mk,Cayley.minus,ite_true] + · apply ContinuousMap.ext; intro z + change edgeSquare τ f y p hp c (z,Cayley.edgeTime (boundary 1 Cayley.plus)) = _ + rw [Cayley.edgeTime_plus,edgeSquare_target] + norm_num [vertexPaths,attaching,Cayley.plus] + +def graphPaths : C(Graph τ,C(I,Y)) := + lift _ (vertexPaths τ f y p) (edgePaths τ f y p hp) (edgePaths_boundary τ f y p hp) +lemma graphPaths_zero (z : Graph τ) : graphPaths τ f y p hp z 0 = f z := by + cases z with + | inl c => exact Path.source _ + | inr z => + change edgeSquare τ f y p hp z.1 (0,Cayley.edgeTime (interior 1 z.2)) = _ + rw [ContinuousMap.Homotopy.apply_zero] + change f (cell _ z.1 (Cayley.edgeParam (Cayley.edgeTime (interior 1 z.2)))) = f _ + rw [Cayley.edgeParam_time,cell_interior] +lemma graphPaths_one (z : Graph τ) : graphPaths τ f y p hp z 1 = y := by + cases z with + | inl c => exact Path.target _ + | inr z => + change edgeSquare τ f y p hp z.1 (1,Cayley.edgeTime (interior 1 z.2)) = y + exact ContinuousMap.Homotopy.apply_one _ _ + +def graphNullhomotopy : f.Homotopy (.const _ y) where + toFun z := graphPaths τ f y p hp z.2 z.1 + continuous_toFun := (graphPaths τ f y p hp).uncurry.continuous.comp continuous_swap + map_zero_left := graphPaths_zero τ f y p hp + map_one_left := graphPaths_one τ f y p hp + +end UniversalFInfinity.DirectedGraph + +namespace UniversalFInfinity.DirectedTree +universe u v +variable {C : Type u} {G : Type v} [Group G] +variable (τ : C → C) (h : C → ℤ) (hτ : ∀ c, h (τ c) = h c + 1) + +include hτ in +lemma height_iterate (c : C) (n : ℕ) : h (τ^[n] c) = h c + n := by + induction n with + | zero => simp + | succ n ih => rw [Function.iterate_succ_apply',hτ,ih]; push_cast; omega + +variable (w : C → G) +def rayProduct (c : C) : ℕ → G + | 0 => 1 + | n+1 => rayProduct c n * w (τ^[n] c) + +lemma rayProduct_add (c : C) (n k : ℕ) : + rayProduct τ w c (n+k) = rayProduct τ w c n * rayProduct τ w (τ^[n] c) k := by + induction k with + | zero => simp [rayProduct] + | succ k ih => + rw [Nat.add_succ,rayProduct,ih,rayProduct,mul_assoc] + congr 2 + rw [Function.iterate_add_apply] + exact congrArg w ((Function.Commute.iterate_iterate (Function.Commute.refl τ) n k).eq c) + +lemma rayProduct_first (c : C) (n : ℕ) : + rayProduct τ w c (n+1) = w c * rayProduct τ w (τ c) n := by + simpa only [Nat.add_comm 1 n,rayProduct,Function.iterate_zero,Function.id_def,one_mul, + Function.iterate_one] using rayProduct_add τ w c 1 n + +include h hτ in + +lemma route_independent (c d : C) (p q p' q' : ℕ) + (he : τ^[p] c = τ^[q] d) (he' : τ^[p'] c = τ^[q'] d) : + rayProduct τ w c p * (rayProduct τ w d q)⁻¹ = + rayProduct τ w c p' * (rayProduct τ w d q')⁻¹ := by + have hlen : (p:ℤ) + q' = (p':ℤ) + q := by + have ha := congrArg h he + have hb := congrArg h he' + rw [height_iterate τ h hτ,height_iterate τ h hτ] at ha hb + omega + have hlen' : p + q' = p' + q := by omega + have enlarge (a b : C) (i j k : ℕ) (hab : τ^[i] a = τ^[j] b) : + rayProduct τ w a i * (rayProduct τ w b j)⁻¹ = + rayProduct τ w a (i+k) * (rayProduct τ w b (j+k))⁻¹ := by + rw [rayProduct_add,rayProduct_add,hab,mul_inv_rev] + group + rw [enlarge c d p q q' he,enlarge c d p' q' q he',hlen',Nat.add_comm q' q] + +variable (hc : ∀ c d, ∃ p q : ℕ, τ^[p] c = τ^[q] d) (root : C) +def potential (c : C) : G := + let p := (hc root c).choose + let q := (hc root c).choose_spec.choose + rayProduct τ w root p * (rayProduct τ w c q)⁻¹ + +include h hτ in +lemma potential_route (c : C) (p q : ℕ) (he : τ^[p] root = τ^[q] c) : + potential τ w hc root c = rayProduct τ w root p * (rayProduct τ w c q)⁻¹ := by + exact route_independent τ h hτ w root c _ _ p q (hc root c).choose_spec.choose_spec he + +include h hτ in + +lemma potential_edge (c : C) : potential τ w hc root c * w c = potential τ w hc root (τ c) := by + obtain ⟨p,q,he⟩ := hc root (τ c) + have he' : τ^[p] root = τ^[q+1] c := by simpa only [Function.iterate_succ_apply] using he + rw [potential_route τ h hτ w hc root c p (q+1) he', + potential_route τ h hτ w hc root (τ c) p q he,rayProduct_first] + group + +end UniversalFInfinity.DirectedTree + +namespace UniversalFInfinity.DirectedGraph +open Set Topology Attachment +open scoped unitInterval +universe u +variable {C : Type u} [TopologicalSpace C] [DiscreteTopology C] (τ : C → C) +variable (h : C → ℤ) (hτ : ∀ c, h (τ c) = h c + 1) +variable (hc : ∀ c d, ∃ p q : ℕ, τ^[p] c = τ^[q] d) (root : C) + +omit [DiscreteTopology C] in +lemma ray_joined (c : C) (n : ℕ) : Joined (vertex τ c) (vertex τ (τ^[n] c)) := by + induction n with + | zero => exact Joined.refl _ + | succ n ih => + rw [Function.iterate_succ_apply'] + exact ih.trans ⟨edge τ (τ^[n] c)⟩ + +include hc in +omit [DiscreteTopology C] in +lemma vertex_joined (c : C) : Joined (vertex τ root) (vertex τ c) := by + obtain ⟨p,q,he⟩ := hc root c + have hd : Joined (vertex τ c) (vertex τ (τ^[p] root)) := by + rw [he]; exact ray_joined τ c q + exact (ray_joined τ root p).trans hd.symm + +def initialPath (c : C) : Path (vertex τ root) (vertex τ c) := + (vertex_joined τ hc root c).somePath + +def initialClass (c : C) : Path.Homotopic.Quotient (vertex τ root) (vertex τ c) := + Path.Homotopic.Quotient.mk (initialPath τ hc root c) + +def edgeClass (c : C) : Path.Homotopic.Quotient (vertex τ c) (vertex τ (τ c)) := + Path.Homotopic.Quotient.mk (edge τ c) + +def edgeWeight (c : C) : (FundamentalGroup (Graph τ) (vertex τ root))ᵐᵒᵖ := + MulOpposite.op (((initialClass τ hc root c).trans (edgeClass τ c)).trans + (initialClass τ hc root (τ c)).symm) + +def treeClass (c : C) : Path.Homotopic.Quotient (vertex τ root) (vertex τ c) := + (MulOpposite.unop (DirectedTree.potential τ (edgeWeight τ hc root) hc root c)).trans + (initialClass τ hc root c) + +include h hτ in +omit [DiscreteTopology C] in +lemma treeClass_edge (c : C) : (treeClass τ hc root c).trans (edgeClass τ c) = + treeClass τ hc root (τ c) := by + have he := DirectedTree.potential_edge τ h hτ (edgeWeight τ hc root) hc root c + have he' := congrArg MulOpposite.unop he + simp only [MulOpposite.unop_mul,FundamentalGroup.mul_def,edgeWeight,MulOpposite.unop_op] at he' + have hh := congrArg (fun (k : FundamentalGroup (Graph τ) (vertex τ root)) => + k.trans (initialClass τ hc root (τ c))) he' + simpa only [treeClass,Path.Homotopic.Quotient.trans_assoc, + Path.Homotopic.Quotient.symm_trans,Path.Homotopic.Quotient.trans_refl] using hh + +def treePath (c : C) : Path (vertex τ root) (vertex τ c) := + (Path.Homotopic.Quotient.mk_surjective (treeClass τ hc root c)).choose + +include h hτ in +omit [DiscreteTopology C] in +lemma treePath_edge (c : C) : ((treePath τ hc root c).trans (edge τ c)).Homotopic + (treePath τ hc root (τ c)) := by + apply Path.Homotopic.Quotient.exact + change (Path.Homotopic.Quotient.mk (treePath τ hc root c)).trans (edgeClass τ c) = _ + unfold treePath + rw [(Path.Homotopic.Quotient.mk_surjective (treeClass τ hc root c)).choose_spec, + (Path.Homotopic.Quotient.mk_surjective (treeClass τ hc root (τ c))).choose_spec] + exact treeClass_edge τ h hτ hc root c + +include hτ hc root in + +lemma tree_contractible : ContractibleSpace (Graph τ) := by + apply (contractible_iff_id_nullhomotopic _).mpr + refine ⟨vertex τ root,⟨graphNullhomotopy τ (.id _) (vertex τ root) + (treePath τ hc root) ?_⟩⟩ + intro c + simpa only [ContinuousMap.coe_id,Path.map_id] using treePath_edge τ h hτ hc root c +end UniversalFInfinity.DirectedGraph + +namespace UniversalFInfinity.GraphBundle + +section +open Set Topology +open scoped unitInterval +universe u v w z +variable {C : Type u} [TopologicalSpace C] [DiscreteTopology C] +variable {A : Type v} [TopologicalSpace A] {B : Type w} [TopologicalSpace B] +variable (τ : C → C) (L R : C → C(B,A)) +variable {Y : Type z} [TopologicalSpace Y] + +def treeProjection : C(Space τ L R,DirectedGraph.Graph τ) := + lift τ L R (fun c => .const _ (DirectedGraph.vertex τ c)) + (fun c => (DirectedGraph.edge τ c).toContinuousMap.comp (.fst)) + (fun c _ => (DirectedGraph.edge τ c).source) + (fun c _ => (DirectedGraph.edge τ c).target) +lemma treeProjection_vertex (c : C) (x : A) : + treeProjection τ L R (vertex τ L R c x) = DirectedGraph.vertex τ c := rfl +lemma treeProjection_edge (c : C) (t : I) (x : B) : + treeProjection τ L R (edge τ L R c t x) = DirectedGraph.edge τ c t := + lift_edge τ L R _ _ _ _ c (t,x) + +omit [DiscreteTopology C] in +lemma pathMap_boundary (y : C → Y) (p : ∀ c,Path (y c) (y (τ c))) (c : C) + (x : Attachment.Sphere 1) : + p c (Cayley.edgeTime (Attachment.boundary 1 x)) = y (DirectedGraph.attaching τ c x) := by + obtain rfl|rfl := Cayley.sphere_one_eq x + · rw [Cayley.edgeTime_minus,Path.source] + simp only [DirectedGraph.attaching,Cayley.minus,ContinuousMap.coe_mk,ite_true] + · rw [Cayley.edgeTime_plus,Path.target] + norm_num [DirectedGraph.attaching,Cayley.plus] + +def treePathMap (y : C → Y) (p : ∀ c,Path (y c) (y (τ c))) : C(DirectedGraph.Graph τ,Y) := + Attachment.lift _ ⟨y,continuous_of_discreteTopology⟩ + (fun c => (p c).toContinuousMap.comp ⟨Cayley.edgeTime,Cayley.continuous_edgeTime⟩) + (pathMap_boundary τ y p) +lemma treePathMap_vertex (y : C → Y) (p : ∀ c,Path (y c) (y (τ c))) (c : C) : + treePathMap τ y p (DirectedGraph.vertex τ c) = y c := rfl +lemma treePathMap_edge (y : C → Y) (p : ∀ c,Path (y c) (y (τ c))) (c : C) (t : I) : + treePathMap τ y p (DirectedGraph.edge τ c t) = p c t := by + change Attachment.lift _ _ _ _ (Attachment.cell _ c (Cayley.edgeParam t)) = _ + rw [Attachment.lift_cell] + change p c (Cayley.edgeTime (Cayley.edgeParam t)) = p c t + rw [Cayley.edgeTime_param] + +lemma nullhomotopic_of_fiber_constant (h : C → ℤ) (hτ : ∀ c,h (τ c) = h c+1) + (hc : ∀ c d,∃ m n : ℕ,τ^[m] c = τ^[n] d) (root : C) + (f : C(Space τ L R,Y)) (y : C → Y) (p : ∀ c,Path (y c) (y (τ c))) + (hv : ∀ c x,f (vertex τ L R c x) = y c) + (he : ∀ c t x,f (edge τ L R c t x) = p c t) : f.Nullhomotopic := by + have := DirectedGraph.tree_contractible τ h hτ hc root + have hf : f = (treePathMap τ y p).comp (treeProjection τ L R) := by + apply hom_ext τ L R + · intro c x + simpa only [ContinuousMap.comp_apply,treeProjection_vertex,treePathMap_vertex] using hv c x + · intro c z + simpa only [ContinuousMap.comp_apply,treeProjection_edge,treePathMap_edge] using he c z.1 z.2 + rw [hf] + have hn := (id_nullhomotopic (DirectedGraph.Graph τ)).comp_right (treePathMap τ y p) + exact hn.comp_left (treeProjection τ L R) +end + +open Set Topology +open scoped unitInterval +universe u v w z r +variable {C : Type u} [TopologicalSpace C] [DiscreteTopology C] +variable {A : Type v} [TopologicalSpace A] {B : Type w} [TopologicalSpace B] +variable (τ : C → C) (L R : C → C(B,A)) +variable {Y : Type z} [TopologicalSpace Y] {Z : Type r} [TopologicalSpace Z] +variable (f : C(Space τ L R,Y)) (y : C → Y) +variable (V : ∀ c,(f.comp (vertexMap τ L R c)).Homotopy (.const _ (y c))) +variable (a b : C → C(Z,Y)) (e : ∀ c z,Path (a c z) (b c z)) +variable (he : ∀ c,Continuous (fun p : Z × I => e c p.1 p.2)) +variable (H : C → C(I × B,Z)) +variable (Q : C → C(B,C(I,C(I,Y)))) +variable (hleft : ∀ c t x,a c (H c (t,x)) = V c (t,L c x)) +variable (qleft : ∀ c x t,Q c x t 0 = b c (H c (t,x))) +variable (qright : ∀ c x t,Q c x t 1 = V (τ c) (t,R c x)) + +def connectorPath (c : C) (p : I × B) : + Path (b c (H c p)) (V (τ c) (p.1,R c p.2)) where + toFun s := Q c p.2 p.1 s + continuous_toFun := (Q c p.2 p.1).continuous + source' := qleft c p.2 p.1 + target' := qright c p.2 p.1 + +omit [DiscreteTopology C] in +lemma connectorPath_continuous (c : C) : Continuous (fun p : (I × B) × I => + connectorPath τ L R f y V b H Q qleft qright c p.1 p.2) := by + change Continuous (fun p : (I × B) × I => Q c p.1.2 p.1.1 p.2) + exact (Q c).uncurry.uncurry.continuous.comp + ((continuous_fst.snd.prodMk continuous_fst.fst).prodMk continuous_snd) + +def gluedPath (c : C) (p : I × B) : Path (a c (H c p)) (V (τ c) (p.1,R c p.2)) := + (e c (H c p)).trans (connectorPath τ L R f y V b H Q qleft qright c p) + +include he in +omit [DiscreteTopology C] in +lemma gluedPath_continuous (c : C) : Continuous (fun p : (I × B) × I => + gluedPath τ L R f y V a b e H Q qleft qright c p.1 p.2) := by + exact Path.trans_continuous_family (fun z : I × B => e c (H c z)) + ((he c).comp (((H c).continuous.comp continuous_fst).prodMk continuous_snd)) + (connectorPath τ L R f y V b H Q qleft qright c) + (connectorPath_continuous τ L R f y V b H Q qleft qright c) + +variable (e0 : ∀ c x s,e c (H c (0,x)) s = f (edge τ L R c s x)) +variable (q0 : ∀ c x s,Q c x 0 s = f (vertex τ L R (τ c) (R c x))) +variable (p : ∀ c,Path (y c) (y (τ c))) +variable (e1 : ∀ c x s,gluedPath τ L R f y V a b e H Q qleft qright c (1,x) s = p c s) + +include e0 q0 in +lemma gluedPath_zero (c : C) (x : B) (s : I) : + gluedPath τ L R f y V a b e H Q qleft qright c (0,x) s = + f (pause τ L R (edge τ L R c s x)) := by + rw [pause_edge τ L R c (s,x)] + change ((e c (H c (0,x))).trans (connectorPath τ L R f y V b H Q qleft qright c (0,x))) s = + f ((edgePath τ L R c x).trans (Path.refl _) s) + rw [Path.trans_apply,Path.trans_apply] + split_ifs with hs + · exact e0 c x _ + · exact q0 c x _ + +def collapsed : C(Space τ L R,Y) := + lift τ L R (fun c => .const _ (y c)) + (fun c => (p c).toContinuousMap.comp .fst) + (fun c _ => (p c).source) (fun c _ => (p c).target) + +lemma collapsed_edge (c : C) (s : I) (x : B) : + collapsed τ L R y p (edge τ L R c s x) = p c s := + lift_edge τ L R _ _ _ _ c (s,x) + +def gluedEdgeHomotopy (c : C) : + ((f.comp (pause τ L R)).comp (edgeMap τ L R c)).Homotopy + ((collapsed τ L R y p).comp (edgeMap τ L R c)) where + toFun z := gluedPath τ L R f y V a b e H Q qleft qright c (z.1,z.2.2) z.2.1 + continuous_toFun := (gluedPath_continuous τ L R f y V a b e he H Q qleft qright c).comp + ((continuous_fst.prodMk continuous_snd.snd).prodMk continuous_snd.fst) + map_zero_left z := gluedPath_zero τ L R f y V a b e H Q qleft qright e0 q0 c z.2 z.1 + map_one_left z := (e1 c z.2 z.1).trans (collapsed_edge τ L R y p c z.1 z.2).symm + +def gluedVertexHomotopy (c : C) : + ((f.comp (pause τ L R)).comp (vertexMap τ L R c)).Homotopy + ((collapsed τ L R y p).comp (vertexMap τ L R c)) := V c + +def coherentHomotopy : (f.comp (pause τ L R)).Homotopy (collapsed τ L R y p) := + homotopy τ L R _ _ (gluedVertexHomotopy τ L R f y V p) + (gluedEdgeHomotopy τ L R f y V a b e he H Q qleft qright e0 q0 p e1) + (fun c t x => ((gluedPath τ L R f y V a b e H Q qleft qright c (t,x)).source).trans (hleft c t x)) + (fun c t x => (gluedPath τ L R f y V a b e H Q qleft qright c (t,x)).target) + +include he hleft e0 q0 e1 in + +theorem nullhomotopic_of_coherent_contraction + (height : C → ℤ) (hτ : ∀ c,height (τ c) = height c+1) + (hc : ∀ c d,∃ m n : ℕ,τ^[m] c = τ^[n] d) (root : C) : f.Nullhomotopic := by + have hn := nullhomotopic_of_fiber_constant τ L R height hτ hc root + (collapsed τ L R y p) y p (fun _ _ => rfl) (collapsed_edge τ L R y p) + obtain ⟨z,⟨K⟩⟩ := hn + refine ⟨z,⟨?_⟩⟩ + have J := coherentHomotopy τ L R f y V a b e he H Q hleft qleft qright e0 q0 p e1 + have P := (ContinuousMap.Homotopy.refl f).comp (pauseHomotopy τ L R) + exact P.symm.trans (J.trans K) +end UniversalFInfinity.GraphBundle + +end + +end OAI diff --git a/lean/OAI/GroupTheory/UniversalGroup/TuringMachines.lean b/lean/OAI/GroupTheory/UniversalGroup/TuringMachines.lean new file mode 100644 index 0000000000000000000000000000000000000000..e90bad2cdf6e47181af0d499e5d96cc25009fb30 --- /dev/null +++ b/lean/OAI/GroupTheory/UniversalGroup/TuringMachines.lean @@ -0,0 +1,315 @@ +import OAI.GroupTheory.UniversalGroup.StackPrograms + +namespace OAI + +section UniversalFinitelyPresentedProof +universe u v w x + +namespace Higman.MicroTM2 +open Turing Function Relation +variable {K Γ Λ σ : Type} [DecidableEq K] +abbrev Stmt (K Γ Λ σ : Type) := TM2.Stmt (fun _ : K ↦ Γ) Λ σ +abbrev Cfg (K Γ Λ σ : Type) := (K → List Γ) × (Option (Stmt K Γ Λ σ) × σ) + +variable (M : Λ → Stmt K Γ Λ σ) + +def step : Cfg K Γ Λ σ → Option (Cfg K Γ Λ σ) + | (_,none,_) => none + | (S,some q,v) => some <| match q with + | .push k f r => (update S k (f v :: S k),some r,v) + | .peek k f r => (S,some r,f v (S k).head?) + | .pop k f r => (update S k (S k).tail,some r,f v (S k).head?) + | .load f r => (S,some r,f v) + | .branch f r t => (S,some (if f v then r else t),v) + | .goto f => (S,some (M (f v)),v) + | .halt => (S,none,v) + +def translate (c : TM2.Cfg (fun _ : K ↦ Γ) Λ σ) : Cfg K Γ Λ σ := + (c.stk,Option.map M c.l,c.var) + +def project : Cfg K Γ Λ σ → TM2.Cfg (fun _ : K ↦ Γ) Λ σ + | (S,none,v) => ⟨none,v,S⟩ + | (S,some q,v) => TM2.stepAux q v S + +theorem reaches_stepAux (q : Stmt K Γ Λ σ) (v : σ) (S : K → List Γ) : + StateTransition.Reaches (step M) (S,some q,v) (translate M (TM2.stepAux q v S)) := by + induction q generalizing v S with + | push k f r ih => + exact ReflTransGen.head rfl (ih v (update S k (f v :: S k))) + | peek k f r ih => exact ReflTransGen.head rfl (ih (f v (S k).head?) S) + | pop k f r ih => + exact ReflTransGen.head rfl (ih (f v (S k).head?) (update S k (S k).tail)) + | load f r ih => exact ReflTransGen.head rfl (ih (f v) S) + | branch f r t ihr iht => + cases h : f v + · simp only [TM2.stepAux,h,Bool.cond_false] + exact ReflTransGen.head + (show (S,some t,v) ∈ step M (S,some (.branch f r t),v) by simp [step,h]) (iht v S) + · simp only [TM2.stepAux,h,Bool.cond_true] + exact ReflTransGen.head + (show (S,some r,v) ∈ step M (S,some (.branch f r t),v) by simp [step,h]) (ihr v S) + | goto f => exact ReflTransGen.single rfl + | halt => exact ReflTransGen.single rfl + +theorem translate_step {c d : TM2.Cfg (fun _ : K ↦ Γ) Λ σ} (h : d ∈ TM2.step M c) : + StateTransition.Reaches (step M) (translate M c) (translate M d) := by + rcases c with ⟨_ | l,v,S⟩ + · simp [TM2.step] at h + · have hh : d = TM2.stepAux (M l) v S := by simpa [TM2.step] using h.symm + subst d + exact reaches_stepAux M (M l) v S + +theorem translate_reaches {c d : TM2.Cfg (fun _ : K ↦ Γ) Λ σ} + (h : TM2.Reaches M c d) : StateTransition.Reaches (step M) (translate M c) (translate M d) := by + induction h with + | refl => exact ReflTransGen.refl + | tail h hd ih => exact ih.trans (translate_step M hd) + +theorem project_step {c d : Cfg K Γ Λ σ} (h : d ∈ step M c) : + TM2.Reaches M (project c) (project d) := by + rcases c with ⟨S,_ | q,v⟩ + · simp [step] at h + · cases q with + | push k f r => + have hd : d = (update S k (f v :: S k),some r,v) := by simpa [step] using h.symm + subst d + exact ReflTransGen.refl + | peek k f r => + have hd : d = (S,some r,f v (S k).head?) := by simpa [step] using h.symm + subst d + exact ReflTransGen.refl + | pop k f r => + have hd : d = (update S k (S k).tail,some r,f v (S k).head?) := by simpa [step] using h.symm + subst d + exact ReflTransGen.refl + | load f r => + have hd : d = (S,some r,f v) := by simpa [step] using h.symm + subst d + exact ReflTransGen.refl + | branch f r t => + have hd : d = (S,some (if f v then r else t),v) := by simpa [step] using h.symm + subst d + cases h : f v <;> simp [project,TM2.stepAux,h,TM2.Reaches] <;> exact ReflTransGen.refl + | goto f => + have hd : d = (S,some (M (f v)),v) := by simpa [step] using h.symm + subst d + exact ReflTransGen.single rfl + | halt => + have hd : d = (S,none,v) := by simpa [step] using h.symm + subst d + exact ReflTransGen.refl + +theorem project_reaches {c d : Cfg K Γ Λ σ} (h : StateTransition.Reaches (step M) c d) : + TM2.Reaches M (project c) (project d) := by + induction h with + | refl => exact ReflTransGen.refl + | tail h hd ih => exact ih.trans (project_step M hd) + +theorem reaches_project_translate (c : TM2.Cfg (fun _ : K ↦ Γ) Λ σ) : + TM2.Reaches M c (project (translate M c)) := by + rcases c with ⟨_ | l,v,S⟩ + · exact ReflTransGen.refl + · exact ReflTransGen.single rfl + +theorem reaches_halt_iff (c : TM2.Cfg (fun _ : K ↦ Γ) Λ σ) (S : K → List Γ) (v : σ) : + TM2.Reaches M c ⟨none,v,S⟩ ↔ + StateTransition.Reaches (step M) (translate M c) (S,none,v) := by + constructor + · exact translate_reaches M + · intro h + exact (reaches_project_translate M c).trans (project_reaches M h) + +end Higman.MicroTM2 + +namespace Higman.TM2StackCompiler +open Turing Function AffineStack StackProgram MicroTM2 Relation +variable {K Γ Λ σ G : Type} [DecidableEq K] [Group G] + +def readOp (pop : Bool) : Option Γ → Op Γ + | none => .empty + | some a => if pop then .pop a else .peek a + +lemma readOp_rel (pop : Bool) (a : Option Γ) (s t : List Γ) : + (readOp pop a).Rel s t ↔ a = s.head? ∧ t = (if pop then s.tail else s) := by + cases pop <;> cases a <;> cases s <;> simp [readOp,Op.Rel] <;> aesop + +lemma readAction_rel (pop : Bool) (a : Option Γ) (k : K) (S T : K → List Γ) : + (Action.onStack k (readOp pop a)).Rel S T ↔ + a = (S k).head? ∧ T = (if pop then update S k (S k).tail else S) := by + simp only [Action.Rel,readOp_rel] + constructor + · rintro ⟨t,⟨h,rfl⟩,rfl⟩ + refine ⟨h,?_⟩ + cases pop <;> simp + · rintro ⟨h,rfl⟩ + refine ⟨if pop then (S k).tail else S k,⟨h,rfl⟩,?_⟩ + cases pop <;> simp + +def rawAction (q : Stmt K Γ Λ σ) (v : σ) (a : Option Γ) : Action K Γ := + match q with + | .push k f _ => .onStack k (.push (f v)) + | .peek k _ _ => .onStack k (readOp false a) + | .pop k _ _ => .onStack k (readOp true a) + | _ => .idle + +def rawTarget (M : Λ → Stmt K Γ Λ σ) (q : Stmt K Γ Λ σ) (v : σ) (a : Option Γ) : + Option (Stmt K Γ Λ σ) × σ := + match q with + | .push _ _ r => (some r,v) + | .peek _ f r => (some r,f v a) + | .pop _ f r => (some r,f v a) + | .load f r => (some r,f v) + | .branch f r t => (some (if f v then r else t),v) + | .goto f => (some (M (f v)),v) + | .halt => (none,v) + +variable (M : Λ → Stmt K Γ Λ σ) + +lemma raw_sound (q : Stmt K Γ Λ σ) (v : σ) (a : Option Γ) (S T : K → List Γ) + (h : (rawAction q v a).Rel S T) : + (T,rawTarget M q v a) ∈ MicroTM2.step M (S,some q,v) := by + cases q with + | push k f r => + obtain ⟨t,ht,rfl⟩ := h + cases ht + rfl + | peek k f r => + obtain ⟨ha,rfl⟩ := (readAction_rel false a k S T).mp h + simp [rawTarget,MicroTM2.step,ha] + | pop k f r => + obtain ⟨ha,rfl⟩ := (readAction_rel true a k S T).mp h + simp [rawTarget,MicroTM2.step,ha] + | load f r | branch f r t | goto f | halt => + cases h + rfl + +lemma raw_complete (q : Stmt K Γ Λ σ) (v : σ) (S : K → List Γ) (d : Cfg K Γ Λ σ) + (h : d ∈ MicroTM2.step M (S,some q,v)) : + ∃ a, (rawAction q v a).Rel S d.1 ∧ d.2 = rawTarget M q v a := by + cases q with + | push k f r => + have hd : d = (update S k (f v :: S k),some r,v) := by simpa [MicroTM2.step] using h.symm + subst d + exact ⟨none,⟨f v :: S k,rfl,rfl⟩,rfl⟩ + | peek k f r => + have hd : d = (S,some r,f v (S k).head?) := by simpa [MicroTM2.step] using h.symm + subst d + exact ⟨(S k).head?,(readAction_rel false _ k S S).mpr ⟨rfl,rfl⟩,rfl⟩ + | pop k f r => + have hd : d = (update S k (S k).tail,some r,f v (S k).head?) := by + simpa [MicroTM2.step] using h.symm + subst d + exact ⟨(S k).head?,(readAction_rel true _ k S _).mpr ⟨rfl,rfl⟩,rfl⟩ + | load f r => + have hd : d = (S,some r,f v) := by simpa [MicroTM2.step] using h.symm + subst d + exact ⟨none,rfl,rfl⟩ + | branch f r t => + have hd : d = (S,some (if f v then r else t),v) := by simpa [MicroTM2.step] using h.symm + subst d + exact ⟨none,rfl,rfl⟩ + | goto f => + have hd : d = (S,some (M (f v)),v) := by simpa [MicroTM2.step] using h.symm + subst d + exact ⟨none,rfl,rfl⟩ + | halt => + have hd : d = (S,none,v) := by simpa [MicroTM2.step] using h.symm + subst d + exact ⟨none,rfl,rfl⟩ + +variable (L : Finset Λ) (hL : ∀ l ∈ L, TM2.SupportsStmt L (M l)) + +include hL in +omit [DecidableEq K] in +lemma target_mem (q : Stmt K Γ Λ σ) (hq : some q ∈ TM2.stmts M L) (v : σ) (a : Option Γ) : + (rawTarget M q v a).1 ∈ TM2.stmts M L := by + classical + have hs : TM2.SupportsStmt L q := by + obtain ⟨l,hl,hh⟩ := Finset.mem_biUnion.mp (Finset.some_mem_insertNone.mp hq) + exact TM2.stmts₁_supportsStmt_mono hh (hL l hl) + cases q with + | push k f r | peek k f r | pop k f r | load f r => + exact TM2.stmts_trans (by simp [TM2.stmts₁,TM2.stmts₁_self]) hq + | branch f r t => + dsimp [rawTarget] + split_ifs + · exact TM2.stmts_trans (by simp [TM2.stmts₁,TM2.stmts₁_self]) hq + · exact TM2.stmts_trans (by simp [TM2.stmts₁,TM2.stmts₁_self]) hq + | goto f => + apply Finset.some_mem_insertNone.mpr + apply Finset.mem_biUnion.mpr + exact ⟨f v,hs v,TM2.stmts₁_self⟩ + | halt => exact Finset.none_mem_insertNone + +abbrev State := {q : Option (Stmt K Γ Λ σ) // q ∈ TM2.stmts M L} × σ +abbrev Edge := {q : Stmt K Γ Λ σ // some q ∈ TM2.stmts M L} × σ × Option Γ + +noncomputable instance [Fintype σ] : Fintype (State M L) := inferInstance +noncomputable instance [Fintype σ] [Fintype Γ] : Fintype (Edge M L) := by + classical + have : Fintype {q : Stmt K Γ Λ σ // some q ∈ TM2.stmts M L} := + Fintype.ofInjective (fun q ↦ (⟨some q.val,q.property⟩ : + {q : Option (Stmt K Γ Λ σ) // q ∈ TM2.stmts M L})) (by + intro q r h; exact Subtype.ext (Option.some.inj (congrArg Subtype.val h))) + exact inferInstance + +noncomputable def compile (e : Edge M L) : Instruction K Γ G (State M L) where + source := (⟨some e.1.val,e.1.property⟩,e.2.1) + target := (⟨(rawTarget M e.1.val e.2.1 e.2.2).1,target_mem M L hL _ e.1.property _ _⟩, + (rawTarget M e.1.val e.2.1 e.2.2).2) + action := rawAction e.1.val e.2.1 e.2.2 + weight := 1 + +def forget (c : (K → List Γ) × State M L) : Cfg K Γ Λ σ := + (c.1,c.2.1.val,c.2.2) + +lemma compile_sound (e : Edge M L) (S T : K → List Γ) + (h : (compile (G := G) M L hL e).action.Rel S T) : + forget M L (T,(compile (G := G) M L hL e).target) ∈ + MicroTM2.step M (forget M L (S,(compile (G := G) M L hL e).source)) := + raw_sound M e.1.val e.2.1 e.2.2 S T h + +lemma compile_complete (c : (K → List Γ) × State M L) (d : Cfg K Γ Λ σ) + (h : d ∈ MicroTM2.step M (forget M L c)) : + ∃ e : Edge M L, c.2 = (compile (G := G) M L hL e).source ∧ + (compile (G := G) M L hL e).action.Rel c.1 d.1 ∧ + forget M L (d.1,(compile (G := G) M L hL e).target) = d := by + rcases c with ⟨S,⟨_ | q,hq⟩,v⟩ + · simp [forget,MicroTM2.step] at h + · obtain ⟨a,ha,hd⟩ := raw_complete M q v S d h + refine ⟨(⟨q,hq⟩,v,a),rfl,ha,?_⟩ + change (d.1,rawTarget M q v a) = d + rw [← hd] + +lemma run_sound {seed : (K → List Γ) × State M L} {s : List (Edge M L)} + {c : (K → List Γ) × State M L} + (h : Run (compile (G := G) M L hL) seed s c) : + StateTransition.Reaches (MicroTM2.step M) (forget M L seed) (forget M L c) := by + induction h with + | start => exact ReflTransGen.refl + | step e S T hr h ih => exact ih.tail (compile_sound M L hL e S T hr) + +lemma reaches_complete {seed : (K → List Γ) × State M L} {d : Cfg K Γ Λ σ} + (h : StateTransition.Reaches (MicroTM2.step M) (forget M L seed) d) : + ∃ s c, Run (compile (G := G) M L hL) seed s c ∧ forget M L c = d := by + induction h with + | refl => exact ⟨[],seed,Run.start,rfl⟩ + | @tail d f hr hd ih => + obtain ⟨s,c,hc,rfl⟩ := ih + obtain ⟨e,he,ha,hf⟩ := compile_complete (G := G) M L hL c f hd + refine ⟨e::s,(f.1,(compile (G := G) M L hL e).target),?_,hf⟩ + apply Run.step e c.1 f.1 ha + simpa only [← he] using hc + +omit [DecidableEq K] in +@[simp] lemma weights_one (s : List (Edge M L)) : + HistoryMachine.value (fun e ↦ (compile (G := G) M L hL e).weight) s = 1 := by + induction s with + | nil => rfl + | cons e s ih => simpa only [HistoryMachine.value,compile,mul_one] using ih + +end Higman.TM2StackCompiler + +end UniversalFinitelyPresentedProof + +end OAI diff --git a/lean/OAI/GroupTheory/UniversalGroup/UniversalPresentation.lean b/lean/OAI/GroupTheory/UniversalGroup/UniversalPresentation.lean new file mode 100644 index 0000000000000000000000000000000000000000..f91c6f58b6940c73ef79533ca370e66022fbe8f9 --- /dev/null +++ b/lean/OAI/GroupTheory/UniversalGroup/UniversalPresentation.lean @@ -0,0 +1,564 @@ +import OAI.GroupTheory.UniversalGroup.HigmanEmbedding + +namespace OAI + +section UniversalFinitelyPresentedProof +universe u v w x +noncomputable section + +namespace UniversalFInfinity.UniversalGroup + +abbrev PresentationCode := Σ n : ℕ, Finset (FreeGroup (Fin n)) +abbrev Presented (p : PresentationCode) := PresentedGroup (p.2 : Set (FreeGroup (Fin p.1))) +abbrev CountableUniversal := Monoid.CoprodI Presented + +instance : Countable PresentationCode := inferInstance +instance (p : PresentationCode) : Countable (Presented p) := by + exact (QuotientGroup.mk'_surjective + (Subgroup.normalClosure (p.2 : Set (FreeGroup (Fin p.1))))).countable + +instance : Countable CountableUniversal := by + exact (Con.mk'_surjective (c := conGen (Monoid.CoprodI.Rel Presented))).countable + +theorem countable_universal {G : Type*} [Group G] [Group.IsFinitelyPresented G] : + ∃ φ : G →* CountableUniversal, Function.Injective φ := by + classical + obtain ⟨n,s,hs,⟨e⟩⟩ := Group.IsFinitelyPresented.exists_mulEquiv_presentedGroup (G := G) + let p : PresentationCode := ⟨n,hs.toFinset⟩ + have heq : (p.2 : Set (FreeGroup (Fin p.1))) = s := hs.coe_toFinset + let a : G ≃* Presented p := e.trans (QuotientGroup.quotientMulEquivOfEq + (congrArg Subgroup.normalClosure heq.symm)) + exact ⟨(Monoid.CoprodI.of (i := p)).comp a.toMonoidHom, + (Monoid.CoprodI.of_injective p).comp a.injective⟩ + +end UniversalFInfinity.UniversalGroup + +namespace UniversalFInfinity.FreeConjugates + +def shift (n : ℤ) : MulAut (FreeGroup ℤ) := + FreeGroup.freeGroupCongr (Equiv.addLeft n) + +@[simp] lemma shift_of (n k : ℤ) : shift n (FreeGroup.of k) = FreeGroup.of (n+k) := rfl + +def shifts : Multiplicative ℤ →* MulAut (FreeGroup ℤ) where + toFun n := shift n.toAdd + map_one' := by + apply MulEquiv.toMonoidHom_injective + ext k + simp [shift] + map_mul' n m := by + apply MulEquiv.toMonoidHom_injective + ext k + simp [shift, add_assoc] + +abbrev ShiftGroup := (FreeGroup ℤ) ⋊[shifts] (Multiplicative ℤ) +abbrev Two := FreeGroup Bool +def a : Two := FreeGroup.of false +def p : Two := FreeGroup.of true +def word (i : ℕ) : Two := a ^ i * p * (a ^ i)⁻¹ + +def test : Two →* ShiftGroup := + FreeGroup.lift (fun b => if b then SemidirectProduct.inl (FreeGroup.of 0) + else SemidirectProduct.inr (Multiplicative.ofAdd 1)) + +@[simp] lemma test_a : test a = SemidirectProduct.inr (Multiplicative.ofAdd 1) := by + simp [test,a] +@[simp] lemma test_p : test p = SemidirectProduct.inl (FreeGroup.of 0) := by + simp [test,p] + +lemma test_word (i : ℕ) : test (word i) = + SemidirectProduct.inl (FreeGroup.of (i : ℤ)) := by + simp only [word,map_mul,map_pow,map_inv,test_a,test_p] + rw [← map_pow,← map_inv,← SemidirectProduct.inl_aut] + congr 1 + change shift ((Multiplicative.ofAdd (1 : ℤ)) ^ i).toAdd (FreeGroup.of 0) = _ + simp + +def inclusion : FreeGroup ℕ →* Two := FreeGroup.lift word + +lemma test_comp : test.comp inclusion = + (SemidirectProduct.inl : FreeGroup ℤ →* ShiftGroup).comp (FreeGroup.map Int.ofNat) := by + apply FreeGroup.ext_hom + intro i + simpa only [MonoidHom.comp_apply, inclusion, FreeGroup.lift_apply_of, FreeGroup.map.of] + using (test_word i).trans (congrArg SemidirectProduct.inl + (congrArg FreeGroup.of (show (i : ℤ) = Int.ofNat i from rfl))) + +lemma inclusion_injective : Function.Injective inclusion := by + apply Function.Injective.of_comp (f := test) + rw [← MonoidHom.coe_comp,test_comp] + exact SemidirectProduct.inl_injective.comp (FreeGroup.map_injective Int.ofNat_injective) + +end UniversalFInfinity.FreeConjugates + +namespace UniversalFInfinity.CountableOvergroup +open Monoid +variable {C : Type u} [Group C] (c : ℕ → C) + +abbrev Base := Coprod C FreeConjugates.Two + +def left : FreeGroup ℕ →* Base (C := C) := + Coprod.inr.comp FreeConjugates.inclusion + +def right : FreeGroup ℕ →* Base (C := C) := + FreeGroup.lift (fun i => Coprod.inl (c i) * Coprod.inr (FreeConjugates.word i)) + +@[simp] lemma left_of (i : ℕ) : left (C := C) (FreeGroup.of i) = + Coprod.inr (FreeConjugates.word i) := by + simp only [left,MonoidHom.comp_apply,FreeConjugates.inclusion,FreeGroup.lift_apply_of] + +@[simp] lemma right_of (i : ℕ) : right c (FreeGroup.of i) = + Coprod.inl (c i) * Coprod.inr (FreeConjugates.word i) := by + simp only [right,FreeGroup.lift_apply_of] + +def projection : Base (C := C) →* FreeConjugates.Two := + Coprod.lift 1 (MonoidHom.id _) + +lemma left_injective : Function.Injective (left (C := C)) := + Coprod.inr_injective.comp FreeConjugates.inclusion_injective + +lemma projection_right : (projection (C := C)).comp (right c) = FreeConjugates.inclusion := by + apply FreeGroup.ext_hom + intro i + simp [projection,right,FreeConjugates.inclusion] + +lemma right_injective : Function.Injective (right c) := by + apply Function.Injective.of_comp (f := projection) + rw [← MonoidHom.coe_comp,projection_right] + exact FreeConjugates.inclusion_injective + +noncomputable def associated : (left (C := C)).range ≃* (right c).range := + (MonoidHom.ofInjective (left_injective (C := C))).symm.trans + (MonoidHom.ofInjective (right_injective c)) + +abbrev Overgroup := HNNExtension (Base (C := C)) (left (C := C)).range (right c).range + (associated c) + +noncomputable def embed : C →* Overgroup c := HNNExtension.of.comp Coprod.inl + +lemma embed_injective : Function.Injective (embed c) := + (HNNExtension.of_injective (φ := associated c)).comp Coprod.inl_injective + +noncomputable def a : Overgroup c := HNNExtension.of (Coprod.inr FreeConjugates.a) +noncomputable def p : Overgroup c := HNNExtension.of (Coprod.inr FreeConjugates.p) +noncomputable def t : Overgroup c := HNNExtension.t + +lemma associated_left (g : FreeGroup ℕ) : associated c ⟨left g,⟨g,rfl⟩⟩ = + ⟨right c g,⟨g,rfl⟩⟩ := by + change (MonoidHom.ofInjective (right_injective c)) + ((MonoidHom.ofInjective (left_injective (C := C))).symm + ((MonoidHom.ofInjective (left_injective (C := C))) g)) = _ + rw [MulEquiv.symm_apply_apply] + rfl + +lemma generator_formula (i : ℕ) : embed c (c i) = + t c * (a c ^ i * p c * (a c ^ i)⁻¹) * (t c)⁻¹ * + (a c ^ i * p c * (a c ^ i)⁻¹)⁻¹ := by + have h := HNNExtension.equiv_eq_conj (φ := associated c) + (⟨left (FreeGroup.of i),⟨FreeGroup.of i,rfl⟩⟩ : (left (C := C)).range) + rw [associated_left] at h + change HNNExtension.of (right c (FreeGroup.of i)) = _ at h + simp only [right_of,left_of,map_mul] at h + have hw : (HNNExtension.of (Coprod.inr (FreeConjugates.word i)) : Overgroup c) = + a c ^ i * p c * (a c ^ i)⁻¹ := by + simp only [FreeConjugates.word,map_mul,map_inv,map_pow,a,p] + rw [hw] at h + change embed c (c i) * _ = t c * _ * (t c)⁻¹ at h + rw [← h] + group + +lemma closure_three_of_generates (hc : Subgroup.closure (Set.range c) = ⊤) : + Subgroup.closure ({a c,p c,t c} : Set (Overgroup c)) = ⊤ := by + let S := Subgroup.closure ({a c,p c,t c} : Set (Overgroup c)) + have ha : a c ∈ S := Subgroup.subset_closure (by simp) + have hp : p c ∈ S := Subgroup.subset_closure (by simp) + have ht : t c ∈ S := Subgroup.subset_closure (by simp) + have hgen : Set.range c ⊆ S.comap (embed c) := by + rintro _ ⟨i,rfl⟩ + change embed c (c i) ∈ S + rw [generator_formula] + have hv := S.mul_mem (S.mul_mem (S.pow_mem ha i) hp) (S.inv_mem (S.pow_mem ha i)) + exact S.mul_mem (S.mul_mem (S.mul_mem ht hv) (S.inv_mem ht)) (S.inv_mem hv) + have htop : ⊤ ≤ S.comap (embed c) := by + rw [← hc] + exact (Subgroup.closure_le _).mpr hgen + have hcS (g : C) : embed c g ∈ S := htop (Subgroup.mem_top g) + have hfS (g : FreeConjugates.Two) : + (HNNExtension.of (Coprod.inr g) : Overgroup c) ∈ S := by + induction g using FreeGroup.induction_on with + | one => simp + | of b => cases b <;> assumption + | inv_of g hg => simpa only [map_inv] using S.inv_mem hg + | mul g h hg hh => simpa only [map_mul] using S.mul_mem hg hh + apply top_unique + intro g hg + clear hg + change g ∈ S + induction g using HNNExtension.induction_on with + | of g => + induction g using Coprod.induction_on with + | inl g => exact hcS g + | inr g => exact hfS g + | mul g h hg hh => simpa only [map_mul] using S.mul_mem hg hh + | t => exact ht + | mul g h hg hh => exact S.mul_mem hg hh + | inv g hg => exact S.inv_mem hg + +lemma closure_three (hc : Function.Surjective c) : + Subgroup.closure ({a c,p c,t c} : Set (Overgroup c)) = ⊤ := + closure_three_of_generates c (by rw [Set.range_eq_univ.mpr hc,Subgroup.closure_univ]) + +lemma finitely_generated (hc : Function.Surjective c) : Group.FG (Overgroup c) := + Group.fg_iff.mpr ⟨{a c,p c,t c},closure_three c hc,by simp⟩ + +theorem countable_embeds_three_generated [Countable C] : + ∃ (V : Type u) (_ : Group V) (_ : Group.FG V), + ∃ e : C →* V, Function.Injective e := by + obtain ⟨c,hc⟩ := exists_surjective_nat C + exact ⟨Overgroup c,inferInstance,finitely_generated c hc,embed c,embed_injective c⟩ + +end UniversalFInfinity.CountableOvergroup + +namespace UniversalFInfinity.ThreePresentation +open Monoid + +abbrev Alphabet := Bool ⊕ Unit +abbrev Words := FreeGroup Alphabet + +def A : Words := FreeGroup.of (Sum.inl false) +def P : Words := FreeGroup.of (Sum.inl true) +def T : Words := FreeGroup.of (Sum.inr ()) +def conjugate (i : ℕ) : Words := A ^ i * P * (A ^ i)⁻¹ +def substitute : FreeGroup ℕ →* Words := + FreeGroup.lift (fun i => T * conjugate i * T⁻¹ * (conjugate i)⁻¹) + +variable (rels : Set (FreeGroup ℕ)) +abbrev C := PresentedGroup rels +abbrev V := CountableOvergroup.Overgroup (PresentedGroup.of (rels := rels)) +abbrev Q := PresentedGroup (substitute '' rels) + +noncomputable def generator : Alphabet → V rels + | Sum.inl false => CountableOvergroup.a _ + | Sum.inl true => CountableOvergroup.p _ + | Sum.inr _ => CountableOvergroup.t _ + +lemma lift_substitute : (FreeGroup.lift (generator rels)).comp substitute = + (CountableOvergroup.embed (PresentedGroup.of (rels := rels))).comp + (PresentedGroup.mk rels) := by + apply FreeGroup.ext_hom + intro i + simp only [MonoidHom.comp_apply,substitute,FreeGroup.lift_apply_of, + map_mul,map_inv,conjugate,map_pow,A,P,T,generator] + exact (CountableOvergroup.generator_formula _ i).symm + +lemma substituted_relation (r : Words) (hr : r ∈ substitute '' rels) : + FreeGroup.lift (generator rels) r = 1 := by + obtain ⟨r,hr,rfl⟩ := hr + change ((FreeGroup.lift (generator rels)).comp substitute) r = 1 + rw [lift_substitute,MonoidHom.comp_apply,PresentedGroup.one_of_mem hr,map_one] + +noncomputable def toV : Q rels →* V rels := + PresentedGroup.toGroup (substituted_relation rels) + +def fromC : C rels →* Q rels := + PresentedGroup.map substitute (fun _ hr => ⟨_,hr,rfl⟩) + +lemma fromC_of (i : ℕ) : fromC rels (PresentedGroup.of i) = + (PresentedGroup.mk (substitute '' rels)) + (T * conjugate i * T⁻¹ * (conjugate i)⁻¹) := by + change (PresentedGroup.mk _) (substitute (FreeGroup.of i)) = _ + rw [substitute,FreeGroup.lift_apply_of] + +lemma toV_comp_fromC : (toV rels).comp (fromC rels) = + CountableOvergroup.embed (PresentedGroup.of (rels := rels)) := by + apply PresentedGroup.ext + intro i + rw [MonoidHom.comp_apply,fromC_of] + change (FreeGroup.lift (generator rels)) + (T * conjugate i * T⁻¹ * (conjugate i)⁻¹) = _ + simp only [map_mul,map_inv,conjugate,map_pow,T,A,P,FreeGroup.lift_apply_of,generator] + exact (CountableOvergroup.generator_formula _ i).symm + +theorem fromC_injective : Function.Injective (fromC rels) := by + apply Function.Injective.of_comp (f := toV rels) + rw [← MonoidHom.coe_comp,toV_comp_fromC] + exact CountableOvergroup.embed_injective _ + +end UniversalFInfinity.ThreePresentation + +namespace UniversalFInfinity.RecursiveUniversal + +abbrev Word := List (ℕ × Bool) +abbrev Code := List Word + +def relations (P : Code) : Set (FreeGroup ℕ) := FreeGroup.mk '' {w | w ∈ P} +def rawAt (m j : ℕ) : Word := ((Encodable.decode (α := Code) m).getD []).getD j [] +def colour (m : ℕ) (w : Word) : Word := w.map (fun x => (Nat.pair m x.1,x.2)) +def relator (k : ℕ) : Word := colour k.unpair.1 (rawAt k.unpair.1 k.unpair.2) +def allRelations : Set (FreeGroup ℕ) := Set.range (fun k => FreeGroup.mk (relator k)) +abbrev Universal := PresentedGroup allRelations + +lemma rawAt_encode (P : Code) (j : ℕ) : rawAt (Encodable.encode P) j = P.getD j [] := by + simp [rawAt] + +lemma coloured_relation (P : Code) (w : Word) (hw : w ∈ P) : + FreeGroup.map (Nat.pair (Encodable.encode P)) (FreeGroup.mk w) ∈ allRelations := by + obtain ⟨j,hj⟩ := List.mem_iff_getElem?.mp hw + refine ⟨Nat.pair (Encodable.encode P) j,?_⟩ + simp only [relator,Nat.unpair_pair,rawAt_encode,List.getD_eq_getElem?_getD,hj, + Option.getD_some,colour,FreeGroup.map.mk] + +def embed (P : Code) : PresentedGroup (relations P) →* Universal := + PresentedGroup.map (FreeGroup.map (Nat.pair (Encodable.encode P))) (by + rintro _ ⟨w,hw,rfl⟩ + exact coloured_relation P w hw) + +def project (P : Code) (k : ℕ) : PresentedGroup (relations P) := + if k.unpair.1 = Encodable.encode P then PresentedGroup.of k.unpair.2 else 1 + +lemma eval_colour (P : Code) (m : ℕ) : + (FreeGroup.lift (project P)).comp (FreeGroup.map (Nat.pair m)) = + if m = Encodable.encode P then PresentedGroup.mk (relations P) else 1 := by + apply FreeGroup.ext_hom + intro i + simp only [MonoidHom.comp_apply,FreeGroup.map.of,FreeGroup.lift_apply_of,project, + Nat.unpair_pair] + split_ifs <;> rfl + +lemma raw_relation (P : Code) (j : ℕ) : + PresentedGroup.mk (relations P) (FreeGroup.mk (P.getD j [])) = 1 := by + simp only [List.getD_eq_getElem?_getD] + cases hj : P[j]? with + | none => change (PresentedGroup.mk (relations P)) 1 = 1; exact map_one _ + | some w => + simp only [Option.getD_some] + exact PresentedGroup.one_of_mem ⟨w,List.mem_of_getElem? hj,rfl⟩ + +lemma project_relator (P : Code) (k : ℕ) : + FreeGroup.lift (project P) (FreeGroup.mk (relator k)) = 1 := by + change FreeGroup.lift (project P) + (FreeGroup.mk ((rawAt k.unpair.1 k.unpair.2).map + (fun x => (Nat.pair k.unpair.1 x.1,x.2)))) = 1 + rw [← FreeGroup.map.mk] + rw [← MonoidHom.comp_apply] + rw [eval_colour] + split_ifs with h + · rw [h,rawAt_encode] + exact raw_relation P _ + · rfl + +def retract (P : Code) : Universal →* PresentedGroup (relations P) := + PresentedGroup.toGroup (by rintro _ ⟨k,rfl⟩; exact project_relator P k) + +lemma retract_embed (P : Code) : (retract P).comp (embed P) = MonoidHom.id _ := by + apply PresentedGroup.ext + intro i + change FreeGroup.lift (project P) (FreeGroup.map (Nat.pair (Encodable.encode P)) + (FreeGroup.of i)) = PresentedGroup.of i + simp [project] + +lemma embed_injective (P : Code) : Function.Injective (embed P) := by + apply Function.Injective.of_comp (f := retract P) + rw [← MonoidHom.coe_comp,retract_embed] + exact Function.injective_id + +def rename {α β : Type*} (i : α ↪ β) (s : Set (FreeGroup α)) : + PresentedGroup s →* PresentedGroup (FreeGroup.map i '' s) := + PresentedGroup.map (FreeGroup.map i) (fun _ hr => ⟨_,hr,rfl⟩) + +noncomputable def renameValues {α β : Type*} (i : α ↪ β) (s : Set (FreeGroup α)) : + β → PresentedGroup s := Function.extend i PresentedGroup.of (fun _ => 1) + +lemma renameValues_comp {α β : Type*} (i : α ↪ β) (s : Set (FreeGroup α)) : + (FreeGroup.lift (renameValues i s)).comp (FreeGroup.map i) = PresentedGroup.mk s := by + apply FreeGroup.ext_hom + intro a + simp [renameValues,i.injective.extend_apply,PresentedGroup.of] + +noncomputable def renameRetract {α β : Type*} (i : α ↪ β) (s : Set (FreeGroup α)) : + PresentedGroup (FreeGroup.map i '' s) →* PresentedGroup s := + PresentedGroup.toGroup (by + rintro _ ⟨r,hr,rfl⟩ + change ((FreeGroup.lift (renameValues i s)).comp (FreeGroup.map i)) r = 1 + rw [renameValues_comp] + exact PresentedGroup.one_of_mem hr) + +lemma renameRetract_comp {α β : Type*} (i : α ↪ β) (s : Set (FreeGroup α)) : + (renameRetract i s).comp (rename i s) = MonoidHom.id _ := by + apply PresentedGroup.ext + intro a + change FreeGroup.lift (renameValues i s) (FreeGroup.map i (FreeGroup.of a)) = + PresentedGroup.of a + simp [renameValues,i.injective.extend_apply] + +lemma rename_injective {α β : Type*} (i : α ↪ β) (s : Set (FreeGroup α)) : + Function.Injective (rename i s) := by + apply Function.Injective.of_comp (f := renameRetract i s) + rw [← MonoidHom.coe_comp,renameRetract_comp] + exact Function.injective_id + +lemma code_exists (s : Set (FreeGroup ℕ)) (hs : s.Finite) : ∃ P : Code, relations P = s := by + classical + refine ⟨hs.toFinset.toList.map FreeGroup.toWord,?_⟩ + ext r + constructor + · rintro ⟨w,hw,rfl⟩ + obtain ⟨q,hq,rfl⟩ := List.mem_map.mp hw + rw [FreeGroup.mk_toWord] + exact hs.mem_toFinset.mp (Finset.mem_toList.mp hq) + · intro hr + refine ⟨r.toWord,?_,FreeGroup.mk_toWord⟩ + exact List.mem_map.mpr ⟨r,Finset.mem_toList.mpr (hs.mem_toFinset.mpr hr),rfl⟩ + +theorem universal {G : Type*} [Group G] [Group.IsFinitelyPresented G] : + ∃ h : G →* Universal, Function.Injective h := by + classical + obtain ⟨n,s,hs,⟨e⟩⟩ := Group.IsFinitelyPresented.exists_mulEquiv_presentedGroup (G := G) + let i : Fin n ↪ ℕ := ⟨Fin.val,Fin.val_injective⟩ + obtain ⟨P,hP⟩ := code_exists (FreeGroup.map i '' s) (hs.image _) + let eP : PresentedGroup (FreeGroup.map i '' s) ≃* PresentedGroup (relations P) := + QuotientGroup.quotientMulEquivOfEq (congrArg Subgroup.normalClosure hP.symm) + exact ⟨(embed P).comp (eP.toMonoidHom.comp ((rename i s).comp e.toMonoidHom)), + (embed_injective P).comp (eP.injective.comp ((rename_injective i s).comp e.injective))⟩ + +lemma rawAt_primrec : Primrec₂ rawAt := by + unfold rawAt + exact (Primrec.list_getD []).comp + (Primrec.option_getD.comp (Primrec.decode.comp Primrec.fst) (Primrec.const [])) Primrec.snd + +lemma colour_primrec : Primrec₂ colour := by + unfold Primrec₂ colour + apply Primrec.list_map Primrec.snd + exact (Primrec₂.natPair.comp (Primrec.fst.comp Primrec.fst) + (Primrec.fst.comp Primrec.snd)).pair (Primrec.snd.comp Primrec.snd) + +theorem relator_primrec : Primrec relator := by + unfold relator + exact colour_primrec.comp (Primrec.fst.comp Primrec.unpair) + (rawAt_primrec.comp (Primrec.fst.comp Primrec.unpair) (Primrec.snd.comp Primrec.unpair)) + +end UniversalFInfinity.RecursiveUniversal + +namespace UniversalFInfinity.RecursiveUniversalThree +open ThreePresentation +abbrev Raw := List (Alphabet × Bool) + +def positive (i : ℕ) : Raw := List.replicate i (Sum.inl false,true) +def v (i : ℕ) : Raw := positive i ++ [(Sum.inl true,true)] ++ FreeGroup.invRev (positive i) +def replacement (i : ℕ) : Raw := + [(Sum.inr (),true)] ++ v i ++ [(Sum.inr (),false)] ++ FreeGroup.invRev (v i) +def substituteRaw (w : RecursiveUniversal.Word) : Raw := + w.flatMap (fun x => if x.2 then replacement x.1 else FreeGroup.invRev (replacement x.1)) +def enumerator (k : ℕ) : Raw := substituteRaw (RecursiveUniversal.relator k) + +lemma mk_positive (i : ℕ) : FreeGroup.mk (positive i) = A ^ i := by + induction i with + | zero => rfl + | succ i ih => + simp only [positive,List.replicate_succ] + change A * FreeGroup.mk (positive i) = A ^ (i+1) + rw [ih,pow_succ'] + +lemma mk_v (i : ℕ) : FreeGroup.mk (v i) = conjugate i := by + simp only [v,← FreeGroup.mul_mk,← FreeGroup.inv_mk,mk_positive,conjugate] + rfl + +lemma mk_replacement (i : ℕ) : FreeGroup.mk (replacement i) = + substitute (FreeGroup.of i) := by + simp only [replacement,← FreeGroup.mul_mk,← FreeGroup.inv_mk,mk_v, + substitute,FreeGroup.lift_apply_of] + rfl + +lemma mk_substituteRaw (w : RecursiveUniversal.Word) : FreeGroup.mk (substituteRaw w) = + substitute (FreeGroup.mk w) := by + induction w with + | nil => exact (map_one substitute).symm + | cons x w ih => + rcases x with ⟨i,b⟩ + cases b with + | false => + change FreeGroup.mk (FreeGroup.invRev (replacement i) ++ substituteRaw w) = + substitute ((FreeGroup.of i)⁻¹ * FreeGroup.mk w) + rw [← FreeGroup.mul_mk,← FreeGroup.inv_mk,mk_replacement,map_mul,map_inv,ih] + | true => + change FreeGroup.mk (replacement i ++ substituteRaw w) = + substitute (FreeGroup.of i * FreeGroup.mk w) + rw [← FreeGroup.mul_mk,mk_replacement,map_mul,ih] + +lemma enumerated_relations : Set.range (fun k => FreeGroup.mk (enumerator k)) = + substitute '' RecursiveUniversal.allRelations := by + ext r + constructor + · rintro ⟨k,rfl⟩ + exact ⟨FreeGroup.mk (RecursiveUniversal.relator k),⟨k,rfl⟩,(mk_substituteRaw _).symm⟩ + · rintro ⟨_,⟨k,rfl⟩,rfl⟩ + exact ⟨k,mk_substituteRaw _⟩ + +lemma invRev_primrec : Primrec (@FreeGroup.invRev Alphabet) := by + unfold FreeGroup.invRev + apply Primrec.list_reverse.comp + apply Primrec.list_map Primrec.id + exact (Primrec.fst.comp Primrec.snd).pair + ((Primrec.dom_bool Bool.not).comp (Primrec.snd.comp Primrec.snd)) + +lemma positive_primrec : Primrec positive := by + have h : Primrec (fun i : ℕ => (List.range i).map (fun _ => ((Sum.inl false,true) : Alphabet × Bool))) := + Primrec.list_map Primrec.list_range (Primrec₂.const _) + apply h.of_eq + intro i + simp only [List.map_const',List.length_range,positive] + +lemma v_primrec : Primrec v := + Primrec.list_append.comp + (Primrec.list_append.comp positive_primrec (Primrec.const _)) + (invRev_primrec.comp positive_primrec) + +lemma replacement_primrec : Primrec replacement := + Primrec.list_append.comp + (Primrec.list_append.comp (Primrec.list_append.comp (Primrec.const _) v_primrec) (Primrec.const _)) + (invRev_primrec.comp v_primrec) + +lemma substituteRaw_primrec : Primrec substituteRaw := by + have h : Primrec (fun x : ℕ × Bool => + if x.2 then replacement x.1 else FreeGroup.invRev (replacement x.1)) := by + apply (Primrec.cond Primrec.snd (replacement_primrec.comp Primrec.fst) + (invRev_primrec.comp (replacement_primrec.comp Primrec.fst))).of_eq + intro x + cases x.2 <;> rfl + exact Primrec.list_flatMap Primrec.id (h.comp Primrec.snd) + +theorem enumerator_primrec : Primrec enumerator := + substituteRaw_primrec.comp RecursiveUniversal.relator_primrec + +abbrev Universal := PresentedGroup (Set.range (fun k => FreeGroup.mk (enumerator k))) + +theorem universal {G : Type*} [Group G] [Group.IsFinitelyPresented G] : + ∃ h : G →* Universal, Function.Injective h := by + obtain ⟨e,he⟩ := RecursiveUniversal.universal (G := G) + let q := QuotientGroup.quotientMulEquivOfEq + (congrArg Subgroup.normalClosure enumerated_relations.symm) + exact ⟨q.toMonoidHom.comp ((ThreePresentation.fromC _).comp e), + q.injective.comp ((ThreePresentation.fromC_injective _).comp he)⟩ + +end UniversalFInfinity.RecursiveUniversalThree + +namespace UniversalFInfinity +universe z + +theorem exists_universal_finitely_presented : + ∃ (U : Type) (_ : Group U) (_ : Group.IsFinitelyPresented U), + ∀ (G : Type z) [Group G] [Group.IsFinitelyPresented G], + ∃ i : G →* U, Function.Injective i := by + obtain ⟨U,gU,fpU,i,hi⟩ := Higman.NormalWords.embeds_presentation + RecursiveUniversalThree.enumerator RecursiveUniversalThree.enumerator_primrec.to_comp + refine ⟨U,gU,fpU,?_⟩ + intro G _ _ + obtain ⟨j,hj⟩ := RecursiveUniversalThree.universal (G := G) + exact ⟨i.comp j,hi.comp hj⟩ + +end UniversalFInfinity + +end +end UniversalFinitelyPresentedProof + +end OAI diff --git a/lean/OAI/GroupTheory/UniversalGroup/UniverseTransport.lean b/lean/OAI/GroupTheory/UniversalGroup/UniverseTransport.lean new file mode 100644 index 0000000000000000000000000000000000000000..a7dcec973ee8aae747c1f8397fe136497c34cbef --- /dev/null +++ b/lean/OAI/GroupTheory/UniversalGroup/UniverseTransport.lean @@ -0,0 +1,181 @@ +import OAI.GroupTheory.UniversalGroup.BrownConstruction + +namespace OAI + +noncomputable section + +open Set Metric Topology BigOperators +open Set Metric Topology +open Set Topology +open Set Metric Topology +open scoped NNReal +open Set Metric Topology +open scoped NNReal ENNReal +open Set Metric Topology +open scoped TensorProduct + +open Set Metric Topology +namespace UniversalFInfinity.UniverseTransport + +section +universe u v +variable {X : Type u} {Y : Type v} [TopologicalSpace X] [TopologicalSpace Y] [Nonempty X] +variable {C : Set X} [CWComplex C] {f : X → Y} (hf : IsClosedEmbedding f) + +def transportedMap (n : ℕ) (i : RelCWComplex.cell C n) : PartialEquiv (Fin n → ℝ) Y := + (RelCWComplex.map n i).trans (hf.isEmbedding.toPartialHomeomorph f).toPartialEquiv + +@[simp] lemma transportedMap_apply (n : ℕ) (i : RelCWComplex.cell C n) (x : Fin n → ℝ) : + transportedMap hf n i x = f (RelCWComplex.map n i x) := rfl + +lemma transportedMap_source (n : ℕ) (i : RelCWComplex.cell C n) : + (transportedMap hf n i).source = ball 0 1 := by + simp only [transportedMap,PartialEquiv.trans_source, + IsEmbedding.toPartialHomeomorph_source,Set.preimage_univ,Set.inter_univ, + RelCWComplex.source_eq] + +lemma transportedMap_image (n : ℕ) (i : RelCWComplex.cell C n) (S : Set (Fin n → ℝ)) : + transportedMap hf n i '' S = f '' (RelCWComplex.map n i '' S) := + Set.image_comp f (RelCWComplex.map n i) S + +lemma transportedMap_continuousOn (n : ℕ) (i : RelCWComplex.cell C n) : + ContinuousOn (transportedMap hf n i) (closedBall 0 1) := + hf.continuous.comp_continuousOn (RelCWComplex.continuousOn n i) + +lemma transportedMap_continuousOn_symm (n : ℕ) (i : RelCWComplex.cell C n) : + ContinuousOn (transportedMap hf n i).symm (transportedMap hf n i).target := by + let e := hf.isEmbedding.toPartialHomeomorph f + change ContinuousOn (fun y => (RelCWComplex.map n i).symm (e.symm y)) + (e.target ∩ e.symm ⁻¹' (RelCWComplex.map n i).target) + exact (RelCWComplex.continuousOn_symm n i).comp + (e.continuousOn_symm.mono Set.inter_subset_left) (fun _ h => h.2) + +variable [T2Space X] + +end + +section +open Set Metric Topology +universe u v +variable {X : Type u} [TopologicalSpace X] [T2Space X] [Nonempty X] + [CWComplex (univ : Set X)] + +abbrev liftMap (n : ℕ) (i : ULift.{v} (RelCWComplex.cell (univ : Set X) n)) := + transportedMap (Homeomorph.ulift.symm : X ≃ₜ ULift.{v} X).isClosedEmbedding n i.down + +@[instance_reducible] +def liftCW : CWComplex (univ : Set (ULift.{v} X)) where + cell n := ULift.{v} (RelCWComplex.cell (univ : Set X) n) + map := liftMap + source_eq n i := transportedMap_source _ n i.down + continuousOn n i := transportedMap_continuousOn _ n i.down + continuousOn_symm n i := transportedMap_continuousOn_symm _ n i.down + pairwiseDisjoint' := by + intro p _ q _ hpq + change Disjoint (liftMap p.1 p.2 '' ball 0 1) (liftMap q.1 q.2 '' ball 0 1) + rw [transportedMap_image,transportedMap_image] + apply (CWComplex.disjoint_openCell_of_ne ?_).image ULift.up_injective.injOn + (Set.subset_univ _) (Set.subset_univ _) + intro h + apply hpq + have hf : Function.Injective (fun p : Σ n, ULift.{v} (RelCWComplex.cell (univ : Set X) n) => + (⟨p.1,p.2.down⟩ : Σ n, RelCWComplex.cell (univ : Set X) n)) := by + rintro ⟨n,⟨i⟩⟩ ⟨m,⟨j⟩⟩ h + cases h + rfl + exact hf h + mapsTo' := by + intro n i + obtain ⟨I,hI⟩ := CWComplex.cellFrontier_subset_finite_closedCell n i.down + refine ⟨fun m => (I m).map ⟨ULift.up,ULift.up_injective⟩,?_⟩ + intro x hx + have h := hI (show RelCWComplex.map n i.down x ∈ CWComplex.cellFrontier n i.down from ⟨x,hx,rfl⟩) + simp only [Set.mem_iUnion] at h + obtain ⟨m,hm,j,hj,hx⟩ := h + refine Set.mem_iUnion.mpr ⟨m,Set.mem_iUnion.mpr ⟨hm,Set.mem_iUnion.mpr + ⟨ULift.up j,Set.mem_iUnion.mpr ⟨Finset.mem_map.mpr ⟨j,hj,rfl⟩,?_⟩⟩⟩⟩ + rw [transportedMap_image] + exact ⟨_,hx,rfl⟩ + closed' := by + intro A _ hclosed + have hpre : IsClosed (ULift.up ⁻¹' A : Set X) := by + apply (CWComplex.closed (univ : Set X) _ (Set.subset_univ _)).mpr + intro n i + have h := (hclosed n (ULift.up i)).preimage continuous_uliftUp + rw [transportedMap_image,Set.preimage_inter] at h + change IsClosed (ULift.up ⁻¹' A ∩ ULift.up ⁻¹' + (ULift.up '' (RelCWComplex.map n i '' closedBall 0 1))) at h + rw [Set.preimage_image_eq _ ULift.up_injective] at h + exact h + exact ULift.isClosed_iff.mpr hpre + union' := by + apply Set.Subset.antisymm (Set.subset_univ _) + intro y _ + have hy : y.down ∈ ⋃ n, ⋃ i : RelCWComplex.cell (univ : Set X) n, CWComplex.closedCell n i := by + rw [CWComplex.union] + trivial + simp only [Set.mem_iUnion] at hy + obtain ⟨n,i,hi⟩ := hy + refine Set.mem_iUnion.mpr ⟨n,Set.mem_iUnion.mpr ⟨ULift.up i,?_⟩⟩ + rw [transportedMap_image] + exact ⟨y.down,hi,rfl⟩ +end +open Set Topology +universe u v +variable {G X E : Type u} [Group G] [TopologicalSpace X] [TopologicalSpace E] + [MulAction G E] {p : E → X} (hp : IsQuotientCoveringMap p G) + +def liftedCover : ULift.{v} E → ULift.{v} X := fun e => ⟨p e.down⟩ +include hp in +lemma liftedCover_quotient : IsQuotientCoveringMap (liftedCover.{u,v} (p := p)) G where + __ := (Homeomorph.ulift.symm.isQuotientMap.comp hp.toIsQuotientMap).comp + Homeomorph.ulift.isQuotientMap + continuous_const_smul g := by + change Continuous (fun e : ULift.{v} E => ULift.up (g • e.down)) + exact continuous_uliftUp.comp ((hp.continuous_const_smul g).comp continuous_uliftDown) + apply_eq_iff_mem_orbit := by + intro e₁ e₂ + change ULift.up (p e₁.down) = ULift.up (p e₂.down) ↔ e₁ ∈ MulAction.orbit G e₂ + rw [ULift.up_inj,hp.apply_eq_iff_mem_orbit] + constructor + · rintro ⟨g,hg⟩ + exact ⟨g,ULift.down_injective hg⟩ + · rintro ⟨g,hg⟩ + exact ⟨g,congrArg ULift.down hg⟩ + disjoint e := by + obtain ⟨U,hU,hd⟩ := hp.disjoint e.down + refine ⟨ULift.down ⁻¹' U,continuous_uliftDown.continuousAt.preimage_mem_nhds hU,?_⟩ + rintro g ⟨z,⟨y,hy,hyz⟩,hz⟩ + exact hd g ⟨z.down,⟨y.down,hy,congrArg ULift.down hyz⟩,hz⟩ +end UniversalFInfinity.UniverseTransport +namespace UniversalFInfinity.Brown +open Set Topology UniverseTransport +universe z +variable {G : Type} [Group G] [TopologicalSpace G] [DiscreteTopology G] +variable (hunif : ∀ S : Milnor.Shapes G, ∃ (T : Milnor.Shapes G) (hST : S ⊆ T), + (Milnor.stageIncl G S T hST).Nullhomotopic) + +include hunif in + +theorem geometric_lifted_of_uniform : HasTypeFInfinity (ULift.{z} G) := by + let : T2Space (ULift.{z} (Base hunif)) := Homeomorph.ulift.symm.t2Space + let : ContractibleSpace (ULift.{z} (Total hunif)) := Homeomorph.ulift.contractibleSpace + let q : ULift.{z} (Total hunif) → ULift.{z} (Base hunif) := + liftedCover (p := pLimit hunif) + have hq : IsQuotientCoveringMap q G := liftedCover_quotient (pLimit_covering hunif) + let : ConnectedSpace (ULift.{z} (Base hunif)) := hq.surjective.connectedSpace hq.continuous + let cw : CWComplex (univ : Set (ULift.{z} (Base hunif))) := liftCW + refine ⟨ULift.{z} (Base hunif),inferInstance,inferInstance,inferInstance,cw,?_,?_,?_⟩ + · intro n + change Finite (ULift.{z} ((baseCW hunif).cell n)) + have := base_finite hunif n + infer_instance + · let e : ULift.{z} (Total hunif) := Classical.choice inferInstance + exact ⟨q e,⟨(hq.fundamentalGroupEquiv ⟨e,rfl⟩).trans + ((MulEquiv.inv' G).symm.trans MulEquiv.ulift.symm)⟩⟩ + · exact ⟨ULift.{z} (Total hunif),inferInstance,inferInstance,q,hq.surjective,hq.isCoveringMap⟩ +end UniversalFInfinity.Brown + +end + +end OAI diff --git a/lean/OAI/InformationTheory/AmplitudeDamping/BlockFactors.lean b/lean/OAI/InformationTheory/AmplitudeDamping/BlockFactors.lean new file mode 100644 index 0000000000000000000000000000000000000000..53bb4eeb1925da9c111cf2011ce13bc26d9d0a96 --- /dev/null +++ b/lean/OAI/InformationTheory/AmplitudeDamping/BlockFactors.lean @@ -0,0 +1,181 @@ +import OAI.InformationTheory.AmplitudeDamping.EntropyContinuity + +namespace OAI + +noncomputable section + +universe u_1 u_2 u_3 u_4 u_5 u_6 u_7 u_8 + +section +open scoped BigOperators ComplexOrder MatrixOrder +open Matrix +namespace GAD + +section +variable {ι : Type u_1} {μ : Type u_2} [Fintype ι] [Fintype μ] [DecidableEq ι] [DecidableEq μ] + +def blockUnitary (U : μ → Matrix.unitaryGroup ι ℂ) : Matrix.unitaryGroup (ι × μ) ℂ := + ⟨Matrix.blockDiagonal (fun m ↦ U m), by + constructor + · change (Matrix.blockDiagonal _)ᴴ*Matrix.blockDiagonal _=1 + rw [Matrix.blockDiagonal_conjTranspose,← Matrix.blockDiagonal_mul] + simp only [← Matrix.star_eq_conjTranspose,Unitary.coe_star_mul_self] + exact Matrix.blockDiagonal_one + · change Matrix.blockDiagonal _*(Matrix.blockDiagonal _)ᴴ=1 + rw [Matrix.blockDiagonal_conjTranspose,← Matrix.blockDiagonal_mul] + simp only [← Matrix.star_eq_conjTranspose,← Unitary.coe_star,Unitary.coe_mul_star_self] + exact Matrix.blockDiagonal_one⟩ + +theorem entropy_blockDiagonal (A : μ → Matrix ι ι ℂ) (hA : ∀ m, (A m).IsHermitian) : + entropy (Matrix.blockDiagonal A)=∑ m, entropy (A m) := by + let U := blockUnitary (fun m ↦ (hA m).eigenvectorUnitary) + let d : ι × μ → ℝ := fun im ↦ (hA im.2).eigenvalues im.1 + have he : Matrix.blockDiagonal A=Unitary.conjStarAlgAut ℂ _ U (Matrix.diagonal (fun im ↦ (d im:ℂ))) := by + rw [Unitary.conjStarAlgAut_apply] + change Matrix.blockDiagonal A=Matrix.blockDiagonal _*Matrix.diagonal _*(Matrix.blockDiagonal _)ᴴ + dsimp only [d] + rw [← Matrix.blockDiagonal_diagonal (fun m i ↦ ((hA m).eigenvalues i:ℂ)),Matrix.blockDiagonal_conjTranspose, + ← Matrix.blockDiagonal_mul,← Matrix.blockDiagonal_mul] + congr 1; funext m + exact (hA m).spectral_theorem + have hh : (Matrix.diagonal (fun im ↦ (d im:ℂ))).IsHermitian := by + apply Matrix.isHermitian_diagonal_iff.mpr + intro im; exact Complex.conj_ofReal _ + rw [he,entropy_unitary_conj U hh,entropy_diagonal,Fintype.sum_prod_type,Finset.sum_comm] + apply Finset.sum_congr rfl + intro m _ + exact (entropy_eq_sum (hA m)).symm + +end + +variable {ι : Type u_3} {κ : Type u_4} {μ : Type u_5} [Fintype ι] [Fintype κ] [Fintype μ] + [DecidableEq ι] [DecidableEq μ] + +def blockProjection (m : μ) : Matrix (ι × μ) (ι × μ) ℂ := + Matrix.diagonal (fun im ↦ if im.2=m then 1 else 0) + +def blockInjection (m : μ) : Matrix (ι × μ) ι ℂ := + fun ia j ↦ if ia.2=m then if ia.1=j then 1 else 0 else 0 + +theorem blockProjection_isProjection (m : μ) : IsProjection (blockProjection (ι := ι) m) := by + constructor + · apply Matrix.isHermitian_diagonal_iff.mpr + intro im; split_ifs <;> simp + · rw [blockProjection,Matrix.diagonal_mul_diagonal] + congr 1; funext im; split_ifs <;> simp + +omit [Fintype κ] in +theorem blockProjection_mul (m : μ) (X : Matrix (ι × μ) κ ℂ) (ia : ι × μ) (j : κ) : + (blockProjection (ι := ι) m*X) ia j=if ia.2=m then X ia j else 0 := by + simp [blockProjection,Matrix.diagonal_mul] + +omit [Fintype κ] [Fintype μ] in +theorem blockInjection_mul (m : μ) (X : Matrix ι κ ℂ) (ia : ι × μ) (j : κ) : + (blockInjection (ι := ι) m*X) ia j=if ia.2=m then X ia.1 j else 0 := by + simp [blockInjection,Matrix.mul_apply,ite_mul] + +theorem blockInjection_isometry (m : μ) : + (blockInjection (ι := ι) m)ᴴ*blockInjection (ι := ι) m=1 := by + ext i j + simp only [Matrix.mul_apply,Fintype.sum_prod_type,Matrix.conjTranspose_apply,blockInjection] + simp [Matrix.one_apply,eq_comm] + +omit [Fintype κ] in +theorem blockProjection_range {m : μ} {X : Matrix (ι × μ) κ ℂ} + (hX : blockProjection (ι := ι) m*X=X) : blockInjection (ι := ι) m*(show Matrix ι κ ℂ from fun i j ↦ X (i,m) j)=X := by + ext ia j + have h := congrArg (fun A : Matrix (ι × μ) κ ℂ ↦ A ia j) hX + rw [blockProjection_mul] at h + rw [blockInjection_mul] + split_ifs with hm + · cases ia with | mk i a => change a=m at hm; subst a; rfl + · simpa only [ite_eq_right hm] using h + +theorem mass_isometry {ρ : Type u_6} [Fintype ρ] (W : Matrix ρ ι ℂ) + (hW : Wᴴ*W=1) (X : Matrix ι κ ℂ) : mass (W*X)=mass X := by + dsimp [mass,gram] + rw [Matrix.conjTranspose_mul,Matrix.trace_mul_comm] + have h : Xᴴ*Wᴴ*(W*X)=Xᴴ*X := by + rw [← Matrix.mul_assoc _ W,Matrix.mul_assoc Xᴴ, hW,Matrix.mul_one] + rw [h,Matrix.trace_mul_comm] + +theorem entropy_gram_isometry {ρ : Type u_7} [Fintype ρ] [DecidableEq ρ] [DecidableEq κ] + (W : Matrix ρ ι ℂ) (hW : Wᴴ*W=1) (X : Matrix ι κ ℂ) : + entropy (gram (W*X))=entropy (gram X) := by + change entropy ((W*X)*(W*X)ᴴ)=entropy (X*Xᴴ) + rw [entropy_mul_conjTranspose,entropy_mul_conjTranspose X,Matrix.conjTranspose_mul] + congr 1 + rw [← Matrix.mul_assoc _ W,Matrix.mul_assoc Xᴴ,hW,Matrix.mul_one] + +theorem block_factor_entropy [DecidableEq κ] (m : μ) (X : Matrix ι κ ℂ) : + entropy (gram (blockInjection (ι := ι) m*X))=entropy (gram X) := + entropy_gram_isometry _ (blockInjection_isometry m) X + +omit [Fintype μ] in +theorem gram_blockInjection (m : μ) (X : Matrix ι κ ℂ) (ia jb : ι × μ) : + gram (blockInjection (ι := ι) m*X) ia jb= + if ia.2=m ∧ jb.2=m then gram X ia.1 jb.1 else 0 := by + change (∑ k, (blockInjection (ι := ι) m*X) ia k*star ((blockInjection (ι := ι) m*X) jb k)) = _ + simp only [blockInjection_mul] + by_cases hi : ia.2=m <;> by_cases hj : jb.2=m <;> + simp [hi,hj,gram,Matrix.mul_apply,Matrix.conjTranspose_apply] + +end GAD + +end + +open scoped BigOperators ComplexOrder MatrixOrder +open Matrix +namespace GAD +variable {ι : Type u_8} [Fintype ι] [DecidableEq ι] + +theorem trace_product_nonneg {A B : Matrix ι ι ℂ} (hA : A.PosSemidef) (hB : B.PosSemidef) : + 0 ≤ (A*B).trace.re := by + let L := spectralFactor hB + have hL : L*Lᴴ=B := spectralFactor_gram hB + have h := (hA.conjTranspose_mul_mul_same L).trace_nonneg + rw [Matrix.trace_mul_cycle] at h + rw [hL] at h + simpa only [Matrix.trace_mul_comm B A] using (Complex.nonneg_iff.mp h).1 + +theorem trace_product_mono {P A B : Matrix ι ι ℂ} (hP : P.PosSemidef) + (hAB : (B-A).PosSemidef) : (P*A).trace.re ≤ (P*B).trace.re := by + have h := trace_product_nonneg hP hAB + simpa only [Matrix.mul_sub,Matrix.trace_sub,Complex.sub_re,sub_nonneg] using h + +theorem IsState.le_one {A : Matrix ι ι ℂ} (hA : IsState A) : (1-A).PosSemidef := by + let U := hA.1.isHermitian.eigenvectorUnitary + let l := hA.1.isHermitian.eigenvalues + have hl : ∀ i, l i ≤ 1 := by + intro i + rw [← spectral_weights_sum hA] + exact Finset.single_le_sum (fun j _ ↦ hA.1.eigenvalues_nonneg j) (Finset.mem_univ i) + have hd : (Matrix.diagonal (fun i ↦ ((1-l i:ℝ):ℂ))).PosSemidef := by + apply Matrix.PosSemidef.diagonal + intro i + change (0:ℂ) ≤ ((1-l i:ℝ):ℂ) + exact_mod_cast sub_nonneg.mpr (hl i) + have he : 1-A=U.val*Matrix.diagonal (fun i ↦ ((1-l i:ℝ):ℂ))*U.valᴴ := by + have hs := hA.1.isHermitian.spectral_theorem + rw [Unitary.conjStarAlgAut_apply] at hs + have hd' : Matrix.diagonal (fun i ↦ ((1-l i:ℝ):ℂ))=1-Matrix.diagonal (fun i ↦ (l i:ℂ)) := by + ext i j + by_cases h : i=j <;> simp [h] + rw [hd',Matrix.mul_sub,Matrix.sub_mul,Matrix.mul_one] + have hu : U.val*U.valᴴ=1 := by + change U.val*star U.val=1 + exact Unitary.mul_star_self_of_mem U.prop + rw [hu] + exact congrArg (fun M ↦ 1-M) hs + rw [he] + exact hd.mul_mul_conjTranspose_same _ + +theorem state_measurement_prob_le_trace {A D : Matrix ι ι ℂ} (hA : IsState A) + (hD : D.PosSemidef) : (D*A).trace.re ≤ D.trace.re := by + simpa only [Matrix.mul_one] using trace_product_mono hD hA.le_one + +end GAD + +end + +end OAI diff --git a/lean/OAI/InformationTheory/AmplitudeDamping/CapacityAchievability.lean b/lean/OAI/InformationTheory/AmplitudeDamping/CapacityAchievability.lean new file mode 100644 index 0000000000000000000000000000000000000000..e5ee0b4b4f72aea5e7422b6c6fbc1dbb16103f51 --- /dev/null +++ b/lean/OAI/InformationTheory/AmplitudeDamping/CapacityAchievability.lean @@ -0,0 +1,48 @@ +import OAI.InformationTheory.AmplitudeDamping.CodingAsymptotics + +namespace OAI + +noncomputable section +open scoped BigOperators ComplexOrder MatrixOrder +open Matrix Filter +namespace GAD + +/-- Direct operational coding for the phase pair; conditional and global typical subspaces +and a sequential collective POVM, rather than an assumed coding theorem. -/ +theorem phase_rate_achievable (γ ν : ℝ) (hγ : γ ∈ Set.Icc (0:ℝ) 1) + (hν : ν ∈ Set.Icc (0:ℝ) 1) {p : ℝ} (hp : p ∈ Set.Icc (0:ℝ) 1) + {r : ℝ} (hr : 0 ≤ r) (hrχ : r < objective γ ν p) : + Achievable γ ν (r/Real.log 2) := by + classical + obtain ⟨q,U,hq,hs,hphase,hent⟩ := phase_spectral γ ν hγ hν hp + let δ := (objective γ ν p-r)/4 + let K := 9*logVariance (meanPhaseWeights γ ν p)+8*logVariance q + have hδ : 0 < δ := by dsimp [δ]; linarith + have hb : 0 < objective γ ν p-2*δ-r := by dsimp [δ]; linarith + have hex (n : ℕ) : ∃ C : Code n, 0 < n → + C.messages=codingMessages r n ∧ averageError γ ν C ≤ + K/((n:ℝ)*δ^2)+4*(codingMessages r n:ℝ)*Real.exp (-(n:ℝ)*(objective γ ν p-2*δ)) := by + by_cases hn : 0 < n + · obtain ⟨C,hC,he⟩ := exists_phase_code γ ν hγ hν hp q U hq hs hphase hent hδ hn + (codingMessages r n) (codingMessages_pos r n) + exact ⟨C,fun _ ↦ ⟨hC,he⟩⟩ + · exact ⟨trivialCode n,fun hn' ↦ (hn hn').elim⟩ + choose C hC using hex + refine ⟨C,?_,?_⟩ + · apply squeeze_zero' (Filter.Eventually.of_forall (fun n ↦ averageError_nonneg γ ν hγ hν (C n))) + · filter_upwards [eventually_ge_atTop 1] with n hn + have hn0 : 0 < n := by omega + exact ((hC n hn0).2).trans (add_le_add le_rfl + (coding_cross_bound hr (objective γ ν p-2*δ) n)) + · exact coding_error_tendsto K δ hb + · intro ε hε + filter_upwards [eventually_ge_atTop 1] with n hn + have hn0 : 0 < n := by omega + rw [(hC n hn0).1] + exact (sub_le_self _ hε.le).trans (codingMessages_rate r hn0) + +end GAD + +end + +end OAI diff --git a/lean/OAI/InformationTheory/AmplitudeDamping/CapacityConverse.lean b/lean/OAI/InformationTheory/AmplitudeDamping/CapacityConverse.lean new file mode 100644 index 0000000000000000000000000000000000000000..1e1b5c6bc43086fb578735731f86b1afdfe795b3 --- /dev/null +++ b/lean/OAI/InformationTheory/AmplitudeDamping/CapacityConverse.lean @@ -0,0 +1,143 @@ +import OAI.InformationTheory.AmplitudeDamping.Holevo + +namespace OAI + +noncomputable section + +section +open scoped BigOperators ComplexOrder MatrixOrder +open Matrix Filter +namespace GAD + +def codeEnsemble {n : ℕ} (C : Code n) : Ensemble n where + size := C.messages + weight := fun _ ↦ (C.messages:ℝ)⁻¹ + weight_nonneg := fun _ ↦ by positivity + weight_sum := by + simp only [Finset.sum_const,Finset.card_univ,Fintype.card_fin,nsmul_eq_mul] + exact mul_inv_cancel₀ (by exact_mod_cast C.messages_pos.ne') + signal := C.encoding + signal_state := C.encoding_state + +theorem code_success_dim_bound (γ ν : ℝ) (hγ : γ ∈ Set.Icc (0:ℝ) 1) + (hν : ν ∈ Set.Icc (0:ℝ) 1) {n : ℕ} (C : Code n) : + (∑ m, (C.decoding m*channel γ ν n (C.encoding m)).trace.re) ≤ (2:ℝ)^n := by + calc + _ ≤ ∑ m, (C.decoding m).trace.re := Finset.sum_le_sum (fun m _ ↦ + state_measurement_prob_le_trace (channel_state γ ν hγ hν n (C.encoding_state m)) (C.decoding_pos m)) + _ = _ := by + rw [← Complex.re_sum,← Matrix.trace_sum,C.decoding_sum,Matrix.trace_one] + rw [basis_card,Nat.cast_pow,Nat.cast_ofNat] + rw [← Complex.ofReal_ofNat,← Complex.ofReal_pow,Complex.ofReal_re] + +theorem code_messages_bound (γ ν : ℝ) (hγ : γ ∈ Set.Icc (0:ℝ) 1) + (hν : ν ∈ Set.Icc (0:ℝ) 1) {n : ℕ} (C : Code n) + (he : averageError γ ν C ≤ 1/2) : (C.messages:ℝ) ≤ 2*(2:ℝ)^n := by + have hM : 0 < (C.messages:ℝ) := by exact_mod_cast C.messages_pos + have hs := code_success_dim_bound γ ν hγ hν C + dsimp [averageError] at he + have ht : (1/2:ℝ)*(C.messages:ℝ) ≤ ∑ m, (C.decoding m*channel γ ν n (C.encoding m)).trace.re := by + apply (le_div_iff₀ hM).mp + linarith + linarith + +theorem code_entropy_bound (γ ν : ℝ) (hγ : γ ∈ Set.Icc (0:ℝ) 1) + (hν : ν ∈ Set.Icc (0:ℝ) 1) {n : ℕ} (C : Code n) {p : ℝ} (hp : Maximizes γ ν p) + {ε : ℝ} (hε : 0 < ε) : + Real.log (C.messages:ℝ) ≤ (n:ℝ)*objective γ ν p+ + 2*factorError ε (2*averageError γ ν C) (2^n*C.messages) := by + let : Nonempty (Fin C.messages) := Fin.pos_iff_nonempty.mp C.messages_pos + have h := cq_decoding_entropy_bound (fun m ↦ channel γ ν n (C.encoding m)) C.decoding + (fun m ↦ channel_state γ ν hγ hν n (C.encoding_state m)) C.decoding_pos C.decoding_sum hε + have hw (m : Fin C.messages) : uniformWeight (Fin C.messages) m=(C.messages:ℝ)⁻¹ := by + simp only [uniformWeight,Fintype.card_fin] + have he : 1-∑ m, uniformWeight (Fin C.messages) m*(C.decoding m*channel γ ν n (C.encoding m)).trace.re = + averageError γ ν C := by + simp only [hw,← Finset.mul_sum,averageError,div_eq_mul_inv] + ring + rw [he,Fintype.card_prod,basis_card,Fintype.card_fin] at h + have hu := ensemble_nats_upper γ ν hγ hν (codeEnsemble C) hp + change entropy (∑ a, (((C.messages:ℝ)⁻¹:ℝ):ℂ) • channel γ ν n (C.encoding a)) - + (∑ a, (C.messages:ℝ)⁻¹*entropy (channel γ ν n (C.encoding a))) ≤ (n:ℝ)*objective γ ν p at hu + simp only [Complex.coe_smul] at hu + simp only [hw] at h + linarith + +theorem code_log_dimension_bound (γ ν : ℝ) (hγ : γ ∈ Set.Icc (0:ℝ) 1) + (hν : ν ∈ Set.Icc (0:ℝ) 1) {n : ℕ} (hn : 0 < n) (C : Code n) + (he : averageError γ ν C ≤ 1/2) : + Real.log (2^n*C.messages:ℕ) ≤ 3*(n:ℝ)*Real.log 2 := by + have hM : 0 < (C.messages:ℝ) := by exact_mod_cast C.messages_pos + have hpow : 0 < (2:ℝ)^n := by positivity + have hb := code_messages_bound γ ν hγ hν C he + have hl := Real.log_le_log hM hb + rw [Real.log_mul (by norm_num : (2:ℝ) ≠ 0) hpow.ne',Real.log_pow] at hl + rw [Nat.cast_mul,Nat.cast_pow,Nat.cast_ofNat,Real.log_mul hpow.ne' hM.ne',Real.log_pow] + have hn' : (1:ℝ) ≤ n := by exact_mod_cast hn + have hlog : 0 ≤ Real.log 2 := Real.log_nonneg (by norm_num) + nlinarith + +theorem code_log_rate_bound (γ ν : ℝ) (hγ : γ ∈ Set.Icc (0:ℝ) 1) + (hν : ν ∈ Set.Icc (0:ℝ) 1) {n : ℕ} (hn : 0 < n) (C : Code n) {p : ℝ} (hp : Maximizes γ ν p) + {ε : ℝ} (hε : 0 < ε) (he : averageError γ ν C ≤ 1/2) + (heε : averageError γ ν C ≤ 2*ε^2) : + Real.log (C.messages:ℝ) ≤ (n:ℝ)*objective γ ν p+ + 12*ε*(n:ℝ)*Real.log 2+(2+4*ε)*Real.log 2 := by + have h := code_entropy_bound γ ν hγ hν C hp hε + have hd : 0 < 2^n*C.messages := Nat.mul_pos (pow_pos (by norm_num) n) C.messages_pos + have hb := factorError_mono hε hd (show 2*averageError γ ν C ≤ 4*ε^2 by nlinarith) + have hlog := code_log_dimension_bound γ ν hγ hν hn C he + have ht : factorError ε (4*ε^2) (2^n*C.messages)= + 2*ε*Real.log (2^n*C.messages:ℕ)+(1+2*ε)*Real.log 2 := by + dsimp [factorError] + field_simp + ring + rw [ht] at hb + have hh := mul_le_mul_of_nonneg_left hlog (show 0 ≤ 2*ε by positivity) + nlinarith + +end GAD + +end + +open scoped BigOperators ComplexOrder MatrixOrder +open Matrix Filter +namespace GAD + +theorem achievable_upper (γ ν : ℝ) (hγ : γ ∈ Set.Icc (0:ℝ) 1) + (hν : ν ∈ Set.Icc (0:ℝ) 1) {p R : ℝ} (hp : Maximizes γ ν p) + (hR : Achievable γ ν R) : R ≤ objective γ ν p/Real.log 2 := by + obtain ⟨C,herr,hrate⟩ := hR + by_contra! hbad + let χ := objective γ ν p/Real.log 2 + let ε := (R-χ)/28 + have hε : 0 < ε := by dsimp [ε,χ]; linarith + have hl : 0 < Real.log 2 := Real.log_pos (by norm_num) + have he1 : ∀ᶠ n : ℕ in atTop, averageError γ ν (C n) < 1/2 := + herr.eventually (gt_mem_nhds (by norm_num : (0:ℝ) < 1/2)) + have he2 : ∀ᶠ n : ℕ in atTop, averageError γ ν (C n) < 2*ε^2 := + herr.eventually (gt_mem_nhds (by positivity : (0:ℝ) < 2*ε^2)) + obtain ⟨N,hN⟩ := exists_nat_gt ((2+4*ε)/ε) + obtain ⟨n,hnR,hn1,hn2,hn⟩ := ((hrate ε hε).and (he1.and + (he2.and (eventually_ge_atTop (max N 1))))).exists + have hn0 : 0 < n := by omega + have hnR0 : 0 < (n:ℝ) := by exact_mod_cast hn0 + have hNn : (N:ℝ) ≤ (n:ℝ) := by exact_mod_cast (le_trans (le_max_left N 1) hn) + have hsmall : 2+4*ε ≤ ε*(n:ℝ) := by + have hh := (div_lt_iff₀ hε).mp hN + nlinarith + have hupper := code_log_rate_bound γ ν hγ hν hn0 (C n) hp hε hn1.le hn2.le + have hlower := (le_div_iff₀ hl).mp ((le_div_iff₀ hnR0).mp hnR) + have hχ : χ*Real.log 2=objective γ ν p := div_mul_cancel₀ _ hl.ne' + have hχn : (n:ℝ)*objective γ ν p=χ*(n:ℝ)*Real.log 2 := by rw [← hχ]; ring + rw [hχn] at hupper + have hsmall' := mul_le_mul_of_nonneg_right hsmall hl.le + have hf : (R-χ-14*ε)*((n:ℝ)*Real.log 2) ≤ 0 := by nlinarith + have hg : 0 < R-χ-14*ε := by dsimp [ε]; change χ < R at hbad; linarith + exact (not_le_of_gt (mul_pos hg (mul_pos hnR0 hl))) hf + +end GAD + +end + +end OAI diff --git a/lean/OAI/InformationTheory/AmplitudeDamping/Channel.lean b/lean/OAI/InformationTheory/AmplitudeDamping/Channel.lean new file mode 100644 index 0000000000000000000000000000000000000000..1460a8467da7f7b92385e5a76caa2a878c7607e8 --- /dev/null +++ b/lean/OAI/InformationTheory/AmplitudeDamping/Channel.lean @@ -0,0 +1,165 @@ +import OAI.InformationTheory.AmplitudeDamping.SequentialProjections + +namespace OAI + +noncomputable section + +universe u_1 u_2 u_3 u_4 u_5 u_6 u_7 u_8 u_9 u_10 u_11 u_12 u_13 u_14 u_15 u_16 u_17 u_18 u_19 u_20 u_21 u_22 u_23 + +section +open scoped BigOperators ComplexOrder MatrixOrder +open Matrix +namespace GAD + +@[simp] theorem kraus_zero (γ ν : ℝ) : kraus γ ν 0 = !![(Real.sqrt (1 - ν) : ℂ), 0; 0, (Real.sqrt (1 - ν) * Real.sqrt (1 - γ) : ℂ)] := by + norm_num [kraus] + +@[simp] theorem kraus_one (γ ν : ℝ) : kraus γ ν 1 = !![0, (Real.sqrt (γ * (1 - ν)) : ℂ); 0, 0] := by + norm_num [kraus] + +@[simp] theorem kraus_two (γ ν : ℝ) : kraus γ ν 2 = !![(Real.sqrt ν * Real.sqrt (1 - γ) : ℂ), 0; 0, (Real.sqrt ν : ℂ)] := by + simp only [kraus, show (2 : Fin 4) ≠ 0 by decide, show (2 : Fin 4) ≠ 1 by decide, ite_false, ite_true] + +@[simp] theorem kraus_three (γ ν : ℝ) : kraus γ ν 3 = !![0, 0; (Real.sqrt (γ * ν) : ℂ), 0] := by + simp only [kraus, show (3 : Fin 4) ≠ 0 by decide, show (3 : Fin 4) ≠ 1 by decide, show (3 : Fin 4) ≠ 2 by decide, ite_false] + +theorem sum_fin_cons {α : Type u_1} {M : Type u_2} [Fintype α] [AddCommMonoid M] {n : ℕ} + (f : (Fin (n+1) → α) → M) : + ∑ r, f r = ∑ a, ∑ r : Fin n → α, f (Fin.cons a r) := by + rw [← (Fin.consEquiv (fun _ : Fin (n+1) ↦ α)).sum_comp f] + rw [Fintype.sum_prod_type] + rfl + +def pure {ι : Type u_3} (ψ : ι → ℂ) : Matrix ι ι ℂ := fun i j ↦ ψ i * star (ψ j) + +def applyKraus {ι : Type u_4} {κ : Type u_5} {ρ : Type u_6} [Fintype κ] [Fintype ρ] + (L : ρ → Matrix ι κ ℂ) (P : Matrix κ κ ℂ) : Matrix ι ι ℂ := + ∑ r, L r * P * (L r).conjTranspose + +theorem local_channel (γ ν : ℝ) (hγ : γ ∈ Set.Icc (0:ℝ) 1) + (hν : ν ∈ Set.Icc (0:ℝ) 1) (P : Matrix (Fin 2) (Fin 2) ℂ) : + applyKraus (kraus γ ν) P = + !![((1-γ*ν:ℝ):ℂ)*P 0 0+((γ*(1-ν):ℝ):ℂ)*P 1 1, + (Real.sqrt (1-γ):ℂ)*P 0 1; + (Real.sqrt (1-γ):ℂ)*P 1 0, + ((γ*ν:ℝ):ℂ)*P 0 0+((1-γ*(1-ν):ℝ):ℂ)*P 1 1] := by + have hγ0 : 0 ≤ 1-γ := sub_nonneg.mpr hγ.2 + have hν0 : 0 ≤ 1-ν := sub_nonneg.mpr hν.2 + have hs (x : ℝ) (hx : 0 ≤ x) : (Real.sqrt x : ℂ)^2 = (x:ℂ) := by + norm_cast; exact Real.sq_sqrt hx + have hsν := hs ν hν.1 + have hsγν := hs (ν*γ) (mul_nonneg hν.1 hγ.1) + have hsγν' := hs (-(ν*γ)+γ) (by nlinarith only [mul_nonneg hγ.1 hν0]) + simp only [applyKraus, Fin.sum_univ_four, kraus_zero, kraus_one, kraus_two, kraus_three] + ext i j + fin_cases i <;> fin_cases j <;> + simp [Matrix.mul_apply, Matrix.vecMul, dotProduct, Matrix.conjTranspose_apply, Fin.sum_univ_two] <;> + ring_nf <;> + simp only [hsν, hsγν, hsγν', hs (1-ν) hν0, hs (1-γ) hγ0] <;> + push_cast <;> ring + +theorem kraus_complete (γ ν : ℝ) (hγ : γ ∈ Set.Icc (0:ℝ) 1) + (hν : ν ∈ Set.Icc (0:ℝ) 1) : + ∑ r, (kraus γ ν r).conjTranspose * kraus γ ν r = 1 := by + have hγ0 : 0 ≤ 1-γ := sub_nonneg.mpr hγ.2 + have hν0 : 0 ≤ 1-ν := sub_nonneg.mpr hν.2 + have hs (x : ℝ) (hx : 0 ≤ x) : (Real.sqrt x : ℂ)^2 = (x:ℂ) := by + norm_cast; exact Real.sq_sqrt hx + have hsν := hs ν hν.1 + have hsγν := hs (ν*γ) (mul_nonneg hν.1 hγ.1) + have hsγν' := hs (-(ν*γ)+γ) (by nlinarith only [mul_nonneg hγ.1 hν0]) + simp only [Fin.sum_univ_four, kraus_zero, kraus_one, kraus_two, kraus_three] + ext i j + fin_cases i <;> fin_cases j <;> + simp [Matrix.mul_apply, Matrix.conjTranspose_apply, Fin.sum_univ_two] <;> + ring_nf <;> + simp only [hsν, hsγν, hsγν', hs (1-ν) hν0, hs (1-γ) hγ0] <;> + push_cast <;> ring + +end GAD + +end + +open scoped BigOperators ComplexOrder MatrixOrder +open Matrix +namespace GAD + +theorem tensorKraus_complete (γ ν : ℝ) (hγ : γ ∈ Set.Icc (0:ℝ) 1) + (hν : ν ∈ Set.Icc (0:ℝ) 1) (n : ℕ) : + ∑ r, (tensorKraus γ ν n r).conjTranspose * tensorKraus γ ν n r = 1 := by + ext i j + simp only [Matrix.sum_apply, Matrix.mul_apply, Matrix.conjTranspose_apply, tensorKraus, + star_prod] + simp only [← Finset.prod_mul_distrib] + have hinner (r : Fin n → Fin 4) : + (∑ b : Basis n, ∏ k, star (kraus γ ν (r k) (b k) (i k)) * kraus γ ν (r k) (b k) (j k)) = + ∏ k, ∑ b : Fin 2, star (kraus γ ν (r k) b (i k)) * kraus γ ν (r k) b (j k) := + (Fintype.prod_sum (fun k b ↦ star (kraus γ ν (r k) b (i k)) * kraus γ ν (r k) b (j k))).symm + simp only [hinner] + rw [← Fintype.prod_sum (fun k r ↦ ∑ b : Fin 2, + star (kraus γ ν r b (i k)) * kraus γ ν r b (j k))] + have hc (k : Fin n) : + (∑ r : Fin 4, ∑ b : Fin 2, star (kraus γ ν r b (i k)) * kraus γ ν r b (j k)) = + if i k = j k then 1 else 0 := by + have h := congrArg (fun A : Matrix (Fin 2) (Fin 2) ℂ ↦ A (i k) (j k)) + (kraus_complete γ ν hγ hν) + simpa only [Matrix.sum_apply, Matrix.mul_apply, Matrix.conjTranspose_apply, + Matrix.one_apply] using h + simp_rw [hc] + simp [Fintype.prod_ite_zero, funext_iff, Matrix.one_apply] + +theorem applyKraus_posSemidef {ι : Type u_7} {κ : Type u_8} {ρ : Type u_9} [Fintype ι] [Fintype κ] [Fintype ρ] + [DecidableEq ι] [DecidableEq κ] (L : ρ → Matrix ι κ ℂ) + {P : Matrix κ κ ℂ} (hP : P.PosSemidef) : (applyKraus L P).PosSemidef := by + rw [← Matrix.nonneg_iff_posSemidef] + exact Finset.sum_nonneg (fun r _ ↦ Matrix.nonneg_iff_posSemidef.mpr + (hP.mul_mul_conjTranspose_same (L r))) + +theorem applyKraus_trace {ι : Type u_10} {κ : Type u_11} {ρ : Type u_12} [Fintype ι] [Fintype κ] [Fintype ρ] + [DecidableEq κ] (L : ρ → Matrix ι κ ℂ) + (hL : ∑ r, (L r).conjTranspose * L r = 1) (P : Matrix κ κ ℂ) : + (applyKraus L P).trace = P.trace := by + simp only [applyKraus, Matrix.trace_sum] + calc + _ = ∑ r, ((L r).conjTranspose * L r * P).trace := by + apply Finset.sum_congr rfl + intro r _ + exact Matrix.trace_mul_cycle _ _ _ + _ = _ := by + rw [← Matrix.trace_sum, ← Matrix.sum_mul, hL, Matrix.one_mul] + +theorem channel_trace (γ ν : ℝ) (hγ : γ ∈ Set.Icc (0:ℝ) 1) + (hν : ν ∈ Set.Icc (0:ℝ) 1) (n : ℕ) (P : QMatrix n) : + (channel γ ν n P).trace = P.trace := + applyKraus_trace _ (tensorKraus_complete γ ν hγ hν n) P + +theorem channel_posSemidef (γ ν : ℝ) (n : ℕ) {P : QMatrix n} (hP : P.PosSemidef) : + (channel γ ν n P).PosSemidef := applyKraus_posSemidef _ hP + +theorem mul_pure_mul_conjTranspose {ι : Type u_13} {κ : Type u_14} [Fintype κ] + (L : Matrix ι κ ℂ) (ψ : κ → ℂ) : L * pure ψ * L.conjTranspose = pure (L *ᵥ ψ) := by + change L * Matrix.vecMulVec ψ (star ψ) * L.conjTranspose = + Matrix.vecMulVec (L *ᵥ ψ) (star (L *ᵥ ψ)) + rw [Matrix.mul_vecMulVec, Matrix.vecMulVec_mul, ← Matrix.star_mulVec] + +def columns {ι : Type u_15} {κ : Type u_16} {ρ : Type u_17} [Fintype κ] (L : ρ → Matrix ι κ ℂ) (ψ : κ → ℂ) : + Matrix ι ρ ℂ := fun i r ↦ (L r *ᵥ ψ) i + +theorem columns_mul_conjTranspose {ι : Type u_18} {κ : Type u_19} {ρ : Type u_20} [Fintype κ] [Fintype ρ] + (L : ρ → Matrix ι κ ℂ) (ψ φ : κ → ℂ) : + columns L ψ * (columns L φ).conjTranspose = + ∑ r, L r * Matrix.vecMulVec ψ (star φ) * (L r).conjTranspose := by + simp_rw [Matrix.mul_vecMulVec, Matrix.vecMulVec_mul, ← Matrix.star_mulVec] + ext i j + simp [columns, Matrix.mul_apply, Matrix.vecMulVec, Matrix.conjTranspose_apply, Matrix.sum_apply] + +theorem columns_pure {ι : Type u_21} {κ : Type u_22} {ρ : Type u_23} [Fintype κ] [Fintype ρ] + (L : ρ → Matrix ι κ ℂ) (ψ : κ → ℂ) : + columns L ψ * (columns L ψ).conjTranspose = applyKraus L (pure ψ) := + columns_mul_conjTranspose L ψ ψ + +end GAD + +end + +end OAI diff --git a/lean/OAI/InformationTheory/AmplitudeDamping/CodingAsymptotics.lean b/lean/OAI/InformationTheory/AmplitudeDamping/CodingAsymptotics.lean new file mode 100644 index 0000000000000000000000000000000000000000..a888b37fd36d8db7cf5bd191c24f4ac96281d5cc --- /dev/null +++ b/lean/OAI/InformationTheory/AmplitudeDamping/CodingAsymptotics.lean @@ -0,0 +1,116 @@ +import OAI.InformationTheory.AmplitudeDamping.PhaseCoding + +namespace OAI + +noncomputable section + +section +open scoped BigOperators ComplexOrder MatrixOrder +open Matrix Filter +namespace GAD + +theorem averageError_nonneg (γ ν : ℝ) (hγ : γ ∈ Set.Icc (0:ℝ) 1) + (hν : ν ∈ Set.Icc (0:ℝ) 1) {n : ℕ} (C : Code n) : + 0 ≤ averageError γ ν C := by + have hM : 0 < (C.messages:ℝ) := by exact_mod_cast C.messages_pos + have hDs (m : Fin C.messages) : (1-C.decoding m).PosSemidef := by + rw [← C.decoding_sum] + have hle : C.decoding m ≤ ∑ j, C.decoding j := Finset.single_le_sum + (fun j _ ↦ Matrix.nonneg_iff_posSemidef.mpr (C.decoding_pos j)) (Finset.mem_univ m) + exact Matrix.nonneg_iff_posSemidef.mp (sub_nonneg.mpr hle) + have hprob (m : Fin C.messages) : (C.decoding m*channel γ ν n (C.encoding m)).trace.re ≤ 1 := by + have hA := channel_state γ ν hγ hν n (C.encoding_state m) + have h := trace_product_mono hA.1 (hDs m) + simpa only [Matrix.mul_one,Matrix.trace_mul_comm _ (C.decoding m),hA.2,Complex.one_re] using h + have hs := Finset.sum_le_sum (s := Finset.univ) (fun m _ ↦ hprob m) + simp only [Finset.sum_const,Finset.card_univ,Fintype.card_fin,nsmul_eq_mul,mul_one] at hs + dsimp [averageError] + exact sub_nonneg.mpr ((div_le_one hM).mpr hs) + +def trivialCode (n : ℕ) : Code n where + messages := 1 + messages_pos := by norm_num + encoding := fun _ ↦ phaseState 0 (fun _ ↦ 0) + encoding_state := fun _ ↦ phaseState_state (by norm_num) _ + decoding := fun _ ↦ 1 + decoding_pos := fun _ ↦ Matrix.PosSemidef.one + decoding_sum := by simp + +theorem trivialCode_error (γ ν : ℝ) (hγ : γ ∈ Set.Icc (0:ℝ) 1) + (hν : ν ∈ Set.Icc (0:ℝ) 1) (n : ℕ) : averageError γ ν (trivialCode n)=0 := by + have h := channel_state γ ν hγ hν n (phaseState_state (n := n) (p := 0) (by norm_num) (fun _ ↦ 0)) + dsimp only [averageError,trivialCode] + simp only [Matrix.one_mul,Fin.sum_univ_one,Nat.cast_one,div_one] + rw [h.2,Complex.one_re,sub_self] + +theorem zero_achievable (γ ν : ℝ) (hγ : γ ∈ Set.Icc (0:ℝ) 1) + (hν : ν ∈ Set.Icc (0:ℝ) 1) : Achievable γ ν 0 := by + refine ⟨trivialCode,?_,?_⟩ + · simpa only [trivialCode_error γ ν hγ hν] using + (tendsto_const_nhds : Tendsto (fun _ : ℕ ↦ (0:ℝ)) atTop (nhds 0)) + · intro ε hε + apply Filter.Eventually.of_forall + intro n + simp only [trivialCode,Nat.cast_one,Real.log_one,zero_div,zero_sub] + linarith + +end GAD + +end + +open Filter +namespace GAD + +def codingMessages (r : ℝ) (n : ℕ) : ℕ := ⌈Real.exp ((n:ℝ)*r)⌉₊ + +theorem codingMessages_pos (r : ℝ) (n : ℕ) : 0 < codingMessages r n := + Nat.ceil_pos.mpr (Real.exp_pos _) + +theorem codingMessages_bound {r : ℝ} (hr : 0 ≤ r) (n : ℕ) : + (codingMessages r n:ℝ) ≤ 2*Real.exp ((n:ℝ)*r) := by + have h1 := Nat.ceil_lt_add_one (Real.exp_pos ((n:ℝ)*r)).le + have h2 : 1 ≤ Real.exp ((n:ℝ)*r) := Real.one_le_exp_iff.mpr (mul_nonneg (Nat.cast_nonneg _) hr) + dsimp only [codingMessages] + linarith + +theorem codingMessages_rate (r : ℝ) {n : ℕ} (hn : 0 < n) : + r/Real.log 2 ≤ Real.log (codingMessages r n:ℝ)/Real.log 2/(n:ℝ) := by + have h : (n:ℝ)*r ≤ Real.log (codingMessages r n:ℝ) := by + have hh := Real.log_le_log (Real.exp_pos ((n:ℝ)*r)) (Nat.le_ceil (Real.exp ((n:ℝ)*r))) + simpa only [Real.log_exp,codingMessages] using hh + have hn' : 0 < (n:ℝ) := by exact_mod_cast hn + have hl : 0 < Real.log 2 := Real.log_pos (by norm_num) + have hh := div_le_div_of_nonneg_right (div_le_div_of_nonneg_right h hl.le) hn'.le + have he : (n:ℝ)*r/Real.log 2/(n:ℝ)=r/Real.log 2 := by + field_simp + rw [he] at hh + exact hh + +theorem coding_cross_bound {r : ℝ} (hr : 0 ≤ r) (a : ℝ) (n : ℕ) : + 4*(codingMessages r n:ℝ)*Real.exp (-(n:ℝ)*a) ≤ + 8*Real.exp (-(n:ℝ)*(a-r)) := by + have h := mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left + (codingMessages_bound hr n) (by norm_num : (0:ℝ) ≤ 4)) (Real.exp_pos (-(n:ℝ)*a)).le + apply h.trans_eq + rw [show 4*(2*Real.exp ((n:ℝ)*r))*Real.exp (-(n:ℝ)*a)= + 8*(Real.exp ((n:ℝ)*r)*Real.exp (-(n:ℝ)*a)) by ring,← Real.exp_add] + congr 2 + ring + +theorem coding_error_tendsto (K δ : ℝ) {b : ℝ} (hb : 0 < b) : + Tendsto (fun n : ℕ ↦ K/((n:ℝ)*δ^2)+8*Real.exp (-(n:ℝ)*b)) atTop (nhds 0) := by + have h1 : Tendsto (fun n : ℕ ↦ K/((n:ℝ)*δ^2)) atTop (nhds 0) := by + have h := (tendsto_const_div_atTop_nhds_zero_nat K).div_const (δ^2) + simpa only [div_div,zero_div] using h + have h2 : Tendsto (fun n : ℕ ↦ 8*Real.exp (-(n:ℝ)*b)) atTop (nhds 0) := by + have he := tendsto_pow_atTop_nhds_zero_of_lt_one (Real.exp_pos (-b)).le + (Real.exp_lt_one_iff.mpr (neg_neg_of_pos hb)) + have h := he.const_mul (8:ℝ) + simpa only [mul_zero,← Real.exp_nat_mul,mul_neg,neg_mul] using h + simpa only [zero_add] using h1.add h2 + +end GAD + +end + +end OAI diff --git a/lean/OAI/InformationTheory/AmplitudeDamping/EnsembleBounds.lean b/lean/OAI/InformationTheory/AmplitudeDamping/EnsembleBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..bc2fbb75121bdb6f852a67e0d0f6c24d1f57f0a6 --- /dev/null +++ b/lean/OAI/InformationTheory/AmplitudeDamping/EnsembleBounds.lean @@ -0,0 +1,161 @@ +import OAI.InformationTheory.AmplitudeDamping.OutputEntropy + +namespace OAI + +noncomputable section + +section +open scoped BigOperators +namespace GAD + +/-- Binary Shannon entropy is concave, including the endpoints. -/ +theorem concaveOn_binEntropy : ConcaveOn ℝ (Set.Icc (0:ℝ) 1) Real.binEntropy := by + refine ⟨convex_Icc _ _, ?_⟩ + intro p hp q hq a b ha hb hab + have h₀ := Real.concaveOn_negMulLog.2 hp.1 hq.1 ha hb hab + have h₁ := Real.concaveOn_negMulLog.2 (sub_nonneg.mpr hp.2) (sub_nonneg.mpr hq.2) ha hb hab + have heq : 1-(a*p+b*q)=a*(1-p)+b*(1-q) := by nlinarith only [hab] + simp only [Real.binEntropy_eq_negMulLog_add_negMulLog_one_sub,smul_eq_mul,heq] at * + linarith + +theorem weighted_conditional_eq (a b : ℝ) (ha : 0 ≤ a) (hb : 0 ≤ b) : + (a+b)*(b/(a+b))=b := by + by_cases h : a+b=0 + · have : b=0 := by linarith + simp [this] + · exact mul_div_cancel₀ _ h + +theorem conditional_mem (a b : ℝ) (ha : 0 ≤ a) (hb : 0 ≤ b) : + b/(a+b) ∈ Set.Icc (0:ℝ) 1 := by + refine ⟨div_nonneg hb (add_nonneg ha hb), ?_⟩ + by_cases h : a+b=0 + · simp [h] + · exact (div_le_one (lt_of_le_of_ne (add_nonneg ha hb) (Ne.symm h))).mpr (by linarith) + +theorem negMulLog_split (a b : ℝ) (ha : 0 ≤ a) (hb : 0 ≤ b) : + Real.negMulLog a+Real.negMulLog b = + Real.negMulLog (a+b)+(a+b)*Real.binEntropy (b/(a+b)) := by + have hb' := weighted_conditional_eq a b ha hb + have ha' : (a+b)*(1-b/(a+b))=a := by nlinarith only [hb'] + have hA := Real.negMulLog_mul (a+b) (1-b/(a+b)) + have hB := Real.negMulLog_mul (a+b) (b/(a+b)) + rw [ha'] at hA + rw [hb'] at hB + rw [Real.binEntropy_eq_negMulLog_add_negMulLog_one_sub] + nlinarith only [hA,hB] + +def distPopulation {n : ℕ} (q : Basis n → ℝ) (j : Fin n) : ℝ := + ∑ i, if i j=1 then q i else 0 + +theorem classical_entropy_le_sum_binary (n : ℕ) (q : Basis n → ℝ) + (hq : ∀ i, 0 ≤ q i) (hs : ∑ i, q i = 1) : + ∑ i, Real.negMulLog (q i) ≤ ∑ j, Real.binEntropy (distPopulation q j) := by + induction n with + | zero => + have hq1 (i : Basis 0) : q i = 1 := by + rw [Fintype.sum_unique] at hs + convert hs using 1 + exact congrArg q (Subsingleton.elim _ _) + simp only [hq1,Real.negMulLog_one,Finset.sum_const_zero,Fintype.sum_empty,le_refl] + | succ n ih => + let t : Basis n → ℝ := fun i ↦ q (Fin.cons 0 i)+q (Fin.cons 1 i) + have ht (i) : 0 ≤ t i := add_nonneg (hq _) (hq _) + have ht1 : ∑ i, t i = 1 := by + rw [sum_fin_cons] at hs + simpa only [Fin.sum_univ_two,← Finset.sum_add_distrib,t] using hs + have hsplit : (∑ i, Real.negMulLog (q i)) = + (∑ i, Real.negMulLog (t i)) + + ∑ i, t i*Real.binEntropy (q (Fin.cons 1 i)/t i) := by + rw [sum_fin_cons,Fin.sum_univ_two,← Finset.sum_add_distrib] + simp only [negMulLog_split _ _ (hq _) (hq _),Finset.sum_add_distrib,t] + have hmean : (∑ i, t i*(q (Fin.cons 1 i)/t i)) = distPopulation q 0 := by + simp only [t,weighted_conditional_eq _ _ (hq _) (hq _)] + unfold distPopulation + rw [sum_fin_cons] + simp + have hJ : (∑ i, t i*Real.binEntropy (q (Fin.cons 1 i)/t i)) ≤ + Real.binEntropy (distPopulation q 0) := by + rw [← hmean] + exact concaveOn_binEntropy.le_map_sum (fun i _ ↦ ht i) ht1 + (fun i _ ↦ conditional_mem _ _ (hq _) (hq _)) + have hpop (j : Fin n) : distPopulation t j = distPopulation q j.succ := by + unfold distPopulation + rw [sum_fin_cons] + simp [Fin.sum_univ_two,t,← Finset.sum_add_distrib,ite_add_ite] + calc + (∑ i, Real.negMulLog (q i)) = _ := hsplit + _ ≤ (∑ j, Real.binEntropy (distPopulation t j))+Real.binEntropy (distPopulation q 0) := + add_le_add (ih t ht ht1) hJ + _ = _ := by simp only [hpop,Fin.sum_univ_succ]; ring + +end GAD + +end + +open scoped BigOperators ComplexOrder MatrixOrder +open Matrix +namespace GAD + +theorem entropy_le_sum_populations {n : ℕ} {P : QMatrix n} (hP : IsState P) : + entropy P ≤ ∑ j, Real.binEntropy (matrixPopulation P j) := by + have hdiag (i : Basis n) : 0 ≤ (P i i).re := (Complex.nonneg_iff.mp hP.1.diag_nonneg).1 + have hs : ∑ i, (P i i).re=1 := by + simpa only [Matrix.trace,Matrix.diag,Complex.re_sum,Complex.one_re] using congrArg Complex.re hP.2 + exact (entropy_le_diagonal hP.1).trans (classical_entropy_le_sum_binary n _ hdiag hs) + +theorem output_entropy_upper (γ ν : ℝ) (hγ : γ ∈ Set.Icc (0:ℝ) 1) + (hν : ν ∈ Set.Icc (0:ℝ) 1) {n : ℕ} {P : QMatrix n} (hP : IsState P) : + entropy (channel γ ν n P) ≤ ∑ j, Real.binEntropy ((1-γ)*matrixPopulation P j+γ*ν) := by + simpa only [channel_population γ ν hγ hν hP] using + entropy_le_sum_populations (channel_state γ ν hγ hν n hP) + +theorem ensemble_nats_upper (γ ν : ℝ) (hγ : γ ∈ Set.Icc (0:ℝ) 1) + (hν : ν ∈ Set.Icc (0:ℝ) 1) {n : ℕ} (E : Ensemble n) {p : ℝ} (hp : Maximizes γ ν p) : + entropy (∑ a, (E.weight a : ℂ) • channel γ ν n (E.signal a)) - + (∑ a, E.weight a * entropy (channel γ ν n (E.signal a))) ≤ + (n : ℝ)*objective γ ν p := by + let P := ∑ a, E.weight a • E.signal a + have hP : IsState P := state_mixture E.weight E.signal E.weight_nonneg E.weight_sum E.signal_state + have hpop (j) : (∑ a, E.weight a*matrixPopulation (E.signal a) j) = matrixPopulation P j := + (matrixPopulation_mixture E.weight E.signal j).symm + have hJ (j) : g (v γ ν (matrixPopulation P j)) ≤ + ∑ a, E.weight a*g (v γ ν (matrixPopulation (E.signal a) j)) := by + rw [← hpop] + exact (convexOn_output_entropy hγ hν).map_sum_le + (fun a _ ↦ E.weight_nonneg a) E.weight_sum + (fun a _ ↦ matrixPopulation_mem (E.signal_state a) j) + have hlow : (∑ j, g (v γ ν (matrixPopulation P j))) ≤ + ∑ a, E.weight a*entropy (channel γ ν n (E.signal a)) := by + calc + _ ≤ ∑ j, ∑ a, E.weight a*g (v γ ν (matrixPopulation (E.signal a) j)) := + Finset.sum_le_sum (fun j _ ↦ hJ j) + _ = ∑ a, E.weight a * ∑ j, g (v γ ν (matrixPopulation (E.signal a) j)) := by + rw [Finset.sum_comm]; simp only [Finset.mul_sum] + _ ≤ _ := Finset.sum_le_sum (fun a _ ↦ mul_le_mul_of_nonneg_left + (mixed_output_entropy_bound γ ν hγ hν n (E.signal_state a)) (E.weight_nonneg a)) + have hu := output_entropy_upper γ ν hγ hν hP + have hv : (∑ j, objective γ ν (matrixPopulation P j)) ≤ (n:ℝ)*objective γ ν p := by + simpa only [Finset.sum_const,Finset.card_univ,Fintype.card_fin,nsmul_eq_mul] using + Finset.sum_le_sum (s := Finset.univ) (fun j _ ↦ hp.2 _ (matrixPopulation_mem hP j)) + have heq : (∑ a, (E.weight a : ℂ) • channel γ ν n (E.signal a)) = channel γ ν n P := by + simp only [Complex.coe_smul, P,channel_mixture] + rw [heq] + simp only [objective,Finset.sum_sub_distrib] at hv + dsimp only [objective] + linarith + +theorem ensembleValue_upper (γ ν : ℝ) (hγ : γ ∈ Set.Icc (0:ℝ) 1) + (hν : ν ∈ Set.Icc (0:ℝ) 1) {n : ℕ} (E : Ensemble n) {p : ℝ} (hp : Maximizes γ ν p) : + ensembleValue γ ν E ≤ (n : ℝ)/Real.log 2 * objective γ ν p := by + unfold ensembleValue + have hlog : 0 < Real.log 2 := Real.log_pos (by norm_num) + have h := div_le_div_of_nonneg_right (ensemble_nats_upper γ ν hγ hν E hp) hlog.le + calc + _ ≤ (n:ℝ)*objective γ ν p / Real.log 2 := h + _ = _ := by ring + +end GAD + +end + +end OAI diff --git a/lean/OAI/InformationTheory/AmplitudeDamping/EntropyContinuity.lean b/lean/OAI/InformationTheory/AmplitudeDamping/EntropyContinuity.lean new file mode 100644 index 0000000000000000000000000000000000000000..50fac38417228bec0fb9e09e30b1228d4c047f2d --- /dev/null +++ b/lean/OAI/InformationTheory/AmplitudeDamping/EntropyContinuity.lean @@ -0,0 +1,333 @@ +import OAI.InformationTheory.AmplitudeDamping.StateEntropy + +namespace OAI + +noncomputable section + +universe u_1 u_2 u_3 u_4 u_5 u_6 u_7 + +namespace GAD + +section +open scoped BigOperators ComplexOrder MatrixOrder InnerProductSpace +open Matrix +variable {ι : Type u_1} {κ : Type u_2} [Fintype ι] [Fintype κ] + +def frobVector (A : Matrix ι κ ℂ) : EuclideanSpace ℂ (ι × κ) := + WithLp.toLp 2 (fun ik ↦ A ik.1 ik.2) + +theorem mass_eq_sum_normSq (A : Matrix ι κ ℂ) : mass A=∑ i, ∑ k, Complex.normSq (A i k) := by + simp [mass,gram,Matrix.trace,Matrix.mul_apply,Complex.mul_conj] + +theorem frobVector_norm (A : Matrix ι κ ℂ) : ‖frobVector A‖^2=mass A := by + rw [EuclideanSpace.norm_sq_eq,mass_eq_sum_normSq] + simp only [Fintype.sum_prod_type,frobVector,PiLp.toLp_apply,Complex.sq_norm] + +omit [Fintype ι] [Fintype κ] in +theorem frobVector_add (A B : Matrix ι κ ℂ) : frobVector (A+B)=frobVector A+frobVector B := rfl +omit [Fintype ι] [Fintype κ] in +theorem frobVector_sub (A B : Matrix ι κ ℂ) : frobVector (A-B)=frobVector A-frobVector B := rfl + +theorem frobVector_inner (A B : Matrix ι κ ℂ) : + ⟪frobVector A,frobVector B⟫_ℝ=(Aᴴ*B).trace.re := by + have hn := norm_add_sq_real (frobVector A) (frobVector B) + rw [← frobVector_add,frobVector_norm,frobVector_norm,frobVector_norm] at hn + have hm : mass (A+B)=mass A+mass B+2*(Aᴴ*B).trace.re := by + rw [mass_eq_sum_normSq,mass_eq_sum_normSq,mass_eq_sum_normSq] + simp only [Matrix.add_apply,Complex.normSq_add,Finset.sum_add_distrib,← Finset.mul_sum] + congr 1 + simp only [Matrix.trace,Matrix.diag,Matrix.mul_apply,Matrix.conjTranspose_apply,Complex.re_sum] + rw [Finset.sum_comm] + congr 1 + apply Finset.sum_congr rfl + intro i _ + apply Finset.sum_congr rfl + intro k _ + simp only [Complex.mul_re,Complex.conj_re,Complex.conj_im,Complex.star_def] + ring + linarith + +variable [DecidableEq ι] + +def IsProjection (P : Matrix ι ι ℂ) : Prop := P.IsHermitian ∧ P*P=P + +omit [DecidableEq ι] in +theorem IsProjection.posSemidef {P : Matrix ι ι ℂ} (hP : IsProjection P) : P.PosSemidef := by + have h := Matrix.posSemidef_self_mul_conjTranspose P + rwa [hP.1.eq,hP.2] at h + +theorem IsProjection.complement {P : Matrix ι ι ℂ} (hP : IsProjection P) : IsProjection (1-P) := by + refine ⟨(Matrix.isHermitian_one).sub hP.1, ?_⟩ + rw [Matrix.sub_mul,Matrix.mul_sub,Matrix.mul_sub,hP.2] + simp + +omit [DecidableEq ι] in +theorem projection_orthogonal {P : Matrix ι ι ℂ} (hP : IsProjection P) (A B : Matrix ι κ ℂ) : + ⟪frobVector (P*A),frobVector (B-P*B)⟫_ℝ=0 := by + rw [frobVector_inner,Matrix.conjTranspose_mul,hP.1.eq,Matrix.mul_sub] + have he : Aᴴ*P*(P*B)=Aᴴ*P*B := by + rw [← Matrix.mul_assoc _ P,Matrix.mul_assoc Aᴴ P P,hP.2] + rw [he,sub_self,Matrix.trace_zero,Complex.zero_re] + +omit [DecidableEq ι] in +theorem projection_mass_decomposition {P : Matrix ι ι ℂ} (hP : IsProjection P) (A : Matrix ι κ ℂ) : + mass (P*A)+mass (A-P*A)=mass A := by + have h := norm_add_sq_real (frobVector (P*A)) (frobVector (A-P*A)) + rw [← frobVector_add,projection_orthogonal hP A A,mul_zero,add_zero] at h + have he : P*A+(A-P*A)=A := by abel + rw [he,frobVector_norm,frobVector_norm,frobVector_norm] at h + linarith + +omit [DecidableEq ι] in +theorem projection_mass_le {P : Matrix ι ι ℂ} (hP : IsProjection P) (A : Matrix ι κ ℂ) : + mass (P*A) ≤ mass A := by + have h := projection_mass_decomposition hP A + linarith [mass_nonneg (A-P*A)] + +end + +section +open scoped BigOperators ComplexOrder MatrixOrder +open Matrix +variable {ι : Type u_3} [Fintype ι] [DecidableEq ι] + +omit [DecidableEq ι] in +theorem shannon_le_log_card [Nonempty ι] (p : ι → ℝ) (hp : ∀ i, 0 ≤ p i) + (hs : ∑ i, p i = 1) : (∑ i, Real.negMulLog (p i)) ≤ Real.log (Fintype.card ι) := by + let d : ℝ := Fintype.card ι + have hd : 0 < d := by dsimp [d]; exact_mod_cast (Fintype.card_pos (α := ι)) + have h := Real.concaveOn_negMulLog.le_map_sum (t := Finset.univ) + (w := fun _ : ι ↦ d⁻¹) (p := p) + (fun _ _ ↦ inv_nonneg.mpr hd.le) + (by simp only [Finset.sum_const,Finset.card_univ,nsmul_eq_mul]; exact mul_inv_cancel₀ hd.ne') + (fun i _ ↦ (show p i ∈ Set.Ici 0 from hp i)) + simp only [smul_eq_mul,← Finset.mul_sum,hs,mul_one,Real.negMulLog,Real.log_inv] at h + have hh := mul_le_mul_of_nonneg_left h hd.le + dsimp only [d] at * + calc + _ = (Fintype.card ι:ℝ) * ((Fintype.card ι:ℝ)⁻¹ * ∑ i, Real.negMulLog (p i)) := by + rw [← mul_assoc,mul_inv_cancel₀ hd.ne',one_mul] + _ ≤ _ := hh + _ = _ := by field_simp + +theorem entropy_le_log_card [Nonempty ι] {A : Matrix ι ι ℂ} (hA : IsState A) : + entropy A ≤ Real.log (Fintype.card ι) := by + rw [entropy_eq_sum hA.1.isHermitian] + exact shannon_le_log_card _ hA.1.eigenvalues_nonneg (spectral_weights_sum hA) + +theorem state_normalize_trace {A : Matrix ι ι ℂ} (hA : A.PosSemidef) {t : ℝ} + (ht : 0 < t) (htr : A.trace=(t:ℂ)) : IsState (t⁻¹ • A) := by + refine ⟨hA.smul (inv_nonneg.mpr ht.le), ?_⟩ + rw [Matrix.trace_smul,htr] + simp [Complex.real_smul,ht.ne'] + +/-- Entropy continuity from a positive common-mixture coupling. -/ +theorem entropy_coupling_bound [Nonempty ι] {A B U V : Matrix ι ι ℂ} + (hA : IsState A) (hB : IsState B) (hU : U.PosSemidef) (hV : V.PosSemidef) + {t : ℝ} (ht : 0 < t) (htrU : U.trace=(t:ℂ)) (htrV : V.trace=(t:ℂ)) + (heq : A+U=B+V) : + entropy A-entropy B ≤ t*Real.log (Fintype.card ι)+(1+t)*Real.binEntropy (t/(1+t)) := by + let a : ℝ := (1+t)⁻¹ + let b : ℝ := t/(1+t) + have ht1 : 0 < 1+t := by positivity + have ha : 0 ≤ a := inv_nonneg.mpr ht1.le + have hb : 0 ≤ b := div_nonneg ht.le ht1.le + have hab : a+b=1 := by dsimp [a,b]; field_simp + have hu := state_normalize_trace hU ht htrU + have hv := state_normalize_trace hV ht htrV + have he : a • A+b • (t⁻¹ • U)=a • B+b • (t⁻¹ • V) := by + have hba : b*t⁻¹=a := by dsimp [a,b]; field_simp + simp only [smul_smul,hba,← smul_add,heq] + have hlo := concaveOn_entropy.2 hA.1 hu.1 ha hb hab + have hup := entropy_mixture_upper (fun s : Fin 2 ↦ if s=0 then a else b) + (fun s : Fin 2 ↦ if s=0 then B else t⁻¹ • V) + (by intro s; split_ifs <;> assumption) + (by intro s; split_ifs <;> assumption) + simp only [Fin.sum_univ_two,ite_true,show (1:Fin 2) ≠ 0 by decide,ite_false] at hup + rw [he] at hlo + have hU0 := entropy_nonneg hu + have hVmax := entropy_le_log_card hv + have hm := mul_le_mul_of_nonneg_left hVmax hb + have hh : Real.negMulLog a+Real.negMulLog b=Real.binEntropy b := by + rw [Real.binEntropy_eq_negMulLog_add_negMulLog_one_sub] + have heab : a=1-b := by linarith + rw [heab]; ring + have htotal : a*(entropy A-entropy B) ≤ b*Real.log (Fintype.card ι)+Real.binEntropy b := by + change a*entropy A+b*entropy (t⁻¹ • U) ≤ _ at hlo + nlinarith [mul_nonneg hb hU0] + have hh' := mul_le_mul_of_nonneg_left htotal ht1.le + dsimp only [a,b] at hh' + have hc : (1+t)*((1+t)⁻¹*(entropy A-entropy B)) = entropy A-entropy B := by + rw [← mul_assoc,mul_inv_cancel₀ ht1.ne',one_mul] + rw [hc,mul_add] at hh' + have hc' : (1+t)*(t/(1+t)*Real.log (Fintype.card ι))=t*Real.log (Fintype.card ι) := by + field_simp + rwa [hc'] at hh' + +end + +open scoped BigOperators ComplexOrder MatrixOrder InnerProductSpace +open Matrix +variable {ι : Type u_4} {κ : Type u_5} [Fintype ι] [Fintype κ] + +theorem mass_real_smul (a : ℝ) (A : Matrix ι κ ℂ) : mass (a • A)=a^2*mass A := by + rw [← frobVector_norm,← frobVector_norm] + have he : frobVector (a • A)=a • frobVector A := rfl + rw [he,norm_smul,Real.norm_eq_abs,mul_pow,sq_abs] + +theorem mass_add (A B : Matrix ι κ ℂ) : + mass (A+B)=mass A+mass B+2*⟪frobVector A,frobVector B⟫_ℝ := by + have h := norm_add_sq_real (frobVector A) (frobVector B) + rw [← frobVector_add,frobVector_norm,frobVector_norm,frobVector_norm] at h + linarith + +theorem mass_sub (A B : Matrix ι κ ℂ) : + mass (A-B)=mass A+mass B-2*⟪frobVector A,frobVector B⟫_ℝ := by + have h := norm_sub_sq_real (frobVector A) (frobVector B) + rw [← frobVector_sub,frobVector_norm,frobVector_norm,frobVector_norm] at h + linarith + +theorem gram_posSemidef (A : Matrix ι κ ℂ) : (gram A).PosSemidef := + Matrix.posSemidef_self_mul_conjTranspose A + +theorem gram_trace (A : Matrix ι κ ℂ) : (gram A).trace=(mass A:ℂ) := by + exact Complex.ext (by rfl) (by simpa using (Complex.nonneg_iff.mp (gram_posSemidef A).trace_nonneg).2.symm) + +variable [DecidableEq ι] + +/-- Quantitative entropy comparison from close normalized Gram factors. -/ +theorem factor_entropy_bound [Nonempty ι] (X Y : Matrix ι κ ℂ) + (hX : mass X=1) (hY : mass Y=1) {ε : ℝ} (hε : 0 < ε) : + entropy (gram X)-entropy (gram Y) ≤ + (mass (X-Y)/(4*ε)+ε)*Real.log (Fintype.card ι)+ + (1+mass (X-Y)/(4*ε)+ε)*Real.log 2 := by + let D := X-Y + let S := X+Y + have hDS : ⟪frobVector D,frobVector S⟫_ℝ=0 := by + dsimp [D,S] + rw [frobVector_sub,frobVector_add,inner_sub_left,inner_add_right,inner_add_right, + real_inner_self_eq_norm_sq,real_inner_self_eq_norm_sq,real_inner_comm (frobVector Y), + frobVector_norm,frobVector_norm,hX,hY] + ring + have hsum : mass D+mass S=4 := by + dsimp [D,S]; rw [mass_add,mass_sub,hX,hY]; ring + have hSle : mass S ≤ 4 := by linarith [mass_nonneg D] + let c : ℝ := (4*ε)⁻¹ + let U : Matrix ι ι ℂ := c • gram (D-ε • S) + let V : Matrix ι ι ℂ := c • gram (D+ε • S) + let t : ℝ := c*(mass D+ε^2*mass S) + have hc : 0 < c := inv_pos.mpr (by positivity) + have htm : 0 < mass D+ε^2*mass S := by + have hd := mass_nonneg D + have hs := mass_nonneg S + have hes : 0 < ε^2 := sq_pos_of_pos hε + by_cases hdz : mass D=0 + · have hspos : 0 < mass S := by linarith + exact add_pos_of_nonneg_of_pos hd (mul_pos hes hspos) + · exact add_pos_of_pos_of_nonneg (lt_of_le_of_ne hd (Ne.symm hdz)) (mul_nonneg hes.le hs) + have ht : 0 < t := mul_pos hc htm + have hin : ⟪frobVector D,frobVector (ε • S)⟫_ℝ=0 := by + change ⟪frobVector D,ε • frobVector S⟫_ℝ=0 + rw [real_inner_smul_right,hDS,mul_zero] + have hmU : mass (D-ε • S)=mass D+ε^2*mass S := by rw [mass_sub,mass_real_smul,hin]; ring + have hmV : mass (D+ε • S)=mass D+ε^2*mass S := by rw [mass_add,mass_real_smul,hin]; ring + have htrU : U.trace=(t:ℂ) := by + dsimp [U,t]; rw [Matrix.trace_smul,gram_trace,hmU]; simp [Complex.real_smul]; ring + have htrV : V.trace=(t:ℂ) := by + dsimp [V,t]; rw [Matrix.trace_smul,gram_trace,hmV]; simp [Complex.real_smul]; ring + have hUV : gram X+U=gram Y+V := by + have hcε : c*(4*ε)=1 := inv_mul_cancel₀ (by positivity) + ext i j + simp only [U,V,D,S,gram,Matrix.mul_apply,Matrix.conjTranspose_apply, + Matrix.sub_apply,Matrix.add_apply,Matrix.smul_apply,star_sub,star_add, + Complex.real_smul,star_mul,Complex.star_def,Complex.conj_ofReal] + rw [Finset.mul_sum,Finset.mul_sum,← Finset.sum_add_distrib,← Finset.sum_add_distrib] + apply Finset.sum_congr rfl + intro k _ + have hcε' : (c:ℂ)*(4*ε)=1 := by exact_mod_cast hcε + linear_combination -(X i k*(starRingEnd ℂ) (X j k)-Y i k*(starRingEnd ℂ) (Y j k))*hcε' + have hA : IsState (gram X) := ⟨gram_posSemidef X, by rw [gram_trace,hX]; norm_num⟩ + have hB : IsState (gram Y) := ⟨gram_posSemidef Y, by rw [gram_trace,hY]; norm_num⟩ + have hb := entropy_coupling_bound hA hB ((gram_posSemidef _).smul hc.le) + ((gram_posSemidef _).smul hc.le) ht htrU htrV hUV + have htle : t ≤ mass (X-Y)/(4*ε)+ε := by + dsimp [t,c,D] + have haux : ε^2*mass S ≤ ε^2*4 := mul_le_mul_of_nonneg_left hSle (sq_nonneg _) + have h := mul_le_mul_of_nonneg_left haux (inv_nonneg.mpr (show 0 ≤ 4*ε by positivity)) + have he : (4*ε)⁻¹*(mass (X-Y)+ε^2*4)=mass (X-Y)/(4*ε)+ε := by field_simp + rw [← he]; nlinarith + have hlog : 0 ≤ Real.log (Fintype.card ι) := Real.log_nonneg (by exact_mod_cast Fintype.card_pos (α := ι)) + have hint : Real.binEntropy (t/(1+t)) ≤ Real.log 2 := Real.binEntropy_le_log_two + calc + _ ≤ t*Real.log (Fintype.card ι)+(1+t)*Real.binEntropy (t/(1+t)) := hb + _ ≤ t*Real.log (Fintype.card ι)+(1+t)*Real.log 2 := + add_le_add le_rfl (mul_le_mul_of_nonneg_left hint (by positivity)) + _ ≤ _ := by + have h1 := mul_le_mul_of_nonneg_right htle hlog + have h2 := mul_le_mul_of_nonneg_right htle (Real.log_nonneg (by norm_num : (1:ℝ) ≤ 2)) + nlinarith + +end GAD + +open scoped BigOperators ComplexOrder MatrixOrder InnerProductSpace +open Matrix +namespace GAD +variable {ι : Type u_6} {κ : Type u_7} [Fintype ι] [Fintype κ] + +theorem mass_eq_zero (A : Matrix ι κ ℂ) : mass A=0 ↔ A=0 := by + rw [← frobVector_norm,sq_eq_zero_iff,norm_eq_zero] + constructor + · intro h; ext i k; exact congrArg (fun v : EuclideanSpace ℂ (ι × κ) ↦ v (i,k)) h + · intro h; subst A; rfl + +theorem projection_inner {P : Matrix ι ι ℂ} (hP : IsProjection P) (X : Matrix ι κ ℂ) : + ⟪frobVector X,frobVector (P*X)⟫_ℝ=mass (P*X) := by + have h := projection_orthogonal hP X X + rw [frobVector_sub,inner_sub_right,real_inner_self_eq_norm_sq, + frobVector_norm,real_inner_comm] at h + linarith + +/-- Normalize a successful projection without losing more than twice its failure mass. -/ +theorem exists_projected_factor {P : Matrix ι ι ℂ} (hP : IsProjection P) + (X B : Matrix ι κ ℂ) (hX : mass X=1) (hB : mass B=1) (hPB : P*B=B) : + ∃ Y : Matrix ι κ ℂ, mass Y=1 ∧ P*Y=Y ∧ mass (X-Y) ≤ 2*(1-mass (P*X)) := by + let p := mass (P*X) + have hp0 : 0 ≤ p := mass_nonneg _ + have hp1 : p ≤ 1 := by simpa only [hX] using projection_mass_le hP X + by_cases hp : p=0 + · refine ⟨B,hB,hPB,?_⟩ + have hz : P*X=0 := (mass_eq_zero _).mp hp + have hi := projection_orthogonal hP B X + rw [hPB,hz,sub_zero,real_inner_comm] at hi + rw [mass_sub,hX,hB,hi] + change 1+1-2*0 ≤ 2*(1-p) + rw [hp]; norm_num + · have hpp : 0 < p := lt_of_le_of_ne hp0 (Ne.symm hp) + have hs : 0 < Real.sqrt p := Real.sqrt_pos.mpr hpp + let a : ℝ := (Real.sqrt p)⁻¹ + refine ⟨a • (P*X), ?_, ?_, ?_⟩ + · rw [mass_real_smul] + change (Real.sqrt p)⁻¹^2*p=1 + rw [inv_pow,Real.sq_sqrt hp0,inv_mul_cancel₀ hp] + · rw [Matrix.mul_smul,← Matrix.mul_assoc,hP.2] + · rw [mass_sub,mass_real_smul,hX] + have he : a^2*mass (P*X)=1 := by + change (Real.sqrt p)⁻¹^2*p=1 + rw [inv_pow,Real.sq_sqrt hp0,inv_mul_cancel₀ hp] + rw [he] + change 1+1-2*⟪frobVector X,a • frobVector (P*X)⟫_ℝ ≤ 2*(1-p) + rw [real_inner_smul_right,projection_inner hP X] + have hsp : p ≤ Real.sqrt p := by nlinarith [Real.sq_sqrt hp0,(Real.sqrt_nonneg p)] + have hprod : a*p=Real.sqrt p := by + dsimp [a] + calc + _ = (Real.sqrt p)⁻¹ * (Real.sqrt p*Real.sqrt p) := by congr 1; nlinarith [Real.sq_sqrt hp0] + _ = _ := by field_simp + change 1+1-2*(a*p) ≤ 2*(1-p) + rw [hprod]; linarith + +end GAD + +end + +end OAI diff --git a/lean/OAI/InformationTheory/AmplitudeDamping/FinitePacking.lean b/lean/OAI/InformationTheory/AmplitudeDamping/FinitePacking.lean new file mode 100644 index 0000000000000000000000000000000000000000..31b5419a9e0b7955bf36e542d46bbf030579d0aa --- /dev/null +++ b/lean/OAI/InformationTheory/AmplitudeDamping/FinitePacking.lean @@ -0,0 +1,186 @@ +import OAI.InformationTheory.AmplitudeDamping.SequentialDecoder + +namespace OAI + +noncomputable section + +universe u_1 u_2 u_3 + +section +open scoped BigOperators +namespace GAD +variable {α : Type u_1} [Fintype α] + +theorem iid_coordinate (q : α → ℝ) (hs : ∑ a, q a=1) (f : α → ℝ) (n : ℕ) (i : Fin n) : + (∑ x : Fin n → α, iidWeight q n x*f (x i))=∑ a, q a*f a := by + induction n with + | zero => exact Fin.elim0 i + | succ n ih => + rw [iid_split_sum] + refine Fin.cases ?_ (fun i ↦ ?_) i + · simp only [Fin.cons_zero,mul_assoc,← Finset.mul_sum,← Finset.sum_mul, + iidWeight_total q hs n,one_mul] + · simp only [Fin.cons_succ,mul_assoc,← Finset.mul_sum,ih,← Finset.sum_mul,hs,one_mul] + +theorem iid_pair (q : α → ℝ) (hs : ∑ a, q a=1) (f : α → α → ℝ) + (n : ℕ) (i j : Fin n) (hij : i ≠ j) : + (∑ x : Fin n → α, iidWeight q n x*f (x i) (x j))=∑ a, ∑ b, q a*q b*f a b := by + induction n with + | zero => exact Fin.elim0 i + | succ n ih => + rw [iid_split_sum] + revert hij + refine Fin.cases ?_ (fun i ↦ ?_) i + · refine Fin.cases ?_ (fun j hij ↦ ?_) j + · intro h; exact (h rfl).elim + · simp only [Fin.cons_zero,Fin.cons_succ,mul_assoc,← Finset.mul_sum, + iid_coordinate q hs] + · refine Fin.cases ?_ (fun j hij ↦ ?_) j + · intro _ + simp only [Fin.cons_zero,Fin.cons_succ,mul_assoc,← Finset.mul_sum] + have he (b : α) := iid_coordinate q hs (fun a ↦ f a b) n i + simp only [he,Finset.mul_sum] + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro a _ + apply Finset.sum_congr rfl + intro b _ + ring + · have hij' : i ≠ j := by intro h; exact hij (congrArg Fin.succ h) + simp only [Fin.cons_succ,mul_assoc,← Finset.mul_sum,ih i j hij', + ← Finset.sum_mul,hs,one_mul] + +/-- A finite average cannot be strictly below every sampled value. -/ +theorem exists_le_weighted_average (q : α → ℝ) (hq : ∀ a, 0 ≤ q a) + (hs : ∑ a, q a=1) (f : α → ℝ) : ∃ a, f a ≤ ∑ b, q b*f b := by + by_contra! h + obtain ⟨a,ha⟩ : ∃ a, 0 < q a := by + by_contra! hz + have hzero : ∀ a, q a=0 := fun a ↦ le_antisymm (hz a) (hq a) + simp only [hzero,Finset.sum_const_zero] at hs + norm_num at hs + have hh : (∑ b, q b*(∑ c, q c*f c)) < ∑ b, q b*f b := by + apply Finset.sum_lt_sum + · intro b _; exact mul_le_mul_of_nonneg_left (h b).le (hq b) + · exact ⟨a,Finset.mem_univ a,mul_lt_mul_of_pos_left (h a) ha⟩ + rw [← Finset.sum_mul,hs,one_mul] at hh + exact lt_irrefl _ hh + +end GAD + +end + +open scoped BigOperators ComplexOrder MatrixOrder +open Matrix +namespace GAD +variable {ι : Type u_2} {α : Type u_3} [Fintype ι] [Fintype α] [DecidableEq ι] + +theorem packing_cross_bound (q : α → ℝ) (hq : ∀ a, 0 ≤ q a) (hs : ∑ a, q a=1) + (A Q : α → Matrix ι ι ℂ) (hQ : ∀ a, IsProjection (Q a)) + (P : Matrix ι ι ℂ) (hP : IsProjection P) {c r : ℝ} (hc : 0 ≤ c) + (hr : ∀ a, (Q a).trace.re ≤ r) + (hp : (c • P-P*(∑ a, q a • A a)*P).PosSemidef) : + (∑ a, ∑ b, q a*q b*(Q b*(P*A a*P)).trace.re) ≤ c*r := by + have hm (b : α) : (∑ a, q a*(Q b*(P*A a*P)).trace.re)= + (Q b*(P*(∑ a, q a • A a)*P)).trace.re := by + simp only [Matrix.mul_sum,Matrix.sum_mul,Matrix.mul_smul,Matrix.smul_mul,Matrix.trace_sum, + Matrix.trace_smul,Complex.re_sum,Complex.real_smul,Complex.mul_re,Complex.ofReal_re, + Complex.ofReal_im,zero_mul,sub_zero] + have hb (b : α) : (∑ a, q a*(Q b*(P*A a*P)).trace.re) ≤ c*r := by + rw [hm] + have h1 := trace_product_mono (hQ b).posSemidef hp + simp only [Matrix.mul_smul,Matrix.trace_smul,Complex.real_smul,Complex.mul_re, + Complex.ofReal_re,Complex.ofReal_im,zero_mul,sub_zero] at h1 + have h2 := trace_product_mono (hQ b).posSemidef hP.complement.posSemidef + simp only [Matrix.mul_one] at h2 + have h3 := mul_le_mul_of_nonneg_left (h2.trans (hr b)) hc + exact h1.trans h3 + calc + _ = ∑ b, q b*(∑ a, q a*(Q b*(P*A a*P)).trace.re) := by + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro b _ + rw [Finset.mul_sum] + apply Finset.sum_congr rfl + intro a _; ring + _ ≤ ∑ b, q b*(c*r) := Finset.sum_le_sum (fun b _ ↦ mul_le_mul_of_nonneg_left (hb b) (hq b)) + _ = _ := by rw [← Finset.sum_mul,hs,one_mul] + +/-- Finite iid quantum packing, using an explicit sequential collective POVM. -/ +theorem exists_packed_measurement (q : α → ℝ) (hq : ∀ a, 0 ≤ q a) (hs : ∑ a, q a=1) + (A Q : α → Matrix ι ι ℂ) (hA : ∀ a, IsState (A a)) (hQ : ∀ a, IsProjection (Q a)) + (P : Matrix ι ι ℂ) (hP : IsProjection P) {a b c r : ℝ} (hc : 0 ≤ c) (hr0 : 0 ≤ r) + (hga : (∑ x, q x*(1-(P*A x).trace.re)) ≤ a) + (hcb : (∑ x, q x*(1-(Q x*A x).trace.re)) ≤ b) + (hr : ∀ x, (Q x).trace.re ≤ r) + (hcp : (c • P-P*(∑ x, q x • A x)*P).PosSemidef) + (M : ℕ) (hM : 0 < M) : + ∃ (x : Fin M → α) (D : Fin M → Matrix ι ι ℂ), + (∀ m, (D m).PosSemidef) ∧ (∑ m, D m=1) ∧ + 1-(∑ m, (D m*A (x m)).trace.re)/(M:ℝ) ≤ 9*a+8*b+4*(M:ℝ)*c*r := by + classical + let ga : α → ℝ := fun x ↦ 1-(P*A x).trace.re + let cb : α → ℝ := fun x ↦ 1-(Q x*A x).trace.re + let cr : α → α → ℝ := fun x y ↦ (Q y*(P*A x*P)).trace.re + let cost : (Fin M → α) → Fin M → ℝ := fun x m ↦ + 9*ga (x m)+8*cb (x m)+4*∑ j : Fin M, if j=m then 0 else cr (x m) (x j) + let B : (Fin M → α) → ℝ := fun x ↦ (∑ m, cost x m)/(M:ℝ) + have hcross := packing_cross_bound q hq hs A Q hQ P hP hc hr hcp + have hcross' (m j : Fin M) : + (∑ x : Fin M → α, iidWeight q M x*(if j=m then 0 else cr (x m) (x j))) ≤ c*r := by + by_cases hj : j=m + · simp only [hj,ite_true,mul_zero,Finset.sum_const_zero] + exact mul_nonneg hc hr0 + · simp only [ite_eq_right hj] + rw [iid_pair q hs cr M m j (Ne.symm hj)] + exact hcross + have hcost (m : Fin M) : (∑ x, iidWeight q M x*cost x m) ≤ 9*a+8*b+4*(M:ℝ)*c*r := by + have h1 := iid_coordinate q hs ga M m + have h2 := iid_coordinate q hs cb M m + have h3 : (∑ x, iidWeight q M x*(∑ j : Fin M, if j=m then 0 else cr (x m) (x j))) ≤ (M:ℝ)*c*r := by + simp only [Finset.mul_sum] + rw [Finset.sum_comm] + calc + _ ≤ ∑ _j : Fin M, c*r := Finset.sum_le_sum (fun j _ ↦ hcross' m j) + _ = _ := by simp only [Finset.sum_const,Finset.card_univ,Fintype.card_fin,nsmul_eq_mul]; ring + dsimp only [cost] + have hex : (∑ x, iidWeight q M x*(9*ga (x m)+8*cb (x m)+4*∑ j : Fin M, if j=m then 0 else cr (x m) (x j))) = + 9*(∑ x, iidWeight q M x*ga (x m))+8*(∑ x, iidWeight q M x*cb (x m))+ + 4*(∑ x, iidWeight q M x*(∑ j : Fin M, if j=m then 0 else cr (x m) (x j))) := by + have hscl (d : ℝ) (f : (Fin M → α) → ℝ) : + (∑ x, iidWeight q M x*(d*f x))=d*∑ x, iidWeight q M x*f x := by + rw [Finset.mul_sum] + apply Finset.sum_congr rfl + intro x _; ring + simp only [mul_add,Finset.sum_add_distrib,hscl] + rw [hex,h1,h2] + change (∑ x, q x*ga x) ≤ a at hga + change (∑ x, q x*cb x) ≤ b at hcb + linarith + have hB : (∑ x, iidWeight q M x*B x) ≤ 9*a+8*b+4*(M:ℝ)*c*r := by + have hMp : 0 < (M:ℝ) := by exact_mod_cast hM + simp only [B,← mul_div_assoc,Finset.mul_sum,← Finset.sum_div] + rw [Finset.sum_comm] + apply (div_le_iff₀ hMp).mpr + have hh := Finset.sum_le_sum (s := Finset.univ) (fun m _ ↦ hcost m) + simpa only [Finset.sum_const,Finset.card_univ,Fintype.card_fin,nsmul_eq_mul,mul_comm] using hh + obtain ⟨x,hx⟩ := exists_le_weighted_average (iidWeight q M) (iidWeight_nonneg q hq M) + (iidWeight_total q hs M) B + obtain ⟨D,hD,hDs,herr⟩ := sequential_decoder_bound hM P hP (fun m ↦ Q (x m)) (fun m ↦ A (x m)) + (fun m ↦ hQ (x m)) (fun m ↦ hA (x m)) + refine ⟨x,D,hD,hDs,?_⟩ + have hh := Finset.sum_le_sum (s := Finset.univ) (fun m _ ↦ herr m) + change (∑ m, (1-(D m*A (x m)).trace.re)) ≤ ∑ m, cost x m at hh + have hMt : (M:ℝ) ≠ 0 := by exact_mod_cast hM.ne' + have hi : 1-(∑ m, (D m*A (x m)).trace.re)/(M:ℝ) ≤ B x := by + change _ ≤ (∑ m, cost x m)/(M:ℝ) + rw [show (1:ℝ)=(M:ℝ)/(M:ℝ) from (div_self hMt).symm,← sub_div] + apply div_le_div_of_nonneg_right _ (by positivity) + simpa only [Finset.sum_sub_distrib,Finset.sum_const,Finset.card_univ,Fintype.card_fin,nsmul_eq_mul,mul_one] using hh + exact hi.trans (hx.trans hB) + +end GAD + +end + +end OAI diff --git a/lean/OAI/InformationTheory/AmplitudeDamping/GramMatrices.lean b/lean/OAI/InformationTheory/AmplitudeDamping/GramMatrices.lean new file mode 100644 index 0000000000000000000000000000000000000000..e96fde6db8f916858a42767e902220a3a58ac9f0 --- /dev/null +++ b/lean/OAI/InformationTheory/AmplitudeDamping/GramMatrices.lean @@ -0,0 +1,181 @@ +import OAI.InformationTheory.AmplitudeDamping.Pinching + +namespace OAI + +universe u_1 u_2 u_3 u_4 u_5 + +noncomputable section +open scoped BigOperators Matrix.Norms.Elementwise +open Matrix +open scoped BigOperators ComplexOrder MatrixOrder +open scoped Matrix.Norms.Elementwise ComplexOrder MatrixOrder +open Matrix Set +open scoped ComplexOrder MatrixOrder +open scoped BigOperators Topology +open Filter Set +open scoped BigOperators ComplexOrder MatrixOrder Topology + +open scoped BigOperators ComplexOrder MatrixOrder +open Matrix +namespace GAD +variable {ι : Type u_1} {κ : Type u_2} {μ : Type u_3} {ν : Type u_4} [Fintype ι] [Fintype κ] [Fintype μ] [Fintype ν] + [DecidableEq ι] [DecidableEq κ] [DecidableEq μ] [DecidableEq ν] + +def zeroBlock (A : Matrix ι κ ℂ) (B : Matrix ι μ ℂ) (C : Matrix ν κ ℂ) : + Matrix (ι ⊕ ν) (κ ⊕ μ) ℂ := Matrix.fromBlocks A B C 0 + +def gram (A : Matrix ι κ ℂ) : Matrix ι ι ℂ := A * Aᴴ + +def mass (A : Matrix ι κ ℂ) : ℝ := (gram A).trace.re + +def logGram (A : Matrix ι κ ℂ) : ℝ := Real.log ‖(1+gram A).det‖ + +omit [DecidableEq ι] [DecidableEq κ] in +theorem mass_nonneg (A : Matrix ι κ ℂ) : 0 ≤ mass A := + (Complex.nonneg_iff.mp (Matrix.posSemidef_self_mul_conjTranspose A).trace_nonneg).1 + +omit [DecidableEq κ] in +theorem one_add_gram_posDef (A : Matrix ι κ ℂ) : (1 + gram A).PosDef := + Matrix.PosDef.one.add_posSemidef (Matrix.posSemidef_self_mul_conjTranspose A) + +omit [Fintype ι] [Fintype ν] [DecidableEq ι] [DecidableEq κ] [DecidableEq μ] [DecidableEq ν] in +theorem gram_zeroBlock (A : Matrix ι κ ℂ) (B : Matrix ι μ ℂ) (C : Matrix ν κ ℂ) : + gram (zeroBlock A B C) = Matrix.fromBlocks (gram A + gram B) (A*Cᴴ) (C*Aᴴ) (gram C) := by + simp [gram, zeroBlock, Matrix.fromBlocks_conjTranspose, Matrix.fromBlocks_multiply] + +omit [DecidableEq ι] [DecidableEq κ] [DecidableEq μ] [DecidableEq ν] in +theorem mass_zeroBlock (A : Matrix ι κ ℂ) (B : Matrix ι μ ℂ) (C : Matrix ν κ ℂ) : + mass (zeroBlock A B C) = mass A + mass B + mass C := by + simp [mass, gram_zeroBlock, Matrix.trace, Matrix.diag, Fintype.sum_sum_type, Finset.sum_add_distrib] + +theorem resolvent_complement (C : Matrix ν κ ℂ) : + 1 - Cᴴ * (1 + C*Cᴴ)⁻¹ * C = (1+Cᴴ*C)⁻¹ := by + have hQ := (one_add_gram_posDef C).isUnit + have hQQ : (1+C*Cᴴ)*(1+C*Cᴴ)⁻¹ = 1 := Matrix.mul_nonsing_inv _ + ((Matrix.isUnit_iff_isUnit_det _).mp hQ) + apply (Matrix.inv_eq_right_inv ?_).symm + calc + (1+Cᴴ*C) * (1-Cᴴ*(1+C*Cᴴ)⁻¹*C) = + 1+Cᴴ*C-Cᴴ*((1+C*Cᴴ)*(1+C*Cᴴ)⁻¹)*C := by + simp only [Matrix.mul_add, Matrix.add_mul, Matrix.mul_sub, + Matrix.mul_one, Matrix.one_mul, Matrix.mul_assoc] + _ = 1 := by rw [hQQ]; simp + +omit [DecidableEq μ] in +theorem det_one_add_gram_zeroBlock (A : Matrix ι κ ℂ) (B : Matrix ι μ ℂ) + (C : Matrix ν κ ℂ) : + (1+gram (zeroBlock A B C)).det = (1+gram C).det * + (1+gram B+A*(1+Cᴴ*C)⁻¹*Aᴴ).det := by + have he : 1+gram (zeroBlock A B C) = Matrix.fromBlocks + (1+gram A+gram B) (A*Cᴴ) (C*Aᴴ) (1+gram C) := by + rw [gram_zeroBlock, ← Matrix.fromBlocks_one, Matrix.fromBlocks_add] + simp [add_assoc] + rw [he] + let := (one_add_gram_posDef C).isUnit.invertible + rw [Matrix.det_fromBlocks₂₂, Matrix.invOf_eq_nonsing_inv] + congr 2 + rw [← resolvent_complement C] + dsimp only [gram] + simp only [Matrix.mul_sub, Matrix.sub_mul, Matrix.mul_one, Matrix.mul_assoc] + abel + +omit [DecidableEq μ] in +theorem logGram_zeroBlock (A : Matrix ι κ ℂ) (B : Matrix ι μ ℂ) + (C : Matrix ν κ ℂ) : + logGram (zeroBlock A B C) = logGram B + logGram C + + blockLogDet A (1+gram B) (1+Cᴴ*C) := by + have hC : ‖(1+gram C).det‖ ≠ 0 := norm_ne_zero_iff.mpr + (isUnit_iff_ne_zero.mp ((Matrix.isUnit_iff_isUnit_det _).mp (one_add_gram_posDef C).isUnit)) + have hE : (1+Cᴴ*C).PosDef := by simpa [gram] using one_add_gram_posDef Cᴴ + have hS := (one_add_gram_posDef B).add_posSemidef (hE.inv.posSemidef.mul_mul_conjTranspose_same A) + have hnS : ‖(1+gram B+A*(1+Cᴴ*C)⁻¹*Aᴴ).det‖ ≠ 0 := norm_ne_zero_iff.mpr + (isUnit_iff_ne_zero.mp ((Matrix.isUnit_iff_isUnit_det _).mp hS.isUnit)) + simp only [logGram, det_one_add_gram_zeroBlock, norm_mul, Real.log_mul hC hnS, blockLogDet] + ring + +omit [Fintype ι] [DecidableEq ι] [DecidableEq κ] in +theorem gram_sqrt_smul {r : ℝ} (hr : 0 ≤ r) (A : Matrix ι κ ℂ) : + gram (Real.sqrt r • A) = r • gram A := by + simp only [gram, Matrix.conjTranspose_smul, star_trivial, Matrix.smul_mul, Matrix.mul_smul, smul_smul, + Real.mul_self_sqrt hr] + +omit [DecidableEq κ] in +theorem logDetShift_eq_logGram {r : ℝ} (hr : 0 ≤ r) (A : Matrix ι κ ℂ) : + logDetShift r (gram A) = logGram (Real.sqrt r • A) := by + simp only [logDetShift, logGram, gram_sqrt_smul hr] + +omit [DecidableEq μ] in +theorem logDetShift_zeroBlock {r : ℝ} (hr : 0 ≤ r) (A : Matrix ι κ ℂ) + (B : Matrix ι μ ℂ) (C : Matrix ν κ ℂ) : + logDetShift r (gram (zeroBlock A B C)) = logDetShift r (gram B) + + logDetShift r (gram C) + blockLogDet (Real.sqrt r • A) (1+r • gram B) (1+r • (Cᴴ*C)) := by + rw [logDetShift_eq_logGram hr, logDetShift_eq_logGram hr, logDetShift_eq_logGram hr] + have hb : Real.sqrt r • zeroBlock A B C = + zeroBlock (Real.sqrt r • A) (Real.sqrt r • B) (Real.sqrt r • C) := by + simp [zeroBlock, Matrix.fromBlocks_smul] + rw [hb, logGram_zeroBlock, gram_sqrt_smul hr] + congr 2 + simp only [Matrix.conjTranspose_smul, star_trivial, Matrix.smul_mul, Matrix.mul_smul, + smul_smul, Real.mul_self_sqrt hr] + +end GAD +open scoped BigOperators ComplexOrder MatrixOrder +open Matrix +namespace GAD +variable {ι : Type u_5} [Fintype ι] [DecidableEq ι] + +theorem log_norm_det_diagonal_real (d : ι → ℝ) (hd : ∀ i, 0 < d i) : + Real.log ‖(Matrix.diagonal (fun i ↦ (d i : ℂ))).det‖ = ∑ i, Real.log (d i) := by + rw [Matrix.det_diagonal, norm_prod] + simp only [Complex.norm_real, Real.norm_eq_abs, abs_of_pos (hd _)] + exact Real.log_prod (fun i _ ↦ (hd i).ne') + +theorem blockLogDet_diagonal_real (z d e : ι → ℝ) (hd : ∀ i, 0 < d i) (he : ∀ i, 0 < e i) : + blockLogDet (Matrix.diagonal (fun i ↦ (z i : ℂ))) + (Matrix.diagonal (fun i ↦ (d i : ℂ))) (Matrix.diagonal (fun i ↦ (e i : ℂ))) = + ∑ i, Real.log (1+(z i)^2/(d i*e i)) := by + have hinv : (Matrix.diagonal (fun i ↦ (e i : ℂ)))⁻¹ = + Matrix.diagonal (fun i ↦ ((e i)⁻¹ : ℂ)) := by + apply Matrix.inv_eq_right_inv + rw [Matrix.diagonal_mul_diagonal] + have heq : (fun i ↦ (e i : ℂ) * ((e i)⁻¹ : ℂ)) = fun _ ↦ (1 : ℂ) := by + ext i + simp [Complex.ofReal_ne_zero.mpr (he i).ne'] + rw [heq, Matrix.diagonal_one] + have hmat : Matrix.diagonal (fun i ↦ (d i : ℂ)) + + Matrix.diagonal (fun i ↦ (z i : ℂ)) * + (Matrix.diagonal (fun i ↦ (e i : ℂ)))⁻¹ * + (Matrix.diagonal (fun i ↦ (z i : ℂ)))ᴴ = + Matrix.diagonal (fun i ↦ ((d i+(z i)^2/e i : ℝ) : ℂ)) := by + rw [hinv, Matrix.diagonal_conjTranspose, Matrix.diagonal_mul_diagonal, + Matrix.diagonal_mul_diagonal, Matrix.diagonal_add] + congr 1 + ext i + simp [pow_two, div_eq_mul_inv, mul_assoc, mul_comm] + have hp (i : ι) : 0 < d i+(z i)^2/e i := add_pos_of_pos_of_nonneg (hd i) + (div_nonneg (sq_nonneg _) (he i).le) + unfold blockLogDet + rw [hmat, log_norm_det_diagonal_real _ hp, log_norm_det_diagonal_real _ hd, ← Finset.sum_sub_distrib] + apply Finset.sum_congr rfl + intro i _ + rw [← Real.log_div (hp i).ne' (hd i).ne'] + congr 1 + field_simp [(hd i).ne', (he i).ne'] + +theorem logDetShift_diagonal_real (r : ℝ) (d : ι → ℝ) (hr : 0 ≤ r) (hd : ∀ i, 0 ≤ d i) : + logDetShift r (Matrix.diagonal (fun i ↦ (d i : ℂ))) = ∑ i, Real.log (1+r*d i) := by + have he : (1 : Matrix ι ι ℂ)+r • Matrix.diagonal (fun i ↦ (d i : ℂ)) = + Matrix.diagonal (fun i ↦ ((1+r*d i : ℝ) : ℂ)) := by + rw [← Matrix.diagonal_one, ← Matrix.diagonal_smul, Matrix.diagonal_add] + congr 1 + ext i + simp [Complex.real_smul] + rw [logDetShift, he, log_norm_det_diagonal_real] + intro i + exact add_pos_of_pos_of_nonneg zero_lt_one (mul_nonneg hr (hd i)) + +end GAD + +end + +end OAI diff --git a/lean/OAI/InformationTheory/AmplitudeDamping/Holevo.lean b/lean/OAI/InformationTheory/AmplitudeDamping/Holevo.lean new file mode 100644 index 0000000000000000000000000000000000000000..06b5b519f0303b982d65bace9a81b2a3eade18c0 --- /dev/null +++ b/lean/OAI/InformationTheory/AmplitudeDamping/Holevo.lean @@ -0,0 +1,50 @@ +import OAI.InformationTheory.AmplitudeDamping.PhaseProducts + +namespace OAI + +noncomputable section +open scoped BigOperators ComplexOrder MatrixOrder +open Matrix +namespace GAD + +theorem holevo_formula (γ ν : ℝ) (hγ : γ ∈ Set.Icc (0:ℝ) 1) + (hν : ν ∈ Set.Icc (0:ℝ) 1) {p : ℝ} (hp : Maximizes γ ν p) (n : ℕ) : + holevo γ ν n = (n:ℝ)/Real.log 2*objective γ ν p := by + have hv := phaseEnsemble_value n γ ν p hp.1 + rw [phaseValue_formula n γ ν hγ hν hp.1] at hv + apply le_antisymm + · apply csSup_le + · exact ⟨ensembleValue γ ν (phaseEnsemble n p hp.1), Set.mem_range_self _⟩ + · rintro _ ⟨E,rfl⟩ + exact ensembleValue_upper γ ν hγ hν E hp + · rw [← hv] + apply le_csSup + · exact ⟨_, fun _ hx ↦ by obtain ⟨E,rfl⟩ := hx; exact ensembleValue_upper γ ν hγ hν E hp⟩ + · exact Set.mem_range_self _ + +theorem holevo_additive (γ ν : ℝ) (hγ : γ ∈ Set.Icc (0:ℝ) 1) + (hν : ν ∈ Set.Icc (0:ℝ) 1) (n : ℕ) : + holevo γ ν n = (n:ℝ)*holevo γ ν 1 := by + obtain ⟨p,hp,hmax⟩ := exists_maximizer γ ν + rw [holevo_formula γ ν hγ hν ⟨hp,hmax⟩ n,holevo_formula γ ν hγ hν ⟨hp,hmax⟩ 1] + norm_num + ring + +theorem holevo_maximizer (γ ν : ℝ) (hγ : γ ∈ Set.Icc (0:ℝ) 1) + (hν : ν ∈ Set.Icc (0:ℝ) 1) : + ∃ p : ℝ, Maximizes γ ν p ∧ + ∀ n : ℕ, 1 ≤ n → holevo γ ν n = (n:ℝ)/Real.log 2*objective γ ν p := by + obtain ⟨p,hp,hmax⟩ := exists_maximizer γ ν + exact ⟨p,⟨hp,hmax⟩,fun n _ ↦ holevo_formula γ ν hγ hν ⟨hp,hmax⟩ n⟩ + +theorem phase_attainment (γ ν : ℝ) (hγ : γ ∈ Set.Icc (0:ℝ) 1) + (hν : ν ∈ Set.Icc (0:ℝ) 1) {p : ℝ} (hp : Maximizes γ ν p) (n : ℕ) : + (∀ s : Basis n, IsState (phaseState p s)) ∧ holevo γ ν n = phaseValue γ ν p n := by + exact ⟨fun s ↦ phaseState_state hp.1 s, by + rw [holevo_formula γ ν hγ hν hp n,phaseValue_formula n γ ν hγ hν hp.1]⟩ + +end GAD + +end + +end OAI diff --git a/lean/OAI/InformationTheory/AmplitudeDamping/HolevoInformation.lean b/lean/OAI/InformationTheory/AmplitudeDamping/HolevoInformation.lean new file mode 100644 index 0000000000000000000000000000000000000000..0b689e26484d9f17df5bfaeac83cd1909ed3c034 --- /dev/null +++ b/lean/OAI/InformationTheory/AmplitudeDamping/HolevoInformation.lean @@ -0,0 +1,138 @@ +import OAI.InformationTheory.AmplitudeDamping.Naimark + +namespace OAI + +noncomputable section + +universe u_1 u_2 u_3 u_4 u_5 u_6 u_7 + +section +open scoped BigOperators ComplexOrder MatrixOrder +open Matrix +namespace GAD + +def factorError (ε d : ℝ) (D : ℕ) : ℝ := + (d/(4*ε)+ε)*Real.log D+(1+d/(4*ε)+ε)*Real.log 2 + +theorem factorError_mono {ε d e : ℝ} {D : ℕ} (hε : 0 < ε) (hD : 0 < D) (hde : d ≤ e) : + factorError ε d D ≤ factorError ε e D := by + have hd := div_le_div_of_nonneg_right hde (show 0 ≤ 4*ε by positivity) + have hlog : 0 ≤ Real.log D := Real.log_nonneg (by exact_mod_cast hD) + have hlog2 : 0 ≤ Real.log 2 := Real.log_nonneg (by norm_num) + dsimp [factorError] + exact add_le_add (mul_le_mul_of_nonneg_right (by linarith) hlog) + (mul_le_mul_of_nonneg_right (by linarith) hlog2) + +theorem factorError_average {μ : Type u_1} [Fintype μ] (ε : ℝ) (D : ℕ) + (w d : μ → ℝ) (hws : ∑ m, w m=1) : + (∑ m, w m*factorError ε (d m) D)=factorError ε (∑ m, w m*d m) D := by + let c := (Real.log D+Real.log 2)/(4*ε) + let v := ε*Real.log D+(1+ε)*Real.log 2 + have he (x : ℝ) : factorError ε x D=x*c+v := by dsimp [factorError,c,v]; ring + simp only [he,mul_add,← mul_assoc,Finset.sum_add_distrib,← Finset.sum_mul,hws,one_mul] + +variable {ι : Type u_2} {κ : Type u_3} {μ : Type u_4} [Fintype ι] [Fintype κ] [Fintype μ] + [DecidableEq ι] [DecidableEq κ] [DecidableEq μ] [Nonempty ι] [Nonempty μ] + +theorem orthogonal_cq_bound (w : μ → ℝ) (hw : ∀ m, 0 ≤ w m) (hws : ∑ m, w m=1) + (X Y : μ → Matrix (ι × μ) κ ℂ) (hX : ∀ m, mass (X m)=1) (hY : ∀ m, mass (Y m)=1) + (hPY : ∀ m, blockProjection (ι := ι) m*Y m=Y m) {ε : ℝ} (hε : 0 < ε) : + (∑ m, Real.negMulLog (w m)) ≤ + entropy (gram (concatenate w X))-(∑ m, w m*entropy (gram (X m)))+ + 2*factorError ε (∑ m, w m*mass (X m-Y m)) (Fintype.card (ι × μ)) := by + have havg := factor_entropy_bound (concatenate w Y) (concatenate w X) + (concatenate_mass_one w Y hw hws hY) (concatenate_mass_one w X hw hws hX) hε + have hmn : mass (concatenate w Y-concatenate w X)=∑ m, w m*mass (X m-Y m) := by + rw [concatenate_sub,mass_concatenate w _ hw] + apply Finset.sum_congr rfl + intro m _ + congr 1 + rw [mass_sub,mass_sub,real_inner_comm] + ring + rw [hmn] at havg + change entropy (gram (concatenate w Y))-entropy (gram (concatenate w X)) ≤ + factorError ε (∑ m, w m*mass (X m-Y m)) (Fintype.card (ι × μ)) at havg + have hind := Finset.sum_le_sum (s := Finset.univ) (fun m _ ↦ + mul_le_mul_of_nonneg_left (factor_entropy_bound (X m) (Y m) (hX m) (hY m) hε) (hw m)) + change (∑ m, w m*(entropy (gram (X m))-entropy (gram (Y m)))) ≤ + (∑ m, w m*factorError ε (mass (X m-Y m)) (Fintype.card (ι × μ))) at hind + rw [factorError_average ε _ w _ hws] at hind + simp only [mul_sub,Finset.sum_sub_distrib] at hind + rw [gram_concatenate w Y hw,orthogonal_factor_entropy w Y hY hPY,Finset.sum_add_distrib] at havg + linarith + +end GAD + +end + +open scoped BigOperators ComplexOrder MatrixOrder +open Matrix +namespace GAD +variable {ι : Type u_5} {μ : Type u_6} [Fintype ι] [Fintype μ] [DecidableEq ι] [DecidableEq μ] + [Nonempty ι] [Nonempty μ] + +def uniformWeight (μ : Type u_7) [Fintype μ] (_ : μ) : ℝ := (Fintype.card μ : ℝ)⁻¹ + +omit [DecidableEq μ] in +theorem uniformWeight_nonneg (m : μ) : 0 ≤ uniformWeight μ m := by + dsimp [uniformWeight]; positivity + +omit [DecidableEq μ] in +theorem uniformWeight_sum : (∑ m : μ, uniformWeight μ m)=1 := by + simp only [uniformWeight,Finset.sum_const,Finset.card_univ,nsmul_eq_mul] + exact mul_inv_cancel₀ (by exact_mod_cast (Fintype.card_pos (α := μ)).ne') + +omit [DecidableEq μ] in +theorem uniformWeight_entropy : (∑ m : μ, Real.negMulLog (uniformWeight μ m))=Real.log (Fintype.card μ) := by + have hc : (Fintype.card μ : ℝ) ≠ 0 := by exact_mod_cast (Fintype.card_pos (α := μ)).ne' + simp only [uniformWeight,Real.negMulLog,Real.log_inv,Finset.sum_const,Finset.card_univ,nsmul_eq_mul] + field_simp + +theorem cq_decoding_entropy_bound (A D : μ → Matrix ι ι ℂ) + (hA : ∀ m, IsState (A m)) (hD : ∀ m, (D m).PosSemidef) (hDs : ∑ m, D m=1) + {ε : ℝ} (hε : 0 < ε) : + Real.log (Fintype.card μ) ≤ + entropy (∑ m, uniformWeight μ m • A m)-(∑ m, uniformWeight μ m*entropy (A m))+ + 2*factorError ε (2*(1-∑ m, uniformWeight μ m*(D m*A m).trace.re)) (Fintype.card (ι × μ)) := by + let W := naimark D hD + let F := fun m ↦ spectralFactor (hA m).1 + let X := fun m ↦ W*F m + have hW : Wᴴ*W=1 := naimark_isometry D hD hDs + have hF (m : μ) : mass (F m)=1 := by dsimp [F,mass]; rw [spectralFactor_gram,(hA m).2]; rfl + have hX (m : μ) : mass (X m)=1 := by rw [mass_isometry W hW,hF] + obtain ⟨Y,hY,hPY,hd⟩ := exists_orthogonal_factors A D hA hD hDs + have hb := orthogonal_cq_bound (uniformWeight μ) uniformWeight_nonneg uniformWeight_sum X Y hX hY hPY hε + rw [uniformWeight_entropy] at hb + have hc : concatenate (uniformWeight μ) X=W*concatenate (uniformWeight μ) F := by + ext i mk + dsimp [concatenate,X] + simp only [Matrix.mul_apply,Finset.mul_sum] + apply Finset.sum_congr rfl + intro j _ + dsimp [concatenate] + ring + have hi (m : μ) : entropy (gram (X m))=entropy (A m) := by + rw [entropy_gram_isometry W hW,spectralFactor_gram] + have ha : entropy (gram (concatenate (uniformWeight μ) X))= + entropy (∑ m, uniformWeight μ m • A m) := by + rw [hc,entropy_gram_isometry W hW,gram_concatenate _ _ uniformWeight_nonneg] + simp only [F,spectralFactor_gram] + rw [ha] at hb + simp only [hi] at hb + have hd' : (∑ m, uniformWeight μ m*mass (X m-Y m)) ≤ + 2*(1-∑ m, uniformWeight μ m*(D m*A m).trace.re) := by + calc + _ ≤ ∑ m, uniformWeight μ m*(2*(1-(D m*A m).trace.re)) := + Finset.sum_le_sum (fun m _ ↦ mul_le_mul_of_nonneg_left (hd m) (uniformWeight_nonneg m)) + _ = _ := by + simp only [mul_sub,mul_one,Finset.sum_sub_distrib,← Finset.mul_sum, + show ∀ a b : ℝ, a*(2*b)=2*(a*b) by intros; ring,← Finset.sum_mul,uniformWeight_sum] + ring + exact hb.trans (add_le_add le_rfl (mul_le_mul_of_nonneg_left + (factorError_mono hε (Fintype.card_pos (α := ι × μ)) hd') (by norm_num))) + +end GAD + +end + +end OAI diff --git a/lean/OAI/InformationTheory/AmplitudeDamping/LogDetConvexity.lean b/lean/OAI/InformationTheory/AmplitudeDamping/LogDetConvexity.lean new file mode 100644 index 0000000000000000000000000000000000000000..48566b5b71916ead8f9b235f7d974da60e163f8c --- /dev/null +++ b/lean/OAI/InformationTheory/AmplitudeDamping/LogDetConvexity.lean @@ -0,0 +1,183 @@ +import OAI.InformationTheory.AmplitudeDamping.MatrixDifferentiation + +namespace OAI + +universe u_1 u_2 u_3 + +noncomputable section +open scoped BigOperators Matrix.Norms.Elementwise +open Matrix +open scoped BigOperators ComplexOrder MatrixOrder + +open scoped Matrix.Norms.Elementwise ComplexOrder MatrixOrder +open Matrix Set +namespace GAD +variable {ι : Type u_1} [Fintype ι] [DecidableEq ι] + +omit [DecidableEq ι] in +/-- Trace commutes with differentiation of finite-dimensional matrix curves. -/ +theorem hasDerivAt_trace {A : ℝ → Matrix ι ι ℂ} {H : Matrix ι ι ℂ} {t : ℝ} + (hA : HasDerivAt A H t) : + HasDerivAt (fun s ↦ (A s).trace) H.trace t := by + convert! HasDerivAt.sum (u := Finset.univ) (fun i _ ↦ + hasDerivAt_pi.1 (hasDerivAt_pi.1 hA i) i) using 1 + ext s + simp [Matrix.trace] + +/-- The first derivative term in Jacobi's formula has the expected noncommutative derivative. -/ +theorem hasDerivAt_trace_inv_mul {A : ℝ → Matrix ι ι ℂ} {H : Matrix ι ι ℂ} {t : ℝ} + (hA : HasDerivAt A H t) (hdet : (A t).det ≠ 0) : + HasDerivAt (fun s ↦ (Matrix.trace ((A s)⁻¹ * H)).re) + (-(Matrix.trace (((A t)⁻¹ * H) * ((A t)⁻¹ * H))).re) t := by + have hi := hasDerivAt_matrix_inv hA hdet + have ht := hasDerivAt_trace (hasDerivAt_matrix_mul hi (hasDerivAt_const t H)) + have hr := Complex.reCLM.hasFDerivAt.comp_hasDerivAt t ht + convert! hr using 1 + simp [Matrix.mul_assoc] + +/-- The skew-shift log-determinant deficit, including non-real determinants. -/ +def skewLogDet (Z D : Matrix ι ι ℂ) : ℝ := + Real.log ‖(D + Z).det‖ - Real.log ‖D.det‖ + +omit [Fintype ι] [DecidableEq ι] in +/-- Positivity is preserved throughout a segment, including both endpoints. -/ +theorem posDef_segment {D E : Matrix ι ι ℂ} (hD : D.PosDef) (hE : E.PosDef) + {a b : ℝ} (ha : 0 ≤ a) (hb : 0 ≤ b) (hab : a + b = 1) : + (a • D + b • E).PosDef := by + rcases eq_or_lt_of_le ha with rfl | ha + · have : b = 1 := by linarith + simpa [this] using hE + · exact (hD.smul ha).add_posSemidef (hE.posSemidef.smul hb) + +/-- Joint convexity mechanism: a fixed skew-Hermitian perturbation has convex logdet deficit. -/ +theorem convexOn_skewLogDet (Z : Matrix ι ι ℂ) (hZ : Z.conjTranspose = -Z) : + ConvexOn ℝ {D : Matrix ι ι ℂ | D.PosDef} (skewLogDet Z) := by + refine ⟨?_, ?_⟩ + · intro D hD E hE a b ha hb hab + exact posDef_segment hD hE ha hb hab + intro D hD E hE a b ha hb hab + let A : ℝ → Matrix ι ι ℂ := fun t ↦ (1 - t) • D + t • E + let H := E - D + have hH : H.IsHermitian := hE.isHermitian.sub hD.isHermitian + have hpos (t : ℝ) (ht : t ∈ Icc (0 : ℝ) 1) : (A t).PosDef := + posDef_segment hD hE (sub_nonneg.2 ht.2) ht.1 (by ring) + have hA (t : ℝ) : HasDerivAt A H t := by + convert! (((hasDerivAt_const t (1 : ℝ)).sub (hasDerivAt_id t)).smul_const D).add + ((hasDerivAt_id t).smul_const E) using 1 + simp [H, sub_eq_add_neg, add_comm] + let f : ℝ → ℝ := fun t ↦ skewLogDet Z (A t) + let f' : ℝ → ℝ := fun t ↦ + (Matrix.trace ((A t + Z)⁻¹ * H)).re - (Matrix.trace ((A t)⁻¹ * H)).re + let f'' : ℝ → ℝ := fun t ↦ + (Matrix.trace (((A t)⁻¹ * H) * ((A t)⁻¹ * H))).re - + (Matrix.trace (((A t + Z)⁻¹ * H) * ((A t + Z)⁻¹ * H))).re + have hunit (t : ℝ) (ht : t ∈ Icc (0 : ℝ) 1) := + skew_shift_trace_bound (A t) Z H (hpos t ht) hZ hH + have hnD (t : ℝ) (ht : t ∈ Icc (0 : ℝ) 1) : (A t).det ≠ 0 := + isUnit_iff_ne_zero.1 ((Matrix.isUnit_iff_isUnit_det _).1 (hpos t ht).isUnit) + have hnC (t : ℝ) (ht : t ∈ Icc (0 : ℝ) 1) : (A t + Z).det ≠ 0 := + isUnit_iff_ne_zero.1 ((Matrix.isUnit_iff_isUnit_det _).1 (hunit t ht).1) + have hf (t : ℝ) (ht : t ∈ Icc (0 : ℝ) 1) : HasDerivAt f (f' t) t := by + have hd := hasDerivAt_logNormDet (hA t) (hnD t ht) + have hc := hasDerivAt_logNormDet ((hA t).add_const Z) (hnC t ht) + convert! hc.sub hd using 1 + simp [f', Matrix.trace_mul_comm H] + have hf' (t : ℝ) (ht : t ∈ Icc (0 : ℝ) 1) : HasDerivAt f' (f'' t) t := by + have hd := hasDerivAt_trace_inv_mul (hA t) (hnD t ht) + have hc := hasDerivAt_trace_inv_mul ((hA t).add_const Z) (hnC t ht) + convert! hc.sub hd using 1 + dsimp [f''] + ring + have hf'' (t : ℝ) (ht : t ∈ Icc (0 : ℝ) 1) : 0 ≤ f'' t := + sub_nonneg.2 (hunit t ht).2 + have hconv : ConvexOn ℝ (Icc (0 : ℝ) 1) f := + convexOn_of_hasDerivWithinAt2_nonneg (convex_Icc _ _) + (fun t ht ↦ (hf t ht).continuousAt.continuousWithinAt) + (fun t ht ↦ (hf t (interior_subset ht)).hasDerivWithinAt) + (fun t ht ↦ (hf' t (interior_subset ht)).hasDerivWithinAt) + (fun t ht ↦ hf'' t (interior_subset ht)) + have h := hconv.2 (show (0 : ℝ) ∈ Icc (0 : ℝ) 1 by simp) + (show (1 : ℝ) ∈ Icc (0 : ℝ) 1 by simp) ha hb hab + have hea : 1 - b = a := by linarith + simpa [f, A, hea] using h + +end GAD + +open scoped ComplexOrder MatrixOrder +open Matrix Set +namespace GAD +variable {ι : Type u_2} {κ : Type u_3} [Fintype ι] [Fintype κ] [DecidableEq ι] [DecidableEq κ] + +omit [DecidableEq ι] [DecidableEq κ] in +/-- A direct sum of strictly positive matrices is strictly positive. -/ +theorem posDef_fromBlocks_zero {D : Matrix ι ι ℂ} {E : Matrix κ κ ℂ} + (hD : D.PosDef) (hE : E.PosDef) : + (Matrix.fromBlocks D 0 0 E).PosDef := by + apply Matrix.PosDef.of_dotProduct_mulVec_pos + (Matrix.IsHermitian.fromBlocks hD.isHermitian (by simp) hE.isHermitian) + intro x hx + have hxsplit : x = Sum.elim (fun i ↦ x (.inl i)) (fun j ↦ x (.inr j)) := by + ext i + cases i <;> rfl + rw [hxsplit, Matrix.fromBlocks_mulVec] + simp only [Matrix.zero_mulVec, add_zero, zero_add, Function.star_sumElim, Sum.elim_comp_inl, Sum.elim_comp_inr, + sumElim_dotProduct_sumElim] + have hnon : (fun i ↦ x (.inl i)) ≠ 0 ∨ (fun j ↦ x (.inr j)) ≠ 0 := by + by_contra h + simp only [not_or, ne_eq, not_not] at h + apply hx + rw [hxsplit, h.1, h.2] + ext i + cases i <;> rfl + rcases hnon with h | h + · exact add_pos_of_pos_of_nonneg (hD.dotProduct_mulVec_pos h) + (hE.posSemidef.dotProduct_mulVec_nonneg _) + · exact add_pos_of_nonneg_of_pos (hD.posSemidef.dotProduct_mulVec_nonneg _) + (hE.dotProduct_mulVec_pos h) + + +def blockLogDet (Z : Matrix ι κ ℂ) (D : Matrix ι ι ℂ) (E : Matrix κ κ ℂ) : ℝ := + Real.log ‖(D + Z * E⁻¹ * Zᴴ).det‖ - Real.log ‖D.det‖ + +theorem skewLogDet_fromBlocks (Z : Matrix ι κ ℂ) + {D : Matrix ι ι ℂ} {E : Matrix κ κ ℂ} (hD : D.PosDef) (hE : E.PosDef) : + skewLogDet (Matrix.fromBlocks 0 Z (-Zᴴ) 0) (Matrix.fromBlocks D 0 0 E) = + blockLogDet Z D E := by + have hS : (D + Z * E⁻¹ * Zᴴ).PosDef := + hD.add_posSemidef (hE.inv.posSemidef.mul_mul_conjTranspose_same Z) + have hnD : ‖D.det‖ ≠ 0 := norm_ne_zero_iff.mpr + (isUnit_iff_ne_zero.mp ((Matrix.isUnit_iff_isUnit_det _).mp hD.isUnit)) + have hnE : ‖E.det‖ ≠ 0 := norm_ne_zero_iff.mpr + (isUnit_iff_ne_zero.mp ((Matrix.isUnit_iff_isUnit_det _).mp hE.isUnit)) + have hnS : ‖(D + Z * E⁻¹ * Zᴴ).det‖ ≠ 0 := norm_ne_zero_iff.mpr + (isUnit_iff_ne_zero.mp ((Matrix.isUnit_iff_isUnit_det _).mp hS.isUnit)) + let := hE.isUnit.invertible + simp only [skewLogDet, blockLogDet, Matrix.fromBlocks_add, add_zero, zero_add] + rw [Matrix.det_fromBlocks₂₂, Matrix.invOf_eq_nonsing_inv, + Matrix.mul_neg, sub_neg_eq_add, Matrix.det_fromBlocks_zero₁₂, norm_mul, norm_mul, + Real.log_mul hnE hnS, Real.log_mul hnD hnE] + ring + +/-- Main log-determinant lemma, in all finite rectangular block dimensions. -/ +theorem convexOn_blockLogDet (Z : Matrix ι κ ℂ) : + ConvexOn ℝ {p : Matrix ι ι ℂ × Matrix κ κ ℂ | p.1.PosDef ∧ p.2.PosDef} + (fun p ↦ blockLogDet Z p.1 p.2) := by + have hc := convexOn_skewLogDet (Matrix.fromBlocks 0 Z (-Zᴴ) 0) (by + simp [Matrix.fromBlocks_conjTranspose, Matrix.fromBlocks_neg]) + refine ⟨?_, ?_⟩ + · intro D hD E hE a b ha hb hab + exact ⟨posDef_segment hD.1 hE.1 ha hb hab, posDef_segment hD.2 hE.2 ha hb hab⟩ + intro D hD E hE a b ha hb hab + have h := hc.2 (posDef_fromBlocks_zero hD.1 hD.2) + (posDef_fromBlocks_zero hE.1 hE.2) ha hb hab + change blockLogDet Z (a • D.1 + b • E.1) (a • D.2 + b • E.2) ≤ _ + simpa only [Matrix.fromBlocks_smul, Matrix.fromBlocks_add, smul_zero, add_zero, + skewLogDet_fromBlocks Z hD.1 hD.2, skewLogDet_fromBlocks Z hE.1 hE.2, + skewLogDet_fromBlocks Z (posDef_segment hD.1 hE.1 ha hb hab) + (posDef_segment hD.2 hE.2 ha hb hab), Prod.fst_add, Prod.snd_add, + Prod.fst_smul, Prod.snd_smul] using h +end GAD + +end + +end OAI diff --git a/lean/OAI/InformationTheory/AmplitudeDamping/LogDetEntropy.lean b/lean/OAI/InformationTheory/AmplitudeDamping/LogDetEntropy.lean new file mode 100644 index 0000000000000000000000000000000000000000..103d6c8e8007d6e307808ad990667c4dbe31c534 --- /dev/null +++ b/lean/OAI/InformationTheory/AmplitudeDamping/LogDetEntropy.lean @@ -0,0 +1,192 @@ +import OAI.InformationTheory.AmplitudeDamping.SpectralEntropy + +namespace OAI + +universe u_1 u_2 u_3 u_4 u_5 + +noncomputable section +open scoped BigOperators Matrix.Norms.Elementwise +open Matrix +open scoped BigOperators ComplexOrder MatrixOrder +open scoped Matrix.Norms.Elementwise ComplexOrder MatrixOrder +open Matrix Set +open scoped ComplexOrder MatrixOrder + +open scoped BigOperators Topology +open Filter Set +namespace GAD + +/-- A finite-spectrum primitive, continuous even at a zero eigenvalue. -/ +def logEntropyPrimitive (a t : ℝ) : ℝ := + (t + a) * Real.log (t + a) - t * Real.log t - a * Real.log (t + 1) + +theorem logEntropyPrimitive_zero (a : ℝ) : + logEntropyPrimitive a 0 = - Real.negMulLog a := by + simp [logEntropyPrimitive, Real.negMulLog] + +theorem continuousOn_logEntropyPrimitive (a : ℝ) : + ContinuousOn (logEntropyPrimitive a) (Ici 0) := by + have h₁ : Continuous (fun t : ℝ ↦ (t + a) * Real.log (t + a)) := + Real.continuous_mul_log.comp (continuous_id.add_const a) + refine (h₁.continuousOn.sub Real.continuous_mul_log.continuousOn).sub ?_ + apply ContinuousOn.const_mul + refine Real.continuousOn_log.comp (continuous_id.add_const 1).continuousOn ?_ + intro t ht + change t + 1 ≠ 0 + have ht0 : 0 ≤ t := ht + linarith + +theorem hasDerivAt_logEntropyPrimitive {a t : ℝ} (ha : 0 ≤ a) (ht : 0 < t) : + HasDerivAt (logEntropyPrimitive a) + (Real.log (1 + a / t) - a / (t + 1)) t := by + have hta : t + a ≠ 0 := by linarith + have ht1 : t + 1 ≠ 0 := by linarith + have h₁ := (Real.hasDerivAt_mul_log hta).comp t ((hasDerivAt_id t).add_const a) + have h₂ := Real.hasDerivAt_mul_log ht.ne' + have h₃ := ((Real.hasDerivAt_log ht1).comp t ((hasDerivAt_id t).add_const 1)).const_mul a + convert! (h₁.sub h₂).sub h₃ using 1 + rw [one_add_div ht.ne', Real.log_div hta ht.ne'] + simp only [mul_one, div_eq_mul_inv] + ring + +theorem tendsto_logEntropyPrimitive (a : ℝ) : + Tendsto (logEntropyPrimitive a) atTop (𝓝 a) := by + have hdiff := (Real.tendsto_log_comp_add_sub_log a).sub + (Real.tendsto_log_comp_add_sub_log 1) + have h := (Real.tendsto_mul_log_one_add_div_atTop a).add (hdiff.const_mul a) + simp only [sub_zero, mul_zero, add_zero] at h + apply h.congr' + filter_upwards [eventually_gt_atTop (0 : ℝ), eventually_gt_atTop (-a)] with t ht hta + have hne : t + a ≠ 0 := by linarith + simp only [logEntropyPrimitive, one_add_div ht.ne', + Real.log_div hne ht.ne'] + ring + + +theorem entropy_sum_le_of_log_sum_le {ι : Type u_1} [Fintype ι] + (c a : ι → ℝ) (ha : ∀ i, 0 ≤ a i) (htrace : ∑ i, c i * a i = 0) + (hlog : ∀ t : ℝ, 0 < t → ∑ i, c i * Real.log (1 + a i / t) ≤ 0) : + ∑ i, c i * Real.negMulLog (a i) ≤ 0 := by + let H : ℝ → ℝ := fun t ↦ ∑ i, c i * logEntropyPrimitive (a i) t + have hcont : ContinuousOn H (Ici 0) := + continuousOn_finsetSum _ (fun i _ ↦ (continuousOn_logEntropyPrimitive (a i)).const_mul _) + have hd (t : ℝ) (ht : 0 < t) : + HasDerivAt H (∑ i, c i * Real.log (1 + a i / t)) t := by + have h := HasDerivAt.sum (u := Finset.univ) (fun i _ ↦ + (hasDerivAt_logEntropyPrimitive (ha i) ht).const_mul (c i)) + convert! h using 1 + · ext t + simp only [H, Finset.sum_apply] + · simp only [mul_sub, Finset.sum_sub_distrib, ← mul_div_assoc, ← Finset.sum_div, + htrace, zero_div, sub_zero] + have hanti : AntitoneOn H (Ici 0) := + antitoneOn_of_deriv_nonpos (convex_Ici 0) hcont + (fun t ht ↦ (hd t (by simpa using ht)).differentiableAt.differentiableWithinAt) + (fun t ht ↦ by rw [(hd t (by simpa using ht)).deriv]; exact hlog t (by simpa using ht)) + have hlim : Tendsto H atTop (𝓝 0) := by + have h := tendsto_finsetSum Finset.univ (fun i _ ↦ + (tendsto_logEntropyPrimitive (a i)).const_mul (c i)) + simpa only [htrace] using h + have hzero : 0 ≤ H 0 := le_of_tendsto hlim (by + filter_upwards [eventually_ge_atTop (0 : ℝ)] with t ht + exact hanti (by simp) ht ht) + simpa only [H, logEntropyPrimitive_zero, mul_neg, Finset.sum_neg_distrib, + neg_nonneg] using hzero +end GAD + +open scoped BigOperators ComplexOrder MatrixOrder Topology +open Matrix +namespace GAD +variable {ι : Type u_2} [Fintype ι] [DecidableEq ι] + +def logDetShift (r : ℝ) (A : Matrix ι ι ℂ) : ℝ := Real.log ‖(1 + r • A).det‖ + +theorem det_unitary_conj (U : Matrix.unitaryGroup ι ℂ) (A : Matrix ι ι ℂ) : + (Unitary.conjStarAlgAut ℂ _ U A).det = A.det := by + rw [Unitary.conjStarAlgAut_apply, Matrix.det_mul, Matrix.det_mul] + have hu := congrArg Matrix.det (Unitary.coe_mul_star_self U) + rw [Matrix.det_mul, Matrix.det_one] at hu + calc + _ = ((U : Matrix ι ι ℂ).det * (star U : Matrix ι ι ℂ).det) * A.det := by ring + _ = A.det := by simp only [← Unitary.coe_star, hu, one_mul] + +theorem logDetShift_eq_sum {A : Matrix ι ι ℂ} (hA : A.PosSemidef) + {r : ℝ} (hr : 0 ≤ r) : + logDetShift r A = ∑ i, Real.log (1 + r * hA.isHermitian.eigenvalues i) := by + let U := hA.isHermitian.eigenvectorUnitary + let φ := Unitary.conjStarAlgAut ℂ (Matrix ι ι ℂ) U + have he : 1 + r • A = φ (Matrix.diagonal + (fun i ↦ ((1 + r * hA.isHermitian.eigenvalues i : ℝ) : ℂ))) := by + have hd : Matrix.diagonal (fun i ↦ ((1 + r * hA.isHermitian.eigenvalues i : ℝ) : ℂ)) = + 1 + r • Matrix.diagonal (fun i ↦ (hA.isHermitian.eigenvalues i : ℂ)) := by + ext i j + by_cases h : i = j <;> simp [h] + rw [hd, map_add, map_one] + have hm : φ (r • Matrix.diagonal (fun i ↦ (hA.isHermitian.eigenvalues i : ℂ))) = + r • φ (Matrix.diagonal (fun i ↦ (hA.isHermitian.eigenvalues i : ℂ))) := + (φ.toAlgEquiv.toLinearEquiv.restrictScalars ℝ).map_smul _ _ + rw [hm] + congr 2 + exact hA.isHermitian.spectral_theorem + unfold logDetShift + rw [he, det_unitary_conj, Matrix.det_diagonal, norm_prod] + have hp (i : ι) : 0 < 1 + r * hA.isHermitian.eigenvalues i := + add_pos_of_pos_of_nonneg zero_lt_one (mul_nonneg hr (hA.eigenvalues_nonneg i)) + simp only [Complex.norm_real, Real.norm_eq_abs, + abs_of_pos (hp _)] + exact Real.log_prod (fun i _ ↦ (hp i).ne') + +/-- Entropy may be compared between unequal matrix sizes by their resolvent determinants. -/ +theorem entropy_le_of_logDetShift_le {κ : Type u_3} [Fintype κ] [DecidableEq κ] + {A : Matrix ι ι ℂ} {B : Matrix κ κ ℂ} (hA : A.PosSemidef) (hB : B.PosSemidef) + (htrace : A.trace.re = B.trace.re) + (hlog : ∀ r : ℝ, 0 < r → logDetShift r A ≤ logDetShift r B) : + entropy A ≤ entropy B := by + have htA : A.trace.re = ∑ i, hA.isHermitian.eigenvalues i := by + rw [hA.isHermitian.trace_eq_sum_eigenvalues]; simp + have htB : B.trace.re = ∑ i, hB.isHermitian.eigenvalues i := by + rw [hB.isHermitian.trace_eq_sum_eigenvalues]; simp + have hh := entropy_sum_le_of_log_sum_le + (Sum.elim (fun _ : ι ↦ (1 : ℝ)) (fun _ : κ ↦ -1)) + (Sum.elim hA.isHermitian.eigenvalues hB.isHermitian.eigenvalues) ?_ ?_ ?_ + · simpa only [Fintype.sum_sum_type, Sum.elim_inl, Sum.elim_inr, one_mul, neg_one_mul, + Finset.sum_neg_distrib, add_neg_le_iff_le_add, zero_add, entropy_eq_sum hA.isHermitian, + entropy_eq_sum hB.isHermitian] using hh + · intro i + cases i with + | inl i => exact hA.eigenvalues_nonneg i + | inr i => exact hB.eigenvalues_nonneg i + · simp only [Fintype.sum_sum_type, Sum.elim_inl, Sum.elim_inr, one_mul, neg_one_mul, + Finset.sum_neg_distrib, ← htA, ← htB, htrace, add_neg_cancel] + · intro t ht + have hh := hlog t⁻¹ (inv_pos.mpr ht) + rw [logDetShift_eq_sum hA (inv_nonneg.mpr ht.le), + logDetShift_eq_sum hB (inv_nonneg.mpr ht.le)] at hh + simpa only [Fintype.sum_sum_type, Sum.elim_inl, Sum.elim_inr, one_mul, neg_one_mul, + Finset.sum_neg_distrib, add_neg_le_iff_le_add, zero_add, div_eq_mul_inv, mul_comm] using hh + +theorem entropy_eq_of_logDetShift_eq {κ : Type u_4} [Fintype κ] [DecidableEq κ] + {A : Matrix ι ι ℂ} {B : Matrix κ κ ℂ} (hA : A.PosSemidef) (hB : B.PosSemidef) + (htrace : A.trace.re = B.trace.re) + (hlog : ∀ r : ℝ, 0 < r → logDetShift r A = logDetShift r B) : + entropy A = entropy B := + le_antisymm (entropy_le_of_logDetShift_le hA hB htrace (fun r hr ↦ (hlog r hr).le)) + (entropy_le_of_logDetShift_le hB hA htrace.symm (fun r hr ↦ (hlog r hr).ge)) + +/-- Nonzero spectra, including their entropy, agree for both rectangular Gram matrices. -/ +theorem entropy_mul_conjTranspose {κ : Type u_5} [Fintype κ] [DecidableEq κ] + (A : Matrix ι κ ℂ) : entropy (A * Aᴴ) = entropy (Aᴴ * A) := by + apply entropy_eq_of_logDetShift_eq (Matrix.posSemidef_self_mul_conjTranspose A) + (Matrix.posSemidef_conjTranspose_mul_self A) + · exact congrArg Complex.re (Matrix.trace_mul_comm A Aᴴ) + · intro r _ + dsimp only [logDetShift] + congr 2 + simpa only [Matrix.smul_mul, Matrix.mul_smul] using + Matrix.det_one_add_mul_comm (r • A) Aᴴ + +end GAD + +end + +end OAI diff --git a/lean/OAI/InformationTheory/AmplitudeDamping/Main.lean b/lean/OAI/InformationTheory/AmplitudeDamping/Main.lean new file mode 100644 index 0000000000000000000000000000000000000000..c11701969c7b48e6e608b6c11ad1e598d715631e --- /dev/null +++ b/lean/OAI/InformationTheory/AmplitudeDamping/Main.lean @@ -0,0 +1,55 @@ +import OAI.InformationTheory.AmplitudeDamping.CapacityAchievability + +namespace OAI + +noncomputable section +open scoped BigOperators ComplexOrder MatrixOrder +open Matrix Filter +namespace GAD + +theorem capacity_formula (γ ν : ℝ) (hγ : γ ∈ Set.Icc (0:ℝ) 1) + (hν : ν ∈ Set.Icc (0:ℝ) 1) {p : ℝ} (hp : Maximizes γ ν p) : + capacity γ ν=objective γ ν p/Real.log 2 := by + have hzero := zero_achievable γ ν hγ hν + have hbdd : BddAbove {R : ℝ | Achievable γ ν R} := + ⟨objective γ ν p/Real.log 2,fun _ hR ↦ achievable_upper γ ν hγ hν hp hR⟩ + have hnonempty : {R : ℝ | Achievable γ ν R}.Nonempty := ⟨0,hzero⟩ + have hcap0 : 0 ≤ capacity γ ν := le_csSup hbdd hzero + apply le_antisymm + · exact csSup_le hnonempty (fun _ hR ↦ achievable_upper γ ν hγ hν hp hR) + · by_contra! hbad + let R := (capacity γ ν+objective γ ν p/Real.log 2)/2 + have hRcap : capacity γ ν < R := by dsimp [R]; linarith + have hRχ : R < objective γ ν p/Real.log 2 := by dsimp [R]; linarith + have hR0 : 0 ≤ R := hcap0.trans hRcap.le + have hl : 0 < Real.log 2 := Real.log_pos (by norm_num) + have hrχ : R*Real.log 2 < objective γ ν p := (lt_div_iff₀ hl).mp hRχ + have ha := phase_rate_achievable γ ν hγ hν hp.1 (mul_nonneg hR0 hl.le) hrχ + rw [mul_div_cancel_right₀ R hl.ne'] at ha + exact (not_le_of_gt hRcap) (le_csSup hbdd ha) + +theorem capacity_holevo (γ ν : ℝ) (hγ : γ ∈ Set.Icc (0:ℝ) 1) + (hν : ν ∈ Set.Icc (0:ℝ) 1) : capacity γ ν=holevo γ ν 1 := by + obtain ⟨p,hp,hmax⟩ := exists_maximizer γ ν + rw [capacity_formula γ ν hγ hν ⟨hp,hmax⟩,holevo_formula γ ν hγ hν ⟨hp,hmax⟩ 1] + norm_num + ring + +theorem main (γ ν : ℝ) (hγ : γ ∈ Set.Icc (0 : ℝ) 1) + (hν : ν ∈ Set.Icc (0 : ℝ) 1) : + (∀ n : ℕ, 1 ≤ n → holevo γ ν n = (n : ℝ) * holevo γ ν 1) ∧ + (∃ p : ℝ, Maximizes γ ν p ∧ + ∀ n : ℕ, 1 ≤ n → holevo γ ν n = (n : ℝ) / Real.log 2 * objective γ ν p) ∧ + capacity γ ν = holevo γ ν 1 ∧ + (∀ p : ℝ, Maximizes γ ν p → ∀ n : ℕ, 1 ≤ n → + (∀ s : Basis n, IsState (phaseState p s)) ∧ + holevo γ ν n = phaseValue γ ν p n) := by + exact ⟨fun n _ ↦ holevo_additive γ ν hγ hν n, + holevo_maximizer γ ν hγ hν,capacity_holevo γ ν hγ hν, + fun p hp n _ ↦ phase_attainment γ ν hγ hν hp n⟩ + +end GAD + +end + +end OAI diff --git a/lean/OAI/InformationTheory/AmplitudeDamping/MatrixDifferentiation.lean b/lean/OAI/InformationTheory/AmplitudeDamping/MatrixDifferentiation.lean new file mode 100644 index 0000000000000000000000000000000000000000..e579750429abe0222ec52471ba7bab0af4289044 --- /dev/null +++ b/lean/OAI/InformationTheory/AmplitudeDamping/MatrixDifferentiation.lean @@ -0,0 +1,279 @@ +import OAI.InformationTheory.AmplitudeDamping.Channel + +namespace OAI + +universe u_1 u_2 + +noncomputable section + +open scoped BigOperators Matrix.Norms.Elementwise +open Matrix +namespace GAD + +variable {ι : Type u_1} [Fintype ι] [DecidableEq ι] + +/-- The determinant as a continuous multilinear map in its rows. -/ +def detMultilinear : ContinuousMultilinearMap ℂ (fun _ : ι ↦ ι → ℂ) ℂ := + { Matrix.detRowAlternating.toMultilinearMap with + cont := by + change Continuous (Matrix.det : Matrix ι ι ℂ → ℂ) + fun_prop } + +/-- Jacobi's differential, without an invertibility assumption. -/ +theorem det_linearDeriv (A H : Matrix ι ι ℂ) : + detMultilinear.linearDeriv A H = Matrix.trace (H * A.adjugate) := by + change (detMultilinear.linearDeriv (fun i j ↦ A i j)) (fun i j ↦ H i j) = _ + rw [ContinuousMultilinearMap.linearDeriv_apply] + simp only [Matrix.trace, Matrix.diag, Matrix.mul_apply] + apply Finset.sum_congr rfl + intro i _ + change (A.updateRow i (H i)).det = _ + rw [← Matrix.cramer_transpose_apply, Matrix.cramer_eq_adjugate_mulVec, + ← Matrix.adjugate_transpose] + simp only [Matrix.mulVec, dotProduct, Matrix.transpose_apply] + apply Finset.sum_congr rfl + intro j _ + ring + +/-- Jacobi's formula along any differentiable complex-matrix curve. -/ +theorem hasDerivAt_det {A : ℝ → Matrix ι ι ℂ} {H : Matrix ι ι ℂ} {t : ℝ} + (hA : HasDerivAt A H t) : + HasDerivAt (fun s ↦ (A s).det) (Matrix.trace (H * (A t).adjugate)) t := by + have h := ((detMultilinear.hasFDerivAt (A t)).restrictScalars ℝ).comp_hasDerivAt t hA + change HasDerivAt (fun s ↦ (A s).det) (detMultilinear.linearDeriv (A t) H) t at h + rwa [det_linearDeriv] at h + +omit [DecidableEq ι] in +/-- Product differentiation with the entrywise matrix topology. -/ +theorem hasDerivAt_matrix_mul {A B : ℝ → Matrix ι ι ℂ} + {H K : Matrix ι ι ℂ} {t : ℝ} + (hA : HasDerivAt A H t) (hB : HasDerivAt B K t) : + HasDerivAt (fun s ↦ A s * B s) (H * B t + A t * K) t := by + apply hasDerivAt_pi.2 + intro i + apply hasDerivAt_pi.2 + intro j + have hh := HasDerivAt.sum (u := Finset.univ) (fun k _ ↦ + ((hasDerivAt_pi.1 (hasDerivAt_pi.1 hA i) k).mul + (hasDerivAt_pi.1 (hasDerivAt_pi.1 hB k) j))) + convert! hh using 1 + · ext s + simp [Matrix.mul_apply] + · simp [Matrix.mul_apply, Finset.sum_add_distrib] + +/-- The row replacement operation is affine. -/ +theorem hasDerivAt_updateRow {A : ℝ → Matrix ι ι ℂ} {H : Matrix ι ι ℂ} {t : ℝ} + (hA : HasDerivAt A H t) (i : ι) (x : ι → ℂ) : + HasDerivAt (fun s ↦ (A s).updateRow i x) (H.updateRow i 0) t := by + apply hasDerivAt_pi.2 + intro j + by_cases hj : j = i + · subst j + simpa using hasDerivAt_const t x + · simpa [Matrix.updateRow_ne hj] using hasDerivAt_pi.1 hA j + +/-- Polynomial differentiability of the adjugate, with no nonsingularity restriction. -/ +theorem differentiableAt_adjugate {A : ℝ → Matrix ι ι ℂ} {H : Matrix ι ι ℂ} {t : ℝ} + (hA : HasDerivAt A H t) : + DifferentiableAt ℝ (fun s ↦ (A s).adjugate) t := by + apply differentiableAt_pi.2 + intro i + apply differentiableAt_pi.2 + intro j + simpa only [Matrix.adjugate_apply] using + (hasDerivAt_det (hasDerivAt_updateRow hA j (Pi.single i 1))).differentiableAt + +/-- The full noncommutative derivative of matrix inversion. -/ +theorem hasDerivAt_matrix_inv {A : ℝ → Matrix ι ι ℂ} {H : Matrix ι ι ℂ} {t : ℝ} + (hA : HasDerivAt A H t) (hdet : (A t).det ≠ 0) : + HasDerivAt (fun s ↦ (A s)⁻¹) (-(A t)⁻¹ * H * (A t)⁻¹) t := by + have hd := (hasDerivAt_det hA).differentiableAt.inv hdet + have hi : DifferentiableAt ℝ (fun s ↦ (A s)⁻¹) t := by + convert! hd.smul (differentiableAt_adjugate hA) using 1 + ext s + simp only [Matrix.inv_def, Ring.inverse_eq_inv] + rfl + have hev := (hasDerivAt_det hA).continuousAt.eventually_ne hdet + have hc : HasDerivAt (fun s ↦ A s * (A s)⁻¹) 0 t := + (hasDerivAt_const t (1 : Matrix ι ι ℂ)).congr_of_eventuallyEq + (hev.mono fun s hs ↦ Matrix.mul_nonsing_inv _ (isUnit_iff_ne_zero.2 hs)) + have hh := (hasDerivAt_matrix_mul hA hi.hasDerivAt).unique hc + have he := congrArg (fun M ↦ (A t)⁻¹ * M) hh + simp only [Matrix.mul_add, ← Matrix.mul_assoc, Matrix.nonsing_inv_mul _ + (isUnit_iff_ne_zero.2 hdet), Matrix.one_mul, Matrix.mul_zero] at he + have hk := eq_neg_of_add_eq_zero_right he + convert! hi.hasDerivAt using 1 + simp only [hk, Matrix.neg_mul] + +/-- Logarithmic norm differentiation, without choosing a complex logarithm branch. -/ +theorem hasDerivAt_log_norm_of_mul {z : ℝ → ℂ} {w : ℂ} {t : ℝ} + (hz : HasDerivAt z (z t * w) t) (h0 : z t ≠ 0) : + HasDerivAt (fun s ↦ Real.log ‖z s‖) w.re t := by + have hr := Complex.reCLM.hasFDerivAt.comp_hasDerivAt t hz + have hi := Complex.imCLM.hasFDerivAt.comp_hasDerivAt t hz + change HasDerivAt (fun s ↦ (z s).re) (z t * w).re t at hr + change HasDerivAt (fun s ↦ (z s).im) (z t * w).im t at hi + have hq : HasDerivAt (fun s ↦ Complex.normSq (z s)) + (2 * Complex.normSq (z t) * w.re) t := by + convert! (hr.mul hr).add (hi.mul hi) using 1 + simp only [Complex.normSq_apply, Complex.mul_re, Complex.mul_im] + ring + have hn : Complex.normSq (z t) ≠ 0 := ne_of_gt (Complex.normSq_pos.2 h0) + have h := (hq.log hn).div_const 2 + convert! h using 1 + · ext s + rw [Complex.normSq_eq_norm_sq, Real.log_pow] + simp + · field_simp + +/-- Jacobi's formula for log absolute determinant, valid for every nonsingular complex matrix. -/ +theorem hasDerivAt_logNormDet {A : ℝ → Matrix ι ι ℂ} {H : Matrix ι ι ℂ} {t : ℝ} + (hA : HasDerivAt A H t) (hdet : (A t).det ≠ 0) : + HasDerivAt (fun s ↦ Real.log ‖(A s).det‖) (Matrix.trace (H * (A t)⁻¹)).re t := by + have ha : (A t).adjugate = (A t).det • (A t)⁻¹ := by + rw [Matrix.inv_def, Ring.inverse_eq_inv, smul_smul, mul_inv_cancel₀ hdet, one_smul] + have h := hasDerivAt_det hA + rw [ha, Matrix.mul_smul, Matrix.trace_smul] at h + exact hasDerivAt_log_norm_of_mul h hdet + +end GAD + + +open scoped BigOperators ComplexOrder MatrixOrder +open Matrix +namespace GAD +variable {ι : Type u_2} [Fintype ι] [DecidableEq ι] + +omit [DecidableEq ι] in +/-- Entrywise real trace bound, avoiding any norm convention for matrices. -/ +theorem trace_square_re_le (B : Matrix ι ι ℂ) : + (Matrix.trace (B * B)).re ≤ (Matrix.trace (B.conjTranspose * B)).re := by + have he (z w : ℂ) : 2 * (z * w).re ≤ Complex.normSq z + Complex.normSq w := by + simp only [Complex.mul_re, Complex.normSq_apply] + nlinarith [sq_nonneg (z.re - w.re), sq_nonneg (z.im + w.im)] + have hh := Finset.sum_le_sum (s := Finset.univ) (fun i _ ↦ + Finset.sum_le_sum (s := Finset.univ) (fun j _ ↦ he (B i j) (B j i))) + have hs : (∑ i, ∑ j, Complex.normSq (B i j)) = + ∑ i, ∑ j, Complex.normSq (B j i) := Finset.sum_comm + simp only [Finset.sum_add_distrib, ← Finset.mul_sum] at hh + rw [hs] at hh + have hb : (Matrix.trace (B.conjTranspose * B)).re = + ∑ i, ∑ j, Complex.normSq (B j i) := by + simp [Matrix.trace, Matrix.mul_apply, Complex.normSq_apply, + Complex.mul_re, Matrix.conjTranspose_apply, RCLike.star_def] + rw [hb] + simp only [Matrix.trace, Matrix.diag, Matrix.mul_apply, Complex.re_sum] + linarith + +/-- A skew-Hermitian perturbation of the identity is nonsingular. -/ +theorem skew_one_add_isUnit (K : Matrix ι ι ℂ) (hK : K.conjTranspose = -K) : + IsUnit (1 + K) := by + have he : (1 + K).conjTranspose * (1 + K) = 1 + K.conjTranspose * K := by + rw [Matrix.conjTranspose_add, Matrix.conjTranspose_one] + noncomm_ring [hK] + have hp : ((1 + K).conjTranspose * (1 + K)).PosDef := by + rw [he] + exact Matrix.PosDef.one.add_posSemidef (Matrix.posSemidef_conjTranspose_mul_self K) + have hd := hp.isUnit + rw [Matrix.isUnit_iff_isUnit_det, Matrix.det_mul] at hd + exact (Matrix.isUnit_iff_isUnit_det _).2 (isUnit_of_mul_isUnit_right hd) + +/-- The resolvent of a skew-Hermitian matrix is a contraction in quadratic-form order. -/ +theorem skew_resolvent_contraction (K : Matrix ι ι ℂ) (hK : K.conjTranspose = -K) : + (1 - ((1 + K)⁻¹).conjTranspose * (1 + K)⁻¹).PosSemidef := by + let R := (1 + K)⁻¹ + have hd : IsUnit (1 + K).det := + (Matrix.isUnit_iff_isUnit_det _).1 (skew_one_add_isUnit K hK) + have hR : (1 + K) * R = 1 := Matrix.mul_nonsing_inv _ hd + have hRt : R.conjTranspose * (1 + K).conjTranspose = 1 := by + simpa only [Matrix.conjTranspose_mul, Matrix.conjTranspose_one] using + congrArg Matrix.conjTranspose hR + have he : (1 + K).conjTranspose * (1 + K) = 1 + K.conjTranspose * K := by + rw [Matrix.conjTranspose_add, Matrix.conjTranspose_one] + noncomm_ring [hK] + have hh : R.conjTranspose * (1 + K.conjTranspose * K) * R = 1 := by + rw [← he, ← Matrix.mul_assoc, hRt, Matrix.one_mul, hR] + have hh' : 1 - R.conjTranspose * R = (K * R).conjTranspose * (K * R) := by + rw [Matrix.conjTranspose_mul] + rw [Matrix.mul_add, Matrix.mul_one, Matrix.add_mul] at hh + apply sub_eq_iff_eq_add.2 + rw [← hh] + noncomm_ring + change (1 - R.conjTranspose * R).PosSemidef + rw [hh'] + exact Matrix.posSemidef_conjTranspose_mul_self _ + + +theorem skew_resolvent_trace_bound (K L : Matrix ι ι ℂ) + (hK : K.conjTranspose = -K) (hL : L.IsHermitian) : + (Matrix.trace (((1 + K)⁻¹ * L) * ((1 + K)⁻¹ * L))).re ≤ + (Matrix.trace (L * L)).re := by + let R := (1 + K)⁻¹ + have hp := (skew_resolvent_contraction K hK).conjTranspose_mul_mul_same L + have ht := hp.trace_nonneg + have ht' := (Complex.nonneg_iff.mp ht).1 + have he : (L.conjTranspose * (1 - R.conjTranspose * R) * L).trace = + (L * L).trace - ((R * L).conjTranspose * (R * L)).trace := by + rw [Matrix.mul_sub, Matrix.mul_one, Matrix.sub_mul, Matrix.trace_sub, + Matrix.conjTranspose_mul, hL.eq] + simp only [Matrix.mul_assoc] + change 0 ≤ (Matrix.trace (L.conjTranspose * (1 - R.conjTranspose * R) * L)).re at ht' + rw [he, Complex.sub_re] at ht' + exact (trace_square_re_le (R * L)).trans (sub_nonneg.1 ht') + +/-- The Hessian bound at an arbitrary positive definite base point. -/ +theorem skew_shift_trace_bound (D Z H : Matrix ι ι ℂ) + (hD : D.PosDef) (hZ : Z.conjTranspose = -Z) (hH : H.IsHermitian) : + IsUnit (D + Z) ∧ + (Matrix.trace (((D + Z)⁻¹ * H) * ((D + Z)⁻¹ * H))).re ≤ + (Matrix.trace ((D⁻¹ * H) * (D⁻¹ * H))).re := by + let S := CFC.sqrt D + have hS : S * S = D := CFC.sqrt_mul_sqrt_self D hD.posSemidef.nonneg + have hSu : IsUnit S := isUnit_of_mul_isUnit_left (hS.symm ▸ hD.isUnit) + have hSd : IsUnit S.det := (Matrix.isUnit_iff_isUnit_det _).1 hSu + have hSh : S.IsHermitian := (CFC.sqrt_nonneg D).posSemidef.isHermitian + let W := S⁻¹ + have hW : W.IsHermitian := hSh.inv + have hSW : S * W = 1 := Matrix.mul_nonsing_inv _ hSd + have hWS : W * S = 1 := Matrix.nonsing_inv_mul _ hSd + let K := W * Z * W + have hK : K.conjTranspose = -K := by + dsimp [K] + rw [Matrix.conjTranspose_mul, Matrix.conjTranspose_mul, hW.eq, hZ] + simp only [Matrix.mul_neg, Matrix.neg_mul, Matrix.mul_assoc] + have hC : D + Z = S * (1 + K) * S := by + dsimp [K] + rw [Matrix.mul_add, Matrix.add_mul, Matrix.mul_one, hS] + congr 1 + simp only [← Matrix.mul_assoc, hSW, Matrix.one_mul] + simp only [Matrix.mul_assoc, hWS, Matrix.mul_one] + have hCu : IsUnit (D + Z) := by + rw [hC] + exact (hSu.mul (skew_one_add_isUnit K hK)).mul hSu + refine ⟨hCu, ?_⟩ + let R := (1 + K)⁻¹ + have hCi : (D + Z)⁻¹ = W * R * W := by + rw [hC, Matrix.mul_inv_rev, Matrix.mul_inv_rev] + exact (Matrix.mul_assoc _ _ _).symm + have hDi : D⁻¹ = W * W := by rw [← hS, Matrix.mul_inv_rev] + let L := W * H * W + have hL : L.IsHermitian := by + simpa only [hW.eq] using Matrix.isHermitian_conjTranspose_mul_mul W hH + have heC : Matrix.trace (((D + Z)⁻¹ * H) * ((D + Z)⁻¹ * H)) = + Matrix.trace ((R * L) * (R * L)) := by + rw [hCi] + dsimp [L] + simpa only [Matrix.mul_assoc] using + Matrix.trace_mul_comm W (R * W * H * W * R * W * H) + have heD : Matrix.trace ((D⁻¹ * H) * (D⁻¹ * H)) = Matrix.trace (L * L) := by + rw [hDi] + dsimp [L] + simpa only [Matrix.mul_assoc] using Matrix.trace_mul_comm W (W * H * W * W * H) + rw [heC, heD] + exact skew_resolvent_trace_bound K L hK hL + +end GAD + +end + +end OAI diff --git a/lean/OAI/InformationTheory/AmplitudeDamping/Model.lean b/lean/OAI/InformationTheory/AmplitudeDamping/Model.lean new file mode 100644 index 0000000000000000000000000000000000000000..eaf20ecc977d7fdf95d82d2189b0bab5e0840c6a --- /dev/null +++ b/lean/OAI/InformationTheory/AmplitudeDamping/Model.lean @@ -0,0 +1,116 @@ +import Mathlib + +namespace OAI + +universe u + +noncomputable section +open scoped BigOperators ComplexOrder +open Matrix Filter + +namespace GAD + +abbrev Basis (n : ℕ) := Fin n → Fin 2 +abbrev QMatrix (n : ℕ) := Matrix (Basis n) (Basis n) ℂ + +/-- The spectral definition of -Tr(P log P), with 0 log 0 = 0. -/ +def entropy {ι : Type u} [Fintype ι] [DecidableEq ι] (P : Matrix ι ι ℂ) : ℝ := + (Matrix.trace (cfc Real.negMulLog P)).re + +def IsState {ι : Type u} [Fintype ι] [DecidableEq ι] (P : Matrix ι ι ℂ) : Prop := + P.PosSemidef ∧ Matrix.trace P = 1 + + +def kraus (γ ν : ℝ) (r : Fin 4) : Matrix (Fin 2) (Fin 2) ℂ := + if r = 0 then + !![(Real.sqrt (1 - ν) : ℂ), 0; + 0, (Real.sqrt (1 - ν) * Real.sqrt (1 - γ) : ℂ)] + else if r = 1 then + !![0, (Real.sqrt (γ * (1 - ν)) : ℂ); 0, 0] + else if r = 2 then + !![(Real.sqrt ν * Real.sqrt (1 - γ) : ℂ), 0; 0, (Real.sqrt ν : ℂ)] + else + !![0, 0; (Real.sqrt (γ * ν) : ℂ), 0] + +/-- Tensor products of the single-site Kraus operators, with the full Kraus index. -/ +def tensorKraus (γ ν : ℝ) (n : ℕ) (r : Fin n → Fin 4) : QMatrix n := + fun i j ↦ ∏ k, kraus γ ν (r k) (i k) (j k) + +/-- The memoryless n-fold generalized amplitude-damping channel. -/ +def channel (γ ν : ℝ) (n : ℕ) (P : QMatrix n) : QMatrix n := + ∑ r : Fin n → Fin 4, + tensorKraus γ ν n r * P * (tensorKraus γ ν n r).conjTranspose + +/-- All finite ensembles, without any product or purity restriction. -/ +structure Ensemble (n : ℕ) where + size : ℕ + weight : Fin size → ℝ + weight_nonneg : ∀ a, 0 ≤ weight a + weight_sum : ∑ a, weight a = 1 + signal : Fin size → QMatrix n + signal_state : ∀ a, IsState (signal a) + +def ensembleValue (γ ν : ℝ) {n : ℕ} (E : Ensemble n) : ℝ := + (entropy (∑ a, (E.weight a : ℂ) • channel γ ν n (E.signal a)) - + ∑ a, E.weight a * entropy (channel γ ν n (E.signal a))) / Real.log 2 + + +def holevo (γ ν : ℝ) (n : ℕ) : ℝ := + sSup (Set.range (ensembleValue γ ν : Ensemble n → ℝ)) + +/-- An unrestricted n-use quantum code with one collective output POVM. -/ +structure Code (n : ℕ) where + messages : ℕ + messages_pos : 0 < messages + encoding : Fin messages → QMatrix n + encoding_state : ∀ a, IsState (encoding a) + decoding : Fin messages → QMatrix n + decoding_pos : ∀ a, (decoding a).PosSemidef + decoding_sum : ∑ a, decoding a = 1 + +def averageError (γ ν : ℝ) {n : ℕ} (C : Code n) : ℝ := + 1 - (∑ a, (Matrix.trace (C.decoding a * channel γ ν n (C.encoding a))).re) / + (C.messages : ℝ) + +/-- The liminf rate condition written as its eventual lower-bound characterization. +There is no preshared entanglement, feedback, or restriction on encodings/decoding. -/ +def Achievable (γ ν R : ℝ) : Prop := + ∃ C : (n : ℕ) → Code n, + Tendsto (fun n ↦ averageError γ ν (C n)) atTop (nhds 0) ∧ + ∀ ε : ℝ, 0 < ε → ∀ᶠ n : ℕ in atTop, + R - ε ≤ Real.log ((C n).messages : ℝ) / Real.log 2 / (n : ℝ) + +/-- Operational unassisted classical capacity, not a definition by regularization. -/ +def capacity (γ ν : ℝ) : ℝ := sSup {R : ℝ | Achievable γ ν R} + +def g (u : ℝ) : ℝ := Real.binEntropy ((1 + Real.sqrt (1 - 4 * u)) / 2) + +def v (γ ν p : ℝ) : ℝ := γ * ν * (1 - ν) + γ * (1 - γ) * (p - ν) ^ 2 + +def objective (γ ν p : ℝ) : ℝ := + Real.binEntropy ((1 - γ) * p + γ * ν) - g (v γ ν p) + +def Maximizes (γ ν p : ℝ) : Prop := + p ∈ Set.Icc (0 : ℝ) 1 ∧ ∀ q ∈ Set.Icc (0 : ℝ) 1, objective γ ν q ≤ objective γ ν p + + +def phaseSignal (p : ℝ) (s b : Fin 2) : ℂ := + if b = 0 then (Real.sqrt (1 - p) : ℂ) + else if s = 0 then (Real.sqrt p : ℂ) else -(Real.sqrt p : ℂ) + +def phaseProduct (p : ℝ) {n : ℕ} (s : Basis n) (i : Basis n) : ℂ := + ∏ k, phaseSignal p (s k) (i k) + +def phaseState (p : ℝ) {n : ℕ} (s : Basis n) : QMatrix n := + fun i j ↦ phaseProduct p s i * star (phaseProduct p s j) + +/-- Holevo value of the explicit 2^n equiprobable product signals. -/ +def phaseValue (γ ν p : ℝ) (n : ℕ) : ℝ := + (entropy (∑ s : Basis n, (((2 : ℝ) ^ n)⁻¹ : ℂ) • channel γ ν n (phaseState p s)) - + ∑ s : Basis n, ((2 : ℝ) ^ n)⁻¹ * entropy (channel γ ν n (phaseState p s))) / + Real.log 2 + +end GAD +end + +end OAI diff --git a/lean/OAI/InformationTheory/AmplitudeDamping/Naimark.lean b/lean/OAI/InformationTheory/AmplitudeDamping/Naimark.lean new file mode 100644 index 0000000000000000000000000000000000000000..8ad522874bfdb371f0bfc287ab2a383ae6b6b1a6 --- /dev/null +++ b/lean/OAI/InformationTheory/AmplitudeDamping/Naimark.lean @@ -0,0 +1,146 @@ +import OAI.InformationTheory.AmplitudeDamping.BlockFactors + +namespace OAI + +noncomputable section + +universe u_1 u_2 u_3 u_4 u_5 + +section +open scoped BigOperators ComplexOrder MatrixOrder +open Matrix +namespace GAD +variable {ι : Type u_1} {μ : Type u_2} [Fintype ι] [Fintype μ] [DecidableEq ι] [DecidableEq μ] + +def naimark (D : μ → Matrix ι ι ℂ) (hD : ∀ m, (D m).PosSemidef) : Matrix (ι × μ) ι ℂ := + fun im j ↦ star (spectralFactor (hD im.2) j im.1) + +omit [DecidableEq μ] in +theorem naimark_isometry (D : μ → Matrix ι ι ℂ) (hD : ∀ m, (D m).PosSemidef) + (hDs : ∑ m, D m=1) : (naimark D hD)ᴴ*naimark D hD=1 := by + rw [← hDs] + ext i j + simp only [Matrix.mul_apply,Fintype.sum_prod_type,Matrix.conjTranspose_apply,naimark,star_star, + Matrix.sum_apply] + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro m _ + exact congrArg (fun A : Matrix ι ι ℂ ↦ A i j) (spectralFactor_gram (hD m)) + +theorem naimark_block (D : μ → Matrix ι ι ℂ) (hD : ∀ m, (D m).PosSemidef) + (X : Matrix ι ι ℂ) (m : μ) : + blockProjection (ι := ι) m*(naimark D hD*X)= + blockInjection (ι := ι) m*((spectralFactor (hD m))ᴴ*X) := by + ext im j + rw [blockProjection_mul,blockInjection_mul] + split_ifs with h + · simp only [Matrix.mul_apply,naimark,h,Matrix.conjTranspose_apply] + · rfl + +theorem naimark_success (D : μ → Matrix ι ι ℂ) (hD : ∀ m, (D m).PosSemidef) + (X : Matrix ι ι ℂ) (m : μ) : + mass (blockProjection (ι := ι) m*(naimark D hD*X))=(D m*gram X).trace.re := by + rw [naimark_block,mass_isometry _ (blockInjection_isometry m)] + dsimp only [mass,gram] + rw [Matrix.conjTranspose_mul,Matrix.conjTranspose_conjTranspose,Matrix.trace_mul_cycle] + have hF : spectralFactor (hD m)*(spectralFactor (hD m))ᴴ=D m := spectralFactor_gram (hD m) + rw [Matrix.mul_assoc Xᴴ (spectralFactor (hD m)) _,hF,Matrix.trace_mul_cycle,Matrix.trace_mul_comm (X*Xᴴ)] + +theorem blockProjection_injection (m : μ) (X : Matrix ι ι ℂ) : + blockProjection (ι := ι) m*(blockInjection (ι := ι) m*X)=blockInjection (ι := ι) m*X := by + ext im j + rw [blockProjection_mul,blockInjection_mul] + split_ifs <;> rfl + +/-- Approximate orthogonalization of well decoded states in a Naimark dilation. -/ +theorem exists_orthogonal_factors (A D : μ → Matrix ι ι ℂ) + (hA : ∀ m, IsState (A m)) (hD : ∀ m, (D m).PosSemidef) (hDs : ∑ m, D m=1) : + ∃ Y : μ → Matrix (ι × μ) ι ℂ, + (∀ m, mass (Y m)=1) ∧ (∀ m, blockProjection (ι := ι) m*Y m=Y m) ∧ + (∀ m, mass (naimark D hD*spectralFactor (hA m).1-Y m) ≤ 2*(1-(D m*A m).trace.re)) := by + have hm (m : μ) : mass (spectralFactor (hA m).1)=1 := by + dsimp [mass] + rw [spectralFactor_gram,(hA m).2,Complex.one_re] + have hy (m : μ) := exists_projected_factor (blockProjection_isProjection m) + (naimark D hD*spectralFactor (hA m).1) (blockInjection (ι := ι) m*spectralFactor (hA m).1) + (by rw [mass_isometry _ (naimark_isometry D hD hDs),hm]) + (by rw [mass_isometry _ (blockInjection_isometry m),hm]) + (blockProjection_injection m _) + choose Y hY hPY hd using hy + refine ⟨Y,hY,hPY,fun m ↦ ?_⟩ + simpa only [naimark_success,spectralFactor_gram] using hd m + +end GAD + +end + +open scoped BigOperators ComplexOrder MatrixOrder +open Matrix +namespace GAD +variable {ι : Type u_3} {κ : Type u_4} {μ : Type u_5} [Fintype ι] [Fintype κ] [Fintype μ] + +def concatenate (w : μ → ℝ) (X : μ → Matrix ι κ ℂ) : Matrix ι (μ × κ) ℂ := + fun i mk ↦ (Real.sqrt (w mk.1):ℂ)*X mk.1 i mk.2 + +omit [Fintype ι] in +theorem gram_concatenate (w : μ → ℝ) (X : μ → Matrix ι κ ℂ) (hw : ∀ m, 0 ≤ w m) : + gram (concatenate w X)=∑ m, w m • gram (X m) := by + ext i j + simp only [gram,Matrix.mul_apply,Matrix.conjTranspose_apply,concatenate, + Fintype.sum_prod_type,Matrix.sum_apply,Matrix.smul_apply,Complex.real_smul, + star_mul,Complex.star_def,Complex.conj_ofReal,Finset.mul_sum] + apply Finset.sum_congr rfl + intro m _ + apply Finset.sum_congr rfl + intro k _ + have hs : (Real.sqrt (w m):ℂ)^2=(w m:ℂ) := by exact_mod_cast Real.sq_sqrt (hw m) + linear_combination X m i k*(starRingEnd ℂ) (X m j k)*hs + +theorem mass_concatenate (w : μ → ℝ) (X : μ → Matrix ι κ ℂ) (hw : ∀ m, 0 ≤ w m) : + mass (concatenate w X)=∑ m, w m*mass (X m) := by + simp only [mass,gram_concatenate w X hw,Matrix.trace_sum,Matrix.trace_smul, + Complex.re_sum,Complex.real_smul,Complex.mul_re,Complex.ofReal_re,Complex.ofReal_im, + zero_mul,sub_zero] + +omit [Fintype ι] [Fintype κ] [Fintype μ] in +theorem concatenate_sub (w : μ → ℝ) (X Y : μ → Matrix ι κ ℂ) : + concatenate w X-concatenate w Y=concatenate w (fun m ↦ X m-Y m) := by + ext i mk + simp [concatenate,mul_sub] + +theorem concatenate_mass_one (w : μ → ℝ) (X : μ → Matrix ι κ ℂ) + (hw : ∀ m, 0 ≤ w m) (hws : ∑ m, w m=1) (hX : ∀ m, mass (X m)=1) : + mass (concatenate w X)=1 := by + rw [mass_concatenate w X hw] + simp only [hX,mul_one,hws] + +variable [DecidableEq ι] [DecidableEq κ] [DecidableEq μ] + +theorem orthogonal_factor_entropy (w : μ → ℝ) (Y : μ → Matrix (ι × μ) κ ℂ) + (hY : ∀ m, mass (Y m)=1) (hPY : ∀ m, blockProjection (ι := ι) m*Y m=Y m) : + entropy (∑ m, w m • gram (Y m))= + ∑ m, (w m*entropy (gram (Y m))+Real.negMulLog (w m)) := by + let Z : μ → Matrix ι κ ℂ := fun m i k ↦ Y m (i,m) k + have hZ (m : μ) : blockInjection (ι := ι) m*Z m=Y m := blockProjection_range (hPY m) + have hmZ (m : μ) : mass (Z m)=1 := by + rw [← mass_isometry _ (blockInjection_isometry m),hZ,hY] + have he : (∑ m, w m • gram (Y m))=Matrix.blockDiagonal (fun m ↦ w m • gram (Z m)) := by + ext ia jb + simp only [Matrix.sum_apply,Matrix.smul_apply,← hZ,gram_blockInjection,Matrix.blockDiagonal_apply] + by_cases h : ia.2=jb.2 + · simp only [h,and_self] + simp + · have hf (m : μ) : ¬(ia.2=m ∧ jb.2=m) := by intro hm; exact h (hm.1.trans hm.2.symm) + simp [hf,h] + rw [he,entropy_blockDiagonal _ (fun m ↦ (gram_posSemidef (Z m)).isHermitian.smul (IsSelfAdjoint.all (w m)))] + apply Finset.sum_congr rfl + intro m _ + rw [entropy_smul _ (gram_posSemidef (Z m)).isHermitian,gram_trace,hmZ] + simp only [Complex.ofReal_one,Complex.one_re,mul_one] + rw [← hZ,block_factor_entropy] + +end GAD + +end + +end OAI diff --git a/lean/OAI/InformationTheory/AmplitudeDamping/OutputConvexity.lean b/lean/OAI/InformationTheory/AmplitudeDamping/OutputConvexity.lean new file mode 100644 index 0000000000000000000000000000000000000000..e7ad38babd9673e84bfd63a6d834e6ccdda1a8ff --- /dev/null +++ b/lean/OAI/InformationTheory/AmplitudeDamping/OutputConvexity.lean @@ -0,0 +1,251 @@ +import OAI.InformationTheory.AmplitudeDamping.ThermalEntropy + +namespace OAI + +noncomputable section +open scoped BigOperators Matrix.Norms.Elementwise +open Matrix +open scoped BigOperators ComplexOrder MatrixOrder +open scoped Matrix.Norms.Elementwise ComplexOrder MatrixOrder +open Matrix Set +open scoped ComplexOrder MatrixOrder +open scoped BigOperators Topology +open Filter Set +open scoped BigOperators ComplexOrder MatrixOrder Topology +open scoped BigOperators ComplexOrder + +open scoped BigOperators +open Set Filter Topology + +namespace GAD + +def radius (s : ℝ) : ℝ := Real.sqrt (1 - 4 * s ^ 2) +def logRatio (t : ℝ) : ℝ := Real.log (1 + t) - Real.log (1 - t) +def wootters (s : ℝ) : ℝ := g (s ^ 2) +def woottersSlope (s : ℝ) : ℝ := 2 * s / radius s * logRatio (radius s) + +theorem continuous_g : Continuous g := by + unfold g + fun_prop + +theorem continuous_wootters : Continuous wootters := by + unfold wootters + exact continuous_g.comp (continuous_id.pow 2) + +theorem radius_pos_lt_one {s : ℝ} (hs : s ∈ Ioo (0 : ℝ) (1 / 2)) : + 0 < radius s ∧ radius s < 1 := by + have hx : 0 < 1 - 4 * s ^ 2 := by nlinarith [hs.1, hs.2] + have hx' : 1 - 4 * s ^ 2 < 1 := by nlinarith [hs.1] + unfold radius + exact ⟨Real.sqrt_pos.2 hx, (Real.sqrt_lt' (by norm_num)).2 (by simpa using hx')⟩ + +theorem radius_sq {s : ℝ} (hs : s ∈ Icc (0 : ℝ) (1 / 2)) : + radius s ^ 2 = 1 - 4 * s ^ 2 := by + apply Real.sq_sqrt + nlinarith [hs.1, hs.2] + +theorem logRatio_lower {t : ℝ} (ht0 : 0 ≤ t) (ht1 : t < 1) : + 2 * t ≤ logRatio t := by + have h := Real.sum_range_le_log_div ht0 ht1 1 + norm_num at h + have hplus : 1 + t ≠ 0 := by linarith + have hminus : 1 - t ≠ 0 := by linarith + rw [Real.log_div hplus hminus] at h + unfold logRatio + linarith + +theorem hasDerivAt_radius {s : ℝ} (hs : s ∈ Ioo (0 : ℝ) (1 / 2)) : + HasDerivAt radius (-4 * s / radius s) s := by + have hx : 1 - 4 * s ^ 2 ≠ 0 := by nlinarith [hs.1, hs.2] + have hd := (Real.hasDerivAt_sqrt hx).comp s + ((hasDerivAt_const s (1 : ℝ)).sub (((hasDerivAt_id s).pow 2).const_mul 4)) + convert! hd using 1 + simp [radius] + ring + +theorem binEntropy_derivative_radius {s : ℝ} (hs : s ∈ Ioo (0 : ℝ) (1 / 2)) : + Real.log (1 - (1 + radius s) / 2) - Real.log ((1 + radius s) / 2) = + -logRatio (radius s) := by + have ht := radius_pos_lt_one hs + have hm : 1 - radius s ≠ 0 := by linarith + have hp : 1 + radius s ≠ 0 := by linarith + rw [show 1 - (1 + radius s) / 2 = (1 - radius s) / 2 by ring, + Real.log_div hm (by norm_num), Real.log_div hp (by norm_num)] + unfold logRatio + ring + +theorem hasDerivAt_wootters {s : ℝ} (hs : s ∈ Ioo (0 : ℝ) (1 / 2)) : + HasDerivAt wootters (woottersSlope s) s := by + have ht := radius_pos_lt_one hs + have hx0 : (1 + radius s) / 2 ≠ 0 := by linarith + have hx1 : (1 + radius s) / 2 ≠ 1 := by linarith + have hd := (Real.hasDerivAt_binEntropy hx0 hx1).comp s + (((hasDerivAt_const s (1 : ℝ)).add (hasDerivAt_radius hs)).div_const 2) + rw [binEntropy_derivative_radius hs] at hd + convert! hd using 1 + unfold woottersSlope + ring + +theorem hasDerivAt_logRatio {t : ℝ} (ht0 : -1 < t) (ht1 : t < 1) : + HasDerivAt logRatio (2 / (1 - t ^ 2)) t := by + have hp : 1 + t ≠ 0 := by linarith + have hm : 1 - t ≠ 0 := by linarith + have hd := (((hasDerivAt_const t (1 : ℝ)).add (hasDerivAt_id t)).log hp).sub + (((hasDerivAt_const t (1 : ℝ)).sub (hasDerivAt_id t)).log hm) + convert! hd using 1 + simp only [Pi.add_apply, Pi.sub_apply, id_eq, zero_add, zero_sub, neg_div] + have he : 1 - t ^ 2 = (1 + t) * (1 - t) := by ring + rw [he] + field_simp + ring + +theorem hasDerivAt_woottersSlope {s : ℝ} (hs : s ∈ Ioo (0 : ℝ) (1 / 2)) : + HasDerivAt woottersSlope + (2 * (logRatio (radius s) - 2 * radius s) / radius s ^ 3) s := by + have ht := radius_pos_lt_one hs + have ht0 : radius s ≠ 0 := ne_of_gt ht.1 + have hs0 : s ≠ 0 := ne_of_gt hs.1 + have ht2 : 1 - radius s ^ 2 = 4 * s ^ 2 := by + nlinarith [radius_sq ⟨hs.1.le, hs.2.le⟩] + have hd := (((hasDerivAt_id s).const_mul 2).div (hasDerivAt_radius hs) ht0).mul + ((hasDerivAt_logRatio (by linarith [ht.1]) ht.2).comp s (hasDerivAt_radius hs)) + convert! hd using 1 + simp only [Pi.div_apply, Function.comp_apply, id_eq, mul_one, ht2] + field_simp + have he : radius s ^ 2 + 4 * s ^ 2 - 1 = 0 := by linarith + linear_combination -logRatio (radius s) * he + +theorem deriv_wootters {s : ℝ} (hs : s ∈ Ioo (0 : ℝ) (1 / 2)) : + deriv wootters s = woottersSlope s := (hasDerivAt_wootters hs).deriv + +theorem deriv2_wootters {s : ℝ} (hs : s ∈ Ioo (0 : ℝ) (1 / 2)) : + deriv^[2] wootters s = + 2 * (logRatio (radius s) - 2 * radius s) / radius s ^ 3 := by + have he : deriv wootters =ᶠ[𝓝 s] woottersSlope := by + filter_upwards [isOpen_Ioo.mem_nhds hs] with x hx + exact deriv_wootters hx + exact he.deriv_eq.trans (hasDerivAt_woottersSlope hs).deriv + +theorem convexOn_wootters : ConvexOn ℝ (Icc (0 : ℝ) (1 / 2)) wootters := by + apply convexOn_of_deriv2_nonneg (convex_Icc _ _) continuous_wootters.continuousOn + · intro s hs + rw [interior_Icc] at hs + exact (hasDerivAt_wootters hs).differentiableAt.differentiableWithinAt + · intro s hs + rw [interior_Icc] at hs + have he : deriv wootters =ᶠ[𝓝 s] woottersSlope := by + filter_upwards [isOpen_Ioo.mem_nhds hs] with x hx + exact deriv_wootters hx + exact ((hasDerivAt_woottersSlope hs).differentiableAt.congr_of_eventuallyEq he).differentiableWithinAt + · intro s hs + rw [interior_Icc] at hs + rw [deriv2_wootters hs] + have ht := radius_pos_lt_one hs + exact div_nonneg (mul_nonneg (by norm_num) (sub_nonneg.2 (logRatio_lower ht.1.le ht.2))) + (pow_nonneg ht.1.le _) + +theorem monotoneOn_wootters : MonotoneOn wootters (Icc (0 : ℝ) (1 / 2)) := by + apply monotoneOn_of_hasDerivWithinAt_nonneg (convex_Icc _ _) + continuous_wootters.continuousOn + · intro s hs + rw [interior_Icc] at hs + exact (hasDerivAt_wootters hs).hasDerivWithinAt + · intro s hs + rw [interior_Icc] at hs + have ht := radius_pos_lt_one hs + unfold woottersSlope + exact mul_nonneg (div_nonneg (mul_nonneg (by norm_num) hs.1.le) ht.1.le) + (le_trans (mul_nonneg (by norm_num) ht.1.le) (logRatio_lower ht.1.le ht.2)) + +theorem v_nonneg {γ ν : ℝ} (hγ : γ ∈ Icc (0 : ℝ) 1) + (hν : ν ∈ Icc (0 : ℝ) 1) (p : ℝ) : 0 ≤ v γ ν p := by + unfold v + exact add_nonneg (mul_nonneg (mul_nonneg hγ.1 hν.1) (sub_nonneg.2 hν.2)) + (mul_nonneg (mul_nonneg hγ.1 (sub_nonneg.2 hγ.2)) (sq_nonneg _)) + +theorem v_population_form (γ ν p : ℝ) : + v γ ν p = ((1 - γ) * p + γ * ν) * (1 - ((1 - γ) * p + γ * ν)) - + (1 - γ) * p * (1 - p) := by + unfold v + ring + +theorem v_le_quarter {γ ν : ℝ} (hγ : γ ∈ Icc (0 : ℝ) 1) + (_hν : ν ∈ Icc (0 : ℝ) 1) {p : ℝ} (hp : p ∈ Icc (0 : ℝ) 1) : + v γ ν p ≤ 1 / 4 := by + rw [v_population_form] + have hsub : 0 ≤ (1 - γ) * p * (1 - p) := + mul_nonneg (mul_nonneg (sub_nonneg.2 hγ.2) hp.1) (sub_nonneg.2 hp.2) + nlinarith [sq_nonneg (((1 - γ) * p + γ * ν) - 1 / 2)] + +theorem sqrt_v_mem {γ ν : ℝ} (hγ : γ ∈ Icc (0 : ℝ) 1) + (hν : ν ∈ Icc (0 : ℝ) 1) {p : ℝ} (hp : p ∈ Icc (0 : ℝ) 1) : + Real.sqrt (v γ ν p) ∈ Icc (0 : ℝ) (1 / 2) := by + refine ⟨Real.sqrt_nonneg _, (Real.sqrt_le_left (by norm_num)).2 ?_⟩ + convert v_le_quarter hγ hν hp using 1 + norm_num + +theorem convexOn_sqrt_v {γ ν : ℝ} (hγ : γ ∈ Icc (0 : ℝ) 1) + (hν : ν ∈ Icc (0 : ℝ) 1) : + ConvexOn ℝ (Icc (0 : ℝ) 1) (fun p ↦ Real.sqrt (v γ ν p)) := by + let z : ℝ → ℂ := fun p ↦ ⟨Real.sqrt (γ * ν * (1 - ν)), + Real.sqrt (γ * (1 - γ)) * (p - ν)⟩ + have hA : 0 ≤ γ * ν * (1 - ν) := + mul_nonneg (mul_nonneg hγ.1 hν.1) (sub_nonneg.2 hν.2) + have hB : 0 ≤ γ * (1 - γ) := mul_nonneg hγ.1 (sub_nonneg.2 hγ.2) + have hz (p : ℝ) : ‖z p‖ = Real.sqrt (v γ ν p) := by + rw [Complex.norm_def] + congr 1 + dsimp [z] + calc + _ = Real.sqrt (γ * ν * (1 - ν)) ^ 2 + + Real.sqrt (γ * (1 - γ)) ^ 2 * (p - ν) ^ 2 := by ring + _ = v γ ν p := by rw [Real.sq_sqrt hA, Real.sq_sqrt hB]; rfl + refine ⟨convex_Icc _ _, ?_⟩ + intro x hx y hy a b ha hb hab + change Real.sqrt (v γ ν (a * x + b * y)) ≤ + a * Real.sqrt (v γ ν x) + b * Real.sqrt (v γ ν y) + rw [← hz, ← hz, ← hz] + have he : z (a * x + b * y) = a • z x + b • z y := by + have hb' : b = 1 - a := by linarith + rw [hb'] + apply Complex.ext <;> simp [z] <;> ring + rw [he] + calc + _ ≤ ‖a • z x‖ + ‖b • z y‖ := norm_add_le _ _ + _ = _ := by rw [norm_smul, norm_smul, Real.norm_eq_abs, Real.norm_eq_abs, + abs_of_nonneg ha, abs_of_nonneg hb] + +theorem wootters_sqrt {u : ℝ} (hu : 0 ≤ u) : wootters (Real.sqrt u) = g u := by + unfold wootters + rw [Real.sq_sqrt hu] + + +theorem convexOn_output_entropy {γ ν : ℝ} (hγ : γ ∈ Icc (0 : ℝ) 1) + (hν : ν ∈ Icc (0 : ℝ) 1) : + ConvexOn ℝ (Icc (0 : ℝ) 1) (fun p ↦ g (v γ ν p)) := by + refine ⟨convex_Icc _ _, ?_⟩ + intro x hx y hy a b ha hb hab + have hxy := (convex_Icc (0 : ℝ) 1) hx hy ha hb hab + have hx' := sqrt_v_mem hγ hν hx + have hy' := sqrt_v_mem hγ hν hy + have hxy' := sqrt_v_mem hγ hν hxy + have hc := (convex_Icc (0 : ℝ) (1 / 2)) hx' hy' ha hb hab + have hm := monotoneOn_wootters hxy' hc ((convexOn_sqrt_v hγ hν).2 hx hy ha hb hab) + have hh := hm.trans (convexOn_wootters.2 hx' hy' ha hb hab) + simpa only [wootters_sqrt (v_nonneg hγ hν _)] using hh + +theorem continuous_objective (γ ν : ℝ) : Continuous (objective γ ν) := by + unfold objective v + exact (Real.binEntropy_continuous.comp (by fun_prop)).sub + (continuous_g.comp (by fun_prop)) + +/-- Existence of the genuine scalar maximum rather than a supremum surrogate. -/ +theorem exists_maximizer (γ ν : ℝ) : + ∃ p ∈ Icc (0 : ℝ) 1, ∀ q ∈ Icc (0 : ℝ) 1, objective γ ν q ≤ objective γ ν p := by + exact isCompact_Icc.exists_isMaxOn (by norm_num) (continuous_objective γ ν).continuousOn + +end GAD + +end + +end OAI diff --git a/lean/OAI/InformationTheory/AmplitudeDamping/OutputEntropy.lean b/lean/OAI/InformationTheory/AmplitudeDamping/OutputEntropy.lean new file mode 100644 index 0000000000000000000000000000000000000000..2151838fdc261428f7ac4f3ce8ccd756cf45b96e --- /dev/null +++ b/lean/OAI/InformationTheory/AmplitudeDamping/OutputEntropy.lean @@ -0,0 +1,202 @@ +import OAI.InformationTheory.AmplitudeDamping.HolevoInformation + +namespace OAI + +noncomputable section + +universe u_1 u_2 u_3 + +section +open scoped BigOperators ComplexOrder MatrixOrder +open Matrix +namespace GAD + +/-- The population-dependent lower bound for every pure input, including entangled inputs. -/ +theorem pure_output_entropy_bound (γ ν : ℝ) (hγ : γ ∈ Set.Icc (0:ℝ) 1) + (hν : ν ∈ Set.Icc (0:ℝ) 1) (n : ℕ) (ψ : Basis n → ℂ) + (hψ : vecMass ψ = 1) : + ∑ j, g (v γ ν (population ψ j)) ≤ entropy (channel γ ν n (pure ψ)) := by + induction n with + | zero => + simpa using entropy_nonneg (channel_state γ ν hγ hν 0 (pure_state hψ)) + | succ n ih => + let x := vecMass (branch ψ 0) + let y := vecMass (branch ψ 1) + let ψ₀ := normalize (branch ψ 0) + let ψ₁ := normalize (branch ψ 1) + have hx : 0 ≤ x := vecMass_nonneg _ + have hy : 0 ≤ y := vecMass_nonneg _ + have hxy : x+y=1 := (vecMass_branches ψ).symm.trans hψ + have h₀ := ih ψ₀ (normalize_mass _) + have h₁ := ih ψ₁ (normalize_mass _) + have hpop (j : Fin n) : population ψ j.succ = x*population ψ₀ j+y*population ψ₁ j := by + rw [population_succ,population_normalize (branch ψ 0),population_normalize (branch ψ 1)] + have hj (j : Fin n) : g (v γ ν (population ψ j.succ)) ≤ + x*g (v γ ν (population ψ₀ j))+y*g (v γ ν (population ψ₁ j)) := by + rw [hpop] + exact (convexOn_output_entropy hγ hν).2 + (population_mem (normalize_mass _) j) (population_mem (normalize_mass _) j) hx hy hxy + calc + ∑ j, g (v γ ν (population ψ j)) = + g (v γ ν (population ψ 0))+∑ j : Fin n, g (v γ ν (population ψ j.succ)) := + Fin.sum_univ_succ _ + _ ≤ g (v γ ν (population ψ 0))+ + ∑ j : Fin n, (x*g (v γ ν (population ψ₀ j))+y*g (v γ ν (population ψ₁ j))) := + add_le_add le_rfl (Finset.sum_le_sum (fun j _ ↦ hj j)) + _ = g (v γ ν (population ψ 0))+ + (x*(∑ j, g (v γ ν (population ψ₀ j)))+y*(∑ j, g (v γ ν (population ψ₁ j)))) := by + rw [Finset.sum_add_distrib,← Finset.mul_sum,← Finset.mul_sum] + _ ≤ g (v γ ν (population ψ 0))+ + (x*entropy (channel γ ν n (pure ψ₀))+y*entropy (channel γ ν n (pure ψ₁))) := + add_le_add le_rfl (add_le_add (mul_le_mul_of_nonneg_left h₀ hx) + (mul_le_mul_of_nonneg_left h₁ hy)) + _ ≤ entropy (channel γ ν (n+1) (pure ψ)) := by + have h := output_entropy_recursion γ ν hγ hν ψ hψ + dsimp [x,y,ψ₀,ψ₁] + linarith + +theorem mixed_output_entropy_bound (γ ν : ℝ) (hγ : γ ∈ Set.Icc (0:ℝ) 1) + (hν : ν ∈ Set.Icc (0:ℝ) 1) (n : ℕ) {P : QMatrix n} (hP : IsState P) : + ∑ j, g (v γ ν (matrixPopulation P j)) ≤ entropy (channel γ ν n P) := by + let w := hP.1.isHermitian.eigenvalues + let ψ := fun a i ↦ hP.1.isHermitian.eigenvectorUnitary i a + have hw (a) : 0 ≤ w a := hP.1.eigenvalues_nonneg a + have hs : ∑ a, w a = 1 := spectral_weights_sum hP + have hv (a) : vecMass (ψ a) = 1 := spectral_vectors_mass hP.1.isHermitian a + have hdecomp : P = ∑ a, w a • pure (ψ a) := spectral_pure_decomposition hP.1.isHermitian + have hchan : channel γ ν n P = ∑ a, w a • channel γ ν n (pure (ψ a)) := by + rw [hdecomp,channel_mixture] + have hpop (j) : matrixPopulation P j = ∑ a, w a * population (ψ a) j := by + conv_lhs => rw [hdecomp] + rw [matrixPopulation_mixture] + simp only [matrixPopulation_pure] + have hj (j) : g (v γ ν (matrixPopulation P j)) ≤ ∑ a, w a*g (v γ ν (population (ψ a) j)) := by + rw [hpop] + exact (convexOn_output_entropy hγ hν).map_sum_le (fun a _ ↦ hw a) hs + (fun a _ ↦ population_mem (hv a) j) + calc + ∑ j, g (v γ ν (matrixPopulation P j)) ≤ + ∑ j, ∑ a, w a*g (v γ ν (population (ψ a) j)) := + Finset.sum_le_sum (fun j _ ↦ hj j) + _ = ∑ a, w a * ∑ j, g (v γ ν (population (ψ a) j)) := by + rw [Finset.sum_comm]; simp only [Finset.mul_sum] + _ ≤ ∑ a, w a * entropy (channel γ ν n (pure (ψ a))) := + Finset.sum_le_sum (fun a _ ↦ mul_le_mul_of_nonneg_left + (pure_output_entropy_bound γ ν hγ hν n (ψ a) (hv a)) (hw a)) + _ ≤ entropy (channel γ ν n P) := by + rw [hchan] + exact concaveOn_entropy.le_map_sum (fun a _ ↦ hw a) hs + (fun a _ ↦ channel_posSemidef γ ν n (pure_posSemidef (ψ a))) + +end GAD + +end + +open scoped BigOperators ComplexOrder MatrixOrder +open Matrix +namespace GAD + +/-- Relabeling the tensor sites. -/ +def coordinatePerm {n : ℕ} {α : Type u_1} (e : Equiv.Perm (Fin n)) : (Fin n → α) ≃ (Fin n → α) where + toFun i := i ∘ e.symm + invFun i := i ∘ e + left_inv i := by ext k; simp + right_inv i := by ext k; simp + +@[simp] theorem coordinatePerm_apply {n : ℕ} {α : Type u_2} (e : Equiv.Perm (Fin n)) + (i : Fin n → α) (k : Fin n) : coordinatePerm e i k = i (e.symm k) := rfl +@[simp] theorem coordinatePerm_symm_apply {n : ℕ} {α : Type u_3} (e : Equiv.Perm (Fin n)) + (i : Fin n → α) (k : Fin n) : (coordinatePerm e).symm i k = i (e k) := rfl + +theorem tensorKraus_reindex (γ ν : ℝ) (n : ℕ) (e : Equiv.Perm (Fin n)) (r : Fin n → Fin 4) : + Matrix.reindex (coordinatePerm e) (coordinatePerm e) (tensorKraus γ ν n r) = + tensorKraus γ ν n (coordinatePerm e r) := by + ext i j + change (∏ k, kraus γ ν (r k) (i (e k)) (j (e k))) = + ∏ k, kraus γ ν (r (e.symm k)) (i k) (j k) + simpa using Equiv.prod_comp e (fun k ↦ kraus γ ν (r (e.symm k)) (i k) (j k)) + +theorem channel_reindex (γ ν : ℝ) (n : ℕ) (e : Equiv.Perm (Fin n)) (P : QMatrix n) : + Matrix.reindex (coordinatePerm e) (coordinatePerm e) (channel γ ν n P) = + channel γ ν n (Matrix.reindex (coordinatePerm e) (coordinatePerm e) P) := by + let φ := reindexStarAlgEquiv (coordinatePerm e : Basis n ≃ Basis n) + have hL (r : Fin n → Fin 4) : φ (tensorKraus γ ν n r) = + tensorKraus γ ν n (coordinatePerm e r) := tensorKraus_reindex γ ν n e r + change φ (∑ r, tensorKraus γ ν n r * P * star (tensorKraus γ ν n r)) = _ + simp only [map_sum,map_mul,map_star,hL] + exact (coordinatePerm e : (Fin n → Fin 4) ≃ _).sum_comp + (fun r ↦ tensorKraus γ ν n r * φ P * star (tensorKraus γ ν n r)) + +theorem matrixPopulation_reindex {n : ℕ} (e : Equiv.Perm (Fin n)) (P : QMatrix n) (j : Fin n) : + matrixPopulation (Matrix.reindex (coordinatePerm e) (coordinatePerm e) P) j = + matrixPopulation P (e.symm j) := by + apply Fintype.sum_equiv (coordinatePerm e).symm + intro i + simp [Matrix.reindex_apply,Matrix.submatrix_apply] + +theorem population_channel_pure_zero (γ ν : ℝ) (hγ : γ ∈ Set.Icc (0:ℝ) 1) + (hν : ν ∈ Set.Icc (0:ℝ) 1) {n : ℕ} (ψ : Basis (n+1) → ℂ) : + matrixPopulation (channel γ ν (n+1) (pure ψ)) 0 = + (1-γ)*population ψ 0+γ*ν*vecMass ψ := by + have hentry (i : Basis n) : + (channel γ ν (n+1) (pure ψ) (Fin.cons 1 i) (Fin.cons 1 i)).re = + (γ*ν)*(gram (columns (tensorKraus γ ν n) (branch ψ 0)) i i).re+ + (1-γ*(1-ν))*(gram (columns (tensorKraus γ ν n) (branch ψ 1)) i i).re := by + rw [channel_first_site_entry] + rw [local_channel γ ν hγ hν (fun a d ↦ + (columns (tensorKraus γ ν n) (branch ψ a) * + (columns (tensorKraus γ ν n) (branch ψ d)).conjTranspose) i i)] + simp [gram] + have hmass (b : Fin 2) : (∑ i, (gram (columns (tensorKraus γ ν n) (branch ψ b)) i i).re) = + vecMass (branch ψ b) := by + simpa only [mass,Matrix.trace,Matrix.diag,Complex.re_sum] using + mass_channel_columns γ ν hγ hν n (branch ψ b) + unfold matrixPopulation + rw [sum_fin_cons] + simp only [Fin.sum_univ_two,Fin.cons_zero,show (0:Fin 2) ≠ 1 by decide,ite_false, + Finset.sum_const_zero,zero_add,ite_true,hentry,Finset.sum_add_distrib,← Finset.mul_sum,hmass, + population_zero,vecMass_branches] + ring + +theorem population_channel_zero (γ ν : ℝ) (hγ : γ ∈ Set.Icc (0:ℝ) 1) + (hν : ν ∈ Set.Icc (0:ℝ) 1) {n : ℕ} {P : QMatrix (n+1)} (hP : IsState P) : + matrixPopulation (channel γ ν (n+1) P) 0 = (1-γ)*matrixPopulation P 0+γ*ν := by + let w := hP.1.isHermitian.eigenvalues + let ψ := fun a i ↦ hP.1.isHermitian.eigenvectorUnitary i a + have hs : ∑ a, w a = 1 := spectral_weights_sum hP + have hv (a) : vecMass (ψ a) = 1 := spectral_vectors_mass hP.1.isHermitian a + have hdecomp : P = ∑ a, w a • pure (ψ a) := spectral_pure_decomposition hP.1.isHermitian + conv_lhs => rw [hdecomp] + rw [channel_mixture,matrixPopulation_mixture] + simp only [population_channel_pure_zero γ ν hγ hν,hv,mul_one] + conv_rhs => rw [hdecomp] + rw [matrixPopulation_mixture] + simp only [matrixPopulation_pure,mul_add,Finset.sum_add_distrib] + rw [← Finset.sum_mul,hs,one_mul,Finset.mul_sum] + congr 1 + apply Finset.sum_congr rfl + intro a _ + ring + +theorem channel_population (γ ν : ℝ) (hγ : γ ∈ Set.Icc (0:ℝ) 1) + (hν : ν ∈ Set.Icc (0:ℝ) 1) {n : ℕ} {P : QMatrix n} (hP : IsState P) (j : Fin n) : + matrixPopulation (channel γ ν n P) j = (1-γ)*matrixPopulation P j+γ*ν := by + cases n with + | zero => exact Fin.elim0 j + | succ n => + let e : Equiv.Perm (Fin (n+1)) := Equiv.swap 0 j + let Q := Matrix.reindex (coordinatePerm e) (coordinatePerm e) P + have hQ : IsState Q := ⟨hP.1.submatrix _, (trace_reindex _ P).trans hP.2⟩ + have h := population_channel_zero γ ν hγ hν hQ + change matrixPopulation (channel γ ν (n+1) (Matrix.reindex _ _ P)) 0 = _ at h + rw [← channel_reindex, matrixPopulation_reindex] at h + change matrixPopulation (channel γ ν (n+1) P) (e.symm 0) = + (1-γ)*matrixPopulation (Matrix.reindex (coordinatePerm e) (coordinatePerm e) P) 0+γ*ν at h + rw [matrixPopulation_reindex] at h + simpa [e] using h + +end GAD + +end + +end OAI diff --git a/lean/OAI/InformationTheory/AmplitudeDamping/PhaseCoding.lean b/lean/OAI/InformationTheory/AmplitudeDamping/PhaseCoding.lean new file mode 100644 index 0000000000000000000000000000000000000000..838f0dbd37c7dbfc4dedf12c917ab66940d42a92 --- /dev/null +++ b/lean/OAI/InformationTheory/AmplitudeDamping/PhaseCoding.lean @@ -0,0 +1,172 @@ +import OAI.InformationTheory.AmplitudeDamping.FinitePacking + +namespace OAI + +noncomputable section + +universe u_1 + +section +open scoped BigOperators ComplexOrder MatrixOrder +open Matrix +namespace GAD + +def signUnitary (s : Fin 2) : Matrix.unitaryGroup (Fin 2) ℂ := + ⟨Matrix.diagonal (fun b ↦ if b=0 ∨ s=0 then 1 else -1), by + constructor <;> ext i j <;> fin_cases i <;> fin_cases j <;> fin_cases s <;> + simp [Matrix.mul_apply,Fin.sum_univ_two,Matrix.star_apply]⟩ + +theorem phaseOutput_conjugate (γ ν : ℝ) (hγ : γ ∈ Set.Icc (0:ℝ) 1) + (hν : ν ∈ Set.Icc (0:ℝ) 1) {p : ℝ} (hp : p ∈ Set.Icc (0:ℝ) 1) (s : Fin 2) : + phaseOutput γ ν p s=Unitary.conjStarAlgAut ℂ _ (signUnitary s) (phaseOutput γ ν p 0) := by + rw [phaseOutput_formula γ ν hγ hν hp s,phaseOutput_formula γ ν hγ hν hp 0] + ext i j + fin_cases i <;> fin_cases j <;> fin_cases s <;> + simp [Unitary.conjStarAlgAut_apply,signUnitary,Matrix.mul_apply,Fin.sum_univ_two, + Matrix.star_apply] + +theorem spectralMatrix_conjugate {ι : Type u_1} [Fintype ι] [DecidableEq ι] + (U V : Matrix.unitaryGroup ι ℂ) (q : ι → ℝ) : + Unitary.conjStarAlgAut ℂ _ U (spectralMatrix V q)=spectralMatrix (U*V) q := by + simp only [spectralMatrix,Unitary.conjStarAlgAut_apply,Submonoid.coe_mul,star_mul, + Matrix.mul_assoc] + +/-- The two phase outputs have a single common eigenvalue distribution. -/ +theorem phase_spectral (γ ν : ℝ) (hγ : γ ∈ Set.Icc (0:ℝ) 1) + (hν : ν ∈ Set.Icc (0:ℝ) 1) {p : ℝ} (hp : p ∈ Set.Icc (0:ℝ) 1) : + ∃ (q : Fin 2 → ℝ) (U : Fin 2 → Matrix.unitaryGroup (Fin 2) ℂ), + (∀ i, 0 ≤ q i) ∧ (∑ i, q i=1) ∧ + (∀ s, phaseOutput γ ν p s=spectralMatrix (U s) q) ∧ + classicalEntropy q=g (v γ ν p) := by + let hA := phaseOutput_state γ ν hγ hν hp 0 + let q := hA.1.isHermitian.eigenvalues + let V := hA.1.isHermitian.eigenvectorUnitary + have hV : phaseOutput γ ν p 0=spectralMatrix V q := hA.1.isHermitian.spectral_theorem + refine ⟨q,fun s ↦ signUnitary s*V,?_,spectral_weights_sum hA,?_,?_⟩ + · exact hA.1.eigenvalues_nonneg + · intro s + rw [phaseOutput_conjugate γ ν hγ hν hp s,hV,spectralMatrix_conjugate] + · rw [← phaseOutput_entropy γ ν hγ hν hp 0,hV,spectralMatrix_entropy] + rfl + +def meanPhaseWeights (γ ν p : ℝ) (b : Fin 2) : ℝ := + if b=0 then 1-((1-γ)*p+γ*ν) else (1-γ)*p+γ*ν + +theorem meanPhaseWeights_nonneg (γ ν : ℝ) (hγ : γ ∈ Set.Icc (0:ℝ) 1) + (hν : ν ∈ Set.Icc (0:ℝ) 1) {p : ℝ} (hp : p ∈ Set.Icc (0:ℝ) 1) (b : Fin 2) : + 0 ≤ meanPhaseWeights γ ν p b := by + have he : 0 ≤ (1-γ)*p+γ*ν := add_nonneg (mul_nonneg (sub_nonneg.mpr hγ.2) hp.1) + (mul_nonneg hγ.1 hν.1) + have hu : (1-γ)*p+γ*ν ≤ 1 := by + have h1 := mul_le_mul_of_nonneg_left hp.2 (sub_nonneg.mpr hγ.2) + have h2 := mul_le_mul_of_nonneg_left hν.2 hγ.1 + nlinarith + dsimp [meanPhaseWeights] + split_ifs + · linarith + · exact he + +theorem meanPhaseWeights_sum (γ ν p : ℝ) : ∑ b, meanPhaseWeights γ ν p b=1 := by + simp [meanPhaseWeights,Fin.sum_univ_two] + +theorem meanPhaseWeights_entropy (γ ν p : ℝ) : + classicalEntropy (meanPhaseWeights γ ν p)=Real.binEntropy ((1-γ)*p+γ*ν) := by + simp [classicalEntropy,meanPhaseWeights,Fin.sum_univ_two, + Real.binEntropy_eq_negMulLog_add_negMulLog_one_sub,add_comm] + +theorem phase_mean_spectral (γ ν : ℝ) (hγ : γ ∈ Set.Icc (0:ℝ) 1) + (hν : ν ∈ Set.Icc (0:ℝ) 1) {p : ℝ} (hp : p ∈ Set.Icc (0:ℝ) 1) : + (1/2:ℝ) • phaseOutput γ ν p 0+(1/2:ℝ) • phaseOutput γ ν p 1= + spectralMatrix 1 (meanPhaseWeights γ ν p) := by + rw [phaseOutput_average γ ν hγ hν hp] + simp [spectralMatrix,meanPhaseWeights] + +end GAD + +end + +open scoped BigOperators ComplexOrder MatrixOrder +open Matrix +namespace GAD + +theorem exists_phase_code (γ ν : ℝ) (hγ : γ ∈ Set.Icc (0:ℝ) 1) + (hν : ν ∈ Set.Icc (0:ℝ) 1) {p : ℝ} (hp : p ∈ Set.Icc (0:ℝ) 1) + (q : Fin 2 → ℝ) (U : Fin 2 → Matrix.unitaryGroup (Fin 2) ℂ) + (hq : ∀ i, 0 ≤ q i) (hs : ∑ i, q i=1) + (hphase : ∀ s, phaseOutput γ ν p s=spectralMatrix (U s) q) + (hent : classicalEntropy q=g (v γ ν p)) + {δ : ℝ} (hδ : 0 < δ) {n : ℕ} (hn : 0 < n) (M : ℕ) (hM : 0 < M) : + ∃ C : Code n, C.messages=M ∧ averageError γ ν C ≤ + (9*logVariance (meanPhaseWeights γ ν p)+8*logVariance q)/((n:ℝ)*δ^2)+ + 4*(M:ℝ)*Real.exp (-(n:ℝ)*(objective γ ν p-2*δ)) := by + let qb := meanPhaseWeights γ ν p + let w : Basis n → ℝ := fun _ ↦ ((2:ℝ)^n)⁻¹ + let A : Basis n → QMatrix n := fun s ↦ channel γ ν n (phaseState p s) + let P := typicalProjection n (fun _ ↦ 1) qb δ + let Q := fun s : Basis n ↦ typicalProjection n (fun k ↦ U (s k)) q δ + have hmean : (∑ s, w s • A s)=tensorMatrix n (fun _ ↦ spectralMatrix 1 qb) := by + simp only [w,A,phaseState_output] + rw [tensorMatrix_average] + simp only [phase_mean_spectral γ ν hγ hν hp,qb] + have hA (s : Basis n) : A s=tensorMatrix n (fun k ↦ spectralMatrix (U (s k)) q) := by + simp only [A,phaseState_output,hphase] + have hP := typicalProjection_properties n (fun _ ↦ 1) qb + (meanPhaseWeights_nonneg γ ν hγ hν hp) (meanPhaseWeights_sum γ ν p) hδ hn + have hQ (s : Basis n) := typicalProjection_properties n (fun k ↦ U (s k)) q hq hs hδ hn + have hw : ∀ s, 0 ≤ w s := fun _ ↦ by dsimp [w]; positivity + have hw1 : ∑ s, w s=1 := phase_weights_sum n + have hga : (∑ s, w s*(1-(P*A s).trace.re)) ≤ logVariance qb/((n:ℝ)*δ^2) := by + have he : (∑ s, w s*(1-(P*A s).trace.re))= + 1-(P*(∑ s, w s • A s)).trace.re := by + simp only [mul_sub,mul_one,Finset.sum_sub_distrib,hw1,Matrix.mul_sum,Matrix.mul_smul, + Matrix.trace_sum,Matrix.trace_smul,Complex.re_sum,Complex.real_smul,Complex.mul_re, + Complex.ofReal_re,Complex.ofReal_im,zero_mul,sub_zero] + rw [he,hmean] + exact hP.2.2.1 + have hcb : (∑ s, w s*(1-(Q s*A s).trace.re)) ≤ logVariance q/((n:ℝ)*δ^2) := by + calc + _ ≤ ∑ s, w s*(logVariance q/((n:ℝ)*δ^2)) := by + apply Finset.sum_le_sum + intro s _ + apply mul_le_mul_of_nonneg_left _ (hw s) + rw [hA] + exact (hQ s).2.2.1 + _ = _ := by rw [← Finset.sum_mul,hw1,one_mul] + have hcp : (Real.exp (-(n:ℝ)*(classicalEntropy qb-δ)) • P- + P*(∑ s, w s • A s)*P).PosSemidef := by + rw [hmean] + exact hP.2.2.2 + obtain ⟨x,D,hD,hDs,he⟩ := exists_packed_measurement w hw hw1 A Q + (fun s ↦ channel_state γ ν hγ hν n (phaseState_state hp s)) + (fun s ↦ (hQ s).1) P hP.1 (Real.exp_pos _).le (Real.exp_pos _).le + hga hcb (fun s ↦ (hQ s).2.1) hcp M hM + let C : Code n := { + messages := M + messages_pos := hM + encoding := fun m ↦ phaseState p (x m) + encoding_state := fun m ↦ phaseState_state hp (x m) + decoding := D + decoding_pos := hD + decoding_sum := hDs } + refine ⟨C,rfl,?_⟩ + have hexp : Real.exp (-(n:ℝ)*(classicalEntropy qb-δ))* + Real.exp ((n:ℝ)*(classicalEntropy q+δ))= + Real.exp (-(n:ℝ)*(objective γ ν p-2*δ)) := by + rw [← Real.exp_add,hent,meanPhaseWeights_entropy] + congr 1 + dsimp [objective] + ring + have hbound : 9*(logVariance qb/((n:ℝ)*δ^2))+8*(logVariance q/((n:ℝ)*δ^2))+ + 4*(M:ℝ)*Real.exp (-(n:ℝ)*(classicalEntropy qb-δ))*Real.exp ((n:ℝ)*(classicalEntropy q+δ))= + (9*logVariance qb+8*logVariance q)/((n:ℝ)*δ^2)+ + 4*(M:ℝ)*Real.exp (-(n:ℝ)*(objective γ ν p-2*δ)) := by + rw [mul_assoc (4*(M:ℝ)),hexp] + ring + rw [hbound] at he + simpa only [averageError,C,A,Complex.re_sum] using he + +end GAD + +end + +end OAI diff --git a/lean/OAI/InformationTheory/AmplitudeDamping/PhaseProducts.lean b/lean/OAI/InformationTheory/AmplitudeDamping/PhaseProducts.lean new file mode 100644 index 0000000000000000000000000000000000000000..df14cd17868cd88755407d08328e024a278854b3 --- /dev/null +++ b/lean/OAI/InformationTheory/AmplitudeDamping/PhaseProducts.lean @@ -0,0 +1,203 @@ +import OAI.InformationTheory.AmplitudeDamping.PhaseStates + +namespace OAI + +noncomputable section + +section +open scoped BigOperators ComplexOrder MatrixOrder Kronecker +open Matrix +namespace GAD + +def tensorMatrix (n : ℕ) (A : Fin n → Matrix (Fin 2) (Fin 2) ℂ) : QMatrix n := + fun i j ↦ ∏ k, A k (i k) (j k) + +def tensorSplit (n : ℕ) : Basis (n+1) ≃ Fin 2 × Basis n := + (Fin.consEquiv (fun _ : Fin (n+1) ↦ Fin 2)).symm + +theorem tensorMatrix_split {n : ℕ} (A : Fin (n+1) → Matrix (Fin 2) (Fin 2) ℂ) : + Matrix.reindex (tensorSplit n) (tensorSplit n) (tensorMatrix (n+1) A) = + A 0 ⊗ₖ tensorMatrix n (fun k ↦ A k.succ) := by + ext i j + simp [Matrix.reindex_apply,Matrix.submatrix_apply,tensorSplit,tensorMatrix, + Fin.prod_univ_succ] + +theorem tensorMatrix_trace (n : ℕ) (A : Fin n → Matrix (Fin 2) (Fin 2) ℂ) : + (tensorMatrix n A).trace = ∏ k, (A k).trace := by + exact (Fintype.prod_sum (fun k i ↦ A k i i)).symm + +theorem tensorMatrix_zero (A : Fin 0 → Matrix (Fin 2) (Fin 2) ℂ) : + tensorMatrix 0 A = 1 := by + ext i j + simp [tensorMatrix,Matrix.one_apply,Subsingleton.elim i j] + +theorem tensorMatrix_posSemidef (n : ℕ) (A : Fin n → Matrix (Fin 2) (Fin 2) ℂ) + (hA : ∀ k, (A k).PosSemidef) : (tensorMatrix n A).PosSemidef := by + induction n with + | zero => rw [tensorMatrix_zero]; exact Matrix.PosSemidef.one + | succ n ih => + have h := (hA 0).kronecker (ih (fun k ↦ A k.succ) (fun k ↦ hA k.succ)) + rw [← tensorMatrix_split A] at h + have h' := h.submatrix (tensorSplit n) + simpa only [Matrix.reindex_apply,Matrix.submatrix_submatrix,Equiv.symm_comp_self, + Matrix.submatrix_id_id] using h' + +theorem tensorMatrix_state (n : ℕ) (A : Fin n → Matrix (Fin 2) (Fin 2) ℂ) + (hA : ∀ k, IsState (A k)) : IsState (tensorMatrix n A) := by + refine ⟨tensorMatrix_posSemidef n A (fun k ↦ (hA k).1), ?_⟩ + rw [tensorMatrix_trace] + simp only [(hA _).2,Finset.prod_const_one] + +theorem tensorMatrix_entropy (n : ℕ) (A : Fin n → Matrix (Fin 2) (Fin 2) ℂ) + (hA : ∀ k, IsState (A k)) : entropy (tensorMatrix n A) = ∑ k, entropy (A k) := by + induction n with + | zero => + rw [tensorMatrix_zero] + have hdiag : (1 : QMatrix 0) = Matrix.diagonal (fun _ : Basis 0 ↦ (1:ℂ)) := by simp + rw [hdiag] + change entropy (Matrix.diagonal (fun _ : Basis 0 ↦ ((1:ℝ):ℂ))) = _ + rw [entropy_diagonal] + simp + | succ n ih => + rw [← entropy_reindex (tensorSplit n) (tensorMatrix_state (n+1) A hA).1.isHermitian, + tensorMatrix_split,entropy_kronecker_state (hA 0) + (tensorMatrix_state n _ (fun k ↦ hA k.succ)),ih _ (fun k ↦ hA k.succ),Fin.sum_univ_succ] + +theorem channel_tensorMatrix (γ ν : ℝ) (n : ℕ) (A : Fin n → Matrix (Fin 2) (Fin 2) ℂ) : + channel γ ν n (tensorMatrix n A) = + tensorMatrix n (fun k ↦ applyKraus (kraus γ ν) (A k)) := by + ext i j + simp only [channel,applyKraus,tensorMatrix,Matrix.mul_apply,Matrix.sum_apply,Matrix.conjTranspose_apply] + change (∑ r : Fin n → Fin 4, ∑ v : Basis n, + (∑ u : Basis n, (∏ k, kraus γ ν (r k) (i k) (u k)) * (∏ k, A k (u k) (v k))) * + star (∏ k, kraus γ ν (r k) (j k) (v k))) = + ∏ k, ∑ r : Fin 4, ∑ v : Fin 2, + (∑ u : Fin 2, kraus γ ν r (i k) u * A k u v) * star (kraus γ ν r (j k) v) + simp only [star_prod,Finset.sum_mul,← Finset.prod_mul_distrib] + have hinner (r : Fin n → Fin 4) (v : Basis n) : + (∑ u : Basis n, ∏ k, (kraus γ ν (r k) (i k) (u k) * A k (u k) (v k)) * + star (kraus γ ν (r k) (j k) (v k))) = + ∏ k, ∑ u : Fin 2, (kraus γ ν (r k) (i k) u * A k u (v k)) * + star (kraus γ ν (r k) (j k) (v k)) := + (Fintype.prod_sum (fun k u ↦ (kraus γ ν (r k) (i k) u * A k u (v k)) * + star (kraus γ ν (r k) (j k) (v k)))).symm + simp only [hinner] + have hmid (r : Fin n → Fin 4) : + (∑ v : Basis n, ∏ k, ∑ u : Fin 2, + (kraus γ ν (r k) (i k) u * A k u (v k)) * star (kraus γ ν (r k) (j k) (v k))) = + ∏ k, ∑ v : Fin 2, ∑ u : Fin 2, + (kraus γ ν (r k) (i k) u * A k u v) * star (kraus γ ν (r k) (j k) v) := + (Fintype.prod_sum (fun k v ↦ ∑ u : Fin 2, + (kraus γ ν (r k) (i k) u * A k u v) * star (kraus γ ν (r k) (j k) v))).symm + simp only [hmid] + exact (Fintype.prod_sum (fun k r ↦ ∑ v : Fin 2, ∑ u : Fin 2, + (kraus γ ν r (i k) u * A k u v) * star (kraus γ ν r (j k) v))).symm + +theorem tensorMatrix_sum {n : ℕ} (B : Fin n → Fin 2 → Matrix (Fin 2) (Fin 2) ℂ) : + (∑ s : Basis n, tensorMatrix n (fun k ↦ B k (s k))) = + tensorMatrix n (fun k ↦ ∑ s, B k s) := by + ext i j + simp only [Matrix.sum_apply,tensorMatrix] + exact (Fintype.prod_sum (fun k s ↦ B k s (i k) (j k))).symm + +theorem tensorMatrix_smul {n : ℕ} (c : Fin n → ℝ) (A : Fin n → Matrix (Fin 2) (Fin 2) ℂ) : + tensorMatrix n (fun k ↦ c k • A k) = (∏ k, c k) • tensorMatrix n A := by + ext i j + simp [tensorMatrix,Complex.real_smul,Finset.prod_mul_distrib] + +theorem tensorMatrix_average {n : ℕ} (B : Fin n → Fin 2 → Matrix (Fin 2) (Fin 2) ℂ) : + (∑ s : Basis n, ((2:ℝ)^n)⁻¹ • tensorMatrix n (fun k ↦ B k (s k))) = + tensorMatrix n (fun k ↦ (1/2:ℝ) • B k 0+(1/2:ℝ) • B k 1) := by + rw [← Finset.smul_sum,tensorMatrix_sum] + have hm : (fun k ↦ (1/2:ℝ) • B k 0+(1/2:ℝ) • B k 1) = + (fun k ↦ (1/2:ℝ) • (∑ s, B k s)) := by + funext k + rw [Fin.sum_univ_two,smul_add] + rw [hm,tensorMatrix_smul] + simp [Finset.prod_const,one_div] + +end GAD + +end + +open scoped BigOperators ComplexOrder MatrixOrder +open Matrix +namespace GAD + +theorem phaseState_tensor {n : ℕ} (p : ℝ) (s : Basis n) : + phaseState p s = tensorMatrix n (fun k ↦ pure (phaseSignal p (s k))) := by + ext i j + simp only [phaseState,phaseProduct,pure,tensorMatrix,star_prod,Finset.prod_mul_distrib] + +theorem phaseState_state {n : ℕ} {p : ℝ} (hp : p ∈ Set.Icc (0:ℝ) 1) (s : Basis n) : + IsState (phaseState p s) := by + rw [phaseState_tensor] + exact tensorMatrix_state n _ (fun k ↦ pure_state (phaseSignal_mass hp (s k))) + +theorem phaseState_output {n : ℕ} (γ ν p : ℝ) (s : Basis n) : + channel γ ν n (phaseState p s) = tensorMatrix n (fun k ↦ phaseOutput γ ν p (s k)) := by + rw [phaseState_tensor,channel_tensorMatrix] + rfl + +theorem phaseState_entropy {n : ℕ} (γ ν : ℝ) (hγ : γ ∈ Set.Icc (0:ℝ) 1) + (hν : ν ∈ Set.Icc (0:ℝ) 1) {p : ℝ} (hp : p ∈ Set.Icc (0:ℝ) 1) (s : Basis n) : + entropy (channel γ ν n (phaseState p s)) = (n:ℝ)*g (v γ ν p) := by + rw [phaseState_output,tensorMatrix_entropy n _ (fun k ↦ phaseOutput_state γ ν hγ hν hp (s k))] + simp only [phaseOutput_entropy γ ν hγ hν hp,Finset.sum_const,Finset.card_univ, + Fintype.card_fin,nsmul_eq_mul] + +theorem phaseState_average_entropy (n : ℕ) (γ ν : ℝ) (hγ : γ ∈ Set.Icc (0:ℝ) 1) + (hν : ν ∈ Set.Icc (0:ℝ) 1) {p : ℝ} (hp : p ∈ Set.Icc (0:ℝ) 1) : + entropy (∑ s : Basis n, (((2:ℝ)^n)⁻¹ : ℂ) • channel γ ν n (phaseState p s)) = + (n:ℝ)*Real.binEntropy ((1-γ)*p+γ*ν) := by + simp only [← Complex.ofReal_pow,← Complex.ofReal_inv,Complex.coe_smul,phaseState_output] + rw [tensorMatrix_average] + have hs : IsState ((1/2:ℝ) • phaseOutput γ ν p 0+(1/2:ℝ) • phaseOutput γ ν p 1) := by + have h := state_mixture (fun _ : Fin 2 ↦ (1/2:ℝ)) (phaseOutput γ ν p) + (by intro a; norm_num) (by norm_num [Fin.sum_univ_two]) + (fun s ↦ phaseOutput_state γ ν hγ hν hp s) + simpa only [Fin.sum_univ_two] using h + rw [tensorMatrix_entropy n _ (fun _ ↦ hs)] + simp only [phaseOutput_average_entropy γ ν hγ hν hp,Finset.sum_const, + Finset.card_univ,Fintype.card_fin,nsmul_eq_mul] + +theorem basis_card (n : ℕ) : Fintype.card (Basis n) = 2^n := by + simp [Basis] + +theorem phase_weights_sum (n : ℕ) : (∑ _s : Basis n, ((2:ℝ)^n)⁻¹) = 1 := by + simp only [Finset.sum_const,Finset.card_univ,basis_card,nsmul_eq_mul,Nat.cast_pow,Nat.cast_ofNat] + exact mul_inv_cancel₀ (pow_ne_zero n (by norm_num)) + +theorem phaseValue_formula (n : ℕ) (γ ν : ℝ) (hγ : γ ∈ Set.Icc (0:ℝ) 1) + (hν : ν ∈ Set.Icc (0:ℝ) 1) {p : ℝ} (hp : p ∈ Set.Icc (0:ℝ) 1) : + phaseValue γ ν p n = (n:ℝ)/Real.log 2*objective γ ν p := by + unfold phaseValue + rw [phaseState_average_entropy n γ ν hγ hν hp] + simp only [phaseState_entropy γ ν hγ hν hp,← Finset.sum_mul,phase_weights_sum,one_mul] + unfold objective + ring + +def phaseEnsemble (n : ℕ) (p : ℝ) (hp : p ∈ Set.Icc (0:ℝ) 1) : Ensemble n where + size := Fintype.card (Basis n) + weight := fun _ ↦ ((2:ℝ)^n)⁻¹ + weight_nonneg := fun _ ↦ inv_nonneg.mpr (pow_nonneg (by norm_num) n) + weight_sum := by + simpa only [Finset.sum_const,Finset.card_univ,Fintype.card_fin,nsmul_eq_mul] using + phase_weights_sum n + signal := fun a ↦ phaseState p ((Fintype.equivFin (Basis n)).symm a) + signal_state := fun a ↦ phaseState_state hp _ + +theorem phaseEnsemble_value (n : ℕ) (γ ν p : ℝ) (hp : p ∈ Set.Icc (0:ℝ) 1) : + ensembleValue γ ν (phaseEnsemble n p hp) = phaseValue γ ν p n := by + unfold ensembleValue phaseEnsemble phaseValue + simp only [← Complex.ofReal_inv,← Complex.ofReal_pow] + rw [Equiv.sum_comp (Fintype.equivFin (Basis n)).symm + (fun s ↦ Complex.ofReal ((2:ℝ)^n)⁻¹ • channel γ ν n (phaseState p s)), + Equiv.sum_comp (Fintype.equivFin (Basis n)).symm + (fun s ↦ ((2:ℝ)^n)⁻¹ * entropy (channel γ ν n (phaseState p s)))] + +end GAD + +end + +end OAI diff --git a/lean/OAI/InformationTheory/AmplitudeDamping/PhaseStates.lean b/lean/OAI/InformationTheory/AmplitudeDamping/PhaseStates.lean new file mode 100644 index 0000000000000000000000000000000000000000..5778cb672785068c20432f473715e6445fee70d0 --- /dev/null +++ b/lean/OAI/InformationTheory/AmplitudeDamping/PhaseStates.lean @@ -0,0 +1,115 @@ +import OAI.InformationTheory.AmplitudeDamping.EnsembleBounds + +namespace OAI + +noncomputable section + +section +open scoped BigOperators ComplexOrder MatrixOrder +open Matrix +namespace GAD + +/-- Entropy of any Hermitian trace-one two-level matrix, expressed through its determinant. -/ +theorem entropy_qubit {P : Matrix (Fin 2) (Fin 2) ℂ} (hP : P.IsHermitian) + (htr : P.trace=1) : entropy P = g P.det.re := by + let a := hP.eigenvalues 0 + let b := hP.eigenvalues 1 + have hab : a+b=1 := by + have h := congrArg Complex.re (hP.trace_eq_sum_eigenvalues.symm.trans htr) + simpa [Fin.sum_univ_two,a,b] using h + have hd : P.det.re=a*b := by + rw [hP.det_eq_prod_eigenvalues,Fin.prod_univ_two] + simp [a,b] + have he : entropy P=Real.negMulLog a+Real.negMulLog b := by + rw [entropy_eq_sum hP,Fin.sum_univ_two] + have hdisc : 1-4*P.det.re=(a-b)^2 := by rw [hd]; nlinarith only [hab] + rw [he,g,hdisc,Real.sqrt_sq_eq_abs] + by_cases h : b ≤ a + · rw [abs_of_nonneg (sub_nonneg.mpr h)] + have ht : (1+(a-b))/2=a := by linarith + rw [ht,Real.binEntropy_eq_negMulLog_add_negMulLog_one_sub] + congr 1 + congr 1 + linarith + · rw [abs_of_neg (sub_neg.mpr (lt_of_not_ge h))] + have ht : (1+ -(a-b))/2=b := by linarith + rw [ht,Real.binEntropy_eq_negMulLog_add_negMulLog_one_sub] + have ht' : 1-b=a := by linarith + rw [ht']; ring + +end GAD + +end + +open scoped BigOperators ComplexOrder MatrixOrder +open Matrix +namespace GAD + +def phaseOutput (γ ν p : ℝ) (s : Fin 2) : Matrix (Fin 2) (Fin 2) ℂ := + applyKraus (kraus γ ν) (pure (phaseSignal p s)) + +theorem phaseSignal_mass {p : ℝ} (hp : p ∈ Set.Icc (0:ℝ) 1) (s : Fin 2) : + vecMass (phaseSignal p s) = 1 := by + simp only [vecMass,Fin.sum_univ_two,phaseSignal,ite_true,show (1:Fin 2) ≠ 0 by decide,ite_false] + split_ifs <;> simp [Complex.normSq_ofReal,Real.mul_self_sqrt hp.1, + Real.mul_self_sqrt (sub_nonneg.mpr hp.2)] + +theorem phaseOutput_state (γ ν : ℝ) (hγ : γ ∈ Set.Icc (0:ℝ) 1) + (hν : ν ∈ Set.Icc (0:ℝ) 1) {p : ℝ} (hp : p ∈ Set.Icc (0:ℝ) 1) (s : Fin 2) : + IsState (phaseOutput γ ν p s) := by + refine ⟨applyKraus_posSemidef _ (pure_posSemidef _), ?_⟩ + exact (applyKraus_trace _ (kraus_complete γ ν hγ hν) _).trans (pure_state (phaseSignal_mass hp s)).2 + +theorem phaseOutput_formula (γ ν : ℝ) (hγ : γ ∈ Set.Icc (0:ℝ) 1) + (hν : ν ∈ Set.Icc (0:ℝ) 1) {p : ℝ} (hp : p ∈ Set.Icc (0:ℝ) 1) (s : Fin 2) : + phaseOutput γ ν p s = + !![((1-((1-γ)*p+γ*ν) : ℝ):ℂ), + ((if s=0 then 1 else -1 : ℝ)*Real.sqrt (1-γ)*Real.sqrt (1-p)*Real.sqrt p : ℂ); + ((if s=0 then 1 else -1 : ℝ)*Real.sqrt (1-γ)*Real.sqrt (1-p)*Real.sqrt p : ℂ), + (((1-γ)*p+γ*ν : ℝ):ℂ)] := by + rw [phaseOutput,local_channel γ ν hγ hν] + have hsp : (Real.sqrt p : ℂ)^2=(p:ℂ) := by exact_mod_cast Real.sq_sqrt hp.1 + have hs1p : (Real.sqrt (1-p) : ℂ)^2=(1-p:ℂ) := by exact_mod_cast Real.sq_sqrt (sub_nonneg.mpr hp.2) + ext i j + fin_cases i <;> fin_cases j <;> fin_cases s <;> + simp [pure,phaseSignal,Matrix.of_apply,Complex.ofReal_mul,Complex.ofReal_sub] <;> + ring_nf <;> simp only [hsp,hs1p] <;> ring + +theorem phaseOutput_det (γ ν : ℝ) (hγ : γ ∈ Set.Icc (0:ℝ) 1) + (hν : ν ∈ Set.Icc (0:ℝ) 1) {p : ℝ} (hp : p ∈ Set.Icc (0:ℝ) 1) (s : Fin 2) : + (phaseOutput γ ν p s).det.re=v γ ν p := by + rw [phaseOutput_formula γ ν hγ hν hp s,Matrix.det_fin_two] + have hγ' := Real.sq_sqrt (sub_nonneg.mpr hγ.2) + have hp' := Real.sq_sqrt (sub_nonneg.mpr hp.2) + have hp'' := Real.sq_sqrt hp.1 + simp only [Matrix.of_apply,Matrix.cons_val_zero,Matrix.cons_val_one,Matrix.cons_val_fin_one, + ← Complex.ofReal_mul,← Complex.ofReal_sub,Complex.ofReal_re] + split_ifs <;> dsimp only [v] <;> + ring_nf <;> rw [hγ', hp', hp''] <;> ring + +theorem phaseOutput_entropy (γ ν : ℝ) (hγ : γ ∈ Set.Icc (0:ℝ) 1) + (hν : ν ∈ Set.Icc (0:ℝ) 1) {p : ℝ} (hp : p ∈ Set.Icc (0:ℝ) 1) (s : Fin 2) : + entropy (phaseOutput γ ν p s)=g (v γ ν p) := by + rw [entropy_qubit (phaseOutput_state γ ν hγ hν hp s).1.isHermitian + (phaseOutput_state γ ν hγ hν hp s).2,phaseOutput_det γ ν hγ hν hp s] + +theorem phaseOutput_average (γ ν : ℝ) (hγ : γ ∈ Set.Icc (0:ℝ) 1) + (hν : ν ∈ Set.Icc (0:ℝ) 1) {p : ℝ} (hp : p ∈ Set.Icc (0:ℝ) 1) : + (1/2:ℝ) • phaseOutput γ ν p 0+(1/2:ℝ) • phaseOutput γ ν p 1 = + Matrix.diagonal (fun b : Fin 2 ↦ ((if b=0 then 1-((1-γ)*p+γ*ν) else (1-γ)*p+γ*ν : ℝ):ℂ)) := by + rw [phaseOutput_formula γ ν hγ hν hp 0,phaseOutput_formula γ ν hγ hν hp 1] + ext i j + fin_cases i <;> fin_cases j <;> simp [Complex.real_smul] <;> ring + +theorem phaseOutput_average_entropy (γ ν : ℝ) (hγ : γ ∈ Set.Icc (0:ℝ) 1) + (hν : ν ∈ Set.Icc (0:ℝ) 1) {p : ℝ} (hp : p ∈ Set.Icc (0:ℝ) 1) : + entropy ((1/2:ℝ) • phaseOutput γ ν p 0+(1/2:ℝ) • phaseOutput γ ν p 1) = + Real.binEntropy ((1-γ)*p+γ*ν) := by + rw [phaseOutput_average γ ν hγ hν hp,entropy_diagonal] + simp [Fin.sum_univ_two,Real.binEntropy_eq_negMulLog_add_negMulLog_one_sub,add_comm] + +end GAD + +end + +end OAI diff --git a/lean/OAI/InformationTheory/AmplitudeDamping/Pinching.lean b/lean/OAI/InformationTheory/AmplitudeDamping/Pinching.lean new file mode 100644 index 0000000000000000000000000000000000000000..a5e45af502eb9ff6f84aa77230c6634e182511f7 --- /dev/null +++ b/lean/OAI/InformationTheory/AmplitudeDamping/Pinching.lean @@ -0,0 +1,151 @@ +import OAI.InformationTheory.AmplitudeDamping.LogDetEntropy + +namespace OAI + +universe u_1 + +noncomputable section +open scoped BigOperators Matrix.Norms.Elementwise +open Matrix +open scoped BigOperators ComplexOrder MatrixOrder +open scoped Matrix.Norms.Elementwise ComplexOrder MatrixOrder +open Matrix Set +open scoped ComplexOrder MatrixOrder +open scoped BigOperators Topology +open Filter Set +open scoped BigOperators ComplexOrder MatrixOrder Topology + +open scoped BigOperators ComplexOrder MatrixOrder +open Matrix Set +namespace GAD +variable {ι : Type u_1} [Fintype ι] [DecidableEq ι] + +theorem inv_unitary_conj (U : Matrix.unitaryGroup ι ℂ) (A : Matrix ι ι ℂ) : + ((U : Matrix ι ι ℂ) * A * (star U : Matrix ι ι ℂ))⁻¹ = + (U : Matrix ι ι ℂ) * A⁻¹ * (star U : Matrix ι ι ℂ) := by + have hu : (U : Matrix ι ι ℂ)⁻¹ = (star U : Matrix ι ι ℂ) := + Matrix.inv_eq_right_inv (Unitary.coe_mul_star_self U) + have hs : (star U : Matrix ι ι ℂ)⁻¹ = (U : Matrix ι ι ℂ) := + Matrix.inv_eq_right_inv (by simpa only [Unitary.coe_star] using Unitary.coe_star_mul_self U) + rw [Matrix.mul_inv_rev, Matrix.mul_inv_rev, hu, hs, Matrix.mul_assoc] + +theorem blockLogDet_unitary (U V : Matrix.unitaryGroup ι ℂ) (Z D E : Matrix ι ι ℂ) : + blockLogDet ((U : Matrix ι ι ℂ)*Z*(star V : Matrix ι ι ℂ)) + ((U : Matrix ι ι ℂ)*D*(star U : Matrix ι ι ℂ)) + ((V : Matrix ι ι ℂ)*E*(star V : Matrix ι ι ℂ)) = blockLogDet Z D E := by + have he : (U : Matrix ι ι ℂ)*D*(star U : Matrix ι ι ℂ) + + ((U : Matrix ι ι ℂ)*Z*(star V : Matrix ι ι ℂ)) * + (((V : Matrix ι ι ℂ)*E*(star V : Matrix ι ι ℂ))⁻¹) * + ((U : Matrix ι ι ℂ)*Z*(star V : Matrix ι ι ℂ))ᴴ = + (U : Matrix ι ι ℂ)*(D+Z*E⁻¹*Zᴴ)*(star U : Matrix ι ι ℂ) := by + rw [inv_unitary_conj] + simp only [← Matrix.star_eq_conjTranspose, star_mul, star_star] + have hv : star (V : Matrix ι ι ℂ) * (V : Matrix ι ι ℂ) = 1 := Unitary.coe_star_mul_self V + simp only [Matrix.mul_assoc, ← Matrix.mul_assoc (star (V : Matrix ι ι ℂ)) (V : Matrix ι ι ℂ), + hv, Matrix.one_mul, Matrix.mul_add, Matrix.add_mul] + unfold blockLogDet + rw [he] + change Real.log ‖(Unitary.conjStarAlgAut ℂ _ U (D+Z*E⁻¹*Zᴴ)).det‖ - + Real.log ‖(Unitary.conjStarAlgAut ℂ _ U D).det‖ = _ + rw [det_unitary_conj, det_unitary_conj] + +def flipSign (k : ι) : Matrix.unitaryGroup ι ℂ := + ⟨Matrix.diagonal (fun i ↦ if i = k then (-1 : ℂ) else 1), by + rw [Matrix.mem_unitaryGroup_iff] + simp only [Matrix.star_eq_conjTranspose, Matrix.diagonal_conjTranspose] + rw [Matrix.diagonal_mul_diagonal] + ext i j + by_cases h : i = j + · subst j + simp only [Matrix.diagonal_apply_eq, Matrix.one_apply_eq] + by_cases hi : i = k <;> simp [hi] + · simp [Matrix.diagonal_apply_ne _ h, Matrix.one_apply_ne h]⟩ + +def partialPinch (s : Finset ι) (A : Matrix ι ι ℂ) : Matrix ι ι ℂ := + fun i j ↦ if i = j ∨ (i ∉ s ∧ j ∉ s) then A i j else 0 + +omit [Fintype ι] in +theorem partialPinch_empty (A : Matrix ι ι ℂ) : partialPinch ∅ A = A := by + ext i j; simp [partialPinch] + +theorem partialPinch_univ (A : Matrix ι ι ℂ) : + partialPinch Finset.univ A = Matrix.diagonal (fun i ↦ A i i) := by + ext i j + by_cases h : i = j <;> simp [partialPinch, Matrix.diagonal, h] + +theorem flipSign_conj_apply (k i j : ι) (A : Matrix ι ι ℂ) : + ((flipSign k : Matrix ι ι ℂ) * A * (star (flipSign k) : Matrix ι ι ℂ)) i j = + (if i = k then (-1 : ℂ) else 1) * A i j * (if j = k then (-1 : ℂ) else 1) := by + by_cases hi : i = k <;> by_cases hj : j = k <;> + simp [flipSign, Matrix.star_eq_conjTranspose, Matrix.mul_diagonal, Matrix.diagonal_mul, hi, hj] + +theorem partialPinch_insert (s : Finset ι) (k : ι) (A : Matrix ι ι ℂ) : + partialPinch (insert k s) A = (1/2 : ℝ) • partialPinch s A + + (1/2 : ℝ) • ((flipSign k : Matrix ι ι ℂ) * partialPinch s A * + (star (flipSign k) : Matrix ι ι ℂ)) := by + ext i j + simp only [Matrix.add_apply, Matrix.smul_apply, flipSign_conj_apply, partialPinch, + Finset.mem_insert, not_or] + by_cases hij : i = j + · subst j + by_cases hi : i = k <;> simp [hi, Complex.real_smul] <;> ring + · by_cases hi : i = k <;> by_cases hj : j = k <;> + by_cases his : i ∈ s <;> by_cases hjs : j ∈ s <;> + simp_all [Complex.real_smul]; ring + +theorem flipSign_diagonal (k : ι) (z : ι → ℂ) : + (flipSign k : Matrix ι ι ℂ) * Matrix.diagonal z * + (star (flipSign k) : Matrix ι ι ℂ) = Matrix.diagonal z := by + ext i j + rw [flipSign_conj_apply] + by_cases h : i = j + · subst j; by_cases hi : i = k <;> simp [hi] + · simp [Matrix.diagonal_apply_ne _ h] + +theorem partialPinch_posDef {D : Matrix ι ι ℂ} (hD : D.PosDef) (s : Finset ι) : + (partialPinch s D).PosDef := by + induction s using Finset.induction_on with + | empty => simpa only [partialPinch_empty] using hD + | @insert k s _ ih => + rw [partialPinch_insert] + exact posDef_segment ih (ih.mul_mul_conjTranspose_same + (Matrix.vecMul_injective_iff_isUnit.mpr (Unitary.isUnit_coe (U := flipSign k)))) + (by norm_num) (by norm_num) (by norm_num) + +theorem blockLogDet_partialPinch_le (z : ι → ℂ) {D E : Matrix ι ι ℂ} + (hD : D.PosDef) (hE : E.PosDef) (s : Finset ι) : + blockLogDet (Matrix.diagonal z) (partialPinch s D) (partialPinch s E) ≤ + blockLogDet (Matrix.diagonal z) D E := by + induction s using Finset.induction_on with + | empty => simp only [partialPinch_empty, le_refl] + | @insert k s _ ih => + have hDp := partialPinch_posDef hD s + have hEp := partialPinch_posDef hE s + have hDc := hDp.mul_mul_conjTranspose_same + (Matrix.vecMul_injective_iff_isUnit.mpr (Unitary.isUnit_coe (U := flipSign k))) + have hEc := hEp.mul_mul_conjTranspose_same + (Matrix.vecMul_injective_iff_isUnit.mpr (Unitary.isUnit_coe (U := flipSign k))) + have hh := (convexOn_blockLogDet (Matrix.diagonal z)).2 + (x := (partialPinch s D, partialPinch s E)) + (y := ((flipSign k : Matrix ι ι ℂ) * partialPinch s D * (star (flipSign k) : Matrix ι ι ℂ), + (flipSign k : Matrix ι ι ℂ) * partialPinch s E * (star (flipSign k) : Matrix ι ι ℂ))) + ⟨hDp,hEp⟩ ⟨hDc,hEc⟩ + (show (0 : ℝ) ≤ 1/2 by norm_num) (show (0 : ℝ) ≤ 1/2 by norm_num) (by norm_num) + have he := blockLogDet_unitary (flipSign k) (flipSign k) (Matrix.diagonal z) + (partialPinch s D) (partialPinch s E) + rw [flipSign_diagonal] at he + simp only [Prod.fst_add, Prod.snd_add, Prod.smul_fst, Prod.smul_snd, smul_eq_mul] at hh + rw [← partialPinch_insert, ← partialPinch_insert, he] at hh + linarith + +theorem blockLogDet_diagonal_le (z : ι → ℂ) {D E : Matrix ι ι ℂ} + (hD : D.PosDef) (hE : E.PosDef) : + blockLogDet (Matrix.diagonal z) (Matrix.diagonal (fun i ↦ D i i)) + (Matrix.diagonal (fun i ↦ E i i)) ≤ blockLogDet (Matrix.diagonal z) D E := by + simpa only [partialPinch_univ] using blockLogDet_partialPinch_le z hD hE Finset.univ + +end GAD + +end + +end OAI diff --git a/lean/OAI/InformationTheory/AmplitudeDamping/PureRecursion.lean b/lean/OAI/InformationTheory/AmplitudeDamping/PureRecursion.lean new file mode 100644 index 0000000000000000000000000000000000000000..496ba5a3bb92d789f9006ec7e600eb875fb46389 --- /dev/null +++ b/lean/OAI/InformationTheory/AmplitudeDamping/PureRecursion.lean @@ -0,0 +1,312 @@ +import OAI.InformationTheory.AmplitudeDamping.TensorEntropy + +namespace OAI + +noncomputable section + +universe u_1 u_2 u_3 u_4 + +namespace GAD + +section +open scoped BigOperators ComplexOrder MatrixOrder +open Matrix +variable {ι : Type u_1} [Fintype ι] + +def vecMass (ψ : ι → ℂ) : ℝ := ∑ i, Complex.normSq (ψ i) + +theorem vecMass_nonneg (ψ : ι → ℂ) : 0 ≤ vecMass ψ := + Finset.sum_nonneg (fun i _ ↦ Complex.normSq_nonneg (ψ i)) + +theorem pure_posSemidef (ψ : ι → ℂ) : (pure ψ).PosSemidef := + Matrix.posSemidef_vecMulVec_self_star ψ + +theorem pure_trace (ψ : ι → ℂ) : (pure ψ).trace = (vecMass ψ : ℂ) := by + simp [Matrix.trace, pure, vecMass, Complex.mul_conj] + +theorem pure_state [DecidableEq ι] {ψ : ι → ℂ} (hψ : vecMass ψ = 1) : IsState (pure ψ) := by + exact ⟨pure_posSemidef ψ, by rw [pure_trace,hψ]; rfl⟩ + +theorem vecMass_eq_zero {ψ : ι → ℂ} : vecMass ψ = 0 ↔ ψ = 0 := by + constructor + · intro h + funext i + apply Complex.normSq_eq_zero.mp + exact (Finset.sum_eq_zero_iff_of_nonneg (fun i _ ↦ Complex.normSq_nonneg (ψ i))).mp h i + (Finset.mem_univ i) + · rintro rfl + simp [vecMass] + +variable [DecidableEq ι] + +def unitVec [Inhabited ι] : ι → ℂ := fun i ↦ if i = default then 1 else 0 + +@[simp] theorem vecMass_unitVec [Inhabited ι] : vecMass (unitVec (ι := ι)) = 1 := by + simp [vecMass, unitVec] + +omit [DecidableEq ι] in +theorem vecMass_smul (z : ℂ) (ψ : ι → ℂ) : + vecMass (z • ψ) = Complex.normSq z * vecMass ψ := by + simp [vecMass, Complex.normSq_mul, Finset.mul_sum] + +def normalize [Inhabited ι] (ψ : ι → ℂ) : ι → ℂ := + if vecMass ψ = 0 then unitVec else ((Real.sqrt (vecMass ψ) : ℂ)⁻¹) • ψ + +theorem sqrt_mass_normalize [Inhabited ι] (ψ : ι → ℂ) : + (Real.sqrt (vecMass ψ) : ℂ) • normalize ψ = ψ := by + by_cases h : vecMass ψ = 0 + · have hz := vecMass_eq_zero.mp h + simp [normalize,hz,vecMass] + · have hs : (Real.sqrt (vecMass ψ) : ℂ) ≠ 0 := by + exact_mod_cast (Real.sqrt_ne_zero'.mpr (lt_of_le_of_ne (vecMass_nonneg ψ) (Ne.symm h))) + simp [normalize,h,smul_smul,hs] + +theorem normalize_mass [Inhabited ι] (ψ : ι → ℂ) : vecMass (normalize ψ) = 1 := by + by_cases h : vecMass ψ = 0 + · simp [normalize,h] + · have hs : Real.sqrt (vecMass ψ)*Real.sqrt (vecMass ψ) = vecMass ψ := Real.mul_self_sqrt (vecMass_nonneg ψ) + simp only [normalize, ite_eq_right h, vecMass_smul, map_inv₀, Complex.normSq_ofReal, hs] + exact inv_mul_cancel₀ h + +theorem normSq_normalize [Inhabited ι] (ψ : ι → ℂ) (i : ι) : + Complex.normSq (ψ i) = vecMass ψ * Complex.normSq (normalize ψ i) := by + calc + Complex.normSq (ψ i) = Complex.normSq (((Real.sqrt (vecMass ψ) : ℂ) • normalize ψ) i) := + congrArg (fun f : ι → ℂ ↦ Complex.normSq (f i)) (sqrt_mass_normalize ψ).symm + _ = _ := by simp [Complex.normSq_mul, Real.mul_self_sqrt (vecMass_nonneg ψ)] + +end + +section +open scoped BigOperators ComplexOrder +open Matrix + +def branch {n : ℕ} (ψ : Basis (n+1) → ℂ) (b : Fin 2) : Basis n → ℂ := + fun i ↦ ψ (Fin.cons b i) + +def population {n : ℕ} (ψ : Basis n → ℂ) (j : Fin n) : ℝ := + ∑ i, if i j = 1 then Complex.normSq (ψ i) else 0 + +theorem population_nonneg {n : ℕ} (ψ : Basis n → ℂ) (j : Fin n) : + 0 ≤ population ψ j := by + apply Finset.sum_nonneg + intro i _ + split_ifs + · exact Complex.normSq_nonneg _ + · rfl + +theorem population_le_mass {n : ℕ} (ψ : Basis n → ℂ) (j : Fin n) : + population ψ j ≤ vecMass ψ := by + apply Finset.sum_le_sum + intro i _ + split_ifs + · rfl + · exact Complex.normSq_nonneg _ + +theorem population_mem {n : ℕ} {ψ : Basis n → ℂ} (hψ : vecMass ψ = 1) (j : Fin n) : + population ψ j ∈ Set.Icc (0:ℝ) 1 := + ⟨population_nonneg ψ j, hψ ▸ population_le_mass ψ j⟩ + +theorem vecMass_branches {n : ℕ} (ψ : Basis (n+1) → ℂ) : + vecMass ψ = vecMass (branch ψ 0) + vecMass (branch ψ 1) := by + unfold vecMass + rw [sum_fin_cons] + simp [Fin.sum_univ_two,branch] + +theorem population_zero {n : ℕ} (ψ : Basis (n+1) → ℂ) : + population ψ 0 = vecMass (branch ψ 1) := by + unfold population + rw [sum_fin_cons] + simp [vecMass,branch] + +theorem population_succ {n : ℕ} (ψ : Basis (n+1) → ℂ) (j : Fin n) : + population ψ j.succ = population (branch ψ 0) j + population (branch ψ 1) j := by + unfold population + rw [sum_fin_cons] + simp [Fin.sum_univ_two,branch] + +theorem population_normalize {n : ℕ} (ψ : Basis n → ℂ) (j : Fin n) : + population ψ j = vecMass ψ * population (normalize ψ) j := by + simp only [population,Finset.mul_sum] + apply Finset.sum_congr rfl + intro i _ + split_ifs with h + · exact normSq_normalize ψ i + · exact (mul_zero _).symm + +def basisSplit (n : ℕ) : Basis n ⊕ Basis n ≃ Basis (n+1) where + toFun := Sum.elim (fun i : Basis n ↦ Fin.cons 0 i) (fun i : Basis n ↦ Fin.cons 1 i) + invFun i := if i 0 = 0 then Sum.inl (Fin.tail i) else Sum.inr (Fin.tail i) + left_inv i := by cases i <;> simp + right_inv i := by + have h := Fin.cons_self_tail i + have hi : i 0 = 0 ∨ i 0 = 1 := by have := (i 0).isLt; omega + rcases hi with hi | hi <;> simp [hi] at * <;> exact h + +@[simp] theorem basisSplit_inl {n : ℕ} (i : Basis n) : basisSplit n (Sum.inl i) = Fin.cons 0 i := rfl +@[simp] theorem basisSplit_inr {n : ℕ} (i : Basis n) : basisSplit n (Sum.inr i) = Fin.cons 1 i := rfl + +end + +open scoped BigOperators ComplexOrder MatrixOrder +open Matrix + +theorem channel_pure_apply (γ ν : ℝ) (n : ℕ) (ψ : Basis n → ℂ) (i j : Basis n) : + channel γ ν n (pure ψ) i j = + ∑ r, (tensorKraus γ ν n r *ᵥ ψ) i * star ((tensorKraus γ ν n r *ᵥ ψ) j) := by + simp only [channel,mul_pure_mul_conjTranspose,Matrix.sum_apply,pure] + +theorem tensorKraus_mulVec_cons (γ ν : ℝ) {n : ℕ} (r : Fin 4) (R : Fin n → Fin 4) + (ψ : Basis (n+1) → ℂ) (b : Fin 2) (i : Basis n) : + (tensorKraus γ ν (n+1) (Fin.cons r R) *ᵥ ψ) (Fin.cons b i) = + ∑ a : Fin 2, kraus γ ν r b a * (tensorKraus γ ν n R *ᵥ branch ψ a) i := by + simp only [Matrix.mulVec,dotProduct] + rw [sum_fin_cons] + simp only [tensorKraus,Fin.prod_univ_succ,Fin.cons_zero,Fin.cons_succ] + simp only [branch,Finset.mul_sum,mul_assoc] + +theorem channel_first_site_entry (γ ν : ℝ) {n : ℕ} (ψ : Basis (n+1) → ℂ) + (b c : Fin 2) (i j : Basis n) : + channel γ ν (n+1) (pure ψ) (Fin.cons b i) (Fin.cons c j) = + applyKraus (kraus γ ν) + (fun a d ↦ (columns (tensorKraus γ ν n) (branch ψ a) * + (columns (tensorKraus γ ν n) (branch ψ d)).conjTranspose) i j) b c := by + rw [channel_pure_apply,sum_fin_cons] + simp only [tensorKraus_mulVec_cons] + let u (R : Fin n → Fin 4) (a : Fin 2) (k : Basis n) := + (tensorKraus γ ν n R *ᵥ branch ψ a) k + change (∑ r : Fin 4, ∑ R : Fin n → Fin 4, + (∑ a : Fin 2, kraus γ ν r b a * u R a i) * + star (∑ d : Fin 2, kraus γ ν r c d * u R d j)) = + ∑ r : Fin 4, ∑ d : Fin 2, + (∑ a : Fin 2, kraus γ ν r b a * (∑ R : Fin n → Fin 4, u R a i * star (u R d j))) * + star (kraus γ ν r c d) + simp only [star_sum,star_mul,Finset.sum_mul,Finset.mul_sum] + apply Finset.sum_congr rfl + intro r _ + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro a _ + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro d _ + apply Finset.sum_congr rfl + intro R _ + ring + +theorem channel_branch_blocks (γ ν : ℝ) (hγ : γ ∈ Set.Icc (0:ℝ) 1) + (hν : ν ∈ Set.Icc (0:ℝ) 1) {n : ℕ} (ψ : Basis (n+1) → ℂ) : + Matrix.reindex (basisSplit n).symm (basisSplit n).symm (channel γ ν (n+1) (pure ψ)) = + thermal (columns (tensorKraus γ ν n) (branch ψ 0)) + (columns (tensorKraus γ ν n) (branch ψ 1)) + (1-γ*ν) (γ*(1-ν)) (γ*ν) (1-γ*(1-ν)) (Real.sqrt (1-γ)) := by + ext i j + rcases i with i | i <;> rcases j with j | j <;> + simp only [Matrix.reindex_apply,Matrix.submatrix_apply,Equiv.symm_symm,basisSplit_inl,basisSplit_inr, + channel_first_site_entry] + all_goals + rw [local_channel γ ν hγ hν (fun a d ↦ + (columns (tensorKraus γ ν n) (branch ψ a) * + (columns (tensorKraus γ ν n) (branch ψ d)).conjTranspose) i j)] + simp [thermal,gram] + +end GAD + +open scoped BigOperators ComplexOrder MatrixOrder +open Matrix +namespace GAD + +variable {ι : Type u_2} {κ : Type u_3} {ρ : Type u_4} [Fintype ι] [Fintype κ] [Fintype ρ] + [DecidableEq ι] [DecidableEq κ] [DecidableEq ρ] + +omit [Fintype ι] [Fintype ρ] [DecidableEq ι] [DecidableEq κ] [DecidableEq ρ] in +theorem columns_smul (L : ρ → Matrix ι κ ℂ) (ψ : κ → ℂ) (z : ℂ) : + columns L (z • ψ) = z • columns L ψ := by + ext i r + simp [columns, Matrix.mulVec_smul] + +omit [Fintype ι] [Fintype ρ] [DecidableEq ι] [DecidableEq ρ] in +theorem columns_normalize [Inhabited κ] (L : ρ → Matrix ι κ ℂ) (ψ : κ → ℂ) : + columns L ψ = Real.sqrt (vecMass ψ) • columns L (normalize ψ) := by + rw [← Complex.coe_smul, ← columns_smul, sqrt_mass_normalize] + +omit [Fintype ι] [DecidableEq ι] [DecidableEq κ] [DecidableEq ρ] in +theorem gram_columns (L : ρ → Matrix ι κ ℂ) (ψ : κ → ℂ) : + gram (columns L ψ) = applyKraus L (pure ψ) := columns_pure L ψ + +theorem mass_channel_columns (γ ν : ℝ) (hγ : γ ∈ Set.Icc (0:ℝ) 1) + (hν : ν ∈ Set.Icc (0:ℝ) 1) (n : ℕ) (ψ : Basis n → ℂ) : + mass (columns (tensorKraus γ ν n) ψ) = vecMass ψ := by + unfold mass + rw [gram_columns] + change (channel γ ν n (pure ψ)).trace.re = _ + rw [channel_trace γ ν hγ hν, pure_trace,Complex.ofReal_re] + +omit [Fintype ι] [DecidableEq ι] [DecidableEq κ] in +theorem thermal_sqrt_smul (X Y : Matrix ι κ ℂ) (a b c d K : ℝ) + {x y : ℝ} (hx : 0 ≤ x) (hy : 0 ≤ y) : + thermal (Real.sqrt x • X) (Real.sqrt y • Y) a b c d K = + thermal X Y (a*x) (b*y) (c*x) (d*y) (K*Real.sqrt x*Real.sqrt y) := by + simp only [thermal,gram_sqrt_smul hx,gram_sqrt_smul hy,smul_smul, + Matrix.conjTranspose_smul, star_trivial,Matrix.smul_mul,Matrix.mul_smul] + congr 1 + · congr 1; ring + · congr 1; ring + +theorem channel_state (γ ν : ℝ) (hγ : γ ∈ Set.Icc (0:ℝ) 1) + (hν : ν ∈ Set.Icc (0:ℝ) 1) (n : ℕ) {P : QMatrix n} (hP : IsState P) : + IsState (channel γ ν n P) := + ⟨channel_posSemidef _ _ _ hP.1, (channel_trace γ ν hγ hν n P).trans hP.2⟩ + +theorem output_entropy_recursion (γ ν : ℝ) (hγ : γ ∈ Set.Icc (0:ℝ) 1) + (hν : ν ∈ Set.Icc (0:ℝ) 1) {n : ℕ} (ψ : Basis (n+1) → ℂ) + (hψ : vecMass ψ = 1) : + vecMass (branch ψ 0) * entropy (channel γ ν n (pure (normalize (branch ψ 0)))) + + vecMass (branch ψ 1) * entropy (channel γ ν n (pure (normalize (branch ψ 1)))) + + g (v γ ν (population ψ 0)) ≤ entropy (channel γ ν (n+1) (pure ψ)) := by + let x := vecMass (branch ψ 0) + let y := vecMass (branch ψ 1) + let X := columns (tensorKraus γ ν n) (normalize (branch ψ 0)) + let Y := columns (tensorKraus γ ν n) (normalize (branch ψ 1)) + have hx : 0 ≤ x := vecMass_nonneg _ + have hy : 0 ≤ y := vecMass_nonneg _ + have hxy : x+y=1 := (vecMass_branches ψ).symm.trans hψ + have hxy' : x=1-y := by linarith + have hX : mass X = 1 := (mass_channel_columns γ ν hγ hν n _).trans (normalize_mass _) + have hY : mass Y = 1 := (mass_channel_columns γ ν hγ hν n _).trans (normalize_mass _) + have h1ν : 0 ≤ 1-ν := sub_nonneg.mpr hν.2 + have h1γ : 0 ≤ 1-γ := sub_nonneg.mpr hγ.2 + have h1γν : 0 ≤ 1-γ*ν := by nlinarith [hγ.2, mul_nonneg hγ.1 h1ν] + have h1γν' : 0 ≤ 1-γ*(1-ν) := by nlinarith [hγ.2, mul_nonneg hγ.1 hν.1] + have hKsq : (Real.sqrt (1-γ)*Real.sqrt x*Real.sqrt y)^2 = (1-γ)*x*y := by + rw [mul_pow,mul_pow,Real.sq_sqrt h1γ,Real.sq_sqrt hx,Real.sq_sqrt hy] + have hh := thermal_entropy X Y hX hY + (mul_nonneg h1γν hx) (mul_nonneg (mul_nonneg hγ.1 h1ν) hy) + (mul_nonneg (mul_nonneg hγ.1 hν.1) hx) (mul_nonneg h1γν' hy) + (mul_nonneg (mul_nonneg (Real.sqrt_nonneg _) (Real.sqrt_nonneg _)) (Real.sqrt_nonneg _)) + (show (1-γ*ν)*x+γ*(1-ν)*y+γ*ν*x+(1-γ*(1-ν))*y=1 by nlinarith only [hxy]) + (show ((1-γ*ν)*x)*((1-γ*(1-ν))*y)-(γ*(1-ν)*y)*(γ*ν*x)= + (Real.sqrt (1-γ)*Real.sqrt x*Real.sqrt y)^2 by rw [hKsq]; ring) + have hcolx : (1-γ*ν)*x+γ*ν*x=x := by ring + have hcoly : γ*(1-ν)*y+(1-γ*(1-ν))*y=y := by ring + have hu : ((1-γ*ν)*x+γ*(1-ν)*y)*(γ*ν*x+(1-γ*(1-ν))*y)- + (Real.sqrt (1-γ)*Real.sqrt x*Real.sqrt y)^2 = v γ ν y := by + rw [hKsq,hxy']; unfold v; ring + have heq : Matrix.reindex (basisSplit n).symm (basisSplit n).symm + (channel γ ν (n+1) (pure ψ)) = + thermal X Y ((1-γ*ν)*x) (γ*(1-ν)*y) (γ*ν*x) ((1-γ*(1-ν))*y) + (Real.sqrt (1-γ)*Real.sqrt x*Real.sqrt y) := by + rw [channel_branch_blocks γ ν hγ hν,columns_normalize _ (branch ψ 0), + columns_normalize _ (branch ψ 1),thermal_sqrt_smul _ _ _ _ _ _ _ hx hy] + have hent := entropy_reindex (basisSplit n).symm + (channel_posSemidef γ ν (n+1) (pure_posSemidef ψ)).isHermitian + rw [heq] at hent + have hbound := hh.2.2 + rw [hcolx,hcoly,hu,hent] at hbound + simpa only [x,y,X,Y,gram_columns,population_zero,channel,applyKraus] using hbound + +end GAD + +end + +end OAI diff --git a/lean/OAI/InformationTheory/AmplitudeDamping/ScalarDeficit.lean b/lean/OAI/InformationTheory/AmplitudeDamping/ScalarDeficit.lean new file mode 100644 index 0000000000000000000000000000000000000000..e2beff56b00426280c7a5adbb7bd09c9d94a1c0f --- /dev/null +++ b/lean/OAI/InformationTheory/AmplitudeDamping/ScalarDeficit.lean @@ -0,0 +1,330 @@ +import OAI.InformationTheory.AmplitudeDamping.GramMatrices + +namespace OAI + +universe u_1 u_2 + +noncomputable section +open scoped BigOperators Matrix.Norms.Elementwise +open Matrix +open scoped BigOperators ComplexOrder MatrixOrder +open scoped Matrix.Norms.Elementwise ComplexOrder MatrixOrder +open Matrix Set +open scoped ComplexOrder MatrixOrder +open scoped BigOperators Topology +open Filter Set +open scoped BigOperators ComplexOrder MatrixOrder Topology + +open scoped BigOperators ComplexOrder +open Matrix Set +namespace GAD + +def blockLambdaPlus (x y z : ℝ) : ℝ := + ((x + y + z) + Real.sqrt ((x + y + z)^2 - 4*y*z)) / 2 + +def blockLambdaMinus (x y z : ℝ) : ℝ := + ((x + y + z) - Real.sqrt ((x + y + z)^2 - 4*y*z)) / 2 + +def scalarDeficit (x y z : ℝ) : ℝ := + Real.negMulLog x + Real.negMulLog y + Real.negMulLog z - + Real.negMulLog (blockLambdaPlus x y z) - Real.negMulLog (blockLambdaMinus x y z) + +theorem blockLambda_properties {x y z : ℝ} (hx : 0 ≤ x) (hy : 0 ≤ y) (hz : 0 ≤ z) : + 0 ≤ blockLambdaPlus x y z ∧ 0 ≤ blockLambdaMinus x y z ∧ + blockLambdaPlus x y z + blockLambdaMinus x y z = x + y + z ∧ + blockLambdaPlus x y z * blockLambdaMinus x y z = y*z := by + have hd : 0 ≤ (x+y+z)^2 - 4*y*z := by + nlinarith [sq_nonneg (y-z), mul_nonneg hx (by linarith : 0 ≤ y+z)] + have hs := Real.sq_sqrt hd + have hsr := Real.sqrt_nonneg ((x+y+z)^2-4*y*z) + have hle : Real.sqrt ((x+y+z)^2-4*y*z) ≤ x+y+z := by + nlinarith [mul_nonneg hy hz] + dsimp [blockLambdaPlus, blockLambdaMinus] + refine ⟨by positivity, by linarith, by ring, ?_⟩ + nlinarith + +def deficitSpectrum (x y z : ℝ) : Fin 5 → ℝ := + ![x, y, z, blockLambdaPlus x y z, blockLambdaMinus x y z] + +def deficitSigns : Fin 5 → ℝ := ![1, 1, 1, -1, -1] + +def deficitLog (x y z t : ℝ) : ℝ := + Real.log (1 + x/t) - Real.log (1 + t*x/((t+y)*(t+z))) + +theorem deficitSpectrum_nonneg {x y z : ℝ} (hx : 0 ≤ x) (hy : 0 ≤ y) (hz : 0 ≤ z) + (i : Fin 5) : 0 ≤ deficitSpectrum x y z i := by + have h := blockLambda_properties hx hy hz + fin_cases i <;> simp [deficitSpectrum] <;> tauto + +theorem deficitSpectrum_trace {x y z : ℝ} (hx : 0 ≤ x) (hy : 0 ≤ y) (hz : 0 ≤ z) : + ∑ i, deficitSigns i * deficitSpectrum x y z i = 0 := by + have h := (blockLambda_properties hx hy hz).2.2.1 + simp [deficitSpectrum, deficitSigns, Fin.sum_univ_succ] + linarith + +theorem deficitSpectrum_entropy (x y z : ℝ) : + ∑ i, deficitSigns i * Real.negMulLog (deficitSpectrum x y z i) = scalarDeficit x y z := by + simp [deficitSpectrum, deficitSigns, scalarDeficit, Fin.sum_univ_succ] + ring + +theorem deficitSpectrum_log {x y z t : ℝ} (hx : 0 ≤ x) (hy : 0 ≤ y) (hz : 0 ≤ z) + (ht : 0 < t) : + ∑ i, deficitSigns i * Real.log (1 + deficitSpectrum x y z i / t) = deficitLog x y z t := by + obtain ⟨hlp, hlm, hsum, hprod⟩ := blockLambda_properties hx hy hz + have hn (a : ℝ) (ha : 0 ≤ a) : 1 + a/t ≠ 0 := ne_of_gt (by positivity) + have hty : t+y ≠ 0 := by linarith + have htz : t+z ≠ 0 := by linarith + have hid : (1 + blockLambdaPlus x y z/t) * (1 + blockLambdaMinus x y z/t) = + (1+y/t)*(1+z/t)*(1+t*x/((t+y)*(t+z))) := by + field_simp + nlinarith [hsum, hprod] + have hlast : 1+t*x/((t+y)*(t+z)) ≠ 0 := ne_of_gt (by positivity) + simp only [deficitSigns, deficitSpectrum, Fin.sum_univ_succ, Matrix.cons_val_zero, + Matrix.cons_val_succ, Matrix.cons_val_fin_one, one_mul, neg_one_mul] + have hh := congrArg Real.log hid + rw [Real.log_mul (hn _ hlp) (hn _ hlm), + Real.log_mul (mul_ne_zero (hn _ hy) (hn _ hz)) hlast, + Real.log_mul (hn _ hy) (hn _ hz)] at hh + dsimp [deficitLog] + linarith + +/-- Finite weighted scalar deficits inherit every pointwise logarithmic comparison. -/ +theorem scalarDeficit_weighted_le_of_log_le {α : Type u_1} [Fintype α] + (c x y z : α → ℝ) (hx : ∀ i, 0 ≤ x i) (hy : ∀ i, 0 ≤ y i) (hz : ∀ i, 0 ≤ z i) + (hlog : ∀ t : ℝ, 0 < t → ∑ i, c i * deficitLog (x i) (y i) (z i) t ≤ 0) : + ∑ i, c i * scalarDeficit (x i) (y i) (z i) ≤ 0 := by + have h := entropy_sum_le_of_log_sum_le + (fun i : α × Fin 5 ↦ c i.1 * deficitSigns i.2) + (fun i ↦ deficitSpectrum (x i.1) (y i.1) (z i.1) i.2) + (fun i ↦ deficitSpectrum_nonneg (hx i.1) (hy i.1) (hz i.1) i.2) ?_ ?_ + · simpa only [Fintype.sum_prod_type, mul_assoc, ← Finset.mul_sum, + deficitSpectrum_entropy] using h + · simp only [Fintype.sum_prod_type, mul_assoc, ← Finset.mul_sum, + deficitSpectrum_trace (hx _) (hy _) (hz _), mul_zero, Finset.sum_const_zero] + · intro t ht + simpa only [Fintype.sum_prod_type, mul_assoc, ← Finset.mul_sum, + deficitSpectrum_log (hx _) (hy _) (hz _) ht] using hlog t ht + +/-- Scalar specialization of the noncommutative logdet function. -/ +theorem blockLogDet_scalar {q d e : ℝ} (hq : 0 ≤ q) (hd : 0 < d) (he : 0 < e) : + blockLogDet (Matrix.diagonal (fun _ : Fin 1 ↦ (Real.sqrt q : ℂ))) + (Matrix.diagonal (fun _ ↦ (d : ℂ))) (Matrix.diagonal (fun _ ↦ (e : ℂ))) = + Real.log (1 + q/(d*e)) := by + have hs : (Real.sqrt q : ℂ) * (Real.sqrt q : ℂ) = (q : ℂ) := by + exact_mod_cast Real.mul_self_sqrt hq + have ht : 0 < d + q/e := add_pos_of_pos_of_nonneg hd (div_nonneg hq he.le) + have heq : d + q/e = d*(1+q/(d*e)) := by field_simp + have hinv : Ring.inverse (fun _ : Fin 1 ↦ (e : ℂ)) = fun _ ↦ (e : ℂ)⁻¹ := by + let u : (Fin 1 → ℂ)ˣ := ⟨fun _ ↦ (e : ℂ), fun _ ↦ (e : ℂ)⁻¹, + by ext; simp [he.ne'], by ext; simp [he.ne']⟩ + exact Ring.inverse_unit u + simp only [blockLogDet, Matrix.inv_diagonal, Matrix.diagonal_conjTranspose, + Matrix.diagonal_mul_diagonal, Matrix.det_fin_one, Matrix.add_apply, + Matrix.diagonal_apply_eq, hinv, Pi.star_apply, Complex.star_def, Complex.conj_ofReal] + have hc : (d : ℂ) + (Real.sqrt q : ℂ) * (e : ℂ)⁻¹ * (Real.sqrt q : ℂ) = + ((d+q/e : ℝ) : ℂ) := by + push_cast + rw [div_eq_mul_inv] + calc + _ = (d : ℂ) + ((Real.sqrt q : ℂ)*(Real.sqrt q : ℂ)) * (e : ℂ)⁻¹ := by ring + _ = _ := by rw [hs] + rw [hc] + simp only [Complex.norm_real, Real.norm_eq_abs, abs_of_pos ht, abs_of_pos hd] + rw [heq, Real.log_mul hd.ne' (ne_of_gt (by positivity : 0 < 1+q/(d*e)))] + ring + +end GAD +open scoped BigOperators ComplexOrder +open Matrix Set +namespace GAD + +theorem convexOn_log_one_add_div_mul {q : ℝ} (hq : 0 ≤ q) : + ConvexOn ℝ {p : ℝ × ℝ | 0 < p.1 ∧ 0 < p.2} + (fun p ↦ Real.log (1 + q/(p.1*p.2))) := by + let Z : Matrix (Fin 1) (Fin 1) ℂ := Matrix.diagonal (fun _ ↦ (Real.sqrt q : ℂ)) + let diag (d : ℝ) : Matrix (Fin 1) (Fin 1) ℂ := Matrix.diagonal (fun _ ↦ (d : ℂ)) + have hp {d : ℝ} (hd : 0 < d) : (diag d).PosDef := by + apply Matrix.PosDef.diagonal + intro i + exact_mod_cast hd + have hl (a b d e : ℝ) : a • diag d + b • diag e = diag (a*d+b*e) := by + ext i j + fin_cases i; fin_cases j + simp [diag] + refine ⟨?_, ?_⟩ + · intro p hp q hq a b ha hb hab + exact ⟨convex_Ioi (𝕜 := ℝ) (0 : ℝ) hp.1 hq.1 ha hb hab, convex_Ioi (𝕜 := ℝ) (0 : ℝ) hp.2 hq.2 ha hb hab⟩ + intro p hp' v hv a b ha hb hab + have h := (convexOn_blockLogDet Z).2 (x := (diag p.1,diag p.2)) (y := (diag v.1,diag v.2)) + ⟨hp hp'.1, hp hp'.2⟩ ⟨hp hv.1, hp hv.2⟩ ha hb hab + have hd : 0 < a*p.1+b*v.1 := convex_Ioi (𝕜 := ℝ) (0 : ℝ) hp'.1 hv.1 ha hb hab + have he : 0 < a*p.2+b*v.2 := convex_Ioi (𝕜 := ℝ) (0 : ℝ) hp'.2 hv.2 ha hb hab + change blockLogDet Z (a • diag p.1+b • diag v.1) (a • diag p.2+b • diag v.2) ≤ _ at h + rw [hl, hl] at h + simpa only [Z, diag, blockLogDet_scalar hq hp'.1 hp'.2, + blockLogDet_scalar hq hv.1 hv.2, blockLogDet_scalar hq hd he, + Prod.fst_add, Prod.snd_add, Prod.smul_fst, Prod.smul_snd, smul_eq_mul] using h + +theorem concaveOn_deficitLog_one {t : ℝ} (ht : 0 < t) : + ConcaveOn ℝ {p : ℝ × ℝ | 0 ≤ p.1 ∧ 0 ≤ p.2} + (fun p ↦ deficitLog 1 p.1 p.2 t) := by + refine ⟨?_, ?_⟩ + · intro p hp q hq a b ha hb _ + exact ⟨add_nonneg (mul_nonneg ha hp.1) (mul_nonneg hb hq.1), + add_nonneg (mul_nonneg ha hp.2) (mul_nonneg hb hq.2)⟩ + intro p hp q hq a b ha hb hab + have h := (convexOn_log_one_add_div_mul ht.le).2 + (x := (t+p.1,t+p.2)) (y := (t+q.1,t+q.2)) + ⟨by simpa using add_pos_of_pos_of_nonneg ht hp.1, + by simpa using add_pos_of_pos_of_nonneg ht hp.2⟩ + ⟨by simpa using add_pos_of_pos_of_nonneg ht hq.1, + by simpa using add_pos_of_pos_of_nonneg ht hq.2⟩ ha hb hab + have he (u v : ℝ) : a*(t+u)+b*(t+v) = t+(a*u+b*v) := by nlinarith [hab] + simp only [Prod.fst_add, Prod.snd_add, Prod.smul_fst, Prod.smul_snd, smul_eq_mul, + he, deficitLog, mul_one] at h ⊢ + nlinarith [congrArg (fun v : ℝ ↦ v * Real.log (1+1/t)) hab] + +theorem concaveOn_scalarDeficit_one : + ConcaveOn ℝ {p : ℝ × ℝ | 0 ≤ p.1 ∧ 0 ≤ p.2} + (fun p ↦ scalarDeficit 1 p.1 p.2) := by + refine ⟨?_, ?_⟩ + · intro p hp q hq a b ha hb _ + exact ⟨add_nonneg (mul_nonneg ha hp.1) (mul_nonneg hb hq.1), + add_nonneg (mul_nonneg ha hp.2) (mul_nonneg hb hq.2)⟩ + intro p hp q hq a b ha hb hab + have hy : ∀ i : Fin 3, 0 ≤ (![p.1,q.1,a*p.1+b*q.1] : Fin 3 → ℝ) i := by + intro i; fin_cases i <;> simp + · exact hp.1 + · exact hq.1 + · exact add_nonneg (mul_nonneg ha hp.1) (mul_nonneg hb hq.1) + have hz : ∀ i : Fin 3, 0 ≤ (![p.2,q.2,a*p.2+b*q.2] : Fin 3 → ℝ) i := by + intro i; fin_cases i <;> simp + · exact hp.2 + · exact hq.2 + · exact add_nonneg (mul_nonneg ha hp.2) (mul_nonneg hb hq.2) + have h := scalarDeficit_weighted_le_of_log_le ![a,b,-1] (fun _ : Fin 3 ↦ 1) + ![p.1,q.1,a*p.1+b*q.1] ![p.2,q.2,a*p.2+b*q.2] (by intro i; positivity) hy hz + (by + intro t ht + have h := (concaveOn_deficitLog_one ht).2 hp hq ha hb hab + simp only [Fin.sum_univ_succ, Fin.sum_univ_zero, add_zero, Matrix.cons_val_zero, Matrix.cons_val_succ, + Matrix.cons_val_fin_one, neg_one_mul, Prod.fst_add, Prod.snd_add, + Prod.smul_fst, Prod.smul_snd, smul_eq_mul] at h ⊢ + linarith) + simp only [Fin.sum_univ_succ, Fin.sum_univ_zero, add_zero, Matrix.cons_val_zero, Matrix.cons_val_succ, + Matrix.cons_val_fin_one, neg_one_mul, Prod.fst_add, Prod.snd_add, + Prod.smul_fst, Prod.smul_snd, smul_eq_mul] at h ⊢ + linarith + +theorem deficitLog_mono {x y z y' z' t : ℝ} (hx : 0 ≤ x) (hy : 0 ≤ y) (hz : 0 ≤ z) + (hyy : y ≤ y') (hzz : z ≤ z') (ht : 0 < t) : + deficitLog x y z t ≤ deficitLog x y' z' t := by + have hden : (t+y)*(t+z) ≤ (t+y')*(t+z') := + mul_le_mul (by linarith) (by linarith) (by linarith) (by linarith) + have hdiv := div_le_div_of_nonneg_left (mul_nonneg ht.le hx) + (by positivity : 0 < (t+y)*(t+z)) hden + have hlog := Real.strictMonoOn_log.monotoneOn + (show 1+t*x/((t+y')*(t+z')) ∈ Ioi 0 by change (0 : ℝ) < _; have : 0 ≤ y' := hy.trans hyy; have : 0 ≤ z' := hz.trans hzz; positivity) + (show 1+t*x/((t+y)*(t+z)) ∈ Ioi 0 by change (0 : ℝ) < _; positivity) + (add_le_add_right hdiv 1) + dsimp only [deficitLog] + linarith + +theorem scalarDeficit_mono {x y z y' z' : ℝ} (hx : 0 ≤ x) (hy : 0 ≤ y) (hz : 0 ≤ z) + (hyy : y ≤ y') (hzz : z ≤ z') : scalarDeficit x y z ≤ scalarDeficit x y' z' := by + have h := scalarDeficit_weighted_le_of_log_le ![1,-1] (fun _ : Fin 2 ↦ x) + ![y,y'] ![z,z'] (fun _ ↦ hx) + (by intro i; fin_cases i <;> simp; exact hy; exact hy.trans hyy) + (by intro i; fin_cases i <;> simp; exact hz; exact hz.trans hzz) + (by + intro t ht + have h := deficitLog_mono hx hy hz hyy hzz ht + simpa [Fin.sum_univ_succ] using sub_nonpos.mpr h) + simpa [Fin.sum_univ_succ, sub_nonpos] using h + +theorem scalarDeficit_zero {y z : ℝ} (hy : 0 ≤ y) (hz : 0 ≤ z) : + scalarDeficit 0 y z = 0 := by + have h (c : ℝ) : c * scalarDeficit 0 y z ≤ 0 := by + have h := scalarDeficit_weighted_le_of_log_le (fun _ : Fin 1 ↦ c) (fun _ ↦ 0) + (fun _ ↦ y) (fun _ ↦ z) (fun _ ↦ le_rfl) (fun _ ↦ hy) (fun _ ↦ hz) + (by intro t ht; simp [deficitLog]) + simpa using h + have hp := h 1 + have hm := h (-1) + linarith + +theorem scalarDeficit_homogeneous {a x y z : ℝ} (ha : 0 ≤ a) + (hx : 0 ≤ x) (hy : 0 ≤ y) (hz : 0 ≤ z) : + scalarDeficit (a*x) (a*y) (a*z) = a * scalarDeficit x y z := by + have hs : Real.sqrt ((a*x+a*y+a*z)^2-4*(a*y)*(a*z)) = + a * Real.sqrt ((x+y+z)^2-4*y*z) := by + rw [show (a*x+a*y+a*z)^2-4*(a*y)*(a*z) = a^2*((x+y+z)^2-4*y*z) by ring, + Real.sqrt_mul (sq_nonneg a), Real.sqrt_sq ha] + have hp : blockLambdaPlus (a*x) (a*y) (a*z) = a * blockLambdaPlus x y z := by + dsimp [blockLambdaPlus]; rw [hs]; ring + have hm : blockLambdaMinus (a*x) (a*y) (a*z) = a * blockLambdaMinus x y z := by + dsimp [blockLambdaMinus]; rw [hs]; ring + have hsum := (blockLambda_properties hx hy hz).2.2.1 + simp only [scalarDeficit, hp, hm, Real.negMulLog_mul] + nlinarith [congrArg (fun v : ℝ ↦ v * Real.negMulLog a) hsum] + +theorem scalarDeficit_perspective {x y z : ℝ} (hx : 0 < x) (hy : 0 ≤ y) (hz : 0 ≤ z) : + scalarDeficit x y z = x * scalarDeficit 1 (y/x) (z/x) := by + have h := scalarDeficit_homogeneous hx.le (show (0 : ℝ) ≤ 1 by norm_num) + (div_nonneg hy hx.le) (div_nonneg hz hx.le) + simpa [mul_div_cancel₀ _ hx.ne'] using h + +theorem scalarDeficit_superadd {x y z x' y' z' : ℝ} + (hx : 0 ≤ x) (hy : 0 ≤ y) (hz : 0 ≤ z) + (hx' : 0 ≤ x') (hy' : 0 ≤ y') (hz' : 0 ≤ z') : + scalarDeficit x y z + scalarDeficit x' y' z' ≤ + scalarDeficit (x+x') (y+y') (z+z') := by + by_cases h0 : x = 0 + · subst x + rw [scalarDeficit_zero hy hz, zero_add, zero_add] + exact scalarDeficit_mono hx' hy' hz' (by linarith) (by linarith) + by_cases h0' : x' = 0 + · subst x' + rw [scalarDeficit_zero hy' hz', add_zero, add_zero] + exact scalarDeficit_mono hx hy hz (by linarith) (by linarith) + have hxp : 0 < x := lt_of_le_of_ne hx (Ne.symm h0) + have hxp' : 0 < x' := lt_of_le_of_ne hx' (Ne.symm h0') + have hs : 0 < x+x' := add_pos hxp hxp' + have h := concaveOn_scalarDeficit_one.2 + (x := (y/x,z/x)) (y := (y'/x',z'/x')) + ⟨div_nonneg hy hx, div_nonneg hz hx⟩ ⟨div_nonneg hy' hx', div_nonneg hz' hx'⟩ + (div_nonneg hx hs.le) (div_nonneg hx' hs.le) + (show x/(x+x') + x'/(x+x') = 1 by field_simp) + simp only [Prod.fst_add, Prod.snd_add, Prod.smul_fst, Prod.smul_snd, smul_eq_mul] at h + have he (a b : ℝ) : x/(x+x')*(a/x) + x'/(x+x')*(b/x') = (a+b)/(x+x') := by + field_simp + rw [he, he] at h + have hm := mul_le_mul_of_nonneg_left h hs.le + rw [scalarDeficit_perspective hxp hy hz, + scalarDeficit_perspective hxp' hy' hz', + scalarDeficit_perspective hs (add_nonneg hy hy') (add_nonneg hz hz')] + convert hm using 1; first | rfl | field_simp + +theorem scalarDeficit_sum_le {ι : Type u_2} (s : Finset ι) (x y z : ι → ℝ) + (hx : ∀ i ∈ s, 0 ≤ x i) (hy : ∀ i ∈ s, 0 ≤ y i) (hz : ∀ i ∈ s, 0 ≤ z i) : + ∑ i ∈ s, scalarDeficit (x i) (y i) (z i) ≤ + scalarDeficit (∑ i ∈ s, x i) (∑ i ∈ s, y i) (∑ i ∈ s, z i) := by + classical + induction s using Finset.induction_on with + | empty => simp [scalarDeficit_zero (le_refl 0) (le_refl 0)] + | @insert i s hi ih => + simp only [Finset.sum_insert hi] + have hxs := fun j hj ↦ hx j (Finset.mem_insert_of_mem hj) + have hys := fun j hj ↦ hy j (Finset.mem_insert_of_mem hj) + have hzs := fun j hj ↦ hz j (Finset.mem_insert_of_mem hj) + calc + _ ≤ scalarDeficit (x i) (y i) (z i) + scalarDeficit (∑ j ∈ s, x j) (∑ j ∈ s, y j) (∑ j ∈ s, z j) := add_le_add le_rfl (ih hxs hys hzs) + _ ≤ _ := scalarDeficit_superadd (hx i (Finset.mem_insert_self i s)) + (hy i (Finset.mem_insert_self i s)) (hz i (Finset.mem_insert_self i s)) + (Finset.sum_nonneg hxs) (Finset.sum_nonneg hys) (Finset.sum_nonneg hzs) + +end GAD + +end + +end OAI diff --git a/lean/OAI/InformationTheory/AmplitudeDamping/SequentialDecoder.lean b/lean/OAI/InformationTheory/AmplitudeDamping/SequentialDecoder.lean new file mode 100644 index 0000000000000000000000000000000000000000..ef9a02634d48893b961088291d89a08cb4075b60 --- /dev/null +++ b/lean/OAI/InformationTheory/AmplitudeDamping/SequentialDecoder.lean @@ -0,0 +1,163 @@ +import OAI.InformationTheory.AmplitudeDamping.TypicalProjectors + +namespace OAI + +universe u_1 + +noncomputable section +open scoped BigOperators ComplexOrder MatrixOrder +open Matrix +namespace GAD +variable {ι : Type u_1} [Fintype ι] [DecidableEq ι] + +def finiteProjectors {M : ℕ} (Q : Fin M → Matrix ι ι ℂ) (k : ℕ) : Matrix ι ι ℂ := + if h : k 1 + | k+1 => (1-Q k)*rejectProduct Q k + +theorem rejectProduct_loss (Q : ℕ → Matrix ι ι ℂ) (hQ : ∀ k, IsProjection (Q k)) (k : ℕ) : + (rejectProduct Q k)ᴴ*rejectProduct Q k- + (rejectProduct Q (k+1))ᴴ*rejectProduct Q (k+1)= + (rejectProduct Q k)ᴴ*Q k*rejectProduct Q k := by + rw [rejectProduct,Matrix.conjTranspose_mul,(hQ k).complement.1.eq] + have he : (rejectProduct Q k)ᴴ*(1-Q k)*((1-Q k)*rejectProduct Q k)= + (rejectProduct Q k)ᴴ*(1-Q k)*rejectProduct Q k := by + rw [← Matrix.mul_assoc _ (1-Q k),Matrix.mul_assoc (rejectProduct Q k)ᴴ, + (hQ k).complement.2] + rw [he,Matrix.mul_sub,Matrix.mul_one,Matrix.sub_mul] + abel + +theorem rejectProduct_sum (Q : ℕ → Matrix ι ι ℂ) (hQ : ∀ k, IsProjection (Q k)) (n : ℕ) : + (∑ k ∈ Finset.range n, (rejectProduct Q k)ᴴ*Q k*rejectProduct Q k)= + 1-(rejectProduct Q n)ᴴ*rejectProduct Q n := by + simp_rw [← rejectProduct_loss Q hQ] + rw [Finset.sum_range_sub'] + simp [rejectProduct] + +theorem sequential_projector_success (Q : ℕ → Matrix ι ι ℂ) + (hQ : ∀ k, IsProjection (Q k)) (Y : Matrix ι κ ℂ) (m : ℕ) : + mass Y-mass (Q m*rejectProduct Q m*Y) ≤ + 4*(mass (Y-Q m*Y)+∑ j ∈ Finset.range m, mass (Q j*Y)) := by + let P : ℕ → Matrix ι ι ℂ := fun k ↦ if k=m then Q m else 1-Q k + have hp (k : ℕ) : IsProjection (P k) := by + dsimp [P]; split_ifs + · exact hQ m + · exact (hQ k).complement + -- Only the first m+1 recurrence steps matter; use a genuine recursively defined sequence. + let Z : ℕ → Matrix ι κ ℂ := fun k ↦ Nat.rec Y (fun j A ↦ P j*A) k + have hz (k : ℕ) : Z (k+1)=P k*Z k := rfl + have hZ (k : ℕ) (hk : k ≤ m) : Z k=rejectProduct Q k*Y := by + induction k with + | zero => simp [Z,rejectProduct] + | succ k ih => + rw [hz,ih (by omega)] + have hkm : k ≠ m := by omega + simp only [P,ite_eq_right hkm,rejectProduct,Matrix.mul_assoc] + have hZend : Z (m+1)=Q m*rejectProduct Q m*Y := by + rw [hz,hZ m le_rfl]; simp only [P,ite_eq_left rfl,Matrix.mul_assoc] + have h := matrix_sequential_union_bound P hp Z hz (m+1) + have hZ0 : Z 0=Y := rfl + rw [hZ0,hZend,Finset.sum_range_succ] at h + have hs : (∑ j ∈ Finset.range m, mass (Y-P j*Y))=∑ j ∈ Finset.range m, mass (Q j*Y) := by + apply Finset.sum_congr rfl + intro j hj + have hjm : j ≠ m := by have := Finset.mem_range.mp hj; omega + simp only [P,ite_eq_right hjm,Matrix.sub_mul,Matrix.one_mul,sub_sub_cancel] + rw [hs] at h + simpa only [P,ite_eq_left rfl,add_comm] using h + +omit [DecidableEq ι] in +theorem mass_triangle_sq (X Y : Matrix ι κ ℂ) : mass (X+Y) ≤ 2*mass X+2*mass Y := by + have h := norm_sub_sq_real (frobVector X) (frobVector Y) + rw [mass_add,← frobVector_norm X,← frobVector_norm Y] + nlinarith [sq_nonneg ‖frobVector X-frobVector Y‖] + +theorem projected_self_failure {P Q : Matrix ι ι ℂ} (hQ : IsProjection Q) + (F : Matrix ι κ ℂ) : mass (P*F-Q*(P*F)) ≤ 2*mass (F-Q*F)+2*mass (F-P*F) := by + have he : P*F-Q*(P*F)=(F-Q*F)+(-(1-Q)*(F-P*F)) := by + simp only [Matrix.neg_mul,Matrix.sub_mul,Matrix.one_mul,Matrix.mul_sub] + abel + rw [he] + have hb := mass_triangle_sq (F-Q*F) (-(1-Q)*(F-P*F)) + have hn : mass (-(1-Q)*(F-P*F))=mass ((1-Q)*(F-P*F)) := by + rw [Matrix.neg_mul,← neg_one_smul ℝ ((1-Q)*(F-P*F)),mass_real_smul] + norm_num + rw [hn] at hb + have hc := projection_mass_le hQ.complement (F-P*F) + linarith + +end GAD + +end + +end OAI diff --git a/lean/OAI/InformationTheory/AmplitudeDamping/SequentialProjections.lean b/lean/OAI/InformationTheory/AmplitudeDamping/SequentialProjections.lean new file mode 100644 index 0000000000000000000000000000000000000000..b03ccd058c6fca2eff5c139ee95a02939a867aeb --- /dev/null +++ b/lean/OAI/InformationTheory/AmplitudeDamping/SequentialProjections.lean @@ -0,0 +1,60 @@ +import OAI.InformationTheory.AmplitudeDamping.Model + +namespace OAI + +universe u_1 + +noncomputable section +open scoped BigOperators InnerProductSpace +namespace GAD + +/-- The elementary sequential-projector union bound. -/ +theorem sequential_union_bound {E : Type u_1} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + (P : ℕ → E → E) (hP : ∀ i x y, ⟪P i x, y-P i y⟫_ℝ = 0) + (u : ℕ → E) (hu : ∀ i, u (i+1)=P i (u i)) (n : ℕ) : + ‖u 0‖^2-‖u n‖^2 ≤ 4 * ∑ i ∈ Finset.range n, ‖u 0-P i (u 0)‖^2 := by + let d : ℕ → E := fun i ↦ u i-u (i+1) + have hi (i : ℕ) : ⟪P i (u 0), d i⟫_ℝ=0 := by + dsimp [d]; rw [hu]; exact hP i _ _ + have hd (i : ℕ) : ‖d i‖^2=‖u i‖^2-‖u (i+1)‖^2 := by + have horth : ⟪u (i+1),d i⟫_ℝ=0 := by dsimp only [d]; rw [hu]; exact hP i _ _ + have he : u i=u (i+1)+d i := by dsimp [d]; abel + rw [he,norm_add_sq_real,horth] + ring + have hsum : (∑ i ∈ Finset.range n, ‖d i‖^2) = ‖u 0‖^2-‖u n‖^2 := by + simp_rw [hd] + exact Finset.sum_range_sub' (fun i ↦ ‖u i‖^2) n + have hdsum : (∑ i ∈ Finset.range n, d i)=u 0-u n := + Finset.sum_range_sub' u n + have hin : ⟪u 0,u 0-u n⟫_ℝ = ∑ i ∈ Finset.range n, ⟪u 0-P i (u 0),d i⟫_ℝ := by + rw [← hdsum,inner_sum] + apply Finset.sum_congr rfl + intro i _ + simp only [inner_sub_left,hi,sub_zero] + let a : ℝ := ∑ i ∈ Finset.range n, ‖u 0-P i (u 0)‖*‖d i‖ + have ha0 : 0 ≤ a := Finset.sum_nonneg (fun i _ ↦ mul_nonneg (norm_nonneg _) (norm_nonneg _)) + have hia : ⟪u 0,u 0-u n⟫_ℝ ≤ a := by + rw [hin] + exact Finset.sum_le_sum (fun i _ ↦ real_inner_le_norm _ _) + have henergy : ‖u 0‖^2-‖u n‖^2 ≤ 2*a := by + have he := norm_sub_sq_real (u 0) (u n) + have hh : ⟪u 0,u 0-u n⟫_ℝ = ‖u 0‖^2-⟪u 0,u n⟫_ℝ := by + rw [inner_sub_right,real_inner_self_eq_norm_sq] + nlinarith [sq_nonneg ‖u 0-u n‖] + have hc : a^2 ≤ (∑ i ∈ Finset.range n, ‖u 0-P i (u 0)‖^2)* + (‖u 0‖^2-‖u n‖^2) := by + rw [← hsum] + exact Finset.sum_mul_sq_le_sq_mul_sq (Finset.range n) _ _ + have hS0 : 0 ≤ ‖u 0‖^2-‖u n‖^2 := by + rw [← hsum]; exact Finset.sum_nonneg (fun i _ ↦ sq_nonneg _) + by_cases hS : ‖u 0‖^2-‖u n‖^2=0 + · rw [hS]; positivity + · have hSpos : 0 < ‖u 0‖^2-‖u n‖^2 := lt_of_le_of_ne hS0 (Ne.symm hS) + have hsquare : (‖u 0‖^2-‖u n‖^2)^2 ≤ 4*a^2 := by nlinarith + nlinarith + +end GAD + +end + +end OAI diff --git a/lean/OAI/InformationTheory/AmplitudeDamping/SpectralEntropy.lean b/lean/OAI/InformationTheory/AmplitudeDamping/SpectralEntropy.lean new file mode 100644 index 0000000000000000000000000000000000000000..5ade345cfb08d18f6bd7cb5b6f527afecdc80909 --- /dev/null +++ b/lean/OAI/InformationTheory/AmplitudeDamping/SpectralEntropy.lean @@ -0,0 +1,156 @@ +import OAI.InformationTheory.AmplitudeDamping.LogDetConvexity + +namespace OAI + +universe u_1 + +noncomputable section +open scoped BigOperators Matrix.Norms.Elementwise +open Matrix +open scoped BigOperators ComplexOrder MatrixOrder +open scoped Matrix.Norms.Elementwise ComplexOrder MatrixOrder +open Matrix Set +open scoped ComplexOrder MatrixOrder + +open scoped BigOperators ComplexOrder MatrixOrder +open Matrix +namespace GAD + +variable {ι : Type u_1} [Fintype ι] [DecidableEq ι] + +/-- Trace invariance under a unitary change of basis. -/ +theorem trace_unitary_conj (U : Matrix.unitaryGroup ι ℂ) (A : Matrix ι ι ℂ) : + (Unitary.conjStarAlgAut ℂ _ U A).trace = A.trace := by + rw [Unitary.conjStarAlgAut_apply, Matrix.trace_mul_cycle] + simp + +/-- Spectral trace for any function on the finite real spectrum. -/ +theorem trace_cfc_eq {A : Matrix ι ι ℂ} (hA : A.IsHermitian) (f : ℝ → ℝ) : + (cfc f A).trace = ∑ i, (f (hA.eigenvalues i) : ℂ) := by + rw [hA.cfc_eq, Matrix.IsHermitian.cfc, trace_unitary_conj] + simp [Matrix.trace_diagonal, Function.comp_def] + +theorem entropy_eq_sum {A : Matrix ι ι ℂ} (hA : A.IsHermitian) : + entropy A = ∑ i, Real.negMulLog (hA.eigenvalues i) := by + simp [entropy, trace_cfc_eq hA] + +theorem entropy_nonneg {A : Matrix ι ι ℂ} (hA : IsState A) : 0 ≤ entropy A := by + rw [entropy_eq_sum hA.1.isHermitian] + have hs : ∑ i, hA.1.isHermitian.eigenvalues i = 1 := by + simpa using congrArg Complex.re + (hA.1.isHermitian.trace_eq_sum_eigenvalues.symm.trans hA.2) + apply Finset.sum_nonneg + intro i _ + apply Real.negMulLog_nonneg (hA.1.eigenvalues_nonneg i) + rw [← hs] + exact Finset.single_le_sum (fun j _ ↦ hA.1.eigenvalues_nonneg j) (Finset.mem_univ i) + +/-- The square-moduli in each row of a unitary matrix sum to one. -/ +theorem unitary_row_sq_sum (U : Matrix.unitaryGroup ι ℂ) (i : ι) : + ∑ j, Complex.normSq (U i j) = 1 := by + have h := congrArg (fun A : Matrix ι ι ℂ ↦ (A i i).re) (Unitary.coe_mul_star_self U) + simpa [Matrix.mul_apply, Matrix.star_apply, Complex.mul_re, Complex.normSq_apply, + mul_comm] using h + +/-- The square-moduli in each column of a unitary matrix sum to one. -/ +theorem unitary_col_sq_sum (U : Matrix.unitaryGroup ι ℂ) (j : ι) : + ∑ i, Complex.normSq (U i j) = 1 := by + have h := congrArg (fun A : Matrix ι ι ℂ ↦ (A j j).re) (Unitary.coe_star_mul_self U) + simpa [Matrix.mul_apply, Matrix.star_apply, Complex.mul_re, Complex.normSq_apply, + mul_comm] using h + +/-- The ordinary diagonal is a doubly stochastic mixing of the spectral diagonal. -/ +theorem diag_eq_spectral_mix {A : Matrix ι ι ℂ} (hA : A.IsHermitian) (i : ι) : + (A i i).re = ∑ j, Complex.normSq (hA.eigenvectorUnitary i j) * hA.eigenvalues j := by + conv_lhs => rw [hA.spectral_theorem] + rw [Unitary.conjStarAlgAut_apply] + rw [Matrix.mul_apply, Complex.re_sum] + apply Finset.sum_congr rfl + intro j _ + simp [Matrix.mul_diagonal, Matrix.star_apply, Complex.mul_re, Complex.mul_im, + Complex.normSq_apply] + ring + +/-- Pinching in any fixed orthonormal coordinate basis increases entropy. -/ +theorem entropy_le_diagonal {A : Matrix ι ι ℂ} (hA : A.PosSemidef) : + entropy A ≤ ∑ i, Real.negMulLog (A i i).re := by + let U := hA.isHermitian.eigenvectorUnitary + have hi (i : ι) : + ∑ j, Complex.normSq (U i j) * Real.negMulLog (hA.isHermitian.eigenvalues j) ≤ + Real.negMulLog (A i i).re := by + rw [diag_eq_spectral_mix hA.isHermitian] + simpa only [U, smul_eq_mul] using + Real.concaveOn_negMulLog.le_map_sum (t := Finset.univ) + (w := fun j ↦ Complex.normSq (U i j)) + (p := hA.isHermitian.eigenvalues) (fun j _ ↦ Complex.normSq_nonneg _) + (by simpa using unitary_row_sq_sum U i) + (fun j _ ↦ hA.eigenvalues_nonneg j) + have h := Finset.sum_le_sum (s := Finset.univ) (fun i _ ↦ hi i) + rw [Finset.sum_comm] at h + simp only [← Finset.sum_mul, unitary_col_sq_sum, one_mul] at h + rwa [entropy_eq_sum hA.isHermitian] + + +/-- Entropy is invariant under every unitary basis change. -/ +theorem entropy_unitary_conj (U : Matrix.unitaryGroup ι ℂ) + {A : Matrix ι ι ℂ} (hA : A.IsHermitian) : + entropy (Unitary.conjStarAlgAut ℂ _ U A) = entropy A := by + have hφA : (Unitary.conjStarAlgAut ℂ _ U A).IsHermitian := by + simpa only [Unitary.conjStarAlgAut_apply, Matrix.star_eq_conjTranspose] using + Matrix.isHermitian_mul_mul_conjTranspose (U : Matrix ι ι ℂ) hA + have hm := StarAlgHomClass.map_cfc (S := ℂ) + (Unitary.conjStarAlgAut ℂ (Matrix ι ι ℂ) U) Real.negMulLog A + Real.continuous_negMulLog.continuousOn + (show Continuous (fun P : Matrix ι ι ℂ ↦ (U : Matrix ι ι ℂ) * P * star U) by fun_prop) + hA hφA + unfold entropy + calc + _ = (Matrix.trace (Unitary.conjStarAlgAut ℂ _ U (cfc Real.negMulLog A))).re := + congrArg (fun P : Matrix ι ι ℂ ↦ P.trace.re) hm.symm + _ = _ := congrArg Complex.re (trace_unitary_conj U _) + +/-- The full matrix entropy, not just normalized-state entropy, is concave on +positive semidefinite matrices. -/ +theorem concaveOn_entropy : + ConcaveOn ℝ {A : Matrix ι ι ℂ | A.PosSemidef} entropy := by + refine ⟨?_, ?_⟩ + · intro A hA B hB a b ha hb _ + exact (hA.smul ha).add (hB.smul hb) + intro A hA B hB a b ha hb hab + let C := a • A + b • B + have hC : C.PosSemidef := (hA.smul ha).add (hB.smul hb) + let U := hC.isHermitian.eigenvectorUnitary + let φ := Unitary.conjStarAlgAut ℂ (Matrix ι ι ℂ) (star U) + have hp (P : Matrix ι ι ℂ) (hP : P.PosSemidef) : (φ P).PosSemidef := by + exact hP.mul_mul_conjTranspose_same (star U : Matrix ι ι ℂ) + have hdiag : φ C = Matrix.diagonal (fun i ↦ (hC.isHermitian.eigenvalues i : ℂ)) := by + exact hC.isHermitian.conjStarAlgAut_star_eigenvectorUnitary + have hlin : φ C = a • φ A + b • φ B := by + dsimp only [C] + rw [map_add] + congr 1 <;> exact (φ.toAlgEquiv.toLinearEquiv.restrictScalars ℝ).map_smul _ _ + have hs (i : ι) : + a * Real.negMulLog ((φ A) i i).re + b * Real.negMulLog ((φ B) i i).re ≤ + Real.negMulLog (hC.isHermitian.eigenvalues i) := by + have he : hC.isHermitian.eigenvalues i = a * ((φ A) i i).re + b * ((φ B) i i).re := by + have ht := congrArg (fun P : Matrix ι ι ℂ ↦ (P i i).re) (hdiag.symm.trans hlin) + simpa using ht + rw [he] + exact Real.concaveOn_negMulLog.2 + ((Complex.nonneg_iff.mp (hp A hA).diag_nonneg).1) + ((Complex.nonneg_iff.mp (hp B hB).diag_nonneg).1) ha hb hab + have hsum := Finset.sum_le_sum (s := Finset.univ) (fun i _ ↦ hs i) + rw [Finset.sum_add_distrib, ← Finset.mul_sum, ← Finset.mul_sum] at hsum + have hEA := entropy_le_diagonal (hp A hA) + have hEB := entropy_le_diagonal (hp B hB) + rw [entropy_unitary_conj (star U) hA.isHermitian] at hEA + rw [entropy_unitary_conj (star U) hB.isHermitian] at hEB + rw [entropy_eq_sum hC.isHermitian] + exact le_trans (add_le_add (mul_le_mul_of_nonneg_left hEA ha) + (mul_le_mul_of_nonneg_left hEB hb)) hsum + +end GAD + +end + +end OAI diff --git a/lean/OAI/InformationTheory/AmplitudeDamping/StateEntropy.lean b/lean/OAI/InformationTheory/AmplitudeDamping/StateEntropy.lean new file mode 100644 index 0000000000000000000000000000000000000000..e488efba4d6562afb2d91184c3efe9adb5bd4ffe --- /dev/null +++ b/lean/OAI/InformationTheory/AmplitudeDamping/StateEntropy.lean @@ -0,0 +1,157 @@ +import OAI.InformationTheory.AmplitudeDamping.PureRecursion + +namespace OAI + +noncomputable section + +universe u_1 u_2 u_3 u_4 + +section +open scoped BigOperators ComplexOrder MatrixOrder +open Matrix +namespace GAD +variable {ι : Type u_1} {α : Type u_2} [Fintype ι] [DecidableEq ι] [Fintype α] + +theorem state_mixture (w : α → ℝ) (P : α → Matrix ι ι ℂ) + (hw : ∀ a, 0 ≤ w a) (hs : ∑ a, w a = 1) (hP : ∀ a, IsState (P a)) : + IsState (∑ a, w a • P a) := by + constructor + · rw [← Matrix.nonneg_iff_posSemidef] + exact Finset.sum_nonneg (fun a _ ↦ Matrix.nonneg_iff_posSemidef.mpr ((hP a).1.smul (hw a))) + · simp only [Matrix.trace_sum,Matrix.trace_smul,(hP _).2,Complex.real_smul,mul_one] + exact_mod_cast hs + +theorem spectral_pure_decomposition {P : Matrix ι ι ℂ} (hP : P.IsHermitian) : + P = ∑ a, hP.eigenvalues a • pure (fun i ↦ hP.eigenvectorUnitary i a) := by + conv_lhs => rw [hP.spectral_theorem] + rw [Unitary.conjStarAlgAut_apply] + ext i j + simp only [Matrix.mul_apply,Matrix.star_apply,Matrix.sum_apply, + Matrix.smul_apply,pure,Complex.real_smul] + apply Finset.sum_congr rfl + intro a _ + simp only [diagonal_apply, Function.comp_apply, mul_ite, mul_zero, Finset.sum_ite_eq', Finset.mem_univ, ite_true] + change hP.eigenvectorUnitary i a * (hP.eigenvalues a : ℂ) * star (hP.eigenvectorUnitary j a) = + (hP.eigenvalues a : ℂ) * (hP.eigenvectorUnitary i a * star (hP.eigenvectorUnitary j a)) + ring + +theorem spectral_weights_sum {P : Matrix ι ι ℂ} (hP : IsState P) : + ∑ a, hP.1.isHermitian.eigenvalues a = 1 := by + simpa using congrArg Complex.re + (hP.1.isHermitian.trace_eq_sum_eigenvalues.symm.trans hP.2) + +theorem spectral_vectors_mass {P : Matrix ι ι ℂ} (hP : P.IsHermitian) (a : ι) : + vecMass (fun i ↦ hP.eigenvectorUnitary i a) = 1 := + unitary_col_sq_sum hP.eigenvectorUnitary a + +theorem channel_mixture (γ ν : ℝ) (n : ℕ) (w : α → ℝ) (P : α → QMatrix n) : + channel γ ν n (∑ a, w a • P a) = ∑ a, w a • channel γ ν n (P a) := by + simp only [channel,Matrix.mul_sum,Matrix.sum_mul,Matrix.mul_smul,Matrix.smul_mul] + rw [Finset.sum_comm] + simp only [Finset.smul_sum] + +def matrixPopulation {n : ℕ} (P : QMatrix n) (j : Fin n) : ℝ := + ∑ i, if i j = 1 then (P i i).re else 0 + +theorem matrixPopulation_pure {n : ℕ} (ψ : Basis n → ℂ) (j : Fin n) : + matrixPopulation (pure ψ) j = population ψ j := by + simp [matrixPopulation,population,pure,Complex.mul_conj] + +theorem matrixPopulation_mixture {n : ℕ} (w : α → ℝ) (P : α → QMatrix n) (j : Fin n) : + matrixPopulation (∑ a, w a • P a) j = ∑ a, w a * matrixPopulation (P a) j := by + simp only [matrixPopulation,Matrix.sum_apply,Complex.re_sum,Matrix.smul_apply, + Complex.real_smul,Complex.mul_re,Complex.ofReal_re,Complex.ofReal_im,zero_mul,sub_zero, + Finset.mul_sum] + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro i _ + split_ifs <;> simp + +theorem matrixPopulation_nonneg {n : ℕ} {P : QMatrix n} (hP : P.PosSemidef) (j : Fin n) : + 0 ≤ matrixPopulation P j := by + apply Finset.sum_nonneg + intro i _ + split_ifs + · exact (Complex.nonneg_iff.mp hP.diag_nonneg).1 + · rfl + +theorem matrixPopulation_le_trace {n : ℕ} {P : QMatrix n} (hP : P.PosSemidef) (j : Fin n) : + matrixPopulation P j ≤ P.trace.re := by + rw [Matrix.trace,Complex.re_sum] + apply Finset.sum_le_sum + intro i _ + split_ifs + · exact le_rfl + · exact (Complex.nonneg_iff.mp hP.diag_nonneg).1 + +theorem matrixPopulation_mem {n : ℕ} {P : QMatrix n} (hP : IsState P) (j : Fin n) : + matrixPopulation P j ∈ Set.Icc (0:ℝ) 1 := by + refine ⟨matrixPopulation_nonneg hP.1 j, ?_⟩ + simpa only [hP.2,Complex.one_re] using matrixPopulation_le_trace hP.1 j + +end GAD + +end + +open scoped BigOperators ComplexOrder MatrixOrder +open Matrix +namespace GAD +variable {ι : Type u_3} {α : Type u_4} [Fintype ι] [DecidableEq ι] [Fintype α] [DecidableEq α] + +def spectralFactor {A : Matrix ι ι ℂ} (hA : A.PosSemidef) : Matrix ι ι ℂ := + fun i k ↦ (Real.sqrt (hA.isHermitian.eigenvalues k) : ℂ) * hA.isHermitian.eigenvectorUnitary i k + +theorem spectralFactor_gram {A : Matrix ι ι ℂ} (hA : A.PosSemidef) : + gram (spectralFactor hA) = A := by + conv_rhs => rw [spectral_pure_decomposition hA.isHermitian] + ext i j + simp only [gram,Matrix.mul_apply,Matrix.conjTranspose_apply,spectralFactor, + star_mul,Matrix.sum_apply,Matrix.smul_apply,pure,Complex.real_smul, + Complex.star_def,Complex.conj_ofReal] + apply Finset.sum_congr rfl + intro k _ + have hs : (Real.sqrt (hA.isHermitian.eigenvalues k) : ℂ)^2 = + (hA.isHermitian.eigenvalues k : ℂ) := by exact_mod_cast Real.sq_sqrt (hA.eigenvalues_nonneg k) + calc + _ = (Real.sqrt (hA.isHermitian.eigenvalues k) : ℂ)^2 * + (hA.isHermitian.eigenvectorUnitary i k * star (hA.isHermitian.eigenvectorUnitary j k)) := by + simp only [Complex.star_def]; ring + _ = _ := by rw [hs]; rfl + +theorem spectralFactor_column {A : Matrix ι ι ℂ} (hA : A.PosSemidef) (k : ι) : + ∑ i, Complex.normSq (spectralFactor hA i k) = hA.isHermitian.eigenvalues k := by + simp only [spectralFactor,Complex.normSq_mul,Complex.normSq_ofReal,← pow_two, + Real.sq_sqrt (hA.eigenvalues_nonneg k),← Finset.mul_sum,unitary_col_sq_sum,mul_one] + +theorem entropy_sum_le (A : α → Matrix ι ι ℂ) (hA : ∀ a, (A a).PosSemidef) : + entropy (∑ a, A a) ≤ ∑ a, entropy (A a) := by + let F : Matrix ι (α × ι) ℂ := fun i ak ↦ spectralFactor (hA ak.1) i ak.2 + have hgram : gram F = ∑ a, A a := by + ext i j + change (∑ ak : α × ι, spectralFactor (hA ak.1) i ak.2 * + star (spectralFactor (hA ak.1) j ak.2)) = (∑ a, A a) i j + simp only [Fintype.sum_prod_type,Matrix.sum_apply] + apply Finset.sum_congr rfl + intro a _ + exact congrArg (fun M : Matrix ι ι ℂ ↦ M i j) (spectralFactor_gram (hA a)) + have hdiag (ak : α × ι) : ((Fᴴ*F) ak ak).re = (hA ak.1).isHermitian.eigenvalues ak.2 := by + change (∑ i, star (F i ak)*F i ak).re = _ + simp only [Complex.re_sum,Complex.star_def,← Complex.normSq_eq_conj_mul_self,Complex.ofReal_re,F] + exact spectralFactor_column (hA ak.1) ak.2 + rw [← hgram] + change entropy (F*Fᴴ) ≤ _ + rw [entropy_mul_conjTranspose] + have he := entropy_le_diagonal (Matrix.posSemidef_conjTranspose_mul_self F) + simpa only [hdiag,Fintype.sum_prod_type,entropy_eq_sum (hA _).isHermitian] using he + +theorem entropy_mixture_upper (w : α → ℝ) (A : α → Matrix ι ι ℂ) + (hw : ∀ a, 0 ≤ w a) (hA : ∀ a, IsState (A a)) : + entropy (∑ a, w a • A a) ≤ ∑ a, (w a*entropy (A a)+Real.negMulLog (w a)) := by + have h := entropy_sum_le (fun a ↦ w a • A a) (fun a ↦ (hA a).1.smul (hw a)) + simpa only [entropy_smul _ (hA _).1.isHermitian,(hA _).2,Complex.one_re,mul_one] using h + +end GAD + +end + +end OAI diff --git a/lean/OAI/InformationTheory/AmplitudeDamping/TensorEntropy.lean b/lean/OAI/InformationTheory/AmplitudeDamping/TensorEntropy.lean new file mode 100644 index 0000000000000000000000000000000000000000..10c68ea8ff42b509667735ffee8d4a54a61519be --- /dev/null +++ b/lean/OAI/InformationTheory/AmplitudeDamping/TensorEntropy.lean @@ -0,0 +1,126 @@ +import OAI.InformationTheory.AmplitudeDamping.OutputConvexity + +namespace OAI + +universe u_1 u_2 u_3 u_4 + +noncomputable section +open scoped BigOperators Matrix.Norms.Elementwise +open Matrix +open scoped BigOperators ComplexOrder MatrixOrder +open scoped Matrix.Norms.Elementwise ComplexOrder MatrixOrder +open Matrix Set +open scoped ComplexOrder MatrixOrder +open scoped BigOperators Topology +open Filter Set +open scoped BigOperators ComplexOrder MatrixOrder Topology +open scoped BigOperators ComplexOrder +open scoped BigOperators +open Set Filter Topology + +open scoped BigOperators ComplexOrder MatrixOrder CStarAlgebra +open Matrix +namespace GAD +variable {ι : Type u_1} {κ : Type u_2} [Fintype ι] [Fintype κ] [DecidableEq ι] [DecidableEq κ] + +omit [Fintype κ] [DecidableEq κ] in +noncomputable def diagonalStarAlgHom : (ι → ℂ) →⋆ₐ[ℂ] Matrix ι ι ℂ := + { Matrix.diagonalAlgHom ℂ with + map_star' := by intro x; ext i j; simp [Matrix.star_apply, Matrix.diagonal_apply]; split_ifs <;> simp_all } + +omit [Fintype κ] [DecidableEq κ] in +theorem entropy_diagonal (p : ι → ℝ) : + entropy (Matrix.diagonal (fun i ↦ (p i : ℂ))) = ∑ i, Real.negMulLog (p i) := by + classical + cases isEmpty_or_nonempty ι + · simp [entropy, Matrix.trace] + let : ContinuousFunctionalCalculus ℝ (ι → ℂ) IsSelfAdjoint := IsSelfAdjoint.instContinuousFunctionalCalculus + let φ := diagonalStarAlgHom (ι := ι) + have hp : IsSelfAdjoint (fun i ↦ (p i : ℂ)) := by ext i; simp + have hd : (Matrix.diagonal (fun i ↦ (p i : ℂ))).IsHermitian := by + exact Matrix.isHermitian_diagonal_iff.mpr (fun i ↦ by simp [IsSelfAdjoint]) + have hm := StarAlgHomClass.map_cfc (S := ℂ) φ Real.negMulLog (fun i ↦ (p i : ℂ)) + Real.continuous_negMulLog.continuousOn + (show Continuous φ by change Continuous (Matrix.diagonal : (ι → ℂ) → Matrix ι ι ℂ); fun_prop) hp hd + have he : cfc Real.negMulLog (fun i ↦ (p i : ℂ)) = fun i ↦ (Real.negMulLog (p i) : ℂ) := by + rw [cfc_map_pi (S := ℂ) Real.negMulLog _ Real.continuous_negMulLog.continuousOn hp (fun i ↦ by simp [IsSelfAdjoint])] + ext i + exact cfc_algebraMap (A := ℂ) (p i) Real.negMulLog + unfold entropy + change (cfc Real.negMulLog (φ (fun i ↦ (p i : ℂ)))).trace.re = _ + calc + _ = (φ (cfc Real.negMulLog (fun i ↦ (p i : ℂ)))).trace.re := congrArg (fun A : Matrix ι ι ℂ ↦ A.trace.re) hm.symm + _ = _ := by rw [he]; simp [φ, diagonalStarAlgHom, Matrix.trace_diagonal] + +noncomputable def reindexStarAlgEquiv (e : ι ≃ κ) : Matrix ι ι ℂ ≃⋆ₐ[ℂ] Matrix κ κ ℂ := + { Matrix.reindexAlgEquiv ℂ ℂ e with + map_star' := by intro A; ext i j; rfl + map_smul' := by intro r A; rfl } + +omit [DecidableEq ι] [DecidableEq κ] in +theorem trace_reindex (e : ι ≃ κ) (A : Matrix ι ι ℂ) : + (Matrix.reindex e e A).trace = A.trace := by + exact Fintype.sum_equiv e.symm _ _ (fun _ ↦ rfl) + +theorem entropy_reindex (e : ι ≃ κ) {A : Matrix ι ι ℂ} (hA : A.IsHermitian) : + entropy (Matrix.reindex e e A) = entropy A := by + let φ := reindexStarAlgEquiv e + have hφA : (φ A).IsHermitian := hA.submatrix e.symm + have hm := StarAlgHomClass.map_cfc (S := ℂ) φ Real.negMulLog A + Real.continuous_negMulLog.continuousOn + (show Continuous φ by + change Continuous (fun A : Matrix ι ι ℂ ↦ A.submatrix e.symm e.symm) + fun_prop) hA hφA + unfold entropy + change (cfc Real.negMulLog (φ A)).trace.re = _ + calc + _ = (φ (cfc Real.negMulLog A)).trace.re := congrArg (fun B : Matrix κ κ ℂ ↦ B.trace.re) hm.symm + _ = _ := congrArg Complex.re (trace_reindex e _) + +end GAD +open scoped BigOperators ComplexOrder MatrixOrder Kronecker +open Matrix +namespace GAD +variable {ι : Type u_3} {κ : Type u_4} [Fintype ι] [Fintype κ] [DecidableEq ι] [DecidableEq κ] + +def tensorUnitary (U : Matrix.unitaryGroup ι ℂ) (V : Matrix.unitaryGroup κ ℂ) : + Matrix.unitaryGroup (ι × κ) ℂ := + ⟨(U : Matrix ι ι ℂ) ⊗ₖ (V : Matrix κ κ ℂ), Matrix.kronecker_mem_unitary U.prop V.prop⟩ + +theorem entropy_kronecker {A : Matrix ι ι ℂ} {B : Matrix κ κ ℂ} + (hA : A.IsHermitian) (hB : B.IsHermitian) : + entropy (A ⊗ₖ B) = B.trace.re * entropy A + A.trace.re * entropy B := by + let U := hA.eigenvectorUnitary + let V := hB.eigenvectorUnitary + let W := tensorUnitary U V + let p := hA.eigenvalues + let q := hB.eigenvalues + have he : A ⊗ₖ B = Unitary.conjStarAlgAut ℂ _ W + (Matrix.diagonal (fun ij : ι × κ ↦ ((p ij.1*q ij.2 : ℝ):ℂ))) := by + conv_lhs => rw [hA.spectral_theorem, hB.spectral_theorem] + simp only [Unitary.conjStarAlgAut_apply, Matrix.star_eq_conjTranspose] + change _ = ((U : Matrix ι ι ℂ) ⊗ₖ (V : Matrix κ κ ℂ)) * _ * + (((U : Matrix ι ι ℂ) ⊗ₖ (V : Matrix κ κ ℂ)).conjTranspose) + rw [Matrix.conjTranspose_kronecker, Matrix.mul_kronecker_mul, + Matrix.mul_kronecker_mul, Matrix.diagonal_kronecker_diagonal] + congr 2 + simp [p,q] + have hd : (Matrix.diagonal (fun ij : ι × κ ↦ ((p ij.1*q ij.2 : ℝ):ℂ))).IsHermitian := + Matrix.isHermitian_diagonal_iff.mpr (fun _ ↦ by simp [IsSelfAdjoint]) + rw [he, entropy_unitary_conj W hd, entropy_diagonal, Fintype.sum_prod_type] + simp_rw [Real.negMulLog_mul, Finset.sum_add_distrib, ← Finset.mul_sum, ← Finset.sum_mul] + have htrA : A.trace.re = ∑ i, p i := by simpa [p] using congrArg Complex.re hA.trace_eq_sum_eigenvalues + have htrB : B.trace.re = ∑ j, q j := by simpa [q] using congrArg Complex.re hB.trace_eq_sum_eigenvalues + rw [htrA,htrB,entropy_eq_sum hA,entropy_eq_sum hB] + simp [p, q, ← Finset.mul_sum] + +theorem entropy_kronecker_state {A : Matrix ι ι ℂ} {B : Matrix κ κ ℂ} + (hA : IsState A) (hB : IsState B) : entropy (A ⊗ₖ B) = entropy A + entropy B := by + rw [entropy_kronecker hA.1.isHermitian hB.1.isHermitian, hA.2, hB.2] + simp + +end GAD + +end + +end OAI diff --git a/lean/OAI/InformationTheory/AmplitudeDamping/ThermalEntropy.lean b/lean/OAI/InformationTheory/AmplitudeDamping/ThermalEntropy.lean new file mode 100644 index 0000000000000000000000000000000000000000..9c8cd4cc05fe3ed83718645a04dc1f218a1cf47e --- /dev/null +++ b/lean/OAI/InformationTheory/AmplitudeDamping/ThermalEntropy.lean @@ -0,0 +1,219 @@ +import OAI.InformationTheory.AmplitudeDamping.ZeroBlockEntropy + +namespace OAI + +universe u_1 u_2 u_3 u_4 + +noncomputable section +open scoped BigOperators Matrix.Norms.Elementwise +open Matrix +open scoped BigOperators ComplexOrder MatrixOrder +open scoped Matrix.Norms.Elementwise ComplexOrder MatrixOrder +open Matrix Set +open scoped ComplexOrder MatrixOrder +open scoped BigOperators Topology +open Filter Set +open scoped BigOperators ComplexOrder MatrixOrder Topology +open scoped BigOperators ComplexOrder + +open scoped BigOperators ComplexOrder MatrixOrder +open Matrix +namespace GAD +variable {ι : Type u_1} {κ : Type u_2} [Fintype ι] [Fintype κ] [DecidableEq ι] [DecidableEq κ] + +def thermal (X Y : Matrix ι κ ℂ) (a b c d K : ℝ) : Matrix (ι ⊕ ι) (ι ⊕ ι) ℂ := + Matrix.fromBlocks (a • gram X+b • gram Y) (K • (X*Yᴴ)) + (K • (Y*Xᴴ)) (c • gram X+d • gram Y) + +omit [DecidableEq κ] in +theorem isState_of_posSemidef_trace_re {P : Matrix ι ι ℂ} + (hP : P.PosSemidef) (ht : P.trace.re = 1) : IsState P := by + refine ⟨hP, ?_⟩ + apply Complex.ext ht + exact (Complex.nonneg_iff.mp hP.trace_nonneg).2.symm + +omit [DecidableEq ι] [DecidableEq κ] in +theorem thermal_trace (X Y : Matrix ι κ ℂ) (hX : mass X = 1) (hY : mass Y = 1) + (a b c d K : ℝ) : (thermal X Y a b c d K).trace.re = a+b+c+d := by + simp only [mass, Matrix.trace, Matrix.diag, Complex.re_sum] at hX hY + simp [thermal, Matrix.trace, Matrix.diag, Fintype.sum_sum_type, Finset.sum_add_distrib, + ← Finset.mul_sum, hX, hY, add_assoc] + +def blockSwap : Matrix.unitaryGroup (ι ⊕ ι) ℂ := + ⟨Matrix.fromBlocks 0 1 1 0, by + rw [Matrix.mem_unitaryGroup_iff, Matrix.star_eq_conjTranspose] + simp [Matrix.fromBlocks_conjTranspose, Matrix.fromBlocks_multiply]⟩ + +omit [DecidableEq κ] in +theorem blockSwap_conj (A B C D : Matrix ι ι ℂ) : + Unitary.conjStarAlgAut ℂ _ (blockSwap (ι := ι)) (Matrix.fromBlocks A B C D) = + Matrix.fromBlocks D C B A := by + simp [Unitary.conjStarAlgAut_apply, blockSwap, Matrix.star_eq_conjTranspose, + Matrix.fromBlocks_conjTranspose, Matrix.fromBlocks_multiply] + +omit [Fintype ι] [DecidableEq ι] [DecidableEq κ] in +theorem thermal_zeroEta_gram (X Y : Matrix ι κ ℂ) {a b d K : ℝ} + (ha : 0 ≤ a) (hb : 0 ≤ b) (hd : 0 ≤ d) (hK : 0 ≤ K) (had : a*d = K^2) : + thermal X Y a b 0 d K = + gram (zeroBlock (Real.sqrt a • X) (Real.sqrt b • Y) (Real.sqrt d • Y)) := by + have hroot : Real.sqrt a * Real.sqrt d = K := by + rw [← Real.sqrt_mul ha, had, Real.sqrt_sq hK] + rw [gram_zeroBlock, gram_sqrt_smul ha, gram_sqrt_smul hb, gram_sqrt_smul hd] + simp only [thermal, zero_smul, zero_add, Matrix.conjTranspose_smul, star_trivial, + Matrix.smul_mul, Matrix.mul_smul, smul_smul, hroot, mul_comm (Real.sqrt d) (Real.sqrt a)] + +theorem thermal_zeroEta (X Y : Matrix ι κ ℂ) (hX : mass X = 1) (hY : mass Y = 1) + {a b d K : ℝ} (ha : 0 ≤ a) (hb : 0 ≤ b) (hd : 0 ≤ d) (hK : 0 ≤ K) + (hs : a+b+d=1) (had : a*d=K^2) : + IsState (thermal X Y a b 0 d K) ∧ + a*entropy (gram X)+(b+d)*entropy (gram Y)+g (b*d) ≤ entropy (thermal X Y a b 0 d K) := by + have hp : (thermal X Y a b 0 d K).PosSemidef := by + rw [thermal_zeroEta_gram X Y ha hb hd hK had] + exact Matrix.posSemidef_self_mul_conjTranspose _ + refine ⟨isState_of_posSemidef_trace_re hp ?_, ?_⟩ + · rw [thermal_trace X Y hX hY]; linarith + · rw [thermal_zeroEta_gram X Y ha hb hd hK had] + have h := zeroBlock_normalized X Y Y hX hY hY ha hb hd hs + linarith + +theorem thermal_zeroBeta (X Y : Matrix ι κ ℂ) (hX : mass X = 1) (hY : mass Y = 1) + {a c d K : ℝ} (ha : 0 ≤ a) (hc : 0 ≤ c) (hd : 0 ≤ d) (hK : 0 ≤ K) + (hs : a+c+d=1) (had : a*d=K^2) : + IsState (thermal X Y a 0 c d K) ∧ + (a+c)*entropy (gram X)+d*entropy (gram Y)+g (c*a) ≤ entropy (thermal X Y a 0 c d K) := by + have hh := thermal_zeroEta Y X hY hX hd hc ha hK (by linarith) (by nlinarith [had]) + have he : thermal X Y a 0 c d K = Unitary.conjStarAlgAut ℂ _ (blockSwap (ι := ι)) + (thermal Y X d c 0 a K) := by + simp only [thermal, blockSwap_conj] + simp [add_comm] + have hen : entropy (thermal X Y a 0 c d K) = entropy (thermal Y X d c 0 a K) := by + rw [he, entropy_unitary_conj _ hh.1.1.isHermitian] + refine ⟨?_, ?_⟩ + · have hp : (thermal X Y a 0 c d K).PosSemidef := by + rw [he, Unitary.conjStarAlgAut_apply, Matrix.star_eq_conjTranspose] + exact hh.1.1.mul_mul_conjTranspose_same _ + exact isState_of_posSemidef_trace_re hp (by rw [thermal_trace X Y hX hY]; linarith) + · rw [hen] + nlinarith [hh.2] + +end GAD +open scoped BigOperators ComplexOrder MatrixOrder +open Matrix +namespace GAD +variable {ι : Type u_3} {κ : Type u_4} [Fintype ι] [Fintype κ] [DecidableEq ι] [DecidableEq κ] + +omit [Fintype ι] [DecidableEq ι] [DecidableEq κ] in +theorem thermal_mix (X Y : Matrix ι κ ℂ) (a b c d a' b' c' d' K w w' : ℝ) + (hw : w+w'=1) : + w • thermal X Y a b c d K + w' • thermal X Y a' b' c' d' K = + thermal X Y (w*a+w'*a') (w*b+w'*b') (w*c+w'*c') (w*d+w'*d') K := by + have hK : w*K+w'*K=K := by rw [← add_mul, hw, one_mul] + simp only [thermal, Matrix.fromBlocks_smul, Matrix.fromBlocks_add, smul_add, smul_smul, + ] + congr 1 + · module + · rw [← add_smul, hK] + · rw [← add_smul, hK] + · module + +/-- The exact finite-dimensional thermal inequality, including all coefficient boundaries. -/ +theorem thermal_entropy (X Y : Matrix ι κ ℂ) (hX : mass X = 1) (hY : mass Y = 1) + {a b c d K : ℝ} (ha : 0 ≤ a) (hb : 0 ≤ b) (hc : 0 ≤ c) (hd : 0 ≤ d) + (hK : 0 ≤ K) (hs : a+b+c+d=1) (hk : a*d-b*c=K^2) : + let u := (a+b)*(c+d)-K^2 + IsState (thermal X Y a b c d K) ∧ u ∈ Set.Icc (0 : ℝ) (1/4) ∧ + (a+c)*entropy (gram X)+(b+d)*entropy (gram Y)+g u ≤ entropy (thermal X Y a b c d K) := by + dsimp only + let U := a+b + let V := c+d + let u := U*V-K^2 + have hU : 0 ≤ U := add_nonneg ha hb + have hV : 0 ≤ V := add_nonneg hc hd + have hUV : U+V=1 := by dsimp [U,V]; linarith + have hu : u=b*V+c*U := by dsimp [u,U,V]; nlinarith only [hk] + have hu0 : 0 ≤ u := by rw [hu]; positivity + have huUV : u ≤ U*V := by dsimp [u]; nlinarith only [sq_nonneg K] + have huq : u ≤ 1/4 := by nlinarith only [sq_nonneg (U-V), hUV, huUV] + change IsState (thermal X Y a b c d K) ∧ u ∈ Set.Icc (0 : ℝ) (1/4) ∧ _ + have hgoal (hstate : IsState (thermal X Y a b c d K)) + (hbound : (a+c)*entropy (gram X)+(b+d)*entropy (gram Y)+g u ≤ entropy (thermal X Y a b c d K)) : + IsState (thermal X Y a b c d K) ∧ u ∈ Set.Icc (0 : ℝ) (1/4) ∧ + (a+c)*entropy (gram X)+(b+d)*entropy (gram Y)+g ((a+b)*(c+d)-K^2) ≤ entropy (thermal X Y a b c d K) := + ⟨hstate, ⟨hu0,huq⟩, hbound⟩ + by_cases hb0 : b=0 + · subst b + have ht := thermal_zeroBeta X Y hX hY ha hc hd hK (by linarith) (by nlinarith only [hk]) + apply hgoal ht.1 + have hue : u=c*a := by dsimp [u,U,V]; nlinarith only [hk] + simpa only [hue, zero_add] using ht.2 + by_cases hc0 : c=0 + · subst c + have ht := thermal_zeroEta X Y hX hY ha hb hd hK (by linarith) (by nlinarith only [hk]) + apply hgoal ht.1 + have hue : u=b*d := by dsimp [u,U,V]; nlinarith only [hk] + simpa only [hue, add_zero] using ht.2 + have hbpos : 0 < b := lt_of_le_of_ne hb (Ne.symm hb0) + have hcpos : 0 < c := lt_of_le_of_ne hc (Ne.symm hc0) + have hUp : 0 < U := by dsimp [U]; linarith + have hVp : 0 < V := by dsimp [V]; linarith + have hup : 0 < u := by rw [hu]; positivity + let w := b*V/u + let w' := c*U/u + have hw : 0 ≤ w := by dsimp [w]; positivity + have hw' : 0 ≤ w' := by dsimp [w']; positivity + have hww : w+w'=1 := by dsimp [w,w']; rw [← add_div, ← hu, div_self hup.ne'] + have hrow1 : K^2/V+u/V = U := by rw [← add_div]; apply (div_eq_iff hVp.ne').mpr; dsimp [u]; ring + have hrow2 : u/U+K^2/U = V := by rw [← add_div]; apply (div_eq_iff hUp.ne').mpr; dsimp [u]; ring + have hprod1 : (K^2/V)*V=K^2 := div_mul_cancel₀ _ hVp.ne' + have hprod2 : U*(K^2/U)=K^2 := mul_div_cancel₀ _ hUp.ne' + have hg1 : (u/V)*V=u := div_mul_cancel₀ _ hVp.ne' + have hg2 : (u/U)*U=u := div_mul_cancel₀ _ hUp.ne' + have hwb : w*(u/V)=b := by dsimp [w]; field_simp + have hwc : w'*(u/U)=c := by dsimp [w']; field_simp + have hwa : w*(K^2/V)+w'*U=a := by + have hh := congrArg (fun r : ℝ ↦ w*r) hrow1 + have hh' := congrArg (fun r : ℝ ↦ r*U) hww + dsimp only [U] at hh hh' ⊢ + linear_combination hh + hh' - hwb + have hwd : w*V+w'*(K^2/U)=d := by + have hh := congrArg (fun r : ℝ ↦ w'*r) hrow2 + have hh' := congrArg (fun r : ℝ ↦ r*V) hww + dsimp only [V] at hh hh' ⊢ + linear_combination hh + hh' - hwc + have h1 := thermal_zeroEta X Y hX hY (div_nonneg (sq_nonneg K) hV) + (div_nonneg hu0 hV) hV hK (by linarith [hrow1]) hprod1 + have h2 := thermal_zeroBeta X Y hX hY hU (div_nonneg hu0 hU) + (div_nonneg (sq_nonneg K) hU) hK (by linarith [hrow2]) hprod2 + let T1 := thermal X Y (K^2/V) (u/V) 0 V K + let T2 := thermal X Y U 0 (u/U) (K^2/U) K + have hmix : w • T1+w' • T2=thermal X Y a b c d K := by + rw [thermal_mix X Y _ _ _ _ _ _ _ _ _ _ _ hww] + simp only [hwa, hwd, mul_zero, add_zero, zero_add, hwb, hwc] + have hpos : (thermal X Y a b c d K).PosSemidef := by + rw [← hmix] + exact (h1.1.1.smul hw).add (h2.1.1.smul hw') + apply hgoal (isState_of_posSemidef_trace_re hpos (by rw [thermal_trace X Y hX hY]; exact hs)) + have hconc := (concaveOn_entropy (ι := ι ⊕ ι)).2 h1.1.1 h2.1.1 hw hw' hww + change w*entropy T1+w'*entropy T2 ≤ entropy (w • T1+w' • T2) at hconc + rw [hmix] at hconc + have hh1 := mul_le_mul_of_nonneg_left h1.2 hw + have hh2 := mul_le_mul_of_nonneg_left h2.2 hw' + rw [hg1] at hh1 + rw [hg2] at hh2 + have hcoeffX : w*(K^2/V)+w'*(U+u/U)=a+c := by linear_combination hwa + hwc + have hcoeffY : w*(u/V+V)+w'*(K^2/U)=b+d := by linear_combination hwd + hwb + have heq : w*((K^2/V)*entropy (gram X)+(u/V+V)*entropy (gram Y)+g u)+ + w'*((U+u/U)*entropy (gram X)+(K^2/U)*entropy (gram Y)+g u) = + (a+c)*entropy (gram X)+(b+d)*entropy (gram Y)+g u := by + calc + _ = (w*(K^2/V)+w'*(U+u/U))*entropy (gram X)+ + (w*(u/V+V)+w'*(K^2/U))*entropy (gram Y)+(w+w')*g u := by ring + _ = _ := by rw [hcoeffX,hcoeffY,hww,one_mul] + dsimp only [T1,T2] at hconc + linarith only [hh1, hh2, hconc, heq] + +end GAD + +end + +end OAI diff --git a/lean/OAI/InformationTheory/AmplitudeDamping/TypicalProjectors.lean b/lean/OAI/InformationTheory/AmplitudeDamping/TypicalProjectors.lean new file mode 100644 index 0000000000000000000000000000000000000000..d0e324e038c4994cf24203e05463d7bcb4a7ab15 --- /dev/null +++ b/lean/OAI/InformationTheory/AmplitudeDamping/TypicalProjectors.lean @@ -0,0 +1,205 @@ +import OAI.InformationTheory.AmplitudeDamping.TypicalSets + +namespace OAI + +noncomputable section + +universe u_1 u_2 u_3 u_4 + +section +open scoped BigOperators ComplexOrder MatrixOrder +open Matrix +namespace GAD + +theorem tensorMatrix_mul {n : ℕ} (A B : Fin n → Matrix (Fin 2) (Fin 2) ℂ) : + tensorMatrix n A * tensorMatrix n B = tensorMatrix n (fun k ↦ A k*B k) := by + ext i j + simp only [tensorMatrix,Matrix.mul_apply,← Finset.prod_mul_distrib] + exact (Fintype.prod_sum (fun k l ↦ A k (i k) l*B k l (j k))).symm + +theorem tensorMatrix_conjTranspose {n : ℕ} (A : Fin n → Matrix (Fin 2) (Fin 2) ℂ) : + (tensorMatrix n A)ᴴ=tensorMatrix n (fun k ↦ (A k)ᴴ) := by + ext i j + simp [tensorMatrix,Matrix.conjTranspose_apply] + +theorem tensorMatrix_diagonal {n : ℕ} (a : Fin n → Fin 2 → ℂ) : + tensorMatrix n (fun k ↦ Matrix.diagonal (a k))=Matrix.diagonal (fun i ↦ ∏ k, a k (i k)) := by + ext i j + by_cases hij : i=j + · subst j; simp [tensorMatrix] + · rw [Matrix.diagonal_apply_ne _ hij] + have hx : ∃ k, i k ≠ j k := by simpa only [not_forall,funext_iff] using hij + obtain ⟨k,hk⟩ := hx + apply Finset.prod_eq_zero (Finset.mem_univ k) + exact Matrix.diagonal_apply_ne _ hk + +theorem tensorMatrix_one {n : ℕ} : tensorMatrix n (fun _ ↦ (1 : Matrix (Fin 2) (Fin 2) ℂ))=1 := by + have h := tensorMatrix_diagonal (fun _ : Fin n ↦ fun _ : Fin 2 ↦ (1:ℂ)) + simpa using h + +def tensorEigenUnitary {n : ℕ} (U : Fin n → Matrix.unitaryGroup (Fin 2) ℂ) : + Matrix.unitaryGroup (Basis n) ℂ := + ⟨tensorMatrix n (fun k ↦ U k), by + constructor + · change (tensorMatrix n _)ᴴ*tensorMatrix n _=1 + rw [tensorMatrix_conjTranspose,tensorMatrix_mul] + simp only [← Matrix.star_eq_conjTranspose,Unitary.coe_star_mul_self] + exact tensorMatrix_one + · change tensorMatrix n _*(tensorMatrix n _)ᴴ=1 + rw [tensorMatrix_conjTranspose,tensorMatrix_mul] + simp only [← Matrix.star_eq_conjTranspose,← Unitary.coe_star,Unitary.coe_mul_star_self] + exact tensorMatrix_one⟩ + +variable {ι : Type u_1} [Fintype ι] [DecidableEq ι] + +def spectralMatrix (U : Matrix.unitaryGroup ι ℂ) (q : ι → ℝ) : Matrix ι ι ℂ := + Unitary.conjStarAlgAut ℂ _ U (Matrix.diagonal (fun i ↦ (q i:ℂ))) + +theorem spectralMatrix_hermitian (U : Matrix.unitaryGroup ι ℂ) (q : ι → ℝ) : + (spectralMatrix U q).IsHermitian := by + apply Matrix.isHermitian_mul_mul_conjTranspose + apply Matrix.isHermitian_diagonal_iff.mpr + intro i; exact Complex.conj_ofReal _ + +theorem spectralMatrix_posSemidef (U : Matrix.unitaryGroup ι ℂ) (q : ι → ℝ) + (hq : ∀ i, 0 ≤ q i) : (spectralMatrix U q).PosSemidef := by + apply Matrix.PosSemidef.mul_mul_conjTranspose_same + apply Matrix.PosSemidef.diagonal + intro i + change (0:ℂ) ≤ (q i:ℂ) + exact_mod_cast hq i + +theorem spectralMatrix_trace (U : Matrix.unitaryGroup ι ℂ) (q : ι → ℝ) : + (spectralMatrix U q).trace=(∑ i, q i:ℝ) := by + rw [spectralMatrix,trace_unitary_conj,Matrix.trace_diagonal] + simp + +theorem spectralMatrix_entropy (U : Matrix.unitaryGroup ι ℂ) (q : ι → ℝ) : + entropy (spectralMatrix U q)=∑ i, Real.negMulLog (q i) := by + rw [spectralMatrix,entropy_unitary_conj] + · exact entropy_diagonal q + · apply Matrix.isHermitian_diagonal_iff.mpr + intro i; exact Complex.conj_ofReal _ + +theorem spectralMatrix_mul (U : Matrix.unitaryGroup ι ℂ) (q r : ι → ℝ) : + spectralMatrix U q*spectralMatrix U r=spectralMatrix U (fun i ↦ q i*r i) := by + rw [spectralMatrix,spectralMatrix,← map_mul,Matrix.diagonal_mul_diagonal] + congr 2; funext i; exact (Complex.ofReal_mul _ _).symm + +theorem spectralMatrix_sub (U : Matrix.unitaryGroup ι ℂ) (q r : ι → ℝ) : + spectralMatrix U q-spectralMatrix U r=spectralMatrix U (fun i ↦ q i-r i) := by + rw [spectralMatrix,spectralMatrix,← map_sub] + congr 1 + ext i j + by_cases h : i=j <;> simp [h] + +theorem spectralMatrix_smul (U : Matrix.unitaryGroup ι ℂ) (c : ℝ) (q : ι → ℝ) : + c • spectralMatrix U q=spectralMatrix U (fun i ↦ c*q i) := by + simp only [spectralMatrix,Unitary.conjStarAlgAut_apply] + rw [← Matrix.smul_mul,← Matrix.mul_smul] + congr 2 + ext i j + simp [Matrix.diagonal_apply,Complex.real_smul] + +def spectralMask (U : Matrix.unitaryGroup ι ℂ) (s : Finset ι) : Matrix ι ι ℂ := + spectralMatrix U (fun i ↦ if i ∈ s then 1 else 0) + +theorem spectralMask_projection (U : Matrix.unitaryGroup ι ℂ) (s : Finset ι) : + IsProjection (spectralMask U s) := by + refine ⟨spectralMatrix_hermitian _ _, ?_⟩ + rw [spectralMask,spectralMatrix_mul] + congr 1; funext i; split_ifs <;> simp + +theorem spectralMask_trace (U : Matrix.unitaryGroup ι ℂ) (s : Finset ι) : + (spectralMask U s).trace=(s.card:ℂ) := by + rw [spectralMask,spectralMatrix_trace] + simp + +theorem spectralMask_compress (U : Matrix.unitaryGroup ι ℂ) (q : ι → ℝ) (s : Finset ι) : + spectralMask U s*spectralMatrix U q*spectralMask U s= + spectralMatrix U (fun i ↦ if i ∈ s then q i else 0) := by + rw [spectralMask,spectralMatrix_mul,spectralMatrix_mul] + congr 1; funext i; split_ifs <;> simp + +theorem spectralMask_compress_bound (U : Matrix.unitaryGroup ι ℂ) (q : ι → ℝ) (s : Finset ι) + {c : ℝ} (hc : ∀ i ∈ s, q i ≤ c) : + (c • spectralMask U s-spectralMask U s*spectralMatrix U q*spectralMask U s).PosSemidef := by + rw [spectralMask_compress,spectralMask,spectralMatrix_smul,spectralMatrix_sub] + apply spectralMatrix_posSemidef + intro i + split_ifs with hi + · simpa using sub_nonneg.mpr (hc i hi) + · simp + +end GAD + +end + +open scoped BigOperators ComplexOrder MatrixOrder +open Matrix +namespace GAD + +theorem tensor_spectralMatrix (n : ℕ) (U : Fin n → Matrix.unitaryGroup (Fin 2) ℂ) + (q : Fin 2 → ℝ) : + tensorMatrix n (fun k ↦ spectralMatrix (U k) q)= + spectralMatrix (tensorEigenUnitary U) (iidWeight q n) := by + dsimp only [spectralMatrix,Unitary.conjStarAlgAut_apply,tensorEigenUnitary] + simp only [iidWeight,Complex.ofReal_prod,Matrix.star_eq_conjTranspose] + rw [← tensorMatrix_diagonal (fun _ : Fin n ↦ fun i : Fin 2 ↦ (q i:ℂ)), + tensorMatrix_conjTranspose, tensorMatrix_mul,tensorMatrix_mul] + +theorem projection_gram_mass {ι : Type u_2} {κ : Type u_3} [Fintype ι] [Fintype κ] + {P : Matrix ι ι ℂ} (hP : IsProjection P) (F : Matrix ι κ ℂ) : + mass (P*F)=(P*gram F).trace.re := by + rw [← projection_inner hP F,frobVector_inner] + dsimp [gram] + rw [← Matrix.mul_assoc,Matrix.trace_mul_cycle,Matrix.trace_mul_comm (F*Fᴴ)] + +variable {ι : Type u_4} [Fintype ι] [DecidableEq ι] + +theorem spectralMask_mass (U : Matrix.unitaryGroup ι ℂ) (q : ι → ℝ) (s : Finset ι) : + (spectralMask U s*spectralMatrix U q).trace.re=∑ i ∈ s, q i := by + rw [spectralMask,spectralMatrix_mul,spectralMatrix_trace,Complex.ofReal_re] + simp [ite_mul] + +theorem spectralMask_loss (U : Matrix.unitaryGroup ι ℂ) (q : ι → ℝ) (s : Finset ι) + (hs : ∑ i, q i=1) : + 1-(spectralMask U s*spectralMatrix U q).trace.re=∑ i, if i ∈ s then 0 else q i := by + rw [spectralMask_mass,← hs] + have he : (∑ i, q i)=(∑ i ∈ s, q i)+(∑ i, if i ∈ s then 0 else q i) := by + calc + _ = ∑ i, ((if i ∈ s then q i else 0)+(if i ∈ s then 0 else q i)) := by + apply Finset.sum_congr rfl + intro i _; split_ifs <;> simp + _ = _ := by rw [Finset.sum_add_distrib]; simp + linarith + +def typicalProjection (n : ℕ) (U : Fin n → Matrix.unitaryGroup (Fin 2) ℂ) + (q : Fin 2 → ℝ) (δ : ℝ) : QMatrix n := + spectralMask (tensorEigenUnitary U) (typicalSet q δ n) + +theorem typicalProjection_properties (n : ℕ) (U : Fin n → Matrix.unitaryGroup (Fin 2) ℂ) + (q : Fin 2 → ℝ) (hq : ∀ i, 0 ≤ q i) (hs : ∑ i, q i=1) + {δ : ℝ} (hδ : 0 < δ) (hn : 0 < n) : + IsProjection (typicalProjection n U q δ) ∧ + (typicalProjection n U q δ).trace.re ≤ Real.exp ((n:ℝ)*(classicalEntropy q+δ)) ∧ + 1-(typicalProjection n U q δ*tensorMatrix n (fun k ↦ spectralMatrix (U k) q)).trace.re ≤ + logVariance q/((n:ℝ)*δ^2) ∧ + (Real.exp (-(n:ℝ)*(classicalEntropy q-δ)) • typicalProjection n U q δ- + typicalProjection n U q δ*tensorMatrix n (fun k ↦ spectralMatrix (U k) q)*typicalProjection n U q δ).PosSemidef := by + classical + refine ⟨spectralMask_projection _ _, ?_, ?_, ?_⟩ + · rw [typicalProjection,spectralMask_trace,Complex.natCast_re] + exact typical_card q hq hs δ n + · rw [tensor_spectralMatrix,typicalProjection,spectralMask_loss _ _ _ (iidWeight_total q hs n)] + simpa only [typicalSet,Finset.mem_filter,Finset.mem_univ,true_and] using typical_tail q hq hs hδ hn + · rw [tensor_spectralMatrix,typicalProjection] + apply spectralMask_compress_bound + intro x hx + exact typical_weight_upper q δ n x (Finset.mem_filter.mp hx).2 + +end GAD + +end + +end OAI diff --git a/lean/OAI/InformationTheory/AmplitudeDamping/TypicalSets.lean b/lean/OAI/InformationTheory/AmplitudeDamping/TypicalSets.lean new file mode 100644 index 0000000000000000000000000000000000000000..560c57d3a32419510abf9f9a58bff27fdfd4f6cd --- /dev/null +++ b/lean/OAI/InformationTheory/AmplitudeDamping/TypicalSets.lean @@ -0,0 +1,180 @@ +import OAI.InformationTheory.AmplitudeDamping.SequentialMatrices + +namespace OAI + +noncomputable section + +universe u_1 u_2 + +section +open scoped BigOperators +namespace GAD +variable {α : Type u_1} [Fintype α] + +def iidWeight (q : α → ℝ) (n : ℕ) (x : Fin n → α) : ℝ := ∏ j, q (x j) +def iidSum (f : α → ℝ) (n : ℕ) (x : Fin n → α) : ℝ := ∑ j, f (x j) + +omit [Fintype α] in +theorem iidWeight_nonneg (q : α → ℝ) (hq : ∀ a, 0 ≤ q a) (n : ℕ) (x : Fin n → α) : + 0 ≤ iidWeight q n x := Finset.prod_nonneg (fun j _ ↦ hq (x j)) + +theorem iidWeight_total (q : α → ℝ) (hs : ∑ a, q a=1) (n : ℕ) : + (∑ x : Fin n → α, iidWeight q n x)=1 := by + rw [show (∑ x : Fin n → α, iidWeight q n x) = ∏ j : Fin n, ∑ a, q a from + (Fintype.prod_sum (fun _ : Fin n ↦ q)).symm] + simp only [hs,Finset.prod_const_one] + +theorem iid_split_sum (q : α → ℝ) (n : ℕ) (f : (Fin (n+1) → α) → ℝ) : + (∑ x, iidWeight q (n+1) x*f x) = + ∑ a, ∑ x : Fin n → α, q a*iidWeight q n x*f (Fin.cons a x) := by + rw [← Equiv.sum_comp (Fin.consEquiv (fun _ : Fin (n+1) ↦ α)) + (fun x ↦ iidWeight q (n+1) x*f x)] + simp only [Fintype.sum_prod_type,Fin.consEquiv_apply,iidWeight,Fin.prod_univ_succ, + Fin.cons_zero,Fin.cons_succ] + rfl + +omit [Fintype α] in +theorem iidSum_cons (f : α → ℝ) (n : ℕ) (a : α) (x : Fin n → α) : + iidSum f (n+1) (Fin.cons a x)=f a+iidSum f n x := by + simp only [iidSum,Fin.sum_univ_succ,Fin.cons_zero,Fin.cons_succ] + +theorem iid_centered_mean (q f : α → ℝ) (hs : ∑ a, q a=1) + (hf : ∑ a, q a*f a=0) (n : ℕ) : + (∑ x : Fin n → α, iidWeight q n x*iidSum f n x)=0 := by + induction n with + | zero => simp [iidSum] + | succ n ih => + rw [iid_split_sum] + have he (a : α) : (∑ x : Fin n → α, q a*iidWeight q n x*iidSum f (n+1) (Fin.cons a x)) = q a*f a := by + simp only [iidSum_cons] + have hpoly (x : Fin n → α) : q a*iidWeight q n x*(f a+iidSum f n x) = + (q a*f a)*iidWeight q n x+q a*(iidWeight q n x*iidSum f n x) := by ring + simp only [hpoly,Finset.sum_add_distrib,← Finset.mul_sum,iidWeight_total q hs n, + ih,mul_one,mul_zero,add_zero] + simpa only [he] using hf + +theorem iid_centered_second (q f : α → ℝ) (hs : ∑ a, q a=1) + (hf : ∑ a, q a*f a=0) (n : ℕ) : + (∑ x : Fin n → α, iidWeight q n x*(iidSum f n x)^2)= + (n:ℝ)*(∑ a, q a*(f a)^2) := by + induction n with + | zero => simp [iidSum] + | succ n ih => + rw [iid_split_sum] + simp only [iidSum_cons] + have he (a : α) : (∑ x : Fin n → α, q a*iidWeight q n x*(f a+iidSum f n x)^2) = + q a*(f a)^2+q a*((n:ℝ)*∑ b, q b*(f b)^2) := by + have hpoly (x : Fin n → α) : q a*iidWeight q n x*(f a+iidSum f n x)^2 = + (q a*(f a)^2)*iidWeight q n x+(2*q a*f a)*(iidWeight q n x*iidSum f n x)+ + q a*(iidWeight q n x*(iidSum f n x)^2) := by ring + simp only [hpoly,Finset.sum_add_distrib,← Finset.mul_sum,iidWeight_total q hs n, + iid_centered_mean q f hs hf n,ih,mul_one,mul_zero,add_zero] + simp only [he,Finset.sum_add_distrib,← Finset.sum_mul,hs,one_mul,Nat.cast_add,Nat.cast_one] + ring + +theorem iid_chebyshev (q f : α → ℝ) (hq : ∀ a, 0 ≤ q a) (hs : ∑ a, q a=1) + (hf : ∑ a, q a*f a=0) (n : ℕ) {t : ℝ} (ht : 0 < t) : + (∑ x : Fin n → α, if t < |iidSum f n x| then iidWeight q n x else 0) ≤ + (n:ℝ)*(∑ a, q a*(f a)^2)/t^2 := by + apply (le_div_iff₀ (sq_pos_of_pos ht)).mpr + rw [Finset.sum_mul,← iid_centered_second q f hs hf n] + apply Finset.sum_le_sum + intro x _ + split_ifs with hx + · apply mul_le_mul_of_nonneg_left _ (iidWeight_nonneg q hq n x) + nlinarith [sq_abs (iidSum f n x)] + · simp only [zero_mul] + exact mul_nonneg (iidWeight_nonneg q hq n x) (sq_nonneg _) + +end GAD + +end + +open scoped BigOperators +namespace GAD +variable {α : Type u_2} [Fintype α] +local instance : DecidablePred (fun p : Prop ↦ p) := Classical.propDecidable + +def classicalEntropy (q : α → ℝ) : ℝ := ∑ a, Real.negMulLog (q a) +def centeredLog (q : α → ℝ) (a : α) : ℝ := -Real.log (q a)-classicalEntropy q +def logVariance (q : α → ℝ) : ℝ := ∑ a, q a*(centeredLog q a)^2 + +theorem centeredLog_mean (q : α → ℝ) (hs : ∑ a, q a=1) : + (∑ a, q a*centeredLog q a)=0 := by + simp only [centeredLog,mul_sub,Finset.sum_sub_distrib,← Finset.sum_mul,hs,one_mul] + simp [classicalEntropy,Real.negMulLog,mul_neg] + +def IsTypical (q : α → ℝ) (δ : ℝ) (n : ℕ) (x : Fin n → α) : Prop := + 0 < iidWeight q n x ∧ |iidSum (centeredLog q) n x| ≤ (n:ℝ)*δ + +theorem iid_log (q : α → ℝ) (n : ℕ) (x : Fin n → α) (hx : 0 < iidWeight q n x) : + iidSum (centeredLog q) n x = -Real.log (iidWeight q n x)-(n:ℝ)*classicalEntropy q := by + have hn : ∀ j ∈ Finset.univ, q (x j) ≠ 0 := (Finset.prod_ne_zero_iff.mp hx.ne') + simp only [iidSum,centeredLog,Finset.sum_sub_distrib,Finset.sum_neg_distrib, + Finset.sum_const,Finset.card_univ,Fintype.card_fin,nsmul_eq_mul] + rw [iidWeight,Real.log_prod hn] + +theorem typical_weight_lower (q : α → ℝ) (δ : ℝ) (n : ℕ) (x : Fin n → α) + (hx : IsTypical q δ n x) : Real.exp (-(n:ℝ)*(classicalEntropy q+δ)) ≤ iidWeight q n x := by + rw [← Real.exp_log hx.1] + apply Real.exp_le_exp.mpr + have h := (abs_le.mp hx.2).2 + rw [iid_log q n x hx.1] at h + nlinarith + +theorem typical_weight_upper (q : α → ℝ) (δ : ℝ) (n : ℕ) (x : Fin n → α) + (hx : IsTypical q δ n x) : iidWeight q n x ≤ Real.exp (-(n:ℝ)*(classicalEntropy q-δ)) := by + rw [← Real.exp_log hx.1] + apply Real.exp_le_exp.mpr + have h := (abs_le.mp hx.2).1 + rw [iid_log q n x hx.1] at h + nlinarith + +theorem typical_tail (q : α → ℝ) (hq : ∀ a, 0 ≤ q a) (hs : ∑ a, q a=1) + {δ : ℝ} (hδ : 0 < δ) {n : ℕ} (hn : 0 < n) : + (∑ x : Fin n → α, if IsTypical q δ n x then 0 else iidWeight q n x) ≤ + logVariance q / ((n:ℝ)*δ^2) := by + have hn' : 0 < (n:ℝ) := by exact_mod_cast hn + have he (x : Fin n → α) : (if IsTypical q δ n x then 0 else iidWeight q n x) = + (if (n:ℝ)*δ < |iidSum (centeredLog q) n x| then iidWeight q n x else 0) := by + by_cases hx : 0 < iidWeight q n x + · simp only [IsTypical,hx,true_and] + split_ifs <;> first | rfl | (exfalso; linarith) + · have hz : iidWeight q n x=0 := le_antisymm (not_lt.mp hx) (iidWeight_nonneg q hq n x) + simp [hz] + simp only [he] + have h := iid_chebyshev q (centeredLog q) hq hs (centeredLog_mean q hs) n (mul_pos hn' hδ) + convert h using 1 + dsimp only [logVariance] + field_simp + +def typicalSet (q : α → ℝ) (δ : ℝ) (n : ℕ) : Finset (Fin n → α) := + Finset.univ.filter (IsTypical q δ n) + +theorem typical_card (q : α → ℝ) (hq : ∀ a, 0 ≤ q a) (hs : ∑ a, q a=1) + (δ : ℝ) (n : ℕ) : + ((typicalSet q δ n).card : ℝ) ≤ Real.exp ((n:ℝ)*(classicalEntropy q+δ)) := by + let c := Real.exp (-(n:ℝ)*(classicalEntropy q+δ)) + have hc : 0 < c := Real.exp_pos _ + have hsum : ((typicalSet q δ n).card : ℝ)*c ≤ 1 := by + calc + _ = ∑ x ∈ typicalSet q δ n, c := by rw [Finset.sum_const,nsmul_eq_mul] + _ ≤ ∑ x ∈ typicalSet q δ n, iidWeight q n x := by + apply Finset.sum_le_sum + intro x hx + exact typical_weight_lower q δ n x (Finset.mem_filter.mp hx).2 + _ ≤ ∑ x : Fin n → α, iidWeight q n x := Finset.sum_le_univ_sum_of_nonneg + (fun x ↦ iidWeight_nonneg q hq n x) + _ = 1 := iidWeight_total q hs n + have h := mul_le_mul_of_nonneg_right hsum (Real.exp_pos ((n:ℝ)*(classicalEntropy q+δ))).le + have hexp : c*Real.exp ((n:ℝ)*(classicalEntropy q+δ))=1 := by + dsimp [c] + rw [← Real.exp_add] + simp only [neg_mul, neg_add_cancel, Real.exp_zero] + rwa [mul_assoc,hexp,mul_one,one_mul] at h + +end GAD + +end + +end OAI diff --git a/lean/OAI/InformationTheory/AmplitudeDamping/ZeroBlockEntropy.lean b/lean/OAI/InformationTheory/AmplitudeDamping/ZeroBlockEntropy.lean new file mode 100644 index 0000000000000000000000000000000000000000..ad66b376d9e765e7303fb71b54c30f4949c65668 --- /dev/null +++ b/lean/OAI/InformationTheory/AmplitudeDamping/ZeroBlockEntropy.lean @@ -0,0 +1,417 @@ +import OAI.InformationTheory.AmplitudeDamping.ScalarDeficit + +namespace OAI + +universe u_1 u_2 u_3 u_4 u_5 u_6 u_7 u_8 u_9 u_10 u_11 u_12 u_13 u_14 u_15 u_16 u_17 u_18 u_19 u_20 u_21 u_22 u_23 u_24 u_25 u_26 u_27 u_28 u_29 u_30 u_31 u_32 + +noncomputable section +open scoped BigOperators Matrix.Norms.Elementwise +open Matrix +open scoped BigOperators ComplexOrder MatrixOrder +open scoped Matrix.Norms.Elementwise ComplexOrder MatrixOrder +open Matrix Set +open scoped ComplexOrder MatrixOrder +open scoped BigOperators Topology +open Filter Set +open scoped BigOperators ComplexOrder MatrixOrder Topology +open scoped BigOperators ComplexOrder + +open scoped BigOperators ComplexOrder MatrixOrder +open Matrix +namespace GAD + +theorem trace_re_eq_sum_eigenvalues {ω : Type u_1} [Fintype ω] [DecidableEq ω] + {T : Matrix ω ω ℂ} (hT : T.PosSemidef) : + T.trace.re = ∑ i, hT.isHermitian.eigenvalues i := by + rw [hT.isHermitian.trace_eq_sum_eigenvalues]; simp + +theorem logDetShift_inv_eq_sum {ω : Type u_2} [Fintype ω] [DecidableEq ω] + {T : Matrix ω ω ℂ} (hT : T.PosSemidef) {t : ℝ} (ht : 0 < t) : + logDetShift t⁻¹ T = ∑ i, Real.log (1+hT.isHermitian.eigenvalues i/t) := by + rw [logDetShift_eq_sum hT (inv_nonneg.mpr ht.le)] + simp only [div_eq_mul_inv, mul_comm] + +theorem entropy_three_sub_le_deficits {ι : Type u_3} {κ : Type u_4} {μ : Type u_5} {ν : Type u_6} {τ : Type u_7} + [Fintype ι] [Fintype κ] [Fintype μ] [Fintype ν] [Fintype τ] + [DecidableEq ι] [DecidableEq κ] [DecidableEq μ] [DecidableEq ν] + {A : Matrix ι ι ℂ} {B : Matrix κ κ ℂ} {C : Matrix μ μ ℂ} {D : Matrix ν ν ℂ} + (hA : A.PosSemidef) (hB : B.PosSemidef) (hC : C.PosSemidef) (hD : D.PosSemidef) + (x y z : τ → ℝ) (hx : ∀ i, 0 ≤ x i) (hy : ∀ i, 0 ≤ y i) (hz : ∀ i, 0 ≤ z i) + (htrace : A.trace.re+B.trace.re+C.trace.re-D.trace.re = 0) + (hlog : ∀ r : ℝ, 0 < r → logDetShift r A+logDetShift r B+logDetShift r C-logDetShift r D ≤ + ∑ i, deficitLog (x i) (y i) (z i) r⁻¹) : + entropy A+entropy B+entropy C-entropy D ≤ ∑ i, scalarDeficit (x i) (y i) (z i) := by + classical + have hh := entropy_sum_le_of_log_sum_le + (Sum.elim (Sum.elim (fun _ : ι ↦ (1 : ℝ)) + (Sum.elim (fun _ : κ ↦ (1 : ℝ)) (Sum.elim (fun _ : μ ↦ (1 : ℝ)) (fun _ : ν ↦ (-1 : ℝ))))) + (fun i : τ × Fin 5 ↦ -deficitSigns i.2)) + (Sum.elim (Sum.elim hA.isHermitian.eigenvalues + (Sum.elim hB.isHermitian.eigenvalues (Sum.elim hC.isHermitian.eigenvalues hD.isHermitian.eigenvalues))) + (fun i : τ × Fin 5 ↦ deficitSpectrum (x i.1) (y i.1) (z i.1) i.2)) ?_ ?_ ?_ + · simp only [Fintype.sum_sum_type, Sum.elim_inl, Sum.elim_inr, Fintype.sum_prod_type, + one_mul, neg_mul, Finset.sum_neg_distrib, + ← entropy_eq_sum hA.isHermitian, ← entropy_eq_sum hB.isHermitian, + ← entropy_eq_sum hC.isHermitian, ← entropy_eq_sum hD.isHermitian, deficitSpectrum_entropy] at hh + linarith + · intro i + rcases i with i | i + · rcases i with i | i + · exact hA.eigenvalues_nonneg i + · rcases i with i | i + · exact hB.eigenvalues_nonneg i + · rcases i with i | i + · exact hC.eigenvalues_nonneg i + · exact hD.eigenvalues_nonneg i + · exact deficitSpectrum_nonneg (hx i.1) (hy i.1) (hz i.1) i.2 + · simp only [Fintype.sum_sum_type, Sum.elim_inl, Sum.elim_inr, Fintype.sum_prod_type, + one_mul, neg_mul, Finset.sum_neg_distrib, + ← trace_re_eq_sum_eigenvalues hA, ← trace_re_eq_sum_eigenvalues hB, ← trace_re_eq_sum_eigenvalues hC, ← trace_re_eq_sum_eigenvalues hD, + deficitSpectrum_trace (hx _) (hy _) (hz _), Finset.sum_const_zero, neg_zero, add_zero] + linarith + · intro t ht' + have h := hlog t⁻¹ (inv_pos.mpr ht') + simp only [inv_inv] at h + simp only [Fintype.sum_sum_type, Sum.elim_inl, Sum.elim_inr, Fintype.sum_prod_type, + one_mul, neg_mul, Finset.sum_neg_distrib, + deficitSpectrum_log (hx _) (hy _) (hz _) ht', ← logDetShift_inv_eq_sum hA ht', ← logDetShift_inv_eq_sum hB ht', ← logDetShift_inv_eq_sum hC ht', ← logDetShift_inv_eq_sum hD ht'] + linarith + +theorem deficitLog_inv {r : ℝ} (hr : 0 < r) (x : ℝ) {y z : ℝ} (hy : 0 ≤ y) (hz : 0 ≤ z) : + deficitLog x y z r⁻¹ = Real.log (1+r*x) - + Real.log (1+r*x/((1+r*y)*(1+r*z))) := by + have hdy : 1+r*y ≠ 0 := ne_of_gt (by positivity) + have hdz : 1+r*z ≠ 0 := ne_of_gt (by positivity) + have hiy : r⁻¹+y ≠ 0 := ne_of_gt (by positivity) + have hiz : r⁻¹+z ≠ 0 := ne_of_gt (by positivity) + have he : r⁻¹*x/((r⁻¹+y)*(r⁻¹+z)) = r*x/((1+r*y)*(1+r*z)) := by + field_simp + simp only [deficitLog, div_inv_eq_mul, mul_comm x r, he] + +variable {ι : Type u_8} {μ : Type u_9} {ν : Type u_10} [Fintype ι] [Fintype μ] [Fintype ν] + [DecidableEq ι] [DecidableEq μ] [DecidableEq ν] + +omit [Fintype ι] [DecidableEq ι] in +theorem posSemidef_diag_re {P : Matrix ι ι ℂ} (hP : P.PosSemidef) (i : ι) : + ((P i i).re : ℂ) = P i i := by + have hi := (Complex.nonneg_iff.mp (hP.diag_nonneg (i := i))).2 + apply Complex.ext <;> simp [hi] + +theorem gram_diagonal_real (s : ι → ℝ) : + gram (Matrix.diagonal (fun i ↦ (s i : ℂ))) = Matrix.diagonal (fun i ↦ (((s i)^2 : ℝ) : ℂ)) := by + simp only [gram, Matrix.diagonal_conjTranspose, Matrix.diagonal_mul_diagonal] + congr 1 + ext i + simp [pow_two] + +omit [DecidableEq μ] in +theorem zeroBlock_diagonal_log_bound (s : ι → ℝ) (B : Matrix ι μ ℂ) (C : Matrix ν ι ℂ) + {r : ℝ} (hr : 0 < r) : + let A := Matrix.diagonal (fun i ↦ (s i : ℂ)) + logDetShift r (gram A)+logDetShift r (gram B)+logDetShift r (gram C)- + logDetShift r (gram (zeroBlock A B C)) ≤ + ∑ i, deficitLog ((s i)^2) ((gram B i i).re) ((Cᴴ*C) i i).re r⁻¹ := by + dsimp only + have hB : (gram B).PosSemidef := Matrix.posSemidef_self_mul_conjTranspose B + have hC := Matrix.posSemidef_conjTranspose_mul_self C + have hy (i : ι) : 0 ≤ (gram B i i).re := (Complex.nonneg_iff.mp (hB.diag_nonneg (i := i))).1 + have hz (i : ι) : 0 ≤ ((Cᴴ*C) i i).re := (Complex.nonneg_iff.mp (hC.diag_nonneg (i := i))).1 + have hD : (1+r • gram B).PosDef := Matrix.PosDef.one.add_posSemidef (hB.smul hr.le) + have hE : (1+r • (Cᴴ*C)).PosDef := Matrix.PosDef.one.add_posSemidef (hC.smul hr.le) + have hdiag {P : Matrix ι ι ℂ} (hP : P.PosSemidef) : + Matrix.diagonal (fun i ↦ (1+r • P) i i) = + Matrix.diagonal (fun i ↦ ((1+r*(P i i).re : ℝ) : ℂ)) := by + congr 1 + ext i + simp only [Matrix.add_apply, Matrix.one_apply_eq, Matrix.smul_apply, Complex.ofReal_add, + Complex.ofReal_one, Complex.ofReal_mul, posSemidef_diag_re hP, Complex.real_smul] + have hZ : Real.sqrt r • Matrix.diagonal (fun i ↦ (s i : ℂ)) = + Matrix.diagonal (fun i ↦ ((Real.sqrt r*s i : ℝ) : ℂ)) := by + rw [← Matrix.diagonal_smul] + congr 1 + ext i + simp [Complex.real_smul] + have hp := blockLogDet_diagonal_le (fun i ↦ ((Real.sqrt r*s i : ℝ) : ℂ)) hD hE + rw [hdiag hB, hdiag hC, blockLogDet_diagonal_real] at hp + · rw [logDetShift_zeroBlock hr.le, hZ, gram_diagonal_real, + logDetShift_diagonal_real _ _ hr.le (fun i ↦ sq_nonneg (s i))] + have he (i : ι) : (Real.sqrt r*s i)^2 = r*(s i)^2 := by + rw [mul_pow, Real.sq_sqrt hr.le] + simp only [he] at hp + simp only [deficitLog_inv hr _ (hy _) (hz _), Finset.sum_sub_distrib] + linarith + · intro i; exact add_pos_of_pos_of_nonneg zero_lt_one (mul_nonneg hr.le (hy i)) + · intro i; exact add_pos_of_pos_of_nonneg zero_lt_one (mul_nonneg hr.le (hz i)) + +omit [DecidableEq μ] in +theorem zeroBlock_diagonal_entropy_bound (s : ι → ℝ) (B : Matrix ι μ ℂ) (C : Matrix ν ι ℂ) : + let A := Matrix.diagonal (fun i ↦ (s i : ℂ)) + entropy (gram A)+entropy (gram B)+entropy (gram C)-entropy (gram (zeroBlock A B C)) ≤ + scalarDeficit (mass A) (mass B) (mass C) := by + dsimp only + let A := Matrix.diagonal (fun i ↦ (s i : ℂ)) + have hx (i : ι) : 0 ≤ (s i)^2 := sq_nonneg _ + have hy (i : ι) : 0 ≤ (gram B i i).re := + (Complex.nonneg_iff.mp ((Matrix.posSemidef_self_mul_conjTranspose B).diag_nonneg (i := i))).1 + have hz (i : ι) : 0 ≤ ((Cᴴ*C) i i).re := + (Complex.nonneg_iff.mp ((Matrix.posSemidef_conjTranspose_mul_self C).diag_nonneg (i := i))).1 + have hh := entropy_three_sub_le_deficits (Matrix.posSemidef_self_mul_conjTranspose A) + (Matrix.posSemidef_self_mul_conjTranspose B) (Matrix.posSemidef_self_mul_conjTranspose C) + (Matrix.posSemidef_self_mul_conjTranspose (zeroBlock A B C)) + (fun i ↦ (s i)^2) (fun i ↦ (gram B i i).re) (fun i ↦ ((Cᴴ*C) i i).re) hx hy hz + (by change mass A+mass B+mass C-mass (zeroBlock A B C) = 0; rw [mass_zeroBlock]; ring) + (fun r hr ↦ zeroBlock_diagonal_log_bound s B C hr) + have hs := scalarDeficit_sum_le Finset.univ (fun i ↦ (s i)^2) + (fun i ↦ (gram B i i).re) (fun i ↦ ((Cᴴ*C) i i).re) + (fun i _ ↦ hx i) (fun i _ ↦ hy i) (fun i _ ↦ hz i) + have hxsum : ∑ i, (s i)^2 = mass A := by + simp [mass, A, gram_diagonal_real, Matrix.trace_diagonal, pow_two, Complex.mul_re] + have hysum : ∑ i, (gram B i i).re = mass B := by simp [mass, Matrix.trace, Matrix.diag] + have hzsum : ∑ i, ((Cᴴ*C) i i).re = mass C := by + rw [mass, gram, Matrix.trace_mul_comm] + simp [Matrix.trace, Matrix.diag] + rw [hxsum, hysum, hzsum] at hs + exact hh.trans hs + +end GAD +open scoped BigOperators ComplexOrder MatrixOrder +open Matrix +namespace GAD +variable {ι : Type u_11} {κ : Type u_12} {μ : Type u_13} {ν : Type u_14} [Fintype ι] [Fintype κ] [Fintype μ] [Fintype ν] + [DecidableEq ι] [DecidableEq κ] [DecidableEq μ] [DecidableEq ν] + +omit [Fintype μ] [DecidableEq ν] [DecidableEq ι] [DecidableEq μ] in +theorem gram_biisometry (R : Matrix μ ι ℂ) (A : Matrix ι κ ℂ) (T : Matrix κ ν ℂ) + (hT : T*Tᴴ = 1) : gram (R*A*T) = R*gram A*Rᴴ := by + simp only [gram, Matrix.conjTranspose_mul, Matrix.mul_assoc, + ← Matrix.mul_assoc T Tᴴ, hT, Matrix.one_mul] + +omit [DecidableEq μ] [DecidableEq ν] in +theorem mass_biisometry (R : Matrix μ ι ℂ) (A : Matrix ι κ ℂ) (T : Matrix κ ν ℂ) + (hR : Rᴴ*R = 1) (hT : T*Tᴴ = 1) : mass (R*A*T) = mass A := by + unfold mass + rw [gram_biisometry R A T hT, Matrix.trace_mul_cycle] + simp only [hR, Matrix.one_mul] + +omit [DecidableEq ν] in +theorem entropy_gram_biisometry (R : Matrix μ ι ℂ) (A : Matrix ι κ ℂ) (T : Matrix κ ν ℂ) + (hR : Rᴴ*R = 1) (hT : T*Tᴴ = 1) : entropy (gram (R*A*T)) = entropy (gram A) := by + rw [gram_biisometry R A T hT] + have he : R*gram A*Rᴴ = gram (R*A) := by + simp only [gram, Matrix.conjTranspose_mul, Matrix.mul_assoc] + rw [he] + change entropy ((R*A)*(R*A)ᴴ) = _ + rw [entropy_mul_conjTranspose] + simp only [Matrix.conjTranspose_mul, Matrix.mul_assoc, ← Matrix.mul_assoc Rᴴ R, + hR, Matrix.one_mul] + exact (entropy_mul_conjTranspose A).symm + +omit [DecidableEq ι] [DecidableEq κ] [DecidableEq μ] [DecidableEq ν] in +theorem zeroBlock_bimultiply {ι' : Type u_15} {κ' : Type u_16} {μ' : Type u_17} {ν' : Type u_18} + [Fintype ι'] [Fintype κ'] [Fintype μ'] [Fintype ν'] + (R : Matrix ι' ι ℂ) (Q : Matrix ν' ν ℂ) (S : Matrix κ κ' ℂ) (T : Matrix μ μ' ℂ) + (A : Matrix ι κ ℂ) (B : Matrix ι μ ℂ) (C : Matrix ν κ ℂ) : + zeroBlock (R*A*S) (R*B*T) (Q*C*S) = + Matrix.fromBlocks R 0 0 Q * zeroBlock A B C * Matrix.fromBlocks S 0 0 T := by + simp [zeroBlock, Matrix.fromBlocks_multiply] + +omit [Fintype ι] [Fintype κ] [DecidableEq μ] [DecidableEq ν] in +theorem isometry_fromBlocks (R : Matrix μ ι ℂ) (Q : Matrix ν κ ℂ) + (hR : Rᴴ*R = 1) (hQ : Qᴴ*Q = 1) : + (Matrix.fromBlocks R 0 0 Q)ᴴ * Matrix.fromBlocks R 0 0 Q = 1 := by + simp [Matrix.fromBlocks_conjTranspose, Matrix.fromBlocks_multiply, hR, hQ] + +omit [Fintype μ] [Fintype ν] [DecidableEq κ] [DecidableEq ι] in +theorem coisometry_fromBlocks (R : Matrix μ ι ℂ) (Q : Matrix ν κ ℂ) + (hR : R*Rᴴ = 1) (hQ : Q*Qᴴ = 1) : + Matrix.fromBlocks R 0 0 Q * (Matrix.fromBlocks R 0 0 Q)ᴴ = 1 := by + simp [Matrix.fromBlocks_conjTranspose, Matrix.fromBlocks_multiply, hR, hQ] + +end GAD +open scoped BigOperators ComplexOrder +open Matrix +namespace GAD +variable {ι : Type u_19} [Fintype ι] [DecidableEq ι] + +/-- Singular-value decomposition in the same finite coordinate type, including +singular matrices. The zero singular directions are completed orthonormally. -/ +theorem exists_unitary_singular_decomposition (A : Matrix ι ι ℂ) : + ∃ (U V : Matrix.unitaryGroup ι ℂ) (s : ι → ℝ), + (∀ i, 0 ≤ s i) ∧ A = (U : Matrix ι ι ℂ) * Matrix.diagonal (fun i ↦ (s i : ℂ)) * star V := by + let hP := Matrix.posSemidef_conjTranspose_mul_self A + let V := hP.isHermitian.eigenvectorUnitary + let l := hP.isHermitian.eigenvalues + let B := A * (V : Matrix ι ι ℂ) + have hGram : Bᴴ * B = Matrix.diagonal (fun i ↦ (l i : ℂ)) := by + simpa only [B, Matrix.conjTranspose_mul, ← Matrix.mul_assoc, + Matrix.star_eq_conjTranspose, V, l, Unitary.conjStarAlgAut_star_apply, + Function.comp_def, RCLike.ofReal_eq_complex_ofReal] using hP.isHermitian.conjStarAlgAut_star_eigenvectorUnitary + let w (i : ι) : EuclideanSpace ℂ ι := WithLp.toLp 2 (fun k ↦ B k i) + have hw (i j : ι) : inner ℂ (w i) (w j) = (Matrix.diagonal (fun i ↦ (l i : ℂ))) i j := by + rw [← hGram] + simp [w, EuclideanSpace.inner_eq_star_dotProduct, Matrix.mul_apply, + Matrix.conjTranspose_apply, dotProduct, mul_comm] + let s (i : ι) := Real.sqrt (l i) + have hs (i : ι) : 0 ≤ s i := Real.sqrt_nonneg _ + have hsq (i : ι) : s i * s i = l i := Real.mul_self_sqrt (hP.eigenvalues_nonneg i) + let v (i : ι) : EuclideanSpace ℂ ι := ((s i : ℂ)⁻¹) • w i + have hv : Orthonormal ℂ (Set.domRestrict {i | s i ≠ 0} v) := by + rw [orthonormal_iff_ite] + intro i j + simp only [Set.domRestrict_apply, v, inner_smul_left, inner_smul_right, hw, + map_inv₀, Complex.conj_ofReal] + by_cases hij : i = j + · subst j + simp only [ite_true, Matrix.diagonal_apply_eq] + have hne : (s i : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr i.property + have hsq' : (s i : ℂ) * (s i : ℂ) = (l i : ℂ) := by exact_mod_cast hsq i + rw [← hsq'] + field_simp + · have hij' : (i : ι) ≠ (j : ι) := fun h ↦ hij (Subtype.ext h) + simp [Matrix.diagonal_apply_ne _ hij', hij] + obtain ⟨b, hb⟩ := hv.exists_orthonormalBasis_extension_of_card_eq + (by simp : Module.finrank ℂ (EuclideanSpace ℂ ι) = Fintype.card ι) + let U : Matrix.unitaryGroup ι ℂ := + ⟨(EuclideanSpace.basisFun ι ℂ).toBasis.toMatrix b.toBasis, + (EuclideanSpace.basisFun ι ℂ).toMatrix_orthonormalBasis_mem_unitary b⟩ + have hU (i j : ι) : U i j = b j i := rfl + have hcol (i : ι) : w i = (s i : ℂ) • b i := by + by_cases hi : s i = 0 + · have hwi : inner ℂ (w i) (w i) = 0 := by + rw [hw, Matrix.diagonal_apply_eq, ← hsq] + simp [hi] + rw [inner_self_eq_zero] at hwi + simp [hi, hwi] + · rw [hb i hi] + simp only [v, smul_smul, mul_inv_cancel₀ (Complex.ofReal_ne_zero.mpr hi), one_smul] + have hB : B = (U : Matrix ι ι ℂ) * Matrix.diagonal (fun i ↦ (s i : ℂ)) := by + ext k i + have h := congrArg (fun x : EuclideanSpace ℂ ι ↦ x k) (hcol i) + simpa [w, Matrix.mul_diagonal, hU, mul_comm] using h + refine ⟨U, V, s, hs, ?_⟩ + rw [← hB] + simp only [B, Matrix.mul_assoc, Unitary.coe_mul_star_self, Matrix.mul_one] +end GAD +open scoped BigOperators ComplexOrder MatrixOrder +open Matrix +namespace GAD + +section +variable {ι : Type u_20} {μ : Type u_21} {ν : Type u_22} [Fintype ι] [Fintype μ] [Fintype ν] + [DecidableEq ι] [DecidableEq μ] [DecidableEq ν] + +theorem zeroBlock_square_entropy_bound (A : Matrix ι ι ℂ) (B : Matrix ι μ ℂ) (C : Matrix ν ι ℂ) : + entropy (gram A)+entropy (gram B)+entropy (gram C)-entropy (gram (zeroBlock A B C)) ≤ + scalarDeficit (mass A) (mass B) (mass C) := by + obtain ⟨U,V,s,_,hA⟩ := exists_unitary_singular_decomposition A + let R : Matrix ι ι ℂ := (star U : Matrix ι ι ℂ) + let T : Matrix ι ι ℂ := V + have hR : Rᴴ*R = 1 := by simp [R, ← Matrix.star_eq_conjTranspose] + have hT : T*Tᴴ = 1 := by simp [T, ← Matrix.star_eq_conjTranspose] + have hUR : R*(U : Matrix ι ι ℂ) = 1 := by simp [R] + have hVT : (star V : Matrix ι ι ℂ)*T = 1 := by simp [T] + have hdiag : R*A*T = Matrix.diagonal (fun i ↦ (s i : ℂ)) := by + rw [hA] + simp only [Unitary.coe_star, Matrix.mul_assoc, ← Matrix.mul_assoc R (U : Matrix ι ι ℂ), hUR, Matrix.one_mul, + hVT, Matrix.mul_one] + have hb := zeroBlock_diagonal_entropy_bound s (R*B) (C*T) + dsimp only at hb + rw [← hdiag] at hb + have hm := entropy_gram_biisometry (Matrix.fromBlocks R 0 0 (1 : Matrix ν ν ℂ)) + (zeroBlock A B C) (Matrix.fromBlocks T 0 0 (1 : Matrix μ μ ℂ)) + (isometry_fromBlocks R 1 hR (by simp)) (coisometry_fromBlocks T 1 hT (by simp)) + rw [← zeroBlock_bimultiply] at hm + simp only [Matrix.mul_one, Matrix.one_mul] at hm + have hB := entropy_gram_biisometry R B (1 : Matrix μ μ ℂ) hR (by simp) + have hC := entropy_gram_biisometry (1 : Matrix ν ν ℂ) C T (by simp) hT + have hmB := mass_biisometry R B (1 : Matrix μ μ ℂ) hR (by simp) + have hmC := mass_biisometry (1 : Matrix ν ν ℂ) C T (by simp) hT + simp only [Matrix.mul_one, Matrix.one_mul] at hB hC hmB hmC + simpa only [entropy_gram_biisometry R A T hR hT, hB, hC, hm, + mass_biisometry R A T hR hT, hmB, hmC] using hb + +end + +section +variable {ι : Type u_23} {κ : Type u_24} {μ : Type u_25} {ν : Type u_26} [Fintype ι] [Fintype κ] [Fintype μ] [Fintype ν] + [DecidableEq ι] [DecidableEq κ] [DecidableEq μ] [DecidableEq ν] + +theorem zeroBlock_entropy_bound (A : Matrix ι κ ℂ) (B : Matrix ι μ ℂ) (C : Matrix ν κ ℂ) : + entropy (gram A)+entropy (gram B)+entropy (gram C)-entropy (gram (zeroBlock A B C)) ≤ + scalarDeficit (mass A) (mass B) (mass C) := by + let R : Matrix (ι ⊕ κ) ι ℂ := Matrix.fromRows 1 0 + let T : Matrix κ (ι ⊕ κ) ℂ := Matrix.fromCols 0 1 + have hR : Rᴴ*R = 1 := by simp [R, Matrix.conjTranspose_fromRows_eq_fromCols_conjTranspose, Matrix.fromCols_mul_fromRows] + have hT : T*Tᴴ = 1 := by simp [T, Matrix.conjTranspose_fromCols_eq_fromRows_conjTranspose, Matrix.fromCols_mul_fromRows] + have hb := zeroBlock_square_entropy_bound (R*A*T) (R*B) (C*T) + have hm := entropy_gram_biisometry (Matrix.fromBlocks R 0 0 (1 : Matrix ν ν ℂ)) + (zeroBlock A B C) (Matrix.fromBlocks T 0 0 (1 : Matrix μ μ ℂ)) + (isometry_fromBlocks R 1 hR (by simp)) (coisometry_fromBlocks T 1 hT (by simp)) + rw [← zeroBlock_bimultiply] at hm + simp only [Matrix.mul_one, Matrix.one_mul] at hm + have hB := entropy_gram_biisometry R B (1 : Matrix μ μ ℂ) hR (by simp) + have hC := entropy_gram_biisometry (1 : Matrix ν ν ℂ) C T (by simp) hT + have hmB := mass_biisometry R B (1 : Matrix μ μ ℂ) hR (by simp) + have hmC := mass_biisometry (1 : Matrix ν ν ℂ) C T (by simp) hT + simp only [Matrix.mul_one, Matrix.one_mul] at hB hC hmB hmC + simpa only [entropy_gram_biisometry R A T hR hT, hB, hC, hm, + mass_biisometry R A T hR hT, hmB, hmC] using hb + +end + +section +variable {ι : Type u_27} {κ : Type u_28} [Fintype ι] [Fintype κ] [DecidableEq ι] [DecidableEq κ] + +theorem entropy_smul (a : ℝ) {P : Matrix ι ι ℂ} (hP : P.IsHermitian) : + entropy (a • P) = a * entropy P + Real.negMulLog a * P.trace.re := by + rw [entropy, ← cfc_comp_smul a Real.negMulLog P, trace_cfc_eq hP] + simp only [smul_eq_mul, Complex.re_sum, Complex.ofReal_re, + Real.negMulLog_mul, Finset.sum_add_distrib, ← Finset.sum_mul, ← Finset.mul_sum, + ← entropy_eq_sum hP] + rw [hP.trace_eq_sum_eigenvalues] + simp + ring + +omit [DecidableEq κ] in +theorem entropy_sqrt_smul {a : ℝ} (ha : 0 ≤ a) (X : Matrix ι κ ℂ) (hX : mass X = 1) : + entropy (gram (Real.sqrt a • X)) = a * entropy (gram X) + Real.negMulLog a := by + have hh : (gram X).IsHermitian := (Matrix.posSemidef_self_mul_conjTranspose X).isHermitian + rw [gram_sqrt_smul ha, entropy_smul a hh] + change a * entropy (gram X) + Real.negMulLog a * mass X = _ + rw [hX, mul_one] + +omit [DecidableEq ι] [DecidableEq κ] in +theorem mass_sqrt_smul {a : ℝ} (ha : 0 ≤ a) (X : Matrix ι κ ℂ) : + mass (Real.sqrt a • X) = a * mass X := by + simp [mass, gram_sqrt_smul ha] + +end + +theorem scalarDeficit_normalized {a b c : ℝ} (h : a+b+c=1) : + scalarDeficit a b c = Real.negMulLog a + Real.negMulLog b + Real.negMulLog c - g (b*c) := by + have hl : blockLambdaMinus a b c = 1-blockLambdaPlus a b c := by + unfold blockLambdaMinus blockLambdaPlus + rw [h]; ring + simp only [scalarDeficit, hl, g, Real.binEntropy_eq_negMulLog_add_negMulLog_one_sub, + blockLambdaPlus, h, one_pow, mul_assoc] + ring + +variable {ι : Type u_29} {κ : Type u_30} {μ : Type u_31} {ν : Type u_32} [Fintype ι] [Fintype κ] [Fintype μ] [Fintype ν] + [DecidableEq ι] [DecidableEq κ] [DecidableEq μ] [DecidableEq ν] + +theorem zeroBlock_normalized (X : Matrix ι κ ℂ) (Y : Matrix ι μ ℂ) (Z : Matrix ν κ ℂ) + (hX : mass X = 1) (hY : mass Y = 1) (hZ : mass Z = 1) + {a b c : ℝ} (ha : 0 ≤ a) (hb : 0 ≤ b) (hc : 0 ≤ c) (h : a+b+c=1) : + a*entropy (gram X)+b*entropy (gram Y)+c*entropy (gram Z)+g (b*c) ≤ + entropy (gram (zeroBlock (Real.sqrt a • X) (Real.sqrt b • Y) (Real.sqrt c • Z))) := by + have hh := zeroBlock_entropy_bound (Real.sqrt a • X) (Real.sqrt b • Y) (Real.sqrt c • Z) + rw [entropy_sqrt_smul ha X hX, entropy_sqrt_smul hb Y hY, entropy_sqrt_smul hc Z hZ, + mass_sqrt_smul ha, mass_sqrt_smul hb, mass_sqrt_smul hc, hX, hY, hZ, mul_one, + mul_one, mul_one, scalarDeficit_normalized h] at hh + linarith + +end GAD + +end + +end OAI diff --git a/lean/OAI/InformationTheory/BooleanNoise/ArtanhBounds.lean b/lean/OAI/InformationTheory/BooleanNoise/ArtanhBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..493f9cc0f72bcb2388ecb6c4918e9e026f5e42e0 --- /dev/null +++ b/lean/OAI/InformationTheory/BooleanNoise/ArtanhBounds.lean @@ -0,0 +1,39 @@ +import OAI.InformationTheory.BooleanNoise.EntropySeries + +namespace OAI + +namespace LeanBlast.CourtadeKumar + +theorem self_le_artanh {u : ℝ} (hu : u ∈ Set.Ico 0 1) : u ≤ Real.artanh u := by + simpa using sum_range_artanh_le hu.1 hu.2 1 + +theorem artanh_le_div_one_sub_sq {u : ℝ} (hu : u ∈ Set.Ico 0 1) : + Real.artanh u ≤ u / (1 - u ^ 2) := by + have huabs : |u| < 1 := by simpa only [abs_of_nonneg hu.1] using hu.2 + have hu2 : u ^ 2 < 1 := by + have hmul := mul_pos (sub_pos.mpr hu.2) (show 0 < 1 + u by linarith [hu.1]) + nlinarith + have hgeom := (hasSum_geometric_of_lt_one (sq_nonneg u) hu2).mul_left u + have hseries := hasSum_artanh huabs + have hle : Real.artanh u ≤ u * (1 - u ^ 2)⁻¹ := by + apply hasSum_le _ hseries hgeom + intro k + have hpow : u ^ (2 * k + 1) = u * (u ^ 2) ^ k := by + rw [pow_add, pow_one, pow_mul] + ring + rw [hpow] + exact div_le_self (mul_nonneg hu.1 (pow_nonneg (sq_nonneg u) k)) + (by linarith [Nat.cast_nonneg (α := ℝ) k]) + simpa only [div_eq_mul_inv] using hle + +theorem one_sub_sq_mul_artanh_le_self {u : ℝ} (hu : u ∈ Set.Ico 0 1) : + (1 - u ^ 2) * Real.artanh u ≤ u := by + have hden : 0 < 1 - u ^ 2 := by + have hmul := mul_pos (sub_pos.mpr hu.2) (show 0 < 1 + u by linarith [hu.1]) + nlinarith + have hle := (le_div_iff₀ hden).mp (artanh_le_div_one_sub_sq hu) + simpa only [mul_comm] using hle + +end LeanBlast.CourtadeKumar + +end OAI diff --git a/lean/OAI/InformationTheory/BooleanNoise/Attainment.lean b/lean/OAI/InformationTheory/BooleanNoise/Attainment.lean new file mode 100644 index 0000000000000000000000000000000000000000..cf4cdb948528d5aa3f0ae8408aadf9ff6338f9f9 --- /dev/null +++ b/lean/OAI/InformationTheory/BooleanNoise/Attainment.lean @@ -0,0 +1,171 @@ +import OAI.InformationTheory.BooleanNoise.FiniteNoise +import OAI.InformationTheory.BooleanNoise.Statement +import OAI.InformationTheory.BooleanNoise.EntropyScalars +import OAI.InformationTheory.BooleanNoise.InformationIdentity + +namespace OAI + +open scoped BigOperators + +noncomputable section + +namespace LeanBlast.CourtadeKumar + +variable {n : ℕ} + +theorem noiseOperator_dictator (u : ℝ) (i : Fin n) (x : Cube n) : + noiseOperator u (signEncoding (dictator i)) x = + u * signEncoding (dictator i) x := by + let a : Fin n → Bool → ℝ := + fun j b => if j = i then (if b then 1 else -1) else 1 + have hprod : (fun y : Cube n => ∏ j, a j (y j)) = signEncoding (dictator i) := by + funext y + simp [a, signEncoding, dictator] + rfl + have hfactor (j : Fin n) : + (∑ b : Bool, (if x j = b then (1 + u) / 2 else (1 - u) / 2) * a j b) = + if j = i then u * signEncoding (dictator i) x else 1 := by + by_cases hji : j = i + · subst j + cases hx : x i <;> simp [a, hx, signEncoding, dictator] <;> ring + · cases hx : x j <;> simp [a, hji] <;> ring + calc + _ = noiseOperator u (fun y => ∏ j, a j (y j)) x := by rw [hprod] + _ = ∏ j, ∑ b : Bool, + (if x j = b then (1 + u) / 2 else (1 - u) / 2) * a j b := + noiseOperator_prod u a x + _ = u * signEncoding (dictator i) x := by simp_rw [hfactor]; simp + +theorem cubeAverage_dictator (i : Fin n) : cubeAverage (signEncoding (dictator i)) = 0 := by + simpa only [noiseOperator_zero_correlation, zero_mul] using + noiseOperator_dictator 0 i (fun _ => false) + +theorem signEncoding_complementDictator (i : Fin n) : + signEncoding (complementDictator i) = fun x => -signEncoding (dictator i) x := by + funext x + cases hx : x i <;> simp [signEncoding, complementDictator, dictator, hx] + +theorem noiseOperator_complementDictator (u : ℝ) (i : Fin n) (x : Cube n) : + noiseOperator u (signEncoding (complementDictator i)) x = + u * signEncoding (complementDictator i) x := by + rw [signEncoding_complementDictator, noiseOperator_neg, noiseOperator_dictator] + ring + +theorem cubeAverage_complementDictator (i : Fin n) : + cubeAverage (signEncoding (complementDictator i)) = 0 := by + rw [signEncoding_complementDictator, cubeAverage_neg, cubeAverage_dictator, neg_zero] + +theorem isSignValued_signEncoding (f : Cube n → Bool) : IsSignValued (signEncoding f) := by + intro x + cases hx : f x <;> simp [signEncoding, hx] + +@[simp] theorem entropyAverage_const (c : ℝ) : + entropyAverage (fun _ : Cube n => c) = entropy c := + cubeAverage_const n (entropy c) + +@[simp] theorem informationDeficit_const (c : ℝ) : + informationDeficit (fun _ : Cube n => c) = 0 := by + simp [informationDeficit] + +theorem entropyAverage_neg (g : Cube n → ℝ) : + entropyAverage (fun x => -g x) = entropyAverage g := by + simp [entropyAverage] + +theorem informationDeficit_neg (g : Cube n → ℝ) : + informationDeficit (fun x => -g x) = informationDeficit g := by + simp only [informationDeficit, cubeAverage_neg, entropy_neg, entropyAverage_neg] + +@[simp] theorem informationDeficit_noise_const (u c : ℝ) : + informationDeficit (noiseOperator u (fun _ : Cube n => c)) = 0 := by + have h : noiseOperator u (fun _ : Cube n => c) = fun _ => c := by + funext x + exact noiseOperator_const u c x + rw [h, informationDeficit_const] + +@[simp] theorem informationDeficit_noise_zero (g : Cube n → ℝ) : + informationDeficit (noiseOperator 0 g) = 0 := by + have h : noiseOperator 0 g = fun _ => cubeAverage g := by + funext x + exact noiseOperator_zero_correlation g x + rw [h, informationDeficit_const] + +theorem informationDeficit_noise_one_le (g : Cube n → ℝ) (hg : IsSignValued g) : + informationDeficit (noiseOperator 1 g) ≤ psi 1 := by + have hnoise : noiseOperator 1 g = g := by + funext x + exact noiseOperator_one g x + have he : entropyAverage g = 0 := by + have hpoint : (fun x => entropy (g x)) = fun _ : Cube n => 0 := by + funext x + rcases hg x with h | h <;> simp [h] + unfold entropyAverage + rw [hpoint, cubeAverage_const] + rw [hnoise, informationDeficit, he, sub_zero, psi_one] + exact entropy_le_ell _ + +theorem informationDeficit_noise_dictator (u : ℝ) (i : Fin n) : + informationDeficit (noiseOperator u (signEncoding (dictator i))) = psi u := by + have he : entropyAverage (noiseOperator u (signEncoding (dictator i))) = entropy u := by + have hpoint : + (fun x => entropy (noiseOperator u (signEncoding (dictator i)) x)) = + fun _ : Cube n => entropy u := by + funext x + rw [noiseOperator_dictator] + cases hx : x i <;> simp [signEncoding, dictator, hx] + unfold entropyAverage + rw [hpoint, cubeAverage_const] + rw [informationDeficit, cubeAverage_noiseOperator, cubeAverage_dictator, + entropy_zero, he] + simp [entropy] + +theorem informationDeficit_noise_complementDictator (u : ℝ) (i : Fin n) : + informationDeficit (noiseOperator u (signEncoding (complementDictator i))) = psi u := by + rw [signEncoding_complementDictator] + have h : noiseOperator u (fun x => -signEncoding (dictator i) x) = + fun x => -noiseOperator u (signEncoding (dictator i)) x := by + funext x + exact noiseOperator_neg u (signEncoding (dictator i)) x + rw [h, informationDeficit_neg, informationDeficit_noise_dictator] + +theorem mutualInformation_dictator (ε : ℝ) (hε0 : 0 ≤ ε) (hεhalf : ε ≤ (1 : ℝ) / 2) + (i : Fin n) : mutualInformation ε (dictator i) = 1 - binaryEntropy ε := by + rw [mutualInformation_eq_informationDeficit ε (dictator i) hε0 hεhalf, + informationDeficit_noise_dictator, one_sub_binaryEntropy_eq_psi] + +theorem mutualInformation_complementDictator (ε : ℝ) (hε0 : 0 ≤ ε) + (hεhalf : ε ≤ (1 : ℝ) / 2) (i : Fin n) : + mutualInformation ε (complementDictator i) = 1 - binaryEntropy ε := by + rw [mutualInformation_eq_informationDeficit ε (complementDictator i) hε0 hεhalf, + informationDeficit_noise_complementDictator, one_sub_binaryEntropy_eq_psi] + +theorem dictatorAttainment : DictatorAttainmentStatement := by + intro n _ ε hε0 hεhalf i + exact ⟨mutualInformation_dictator ε hε0 hεhalf i, + mutualInformation_complementDictator ε hε0 hεhalf i⟩ + +theorem mutualInformation_zero_le (f : Cube n → Bool) : mutualInformation 0 f ≤ 1 := by + rw [mutualInformation_eq_informationDeficit 0 f (by norm_num) (by norm_num)] + simp only [mul_zero, sub_zero] + apply (div_le_one ell_pos).mpr + simpa only [psi_one] using + informationDeficit_noise_one_le (signEncoding f) (isSignValued_signEncoding f) + +theorem mutualInformation_half (f : Cube n → Bool) : + mutualInformation ((1 : ℝ) / 2) f = 0 := by + rw [mutualInformation_eq_informationDeficit _ f (by norm_num) (by norm_num)] + norm_num + +theorem courtadeKumar_zero (f : Cube n → Bool) : + mutualInformation 0 f ≤ 1 - binaryEntropy 0 := by + simpa only [binaryEntropy_zero, sub_zero] using mutualInformation_zero_le f + +theorem courtadeKumar_half (f : Cube n → Bool) : + mutualInformation ((1 : ℝ) / 2) f ≤ 1 - binaryEntropy ((1 : ℝ) / 2) := by + rw [mutualInformation_half, one_sub_binaryEntropy_eq_psi] + norm_num + +end LeanBlast.CourtadeKumar + +end + +end OAI diff --git a/lean/OAI/InformationTheory/BooleanNoise/Basic.lean b/lean/OAI/InformationTheory/BooleanNoise/Basic.lean new file mode 100644 index 0000000000000000000000000000000000000000..a8a77fe666d2230e129cd97e295de56006dd8034 --- /dev/null +++ b/lean/OAI/InformationTheory/BooleanNoise/Basic.lean @@ -0,0 +1,71 @@ +import OAI.InformationTheory.BooleanNoise.Model +import OAI.Combinatorics.GotsmanLinial.Statement +import Mathlib.Analysis.SpecialFunctions.Artanh + +namespace OAI + +noncomputable section + +namespace LeanBlast.CourtadeKumar + +def noiseKernel {n : ℕ} (u : ℝ) (x y : Cube n) : ℝ := + ∏ i, if x i = y i then (1 + u) / 2 else (1 - u) / 2 + +def noiseOperator {n : ℕ} (u : ℝ) (g : Cube n → ℝ) (x : Cube n) : ℝ := + ∑ y, noiseKernel u x y * g y + +abbrev flip {n : ℕ} (i : Fin n) (x : Cube n) : Cube n := + LeanBlast.GotsmanLinial.flip i x + +def cubeDerivative {n : ℕ} (i : Fin n) (g : Cube n → ℝ) (x : Cube n) : ℝ := + (g x - g (flip i x)) / 2 + +def psi (v : ℝ) : ℝ := + (1 + v) / 2 * Real.log (1 + v) + (1 - v) / 2 * Real.log (1 - v) + +def entropy (v : ℝ) : ℝ := ell - psi v + +def entropyAverage {n : ℕ} (g : Cube n → ℝ) : ℝ := + cubeAverage (fun x => entropy (g x)) + +def informationDeficit {n : ℕ} (g : Cube n → ℝ) : ℝ := + entropy (cubeAverage g) - entropyAverage g + +def meanVariance {n : ℕ} (g : Cube n → ℝ) : ℝ := + 1 - (cubeAverage g) ^ 2 + +def dissipation {n : ℕ} (g : Cube n → ℝ) : ℝ := + ∑ i, cubeAverage (fun x => Real.artanh (g x) * cubeDerivative i g x) + +def IsInterior {n : ℕ} (g : Cube n → ℝ) : Prop := + ∀ x, -1 < g x ∧ g x < 1 + +def IsSignValued {n : ℕ} (g : Cube n → ℝ) : Prop := + ∀ x, g x = 1 ∨ g x = -1 + +def IsIncreasing {n : ℕ} (g : Cube n → ℝ) : Prop := + ∀ x y, (∀ i, x i ≤ y i) → g x ≤ g y + +def signEncoding {n : ℕ} (f : Cube n → Bool) (x : Cube n) : ℝ := + if f x then 1 else -1 + +def restrict {n : ℕ} (g : Cube (n + 1) → ℝ) (b : Bool) (x : Cube n) : ℝ := + g (Fin.cases b x) + +def pairMean {n : ℕ} (g : Cube (n + 1) → ℝ) (x : Cube n) : ℝ := + (restrict g true x + restrict g false x) / 2 + +def pairHalfDifference {n : ℕ} (g : Cube (n + 1) → ℝ) (x : Cube n) : ℝ := + (restrict g true x - restrict g false x) / 2 + +def pairEntropyGap (a b : ℝ) : ℝ := + entropy a - (entropy (a + b) + entropy (a - b)) / 2 + +def pairDissipation (a b : ℝ) : ℝ := + b / 2 * (Real.artanh (a + b) - Real.artanh (a - b)) + +end LeanBlast.CourtadeKumar + +end + +end OAI diff --git a/lean/OAI/InformationTheory/BooleanNoise/Comparison.lean b/lean/OAI/InformationTheory/BooleanNoise/Comparison.lean new file mode 100644 index 0000000000000000000000000000000000000000..7f28399babccca650ea046cc6964de3220cddd52 --- /dev/null +++ b/lean/OAI/InformationTheory/BooleanNoise/Comparison.lean @@ -0,0 +1,744 @@ +import OAI.InformationTheory.BooleanNoise.Basic +import OAI.InformationTheory.BooleanNoise.EntropyScalars +import OAI.InformationTheory.BooleanNoise.CurvatureCertificates +import OAI.InformationTheory.BooleanNoise.ComparisonEstimates +import OAI.InformationTheory.BooleanNoise.InverseRegularity +import OAI.InformationTheory.BooleanNoise.LShape +import OAI.InformationTheory.BooleanNoise.EntropyBounds +import OAI.InformationTheory.BooleanNoise.SemigroupFlow +import OAI.InformationTheory.BooleanNoise.CubeVariance +import OAI.InformationTheory.BooleanNoise.MonotoneDissipation +import OAI.InformationTheory.BooleanNoise.GeneralDissipation +import Mathlib.Analysis.ODE.Gronwall +import Mathlib.MeasureTheory.Integral.IntervalIntegral.FundThmCalculus +import Mathlib.Tactic + +namespace OAI + +noncomputable section + +open Set Filter MeasureTheory +open scoped Topology BigOperators + +namespace LeanBlast.CourtadeKumar + +theorem le_add_initial_gap_of_deriv_le_on_above + {f g f' g' : ℝ → ℝ} {a b δ : ℝ} + (hf : ∀ t ∈ Icc a b, HasDerivAt f (f' t) t) + (hg : ∀ t ∈ Icc a b, HasDerivAt g (g' t) t) + (hderiv : ∀ t ∈ Ico a b, g t ≤ f t → f' t ≤ g' t) + (hδ : 0 ≤ δ) (ha : f a ≤ g a + δ) : + ∀ t ∈ Icc a b, f t ≤ g t + δ := by + have hfcont : ContinuousOn f (Icc a b) := + fun t ht => (hf t ht).continuousAt.continuousWithinAt + have hgcont : ContinuousOn g (Icc a b) := + fun t ht => (hg t ht).continuousAt.continuousWithinAt + have hpert : ∀ t ∈ Icc a b, ∀ ε > 0, + f t ≤ g t + δ + ε * (t - a) := by + intro t ht ε hε + apply image_le_of_deriv_right_lt_deriv_boundary' hfcont + (fun x hx => (hf x ⟨hx.1, hx.2.le⟩).hasDerivWithinAt) + (B := fun x => g x + δ + ε * (x - a)) + (B' := fun x => g' x + ε) + · simpa using ha + · exact (hgcont.add continuousOn_const).add + (continuousOn_const.mul (continuousOn_id.sub continuousOn_const)) + · intro x hx + convert! (((hg x ⟨hx.1, hx.2.le⟩).add_const δ).add + (((hasDerivAt_id x).sub_const a).const_mul ε)).hasDerivWithinAt using 1 + simp + · intro x hx heq + have hnonneg : 0 ≤ ε * (x - a) := mul_nonneg hε.le (sub_nonneg.mpr hx.1) + have hgf : g x ≤ f x := by rw [heq]; linarith + have hd := hderiv x hx hgf + linarith + · exact ht + intro t ht + have hc : ContinuousWithinAt (fun ε : ℝ => g t + δ + ε * (t - a)) (Ioi 0) 0 := by + fun_prop + convert continuousWithinAt_const.closure_le _ hc (hpert t ht) using 1 <;> simp + +theorem le_of_deriv_le_on_above + {f g f' g' : ℝ → ℝ} {a b : ℝ} + (hf : ∀ t ∈ Icc a b, HasDerivAt f (f' t) t) + (hg : ∀ t ∈ Icc a b, HasDerivAt g (g' t) t) + (hderiv : ∀ t ∈ Ico a b, g t ≤ f t → f' t ≤ g' t) + (ha : f a ≤ g a) : ∀ t ∈ Icc a b, f t ≤ g t := by + simpa only [add_zero] using + le_add_initial_gap_of_deriv_le_on_above hf hg hderiv (δ := 0) le_rfl (by simpa using ha) + +theorem le_of_deriv_le_on_above_of_tendsto + {f g f' g' : ℝ → ℝ} {l : ℝ} + (hf : ∀ t, 0 < t → HasDerivAt f (f' t) t) + (hg : ∀ t, 0 < t → HasDerivAt g (g' t) t) + (hderiv : ∀ t, 0 < t → g t ≤ f t → f' t ≤ g' t) + (hf0 : Tendsto f (𝓝[>] 0) (𝓝 l)) + (hg0 : Tendsto g (𝓝[>] 0) (𝓝 l)) : + ∀ t, 0 < t → f t ≤ g t := by + intro t ht + have hlim : Tendsto (fun a => g t + max (f a - g a) 0) (𝓝[>] 0) (𝓝 (g t)) := by + convert tendsto_const_nhds.add ((hf0.sub hg0).max tendsto_const_nhds) using 1 + simp + apply le_of_tendsto_of_tendsto tendsto_const_nhds hlim + filter_upwards [Ioo_mem_nhdsGT ht] with a ha + apply le_add_initial_gap_of_deriv_le_on_above + (fun x hx => hf x (ha.1.trans_le hx.1)) + (fun x hx => hg x (ha.1.trans_le hx.1)) + (fun x hx => hderiv x (ha.1.trans_le hx.1)) + (le_max_right (f a - g a) 0) + · have hgmax := le_max_left (f a - g a) 0 + linarith + · exact ⟨ha.2.le, le_rfl⟩ + +def comparisonKernel (s : ℝ) : ℝ := 1 / (s ^ 2 * Real.artanh s) + +def comparisonV (u : ℝ) : ℝ := + 2 * u * Real.artanh u * ∫ s in u..1, comparisonKernel s + +def comparisonVTime (t : ℝ) : ℝ := comparisonV (Real.exp (-t)) + +theorem measurable_comparisonKernel : Measurable comparisonKernel := by + unfold comparisonKernel Real.artanh + fun_prop + +theorem comparisonKernel_nonneg {s : ℝ} (hs : 0 ≤ s) : 0 ≤ comparisonKernel s := by + exact one_div_nonneg.mpr (mul_nonneg (sq_nonneg s) (Real.artanh_nonneg hs)) + +@[simp] theorem comparisonKernel_one : comparisonKernel 1 = 0 := by + norm_num [comparisonKernel, Real.artanh] + +theorem comparisonKernel_le {u s : ℝ} (hu : 0 < u) (hu1 : u < 1) + (hus : u ≤ s) (hs1 : s ≤ 1) : comparisonKernel s ≤ comparisonKernel u := by + by_cases hs : s = 1 + · subst s + simpa using comparisonKernel_nonneg hu.le + · have hslt : s < 1 := lt_of_le_of_ne hs1 hs + apply one_div_le_one_div_of_le + (mul_pos (sq_pos_of_pos hu) (Real.artanh_pos ⟨hu, hu1⟩)) + exact mul_le_mul (sq_le_sq₀ hu.le (hu.le.trans hus) |>.mpr hus) + (Real.artanh_le_artanh (by linarith) hslt hus) + (Real.artanh_nonneg hu.le) (sq_nonneg s) + +theorem intervalIntegrable_comparisonKernel {u : ℝ} (hu : 0 < u) (hu1 : u < 1) : + IntervalIntegrable comparisonKernel volume u 1 := by + apply (intervalIntegrable_const (c := comparisonKernel u)).mono_fun' + measurable_comparisonKernel.aestronglyMeasurable + rw [uIoc_of_le hu1.le] + filter_upwards [ae_restrict_mem measurableSet_Ioc] with s hs + rw [Real.norm_eq_abs, abs_of_nonneg (comparisonKernel_nonneg (hu.le.trans hs.1.le))] + exact comparisonKernel_le hu hu1 hs.1.le hs.2 + +theorem continuousAt_comparisonKernel {u : ℝ} (hu : 0 < u) (hu1 : u < 1) : + ContinuousAt comparisonKernel u := by + exact continuousAt_const.div + ((continuousAt_id.pow 2).mul (hasDerivAt_artanh ⟨by linarith, hu1⟩).continuousAt) + (mul_ne_zero (pow_ne_zero 2 hu.ne') (ne_of_gt (Real.artanh_pos ⟨hu, hu1⟩))) + +theorem comparisonV_nonneg {u : ℝ} (hu : 0 ≤ u) (hu1 : u ≤ 1) : + 0 ≤ comparisonV u := by + apply mul_nonneg + · exact mul_nonneg (mul_nonneg (by norm_num) hu) (Real.artanh_nonneg hu) + · exact intervalIntegral.integral_nonneg hu1 fun s hs => + comparisonKernel_nonneg (hu.trans hs.1) + +theorem comparisonV_le_endpoint_bound {u : ℝ} (hu : 0 < u) (hu1 : u < 1) : + comparisonV u ≤ 2 * (1 - u) / u := by + have hI : (∫ s in u..1, comparisonKernel s) ≤ (1 - u) * comparisonKernel u := by + calc + _ ≤ ∫ _s in u..1, comparisonKernel u := + intervalIntegral.integral_mono_on hu1.le (intervalIntegrable_comparisonKernel hu hu1) + intervalIntegrable_const (fun s hs => comparisonKernel_le hu hu1 hs.1 hs.2) + _ = _ := by simp + unfold comparisonV + calc + _ ≤ 2 * u * Real.artanh u * ((1 - u) * comparisonKernel u) := + mul_le_mul_of_nonneg_left hI + (mul_nonneg (mul_nonneg (by norm_num) hu.le) (Real.artanh_nonneg hu.le)) + _ = 2 * (1 - u) / u := by + unfold comparisonKernel + field_simp [hu.ne', (Real.artanh_pos ⟨hu, hu1⟩).ne'] + +theorem tendsto_comparisonVTime_zero : + Tendsto comparisonVTime (𝓝[>] 0) (𝓝 0) := by + have hu : Tendsto (fun t : ℝ => Real.exp (-t)) (𝓝[>] 0) (𝓝 1) := by + have h : Continuous (fun t : ℝ => Real.exp (-t)) := by fun_prop + simpa using (h.continuousAt (x := 0)).tendsto.mono_left nhdsWithin_le_nhds + have hbound : Tendsto (fun t : ℝ => 2 * (1 - Real.exp (-t)) / Real.exp (-t)) + (𝓝[>] 0) (𝓝 0) := by + convert (tendsto_const_nhds.mul (tendsto_const_nhds.sub hu)).div hu (by norm_num) using 1 + norm_num + apply squeeze_zero' _ _ hbound + · filter_upwards [self_mem_nhdsWithin] with t ht + change 0 < t at ht + exact comparisonV_nonneg (Real.exp_pos _).le (le_of_lt (Real.exp_lt_one_iff.mpr (by linarith))) + · filter_upwards [self_mem_nhdsWithin] with t ht + change 0 < t at ht + exact comparisonV_le_endpoint_bound (Real.exp_pos _) (Real.exp_lt_one_iff.mpr (by linarith)) + +theorem hasDerivAt_comparisonV {u : ℝ} (hu : 0 < u) (hu1 : u < 1) : + HasDerivAt comparisonV + (2 * (Real.artanh u + u / (1 - u ^ 2)) * + (∫ s in u..1, comparisonKernel s) - 2 / u) u := by + have hI := intervalIntegral.integral_hasDerivAt_left + (intervalIntegrable_comparisonKernel hu hu1) + measurable_comparisonKernel.stronglyMeasurable.stronglyMeasurableAtFilter + (continuousAt_comparisonKernel hu hu1) + have hprod := (((hasDerivAt_id u).const_mul 2).mul + (hasDerivAt_artanh ⟨by linarith, hu1⟩)).mul hI + convert! hprod using 1 + simp only [id_eq, Pi.mul_apply] + unfold comparisonKernel + field_simp [hu.ne', (Real.artanh_pos ⟨hu, hu1⟩).ne'] + ring + +theorem hasDerivAt_comparisonVTime {t : ℝ} (ht : 0 < t) : + let u := Real.exp (-t) + HasDerivAt comparisonVTime + (2 - (1 + u / ((1 - u ^ 2) * Real.artanh u)) * comparisonVTime t) t := by + dsimp only + have hu := Real.exp_pos (-t) + have hu1 : Real.exp (-t) < 1 := Real.exp_lt_one_iff.mpr (by linarith) + have hderiv := (hasDerivAt_comparisonV hu hu1).comp t (hasDerivAt_id t).neg.exp + convert! hderiv using 1 + simp only [id_eq, Pi.neg_apply] + unfold comparisonVTime comparisonV + have hden : 1 - Real.exp (-t) ^ 2 ≠ 0 := by nlinarith + field_simp [hu.ne', (Real.artanh_pos ⟨hu, hu1⟩).ne', hden] + ring + +private theorem sq_lt_one_of_mem {u : ℝ} (hu : u ∈ Ioo (-1) 1) : u ^ 2 < 1 := by + have hp : 0 < (1 - u) * (u + 1) := mul_pos (by linarith [hu.2]) (by linarith [hu.1]) + nlinarith + +private theorem hasDerivAt_artanh_cubic_gap {u : ℝ} (hu : u ∈ Ioo (-1) 1) : + HasDerivAt (fun x : ℝ => Real.artanh x - x - x ^ 3 / 3) + (u ^ 4 / (1 - u ^ 2)) u := by + have hden : 1 - u ^ 2 ≠ 0 := ne_of_gt (sub_pos.mpr (sq_lt_one_of_mem hu)) + convert! ((hasDerivAt_artanh hu).sub (hasDerivAt_id u)).sub + (((hasDerivAt_id u).pow 3).div_const 3) using 1 + simp only [id_eq] + field_simp [hden] + ring + +theorem artanh_cubic_lower {u : ℝ} (hu : 0 ≤ u) (hu1 : u < 1) : + u + u ^ 3 / 3 ≤ Real.artanh u := by + have hm : MonotoneOn (fun x : ℝ => Real.artanh x - x - x ^ 3 / 3) (Ico 0 1) := by + apply monotoneOn_of_hasDerivWithinAt_nonneg (convex_Ico 0 1) + · intro x hx + exact (hasDerivAt_artanh_cubic_gap ⟨by linarith [hx.1], hx.2⟩).continuousAt.continuousWithinAt + · intro x hx + have hx' : x ∈ Ico (0 : ℝ) 1 := interior_subset hx + exact (hasDerivAt_artanh_cubic_gap ⟨by linarith [hx'.1], hx'.2⟩).hasDerivWithinAt + · intro x hx + have hx' : x ∈ Ico (0 : ℝ) 1 := interior_subset hx + exact div_nonneg (by positivity) + (sub_nonneg.mpr (le_of_lt (sq_lt_one_of_mem ⟨by linarith [hx'.1], hx'.2⟩))) + have h := hm (show (0 : ℝ) ∈ Ico 0 1 by norm_num) ⟨hu, hu1⟩ hu + simp only [Real.artanh_zero, sub_zero] at h + linarith + +def rationalArtanhGap (u : ℝ) : ℝ := u / (1 - u ^ 2 / 2) - Real.artanh u + +theorem hasDerivAt_rationalArtanhGap {u : ℝ} (hu : u ∈ Ioo (-1) 1) : + HasDerivAt rationalArtanhGap + (u ^ 2 * (2 - 3 * u ^ 2) / ((2 - u ^ 2) ^ 2 * (1 - u ^ 2))) u := by + have hsq := sq_lt_one_of_mem hu + have hden : 1 - u ^ 2 / 2 ≠ 0 := by nlinarith + have hden' : 1 - u ^ 2 ≠ 0 := by nlinarith + have hden'' : 2 - u ^ 2 ≠ 0 := by nlinarith + have hd := ((hasDerivAt_id u).div + ((hasDerivAt_const u 1).sub (((hasDerivAt_id u).pow 2).div_const 2)) hden).sub + (hasDerivAt_artanh hu) + convert! hd using 1 + simp only [id_eq, Pi.sub_apply, Pi.pow_apply] + field_simp [hden, hden', hden''] + ring + +theorem artanh_le_rational {u : ℝ} (hu : 0 ≤ u) (hu9 : u ≤ 9 / 10) : + Real.artanh u ≤ u / (1 - u ^ 2 / 2) := by + let c : ℝ := Real.sqrt (2 / 3) + have hc0 : 0 ≤ c := Real.sqrt_nonneg _ + have hcsq : c ^ 2 = 2 / 3 := Real.sq_sqrt (by norm_num) + have hc9 : c < 9 / 10 := by nlinarith + have hdenpos : ∀ x ∈ Icc (0 : ℝ) (9 / 10), + 0 < (2 - x ^ 2) ^ 2 * (1 - x ^ 2) := by + intro x hx + have hsq : x ^ 2 < 1 := sq_lt_one_of_mem ⟨by linarith [hx.1], by linarith [hx.2]⟩ + exact mul_pos (sq_pos_of_pos (by linarith)) (by linarith) + have hleft : MonotoneOn rationalArtanhGap (Icc 0 c) := by + apply monotoneOn_of_hasDerivWithinAt_nonneg (convex_Icc 0 c) + · intro x hx + exact (hasDerivAt_rationalArtanhGap ⟨by linarith [hx.1], by linarith [hx.2]⟩).continuousAt.continuousWithinAt + · intro x hx + have hx' : x ∈ Icc (0 : ℝ) c := interior_subset hx + exact (hasDerivAt_rationalArtanhGap ⟨by linarith [hx'.1], by linarith [hx'.2]⟩).hasDerivWithinAt + · intro x hx + have hx' : x ∈ Icc (0 : ℝ) c := interior_subset hx + have hsq : x ^ 2 ≤ c ^ 2 := (sq_le_sq₀ hx'.1 hc0).mpr hx'.2 + exact div_nonneg (mul_nonneg (sq_nonneg _) (by nlinarith)) + (hdenpos x ⟨hx'.1, hx'.2.trans hc9.le⟩).le + have hright : AntitoneOn rationalArtanhGap (Icc c (9 / 10)) := by + apply antitoneOn_of_hasDerivWithinAt_nonpos (convex_Icc c (9 / 10)) + · intro x hx + exact (hasDerivAt_rationalArtanhGap ⟨by linarith [hx.1], by linarith [hx.2]⟩).continuousAt.continuousWithinAt + · intro x hx + have hx' : x ∈ Icc c (9 / 10 : ℝ) := interior_subset hx + exact (hasDerivAt_rationalArtanhGap ⟨by linarith [hx'.1], by linarith [hx'.2]⟩).hasDerivWithinAt + · intro x hx + have hx' : x ∈ Icc c (9 / 10 : ℝ) := interior_subset hx + have hx0 : 0 ≤ x := hc0.trans hx'.1 + have hsq : c ^ 2 ≤ x ^ 2 := (sq_le_sq₀ hc0 hx0).mpr hx'.1 + exact div_nonpos_of_nonpos_of_nonneg (mul_nonpos_of_nonneg_of_nonpos (sq_nonneg _) (by nlinarith)) + (hdenpos x ⟨hx0, hx'.2⟩).le + have hend : 0 ≤ rationalArtanhGap (9 / 10) := by + have ha : Real.artanh (9 / 10) = Real.log 19 / 2 := by + rw [Real.artanh_eq_half_log (by norm_num)] + norm_num + ring + unfold rationalArtanhGap + rw [ha] + norm_num + linarith [log_nineteen_lt_three] + have hgap : 0 ≤ rationalArtanhGap u := by + by_cases huc : u ≤ c + · have h := hleft ⟨le_rfl, hc0⟩ ⟨hu, huc⟩ hu + simpa [rationalArtanhGap] using h + · exact hend.trans (hright ⟨le_of_not_ge huc, hu9⟩ ⟨hc9.le, le_rfl⟩ hu9) + exact sub_nonneg.mp hgap + +def comparisonModelKernel (s : ℝ) : ℝ := (1 - s ^ 2 / 2) / s ^ 3 + +def comparisonPrimitive (s : ℝ) : ℝ := -(1 / (2 * s ^ 2)) - Real.log s / 2 + +theorem comparisonModelKernel_le {s : ℝ} (hs : 0 < s) (hs9 : s ≤ 9 / 10) : + comparisonModelKernel s ≤ comparisonKernel s := by + have hs1 : s < 1 := by linarith + have hsq := sq_lt_one_of_mem (show s ∈ Ioo (-1) 1 from ⟨by linarith, hs1⟩) + have hnum : 0 < 1 - s ^ 2 / 2 := by linarith + have ha := (le_div_iff₀ hnum).mp (artanh_le_rational hs.le hs9) + have hmul := mul_le_mul_of_nonneg_left ha (sq_nonneg s) + unfold comparisonModelKernel comparisonKernel + apply (div_le_div_iff₀ (pow_pos hs 3) + (mul_pos (sq_pos_of_pos hs) (Real.artanh_pos ⟨hs, hs1⟩))).mpr + nlinarith + +theorem hasDerivAt_comparisonPrimitive {s : ℝ} (hs : 0 < s) : + HasDerivAt comparisonPrimitive (comparisonModelKernel s) s := by + have hden : 2 * s ^ 2 ≠ 0 := by positivity + have hd := (((hasDerivAt_const s 1).div + (((hasDerivAt_id s).pow 2).const_mul 2) hden).neg).sub + ((Real.hasDerivAt_log hs.ne').div_const 2) + convert! hd using 1 + simp only [id_eq, Pi.pow_apply] + unfold comparisonModelKernel + field_simp [hs.ne'] + ring + +theorem continuousAt_comparisonModelKernel {s : ℝ} (hs : 0 < s) : + ContinuousAt comparisonModelKernel s := by + unfold comparisonModelKernel + fun_prop (disch := positivity) + +theorem integral_comparisonModelKernel {u : ℝ} (hu : 0 < u) (hu9 : u ≤ 9 / 10) : + (∫ s in u..(9 / 10), comparisonModelKernel s) = + (1 - u ^ 2 * comparisonC u) / (2 * u ^ 2) := by + have hpos : ∀ s ∈ uIcc u (9 / 10), 0 < s := by + intro s hs + rw [uIcc_of_le hu9] at hs + exact hu.trans_le hs.1 + have hint : IntervalIntegrable comparisonModelKernel volume u (9 / 10) := + ContinuousOn.intervalIntegrable + (fun s hs => (continuousAt_comparisonModelKernel (hpos s hs)).continuousWithinAt) + rw [intervalIntegral.integral_eq_sub_of_hasDerivAt + (fun s hs => hasDerivAt_comparisonPrimitive (hpos s hs)) hint] + unfold comparisonPrimitive comparisonC + norm_num + field_simp [hu.ne'] + ring + +theorem comparisonV_lower {u : ℝ} (hu : 0 < u) (hu9 : u ≤ 9 / 10) : + Real.artanh u / u * (1 - u ^ 2 * comparisonC u) ≤ comparisonV u := by + have hu1 : u < 1 := by linarith + have hkernel := intervalIntegrable_comparisonKernel hu hu1 + have hkernel9 : IntervalIntegrable comparisonKernel volume u (9 / 10) := by + apply hkernel.mono_set + rw [uIcc_of_le hu9, uIcc_of_le hu1.le] + exact Icc_subset_Icc le_rfl (by norm_num) + have hmodel : IntervalIntegrable comparisonModelKernel volume u (9 / 10) := by + apply ContinuousOn.intervalIntegrable + intro s hs + rw [uIcc_of_le hu9] at hs + exact (continuousAt_comparisonModelKernel (hu.trans_le hs.1)).continuousWithinAt + have hpos : 0 ≤ᵐ[volume.restrict (Ioc u 1)] comparisonKernel := by + filter_upwards [ae_restrict_mem measurableSet_Ioc] with s hs + exact comparisonKernel_nonneg (hu.le.trans hs.1.le) + have hI : (1 - u ^ 2 * comparisonC u) / (2 * u ^ 2) ≤ + ∫ s in u..1, comparisonKernel s := by + rw [← integral_comparisonModelKernel hu hu9] + calc + _ ≤ ∫ s in u..(9 / 10), comparisonKernel s := + intervalIntegral.integral_mono_on hu9 hmodel hkernel9 + (fun s hs => comparisonModelKernel_le (hu.trans_le hs.1) hs.2) + _ ≤ ∫ s in u..1, comparisonKernel s := + intervalIntegral.integral_mono_interval le_rfl hu9 (by norm_num) hpos hkernel + have hm := mul_le_mul_of_nonneg_left hI + (mul_nonneg (mul_nonneg (by norm_num : (0 : ℝ) ≤ 2) hu.le) + (Real.artanh_nonneg hu.le)) + convert! hm using 1 + field_simp [hu.ne'] + +theorem one_sub_comparisonV_le {u : ℝ} (hu0 : 1 / 5 ≤ u) (hu1 : u ≤ 5 / 8) : + 1 - comparisonV u ≤ 5 / 2 * u ^ 2 := by + have hu : 0 < u := by linarith + have hu9 : u ≤ 9 / 10 := by linarith + have hcubic := artanh_cubic_lower hu.le (show u < 1 by linarith) + have hratio : 1 + u ^ 2 / 3 ≤ Real.artanh u / u := by + apply (le_div_iff₀ hu).mpr + nlinarith + have hprod := mul_le_mul_of_nonneg_right hratio + (comparisonC_integral_bracket_nonneg hu hu9) + have hlow := comparisonV_lower hu hu9 + have hQ := mul_le_mul_of_nonneg_left (comparisonC_middle_bound hu0 hu1) (sq_nonneg u) + nlinarith + +def comparisonBias (m : ℝ) : ℝ := m ^ 2 * ell - psi m + +theorem comparisonBias_eq (m : ℝ) : + entropy m = (1 - m ^ 2) * ell + comparisonBias m := by + unfold comparisonBias entropy + ring + +theorem comparisonBias_bounds {m : ℝ} (hm : |m| ≤ 1) : + 0 ≤ comparisonBias m ∧ comparisonBias m ≤ m ^ 2 * (ell - 1 / 2) := by + have hlow := half_sq_le_psi hm + have hupp := psi_le_ell_mul_sq hm + unfold comparisonBias + constructor <;> nlinarith + +def comparisonLower (A B t : ℝ) : ℝ := + A * entropy (Real.exp (-t)) + B * comparisonVTime t + +theorem hasDerivAt_entropy_exp_neg {t : ℝ} (ht : 0 < t) : + HasDerivAt (fun z : ℝ => entropy (Real.exp (-z))) + (Real.exp (-t) * Real.artanh (Real.exp (-t))) t := by + have hu := Real.exp_pos (-t) + have hu1 : Real.exp (-t) < 1 := Real.exp_lt_one_iff.mpr (by linarith) + convert! (hasDerivAt_entropy ⟨by linarith, hu1⟩).comp t (hasDerivAt_id t).neg.exp using 1 + simp only [id_eq, Pi.neg_apply] + ring + +theorem hasDerivAt_comparisonLower (A B : ℝ) {t : ℝ} (ht : 0 < t) : + HasDerivAt (comparisonLower A B) + (A * r (psi (Real.exp (-t))) + + B * (2 - rDeriv (psi (Real.exp (-t))) * comparisonVTime t)) t := by + have hu := Real.exp_pos (-t) + have hu1 : Real.exp (-t) < 1 := Real.exp_lt_one_iff.mpr (by linarith) + rw [r_psi ⟨by linarith, hu1⟩, rDeriv_psi ⟨hu, hu1⟩] + exact + ((hasDerivAt_entropy_exp_neg ht).const_mul A).add ((hasDerivAt_comparisonVTime ht).const_mul B) + +theorem comparisonLower_pos {A B t : ℝ} (hA : 0 < A) (hB : 0 ≤ B) (ht : 0 < t) : + 0 < comparisonLower A B t := by + have hu := Real.exp_pos (-t) + have hu1 : Real.exp (-t) < 1 := Real.exp_lt_one_iff.mpr (by linarith) + exact add_pos_of_pos_of_nonneg + (mul_pos hA (entropy_pos ⟨by linarith, hu1⟩)) + (mul_nonneg hB (comparisonV_nonneg hu.le hu1.le)) + +theorem tendsto_comparisonLower_zero (A B : ℝ) : + Tendsto (comparisonLower A B) (𝓝[>] 0) (𝓝 0) := by + have hu : Tendsto (fun t : ℝ => Real.exp (-t)) (𝓝[>] 0) (𝓝 1) := by + have h : Continuous (fun t : ℝ => Real.exp (-t)) := by fun_prop + simpa using (h.continuousAt (x := 0)).tendsto.mono_left nhdsWithin_le_nhds + have hh : Tendsto (fun t : ℝ => entropy (Real.exp (-t))) (𝓝[>] 0) (𝓝 0) := by + convert! (continuous_entropy.tendsto 1).comp hu using 1 + simp + convert! (tendsto_const_nhds.mul hh).add + (tendsto_const_nhds.mul tendsto_comparisonVTime_zero) using 1 + simp + +theorem comparisonLower_subsolution + (hLsupport : ∀ x, 0 < x → ∀ y, 0 < y → L x + LDeriv x * (y - x) ≤ L y) + {A B H t : ℝ} (hA : 0 < A) (hB : 0 ≤ B) (hH : H = A * ell + B) (ht : 0 < t) : + A * r (psi (Real.exp (-t))) + + B * (2 - rDeriv (psi (Real.exp (-t))) * comparisonVTime t) ≤ + 2 * (H - comparisonLower A B t) + A * L (comparisonLower A B t / A) := by + have hu := Real.exp_pos (-t) + have hu1 : Real.exp (-t) < 1 := Real.exp_lt_one_iff.mpr (by linarith) + have hHu : 0 < entropy (Real.exp (-t)) := entropy_pos ⟨by linarith, hu1⟩ + have hlowpos := comparisonLower_pos hA hB ht + have htangent := hLsupport _ hHu _ (div_pos hlowpos hA) + have hscaled : A * L (entropy (Real.exp (-t))) + + LDeriv (entropy (Real.exp (-t))) * (B * comparisonVTime t) ≤ + A * L (comparisonLower A B t / A) := by + calc + _ = A * (L (entropy (Real.exp (-t))) + + LDeriv (entropy (Real.exp (-t))) * + (comparisonLower A B t / A - entropy (Real.exp (-t)))) := by + unfold comparisonLower + field_simp [hA.ne'] + ring + _ ≤ _ := mul_le_mul_of_nonneg_left htangent hA.le + rw [L_entropy ⟨by linarith, hu1⟩, LDeriv_entropy ⟨hu, hu1⟩] at hscaled + rw [hH] + unfold comparisonLower entropy at hscaled ⊢ + nlinarith [hscaled] + +theorem comparison_rhs_antitone (hLmono : AntitoneOn L (Ioi 0)) + {A : ℝ} (hA : 0 < A) (H : ℝ) : + AntitoneOn (fun x => 2 * (H - x) + A * L (x / A)) (Ioi 0) := by + intro x hx y hy hxy + have hL := hLmono (div_pos hx hA) (div_pos hy hA) ((div_le_div_iff_of_pos_right hA).mpr hxy) + exact add_le_add (by linarith) (mul_le_mul_of_nonneg_left hL hA.le) + +theorem comparisonLower_le_of_differential_inequality + (hLmono : AntitoneOn L (Ioi 0)) + (hLsupport : ∀ x, 0 < x → ∀ y, 0 < y → L x + LDeriv x * (y - x) ≤ L y) + {A B H : ℝ} (hA : 0 < A) (hB : 0 ≤ B) (hH : H = A * ell + B) + (h h' : ℝ → ℝ) (hpos : ∀ t, 0 < t → 0 < h t) + (hderiv : ∀ t, 0 < t → HasDerivAt h (h' t) t) + (hdiff : ∀ t, 0 < t → 2 * (H - h t) + A * L (h t / A) ≤ h' t) + (hinit : Tendsto h (𝓝[>] 0) (𝓝 0)) : + ∀ t, 0 < t → comparisonLower A B t ≤ h t := by + apply le_of_deriv_le_on_above_of_tendsto + (fun t ht => hasDerivAt_comparisonLower A B ht) hderiv + _ (tendsto_comparisonLower_zero A B) hinit + intro t ht horder + exact (comparisonLower_subsolution hLsupport hA hB hH ht).trans + (((comparison_rhs_antitone hLmono hA H) (hpos t ht) + (comparisonLower_pos hA hB ht) horder).trans (hdiff t ht)) + +theorem hasDerivAt_psi_exp_neg {t : ℝ} (ht : 0 < t) : + HasDerivAt (fun z : ℝ => psi (Real.exp (-z))) + (-r (psi (Real.exp (-t)))) t := by + have hu := Real.exp_pos (-t) + have hu1 : Real.exp (-t) < 1 := Real.exp_lt_one_iff.mpr (by linarith) + rw [r_psi ⟨by linarith, hu1⟩] + convert! (hasDerivAt_psi ⟨by linarith, hu1⟩).comp t (hasDerivAt_id t).neg.exp using 1 + simp only [id_eq, Pi.neg_apply] + ring + +theorem small_information_comparison + (hrmono : MonotoneOn r (Ico 0 ell)) + (S S' : ℝ → ℝ) {t0 : ℝ} (ht0 : 0 < t0) + (hderiv : ∀ t, t0 ≤ t → HasDerivAt S (S' t) t) + (hrange : ∀ t, t0 ≤ t → S t ∈ Ico 0 ell) + (hdecay : ∀ t, t0 ≤ t → S' t ≤ -r (S t)) + (hstart : S t0 ≤ psi (Real.exp (-t0))) : + ∀ t, t0 ≤ t → S t ≤ psi (Real.exp (-t)) := by + intro t htt0 + refine le_of_deriv_le_on_above (a := t0) (b := t) + (fun z hz => hderiv z hz.1) + (fun z hz => hasDerivAt_psi_exp_neg (ht0.trans_le hz.1)) + ?_ hstart t ⟨htt0, le_rfl⟩ + intro z hz hcross + have hz0 : 0 < z := ht0.trans_le hz.1 + have hu := Real.exp_pos (-z) + have hu1 : Real.exp (-z) < 1 := Real.exp_lt_one_iff.mpr (by linarith) + have hpsi : psi (Real.exp (-z)) ∈ Ico 0 ell := + ⟨psi_nonneg _, psi_lt_ell ⟨by linarith, hu1⟩⟩ + exact (hdecay z hz.1).trans (neg_le_neg (hrmono hpsi (hrange z hz.1) hcross)) + +theorem noiseFlow_comparison_lower_from_dissipation + (hLmono : AntitoneOn L (Ioi 0)) + (hLsupport : ∀ x, 0 < x → ∀ y, 0 < y → L x + LDeriv x * (y - x) ≤ L y) + {n : ℕ} + (hmonoD : ∀ g : Cube n → ℝ, IsInterior g → IsIncreasing g → + 2 * informationDeficit g + meanVariance g * L (entropyAverage g / meanVariance g) ≤ + dissipation g) + (F : Cube n → ℝ) (hF : IsSignValued F) (hinc : IsIncreasing F) + (hnc : ∃ x y, F x ≠ F y) : + ∀ t, 0 < t → + comparisonLower (1 - (cubeAverage F) ^ 2) (comparisonBias (cubeAverage F)) t ≤ + entropyAverage (noiseFlow F t) := by + have hm : |cubeAverage F| ≤ 1 := + (abs_lt.mpr (cubeAverage_mem_Ioo_of_signValued_nonconstant hF hnc)).le + have hA : 0 < 1 - (cubeAverage F) ^ 2 := + meanVariance_pos_of_signValued_nonconstant hF hnc + apply comparisonLower_le_of_differential_inequality hLmono hLsupport hA + (comparisonBias_bounds hm).1 (comparisonBias_eq (cubeAverage F)) + (fun t => entropyAverage (noiseFlow F t)) (fun t => dissipation (noiseFlow F t)) + (fun t ht => entropyAverage_noiseFlow_pos F hF hnc ht) + (fun t ht => hasDerivAt_entropyAverage_noiseFlow F hF hnc ht) + _ (tendsto_entropyAverage_noiseFlow_zero_right F hF) + intro t ht + simpa only [informationDeficit, meanVariance, cubeAverage_noiseFlow] using + hmonoD (noiseFlow F t) (isInterior_noiseFlow F hF hnc ht) (isIncreasing_noiseFlow F hinc ht.le) + +theorem informationDeficit_noiseFlow_le_comparison_from_dissipation + (hLmono : AntitoneOn L (Ioi 0)) + (hLsupport : ∀ x, 0 < x → ∀ y, 0 < y → L x + LDeriv x * (y - x) ≤ L y) + {n : ℕ} + (hmonoD : ∀ g : Cube n → ℝ, IsInterior g → IsIncreasing g → + 2 * informationDeficit g + meanVariance g * L (entropyAverage g / meanVariance g) ≤ + dissipation g) + (F : Cube n → ℝ) (hF : IsSignValued F) (hinc : IsIncreasing F) + (hnc : ∃ x y, F x ≠ F y) {t : ℝ} (ht : 0 < t) : + informationDeficit (noiseFlow F t) ≤ + (1 - (cubeAverage F) ^ 2) * psi (Real.exp (-t)) + + comparisonBias (cubeAverage F) * (1 - comparisonVTime t) := by + have hlow := noiseFlow_comparison_lower_from_dissipation + hLmono hLsupport hmonoD F hF hinc hnc t ht + calc + informationDeficit (noiseFlow F t) = + entropy (cubeAverage F) - entropyAverage (noiseFlow F t) := by + simp only [informationDeficit, cubeAverage_noiseFlow] + _ ≤ entropy (cubeAverage F) - + comparisonLower (1 - (cubeAverage F) ^ 2) (comparisonBias (cubeAverage F)) t := + sub_le_sub_left hlow _ + _ = _ := by + rw [comparisonBias_eq (cubeAverage F)] + unfold comparisonLower entropy + ring + +theorem informationDeficit_noiseFlow_le_psi_large_from_dissipation + (hLmono : AntitoneOn L (Ioi 0)) + (hLsupport : ∀ x, 0 < x → ∀ y, 0 < y → L x + LDeriv x * (y - x) ≤ L y) + {n : ℕ} + (hmonoD : ∀ g : Cube n → ℝ, IsInterior g → IsIncreasing g → + 2 * informationDeficit g + meanVariance g * L (entropyAverage g / meanVariance g) ≤ + dissipation g) + (F : Cube n → ℝ) (hF : IsSignValued F) (hinc : IsIncreasing F) + (hnc : ∃ x y, F x ≠ F y) {t : ℝ} (ht : 0 < t) + (hu0 : 1 / 5 ≤ Real.exp (-t)) : + informationDeficit (noiseFlow F t) ≤ psi (Real.exp (-t)) := by + have hu := Real.exp_pos (-t) + have hu1 : Real.exp (-t) < 1 := Real.exp_lt_one_iff.mpr (by linarith) + have hm : |cubeAverage F| ≤ 1 := + (abs_lt.mpr (cubeAverage_mem_Ioo_of_signValued_nonconstant hF hnc)).le + have hB := comparisonBias_bounds hm + have hP := half_sq_le_psi (show |Real.exp (-t)| ≤ 1 by rw [abs_of_pos hu]; exact hu1.le) + have hS := informationDeficit_noiseFlow_le_comparison_from_dissipation + hLmono hLsupport hmonoD F hF hinc hnc ht + by_cases hlarge : 5 / 8 ≤ Real.exp (-t) + · exact comparison_large_regime (cubeAverage F) (Real.exp (-t)) + (comparisonBias (cubeAverage F)) (psi (Real.exp (-t))) + (informationDeficit (noiseFlow F t)) (comparisonVTime t) + hB.1 hB.2 hP hS hlarge (comparisonV_nonneg hu.le hu1.le) + · apply comparison_middle_regime (cubeAverage F) (Real.exp (-t)) + (comparisonBias (cubeAverage F)) (psi (Real.exp (-t))) + (informationDeficit (noiseFlow F t)) (comparisonVTime t) + hB.1 hB.2 hP hS + exact one_sub_comparisonV_le hu0 (le_of_not_ge hlarge) + +theorem dissipation_nonneg {n : ℕ} (g : Cube n → ℝ) (hg : IsInterior g) : + 0 ≤ dissipation g := by + induction n with + | zero => simp [dissipation] + | succ n ih => + rw [dissipation_split] + exact add_nonneg + (div_nonneg (add_nonneg (ih _ (hg.restrict true)) (ih _ (hg.restrict false))) + (by norm_num)) + (cubeAverage_nonneg fun x => pairDissipation_nonneg _ _ (hg.pairDomain x)) + +theorem antitone_informationDeficit_noiseFlow {n : ℕ} + (F : Cube n → ℝ) (hF : IsSignValued F) (hnc : ∃ x y, F x ≠ F y) : + AntitoneOn (fun t => informationDeficit (noiseFlow F t)) (Ioi 0) := by + apply antitoneOn_of_hasDerivWithinAt_nonpos (convex_Ioi 0) + (continuous_informationDeficit_noiseFlow F).continuousOn + · intro t ht + have ht' : 0 < t := interior_subset ht + exact (hasDerivAt_informationDeficit_noiseFlow F hF hnc ht').hasDerivWithinAt + · intro t ht + have ht' : 0 < t := interior_subset ht + exact neg_nonpos.mpr (dissipation_nonneg _ (isInterior_noiseFlow F hF hnc ht')) + +private theorem exp_neg_log_five : Real.exp (-Real.log 5) = (1 / 5 : ℝ) := by + rw [Real.exp_neg, Real.exp_log (by norm_num)] + norm_num + +theorem informationDeficit_noiseFlow_le_psi_from_dissipation + (hLmono : AntitoneOn L (Ioi 0)) + (hLsupport : ∀ x, 0 < x → ∀ y, 0 < y → L x + LDeriv x * (y - x) ≤ L y) + (hrmono : MonotoneOn r (Ico 0 ell)) + {n : ℕ} + (hmonoD : ∀ g : Cube n → ℝ, IsInterior g → IsIncreasing g → + 2 * informationDeficit g + meanVariance g * L (entropyAverage g / meanVariance g) ≤ + dissipation g) + (hsmallD : ∀ g : Cube n → ℝ, IsInterior g → informationDeficit g ≤ s0 → + r (informationDeficit g) ≤ dissipation g) + (F : Cube n → ℝ) (hF : IsSignValued F) (hinc : IsIncreasing F) + (hnc : ∃ x y, F x ≠ F y) {t : ℝ} (ht : 0 < t) : + informationDeficit (noiseFlow F t) ≤ psi (Real.exp (-t)) := by + have hlarge (z : ℝ) (hz : 0 < z) (huz : 1 / 5 ≤ Real.exp (-z)) : + informationDeficit (noiseFlow F z) ≤ psi (Real.exp (-z)) := + informationDeficit_noiseFlow_le_psi_large_from_dissipation + hLmono hLsupport hmonoD F hF hinc hnc hz huz + by_cases hu0 : 1 / 5 ≤ Real.exp (-t) + · exact hlarge t ht hu0 + · have ht0 : 0 < Real.log 5 := Real.log_pos (by norm_num) + have hstart : informationDeficit (noiseFlow F (Real.log 5)) ≤ psi (Real.exp (-Real.log 5)) := + hlarge (Real.log 5) ht0 (by rw [exp_neg_log_five]) + have hstart0 : informationDeficit (noiseFlow F (Real.log 5)) ≤ s0 := by + simpa only [exp_neg_log_five, s0] using hstart + have hSsmall : ∀ z, Real.log 5 ≤ z → informationDeficit (noiseFlow F z) ≤ s0 := by + intro z hz + exact ((antitone_informationDeficit_noiseFlow F hF hnc) ht0 (ht0.trans_le hz) hz).trans hstart0 + have hSrange : ∀ z, Real.log 5 ≤ z → informationDeficit (noiseFlow F z) ∈ Ico 0 ell := by + intro z hz + refine ⟨informationDeficit_nonneg (isInterior_noiseFlow F hF hnc (ht0.trans_le hz)), ?_⟩ + exact (hSsmall z hz).trans_lt (psi_lt_ell (by norm_num : (1 / 5 : ℝ) ∈ Ioo (-1) 1)) + have hbound := small_information_comparison hrmono + (fun z => informationDeficit (noiseFlow F z)) (fun z => -dissipation (noiseFlow F z)) ht0 + (fun z hz => hasDerivAt_informationDeficit_noiseFlow F hF hnc (ht0.trans_le hz)) + hSrange + (fun z hz => neg_le_neg (hsmallD _ (isInterior_noiseFlow F hF hnc (ht0.trans_le hz)) + (hSsmall z hz))) hstart + apply hbound t + have hcomp : Real.exp (-t) ≤ Real.exp (-Real.log 5) := by + rw [exp_neg_log_five] + exact le_of_not_ge hu0 + have hcomp' := Real.exp_le_exp.mp hcomp + linarith + +theorem informationDeficit_noise_le_psi_from_dissipation + (hLmono : AntitoneOn L (Ioi 0)) + (hLsupport : ∀ x, 0 < x → ∀ y, 0 < y → L x + LDeriv x * (y - x) ≤ L y) + (hrmono : MonotoneOn r (Ico 0 ell)) + {n : ℕ} + (hmonoD : ∀ g : Cube n → ℝ, IsInterior g → IsIncreasing g → + 2 * informationDeficit g + meanVariance g * L (entropyAverage g / meanVariance g) ≤ + dissipation g) + (hsmallD : ∀ g : Cube n → ℝ, IsInterior g → informationDeficit g ≤ s0 → + r (informationDeficit g) ≤ dissipation g) + (F : Cube n → ℝ) (hF : IsSignValued F) (hinc : IsIncreasing F) + (hnc : ∃ x y, F x ≠ F y) (u : ℝ) (hu0 : 0 < u) (hu1 : u < 1) : + informationDeficit (noiseOperator u F) ≤ psi u := by + have ht : 0 < -Real.log u := neg_pos.mpr (Real.log_neg hu0 hu1) + simpa only [noiseFlow, neg_neg, Real.exp_log hu0] using + informationDeficit_noiseFlow_le_psi_from_dissipation hLmono hLsupport hrmono hmonoD hsmallD + F hF hinc hnc ht + +theorem informationDeficit_noise_le_psi_from_sharp_dissipation + {n : ℕ} + (hmonoD : ∀ g : Cube n → ℝ, IsInterior g → IsIncreasing g → + 2 * informationDeficit g + meanVariance g * L (entropyAverage g / meanVariance g) ≤ + dissipation g) + (hsmallD : ∀ g : Cube n → ℝ, IsInterior g → informationDeficit g ≤ s0 → + r (informationDeficit g) ≤ dissipation g) + (F : Cube n → ℝ) (hF : IsSignValued F) (hinc : IsIncreasing F) + (hnc : ∃ x y, F x ≠ F y) (u : ℝ) (hu0 : 0 < u) (hu1 : u < 1) : + informationDeficit (noiseOperator u F) ≤ psi u := by + have hrmono : MonotoneOn r (Ico 0 ell) := by + intro x hx y hy hxy + have hgap := monotoneOn_rGap hx hy hxy + unfold rGap at hgap + linarith + exact informationDeficit_noise_le_psi_from_dissipation + antitoneOn_L L_support hrmono hmonoD hsmallD F hF hinc hnc u hu0 hu1 + +theorem informationDeficit_noise_le_psi_of_increasing + {n : ℕ} (F : Cube n → ℝ) (hF : IsSignValued F) (hinc : IsIncreasing F) + (hnc : ∃ x y, F x ≠ F y) (u : ℝ) (hu0 : 0 < u) (hu1 : u < 1) : + informationDeficit (noiseOperator u F) ≤ psi u := + informationDeficit_noise_le_psi_from_sharp_dissipation + (fun g hg hmono => monotone_dissipation g hg hmono) + (fun g hg hS => small_information_dissipation g hg hS) + F hF hinc hnc u hu0 hu1 + +end LeanBlast.CourtadeKumar + +end + +end OAI diff --git a/lean/OAI/InformationTheory/BooleanNoise/ComparisonEstimates.lean b/lean/OAI/InformationTheory/BooleanNoise/ComparisonEstimates.lean new file mode 100644 index 0000000000000000000000000000000000000000..3fc1c3493c1213fc5b543287ced95276f30a9f82 --- /dev/null +++ b/lean/OAI/InformationTheory/BooleanNoise/ComparisonEstimates.lean @@ -0,0 +1,155 @@ +import OAI.InformationTheory.BooleanNoise.EntropyScalars +import OAI.InformationTheory.BooleanNoise.CurvatureCertificates +import Mathlib.Analysis.Calculus.Deriv.MeanValue + +namespace OAI + +noncomputable section + +open Set + +namespace LeanBlast.CourtadeKumar + +def comparisonC (u : ℝ) : ℝ := + 100 / 81 + Real.log (9 / 10) - Real.log u + +def comparisonBracket (u : ℝ) : ℝ := + (1 + u ^ 2 / 3) * comparisonC u - 1 / 3 + +theorem comparisonC_eq_log_div {u : ℝ} (hu : 0 < u) : + comparisonC u = 100 / 81 + Real.log ((9 / 10) / u) := by + rw [Real.log_div (by norm_num : (9 / 10 : ℝ) ≠ 0) hu.ne'] + unfold comparisonC + ring + +theorem comparisonC_lt_eleven_fourths {u : ℝ} (hu : (1 / 5 : ℝ) ≤ u) : + comparisonC u < 11 / 4 := by + have hlog := Real.log_le_log (by norm_num : (0 : ℝ) < 1 / 5) hu + have hbase : Real.log (9 / 10 : ℝ) - Real.log (1 / 5 : ℝ) = + Real.log (9 / 2 : ℝ) := by + rw [← Real.log_div (by norm_num : (9 / 10 : ℝ) ≠ 0) + (by norm_num : (1 / 5 : ℝ) ≠ 0)] + norm_num + have hnum := log_nine_halves_lt_151_div_100 + unfold comparisonC + linarith + +theorem hasDerivAt_comparisonC {u : ℝ} (hu : u ≠ 0) : + HasDerivAt comparisonC (-u⁻¹) u := by + exact (Real.hasDerivAt_log hu).const_sub (100 / 81 + Real.log (9 / 10 : ℝ)) + +theorem hasDerivAt_comparisonBracket {u : ℝ} (hu : u ≠ 0) : + HasDerivAt comparisonBracket + (u * (2 * comparisonC u - 1) / 3 - 1 / u) u := by + have hp : HasDerivAt (fun v : ℝ => 1 + v ^ 2 / 3) (2 * u / 3) u := by + convert! (((hasDerivAt_id u).pow 2).div_const 3).const_add 1 using 1 + simp + convert! (hp.mul (hasDerivAt_comparisonC hu)).sub_const (1 / 3) using 1 + field_simp + ring + +theorem comparisonBracket_derivative_neg {u : ℝ} + (hu0 : (1 / 5 : ℝ) ≤ u) (hu1 : u ≤ (5 / 8 : ℝ)) : + u * (2 * comparisonC u - 1) / 3 - 1 / u < 0 := by + have hu : 0 < u := by linarith + have hC := comparisonC_lt_eleven_fourths hu0 + have hu2 : u ^ 2 ≤ (5 / 8 : ℝ) ^ 2 := by + nlinarith [mul_nonneg (show 0 ≤ (5 / 8 : ℝ) - u by linarith) + (show 0 ≤ (5 / 8 : ℝ) + u by linarith)] + have hmul : u ^ 2 * (2 * comparisonC u - 1) ≤ (9 / 2 : ℝ) * u ^ 2 := by + have := mul_le_mul_of_nonneg_left (show 2 * comparisonC u - 1 ≤ (9 / 2 : ℝ) by + linarith) (sq_nonneg u) + nlinarith + apply (mul_lt_mul_iff_left₀ hu).mp + have heq : (u * (2 * comparisonC u - 1) / 3 - 1 / u) * u = + u ^ 2 * (2 * comparisonC u - 1) / 3 - 1 := by + field_simp + rw [heq, zero_mul] + nlinarith + +theorem comparisonBracket_antitone : + AntitoneOn comparisonBracket (Icc (1 / 5 : ℝ) (5 / 8)) := by + apply antitoneOn_of_deriv_nonpos (convex_Icc _ _) + · intro u hu + exact (hasDerivAt_comparisonBracket (by linarith [hu.1])).continuousAt.continuousWithinAt + · intro u hu + have hu' : u ∈ Icc (1 / 5 : ℝ) (5 / 8) := interior_subset hu + exact (hasDerivAt_comparisonBracket (by linarith [hu'.1])).differentiableAt.differentiableWithinAt + · intro u hu + have hu' : u ∈ Icc (1 / 5 : ℝ) (5 / 8) := interior_subset hu + rw [(hasDerivAt_comparisonBracket (by linarith [hu'.1])).deriv] + exact (comparisonBracket_derivative_neg hu'.1 hu'.2).le + +theorem comparisonC_middle_bound {u : ℝ} + (hu0 : (1 / 5 : ℝ) ≤ u) (hu1 : u ≤ (5 / 8 : ℝ)) : + (1 + u ^ 2 / 3) * comparisonC u - 1 / 3 ≤ (5 / 2 : ℝ) := by + have hanti := comparisonBracket_antitone + (show (1 / 5 : ℝ) ∈ Icc (1 / 5 : ℝ) (5 / 8) by constructor <;> norm_num) + (show u ∈ Icc (1 / 5 : ℝ) (5 / 8) from ⟨hu0, hu1⟩) hu0 + have hbase : comparisonBracket (1 / 5 : ℝ) < (5 / 2 : ℝ) := by + have hC := comparisonC_lt_eleven_fourths (show (1 / 5 : ℝ) ≤ 1 / 5 by norm_num) + unfold comparisonBracket + norm_num + linarith + exact hanti.trans hbase.le + +theorem comparisonC_integral_bracket_nonneg {u : ℝ} + (hu : 0 < u) (hu9 : u ≤ (9 / 10 : ℝ)) : + 0 ≤ 1 - u ^ 2 * comparisonC u := by + have hlog := Real.log_le_sub_one_of_pos + (div_pos (by norm_num : (0 : ℝ) < 9 / 10) hu) + have hC : comparisonC u ≤ 100 / 81 + (9 / 10) / u - 1 := by + rw [comparisonC_eq_log_div hu] + linarith + have hmul := mul_le_mul_of_nonneg_left hC (sq_nonneg u) + have heq : u ^ 2 * (100 / 81 + (9 / 10) / u - 1) = + (19 / 81 : ℝ) * u ^ 2 + (9 / 10 : ℝ) * u := by + field_simp + ring + rw [heq] at hmul + have hu2 : u ^ 2 ≤ (9 / 10 : ℝ) ^ 2 := by + nlinarith [mul_nonneg (show 0 ≤ (9 / 10 : ℝ) - u by linarith) + (show 0 ≤ (9 / 10 : ℝ) + u by linarith)] + nlinarith + +theorem comparison_large_regime (m u B P S v : ℝ) + (hB0 : 0 ≤ B) (hB : B ≤ m ^ 2 * (ell - 1 / 2)) + (hP : u ^ 2 / 2 ≤ P) + (hS : S ≤ (1 - m ^ 2) * P + B * (1 - v)) + (hu : (5 / 8 : ℝ) ≤ u) (hv : 0 ≤ v) : S ≤ P := by + have hlevel : ell - 1 / 2 ≤ P := by + have hell := ell_lt_347_div_500 + nlinarith [sq_nonneg (u - 5 / 8)] + have hcorrection : B * (1 - v) ≤ m ^ 2 * P := by + calc + B * (1 - v) ≤ B := by nlinarith [mul_nonneg hB0 hv] + _ ≤ m ^ 2 * (ell - 1 / 2) := hB + _ ≤ m ^ 2 * P := mul_le_mul_of_nonneg_left hlevel (sq_nonneg m) + nlinarith + +theorem comparison_middle_regime (m u B P S v : ℝ) + (hB0 : 0 ≤ B) (hB : B ≤ m ^ 2 * (ell - 1 / 2)) + (hP : u ^ 2 / 2 ≤ P) + (hS : S ≤ (1 - m ^ 2) * P + B * (1 - v)) + (hv : 1 - v ≤ (5 / 2 : ℝ) * u ^ 2) : S ≤ P := by + have hell : (ell - 1 / 2) * (5 / 2 : ℝ) ≤ 1 / 2 := by + have h := ell_lt_347_div_500 + linarith + have hcorrection : B * (1 - v) ≤ m ^ 2 * P := by + calc + B * (1 - v) ≤ B * ((5 / 2 : ℝ) * u ^ 2) := + mul_le_mul_of_nonneg_left hv hB0 + _ ≤ (m ^ 2 * (ell - 1 / 2)) * ((5 / 2 : ℝ) * u ^ 2) := + mul_le_mul_of_nonneg_right hB (by positivity) + _ ≤ m ^ 2 * (u ^ 2 / 2) := by + have h := mul_le_mul_of_nonneg_left hell + (mul_nonneg (sq_nonneg m) (sq_nonneg u)) + nlinarith + _ ≤ m ^ 2 * P := mul_le_mul_of_nonneg_left hP (sq_nonneg m) + nlinarith + +end LeanBlast.CourtadeKumar + +end + +end OAI diff --git a/lean/OAI/InformationTheory/BooleanNoise/ConcavityAcrossJoin.lean b/lean/OAI/InformationTheory/BooleanNoise/ConcavityAcrossJoin.lean new file mode 100644 index 0000000000000000000000000000000000000000..148132827e27e0546982fb43fb4d9aab6cae4a6e --- /dev/null +++ b/lean/OAI/InformationTheory/BooleanNoise/ConcavityAcrossJoin.lean @@ -0,0 +1,65 @@ +import Mathlib.Analysis.Convex.Deriv +import Mathlib.Tactic.Linarith + +namespace OAI + +noncomputable section + +open Set + +namespace LeanBlast.CourtadeKumar + +theorem antitoneOn_Ioi_of_hasDerivAt_nonpos_except + (f f' : ℝ → ℝ) (a c : ℝ) + (hf : ContinuousOn f (Ioi a)) + (hd : ∀ x, a < x → x ≠ c → HasDerivAt f (f' x) x) + (hneg : ∀ x, a < x → x ≠ c → f' x ≤ 0) : + AntitoneOn f (Ioi a) := by + have hsegment (l r : ℝ) (hal : a < l) (hlr : l ≤ r) + (hc : c ∉ Ioo l r) : f r ≤ f l := by + have hanti : AntitoneOn f (Icc l r) := by + apply antitoneOn_of_hasDerivWithinAt_nonpos (f' := f') (convex_Icc l r) + · exact hf.mono (fun _ hz => hal.trans_le hz.1) + · intro z hz + rw [interior_Icc] at hz + have hzc : z ≠ c := by + rintro rfl + exact hc hz + exact (hd z (hal.trans hz.1) hzc).hasDerivWithinAt + · intro z hz + rw [interior_Icc] at hz + have hzc : z ≠ c := by + rintro rfl + exact hc hz + exact hneg z (hal.trans hz.1) hzc + exact hanti ⟨le_rfl, hlr⟩ ⟨hlr, le_rfl⟩ hlr + intro x hx y hy hxy + by_cases hc : c ∈ Ioo x y + · exact (hsegment c y (hx.trans hc.1) hc.2.le (by simp)).trans + (hsegment x c hx hc.1.le (by simp)) + · exact hsegment x y hx hxy hc + +theorem concaveOn_Ioi_of_hasDerivAt2_nonpos_except + (f f' f'' : ℝ → ℝ) (a c : ℝ) + (hd : ∀ x, a < x → HasDerivAt f (f' x) x) + (hcf' : ContinuousOn f' (Ioi a)) + (hd' : ∀ x, a < x → x ≠ c → HasDerivAt f' (f'' x) x) + (hneg : ∀ x, a < x → x ≠ c → f'' x ≤ 0) : + ConcaveOn ℝ (Ioi a) f := by + have hanti := antitoneOn_Ioi_of_hasDerivAt_nonpos_except f' f'' a c hcf' hd' hneg + apply AntitoneOn.concaveOn_of_deriv (convex_Ioi a) + · intro x hx + exact (hd x hx).continuousAt.continuousWithinAt + · intro x hx + rw [interior_Ioi] at hx + exact (hd x hx).differentiableAt.differentiableWithinAt + · intro x hx y hy hxy + rw [interior_Ioi] at hx hy + rw [(hd x hx).deriv, (hd y hy).deriv] + exact hanti hx hy hxy + +end LeanBlast.CourtadeKumar + +end + +end OAI diff --git a/lean/OAI/InformationTheory/BooleanNoise/CubeSplits.lean b/lean/OAI/InformationTheory/BooleanNoise/CubeSplits.lean new file mode 100644 index 0000000000000000000000000000000000000000..5717258660fa15461a5f15b6903679a1da22c33d --- /dev/null +++ b/lean/OAI/InformationTheory/BooleanNoise/CubeSplits.lean @@ -0,0 +1,245 @@ +import OAI.InformationTheory.BooleanNoise.FiniteNoise +import Mathlib.Algebra.BigOperators.Fin +import Mathlib.Data.Fin.Tuple.Basic +import Mathlib.Tactic + +namespace OAI + +open scoped BigOperators + +noncomputable section + +namespace LeanBlast.CourtadeKumar + +variable {n : ℕ} + +def cubeSplitEquiv (n : ℕ) : Bool × Cube n ≃ Cube (n + 1) where + toFun z := Fin.cases z.1 z.2 + invFun x := (x 0, fun i => x i.succ) + left_inv z := by cases z; rfl + right_inv x := by + funext i + refine Fin.cases ?_ (fun j => ?_) i <;> rfl + +theorem sum_cube_split (g : Cube (n + 1) → ℝ) : + (∑ x, g x) = (∑ x, restrict g true x) + ∑ x, restrict g false x := by + rw [← (cubeSplitEquiv n).sum_comp g, Fintype.sum_prod_type, Fintype.sum_bool] + rfl + +theorem cubeAverage_split (g : Cube (n + 1) → ℝ) : + cubeAverage g = (cubeAverage (restrict g true) + cubeAverage (restrict g false)) / 2 := by + unfold cubeAverage + rw [sum_cube_split, pow_succ] + have hN : (2 : ℝ) ^ n ≠ 0 := ne_of_gt (cube_denominator_pos n) + field_simp + +theorem cubeAverage_div (g : Cube n → ℝ) (c : ℝ) : + cubeAverage (fun x => g x / c) = cubeAverage g / c := by + simp only [cubeAverage, div_eq_mul_inv] + rw [← Finset.sum_mul] + ring + +theorem cubeAverage_half_sum (g h : Cube n → ℝ) : + cubeAverage (fun x => (g x + h x) / 2) = (cubeAverage g + cubeAverage h) / 2 := by + rw [cubeAverage_div, cubeAverage_add] + +theorem cubeAverage_split_pair (g : Cube (n + 1) → ℝ) : + cubeAverage g = cubeAverage (fun x => (restrict g true x + restrict g false x) / 2) := by + rw [cubeAverage_half_sum, cubeAverage_split] + +@[simp] theorem pairMean_add_halfDifference (g : Cube (n + 1) → ℝ) (x : Cube n) : + pairMean g x + pairHalfDifference g x = restrict g true x := by + unfold pairMean pairHalfDifference + ring + +@[simp] theorem pairMean_sub_halfDifference (g : Cube (n + 1) → ℝ) (x : Cube n) : + pairMean g x - pairHalfDifference g x = restrict g false x := by + unfold pairMean pairHalfDifference + ring + +@[simp] theorem cubeAverage_pairMean (g : Cube (n + 1) → ℝ) : + cubeAverage (pairMean g) = cubeAverage g := by + exact (cubeAverage_split_pair g).symm + +theorem cubeAverage_pairHalfDifference (g : Cube (n + 1) → ℝ) : + cubeAverage (pairHalfDifference g) = + (cubeAverage (restrict g true) - cubeAverage (restrict g false)) / 2 := by + unfold pairHalfDifference + rw [cubeAverage_div, cubeAverage_sub] + +theorem cubeAverage_pairMean_add_halfDifference (g : Cube (n + 1) → ℝ) : + cubeAverage (pairMean g) + cubeAverage (pairHalfDifference g) = + cubeAverage (restrict g true) := by + rw [cubeAverage_pairMean, cubeAverage_split, cubeAverage_pairHalfDifference] + ring + +theorem cubeAverage_pairMean_sub_halfDifference (g : Cube (n + 1) → ℝ) : + cubeAverage (pairMean g) - cubeAverage (pairHalfDifference g) = + cubeAverage (restrict g false) := by + rw [cubeAverage_pairMean, cubeAverage_split, cubeAverage_pairHalfDifference] + ring + +theorem entropyAverage_split (g : Cube (n + 1) → ℝ) : + entropyAverage g = (entropyAverage (restrict g true) + entropyAverage (restrict g false)) / 2 := by + exact cubeAverage_split (fun x => entropy (g x)) + +theorem cubeAverage_pairEntropyGap (g : Cube (n + 1) → ℝ) : + cubeAverage (fun x => pairEntropyGap (pairMean g x) (pairHalfDifference g x)) = + entropyAverage (pairMean g) - entropyAverage g := by + simp only [pairEntropyGap, pairMean_add_halfDifference, pairMean_sub_halfDifference] + rw [cubeAverage_sub, cubeAverage_div, cubeAverage_add] + change entropyAverage (pairMean g) - + (entropyAverage (restrict g true) + entropyAverage (restrict g false)) / 2 = _ + rw [← entropyAverage_split] + +theorem informationDeficit_split (g : Cube (n + 1) → ℝ) : + (informationDeficit (restrict g true) + informationDeficit (restrict g false)) / 2 = + informationDeficit g - pairEntropyGap (cubeAverage (pairMean g)) + (cubeAverage (pairHalfDifference g)) := by + rw [pairEntropyGap, cubeAverage_pairMean_add_halfDifference, + cubeAverage_pairMean_sub_halfDifference, cubeAverage_pairMean] + simp only [informationDeficit] + rw [entropyAverage_split] + ring + +theorem informationDeficit_eq_pairMean_add (g : Cube (n + 1) → ℝ) : + informationDeficit g = informationDeficit (pairMean g) + + cubeAverage (fun x => pairEntropyGap (pairMean g x) (pairHalfDifference g x)) := by + rw [cubeAverage_pairEntropyGap] + simp only [informationDeficit, cubeAverage_pairMean] + ring + +theorem meanVariance_split (g : Cube (n + 1) → ℝ) : + (meanVariance (restrict g true) + meanVariance (restrict g false)) / 2 = + meanVariance g - (cubeAverage (pairHalfDifference g)) ^ 2 := by + simp only [meanVariance] + rw [cubeAverage_split, cubeAverage_pairHalfDifference] + ring + +theorem flip_zero_cases (b : Bool) (x : Cube n) : + flip (0 : Fin (n + 1)) (Fin.cases b x) = Fin.cases (!b) x := by + funext i + refine Fin.cases ?_ (fun j => ?_) i + · simp [flip, LeanBlast.GotsmanLinial.flip] + · simp [flip, LeanBlast.GotsmanLinial.flip] + +theorem flip_succ_cases (i : Fin n) (b : Bool) (x : Cube n) : + flip i.succ (Fin.cases b x) = Fin.cases b (flip i x) := by + funext j + refine Fin.cases ?_ (fun k => ?_) j + · have h0 : (0 : Fin (n + 1)) ≠ i.succ := Ne.symm (Fin.succ_ne_zero i) + simp [flip, LeanBlast.GotsmanLinial.flip, h0] + · by_cases hki : k = i + · subst k + simp [flip, LeanBlast.GotsmanLinial.flip] + · simp [flip, LeanBlast.GotsmanLinial.flip, hki] + +theorem restrict_cubeDerivative_succ (g : Cube (n + 1) → ℝ) (i : Fin n) (b : Bool) : + restrict (cubeDerivative i.succ g) b = cubeDerivative i (restrict g b) := by + funext x + simp only [restrict, cubeDerivative, flip_succ_cases] + +theorem cubeAverage_first_coordinate_energy (g : Cube (n + 1) → ℝ) : + cubeAverage (fun x => Real.artanh (g x) * cubeDerivative 0 g x) = + cubeAverage (fun x => pairDissipation (pairMean g x) (pairHalfDifference g x)) := by + rw [cubeAverage_split_pair] + congr 1 + funext x + simp only [restrict, cubeDerivative, flip_zero_cases, Bool.not_true, Bool.not_false] + rw [pairDissipation, pairMean_add_halfDifference, pairMean_sub_halfDifference] + dsimp only [pairHalfDifference, restrict] + ring + +theorem cubeAverage_succ_coordinate_energy (g : Cube (n + 1) → ℝ) (i : Fin n) : + cubeAverage (fun x => Real.artanh (g x) * cubeDerivative i.succ g x) = + (cubeAverage (fun x => Real.artanh (restrict g true x) * cubeDerivative i (restrict g true) x) + + cubeAverage (fun x => Real.artanh (restrict g false x) * cubeDerivative i (restrict g false) x)) / 2 := by + have hr (b : Bool) : + restrict (fun x => Real.artanh (g x) * cubeDerivative i.succ g x) b = + (fun x => Real.artanh (restrict g b x) * cubeDerivative i (restrict g b) x) := by + funext x + simp only [restrict, cubeDerivative, flip_succ_cases] + rw [cubeAverage_split, hr true, hr false] + +theorem dissipation_split (g : Cube (n + 1) → ℝ) : + dissipation g = (dissipation (restrict g true) + dissipation (restrict g false)) / 2 + + cubeAverage (fun x => pairDissipation (pairMean g x) (pairHalfDifference g x)) := by + simp only [dissipation] + rw [Fin.sum_univ_succ, cubeAverage_first_coordinate_energy] + simp_rw [cubeAverage_succ_coordinate_energy] + rw [← Finset.sum_div, Finset.sum_add_distrib] + ring + +theorem IsInterior.restrict {g : Cube (n + 1) → ℝ} (hg : IsInterior g) (b : Bool) : + IsInterior (LeanBlast.CourtadeKumar.restrict g b) := by + intro x + exact hg (Fin.cases b x) + +theorem IsInterior.pairMean {g : Cube (n + 1) → ℝ} (hg : IsInterior g) : + IsInterior (LeanBlast.CourtadeKumar.pairMean g) := by + intro x + have h1 := hg.restrict true x + have h0 := hg.restrict false x + dsimp only [LeanBlast.CourtadeKumar.pairMean] + constructor <;> linarith + +theorem IsInterior.pairDomain {g : Cube (n + 1) → ℝ} (hg : IsInterior g) : + ∀ x, |LeanBlast.CourtadeKumar.pairMean g x| + |pairHalfDifference g x| < 1 := by + intro x + have h1 := hg.restrict true x + have h0 := hg.restrict false x + have hsum := pairMean_add_halfDifference g x + have hsub := pairMean_sub_halfDifference g x + rcases le_total 0 (LeanBlast.CourtadeKumar.pairMean g x) with ha | ha <;> + rcases le_total 0 (pairHalfDifference g x) with hb | hb + · rw [abs_of_nonneg ha, abs_of_nonneg hb] + linarith + · rw [abs_of_nonneg ha, abs_of_nonpos hb] + linarith + · rw [abs_of_nonpos ha, abs_of_nonneg hb] + linarith + · rw [abs_of_nonpos ha, abs_of_nonpos hb] + linarith + +def cubeVariance (g : Cube n → ℝ) : ℝ := + cubeAverage (fun x => (g x - cubeAverage g) ^ 2) + +theorem cubeVariance_nonneg (g : Cube n → ℝ) : 0 ≤ cubeVariance g := + cubeAverage_nonneg fun _ => sq_nonneg _ + +theorem cubeVariance_eq (g : Cube n → ℝ) : + cubeVariance g = cubeAverage (fun x => (g x) ^ 2) - (cubeAverage g) ^ 2 := by + unfold cubeVariance + have heq : (fun x => (g x - cubeAverage g) ^ 2) = + (fun x => (g x) ^ 2 - (2 * cubeAverage g) * g x + (cubeAverage g) ^ 2) := by + funext x + ring + rw [heq, cubeAverage_add, cubeAverage_sub, cubeAverage_smul, cubeAverage_const] + ring + +theorem average_one_sub_sq_eq_meanVariance_sub_variance (g : Cube n → ℝ) : + cubeAverage (fun x => 1 - (g x) ^ 2) = meanVariance g - cubeVariance g := by + rw [cubeAverage_sub, cubeAverage_const, cubeVariance_eq] + unfold meanVariance + ring + +theorem cubeAverage_dim_zero (g : Cube 0 → ℝ) : + cubeAverage g = g (fun i => Fin.elim0 i) := by + have heq : g = fun _ => g (fun i => Fin.elim0 i) := by + funext x + congr 1 + exact Subsingleton.elim _ _ + rw [heq, cubeAverage_const] + +@[simp] theorem informationDeficit_dim_zero (g : Cube 0 → ℝ) : informationDeficit g = 0 := by + simp only [informationDeficit, entropyAverage, cubeAverage_dim_zero] + ring + +@[simp] theorem dissipation_dim_zero (g : Cube 0 → ℝ) : dissipation g = 0 := by + simp [dissipation] + +end LeanBlast.CourtadeKumar + +end + +end OAI diff --git a/lean/OAI/InformationTheory/BooleanNoise/CubeVariance.lean b/lean/OAI/InformationTheory/BooleanNoise/CubeVariance.lean new file mode 100644 index 0000000000000000000000000000000000000000..f776a2782bff80a271d9968628e6e6cb13809b92 --- /dev/null +++ b/lean/OAI/InformationTheory/BooleanNoise/CubeVariance.lean @@ -0,0 +1,205 @@ +import OAI.InformationTheory.BooleanNoise.CubeSplits +import OAI.InformationTheory.BooleanNoise.JensenGaps +import OAI.InformationTheory.BooleanNoise.PairEntropy +import Mathlib.Analysis.SpecialFunctions.Log.Basic + +namespace OAI + +open scoped BigOperators + +noncomputable section + +namespace LeanBlast.CourtadeKumar + +variable {n : ℕ} + +def binaryRelativeEntropy (a m : ℝ) : ℝ := + (1 + a) / 2 * Real.log ((1 + a) / (1 + m)) + + (1 - a) / 2 * Real.log ((1 - a) / (1 - m)) + +theorem one_sub_sq_pos_of_interior {a : ℝ} (ha : -1 < a ∧ a < 1) : + 0 < 1 - a ^ 2 := by + nlinarith [mul_pos (by linarith : 0 < 1 - a) (by linarith : 0 < 1 + a)] + +theorem binaryRelativeEntropy_eq {a m : ℝ} + (ha : -1 < a ∧ a < 1) (hm : -1 < m ∧ m < 1) : + binaryRelativeEntropy a m = psi a - psi m - + (a - m) / 2 * (Real.log (1 + m) - Real.log (1 - m)) := by + have hap : 1 + a ≠ 0 := ne_of_gt (by linarith) + have ham : 1 - a ≠ 0 := ne_of_gt (by linarith) + have hmp : 1 + m ≠ 0 := ne_of_gt (by linarith) + have hmm : 1 - m ≠ 0 := ne_of_gt (by linarith) + unfold binaryRelativeEntropy psi + rw [Real.log_div hap hmp, Real.log_div ham hmm] + ring + +theorem sub_le_mul_log_div {a b : ℝ} (ha : 0 < a) (hb : 0 < b) : + a - b ≤ a * Real.log (a / b) := by + have h := mul_le_mul_of_nonneg_left + (Real.one_sub_inv_le_log_of_pos (div_pos ha hb)) ha.le + have heq : a * (1 - (a / b)⁻¹) = a - b := by + field_simp + rwa [heq] at h + +theorem binaryRelativeEntropy_nonneg {a m : ℝ} + (ha : -1 < a ∧ a < 1) (hm : -1 < m ∧ m < 1) : + 0 ≤ binaryRelativeEntropy a m := by + have hp := sub_le_mul_log_div (a := 1 + a) (b := 1 + m) + (by linarith) (by linarith) + have hm' := sub_le_mul_log_div (a := 1 - a) (b := 1 - m) + (by linarith) (by linarith) + unfold binaryRelativeEntropy + nlinarith + +theorem binaryRelativeEntropy_le_sq_div {a m : ℝ} + (ha : -1 < a ∧ a < 1) (hm : -1 < m ∧ m < 1) : + binaryRelativeEntropy a m ≤ (a - m) ^ 2 / (1 - m ^ 2) := by + have hmp : 1 + m ≠ 0 := ne_of_gt (by linarith) + have hmm : 1 - m ≠ 0 := ne_of_gt (by linarith) + have hA : 1 - m ^ 2 ≠ 0 := ne_of_gt (one_sub_sq_pos_of_interior hm) + have hp := mul_le_mul_of_nonneg_left + (Real.log_le_sub_one_of_pos + (div_pos (by linarith : 0 < 1 + a) (by linarith : 0 < 1 + m))) + (show 0 ≤ (1 + a) / 2 by linarith) + have hn := mul_le_mul_of_nonneg_left + (Real.log_le_sub_one_of_pos + (div_pos (by linarith : 0 < 1 - a) (by linarith : 0 < 1 - m))) + (show 0 ≤ (1 - a) / 2 by linarith) + calc + binaryRelativeEntropy a m ≤ + (1 + a) / 2 * ((1 + a) / (1 + m) - 1) + + (1 - a) / 2 * ((1 - a) / (1 - m) - 1) := add_le_add hp hn + _ = (a - m) ^ 2 / (1 - m ^ 2) := by + field_simp + ring + +theorem informationDeficit_eq_average_psi (g : Cube n → ℝ) : + informationDeficit g = cubeAverage (fun x => psi (g x)) - psi (cubeAverage g) := by + unfold informationDeficit entropyAverage entropy + rw [cubeAverage_sub, cubeAverage_const] + ring + +theorem informationDeficit_eq_average_binaryRelativeEntropy + {g : Cube n → ℝ} (hg : IsInterior g) : + informationDeficit g = + cubeAverage (fun x => binaryRelativeEntropy (g x) (cubeAverage g)) := by + let m := cubeAverage g + let c := Real.log (1 + m) - Real.log (1 - m) + have hlin : cubeAverage (fun x => (g x - m) / 2 * c) = 0 := by + have heq : (fun x => (g x - m) / 2 * c) = (fun x => (c / 2) * (g x - m)) := by + funext x + ring + rw [heq, cubeAverage_smul, cubeAverage_sub, cubeAverage_const] + dsimp [m] + ring + have heq : (fun x => binaryRelativeEntropy (g x) m) = + (fun x => psi (g x) - psi m - (g x - m) / 2 * c) := by + funext x + exact binaryRelativeEntropy_eq (hg x) hg.cubeAverage + rw [show (fun x => binaryRelativeEntropy (g x) (cubeAverage g)) = + (fun x => binaryRelativeEntropy (g x) m) from rfl, heq] + rw [cubeAverage_sub, cubeAverage_sub, cubeAverage_const, hlin, sub_zero] + exact informationDeficit_eq_average_psi g + +theorem informationDeficit_nonneg {g : Cube n → ℝ} (hg : IsInterior g) : + 0 ≤ informationDeficit g := by + rw [informationDeficit_eq_average_binaryRelativeEntropy hg] + exact cubeAverage_nonneg fun x => binaryRelativeEntropy_nonneg (hg x) hg.cubeAverage + +theorem informationDeficit_le_variance_div {g : Cube n → ℝ} (hg : IsInterior g) : + informationDeficit g ≤ cubeVariance g / meanVariance g := by + rw [informationDeficit_eq_average_binaryRelativeEntropy hg] + calc + cubeAverage (fun x => binaryRelativeEntropy (g x) (cubeAverage g)) ≤ + cubeAverage (fun x => (g x - cubeAverage g) ^ 2 / (1 - (cubeAverage g) ^ 2)) := + cubeAverage_mono fun x => binaryRelativeEntropy_le_sq_div (hg x) hg.cubeAverage + _ = cubeVariance g / meanVariance g := cubeAverage_div _ _ + +theorem abs_cubeAverage_le (g : Cube n → ℝ) : + |cubeAverage g| ≤ cubeAverage (fun x => |g x|) := by + unfold cubeAverage + rw [abs_div, abs_of_pos (cube_denominator_pos n)] + exact div_le_div_of_nonneg_right (Finset.abs_sum_le_sum_abs _ _) (cube_denominator_pos n).le + +theorem cubeAverage_pairDomain {a b : Cube n → ℝ} + (hdom : ∀ x, |a x| + |b x| < 1) : + |cubeAverage a| + |cubeAverage b| < 1 := by + calc + |cubeAverage a| + |cubeAverage b| ≤ + cubeAverage (fun x => |a x|) + cubeAverage (fun x => |b x|) := + add_le_add (abs_cubeAverage_le a) (abs_cubeAverage_le b) + _ = cubeAverage (fun x => |a x| + |b x|) := (cubeAverage_add _ _).symm + _ < 1 := by simpa using cubeAverage_lt hdom + +theorem IsInterior.of_pairDomain_left {a b : Cube n → ℝ} + (hdom : ∀ x, |a x| + |b x| < 1) : IsInterior a := by + intro x + apply abs_lt.mp + exact lt_of_le_of_lt (le_add_of_nonneg_right (abs_nonneg _)) (hdom x) + +theorem average_one_sub_sq_pos {g : Cube n → ℝ} (hg : IsInterior g) : + 0 < cubeAverage (fun x => 1 - (g x) ^ 2) := by + have h := cubeAverage_lt (fun x => one_sub_sq_pos_of_interior (hg x)) + simpa using h + +theorem scaled_informationDeficit_le_variance_gap (a b : Cube n → ℝ) + (hdom : ∀ x, |a x| + |b x| < 1) : + ((cubeAverage b) ^ 2 / (1 - (cubeAverage a) ^ 2)) * informationDeficit a ≤ + cubeAverage (fun x => (b x) ^ 2 / (1 - (a x) ^ 2)) - + (cubeAverage b) ^ 2 / (1 - (cubeAverage a) ^ 2) := by + have ha : IsInterior a := IsInterior.of_pairDomain_left hdom + let A := 1 - (cubeAverage a) ^ 2 + let W := cubeAverage (fun x => 1 - (a x) ^ 2) + let q := (cubeAverage b) ^ 2 / A + have hA : 0 < A := one_sub_sq_pos_of_interior ha.cubeAverage + have hW : 0 < W := average_one_sub_sq_pos ha + have hvar : 0 ≤ cubeVariance a := cubeVariance_nonneg a + have hWA : W = A - cubeVariance a := average_one_sub_sq_eq_meanVariance_sub_variance a + have hWle : W ≤ A := by linarith + have hq : 0 ≤ q := div_nonneg (sq_nonneg _) hA.le + have hSa : informationDeficit a ≤ cubeVariance a / W := + (informationDeficit_le_variance_div ha).trans + (div_le_div_of_nonneg_left hvar hW hWle) + have halg : q * (cubeVariance a / W) = (cubeAverage b) ^ 2 / W - + (cubeAverage b) ^ 2 / A := by + have hv : cubeVariance a = A - W := by linarith + rw [hv] + dsimp [q] + field_simp + calc + q * informationDeficit a ≤ q * (cubeVariance a / W) := + mul_le_mul_of_nonneg_left hSa hq + _ = (cubeAverage b) ^ 2 / W - (cubeAverage b) ^ 2 / A := halg + _ ≤ _ := pair_variance_gap_lower_bound a b hdom + +theorem entropy_product_le_scaled_informationDeficit (a b : Cube n → ℝ) + (hdom : ∀ x, |a x| + |b x| < 1) : + pairEntropyGap (cubeAverage a) (cubeAverage b) * informationDeficit a / ell ≤ + ((cubeAverage b) ^ 2 / (1 - (cubeAverage a) ^ 2)) * informationDeficit a := by + have hSa : 0 ≤ informationDeficit a := + informationDeficit_nonneg (IsInterior.of_pairDomain_left hdom) + have hJ := pairEntropyGap_le_quadratic (cubeAverage a) (cubeAverage b) + (cubeAverage_pairDomain hdom) + have hJdiv : pairEntropyGap (cubeAverage a) (cubeAverage b) / ell ≤ + (cubeAverage b) ^ 2 / (1 - (cubeAverage a) ^ 2) := by + apply (div_le_iff₀ ell_pos).2 + exact hJ.trans_eq (mul_comm _ _) + calc + pairEntropyGap (cubeAverage a) (cubeAverage b) * informationDeficit a / ell = + (pairEntropyGap (cubeAverage a) (cubeAverage b) / ell) * informationDeficit a := by + ring + _ ≤ _ := mul_le_mul_of_nonneg_right hJdiv hSa + +theorem entropy_product_le_variance_gap (a b : Cube n → ℝ) + (hdom : ∀ x, |a x| + |b x| < 1) : + pairEntropyGap (cubeAverage a) (cubeAverage b) * informationDeficit a / ell ≤ + cubeAverage (fun x => (b x) ^ 2 / (1 - (a x) ^ 2)) - + (cubeAverage b) ^ 2 / (1 - (cubeAverage a) ^ 2) := + (entropy_product_le_scaled_informationDeficit a b hdom).trans + (scaled_informationDeficit_le_variance_gap a b hdom) + +end LeanBlast.CourtadeKumar + +end + +end OAI diff --git a/lean/OAI/InformationTheory/BooleanNoise/CurvatureBounds.lean b/lean/OAI/InformationTheory/BooleanNoise/CurvatureBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..4ecbc6615131219bc83fcfa04e9188fca25d8974 --- /dev/null +++ b/lean/OAI/InformationTheory/BooleanNoise/CurvatureBounds.lean @@ -0,0 +1,169 @@ +import OAI.InformationTheory.BooleanNoise.CurvatureCertificates +import OAI.InformationTheory.BooleanNoise.InverseScalars +import OAI.InformationTheory.BooleanNoise.SmallCurvatureAux +import OAI.InformationTheory.BooleanNoise.MediumCurvature +import OAI.InformationTheory.BooleanNoise.LargeCurvature +import OAI.InformationTheory.BooleanNoise.InverseRegularity + +namespace OAI + +noncomputable section + +open Set Filter +open scoped Topology + +namespace LeanBlast.CourtadeKumar + +def curvatureModel (u t : ℝ) : ℝ := + ((1 + u ^ 2) * t - u) / ((1 - u ^ 2) ^ 2 * t ^ 3) + +private def smallCoarseBound (z : ℝ) : ℝ := + ((4 / 3) + (2 / 3) * (z / (1 - z))) / ((1 - z) ^ 2 * (1 + z / 3) ^ 3) + +private theorem smallCoarseBound_lt_ten_sevenths {z : ℝ} + (hz0 : 0 ≤ z) (hz25 : z ≤ 1 / 25) : smallCoarseBound z < 10 / 7 := by + have hz1 : 0 < 1 - z := by linarith + have hratio : z / (1 - z) ≤ 1 / 24 := (div_le_iff₀ hz1).mpr (by linarith) + have hnum : (4 / 3 : ℝ) + (2 / 3) * (z / (1 - z)) ≤ 49 / 36 := by linarith + have hzsq : z ^ 2 ≤ 1 / 625 := by + nlinarith [mul_nonneg hz0 (show 0 ≤ 1 / 25 - z by linarith)] + have hcube : 1 + z ≤ (1 + z / 3) ^ 3 := by + nlinarith [sq_nonneg z, pow_nonneg hz0 3] + have hbase : (599 / 625 : ℝ) ≤ (1 - z) ^ 2 * (1 + z) := by + nlinarith [pow_nonneg hz0 3] + have hden : (599 / 625 : ℝ) ≤ (1 - z) ^ 2 * (1 + z / 3) ^ 3 := + hbase.trans (mul_le_mul_of_nonneg_left hcube (sq_nonneg _)) + have hden0 : 0 < (1 - z) ^ 2 * (1 + z / 3) ^ 3 := by linarith + apply (div_lt_iff₀ hden0).mpr + calc + (4 / 3 : ℝ) + (2 / 3) * (z / (1 - z)) ≤ 49 / 36 := hnum + _ < (10 / 7) * (599 / 625) := by norm_num + _ ≤ (10 / 7) * ((1 - z) ^ 2 * (1 + z / 3) ^ 3) := + mul_le_mul_of_nonneg_left hden (by norm_num) + +private theorem normalized_small_curvature_le {z a : ℝ} + (hz0 : 0 < z) (hz25 : z ≤ 1 / 25) + (hal : 1 + z / 3 ≤ a) (hau : a ≤ 1 + z / (3 * (1 - z))) : + (((1 + z) * a - 1) / z) / ((1 - z) ^ 2 * a ^ 3) ≤ smallCoarseBound z := by + have hz1 : 0 < 1 - z := by linarith + have ha0 : 0 < a := by linarith + have hnum : ((1 + z) * a - 1) / z ≤ (4 / 3) + (2 / 3) * (z / (1 - z)) := by + calc + ((1 + z) * a - 1) / z ≤ + ((1 + z) * (1 + z / (3 * (1 - z))) - 1) / z := + div_le_div_of_nonneg_right + (sub_le_sub_right (mul_le_mul_of_nonneg_left hau (by linarith)) 1) hz0.le + _ = (4 / 3) + (2 / 3) * (z / (1 - z)) := by + field_simp [hz0.ne', hz1.ne'] + ring + have hupper0 : 0 ≤ (4 / 3 : ℝ) + (2 / 3) * (z / (1 - z)) := by positivity + have hden0 : 0 < (1 - z) ^ 2 * (1 + z / 3) ^ 3 := by positivity + have hdena0 : 0 < (1 - z) ^ 2 * a ^ 3 := by positivity + have hdencmp : (1 - z) ^ 2 * (1 + z / 3) ^ 3 ≤ (1 - z) ^ 2 * a ^ 3 := + mul_le_mul_of_nonneg_left (pow_le_pow_left₀ (by positivity) hal 3) (sq_nonneg _) + calc + (((1 + z) * a - 1) / z) / ((1 - z) ^ 2 * a ^ 3) ≤ + ((4 / 3) + (2 / 3) * (z / (1 - z))) / ((1 - z) ^ 2 * a ^ 3) := + div_le_div_of_nonneg_right hnum hdena0.le + _ ≤ smallCoarseBound z := div_le_div_of_nonneg_left hupper0 hden0 hdencmp + +theorem curvatureModel_small_of_cubic_bounds {u t : ℝ} + (hu0 : 0 < u) (hu5 : u ≤ 1 / 5) + (hl : u + u ^ 3 / 3 ≤ t) (hu : t ≤ u + u ^ 3 / (3 * (1 - u ^ 2))) : + curvatureModel u t < 1 / ell := by + have hz0 : 0 < u ^ 2 := sq_pos_of_pos hu0 + have hz25 : u ^ 2 ≤ 1 / 25 := by + nlinarith [mul_nonneg hu0.le (show 0 ≤ 1 / 5 - u by linarith)] + have hq : 0 < 1 - u ^ 2 := by linarith + have ht0 : 0 < t := by nlinarith [pow_pos hu0 3] + have hal : 1 + u ^ 2 / 3 ≤ t / u := by + apply (le_div_iff₀ hu0).mpr + nlinarith + have hau : t / u ≤ 1 + u ^ 2 / (3 * (1 - u ^ 2)) := by + apply (div_le_iff₀ hu0).mpr + calc + t ≤ u + u ^ 3 / (3 * (1 - u ^ 2)) := hu + _ = (1 + u ^ 2 / (3 * (1 - u ^ 2))) * u := by ring + have he : curvatureModel u t = + (((1 + u ^ 2) * (t / u) - 1) / u ^ 2) / ((1 - u ^ 2) ^ 2 * (t / u) ^ 3) := by + unfold curvatureModel + field_simp [hu0.ne', ht0.ne', hq.ne'] + rw [he] + exact (normalized_small_curvature_le hz0 hz25 hal hau).trans_lt + ((smallCoarseBound_lt_ten_sevenths hz0.le hz25).trans ten_sevenths_lt_inv_ell) + +theorem curvatureModel_artanh_small {u : ℝ} (hu0 : 0 < u) (hu5 : u ≤ 1 / 5) : + curvatureModel u (Real.artanh u) < 1 / ell := by + have hu : u ∈ Set.Ico (0 : ℝ) 1 := ⟨hu0.le, by linarith⟩ + exact curvatureModel_small_of_cubic_bounds hu0 hu5 + (cubic_le_artanh hu) (artanh_le_cubic_tail hu) + +theorem rSecondDeriv_le_inv_ell {s : ℝ} (hs0 : 0 ≤ s) (hs : s ≤ s0) : + rSecondDeriv s ≤ 1 / ell := by + by_cases hs_zero : s = 0 + · subst s + rw [rSecondDeriv_zero] + exact (show (4 / 3 : ℝ) < 10 / 7 by norm_num).trans ten_sevenths_lt_inv_ell |>.le + · have hsp : 0 < s := lt_of_le_of_ne hs0 (Ne.symm hs_zero) + have hsell : s < ell := hs.trans_lt s0_lt_ell + have hu := psiInv_mem_Ioo ⟨hsp, hsell⟩ + have hu5 : psiInv s ≤ 1 / 5 := by + apply (strictMonoOn_psi.le_iff_le ⟨hu.1.le, hu.2.le⟩ (by norm_num)).mp + rw [psi_psiInv hs0 hsell] + exact hs + change (if s ≤ 0 then 4 / 3 else curvatureModel (psiInv s) (Real.artanh (psiInv s))) ≤ _ + rw [ite_eq_right (not_le.mpr hsp)] + exact (curvatureModel_artanh_small hu.1 hu5).le + +theorem entropy_curvature_bound {u : ℝ} (hu0 : 0 < u) (hu1 : u < 1) : + entropy u ^ 2 * curvatureModel u (Real.artanh u) ≤ 2 / 3 := by + by_cases hz : u ^ 2 ≤ 2 / 3 + · exact medium_curvature_bound hu0 hu1 hz + · exact large_curvature_bound hu0.le hu1 (le_of_not_ge hz) + +theorem inverseEntropy_curvature_bound {s : ℝ} (hs : s ∈ Ioo (0 : ℝ) ell) : + (ell - s) ^ 2 * rSecondDeriv s ≤ 2 / 3 := by + have hu := psiInv_mem_Ioo hs + have h := entropy_curvature_bound hu.1 hu.2 + rw [rSecondDeriv, ite_eq_right (not_le.mpr hs.1)] + simpa only [entropy, psi_psiInv hs.1.le hs.2, curvatureModel] using h + +theorem L_curvature_bound {x : ℝ} (hx : x ∈ Ioo (0 : ℝ) ell) : + x ^ 2 * rSecondDeriv (ell - x) ≤ 2 / 3 := by + have hs : ell - x ∈ Ioo (0 : ℝ) ell := ⟨by linarith [hx.2], by linarith [hx.1]⟩ + simpa only [sub_sub_cancel] using inverseEntropy_curvature_bound hs + +theorem LDeriv_curvature_bound {x : ℝ} (hx : x ∈ Ioo (0 : ℝ) ell) : + x ^ 2 * deriv LDeriv x ≤ 2 / 3 := by + rw [(hasDerivAt_LDeriv_of_lt hx).deriv] + exact L_curvature_bound hx + +theorem hasDerivAt_deriv_L_of_lt {x : ℝ} (hx : x ∈ Ioo (0 : ℝ) ell) : + HasDerivAt (deriv L) (rSecondDeriv (ell - x)) x := by + have he : deriv L =ᶠ[𝓝 x] LDeriv := by + filter_upwards [Ioo_mem_nhds hx.1 hx.2] with y hy + exact (hasDerivAt_L_of_lt hy).deriv + exact (hasDerivAt_LDeriv_of_lt hx).congr_of_eventuallyEq he + +theorem L_second_deriv_bound {x : ℝ} (hx : x ∈ Ioo (0 : ℝ) ell) : + x ^ 2 * deriv (deriv L) x ≤ 2 / 3 := by + rw [(hasDerivAt_deriv_L_of_lt hx).deriv] + exact L_curvature_bound hx + +theorem hasDerivAt_deriv_r_of_pos {s : ℝ} (hs : s ∈ Ioo (0 : ℝ) ell) : + HasDerivAt (deriv r) (rSecondDeriv s) s := by + have he : deriv r =ᶠ[𝓝 s] rDeriv := by + filter_upwards [Ioo_mem_nhds hs.1 hs.2] with y hy + exact (hasDerivAt_r hy).deriv + exact (hasDerivAt_rDeriv hs).congr_of_eventuallyEq he + +theorem r_second_deriv_bound {s : ℝ} (hs0 : 0 < s) (hs : s ≤ s0) : + deriv (deriv r) s ≤ 1 / ell := by + rw [(hasDerivAt_deriv_r_of_pos ⟨hs0, hs.trans_lt s0_lt_ell⟩).deriv] + exact rSecondDeriv_le_inv_ell hs0.le hs + +end LeanBlast.CourtadeKumar + +end + +end OAI diff --git a/lean/OAI/InformationTheory/BooleanNoise/CurvatureCertificates.lean b/lean/OAI/InformationTheory/BooleanNoise/CurvatureCertificates.lean new file mode 100644 index 0000000000000000000000000000000000000000..c62f7e4e6fcfe8a95939432fe9e92a323305c6bf --- /dev/null +++ b/lean/OAI/InformationTheory/BooleanNoise/CurvatureCertificates.lean @@ -0,0 +1,241 @@ +import OAI.InformationTheory.BooleanNoise.Basic +import Mathlib.Tactic +import Mathlib.Analysis.SpecialFunctions.ExpDeriv + +namespace OAI + +noncomputable section + +open scoped BigOperators + +namespace LeanBlast.CourtadeKumar + +def bernsteinSum (d : ℕ) (B : Fin (d + 1) → ℝ) (t : ℝ) : ℝ := + ∑ i, B i * (d.choose i.val : ℝ) * t ^ i.val * (1 - t) ^ (d - i.val) + +theorem bernsteinSum_pos (d : ℕ) (B : Fin (d + 1) → ℝ) + (hB : ∀ i, 0 < B i) {t : ℝ} (ht0 : 0 ≤ t) (ht1 : t ≤ 1) : + 0 < bernsteinSum d B t := by + have h1t : 0 ≤ 1 - t := sub_nonneg.mpr ht1 + unfold bernsteinSum + apply Finset.sum_pos' + · intro i _ + exact mul_nonneg + (mul_nonneg (mul_nonneg (hB i).le (Nat.cast_nonneg _)) (pow_nonneg ht0 _)) + (pow_nonneg h1t _) + · by_cases hlt : t < 1 + · refine ⟨⟨0, Nat.zero_lt_succ d⟩, Finset.mem_univ _, ?_⟩ + simpa only [Fin.val_zero, Nat.choose_zero_right, Nat.cast_one, pow_zero, + mul_one, Nat.sub_zero] using + mul_pos (hB ⟨0, Nat.zero_lt_succ d⟩) (pow_pos (sub_pos.mpr hlt) d) + · have ht : t = 1 := le_antisymm ht1 (le_of_not_gt hlt) + refine ⟨⟨d, Nat.lt_succ_self d⟩, Finset.mem_univ _, ?_⟩ + simpa [ht] using hB ⟨d, Nat.lt_succ_self d⟩ + +def curvatureT (z : ℝ) : ℝ := + 1 + z / 3 + z ^ 2 / 5 + z ^ 3 / 7 + z ^ 4 / 9 + z ^ 5 / 11 + +def curvatureP (z : ℝ) : ℝ := + 347 / 500 - z / 2 - z ^ 2 / 12 - z ^ 3 / 30 - z ^ 4 / 56 - z ^ 5 / 90 + +def curvatureN (z : ℝ) : ℝ := + (1 - z) * (4 / 3 + (8 / 15) * z + (12 / 35) * z ^ 2 + + (16 / 63) * z ^ 3 + (20 / 99) * z ^ 4) + (24 / 143) * z ^ 5 + +def curvaturePolynomial (z : ℝ) : ℝ := + 2 * (1 - z) ^ 3 * curvatureT z ^ 3 - 3 * curvatureP z ^ 2 * curvatureN z + +private def curvatureBernstein : Fin 19 → ℝ := + ![(4591 / 62500 : ℝ), + (49876 / 703125 : ℝ), + (616620509 / 9036562500 : ℝ), + (425343109 / 6506325000 : ℝ), + (1239780551 / 19880437500 : ℝ), + (8677345901149 / 146538704812500 : ℝ), + (243668974553 / 4355288437500 : ℝ), + (9012669336346771 / 171450284630625000 : ℝ), + (1633213857973883 / 33281525840062500 : ℝ), + (270017981574109469 / 5940752362451156250 : ℝ), + (49027630438590434159 / 1176268967765328937500 : ℝ), + (363078011510202773129 / 9624018827170873125000 : ℝ), + (10171907529149910232987 / 303156593055882503437500 : ℝ), + (4117638512237582389 / 141331745014397437500 : ℝ), + (29341211329970780039 / 1199300807693601112500 : ℝ), + (7749647417493214337891 / 395769266538888367125000 : ℝ), + (14423931694547701552427 / 989423166347220917812500 : ℝ), + (140069602865401114033 / 14550340681576778203125 : ℝ), + (2753371080520712929 / 554298692631496312500 : ℝ)] + +private theorem curvatureBernstein_pos (i : Fin 19) : 0 < curvatureBernstein i := by + fin_cases i <;> norm_num [curvatureBernstein] + +theorem curvaturePolynomial_bernstein (t : ℝ) : + curvaturePolynomial ((2 / 3) * t) = bernsteinSum 18 curvatureBernstein t := by + simp only [bernsteinSum, Fin.sum_univ_succ, Fin.val_zero, Fin.val_succ] + norm_num [curvatureBernstein, Nat.choose_eq_descFactorial_div_factorial, + Nat.descFactorial, Nat.factorial] + unfold curvaturePolynomial curvatureT curvatureP curvatureN + ring + +theorem curvatureCertificate_pos {z : ℝ} (hz0 : 0 ≤ z) (hz2 : z ≤ 2 / 3) : + 0 < curvaturePolynomial z := by + have ht0 : 0 ≤ (3 / 2 : ℝ) * z := by positivity + have ht1 : (3 / 2 : ℝ) * z ≤ 1 := by linarith + have h := bernsteinSum_pos 18 curvatureBernstein curvatureBernstein_pos ht0 ht1 + rw [← curvaturePolynomial_bernstein] at h + have he : (2 / 3 : ℝ) * ((3 / 2) * z) = z := by ring + simpa only [he] using h + +def lambdaPolynomial (b : ℝ) : ℝ := + 4 - (5 / 2) * b - 5 * b ^ 2 - (7 / 4) * b ^ 3 + (56 / 15) * b ^ 4 + + b ^ 5 + (15 / 14) * b ^ 6 + (3 / 8) * b ^ 7 + (8 / 15) * b ^ 8 + +private def lambdaBernsteinLow : Fin 9 → ℝ := + ![4, + (241 / 64 : ℝ), + (1537 / 448 : ℝ), + (42755 / 14336 : ℝ), + (217187 / 89600 : ℝ), + (510487 / 286720 : ℝ), + (8901163 / 8028160 : ℝ), + (19161827 / 36700160 : ℝ), + (1316227 / 4587520 : ℝ)] + +private def lambdaBernsteinHigh : Fin 9 → ℝ := + ![(1316227 / 4587520 : ℝ), + (7652479 / 36700160 : ℝ), + (5432143 / 32112640 : ℝ), + (2869523 / 16056320 : ℝ), + (3747241 / 15052800 : ℝ), + (1185781 / 3010560 : ℝ), + (79071 / 125440 : ℝ), + (5261 / 5376 : ℝ), + (1229 / 840 : ℝ)] + +private theorem lambdaBernsteinLow_pos (i : Fin 9) : 0 < lambdaBernsteinLow i := by + fin_cases i <;> norm_num [lambdaBernsteinLow] + +private theorem lambdaBernsteinHigh_pos (i : Fin 9) : 0 < lambdaBernsteinHigh i := by + fin_cases i <;> norm_num [lambdaBernsteinHigh] + +theorem lambdaPolynomial_bernstein_low (t : ℝ) : + lambdaPolynomial ((3 / 4) * t) = bernsteinSum 8 lambdaBernsteinLow t := by + unfold bernsteinSum + simp_rw [Nat.choose_eq_descFactorial_div_factorial] + norm_num [lambdaPolynomial, lambdaBernsteinLow, Fin.sum_univ_succ, + Nat.descFactorial, Nat.factorial] + ring + +theorem lambdaPolynomial_bernstein_high (t : ℝ) : + lambdaPolynomial (3 / 4 + (1 / 4) * t) = bernsteinSum 8 lambdaBernsteinHigh t := by + unfold bernsteinSum + simp_rw [Nat.choose_eq_descFactorial_div_factorial] + norm_num [lambdaPolynomial, lambdaBernsteinHigh, Fin.sum_univ_succ, + Nat.descFactorial, Nat.factorial] + ring + +theorem lambdaCertificate_pos {b : ℝ} (hb0 : 0 ≤ b) (hb1 : b ≤ 1) : + 0 < lambdaPolynomial b := by + by_cases hb : b ≤ 3 / 4 + · have ht0 : 0 ≤ (4 / 3 : ℝ) * b := by positivity + have ht1 : (4 / 3 : ℝ) * b ≤ 1 := by linarith + have h := bernsteinSum_pos 8 lambdaBernsteinLow lambdaBernsteinLow_pos ht0 ht1 + rw [← lambdaPolynomial_bernstein_low] at h + have he : (3 / 4 : ℝ) * ((4 / 3) * b) = b := by ring + simpa only [he] using h + · have ht0 : 0 ≤ 4 * b - 3 := by linarith + have ht1 : 4 * b - 3 ≤ 1 := by linarith + have h := bernsteinSum_pos 8 lambdaBernsteinHigh lambdaBernsteinHigh_pos ht0 ht1 + rw [← lambdaPolynomial_bernstein_high] at h + have he : (3 / 4 : ℝ) + (1 / 4) * (4 * b - 3) = b := by ring + simpa only [he] using h + +theorem two_lt_exp_347_div_500 : (2 : ℝ) < Real.exp (347 / 500) := by + refine lt_of_lt_of_le ?_ (Real.sum_le_exp_of_nonneg (by norm_num : (0 : ℝ) ≤ 347 / 500) 5) + norm_num [Finset.sum_range_succ, Nat.factorial] + +theorem ell_lt_347_div_500 : ell < 347 / 500 := + (Real.log_lt_iff_lt_exp (by norm_num : (0 : ℝ) < 2)).mpr two_lt_exp_347_div_500 + +theorem nine_lt_exp_eleven_fifths : (9 : ℝ) < Real.exp (11 / 5) := by + refine lt_of_lt_of_le ?_ (Real.sum_le_exp_of_nonneg (by norm_num : (0 : ℝ) ≤ 11 / 5) 8) + norm_num [Finset.sum_range_succ, Nat.factorial] + +theorem nineteen_lt_exp_three : (19 : ℝ) < Real.exp 3 := by + refine lt_of_lt_of_le ?_ (Real.sum_le_exp_of_nonneg (by norm_num : (0 : ℝ) ≤ 3) 7) + norm_num [Finset.sum_range_succ, Nat.factorial] + +theorem log_nineteen_lt_three : Real.log 19 < 3 := + (Real.log_lt_iff_lt_exp (by norm_num : (0 : ℝ) < 19)).mpr nineteen_lt_exp_three + +theorem nine_halves_lt_exp_151_div_100 : (9 / 2 : ℝ) < Real.exp (151 / 100) := by + refine lt_of_lt_of_le ?_ (Real.sum_le_exp_of_nonneg (by norm_num : (0 : ℝ) ≤ 151 / 100) 6) + norm_num [Finset.sum_range_succ, Nat.factorial] + +theorem log_nine_halves_lt_151_div_100 : Real.log (9 / 2) < 151 / 100 := + (Real.log_lt_iff_lt_exp (by norm_num : (0 : ℝ) < 9 / 2)).mpr nine_halves_lt_exp_151_div_100 + +def smallCurvatureBound (z : ℝ) : ℝ := + ((4 / 3) + (8 / 15) * (z / (1 - z))) / ((1 - z) ^ 2 * (1 + z / 3) ^ 3) + +theorem smallCurvatureBound_lt_ten_sevenths {z : ℝ} + (hz0 : 0 ≤ z) (hz25 : z ≤ 1 / 25) : smallCurvatureBound z < 10 / 7 := by + have hz1 : 0 < 1 - z := by linarith + have hratio : z / (1 - z) ≤ 1 / 24 := (div_le_iff₀ hz1).mpr (by linarith) + have hnum : (4 / 3 : ℝ) + (8 / 15) * (z / (1 - z)) ≤ 61 / 45 := by linarith + have hzsq : z ^ 2 ≤ 1 / 625 := by + nlinarith [mul_nonneg hz0 (show 0 ≤ 1 / 25 - z by linarith)] + have hcube : 1 + z ≤ (1 + z / 3) ^ 3 := by + nlinarith [sq_nonneg z, pow_nonneg hz0 3] + have hbase : (599 / 625 : ℝ) ≤ (1 - z) ^ 2 * (1 + z) := by + nlinarith [pow_nonneg hz0 3] + have hden : (599 / 625 : ℝ) ≤ (1 - z) ^ 2 * (1 + z / 3) ^ 3 := + hbase.trans (mul_le_mul_of_nonneg_left hcube (sq_nonneg _)) + have hden0 : 0 < (1 - z) ^ 2 * (1 + z / 3) ^ 3 := by linarith + apply (div_lt_iff₀ hden0).mpr + calc + (4 / 3 : ℝ) + (8 / 15) * (z / (1 - z)) ≤ 61 / 45 := hnum + _ < (10 / 7) * (599 / 625) := by norm_num + _ ≤ (10 / 7) * ((1 - z) ^ 2 * (1 + z / 3) ^ 3) := + mul_le_mul_of_nonneg_left hden (by norm_num) + +theorem ten_sevenths_lt_inv_ell : (10 / 7 : ℝ) < 1 / ell := by + have hpos : 0 < ell := Real.log_pos (by norm_num) + apply (lt_div_iff₀ hpos).mpr + have h := ell_lt_347_div_500 + linarith + +theorem smallCurvatureBound_lt_inv_ell {z : ℝ} + (hz0 : 0 ≤ z) (hz25 : z ≤ 1 / 25) : smallCurvatureBound z < 1 / ell := + (smallCurvatureBound_lt_ten_sevenths hz0 hz25).trans ten_sevenths_lt_inv_ell + +theorem largeCurvature_first_term_le {y : ℝ} (hy : 0 ≤ y) : + (1 - y) * (1 + (10 / 9) * y) ^ 2 ≤ 13718 / 10935 := by + have h : 0 ≤ (y - 11 / 30) ^ 2 * ((100 / 81) * y + 460 / 243) := + mul_nonneg (sq_nonneg _) (by positivity) + nlinarith + +theorem largeCurvature_second_term_le {y : ℝ} (hy0 : 0 ≤ y) (hy5 : y ≤ 5 / 11) : + (1 + y) * (1 + (10 / 9) * y) ^ 2 / 81 ≤ 355216 / 8732691 := by + calc + (1 + y) * (1 + (10 / 9) * y) ^ 2 / 81 ≤ + (1 + (5 / 11 : ℝ)) * (1 + (10 / 9) * (5 / 11)) ^ 2 / 81 := by + gcongr + _ = 355216 / 8732691 := by norm_num + +theorem largeCurvature_rational_sum : + (13718 / 10935 : ℝ) + 355216 / 8732691 < 4 / 3 := by norm_num + +theorem largeCurvatureEnvelope_lt {y : ℝ} (hy0 : 0 ≤ y) (hy5 : y ≤ 5 / 11) : + (1 / 2 : ℝ) * ((1 - y) * (1 + (10 / 9) * y) ^ 2 + + (1 + y) * (1 + (10 / 9) * y) ^ 2 / 81) < 2 / 3 := by + have h1 := largeCurvature_first_term_le hy0 + have h2 := largeCurvature_second_term_le hy0 hy5 + have h3 := largeCurvature_rational_sum + linarith + +end LeanBlast.CourtadeKumar + +end + +end OAI diff --git a/lean/OAI/InformationTheory/BooleanNoise/EndpointLimits.lean b/lean/OAI/InformationTheory/BooleanNoise/EndpointLimits.lean new file mode 100644 index 0000000000000000000000000000000000000000..953f4264697e592c1f4b63b3591c34cd5564b1f9 --- /dev/null +++ b/lean/OAI/InformationTheory/BooleanNoise/EndpointLimits.lean @@ -0,0 +1,164 @@ +import OAI.InformationTheory.BooleanNoise.EntropyScalars +import Mathlib.Analysis.Calculus.LHopital +import Mathlib.Analysis.Calculus.Deriv.Slope + +namespace OAI + +noncomputable section + +open Filter Set +open scoped Topology + +namespace LeanBlast.CourtadeKumar + +theorem tendsto_artanh_div_id_zero_right : + Tendsto (fun u : ℝ => Real.artanh u / u) (𝓝[>] 0) (𝓝 1) := by + have hd : HasDerivAt Real.artanh 1 0 := by + simpa using hasDerivAt_artanh (show (0 : ℝ) ∈ Ioo (-1) 1 by constructor <;> norm_num) + simpa [smul_eq_mul, div_eq_mul_inv, mul_comm] using hd.tendsto_slope_zero_right + +theorem tendsto_id_div_artanh_zero_right : + Tendsto (fun u : ℝ => u / Real.artanh u) (𝓝[>] 0) (𝓝 1) := by + simpa only [inv_div, inv_one] using + tendsto_artanh_div_id_zero_right.inv₀ (show (1 : ℝ) ≠ 0 by norm_num) + +theorem tendsto_entropy_inverse_derivative_zero_right : + Tendsto (fun u : ℝ => 1 + u / ((1 - u ^ 2) * Real.artanh u)) + (𝓝[>] 0) (𝓝 2) := by + have hu : Tendsto (fun u : ℝ => u) (𝓝[>] 0) (𝓝 0) := + tendsto_nhdsWithin_of_tendsto_nhds tendsto_id + have hden : Tendsto (fun u : ℝ => 1 - u ^ 2) (𝓝[>] 0) (𝓝 1) := by + simpa using tendsto_const_nhds.sub (hu.pow 2) + have hquot := tendsto_id_div_artanh_zero_right.div hden (show (1 : ℝ) ≠ 0 by norm_num) + have hadd : + Tendsto (fun u : ℝ => 1 + (u / Real.artanh u) / (1 - u ^ 2)) + (𝓝[>] 0) (𝓝 ((1 : ℝ) + 1 / 1)) := tendsto_const_nhds.add hquot + norm_num [div_div, mul_comm] at hadd ⊢ + exact hadd + +theorem tendsto_artanh_mul_id_div_psi_zero_right : + Tendsto (fun u : ℝ => (u * Real.artanh u) / psi u) (𝓝[>] 0) (𝓝 2) := by + have hu : Tendsto (fun u : ℝ => u) (𝓝[>] 0) (𝓝 0) := + tendsto_nhdsWithin_of_tendsto_nhds tendsto_id + have hda : HasDerivAt Real.artanh 1 0 := by + simpa using hasDerivAt_artanh (show (0 : ℝ) ∈ Ioo (-1) 1 by constructor <;> norm_num) + have ha : Tendsto Real.artanh (𝓝[>] 0) (𝓝 0) := by + simpa using hda.continuousAt.tendsto.mono_left nhdsWithin_le_nhds + have hp : Tendsto psi (𝓝[>] 0) (𝓝 0) := by + simpa [psi] using + (hasDerivAt_psi (show (0 : ℝ) ∈ Ioo (-1) 1 by constructor <;> norm_num)).continuousAt.tendsto.mono_left + nhdsWithin_le_nhds + have hquot : Tendsto + (fun u : ℝ => (Real.artanh u + u / (1 - u ^ 2)) / Real.artanh u) + (𝓝[>] 0) (𝓝 2) := by + apply tendsto_entropy_inverse_derivative_zero_right.congr' + filter_upwards [Ioo_mem_nhdsGT (show (0 : ℝ) < 1 by norm_num)] with u hu + have hne : Real.artanh u ≠ 0 := ne_of_gt (Real.artanh_pos hu) + rw [add_div, div_self hne, div_div] + apply HasDerivAt.lhopital_zero_right_on_Ioo + (f' := fun u => Real.artanh u + u / (1 - u ^ 2)) + (g' := Real.artanh) (show (0 : ℝ) < 1 by norm_num) + · intro u hu + convert! (hasDerivAt_id u).mul + (hasDerivAt_artanh (show u ∈ Ioo (-1) 1 from ⟨by linarith [hu.1], hu.2⟩)) using 1 + simp [id_eq, div_eq_mul_inv] + · intro u hu + exact hasDerivAt_psi ⟨by linarith [hu.1], hu.2⟩ + · intro u hu + exact ne_of_gt (Real.artanh_pos hu) + · simpa using hu.mul ha + · exact hp + · exact hquot + +theorem tendsto_psi_div_sq_zero_right : + Tendsto (fun u : ℝ => psi u / u ^ 2) (𝓝[>] 0) (𝓝 (1 / 2 : ℝ)) := by + have hu : Tendsto (fun u : ℝ => u) (𝓝[>] 0) (𝓝 0) := + tendsto_nhdsWithin_of_tendsto_nhds tendsto_id + apply HasDerivAt.lhopital_zero_right_on_Ioo + (f' := Real.artanh) (g' := fun u => 2 * u) (show (0 : ℝ) < 1 by norm_num) + · intro u hu + exact hasDerivAt_psi ⟨by linarith [hu.1], hu.2⟩ + · intro u _ + convert! (hasDerivAt_id u).pow 2 using 1 + simp + · intro u hu + exact mul_ne_zero (by norm_num) (ne_of_gt hu.1) + · simpa using (continuous_psi.tendsto (0 : ℝ)).mono_left nhdsWithin_le_nhds + · simpa using hu.pow 2 + · simpa [div_div, mul_comm] using tendsto_artanh_div_id_zero_right.div_const 2 + +private theorem endpoint_one_sub_sq_pos {u : ℝ} (hu : u ∈ Ioo 0 1) : + 0 < 1 - u ^ 2 := by + have h := mul_pos (show 0 < 1 + u by linarith [hu.1]) (sub_pos.mpr hu.2) + nlinarith + +theorem tendsto_artanh_sub_id_div_cube_zero_right : + Tendsto (fun u : ℝ => (Real.artanh u - u) / u ^ 3) + (𝓝[>] 0) (𝓝 (1 / 3 : ℝ)) := by + have hu : Tendsto (fun u : ℝ => u) (𝓝[>] 0) (𝓝 0) := + tendsto_nhdsWithin_of_tendsto_nhds tendsto_id + have hda : HasDerivAt Real.artanh 1 0 := by + simpa using hasDerivAt_artanh (show (0 : ℝ) ∈ Ioo (-1) 1 by constructor <;> norm_num) + have ha : Tendsto Real.artanh (𝓝[>] 0) (𝓝 0) := by + simpa using hda.continuousAt.tendsto.mono_left nhdsWithin_le_nhds + have hden : Tendsto (fun u : ℝ => 3 * (1 - u ^ 2)) (𝓝[>] 0) (𝓝 3) := by + convert tendsto_const_nhds.mul (tendsto_const_nhds.sub (hu.pow 2)) using 1 + norm_num + have hquot : Tendsto (fun u : ℝ => (1 / (1 - u ^ 2) - 1) / (3 * u ^ 2)) + (𝓝[>] 0) (𝓝 (1 / 3 : ℝ)) := by + apply (tendsto_const_nhds.div hden (show (3 : ℝ) ≠ 0 by norm_num)).congr' + filter_upwards [Ioo_mem_nhdsGT (show (0 : ℝ) < 1 by norm_num)] with u hu + have hu0 := ne_of_gt hu.1 + have hsq := ne_of_gt (endpoint_one_sub_sq_pos hu) + dsimp + field_simp + ring + apply HasDerivAt.lhopital_zero_right_on_Ioo + (f' := fun u => 1 / (1 - u ^ 2) - 1) (g' := fun u => 3 * u ^ 2) + (show (0 : ℝ) < 1 by norm_num) + · intro u hu + exact (hasDerivAt_artanh ⟨by linarith [hu.1], hu.2⟩).sub (hasDerivAt_id u) + · intro u _ + convert! (hasDerivAt_id u).pow 3 using 1 + simp + · intro u hu + exact mul_ne_zero (by norm_num) (pow_ne_zero 2 (ne_of_gt hu.1)) + · simpa using ha.sub hu + · simpa using hu.pow 3 + · exact hquot + +theorem tendsto_entropy_inverse_second_derivative_zero_right : + Tendsto (fun u : ℝ => + ((1 + u ^ 2) * Real.artanh u - u) / + ((1 - u ^ 2) ^ 2 * (Real.artanh u) ^ 3)) + (𝓝[>] 0) (𝓝 (4 / 3 : ℝ)) := by + have hu : Tendsto (fun u : ℝ => u) (𝓝[>] 0) (𝓝 0) := + tendsto_nhdsWithin_of_tendsto_nhds tendsto_id + have hnum : Tendsto + (fun u : ℝ => (Real.artanh u - u) / u ^ 3 + Real.artanh u / u) + (𝓝[>] 0) (𝓝 (4 / 3 : ℝ)) := by + convert tendsto_artanh_sub_id_div_cube_zero_right.add tendsto_artanh_div_id_zero_right + using 1 + norm_num + have hden : Tendsto + (fun u : ℝ => (1 - u ^ 2) ^ 2 * (Real.artanh u / u) ^ 3) + (𝓝[>] 0) (𝓝 1) := by + convert ((tendsto_const_nhds.sub (hu.pow 2)).pow 2).mul + (tendsto_artanh_div_id_zero_right.pow 3) using 1 + norm_num + have h := hnum.div hden (show (1 : ℝ) ≠ 0 by norm_num) + simp only [div_one] at h + apply h.congr' + filter_upwards [Ioo_mem_nhdsGT (show (0 : ℝ) < 1 by norm_num)] with u hu + have hu0 := ne_of_gt hu.1 + have ha0 := ne_of_gt (Real.artanh_pos hu) + have hsq := ne_of_gt (endpoint_one_sub_sq_pos hu) + dsimp + field_simp + ring + +end LeanBlast.CourtadeKumar + +end + +end OAI diff --git a/lean/OAI/InformationTheory/BooleanNoise/EntropyBounds.lean b/lean/OAI/InformationTheory/BooleanNoise/EntropyBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..32ac3458fae01380078311a23c8c6cc2970c8f4f --- /dev/null +++ b/lean/OAI/InformationTheory/BooleanNoise/EntropyBounds.lean @@ -0,0 +1,79 @@ +import OAI.InformationTheory.BooleanNoise.EntropySeries +import Mathlib.Analysis.Normed.Group.FunctionSeries + +namespace OAI + +noncomputable section + +open Set Filter Finset +open scoped Topology BigOperators + +namespace LeanBlast.CourtadeKumar + +def psiSeries (v : ℝ) : ℝ := ∑' k : ℕ, psiCoeff k * v ^ (2 * (k + 1)) + +theorem norm_psiSeries_term_le {v : ℝ} (hv : |v| ≤ 1) (k : ℕ) : + ‖psiCoeff k * v ^ (2 * (k + 1))‖ ≤ psiCoeff k := by + rw [norm_mul, norm_pow, Real.norm_eq_abs, Real.norm_eq_abs, + abs_of_nonneg (psiCoeff_nonneg k)] + exact mul_le_of_le_one_right (psiCoeff_nonneg k) + (pow_le_one₀ (abs_nonneg v) hv) + +theorem summable_psi_closed {v : ℝ} (hv : |v| ≤ 1) : + Summable (fun k : ℕ => psiCoeff k * v ^ (2 * (k + 1))) := + Summable.of_norm_bounded summable_psiCoeff (norm_psiSeries_term_le hv) + +theorem continuousOn_psiSeries : ContinuousOn psiSeries (Icc (-1) 1) := by + apply continuousOn_tsum + · intro k + fun_prop + · exact summable_psiCoeff + · intro k v hv + exact norm_psiSeries_term_le (abs_le.mpr hv) k + +theorem psiSeries_eq_psi {v : ℝ} (hv : |v| ≤ 1) : psiSeries v = psi v := by + have h : EqOn psiSeries psi (Ioo (-1) 1) := by + intro x hx + exact (hasSum_psi (abs_lt.mpr hx)).tsum_eq + have h' := h.of_subset_closure continuousOn_psiSeries continuous_psi.continuousOn + Ioo_subset_Icc_self (show Icc (-1 : ℝ) 1 ⊆ closure (Ioo (-1) 1) by + rw [closure_Ioo (by norm_num : (-1 : ℝ) ≠ 1)]) + exact h' (abs_le.mp hv) + +theorem hasSum_psi_closed {v : ℝ} (hv : |v| ≤ 1) : + HasSum (fun k : ℕ => psiCoeff k * v ^ (2 * (k + 1))) (psi v) := by + rw [← psiSeries_eq_psi hv] + exact (summable_psi_closed hv).hasSum + +theorem hasSum_psiCoeff : HasSum psiCoeff ell := by + simpa using hasSum_psi_closed (v := 1) (by norm_num) + +theorem tsum_psiCoeff : ∑' k : ℕ, psiCoeff k = ell := hasSum_psiCoeff.tsum_eq + +theorem half_sq_le_psi {v : ℝ} (hv : |v| ≤ 1) : v ^ 2 / 2 ≤ psi v := by + have h := (summable_psi_closed hv).sum_le_tsum {0} (fun k hk => + mul_nonneg (psiCoeff_nonneg k) (Even.pow_nonneg (even_two_mul (k + 1)) v)) + rw [(hasSum_psi_closed hv).tsum_eq] at h + simpa [psiCoeff_zero, div_eq_mul_inv, mul_comm] using h + +theorem psi_le_ell_mul_sq {v : ℝ} (hv : |v| ≤ 1) : psi v ≤ ell * v ^ 2 := by + have hsq : v ^ 2 ≤ 1 := by + have h := abs_le.mp hv + nlinarith [mul_nonneg (sub_nonneg.mpr h.2) (show 0 ≤ 1 + v by linarith [h.1])] + apply hasSum_le _ (hasSum_psi_closed hv) (hasSum_psiCoeff.mul_right (v ^ 2)) + intro k + apply mul_le_mul_of_nonneg_left _ (psiCoeff_nonneg k) + rw [show 2 * (k + 1) = 2 * k + 2 by omega, pow_add, pow_mul] + exact mul_le_of_le_one_left (sq_nonneg v) (pow_le_one₀ (sq_nonneg v) hsq) + +theorem ell_mul_one_sub_sq_le_entropy {v : ℝ} (hv : |v| ≤ 1) : + ell * (1 - v ^ 2) ≤ entropy v := by + have h := psi_le_ell_mul_sq hv + unfold entropy + nlinarith + +end LeanBlast.CourtadeKumar + +end + +end OAI diff --git a/lean/OAI/InformationTheory/BooleanNoise/EntropyScalars.lean b/lean/OAI/InformationTheory/BooleanNoise/EntropyScalars.lean new file mode 100644 index 0000000000000000000000000000000000000000..8c4979ea3aee65b101c680d2544c757b86fd7cb1 --- /dev/null +++ b/lean/OAI/InformationTheory/BooleanNoise/EntropyScalars.lean @@ -0,0 +1,163 @@ +import OAI.InformationTheory.BooleanNoise.Basic +import Mathlib.Analysis.SpecialFunctions.BinaryEntropy + +namespace OAI + +noncomputable section + +open Set Filter +open scoped Topology + +namespace LeanBlast.CourtadeKumar + +theorem ell_pos : 0 < ell := Real.log_pos (by norm_num) + +theorem ell_lt_one : ell < 1 := by + have h := Real.log_lt_sub_one_of_pos (x := 2) (by norm_num) (by norm_num) + norm_num at h + exact h + +@[simp] theorem psi_zero : psi 0 = 0 := by norm_num [psi] +@[simp] theorem psi_one : psi 1 = ell := by norm_num [psi, ell] + +@[simp] theorem psi_neg (v : ℝ) : psi (-v) = psi v := by + simp only [psi, sub_eq_add_neg, neg_neg] + ring + +@[simp] theorem psi_neg_one : psi (-1) = ell := by rw [psi_neg, psi_one] + +@[simp] theorem entropy_zero : entropy 0 = ell := by simp [entropy] +@[simp] theorem entropy_one : entropy 1 = 0 := by simp [entropy] +@[simp] theorem entropy_neg (v : ℝ) : entropy (-v) = entropy v := by simp [entropy] +@[simp] theorem entropy_neg_one : entropy (-1) = 0 := by simp + +theorem entropy_eq_binEntropy (v : ℝ) : + entropy v = Real.binEntropy ((1 + v) / 2) := by + have hs (t : ℝ) : Real.negMulLog (t / 2) = + -(t / 2) * Real.log t + (t / 2) * ell := by + calc + _ = (2 : ℝ)⁻¹ * Real.negMulLog t + t * Real.negMulLog ((2 : ℝ)⁻¹) := by + simpa [div_eq_mul_inv] using Real.negMulLog_mul t ((2 : ℝ)⁻¹) + _ = _ := by simp [Real.negMulLog, ell, Real.log_inv]; ring + rw [Real.binEntropy_eq_negMulLog_add_negMulLog_one_sub] + rw [show 1 - (1 + v) / 2 = (1 - v) / 2 by ring, hs, hs] + unfold entropy psi + ring + +theorem continuous_entropy : Continuous entropy := by + have h : entropy = fun v => Real.binEntropy ((1 + v) / 2) := + funext entropy_eq_binEntropy + rw [h] + fun_prop + +theorem continuous_psi : Continuous psi := by + have h : psi = fun v => ell - entropy v := by ext v; simp [entropy] + rw [h] + exact continuous_const.sub continuous_entropy + +theorem psi_nonneg (v : ℝ) : 0 ≤ psi v := by + have h := Real.binEntropy_le_log_two (p := (1 + v) / 2) + rw [← entropy_eq_binEntropy] at h + unfold entropy ell at * + linarith + +theorem entropy_le_ell (v : ℝ) : entropy v ≤ ell := by + exact sub_le_self _ (psi_nonneg v) + +theorem entropy_nonneg {v : ℝ} (hv : v ∈ Icc (-1) 1) : 0 ≤ entropy v := by + rw [entropy_eq_binEntropy] + exact Real.binEntropy_nonneg (by linarith [hv.1]) (by linarith [hv.2]) + +theorem entropy_pos {v : ℝ} (hv : v ∈ Ioo (-1) 1) : 0 < entropy v := by + rw [entropy_eq_binEntropy] + exact Real.binEntropy_pos (by linarith [hv.1]) (by linarith [hv.2]) + +theorem psi_le_ell {v : ℝ} (hv : v ∈ Icc (-1) 1) : psi v ≤ ell := by + have := entropy_nonneg hv + unfold entropy at this + linarith + +theorem psi_lt_ell {v : ℝ} (hv : v ∈ Ioo (-1) 1) : psi v < ell := by + have := entropy_pos hv + unfold entropy at this + linarith + +theorem strictMonoOn_psi : StrictMonoOn psi (Icc 0 1) := by + intro x hx y hy hxy + have h := Real.binEntropy_strictAntiOn + (show (1 + x) / 2 ∈ Icc ((2 : ℝ)⁻¹) 1 by constructor <;> linarith [hx.1, hx.2]) + (show (1 + y) / 2 ∈ Icc ((2 : ℝ)⁻¹) 1 by constructor <;> linarith [hy.1, hy.2]) + (show (1 + x) / 2 < (1 + y) / 2 by linarith) + rw [← entropy_eq_binEntropy, ← entropy_eq_binEntropy] at h + unfold entropy at h + linarith + +theorem concaveOn_entropy : ConcaveOn ℝ (Icc (-1) 1) entropy := by + refine ⟨convex_Icc (-1) 1, ?_⟩ + intro x hx y hy a b ha hb hab + have hx' : (1 + x) / 2 ∈ Icc (0 : ℝ) 1 := by + constructor <;> linarith [hx.1, hx.2] + have hy' : (1 + y) / 2 ∈ Icc (0 : ℝ) 1 := by + constructor <;> linarith [hy.1, hy.2] + have h := Real.strictConcave_binEntropy.concaveOn.2 hx' hy' ha hb hab + simp only [smul_eq_mul] at h ⊢ + rw [entropy_eq_binEntropy, entropy_eq_binEntropy, entropy_eq_binEntropy] + convert h using 1 + congr 1 + nlinarith + +theorem convexOn_psi : ConvexOn ℝ (Icc (-1) 1) psi := by + have h := concaveOn_entropy.neg.add (convexOn_const ell (convex_Icc (-1 : ℝ) 1)) + convert h using 1 + ext v + simp [entropy] + +theorem artanh_eq_log_sub {v : ℝ} (hv : v ∈ Ioo (-1) 1) : + Real.artanh v = (Real.log (1 + v) - Real.log (1 - v)) / 2 := by + rw [Real.artanh_eq_half_log ⟨hv.1.le, hv.2.le⟩, + Real.log_div (by linarith [hv.1]) (by linarith [hv.2])] + ring + +theorem hasDerivAt_psi {v : ℝ} (hv : v ∈ Ioo (-1) 1) : + HasDerivAt psi (Real.artanh v) v := by + have hp : 1 + v ≠ 0 := by linarith [hv.1] + have hm : 1 - v ≠ 0 := by linarith [hv.2] + have h1 := ((Real.hasDerivAt_mul_log hp).comp v + ((hasDerivAt_id v).const_add 1)).div_const 2 + have h2 := ((Real.hasDerivAt_mul_log hm).comp v + ((hasDerivAt_id v).const_sub 1)).div_const 2 + convert h1.add h2 using 1 + · ext u + dsimp [psi] + ring + · rw [artanh_eq_log_sub hv] + ring + +theorem hasDerivAt_entropy {v : ℝ} (hv : v ∈ Ioo (-1) 1) : + HasDerivAt entropy (-Real.artanh v) v := by + exact (hasDerivAt_psi hv).const_sub ell + +theorem hasDerivAt_artanh {v : ℝ} (hv : v ∈ Ioo (-1) 1) : + HasDerivAt Real.artanh (1 / (1 - v ^ 2)) v := by + have hp : 1 + v ≠ 0 := by linarith [hv.1] + have hm : 1 - v ≠ 0 := by linarith [hv.2] + have hq : 1 - v ^ 2 ≠ 0 := by + have hp' : 0 < 1 + v := by linarith [hv.1] + have hm' : 0 < 1 - v := by linarith [hv.2] + nlinarith [mul_pos hp' hm'] + have h := ((((hasDerivAt_id v).const_add 1).log hp).sub + (((hasDerivAt_id v).const_sub 1).log hm)).div_const 2 + have he : Real.artanh =ᶠ[𝓝 v] + (fun u => (Real.log (1 + u) - Real.log (1 - u)) / 2) := by + filter_upwards [Ioo_mem_nhds hv.1 hv.2] with u hu + exact artanh_eq_log_sub hu + apply (h.congr_of_eventuallyEq he).congr_deriv + change (1 / (1 + v) - -1 / (1 - v)) / 2 = 1 / (1 - v ^ 2) + field_simp [hp, hm, hq] + ring + +end LeanBlast.CourtadeKumar + +end + +end OAI diff --git a/lean/OAI/InformationTheory/BooleanNoise/EntropySeries.lean b/lean/OAI/InformationTheory/BooleanNoise/EntropySeries.lean new file mode 100644 index 0000000000000000000000000000000000000000..796c879521b49d34d5591b25ff7374e73b3e9e48 --- /dev/null +++ b/lean/OAI/InformationTheory/BooleanNoise/EntropySeries.lean @@ -0,0 +1,102 @@ +import OAI.InformationTheory.BooleanNoise.EntropyScalars +import Mathlib.Analysis.PSeries + +namespace OAI + +noncomputable section + +open Set Filter Finset +open scoped Topology BigOperators + +namespace LeanBlast.CourtadeKumar + +def psiCoeff (k : ℕ) : ℝ := 1 / ((2 * (k : ℝ) + 2) * (2 * (k : ℝ) + 1)) + +theorem psiCoeff_pos (k : ℕ) : 0 < psiCoeff k := by unfold psiCoeff; positivity + +theorem psiCoeff_nonneg (k : ℕ) : 0 ≤ psiCoeff k := (psiCoeff_pos k).le + +@[simp] theorem psiCoeff_zero : psiCoeff 0 = 1 / 2 := by norm_num [psiCoeff] + +theorem hasSum_artanh {v : ℝ} (hv : |v| < 1) : + HasSum (fun k : ℕ => v ^ (2 * k + 1) / (2 * (k : ℝ) + 1)) (Real.artanh v) := by + have h := (Real.hasSum_log_sub_log_of_abs_lt_one hv).mul_left (1 / 2) + convert h using 1 + · ext k + ring + · rw [artanh_eq_log_sub (abs_lt.mp hv)] + ring + +theorem hasSum_mul_artanh {v : ℝ} (hv : |v| < 1) : + HasSum (fun k : ℕ => (2 * ((k : ℝ) + 1)) * psiCoeff k * v ^ (2 * (k + 1))) + (v * Real.artanh v) := by + have h := (hasSum_artanh hv).mul_left v + convert h using 1 + ext k + have h1 : 2 * (k : ℝ) + 1 ≠ 0 := by positivity + have h2 : 2 * (k : ℝ) + 2 ≠ 0 := by positivity + rw [show 2 * (k + 1) = (2 * k + 1) + 1 by omega, pow_succ] + unfold psiCoeff + field_simp + +theorem psi_eq_mul_artanh_add_log {v : ℝ} (hv : |v| < 1) : + psi v = v * Real.artanh v + 1 / 2 * Real.log (1 - v ^ 2) := by + have hp : 1 + v ≠ 0 := by linarith [(abs_lt.mp hv).1] + have hm : 1 - v ≠ 0 := by linarith [(abs_lt.mp hv).2] + have hl : Real.log (1 - v ^ 2) = Real.log (1 + v) + Real.log (1 - v) := by + rw [← Real.log_mul hp hm] + congr 1 + ring + rw [artanh_eq_log_sub (abs_lt.mp hv), hl] + unfold psi + ring + +theorem hasSum_psi {v : ℝ} (hv : |v| < 1) : + HasSum (fun k : ℕ => psiCoeff k * v ^ (2 * (k + 1))) (psi v) := by + have hv2 : |v ^ 2| < 1 := by + rw [abs_of_nonneg (sq_nonneg v)] + have h1 : 0 < 1 + v := by linarith [(abs_lt.mp hv).1] + have h2 : 0 < 1 - v := by linarith [(abs_lt.mp hv).2] + nlinarith [mul_pos h1 h2] + have h := ((hasSum_artanh hv).mul_left v).add + ((Real.hasSum_pow_div_log_of_abs_lt_one hv2).mul_left (-(1 / 2))) + convert h using 1 + · ext k + have h1 : 2 * (k : ℝ) + 1 ≠ 0 := by positivity + have h2 : (k : ℝ) + 1 ≠ 0 := by positivity + have h3 : 2 * (k : ℝ) + 2 ≠ 0 := by positivity + rw [← pow_mul, show 2 * (k + 1) = (2 * k + 1) + 1 by omega, pow_succ] + unfold psiCoeff + field_simp + ring + · rw [psi_eq_mul_artanh_add_log hv] + ring + +theorem sum_range_artanh_le {v : ℝ} (hv0 : 0 ≤ v) (hv1 : v < 1) (m : ℕ) : + (∑ k ∈ Finset.range m, v ^ (2 * k + 1) / (2 * (k : ℝ) + 1)) ≤ Real.artanh v := by + have h := hasSum_artanh (show |v| < 1 by rwa [abs_of_nonneg hv0]) + rw [← h.tsum_eq] + exact h.summable.sum_le_tsum (Finset.range m) (fun k hk => by positivity) + +theorem sum_range_psi_le {v : ℝ} (hv : |v| < 1) (m : ℕ) : + (∑ k ∈ Finset.range m, psiCoeff k * v ^ (2 * (k + 1))) ≤ psi v := by + have h := hasSum_psi hv + rw [← h.tsum_eq] + exact h.summable.sum_le_tsum (Finset.range m) (fun k hk => + mul_nonneg (psiCoeff_nonneg k) (Even.pow_nonneg (even_two_mul (k + 1)) v)) + +theorem summable_psiCoeff : Summable psiCoeff := by + have h : Summable (fun k : ℕ => 1 / ((k : ℝ) + 1) ^ 2) := by + simpa only [Nat.cast_add, Nat.cast_one] using + (summable_nat_add_iff 1).mpr (Real.summable_one_div_nat_pow.mpr (by norm_num : 1 < 2)) + apply Summable.of_nonneg_of_le psiCoeff_nonneg ?_ h + intro k + unfold psiCoeff + apply one_div_le_one_div_of_le (by positivity) + nlinarith [sq_nonneg (k : ℝ), Nat.cast_nonneg (α := ℝ) k] + +end LeanBlast.CourtadeKumar + +end + +end OAI diff --git a/lean/OAI/InformationTheory/BooleanNoise/FiniteDistribution.lean b/lean/OAI/InformationTheory/BooleanNoise/FiniteDistribution.lean new file mode 100644 index 0000000000000000000000000000000000000000..913c8374392649e6a47c24680a865db0bc395d2d --- /dev/null +++ b/lean/OAI/InformationTheory/BooleanNoise/FiniteDistribution.lean @@ -0,0 +1,132 @@ +import OAI.InformationTheory.BooleanNoise.Statement +import OAI.InformationTheory.BooleanNoise.FiniteNoise + +namespace OAI + +noncomputable section + +open scoped BigOperators + +namespace LeanBlast.CourtadeKumar + +variable {n : ℕ} + +def signProbability (v : ℝ) (b : Bool) : ℝ := + if b then (1 + v) / 2 else (1 - v) / 2 + +theorem sum_signProbability (v : ℝ) : (∑ b : Bool, signProbability v b) = 1 := by + simp only [Fintype.sum_bool, signProbability, Bool.false_eq_true, ite_false, ite_true] + ring + +theorem signProbability_signEncoding (f : Cube n → Bool) (x : Cube n) (b : Bool) : + signProbability (signEncoding f x) b = if f x = b then 1 else 0 := by + cases b <;> cases hfx : f x <;> simp [signProbability, signEncoding, hfx] + +theorem noiseOperator_signProbability (u : ℝ) (g : Cube n → ℝ) (b : Bool) (x : Cube n) : + noiseOperator u (fun y => signProbability (g y) b) x = + signProbability (noiseOperator u g x) b := by + cases b + · change noiseOperator u (fun y => (1 - g y) / 2) x = (1 - noiseOperator u g x) / 2 + have hfun : (fun y => (1 - g y) / 2) = (fun y => (1 / 2 : ℝ) * (1 - g y)) := by + funext y + ring + rw [hfun, noiseOperator_smul, noiseOperator_sub, noiseOperator_const] + ring + · change noiseOperator u (fun y => (1 + g y) / 2) x = (1 + noiseOperator u g x) / 2 + have hfun : (fun y => (1 + g y) / 2) = (fun y => (1 / 2 : ℝ) * (1 + g y)) := by + funext y + ring + rw [hfun, noiseOperator_smul, noiseOperator_add, noiseOperator_const] + ring + +theorem cubeAverage_signProbability (g : Cube n → ℝ) (b : Bool) : + cubeAverage (fun x => signProbability (g x) b) = signProbability (cubeAverage g) b := by + cases b + · change cubeAverage (fun y => (1 - g y) / 2) = (1 - cubeAverage g) / 2 + have hfun : (fun y => (1 - g y) / 2) = (fun y => (1 / 2 : ℝ) * (1 - g y)) := by + funext y + ring + rw [hfun, cubeAverage_smul, cubeAverage_sub, cubeAverage_const] + ring + · change cubeAverage (fun y => (1 + g y) / 2) = (1 + cubeAverage g) / 2 + have hfun : (fun y => (1 + g y) / 2) = (fun y => (1 / 2 : ℝ) * (1 + g y)) := by + funext y + ring + rw [hfun, cubeAverage_smul, cubeAverage_add, cubeAverage_const] + ring + +theorem bitFlipKernel_eq_noiseKernel (ε : ℝ) (x y : Cube n) : + bitFlipKernel ε x y = noiseKernel (1 - 2 * ε) x y := by + unfold bitFlipKernel noiseKernel + apply Finset.prod_congr rfl + intro i _ + split_ifs <;> ring + +theorem bitFlipKernel_nonneg {ε : ℝ} (hε0 : 0 ≤ ε) (hεhalf : ε ≤ (1 : ℝ) / 2) + (x y : Cube n) : 0 ≤ bitFlipKernel ε x y := by + rw [bitFlipKernel_eq_noiseKernel] + exact noiseKernel_nonneg (by linarith) (by linarith) x y + +theorem jointProbability_eq_posterior (ε : ℝ) (f : Cube n → Bool) (b : Bool) (y : Cube n) : + jointProbability ε f b y = + signProbability (noiseOperator (1 - 2 * ε) (signEncoding f) y) b / (2 : ℝ) ^ n := by + have hterm (x : Cube n) : + (if f x = b then bitFlipKernel ε x y else 0) = + noiseKernel (1 - 2 * ε) y x * signProbability (signEncoding f x) b := by + rw [signProbability_signEncoding] + by_cases h : f x = b + · simp only [h, ite_true, mul_one, bitFlipKernel_eq_noiseKernel] + exact noiseKernel_symm _ x y + · simp [h] + unfold jointProbability cubeAverage + simp_rw [hterm] + change noiseOperator (1 - 2 * ε) (fun x => signProbability (signEncoding f x) b) y / + (2 : ℝ) ^ n = _ + rw [noiseOperator_signProbability] + +theorem functionMarginal_eq_signProbability (ε : ℝ) (f : Cube n → Bool) (b : Bool) : + functionMarginal ε f b = signProbability (cubeAverage (signEncoding f)) b := by + unfold functionMarginal + simp_rw [jointProbability_eq_posterior] + rw [← Finset.sum_div] + change cubeAverage (fun y => signProbability (noiseOperator (1 - 2 * ε) (signEncoding f) y) b) = _ + rw [cubeAverage_signProbability, cubeAverage_noiseOperator] + +theorem observationMarginal_eq_uniform (ε : ℝ) (f : Cube n → Bool) (y : Cube n) : + observationMarginal ε f y = 1 / (2 : ℝ) ^ n := by + unfold observationMarginal + simp_rw [jointProbability_eq_posterior] + rw [← Finset.sum_div, sum_signProbability] + +theorem observationMarginal_pos (ε : ℝ) (f : Cube n → Bool) (y : Cube n) : + 0 < observationMarginal ε f y := by + rw [observationMarginal_eq_uniform] + exact div_pos zero_lt_one (cube_denominator_pos n) + +theorem conditionalProbability_eq_signProbability (ε : ℝ) (f : Cube n → Bool) + (b : Bool) (y : Cube n) : + jointProbability ε f b y / observationMarginal ε f y = + signProbability (noiseOperator (1 - 2 * ε) (signEncoding f) y) b := by + rw [jointProbability_eq_posterior, observationMarginal_eq_uniform] + field_simp + +theorem jointProbability_nonneg (ε : ℝ) (f : Cube n → Bool) + (hε0 : 0 ≤ ε) (hεhalf : ε ≤ (1 : ℝ) / 2) (b : Bool) (y : Cube n) : + 0 ≤ jointProbability ε f b y := by + apply cubeAverage_nonneg + intro x + split_ifs + · exact bitFlipKernel_nonneg hε0 hεhalf x y + · exact le_refl 0 + +theorem jointProbability_sum (ε : ℝ) (f : Cube n → Bool) : + (∑ b : Bool, ∑ y : Cube n, jointProbability ε f b y) = 1 := by + change (∑ b : Bool, functionMarginal ε f b) = 1 + simp_rw [functionMarginal_eq_signProbability] + exact sum_signProbability _ + +end LeanBlast.CourtadeKumar + +end + +end OAI diff --git a/lean/OAI/InformationTheory/BooleanNoise/FiniteInformation.lean b/lean/OAI/InformationTheory/BooleanNoise/FiniteInformation.lean new file mode 100644 index 0000000000000000000000000000000000000000..54a038b917c8635ab297bf49405a4b8b84f8e42d --- /dev/null +++ b/lean/OAI/InformationTheory/BooleanNoise/FiniteInformation.lean @@ -0,0 +1,61 @@ +import OAI.InformationTheory.BooleanNoise.Statement + +namespace OAI + +noncomputable section + +open scoped BigOperators + +universe u v + +namespace LeanBlast.CourtadeKumar + +theorem xlogx_mul (a b : ℝ) : + xlogx (a * b) = a * xlogx b + b * xlogx a := by + by_cases ha : a = 0 + · simp [ha, xlogx] + by_cases hb : b = 0 + · simp [hb, xlogx] + simp only [xlogx, Real.log_mul ha hb] + ring + +theorem finite_kl_eq_entropy_sums {A : Type u} {B : Type v} [Fintype A] [Fintype B] + (j : A → B → ℝ) (hj : ∀ a b, 0 ≤ j a b) : + (∑ a : A, ∑ b : B, + if 0 < j a b then j a b * Real.log + (j a b / ((∑ z : B, j a z) * (∑ z : A, j z b))) else 0) = + (∑ a : A, ∑ b : B, xlogx (j a b)) - + (∑ a : A, xlogx (∑ b : B, j a b)) - + (∑ b : B, xlogx (∑ a : A, j a b)) := by + classical + have hterm (a : A) (b : B) : + (if 0 < j a b then j a b * Real.log + (j a b / ((∑ z : B, j a z) * (∑ z : A, j z b))) else 0) = + xlogx (j a b) - j a b * Real.log (∑ z : B, j a z) - + j a b * Real.log (∑ z : A, j z b) := by + by_cases hp : 0 < j a b + · have hr : 0 < ∑ z : B, j a z := lt_of_lt_of_le hp + (Finset.single_le_sum (fun z _ => hj a z) (Finset.mem_univ b)) + have hc : 0 < ∑ z : A, j z b := lt_of_lt_of_le hp + (Finset.single_le_sum (fun z _ => hj z b) (Finset.mem_univ a)) + rw [ite_eq_left hp, Real.log_div (ne_of_gt hp) (ne_of_gt (mul_pos hr hc)), + Real.log_mul (ne_of_gt hr) (ne_of_gt hc)] + unfold xlogx + ring + · have hz : j a b = 0 := le_antisymm (le_of_not_gt hp) (hj a b) + simp [hz, xlogx] + have hrow : (∑ a : A, ∑ b : B, j a b * Real.log (∑ z : B, j a z)) = + ∑ a : A, xlogx (∑ b : B, j a b) := by + simp only [xlogx, Finset.sum_mul] + have hcol : (∑ a : A, ∑ b : B, j a b * Real.log (∑ z : A, j z b)) = + ∑ b : B, xlogx (∑ a : A, j a b) := by + rw [Finset.sum_comm] + simp only [xlogx, Finset.sum_mul] + simp_rw [hterm, Finset.sum_sub_distrib] + rw [hrow, hcol] + +end LeanBlast.CourtadeKumar + +end + +end OAI diff --git a/lean/OAI/InformationTheory/BooleanNoise/FiniteNoise.lean b/lean/OAI/InformationTheory/BooleanNoise/FiniteNoise.lean new file mode 100644 index 0000000000000000000000000000000000000000..2ee75e8a6187fe5d941a5582c82a0c40fe905acd --- /dev/null +++ b/lean/OAI/InformationTheory/BooleanNoise/FiniteNoise.lean @@ -0,0 +1,258 @@ +import OAI.InformationTheory.BooleanNoise.Basic +import Mathlib.Algebra.BigOperators.Ring.Finset +import Mathlib.Algebra.Order.BigOperators.Group.Finset +import Mathlib.Tactic.Linarith +import Mathlib.Tactic.Positivity +import Mathlib.Tactic.Ring + +namespace OAI + +open scoped BigOperators + +noncomputable section + +universe u + +namespace LeanBlast.CourtadeKumar + +variable {n : ℕ} + +@[simp] theorem card_cube (n : ℕ) : Fintype.card (Cube n) = 2 ^ n := + LeanBlast.GotsmanLinial.card_cube n + +theorem cube_denominator_pos (n : ℕ) : 0 < (2 : ℝ) ^ n := by positivity + +@[simp] theorem cubeAverage_const (n : ℕ) (c : ℝ) : + cubeAverage (fun _ : Cube n => c) = c := by + simp [cubeAverage] + +theorem cubeAverage_zeroDim (g : Cube 0 → ℝ) : + cubeAverage g = g (fun _ => false) := by + simp only [cubeAverage, pow_zero, div_one, Fintype.sum_unique] + exact congrArg g (Subsingleton.elim _ _) + +theorem cubeAverage_add (g h : Cube n → ℝ) : + cubeAverage (fun x => g x + h x) = cubeAverage g + cubeAverage h := by + simp [cubeAverage, Finset.sum_add_distrib, add_div] + +theorem cubeAverage_sub (g h : Cube n → ℝ) : + cubeAverage (fun x => g x - h x) = cubeAverage g - cubeAverage h := by + simp [cubeAverage, Finset.sum_sub_distrib, sub_div] + +theorem cubeAverage_neg (g : Cube n → ℝ) : + cubeAverage (fun x => -g x) = -cubeAverage g := by + simp [cubeAverage, neg_div] + +theorem cubeAverage_smul (c : ℝ) (g : Cube n → ℝ) : + cubeAverage (fun x => c * g x) = c * cubeAverage g := by + simp [cubeAverage, ← Finset.mul_sum, mul_div_assoc] + +theorem cubeAverage_sum {ι : Type u} [Fintype ι] (f : ι → Cube n → ℝ) : + cubeAverage (fun x => ∑ i, f i x) = ∑ i, cubeAverage (f i) := by + simp only [cubeAverage, Finset.sum_div] + exact Finset.sum_comm + +theorem cubeAverage_nonneg {g : Cube n → ℝ} (hg : ∀ x, 0 ≤ g x) : + 0 ≤ cubeAverage g := + div_nonneg (Finset.sum_nonneg fun x _ => hg x) (le_of_lt (cube_denominator_pos n)) + +theorem cubeAverage_mono {g h : Cube n → ℝ} (hgh : ∀ x, g x ≤ h x) : + cubeAverage g ≤ cubeAverage h := by + exact div_le_div_of_nonneg_right (Finset.sum_le_sum fun x _ => hgh x) + (le_of_lt (cube_denominator_pos n)) + +theorem cubeAverage_strict_mono {g h : Cube n → ℝ} (hgh : ∀ x, g x ≤ h x) + (hlt : ∃ x, g x < h x) : cubeAverage g < cubeAverage h := by + apply (div_lt_div_iff_of_pos_right (cube_denominator_pos n)).2 + apply Finset.sum_lt_sum (fun x _ => hgh x) + obtain ⟨x, hx⟩ := hlt + exact ⟨x, Finset.mem_univ x, hx⟩ + +theorem cubeAverage_lt {g h : Cube n → ℝ} (hgh : ∀ x, g x < h x) : + cubeAverage g < cubeAverage h := by + exact cubeAverage_strict_mono (fun x => (hgh x).le) ⟨fun _ => false, hgh _⟩ + +theorem IsInterior.cubeAverage {g : Cube n → ℝ} (hg : IsInterior g) : + -1 < cubeAverage g ∧ cubeAverage g < 1 := by + constructor + · simpa using cubeAverage_lt (fun x => (hg x).1) + · simpa using cubeAverage_lt (fun x => (hg x).2) + +theorem cubeAverage_le_const {g : Cube n → ℝ} {c : ℝ} (hg : ∀ x, g x ≤ c) : + cubeAverage g ≤ c := by + simpa using cubeAverage_mono hg + +theorem const_le_cubeAverage {g : Cube n → ℝ} {c : ℝ} (hg : ∀ x, c ≤ g x) : + c ≤ cubeAverage g := by + simpa using cubeAverage_mono hg + +theorem noiseKernel_symm (u : ℝ) (x y : Cube n) : + noiseKernel u x y = noiseKernel u y x := by + apply Finset.prod_congr rfl + intro i _ + by_cases h : x i = y i + · rw [ite_eq_left h, ite_eq_left h.symm] + · rw [ite_eq_right h, ite_eq_right (Ne.symm h)] + +theorem noiseKernel_nonneg {u : ℝ} (hu0 : 0 ≤ u) (hu1 : u ≤ 1) + (x y : Cube n) : 0 ≤ noiseKernel u x y := by + apply Finset.prod_nonneg + intro i _ + split_ifs <;> linarith + +theorem noiseKernel_pos {u : ℝ} (hu0 : 0 ≤ u) (hu1 : u < 1) + (x y : Cube n) : 0 < noiseKernel u x y := by + apply Finset.prod_pos + intro i _ + split_ifs <;> linarith + +theorem noiseKernel_row_sum (u : ℝ) (x : Cube n) : + ∑ y, noiseKernel u x y = 1 := by + unfold noiseKernel + rw [← Fintype.prod_sum (fun (i : Fin n) (b : Bool) => + if x i = b then (1 + u) / 2 else (1 - u) / 2)] + have hfactor : ∀ i : Fin n, + (∑ b : Bool, if x i = b then (1 + u) / 2 else (1 - u) / 2) = 1 := by + intro i + cases x i <;> simp <;> ring + simp_rw [hfactor] + simp + +theorem noiseKernel_col_sum (u : ℝ) (y : Cube n) : + ∑ x, noiseKernel u x y = 1 := by + simp_rw [noiseKernel_symm u] + exact noiseKernel_row_sum u y + +theorem noiseKernel_split_coord (u : ℝ) (x y : Cube n) (i : Fin n) : + noiseKernel u x y = + (if x i = y i then (1 + u) / 2 else (1 - u) / 2) * + ∏ j ∈ Finset.univ.erase i, if x j = y j then (1 + u) / 2 else (1 - u) / 2 := by + exact (Finset.mul_prod_erase _ _ (Finset.mem_univ i)).symm + +@[simp] theorem noiseOperator_const (u c : ℝ) (x : Cube n) : + noiseOperator u (fun _ => c) x = c := by + rw [noiseOperator, ← Finset.sum_mul, noiseKernel_row_sum, one_mul] + +theorem noiseOperator_add (u : ℝ) (g h : Cube n → ℝ) (x : Cube n) : + noiseOperator u (fun y => g y + h y) x = noiseOperator u g x + noiseOperator u h x := by + simp [noiseOperator, mul_add, Finset.sum_add_distrib] + +theorem noiseOperator_sub (u : ℝ) (g h : Cube n → ℝ) (x : Cube n) : + noiseOperator u (fun y => g y - h y) x = noiseOperator u g x - noiseOperator u h x := by + simp [noiseOperator, mul_sub, Finset.sum_sub_distrib] + +theorem noiseOperator_neg (u : ℝ) (g : Cube n → ℝ) (x : Cube n) : + noiseOperator u (fun y => -g y) x = -noiseOperator u g x := by + simp [noiseOperator] + +theorem noiseOperator_smul (u c : ℝ) (g : Cube n → ℝ) (x : Cube n) : + noiseOperator u (fun y => c * g y) x = c * noiseOperator u g x := by + simp [noiseOperator, Finset.mul_sum, mul_left_comm] + +theorem cubeAverage_noiseOperator (u : ℝ) (g : Cube n → ℝ) : + cubeAverage (noiseOperator u g) = cubeAverage g := by + unfold cubeAverage noiseOperator + rw [Finset.sum_comm] + simp_rw [← Finset.sum_mul, noiseKernel_col_sum, one_mul] + +theorem noiseOperator_prod (u : ℝ) (f : Fin n → Bool → ℝ) (x : Cube n) : + noiseOperator u (fun y => ∏ i, f i (y i)) x = + ∏ i, ∑ b : Bool, (if x i = b then (1 + u) / 2 else (1 - u) / 2) * f i b := by + unfold noiseOperator noiseKernel + simp_rw [← Finset.prod_mul_distrib] + exact (Fintype.prod_sum (fun (i : Fin n) (b : Bool) => + (if x i = b then (1 + u) / 2 else (1 - u) / 2) * f i b)).symm + +@[simp] theorem noiseKernel_zero (x y : Cube n) : + noiseKernel 0 x y = 1 / (2 : ℝ) ^ n := by + simp [noiseKernel, one_div] + +@[simp] theorem noiseOperator_zero_correlation (g : Cube n → ℝ) (x : Cube n) : + noiseOperator 0 g x = cubeAverage g := by + simp only [noiseOperator, noiseKernel_zero, ← Finset.mul_sum] + unfold cubeAverage + ring + +@[simp] theorem noiseKernel_one (x y : Cube n) : + noiseKernel 1 x y = if x = y then 1 else 0 := by + simp only [noiseKernel, add_self_div_two, sub_self, zero_div] + rw [Fintype.prod_boole] + simp only [← funext_iff] + +@[simp] theorem noiseOperator_one (g : Cube n → ℝ) (x : Cube n) : + noiseOperator 1 g x = g x := by + simp [noiseOperator] + +theorem noiseOperator_mono {u : ℝ} (hu0 : 0 ≤ u) (hu1 : u ≤ 1) + {g h : Cube n → ℝ} (hgh : ∀ y, g y ≤ h y) (x : Cube n) : + noiseOperator u g x ≤ noiseOperator u h x := by + exact Finset.sum_le_sum fun y _ => + mul_le_mul_of_nonneg_left (hgh y) (noiseKernel_nonneg hu0 hu1 x y) + +theorem noiseOperator_bounds {u : ℝ} (hu0 : 0 ≤ u) (hu1 : u ≤ 1) + {g : Cube n → ℝ} (hg : ∀ y, -1 ≤ g y ∧ g y ≤ 1) (x : Cube n) : + -1 ≤ noiseOperator u g x ∧ noiseOperator u g x ≤ 1 := by + constructor + · simpa using noiseOperator_mono hu0 hu1 (fun y => (hg y).1) x + · simpa using noiseOperator_mono hu0 hu1 (fun y => (hg y).2) x + +theorem noiseOperator_strict_mono {u : ℝ} (hu0 : 0 ≤ u) (hu1 : u < 1) + {g h : Cube n → ℝ} (hgh : ∀ y, g y ≤ h y) (hlt : ∃ y, g y < h y) (x : Cube n) : + noiseOperator u g x < noiseOperator u h x := by + apply Finset.sum_lt_sum + · intro y _ + exact mul_le_mul_of_nonneg_left (hgh y) (le_of_lt (noiseKernel_pos hu0 hu1 x y)) + · obtain ⟨y, hy⟩ := hlt + exact ⟨y, Finset.mem_univ y, mul_lt_mul_of_pos_left hy (noiseKernel_pos hu0 hu1 x y)⟩ + +theorem exists_signs_of_nonconstant {g : Cube n → ℝ} (hg : IsSignValued g) + (hne : ∃ x y, g x ≠ g y) : (∃ x, g x = 1) ∧ (∃ y, g y = -1) := by + obtain ⟨x, y, hxy⟩ := hne + rcases hg x with hx | hx <;> rcases hg y with hy | hy + · exact False.elim (hxy (hx.trans hy.symm)) + · exact ⟨⟨x, hx⟩, ⟨y, hy⟩⟩ + · exact ⟨⟨y, hy⟩, ⟨x, hx⟩⟩ + · exact False.elim (hxy (hx.trans hy.symm)) + +theorem noiseOperator_isInterior_of_exists_signs {u : ℝ} (hu0 : 0 ≤ u) (hu1 : u < 1) + {g : Cube n → ℝ} (hg : IsSignValued g) + (hpos : ∃ x, g x = 1) (hneg : ∃ y, g y = -1) : + IsInterior (noiseOperator u g) := by + have hb : ∀ y, -1 ≤ g y ∧ g y ≤ 1 := by + intro y + rcases hg y with h | h <;> rw [h] <;> norm_num + intro x + constructor + · have hs : ∃ y, (-1 : ℝ) < g y := by + obtain ⟨y, hy⟩ := hpos + exact ⟨y, by rw [hy]; norm_num⟩ + simpa using noiseOperator_strict_mono hu0 hu1 (fun y => (hb y).1) hs x + · have hs : ∃ y, g y < (1 : ℝ) := by + obtain ⟨y, hy⟩ := hneg + exact ⟨y, by rw [hy]; norm_num⟩ + simpa using noiseOperator_strict_mono hu0 hu1 (fun y => (hb y).2) hs x + +theorem noiseOperator_isInterior {u : ℝ} (hu0 : 0 ≤ u) (hu1 : u < 1) + {g : Cube n → ℝ} (hg : IsSignValued g) (hne : ∃ x y, g x ≠ g y) : + IsInterior (noiseOperator u g) := by + obtain ⟨hp, hn⟩ := exists_signs_of_nonconstant hg hne + exact noiseOperator_isInterior_of_exists_signs hu0 hu1 hg hp hn + +theorem cubeAverage_mem_Ioo_of_signValued_nonconstant {g : Cube n → ℝ} + (hg : IsSignValued g) (hne : ∃ x y, g x ≠ g y) : + -1 < cubeAverage g ∧ cubeAverage g < 1 := by + simpa using noiseOperator_isInterior (u := 0) (by norm_num) (by norm_num) hg hne + (fun _ => false) + +theorem meanVariance_pos_of_signValued_nonconstant {g : Cube n → ℝ} + (hg : IsSignValued g) (hne : ∃ x y, g x ≠ g y) : 0 < meanVariance g := by + obtain ⟨hlo, hhi⟩ := cubeAverage_mem_Ioo_of_signValued_nonconstant hg hne + unfold meanVariance + nlinarith [sq_nonneg (cubeAverage g), mul_pos (by linarith : 0 < 1 - cubeAverage g) + (by linarith : 0 < 1 + cubeAverage g)] + +end LeanBlast.CourtadeKumar + +end + +end OAI diff --git a/lean/OAI/InformationTheory/BooleanNoise/GeneralDissipation.lean b/lean/OAI/InformationTheory/BooleanNoise/GeneralDissipation.lean new file mode 100644 index 0000000000000000000000000000000000000000..a7bc28bc9adcfbeb928c7c18b7a852294edc5cd5 --- /dev/null +++ b/lean/OAI/InformationTheory/BooleanNoise/GeneralDissipation.lean @@ -0,0 +1,171 @@ +import OAI.InformationTheory.BooleanNoise.Basic +import OAI.InformationTheory.BooleanNoise.JensenGaps +import OAI.InformationTheory.BooleanNoise.CubeVariance +import OAI.InformationTheory.BooleanNoise.InverseScalars +import OAI.InformationTheory.BooleanNoise.KRegularity +import Mathlib.Analysis.Calculus.Deriv.MeanValue +import Mathlib.Analysis.Calculus.Deriv.Shift +import Mathlib.Analysis.Convex.Function +import Mathlib.Tactic + +namespace OAI + +open Set + +namespace LeanBlast.CourtadeKumar + +theorem function_increment_le_of_lipschitz_deriv + (F : ℝ → ℝ) (C : ℝ) + (hcont : ContinuousOn F (Ici 0)) + (hdiff : ∀ x : ℝ, 0 < x → DifferentiableAt ℝ F x) + (hlip : ∀ x y : ℝ, 0 < x → 0 < y → + |deriv F x - deriv F y| ≤ C * |x - y|) + (hnonneg : ∀ x : ℝ, 0 ≤ x → 0 ≤ F x) + {Je Jm Sa : ℝ} (hJm : 0 ≤ Jm) (hJe : Jm ≤ Je) (hSa : 0 ≤ Sa) : + F (Je + Sa) - F (Je + Sa - Jm) ≤ F Je + C * Jm * Sa := by + let G : ℝ → ℝ := fun t => F (Je + t) - F (Je - Jm + t) + have hJe0 : 0 ≤ Je := hJm.trans hJe + have hbase : 0 ≤ Je - Jm := sub_nonneg.mpr hJe + have hGcont : ContinuousOn G (Ici 0) := by + apply ContinuousOn.sub + · exact hcont.comp (continuous_const.add continuous_id).continuousOn + (fun t ht => add_nonneg hJe0 ht) + · exact hcont.comp (continuous_const.add continuous_id).continuousOn + (fun t ht => add_nonneg hbase ht) + have hGderiv : ∀ t : ℝ, 0 < t → + HasDerivAt G (deriv F (Je + t) - deriv F (Je - Jm + t)) t := by + intro t ht + exact ((hdiff (Je + t) (add_pos_of_nonneg_of_pos hJe0 ht)).hasDerivAt.comp_const_add Je t).sub + ((hdiff (Je - Jm + t) (add_pos_of_nonneg_of_pos hbase ht)).hasDerivAt.comp_const_add + (Je - Jm) t) + have hGdiff : DifferentiableOn ℝ G (interior (Ici 0)) := by + intro t ht + have ht0 : 0 < t := by simpa only [interior_Ici, mem_Ioi] using ht + exact (hGderiv t ht0).differentiableAt.differentiableWithinAt + have hGbound : ∀ t ∈ interior (Ici 0), deriv G t ≤ C * Jm := by + intro t ht + have ht0 : 0 < t := by simpa only [interior_Ici, mem_Ioi] using ht + rw [(hGderiv t ht0).deriv] + calc + _ ≤ |deriv F (Je + t) - deriv F (Je - Jm + t)| := le_abs_self _ + _ ≤ C * |(Je + t) - (Je - Jm + t)| := + hlip _ _ (add_pos_of_nonneg_of_pos hJe0 ht0) (add_pos_of_nonneg_of_pos hbase ht0) + _ = C * Jm := by rw [show (Je + t) - (Je - Jm + t) = Jm by ring, abs_of_nonneg hJm] + have hstep := (convex_Ici (0 : ℝ)).image_sub_le_mul_sub_of_deriv_le + hGcont hGdiff hGbound 0 (by simp) Sa hSa hSa + simp only [G, add_zero, sub_zero] at hstep + rw [show Je - Jm + Sa = Je + Sa - Jm by ring] at hstep + linarith [hnonneg (Je - Jm) hbase] + +theorem general_dissipation_step_algebra (F : ℝ → ℝ) + {S Je Jm Sa V Drestr Dpair : ℝ} + (hrestr : 2 * (S - Jm) + F (S - Jm) ≤ Drestr) + (hpair : F Je + V ≤ Dpair - 2 * Jm) + (hvariance : Jm * Sa / ell ≤ V) + (hincrement : F S - F (S - Jm) ≤ F Je + Jm * Sa / ell) : + 2 * S + F S ≤ Drestr + Dpair := by + linarith + +theorem restriction_bound_of_convex (F : ℝ → ℝ) + (hF : ConvexOn ℝ (Ici 0) F) {S₁ S₀ D₁ D₀ : ℝ} + (hS₁ : 0 ≤ S₁) (hS₀ : 0 ≤ S₀) + (hD₁ : 2 * S₁ + F S₁ ≤ D₁) (hD₀ : 2 * S₀ + F S₀ ≤ D₀) : + 2 * ((S₁ + S₀) / 2) + F ((S₁ + S₀) / 2) ≤ (D₁ + D₀) / 2 := by + have hmid := hF.2 hS₁ hS₀ (by norm_num : (0 : ℝ) ≤ 1 / 2) + (by norm_num : (0 : ℝ) ≤ 1 / 2) (by norm_num) + simp only [smul_eq_mul] at hmid + rw [show (1 / 2 : ℝ) * S₁ + (1 / 2 : ℝ) * S₀ = (S₁ + S₀) / 2 by ring] at hmid + linarith + +theorem averaged_remainder_bound {n : ℕ} (F : ℝ → ℝ) + (hF : ConvexOn ℝ (Ici 0) F) (J d : Cube n → ℝ) + (hJ : ∀ x, 0 ≤ J x) (hpoint : ∀ x, F (J x) ≤ d x - 2 * J x) + {Jm V : ℝ} (hgap : V ≤ 2 * (cubeAverage J - Jm)) : + F (cubeAverage J) + V ≤ cubeAverage d - 2 * Jm := by + have havg : cubeAverage (fun x => F (J x)) ≤ cubeAverage (fun x => d x - 2 * J x) := by + exact div_le_div_of_nonneg_right (Finset.sum_le_sum (fun x _ => hpoint x)) (by positivity) + have hidentity : cubeAverage (fun x => d x - 2 * J x) = + cubeAverage d - 2 * cubeAverage J := by + simp [cubeAverage, Finset.sum_sub_distrib, ← Finset.mul_sum, sub_div, mul_div_assoc] + rw [hidentity] at havg + have hjensen := convexOn_cubeAverage_le F hF J hJ + linarith + +theorem general_dissipation_of_K_estimates + (hconvex : ConvexOn ℝ (Ici 0) K) + (hincrement : ∀ {Je Jm Sa : ℝ}, 0 ≤ Jm → Jm ≤ Je → 0 ≤ Sa → + K (Je + Sa) - K (Je + Sa - Jm) ≤ K Je + Jm * Sa / ell) + (hpoint : ∀ (a b : ℝ), |a| + |b| < 1 → + K (pairEntropyGap a b) ≤ pairDissipation a b - 2 * pairEntropyGap a b) : + ∀ {n : ℕ} (g : Cube n → ℝ), IsInterior g → + 2 * informationDeficit g + K (informationDeficit g) ≤ dissipation g := by + intro n + induction n with + | zero => + intro g _ + simp + | succ n ih => + intro g hg + let a := pairMean g + let b := pairHalfDifference g + let J := fun x => pairEntropyGap (a x) (b x) + let Je := cubeAverage J + let Jm := pairEntropyGap (cubeAverage a) (cubeAverage b) + let Sa := informationDeficit a + let V := cubeAverage (fun x => (b x) ^ 2 / (1 - (a x) ^ 2)) - + (cubeAverage b) ^ 2 / (1 - (cubeAverage a) ^ 2) + have hdom : ∀ x, |a x| + |b x| < 1 := hg.pairDomain + have hSa : 0 ≤ Sa := informationDeficit_nonneg hg.pairMean + have hJm : 0 ≤ Jm := pairEntropyGap_nonneg _ _ (cubeAverage_pairDomain hdom) + have hJmJe : Jm ≤ Je := pair_jensen_gap_nonneg a b hdom + have hrestr := restriction_bound_of_convex K hconvex + (informationDeficit_nonneg (hg.restrict true)) + (informationDeficit_nonneg (hg.restrict false)) + (ih (restrict g true) (hg.restrict true)) + (ih (restrict g false) (hg.restrict false)) + rw [informationDeficit_split] at hrestr + have hpairavg : K Je + V ≤ + cubeAverage (fun x => pairDissipation (a x) (b x)) - 2 * Jm := + averaged_remainder_bound K hconvex J (fun x => pairDissipation (a x) (b x)) + (fun x => pairEntropyGap_nonneg _ _ (hdom x)) + (fun x => hpoint _ _ (hdom x)) (pair_jensen_gap a b hdom) + have hvariance : Jm * Sa / ell ≤ V := entropy_product_le_variance_gap a b hdom + have hinc := hincrement hJm hJmJe hSa + have hS : informationDeficit g = Je + Sa := by + dsimp only [Je, J, Sa, a, b] + rw [informationDeficit_eq_pairMean_add] + ring + rw [← hS] at hinc + have htotal := general_dissipation_step_algebra K hrestr hpairavg hvariance hinc + rw [dissipation_split] + exact htotal + +theorem K_increment {Je Jm Sa : ℝ} + (hJm : 0 ≤ Jm) (hJe : Jm ≤ Je) (hSa : 0 ≤ Sa) : + K (Je + Sa) - K (Je + Sa - Jm) ≤ K Je + Jm * Sa / ell := by + have h := function_increment_le_of_lipschitz_deriv K (1 / ell) continuousOn_K + (fun x hx => (hasDerivAt_K hx.le).differentiableAt) + (fun x y hx hy => by + rw [(hasDerivAt_K hx.le).deriv, (hasDerivAt_K hy.le).deriv] + exact KDeriv_lipschitz x y) + (fun x _ => K_nonneg x) hJm hJe hSa + calc + _ ≤ K Je + (1 / ell) * Jm * Sa := h + _ = K Je + Jm * Sa / ell := by ring + +theorem general_dissipation {n : ℕ} (g : Cube n → ℝ) (hg : IsInterior g) : + 2 * informationDeficit g + K (informationDeficit g) ≤ dissipation g := by + apply general_dissipation_of_K_estimates convexOn_K K_increment ?_ g hg + intro a b hdom + exact (K_le_rGap (pairEntropyGap_nonneg a b hdom) (pairEntropyGap_lt_ell a b hdom)).trans + (rGap_pairEntropyGap_le a b hdom) + +theorem small_information_dissipation {n : ℕ} (g : Cube n → ℝ) (hg : IsInterior g) + (hS : informationDeficit g ≤ s0) : r (informationDeficit g) ≤ dissipation g := by + have h := general_dissipation g hg + rw [K_eq_rGap_nonneg (informationDeficit_nonneg hg) hS, rGap] at h + linarith + +end LeanBlast.CourtadeKumar + +end OAI diff --git a/lean/OAI/InformationTheory/BooleanNoise/InformationIdentity.lean b/lean/OAI/InformationTheory/BooleanNoise/InformationIdentity.lean new file mode 100644 index 0000000000000000000000000000000000000000..75c3a877a22b087f50a7c9ececd6657dc74c0add --- /dev/null +++ b/lean/OAI/InformationTheory/BooleanNoise/InformationIdentity.lean @@ -0,0 +1,112 @@ +import OAI.InformationTheory.BooleanNoise.FiniteInformation +import OAI.InformationTheory.BooleanNoise.FiniteDistribution +import OAI.InformationTheory.BooleanNoise.EntropyScalars + +namespace OAI + +noncomputable section + +open scoped BigOperators + +namespace LeanBlast.CourtadeKumar + +variable {n : ℕ} + +theorem sum_xlogx_signProbability (v : ℝ) : + (∑ b : Bool, xlogx (signProbability v b)) = -entropy v := by + rw [entropy_eq_binEntropy] + have hhalf : 1 - (1 + v) / 2 = (1 - v) / 2 := by ring + simp only [Fintype.sum_bool, signProbability, Bool.false_eq_true, ite_false, ite_true] + rw [Real.binEntropy, hhalf] + simp only [Real.log_inv, xlogx] + ring + +theorem binaryEntropy_eq_binEntropy (ε : ℝ) : + binaryEntropy ε = Real.binEntropy ε / ell := by + unfold binaryEntropy xlogx Real.binEntropy + simp only [Real.log_inv] + ring + +theorem one_sub_binaryEntropy_eq_psi (ε : ℝ) : + 1 - binaryEntropy ε = psi (1 - 2 * ε) / ell := by + rw [binaryEntropy_eq_binEntropy] + have h := entropy_eq_binEntropy (1 - 2 * ε) + rw [show (1 + (1 - 2 * ε)) / 2 = 1 - ε by ring, Real.binEntropy_one_sub] at h + rw [← h] + unfold entropy + field_simp [ne_of_gt ell_pos] + ring + +theorem joint_xlogx_sum_bool (ε : ℝ) (f : Cube n → Bool) (y : Cube n) : + (∑ b : Bool, xlogx (jointProbability ε f b y)) = + xlogx (((2 : ℝ) ^ n)⁻¹) - + entropy (noiseOperator (1 - 2 * ε) (signEncoding f) y) / (2 : ℝ) ^ n := by + simp_rw [jointProbability_eq_posterior, div_eq_mul_inv, xlogx_mul] + rw [Finset.sum_add_distrib, ← Finset.sum_mul, ← Finset.mul_sum, + sum_signProbability, sum_xlogx_signProbability] + ring + +theorem joint_xlogx_sum (ε : ℝ) (f : Cube n → Bool) : + (∑ b : Bool, ∑ y : Cube n, xlogx (jointProbability ε f b y)) = + (2 : ℝ) ^ n * xlogx (((2 : ℝ) ^ n)⁻¹) - + entropyAverage (noiseOperator (1 - 2 * ε) (signEncoding f)) := by + rw [Finset.sum_comm] + simp_rw [joint_xlogx_sum_bool] + simp [Finset.sum_sub_distrib, entropyAverage, cubeAverage, Finset.sum_div] + +theorem functionMarginal_xlogx_sum (ε : ℝ) (f : Cube n → Bool) : + (∑ b : Bool, xlogx (functionMarginal ε f b)) = + -entropy (cubeAverage (signEncoding f)) := by + simp_rw [functionMarginal_eq_signProbability] + exact sum_xlogx_signProbability _ + +theorem observationMarginal_xlogx_sum (ε : ℝ) (f : Cube n → Bool) : + (∑ y : Cube n, xlogx (observationMarginal ε f y)) = + (2 : ℝ) ^ n * xlogx (((2 : ℝ) ^ n)⁻¹) := by + simp [observationMarginal_eq_uniform, one_div] + +theorem mutualInformation_eq_informationDeficit (ε : ℝ) (f : Cube n → Bool) + (hε0 : 0 ≤ ε) (hεhalf : ε ≤ (1 : ℝ) / 2) : + mutualInformation ε f = + informationDeficit (noiseOperator (1 - 2 * ε) (signEncoding f)) / ell := by + unfold mutualInformation functionMarginal observationMarginal + rw [finite_kl_eq_entropy_sums (jointProbability ε f) + (jointProbability_nonneg ε f hε0 hεhalf)] + change ((∑ b : Bool, ∑ y : Cube n, xlogx (jointProbability ε f b y)) - + (∑ b : Bool, xlogx (functionMarginal ε f b)) - + (∑ y : Cube n, xlogx (observationMarginal ε f y))) / ell = _ + rw [joint_xlogx_sum, functionMarginal_xlogx_sum, observationMarginal_xlogx_sum] + unfold informationDeficit + rw [cubeAverage_noiseOperator] + ring + +theorem mutualInformation_nats (ε : ℝ) (f : Cube n → Bool) + (hε0 : 0 ≤ ε) (hεhalf : ε ≤ (1 : ℝ) / 2) : + ell * mutualInformation ε f = + informationDeficit (noiseOperator (1 - 2 * ε) (signEncoding f)) := by + rw [mutualInformation_eq_informationDeficit ε f hε0 hεhalf] + field_simp [ne_of_gt ell_pos] + +theorem mutualInformation_nats_eq_entropy (ε : ℝ) (f : Cube n → Bool) + (hε0 : 0 ≤ ε) (hεhalf : ε ≤ (1 : ℝ) / 2) : + ell * mutualInformation ε f = entropy (cubeAverage (signEncoding f)) - + entropyAverage (noiseOperator (1 - 2 * ε) (signEncoding f)) := by + rw [mutualInformation_nats ε f hε0 hεhalf] + unfold informationDeficit + rw [cubeAverage_noiseOperator] + +theorem mutualInformation_nats_eq_psi (ε : ℝ) (f : Cube n → Bool) + (hε0 : 0 ≤ ε) (hεhalf : ε ≤ (1 : ℝ) / 2) : + ell * mutualInformation ε f = + cubeAverage (fun x => psi (noiseOperator (1 - 2 * ε) (signEncoding f) x)) - + psi (cubeAverage (signEncoding f)) := by + rw [mutualInformation_nats_eq_entropy ε f hε0 hεhalf] + unfold entropyAverage entropy + rw [cubeAverage_sub, cubeAverage_const] + ring + +end LeanBlast.CourtadeKumar + +end + +end OAI diff --git a/lean/OAI/InformationTheory/BooleanNoise/InverseRegularity.lean b/lean/OAI/InformationTheory/BooleanNoise/InverseRegularity.lean new file mode 100644 index 0000000000000000000000000000000000000000..69426856f308da9e149dbef0a9631abed042096b --- /dev/null +++ b/lean/OAI/InformationTheory/BooleanNoise/InverseRegularity.lean @@ -0,0 +1,264 @@ +import OAI.InformationTheory.BooleanNoise.InverseScalars +import OAI.InformationTheory.BooleanNoise.EndpointLimits +import OAI.InformationTheory.BooleanNoise.ArtanhBounds + +namespace OAI + +noncomputable section + +open Set Filter +open scoped Topology + +namespace LeanBlast.CourtadeKumar + +theorem psi_pos_of_pos {u : ℝ} (hu : 0 < u) (hu1 : u ≤ 1) : 0 < psi u := by + simpa only [psi_zero] using + strictMonoOn_psi (show (0 : ℝ) ∈ Icc 0 1 by norm_num) ⟨hu.le, hu1⟩ hu + +theorem rDeriv_psi {u : ℝ} (hu : u ∈ Ioo 0 1) : + rDeriv (psi u) = 1 + u / ((1 - u ^ 2) * Real.artanh u) := by + simp only [rDeriv, ite_eq_right (not_le.mpr (psi_pos_of_pos hu.1 hu.2.le)), + psiInv_psi ⟨hu.1.le, hu.2.le⟩] + +theorem rSecondDeriv_psi {u : ℝ} (hu : u ∈ Ioo 0 1) : + rSecondDeriv (psi u) = ((1 + u ^ 2) * Real.artanh u - u) / + ((1 - u ^ 2) ^ 2 * (Real.artanh u) ^ 3) := by + simp only [rSecondDeriv, ite_eq_right (not_le.mpr (psi_pos_of_pos hu.1 hu.2.le)), + psiInv_psi ⟨hu.1.le, hu.2.le⟩] + +theorem hasDerivAt_rDerivativeFormula {u : ℝ} (hu : u ∈ Ioo 0 1) : + HasDerivAt (fun v => 1 + v / ((1 - v ^ 2) * Real.artanh v)) + (((1 + u ^ 2) * Real.artanh u - u) / + ((1 - u ^ 2) ^ 2 * (Real.artanh u) ^ 2)) u := by + have ht : Real.artanh u ≠ 0 := (Real.artanh_pos hu).ne' + have hq : 1 - u ^ 2 ≠ 0 := by nlinarith [hu.1, hu.2] + have hd := (((hasDerivAt_id u).pow 2).const_sub 1).mul + (hasDerivAt_artanh ⟨by linarith [hu.1], hu.2⟩) + have h := ((hasDerivAt_id u).div hd (mul_ne_zero hq ht)).const_add 1 + convert! h using 1 + dsimp + field_simp [hq, ht] + ring + +theorem hasDerivAt_rDeriv {s : ℝ} (hs : s ∈ Ioo 0 ell) : + HasDerivAt rDeriv (rSecondDeriv s) s := by + have hu := psiInv_mem_Ioo hs + have h := (hasDerivAt_rDerivativeFormula hu).comp s (hasDerivAt_psiInv hs) + have he : rDeriv =ᶠ[𝓝 s] + (fun z => 1 + psiInv z / ((1 - (psiInv z) ^ 2) * Real.artanh (psiInv z))) := by + filter_upwards [Ioi_mem_nhds hs.1] with z hz + simp only [rDeriv, ite_eq_right (not_le.mpr (show 0 < z from hz))] + apply (h.congr_of_eventuallyEq he).congr_deriv + have ht : Real.artanh (psiInv s) ≠ 0 := (Real.artanh_pos hu).ne' + have hq : 1 - (psiInv s) ^ 2 ≠ 0 := by nlinarith [hu.1, hu.2] + simp only [rSecondDeriv, ite_eq_right (not_le.mpr hs.1)] + field_simp [hq, ht] + +theorem continuousOn_rGap : ContinuousOn rGap (Ico 0 ell) := + continuousOn_r.sub (continuous_const.mul continuous_id).continuousOn + +theorem hasDerivAt_rGap {s : ℝ} (hs : s ∈ Ioo 0 ell) : + HasDerivAt rGap (rDeriv s - 2) s := by + convert! (hasDerivAt_r hs).sub ((hasDerivAt_id s).const_mul 2) using 1 + simp + +theorem L_ell_sub {s : ℝ} (hs : 0 ≤ s) (hsell : s < ell) : + L (ell - s) = r s - 2 * s := by + rcases hs.eq_or_lt with rfl | hs + · simp [L] + · have hx : 0 < ell - s ∧ ell - s < ell := by constructor <;> linarith + simp only [L, ite_eq_left hx, rGap, sub_sub_cancel] + +theorem L_entropy {u : ℝ} (hu : u ∈ Ioo (-1) 1) : + L (entropy u) = r (psi u) - 2 * psi u := + L_ell_sub (psi_nonneg u) (psi_lt_ell hu) + +theorem LDeriv_entropy {u : ℝ} (hu : u ∈ Ioo 0 1) : + LDeriv (entropy u) = 2 - rDeriv (psi u) := by + have hp := psi_pos_of_pos hu.1 hu.2.le + have hpl := psi_lt_ell (show u ∈ Ioo (-1) 1 by constructor <;> linarith [hu.1, hu.2]) + have hx : 0 < entropy u ∧ entropy u < ell := by unfold entropy; constructor <;> linarith + rw [LDeriv, ite_eq_left hx] + simp only [entropy, sub_sub_cancel] + +theorem hasDerivAt_L_of_lt {x : ℝ} (hx : x ∈ Ioo 0 ell) : + HasDerivAt L (LDeriv x) x := by + have hs : ell - x ∈ Ioo 0 ell := by constructor <;> linarith [hx.1, hx.2] + have h := (hasDerivAt_rGap hs).comp x ((hasDerivAt_id x).const_sub ell) + have he : L =ᶠ[𝓝 x] (fun z => rGap (ell - z)) := by + filter_upwards [Ioo_mem_nhds hx.1 hx.2] with z hz + exact L_eq_rGap hz + apply (h.congr_of_eventuallyEq he).congr_deriv + rw [LDeriv, ite_eq_left (show 0 < x ∧ x < ell from hx)] + ring + +theorem hasDerivAt_LDeriv_of_lt {x : ℝ} (hx : x ∈ Ioo 0 ell) : + HasDerivAt LDeriv (rSecondDeriv (ell - x)) x := by + have hs : ell - x ∈ Ioo 0 ell := by constructor <;> linarith [hx.1, hx.2] + have h := ((hasDerivAt_rDeriv hs).comp x ((hasDerivAt_id x).const_sub ell)).const_sub 2 + have he : LDeriv =ᶠ[𝓝 x] (fun z => 2 - rDeriv (ell - z)) := by + filter_upwards [Ioo_mem_nhds hx.1 hx.2] with z hz + exact ite_eq_left hz + apply (h.congr_of_eventuallyEq he).congr_deriv + ring + +theorem rDeriv_ge_two {s : ℝ} (hs : 0 ≤ s) (hsell : s < ell) : 2 ≤ rDeriv s := by + rcases hs.eq_or_lt with rfl | hs + · simp + · have hu := psiInv_mem_Ioo ⟨hs, hsell⟩ + have hq : 0 < 1 - (psiInv s) ^ 2 := by + nlinarith [mul_pos (sub_pos.mpr hu.2) (show 0 < 1 + psiInv s by linarith [hu.1])] + have ht := Real.artanh_pos hu + have hb := one_sub_sq_mul_artanh_le_self ⟨hu.1.le, hu.2⟩ + have hd : 1 ≤ psiInv s / ((1 - (psiInv s) ^ 2) * Real.artanh (psiInv s)) := + (le_div_iff₀ (mul_pos hq ht)).mpr (by simpa using hb) + simp only [rDeriv, ite_eq_right (not_le.mpr hs)] + linarith + +theorem rSecondDeriv_pos {s : ℝ} (hs : s ∈ Ioo 0 ell) : 0 < rSecondDeriv s := by + have hu := psiInv_mem_Ioo hs + have hq : 0 < 1 - (psiInv s) ^ 2 := by + nlinarith [mul_pos (sub_pos.mpr hu.2) (show 0 < 1 + psiInv s by linarith [hu.1])] + have ht := Real.artanh_pos hu + have hb := self_le_artanh ⟨hu.1.le, hu.2⟩ + have hn : 0 < (1 + (psiInv s) ^ 2) * Real.artanh (psiInv s) - psiInv s := by + nlinarith [mul_pos (sq_pos_of_pos hu.1) ht] + simp only [rSecondDeriv, ite_eq_right (not_le.mpr hs.1)] + exact div_pos hn (mul_pos (sq_pos_of_pos hq) (pow_pos ht 3)) + +theorem rSecondDeriv_nonneg {s : ℝ} (hs : 0 ≤ s) (hsell : s < ell) : + 0 ≤ rSecondDeriv s := by + rcases hs.eq_or_lt with rfl | hs + · norm_num + · exact (rSecondDeriv_pos ⟨hs, hsell⟩).le + +theorem convexOn_r : ConvexOn ℝ (Ico 0 ell) r := by + refine convexOn_of_hasDerivWithinAt2_nonneg + (f' := rDeriv) (f'' := rSecondDeriv) (convex_Ico 0 ell) continuousOn_r ?_ ?_ ?_ + · intro s hs + exact (hasDerivAt_r (by simpa using hs)).hasDerivWithinAt + · intro s hs + exact (hasDerivAt_rDeriv (by simpa using hs)).hasDerivWithinAt + · intro s hs + exact (rSecondDeriv_pos (by simpa using hs)).le + +theorem convexOn_rGap : ConvexOn ℝ (Ico 0 ell) rGap := by + refine convexOn_of_hasDerivWithinAt2_nonneg + (f' := fun s => rDeriv s - 2) (f'' := rSecondDeriv) + (convex_Ico 0 ell) continuousOn_rGap ?_ ?_ ?_ + · intro s hs + exact (hasDerivAt_rGap (by simpa using hs)).hasDerivWithinAt + · intro s hs + simpa only [sub_zero] using + ((hasDerivAt_rDeriv (by simpa using hs)).sub_const 2).hasDerivWithinAt + · intro s hs + exact (rSecondDeriv_pos (by simpa using hs)).le + +theorem monotoneOn_rGap : MonotoneOn rGap (Ico 0 ell) := by + refine monotoneOn_of_hasDerivWithinAt_nonneg (f' := fun s => rDeriv s - 2) + (convex_Ico 0 ell) continuousOn_rGap ?_ ?_ + · intro s hs + exact (hasDerivAt_rGap (by simpa using hs)).hasDerivWithinAt + · intro s hs + have hs' : s ∈ Ioo 0 ell := by simpa using hs + exact sub_nonneg.mpr (rDeriv_ge_two hs'.1.le hs'.2) + +theorem rGap_nonneg {s : ℝ} (hs : 0 ≤ s) (hsell : s < ell) : 0 ≤ rGap s := by + simpa only [rGap_zero] using monotoneOn_rGap ⟨le_rfl, ell_pos⟩ ⟨hs, hsell⟩ hs + +theorem monotoneOn_rDeriv : MonotoneOn rDeriv (Ico 0 ell) := by + have hm : MonotoneOn rDeriv (Ioo 0 ell) := by + refine monotoneOn_of_hasDerivWithinAt_nonneg (f' := rSecondDeriv) + (convex_Ioo 0 ell) ?_ ?_ ?_ + · exact fun s hs => (hasDerivAt_rDeriv hs).continuousAt.continuousWithinAt + · intro s hs + exact (hasDerivAt_rDeriv (by simpa using hs)).hasDerivWithinAt + · intro s hs + exact (rSecondDeriv_pos (by simpa using hs)).le + intro s hs t ht hst + rcases hs.1.eq_or_lt with rfl | hs0 + · simpa only [rDeriv_zero] using rDeriv_ge_two ht.1 ht.2 + · exact hm ⟨hs0, hs.2⟩ ⟨lt_of_lt_of_le hs0 hst, ht.2⟩ hst + +theorem tendsto_psiInv_zero_right : Tendsto psiInv (𝓝[>] 0) (𝓝[>] 0) := by + have hc : Tendsto psiInv (𝓝[≥] 0) (𝓝 0) := by + simpa only [ContinuousWithinAt, nhdsWithin_Icc_eq_nhdsGE ell_pos, psiInv_zero] using + continuousOn_psiInv 0 ⟨le_rfl, ell_pos.le⟩ + refine tendsto_nhdsWithin_iff.mpr ⟨hc.mono_left (nhdsWithin_mono _ Ioi_subset_Ici_self), ?_⟩ + filter_upwards [Ioo_mem_nhdsGT ell_pos] with s hs + exact (psiInv_mem_Ioo hs).1 + +theorem tendsto_rDeriv_zero_right : Tendsto rDeriv (𝓝[>] 0) (𝓝 2) := by + apply (tendsto_entropy_inverse_derivative_zero_right.comp tendsto_psiInv_zero_right).congr' + filter_upwards [self_mem_nhdsWithin] with s hs + simp only [Function.comp_apply, rDeriv, ite_eq_right (not_le.mpr (show 0 < s from hs))] + +theorem tendsto_rSecondDeriv_zero_right : Tendsto rSecondDeriv (𝓝[>] 0) (𝓝 (4 / 3 : ℝ)) := by + apply (tendsto_entropy_inverse_second_derivative_zero_right.comp tendsto_psiInv_zero_right).congr' + filter_upwards [self_mem_nhdsWithin] with s hs + simp only [Function.comp_apply, rSecondDeriv, ite_eq_right (not_le.mpr (show 0 < s from hs))] + +theorem continuousOn_rDeriv : ContinuousOn rDeriv (Ico 0 ell) := by + intro s hs + rcases hs.1.eq_or_lt with rfl | hs0 + · have hright : ContinuousWithinAt rDeriv (Ioi 0) 0 := by + simpa only [ContinuousWithinAt, rDeriv_zero] using tendsto_rDeriv_zero_right + apply hright.insert.mono + intro s hs + rcases hs.1.eq_or_lt with h | h + · exact Or.inl h.symm + · exact Or.inr h + · exact (hasDerivAt_rDeriv ⟨hs0, hs.2⟩).continuousAt.continuousWithinAt + +theorem tendsto_r_div_zero_right : + Tendsto (fun s : ℝ => r s / s) (𝓝[>] 0) (𝓝 2) := by + apply (tendsto_artanh_mul_id_div_psi_zero_right.comp tendsto_psiInv_zero_right).congr' + filter_upwards [Ioo_mem_nhdsGT ell_pos] with s hs + simp only [Function.comp_apply, r, psi_psiInv hs.1.le hs.2] + +theorem hasDerivWithinAt_r_zero : HasDerivWithinAt r 2 (Ici 0) 0 := by + rw [hasDerivWithinAt_iff_tendsto_slope, Ici_sdiff_left] + have he : slope r 0 = fun s : ℝ => r s / s := by + ext s + simp only [slope_def_field, r_zero, sub_zero] + rw [he] + exact tendsto_r_div_zero_right + +theorem hasDerivWithinAt_rGap_zero : HasDerivWithinAt rGap 0 (Ici 0) 0 := by + convert! hasDerivWithinAt_r_zero.sub + (((hasDerivAt_id (0 : ℝ)).const_mul 2).hasDerivWithinAt) using 1 + simp + +theorem monotoneOn_r : MonotoneOn r (Ico 0 ell) := by + intro s hs t ht hst + have h := monotoneOn_rGap hs ht hst + unfold rGap at h + linarith + +theorem hasDerivWithinAt_rDeriv_zero : + HasDerivWithinAt rDeriv (4 / 3 : ℝ) (Ici 0) 0 := by + have hlim : Tendsto (fun s : ℝ => (rDeriv s - 2) / s) + (𝓝[>] 0) (𝓝 (4 / 3 : ℝ)) := by + apply HasDerivAt.lhopital_zero_right_on_Ioo + (f' := rSecondDeriv) (g' := fun _ => 1) ell_pos + · intro s hs + exact (hasDerivAt_rDeriv hs).sub_const 2 + · intro s _ + exact hasDerivAt_id s + · intro s _ + norm_num + · simpa using tendsto_rDeriv_zero_right.sub (tendsto_const_nhds (x := (2 : ℝ))) + · exact tendsto_nhdsWithin_of_tendsto_nhds tendsto_id + · simpa using tendsto_rSecondDeriv_zero_right + rw [hasDerivWithinAt_iff_tendsto_slope, Ici_sdiff_left] + have he : slope rDeriv 0 = fun s : ℝ => (rDeriv s - 2) / s := by + ext s + simp only [slope_def_field, rDeriv_zero, sub_zero] + rw [he] + exact hlim + +end LeanBlast.CourtadeKumar + +end + +end OAI diff --git a/lean/OAI/InformationTheory/BooleanNoise/InverseScalars.lean b/lean/OAI/InformationTheory/BooleanNoise/InverseScalars.lean new file mode 100644 index 0000000000000000000000000000000000000000..469c2e9e419606b2a84e379b1e2867d588495d25 --- /dev/null +++ b/lean/OAI/InformationTheory/BooleanNoise/InverseScalars.lean @@ -0,0 +1,193 @@ +import OAI.InformationTheory.BooleanNoise.EntropyScalars +import Mathlib.Data.Set.Function +import Mathlib.Analysis.Calculus.Deriv.Inverse +import Mathlib.Analysis.Convex.Deriv +import Mathlib.Topology.Order.MonotoneContinuity + +namespace OAI + +noncomputable section + +open Set Filter +open scoped Topology + +namespace LeanBlast.CourtadeKumar + +def psiInv (s : ℝ) : ℝ := Function.invFunOn psi (Set.Icc 0 1) s + +def r (s : ℝ) : ℝ := psiInv s * Real.artanh (psiInv s) + +def rDeriv (s : ℝ) : ℝ := + if s ≤ 0 then 2 else + 1 + psiInv s / ((1 - (psiInv s) ^ 2) * Real.artanh (psiInv s)) + +def rSecondDeriv (s : ℝ) : ℝ := + if s ≤ 0 then 4 / 3 else + (((1 + (psiInv s) ^ 2) * Real.artanh (psiInv s) - psiInv s) / + ((1 - (psiInv s) ^ 2) ^ 2 * (Real.artanh (psiInv s)) ^ 3)) + +def rGap (s : ℝ) : ℝ := r s - 2 * s + +def L (x : ℝ) : ℝ := + if 0 < x ∧ x < ell then rGap (ell - x) else 0 + +def LDeriv (x : ℝ) : ℝ := + if 0 < x ∧ x < ell then 2 - rDeriv (ell - x) else 0 + +def s0 : ℝ := psi (1 / 5) + +def K (s : ℝ) : ℝ := + if s ≤ 0 then 0 else + if s ≤ s0 then rGap s else rGap s0 + (rDeriv s0 - 2) * (s - s0) + +def KDeriv (s : ℝ) : ℝ := + if s ≤ 0 then 0 else + if s ≤ s0 then rDeriv s - 2 else rDeriv s0 - 2 + +theorem psiInv_mem_of_mem_image {s : ℝ} (hs : s ∈ psi '' Set.Icc 0 1) : + psiInv s ∈ Set.Icc 0 1 := + Function.invFunOn_mem hs + +theorem psi_psiInv_of_mem_image {s : ℝ} (hs : s ∈ psi '' Set.Icc 0 1) : + psi (psiInv s) = s := + Function.invFunOn_eq hs + +@[simp] theorem rDeriv_zero : rDeriv 0 = 2 := by simp [rDeriv] +@[simp] theorem rSecondDeriv_zero : rSecondDeriv 0 = 4 / 3 := by simp [rSecondDeriv] +@[simp] theorem K_zero : K 0 = 0 := by simp [K] +@[simp] theorem KDeriv_zero : KDeriv 0 = 0 := by simp [KDeriv] + +theorem L_eq_zero_of_ell_le {x : ℝ} (hx : ell ≤ x) : L x = 0 := by + simp [L, not_lt.mpr hx] + +theorem L_eq_rGap {x : ℝ} (hx : x ∈ Set.Ioo 0 ell) : + L x = rGap (ell - x) := by simp [L, hx.1, hx.2] + +theorem K_eq_rGap {s : ℝ} (hs : 0 < s) (hs0 : s ≤ s0) : K s = rGap s := by + simp [K, not_le.mpr hs, hs0] + +theorem K_eq_tangent {s : ℝ} (hs : 0 < s) (hs0 : s0 ≤ s) : + K s = rGap s0 + (rDeriv s0 - 2) * (s - s0) := by + rcases hs0.eq_or_lt with rfl | hs0 + · simp [K, not_le.mpr hs] + · simp [K, not_le.mpr hs, not_le.mpr hs0] + +theorem image_psi_Icc : psi '' Icc 0 1 = Icc 0 ell := by + simpa only [psi_zero, psi_one] using + continuous_psi.continuousOn.image_Icc_of_monotoneOn + (by norm_num : (0 : ℝ) ≤ 1) strictMonoOn_psi.monotoneOn + +theorem psiInv_mem_Icc {s : ℝ} (hs : s ∈ Icc 0 ell) : psiInv s ∈ Icc 0 1 := by + exact psiInv_mem_of_mem_image (image_psi_Icc.symm ▸ hs) + +theorem psi_psiInv_Icc {s : ℝ} (hs : s ∈ Icc 0 ell) : psi (psiInv s) = s := by + exact psi_psiInv_of_mem_image (image_psi_Icc.symm ▸ hs) + +theorem psiInv_psi {u : ℝ} (hu : u ∈ Icc 0 1) : psiInv (psi u) = u := + strictMonoOn_psi.injOn.leftInvOn_invFunOn hu + +@[simp] theorem psiInv_zero : psiInv 0 = 0 := by + simpa only [psi_zero] using psiInv_psi (show (0 : ℝ) ∈ Icc 0 1 by norm_num) + +@[simp] theorem psiInv_ell : psiInv ell = 1 := by + simpa only [psi_one] using psiInv_psi (show (1 : ℝ) ∈ Icc 0 1 by norm_num) + +@[simp] theorem r_zero : r 0 = 0 := by simp [r] +@[simp] theorem rGap_zero : rGap 0 = 0 := by simp [rGap] + +theorem psi_psiInv {s : ℝ} (hs : 0 ≤ s) (hsell : s < ell) : psi (psiInv s) = s := + psi_psiInv_Icc ⟨hs, hsell.le⟩ + +theorem psiInv_mem_Ico {s : ℝ} (hs : 0 ≤ s) (hsell : s < ell) : + psiInv s ∈ Ico 0 1 := by + have hu := psiInv_mem_Icc ⟨hs, hsell.le⟩ + refine ⟨hu.1, ?_⟩ + by_contra h + have he : psiInv s = 1 := le_antisymm hu.2 (le_of_not_gt h) + have hv := psi_psiInv hs hsell + rw [he, psi_one] at hv + linarith + +theorem psiInv_mem_Ioo {s : ℝ} (hs : s ∈ Ioo 0 ell) : psiInv s ∈ Ioo 0 1 := by + have hu := psiInv_mem_Ico hs.1.le hs.2 + refine ⟨?_, hu.2⟩ + by_contra h + have he : psiInv s = 0 := le_antisymm (le_of_not_gt h) hu.1 + have hv := psi_psiInv hs.1.le hs.2 + rw [he, psi_zero] at hv + linarith [hs.1] + +def psiOrderIso : Icc (0 : ℝ) 1 ≃o Icc (0 : ℝ) ell where + toFun u := ⟨psi u, image_psi_Icc ▸ mem_image_of_mem psi u.property⟩ + invFun s := ⟨psiInv s, psiInv_mem_Icc s.property⟩ + left_inv u := Subtype.ext (psiInv_psi u.property) + right_inv s := Subtype.ext (psi_psiInv_Icc s.property) + map_rel_iff' := by + intro u v + exact strictMonoOn_psi.le_iff_le u.property v.property + +theorem continuousOn_psiInv : ContinuousOn psiInv (Icc 0 ell) := by + rw [continuousOn_iff_continuous_domRestrict] + exact continuous_subtype_val.comp psiOrderIso.symm.continuous + +theorem continuousAt_psiInv {s : ℝ} (hs : s ∈ Ioo 0 ell) : ContinuousAt psiInv s := + (continuousOn_psiInv s ⟨hs.1.le, hs.2.le⟩).continuousAt (Icc_mem_nhds hs.1 hs.2) + +theorem r_psi_nonneg {u : ℝ} (hu : u ∈ Icc 0 1) : + r (psi u) = u * Real.artanh u := by rw [r, psiInv_psi hu] + +theorem r_psi {u : ℝ} (hu : u ∈ Ioo (-1) 1) : + r (psi u) = u * Real.artanh u := by + by_cases h0 : 0 ≤ u + · exact r_psi_nonneg ⟨h0, hu.2.le⟩ + · have hn : -u ∈ Ioo (-1) 1 := by constructor <;> linarith [hu.1, hu.2] + have hodd : Real.artanh (-u) = -Real.artanh u := by + rw [artanh_eq_log_sub hn, artanh_eq_log_sub hu] + simp only [sub_eq_add_neg, neg_neg] + ring + calc + r (psi u) = r (psi (-u)) := by rw [psi_neg] + _ = (-u) * Real.artanh (-u) := r_psi_nonneg ⟨by linarith, hn.2.le⟩ + _ = u * Real.artanh u := by rw [hodd]; ring + +theorem s0_pos : 0 < s0 := by + change 0 < psi (1 / 5) + rw [← psi_zero] + exact strictMonoOn_psi (by norm_num) (by norm_num) (by norm_num) + +theorem s0_lt_ell : s0 < ell := psi_lt_ell (by norm_num) + +theorem hasDerivAt_psiInv {s : ℝ} (hs : s ∈ Ioo 0 ell) : + HasDerivAt psiInv (Real.artanh (psiInv s))⁻¹ s := by + have hu := psiInv_mem_Ioo hs + apply HasDerivAt.of_local_left_inverse (continuousAt_psiInv hs) + (hasDerivAt_psi ⟨by linarith [hu.1], hu.2⟩) (Real.artanh_pos hu).ne' + filter_upwards [Ioo_mem_nhds hs.1 hs.2] with t ht + exact psi_psiInv ht.1.le ht.2 + +theorem continuousOn_r : ContinuousOn r (Ico 0 ell) := by + have hi : ContinuousOn psiInv (Ico 0 ell) := + continuousOn_psiInv.mono (fun _ h => ⟨h.1, h.2.le⟩) + intro s hs + have hu := psiInv_mem_Ico hs.1 hs.2 + exact (hi s hs).mul + ((hasDerivAt_artanh ⟨by linarith [hu.1], hu.2⟩).continuousAt.comp_continuousWithinAt + (hi s hs)) + +theorem hasDerivAt_r {s : ℝ} (hs : s ∈ Ioo 0 ell) : HasDerivAt r (rDeriv s) s := by + have hu := psiInv_mem_Ioo hs + have hi := hasDerivAt_psiInv hs + have ht := (hasDerivAt_artanh ⟨by linarith [hu.1], hu.2⟩).comp s hi + have hn : Real.artanh (psiInv s) ≠ 0 := (Real.artanh_pos hu).ne' + have hq : 1 - (psiInv s) ^ 2 ≠ 0 := by nlinarith [hu.1, hu.2] + convert! hi.mul ht using 1 + unfold rDeriv + rw [ite_eq_right (not_le.mpr hs.1)] + simp only [Function.comp_apply] + field_simp + +end LeanBlast.CourtadeKumar + +end + +end OAI diff --git a/lean/OAI/InformationTheory/BooleanNoise/JensenGaps.lean b/lean/OAI/InformationTheory/BooleanNoise/JensenGaps.lean new file mode 100644 index 0000000000000000000000000000000000000000..47e54a9d12e9a0f1828b09f0066851d573f26d0f --- /dev/null +++ b/lean/OAI/InformationTheory/BooleanNoise/JensenGaps.lean @@ -0,0 +1,536 @@ +import OAI.InformationTheory.BooleanNoise.Basic +import OAI.InformationTheory.BooleanNoise.EntropySeries +import OAI.InformationTheory.BooleanNoise.PairEntropy +import OAI.InformationTheory.BooleanNoise.LambdaScalars +import Mathlib.Analysis.Convex.Mul +import Mathlib.Analysis.Convex.Jensen +import Mathlib.Topology.Algebra.InfiniteSum.Ring +import Mathlib.Topology.Algebra.InfiniteSum.Order +import Mathlib.Tactic + +namespace OAI + +noncomputable section + +open scoped BigOperators + +universe u + +namespace LeanBlast.CourtadeKumar + +theorem pow_tangent_remainder_nonneg (n : ℕ) (x y : ℝ) (hx : 0 ≤ x) (hy : 0 ≤ y) : + 0 ≤ x ^ (n + 1) - y ^ (n + 1) - (n + 1 : ℝ) * y ^ n * (x - y) := by + induction n with + | zero => simp + | succ n ih => + have hp := add_nonneg (mul_nonneg hx ih) + (mul_nonneg (mul_nonneg (by positivity : (0 : ℝ) ≤ n + 1) (pow_nonneg hy n)) + (sq_nonneg (x - y))) + convert hp using 1 + push_cast + simp only [pow_succ] + ring + +theorem pow_tangent_remainder_lower (n : ℕ) (x y : ℝ) (hx : 0 ≤ x) (hy : 0 ≤ y) : + (n + 1 : ℝ) * y ^ n * (x - y) ^ 2 ≤ + x ^ (n + 2) - y ^ (n + 2) - (n + 2 : ℝ) * y ^ (n + 1) * (x - y) := by + have hp := mul_nonneg hx (pow_tangent_remainder_nonneg n x y hx hy) + have hid : x ^ (n + 2) - y ^ (n + 2) - (n + 2 : ℝ) * y ^ (n + 1) * (x - y) = + x * (x ^ (n + 1) - y ^ (n + 1) - (n + 1 : ℝ) * y ^ n * (x - y)) + + (n + 1 : ℝ) * y ^ n * (x - y) ^ 2 := by + simp only [pow_succ] + ring + rw [hid] + linarith + +section Weighted + +variable {ι : Type u} [Fintype ι] + +private abbrev entropySeriesCoeff (j : ℕ) : ℝ := psiCoeff j + +theorem weighted_even_pow_jensen (w x : ι → ℝ) (n : ℕ) + (hw : ∀ i, 0 ≤ w i) (hprob : ∑ i, w i = 1) : + (∑ i, w i * x i) ^ (2 * n) ≤ ∑ i, w i * (x i) ^ (2 * n) := by + have hc : ConvexOn ℝ Set.univ (fun t : ℝ => t ^ (2 * n)) := + (even_two_mul n).convexOn_pow + simpa only [smul_eq_mul] using hc.map_sum_le (fun i _ => hw i) hprob + (fun i _ => Set.mem_univ (x i)) + +theorem weighted_centered_second_moment (w x : ι → ℝ) (y : ℝ) + (hprob : ∑ i, w i = 1) (hmean : ∑ i, w i * x i = y) : + (∑ i, w i * (x i - y) ^ 2) = (∑ i, w i * (x i) ^ 2) - y ^ 2 := by + calc + (∑ i, w i * (x i - y) ^ 2) = + ∑ i, (w i * (x i) ^ 2 - 2 * y * (w i * x i) + y ^ 2 * w i) := by + apply Finset.sum_congr rfl + intro i _ + ring + _ = (∑ i, w i * (x i) ^ 2) - 2 * y * (∑ i, w i * x i) + y ^ 2 * (∑ i, w i) := by + simp only [Finset.sum_sub_distrib, Finset.sum_add_distrib, Finset.mul_sum] + _ = _ := by rw [hprob, hmean]; ring + +theorem weighted_pow_gap_lower (w x : ι → ℝ) (y : ℝ) (n : ℕ) + (hw : ∀ i, 0 ≤ w i) (hprob : ∑ i, w i = 1) + (hx : ∀ i, 0 ≤ x i) (hy : 0 ≤ y) (hmean : ∑ i, w i * x i = y) : + (n + 1 : ℝ) * y ^ n * ((∑ i, w i * (x i) ^ 2) - y ^ 2) ≤ + (∑ i, w i * (x i) ^ (n + 2)) - y ^ (n + 2) := by + have h := Finset.sum_le_sum (s := Finset.univ) (fun i _ => + mul_le_mul_of_nonneg_left (pow_tangent_remainder_lower n (x i) y (hx i) hy) (hw i)) + have hleft : (∑ i, w i * ((n + 1 : ℝ) * y ^ n * (x i - y) ^ 2)) = + (n + 1 : ℝ) * y ^ n * ((∑ i, w i * (x i) ^ 2) - y ^ 2) := by + rw [← weighted_centered_second_moment w x y hprob hmean, Finset.mul_sum] + apply Finset.sum_congr rfl + intro i _ + ring + have hright : (∑ i, w i * + ((x i) ^ (n + 2) - y ^ (n + 2) - (n + 2 : ℝ) * y ^ (n + 1) * (x i - y))) = + (∑ i, w i * (x i) ^ (n + 2)) - y ^ (n + 2) := by + calc + _ = ∑ i, (w i * (x i) ^ (n + 2) - y ^ (n + 2) * w i - + (n + 2 : ℝ) * y ^ (n + 1) * (w i * x i - y * w i)) := by + apply Finset.sum_congr rfl + intro i _ + ring + _ = (∑ i, w i * (x i) ^ (n + 2)) - y ^ (n + 2) * (∑ i, w i) - + (n + 2 : ℝ) * y ^ (n + 1) * ((∑ i, w i * x i) - y * (∑ i, w i)) := by + simp only [Finset.sum_sub_distrib, mul_sub, Finset.mul_sum] + _ = _ := by rw [hprob, hmean]; ring + rwa [hleft, hright] at h + +theorem weighted_series_gap_hasSum (c : ℕ → ℝ) (p : ℕ → ℕ) (F : ℝ → ℝ) + (w x : ι → ℝ) (y : ℝ) + (hx : ∀ i, HasSum (fun j => c j * (x i) ^ (p j)) (F (x i))) + (hy : HasSum (fun j => c j * y ^ (p j)) (F y)) : + HasSum (fun j => 2 * c j * ((∑ i, w i * (x i) ^ (p j)) - y ^ (p j))) + (2 * ((∑ i, w i * F (x i)) - F y)) := by + have hsum := hasSum_sum (s := Finset.univ) (fun i _ => (hx i).mul_left (w i)) + have h := (hsum.sub hy).mul_left 2 + have heq : ∀ j, (∑ i, w i * (c j * (x i) ^ (p j))) = + c j * (∑ i, w i * (x i) ^ (p j)) := by + intro j + rw [Finset.mul_sum] + apply Finset.sum_congr rfl + intro i _ + ring + simp_rw [heq] at h + convert h using 1 + ext j + ring + +private theorem entropy_series_gap_lower (F : ℝ → ℝ) (w x : ι → ℝ) (y : ℝ) + (hw : ∀ i, 0 ≤ w i) (hprob : ∑ i, w i = 1) (hmean : ∑ i, w i * x i = y) + (hx : ∀ i, HasSum (fun j => entropySeriesCoeff j * (x i) ^ (2 * (j + 1))) (F (x i))) + (hy : HasSum (fun j => entropySeriesCoeff j * y ^ (2 * (j + 1))) (F y)) : + (∑ i, w i * (x i) ^ 2) - y ^ 2 ≤ 2 * ((∑ i, w i * F (x i)) - F y) := by + have hsum := weighted_series_gap_hasSum entropySeriesCoeff (fun j => 2 * (j + 1)) F w x y hx hy + apply hasSum_le _ (hasSum_ite_eq (0 : ℕ) ((∑ i, w i * (x i) ^ 2) - y ^ 2)) hsum + intro j + by_cases hj : j = 0 + · subst j + norm_num [entropySeriesCoeff] + · simp only [ite_eq_right hj] + have hp := weighted_even_pow_jensen w x (j + 1) hw hprob + rw [hmean] at hp + exact mul_nonneg (mul_nonneg (by norm_num) (psiCoeff_nonneg j)) (sub_nonneg.mpr hp) + +private theorem entropy_series_gap_strengthened (F : ℝ → ℝ) (w x : ι → ℝ) (y : ℝ) + (hw : ∀ i, 0 ≤ w i) (hprob : ∑ i, w i = 1) (hmean : ∑ i, w i * x i = y) + (hx0 : ∀ i, 0 ≤ x i) (hy0 : 0 ≤ y) (hy1 : y < 1) + (hx : ∀ i, HasSum (fun j => entropySeriesCoeff j * (x i) ^ (2 * (j + 1))) (F (x i))) + (hy : HasSum (fun j => entropySeriesCoeff j * y ^ (2 * (j + 1))) (F y)) : + ((∑ i, w i * (x i) ^ 2) - y ^ 2) * lambda (y ^ 2) ≤ + 2 * ((∑ i, w i * F (x i)) - F y) := by + have hsum := weighted_series_gap_hasSum entropySeriesCoeff (fun j => 2 * (j + 1)) F w x y hx hy + have hlambda := (hasSum_lambda (sq_nonneg y) (by nlinarith : y ^ 2 < 1)).mul_left + ((∑ i, w i * (x i) ^ 2) - y ^ 2) + apply hasSum_le _ hlambda hsum + intro j + have hp := weighted_pow_gap_lower w x y (2 * j) hw hprob hx0 hy0 hmean + have hc : 0 ≤ 2 * entropySeriesCoeff j := mul_nonneg (by norm_num) (psiCoeff_nonneg j) + have h := mul_le_mul_of_nonneg_left hp hc + have heq : 2 * entropySeriesCoeff j * + ((2 * j + 1 : ℝ) * y ^ (2 * j) * ((∑ i, w i * (x i) ^ 2) - y ^ 2)) = + ((∑ i, w i * (x i) ^ 2) - y ^ 2) * ((y ^ 2) ^ j / ((j : ℝ) + 1)) := by + simp only [entropySeriesCoeff, psiCoeff, pow_mul] + field_simp + rw [show 2 * j + 2 = 2 * (j + 1) by omega] at h + push_cast at h + rwa [heq] at h + +theorem weighted_psi_gap (w x : ι → ℝ) (y : ℝ) + (hw : ∀ i, 0 ≤ w i) (hprob : ∑ i, w i = 1) (hmean : ∑ i, w i * x i = y) + (hx : ∀ i, |x i| < 1) : + (∑ i, w i * (x i) ^ 2) - y ^ 2 ≤ 2 * ((∑ i, w i * psi (x i)) - psi y) := by + have hy : |y| < 1 := by + apply abs_lt.mpr + rw [← hmean] + simpa only [smul_eq_mul, Set.mem_Ioo] using (convex_Ioo (-1 : ℝ) 1).sum_mem + (fun i _ => hw i) hprob (fun i _ => abs_lt.mp (hx i)) + exact entropy_series_gap_lower psi w x y hw hprob hmean + (fun i => hasSum_psi (hx i)) (hasSum_psi hy) + +theorem weighted_psi_gap_strengthened (w x : ι → ℝ) (y : ℝ) + (hw : ∀ i, 0 ≤ w i) (hprob : ∑ i, w i = 1) (hmean : ∑ i, w i * x i = y) + (hx : ∀ i, |x i| < 1) (hx0 : ∀ i, 0 ≤ x i) : + ((∑ i, w i * (x i) ^ 2) - y ^ 2) * lambda (y ^ 2) ≤ + 2 * ((∑ i, w i * psi (x i)) - psi y) := by + have hy : |y| < 1 := by + apply abs_lt.mpr + rw [← hmean] + simpa only [smul_eq_mul, Set.mem_Ioo] using (convex_Ioo (-1 : ℝ) 1).sum_mem + (fun i _ => hw i) hprob (fun i _ => abs_lt.mp (hx i)) + have hy0 : 0 ≤ y := by + rw [← hmean] + exact Finset.sum_nonneg (fun i _ => mul_nonneg (hw i) (hx0 i)) + exact entropy_series_gap_strengthened psi w x y hw hprob hmean hx0 hy0 + (abs_lt.mp hy).2 (fun i => hasSum_psi (hx i)) (hasSum_psi hy) + +private theorem normalized_ratio_weights_data (w t b : ι → ℝ) (T k : ℝ) + (hw : ∀ i, 0 ≤ w i) (ht : ∀ i, 0 < t i) (hT : 0 < T) + (hmass : ∑ i, w i * t i = T) (hmean : ∑ i, w i * b i = k) : + (∀ i, 0 ≤ w i * t i / T) ∧ (∑ i, w i * t i / T) = 1 ∧ + (∑ i, (w i * t i / T) * (b i / t i)) = k / T := by + refine ⟨fun i => div_nonneg (mul_nonneg (hw i) (ht i).le) hT.le, ?_, ?_⟩ + · rw [← Finset.sum_div, hmass, div_self hT.ne'] + · calc + _ = ∑ i, (w i * b i) / T := by + apply Finset.sum_congr rfl + intro i _ + field_simp [(ht i).ne'] + _ = k / T := by rw [← Finset.sum_div, hmean] + +private theorem rescale_perspective_gap (w t b : ι → ℝ) (T k C : ℝ) + (ht : ∀ i, 0 < t i) (hT : 0 < T) + (hgap : ((∑ i, (w i * t i / T) * (b i / t i) ^ 2) - (k / T) ^ 2) * C ≤ + 2 * ((∑ i, (w i * t i / T) * psi (b i / t i)) - psi (k / T))) : + ((∑ i, w i * (b i) ^ 2 / t i) - k ^ 2 / T) * C ≤ + 2 * ((∑ i, w i * t i * psi (b i / t i)) - T * psi (k / T)) := by + have hsecond : (∑ i, (w i * t i / T) * (b i / t i) ^ 2) = + (∑ i, w i * (b i) ^ 2 / t i) / T := by + rw [Finset.sum_div] + apply Finset.sum_congr rfl + intro i _ + field_simp [(ht i).ne'] + have hentropy : (∑ i, (w i * t i / T) * psi (b i / t i)) = + (∑ i, w i * t i * psi (b i / t i)) / T := by + rw [Finset.sum_div] + apply Finset.sum_congr rfl + intro i _ + ring + rw [hsecond, hentropy] at hgap + have h := mul_le_mul_of_nonneg_left hgap hT.le + convert h using 1 <;> field_simp + +theorem weighted_perspective_gap (w t b : ι → ℝ) (T k : ℝ) + (hw : ∀ i, 0 ≤ w i) (ht : ∀ i, 0 < t i) (hT : 0 < T) + (hmass : ∑ i, w i * t i = T) (hmean : ∑ i, w i * b i = k) + (hdom : ∀ i, |b i| < t i) : + (∑ i, w i * (b i) ^ 2 / t i) - k ^ 2 / T ≤ + 2 * ((∑ i, w i * t i * psi (b i / t i)) - T * psi (k / T)) := by + obtain ⟨hq0, hq1, hqm⟩ := normalized_ratio_weights_data w t b T k hw ht hT hmass hmean + have hx : ∀ i, |b i / t i| < 1 := by + intro i + rw [abs_div, abs_of_pos (ht i)] + exact (div_lt_one (ht i)).mpr (hdom i) + have hg := weighted_psi_gap (fun i => w i * t i / T) (fun i => b i / t i) + (k / T) hq0 hq1 hqm hx + simpa only [mul_one] using rescale_perspective_gap w t b T k 1 ht hT + (by simpa only [mul_one] using hg) + +theorem weighted_perspective_gap_strengthened (w t b : ι → ℝ) (T k : ℝ) + (hw : ∀ i, 0 ≤ w i) (ht : ∀ i, 0 < t i) (hT : 0 < T) + (hmass : ∑ i, w i * t i = T) (hmean : ∑ i, w i * b i = k) + (hdom : ∀ i, |b i| < t i) (hb : ∀ i, 0 ≤ b i) : + ((∑ i, w i * (b i) ^ 2 / t i) - k ^ 2 / T) * lambda ((k / T) ^ 2) ≤ + 2 * ((∑ i, w i * t i * psi (b i / t i)) - T * psi (k / T)) := by + obtain ⟨hq0, hq1, hqm⟩ := normalized_ratio_weights_data w t b T k hw ht hT hmass hmean + have hx : ∀ i, |b i / t i| < 1 := by + intro i + rw [abs_div, abs_of_pos (ht i)] + exact (div_lt_one (ht i)).mpr (hdom i) + have hg := weighted_psi_gap_strengthened (fun i => w i * t i / T) (fun i => b i / t i) + (k / T) hq0 hq1 hqm hx (fun i => div_nonneg (hb i) (ht i).le) + exact rescale_perspective_gap w t b T k (lambda ((k / T) ^ 2)) ht hT hg + +theorem weighted_abs_mean_le (w x : ι → ℝ) (hw : ∀ i, 0 ≤ w i) : + |∑ i, w i * x i| ≤ ∑ i, w i * |x i| := by + calc + |∑ i, w i * x i| ≤ ∑ i, |w i * x i| := Finset.abs_sum_le_sum_abs _ _ + _ = _ := by simp only [abs_mul, abs_of_nonneg (hw _)] + +theorem weighted_pair_mean_interior (w a b : ι → ℝ) + (hw : ∀ i, 0 ≤ w i) (hprob : ∑ i, w i = 1) + (hdom : ∀ i, |a i| + |b i| < 1) : + |∑ i, w i * a i| + |∑ i, w i * b i| < 1 := by + have havg : (∑ i, w i * (|a i| + |b i|)) < 1 := by + simpa only [smul_eq_mul, Set.mem_Iio] using (convex_Iio (1 : ℝ)).sum_mem + (fun i _ => hw i) hprob (fun i _ => hdom i) + have h := add_le_add (weighted_abs_mean_le w a hw) (weighted_abs_mean_le w b hw) + rw [← Finset.sum_add_distrib] at h + simp only [← mul_add] at h + exact h.trans_lt havg + +theorem weighted_positive_mean (w t : ι → ℝ) + (hw : ∀ i, 0 ≤ w i) (hprob : ∑ i, w i = 1) (ht : ∀ i, 0 < t i) : + 0 < ∑ i, w i * t i := by + simpa only [smul_eq_mul, Set.mem_Ioi] using (convex_Ioi (0 : ℝ)).sum_mem + (fun i _ => hw i) hprob (fun i _ => ht i) + +theorem weighted_ratio_centered_identity (w t b : ι → ℝ) (y : ℝ) + (ht : ∀ i, t i ≠ 0) : + (∑ i, w i * t i * (b i / t i - y) ^ 2) = + (∑ i, w i * (b i) ^ 2 / t i) - 2 * y * (∑ i, w i * b i) + + y ^ 2 * (∑ i, w i * t i) := by + calc + _ = ∑ i, (w i * (b i) ^ 2 / t i - 2 * y * (w i * b i) + + y ^ 2 * (w i * t i)) := by + apply Finset.sum_congr rfl + intro i _ + field_simp [ht i] + ring + _ = _ := by simp only [Finset.sum_sub_distrib, Finset.sum_add_distrib, Finset.mul_sum] + +theorem weighted_ratio_variance_identity (w t b : ι → ℝ) (T k : ℝ) + (ht : ∀ i, t i ≠ 0) (hT : T ≠ 0) + (hmass : ∑ i, w i * t i = T) (hmean : ∑ i, w i * b i = k) : + (∑ i, w i * t i * (b i / t i - k / T) ^ 2) = + (∑ i, w i * (b i) ^ 2 / t i) - k ^ 2 / T := by + rw [weighted_ratio_centered_identity w t b _ ht, hmass, hmean] + field_simp + ring + +theorem weighted_ratio_variance_nonneg (w t b : ι → ℝ) (T k : ℝ) + (hw : ∀ i, 0 ≤ w i) (ht : ∀ i, 0 < t i) (hT : 0 < T) + (hmass : ∑ i, w i * t i = T) (hmean : ∑ i, w i * b i = k) : + 0 ≤ (∑ i, w i * (b i) ^ 2 / t i) - k ^ 2 / T := by + rw [← weighted_ratio_variance_identity w t b T k (fun i => (ht i).ne') hT.ne' + hmass hmean] + exact Finset.sum_nonneg (fun i _ => + mul_nonneg (mul_nonneg (hw i) (ht i).le) (sq_nonneg _)) + +theorem weighted_variance_gap_lower_bound (w a b : ι → ℝ) + (hw : ∀ i, 0 ≤ w i) (hprob : ∑ i, w i = 1) + (hdom : ∀ i, |a i| + |b i| < 1) : + (∑ i, w i * b i) ^ 2 / (∑ i, w i * (1 - (a i) ^ 2)) - + (∑ i, w i * b i) ^ 2 / (1 - (∑ i, w i * a i) ^ 2) ≤ + (∑ i, w i * (b i) ^ 2 / (1 - (a i) ^ 2)) - + (∑ i, w i * b i) ^ 2 / (1 - (∑ i, w i * a i) ^ 2) := by + have ht : ∀ i, 0 < 1 - (a i) ^ 2 := by + intro i + have hi := hdom i + have hsq := sq_abs (a i) + nlinarith [abs_nonneg (a i), abs_nonneg (b i)] + have hT := weighted_positive_mean w (fun i => 1 - (a i) ^ 2) hw hprob ht + have h := weighted_ratio_variance_nonneg w (fun i => 1 - (a i) ^ 2) b _ _ + hw ht hT rfl rfl + linarith + +theorem weighted_variance_gap_nonneg (w a b : ι → ℝ) + (hw : ∀ i, 0 ≤ w i) (hprob : ∑ i, w i = 1) + (hdom : ∀ i, |a i| + |b i| < 1) : + 0 ≤ (∑ i, w i * (b i) ^ 2 / (1 - (a i) ^ 2)) - + (∑ i, w i * b i) ^ 2 / (1 - (∑ i, w i * a i) ^ 2) := by + have ht : ∀ i, 0 < 1 - (a i) ^ 2 := by + intro i + have hi := hdom i + nlinarith [sq_abs (a i), abs_nonneg (a i), abs_nonneg (b i)] + have hT := weighted_positive_mean w (fun i => 1 - (a i) ^ 2) hw hprob ht + have hj := weighted_even_pow_jensen w a 1 hw hprob + norm_num only [Nat.mul_one] at hj + have hW : (∑ i, w i * (1 - (a i) ^ 2)) ≤ 1 - (∑ i, w i * a i) ^ 2 := by + simp only [mul_sub, mul_one, Finset.sum_sub_distrib, hprob] + linarith + have hdiv := div_le_div_of_nonneg_left (sq_nonneg (∑ i, w i * b i)) hT hW + have h := weighted_variance_gap_lower_bound w a b hw hprob hdom + linarith + +private theorem pair_reciprocal_square_identity (a b : ℝ) (h : |a| + |b| < 1) : + b ^ 2 / (1 + a) + b ^ 2 / (1 - a) = 2 * (b ^ 2 / (1 - a ^ 2)) := by + have hp := (pair_denom_add_pos a b h).ne' + have hm := (pair_denom_sub_pos a b h).ne' + have hv := (pair_variance_pos a b h).ne' + field_simp + ring + +private theorem weighted_pair_gap_combine (w a b : ι → ℝ) (m k C : ℝ) + (hdom : ∀ i, |a i| + |b i| < 1) (hcenter : |m| + |k| < 1) + (hp : ((∑ i, w i * (b i) ^ 2 / (1 + a i)) - k ^ 2 / (1 + m)) * C ≤ + 2 * ((∑ i, w i * (1 + a i) * psi (b i / (1 + a i))) - + (1 + m) * psi (k / (1 + m)))) + (hm : ((∑ i, w i * (b i) ^ 2 / (1 - a i)) - k ^ 2 / (1 - m)) * C ≤ + 2 * ((∑ i, w i * (1 - a i) * psi (b i / (1 - a i))) - + (1 - m) * psi (k / (1 - m)))) : + ((∑ i, w i * (b i) ^ 2 / (1 - (a i) ^ 2)) - k ^ 2 / (1 - m ^ 2)) * C ≤ + 2 * ((∑ i, w i * pairEntropyGap (a i) (b i)) - pairEntropyGap m k) := by + have hv : (∑ i, w i * (b i) ^ 2 / (1 + a i)) + + (∑ i, w i * (b i) ^ 2 / (1 - a i)) = + 2 * (∑ i, w i * (b i) ^ 2 / (1 - (a i) ^ 2)) := by + rw [← Finset.sum_add_distrib, Finset.mul_sum] + apply Finset.sum_congr rfl + intro i _ + calc + _ = w i * ((b i) ^ 2 / (1 + a i) + (b i) ^ 2 / (1 - a i)) := by ring + _ = _ := by rw [pair_reciprocal_square_identity (a i) (b i) (hdom i)]; ring + have hvc := pair_reciprocal_square_identity m k hcenter + have he : (∑ i, w i * (1 + a i) * psi (b i / (1 + a i))) + + (∑ i, w i * (1 - a i) * psi (b i / (1 - a i))) = + 2 * (∑ i, w i * pairEntropyGap (a i) (b i)) := by + rw [← Finset.sum_add_distrib, Finset.mul_sum] + apply Finset.sum_congr rfl + intro i _ + rw [pairEntropyGap_weighted (a i) (b i) (hdom i)] + ring + have hec : (1 + m) * psi (k / (1 + m)) + (1 - m) * psi (k / (1 - m)) = + 2 * pairEntropyGap m k := by + rw [pairEntropyGap_weighted m k hcenter] + ring + have hvC := congrArg (fun z : ℝ => z * C) hv + have hvcC := congrArg (fun z : ℝ => z * C) hvc + nlinarith only [hp, hm, hvC, hvcC, he, hec] + +theorem weighted_pair_jensen_gap (w a b : ι → ℝ) + (hw : ∀ i, 0 ≤ w i) (hprob : ∑ i, w i = 1) + (hdom : ∀ i, |a i| + |b i| < 1) : + (∑ i, w i * (b i) ^ 2 / (1 - (a i) ^ 2)) - + (∑ i, w i * b i) ^ 2 / (1 - (∑ i, w i * a i) ^ 2) ≤ + 2 * ((∑ i, w i * pairEntropyGap (a i) (b i)) - + pairEntropyGap (∑ i, w i * a i) (∑ i, w i * b i)) := by + let m := ∑ i, w i * a i + let k := ∑ i, w i * b i + have hc : |m| + |k| < 1 := weighted_pair_mean_interior w a b hw hprob hdom + have hmp : (∑ i, w i * (1 + a i)) = 1 + m := by + simp only [mul_add, mul_one, Finset.sum_add_distrib, hprob, m] + have hmm : (∑ i, w i * (1 - a i)) = 1 - m := by + simp only [mul_sub, mul_one, Finset.sum_sub_distrib, hprob, m] + have hp := weighted_perspective_gap w (fun i => 1 + a i) b (1 + m) k hw + (fun i => pair_denom_add_pos (a i) (b i) (hdom i)) + (pair_denom_add_pos m k hc) hmp rfl + (fun i => pair_abs_lt_denom_add (a i) (b i) (hdom i)) + have hm := weighted_perspective_gap w (fun i => 1 - a i) b (1 - m) k hw + (fun i => pair_denom_sub_pos (a i) (b i) (hdom i)) + (pair_denom_sub_pos m k hc) hmm rfl + (fun i => pair_abs_lt_denom_sub (a i) (b i) (hdom i)) + simpa only [mul_one] using weighted_pair_gap_combine w a b m k 1 hdom hc + (by simpa only [mul_one] using hp) (by simpa only [mul_one] using hm) + +private theorem lambda_ratio_min_le (m k t : ℝ) (hk : 0 ≤ k) + (ht : 0 < t) (htmax : t ≤ 1 + |m|) (hkt : k < t) : + lambda ((k / (1 + |m|)) ^ 2) ≤ lambda ((k / t) ^ 2) := by + have hmax : 0 < 1 + |m| := by positivity + have hx : 0 ≤ k / (1 + |m|) := div_nonneg hk hmax.le + have hy : 0 ≤ k / t := div_nonneg hk ht.le + have hxy := div_le_div_of_nonneg_left hk ht htmax + have hy1 : k / t < 1 := (div_lt_one ht).mpr hkt + apply monotoneOn_lambda + · exact ⟨sq_nonneg _, by nlinarith⟩ + · exact ⟨sq_nonneg _, by nlinarith⟩ + · exact pow_le_pow_left₀ hx hxy 2 + +theorem weighted_pair_jensen_gap_strengthened (w a b : ι → ℝ) + (hw : ∀ i, 0 ≤ w i) (hprob : ∑ i, w i = 1) + (hdom : ∀ i, |a i| + |b i| < 1) (hb : ∀ i, 0 ≤ b i) : + ((∑ i, w i * (b i) ^ 2 / (1 - (a i) ^ 2)) - + (∑ i, w i * b i) ^ 2 / (1 - (∑ i, w i * a i) ^ 2)) * + lambda (((∑ i, w i * b i) / (1 + |∑ i, w i * a i|)) ^ 2) ≤ + 2 * ((∑ i, w i * pairEntropyGap (a i) (b i)) - + pairEntropyGap (∑ i, w i * a i) (∑ i, w i * b i)) := by + let m := ∑ i, w i * a i + let k := ∑ i, w i * b i + have hc : |m| + |k| < 1 := weighted_pair_mean_interior w a b hw hprob hdom + have hk : 0 ≤ k := Finset.sum_nonneg (fun i _ => mul_nonneg (hw i) (hb i)) + have htp := pair_denom_add_pos m k hc + have htm := pair_denom_sub_pos m k hc + have hp0 : ∀ i, 0 < 1 + a i := fun i => pair_denom_add_pos (a i) (b i) (hdom i) + have hm0 : ∀ i, 0 < 1 - a i := fun i => pair_denom_sub_pos (a i) (b i) (hdom i) + have hmp : (∑ i, w i * (1 + a i)) = 1 + m := by + simp only [mul_add, mul_one, Finset.sum_add_distrib, hprob, m] + have hmm : (∑ i, w i * (1 - a i)) = 1 - m := by + simp only [mul_sub, mul_one, Finset.sum_sub_distrib, hprob, m] + have hp := weighted_perspective_gap_strengthened w (fun i => 1 + a i) b (1 + m) k + hw hp0 htp hmp rfl (fun i => pair_abs_lt_denom_add (a i) (b i) (hdom i)) hb + have hm := weighted_perspective_gap_strengthened w (fun i => 1 - a i) b (1 - m) k + hw hm0 htm hmm rfl (fun i => pair_abs_lt_denom_sub (a i) (b i) (hdom i)) hb + have hvp := weighted_ratio_variance_nonneg w (fun i => 1 + a i) b (1 + m) k + hw hp0 htp hmp rfl + have hvm := weighted_ratio_variance_nonneg w (fun i => 1 - a i) b (1 - m) k + hw hm0 htm hmm rfl + have hcp := lambda_ratio_min_le m k (1 + m) hk htp (by linarith [le_abs_self m]) + (by simpa only [abs_of_nonneg hk] using pair_abs_lt_denom_add m k hc) + have hcm := lambda_ratio_min_le m k (1 - m) hk htm (by linarith [neg_le_abs m]) + (by simpa only [abs_of_nonneg hk] using pair_abs_lt_denom_sub m k hc) + exact weighted_pair_gap_combine w a b m k _ hdom hc + ((mul_le_mul_of_nonneg_left hcp hvp).trans hp) + ((mul_le_mul_of_nonneg_left hcm hvm).trans hm) + +end Weighted + +private theorem cube_uniform_weights_sum_one (n : ℕ) : + ∑ _ : Cube n, ((2 : ℝ) ^ n)⁻¹ = 1 := by + simp [Cube, LeanBlast.GotsmanLinial.Cube] + +private theorem cubeAverage_as_weighted_sum {n : ℕ} (f : Cube n → ℝ) : + cubeAverage f = ∑ x, ((2 : ℝ) ^ n)⁻¹ * f x := by + rw [cubeAverage, ← Finset.mul_sum] + ring + +theorem convexOn_cubeAverage_le {n : ℕ} (F : ℝ → ℝ) {s : Set ℝ} + (hF : ConvexOn ℝ s F) (v : Cube n → ℝ) (hv : ∀ x, v x ∈ s) : + F (cubeAverage v) ≤ cubeAverage (fun x => F (v x)) := by + simp only [cubeAverage_as_weighted_sum] + simpa only [smul_eq_mul] using hF.map_sum_le + (fun (_ : Cube n) _ => inv_nonneg.mpr (pow_nonneg (by norm_num : (0 : ℝ) ≤ 2) n)) + (cube_uniform_weights_sum_one n) (fun x _ => hv x) + +theorem pair_variance_gap_lower_bound {n : ℕ} (a b : Cube n → ℝ) + (hdom : ∀ x, |a x| + |b x| < 1) : + (cubeAverage b) ^ 2 / cubeAverage (fun x => 1 - (a x) ^ 2) - + (cubeAverage b) ^ 2 / (1 - (cubeAverage a) ^ 2) ≤ + cubeAverage (fun x => (b x) ^ 2 / (1 - (a x) ^ 2)) - + (cubeAverage b) ^ 2 / (1 - (cubeAverage a) ^ 2) := by + simpa only [cubeAverage_as_weighted_sum, ← mul_div_assoc] using + weighted_variance_gap_lower_bound (fun _ => ((2 : ℝ) ^ n)⁻¹) a b + (fun _ => by positivity) (cube_uniform_weights_sum_one n) hdom + +theorem pair_variance_gap_nonneg {n : ℕ} (a b : Cube n → ℝ) + (hdom : ∀ x, |a x| + |b x| < 1) : + 0 ≤ cubeAverage (fun x => (b x) ^ 2 / (1 - (a x) ^ 2)) - + (cubeAverage b) ^ 2 / (1 - (cubeAverage a) ^ 2) := by + simpa only [cubeAverage_as_weighted_sum, ← mul_div_assoc] using + weighted_variance_gap_nonneg (fun _ => ((2 : ℝ) ^ n)⁻¹) a b + (fun _ => by positivity) (cube_uniform_weights_sum_one n) hdom + +theorem pair_jensen_gap {n : ℕ} (a b : Cube n → ℝ) + (hdom : ∀ x, |a x| + |b x| < 1) : + cubeAverage (fun x => (b x) ^ 2 / (1 - (a x) ^ 2)) - + (cubeAverage b) ^ 2 / (1 - (cubeAverage a) ^ 2) ≤ + 2 * (cubeAverage (fun x => pairEntropyGap (a x) (b x)) - + pairEntropyGap (cubeAverage a) (cubeAverage b)) := by + simpa only [cubeAverage_as_weighted_sum, ← mul_div_assoc] using + weighted_pair_jensen_gap (fun _ => ((2 : ℝ) ^ n)⁻¹) a b + (fun _ => by positivity) (cube_uniform_weights_sum_one n) hdom + +theorem pair_jensen_gap_strengthened {n : ℕ} (a b : Cube n → ℝ) + (hdom : ∀ x, |a x| + |b x| < 1) (hb : ∀ x, 0 ≤ b x) : + (cubeAverage (fun x => (b x) ^ 2 / (1 - (a x) ^ 2)) - + (cubeAverage b) ^ 2 / (1 - (cubeAverage a) ^ 2)) * + lambda (((cubeAverage b) / (1 + |cubeAverage a|)) ^ 2) ≤ + 2 * (cubeAverage (fun x => pairEntropyGap (a x) (b x)) - + pairEntropyGap (cubeAverage a) (cubeAverage b)) := by + simpa only [cubeAverage_as_weighted_sum, ← mul_div_assoc] using + weighted_pair_jensen_gap_strengthened (fun _ => ((2 : ℝ) ^ n)⁻¹) a b + (fun _ => by positivity) (cube_uniform_weights_sum_one n) hdom hb + +theorem pair_jensen_gap_nonneg {n : ℕ} (a b : Cube n → ℝ) + (hdom : ∀ x, |a x| + |b x| < 1) : + pairEntropyGap (cubeAverage a) (cubeAverage b) ≤ + cubeAverage (fun x => pairEntropyGap (a x) (b x)) := by + have hv := pair_variance_gap_nonneg a b hdom + have hj := pair_jensen_gap a b hdom + linarith + +end LeanBlast.CourtadeKumar + +end + +end OAI diff --git a/lean/OAI/InformationTheory/BooleanNoise/KRegularity.lean b/lean/OAI/InformationTheory/BooleanNoise/KRegularity.lean new file mode 100644 index 0000000000000000000000000000000000000000..73887befb007b5031078081bf48a54f63909a0f8 --- /dev/null +++ b/lean/OAI/InformationTheory/BooleanNoise/KRegularity.lean @@ -0,0 +1,258 @@ +import OAI.InformationTheory.BooleanNoise.Basic +import OAI.InformationTheory.BooleanNoise.InverseScalars +import OAI.InformationTheory.BooleanNoise.InverseRegularity +import OAI.InformationTheory.BooleanNoise.CurvatureBounds +import Mathlib.Analysis.Calculus.Deriv.MeanValue +import Mathlib.Analysis.Convex.Deriv +import Mathlib.Topology.MetricSpace.Lipschitz +import Mathlib.Tactic + +namespace OAI + +open Set Filter +open scoped Topology + +namespace LeanBlast.CourtadeKumar + +theorem hasDerivAt_tangent_extension (F : ℝ → ℝ) {c d : ℝ} + (hF : HasDerivAt F d c) : + HasDerivAt (fun s => if s ≤ c then F s else F c + d * (s - c)) d c := by + let T : ℝ → ℝ := fun s => if s ≤ c then F s else F c + d * (s - c) + have hleft : HasDerivWithinAt T d (Iic c) c := by + apply hF.hasDerivWithinAt.congr + · intro s hs + change s ≤ c at hs + simp only [T, ite_eq_left hs] + · simp [T] + have hline : HasDerivAt (fun s : ℝ => F c + d * (s - c)) d c := by + convert! (((hasDerivAt_id c).sub_const c).const_mul d).const_add (F c) using 1 + ring + have hright : HasDerivWithinAt T d (Ici c) c := by + apply hline.hasDerivWithinAt.congr + · intro s hs + change c ≤ s at hs + rcases hs.eq_or_lt with rfl | hs + · simp [T] + · simp [T, not_le.mpr hs] + · simp [T] + simpa only [Iic_union_Ici, hasDerivWithinAt_univ] using hleft.union hright + +theorem clamp_nonexpansive (c x y : ℝ) : + |min (max x 0) c - min (max y 0) c| ≤ |x - y| := by + have h : LipschitzWith 1 (fun s : ℝ => min (max s 0) c) := + (LipschitzWith.id.max_const 0).min_const c + simpa only [Real.dist_eq, NNReal.coe_one, one_mul] using h.dist_le_mul x y + +theorem K_eq_zero_of_nonpos {s : ℝ} (hs : s ≤ 0) : K s = 0 := by simp [K, hs] + +theorem KDeriv_eq_clamp (s : ℝ) : + KDeriv s = rDeriv (min (max s 0) s0) - 2 := by + by_cases hs : s ≤ 0 + · simp [KDeriv, hs, min_eq_left s0_pos.le] + · have hs0 : 0 ≤ s := (lt_of_not_ge hs).le + by_cases hsc : s ≤ s0 + · simp [KDeriv, hs, hsc, max_eq_left hs0] + · simp [KDeriv, hs, hsc, max_eq_left hs0, min_eq_right (le_of_not_ge hsc)] + +theorem K_eq_rGap_nonneg {s : ℝ} (hs : 0 ≤ s) (hsc : s ≤ s0) : K s = rGap s := by + rcases hs.eq_or_lt with rfl | hs + · simp + · exact K_eq_rGap hs hsc + +theorem clamp_mem_inverse_domain (s : ℝ) : min (max s 0) s0 ∈ Ico 0 ell := + ⟨le_min (le_max_right s 0) s0_pos.le, (min_le_right _ _).trans_lt s0_lt_ell⟩ + +theorem hasDerivAt_K_pos {s : ℝ} (hs : 0 < s) : HasDerivAt K (KDeriv s) s := by + by_cases hsc : s < s0 + · have he : K =ᶠ[𝓝 s] rGap := by + filter_upwards [Ioo_mem_nhds hs hsc] with t ht + exact K_eq_rGap ht.1 ht.2.le + have hKd : KDeriv s = rDeriv s - 2 := by simp [KDeriv, not_le.mpr hs, hsc.le] + rw [hKd] + exact (hasDerivAt_rGap ⟨hs, hsc.trans s0_lt_ell⟩).congr_of_eventuallyEq he + · have hsc' : s0 ≤ s := le_of_not_gt hsc + rcases hsc'.eq_or_lt with rfl | hsc' + · have hjoin := hasDerivAt_tangent_extension rGap (hasDerivAt_rGap ⟨s0_pos, s0_lt_ell⟩) + have he : K =ᶠ[𝓝 s0] + (fun t => if t ≤ s0 then rGap t else rGap s0 + (rDeriv s0 - 2) * (t - s0)) := by + filter_upwards [Ioi_mem_nhds s0_pos] with t ht + change 0 < t at ht + simp only [K, ite_eq_right (not_le.mpr ht)] + have hKd : KDeriv s0 = rDeriv s0 - 2 := by simp [KDeriv, not_le.mpr s0_pos] + rw [hKd] + exact hjoin.congr_of_eventuallyEq he + · have hline : HasDerivAt + (fun t : ℝ => rGap s0 + (rDeriv s0 - 2) * (t - s0)) (rDeriv s0 - 2) s := by + convert! (((hasDerivAt_id s).sub_const s0).const_mul (rDeriv s0 - 2)).const_add + (rGap s0) using 1 + ring + have he : K =ᶠ[𝓝 s] + (fun t => rGap s0 + (rDeriv s0 - 2) * (t - s0)) := by + filter_upwards [Ioi_mem_nhds hsc'] with t ht + exact K_eq_tangent (s0_pos.trans ht) ht.le + have hKd : KDeriv s = rDeriv s0 - 2 := by + simp [KDeriv, not_le.mpr hs, not_le.mpr hsc'] + rw [hKd] + exact hline.congr_of_eventuallyEq he + +theorem hasDerivAt_K_zero_of_right_derivative + (hzero : HasDerivWithinAt rGap 0 (Ici 0) 0) : HasDerivAt K 0 0 := by + have hleft : HasDerivWithinAt K 0 (Iic 0) 0 := by + apply (hasDerivAt_const (0 : ℝ) (0 : ℝ)).hasDerivWithinAt.congr + · intro s hs + exact K_eq_zero_of_nonpos hs + · simp + have hright : HasDerivWithinAt K 0 (Ici 0) 0 := by + apply hzero.congr_of_eventuallyEq + · have hnear : ∀ᶠ s in 𝓝[Ici (0 : ℝ)] 0, s < s0 := + Filter.Eventually.filter_mono nhdsWithin_le_nhds (Iio_mem_nhds s0_pos) + filter_upwards [self_mem_nhdsWithin, hnear] with s hs hs0 + exact K_eq_rGap_nonneg hs hs0.le + · simp + simpa only [Iic_union_Ici, hasDerivWithinAt_univ] using hleft.union hright + +theorem KDeriv_monotone_of_rDeriv + (hmono : MonotoneOn rDeriv (Ico 0 ell)) : Monotone KDeriv := by + intro x y hxy + rw [KDeriv_eq_clamp, KDeriv_eq_clamp] + exact sub_le_sub_right + (hmono (clamp_mem_inverse_domain x) (clamp_mem_inverse_domain y) + (min_le_min_right s0 (max_le_max_right 0 hxy))) 2 + +theorem KDeriv_lipschitz_of_rDeriv {C : ℝ} (hC : 0 ≤ C) + (hbound : ∀ x ∈ Icc (0 : ℝ) s0, ∀ y ∈ Icc (0 : ℝ) s0, + |rDeriv x - rDeriv y| ≤ C * |x - y|) (x y : ℝ) : + |KDeriv x - KDeriv y| ≤ C * |x - y| := by + rw [KDeriv_eq_clamp, KDeriv_eq_clamp] + have hx : min (max x 0) s0 ∈ Icc (0 : ℝ) s0 := + ⟨le_min (le_max_right x 0) s0_pos.le, min_le_right _ _⟩ + have hy : min (max y 0) s0 ∈ Icc (0 : ℝ) s0 := + ⟨le_min (le_max_right y 0) s0_pos.le, min_le_right _ _⟩ + rw [show rDeriv (min (max x 0) s0) - 2 - (rDeriv (min (max y 0) s0) - 2) = + rDeriv (min (max x 0) s0) - rDeriv (min (max y 0) s0) by ring] + exact (hbound _ hx _ hy).trans + (mul_le_mul_of_nonneg_left (clamp_nonexpansive s0 x y) hC) + +theorem rDeriv_increment_le_of_continuous + (hcont : ContinuousOn rDeriv (Icc 0 s0)) + {x y : ℝ} (hx : x ∈ Icc 0 s0) (hy : y ∈ Icc 0 s0) (hxy : x ≤ y) : + rDeriv y - rDeriv x ≤ (1 / ell) * (y - x) := by + have hdiff : DifferentiableOn ℝ rDeriv (interior (Icc 0 s0)) := by + intro s hs + have hsi : s ∈ Ioo 0 s0 := by simpa only [interior_Icc] using hs + exact (hasDerivAt_rDeriv ⟨hsi.1, hsi.2.trans s0_lt_ell⟩).differentiableAt.differentiableWithinAt + have hbound : ∀ s ∈ interior (Icc 0 s0), deriv rDeriv s ≤ 1 / ell := by + intro s hs + have hsi : s ∈ Ioo 0 s0 := by simpa only [interior_Icc] using hs + rw [(hasDerivAt_rDeriv ⟨hsi.1, hsi.2.trans s0_lt_ell⟩).deriv] + exact rSecondDeriv_le_inv_ell hsi.1.le hsi.2.le + exact (convex_Icc (0 : ℝ) s0).image_sub_le_mul_sub_of_deriv_le + hcont hdiff hbound x hx y hy hxy + +theorem rDeriv_lipschitz_of_continuous_monotone + (hcont : ContinuousOn rDeriv (Icc 0 s0)) + (hmono : MonotoneOn rDeriv (Icc 0 s0)) + {x y : ℝ} (hx : x ∈ Icc 0 s0) (hy : y ∈ Icc 0 s0) : + |rDeriv x - rDeriv y| ≤ (1 / ell) * |x - y| := by + rcases le_total x y with hxy | hyx + · calc + |rDeriv x - rDeriv y| = rDeriv y - rDeriv x := by + rw [abs_of_nonpos (sub_nonpos.mpr (hmono hx hy hxy))] + ring + _ ≤ (1 / ell) * (y - x) := rDeriv_increment_le_of_continuous hcont hx hy hxy + _ = (1 / ell) * |x - y| := by rw [abs_of_nonpos (sub_nonpos.mpr hxy)]; ring + · rw [abs_of_nonneg (sub_nonneg.mpr (hmono hy hx hyx)), + abs_of_nonneg (sub_nonneg.mpr hyx)] + exact rDeriv_increment_le_of_continuous hcont hy hx hyx + +theorem K_le_rGap_of_convex (hconvex : ConvexOn ℝ (Ico 0 ell) rGap) + {s : ℝ} (hs : 0 ≤ s) (hsell : s < ell) : K s ≤ rGap s := by + by_cases hsc : s ≤ s0 + · rw [K_eq_rGap_nonneg hs hsc] + · have hsc' : s0 < s := lt_of_not_ge hsc + rw [K_eq_tangent (s0_pos.trans hsc') hsc'.le] + have hslope := hconvex.le_slope_of_hasDerivAt ⟨s0_pos.le, s0_lt_ell⟩ + ⟨hs, hsell⟩ hsc' (hasDerivAt_rGap ⟨s0_pos, s0_lt_ell⟩) + rw [slope_def_field] at hslope + have hmul := (le_div_iff₀ (sub_pos.mpr hsc')).mp hslope + linarith + +theorem K_nonneg_of_rGap_nonneg + (hgap : ∀ s : ℝ, 0 ≤ s → s < ell → 0 ≤ rGap s) + (hslope : 0 ≤ rDeriv s0 - 2) (s : ℝ) : 0 ≤ K s := by + by_cases hs : s ≤ 0 + · rw [K_eq_zero_of_nonpos hs] + · have hs' : 0 < s := lt_of_not_ge hs + by_cases hsc : s ≤ s0 + · rw [K_eq_rGap hs' hsc] + exact hgap s hs'.le (hsc.trans_lt s0_lt_ell) + · have hsc' : s0 < s := lt_of_not_ge hsc + rw [K_eq_tangent hs' hsc'.le] + exact add_nonneg (hgap s0 s0_pos.le s0_lt_ell) + (mul_nonneg hslope (sub_nonneg.mpr hsc'.le)) + +theorem convexOn_K_of_shape + (hzero : HasDerivWithinAt rGap 0 (Ici 0) 0) + (hmono : MonotoneOn rDeriv (Ico 0 ell)) : ConvexOn ℝ (Ici 0) K := by + have hd : ∀ s ∈ Ici (0 : ℝ), HasDerivAt K (KDeriv s) s := by + intro s hs + rcases (show 0 ≤ s from hs).eq_or_lt with rfl | hs + · simpa only [KDeriv_zero] using hasDerivAt_K_zero_of_right_derivative hzero + · exact hasDerivAt_K_pos hs + have hc : ContinuousOn K (Ici 0) := fun s hs => (hd s hs).continuousAt.continuousWithinAt + have hdiff : DifferentiableOn ℝ K (interior (Ici 0)) := by + intro s hs + exact (hd s (interior_subset hs)).differentiableAt.differentiableWithinAt + have hm : MonotoneOn (deriv K) (interior (Ici 0)) := by + intro x hx y hy hxy + rw [(hd x (interior_subset hx)).deriv, (hd y (interior_subset hy)).deriv] + exact KDeriv_monotone_of_rDeriv hmono hxy + exact hm.convexOn_of_deriv (convex_Ici 0) hc hdiff + +theorem hasDerivAt_K {s : ℝ} (hs : 0 ≤ s) : HasDerivAt K (KDeriv s) s := by + rcases hs.eq_or_lt with rfl | hs + · simpa only [KDeriv_zero] using + hasDerivAt_K_zero_of_right_derivative hasDerivWithinAt_rGap_zero + · exact hasDerivAt_K_pos hs + +theorem continuousOn_K : ContinuousOn K (Ici 0) := + fun _s hs => (hasDerivAt_K hs).continuousAt.continuousWithinAt + +theorem monotone_KDeriv : Monotone KDeriv := + KDeriv_monotone_of_rDeriv monotoneOn_rDeriv + +theorem KDeriv_nonneg (s : ℝ) : 0 ≤ KDeriv s := by + rw [KDeriv_eq_clamp] + exact sub_nonneg.mpr (rDeriv_ge_two (clamp_mem_inverse_domain s).1 + (clamp_mem_inverse_domain s).2) + +theorem monotoneOn_K : MonotoneOn K (Ici 0) := by + refine monotoneOn_of_hasDerivWithinAt_nonneg (f' := KDeriv) + (convex_Ici 0) continuousOn_K ?_ ?_ + · intro s hs + exact (hasDerivAt_K (interior_subset hs)).hasDerivWithinAt + · intro s _ + exact KDeriv_nonneg s + +theorem convexOn_K : ConvexOn ℝ (Ici 0) K := + convexOn_K_of_shape hasDerivWithinAt_rGap_zero monotoneOn_rDeriv + +theorem K_nonneg (s : ℝ) : 0 ≤ K s := + K_nonneg_of_rGap_nonneg (fun _ hs hsell => rGap_nonneg hs hsell) + (sub_nonneg.mpr (rDeriv_ge_two s0_pos.le s0_lt_ell)) s + +theorem K_le_rGap {s : ℝ} (hs : 0 ≤ s) (hsell : s < ell) : K s ≤ rGap s := + K_le_rGap_of_convex convexOn_rGap hs hsell + +theorem KDeriv_lipschitz (x y : ℝ) : + |KDeriv x - KDeriv y| ≤ (1 / ell) * |x - y| := by + apply KDeriv_lipschitz_of_rDeriv (le_of_lt (one_div_pos.mpr ell_pos)) + intro a ha b hb + have hsub : Icc (0 : ℝ) s0 ⊆ Ico 0 ell := + fun _ ht => ⟨ht.1, ht.2.trans_lt s0_lt_ell⟩ + exact rDeriv_lipschitz_of_continuous_monotone + (continuousOn_rDeriv.mono hsub) (monotoneOn_rDeriv.mono hsub) ha hb + +end LeanBlast.CourtadeKumar + +end OAI diff --git a/lean/OAI/InformationTheory/BooleanNoise/LRegularity.lean b/lean/OAI/InformationTheory/BooleanNoise/LRegularity.lean new file mode 100644 index 0000000000000000000000000000000000000000..fc0fb56b2d756a0ddf5b5ba2dbd52111ae9da53f --- /dev/null +++ b/lean/OAI/InformationTheory/BooleanNoise/LRegularity.lean @@ -0,0 +1,122 @@ +import OAI.InformationTheory.BooleanNoise.InverseRegularity +import OAI.InformationTheory.BooleanNoise.CurvatureBounds + +namespace OAI + +noncomputable section + +open Set Filter +open scoped Topology + +namespace LeanBlast.CourtadeKumar + +def LSecondDeriv (x : ℝ) : ℝ := + if x < ell then rSecondDeriv (ell - x) else 0 + +theorem LDeriv_eq_zero_of_ell_le {x : ℝ} (hx : ell ≤ x) : LDeriv x = 0 := by + simp [LDeriv, not_lt.mpr hx] + +theorem LSecondDeriv_eq_zero_of_ell_le {x : ℝ} (hx : ell ≤ x) : LSecondDeriv x = 0 := by + simp [LSecondDeriv, not_lt.mpr hx] + +private theorem L_eq_rGap_on_left {x : ℝ} (hx : x ∈ Ioc 0 ell) : + L x = rGap (ell - x) := by + rcases hx.2.lt_or_eq with hlt | rfl + · exact L_eq_rGap ⟨hx.1, hlt⟩ + · simp [L] + +private theorem LDeriv_eq_formula_on_left {x : ℝ} (hx : x ∈ Ioc 0 ell) : + LDeriv x = 2 - rDeriv (ell - x) := by + rcases hx.2.lt_or_eq with hlt | rfl + · exact ite_eq_left ⟨hx.1, hlt⟩ + · simp [LDeriv] + +private theorem L_join_neighborhood : Ioc (0 : ℝ) ell ∪ Ici ell ∈ 𝓝 ell := by + apply mem_of_superset (Ioi_mem_nhds ell_pos) + intro x hx + rcases le_total x ell with h | h + · exact Or.inl ⟨hx, h⟩ + · exact Or.inr h + +theorem hasDerivAt_L_of_gt {x : ℝ} (hx : ell < x) : + HasDerivAt L (LDeriv x) x := by + have he : L =ᶠ[𝓝 x] (fun _ => 0) := by + filter_upwards [Ioi_mem_nhds hx] with y hy + exact L_eq_zero_of_ell_le (le_of_lt hy) + rw [LDeriv_eq_zero_of_ell_le hx.le] + exact (hasDerivAt_const x (0 : ℝ)).congr_of_eventuallyEq he + +theorem hasDerivAt_LDeriv_of_gt {x : ℝ} (hx : ell < x) : + HasDerivAt LDeriv 0 x := by + have he : LDeriv =ᶠ[𝓝 x] (fun _ => 0) := by + filter_upwards [Ioi_mem_nhds hx] with y hy + exact LDeriv_eq_zero_of_ell_le (le_of_lt hy) + exact (hasDerivAt_const x (0 : ℝ)).congr_of_eventuallyEq he + +theorem hasDerivAt_LDeriv {x : ℝ} (hx : 0 < x) (hne : x ≠ ell) : + HasDerivAt LDeriv (LSecondDeriv x) x := by + rcases lt_or_gt_of_ne hne with hlt | hgt + · simpa only [LSecondDeriv, ite_eq_left hlt] using hasDerivAt_LDeriv_of_lt ⟨hx, hlt⟩ + · rw [LSecondDeriv_eq_zero_of_ell_le hgt.le] + exact hasDerivAt_LDeriv_of_gt hgt + +theorem hasDerivAt_L_at_ell : HasDerivAt L (LDeriv ell) ell := by + have hleft0 : HasDerivWithinAt (fun x : ℝ => rGap (ell - x)) 0 (Ioc 0 ell) ell := by + convert! hasDerivWithinAt_rGap_zero.comp_of_eq ell + ((hasDerivAt_id ell).const_sub ell).hasDerivWithinAt + (show MapsTo (fun x : ℝ => ell - x) (Ioc 0 ell) (Ici 0) from + fun x hx => sub_nonneg.mpr hx.2) (by simp) using 1 + simp + have hleft : HasDerivWithinAt L 0 (Ioc 0 ell) ell := + hleft0.congr (fun _ hx => L_eq_rGap_on_left hx) (by simp [L]) + have hright : HasDerivWithinAt L 0 (Ici ell) ell := + (hasDerivAt_const ell (0 : ℝ)).hasDerivWithinAt.congr + (fun _ hx => L_eq_zero_of_ell_le hx) (L_eq_zero_of_ell_le le_rfl) + simpa only [LDeriv_eq_zero_of_ell_le (le_refl ell)] using + (hleft.union hright).hasDerivAt L_join_neighborhood + +theorem hasDerivAt_L {x : ℝ} (hx : 0 < x) : HasDerivAt L (LDeriv x) x := by + rcases lt_trichotomy x ell with hlt | rfl | hgt + · exact hasDerivAt_L_of_lt ⟨hx, hlt⟩ + · exact hasDerivAt_L_at_ell + · exact hasDerivAt_L_of_gt hgt + +theorem continuousAt_LDeriv_at_ell : ContinuousAt LDeriv ell := by + have hr : ContinuousWithinAt rDeriv (Ico 0 ell) 0 := + continuousOn_rDeriv 0 ⟨le_rfl, ell_pos⟩ + have hcomp : ContinuousWithinAt (fun x : ℝ => rDeriv (ell - x)) (Ioc 0 ell) ell := by + exact hr.comp_of_eq + ((continuous_const.sub continuous_id).continuousWithinAt : + ContinuousWithinAt (fun x : ℝ => ell - x) (Ioc 0 ell) ell) + (show MapsTo (fun x : ℝ => ell - x) (Ioc 0 ell) (Ico 0 ell) from + fun x hx => ⟨sub_nonneg.mpr hx.2, by linarith [hx.1]⟩) (by simp) + have hleft : ContinuousWithinAt LDeriv (Ioc 0 ell) ell := + (continuousWithinAt_const.sub hcomp).congr + (fun _ hx => LDeriv_eq_formula_on_left hx) (by simp [LDeriv]) + have hright : ContinuousWithinAt LDeriv (Ici ell) ell := + continuousWithinAt_const.congr (fun _ hx => LDeriv_eq_zero_of_ell_le hx) + (LDeriv_eq_zero_of_ell_le le_rfl) + exact (hleft.union hright).continuousAt L_join_neighborhood + +theorem continuousOn_LDeriv : ContinuousOn LDeriv (Ioi 0) := by + intro x hx + by_cases hxe : x = ell + · subst x + exact continuousAt_LDeriv_at_ell.continuousWithinAt + · exact (hasDerivAt_LDeriv hx hxe).continuousAt.continuousWithinAt + +theorem continuousOn_L : ContinuousOn L (Ioi 0) := + fun _ hx => (hasDerivAt_L hx).continuousAt.continuousWithinAt + +theorem LSecondDeriv_bound {x : ℝ} (hx : 0 < x) : + x ^ 2 * LSecondDeriv x ≤ 2 / 3 := by + by_cases h : x < ell + · simpa only [LSecondDeriv, ite_eq_left h] using L_curvature_bound ⟨hx, h⟩ + · rw [LSecondDeriv_eq_zero_of_ell_le (le_of_not_gt h)] + norm_num + +end LeanBlast.CourtadeKumar + +end + +end OAI diff --git a/lean/OAI/InformationTheory/BooleanNoise/LShape.lean b/lean/OAI/InformationTheory/BooleanNoise/LShape.lean new file mode 100644 index 0000000000000000000000000000000000000000..a488486fe436958c192af6afd8958549c731321a --- /dev/null +++ b/lean/OAI/InformationTheory/BooleanNoise/LShape.lean @@ -0,0 +1,78 @@ +import OAI.InformationTheory.BooleanNoise.LRegularity + +namespace OAI + +noncomputable section + +open Set + +namespace LeanBlast.CourtadeKumar + +theorem L_eq_rGap_max {x : ℝ} (hx : 0 < x) : + L x = rGap (max (ell - x) 0) := by + by_cases hxl : x < ell + · rw [L_eq_rGap ⟨hx, hxl⟩, max_eq_left (sub_nonneg.mpr hxl.le)] + · rw [L_eq_zero_of_ell_le (le_of_not_gt hxl), + max_eq_right (sub_nonpos.mpr (le_of_not_gt hxl)), rGap_zero] + +theorem positivePart_ell_sub_mem {x : ℝ} (hx : 0 < x) : + max (ell - x) 0 ∈ Ico 0 ell := by + exact ⟨le_max_right _ _, max_lt (by linarith) ell_pos⟩ + +theorem L_nonneg {x : ℝ} (hx : 0 < x) : 0 ≤ L x := by + rw [L_eq_rGap_max hx] + exact rGap_nonneg (positivePart_ell_sub_mem hx).1 (positivePart_ell_sub_mem hx).2 + +theorem antitoneOn_L : AntitoneOn L (Ioi 0) := by + intro x hx y hy hxy + rw [L_eq_rGap_max hx, L_eq_rGap_max hy] + exact monotoneOn_rGap (positivePart_ell_sub_mem hy) (positivePart_ell_sub_mem hx) + (max_le_max (sub_le_sub_left hxy ell) le_rfl) + +theorem convexOn_L : ConvexOn ℝ (Ioi 0) L := by + refine ⟨convex_Ioi 0, ?_⟩ + intro x hx y hy a b ha hb hab + have hz : 0 < a * x + b * y := by + simpa only [smul_eq_mul, mem_Ioi] using (convex_Ioi (0 : ℝ)) hx hy ha hb hab + have hsum : a * max (ell - x) 0 + b * max (ell - y) 0 ∈ Ico 0 ell := by + simpa only [smul_eq_mul] using + (convex_Ico (0 : ℝ) ell) (positivePart_ell_sub_mem hx) + (positivePart_ell_sub_mem hy) ha hb hab + have hmax : max (ell - (a * x + b * y)) 0 ≤ + a * max (ell - x) 0 + b * max (ell - y) 0 := by + apply max_le + · calc + ell - (a * x + b * y) = a * (ell - x) + b * (ell - y) := by + nlinarith [congrArg (fun t : ℝ => t * ell) hab] + _ ≤ _ := add_le_add (mul_le_mul_of_nonneg_left (le_max_left _ _) ha) + (mul_le_mul_of_nonneg_left (le_max_left _ _) hb) + · exact add_nonneg (mul_nonneg ha (le_max_right _ _)) + (mul_nonneg hb (le_max_right _ _)) + simp only [smul_eq_mul] + rw [L_eq_rGap_max hz, L_eq_rGap_max hx, L_eq_rGap_max hy] + exact (monotoneOn_rGap (positivePart_ell_sub_mem hz) hsum hmax).trans + (convexOn_rGap.2 (positivePart_ell_sub_mem hx) (positivePart_ell_sub_mem hy) + ha hb hab) + +theorem L_tangent_le {x y : ℝ} (hx : 0 < x) (hy : 0 < y) : + L x + LDeriv x * (y - x) ≤ L y := by + rcases lt_trichotomy x y with hxy | rfl | hyx + · have hs := convexOn_L.le_slope_of_hasDerivAt hx hy hxy (hasDerivAt_L hx) + rw [slope_def_field] at hs + have hm := (le_div_iff₀ (sub_pos.mpr hxy)).mp hs + linarith + · simp + · have hs := convexOn_L.slope_le_of_hasDerivAt hy hx hyx (hasDerivAt_L hx) + rw [slope_def_field] at hs + have hm := (div_le_iff₀ (sub_pos.mpr hyx)).mp hs + nlinarith + +theorem L_support : ∀ x, 0 < x → ∀ y, 0 < y → + L x + LDeriv x * (y - x) ≤ L y := + fun _ hx _ hy => L_tangent_le hx hy + +end LeanBlast.CourtadeKumar + +end + +end OAI diff --git a/lean/OAI/InformationTheory/BooleanNoise/LambdaScalars.lean b/lean/OAI/InformationTheory/BooleanNoise/LambdaScalars.lean new file mode 100644 index 0000000000000000000000000000000000000000..2a480dfa5124ca1589c18d8e0afdf389f8f421d6 --- /dev/null +++ b/lean/OAI/InformationTheory/BooleanNoise/LambdaScalars.lean @@ -0,0 +1,63 @@ +import OAI.InformationTheory.BooleanNoise.Basic +import Mathlib.Analysis.SpecialFunctions.Log.Deriv +import Mathlib.Tactic + +namespace OAI + +noncomputable section + +open scoped BigOperators Topology +open Set Filter + +namespace LeanBlast.CourtadeKumar + +def lambda (z : ℝ) : ℝ := if z = 0 then 1 else -Real.log (1 - z) / z + +@[simp] theorem lambda_zero : lambda 0 = 1 := by simp [lambda] + +theorem lambda_of_ne_zero {z : ℝ} (hz : z ≠ 0) : + lambda z = -Real.log (1 - z) / z := by simp [lambda, hz] + +theorem mul_lambda (z : ℝ) : z * lambda z = -Real.log (1 - z) := by + by_cases hz : z = 0 + · simp [hz] + · rw [lambda_of_ne_zero hz] + field_simp + +theorem hasSum_lambda {z : ℝ} (hz0 : 0 ≤ z) (hz1 : z < 1) : + HasSum (fun j : ℕ => z ^ j / ((j : ℝ) + 1)) (lambda z) := by + by_cases hz : z = 0 + · subst z + rw [lambda_zero] + convert (hasSum_ite_eq (0 : ℕ) (1 : ℝ)) using 1 + ext j + by_cases hj : j = 0 <;> simp [hj] + · have hlog := (Real.hasSum_pow_div_log_of_abs_lt_one + (show |z| < 1 by rwa [abs_of_nonneg hz0])).div_const z + rw [lambda_of_ne_zero hz] + convert hlog using 1 + ext j + rw [pow_succ] + field_simp + +theorem summable_lambda {z : ℝ} (hz0 : 0 ≤ z) (hz1 : z < 1) : + Summable (fun j : ℕ => z ^ j / ((j : ℝ) + 1)) := + (hasSum_lambda hz0 hz1).summable + +theorem monotoneOn_lambda : MonotoneOn lambda (Ico (0 : ℝ) 1) := by + intro x hx y hy hxy + apply hasSum_le _ (hasSum_lambda hx.1 hx.2) (hasSum_lambda hy.1 hy.2) + intro j + exact div_le_div_of_nonneg_right (pow_le_pow_left₀ hx.1 hxy j) (by positivity) + +theorem one_le_lambda {z : ℝ} (hz0 : 0 ≤ z) (hz1 : z < 1) : 1 ≤ lambda z := by + simpa using monotoneOn_lambda (show (0 : ℝ) ∈ Ico 0 1 by norm_num) ⟨hz0, hz1⟩ hz0 + +theorem lambda_nonneg {z : ℝ} (hz0 : 0 ≤ z) (hz1 : z < 1) : 0 ≤ lambda z := + zero_le_one.trans (one_le_lambda hz0 hz1) + +end LeanBlast.CourtadeKumar + +end + +end OAI diff --git a/lean/OAI/InformationTheory/BooleanNoise/LargeCurvature.lean b/lean/OAI/InformationTheory/BooleanNoise/LargeCurvature.lean new file mode 100644 index 0000000000000000000000000000000000000000..dd52661bb0ff2f7b3b921396e69f4baa87ec8326 --- /dev/null +++ b/lean/OAI/InformationTheory/BooleanNoise/LargeCurvature.lean @@ -0,0 +1,138 @@ +import OAI.InformationTheory.BooleanNoise.EntropySeries +import Mathlib.Tactic + +namespace OAI + +noncomputable section + +open scoped BigOperators + +namespace LeanBlast.CourtadeKumar + +theorem large_parameter_gt_81 {u : ℝ} (hu0 : 0 ≤ u) (hu2 : (2 / 3 : ℝ) ≤ u ^ 2) : + (81 / 100 : ℝ) < u := by + by_contra h + have hsq := pow_le_pow_left₀ hu0 (le_of_not_gt h) 2 + norm_num at hsq + linarith + +theorem large_artanh_gt_eleven_tenths {u : ℝ} (hu0 : 0 ≤ u) (hu1 : u < 1) + (hu2 : (2 / 3 : ℝ) ≤ u ^ 2) : (11 / 10 : ℝ) < Real.artanh u := by + have hu81 := (large_parameter_gt_81 hu0 hu2).le + have hpoly : (∑ k ∈ Finset.range 5, + (81 / 100 : ℝ) ^ (2 * k + 1) / (2 * (k : ℝ) + 1)) ≤ + ∑ k ∈ Finset.range 5, u ^ (2 * k + 1) / (2 * (k : ℝ) + 1) := by + apply Finset.sum_le_sum + intro k _ + exact div_le_div_of_nonneg_right + (pow_le_pow_left₀ (by norm_num : (0 : ℝ) ≤ 81 / 100) hu81 _) (by positivity) + have hnum : (11 / 10 : ℝ) < ∑ k ∈ Finset.range 5, + (81 / 100 : ℝ) ^ (2 * k + 1) / (2 * (k : ℝ) + 1) := by + norm_num [Finset.sum_range_succ] + exact hnum.trans_le (hpoly.trans (sum_range_artanh_le hu0 hu1 5)) + +theorem entropy_eq_large_parameter_form {u : ℝ} (hu0 : 0 ≤ u) (hu1 : u < 1) : + entropy u = (1 - u) * Real.artanh u + Real.log (1 + (1 - u) / (1 + u)) := by + have hp : 0 < 1 + u := by linarith + have heq : 1 + (1 - u) / (1 + u) = 2 / (1 + u) := by + field_simp + ring + rw [heq, Real.log_div (by norm_num : (2 : ℝ) ≠ 0) hp.ne', + artanh_eq_log_sub ⟨by linarith, hu1⟩] + unfold entropy psi ell + ring + +theorem large_parameter_polynomial_bound {y : ℝ} (hy0 : 0 ≤ y) + (hy1 : y ≤ (5 / 11 : ℝ)) : + (1 / 2 : ℝ) * (1 - y + (1 + y) / 81) * (1 + 10 * y / 9) ^ 2 ≤ 2 / 3 := by + have hfirst : (1 - y) * (1 + 10 * y / 9) ^ 2 ≤ (13718 / 10935 : ℝ) := by + have hc : (13718 / 10935 : ℝ) - (1 - y) * (1 + 10 * y / 9) ^ 2 = + (y - 11 / 30) ^ 2 * ((100 / 81 : ℝ) * y + 460 / 243) := by ring + have hp : 0 ≤ (y - 11 / 30) ^ 2 * ((100 / 81 : ℝ) * y + 460 / 243) := + mul_nonneg (sq_nonneg _) (by positivity) + linarith + have hsecond : (1 + y) * (1 + 10 * y / 9) ^ 2 / 81 ≤ + (355216 / 8732691 : ℝ) := by + calc + _ ≤ (1 + (5 / 11 : ℝ)) * (1 + 10 * (5 / 11 : ℝ) / 9) ^ 2 / 81 := by + gcongr + _ = _ := by norm_num + nlinarith + +theorem large_curvature_bound {u : ℝ} (hu0 : 0 ≤ u) (hu1 : u < 1) + (hu2 : (2 / 3 : ℝ) ≤ u ^ 2) : + entropy u ^ 2 * (((1 + u ^ 2) * Real.artanh u - u) / + ((1 - u ^ 2) ^ 2 * (Real.artanh u) ^ 3)) ≤ 2 / 3 := by + let t : ℝ := Real.artanh u + let e : ℝ := (1 - u) / (1 + u) + let y : ℝ := 1 / (2 * t) + let R : ℝ := 1 + (1 + e) * y + let A : ℝ := 1 - y + (1 + y) * e ^ 2 + let Q : ℝ := ((1 + u ^ 2) * t - u) / ((1 - u ^ 2) ^ 2 * t ^ 3) + have ht11 : (11 / 10 : ℝ) < t := large_artanh_gt_eleven_tenths hu0 hu1 hu2 + have ht : 0 < t := by linarith + have hp : 0 < 1 + u := by linarith + have hm : 0 < 1 - u := by linarith + have hsq : 0 < 1 - u ^ 2 := by nlinarith [mul_pos hm hp] + have he0 : 0 ≤ e := div_nonneg hm.le hp.le + have he1 : e ≤ (1 / 9 : ℝ) := by + dsimp only [e] + apply (div_le_iff₀ hp).mpr + linarith [large_parameter_gt_81 hu0 hu2] + have hy0 : 0 ≤ y := by dsimp only [y]; positivity + have hy1 : y ≤ (5 / 11 : ℝ) := by + dsimp only [y] + apply (div_le_iff₀ (by positivity : 0 < 2 * t)).mpr + linarith + have hR0 : 0 ≤ R := by dsimp only [R]; positivity + have hA0 : 0 ≤ A := by + have hy : 0 ≤ 1 - y := by linarith + dsimp only [A] + positivity + have hQ : 0 ≤ Q := by + apply div_nonneg + · nlinarith [mul_nonneg (sq_nonneg u) ht.le] + · positivity + have hH0 : 0 ≤ entropy u := entropy_nonneg ⟨by linarith, hu1.le⟩ + have hH : entropy u ≤ (1 - u) * t * R := by + have hlog : Real.log (1 + e) ≤ e := by + have h := Real.log_le_sub_one_of_pos (by linarith : 0 < 1 + e) + linarith + have hid : entropy u = (1 - u) * t + Real.log (1 + e) := + entropy_eq_large_parameter_form hu0 hu1 + have hr : (1 - u) * t * R = (1 - u) * t + e := by + dsimp only [R, e, y] + field_simp [ht.ne', hp.ne'] + ring + rw [hr, hid] + linarith + have hcoef : ((1 - u) * t) ^ 2 * Q = (1 / 2 : ℝ) * A := by + dsimp only [Q, A, e, y] + field_simp [ht.ne', hp.ne', hsq.ne'] + ring + have hRsq : R ^ 2 ≤ (1 + 10 * y / 9) ^ 2 := by + apply pow_le_pow_left₀ hR0 + dsimp only [R] + nlinarith [mul_le_mul_of_nonneg_right he1 hy0] + have hA : A ≤ 1 - y + (1 + y) / 81 := by + have he2 := pow_le_pow_left₀ he0 he1 2 + have hmul := mul_le_mul_of_nonneg_left he2 (by linarith : 0 ≤ 1 + y) + dsimp only [A] + nlinarith + have hprod : A * R ^ 2 ≤ (1 - y + (1 + y) / 81) * (1 + 10 * y / 9) ^ 2 := + mul_le_mul hA hRsq (sq_nonneg R) (hA0.trans hA) + change entropy u ^ 2 * Q ≤ 2 / 3 + calc + entropy u ^ 2 * Q ≤ ((1 - u) * t * R) ^ 2 * Q := + mul_le_mul_of_nonneg_right (pow_le_pow_left₀ hH0 hH 2) hQ + _ = (((1 - u) * t) ^ 2 * Q) * R ^ 2 := by ring + _ = (1 / 2 : ℝ) * (A * R ^ 2) := by rw [hcoef]; ring + _ ≤ (1 / 2 : ℝ) * ((1 - y + (1 + y) / 81) * (1 + 10 * y / 9) ^ 2) := + mul_le_mul_of_nonneg_left hprod (by norm_num) + _ ≤ 2 / 3 := by simpa only [mul_assoc] using large_parameter_polynomial_bound hy0 hy1 + +end LeanBlast.CourtadeKumar + +end + +end OAI diff --git a/lean/OAI/InformationTheory/BooleanNoise/Main.lean b/lean/OAI/InformationTheory/BooleanNoise/Main.lean new file mode 100644 index 0000000000000000000000000000000000000000..ad758c7fb9a830a6a159b02afed81aeabf30fc08 --- /dev/null +++ b/lean/OAI/InformationTheory/BooleanNoise/Main.lean @@ -0,0 +1,67 @@ +import OAI.InformationTheory.BooleanNoise.Attainment +import OAI.InformationTheory.BooleanNoise.Rearrangement +import OAI.InformationTheory.BooleanNoise.Comparison + +namespace OAI + +noncomputable section + +namespace LeanBlast.CourtadeKumar + +theorem informationDeficit_noise_le_psi_of_increasing_case {n : ℕ} + (u : ℝ) (hu : u ∈ Set.Icc (0 : ℝ) 1) + (hcase : 0 < u → u < 1 → + ∀ G : Cube n → ℝ, IsSignValued G → IsIncreasing G → + (∃ x y, G x ≠ G y) → + informationDeficit (noiseOperator u G) ≤ psi u) + (F : Cube n → ℝ) (hF : IsSignValued F) : + informationDeficit (noiseOperator u F) ≤ psi u := by + classical + by_cases hu0 : u = 0 + · subst u + simp + by_cases hu1 : u = 1 + · subst u + exact informationDeficit_noise_one_le F hF + have hupos : 0 < u := lt_of_le_of_ne hu.1 (Ne.symm hu0) + have hult : u < 1 := lt_of_le_of_ne hu.2 hu1 + obtain ⟨G, hG, hinc, _, hdom⟩ := exists_increasing_informationDeficit_ge u hu F hF + apply hdom.trans + by_cases hnc : ∃ x y, G x ≠ G y + · exact hcase hupos hult G hG hinc hnc + · have hconstant : G = fun _ => G (fun _ => false) := by + funext x + by_contra hx + exact hnc ⟨x, (fun _ => false), hx⟩ + rw [hconstant, informationDeficit_noise_const] + exact psi_nonneg u + +theorem informationDeficit_noise_le_psi {n : ℕ} + (F : Cube n → ℝ) (hF : IsSignValued F) + (u : ℝ) (hu : u ∈ Set.Icc (0 : ℝ) 1) : + informationDeficit (noiseOperator u F) ≤ psi u := by + apply informationDeficit_noise_le_psi_of_increasing_case u hu _ F hF + intro hu0 hu1 G hG hinc hnc + exact informationDeficit_noise_le_psi_of_increasing G hG hinc hnc u hu0 hu1 + +theorem courtadeKumar_bound {n : ℕ} (ε : ℝ) + (hε0 : 0 ≤ ε) (hεhalf : ε ≤ (1 : ℝ) / 2) (f : Cube n → Bool) : + mutualInformation ε f ≤ 1 - binaryEntropy ε := by + rw [mutualInformation_eq_informationDeficit ε f hε0 hεhalf, + one_sub_binaryEntropy_eq_psi] + apply div_le_div_of_nonneg_right _ ell_pos.le + apply informationDeficit_noise_le_psi (signEncoding f) (isSignValued_signEncoding f) + constructor <;> linarith + +theorem courtadeKumar : CourtadeKumarStatement := by + intro n _ ε hε0 hεhalf f + exact courtadeKumar_bound ε hε0 hεhalf f + +theorem courtadeKumarAndAttainment : FullStatement := + ⟨courtadeKumar, dictatorAttainment⟩ + +end LeanBlast.CourtadeKumar + +end + +end OAI diff --git a/lean/OAI/InformationTheory/BooleanNoise/MediumCurvature.lean b/lean/OAI/InformationTheory/BooleanNoise/MediumCurvature.lean new file mode 100644 index 0000000000000000000000000000000000000000..c26eca0107904c0d02f4a2fd3e79f408ba5fb50f --- /dev/null +++ b/lean/OAI/InformationTheory/BooleanNoise/MediumCurvature.lean @@ -0,0 +1,159 @@ +import OAI.InformationTheory.BooleanNoise.EntropyBounds +import OAI.InformationTheory.BooleanNoise.CurvatureCertificates + +namespace OAI + +noncomputable section + +open Finset Set +open scoped BigOperators + +namespace LeanBlast.CourtadeKumar + +def curvatureNumeratorCoeff (k : ℕ) : ℝ := + 1 / (2 * (k : ℝ) + 1) + 1 / (2 * (k : ℝ) + 3) + +theorem curvatureNumeratorCoeff_nonneg (k : ℕ) : 0 ≤ curvatureNumeratorCoeff k := by + unfold curvatureNumeratorCoeff + positivity + +theorem curvatureNumeratorCoeff_antitone : Antitone curvatureNumeratorCoeff := by + intro i j hij + have hij' : (i : ℝ) ≤ j := by exact_mod_cast hij + unfold curvatureNumeratorCoeff + exact add_le_add (one_div_le_one_div_of_le (by positivity) (by linarith)) + (one_div_le_one_div_of_le (by positivity) (by linarith)) + +theorem hasSum_artanh_div {u : ℝ} (hu0 : 0 < u) (hu1 : u < 1) : + HasSum (fun k : ℕ => (1 / (2 * (k : ℝ) + 1)) * (u ^ 2) ^ k) + (Real.artanh u / u) := by + have h := (hasSum_artanh (show |u| < 1 by rwa [abs_of_pos hu0])).div_const u + convert h using 1 + ext k + rw [pow_add, pow_one, ← pow_mul] + field_simp + +theorem hasSum_curvatureNumerator {u : ℝ} (hu0 : 0 < u) (hu1 : u < 1) : + HasSum (fun k : ℕ => curvatureNumeratorCoeff k * (u ^ 2) ^ k) + (((1 + u ^ 2) * Real.artanh u - u) / u ^ 3) := by + have hA := hasSum_artanh_div hu0 hu1 + have htail := (hasSum_nat_add_iff' 1).mpr hA + have hB : HasSum (fun k : ℕ => (1 / (2 * (k : ℝ) + 3)) * (u ^ 2) ^ k) + ((Real.artanh u / u - 1) / u ^ 2) := by + have hdiv := htail.div_const (u ^ 2) + convert hdiv using 1 + · ext k + simp only [Nat.cast_add, Nat.cast_one] + rw [pow_succ] + field_simp + ring + · simp + convert hA.add hB using 1 + · ext k + unfold curvatureNumeratorCoeff + ring + · field_simp + ring + +theorem curvatureT_lower {u : ℝ} (hu0 : 0 < u) (hu1 : u < 1) : + u * curvatureT (u ^ 2) ≤ Real.artanh u := by + have h := sum_range_artanh_le hu0.le hu1 6 + convert h using 1 + norm_num [curvatureT, Finset.sum_range_succ] + ring + +theorem curvatureP_upper {u : ℝ} (hu0 : 0 < u) (hu1 : u < 1) : + entropy u ≤ curvatureP (u ^ 2) := by + have h := sum_range_psi_le (show |u| < 1 by rwa [abs_of_pos hu0]) 5 + have hs : (∑ k ∈ Finset.range 5, psiCoeff k * u ^ (2 * (k + 1))) = + u ^ 2 / 2 + (u ^ 2) ^ 2 / 12 + (u ^ 2) ^ 3 / 30 + + (u ^ 2) ^ 4 / 56 + (u ^ 2) ^ 5 / 90 := by + norm_num [psiCoeff, Finset.sum_range_succ] + ring + rw [hs] at h + unfold entropy curvatureP + linarith [ell_lt_347_div_500] + +theorem curvatureNumerator_upper {u : ℝ} (hu0 : 0 < u) (hu1 : u < 1) : + (((1 + u ^ 2) * Real.artanh u - u) / u ^ 3) ≤ + curvatureN (u ^ 2) / (1 - u ^ 2) := by + have hz0 : 0 ≤ u ^ 2 := sq_nonneg u + have hz1 : u ^ 2 < 1 := by nlinarith [mul_pos hu0 (sub_pos.mpr hu1)] + have hz : 1 - u ^ 2 ≠ 0 := by linarith + have hA := hasSum_curvatureNumerator hu0 hu1 + have htail := (hasSum_nat_add_iff' 5).mpr hA + have hgeo := (hasSum_geometric_of_lt_one hz0 hz1).mul_left + (curvatureNumeratorCoeff 5 * (u ^ 2) ^ 5) + have hbound := hasSum_le + (fun k : ℕ => calc + curvatureNumeratorCoeff (k + 5) * (u ^ 2) ^ (k + 5) ≤ + curvatureNumeratorCoeff 5 * (u ^ 2) ^ (k + 5) := + mul_le_mul_of_nonneg_right + (curvatureNumeratorCoeff_antitone (by omega)) (pow_nonneg hz0 _) + _ = (curvatureNumeratorCoeff 5 * (u ^ 2) ^ 5) * (u ^ 2) ^ k := by + rw [pow_add] + ring) htail hgeo + have hpartial : + (∑ k ∈ Finset.range 5, curvatureNumeratorCoeff k * (u ^ 2) ^ k) + + (curvatureNumeratorCoeff 5 * (u ^ 2) ^ 5) * (1 - u ^ 2)⁻¹ = + curvatureN (u ^ 2) / (1 - u ^ 2) := by + norm_num [curvatureNumeratorCoeff, Finset.sum_range_succ, curvatureN] + field_simp + rw [← hpartial] + linarith + +theorem medium_curvature_bound {u : ℝ} (hu0 : 0 < u) (hu1 : u < 1) + (hz : u ^ 2 ≤ (2 / 3 : ℝ)) : + entropy u ^ 2 * (((1 + u ^ 2) * Real.artanh u - u) / + ((1 - u ^ 2) ^ 2 * (Real.artanh u) ^ 3)) ≤ 2 / 3 := by + have hz0 : 0 ≤ u ^ 2 := sq_nonneg u + have hz1 : 0 < 1 - u ^ 2 := by linarith + have ht : 0 < Real.artanh u := Real.artanh_pos ⟨hu0, hu1⟩ + have hH : 0 < entropy u := entropy_pos ⟨by linarith, hu1⟩ + have hHP := curvatureP_upper hu0 hu1 + have hP : 0 < curvatureP (u ^ 2) := hH.trans_le hHP + have hT : 0 < curvatureT (u ^ 2) := by unfold curvatureT; positivity + have hTl := curvatureT_lower hu0 hu1 + have hN := curvatureNumerator_upper hu0 hu1 + have hnum : (1 + u ^ 2) * Real.artanh u - u ≤ + (curvatureN (u ^ 2) / (1 - u ^ 2)) * u ^ 3 := + (div_le_iff₀ (pow_pos hu0 3)).mp hN + have hu_atanh : u ≤ Real.artanh u := by + simpa using sum_range_artanh_le hu0.le hu1 1 + have hnum0 : 0 ≤ (1 + u ^ 2) * Real.artanh u - u := by + nlinarith [mul_nonneg hz0 ht.le] + have hsq : entropy u ^ 2 ≤ curvatureP (u ^ 2) ^ 2 := + pow_le_pow_left₀ hH.le hHP 2 + have hprod := mul_le_mul hsq hnum hnum0 (sq_nonneg (curvatureP (u ^ 2))) + have hc := curvatureCertificate_pos hz0 hz + unfold curvaturePolynomial at hc + have hc' : 3 * curvatureP (u ^ 2) ^ 2 * curvatureN (u ^ 2) < + 2 * (1 - u ^ 2) ^ 3 * curvatureT (u ^ 2) ^ 3 := by linarith + have hcert : curvatureP (u ^ 2) ^ 2 * + ((curvatureN (u ^ 2) / (1 - u ^ 2)) * u ^ 3) < + (2 / 3 : ℝ) * (1 - u ^ 2) ^ 2 * (u * curvatureT (u ^ 2)) ^ 3 := by + rw [show curvatureP (u ^ 2) ^ 2 * + ((curvatureN (u ^ 2) / (1 - u ^ 2)) * u ^ 3) = + (curvatureP (u ^ 2) ^ 2 * curvatureN (u ^ 2) * u ^ 3) / (1 - u ^ 2) by ring] + apply (div_lt_iff₀ hz1).mpr + have hc'' := mul_lt_mul_of_pos_right hc' (pow_pos hu0 3) + nlinarith + have hpow : (u * curvatureT (u ^ 2)) ^ 3 ≤ (Real.artanh u) ^ 3 := + pow_le_pow_left₀ (mul_nonneg hu0.le hT.le) hTl 3 + have hden := mul_le_mul_of_nonneg_left hpow + (show 0 ≤ (2 / 3 : ℝ) * (1 - u ^ 2) ^ 2 by positivity) + rw [← mul_div_assoc] + apply (div_le_iff₀ (mul_pos (pow_pos hz1 2) (pow_pos ht 3))).mpr + calc + entropy u ^ 2 * ((1 + u ^ 2) * Real.artanh u - u) ≤ + curvatureP (u ^ 2) ^ 2 * + ((curvatureN (u ^ 2) / (1 - u ^ 2)) * u ^ 3) := hprod + _ ≤ (2 / 3 : ℝ) * (1 - u ^ 2) ^ 2 * (u * curvatureT (u ^ 2)) ^ 3 := hcert.le + _ ≤ (2 / 3 : ℝ) * ((1 - u ^ 2) ^ 2 * (Real.artanh u) ^ 3) := by + simpa only [mul_assoc] using hden + +end LeanBlast.CourtadeKumar + +end + +end OAI diff --git a/lean/OAI/InformationTheory/BooleanNoise/Model.lean b/lean/OAI/InformationTheory/BooleanNoise/Model.lean new file mode 100644 index 0000000000000000000000000000000000000000..6b8eaf3922c8bb5602ce55bf7a5c4b79c3d3fae8 --- /dev/null +++ b/lean/OAI/InformationTheory/BooleanNoise/Model.lean @@ -0,0 +1,66 @@ +import Mathlib +import OAI.Combinatorics.GotsmanLinial.Model + +namespace OAI + +noncomputable section + +open scoped BigOperators + +namespace LeanBlast.CourtadeKumar + +abbrev Cube (n : ℕ) := LeanBlast.GotsmanLinial.Cube n + +def cubeAverage {n : ℕ} (g : Cube n → ℝ) : ℝ := + (∑ x, g x) / (2 : ℝ) ^ n + +def ell : ℝ := Real.log 2 + +def bitFlipKernel {n : ℕ} (ε : ℝ) (x y : Cube n) : ℝ := + ∏ i, if x i = y i then 1 - ε else ε + +def jointProbability {n : ℕ} (ε : ℝ) (f : Cube n → Bool) (b : Bool) (y : Cube n) : ℝ := + cubeAverage (fun x => if f x = b then bitFlipKernel ε x y else 0) + +def functionMarginal {n : ℕ} (ε : ℝ) (f : Cube n → Bool) (b : Bool) : ℝ := + ∑ y, jointProbability ε f b y + +def observationMarginal {n : ℕ} (ε : ℝ) (f : Cube n → Bool) (y : Cube n) : ℝ := + ∑ b : Bool, jointProbability ε f b y + +def xlogx (t : ℝ) : ℝ := t * Real.log t + +def binaryEntropy (ε : ℝ) : ℝ := + -(xlogx ε + xlogx (1 - ε)) / ell + +def mutualInformation {n : ℕ} (ε : ℝ) (f : Cube n → Bool) : ℝ := + (∑ b : Bool, ∑ y : Cube n, + if 0 < jointProbability ε f b y then + jointProbability ε f b y * + Real.log (jointProbability ε f b y / + (functionMarginal ε f b * observationMarginal ε f y)) + else 0) / ell + +def dictator {n : ℕ} (i : Fin n) (x : Cube n) : Bool := x i + +def complementDictator {n : ℕ} (i : Fin n) (x : Cube n) : Bool := !(x i) + +def CourtadeKumarStatement : Prop := + ∀ (n : ℕ), 1 ≤ n → + ∀ ε : ℝ, 0 ≤ ε → ε ≤ (1 : ℝ) / 2 → + ∀ f : Cube n → Bool, mutualInformation ε f ≤ 1 - binaryEntropy ε + +def DictatorAttainmentStatement : Prop := + ∀ (n : ℕ), 1 ≤ n → + ∀ ε : ℝ, 0 ≤ ε → ε ≤ (1 : ℝ) / 2 → + ∀ i : Fin n, + mutualInformation ε (dictator i) = 1 - binaryEntropy ε ∧ + mutualInformation ε (complementDictator i) = 1 - binaryEntropy ε + +def FullStatement : Prop := CourtadeKumarStatement ∧ DictatorAttainmentStatement + +end LeanBlast.CourtadeKumar + +end + +end OAI diff --git a/lean/OAI/InformationTheory/BooleanNoise/MonotoneDissipation.lean b/lean/OAI/InformationTheory/BooleanNoise/MonotoneDissipation.lean new file mode 100644 index 0000000000000000000000000000000000000000..29f59322305d149190a837af879b74c934a967f4 --- /dev/null +++ b/lean/OAI/InformationTheory/BooleanNoise/MonotoneDissipation.lean @@ -0,0 +1,409 @@ +import OAI.InformationTheory.BooleanNoise.InverseScalars +import OAI.InformationTheory.BooleanNoise.LambdaScalars +import OAI.InformationTheory.BooleanNoise.PerspectiveJensen +import OAI.InformationTheory.BooleanNoise.EntropyScalars +import OAI.InformationTheory.BooleanNoise.EntropyBounds +import OAI.InformationTheory.BooleanNoise.CubeSplits +import OAI.InformationTheory.BooleanNoise.JensenGaps +import OAI.InformationTheory.BooleanNoise.LShape +import OAI.InformationTheory.BooleanNoise.NormalizedPair +import OAI.InformationTheory.BooleanNoise.PerspectiveInequality +import Mathlib.Tactic + +namespace OAI + +noncomputable section + +open scoped BigOperators +open Set + +namespace LeanBlast.CourtadeKumar + +theorem IsIncreasing.restrict {n : ℕ} {g : Cube (n + 1) → ℝ} + (hg : IsIncreasing g) (b : Bool) : IsIncreasing (restrict g b) := by + intro x y hxy + apply hg + intro i + refine Fin.cases ?_ (fun j => ?_) i + · simp + · exact hxy j + +theorem IsIncreasing.pairHalfDifference_nonneg {n : ℕ} {g : Cube (n + 1) → ℝ} + (hg : IsIncreasing g) (x : Cube n) : 0 ≤ pairHalfDifference g x := by + have horder : CourtadeKumar.restrict g false x ≤ CourtadeKumar.restrict g true x := by + apply hg + intro i + refine Fin.cases ?_ (fun j => ?_) i + · simp + · exact le_rfl + exact div_nonneg (sub_nonneg.mpr horder) (by norm_num) + +theorem scalar_meanVariance_pos {m : ℝ} (hm : |m| < 1) : 0 < 1 - m ^ 2 := by + have hsq := (sq_lt_sq₀ (abs_nonneg m) (by norm_num : (0 : ℝ) ≤ 1)).mpr hm + rw [sq_abs] at hsq + nlinarith + +theorem scalar_meanVariance_le_one (m : ℝ) : 1 - m ^ 2 ≤ 1 := by + nlinarith [sq_nonneg m] + +theorem IsInterior.meanVariance_pos {n : ℕ} {g : Cube n → ℝ} + (hg : IsInterior g) : 0 < meanVariance g := + scalar_meanVariance_pos (abs_lt.mpr hg.cubeAverage) + +theorem IsInterior.entropyAverage_pos {n : ℕ} {g : Cube n → ℝ} + (hg : IsInterior g) : 0 < entropyAverage g := by + have h := cubeAverage_lt (fun x => entropy_pos (hg x)) + simpa only [cubeAverage_const, entropyAverage] using h + +theorem average_one_sub_sq_le_meanVariance {n : ℕ} (a : Cube n → ℝ) : + cubeAverage (fun x => 1 - (a x) ^ 2) ≤ meanVariance a := by + rw [average_one_sub_sq_eq_meanVariance_sub_variance] + linarith [cubeVariance_nonneg a] + +theorem monotone_pair_average_geometry {n : ℕ} (a b : Cube n → ℝ) + (hdom : ∀ x, |a x| + |b x| < 1) (hb : ∀ x, 0 ≤ b x) : + |cubeAverage a| < 1 ∧ 0 ≤ cubeAverage b ∧ + cubeAverage b < 1 - |cubeAverage a| ∧ + 0 < cubeAverage (fun x => 1 - (a x) ^ 2) ∧ + cubeAverage (fun x => 1 - (a x) ^ 2) ≤ 1 - (cubeAverage a) ^ 2 ∧ + cubeAverage b ≤ cubeAverage (fun x => 1 - (a x) ^ 2) := by + have ha : IsInterior a := by + intro x + apply abs_lt.mp + linarith [hdom x, abs_nonneg (b x)] + have hm : |cubeAverage a| < 1 := abs_lt.mpr ha.cubeAverage + have hk : 0 ≤ cubeAverage b := cubeAverage_nonneg hb + have hplus : cubeAverage a + cubeAverage b < 1 := by + have h := cubeAverage_lt (g := fun x => a x + b x) (h := fun _ => 1) (by + intro x + have hd := hdom x + rw [abs_of_nonneg (hb x)] at hd + linarith [le_abs_self (a x)]) + simpa only [cubeAverage_add, cubeAverage_const] using h + have hminus : -cubeAverage a + cubeAverage b < 1 := by + have h := cubeAverage_lt (g := fun x => -a x + b x) (h := fun _ => 1) (by + intro x + have hd := hdom x + rw [abs_of_nonneg (hb x)] at hd + linarith [neg_le_abs (a x)]) + simpa only [cubeAverage_add, cubeAverage_neg, cubeAverage_const] using h + have hkm : cubeAverage b < 1 - |cubeAverage a| := by + by_cases hm0 : 0 ≤ cubeAverage a + · rw [abs_of_nonneg hm0] + linarith + · rw [abs_of_nonpos (le_of_not_ge hm0)] + linarith + have hW : 0 < cubeAverage (fun x => 1 - (a x) ^ 2) := by + have h := cubeAverage_lt (fun x => scalar_meanVariance_pos (abs_lt.mpr (ha x))) + simpa only [cubeAverage_const] using h + have hkW : cubeAverage b ≤ cubeAverage (fun x => 1 - (a x) ^ 2) := by + apply cubeAverage_mono + intro x + have hd := hdom x + rw [abs_of_nonneg (hb x)] at hd + have ha1 : |a x| ≤ 1 := (abs_lt.mpr (ha x)).le + have hasq : |a x| ^ 2 ≤ |a x| := by + nlinarith [mul_nonneg (abs_nonneg (a x)) (sub_nonneg.mpr ha1)] + nlinarith [sq_abs (a x)] + exact ⟨hm, hk, hkm, hW, average_one_sub_sq_le_meanVariance a, hkW⟩ + +theorem halfDifference_sq_lt_meanVariance {m k : ℝ} + (hm : |m| < 1) (hk : 0 ≤ k) (hkm : k < 1 - |m|) : + k ^ 2 < 1 - m ^ 2 := by + have hsq := (sq_lt_sq₀ hk (sub_nonneg.mpr hm.le)).mpr hkm + have ha : |m| ^ 2 ≤ |m| := by + nlinarith [mul_nonneg (abs_nonneg m) (sub_nonneg.mpr hm.le)] + nlinarith [sq_abs m] + +theorem monotone_split_parameter_bounds {m k W : ℝ} + (hm : |m| < 1) (hk : 0 ≤ k) (hkm : k < 1 - |m|) + (hW : 0 < W) (hWA : W ≤ 1 - m ^ 2) (hkW : k ≤ W) : + 0 ≤ k ^ 2 / (1 - m ^ 2) ∧ k ^ 2 / (1 - m ^ 2) < 1 ∧ + 0 < W / (1 - m ^ 2) ∧ W / (1 - m ^ 2) ≤ 1 ∧ + k ^ 2 / (1 - m ^ 2) ≤ (W / (1 - m ^ 2)) ^ 2 := by + have hA := scalar_meanVariance_pos hm + have hA1 := scalar_meanVariance_le_one m + refine ⟨div_nonneg (sq_nonneg _) hA.le, + (div_lt_one hA).mpr (halfDifference_sq_lt_meanVariance hm hk hkm), + div_pos hW hA, (div_le_one hA).mpr hWA, ?_⟩ + have hk2W2 : k ^ 2 ≤ W ^ 2 := (sq_le_sq₀ hk hW.le).mpr hkW + have hk2A : k ^ 2 * (1 - m ^ 2) ≤ W ^ 2 := by + calc + k ^ 2 * (1 - m ^ 2) ≤ k ^ 2 * 1 := + mul_le_mul_of_nonneg_left hA1 (sq_nonneg _) + _ = k ^ 2 := mul_one _ + _ ≤ W ^ 2 := hk2W2 + rw [div_pow] + apply (div_le_div_iff₀ hA (sq_pos_of_pos hA)).mpr + nlinarith [mul_le_mul_of_nonneg_right hk2A hA.le] + +theorem meanSquare_ratio_le_jensen_ratio {m k : ℝ} + (hm : |m| < 1) (hk : 0 ≤ k) (hkm : k < 1 - |m|) : + k ^ 2 / (1 - m ^ 2) ≤ k / (1 + |m|) := by + have hA := scalar_meanVariance_pos hm + have hden : 0 < 1 + |m| := by positivity + apply (div_le_div_iff₀ hA hden).mpr + have hprod := mul_le_mul_of_nonneg_left hkm.le + (mul_nonneg hk hden.le) + rw [← sq_abs m] + nlinarith [hprod] + +theorem jensen_ratio_mem_unit_interval {m k : ℝ} + (hk : 0 ≤ k) (hkm : k < 1 - |m|) : + 0 ≤ k / (1 + |m|) ∧ k / (1 + |m|) < 1 := by + have hden : 0 < 1 + |m| := by positivity + refine ⟨div_nonneg hk hden.le, (div_lt_one hden).mpr ?_⟩ + linarith [abs_nonneg m] + +theorem normalized_variance_gap_nonneg {q w : ℝ} + (hq : 0 ≤ q) (hw : 0 < w) (hw1 : w ≤ 1) : + 0 ≤ q * (1 / w - 1) := by + have hinv : 1 ≤ 1 / w := (le_div_iff₀ hw).mpr (by simpa using hw1) + exact mul_nonneg hq (sub_nonneg.mpr hinv) + +theorem normalized_variance_gap_identity {A W k : ℝ} (hA : A ≠ 0) (hW : W ≠ 0) : + k ^ 2 / W - k ^ 2 / A = (k ^ 2 / A) * (1 / (W / A) - 1) := by + field_simp + +theorem normalized_jensen_correction_le {m k W V : ℝ} + (hm : |m| < 1) (hk : 0 ≤ k) (hkm : k < 1 - |m|) + (hW : 0 < W) (hWA : W ≤ 1 - m ^ 2) (hkW : k ≤ W) + (hV : k ^ 2 / W - k ^ 2 / (1 - m ^ 2) ≤ V) : + (k ^ 2 / (1 - m ^ 2)) * (1 / (W / (1 - m ^ 2)) - 1) * + lambda ((k ^ 2 / (1 - m ^ 2)) ^ 2) ≤ + V * lambda ((k / (1 + |m|)) ^ 2) := by + obtain ⟨hq, hq1, hw, hw1, _⟩ := + monotone_split_parameter_bounds hm hk hkm hW hWA hkW + obtain ⟨hs, hs1⟩ := jensen_ratio_mem_unit_interval hk hkm + have hq2 : (k ^ 2 / (1 - m ^ 2)) ^ 2 < 1 := by nlinarith + have hs2 : (k / (1 + |m|)) ^ 2 < 1 := by nlinarith + have hqs : (k ^ 2 / (1 - m ^ 2)) ^ 2 ≤ (k / (1 + |m|)) ^ 2 := + (sq_le_sq₀ hq hs).mpr (meanSquare_ratio_le_jensen_ratio hm hk hkm) + have hB := normalized_variance_gap_nonneg hq hw hw1 + have hBV : (k ^ 2 / (1 - m ^ 2)) * (1 / (W / (1 - m ^ 2)) - 1) ≤ V := by + rwa [← normalized_variance_gap_identity (scalar_meanVariance_pos hm).ne' hW.ne'] + have hlambda := monotoneOn_lambda ⟨sq_nonneg _, hq2⟩ ⟨sq_nonneg _, hs2⟩ hqs + exact mul_le_mul hBV hlambda (lambda_nonneg (sq_nonneg _) hq2) (hB.trans hBV) + +theorem scaled_perspective_bound (F : ℝ → ℝ) {A W k h B : ℝ} + (hA : 0 < A) (hA1 : A ≤ 1) (hW : 0 < W) (hAk : 0 < A - k ^ 2) + (hB : 0 ≤ B) + (hperspective : F (h / A) - (1 - k ^ 2 / A) * F ((h / A) / (1 - k ^ 2 / A)) - + (W / A) * F ((h / A) / (W / A)) ≤ B) : + A * F (h / A) - (A - k ^ 2) * F (h / (A - k ^ 2)) - W * F (h / W) ≤ B := by + have harg1 : (h / A) / (1 - k ^ 2 / A) = h / (A - k ^ 2) := by + have hden : 1 - k ^ 2 / A = (A - k ^ 2) / A := by field_simp + rw [hden] + field_simp + have harg2 : (h / A) / (W / A) = h / W := by field_simp + rw [harg1, harg2] at hperspective + have hscaled := mul_le_mul_of_nonneg_left hperspective hA.le + have hcoef1 : A * (1 - k ^ 2 / A) = A - k ^ 2 := by field_simp + have hcoef2 : A * (W / A) = W := by field_simp + have hleft : A * (F (h / A) - (1 - k ^ 2 / A) * F (h / (A - k ^ 2)) - + (W / A) * F (h / W)) = + A * F (h / A) - (A - k ^ 2) * F (h / (A - k ^ 2)) - W * F (h / W) := by + rw [mul_sub, mul_sub, ← mul_assoc, hcoef1, ← mul_assoc, hcoef2] + rw [hleft] at hscaled + exact hscaled.trans (by nlinarith) + +theorem monotone_dissipation_step_algebra (F : ℝ → ℝ) + {S Jm A k h W B Drestr Dpair : ℝ} + (hrestr : 2 * (S - Jm) + (A - k ^ 2) * F (h / (A - k ^ 2)) ≤ Drestr) + (hpair : W * F (h / W) + B ≤ Dpair - 2 * Jm) + (hperspective : A * F (h / A) - (A - k ^ 2) * F (h / (A - k ^ 2)) - + W * F (h / W) ≤ B) : + 2 * S + A * F (h / A) ≤ Drestr + Dpair := by + linarith + +theorem monotone_pair_correction {m k W h Je Jm V Dpair : ℝ} + (hm : |m| < 1) (hk : 0 ≤ k) (hkm : k < 1 - |m|) + (hW : 0 < W) (hWA : W ≤ 1 - m ^ 2) (hkW : k ≤ W) + (hV : k ^ 2 / W - k ^ 2 / (1 - m ^ 2) ≤ V) + (hnormalized : W * L (h / W) ≤ Dpair - 2 * Je) + (hgap : V * lambda ((k / (1 + |m|)) ^ 2) ≤ 2 * (Je - Jm)) : + W * L (h / W) + + (k ^ 2 / (1 - m ^ 2)) * (1 / (W / (1 - m ^ 2)) - 1) * + lambda ((k ^ 2 / (1 - m ^ 2)) ^ 2) ≤ Dpair - 2 * Jm := by + have hcorrection := normalized_jensen_correction_le hm hk hkm hW hWA hkW hV + linarith + +theorem monotone_dissipation_step_of_perspective + {m k W h S Je Jm V Drestr Dpair : ℝ} + (hm : |m| < 1) (hk : 0 ≤ k) (hkm : k < 1 - |m|) + (hW : 0 < W) (hWA : W ≤ 1 - m ^ 2) (hkW : k ≤ W) + (hV : k ^ 2 / W - k ^ 2 / (1 - m ^ 2) ≤ V) + (hrestr : 2 * (S - Jm) + (1 - m ^ 2 - k ^ 2) * + L (h / (1 - m ^ 2 - k ^ 2)) ≤ Drestr) + (hnormalized : W * L (h / W) ≤ Dpair - 2 * Je) + (hgap : V * lambda ((k / (1 + |m|)) ^ 2) ≤ 2 * (Je - Jm)) + (hperspective : L (h / (1 - m ^ 2)) - + (1 - k ^ 2 / (1 - m ^ 2)) * + L ((h / (1 - m ^ 2)) / (1 - k ^ 2 / (1 - m ^ 2))) - + (W / (1 - m ^ 2)) * L ((h / (1 - m ^ 2)) / (W / (1 - m ^ 2))) ≤ + (k ^ 2 / (1 - m ^ 2)) * (1 / (W / (1 - m ^ 2)) - 1) * + lambda ((k ^ 2 / (1 - m ^ 2)) ^ 2)) : + 2 * S + (1 - m ^ 2) * L (h / (1 - m ^ 2)) ≤ Drestr + Dpair := by + have hA := scalar_meanVariance_pos hm + have hAk : 0 < 1 - m ^ 2 - k ^ 2 := by + linarith [halfDifference_sq_lt_meanVariance hm hk hkm] + obtain ⟨hq, hq1, hw, hw1, _⟩ := + monotone_split_parameter_bounds hm hk hkm hW hWA hkW + have hq2 : (k ^ 2 / (1 - m ^ 2)) ^ 2 < 1 := by nlinarith + have hB := mul_nonneg (normalized_variance_gap_nonneg hq hw hw1) + (lambda_nonneg (sq_nonneg _) hq2) + have hp := scaled_perspective_bound L hA (scalar_meanVariance_le_one m) hW hAk hB + hperspective + have hc := monotone_pair_correction hm hk hkm hW hWA hkW hV hnormalized hgap + exact monotone_dissipation_step_algebra L hrestr hc hp + +theorem two_point_perspective_jensen (F : ℝ → ℝ) + (hF : ConvexOn ℝ (Ioi 0) F) {A₀ A₁ H₀ H₁ : ℝ} + (hA₀ : 0 < A₀) (hA₁ : 0 < A₁) (hH₀ : 0 < H₀) (hH₁ : 0 < H₁) : + ((A₁ + A₀) / 2) * F (((H₁ + H₀) / 2) / ((A₁ + A₀) / 2)) ≤ + (A₁ * F (H₁ / A₁) + A₀ * F (H₀ / A₀)) / 2 := by + have hsum : 0 < A₁ + A₀ := add_pos hA₁ hA₀ + have hweights : A₁ / (A₁ + A₀) + A₀ / (A₁ + A₀) = 1 := by field_simp + have hJ := hF.2 (show H₁ / A₁ ∈ Ioi 0 from div_pos hH₁ hA₁) + (show H₀ / A₀ ∈ Ioi 0 from div_pos hH₀ hA₀) + (div_nonneg hA₁.le hsum.le) (div_nonneg hA₀.le hsum.le) hweights + simp only [smul_eq_mul] at hJ + have harg : A₁ / (A₁ + A₀) * (H₁ / A₁) + + A₀ / (A₁ + A₀) * (H₀ / A₀) = (H₁ + H₀) / (A₁ + A₀) := by + field_simp + rw [harg] at hJ + have hhalf : ((H₁ + H₀) / 2) / ((A₁ + A₀) / 2) = + (H₁ + H₀) / (A₁ + A₀) := by field_simp + rw [hhalf] + have hscaled := mul_le_mul_of_nonneg_left hJ (show 0 ≤ (A₁ + A₀) / 2 by positivity) + have hright : (A₁ + A₀) / 2 * + (A₁ / (A₁ + A₀) * F (H₁ / A₁) + A₀ / (A₁ + A₀) * F (H₀ / A₀)) = + (A₁ * F (H₁ / A₁) + A₀ * F (H₀ / A₀)) / 2 := by + field_simp + rwa [hright] at hscaled + +theorem monotone_dissipation_zero (g : Cube 0 → ℝ) (hg : IsInterior g) : + 2 * informationDeficit g + + meanVariance g * L (entropyAverage g / meanVariance g) ≤ dissipation g := by + have hA : 0 < meanVariance g := hg.meanVariance_pos + have hscalar := ell_mul_one_sub_sq_le_entropy + (abs_lt.mpr (hg (fun _ => false))).le + have hratio : ell ≤ entropyAverage g / meanVariance g := by + apply (le_div_iff₀ hA).mpr + simpa only [entropyAverage, meanVariance, cubeAverage_zeroDim] using hscalar + rw [informationDeficit_dim_zero, dissipation_dim_zero, L_eq_zero_of_ell_le hratio] + simp + +theorem averaged_normalized_pair_of_pointwise + (hconvex : ConvexOn ℝ (Ioi 0) L) + (hpair : ∀ a b : ℝ, |a| + |b| < 1 → + (1 - a ^ 2) * L (((entropy (a + b) + entropy (a - b)) / 2) / (1 - a ^ 2)) ≤ + pairDissipation a b - 2 * pairEntropyGap a b) + {n : ℕ} (g : Cube (n + 1) → ℝ) (hg : IsInterior g) : + cubeAverage (fun x => 1 - (pairMean g x) ^ 2) * + L (entropyAverage g / cubeAverage (fun x => 1 - (pairMean g x) ^ 2)) ≤ + cubeAverage (fun x => pairDissipation (pairMean g x) (pairHalfDifference g x)) - + 2 * cubeAverage (fun x => pairEntropyGap (pairMean g x) (pairHalfDifference g x)) := by + let A : Cube n → ℝ := fun x => 1 - (pairMean g x) ^ 2 + let H : Cube n → ℝ := fun x => + (entropy (pairMean g x + pairHalfDifference g x) + + entropy (pairMean g x - pairHalfDifference g x)) / 2 + have hA : ∀ x, 0 < A x := fun x => + scalar_meanVariance_pos (abs_lt.mpr (hg.pairMean x)) + have hH : ∀ x, 0 < H x := by + intro x + dsimp [H] + rw [pairMean_add_halfDifference, pairMean_sub_halfDifference] + exact div_pos (add_pos (entropy_pos (hg.restrict true x)) + (entropy_pos (hg.restrict false x))) (by norm_num) + have hHavg : cubeAverage H = entropyAverage g := by + dsimp [H] + simp only [pairMean_add_halfDifference, pairMean_sub_halfDifference] + rw [cubeAverage_half_sum] + exact (entropyAverage_split g).symm + have hJ := cubeAverage_perspective_jensen L hconvex A H hA hH + rw [hHavg] at hJ + have hpoint := cubeAverage_mono (fun x => hpair _ _ (hg.pairDomain x)) + have hcombined := hJ.trans hpoint + simpa only [A, cubeAverage_sub, cubeAverage_smul] using hcombined + +theorem restricted_monotone_dissipation_lower + (hconvex : ConvexOn ℝ (Ioi 0) L) + {n : ℕ} (g : Cube (n + 1) → ℝ) (hg : IsInterior g) + (htrue : 2 * informationDeficit (restrict g true) + + meanVariance (restrict g true) * + L (entropyAverage (restrict g true) / meanVariance (restrict g true)) ≤ + dissipation (restrict g true)) + (hfalse : 2 * informationDeficit (restrict g false) + + meanVariance (restrict g false) * + L (entropyAverage (restrict g false) / meanVariance (restrict g false)) ≤ + dissipation (restrict g false)) : + 2 * (informationDeficit g - pairEntropyGap (cubeAverage (pairMean g)) + (cubeAverage (pairHalfDifference g))) + + (meanVariance g - (cubeAverage (pairHalfDifference g)) ^ 2) * + L (entropyAverage g / (meanVariance g - (cubeAverage (pairHalfDifference g)) ^ 2)) ≤ + (dissipation (restrict g true) + dissipation (restrict g false)) / 2 := by + have hJ := two_point_perspective_jensen L hconvex + (hg.restrict false).meanVariance_pos (hg.restrict true).meanVariance_pos + (hg.restrict false).entropyAverage_pos (hg.restrict true).entropyAverage_pos + rw [meanVariance_split, ← entropyAverage_split g] at hJ + have hS := informationDeficit_split g + linarith + +theorem monotone_dissipation_from_scalar_lemmas + (hconvex : ConvexOn ℝ (Ioi 0) L) + (hpair : ∀ a b : ℝ, |a| + |b| < 1 → + (1 - a ^ 2) * L (((entropy (a + b) + entropy (a - b)) / 2) / (1 - a ^ 2)) ≤ + pairDissipation a b - 2 * pairEntropyGap a b) + (hperspective : ∀ x w q : ℝ, 0 < x → 0 < w → w ≤ 1 → 0 ≤ q → q < 1 → q ≤ w ^ 2 → + L x - (1 - q) * L (x / (1 - q)) - w * L (x / w) ≤ + q * (1 / w - 1) * lambda (q ^ 2)) : + ∀ {n : ℕ} (g : Cube n → ℝ), IsInterior g → IsIncreasing g → + 2 * informationDeficit g + meanVariance g * L (entropyAverage g / meanVariance g) ≤ + dissipation g := by + intro n + induction n with + | zero => + intro g hg _ + exact monotone_dissipation_zero g hg + | succ n ih => + intro g hg hmono + let a := pairMean g + let b := pairHalfDifference g + have hdom : ∀ x, |a x| + |b x| < 1 := hg.pairDomain + have hb : ∀ x, 0 ≤ b x := hmono.pairHalfDifference_nonneg + obtain ⟨hm, hk, hkm, hW, hWA, hkW⟩ := monotone_pair_average_geometry a b hdom hb + have htrue := ih (restrict g true) (hg.restrict true) (hmono.restrict true) + have hfalse := ih (restrict g false) (hg.restrict false) (hmono.restrict false) + have hrestr := restricted_monotone_dissipation_lower hconvex g hg htrue hfalse + have hrestr' : + 2 * (informationDeficit g - pairEntropyGap (cubeAverage a) (cubeAverage b)) + + (1 - (cubeAverage a) ^ 2 - (cubeAverage b) ^ 2) * + L (entropyAverage g / (1 - (cubeAverage a) ^ 2 - (cubeAverage b) ^ 2)) ≤ + (dissipation (restrict g true) + dissipation (restrict g false)) / 2 := by + simpa only [a, b, meanVariance, cubeAverage_pairMean] using hrestr + have hnorm := averaged_normalized_pair_of_pointwise hconvex hpair g hg + have hgap := pair_jensen_gap_strengthened a b hdom hb + have hV := pair_variance_gap_lower_bound a b hdom + obtain ⟨hq, hq1, hw, hw1, hqw⟩ := + monotone_split_parameter_bounds hm hk hkm hW hWA hkW + have hx : 0 < entropyAverage g / (1 - (cubeAverage a) ^ 2) := + div_pos hg.entropyAverage_pos (scalar_meanVariance_pos hm) + have hp := hperspective _ _ _ hx hw hw1 hq hq1 hqw + have hfinal := monotone_dissipation_step_of_perspective hm hk hkm hW hWA hkW + hV hrestr' hnorm hgap hp + rw [dissipation_split g] + simpa only [a, b, meanVariance, cubeAverage_pairMean] using hfinal + +theorem monotone_dissipation {n : ℕ} (g : Cube n → ℝ) + (hg : IsInterior g) (hmono : IsIncreasing g) : + 2 * informationDeficit g + meanVariance g * L (entropyAverage g / meanVariance g) ≤ + dissipation g := by + exact monotone_dissipation_from_scalar_lemmas convexOn_L + (fun _ _ hab => normalized_pair_bound hab) perspective_inequality g hg hmono + +end LeanBlast.CourtadeKumar + +end + +end OAI diff --git a/lean/OAI/InformationTheory/BooleanNoise/NormalizedPair.lean b/lean/OAI/InformationTheory/BooleanNoise/NormalizedPair.lean new file mode 100644 index 0000000000000000000000000000000000000000..8c81673eba23c8f8f751ed7740c5d40463deac7c --- /dev/null +++ b/lean/OAI/InformationTheory/BooleanNoise/NormalizedPair.lean @@ -0,0 +1,377 @@ +import OAI.InformationTheory.BooleanNoise.Basic +import OAI.InformationTheory.BooleanNoise.PairEntropy +import OAI.InformationTheory.BooleanNoise.EntropySeries +import OAI.InformationTheory.BooleanNoise.InverseScalars +import OAI.InformationTheory.BooleanNoise.InverseRegularity +import OAI.InformationTheory.BooleanNoise.LShape +import Mathlib.Topology.Algebra.InfiniteSum.Order +import Mathlib.Topology.Algebra.InfiniteSum.Ring +import Mathlib.Tactic + +namespace OAI + +open scoped BigOperators + +namespace LeanBlast.CourtadeKumar + +theorem hasSum_weighted_nonneg_of_single_crossing + {x weight : ℕ → ℝ} {total : ℝ} + (hs : HasSum x 0) (hws : HasSum (fun j => weight j * x j) total) + (hw : Monotone weight) + (hcross : ∀ i j, i ≤ j → 0 < x i → 0 ≤ x j) : 0 ≤ total := by + classical + by_cases hpos : ∃ j, 0 < x j + · let k := Nat.find hpos + have hk : 0 < x k := Nat.find_spec hpos + have hbefore : ∀ j, j < k → x j ≤ 0 := by + intro j hj + exact le_of_not_gt (Nat.find_min hpos hj) + have hafter : ∀ j, k ≤ j → 0 ≤ x j := fun j hj => hcross k j hj hk + have hshift : HasSum (fun j => (weight j - weight k) * x j) total := by + convert hws.sub (hs.mul_left (weight k)) using 1 + · ext j + ring + · ring + apply hshift.nonneg + intro j + by_cases hj : j < k + · exact mul_nonneg_of_nonpos_of_nonpos (sub_nonpos.mpr (hw hj.le)) (hbefore j hj) + · exact mul_nonneg (sub_nonneg.mpr (hw (le_of_not_gt hj))) + (hafter j (le_of_not_gt hj)) + · have hx : ∀ j, x j ≤ 0 := fun j => le_of_not_gt (fun hj => hpos ⟨j, hj⟩) + have hzero : ∀ j, x j = 0 := by + intro j + have hle : -x j ≤ (0 : ℝ) := by + simpa using le_hasSum hs.neg j (fun i _ => neg_nonneg.mpr (hx i)) + linarith [hx j] + exact hws.nonneg (fun j => by rw [hzero j]; simp) + +theorem logconvex_single_crossing {z : ℕ → ℝ} + (hz : ∀ j, 0 ≤ z j) (hz0 : z 0 ≤ 1) + (hlog : ∀ j, z (j + 1) ^ 2 ≤ z j * z (j + 2)) + (i j : ℕ) (hij : i ≤ j) (hi : 1 < z i) : 1 < z j := by + have hprevious : ∀ n, 1 < z (n + 1) → z n ≤ z (n + 1) := by + intro n + induction n with + | zero => + intro h + exact hz0.trans h.le + | succ n ih => + intro h + change 1 < z (n + 2) at h + change z (n + 1) ≤ z (n + 2) + by_contra hnot + have hdesc : z (n + 2) < z (n + 1) := lt_of_not_ge hnot + have hprev := ih (h.trans hdesc) + have hmul := mul_le_mul_of_nonneg_right hprev (hz (n + 2)) + have hsq := hlog n + nlinarith + have hnext : ∀ n, 1 < z n → 1 < z (n + 1) := by + intro n hn + cases n with + | zero => exact (not_lt_of_ge hz0 hn).elim + | succ n => + have hprev := hprevious n hn + have hmul := mul_le_mul_of_nonneg_right hprev (hz (n + 2)) + have hsq := hlog n + change 1 < z (n + 2) + nlinarith + exact Nat.le_induction hi (fun n _ hn => hnext n hn) j hij + +theorem logconvex_mul_pow {m : ℕ → ℝ} + (hlog : ∀ j, m (j + 1) ^ 2 ≤ m j * m (j + 2)) (c : ℝ) (j : ℕ) : + (m (j + 1) * c ^ (j + 1)) ^ 2 ≤ + (m j * c ^ j) * (m (j + 2) * c ^ (j + 2)) := by + calc + (m (j + 1) * c ^ (j + 1)) ^ 2 = + m (j + 1) ^ 2 * (c ^ (j + 1)) ^ 2 := mul_pow _ _ _ + _ ≤ (m j * m (j + 2)) * (c ^ (j + 1)) ^ 2 := + mul_le_mul_of_nonneg_right (hlog j) (sq_nonneg _) + _ = (m j * c ^ j) * (m (j + 2) * c ^ (j + 2)) := by + simp only [pow_add, pow_one, pow_two] + ring + +theorem logconvex_geometric_single_crossing {m : ℕ → ℝ} + (hm : ∀ j, 0 ≤ m j) (hm0 : m 0 ≤ 1) + (hlog : ∀ j, m (j + 1) ^ 2 ≤ m j * m (j + 2)) + {t : ℝ} (ht : 0 ≤ t) (i j : ℕ) (hij : i ≤ j) + (hi : t ^ i < m i) : t ^ j < m j := by + by_cases ht0 : t = 0 + · subst t + by_cases hi0 : i = 0 + · subst i + simp only [pow_zero] at hi + exact (not_lt_of_ge hm0 hi).elim + · have hmi : 0 < m i := by simpa [zero_pow hi0] using hi + have hpositive : ∀ n, 0 < m (n + 1) → 0 < m (n + 2) := by + intro n hn + have hsq := hlog n + have hm0 := hm n + have hm2 := hm (n + 2) + nlinarith + have htail : ∀ k, i ≤ k → 0 < m k := by + intro k hk + induction k, hk using Nat.le_induction with + | base => exact hmi + | succ k hk ih => + obtain ⟨l, rfl⟩ := Nat.exists_eq_succ_of_ne_zero (by omega : k ≠ 0) + exact hpositive l ih + have hj0 : j ≠ 0 := by omega + simpa [zero_pow hj0] using htail j hij + · have htpos : 0 < t := lt_of_le_of_ne ht (Ne.symm ht0) + have hzi : 1 < m i * (t⁻¹) ^ i := by + rw [inv_pow, ← div_eq_mul_inv] + exact (lt_div_iff₀ (pow_pos htpos i)).mpr (by simpa using hi) + have hzj := logconvex_single_crossing + (z := fun k => m k * (t⁻¹) ^ k) + (fun k => mul_nonneg (hm k) (pow_nonneg (inv_nonneg.mpr ht) k)) + (by simpa using hm0) (logconvex_mul_pow hlog (t⁻¹)) i j hij hzi + change 1 < m j * (t⁻¹) ^ j at hzj + rw [inv_pow, ← div_eq_mul_inv] at hzj + simpa only [one_mul] using (lt_div_iff₀ (pow_pos htpos j)).mp hzj + +theorem weighted_hasSum_le_of_logconvex + {m c weight : ℕ → ℝ} {t mass moment geometricMoment : ℝ} + (hm : ∀ j, 0 ≤ m j) (hm0 : m 0 ≤ 1) + (hlog : ∀ j, m (j + 1) ^ 2 ≤ m j * m (j + 2)) + (hc : ∀ j, 0 ≤ c j) (hw : Monotone weight) (ht : 0 ≤ t) + (hs : HasSum (fun k => c k * m (k + 1)) mass) + (hts : HasSum (fun k => c k * t ^ (k + 1)) mass) + (hws : HasSum (fun k => weight k * (c k * m (k + 1))) moment) + (hwts : HasSum (fun k => weight k * (c k * t ^ (k + 1))) geometricMoment) : + geometricMoment ≤ moment := by + have hdiff : HasSum (fun k => c k * (m (k + 1) - t ^ (k + 1))) 0 := by + convert hs.sub hts using 1 + · ext k + ring + · ring + have hwdiff : HasSum + (fun k => weight k * (c k * (m (k + 1) - t ^ (k + 1)))) + (moment - geometricMoment) := by + convert hws.sub hwts using 1 + ext k + ring + have hnonneg := hasSum_weighted_nonneg_of_single_crossing hdiff hwdiff hw ?_ + · linarith + · intro i j hij hi + have hmi : t ^ (i + 1) < m (i + 1) := by + have hci := hc i + nlinarith + have hmj := logconvex_geometric_single_crossing hm hm0 hlog ht + (i + 1) (j + 1) (Nat.add_le_add_right hij 1) hmi + exact mul_nonneg (hc j) (sub_nonneg.mpr hmj.le) + +noncomputable def rawPairMoment (a b : ℝ) (j : ℕ) : ℝ := + (1 + a) / 2 * (b / (1 + a)) ^ (2 * j) + + (1 - a) / 2 * (b / (1 - a)) ^ (2 * j) + +noncomputable def normalizedPairMoment (a b : ℝ) (j : ℕ) : ℝ := + if j = 0 then 1 else rawPairMoment a b j / (1 - a ^ 2) + +@[simp] +theorem normalizedPairMoment_zero (a b : ℝ) : normalizedPairMoment a b 0 = 1 := by + simp [normalizedPairMoment] + +@[simp] +theorem normalizedPairMoment_succ (a b : ℝ) (j : ℕ) : + normalizedPairMoment a b (j + 1) = rawPairMoment a b (j + 1) / (1 - a ^ 2) := by + simp [normalizedPairMoment] + +theorem normalized_pair_scale_pos {a b : ℝ} (hab : |a| + |b| < 1) : 0 < 1 - a ^ 2 := by + have h := mul_pos (pair_denom_add_pos a b hab) (pair_denom_sub_pos a b hab) + nlinarith + +theorem abs_lt_normalized_pair_scale {a b : ℝ} (hab : |a| + |b| < 1) : + |b| < 1 - a ^ 2 := by + have ha : |a| < 1 := lt_of_le_of_lt (le_add_of_nonneg_right (abs_nonneg b)) hab + have hm := mul_nonneg (abs_nonneg a) (show 0 ≤ 1 - |a| by linarith) + nlinarith [sq_abs a] + +theorem two_atom_moment_logconvex (w u p q : ℝ) + (hw : 0 ≤ w) (hu : 0 ≤ u) (hp : 0 ≤ p) (hq : 0 ≤ q) (j : ℕ) : + (w * p ^ (j + 1) + u * q ^ (j + 1)) ^ 2 ≤ + (w * p ^ j + u * q ^ j) * (w * p ^ (j + 2) + u * q ^ (j + 2)) := by + have hnonneg : 0 ≤ w * u * p ^ j * q ^ j * (p - q) ^ 2 := by positivity + have heq : + (w * p ^ j + u * q ^ j) * (w * p ^ (j + 2) + u * q ^ (j + 2)) - + (w * p ^ (j + 1) + u * q ^ (j + 1)) ^ 2 = + w * u * p ^ j * q ^ j * (p - q) ^ 2 := by + simp only [pow_add, pow_one, pow_two] + ring + linarith + +theorem rawPairMoment_logconvex {a b : ℝ} (hab : |a| + |b| < 1) (j : ℕ) : + rawPairMoment a b (j + 1) ^ 2 ≤ + rawPairMoment a b j * rawPairMoment a b (j + 2) := by + simpa only [rawPairMoment, ← pow_mul] using + two_atom_moment_logconvex ((1 + a) / 2) ((1 - a) / 2) + ((b / (1 + a)) ^ 2) ((b / (1 - a)) ^ 2) + (le_of_lt (div_pos (pair_denom_add_pos a b hab) (by norm_num))) + (le_of_lt (div_pos (pair_denom_sub_pos a b hab) (by norm_num))) + (sq_nonneg _) (sq_nonneg _) j + +theorem normalizedPairMoment_nonneg {a b : ℝ} (hab : |a| + |b| < 1) (j : ℕ) : + 0 ≤ normalizedPairMoment a b j := by + unfold normalizedPairMoment + split_ifs with hj + · norm_num + · apply div_nonneg _ (normalized_pair_scale_pos hab).le + unfold rawPairMoment + apply add_nonneg + · apply mul_nonneg (by linarith [pair_denom_add_pos a b hab]) + rw [pow_mul] + exact pow_nonneg (sq_nonneg _) j + · apply mul_nonneg (by linarith [pair_denom_sub_pos a b hab]) + rw [pow_mul] + exact pow_nonneg (sq_nonneg _) j + +theorem normalizedPairMoment_one {a b : ℝ} (hab : |a| + |b| < 1) : + normalizedPairMoment a b 1 = b ^ 2 / (1 - a ^ 2) ^ 2 := by + have hp := ne_of_gt (pair_denom_add_pos a b hab) + have hm := ne_of_gt (pair_denom_sub_pos a b hab) + have hA := ne_of_gt (normalized_pair_scale_pos hab) + norm_num [normalizedPairMoment, rawPairMoment] + field_simp + ring + +theorem normalizedPairMoment_two {a b : ℝ} (hab : |a| + |b| < 1) : + normalizedPairMoment a b 2 = b ^ 4 * (1 + 3 * a ^ 2) / (1 - a ^ 2) ^ 4 := by + have hp := ne_of_gt (pair_denom_add_pos a b hab) + have hm := ne_of_gt (pair_denom_sub_pos a b hab) + have hA := ne_of_gt (normalized_pair_scale_pos hab) + norm_num [normalizedPairMoment, rawPairMoment] + field_simp + ring + +theorem normalizedPairMoment_logconvex {a b : ℝ} (hab : |a| + |b| < 1) (j : ℕ) : + normalizedPairMoment a b (j + 1) ^ 2 ≤ + normalizedPairMoment a b j * normalizedPairMoment a b (j + 2) := by + cases j with + | zero => + rw [normalizedPairMoment_zero, one_mul, normalizedPairMoment_one hab, + normalizedPairMoment_two hab] + calc + (b ^ 2 / (1 - a ^ 2) ^ 2) ^ 2 = b ^ 4 / (1 - a ^ 2) ^ 4 := by + rw [div_pow, ← pow_mul, ← pow_mul] + _ ≤ b ^ 4 * (1 + 3 * a ^ 2) / (1 - a ^ 2) ^ 4 := by + apply div_le_div_of_nonneg_right _ (by positivity) + nlinarith [show 0 ≤ 3 * a ^ 2 * b ^ 4 by positivity] + | succ j => + change (rawPairMoment a b (j + 2) / (1 - a ^ 2)) ^ 2 ≤ + (rawPairMoment a b (j + 1) / (1 - a ^ 2)) * + (rawPairMoment a b (j + 3) / (1 - a ^ 2)) + rw [div_pow, div_mul_div_comm, ← pow_two (1 - a ^ 2)] + exact div_le_div_of_nonneg_right (rawPairMoment_logconvex hab (j + 1)) + (sq_nonneg (1 - a ^ 2)) + +theorem normalizedPairMoment_one_lt_one {a b : ℝ} (hab : |a| + |b| < 1) : + normalizedPairMoment a b 1 < 1 := by + rw [normalizedPairMoment_one hab] + have hA := normalized_pair_scale_pos hab + have hb := abs_lt_normalized_pair_scale hab + have hprod := mul_pos (sub_pos.mpr hb) (add_pos_of_pos_of_nonneg hA (abs_nonneg b)) + apply (div_lt_one (sq_pos_of_pos hA)).mpr + nlinarith [sq_abs b] + +theorem hasSum_normalizedPairEntropy {a b : ℝ} (hab : |a| + |b| < 1) : + HasSum (fun k => psiCoeff k * normalizedPairMoment a b (k + 1)) + (pairEntropyGap a b / (1 - a ^ 2)) := by + have hp := hasSum_psi (abs_lt.mpr (pair_ratio_add_mem_Ioo a b hab)) + have hm := hasSum_psi (abs_lt.mpr (pair_ratio_sub_mem_Ioo a b hab)) + have hs := ((hp.mul_left ((1 + a) / 2)).add + (hm.mul_left ((1 - a) / 2))).div_const (1 - a ^ 2) + convert hs using 1 + · ext k + rw [normalizedPairMoment_succ] + unfold rawPairMoment + ring + · rw [pairEntropyGap_weighted a b hab] + +theorem hasSum_normalizedPairDissipation {a b : ℝ} (hab : |a| + |b| < 1) : + HasSum (fun k : ℕ => (2 * ((k : ℝ) + 1)) * + (psiCoeff k * normalizedPairMoment a b (k + 1))) + (pairDissipation a b / (1 - a ^ 2)) := by + have hp := hasSum_mul_artanh (abs_lt.mpr (pair_ratio_add_mem_Ioo a b hab)) + have hm := hasSum_mul_artanh (abs_lt.mpr (pair_ratio_sub_mem_Ioo a b hab)) + have hs := ((hp.mul_left ((1 + a) / 2)).add + (hm.mul_left ((1 - a) / 2))).div_const (1 - a ^ 2) + convert hs using 1 + · ext k + rw [normalizedPairMoment_succ] + unfold rawPairMoment + ring + · rw [pairDissipation_weighted a b hab] + +theorem normalized_pair_dissipation_ge_of_psi {a b v : ℝ} + (hab : |a| + |b| < 1) (hv : |v| < 1) + (hvpsi : psi v = pairEntropyGap a b / (1 - a ^ 2)) : + v * Real.artanh v ≤ pairDissipation a b / (1 - a ^ 2) := by + apply weighted_hasSum_le_of_logconvex + (m := normalizedPairMoment a b) (c := psiCoeff) + (weight := fun k => 2 * ((k : ℝ) + 1)) (t := v ^ 2) + (normalizedPairMoment_nonneg hab) + (by simp) (normalizedPairMoment_logconvex hab) psiCoeff_nonneg + · intro i j hij + have hcast : (i : ℝ) ≤ (j : ℝ) := by exact_mod_cast hij + dsimp + linarith + · exact sq_nonneg v + · exact hasSum_normalizedPairEntropy hab + · simpa only [← pow_mul, hvpsi] using hasSum_psi hv + · exact hasSum_normalizedPairDissipation hab + · simpa only [← pow_mul, mul_assoc] using hasSum_mul_artanh hv + +theorem normalized_pair_dissipation_ge_r {a b : ℝ} (hab : |a| + |b| < 1) : + r (pairEntropyGap a b / (1 - a ^ 2)) ≤ pairDissipation a b / (1 - a ^ 2) := by + have hs0 := pairEntropyGap_div_variance_nonneg a b hab + have hs1 := pairEntropyGap_div_variance_lt_ell a b hab + have hv := psiInv_mem_Ico hs0 hs1 + exact normalized_pair_dissipation_ge_of_psi hab + (by simpa only [abs_of_nonneg hv.1] using hv.2) (psi_psiInv hs0 hs1) + +private theorem normalized_pair_bound_of_antitone + (hanti : AntitoneOn L (Set.Ioi 0)) {a b : ℝ} (hab : |a| + |b| < 1) : + (1 - a ^ 2) * + L (((entropy (a + b) + entropy (a - b)) / 2) / (1 - a ^ 2)) ≤ + pairDissipation a b - 2 * pairEntropyGap a b := by + have hA := normalized_pair_scale_pos hab + have hs0 := pairEntropyGap_div_variance_nonneg a b hab + have hs1 := pairEntropyGap_div_variance_lt_ell a b hab + have hlow : 0 < ell - pairEntropyGap a b / (1 - a ^ 2) := sub_pos.mpr hs1 + have ha : |a| ≤ 1 := + (lt_of_le_of_lt (le_add_of_nonneg_right (abs_nonneg b)) hab).le + have hH := ell_mul_one_sub_sq_le_entropy ha + have hratio : ell - pairEntropyGap a b / (1 - a ^ 2) ≤ + ((entropy (a + b) + entropy (a - b)) / 2) / (1 - a ^ 2) := by + apply (le_div_iff₀ hA).mpr + calc + (ell - pairEntropyGap a b / (1 - a ^ 2)) * (1 - a ^ 2) = + ell * (1 - a ^ 2) - pairEntropyGap a b := by + field_simp + _ ≤ entropy a - pairEntropyGap a b := sub_le_sub_right hH _ + _ = (entropy (a + b) + entropy (a - b)) / 2 := by + unfold pairEntropyGap + ring + have hL := hanti hlow (hlow.trans_le hratio) hratio + rw [L_ell_sub hs0 hs1] at hL + have hr := normalized_pair_dissipation_ge_r hab + have hbound : + L (((entropy (a + b) + entropy (a - b)) / 2) / (1 - a ^ 2)) ≤ + (pairDissipation a b - 2 * pairEntropyGap a b) / (1 - a ^ 2) := by + calc + _ ≤ r (pairEntropyGap a b / (1 - a ^ 2)) - + 2 * (pairEntropyGap a b / (1 - a ^ 2)) := hL + _ ≤ pairDissipation a b / (1 - a ^ 2) - + 2 * (pairEntropyGap a b / (1 - a ^ 2)) := sub_le_sub_right hr _ + _ = _ := by ring + simpa only [mul_comm] using (le_div_iff₀ hA).mp hbound + +theorem normalized_pair_bound {a b : ℝ} (hab : |a| + |b| < 1) : + (1 - a ^ 2) * + L (((entropy (a + b) + entropy (a - b)) / 2) / (1 - a ^ 2)) ≤ + pairDissipation a b - 2 * pairEntropyGap a b := + normalized_pair_bound_of_antitone antitoneOn_L hab + +end LeanBlast.CourtadeKumar + +end OAI diff --git a/lean/OAI/InformationTheory/BooleanNoise/PairEntropy.lean b/lean/OAI/InformationTheory/BooleanNoise/PairEntropy.lean new file mode 100644 index 0000000000000000000000000000000000000000..4f527cb9ad23b7b97928a810606e91f8439577ff --- /dev/null +++ b/lean/OAI/InformationTheory/BooleanNoise/PairEntropy.lean @@ -0,0 +1,280 @@ +import OAI.InformationTheory.BooleanNoise.Basic +import OAI.InformationTheory.BooleanNoise.EntropyScalars +import OAI.InformationTheory.BooleanNoise.EntropyBounds +import OAI.InformationTheory.BooleanNoise.InverseRegularity +import OAI.InformationTheory.BooleanNoise.KRegularity +import Mathlib.Analysis.Convex.Function +import Mathlib.Tactic.FieldSimp +import Mathlib.Tactic.Linarith +import Mathlib.Tactic.Ring + +namespace OAI + +noncomputable section + +namespace LeanBlast.CourtadeKumar + +theorem pair_mean_mem_Ioo (a b : ℝ) (h : |a| + |b| < 1) : a ∈ Set.Ioo (-1) 1 := by + have ha : |a| < 1 := lt_of_le_of_lt (le_add_of_nonneg_right (abs_nonneg b)) h + exact abs_lt.mp ha + +theorem pair_add_mem_Ioo (a b : ℝ) (h : |a| + |b| < 1) : a + b ∈ Set.Ioo (-1) 1 := by + exact abs_lt.mp (lt_of_le_of_lt (abs_add_le a b) h) + +theorem pair_sub_mem_Ioo (a b : ℝ) (h : |a| + |b| < 1) : a - b ∈ Set.Ioo (-1) 1 := by + exact abs_lt.mp (lt_of_le_of_lt (abs_sub a b) h) + +theorem pair_denom_add_pos (a b : ℝ) (h : |a| + |b| < 1) : 0 < 1 + a := by + have ha := (pair_mean_mem_Ioo a b h).1 + linarith + +theorem pair_denom_sub_pos (a b : ℝ) (h : |a| + |b| < 1) : 0 < 1 - a := by + have ha := (pair_mean_mem_Ioo a b h).2 + linarith + +theorem pair_abs_lt_denom_add (a b : ℝ) (h : |a| + |b| < 1) : |b| < 1 + a := by + linarith [neg_le_abs a] + +theorem pair_abs_lt_denom_sub (a b : ℝ) (h : |a| + |b| < 1) : |b| < 1 - a := by + linarith [le_abs_self a] + +private theorem div_mem_Ioo (s b : ℝ) (hs : 0 < s) (hb : |b| < s) : + b / s ∈ Set.Ioo (-1) 1 := by + obtain ⟨hlo, hhi⟩ := abs_lt.mp hb + constructor + · apply (lt_div_iff₀ hs).2 + linarith + · apply (div_lt_iff₀ hs).2 + linarith + +theorem pair_ratio_add_mem_Ioo (a b : ℝ) (h : |a| + |b| < 1) : + b / (1 + a) ∈ Set.Ioo (-1) 1 := + div_mem_Ioo (1 + a) b (pair_denom_add_pos a b h) (pair_abs_lt_denom_add a b h) + +theorem pair_ratio_sub_mem_Ioo (a b : ℝ) (h : |a| + |b| < 1) : + b / (1 - a) ∈ Set.Ioo (-1) 1 := + div_mem_Ioo (1 - a) b (pair_denom_sub_pos a b h) (pair_abs_lt_denom_sub a b h) + +theorem pair_variance_pos (a b : ℝ) (h : |a| + |b| < 1) : 0 < 1 - a ^ 2 := by + have hp := mul_pos (pair_denom_add_pos a b h) (pair_denom_sub_pos a b h) + nlinarith + +theorem pair_abs_lt_variance (a b : ℝ) (h : |a| + |b| < 1) : + |b| < 1 - a ^ 2 := by + have ha1 : |a| < 1 := lt_of_le_of_lt (le_add_of_nonneg_right (abs_nonneg b)) h + have hprod := mul_nonneg (abs_nonneg a) (show 0 ≤ 1 - |a| by linarith) + nlinarith [sq_abs a] + +theorem pair_weighted_sq (a b : ℝ) (h : |a| + |b| < 1) : + (1 + a) / 2 * (b / (1 + a)) ^ 2 + (1 - a) / 2 * (b / (1 - a)) ^ 2 = + b ^ 2 / (1 - a ^ 2) := by + have hp := ne_of_gt (pair_denom_add_pos a b h) + have hm := ne_of_gt (pair_denom_sub_pos a b h) + have hv := ne_of_gt (pair_variance_pos a b h) + field_simp + ring + +theorem pairEntropyGap_eq_psi (a b : ℝ) : + pairEntropyGap a b = (psi (a + b) + psi (a - b)) / 2 - psi a := by + unfold pairEntropyGap entropy + ring + +@[simp] theorem pairEntropyGap_zero (a : ℝ) : pairEntropyGap a 0 = 0 := by + simp [pairEntropyGap] + +@[simp] theorem pairDissipation_zero (a : ℝ) : pairDissipation a 0 = 0 := by + simp [pairDissipation] + +theorem pairEntropyGap_neg_right (a b : ℝ) : pairEntropyGap a (-b) = pairEntropyGap a b := by + change entropy a - (entropy (a - b) + entropy (a - -b)) / 2 = _ + rw [sub_neg_eq_add] + unfold pairEntropyGap + ring + +private theorem weighted_psi_div (s b : ℝ) (hs : 0 < s) (hb : |b| < s) : + s / 2 * psi (b / s) = + (s + b) / 4 * Real.log (s + b) + (s - b) / 4 * Real.log (s - b) - + s / 2 * Real.log s := by + obtain ⟨hlo, hhi⟩ := abs_lt.mp hb + have hs0 : s ≠ 0 := ne_of_gt hs + have hp : s + b ≠ 0 := ne_of_gt (by linarith) + have hm : s - b ≠ 0 := ne_of_gt (by linarith) + have hplus : 1 + b / s = (s + b) / s := by field_simp + have hminus : 1 - b / s = (s - b) / s := by field_simp + rw [psi, hplus, hminus, Real.log_div hp hs0, Real.log_div hm hs0] + field_simp + ring + +theorem pairEntropyGap_weighted (a b : ℝ) (h : |a| + |b| < 1) : + pairEntropyGap a b = + (1 + a) / 2 * psi (b / (1 + a)) + (1 - a) / 2 * psi (b / (1 - a)) := by + rw [weighted_psi_div (1 + a) b (pair_denom_add_pos a b h) (pair_abs_lt_denom_add a b h), + weighted_psi_div (1 - a) b (pair_denom_sub_pos a b h) (pair_abs_lt_denom_sub a b h)] + unfold pairEntropyGap entropy psi + ring_nf + +private theorem pair_artanh_eq_log_sub (x : ℝ) (hx : x ∈ Set.Ioo (-1) 1) : + Real.artanh x = (Real.log (1 + x) - Real.log (1 - x)) / 2 := by + rw [Real.artanh_eq_half_log ⟨le_of_lt hx.1, le_of_lt hx.2⟩, + Real.log_div (ne_of_gt (by linarith [hx.1])) (ne_of_gt (by linarith [hx.2]))] + ring + +private theorem artanh_div (s b : ℝ) (hs : 0 < s) (hb : |b| < s) : + Real.artanh (b / s) = (Real.log (s + b) - Real.log (s - b)) / 2 := by + obtain ⟨hlo, hhi⟩ := abs_lt.mp hb + have hs0 : s ≠ 0 := ne_of_gt hs + have hp : s + b ≠ 0 := ne_of_gt (by linarith) + have hm : s - b ≠ 0 := ne_of_gt (by linarith) + have hplus : 1 + b / s = (s + b) / s := by field_simp + have hminus : 1 - b / s = (s - b) / s := by field_simp + rw [pair_artanh_eq_log_sub _ (div_mem_Ioo s b hs hb), hplus, hminus, + Real.log_div hp hs0, Real.log_div hm hs0] + ring + +theorem pairDissipation_weighted (a b : ℝ) (h : |a| + |b| < 1) : + pairDissipation a b = + (1 + a) / 2 * (b / (1 + a) * Real.artanh (b / (1 + a))) + + (1 - a) / 2 * (b / (1 - a) * Real.artanh (b / (1 - a))) := by + have hp : 1 + a ≠ 0 := ne_of_gt (pair_denom_add_pos a b h) + have hm : 1 - a ≠ 0 := ne_of_gt (pair_denom_sub_pos a b h) + rw [pairDissipation, pair_artanh_eq_log_sub _ (pair_add_mem_Ioo a b h), + pair_artanh_eq_log_sub _ (pair_sub_mem_Ioo a b h), + artanh_div (1 + a) b (pair_denom_add_pos a b h) (pair_abs_lt_denom_add a b h), + artanh_div (1 - a) b (pair_denom_sub_pos a b h) (pair_abs_lt_denom_sub a b h)] + field_simp + ring_nf + +theorem pairDissipation_nonneg (a b : ℝ) (h : |a| + |b| < 1) : + 0 ≤ pairDissipation a b := by + unfold pairDissipation + by_cases hb : 0 ≤ b + · apply mul_nonneg (by positivity) + apply sub_nonneg.mpr + exact Real.artanh_le_artanh (pair_sub_mem_Ioo a b h).1 + (pair_add_mem_Ioo a b h).2 (by linarith) + · apply mul_nonneg_of_nonpos_of_nonpos (by linarith) + apply sub_nonpos.mpr + exact Real.artanh_le_artanh (pair_add_mem_Ioo a b h).1 + (pair_sub_mem_Ioo a b h).2 (by linarith) + +theorem pairEntropyGap_nonneg (a b : ℝ) (h : |a| + |b| < 1) : + 0 ≤ pairEntropyGap a b := by + rw [pairEntropyGap_weighted a b h] + exact add_nonneg + (mul_nonneg (by linarith [pair_denom_add_pos a b h]) (psi_nonneg _)) + (mul_nonneg (by linarith [pair_denom_sub_pos a b h]) (psi_nonneg _)) + +theorem pairEntropyGap_div_variance_nonneg (a b : ℝ) (h : |a| + |b| < 1) : + 0 ≤ pairEntropyGap a b / (1 - a ^ 2) := + div_nonneg (pairEntropyGap_nonneg a b h) (le_of_lt (pair_variance_pos a b h)) + +theorem pairEntropyGap_lt_ell (a b : ℝ) (h : |a| + |b| < 1) : + pairEntropyGap a b < ell := by + rw [pairEntropyGap_weighted a b h] + calc + _ < (1 + a) / 2 * ell + (1 - a) / 2 * ell := + add_lt_add + (mul_lt_mul_of_pos_left (psi_lt_ell (pair_ratio_add_mem_Ioo a b h)) + (by linarith [pair_denom_add_pos a b h])) + (mul_lt_mul_of_pos_left (psi_lt_ell (pair_ratio_sub_mem_Ioo a b h)) + (by linarith [pair_denom_sub_pos a b h])) + _ = ell := by ring + +theorem pair_entropyAverage_pos (a b : ℝ) (h : |a| + |b| < 1) : + 0 < (entropy (a + b) + entropy (a - b)) / 2 := by + have hp := entropy_pos (pair_add_mem_Ioo a b h) + have hm := entropy_pos (pair_sub_mem_Ioo a b h) + linarith + +theorem pairEntropyGap_lt_entropy (a b : ℝ) (h : |a| + |b| < 1) : + pairEntropyGap a b < entropy a := by + unfold pairEntropyGap + linarith [pair_entropyAverage_pos a b h] + +theorem pairEntropyGap_le_quadratic (a b : ℝ) (h : |a| + |b| < 1) : + pairEntropyGap a b ≤ ell * (b ^ 2 / (1 - a ^ 2)) := by + calc + _ = (1 + a) / 2 * psi (b / (1 + a)) + + (1 - a) / 2 * psi (b / (1 - a)) := pairEntropyGap_weighted a b h + _ ≤ (1 + a) / 2 * (ell * (b / (1 + a)) ^ 2) + + (1 - a) / 2 * (ell * (b / (1 - a)) ^ 2) := + add_le_add + (mul_le_mul_of_nonneg_left + (psi_le_ell_mul_sq (le_of_lt (abs_lt.mpr (pair_ratio_add_mem_Ioo a b h)))) + (by linarith [pair_denom_add_pos a b h])) + (mul_le_mul_of_nonneg_left + (psi_le_ell_mul_sq (le_of_lt (abs_lt.mpr (pair_ratio_sub_mem_Ioo a b h)))) + (by linarith [pair_denom_sub_pos a b h])) + _ = ell * ((1 + a) / 2 * (b / (1 + a)) ^ 2 + + (1 - a) / 2 * (b / (1 - a)) ^ 2) := by ring + _ = _ := by rw [pair_weighted_sq a b h] + +theorem pairEntropyGap_div_variance_lt_ell (a b : ℝ) (h : |a| + |b| < 1) : + pairEntropyGap a b / (1 - a ^ 2) < ell := by + have hA := pair_variance_pos a b h + have hb := pair_abs_lt_variance a b h + have hprod := mul_pos (show 0 < 1 - a ^ 2 - |b| by linarith) + (show 0 < 1 - a ^ 2 + |b| by linarith [abs_nonneg b]) + have hsq : b ^ 2 < (1 - a ^ 2) * (1 - a ^ 2) := by nlinarith [sq_abs b] + have hratio : b ^ 2 / (1 - a ^ 2) < 1 - a ^ 2 := (div_lt_iff₀ hA).2 hsq + apply (div_lt_iff₀ hA).2 + exact (pairEntropyGap_le_quadratic a b h).trans_lt + (mul_lt_mul_of_pos_left hratio ell_pos) + +theorem hasDerivAt_pairEntropyGap (a b : ℝ) (h : |a| + |b| < 1) : + HasDerivAt (fun t => pairEntropyGap a t) + ((Real.artanh (a + b) - Real.artanh (a - b)) / 2) b := by + have hp : HasDerivAt (fun t => psi (a + t)) (Real.artanh (a + b)) b := by + convert! (hasDerivAt_psi (pair_add_mem_Ioo a b h)).comp b + ((hasDerivAt_id b).const_add a) using 1 + simp + have hm : HasDerivAt (fun t => psi (a - t)) (-Real.artanh (a - b)) b := by + convert! (hasDerivAt_psi (pair_sub_mem_Ioo a b h)).comp b + ((hasDerivAt_const b a).sub (hasDerivAt_id b)) using 1 + simp + have hf : (fun t => pairEntropyGap a t) = + (fun t => (psi (a + t) + psi (a - t)) / 2 - psi a) := + funext (pairEntropyGap_eq_psi a) + rw [hf] + convert! ((hp.add hm).div_const 2).sub_const (psi a) using 1 + +theorem pairDissipation_eq_mul_deriv (a b : ℝ) (h : |a| + |b| < 1) : + pairDissipation a b = b * deriv (fun t => pairEntropyGap a t) b := by + rw [(hasDerivAt_pairEntropyGap a b h).deriv, pairDissipation] + ring + +theorem pairDissipation_weighted_r (a b : ℝ) (h : |a| + |b| < 1) : + pairDissipation a b = + (1 + a) / 2 * r (psi (b / (1 + a))) + + (1 - a) / 2 * r (psi (b / (1 - a))) := by + rw [r_psi (pair_ratio_add_mem_Ioo a b h), r_psi (pair_ratio_sub_mem_Ioo a b h)] + exact pairDissipation_weighted a b h + +theorem r_pairEntropyGap_le_pairDissipation (a b : ℝ) (h : |a| + |b| < 1) : + r (pairEntropyGap a b) ≤ pairDissipation a b := by + have hp := pair_ratio_add_mem_Ioo a b h + have hm := pair_ratio_sub_mem_Ioo a b h + have hJ := convexOn_r.2 + (show psi (b / (1 + a)) ∈ Set.Ico 0 ell from ⟨psi_nonneg _, psi_lt_ell hp⟩) + (show psi (b / (1 - a)) ∈ Set.Ico 0 ell from ⟨psi_nonneg _, psi_lt_ell hm⟩) + (show 0 ≤ (1 + a) / 2 by linarith [pair_denom_add_pos a b h]) + (show 0 ≤ (1 - a) / 2 by linarith [pair_denom_sub_pos a b h]) + (show (1 + a) / 2 + (1 - a) / 2 = 1 by ring) + simp only [smul_eq_mul] at hJ + rw [← pairEntropyGap_weighted a b h] at hJ + exact hJ.trans_eq (pairDissipation_weighted_r a b h).symm + +theorem rGap_pairEntropyGap_le (a b : ℝ) (h : |a| + |b| < 1) : + rGap (pairEntropyGap a b) ≤ pairDissipation a b - 2 * pairEntropyGap a b := by + exact sub_le_sub_right (r_pairEntropyGap_le_pairDissipation a b h) _ + +theorem K_pairEntropyGap_le (a b : ℝ) (h : |a| + |b| < 1) : + K (pairEntropyGap a b) ≤ pairDissipation a b - 2 * pairEntropyGap a b := + (K_le_rGap (pairEntropyGap_nonneg a b h) (pairEntropyGap_lt_ell a b h)).trans + (rGap_pairEntropyGap_le a b h) + +end LeanBlast.CourtadeKumar + +end + +end OAI diff --git a/lean/OAI/InformationTheory/BooleanNoise/PerspectiveCalculus.lean b/lean/OAI/InformationTheory/BooleanNoise/PerspectiveCalculus.lean new file mode 100644 index 0000000000000000000000000000000000000000..525580c477925f0ad69c5fae473d6822dd383944 --- /dev/null +++ b/lean/OAI/InformationTheory/BooleanNoise/PerspectiveCalculus.lean @@ -0,0 +1,102 @@ +import OAI.InformationTheory.BooleanNoise.ConcavityAcrossJoin +import Mathlib.Analysis.SpecialFunctions.Log.Deriv +import Mathlib.Tactic + +namespace OAI + +noncomputable section + +open Set + +namespace LeanBlast.CourtadeKumar + +def logCorrectedPerspective (f : ℝ → ℝ) (x C v : ℝ) : ℝ := + v * f (x / v) - C * v * Real.log v + +def logCorrectedPerspectiveDeriv (f f' : ℝ → ℝ) (x C v : ℝ) : ℝ := + f (x / v) - (x / v) * f' (x / v) - C * (Real.log v + 1) + +def logCorrectedPerspectiveSecondDeriv (f'' : ℝ → ℝ) (x C v : ℝ) : ℝ := + ((x / v) ^ 2 * f'' (x / v) - C) / v + +private theorem hasDerivAt_const_quotient (x v : ℝ) (hv : 0 < v) : + HasDerivAt (fun w : ℝ => x / w) (-x / v ^ 2) v := by + convert! (hasDerivAt_const v x).div (hasDerivAt_id v) (ne_of_gt hv) using 1 + simp + +theorem hasDerivAt_logCorrectedPerspective (f f' : ℝ → ℝ) (x C : ℝ) + {v : ℝ} (hv : 0 < v) (hf : HasDerivAt f (f' (x / v)) (x / v)) : + HasDerivAt (logCorrectedPerspective f x C) + (logCorrectedPerspectiveDeriv f f' x C v) v := by + have hi := hasDerivAt_const_quotient x v hv + have hp := (hasDerivAt_id v).mul (hf.comp v hi) + have hl := ((hasDerivAt_id v).mul (Real.hasDerivAt_log (ne_of_gt hv))).const_mul C + convert hp.sub hl using 1 + · ext w + change w * f (x / w) - C * w * Real.log w = + w * f (x / w) - C * (w * Real.log w) + ring + · dsimp only [logCorrectedPerspectiveDeriv, id_eq, Function.comp_def] + field_simp [ne_of_gt hv] + ring + +theorem hasDerivAt_logCorrectedPerspectiveDeriv (f f' f'' : ℝ → ℝ) (x C : ℝ) + {v : ℝ} (hv : 0 < v) (hf : HasDerivAt f (f' (x / v)) (x / v)) + (hf' : HasDerivAt f' (f'' (x / v)) (x / v)) : + HasDerivAt (logCorrectedPerspectiveDeriv f f' x C) + (logCorrectedPerspectiveSecondDeriv f'' x C v) v := by + have hi := hasDerivAt_const_quotient x v hv + have hfirst := hf.comp v hi + have hsecond := hi.mul (hf'.comp v hi) + have hlog := ((Real.hasDerivAt_log (ne_of_gt hv)).add_const 1).const_mul C + convert! (hfirst.sub hsecond).sub hlog using 1 + dsimp only [logCorrectedPerspectiveSecondDeriv, Function.comp_apply] + field_simp [ne_of_gt hv] + ring + +theorem continuousOn_logCorrectedPerspectiveDeriv (f f' : ℝ → ℝ) (x C : ℝ) + (hx : 0 < x) (hf : ∀ y, 0 < y → HasDerivAt f (f' y) y) + (hf' : ContinuousOn f' (Ioi 0)) : + ContinuousOn (logCorrectedPerspectiveDeriv f f' x C) (Ioi 0) := by + have hi : ContinuousOn (fun v : ℝ => x / v) (Ioi 0) := + continuousOn_const.div continuousOn_id (fun _ hv => ne_of_gt hv) + have hmap : MapsTo (fun v : ℝ => x / v) (Ioi 0) (Ioi 0) := + fun _ hv => div_pos hx hv + have hcf : ContinuousOn f (Ioi 0) := + fun y hy => (hf y hy).continuousAt.continuousWithinAt + have hl : ContinuousOn Real.log (Ioi 0) := + continuousOn_id.log (fun _ hv => ne_of_gt hv) + exact ((hcf.comp hi hmap).sub (hi.mul (hf'.comp hi hmap))).sub + (continuousOn_const.mul (hl.add continuousOn_const)) + +theorem concaveOn_logCorrectedPerspective (f f' f'' : ℝ → ℝ) + (x C join : ℝ) (hx : 0 < x) (hjoin : 0 < join) + (hf : ∀ y, 0 < y → HasDerivAt f (f' y) y) + (hcf' : ContinuousOn f' (Ioi 0)) + (hf' : ∀ y, 0 < y → y ≠ join → HasDerivAt f' (f'' y) y) + (hcurv : ∀ y, 0 < y → y ≠ join → y ^ 2 * f'' y ≤ C) : + ConcaveOn ℝ (Ioi 0) (logCorrectedPerspective f x C) := by + have hneq {v : ℝ} (hv : 0 < v) (hvc : v ≠ x / join) : x / v ≠ join := by + intro heq + apply hvc + apply (eq_div_iff (ne_of_gt hjoin)).mpr + have h := (div_eq_iff (ne_of_gt hv)).mp heq + linarith + apply concaveOn_Ioi_of_hasDerivAt2_nonpos_except + (logCorrectedPerspective f x C) (logCorrectedPerspectiveDeriv f f' x C) + (logCorrectedPerspectiveSecondDeriv f'' x C) 0 (x / join) + · intro v hv + exact hasDerivAt_logCorrectedPerspective f f' x C hv (hf _ (div_pos hx hv)) + · exact continuousOn_logCorrectedPerspectiveDeriv f f' x C hx hf hcf' + · intro v hv hvc + exact hasDerivAt_logCorrectedPerspectiveDeriv f f' f'' x C hv + (hf _ (div_pos hx hv)) (hf' _ (div_pos hx hv) (hneq hv hvc)) + · intro v hv hvc + exact div_nonpos_of_nonpos_of_nonneg + (sub_nonpos.mpr (hcurv _ (div_pos hx hv) (hneq hv hvc))) hv.le + +end LeanBlast.CourtadeKumar + +end + +end OAI diff --git a/lean/OAI/InformationTheory/BooleanNoise/PerspectiveInequality.lean b/lean/OAI/InformationTheory/BooleanNoise/PerspectiveInequality.lean new file mode 100644 index 0000000000000000000000000000000000000000..91cf08c9cc110027fd37ac2a994724467675353e --- /dev/null +++ b/lean/OAI/InformationTheory/BooleanNoise/PerspectiveInequality.lean @@ -0,0 +1,307 @@ +import OAI.InformationTheory.BooleanNoise.LambdaScalars +import OAI.InformationTheory.BooleanNoise.PerspectiveJensen +import OAI.InformationTheory.BooleanNoise.PerspectiveLogTrapezoid +import OAI.InformationTheory.BooleanNoise.PerspectiveCalculus +import OAI.InformationTheory.BooleanNoise.CurvatureBounds +import OAI.InformationTheory.BooleanNoise.LRegularity +import OAI.InformationTheory.BooleanNoise.LShape +import OAI.InformationTheory.BooleanNoise.Basic +import OAI.InformationTheory.BooleanNoise.CurvatureCertificates +import Mathlib.Analysis.SpecialFunctions.Log.Deriv +import Mathlib.Analysis.Convex.Jensen +import Mathlib.Analysis.Convex.Deriv +import Mathlib.Tactic + +namespace OAI + +noncomputable section + +open scoped BigOperators Topology +open Set Filter + +namespace LeanBlast.CourtadeKumar + +def logBarrier (b : ℝ) : ℝ := -Real.log (1 - b) + +@[simp] theorem logBarrier_zero : logBarrier 0 = 0 := by simp [logBarrier] + +theorem hasDerivAt_logBarrier {b : ℝ} (hb : b < 1) : + HasDerivAt logBarrier (1 / (1 - b)) b := by + have h := (((hasDerivAt_const b (1 : ℝ)).sub (hasDerivAt_id b)).log + (show 1 - b ≠ 0 by linarith)).neg + convert! h using 1 + simp [neg_div] + +theorem lambda_truncated_upper {z : ℝ} (hz0 : 0 ≤ z) (hz1 : z < 1) (k m : ℕ) : + (1 - z ^ k) * lambda z ≤ + (∑ j ∈ Finset.range k, z ^ j / ((j : ℝ) + 1)) - + ∑ j ∈ Finset.range m, + (z ^ k * (z ^ j / ((j : ℝ) + 1)) - + z ^ (j + k) / ((j : ℝ) + k + 1)) := by + have hs := hasSum_lambda hz0 hz1 + have ht := (hasSum_nat_add_iff' k).mpr hs + have hd := (hs.mul_left (z ^ k)).sub ht + simp only [Nat.cast_add] at hd + have hnonneg : ∀ j : ℕ, + 0 ≤ z ^ k * (z ^ j / ((j : ℝ) + 1)) - + z ^ (j + k) / ((j : ℝ) + k + 1) := by + intro j + rw [sub_nonneg, ← mul_div_assoc, ← pow_add, Nat.add_comm k j] + apply div_le_div_of_nonneg_left (pow_nonneg hz0 _) (by positivity) + have hk : (0 : ℝ) ≤ k := Nat.cast_nonneg k + linarith + have hp := sum_le_hasSum (Finset.range m) (fun j _ => hnonneg j) hd + linarith + +theorem lambda_cutoff_four {b : ℝ} (hb0 : 0 ≤ b) (hb1 : b < 1) : + (1 - b ^ 4) * lambda b ≤ + 1 + b / 2 + b ^ 2 / 3 + b ^ 3 / 4 - (4 / 5 : ℝ) * b ^ 4 - + b ^ 5 / 3 - (4 / 21 : ℝ) * b ^ 6 - b ^ 7 / 8 - (4 / 45 : ℝ) * b ^ 8 := by + have h := lambda_truncated_upper hb0 hb1 4 5 + norm_num [Finset.sum_range_succ] at h + nlinarith + +private theorem sq_lt_one_of_nonneg {b : ℝ} (hb0 : 0 ≤ b) (hb1 : b < 1) : b ^ 2 < 1 := by + have h := mul_pos (sub_pos.mpr hb1) (show 0 < 1 + b by linarith) + nlinarith + +theorem lambda_cutoff_two_sq {b : ℝ} (hb0 : 0 ≤ b) (hb1 : b < 1) : + (1 - b ^ 4) * lambda (b ^ 2) ≤ + 1 + b ^ 2 / 2 - (2 / 3 : ℝ) * b ^ 4 - b ^ 6 / 4 - (2 / 15 : ℝ) * b ^ 8 := by + have h := lambda_truncated_upper (sq_nonneg b) (sq_lt_one_of_nonneg hb0 hb1) 2 3 + norm_num [Finset.sum_range_succ] at h + nlinarith + +def lambdaDerivativeFactor (b : ℝ) : ℝ := + 9 - b - 3 * b ^ 2 - b ^ 3 - 3 * (1 - b ^ 4) * lambda b - + 2 * (1 - b ^ 4) * lambda (b ^ 2) + +theorem lambda_polynomial_le_factor {b : ℝ} (hb0 : 0 ≤ b) (hb1 : b < 1) : + 4 - (5 / 2 : ℝ) * b - 5 * b ^ 2 - (7 / 4 : ℝ) * b ^ 3 + + (56 / 15 : ℝ) * b ^ 4 + b ^ 5 + (15 / 14 : ℝ) * b ^ 6 + + (3 / 8 : ℝ) * b ^ 7 + (8 / 15 : ℝ) * b ^ 8 ≤ lambdaDerivativeFactor b := by + unfold lambdaDerivativeFactor + have h1 := lambda_cutoff_four hb0 hb1 + have h2 := lambda_cutoff_two_sq hb0 hb1 + nlinarith + +def lambdaAuxiliary (b : ℝ) : ℝ := + 3 * logBarrier (b ^ 4) - b ^ 3 * logBarrier b - b ^ 2 * logBarrier (b ^ 2) + +def lambdaAuxiliaryDerivative (b : ℝ) : ℝ := + 12 * b ^ 3 / (1 - b ^ 4) - 3 * b ^ 2 * logBarrier b - b ^ 3 / (1 - b) - + 2 * b * logBarrier (b ^ 2) - 2 * b ^ 3 / (1 - b ^ 2) + +@[simp] theorem lambdaAuxiliary_zero : lambdaAuxiliary 0 = 0 := by + simp [lambdaAuxiliary] + +theorem hasDerivAt_lambdaAuxiliary {b : ℝ} (hb0 : 0 ≤ b) (hb1 : b < 1) : + HasDerivAt lambdaAuxiliary (lambdaAuxiliaryDerivative b) b := by + have hb2 := sq_lt_one_of_nonneg hb0 hb1 + have hb4 : b ^ 4 < 1 := by + have h := sq_lt_one_of_nonneg (sq_nonneg b) hb2 + nlinarith + have h1 := hasDerivAt_logBarrier hb1 + have h2 := (hasDerivAt_logBarrier hb2).comp b (h := fun t : ℝ => t ^ 2) (hasDerivAt_pow 2 b) + have h4 := (hasDerivAt_logBarrier hb4).comp b (h := fun t : ℝ => t ^ 4) (hasDerivAt_pow 4 b) + have hd := ((h4.const_mul 3).sub ((hasDerivAt_pow 3 b).mul h1)).sub + ((hasDerivAt_pow 2 b).mul h2) + convert! hd using 1 + simp only [lambdaAuxiliaryDerivative, Function.comp_apply] + ring + +theorem lambdaAuxiliaryDerivative_factor {b : ℝ} (hb0 : 0 < b) (hb1 : b < 1) : + lambdaAuxiliaryDerivative b = b ^ 3 / (1 - b ^ 4) * lambdaDerivativeFactor b := by + have hb2 := sq_lt_one_of_nonneg hb0.le hb1 + have hb4 : b ^ 4 < 1 := by + have h := sq_lt_one_of_nonneg (sq_nonneg b) hb2 + nlinarith + have hne : b ≠ 0 := hb0.ne' + have hne2 : b ^ 2 ≠ 0 := pow_ne_zero _ hne + have h1 : 1 - b ≠ 0 := by linarith + have h2 : 1 - b ^ 2 ≠ 0 := by linarith + have h4 : 1 - b ^ 4 ≠ 0 := by linarith + simp only [lambdaAuxiliaryDerivative, lambdaDerivativeFactor, logBarrier, + lambda_of_ne_zero hne, lambda_of_ne_zero hne2] + field_simp + ring + +theorem lambdaDerivativeFactor_pos {b : ℝ} (hb0 : 0 ≤ b) (hb1 : b < 1) : + 0 < lambdaDerivativeFactor b := by + have hp := lambdaCertificate_pos hb0 hb1.le + have hf := lambda_polynomial_le_factor hb0 hb1 + unfold lambdaPolynomial at hp + linarith + +theorem lambdaAuxiliaryDerivative_nonneg {b : ℝ} (hb0 : 0 < b) (hb1 : b < 1) : + 0 ≤ lambdaAuxiliaryDerivative b := by + rw [lambdaAuxiliaryDerivative_factor hb0 hb1] + have hb4 : b ^ 4 < 1 := by + have h := sq_lt_one_of_nonneg (sq_nonneg b) (sq_lt_one_of_nonneg hb0.le hb1) + nlinarith + exact mul_nonneg (div_nonneg (pow_nonneg hb0.le _) (sub_nonneg.mpr hb4.le)) + (lambdaDerivativeFactor_pos hb0.le hb1).le + +theorem monotoneOn_lambdaAuxiliary : MonotoneOn lambdaAuxiliary (Ico (0 : ℝ) 1) := by + apply monotoneOn_of_hasDerivWithinAt_nonneg (convex_Ico 0 1) + (fun b hb => (hasDerivAt_lambdaAuxiliary hb.1 hb.2).continuousAt.continuousWithinAt) + · intro b hb + simp only [interior_Ico, mem_Ioo] at hb + exact (hasDerivAt_lambdaAuxiliary hb.1.le hb.2).hasDerivWithinAt + · intro b hb + simp only [interior_Ico, mem_Ioo] at hb + exact lambdaAuxiliaryDerivative_nonneg hb.1 hb.2 + +theorem lambdaAuxiliary_nonneg {b : ℝ} (hb0 : 0 ≤ b) (hb1 : b < 1) : + 0 ≤ lambdaAuxiliary b := by + simpa using monotoneOn_lambdaAuxiliary + (show (0 : ℝ) ∈ Ico 0 1 by norm_num) ⟨hb0, hb1⟩ hb0 + +theorem lambdaAuxiliary_eq (b : ℝ) : + lambdaAuxiliary b = b ^ 4 * (3 * lambda (b ^ 4) - lambda b - lambda (b ^ 2)) := by + have hM (z : ℝ) : logBarrier z = z * lambda z := (mul_lambda z).symm + rw [lambdaAuxiliary, hM, hM, hM] + ring + +theorem lambda_add_sq_le (b : ℝ) (hb0 : 0 ≤ b) (hb1 : b < 1) : + lambda b + lambda (b ^ 2) ≤ 3 * lambda (b ^ 4) := by + by_cases hb : b = 0 + · subst b + norm_num + have h := lambdaAuxiliary_nonneg hb0 hb1 + rw [lambdaAuxiliary_eq] at h + have hp : 0 < b ^ 4 := pow_pos (lt_of_le_of_ne hb0 (Ne.symm hb)) _ + have ht := nonneg_of_mul_nonneg_right h hp + linarith + +theorem lambda_sqrt_add_le (q : ℝ) (hq0 : 0 ≤ q) (hq1 : q < 1) : + lambda (Real.sqrt q) + lambda q ≤ 3 * lambda (q ^ 2) := by + have hsq := Real.sq_sqrt hq0 + have hq : Real.sqrt q < 1 := by nlinarith [Real.sqrt_nonneg q] + have h := lambda_add_sq_le (Real.sqrt q) (Real.sqrt_nonneg q) hq + have hfour : (Real.sqrt q) ^ 4 = q ^ 2 := by nlinarith [sq_nonneg (Real.sqrt q)] + simpa only [hsq, hfour] using h + +theorem concave_perspective_exchange (f : ℝ → ℝ) (hf : ConcaveOn ℝ (Ioi 0) f) + (w q : ℝ) (hq0 : 0 < q) (hqw : q < w) (hw1 : w ≤ 1) : + f 1 + f (w - q) ≤ f w + f (1 - q) := by + let a := q / (1 - w + q) + let b := (1 - w) / (1 - w + q) + have hr : 0 < 1 - w + q := by linarith + have ha : 0 ≤ a := div_nonneg hq0.le hr.le + have hb : 0 ≤ b := div_nonneg (sub_nonneg.mpr hw1) hr.le + have hab : a + b = 1 := by dsimp [a, b]; field_simp; ring + have hab' : b + a = 1 := by linarith + have hp1 : a * 1 + b * (w - q) = w := by dsimp [a, b]; field_simp; ring + have hp2 : b * 1 + a * (w - q) = 1 - q := by dsimp [a, b]; field_simp; ring + have h1 := hf.2 (show (1 : ℝ) ∈ Ioi 0 by norm_num) + (show w - q ∈ Ioi 0 from sub_pos.mpr hqw) ha hb hab + have h2 := hf.2 (show (1 : ℝ) ∈ Ioi 0 by norm_num) + (show w - q ∈ Ioi 0 from sub_pos.mpr hqw) hb ha hab' + simp only [smul_eq_mul, hp1, hp2] at h1 h2 + calc + f 1 + f (w - q) = (a * f 1 + b * f (w - q)) + + (b * f 1 + a * f (w - q)) := by + calc + _ = (a + b) * f 1 + (a + b) * f (w - q) := by rw [hab]; ring + _ = _ := by ring + _ ≤ f w + f (1 - q) := add_le_add h1 h2 + +theorem perspective_kernel_upper (f : ℝ → ℝ) (x w q : ℝ) + (hx : 0 < x) (hq0 : 0 < q) (hqw : q < w) (hw1 : w ≤ 1) + (hf0 : ∀ t, 0 < t → 0 ≤ f t) + (hconc : ConcaveOn ℝ (Ioi 0) + (fun v => v * f (x / v) - (2 / 3 : ℝ) * v * Real.log v)) : + f x - (1 - q) * f (x / (1 - q)) - w * f (x / w) ≤ + (2 / 3 : ℝ) * ((w - q) * Real.log (w - q) - + (1 - q) * Real.log (1 - q) - w * Real.log w) := by + have he := concave_perspective_exchange _ hconc w q hq0 hqw hw1 + have hn : 0 ≤ (w - q) * f (x / (w - q)) := + mul_nonneg (sub_nonneg.mpr hqw.le) (hf0 _ (div_pos hx (sub_pos.mpr hqw))) + simp only [one_mul, div_one, Real.log_one, mul_zero, sub_zero] at he + nlinarith + +theorem lt_weight_of_le_weight_sq {w q : ℝ} + (hw0 : 0 < w) (hw1 : w ≤ 1) (hq1 : q < 1) (hqw : q ≤ w ^ 2) : q < w := by + rcases eq_or_lt_of_le hw1 with rfl | hwlt + · simpa using hq1 + · have hsq : w ^ 2 < w := by nlinarith [mul_pos hw0 (sub_pos.mpr hwlt)] + exact hqw.trans_lt hsq + +theorem lambda_trapezoid_bound (w q : ℝ) + (hw0 : 0 < w) (hw1 : w ≤ 1) (hq0 : 0 ≤ q) (hq1 : q < 1) + (hqw : q ≤ w ^ 2) : + (1 - w) / 3 * (logBarrier (q / w) + logBarrier q) ≤ + q * (1 / w - 1) * lambda (q ^ 2) := by + have hlt := lt_weight_of_le_weight_sq hw0 hw1 hq1 hqw + have hqdiv0 : 0 ≤ q / w := div_nonneg hq0 hw0.le + have hqdiv1 : q / w < 1 := (div_lt_one hw0).mpr hlt + have hs0 := Real.sqrt_nonneg q + have hs2 := Real.sq_sqrt hq0 + have hs1 : Real.sqrt q < 1 := by nlinarith + have hsw : Real.sqrt q ≤ w := by nlinarith + have hdivsqrt : q / w ≤ Real.sqrt q := by + apply (div_le_iff₀ hw0).mpr + nlinarith [mul_nonneg hs0 (sub_nonneg.mpr hsw)] + have hl1 := monotoneOn_lambda ⟨hqdiv0, hqdiv1⟩ ⟨hs0, hs1⟩ hdivsqrt + have hl2 : w * lambda q ≤ lambda q := by + nlinarith [mul_nonneg (sub_nonneg.mpr hw1) (lambda_nonneg hq0 hq1)] + have hls := lambda_sqrt_add_le q hq0 hq1 + have hsum : lambda (q / w) + w * lambda q ≤ 3 * lambda (q ^ 2) := by linarith + have hcoef : 0 ≤ q * (1 - w) / (3 * w) := + div_nonneg (mul_nonneg hq0 (sub_nonneg.mpr hw1)) (mul_nonneg (by norm_num) hw0.le) + have hm := mul_le_mul_of_nonneg_left hsum hcoef + have hM (z : ℝ) : logBarrier z = z * lambda z := (mul_lambda z).symm + rw [hM, hM] + convert hm using 1 <;> field_simp + +theorem perspective_inequality_of_adjusted_concave (f : ℝ → ℝ) (x w q : ℝ) + (hx : 0 < x) (hw0 : 0 < w) (hw1 : w ≤ 1) (hq0 : 0 ≤ q) (hq1 : q < 1) + (hqw : q ≤ w ^ 2) (hf0 : ∀ t, 0 < t → 0 ≤ f t) + (hconc : ConcaveOn ℝ (Ioi 0) + (fun v => v * f (x / v) - (2 / 3 : ℝ) * v * Real.log v)) : + f x - (1 - q) * f (x / (1 - q)) - w * f (x / w) ≤ + q * (1 / w - 1) * lambda (q ^ 2) := by + rcases eq_or_lt_of_le hq0 with hq | hq + · subst q + have hn := mul_nonneg hw0.le (hf0 _ (div_pos hx hw0)) + simpa using neg_nonpos.mpr hn + have hlt := lt_weight_of_le_weight_sq hw0 hw1 hq1 hqw + have hk := perspective_kernel_upper f x w q hx hq hlt hw1 hf0 hconc + have ht := perspective_log_trapezoid q w hq0 hlt hw1 + have hl := lambda_trapezoid_bound w q hw0 hw1 hq0 hq1 hqw + have hc : (2 / 3 : ℝ) * ((w - q) * Real.log (w - q) - + (1 - q) * Real.log (1 - q) - w * Real.log w) ≤ + (1 - w) / 3 * (logBarrier (q / w) + logBarrier q) := by + unfold logBarrier + nlinarith + exact hk.trans (hc.trans hl) + +theorem LSecondDeriv_curvature_bound {x : ℝ} (hx : 0 < x) : + x ^ 2 * LSecondDeriv x ≤ 2 / 3 := by + by_cases hxl : x < ell + · simpa only [LSecondDeriv, ite_eq_left hxl] using L_curvature_bound ⟨hx, hxl⟩ + · simp only [LSecondDeriv, ite_eq_right hxl, mul_zero] + norm_num + +theorem concaveOn_L_logCorrectedPerspective (x : ℝ) (hx : 0 < x) : + ConcaveOn ℝ (Ioi 0) + (fun v => v * L (x / v) - (2 / 3 : ℝ) * v * Real.log v) := by + exact concaveOn_logCorrectedPerspective L LDeriv LSecondDeriv x (2 / 3) ell + hx ell_pos (fun y hy => hasDerivAt_L hy) continuousOn_LDeriv + (fun y hy hne => hasDerivAt_LDeriv hy hne) + (fun y hy _ => LSecondDeriv_curvature_bound hy) + +theorem perspective_inequality (x w q : ℝ) + (hx : 0 < x) (hw0 : 0 < w) (hw1 : w ≤ 1) (hq0 : 0 ≤ q) (hq1 : q < 1) + (hqw : q ≤ w ^ 2) : + L x - (1 - q) * L (x / (1 - q)) - w * L (x / w) ≤ + q * (1 / w - 1) * lambda (q ^ 2) := + perspective_inequality_of_adjusted_concave L x w q hx hw0 hw1 hq0 hq1 hqw + (fun _ ht => L_nonneg ht) (concaveOn_L_logCorrectedPerspective x hx) + +end LeanBlast.CourtadeKumar + +end + +end OAI diff --git a/lean/OAI/InformationTheory/BooleanNoise/PerspectiveJensen.lean b/lean/OAI/InformationTheory/BooleanNoise/PerspectiveJensen.lean new file mode 100644 index 0000000000000000000000000000000000000000..262d6e853240217d0d7dacbdaf1ca127d72fc91a --- /dev/null +++ b/lean/OAI/InformationTheory/BooleanNoise/PerspectiveJensen.lean @@ -0,0 +1,55 @@ +import OAI.InformationTheory.BooleanNoise.Basic +import Mathlib.Analysis.Convex.Jensen +import Mathlib.Tactic + +namespace OAI + +noncomputable section + +open scoped BigOperators Topology +open Set Filter + +universe u + +namespace LeanBlast.CourtadeKumar + +theorem weighted_perspective_jensen {ι : Type u} [Fintype ι] + (f : ℝ → ℝ) (hf : ConvexOn ℝ (Ioi 0) f) + (p A H : ι → ℝ) (hp : ∀ i, 0 ≤ p i) (hA : ∀ i, 0 < A i) + (hH : ∀ i, 0 < H i) (hS : 0 < ∑ i, p i * A i) : + (∑ i, p i * A i) * f ((∑ i, p i * H i) / (∑ i, p i * A i)) ≤ + ∑ i, p i * A i * f (H i / A i) := by + have hj := hf.map_centerMass_le + (t := Finset.univ) (w := fun i => p i * A i) (p := fun i => H i / A i) + (fun i _ => mul_nonneg (hp i) (hA i).le) hS (fun i _ => div_pos (hH i) (hA i)) + have heq : (∑ i, p i * A i * (H i / A i)) = ∑ i, p i * H i := by + apply Finset.sum_congr rfl + intro i _ + field_simp [(hA i).ne'] + simp only [Finset.centerMass, smul_eq_mul, Function.comp_apply] at hj + rw [heq] at hj + have hm := mul_le_mul_of_nonneg_left hj hS.le + simp only [← mul_assoc, mul_inv_cancel₀ hS.ne', one_mul] at hm + simpa [← div_eq_inv_mul, mul_assoc] using hm + +theorem cubeAverage_perspective_jensen {n : ℕ} + (f : ℝ → ℝ) (hf : ConvexOn ℝ (Ioi 0) f) + (A H : Cube n → ℝ) (hA : ∀ i, 0 < A i) (hH : ∀ i, 0 < H i) : + cubeAverage A * f (cubeAverage H / cubeAverage A) ≤ + cubeAverage (fun i => A i * f (H i / A i)) := by + have hc : 0 < (2 : ℝ) ^ n := pow_pos (by norm_num) n + have hs : 0 < ∑ i, ((2 : ℝ) ^ n)⁻¹ * A i := + Finset.sum_pos (fun i _ => mul_pos (inv_pos.mpr hc) (hA i)) Finset.univ_nonempty + have h := weighted_perspective_jensen f hf (fun _ => ((2 : ℝ) ^ n)⁻¹) + A H (fun _ => (inv_pos.mpr hc).le) hA hH hs + have havg (g : Cube n → ℝ) : + (∑ i, ((2 : ℝ) ^ n)⁻¹ * g i) = cubeAverage g := by + rw [← Finset.mul_sum, cubeAverage, div_eq_mul_inv] + ring + simpa only [mul_assoc, havg] using h + +end LeanBlast.CourtadeKumar + +end + +end OAI diff --git a/lean/OAI/InformationTheory/BooleanNoise/PerspectiveLogTrapezoid.lean b/lean/OAI/InformationTheory/BooleanNoise/PerspectiveLogTrapezoid.lean new file mode 100644 index 0000000000000000000000000000000000000000..d43ff6afd6c4054ccf42b83f78456a9873508aa0 --- /dev/null +++ b/lean/OAI/InformationTheory/BooleanNoise/PerspectiveLogTrapezoid.lean @@ -0,0 +1,97 @@ +import Mathlib.Analysis.SpecialFunctions.Log.Deriv +import Mathlib.Analysis.Calculus.Deriv.MeanValue +import Mathlib.Tactic.FieldSimp +import Mathlib.Tactic.Linarith +import Mathlib.Tactic.Ring + +namespace OAI + +noncomputable section + +namespace LeanBlast.CourtadeKumar + +private def trapezoidGap (q w : ℝ) : ℝ := + (1 + w - 2 * q) * (Real.log (1 - q) - Real.log (w - q)) + + (1 + w) * Real.log w + +private def trapezoidGapDeriv (q w : ℝ) : ℝ := + Real.log (1 - q) - Real.log (w - q) - (1 + w - 2 * q) / (w - q) + + Real.log w + (1 + w) / w + +private theorem hasDerivAt_trapezoidGap (q w : ℝ) (hw0 : 0 < w) (hqw : q < w) : + HasDerivAt (trapezoidGap q) (trapezoidGapDeriv q w) w := by + have ha := ((hasDerivAt_id w).const_add (1 : ℝ)).sub_const (2 * q) + have hb := HasDerivAt.const_sub (Real.log (1 - q)) + (((hasDerivAt_id w).sub_const q).log (ne_of_gt (sub_pos.mpr hqw))) + have hc := ((hasDerivAt_id w).const_add (1 : ℝ)).mul + (Real.hasDerivAt_log (ne_of_gt hw0)) + convert! (ha.mul hb).add hc using 1 + dsimp [trapezoidGap, trapezoidGapDeriv] + ring + +private theorem trapezoidGapDeriv_nonpos (q w : ℝ) + (hq0 : 0 ≤ q) (hqw : q < w) (hw1 : w ≤ 1) : trapezoidGapDeriv q w ≤ 0 := by + have hw0 : 0 < w := lt_of_le_of_lt hq0 hqw + have hd : 0 < w - q := sub_pos.mpr hqw + have hq1 : q < 1 := lt_of_lt_of_le hqw hw1 + have h1q : 0 < 1 - q := sub_pos.mpr hq1 + let r : ℝ := (1 - q) * w / (w - q) + have hr : 0 < r := div_pos (mul_pos h1q hw0) hd + have hlog := Real.log_le_sub_one_of_pos hr + have hlogeq : Real.log r = Real.log (1 - q) + Real.log w - Real.log (w - q) := by + dsimp [r] + rw [Real.log_div (ne_of_gt (mul_pos h1q hw0)) (ne_of_gt hd), + Real.log_mul (ne_of_gt h1q) (ne_of_gt hw0)] + rw [hlogeq] at hlog + have hrem : r - 1 + (1 + w) / w - (1 + w - 2 * q) / (w - q) = + -q * (1 - w) ^ 2 / (w * (w - q)) := by + dsimp [r] + field_simp [ne_of_gt hw0, ne_of_gt hd] + ring + have hrest : r - 1 + (1 + w) / w - (1 + w - 2 * q) / (w - q) ≤ 0 := by + rw [hrem] + exact div_nonpos_of_nonpos_of_nonneg + (mul_nonpos_of_nonpos_of_nonneg (neg_nonpos.mpr hq0) (sq_nonneg _)) + (mul_nonneg hw0.le hd.le) + unfold trapezoidGapDeriv + linarith + +private theorem trapezoidGap_nonneg (q w : ℝ) + (hq0 : 0 ≤ q) (hqw : q < w) (hw1 : w ≤ 1) : 0 ≤ trapezoidGap q w := by + have hw0 : 0 < w := lt_of_le_of_lt hq0 hqw + have hd (v : ℝ) (hv : v ∈ Set.Icc w 1) : + HasDerivAt (trapezoidGap q) (trapezoidGapDeriv q v) v := + hasDerivAt_trapezoidGap q v (lt_of_lt_of_le hw0 hv.1) (lt_of_lt_of_le hqw hv.1) + have hanti : AntitoneOn (trapezoidGap q) (Set.Icc w 1) := by + apply antitoneOn_of_deriv_nonpos (convex_Icc w 1) + · intro v hv + exact (hd v hv).continuousAt.continuousWithinAt + · intro v hv + exact (hd v (interior_subset hv)).differentiableAt.differentiableWithinAt + · intro v hv + have hvm : v ∈ Set.Icc w 1 := interior_subset hv + rw [(hd v hvm).deriv] + exact trapezoidGapDeriv_nonpos q v hq0 (lt_of_lt_of_le hqw hvm.1) hvm.2 + have h := hanti ⟨le_refl w, hw1⟩ ⟨hw1, le_refl 1⟩ hw1 + simpa [trapezoidGap] using h + +theorem perspective_log_trapezoid (q w : ℝ) + (hq0 : 0 ≤ q) (hqw : q < w) (hw1 : w ≤ 1) : + 2 * ((w - q) * Real.log (w - q) - (1 - q) * Real.log (1 - q) - + w * Real.log w) ≤ + (1 - w) * (-Real.log (1 - q / w) - Real.log (1 - q)) := by + have hw0 : 0 < w := lt_of_le_of_lt hq0 hqw + have hd : 0 < w - q := sub_pos.mpr hqw + have hlog : Real.log (1 - q / w) = Real.log (w - q) - Real.log w := by + rw [show 1 - q / w = (w - q) / w by field_simp] + exact Real.log_div (ne_of_gt hd) (ne_of_gt hw0) + have hgap := trapezoidGap_nonneg q w hq0 hqw hw1 + rw [hlog] + unfold trapezoidGap at hgap + nlinarith only [hgap] + +end LeanBlast.CourtadeKumar + +end + +end OAI diff --git a/lean/OAI/InformationTheory/BooleanNoise/Rearrangement.lean b/lean/OAI/InformationTheory/BooleanNoise/Rearrangement.lean new file mode 100644 index 0000000000000000000000000000000000000000..874398d01cc5d0a392c0e37cff5e58739db6c4f6 --- /dev/null +++ b/lean/OAI/InformationTheory/BooleanNoise/Rearrangement.lean @@ -0,0 +1,429 @@ +import OAI.InformationTheory.BooleanNoise.FiniteNoise +import OAI.InformationTheory.BooleanNoise.EntropyScalars +import Mathlib.Tactic + +namespace OAI + +noncomputable section + +open scoped BigOperators + +namespace LeanBlast.CourtadeKumar + +variable {n : ℕ} + +def setBit (i : Fin n) (b : Bool) (x : Cube n) : Cube n := Function.update x i b + +@[simp] theorem setBit_apply_same (i : Fin n) (b : Bool) (x : Cube n) : + setBit i b x i = b := Function.update_self _ _ _ + +@[simp] theorem setBit_self (i : Fin n) (x : Cube n) : setBit i (x i) x = x := + Function.update_eq_self _ _ + +@[simp] theorem setBit_setBit (i : Fin n) (a b : Bool) (x : Cube n) : + setBit i b (setBit i a x) = setBit i b x := Function.update_idem _ _ _ + +theorem setBit_comm {i j : Fin n} (hij : i ≠ j) (a b : Bool) (x : Cube n) : + setBit j b (setBit i a x) = setBit i a (setBit j b x) := + by + change Function.update (Function.update x i a) j b = + Function.update (Function.update x j b) i a + exact Function.update_comm hij a b x + +def IsIncreasingIn (i : Fin n) (F : Cube n → ℝ) : Prop := + ∀ x, F (setBit i false x) ≤ F (setBit i true x) + +def sortCoordinate (i : Fin n) (F : Cube n → ℝ) (x : Cube n) : ℝ := + if x i then max (F (setBit i false x)) (F (setBit i true x)) + else min (F (setBit i false x)) (F (setBit i true x)) + +@[simp] theorem sortCoordinate_false (i : Fin n) (F : Cube n → ℝ) (x : Cube n) : + sortCoordinate i F (setBit i false x) = + min (F (setBit i false x)) (F (setBit i true x)) := by + simp [sortCoordinate] + +@[simp] theorem sortCoordinate_true (i : Fin n) (F : Cube n → ℝ) (x : Cube n) : + sortCoordinate i F (setBit i true x) = + max (F (setBit i false x)) (F (setBit i true x)) := by + simp [sortCoordinate] + +theorem sortCoordinate_signValued (i : Fin n) {F : Cube n → ℝ} + (hF : IsSignValued F) : IsSignValued (sortCoordinate i F) := by + intro x + rcases hF (setBit i false x) with h0 | h0 <;> + rcases hF (setBit i true x) with h1 | h1 <;> + cases hx : x i <;> simp [sortCoordinate, hx, h0, h1] + +theorem sortCoordinate_increasingIn (i : Fin n) (F : Cube n → ℝ) : + IsIncreasingIn i (sortCoordinate i F) := by + intro x + simp only [sortCoordinate_false, sortCoordinate_true] + exact min_le_max + +theorem sortCoordinate_preserves_increasingIn (i j : Fin n) {F : Cube n → ℝ} + (hF : IsIncreasingIn j F) : IsIncreasingIn j (sortCoordinate i F) := by + by_cases hij : i = j + · subst j + exact sortCoordinate_increasingIn i F + · intro x + have h0 := hF (setBit i false x) + have h1 := hF (setBit i true x) + simp only [sortCoordinate, setBit, Function.update_of_ne hij, + Function.update_comm (Ne.symm hij)] + cases hx : x i <;> simp only [Bool.false_eq_true, ↓reduceIte] + · exact min_le_min h0 h1 + · exact max_le_max h0 h1 + +theorem increasingIn_setBit_mono {F : Cube n → ℝ} {i : Fin n} + (hF : IsIncreasingIn i F) (x : Cube n) (a b : Bool) (hab : a ≤ b) : + F (setBit i a x) ≤ F (setBit i b x) := by + cases a <;> cases b + · exact le_rfl + · exact hF x + · exact False.elim ((by decide : ¬ ((true : Bool) ≤ false)) hab) + · exact le_rfl + +theorem isIncreasing_of_forall_increasingIn {F : Cube n → ℝ} + (hF : ∀ i, IsIncreasingIn i F) : IsIncreasing F := by + intro x y hxy + let fill (s : Finset (Fin n)) : Cube n := fun i => if i ∈ s then y i else x i + have hfill : ∀ s : Finset (Fin n), F x ≤ F (fill s) := by + intro s + induction s using Finset.induction_on with + | empty => simp [fill] + | @insert i s hi ih => + have hstep : F (fill s) ≤ F (setBit i (y i) (fill s)) := by + have horder : fill s i ≤ y i := by simp [fill, hi, hxy i] + simpa only [setBit_self] using + increasingIn_setBit_mono (hF i) (fill s) (fill s i) (y i) horder + have heq : setBit i (y i) (fill s) = fill (insert i s) := by + funext j + by_cases hji : j = i + · subst j; simp [fill] + · simp [setBit, fill, hji] + exact ih.trans (heq ▸ hstep) + simpa [fill] using hfill Finset.univ + +theorem isIncreasing_increasingIn {F : Cube n → ℝ} (hF : IsIncreasing F) + (i : Fin n) : IsIncreasingIn i F := by + intro x + apply hF + intro j + by_cases hji : j = i + · subst j; simp + · simp [setBit, Function.update_of_ne hji] + +theorem pair_sum_setBit (i : Fin n) (F : Cube n → ℝ) (x : Cube n) : + F (setBit i false x) + F (setBit i true x) = F x + F (flip i x) := by + have hself := setBit_self i x + cases hx : x i + · simpa [setBit, flip, LeanBlast.GotsmanLinial.flip, hx] using + congrArg (fun z => F z + F (setBit i true x)) hself + · simpa [setBit, flip, LeanBlast.GotsmanLinial.flip, hx, add_comm] using + congrArg (fun z => F (setBit i false x) + F z) hself + +theorem sum_comp_flip (i : Fin n) (F : Cube n → ℝ) : + (∑ x, F (flip i x)) = ∑ x, F x := by + exact Fintype.sum_bijective (flip i) (LeanBlast.GotsmanLinial.flip_bijective i) _ _ + (fun _ => rfl) + +theorem sum_setBit_pair (i : Fin n) (F : Cube n → ℝ) : + (∑ x, (F (setBit i false x) + F (setBit i true x))) = 2 * ∑ x, F x := by + simp_rw [pair_sum_setBit] + rw [Finset.sum_add_distrib, sum_comp_flip] + ring + +theorem cubeAverage_sortCoordinate (i : Fin n) (F : Cube n → ℝ) : + cubeAverage (sortCoordinate i F) = cubeAverage F := by + have h : (∑ x, (sortCoordinate i F (setBit i false x) + + sortCoordinate i F (setBit i true x))) = + ∑ x, (F (setBit i false x) + F (setBit i true x)) := by + simp only [sortCoordinate_false, sortCoordinate_true, min_add_max] + rw [sum_setBit_pair, sum_setBit_pair] at h + have hs : (∑ x, sortCoordinate i F x) = ∑ x, F x := by linarith + exact congrArg (fun z : ℝ => z / (2 : ℝ) ^ n) hs + +def coordinatePairMean (i : Fin n) (F : Cube n → ℝ) (x : Cube n) : ℝ := + (F (setBit i false x) + F (setBit i true x)) / 2 + +def coordinatePairDifference (i : Fin n) (F : Cube n → ℝ) (x : Cube n) : ℝ := + (F (setBit i true x) - F (setBit i false x)) / 2 + +def coordinateOffKernel (i : Fin n) (u : ℝ) (x y : Cube n) : ℝ := + ∏ j ∈ Finset.univ.erase i, + if x j = y j then (1 + u) / 2 else (1 - u) / 2 + +def coordinateOffNoise (i : Fin n) (u : ℝ) (F : Cube n → ℝ) (x : Cube n) : ℝ := + ∑ y, coordinateOffKernel i u x y / 2 * F y + +theorem coordinateOffKernel_setBit_left (i : Fin n) (u : ℝ) (x y : Cube n) (b : Bool) : + coordinateOffKernel i u (setBit i b x) y = coordinateOffKernel i u x y := by + apply Finset.prod_congr rfl + intro j hj + simp only [setBit, Function.update_of_ne (Finset.mem_erase.mp hj).1] + +theorem coordinateOffKernel_setBit_right (i : Fin n) (u : ℝ) (x y : Cube n) (b : Bool) : + coordinateOffKernel i u x (setBit i b y) = coordinateOffKernel i u x y := by + apply Finset.prod_congr rfl + intro j hj + simp only [setBit, Function.update_of_ne (Finset.mem_erase.mp hj).1] + +theorem noiseKernel_setBit_pair (i : Fin n) (u : ℝ) (x y : Cube n) (a b : Bool) : + noiseKernel u (setBit i a x) (setBit i b y) = + (if a = b then (1 + u) / 2 else (1 - u) / 2) * coordinateOffKernel i u x y := by + rw [noiseKernel_split_coord _ _ _ i] + simp only [setBit_apply_same] + change (if a = b then _ else _) * + coordinateOffKernel i u (setBit i a x) (setBit i b y) = _ + rw [coordinateOffKernel_setBit_left, coordinateOffKernel_setBit_right] + +theorem coordinateOffKernel_nonneg (i : Fin n) {u : ℝ} (hu : u ∈ Set.Icc 0 1) + (x y : Cube n) : 0 ≤ coordinateOffKernel i u x y := by + apply Finset.prod_nonneg + intro j _ + split_ifs <;> linarith [hu.1, hu.2] + +theorem coordinateOffNoise_add (i : Fin n) (u : ℝ) (F G : Cube n → ℝ) (x : Cube n) : + coordinateOffNoise i u (fun y => F y + G y) x = + coordinateOffNoise i u F x + coordinateOffNoise i u G x := by + simp only [coordinateOffNoise, mul_add, Finset.sum_add_distrib] + +theorem coordinateOffNoise_smul (i : Fin n) (u c : ℝ) (F : Cube n → ℝ) (x : Cube n) : + coordinateOffNoise i u (fun y => c * F y) x = c * coordinateOffNoise i u F x := by + simp only [coordinateOffNoise, Finset.mul_sum, mul_left_comm] + +theorem coordinateOffNoise_mono (i : Fin n) {u : ℝ} (hu : u ∈ Set.Icc 0 1) + {F G : Cube n → ℝ} (hFG : ∀ y, F y ≤ G y) (x : Cube n) : + coordinateOffNoise i u F x ≤ coordinateOffNoise i u G x := by + exact Finset.sum_le_sum fun y _ => mul_le_mul_of_nonneg_left (hFG y) + (div_nonneg (coordinateOffKernel_nonneg i hu x y) (by norm_num)) + +theorem coordinateOffNoise_nonneg (i : Fin n) {u : ℝ} (hu : u ∈ Set.Icc 0 1) + {F : Cube n → ℝ} (hF : ∀ y, 0 ≤ F y) (x : Cube n) : + 0 ≤ coordinateOffNoise i u F x := by + exact Finset.sum_nonneg fun y _ => + mul_nonneg (div_nonneg (coordinateOffKernel_nonneg i hu x y) (by norm_num)) (hF y) + +theorem coordinateOffNoise_abs_bound (i : Fin n) {u : ℝ} (hu : u ∈ Set.Icc 0 1) + (F : Cube n → ℝ) (x : Cube n) : + -coordinateOffNoise i u (fun y => |F y|) x ≤ coordinateOffNoise i u F x ∧ + coordinateOffNoise i u F x ≤ coordinateOffNoise i u (fun y => |F y|) x := by + constructor + · have h := coordinateOffNoise_mono i hu (fun y => neg_abs_le (F y)) x + have heq : coordinateOffNoise i u (fun y => -|F y|) x = + -coordinateOffNoise i u (fun y => |F y|) x := by + simp [coordinateOffNoise] + rw [heq] at h + exact h + · exact coordinateOffNoise_mono i hu (fun y => le_abs_self (F y)) x + +theorem noiseOperator_setBit (i : Fin n) (u : ℝ) (F : Cube n → ℝ) + (x : Cube n) (b : Bool) : + noiseOperator u F (setBit i b x) = + coordinateOffNoise i u (coordinatePairMean i F) x + + (if b then u else -u) * coordinateOffNoise i u (coordinatePairDifference i F) x := by + have h := sum_setBit_pair i (fun y => noiseKernel u (setBit i b x) y * F y) + change _ = 2 * noiseOperator u F (setBit i b x) at h + have heq : (∑ y, (noiseKernel u (setBit i b x) (setBit i false y) * F (setBit i false y) + + noiseKernel u (setBit i b x) (setBit i true y) * F (setBit i true y))) = + 2 * coordinateOffNoise i u (fun y => coordinatePairMean i F y + + (if b then u else -u) * coordinatePairDifference i F y) x := by + rw [coordinateOffNoise, Finset.mul_sum] + apply Finset.sum_congr rfl + intro y _ + rw [noiseKernel_setBit_pair, noiseKernel_setBit_pair] + cases b <;> simp only [Bool.false_eq_true, Bool.true_eq_false, ↓reduceIte, + coordinatePairMean, coordinatePairDifference] <;> ring + rw [heq, coordinateOffNoise_add, coordinateOffNoise_smul] at h + linarith + +@[simp] theorem coordinatePairMean_sortCoordinate (i : Fin n) (F : Cube n → ℝ) : + coordinatePairMean i (sortCoordinate i F) = coordinatePairMean i F := by + funext x + simp only [coordinatePairMean, sortCoordinate_false, sortCoordinate_true, min_add_max] + +@[simp] theorem coordinatePairDifference_sortCoordinate (i : Fin n) (F : Cube n → ℝ) : + coordinatePairDifference i (sortCoordinate i F) = + fun x => |coordinatePairDifference i F x| := by + funext x + simp only [coordinatePairDifference, sortCoordinate_false, sortCoordinate_true] + rcases le_total (F (setBit i false x)) (F (setBit i true x)) with h | h + · rw [min_eq_left h, max_eq_right h, abs_of_nonneg (div_nonneg (sub_nonneg.mpr h) (by norm_num))] + · rw [min_eq_right h, max_eq_left h, abs_of_nonpos (div_nonpos_of_nonpos_of_nonneg + (sub_nonpos.mpr h) (by norm_num))] + ring + +theorem isIncreasing_noiseOperator {u : ℝ} (hu : u ∈ Set.Icc 0 1) + {F : Cube n → ℝ} (hF : IsIncreasing F) : IsIncreasing (noiseOperator u F) := by + apply isIncreasing_of_forall_increasingIn + intro i x + rw [noiseOperator_setBit, noiseOperator_setBit] + simp only [Bool.false_eq_true, ↓reduceIte] + have hb : 0 ≤ coordinateOffNoise i u (coordinatePairDifference i F) x := by + apply coordinateOffNoise_nonneg i hu + intro y + exact div_nonneg (sub_nonneg.mpr (isIncreasing_increasingIn hF i y)) (by norm_num) + nlinarith [mul_nonneg hu.1 hb] + +theorem psi_symmetric_pair_mono (a b c : ℝ) (hc : 0 ≤ c) + (hb : -c ≤ b ∧ b ≤ c) + (hminus : a - c ∈ Set.Icc (-1 : ℝ) 1) + (hplus : a + c ∈ Set.Icc (-1 : ℝ) 1) : + psi (a + b) + psi (a - b) ≤ psi (a + c) + psi (a - c) := by + by_cases hcz : c = 0 + · have hbz : b = 0 := by rcases hb with ⟨hl, hu⟩; simp only [hcz, neg_zero] at hl hu; linarith + simp [hcz, hbz] + · have hcp : 0 < c := lt_of_le_of_ne hc (Ne.symm hcz) + let t : ℝ := (c + b) / (2 * c) + let s : ℝ := (c - b) / (2 * c) + have ht : 0 ≤ t := div_nonneg (by linarith [hb.1]) (by positivity) + have hs : 0 ≤ s := div_nonneg (by linarith [hb.2]) (by positivity) + have hts : t + s = 1 := by dsimp [t, s]; field_simp; ring + have hst : s + t = 1 := by linarith + have hr1 : t * (a + c) + s * (a - c) = a + b := by + dsimp [t, s]; field_simp; ring + have hr2 : s * (a + c) + t * (a - c) = a - b := by + dsimp [t, s]; field_simp; ring + have h1 := convexOn_psi.2 hplus hminus ht hs hts + have h2 := convexOn_psi.2 hplus hminus hs ht hst + simp only [smul_eq_mul, hr1] at h1 + simp only [smul_eq_mul, hr2] at h2 + calc + psi (a + b) + psi (a - b) ≤ + (t * psi (a + c) + s * psi (a - c)) + + (s * psi (a + c) + t * psi (a - c)) := add_le_add h1 h2 + _ = (t + s) * (psi (a + c) + psi (a - c)) := by ring + _ = psi (a + c) + psi (a - c) := by rw [hts, one_mul] + +private theorem rearrangement_sign_bounds {F : Cube n → ℝ} (hF : IsSignValued F) : + ∀ y, -1 ≤ F y ∧ F y ≤ 1 := by + intro y + rcases hF y with h | h <;> rw [h] <;> norm_num + +theorem psi_noise_sortCoordinate_pair (i : Fin n) {u : ℝ} + (hu : u ∈ Set.Icc 0 1) {F : Cube n → ℝ} (hF : IsSignValued F) (x : Cube n) : + psi (noiseOperator u F (setBit i false x)) + + psi (noiseOperator u F (setBit i true x)) ≤ + psi (noiseOperator u (sortCoordinate i F) (setBit i false x)) + + psi (noiseOperator u (sortCoordinate i F) (setBit i true x)) := by + let A := coordinateOffNoise i u (coordinatePairMean i F) x + let B := u * coordinateOffNoise i u (coordinatePairDifference i F) x + let C := u * coordinateOffNoise i u (fun y => |coordinatePairDifference i F y|) x + have hc : 0 ≤ C := mul_nonneg hu.1 + (coordinateOffNoise_nonneg i hu (fun y => abs_nonneg _) x) + have hbound := coordinateOffNoise_abs_bound i hu (coordinatePairDifference i F) x + have hb : -C ≤ B ∧ B ≤ C := by + dsimp only [B, C] + constructor + · have h := mul_le_mul_of_nonneg_left hbound.1 hu.1 + nlinarith + · exact mul_le_mul_of_nonneg_left hbound.2 hu.1 + have hfminus : noiseOperator u F (setBit i false x) = A - B := by + rw [noiseOperator_setBit] + dsimp [A, B] + ring + have hfplus : noiseOperator u F (setBit i true x) = A + B := by + rw [noiseOperator_setBit] + rfl + have hsminus : noiseOperator u (sortCoordinate i F) (setBit i false x) = A - C := by + rw [noiseOperator_setBit, coordinatePairMean_sortCoordinate, coordinatePairDifference_sortCoordinate] + dsimp [A, C] + ring + have hsplus : noiseOperator u (sortCoordinate i F) (setBit i true x) = A + C := by + rw [noiseOperator_setBit, coordinatePairMean_sortCoordinate, coordinatePairDifference_sortCoordinate] + rfl + have hsort := rearrangement_sign_bounds (sortCoordinate_signValued i hF) + have hminus : A - C ∈ Set.Icc (-1 : ℝ) 1 := by + rw [← hsminus] + exact noiseOperator_bounds hu.1 hu.2 hsort _ + have hplus : A + C ∈ Set.Icc (-1 : ℝ) 1 := by + rw [← hsplus] + exact noiseOperator_bounds hu.1 hu.2 hsort _ + rw [hfminus, hfplus, hsminus, hsplus] + simpa only [add_comm] using psi_symmetric_pair_mono A B C hc hb hminus hplus + +theorem cubeAverage_psi_noise_sortCoordinate (i : Fin n) {u : ℝ} + (hu : u ∈ Set.Icc 0 1) {F : Cube n → ℝ} (hF : IsSignValued F) : + cubeAverage (fun x => psi (noiseOperator u F x)) ≤ + cubeAverage (fun x => psi (noiseOperator u (sortCoordinate i F) x)) := by + have h := Finset.sum_le_sum (fun x (_ : x ∈ (Finset.univ : Finset (Cube n))) => + psi_noise_sortCoordinate_pair i hu hF x) + rw [sum_setBit_pair i (fun x => psi (noiseOperator u F x)), + sum_setBit_pair i (fun x => psi (noiseOperator u (sortCoordinate i F) x))] at h + have hs : (∑ x, psi (noiseOperator u F x)) ≤ + ∑ x, psi (noiseOperator u (sortCoordinate i F) x) := by linarith + exact div_le_div_of_nonneg_right hs (cube_denominator_pos n).le + +theorem informationDeficit_eq_psi_difference (F : Cube n → ℝ) : + informationDeficit F = cubeAverage (fun x => psi (F x)) - psi (cubeAverage F) := by + unfold informationDeficit entropyAverage entropy + rw [cubeAverage_sub, cubeAverage_const] + ring + +theorem informationDeficit_noise_sortCoordinate (i : Fin n) {u : ℝ} + (hu : u ∈ Set.Icc 0 1) {F : Cube n → ℝ} (hF : IsSignValued F) : + informationDeficit (noiseOperator u F) ≤ + informationDeficit (noiseOperator u (sortCoordinate i F)) := by + rw [informationDeficit_eq_psi_difference, informationDeficit_eq_psi_difference, + cubeAverage_noiseOperator, cubeAverage_noiseOperator, cubeAverage_sortCoordinate] + exact sub_le_sub_right (cubeAverage_psi_noise_sortCoordinate i hu hF) _ + +def sortCoordinates : List (Fin n) → (Cube n → ℝ) → Cube n → ℝ + | [], F => F + | i :: is, F => sortCoordinates is (sortCoordinate i F) + +theorem sortCoordinates_signValued (is : List (Fin n)) {F : Cube n → ℝ} + (hF : IsSignValued F) : IsSignValued (sortCoordinates is F) := by + induction is generalizing F with + | nil => exact hF + | cons i is ih => exact ih (sortCoordinate_signValued i hF) + +theorem cubeAverage_sortCoordinates (is : List (Fin n)) (F : Cube n → ℝ) : + cubeAverage (sortCoordinates is F) = cubeAverage F := by + induction is generalizing F with + | nil => rfl + | cons i is ih => rw [sortCoordinates, ih, cubeAverage_sortCoordinate] + +theorem sortCoordinates_increasingIn (is : List (Fin n)) {F : Cube n → ℝ} + (j : Fin n) (hj : j ∈ is ∨ IsIncreasingIn j F) : + IsIncreasingIn j (sortCoordinates is F) := by + induction is generalizing F with + | nil => exact hj.resolve_left (by simp) + | cons i is ih => + apply ih + rcases hj with hmem | hinc + · rcases List.mem_cons.mp hmem with hji | hmem + · subst j + exact Or.inr (sortCoordinate_increasingIn i F) + · exact Or.inl hmem + · exact Or.inr (sortCoordinate_preserves_increasingIn i j hinc) + +theorem informationDeficit_noise_sortCoordinates (is : List (Fin n)) {u : ℝ} + (hu : u ∈ Set.Icc 0 1) {F : Cube n → ℝ} (hF : IsSignValued F) : + informationDeficit (noiseOperator u F) ≤ + informationDeficit (noiseOperator u (sortCoordinates is F)) := by + induction is generalizing F with + | nil => exact le_rfl + | cons i is ih => + exact (informationDeficit_noise_sortCoordinate i hu hF).trans + (ih (sortCoordinate_signValued i hF)) + +theorem exists_increasing_informationDeficit_ge (u : ℝ) (hu : u ∈ Set.Icc 0 1) + (F : Cube n → ℝ) (hF : IsSignValued F) : + ∃ G : Cube n → ℝ, IsSignValued G ∧ IsIncreasing G ∧ + cubeAverage G = cubeAverage F ∧ + informationDeficit (noiseOperator u F) ≤ informationDeficit (noiseOperator u G) := by + classical + let is : List (Fin n) := Finset.univ.toList + refine ⟨sortCoordinates is F, sortCoordinates_signValued is hF, ?_, + cubeAverage_sortCoordinates is F, informationDeficit_noise_sortCoordinates is hu hF⟩ + apply isIncreasing_of_forall_increasingIn + intro j + apply sortCoordinates_increasingIn is j + exact Or.inl (by simp [is]) + +end LeanBlast.CourtadeKumar + +end + +end OAI diff --git a/lean/OAI/InformationTheory/BooleanNoise/SemigroupFlow.lean b/lean/OAI/InformationTheory/BooleanNoise/SemigroupFlow.lean new file mode 100644 index 0000000000000000000000000000000000000000..58af854642f249be1152cdd019c089ded61d45b6 --- /dev/null +++ b/lean/OAI/InformationTheory/BooleanNoise/SemigroupFlow.lean @@ -0,0 +1,188 @@ +import OAI.InformationTheory.BooleanNoise.Rearrangement +import Mathlib.Analysis.SpecialFunctions.ExpDeriv +import Mathlib.Analysis.Calculus.Deriv.Mul +import Mathlib.Tactic + +namespace OAI + +noncomputable section + +open scoped BigOperators Topology +open Filter + +namespace LeanBlast.CourtadeKumar + +variable {n : ℕ} + +def noiseFlow (F : Cube n → ℝ) (t : ℝ) : Cube n → ℝ := + noiseOperator (Real.exp (-t)) F + +private theorem noiseKernel_flip_derivative_term (u : ℝ) + (x y : Cube n) (i : Fin n) : + (∏ j ∈ Finset.univ.erase i, + if x j = y j then (1 + u) / 2 else (1 - u) / 2) * + (if x i = y i then -u / 2 else u / 2) = + -((noiseKernel u x y - noiseKernel u (flip i x) y) / 2) := by + have hrest : (∏ j ∈ Finset.univ.erase i, + if (flip i x) j = y j then (1 + u) / 2 else (1 - u) / 2) = + ∏ j ∈ Finset.univ.erase i, + if x j = y j then (1 + u) / 2 else (1 - u) / 2 := by + apply Finset.prod_congr rfl + intro j hj + have hji := (Finset.mem_erase.mp hj).1 + simp only [flip, LeanBlast.GotsmanLinial.flip, Function.update_of_ne hji] + rw [noiseKernel_split_coord u x y i, noiseKernel_split_coord u (flip i x) y i, hrest] + cases hx : x i <;> cases hy : y i <;> + simp [flip, LeanBlast.GotsmanLinial.flip, hx] <;> ring + +private theorem hasDerivAt_noise_factor (x y : Cube n) (i : Fin n) (t : ℝ) : + HasDerivAt (fun s : ℝ => + if x i = y i then (1 + Real.exp (-s)) / 2 else (1 - Real.exp (-s)) / 2) + (if x i = y i then -Real.exp (-t) / 2 else Real.exp (-t) / 2) t := by + have hu : HasDerivAt (fun s : ℝ => Real.exp (-s)) (-Real.exp (-t)) t := by + simpa using (hasDerivAt_id t).neg.exp + by_cases hxy : x i = y i + · simp only [ite_eq_left hxy] + exact (hu.const_add 1).div_const 2 + · simp only [ite_eq_right hxy] + simpa using (hu.const_sub 1).div_const 2 + +theorem hasDerivAt_noiseKernel_flow (x y : Cube n) (t : ℝ) : + HasDerivAt (fun s : ℝ => noiseKernel (Real.exp (-s)) x y) + (-(∑ i : Fin n, + (noiseKernel (Real.exp (-t)) x y - + noiseKernel (Real.exp (-t)) (flip i x) y) / 2)) t := by + have h := HasDerivAt.fun_finsetProd + (fun i (_ : i ∈ (Finset.univ : Finset (Fin n))) => hasDerivAt_noise_factor x y i t) + convert! h using 1 + simp only [smul_eq_mul, noiseKernel_flip_derivative_term, Finset.sum_neg_distrib] + +theorem cubeDerivative_noiseOperator (u : ℝ) (F : Cube n → ℝ) + (i : Fin n) (x : Cube n) : + cubeDerivative i (noiseOperator u F) x = + ∑ y, ((noiseKernel u x y - noiseKernel u (flip i x) y) / 2) * F y := by + simp [cubeDerivative, noiseOperator, sub_div, sub_mul, + div_mul_eq_mul_div, Finset.sum_sub_distrib, Finset.sum_div] + +theorem hasDerivAt_noiseFlow (F : Cube n → ℝ) (t : ℝ) (x : Cube n) : + HasDerivAt (fun s : ℝ => noiseFlow F s x) + (-(∑ i : Fin n, cubeDerivative i (noiseFlow F t) x)) t := by + have h := HasDerivAt.fun_sum + (fun y (_ : y ∈ (Finset.univ : Finset (Cube n))) => + (hasDerivAt_noiseKernel_flow x y t).mul_const (F y)) + convert! h using 1 + simp only [noiseFlow, cubeDerivative_noiseOperator, neg_mul, + Finset.sum_mul, Finset.sum_neg_distrib] + congr 1 + exact Finset.sum_comm + +theorem continuous_noiseFlow (F : Cube n → ℝ) (x : Cube n) : + Continuous (fun t : ℝ => noiseFlow F t x) := by + exact continuous_iff_continuousAt.mpr fun t => (hasDerivAt_noiseFlow F t x).continuousAt + +@[simp] +theorem noiseFlow_zero (F : Cube n → ℝ) : noiseFlow F 0 = F := by + funext x + simp [noiseFlow] + +theorem cubeAverage_noiseFlow (F : Cube n → ℝ) (t : ℝ) : + cubeAverage (noiseFlow F t) = cubeAverage F := + cubeAverage_noiseOperator _ _ + +theorem meanVariance_noiseFlow (F : Cube n → ℝ) (t : ℝ) : + meanVariance (noiseFlow F t) = meanVariance F := by + simp only [meanVariance, cubeAverage_noiseFlow] + +theorem isInterior_noiseFlow (F : Cube n → ℝ) (hF : IsSignValued F) + (hnc : ∃ x y, F x ≠ F y) {t : ℝ} (ht : 0 < t) : + IsInterior (noiseFlow F t) := by + apply noiseOperator_isInterior (Real.exp_pos _).le _ hF hnc + rw [Real.exp_lt_one_iff] + linarith + +theorem isIncreasing_noiseFlow (F : Cube n → ℝ) (hF : IsIncreasing F) + {t : ℝ} (ht : 0 ≤ t) : IsIncreasing (noiseFlow F t) := by + apply isIncreasing_noiseOperator ⟨(Real.exp_pos _).le, ?_⟩ hF + rw [Real.exp_le_one_iff] + linarith + +theorem hasDerivAt_entropyAverage_noiseFlow_of_isInterior + (F : Cube n → ℝ) (t : ℝ) (hinterior : IsInterior (noiseFlow F t)) : + HasDerivAt (fun s : ℝ => entropyAverage (noiseFlow F s)) + (dissipation (noiseFlow F t)) t := by + have h := (HasDerivAt.fun_sum + (fun x (_ : x ∈ (Finset.univ : Finset (Cube n))) => + (hasDerivAt_entropy (hinterior x)).comp t (hasDerivAt_noiseFlow F t x))).div_const + ((2 : ℝ) ^ n) + convert! h using 1 + simp only [dissipation, cubeAverage, neg_mul_neg, Finset.mul_sum, Finset.sum_div] + exact Finset.sum_comm + +theorem hasDerivAt_entropyAverage_noiseFlow + (F : Cube n → ℝ) (hF : IsSignValued F) (hnc : ∃ x y, F x ≠ F y) + {t : ℝ} (ht : 0 < t) : + HasDerivAt (fun s : ℝ => entropyAverage (noiseFlow F s)) + (dissipation (noiseFlow F t)) t := + hasDerivAt_entropyAverage_noiseFlow_of_isInterior F t (isInterior_noiseFlow F hF hnc ht) + +theorem hasDerivAt_informationDeficit_noiseFlow_of_isInterior + (F : Cube n → ℝ) (t : ℝ) (hinterior : IsInterior (noiseFlow F t)) : + HasDerivAt (fun s : ℝ => informationDeficit (noiseFlow F s)) + (-dissipation (noiseFlow F t)) t := by + simpa only [informationDeficit, cubeAverage_noiseFlow] using + (hasDerivAt_entropyAverage_noiseFlow_of_isInterior F t hinterior).const_sub + (entropy (cubeAverage F)) + +theorem hasDerivAt_informationDeficit_noiseFlow + (F : Cube n → ℝ) (hF : IsSignValued F) (hnc : ∃ x y, F x ≠ F y) + {t : ℝ} (ht : 0 < t) : + HasDerivAt (fun s : ℝ => informationDeficit (noiseFlow F s)) + (-dissipation (noiseFlow F t)) t := + hasDerivAt_informationDeficit_noiseFlow_of_isInterior F t (isInterior_noiseFlow F hF hnc ht) + +theorem continuous_entropyAverage_noiseFlow (F : Cube n → ℝ) : + Continuous (fun t : ℝ => entropyAverage (noiseFlow F t)) := by + apply Continuous.div_const + exact continuous_finsetSum _ fun x _ => continuous_entropy.comp (continuous_noiseFlow F x) + +theorem continuous_informationDeficit_noiseFlow (F : Cube n → ℝ) : + Continuous (fun t : ℝ => informationDeficit (noiseFlow F t)) := by + simp only [informationDeficit, cubeAverage_noiseFlow] + exact continuous_const.sub (continuous_entropyAverage_noiseFlow F) + +theorem entropyAverage_eq_zero_of_signValued (F : Cube n → ℝ) (hF : IsSignValued F) : + entropyAverage F = 0 := by + have hzero : ∀ x, entropy (F x) = 0 := by + intro x + rcases hF x with h | h <;> rw [h] <;> simp + simp only [entropyAverage, cubeAverage, hzero, Finset.sum_const_zero, zero_div] + +theorem tendsto_entropyAverage_noiseFlow_zero + (F : Cube n → ℝ) (hF : IsSignValued F) : + Tendsto (fun t : ℝ => entropyAverage (noiseFlow F t)) (𝓝 0) (𝓝 0) := by + simpa only [noiseFlow_zero, entropyAverage_eq_zero_of_signValued F hF] using + (continuous_entropyAverage_noiseFlow F).continuousAt.tendsto (x := 0) + +theorem tendsto_entropyAverage_noiseFlow_zero_right + (F : Cube n → ℝ) (hF : IsSignValued F) : + Tendsto (fun t : ℝ => entropyAverage (noiseFlow F t)) (𝓝[>] 0) (𝓝 0) := + (tendsto_entropyAverage_noiseFlow_zero F hF).mono_left nhdsWithin_le_nhds + +theorem entropyAverage_noiseFlow_pos + (F : Cube n → ℝ) (hF : IsSignValued F) (hnc : ∃ x y, F x ≠ F y) + {t : ℝ} (ht : 0 < t) : 0 < entropyAverage (noiseFlow F t) := by + apply div_pos _ (cube_denominator_pos n) + exact Finset.sum_pos + (fun x _ => entropy_pos (isInterior_noiseFlow F hF hnc ht x)) Finset.univ_nonempty + +theorem meanVariance_noiseFlow_pos + (F : Cube n → ℝ) (hF : IsSignValued F) (hnc : ∃ x y, F x ≠ F y) (t : ℝ) : + 0 < meanVariance (noiseFlow F t) := by + rw [meanVariance_noiseFlow] + exact meanVariance_pos_of_signValued_nonconstant hF hnc + +end LeanBlast.CourtadeKumar + +end + +end OAI diff --git a/lean/OAI/InformationTheory/BooleanNoise/SmallCurvatureAux.lean b/lean/OAI/InformationTheory/BooleanNoise/SmallCurvatureAux.lean new file mode 100644 index 0000000000000000000000000000000000000000..d5c130c1d61e02e06e4e81194bd173e5a97cc4c1 --- /dev/null +++ b/lean/OAI/InformationTheory/BooleanNoise/SmallCurvatureAux.lean @@ -0,0 +1,44 @@ +import OAI.InformationTheory.BooleanNoise.EntropySeries + +namespace OAI + +namespace LeanBlast.CourtadeKumar + +theorem artanh_le_cubic_tail {u : ℝ} (hu : u ∈ Set.Ico 0 1) : + Real.artanh u ≤ u + u ^ 3 / (3 * (1 - u ^ 2)) := by + have hu0 : 0 ≤ u := hu.1 + have hu1 : u < 1 := hu.2 + have huabs : |u| < 1 := by rwa [abs_of_nonneg hu0] + have hu2 : u ^ 2 < 1 := by nlinarith [sq_nonneg (u - 1)] + have hseries := hasSum_artanh huabs + have htail : HasSum + (fun k : ℕ => u ^ (2 * (k + 1) + 1) / (2 * ((k + 1 : ℕ) : ℝ) + 1)) + (Real.artanh u - u) := by + simpa using (hasSum_nat_add_iff' 1).mpr hseries + have hgeom := (hasSum_geometric_of_lt_one (sq_nonneg u) hu2).mul_left (u ^ 3 / 3) + have hle : Real.artanh u - u ≤ (u ^ 3 / 3) * (1 - u ^ 2)⁻¹ := by + apply hasSum_le _ htail hgeom + intro k + have hpow : u ^ (2 * (k + 1) + 1) = u ^ 3 * (u ^ 2) ^ k := by + rw [show 2 * (k + 1) + 1 = 3 + 2 * k by omega, pow_add, pow_mul] + rw [hpow] + calc + _ ≤ (u ^ 3 * (u ^ 2) ^ k) / 3 := by + apply div_le_div_of_nonneg_left (by positivity) (by norm_num) + push_cast + linarith [Nat.cast_nonneg (α := ℝ) k] + _ = _ := by ring + calc + Real.artanh u = u + (Real.artanh u - u) := by ring + _ ≤ u + (u ^ 3 / 3) * (1 - u ^ 2)⁻¹ := by linarith + _ = _ := by simp only [div_eq_mul_inv, mul_inv_rev]; ring + +theorem cubic_le_artanh {u : ℝ} (hu : u ∈ Set.Ico 0 1) : + u + u ^ 3 / 3 ≤ Real.artanh u := by + have h := sum_range_artanh_le hu.1 hu.2 2 + norm_num [Finset.sum_range_succ] at h + exact h + +end LeanBlast.CourtadeKumar + +end OAI diff --git a/lean/OAI/InformationTheory/BooleanNoise/Statement.lean b/lean/OAI/InformationTheory/BooleanNoise/Statement.lean new file mode 100644 index 0000000000000000000000000000000000000000..2c15a36839cd9f26837fcfe55301999518df2a69 --- /dev/null +++ b/lean/OAI/InformationTheory/BooleanNoise/Statement.lean @@ -0,0 +1,24 @@ +import OAI.InformationTheory.BooleanNoise.Basic +import Mathlib.Analysis.SpecialFunctions.BinaryEntropy + +namespace OAI + +noncomputable section + +open scoped BigOperators + +namespace LeanBlast.CourtadeKumar + +@[simp] theorem xlogx_zero : xlogx 0 = 0 := by simp [xlogx] + +@[simp] theorem binaryEntropy_zero : binaryEntropy 0 = 0 := by + simp [binaryEntropy, xlogx] + +@[simp] theorem binaryEntropy_one : binaryEntropy 1 = 0 := by + simp [binaryEntropy, xlogx] + +end LeanBlast.CourtadeKumar + +end + +end OAI diff --git a/lean/OAI/InformationTheory/DimensionTen/ChoiTransfer.lean b/lean/OAI/InformationTheory/DimensionTen/ChoiTransfer.lean new file mode 100644 index 0000000000000000000000000000000000000000..b394cf5a4bfda22de35a385c0ef9a426d8d32708 --- /dev/null +++ b/lean/OAI/InformationTheory/DimensionTen/ChoiTransfer.lean @@ -0,0 +1,113 @@ +import OAI.Analysis.Quantum.DimensionTen.Main +import OAI.InformationTheory.SecretKey.Main + +namespace OAI + +/-! Transpose-adjoint transfer for the explicit dimension-ten maps. -/ + +noncomputable section +open Matrix MeasureTheory Filter +open scoped ComplexOrder Kronecker ENNReal + +namespace DimensionTen +universe u + +lemma operational_matrixUnit {a : ℕ} (i j : Fin a) : + ZeroKey.matrixUnit i j = Matrix.single i j (1 : ℂ) := by + ext u v + simp [ZeroKey.matrixUnit, Matrix.single_apply, ite_and, eq_comm] + +def phiOneSharp : Mat 10 →ₗ[ℂ] Mat 10 := + asLinearMap (krausMap (fun p => (phiOneKraus p)ᵀ)) (krausMap_linear _) + +def phiTwoLinear : Mat 10 →ₗ[ℂ] Mat 10 := asLinearMap phiTwo phiTwo_ppt.1 + +lemma phiOneSharp_single (x y i j : Fin 10) : + phiOneSharp (Matrix.single x y 1) i j = phiOne (Matrix.single i j 1) x y := by + change krausMap (fun p : Fin 6 × Fin 6 => (phiOneKraus p)ᵀ) + (Matrix.single x y 1) i j = _ + rw [phiOne_kraus, krausMap_single, krausMap_single] + rfl + +lemma phiOneSharp_apply (A : Mat 10) (i j : Fin 10) : + phiOneSharp A i j = + ∑ x, ∑ y, A x y * phiOne (Matrix.single i j 1) x y := by + conv_lhs => rw [matrix_expansion A] + simp only [map_sum, map_smul, Matrix.sum_apply, Matrix.smul_apply, + smul_eq_mul, phiOneSharp_single] + +lemma phiOneSharp_input_transpose (A : Mat 10) : phiOneSharp Aᵀ = phiOneSharp A := by + ext i j + simp only [phiOneSharp_apply, Matrix.transpose_apply] + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro x hx + apply Finset.sum_congr rfl + intro y hy + have he := congrArg (fun B : Mat 10 => B x y) (phiOne_output_transpose (Matrix.single i j 1)) + change phiOne (Matrix.single i j 1) y x = phiOne (Matrix.single i j 1) x y at he + rw [he] + +lemma hsAdjoint_input_transpose {a b : ℕ} (F : Mat a → Mat b) + (h : ∀ A, (F A)ᵀ = F A) (Y : Mat b) : + hsAdjoint F Yᵀ = hsAdjoint F Y := by + ext i j + simp only [hsAdjoint, Matrix.transpose_apply] + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro u hu + apply Finset.sum_congr rfl + intro v hv + have he := congrArg (fun B : Mat b => B u v) (h (Matrix.single i j 1)) + change F (Matrix.single i j 1) v u = F (Matrix.single i j 1) u v at he + rw [he] + +lemma phiTwo_input_transpose (A : Mat 10) : phiTwo Aᵀ = phiTwo A := by + unfold phiTwo + rw [← real_compression_transpose _ firstSix_real, + hsAdjoint_input_transpose _ complementaryMap_output_transpose] + +lemma phiOneSharp_pptType : ZeroKey.PPTType phiOneSharp := by + have hcp : ZeroKey.CompletelyPositive phiOneSharp := + ZeroKey.cp_of_kraus_representation phiOneSharp (fun p => (phiOneKraus p)ᵀ) + (fun _ => rfl) + refine ⟨hcp, ?_⟩ + have he : phiOneSharp.comp (ZeroKey.transposeLinear 10) = phiOneSharp := by + ext A i j + exact congrArg (fun B : Mat 10 => B i j) (phiOneSharp_input_transpose A) + rw [he] + exact hcp + +lemma phiTwo_pptType : ZeroKey.PPTType phiTwoLinear := by + have hcp : ZeroKey.CompletelyPositive phiTwoLinear := by + apply ZeroKey.cp_of_kraus_representation phiTwoLinear phiTwoKraus + intro A + change phiTwo A = _ + rw [phiTwo_kraus] + rfl + refine ⟨hcp, ?_⟩ + have he : phiTwoLinear.comp (ZeroKey.transposeLinear 10) = phiTwoLinear := by + ext A i j + exact congrArg (fun B : Mat 10 => B i j) (phiTwo_input_transpose A) + rw [he] + exact hcp + +lemma compositeChoi_transfer : + ZeroKey.tensorMap phiOneSharp phiTwoLinear (ZeroKey.outer (omega 10) (omega 10)) = + compositeChoi := by + ext ⟨i,u⟩ ⟨j,v⟩ + simp only [ZeroKey.tensorMap, ZeroKey.outer, omega, operational_matrixUnit, + phiOneSharp_single] + simp only [apply_ite star, star_one, star_zero, ite_mul, one_mul, zero_mul] + simp only [Finset.sum_ite_irrel, Finset.sum_const_zero, + Finset.sum_ite_eq, Finset.mem_univ, ite_true] + change (∑ x, ∑ y, phiOne (Matrix.single i j 1) x y * phiTwo (Matrix.single x y 1) u v) = + phiTwo (phiOne (Matrix.single i j 1)) u v + conv_rhs => rw [linear_expansion phiTwo phiTwo_ppt.1] + simp only [Matrix.sum_apply, Matrix.smul_apply, smul_eq_mul] + +end DimensionTen + +end + +end OAI diff --git a/lean/OAI/InformationTheory/DimensionTen/FiniteReadout.lean b/lean/OAI/InformationTheory/DimensionTen/FiniteReadout.lean new file mode 100644 index 0000000000000000000000000000000000000000..4dec388682d0a3bd4ed4a613ae1b883169404cc9 --- /dev/null +++ b/lean/OAI/InformationTheory/DimensionTen/FiniteReadout.lean @@ -0,0 +1,103 @@ +import OAI.InformationTheory.SecretKey.Main + +namespace OAI + +/-! Key rates for protocols with finite total terminal readouts. -/ + +noncomputable section +open Matrix MeasureTheory Filter +open scoped ComplexOrder Kronecker ENNReal + +namespace DimensionTen +universe u + +structure AdmittedKeyTrial {a b : ℕ} [Nonempty (Fin a)] [Nonempty (Fin b)] + (R : Matrix (Fin a × Fin b) (Fin a × Fin b) ℂ) (hR : ZeroKey.Density R) + (ell : ℕ) where + messages : ZeroKey.ClassicalRecordSpace.{u} + implementation : ZeroKey.KeyImplementation a b ell messages + eveDim : ℕ + purification : Matrix (Fin a × Fin b) (Fin eveDim) ℂ + prepares : purification * purificationᴴ = R + referenceMeasure : Measure (ℕ → messages) + sigmaFinite : SigmaFinite referenceMeasure + dominates : implementation.discussion.transcriptLaw ≪ referenceMeasure + ideal : ZeroKey.EveDensity referenceMeasure (Fin eveDim) +attribute [instance] AdmittedKeyTrial.sigmaFinite + +namespace AdmittedKeyTrial +variable {a b ell : ℕ} [Nonempty (Fin a)] [Nonempty (Fin b)] + {R : Matrix (Fin a × Fin b) (Fin a × Fin b) ℂ} {hR : ZeroKey.Density R} + (p : AdmittedKeyTrial.{u} R hR ell) + +def actual : ZeroKey.KeyDensity p.referenceMeasure (ZeroKey.KeyWord ell) (Fin p.eveDim) := + p.implementation.output R hR p.purification p.prepares p.referenceMeasure p.dominates + +def error : ℝ := p.actual.idealError p.ideal + +def toCompleted : ZeroKey.CompletedKeyTrial.{u} R hR ell where + messages := p.messages + eveDim := p.eveDim + purification := p.purification + prepares := p.prepares + referenceMeasure := p.referenceMeasure + sigmaFinite := p.sigmaFinite + actual := p.actual + completed := ZeroKey.IsCompletedKeyOutput.of_implementation p.implementation p.dominates + ideal := p.ideal + +lemma toCompleted_error : p.toCompleted.error = p.error := rfl +end AdmittedKeyTrial + +structure AdmittedKeyScheme {a b : ℕ} [Nonempty (Fin a)] [Nonempty (Fin b)] + (R : Matrix (Fin a × Fin b) (Fin a × Fin b) ℂ) (hR : ZeroKey.Density R) where + length : ℕ → ℕ + trial : (k : ℕ) → AdmittedKeyTrial.{u} (ZeroKey.positiveCopies R k) + (hR.positiveCopies k) (length k) + +namespace AdmittedKeyScheme +variable {a b : ℕ} [Nonempty (Fin a)] [Nonempty (Fin b)] + {R : Matrix (Fin a × Fin b) (Fin a × Fin b) ℂ} {hR : ZeroKey.Density R} + (s : AdmittedKeyScheme.{u} R hR) + +def Secure : Prop := Tendsto (fun k => (s.trial k).error) atTop (nhds 0) + +def lowerRate : ℝ≥0∞ := + liminf (fun k : ℕ => (s.length k : ℝ≥0∞) / (k+1 : ℕ)) atTop + +def toCompleted : ZeroKey.CompletedKeyScheme.{u} R hR where + length := s.length + trial k := (s.trial k).toCompleted + +lemma toCompleted_secure (hs : s.Secure) : s.toCompleted.Secure := hs + +lemma toCompleted_lowerRate : s.toCompleted.lowerRate = s.lowerRate := rfl +end AdmittedKeyScheme + +def distillableSecretKey {a b : ℕ} [Nonempty (Fin a)] [Nonempty (Fin b)] + (R : Matrix (Fin a × Fin b) (Fin a × Fin b) ℂ) (hR : ZeroKey.Density R) : ℝ≥0∞ := + sSup {r | r = 0 ∨ ∃ s : AdmittedKeyScheme.{u} R hR, s.Secure ∧ r = s.lowerRate} + +lemma distillableSecretKey_le_completed {a b : ℕ} [Nonempty (Fin a)] [Nonempty (Fin b)] + (R : Matrix (Fin a × Fin b) (Fin a × Fin b) ℂ) (hR : ZeroKey.Density R) : + distillableSecretKey.{u} R hR ≤ ZeroKey.distillableSecretKey.{u} R hR := by + apply sSup_le + intro r hr + apply le_sSup + rcases hr with hz | ⟨s,hs,hr⟩ + · exact Or.inl hz + · exact Or.inr ⟨s.toCompleted,s.toCompleted_secure hs,hr⟩ + +lemma distillableSecretKey_zero_of_inClass {a b : ℕ} + [Nonempty (Fin a)] [Nonempty (Fin b)] + (R : Matrix (Fin a × Fin b) (Fin a × Fin b) ℂ) (hR : ZeroKey.Density R) + (hc : ZeroKey.InClass R) : distillableSecretKey.{u} R hR = 0 := by + apply le_antisymm _ bot_le + exact (distillableSecretKey_le_completed R hR).trans + (le_of_eq (ZeroKey.class_distillableSecretKey_zero R hR hc)) + +end DimensionTen + +end + +end OAI diff --git a/lean/OAI/InformationTheory/DimensionTen/StateDensity.lean b/lean/OAI/InformationTheory/DimensionTen/StateDensity.lean new file mode 100644 index 0000000000000000000000000000000000000000..72feb258ae76317d29924ae88b8aa2e923dc41f5 --- /dev/null +++ b/lean/OAI/InformationTheory/DimensionTen/StateDensity.lean @@ -0,0 +1,70 @@ +import OAI.Analysis.Quantum.DimensionTen.Main +import OAI.InformationTheory.SecretKey.Main + +namespace OAI + +/-! Normalization and product-free range of the dimension-ten Choi state. -/ + +noncomputable section +open Matrix MeasureTheory Filter +open scoped ComplexOrder Kronecker ENNReal + +namespace DimensionTen +universe u + +lemma compositeChoi_trace_ne : trace compositeChoi ≠ 0 := + fun h => compositeChoi_ne (compositeChoi_posSemidef.trace_eq_zero_iff.mp h) + +lemma compositeChoi_trace_nonneg : 0 ≤ trace compositeChoi := + compositeChoi_posSemidef.trace_nonneg + +lemma compositeChoi_trace_re : ((trace compositeChoi).re : ℂ) = trace compositeChoi := by + have hi := (RCLike.nonneg_iff.mp compositeChoi_trace_nonneg).2 + apply Complex.ext + · rfl + · exact hi.symm + +def rho : Matrix (Fin 10 × Fin 10) (Fin 10 × Fin 10) ℂ := + (trace compositeChoi)⁻¹ • compositeChoi + +lemma rho_density : ZeroKey.Density rho := by + constructor + · exact compositeChoi_posSemidef.smul (inv_nonneg.mpr compositeChoi_trace_nonneg) + · rw [rho, Matrix.trace_smul, smul_eq_mul, + inv_mul_cancel₀ compositeChoi_trace_ne] + +lemma rho_productfree (u v : Fin 10 → ℂ) (w : Fin 10 × Fin 10 → ℂ) + (h : rho *ᵥ w = productVector u v) : u = 0 ∨ v = 0 := by + apply compositeChoi_productfree u v ((trace compositeChoi)⁻¹ • w) + simpa only [rho, Matrix.smul_mulVec, Matrix.mulVec_smul] using h + +lemma operational_separable {a b : ℕ} + (Z : Matrix (Fin a × Fin b) (Fin a × Fin b) ℂ) + (h : ZeroKey.Separable Z) : separable Z := by + obtain ⟨r,A,B,hA,hB,he⟩ := h + exact ⟨r,A,B,fun i => ⟨hA i,hB i⟩,he⟩ + +lemma rho_entangled : ¬ ZeroKey.Separable rho := by + intro h + have hz := h.smul compositeChoi_trace_nonneg + rw [rho, smul_smul, mul_inv_cancel₀ compositeChoi_trace_ne, one_smul] at hz + exact compositeChoi_not_separable (operational_separable _ hz) + +lemma rho_range_contains_no_nonzero_product : + ∀ u v : Fin 10 → ℂ, + productVector u v ∈ Set.range (fun w => rho *ᵥ w) → productVector u v = 0 := by + intro u v ⟨w,hw⟩ + rcases rho_productfree u v w hw with rfl | rfl <;> + ext i <;> simp [productVector] + +theorem main_state_geometry : + ZeroKey.Density rho ∧ ¬ ZeroKey.Separable rho ∧ + (∀ u v : Fin 10 → ℂ, + productVector u v ∈ Set.range (fun w => rho *ᵥ w) → productVector u v = 0) := by + exact ⟨rho_density, rho_entangled, rho_range_contains_no_nonzero_product⟩ + +end DimensionTen + +end + +end OAI diff --git a/lean/OAI/InformationTheory/DimensionTen/StateKey.lean b/lean/OAI/InformationTheory/DimensionTen/StateKey.lean new file mode 100644 index 0000000000000000000000000000000000000000..f3b41f4d06efdf444803b37c4ad99c98d0318040 --- /dev/null +++ b/lean/OAI/InformationTheory/DimensionTen/StateKey.lean @@ -0,0 +1,103 @@ +import OAI.InformationTheory.DimensionTen.ChoiTransfer +import OAI.InformationTheory.DimensionTen.StateDensity +import OAI.InformationTheory.DimensionTen.FiniteReadout + +namespace OAI + +/-! Dimension-ten key bounds for finite total terminal readouts and their trace-norm closure. -/ + +noncomputable section +open Matrix MeasureTheory Filter +open scoped ComplexOrder Kronecker ENNReal + +namespace DimensionTen +universe u + +lemma rho_inClass : ZeroKey.InClass rho := by + refine ⟨rho_density,10,10,phiOneSharp,phiTwoLinear, + (fun i => ((Real.sqrt (trace compositeChoi).re)⁻¹ : ℝ) * omega 10 i), + phiOneSharp_pptType,phiTwo_pptType,?_⟩ + have hc : ((((Real.sqrt (trace compositeChoi).re)⁻¹ : ℝ) : ℂ) * + (((Real.sqrt (trace compositeChoi).re)⁻¹ : ℝ) : ℂ)) = (trace compositeChoi)⁻¹ := by + have hl : 0 ≤ (trace compositeChoi).re := + (RCLike.nonneg_iff.mp compositeChoi_trace_nonneg).1 + rw [← Complex.ofReal_mul, ← mul_inv, Real.mul_self_sqrt hl, + Complex.ofReal_inv, compositeChoi_trace_re] + have ho : ZeroKey.outer + (fun i => ((Real.sqrt (trace compositeChoi).re)⁻¹ : ℝ) * omega 10 i) + (fun i => ((Real.sqrt (trace compositeChoi).re)⁻¹ : ℝ) * omega 10 i) = + (trace compositeChoi)⁻¹ • ZeroKey.outer (omega 10) (omega 10) := by + ext i j + simp only [ZeroKey.outer, star_mul, Complex.star_def, Complex.conj_ofReal, + Matrix.smul_apply, smul_eq_mul] + rw [← hc] + ring + rw [ho, ZeroKey.tensorMap_smul, compositeChoi_transfer] + rfl + +def SecretBitSeparation {a b : ℕ} [Nonempty (Fin a)] [Nonempty (Fin b)] + (R : Matrix (Fin a × Fin b) (Fin a × Fin b) ℂ) (hR : ZeroKey.Density R) : Prop := + ∀ (n : ℕ), 1 ≤ n → + ∀ (O M : Type u) [MeasurableSpace O] [MeasurableSpace M] + [StandardBorelSpace O] [Nonempty O] [StandardBorelSpace M] [Nonempty M] + (d : ZeroKey.Discussion O M) (A B : ℕ → Type u) + [∀ k, AddCommGroup (A k)] [∀ k, Module ℂ (A k)] [∀ k, One (A k)] [∀ k, LE (A k)] + [∀ k, AddCommGroup (B k)] [∀ k, Module ℂ (B k)] [∀ k, One (B k)] [∀ k, LE (B k)] + (TA TB CA CB : Type u) + [AddCommGroup TA] [Module ℂ TA] [One TA] [LE TA] + [AddCommGroup TB] [Module ℂ TB] [One TB] [LE TB] + [AddCommGroup CA] [Module ℂ CA] [One CA] [LE CA] + [AddCommGroup CB] [Module ℂ CB] [One CB] [LE CB] + (p : ZeroKey.BitProtocol (ι := Fin (ZeroKey.copyDim a (n-1))) + (η := Fin (ZeroKey.copyDim b (n-1))) d A B TA TB CA CB) + (e : ℕ) (P : Matrix + (Fin (ZeroKey.copyDim a (n-1)) × Fin (ZeroKey.copyDim b (n-1))) (Fin e) ℂ) + (hP : P * Pᴴ = ZeroKey.positiveCopies R (n-1)) + (sigma : ZeroKey.PositiveMatrixMeasure (ℕ → M) (Fin e)), + (trace (sigma.value Set.univ)).re = 1 → + (1/5 ≤ p.purifiedSecretBitError (ZeroKey.positiveCopies R (n-1)) + (hR.positiveCopies (n-1)) P hP sigma ∧ + 1/10 ≤ p.purifiedSecretBitError (ZeroKey.positiveCopies R (n-1)) + (hR.positiveCopies (n-1)) P hP sigma / 2) + +def CompletedBitSeparation {a b : ℕ} [Nonempty (Fin a)] [Nonempty (Fin b)] + (R : Matrix (Fin a × Fin b) (Fin a × Fin b) ℂ) (hR : ZeroKey.Density R) : Prop := + ∀ (n : ℕ), 1 ≤ n → + ∀ p : ZeroKey.CompletedKeyTrial.{u} (ZeroKey.positiveCopies R (n-1)) + (hR.positiveCopies (n-1)) 1, + 1/5 ≤ p.error ∧ 1/10 ≤ p.error / 2 + +lemma secretBitSeparation_of_inClass {a b : ℕ} [Nonempty (Fin a)] [Nonempty (Fin b)] + (R : Matrix (Fin a × Fin b) (Fin a × Fin b) ℂ) (hR : ZeroKey.Density R) + (hc : ZeroKey.InClass R) : SecretBitSeparation.{u} R hR := by + intro n hn O M _ _ _ _ _ _ d A B _ _ _ _ _ _ _ _ TA TB CA CB _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ p e P hP sigma hs + have hg := ZeroKey.class_uniformProtocolGap R hR hc (n-1) O M d A B TA TB CA CB p e P hP sigma hs + change 1 / 5 ≤ p.purifiedSecretBitError (ZeroKey.positiveCopies R (n-1)) + (hR.positiveCopies (n-1)) P hP sigma at hg + exact ⟨hg, by linarith⟩ + +lemma completedBitSeparation_of_inClass {a b : ℕ} [Nonempty (Fin a)] [Nonempty (Fin b)] + (R : Matrix (Fin a × Fin b) (Fin a × Fin b) ℂ) (hR : ZeroKey.Density R) + (hc : ZeroKey.InClass R) : CompletedBitSeparation.{u} R hR := by + intro n hn p + have hg := ZeroKey.class_uniformCompletedGap R hR hc (n-1) 1 (by decide) p + exact ⟨hg, by linarith⟩ + +theorem main_state : + ZeroKey.Density rho ∧ + ¬ ZeroKey.Separable rho ∧ + (∀ u v : Fin 10 → ℂ, + productVector u v ∈ Set.range (fun w => rho *ᵥ w) → productVector u v = 0) ∧ + distillableSecretKey.{u} rho rho_density = 0 ∧ + SecretBitSeparation.{u} rho rho_density ∧ + CompletedBitSeparation.{u} rho rho_density := by + exact ⟨rho_density, rho_entangled, rho_range_contains_no_nonzero_product, + distillableSecretKey_zero_of_inClass rho rho_density rho_inClass, + secretBitSeparation_of_inClass rho rho_density rho_inClass, + completedBitSeparation_of_inClass rho rho_density rho_inClass⟩ + +end DimensionTen + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/ActualDefaults.lean b/lean/OAI/InformationTheory/Entanglement/ActualDefaults.lean new file mode 100644 index 0000000000000000000000000000000000000000..698f358858cfc70eba4b16fe6bcfa1cee52224f5 --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/ActualDefaults.lean @@ -0,0 +1,83 @@ +import OAI.InformationTheory.Entanglement.HilbertVectorMeasure +import OAI.InformationTheory.Entanglement.HilbertRecordMap +import OAI.InformationTheory.Entanglement.HilbertCoarsegrain + +namespace OAI + +noncomputable section +open scoped InnerProductSpace ComplexOrder MeasureTheory +open ContinuousLinearMap MeasureTheory Filter +namespace SecretKey +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {ι X Y : Type*} [MeasurableSpace X] [MeasurableSpace Y] +namespace PositiveHilbertMeasure +variable {b : HilbertBasis ι ℂ H} (W : PositiveHilbertMeasure X H b) + +lemma value_eq_zero_of_trace_null {s : Set X} (hs : MeasurableSet s) + (hz : W.traceMeasure s=0) : W.value s=0 := by + have hn : W.traceValue s=0 := by + apply norm_eq_zero.mp + rw [W.traceValue_norm hs,Measure.real,hz,ENNReal.toReal_zero] + rw [← W.traceValue_operator hs,hn] + rfl +lemma coeff_eq_zero_of_trace_null (x y : H) {s : Set X} (hs : MeasurableSet s) + (hz : W.traceMeasure s=0) : W.coeff x y s=0 := by + rw [W.coeff_value x y s hs,W.value_eq_zero_of_trace_null hs hz] + simp + +lemma value_eq_of_ae_set {s t : Set X} (hs : MeasurableSet s) (ht : MeasurableSet t) + (he : s =ᵐ[W.traceMeasure] t) : W.value s=W.value t := by + have hzst : W.traceMeasure (s \ t)=0 := by + apply measure_mono_null (fun x hx => ?_) (ae_iff.mp he) + change ¬ ((x∈s)=(x∈t)) + intro h + exact hx.2 (Eq.mp h hx.1) + have hzts : W.traceMeasure (t \ s)=0 := by + apply measure_mono_null (fun x hx => ?_) (ae_iff.mp he) + change ¬ ((x∈s)=(x∈t)) + intro h + exact hx.2 (Eq.mpr h hx.1) + ext y + apply ext_inner_left ℂ + intro x + rw [← W.coeff_value x y s hs,← W.coeff_value x y t ht] + have h := VectorMeasure.of_sdiff_of_sdiff_eq_zero hs ht + (W.coeff_eq_zero_of_trace_null x y (ht.diff hs) hzts) + rw [W.coeff_eq_zero_of_trace_null x y (hs.diff ht) hzst,zero_add] at h + exact h.symm + +lemma mapRecord_value_congr_ae (f g : X→Y) (hf : Measurable f) (hg : Measurable g) + (he : f =ᵐ[W.traceMeasure] g) (s : Set Y) (hs : MeasurableSet s) : + (W.mapRecord f hf).value s=(W.mapRecord g hg).value s := by + apply W.value_eq_of_ae_set (hf hs) (hg hs) + filter_upwards [he] with z hz + change (f z∈s)=(g z∈s) + rw [hz] +end PositiveHilbertMeasure +local instance : MeasurableSpace (Option (Fin 2)) := ⊤ +local instance : MeasurableSingletonClass (Option (Fin 2)) := ⟨fun _ => trivial⟩ + +theorem actual_completion_removes_defaults + {T : Type*} [MeasurableSpace T] {b : HilbertBasis ι ℂ H} + (W : PositiveHilbertMeasure X H b) + (t : X→T) (ha hb : X→Option (Fin 2)) (a c : X→Fin 2) + (ht : Measurable t) (hha : Measurable ha) (hhb : Measurable hb) + (haM : Measurable a) (hcM : Measurable c) + (hcompleteA : ha =ᵐ[W.traceMeasure] (fun x => some (a x))) + (hcompleteB : hb =ᵐ[W.traceMeasure] (fun x => some (c x))) + (s : Set (T×(Fin 2×Fin 2))) (hs : MeasurableSet s) : + W.value ((fun x => (t x,(abortToZero (ha x),abortToZero (hb x)))) ⁻¹' s)= + W.value ((fun x => (t x,(a x,c x))) ⁻¹' s) := by + have hD : Measurable abortToZero := measurable_of_countable abortToZero + apply W.value_eq_of_ae_set + ((ht.prodMk ((hD.comp hha).prodMk (hD.comp hhb))) hs) + ((ht.prodMk (haM.prodMk hcM)) hs) + filter_upwards [hcompleteA,hcompleteB] with x hA hB + change ((t x,(abortToZero (ha x),abortToZero (hb x)))∈s)=((t x,(a x,c x))∈s) + rw [hA,hB,abortToZero_some,abortToZero_some] + +end SecretKey + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/AdaptivePublic.lean b/lean/OAI/InformationTheory/Entanglement/AdaptivePublic.lean new file mode 100644 index 0000000000000000000000000000000000000000..5f1565cf3fabc17aa488e7a1fa6454ef80c525a1 --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/AdaptivePublic.lean @@ -0,0 +1,101 @@ +import OAI.InformationTheory.Entanglement.TranscriptClassical +import OAI.InformationTheory.Entanglement.CausalPublic + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory Filter +open scoped MeasureTheory ProbabilityTheory +namespace SecretKey +variable {Ω : Type*} {mΩ : MeasurableSpace Ω} [StandardBorelSpace Ω] +variable {X : Type*} [MeasurableSpace X] +variable {μ : Measure Ω} [IsFiniteMeasure μ] +variable {F A B : MeasurableSpace Ω} +variable (hF : F ≤ mΩ) (hA : A ≤ mΩ) (hB : B ≤ mΩ) + +def senderMask (r : Ω → TapeRole) (q : TapeRole) (M : Ω → X) (x₀ : X) : Ω → X := + fun ω => if r ω=q then M ω else x₀ +lemma mask_measurable {G : MeasurableSpace Ω} (r : Ω → TapeRole) + (hr : ∀ q, MeasurableSet[G] {ω | r ω=q}) (M : Ω→X) + (hM : Measurable[G] M) (x₀ : X) (q : TapeRole) : + Measurable[G] (senderMask r q M x₀) := by + exact hM.ite (hr q) measurable_const + +lemma masked_record_information (r : Ω → TapeRole) + (hr : ∀ q, MeasurableSet[F] {ω | r ω=q}) (M : Ω→X) (x₀ : X) : + F ⊔ (inferInstance : MeasurableSpace X).comap M= + ((F ⊔ (inferInstance : MeasurableSpace X).comap (senderMask r .source M x₀)) ⊔ + (inferInstance : MeasurableSpace X).comap (senderMask r .alice M x₀)) ⊔ + (inferInstance : MeasurableSpace X).comap (senderMask r .bob M x₀) := by + let C := (inferInstance : MeasurableSpace X).comap M + let S := (inferInstance : MeasurableSpace X).comap (senderMask r .source M x₀) + let P := (inferInstance : MeasurableSpace X).comap (senderMask r .alice M x₀) + let Q := (inferInstance : MeasurableSpace X).comap (senderMask r .bob M x₀) + change F ⊔ C=((F ⊔ S) ⊔ P) ⊔ Q + have hFC : F≤F ⊔ C := le_sup_left + have hC : Measurable[F ⊔ C] M := measurable_iff_comap_le.mpr le_sup_right + have hmask (q : TapeRole) : (inferInstance : MeasurableSpace X).comap (senderMask r q M x₀)≤F ⊔ C := + (mask_measurable r (fun q => hFC _ (hr q)) M hC x₀ q).comap_le + apply le_antisymm + · apply sup_le + · exact le_sup_of_le_left (le_sup_of_le_left le_sup_left) + · apply Measurable.comap_le + have hFG : F≤((F ⊔ S) ⊔ P) ⊔ Q := le_sup_of_le_left (le_sup_of_le_left le_sup_left) + have hS : Measurable[((F ⊔ S) ⊔ P) ⊔ Q] (senderMask r .source M x₀) := + measurable_iff_comap_le.mpr (le_sup_of_le_left (le_sup_of_le_left le_sup_right)) + have hP : Measurable[((F ⊔ S) ⊔ P) ⊔ Q] (senderMask r .alice M x₀) := + measurable_iff_comap_le.mpr (le_sup_of_le_left le_sup_right) + have hQ : Measurable[((F ⊔ S) ⊔ P) ⊔ Q] (senderMask r .bob M x₀) := + measurable_iff_comap_le.mpr le_sup_right + have he : M=(fun ω => if r ω=.source then senderMask r .source M x₀ ω else + if r ω=.alice then senderMask r .alice M x₀ ω else senderMask r .bob M x₀ ω) := by + funext ω + cases h : r ω <;> simp [senderMask,h] + rw [he] + exact hS.ite (hFG _ (hr .source)) (hP.ite (hFG _ (hr .alice)) hQ) + · exact sup_le (sup_le (sup_le le_sup_left (hmask .source)) (hmask .alice)) (hmask .bob) +include hA hB in + +theorem adaptive_public_step (hind : CondIndep F A B hF μ) + (r : Ω → TapeRole) (hr : ∀ q, MeasurableSet[F] {ω | r ω=q}) + (M : Ω→X) (x₀ : X) + (ha : Measurable[A ⊔ F] (senderMask r .alice M x₀)) + (hb : Measurable[B ⊔ F] (senderMask r .bob M x₀)) + (hs : Measurable[mΩ] (senderMask r .source M x₀)) + (hk : ∀ E, MeasurableSet E → AEStronglyMeasurable[F] + (μ⟦senderMask r .source M x₀ ⁻¹' E | (A ⊔ B) ⊔ F⟧) μ) : + ∃ hD : F ⊔ (inferInstance : MeasurableSpace X).comap M ≤ mΩ, + CondIndep (F ⊔ (inferInstance : MeasurableSpace X).comap M) A B hD μ := by + let S := (inferInstance : MeasurableSpace X).comap (senderMask r .source M x₀) + let P := (inferInstance : MeasurableSpace X).comap (senderMask r .alice M x₀) + let Q := (inferInstance : MeasurableSpace X).comap (senderMask r .bob M x₀) + have hS : S ≤ mΩ := hs.comap_le + have hP : P ≤ mΩ := ha.comap_le.trans (sup_le hA hF) + have hQ : Q ≤ mΩ := hb.comap_le.trans (sup_le hB hF) + have hsource : CondIndep F S (A ⊔ B) hF μ := by + apply CondIndep.symm + apply independent_of_public_conditional_laws hF (sup_le (sup_le hA hB) hF) + le_sup_right le_sup_left hS + intro E hE + obtain ⟨s,hs,hse⟩ := hE + rw [← hse] + exact hk s hs + have hiS : CondIndep (F ⊔ S) A B (sup_le hF hS) μ := by + simpa only [sup_comm S F] using public_source_preserves_independence hF hA hB hind hS hsource + have hiP : CondIndep ((F ⊔ S) ⊔ P) A B (sup_le (sup_le hF hS) hP) μ := by + apply sender_message_preserves_independence (sup_le hF hS) hA hB hiS le_sup_left + exact sup_le le_sup_right (ha.comap_le.trans (sup_le_sup_left le_sup_left A)) + have hiQ : CondIndep (((F ⊔ S) ⊔ P) ⊔ Q) A B + (sup_le (sup_le (sup_le hF hS) hP) hQ) μ := by + apply CondIndep.symm + apply sender_message_preserves_independence (sup_le (sup_le hF hS) hP) hB hA hiP.symm le_sup_left + exact sup_le le_sup_right (hb.comap_le.trans + (sup_le_sup_left (le_sup_of_le_left le_sup_left) B)) + rw [masked_record_information r hr M x₀] + exact ⟨sup_le (sup_le (sup_le hF hS) hP) hQ,hiQ⟩ + +end SecretKey + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/ArbitraryPurificationConsumer.lean b/lean/OAI/InformationTheory/Entanglement/ArbitraryPurificationConsumer.lean new file mode 100644 index 0000000000000000000000000000000000000000..c4271dc2c51e452acd8a999fa8c8290a7d4e24dd --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/ArbitraryPurificationConsumer.lean @@ -0,0 +1,89 @@ +import OAI.InformationTheory.Entanglement.TestedQuantumConsumer +import OAI.InformationTheory.Entanglement.PurificationExpansion + +namespace OAI + +noncomputable section +open scoped BigOperators ENNReal MeasureTheory InnerProductSpace ComplexOrder MatrixOrder Kronecker +open MeasureTheory Matrix ContinuousLinearMap ProbabilityTheory Filter +namespace SecretKey +open ChannelCompletion TensorCriterion +variable {T : Type*} [MeasurableSpace T] +variable {n m : Type} [Fintype n] [Fintype m] [DecidableEq n] [DecidableEq m] + +theorem arbitrary_purification_tested_gap + {Ω : Type*} {mΩ : MeasurableSpace Ω} [StandardBorelSpace Ω] + (ν : Measure Ω) [IsFiniteMeasure ν] (t : Ω→T) (ht : Measurable t) + {A B : MeasurableSpace Ω} (hA : A ≤ mΩ) (hB : B ≤ mΩ) + (hind : CondIndep (MeasurableSpace.comap t inferInstance) A B ht.comap_le ν) + (a : Fin 2→Option (PositiveTestIndex n)→Set Ω) + (q : Fin 2→Option (PositiveTestIndex m)→Set Ω) + (ha : ∀ i r, MeasurableSet[A] (a i r)) (hq : ∀ j s, MeasurableSet[B] (q j s)) + (M : Fin 2→Fin 2→PositiveMatrixMeasure T (n×m)) + (hdom : ∀ i j, (M i j).traceMeasure ≪ (@Measure.map Ω T mΩ _ t ν)) + (hleft : ∀ i r s, MeasurableSet s → + (∑ j, (Matrix.trace ((probePOVM r ⊗ₖ (1 : Mat m))*(M i j).value s)).re)= + ν.real (a i r∩t⁻¹' s)) + (hright : ∀ j g s, MeasurableSet s → + (∑ i, (Matrix.trace (((1 : Mat n) ⊗ₖ probePOVM g)*(M i j).value s)).re)= + ν.real (q j g∩t⁻¹' s)) + (hjoint : ∀ i j r g s, MeasurableSet s → + (Matrix.trace ((probePOVM r ⊗ₖ probePOVM g)*(M i j).value s)).re= + ν.real ((a i r∩q j g)∩t⁻¹' s)) + {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + {ι : Type*} (b : HilbertBasis ι ℂ H) + (R : Mat (n×m)) (hR : Represented R) (i₀ : n×m) + (x : (n×m)→H) (hxGram : ∀ i j, inner ℂ (x i) (x j)=Rᵀ i j) + (W : Fin 2→Fin 2→PositiveHilbertMeasure T H b) + (hW : ∀ i j s, MeasurableSet s → (W i j).value s=hilbertEmbed x ((M i j).value s)) + (hW1 : (∑ i, ∑ j, hilbertTrace b ((W i j).value Set.univ))=1) + (σ : PositiveHilbertMeasure T H b) (hσ1 : σ.traceMeasure Set.univ=1) : + ENNReal.ofReal (1/5) ≤ hilbertCQDistance b W σ := by + obtain ⟨d,v,Z,hv,hx,hg⟩ := purification_orthonormal_expansion x + have hGram : Zᴴ*Z=Rᵀ := by ext i j; rw [hg,hxGram] + have hd : 0 ((M i j).filter Z).hilbertEmbedding b v hv + have hValues i j s (hs : MeasurableSet s) : (W i j).value s=(V i j).value s := by + rw [hW i j s hs] + change hilbertEmbed x ((M i j).value s)= + hilbertEmbed v (((M i j).filter Z).value s) + rw [PositiveMatrixMeasure.filter_value] + rw [← hilbertEmbed_congruence] + congr 1 + funext j + exact (hx j).symm + have hnorm : (∑ i, ∑ j, (Matrix.trace (((M i j).filter Z).value Set.univ)).re)=1 := by + rw [← hW1] + apply Finset.sum_congr rfl; intro i hi + apply Finset.sum_congr rfl; intro j hj + rw [hValues i j Set.univ MeasurableSet.univ] + exact (hilbertEmbed_trace b v hv _).symm + have hgap := independent_tested_quantum_gap ν t ht hA hB hind a q ha hq M hdom + hleft hright hjoint b R hR i₀ v hv j₀ Z hGram hnorm σ hσ1 + have he : hilbertCQDistance b W σ=hilbertCQDistance b V σ := by + unfold hilbertCQDistance + apply Finset.sum_congr rfl; intro i hi + apply Finset.sum_congr rfl; intro j hj + unfold hilbertVariation + apply iSup_congr; intro P + apply iSup_congr; intro hP + apply iSup_congr; intro hpd + apply Finset.sum_congr rfl; intro s hs + exact congrArg (fun D => hilbertENorm b (D-hilbertIdeal σ.value i j s)) + (hValues i j s (hP s hs)) + rw [he] + exact hgap + +end SecretKey + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/BinomialDimension.lean b/lean/OAI/InformationTheory/Entanglement/BinomialDimension.lean new file mode 100644 index 0000000000000000000000000000000000000000..dcbe92df0ba17f17c13425540f918e82f66e6dcf --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/BinomialDimension.lean @@ -0,0 +1,14 @@ +import Mathlib + +namespace OAI + +namespace BinomialDimension +irreducible_def binomialDimension (q : ℕ) : ℕ := Nat.choose q 8 +def Q := (Nat.choose 1027 513)^3 +def L := binomialDimension Q +lemma L_def : L=Nat.choose Q 8 := binomialDimension_def Q +def D := 4^L + +end BinomialDimension + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/BooleanSpan.lean b/lean/OAI/InformationTheory/Entanglement/BooleanSpan.lean new file mode 100644 index 0000000000000000000000000000000000000000..d6f417200fe334d2ff4a2ba529eef5011be588bc --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/BooleanSpan.lean @@ -0,0 +1,92 @@ +import Mathlib + +namespace OAI + +noncomputable section +open scoped BigOperators +namespace FiniteConstruction +variable {α β 𝔽 : Type} [Fintype α] [DecidableEq α] + [Field 𝔽] +variable (B : β → Finset α) + +def monomial (s : Finset α) : β → 𝔽 := fun b => if s ⊆ B b then 1 else 0 + +def smallSets (α : Type) [Fintype α] [DecidableEq α] (d : ℕ) : Finset (Finset α) := + (Finset.range (d+1)).biUnion (fun j => Finset.univ.powersetCard j) +lemma mem_smallSets (s : Finset α) (d : ℕ) : s ∈ smallSets α d ↔ s.card ≤ d := by + simp only [smallSets,Finset.mem_biUnion,Finset.mem_range,Finset.mem_powersetCard, + Finset.subset_univ,true_and] + constructor + · rintro ⟨j,hj,he⟩ + omega + · intro hs + exact ⟨s.card,by omega,rfl⟩ + +def lowDegree (d : ℕ) : Submodule 𝔽 (β → 𝔽) := + Submodule.span 𝔽 (monomial (𝔽 := 𝔽) B '' (smallSets α d : Set (Finset α))) + +lemma monomial_mem {s : Finset α} {d : ℕ} (hs : s.card ≤ d) : + monomial (𝔽 := 𝔽) B s ∈ lowDegree B d := by + exact Submodule.subset_span ⟨s,(mem_smallSets s d).mpr hs,rfl⟩ +omit [Fintype α] in +lemma monomial_empty : monomial (𝔽 := 𝔽) B ∅=1 := by ext b; simp [monomial] +omit [Fintype α] in +lemma monomial_mul (s t : Finset α) : + monomial (𝔽 := 𝔽) B s * monomial B t=monomial B (s ∪ t) := by + ext b + by_cases hs : s ⊆ B b <;> by_cases ht : t ⊆ B b <;> + simp [monomial,Finset.union_subset_iff,hs,ht] +lemma coordinate_mul_mem {d : ℕ} {f : β → 𝔽} (hf : f ∈ lowDegree B d) (a : α) : + monomial B {a} * f ∈ lowDegree B (d+1) := by + induction hf using Submodule.span_induction with + | mem x hx => + obtain ⟨s,hs,rfl⟩ := hx + rw [monomial_mul] + apply monomial_mem + have hc := (Finset.card_union_le ({a} : Finset α) s) + have hd := (mem_smallSets s d).mp hs + simp only [Finset.card_singleton] at hc + omega + | zero => simp + | add x y hx hy ihx ihy => simpa only [mul_add] using Submodule.add_mem _ ihx ihy + | smul c x hx ih => simpa only [mul_smul_comm] using Submodule.smul_mem _ c ih + +lemma sum_power_mem (A : Finset α) (d : ℕ) : + (∑ a ∈ A, monomial (𝔽 := 𝔽) B {a})^d ∈ lowDegree B d := by + induction d with + | zero => simpa only [pow_zero,monomial_empty] using + (monomial_mem (𝔽 := 𝔽) B (s := ∅) (d := 0) (by simp)) + | succ d ih => + rw [pow_succ',Finset.sum_mul] + exact Submodule.sum_mem _ (fun a _ => coordinate_mul_mem B ih a) + +variable [Fintype β] [DecidableEq β] + +lemma interpolation_dimension_bound (d : ℕ) + (h : ∀ b : β, Pi.single b (1 : 𝔽) ∈ lowDegree B d) : + Fintype.card β ≤ ∑ j ∈ Finset.range (d+1), (Fintype.card α).choose j := by + have ht : lowDegree (𝔽 := 𝔽) B d=⊤ := by + apply top_unique + intro f hf + have he : f=∑ b, f b • Pi.single b (1 : 𝔽) := by + ext b + simp [Pi.single_apply] + rw [he] + exact Submodule.sum_mem _ (fun b _ => Submodule.smul_mem _ (f b) (h b)) + classical + have hd := finrank_span_finset_le_card (R := 𝔽) + ((smallSets α d).image (monomial (𝔽 := 𝔽) B)) + have he : Submodule.span 𝔽 (((smallSets α d).image (monomial (𝔽 := 𝔽) B)) : Set (β → 𝔽))= + lowDegree B d := by rw [Finset.coe_image]; rfl + change Module.finrank 𝔽 (Submodule.span 𝔽 _) ≤ _ at hd + rw [he,ht,finrank_top,Module.finrank_fintype_fun_eq_card] at hd + refine hd.trans (Finset.card_image_le.trans ?_) + calc + (smallSets α d).card ≤ ∑ j ∈ Finset.range (d+1), ((Finset.univ : Finset α).powersetCard j).card := by + exact Finset.card_biUnion_le + _ = _ := by simp only [Finset.card_powersetCard,Finset.card_univ] +end FiniteConstruction + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/CPBlocks.lean b/lean/OAI/InformationTheory/Entanglement/CPBlocks.lean new file mode 100644 index 0000000000000000000000000000000000000000..f0c1d548418f61e5685d853f75f82e845d33304a --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/CPBlocks.lean @@ -0,0 +1,86 @@ +import OAI.InformationTheory.Entanglement.PositiveBlock + +namespace OAI + +noncomputable section +open scoped BigOperators ComplexOrder MatrixOrder Kronecker +open Matrix +namespace SecretKey +open ChannelCompletion TensorCriterion +variable {n m : Type} [Fintype n] [Fintype m] [DecidableEq m] + +omit [Fintype m] [DecidableEq m] in +lemma cp_pure_block {F : Map n m} (hF : CP F) (u v : n → ℂ) : + (fromBlocks (F (projector u)) (F (vecMulVec u (star v))) + (F (vecMulVec u (star v)))ᴴ (F (projector v))).PosSemidef := by + let x : Bool × n → ℂ := fun p => if p.1 then v p.2 else u p.2 + have h := hF Bool (projector x) (Matrix.posSemidef_vecMulVec_self_star x) + let e : m ⊕ m → Bool × m := Sum.elim (fun i => (false,i)) (fun i => (true,i)) + have he : (amplify F (projector x)).submatrix e e = + fromBlocks (F (projector u)) (F (vecMulVec u (star v))) + (F (vecMulVec u (star v)))ᴴ (F (projector v)) := by + ext i j + cases i with + | inl i => cases j <;> rfl + | inr i => cases j with + | inr j => rfl + | inl j => + exact (h.isHermitian.apply (true,i) (false,j)).symm + rw [← he] + exact h.submatrix e + +lemma cp_filtered_bound {F : Map n m} (hF : CP F) (u v : n → ℂ) + (S T : Mat m) : + traceNorm (S * F (vecMulVec u (star v)) * Tᴴ) ≤ + Real.sqrt ((Matrix.trace (S * F (projector u) * Sᴴ)).re * + (Matrix.trace (T * F (projector v) * Tᴴ)).re) := by + have h := (cp_pure_block hF u v).mul_mul_conjTranspose_same (fromBlocks S 0 0 T) + simp only [Matrix.fromBlocks_conjTranspose, Matrix.conjTranspose_zero, + Matrix.fromBlocks_multiply,Matrix.mul_zero,Matrix.zero_mul,add_zero,zero_add] at h + apply positive_block + convert h using 1 + simp only [Matrix.conjTranspose_mul, Matrix.conjTranspose_conjTranspose, Matrix.mul_assoc] + +lemma cp_filtered_reverse {F : Map n m} (hF : CP (F.comp transposeMap)) (u v : n → ℂ) + (S T : Mat m) : + traceNorm (S * F (vecMulVec u (star v)) * Tᴴ) ≤ + Real.sqrt ((Matrix.trace (S * F (projector v) * Sᴴ)).re * + (Matrix.trace (T * F (projector u) * Tᴴ)).re) := by + have he (u v : n → ℂ) : (vecMulVec (star v) (star (star u)))ᵀ = vecMulVec u (star v) := by + ext i j + simp [Matrix.vecMulVec_apply,Pi.star_apply,mul_comm] + have h := cp_filtered_bound hF (star v) (star u) S T + simpa only [LinearMap.comp_apply,transposeMap_apply,projector,he] using h + +lemma trace_filter {D : Mat m} (hD : D.PosSemidef) (A : Mat m) : + Matrix.trace (CFC.sqrt D * A * (CFC.sqrt D)ᴴ) = Matrix.trace (D*A) := by + rw [(Matrix.nonneg_iff_posSemidef.mp (CFC.sqrt_nonneg D)).isHermitian.eq, + Matrix.trace_mul_cycle, CFC.sqrt_mul_sqrt_self _ hD.nonneg] + +lemma trace_psd_product_nonneg {A D : Mat m} (hA : A.PosSemidef) (hD : D.PosSemidef) : + 0 ≤ (Matrix.trace (D*A)).re := by + rw [← trace_filter hD] + exact (Complex.nonneg_iff.mp (hA.mul_mul_conjTranspose_same _).trace_nonneg).1 + +lemma cp_effect_direct {F : Map n m} (hF : CP F) (u v : n → ℂ) + {D E : Mat m} (hD : D.PosSemidef) (hE : E.PosSemidef) : + traceNorm (CFC.sqrt D * F (vecMulVec u (star v)) * CFC.sqrt E) ≤ + Real.sqrt ((Matrix.trace (D*F (projector u))).re * (Matrix.trace (E*F (projector v))).re) := by + have h := cp_filtered_bound hF u v (CFC.sqrt D) (CFC.sqrt E) + rw [trace_filter hD,trace_filter hE, + (Matrix.nonneg_iff_posSemidef.mp (CFC.sqrt_nonneg E)).isHermitian.eq] at h + exact h + +lemma cp_effect_reverse {F : Map n m} (hF : CP (F.comp transposeMap)) (u v : n → ℂ) + {D E : Mat m} (hD : D.PosSemidef) (hE : E.PosSemidef) : + traceNorm (CFC.sqrt D * F (vecMulVec u (star v)) * CFC.sqrt E) ≤ + Real.sqrt ((Matrix.trace (D*F (projector v))).re * (Matrix.trace (E*F (projector u))).re) := by + have h := cp_filtered_reverse hF u v (CFC.sqrt D) (CFC.sqrt E) + rw [trace_filter hD,trace_filter hE, + (Matrix.nonneg_iff_posSemidef.mp (CFC.sqrt_nonneg E)).isHermitian.eq] at h + exact h +end SecretKey + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/CQVariation.lean b/lean/OAI/InformationTheory/Entanglement/CQVariation.lean new file mode 100644 index 0000000000000000000000000000000000000000..dbab3e7f367004012962b1f9f3bff4585035a07d --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/CQVariation.lean @@ -0,0 +1,89 @@ +import OAI.InformationTheory.Entanglement.TraceMatrixSpace +import OAI.InformationTheory.Entanglement.MatrixMeasureChannel + +namespace OAI + +noncomputable section +open scoped BigOperators ENNReal MeasureTheory Matrix.Norms.L2Operator +open MeasureTheory Matrix +namespace SecretKey +open ChannelCompletion +variable {T : Type*} [MeasurableSpace T] {n : Type} [Fintype n] [DecidableEq n] + +def traceDensityMeasure (μ : Measure T) (D : T → Mat n) : VectorMeasure T (TraceMatrix n) := + μ.withDensityᵥ (fun t => TraceMatrix.mk (D t)) +lemma traceDensityMeasure_value (μ : Measure T) (D : T → Mat n) + (hi : ∀ a b, Integrable (fun t => D t a b) μ) {s : Set T} (hs : MeasurableSet s) : + (traceDensityMeasure μ D s).val=fun a b => ∫ t in s, D t a b ∂μ := by + rw [traceDensityMeasure,withDensityᵥ_apply (TraceMatrix.integrable_into hi) hs] + ext a b + exact TraceMatrix.setIntegral_entry hi s a b +lemma traceDensityMeasure_variation (μ : Measure T) (D : T → Mat n) + (hi : ∀ a b, Integrable (fun t => D t a b) μ) : + (traceDensityMeasure μ D).variation Set.univ=ENNReal.ofReal (∫ t, traceNorm (D t) ∂μ) := by + rw [traceDensityMeasure,Measure.variation_withDensityᵥ (TraceMatrix.integrable_into hi), + withDensity_apply _ MeasurableSet.univ] + simp only [Measure.restrict_univ] + simp only [← ofReal_norm] + rw [← ofReal_integral_eq_lintegral_ofReal (TraceMatrix.integrable_into hi).norm + (Filter.Eventually.of_forall (fun t => norm_nonneg _))] + rfl +omit [Fintype n] [DecidableEq n] in +lemma idealDensity_entry_integrable (σ : T → Mat n) {μ : Measure T} + (hi : ∀ a b, Integrable (fun t => σ t a b) μ) (i j : Fin 2) (a b : n) : + Integrable (fun t => idealDensity σ i j t a b) μ := by + unfold idealDensity halfDensity + split_ifs + · exact (hi a b).const_mul _ + · exact integrable_zero _ _ _ +omit [Fintype n] [DecidableEq n] in +lemma idealDensity_entry_integral (σ : T → Mat n) {μ : Measure T} + (s : Set T) (i j : Fin 2) (a b : n) : + (∫ t in s, idealDensity σ i j t a b ∂μ)= + (if i=j then (1/2 : ℂ)*(∫ t in s, σ t a b ∂μ) else 0) := by + unfold idealDensity halfDensity + split_ifs <;> simp only [Matrix.smul_apply,smul_eq_mul,integral_const_mul,Matrix.zero_apply,integral_zero] +def cqDifferenceMeasure (W : Fin 2 → Fin 2 → PositiveMatrixMeasure T n) + (σ : PositiveMatrixMeasure T n) (i j : Fin 2) : VectorMeasure T (TraceMatrix n) := + traceDensityMeasure (bitComparisonMeasure W σ) (fun t => + (W i j).positiveDensity (bitComparisonMeasure W σ) t- + idealDensity (σ.positiveDensity (bitComparisonMeasure W σ)) i j t) +lemma cqDifferenceMeasure_value (W : Fin 2 → Fin 2 → PositiveMatrixMeasure T n) + (σ : PositiveMatrixMeasure T n) (i j : Fin 2) {s : Set T} (hs : MeasurableSet s) : + (cqDifferenceMeasure W σ i j s).val= + (W i j).value s-(if i=j then halfDensity (σ.value s) else 0) := by + rw [cqDifferenceMeasure] + rw [traceDensityMeasure_value _ (fun t => (W i j).positiveDensity (bitComparisonMeasure W σ) t- + idealDensity (σ.positiveDensity (bitComparisonMeasure W σ)) i j t) (fun a b => + ((W i j).positiveDensity_integrable (bitComparison_actual_dom W σ i j) a b).sub + (idealDensity_entry_integrable _ (σ.positiveDensity_integrable (bitComparison_ideal_dom W σ)) i j a b)) hs] + ext a b + simp only [Matrix.sub_apply] + rw [integral_sub + ((W i j).positiveDensity_integrable (bitComparison_actual_dom W σ i j) a b).integrableOn + (idealDensity_entry_integrable _ (σ.positiveDensity_integrable (bitComparison_ideal_dom W σ)) i j a b).integrableOn, + (W i j).positiveDensity_setIntegral (bitComparison_actual_dom W σ i j) hs, + idealDensity_entry_integral,σ.positiveDensity_setIntegral (bitComparison_ideal_dom W σ) hs] + split_ifs <;> rfl + +theorem cqBitDistance_variation (W : Fin 2 → Fin 2 → PositiveMatrixMeasure T n) + (σ : PositiveMatrixMeasure T n) : + ENNReal.ofReal (cqBitDistance W σ)= + ∑ i, ∑ j, (cqDifferenceMeasure W σ i j).variation Set.univ := by + unfold cqBitDistance bitDistance + rw [ENNReal.ofReal_sum_of_nonneg (fun i _ => Finset.sum_nonneg + (fun j _ => integral_nonneg (fun t => traceNorm_nonneg _)))] + apply Finset.sum_congr rfl + intro i _ + rw [ENNReal.ofReal_sum_of_nonneg (fun j _ => integral_nonneg (fun t => traceNorm_nonneg _))] + apply Finset.sum_congr rfl + intro j _ + exact (traceDensityMeasure_variation _ _ (fun a b => + ((W i j).positiveDensity_integrable (bitComparison_actual_dom W σ i j) a b).sub + (idealDensity_entry_integrable _ (σ.positiveDensity_integrable (bitComparison_ideal_dom W σ)) i j a b))).symm + +end SecretKey + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/CausalIndependence.lean b/lean/OAI/InformationTheory/Entanglement/CausalIndependence.lean new file mode 100644 index 0000000000000000000000000000000000000000..efbd0075d630dfff81960d4b7656eec107f0fdc0 --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/CausalIndependence.lean @@ -0,0 +1,129 @@ +import OAI.InformationTheory.Entanglement.CausalPublic + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory Filter Function +open scoped MeasureTheory ProbabilityTheory unitInterval +namespace SecretKey +attribute [local instance] Classical.propDecidable +variable {X : Type*} [MeasurableSpace X] +variable (role : ℕ → TapeRole) (pub : Set ℕ) (x₀ : X) +variable (g : (k : ℕ) → (Fin k → X) → I → X) +variable (hg : ∀ k, Measurable (uncurry (g k))) +def causalPublicFiltration : Filtration ℕ (inferInstance : MeasurableSpace (UniformTapes ℕ)) where + seq := causalPublicInfo role pub x₀ g + mono' := causalPublicInfo_mono role pub x₀ g + le' := causalPublicInfo_le role pub x₀ g hg +lemma causalPublic_zero : causalPublicInfo role pub x₀ g 0=⊥ := by + apply le_bot_iff.mp + let : MeasurableSpace (UniformTapes ℕ) := ⊥ + have he : causalPublic role pub x₀ g 0=(fun _ => (Fin.elim0 : Fin 0 → X)) := by + funext ω i; exact Fin.elim0 i + change (inferInstance : MeasurableSpace (Fin 0→X)).comap _ ≤ _ + rw [he] + exact (measurable_const : Measurable (fun _ : UniformTapes ℕ => (Fin.elim0 : Fin 0 → X))).comap_le +include hg in +lemma causal_initial_independence : + CondIndep (causalPublicInfo role pub x₀ g 0) (roleInfo role .alice) (roleInfo role .bob) + (causalPublicInfo_le role pub x₀ g hg 0) uniformTapesLaw := by + apply initial_uniform_tape_independence (c := ∅) + · apply Set.disjoint_left.mpr + intro k hb ha + simp only [Set.mem_union,Set.mem_ofPred_eq,Set.mem_empty_iff_false,or_false] at ha + have h : TapeRole.alice=TapeRole.bob := ha.symm.trans hb + cases h + · rw [causalPublic_zero] + exact bot_le +include hg in +lemma causal_public_steps (hsource : ∀ k, role k=.source → k∈pub) + (κ : (k : ℕ) → Kernel (Fin k → X) X) [∀ k, IsMarkovKernel (κ k)] + (hmap : ∀ k s, volume.map (g k s)=κ k s) (k : ℕ) : + TapePublicStep uniformTapesLaw (roleInfo role .alice) (roleInfo role .bob) + (causalPublicInfo role pub x₀ g k) (causalPublicInfo role pub x₀ g (k+1)) + (causalPublicInfo_le role pub x₀ g hg k) := by + cases hr : role k with + | alice => + exact Or.inl (by simpa only [hr] using causalPublic_succ_local role pub x₀ g hg k) + | bob => + exact Or.inr (Or.inl (by simpa only [hr] using causalPublic_succ_local role pub x₀ g hg k)) + | source => exact causal_source_step role pub x₀ g hg hsource κ hmap k hr + +def completeCausalPublic (ω : UniformTapes ℕ) (k : ℕ) : X := + if k∈pub then sampledHistory (causalSampler role pub x₀ g) ω k else x₀ +def completeCausalView (r : TapeRole) (ω : UniformTapes ℕ) (k : ℕ) : X := + if role k=r ∨ k∈pub then sampledHistory (causalSampler role pub x₀ g) ω k else x₀ +omit [MeasurableSpace X] in +lemma completeCausalPublic_prefix (k : ℕ) (ω : UniformTapes ℕ) : + causalPublic role pub x₀ g k ω=recordPrefix k (completeCausalPublic role pub x₀ g ω) := by + funext i + simp only [causalPublic,publicPrefix,recordPrefix,completeCausalPublic,sampledPrefix_eq] +omit [MeasurableSpace X] in +lemma completeCausalPublic_last (k : ℕ) (ω : UniformTapes ℕ) : + causalPublic role pub x₀ g (k+1) ω (Fin.last k)=completeCausalPublic role pub x₀ g ω k := by + rw [completeCausalPublic_prefix] + rfl +include hg in +lemma completeCausalPublic_measurable : Measurable (completeCausalPublic role pub x₀ g) := by + apply Measurable.of_eval + intro k + have he : (fun ω => completeCausalPublic role pub x₀ g ω k)= + (fun ω => causalPublic role pub x₀ g (k+1) ω (Fin.last k)) := + funext fun ω => (completeCausalPublic_last role pub x₀ g k ω).symm + rw [he] + exact (measurable_pi_apply (Fin.last k)).comp (causalPublic_measurable role pub x₀ g hg (k+1)) +lemma completeCausalPublic_information : + (inferInstance : MeasurableSpace (ℕ → X)).comap (completeCausalPublic role pub x₀ g)= + ⨆ k, causalPublicInfo role pub x₀ g k := by + apply le_antisymm + · let : MeasurableSpace (UniformTapes ℕ) := ⨆ k, causalPublicInfo role pub x₀ g k + apply Measurable.comap_le + apply Measurable.of_eval + intro k + have he : (fun ω => completeCausalPublic role pub x₀ g ω k)= + (fun ω => causalPublic role pub x₀ g (k+1) ω (Fin.last k)) := + funext fun ω => (completeCausalPublic_last role pub x₀ g k ω).symm + rw [he] + exact ((measurable_pi_apply (Fin.last k)).comp (causalPublic_own_measurable role pub x₀ g (k+1))).mono (le_iSup _ (k+1)) le_rfl + · apply iSup_le + intro k + let : MeasurableSpace (UniformTapes ℕ) := + (inferInstance : MeasurableSpace (ℕ → X)).comap (completeCausalPublic role pub x₀ g) + have hm : Measurable (completeCausalPublic role pub x₀ g) := measurable_iff_comap_le.mpr le_rfl + have he : causalPublic role pub x₀ g k=recordPrefix k ∘ completeCausalPublic role pub x₀ g := + funext (completeCausalPublic_prefix role pub x₀ g k) + exact (congrArg (fun f => (inferInstance : MeasurableSpace (Fin k→X)).comap f) he).le.trans + ((recordPrefix_measurable k).comp hm).comap_le +include hg in +lemma completeCausalView_local (r : TapeRole) : + Measurable[roleInfo role r ⊔ (inferInstance : MeasurableSpace (ℕ→X)).comap (completeCausalPublic role pub x₀ g)] + (completeCausalView role pub x₀ g r) := by + rw [completeCausalPublic_information] + let : MeasurableSpace (UniformTapes ℕ) := roleInfo role r ⊔ ⨆ k,causalPublicInfo role pub x₀ g k + apply Measurable.of_eval + intro k + have he : (fun ω => completeCausalView role pub x₀ g r ω k)= + (fun ω => causalVisible role pub x₀ g r (k+1) ω (Fin.last k)) := by + funext ω + simp [completeCausalView,causalVisible,visiblePrefix,sampledPrefix_succ,sampledHistory] + rw [he] + exact ((measurable_pi_apply (Fin.last k)).comp (causalVisible_local role pub x₀ g hg r (k+1))).mono + (sup_le_sup_left (le_iSup _ (k+1)) _) le_rfl + +theorem causal_complete_independence (hsource : ∀ k, role k=.source → k∈pub) + (κ : (k : ℕ) → Kernel (Fin k → X) X) [∀ k, IsMarkovKernel (κ k)] + (hmap : ∀ k s, volume.map (g k s)=κ k s) : + CondIndep ((inferInstance : MeasurableSpace (ℕ→X)).comap (completeCausalPublic role pub x₀ g)) + (roleInfo role .alice ⊔ (inferInstance : MeasurableSpace (ℕ→X)).comap (completeCausalPublic role pub x₀ g)) + (roleInfo role .bob ⊔ (inferInstance : MeasurableSpace (ℕ→X)).comap (completeCausalPublic role pub x₀ g)) + (completeCausalPublic_measurable role pub x₀ g hg).comap_le uniformTapesLaw := by + simpa only [completeCausalPublic_information,causalPublicFiltration] using tapes_independent_given_complete_public uniformTapesLaw _ _ (roleInfo_le role .alice) + (roleInfo_le role .bob) (causalPublicFiltration role pub x₀ g hg) + (causal_initial_independence role pub x₀ g hg) + (causal_public_steps role pub x₀ g hg hsource κ hmap) + +end SecretKey + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/CausalPublic.lean b/lean/OAI/InformationTheory/Entanglement/CausalPublic.lean new file mode 100644 index 0000000000000000000000000000000000000000..3b6f133a68b8655920599a4a9c4b8b6f909e7425 --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/CausalPublic.lean @@ -0,0 +1,150 @@ +import OAI.InformationTheory.Entanglement.CausalSampler + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory Filter Function +open scoped MeasureTheory ProbabilityTheory unitInterval +namespace SecretKey +attribute [local instance] Classical.propDecidable +variable {Ω X : Type*} [MeasurableSpace X] +lemma snoc_information (k : ℕ) (P : Ω → Fin k → X) (C : Ω → X) : + (inferInstance : MeasurableSpace (Fin (k+1) → X)).comap (fun ω => Fin.snoc (P ω) (C ω))= + (inferInstance : MeasurableSpace (Fin k → X)).comap P ⊔ + (inferInstance : MeasurableSpace X).comap C := by + let Y : Ω → (Fin (k+1) → X) := fun ω => Fin.snoc (P ω) (C ω) + apply le_antisymm + · let : MeasurableSpace Ω := (inferInstance : MeasurableSpace (Fin k → X)).comap P ⊔ + (inferInstance : MeasurableSpace X).comap C + have hp : Measurable P := measurable_iff_comap_le.mpr le_sup_left + have hc : Measurable C := measurable_iff_comap_le.mpr le_sup_right + exact ((snoc_measurable k).comp (hp.prodMk hc)).comap_le + · let : MeasurableSpace Ω := (inferInstance : MeasurableSpace (Fin (k+1) → X)).comap Y + have hy : Measurable Y := measurable_iff_comap_le.mpr le_rfl + apply sup_le + · have he : P=(fun u : Fin (k+1) → X => fun i : Fin k => u i.castSucc) ∘ Y := by + funext ω i; simp [Y] + exact (congrArg (fun f => (inferInstance : MeasurableSpace (Fin k → X)).comap f) he).le.trans + ((show Measurable (fun u : Fin (k+1) → X => fun i : Fin k => u i.castSucc) by fun_prop).comp hy).comap_le + · have he : C=(fun u : Fin (k+1) → X => u (Fin.last k)) ∘ Y := by + funext ω; simp [Y] + exact (congrArg (fun f => (inferInstance : MeasurableSpace X).comap f) he).le.trans + ((measurable_pi_apply (Fin.last k)).comp hy).comap_le + +variable (role : ℕ → TapeRole) (pub : Set ℕ) (x₀ : X) +variable (g : (k : ℕ) → (Fin k → X) → I → X) +variable (hg : ∀ k, Measurable (uncurry (g k))) +omit [MeasurableSpace X] in +lemma causalPublic_succ (k : ℕ) (ω : UniformTapes ℕ) : + causalPublic role pub x₀ g (k+1) ω=Fin.snoc (causalPublic role pub x₀ g k ω) + (if k∈pub then sampledHistory (causalSampler role pub x₀ g) ω k else x₀) := by + funext i + refine Fin.lastCases ?_ (fun j => ?_) i + · simp [causalPublic,publicPrefix,sampledPrefix_succ] + · simpa only [Fin.snoc_castSucc] using causalPublic_castSucc role pub x₀ g k ω j +lemma causalPublicInfo_succ (k : ℕ) (hk : k∈pub) : + causalPublicInfo role pub x₀ g (k+1)=causalPublicInfo role pub x₀ g k ⊔ + (inferInstance : MeasurableSpace X).comap (fun ω => sampledHistory (causalSampler role pub x₀ g) ω k) := by + simp only [causalPublicInfo,funext (causalPublic_succ role pub x₀ g k),hk,ite_true] + exact snoc_information _ _ _ +lemma causalPublicInfo_succ_of_private (k : ℕ) (hk : k∉pub) : + causalPublicInfo role pub x₀ g (k+1)=causalPublicInfo role pub x₀ g k := by + apply le_antisymm + · let : MeasurableSpace (UniformTapes ℕ) := causalPublicInfo role pub x₀ g k + have hP := causalPublic_own_measurable role pub x₀ g k + change (inferInstance : MeasurableSpace (Fin (k+1) → X)).comap _ ≤ _ + have he : causalPublic role pub x₀ g (k+1)=fun ω => Fin.snoc (causalPublic role pub x₀ g k ω) x₀ := by + funext ω + simp only [causalPublic_succ,hk,ite_false] + rw [he] + exact ((snoc_measurable k).comp (hP.prodMk measurable_const)).comap_le + · exact causalPublicInfo_mono role pub x₀ g (Nat.le_succ k) +include hg in +lemma causalOutcome_local (k : ℕ) : + Measurable[roleInfo role (role k) ⊔ causalPublicInfo role pub x₀ g k] + (fun ω => sampledHistory (causalSampler role pub x₀ g) ω k) := by + have hv := causalVisible_local role pub x₀ g hg (role k) k + have hu : Measurable[roleInfo role (role k) ⊔ causalPublicInfo role pub x₀ g k] + (fun ω : UniformTapes ℕ => ω k) := + (measurable_tape_coordinate {j | role j=role k} k rfl).mono le_sup_left le_rfl + exact (hg k).comp (hv.prodMk hu) +include hg in +lemma causalPublic_succ_local (k : ℕ) : + causalPublicInfo role pub x₀ g (k+1) ≤ roleInfo role (role k) ⊔ causalPublicInfo role pub x₀ g k := by + by_cases hk : k∈pub + · rw [causalPublicInfo_succ role pub x₀ g k hk] + exact sup_le le_sup_right (causalOutcome_local role pub x₀ g hg k).comap_le + · rw [causalPublicInfo_succ_of_private role pub x₀ g k hk] + exact le_sup_right +omit [MeasurableSpace X] in +lemma source_view_eq_public (hsource : ∀ k, role k=.source → k∈pub) (k : ℕ) : + causalVisible role pub x₀ g .source k=causalPublic role pub x₀ g k := by + funext ω i + by_cases hi : i.val∈pub + · simp [causalVisible,visiblePrefix,causalPublic,publicPrefix,hi] + · have hn : role i.val≠.source := fun h => hi (hsource i h) + simp [causalVisible,visiblePrefix,causalPublic,publicPrefix,hi,hn] + +lemma causal_source_step (hsource : ∀ k, role k=.source → k∈pub) + (κ : (k : ℕ) → Kernel (Fin k → X) X) [∀ k, IsMarkovKernel (κ k)] + (hmap : ∀ k s, volume.map (g k s)=κ k s) (k : ℕ) (hk : role k=.source) : + TapePublicStep uniformTapesLaw (roleInfo role .alice) (roleInfo role .bob) + (causalPublicInfo role pub x₀ g k) (causalPublicInfo role pub x₀ g (k+1)) + (causalPublicInfo_le role pub x₀ g hg k) := by + let E := {j | role j≠TapeRole.source} + let S := {j | role j≠TapeRole.source ∨ j ((fun j => ω j),causalPublic role pub x₀ g k ω) + have hrest : Measurable[tapeInformation S] (fun ω : UniformTapes ℕ => fun j : E => ω j) := by + let : MeasurableSpace (UniformTapes ℕ) := tapeInformation S + apply Measurable.of_eval + intro j + exact measurable_tape_coordinate S j (Or.inl j.property) + have hP : Measurable[tapeInformation S] (causalPublic role pub x₀ g k) := + ((publicPrefix_measurable pub x₀ k).comp + (sampledPrefix_measurable _ (causalSampler_measurable role pub x₀ g hg) k)).mono + (tapeInformation_mono (fun j hj => Or.inr hj)) le_rfl + have hHs : Measurable[tapeInformation S] H := hrest.prodMk hP + have hH : Measurable H := hHs.mono (tapeInformation_le _) le_rfl + have hind : IndepFun H (fun ω => ω k) uniformTapesLaw := + fresh_coordinate_independent (by simp [S,hk]) H hHs + have hHown : Measurable[(inferInstance : MeasurableSpace (UniformTapes E × (Fin k→X))).comap H] H := + measurable_iff_comap_le.mpr le_rfl + have hFH : causalPublicInfo role pub x₀ g k ≤ (inferInstance : MeasurableSpace (UniformTapes E × (Fin k→X))).comap H := by + change (inferInstance : MeasurableSpace (Fin k→X)).comap (Prod.snd ∘ H) ≤ _ + exact ((show Measurable (Prod.snd : UniformTapes E × (Fin k→X) → Fin k→X) from measurable_snd).comp + hHown).comap_le + have hrH (r : TapeRole) (hr : r≠.source) : + roleInfo role r ≤ (inferInstance : MeasurableSpace (UniformTapes E × (Fin k→X))).comap H := by + apply iSup_le + intro j + apply iSup_le + intro hj + have hjE : j∈E := by dsimp [E]; exact fun hs => hr (hj.symm.trans hs) + have hcoord : (fun ω : UniformTapes ℕ => ω j)= + (fun p : UniformTapes E × (Fin k→X) => p.1 ⟨j,hjE⟩) ∘ H := rfl + rw [hcoord] + exact ((show Measurable (fun p : UniformTapes E × (Fin k→X) => p.1 ⟨j,hjE⟩) by fun_prop).comp + hHown).comap_le + have hDH := sup_le (hrH .alice (by decide)) (hrH .bob (by decide)) + have hc := sampled_public_independence (causalPublicInfo_le role pub x₀ g hg k) + (sup_le (roleInfo_le role .alice) (roleInfo_le role .bob)) H hH hFH hDH + Prod.snd measurable_snd (causalPublic_own_measurable role pub x₀ g k) + (fun ω => ω k) (measurable_pi_apply k) hind (tape_coordinate_law k) + (κ k) (g k) (hg k) (hmap k) + have he : (fun ω => g k (causalPublic role pub x₀ g k ω) (ω k))= + (fun ω => sampledHistory (causalSampler role pub x₀ g) ω k) := by + funext ω + change g k (causalPublic role pub x₀ g k ω) _=g k (causalVisible role pub x₀ g (role k) k ω) _ + rw [hk,source_view_eq_public role pub x₀ g hsource k] + change CondIndep (causalPublicInfo role pub x₀ g k) (roleInfo role .alice ⊔ roleInfo role .bob) ((inferInstance : MeasurableSpace X).comap (fun ω => g k (causalPublic role pub x₀ g k ω) (ω k))) _ _ at hc + rw [he] at hc + refine Or.inr (Or.inr ⟨_,(show Measurable (fun ω => sampledHistory (causalSampler role pub x₀ g) ω k) from + (measurable_pi_apply k).comp (sampledHistory_measurable _ (causalSampler_measurable role pub x₀ g hg))).comap_le,?_,hc.symm⟩) + rw [causalPublicInfo_succ role pub x₀ g k (hsource k hk),sup_comm] + +end SecretKey + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/CausalRealization.lean b/lean/OAI/InformationTheory/Entanglement/CausalRealization.lean new file mode 100644 index 0000000000000000000000000000000000000000..e56c656419c1cdcb3c301b1e613ccdaff6d5e5d9 --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/CausalRealization.lean @@ -0,0 +1,68 @@ +import OAI.InformationTheory.Entanglement.CausalIndependence + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory Filter Function +open scoped MeasureTheory ProbabilityTheory unitInterval +namespace SecretKey +attribute [local instance] Classical.propDecidable +variable {X : Type*} [MeasurableSpace X] [StandardBorelSpace X] [Nonempty X] +variable (role : ℕ → TapeRole) (pub : Set ℕ) (x₀ : X) + +def visibleKernel (κ : (k : ℕ) → Kernel (Fin k → X) X) (k : ℕ) : Kernel (Fin k→X) X := + (κ k).comap (visiblePrefix role pub x₀ (role k) k) + (visiblePrefix_measurable role pub x₀ (role k) k) +instance visibleKernel_markov (κ : (k : ℕ) → Kernel (Fin k → X) X) + [∀ k, IsMarkovKernel (κ k)] (k : ℕ) : IsMarkovKernel (visibleKernel role pub x₀ κ k) := by + unfold visibleKernel + infer_instance + +theorem causal_history_realization (hsource : ∀ k, role k=.source → k∈pub) + (κ : (k : ℕ) → Kernel (Fin k → X) X) [∀ k, IsMarkovKernel (κ k)] + (ν : Measure (ℕ→X)) [IsProbabilityMeasure ν] + (hν : ∀ k, ν.map (fun x => (recordPrefix k x,x k))= + ν.map (recordPrefix k) ⊗ₘ visibleKernel role pub x₀ κ k) : + ∃ g : (k : ℕ) → (Fin k → X) → I → X, + (∀ k, Measurable (uncurry (g k))) ∧ + ν=uniformTapesLaw.map (sampledHistory (causalSampler role pub x₀ g)) ∧ + ∃ hT : Measurable (completeCausalPublic role pub x₀ g), + CondIndep ((inferInstance : MeasurableSpace (ℕ→X)).comap (completeCausalPublic role pub x₀ g)) + (roleInfo role .alice ⊔ (inferInstance : MeasurableSpace (ℕ→X)).comap (completeCausalPublic role pub x₀ g)) + (roleInfo role .bob ⊔ (inferInstance : MeasurableSpace (ℕ→X)).comap (completeCausalPublic role pub x₀ g)) + hT.comap_le uniformTapesLaw := by + have hs (k : ℕ) := (κ k).exists_measurable_map_eq_unitInterval + choose g hg hmap using hs + refine ⟨g,hg,?_,completeCausalPublic_measurable role pub x₀ g hg, + causal_complete_independence role pub x₀ g hg hsource κ hmap⟩ + apply sampled_full_history_law _ (causalSampler_measurable role pub x₀ g hg) + (visibleKernel role pub x₀ κ) _ ν hν + intro k s + exact hmap k (visiblePrefix role pub x₀ (role k) k s) + +omit [StandardBorelSpace X] [Nonempty X] in +theorem causal_terminal_values_independent + (g : (k : ℕ) → (Fin k → X) → I → X) + (hg : ∀ k, Measurable (uncurry (g k))) + (hsource : ∀ k, role k=.source → k∈pub) + (κ : (k : ℕ) → Kernel (Fin k → X) X) [∀ k, IsMarkovKernel (κ k)] + (hmap : ∀ k s, volume.map (g k s)=κ k s) + {α β : Type*} [MeasurableSpace α] [MeasurableSpace β] + (f : (ℕ→X) → α) (q : (ℕ→X) → β) (hf : Measurable f) (hq : Measurable q) : + CondIndepFun ((inferInstance : MeasurableSpace (ℕ→X)).comap (completeCausalPublic role pub x₀ g)) + (completeCausalPublic_measurable role pub x₀ g hg).comap_le + (f ∘ completeCausalView role pub x₀ g .alice) + (q ∘ completeCausalView role pub x₀ g .bob) uniformTapesLaw := by + have hi := causal_complete_independence role pub x₀ g hg hsource κ hmap + rw [condIndepFun_iff_condIndep] + apply condIndep_of_condIndep_of_le_right (condIndep_of_condIndep_of_le_left hi ?_) ?_ + · have hf' := (hf.comp (completeCausalView_local role pub x₀ g hg .alice)).comap_le + simpa only [← completeCausalPublic_information] using hf' + · have hq' := (hq.comp (completeCausalView_local role pub x₀ g hg .bob)).comap_le + simpa only [← completeCausalPublic_information] using hq' + +end SecretKey + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/CausalSampler.lean b/lean/OAI/InformationTheory/Entanglement/CausalSampler.lean new file mode 100644 index 0000000000000000000000000000000000000000..ef2294afdc8d59cbc85aa9645787a63e0946fa99 --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/CausalSampler.lean @@ -0,0 +1,135 @@ +import OAI.InformationTheory.Entanglement.SequentialSampling +import OAI.InformationTheory.Entanglement.PublicSampler +import OAI.InformationTheory.Entanglement.TranscriptClassical + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory Filter Function +open scoped MeasureTheory ProbabilityTheory unitInterval +namespace SecretKey + +inductive TapeRole | alice | bob | source + deriving DecidableEq +attribute [local instance] Classical.propDecidable + +variable {X : Type*} [MeasurableSpace X] +variable (role : ℕ → TapeRole) (pub : Set ℕ) (x₀ : X) + +def visiblePrefix (r : TapeRole) (k : ℕ) (x : Fin k → X) : Fin k → X := + fun i => if role i = r ∨ i.val∈pub then x i else x₀ + +def publicPrefix (k : ℕ) (x : Fin k → X) : Fin k → X := + fun i => if i.val∈pub then x i else x₀ +lemma visiblePrefix_measurable (r : TapeRole) (k : ℕ) : + Measurable (visiblePrefix role pub x₀ r k) := by + apply Measurable.of_eval + intro i + by_cases h : role i=r ∨ i.val∈pub + · simpa only [visiblePrefix,h,ite_true] using measurable_pi_apply i + · simpa only [visiblePrefix,h,ite_false] using (measurable_const : Measurable (fun _ : Fin k → X => x₀)) +lemma publicPrefix_measurable (k : ℕ) : + Measurable (publicPrefix pub x₀ k) := by + apply Measurable.of_eval + intro i + by_cases h : i.val∈pub + · simpa only [publicPrefix,h,ite_true] using measurable_pi_apply i + · simpa only [publicPrefix,h,ite_false] using (measurable_const : Measurable (fun _ : Fin k → X => x₀)) + +variable (g : (k : ℕ) → (Fin k → X) → I → X) +def causalSampler (k : ℕ) (x : Fin k → X) (u : I) : X := + g k (visiblePrefix role pub x₀ (role k) k x) u +lemma causalSampler_measurable (hg : ∀ k, Measurable (uncurry (g k))) (k : ℕ) : + Measurable (uncurry (causalSampler role pub x₀ g k)) := by + exact (hg k).comp + (((visiblePrefix_measurable role pub x₀ (role k) k).comp measurable_fst).prodMk measurable_snd) +def causalPublic (k : ℕ) : UniformTapes ℕ → (Fin k → X) := + fun ω => publicPrefix pub x₀ k (sampledPrefix (causalSampler role pub x₀ g) k ω) +def causalVisible (r : TapeRole) (k : ℕ) : UniformTapes ℕ → (Fin k → X) := + fun ω => visiblePrefix role pub x₀ r k (sampledPrefix (causalSampler role pub x₀ g) k ω) +@[instance_reducible] +def causalPublicInfo (k : ℕ) : MeasurableSpace (UniformTapes ℕ) := + (inferInstance : MeasurableSpace (Fin k → X)).comap (causalPublic role pub x₀ g k) +@[instance_reducible] +def roleInfo (r : TapeRole) : MeasurableSpace (UniformTapes ℕ) := tapeInformation {k | role k=r} +lemma causalPublic_measurable (hg : ∀ k, Measurable (uncurry (g k))) (k : ℕ) : + Measurable (causalPublic role pub x₀ g k) := + (publicPrefix_measurable pub x₀ k).comp + (sampledPrefix_measurable_global _ (causalSampler_measurable role pub x₀ g hg) k) +lemma causalPublicInfo_le (hg : ∀ k, Measurable (uncurry (g k))) (k : ℕ) : + causalPublicInfo role pub x₀ g k ≤ (inferInstance : MeasurableSpace (UniformTapes ℕ)) := + (causalPublic_measurable role pub x₀ g hg k).comap_le +lemma roleInfo_le (r : TapeRole) : roleInfo role r ≤ (inferInstance : MeasurableSpace (UniformTapes ℕ)) := + tapeInformation_le _ +lemma causalPublic_own_measurable (k : ℕ) : + Measurable[causalPublicInfo role pub x₀ g k] (causalPublic role pub x₀ g k) := + measurable_iff_comap_le.mpr le_rfl + +omit [MeasurableSpace X] in +lemma causalPublic_castSucc (k : ℕ) (ω : UniformTapes ℕ) (i : Fin k) : + causalPublic role pub x₀ g (k+1) ω i.castSucc=causalPublic role pub x₀ g k ω i := by + simp only [causalPublic,publicPrefix,sampledPrefix_succ,Fin.snoc_castSucc,Fin.val_castSucc] +lemma causalPublicInfo_mono : Monotone (causalPublicInfo role pub x₀ g) := by + apply monotone_nat_of_le_succ + intro k + have h : causalPublic role pub x₀ g k= + (fun v : Fin (k+1)→X => fun i : Fin k => v i.castSucc) ∘ causalPublic role pub x₀ g (k+1) := by + funext ω i + exact (causalPublic_castSucc role pub x₀ g k ω i).symm + change (inferInstance : MeasurableSpace (Fin k→X)).comap _ ≤ _ + rw [h] + exact ((show Measurable (fun v : Fin (k+1)→X => fun i : Fin k => v i.castSucc) by fun_prop).comp + (causalPublic_own_measurable role pub x₀ g (k+1))).comap_le + +theorem causalVisible_local (hg : ∀ k, Measurable (uncurry (g k))) (r : TapeRole) (k : ℕ) : + Measurable[roleInfo role r ⊔ causalPublicInfo role pub x₀ g k] + (causalVisible role pub x₀ g r k) := by + induction k with + | zero => + let : MeasurableSpace (UniformTapes ℕ) := roleInfo role r ⊔ causalPublicInfo role pub x₀ g 0 + apply Measurable.of_eval + intro i + exact Fin.elim0 i + | succ k ih => + let F := roleInfo role r ⊔ causalPublicInfo role pub x₀ g (k+1) + let : MeasurableSpace (UniformTapes ℕ) := F + have hp : Measurable[F] (causalVisible role pub x₀ g r k) := + ih.mono (sup_le_sup_left (causalPublicInfo_mono role pub x₀ g (Nat.le_succ k)) _) le_rfl + have hpub : Measurable[F] (causalPublic role pub x₀ g (k+1)) := + (causalPublic_own_measurable role pub x₀ g (k+1)).mono le_sup_right le_rfl + apply Measurable.of_eval + intro i + refine Fin.lastCases ?_ (fun j => ?_) i + · by_cases hk : k∈pub + · have he : (fun ω => causalVisible role pub x₀ g r (k+1) ω (Fin.last k))= + (fun ω => causalPublic role pub x₀ g (k+1) ω (Fin.last k)) := by + funext ω + simp [causalVisible,visiblePrefix,causalPublic,publicPrefix,hk] + rw [he] + exact (measurable_pi_apply (Fin.last k)).comp hpub + · by_cases hr : role k=r + · have hu : Measurable[F] (fun ω : UniformTapes ℕ => ω k) := by + apply (measurable_tape_coordinate {j | role j=r} k hr).mono le_sup_left le_rfl + have he : (fun ω => causalVisible role pub x₀ g r (k+1) ω (Fin.last k))= + (fun ω => g k (causalVisible role pub x₀ g r k ω) (ω k)) := by + funext ω + simp [causalVisible,visiblePrefix,sampledPrefix_succ,sampledHistory,causalSampler,hr] + rw [he] + exact (hg k).comp (hp.prodMk hu) + · have he : (fun ω => causalVisible role pub x₀ g r (k+1) ω (Fin.last k))=(fun _ => x₀) := by + funext ω + simp [causalVisible,visiblePrefix,hk,hr] + rw [he] + exact measurable_const + · have he : (fun ω => causalVisible role pub x₀ g r (k+1) ω j.castSucc)= + (fun ω => causalVisible role pub x₀ g r k ω j) := by + funext ω + simp only [causalVisible,visiblePrefix,sampledPrefix_succ,Fin.snoc_castSucc,Fin.val_castSucc] + rw [he] + exact (measurable_pi_apply j).comp hp + +end SecretKey + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/ChoiTransfer.lean b/lean/OAI/InformationTheory/Entanglement/ChoiTransfer.lean new file mode 100644 index 0000000000000000000000000000000000000000..638dd8777603936ec5d032c24a0a812f99d70333 --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/ChoiTransfer.lean @@ -0,0 +1,60 @@ +import OAI.InformationTheory.Entanglement.TensorTools + +namespace OAI + +noncomputable section +open scoped BigOperators ComplexOrder MatrixOrder Kronecker +open Matrix +namespace SecretKey +open ChannelCompletion TensorCriterion +variable {n m p : Type} [Fintype n] [Fintype m] [Fintype p] + [DecidableEq n] [DecidableEq m] + +omit [Fintype m] [DecidableEq m] in +lemma linearMap_entries (F : Map n m) (X : Mat n) : + F X = ∑ i, ∑ j, X i j • F (Matrix.single i j 1) := by + conv_lhs => rw [Matrix.matrix_eq_sum_single X] + simp only [map_sum, ← map_smul] + simp + +def sharp (F : Map n m) : Map m n := transposeMap.comp ((hsAdjoint F).comp transposeMap) + +omit [DecidableEq m] in +lemma sharp_apply {F : Map n m} (hF : CP F) (A : Mat m) (i j : n) : + sharp F A i j = ∑ k, ∑ l, F (Matrix.single i j 1) k l * A k l := by + change (∑ k, ∑ l, star (F (Matrix.single j i 1) k l)*A l k) = _ + have hentry (k l : m) : star (F (Matrix.single j i 1) k l) = + F (Matrix.single i j 1) l k := (cp_choi hF).isHermitian.apply (i,l) (j,k) + simp_rw [hentry] + rw [Finset.sum_comm] + +omit [Fintype m] in +lemma omega_block (i j : m) : + (Matrix.of fun k l => projector (omega (n := m)) (i,k) (j,l))=Matrix.single i j 1 := by + ext k l + simp only [projector,Matrix.vecMulVec_apply,omega,Pi.star_apply,Matrix.single_apply] + by_cases hik : i=k <;> by_cases hjl : j=l <;> simp [hik,hjl] + +lemma choi_transfer {F : Map n m} (hF : CP F) (G : Map m p) : + choi (G.comp F)=tensorMap (sharp F) G (projector (omega (n := m))) := by + classical + ext ⟨i,a⟩ ⟨j,b⟩ + change G (F (Matrix.single i j 1)) a b = + sharp F (Matrix.of fun k l => G (Matrix.of fun r s => projector (omega (n := m)) (k,r) (l,s)) a b) i j + simp_rw [omega_block,sharp_apply hF] + rw [linearMap_entries G] + simp only [Matrix.sum_apply,Matrix.smul_apply,smul_eq_mul,Matrix.of_apply] + +omit [DecidableEq m] in +lemma tensorMap_smul (a b : ℂ) (F : Map n m) {r s : Type} [Fintype r] [Fintype s] + (G : Map r s) : tensorMap (a • F) (b • G)=(a*b) • tensorMap F G := by + classical + apply linearMap_eq_of_tensors + intro A B + simp only [LinearMap.smul_apply,tensorMap_kronecker,Matrix.smul_kronecker, + Matrix.kronecker_smul,smul_smul,mul_comm] +end SecretKey + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/Coherence.lean b/lean/OAI/InformationTheory/Entanglement/Coherence.lean new file mode 100644 index 0000000000000000000000000000000000000000..45aa31afac1fd83808a72836ed87f3fbe8b62163 --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/Coherence.lean @@ -0,0 +1,100 @@ +import OAI.InformationTheory.Entanglement.NormalizeRepresentation +import OAI.InformationTheory.Entanglement.SpectralWeights + +namespace OAI + +noncomputable section +open scoped BigOperators ComplexOrder MatrixOrder Kronecker +open Matrix +namespace SecretKey +open ChannelCompletion TensorCriterion +variable {r s n m : Type} [Fintype r] [Fintype s] [Fintype n] [Fintype m] + [DecidableEq r] [DecidableEq s] [DecidableEq n] [DecidableEq m] + +lemma four_effect_commuting (L : Map r n) (M : Map s m) (χ : r × s → ℂ) + (hL : CP L) (hLT : CP (L.comp transposeMap)) + (hM : CP M) (hMT : CP (M.comp transposeMap)) + (X : Fin 2 → Mat n) (Y : Fin 2 → Mat m) + (hX : ∀ i, (X i).PosSemidef) (hY : ∀ i, (Y i).PosSemidef) + (hcomm : Commute (hsAdjoint L (X 0)) (hsAdjoint L (X 1))) : + let R := tensorMap L M (projector χ) + let D := fun i j => X i ⊗ₖ Y j + let p := fun i j => (Matrix.trace (D i j * R)).re + traceNorm (CFC.sqrt (D 0 0) * R * CFC.sqrt (D 1 1)) ≤ + Real.sqrt (p 0 0 * p 0 1) + Real.sqrt (p 1 0 * p 1 1) + + 2 * Real.sqrt (p 0 1 * p 1 0) := by + let A := fun i => hsAdjoint L (X i) + let B := fun j => hsAdjoint M (Y j) + have hA (i : Fin 2) : (A i).PosSemidef := cp_positive (cp_hsAdjoint hL) (hX i) + have hB (j : Fin 2) : (B j).PosSemidef := cp_positive (cp_hsAdjoint hM) (hY j) + let C := tensorMap L M + let D := fun i j => X i ⊗ₖ Y j + let p := fun i j => (Matrix.trace (D i j * C (projector χ))).re + let wgt := fun (z : r × s → ℂ) i j => quad (A i ⊗ₖ B j) z + have hw (z : r × s → ℂ) (i j : Fin 2) : + (Matrix.trace (D i j * C (projector z))).re=wgt z i j := by + rw [pullback_tensor hL hM,quad_trace] + have hn (z : r × s → ℂ) (i j : Fin 2) : 0≤wgt z i j := + quad_nonneg ((hA i).kronecker (hB j)) z + have hD (i j : Fin 2) : (D i j).PosSemidef := (hX i).kronecker (hY j) + obtain ⟨v,w,hsum,hadd,hv,hw'⟩ := spectral_weights A B hA hB hcomm χ + change (∀ i j, wgt χ i j=wgt v i j+wgt w i j) at hadd + change wgt v 1 1≤wgt v 0 1 at hv + change wgt w 0 0≤wgt w 1 0 at hw' + have hvle (i j : Fin 2) : wgt v i j≤p i j := by + dsimp [p]; rw [hw,hadd]; exact le_add_of_nonneg_right (hn w i j) + have hwle (i j : Fin 2) : wgt w i j≤p i j := by + dsimp [p]; rw [hw,hadd]; exact le_add_of_nonneg_left (hn v i j) + let Z := fun u z => CFC.sqrt (D 0 0)*C (vecMulVec u (star z))*CFC.sqrt (D 1 1) + have hd (u z : r × s → ℂ) : traceNorm (Z u z)≤Real.sqrt (wgt u 0 0*wgt z 1 1) := by + have h := cp_effect_direct (cp_tensorMap hL hM) u z (hD 0 0) (hD 1 1) + dsimp only [D] at h + simpa only [pullback_tensor hL hM,quad_trace] using h + have hr (u z : r × s → ℂ) : traceNorm (Z u z)≤Real.sqrt (wgt z 0 0*wgt u 1 1) := by + have h := cp_effect_reverse (cp_tensor_input_transpose hLT hMT) u z (hD 0 0) (hD 1 1) + dsimp only [D] at h + simpa only [pullback_tensor hL hM,quad_trace] using h + have hvv : traceNorm (Z v v)≤Real.sqrt (p 0 0*p 0 1) := + (hd v v).trans (Real.sqrt_le_sqrt (mul_le_mul (hvle 0 0) (hv.trans (hvle 0 1)) + (hn v 1 1) ((hn v 0 0).trans (hvle 0 0)))) + have hww : traceNorm (Z w w)≤Real.sqrt (p 1 0*p 1 1) := + (hd w w).trans (Real.sqrt_le_sqrt (mul_le_mul (hw'.trans (hwle 1 0)) (hwle 1 1) + (hn w 1 1) ((hn w 0 0).trans (hw'.trans (hwle 1 0))))) + have hc : Real.sqrt (wgt w 0 0*wgt v 1 1)≤Real.sqrt (p 0 1*p 1 0) := by + rw [mul_comm (p 0 1)] + exact Real.sqrt_le_sqrt (mul_le_mul (hw'.trans (hwle 1 0)) (hv.trans (hvle 0 1)) + (hn v 1 1) ((hn w 0 0).trans (hw'.trans (hwle 1 0)))) + have he : Z χ χ=(Z v v+Z v w)+(Z w v+Z w w) := by + dsimp [Z] + rw [hsum] + simp only [star_add,Matrix.add_vecMulVec,Matrix.vecMulVec_add,map_add, + Matrix.mul_add,Matrix.add_mul] + abel + change traceNorm (Z χ χ)≤_ + rw [he] + have h1 := traceNorm_add_le (Z v v+Z v w) (Z w v+Z w w) + have h2 := traceNorm_add_le (Z v v) (Z v w) + have h3 := traceNorm_add_le (Z w v) (Z w w) + have h4 := (hr v w).trans hc + have h5 := (hd w v).trans hc + dsimp only [p,C,D] at hvv hww h4 h5 + linarith + +theorem four_effect {n m : Type} [Fintype n] [Fintype m] [DecidableEq n] [DecidableEq m] + (R : Mat (n × m)) (hR : Represented R) + (X : Fin 2 → Mat n) (Y : Fin 2 → Mat m) + (hX : ∀ i, (X i).PosSemidef) (hY : ∀ i, (Y i).PosSemidef) : + let D := fun i j => X i ⊗ₖ Y j + let p := fun i j => (Matrix.trace (D i j * R)).re + traceNorm (CFC.sqrt (D 0 0) * R * CFC.sqrt (D 1 1)) ≤ + Real.sqrt (p 0 0 * p 0 1) + Real.sqrt (p 1 0 * p 1 1) + + 2 * Real.sqrt (p 0 1 * p 1 0) := by + obtain ⟨r,s,_,_,L,M,χ,hL,hLT,hM,hMT,hR,hcomm⟩ := normalized_representation R hR X hX + rw [hR] + exact four_effect_commuting L M χ hL hLT hM hMT X Y hX hY hcomm + +end SecretKey + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/CombinatorialAssembly.lean b/lean/OAI/InformationTheory/Entanglement/CombinatorialAssembly.lean new file mode 100644 index 0000000000000000000000000000000000000000..e07419e156aea91ff6f3046eb7e2def0e2156c7e --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/CombinatorialAssembly.lean @@ -0,0 +1,97 @@ +import OAI.InformationTheory.Entanglement.CombinatorialLocal +import OAI.InformationTheory.Entanglement.MultiTensor + +namespace OAI + +noncomputable section +open scoped BigOperators +open Matrix +namespace FiniteConstruction +open ChannelCompletion + +def P (i : Label) : Mat OutputCoordinate := + multiTensor (fun S => localProjection S i.1 (i.2 S)) +lemma P_hermitian (i : Label) : (P i).IsHermitian := + multiTensor_hermitian _ (fun _ => localProjection_hermitian _ _ _) +lemma P_real (i : Label) (a b : OutputCoordinate) : star (P i a b)=P i a b := by + simp only [P,multiTensor,star_prod] + simp_rw [localProjection_real] +lemma P_idempotent (i : Label) : P i*P i=P i := + multiTensor_idempotent _ (fun _ => localProjection_idempotent _ _ _) +lemma P_orthogonal (i j : Label) (hq : i.1=j.1) (hij : i ≠ j) : P i*P j=0 := by + obtain ⟨q,a⟩ := i + obtain ⟨r,b⟩ := j + dsimp only at hq + subst r + exact multiTensor_orthogonal _ (fun S => localProjection_orthogonal S q) a b + (by intro he; subst b; exact hij rfl) +lemma P_complete (q : Question) : ∑ i : Label with i.1=q, P i=1 := by + rw [Finset.sum_filter,Fintype.sum_prod_type] + dsimp only + rw [Finset.sum_comm] + simp only [Finset.sum_ite_eq',Finset.mem_univ,ite_true] + simp only [P] + exact multiTensor_complete (fun S : Eight => fun a : Outcome => localProjection S q a) + (fun S => localProjection_complete S q) +lemma P_commute (i j : Label) (hc : ProjectionCriterion.correlation u i.1 j.1 ≠ 0) : + P i*P j=P j*P i := + multiTensor_commute _ _ (fun S => localProjection_commute S i.1 j.1 (i.2 S) (j.2 S) hc) +lemma P_overlap_product (i j : Label) : + Matrix.trace (P i*P j)=∏ S, Matrix.trace + (localProjection S i.1 (i.2 S)*localProjection S j.1 (j.2 S)) := + multiTensor_trace_mul _ _ +lemma P_clique (J : Finset Label) + (hJ : ∀ i ∈ J, ∀ j ∈ J, i ≠ j → 0 < (Matrix.trace (P i*P j)).re) : J.card ≤ κ := by + have hinj : Set.InjOn Prod.fst (J : Set Label) := by + intro i hi j hj hq + by_contra he + have hz := P_orthogonal i j hq he + have hh := hJ i hi j hj he + rw [hz,Matrix.trace_zero,Complex.zero_re] at hh + exact (lt_irrefl _ hh) + have hcard := Finset.card_image_of_injOn hinj + rw [← hcard] + apply no_orthogonal_eight_bound + intro hC + obtain ⟨T,hT,cT,pT⟩ := hC + let S : Eight := ⟨T,cT⟩ + have hS : OrthogonalEight S := pT + have hf : ∀ t : Fin 6, ∃ i : Label, i ∈ J ∧ i.1=six S t := by + intro t + exact Finset.mem_image.mp (hT (six_mem S t)) + choose f hf hfst using hf + obtain ⟨t,v,htv,hz⟩ := parity_zero_product (fun t => (f t).2 S) + have hfv : f t ≠ f v := by + intro he + have hq := congrArg Prod.fst he + rw [hfst,hfst] at hq + exact htv (six_injective S hq) + have hzero : P (f t)*P (f v)=0 := by + unfold P + rw [multiTensor_mul] + apply multiTensor_zero_of _ S + rw [hfst,hfst,localProjection_six S hS,localProjection_six S hS] + exact hz + have hh := hJ (f t) (hf t) (f v) (hf v) hfv + rw [hzero,Matrix.trace_zero,Complex.zero_re] at hh + exact lt_irrefl _ hh + +def data : ProjectionCriterion.Data Question Coordinate OutputCoordinate Label where + question := Prod.fst + u := u + unit := question_unit + P := P + hermitian := P_hermitian + idempotent := P_idempotent + orthogonal := P_orthogonal + complete := P_complete + commute := P_commute + κ := κ + gap := by rw [question_card,coordinate_card]; exact strict_gap + clique := fun J hJ => by exact_mod_cast P_clique J hJ + +end FiniteConstruction + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/CombinatorialLocal.lean b/lean/OAI/InformationTheory/Entanglement/CombinatorialLocal.lean new file mode 100644 index 0000000000000000000000000000000000000000..c1c9dfa8a925679091e9bb56eea2fad2b26fb8c0 --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/CombinatorialLocal.lean @@ -0,0 +1,79 @@ +import OAI.InformationTheory.Entanglement.CombinatorialOrder +import OAI.InformationTheory.Entanglement.ParityObstruction + +namespace OAI + +noncomputable section +open scoped BigOperators +open Matrix +namespace FiniteConstruction +open ChannelCompletion + +def trivial (a : Outcome) : Mat Four := if a=(1,1) then 1 else 0 +def localProjection (S : Eight) (q : Question) (a : Outcome) : Mat Four := + match contextAt S q with + | some t => h t a + | none => trivial a +lemma localProjection_six (S : Eight) (hS : OrthogonalEight S) (t : Fin 6) (a : Outcome) : + localProjection S (six S t) a=h t a := by + simp only [localProjection,contextAt_six S hS] +lemma localProjection_hermitian (S : Eight) (q : Question) (a : Outcome) : + (localProjection S q a).IsHermitian := by + unfold localProjection + cases contextAt S q with + | none => unfold trivial; split_ifs <;> simp + | some t => exact h_hermitian t a +lemma localProjection_real (S : Eight) (q : Question) (a : Outcome) (i j : Four) : + star (localProjection S q a i j)=localProjection S q a i j := by + unfold localProjection + cases contextAt S q with + | none => unfold trivial; split_ifs <;> simp [Matrix.one_apply] + | some t => exact h_real t a i j +lemma localProjection_idempotent (S : Eight) (q : Question) (a : Outcome) : + localProjection S q a*localProjection S q a=localProjection S q a := by + unfold localProjection + cases contextAt S q with + | none => unfold trivial; split_ifs <;> simp + | some t => exact h_idempotent t a +lemma localProjection_orthogonal (S : Eight) (q : Question) (a b : Outcome) (hab : a ≠ b) : + localProjection S q a*localProjection S q b=0 := by + unfold localProjection + cases contextAt S q with + | none => unfold trivial; split_ifs <;> simp_all + | some t => exact h_orthogonal t a b hab +lemma localProjection_complete (S : Eight) (q : Question) : + ∑ a, localProjection S q a=1 := by + unfold localProjection + cases contextAt S q with + | none => simp [trivial] + | some t => exact h_complete t +lemma localProjection_commute_same (S : Eight) (q : Question) (a b : Outcome) : + localProjection S q a*localProjection S q b= + localProjection S q b*localProjection S q a := by + by_cases he : a=b + · subst b; rfl + · rw [localProjection_orthogonal S q a b he,localProjection_orthogonal S q b a (Ne.symm he)] +lemma both_contexts_orthogonal (S : Eight) (q r : Question) (t v : Fin 6) + (hq : contextAt S q=some t) (hr : contextAt S r=some v) (hqr : q ≠ r) : + ProjectionCriterion.correlation u q r=0 := by + obtain ⟨hS,ht⟩ := contextAt_some S q t hq + obtain ⟨_,hv⟩ := contextAt_some S r v hr + apply hS q (ht ▸ six_mem S t) r (hv ▸ six_mem S v) hqr +lemma localProjection_commute (S : Eight) (q r : Question) (a b : Outcome) + (hc : ProjectionCriterion.correlation u q r ≠ 0) : + localProjection S q a*localProjection S r b= + localProjection S r b*localProjection S q a := by + by_cases hqr : q=r + · subst r; exact localProjection_commute_same S q a b + unfold localProjection + cases hq : contextAt S q with + | none => unfold trivial; split_ifs <;> simp + | some t => + cases hr : contextAt S r with + | none => unfold trivial; split_ifs <;> simp + | some v => exact (hc (both_contexts_orthogonal S q r t v hq hr hqr)).elim +end FiniteConstruction + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/CombinatorialMain.lean b/lean/OAI/InformationTheory/Entanglement/CombinatorialMain.lean new file mode 100644 index 0000000000000000000000000000000000000000..266f198e55d5fd80ab08a89471ae67065eca3266 --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/CombinatorialMain.lean @@ -0,0 +1,111 @@ +import OAI.InformationTheory.Entanglement.CombinatorialAssembly +import OAI.InformationTheory.Entanglement.ProjectionReindex +import OAI.InformationTheory.Entanglement.ProjectionRealMain +import OAI.InformationTheory.Entanglement.ProjectionSquare +import OAI.Analysis.Quantum.PPTSquare.ChannelModel +import OAI.Analysis.Quantum.PPTSquare.TraceCompletion +import OAI.Analysis.Quantum.PPTSquare.Compression +import OAI.Analysis.Quantum.PPTSquare.ChannelCompletion + +namespace OAI + +noncomputable section +open scoped BigOperators ComplexOrder MatrixOrder Kronecker +open Matrix +namespace ProjectionCriterion.Data +variable {Q K D I D' I' : Type} [Fintype Q] [Fintype K] [Fintype D] [Fintype I] + [Fintype D'] [Fintype I'] [DecidableEq Q] [DecidableEq K] [DecidableEq D] + [DecidableEq I] [DecidableEq D'] [DecidableEq I'] +omit [DecidableEq K] [DecidableEq I'] in +lemma real_reindex (d : Data Q K D I) (eD : D' ≃ D) (eI : I' ≃ I) + (hr : d.RealProjections) : (d.reindex eD eI).RealProjections := + fun i a b => hr (eI i) (eD a) (eD b) +end ProjectionCriterion.Data +namespace FiniteConstruction +open ChannelCompletion TensorCriterion SecretKey ProjectionCriterion + +lemma Q_pos : 0 < Q := pow_pos b_pos 3 +lemma D_pos : 0 < D := pow_pos (by norm_num : (0:ℕ)<4) L +instance questionNonempty : Nonempty Question := + Fintype.card_pos_iff.mp (question_card.symm ▸ Q_pos) +instance dNeZero : NeZero D := ⟨ne_of_gt D_pos⟩ +lemma D_le_m : D ≤ m := by + have h : 1 ≤ Q := Q_pos + simpa only [m,one_mul] using (Nat.mul_le_mul_right D h : 1*D ≤ Q*D) + +def concreteData : ProjectionCriterion.Data Question Coordinate (Fin D) (Fin m) := + data.reindex outputEnumeration labelEnumeration +lemma data_real : data.RealProjections := by + intro i a b + change (P i a b).im=0 + have h := congrArg Complex.im (P_real i a b) + simp only [Complex.star_def,Complex.conj_im] at h + linarith +lemma concrete_real : concreteData.RealProjections := + ProjectionCriterion.Data.real_reindex data outputEnumeration labelEnumeration data_real + +def Psi : Map (Fin m) (Fin D) := concreteData.Psi +def Lambda : Map (Fin D) (Fin m) := hsAdjoint Psi +def localChannel : Map (Fin D) (Fin m) := concreteData.localChannel +def rho : Mat (Fin m × Fin m) := concreteData.rho +def Phi1 : Map (Fin m) (Fin m) := concreteData.Xi1 D_le_m +def Phi2 : Map (Fin m) (Fin m) := concreteData.Xi2 D_le_m +def Theta : Map (Space m) (Space m) := theta m Phi1 Phi2 + +lemma localChannel_exact : localChannel=((Q : ℂ)⁻¹) • Lambda := by + simp only [localChannel,ProjectionCriterion.Data.localChannel,question_card, + Complex.ofReal_inv,Complex.ofReal_natCast,Lambda,Psi] +lemma rho_exact : rho=((Q : ℂ)^2*(D : ℂ))⁻¹ • choi (Lambda.comp Psi) := by + simp only [rho,ProjectionCriterion.Data.rho,ProjectionCriterion.Data.C,question_card, + Fintype.card_fin,Complex.ofReal_inv,Complex.ofReal_mul,Complex.ofReal_pow, + Complex.ofReal_natCast,Lambda,Psi] +lemma Phi1_ppt : PPT Phi1 := concreteData.Xi1_ppt D_le_m +lemma Phi2_ppt : PPT Phi2 := concreteData.Xi2_ppt D_le_m +lemma pair_identification : choi (Phi2.comp Phi1)=((Q : ℂ)^2*(D : ℂ)) • rho := by + have hq : (Q : ℂ)≠0 := Nat.cast_ne_zero.mpr (ne_of_gt Q_pos) + have hd : (D : ℂ)≠0 := Nat.cast_ne_zero.mpr (ne_of_gt D_pos) + rw [rho_exact,smul_smul] + rw [mul_inv_cancel₀ (mul_ne_zero (pow_ne_zero _ hq) hd),one_smul] + exact congrArg choi (concreteData.Xi_composite D_le_m) +lemma composite_nonseparable : ¬ Separable (choi (Phi2.comp Phi1)) := by + change ¬ Separable (choi ((concreteData.Xi2 D_le_m).comp (concreteData.Xi1 D_le_m))) + rw [concreteData.Xi_composite D_le_m] + exact concreteData.C_nonseparable +lemma pair_not_eb : ¬ EntanglementBreaking (Phi2.comp Phi1) := concreteData.Xi_not_eb D_le_m +lemma theta_ppt : PPT Theta := ChannelCompletion.theta_ppt m Phi1_ppt Phi2_ppt +lemma theta_tp : TracePreserving Theta := theta_tracePreserving m Phi1 Phi2 +lemma theta_corner : + (W0 m ⊗ₖ W0 m)ᴴ*choi (Theta.comp Theta)*(W0 m ⊗ₖ W0 m)= + (((coefficient Phi1*coefficient Phi2 : ℝ) : ℂ)*((Q : ℂ)^2*(D : ℂ))) • rho := by + rw [Theta,choi_corner,pair_identification,smul_smul] +lemma theta_not_eb : ¬ EntanglementBreaking (Theta.comp Theta) := + (channel_completion m Phi1 Phi2 Phi1_ppt Phi2_ppt).2.2.2.2.2.2.2.2 composite_nonseparable + +theorem combinatorial_algebraic_clauses : + (κ : ℝ)<(Q : ℝ)/(K : ℝ) ∧ + PPT localChannel ∧ TracePreserving localChannel ∧ + rho=tensorMap localChannel localChannel (projector (ProjectionCriterion.Phi D)) ∧ + rho=((Q : ℂ)^2*(D : ℂ))⁻¹ • choi (Lambda.comp Psi) ∧ + rho.PosSemidef ∧ Matrix.trace rho=1 ∧ Represented rho ∧ ¬ Separable rho ∧ + PPT Phi1 ∧ PPT Phi2 ∧ Phi2=hsAdjoint Phi1 ∧ + choi (Phi2.comp Phi1)=((Q : ℂ)^2*(D : ℂ)) • rho ∧ + ¬ EntanglementBreaking (Phi2.comp Phi1) ∧ + 0 ⟨A.val,by simpa only [S,Finset.mem_filter,Finset.mem_powersetCard, + Finset.subset_univ,true_and,Finset.singleton_subset_iff] using A.property⟩ + invFun := fun A => ⟨A.val,by simpa only [S,Finset.mem_filter,Finset.mem_powersetCard, + Finset.subset_univ,true_and,Finset.singleton_subset_iff] using A.property⟩ + left_inv := fun A => rfl + right_inv := fun A => rfl } + rw [Fintype.card_congr e,Fintype.card_coe] + change S.card=b + dsimp only [S] + rw [Finset.card_filter_powersetCard_subset _ _ _ (Finset.subset_univ _) (by simp)] + simp only [Finset.card_univ,Fintype.card_fin,Finset.card_singleton,b] + +lemma b_pos : 0 < b := Nat.choose_pos (by decide) +lemma a₀_pos : 0 < a₀ := by + have he : 1 ≤ a₀ := by + have h := Finset.single_le_sum (fun j (_ : j ∈ Finset.range 257) => Nat.zero_le (Nat.choose 1028 j)) + (show 0 ∈ Finset.range 257 by simp) + simpa only [Nat.choose_zero_right,a₀] using h + omega + +lemma choose_le_of_le_half {n i j : ℕ} (hij : i ≤ j) (hj : j ≤ n/2) : + Nat.choose n i ≤ Nat.choose n j := by + induction hij with + | refl => rfl + | @step j hij ih => + exact (ih (by omega)).trans (Nat.choose_le_succ_of_lt_half_left (by omega)) + +lemma a₀_upper : a₀ ≤ 257*Nat.choose 1028 257 := by + calc + a₀ ≤ ∑ j ∈ Finset.range 257, Nat.choose 1028 257 := by + apply Finset.sum_le_sum + intro j hj + exact choose_le_of_le_half (by have := Finset.mem_range.mp hj; omega) (by decide) + _ = _ := by simp +lemma central_eq : Nat.choose 1028 514=2*b := by + have hs : Nat.choose 1027 514=Nat.choose 1027 513 := by + simpa only [show 1027-513=514 by rfl] using Nat.choose_symm (show 513≤1027 by decide) + change Nat.choose (1027+1) (513+1)=_ + rw [Nat.choose_succ_succ,hs] + unfold b + omega +lemma b_lower : 2^1027 ≤ 1029*b := by + have hs : 2^1028 ≤ 1029*(2*b) := by + rw [← Nat.sum_range_choose 1028] + calc + _ ≤ ∑ j ∈ Finset.range 1029, Nat.choose 1028 514 := by + apply Finset.sum_le_sum + intro j _ + exact Nat.choose_le_middle j 1028 + _ = _ := by simp only [Finset.sum_const,Finset.card_range,nsmul_eq_mul,central_eq,Nat.cast_id] + have hp : (2 : ℕ)^1028=2*2^1027 := by rw [show 1028=1027+1 by rfl,pow_succ,mul_comm] + rw [hp] at hs + omega +lemma binomial_term : Nat.choose 1028 257*3^771 ≤ 4^1028 := by + have hs := Finset.single_le_sum + (fun j (_ : j ∈ Finset.range (1028+1)) => Nat.zero_le ((1:ℕ)^j*3^(1028-j)*Nat.choose 1028 j)) + (show 257 ∈ Finset.range (1028+1) by simp) + have he : (∑ j ∈ Finset.range (1028+1), (1:ℕ)^j*3^(1028-j)*Nat.choose 1028 j)=4^1028 := by + simpa only [Nat.cast_id, show (1 : ℕ)+3=4 by rfl] using + (add_pow (1 : ℕ) 3 1028).symm + rw [he] at hs + simpa only [one_pow,one_mul,show 1028-257=771 by rfl,show (1:ℕ)+3=4 by rfl,mul_comm] + using hs +lemma arithmetic_gap : 3*1086373952*257*1029*4^1028 < 2^1027*3^771 := by + rw [show 1028=128*8+4 by rfl,show 1027=128*8+3 by rfl, + show 771=128*6+3 by rfl] + simp only [pow_add,pow_mul] + norm_num +lemma a₀_scaled_bound : a₀*3^771 ≤ 257*4^1028 := by + calc + _ ≤ (257*Nat.choose 1028 257)*3^771 := Nat.mul_le_mul_right _ a₀_upper + _ = 257*(Nat.choose 1028 257*3^771) := mul_assoc _ _ _ + _ ≤ _ := Nat.mul_le_mul_left _ binomial_term +lemma strict_natural_gap : 3*K*a₀ < b := by + have gap (smallBound largeBound coefficient powerTwo powerThree powerFour : ℕ) + (positive : 0 < 1029*powerThree) + (small : smallBound*powerThree ≤ 257*powerFour) + (large : powerTwo ≤ 1029*largeBound) + (arithmetic : 3*coefficient*257*1029*powerFour < powerTwo*powerThree) : + 3*coefficient*smallBound < largeBound := by + apply (Nat.mul_lt_mul_right positive).mp + calc + (3*coefficient*smallBound)*(1029*powerThree) = + 3*coefficient*1029*(smallBound*powerThree) := by ring + _ ≤ 3*coefficient*1029*(257*powerFour) := Nat.mul_le_mul_left _ small + _ = 3*coefficient*257*1029*powerFour := by ring + _ < powerTwo*powerThree := arithmetic + _ ≤ (1029*largeBound)*powerThree := Nat.mul_le_mul_right _ large + _ = largeBound*(1029*powerThree) := by ring + exact gap a₀ b K (2^1027) (3^771) (4^1028) (by positivity) + a₀_scaled_bound b_lower (by unfold K; exact arithmetic_gap) +lemma strict_gap : (κ : ℝ) < (Q : ℝ)/(K : ℝ) := by + have hb : 0 < (b : ℝ) := Nat.cast_pos.mpr b_pos + have hk : 0 < (K : ℝ) := by norm_num [K] + have hn : 3*(K : ℝ)*(a₀ : ℝ) < b := by exact_mod_cast strict_natural_gap + have hh := mul_lt_mul_of_pos_right hn (sq_pos_of_pos hb) + rw [lt_div_iff₀ hk] + dsimp [κ,Q] + push_cast + nlinarith +end FiniteConstruction + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/CombinatorialOrder.lean b/lean/OAI/InformationTheory/Entanglement/CombinatorialOrder.lean new file mode 100644 index 0000000000000000000000000000000000000000..bb91bb5ef502d5836a4a0d93d4f30df329733bc4 --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/CombinatorialOrder.lean @@ -0,0 +1,116 @@ +import OAI.InformationTheory.Entanglement.CombinatorialQuestions +import OAI.InformationTheory.Entanglement.ParityData + +namespace OAI + +noncomputable section +open scoped BigOperators +namespace FiniteConstruction + +instance baseLinearOrder : LinearOrder Base := LinearOrder.lift' + (fun A => A.val.sort (· ≤ ·)) (by + intro A B h + apply Subtype.ext + have he := congrArg List.toFinset h + simpa only [Finset.sort_toFinset] using he) +instance (priority := 2000) baseLE : LE Base := baseLinearOrder.toLE +instance (priority := 2000) baseLT : LT Base := baseLinearOrder.toLT + +instance questionLinearOrder : LinearOrder Question := LinearOrder.lift' + (fun q => [q.1,q.2.1,q.2.2]) (by + intro q r h + simp only [List.cons.injEq,and_true] at h + exact Prod.ext h.1 (Prod.ext h.2.1 h.2.2)) + +instance (priority := 2000) questionLE : LE Question := questionLinearOrder.toLE +instance (priority := 2000) questionLT : LT Question := questionLinearOrder.toLT +abbrev Eight := {S : Finset Question // S.card=8} +instance eightLinearOrder : LinearOrder Eight := LinearOrder.lift' + (fun S => S.val.sort (· ≤ ·)) (by + intro S T h + apply Subtype.ext + have he := congrArg List.toFinset h + simpa only [Finset.sort_toFinset] using he) +instance (priority := 2000) eightLE : LE Eight := eightLinearOrder.toLE +instance (priority := 2000) eightLT : LT Eight := eightLinearOrder.toLT +lemma eight_card : Fintype.card Eight=L := by + rw [L_def,Fintype.card_finset_len,question_card] + +def six (S : Eight) (t : Fin 6) : Question := + S.val.orderEmbOfFin S.property (Fin.castLE (by decide) t) +lemma six_mem (S : Eight) (t : Fin 6) : six S t ∈ S.val := + S.val.orderEmbOfFin_mem S.property _ +lemma six_injective (S : Eight) : Function.Injective (six S) := + (S.val.orderEmbOfFin S.property).injective.comp (Fin.castLE_injective (by decide)) + +def OrthogonalEight (S : Eight) : Prop := + Clique (fun q r => ProjectionCriterion.correlation u q r=0) S.val + +def contextAt (S : Eight) (q : Question) : Option (Fin 6) := by + classical + exact if OrthogonalEight S then + if h : ∃ t, six S t=q then some (Classical.choose h) else none + else none +lemma contextAt_six (S : Eight) (hS : OrthogonalEight S) (t : Fin 6) : + contextAt S (six S t)=some t := by + unfold contextAt + rw [ite_eq_left hS,dite_eq_left (show ∃ t', six S t'=six S t from ⟨t,rfl⟩)] + congr 1 + exact six_injective S (Classical.choose_spec (show ∃ t', six S t'=six S t from ⟨t,rfl⟩)) +lemma contextAt_some (S : Eight) (q : Question) (t : Fin 6) + (ht : contextAt S q=some t) : OrthogonalEight S ∧ six S t=q := by + unfold contextAt at ht + split_ifs at ht with ho he + · have heq := Option.some.inj ht + refine ⟨ho,?_⟩ + rw [← heq] + exact Classical.choose_spec he + +abbrev OutputCoordinate := Eight → Four +abbrev Label := Question × (Eight → Outcome) +lemma four_card : Fintype.card Four=4 := rfl +lemma outcome_card : Fintype.card Outcome=4 := rfl +attribute [local irreducible] L Q b +lemma card_arrow_eq {α β : Type} [Fintype α] [Fintype β] [DecidableEq α] + {a b : ℕ} (ha : Fintype.card α=a) (hb : Fintype.card β=b) : + Fintype.card (α → β)=b^a := by rw [Fintype.card_fun,ha,hb] +lemma card_pair_eq {α β : Type} [Fintype α] [Fintype β] + {a b : ℕ} (ha : Fintype.card α=a) (hb : Fintype.card β=b) : + Fintype.card (α × β)=a*b := by rw [Fintype.card_prod,ha,hb] +lemma output_card : Fintype.card OutputCoordinate=D := by + have he := card_arrow_eq eight_card four_card + exact he +lemma outcomeString_card : Fintype.card (Eight → Outcome)=D := by + have he := card_arrow_eq eight_card outcome_card + exact he +lemma label_card : Fintype.card Label=m := by + have he := card_pair_eq question_card outcomeString_card + exact he + +instance fourLinearOrder : LinearOrder Four := + LinearOrder.lift' (toLex : Four ≃ Lex Four) toLex.injective +instance (priority := 2000) fourLE : LE Four := fourLinearOrder.toLE +instance (priority := 2000) fourLT : LT Four := fourLinearOrder.toLT +instance eightWellFounded : @WellFoundedLT Eight eightLinearOrder.toLT := + @Finite.to_wellFoundedLT Eight inferInstance eightLinearOrder.toPreorder + +instance outputLinearOrder : LinearOrder OutputCoordinate := + LinearOrder.lift' (toLex : OutputCoordinate ≃ Lex OutputCoordinate) toLex.injective +instance labelLinearOrder : LinearOrder Label := + LinearOrder.lift' (toLex : Label ≃ Lex Label) toLex.injective + +def orderedEnumeration {τ : Type} [Fintype τ] [LinearOrder τ] {n : ℕ} + (hc : Fintype.card τ=n) : Fin n ≃ τ := + ((Finset.univ : Finset τ).orderIsoOfFin (by simpa using hc)).toEquiv.trans + { toFun := Subtype.val + invFun := fun x => ⟨x,Finset.mem_univ x⟩ + left_inv := fun x => by cases x; rfl + right_inv := fun x => rfl } +def outputEnumeration : Fin D ≃ OutputCoordinate := orderedEnumeration output_card +def labelEnumeration : Fin m ≃ Label := orderedEnumeration label_card + +end FiniteConstruction + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/CombinatorialQuestions.lean b/lean/OAI/InformationTheory/Entanglement/CombinatorialQuestions.lean new file mode 100644 index 0000000000000000000000000000000000000000..9209ed0cfff5c744cc9679a77680fee2e242898f --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/CombinatorialQuestions.lean @@ -0,0 +1,105 @@ +import OAI.InformationTheory.Entanglement.CombinatorialNumbers +import OAI.InformationTheory.Entanglement.FiberBound +import OAI.InformationTheory.Entanglement.ProjectionData + +namespace OAI + +noncomputable section +open scoped BigOperators +namespace FiniteConstruction + +abbrev Question := Base × (Base × Base) +abbrev Coordinate := Fin 1028 × (Fin 1028 × Fin 1028) +def sign (A : Base) (i : Fin 1028) : ℝ := if i ∈ A.val then 1 else -1 +def s (A : Base) (i : Fin 1028) : ℝ := sign A i / Real.sqrt 1028 +def u (q : Question) (i : Coordinate) : ℝ := s q.1 i.1 * (s q.2.1 i.2.1 * s q.2.2 i.2.2) +def baseOrth (A B : Base) : Prop := (A.val ∩ B.val).card = 257 +lemma baseOrth_symm : ∀ ⦃left right⦄, baseOrth left right → baseOrth right left := by + intro A B h + simpa only [baseOrth,Finset.inter_comm] using h +lemma sign_sum (A B : Base) : + ∑ i, sign A i * sign B i = 4*((A.val ∩ B.val).card : ℝ)-1028 := by + have he (i : Fin 1028) : sign A i* sign B i= + 4*(if i ∈ A.val ∩ B.val then (1:ℝ) else 0)- + 2*(if i ∈ A.val then (1:ℝ) else 0)- + 2*(if i ∈ B.val then (1:ℝ) else 0)+1 := by + by_cases ha : i ∈ A.val <;> by_cases hb : i ∈ B.val <;> norm_num [sign,ha,hb] + simp_rw [he] + simp only [Finset.sum_add_distrib,Finset.sum_sub_distrib,← Finset.mul_sum] + have hi (T : Finset (Fin 1028)) : + (∑ i : Fin 1028, if i ∈ T then (1:ℝ) else 0)=(T.card : ℝ) := by + simp only [Finset.sum_ite_mem,Finset.univ_inter,Finset.sum_const, + nsmul_eq_mul,mul_one] + rw [hi,hi,hi,A.property.1,B.property.1] + simp only [Finset.sum_const,Finset.card_univ,Fintype.card_fin,nsmul_eq_mul,mul_one] + norm_num +lemma base_gram (A B : Base) : + ∑ i, s A i*s B i = ((A.val ∩ B.val).card : ℝ)/257-1 := by + have hs : (Real.sqrt 1028)^2=(1028:ℝ) := Real.sq_sqrt (by norm_num) + calc + _ = (∑ i, sign A i*sign B i)/(Real.sqrt 1028)^2 := by + simp only [s,div_mul_div_comm,← pow_two,Finset.sum_div] + _ = _ := by rw [sign_sum,hs]; ring +lemma base_unit (A : Base) : ∑ i, s A i*s A i=1 := by + rw [base_gram,Finset.inter_self,A.property.1] + norm_num +lemma question_gram (q r : Question) : + ProjectionCriterion.correlation u q r= + (((q.1.val ∩ r.1.val).card : ℝ)/257-1)* + ((((q.2.1.val ∩ r.2.1.val).card : ℝ)/257-1)* + (((q.2.2.val ∩ r.2.2.val).card : ℝ)/257-1)) := by + unfold ProjectionCriterion.correlation u + simp only [Fintype.sum_prod_type] + conv_lhs => arg 2; intro a; arg 2; intro b; arg 2; intro c; rw [show + s q.1 a*(s q.2.1 b*s q.2.2 c)*(s r.1 a*(s r.2.1 b*s r.2.2 c))= + (s q.1 a*s r.1 a)*((s q.2.1 b*s r.2.1 b)*(s q.2.2 c*s r.2.2 c)) by ring] + simp only [← Finset.mul_sum,← Finset.sum_mul,base_gram] +lemma question_unit (q : Question) : ∑ i, u q i*u q i=1 := by + change ProjectionCriterion.correlation u q q=1 + rw [question_gram] + simp only [Finset.inter_self,q.1.property.1,q.2.1.property.1,q.2.2.property.1] + norm_num +lemma question_card : Fintype.card Question=Q := by + simp only [Question,Fintype.card_prod,base_card,Q] + ring +lemma coordinate_card : Fintype.card Coordinate=K := by norm_num [Coordinate,K] +lemma base_gram_zero_iff (A B : Base) : + ((A.val ∩ B.val).card : ℝ)/257-1=0 ↔ baseOrth A B := by + unfold baseOrth + constructor + · intro h + have he : ((A.val ∩ B.val).card : ℝ)=257 := by linarith + exact_mod_cast he + · intro h + rw [h] + norm_num +lemma question_orth_iff (q r : Question) : + ProjectionCriterion.correlation u q r=0 ↔ + orRelation baseOrth (orRelation baseOrth baseOrth) q r := by + rw [question_gram] + simp only [mul_eq_zero,base_gram_zero_iff,orRelation] +lemma no_orthogonal_eight_bound (J : Finset Question) + (hJ : ¬ HasClique (fun q r => ProjectionCriterion.correlation u q r=0) J 8) : + J.card ≤ κ := by + have hbase (G : Finset Base) + (hG : ∀ x ∈ G, ∀ y ∈ G, x ≠ y → ¬ baseOrth x y) : G.card ≤ a₀ := + restricted_intersections G hG + have htwo (U : Finset Base) (hU : ¬ HasClique baseOrth U 2) : U.card ≤ a₀ := + hbase U (no_pair_of_no_clique_two baseOrth_symm hU) + have hfour (U : Finset (Base × Base)) + (hU : ¬ HasClique (orRelation baseOrth baseOrth) U 4) : U.card ≤ 2*a₀*b := by + have hh := amplification_bound baseOrth_symm a₀ a₀ 2 hbase htwo U hU + simpa only [base_card,show a₀*b+b*a₀=2*a₀*b by ring] using hh + have he : ¬ HasClique (orRelation baseOrth (orRelation baseOrth baseOrth)) J (2*4) := by + intro hh + apply hJ + obtain ⟨T,hT,cT,pT⟩ := hh + exact ⟨T,hT,cT,fun q hq r hr hqr => (question_orth_iff q r).mpr (pT q hq r hr hqr)⟩ + have hh := amplification_bound baseOrth_symm a₀ (2*a₀*b) 4 hbase hfour J he + simpa only [Fintype.card_prod,base_card,κ,show a₀*(b*b)+b*(2*a₀*b)=3*a₀*b^2 by ring] using hh + +end FiniteConstruction + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/ConditionalUpdate.lean b/lean/OAI/InformationTheory/Entanglement/ConditionalUpdate.lean new file mode 100644 index 0000000000000000000000000000000000000000..7303693876b61bdd782dbfc16e73a60783d022be --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/ConditionalUpdate.lean @@ -0,0 +1,187 @@ +import OAI.InformationTheory.Entanglement.TranscriptLimit + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory Filter Set +open scoped MeasureTheory ProbabilityTheory Topology +namespace SecretKey +variable {Ω : Type*} {mΩ : MeasurableSpace Ω} + +lemma setIntegral_eq_on_generated {μ : Measure Ω} {F : MeasurableSpace Ω} + (hF : F ≤ mΩ) {p : Set (Set Ω)} (hp : IsPiSystem p) + (hgen : F=MeasurableSpace.generateFrom p) {f g : Ω → ℝ} + (hf : Integrable f μ) (hg : Integrable g μ) + (huniv : (∫ x, f x ∂μ)=(∫ x, g x ∂μ)) + (hbasic : ∀ s∈p, (∫ x in s, f x ∂μ)=(∫ x in s, g x ∂μ)) : + ∀ s, MeasurableSet[F] s → (∫ x in s, f x ∂μ)=(∫ x in s, g x ∂μ) := by + apply @MeasurableSpace.induction_on_inter Ω F + (fun s _ => (∫ x in s, f x ∂μ)=(∫ x in s, g x ∂μ)) p hgen hp + · simp + · exact hbasic + · intro s hs heq + have ha := integral_add_compl (hF s hs) hf + have hb := integral_add_compl (hF s hs) hg + linarith + · intro s hd hs heq + rw [integral_iUnion (fun i => hF _ (hs i)) hd hf.integrableOn, + integral_iUnion (fun i => hF _ (hs i)) hd hg.integrableOn] + exact tsum_congr heq + +def joinTests (A F : MeasurableSpace Ω) : Set (Set Ω) := + {s | ∃ a t, MeasurableSet[A] a ∧ MeasurableSet[F] t ∧ s=a∩t} +lemma joinTests_pi (A F : MeasurableSpace Ω) : IsPiSystem (joinTests A F) := by + rintro s ⟨a,t,ha,ht,rfl⟩ u ⟨b,v,hb,hv,rfl⟩ _ + refine ⟨a∩b,t∩v,ha.inter hb,ht.inter hv,?_⟩ + ext x + simp only [mem_inter_iff] + tauto +lemma joinTests_generate (A F : MeasurableSpace Ω) : + A ⊔ F=MeasurableSpace.generateFrom (joinTests A F) := by + apply le_antisymm + · apply sup_le + · intro s hs + exact MeasurableSpace.measurableSet_generateFrom + ⟨s,Set.univ,hs,MeasurableSet.univ,(Set.inter_univ s).symm⟩ + · intro s hs + exact MeasurableSpace.measurableSet_generateFrom + ⟨Set.univ,s,MeasurableSet.univ,hs,(Set.univ_inter s).symm⟩ + · apply MeasurableSpace.generateFrom_le + rintro s ⟨a,t,ha,ht,rfl⟩ + exact ((le_sup_left : A ≤ A ⊔ F) _ ha).inter ((le_sup_right : F ≤ A ⊔ F) _ ht) + +variable [standardBorel : StandardBorelSpace Ω] {μ : Measure Ω} [IsFiniteMeasure μ] +variable {F A B : MeasurableSpace Ω} (hF : F ≤ mΩ) (hA : A ≤ mΩ) (hB : B ≤ mΩ) +lemma indicator_one_mul (s : Set Ω) (f : Ω → ℝ) : s.indicator 1*f=s.indicator f := by + ext x + by_cases hx : x∈s <;> simp [hx] +omit standardBorel in +lemma integrable_indicator_one (s : Set Ω) (hs : MeasurableSet[mΩ] s) : + Integrable (s.indicator (1 : Ω → ℝ)) μ := (integrable_const _).indicator hs +include hA hB in + +theorem conditional_marginal_join (hind : CondIndep F A B hF μ) + {b : Set Ω} (hb : MeasurableSet[B] b) : + (μ⟦b | F⟧) =ᵐ[μ] (μ⟦b | A ⊔ F⟧) := by + have hAF : A ⊔ F ≤ mΩ := sup_le hA hF + have hbi := integrable_indicator_one (μ := μ) b (hB b hb) + apply ae_eq_condExp_of_forall_setIntegral_eq hAF hbi + · intro s hs _ + exact integrable_condExp.integrableOn + · intro s hs _ + apply setIntegral_eq_on_generated hAF (joinTests_pi A F) (joinTests_generate A F) + integrable_condExp hbi (integral_condExp hF) _ s hs + rintro u ⟨a,t,ha,ht,rfl⟩ + have hai := integrable_indicator_one (μ := μ) a (hA a ha) + have hprod : Integrable (a.indicator (1 : Ω → ℝ) * (μ⟦b | F⟧)) μ := by + rw [indicator_one_mul] + exact integrable_condExp.indicator (hA a ha) + have he := condExp_mul_of_stronglyMeasurable_right + (stronglyMeasurable_condExp (m := F)) hprod hai + have hi := (condIndep_iff F A B hF hA hB μ).mp hind a b ha hb + have heq : μ[a.indicator (1 : Ω → ℝ) * (μ⟦b | F⟧) | F] =ᵐ[μ] (μ⟦a∩b | F⟧) := he.trans hi.symm + have hh := setIntegral_congr_ae (hF t ht) (heq.mono (fun x hx _ => hx)) + have habi : Integrable ((a∩b).indicator (fun _ => (1 : ℝ))) μ := + (integrable_const _).indicator ((hA a ha).inter (hB b hb)) + rw [setIntegral_condExp hF hprod ht,setIntegral_condExp hF habi ht] at hh + change (∫ x in t, (a.indicator (1 : Ω → ℝ) * (μ⟦b | F⟧)) x ∂μ)= + (∫ x in t, (a∩b).indicator (1 : Ω → ℝ) x ∂μ) at hh + rw [indicator_one_mul,setIntegral_indicator (hA a ha)] at hh + rw [show (a∩b).indicator (1 : Ω → ℝ)=a.indicator (b.indicator (1 : Ω → ℝ)) by + ext x; by_cases hxa : x∈a <;> by_cases hxb : x∈b <;> simp [hxa,hxb], + setIntegral_indicator (hA a ha)] at hh + simpa only [Set.inter_comm t a, Pi.one_def] using hh + · exact (stronglyMeasurable_condExp (m := F) (μ := μ) (f := b.indicator (fun _ => (1 : ℝ)))).mono + (show F ≤ A ⊔ F from le_sup_right) |>.aestronglyMeasurable + +omit standardBorel in +lemma conditional_inter_pullout {H : MeasurableSpace Ω} (hH : H ≤ mΩ) + {a b : Set Ω} (ha : MeasurableSet[H] a) (hb : MeasurableSet[mΩ] b) : + (μ⟦a∩b | H⟧) =ᵐ[μ] a.indicator (1 : Ω → ℝ) * (μ⟦b | H⟧) := by + change μ[(a∩b).indicator (1 : Ω → ℝ) | H] =ᵐ[μ] _ + rw [Set.inter_indicator_one] + apply condExp_mul_of_stronglyMeasurable_left + (stronglyMeasurable_const.indicator ha) + · change Integrable (a.indicator (1 : Ω → ℝ) * b.indicator (1 : Ω → ℝ)) μ + rw [← Set.inter_indicator_one] + exact integrable_indicator_one (a∩b) ((hH a ha).inter hb) + · exact integrable_indicator_one b hb + +lemma independence_of_local_marginals {D H : MeasurableSpace Ω} + (hD : D ≤ mΩ) (hH : H ≤ mΩ) (hAH : A ≤ H) (hDH : D ≤ H) + (hB : B ≤ mΩ) + (hmar : ∀ b, MeasurableSet[B] b → (μ⟦b | H⟧)=ᵐ[μ](μ⟦b | D⟧)) : + CondIndep D A B hD μ := by + rw [condIndep_iff D A B hD (hAH.trans hH) hB μ] + intro a b ha hb + have hb' := hB b hb + have hai := integrable_indicator_one (μ := μ) a (hH a (hAH a ha)) + have he0 := conditional_inter_pullout (μ := μ) hH (hAH a ha) hb' + have he1 : (μ⟦a∩b | H⟧)=ᵐ[μ] a.indicator (1 : Ω → ℝ)*(μ⟦b | D⟧) := + he0.trans (Filter.EventuallyEq.rfl.mul (hmar b hb)) + have he2 := (condExp_condExp_of_le (μ := μ) (f := (a∩b).indicator (fun _ =>(1 : ℝ))) hDH hH).symm.trans + (condExp_congr_ae (m := D) he1) + have hp : Integrable (a.indicator (1 : Ω → ℝ) * (μ⟦b | D⟧)) μ := by + rw [indicator_one_mul] + exact integrable_condExp.indicator (hH a (hAH a ha)) + exact he2.trans (condExp_mul_of_stronglyMeasurable_right stronglyMeasurable_condExp hp hai) + +include hA hB in + +theorem sender_message_preserves_independence (hind : CondIndep F A B hF μ) + {D : MeasurableSpace Ω} (hFD : F ≤ D) (hDA : D ≤ A ⊔ F) : + CondIndep D A B (hDA.trans (sup_le hA hF)) μ := by + have hAF : A ⊔ F ≤ mΩ := sup_le hA hF + have hD : D ≤ mΩ := hDA.trans hAF + apply independence_of_local_marginals hD hAF le_sup_left hDA hB + intro b hb + have he := conditional_marginal_join hF hA hB hind hb + have hm : StronglyMeasurable[D] (μ⟦b | F⟧) := + stronglyMeasurable_condExp.mono hFD + have he' := condExp_congr_ae (m := D) he + rw [condExp_of_stronglyMeasurable hD hm integrable_condExp] at he' + exact he.symm.trans (he'.trans (condExp_condExp_of_le hDA hAF)) + +include hA hB in + +theorem public_source_preserves_independence (hind : CondIndep F A B hF μ) + {C : MeasurableSpace Ω} (hC : C ≤ mΩ) + (hsource : CondIndep F C (A ⊔ B) hF μ) : + CondIndep (C ⊔ F) A B (sup_le hC hF) μ := by + rw [condIndep_iff (C ⊔ F) A B (sup_le hC hF) hA hB μ] + intro a b ha hb + have hj := conditional_marginal_join hF hC (sup_le hA hB) hsource + (((le_sup_left : A ≤ A ⊔ B) _ ha).inter ((le_sup_right : B ≤ A ⊔ B) _ hb)) + have hma := conditional_marginal_join hF hC (sup_le hA hB) hsource + ((le_sup_left : A ≤ A ⊔ B) _ ha) + have hmb := conditional_marginal_join hF hC (sup_le hA hB) hsource + ((le_sup_right : B ≤ A ⊔ B) _ hb) + exact hj.symm.trans (((condIndep_iff F A B hF hA hB μ).mp hind a b ha hb).trans + (hma.mul hmb)) +include hA hB in + +theorem conditional_independence_adjoin_public (hind : CondIndep F A B hF μ) : + CondIndep F (A ⊔ F) (B ⊔ F) hF μ := by + have hleft : CondIndep F (A ⊔ F) B hF μ := by + apply independence_of_local_marginals hF (sup_le hA hF) le_rfl le_sup_right hB + intro b hb + exact (conditional_marginal_join hF hA hB hind hb).symm + apply CondIndep.symm + apply independence_of_local_marginals hF (sup_le hB hF) le_rfl le_sup_right (sup_le hA hF) + intro a ha + exact (conditional_marginal_join hF hB (sup_le hA hF) hleft.symm ha).symm + +lemma independent_of_public_conditional_laws {H : MeasurableSpace Ω} + (hH : H ≤ mΩ) (hFH : F ≤ H) (hAH : A ≤ H) (hB : B ≤ mΩ) + (hkernel : ∀ b, MeasurableSet[B] b → AEStronglyMeasurable[F] (μ⟦b | H⟧) μ) : + CondIndep F A B hF μ := by + apply independence_of_local_marginals hF hH hAH hFH hB + intro b hb + exact (condExp_of_aestronglyMeasurable' hF (hkernel b hb) integrable_condExp).symm.trans + (condExp_condExp_of_le hFH hH) + +end SecretKey + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/ConditionedLaw.lean b/lean/OAI/InformationTheory/Entanglement/ConditionedLaw.lean new file mode 100644 index 0000000000000000000000000000000000000000..b1fa773b310a355d0dc9a00d49295d4f7f50ab78 --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/ConditionedLaw.lean @@ -0,0 +1,89 @@ +import OAI.InformationTheory.Entanglement.FactorizedLawGap +import OAI.InformationTheory.Entanglement.DefaultNull + +namespace OAI + +noncomputable section +open MeasureTheory Matrix Filter +open scoped BigOperators ComplexOrder MatrixOrder MeasureTheory Kronecker +namespace SecretKey +open ChannelCompletion +variable {T : Type*} [MeasurableSpace T] {n m : Type} [Fintype n] [Fintype m] + [DecidableEq n] [DecidableEq m] +namespace PositiveMatrixMeasure + +def restrict (W : PositiveMatrixMeasure T n) (A : Set T) : PositiveMatrixMeasure T n where + entry i j := (W.entry i j).restrict A + positive s hs := by + by_cases hA : MeasurableSet A + · simpa only [VectorMeasure.restrict_apply _ hA hs] using W.positive (s∩A) (hs.inter hA) + · simp only [VectorMeasure.restrict_not_measurable _ hA] + exact Matrix.PosSemidef.zero +omit [DecidableEq n] in +lemma restrict_value (W : PositiveMatrixMeasure T n) {A s : Set T} + (hA : MeasurableSet A) (hs : MeasurableSet s) : (W.restrict A).value s=W.value (s∩A) := by + ext i j + exact VectorMeasure.restrict_apply _ hA hs + +def scale (W : PositiveMatrixMeasure T n) (c : ℝ) (hc : 0≤c) : PositiveMatrixMeasure T n where + entry i j := (c : ℂ) • W.entry i j + positive s hs := by + change ((c : ℂ) • W.value s).PosSemidef + exact (W.positive s hs).smul (by exact_mod_cast hc) +omit [DecidableEq n] in +lemma scale_value (W : PositiveMatrixMeasure T n) (c : ℝ) (hc : 0≤c) (s : Set T) : + (W.scale c hc).value s=(c : ℂ) • W.value s := rfl +end PositiveMatrixMeasure + +def publicMass (W : Fin 2 → Fin 2 → PositiveMatrixMeasure T n) (A : Set T) : ℝ := + ∑ i, ∑ j, (Matrix.trace ((W i j).value A)).re +def conditionedBlocks (W : Fin 2 → Fin 2 → PositiveMatrixMeasure T n) (A : Set T) + (hr : 0 ((W i j).restrict A).scale (publicMass W A)⁻¹ (inv_nonneg.mpr hr.le) +omit [DecidableEq n] in +lemma conditionedBlocks_normalized (W : Fin 2 → Fin 2 → PositiveMatrixMeasure T n) + {A : Set T} (hA : MeasurableSet A) (hr : 0 eveBlock R (X i t ⊗ₖ Y j t) a b) μ) + (hDs : ∀ i j s, MeasurableSet s → ∀ a b, + (∫ t in s, eveBlock R (X i t ⊗ₖ Y j t) a b ∂μ)=(W i j).value s a b) + (A : Set T) (hA : MeasurableSet A) (hr : 0 (c : ℂ) • X i t + have he (i j t) : eveBlock R (X' i t ⊗ₖ Y j t)=(c : ℂ) • eveBlock R (X i t ⊗ₖ Y j t) := by + change eveBlock R (((c : ℂ) • X i t) ⊗ₖ Y j t) = _ + rw [Matrix.smul_kronecker,eveBlock_smul] + apply factorized_law_gap R hR (conditionedBlocks W A hr) σ (μ.restrict A) X' Y + (fun i => (measurable_const (a := (c : ℂ))).smul (hXm i)) hYm + (fun i t => (hXp i t).smul (by exact_mod_cast hc)) hYp + · intro i j a b + simp only [he,Matrix.smul_apply,smul_eq_mul] + exact ((hDi i j a b).integrableOn).const_mul _ + · intro i j s hs a b + simp only [he,Matrix.smul_apply,smul_eq_mul,integral_const_mul] + rw [Measure.restrict_restrict hs,hDs i j (s∩A) (hs.inter hA)] + simp only [conditionedBlocks,PositiveMatrixMeasure.scale_value, + PositiveMatrixMeasure.restrict_value _ hA hs,Matrix.smul_apply,smul_eq_mul,c] + · exact conditionedBlocks_normalized W hA hr + · exact hσ1 + +end SecretKey + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/CorrelationBound.lean b/lean/OAI/InformationTheory/Entanglement/CorrelationBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..7f9f48da8e26376b9715d97e019b9d7f69122fb4 --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/CorrelationBound.lean @@ -0,0 +1,63 @@ +import OAI.InformationTheory.Entanglement.ProjectionData + +namespace OAI + +noncomputable section +open scoped BigOperators +open Matrix +namespace ProjectionCriterion +variable {Q K : Type} [Fintype Q] [Fintype K] + +lemma symmetric_trace_square (M : Matrix K K ℝ) (hM : Mᵀ=M) : + Matrix.trace (M*M) = ∑ a, ∑ b, (M a b)^2 := by + change (∑ a, ∑ b, M a b*M b a) = _ + apply Finset.sum_congr rfl + intro a _ + apply Finset.sum_congr rfl + intro b _ + have he : M b a=M a b := congrArg (fun N : Matrix K K ℝ => N a b) hM + rw [he,pow_two] + +lemma trace_square_lower [DecidableEq K] (M : Matrix K K ℝ) (hM : Mᵀ=M) : + (Matrix.trace M)^2 ≤ (Fintype.card K : ℝ)*Matrix.trace (M*M) := by + have hc := Finset.sum_mul_sq_le_sq_mul_sq Finset.univ + (fun _ : K => (1 : ℝ)) (fun a => M a a) + simp only [one_mul,one_pow,Finset.sum_const,Finset.card_univ,nsmul_eq_mul,mul_one] at hc + change (Matrix.trace M)^2 ≤ (Fintype.card K : ℝ)*(∑ a, (M a a)^2) at hc + have hs : (∑ a, (M a a)^2) ≤ ∑ a, ∑ b, (M a b)^2 := by + apply Finset.sum_le_sum + intro a _ + exact Finset.single_le_sum (fun b _ => sq_nonneg (M a b)) (Finset.mem_univ a) + rw [symmetric_trace_square M hM] + exact hc.trans (mul_le_mul_of_nonneg_left hs (Nat.cast_nonneg _)) + +theorem correlation_lower [DecidableEq K] [Nonempty K] (u : Q → K → ℝ) + (hu : ∀ q, ∑ a, u q a*u q a=1) : + (Fintype.card Q : ℝ)^2/(Fintype.card K : ℝ) ≤ + ∑ q, ∑ r, (correlation u q r)^2 := by + let U : Matrix Q K ℝ := u + let M := Uᵀ*U + let G := U*Uᵀ + have hm : Mᵀ=M := by simp [M,Matrix.transpose_mul] + have hg : Gᵀ=G := by simp [G,Matrix.transpose_mul] + have ht : Matrix.trace M=(Fintype.card Q : ℝ) := by + rw [show M=Uᵀ*U from rfl,Matrix.trace_mul_comm] + change (∑ q, ∑ a, u q a*u q a) = _ + simp only [hu,Finset.sum_const,Finset.card_univ,nsmul_eq_mul,mul_one] + have hsq : Matrix.trace (M*M)=Matrix.trace (G*G) := by + dsimp only [M,G] + calc + Matrix.trace (Uᵀ*U*(Uᵀ*U)) = Matrix.trace (Uᵀ*(U*Uᵀ)*U) := by simp only [Matrix.mul_assoc] + _ = Matrix.trace (U*Uᵀ*(U*Uᵀ)) := Matrix.trace_mul_cycle _ _ _ + have hc := trace_square_lower M hm + rw [ht,hsq,symmetric_trace_square G hg] at hc + have hGq (q r : Q) : G q r = correlation u q r := rfl + simp_rw [hGq] at hc + have hK : 0 < (Fintype.card K : ℝ) := Nat.cast_pos.mpr Fintype.card_pos + apply (div_le_iff₀ hK).mpr + simpa only [mul_comm] using hc +end ProjectionCriterion + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/CyclicCharpoly.lean b/lean/OAI/InformationTheory/Entanglement/CyclicCharpoly.lean new file mode 100644 index 0000000000000000000000000000000000000000..4a86ff05f2777dbfeed66812969484bf000bdbb9 --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/CyclicCharpoly.lean @@ -0,0 +1,52 @@ +import Mathlib + +namespace OAI + +noncomputable section +open scoped BigOperators +open Matrix Polynomial +namespace PencilCyclic +variable {K : Type*} [Field K] {n : ℕ} + +def krylov (A : Matrix (Fin n) (Fin n) K) (v : Fin n → K) : Matrix (Fin n) (Fin n) K := + Matrix.of fun i j => ((A ^ (j : ℕ)).mulVec v) i + +lemma aeval_mulVec_eq {A : Matrix (Fin n) (Fin n) K} (v : Fin n → K) + (q : K[X]) (hq : q.natDegree < n) : + (aeval A q).mulVec v = (krylov A v).mulVec (fun i => q.coeff i) := by + rw [Polynomial.aeval_eq_sum_range' hq] + simp only [Matrix.sum_mulVec, Matrix.smul_mulVec] + ext i + simp only [Finset.sum_apply, Matrix.mulVec, dotProduct, krylov, Matrix.of_apply] + rw [← Fin.sum_univ_eq_sum_range] + apply Finset.sum_congr rfl + intro j _ + simp [Matrix.mulVec, dotProduct, mul_comm] + +lemma polynomial_zero_of_cyclic {A B : Matrix (Fin n) (Fin n) K} {v : Fin n → K} + (hB : B * krylov A v = 1) (q : K[X]) (hqn : q.natDegree < n) + (hq : (aeval A q).mulVec v = 0) : q = 0 := by + have hc : (fun i : Fin n => q.coeff i) = 0 := by + have hh := congrArg (Matrix.mulVec B) hq + rw [aeval_mulVec_eq v q hqn, Matrix.mulVec_mulVec, hB, + Matrix.one_mulVec, Matrix.mulVec_zero] at hh + exact hh + ext k + by_cases hk : k < n + · exact congrFun hc ⟨k,hk⟩ + · exact (Polynomial.coeff_eq_zero_of_natDegree_lt (by omega)).trans (Polynomial.coeff_zero _).symm + +lemma charpoly_eq_of_cyclic {A B : Matrix (Fin n) (Fin n) K} {v : Fin n → K} + (hn : n ≠ 0) (hB : B * krylov A v = 1) (f : K[X]) (hf : f.Monic) (hfn : f.natDegree = n) + (hfv : (aeval A f).mulVec v = 0) : A.charpoly = f := by + have hdeg : (A.charpoly - f).natDegree < n := by + exact Polynomial.IsMonicOfDegree.natDegree_sub_lt hn + ⟨by simp, Matrix.charpoly_monic A⟩ ⟨hfn, hf⟩ + have he : (aeval A (A.charpoly - f)).mulVec v = 0 := by + rw [map_sub, Matrix.aeval_self_charpoly, zero_sub, Matrix.neg_mulVec, hfv, neg_zero] + exact sub_eq_zero.mp (polynomial_zero_of_cyclic hB _ hdeg he) +end PencilCyclic + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/DefaultNull.lean b/lean/OAI/InformationTheory/Entanglement/DefaultNull.lean new file mode 100644 index 0000000000000000000000000000000000000000..7e0da2f2b1881cf250803030c194a4fc6ef0d0ee --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/DefaultNull.lean @@ -0,0 +1,72 @@ +import OAI.InformationTheory.Entanglement.ReferenceFilter + +namespace OAI + +noncomputable section +open scoped MeasureTheory BigOperators ComplexOrder MatrixOrder +open MeasureTheory Matrix Filter +namespace SecretKey +open ChannelCompletion +variable {Ω T : Type*} [MeasurableSpace Ω] [MeasurableSpace T] +variable {n : Type} [Fintype n] +namespace PositiveMatrixMeasure +@[ext] lemma ext_entry_default {W V : PositiveMatrixMeasure Ω n} (h : W.entry=V.entry) : W=V := by + cases W + cases V + cases h + rfl +lemma value_zero_of_trace_zero (W : PositiveMatrixMeasure Ω n) {s : Set Ω} + (hs : MeasurableSet s) (h0 : (Matrix.trace (W.value s)).re=0) : W.value s=0 := by + apply (W.positive s hs).trace_eq_zero_iff.mp + apply Complex.ext + · exact h0 + · exact (Complex.nonneg_iff.mp (W.positive s hs).trace_nonneg).2.symm +lemma traceMeasure_eq_zero_iff (W : PositiveMatrixMeasure Ω n) {s : Set Ω} + (hs : MeasurableSet s) : W.traceMeasure s=0 ↔ (Matrix.trace (W.value s)).re=0 := by + rw [← W.traceMeasure_real hs,measureReal_def,ENNReal.toReal_eq_zero_iff] + simp only [measure_ne_top,or_false] + +lemma subevent_zero_of_trace_zero (W : PositiveMatrixMeasure Ω n) {N s : Set Ω} + (hN : MeasurableSet N) (h0 : (Matrix.trace (W.value N)).re=0) + (hs : MeasurableSet s) (hsN : s⊆N) : W.value s=0 := by + apply W.value_zero_of_trace_zero hs + apply (W.traceMeasure_eq_zero_iff hs).mp + exact measure_mono_null hsN ((W.traceMeasure_eq_zero_iff hN).mpr h0) + +def map (W : PositiveMatrixMeasure Ω n) (f : Ω → T) (hf : Measurable f) : + PositiveMatrixMeasure T n where + entry i j := (W.entry i j).map f + positive s hs := by + simpa only [VectorMeasure.map_apply _ hf hs] using W.positive (f⁻¹' s) (hf hs) +lemma map_value (W : PositiveMatrixMeasure Ω n) (f : Ω → T) (hf : Measurable f) + {s : Set T} (hs : MeasurableSet s) : (W.map f hf).value s=W.value (f⁻¹' s) := by + ext i j + exact VectorMeasure.map_apply _ hf hs +lemma map_congr_trace_ae (W : PositiveMatrixMeasure Ω n) (f g : Ω → T) + (hf : Measurable f) (hg : Measurable g) (hfg : f=ᵐ[W.traceMeasure]g) : + W.map f hf=W.map g hg := by + apply ext_entry_default + ext i j s hs + change ((W.entry i j).map f) s=((W.entry i j).map g) s + rw [VectorMeasure.map_apply _ hf hs,VectorMeasure.map_apply _ hg hs] + change W.value (f⁻¹' s) i j=W.value (g⁻¹' s) i j + rw [ ← W.positiveDensity_setIntegral Measure.AbsolutelyContinuous.rfl (hf hs) i j, + ← W.positiveDensity_setIntegral Measure.AbsolutelyContinuous.rfl (hg hs) i j] + apply setIntegral_congr_set + filter_upwards [hfg] with x hx + exact congrArg (fun y => y ∈ s) hx + +theorem default_output_unchanged (W : PositiveMatrixMeasure Ω n) + (N : Set Ω) (hN : MeasurableSet N) (h0 : (Matrix.trace (W.value N)).re=0) + (f g : Ω → T) (hf : Measurable f) (hg : Measurable g) + (heq : ∀ x, x∉N → f x=g x) : W.map f hf=W.map g hg := by + apply W.map_congr_trace_ae f g hf hg + filter_upwards [measure_eq_zero_iff_ae_notMem.mp ((W.traceMeasure_eq_zero_iff hN).mpr h0)] with x hx + exact heq x hx +end PositiveMatrixMeasure + +end SecretKey + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/DensityChange.lean b/lean/OAI/InformationTheory/Entanglement/DensityChange.lean new file mode 100644 index 0000000000000000000000000000000000000000..303ae03f34b4c1bd22fd2988a6f54e5dfe2d30ad --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/DensityChange.lean @@ -0,0 +1,62 @@ +import OAI.InformationTheory.Entanglement.MatrixTraceMeasure + +namespace OAI + +noncomputable section +open MeasureTheory Matrix +open scoped MeasureTheory BigOperators ComplexOrder MatrixOrder Kronecker +namespace SecretKey +open ChannelCompletion +variable {n : Type} [Fintype n] [DecidableEq n] +lemma traceNorm_smul_nonneg (c : ℝ) (hc : 0≤c) (A : Mat n) : + traceNorm ((c : ℂ) • A)=c*traceNorm A := by + obtain ⟨V,hV,he⟩ := MatrixPolar.polar A + have hH : (CFC.sqrt (Aᴴ*A)).PosSemidef := sqrt_psd _ + have hcp : (((c : ℂ) • CFC.sqrt (Aᴴ*A))).PosSemidef := + hH.smul (by rw [Complex.nonneg_iff]; exact ⟨hc,rfl⟩) + conv_lhs => rw [he,← Matrix.mul_smul,traceNorm_unitary_left _ hV,traceNorm_of_psd hcp] + simp only [Matrix.trace_smul,smul_eq_mul,Complex.mul_re,Complex.ofReal_re,Complex.ofReal_im,zero_mul,sub_zero] + rfl +lemma eveBlock_smul (c : ℂ) (R D : Mat n) : eveBlock R (c • D)=c • eveBlock R D := by + simp only [eveBlock,Matrix.mul_smul,Matrix.smul_mul,Matrix.transpose_smul] +variable {Ω : Type*} [MeasurableSpace Ω] +variable (μ ν : Measure Ω) +def densityWeight (x : Ω) : ℝ := (μ.rnDeriv ν x).toReal +lemma densityWeight_nonneg (x : Ω) : 0≤densityWeight μ ν x := ENNReal.toReal_nonneg +lemma densityWeight_measurable : Measurable (densityWeight μ ν) := + (Measure.measurable_rnDeriv μ ν).ennreal_toReal +variable [IsFiniteMeasure μ] [IsFiniteMeasure ν] +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] +lemma densityWeight_integrable (hμν : μ≪ν) {f : Ω → E} (hf : Integrable f μ) : + Integrable (fun x => densityWeight μ ν x • f x) ν := by + rw [← Measure.withDensity_rnDeriv_eq μ ν hμν] at hf + exact (integrable_withDensity_iff_integrable_smul' (Measure.measurable_rnDeriv μ ν) + (Measure.rnDeriv_lt_top μ ν)).mp hf +lemma densityWeight_integral (hμν : μ≪ν) (f : Ω → E) : + (∫ x, densityWeight μ ν x • f x ∂ν)=∫ x, f x ∂μ := by + conv_rhs => rw [← Measure.withDensity_rnDeriv_eq μ ν hμν] + exact (integral_withDensity_eq_integral_toReal_smul (Measure.measurable_rnDeriv μ ν) + (Measure.rnDeriv_lt_top μ ν) f).symm +lemma densityWeight_setIntegral (hμν : μ≪ν) (f : Ω → E) {s : Set Ω} (hs : MeasurableSet s) : + (∫ x in s, densityWeight μ ν x • f x ∂ν)=∫ x in s, f x ∂μ := by + conv_rhs => rw [← Measure.withDensity_rnDeriv_eq μ ν hμν] + exact (setIntegral_withDensity_eq_setIntegral_toReal_smul (Measure.measurable_rnDeriv μ ν) + (ae_restrict_of_ae (Measure.rnDeriv_lt_top μ ν)) f hs).symm + +omit [IsFiniteMeasure μ] [IsFiniteMeasure ν] in +lemma densityWeight_eveBlock {m : Type} [Fintype m] [DecidableEq m] + (R : Mat (n×m)) (X : Ω → Mat n) (Y : Ω → Mat m) (x : Ω) : + (densityWeight μ ν x : ℂ) • eveBlock R (X x ⊗ₖ Y x)= + eveBlock R (((densityWeight μ ν x : ℂ) • X x) ⊗ₖ Y x) := by + rw [Matrix.smul_kronecker,eveBlock_smul] + +lemma densityWeight_traceNorm_integral (hμν : μ≪ν) (D : Ω → Mat n) : + (∫ x, traceNorm ((densityWeight μ ν x : ℂ) • D x) ∂ν)=∫ x, traceNorm (D x) ∂μ := by + simp only [traceNorm_smul_nonneg _ (densityWeight_nonneg μ ν _)] + exact densityWeight_integral μ ν hμν (fun x => traceNorm (D x)) + +end SecretKey + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/DensityGap.lean b/lean/OAI/InformationTheory/Entanglement/DensityGap.lean new file mode 100644 index 0000000000000000000000000000000000000000..0db9daeef2d1740de1cf5e12a23e53d57e2122e3 --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/DensityGap.lean @@ -0,0 +1,139 @@ +import OAI.InformationTheory.Entanglement.EveBlocks +import OAI.InformationTheory.Entanglement.ScalarGap + +namespace OAI + +noncomputable section +open scoped BigOperators MatrixOrder ComplexOrder Kronecker +open scoped Matrix.Norms.L2Operator +open Matrix MeasureTheory +namespace SecretKey +instance matrixMeasurableSpace (n m : Type*) : MeasurableSpace (Matrix n m ℂ) := borel _ +instance matrixBorelSpace (n m : Type*) : BorelSpace (Matrix n m ℂ) := ⟨rfl⟩ +open ChannelCompletion +variable {n : Type} [Fintype n] [DecidableEq n] +lemma traceNorm_neg (A : Mat n) : traceNorm (-A)=traceNorm A := by + have h := traceNorm_unitary_left A (U := -1) (by simp) + simpa only [Matrix.neg_mul,Matrix.one_mul] using h +lemma traceNorm_sub_le (A B : Mat n) : traceNorm (A-B)≤traceNorm A+traceNorm B := by + simpa only [sub_eq_add_neg,traceNorm_neg] using traceNorm_add_le A (-B) +lemma traceNorm_sub_triangle (A B C : Mat n) : + traceNorm (A-B)≤traceNorm (A-C)+traceNorm (B-C) := by + have he : A-B=(A-C)-(B-C) := by abel + rw [he] + exact traceNorm_sub_le _ _ +lemma trace_sub_reverse_le (A B : Mat n) : + (Matrix.trace B).re-(Matrix.trace A).re≤traceNorm (A-B) := by + have h := trace_re_le_traceNorm (B-A) + simp only [Matrix.trace_sub,Complex.sub_re] at h + rwa [show B-A=-(A-B) by abel,traceNorm_neg] at h + +variable {Ω : Type*} [MeasurableSpace Ω] {μ : Measure Ω} +lemma integrable_traceNorm_sub {A B : Ω → Mat n} + (hAm : Measurable A) (hBm : Measurable B) + (hAp : ∀ x, (A x).PosSemidef) (hBp : ∀ x, (B x).PosSemidef) + (hAi : Integrable (fun x => (Matrix.trace (A x)).re) μ) + (hBi : Integrable (fun x => (Matrix.trace (B x)).re) μ) : + Integrable (fun x => traceNorm (A x-B x)) μ := by + apply (hAi.add hBi).mono' (continuous_traceNorm.measurable.comp (hAm.sub hBm)).aestronglyMeasurable + filter_upwards [] with x + change ‖traceNorm (A x-B x)‖ ≤ (Matrix.trace (A x)).re+(Matrix.trace (B x)).re + rw [Real.norm_of_nonneg (traceNorm_nonneg _)] + simpa only [traceNorm_of_psd (hAp x),traceNorm_of_psd (hBp x)] using traceNorm_sub_le (A x) (B x) + +def halfDensity (σ : Mat n) : Mat n := (1/2 : ℂ) • σ +omit [Fintype n] [DecidableEq n] in +lemma halfDensity_psd {σ : Mat n} (hσ : σ.PosSemidef) : (halfDensity σ).PosSemidef := + hσ.smul (by rw [Complex.nonneg_iff]; norm_num : (0 : ℂ)≤1/2) +omit [DecidableEq n] in +lemma halfDensity_trace (σ : Mat n) : (Matrix.trace (halfDensity σ)).re=(Matrix.trace σ).re/2 := by + simp only [halfDensity,Matrix.trace_smul,smul_eq_mul,Complex.mul_re] + norm_num + ring + +def idealDensity (σ : Ω → Mat n) (i j : Fin 2) (x : Ω) : Mat n := + if i=j then halfDensity (σ x) else 0 +def bitDistance (τ : Fin 2 → Fin 2 → Ω → Mat n) (σ : Ω → Mat n) (μ : Measure Ω) : ℝ := + ∑ i, ∑ j, ∫ x, traceNorm (τ i j x-idealDensity σ i j x) ∂μ + +theorem matrix_density_gap (τ : Fin 2 → Fin 2 → Ω → Mat n) (σ : Ω → Mat n) + (hτm : ∀ i j, Measurable (τ i j)) (hσm : Measurable σ) + (hτp : ∀ i j x, (τ i j x).PosSemidef) (hσp : ∀ x, (σ x).PosSemidef) + (hτi : ∀ i j, Integrable (fun x => (Matrix.trace (τ i j x)).re) μ) + (hσi : Integrable (fun x => (Matrix.trace (σ x)).re) μ) + (hτ1 : (∑ i, ∑ j, ∫ x, (Matrix.trace (τ i j x)).re ∂μ)=1) + (hσ1 : (∫ x, (Matrix.trace (σ x)).re ∂μ)=1) + (hc : ∀ x, fidelity (τ 0 0 x) (τ 1 1 x) ≤ + Real.sqrt ((Matrix.trace (τ 0 0 x)).re*(Matrix.trace (τ 0 1 x)).re)+ + Real.sqrt ((Matrix.trace (τ 1 0 x)).re*(Matrix.trace (τ 1 1 x)).re)+ + 2*Real.sqrt ((Matrix.trace (τ 0 1 x)).re*(Matrix.trace (τ 1 0 x)).re)) : + 1/5≤bitDistance τ σ μ := by + let p := fun i j x => (Matrix.trace (τ i j x)).re + let P := fun i j => ∫ x, p i j x ∂μ + let a := fun i => ∫ x, traceNorm (τ i i x-halfDensity (σ x)) ∂μ + let q := ∫ x, traceNorm (τ 0 0 x-τ 1 1 x) ∂μ + have pn (i j : Fin 2) (x : Ω) : 0≤p i j x := + (Complex.nonneg_iff.mp (hτp i j x).trace_nonneg).1 + have Pn (i j : Fin 2) : 0≤P i j := integral_nonneg (pn i j) + have hnorm : P 0 0+P 0 1+P 1 0+P 1 1=1 := by + simp only [Fin.sum_univ_two] at hτ1 + dsimp only [P,p] + linarith + have hmhalf : Measurable (fun x => halfDensity (σ x)) := by + exact (measurable_const : Measurable (fun _ : Ω => (1/2 : ℂ))).smul hσm + have hihalf : Integrable (fun x => (Matrix.trace (halfDensity (σ x))).re) μ := by + simpa only [halfDensity_trace] using hσi.div_const 2 + have hai (i : Fin 2) := integrable_traceNorm_sub (hτm i i) hmhalf + (hτp i i) (fun x => halfDensity_psd (hσp x)) (hτi i i) hihalf + have hqi := integrable_traceNorm_sub (hτm 0 0) (hτm 1 1) (hτp 0 0) (hτp 1 1) + (hτi 0 0) (hτi 1 1) + have heq : bitDistance τ σ μ=P 0 1+P 1 0+a 0+a 1 := by + unfold bitDistance idealDensity + simp only [Fin.sum_univ_two,ite_true,show (0 : Fin 2)≠1 by decide, + show (1 : Fin 2)≠0 by decide,ite_false,sub_zero] + simp only [traceNorm_of_psd (hτp _ _ _)] + dsimp only [a,P,p] + ring + have hq : q≤a 0+a 1 := by + have h := integral_mono hqi ((hai 0).add (hai 1)) + (fun x => traceNorm_sub_triangle (τ 0 0 x) (τ 1 1 x) (halfDensity (σ x))) + simp only [Pi.add_apply] at h + rwa [integral_add (hai 0) (hai 1)] at h + have hatrace (i : Fin 2) : 1/2-P i i≤a i := by + have h := integral_mono (hihalf.sub (hτi i i)) (hai i) + (fun x => trace_sub_reverse_le (τ i i x) (halfDensity (σ x))) + simp only [Pi.sub_apply] at h + rw [integral_sub hihalf (hτi i i)] at h + simp only [halfDensity_trace,integral_div,hσ1] at h + exact h + have he : P 0 1+P 1 0≤bitDistance τ σ μ/2 := by + rw [heq] + have h0 := hatrace 0 + have h1 := hatrace 1 + linarith + have hip (i j k l : Fin 2) := sqrt_product_integrable (hτi i j) (hτi k l) (pn i j) (pn k l) + have hu := integral_mono (((hτi 0 0).add (hτi 1 1)).sub hqi |>.div_const 2) + (((hip 0 0 0 1).add (hip 1 0 1 1)).add ((hip 0 1 1 0).const_mul 2)) + (fun x => (fidelity_lower (hτp 0 0 x) (hτp 1 1 x)).trans (hc x)) + simp only [Pi.add_apply,Pi.sub_apply] at hu + have hsum : Integrable (fun x => p 0 0 x+p 1 1 x) μ := (hτi 0 0).add (hτi 1 1) + have hroots : Integrable (fun x => Real.sqrt (p 0 0 x*p 0 1 x)+Real.sqrt (p 1 0 x*p 1 1 x)) μ := + (hip 0 0 0 1).add (hip 1 0 1 1) + rw [integral_div,integral_sub hsum hqi, + integral_add (hτi 0 0) (hτi 1 1), + integral_add hroots ((hip 0 1 1 0).const_mul 2), + integral_add (hip 0 0 0 1) (hip 1 0 1 1),integral_const_mul] at hu + have bound (i j k l : Fin 2) := integral_sqrt_product_le (hτi i j) (hτi k l) (pn i j) (pn k l) + have hf : (P 0 0+P 1 1-q)/2≤ + Real.sqrt (P 0 0*P 0 1)+Real.sqrt (P 1 0*P 1 1)+2*Real.sqrt (P 0 1*P 1 0) := by + exact hu.trans (add_le_add (add_le_add (bound 0 0 0 1) (bound 1 0 1 1)) + (mul_le_mul_of_nonneg_left (bound 0 1 1 0) (by norm_num))) + apply scalar_secret_bit_gap (Pn 0 0) (Pn 0 1) (Pn 1 0) (Pn 1 1) hnorm he _ hf + rw [heq] + linarith + +end SecretKey + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/DensityPositivity.lean b/lean/OAI/InformationTheory/Entanglement/DensityPositivity.lean new file mode 100644 index 0000000000000000000000000000000000000000..9320a6cf2f36e28da6166aba08be482d6517dfce --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/DensityPositivity.lean @@ -0,0 +1,84 @@ +import OAI.InformationTheory.Entanglement.MatrixMeasure + +namespace OAI + +noncomputable section +open scoped BigOperators ComplexOrder MatrixOrder ENNReal MeasureTheory Matrix.Norms.L2Operator +open Matrix MeasureTheory Filter +namespace SecretKey +open ChannelCompletion +variable {Ω : Type*} [MeasurableSpace Ω] {μ : Measure Ω} +variable {n : Type} [Fintype n] + +def quadratic (M : Mat n) (z : n → ℂ) : ℂ := ∑ i, ∑ j, star (z i)*M i j*z j +lemma quadratic_eq (M : Mat n) (z : n → ℂ) : quadratic M z=star z ⬝ᵥ M *ᵥ z := by + simp only [quadratic,dotProduct,Matrix.mulVec,Pi.star_apply,Finset.mul_sum,mul_assoc] +lemma continuous_quadratic (M : Mat n) : Continuous (quadratic M) := by + unfold quadratic + fun_prop +lemma quadratic_integrable {D : Ω → Mat n} + (hi : ∀ i j, Integrable (fun x => D x i j) μ) (z : n → ℂ) : + Integrable (fun x => quadratic (D x) z) μ := by + exact integrable_finsetSum _ fun i _ => integrable_finsetSum _ fun j _ => + ((hi i j).const_mul _).mul_const _ +namespace PositiveMatrixMeasure +variable (W : PositiveMatrixMeasure Ω n) [SigmaFinite μ] +variable (hdom : ∀ s, MeasurableSet s → μ s=0 → (Matrix.trace (W.value s)).re=0) +include hdom +lemma quadratic_setIntegral {s : Set Ω} (hs : MeasurableSet s) (z : n → ℂ) : + (∫ x in s, quadratic (W.density μ x) z ∂μ)=quadratic (W.value s) z := by + unfold quadratic + rw [integral_finsetSum _ (fun i _ => integrable_finsetSum _ fun j _ => + (((W.density_integrable i j).const_mul _).mul_const _).integrableOn)] + apply Finset.sum_congr rfl + intro i _ + rw [integral_finsetSum _ (fun j _ => + (((W.density_integrable i j).const_mul _).mul_const _).integrableOn)] + apply Finset.sum_congr rfl + intro j _ + rw [integral_mul_const,integral_const_mul,W.density_setIntegral hdom hs] +lemma density_ae_hermitian : ∀ᵐ x ∂μ, (W.density μ x).IsHermitian := by + have h (i j : n) : (fun x => star (W.density μ x j i)) =ᵐ[μ] (fun x => W.density μ x i j) := by + refine Integrable.ae_eq_of_forall_setIntegral_eq _ _ + (RCLike.conjLIE.toContinuousLinearEquiv.toContinuousLinearMap.integrable_comp + (W.density_integrable j i)) (W.density_integrable i j) ?_ + intro s hs _ + change (∫ x in s, (starRingEnd ℂ) (W.density μ x j i) ∂μ)=_ + rw [integral_conj,W.density_setIntegral hdom hs,W.density_setIntegral hdom hs] + exact congrArg (fun M : Mat n => M i j) (W.positive s hs).isHermitian.eq + have hall := ae_all_iff.mpr fun i => ae_all_iff.mpr (h i) + filter_upwards [hall] with x hx + ext i j + exact hx i j +lemma quadratic_ae_nonneg (z : n → ℂ) : ∀ᵐ x ∂μ, 0≤quadratic (W.density μ x) z := by + have hi := quadratic_integrable (W.density_integrable (μ := μ)) z + have hre : ∀ᵐ x ∂μ, 0≤(quadratic (W.density μ x) z).re := by + refine ae_nonneg_of_forall_setIntegral_nonneg hi.re ?_ + intro s hs _ + simp only [← RCLike.re_eq_complex_re] + rw [integral_re hi.integrableOn,W.quadratic_setIntegral hdom hs,quadratic_eq] + exact (W.positive s hs).re_dotProduct_nonneg z + have him : (fun x => (quadratic (W.density μ x) z).im) =ᵐ[μ] (fun _ => (0 : ℝ)) := by + refine Integrable.ae_eq_of_forall_setIntegral_eq _ _ hi.im (integrable_zero _ _ _) ?_ + intro s hs _ + simp only [← RCLike.im_eq_complex_im] + rw [integral_im hi.integrableOn,W.quadratic_setIntegral hdom hs,quadratic_eq,integral_zero] + exact (Complex.nonneg_iff.mp ((W.positive s hs).dotProduct_mulVec_nonneg z)).2.symm + filter_upwards [hre,him] with x hx hy + exact Complex.nonneg_iff.mpr ⟨hx,hy.symm⟩ + +lemma density_ae_psd : ∀ᵐ x ∂μ, (W.density μ x).PosSemidef := by + have hall := ae_all_iff.mpr (fun k : ℕ => W.quadratic_ae_nonneg hdom + (TopologicalSpace.denseSeq (n → ℂ) k)) + filter_upwards [W.density_ae_hermitian hdom,hall] with x hherm hx + refine Matrix.PosSemidef.of_dotProduct_mulVec_nonneg hherm fun z => ?_ + rw [← quadratic_eq] + exact (TopologicalSpace.denseRange_denseSeq (n → ℂ)).induction_on z + (isClosed_le continuous_const (continuous_quadratic _)) hx +end PositiveMatrixMeasure + +end SecretKey + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/EffectNormalization.lean b/lean/OAI/InformationTheory/Entanglement/EffectNormalization.lean new file mode 100644 index 0000000000000000000000000000000000000000..76e9a8ff8057fbf15f5e3c653826da292a2663a3 --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/EffectNormalization.lean @@ -0,0 +1,120 @@ +import OAI.InformationTheory.Entanglement.TraceNorm + +namespace OAI + +noncomputable section +open scoped BigOperators ComplexOrder MatrixOrder +open Matrix +namespace SecretKey +variable {n : Type} [Fintype n] [DecidableEq n] + +lemma psd_column_zero {A : Matrix n n ℂ} (hA : A.PosSemidef) (i : n) + (hi : A i i = 0) : ∀ j, A j i = 0 := by + have h := (hA.dotProduct_mulVec_zero_iff (x := Pi.single i 1)).mp (by simpa using hi) + intro j + simpa using congrFun h j + +lemma psd_row_zero {A : Matrix n n ℂ} (hA : A.PosSemidef) (i : n) + (hi : A i i = 0) : ∀ j, A i j = 0 := by + intro j + have h := congrArg star (psd_column_zero hA i hi j) + simpa only [← hA.isHermitian.apply i j, star_zero] using h + +lemma unitary_spectral {A : Matrix n n ℂ} (hA : A.IsHermitian) : + ∃ U : Matrix n n ℂ, Uᴴ * U = 1 ∧ + Uᴴ * A * U = diagonal (fun i => (hA.eigenvalues i : ℂ)) := by + let U : Matrix n n ℂ := hA.eigenvectorUnitary + have hU : Uᴴ * U = 1 := Unitary.coe_star_mul_self _ + refine ⟨U,hU,?_⟩ + conv_lhs => rw [hA.spectral_theorem] + change Uᴴ * (U * diagonal (fun i => (hA.eigenvalues i : ℂ)) * Uᴴ) * U = _ + simp only [← Matrix.mul_assoc, hU, Matrix.one_mul] + rw [Matrix.mul_assoc, hU, Matrix.mul_one] + +lemma commuting_normalization {A B : Matrix n n ℂ} (hA : A.PosSemidef) (hB : B.PosSemidef) : + ∃ S T : Matrix n n ℂ, S*T=1 ∧ T*S=1 ∧ Commute (Sᴴ*A*S) (Sᴴ*B*S) := by + let H := A+B + have hH : H.PosSemidef := hA.add hB + obtain ⟨U,hU,hHdiag⟩ := unitary_spectral hH.isHermitian + let a := Uᴴ*A*U + let b := Uᴴ*B*U + have ha : a.PosSemidef := hA.conjTranspose_mul_mul_same U + have hb : b.PosSemidef := hB.conjTranspose_mul_mul_same U + let eig := hH.isHermitian.eigenvalues + have hab : a+b = diagonal (fun i => (eig i : ℂ)) := by + rw [← hHdiag] + simp only [H,a,b,Matrix.mul_add,Matrix.add_mul] + have hzero (i : n) (hi : eig i = 0) : ∀ j, a i j = 0 := by + apply psd_row_zero ha i + have he : a i i + b i i = 0 := by + simpa only [Matrix.add_apply, Matrix.diagonal_apply_eq, hi, Complex.ofReal_zero] using + congrArg (fun M => M i i) hab + exact le_antisymm (by rw [← he]; exact le_add_of_nonneg_right hb.diag_nonneg) ha.diag_nonneg + let d : n → ℝ := fun i => if eig i = 0 then 1 else (Real.sqrt (eig i))⁻¹ + have hd (i : n) : d i ≠ 0 := by + dsimp [d] + split_ifs with hi + · exact one_ne_zero + · exact inv_ne_zero (Real.sqrt_ne_zero'.mpr (lt_of_le_of_ne (hH.eigenvalues_nonneg i) (Ne.symm hi))) + let D : Matrix n n ℂ := diagonal (fun i => (d i : ℂ)) + let E : Matrix n n ℂ := diagonal (fun i => ((d i)⁻¹ : ℂ)) + have hD : Dᴴ = D := by simp [D, Matrix.diagonal_conjTranspose] + have hDE : D*E=1 := by + rw [Matrix.diagonal_mul_diagonal] + ext i j + simp only [Matrix.diagonal_apply,Matrix.one_apply] + split_ifs with h + · subst j; simp [hd] + · rfl + have hED : E*D=1 := by + rw [Matrix.diagonal_mul_diagonal] + ext i j + simp only [Matrix.diagonal_apply,Matrix.one_apply] + split_ifs with h + · subst j; simp [hd] + · rfl + let P : Matrix n n ℂ := diagonal (fun i => if eig i = 0 then 0 else 1) + have hsum : D*a*D+D*b*D=P := by + rw [← Matrix.add_mul, ← Matrix.mul_add, hab] + simp only [D,P,Matrix.diagonal_mul_diagonal] + congr 1 + funext i + dsimp [d] + split_ifs with hi + · simp [hi] + · have hs : Real.sqrt (eig i) ≠ 0 := Real.sqrt_ne_zero'.mpr + (lt_of_le_of_ne (hH.eigenvalues_nonneg i) (Ne.symm hi)) + have he : (Real.sqrt (eig i))⁻¹ * eig i * (Real.sqrt (eig i))⁻¹ = 1 := by + field_simp + nlinarith [Real.sq_sqrt (show 0 ≤ eig i from hH.eigenvalues_nonneg i)] + exact_mod_cast he + have hAP : (D*a*D)*P=D*a*D := by + ext i j + simp only [P,Matrix.mul_diagonal,Matrix.diagonal_mul,D] + by_cases hj : eig j = 0 + · have hz : a i j = 0 := by + have hc := congrArg star (hzero j hj i) + simpa only [← ha.isHermitian.apply i j, star_zero] using hc + simp [hj,hz] + · simp [hj] + have hPA : P*(D*a*D)=D*a*D := by + ext i j + simp only [P,Matrix.mul_diagonal,Matrix.diagonal_mul,D] + by_cases hi : eig i = 0 + · simp [hi,hzero i hi j] + · simp [hi] + refine ⟨U*D,E*Uᴴ,?_,?_,?_⟩ + · rw [Matrix.mul_assoc, ← Matrix.mul_assoc D E, hDE, Matrix.one_mul, unitary_reverse hU] + · rw [Matrix.mul_assoc, ← Matrix.mul_assoc Uᴴ U, hU, Matrix.one_mul, hED] + · have hb' : D*b*D=P-D*a*D := by rw [← hsum]; abel + change Commute ((U*D)ᴴ*A*(U*D)) ((U*D)ᴴ*B*(U*D)) + have heA : (U*D)ᴴ*A*(U*D)=D*a*D := by simp [a,Matrix.conjTranspose_mul,hD,Matrix.mul_assoc] + have heB : (U*D)ᴴ*B*(U*D)=D*b*D := by simp [b,Matrix.conjTranspose_mul,hD,Matrix.mul_assoc] + rw [heA,heB] + change (D*a*D)*(D*b*D)=(D*b*D)*(D*a*D) + rw [hb',Matrix.mul_sub,Matrix.sub_mul,hAP,hPA] +end SecretKey + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/EightSubsetCardinality.lean b/lean/OAI/InformationTheory/Entanglement/EightSubsetCardinality.lean new file mode 100644 index 0000000000000000000000000000000000000000..5b7220527a1577013c9c25ec478f333619abfad6 --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/EightSubsetCardinality.lean @@ -0,0 +1,20 @@ +import OAI.InformationTheory.Entanglement.CombinatorialQuestions +import OAI.InformationTheory.Entanglement.ParityData + +namespace OAI + +noncomputable section +open scoped BigOperators +namespace FiniteConstruction +abbrev EightTest := {S : Finset Question // S.card=8} +lemma eight_card_test : Fintype.card EightTest=L := by + rw [Fintype.card_finset_len, question_card, L_def] +lemma d_refl : D=4^L := rfl +lemma big_card_test : Fintype.card (EightTest → Four) = D := by + have hc : Fintype.card Four=4 := rfl + rw [d_refl, Fintype.card_fun, hc, eight_card_test] +end FiniteConstruction + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/EveBlocks.lean b/lean/OAI/InformationTheory/Entanglement/EveBlocks.lean new file mode 100644 index 0000000000000000000000000000000000000000..2e4088650913e1c90e7c6739fd857c0b8f9fe8f1 --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/EveBlocks.lean @@ -0,0 +1,66 @@ +import OAI.InformationTheory.Entanglement.Coherence +import OAI.InformationTheory.Entanglement.PowersStormer + +namespace OAI + +noncomputable section +open scoped BigOperators MatrixOrder ComplexOrder Kronecker +open Matrix +namespace SecretKey +open ChannelCompletion +variable {n m : Type} [Fintype n] [Fintype m] [DecidableEq n] [DecidableEq m] + +def eveBlock (R D : Mat n) : Mat n := (CFC.sqrt R*D*CFC.sqrt R)ᵀ +lemma eveBlock_psd {R D : Mat n} (hD : D.PosSemidef) : (eveBlock R D).PosSemidef := by + unfold eveBlock + have h : (CFC.sqrt R*D*CFC.sqrt R).PosSemidef := by + simpa only [sqrt_herm] using hD.mul_mul_conjTranspose_same (CFC.sqrt R) + exact h.transpose +lemma eveBlock_trace {R D : Mat n} (hR : R.PosSemidef) : + Matrix.trace (eveBlock R D)=Matrix.trace (D*R) := by + unfold eveBlock + rw [Matrix.trace_transpose,Matrix.trace_mul_cycle, + CFC.sqrt_mul_sqrt_self R hR.nonneg,Matrix.trace_mul_comm] +lemma eveBlock_gram {R D : Mat n} (hD : D.PosSemidef) : + CFC.sqrt R*D*CFC.sqrt R=(CFC.sqrt D*CFC.sqrt R)ᴴ*(CFC.sqrt D*CFC.sqrt R) := by + simp only [Matrix.conjTranspose_mul,sqrt_herm] + simp only [Matrix.mul_assoc] + rw [← Matrix.mul_assoc (CFC.sqrt D),CFC.sqrt_mul_sqrt_self D hD.nonneg] +lemma eveBlock_fidelity {R A B : Mat n} (hR : R.PosSemidef) (hA : A.PosSemidef) + (hB : B.PosSemidef) : + fidelity (eveBlock R A) (eveBlock R B)=traceNorm (CFC.sqrt A*R*CFC.sqrt B) := by + unfold eveBlock + rw [fidelity_transpose (by simpa only [sqrt_herm] using hA.mul_mul_conjTranspose_same (CFC.sqrt R)) + (by simpa only [sqrt_herm] using hB.mul_mul_conjTranspose_same (CFC.sqrt R)), + eveBlock_gram hA,eveBlock_gram hB,fidelity_polar] + simp only [Matrix.conjTranspose_mul,sqrt_herm] + congr 1 + simp only [Matrix.mul_assoc] + rw [← Matrix.mul_assoc (CFC.sqrt R),CFC.sqrt_mul_sqrt_self R hR.nonneg] + +lemma eveBlock_coherence (R : Mat (n × m)) (hR : Represented R) + (X : Fin 2 → Mat n) (Y : Fin 2 → Mat m) + (hX : ∀ i, (X i).PosSemidef) (hY : ∀ i, (Y i).PosSemidef) : + let τ := fun i j => eveBlock R (X i ⊗ₖ Y j) + let p := fun i j => (Matrix.trace (τ i j)).re + fidelity (τ 0 0) (τ 1 1) ≤ + Real.sqrt (p 0 0*p 0 1)+Real.sqrt (p 1 0*p 1 1)+2*Real.sqrt (p 0 1*p 1 0) := by + dsimp only + rw [eveBlock_fidelity hR.1 ((hX 0).kronecker (hY 0)) ((hX 1).kronecker (hY 1))] + simp only [eveBlock_trace hR.1] + exact four_effect R hR X Y hX hY + +open scoped Matrix.Norms.L2Operator in +lemma continuous_traceNorm : Continuous (traceNorm : Mat n → ℝ) := by + have h : Continuous (fun A : Mat n => CFC.sqrt (Aᴴ*A)) := by + exact CFC.continuousOn_sqrt.comp_continuous (by fun_prop) + (fun A => (Matrix.posSemidef_conjTranspose_mul_self A).nonneg) + change Continuous (fun A : Mat n => (Matrix.trace (CFC.sqrt (Aᴴ*A))).re) + unfold Matrix.trace Matrix.diag + fun_prop + +end SecretKey + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/FactorizedLawGap.lean b/lean/OAI/InformationTheory/Entanglement/FactorizedLawGap.lean new file mode 100644 index 0000000000000000000000000000000000000000..38af15807cf6f2488e24a701753c0f978d625b91 --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/FactorizedLawGap.lean @@ -0,0 +1,155 @@ +import OAI.InformationTheory.Entanglement.MatrixDensityChange + +namespace OAI + +noncomputable section +open MeasureTheory Matrix Filter +open scoped MeasureTheory BigOperators ComplexOrder MatrixOrder Kronecker +namespace SecretKey +open ChannelCompletion +variable {T : Type*} [MeasurableSpace T] {n m : Type} [Fintype n] [Fintype m] + [DecidableEq n] [DecidableEq m] + +def bitComparisonMeasure (W : Fin 2 → Fin 2 → PositiveMatrixMeasure T n) + (σ : PositiveMatrixMeasure T n) : Measure T := + familyTraceMeasure (fun p : Fin 2 × Fin 2 => W p.1 p.2)+σ.traceMeasure +instance bitComparisonMeasureIsFiniteMeasure (W : Fin 2 → Fin 2 → PositiveMatrixMeasure T n) + (σ : PositiveMatrixMeasure T n) : IsFiniteMeasure (bitComparisonMeasure W σ) := by + unfold bitComparisonMeasure + infer_instance +omit [DecidableEq n] in +lemma bitComparison_actual_dom (W : Fin 2 → Fin 2 → PositiveMatrixMeasure T n) + (σ : PositiveMatrixMeasure T n) (i j : Fin 2) : + (W i j).traceMeasure≪bitComparisonMeasure W σ := + (trace_absolutelyContinuous_family (fun p : Fin 2 × Fin 2 => W p.1 p.2) (i,j)).trans + (Measure.absolutelyContinuous_of_le (le_add_of_nonneg_right bot_le)) +omit [DecidableEq n] in +lemma bitComparison_ideal_dom (W : Fin 2 → Fin 2 → PositiveMatrixMeasure T n) + (σ : PositiveMatrixMeasure T n) : σ.traceMeasure≪bitComparisonMeasure W σ := + Measure.absolutelyContinuous_of_le (le_add_of_nonneg_left bot_le) + +def cqBitDistance (W : Fin 2 → Fin 2 → PositiveMatrixMeasure T n) + (σ : PositiveMatrixMeasure T n) : ℝ := + bitDistance (fun i j => (W i j).positiveDensity (bitComparisonMeasure W σ)) + (σ.positiveDensity (bitComparisonMeasure W σ)) (bitComparisonMeasure W σ) +lemma cqBitDistance_enlarge (W : Fin 2 → Fin 2 → PositiveMatrixMeasure T n) + (σ : PositiveMatrixMeasure T n) {ν : Measure T} [IsFiniteMeasure ν] + (hν : bitComparisonMeasure W σ≪ν) : + cqBitDistance W σ=bitDistance (fun i j => (W i j).positiveDensity ν) + (σ.positiveDensity ν) ν := + (bitLawDistance_change W σ (bitComparison_actual_dom W σ) (bitComparison_ideal_dom W σ) hν).symm +omit [DecidableEq n] in +lemma integral_trace_of_entry_integrals {μ : Measure T} (D : T → Mat n) (M : Mat n) + (hi : ∀ a b, Integrable (fun t => D t a b) μ) + (he : ∀ a b, (∫ t, D t a b ∂μ)=M a b) : + (∫ t, (Matrix.trace (D t)).re ∂μ)=(Matrix.trace M).re := by + change (∫ t, RCLike.re (∑ i, D t i i) ∂μ)=_ + rw [integral_re (integrable_finsetSum _ (fun i _ => hi i i))] + rw [integral_finsetSum _ (fun i _ => hi i i)] + simp only [he,Matrix.trace,Matrix.diag] + rfl +lemma measurable_factorized_eveBlock (R : Mat (n×m)) {X : T → Mat n} {Y : T → Mat m} + (hX : Measurable X) (hY : Measurable Y) : Measurable (fun t => eveBlock R (X t ⊗ₖ Y t)) := by + change @Measurable T (n → n → ℂ) _ (borel _) X at hX + change @Measurable T (m → m → ℂ) _ (borel _) Y at hY + rw [← @BorelSpace.measurable_eq (n → n → ℂ) _ MeasurableSpace.pi _] at hX + rw [← @BorelSpace.measurable_eq (m → m → ℂ) _ MeasurableSpace.pi _] at hY + change @Measurable T ((n×m) → (n×m) → ℂ) _ (borel _) _ + rw [← @BorelSpace.measurable_eq ((n×m) → (n×m) → ℂ) _ MeasurableSpace.pi _] + apply Measurable.of_eval + intro a + apply Measurable.of_eval + intro b + simp only [eveBlock,Matrix.transpose_apply,Matrix.mul_apply,Matrix.kroneckerMap_apply] + apply Finset.measurable_sum + intro j _ + apply Measurable.mul _ measurable_const + apply Finset.measurable_sum + intro k _ + exact measurable_const.mul (((measurable_pi_apply j.1).comp ((measurable_pi_apply k.1).comp hX)).mul + ((measurable_pi_apply j.2).comp ((measurable_pi_apply k.2).comp hY))) +lemma scaled_eveBlock_coherence (R : Mat (n×m)) (hR : Represented R) + (X : Fin 2 → Mat n) (Y : Fin 2 → Mat m) + (hX : ∀ i, (X i).PosSemidef) (hY : ∀ i, (Y i).PosSemidef) + (c : ℝ) (hc : 0≤c) : + let τ := fun i j => (c : ℂ) • eveBlock R (X i ⊗ₖ Y j) + let p := fun i j => (Matrix.trace (τ i j)).re + fidelity (τ 0 0) (τ 1 1) ≤ + Real.sqrt (p 0 0*p 0 1)+Real.sqrt (p 1 0*p 1 1)+2*Real.sqrt (p 0 1*p 1 0) := by + dsimp only + have he (i j : Fin 2) : (c : ℂ) • eveBlock R (X i ⊗ₖ Y j)= + eveBlock R (((c : ℂ) • X i) ⊗ₖ Y j) := by + rw [Matrix.smul_kronecker,eveBlock_smul] + simp only [he] + exact eveBlock_coherence R hR (fun i => (c : ℂ) • X i) Y + (fun i => (hX i).smul (by rw [Complex.nonneg_iff]; exact ⟨hc,by simp⟩)) hY + +theorem factorized_law_gap (R : Mat (n×m)) (hR : Represented R) + (W : Fin 2 → Fin 2 → PositiveMatrixMeasure T (n×m)) + (σ : PositiveMatrixMeasure T (n×m)) (μ : Measure T) [IsFiniteMeasure μ] + (X : Fin 2 → T → Mat n) (Y : Fin 2 → T → Mat m) + (hXm : ∀ i, Measurable (X i)) (hYm : ∀ j, Measurable (Y j)) + (hXp : ∀ i t, (X i t).PosSemidef) (hYp : ∀ j t, (Y j t).PosSemidef) + (hDi : ∀ i j a b, Integrable (fun t => eveBlock R (X i t ⊗ₖ Y j t) a b) μ) + (hDs : ∀ i j s, MeasurableSet s → ∀ a b, + (∫ t in s, eveBlock R (X i t ⊗ₖ Y j t) a b ∂μ)=(W i j).value s a b) + (hW1 : (∑ i, ∑ j, (Matrix.trace ((W i j).value Set.univ)).re)=1) + (hσ1 : (Matrix.trace (σ.value Set.univ)).re=1) : + 1/5≤cqBitDistance W σ := by + let ν := μ+bitComparisonMeasure W σ + have hμν : μ≪ν := Measure.absolutelyContinuous_of_le (le_add_of_nonneg_right bot_le) + have hκν : bitComparisonMeasure W σ≪ν := + Measure.absolutelyContinuous_of_le (le_add_of_nonneg_left bot_le) + let D := fun i j t => eveBlock R (X i t ⊗ₖ Y j t) + let D' := fun i j t => (densityWeight μ ν t : ℂ) • D i j t + have hD'm : ∀ i j, Measurable (D' i j) := by + intro i j + have hd : Measurable (D i j) := measurable_factorized_eveBlock R (hXm i) (hYm j) + exact (densityWeight_measurable μ ν).complex_ofReal.smul hd + have hD'p : ∀ i j t, (D' i j t).PosSemidef := by + intro i j t + exact (eveBlock_psd ((hXp i t).kronecker (hYp j t))).smul + (by rw [Complex.nonneg_iff]; exact ⟨densityWeight_nonneg μ ν t,by simp⟩) + have hD'i : ∀ i j a b, Integrable (fun t => D' i j t a b) ν := by + intro i j a b + simpa only [D',D,Matrix.smul_apply,smul_eq_mul,Complex.real_smul] using + densityWeight_integrable μ ν hμν (hDi i j a b) + have hD's : ∀ i j s, MeasurableSet s → ∀ a b, + (∫ t in s, D' i j t a b ∂ν)=(W i j).value s a b := by + intro i j s hs a b + simpa only [D',D,Matrix.smul_apply,smul_eq_mul,Complex.real_smul] using + (densityWeight_setIntegral μ ν hμν (fun t => D i j t a b) hs).trans (hDs i j s hs a b) + have hDeq : ∀ i j, D' i j=ᵐ[ν](W i j).positiveDensity ν := by + intro i j + exact (W i j).density_unique ((bitComparison_actual_dom W σ i j).trans hκν) + (D' i j) (hD'i i j) (hD's i j) + rw [cqBitDistance_enlarge W σ hκν, + ← bitDistance_congr_ae hDeq (Filter.EventuallyEq.rfl : σ.positiveDensity ν=ᵐ[ν]σ.positiveDensity ν)] + apply matrix_density_gap _ _ hD'm (σ.positiveDensity_measurable ν) hD'p + (σ.positiveDensity_psd ν) + · intro i j + exact (integrable_finsetSum _ (fun a _ => hD'i i j a a)).re + · exact σ.positiveDensity_trace_integrable ((bitComparison_ideal_dom W σ).trans hκν) + · have he : (∑ i, ∑ j, ∫ t, (Matrix.trace (D' i j t)).re ∂ν)= + (∑ i, ∑ j, (Matrix.trace ((W i j).value Set.univ)).re) := by + apply Finset.sum_congr rfl + intro i hi + apply Finset.sum_congr rfl + intro j hj + apply integral_trace_of_entry_integrals _ _ (hD'i i j) + intro a b + simpa using hD's i j Set.univ MeasurableSet.univ a b + exact he.trans hW1 + · rw [← σ.traceMeasure_real MeasurableSet.univ] at hσ1 + simpa only [Measure.restrict_univ] using + (σ.positiveDensity_trace_setIntegral ((bitComparison_ideal_dom W σ).trans hκν) + MeasurableSet.univ).trans hσ1 + · intro t + exact scaled_eveBlock_coherence R hR (fun i => X i t) (fun j => Y j t) + (fun i => hXp i t) (fun j => hYp j t) (densityWeight μ ν t) (densityWeight_nonneg μ ν t) + +end SecretKey + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/FiberBound.lean b/lean/OAI/InformationTheory/Entanglement/FiberBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..fcd590f888c3650214e49bda122d65e8a8e09160 --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/FiberBound.lean @@ -0,0 +1,116 @@ +import Mathlib + +namespace OAI + +noncomputable section +open scoped BigOperators +namespace FiniteConstruction +variable {α β : Type} [Fintype α] [Fintype β] [DecidableEq α] [DecidableEq β] + +def Clique {τ : Type} (R : τ → τ → Prop) (s : Finset τ) : Prop := + ∀ a ∈ s, ∀ b ∈ s, a ≠ b → R a b +def HasClique {τ : Type} (R : τ → τ → Prop) (s : Finset τ) (n : ℕ) : Prop := + ∃ t : Finset τ, t ⊆ s ∧ t.card=n ∧ Clique R t +def orRelation (R : α → α → Prop) (S : β → β → Prop) (x y : α × β) : Prop := + R x.1 y.1 ∨ S x.2 y.2 + +def fiber (J : Finset (α × β)) (a : α) : Finset β := + Finset.univ.filter (fun b => (a,b) ∈ J) +omit [Fintype α] in +lemma mem_fiber {J : Finset (α × β)} {a : α} {b : β} : b ∈ fiber J a ↔ (a,b) ∈ J := by + simp [fiber] +lemma card_fibers (J : Finset (α × β)) : J.card=∑ a, (fiber J a).card := by + have he : J.card=∑ z : α × β, if z ∈ J then (1 : ℕ) else 0 := by simp + rw [he,Fintype.sum_prod_type] + apply Finset.sum_congr rfl + intro a _ + simp only [fiber,Finset.card_filter] + +omit [Fintype α] in +lemma join_cliques {R : α → α → Prop} {S : β → β → Prop} + (hR : ∀ ⦃left right⦄, R left right → R right left) + {J : Finset (α × β)} {a b : α} (hab : a ≠ b) (hr : R a b) + {n : ℕ} (ha : HasClique S (fiber J a) n) (hb : HasClique S (fiber J b) n) : + HasClique (orRelation R S) J (2*n) := by + classical + obtain ⟨U,hU,cU,pU⟩ := ha + obtain ⟨V,hV,cV,pV⟩ := hb + let U' := U.image (fun x => (a,x)) + let V' := V.image (fun x => (b,x)) + have hdis : Disjoint U' V' := by + apply Finset.disjoint_left.mpr + intro z hzU hzV + obtain ⟨u,hu,heu⟩ := Finset.mem_image.mp hzU + obtain ⟨v,hv,hev⟩ := Finset.mem_image.mp hzV + exact hab (congrArg Prod.fst (heu.trans hev.symm)) + refine ⟨U' ∪ V',?_,?_,?_⟩ + · intro z hz + rcases Finset.mem_union.mp hz with hz | hz + · obtain ⟨u,hu,rfl⟩ := Finset.mem_image.mp hz + exact mem_fiber.mp (hU hu) + · obtain ⟨v,hv,rfl⟩ := Finset.mem_image.mp hz + exact mem_fiber.mp (hV hv) + · rw [Finset.card_union_of_disjoint hdis] + have hu : U'.card=U.card := Finset.card_image_of_injective _ (fun x y h => (Prod.mk.inj h).2) + have hv : V'.card=V.card := Finset.card_image_of_injective _ (fun x y h => (Prod.mk.inj h).2) + rw [hu,hv,cU,cV] + omega + · intro x hx y hy hxy + rcases Finset.mem_union.mp hx with hx | hx <;> + rcases Finset.mem_union.mp hy with hy | hy + · obtain ⟨u,hu,rfl⟩ := Finset.mem_image.mp hx + obtain ⟨v,hv,rfl⟩ := Finset.mem_image.mp hy + exact Or.inr (pU u hu v hv (by intro he; subst v; exact hxy rfl)) + · obtain ⟨u,hu,rfl⟩ := Finset.mem_image.mp hx + obtain ⟨v,hv,rfl⟩ := Finset.mem_image.mp hy + exact Or.inl hr + · obtain ⟨u,hu,rfl⟩ := Finset.mem_image.mp hx + obtain ⟨v,hv,rfl⟩ := Finset.mem_image.mp hy + exact Or.inl (hR hr) + · obtain ⟨u,hu,rfl⟩ := Finset.mem_image.mp hx + obtain ⟨v,hv,rfl⟩ := Finset.mem_image.mp hy + exact Or.inr (pV u hu v hv (by intro he; subst v; exact hxy rfl)) + +lemma no_pair_of_no_clique_two {τ : Type} [DecidableEq τ] {R : τ → τ → Prop} + (hR : ∀ ⦃left right⦄, R left right → R right left) + {J : Finset τ} (hJ : ¬ HasClique R J 2) : + ∀ a ∈ J, ∀ b ∈ J, a ≠ b → ¬ R a b := by + intro a ha b hb hab hr + apply hJ + refine ⟨{a,b},by intro x hx; simp only [Finset.mem_insert,Finset.mem_singleton] at hx; rcases hx with rfl|rfl <;> assumption,?_,?_⟩ + · simp [hab] + · intro x hx y hy hxy + simp only [Finset.mem_insert,Finset.mem_singleton] at hx hy + rcases hx with rfl|rfl <;> rcases hy with rfl|rfl + · exact (hxy rfl).elim + · exact hr + · exact hR hr + · exact (hxy rfl).elim + +lemma amplification_bound {R : α → α → Prop} {S : β → β → Prop} + (hR : ∀ ⦃left right⦄, R left right → R right left) (a c t : ℕ) + (hbase : ∀ G : Finset α, (∀ x ∈ G, ∀ y ∈ G, x ≠ y → ¬ R x y) → G.card ≤ a) + (htail : ∀ U : Finset β, ¬ HasClique S U t → U.card ≤ c) + (J : Finset (α × β)) (hJ : ¬ HasClique (orRelation R S) J (2*t)) : + J.card ≤ a*Fintype.card β+Fintype.card α*c := by + classical + let G := Finset.univ.filter (fun x => HasClique S (fiber J x) t) + have hG : G.card ≤ a := hbase G (by + intro x hx y hy hxy hrel + exact hJ (join_cliques hR hxy hrel (Finset.mem_filter.mp hx).2 (Finset.mem_filter.mp hy).2)) + have hf (x : α) : (fiber J x).card ≤ (if x ∈ G then Fintype.card β else 0)+c := by + by_cases hx : x ∈ G + · rw [ite_eq_left hx] + exact (Finset.card_le_univ _).trans (Nat.le_add_right _ _) + · rw [ite_eq_right hx,zero_add] + exact htail _ (by simpa only [G,Finset.mem_filter,Finset.mem_univ,true_and] using hx) + rw [card_fibers] + calc + _ ≤ ∑ x : α, ((if x ∈ G then Fintype.card β else 0)+c) := Finset.sum_le_sum (fun x _ => hf x) + _ = G.card*Fintype.card β+Fintype.card α*c := by simp [Finset.sum_add_distrib] + _ ≤ _ := Nat.add_le_add_right (Nat.mul_le_mul_right _ hG) _ +end FiniteConstruction + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/FidelityTools.lean b/lean/OAI/InformationTheory/Entanglement/FidelityTools.lean new file mode 100644 index 0000000000000000000000000000000000000000..8b900b0298f1cb97a2bc2c5ac594016896f71d43 --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/FidelityTools.lean @@ -0,0 +1,72 @@ +import OAI.InformationTheory.Entanglement.Coherence + +namespace OAI + +noncomputable section +open scoped BigOperators ComplexOrder MatrixOrder Kronecker +open Matrix +namespace SecretKey +open ChannelCompletion TensorCriterion +variable {n : Type} [Fintype n] [DecidableEq n] + +def fidelity (A B : Mat n) : ℝ := traceNorm (CFC.sqrt A*CFC.sqrt B) +lemma sqrt_psd (A : Mat n) : (CFC.sqrt A).PosSemidef := + Matrix.nonneg_iff_posSemidef.mp (CFC.sqrt_nonneg A) +lemma sqrt_herm (A : Mat n) : (CFC.sqrt A)ᴴ=CFC.sqrt A := (sqrt_psd A).isHermitian.eq + +lemma traceNorm_conjTranspose (A : Mat n) : traceNorm Aᴴ=traceNorm A := by + obtain ⟨U,hU,he⟩ := MatrixPolar.polar A + conv_lhs => rw [he,Matrix.conjTranspose_mul,sqrt_herm,traceNorm_unitary_right _ (unitary_star hU)] + conv_rhs => rw [he,traceNorm_unitary_left _ hU] + +lemma sqrt_transpose {A : Mat n} (hA : A.PosSemidef) : CFC.sqrt Aᵀ=(CFC.sqrt A)ᵀ := by + apply CFC.sqrt_unique + · rw [← Matrix.transpose_mul,CFC.sqrt_mul_sqrt_self A hA.nonneg] + · exact (sqrt_psd A).transpose.nonneg + +omit [Fintype n] [DecidableEq n] in +lemma conjugate_transpose_transpose (A : Mat n) : (Aᵀ)ᴴ=(Aᴴ)ᵀ := by + ext i j + rfl + +lemma traceNorm_transpose (A : Mat n) : traceNorm Aᵀ=traceNorm A := by + rw [← traceNorm_conjTranspose A] + have hAA : (A*Aᴴ).PosSemidef := by + simpa only [Matrix.conjTranspose_conjTranspose] using Matrix.posSemidef_conjTranspose_mul_self Aᴴ + unfold traceNorm + rw [conjugate_transpose_transpose,← Matrix.transpose_mul, + sqrt_transpose hAA,Matrix.trace_transpose, + Matrix.conjTranspose_conjTranspose] + +lemma fidelity_polar (A B : Mat n) : fidelity (Aᴴ*A) (Bᴴ*B)=traceNorm (A*Bᴴ) := by + obtain ⟨U,hU,heA⟩ := MatrixPolar.polar A + obtain ⟨V,hV,heB⟩ := MatrixPolar.polar B + conv_rhs => rw [heA,heB,Matrix.conjTranspose_mul,sqrt_herm] + rw [← Matrix.mul_assoc,Matrix.mul_assoc U,traceNorm_unitary_right _ (unitary_star hV), + traceNorm_unitary_left _ hU] + rfl + +lemma fidelity_transpose {A B : Mat n} (hA : A.PosSemidef) (hB : B.PosSemidef) : + fidelity Aᵀ Bᵀ=fidelity A B := by + unfold fidelity + rw [sqrt_transpose hA,sqrt_transpose hB,← Matrix.transpose_mul,traceNorm_transpose, + ← traceNorm_conjTranspose (CFC.sqrt B*CFC.sqrt A),Matrix.conjTranspose_mul, + sqrt_herm,sqrt_herm] + +lemma unitary_trace_conj {U : Mat n} (hU : Uᴴ*U=1) (A : Mat n) : + Matrix.trace (Uᴴ*A*U)=Matrix.trace A := by + rw [Matrix.trace_mul_cycle,unitary_reverse hU,Matrix.one_mul] + +lemma unitary_traceNorm_conj {U : Mat n} (hU : Uᴴ*U=1) (A : Mat n) : + traceNorm (Uᴴ*A*U)=traceNorm A := by + rw [traceNorm_unitary_right _ hU,traceNorm_unitary_left _ (unitary_star hU)] + +lemma unitary_conj_mul {U : Mat n} (hU : Uᴴ*U=1) (A B : Mat n) : + (Uᴴ*A*U)*(Uᴴ*B*U)=Uᴴ*(A*B)*U := by + simp only [Matrix.mul_assoc] + rw [← Matrix.mul_assoc U Uᴴ,unitary_reverse hU,Matrix.one_mul] +end SecretKey + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/FiniteInputInstrument.lean b/lean/OAI/InformationTheory/Entanglement/FiniteInputInstrument.lean new file mode 100644 index 0000000000000000000000000000000000000000..a6fdb2a1d7eb5630fa3c7733f6015556401ef3d8 --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/FiniteInputInstrument.lean @@ -0,0 +1,109 @@ +import OAI.InformationTheory.Entanglement.DefaultNull +import OAI.InformationTheory.Entanglement.ChoiTransfer + +namespace OAI + +noncomputable section +open scoped BigOperators ComplexOrder MatrixOrder MeasureTheory Kronecker +open MeasureTheory Matrix +namespace SecretKey +open ChannelCompletion TensorCriterion +variable {Ω : Type*} [MeasurableSpace Ω] +variable {n e d : Type} [Fintype n] [Fintype e] [Fintype d] + [DecidableEq n] [DecidableEq e] [DecidableEq d] + +structure FiniteInputInstrument (n : Type) [Fintype n] (Ω : Type*) [MeasurableSpace Ω] where + law : Mat n →ₗ[ℂ] ComplexMeasure Ω + positive : ∀ (r : Type) [Fintype r] (A : Mat (r×n)), A.PosSemidef → + ∀ s, MeasurableSet s → Matrix.PosSemidef (fun a b => law (fun i j => A (a,i) (b,j)) s) + total : ∀ A, law A Set.univ=Matrix.trace A +namespace FiniteInputInstrument +variable (I : FiniteInputInstrument n Ω) + +def referenceLaw (A : Mat (e×n)) (hA : A.PosSemidef) : PositiveMatrixMeasure Ω e where + entry a b := I.law (fun i j => A (a,i) (b,j)) + positive s hs := I.positive e A hA s hs + +def purificationLaw (B : Matrix e n ℂ) : PositiveMatrixMeasure Ω e := + I.referenceLaw (projector (fun p : e×n => B p.1 p.2)) (Matrix.posSemidef_vecMulVec_self_star _) + +def rawProbe : PositiveMatrixMeasure Ω n := + I.referenceLaw (projector (omega (n := n))) (Matrix.posSemidef_vecMulVec_self_star _) +lemma rawProbe_entry (a b : n) : I.rawProbe.entry a b=I.law (Matrix.single a b 1) := by + change I.law (fun i j => projector (omega (n := n)) (a,i) (b,j))=_ + rw [show (fun i j => projector (omega (n := n)) (a,i) (b,j))=Matrix.single a b 1 from omega_block a b] +lemma law_entries (A : Mat n) : + I.law A=∑ i, ∑ j, A i j • I.law (Matrix.single i j 1) := by + conv_lhs => rw [Matrix.matrix_eq_sum_single A] + simp only [map_sum,← map_smul] + simp + +omit [DecidableEq e] in +theorem purificationLaw_eq_filter (B : Matrix e n ℂ) : + I.purificationLaw B=I.rawProbe.filter B := by + apply PositiveMatrixMeasure.ext_entry_default + funext a b + change I.law (fun i j => B a i*star (B b j))= + ∑ i, ∑ j, (B a i*star (B b j)) • I.rawProbe.entry i j + erw [I.law_entries] + simp only [I.rawProbe_entry] +omit [DecidableEq n] [DecidableEq e] in +lemma purificationLaw_total (B : Matrix e n ℂ) : + (I.purificationLaw B).value Set.univ=B*Bᴴ := by + ext a b + change I.law (fun i j => B a i*star (B b j)) Set.univ=_ + erw [I.total] + simp only [Matrix.trace,Matrix.diag,Matrix.mul_apply,Matrix.conjTranspose_apply] +lemma rawProbe_total : I.rawProbe.value Set.univ=1 := by + ext a b + change I.rawProbe.entry a b Set.univ=_ + erw [I.rawProbe_entry,I.total] + by_cases h : a=b + · subst b; simp [Matrix.trace, Matrix.diag, Matrix.single_apply] + · simp [Matrix.trace, Matrix.diag, Matrix.single_apply,h,Ne.symm h] + +theorem rawProbe_test (E : Mat n) (s : Set Ω) : + Matrix.trace (E*I.rawProbe.value s)=I.law Eᵀ s := by + erw [I.law_entries] + simp only [_root_.sum_apply,_root_.smul_apply,smul_eq_mul] + simp only [Matrix.trace,Matrix.diag,Matrix.mul_apply,PositiveMatrixMeasure.value, + I.rawProbe_entry,Matrix.transpose_apply] + rw [Finset.sum_comm] + +omit [DecidableEq e] [DecidableEq d] in +theorem referenceLaw_conjugation (A : Mat (e×n)) (hA : A.PosSemidef) + (B : Matrix d e ℂ) : + I.referenceLaw ((B ⊗ₖ (1 : Mat n))*A*(B ⊗ₖ (1 : Mat n))ᴴ) + (hA.mul_mul_conjTranspose_same _)=(I.referenceLaw A hA).filter B := by + apply PositiveMatrixMeasure.ext_entry_default + funext a b + change I.law (fun i j => ((B ⊗ₖ (1 : Mat n))*A*(B ⊗ₖ (1 : Mat n))ᴴ) (a,i) (b,j))= + ∑ u, ∑ v, (B a u*star (B b v)) • I.law (fun i j => A (u,i) (v,j)) + have hEntry : (fun i j => ((B ⊗ₖ (1 : Mat n))*A*(B ⊗ₖ (1 : Mat n))ᴴ) (a,i) (b,j))= + ∑ u, ∑ v, (B a u*star (B b v)) • (fun i j => A (u,i) (v,j)) := by + ext i j + simp only [Finset.sum_apply,Pi.smul_apply,smul_eq_mul] + simp only [Matrix.mul_apply,Matrix.conjTranspose_apply,Matrix.kroneckerMap_apply, + Matrix.one_apply,Fintype.sum_prod_type, + mul_one,mul_zero,ite_mul,zero_mul,apply_ite,star_zero] + simp only [Finset.sum_ite_eq,Finset.mem_univ,ite_true,Finset.sum_mul] + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro u hu + apply Finset.sum_congr rfl + intro v hv + ring + erw [hEntry,map_sum] + apply Finset.sum_congr rfl + intro u hu + erw [map_sum] + apply Finset.sum_congr rfl + intro v hv + exact I.law.map_smul _ _ + +end FiniteInputInstrument +end SecretKey + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/FiniteLawRecovery.lean b/lean/OAI/InformationTheory/Entanglement/FiniteLawRecovery.lean new file mode 100644 index 0000000000000000000000000000000000000000..d1b92725598e91966fb64e6da3370e2d52922aa5 --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/FiniteLawRecovery.lean @@ -0,0 +1,42 @@ +import OAI.InformationTheory.Entanglement.MatrixMeasureChannel +import OAI.InformationTheory.Entanglement.InstrumentCovariance + +namespace OAI + +noncomputable section +open MeasureTheory Matrix +open scoped BigOperators ComplexOrder MatrixOrder MeasureTheory +namespace SecretKey +open ChannelCompletion TensorCriterion +variable {T : Type*} [MeasurableSpace T] +variable {n e : Type} [Fintype n] [Fintype e] [DecidableEq n] [DecidableEq e] + +theorem finite_branch_law_recovery (i₀ : n) (B : Matrix e n ℂ) : + ∃ F : Map e n, ∃ hF : CP F, TracePreserving F ∧ + ∀ W : PositiveMatrixMeasure T n, + (W.filter B).channel F hF=W.filter (CFC.sqrt (Bᴴ*B)) := by + obtain ⟨F,hF,hT,hrec⟩ := finite_purification_recovery i₀ B + refine ⟨F,hF,hT,?_⟩ + intro W + apply PositiveMatrixMeasure.eq_of_value + intro s hs + rw [PositiveMatrixMeasure.channel_value,PositiveMatrixMeasure.filter_value, + PositiveMatrixMeasure.filter_value] + simpa only [(sqrt_psd (Bᴴ*B)).isHermitian.eq] using hrec (W.value s) + +theorem finite_purification_distance_recovery (i₀ : n) (B : Matrix e n ℂ) : + ∃ F : Map e n, ∃ hF : CP F, TracePreserving F ∧ + ∀ (W : Fin 2 → Fin 2 → PositiveMatrixMeasure T n) (σ : PositiveMatrixMeasure T e), + cqBitDistance (fun i j => (W i j).filter (CFC.sqrt (Bᴴ*B))) (σ.channel F hF)≤ + cqBitDistance (fun i j => (W i j).filter B) σ := by + obtain ⟨F,hF,hT,hrec⟩ := finite_branch_law_recovery (T := T) i₀ B + refine ⟨F,hF,hT,?_⟩ + intro W σ + have h := cqBitDistance_channel (fun i j => (W i j).filter B) σ F hF hT + simpa only [hrec] using h + +end SecretKey + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/FiniteRecovery.lean b/lean/OAI/InformationTheory/Entanglement/FiniteRecovery.lean new file mode 100644 index 0000000000000000000000000000000000000000..d723781390f0ce5b43b349b9b87f4ee344fde215 --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/FiniteRecovery.lean @@ -0,0 +1,108 @@ +import OAI.InformationTheory.Entanglement.TraceContractivity + +namespace OAI + +noncomputable section +open scoped BigOperators ComplexOrder MatrixOrder +open Matrix +namespace SecretKey +open ChannelCompletion TensorCriterion +variable {n e : Type} [Fintype n] [Fintype e] [DecidableEq n] [DecidableEq e] + +def eraseComplement (i₀ : n) : Map (n⊕e) n := + ad ((coord (Sum.inl : n → n⊕e))ᴴ)+∑ j : e, ad (Matrix.single i₀ (Sum.inr j) 1) +omit [Fintype n] in +lemma single_ad (i : n) (j : e) (A : Mat e) : + ad (Matrix.single i j 1) A=A j j • Matrix.single i i 1 := by + ext a b + by_cases ha : i=a <;> by_cases hb : i=b <;> + simp_all [ad,Matrix.smul_apply] +lemma eraseComplement_apply (i₀ : n) (A : Mat (n⊕e)) : + eraseComplement i₀ A=A.submatrix Sum.inl Sum.inl+ + (∑ j : e, A (Sum.inr j) (Sum.inr j)) • Matrix.single i₀ i₀ 1 := by + simp only [eraseComplement,LinearMap.add_apply,LinearMap.sum_apply,ad_apply, + Matrix.conjTranspose_conjTranspose,coord_compress] + simp_rw [← ad_apply,single_ad] + rw [Finset.sum_smul] +lemma eraseComplement_cp (i₀ : n) : CP (eraseComplement (e := e) i₀) := by + exact cp_add (cp_ad _) (cp_sum _ (fun _ => cp_ad _)) +lemma eraseComplement_tp (i₀ : n) : TracePreserving (eraseComplement (e := e) i₀) := by + intro A + rw [eraseComplement_apply,Matrix.trace_add,Matrix.trace_smul] + simp only [Matrix.trace,Matrix.diag,Matrix.submatrix_apply,Fintype.sum_sum_type] + simp [Matrix.single_apply] +lemma eraseComplement_keep (i₀ : n) (A : Mat n) : + eraseComplement (e := e) i₀ (ad (coord (Sum.inl : n → n⊕e)) A)=A := by + rw [eraseComplement_apply] + have hk := coord_isometry (Sum.inl : n → n⊕e) Sum.inl_injective + have he : (ad (coord (Sum.inl : n → n⊕e)) A).submatrix Sum.inl Sum.inl=A := by + rw [← coord_compress,ad_apply] + simp only [← Matrix.mul_assoc,hk,Matrix.one_mul] + rw [Matrix.mul_assoc,hk,Matrix.mul_one] + rw [he] + have hz (j : e) : ad (coord (Sum.inl : n → n⊕e)) A (Sum.inr j) (Sum.inr j)=0 := by + simp [ad,coord,Matrix.mul_apply] + simp only [hz,Finset.sum_const_zero,zero_smul,add_zero] +lemma ad_tracePreserving {a b : Type} [Fintype a] [Fintype b] [DecidableEq a] + (V : Matrix b a ℂ) (hV : Vᴴ*V=1) : TracePreserving (ad V) := by + intro A + rw [ad_apply,Matrix.trace_mul_cycle,hV,Matrix.one_mul] +lemma tp_comp {a b c : Type} [Fintype a] [Fintype b] [Fintype c] + {F : Map a b} {G : Map b c} (hF : TracePreserving F) (hG : TracePreserving G) : + TracePreserving (G.comp F) := by intro A; exact (hG (F A)).trans (hF A) + +theorem finite_purification_recovery (i₀ : n) (B : Matrix e n ℂ) : + ∃ F : Map e n, CP F ∧ TracePreserving F ∧ + ∀ A : Mat n, F (B*A*Bᴴ)=CFC.sqrt (Bᴴ*B)*A*CFC.sqrt (Bᴴ*B) := by + let K := coord (Sum.inl : n → n⊕e) + let J := coord (Sum.inr : e → n⊕e) + have hK : Kᴴ*K=1 := coord_isometry _ Sum.inl_injective + have hJ : Jᴴ*J=1 := coord_isometry _ Sum.inr_injective + let R := Bᴴ*B + let C := J*B*Kᴴ + have hgram : Cᴴ*C=K*R*Kᴴ := by + dsimp [C,R] + rw [Matrix.conjTranspose_mul,Matrix.conjTranspose_mul,Matrix.conjTranspose_conjTranspose] + simp only [Matrix.mul_assoc] + rw [← Matrix.mul_assoc Jᴴ J,hJ,Matrix.one_mul] + have hsqrt : CFC.sqrt (Cᴴ*C)=K*CFC.sqrt R*Kᴴ := by + apply CFC.sqrt_unique + · rw [hgram] + calc + (K*CFC.sqrt R*Kᴴ)*(K*CFC.sqrt R*Kᴴ)=K*(CFC.sqrt R*CFC.sqrt R)*Kᴴ := by + simp only [Matrix.mul_assoc] + rw [← Matrix.mul_assoc Kᴴ K,hK,Matrix.one_mul] + _=K*R*Kᴴ := by rw [CFC.sqrt_mul_sqrt_self R (Matrix.posSemidef_conjTranspose_mul_self B).nonneg] + · exact ((sqrt_psd R).mul_mul_conjTranspose_same K).nonneg + obtain ⟨U,hU,hC⟩ := MatrixPolar.polar C + have hU' := unitary_reverse hU + have hfactor : Uᴴ*J*B=K*CFC.sqrt R := by + have hh := congrArg (fun M => Uᴴ*M*K) hC + rw [hsqrt] at hh + dsimp only [C] at hh + simpa only [Matrix.mul_assoc,← Matrix.mul_assoc Kᴴ K,hK,Matrix.mul_one, + ← Matrix.mul_assoc Uᴴ U,hU,Matrix.one_mul] using hh + let F := (eraseComplement (e := e) i₀).comp (ad (Uᴴ*J)) + refine ⟨F,cp_comp (eraseComplement_cp i₀) (cp_ad _),?_,?_⟩ + · apply tp_comp _ (eraseComplement_tp i₀) + apply ad_tracePreserving + rw [Matrix.conjTranspose_mul,Matrix.conjTranspose_conjTranspose] + simp only [Matrix.mul_assoc] + rw [← Matrix.mul_assoc U Uᴴ,hU',Matrix.one_mul,hJ] + · intro A + change eraseComplement i₀ (ad (Uᴴ*J) (B*A*Bᴴ))=_ + have hh : ad (Uᴴ*J) (B*A*Bᴴ)= + ad K (CFC.sqrt R*A*CFC.sqrt R) := by + have he : (Uᴴ*J)*B=K*CFC.sqrt R := by simpa only [Matrix.mul_assoc] using hfactor + rw [ad_apply,ad_apply] + calc + _=((Uᴴ*J)*B)*A*((Uᴴ*J)*B)ᴴ := by simp only [Matrix.conjTranspose_mul,Matrix.mul_assoc] + _=(K*CFC.sqrt R)*A*(K*CFC.sqrt R)ᴴ := by rw [he] + _=_ := by rw [Matrix.conjTranspose_mul,sqrt_herm]; simp only [Matrix.mul_assoc] + rw [hh,eraseComplement_keep] + +end SecretKey + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/FirstBitLaw.lean b/lean/OAI/InformationTheory/Entanglement/FirstBitLaw.lean new file mode 100644 index 0000000000000000000000000000000000000000..c5138ba27b431fc877a4dc1b0473da13024e06dc --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/FirstBitLaw.lean @@ -0,0 +1,72 @@ +import OAI.InformationTheory.Entanglement.HilbertCoarsegrain + +namespace OAI + +noncomputable section +open scoped BigOperators ENNReal MeasureTheory InnerProductSpace ComplexOrder +open MeasureTheory ContinuousLinearMap +namespace SecretKey +variable {T : Type*} [MeasurableSpace T] +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {ι a : Type*} [Fintype a] [DecidableEq a] + +def uniformKeyLaw (b : HilbertBasis ι ℂ H) (σ : PositiveHilbertMeasure T H b) : + (a×a)→PositiveHilbertMeasure T H b := fun p => + σ.scale (if p.1=p.2 then (Fintype.card a : ℝ)⁻¹ else 0) (by + split_ifs + · exact inv_nonneg.mpr (Nat.cast_nonneg _) + · rfl) +lemma uniformKeyLaw_value (b : HilbertBasis ι ℂ H) (σ : PositiveHilbertMeasure T H b) + (p : a×a) (s : Set T) : + (uniformKeyLaw b σ p).value s= + if p.1=p.2 then ((Fintype.card a : ℂ)⁻¹) • σ.value s else 0 := by + simp only [uniformKeyLaw,PositiveHilbertMeasure.scale_value] + split_ifs <;> simp +omit [DecidableEq a] in +lemma firstBitPush_value (b : HilbertBasis ι ℂ H) + (W : ((Fin 2×a)×(Fin 2×a))→PositiveHilbertMeasure T H b) (i j : Fin 2) (s : Set T) : + (localClassicalPush b Prod.fst Prod.fst W (i,j)).value s= + ∑ x : a, ∑ y : a, (W ((i,x),(j,y))).value s := by + simp only [localClassicalPush,classicalPush_value,Finset.sum_filter,Fintype.sum_prod_type, + Prod.map_apply,Prod.mk.injEq] + fin_cases i <;> fin_cases j <;> simp +lemma firstBitPush_ideal_value [Nonempty a] (b : HilbertBasis ι ℂ H) + (σ : PositiveHilbertMeasure T H b) (i j : Fin 2) (s : Set T) : + (localClassicalPush b Prod.fst Prod.fst (uniformKeyLaw b σ (a := Fin 2×a)) (i,j)).value s= + hilbertIdeal σ.value i j s := by + rw [firstBitPush_value] + simp only [uniformKeyLaw_value,Prod.mk.injEq,Fintype.card_prod,Fintype.card_fin] + by_cases hij : i=j + · simp only [hij,true_and,Finset.sum_ite_eq,Finset.mem_univ,ite_true,Finset.sum_const,Finset.card_univ, + hilbertIdeal] + rw [← Nat.cast_smul_eq_nsmul ℂ,smul_smul] + congr 1 + have hn : (Fintype.card a : ℂ)≠0 := by exact_mod_cast Fintype.card_ne_zero + push_cast + field_simp + · simp [hij,hilbertIdeal] + +theorem first_bit_contract [Nonempty a] (b : HilbertBasis ι ℂ H) + (W : ((Fin 2×a)×(Fin 2×a))→PositiveHilbertMeasure T H b) + (σ : PositiveHilbertMeasure T H b) : + hilbertCQDistance b (fun i j => localClassicalPush b Prod.fst Prod.fst W (i,j)) σ≤ + hilbertClassicalDistance b W (uniformKeyLaw b σ) := by + have h := classicalPush_contract b (Prod.map Prod.fst Prod.fst) W (uniformKeyLaw b σ) + apply le_trans ?_ h + apply le_of_eq + simp only [hilbertCQDistance,hilbertClassicalDistance,Fintype.sum_prod_type] + apply Finset.sum_congr rfl + intro i hi + apply Finset.sum_congr rfl + intro j hj + apply hilbertVariation_congr + intro s hs + change _ = (localClassicalPush b Prod.fst Prod.fst W (i,j)).value s - + (localClassicalPush b Prod.fst Prod.fst (uniformKeyLaw b σ) (i,j)).value s + rw [firstBitPush_ideal_value] + +end SecretKey + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/FullQuantumConsumer.lean b/lean/OAI/InformationTheory/Entanglement/FullQuantumConsumer.lean new file mode 100644 index 0000000000000000000000000000000000000000..5f11df6eaf3391065129f8548766ef9e36be8d97 --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/FullQuantumConsumer.lean @@ -0,0 +1,73 @@ +import OAI.InformationTheory.Entanglement.HilbertLawRecovery +import OAI.InformationTheory.Entanglement.HilbertLawFinite +import OAI.InformationTheory.Entanglement.FactorizedLawGap + +namespace OAI + +noncomputable section +open scoped BigOperators ENNReal MeasureTheory InnerProductSpace ComplexOrder MatrixOrder Kronecker +open MeasureTheory Matrix ContinuousLinearMap +namespace SecretKey +open ChannelCompletion TensorCriterion +variable {T : Type*} [MeasurableSpace T] +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {ι : Type*} {n m e : Type} [Fintype n] [Fintype m] [Fintype e] + [DecidableEq n] [DecidableEq m] [DecidableEq e] +lemma canonical_filter_eveBlock (R : Mat (n×m)) (hR : R.PosSemidef) (D : Mat (n×m)) : + CFC.sqrt Rᵀ*Dᵀ*(CFC.sqrt Rᵀ)ᴴ=eveBlock R D := by + rw [sqrt_transpose hR,conjugate_transpose_transpose,sqrt_herm] + simp only [eveBlock,Matrix.transpose_mul,Matrix.mul_assoc] + +theorem full_quantum_factorized_gap (b : HilbertBasis ι ℂ H) + (R : Mat (n×m)) (hR : Represented R) (i₀ : n×m) + (v : e→H) (hv : Orthonormal ℂ v) (j₀ : e) (B : Matrix e (n×m) ℂ) + (hGram : Bᴴ*B=Rᵀ) + (M : Fin 2 → Fin 2 → PositiveMatrixMeasure T (n×m)) + (μ : Measure T) [IsFiniteMeasure μ] + (X : Fin 2 → T → Mat n) (Y : Fin 2 → T → Mat m) + (hXm : ∀ i, Measurable (X i)) (hYm : ∀ j, Measurable (Y j)) + (hXp : ∀ i t, (X i t).PosSemidef) (hYp : ∀ j t, (Y j t).PosSemidef) + (hMi : ∀ i j a c, Integrable (fun t => ((X i t ⊗ₖ Y j t)ᵀ) a c) μ) + (hMs : ∀ i j s, MeasurableSet s → ∀ a c, + (∫ t in s, ((X i t ⊗ₖ Y j t)ᵀ) a c ∂μ)=(M i j).value s a c) + (hW1 : (∑ i, ∑ j, (Matrix.trace (((M i j).filter B).value Set.univ)).re)=1) + (σ : PositiveHilbertMeasure T H b) (hσ1 : σ.traceMeasure Set.univ=1) : + ENNReal.ofReal (1/5) ≤ hilbertCQDistance b + (fun i j => ((M i j).filter B).hilbertEmbedding b v hv) σ := by + obtain ⟨F,hF,hTP,hrec,hcontract⟩ := hilbert_purification_law_recovery (T := T) b v hv j₀ i₀ B + let W := fun i j => (M i j).filter (CFC.sqrt (Bᴴ*B)) + let σ' := (σ.erase v hv j₀).channel F hF + have hWPs (i j : Fin 2) : ((M i j).filter B).channel F hF=W i j := by + simpa only [PositiveMatrixMeasure.hilbertEmbedding_recovered] using hrec (M i j) + have hWnorm : (∑ i, ∑ j, (Matrix.trace ((W i j).value Set.univ)).re)=1 := by + calc + _ = ∑ i, ∑ j, (Matrix.trace ((((M i j).filter B).channel F hF).value Set.univ)).re := by + simp only [hWPs] + _ = 1 := by simpa only [PositiveMatrixMeasure.channel_value,show ∀ A, Matrix.trace (F A)=Matrix.trace A from hTP] using hW1 + have hσnorm : (Matrix.trace (σ'.value Set.univ)).re=1 := by + rw [← PositiveMatrixMeasure.traceMeasure_real _ MeasurableSet.univ] + change (((σ.erase v hv j₀).channel F hF).traceMeasure Set.univ).toReal=1 + rw [PositiveMatrixMeasure.channel_traceMeasure _ F hF hTP, + PositiveHilbertMeasure.erase_traceMeasure,hσ1] + norm_num + have hp := hR.1 + have hdiag (i j t) : CFC.sqrt (Bᴴ*B)*(X i t ⊗ₖ Y j t)ᵀ*(CFC.sqrt (Bᴴ*B))ᴴ= + eveBlock R (X i t ⊗ₖ Y j t) := by + rw [hGram] + exact canonical_filter_eveBlock R hp _ + have hg : 1/5 ≤ cqBitDistance W σ' := by + apply factorized_law_gap R hR W σ' μ X Y hXm hYm hXp hYp + · intro i j a c + simpa only [hdiag] using filter_density_integrable (hMi i j) (CFC.sqrt (Bᴴ*B)) a c + · intro i j s hs a c + simpa only [hdiag] using filter_setIntegral (M i j) (CFC.sqrt (Bᴴ*B)) + (fun t => (X i t ⊗ₖ Y j t)ᵀ) (hMi i j) (hMs i j) hs a c + · exact hWnorm + · exact hσnorm + exact (ENNReal.ofReal_le_ofReal hg).trans (hcontract M σ) + +end SecretKey + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/FunctionCardinality.lean b/lean/OAI/InformationTheory/Entanglement/FunctionCardinality.lean new file mode 100644 index 0000000000000000000000000000000000000000..ff84786e054e85328e3c15a4086650a9b69d1f20 --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/FunctionCardinality.lean @@ -0,0 +1,17 @@ +import OAI.InformationTheory.Entanglement.CombinatorialNumbers + +namespace OAI + +noncomputable section +namespace FiniteConstruction + +lemma function_card_eq_dimension {α β : Type} [Fintype α] [Fintype β] [DecidableEq α] + (ha : Fintype.card α=L) (hb : Fintype.card β=4) : + Fintype.card (α→β)=D := by + unfold D + rw [Fintype.card_fun,ha,hb] +end FiniteConstruction + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/HermitianBanach.lean b/lean/OAI/InformationTheory/Entanglement/HermitianBanach.lean new file mode 100644 index 0000000000000000000000000000000000000000..8e2bd577942f869ee334cdc6c25e1e46e5ce613b --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/HermitianBanach.lean @@ -0,0 +1,134 @@ +import OAI.InformationTheory.Entanglement.TraceStateBounds + +namespace OAI + +noncomputable section +open scoped InnerProductSpace ComplexOrder +open ContinuousLinearMap Filter +namespace SecretKey +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {ι : Type*} +lemma hermitianTraceClass_real_smul (b : HilbertBasis ι ℂ H) (r : ℝ) + {A : H→L[ℂ]H} (hA : HermitianTraceClass b A) : HermitianTraceClass b (r • A) := by + refine ⟨(show IsSelfAdjoint r by simp [IsSelfAdjoint]).smul hA.1,?_⟩ + rw [CFC.abs_smul] + refine ⟨smul_nonneg (norm_nonneg r) hA.2.1,?_⟩ + change Summable (fun i => (inner ℂ (b i) (((‖r‖ : ℝ) : ℂ) • CFC.abs A (b i))).re) + simpa only [inner_smul_right,Complex.mul_re,Complex.ofReal_re,Complex.ofReal_im,zero_mul,sub_zero] + using hA.2.2.mul_left ‖r‖ +lemma hilbertTraceNorm_real_smul (b : HilbertBasis ι ℂ H) (r : ℝ) (A : H→L[ℂ]H) : + hilbertTraceNorm b (r • A)=‖r‖*hilbertTraceNorm b A := by + rw [hilbertTraceNorm,CFC.abs_smul] + change (∑' i, (inner ℂ (b i) (((‖r‖ : ℝ) : ℂ) • CFC.abs A (b i))).re)=_ + simp only [inner_smul_right,Complex.mul_re,Complex.ofReal_re,Complex.ofReal_im,zero_mul,sub_zero] + exact tsum_mul_left +lemma hilbertTraceNorm_nonneg (b : HilbertBasis ι ℂ H) (A : H→L[ℂ]H) : + 0≤hilbertTraceNorm b A := by + exact tsum_nonneg (fun i => (nonneg_iff_isPositive.mp (CFC.abs_nonneg A)).re_inner_nonneg_right _) +lemma opNorm_le_traceNorm (b : HilbertBasis ι ℂ H) {A : H→L[ℂ]H} + (hA : HermitianTraceClass b A) : ‖A‖≤hilbertTraceNorm b A := by + simpa only [CFC.norm_abs,hilbertTraceNorm] using positive_opNorm_le_trace b hA.2 + +def hermitianTraceSpace (b : HilbertBasis ι ℂ H) : Submodule ℝ (H→L[ℂ]H) where + carrier := {A | HermitianTraceClass b A} + zero_mem' := by simp [HermitianTraceClass,HasFinitePositiveTrace] + add_mem' hA hB := (hilbertTraceNorm_triangle b hA hB).1 + smul_mem' r A hA := hermitianTraceClass_real_smul b r hA + +def HermitianTrace (b : HilbertBasis ι ℂ H) : Type _ := ↥(hermitianTraceSpace b) +namespace HermitianTrace +variable (b : HilbertBasis ι ℂ H) +instance hermitianTraceAddCommGroup : AddCommGroup (HermitianTrace b) := inferInstanceAs (AddCommGroup (hermitianTraceSpace b)) +instance hermitianTraceModule : Module ℝ (HermitianTrace b) := inferInstanceAs (Module ℝ (hermitianTraceSpace b)) +def operator (A : HermitianTrace b) : H→L[ℂ]H := A.val +lemma property (A : HermitianTrace b) : HermitianTraceClass b (operator b A) := Subtype.property A +instance hermitianTraceNorm : Norm (HermitianTrace b) := ⟨fun A => hilbertTraceNorm b (operator b A)⟩ +@[simp] lemma operator_add (A B : HermitianTrace b) : operator b (A+B)=operator b A+operator b B := rfl +@[simp] lemma operator_sub (A B : HermitianTrace b) : operator b (A-B)=operator b A-operator b B := rfl +@[simp] lemma operator_smul (r : ℝ) (A : HermitianTrace b) : operator b (r • A)=r • operator b A := rfl +@[simp] lemma operator_zero : operator b 0=0 := rfl +lemma norm_eq (A : HermitianTrace b) : ‖A‖=hilbertTraceNorm b (operator b A) := rfl +lemma core : NormedSpace.Core ℝ (HermitianTrace b) where + norm_nonneg A := hilbertTraceNorm_nonneg b _ + norm_smul r A := hilbertTraceNorm_real_smul b r _ + norm_triangle A B := (hilbertTraceNorm_triangle b (property b A) (property b B)).2 + norm_eq_zero_iff A := by + constructor + · intro h + apply Subtype.ext + apply norm_eq_zero.mp + exact le_antisymm (h ▸ opNorm_le_traceNorm b (property b A)) (norm_nonneg _) + · intro h; rw [h]; simp [norm_eq,hilbertTraceNorm,hilbertTrace] +instance hermitianTraceNormedAddCommGroup : NormedAddCommGroup (HermitianTrace b) := NormedAddCommGroup.ofCore (core b) +instance hermitianTraceNormedSpace : NormedSpace ℝ (HermitianTrace b) := NormedSpace.ofCore (core b) + +def inclusion : HermitianTrace b →L[ℝ] H→L[ℂ]H := + ({ toFun := operator b + map_add' := operator_add b + map_smul' := fun r A => operator_smul b r A } : HermitianTrace b →ₗ[ℝ] H→L[ℂ]H).mkContinuous 1 + (fun A => by + change ‖operator b A‖ ≤ 1 * hilbertTraceNorm b (operator b A) + simpa only [one_mul] using opNorm_le_traceNorm b (property b A)) +end HermitianTrace + +lemma traceNorm_fatou_bound (b : HilbertBasis ι ℂ H) {A : ℕ→H→L[ℂ]H} {T : H→L[ℂ]H} + (hlim : Tendsto A atTop (nhds T)) (hA : ∀ n, HermitianTraceClass b (A n)) + {C : ℝ} (hC : ∀ᶠ n in atTop, hilbertTraceNorm b (A n)≤C) : + HermitianTraceClass b T ∧ hilbertTraceNorm b T≤C := by + have hself : IsSelfAdjoint T := by + have hs := hlim.star + exact tendsto_nhds_unique hs (hlim.congr' (Filter.Eventually.of_forall (fun n => (hA n).1.star_eq.symm))) + have hnorm : Tendsto (fun n => CFC.abs (A n)) atTop (nhds (CFC.abs T)) := + CFC.continuous_abs.continuousAt.tendsto.comp hlim + have hdiag (i : ι) : Tendsto (fun n => (inner ℂ (b i) (CFC.abs (A n) (b i))).re) + atTop (nhds (inner ℂ (b i) (CFC.abs T (b i))).re) := by + exact Complex.continuous_re.continuousAt.tendsto.comp + (tendsto_const_nhds.inner ((ContinuousLinearMap.apply ℂ H (b i)).continuous.continuousAt.tendsto.comp hnorm)) + have hn (i : ι) : 0≤(inner ℂ (b i) (CFC.abs T (b i))).re := + (nonneg_iff_isPositive.mp (CFC.abs_nonneg T)).re_inner_nonneg_right _ + have hbound (s : Finset ι) : ∑ i∈s, (inner ℂ (b i) (CFC.abs T (b i))).re≤C := by + apply le_of_tendsto (tendsto_finsetSum s (fun i hi => hdiag i)) + filter_upwards [hC] with n hn + exact ((hA n).2.2.sum_le_tsum s (fun i hi => + (nonneg_iff_isPositive.mp (CFC.abs_nonneg (A n))).re_inner_nonneg_right _)).trans hn + exact ⟨⟨hself, CFC.abs_nonneg T, summable_of_sum_le hn hbound⟩, + Real.tsum_le_of_sum_le hn hbound⟩ +namespace HermitianTrace +variable (b : HilbertBasis ι ℂ H) + +instance completeSpace : CompleteSpace (HermitianTrace b) := by + apply Metric.complete_of_cauchySeq_tendsto + intro u hu + obtain ⟨T,hT⟩ := cauchySeq_tendsto_of_complete ((inclusion b).uniformContinuous.comp_cauchySeq hu) + change Tendsto (fun n => operator b (u n)) atTop (nhds T) at hT + obtain ⟨N,hN⟩ := Metric.cauchySeq_iff.mp hu 1 zero_lt_one + have hbound : ∀ᶠ n in atTop, hilbertTraceNorm b (operator b (u n)) ≤ ‖u N‖+1 := by + filter_upwards [eventually_ge_atTop N] with n hn + change ‖u n‖ ≤ ‖u N‖+1 + have hh := hN n hn N le_rfl + rw [dist_eq_norm] at hh + simpa only [sub_add_cancel] using (norm_add_le (u n-u N) (u N)).trans + (by linarith : ‖u n-u N‖+‖u N‖≤‖u N‖+1) + have hTC := traceNorm_fatou_bound b hT (fun n => property b (u n)) hbound + let t : HermitianTrace b := ⟨T,hTC.1⟩ + refine ⟨t,Metric.tendsto_atTop.mpr ?_⟩ + intro ε hε + obtain ⟨M,hM⟩ := Metric.cauchySeq_iff.mp hu (ε/2) (by positivity) + refine ⟨M,fun m hm => ?_⟩ + have hdiff : Tendsto (fun n => operator b (u n)-operator b (u m)) atTop + (nhds (T-operator b (u m))) := hT.sub_const _ + have hsmall : ∀ᶠ n in atTop, hilbertTraceNorm b (operator b (u n)-operator b (u m)) ≤ ε/2 := by + filter_upwards [eventually_ge_atTop M] with n hn + change ‖u n-u m‖≤ε/2 + simpa only [dist_eq_norm] using (hM n hn m hm).le + have hlim := (traceNorm_fatou_bound b hdiff (fun n => property b (u n-u m)) hsmall).2 + have : ‖t-u m‖≤ε/2 := hlim + rw [dist_comm,dist_eq_norm] + exact this.trans_lt (by linarith) +end HermitianTrace + +end SecretKey + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/HermitianInstrument.lean b/lean/OAI/InformationTheory/Entanglement/HermitianInstrument.lean new file mode 100644 index 0000000000000000000000000000000000000000..f21fd037b235da5e70a2c34877f8c00c440cd141 --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/HermitianInstrument.lean @@ -0,0 +1,111 @@ +import OAI.InformationTheory.Entanglement.HermitianBanach +import OAI.InformationTheory.Entanglement.InstrumentContraction + +namespace OAI + +noncomputable section +open scoped InnerProductSpace ComplexOrder MeasureTheory +open ContinuousLinearMap MeasureTheory +namespace SecretKey +variable {H K : Type*} + [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + [NormedAddCommGroup K] [InnerProductSpace ℂ K] [CompleteSpace K] +variable {ι κ : Type*} +namespace HermitianTrace +variable (b : HilbertBasis ι ℂ H) +def asTraceClass (A : HermitianTrace b) : TraceClass b := + ⟨operator b A,by + obtain ⟨hp,hn⟩ := hermitian_parts_finite b (property b A) + rw [← CFC.posPart_sub_negPart (operator b A) (property b A).1] + exact (traceClassSpace b).sub_mem (Submodule.subset_span hp) (Submodule.subset_span hn)⟩ +@[simp] lemma asTraceClass_operator (A : HermitianTrace b) : (asTraceClass b A).val=operator b A := rfl +@[simp] lemma asTraceClass_add (A B : HermitianTrace b) : asTraceClass b (A+B)=asTraceClass b A+asTraceClass b B := rfl +@[simp] lemma asTraceClass_smul (s : ℝ) (A : HermitianTrace b) : + asTraceClass b (s • A)=(s : ℂ) • asTraceClass b A := by + apply Subtype.ext + exact (Complex.coe_smul s (operator b A)).symm +instance : MeasurableSpace (HermitianTrace b) := borel _ +instance : BorelSpace (HermitianTrace b) := ⟨rfl⟩ +end HermitianTrace +variable {X : Type*} [MeasurableSpace X] +namespace TraceInstrument +variable {b : HilbertBasis ι ℂ H} {c : HilbertBasis κ ℂ K} +variable (I : TraceInstrument b c X) +omit [CompleteSpace H] in +lemma event_positive_trace_bound (A : TraceClass b) (hA : 0≤A.val) + {s : Set X} (hs : MeasurableSet s) : + HasFinitePositiveTrace c (I.event s A).val ∧ + hilbertTrace c (I.event s A).val≤hilbertTrace b A.val := by + have hp := (traceClass_positive_iff c _).mp + ⟨(I.event s A).property,cp_trace_positive b c (I.event_cp s hs) hA⟩ + refine ⟨hp,?_⟩ + rw [← I.law_value A hA s hs,← (I.law A hA).trace_value s hs] + have hm : (I.law A hA).traceMeasure.real s≤(I.law A hA).traceMeasure.real Set.univ := by + exact ENNReal.toReal_mono (measure_ne_top _ _) (measure_mono (Set.subset_univ s)) + apply hm.trans_eq + rw [(I.law A hA).trace_value _ MeasurableSet.univ,I.law_value _ _ _ MeasurableSet.univ, + ← traceClassTrace_re,I.trace_preserving,traceClassTrace_re] + +lemma event_traceNorm_bound (A : TraceClass b) (hA : HermitianTraceClass b A.val) + {s : Set X} (hs : MeasurableSet s) : + HermitianTraceClass c (I.event s A).val ∧ + hilbertTraceNorm c (I.event s A).val≤hilbertTraceNorm b A.val := by + obtain ⟨hp,hn⟩ := hermitian_parts_finite b hA + let P : TraceClass b := ⟨posPart A.val,Submodule.subset_span hp⟩ + let N : TraceClass b := ⟨negPart A.val,Submodule.subset_span hn⟩ + have he : P-N=A := Subtype.ext (CFC.posPart_sub_negPart _ hA.1) + have hp' := I.event_positive_trace_bound P hp.1 hs + have hn' := I.event_positive_trace_bound N hn.1 hs + have hh := positive_difference_traceClass c hp'.1 hn'.1 + have heF : (I.event s A).val=(I.event s P).val-(I.event s N).val := by + rw [← Submodule.coe_sub,← map_sub,he] + rw [← heF] at hh + refine ⟨hh.1,hh.2.trans ?_⟩ + rw [hilbertTraceNorm_jordan b hA] + exact add_le_add hp'.2 hn'.2 +def hermitianEventApply (s : Set X) (hs : MeasurableSet s) (A : HermitianTrace b) : + HermitianTrace c := by + refine ⟨(I.event s (HermitianTrace.asTraceClass b A)).val,?_⟩ + change HermitianTraceClass c (I.event s (HermitianTrace.asTraceClass b A)).val + exact (I.event_traceNorm_bound (HermitianTrace.asTraceClass b A) + (HermitianTrace.property b A) hs).1 +lemma hermitianEventApply_add (s : Set X) (hs : MeasurableSet s) (A B : HermitianTrace b) : + I.hermitianEventApply s hs (A+B)=I.hermitianEventApply s hs A+I.hermitianEventApply s hs B := by + apply Subtype.ext + change (I.event s (HermitianTrace.asTraceClass b (A+B))).val= + (I.event s (HermitianTrace.asTraceClass b A)).val+(I.event s (HermitianTrace.asTraceClass b B)).val + rw [HermitianTrace.asTraceClass_add,map_add] + rfl +lemma hermitianEventApply_smul (s : Set X) (hs : MeasurableSet s) (r : ℝ) (A : HermitianTrace b) : + I.hermitianEventApply s hs (r • A)=r • I.hermitianEventApply s hs A := by + apply Subtype.ext + change (I.event s (HermitianTrace.asTraceClass b (r • A))).val= + r • (I.event s (HermitianTrace.asTraceClass b A)).val + rw [HermitianTrace.asTraceClass_smul,map_smul] + exact Complex.coe_smul r _ +def hermitianEventLinear (s : Set X) (hs : MeasurableSet s) : HermitianTrace b →ₗ[ℝ] HermitianTrace c where + toFun := I.hermitianEventApply s hs + map_add' := I.hermitianEventApply_add s hs + map_smul' := I.hermitianEventApply_smul s hs +lemma hermitianEventLinear_norm (s : Set X) (hs : MeasurableSet s) (A : HermitianTrace b) : + ‖I.hermitianEventLinear s hs A‖≤1*‖A‖ := by + change hilbertTraceNorm c (I.event s (HermitianTrace.asTraceClass b A)).val≤ + 1*hilbertTraceNorm b (HermitianTrace.operator b A) + simpa only [one_mul,HermitianTrace.asTraceClass_operator] using (I.event_traceNorm_bound (HermitianTrace.asTraceClass b A) + (HermitianTrace.property b A) hs).2 + +def hermitianEvent (s : Set X) (hs : MeasurableSet s) : + HermitianTrace b →L[ℝ] HermitianTrace c := + (I.hermitianEventLinear s hs).mkContinuous 1 (I.hermitianEventLinear_norm s hs) + +lemma event_integral {S : Type*} [MeasurableSpace S] (μ : Measure S) + (f : S→HermitianTrace b) (hf : Integrable f μ) {s : Set X} (hs : MeasurableSet s) : + I.hermitianEvent s hs (∫ h, f h ∂μ)=∫ h, I.hermitianEvent s hs (f h) ∂μ := by + exact ((I.hermitianEvent s hs).integral_comp_comm hf).symm +end TraceInstrument + +end SecretKey + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/HilbertCanonicalRecovery.lean b/lean/OAI/InformationTheory/Entanglement/HilbertCanonicalRecovery.lean new file mode 100644 index 0000000000000000000000000000000000000000..174217238b6b20d6358eb909ffb38f7d92833e40 --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/HilbertCanonicalRecovery.lean @@ -0,0 +1,49 @@ +import OAI.InformationTheory.Entanglement.HilbertEmbedding +import OAI.InformationTheory.Entanglement.PurificationSupport + +namespace OAI + +noncomputable section +open scoped BigOperators InnerProductSpace ComplexOrder MatrixOrder +open ContinuousLinearMap Matrix +namespace SecretKey +open ChannelCompletion TensorCriterion +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {ι : Type*} {n e : Type} [Fintype n] [Fintype e] [DecidableEq n] [DecidableEq e] +lemma hilbertErase_hermitian_traceClass (b : HilbertBasis ι ℂ H) (v : e → H) + (hv : Orthonormal ℂ v) (j₀ : e) {T : H →L[ℂ] H} (hT : HermitianTraceClass b T) : + (hilbertErase b v j₀ T).IsHermitian := by + obtain ⟨hp,hm⟩ := hermitian_parts_finite b hT + have he : hilbertErase b v j₀ (posPart T)-hilbertErase b v j₀ (negPart T)=hilbertErase b v j₀ T := by + rw [← hilbertErase_sub b v j₀ _ _ hp.2 hm.2,CFC.posPart_sub_negPart T hT.1] + rw [← he] + exact (hilbertErase_psd b v hv j₀ hp).isHermitian.sub (hilbertErase_psd b v hv j₀ hm).isHermitian + +theorem hilbert_canonical_recovery (b : HilbertBasis ι ℂ H) (v : e → H) + (hv : Orthonormal ℂ v) (j₀ : e) (i₀ : n) (B : Matrix e n ℂ) : + ∃ F : Map e n, CP F ∧ TracePreserving F ∧ + (∀ {T : H →L[ℂ] H}, HasFinitePositiveTrace b T → + (F (hilbertErase b v j₀ T)).PosSemidef) ∧ + (∀ T : H →L[ℂ] H, (Matrix.trace (F (hilbertErase b v j₀ T))).re=hilbertTrace b T) ∧ + (∀ {T : H →L[ℂ] H}, HermitianTraceClass b T → + traceNorm (F (hilbertErase b v j₀ T))≤hilbertTraceNorm b T) ∧ + ∀ A : Mat n, F (hilbertErase b v j₀ (hilbertEmbed v (B*A*Bᴴ)))= + CFC.sqrt (Bᴴ*B)*A*CFC.sqrt (Bᴴ*B) := by + obtain ⟨F,hF,hTP,hrec⟩ := finite_purification_recovery i₀ B + refine ⟨F,hF,hTP,?_,?_,?_,?_⟩ + · intro T hT + exact cp_positive hF (hilbertErase_psd b v hv j₀ hT) + · intro T + rw [hTP,hilbertErase_trace] + · intro T hT + exact (traceNorm_cptp F hF hTP (hilbertErase_hermitian_traceClass b v hv j₀ hT)).trans + (hilbertErase_contract b v hv j₀ hT) + · intro A + rw [hilbertErase_embed b v hv] + exact hrec A + +end SecretKey + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/HilbertChannel.lean b/lean/OAI/InformationTheory/Entanglement/HilbertChannel.lean new file mode 100644 index 0000000000000000000000000000000000000000..a8017b449277e2b6f8c93f46237b9f1e746fec70 --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/HilbertChannel.lean @@ -0,0 +1,88 @@ +import OAI.InformationTheory.Entanglement.TraceInstrument + +namespace OAI + +noncomputable section +open scoped BigOperators InnerProductSpace ComplexOrder +open ContinuousLinearMap +namespace SecretKey +variable {H K : Type*} + [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + [NormedAddCommGroup K] [InnerProductSpace ℂ K] [CompleteSpace K] +variable {ι κ : Type*} +omit [CompleteSpace H] [CompleteSpace K] in +lemma cp_trace_positive (b : HilbertBasis ι ℂ H) (c : HilbertBasis κ ℂ K) + {F : TraceClass b →ₗ[ℂ] TraceClass c} (hF : TraceCP b c F) + {A : TraceClass b} (hA : 0 ≤ (A : H →L[ℂ] H)) : 0 ≤ (F A : K →L[ℂ] K) := by + have hp : TraceBlockPositive b (fun _ _ : Unit => A) := by + intro x + simpa using (nonneg_iff_isPositive.mp hA).inner_nonneg_right (x ()) + have h := hF Unit inferInstance _ hp + apply nonneg_iff_isPositive.mpr + rw [ContinuousLinearMap.isPositive_iff_complex] + intro x + have hx : 0 ≤ inner ℂ x ((F A : K →L[ℂ] K) x) := by simpa using h (fun _ => x) + have hx' : 0 ≤ inner ℂ ((F A : K →L[ℂ] K) x) x := by + rw [← inner_conj_symm] + exact star_nonneg_iff.mpr hx + exact ⟨Complex.ext rfl (Complex.nonneg_iff.mp hx').2, (Complex.nonneg_iff.mp hx').1⟩ + +structure TraceChannel (b : HilbertBasis ι ℂ H) (c : HilbertBasis κ ℂ K) where + map : TraceClass b →ₗ[ℂ] TraceClass c + cp : TraceCP b c map + trace_preserving : ∀ A, traceClassTrace c (map A)=traceClassTrace b A +omit [CompleteSpace H] in +lemma finitePositiveTrace_add (b : HilbertBasis ι ℂ H) {A B : H →L[ℂ] H} + (hA : HasFinitePositiveTrace b A) (hB : HasFinitePositiveTrace b B) : + HasFinitePositiveTrace b (A+B) := by + refine ⟨add_nonneg hA.1 hB.1,?_⟩ + simpa only [add_apply,inner_add_right,Complex.add_re] using hA.2.add hB.2 + +theorem hilbertTraceNorm_triangle (b : HilbertBasis ι ℂ H) {A B : H →L[ℂ] H} + (hA : HermitianTraceClass b A) (hB : HermitianTraceClass b B) : + HermitianTraceClass b (A+B) ∧ + hilbertTraceNorm b (A+B) ≤ hilbertTraceNorm b A+hilbertTraceNorm b B := by + obtain ⟨hp,hn⟩ := hermitian_parts_finite b hA + obtain ⟨hq,hm⟩ := hermitian_parts_finite b hB + have he : A+B=(posPart A+posPart B)-(negPart A+negPart B) := by + rw [add_sub_add_comm,CFC.posPart_sub_negPart A hA.1,CFC.posPart_sub_negPart B hB.1] + obtain ⟨hc,hbound⟩ := positive_difference_traceClass b + (finitePositiveTrace_add b hp hq) (finitePositiveTrace_add b hn hm) + rw [← he] at hc hbound + refine ⟨hc,?_⟩ + rw [hilbertTraceNorm_jordan b hA,hilbertTraceNorm_jordan b hB] + rw [hilbertTrace_add b _ _ hp.2 hq.2,hilbertTrace_add b _ _ hn.2 hm.2] at hbound + linarith +namespace TraceChannel +variable {b : HilbertBasis ι ℂ H} {c : HilbertBasis κ ℂ K} +variable (F : TraceChannel b c) +omit [CompleteSpace H] [CompleteSpace K] in +lemma positive (A : TraceClass b) (hA : 0 ≤ (A : H →L[ℂ] H)) : + HasFinitePositiveTrace c (F.map A : K →L[ℂ] K) := + (traceClass_positive_iff c _).mp ⟨(F.map A).property,cp_trace_positive b c F.cp hA⟩ +omit [CompleteSpace H] [CompleteSpace K] in +lemma real_trace (A : TraceClass b) : + hilbertTrace c (F.map A : K →L[ℂ] K)=hilbertTrace b (A : H →L[ℂ] H) := by + rw [← traceClassTrace_re,← traceClassTrace_re,F.trace_preserving] + +theorem traceNorm_contract (A : TraceClass b) (hA : HermitianTraceClass b (A : H →L[ℂ] H)) : + HermitianTraceClass c (F.map A : K →L[ℂ] K) ∧ + hilbertTraceNorm c (F.map A : K →L[ℂ] K) ≤ hilbertTraceNorm b (A : H →L[ℂ] H) := by + obtain ⟨hp,hn⟩ := hermitian_parts_finite b hA + let P : TraceClass b := ⟨posPart (A : H →L[ℂ] H),Submodule.subset_span hp⟩ + let N : TraceClass b := ⟨negPart (A : H →L[ℂ] H),Submodule.subset_span hn⟩ + have he : P-N=A := Subtype.ext (CFC.posPart_sub_negPart _ hA.1) + have heF : (F.map A : K →L[ℂ] K)=(F.map P : K →L[ℂ] K)-(F.map N : K →L[ℂ] K) := by + rw [← Submodule.coe_sub,← map_sub,he] + obtain ⟨hc,hbound⟩ := positive_difference_traceClass c (F.positive P hp.1) (F.positive N hn.1) + rw [← heF] at hc hbound + refine ⟨hc,?_⟩ + rw [F.real_trace,F.real_trace] at hbound + exact hbound.trans_eq (hilbertTraceNorm_jordan b hA).symm +end TraceChannel + +end SecretKey + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/HilbertChannelMeasure.lean b/lean/OAI/InformationTheory/Entanglement/HilbertChannelMeasure.lean new file mode 100644 index 0000000000000000000000000000000000000000..3a266cd21f7a7b4c2585aca3b70c039bc6ea8b26 --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/HilbertChannelMeasure.lean @@ -0,0 +1,108 @@ +import OAI.InformationTheory.Entanglement.HilbertVectorMeasure + +namespace OAI + +noncomputable section +open scoped InnerProductSpace ComplexOrder MeasureTheory +open ContinuousLinearMap MeasureTheory +namespace SecretKey +variable {H K : Type*} + [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + [NormedAddCommGroup K] [InnerProductSpace ℂ K] [CompleteSpace K] +variable {ι κ T : Type*} [MeasurableSpace T] +namespace TraceChannel +variable {b : HilbertBasis ι ℂ H} {c : HilbertBasis κ ℂ K} +variable (F : TraceChannel b c) +def hermitianApply (A : HermitianTrace b) : HermitianTrace c := + ⟨(F.map (HermitianTrace.asTraceClass b A)).val, + (F.traceNorm_contract (HermitianTrace.asTraceClass b A) (HermitianTrace.property b A)).1⟩ +lemma hermitianApply_add (A B : HermitianTrace b) : + F.hermitianApply (A+B)=F.hermitianApply A+F.hermitianApply B := by + apply Subtype.ext + change (F.map (HermitianTrace.asTraceClass b (A+B))).val= _ + rw [HermitianTrace.asTraceClass_add,map_add] + rfl +lemma hermitianApply_smul (r : ℝ) (A : HermitianTrace b) : + F.hermitianApply (r • A)=r • F.hermitianApply A := by + apply Subtype.ext + change (F.map (HermitianTrace.asTraceClass b (r • A))).val=r • _ + rw [HermitianTrace.asTraceClass_smul,map_smul] + exact Complex.coe_smul r _ +def hermitianLinear : HermitianTrace b →ₗ[ℝ] HermitianTrace c where + toFun := F.hermitianApply + map_add' := F.hermitianApply_add + map_smul' := F.hermitianApply_smul +lemma hermitianLinear_norm (A : HermitianTrace b) : ‖F.hermitianLinear A‖≤1*‖A‖ := by + change hilbertTraceNorm c (F.map (HermitianTrace.asTraceClass b A)).val≤ + 1*hilbertTraceNorm b (HermitianTrace.operator b A) + simpa only [one_mul,HermitianTrace.asTraceClass_operator] using + (F.traceNorm_contract (HermitianTrace.asTraceClass b A) (HermitianTrace.property b A)).2 + +def hermitianMap : HermitianTrace b →L[ℝ] HermitianTrace c := + F.hermitianLinear.mkContinuous 1 F.hermitianLinear_norm +lemma hermitianMap_operator (A : HermitianTrace b) : + HermitianTrace.operator c (F.hermitianMap A)=(F.map (HermitianTrace.asTraceClass b A)).val := rfl +lemma traceValue_asTraceClass (W : PositiveHilbertMeasure T H b) + {s : Set T} (hs : MeasurableSet s) : + (HermitianTrace.asTraceClass b (W.traceValue s)).val=W.value s := W.traceValue_operator hs + +def onLaw (W : PositiveHilbertMeasure T H b) : PositiveHilbertMeasure T K c where + value s := HermitianTrace.operator c (F.hermitianMap (W.traceVectorMeasure s)) + coeff x y := W.traceVectorMeasure.mapRange + (((HermitianTrace.coefficient c x y).comp F.hermitianMap).toLinearMap.toAddMonoidHom) + ((HermitianTrace.coefficient c x y).comp F.hermitianMap).continuous + coeff_value x y s hs := rfl + positive s hs := by + rw [F.hermitianMap_operator] + apply F.positive + change 0≤HermitianTrace.operator b (W.traceValue s) + rw [W.traceValue_operator hs] + exact (W.positive s hs).1 + traceMeasure := W.traceMeasure + traceFinite := inferInstance + trace_value s hs := by + rw [F.hermitianMap_operator,F.real_trace] + change W.traceMeasure.real s=hilbertTrace b (HermitianTrace.operator b (W.traceValue s)) + rw [W.traceValue_operator hs] + exact W.trace_value s hs +lemma onLaw_value (W : PositiveHilbertMeasure T H b) {s : Set T} (hs : MeasurableSet s) : + (F.onLaw W).value s=(F.map ⟨W.value s,Submodule.subset_span (W.positive s hs)⟩).val := by + change (F.map (HermitianTrace.asTraceClass b (W.traceValue s))).val=_ + congr 2 + exact Subtype.ext (W.traceValue_operator hs) +lemma onLaw_traceMeasure (W : PositiveHilbertMeasure T H b) : + (F.onLaw W).traceMeasure=W.traceMeasure := rfl + +theorem onLaw_distance_contract (W V : PositiveHilbertMeasure T H b) : + hilbertVariation c (fun s => (F.onLaw W).value s-(F.onLaw V).value s)≤ + hilbertVariation b (fun s => W.value s-V.value s) := by + apply iSup_le; intro P + apply iSup_le; intro hm + apply iSup_le; intro hd + refine le_trans (b := ∑ s∈P, hilbertENorm b (W.value s-V.value s)) ?_ ?_ + swap + · unfold hilbertVariation + apply le_iSup_of_le P + apply le_iSup_of_le hm + apply le_iSup_of_le hd + exact le_rfl + apply Finset.sum_le_sum + intro s hs + have hA := (W.positive s (hm s hs)) + have hB := (V.positive s (hm s hs)) + let A : TraceClass b := ⟨W.value s,Submodule.subset_span hA⟩ + let B : TraceClass b := ⟨V.value s,Submodule.subset_span hB⟩ + have ht := (positive_difference_traceClass b hA hB).1 + have hh := F.traceNorm_contract (A-B) ht + dsimp only + erw [F.onLaw_value W (hm s hs),F.onLaw_value V (hm s hs)] + change hilbertENorm c ((F.map A).val-(F.map B).val)≤_ + rw [← Submodule.coe_sub,← map_sub,hilbertENorm_eq c hh.1.2,hilbertENorm_eq b ht.2] + exact ENNReal.ofReal_le_ofReal hh.2 +end TraceChannel + +end SecretKey + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/HilbertCoarsegrain.lean b/lean/OAI/InformationTheory/Entanglement/HilbertCoarsegrain.lean new file mode 100644 index 0000000000000000000000000000000000000000..777858fc9e44c4018a29cbdb8567bdbc595b4ad0 --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/HilbertCoarsegrain.lean @@ -0,0 +1,53 @@ +import OAI.InformationTheory.Entanglement.HilbertLawAlgebra + +namespace OAI + +noncomputable section +open scoped BigOperators ENNReal MeasureTheory InnerProductSpace ComplexOrder +open MeasureTheory ContinuousLinearMap +namespace SecretKey +variable {T : Type*} [MeasurableSpace T] +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {ι a d : Type*} [Fintype a] [Fintype d] [DecidableEq d] + +def classicalPush (b : HilbertBasis ι ℂ H) (f : a→d) (W : a→PositiveHilbertMeasure T H b) : + d→PositiveHilbertMeasure T H b := + fun j => PositiveHilbertMeasure.familySum (Finset.univ.filter (fun i => f i=j)) W +omit [Fintype d] in +lemma classicalPush_value (b : HilbertBasis ι ℂ H) (f : a→d) (W : a→PositiveHilbertMeasure T H b) + (j : d) (s : Set T) : + (classicalPush b f W j).value s=∑ i∈Finset.univ.filter (fun i => f i=j), (W i).value s := rfl +lemma classicalPush_trace (b : HilbertBasis ι ℂ H) (f : a→d) (W : a→PositiveHilbertMeasure T H b) + (s : Set T) : ∑ j, (classicalPush b f W j).traceMeasure s=∑ i, (W i).traceMeasure s := by + simp only [classicalPush,PositiveHilbertMeasure.familySum,Measure.finsetSum_apply] + exact Finset.sum_fiberwise _ f _ + +theorem classicalPush_contract (b : HilbertBasis ι ℂ H) (f : a→d) + (W V : a→PositiveHilbertMeasure T H b) : + hilbertClassicalDistance b (classicalPush b f W) (classicalPush b f V)≤hilbertClassicalDistance b W V := by + unfold hilbertClassicalDistance + calc + _ ≤ ∑ j, ∑ i∈Finset.univ.filter (fun i => f i=j), + hilbertVariation b (fun s => (W i).value s-(V i).value s) := by + apply Finset.sum_le_sum + intro j hj + simp only [classicalPush_value,← Finset.sum_sub_distrib] + exact hilbertVariation_sum_le b _ _ (fun i hi s hs => + (positive_difference_traceClass b ((W i).positive s hs) ((V i).positive s hs)).1) + _ = _ := Finset.sum_fiberwise _ f _ + +def localClassicalPush {a₁ a₂ d₁ d₂ : Type*} + [Fintype a₁] [Fintype a₂] [Fintype d₁] [Fintype d₂] [DecidableEq d₁] [DecidableEq d₂] + (b : HilbertBasis ι ℂ H) (f : a₁→d₁) (g : a₂→d₂) + (W : (a₁×a₂)→PositiveHilbertMeasure T H b) : (d₁×d₂)→PositiveHilbertMeasure T H b := + classicalPush b (Prod.map f g) W + +def abortToZero : Option (Fin 2) → Fin 2 := fun x => x.getD 0 +lemma abortToZero_none : abortToZero none=0 := rfl +lemma abortToZero_some (i : Fin 2) : abortToZero (some i)=i := rfl + +end SecretKey + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/HilbertConditioning.lean b/lean/OAI/InformationTheory/Entanglement/HilbertConditioning.lean new file mode 100644 index 0000000000000000000000000000000000000000..7beaf552d608f33bc366cdea0f998894c226e0f3 --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/HilbertConditioning.lean @@ -0,0 +1,101 @@ +import OAI.InformationTheory.Entanglement.FullQuantumConsumer +import OAI.InformationTheory.Entanglement.ConditionedLaw +import OAI.InformationTheory.Entanglement.HilbertLawScale + +namespace OAI + +noncomputable section +open scoped BigOperators ENNReal MeasureTheory InnerProductSpace ComplexOrder MatrixOrder Kronecker +open MeasureTheory Matrix ContinuousLinearMap +namespace SecretKey +open ChannelCompletion TensorCriterion +variable {T : Type*} [MeasurableSpace T] +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {ι : Type*} {n m e : Type} [Fintype n] [Fintype m] [Fintype e] + [DecidableEq n] [DecidableEq m] [DecidableEq e] +namespace PositiveHilbertMeasure + +def restrict (b : HilbertBasis ι ℂ H) (W : PositiveHilbertMeasure T H b) + (A : Set T) (hA : MeasurableSet A) : PositiveHilbertMeasure T H b where + value s := W.value (s∩A) + coeff x y := (W.coeff x y).restrict A + coeff_value x y s hs := by + rw [VectorMeasure.restrict_apply _ hA hs,W.coeff_value _ _ _ (hs.inter hA)] + positive s hs := W.positive (s∩A) (hs.inter hA) + traceMeasure := W.traceMeasure.restrict A + traceFinite := inferInstance + trace_value s hs := by + rw [Measure.real,Measure.restrict_apply hs] + exact W.trace_value _ (hs.inter hA) +lemma restrict_value (b : HilbertBasis ι ℂ H) (W : PositiveHilbertMeasure T H b) + (A : Set T) (hA : MeasurableSet A) (s : Set T) : + (W.restrict b A hA).value s=W.value (s∩A) := rfl +end PositiveHilbertMeasure +omit [DecidableEq n] [DecidableEq m] [DecidableEq e] in +lemma filter_scaled_restrict_value (M : PositiveMatrixMeasure T (n×m)) + (B : Matrix e (n×m) ℂ) (A : Set T) (hA : MeasurableSet A) + (c : ℝ) (hc : 0≤c) {s : Set T} (hs : MeasurableSet s) : + (((M.restrict A).scale c hc).filter B).value s= + (c : ℂ) • ((M.filter B).value (s∩A)) := by + rw [PositiveMatrixMeasure.filter_value,PositiveMatrixMeasure.scale_value, + PositiveMatrixMeasure.restrict_value _ hA hs,PositiveMatrixMeasure.filter_value, + Matrix.mul_smul,Matrix.smul_mul] + +omit [DecidableEq n] [DecidableEq m] in +lemma embedded_conditioning_value (b : HilbertBasis ι ℂ H) (v : e→H) + (hv : Orthonormal ℂ v) (M : PositiveMatrixMeasure T (n×m)) + (B : Matrix e (n×m) ℂ) (A : Set T) (hA : MeasurableSet A) + (c : ℝ) (hc : 0≤c) {s : Set T} (hs : MeasurableSet s) : + ((((M.restrict A).scale c hc).filter B).hilbertEmbedding b v hv).value s= + ((((M.filter B).hilbertEmbedding b v hv).restrict b A hA).scale c hc).value s := by + change hilbertEmbed v _ = (c : ℂ) • hilbertEmbed v _ + rw [filter_scaled_restrict_value M B A hA c hc hs] + unfold hilbertEmbed + simp only [Matrix.smul_apply,Finset.smul_sum,smul_smul,smul_eq_mul] + +theorem full_quantum_conditioned_factorized_gap (b : HilbertBasis ι ℂ H) + (R : Mat (n×m)) (hR : Represented R) (i₀ : n×m) + (v : e→H) (hv : Orthonormal ℂ v) (j₀ : e) (B : Matrix e (n×m) ℂ) + (hGram : Bᴴ*B=Rᵀ) + (M : Fin 2 → Fin 2 → PositiveMatrixMeasure T (n×m)) + (μ : Measure T) [IsFiniteMeasure μ] + (X : Fin 2 → T → Mat n) (Y : Fin 2 → T → Mat m) + (hXm : ∀ i, Measurable (X i)) (hYm : ∀ j, Measurable (Y j)) + (hXp : ∀ i t, (X i t).PosSemidef) (hYp : ∀ j t, (Y j t).PosSemidef) + (hMi : ∀ i j a c, Integrable (fun t => ((X i t ⊗ₖ Y j t)ᵀ) a c) μ) + (hMs : ∀ i j s, MeasurableSet s → ∀ a c, + (∫ t in s, ((X i t ⊗ₖ Y j t)ᵀ) a c ∂μ)=(M i j).value s a c) + (A : Set T) (hA : MeasurableSet A) + (hr : 0 (M i j).filter B) A) + (σ : PositiveHilbertMeasure T H b) (hσ1 : σ.traceMeasure Set.univ=1) : + ENNReal.ofReal (1/5) ≤ hilbertCQDistance b + (fun i j => ((((M i j).restrict A).scale + (publicMass (fun i j => (M i j).filter B) A)⁻¹ (inv_nonneg.mpr hr.le)).filter B).hilbertEmbedding b v hv) σ := by + let c := (publicMass (fun i j => (M i j).filter B) A)⁻¹ + have hc : 0≤c := inv_nonneg.mpr hr.le + let M' := fun i j => ((M i j).restrict A).scale c hc + let X' := fun i t => (c : ℂ) • X i t + have he (i j t) : (X' i t ⊗ₖ Y j t)ᵀ=(c : ℂ) • (X i t ⊗ₖ Y j t)ᵀ := by + exact congrArg Matrix.transpose (Matrix.smul_kronecker _ _ _) + apply full_quantum_factorized_gap b R hR i₀ v hv j₀ B hGram M' (μ.restrict A) X' Y + (fun i => (measurable_const (a := (c : ℂ))).smul (hXm i)) hYm + (fun i t => (hXp i t).smul (by exact_mod_cast hc)) hYp + · intro i j a d + simp only [he,Matrix.smul_apply,smul_eq_mul] + exact ((hMi i j a d).integrableOn).const_mul _ + · intro i j s hs a d + simp only [he,Matrix.smul_apply,smul_eq_mul,integral_const_mul] + rw [Measure.restrict_restrict hs,hMs i j (s∩A) (hs.inter hA)] + simp only [M',PositiveMatrixMeasure.scale_value, + PositiveMatrixMeasure.restrict_value _ hA hs,Matrix.smul_apply,smul_eq_mul] + · simp only [M',filter_scaled_restrict_value _ B A hA c hc MeasurableSet.univ, + Set.univ_inter,Matrix.trace_smul,smul_eq_mul,Complex.mul_re,Complex.ofReal_re, + Complex.ofReal_im,zero_mul,sub_zero,← Finset.mul_sum] + exact inv_mul_cancel₀ hr.ne' + · exact hσ1 + +end SecretKey + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/HilbertENorm.lean b/lean/OAI/InformationTheory/Entanglement/HilbertENorm.lean new file mode 100644 index 0000000000000000000000000000000000000000..c6321c3f2afec8824e96583b76d951dcad1f7c7d --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/HilbertENorm.lean @@ -0,0 +1,48 @@ +import OAI.InformationTheory.Entanglement.HilbertCanonicalRecovery + +namespace OAI + +noncomputable section +open scoped BigOperators InnerProductSpace ComplexOrder MatrixOrder ENNReal +open ContinuousLinearMap Matrix +namespace SecretKey +open ChannelCompletion TensorCriterion +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {ι : Type*} {n : Type} [Fintype n] [DecidableEq n] + +def hilbertENorm (b : HilbertBasis ι ℂ H) (T : H →L[ℂ] H) : ℝ≥0∞ := + ∑' i, ENNReal.ofReal (inner ℂ (b i) ((CFC.abs T) (b i))).re +lemma hilbertENorm_eq (b : HilbertBasis ι ℂ H) {T : H →L[ℂ] H} + (hT : HasFinitePositiveTrace b (CFC.abs T)) : + hilbertENorm b T=ENNReal.ofReal (hilbertTraceNorm b T) := by + exact (ENNReal.ofReal_tsum_of_nonneg + (fun i => (nonneg_iff_isPositive.mp hT.1).re_inner_nonneg_right _) hT.2).symm +lemma finite_abs_of_hilbertENorm (b : HilbertBasis ι ℂ H) {T : H →L[ℂ] H} + (hT : hilbertENorm b T ≠ ⊤) : HasFinitePositiveTrace b (CFC.abs T) := by + refine ⟨CFC.abs_nonneg T,?_⟩ + have hs := ENNReal.summable_toReal hT + convert hs using 1 + ext i + exact (ENNReal.toReal_ofReal + ((nonneg_iff_isPositive.mp (CFC.abs_nonneg T)).re_inner_nonneg_right (b i))).symm + +lemma hilbertErase_econtract (b : HilbertBasis ι ℂ H) (v : n → H) + (hv : Orthonormal ℂ v) (i₀ : n) {T : H →L[ℂ] H} (hT : IsSelfAdjoint T) : + ENNReal.ofReal (traceNorm (hilbertErase b v i₀ T))≤hilbertENorm b T := by + by_cases hf : hilbertENorm b T=⊤ + · rw [hf]; exact le_top + rw [hilbertENorm_eq b (finite_abs_of_hilbertENorm b hf)] + exact ENNReal.ofReal_le_ofReal (hilbertErase_contract b v hv i₀ + ⟨hT,finite_abs_of_hilbertENorm b hf⟩) +lemma hilbertErase_positive_difference_econtract (b : HilbertBasis ι ℂ H) + (v : n → H) (hv : Orthonormal ℂ v) (i₀ : n) {A B : H →L[ℂ] H} + (hA : HasFinitePositiveTrace b A) (hB : HasFinitePositiveTrace b B) : + ENNReal.ofReal (traceNorm (hilbertErase b v i₀ A-hilbertErase b v i₀ B))≤hilbertENorm b (A-B) := by + rw [← hilbertErase_sub b v i₀ A B hA.2 hB.2] + exact hilbertErase_econtract b v hv i₀ (hA.1.isSelfAdjoint.sub hB.1.isSelfAdjoint) + +end SecretKey + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/HilbertEmbedding.lean b/lean/OAI/InformationTheory/Entanglement/HilbertEmbedding.lean new file mode 100644 index 0000000000000000000000000000000000000000..fa2d979ec6ab2e7086db040aa818a42548873c87 --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/HilbertEmbedding.lean @@ -0,0 +1,56 @@ +import OAI.InformationTheory.Entanglement.HilbertRecovery +import OAI.InformationTheory.Entanglement.FiniteRecovery + +namespace OAI + +noncomputable section +open scoped BigOperators InnerProductSpace ComplexOrder MatrixOrder +open ContinuousLinearMap Matrix +namespace SecretKey +open ChannelCompletion TensorCriterion +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] +variable {ι : Type*} {n : Type} [Fintype n] [DecidableEq n] + +def hilbertEmbed (v : n → H) (A : Mat n) : H →L[ℂ] H := + ∑ i, ∑ j, A i j • InnerProductSpace.rankOne ℂ (v i) (v j) +omit [DecidableEq n] in +lemma hilbertEmbed_apply (v : n → H) (A : Mat n) (x : H) : + hilbertEmbed v A x=∑ i, ∑ j, (A i j*inner ℂ (v j) x) • v i := by + simp only [hilbertEmbed,_root_.sum_apply,_root_.smul_apply, + InnerProductSpace.rankOne_apply,smul_smul] +lemma hilbertCompress_embed (v : n → H) (hv : Orthonormal ℂ v) (A : Mat n) : + hilbertCompress v (hilbertEmbed v A)=A := by + ext i j + change inner ℂ (v i) (hilbertEmbed v A (v j))=A i j + rw [hilbertEmbed_apply] + simp only [inner_sum,inner_smul_right,orthonormal_iff_ite.mp hv] + simp [mul_ite] +omit [DecidableEq n] in +lemma hilbertEmbed_diagonal_hasSum (b : HilbertBasis ι ℂ H) (v : n → H) (A : Mat n) : + HasSum (fun k => (inner ℂ (b k) (hilbertEmbed v A (b k))).re) + (∑ i, ∑ j, (A i j*inner ℂ (v j) (v i)).re) := by + have h (i j : n) : HasSum (fun k => (A i j*(inner ℂ (v j) (b k)*inner ℂ (b k) (v i))).re) + (A i j*inner ℂ (v j) (v i)).re := by + simpa only [Complex.reCLM_apply] using + ((b.hasSum_inner_mul_inner (v j) (v i)).mul_left (A i j)).mapL Complex.reCLM + have hs := hasSum_sum (s := Finset.univ) (fun i _ => + hasSum_sum (s := Finset.univ) (fun j _ => h i j)) + convert hs using 1 + ext k + simp only [hilbertEmbed_apply,inner_sum,inner_smul_right,Complex.re_sum,mul_assoc] +lemma hilbertEmbed_trace (b : HilbertBasis ι ℂ H) (v : n → H) (hv : Orthonormal ℂ v) + (A : Mat n) : hilbertTrace b (hilbertEmbed v A)=(Matrix.trace A).re := by + rw [hilbertTrace,(hilbertEmbed_diagonal_hasSum b v A).tsum_eq] + simp only [orthonormal_iff_ite.mp hv] + simp [Matrix.trace,Matrix.diag,Complex.re_sum,apply_ite] + +theorem hilbertErase_embed (b : HilbertBasis ι ℂ H) (v : n → H) (hv : Orthonormal ℂ v) + (i₀ : n) (A : Mat n) : hilbertErase b v i₀ (hilbertEmbed v A)=A := by + rw [hilbertErase,hilbertCompress_embed v hv,hilbertEmbed_trace b v hv] + simp + +end SecretKey + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/HilbertEmbeddingOrder.lean b/lean/OAI/InformationTheory/Entanglement/HilbertEmbeddingOrder.lean new file mode 100644 index 0000000000000000000000000000000000000000..7766c85b69d3f8ce86fe79dab50c44e7d4da2ef1 --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/HilbertEmbeddingOrder.lean @@ -0,0 +1,58 @@ +import OAI.InformationTheory.Entanglement.HilbertEmbedding + +namespace OAI + +noncomputable section +open scoped BigOperators InnerProductSpace ComplexOrder MatrixOrder +open ContinuousLinearMap Matrix +namespace SecretKey +open ChannelCompletion TensorCriterion +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {ι : Type*} {n e : Type} [Fintype n] [Fintype e] +lemma hilbertEmbed_adjoint (v : n → H) (A : Mat n) : + star (hilbertEmbed v A)=hilbertEmbed v Aᴴ := by + simp only [hilbertEmbed,star_sum,star_smul,ContinuousLinearMap.star_eq_adjoint, + InnerProductSpace.adjoint_rankOne,Matrix.conjTranspose_apply] + rw [Finset.sum_comm] +lemma hilbertEmbed_psd (v : n → H) {A : Mat n} (hA : A.PosSemidef) : + 0≤hilbertEmbed v A := by + apply nonneg_iff_isPositive.mpr + refine ⟨?_,?_⟩ + · apply isSelfAdjoint_iff_isSymmetric.mp + change star (hilbertEmbed v A)=hilbertEmbed v A + rw [hilbertEmbed_adjoint,hA.isHermitian.eq] + · intro x + have h := hA.dotProduct_mulVec_nonneg (fun i => inner ℂ (v i) x) + rw [ContinuousLinearMap.reApplyInnerSelf_apply, ← inner_re_symm] + change 0≤(inner ℂ x (hilbertEmbed v A x)).re + have he : inner ℂ x (hilbertEmbed v A x)= + (star fun i => inner ℂ (v i) x) ⬝ᵥ A *ᵥ (fun i => inner ℂ (v i) x) := by + simp only [hilbertEmbed_apply,inner_sum,inner_smul_right,dotProduct,Matrix.mulVec, + Pi.star_apply,Finset.mul_sum] + simp only [← inner_conj_symm x,mul_assoc,mul_comm,RCLike.star_def] + rw [he] + exact (Complex.nonneg_iff.mp h).1 +lemma hilbertEmbed_psd_finite (b : HilbertBasis ι ℂ H) (v : n → H) + {A : Mat n} (hA : A.PosSemidef) : HasFinitePositiveTrace b (hilbertEmbed v A) := + ⟨hilbertEmbed_psd v hA,(hilbertEmbed_diagonal_hasSum b v A).summable⟩ + +omit [CompleteSpace H] in +lemma hilbertEmbed_congruence (v : e → H) (B : Matrix e n ℂ) (A : Mat n) : + hilbertEmbed (fun j => ∑ i, B i j • v i) A=hilbertEmbed v (B*A*Bᴴ) := by + ext x + simp only [hilbertEmbed_apply,sum_inner,inner_smul_left,Finset.mul_sum, + Finset.sum_mul,Finset.smul_sum,Finset.sum_smul,smul_smul,Matrix.mul_apply, + Matrix.conjTranspose_apply] + conv_lhs => rw [Finset.sum_comm]; arg 2; ext j; rw [Finset.sum_comm]; arg 2; ext i; rw [Finset.sum_comm] + conv_rhs => rw [Finset.sum_comm]; arg 2; ext i; rw [Finset.sum_comm]; arg 2; ext j; rw [Finset.sum_comm] + conv_lhs => rw [Finset.sum_comm]; arg 2; ext i; rw [Finset.sum_comm] + conv_rhs => arg 2; ext k; arg 2; ext j; rw [Finset.sum_comm] + conv_rhs => arg 2; ext k; rw [Finset.sum_comm] + conv_rhs => rw [Finset.sum_comm] + simp only [mul_assoc,mul_left_comm,mul_comm,RCLike.star_def] + +end SecretKey + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/HilbertLawAlgebra.lean b/lean/OAI/InformationTheory/Entanglement/HilbertLawAlgebra.lean new file mode 100644 index 0000000000000000000000000000000000000000..3d5599ff6588b38befebb89bd07fc12cee293eb2 --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/HilbertLawAlgebra.lean @@ -0,0 +1,95 @@ +import OAI.InformationTheory.Entanglement.HilbertLawMetric + +namespace OAI + +noncomputable section +open scoped BigOperators ENNReal MeasureTheory InnerProductSpace ComplexOrder +open MeasureTheory ContinuousLinearMap +namespace SecretKey +variable {T : Type*} [MeasurableSpace T] +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {ι a : Type*} +omit [CompleteSpace H] in +lemma finitePositiveTrace_sum (b : HilbertBasis ι ℂ H) (s : Finset a) (A : a→H→L[ℂ]H) + (hA : ∀ i∈s, HasFinitePositiveTrace b (A i)) : HasFinitePositiveTrace b (∑ i∈s, A i) := by + classical + induction s using Finset.induction_on with + | empty => simp only [Finset.sum_empty]; exact ⟨le_rfl,by simp⟩ + | @insert i s hi ih => + rw [Finset.sum_insert hi] + exact finitePositiveTrace_add b (hA i (by simp)) (ih (fun j hj => hA j (by simp [hj]))) +lemma hermitianTraceClass_sum (b : HilbertBasis ι ℂ H) (s : Finset a) (A : a→H→L[ℂ]H) + (hA : ∀ i∈s, HermitianTraceClass b (A i)) : HermitianTraceClass b (∑ i∈s, A i) := by + classical + induction s using Finset.induction_on with + | empty => simp only [Finset.sum_empty]; exact ⟨by simp,by simp [HasFinitePositiveTrace]⟩ + | @insert i s hi ih => + rw [Finset.sum_insert hi] + exact (hilbertTraceNorm_triangle b (hA i (by simp)) (ih (fun j hj => hA j (by simp [hj])))).1 +omit [CompleteSpace H] in +lemma hilbertTrace_sum (b : HilbertBasis ι ℂ H) (s : Finset a) (A : a→H→L[ℂ]H) + (hA : ∀ i∈s, HasFinitePositiveTrace b (A i)) : + hilbertTrace b (∑ i∈s, A i)=∑ i∈s, hilbertTrace b (A i) := by + classical + induction s using Finset.induction_on with + | empty => simp [hilbertTrace] + | @insert i s hi ih => + rw [Finset.sum_insert hi,Finset.sum_insert hi, + hilbertTrace_add b _ _ (hA i (by simp)).2 (finitePositiveTrace_sum b s A (fun j hj => hA j (by simp [hj]))).2, + ih (fun j hj => hA j (by simp [hj]))] +namespace PositiveHilbertMeasure +variable {b : HilbertBasis ι ℂ H} + +def familySum (s : Finset a) (W : a→PositiveHilbertMeasure T H b) : PositiveHilbertMeasure T H b where + value A := ∑ i∈s, (W i).value A + coeff x y := ∑ i∈s, (W i).coeff x y + coeff_value x y A hA := by + simp only [_root_.sum_apply, sum_apply, inner_sum] + exact Finset.sum_congr rfl (fun i hi => (W i).coeff_value x y A hA) + positive A hA := finitePositiveTrace_sum b s (fun i => (W i).value A) (fun i hi => (W i).positive A hA) + traceMeasure := ∑ i∈s, (W i).traceMeasure + traceFinite := inferInstance + trace_value A hA := by + rw [Measure.real,Measure.finsetSum_apply,ENNReal.toReal_sum (fun i hi => measure_ne_top (W i).traceMeasure A), + hilbertTrace_sum b s _ (fun i hi => (W i).positive A hA)] + exact Finset.sum_congr rfl (fun i hi => (W i).trace_value A hA) +lemma familySum_value (s : Finset a) (W : a→PositiveHilbertMeasure T H b) (A : Set T) : + (familySum s W).value A=∑ i∈s, (W i).value A := rfl + +def scale (W : PositiveHilbertMeasure T H b) (c : ℝ) (hc : 0≤c) : PositiveHilbertMeasure T H b where + value A := (c : ℂ) • W.value A + coeff x y := (c : ℂ) • W.coeff x y + coeff_value x y A hA := by + simp only [_root_.smul_apply,smul_eq_mul,inner_smul_right,W.coeff_value x y A hA] + positive A hA := finitePositiveTrace_real_smul b c hc (W.positive A hA) + traceMeasure := ENNReal.ofReal c • W.traceMeasure + traceFinite := ⟨by + simpa only [Measure.smul_apply,smul_eq_mul] using + ENNReal.mul_lt_top ENNReal.ofReal_lt_top (measure_lt_top W.traceMeasure Set.univ)⟩ + trace_value A hA := by + rw [Measure.real,Measure.smul_apply,smul_eq_mul,ENNReal.toReal_mul,ENNReal.toReal_ofReal hc, + hilbertTrace_real_smul,← W.trace_value A hA] + rfl +lemma scale_value (W : PositiveHilbertMeasure T H b) (c : ℝ) (hc : 0≤c) (A : Set T) : + (W.scale c hc).value A=(c : ℂ) • W.value A := rfl +end PositiveHilbertMeasure +lemma hilbertVariation_zero (b : HilbertBasis ι ℂ H) : + hilbertVariation b (fun _ : Set T => (0 : H→L[ℂ]H))=0 := by + simp [hilbertVariation,hilbertENorm] +lemma hilbertVariation_sum_le (b : HilbertBasis ι ℂ H) (s : Finset a) (F : a→Set T→H→L[ℂ]H) + (hF : ∀ i∈s, ∀ A, MeasurableSet A → HermitianTraceClass b (F i A)) : + hilbertVariation b (fun A => ∑ i∈s, F i A)≤∑ i∈s, hilbertVariation b (F i) := by + classical + induction s using Finset.induction_on with + | empty => simp only [Finset.sum_empty,hilbertVariation_zero,le_refl] + | @insert i s hi ih => + simp only [Finset.sum_insert hi] + apply (hilbertVariation_add_le b _ _ (hF i (by simp)) + (fun A hA => hermitianTraceClass_sum b s (fun j => F j A) (fun j hj => hF j (by simp [hj]) A hA))).trans + exact add_le_add le_rfl (ih (fun j hj => hF j (by simp [hj]))) + +end SecretKey + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/HilbertLawDistance.lean b/lean/OAI/InformationTheory/Entanglement/HilbertLawDistance.lean new file mode 100644 index 0000000000000000000000000000000000000000..87952298a6f0da6a291f4116de9ba08b3490c8d0 --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/HilbertLawDistance.lean @@ -0,0 +1,77 @@ +import OAI.InformationTheory.Entanglement.HilbertMeasureEmbedding +import OAI.InformationTheory.Entanglement.CQVariation + +namespace OAI + +noncomputable section +open scoped BigOperators ENNReal MeasureTheory InnerProductSpace ComplexOrder MatrixOrder +open MeasureTheory Matrix ContinuousLinearMap +namespace SecretKey +open ChannelCompletion TensorCriterion +variable {T : Type*} [MeasurableSpace T] +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {ι : Type*} {n : Type} [Fintype n] [DecidableEq n] + +def hilbertVariation (b : HilbertBasis ι ℂ H) (F : Set T → H →L[ℂ] H) : ℝ≥0∞ := + ⨆ (P : Finset (Set T)) (_ : ∀ s∈P, MeasurableSet s) + (_ : (P : Set (Set T)).PairwiseDisjoint id), ∑ s∈P, hilbertENorm b (F s) +lemma variation_le_hilbertVariation (b : HilbertBasis ι ℂ H) (F : Set T → H →L[ℂ] H) + (M : VectorMeasure T (TraceMatrix n)) + (hc : ∀ s, MeasurableSet s → ‖M s‖ₑ≤hilbertENorm b (F s)) : + M.variation Set.univ≤hilbertVariation b F := by + by_contra h + obtain ⟨P,_,hpd,hpm,hP⟩ := M.exists_lt_sum_of_lt_variation MeasurableSet.univ (lt_of_not_ge h) + have hs : (∑ s∈P, ‖M s‖ₑ)≤∑ s∈P, hilbertENorm b (F s) := + Finset.sum_le_sum (fun s hs => hc s (hpm s hs)) + have hv : (∑ s∈P, hilbertENorm b (F s))≤hilbertVariation b F := + le_iSup_of_le P (le_iSup_of_le hpm (le_iSup_of_le hpd le_rfl)) + exact (not_lt_of_ge (hs.trans hv)) hP + +def hilbertIdeal (σ : Set T → H →L[ℂ] H) (i j : Fin 2) (s : Set T) : H →L[ℂ] H := + if i=j then (((1/2 : ℝ) : ℂ) • σ s) else 0 +lemma hilbertIdeal_positive (b : HilbertBasis ι ℂ H) + (σ : PositiveHilbertMeasure T H b) (i j : Fin 2) {s : Set T} (hs : MeasurableSet s) : + HasFinitePositiveTrace b (hilbertIdeal σ.value i j s) := by + unfold hilbertIdeal + split_ifs + · exact finitePositiveTrace_real_smul b _ (by norm_num) (σ.positive s hs) + · exact ⟨le_rfl,by simp⟩ +omit [MeasurableSpace T] [CompleteSpace H] in +lemma hilbertErase_ideal (b : HilbertBasis ι ℂ H) (v : n → H) (i₀ : n) + (σ : Set T → H →L[ℂ] H) (i j : Fin 2) (s : Set T) : + hilbertErase b v i₀ (hilbertIdeal σ i j s)= + (if i=j then halfDensity (hilbertErase b v i₀ (σ s)) else 0) := by + unfold hilbertIdeal + split_ifs + · rw [hilbertErase_real_smul] + norm_num [halfDensity] + · ext a b + simp [hilbertErase,hilbertCompress,hilbertTrace,Matrix.trace,Matrix.diag] + +def hilbertCQDistance (b : HilbertBasis ι ℂ H) + (W : Fin 2 → Fin 2 → PositiveHilbertMeasure T H b) (σ : PositiveHilbertMeasure T H b) : ℝ≥0∞ := + ∑ i, ∑ j, hilbertVariation b (fun s => (W i j).value s-hilbertIdeal σ.value i j s) + +theorem hilbertCQDistance_recovery (b : HilbertBasis ι ℂ H) (v : n → H) + (hv : Orthonormal ℂ v) (i₀ : n) + (W : Fin 2 → Fin 2 → PositiveHilbertMeasure T H b) (σ : PositiveHilbertMeasure T H b) : + ENNReal.ofReal (cqBitDistance (fun i j => (W i j).erase v hv i₀) (σ.erase v hv i₀))≤ + hilbertCQDistance b W σ := by + rw [cqBitDistance_variation] + apply Finset.sum_le_sum + intro i _ + apply Finset.sum_le_sum + intro j _ + apply variation_le_hilbertVariation + intro s hs + rw [← ofReal_norm,TraceMatrix.norm_eq,cqDifferenceMeasure_value _ _ _ _ hs, + PositiveHilbertMeasure.erase_value _ v hv i₀ hs, + PositiveHilbertMeasure.erase_value _ v hv i₀ hs,← hilbertErase_ideal] + exact hilbertErase_positive_difference_econtract b v hv i₀ + ((W i j).positive s hs) (hilbertIdeal_positive b σ i j hs) + +end SecretKey + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/HilbertLawFinite.lean b/lean/OAI/InformationTheory/Entanglement/HilbertLawFinite.lean new file mode 100644 index 0000000000000000000000000000000000000000..f8ed14a406fd035f3484aa01a375d4ebc137d246 --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/HilbertLawFinite.lean @@ -0,0 +1,102 @@ +import OAI.InformationTheory.Entanglement.HilbertLawDistance +import OAI.InformationTheory.Entanglement.HilbertTraceDifference + +namespace OAI + +noncomputable section +open scoped BigOperators ENNReal MeasureTheory InnerProductSpace ComplexOrder +open MeasureTheory ContinuousLinearMap +namespace SecretKey +variable {T : Type*} [MeasurableSpace T] +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {ι : Type*} +lemma hilbertDifference_enorm_le (b : HilbertBasis ι ℂ H) + {A B : H →L[ℂ] H} (hA : HasFinitePositiveTrace b A) (hB : HasFinitePositiveTrace b B) : + hilbertENorm b (A-B)≤ENNReal.ofReal (hilbertTrace b A)+ENNReal.ofReal (hilbertTrace b B) := by + obtain ⟨ht,hb⟩ := positive_difference_traceClass b hA hB + rw [hilbertENorm_eq b ht.2] + apply (ENNReal.ofReal_le_ofReal hb).trans + exact ENNReal.ofReal_add_le +lemma hilbertVariation_difference_le (b : HilbertBasis ι ℂ H) + (W V : PositiveHilbertMeasure T H b) : + hilbertVariation b (fun s => W.value s-V.value s)≤ + W.traceMeasure Set.univ+V.traceMeasure Set.univ := by + apply iSup_le + intro P + apply iSup_le + intro hP + apply iSup_le + intro hd + have he (s : Set T) (hs : MeasurableSet s) : + hilbertENorm b (W.value s-V.value s)≤W.traceMeasure s+V.traceMeasure s := by + have h := hilbertDifference_enorm_le b (W.positive s hs) (V.positive s hs) + rw [← W.trace_value s hs,← V.trace_value s hs, + Measure.real,Measure.real,ENNReal.ofReal_toReal (measure_ne_top _ _), + ENNReal.ofReal_toReal (measure_ne_top _ _)] at h + exact h + calc + _ ≤ ∑ s∈P, (W.traceMeasure s+V.traceMeasure s) := Finset.sum_le_sum (fun s hs => he s (hP s hs)) + _ = (∑ s∈P, W.traceMeasure s)+(∑ s∈P, V.traceMeasure s) := Finset.sum_add_distrib + _ ≤ W.traceMeasure Set.univ+V.traceMeasure Set.univ := add_le_add + (sum_measure_le_measure_univ (fun s hs => (hP s hs).nullMeasurableSet) hd.aedisjoint) + (sum_measure_le_measure_univ (fun s hs => (hP s hs).nullMeasurableSet) hd.aedisjoint) +lemma hilbertVariation_difference_ne_top (b : HilbertBasis ι ℂ H) + (W V : PositiveHilbertMeasure T H b) : + hilbertVariation b (fun s => W.value s-V.value s)≠⊤ := + ne_top_of_le_ne_top (ENNReal.add_ne_top.mpr ⟨measure_ne_top _ _,measure_ne_top _ _⟩) + (hilbertVariation_difference_le b W V) + +lemma hilbert_event_difference_norm (b : HilbertBasis ι ℂ H) + (W V : PositiveHilbertMeasure T H b) {s : Set T} (hs : MeasurableSet s) : + HermitianTraceClass b (W.value s-V.value s) ∧ + hilbertENorm b (W.value s-V.value s)=ENNReal.ofReal (hilbertTraceNorm b (W.value s-V.value s)) := by + have ht := (positive_difference_traceClass b (W.positive s hs) (V.positive s hs)).1 + exact ⟨ht,hilbertENorm_eq b ht.2⟩ +lemma hilbertVariation_le_measure (b : HilbertBasis ι ℂ H) + (F : Set T → H →L[ℂ] H) (μ : Measure T) + (h : ∀ s, MeasurableSet s → hilbertENorm b (F s)≤μ s) : + hilbertVariation b F≤μ Set.univ := by + apply iSup_le + intro P + apply iSup_le + intro hm + apply iSup_le + intro hd + exact (Finset.sum_le_sum (fun s hs => h s (hm s hs))).trans + (sum_measure_le_measure_univ (fun s hs => (hm s hs).nullMeasurableSet) hd.aedisjoint) +lemma hilbertCQDistance_ne_top (b : HilbertBasis ι ℂ H) + (W : Fin 2 → Fin 2 → PositiveHilbertMeasure T H b) + (σ : PositiveHilbertMeasure T H b) : hilbertCQDistance b W σ≠⊤ := by + have hb (i j : Fin 2) : hilbertVariation b + (fun s => (W i j).value s-hilbertIdeal σ.value i j s)≤ + ((W i j).traceMeasure+σ.traceMeasure) Set.univ := by + apply hilbertVariation_le_measure + intro s hs + have hn : 0≤hilbertTrace b (σ.value s) := by + rw [← σ.trace_value s hs] + exact measureReal_nonneg + have hi : hilbertTrace b (hilbertIdeal σ.value i j s)≤hilbertTrace b (σ.value s) := by + unfold hilbertIdeal + split_ifs + · rw [hilbertTrace_real_smul]; nlinarith + · simpa only [hilbertTrace,zero_apply,inner_zero_right,Complex.zero_re,tsum_zero] using hn + have he := hilbertDifference_enorm_le b ((W i j).positive s hs) (hilbertIdeal_positive b σ i j hs) + apply he.trans + rw [Measure.add_apply,← (W i j).trace_value s hs] + apply add_le_add + · exact (ENNReal.ofReal_toReal (measure_ne_top _ _)).le + · apply (ENNReal.ofReal_le_ofReal hi).trans + rw [← σ.trace_value s hs] + exact (ENNReal.ofReal_toReal (measure_ne_top _ _)).le + unfold hilbertCQDistance + apply ENNReal.sum_ne_top.mpr + intro i hi + apply ENNReal.sum_ne_top.mpr + intro j hj + exact ne_top_of_le_ne_top (measure_ne_top _ _) (hb i j) + +end SecretKey + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/HilbertLawMetric.lean b/lean/OAI/InformationTheory/Entanglement/HilbertLawMetric.lean new file mode 100644 index 0000000000000000000000000000000000000000..adf75cbf547a56866a62c00e52f408433bd6f4a0 --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/HilbertLawMetric.lean @@ -0,0 +1,93 @@ +import OAI.InformationTheory.Entanglement.HilbertChannel +import OAI.InformationTheory.Entanglement.HilbertLawFinite + +namespace OAI + +noncomputable section +open scoped BigOperators ENNReal MeasureTheory InnerProductSpace ComplexOrder +open MeasureTheory ContinuousLinearMap +namespace SecretKey +variable {T : Type*} [MeasurableSpace T] +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {ι : Type*} +lemma hilbertENorm_add_le (b : HilbertBasis ι ℂ H) {A B : H →L[ℂ] H} + (hA : HermitianTraceClass b A) (hB : HermitianTraceClass b B) : + hilbertENorm b (A+B)≤hilbertENorm b A+hilbertENorm b B := by + obtain ⟨hC,hc⟩ := hilbertTraceNorm_triangle b hA hB + rw [hilbertENorm_eq b hC.2,hilbertENorm_eq b hA.2,hilbertENorm_eq b hB.2] + exact (ENNReal.ofReal_le_ofReal hc).trans ENNReal.ofReal_add_le +lemma hilbertVariation_congr (b : HilbertBasis ι ℂ H) {F G : Set T→H→L[ℂ]H} + (h : ∀ s, MeasurableSet s → F s=G s) : hilbertVariation b F=hilbertVariation b G := by + unfold hilbertVariation + congr 1 + funext P + congr 1 + funext hm + congr 1 + funext hd + exact Finset.sum_congr rfl fun s hs => congrArg (hilbertENorm b) (h s (hm s hs)) +lemma hilbertVariation_add_le (b : HilbertBasis ι ℂ H) (F G : Set T→H→L[ℂ]H) + (hF : ∀ s, MeasurableSet s → HermitianTraceClass b (F s)) + (hG : ∀ s, MeasurableSet s → HermitianTraceClass b (G s)) : + hilbertVariation b (fun s => F s+G s)≤hilbertVariation b F+hilbertVariation b G := by + apply iSup_le; intro P + apply iSup_le; intro hm + apply iSup_le; intro hd + calc + _ ≤ ∑ s∈P, (hilbertENorm b (F s)+hilbertENorm b (G s)) := + Finset.sum_le_sum fun s hs => hilbertENorm_add_le b (hF s (hm s hs)) (hG s (hm s hs)) + _ = (∑ s∈P, hilbertENorm b (F s))+(∑ s∈P, hilbertENorm b (G s)) := Finset.sum_add_distrib + _ ≤ hilbertVariation b F+hilbertVariation b G := add_le_add + (le_iSup_of_le P (le_iSup_of_le hm (le_iSup_of_le hd le_rfl))) + (le_iSup_of_le P (le_iSup_of_le hm (le_iSup_of_le hd le_rfl))) +lemma hilbertVariation_neg (b : HilbertBasis ι ℂ H) (F : Set T→H→L[ℂ]H) : + hilbertVariation b (fun s => -F s)=hilbertVariation b F := by + simp only [hilbertVariation,hilbertENorm,CFC.abs_neg] +lemma hilbertVariation_difference_comm (b : HilbertBasis ι ℂ H) + (W V : PositiveHilbertMeasure T H b) : + hilbertVariation b (fun s => W.value s-V.value s)= + hilbertVariation b (fun s => V.value s-W.value s) := by + calc + _ = hilbertVariation b (fun s => -(V.value s-W.value s)) := by simp only [neg_sub] + _ = _ := hilbertVariation_neg _ _ + +theorem hilbertVariation_difference_triangle (b : HilbertBasis ι ℂ H) + (W V Z : PositiveHilbertMeasure T H b) : + hilbertVariation b (fun s => W.value s-Z.value s)≤ + hilbertVariation b (fun s => W.value s-V.value s)+ + hilbertVariation b (fun s => V.value s-Z.value s) := by + have he : (fun s => W.value s-Z.value s)= + (fun s => (W.value s-V.value s)+(V.value s-Z.value s)) := by + funext s; abel + rw [he] + exact hilbertVariation_add_le b _ _ + (fun s hs => (positive_difference_traceClass b (W.positive s hs) (V.positive s hs)).1) + (fun s hs => (positive_difference_traceClass b (V.positive s hs) (Z.positive s hs)).1) + +def hilbertClassicalDistance {a : Type*} [Fintype a] (b : HilbertBasis ι ℂ H) + (W V : a→PositiveHilbertMeasure T H b) : ℝ≥0∞ := + ∑ i, hilbertVariation b (fun s => (W i).value s-(V i).value s) +lemma hilbertClassicalDistance_ne_top {a : Type*} [Fintype a] (b : HilbertBasis ι ℂ H) + (W V : a→PositiveHilbertMeasure T H b) : hilbertClassicalDistance b W V≠⊤ := by + apply ENNReal.sum_ne_top.mpr + intro i hi + exact hilbertVariation_difference_ne_top b (W i) (V i) +lemma hilbertClassicalDistance_triangle {a : Type*} [Fintype a] (b : HilbertBasis ι ℂ H) + (W V Z : a→PositiveHilbertMeasure T H b) : + hilbertClassicalDistance b W Z≤hilbertClassicalDistance b W V+hilbertClassicalDistance b V Z := by + unfold hilbertClassicalDistance + rw [← Finset.sum_add_distrib] + exact Finset.sum_le_sum (fun i hi => hilbertVariation_difference_triangle b (W i) (V i) (Z i)) +lemma hilbertClassicalDistance_le_two {a : Type*} [Fintype a] (b : HilbertBasis ι ℂ H) + (W V : a→PositiveHilbertMeasure T H b) + (hW : ∑ i, (W i).traceMeasure Set.univ=1) (hV : ∑ i, (V i).traceMeasure Set.univ=1) : + hilbertClassicalDistance b W V≤2 := by + apply (Finset.sum_le_sum (fun i hi => hilbertVariation_difference_le b (W i) (V i))).trans + rw [Finset.sum_add_distrib,hW,hV] + norm_num + +end SecretKey + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/HilbertLawRecovery.lean b/lean/OAI/InformationTheory/Entanglement/HilbertLawRecovery.lean new file mode 100644 index 0000000000000000000000000000000000000000..b583e2e7d1ee7121e7714b0613eef0ab1105d5f9 --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/HilbertLawRecovery.lean @@ -0,0 +1,72 @@ +import OAI.InformationTheory.Entanglement.HilbertLawDistance +import OAI.InformationTheory.Entanglement.FiniteLawRecovery + +namespace OAI + +noncomputable section +open scoped BigOperators ENNReal MeasureTheory InnerProductSpace ComplexOrder MatrixOrder +open MeasureTheory Matrix ContinuousLinearMap +namespace SecretKey +open ChannelCompletion TensorCriterion +variable {T : Type*} [MeasurableSpace T] +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {ι : Type*} {n e : Type} [Fintype n] [Fintype e] [DecidableEq n] [DecidableEq e] + +theorem hilbert_purification_law_recovery (b : HilbertBasis ι ℂ H) + (v : e → H) (hv : Orthonormal ℂ v) (j₀ : e) (i₀ : n) (B : Matrix e n ℂ) : + ∃ F : Map e n, ∃ hF : CP F, TracePreserving F ∧ + (∀ W : PositiveMatrixMeasure T n, + (((W.filter B).hilbertEmbedding b v hv).erase v hv j₀).channel F hF= + W.filter (CFC.sqrt (Bᴴ*B))) ∧ + ∀ (W : Fin 2 → Fin 2 → PositiveMatrixMeasure T n) (σ : PositiveHilbertMeasure T H b), + ENNReal.ofReal (cqBitDistance (fun i j => (W i j).filter (CFC.sqrt (Bᴴ*B))) + ((σ.erase v hv j₀).channel F hF))≤ + hilbertCQDistance b (fun i j => ((W i j).filter B).hilbertEmbedding b v hv) σ := by + obtain ⟨F,hF,hT,hrec⟩ := finite_branch_law_recovery (T := T) i₀ B + refine ⟨F,hF,hT,?_,?_⟩ + · intro W + rw [PositiveMatrixMeasure.hilbertEmbedding_recovered] + exact hrec W + · intro W σ + have hc := cqBitDistance_channel (fun i j => (W i j).filter B) (σ.erase v hv j₀) F hF hT + simp only [hrec] at hc + have he := hilbertCQDistance_recovery b v hv j₀ + (fun i j => ((W i j).filter B).hilbertEmbedding b v hv) σ + simp only [PositiveMatrixMeasure.hilbertEmbedding_recovered] at he + exact (ENNReal.ofReal_le_ofReal hc).trans he + +omit [CompleteSpace H] [DecidableEq n] in +theorem purification_orthonormal_support (x : n → H) (hx : ∃ j, x j≠0) : + ∃ d : ℕ, ∃ _ : 0 B a j)=0 := by ext a; exact Fin.elim0 a + rw [hz,map_zero] + let v : Fin d → H := fun a => V (EuclideanSpace.basisFun (Fin d) ℂ a) + refine ⟨d,hd,v,?_,B,?_,hgram⟩ + · rw [orthonormal_iff_ite] + intro i j + change inner ℂ (V _) (V _) = _ + rw [V.inner_map_map] + exact orthonormal_iff_ite.mp (EuclideanSpace.basisFun (Fin d) ℂ).orthonormal i j + · intro j + rw [← hx' j] + change V (WithLp.toLp 2 (fun a => B a j))=∑ a, B a j • V (EuclideanSpace.basisFun (Fin d) ℂ a) + have he := congrArg V ((EuclideanSpace.basisFun (Fin d) ℂ).sum_repr + (WithLp.toLp 2 (fun a => B a j))).symm + simpa only [map_sum,map_smul,EuclideanSpace.basisFun_repr,WithLp.ofLp_toLp] using he + +end SecretKey + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/HilbertLawScale.lean b/lean/OAI/InformationTheory/Entanglement/HilbertLawScale.lean new file mode 100644 index 0000000000000000000000000000000000000000..1792e7b8bbbdef1437da5f15811390aa1008cf16 --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/HilbertLawScale.lean @@ -0,0 +1,70 @@ +import OAI.InformationTheory.Entanglement.HilbertLawAlgebra + +namespace OAI + +noncomputable section +open scoped BigOperators ENNReal MeasureTheory InnerProductSpace ComplexOrder +open MeasureTheory ContinuousLinearMap +namespace SecretKey +variable {T : Type*} [MeasurableSpace T] +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {ι : Type*} +lemma hilbertENorm_real_smul (b : HilbertBasis ι ℂ H) (c : ℝ) (hc : 0≤c) (A : H→L[ℂ]H) : + hilbertENorm b ((c : ℂ) • A)=ENNReal.ofReal c*hilbertENorm b A := by + have he : CFC.abs ((c : ℂ) • A)=(c : ℂ) • CFC.abs A := by + rw [CFC.abs_smul] + simp only [Complex.norm_real,Real.norm_eq_abs,abs_of_nonneg hc] + ext x + simp + simp only [hilbertENorm,he,_root_.smul_apply,inner_smul_right,Complex.mul_re, + Complex.ofReal_re,Complex.ofReal_im,zero_mul,sub_zero,ENNReal.ofReal_mul hc] + exact ENNReal.tsum_mul_left +lemma hilbertVariation_real_smul (b : HilbertBasis ι ℂ H) (c : ℝ) (hc : 0≤c) + (F : Set T→H→L[ℂ]H) : + hilbertVariation b (fun s => (c : ℂ) • F s)=ENNReal.ofReal c*hilbertVariation b F := by + simp only [hilbertVariation,hilbertENorm_real_smul b c hc,← Finset.mul_sum,← ENNReal.mul_iSup] +lemma hermitianTraceClass_scaled_difference (b : HilbertBasis ι ℂ H) (c : ℝ) (hc : 0≤c) + {A B : H→L[ℂ]H} (hA : HasFinitePositiveTrace b A) (hB : HasFinitePositiveTrace b B) : + HermitianTraceClass b ((c : ℂ) • (A-B)) := by + rw [smul_sub] + exact (positive_difference_traceClass b (finitePositiveTrace_real_smul b c hc hA) + (finitePositiveTrace_real_smul b c hc hB)).1 + +theorem hilbertClassical_mixture_bound {a : Type*} [Fintype a] + (b : HilbertBasis ι ℂ H) (δ : ℝ) (hδ0 : 0≤δ) (hδ1 : δ≤1) + (W ok bad γ : a→PositiveHilbertMeasure T H b) + (hW : ∀ i s, MeasurableSet s → + (W i).value s=((1-δ : ℝ) : ℂ) • (ok i).value s+(δ : ℂ) • (bad i).value s) + (hbad : ∑ i, (bad i).traceMeasure Set.univ=1) + (hγ : ∑ i, (γ i).traceMeasure Set.univ=1) : + hilbertClassicalDistance b W γ≤ + ENNReal.ofReal (1-δ)*hilbertClassicalDistance b ok γ+2*ENNReal.ofReal δ := by + have hc : 0≤1-δ := sub_nonneg.mpr hδ1 + have hb := hilbertClassicalDistance_le_two b bad γ hbad hγ + calc + _ ≤ ENNReal.ofReal (1-δ)*hilbertClassicalDistance b ok γ+ + ENNReal.ofReal δ*hilbertClassicalDistance b bad γ := by + unfold hilbertClassicalDistance + rw [Finset.mul_sum,Finset.mul_sum,← Finset.sum_add_distrib] + apply Finset.sum_le_sum + intro i hi + have he := hilbertVariation_congr b (fun s hs => show + (W i).value s-(γ i).value s= + ((1-δ : ℝ) : ℂ) • ((ok i).value s-(γ i).value s)+ + (δ : ℂ) • ((bad i).value s-(γ i).value s) from by + rw [hW i s hs] + push_cast + module) + rw [he,← hilbertVariation_real_smul b (1-δ) hc,← hilbertVariation_real_smul b δ hδ0] + exact hilbertVariation_add_le b _ _ + (fun s hs => hermitianTraceClass_scaled_difference b (1-δ) hc ((ok i).positive s hs) ((γ i).positive s hs)) + (fun s hs => hermitianTraceClass_scaled_difference b δ hδ0 ((bad i).positive s hs) ((γ i).positive s hs)) + _ ≤ _ := by + apply add_le_add le_rfl + simpa only [mul_comm] using mul_le_mul (show ENNReal.ofReal δ ≤ ENNReal.ofReal δ from le_rfl) hb (bot_le) (bot_le) + +end SecretKey + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/HilbertMeasure.lean b/lean/OAI/InformationTheory/Entanglement/HilbertMeasure.lean new file mode 100644 index 0000000000000000000000000000000000000000..85215d5b7490f5936f055d58163359a48457e7b3 --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/HilbertMeasure.lean @@ -0,0 +1,95 @@ +import OAI.InformationTheory.Entanglement.HilbertENorm +import OAI.InformationTheory.Entanglement.MatrixMeasureChannel + +namespace OAI + +noncomputable section +open scoped BigOperators InnerProductSpace ComplexOrder MatrixOrder ENNReal MeasureTheory +open ContinuousLinearMap Matrix MeasureTheory +namespace SecretKey +open ChannelCompletion TensorCriterion +variable {T : Type*} [MeasurableSpace T] +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {ι : Type*} {n m : Type} [Fintype n] [Fintype m] [DecidableEq n] [DecidableEq m] + +structure PositiveHilbertMeasure (T H : Type*) [MeasurableSpace T] + [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + {ι : Type*} (b : HilbertBasis ι ℂ H) where + value : Set T → H →L[ℂ] H + coeff : H → H → ComplexMeasure T + coeff_value : ∀ x y s, MeasurableSet s → coeff x y s=inner ℂ x (value s y) + positive : ∀ s, MeasurableSet s → HasFinitePositiveTrace b (value s) + traceMeasure : Measure T + traceFinite : IsFiniteMeasure traceMeasure + trace_value : ∀ s, MeasurableSet s → traceMeasure.real s=hilbertTrace b (value s) +attribute [instance] PositiveHilbertMeasure.traceFinite +namespace PositiveHilbertMeasure +variable {b : HilbertBasis ι ℂ H} (W : PositiveHilbertMeasure T H b) +def compress (v : n → H) : PositiveMatrixMeasure T n where + entry i j := W.coeff (v i) (v j) + positive s hs := by + have he : (fun i j => W.coeff (v i) (v j) s)=hilbertCompress v (W.value s) := by + ext i j; exact W.coeff_value _ _ _ hs + rw [he] + exact hilbertCompress_psd v (W.positive s hs).1 +omit [DecidableEq n] in +lemma compress_value (v : n → H) {s : Set T} (hs : MeasurableSet s) : + (W.compress v).value s=hilbertCompress v (W.value s) := by + ext i j; exact W.coeff_value _ _ _ hs + +def traceComplex : ComplexMeasure T := W.traceMeasure.toSignedMeasure.toComplexMeasure 0 +lemma traceComplex_value {s : Set T} (hs : MeasurableSet s) : + W.traceComplex s=(hilbertTrace b (W.value s) : ℂ) := by + unfold traceComplex + rw [SignedMeasure.toComplexMeasure_apply,Measure.toSignedMeasure_apply_measurable hs] + apply Complex.ext + · exact W.trace_value s hs + · simp +lemma erased_entries (v : n → H) (i₀ : n) {s : Set T} (hs : MeasurableSet s) : + (fun i j => (W.coeff (v i) (v j)+ + projector (Pi.single i₀ (1 : ℂ)) i j • (W.traceComplex-∑ k, W.coeff (v k) (v k))) s)= + hilbertErase b v i₀ (W.value s) := by + have ht : Matrix.trace (hilbertCompress v (W.value s))= + ((Matrix.trace (hilbertCompress v (W.value s))).re : ℂ) := by + apply Complex.ext + · rfl + · exact (Complex.nonneg_iff.mp (hilbertCompress_psd v (W.positive s hs).1).trace_nonneg).2.symm + ext i j + simp only [_root_.add_apply,_root_.smul_apply,_root_.sub_apply,_root_.sum_apply, + W.coeff_value _ _ _ hs,W.traceComplex_value hs,hilbertErase,Matrix.add_apply, + Matrix.smul_apply,smul_eq_mul,Complex.ofReal_sub] + change _+_*((hilbertTrace b (W.value s) : ℂ)-Matrix.trace (hilbertCompress v (W.value s)))=_ + rw [ht] + rw [mul_comm] + simp only [Complex.ofReal_re,hilbertCompress] + +def erase (v : n → H) (hv : Orthonormal ℂ v) (i₀ : n) : PositiveMatrixMeasure T n where + entry i j := W.coeff (v i) (v j)+ + projector (Pi.single i₀ (1 : ℂ)) i j • (W.traceComplex-∑ k, W.coeff (v k) (v k)) + positive s hs := by + rw [W.erased_entries v i₀ hs] + exact hilbertErase_psd b v hv i₀ (W.positive s hs) +lemma erase_value (v : n → H) (hv : Orthonormal ℂ v) (i₀ : n) + {s : Set T} (hs : MeasurableSet s) : + (W.erase v hv i₀).value s=hilbertErase b v i₀ (W.value s) := + W.erased_entries v i₀ hs +lemma erase_traceMeasure (v : n → H) (hv : Orthonormal ℂ v) (i₀ : n) : + (W.erase v hv i₀).traceMeasure=W.traceMeasure := by + apply Measure.ext + intro s hs + exact (ENNReal.toReal_eq_toReal_iff' (measure_ne_top _ _) (measure_ne_top _ _)).mp (by + change (W.erase v hv i₀).traceMeasure.real s=W.traceMeasure.real s + rw [PositiveMatrixMeasure.traceMeasure_real _ hs,W.erase_value v hv i₀ hs, + hilbertErase_trace,← W.trace_value s hs]) + +theorem erase_law (v : n → H) (hv : Orthonormal ℂ v) (i₀ : n) : + (∀ s, MeasurableSet s → (W.erase v hv i₀).value s=hilbertErase b v i₀ (W.value s)) ∧ + (W.erase v hv i₀).traceMeasure=W.traceMeasure := + ⟨fun _ hs => W.erase_value v hv i₀ hs,W.erase_traceMeasure v hv i₀⟩ +end PositiveHilbertMeasure + +end SecretKey + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/HilbertMeasureEmbedding.lean b/lean/OAI/InformationTheory/Entanglement/HilbertMeasureEmbedding.lean new file mode 100644 index 0000000000000000000000000000000000000000..822897e9340135a86336125d0a14ca31dc31cb9a --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/HilbertMeasureEmbedding.lean @@ -0,0 +1,82 @@ +import OAI.InformationTheory.Entanglement.HilbertMeasure +import OAI.InformationTheory.Entanglement.HilbertEmbeddingOrder + +namespace OAI + +noncomputable section +open scoped BigOperators InnerProductSpace ComplexOrder MatrixOrder ENNReal MeasureTheory +open ContinuousLinearMap Matrix MeasureTheory +namespace SecretKey +open ChannelCompletion TensorCriterion +variable {T : Type*} [MeasurableSpace T] +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {ι : Type*} {n : Type} [Fintype n] [DecidableEq n] +omit [CompleteSpace H] in +lemma hilbertTrace_real_smul (b : HilbertBasis ι ℂ H) (c : ℝ) (A : H →L[ℂ] H) : + hilbertTrace b ((c : ℂ) • A)=c*hilbertTrace b A := by + simp only [hilbertTrace,_root_.smul_apply,inner_smul_right,Complex.mul_re, + Complex.ofReal_re,Complex.ofReal_im,zero_mul,sub_zero,tsum_mul_left] +omit [CompleteSpace H] [Fintype n] [DecidableEq n] in +lemma hilbertCompress_smul (v : n → H) (c : ℂ) (A : H →L[ℂ] H) : + hilbertCompress v (c • A)=c • hilbertCompress v A := by + ext i j + simp only [hilbertCompress,_root_.smul_apply,inner_smul_right,Matrix.smul_apply,smul_eq_mul] +omit [CompleteSpace H] in +lemma hilbertErase_real_smul (b : HilbertBasis ι ℂ H) (v : n → H) (i₀ : n) + (c : ℝ) (A : H →L[ℂ] H) : + hilbertErase b v i₀ ((c : ℂ) • A)=(c : ℂ) • hilbertErase b v i₀ A := by + simp only [hilbertErase,hilbertCompress_smul,hilbertTrace_real_smul,Matrix.trace_smul, + smul_eq_mul,Complex.mul_re,Complex.ofReal_re,Complex.ofReal_im,zero_mul,sub_zero, + ← mul_sub,Complex.ofReal_mul,smul_add,smul_smul] +lemma finitePositiveTrace_real_smul (b : HilbertBasis ι ℂ H) (c : ℝ) (hc : 0≤c) + {A : H →L[ℂ] H} (hA : HasFinitePositiveTrace b A) : + HasFinitePositiveTrace b ((c : ℂ) • A) := by + refine ⟨?_,?_⟩ + · have he : (c : ℂ) • A=c • A := by ext x; simp + rw [he] + exact smul_nonneg hc hA.1 + · simpa only [_root_.smul_apply,inner_smul_right,Complex.mul_re, + Complex.ofReal_re,Complex.ofReal_im,zero_mul,sub_zero] using hA.2.mul_left c +namespace PositiveMatrixMeasure +omit [DecidableEq n] in +lemma ext_entry {V W : PositiveMatrixMeasure T n} (h : V.entry=W.entry) : V=W := by + cases V + cases W + cases h + rfl +def hilbertEmbedding (W : PositiveMatrixMeasure T n) (b : HilbertBasis ι ℂ H) + (v : n → H) (hv : Orthonormal ℂ v) : PositiveHilbertMeasure T H b where + value s := hilbertEmbed v (W.value s) + coeff x y := ∑ i, ∑ j, (inner ℂ x (v i)*inner ℂ (v j) y) • W.entry i j + coeff_value x y s hs := by + simp only [_root_.sum_apply,_root_.smul_apply,smul_eq_mul,hilbertEmbed_apply,inner_sum, + inner_smul_right,PositiveMatrixMeasure.value] + apply Finset.sum_congr rfl + intro i _ + apply Finset.sum_congr rfl + intro j _ + ring + positive s hs := hilbertEmbed_psd_finite b v (W.positive s hs) + traceMeasure := W.traceMeasure + traceFinite := inferInstance + trace_value s hs := by rw [hilbertEmbed_trace b v hv,W.traceMeasure_real hs] +lemma hilbertEmbedding_recovered (W : PositiveMatrixMeasure T n) (b : HilbertBasis ι ℂ H) + (v : n → H) (hv : Orthonormal ℂ v) (i₀ : n) : + (W.hilbertEmbedding b v hv).erase v hv i₀=W := by + have he : ((W.hilbertEmbedding b v hv).erase v hv i₀).entry=W.entry := by + funext i j + apply VectorMeasure.ext + intro s hs + have h := PositiveHilbertMeasure.erase_value (W.hilbertEmbedding b v hv) v hv i₀ hs + change _=hilbertErase b v i₀ (hilbertEmbed v (W.value s)) at h + rw [hilbertErase_embed b v hv i₀] at h + exact congrArg (fun A : Mat n => A i j) h + exact ext_entry he + +end PositiveMatrixMeasure + +end SecretKey + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/HilbertRecordMap.lean b/lean/OAI/InformationTheory/Entanglement/HilbertRecordMap.lean new file mode 100644 index 0000000000000000000000000000000000000000..a79aea34d8166a94e1866cb105ffc5268f874925 --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/HilbertRecordMap.lean @@ -0,0 +1,83 @@ +import OAI.InformationTheory.Entanglement.WeakLawTrace +import OAI.InformationTheory.Entanglement.SequentialSampling + +namespace OAI + +noncomputable section +open scoped InnerProductSpace ComplexOrder MeasureTheory +open ContinuousLinearMap MeasureTheory ProbabilityTheory Filter +namespace SecretKey +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {ι X Y : Type*} [MeasurableSpace X] [MeasurableSpace Y] +namespace PositiveHilbertMeasure +variable {b : HilbertBasis ι ℂ H} (W : PositiveHilbertMeasure X H b) + +def mapRecord (f : X→Y) (hf : Measurable f) : PositiveHilbertMeasure Y H b where + value s := W.value (f ⁻¹' s) + coeff x y := (W.coeff x y).map f + coeff_value x y s hs := by rw [VectorMeasure.map_apply _ hf hs,W.coeff_value _ _ _ (hf hs)] + positive s hs := W.positive _ (hf hs) + traceMeasure := W.traceMeasure.map f + traceFinite := inferInstance + trace_value s hs := by rw [Measure.real,Measure.map_apply hf hs]; exact W.trace_value _ (hf hs) +@[simp] lemma mapRecord_trace (f : X→Y) (hf : Measurable f) : + (W.mapRecord f hf).traceMeasure=W.traceMeasure.map f := rfl +instance mapRecord_probability [IsProbabilityMeasure W.traceMeasure] + (f : X→Y) (hf : Measurable f) : IsProbabilityMeasure (W.mapRecord f hf).traceMeasure := by + change IsProbabilityMeasure (W.traceMeasure.map f) + infer_instance +end PositiveHilbertMeasure + +def IsWeakDensity (b : HilbertBasis ι ℂ H) (W : PositiveHilbertMeasure X H b) + (μ : Measure X) (ρ : X→DensityOperator b) : Prop := + ∀ s, MeasurableSet s → ∀ x y, W.coeff x y s=∫ z in s, inner ℂ x ((ρ z).val.val y) ∂μ +lemma weakDensity_mapRecord (b : HilbertBasis ι ℂ H) (W : PositiveHilbertMeasure X H b) + (μ : Measure X) (ρ : X→DensityOperator b) + (hm : ∀ x y, Measurable (fun z => inner ℂ x ((ρ z).val.val y))) + (hd : IsWeakDensity b W μ ρ) (e : X ≃ᵐ Y) : + IsWeakDensity b (W.mapRecord e e.measurable) (μ.map e) (ρ ∘ e.symm) := by + intro s hs x y + change (W.coeff x y).map e s=_ + rw [VectorMeasure.map_apply _ e.measurable hs,hd _ (e.measurable hs)] + erw [setIntegral_map hs ((hm x y).comp e.symm.measurable).aestronglyMeasurable e.measurable.aemeasurable] + simp only [Function.comp_apply,e.symm_apply_apply] + +def historyStepEquiv (X : Type*) [MeasurableSpace X] (k : ℕ) : + (Fin (k+1)→X) ≃ᵐ ((Fin k→X)×X) where + toFun x := (fun i => x i.castSucc,x (Fin.last k)) + invFun p := Fin.snoc p.1 p.2 + left_inv x := by funext i; refine Fin.lastCases ?_ (fun j => ?_) i <;> simp + right_inv p := by ext i <;> simp + measurable_toFun := by + change Measurable (fun x : Fin (k+1)→X => (fun i : Fin k => x i.castSucc,x (Fin.last k))) + fun_prop + measurable_invFun := by + change Measurable (fun p : (Fin k→X)×X => Fin.snoc (α := fun _ : Fin (k+1) => X) p.1 p.2) + apply Measurable.of_eval + intro i + refine Fin.lastCases ?_ (fun j => ?_) i + · simpa only [Fin.snoc_last] using (measurable_snd : Measurable (fun p : (Fin k→X)×X => p.2)) + · simpa only [Fin.snoc_castSucc,Function.comp_def] using + (measurable_pi_apply j).comp (measurable_fst : Measurable (fun p : (Fin k→X)×X => p.1)) +lemma weakDensity_of_step {steps : ℕ} (b : HilbertBasis ι ℂ H) + (W : PositiveHilbertMeasure (Fin (steps+1)→X) H b) (μ : Measure (Fin (steps+1)→X)) + (ρ : (Fin (steps+1)→X)→DensityOperator b) + (hm : ∀ x y, Measurable (fun z => inner ℂ x ((ρ z).val.val y))) + (hd : IsWeakDensity b (W.mapRecord (historyStepEquiv X steps) (historyStepEquiv X steps).measurable) + (μ.map (historyStepEquiv X steps)) (ρ ∘ (historyStepEquiv X steps).symm)) : + IsWeakDensity b W μ ρ := by + intro s hs x y + let e := historyStepEquiv X steps + have he := hd (e.symm ⁻¹' s) (e.symm.measurable hs) x y + change (W.coeff x y).map e (e.symm ⁻¹' s)=_ at he + rw [VectorMeasure.map_apply _ e.measurable (e.symm.measurable hs)] at he + erw [setIntegral_map (e.symm.measurable hs) + ((hm x y).comp e.symm.measurable).aestronglyMeasurable e.measurable.aemeasurable] at he + simpa only [Function.comp_apply,e.symm_apply_apply,Set.preimage_preimage, + e.symm_comp_self,Set.preimage_id'] using he + +end SecretKey + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/HilbertRecovery.lean b/lean/OAI/InformationTheory/Entanglement/HilbertRecovery.lean new file mode 100644 index 0000000000000000000000000000000000000000..579b44ff4f72d8fa3300c699d9bd2702e0603cfb --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/HilbertRecovery.lean @@ -0,0 +1,92 @@ +import OAI.InformationTheory.Entanglement.HilbertTrace +import OAI.InformationTheory.Entanglement.TraceContractivity + +namespace OAI + +noncomputable section +open scoped BigOperators InnerProductSpace ComplexOrder MatrixOrder +open ContinuousLinearMap Matrix +namespace SecretKey +open ChannelCompletion TensorCriterion +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {ι : Type*} {n : Type} [Fintype n] [DecidableEq n] + +def hilbertCompress (v : n → H) (T : H →L[ℂ] H) : Mat n := + fun i j => inner ℂ (v i) (T (v j)) +omit [Fintype n] [DecidableEq n] in +lemma hilbertCompress_hermitian (v : n → H) {T : H →L[ℂ] H} (hT : IsSelfAdjoint T) : + (hilbertCompress v T).IsHermitian := by + ext i j + change star (inner ℂ (v j) (T (v i)))=inner ℂ (v i) (T (v j)) + change (starRingEnd ℂ) (inner ℂ (v j) (T (v i)))=inner ℂ (v i) (T (v j)) + rw [inner_conj_symm] + exact (isSelfAdjoint_iff_isSymmetric.mp hT) _ _ +omit [DecidableEq n] in +lemma hilbertCompress_psd (v : n → H) {T : H →L[ℂ] H} (hT : 0≤T) : + (hilbertCompress v T).PosSemidef := by + refine Matrix.PosSemidef.of_dotProduct_mulVec_nonneg + (hilbertCompress_hermitian v hT.isSelfAdjoint) ?_ + intro x + have h := (nonneg_iff_isPositive.mp hT).inner_nonneg_right (∑ i, x i • v i) + simp only [map_sum,map_smul,inner_sum,sum_inner,inner_smul_left,inner_smul_right,Finset.mul_sum] at h + rw [Finset.sum_comm] at h + simpa only [hilbertCompress,dotProduct,Matrix.mulVec,Pi.star_apply,Finset.mul_sum,Finset.sum_mul, + mul_assoc,mul_left_comm,mul_comm,RCLike.star_def] using h + +def hilbertErase (b : HilbertBasis ι ℂ H) (v : n → H) (i₀ : n) + (T : H →L[ℂ] H) : Mat n := + hilbertCompress v T+((hilbertTrace b T-(Matrix.trace (hilbertCompress v T)).re : ℝ) : ℂ) • projector (Pi.single i₀ 1) +lemma hilbertErase_psd (b : HilbertBasis ι ℂ H) (v : n → H) (hv : Orthonormal ℂ v) (i₀ : n) + {T : H →L[ℂ] H} (hT : HasFinitePositiveTrace b T) : + (hilbertErase b v i₀ T).PosSemidef := by + apply (hilbertCompress_psd v hT.1).add + apply (Matrix.posSemidef_vecMulVec_self_star _).smul + rw [Complex.nonneg_iff] + refine ⟨sub_nonneg.mpr ?_,rfl⟩ + simpa only [Matrix.trace,Matrix.diag,hilbertCompress,Complex.re_sum] using + positive_finite_compression_trace b hT v hv Finset.univ + +lemma pure_coordinate_trace (i₀ : n) : + Matrix.trace (projector (Pi.single i₀ (1 : ℂ)))=1 := by + simp [projector,Matrix.trace,Matrix.diag,Matrix.vecMulVec,Pi.single_apply] +omit [CompleteSpace H] in +lemma hilbertErase_trace (b : HilbertBasis ι ℂ H) (v : n → H) (i₀ : n) (T : H →L[ℂ] H) : + (Matrix.trace (hilbertErase b v i₀ T)).re=hilbertTrace b T := by + rw [hilbertErase,Matrix.trace_add,Matrix.trace_smul,pure_coordinate_trace] + simp only [smul_eq_mul,mul_one,Complex.add_re,Complex.ofReal_re] + ring +omit [CompleteSpace H] [Fintype n] [DecidableEq n] in +lemma hilbertCompress_sub (v : n → H) (A B : H →L[ℂ] H) : + hilbertCompress v (A-B)=hilbertCompress v A-hilbertCompress v B := by + ext i j + simp only [hilbertCompress,_root_.sub_apply,inner_sub_right,Matrix.sub_apply] +omit [CompleteSpace H] in +lemma hilbertErase_sub (b : HilbertBasis ι ℂ H) (v : n → H) (i₀ : n) (A B : H →L[ℂ] H) + (hA : Summable (fun i => (inner ℂ (b i) (A (b i))).re)) + (hB : Summable (fun i => (inner ℂ (b i) (B (b i))).re)) : + hilbertErase b v i₀ (A-B)=hilbertErase b v i₀ A-hilbertErase b v i₀ B := by + simp only [hilbertErase,hilbertCompress_sub,hilbertTrace_sub b A B hA hB, + Matrix.trace_sub,Complex.sub_re,Complex.ofReal_sub,sub_smul] + abel + +theorem hilbertErase_contract (b : HilbertBasis ι ℂ H) (v : n → H) + (hv : Orthonormal ℂ v) (i₀ : n) {T : H →L[ℂ] H} + (hT : HermitianTraceClass b T) : + traceNorm (hilbertErase b v i₀ T)≤hilbertTraceNorm b T := by + obtain ⟨hp,hm⟩ := hermitian_parts_finite b hT + calc + traceNorm (hilbertErase b v i₀ T)=traceNorm + (hilbertErase b v i₀ (posPart T)-hilbertErase b v i₀ (negPart T)) := by + rw [← hilbertErase_sub b v i₀ _ _ hp.2 hm.2,CFC.posPart_sub_negPart T hT.1] + _ ≤ traceNorm (hilbertErase b v i₀ (posPart T))+traceNorm (hilbertErase b v i₀ (negPart T)) := + traceNorm_sub_le _ _ + _ = hilbertTrace b (posPart T)+hilbertTrace b (negPart T) := by + rw [traceNorm_of_psd (hilbertErase_psd b v hv i₀ hp), + traceNorm_of_psd (hilbertErase_psd b v hv i₀ hm),hilbertErase_trace,hilbertErase_trace] + _ = hilbertTraceNorm b T := (hilbertTraceNorm_jordan b hT).symm + +end SecretKey + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/HilbertTensor.lean b/lean/OAI/InformationTheory/Entanglement/HilbertTensor.lean new file mode 100644 index 0000000000000000000000000000000000000000..5f17aa0334fb28c65a50687a1b5d91786ef5c259 --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/HilbertTensor.lean @@ -0,0 +1,110 @@ +import OAI.InformationTheory.Entanglement.TraceClassModel + +namespace OAI + +noncomputable section +open scoped TensorProduct InnerProductSpace ComplexOrder +open ContinuousLinearMap UniformSpace +namespace SecretKey +variable {H K L M : Type*} + [NormedAddCommGroup H] [InnerProductSpace ℂ H] + [NormedAddCommGroup K] [InnerProductSpace ℂ K] + [NormedAddCommGroup L] [InnerProductSpace ℂ L] + [NormedAddCommGroup M] [InnerProductSpace ℂ M] + +abbrev HilbertTensor (H K : Type*) [NormedAddCommGroup H] [InnerProductSpace ℂ H] + [NormedAddCommGroup K] [InnerProductSpace ℂ K] := Completion (H ⊗[ℂ] K) +def hilbertTmul (x : H) (y : K) : HilbertTensor H K := ((x ⊗ₜ[ℂ] y : H ⊗[ℂ] K) : Completion _) +lemma hilbertTmul_inner (x x' : H) (y y' : K) : + inner ℂ (hilbertTmul x y) (hilbertTmul x' y')=inner ℂ x x'*inner ℂ y y' := by + exact Completion.inner_coe (x ⊗ₜ[ℂ] y) (x' ⊗ₜ[ℂ] y') +lemma hilbertTmul_continuous : Continuous (fun p : H×K => hilbertTmul p.1 p.2) := by + exact (Completion.continuous_coe _).comp TensorProduct.continuous_tmul +variable {ι κ : Type*} +lemma tensor_basis_orthonormal (b : HilbertBasis ι ℂ H) (c : HilbertBasis κ ℂ K) : + Orthonormal ℂ (fun p : ι×κ => hilbertTmul (b p.1) (c p.2)) := by + exact (b.orthonormal.tmul c.orthonormal).comp_linearIsometry Completion.toComplₗᵢ +lemma tensor_basis_dense (b : HilbertBasis ι ℂ H) (c : HilbertBasis κ ℂ K) : + ⊤≤(Submodule.span ℂ (Set.range (fun p : ι×κ => hilbertTmul (b p.1) (c p.2)))).topologicalClosure := by + let S := (Submodule.span ℂ (Set.range (fun p : ι×κ => hilbertTmul (b p.1) (c p.2)))).topologicalClosure + have hS : IsClosed (S : Set (HilbertTensor H K)) := Submodule.isClosed_topologicalClosure _ + have hbase (i : ι) (j : κ) : hilbertTmul (b i) (c j)∈S := + Submodule.le_topologicalClosure _ (Submodule.subset_span ⟨(i,j),rfl⟩) + have hfirst (i : ι) (y : K) : hilbertTmul (b i) y∈S := by + let F : K →L[ℂ] HilbertTensor H K := Completion.toComplL.comp (TensorProduct.mkL ℂ H K (b i)) + have hs := (c.hasSum_repr y).mapL F + apply hS.mem_of_tendsto hs + filter_upwards with t + apply S.sum_mem + intro j hj + rw [map_smul] + exact S.smul_mem (c.repr y j) (hbase i j) + have hsecond (x : H) (y : K) : hilbertTmul x y∈S := by + let F : H →L[ℂ] HilbertTensor H K := Completion.toComplL.comp ((TensorProduct.mkL ℂ H K).flip y) + have hs := (b.hasSum_repr x).mapL F + apply hS.mem_of_tendsto hs + filter_upwards with t + apply S.sum_mem + intro i hi + rw [map_smul] + exact S.smul_mem (b.repr x i) (hfirst i y) + intro z hz + change z∈S + refine Completion.induction_on z hS ?_ + intro x + induction x using TensorProduct.inductionOn with + | tmul x y => exact hsecond x y + | add x y hx hy => simpa only [Completion.coe_add] using S.add_mem hx hy +def tensorHilbertBasis (b : HilbertBasis ι ℂ H) (c : HilbertBasis κ ℂ K) : + HilbertBasis (ι×κ) ℂ (HilbertTensor H K) := + HilbertBasis.mk (tensor_basis_orthonormal b c) (tensor_basis_dense b c) +@[simp] lemma tensorHilbertBasis_apply (b : HilbertBasis ι ℂ H) (c : HilbertBasis κ ℂ K) (p : ι×κ) : + tensorHilbertBasis b c p=hilbertTmul (b p.1) (c p.2) := by + simp [tensorHilbertBasis] +def hilbertTensorMap (A : H →L[ℂ] L) (B : K →L[ℂ] M) : HilbertTensor H K →L[ℂ] HilbertTensor L M := + (Completion.toComplL.comp (TensorProduct.mapL A B)).extend Completion.toComplL +@[simp] lemma hilbertTensorMap_tmul (A : H →L[ℂ] L) (B : K →L[ℂ] M) (x : H) (y : K) : + hilbertTensorMap A B (hilbertTmul x y)=hilbertTmul (A x) (B y) := by + exact ContinuousLinearMap.extend_eq _ Completion.denseRange_coe (Completion.isUniformInducing_coe _) _ + +lemma hilbertTensor_ext {F G : HilbertTensor H K →L[ℂ] L} + (h : ∀ x y, F (hilbertTmul x y)=G (hilbertTmul x y)) : F=G := by + ext z + refine Completion.induction_on z (isClosed_eq F.continuous G.continuous) ?_ + intro t + induction t using TensorProduct.inductionOn with + | tmul x y => exact h x y + | add x y hx hy => simp only [Completion.coe_add,map_add,hx,hy] +lemma hilbertTensorMap_comp (A : H →L[ℂ] L) (B : K →L[ℂ] M) + (C : H →L[ℂ] H) (D : K →L[ℂ] K) : + hilbertTensorMap (A.comp C) (B.comp D)= + (hilbertTensorMap A B).comp (hilbertTensorMap C D) := by + apply hilbertTensor_ext + intro x y + simp +lemma hilbertTensor_inner_ext (F G : HilbertTensor H K →L[ℂ] HilbertTensor L M) + (h : ∀ x y u v, inner ℂ (hilbertTmul u v) (F (hilbertTmul x y))= + inner ℂ (hilbertTmul u v) (G (hilbertTmul x y))) : F=G := by + apply hilbertTensor_ext + intro x y + apply ext_inner_left ℂ + intro z + refine Completion.induction_on z (isClosed_eq (by fun_prop) (by fun_prop)) ?_ + intro t + induction t using TensorProduct.inductionOn with + | tmul u v => exact h x y u v + | add u v hu hv => simp only [Completion.coe_add,inner_add_left,hu,hv] +variable [CompleteSpace H] [CompleteSpace K] [CompleteSpace L] [CompleteSpace M] + +lemma hilbertTensorMap_adjoint (A : H →L[ℂ] L) (B : K →L[ℂ] M) : + (hilbertTensorMap A B).adjoint=hilbertTensorMap A.adjoint B.adjoint := by + apply hilbertTensor_inner_ext + intro x y u v + rw [adjoint_inner_right,hilbertTensorMap_tmul,hilbertTensorMap_tmul, + hilbertTmul_inner,hilbertTmul_inner,A.adjoint_inner_right,B.adjoint_inner_right] + +end SecretKey + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/HilbertTrace.lean b/lean/OAI/InformationTheory/Entanglement/HilbertTrace.lean new file mode 100644 index 0000000000000000000000000000000000000000..27fa5a67d12aa91bf8c622725be7eed73cecf2ba --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/HilbertTrace.lean @@ -0,0 +1,132 @@ +import Mathlib + +namespace OAI + +noncomputable section +open scoped BigOperators InnerProductSpace ComplexOrder +open ContinuousLinearMap +namespace SecretKey +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {ι κ : Type*} + +def hilbertTrace (b : HilbertBasis ι ℂ H) (T : H →L[ℂ] H) : ℝ := + ∑' i, (inner ℂ (b i) (T (b i))).re + +def HasFinitePositiveTrace (b : HilbertBasis ι ℂ H) (T : H →L[ℂ] H) : Prop := + 0≤T ∧ Summable (fun i => (inner ℂ (b i) (T (b i))).re) + +omit [CompleteSpace H] in +lemma hilbert_parseval (b : HilbertBasis ι ℂ H) (x : H) : + HasSum (fun i => ‖inner ℂ (b i) x‖^2) (‖x‖^2) := by + have h := (b.hasSum_inner_mul_inner x x).mapL Complex.reCLM + convert h using 1 + · ext i + simp only [Complex.reCLM_apply,← inner_conj_symm x,Complex.conj_mul', + ← Complex.ofReal_pow,Complex.ofReal_re] + · exact (InnerProductSpace.norm_sq_eq_re_inner (𝕜 := ℂ) x) + +lemma positive_diagonal_sqrt {T : H →L[ℂ] H} (hT : 0≤T) (x : H) : + (inner ℂ x (T x)).re=‖(CFC.sqrt T) x‖^2 := by + have hs : (CFC.sqrt T).IsPositive := nonneg_iff_isPositive.mp (CFC.sqrt_nonneg T) + rw [InnerProductSpace.norm_sq_eq_re_inner (𝕜 := ℂ)] + have he : inner ℂ (CFC.sqrt T x) (CFC.sqrt T x)=inner ℂ x (T x) := by + rw [hs.inner_left_eq_inner_right] + change inner ℂ x ((CFC.sqrt T*CFC.sqrt T) x)=_ + rw [CFC.sqrt_mul_sqrt_self T] + exact congrArg Complex.re he.symm + +omit [CompleteSpace H] in +lemma symmetric_finite_compression_trace + (b : HilbertBasis ι ℂ H) (S : H →L[ℂ] H) (hS : S.IsSymmetric) + (hi : Summable (fun i => ‖S (b i)‖^2)) + (v : κ → H) (hv : Orthonormal ℂ v) (s : Finset κ) : + ∑ j ∈ s, ‖S (v j)‖^2 ≤ ∑' i, ‖S (b i)‖^2 := by + have he (j : κ) : + HasSum (fun i => ‖inner ℂ (v j) (S (b i))‖^2) (‖S (v j)‖^2) := by + convert hilbert_parseval b (S (v j)) using 1 + ext i + have h := hS (b i) (v j) + change inner ℂ (S (b i)) (v j)=inner ℂ (b i) (S (v j)) at h + rw [← h,norm_inner_symm] + calc + ∑ j ∈ s, ‖S (v j)‖^2 = ∑ j ∈ s, ∑' i, ‖inner ℂ (v j) (S (b i))‖^2 := by + apply Finset.sum_congr rfl + intro j hj + exact (he j).tsum_eq.symm + _ = ∑' i, ∑ j ∈ s, ‖inner ℂ (v j) (S (b i))‖^2 := + ((fun j (_ : j∈s) => (he j).summable) |> Summable.tsum_finsetSum).symm + _ ≤ ∑' i, ‖S (b i)‖^2 := by + apply Summable.tsum_le_tsum _ ((hasSum_sum (s := s) fun j _ => he j).summable) hi + intro i + exact hv.sum_inner_products_le (S (b i)) + +lemma positive_finite_compression_trace + (b : HilbertBasis ι ℂ H) {T : H →L[ℂ] H} (hT : HasFinitePositiveTrace b T) + (v : κ → H) (hv : Orthonormal ℂ v) (s : Finset κ) : + ∑ j ∈ s, (inner ℂ (v j) (T (v j))).re ≤ hilbertTrace b T := by + have hi : Summable (fun i => ‖CFC.sqrt T (b i)‖^2) := by + simpa only [← positive_diagonal_sqrt hT.1] using hT.2 + have hs := symmetric_finite_compression_trace b (CFC.sqrt T) + (nonneg_iff_isPositive.mp (CFC.sqrt_nonneg T)).isSymmetric hi v hv s + simpa only [← positive_diagonal_sqrt hT.1,hilbertTrace] using hs + +lemma positiveTrace_change_basis (b : HilbertBasis ι ℂ H) (c : HilbertBasis κ ℂ H) + {T : H →L[ℂ] H} (hT : HasFinitePositiveTrace b T) : + HasFinitePositiveTrace c T ∧ hilbertTrace c T=hilbertTrace b T := by + have hc : HasFinitePositiveTrace c T := ⟨hT.1,summable_of_sum_le + (fun j => (nonneg_iff_isPositive.mp hT.1).re_inner_nonneg_right _) + (fun s => positive_finite_compression_trace b hT c c.orthonormal s)⟩ + refine ⟨hc,le_antisymm ?_ ?_⟩ + · exact Real.tsum_le_of_sum_le (fun j => (nonneg_iff_isPositive.mp hT.1).re_inner_nonneg_right _) + (fun s => positive_finite_compression_trace b hT c c.orthonormal s) + · exact Real.tsum_le_of_sum_le (fun j => (nonneg_iff_isPositive.mp hT.1).re_inner_nonneg_right _) + (fun s => positive_finite_compression_trace c hc b b.orthonormal s) + +omit [CompleteSpace H] in +lemma hilbertTrace_add (b : HilbertBasis ι ℂ H) (A B : H →L[ℂ] H) + (hA : Summable (fun i => (inner ℂ (b i) (A (b i))).re)) + (hB : Summable (fun i => (inner ℂ (b i) (B (b i))).re)) : + hilbertTrace b (A+B)=hilbertTrace b A+hilbertTrace b B := by + simp only [hilbertTrace,add_apply,inner_add_right,Complex.add_re] + exact hA.tsum_add hB +omit [CompleteSpace H] in +lemma hilbertTrace_sub (b : HilbertBasis ι ℂ H) (A B : H →L[ℂ] H) + (hA : Summable (fun i => (inner ℂ (b i) (A (b i))).re)) + (hB : Summable (fun i => (inner ℂ (b i) (B (b i))).re)) : + hilbertTrace b (A-B)=hilbertTrace b A-hilbertTrace b B := by + simp only [hilbertTrace,sub_apply,inner_sub_right,Complex.sub_re] + exact hA.tsum_sub hB +omit [CompleteSpace H] in +lemma finitePositiveTrace_of_le (b : HilbertBasis ι ℂ H) + {A B : H →L[ℂ] H} (hB : HasFinitePositiveTrace b B) (hA : 0≤A) (hAB : A≤B) : + HasFinitePositiveTrace b A := by + refine ⟨hA,Summable.of_nonneg_of_le + (fun i => (nonneg_iff_isPositive.mp hA).re_inner_nonneg_right _) ?_ hB.2⟩ + intro i + have h := (nonneg_iff_isPositive.mp (sub_nonneg.mpr hAB)).re_inner_nonneg_right (b i) + change 0≤Complex.re (inner ℂ (b i) ((B-A) (b i))) at h + simpa only [sub_apply,inner_sub_right,Complex.sub_re,sub_nonneg] using h + +def hilbertTraceNorm (b : HilbertBasis ι ℂ H) (T : H →L[ℂ] H) : ℝ := + hilbertTrace b (CFC.abs T) +def HermitianTraceClass (b : HilbertBasis ι ℂ H) (T : H →L[ℂ] H) : Prop := + IsSelfAdjoint T ∧ HasFinitePositiveTrace b (CFC.abs T) +lemma hermitian_parts_finite (b : HilbertBasis ι ℂ H) {T : H →L[ℂ] H} + (hT : HermitianTraceClass b T) : + HasFinitePositiveTrace b (posPart T) ∧ HasFinitePositiveTrace b (negPart T) := by + have he : posPart T+negPart T=CFC.abs T := CFC.posPart_add_negPart T hT.1 + exact ⟨finitePositiveTrace_of_le b hT.2 (CFC.posPart_nonneg T) + (he ▸ le_add_of_nonneg_right (CFC.negPart_nonneg T)), + finitePositiveTrace_of_le b hT.2 (CFC.negPart_nonneg T) + (he ▸ le_add_of_nonneg_left (CFC.posPart_nonneg T))⟩ +lemma hilbertTraceNorm_jordan (b : HilbertBasis ι ℂ H) {T : H →L[ℂ] H} + (hT : HermitianTraceClass b T) : + hilbertTraceNorm b T=hilbertTrace b (posPart T)+hilbertTrace b (negPart T) := by + obtain ⟨hp,hm⟩ := hermitian_parts_finite b hT + rw [hilbertTraceNorm,← CFC.posPart_add_negPart T hT.1,hilbertTrace_add b _ _ hp.2 hm.2] + +end SecretKey + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/HilbertTraceDifference.lean b/lean/OAI/InformationTheory/Entanglement/HilbertTraceDifference.lean new file mode 100644 index 0000000000000000000000000000000000000000..6fc93ea88d7cd9b47734f75cd882df105d22930d --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/HilbertTraceDifference.lean @@ -0,0 +1,90 @@ +import OAI.InformationTheory.Entanglement.HilbertTraceIdeal + +namespace OAI + +noncomputable section +open scoped BigOperators InnerProductSpace ComplexOrder +open ContinuousLinearMap +namespace SecretKey +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {ι : Type*} +lemma positive_part_finite_sum_le (b : HilbertBasis ι ℂ H) + {T A : H →L[ℂ] H} (hT : IsSelfAdjoint T) + (hA : HasFinitePositiveTrace b A) (hTA : T≤A) (s : Finset ι) : + (∑ j∈s, (inner ℂ (b j) (posPart T (b j))).re)≤hilbertTrace b A := by + apply le_of_forall_pos_le_add + intro ε hε + let δ : ℝ := ε/(s.card+1) + have hd : 0<δ := div_pos hε (by positivity) + let U := cfc (positiveSupportApprox δ) T + obtain ⟨hu,hn,he⟩ := positiveSupportApprox_operator T hT hd + change IsSelfAdjoint U at hu + change ‖U‖≤1 at hn + change ‖posPart T-U*T*U‖≤δ at he + have hus : U.IsSymmetric := isSelfAdjoint_iff_isSymmetric.mp hu + have hj (j : ι) : (inner ℂ (b j) (posPart T (b j))).re ≤ + (inner ℂ (U (b j)) (A (U (b j)))).re+δ := by + have hn1 : ‖b j‖=1 := b.orthonormal.norm_eq_one j + have hb : (inner ℂ (b j) ((posPart T-U*T*U) (b j))).re≤δ := by + calc + _ ≤ ‖inner ℂ (b j) ((posPart T-U*T*U) (b j))‖ := Complex.re_le_norm _ + _ ≤ ‖b j‖ * ‖(posPart T-U*T*U) (b j)‖ := norm_inner_le_norm _ _ + _ ≤ ‖b j‖ * (‖posPart T-U*T*U‖ * ‖b j‖) := + mul_le_mul_of_nonneg_left ((posPart T-U*T*U).le_opNorm _) (norm_nonneg _) + _ ≤ δ := by simpa only [hn1,one_mul,mul_one] using he + have ht : (inner ℂ (U (b j)) (T (U (b j)))).re≤ + (inner ℂ (U (b j)) (A (U (b j)))).re := by + have hp := (nonneg_iff_isPositive.mp (sub_nonneg.mpr hTA)).re_inner_nonneg_right (U (b j)) + change 0≤(inner ℂ (U (b j)) ((A-T) (U (b j)))).re at hp + simpa only [sub_apply,inner_sub_right,Complex.sub_re,sub_nonneg] using hp + have hh : inner ℂ (b j) ((U*T*U) (b j))=inner ℂ (U (b j)) (T (U (b j))) := by + exact (hus (b j) (T (U (b j)))).symm + simp only [sub_apply,inner_sub_right,Complex.sub_re,hh] at hb + linarith + calc + (∑ j∈s, (inner ℂ (b j) (posPart T (b j))).re) ≤ + ∑ j∈s, ((inner ℂ (U (b j)) (A (U (b j)))).re+δ) := + Finset.sum_le_sum (fun j _ => hj j) + _ = (∑ j∈s, (inner ℂ (U (b j)) (A (U (b j)))).re)+s.card*δ := by + rw [Finset.sum_add_distrib,Finset.sum_const,nsmul_eq_mul] + _ ≤ hilbertTrace b A+s.card*δ := + add_le_add (positive_contraction_family_trace b hA U hus hn s) le_rfl + _ ≤ hilbertTrace b A+ε := by + apply add_le_add le_rfl + have hfrac : δ*((s.card : ℝ)+1)=ε := (div_mul_cancel₀ ε (by positivity)) + nlinarith +lemma positive_part_finite_of_majorant (b : HilbertBasis ι ℂ H) + {T A : H →L[ℂ] H} (hT : IsSelfAdjoint T) + (hA : HasFinitePositiveTrace b A) (hTA : T≤A) : + HasFinitePositiveTrace b (posPart T) ∧ hilbertTrace b (posPart T)≤hilbertTrace b A := by + have hn (i : ι) : 0≤(inner ℂ (b i) (posPart T (b i))).re := + (nonneg_iff_isPositive.mp (CFC.posPart_nonneg T)).re_inner_nonneg_right _ + exact ⟨⟨CFC.posPart_nonneg T,summable_of_sum_le hn + (positive_part_finite_sum_le b hT hA hTA)⟩, + Real.tsum_le_of_sum_le hn (positive_part_finite_sum_le b hT hA hTA)⟩ + +theorem positive_difference_traceClass (b : HilbertBasis ι ℂ H) + {A B : H →L[ℂ] H} (hA : HasFinitePositiveTrace b A) + (hB : HasFinitePositiveTrace b B) : + HermitianTraceClass b (A-B) ∧ + hilbertTraceNorm b (A-B)≤hilbertTrace b A+hilbertTrace b B := by + have ht : IsSelfAdjoint (A-B) := hA.1.isSelfAdjoint.sub hB.1.isSelfAdjoint + obtain ⟨hp,hp'⟩ := positive_part_finite_of_majorant b ht hA + (sub_le_self A hB.1) + obtain ⟨hn,hn'⟩ := positive_part_finite_of_majorant b ht.neg hB (show -(A-B)≤B by + rw [neg_sub]; exact sub_le_self B hA.1) + have he : posPart (-(A-B))=negPart (A-B) := CFC.posPart_neg (A-B) + rw [he] at hn hn' + have hab : HasFinitePositiveTrace b (CFC.abs (A-B)) := by + rw [← CFC.posPart_add_negPart (A-B) ht] + refine ⟨add_nonneg hp.1 hn.1,?_⟩ + simpa only [add_apply,inner_add_right,Complex.add_re] using hp.2.add hn.2 + refine ⟨⟨ht,hab⟩,?_⟩ + rw [hilbertTraceNorm_jordan b ⟨ht,hab⟩] + exact add_le_add hp' hn' + +end SecretKey + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/HilbertTraceIdeal.lean b/lean/OAI/InformationTheory/Entanglement/HilbertTraceIdeal.lean new file mode 100644 index 0000000000000000000000000000000000000000..1926e31169b3a0cd4459e2774de9df71df997102 --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/HilbertTraceIdeal.lean @@ -0,0 +1,112 @@ +import OAI.InformationTheory.Entanglement.HilbertTrace + +namespace OAI + +noncomputable section +open scoped BigOperators InnerProductSpace ComplexOrder +open ContinuousLinearMap +namespace SecretKey +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {ι κ : Type*} + +omit [CompleteSpace H] in +lemma symmetric_bessel_trace (b : HilbertBasis ι ℂ H) (S : H →L[ℂ] H) + (hS : S.IsSymmetric) (hi : Summable (fun i => ‖S (b i)‖^2)) + (v : κ → H) (s : Finset κ) (hv : ∀ x, ∑ j∈s, ‖inner ℂ (v j) x‖^2≤‖x‖^2) : + ∑ j∈s, ‖S (v j)‖^2≤∑' i, ‖S (b i)‖^2 := by + have he (j : κ) : HasSum (fun i => ‖inner ℂ (v j) (S (b i))‖^2) (‖S (v j)‖^2) := by + convert hilbert_parseval b (S (v j)) using 1 + ext i + have h := hS (b i) (v j) + change inner ℂ (S (b i)) (v j)=inner ℂ (b i) (S (v j)) at h + rw [← h,norm_inner_symm] + calc + ∑ j∈s, ‖S (v j)‖^2=∑ j∈s, ∑' i, ‖inner ℂ (v j) (S (b i))‖^2 := by + apply Finset.sum_congr rfl + intro j _ + exact (he j).tsum_eq.symm + _ = ∑' i, ∑ j∈s, ‖inner ℂ (v j) (S (b i))‖^2 := + ((fun j (_ : j∈s) => (he j).summable) |> Summable.tsum_finsetSum).symm + _ ≤ ∑' i, ‖S (b i)‖^2 := + Summable.tsum_le_tsum (fun i => hv (S (b i))) + (hasSum_sum (s := s) (fun j _ => he j)).summable hi +lemma positive_contraction_family_trace (b : HilbertBasis ι ℂ H) + {A : H →L[ℂ] H} (hA : HasFinitePositiveTrace b A) + (U : H →L[ℂ] H) (hU : U.IsSymmetric) (hn : ‖U‖≤1) (s : Finset ι) : + ∑ j∈s, (inner ℂ (U (b j)) (A (U (b j)))).re≤hilbertTrace b A := by + have hi : Summable (fun i => ‖CFC.sqrt A (b i)‖^2) := by + simpa only [← positive_diagonal_sqrt hA.1] using hA.2 + have hb (x : H) : (∑ j∈s, ‖inner ℂ (U (b j)) x‖^2)≤‖x‖^2 := by + have he (j : ι) : inner ℂ (U (b j)) x=inner ℂ (b j) (U x) := hU _ _ + simp only [he] + calc + (∑ j∈s, ‖inner ℂ (b j) (U x)‖^2)≤‖U x‖^2 := b.orthonormal.sum_inner_products_le _ + _ ≤ ‖x‖^2 := by + apply pow_le_pow_left₀ (norm_nonneg _) + exact (U.le_opNorm x).trans (by nlinarith [norm_nonneg x]) + have h := symmetric_bessel_trace b (CFC.sqrt A) + (nonneg_iff_isPositive.mp (CFC.sqrt_nonneg A)).isSymmetric hi (fun i => U (b i)) s hb + simpa only [← positive_diagonal_sqrt hA.1,hilbertTrace] using h + +def positiveSupportApprox (ε : ℝ) (x : ℝ) : ℝ := + Real.sqrt (max x 0/(max x 0+ε)) +lemma positiveSupportApprox_continuous {ε : ℝ} (hε : 0<ε) : + Continuous (positiveSupportApprox ε) := by + exact ((continuous_id.max continuous_const).div + ((continuous_id.max continuous_const).add continuous_const) + (fun x => (add_pos_of_nonneg_of_pos (le_max_right x 0) hε).ne')).sqrt +lemma positiveSupportApprox_norm {ε : ℝ} (hε : 0<ε) (x : ℝ) : + ‖positiveSupportApprox ε x‖≤1 := by + unfold positiveSupportApprox + rw [Real.norm_eq_abs,abs_of_nonneg (Real.sqrt_nonneg _)] + apply Real.sqrt_le_one.mpr + exact (div_le_one (add_pos_of_nonneg_of_pos (le_max_right x 0) hε)).mpr (by linarith) +lemma positiveSupportApprox_error {ε : ℝ} (hε : 0<ε) (x : ℝ) : + ‖max x 0-positiveSupportApprox ε x*x*positiveSupportApprox ε x‖≤ε := by + have hs : (positiveSupportApprox ε x)^2=max x 0/(max x 0+ε) := + Real.sq_sqrt (div_nonneg (le_max_right x 0) (by linarith [le_max_right x 0])) + have hd : 0 < (max x 0 + ε) := add_pos_of_nonneg_of_pos (le_max_right x 0) hε + have he : (positiveSupportApprox ε x)^2*(max x 0+ε)=max x 0 := + (eq_div_iff hd.ne').mp hs + have hn := positiveSupportApprox_norm hε x + rw [Real.norm_eq_abs] at hn ⊢ + have hns := abs_le.mp hn + by_cases hx : 0≤x + · rw [max_eq_left hx] at he ⊢ + apply abs_le.mpr + constructor <;> nlinarith [sq_nonneg (positiveSupportApprox ε x)] + · have hm : max x 0=0 := max_eq_right (le_of_not_ge hx) + simp [positiveSupportApprox,hm,hε.le] +lemma positiveSupportApprox_operator (T : H →L[ℂ] H) (hT : IsSelfAdjoint T) + {ε : ℝ} (hε : 0<ε) : + let U := cfc (positiveSupportApprox ε) T + IsSelfAdjoint U ∧ ‖U‖≤1 ∧ ‖posPart T-U*T*U‖≤ε := by + dsimp only + refine ⟨cfc_predicate _ _,norm_cfc_le (by norm_num) (fun x _ => positiveSupportApprox_norm hε x),?_⟩ + have hc : ContinuousOn (positiveSupportApprox ε) (spectrum ℝ T) := + (positiveSupportApprox_continuous hε).continuousOn + have hm : cfc (fun x => positiveSupportApprox ε x*x*positiveSupportApprox ε x) T= + cfc (positiveSupportApprox ε) T*T*cfc (positiveSupportApprox ε) T := by + rw [cfc_mul (fun x => positiveSupportApprox ε x*x) (positiveSupportApprox ε) T + ((positiveSupportApprox_continuous hε).mul continuous_id).continuousOn hc, + cfc_mul (positiveSupportApprox ε) (fun x : ℝ => x) T hc continuous_id.continuousOn] + change cfc (positiveSupportApprox ε) T * cfc (id : ℝ → ℝ) T * + cfc (positiveSupportApprox ε) T = _ + rw [cfc_id ℝ T hT] + have hp : cfc (fun x : ℝ => max x 0) T=posPart T := by + rw [CFC.posPart_def,cfcₙ_eq_cfc] + rfl + have he : posPart T-cfc (positiveSupportApprox ε) T*T*cfc (positiveSupportApprox ε) T= + cfc (fun x => max x 0-positiveSupportApprox ε x*x*positiveSupportApprox ε x) T := by + rw [cfc_sub (fun x : ℝ => max x 0) + (fun x : ℝ => positiveSupportApprox ε x*x*positiveSupportApprox ε x) T + (continuous_id.max continuous_const).continuousOn + (((positiveSupportApprox_continuous hε).mul continuous_id).mul + (positiveSupportApprox_continuous hε)).continuousOn,hp,hm] + rw [he] + exact norm_cfc_le hε.le (fun x _ => positiveSupportApprox_error hε x) +end SecretKey + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/HilbertVectorMeasure.lean b/lean/OAI/InformationTheory/Entanglement/HilbertVectorMeasure.lean new file mode 100644 index 0000000000000000000000000000000000000000..77578bcdc9a827490e1a46b4896293a77c242931 --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/HilbertVectorMeasure.lean @@ -0,0 +1,76 @@ +import OAI.InformationTheory.Entanglement.HermitianInstrument + +namespace OAI + +noncomputable section +open scoped InnerProductSpace ComplexOrder MeasureTheory Function +open ContinuousLinearMap MeasureTheory +namespace SecretKey +attribute [local instance] Classical.propDecidable +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {ι T : Type*} [MeasurableSpace T] +namespace HermitianTrace +variable (b : HilbertBasis ι ℂ H) +def coefficient (x y : H) : HermitianTrace b →L[ℝ] ℂ := + ((innerSL ℂ x).restrictScalars ℝ).comp + (((ContinuousLinearMap.apply ℂ H y).restrictScalars ℝ).comp (inclusion b)) +@[simp] lemma coefficient_apply (x y : H) (A : HermitianTrace b) : + coefficient b x y A=inner ℂ x (operator b A y) := rfl +lemma ext_coefficient {A B : HermitianTrace b} + (h : ∀ x y, coefficient b x y A=coefficient b x y B) : A=B := by + apply Subtype.ext + ext y + exact ext_inner_left ℂ (fun x => h x y) +end HermitianTrace +namespace PositiveHilbertMeasure +variable {b : HilbertBasis ι ℂ H} (W : PositiveHilbertMeasure T H b) + +def traceValue (s : Set T) : HermitianTrace b := + if hs : MeasurableSet s then ⟨W.value s,⟨(W.positive s hs).1.isSelfAdjoint,by + rw [CFC.abs_of_nonneg _ (W.positive s hs).1] + exact W.positive s hs⟩⟩ else 0 +lemma traceValue_operator {s : Set T} (hs : MeasurableSet s) : + HermitianTrace.operator b (W.traceValue s)=W.value s := by + simp [traceValue,hs,HermitianTrace.operator] +lemma traceValue_coefficient (x y : H) {s : Set T} (hs : MeasurableSet s) : + HermitianTrace.coefficient b x y (W.traceValue s)=W.coeff x y s := by + rw [HermitianTrace.coefficient_apply,W.traceValue_operator hs,W.coeff_value x y s hs] +lemma traceValue_norm {s : Set T} (hs : MeasurableSet s) : + ‖W.traceValue s‖=W.traceMeasure.real s := by + rw [HermitianTrace.norm_eq,W.traceValue_operator hs,hilbertTraceNorm, + CFC.abs_of_nonneg _ (W.positive s hs).1,← W.trace_value s hs] +lemma traceValue_empty : W.traceValue ∅=0 := by + apply HermitianTrace.ext_coefficient + intro x y + rw [W.traceValue_coefficient x y MeasurableSet.empty,VectorMeasure.empty,map_zero] + +lemma traceValue_hasSum {f : ℕ→Set T} (hf : ∀ i, MeasurableSet (f i)) + (hd : Pairwise (Disjoint on f)) : HasSum (fun i => W.traceValue (f i)) (W.traceValue (⋃ i, f i)) := by + have hs : Summable (fun i => W.traceValue (f i)) := by + apply Summable.of_norm + simpa only [W.traceValue_norm (hf _)] using (summable_measure_toReal (μ := W.traceMeasure) hf hd) + convert hs.hasSum using 1 + apply HermitianTrace.ext_coefficient + intro x y + have h1 := hs.hasSum.mapL (HermitianTrace.coefficient b x y) + have h2 := (W.coeff x y).m_iUnion hf hd + simp only [W.traceValue_coefficient x y (hf _)] at h1 + rw [W.traceValue_coefficient x y (MeasurableSet.iUnion hf)] + exact h2.unique h1 + +def traceVectorMeasure : VectorMeasure T (HermitianTrace b) where + measureOf' := W.traceValue + empty' := W.traceValue_empty + not_measurable' := by intro s hs; simp [traceValue,hs] + m_iUnion' := by intro f hf hd; exact W.traceValue_hasSum hf hd +@[simp] lemma traceVectorMeasure_apply (s : Set T) : W.traceVectorMeasure s=W.traceValue s := rfl +lemma traceVectorMeasure_coefficient (x y : H) {s : Set T} (hs : MeasurableSet s) : + HermitianTrace.coefficient b x y (W.traceVectorMeasure s)=W.coeff x y s := + W.traceValue_coefficient x y hs +end PositiveHilbertMeasure + +end SecretKey + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/IndependentTapes.lean b/lean/OAI/InformationTheory/Entanglement/IndependentTapes.lean new file mode 100644 index 0000000000000000000000000000000000000000..3a17b5c2d6f7583ed7ca07460944e226d83feb8f --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/IndependentTapes.lean @@ -0,0 +1,67 @@ +import OAI.InformationTheory.Entanglement.KernelSampling + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory Filter +open scoped MeasureTheory ProbabilityTheory unitInterval +namespace SecretKey +variable {ι : Type*} +abbrev UniformTapes (ι : Type*) := ι → I +def uniformTapesLaw : Measure (UniformTapes ι) := Measure.infinitePi (fun _ : ι => (volume : Measure I)) +instance : IsProbabilityMeasure (uniformTapesLaw (ι := ι)) := by unfold uniformTapesLaw; infer_instance + +@[instance_reducible] def tapeInformation (s : Set ι) : MeasurableSpace (UniformTapes ι) := + ⨆ i ∈ s, (inferInstance : MeasurableSpace I).comap (fun ω => ω i) +lemma tapeInformation_le (s : Set ι) : tapeInformation s ≤ (inferInstance : MeasurableSpace (UniformTapes ι)) := + iSup_le fun i => iSup_le fun _ => (measurable_pi_apply i).comap_le +lemma tapeInformation_mono {s t : Set ι} (h : s ⊆ t) : tapeInformation s ≤ tapeInformation t := + iSup_le fun i => iSup_le fun hi => le_iSup_of_le i (le_iSup_of_le (h hi) le_rfl) +lemma tapeInformation_union (s t : Set ι) : tapeInformation (s∪t)=tapeInformation s ⊔ tapeInformation t := by + apply le_antisymm + · refine iSup_le fun i => iSup_le fun hi => ?_ + rcases hi with hi|hi + · exact le_sup_of_le_left (le_iSup_of_le i (le_iSup_of_le hi le_rfl)) + · exact le_sup_of_le_right (le_iSup_of_le i (le_iSup_of_le hi le_rfl)) + · exact sup_le (tapeInformation_mono Set.subset_union_left) (tapeInformation_mono Set.subset_union_right) +lemma independent_tape_groups {s t : Set ι} (hst : Disjoint s t) : + Indep (tapeInformation s) (tapeInformation t) uniformTapesLaw := by + apply indep_iSup_of_disjoint (fun i => (measurable_pi_apply i).comap_le) _ hst + exact (iIndepFun_iff_iIndep _ _ _).mp (iIndepFun_infinitePi (X := fun _ (u : I) => u) (by fun_prop)) +lemma tape_coordinate_law (i : ι) : uniformTapesLaw.map (fun ω : UniformTapes ι => ω i)=volume := + Measure.infinitePi_map_eval _ i +lemma fresh_coordinate_independent {S : Type*} [MeasurableSpace S] + {s : Set ι} {i : ι} (hi : i∉s) (H : UniformTapes ι → S) + (hH : Measurable[tapeInformation s] H) : + IndepFun H (fun ω => ω i) uniformTapesLaw := by + have h := independent_tape_groups (s := s) (t := {i}) (Set.disjoint_singleton_right.mpr hi) + apply indep_of_indep_of_le h hH.comap_le + exact le_iSup_of_le i (le_iSup_of_le (Set.mem_singleton i) le_rfl) + +variable {Ω : Type*} {mΩ : MeasurableSpace Ω} [StandardBorelSpace Ω] +variable {μ : Measure Ω} [IsProbabilityMeasure μ] +lemma initial_conditional_independence {A B F : MeasurableSpace Ω} + (hA : A ≤ mΩ) (hB : B ≤ mΩ) (hF : F ≤ mΩ) + (hind : Indep B (A ⊔ F) μ) : CondIndep F A B hF μ := by + apply independence_of_local_marginals hF (sup_le hA hF) le_sup_left le_sup_right hB + intro b hb + have hsm : StronglyMeasurable[B] (b.indicator (fun _ => (1 : ℝ))) := + stronglyMeasurable_const.indicator hb + exact (condExp_indep_eq hB (sup_le hA hF) hsm hind).trans + (condExp_indep_eq hB hF hsm (indep_of_indep_of_le_right hind le_sup_right)).symm + +theorem initial_uniform_tape_independence [Countable ι] + {a b c : Set ι} (habc : Disjoint b (a∪c)) + {F : MeasurableSpace (UniformTapes ι)} (hF : F ≤ tapeInformation c) : + CondIndep F (tapeInformation a) (tapeInformation b) (hF.trans (tapeInformation_le c)) uniformTapesLaw := by + apply initial_conditional_independence (tapeInformation_le a) (tapeInformation_le b) + (hF.trans (tapeInformation_le c)) + apply indep_of_indep_of_le_right (independent_tape_groups habc) + rw [tapeInformation_union] + exact sup_le_sup_left hF _ + +end SecretKey + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/InformationalComplete.lean b/lean/OAI/InformationTheory/Entanglement/InformationalComplete.lean new file mode 100644 index 0000000000000000000000000000000000000000..11d7198a12e3d289415493ce6993cf26c3e5c93d --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/InformationalComplete.lean @@ -0,0 +1,125 @@ +import OAI.InformationTheory.Entanglement.EveBlocks + +namespace OAI + +noncomputable section +open scoped BigOperators ComplexOrder MatrixOrder Kronecker +open Matrix +namespace SecretKey +open ChannelCompletion TensorCriterion +variable {n m : Type} [Fintype n] [Fintype m] [DecidableEq n] [DecidableEq m] + +omit [Fintype n] [DecidableEq n] in +lemma projector_polarization (x y : n → ℂ) : + projector (x+y)-projector x-projector y+ + Complex.I • (projector (x+Complex.I • y)-projector x-projector y)= + (2 : ℂ) • Matrix.vecMulVec x (star y) := by + ext i j + simp only [projector,Matrix.vecMulVec_apply,Matrix.add_apply,Matrix.sub_apply, + Matrix.smul_apply,Pi.add_apply,Pi.smul_apply,Pi.star_apply,smul_eq_mul, + star_add,star_mul,Complex.star_def,Complex.conj_I] + ring_nf + simp only [Complex.I_sq,Complex.I_pow_three] + ring + +def testBasis (i : n) : n → ℂ := Pi.single i 1 +omit [Fintype n] in +lemma star_testBasis (i : n) : star (testBasis i)=testBasis i := by + ext j + simp [testBasis,Pi.single_apply] +omit [Fintype n] in +lemma single_projector_polarization (i j : n) : + (2 : ℂ) • Matrix.single i j 1= + projector (testBasis i+testBasis j)-projector (testBasis i)-projector (testBasis j)+ + Complex.I • (projector (testBasis i+Complex.I • testBasis j)- + projector (testBasis i)-projector (testBasis j)) := by + rw [projector_polarization,star_testBasis] + congr 1 + exact Matrix.single_eq_single_vecMulVec_single i j + +theorem linear_eq_zero_of_projector_tests (L : Mat n →ₗ[ℂ] ℂ) + (hbase : ∀ i, L (projector (testBasis i))=0) + (hplus : ∀ i j, L (projector (testBasis i+testBasis j))=0) + (himag : ∀ i j, L (projector (testBasis i+Complex.I • testBasis j))=0) : + L=0 := by + have hs (i j : n) : L (Matrix.single i j 1)=0 := by + have h := congrArg L (single_projector_polarization i j) + simp only [map_smul,map_add,map_sub,hbase,hplus,himag,sub_zero,zero_add,smul_zero] at h + simpa using h + ext A + induction A using Matrix.induction_on' with + | h_zero => exact map_zero L + | h_add A B hA hB => simp [hA,hB] + | h_std_basis i j c => + have he : Matrix.single i j c=c • Matrix.single i j (1 : ℂ) := by simp + rw [he,map_smul,hs,smul_zero] + rfl + +abbrev PositiveTestIndex (n : Type) := n ⊕ ((n×n) ⊕ (n×n)) +def positiveTestVector : PositiveTestIndex n → n → ℂ + | .inl i => testBasis i + | .inr (.inl (i,j)) => testBasis i+testBasis j + | .inr (.inr (i,j)) => testBasis i+Complex.I • testBasis j +def positiveTest (k : PositiveTestIndex n) : Mat n := projector (positiveTestVector k) +lemma positiveTest_psd (k : PositiveTestIndex n) : (positiveTest k).PosSemidef := + Matrix.posSemidef_vecMulVec_self_star _ +lemma linear_eq_zero_of_positive_tests (L : Mat n →ₗ[ℂ] ℂ) + (h : ∀ k, L (positiveTest k)=0) : L=0 := by + apply linear_eq_zero_of_projector_tests L + · exact fun i => h (.inl i) + · exact fun i j => h (.inr (.inl (i,j))) + · exact fun i j => h (.inr (.inr (i,j))) + +def tensorTraceDifference (W : Mat (n×m)) (X : Mat n) (Y : Mat m) : + Mat n →ₗ[ℂ] Mat m →ₗ[ℂ] ℂ where + toFun E := + { toFun := fun G => Matrix.trace ((E ⊗ₖ G)*W)-Matrix.trace (E*X)*Matrix.trace (G*Y) + map_add' := by + intro G H + simp only [Matrix.kronecker_add,Matrix.add_mul,Matrix.trace_add] + ring + map_smul' := by + intro c G + simp only [Matrix.kronecker_smul,Matrix.smul_mul,Matrix.trace_smul,smul_eq_mul,RingHom.id_apply] + ring } + map_add' := by + intro E G + ext H + change Matrix.trace (((E+G) ⊗ₖ H)*W)-Matrix.trace ((E+G)*X)*Matrix.trace (H*Y)= + (Matrix.trace ((E ⊗ₖ H)*W)-Matrix.trace (E*X)*Matrix.trace (H*Y))+ + (Matrix.trace ((G ⊗ₖ H)*W)-Matrix.trace (G*X)*Matrix.trace (H*Y)) + simp only [Matrix.add_kronecker,Matrix.add_mul,Matrix.trace_add] + ring + map_smul' := by + intro c E + ext G + change Matrix.trace (((c • E) ⊗ₖ G)*W)-Matrix.trace ((c • E)*X)*Matrix.trace (G*Y)= + c • (Matrix.trace ((E ⊗ₖ G)*W)-Matrix.trace (E*X)*Matrix.trace (G*Y)) + simp only [Matrix.smul_kronecker,Matrix.smul_mul,Matrix.trace_smul,smul_eq_mul] + ring + +theorem tensor_product_of_positive_tests (W : Mat (n×m)) (X : Mat n) (Y : Mat m) + (htest : ∀ e : PositiveTestIndex n, ∀ g : PositiveTestIndex m, + Matrix.trace ((positiveTest e ⊗ₖ positiveTest g)*W)= + Matrix.trace (positiveTest e*X)*Matrix.trace (positiveTest g*Y)) : + W=X ⊗ₖ Y := by + let L := tensorTraceDifference W X Y + have hL (g : PositiveTestIndex m) : ∀ E, L E (positiveTest g)=0 := by + have hz := linear_eq_zero_of_positive_tests (L.flip (positiveTest g)) + (fun e => sub_eq_zero.mpr (htest e g)) + intro E + exact LinearMap.congr_fun hz E + have hz (E : Mat n) : L E=0 := + linear_eq_zero_of_positive_tests (L E) (fun g => hL g E) + ext ⟨i,a⟩ ⟨j,b⟩ + have h := LinearMap.congr_fun (hz (Matrix.single j i 1)) (Matrix.single b a 1) + change Matrix.trace (((Matrix.single j i (1 : ℂ)) ⊗ₖ Matrix.single b a 1)*W)- + Matrix.trace (Matrix.single j i 1*X)*Matrix.trace (Matrix.single b a 1*Y)=0 at h + simpa only [Matrix.single_kronecker_single,one_mul,Matrix.trace_single_mul,one_smul, + sub_eq_zero,Matrix.kronecker_apply] using h + +end SecretKey + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/InstrumentContraction.lean b/lean/OAI/InformationTheory/Entanglement/InstrumentContraction.lean new file mode 100644 index 0000000000000000000000000000000000000000..d634307a045dec853953384a1acc41b469982435 --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/InstrumentContraction.lean @@ -0,0 +1,62 @@ +import OAI.InformationTheory.Entanglement.HilbertChannel +import OAI.InformationTheory.Entanglement.HilbertLawMetric + +namespace OAI + +noncomputable section +open scoped BigOperators ENNReal MeasureTheory InnerProductSpace ComplexOrder +open MeasureTheory ContinuousLinearMap +namespace SecretKey +variable {T : Type*} [MeasurableSpace T] +variable {H K : Type*} + [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + [NormedAddCommGroup K] [InnerProductSpace ℂ K] [CompleteSpace K] +variable {ι κ : Type*} +namespace TraceInstrument +variable {b : HilbertBasis ι ℂ H} {c : HilbertBasis κ ℂ K} +variable (I : TraceInstrument b c T) +omit [CompleteSpace H] in +lemma law_total_trace (A : TraceClass b) (hA : 0≤(A : H→L[ℂ]H)) : + (I.law A hA).traceMeasure Set.univ=ENNReal.ofReal (hilbertTrace b (A : H→L[ℂ]H)) := by + rw [← traceClassTrace_re,← I.trace_preserving A,traceClassTrace_re, + ← I.law_value A hA _ MeasurableSet.univ,← (I.law A hA).trace_value _ MeasurableSet.univ] + exact (ENNReal.ofReal_toReal (measure_ne_top _ _)).symm + +theorem variation_contract (A : TraceClass b) + (hA : HermitianTraceClass b (A : H→L[ℂ]H)) : + hilbertVariation c (fun s => (I.event s A : K→L[ℂ]K))≤hilbertENorm b (A : H→L[ℂ]H) := by + obtain ⟨hp,hn⟩ := hermitian_parts_finite b hA + let P : TraceClass b := ⟨posPart (A : H→L[ℂ]H),Submodule.subset_span hp⟩ + let N : TraceClass b := ⟨negPart (A : H→L[ℂ]H),Submodule.subset_span hn⟩ + have he : P-N=A := Subtype.ext (CFC.posPart_sub_negPart _ hA.1) + have hval (s : Set T) (hs : MeasurableSet s) : + (I.event s A : K→L[ℂ]K)=(I.law P hp.1).value s-(I.law N hn.1).value s := by + rw [I.law_value _ _ _ hs,I.law_value _ _ _ hs,← Submodule.coe_sub,← map_sub,he] + rw [hilbertVariation_congr c hval,hilbertENorm_eq b hA.2] + apply (hilbertVariation_difference_le c (I.law P hp.1) (I.law N hn.1)).trans + have hpos : 0≤hilbertTrace b (P : H→L[ℂ]H) := + tsum_nonneg (fun i => (nonneg_iff_isPositive.mp hp.1).re_inner_nonneg_right _) + rw [I.law_total_trace P hp.1,I.law_total_trace N hn.1, + ← ENNReal.ofReal_add hpos,hilbertTraceNorm_jordan b hA] + exact tsum_nonneg (fun i => (nonneg_iff_isPositive.mp hn.1).re_inner_nonneg_right _) + +theorem output_distance_contract (A B : TraceClass b) + (hA : 0≤(A : H→L[ℂ]H)) (hB : 0≤(B : H→L[ℂ]H)) : + hilbertVariation c (fun s => (I.law A hA).value s-(I.law B hB).value s)≤ + hilbertENorm b ((A : H→L[ℂ]H)-(B : H→L[ℂ]H)) := by + have ht := (positive_difference_traceClass b + ((traceClass_positive_iff b _).mp ⟨A.property,hA⟩) + ((traceClass_positive_iff b _).mp ⟨B.property,hB⟩)).1 + have h := I.variation_contract (A-B) ht + apply le_trans ?_ h + apply le_of_eq + apply hilbertVariation_congr + intro s hs + rw [I.law_value _ _ _ hs,I.law_value _ _ _ hs,map_sub,Submodule.coe_sub] +end TraceInstrument + +end SecretKey + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/InstrumentCovariance.lean b/lean/OAI/InformationTheory/Entanglement/InstrumentCovariance.lean new file mode 100644 index 0000000000000000000000000000000000000000..87e6755100a206fee090e194b4a976f8907e8665 --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/InstrumentCovariance.lean @@ -0,0 +1,58 @@ +import OAI.InformationTheory.Entanglement.InstrumentLaw + +namespace OAI + +noncomputable section +open MeasureTheory Matrix +open scoped BigOperators ComplexOrder MatrixOrder MeasureTheory Kronecker +namespace SecretKey +open ChannelCompletion TensorCriterion +variable {Ω : Type*} [MeasurableSpace Ω] +variable {n r q : Type} [Fintype n] [Fintype r] [Fintype q] + [DecidableEq n] [DecidableEq r] [DecidableEq q] +omit [DecidableEq r] in +lemma PositiveMatrixMeasure.eq_of_value {U V : PositiveMatrixMeasure Ω r} + (h : ∀ s, MeasurableSet s → U.value s=V.value s) : U=V := by + have he : U.entry=V.entry := by + funext a b + apply VectorMeasure.ext + intro s hs + exact congrArg (fun M : Mat r => M a b) (h s hs) + cases U + cases V + cases he + rfl +namespace CPOutcomeLaw +variable (L : CPOutcomeLaw Ω n) +omit [Fintype q] [DecidableEq r] [DecidableEq q] in +lemma ref_sandwich_entry (R : Mat (n×r)) (K : Matrix q r ℂ) (i j : n) (a b : q) : + (((1 : Mat n) ⊗ₖ K)*R*((1 : Mat n) ⊗ₖ K)ᴴ) (i,a) (j,b)= + ∑ c, ∑ d, K a c*R (i,c) (j,d)*star (K b d) := by + simp only [Matrix.mul_apply,Matrix.conjTranspose_apply,Fintype.sum_prod_type, + Matrix.kroneckerMap_apply,Matrix.one_apply,Finset.sum_mul] + simp only [ite_mul,one_mul,zero_mul] + simp [apply_ite,Finset.sum_ite_irrel] + rw [Finset.sum_comm] + +omit [DecidableEq r] [DecidableEq q] in +theorem reference_filter (R : Mat (n×r)) (hR : R.PosSemidef) (K : Matrix q r ℂ) : + L.reference (((1 : Mat n) ⊗ₖ K)*R*((1 : Mat n) ⊗ₖ K)ᴴ) + (hR.mul_mul_conjTranspose_same ((1 : Mat n) ⊗ₖ K))= + (L.reference R hR).filter K := by + apply PositiveMatrixMeasure.eq_of_value + intro s hs + ext a b + rw [reference_value,reference_filter_value] + simp only [ref_sandwich_entry] + +omit [DecidableEq r] in +theorem reference_pure (B : Matrix r n ℂ) : + L.reference (projector (fun a : n×r => B a.2 a.1)) (Matrix.posSemidef_vecMulVec_self_star _)=L.probe.filter B := by + rfl + +end CPOutcomeLaw +end SecretKey + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/InstrumentLaw.lean b/lean/OAI/InformationTheory/Entanglement/InstrumentLaw.lean new file mode 100644 index 0000000000000000000000000000000000000000..b3e1c9e029a211d48ea5bc490db025574aaae752 --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/InstrumentLaw.lean @@ -0,0 +1,92 @@ +import OAI.InformationTheory.Entanglement.ReferenceFilter +import OAI.InformationTheory.Entanglement.ChoiTransfer + +namespace OAI + +noncomputable section +open MeasureTheory Matrix +open scoped BigOperators ComplexOrder MatrixOrder MeasureTheory +namespace SecretKey +open ChannelCompletion TensorCriterion +variable {Ω : Type*} [MeasurableSpace Ω] +variable {n r q : Type} [Fintype n] [Fintype r] [Fintype q] + [DecidableEq n] [DecidableEq r] [DecidableEq q] + +structure CPOutcomeLaw (Ω : Type*) [MeasurableSpace Ω] (n : Type) [Fintype n] where + law : Mat n →ₗ[ℂ] ComplexMeasure Ω + cp : ∀ s, MeasurableSet s → CP + ({ toFun := fun A => fun _ _ : Unit => law A s + map_add' := by intro A B; ext i j; simp only [map_add]; rfl + map_smul' := by intro c A; ext i j; simp only [map_smul]; rfl } : Map n Unit) +namespace CPOutcomeLaw +variable (L : CPOutcomeLaw Ω n) +def event (s : Set Ω) : Map n Unit where + toFun A := fun _ _ => L.law A s + map_add' A B := by ext i j; simp only [map_add]; rfl + map_smul' c A := by ext i j; simp only [map_smul]; rfl +lemma law_expand (s : Set Ω) (A : Mat n) : + L.law A s=∑ i, ∑ j, A i j*L.law (Matrix.single i j 1) s := by + have hm : L.law A=∑ i, ∑ j, A i j • L.law (Matrix.single i j 1) := by + conv_lhs => rw [Matrix.matrix_eq_sum_single A] + simp only [map_sum,← map_smul] + simp + have he := congrArg (fun c : ComplexMeasure Ω => c s) hm + simpa only [_root_.sum_apply,_root_.smul_apply,smul_eq_mul] using he +omit [DecidableEq n] in +lemma event_cp {s : Set Ω} (hs : MeasurableSet s) : CP (L.event s) := L.cp s hs + +def probe : PositiveMatrixMeasure Ω n where + entry i j := L.law (Matrix.single i j 1) + positive s hs := by + have h := cp_choi (L.event_cp hs) + apply h.submatrix (fun i : n => (i,())) +lemma probe_value (s : Set Ω) (i j : n) : + L.probe.value s i j=L.law (Matrix.single i j 1) s := rfl + +def reference (R : Mat (n×r)) (hR : R.PosSemidef) : PositiveMatrixMeasure Ω r where + entry a b := ∑ i, ∑ j, R (i,a) (j,b) • L.law (Matrix.single i j 1) + positive s hs := by + have h := L.event_cp hs r (R.submatrix Prod.swap Prod.swap) (hR.submatrix Prod.swap) + have h' := h.submatrix (fun a : r => (a,())) + have he : (fun a b => (∑ i, ∑ j, R (i,a) (j,b) • L.law (Matrix.single i j 1)) s)= + (amplify (L.event s) (R.submatrix Prod.swap Prod.swap)).submatrix + (fun a : r => (a,())) (fun a : r => (a,())) := by + ext a b + simp only [_root_.sum_apply,_root_.smul_apply,smul_eq_mul] + change (∑ i, ∑ j, R (i,a) (j,b)*L.law (Matrix.single i j 1) s)= + L.law (Matrix.of fun i j => R (i,a) (j,b)) s + simpa only [Matrix.of_apply] using + (L.law_expand s (Matrix.of fun i j => R (i,a) (j,b))).symm + rw [he] + exact h' +omit [DecidableEq r] in +lemma reference_value (R : Mat (n×r)) (hR : R.PosSemidef) (s : Set Ω) (a b : r) : + (L.reference R hR).value s a b=∑ i, ∑ j, R (i,a) (j,b)*L.probe.value s i j := by + simp only [reference,probe,PositiveMatrixMeasure.value,_root_.sum_apply,_root_.smul_apply,smul_eq_mul] + +omit [DecidableEq r] [DecidableEq q] in +lemma reference_filter_value (R : Mat (n×r)) (hR : R.PosSemidef) + (K : Matrix q r ℂ) (s : Set Ω) (a b : q) : + ((L.reference R hR).filter K).value s a b= + ∑ i, ∑ j, (∑ c, ∑ d, K a c*R (i,c) (j,d)*star (K b d))*L.probe.value s i j := by + rw [PositiveMatrixMeasure.filter_value] + simp only [Matrix.mul_apply,Matrix.conjTranspose_apply,reference_value, + Finset.sum_mul,Finset.mul_sum] + conv_lhs => rw [Finset.sum_comm]; arg 2; ext c; rw [Finset.sum_comm]; arg 2; ext i; rw [Finset.sum_comm] + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro i hi + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro j hj + apply Finset.sum_congr rfl + intro c hc + apply Finset.sum_congr rfl + intro d hd + ring +end CPOutcomeLaw +end SecretKey + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/InstrumentMeasure.lean b/lean/OAI/InformationTheory/Entanglement/InstrumentMeasure.lean new file mode 100644 index 0000000000000000000000000000000000000000..4f4ee2e447cad2a9206bb1f3e6bb9978021085ba --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/InstrumentMeasure.lean @@ -0,0 +1,65 @@ +import OAI.InformationTheory.Entanglement.InstrumentCovariance +import OAI.InformationTheory.Entanglement.ProbeFactorization + +namespace OAI + +noncomputable section +open MeasureTheory Matrix +open scoped BigOperators ComplexOrder MatrixOrder MeasureTheory +namespace SecretKey +open ChannelCompletion TensorCriterion +variable {Ω : Type*} [MeasurableSpace Ω] +variable {n : Type} [Fintype n] [DecidableEq n] +namespace PositiveMatrixMeasure + +def testMeasure (W : PositiveMatrixMeasure Ω n) (E : Mat n) : Measure Ω := + (W.filter (CFC.sqrt E)).traceMeasure +instance (W : PositiveMatrixMeasure Ω n) (E : Mat n) : IsFiniteMeasure (W.testMeasure E) := by + unfold testMeasure + infer_instance +lemma testMeasure_real (W : PositiveMatrixMeasure Ω n) {E : Mat n} (hE : E.PosSemidef) + {s : Set Ω} (hs : MeasurableSet s) : + (W.testMeasure E).real s=(Matrix.trace (E*W.value s)).re := by + rw [testMeasure,traceMeasure_real _ hs,filter_value,trace_filter hE] +lemma testMeasure_density (W : PositiveMatrixMeasure Ω n) {E : Mat n} (hE : E.PosSemidef) + {μ : Measure Ω} [IsFiniteMeasure μ] (hW : W.traceMeasure≪μ) + {s : Set Ω} (hs : MeasurableSet s) : + (∫ t in s, (Matrix.trace (E*W.positiveDensity μ t)).re ∂μ)=(W.testMeasure E).real s := by + rw [testMeasure_real W hE hs] + change (∫ t in s, RCLike.re (Matrix.trace (E*W.positiveDensity μ t)) ∂μ)=_ + have hi : Integrable (fun t => Matrix.trace (E*W.positiveDensity μ t)) (μ.restrict s) := by + simp only [Matrix.trace,Matrix.diag,Matrix.mul_apply] + exact integrable_finsetSum _ fun i _ => integrable_finsetSum _ fun j _ => + ((W.positiveDensity_integrable hW j i).integrableOn).const_mul _ + rw [integral_re hi] + change Complex.re (∫ t in s, Matrix.trace (E*W.positiveDensity μ t) ∂μ)=_ + apply congrArg Complex.re + change (∫ t in s, ∑ i : n, ∑ j : n, E i j*W.positiveDensity μ t j i ∂μ)= + ∑ i : n, ∑ j : n, E i j*W.value s j i + rw [integral_finsetSum (Finset.univ : Finset n) (fun i _ => integrable_finsetSum (Finset.univ : Finset n) (fun j _ => + ((W.positiveDensity_integrable hW j i).integrableOn).const_mul (E i j)))] + apply Finset.sum_congr rfl + intro i hi + rw [integral_finsetSum (Finset.univ : Finset n) (fun j _ => ((W.positiveDensity_integrable hW j i).integrableOn).const_mul (E i j))] + apply Finset.sum_congr rfl + intro j hj + rw [integral_const_mul,W.positiveDensity_setIntegral hW hs] +end PositiveMatrixMeasure +namespace CPOutcomeLaw +variable (L : CPOutcomeLaw Ω n) + +lemma probe_test_value (E : Mat n) (s : Set Ω) : + Matrix.trace (E*L.probe.value s)=L.law Eᵀ s := by + rw [L.law_expand] + simp only [Matrix.trace,Matrix.diag,Matrix.mul_apply,Matrix.transpose_apply,probe_value] + rw [Finset.sum_comm] +lemma probe_testMeasure_real {E : Mat n} (hE : E.PosSemidef) {s : Set Ω} (hs : MeasurableSet s) : + (L.probe.testMeasure E).real s=(L.law Eᵀ s).re := by + rw [PositiveMatrixMeasure.testMeasure_real _ hE hs,L.probe_test_value] + +end CPOutcomeLaw +end SecretKey + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/KernelSampling.lean b/lean/OAI/InformationTheory/Entanglement/KernelSampling.lean new file mode 100644 index 0000000000000000000000000000000000000000..6895acfffec93a5a475a26cdc3e5fb01367b6c6a --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/KernelSampling.lean @@ -0,0 +1,68 @@ +import OAI.InformationTheory.Entanglement.ConditionalUpdate + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory Filter Function +open scoped MeasureTheory ProbabilityTheory unitInterval +namespace SecretKey +variable {Ω S N Y : Type*} [MeasurableSpace Ω] [MeasurableSpace S] + [MeasurableSpace N] [StandardBorelSpace N] [Nonempty N] + [MeasurableSpace Y] [StandardBorelSpace Y] [Nonempty Y] +variable {μ : Measure Ω} [IsProbabilityMeasure μ] + +lemma independent_noise_condDistrib (H : Ω → S) (U : Ω → N) + (hH : Measurable H) (hU : Measurable U) (hind : IndepFun H U μ) : + condDistrib U H μ =ᵐ[μ.map H] Kernel.const S (μ.map U) := by + apply condDistrib_ae_eq_of_measure_eq_compProd_of_measurable hH hU + rw [Measure.compProd_const] + exact hind.map_prod_eq_prod_map_map hH.aemeasurable hU.aemeasurable + +omit [StandardBorelSpace Y] [Nonempty Y] in +theorem sampled_conditional_event (H : Ω → S) (U : Ω → N) + (hH : Measurable H) (hU : Measurable U) (hind : IndepFun H U μ) + (f : S → N → Y) (hf : Measurable (uncurry f)) + (κ : Kernel S Y) [IsMarkovKernel κ] + (hmap : ∀ s, (μ.map U).map (f s) = κ s) + (E : Set Y) (hE : MeasurableSet E) : + (μ⟦(fun ω => f (H ω) (U ω)) ⁻¹' E | (inferInstance : MeasurableSpace S).comap H⟧) + =ᵐ[μ] fun ω => (κ (H ω)).real E := by + let g : S × N → ℝ := fun v => E.indicator (fun _ => (1 : ℝ)) (f v.1 v.2) + have hg : StronglyMeasurable g := + (measurable_const.indicator hE |>.comp hf).stronglyMeasurable + have hgi : Integrable (fun ω => g (H ω,U ω)) μ := by + change Integrable (((fun ω => f (H ω) (U ω)) ⁻¹' E).indicator (fun _ => (1 : ℝ))) μ + exact (integrable_const (1 : ℝ)).indicator (hE.preimage (hf.comp (hH.prodMk hU))) + have hc := condExp_prod_ae_eq_integral_condDistrib hH hU.aemeasurable hg hgi + have hd := independent_noise_condDistrib H U hH hU hind + have hd' := ae_of_ae_map hH.aemeasurable hd + have hfun : ((fun ω => f (H ω) (U ω)) ⁻¹' E).indicator (fun _ => (1 : ℝ)) = + (fun ω => g (H ω,U ω)) := by + ext ω + by_cases hx : f (H ω) (U ω) ∈ E <;> simp [g, hx] + change condExp _ μ _ =ᵐ[μ] _ + rw [hfun] + filter_upwards [hc,hd'] with ω he hdω + rw [he,hdω] + change (∫ u, E.indicator (fun _ => (1 : ℝ)) (f (H ω) u) ∂μ.map U) = _ + rw [← integral_map (by fun_prop) (by fun_prop), hmap] + simp [measureReal_def, integral_indicator hE] + +theorem exists_uniform_conditional_sampler (κ : Kernel S Y) [IsMarkovKernel κ] : + ∃ f : S → I → Y, Measurable (uncurry f) ∧ + (∀ s, volume.map (f s)=κ s) ∧ + ∀ (H : Ω → S) (U : Ω → I), Measurable H → Measurable U → IndepFun H U μ → + μ.map U=volume → ∀ E, MeasurableSet E → + (μ⟦(fun ω => f (H ω) (U ω)) ⁻¹' E | (inferInstance : MeasurableSpace S).comap H⟧) + =ᵐ[μ] fun ω => (κ (H ω)).real E := by + obtain ⟨f,hf,hmap⟩ := κ.exists_measurable_map_eq_unitInterval + refine ⟨f,hf,hmap,?_⟩ + intro H U hH hU hind hdist E hE + apply sampled_conditional_event H U hH hU hind f hf κ _ E hE + simpa only [hdist] using hmap + +end SecretKey + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/KeyRates.lean b/lean/OAI/InformationTheory/Entanglement/KeyRates.lean new file mode 100644 index 0000000000000000000000000000000000000000..71c00596cb4a244296438d9d5a67d06c4a3b6858 --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/KeyRates.lean @@ -0,0 +1,35 @@ +import Mathlib + +namespace OAI + +noncomputable section +open Filter +open scoped Topology +namespace SecretKey + +theorem eventually_empty_of_uniform_bit_gap (length : ℕ → ℕ) (error : ℕ → ℝ) + (hgap : ∀ k, 1≤length k → (1:ℝ)/5≤error k) + (hsecure : Tendsto error atTop (𝓝 0)) : ∀ᶠ k in atTop, length k=0 := by + have he : ∀ᶠ k in atTop, error k<(1:ℝ)/5 := + hsecure.eventually (eventually_lt_nhds (by norm_num)) + filter_upwards [he] with k hk + by_contra hn + have hh := hgap k (Nat.one_le_iff_ne_zero.mpr hn) + linarith + +theorem secure_key_rate_zero (length : ℕ → ℕ) (error : ℕ → ℝ) + (hgap : ∀ k, 1≤length k → (1:ℝ)/5≤error k) + (hsecure : Tendsto error atTop (𝓝 0)) : + Filter.liminf (fun k => (length k : ℝ)/(k : ℝ)) atTop=0 := by + have h0 := eventually_empty_of_uniform_bit_gap length error hgap hsecure + have he : (fun k => (length k : ℝ)/(k : ℝ))=ᶠ[atTop](fun _ => (0:ℝ)) := by + filter_upwards [h0] with k hk + simp [hk] + rw [Filter.liminf_congr he] + simp + +end SecretKey + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/LinearPolynomialCertificate.lean b/lean/OAI/InformationTheory/Entanglement/LinearPolynomialCertificate.lean new file mode 100644 index 0000000000000000000000000000000000000000..a91f23d88b54448a9d624edcf1cc5371a8397c03 --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/LinearPolynomialCertificate.lean @@ -0,0 +1,35 @@ +import Mathlib +import OAI.Analysis.Quantum.PPTSquare.ModularSupport + +namespace OAI + +noncomputable section +open Polynomial + +namespace LinearPolynomialCertificate +open PolynomialCertificate +local instance : Fact (Nat.Prime 41) := ⟨by decide⟩ +def ff : (ZMod 41)[X] := X+1 +def powerCert (e : ℕ) (a : List (ZMod 41)) : Prop := ff ∣ X ^ e - poly a +def degreeCert (e n : ℕ) : Prop := by + classical + exact (EuclideanDomain.gcd ff (X ^ e-X)).natDegree = n +lemma degreeStep (e n : ℕ) (r g : List (ZMod 41)) + (hfnz : ff ≠ 0) + (hpow : powerCert e r) (hg : poly g ≠ 0) (hgf : poly g ∣ ff) (hgr : poly g ∣ poly r-X) + (hb : ∃ a b, a*ff+b*(poly r-X)=poly g) (hdeg : (poly g).natDegree = n) : degreeCert e n := by + unfold degreeCert + exact (gcd_degree_of_mod hfnz hg hpow hgf hgr hb).trans hdeg +end LinearPolynomialCertificate + +namespace LinearPolynomialCertificateBridge +attribute [local instance] Classical.propDecidable +open LinearPolynomialCertificate +lemma bridge (e n : ℕ) (h : degreeCert e n) : (EuclideanDomain.gcd ff (X^e-X)).natDegree = n := by + unfold degreeCert at h + convert h using 2 +end LinearPolynomialCertificateBridge + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/LocalMemoryKernels.lean b/lean/OAI/InformationTheory/Entanglement/LocalMemoryKernels.lean new file mode 100644 index 0000000000000000000000000000000000000000..cf8371f6267ff709fc74d9be85d1abcfa96436da --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/LocalMemoryKernels.lean @@ -0,0 +1,73 @@ +import OAI.InformationTheory.Entanglement.CausalRealization + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory Function Filter +open scoped MeasureTheory ProbabilityTheory unitInterval +namespace SecretKey +attribute [local instance] Classical.propDecidable +variable {X S : Type*} +variable (role : ℕ → TapeRole) (pub : Set ℕ) (x₀ : X) (r : TapeRole) +lemma visiblePrefix_init (k : ℕ) (h : Fin (k+1)→X) : + Fin.init (visiblePrefix role pub x₀ r (k+1) h)= + visiblePrefix role pub x₀ r k (Fin.init h) := by + funext i + simp only [Fin.init,visiblePrefix,Fin.val_castSucc] +lemma visiblePrefix_idem (k : ℕ) (h : Fin k→X) : + visiblePrefix role pub x₀ r k (visiblePrefix role pub x₀ r k h)=visiblePrefix role pub x₀ r k h := by + funext i + dsimp only [visiblePrefix] + split_ifs <;> rfl + +def localStateAt (s₀ : S) (update : (k : ℕ) → (Fin k→X) → S → X → S) : + (k : ℕ) → (Fin k→X) → S + | 0, _ => s₀ + | k+1, h => if role k=r then + update k (visiblePrefix role pub x₀ r k (Fin.init h)) + (localStateAt s₀ update k (Fin.init h)) (h (Fin.last k)) + else localStateAt s₀ update k (Fin.init h) +lemma localStateAt_visible (s₀ : S) (update : (k : ℕ) → (Fin k→X) → S → X → S) + (k : ℕ) (h : Fin k→X) : + localStateAt role pub x₀ r s₀ update k (visiblePrefix role pub x₀ r k h)= + localStateAt role pub x₀ r s₀ update k h := by + induction k with + | zero => rfl + | succ k ih => + simp only [localStateAt,visiblePrefix_init,visiblePrefix_idem,ih] + by_cases hr : role k=r + · simp [hr,visiblePrefix] + · simp only [hr,ite_false] +variable [MeasurableSpace X] [MeasurableSpace S] +lemma localStateAt_measurable (s₀ : S) (update : (k : ℕ) → (Fin k→X) → S → X → S) + (hupdate : ∀ k, Measurable (fun p : ((Fin k→X)×S)×X => update k p.1.1 p.1.2 p.2)) (k : ℕ) : + Measurable (localStateAt role pub x₀ r s₀ update k) := by + induction k with + | zero => exact measurable_const + | succ k ih => + have hini : Measurable (Fin.init : (Fin (k+1)→X) → (Fin k→X)) := by + apply Measurable.of_eval; intro i; exact measurable_pi_apply i.castSucc + by_cases hr : role k=r + · simp only [localStateAt,hr,ite_true] + exact (hupdate k).comp + ((((visiblePrefix_measurable role pub x₀ r k).comp hini).prodMk (ih.comp hini)).prodMk + (measurable_pi_apply (Fin.last k))) + · simpa only [localStateAt,hr,ite_false,Function.comp_def] using ih.comp hini + +def memoryOutcomeKernel (s₀ : S) (update : (k : ℕ) → (Fin k→X) → S → X → S) + (hupdate : ∀ k, Measurable (fun p : ((Fin k→X)×S)×X => update k p.1.1 p.1.2 p.2)) + (K : (k : ℕ) → Kernel ((Fin k→X)×S) X) (k : ℕ) : Kernel (Fin k→X) X := + (K k).comap (fun h => (visiblePrefix role pub x₀ r k h,localStateAt role pub x₀ r s₀ update k h)) + ((visiblePrefix_measurable role pub x₀ r k).prodMk (localStateAt_measurable role pub x₀ r s₀ update hupdate k)) +lemma memoryOutcomeKernel_visible (s₀ : S) (update : (k : ℕ) → (Fin k→X) → S → X → S) + (hupdate : ∀ k, Measurable (fun p : ((Fin k→X)×S)×X => update k p.1.1 p.1.2 p.2)) + (K : (k : ℕ) → Kernel ((Fin k→X)×S) X) (k : ℕ) (h : Fin k→X) : + memoryOutcomeKernel role pub x₀ r s₀ update hupdate K k (visiblePrefix role pub x₀ r k h)= + memoryOutcomeKernel role pub x₀ r s₀ update hupdate K k h := by + simp only [memoryOutcomeKernel,Kernel.comap_apply,visiblePrefix_idem,localStateAt_visible] + +end SecretKey + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/LocalStateVisibility.lean b/lean/OAI/InformationTheory/Entanglement/LocalStateVisibility.lean new file mode 100644 index 0000000000000000000000000000000000000000..fd5b77c316237e9a1bb363308c4639cc14792714 --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/LocalStateVisibility.lean @@ -0,0 +1,38 @@ +import OAI.InformationTheory.Entanglement.CausalRealization +import OAI.InformationTheory.Entanglement.TraceInstrument + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory Function +namespace SecretKey +variable {X S : Type*} +variable (role : ℕ → TapeRole) (pub : Set ℕ) (x₀ : X) (r : TapeRole) +variable [MeasurableSpace X] [StandardBorelSpace X] [Nonempty X] +variable {H K : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + [NormedAddCommGroup K] [InnerProductSpace ℂ K] [CompleteSpace K] +variable {ι κ : Type*} (b : HilbertBasis ι ℂ H) (d : HilbertBasis κ ℂ K) + +omit [StandardBorelSpace X] [Nonempty X] [CompleteSpace H] in +theorem local_born_kernel_visible + (s₀ : DensityOperator b) + (U : (n : ℕ) → (Fin n → X) → DensityOperator b → X → DensityOperator b) + (n : ℕ) (J : (Fin n → X) → TraceInstrument b d X) + (hm : ∀ A, MeasurableSet A → Measurable (fun h => + (J (visiblePrefix role pub x₀ r n h)).outcome (localStateAt role pub x₀ r s₀ U n h) A)) : + TraceInstrument.historyKernel + (fun h => J (visiblePrefix role pub x₀ r n h)) (localStateAt role pub x₀ r s₀ U n) hm= + (TraceInstrument.historyKernel + (fun h => J (visiblePrefix role pub x₀ r n h)) (localStateAt role pub x₀ r s₀ U n) hm).comap + (visiblePrefix role pub x₀ r n) (visiblePrefix_measurable role pub x₀ r n) := by + + let : MeasurableSpace (DensityOperator b) := ⊤ + ext h A hA + simp only [Kernel.comap_apply,TraceInstrument.historyKernel,Kernel.coe_mk, + visiblePrefix_idem,localStateAt_visible] + +end SecretKey + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/Main.lean b/lean/OAI/InformationTheory/Entanglement/Main.lean new file mode 100644 index 0000000000000000000000000000000000000000..dc66c2776c59819debddec49254465f528263cbb --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/Main.lean @@ -0,0 +1,151 @@ +import OAI.InformationTheory.Entanglement.ActualDefaults +import OAI.InformationTheory.Entanglement.AdaptivePublic +import OAI.InformationTheory.Entanglement.ArbitraryPurificationConsumer +import OAI.InformationTheory.Entanglement.FunctionCardinality +import OAI.InformationTheory.Entanglement.EightSubsetCardinality +import OAI.InformationTheory.Entanglement.BooleanSpan +import OAI.InformationTheory.Entanglement.LinearPolynomialCertificate +import OAI.InformationTheory.Entanglement.CPBlocks +import OAI.InformationTheory.Entanglement.CQVariation +import OAI.InformationTheory.Entanglement.CausalIndependence +import OAI.InformationTheory.Entanglement.CausalPublic +import OAI.InformationTheory.Entanglement.CausalRealization +import OAI.InformationTheory.Entanglement.CausalSampler +import OAI.InformationTheory.Entanglement.ChoiTransfer +import OAI.InformationTheory.Entanglement.Coherence +import OAI.InformationTheory.Entanglement.CombinatorialAssembly +import OAI.InformationTheory.Entanglement.CombinatorialLocal +import OAI.InformationTheory.Entanglement.CombinatorialMain +import OAI.InformationTheory.Entanglement.CombinatorialNumbers +import OAI.InformationTheory.Entanglement.CombinatorialOrder +import OAI.InformationTheory.Entanglement.CombinatorialQuestions +import OAI.InformationTheory.Entanglement.ConditionalUpdate +import OAI.InformationTheory.Entanglement.ConditionedLaw +import OAI.InformationTheory.Entanglement.CorrelationBound +import OAI.InformationTheory.Entanglement.CyclicCharpoly +import OAI.InformationTheory.Entanglement.DefaultNull +import OAI.InformationTheory.Entanglement.DensityChange +import OAI.InformationTheory.Entanglement.DensityGap +import OAI.InformationTheory.Entanglement.DensityPositivity +import OAI.InformationTheory.Entanglement.EffectNormalization +import OAI.InformationTheory.Entanglement.SplittingEmbedding +import OAI.InformationTheory.Entanglement.EveBlocks +import OAI.InformationTheory.Entanglement.FactorizedLawGap +import OAI.InformationTheory.Entanglement.FiberBound +import OAI.InformationTheory.Entanglement.FidelityTools +import OAI.InformationTheory.Entanglement.FiniteInputInstrument +import OAI.InformationTheory.Entanglement.FiniteLawRecovery +import OAI.InformationTheory.Entanglement.FiniteRecovery +import OAI.InformationTheory.Entanglement.FirstBitLaw +import OAI.InformationTheory.Entanglement.FullQuantumConsumer +import OAI.InformationTheory.Entanglement.PolynomialGcdDegree +import OAI.InformationTheory.Entanglement.HermitianBanach +import OAI.InformationTheory.Entanglement.HermitianInstrument +import OAI.InformationTheory.Entanglement.HilbertCanonicalRecovery +import OAI.InformationTheory.Entanglement.HilbertChannel +import OAI.InformationTheory.Entanglement.HilbertChannelMeasure +import OAI.InformationTheory.Entanglement.HilbertCoarsegrain +import OAI.InformationTheory.Entanglement.HilbertConditioning +import OAI.InformationTheory.Entanglement.HilbertENorm +import OAI.InformationTheory.Entanglement.HilbertEmbedding +import OAI.InformationTheory.Entanglement.HilbertEmbeddingOrder +import OAI.InformationTheory.Entanglement.HilbertLawAlgebra +import OAI.InformationTheory.Entanglement.HilbertLawDistance +import OAI.InformationTheory.Entanglement.HilbertLawFinite +import OAI.InformationTheory.Entanglement.HilbertLawMetric +import OAI.InformationTheory.Entanglement.HilbertLawRecovery +import OAI.InformationTheory.Entanglement.HilbertLawScale +import OAI.InformationTheory.Entanglement.HilbertMeasure +import OAI.InformationTheory.Entanglement.HilbertMeasureEmbedding +import OAI.InformationTheory.Entanglement.HilbertRecordMap +import OAI.InformationTheory.Entanglement.HilbertRecovery +import OAI.InformationTheory.Entanglement.HilbertTensor +import OAI.InformationTheory.Entanglement.HilbertTrace +import OAI.InformationTheory.Entanglement.HilbertTraceDifference +import OAI.InformationTheory.Entanglement.HilbertTraceIdeal +import OAI.InformationTheory.Entanglement.HilbertVectorMeasure +import OAI.InformationTheory.Entanglement.IndependentTapes +import OAI.InformationTheory.Entanglement.InformationalComplete +import OAI.InformationTheory.Entanglement.InstrumentContraction +import OAI.InformationTheory.Entanglement.InstrumentCovariance +import OAI.InformationTheory.Entanglement.InstrumentLaw +import OAI.InformationTheory.Entanglement.InstrumentMeasure +import OAI.InformationTheory.Entanglement.KernelSampling +import OAI.InformationTheory.Entanglement.KeyRates +import OAI.InformationTheory.Entanglement.LocalMemoryKernels +import OAI.InformationTheory.Entanglement.LocalStateVisibility +import OAI.InformationTheory.Entanglement.MainStateAlgebra +import OAI.InformationTheory.Entanglement.MatrixDensityChange +import OAI.InformationTheory.Entanglement.MatrixFamilyDensity +import OAI.InformationTheory.Entanglement.MatrixMeasure +import OAI.InformationTheory.Entanglement.MatrixMeasureChannel +import OAI.InformationTheory.Entanglement.MatrixPolar +import OAI.InformationTheory.Entanglement.MatrixTraceMeasure +import OAI.InformationTheory.Entanglement.MatrixMeasurability +import OAI.InformationTheory.Entanglement.MultiTensor +import OAI.InformationTheory.Entanglement.NormalizeRepresentation +import OAI.InformationTheory.Entanglement.NormalizedProbe +import OAI.InformationTheory.Entanglement.NormalizedPurificationConsumer +import OAI.InformationTheory.Entanglement.OperationalNorm +import OAI.InformationTheory.Entanglement.ParityData +import OAI.InformationTheory.Entanglement.ParityObstruction +import OAI.InformationTheory.Entanglement.PhysicalAdaptiveStep +import OAI.InformationTheory.Entanglement.PhysicalChronology +import OAI.InformationTheory.Entanglement.PhysicalConditionalUpdate +import OAI.InformationTheory.Entanglement.PhysicalExecutionStep +import OAI.InformationTheory.Entanglement.PhysicalHistoryRealization +import OAI.InformationTheory.Entanglement.PhysicalProductStep +import OAI.InformationTheory.Entanglement.PhysicalPublicPrefix +import OAI.InformationTheory.Entanglement.PhysicalRawPrefix +import OAI.InformationTheory.Entanglement.PhysicalRightAdaptive +import OAI.InformationTheory.Entanglement.PhysicalRightRawPrefix +import OAI.InformationTheory.Entanglement.PhysicalRightStep +import OAI.InformationTheory.Entanglement.PhysicalVersion +import OAI.InformationTheory.Entanglement.PositiveBlock +import OAI.InformationTheory.Entanglement.PowersStormer +import OAI.InformationTheory.Entanglement.ProbeDensity +import OAI.InformationTheory.Entanglement.ProbeFactorization +import OAI.InformationTheory.Entanglement.ProbeMatrices +import OAI.InformationTheory.Entanglement.ProbePOVM +import OAI.InformationTheory.Entanglement.ProbeRescaling +import OAI.InformationTheory.Entanglement.ProductInstrumentStep +import OAI.InformationTheory.Entanglement.ProjectionData +import OAI.InformationTheory.Entanglement.ProjectionMain +import OAI.InformationTheory.Entanglement.ProjectionReal +import OAI.InformationTheory.Entanglement.ProjectionRealMain +import OAI.InformationTheory.Entanglement.ProjectionReindex +import OAI.InformationTheory.Entanglement.ProjectionSquare +import OAI.InformationTheory.Entanglement.ProjectionStats +import OAI.InformationTheory.Entanglement.PublicSampler +import OAI.InformationTheory.Entanglement.PurificationExpansion +import OAI.InformationTheory.Entanglement.PurificationSupport +import OAI.InformationTheory.Entanglement.QuantumStepKernel +import OAI.InformationTheory.Entanglement.ReferenceFilter +import OAI.InformationTheory.Entanglement.RestrictedIntersections +import OAI.InformationTheory.Entanglement.ScalarGap +import OAI.InformationTheory.Entanglement.BinomialDimension +import OAI.InformationTheory.Entanglement.SecretDefinitions +import OAI.InformationTheory.Entanglement.SequentialSampling +import OAI.InformationTheory.Entanglement.SparseSeparable +import OAI.InformationTheory.Entanglement.SpectralCut +import OAI.InformationTheory.Entanglement.SpectralWeights +import OAI.InformationTheory.Entanglement.TensorClosure +import OAI.InformationTheory.Entanglement.TensorPowers +import OAI.InformationTheory.Entanglement.TensorTools +import OAI.InformationTheory.Entanglement.TestedQuantumConsumer +import OAI.InformationTheory.Entanglement.TraceClassModel +import OAI.InformationTheory.Entanglement.TraceContractivity +import OAI.InformationTheory.Entanglement.TraceInstrument +import OAI.InformationTheory.Entanglement.TraceMatrixSpace +import OAI.InformationTheory.Entanglement.TraceNorm +import OAI.InformationTheory.Entanglement.TraceStateBounds +import OAI.InformationTheory.Entanglement.TraceTensor +import OAI.InformationTheory.Entanglement.TranscriptClassical +import OAI.InformationTheory.Entanglement.TranscriptLimit +import OAI.InformationTheory.Entanglement.WeakIntegralForm +import OAI.InformationTheory.Entanglement.WeakLawTrace +import OAI.InformationTheory.Entanglement.WeakProductPrefix +import OAI.InformationTheory.Entanglement.WeakStateSupport +import OAI.InformationTheory.Entanglement.WeakStateUnique +import OAI.InformationTheory.Entanglement.WeakTensorMeasurable + diff --git a/lean/OAI/InformationTheory/Entanglement/MainStateAlgebra.lean b/lean/OAI/InformationTheory/Entanglement/MainStateAlgebra.lean new file mode 100644 index 0000000000000000000000000000000000000000..c4228a0e767ccb298d5a52d2c110c4f377793a6c --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/MainStateAlgebra.lean @@ -0,0 +1,103 @@ +import OAI.Analysis.Quantum.PPTSquare.ExplicitMaps +import OAI.Analysis.Quantum.PPTSquare.PairResult +import OAI.InformationTheory.Entanglement.ChoiTransfer +import OAI.InformationTheory.Entanglement.SecretDefinitions + +namespace OAI + +noncomputable section +open scoped BigOperators ComplexOrder MatrixOrder Kronecker +open Matrix +namespace SecretKey +open ChannelCompletion TensorCriterion +variable {n m : Type} [Fintype n] [Fintype m] [DecidableEq n] [DecidableEq m] +lemma sharp_ppt {F : Map n m} (hF : PPT F) : PPT (sharp F) := by + exact ppt_output_transpose (ppt_input_transpose (ppt_hsAdjoint hF)) +omit [Fintype n] [DecidableEq n] in +lemma projector_real_smul (r : ℝ) (v : n → ℂ) : + projector ((r : ℂ) • v)=((r^2 : ℝ) : ℂ) • projector v := by + ext i j + simp only [projector,Matrix.vecMulVec_apply,Pi.smul_apply,Pi.star_apply,smul_eq_mul, + star_mul,Complex.star_def,Complex.conj_ofReal,Matrix.smul_apply,Complex.ofReal_pow] + ring +omit [DecidableEq n] in +lemma psd_trace_re_pos {A : Mat n} (hA : A.PosSemidef) (hne : A ≠ 0) : + 0 < (Matrix.trace A).re := by + have ht := Complex.nonneg_iff.mp hA.trace_nonneg + apply lt_of_le_of_ne ht.1 + intro h + apply hne + apply hA.trace_eq_zero_iff.mp + apply Complex.ext + · exact h.symm + · exact ht.2.symm +omit [DecidableEq n] in +lemma psd_trace_ofReal {A : Mat n} (hA : A.PosSemidef) : + ((Matrix.trace A).re : ℂ)=Matrix.trace A := by + apply Complex.ext + · rfl + · exact (Complex.nonneg_iff.mp hA.trace_nonneg).2 +omit [DecidableEq n] in +lemma normalized_psd {A : Mat n} (hA : A.PosSemidef) : + ((((Matrix.trace A).re)⁻¹ : ℝ) : ℂ) • A |>.PosSemidef := + hA.smul (by exact_mod_cast inv_nonneg.mpr (Complex.nonneg_iff.mp hA.trace_nonneg).1) +omit [DecidableEq n] in +lemma normalized_trace {A : Mat n} (hA : A.PosSemidef) (hne : A ≠ 0) : + Matrix.trace (((((Matrix.trace A).re)⁻¹ : ℝ) : ℂ) • A)=1 := by + rw [Matrix.trace_smul,smul_eq_mul,Complex.ofReal_inv,psd_trace_ofReal hA] + exact inv_mul_cancel₀ (fun h => hne (hA.trace_eq_zero_iff.mp h)) +end SecretKey + +namespace ExplicitPencil +open ChannelCompletion TensorCriterion SecretKey + +def stateTrace : ℝ := (Matrix.trace (Z L)).re + +def rho : Mat (Fin 10 × Fin 10) := ((stateTrace⁻¹ : ℝ) : ℂ) • Z L + +def stateVector : Fin 10 × Fin 10 → ℂ := + (((Real.sqrt stateTrace)⁻¹ : ℝ) : ℂ) • omega +lemma Z_psd : (Z L).PosSemidef := cp_choi (cp_comp main_pair.2.1.1 main_pair.1.1) +lemma stateTrace_pos : 0 < stateTrace := psd_trace_re_pos Z_psd main_pair.2.2.1 +lemma rho_psd : rho.PosSemidef := normalized_psd Z_psd +lemma rho_trace : Matrix.trace rho=1 := normalized_trace Z_psd main_pair.2.2.1 +lemma rho_ne_zero : rho ≠ 0 := by + intro h + have hh := rho_trace + rw [h,Matrix.trace_zero] at hh + exact zero_ne_one hh +lemma rho_no_product (u v : Fin 10 → ℂ) + (h : ∃ w, rho.mulVec w=product u v) : product u v=0 := by + obtain ⟨w,hw⟩ := h + apply main_pair.2.2.2.1 u v + refine ⟨((stateTrace⁻¹ : ℝ) : ℂ) • w, ?_⟩ + rw [Matrix.mulVec_smul] + simpa only [rho,Matrix.smul_mulVec] using hw +lemma rho_entangled : ¬ Separable rho := by + intro h + obtain ⟨u,v,hne,w,hw⟩ := separable_nonzero_product h rho_ne_zero + exact hne (rho_no_product u v ⟨w,hw⟩) +lemma stateVector_projector : projector stateVector= + ((stateTrace⁻¹ : ℝ) : ℂ) • projector (omega (n := Fin 10)) := by + rw [stateVector,projector_real_smul,inv_pow,Real.sq_sqrt stateTrace_pos.le] +lemma rho_identification : rho=tensorMap (sharp (Phi1 L)) (Phi2 L) (projector stateVector) := by + rw [stateVector_projector,map_smul,← choi_transfer main_pair.1.1] + rfl +lemma rho_represented : Represented rho := by + refine ⟨rho_psd,rho_trace,10,10,by norm_num,by norm_num, + sharp (Phi1 L),Phi2 L,stateVector,(sharp_ppt main_pair.1).1, + (ppt_input_transpose (sharp_ppt main_pair.1)).1,main_pair.2.1.1, + (ppt_input_transpose main_pair.2.1).1,rho_identification⟩ + +theorem main_state_algebra : rho.PosSemidef ∧ Matrix.trace rho=1 ∧ + rho ≠ 0 ∧ (∀ u v : Fin 10 → ℂ, + (∃ w, rho.mulVec w=product u v) → product u v=0) ∧ + ¬ Separable rho ∧ Represented rho ∧ + rho=tensorMap (sharp (Phi1 L)) (Phi2 L) (projector stateVector) := + ⟨rho_psd,rho_trace,rho_ne_zero,rho_no_product,rho_entangled,rho_represented,rho_identification⟩ + +end ExplicitPencil + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/MatrixDensityChange.lean b/lean/OAI/InformationTheory/Entanglement/MatrixDensityChange.lean new file mode 100644 index 0000000000000000000000000000000000000000..a28569e2532bf0ded63bd9e2395d82e56aa27afc --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/MatrixDensityChange.lean @@ -0,0 +1,79 @@ +import OAI.InformationTheory.Entanglement.DensityChange +import OAI.InformationTheory.Entanglement.MatrixFamilyDensity + +namespace OAI + +noncomputable section +open MeasureTheory Matrix Filter +open scoped MeasureTheory BigOperators ComplexOrder MatrixOrder Kronecker +namespace SecretKey +open ChannelCompletion +variable {Ω : Type*} [MeasurableSpace Ω] {n : Type} [Fintype n] +namespace PositiveMatrixMeasure +lemma density_unique (W : PositiveMatrixMeasure Ω n) {μ : Measure Ω} [IsFiniteMeasure μ] + (hW : W.traceMeasure≪μ) (D : Ω → Mat n) + (hDi : ∀ a b, Integrable (fun t => D t a b) μ) + (hDs : ∀ s, MeasurableSet s → ∀ a b, (∫ t in s, D t a b ∂μ)=W.value s a b) : + D =ᵐ[μ] W.positiveDensity μ := by + have he (a b : n) : (fun t => D t a b)=ᵐ[μ](fun t => W.positiveDensity μ t a b) := by + apply Integrable.ae_eq_of_forall_setIntegral_eq _ _ (hDi a b) (W.positiveDensity_integrable hW a b) + intro s hs _ + rw [hDs s hs,W.positiveDensity_setIntegral hW hs] + filter_upwards [ae_all_iff.mpr fun a => ae_all_iff.mpr fun b => he a b] with t ht + ext a b + exact ht a b +lemma positiveDensity_change (W : PositiveMatrixMeasure Ω n) {μ ν : Measure Ω} + [IsFiniteMeasure μ] [IsFiniteMeasure ν] + (hW : W.traceMeasure≪μ) (hμν : μ≪ν) : + (fun t => (densityWeight μ ν t : ℂ) • W.positiveDensity μ t)=ᵐ[ν] W.positiveDensity ν := by + apply W.density_unique (hW.trans hμν) + · intro a b + simpa only [Matrix.smul_apply,smul_eq_mul,Complex.real_smul] using + densityWeight_integrable μ ν hμν (W.positiveDensity_integrable hW a b) + · intro s hs a b + change (∫ t in s, (densityWeight μ ν t : ℂ)*W.positiveDensity μ t a b ∂ν)=_ + simpa only [Complex.real_smul] using + (densityWeight_setIntegral μ ν hμν (fun t => W.positiveDensity μ t a b) hs).trans + (W.positiveDensity_setIntegral hW hs a b) +end PositiveMatrixMeasure +lemma bitDistance_congr_ae {μ : Measure Ω} + {A B : Fin 2 → Fin 2 → Ω → Mat n} {σ θ : Ω → Mat n} + (hAB : ∀ i j, A i j=ᵐ[μ]B i j) (hστ : σ=ᵐ[μ]θ) : + bitDistance A σ μ=bitDistance B θ μ := by + apply Finset.sum_congr rfl + intro i hi + apply Finset.sum_congr rfl + intro j hj + apply integral_congr_ae + filter_upwards [hAB i j,hστ] with t ht hs + simp only [ht,idealDensity,hs] +variable [DecidableEq n] +lemma bitDistance_weight {μ ν : Measure Ω} [IsFiniteMeasure μ] [IsFiniteMeasure ν] + (hμν : μ≪ν) (A : Fin 2 → Fin 2 → Ω → Mat n) (σ : Ω → Mat n) : + bitDistance (fun i j t => (densityWeight μ ν t : ℂ) • A i j t) + (fun t => (densityWeight μ ν t : ℂ) • σ t) ν=bitDistance A σ μ := by + apply Finset.sum_congr rfl + intro i hi + apply Finset.sum_congr rfl + intro j hj + have he (t : Ω) : idealDensity (fun t => (densityWeight μ ν t : ℂ) • σ t) i j t= + (densityWeight μ ν t : ℂ) • idealDensity σ i j t := by + unfold idealDensity halfDensity + split_ifs <;> simp only [smul_zero,smul_smul,mul_comm] + simp only [he,← smul_sub] + exact densityWeight_traceNorm_integral μ ν hμν (fun t => A i j t-idealDensity σ i j t) + +theorem bitLawDistance_change (A : Fin 2 → Fin 2 → PositiveMatrixMeasure Ω n) + (σ : PositiveMatrixMeasure Ω n) {μ ν : Measure Ω} [IsFiniteMeasure μ] [IsFiniteMeasure ν] + (hA : ∀ i j, (A i j).traceMeasure≪μ) (hσ : σ.traceMeasure≪μ) (hμν : μ≪ν) : + bitDistance (fun i j => (A i j).positiveDensity ν) (σ.positiveDensity ν) ν= + bitDistance (fun i j => (A i j).positiveDensity μ) (σ.positiveDensity μ) μ := by + rw [← bitDistance_weight hμν] + exact bitDistance_congr_ae (fun i j => ((A i j).positiveDensity_change (hA i j) hμν).symm) + (σ.positiveDensity_change hσ hμν).symm + +end SecretKey + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/MatrixFamilyDensity.lean b/lean/OAI/InformationTheory/Entanglement/MatrixFamilyDensity.lean new file mode 100644 index 0000000000000000000000000000000000000000..ca158f5b2f176adb9211cb251513d40d5115f47d --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/MatrixFamilyDensity.lean @@ -0,0 +1,74 @@ +import OAI.InformationTheory.Entanglement.MatrixTraceMeasure + +namespace OAI + +noncomputable section +open scoped BigOperators ComplexOrder MatrixOrder ENNReal MeasureTheory Matrix.Norms.L2Operator +open Matrix MeasureTheory Filter +attribute [local instance] Classical.propDecidable +namespace SecretKey +open ChannelCompletion +variable {Ω : Type*} [MeasurableSpace Ω] {n : Type} [Fintype n] +variable {ι : Type*} [Fintype ι] + +def familyTraceMeasure (W : ι → PositiveMatrixMeasure Ω n) : Measure Ω := + ∑ a, (W a).traceMeasure +instance familyTraceMeasureIsFiniteMeasure (W : ι → PositiveMatrixMeasure Ω n) : + IsFiniteMeasure (familyTraceMeasure W) := by + unfold familyTraceMeasure + infer_instance +lemma trace_absolutelyContinuous_family (W : ι → PositiveMatrixMeasure Ω n) (a : ι) : + (W a).traceMeasure ≪ familyTraceMeasure W := by + apply Measure.absolutelyContinuous_of_le + exact Finset.single_le_sum (f := fun i => (W i).traceMeasure) + (fun i _ => by exact bot_le) (Finset.mem_univ a) +lemma familyTraceMeasure_real (W : ι → PositiveMatrixMeasure Ω n) (s : Set Ω) : + (familyTraceMeasure W).real s=∑ a, (W a).traceMeasure.real s := by + simp only [familyTraceMeasure,measureReal_def,Measure.coe_finsetSum,Finset.sum_apply] + exact ENNReal.toReal_sum (fun a _ => measure_ne_top _ _) + +def familyDensity (W : ι → PositiveMatrixMeasure Ω n) (a : ι) : Ω → Mat n := + (W a).positiveDensity (familyTraceMeasure W) +lemma familyDensity_psd (W : ι → PositiveMatrixMeasure Ω n) (a : ι) (t : Ω) : + (familyDensity W a t).PosSemidef := (W a).positiveDensity_psd _ _ +lemma familyDensity_measurable [DecidableEq n] (W : ι → PositiveMatrixMeasure Ω n) (a : ι) : + Measurable (familyDensity W a) := (W a).positiveDensity_measurable _ +lemma familyDensity_integrable (W : ι → PositiveMatrixMeasure Ω n) (a : ι) (i j : n) : + Integrable (fun t => familyDensity W a t i j) (familyTraceMeasure W) := + (W a).positiveDensity_integrable (trace_absolutelyContinuous_family W a) i j +lemma familyDensity_trace_integrable (W : ι → PositiveMatrixMeasure Ω n) (a : ι) : + Integrable (fun t => (Matrix.trace (familyDensity W a t)).re) (familyTraceMeasure W) := + (W a).positiveDensity_trace_integrable (trace_absolutelyContinuous_family W a) +lemma familyDensity_setIntegral (W : ι → PositiveMatrixMeasure Ω n) (a : ι) + {s : Set Ω} (hs : MeasurableSet s) (i j : n) : + (∫ t in s, familyDensity W a t i j ∂familyTraceMeasure W)=(W a).value s i j := + (W a).positiveDensity_setIntegral (trace_absolutelyContinuous_family W a) hs i j +lemma familyDensity_trace_setIntegral (W : ι → PositiveMatrixMeasure Ω n) (a : ι) + {s : Set Ω} (hs : MeasurableSet s) : + (∫ t in s, (Matrix.trace (familyDensity W a t)).re ∂familyTraceMeasure W)= + (W a).traceMeasure.real s := + (W a).positiveDensity_trace_setIntegral (trace_absolutelyContinuous_family W a) hs + +theorem familyDensity_trace_sum_one (W : ι → PositiveMatrixMeasure Ω n) : + ∀ᵐ t ∂familyTraceMeasure W, (∑ a, (Matrix.trace (familyDensity W a t)).re)=1 := by + refine Integrable.ae_eq_of_forall_setIntegral_eq _ _ + (integrable_finsetSum _ (fun a _ => familyDensity_trace_integrable W a)) + (integrable_const (1 : ℝ)) ?_ + intro s hs _ + rw [integral_finsetSum _ (fun a _ => (familyDensity_trace_integrable W a).integrableOn)] + simp_rw [familyDensity_trace_setIntegral W _ hs] + rw [← familyTraceMeasure_real] + simp +lemma familyDensity_total_integral (W : ι → PositiveMatrixMeasure Ω n) : + (∑ a, ∫ t, (Matrix.trace (familyDensity W a t)).re ∂familyTraceMeasure W)= + (familyTraceMeasure W).real Set.univ := by + rw [familyTraceMeasure_real] + apply Finset.sum_congr rfl + intro a _ + simpa using familyDensity_trace_setIntegral W a MeasurableSet.univ + +end SecretKey + +end + +end OAI diff --git a/lean/OAI/InformationTheory/Entanglement/MatrixMeasurability.lean b/lean/OAI/InformationTheory/Entanglement/MatrixMeasurability.lean new file mode 100644 index 0000000000000000000000000000000000000000..433eac4b31c499d74cf210177ce61e2e54ea54df --- /dev/null +++ b/lean/OAI/InformationTheory/Entanglement/MatrixMeasurability.lean @@ -0,0 +1,15 @@ +import Mathlib + +namespace OAI + +noncomputable section +instance matMeas (n m : Type*) : MeasurableSpace (Matrix n m ℂ) := borel _ +instance matBorel (n m : Type*) : BorelSpace (Matrix n m ℂ) := ⟨rfl⟩ +variable {n : Type} + +lemma matrix_sub_continuous : Continuous (fun x : Matrix n n ℂ × Matrix n n ℂ => x.1-x.2) := by fun_prop +open scoped Matrix.Norms.L2Operator + +end + +end OAI